vlite3 0.1.0 → 0.1.2
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/_virtual/_plugin-vue_export-helper.js +9 -0
- package/components/Accordion/Accordion.vue.d.ts +44 -0
- package/components/Accordion/Accordion.vue.js +95 -0
- package/components/Accordion/Accordion.vue2.js +4 -0
- package/components/Accordion/AccordionContent.vue.d.ts +22 -0
- package/components/Accordion/AccordionContent.vue.js +7 -0
- package/components/Accordion/AccordionContent.vue2.js +47 -0
- package/components/Accordion/AccordionItem.vue.d.ts +56 -0
- package/components/Accordion/AccordionItem.vue.js +115 -0
- package/components/Accordion/AccordionItem.vue2.js +4 -0
- package/components/Accordion/AccordionTrigger.vue.d.ts +43 -0
- package/components/Accordion/AccordionTrigger.vue.js +94 -0
- package/components/Accordion/AccordionTrigger.vue2.js +4 -0
- package/components/Accordion/index.d.ts +5 -0
- package/components/Accordion/types.d.ts +33 -0
- package/components/Alert.vue.d.ts +36 -0
- package/components/Alert.vue.js +84 -0
- package/components/Alert.vue2.js +4 -0
- package/components/Avatar.vue.d.ts +32 -0
- package/components/Avatar.vue.js +78 -0
- package/components/Avatar.vue2.js +4 -0
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +32 -0
- package/components/AvatarUploader/AvatarUploader.vue.js +99 -0
- package/components/AvatarUploader/AvatarUploader.vue2.js +4 -0
- package/{src/components/AvatarUploader/index.ts → components/AvatarUploader/index.d.ts} +2 -2
- package/components/Badge.vue.d.ts +25 -0
- package/components/Badge.vue.js +27 -0
- package/components/Badge.vue2.js +4 -0
- package/components/Button.vue.d.ts +26 -0
- package/components/Button.vue.js +107 -0
- package/components/Button.vue2.js +4 -0
- package/components/ButtonGroup.vue.d.ts +29 -0
- package/components/ButtonGroup.vue.js +7 -0
- package/components/ButtonGroup.vue2.js +30 -0
- package/components/Carousel/Carousel.vue.d.ts +847 -0
- package/components/Carousel/Carousel.vue.js +7 -0
- package/components/Carousel/Carousel.vue2.js +68 -0
- package/components/Carousel/index.d.ts +2 -0
- package/components/Carousel/types.d.ts +24 -0
- package/components/CheckBox.vue.d.ts +27 -0
- package/components/CheckBox.vue.js +115 -0
- package/components/CheckBox.vue2.js +4 -0
- package/components/Chip/Chip.vue.d.ts +33 -0
- package/components/Chip/Chip.vue.js +113 -0
- package/components/Chip/Chip.vue2.js +4 -0
- package/components/Chip/index.d.ts +2 -0
- package/components/Chip/types.d.ts +12 -0
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +32 -0
- package/components/ChoiceBox/ChoiceBox.vue.js +141 -0
- package/components/ChoiceBox/ChoiceBox.vue2.js +4 -0
- package/components/ChoiceBox/index.d.ts +2 -0
- package/components/ColorPicker/ColorIro.vue.d.ts +18 -0
- package/components/ColorPicker/ColorIro.vue.js +142 -0
- package/components/ColorPicker/ColorIro.vue3.js +5 -0
- package/components/ColorPicker/ColorPicker.vue.d.ts +22 -0
- package/components/ColorPicker/ColorPicker.vue.js +56 -0
- package/components/ColorPicker/ColorPicker.vue2.js +4 -0
- package/components/ConfirmationModal.vue.d.ts +39 -0
- package/components/ConfirmationModal.vue.js +55 -0
- package/components/ConfirmationModal.vue2.js +4 -0
- package/components/DataTable/DataTable.vue.d.ts +60 -0
- package/components/DataTable/DataTable.vue.js +7 -0
- package/components/DataTable/DataTable.vue2.js +310 -0
- package/components/DataTable/DataTableHeader.vue.d.ts +14 -0
- package/components/DataTable/DataTableHeader.vue.js +49 -0
- package/components/DataTable/DataTableHeader.vue2.js +4 -0
- package/components/DataTable/DataTableRow.vue.d.ts +51 -0
- package/components/DataTable/DataTableRow.vue.js +114 -0
- package/components/DataTable/DataTableRow.vue2.js +4 -0
- package/components/DataTable/DataTableToolbar.vue.d.ts +31 -0
- package/components/DataTable/DataTableToolbar.vue.js +45 -0
- package/components/DataTable/DataTableToolbar.vue2.js +4 -0
- package/components/DataTable/index.d.ts +4 -0
- package/components/DataTable/types.d.ts +75 -0
- package/components/DatePicker.vue.d.ts +44 -0
- package/components/DatePicker.vue.js +84 -0
- package/components/DatePicker.vue2.js +4 -0
- package/components/Dropdown/Dropdown.vue.d.ts +105 -0
- package/components/Dropdown/Dropdown.vue.js +206 -0
- package/components/Dropdown/Dropdown.vue2.js +4 -0
- package/components/Dropdown/DropdownBooleanItem.vue.d.ts +12 -0
- package/components/Dropdown/DropdownBooleanItem.vue.js +41 -0
- package/components/Dropdown/DropdownBooleanItem.vue2.js +4 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +21 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.js +73 -0
- package/components/Dropdown/DropdownGroupedLayout.vue2.js +4 -0
- package/components/Dropdown/DropdownItem.vue.d.ts +35 -0
- package/components/Dropdown/DropdownItem.vue.js +56 -0
- package/components/Dropdown/DropdownItem.vue2.js +4 -0
- package/components/Dropdown/DropdownMenu.vue.d.ts +73 -0
- package/components/Dropdown/DropdownMenu.vue.js +232 -0
- package/components/Dropdown/DropdownMenu.vue2.js +4 -0
- package/components/Dropdown/DropdownTrigger.vue.d.ts +15 -0
- package/components/Dropdown/DropdownTrigger.vue.js +26 -0
- package/components/Dropdown/DropdownTrigger.vue2.js +4 -0
- package/components/Dropdown/composables/useDropdownIds.d.ts +5 -0
- package/components/Dropdown/composables/useDropdownIds.js +20 -0
- package/components/Dropdown/composables/useDropdownNavigation.d.ts +19 -0
- package/components/Dropdown/composables/useDropdownNavigation.js +49 -0
- package/components/Dropdown/composables/useDropdownSelection.d.ts +16 -0
- package/components/Dropdown/composables/useDropdownSelection.js +41 -0
- package/components/Dropdown/index.d.ts +6 -0
- package/components/FilePicker/FilePicker.vue.d.ts +65 -0
- package/components/FilePicker/FilePicker.vue.js +285 -0
- package/components/FilePicker/FilePicker.vue2.js +4 -0
- package/components/FilePicker/index.d.ts +2 -0
- package/components/FileTree/FileTree.vue.d.ts +20 -0
- package/components/FileTree/FileTree.vue.js +139 -0
- package/components/FileTree/FileTree.vue2.js +4 -0
- package/components/FileTree/FileTreeNode.vue.d.ts +28 -0
- package/components/FileTree/FileTreeNode.vue.js +184 -0
- package/components/FileTree/FileTreeNode.vue2.js +4 -0
- package/components/FileTree/index.d.ts +4 -0
- package/components/FileTree/types.d.ts +36 -0
- package/components/FileTree/useTreeSelection.d.ts +12 -0
- package/components/FileTree/useTreeSelection.js +25 -0
- package/components/Form/CustomFields.vue.d.ts +38 -0
- package/components/Form/CustomFields.vue.js +7 -0
- package/components/Form/CustomFields.vue2.js +161 -0
- package/components/Form/Form.vue.d.ts +94 -0
- package/components/Form/Form.vue.js +7 -0
- package/components/Form/Form.vue2.js +238 -0
- package/components/Form/FormField.vue.d.ts +28 -0
- package/components/Form/FormField.vue.js +207 -0
- package/components/Form/FormField.vue2.js +4 -0
- package/components/Form/FormFields.vue.d.ts +29 -0
- package/components/Form/FormFields.vue.js +7 -0
- package/components/Form/FormFields.vue2.js +95 -0
- package/components/Form/composables/useFileUpload.d.ts +24 -0
- package/components/Form/composables/useFileUpload.js +40 -0
- package/components/Form/composables/useForm.d.ts +48 -0
- package/components/Form/composables/useForm.js +109 -0
- package/components/Form/index.d.ts +9 -0
- package/components/Form/types.d.ts +167 -0
- package/components/Form/utils/form.utils.d.ts +44 -0
- package/components/Form/utils/form.utils.js +97 -0
- package/components/Heatmap/Heatmap.vue.d.ts +26 -0
- package/components/Heatmap/Heatmap.vue.js +7 -0
- package/components/Heatmap/Heatmap.vue2.js +326 -0
- package/components/Heatmap/index.d.ts +2 -0
- package/components/Heatmap/types.d.ts +66 -0
- package/components/Icon.vue.d.ts +7 -0
- package/components/Icon.vue.js +25 -0
- package/components/Icon.vue2.js +4 -0
- package/components/IconPicker.vue.d.ts +38 -0
- package/components/IconPicker.vue.js +124 -0
- package/components/IconPicker.vue2.js +4 -0
- package/components/Input.vue.d.ts +54 -0
- package/components/Input.vue.js +267 -0
- package/components/Input.vue2.js +4 -0
- package/components/Label.vue.d.ts +23 -0
- package/components/Label.vue.js +23 -0
- package/components/Label.vue2.js +4 -0
- package/components/Logo.vue.d.ts +2 -0
- package/components/Logo.vue.js +10 -0
- package/components/Logo.vue2.js +4 -0
- package/components/Masonry/Masonry.vue.d.ts +31 -0
- package/components/Masonry/Masonry.vue.js +7 -0
- package/components/Masonry/Masonry.vue2.js +83 -0
- package/components/Masonry/index.d.ts +2 -0
- package/components/Masonry/types.d.ts +33 -0
- package/components/Masonry/types.js +10 -0
- package/components/Modal.vue.d.ts +52 -0
- package/components/Modal.vue.js +116 -0
- package/components/Modal.vue2.js +4 -0
- package/components/MultiSelect/MultiSelect.vue.d.ts +40 -0
- package/components/MultiSelect/MultiSelect.vue.js +126 -0
- package/components/MultiSelect/MultiSelect.vue2.js +4 -0
- package/components/MultiSelect/index.d.ts +1 -0
- package/components/Navbar/Navbar.vue.d.ts +51 -0
- package/components/Navbar/Navbar.vue.js +198 -0
- package/components/Navbar/Navbar.vue2.js +4 -0
- package/components/Navbar/NavbarGroup.vue.d.ts +24 -0
- package/components/Navbar/NavbarGroup.vue.js +23 -0
- package/components/Navbar/NavbarGroup.vue2.js +4 -0
- package/components/Navbar/NavbarItem.vue.d.ts +40 -0
- package/components/Navbar/NavbarItem.vue.js +104 -0
- package/components/Navbar/NavbarItem.vue2.js +4 -0
- package/components/Navbar/index.d.ts +3 -0
- package/components/OTPInput/OTPInput.vue.d.ts +33 -0
- package/components/OTPInput/OTPInput.vue.js +115 -0
- package/components/OTPInput/OTPInput.vue2.js +4 -0
- package/components/OTPInput/index.d.ts +1 -0
- package/components/Pagination/Pagination.vue.d.ts +34 -0
- package/components/Pagination/Pagination.vue.js +196 -0
- package/components/Pagination/Pagination.vue2.js +4 -0
- package/components/Pagination/index.d.ts +1 -0
- package/components/PricingPlan/PricingPlan.vue.d.ts +22 -0
- package/components/PricingPlan/PricingPlan.vue.js +55 -0
- package/components/PricingPlan/PricingPlan.vue2.js +4 -0
- package/components/PricingPlan/PricingPlanItem.vue.d.ts +17 -0
- package/components/PricingPlan/PricingPlanItem.vue.js +94 -0
- package/components/PricingPlan/PricingPlanItem.vue2.js +4 -0
- package/components/PricingPlan/index.d.ts +3 -0
- package/components/PricingPlan/types.d.ts +25 -0
- package/components/SidePanel.vue.d.ts +64 -0
- package/components/SidePanel.vue.js +7 -0
- package/components/SidePanel.vue2.js +131 -0
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +11 -0
- package/components/SidebarMenu/SidebarMenu.vue.js +78 -0
- package/components/SidebarMenu/SidebarMenu.vue2.js +4 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +9 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.js +269 -0
- package/components/SidebarMenu/SidebarMenuItem.vue3.js +5 -0
- package/components/SidebarMenu/index.d.ts +3 -0
- package/components/SidebarMenu/types.d.ts +35 -0
- package/components/Slider.vue.d.ts +31 -0
- package/components/Slider.vue.js +157 -0
- package/components/Slider.vue2.js +4 -0
- package/components/Switch.vue.d.ts +16 -0
- package/components/Switch.vue.js +40 -0
- package/components/Switch.vue2.js +4 -0
- package/components/Tabes/Tabes.vue.d.ts +21 -0
- package/components/Tabes/Tabes.vue.js +75 -0
- package/components/Tabes/Tabes.vue2.js +4 -0
- package/components/Tabes/index.d.ts +2 -0
- package/components/Tabes/types.d.ts +8 -0
- package/components/Textarea.vue.d.ts +22 -0
- package/components/Textarea.vue.js +34 -0
- package/components/Textarea.vue2.js +4 -0
- package/components/ThemeToggle.vue.d.ts +2 -0
- package/components/ThemeToggle.vue.js +18 -0
- package/components/ThemeToggle.vue2.js +4 -0
- package/components/Timeline.vue.d.ts +39 -0
- package/components/Timeline.vue.js +174 -0
- package/components/Timeline.vue2.js +4 -0
- package/components/ToastNotification.vue.d.ts +7 -0
- package/components/ToastNotification.vue.js +7 -0
- package/components/ToastNotification.vue2.js +151 -0
- package/components/Tooltip.vue.d.ts +31 -0
- package/components/Tooltip.vue.js +45 -0
- package/components/Tooltip.vue2.js +4 -0
- package/components/Workbook/Sheet.vue.d.ts +38 -0
- package/components/Workbook/Sheet.vue.js +141 -0
- package/components/Workbook/Sheet.vue2.js +4 -0
- package/components/Workbook/Workbook.vue.d.ts +54 -0
- package/components/Workbook/Workbook.vue.js +7 -0
- package/components/Workbook/Workbook.vue2.js +146 -0
- package/components/Workbook/WorkbookAddButton.vue.d.ts +6 -0
- package/components/Workbook/WorkbookAddButton.vue.js +20 -0
- package/components/Workbook/WorkbookAddButton.vue2.js +4 -0
- package/components/Workbook/index.d.ts +3 -0
- package/components/Workbook/types.d.ts +34 -0
- package/composables/useKeyStroke.d.ts +21 -0
- package/composables/useKeyStroke.js +93 -0
- package/composables/useNotifications.d.ts +113 -0
- package/composables/useNotifications.js +99 -0
- package/composables/useTheme.d.ts +6 -0
- package/composables/useTheme.js +32 -0
- package/core/config.d.ts +29 -0
- package/core/config.js +12 -0
- package/core/index.d.ts +31 -0
- package/core/index.js +15 -0
- package/directives/vRipple.d.ts +4 -0
- package/directives/vRipple.js +17 -0
- package/index.d.ts +49 -0
- package/index.js +156 -0
- package/package.json +2 -2
- package/style.css +590 -0
- package/types/alert.type.d.ts +10 -0
- package/{src/types/avatar.type.ts → types/avatar.type.d.ts} +8 -9
- package/types/button.d.ts +15 -0
- package/types/buttongroup.type.d.ts +1 -0
- package/{src/types/config.type.ts → types/config.type.d.ts} +13 -16
- package/types/form.type.d.ts +45 -0
- package/types/index.d.ts +10 -0
- package/types/navbar.type.d.ts +27 -0
- package/types/sidepanel.type.d.ts +13 -0
- package/types/styles.d.ts +28 -0
- package/types/timeline.type.d.ts +9 -0
- package/{src/utils/functions.ts → utils/functions.d.ts} +1 -9
- package/utils/functions.js +11 -0
- package/utils/index.d.ts +2 -0
- package/utils/object.d.ts +6 -0
- package/utils/object.js +14 -0
- package/.vscode/extensions.json +0 -3
- package/LICENSE +0 -21
- package/index.html +0 -16
- package/scripts/bundle-css.js +0 -45
- package/src/App.vue +0 -7
- package/src/components/Accordion/Accordion.vue +0 -139
- package/src/components/Accordion/AccordionContent.vue +0 -63
- package/src/components/Accordion/AccordionItem.vue +0 -163
- package/src/components/Accordion/AccordionTrigger.vue +0 -125
- package/src/components/Accordion/index.ts +0 -5
- package/src/components/Accordion/types.ts +0 -41
- package/src/components/Alert.vue +0 -112
- package/src/components/Avatar.vue +0 -110
- package/src/components/AvatarUploader/AvatarUploader.vue +0 -129
- package/src/components/Badge.vue +0 -45
- package/src/components/Button.vue +0 -122
- package/src/components/ButtonGroup.vue +0 -173
- package/src/components/Carousel/Carousel.vue +0 -84
- package/src/components/Carousel/index.ts +0 -2
- package/src/components/Carousel/types.ts +0 -25
- package/src/components/CheckBox.vue +0 -132
- package/src/components/Chip/Chip.vue +0 -158
- package/src/components/Chip/index.ts +0 -2
- package/src/components/Chip/types.ts +0 -23
- package/src/components/ChoiceBox/ChoiceBox.vue +0 -181
- package/src/components/ChoiceBox/index.ts +0 -2
- package/src/components/ColorPicker/ColorIro.vue +0 -207
- package/src/components/ColorPicker/ColorPicker.vue +0 -61
- package/src/components/ConfirmationModal.vue +0 -46
- package/src/components/DataTable/DataTable.vue +0 -478
- package/src/components/DataTable/DataTableHeader.vue +0 -78
- package/src/components/DataTable/DataTableRow.vue +0 -171
- package/src/components/DataTable/DataTableToolbar.vue +0 -45
- package/src/components/DataTable/index.ts +0 -5
- package/src/components/DataTable/types.ts +0 -85
- package/src/components/DatePicker.vue +0 -102
- package/src/components/Dropdown/Dropdown.vue +0 -348
- package/src/components/Dropdown/DropdownBooleanItem.vue +0 -40
- package/src/components/Dropdown/DropdownGroupedLayout.vue +0 -115
- package/src/components/Dropdown/DropdownItem.vue +0 -56
- package/src/components/Dropdown/DropdownMenu.vue +0 -374
- package/src/components/Dropdown/DropdownTrigger.vue +0 -27
- package/src/components/Dropdown/composables/useDropdownIds.ts +0 -27
- package/src/components/Dropdown/composables/useDropdownNavigation.ts +0 -109
- package/src/components/Dropdown/composables/useDropdownSelection.ts +0 -106
- package/src/components/Dropdown/index.ts +0 -6
- package/src/components/FilePicker/FilePicker.vue +0 -459
- package/src/components/FilePicker/index.ts +0 -2
- package/src/components/FileTree/FileTree.vue +0 -334
- package/src/components/FileTree/FileTreeNode.vue +0 -225
- package/src/components/FileTree/index.ts +0 -2
- package/src/components/FileTree/types.ts +0 -31
- package/src/components/FileTree/useTreeSelection.ts +0 -66
- package/src/components/Form/CustomFields.vue +0 -294
- package/src/components/Form/Form.vue +0 -406
- package/src/components/Form/FormField.vue +0 -404
- package/src/components/Form/FormFields.vue +0 -161
- package/src/components/Form/composables/useFileUpload.ts +0 -112
- package/src/components/Form/composables/useForm.ts +0 -356
- package/src/components/Form/index.ts +0 -16
- package/src/components/Form/types.ts +0 -203
- package/src/components/Form/utils/form.utils.ts +0 -209
- package/src/components/Heatmap/Heatmap.vue +0 -629
- package/src/components/Heatmap/index.ts +0 -2
- package/src/components/Heatmap/types.ts +0 -84
- package/src/components/Icon.vue +0 -47
- package/src/components/IconPicker.vue +0 -138
- package/src/components/Input.vue +0 -366
- package/src/components/Label.vue +0 -25
- package/src/components/Logo.vue +0 -5
- package/src/components/Masonry/Masonry.vue +0 -148
- package/src/components/Masonry/index.ts +0 -2
- package/src/components/Masonry/types.ts +0 -44
- package/src/components/Modal.vue +0 -135
- package/src/components/MultiSelect/MultiSelect.vue +0 -176
- package/src/components/MultiSelect/index.ts +0 -1
- package/src/components/Navbar/Navbar.vue +0 -277
- package/src/components/Navbar/NavbarGroup.vue +0 -27
- package/src/components/Navbar/NavbarItem.vue +0 -124
- package/src/components/Navbar/index.ts +0 -3
- package/src/components/OTPInput/OTPInput.vue +0 -220
- package/src/components/OTPInput/index.ts +0 -1
- package/src/components/Pagination/Pagination.vue +0 -238
- package/src/components/Pagination/index.ts +0 -1
- package/src/components/PricingPlan/PricingPlan.vue +0 -102
- package/src/components/PricingPlan/PricingPlanItem.vue +0 -148
- package/src/components/PricingPlan/index.ts +0 -3
- package/src/components/PricingPlan/types.ts +0 -29
- package/src/components/SidePanel.vue +0 -184
- package/src/components/SidebarMenu/SidebarMenu.vue +0 -146
- package/src/components/SidebarMenu/SidebarMenuItem.vue +0 -333
- package/src/components/SidebarMenu/index.ts +0 -3
- package/src/components/SidebarMenu/types.ts +0 -54
- package/src/components/Slider.vue +0 -181
- package/src/components/Switch.vue +0 -51
- package/src/components/Tabes/Tabes.vue +0 -112
- package/src/components/Tabes/index.ts +0 -2
- package/src/components/Tabes/types.ts +0 -17
- package/src/components/Textarea.vue +0 -48
- package/src/components/ThemeToggle.vue +0 -14
- package/src/components/Timeline.vue +0 -250
- package/src/components/ToastNotification.vue +0 -257
- package/src/components/Tooltip.vue +0 -25
- package/src/components/Workbook/Sheet.vue +0 -185
- package/src/components/Workbook/Workbook.vue +0 -231
- package/src/components/Workbook/WorkbookAddButton.vue +0 -17
- package/src/components/Workbook/index.ts +0 -3
- package/src/components/Workbook/types.ts +0 -43
- package/src/composables/useKeyStroke.ts +0 -291
- package/src/composables/useNotifications.ts +0 -206
- package/src/composables/useTheme.ts +0 -55
- package/src/core/config.ts +0 -37
- package/src/core/index.ts +0 -49
- package/src/css/base.css +0 -148
- package/src/css/input.css +0 -61
- package/src/css/main.css +0 -6
- package/src/css/theme.css +0 -344
- package/src/directives/vRipple.ts +0 -38
- package/src/index.ts +0 -53
- package/src/main.ts +0 -5
- package/src/playground/Playground.vue +0 -429
- package/src/playground/composables/useGetUsers.ts +0 -538
- package/src/playground/demos/AccordionDemo.vue +0 -361
- package/src/playground/demos/AlertDemo.vue +0 -36
- package/src/playground/demos/AvatarDemo.vue +0 -41
- package/src/playground/demos/AvatarUploaderDemo.vue +0 -133
- package/src/playground/demos/BadgeDemo.vue +0 -31
- package/src/playground/demos/BadgesDemo.vue +0 -26
- package/src/playground/demos/ButtonDemo.vue +0 -99
- package/src/playground/demos/ButtonGroupDemo.vue +0 -39
- package/src/playground/demos/ButtonsDemo.vue +0 -111
- package/src/playground/demos/CarouselDemo.vue +0 -135
- package/src/playground/demos/CheckBoxDemo.vue +0 -43
- package/src/playground/demos/ChipDemo.vue +0 -190
- package/src/playground/demos/ChoiceBoxDemo.vue +0 -160
- package/src/playground/demos/ColorPickerDemo.vue +0 -30
- package/src/playground/demos/ColorsDemo.vue +0 -295
- package/src/playground/demos/DataTableDemo.vue +0 -215
- package/src/playground/demos/DatePickerDemo.vue +0 -43
- package/src/playground/demos/DisplayDemo.vue +0 -101
- package/src/playground/demos/DropdownDemo.vue +0 -651
- package/src/playground/demos/FilePickerDemo.vue +0 -175
- package/src/playground/demos/FileTreeDemo.vue +0 -150
- package/src/playground/demos/FormDemo.vue +0 -1144
- package/src/playground/demos/HeatmapDemo.vue +0 -467
- package/src/playground/demos/IconPickerDemo.vue +0 -27
- package/src/playground/demos/InputDemo.vue +0 -80
- package/src/playground/demos/InputsDemo.vue +0 -127
- package/src/playground/demos/LabelDemo.vue +0 -32
- package/src/playground/demos/MasonryDemo.vue +0 -241
- package/src/playground/demos/ModalDemo.vue +0 -67
- package/src/playground/demos/MultiSelectDemo.vue +0 -300
- package/src/playground/demos/NavbarDemo.vue +0 -59
- package/src/playground/demos/NavigationDemo.vue +0 -116
- package/src/playground/demos/OTPInputDemo.vue +0 -170
- package/src/playground/demos/OverlaysDemo.vue +0 -104
- package/src/playground/demos/PaginationDemo.vue +0 -130
- package/src/playground/demos/PricingPlanDemo.vue +0 -110
- package/src/playground/demos/SidePanelDemo.vue +0 -45
- package/src/playground/demos/SidebarMenuDemo.vue +0 -170
- package/src/playground/demos/SliderDemo.vue +0 -48
- package/src/playground/demos/SwitchDemo.vue +0 -40
- package/src/playground/demos/TabesDemo.vue +0 -178
- package/src/playground/demos/TextareaDemo.vue +0 -31
- package/src/playground/demos/ThemeToggleDemo.vue +0 -20
- package/src/playground/demos/TimelineDemo.vue +0 -43
- package/src/playground/demos/ToastDemo.vue +0 -111
- package/src/playground/demos/TooltipDemo.vue +0 -30
- package/src/playground/demos/WorkbookDemo.vue +0 -227
- package/src/types/alert.type.ts +0 -11
- package/src/types/button.ts +0 -36
- package/src/types/buttongroup.type.ts +0 -1
- package/src/types/form.type.ts +0 -75
- package/src/types/index.ts +0 -11
- package/src/types/navbar.type.ts +0 -28
- package/src/types/sidepanel.type.ts +0 -14
- package/src/types/styles.ts +0 -42
- package/src/types/timeline.type.ts +0 -11
- package/src/utils/index.ts +0 -2
- package/src/utils/object.ts +0 -40
- package/tsconfig.app.json +0 -27
- package/tsconfig.json +0 -48
- package/tsconfig.node.json +0 -18
- package/tsconfig.node.tsbuildinfo +0 -1
- package/tsconfig.tsbuildinfo +0 -1
- package/vercel.json +0 -8
- package/vite.config.d.ts +0 -2
- package/vite.config.js +0 -63
- package/vite.config.ts +0 -64
- package/vite.config.vercel.ts +0 -17
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, onUnmounted, ref, watch } from 'vue'
|
|
3
|
-
import Button from './Button.vue'
|
|
4
|
-
import { useKeyStroke } from '../composables/useKeyStroke'
|
|
5
|
-
import type { SidePanelPosition, SidePanelSize } from '@/types'
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
show: boolean
|
|
9
|
-
title?: string
|
|
10
|
-
description?: string
|
|
11
|
-
position?: SidePanelPosition
|
|
12
|
-
size?: SidePanelSize
|
|
13
|
-
closeOutside?: boolean
|
|
14
|
-
hideCloseButton?: boolean
|
|
15
|
-
class?: string
|
|
16
|
-
overlayClass?: string
|
|
17
|
-
triggerClass?: string
|
|
18
|
-
backdrop?: boolean
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
22
|
-
show: false,
|
|
23
|
-
position: 'right',
|
|
24
|
-
size: 'md',
|
|
25
|
-
closeOutside: true,
|
|
26
|
-
hideCloseButton: false,
|
|
27
|
-
backdrop: true,
|
|
28
|
-
class: '',
|
|
29
|
-
overlayClass: '',
|
|
30
|
-
triggerClass: '',
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const emit = defineEmits<{
|
|
34
|
-
(e: 'close'): void
|
|
35
|
-
(e: 'update:show', value: boolean): void
|
|
36
|
-
(e: 'onOpen'): void
|
|
37
|
-
(e: 'onAfterOpen'): void
|
|
38
|
-
(e: 'onAfterClose'): void
|
|
39
|
-
}>()
|
|
40
|
-
|
|
41
|
-
const visible = ref(props.show)
|
|
42
|
-
|
|
43
|
-
watch(
|
|
44
|
-
() => props.show,
|
|
45
|
-
(val) => {
|
|
46
|
-
visible.value = val
|
|
47
|
-
if (val) emit('onOpen')
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
const handleOpen = () => {
|
|
52
|
-
visible.value = true
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const close = () => {
|
|
56
|
-
visible.value = false
|
|
57
|
-
emit('update:show', false)
|
|
58
|
-
emit('close')
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const handleBackdropClick = () => {
|
|
62
|
-
if (props.closeOutside) {
|
|
63
|
-
close()
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Escape key handling
|
|
68
|
-
const { onKeyStroke } = useKeyStroke()
|
|
69
|
-
onKeyStroke('Escape', close)
|
|
70
|
-
|
|
71
|
-
// Prevent body scroll when open
|
|
72
|
-
watch(visible, (val) => {
|
|
73
|
-
if (val) {
|
|
74
|
-
document.body.style.overflow = 'hidden'
|
|
75
|
-
} else {
|
|
76
|
-
document.body.style.overflow = ''
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
// Clean up on unmount
|
|
81
|
-
onUnmounted(() => {
|
|
82
|
-
document.body.style.overflow = ''
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
const sizeClasses: Record<SidePanelSize, string> = {
|
|
86
|
-
sm: 'max-w-sm',
|
|
87
|
-
md: 'max-w-md',
|
|
88
|
-
lg: 'max-w-lg',
|
|
89
|
-
xl: 'max-w-xl',
|
|
90
|
-
full: 'max-w-full',
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const positionClasses = computed(() => {
|
|
94
|
-
return props.position === 'left' ? 'left-0' : 'right-0'
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
const transitionName = computed(() => {
|
|
98
|
-
return props.position === 'left' ? 'slide-left' : 'slide-right'
|
|
99
|
-
})
|
|
100
|
-
</script>
|
|
101
|
-
|
|
102
|
-
<template>
|
|
103
|
-
<span @click.stop="handleOpen" :class="`${triggerClass}`">
|
|
104
|
-
<slot name="trigger" />
|
|
105
|
-
</span>
|
|
106
|
-
<Teleport to="body">
|
|
107
|
-
<Transition
|
|
108
|
-
enter-active-class="transition-opacity duration-300 ease-out"
|
|
109
|
-
enter-from-class="opacity-0"
|
|
110
|
-
enter-to-class="opacity-100"
|
|
111
|
-
leave-active-class="transition-opacity duration-200 ease-in"
|
|
112
|
-
leave-from-class="opacity-100"
|
|
113
|
-
leave-to-class="opacity-0">
|
|
114
|
-
<div
|
|
115
|
-
v-if="visible"
|
|
116
|
-
class="fixed inset-0 z-50 bg-[#00000077]"
|
|
117
|
-
:class="[overlayClass, { 'backdrop-blur-[2px]': backdrop }]"
|
|
118
|
-
@click="handleBackdropClick"></div>
|
|
119
|
-
</Transition>
|
|
120
|
-
|
|
121
|
-
<Transition
|
|
122
|
-
:name="transitionName"
|
|
123
|
-
@after-enter="$emit('onAfterOpen')"
|
|
124
|
-
@after-leave="$emit('onAfterClose')">
|
|
125
|
-
<div
|
|
126
|
-
v-if="visible"
|
|
127
|
-
class="sidepanel-body fixed inset-y-0 z-50 flex flex-col bg-body shadow-xl border transition-transform duration-300 ease-in-out w-full"
|
|
128
|
-
:class="[sizeClasses[size], positionClasses, props.class]">
|
|
129
|
-
<!-- Header -->
|
|
130
|
-
<div
|
|
131
|
-
v-if="title || $slots.header"
|
|
132
|
-
class="flex-none flex items-center justify-between px-6 py-2 border-b border-border">
|
|
133
|
-
<slot name="header">
|
|
134
|
-
<div>
|
|
135
|
-
<h3 class="text-lg font-bold text-foreground">
|
|
136
|
-
{{ title }}
|
|
137
|
-
</h3>
|
|
138
|
-
<p v-if="description" class="mt-1 text-sm text-muted-foreground">
|
|
139
|
-
{{ description }}
|
|
140
|
-
</p>
|
|
141
|
-
</div>
|
|
142
|
-
</slot>
|
|
143
|
-
<Button
|
|
144
|
-
v-if="!hideCloseButton"
|
|
145
|
-
rounded="full"
|
|
146
|
-
size="sm"
|
|
147
|
-
variant="ghost"
|
|
148
|
-
icon="lucide:x"
|
|
149
|
-
@click="close"
|
|
150
|
-
class="-mr-2" />
|
|
151
|
-
</div>
|
|
152
|
-
|
|
153
|
-
<!-- Body -->
|
|
154
|
-
<div class="flex-1 overflow-y-auto px-6 py-4">
|
|
155
|
-
<slot :close="close" />
|
|
156
|
-
</div>
|
|
157
|
-
|
|
158
|
-
<!-- Footer -->
|
|
159
|
-
<div v-if="$slots.footer" class="flex-none px-6 py-4 border-t border-border bg-muted/50">
|
|
160
|
-
<slot name="footer" :close="close" />
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</Transition>
|
|
164
|
-
</Teleport>
|
|
165
|
-
</template>
|
|
166
|
-
|
|
167
|
-
<style scoped>
|
|
168
|
-
.slide-right-enter-active,
|
|
169
|
-
.slide-right-leave-active,
|
|
170
|
-
.slide-left-enter-active,
|
|
171
|
-
.slide-left-leave-active {
|
|
172
|
-
transition: transform 0.3s ease-in-out;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.slide-right-enter-from,
|
|
176
|
-
.slide-right-leave-to {
|
|
177
|
-
transform: translateX(100%);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.slide-left-enter-from,
|
|
181
|
-
.slide-left-leave-to {
|
|
182
|
-
transform: translateX(-100%);
|
|
183
|
-
}
|
|
184
|
-
</style>
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { provide, ref, watch, reactive, computed } from 'vue'
|
|
3
|
-
import { useRoute } from 'vue-router'
|
|
4
|
-
import type { SidebarMenuProps, SidebarMenuItemSchema, SidebarMenuContext } from './types'
|
|
5
|
-
import SidebarMenuItem from './SidebarMenuItem.vue'
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(defineProps<SidebarMenuProps>(), {
|
|
8
|
-
items: () => [],
|
|
9
|
-
allowMultiple: true,
|
|
10
|
-
indentSize: 12,
|
|
11
|
-
variant: 'default',
|
|
12
|
-
defaultExpanded: () => [],
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
const route = useRoute()
|
|
16
|
-
|
|
17
|
-
// Internal State
|
|
18
|
-
const expandedItems = ref<string[]>([...props.defaultExpanded])
|
|
19
|
-
const activeItem = ref<string | null>(null)
|
|
20
|
-
|
|
21
|
-
// Helper: Check if item is active
|
|
22
|
-
const isItemActive = (item: SidebarMenuItemSchema, path: string): boolean => {
|
|
23
|
-
// 1. Check ID equality with activeItem (manual set)
|
|
24
|
-
if (activeItem.value === item.id) return true
|
|
25
|
-
|
|
26
|
-
// 2. Check Route Path
|
|
27
|
-
if (item.to) {
|
|
28
|
-
const itemPath = typeof item.to === 'string' ? item.to : (item.to as any).path
|
|
29
|
-
if (itemPath) {
|
|
30
|
-
// Exact match or Prefix? Usually exact for link, prefix for group?
|
|
31
|
-
// Sidebar links usually exact match or "active class" logic.
|
|
32
|
-
// Simple exact + optional trailing slash logic
|
|
33
|
-
if (path === itemPath) return true
|
|
34
|
-
if (path.startsWith(itemPath) && itemPath !== '/' && itemPath.length > 1) return true
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return false
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Logic to find active item and expand parents
|
|
41
|
-
const syncWithRoute = (
|
|
42
|
-
items: SidebarMenuItemSchema[],
|
|
43
|
-
path: string,
|
|
44
|
-
parents: string[] = []
|
|
45
|
-
): boolean => {
|
|
46
|
-
let found = false
|
|
47
|
-
for (const item of items) {
|
|
48
|
-
const id = item.id || item.label
|
|
49
|
-
// Check if this item is the active one
|
|
50
|
-
if (isItemActive(item, path)) {
|
|
51
|
-
activeItem.value = id
|
|
52
|
-
// Expand all parents
|
|
53
|
-
parents.forEach((pId) => {
|
|
54
|
-
if (!expandedItems.value.includes(pId)) expandedItems.value.push(pId)
|
|
55
|
-
})
|
|
56
|
-
found = true
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Recurse
|
|
60
|
-
if (item.children) {
|
|
61
|
-
const childFound = syncWithRoute(item.children, path, [...parents, id])
|
|
62
|
-
if (childFound) {
|
|
63
|
-
// If child is active, also ensure this parent is expanded?
|
|
64
|
-
// Yes, if we want auto-expand.
|
|
65
|
-
// Logic above "Expand all parents" handles ancestors.
|
|
66
|
-
// But if we are "parents" list, we are already added.
|
|
67
|
-
found = true
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return found
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Watch Route
|
|
75
|
-
watch(
|
|
76
|
-
() => route?.path,
|
|
77
|
-
(path) => {
|
|
78
|
-
// Only auto-expand if utilizing Tree mode mostly?
|
|
79
|
-
// Or Popover too? Popover usually doesn't "expand" in terms of pushing content, but "active" state matters.
|
|
80
|
-
// For Tree mode (default), we definitely want to expand.
|
|
81
|
-
if (path) syncWithRoute(props.items, path)
|
|
82
|
-
},
|
|
83
|
-
{ immediate: true }
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
// Also watch items change to re-sync
|
|
87
|
-
watch(
|
|
88
|
-
() => props.items,
|
|
89
|
-
() => {
|
|
90
|
-
if (route?.path) syncWithRoute(props.items, route.path)
|
|
91
|
-
},
|
|
92
|
-
{ deep: true }
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
const toggleExpand = (id: string) => {
|
|
96
|
-
const isExpanded = expandedItems.value.includes(id)
|
|
97
|
-
|
|
98
|
-
if (isExpanded) {
|
|
99
|
-
expandedItems.value = expandedItems.value.filter((item) => item !== id)
|
|
100
|
-
} else {
|
|
101
|
-
if (props.allowMultiple) {
|
|
102
|
-
expandedItems.value.push(id)
|
|
103
|
-
} else {
|
|
104
|
-
// Single mode: close siblings?
|
|
105
|
-
// Truly "Accordion" usually means ONLY one at this level can be open.
|
|
106
|
-
// But implementing strict single-open globally is tricky for deep nesting.
|
|
107
|
-
// A simple approach for standard sidebar: Close ALL others? Or just close others at same level?
|
|
108
|
-
// "allowMultiple: false" usually implies global single expanded or per level.
|
|
109
|
-
// Let's implement: Replace current expanded list with just this one (and its parents?)
|
|
110
|
-
// To keep parents open, we'd need to know lineage.
|
|
111
|
-
// SIMPLIFICATION for this task: Just single mode logic = Replace array if at root, but deeper logic needs parent awareness.
|
|
112
|
-
// FOR NOW: Simple toggle, usually sufficient. If users want strict accordion, we might need more complex tree traversal or emitting events up.
|
|
113
|
-
// Let's stick to standard behavior: simply add it. If not allowMultiple, we clear others?
|
|
114
|
-
// Let's clear others for now to mimic strict accordion.
|
|
115
|
-
// warning: clearing others might close parents! That's bad.
|
|
116
|
-
// Better to default to standard multiple for sidebars as safe default.
|
|
117
|
-
expandedItems.value.push(id)
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const setActive = (id: string | null) => {
|
|
123
|
-
activeItem.value = id
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Provide context
|
|
127
|
-
// We use reactive to auto-unwrap Refs for consumers
|
|
128
|
-
|
|
129
|
-
const context = reactive({
|
|
130
|
-
activeItem,
|
|
131
|
-
expandedItems,
|
|
132
|
-
toggleExpand,
|
|
133
|
-
setActive,
|
|
134
|
-
indentSize: computed(() => props.indentSize),
|
|
135
|
-
variant: computed(() => props.variant),
|
|
136
|
-
renderMode: computed(() => props.renderMode || 'tree'),
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
provide('sidebar-menu-ctx', context)
|
|
140
|
-
</script>
|
|
141
|
-
|
|
142
|
-
<template>
|
|
143
|
-
<nav class="flex flex-col space-y-1 w-full" role="tree" aria-label="Sidebar Menu">
|
|
144
|
-
<SidebarMenuItem v-for="item in items" :key="item.id || item.label" :item="item" />
|
|
145
|
-
</nav>
|
|
146
|
-
</template>
|
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, inject } from 'vue'
|
|
3
|
-
import Icon from '../Icon.vue'
|
|
4
|
-
import type { SidebarMenuItemSchema, SidebarMenuContext } from './types'
|
|
5
|
-
import { Dropdown } from '@/components/Dropdown'
|
|
6
|
-
import type { IDropdownOptions, IDropdownOption } from '@/types/styles'
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
item: SidebarMenuItemSchema
|
|
10
|
-
depth?: number
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
14
|
-
depth: 0,
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
const context = inject<SidebarMenuContext>('sidebar-menu-ctx')
|
|
18
|
-
|
|
19
|
-
if (!context) {
|
|
20
|
-
throw new Error('SidebarMenuItem must be used within a SidebarMenu')
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Render Mode Logic
|
|
24
|
-
const computedRenderMode = computed(() => {
|
|
25
|
-
return props.item.renderMode || context.renderMode || 'tree'
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
const usePopover = computed(() => {
|
|
29
|
-
return computedRenderMode.value === 'popover' && hasChildren.value
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const itemId = computed(() => {
|
|
33
|
-
if (props.item.id) return props.item.id
|
|
34
|
-
if (props.item.to && typeof props.item.to === 'string') return props.item.to
|
|
35
|
-
return props.item.label
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
const hasChildren = computed(() => !!props.item.children?.length)
|
|
39
|
-
|
|
40
|
-
const isExpanded = computed(() => {
|
|
41
|
-
if (usePopover.value) return false
|
|
42
|
-
return context.expandedItems.includes(itemId.value)
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const isActive = computed(() => {
|
|
46
|
-
// Simple check against context activeItem which is now managed by SidebarMenu
|
|
47
|
-
// For visual highlighting, SidebarMenu sets activeItem based on route.
|
|
48
|
-
return context.activeItem === itemId.value
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
const handleClick = (e: MouseEvent) => {
|
|
52
|
-
if (props.item.disabled) return
|
|
53
|
-
|
|
54
|
-
if (hasChildren.value) {
|
|
55
|
-
if (!props.item.to && !props.item.href) {
|
|
56
|
-
if (!usePopover.value) {
|
|
57
|
-
context.toggleExpand(itemId.value)
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (props.item.action) {
|
|
63
|
-
props.item.action(props.item)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// In Popover mode, Dropdown handles selection if we use options.
|
|
67
|
-
// But here we are the TRIGGER for the root popover OR a tree item.
|
|
68
|
-
// If we click the trigger, we don't necessarily set active unless it's a link?
|
|
69
|
-
// Usually folder clicks don't set active.
|
|
70
|
-
if (!hasChildren.value || props.item.to) {
|
|
71
|
-
context.setActive(itemId.value)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const handleChevronClick = (e: Event) => {
|
|
76
|
-
e.stopPropagation()
|
|
77
|
-
if (!usePopover.value) {
|
|
78
|
-
context.toggleExpand(itemId.value)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Styling
|
|
83
|
-
const indentSize = computed(() => context.indentSize || 12)
|
|
84
|
-
const itemStyle = computed(() => {
|
|
85
|
-
return {
|
|
86
|
-
marginLeft: `${props.depth * indentSize.value}px`,
|
|
87
|
-
width: `calc(100% - ${props.depth * indentSize.value}px)`,
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
const itemClass = computed(() => {
|
|
92
|
-
const base =
|
|
93
|
-
'group flex items-center justify-between py-1.5 px-2 text-sm font-medium rounded-md transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 relative border border-transparent select-none cursor-pointer'
|
|
94
|
-
|
|
95
|
-
let variantClass = ''
|
|
96
|
-
if (isActive.value) {
|
|
97
|
-
variantClass = 'bg-primary/5 text-primary'
|
|
98
|
-
} else {
|
|
99
|
-
variantClass = 'text-muted-foreground hover:bg-accent/80 hover:text-foreground'
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (props.item.disabled) {
|
|
103
|
-
variantClass = 'opacity-50 cursor-not-allowed pointer-events-none'
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return `${base} ${variantClass} ${props.item.class || ''}`
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
// Mappers for Dropdown
|
|
110
|
-
const mapItemToDropdown = (item: SidebarMenuItemSchema): IDropdownOption => {
|
|
111
|
-
return {
|
|
112
|
-
label: item.label,
|
|
113
|
-
value: item.id || item.label, // Use stable ID for value
|
|
114
|
-
icon: item.icon,
|
|
115
|
-
disabled: item.disabled,
|
|
116
|
-
children: item.children ? item.children.map(mapItemToDropdown) : undefined,
|
|
117
|
-
data: item, // Store full item schema in data for custom slot rendering
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const dropdownOptions = computed<IDropdownOptions>(() => {
|
|
122
|
-
if (!props.item.children) return []
|
|
123
|
-
return props.item.children.map(mapItemToDropdown)
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
// We need a separate click handler for items inside the dropdown (emitted by Dropdown)
|
|
127
|
-
const handleDropdownSelect = (option: any) => {
|
|
128
|
-
// The option.data contains the SidebarMenuItemSchema
|
|
129
|
-
const schema = option.data as SidebarMenuItemSchema
|
|
130
|
-
if (schema) {
|
|
131
|
-
if (schema.action) schema.action(schema)
|
|
132
|
-
// If it has a link, navigation happens via router-link in slot technically?
|
|
133
|
-
// Wait, DropdownItem renders the slot. If slot contains router-link, click propagates?
|
|
134
|
-
// Dropdown usually handles click and emits select.
|
|
135
|
-
// If we use <router-link> in the slot, the link click happens.
|
|
136
|
-
// We should ensure we update active state.
|
|
137
|
-
|
|
138
|
-
const id = schema.id || schema.label || (typeof schema.to === 'string' ? schema.to : '')
|
|
139
|
-
if (id) context.setActive(id)
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Animation Hooks (Tree only)
|
|
144
|
-
const beforeEnter = (el: Element) => {
|
|
145
|
-
const element = el as HTMLElement
|
|
146
|
-
element.style.height = '0'
|
|
147
|
-
element.style.opacity = '0'
|
|
148
|
-
}
|
|
149
|
-
const enter = (el: Element) => {
|
|
150
|
-
const element = el as HTMLElement
|
|
151
|
-
element.style.height = element.scrollHeight + 'px'
|
|
152
|
-
element.style.opacity = '1'
|
|
153
|
-
}
|
|
154
|
-
const afterEnter = (el: Element) => {
|
|
155
|
-
const element = el as HTMLElement
|
|
156
|
-
element.style.height = 'auto'
|
|
157
|
-
element.style.overflow = 'visible'
|
|
158
|
-
}
|
|
159
|
-
const beforeLeave = (el: Element) => {
|
|
160
|
-
const element = el as HTMLElement
|
|
161
|
-
element.style.height = element.scrollHeight + 'px'
|
|
162
|
-
element.style.overflow = 'hidden' // Force hidden during leave
|
|
163
|
-
element.style.opacity = '1'
|
|
164
|
-
}
|
|
165
|
-
const leave = (el: Element) => {
|
|
166
|
-
const element = el as HTMLElement
|
|
167
|
-
element.style.height = '0'
|
|
168
|
-
element.style.opacity = '0'
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const componentIs = computed(() => {
|
|
172
|
-
if (props.item.to) return 'router-link'
|
|
173
|
-
if (props.item.href) return 'a'
|
|
174
|
-
return 'button'
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
const componentProps = computed(() => {
|
|
178
|
-
if (props.item.to) return { to: props.item.to }
|
|
179
|
-
if (props.item.href)
|
|
180
|
-
return {
|
|
181
|
-
href: props.item.href,
|
|
182
|
-
target: '_blank',
|
|
183
|
-
rel: 'noopener noreferrer',
|
|
184
|
-
}
|
|
185
|
-
return { type: 'button' }
|
|
186
|
-
})
|
|
187
|
-
</script>
|
|
188
|
-
|
|
189
|
-
<template>
|
|
190
|
-
<div class="w-full relative">
|
|
191
|
-
<!-- Case 1: Popover Mode (Wrapper is Dropdown) -->
|
|
192
|
-
<Dropdown
|
|
193
|
-
v-if="usePopover"
|
|
194
|
-
position="right-start"
|
|
195
|
-
:offset="[0, 10]"
|
|
196
|
-
class="w-full"
|
|
197
|
-
:searchable="false"
|
|
198
|
-
width="220px"
|
|
199
|
-
:options="dropdownOptions"
|
|
200
|
-
@onSelect="handleDropdownSelect">
|
|
201
|
-
<template #trigger="{ isOpen }">
|
|
202
|
-
<!-- Helper Trigger Div to handle layout -->
|
|
203
|
-
<div class="w-full">
|
|
204
|
-
<component
|
|
205
|
-
:is="componentIs"
|
|
206
|
-
v-bind="componentProps"
|
|
207
|
-
:class="[itemClass, isOpen ? 'bg-muted text-foreground' : '']"
|
|
208
|
-
:style="itemStyle"
|
|
209
|
-
:aria-haspopup="true"
|
|
210
|
-
:aria-expanded="isOpen"
|
|
211
|
-
@click="handleClick">
|
|
212
|
-
<div class="flex items-center gap-2.5 min-w-0 flex-1">
|
|
213
|
-
<Icon
|
|
214
|
-
v-if="item.icon"
|
|
215
|
-
:icon="item.icon"
|
|
216
|
-
class="h-4 w-4 shrink-0 transition-colors opacity-70 group-hover:opacity-100"
|
|
217
|
-
:class="isActive || isOpen ? 'opacity-100' : ''" />
|
|
218
|
-
<span class="truncate leading-none pt-0.5">{{ item.label }}</span>
|
|
219
|
-
<span
|
|
220
|
-
v-if="item.badge"
|
|
221
|
-
class="ml-auto inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium"
|
|
222
|
-
:class="item.badgeClass || 'bg-muted text-muted-foreground'">
|
|
223
|
-
{{ item.badge }}
|
|
224
|
-
</span>
|
|
225
|
-
</div>
|
|
226
|
-
<!-- Chevron Right for Popover -->
|
|
227
|
-
<div
|
|
228
|
-
class="ml-1.5 flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground">
|
|
229
|
-
<Icon icon="lucide:chevron-right" class="h-3 w-3" />
|
|
230
|
-
</div>
|
|
231
|
-
</component>
|
|
232
|
-
</div>
|
|
233
|
-
</template>
|
|
234
|
-
|
|
235
|
-
<!-- Custom rendering for dropdown items (recursive via Dropdown logic) -->
|
|
236
|
-
<!-- Dropdown exposes 'item' slot for each option -->
|
|
237
|
-
<template #item="{ option }">
|
|
238
|
-
<!-- We want to render this similarly to our sidebar item but inside dropdown -->
|
|
239
|
-
<!-- Use router-link if 'to' is present in the schema (option.data) -->
|
|
240
|
-
<component
|
|
241
|
-
:is="option.data?.to ? 'router-link' : option.data?.href ? 'a' : 'div'"
|
|
242
|
-
:to="option.data?.to"
|
|
243
|
-
:href="option.data?.href"
|
|
244
|
-
target="option.data?.href ? '_blank' : undefined"
|
|
245
|
-
class="flex items-center w-full gap-2 text-sm">
|
|
246
|
-
<Icon v-if="option.icon" :icon="option.icon" class="h-4 w-4 shrink-0 opacity-70" />
|
|
247
|
-
<span class="truncate flex-1">{{ option.label }}</span>
|
|
248
|
-
<span
|
|
249
|
-
v-if="option.data?.badge"
|
|
250
|
-
class="ml-auto inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium"
|
|
251
|
-
:class="option.data?.badgeClass || 'bg-muted text-muted-foreground'">
|
|
252
|
-
{{ option.data.badge }}
|
|
253
|
-
</span>
|
|
254
|
-
</component>
|
|
255
|
-
</template>
|
|
256
|
-
</Dropdown>
|
|
257
|
-
|
|
258
|
-
<!-- Case 2: Tree Mode (Standard) -->
|
|
259
|
-
<template v-else>
|
|
260
|
-
<!-- Item Row -->
|
|
261
|
-
<component
|
|
262
|
-
:is="componentIs"
|
|
263
|
-
v-bind="componentProps"
|
|
264
|
-
:class="itemClass"
|
|
265
|
-
:style="itemStyle"
|
|
266
|
-
:aria-expanded="hasChildren ? isExpanded : undefined"
|
|
267
|
-
:aria-current="isActive ? 'page' : undefined"
|
|
268
|
-
@click="handleClick">
|
|
269
|
-
<div class="flex items-center gap-2.5 min-w-0 flex-1">
|
|
270
|
-
<Icon
|
|
271
|
-
v-if="item.icon"
|
|
272
|
-
:icon="item.icon"
|
|
273
|
-
class="h-4 w-4 shrink-0 transition-colors opacity-70 group-hover:opacity-100"
|
|
274
|
-
:class="isActive ? 'opacity-100' : ''" />
|
|
275
|
-
<span class="truncate leading-none pt-0.5">{{ item.label }}</span>
|
|
276
|
-
<span
|
|
277
|
-
v-if="item.badge"
|
|
278
|
-
class="ml-auto inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium"
|
|
279
|
-
:class="item.badgeClass || 'bg-muted text-muted-foreground'">
|
|
280
|
-
{{ item.badge }}
|
|
281
|
-
</span>
|
|
282
|
-
</div>
|
|
283
|
-
|
|
284
|
-
<!-- Chevron Down for Tree -->
|
|
285
|
-
<div
|
|
286
|
-
v-if="hasChildren"
|
|
287
|
-
role="button"
|
|
288
|
-
tabindex="0"
|
|
289
|
-
class="ml-1.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-all"
|
|
290
|
-
@click="handleChevronClick"
|
|
291
|
-
@keydown.enter.space.prevent="handleChevronClick">
|
|
292
|
-
<Icon
|
|
293
|
-
icon="lucide:chevron-down"
|
|
294
|
-
class="h-3 w-3 transition-transform duration-200"
|
|
295
|
-
:class="{ 'rotate-180': isExpanded }" />
|
|
296
|
-
</div>
|
|
297
|
-
</component>
|
|
298
|
-
|
|
299
|
-
<!-- Children Recursion -->
|
|
300
|
-
<Transition
|
|
301
|
-
name="sidebar-slide"
|
|
302
|
-
@before-enter="beforeEnter"
|
|
303
|
-
@enter="enter"
|
|
304
|
-
@after-enter="afterEnter"
|
|
305
|
-
@before-leave="beforeLeave"
|
|
306
|
-
@leave="leave">
|
|
307
|
-
<div
|
|
308
|
-
v-if="hasChildren && isExpanded"
|
|
309
|
-
class="overflow-hidden transition-all duration-300 ease-in-out relative">
|
|
310
|
-
<!-- Tree Guide -->
|
|
311
|
-
<div
|
|
312
|
-
v-if="context.variant === 'default'"
|
|
313
|
-
class="absolute top-0 bottom-2 w-px bg-border"
|
|
314
|
-
:style="{
|
|
315
|
-
left: `${(depth + 1) * indentSize - indentSize / 2}px`,
|
|
316
|
-
}"></div>
|
|
317
|
-
|
|
318
|
-
<div class="mt-0.5 space-y-0.5">
|
|
319
|
-
<SidebarMenuItem
|
|
320
|
-
v-for="child in item.children"
|
|
321
|
-
:key="child.id || child.label"
|
|
322
|
-
:item="child"
|
|
323
|
-
:depth="depth + 1" />
|
|
324
|
-
</div>
|
|
325
|
-
</div>
|
|
326
|
-
</Transition>
|
|
327
|
-
</template>
|
|
328
|
-
</div>
|
|
329
|
-
</template>
|
|
330
|
-
|
|
331
|
-
<style scoped>
|
|
332
|
-
/* No extra styles */
|
|
333
|
-
</style>
|