@meistrari/tela-build 1.0.0
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/README.md +75 -0
- package/app.config.ts +73 -0
- package/components/tela/animated/animated-calculating-number.vue +16 -0
- package/components/tela/animated/animated-number.mdx +248 -0
- package/components/tela/animated/animated-number.stories.ts +52 -0
- package/components/tela/animated/animated-number.vue +23 -0
- package/components/tela/animated/animated-text.vue +124 -0
- package/components/tela/animated/animated-value.vue +68 -0
- package/components/tela/avatar/avatar.mdx +117 -0
- package/components/tela/avatar/avatar.stories.ts +62 -0
- package/components/tela/avatar/avatar.vue +71 -0
- package/components/tela/avatar/group/avatar-group.stories.ts +78 -0
- package/components/tela/avatar/group/avatar-group.vue +46 -0
- package/components/tela/badge/badge.mdx +154 -0
- package/components/tela/badge/badge.stories.ts +82 -0
- package/components/tela/badge/badge.vue +41 -0
- package/components/tela/button/button.mdx +155 -0
- package/components/tela/button/button.stories.ts +202 -0
- package/components/tela/button/button.vue +107 -0
- package/components/tela/card.vue +30 -0
- package/components/tela/chart/chart-bar.vue +58 -0
- package/components/tela/chat/chat.mdx +268 -0
- package/components/tela/chat/chat.stories.ts +253 -0
- package/components/tela/chat/command/index.vue +41 -0
- package/components/tela/chat/command/mention/index.vue +138 -0
- package/components/tela/chat/index.vue +112 -0
- package/components/tela/chat/pure-text-input/chat-text-input.vue +190 -0
- package/components/tela/chat/text-input/chat-text-input.stories.ts +128 -0
- package/components/tela/chat/text-input/index.vue +217 -0
- package/components/tela/chat/text-message/chat-text-message.stories.ts +138 -0
- package/components/tela/chat/text-message/index.vue +355 -0
- package/components/tela/chat/types.ts +19 -0
- package/components/tela/checkbox/checkbox-card.vue +30 -0
- package/components/tela/checkbox/checkbox.mdx +164 -0
- package/components/tela/checkbox/checkbox.stories.ts +104 -0
- package/components/tela/checkbox/checkbox.vue +43 -0
- package/components/tela/collapsible/Collapsible.vue +15 -0
- package/components/tela/collapsible/CollapsibleContent.vue +59 -0
- package/components/tela/collapsible/CollapsibleTrigger.vue +12 -0
- package/components/tela/collapsible/collapsible.mdx +157 -0
- package/components/tela/collapsible-section/collapsible-section.mdx +180 -0
- package/components/tela/collapsible-section/collapsible-section.stories.ts +53 -0
- package/components/tela/collapsible-section/collapsible-section.vue +51 -0
- package/components/tela/collapsible-section-with-actions.vue +98 -0
- package/components/tela/combobox/combobox-anchor.vue +24 -0
- package/components/tela/combobox/combobox-empty.vue +19 -0
- package/components/tela/combobox/combobox-group.vue +24 -0
- package/components/tela/combobox/combobox-indicator.vue +22 -0
- package/components/tela/combobox/combobox-input.vue +31 -0
- package/components/tela/combobox/combobox-item.vue +28 -0
- package/components/tela/combobox/combobox-label.vue +24 -0
- package/components/tela/combobox/combobox-list.vue +90 -0
- package/components/tela/combobox/combobox-module-selector.vue +366 -0
- package/components/tela/combobox/combobox-root.vue +15 -0
- package/components/tela/combobox/combobox-trigger.vue +12 -0
- package/components/tela/combobox/combobox.mdx +285 -0
- package/components/tela/combobox/combobox.stories.ts +232 -0
- package/components/tela/combobox/combobox.vue +497 -0
- package/components/tela/command/command-dialog.vue +22 -0
- package/components/tela/command/command-empty.vue +25 -0
- package/components/tela/command/command-group.vue +46 -0
- package/components/tela/command/command-input.vue +38 -0
- package/components/tela/command/command-item.vue +78 -0
- package/components/tela/command/command-list.vue +78 -0
- package/components/tela/command/command-separator.vue +23 -0
- package/components/tela/command/command-shortcut.vue +13 -0
- package/components/tela/command/command.vue +88 -0
- package/components/tela/command/dialog-base.vue +15 -0
- package/components/tela/command/dialog-content.vue +50 -0
- package/components/tela/command/utils.ts +15 -0
- package/components/tela/complex-table/complex-table-cell.stories.ts +145 -0
- package/components/tela/complex-table/complex-table-cell.vue +45 -0
- package/components/tela/complex-table/complex-table-header-cell.stories.ts +103 -0
- package/components/tela/complex-table/complex-table-header-cell.vue +48 -0
- package/components/tela/complex-table/complex-table-header.stories.ts +89 -0
- package/components/tela/complex-table/complex-table-header.vue +70 -0
- package/components/tela/complex-table/complex-table-row.vue +199 -0
- package/components/tela/complex-table/complex-table-virtualized.vue +326 -0
- package/components/tela/complex-table/complex-table.stories.ts +358 -0
- package/components/tela/complex-table/complex-table.vue +237 -0
- package/components/tela/complex-table/composables/table-common.ts +93 -0
- package/components/tela/complex-table/composables/table-selection.ts +87 -0
- package/components/tela/complex-table/composables/virtual-scroll.ts +252 -0
- package/components/tela/complex-table/styles/table-shared.css +170 -0
- package/components/tela/complex-table/types.ts +63 -0
- package/components/tela/complex-table/utils.ts +35 -0
- package/components/tela/confirm-button/confirm-button.vue +137 -0
- package/components/tela/confirmation-modal/confirmation-modal.vue +72 -0
- package/components/tela/copy-button.vue +86 -0
- package/components/tela/date-range-picker.vue +221 -0
- package/components/tela/dialog/dialog.mdx +170 -0
- package/components/tela/dialog/dialog.vue +182 -0
- package/components/tela/disabled-area.vue +16 -0
- package/components/tela/disclaimer/disclaimer.mdx +238 -0
- package/components/tela/disclaimer/disclaimer.stories.ts +196 -0
- package/components/tela/disclaimer/disclaimer.vue +125 -0
- package/components/tela/dropdown-menu/DropdownMenu.vue +121 -0
- package/components/tela/dropdown-menu/DropdownMenuCheckboxItem.vue +40 -0
- package/components/tela/dropdown-menu/DropdownMenuContent.vue +75 -0
- package/components/tela/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/components/tela/dropdown-menu/DropdownMenuItem.vue +137 -0
- package/components/tela/dropdown-menu/DropdownMenuLabel.vue +26 -0
- package/components/tela/dropdown-menu/DropdownMenuRadioGroup.vue +18 -0
- package/components/tela/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/components/tela/dropdown-menu/DropdownMenuRoot.vue +15 -0
- package/components/tela/dropdown-menu/DropdownMenuSeparator.vue +21 -0
- package/components/tela/dropdown-menu/DropdownMenuShortcut.vue +14 -0
- package/components/tela/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/components/tela/dropdown-menu/DropdownMenuSubContent.vue +30 -0
- package/components/tela/dropdown-menu/DropdownMenuSubTrigger.vue +35 -0
- package/components/tela/dropdown-menu/DropdownMenuTrigger.vue +14 -0
- package/components/tela/dropdown-menu/dropdown-menu.mdx +265 -0
- package/components/tela/dropdown-menu/dropdown-menu.stories.ts +156 -0
- package/components/tela/expandable-input.vue +96 -0
- package/components/tela/file-drop.vue +37 -0
- package/components/tela/file-upload/file-upload.mdx +189 -0
- package/components/tela/file-upload/file-upload.stories.ts +48 -0
- package/components/tela/file-upload/file-upload.vue +205 -0
- package/components/tela/filters/checkbox-filter.stories.ts +218 -0
- package/components/tela/filters/checkbox-filter.vue +165 -0
- package/components/tela/filters/date-filter.stories.ts +258 -0
- package/components/tela/filters/date-filter.vue +200 -0
- package/components/tela/filters/user-filter.stories.ts +344 -0
- package/components/tela/filters/user-filter.vue +271 -0
- package/components/tela/hover-card/hover-card.mdx +221 -0
- package/components/tela/hover-card/hover-card.stories.ts +87 -0
- package/components/tela/hover-card/hover-card.vue +61 -0
- package/components/tela/icon/custom.vue +319 -0
- package/components/tela/icon/spinner.vue +12 -0
- package/components/tela/icon-button/icon-button.vue +114 -0
- package/components/tela/icon.vue +37 -0
- package/components/tela/initials.vue +28 -0
- package/components/tela/inline-input.vue +77 -0
- package/components/tela/input/input.mdx +182 -0
- package/components/tela/input/input.stories.ts +153 -0
- package/components/tela/input/tela-input.vue +240 -0
- package/components/tela/kbd/kbd-return.vue +6 -0
- package/components/tela/kbd/kbd.mdx +238 -0
- package/components/tela/kbd/kbd.vue +18 -0
- package/components/tela/label/label.mdx +121 -0
- package/components/tela/label/label.stories.ts +37 -0
- package/components/tela/label/label.vue +25 -0
- package/components/tela/link-decoration/link-decoration.vue +19 -0
- package/components/tela/live-label.vue +32 -0
- package/components/tela/long-press-button.vue +98 -0
- package/components/tela/menubar/menubar-content.vue +77 -0
- package/components/tela/menubar/menubar-item.vue +32 -0
- package/components/tela/menubar/menubar-label.vue +14 -0
- package/components/tela/menubar/menubar-menu.vue +12 -0
- package/components/tela/menubar/menubar-root.vue +30 -0
- package/components/tela/menubar/menubar-separator.vue +17 -0
- package/components/tela/menubar/menubar-shortcut.vue +14 -0
- package/components/tela/menubar/menubar-sub-content.vue +36 -0
- package/components/tela/menubar/menubar-sub-trigger.vue +28 -0
- package/components/tela/menubar/menubar-sub.vue +20 -0
- package/components/tela/menubar/menubar-trigger.vue +27 -0
- package/components/tela/menubar/menubar.vue +298 -0
- package/components/tela/modal/modal.mdx +145 -0
- package/components/tela/modal/modal.vue +242 -0
- package/components/tela/multiple-select/multiple-select.mdx +274 -0
- package/components/tela/multiple-select/multiple-select.stories.ts +325 -0
- package/components/tela/multiple-select/multiple-select.vue +666 -0
- package/components/tela/pane.vue +110 -0
- package/components/tela/popover/popover-content.vue +48 -0
- package/components/tela/popover/popover-trigger.vue +12 -0
- package/components/tela/popover/popover.mdx +239 -0
- package/components/tela/popover/popover.stories.ts +150 -0
- package/components/tela/popover/popover.vue +15 -0
- package/components/tela/popover-list/popover-list-nested.vue +104 -0
- package/components/tela/popover-list/popover-list.stories.ts +330 -0
- package/components/tela/popover-list/popover-list.vue +191 -0
- package/components/tela/radio-button.vue +66 -0
- package/components/tela/radio-group/radio-group-item.vue +40 -0
- package/components/tela/radio-group/radio-group-root.vue +26 -0
- package/components/tela/radio-group/radio-group.mdx +78 -0
- package/components/tela/radio-group/radio-group.stories.ts +106 -0
- package/components/tela/radio-group/radio-group.vue +23 -0
- package/components/tela/range-calendar.stories.ts +110 -0
- package/components/tela/range-calendar.vue +109 -0
- package/components/tela/scroll-area/scroll-area.mdx +183 -0
- package/components/tela/scroll-area/scroll-area.vue +30 -0
- package/components/tela/scroll-area/scroll-bar.vue +31 -0
- package/components/tela/segment-toggle.stories.ts +114 -0
- package/components/tela/segment-toggle.vue +66 -0
- package/components/tela/select-menu/select-menu-content.vue +106 -0
- package/components/tela/select-menu/select-menu-down-button.vue +20 -0
- package/components/tela/select-menu/select-menu-group.vue +16 -0
- package/components/tela/select-menu/select-menu-item.vue +40 -0
- package/components/tela/select-menu/select-menu-root.vue +15 -0
- package/components/tela/select-menu/select-menu-trigger.vue +34 -0
- package/components/tela/select-menu/select-menu-up-button.vue +20 -0
- package/components/tela/select-menu/select-menu-value.vue +12 -0
- package/components/tela/select-menu/select-menu.mdx +221 -0
- package/components/tela/select-menu/select-menu.stories.ts +91 -0
- package/components/tela/select-menu/select-menu.vue +165 -0
- package/components/tela/selector/selector.vue +47 -0
- package/components/tela/sheet/sheet-close.vue +12 -0
- package/components/tela/sheet/sheet-content.vue +57 -0
- package/components/tela/sheet/sheet-description.vue +23 -0
- package/components/tela/sheet/sheet-footer.vue +18 -0
- package/components/tela/sheet/sheet-header.vue +15 -0
- package/components/tela/sheet/sheet-root.vue +18 -0
- package/components/tela/sheet/sheet-title.vue +23 -0
- package/components/tela/sheet/sheet-trigger.vue +12 -0
- package/components/tela/sheet/sheet.client.vue +150 -0
- package/components/tela/sheet/sheet.mdx +176 -0
- package/components/tela/sheet/sheet.stories.ts +201 -0
- package/components/tela/sheet/variants.ts +22 -0
- package/components/tela/side-sheet/side-sheet.mdx +131 -0
- package/components/tela/side-sheet/side-sheet.stories.ts +134 -0
- package/components/tela/side-sheet/side-sheet.vue +106 -0
- package/components/tela/skeleton/skeleton.mdx +165 -0
- package/components/tela/skeleton/skeleton.stories.ts +35 -0
- package/components/tela/skeleton/skeleton.vue +45 -0
- package/components/tela/skeleton-icon.vue +24 -0
- package/components/tela/span.vue +24 -0
- package/components/tela/star-button.vue +70 -0
- package/components/tela/status/status-lean.vue +30 -0
- package/components/tela/status/status.mdx +187 -0
- package/components/tela/status/status.stories.ts +160 -0
- package/components/tela/status/status.vue +420 -0
- package/components/tela/status-bar/status-bar.mdx +178 -0
- package/components/tela/status-bar/status-bar.stories.ts +64 -0
- package/components/tela/status-bar/status-bar.vue +56 -0
- package/components/tela/status-bar/types.ts +5 -0
- package/components/tela/switch/switch.mdx +118 -0
- package/components/tela/switch/switch.stories.ts +80 -0
- package/components/tela/switch/switch.vue +56 -0
- package/components/tela/table/table-body.vue +13 -0
- package/components/tela/table/table-caption.vue +13 -0
- package/components/tela/table/table-cell.vue +20 -0
- package/components/tela/table/table-empty.vue +37 -0
- package/components/tela/table/table-footer.vue +13 -0
- package/components/tela/table/table-head.vue +13 -0
- package/components/tela/table/table-header.vue +13 -0
- package/components/tela/table/table-row.vue +13 -0
- package/components/tela/table/table.mdx +230 -0
- package/components/tela/table/table.stories.ts +384 -0
- package/components/tela/table/table.vue +15 -0
- package/components/tela/tabs/tabs-content.vue +20 -0
- package/components/tela/tabs/tabs-indicator.vue +22 -0
- package/components/tela/tabs/tabs-list.vue +23 -0
- package/components/tela/tabs/tabs-root.vue +15 -0
- package/components/tela/tabs/tabs-trigger.vue +27 -0
- package/components/tela/tabs/tabs.mdx +138 -0
- package/components/tela/tabs/tabs.stories.ts +72 -0
- package/components/tela/tabs/tabs.vue +61 -0
- package/components/tela/tags/tags-select.mdx +318 -0
- package/components/tela/tags/tags-select.stories.ts +47 -0
- package/components/tela/tags/tags-select.vue +637 -0
- package/components/tela/tags/tags.mdx +151 -0
- package/components/tela/tags/tags.stories.ts +118 -0
- package/components/tela/tags/tags.vue +112 -0
- package/components/tela/textarea/textarea.mdx +102 -0
- package/components/tela/textarea/textarea.stories.ts +50 -0
- package/components/tela/textarea/textarea.vue +34 -0
- package/components/tela/toggle-group.vue +91 -0
- package/components/tela/tooltip/tooltip-content.vue +45 -0
- package/components/tela/tooltip/tooltip-provider.vue +12 -0
- package/components/tela/tooltip/tooltip-root.vue +15 -0
- package/components/tela/tooltip/tooltip-trigger.vue +12 -0
- package/components/tela/tooltip/tooltip.mdx +196 -0
- package/components/tela/tooltip/tooltip.stories.ts +200 -0
- package/components/tela/tooltip/tooltip.vue +91 -0
- package/components/tela/tooltip-group/tooltip-group-trigger.vue +92 -0
- package/components/tela/tooltip-group/tooltip-group.mdx +236 -0
- package/components/tela/tooltip-group/tooltip-group.stories.ts +465 -0
- package/components/tela/tooltip-group/tooltip-group.vue +35 -0
- package/components/tela/transparent-input.vue +151 -0
- package/components/tela/variable-icon.vue +28 -0
- package/components/tela/variable-input.vue +77 -0
- package/components/tela/wide-button/wide-button.vue +40 -0
- package/components.json +18 -0
- package/composables/status-toast.ts +67 -0
- package/css/reset.css +386 -0
- package/css/text.css +22 -0
- package/lib/doc-generator.ts +903 -0
- package/lib/extractors/volar-extract.ts +186 -0
- package/lib/type-resolver.ts +402 -0
- package/lib/utils.ts +6 -0
- package/modules/tela-build-docs/index.ts +139 -0
- package/nuxt.config.ts +80 -0
- package/package.json +84 -0
- package/plugins/test-id.ts +7 -0
- package/tsconfig.json +7 -0
- package/types/custom-icon.ts +1 -0
- package/types/index.ts +2 -0
- package/types/status.ts +1 -0
- package/unocss.config.ts +89 -0
- package/utils/component-utils.ts +30 -0
- package/utils/design-tokens.ts +431 -0
- package/utils/fold.ts +8 -0
- package/utils/select-menu.ts +10 -0
- package/utils/status.ts +1 -0
- package/utils/without-keys.ts +34 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { Meta, Canvas, ArgTypes } from '@storybook/blocks';
|
|
2
|
+
import * as DisclaimerStories from './disclaimer.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={DisclaimerStories} />
|
|
5
|
+
|
|
6
|
+
# TelaDisclaimer
|
|
7
|
+
|
|
8
|
+
A disclaimer component that displays important notices, warnings, or information to users. Supports auto-hide functionality, custom icons, close buttons, and visibility control. Useful for displaying temporary notices, privacy information, or important alerts that need user attention.
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
|
|
12
|
+
### With Auto-Hide
|
|
13
|
+
|
|
14
|
+
<Canvas of={DisclaimerStories.WithAutoHideDemo} />
|
|
15
|
+
|
|
16
|
+
### Without Auto-Hide
|
|
17
|
+
|
|
18
|
+
<Canvas of={DisclaimerStories.WithoutAutoHide} />
|
|
19
|
+
|
|
20
|
+
### Without Close Button
|
|
21
|
+
|
|
22
|
+
<Canvas of={DisclaimerStories.WithoutCloseButton} />
|
|
23
|
+
|
|
24
|
+
### Different Icons
|
|
25
|
+
|
|
26
|
+
<Canvas of={DisclaimerStories.DifferentIcons} />
|
|
27
|
+
|
|
28
|
+
### Interactive with Control
|
|
29
|
+
|
|
30
|
+
<Canvas of={DisclaimerStories.InteractiveWithCloseHandling} />
|
|
31
|
+
|
|
32
|
+
### Basic Usage
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<TelaDisclaimer
|
|
36
|
+
icon="i-ph-info"
|
|
37
|
+
title="Important Notice"
|
|
38
|
+
description="Please read this important information."
|
|
39
|
+
@close="handleClose"
|
|
40
|
+
/>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### With Auto-Hide Code
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<TelaDisclaimer
|
|
47
|
+
title="This will auto-hide in 5 seconds"
|
|
48
|
+
description="Watch this disappear automatically"
|
|
49
|
+
:auto-hide-delay="5000"
|
|
50
|
+
@close="onClose"
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Without Auto-Hide Code
|
|
55
|
+
|
|
56
|
+
```vue
|
|
57
|
+
<TelaDisclaimer
|
|
58
|
+
title="Persistent Notice"
|
|
59
|
+
description="This will not auto-hide"
|
|
60
|
+
:auto-hide="false"
|
|
61
|
+
icon="i-ph-warning"
|
|
62
|
+
/>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Without Close Button Code
|
|
66
|
+
|
|
67
|
+
```vue
|
|
68
|
+
<TelaDisclaimer
|
|
69
|
+
title="No Close Button"
|
|
70
|
+
description="Auto-hide only"
|
|
71
|
+
:show-close-button="false"
|
|
72
|
+
:auto-hide-delay="3000"
|
|
73
|
+
/>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Different Icons Code
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<!-- Info -->
|
|
80
|
+
<TelaDisclaimer
|
|
81
|
+
icon="i-ph-info"
|
|
82
|
+
title="Information"
|
|
83
|
+
description="Helpful information for users"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<!-- Warning -->
|
|
87
|
+
<TelaDisclaimer
|
|
88
|
+
icon="i-ph-warning"
|
|
89
|
+
title="Warning"
|
|
90
|
+
description="Please be aware of this"
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<!-- Clock -->
|
|
94
|
+
<TelaDisclaimer
|
|
95
|
+
icon="i-ph-clock-countdown"
|
|
96
|
+
title="Time-sensitive"
|
|
97
|
+
description="Content expires in 24 hours"
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<!-- Shield -->
|
|
101
|
+
<TelaDisclaimer
|
|
102
|
+
icon="i-ph-shield-check"
|
|
103
|
+
title="Privacy Protected"
|
|
104
|
+
description="Your data is automatically deleted"
|
|
105
|
+
/>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Privacy Notice
|
|
109
|
+
|
|
110
|
+
```vue
|
|
111
|
+
<TelaDisclaimer
|
|
112
|
+
icon="i-ph-lock"
|
|
113
|
+
title="Privacy Notice"
|
|
114
|
+
description="All data is encrypted and automatically deleted after 24 hours for your privacy."
|
|
115
|
+
:auto-hide="false"
|
|
116
|
+
/>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Expiration Notice
|
|
120
|
+
|
|
121
|
+
```vue
|
|
122
|
+
<TelaDisclaimer
|
|
123
|
+
icon="i-ph-clock-countdown"
|
|
124
|
+
title="Content Expires"
|
|
125
|
+
description="This content will be automatically deleted in 24 hours."
|
|
126
|
+
:auto-hide-delay="86400000"
|
|
127
|
+
@close="onExpire"
|
|
128
|
+
/>
|
|
129
|
+
<!-- 24 hours = 86400000 milliseconds -->
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```vue
|
|
133
|
+
<script setup>
|
|
134
|
+
import { ref } from 'vue'
|
|
135
|
+
|
|
136
|
+
const isVisible = ref(true)
|
|
137
|
+
|
|
138
|
+
const handleClose = () => {
|
|
139
|
+
console.log('Disclaimer closed')
|
|
140
|
+
// Handle close event
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const showAgain = () => {
|
|
144
|
+
isVisible.value = true
|
|
145
|
+
}
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<template>
|
|
149
|
+
<div>
|
|
150
|
+
<TelaDisclaimer
|
|
151
|
+
v-if="isVisible"
|
|
152
|
+
title="Controlled Notice"
|
|
153
|
+
description="This disclaimer's visibility is controlled externally"
|
|
154
|
+
:visible="isVisible"
|
|
155
|
+
@close="handleClose"
|
|
156
|
+
/>
|
|
157
|
+
<button v-else @click="showAgain">
|
|
158
|
+
Show Again
|
|
159
|
+
</button>
|
|
160
|
+
</div>
|
|
161
|
+
</template>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Props
|
|
165
|
+
|
|
166
|
+
<ArgTypes />
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
type DisclaimerProps = {
|
|
170
|
+
icon?: string
|
|
171
|
+
title?: string
|
|
172
|
+
description?: string
|
|
173
|
+
autoHide?: boolean
|
|
174
|
+
autoHideDelay?: number
|
|
175
|
+
showCloseButton?: boolean
|
|
176
|
+
visible?: boolean
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Events
|
|
181
|
+
|
|
182
|
+
- `close` - Emitted when disclaimer is closed (via button or auto-hide)
|
|
183
|
+
|
|
184
|
+
## Features
|
|
185
|
+
|
|
186
|
+
- **Auto-Hide**: Automatically hide after delay
|
|
187
|
+
- **Close Button**: Optional close button
|
|
188
|
+
- **Custom Icons**: Use any icon
|
|
189
|
+
- **Custom Text**: Title and description
|
|
190
|
+
- **Visibility Control**: Control visibility externally
|
|
191
|
+
- **Event Handling**: React to close events
|
|
192
|
+
- **Flexible Layout**: Responsive design
|
|
193
|
+
|
|
194
|
+
## Auto-Hide Delays
|
|
195
|
+
|
|
196
|
+
Common delay durations:
|
|
197
|
+
- 3 seconds: 3000ms - Quick notices
|
|
198
|
+
- 5 seconds: 5000ms - Standard notices
|
|
199
|
+
- 10 seconds: 10000ms - Important notices
|
|
200
|
+
- 30 seconds: 30000ms - Critical notices
|
|
201
|
+
- 24 hours: 86400000ms - Expiration notices
|
|
202
|
+
|
|
203
|
+
## Icon Types
|
|
204
|
+
|
|
205
|
+
Common use cases:
|
|
206
|
+
- **i-ph-info**: General information
|
|
207
|
+
- **i-ph-warning**: Warnings
|
|
208
|
+
- **i-ph-clock-countdown**: Time-sensitive content
|
|
209
|
+
- **i-ph-shield-check**: Privacy/security
|
|
210
|
+
- **i-ph-lock**: Data protection
|
|
211
|
+
- **i-ph-trash**: Auto-deletion
|
|
212
|
+
|
|
213
|
+
## Use Cases
|
|
214
|
+
|
|
215
|
+
- **Privacy Notices**: Inform about data handling
|
|
216
|
+
- **Expiration Warnings**: Notify about content expiration
|
|
217
|
+
- **Terms Updates**: Alert about policy changes
|
|
218
|
+
- **Cookie Consent**: GDPR compliance
|
|
219
|
+
- **Beta Features**: Warn about experimental features
|
|
220
|
+
- **Maintenance**: Notify about scheduled maintenance
|
|
221
|
+
|
|
222
|
+
## Best Practices
|
|
223
|
+
|
|
224
|
+
1. **Be Clear**: Use concise, understandable language
|
|
225
|
+
2. **Set Appropriate Delays**: Match delay to importance
|
|
226
|
+
3. **Provide Close Option**: Let users dismiss notices
|
|
227
|
+
4. **Use Meaningful Icons**: Icons should match the message
|
|
228
|
+
5. **Don't Overuse**: Too many disclaimers are ignored
|
|
229
|
+
6. **Respect User Choice**: Remember if user closed it
|
|
230
|
+
|
|
231
|
+
## Accessibility
|
|
232
|
+
|
|
233
|
+
- Semantic HTML structure
|
|
234
|
+
- ARIA role for alert/status
|
|
235
|
+
- Keyboard accessible close button
|
|
236
|
+
- Screen reader announcements
|
|
237
|
+
- Focus management
|
|
238
|
+
- Sufficient color contrast
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook-vue/vue3'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
import Disclaimer from './disclaimer.vue'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Core/Disclaimer',
|
|
8
|
+
component: Disclaimer,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component: 'A disclaimer component that displays important notices, warnings, or information to users. Supports auto-hide functionality, custom icons, close buttons, and visibility control. Useful for displaying temporary notices, privacy information, or important alerts that need user attention.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
icon: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
description: 'Icon name to display (e.g., i-ph-clock, i-ph-info)',
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Bold title text',
|
|
25
|
+
},
|
|
26
|
+
description: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'Description text',
|
|
29
|
+
},
|
|
30
|
+
autoHide: {
|
|
31
|
+
control: 'boolean',
|
|
32
|
+
description: 'Enable auto-hide functionality',
|
|
33
|
+
},
|
|
34
|
+
autoHideDelay: {
|
|
35
|
+
control: 'number',
|
|
36
|
+
description: 'Delay in milliseconds before auto-hiding',
|
|
37
|
+
},
|
|
38
|
+
showCloseButton: {
|
|
39
|
+
control: 'boolean',
|
|
40
|
+
description: 'Show the close button',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
icon: 'i-ph-clock-countdown',
|
|
45
|
+
title: 'Content expires every 24 hours',
|
|
46
|
+
description: 'After this period, all files and tasks are automatically deleted for privacy compliance.',
|
|
47
|
+
autoHide: true,
|
|
48
|
+
autoHideDelay: 86400000,
|
|
49
|
+
showCloseButton: true,
|
|
50
|
+
},
|
|
51
|
+
} satisfies Meta<typeof Disclaimer>
|
|
52
|
+
|
|
53
|
+
export default meta
|
|
54
|
+
|
|
55
|
+
type Story = StoryObj<typeof meta>
|
|
56
|
+
|
|
57
|
+
export const Default: Story = {
|
|
58
|
+
render: args => ({
|
|
59
|
+
components: { Disclaimer },
|
|
60
|
+
setup() {
|
|
61
|
+
return { args }
|
|
62
|
+
},
|
|
63
|
+
template: `<Disclaimer v-bind="args" @close="console.log('Disclaimer closed')" />`,
|
|
64
|
+
}),
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const WithAutoHideDemo: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
title: 'This will auto-hide in 5 seconds',
|
|
70
|
+
description: 'Watch this disclaimer disappear automatically after the timeout.',
|
|
71
|
+
autoHideDelay: 5000,
|
|
72
|
+
},
|
|
73
|
+
render: args => ({
|
|
74
|
+
components: { Disclaimer },
|
|
75
|
+
setup() {
|
|
76
|
+
return { args }
|
|
77
|
+
},
|
|
78
|
+
template: `<Disclaimer v-bind="args" @close="console.log('Auto-hide triggered')" />`,
|
|
79
|
+
}),
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const WithoutAutoHide: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
title: 'Persistent Disclaimer',
|
|
85
|
+
description: 'This disclaimer will not auto-hide and must be closed manually.',
|
|
86
|
+
autoHide: false,
|
|
87
|
+
icon: 'i-ph-info',
|
|
88
|
+
},
|
|
89
|
+
render: args => ({
|
|
90
|
+
components: { Disclaimer },
|
|
91
|
+
setup() {
|
|
92
|
+
return { args }
|
|
93
|
+
},
|
|
94
|
+
template: `
|
|
95
|
+
<div style="padding: 40px;">
|
|
96
|
+
<Disclaimer v-bind="args" @close="console.log('Manually closed')" />
|
|
97
|
+
</div>`,
|
|
98
|
+
}),
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const WithoutCloseButton: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
title: 'No Close Button',
|
|
104
|
+
description: 'This disclaimer has no close button and will auto-hide after the delay.',
|
|
105
|
+
showCloseButton: false,
|
|
106
|
+
icon: 'i-ph-warning',
|
|
107
|
+
},
|
|
108
|
+
render: args => ({
|
|
109
|
+
components: { Disclaimer },
|
|
110
|
+
setup() {
|
|
111
|
+
return { args }
|
|
112
|
+
},
|
|
113
|
+
template: `
|
|
114
|
+
<div style="padding: 40px;">
|
|
115
|
+
<Disclaimer v-bind="args" @close="console.log('Auto-hide only')" />
|
|
116
|
+
</div>`,
|
|
117
|
+
}),
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const DifferentIcons: Story = {
|
|
121
|
+
render: () => ({
|
|
122
|
+
components: { Disclaimer },
|
|
123
|
+
template: `
|
|
124
|
+
<div style="padding: 40px; display: flex; flex-direction: column; gap: 16px;">
|
|
125
|
+
<Disclaimer
|
|
126
|
+
icon="i-ph-clock-countdown"
|
|
127
|
+
title="Time-sensitive content"
|
|
128
|
+
description="This content expires after 24 hours."
|
|
129
|
+
:auto-hide="false"
|
|
130
|
+
/>
|
|
131
|
+
<Disclaimer
|
|
132
|
+
icon="i-ph-info"
|
|
133
|
+
title="Information"
|
|
134
|
+
description="Important information for users."
|
|
135
|
+
:auto-hide="false"
|
|
136
|
+
/>
|
|
137
|
+
<Disclaimer
|
|
138
|
+
icon="i-ph-warning"
|
|
139
|
+
title="Warning"
|
|
140
|
+
description="Please be aware of this important notice."
|
|
141
|
+
:auto-hide="false"
|
|
142
|
+
/>
|
|
143
|
+
<Disclaimer
|
|
144
|
+
icon="i-ph-shield-check"
|
|
145
|
+
title="Privacy Protected"
|
|
146
|
+
description="Your data is automatically deleted for privacy."
|
|
147
|
+
:auto-hide="false"
|
|
148
|
+
/>
|
|
149
|
+
</div>`,
|
|
150
|
+
}),
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export const InteractiveWithCloseHandling: Story = {
|
|
154
|
+
render: () => ({
|
|
155
|
+
components: { Disclaimer },
|
|
156
|
+
setup() {
|
|
157
|
+
const disclaimerVisible = ref(true)
|
|
158
|
+
const closeCount = ref(0)
|
|
159
|
+
|
|
160
|
+
const handleClose = () => {
|
|
161
|
+
closeCount.value++
|
|
162
|
+
console.warn(`Disclaimer closed ${closeCount.value} time(s)`)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const reset = () => {
|
|
166
|
+
disclaimerVisible.value = false
|
|
167
|
+
setTimeout(() => {
|
|
168
|
+
disclaimerVisible.value = true
|
|
169
|
+
}, 100)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return { disclaimerVisible, closeCount, handleClose, reset }
|
|
173
|
+
},
|
|
174
|
+
template: `
|
|
175
|
+
<div style="padding: 40px;">
|
|
176
|
+
<div style="margin-bottom: 20px;">
|
|
177
|
+
<button
|
|
178
|
+
@click="reset"
|
|
179
|
+
style="padding: 8px 16px; background: #333; color: white; border: none; border-radius: 6px; cursor: pointer;"
|
|
180
|
+
>
|
|
181
|
+
Reset Disclaimer
|
|
182
|
+
</button>
|
|
183
|
+
<span style="margin-left: 16px; color: #666;">
|
|
184
|
+
Close count: {{ closeCount }}
|
|
185
|
+
</span>
|
|
186
|
+
</div>
|
|
187
|
+
<Disclaimer
|
|
188
|
+
:visible="disclaimerVisible"
|
|
189
|
+
title="Interactive Disclaimer with External Control"
|
|
190
|
+
description="This disclaimer's visibility is controlled externally via the visible prop."
|
|
191
|
+
:auto-hide-delay="10000"
|
|
192
|
+
@close="handleClose"
|
|
193
|
+
/>
|
|
194
|
+
</div>`,
|
|
195
|
+
}),
|
|
196
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
icon?: string
|
|
6
|
+
iconStyle?: string
|
|
7
|
+
title?: string
|
|
8
|
+
description?: string
|
|
9
|
+
autoHide?: boolean
|
|
10
|
+
autoHideDelay?: number // in milliseconds
|
|
11
|
+
showCloseButton?: boolean
|
|
12
|
+
visible?: Ref<boolean>
|
|
13
|
+
backgroundColor?: string
|
|
14
|
+
actionUrl?: string
|
|
15
|
+
actionText?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
19
|
+
icon: 'i-ph-clock-countdown',
|
|
20
|
+
iconStyle: 'color: var(--gray-600, #767E86);',
|
|
21
|
+
autoHide: false,
|
|
22
|
+
autoHideDelay: 0,
|
|
23
|
+
showCloseButton: true,
|
|
24
|
+
backgroundColor: 'bg-gray-100',
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits<{
|
|
28
|
+
close: []
|
|
29
|
+
}>()
|
|
30
|
+
|
|
31
|
+
// Use provided ref or create a local one
|
|
32
|
+
const localVisible = ref(true)
|
|
33
|
+
const isVisible = computed(() => props.visible ?? localVisible)
|
|
34
|
+
|
|
35
|
+
function handleClose() {
|
|
36
|
+
isVisible.value.value = false
|
|
37
|
+
emit('close')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function handleAction() {
|
|
41
|
+
if (props.actionUrl) {
|
|
42
|
+
window.open(props.actionUrl, '_blank')
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
if (props.autoHide && props.autoHideDelay > 0) {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
if (isVisible.value.value) {
|
|
50
|
+
handleClose()
|
|
51
|
+
}
|
|
52
|
+
}, props.autoHideDelay)
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<Transition name="disclaimer-fade">
|
|
59
|
+
<div
|
|
60
|
+
v-if="isVisible.value"
|
|
61
|
+
flex items-center gap-12px
|
|
62
|
+
p-12px rounded-10px shadow-subtle
|
|
63
|
+
transition ease-in-out relative
|
|
64
|
+
:class="backgroundColor"
|
|
65
|
+
>
|
|
66
|
+
<TelaIcon
|
|
67
|
+
v-if="icon"
|
|
68
|
+
:name="icon"
|
|
69
|
+
size="20px"
|
|
70
|
+
flex-shrink-0
|
|
71
|
+
:style="iconStyle"
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<div flex-1 flex items-center gap-4px>
|
|
75
|
+
<span text-gray-700 font-semibold text-14px leading-20px>
|
|
76
|
+
{{ title }}
|
|
77
|
+
</span>
|
|
78
|
+
<span text-gray-600 text-14px leading-20px>
|
|
79
|
+
{{ description }}
|
|
80
|
+
</span>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<TelaButton
|
|
84
|
+
v-if="actionUrl && actionText"
|
|
85
|
+
variant="ghost"
|
|
86
|
+
class="h-20px"
|
|
87
|
+
@click="handleAction"
|
|
88
|
+
>
|
|
89
|
+
{{ actionText }}
|
|
90
|
+
</TelaButton>
|
|
91
|
+
|
|
92
|
+
<button
|
|
93
|
+
v-if="showCloseButton"
|
|
94
|
+
p-0
|
|
95
|
+
m-0 border-none bg-transparent cursor-pointer flex
|
|
96
|
+
items-center justify-center hover:opacity-70
|
|
97
|
+
outline-none focus:ring-1 focus:ring-cyan-600 rounded-4px
|
|
98
|
+
transition-opacity @click="handleClose"
|
|
99
|
+
>
|
|
100
|
+
<TelaIcon
|
|
101
|
+
name="i-ph-x"
|
|
102
|
+
size="20px"
|
|
103
|
+
text-gray-600
|
|
104
|
+
/>
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
</Transition>
|
|
108
|
+
</template>
|
|
109
|
+
|
|
110
|
+
<style scoped>
|
|
111
|
+
.disclaimer-fade-enter-active,
|
|
112
|
+
.disclaimer-fade-leave-active {
|
|
113
|
+
transition: opacity 0.3s ease, transform 0.3s ease;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.disclaimer-fade-enter-from {
|
|
117
|
+
opacity: 0;
|
|
118
|
+
transform: translateY(-8px);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.disclaimer-fade-leave-to {
|
|
122
|
+
opacity: 0;
|
|
123
|
+
transform: translateY(-8px);
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { VisuallyHidden } from 'radix-vue'
|
|
3
|
+
import DropdownMenuRoot from './DropdownMenuRoot.vue'
|
|
4
|
+
import DropdownMenuContent from './DropdownMenuContent.vue'
|
|
5
|
+
import DropdownMenuGroup from './DropdownMenuGroup.vue'
|
|
6
|
+
import DropdownMenuItem from './DropdownMenuItem.vue'
|
|
7
|
+
import DropdownMenuLabel from './DropdownMenuLabel.vue'
|
|
8
|
+
import DropdownMenuTrigger from './DropdownMenuTrigger.vue'
|
|
9
|
+
import type { TooltipProps } from '../tooltip/tooltip.vue'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
items: {
|
|
13
|
+
label: string
|
|
14
|
+
icon?: string
|
|
15
|
+
iconSide?: 'left' | 'right'
|
|
16
|
+
group?: string
|
|
17
|
+
color?: 'positive' | 'caution' | 'negative'
|
|
18
|
+
click: () => void
|
|
19
|
+
disabled?: boolean
|
|
20
|
+
checkbox?: {
|
|
21
|
+
modelValue: boolean
|
|
22
|
+
onChange: (value: boolean) => void
|
|
23
|
+
}
|
|
24
|
+
tooltip?: string | TooltipProps
|
|
25
|
+
}[]
|
|
26
|
+
sideOffset?: number
|
|
27
|
+
allowSearch?: boolean
|
|
28
|
+
searchPlaceholder?: string
|
|
29
|
+
shouldBeModal?: boolean
|
|
30
|
+
contentClass?: string
|
|
31
|
+
align?: 'start' | 'end' | 'center'
|
|
32
|
+
}>(), {
|
|
33
|
+
align: 'start',
|
|
34
|
+
iconSide: 'left',
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
defineEmits(['click'])
|
|
38
|
+
|
|
39
|
+
const search = ref('')
|
|
40
|
+
const searchInputEl = ref<HTMLInputElement>()
|
|
41
|
+
const isStorybook = Boolean(import.meta.env.STORYBOOK)
|
|
42
|
+
|
|
43
|
+
const filteredItems = computed(() => search.value ? props.items.filter(item => item.label.toLowerCase().includes(search.value.toLowerCase())) : props.items)
|
|
44
|
+
const groups = computed(() => filteredItems.value.reduce((acc, item) => {
|
|
45
|
+
if (item.group) {
|
|
46
|
+
acc[item.group] = [...(acc[item.group] || []), item]
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
acc.__default = [...(acc.__default || []), item]
|
|
50
|
+
}
|
|
51
|
+
return acc
|
|
52
|
+
}, {} as Record<string, typeof props.items[number][]>))
|
|
53
|
+
|
|
54
|
+
function onToggle(open: boolean) {
|
|
55
|
+
if (!open)
|
|
56
|
+
return
|
|
57
|
+
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
if (searchInputEl.value) {
|
|
60
|
+
searchInputEl.value.focus()
|
|
61
|
+
}
|
|
62
|
+
}, 50)
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<div data-allow-mismatch @click.stop>
|
|
68
|
+
<DropdownMenuRoot :modal="shouldBeModal" :default-open="isStorybook" @update:open="onToggle">
|
|
69
|
+
<DropdownMenuTrigger as-child class="data-[state=open]:bg-gray-100">
|
|
70
|
+
<slot />
|
|
71
|
+
<VisuallyHidden v-if="isStorybook" as-child>
|
|
72
|
+
<button />
|
|
73
|
+
</VisuallyHidden>
|
|
74
|
+
</DropdownMenuTrigger>
|
|
75
|
+
|
|
76
|
+
<DropdownMenuContent
|
|
77
|
+
:align="align"
|
|
78
|
+
:side-offset="sideOffset"
|
|
79
|
+
:class="cn('min-w-128px! z-605!', contentClass)"
|
|
80
|
+
>
|
|
81
|
+
<div v-if="allowSearch" flex="~" items-center px-8px py-6px>
|
|
82
|
+
<TelaIcon name="i-ph-magnifying-glass-bold" text-gray-800 mr-6px />
|
|
83
|
+
<input
|
|
84
|
+
ref="searchInputEl" v-model="search"
|
|
85
|
+
:placeholder="searchPlaceholder ?? 'Search'"
|
|
86
|
+
body-14-regular text-gray-900
|
|
87
|
+
class="placeholder:text-13px! placeholder:text-gray-400 focus-visible:outline-none"
|
|
88
|
+
>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div v-if="filteredItems.length === 0" flex="~" items-center justify-center py-12px>
|
|
92
|
+
<TelaIcon name="i-ph-info-bold" text-gray-400 size="sm" mr-8px />
|
|
93
|
+
<span body-12-regular text-gray-400>
|
|
94
|
+
No results
|
|
95
|
+
</span>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<template v-else>
|
|
99
|
+
<DropdownMenuGroup v-for="(group, groupName) in groups" :key="groupName">
|
|
100
|
+
<DropdownMenuLabel v-if="groupName !== '__default'" body-12-semibold text-gray-600>
|
|
101
|
+
{{ groupName }}
|
|
102
|
+
</DropdownMenuLabel>
|
|
103
|
+
<DropdownMenuItem
|
|
104
|
+
v-for="item in group"
|
|
105
|
+
:key="item.label"
|
|
106
|
+
:disabled="item.disabled"
|
|
107
|
+
:icon="item.icon"
|
|
108
|
+
:icon-side="item.iconSide"
|
|
109
|
+
:color="item.color"
|
|
110
|
+
:checkbox="item.checkbox"
|
|
111
|
+
:tooltip="item.tooltip"
|
|
112
|
+
@click="item.click"
|
|
113
|
+
>
|
|
114
|
+
<span>{{ item.label }}</span>
|
|
115
|
+
</DropdownMenuItem>
|
|
116
|
+
</DropdownMenuGroup>
|
|
117
|
+
</template>
|
|
118
|
+
</DropdownMenuContent>
|
|
119
|
+
</DropdownMenuRoot>
|
|
120
|
+
</div>
|
|
121
|
+
</template>
|