@weni/unnnic-system 3.12.3-alpha.4 → 3.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/components/Alert/Alert.vue.d.ts +3 -3
- package/dist/components/Alert/Version1dot1.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +18 -92
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +36 -184
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +2 -2
- package/dist/components/Card/AccountCard.vue.d.ts +2 -2
- package/dist/components/Card/Card.vue.d.ts +29 -103
- package/dist/components/Card/CardCompany.vue.d.ts +2 -2
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +19 -93
- package/dist/components/Card/ContentCard.vue.d.ts +1 -1
- package/dist/components/Card/DashCard.vue.d.ts +2 -2
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +1 -1
- package/dist/components/Card/SimpleCard.vue.d.ts +18 -92
- package/dist/components/Card/StatusCard.vue.d.ts +1 -1
- package/dist/components/Card/TitleCard.vue.d.ts +18 -92
- package/dist/components/CardImage/CardImage.vue.d.ts +5 -5
- package/dist/components/CardInformation/CardInformation.vue.d.ts +19 -93
- package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
- package/dist/components/Carousel/Carousel.vue.d.ts +2 -2
- package/dist/components/Carousel/TagCarousel.vue.d.ts +2 -2
- package/dist/components/ChartBar/ChartBar.vue.d.ts +24 -98
- package/dist/components/ChartLine/ChartLine.vue.d.ts +18 -92
- package/dist/components/ChatText/ChatText.vue.d.ts +18 -92
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +6 -6
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +18 -92
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
- package/dist/components/DataArea/DataArea.vue.d.ts +18 -92
- package/dist/components/DataTable/index.vue.d.ts +1 -1
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +15 -94
- package/dist/components/Disclaimer/Disclaimer.vue.d.ts +3 -6
- package/dist/components/Disclaimer/Disclaimer.vue.d.ts.map +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.vue.d.ts +8 -0
- package/dist/components/Disclaimer/DisclaimerV2.vue.d.ts.map +1 -0
- package/dist/components/Disclaimer/types-v2.d.ts +7 -0
- package/dist/components/Disclaimer/types-v2.d.ts.map +1 -0
- package/dist/components/Disclaimer/types.d.ts +3 -6
- package/dist/components/Disclaimer/types.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.vue.d.ts +207 -37
- package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/components/FormElement/FormElement.vue.d.ts +6 -6
- package/dist/components/ImportCard/ImportCard.vue.d.ts +6 -6
- package/dist/components/Input/BaseInput.vue.d.ts +0 -22
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +14 -93
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +3 -54
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputNext/InputNext.vue.d.ts +4 -4
- package/dist/components/Label/Label.vue.d.ts +1 -1
- package/dist/components/Label/Label.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +35 -209
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +20 -99
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +12 -12
- package/dist/components/MoodRating/MoodRating.vue.d.ts +18 -92
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +163 -0
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
- package/dist/components/Radio/Radio.vue.d.ts +6 -6
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +12 -63
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +2 -2
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +5 -5
- package/dist/components/SelectTime/index.vue.d.ts +4 -55
- package/dist/components/Slider/Slider.vue.d.ts +18 -92
- package/dist/components/Switch/Switch.vue.d.ts +3 -3
- package/dist/components/Tab/Tab.vue.d.ts +18 -92
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
- package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +2 -2
- package/dist/components/TextArea/TextArea.vue.d.ts +8 -8
- package/dist/components/Toast/Toast.vue.d.ts +1 -1
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/ToolTip/ToolTip.vue.d.ts +18 -92
- package/dist/components/ToolTip/ToolTip.vue.d.ts.map +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +6 -6
- package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
- package/dist/components/UploadArea/UploadArea.vue.d.ts +6 -6
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/components/ui/popover/PopoverOption.vue.d.ts +1 -1
- package/dist/components/ui/popover/PopoverOption.vue.d.ts.map +1 -1
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +1 -1
- package/dist/{es-e4e4f53d.mjs → es-c19444c0.mjs} +1 -1
- package/dist/{index-492e2532.mjs → index-93b45359.mjs} +51889 -54730
- package/dist/locales/en.json.d.ts +1 -3
- package/dist/locales/es.json.d.ts +1 -3
- package/dist/locales/pt_br.json.d.ts +1 -3
- package/dist/{pt-br-ac2463c3.mjs → pt-br-23dc9ca6.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +206 -234
- package/dist/unnnic.umd.js +44 -48
- package/package.json +2 -3
- package/src/assets/scss/scheme-colors.scss +223 -223
- package/src/assets/scss/tailwind.scss +0 -8
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/Disclaimer/Disclaimer.vue +42 -136
- package/src/components/Disclaimer/DisclaimerV2.vue +171 -0
- package/src/components/Disclaimer/__tests__/Disclaimer.spec.js +45 -70
- package/src/components/Disclaimer/__tests__/DisclaimerV2.spec.js +68 -0
- package/src/components/Disclaimer/types-v2.ts +12 -0
- package/src/components/Disclaimer/types.ts +3 -12
- package/src/components/Drawer/Drawer.vue +269 -190
- package/src/components/Drawer/__tests__/Drawer.spec.js +46 -37
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
- package/src/components/Input/BaseInput.vue +2 -21
- package/src/components/Input/Input.scss +3 -2
- package/src/components/Input/Input.vue +1 -19
- package/src/components/Input/TextInput.vue +22 -58
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +1 -5
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -7
- package/src/components/ModalDialog/ModalDialog.vue +148 -64
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +221 -11
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
- package/src/components/MultiSelect/MultiSelect.vue +297 -0
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
- package/src/components/Toast/Toast.vue +9 -16
- package/src/components/ToolTip/ToolTip.vue +177 -25
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
- package/src/components/index.ts +11 -63
- package/src/components/ui/popover/PopoverContent.vue +2 -19
- package/src/components/ui/popover/PopoverOption.vue +0 -4
- package/src/components/ui/popover/PopoverTrigger.vue +1 -5
- package/src/locales/en.json +1 -3
- package/src/locales/es.json +1 -3
- package/src/locales/pt_br.json +1 -3
- package/src/stories/Disclaimer.stories.js +12 -53
- package/src/stories/DisclaimerV2.stories.js +51 -0
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/ModalDialog.mdx +0 -3
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/MultiSelect.stories.js +46 -142
- package/dist/components/MultiSelect/MultSelectOption.vue.d.ts +0 -17
- package/dist/components/MultiSelect/MultSelectOption.vue.d.ts.map +0 -1
- package/dist/components/MultiSelect/index.vue.d.ts +0 -44
- package/dist/components/MultiSelect/index.vue.d.ts.map +0 -1
- package/dist/components/Select/index.vue.d.ts +0 -44
- package/dist/components/Select/index.vue.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -23750
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -23
- package/dist/components/ui/dialog/Dialog.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -21
- package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -43
- package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -25
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -29
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -23
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -19
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/index.d.ts +0 -8
- package/dist/components/ui/dialog/index.d.ts.map +0 -1
- package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -35
- package/dist/components/ui/drawer/Drawer.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts +0 -21
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -43
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -23
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -22
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -25
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -8
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -23
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +0 -19
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/index.d.ts +0 -11
- package/dist/components/ui/drawer/index.d.ts.map +0 -1
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +0 -23
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +0 -31
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +0 -19
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/index.d.ts +0 -4
- package/dist/components/ui/tooltip/index.d.ts.map +0 -1
- package/dist/lib/layer-manager.d.ts +0 -16
- package/dist/lib/layer-manager.d.ts.map +0 -1
- package/src/components/MultiSelect/MultSelectOption.vue +0 -49
- package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +0 -556
- package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +0 -229
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +0 -87
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +0 -51
- package/src/components/MultiSelect/index.vue +0 -224
- package/src/components/Select/__tests__/Select.spec.js +0 -422
- package/src/components/Select/__tests__/SelectItem.spec.js +0 -330
- package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +0 -8
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +0 -71
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +0 -15
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +0 -25
- package/src/components/Select/__tests__/__snapshots__/SelectPopover.spec.js.snap +0 -8
- package/src/components/Select/index.vue +0 -297
- package/src/components/ui/dialog/Dialog.vue +0 -19
- package/src/components/ui/dialog/DialogClose.vue +0 -29
- package/src/components/ui/dialog/DialogContent.vue +0 -140
- package/src/components/ui/dialog/DialogFooter.vue +0 -50
- package/src/components/ui/dialog/DialogHeader.vue +0 -83
- package/src/components/ui/dialog/DialogTitle.vue +0 -38
- package/src/components/ui/dialog/DialogTrigger.vue +0 -16
- package/src/components/ui/dialog/index.ts +0 -7
- package/src/components/ui/drawer/Drawer.vue +0 -27
- package/src/components/ui/drawer/DrawerClose.vue +0 -31
- package/src/components/ui/drawer/DrawerContent.vue +0 -111
- package/src/components/ui/drawer/DrawerDescription.vue +0 -40
- package/src/components/ui/drawer/DrawerFooter.vue +0 -38
- package/src/components/ui/drawer/DrawerHeader.vue +0 -57
- package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
- package/src/components/ui/drawer/DrawerTitle.vue +0 -37
- package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
- package/src/components/ui/drawer/index.ts +0 -10
- package/src/components/ui/tooltip/Tooltip.vue +0 -21
- package/src/components/ui/tooltip/TooltipContent.vue +0 -74
- package/src/components/ui/tooltip/TooltipTrigger.vue +0 -26
- package/src/components/ui/tooltip/index.ts +0 -3
- package/src/lib/layer-manager.ts +0 -92
- package/src/stories/Dialog.stories.js +0 -832
- package/src/stories/DrawerNext.stories.js +0 -611
- package/src/stories/LayerManager.docs.mdx +0 -40
- package/src/stories/LayerManager.stories.js +0 -364
- package/src/stories/Select.stories.js +0 -158
|
@@ -1,611 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Drawer,
|
|
3
|
-
DrawerContent,
|
|
4
|
-
DrawerTrigger,
|
|
5
|
-
DrawerHeader,
|
|
6
|
-
DrawerTitle,
|
|
7
|
-
DrawerDescription,
|
|
8
|
-
DrawerFooter,
|
|
9
|
-
DrawerClose,
|
|
10
|
-
} from '../components/ui/drawer';
|
|
11
|
-
import UnnnicButton from '../components/Button/Button.vue';
|
|
12
|
-
|
|
13
|
-
const drawerContent = () => `
|
|
14
|
-
<DrawerHeader>
|
|
15
|
-
<DrawerTitle>Drawer Title</DrawerTitle>
|
|
16
|
-
<DrawerDescription>This is a description of the drawer content.</DrawerDescription>
|
|
17
|
-
</DrawerHeader>
|
|
18
|
-
<section style="padding: 24px;">
|
|
19
|
-
<p style="margin: 0;">
|
|
20
|
-
This is the content of the drawer. You can add any content here, including forms,
|
|
21
|
-
text, images, or other components. The drawer slides in from the right side of the screen.
|
|
22
|
-
</p>
|
|
23
|
-
</section>
|
|
24
|
-
<DrawerFooter>
|
|
25
|
-
<DrawerClose>
|
|
26
|
-
<UnnnicButton text="Cancel" type="tertiary" />
|
|
27
|
-
</DrawerClose>
|
|
28
|
-
<UnnnicButton text="Confirm" type="primary" />
|
|
29
|
-
</DrawerFooter>
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
export default {
|
|
33
|
-
title: 'Misc/DrawerNext',
|
|
34
|
-
component: Drawer,
|
|
35
|
-
tags: ['autodocs'],
|
|
36
|
-
parameters: {
|
|
37
|
-
docs: {
|
|
38
|
-
description: {
|
|
39
|
-
component: `**Transitional component to replace the [Drawer](?path=/docs/misc-drawer--default) in the future.**
|
|
40
|
-
<br/>
|
|
41
|
-
<br/>
|
|
42
|
-
A drawer component that slides in from the right side of the screen, displaying content in a portal.
|
|
43
|
-
<br/>
|
|
44
|
-
Built on top of Vaul Vue, it provides a modern and accessible way to display drawer panels.
|
|
45
|
-
<br/>
|
|
46
|
-
Supports four sizes (medium, large, extra-large, giant) and can be controlled via the "open" prop for programmatic control.
|
|
47
|
-
<br/>
|
|
48
|
-
API reference: https://github.com/unovue/vaul-vue
|
|
49
|
-
`,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
argTypes: {
|
|
54
|
-
size: {
|
|
55
|
-
control: { type: 'select' },
|
|
56
|
-
options: ['medium', 'large', 'extra-large', 'giant'],
|
|
57
|
-
defaultValue: {
|
|
58
|
-
summary: 'medium',
|
|
59
|
-
},
|
|
60
|
-
description: 'The size of the drawer',
|
|
61
|
-
},
|
|
62
|
-
showOverlay: {
|
|
63
|
-
control: { type: 'boolean' },
|
|
64
|
-
defaultValue: {
|
|
65
|
-
summary: 'true',
|
|
66
|
-
},
|
|
67
|
-
description: 'Whether to show the overlay background',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
args: {
|
|
71
|
-
size: 'medium',
|
|
72
|
-
showOverlay: true,
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const Default = {
|
|
77
|
-
parameters: {
|
|
78
|
-
docs: {
|
|
79
|
-
description: {
|
|
80
|
-
story:
|
|
81
|
-
'Default drawer with header, description, body content, and footer with action buttons.',
|
|
82
|
-
},
|
|
83
|
-
source: {
|
|
84
|
-
code: `<UnnnicDrawerNext>
|
|
85
|
-
<UnnnicDrawerTrigger>
|
|
86
|
-
<UnnnicButton text="Open Drawer" />
|
|
87
|
-
</UnnnicDrawerTrigger>
|
|
88
|
-
<UnnnicDrawerContent>
|
|
89
|
-
<UnnnicDrawerHeader>
|
|
90
|
-
<UnnnicDrawerTitle>Drawer Title</UnnnicDrawerTitle>
|
|
91
|
-
<UnnnicDrawerDescription>This is a description of the drawer content.</UnnnicDrawerDescription>
|
|
92
|
-
</UnnnicDrawerHeader>
|
|
93
|
-
<section style="padding: 24px;">
|
|
94
|
-
<p>This is the content of the drawer.</p>
|
|
95
|
-
</section>
|
|
96
|
-
<UnnnicDrawerFooter>
|
|
97
|
-
<UnnnicDrawerClose>
|
|
98
|
-
<UnnnicButton text="Cancel" type="tertiary" />
|
|
99
|
-
</UnnnicDrawerClose>
|
|
100
|
-
<UnnnicButton text="Confirm" type="primary" />
|
|
101
|
-
</UnnnicDrawerFooter>
|
|
102
|
-
</UnnnicDrawerContent>
|
|
103
|
-
</UnnnicDrawerNext>`,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
render: (args) => ({
|
|
108
|
-
components: {
|
|
109
|
-
Drawer,
|
|
110
|
-
DrawerContent,
|
|
111
|
-
DrawerTrigger,
|
|
112
|
-
DrawerHeader,
|
|
113
|
-
DrawerTitle,
|
|
114
|
-
DrawerDescription,
|
|
115
|
-
DrawerFooter,
|
|
116
|
-
DrawerClose,
|
|
117
|
-
UnnnicButton,
|
|
118
|
-
},
|
|
119
|
-
setup() {
|
|
120
|
-
return { args };
|
|
121
|
-
},
|
|
122
|
-
template: `
|
|
123
|
-
<Drawer>
|
|
124
|
-
<DrawerTrigger>
|
|
125
|
-
<UnnnicButton text="Open Drawer" />
|
|
126
|
-
</DrawerTrigger>
|
|
127
|
-
<DrawerContent v-bind="args">
|
|
128
|
-
<DrawerHeader>
|
|
129
|
-
<DrawerTitle>Drawer Title</DrawerTitle>
|
|
130
|
-
<DrawerDescription>This is a description of the drawer content.</DrawerDescription>
|
|
131
|
-
</DrawerHeader>
|
|
132
|
-
<section style="padding: 24px;">
|
|
133
|
-
<p style="margin: 0;">
|
|
134
|
-
This is the content of the drawer. You can add any content here, including forms,
|
|
135
|
-
text, images, or other components. The drawer slides in from the right side of the screen.
|
|
136
|
-
</p>
|
|
137
|
-
</section>
|
|
138
|
-
<DrawerFooter>
|
|
139
|
-
<DrawerClose>
|
|
140
|
-
<UnnnicButton text="Cancel" type="tertiary" />
|
|
141
|
-
</DrawerClose>
|
|
142
|
-
<UnnnicButton text="Confirm" type="primary" />
|
|
143
|
-
</DrawerFooter>
|
|
144
|
-
</DrawerContent>
|
|
145
|
-
</Drawer>
|
|
146
|
-
`,
|
|
147
|
-
}),
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const Sizes = {
|
|
151
|
-
parameters: {
|
|
152
|
-
docs: {
|
|
153
|
-
description: {
|
|
154
|
-
story:
|
|
155
|
-
'Drawers come in four sizes: medium (33%), large (50%), extra-large (66%), and giant (75%).',
|
|
156
|
-
},
|
|
157
|
-
source: {
|
|
158
|
-
code: `<!-- Medium Drawer -->
|
|
159
|
-
<UnnnicDrawerNext>
|
|
160
|
-
...
|
|
161
|
-
<UnnnicDrawerContent size="medium">
|
|
162
|
-
...
|
|
163
|
-
</UnnnicDrawerNext>
|
|
164
|
-
|
|
165
|
-
<!-- Large Drawer -->
|
|
166
|
-
<UnnnicDrawerNext>
|
|
167
|
-
...
|
|
168
|
-
<UnnnicDrawerContent size="large">
|
|
169
|
-
...
|
|
170
|
-
</UnnnicDrawerNext>
|
|
171
|
-
|
|
172
|
-
<!-- Extra Large Drawer -->
|
|
173
|
-
<UnnnicDrawerNext>
|
|
174
|
-
...
|
|
175
|
-
<UnnnicDrawerContent size="extra-large">
|
|
176
|
-
...
|
|
177
|
-
</UnnnicDrawerNext>
|
|
178
|
-
|
|
179
|
-
<!-- Giant Drawer -->
|
|
180
|
-
<UnnnicDrawerNext>
|
|
181
|
-
...
|
|
182
|
-
<UnnnicDrawerContent size="giant">
|
|
183
|
-
...
|
|
184
|
-
</UnnnicDrawerNext>`,
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
render: (args) => ({
|
|
189
|
-
components: {
|
|
190
|
-
Drawer,
|
|
191
|
-
DrawerContent,
|
|
192
|
-
DrawerClose,
|
|
193
|
-
DrawerTrigger,
|
|
194
|
-
DrawerHeader,
|
|
195
|
-
DrawerTitle,
|
|
196
|
-
DrawerDescription,
|
|
197
|
-
DrawerFooter,
|
|
198
|
-
UnnnicButton,
|
|
199
|
-
},
|
|
200
|
-
setup() {
|
|
201
|
-
return { args };
|
|
202
|
-
},
|
|
203
|
-
template: `
|
|
204
|
-
<div style="display: flex; align-items: center; gap: 16px;">
|
|
205
|
-
<Drawer>
|
|
206
|
-
<DrawerTrigger>
|
|
207
|
-
<UnnnicButton text="Medium Drawer" />
|
|
208
|
-
</DrawerTrigger>
|
|
209
|
-
<DrawerContent size="medium">
|
|
210
|
-
${drawerContent()}
|
|
211
|
-
</DrawerContent>
|
|
212
|
-
</Drawer>
|
|
213
|
-
|
|
214
|
-
<Drawer>
|
|
215
|
-
<DrawerTrigger>
|
|
216
|
-
<UnnnicButton text="Large Drawer" />
|
|
217
|
-
</DrawerTrigger>
|
|
218
|
-
<DrawerContent size="large">
|
|
219
|
-
${drawerContent()}
|
|
220
|
-
</DrawerContent>
|
|
221
|
-
</Drawer>
|
|
222
|
-
|
|
223
|
-
<Drawer>
|
|
224
|
-
<DrawerTrigger>
|
|
225
|
-
<UnnnicButton text="Extra Large Drawer" />
|
|
226
|
-
</DrawerTrigger>
|
|
227
|
-
<DrawerContent size="extra-large">
|
|
228
|
-
${drawerContent()}
|
|
229
|
-
</DrawerContent>
|
|
230
|
-
</Drawer>
|
|
231
|
-
|
|
232
|
-
<Drawer>
|
|
233
|
-
<DrawerTrigger>
|
|
234
|
-
<UnnnicButton text="Giant Drawer" />
|
|
235
|
-
</DrawerTrigger>
|
|
236
|
-
<DrawerContent size="giant">
|
|
237
|
-
${drawerContent()}
|
|
238
|
-
</DrawerContent>
|
|
239
|
-
</Drawer>
|
|
240
|
-
</div>
|
|
241
|
-
`,
|
|
242
|
-
}),
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
export const WithoutFooter = {
|
|
246
|
-
parameters: {
|
|
247
|
-
docs: {
|
|
248
|
-
description: {
|
|
249
|
-
story:
|
|
250
|
-
'Drawer without a footer. Useful for informational drawers or when actions are inline with content.',
|
|
251
|
-
},
|
|
252
|
-
source: {
|
|
253
|
-
code: `<UnnnicDrawerNext>
|
|
254
|
-
<UnnnicDrawerTrigger>
|
|
255
|
-
<UnnnicButton text="Drawer Without Footer" />
|
|
256
|
-
</UnnnicDrawerTrigger>
|
|
257
|
-
<UnnnicDrawerContent>
|
|
258
|
-
<UnnnicDrawerHeader>
|
|
259
|
-
<UnnnicDrawerTitle>Information</UnnnicDrawerTitle>
|
|
260
|
-
<UnnnicDrawerDescription>This drawer doesn't have a footer section.</UnnnicDrawerDescription>
|
|
261
|
-
</UnnnicDrawerHeader>
|
|
262
|
-
<section style="padding: 24px;">
|
|
263
|
-
<p>This is an informational drawer without a footer.</p>
|
|
264
|
-
<p>The user can close it by clicking the close button or outside the drawer.</p>
|
|
265
|
-
</section>
|
|
266
|
-
</UnnnicDrawerContent>
|
|
267
|
-
</UnnnicDrawerNext>`,
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
render: (args) => ({
|
|
272
|
-
components: {
|
|
273
|
-
Drawer,
|
|
274
|
-
DrawerContent,
|
|
275
|
-
DrawerHeader,
|
|
276
|
-
DrawerTitle,
|
|
277
|
-
DrawerDescription,
|
|
278
|
-
DrawerTrigger,
|
|
279
|
-
UnnnicButton,
|
|
280
|
-
},
|
|
281
|
-
setup() {
|
|
282
|
-
return { args };
|
|
283
|
-
},
|
|
284
|
-
template: `
|
|
285
|
-
<Drawer>
|
|
286
|
-
<DrawerTrigger>
|
|
287
|
-
<UnnnicButton text="Drawer Without Footer" />
|
|
288
|
-
</DrawerTrigger>
|
|
289
|
-
<DrawerContent v-bind="args">
|
|
290
|
-
<DrawerHeader>
|
|
291
|
-
<DrawerTitle>Information</DrawerTitle>
|
|
292
|
-
<DrawerDescription>This drawer doesn't have a footer section.</DrawerDescription>
|
|
293
|
-
</DrawerHeader>
|
|
294
|
-
<section style="padding: 24px;">
|
|
295
|
-
<p>This is an informational drawer without a footer. The user can close it by clicking the close button or outside the drawer.</p>
|
|
296
|
-
<p>This pattern is useful for simple notifications or information displays that don't require explicit actions.</p>
|
|
297
|
-
</section>
|
|
298
|
-
</DrawerContent>
|
|
299
|
-
</Drawer>
|
|
300
|
-
`,
|
|
301
|
-
}),
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
export const CustomHeaderCloseButton = {
|
|
305
|
-
parameters: {
|
|
306
|
-
docs: {
|
|
307
|
-
description: {
|
|
308
|
-
story: 'Drawer with a custom close button in the header.',
|
|
309
|
-
},
|
|
310
|
-
source: {
|
|
311
|
-
code: `<UnnnicDrawerNext>
|
|
312
|
-
<UnnnicDrawerTrigger>
|
|
313
|
-
<UnnnicButton text="Drawer With Custom Close Button" />
|
|
314
|
-
</UnnnicDrawerTrigger>
|
|
315
|
-
<UnnnicDrawerContent>
|
|
316
|
-
<UnnnicDrawerHeader>
|
|
317
|
-
<template #close>
|
|
318
|
-
<DrawerClose>
|
|
319
|
-
<UnnnicButton iconCenter="arrow_forward" size="small" type="tertiary" />
|
|
320
|
-
</DrawerClose>
|
|
321
|
-
</template>
|
|
322
|
-
<UnnnicDrawerTitle>Drawer With Custom Close Button</UnnnicDrawerTitle>
|
|
323
|
-
<UnnnicDrawerDescription>This drawer has a custom close button in the header.</UnnnicDrawerDescription>
|
|
324
|
-
</UnnnicDrawerHeader>
|
|
325
|
-
<div style="padding: 24px;">
|
|
326
|
-
<p>This drawer has a custom close button in the header. User must use footer buttons to close.</p>
|
|
327
|
-
</div>
|
|
328
|
-
</UnnnicDrawerContent>
|
|
329
|
-
</UnnnicDrawerNext>`,
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
render: (args) => ({
|
|
334
|
-
components: {
|
|
335
|
-
Drawer,
|
|
336
|
-
DrawerContent,
|
|
337
|
-
DrawerHeader,
|
|
338
|
-
DrawerTitle,
|
|
339
|
-
DrawerDescription,
|
|
340
|
-
DrawerTrigger,
|
|
341
|
-
DrawerFooter,
|
|
342
|
-
DrawerClose,
|
|
343
|
-
UnnnicButton,
|
|
344
|
-
},
|
|
345
|
-
setup() {
|
|
346
|
-
return { args };
|
|
347
|
-
},
|
|
348
|
-
template: `
|
|
349
|
-
<Drawer>
|
|
350
|
-
<DrawerTrigger>
|
|
351
|
-
<UnnnicButton text="Drawer With Custom Close Button" />
|
|
352
|
-
</DrawerTrigger>
|
|
353
|
-
<DrawerContent v-bind="args">
|
|
354
|
-
<DrawerHeader>
|
|
355
|
-
<template #close>
|
|
356
|
-
<DrawerClose>
|
|
357
|
-
<UnnnicButton iconCenter="arrow_forward" size="small" type="tertiary" />
|
|
358
|
-
</DrawerClose>
|
|
359
|
-
</template>
|
|
360
|
-
<DrawerTitle>Drawer With Custom Close Button</DrawerTitle>
|
|
361
|
-
<DrawerDescription>This drawer has a custom close button in the header.</DrawerDescription>
|
|
362
|
-
</DrawerHeader>
|
|
363
|
-
<section style="padding: 24px;">
|
|
364
|
-
<p>
|
|
365
|
-
This drawer has a custom close button in the header. The user must interact with the footer buttons to close the drawer.
|
|
366
|
-
</p>
|
|
367
|
-
</section>
|
|
368
|
-
</DrawerContent>
|
|
369
|
-
</Drawer>
|
|
370
|
-
`,
|
|
371
|
-
}),
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
export const ControlledOpen = {
|
|
375
|
-
parameters: {
|
|
376
|
-
docs: {
|
|
377
|
-
description: {
|
|
378
|
-
story: `Drawer controlled by the "open" prop. This allows you to programmatically open and close the drawer.
|
|
379
|
-
<br/>
|
|
380
|
-
Use v-model:open to bind the open state to a reactive variable in your component.`,
|
|
381
|
-
},
|
|
382
|
-
source: {
|
|
383
|
-
code: `<script setup>
|
|
384
|
-
import { ref } from 'vue';
|
|
385
|
-
|
|
386
|
-
const isOpen = ref(false);
|
|
387
|
-
|
|
388
|
-
const openDrawer = () => {
|
|
389
|
-
isOpen.value = true;
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
const closeDrawer = () => {
|
|
393
|
-
isOpen.value = false;
|
|
394
|
-
};
|
|
395
|
-
</script>
|
|
396
|
-
|
|
397
|
-
<template>
|
|
398
|
-
<section>
|
|
399
|
-
<UnnnicButton text="Open Drawer" @click="openDrawer" />
|
|
400
|
-
|
|
401
|
-
<UnnnicDrawerNext v-model:open="isOpen">
|
|
402
|
-
<UnnnicDrawerContent>
|
|
403
|
-
<UnnnicDrawerHeader>
|
|
404
|
-
<UnnnicDrawerTitle>Controlled Drawer</UnnnicDrawerTitle>
|
|
405
|
-
<UnnnicDrawerDescription>This drawer is controlled by the "open" prop.</UnnnicDrawerDescription>
|
|
406
|
-
</UnnnicDrawerHeader>
|
|
407
|
-
<div style="padding: 24px;">
|
|
408
|
-
<p>This drawer is controlled by the "open" prop.</p>
|
|
409
|
-
</div>
|
|
410
|
-
</UnnnicDrawerContent>
|
|
411
|
-
</UnnnicDrawerNext>
|
|
412
|
-
</section>
|
|
413
|
-
</template>`,
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
render: (args) => ({
|
|
418
|
-
components: {
|
|
419
|
-
Drawer,
|
|
420
|
-
DrawerContent,
|
|
421
|
-
DrawerFooter,
|
|
422
|
-
DrawerHeader,
|
|
423
|
-
DrawerTitle,
|
|
424
|
-
DrawerDescription,
|
|
425
|
-
UnnnicButton,
|
|
426
|
-
DrawerClose,
|
|
427
|
-
},
|
|
428
|
-
setup() {
|
|
429
|
-
return { args };
|
|
430
|
-
},
|
|
431
|
-
data() {
|
|
432
|
-
return {
|
|
433
|
-
isOpen: false,
|
|
434
|
-
};
|
|
435
|
-
},
|
|
436
|
-
methods: {
|
|
437
|
-
openDrawer() {
|
|
438
|
-
this.isOpen = true;
|
|
439
|
-
},
|
|
440
|
-
closeDrawer() {
|
|
441
|
-
this.isOpen = false;
|
|
442
|
-
},
|
|
443
|
-
},
|
|
444
|
-
template: `
|
|
445
|
-
<div style="display: flex; justify-content: center; align-items: center; gap: 16px; flex-direction: column;">
|
|
446
|
-
<div style="display: flex; gap: 16px;">
|
|
447
|
-
<UnnnicButton text="Open Drawer" @click="openDrawer" />
|
|
448
|
-
</div>
|
|
449
|
-
|
|
450
|
-
<p style="margin: 0; color: #67738B;">Drawer is currently: <strong>{{ isOpen ? 'OPEN' : 'CLOSED' }}</strong></p>
|
|
451
|
-
|
|
452
|
-
<Drawer v-model:open="isOpen">
|
|
453
|
-
<DrawerContent v-bind="args">
|
|
454
|
-
<DrawerHeader>
|
|
455
|
-
<DrawerTitle>Controlled Drawer</DrawerTitle>
|
|
456
|
-
<DrawerDescription>This drawer is controlled by the "open" prop.</DrawerDescription>
|
|
457
|
-
</DrawerHeader>
|
|
458
|
-
<div style="padding: 24px; flex: 1; overflow-y: auto;">
|
|
459
|
-
<p style="margin: 0; color: #67738B;">
|
|
460
|
-
This drawer is controlled by the "open" prop. You can open and close it programmatically using the buttons.
|
|
461
|
-
</p>
|
|
462
|
-
</div>
|
|
463
|
-
</DrawerContent>
|
|
464
|
-
</Drawer>
|
|
465
|
-
</div>
|
|
466
|
-
`,
|
|
467
|
-
}),
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
export const LongContent = {
|
|
471
|
-
parameters: {
|
|
472
|
-
docs: {
|
|
473
|
-
description: {
|
|
474
|
-
story:
|
|
475
|
-
'Drawer with scrollable content. The drawer body will scroll when content exceeds the viewport height.',
|
|
476
|
-
},
|
|
477
|
-
source: {
|
|
478
|
-
code: `<UnnnicDrawerNext>
|
|
479
|
-
<UnnnicDrawerTrigger>
|
|
480
|
-
<UnnnicButton text="Long Content Drawer" />
|
|
481
|
-
</UnnnicDrawerTrigger>
|
|
482
|
-
<UnnnicDrawerContent>
|
|
483
|
-
<UnnnicDrawerHeader>
|
|
484
|
-
<UnnnicDrawerTitle>Terms and Conditions</UnnnicDrawerTitle>
|
|
485
|
-
<UnnnicDrawerDescription>Please read the following terms carefully.</UnnnicDrawerDescription>
|
|
486
|
-
</UnnnicDrawerHeader>
|
|
487
|
-
<div style="padding: 24px; flex: 1; overflow-y: auto;">
|
|
488
|
-
<!-- Your long content here -->
|
|
489
|
-
<div v-for="i in 10" :key="i">
|
|
490
|
-
<h4>Section {{ i }}</h4>
|
|
491
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit...</p>
|
|
492
|
-
</div>
|
|
493
|
-
</div>
|
|
494
|
-
<UnnnicDrawerFooter>
|
|
495
|
-
<UnnnicButton text="Cancel" type="tertiary" />
|
|
496
|
-
<UnnnicButton text="Confirm" type="primary" />
|
|
497
|
-
</UnnnicDrawerFooter>
|
|
498
|
-
</UnnnicDrawerContent>
|
|
499
|
-
</UnnnicDrawerNext>`,
|
|
500
|
-
},
|
|
501
|
-
},
|
|
502
|
-
},
|
|
503
|
-
render: (args) => ({
|
|
504
|
-
components: {
|
|
505
|
-
Drawer,
|
|
506
|
-
DrawerContent,
|
|
507
|
-
DrawerFooter,
|
|
508
|
-
DrawerHeader,
|
|
509
|
-
DrawerTitle,
|
|
510
|
-
DrawerDescription,
|
|
511
|
-
DrawerTrigger,
|
|
512
|
-
UnnnicButton,
|
|
513
|
-
DrawerClose,
|
|
514
|
-
},
|
|
515
|
-
setup() {
|
|
516
|
-
return { args };
|
|
517
|
-
},
|
|
518
|
-
template: `
|
|
519
|
-
<Drawer>
|
|
520
|
-
<DrawerTrigger>
|
|
521
|
-
<UnnnicButton text="Long Content Drawer" />
|
|
522
|
-
</DrawerTrigger>
|
|
523
|
-
<DrawerContent v-bind="args">
|
|
524
|
-
<DrawerHeader>
|
|
525
|
-
<DrawerTitle>Terms and Conditions</DrawerTitle>
|
|
526
|
-
<DrawerDescription>Please read the following terms carefully.</DrawerDescription>
|
|
527
|
-
</DrawerHeader>
|
|
528
|
-
<div style="padding: 24px; flex: 1; overflow-y: auto;">
|
|
529
|
-
<div v-for="i in 10" :key="i" style="margin-bottom: 16px;">
|
|
530
|
-
<h4 style="margin: 0 0 8px 0; color: #272B33;">Section {{ i }}</h4>
|
|
531
|
-
<p style="margin: 0; color: #67738B; line-height: 1.6;">
|
|
532
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
533
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
534
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
535
|
-
</p>
|
|
536
|
-
</div>
|
|
537
|
-
</div>
|
|
538
|
-
<DrawerFooter>
|
|
539
|
-
<DrawerClose>
|
|
540
|
-
<UnnnicButton text="Cancel" type="tertiary" />
|
|
541
|
-
</DrawerClose>
|
|
542
|
-
<UnnnicButton text="Confirm" type="primary" />
|
|
543
|
-
</DrawerFooter>
|
|
544
|
-
</DrawerContent>
|
|
545
|
-
</Drawer>
|
|
546
|
-
`,
|
|
547
|
-
}),
|
|
548
|
-
};
|
|
549
|
-
|
|
550
|
-
export const WithoutOverlay = {
|
|
551
|
-
parameters: {
|
|
552
|
-
docs: {
|
|
553
|
-
description: {
|
|
554
|
-
story: `Drawer without overlay background. Useful when nesting drawers or when you want to allow interaction with the page behind.
|
|
555
|
-
<br/>
|
|
556
|
-
It is recommended to use this variation for contexts where the drawer is used with another drawer or modal.`,
|
|
557
|
-
},
|
|
558
|
-
source: {
|
|
559
|
-
code: `<UnnnicDrawerNext>
|
|
560
|
-
<UnnnicDrawerTrigger>
|
|
561
|
-
<UnnnicButton text="Drawer Without Overlay" />
|
|
562
|
-
</UnnnicDrawerTrigger>
|
|
563
|
-
<UnnnicDrawerContent :showOverlay="false">
|
|
564
|
-
<UnnnicDrawerHeader>
|
|
565
|
-
<UnnnicDrawerTitle>Drawer Without Overlay</UnnnicDrawerTitle>
|
|
566
|
-
<UnnnicDrawerDescription>This drawer doesn't have a background overlay.</UnnnicDrawerDescription>
|
|
567
|
-
</UnnnicDrawerHeader>
|
|
568
|
-
<div style="padding: 24px;">
|
|
569
|
-
<p>You can interact with the page behind this drawer.</p>
|
|
570
|
-
</div>
|
|
571
|
-
</UnnnicDrawerContent>
|
|
572
|
-
</UnnnicDrawerNext>`,
|
|
573
|
-
},
|
|
574
|
-
},
|
|
575
|
-
},
|
|
576
|
-
render: (args) => ({
|
|
577
|
-
components: {
|
|
578
|
-
Drawer,
|
|
579
|
-
DrawerContent,
|
|
580
|
-
DrawerTrigger,
|
|
581
|
-
DrawerHeader,
|
|
582
|
-
DrawerTitle,
|
|
583
|
-
DrawerDescription,
|
|
584
|
-
DrawerFooter,
|
|
585
|
-
UnnnicButton,
|
|
586
|
-
DrawerClose,
|
|
587
|
-
},
|
|
588
|
-
setup() {
|
|
589
|
-
return { args };
|
|
590
|
-
},
|
|
591
|
-
template: `
|
|
592
|
-
<Drawer>
|
|
593
|
-
<DrawerTrigger>
|
|
594
|
-
<UnnnicButton text="Drawer Without Overlay" />
|
|
595
|
-
</DrawerTrigger>
|
|
596
|
-
<DrawerContent v-bind="args" :showOverlay="false">
|
|
597
|
-
<DrawerHeader>
|
|
598
|
-
<DrawerTitle>Drawer Without Overlay</DrawerTitle>
|
|
599
|
-
<DrawerDescription>This drawer doesn't have a background overlay.</DrawerDescription>
|
|
600
|
-
</DrawerHeader>
|
|
601
|
-
<div style="padding: 24px; flex: 1; overflow-y: auto;">
|
|
602
|
-
<p style="margin: 0; color: #67738B;">
|
|
603
|
-
You can interact with the page behind this drawer. This is useful when nesting drawers or modals,
|
|
604
|
-
or when you want to allow users to reference content on the page while the drawer is open.
|
|
605
|
-
</p>
|
|
606
|
-
</div>
|
|
607
|
-
</DrawerContent>
|
|
608
|
-
</Drawer>
|
|
609
|
-
`,
|
|
610
|
-
}),
|
|
611
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks';
|
|
2
|
-
|
|
3
|
-
<Meta title="Utilities/Layer Manager/Overview" />
|
|
4
|
-
|
|
5
|
-
# Layer Manager Overview
|
|
6
|
-
|
|
7
|
-
The layer manager exists to keep every teleported component (dialogs, drawers, popovers, tooltips, toasts, etc.) in a predictable stacking order without sprinkling arbitrary `z-index: 9999` rules across the codebase. Defining semantic bands (drawer, modal, popover, tooltip, toast) and allocating values automatically whenever a component mounts. [Reference](https://v1.chakra-ui.com/docs/components/recipes/z-index)
|
|
8
|
-
|
|
9
|
-
## Why avoid manual z-index values?
|
|
10
|
-
|
|
11
|
-
- **Unbounded numbers** – once one component uses `z-index: 9999`, the next overlay needs more. This escalates quickly and still breaks when stacking contexts change.
|
|
12
|
-
- **Stacking contexts** – `position`, `transform`, `opacity`, `filter`, and even flex or grid children can create new contexts that ignore global z-index rules. Portaled content plus a manager side-steps this entirely.
|
|
13
|
-
- **Shared ownership** – dialogs, drawers, dropdowns, and popovers often live in different packages. A single allocator means each feature does not need to know what values others are using.
|
|
14
|
-
|
|
15
|
-
## How it works here
|
|
16
|
-
|
|
17
|
-
1. **Tokens, not numbers** – components request a token such as `modal`, `popover`, or `tooltip`. The manager maps those tokens to a base band (e.g., modals start at 1200, popovers at 1400).
|
|
18
|
-
2. **Auto-increment** – every time a component mounts, it receives the next value in its band so nested dialogs or infinite toasts still stack correctly.
|
|
19
|
-
3. **Scoped offsets** – overlays that belong to the same surface (e.g., `DialogOverlay` vs `DialogContent`) simply call `useLayerZIndex` with a small negative offset so the overlay sits just beneath the content that opened it.
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
const modalZ = useLayerZIndex('modal');
|
|
23
|
-
const overlayZ = useLayerZIndex('modal', { offset: -2 });
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Benefits
|
|
27
|
-
|
|
28
|
-
- **Deterministic ordering** – open a drawer, then a popover, then a dialog, then a tooltip and the visual order will always follow the semantic bands.
|
|
29
|
-
- **Safer refactors** – tokens can be remapped (e.g., raise the entire `tooltip` band) without touching every component.
|
|
30
|
-
|
|
31
|
-
## When to override
|
|
32
|
-
|
|
33
|
-
In rare cases you might still need a custom `z-index`. Prefer to:
|
|
34
|
-
|
|
35
|
-
1. Add a new token in the layer manager if the surface fits the existing pattern (e.g., `tour`).
|
|
36
|
-
2. Only apply inline overrides for truly one-off cases, and document why the global manager does not work there.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Use the `Layer Manager` stories in Storybook to verify real interactions (dialog + tooltip/popover, drawer + dialog, nested dialogs, dialog + toast) whenever you add a new teleported component.
|
|
40
|
-
|