-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create
PScopedNotification
(#4892)
Signed-off-by: yuda <[email protected]>
- Loading branch information
Showing
4 changed files
with
559 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
packages/mirinae/src/feedbacks/scoped-notification/PScopedNotification.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{/* ScopedNotification.mdx */} | ||
|
||
import {Canvas, Meta, Controls} from '@storybook/blocks'; | ||
|
||
import * as PScopedNotificationStories from './PScopedNotification.stories'; | ||
|
||
<Meta of={PScopedNotificationStories}/> | ||
|
||
|
||
# ScopedNotification | ||
|
||
<br/> | ||
<br/> | ||
|
||
## Basic | ||
<Canvas of={PScopedNotificationStories.Basic}/> | ||
|
||
## Type | ||
<Canvas of={PScopedNotificationStories.Type}/> | ||
|
||
## Layout | ||
<Canvas of={PScopedNotificationStories.Layout}/> | ||
|
||
## Icon | ||
<Canvas of={PScopedNotificationStories.Icon}/> | ||
|
||
## Title | ||
<Canvas of={PScopedNotificationStories.Title}/> | ||
|
||
## Close Button | ||
<Canvas of={PScopedNotificationStories.CloseButton}/> | ||
|
||
## Playground | ||
<Canvas of={PScopedNotificationStories.Playground}/> | ||
<Controls of={PScopedNotificationStories.Playground}/> | ||
|
||
<br/> | ||
<br/> |
219 changes: 219 additions & 0 deletions
219
packages/mirinae/src/feedbacks/scoped-notification/PScopedNotification.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
import type { Meta, StoryObj } from '@storybook/vue'; | ||
import type { ComponentProps } from 'vue-component-type-helpers'; | ||
|
||
import { | ||
getScopedNotificationArgs, getScopedNotificationArgTypes, getScopedNotificationParameters, | ||
} from '@/feedbacks/scoped-notification/story-helper'; | ||
|
||
import PScopedNotification from './PScopedNotification.vue'; | ||
|
||
|
||
|
||
type ScopedNotificationPropsAndCustomArgs = ComponentProps<typeof PScopedNotification>; | ||
|
||
const meta: Meta<ScopedNotificationPropsAndCustomArgs> = { | ||
title: 'Feedbacks/Scoped Notification', | ||
component: PScopedNotification, | ||
argTypes: { | ||
...getScopedNotificationArgTypes(), | ||
}, | ||
parameters: { | ||
...getScopedNotificationParameters(), | ||
}, | ||
args: { | ||
...getScopedNotificationArgs(), | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof PScopedNotification>; | ||
|
||
|
||
const Template: Story = { | ||
render: (args, { argTypes }) => ({ | ||
props: Object.keys(argTypes), | ||
components: { PScopedNotification }, | ||
template: ` | ||
<p-scoped-notification v-bind="$props"></p-scoped-notification> | ||
`, | ||
}), | ||
}; | ||
|
||
export const Basic: Story = { | ||
render: () => ({ | ||
components: { PScopedNotification }, | ||
template: ` | ||
<div> | ||
<p-scoped-notification type="information" | ||
layout="full-width" | ||
icon="ic_info-circle" | ||
title="Title" | ||
:visible="true" | ||
> | ||
<template #default> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | ||
</template> | ||
<template #right> | ||
right slot | ||
</template> | ||
</p-scoped-notification> | ||
</div> | ||
`, | ||
setup() { | ||
return {}; | ||
}, | ||
}), | ||
}; | ||
|
||
export const Type: Story = { | ||
render: () => ({ | ||
components: { PScopedNotification }, | ||
template: ` | ||
<div> | ||
<template v-for="type in ['information', 'danger', 'warning', 'success', 'discovery', 'tip']"> | ||
<p>{{ type }}</p> | ||
<p-scoped-notification | ||
:key="type" | ||
:type="type" | ||
layout="full-width" | ||
icon="ic_error-filled" | ||
title="Title" | ||
:visible="true" | ||
class="mb-4" | ||
> | ||
<template #default> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | ||
</template> | ||
<template #right> | ||
right slot | ||
</template> | ||
</p-scoped-notification> | ||
</template> | ||
</div> | ||
`, | ||
setup() { | ||
return {}; | ||
}, | ||
}), | ||
}; | ||
|
||
export const Layout: Story = { | ||
render: () => ({ | ||
components: { PScopedNotification }, | ||
template: ` | ||
<div> | ||
<template v-for="layout in ['full-width', 'in-section']"> | ||
<p>{{ layout }}</p> | ||
<p-scoped-notification | ||
:key="layout" | ||
:layout="layout" | ||
icon="ic_info-circle" | ||
:title="layout" | ||
:visible="true" | ||
class="mb-4" | ||
> | ||
<template #default> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | ||
</template> | ||
</p-scoped-notification> | ||
</template> | ||
</div> | ||
`, | ||
setup() { | ||
return {}; | ||
}, | ||
}), | ||
}; | ||
|
||
export const Icon: Story = { | ||
render: () => ({ | ||
components: { PScopedNotification }, | ||
template: ` | ||
<div> | ||
<template v-for="icon in ['ic_info-circle', 'ic_error-filled', 'ic_warning-filled']"> | ||
<p-scoped-notification | ||
:key="icon" | ||
layout="full-width" | ||
:icon="icon" | ||
title="Title" | ||
:visible="true" | ||
class="mb-2" | ||
/> | ||
</template> | ||
</div> | ||
`, | ||
setup() { | ||
return {}; | ||
}, | ||
}), | ||
}; | ||
|
||
export const Title: Story = { | ||
render: () => ({ | ||
components: { PScopedNotification }, | ||
template: ` | ||
<div> | ||
<p>Title</p> | ||
<p-scoped-notification | ||
layout="full-width" | ||
icon="ic_info-circle" | ||
title="Title!!" | ||
:visible="true" | ||
class="mb-4" | ||
> | ||
<template #default> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | ||
</template> | ||
</p-scoped-notification> | ||
<p>No Title</p> | ||
<p-scoped-notification | ||
layout="full-width" | ||
icon="ic_info-circle" | ||
:visible="true" | ||
> | ||
<template #default> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | ||
</template> | ||
</p-scoped-notification> | ||
</div> | ||
`, | ||
setup() { | ||
return {}; | ||
}, | ||
}), | ||
}; | ||
|
||
export const CloseButton: Story = { | ||
render: () => ({ | ||
components: { PScopedNotification }, | ||
template: ` | ||
<div> | ||
<p>No Close Button (default)</p> | ||
<p-scoped-notification | ||
layout="full-width" | ||
icon="ic_info-circle" | ||
title="Title" | ||
:visible="true" | ||
class="mb-4" | ||
> | ||
</p-scoped-notification> | ||
<p>Show Close Button</p> | ||
<p-scoped-notification | ||
layout="full-width" | ||
icon="ic_info-circle" | ||
title="Title" | ||
:visible="true" | ||
show-close-button | ||
> | ||
</p-scoped-notification> | ||
</div> | ||
`, | ||
setup() { | ||
return {}; | ||
}, | ||
}), | ||
}; | ||
|
||
export const Playground: Story = { | ||
...Template, | ||
}; |
Oops, something went wrong.