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,277 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, onMounted, onUnmounted, useSlots } from 'vue'
|
|
3
|
-
import Icon from '../Icon.vue'
|
|
4
|
-
import NavbarItem from './NavbarItem.vue'
|
|
5
|
-
import Button from '../Button.vue'
|
|
6
|
-
import SidePanel from '../SidePanel.vue'
|
|
7
|
-
import Logo from '../Logo.vue' // Assuming Logo exists or using fallback
|
|
8
|
-
import type { NavbarProps } from '@/types/navbar.type'
|
|
9
|
-
|
|
10
|
-
const props = withDefaults(defineProps<NavbarProps>(), {
|
|
11
|
-
variant: 'header',
|
|
12
|
-
position: 'sticky', // default to sticky for modern feels
|
|
13
|
-
centerPosition: 'center',
|
|
14
|
-
glass: true,
|
|
15
|
-
border: true,
|
|
16
|
-
floating: false,
|
|
17
|
-
height: 'h-16',
|
|
18
|
-
width: 'w-64',
|
|
19
|
-
class: '',
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const emit = defineEmits<{
|
|
23
|
-
(e: 'toggle-mobile'): void
|
|
24
|
-
}>()
|
|
25
|
-
|
|
26
|
-
const isMobileMenuOpen = ref(false)
|
|
27
|
-
const isScrolled = ref(false)
|
|
28
|
-
const slots = useSlots()
|
|
29
|
-
|
|
30
|
-
// Scroll detection for styling effects
|
|
31
|
-
const handleScroll = () => {
|
|
32
|
-
isScrolled.value = window.scrollY > 10
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
onMounted(() => {
|
|
36
|
-
window.addEventListener('scroll', handleScroll, { passive: true })
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
onUnmounted(() => {
|
|
40
|
-
window.removeEventListener('scroll', handleScroll)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
// CSS Classes Construction
|
|
44
|
-
const containerClasses = computed(() => {
|
|
45
|
-
const isSidebar = props.variant === 'sidebar'
|
|
46
|
-
|
|
47
|
-
const positionClasses = {
|
|
48
|
-
fixed: 'fixed top-0 left-0 z-40',
|
|
49
|
-
sticky: 'sticky top-0 z-40',
|
|
50
|
-
relative: 'relative z-10',
|
|
51
|
-
absolute: 'absolute top-0 left-0 w-full z-40',
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const base = 'transition-all duration-300 ease-in-out bg-body'
|
|
55
|
-
|
|
56
|
-
// Effects
|
|
57
|
-
const effects = [
|
|
58
|
-
props.glass && (isScrolled.value || isSidebar || props.floating)
|
|
59
|
-
? 'backdrop-blur-md bg-background/80 supports-[backdrop-filter]:bg-background/60'
|
|
60
|
-
: 'bg-background',
|
|
61
|
-
props.border && !props.floating
|
|
62
|
-
? isSidebar
|
|
63
|
-
? 'border-r border-border'
|
|
64
|
-
: 'border-b border-border'
|
|
65
|
-
: '',
|
|
66
|
-
props.floating ? 'm-4 rounded-xl shadow-lg border border-border/50' : '',
|
|
67
|
-
isScrolled.value && !props.floating && !isSidebar && props.position === 'sticky'
|
|
68
|
-
? 'shadow-sm'
|
|
69
|
-
: '',
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
// Layout
|
|
73
|
-
let layout = ''
|
|
74
|
-
if (isSidebar) {
|
|
75
|
-
// Sidebar: Mobile (auto height, full width) -> Desktop (fixed width based on prop, full height constrained to viewport)
|
|
76
|
-
// We use md:max-h-screen to ensure that if the sidebar is sticky/fixed, it never exceeds the viewport height,
|
|
77
|
-
// allowing internal scrolling to work correctly regardless of the main content height.
|
|
78
|
-
layout = `flex flex-col max-md:w-full ${props.width} h-auto md:h-full md:max-h-screen`
|
|
79
|
-
} else {
|
|
80
|
-
// Header Navbar
|
|
81
|
-
// Flexbox with standard gap. Alignment is handled by child margins.
|
|
82
|
-
layout = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${props.height}`
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return [base, positionClasses[props.position], ...effects, layout, props.class].join(' ')
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
const centerClasses = computed(() => {
|
|
89
|
-
if (props.variant === 'sidebar') return 'flex-1 py-4 overflow-y-auto'
|
|
90
|
-
|
|
91
|
-
// Header logic
|
|
92
|
-
switch (props.centerPosition) {
|
|
93
|
-
case 'left':
|
|
94
|
-
// Sits next to Left section. No special margin needed other than global gap.
|
|
95
|
-
return 'flex items-center justify-start'
|
|
96
|
-
case 'right':
|
|
97
|
-
// Pushed to the right (ml-auto), sitting next to Right section.
|
|
98
|
-
return 'flex items-center justify-end ml-auto'
|
|
99
|
-
case 'center':
|
|
100
|
-
default:
|
|
101
|
-
// Tried to center in available space. mx-auto in a flex container pushes against siblings.
|
|
102
|
-
return 'hidden md:flex items-center justify-center mx-auto'
|
|
103
|
-
}
|
|
104
|
-
})
|
|
105
|
-
</script>
|
|
106
|
-
|
|
107
|
-
<template>
|
|
108
|
-
<nav :class="containerClasses" role="navigation">
|
|
109
|
-
<!-- HEADER LAYOUT -->
|
|
110
|
-
<template v-if="variant === 'header'">
|
|
111
|
-
<!-- Left Section -->
|
|
112
|
-
<div class="flex items-center gap-4 shrink-0 z-10">
|
|
113
|
-
<!-- Mobile Toggle -->
|
|
114
|
-
<slot name="mobile-trigger">
|
|
115
|
-
<button
|
|
116
|
-
type="button"
|
|
117
|
-
class="md:hidden p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0"
|
|
118
|
-
@click="isMobileMenuOpen = true">
|
|
119
|
-
<Icon icon="lucide:menu" class="w-5 h-5" />
|
|
120
|
-
<span class="sr-only">Open Menu</span>
|
|
121
|
-
</button>
|
|
122
|
-
</slot>
|
|
123
|
-
|
|
124
|
-
<!-- Logo Slot -->
|
|
125
|
-
<div class="shrink-0">
|
|
126
|
-
<slot name="logo">
|
|
127
|
-
<component
|
|
128
|
-
:is="props.logo ? 'img' : 'div'"
|
|
129
|
-
:src="props.logo"
|
|
130
|
-
class="h-8 w-auto font-bold text-xl flex items-center gap-2">
|
|
131
|
-
<Logo v-if="!props.logo" class="h-6 w-6" />
|
|
132
|
-
<span v-if="!props.logo && props.logoAlt">{{ props.logoAlt }}</span>
|
|
133
|
-
<span v-else-if="!props.logo">Brand</span>
|
|
134
|
-
</component>
|
|
135
|
-
</slot>
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<!-- Left Slot Content -->
|
|
139
|
-
<div class="hidden md:flex items-center gap-1 overflow-x-auto no-scrollbar mask-gradient">
|
|
140
|
-
<slot name="left" />
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
<!-- Center Section -->
|
|
145
|
-
<div
|
|
146
|
-
:class="[
|
|
147
|
-
centerClasses,
|
|
148
|
-
// Width constraint to ensure it doesn't crush others, but allows simple resizing
|
|
149
|
-
'max-w-full',
|
|
150
|
-
]">
|
|
151
|
-
<slot name="center" />
|
|
152
|
-
</div>
|
|
153
|
-
|
|
154
|
-
<!-- Right Section -->
|
|
155
|
-
<!--
|
|
156
|
-
ml-auto ensures this section is ALWAYS pushed to the end.
|
|
157
|
-
Even if centerPosition is 'right', the Center section has ml-auto, so they will stack at the end.
|
|
158
|
-
This logic relies on Flexbox behavior: multiple auto-margins split the available space.
|
|
159
|
-
|
|
160
|
-
Scenario 1: Center='left'. Left -> Center -> (space) -> Right (ml-auto). Correct.
|
|
161
|
-
Scenario 2: Center='center'. Left -> (space/2) -> Center (mx-auto) -> (space/2) -> Right. Correct-ish (Right might need its own push if Center isn't perfect).
|
|
162
|
-
Actually if Center is mx-auto, it consumes equal space on both sides. Right naturally sits at end?
|
|
163
|
-
No, if Center is mx-auto, it tries to centers itself between Left and Right.
|
|
164
|
-
BUT to guarantee Right is at EDGE:
|
|
165
|
-
If we put ml-auto on Right, it consumes all right-side space.
|
|
166
|
-
If Center ALSO has mx-auto (ml-auto + mr-auto), space is shared.
|
|
167
|
-
|
|
168
|
-
To strictly enforce Right at End:
|
|
169
|
-
We should rely on `ml-auto` on the Right section primarily.
|
|
170
|
-
AND modify Center logic:
|
|
171
|
-
- If Right has `ml-auto`, it pins to right.
|
|
172
|
-
- If Center is 'center', it should assume `mx-auto`.
|
|
173
|
-
- If Center is 'right', it also needs `ml-auto` but `mr-4` (gap).
|
|
174
|
-
|
|
175
|
-
Let's keep it simple: Right always gets `ml-0` by default, but if layout gap handles it...
|
|
176
|
-
Wait, `justify-between` on parent was safer for 'center'.
|
|
177
|
-
Let's try:
|
|
178
|
-
Left (natural)
|
|
179
|
-
Center (flex-1 flex justify-center, IF center='center') -> This centers it in remaining space.
|
|
180
|
-
Right (shrink-0)
|
|
181
|
-
-->
|
|
182
|
-
<div
|
|
183
|
-
class="flex items-center gap-2 shrink-0 max-w-[40%] z-10"
|
|
184
|
-
:class="{
|
|
185
|
-
// Always push to end unless Center is pushing it.
|
|
186
|
-
// If Center is 'center' (mx-auto) or 'right' (ml-auto), this naturally falls to end.
|
|
187
|
-
// If Center is 'left', we MUST have ml-auto here.
|
|
188
|
-
'ml-auto': centerPosition === 'left' || centerPosition === 'center',
|
|
189
|
-
// If center is 'right', Center has ml-auto. Right just sits next to it.
|
|
190
|
-
// But if we add ml-auto here too, they might split space? No, flexbox parses strictly.
|
|
191
|
-
}">
|
|
192
|
-
<slot name="right" />
|
|
193
|
-
</div>
|
|
194
|
-
</template>
|
|
195
|
-
|
|
196
|
-
<!-- SIDEBAR LAYOUT -->
|
|
197
|
-
<template v-else>
|
|
198
|
-
<!-- MOBILE HEADER (Visible only on small screens) -->
|
|
199
|
-
<div class="md:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background">
|
|
200
|
-
<!-- Logo -->
|
|
201
|
-
<slot name="logo">
|
|
202
|
-
<div class="font-bold text-xl truncate">Brand</div>
|
|
203
|
-
</slot>
|
|
204
|
-
|
|
205
|
-
<!-- Mobile Toggle -->
|
|
206
|
-
<button
|
|
207
|
-
type="button"
|
|
208
|
-
class="p-2 -mr-2 text-muted-foreground hover:bg-accent rounded-md"
|
|
209
|
-
@click="isMobileMenuOpen = true">
|
|
210
|
-
<Icon icon="lucide:menu" class="w-5 h-5" />
|
|
211
|
-
<span class="sr-only">Open Menu</span>
|
|
212
|
-
</button>
|
|
213
|
-
</div>
|
|
214
|
-
|
|
215
|
-
<!-- DESKTOP SIDEBAR CONTENT -->
|
|
216
|
-
<div class="hidden md:flex flex-col h-full w-full overflow-hidden">
|
|
217
|
-
<!-- Sidebar Header -->
|
|
218
|
-
<div class="h-16 flex items-center px-6 shrink-0 z-10">
|
|
219
|
-
<slot name="logo">
|
|
220
|
-
<div class="font-bold text-xl truncate">Brand</div>
|
|
221
|
-
</slot>
|
|
222
|
-
</div>
|
|
223
|
-
|
|
224
|
-
<!-- Sidebar Body -->
|
|
225
|
-
<div class="flex-1 px-4 py-4 overflow-y-auto space-y-4 scrollbar-thin">
|
|
226
|
-
<slot name="left" />
|
|
227
|
-
<slot />
|
|
228
|
-
<slot name="center" />
|
|
229
|
-
</div>
|
|
230
|
-
|
|
231
|
-
<!-- Sidebar Footer -->
|
|
232
|
-
<div class="p-4 border-t border-border shrink-0 bg-background mt-auto">
|
|
233
|
-
<slot name="right" />
|
|
234
|
-
</div>
|
|
235
|
-
</div>
|
|
236
|
-
</template>
|
|
237
|
-
|
|
238
|
-
<!-- MOBILE DRAWER (reusing SidePanel) -->
|
|
239
|
-
<SidePanel
|
|
240
|
-
v-model:show="isMobileMenuOpen"
|
|
241
|
-
position="left"
|
|
242
|
-
size="sm"
|
|
243
|
-
triggerClass="sm:hidden"
|
|
244
|
-
class="z-60 sm:hidden">
|
|
245
|
-
<template #header>
|
|
246
|
-
<slot name="logo">Brand</slot>
|
|
247
|
-
</template>
|
|
248
|
-
|
|
249
|
-
<div class="flex flex-col space-y-6 pt-4 h-full">
|
|
250
|
-
<!-- Header Variant Menu -->
|
|
251
|
-
<template v-if="variant === 'header'">
|
|
252
|
-
<div class="flex flex-col space-y-1">
|
|
253
|
-
<slot name="mobile-menu">
|
|
254
|
-
<!-- Fallback to using left+center content if no mobile-specific menu provided -->
|
|
255
|
-
<slot name="left" />
|
|
256
|
-
<div class="h-px bg-border my-2"></div>
|
|
257
|
-
<slot name="center" />
|
|
258
|
-
</slot>
|
|
259
|
-
</div>
|
|
260
|
-
</template>
|
|
261
|
-
|
|
262
|
-
<!-- Sidebar Variant Menu (Just replicate sidebar content) -->
|
|
263
|
-
<template v-else>
|
|
264
|
-
<div class="flex flex-col space-y-4 flex-1 overflow-y-auto">
|
|
265
|
-
<slot name="left" />
|
|
266
|
-
<slot />
|
|
267
|
-
<slot name="center" />
|
|
268
|
-
</div>
|
|
269
|
-
</template>
|
|
270
|
-
|
|
271
|
-
<div class="mt-auto pt-4 border-t border-border">
|
|
272
|
-
<slot name="right" />
|
|
273
|
-
</div>
|
|
274
|
-
</div>
|
|
275
|
-
</SidePanel>
|
|
276
|
-
</nav>
|
|
277
|
-
</template>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
orientation?: 'horizontal' | 'vertical'
|
|
6
|
-
class?: string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
10
|
-
orientation: 'horizontal',
|
|
11
|
-
class: '',
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
const classes = computed(() => {
|
|
15
|
-
return [
|
|
16
|
-
'flex',
|
|
17
|
-
props.orientation === 'vertical' ? 'flex-col space-y-1' : 'flex-row items-center space-x-1',
|
|
18
|
-
props.class,
|
|
19
|
-
].join(' ')
|
|
20
|
-
})
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<div :class="classes">
|
|
25
|
-
<slot />
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import Icon from '../Icon.vue'
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
to?: string
|
|
7
|
-
href?: string
|
|
8
|
-
label?: string
|
|
9
|
-
icon?: string
|
|
10
|
-
iconRight?: string
|
|
11
|
-
active?: boolean
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
class?: string
|
|
14
|
-
// 'horizontal' | 'vertical' - usually inferred but can be forced
|
|
15
|
-
orientation?: 'horizontal' | 'vertical'
|
|
16
|
-
// 'default' | 'pill' | 'underline'
|
|
17
|
-
variant?: 'default' | 'pill' | 'underline' | 'ghost'
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
21
|
-
active: false,
|
|
22
|
-
disabled: false,
|
|
23
|
-
class: '',
|
|
24
|
-
orientation: 'horizontal',
|
|
25
|
-
variant: 'ghost',
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
const emit = defineEmits<{
|
|
29
|
-
(e: 'click', event: MouseEvent): void
|
|
30
|
-
}>()
|
|
31
|
-
|
|
32
|
-
const isExternal = computed(() => {
|
|
33
|
-
return props.href && (props.href.startsWith('http') || props.href.startsWith('//'))
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const componentType = computed(() => {
|
|
37
|
-
if (props.to) return 'router-link'
|
|
38
|
-
if (props.href) return 'a'
|
|
39
|
-
return 'button'
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const classes = computed(() => {
|
|
43
|
-
const base =
|
|
44
|
-
'group flex items-center gap-2 px-3 py-2 text-sm font-medium transition-all duration-200 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none cursor-pointer'
|
|
45
|
-
|
|
46
|
-
// Ghost Variant
|
|
47
|
-
if (props.variant === 'ghost') {
|
|
48
|
-
return [
|
|
49
|
-
base,
|
|
50
|
-
'hover:bg-accent hover:text-foreground text-muted-foreground',
|
|
51
|
-
props.active ? 'bg-accent text-accent-foreground font-semibold' : 'text-muted-foreground',
|
|
52
|
-
props.class,
|
|
53
|
-
].join(' ')
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Pill Variant
|
|
57
|
-
if (props.variant === 'pill') {
|
|
58
|
-
return [
|
|
59
|
-
base,
|
|
60
|
-
props.active
|
|
61
|
-
? 'bg-primary text-primary-fg shadow-sm'
|
|
62
|
-
: 'text-muted-foreground hover:bg-accent hover:text-foreground',
|
|
63
|
-
props.class,
|
|
64
|
-
].join(' ')
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Underline Variant
|
|
68
|
-
if (props.variant === 'underline') {
|
|
69
|
-
return [
|
|
70
|
-
base,
|
|
71
|
-
'rounded-none border-b-2',
|
|
72
|
-
props.active
|
|
73
|
-
? 'text-primary border-primary'
|
|
74
|
-
: 'text-muted-foreground border-transparent hover:border-border hover:text-foreground',
|
|
75
|
-
props.class,
|
|
76
|
-
].join(' ')
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Default Variant (link style)
|
|
80
|
-
return [
|
|
81
|
-
base,
|
|
82
|
-
'hover:text-foreground transition-colors',
|
|
83
|
-
props.active ? 'text-foreground font-semibold' : 'text-muted-foreground',
|
|
84
|
-
props.class,
|
|
85
|
-
].join(' ')
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
const handleClick = (e: MouseEvent) => {
|
|
89
|
-
if (props.disabled) {
|
|
90
|
-
e.preventDefault()
|
|
91
|
-
return
|
|
92
|
-
}
|
|
93
|
-
emit('click', e)
|
|
94
|
-
}
|
|
95
|
-
</script>
|
|
96
|
-
|
|
97
|
-
<template>
|
|
98
|
-
<component
|
|
99
|
-
:is="componentType"
|
|
100
|
-
:to="to"
|
|
101
|
-
:href="href"
|
|
102
|
-
:type="componentType === 'button' ? 'button' : undefined"
|
|
103
|
-
:target="isExternal ? '_blank' : undefined"
|
|
104
|
-
:rel="isExternal ? 'noopener noreferrer' : undefined"
|
|
105
|
-
:class="classes"
|
|
106
|
-
@click="handleClick">
|
|
107
|
-
<Icon
|
|
108
|
-
v-if="icon"
|
|
109
|
-
:icon="icon"
|
|
110
|
-
class="h-4 w-4 shrink-0 transition-colors"
|
|
111
|
-
:class="active ? 'text-current' : 'text-muted-foreground group-hover:text-current'" />
|
|
112
|
-
|
|
113
|
-
<span v-if="label || $slots.default" class="flex-1 truncate text-left">
|
|
114
|
-
<slot>{{ label }}</slot>
|
|
115
|
-
</span>
|
|
116
|
-
|
|
117
|
-
<Icon v-if="iconRight" :icon="iconRight" class="h-4 w-4 shrink-0 opacity-70" />
|
|
118
|
-
|
|
119
|
-
<!-- Optional Badge Slot support -->
|
|
120
|
-
<div v-if="$slots.badge" class="ml-auto">
|
|
121
|
-
<slot name="badge" />
|
|
122
|
-
</div>
|
|
123
|
-
</component>
|
|
124
|
-
</template>
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, watch, onMounted, nextTick, computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
length?: number
|
|
6
|
-
modelValue?: string
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
error?: boolean
|
|
9
|
-
autofocus?: boolean
|
|
10
|
-
type?: 'text' | 'number'
|
|
11
|
-
placeholder?: string
|
|
12
|
-
variant?: 'solid' | 'outline' | 'ghost'
|
|
13
|
-
attached?: boolean
|
|
14
|
-
size?: 'sm' | 'md' | 'lg'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
-
length: 6,
|
|
19
|
-
modelValue: '',
|
|
20
|
-
disabled: false,
|
|
21
|
-
error: false,
|
|
22
|
-
autofocus: false,
|
|
23
|
-
type: 'number',
|
|
24
|
-
placeholder: '',
|
|
25
|
-
variant: 'outline',
|
|
26
|
-
attached: false,
|
|
27
|
-
size: 'md',
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const emit = defineEmits<{
|
|
31
|
-
(e: 'update:modelValue', value: string): void
|
|
32
|
-
(e: 'complete', value: string): void
|
|
33
|
-
(e: 'change', value: string): void
|
|
34
|
-
}>()
|
|
35
|
-
|
|
36
|
-
const inputs = ref<(HTMLInputElement | null)[]>([])
|
|
37
|
-
const digits = ref<string[]>(new Array(props.length).fill(''))
|
|
38
|
-
|
|
39
|
-
// Sync from modelValue
|
|
40
|
-
watch(
|
|
41
|
-
() => props.modelValue,
|
|
42
|
-
(newVal) => {
|
|
43
|
-
const val = newVal || ''
|
|
44
|
-
const chars = val.split('').slice(0, props.length)
|
|
45
|
-
const currentJoined = digits.value.join('')
|
|
46
|
-
if (currentJoined !== val) {
|
|
47
|
-
const newDigits = new Array(props.length).fill('')
|
|
48
|
-
chars.forEach((c, i) => (newDigits[i] = c))
|
|
49
|
-
digits.value = newDigits
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{ immediate: true }
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
const updateModel = () => {
|
|
56
|
-
const val = digits.value.join('')
|
|
57
|
-
emit('update:modelValue', val)
|
|
58
|
-
emit('change', val)
|
|
59
|
-
if (val.length === props.length) {
|
|
60
|
-
emit('complete', val)
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const handleInput = (event: Event, index: number) => {
|
|
65
|
-
const target = event.target as HTMLInputElement
|
|
66
|
-
let val = target.value
|
|
67
|
-
|
|
68
|
-
if (props.type === 'number') {
|
|
69
|
-
val = val.replace(/\D/g, '')
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (val.length === 1) {
|
|
73
|
-
digits.value[index] = val
|
|
74
|
-
updateModel()
|
|
75
|
-
if (index < props.length - 1) {
|
|
76
|
-
inputs.value[index + 1]?.focus()
|
|
77
|
-
}
|
|
78
|
-
return
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (!val) {
|
|
82
|
-
digits.value[index] = ''
|
|
83
|
-
updateModel()
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (val.length > 1) {
|
|
88
|
-
const chars = val.split('').slice(0, props.length - index)
|
|
89
|
-
chars.forEach((c, i) => {
|
|
90
|
-
if (index + i < props.length) {
|
|
91
|
-
digits.value[index + i] = c
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
updateModel()
|
|
95
|
-
const nextFocus = Math.min(index + chars.length, props.length - 1)
|
|
96
|
-
inputs.value[nextFocus]?.focus()
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const handleKeyDown = (event: KeyboardEvent, index: number) => {
|
|
101
|
-
const key = event.key
|
|
102
|
-
|
|
103
|
-
if (key === 'Backspace') {
|
|
104
|
-
if (!digits.value[index]) {
|
|
105
|
-
event.preventDefault()
|
|
106
|
-
if (index > 0) {
|
|
107
|
-
digits.value[index - 1] = ''
|
|
108
|
-
inputs.value[index - 1]?.focus()
|
|
109
|
-
updateModel()
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (key === 'ArrowLeft') {
|
|
116
|
-
event.preventDefault()
|
|
117
|
-
if (index > 0) {
|
|
118
|
-
inputs.value[index - 1]?.focus()
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (key === 'ArrowRight') {
|
|
123
|
-
event.preventDefault()
|
|
124
|
-
if (index < props.length - 1) {
|
|
125
|
-
inputs.value[index + 1]?.focus()
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const handlePaste = (event: ClipboardEvent) => {
|
|
131
|
-
event.preventDefault()
|
|
132
|
-
const pastedData = event.clipboardData?.getData('text/plain')
|
|
133
|
-
if (!pastedData) return
|
|
134
|
-
|
|
135
|
-
let paste = pastedData.trim()
|
|
136
|
-
if (props.type === 'number') {
|
|
137
|
-
paste = paste.replace(/\D/g, '')
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const chars = paste.split('').slice(0, props.length)
|
|
141
|
-
const newDigits = [...digits.value]
|
|
142
|
-
chars.forEach((char, i) => {
|
|
143
|
-
newDigits[i] = char
|
|
144
|
-
})
|
|
145
|
-
digits.value = newDigits
|
|
146
|
-
|
|
147
|
-
updateModel()
|
|
148
|
-
|
|
149
|
-
const nextIndex = Math.min(chars.length, props.length - 1)
|
|
150
|
-
inputs.value[nextIndex]?.focus()
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const setInputRef = (el: any, index: number) => {
|
|
154
|
-
if (el) inputs.value[index] = el
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
onMounted(() => {
|
|
158
|
-
if (props.autofocus) {
|
|
159
|
-
nextTick(() => {
|
|
160
|
-
inputs.value[0]?.focus()
|
|
161
|
-
})
|
|
162
|
-
}
|
|
163
|
-
})
|
|
164
|
-
|
|
165
|
-
// Styling Computed Props
|
|
166
|
-
const containerClasses = computed(() => {
|
|
167
|
-
return ['flex items-center', props.attached ? '-space-x-px' : 'gap-2'].join(' ')
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
const inputClasses = (index: number) => {
|
|
171
|
-
const base =
|
|
172
|
-
'text-center font-medium transition-all focus:outline-none focus:z-10 disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted-foreground'
|
|
173
|
-
|
|
174
|
-
const sizes = {
|
|
175
|
-
sm: 'w-8 h-8 text-sm',
|
|
176
|
-
md: 'w-10 h-10 text-lg',
|
|
177
|
-
lg: 'w-12 h-12 text-xl',
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const variants = {
|
|
181
|
-
solid:
|
|
182
|
-
'bg-muted border border-transparent focus:border-primary focus:ring-2 focus:ring-primary',
|
|
183
|
-
outline: 'border border-input focus:border-primary focus:ring-2 focus:ring-primary',
|
|
184
|
-
ghost:
|
|
185
|
-
'bg-transparent border border-transparent hover:bg-accent focus:focus:border-primary focus:ring-2 focus:ring-primary',
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Error state override
|
|
189
|
-
const errorClass = props.error ? 'border-destructive focus:ring-destructive text-destructive' : ''
|
|
190
|
-
|
|
191
|
-
let rounding = 'rounded-md'
|
|
192
|
-
if (props.attached) {
|
|
193
|
-
if (index === 0) rounding = 'rounded-l-md rounded-r-none'
|
|
194
|
-
else if (index === props.length - 1) rounding = 'rounded-r-md rounded-l-none'
|
|
195
|
-
else rounding = 'rounded-none'
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return [base, sizes[props.size], variants[props.variant], errorClass, rounding].join(' ')
|
|
199
|
-
}
|
|
200
|
-
</script>
|
|
201
|
-
|
|
202
|
-
<template>
|
|
203
|
-
<div :class="containerClasses">
|
|
204
|
-
<input
|
|
205
|
-
v-for="(digit, index) in props.length"
|
|
206
|
-
:key="index"
|
|
207
|
-
:ref="(el) => setInputRef(el, index)"
|
|
208
|
-
:value="digits[index]"
|
|
209
|
-
:type="type === 'number' ? 'tel' : 'text'"
|
|
210
|
-
inputmode="numeric"
|
|
211
|
-
:maxlength="1"
|
|
212
|
-
:disabled="disabled"
|
|
213
|
-
:placeholder="placeholder"
|
|
214
|
-
:class="inputClasses(index)"
|
|
215
|
-
@input="(e) => handleInput(e, index)"
|
|
216
|
-
@keydown="(e) => handleKeyDown(e, index)"
|
|
217
|
-
@paste="handlePaste"
|
|
218
|
-
@focus="$emit('update:modelValue', digits.join(''))" />
|
|
219
|
-
</div>
|
|
220
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as OTPInput } from './OTPInput.vue'
|