@sewadah/selaras 0.1.1
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/LICENSE +21 -0
- package/README.md +131 -0
- package/dist/module.d.mts +22 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +127 -0
- package/dist/runtime/components/Accordion.d.vue.ts +59 -0
- package/dist/runtime/components/Accordion.vue +65 -0
- package/dist/runtime/components/Accordion.vue.d.ts +59 -0
- package/dist/runtime/components/Alert.d.vue.ts +39 -0
- package/dist/runtime/components/Alert.vue +64 -0
- package/dist/runtime/components/Alert.vue.d.ts +39 -0
- package/dist/runtime/components/AlertDialog.d.vue.ts +66 -0
- package/dist/runtime/components/AlertDialog.vue +116 -0
- package/dist/runtime/components/AlertDialog.vue.d.ts +66 -0
- package/dist/runtime/components/App.d.vue.ts +32 -0
- package/dist/runtime/components/App.vue +26 -0
- package/dist/runtime/components/App.vue.d.ts +32 -0
- package/dist/runtime/components/Autocomplete.d.vue.ts +61 -0
- package/dist/runtime/components/Autocomplete.vue +41 -0
- package/dist/runtime/components/Autocomplete.vue.d.ts +61 -0
- package/dist/runtime/components/Avatar.d.vue.ts +46 -0
- package/dist/runtime/components/Avatar.vue +64 -0
- package/dist/runtime/components/Avatar.vue.d.ts +46 -0
- package/dist/runtime/components/AvatarGroup.d.vue.ts +14 -0
- package/dist/runtime/components/AvatarGroup.vue +41 -0
- package/dist/runtime/components/AvatarGroup.vue.d.ts +14 -0
- package/dist/runtime/components/Badge.d.vue.ts +37 -0
- package/dist/runtime/components/Badge.vue +47 -0
- package/dist/runtime/components/Badge.vue.d.ts +37 -0
- package/dist/runtime/components/Breadcrumb.d.vue.ts +37 -0
- package/dist/runtime/components/Breadcrumb.vue +109 -0
- package/dist/runtime/components/Breadcrumb.vue.d.ts +37 -0
- package/dist/runtime/components/Button.d.vue.ts +45 -0
- package/dist/runtime/components/Button.vue +67 -0
- package/dist/runtime/components/Button.vue.d.ts +45 -0
- package/dist/runtime/components/ButtonGroup.d.vue.ts +22 -0
- package/dist/runtime/components/ButtonGroup.vue +21 -0
- package/dist/runtime/components/ButtonGroup.vue.d.ts +22 -0
- package/dist/runtime/components/Callout.d.vue.ts +27 -0
- package/dist/runtime/components/Callout.vue +47 -0
- package/dist/runtime/components/Callout.vue.d.ts +27 -0
- package/dist/runtime/components/Card.d.vue.ts +25 -0
- package/dist/runtime/components/Card.vue +30 -0
- package/dist/runtime/components/Card.vue.d.ts +25 -0
- package/dist/runtime/components/CardGroup.d.vue.ts +23 -0
- package/dist/runtime/components/CardGroup.vue +19 -0
- package/dist/runtime/components/CardGroup.vue.d.ts +23 -0
- package/dist/runtime/components/Checkbox.d.vue.ts +45 -0
- package/dist/runtime/components/Checkbox.vue +76 -0
- package/dist/runtime/components/Checkbox.vue.d.ts +45 -0
- package/dist/runtime/components/Chip.d.vue.ts +50 -0
- package/dist/runtime/components/Chip.vue +75 -0
- package/dist/runtime/components/Chip.vue.d.ts +50 -0
- package/dist/runtime/components/CodeButton.d.vue.ts +21 -0
- package/dist/runtime/components/CodeButton.vue +33 -0
- package/dist/runtime/components/CodeButton.vue.d.ts +21 -0
- package/dist/runtime/components/CodeGroup.d.vue.ts +3 -0
- package/dist/runtime/components/CodeGroup.vue +46 -0
- package/dist/runtime/components/CodeGroup.vue.d.ts +3 -0
- package/dist/runtime/components/CodeTree.d.vue.ts +17 -0
- package/dist/runtime/components/CodeTree.vue +56 -0
- package/dist/runtime/components/CodeTree.vue.d.ts +17 -0
- package/dist/runtime/components/Collapsible.d.vue.ts +44 -0
- package/dist/runtime/components/Collapsible.vue +52 -0
- package/dist/runtime/components/Collapsible.vue.d.ts +44 -0
- package/dist/runtime/components/ColorModeToggle.d.vue.ts +3 -0
- package/dist/runtime/components/ColorModeToggle.vue +24 -0
- package/dist/runtime/components/ColorModeToggle.vue.d.ts +3 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +30 -0
- package/dist/runtime/components/ColorPicker.vue +112 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +30 -0
- package/dist/runtime/components/Column.d.ts +72 -0
- package/dist/runtime/components/Column.js +34 -0
- package/dist/runtime/components/ColumnGroup.d.ts +33 -0
- package/dist/runtime/components/ColumnGroup.js +17 -0
- package/dist/runtime/components/CommandPalette.d.vue.ts +41 -0
- package/dist/runtime/components/CommandPalette.vue +208 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +41 -0
- package/dist/runtime/components/Container.d.vue.ts +22 -0
- package/dist/runtime/components/Container.vue +21 -0
- package/dist/runtime/components/Container.vue.d.ts +22 -0
- package/dist/runtime/components/ContentNavigation.d.vue.ts +31 -0
- package/dist/runtime/components/ContentNavigation.vue +64 -0
- package/dist/runtime/components/ContentNavigation.vue.d.ts +31 -0
- package/dist/runtime/components/ContentSurround.d.vue.ts +16 -0
- package/dist/runtime/components/ContentSurround.vue +46 -0
- package/dist/runtime/components/ContentSurround.vue.d.ts +16 -0
- package/dist/runtime/components/ContentToc.d.vue.ts +35 -0
- package/dist/runtime/components/ContentToc.vue +265 -0
- package/dist/runtime/components/ContentToc.vue.d.ts +35 -0
- package/dist/runtime/components/ContextMenu.d.vue.ts +33 -0
- package/dist/runtime/components/ContextMenu.vue +49 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +33 -0
- package/dist/runtime/components/DashboardGroup.d.vue.ts +24 -0
- package/dist/runtime/components/DashboardGroup.vue +52 -0
- package/dist/runtime/components/DashboardGroup.vue.d.ts +24 -0
- package/dist/runtime/components/DashboardNavbar.d.vue.ts +23 -0
- package/dist/runtime/components/DashboardNavbar.vue +33 -0
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +23 -0
- package/dist/runtime/components/DashboardPanel.d.vue.ts +22 -0
- package/dist/runtime/components/DashboardPanel.vue +26 -0
- package/dist/runtime/components/DashboardPanel.vue.d.ts +22 -0
- package/dist/runtime/components/DashboardResizeHandle.d.vue.ts +8 -0
- package/dist/runtime/components/DashboardResizeHandle.vue +19 -0
- package/dist/runtime/components/DashboardResizeHandle.vue.d.ts +8 -0
- package/dist/runtime/components/DashboardSidebar.d.vue.ts +40 -0
- package/dist/runtime/components/DashboardSidebar.vue +117 -0
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +40 -0
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +21 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue +42 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +21 -0
- package/dist/runtime/components/DatePicker.d.vue.ts +165 -0
- package/dist/runtime/components/DatePicker.vue +796 -0
- package/dist/runtime/components/DatePicker.vue.d.ts +165 -0
- package/dist/runtime/components/Drawer.d.vue.ts +74 -0
- package/dist/runtime/components/Drawer.vue +157 -0
- package/dist/runtime/components/Drawer.vue.d.ts +74 -0
- package/dist/runtime/components/DrawerRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/DrawerRenderer.vue +30 -0
- package/dist/runtime/components/DrawerRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/Dropdown.d.vue.ts +35 -0
- package/dist/runtime/components/Dropdown.vue +51 -0
- package/dist/runtime/components/Dropdown.vue.d.ts +35 -0
- package/dist/runtime/components/FileTree.d.vue.ts +28 -0
- package/dist/runtime/components/FileTree.vue +68 -0
- package/dist/runtime/components/FileTree.vue.d.ts +28 -0
- package/dist/runtime/components/FileUpload.d.vue.ts +68 -0
- package/dist/runtime/components/FileUpload.vue +226 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +68 -0
- package/dist/runtime/components/FormField.d.vue.ts +37 -0
- package/dist/runtime/components/FormField.vue +72 -0
- package/dist/runtime/components/FormField.vue.d.ts +37 -0
- package/dist/runtime/components/Header.d.vue.ts +20 -0
- package/dist/runtime/components/Header.vue +23 -0
- package/dist/runtime/components/Header.vue.d.ts +20 -0
- package/dist/runtime/components/Icon.d.vue.ts +14 -0
- package/dist/runtime/components/Icon.vue +18 -0
- package/dist/runtime/components/Icon.vue.d.ts +14 -0
- package/dist/runtime/components/Input.d.vue.ts +41 -0
- package/dist/runtime/components/Input.vue +86 -0
- package/dist/runtime/components/Input.vue.d.ts +41 -0
- package/dist/runtime/components/InputGroup.d.vue.ts +22 -0
- package/dist/runtime/components/InputGroup.vue +21 -0
- package/dist/runtime/components/InputGroup.vue.d.ts +22 -0
- package/dist/runtime/components/InputNumber.d.vue.ts +37 -0
- package/dist/runtime/components/InputNumber.vue +173 -0
- package/dist/runtime/components/InputNumber.vue.d.ts +37 -0
- package/dist/runtime/components/Kbd.d.vue.ts +24 -0
- package/dist/runtime/components/Kbd.vue +42 -0
- package/dist/runtime/components/Kbd.vue.d.ts +24 -0
- package/dist/runtime/components/Modal.d.vue.ts +72 -0
- package/dist/runtime/components/Modal.vue +178 -0
- package/dist/runtime/components/Modal.vue.d.ts +72 -0
- package/dist/runtime/components/ModalRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/ModalRenderer.vue +25 -0
- package/dist/runtime/components/ModalRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/NavigationMenu.d.vue.ts +108 -0
- package/dist/runtime/components/NavigationMenu.vue +166 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +108 -0
- package/dist/runtime/components/NavigationMenuAccordionItem.d.vue.ts +23 -0
- package/dist/runtime/components/NavigationMenuAccordionItem.vue +106 -0
- package/dist/runtime/components/NavigationMenuAccordionItem.vue.d.ts +23 -0
- package/dist/runtime/components/NavigationMenuFlyoutList.d.vue.ts +19 -0
- package/dist/runtime/components/NavigationMenuFlyoutList.vue +44 -0
- package/dist/runtime/components/NavigationMenuFlyoutList.vue.d.ts +19 -0
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.d.vue.ts +49 -0
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue +116 -0
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue.d.ts +49 -0
- package/dist/runtime/components/PageAside.d.vue.ts +20 -0
- package/dist/runtime/components/PageAside.vue +26 -0
- package/dist/runtime/components/PageAside.vue.d.ts +20 -0
- package/dist/runtime/components/PageHeader.d.vue.ts +24 -0
- package/dist/runtime/components/PageHeader.vue +30 -0
- package/dist/runtime/components/PageHeader.vue.d.ts +24 -0
- package/dist/runtime/components/Pagination.d.vue.ts +42 -0
- package/dist/runtime/components/Pagination.vue +113 -0
- package/dist/runtime/components/Pagination.vue.d.ts +42 -0
- package/dist/runtime/components/PinInput.d.vue.ts +40 -0
- package/dist/runtime/components/PinInput.vue +66 -0
- package/dist/runtime/components/PinInput.vue.d.ts +40 -0
- package/dist/runtime/components/Popover.d.vue.ts +52 -0
- package/dist/runtime/components/Popover.vue +77 -0
- package/dist/runtime/components/Popover.vue.d.ts +52 -0
- package/dist/runtime/components/Progress.d.vue.ts +32 -0
- package/dist/runtime/components/Progress.vue +76 -0
- package/dist/runtime/components/Progress.vue.d.ts +32 -0
- package/dist/runtime/components/ProseH1.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH1.vue +21 -0
- package/dist/runtime/components/ProseH1.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH2.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH2.vue +21 -0
- package/dist/runtime/components/ProseH2.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH3.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH3.vue +21 -0
- package/dist/runtime/components/ProseH3.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH4.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH4.vue +21 -0
- package/dist/runtime/components/ProseH4.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH5.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH5.vue +21 -0
- package/dist/runtime/components/ProseH5.vue.d.ts +18 -0
- package/dist/runtime/components/ProseH6.d.vue.ts +18 -0
- package/dist/runtime/components/ProseH6.vue +21 -0
- package/dist/runtime/components/ProseH6.vue.d.ts +18 -0
- package/dist/runtime/components/ProsePre.d.vue.ts +20 -0
- package/dist/runtime/components/ProsePre.vue +50 -0
- package/dist/runtime/components/ProsePre.vue.d.ts +20 -0
- package/dist/runtime/components/RadioGroup.d.vue.ts +50 -0
- package/dist/runtime/components/RadioGroup.vue +82 -0
- package/dist/runtime/components/RadioGroup.vue.d.ts +50 -0
- package/dist/runtime/components/Rating.d.vue.ts +36 -0
- package/dist/runtime/components/Rating.vue +83 -0
- package/dist/runtime/components/Rating.vue.d.ts +36 -0
- package/dist/runtime/components/ReadMore.d.vue.ts +20 -0
- package/dist/runtime/components/ReadMore.vue +59 -0
- package/dist/runtime/components/ReadMore.vue.d.ts +20 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +19 -0
- package/dist/runtime/components/ScrollArea.vue +37 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +19 -0
- package/dist/runtime/components/Select.d.vue.ts +60 -0
- package/dist/runtime/components/Select.vue +40 -0
- package/dist/runtime/components/Select.vue.d.ts +60 -0
- package/dist/runtime/components/Separator.d.vue.ts +27 -0
- package/dist/runtime/components/Separator.vue +36 -0
- package/dist/runtime/components/Separator.vue.d.ts +27 -0
- package/dist/runtime/components/Skeleton.d.vue.ts +13 -0
- package/dist/runtime/components/Skeleton.vue +17 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +13 -0
- package/dist/runtime/components/Slideover.d.vue.ts +65 -0
- package/dist/runtime/components/Slideover.vue +140 -0
- package/dist/runtime/components/Slideover.vue.d.ts +65 -0
- package/dist/runtime/components/SlideoverRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/SlideoverRenderer.vue +27 -0
- package/dist/runtime/components/SlideoverRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/Slider.d.vue.ts +60 -0
- package/dist/runtime/components/Slider.vue +186 -0
- package/dist/runtime/components/Slider.vue.d.ts +60 -0
- package/dist/runtime/components/Splitter.d.vue.ts +41 -0
- package/dist/runtime/components/Splitter.vue +31 -0
- package/dist/runtime/components/Splitter.vue.d.ts +41 -0
- package/dist/runtime/components/SplitterPanel.d.vue.ts +55 -0
- package/dist/runtime/components/SplitterPanel.vue +52 -0
- package/dist/runtime/components/SplitterPanel.vue.d.ts +55 -0
- package/dist/runtime/components/SplitterResizeHandle.d.vue.ts +14 -0
- package/dist/runtime/components/SplitterResizeHandle.vue +22 -0
- package/dist/runtime/components/SplitterResizeHandle.vue.d.ts +14 -0
- package/dist/runtime/components/Stepper.d.vue.ts +57 -0
- package/dist/runtime/components/Stepper.vue +101 -0
- package/dist/runtime/components/Stepper.vue.d.ts +57 -0
- package/dist/runtime/components/Switch.d.vue.ts +49 -0
- package/dist/runtime/components/Switch.vue +73 -0
- package/dist/runtime/components/Switch.vue.d.ts +49 -0
- package/dist/runtime/components/Table.d.vue.ts +83 -0
- package/dist/runtime/components/Table.vue +339 -0
- package/dist/runtime/components/Table.vue.d.ts +83 -0
- package/dist/runtime/components/Tabs.d.vue.ts +43 -0
- package/dist/runtime/components/Tabs.vue +60 -0
- package/dist/runtime/components/Tabs.vue.d.ts +43 -0
- package/dist/runtime/components/Textarea.d.vue.ts +45 -0
- package/dist/runtime/components/Textarea.vue +110 -0
- package/dist/runtime/components/Textarea.vue.d.ts +45 -0
- package/dist/runtime/components/Theme.d.vue.ts +19 -0
- package/dist/runtime/components/Theme.vue +18 -0
- package/dist/runtime/components/Theme.vue.d.ts +19 -0
- package/dist/runtime/components/Toast.d.vue.ts +8 -0
- package/dist/runtime/components/Toast.vue +58 -0
- package/dist/runtime/components/Toast.vue.d.ts +8 -0
- package/dist/runtime/components/Toggle.d.vue.ts +38 -0
- package/dist/runtime/components/Toggle.vue +44 -0
- package/dist/runtime/components/Toggle.vue.d.ts +38 -0
- package/dist/runtime/components/ToggleGroup.d.vue.ts +48 -0
- package/dist/runtime/components/ToggleGroup.vue +61 -0
- package/dist/runtime/components/ToggleGroup.vue.d.ts +48 -0
- package/dist/runtime/components/Tooltip.d.vue.ts +28 -0
- package/dist/runtime/components/Tooltip.vue +40 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +28 -0
- package/dist/runtime/components/Tree.d.vue.ts +64 -0
- package/dist/runtime/components/Tree.vue +139 -0
- package/dist/runtime/components/Tree.vue.d.ts +64 -0
- package/dist/runtime/composables/use-combobox-select.d.ts +45 -0
- package/dist/runtime/composables/use-combobox-select.js +80 -0
- package/dist/runtime/composables/use-command-palette.d.ts +8 -0
- package/dist/runtime/composables/use-command-palette.js +14 -0
- package/dist/runtime/composables/use-drawer.d.ts +42 -0
- package/dist/runtime/composables/use-drawer.js +44 -0
- package/dist/runtime/composables/use-form-field.d.ts +10 -0
- package/dist/runtime/composables/use-form-field.js +8 -0
- package/dist/runtime/composables/use-icons.d.ts +10 -0
- package/dist/runtime/composables/use-icons.js +7 -0
- package/dist/runtime/composables/use-locale.d.ts +12 -0
- package/dist/runtime/composables/use-locale.js +6 -0
- package/dist/runtime/composables/use-media-query.d.ts +11 -0
- package/dist/runtime/composables/use-media-query.js +15 -0
- package/dist/runtime/composables/use-messages.d.ts +12 -0
- package/dist/runtime/composables/use-messages.js +7 -0
- package/dist/runtime/composables/use-modal.d.ts +32 -0
- package/dist/runtime/composables/use-modal.js +39 -0
- package/dist/runtime/composables/use-ripple.d.ts +15 -0
- package/dist/runtime/composables/use-ripple.js +6 -0
- package/dist/runtime/composables/use-slideover.d.ts +36 -0
- package/dist/runtime/composables/use-slideover.js +41 -0
- package/dist/runtime/composables/use-table.d.ts +63 -0
- package/dist/runtime/composables/use-table.js +142 -0
- package/dist/runtime/composables/use-toast.d.ts +15 -0
- package/dist/runtime/composables/use-toast.js +16 -0
- package/dist/runtime/directives/index.d.ts +1 -0
- package/dist/runtime/directives/index.js +1 -0
- package/dist/runtime/directives/ripple.d.ts +16 -0
- package/dist/runtime/directives/ripple.js +80 -0
- package/dist/runtime/internal/ColorPickerBody.d.vue.ts +26 -0
- package/dist/runtime/internal/ColorPickerBody.vue +111 -0
- package/dist/runtime/internal/ColorPickerBody.vue.d.ts +26 -0
- package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +122 -0
- package/dist/runtime/internal/ComboboxSelectBase.vue +590 -0
- package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +122 -0
- package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +71 -0
- package/dist/runtime/internal/ComboboxSelectBody.vue +146 -0
- package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +71 -0
- package/dist/runtime/internal/DatePickerCalendarBody.d.vue.ts +71 -0
- package/dist/runtime/internal/DatePickerCalendarBody.vue +215 -0
- package/dist/runtime/internal/DatePickerCalendarBody.vue.d.ts +71 -0
- package/dist/runtime/internal/DatePickerRangeCalendarBody.d.vue.ts +37 -0
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +96 -0
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue.d.ts +37 -0
- package/dist/runtime/internal/DatePickerTimeBody.d.vue.ts +33 -0
- package/dist/runtime/internal/DatePickerTimeBody.vue +53 -0
- package/dist/runtime/internal/DatePickerTimeBody.vue.d.ts +33 -0
- package/dist/runtime/internal/TimeStepper.d.vue.ts +28 -0
- package/dist/runtime/internal/TimeStepper.vue +99 -0
- package/dist/runtime/internal/TimeStepper.vue.d.ts +28 -0
- package/dist/runtime/prose.css +1 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/theme/accordion.d.ts +131 -0
- package/dist/runtime/theme/accordion.js +60 -0
- package/dist/runtime/theme/alert-dialog.d.ts +50 -0
- package/dist/runtime/theme/alert-dialog.js +30 -0
- package/dist/runtime/theme/alert.d.ts +62 -0
- package/dist/runtime/theme/alert.js +52 -0
- package/dist/runtime/theme/avatar-group.d.ts +59 -0
- package/dist/runtime/theme/avatar-group.js +18 -0
- package/dist/runtime/theme/avatar.d.ts +206 -0
- package/dist/runtime/theme/avatar.js +67 -0
- package/dist/runtime/theme/badge.d.ts +140 -0
- package/dist/runtime/theme/badge.js +90 -0
- package/dist/runtime/theme/breadcrumb.d.ts +86 -0
- package/dist/runtime/theme/breadcrumb.js +22 -0
- package/dist/runtime/theme/button-group.d.ts +53 -0
- package/dist/runtime/theme/button-group.js +21 -0
- package/dist/runtime/theme/button.d.ts +155 -0
- package/dist/runtime/theme/button.js +99 -0
- package/dist/runtime/theme/callout.d.ts +74 -0
- package/dist/runtime/theme/callout.js +23 -0
- package/dist/runtime/theme/card-group.d.ts +44 -0
- package/dist/runtime/theme/card-group.js +19 -0
- package/dist/runtime/theme/card.d.ts +62 -0
- package/dist/runtime/theme/card.js +23 -0
- package/dist/runtime/theme/checkbox.d.ts +218 -0
- package/dist/runtime/theme/checkbox.js +113 -0
- package/dist/runtime/theme/chip.d.ts +155 -0
- package/dist/runtime/theme/chip.js +86 -0
- package/dist/runtime/theme/code-button.d.ts +32 -0
- package/dist/runtime/theme/code-button.js +7 -0
- package/dist/runtime/theme/code-tree.d.ts +50 -0
- package/dist/runtime/theme/code-tree.js +13 -0
- package/dist/runtime/theme/collapsible.d.ts +95 -0
- package/dist/runtime/theme/collapsible.js +46 -0
- package/dist/runtime/theme/color-picker.d.ts +152 -0
- package/dist/runtime/theme/color-picker.js +83 -0
- package/dist/runtime/theme/command-palette.d.ts +110 -0
- package/dist/runtime/theme/command-palette.js +23 -0
- package/dist/runtime/theme/container.d.ts +62 -0
- package/dist/runtime/theme/container.js +18 -0
- package/dist/runtime/theme/content-navigation.d.ts +47 -0
- package/dist/runtime/theme/content-navigation.js +38 -0
- package/dist/runtime/theme/content-surround.d.ts +53 -0
- package/dist/runtime/theme/content-surround.js +22 -0
- package/dist/runtime/theme/content-toc.d.ts +56 -0
- package/dist/runtime/theme/content-toc.js +41 -0
- package/dist/runtime/theme/context-menu.d.ts +38 -0
- package/dist/runtime/theme/context-menu.js +21 -0
- package/dist/runtime/theme/dashboard-group.d.ts +26 -0
- package/dist/runtime/theme/dashboard-group.js +9 -0
- package/dist/runtime/theme/dashboard-navbar.d.ts +44 -0
- package/dist/runtime/theme/dashboard-navbar.js +9 -0
- package/dist/runtime/theme/dashboard-panel.d.ts +26 -0
- package/dist/runtime/theme/dashboard-panel.js +6 -0
- package/dist/runtime/theme/dashboard-resize-handle.d.ts +26 -0
- package/dist/runtime/theme/dashboard-resize-handle.js +17 -0
- package/dist/runtime/theme/dashboard-sidebar.d.ts +50 -0
- package/dist/runtime/theme/dashboard-sidebar.js +40 -0
- package/dist/runtime/theme/date-picker.d.ts +119 -0
- package/dist/runtime/theme/date-picker.js +75 -0
- package/dist/runtime/theme/drawer.d.ts +95 -0
- package/dist/runtime/theme/drawer.js +57 -0
- package/dist/runtime/theme/dropdown.d.ts +41 -0
- package/dist/runtime/theme/dropdown.js +21 -0
- package/dist/runtime/theme/file-tree.d.ts +56 -0
- package/dist/runtime/theme/file-tree.js +33 -0
- package/dist/runtime/theme/file-upload.d.ts +233 -0
- package/dist/runtime/theme/file-upload.js +63 -0
- package/dist/runtime/theme/form-field.d.ts +95 -0
- package/dist/runtime/theme/form-field.js +37 -0
- package/dist/runtime/theme/header.d.ts +38 -0
- package/dist/runtime/theme/header.js +8 -0
- package/dist/runtime/theme/icon.d.ts +80 -0
- package/dist/runtime/theme/icon.js +26 -0
- package/dist/runtime/theme/input-group.d.ts +95 -0
- package/dist/runtime/theme/input-group.js +39 -0
- package/dist/runtime/theme/input-number.d.ts +164 -0
- package/dist/runtime/theme/input-number.js +76 -0
- package/dist/runtime/theme/input.d.ts +185 -0
- package/dist/runtime/theme/input.js +72 -0
- package/dist/runtime/theme/kbd.d.ts +44 -0
- package/dist/runtime/theme/kbd.js +16 -0
- package/dist/runtime/theme/modal.d.ts +74 -0
- package/dist/runtime/theme/modal.js +58 -0
- package/dist/runtime/theme/navigation-menu.d.ts +224 -0
- package/dist/runtime/theme/navigation-menu.js +232 -0
- package/dist/runtime/theme/page-aside.d.ts +44 -0
- package/dist/runtime/theme/page-aside.js +17 -0
- package/dist/runtime/theme/page-header.d.ts +38 -0
- package/dist/runtime/theme/page-header.js +8 -0
- package/dist/runtime/theme/pagination.d.ts +68 -0
- package/dist/runtime/theme/pagination.js +21 -0
- package/dist/runtime/theme/pin-input.d.ts +131 -0
- package/dist/runtime/theme/pin-input.js +40 -0
- package/dist/runtime/theme/popover.d.ts +32 -0
- package/dist/runtime/theme/popover.js +7 -0
- package/dist/runtime/theme/progress.d.ts +185 -0
- package/dist/runtime/theme/progress.js +54 -0
- package/dist/runtime/theme/prose.d.ts +92 -0
- package/dist/runtime/theme/prose.js +17 -0
- package/dist/runtime/theme/radio-group.d.ts +239 -0
- package/dist/runtime/theme/radio-group.js +134 -0
- package/dist/runtime/theme/rating.d.ts +167 -0
- package/dist/runtime/theme/rating.js +77 -0
- package/dist/runtime/theme/read-more.d.ts +38 -0
- package/dist/runtime/theme/read-more.js +21 -0
- package/dist/runtime/theme/scroll-area.d.ts +50 -0
- package/dist/runtime/theme/scroll-area.js +10 -0
- package/dist/runtime/theme/select.d.ts +176 -0
- package/dist/runtime/theme/select.js +74 -0
- package/dist/runtime/theme/separator.d.ts +158 -0
- package/dist/runtime/theme/separator.js +63 -0
- package/dist/runtime/theme/skeleton.d.ts +35 -0
- package/dist/runtime/theme/skeleton.js +27 -0
- package/dist/runtime/theme/slideover.d.ts +107 -0
- package/dist/runtime/theme/slideover.js +62 -0
- package/dist/runtime/theme/slider.d.ts +227 -0
- package/dist/runtime/theme/slider.js +73 -0
- package/dist/runtime/theme/splitter-panel.d.ts +26 -0
- package/dist/runtime/theme/splitter-panel.js +9 -0
- package/dist/runtime/theme/splitter-resize-handle.d.ts +44 -0
- package/dist/runtime/theme/splitter-resize-handle.js +18 -0
- package/dist/runtime/theme/splitter.d.ts +35 -0
- package/dist/runtime/theme/splitter.js +15 -0
- package/dist/runtime/theme/stepper.d.ts +221 -0
- package/dist/runtime/theme/stepper.js +106 -0
- package/dist/runtime/theme/switch.d.ts +206 -0
- package/dist/runtime/theme/switch.js +84 -0
- package/dist/runtime/theme/table.d.ts +176 -0
- package/dist/runtime/theme/table.js +59 -0
- package/dist/runtime/theme/tabs.d.ts +59 -0
- package/dist/runtime/theme/tabs.js +44 -0
- package/dist/runtime/theme/textarea.d.ts +212 -0
- package/dist/runtime/theme/textarea.js +56 -0
- package/dist/runtime/theme/toast.d.ts +80 -0
- package/dist/runtime/theme/toast.js +31 -0
- package/dist/runtime/theme/toggle-group.d.ts +110 -0
- package/dist/runtime/theme/toggle-group.js +48 -0
- package/dist/runtime/theme/toggle.d.ts +92 -0
- package/dist/runtime/theme/toggle.js +48 -0
- package/dist/runtime/theme/tooltip.d.ts +44 -0
- package/dist/runtime/theme/tooltip.js +14 -0
- package/dist/runtime/theme/tree.d.ts +80 -0
- package/dist/runtime/theme/tree.js +32 -0
- package/dist/runtime/theme.css +1 -0
- package/dist/runtime/types/app-config.d.ts +15 -0
- package/dist/runtime/types/index.d.ts +82 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/utils/format-bytes.d.ts +2 -0
- package/dist/runtime/utils/format-bytes.js +9 -0
- package/dist/runtime/utils/fuzzy-match.d.ts +12 -0
- package/dist/runtime/utils/fuzzy-match.js +21 -0
- package/dist/runtime/utils/icons.d.ts +38 -0
- package/dist/runtime/utils/icons.js +51 -0
- package/dist/runtime/utils/injection-keys.d.ts +69 -0
- package/dist/runtime/utils/injection-keys.js +3 -0
- package/dist/runtime/utils/messages.d.ts +70 -0
- package/dist/runtime/utils/messages.js +68 -0
- package/dist/runtime/utils/navigation-menu.d.ts +32 -0
- package/dist/runtime/utils/navigation-menu.js +5 -0
- package/dist/runtime/utils/table-columns.d.ts +30 -0
- package/dist/runtime/utils/table-columns.js +89 -0
- package/dist/runtime/utils/table-export.d.ts +12 -0
- package/dist/runtime/utils/table-export.js +29 -0
- package/dist/runtime/utils/ui.d.ts +124 -0
- package/dist/runtime/utils/ui.js +74 -0
- package/dist/types.d.mts +3 -0
- package/package.json +99 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { headerTheme } from "../theme/header";
|
|
4
|
+
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
5
|
+
defineOptions({ inheritAttrs: false });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
ui: { type: Object, required: false }
|
|
8
|
+
});
|
|
9
|
+
const theme = useComponentTheme("header", headerTheme);
|
|
10
|
+
const ui = computed(() => theme.value());
|
|
11
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<header v-bind="rootProps">
|
|
16
|
+
<div v-bind="resolveSlot(ui.left, props.ui?.left)">
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
<div v-if="$slots.right" v-bind="resolveSlot(ui.right, props.ui?.right)">
|
|
20
|
+
<slot name="right" />
|
|
21
|
+
</div>
|
|
22
|
+
</header>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HeaderThemeSlots } from '../theme/header.js';
|
|
2
|
+
import type { UiProp } from '../utils/ui.js';
|
|
3
|
+
export interface HeaderProps {
|
|
4
|
+
ui?: UiProp<HeaderThemeSlots>;
|
|
5
|
+
}
|
|
6
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
} & {
|
|
10
|
+
right?: (props: typeof __VLS_3) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<HeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<HeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { IconThemeSlots } from '../theme/icon.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { iconTheme } from '../theme/icon.js';
|
|
5
|
+
type IconVariants = VariantProps<typeof iconTheme>;
|
|
6
|
+
export interface IconProps {
|
|
7
|
+
/** Any name Nuxt Icon resolves, e.g. `hugeicons:star` (or any other registered set, like `lucide:star`). */
|
|
8
|
+
name: string;
|
|
9
|
+
color?: IconVariants['color'];
|
|
10
|
+
ui?: UiProp<IconThemeSlots>;
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { iconTheme } from "../theme/icon";
|
|
4
|
+
import { useComponentTheme, useRootProps } from "../utils/ui";
|
|
5
|
+
defineOptions({ inheritAttrs: false });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
name: { type: String, required: true },
|
|
8
|
+
color: { type: null, required: false },
|
|
9
|
+
ui: { type: Object, required: false }
|
|
10
|
+
});
|
|
11
|
+
const theme = useComponentTheme("icon", iconTheme);
|
|
12
|
+
const ui = computed(() => theme.value({ color: props.color }));
|
|
13
|
+
const rootProps = useRootProps(() => ui.value.base, () => props.ui?.base);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<Icon :name="name" v-bind="rootProps" />
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { IconThemeSlots } from '../theme/icon.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { iconTheme } from '../theme/icon.js';
|
|
5
|
+
type IconVariants = VariantProps<typeof iconTheme>;
|
|
6
|
+
export interface IconProps {
|
|
7
|
+
/** Any name Nuxt Icon resolves, e.g. `hugeicons:star` (or any other registered set, like `lucide:star`). */
|
|
8
|
+
name: string;
|
|
9
|
+
color?: IconVariants['color'];
|
|
10
|
+
ui?: UiProp<IconThemeSlots>;
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { InputThemeSlots } from '../theme/input.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { inputTheme } from '../theme/input.js';
|
|
5
|
+
type InputVariants = VariantProps<typeof inputTheme>;
|
|
6
|
+
export interface InputProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
modelValue?: string | number;
|
|
10
|
+
type?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
size?: InputVariants['size'];
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
invalid?: boolean;
|
|
15
|
+
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
16
|
+
color?: InputVariants['color'];
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
icon?: string;
|
|
19
|
+
trailingIcon?: string;
|
|
20
|
+
ui?: UiProp<InputThemeSlots>;
|
|
21
|
+
}
|
|
22
|
+
export interface InputEmits {
|
|
23
|
+
'update:modelValue': [value: string];
|
|
24
|
+
}
|
|
25
|
+
declare var __VLS_15: {};
|
|
26
|
+
type __VLS_Slots = {} & {
|
|
27
|
+
'clear-icon'?: (props: typeof __VLS_15) => any;
|
|
28
|
+
};
|
|
29
|
+
declare const __VLS_base: import("vue").DefineComponent<InputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:modelValue": (value: string) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<InputProps> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormField } from "../composables/use-form-field";
|
|
4
|
+
import { useIcons } from "../composables/use-icons";
|
|
5
|
+
import { useMessages } from "../composables/use-messages";
|
|
6
|
+
import { inputTheme } from "../theme/input";
|
|
7
|
+
import { resolveSlot, useComponentTheme, useRootProps, useThemeProps } from "../utils/ui";
|
|
8
|
+
import Button from "./Button.vue";
|
|
9
|
+
import Icon from "./Icon.vue";
|
|
10
|
+
defineOptions({ inheritAttrs: false });
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
id: { type: String, required: false },
|
|
13
|
+
name: { type: String, required: false },
|
|
14
|
+
modelValue: { type: [String, Number], required: false },
|
|
15
|
+
type: { type: String, required: false, default: "text" },
|
|
16
|
+
placeholder: { type: String, required: false },
|
|
17
|
+
size: { type: null, required: false },
|
|
18
|
+
disabled: { type: Boolean, required: false },
|
|
19
|
+
invalid: { type: Boolean, required: false },
|
|
20
|
+
color: { type: null, required: false },
|
|
21
|
+
clearable: { type: Boolean, required: false },
|
|
22
|
+
icon: { type: String, required: false },
|
|
23
|
+
trailingIcon: { type: String, required: false },
|
|
24
|
+
ui: { type: Object, required: false }
|
|
25
|
+
});
|
|
26
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
27
|
+
const field = useFormField();
|
|
28
|
+
const inputId = computed(() => props.id ?? field?.id);
|
|
29
|
+
const inputInvalid = computed(() => props.invalid || (field?.invalid.value ?? false));
|
|
30
|
+
const describedBy = computed(() => field?.describedBy.value);
|
|
31
|
+
const hasValue = computed(() => props.modelValue !== void 0 && props.modelValue !== "");
|
|
32
|
+
const showClear = computed(() => !!props.clearable && !props.disabled && hasValue.value);
|
|
33
|
+
function clear() {
|
|
34
|
+
emit("update:modelValue", "");
|
|
35
|
+
}
|
|
36
|
+
const themeProps = useThemeProps("input");
|
|
37
|
+
const effectiveSize = computed(() => props.size ?? field?.size ?? themeProps.value.size ?? "md");
|
|
38
|
+
const clearSize = computed(() => ({ sm: "sm", md: "sm", lg: "md" })[effectiveSize.value]);
|
|
39
|
+
const icons = useIcons();
|
|
40
|
+
const messages = useMessages();
|
|
41
|
+
const theme = useComponentTheme("input", inputTheme);
|
|
42
|
+
const ui = computed(() => theme.value({
|
|
43
|
+
size: effectiveSize.value,
|
|
44
|
+
color: props.color ?? themeProps.value.color ?? "primary",
|
|
45
|
+
invalid: inputInvalid.value,
|
|
46
|
+
hasLeadingIcon: !!props.icon,
|
|
47
|
+
hasTrailingIcon: !!props.trailingIcon || showClear.value
|
|
48
|
+
}));
|
|
49
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
50
|
+
const baseProps = computed(() => resolveSlot(ui.value.base, props.ui?.base));
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div v-bind="rootProps">
|
|
55
|
+
<Icon v-if="icon" :name="icon" v-bind="resolveSlot(ui.leadingIcon, props.ui?.leadingIcon)" />
|
|
56
|
+
<input
|
|
57
|
+
:id="inputId"
|
|
58
|
+
data-ui-group-item
|
|
59
|
+
:value="modelValue"
|
|
60
|
+
:type="type"
|
|
61
|
+
:name="name ?? field?.name"
|
|
62
|
+
:placeholder="placeholder"
|
|
63
|
+
:disabled="disabled"
|
|
64
|
+
:aria-invalid="inputInvalid || void 0"
|
|
65
|
+
:aria-describedby="describedBy"
|
|
66
|
+
v-bind="baseProps"
|
|
67
|
+
@input="$emit('update:modelValue', $event.target.value)"
|
|
68
|
+
>
|
|
69
|
+
<Button
|
|
70
|
+
v-if="showClear"
|
|
71
|
+
:size="clearSize"
|
|
72
|
+
variant="text"
|
|
73
|
+
color="neutral"
|
|
74
|
+
:aria-label="messages.clear"
|
|
75
|
+
v-bind="resolveSlot(ui.clear, props.ui?.clear)"
|
|
76
|
+
@click="clear"
|
|
77
|
+
>
|
|
78
|
+
<template #icon="{ class: iconClass }">
|
|
79
|
+
<slot name="clear-icon">
|
|
80
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
81
|
+
</slot>
|
|
82
|
+
</template>
|
|
83
|
+
</Button>
|
|
84
|
+
<Icon v-else-if="trailingIcon" :name="trailingIcon" v-bind="resolveSlot(ui.trailingIcon, props.ui?.trailingIcon)" />
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { InputThemeSlots } from '../theme/input.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { inputTheme } from '../theme/input.js';
|
|
5
|
+
type InputVariants = VariantProps<typeof inputTheme>;
|
|
6
|
+
export interface InputProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
modelValue?: string | number;
|
|
10
|
+
type?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
size?: InputVariants['size'];
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
invalid?: boolean;
|
|
15
|
+
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
16
|
+
color?: InputVariants['color'];
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
icon?: string;
|
|
19
|
+
trailingIcon?: string;
|
|
20
|
+
ui?: UiProp<InputThemeSlots>;
|
|
21
|
+
}
|
|
22
|
+
export interface InputEmits {
|
|
23
|
+
'update:modelValue': [value: string];
|
|
24
|
+
}
|
|
25
|
+
declare var __VLS_15: {};
|
|
26
|
+
type __VLS_Slots = {} & {
|
|
27
|
+
'clear-icon'?: (props: typeof __VLS_15) => any;
|
|
28
|
+
};
|
|
29
|
+
declare const __VLS_base: import("vue").DefineComponent<InputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:modelValue": (value: string) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<InputProps> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { InputGroupThemeSlots } from '../theme/input-group.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { inputGroupTheme } from '../theme/input-group.js';
|
|
5
|
+
type InputGroupVariants = VariantProps<typeof inputGroupTheme>;
|
|
6
|
+
export interface InputGroupProps {
|
|
7
|
+
orientation?: InputGroupVariants['orientation'];
|
|
8
|
+
ui?: UiProp<InputGroupThemeSlots>;
|
|
9
|
+
}
|
|
10
|
+
declare var __VLS_1: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<InputGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InputGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { inputGroupTheme } from "../theme/input-group";
|
|
4
|
+
import { useComponentTheme, useRootProps } from "../utils/ui";
|
|
5
|
+
defineOptions({ inheritAttrs: false });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
orientation: { type: null, required: false },
|
|
8
|
+
ui: { type: Object, required: false }
|
|
9
|
+
});
|
|
10
|
+
const theme = useComponentTheme("inputGroup", inputGroupTheme);
|
|
11
|
+
const ui = computed(() => theme.value({
|
|
12
|
+
orientation: props.orientation
|
|
13
|
+
}));
|
|
14
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div v-bind="rootProps">
|
|
19
|
+
<slot />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { InputGroupThemeSlots } from '../theme/input-group.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { inputGroupTheme } from '../theme/input-group.js';
|
|
5
|
+
type InputGroupVariants = VariantProps<typeof inputGroupTheme>;
|
|
6
|
+
export interface InputGroupProps {
|
|
7
|
+
orientation?: InputGroupVariants['orientation'];
|
|
8
|
+
ui?: UiProp<InputGroupThemeSlots>;
|
|
9
|
+
}
|
|
10
|
+
declare var __VLS_1: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<InputGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InputGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { InputNumberThemeSlots } from '../theme/input-number.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { inputNumberTheme } from '../theme/input-number.js';
|
|
5
|
+
type InputNumberVariants = VariantProps<typeof inputNumberTheme>;
|
|
6
|
+
export interface InputNumberProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
modelValue?: number;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
step?: number;
|
|
13
|
+
/** When both `min` and `max` are set, stepping (click, arrow keys, or typing an out-of-range value) cycles past the boundary instead of clamping to it - e.g. an hour-of-day stepper going 12 -> 1, not getting stuck at 12. Default false (clamp), matching a plain bounded quantity. */
|
|
14
|
+
wrap?: boolean;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Passed straight to `Intl.NumberFormat` for the read-only (blurred) display - e.g. `{ minimumIntegerDigits: 2 }` to zero-pad. Not applied while editing, so typing never fights reformatted text. */
|
|
17
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
18
|
+
locale?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
22
|
+
color?: InputNumberVariants['color'];
|
|
23
|
+
size?: InputNumberVariants['size'];
|
|
24
|
+
/** 'horizontal' (default) flanks the input with two full-height buttons; 'vertical' replaces them with a single compact up/down pair pinned to the end edge. */
|
|
25
|
+
orientation?: InputNumberVariants['orientation'];
|
|
26
|
+
ui?: UiProp<InputNumberThemeSlots>;
|
|
27
|
+
}
|
|
28
|
+
export interface InputNumberEmits {
|
|
29
|
+
'update:modelValue': [value: number | undefined];
|
|
30
|
+
}
|
|
31
|
+
declare const __VLS_export: import("vue").DefineComponent<InputNumberProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
"update:modelValue": (value: number | undefined) => any;
|
|
33
|
+
}, string, import("vue").PublicProps, Readonly<InputNumberProps> & Readonly<{
|
|
34
|
+
"onUpdate:modelValue"?: ((value: number | undefined) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { useFormField } from "../composables/use-form-field";
|
|
4
|
+
import { useIcons } from "../composables/use-icons";
|
|
5
|
+
import { useLocale } from "../composables/use-locale";
|
|
6
|
+
import { useMessages } from "../composables/use-messages";
|
|
7
|
+
import { inputNumberTheme } from "../theme/input-number";
|
|
8
|
+
import { applyClassPrefix, resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
9
|
+
import Button from "./Button.vue";
|
|
10
|
+
import Icon from "./Icon.vue";
|
|
11
|
+
defineOptions({ inheritAttrs: false });
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
id: { type: String, required: false },
|
|
14
|
+
name: { type: String, required: false },
|
|
15
|
+
modelValue: { type: Number, required: false },
|
|
16
|
+
min: { type: Number, required: false },
|
|
17
|
+
max: { type: Number, required: false },
|
|
18
|
+
step: { type: Number, required: false, default: 1 },
|
|
19
|
+
wrap: { type: Boolean, required: false },
|
|
20
|
+
placeholder: { type: String, required: false },
|
|
21
|
+
formatOptions: { type: null, required: false },
|
|
22
|
+
locale: { type: String, required: false },
|
|
23
|
+
disabled: { type: Boolean, required: false },
|
|
24
|
+
invalid: { type: Boolean, required: false },
|
|
25
|
+
color: { type: null, required: false, default: "primary" },
|
|
26
|
+
size: { type: null, required: false },
|
|
27
|
+
orientation: { type: null, required: false, default: "horizontal" },
|
|
28
|
+
ui: { type: Object, required: false }
|
|
29
|
+
});
|
|
30
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
31
|
+
const field = useFormField();
|
|
32
|
+
const inputId = computed(() => props.id ?? field?.id);
|
|
33
|
+
const inputInvalid = computed(() => props.invalid || (field?.invalid.value ?? false));
|
|
34
|
+
const describedBy = computed(() => field?.describedBy.value);
|
|
35
|
+
const effectiveSize = computed(() => props.size ?? field?.size ?? "md");
|
|
36
|
+
const buttonSize = computed(() => ({ sm: "sm", md: "sm", lg: "md" })[effectiveSize.value]);
|
|
37
|
+
const isFocused = ref(false);
|
|
38
|
+
const editingValue = ref("");
|
|
39
|
+
const effectiveLocale = computed(() => props.locale ?? useLocale().value);
|
|
40
|
+
const numberFormatter = computed(() => props.formatOptions ? new Intl.NumberFormat(effectiveLocale.value, props.formatOptions) : void 0);
|
|
41
|
+
const displayValue = computed(() => {
|
|
42
|
+
if (isFocused.value)
|
|
43
|
+
return editingValue.value;
|
|
44
|
+
if (props.modelValue === void 0)
|
|
45
|
+
return "";
|
|
46
|
+
return numberFormatter.value ? numberFormatter.value.format(props.modelValue) : String(props.modelValue);
|
|
47
|
+
});
|
|
48
|
+
function clamp(value) {
|
|
49
|
+
if (props.wrap && props.min !== void 0 && props.max !== void 0) {
|
|
50
|
+
const size = props.max - props.min + 1;
|
|
51
|
+
return props.min + ((value - props.min) % size + size) % size;
|
|
52
|
+
}
|
|
53
|
+
let result = value;
|
|
54
|
+
if (props.min !== void 0)
|
|
55
|
+
result = Math.max(props.min, result);
|
|
56
|
+
if (props.max !== void 0)
|
|
57
|
+
result = Math.min(props.max, result);
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
function commit(value) {
|
|
61
|
+
emit("update:modelValue", value === void 0 ? void 0 : clamp(value));
|
|
62
|
+
}
|
|
63
|
+
function focus() {
|
|
64
|
+
isFocused.value = true;
|
|
65
|
+
editingValue.value = props.modelValue === void 0 ? "" : String(props.modelValue);
|
|
66
|
+
}
|
|
67
|
+
function blur() {
|
|
68
|
+
isFocused.value = false;
|
|
69
|
+
const parsed = editingValue.value.trim() === "" ? void 0 : Number(editingValue.value);
|
|
70
|
+
commit(parsed === void 0 || Number.isNaN(parsed) ? void 0 : parsed);
|
|
71
|
+
}
|
|
72
|
+
function input(event) {
|
|
73
|
+
editingValue.value = event.target.value;
|
|
74
|
+
}
|
|
75
|
+
function keydown(event) {
|
|
76
|
+
if (event.key === "Enter") {
|
|
77
|
+
event.target.blur();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (event.key === "ArrowUp") {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
stepBy(props.step);
|
|
83
|
+
} else if (event.key === "ArrowDown") {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
stepBy(-props.step);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function stepBy(delta) {
|
|
89
|
+
const base = props.modelValue ?? props.min ?? 0;
|
|
90
|
+
commit(base + delta);
|
|
91
|
+
if (isFocused.value)
|
|
92
|
+
editingValue.value = String(clamp(base + delta));
|
|
93
|
+
}
|
|
94
|
+
const canDecrement = computed(() => !props.disabled && (props.wrap || props.min === void 0 || props.modelValue === void 0 || props.modelValue > props.min));
|
|
95
|
+
const canIncrement = computed(() => !props.disabled && (props.wrap || props.max === void 0 || props.modelValue === void 0 || props.modelValue < props.max));
|
|
96
|
+
const icons = useIcons();
|
|
97
|
+
const messages = useMessages();
|
|
98
|
+
const theme = useComponentTheme("inputNumber", inputNumberTheme);
|
|
99
|
+
const ui = computed(() => theme.value({ size: effectiveSize.value, color: props.color, invalid: inputInvalid.value, orientation: props.orientation }));
|
|
100
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
101
|
+
const inputProps = computed(() => resolveSlot(ui.value.input, props.ui?.input));
|
|
102
|
+
const stepperProps = computed(() => resolveSlot(ui.value.stepper, props.ui?.stepper));
|
|
103
|
+
const stepperButtonProps = computed(() => resolveSlot(ui.value.stepperButton, props.ui?.stepperButton));
|
|
104
|
+
const stepButtonUi = { base: "shrink-0" };
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<template>
|
|
108
|
+
<div v-bind="rootProps">
|
|
109
|
+
<Button
|
|
110
|
+
v-if="orientation === 'horizontal'"
|
|
111
|
+
variant="text"
|
|
112
|
+
color="neutral"
|
|
113
|
+
:size="buttonSize"
|
|
114
|
+
:icon="icons.minus"
|
|
115
|
+
:aria-label="messages.decrement"
|
|
116
|
+
:disabled="!canDecrement"
|
|
117
|
+
:ui="stepButtonUi"
|
|
118
|
+
tabindex="-1"
|
|
119
|
+
@click="stepBy(-step)"
|
|
120
|
+
/>
|
|
121
|
+
<input
|
|
122
|
+
:id="inputId"
|
|
123
|
+
:value="displayValue"
|
|
124
|
+
type="text"
|
|
125
|
+
inputmode="numeric"
|
|
126
|
+
:name="name ?? field?.name"
|
|
127
|
+
:placeholder="placeholder"
|
|
128
|
+
:disabled="disabled"
|
|
129
|
+
:aria-invalid="inputInvalid || void 0"
|
|
130
|
+
:aria-describedby="describedBy"
|
|
131
|
+
v-bind="inputProps"
|
|
132
|
+
@focus="focus"
|
|
133
|
+
@blur="blur"
|
|
134
|
+
@input="input"
|
|
135
|
+
@keydown="keydown"
|
|
136
|
+
>
|
|
137
|
+
<Button
|
|
138
|
+
v-if="orientation === 'horizontal'"
|
|
139
|
+
variant="text"
|
|
140
|
+
color="neutral"
|
|
141
|
+
:size="buttonSize"
|
|
142
|
+
:icon="icons.plus"
|
|
143
|
+
:aria-label="messages.increment"
|
|
144
|
+
:disabled="!canIncrement"
|
|
145
|
+
:ui="stepButtonUi"
|
|
146
|
+
tabindex="-1"
|
|
147
|
+
@click="stepBy(step)"
|
|
148
|
+
/>
|
|
149
|
+
|
|
150
|
+
<div v-else v-bind="stepperProps">
|
|
151
|
+
<button
|
|
152
|
+
type="button"
|
|
153
|
+
v-bind="stepperButtonProps"
|
|
154
|
+
:aria-label="messages.increment"
|
|
155
|
+
:disabled="!canIncrement"
|
|
156
|
+
tabindex="-1"
|
|
157
|
+
@click="stepBy(step)"
|
|
158
|
+
>
|
|
159
|
+
<Icon :name="icons.chevronUp" :class="applyClassPrefix('size-3')" />
|
|
160
|
+
</button>
|
|
161
|
+
<button
|
|
162
|
+
type="button"
|
|
163
|
+
v-bind="stepperButtonProps"
|
|
164
|
+
:aria-label="messages.decrement"
|
|
165
|
+
:disabled="!canDecrement"
|
|
166
|
+
tabindex="-1"
|
|
167
|
+
@click="stepBy(-step)"
|
|
168
|
+
>
|
|
169
|
+
<Icon :name="icons.chevronDown" :class="applyClassPrefix('size-3')" />
|
|
170
|
+
</button>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { InputNumberThemeSlots } from '../theme/input-number.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { inputNumberTheme } from '../theme/input-number.js';
|
|
5
|
+
type InputNumberVariants = VariantProps<typeof inputNumberTheme>;
|
|
6
|
+
export interface InputNumberProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
modelValue?: number;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
step?: number;
|
|
13
|
+
/** When both `min` and `max` are set, stepping (click, arrow keys, or typing an out-of-range value) cycles past the boundary instead of clamping to it - e.g. an hour-of-day stepper going 12 -> 1, not getting stuck at 12. Default false (clamp), matching a plain bounded quantity. */
|
|
14
|
+
wrap?: boolean;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Passed straight to `Intl.NumberFormat` for the read-only (blurred) display - e.g. `{ minimumIntegerDigits: 2 }` to zero-pad. Not applied while editing, so typing never fights reformatted text. */
|
|
17
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
18
|
+
locale?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
22
|
+
color?: InputNumberVariants['color'];
|
|
23
|
+
size?: InputNumberVariants['size'];
|
|
24
|
+
/** 'horizontal' (default) flanks the input with two full-height buttons; 'vertical' replaces them with a single compact up/down pair pinned to the end edge. */
|
|
25
|
+
orientation?: InputNumberVariants['orientation'];
|
|
26
|
+
ui?: UiProp<InputNumberThemeSlots>;
|
|
27
|
+
}
|
|
28
|
+
export interface InputNumberEmits {
|
|
29
|
+
'update:modelValue': [value: number | undefined];
|
|
30
|
+
}
|
|
31
|
+
declare const __VLS_export: import("vue").DefineComponent<InputNumberProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
"update:modelValue": (value: number | undefined) => any;
|
|
33
|
+
}, string, import("vue").PublicProps, Readonly<InputNumberProps> & Readonly<{
|
|
34
|
+
"onUpdate:modelValue"?: ((value: number | undefined) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
import type { KbdThemeSlots } from '../theme/kbd.js';
|
|
3
|
+
import type { UiProp } from '../utils/ui.js';
|
|
4
|
+
import { kbdTheme } from '../theme/kbd.js';
|
|
5
|
+
type KbdVariants = VariantProps<typeof kbdTheme>;
|
|
6
|
+
export interface KbdProps {
|
|
7
|
+
/** A key name resolved via a small built-in symbol map (`meta` -> ⌘, `up` -> ↑, ...) - falls back to the raw string itself when there's no match. Omit in favor of the default slot for anything more custom. */
|
|
8
|
+
value?: string;
|
|
9
|
+
size?: KbdVariants['size'];
|
|
10
|
+
ui?: UiProp<KbdThemeSlots>;
|
|
11
|
+
}
|
|
12
|
+
declare var __VLS_1: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
default?: (props: typeof __VLS_1) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<KbdProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KbdProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { kbdTheme } from "../theme/kbd";
|
|
4
|
+
import { useComponentTheme, useRootProps } from "../utils/ui";
|
|
5
|
+
defineOptions({ inheritAttrs: false });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
value: { type: String, required: false },
|
|
8
|
+
size: { type: null, required: false },
|
|
9
|
+
ui: { type: Object, required: false }
|
|
10
|
+
});
|
|
11
|
+
const KEY_SYMBOLS = {
|
|
12
|
+
meta: "\u2318",
|
|
13
|
+
command: "\u2318",
|
|
14
|
+
cmd: "\u2318",
|
|
15
|
+
ctrl: "\u2303",
|
|
16
|
+
control: "\u2303",
|
|
17
|
+
alt: "\u2325",
|
|
18
|
+
option: "\u2325",
|
|
19
|
+
shift: "\u21E7",
|
|
20
|
+
enter: "\u21B5",
|
|
21
|
+
return: "\u21B5",
|
|
22
|
+
backspace: "\u232B",
|
|
23
|
+
delete: "\u2326",
|
|
24
|
+
tab: "\u21E5",
|
|
25
|
+
capslock: "\u21EA",
|
|
26
|
+
escape: "Esc",
|
|
27
|
+
esc: "Esc",
|
|
28
|
+
up: "\u2191",
|
|
29
|
+
down: "\u2193",
|
|
30
|
+
left: "\u2190",
|
|
31
|
+
right: "\u2192",
|
|
32
|
+
space: "Space"
|
|
33
|
+
};
|
|
34
|
+
const resolvedValue = computed(() => props.value ? KEY_SYMBOLS[props.value.toLowerCase()] ?? props.value : void 0);
|
|
35
|
+
const theme = useComponentTheme("kbd", kbdTheme);
|
|
36
|
+
const ui = computed(() => theme.value({ size: props.size }));
|
|
37
|
+
const rootProps = useRootProps(() => ui.value.base, () => props.ui?.base);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<kbd v-bind="rootProps"><slot>{{ resolvedValue }}</slot></kbd>
|
|
42
|
+
</template>
|