@sewadah/selaras 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -20
- package/dist/module.d.mts +10 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +123 -36
- package/dist/runtime/components/Accordion.d.vue.ts +3 -0
- package/dist/runtime/components/Accordion.vue +5 -1
- package/dist/runtime/components/Accordion.vue.d.ts +3 -0
- package/dist/runtime/components/Alert.d.vue.ts +2 -1
- package/dist/runtime/components/Alert.vue +6 -3
- package/dist/runtime/components/Alert.vue.d.ts +2 -1
- package/dist/runtime/components/AlertDialog.d.vue.ts +2 -0
- package/dist/runtime/components/AlertDialog.vue +21 -8
- package/dist/runtime/components/AlertDialog.vue.d.ts +2 -0
- package/dist/runtime/components/App.vue +9 -2
- package/dist/runtime/components/Autocomplete.d.vue.ts +22 -58
- package/dist/runtime/components/Autocomplete.vue +50 -11
- package/dist/runtime/components/Autocomplete.vue.d.ts +22 -58
- package/dist/runtime/components/Avatar.d.vue.ts +2 -1
- package/dist/runtime/components/Avatar.vue +4 -2
- package/dist/runtime/components/Avatar.vue.d.ts +2 -1
- package/dist/runtime/components/Badge.d.vue.ts +3 -2
- package/dist/runtime/components/Badge.vue +8 -5
- package/dist/runtime/components/Badge.vue.d.ts +3 -2
- package/dist/runtime/components/Breadcrumb.d.vue.ts +3 -0
- package/dist/runtime/components/Breadcrumb.vue +5 -2
- package/dist/runtime/components/Breadcrumb.vue.d.ts +3 -0
- package/dist/runtime/components/Button.d.vue.ts +5 -2
- package/dist/runtime/components/Button.vue +5 -2
- package/dist/runtime/components/Button.vue.d.ts +5 -2
- package/dist/runtime/components/Checkbox.d.vue.ts +2 -1
- package/dist/runtime/components/Checkbox.vue +4 -2
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
- package/dist/runtime/components/Chip.d.vue.ts +2 -1
- package/dist/runtime/components/Chip.vue +4 -2
- package/dist/runtime/components/Chip.vue.d.ts +2 -1
- package/dist/runtime/components/Collapsible.d.vue.ts +3 -0
- package/dist/runtime/components/Collapsible.vue +11 -6
- package/dist/runtime/components/Collapsible.vue.d.ts +3 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +13 -3
- package/dist/runtime/components/ColorPicker.vue +60 -14
- package/dist/runtime/components/ColorPicker.vue.d.ts +13 -3
- package/dist/runtime/components/Column.d.ts +1 -1
- package/dist/runtime/components/CommandPalette.vue +18 -16
- package/dist/runtime/components/ContentNavigation.d.vue.ts +3 -0
- package/dist/runtime/components/ContentNavigation.vue +6 -3
- package/dist/runtime/components/ContentNavigation.vue.d.ts +3 -0
- package/dist/runtime/components/ContentSurround.d.vue.ts +3 -0
- package/dist/runtime/components/ContentSurround.vue +7 -4
- package/dist/runtime/components/ContentSurround.vue.d.ts +3 -0
- package/dist/runtime/components/ContentToc.d.vue.ts +3 -0
- package/dist/runtime/components/ContentToc.vue +22 -12
- package/dist/runtime/components/ContentToc.vue.d.ts +3 -0
- package/dist/runtime/components/ContextMenu.vue +3 -2
- package/dist/runtime/components/DashboardSidebar.vue +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +1 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue +3 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -0
- package/dist/runtime/components/DatePicker.d.vue.ts +32 -23
- package/dist/runtime/components/DatePicker.vue +130 -60
- package/dist/runtime/components/DatePicker.vue.d.ts +32 -23
- package/dist/runtime/components/Drawer.d.vue.ts +2 -0
- package/dist/runtime/components/Drawer.vue +21 -8
- package/dist/runtime/components/Drawer.vue.d.ts +2 -0
- package/dist/runtime/components/DrawerRenderer.vue +28 -21
- package/dist/runtime/components/Dropdown.d.vue.ts +14 -4
- package/dist/runtime/components/Dropdown.vue +19 -4
- package/dist/runtime/components/Dropdown.vue.d.ts +14 -4
- package/dist/runtime/components/FileTree.d.vue.ts +3 -0
- package/dist/runtime/components/FileTree.vue +7 -3
- package/dist/runtime/components/FileTree.vue.d.ts +3 -0
- package/dist/runtime/components/FileUpload.d.vue.ts +2 -1
- package/dist/runtime/components/FileUpload.vue +75 -32
- package/dist/runtime/components/FileUpload.vue.d.ts +2 -1
- package/dist/runtime/components/FormField.d.vue.ts +2 -0
- package/dist/runtime/components/FormField.vue +12 -9
- package/dist/runtime/components/FormField.vue.d.ts +2 -0
- package/dist/runtime/components/Icon.d.vue.ts +2 -4
- package/dist/runtime/components/Icon.vue +7 -2
- package/dist/runtime/components/Icon.vue.d.ts +2 -4
- package/dist/runtime/components/Input.d.vue.ts +2 -1
- package/dist/runtime/components/Input.vue +12 -6
- package/dist/runtime/components/Input.vue.d.ts +2 -1
- package/dist/runtime/components/InputNumber.d.vue.ts +4 -1
- package/dist/runtime/components/InputNumber.vue +21 -8
- package/dist/runtime/components/InputNumber.vue.d.ts +4 -1
- package/dist/runtime/components/Modal.d.vue.ts +2 -0
- package/dist/runtime/components/Modal.vue +21 -8
- package/dist/runtime/components/Modal.vue.d.ts +2 -0
- package/dist/runtime/components/ModalRenderer.vue +23 -16
- package/dist/runtime/components/NavigationMenu.d.vue.ts +2 -4
- package/dist/runtime/components/NavigationMenu.vue +8 -4
- package/dist/runtime/components/NavigationMenu.vue.d.ts +2 -4
- package/dist/runtime/components/NavigationMenuAccordionItem.d.vue.ts +2 -4
- package/dist/runtime/components/NavigationMenuAccordionItem.vue +5 -3
- package/dist/runtime/components/NavigationMenuAccordionItem.vue.d.ts +2 -4
- package/dist/runtime/components/NavigationMenuFlyoutList.d.vue.ts +2 -4
- package/dist/runtime/components/NavigationMenuFlyoutList.vue +7 -4
- package/dist/runtime/components/NavigationMenuFlyoutList.vue.d.ts +2 -4
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.d.vue.ts +2 -4
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue +9 -2
- package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue.d.ts +2 -4
- package/dist/runtime/components/Pagination.d.vue.ts +3 -2
- package/dist/runtime/components/Pagination.vue.d.ts +3 -2
- package/dist/runtime/components/PinInput.d.vue.ts +2 -1
- package/dist/runtime/components/PinInput.vue +17 -6
- package/dist/runtime/components/PinInput.vue.d.ts +2 -1
- package/dist/runtime/components/Popover.d.vue.ts +2 -0
- package/dist/runtime/components/Popover.vue +14 -7
- package/dist/runtime/components/Popover.vue.d.ts +2 -0
- package/dist/runtime/components/Progress.d.vue.ts +2 -1
- package/dist/runtime/components/Progress.vue +6 -4
- package/dist/runtime/components/Progress.vue.d.ts +2 -1
- package/dist/runtime/components/ProseH1.d.vue.ts +2 -0
- package/dist/runtime/components/ProseH1.vue +7 -4
- package/dist/runtime/components/ProseH1.vue.d.ts +2 -0
- package/dist/runtime/components/ProseH2.d.vue.ts +2 -0
- package/dist/runtime/components/ProseH2.vue +7 -4
- package/dist/runtime/components/ProseH2.vue.d.ts +2 -0
- package/dist/runtime/components/ProseH3.d.vue.ts +2 -0
- package/dist/runtime/components/ProseH3.vue +7 -4
- package/dist/runtime/components/ProseH3.vue.d.ts +2 -0
- package/dist/runtime/components/ProseH4.d.vue.ts +2 -0
- package/dist/runtime/components/ProseH4.vue +7 -4
- package/dist/runtime/components/ProseH4.vue.d.ts +2 -0
- package/dist/runtime/components/ProseH5.d.vue.ts +2 -0
- package/dist/runtime/components/ProseH5.vue +7 -4
- package/dist/runtime/components/ProseH5.vue.d.ts +2 -0
- package/dist/runtime/components/ProseH6.d.vue.ts +2 -0
- package/dist/runtime/components/ProseH6.vue +7 -4
- package/dist/runtime/components/ProseH6.vue.d.ts +2 -0
- package/dist/runtime/components/ProsePre.d.vue.ts +4 -2
- package/dist/runtime/components/ProsePre.vue +9 -3
- package/dist/runtime/components/ProsePre.vue.d.ts +4 -2
- package/dist/runtime/components/RadioGroup.d.vue.ts +2 -1
- package/dist/runtime/components/RadioGroup.vue +9 -5
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -1
- package/dist/runtime/components/Rating.d.vue.ts +2 -1
- package/dist/runtime/components/Rating.vue +4 -1
- package/dist/runtime/components/Rating.vue.d.ts +2 -1
- package/dist/runtime/components/ReadMore.d.vue.ts +3 -0
- package/dist/runtime/components/ReadMore.vue +24 -6
- package/dist/runtime/components/ReadMore.vue.d.ts +3 -0
- package/dist/runtime/components/Select.d.vue.ts +21 -57
- package/dist/runtime/components/Select.vue +58 -9
- package/dist/runtime/components/Select.vue.d.ts +21 -57
- package/dist/runtime/components/Separator.d.vue.ts +2 -1
- package/dist/runtime/components/Separator.vue +4 -2
- package/dist/runtime/components/Separator.vue.d.ts +2 -1
- package/dist/runtime/components/Slideover.d.vue.ts +2 -0
- package/dist/runtime/components/Slideover.vue +21 -8
- package/dist/runtime/components/Slideover.vue.d.ts +2 -0
- package/dist/runtime/components/SlideoverRenderer.vue +25 -18
- package/dist/runtime/components/Slider.d.vue.ts +2 -1
- package/dist/runtime/components/Slider.vue +4 -1
- package/dist/runtime/components/Slider.vue.d.ts +2 -1
- package/dist/runtime/components/SplitterResizeHandle.d.vue.ts +3 -0
- package/dist/runtime/components/SplitterResizeHandle.vue +5 -2
- package/dist/runtime/components/SplitterResizeHandle.vue.d.ts +3 -0
- package/dist/runtime/components/Stepper.d.vue.ts +2 -1
- package/dist/runtime/components/Stepper.vue +4 -1
- package/dist/runtime/components/Stepper.vue.d.ts +2 -1
- package/dist/runtime/components/Switch.d.vue.ts +2 -1
- package/dist/runtime/components/Switch.vue +4 -2
- package/dist/runtime/components/Switch.vue.d.ts +2 -1
- package/dist/runtime/components/Table.d.vue.ts +28 -80
- package/dist/runtime/components/Table.vue +25 -13
- package/dist/runtime/components/Table.vue.d.ts +28 -80
- package/dist/runtime/components/Tabs.d.vue.ts +3 -0
- package/dist/runtime/components/Tabs.vue +5 -1
- package/dist/runtime/components/Tabs.vue.d.ts +3 -0
- package/dist/runtime/components/Textarea.d.vue.ts +2 -1
- package/dist/runtime/components/Textarea.vue +11 -6
- package/dist/runtime/components/Textarea.vue.d.ts +2 -1
- package/dist/runtime/components/Theme.d.vue.ts +16 -5
- package/dist/runtime/components/Theme.vue +30 -5
- package/dist/runtime/components/Theme.vue.d.ts +16 -5
- package/dist/runtime/components/Toast.vue +11 -39
- package/dist/runtime/components/Toggle.d.vue.ts +2 -1
- package/dist/runtime/components/Toggle.vue +4 -1
- package/dist/runtime/components/Toggle.vue.d.ts +2 -1
- package/dist/runtime/components/ToggleGroup.d.vue.ts +2 -1
- package/dist/runtime/components/ToggleGroup.vue +4 -1
- package/dist/runtime/components/ToggleGroup.vue.d.ts +2 -1
- package/dist/runtime/components/Tooltip.vue +3 -2
- package/dist/runtime/components/Tree.d.vue.ts +5 -2
- package/dist/runtime/components/Tree.vue +5 -1
- package/dist/runtime/components/Tree.vue.d.ts +5 -2
- package/dist/runtime/composables/use-drawer.d.ts +1 -22
- package/dist/runtime/composables/use-drawer.js +12 -18
- package/dist/runtime/composables/use-form-field.d.ts +1 -0
- package/dist/runtime/composables/use-icons.d.ts +2 -2
- package/dist/runtime/composables/use-icons.js +1 -1
- package/dist/runtime/composables/use-locale.d.ts +2 -2
- package/dist/runtime/composables/use-locale.js +1 -1
- package/dist/runtime/composables/use-media-query.d.ts +6 -8
- package/dist/runtime/composables/use-media-query.js +7 -2
- package/dist/runtime/composables/use-messages.d.ts +2 -2
- package/dist/runtime/composables/use-messages.js +1 -1
- package/dist/runtime/composables/use-modal.d.ts +1 -17
- package/dist/runtime/composables/use-modal.js +12 -18
- package/dist/runtime/composables/use-ripple.d.ts +2 -2
- package/dist/runtime/composables/use-ripple.js +1 -1
- package/dist/runtime/composables/use-slideover.d.ts +1 -19
- package/dist/runtime/composables/use-slideover.js +12 -18
- package/dist/runtime/composables/use-table.d.ts +74 -17
- package/dist/runtime/composables/use-table.js +4 -1
- package/dist/runtime/composables/use-toast.d.ts +8 -8
- package/dist/runtime/composables/use-toast.js +9 -11
- package/dist/runtime/default-color-metadata.d.ts +4 -0
- package/dist/runtime/default-color-metadata.js +4 -0
- package/dist/runtime/default-colors.css +1 -0
- package/dist/runtime/internal/ColorPickerBody.d.vue.ts +1 -0
- package/dist/runtime/internal/ColorPickerBody.vue +24 -1
- package/dist/runtime/internal/ColorPickerBody.vue.d.ts +1 -0
- package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +50 -46
- package/dist/runtime/internal/ComboboxSelectBase.vue +340 -93
- package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +50 -46
- package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +29 -23
- package/dist/runtime/internal/ComboboxSelectBody.vue +74 -40
- package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +29 -23
- package/dist/runtime/internal/DatePickerCalendarBody.d.vue.ts +3 -5
- package/dist/runtime/internal/DatePickerCalendarBody.vue +2 -2
- package/dist/runtime/internal/DatePickerCalendarBody.vue.d.ts +3 -5
- package/dist/runtime/internal/DatePickerRangeCalendarBody.d.vue.ts +3 -5
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +1 -1
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue.d.ts +3 -5
- package/dist/runtime/internal/DatePickerTimeBody.d.vue.ts +2 -4
- package/dist/runtime/internal/DatePickerTimeBody.vue.d.ts +2 -4
- package/dist/runtime/internal/ProgrammaticTheme.d.vue.ts +17 -0
- package/dist/runtime/internal/ProgrammaticTheme.vue +41 -0
- package/dist/runtime/internal/ProgrammaticTheme.vue.d.ts +17 -0
- package/dist/runtime/internal/TimeStepper.vue +1 -1
- package/dist/runtime/internal/ToastItemRenderer.d.vue.ts +14 -0
- package/dist/runtime/internal/ToastItemRenderer.vue +54 -0
- package/dist/runtime/internal/ToastItemRenderer.vue.d.ts +14 -0
- package/dist/runtime/internal/combobox-select.d.ts +52 -0
- package/dist/runtime/{composables/use-combobox-select.js → internal/combobox-select.js} +26 -11
- package/dist/runtime/internal/programmatic-services.d.ts +71 -0
- package/dist/runtime/internal/programmatic-services.js +61 -0
- package/dist/runtime/prose.css +1 -1
- package/dist/runtime/structural.css +1 -0
- package/dist/runtime/table.d.ts +3 -0
- package/dist/runtime/table.js +1 -0
- package/dist/runtime/theme/accordion.d.ts +27 -0
- package/dist/runtime/theme/accordion.js +15 -6
- package/dist/runtime/theme/alert-dialog.js +5 -5
- package/dist/runtime/theme/alert.js +6 -15
- package/dist/runtime/theme/avatar-group.js +2 -2
- package/dist/runtime/theme/avatar.js +12 -18
- package/dist/runtime/theme/badge.d.ts +39 -9
- package/dist/runtime/theme/badge.js +11 -40
- package/dist/runtime/theme/breadcrumb.d.ts +29 -47
- package/dist/runtime/theme/breadcrumb.js +16 -5
- package/dist/runtime/theme/button.d.ts +45 -15
- package/dist/runtime/theme/button.js +10 -57
- package/dist/runtime/theme/callout.js +7 -7
- package/dist/runtime/theme/card.js +7 -7
- package/dist/runtime/theme/checkbox.d.ts +21 -84
- package/dist/runtime/theme/checkbox.js +15 -36
- package/dist/runtime/theme/chip.js +4 -22
- package/dist/runtime/theme/code-button.js +2 -2
- package/dist/runtime/theme/code-tree.d.ts +3 -3
- package/dist/runtime/theme/code-tree.js +4 -4
- package/dist/runtime/theme/collapsible.d.ts +27 -0
- package/dist/runtime/theme/collapsible.js +12 -3
- package/dist/runtime/theme/color-picker.d.ts +18 -54
- package/dist/runtime/theme/color-picker.js +19 -18
- package/dist/runtime/theme/command-palette.d.ts +6 -6
- package/dist/runtime/theme/command-palette.js +12 -10
- package/dist/runtime/theme/content-navigation.d.ts +27 -0
- package/dist/runtime/theme/content-navigation.js +14 -5
- package/dist/runtime/theme/content-surround.d.ts +27 -0
- package/dist/runtime/theme/content-surround.js +13 -4
- package/dist/runtime/theme/content-toc.d.ts +27 -0
- package/dist/runtime/theme/content-toc.js +14 -5
- package/dist/runtime/theme/context-menu.js +7 -7
- package/dist/runtime/theme/dashboard-navbar.d.ts +6 -6
- package/dist/runtime/theme/dashboard-navbar.js +2 -2
- package/dist/runtime/theme/dashboard-resize-handle.js +3 -3
- package/dist/runtime/theme/dashboard-sidebar.js +3 -3
- package/dist/runtime/theme/date-picker.js +10 -10
- package/dist/runtime/theme/drawer.js +9 -9
- package/dist/runtime/theme/dropdown.js +7 -7
- package/dist/runtime/theme/file-tree.d.ts +27 -0
- package/dist/runtime/theme/file-tree.js +12 -3
- package/dist/runtime/theme/file-upload.d.ts +18 -72
- package/dist/runtime/theme/file-upload.js +20 -19
- package/dist/runtime/theme/form-field.js +5 -5
- package/dist/runtime/theme/header.d.ts +3 -3
- package/dist/runtime/theme/header.js +1 -1
- package/dist/runtime/theme/icon.d.ts +30 -57
- package/dist/runtime/theme/icon.js +19 -9
- package/dist/runtime/theme/input-number.d.ts +21 -63
- package/dist/runtime/theme/input-number.js +12 -12
- package/dist/runtime/theme/input.d.ts +21 -63
- package/dist/runtime/theme/input.js +12 -12
- package/dist/runtime/theme/kbd.js +1 -1
- package/dist/runtime/theme/modal.js +4 -4
- package/dist/runtime/theme/navigation-menu.d.ts +2 -0
- package/dist/runtime/theme/navigation-menu.js +17 -28
- package/dist/runtime/theme/page-header.js +3 -3
- package/dist/runtime/theme/pagination.js +1 -1
- package/dist/runtime/theme/pin-input.d.ts +21 -63
- package/dist/runtime/theme/pin-input.js +13 -11
- package/dist/runtime/theme/popover.js +2 -2
- package/dist/runtime/theme/progress.d.ts +21 -84
- package/dist/runtime/theme/progress.js +12 -12
- package/dist/runtime/theme/prose.d.ts +35 -50
- package/dist/runtime/theme/prose.js +24 -11
- package/dist/runtime/theme/radio-group.d.ts +21 -84
- package/dist/runtime/theme/radio-group.js +16 -22
- package/dist/runtime/theme/rating.d.ts +21 -63
- package/dist/runtime/theme/rating.js +10 -10
- package/dist/runtime/theme/read-more.d.ts +27 -0
- package/dist/runtime/theme/read-more.js +13 -4
- package/dist/runtime/theme/scroll-area.d.ts +3 -3
- package/dist/runtime/theme/scroll-area.js +2 -2
- package/dist/runtime/theme/select.d.ts +21 -54
- package/dist/runtime/theme/select.js +32 -24
- package/dist/runtime/theme/separator.d.ts +18 -54
- package/dist/runtime/theme/separator.js +16 -12
- package/dist/runtime/theme/skeleton.js +4 -4
- package/dist/runtime/theme/slideover.js +5 -5
- package/dist/runtime/theme/slider.d.ts +21 -84
- package/dist/runtime/theme/slider.js +14 -14
- package/dist/runtime/theme/splitter-resize-handle.d.ts +27 -0
- package/dist/runtime/theme/splitter-resize-handle.js +11 -1
- package/dist/runtime/theme/stepper.d.ts +21 -84
- package/dist/runtime/theme/stepper.js +12 -33
- package/dist/runtime/theme/switch.d.ts +21 -84
- package/dist/runtime/theme/switch.js +13 -13
- package/dist/runtime/theme/table.d.ts +27 -0
- package/dist/runtime/theme/table.js +31 -21
- package/dist/runtime/theme/tabs.d.ts +27 -0
- package/dist/runtime/theme/tabs.js +17 -7
- package/dist/runtime/theme/textarea.d.ts +21 -63
- package/dist/runtime/theme/textarea.js +12 -12
- package/dist/runtime/theme/toast.d.ts +12 -48
- package/dist/runtime/theme/toast.js +9 -9
- package/dist/runtime/theme/toggle-group.js +5 -11
- package/dist/runtime/theme/toggle.js +2 -12
- package/dist/runtime/theme/tooltip.d.ts +3 -3
- package/dist/runtime/theme/tooltip.js +3 -3
- package/dist/runtime/theme/tree.d.ts +27 -0
- package/dist/runtime/theme/tree.js +13 -3
- package/dist/runtime/theme-api.d.ts +15 -0
- package/dist/runtime/theme-api.js +12 -0
- package/dist/runtime/theme-config.d.ts +470 -0
- package/dist/runtime/theme-config.js +0 -0
- package/dist/runtime/theme.css +1 -1
- package/dist/runtime/types/app-config.d.ts +11 -8
- package/dist/runtime/types/index.d.ts +19 -1
- package/dist/runtime/utils/app-scoped-state.d.ts +2 -0
- package/dist/runtime/utils/app-scoped-state.js +13 -0
- package/dist/runtime/utils/autocomplete-contracts.d.ts +24 -0
- package/dist/runtime/utils/autocomplete-contracts.js +0 -0
- package/dist/runtime/utils/color-registry.d.ts +62 -0
- package/dist/runtime/utils/color-registry.js +191 -0
- package/dist/runtime/utils/dtcg-colors.d.ts +25 -0
- package/dist/runtime/utils/dtcg-colors.js +40 -0
- package/dist/runtime/utils/file-icons.d.ts +8 -0
- package/dist/runtime/utils/file-icons.js +131 -0
- package/dist/runtime/utils/functional-tokens.d.ts +26 -0
- package/dist/runtime/utils/functional-tokens.js +54 -0
- package/dist/runtime/utils/icons.d.ts +3 -0
- package/dist/runtime/utils/icons.js +4 -0
- package/dist/runtime/utils/injection-keys.d.ts +12 -3
- package/dist/runtime/utils/native-input.d.ts +5 -0
- package/dist/runtime/utils/native-input.js +32 -0
- package/dist/runtime/utils/navigation-menu.d.ts +3 -0
- package/dist/runtime/utils/programmatic-theme.d.ts +17 -0
- package/dist/runtime/utils/programmatic-theme.js +59 -0
- package/dist/runtime/utils/registered-colors.d.ts +3 -0
- package/dist/runtime/utils/registered-colors.js +14 -0
- package/dist/runtime/utils/seed-colors.d.ts +19 -0
- package/dist/runtime/utils/seed-colors.js +207 -0
- package/dist/runtime/utils/select-contracts.d.ts +101 -0
- package/dist/runtime/utils/select-contracts.js +0 -0
- package/dist/runtime/utils/table-contracts.d.ts +60 -0
- package/dist/runtime/utils/table-contracts.js +0 -0
- package/dist/runtime/utils/ui.d.ts +26 -4
- package/dist/runtime/utils/ui.js +38 -5
- package/dist/tokens/default-colors.tokens.json +879 -0
- package/package.json +83 -16
- package/dist/runtime/composables/use-combobox-select.d.ts +0 -45
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { iconTheme } from "../theme/icon";
|
|
4
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
4
5
|
import { useComponentTheme, useRootProps } from "../utils/ui";
|
|
5
6
|
defineOptions({ inheritAttrs: false });
|
|
6
7
|
const props = defineProps({
|
|
@@ -9,10 +10,14 @@ const props = defineProps({
|
|
|
9
10
|
ui: { type: Object, required: false }
|
|
10
11
|
});
|
|
11
12
|
const theme = useComponentTheme("icon", iconTheme);
|
|
12
|
-
const
|
|
13
|
+
const effectiveColor = computed(() => props.color ? resolveRegisteredColorRole(props.color, "primary") : void 0);
|
|
14
|
+
const ui = computed(() => theme.value({
|
|
15
|
+
color: effectiveColor.value,
|
|
16
|
+
colored: !!effectiveColor.value
|
|
17
|
+
}));
|
|
13
18
|
const rootProps = useRootProps(() => ui.value.base, () => props.ui?.base);
|
|
14
19
|
</script>
|
|
15
20
|
|
|
16
21
|
<template>
|
|
17
|
-
<Icon :name="name" v-bind="rootProps" />
|
|
22
|
+
<Icon :name="name" :data-selaras-color="effectiveColor" v-bind="rootProps" />
|
|
18
23
|
</template>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
1
|
import type { IconThemeSlots } from '../theme/icon.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
3
|
import type { UiProp } from '../utils/ui.js';
|
|
4
|
-
import { iconTheme } from '../theme/icon.js';
|
|
5
|
-
type IconVariants = VariantProps<typeof iconTheme>;
|
|
6
4
|
export interface IconProps {
|
|
7
5
|
/** Any name Nuxt Icon resolves, e.g. `hugeicons:star` (or any other registered set, like `lucide:star`). */
|
|
8
6
|
name: string;
|
|
9
|
-
color?:
|
|
7
|
+
color?: ColorRole;
|
|
10
8
|
ui?: UiProp<IconThemeSlots>;
|
|
11
9
|
}
|
|
12
10
|
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>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { InputThemeSlots } from '../theme/input.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { inputTheme } from '../theme/input.js';
|
|
5
6
|
type InputVariants = VariantProps<typeof inputTheme>;
|
|
@@ -13,7 +14,7 @@ export interface InputProps {
|
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
invalid?: boolean;
|
|
15
16
|
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
16
|
-
color?:
|
|
17
|
+
color?: ColorRole;
|
|
17
18
|
clearable?: boolean;
|
|
18
19
|
icon?: string;
|
|
19
20
|
trailingIcon?: string;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
2
|
+
import { computed, mergeProps } from "vue";
|
|
3
3
|
import { useFormField } from "../composables/use-form-field";
|
|
4
4
|
import { useIcons } from "../composables/use-icons";
|
|
5
5
|
import { useMessages } from "../composables/use-messages";
|
|
6
6
|
import { inputTheme } from "../theme/input";
|
|
7
|
-
import {
|
|
7
|
+
import { isNativeInputA11yAttr, isNativeInputAttr } from "../utils/native-input";
|
|
8
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
9
|
+
import { resolveSlot, useComponentTheme, useFallthroughAttrs, useRootProps, useThemeProps } from "../utils/ui";
|
|
8
10
|
import Button from "./Button.vue";
|
|
9
11
|
import Icon from "./Icon.vue";
|
|
10
12
|
defineOptions({ inheritAttrs: false });
|
|
@@ -39,19 +41,23 @@ const clearSize = computed(() => ({ sm: "sm", md: "sm", lg: "md" })[effectiveSiz
|
|
|
39
41
|
const icons = useIcons();
|
|
40
42
|
const messages = useMessages();
|
|
41
43
|
const theme = useComponentTheme("input", inputTheme);
|
|
44
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? themeProps.value.color ?? "primary", "primary"));
|
|
42
45
|
const ui = computed(() => theme.value({
|
|
43
46
|
size: effectiveSize.value,
|
|
44
|
-
color:
|
|
47
|
+
color: effectiveColor.value,
|
|
45
48
|
invalid: inputInvalid.value,
|
|
46
49
|
hasLeadingIcon: !!props.icon,
|
|
47
50
|
hasTrailingIcon: !!props.trailingIcon || showClear.value
|
|
48
51
|
}));
|
|
49
|
-
const
|
|
52
|
+
const isInputAttr = (key) => isNativeInputAttr(key) || isNativeInputA11yAttr(key);
|
|
53
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root, { exclude: isInputAttr });
|
|
54
|
+
const nativeInputAttrs = useFallthroughAttrs(isInputAttr);
|
|
50
55
|
const baseProps = computed(() => resolveSlot(ui.value.base, props.ui?.base));
|
|
56
|
+
const inputProps = computed(() => mergeProps(baseProps.value, nativeInputAttrs.value));
|
|
51
57
|
</script>
|
|
52
58
|
|
|
53
59
|
<template>
|
|
54
|
-
<div v-bind="rootProps">
|
|
60
|
+
<div :data-selaras-color="inputInvalid ? 'danger' : effectiveColor" v-bind="rootProps">
|
|
55
61
|
<Icon v-if="icon" :name="icon" v-bind="resolveSlot(ui.leadingIcon, props.ui?.leadingIcon)" />
|
|
56
62
|
<input
|
|
57
63
|
:id="inputId"
|
|
@@ -63,7 +69,7 @@ const baseProps = computed(() => resolveSlot(ui.value.base, props.ui?.base));
|
|
|
63
69
|
:disabled="disabled"
|
|
64
70
|
:aria-invalid="inputInvalid || void 0"
|
|
65
71
|
:aria-describedby="describedBy"
|
|
66
|
-
v-bind="
|
|
72
|
+
v-bind="inputProps"
|
|
67
73
|
@input="$emit('update:modelValue', $event.target.value)"
|
|
68
74
|
>
|
|
69
75
|
<Button
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { InputThemeSlots } from '../theme/input.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { inputTheme } from '../theme/input.js';
|
|
5
6
|
type InputVariants = VariantProps<typeof inputTheme>;
|
|
@@ -13,7 +14,7 @@ export interface InputProps {
|
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
invalid?: boolean;
|
|
15
16
|
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
16
|
-
color?:
|
|
17
|
+
color?: ColorRole;
|
|
17
18
|
clearable?: boolean;
|
|
18
19
|
icon?: string;
|
|
19
20
|
trailingIcon?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { InputNumberThemeSlots } from '../theme/input-number.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { inputNumberTheme } from '../theme/input-number.js';
|
|
5
6
|
type InputNumberVariants = VariantProps<typeof inputNumberTheme>;
|
|
@@ -17,9 +18,11 @@ export interface InputNumberProps {
|
|
|
17
18
|
formatOptions?: Intl.NumberFormatOptions;
|
|
18
19
|
locale?: string;
|
|
19
20
|
disabled?: boolean;
|
|
21
|
+
/** Keeps the field focusable and readable while preventing typing and stepping. */
|
|
22
|
+
readonly?: boolean;
|
|
20
23
|
invalid?: boolean;
|
|
21
24
|
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
22
|
-
color?:
|
|
25
|
+
color?: ColorRole;
|
|
23
26
|
size?: InputNumberVariants['size'];
|
|
24
27
|
/** '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
28
|
orientation?: InputNumberVariants['orientation'];
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, ref } from "vue";
|
|
2
|
+
import { computed, mergeProps, ref } from "vue";
|
|
3
3
|
import { useFormField } from "../composables/use-form-field";
|
|
4
4
|
import { useIcons } from "../composables/use-icons";
|
|
5
5
|
import { useLocale } from "../composables/use-locale";
|
|
6
6
|
import { useMessages } from "../composables/use-messages";
|
|
7
7
|
import { inputNumberTheme } from "../theme/input-number";
|
|
8
|
-
import {
|
|
8
|
+
import { isNativeInputA11yAttr, isNativeInputAttr } from "../utils/native-input";
|
|
9
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
10
|
+
import { applyClassPrefix, resolveSlot, useComponentTheme, useFallthroughAttrs, useRootProps } from "../utils/ui";
|
|
9
11
|
import Button from "./Button.vue";
|
|
10
12
|
import Icon from "./Icon.vue";
|
|
11
13
|
defineOptions({ inheritAttrs: false });
|
|
@@ -21,6 +23,7 @@ const props = defineProps({
|
|
|
21
23
|
formatOptions: { type: null, required: false },
|
|
22
24
|
locale: { type: String, required: false },
|
|
23
25
|
disabled: { type: Boolean, required: false },
|
|
26
|
+
readonly: { type: Boolean, required: false },
|
|
24
27
|
invalid: { type: Boolean, required: false },
|
|
25
28
|
color: { type: null, required: false, default: "primary" },
|
|
26
29
|
size: { type: null, required: false },
|
|
@@ -86,26 +89,31 @@ function keydown(event) {
|
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
function stepBy(delta) {
|
|
92
|
+
if (props.disabled || props.readonly)
|
|
93
|
+
return;
|
|
89
94
|
const base = props.modelValue ?? props.min ?? 0;
|
|
90
95
|
commit(base + delta);
|
|
91
96
|
if (isFocused.value)
|
|
92
97
|
editingValue.value = String(clamp(base + delta));
|
|
93
98
|
}
|
|
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));
|
|
99
|
+
const canDecrement = computed(() => !props.disabled && !props.readonly && (props.wrap || props.min === void 0 || props.modelValue === void 0 || props.modelValue > props.min));
|
|
100
|
+
const canIncrement = computed(() => !props.disabled && !props.readonly && (props.wrap || props.max === void 0 || props.modelValue === void 0 || props.modelValue < props.max));
|
|
96
101
|
const icons = useIcons();
|
|
97
102
|
const messages = useMessages();
|
|
98
103
|
const theme = useComponentTheme("inputNumber", inputNumberTheme);
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const
|
|
104
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
105
|
+
const ui = computed(() => theme.value({ size: effectiveSize.value, color: effectiveColor.value, invalid: inputInvalid.value, orientation: props.orientation }));
|
|
106
|
+
const isInputAttr = (key) => isNativeInputAttr(key) || isNativeInputA11yAttr(key);
|
|
107
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root, { exclude: isInputAttr });
|
|
108
|
+
const nativeInputAttrs = useFallthroughAttrs(isInputAttr);
|
|
109
|
+
const inputProps = computed(() => mergeProps(resolveSlot(ui.value.input, props.ui?.input), nativeInputAttrs.value));
|
|
102
110
|
const stepperProps = computed(() => resolveSlot(ui.value.stepper, props.ui?.stepper));
|
|
103
111
|
const stepperButtonProps = computed(() => resolveSlot(ui.value.stepperButton, props.ui?.stepperButton));
|
|
104
112
|
const stepButtonUi = { base: "shrink-0" };
|
|
105
113
|
</script>
|
|
106
114
|
|
|
107
115
|
<template>
|
|
108
|
-
<div v-bind="rootProps">
|
|
116
|
+
<div :data-selaras-color="inputInvalid ? 'danger' : effectiveColor" v-bind="rootProps">
|
|
109
117
|
<Button
|
|
110
118
|
v-if="orientation === 'horizontal'"
|
|
111
119
|
variant="text"
|
|
@@ -126,6 +134,11 @@ const stepButtonUi = { base: "shrink-0" };
|
|
|
126
134
|
:name="name ?? field?.name"
|
|
127
135
|
:placeholder="placeholder"
|
|
128
136
|
:disabled="disabled"
|
|
137
|
+
:readonly="readonly"
|
|
138
|
+
role="spinbutton"
|
|
139
|
+
:aria-valuemin="min"
|
|
140
|
+
:aria-valuemax="max"
|
|
141
|
+
:aria-valuenow="props.modelValue"
|
|
129
142
|
:aria-invalid="inputInvalid || void 0"
|
|
130
143
|
:aria-describedby="describedBy"
|
|
131
144
|
v-bind="inputProps"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { InputNumberThemeSlots } from '../theme/input-number.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { inputNumberTheme } from '../theme/input-number.js';
|
|
5
6
|
type InputNumberVariants = VariantProps<typeof inputNumberTheme>;
|
|
@@ -17,9 +18,11 @@ export interface InputNumberProps {
|
|
|
17
18
|
formatOptions?: Intl.NumberFormatOptions;
|
|
18
19
|
locale?: string;
|
|
19
20
|
disabled?: boolean;
|
|
21
|
+
/** Keeps the field focusable and readable while preventing typing and stepping. */
|
|
22
|
+
readonly?: boolean;
|
|
20
23
|
invalid?: boolean;
|
|
21
24
|
/** The focus-ring color - the resting (unfocused) ring stays neutral regardless. */
|
|
22
|
-
color?:
|
|
25
|
+
color?: ColorRole;
|
|
23
26
|
size?: InputNumberVariants['size'];
|
|
24
27
|
/** '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
28
|
orientation?: InputNumberVariants['orientation'];
|
|
@@ -2,6 +2,8 @@ import type { ModalThemeSlots } from '../theme/modal.js';
|
|
|
2
2
|
import type { UiProp } from '../utils/ui.js';
|
|
3
3
|
export interface ModalProps {
|
|
4
4
|
open?: boolean;
|
|
5
|
+
/** Initial visibility for an uncontrolled modal. Supplying `open` makes the parent authoritative. */
|
|
6
|
+
defaultOpen?: boolean;
|
|
5
7
|
title?: string;
|
|
6
8
|
description?: string;
|
|
7
9
|
/** Full-viewport layout instead of the default centered card. Still the initial state when `maximizable` is set - the toggle button takes over from there, optionally controllable via `v-model:fullscreen`. */
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger, VisuallyHidden } from "reka-ui";
|
|
3
|
-
import { computed, ref, useSlots, watch, watchEffect } from "vue";
|
|
3
|
+
import { computed, getCurrentInstance, ref, useSlots, watch, watchEffect } from "vue";
|
|
4
4
|
import { useIcons } from "../composables/use-icons";
|
|
5
5
|
import { useMessages } from "../composables/use-messages";
|
|
6
6
|
import { modalTheme } from "../theme/modal";
|
|
7
|
-
import { resolveSlot, useComponentTheme } from "../utils/ui";
|
|
7
|
+
import { resolveSlot, useComponentTheme, useThemeBindings } from "../utils/ui";
|
|
8
8
|
import Button from "./Button.vue";
|
|
9
9
|
import Icon from "./Icon.vue";
|
|
10
10
|
const props = defineProps({
|
|
11
|
-
open: { type: Boolean, required: false },
|
|
11
|
+
open: { type: Boolean, required: false, default: void 0 },
|
|
12
|
+
defaultOpen: { type: Boolean, required: false },
|
|
12
13
|
title: { type: String, required: false },
|
|
13
14
|
description: { type: String, required: false },
|
|
14
15
|
fullscreen: { type: Boolean, required: false },
|
|
@@ -47,13 +48,15 @@ function onContentAnimationEnd(event) {
|
|
|
47
48
|
if (event.target.getAttribute("data-state") === "closed")
|
|
48
49
|
emit("afterLeave");
|
|
49
50
|
}
|
|
50
|
-
const
|
|
51
|
+
const isControlled = Object.hasOwn(getCurrentInstance()?.vnode.props ?? {}, "open");
|
|
52
|
+
const internalOpen = ref(props.open ?? props.defaultOpen ?? false);
|
|
51
53
|
watch(() => props.open, (value) => {
|
|
52
|
-
if (
|
|
53
|
-
internalOpen.value = value;
|
|
54
|
+
if (isControlled)
|
|
55
|
+
internalOpen.value = value ?? false;
|
|
54
56
|
});
|
|
55
57
|
function onUpdateOpen(value) {
|
|
56
|
-
|
|
58
|
+
if (!isControlled)
|
|
59
|
+
internalOpen.value = value;
|
|
57
60
|
emit("update:open", value);
|
|
58
61
|
}
|
|
59
62
|
watch(internalOpen, (value) => {
|
|
@@ -79,6 +82,7 @@ if (import.meta.dev) {
|
|
|
79
82
|
const icons = useIcons();
|
|
80
83
|
const messages = useMessages();
|
|
81
84
|
const theme = useComponentTheme("modal", modalTheme);
|
|
85
|
+
const themeBindings = useThemeBindings();
|
|
82
86
|
const ui = computed(() => theme.value({ fullscreen: internalFullscreen.value, transition: props.transition }));
|
|
83
87
|
const overlayProps = computed(() => resolveSlot(ui.value.overlay, props.ui?.overlay));
|
|
84
88
|
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
@@ -98,8 +102,17 @@ const footerProps = computed(() => resolveSlot(ui.value.footer, props.ui?.footer
|
|
|
98
102
|
<slot />
|
|
99
103
|
</DialogTrigger>
|
|
100
104
|
<DialogPortal>
|
|
101
|
-
<DialogOverlay
|
|
105
|
+
<DialogOverlay
|
|
106
|
+
v-if="overlay"
|
|
107
|
+
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
108
|
+
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
109
|
+
:style="themeBindings.style"
|
|
110
|
+
v-bind="overlayProps"
|
|
111
|
+
/>
|
|
102
112
|
<DialogContent
|
|
113
|
+
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
114
|
+
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
115
|
+
:style="themeBindings.style"
|
|
103
116
|
v-bind="contentProps"
|
|
104
117
|
@escape-key-down="onEscapeKeyDown"
|
|
105
118
|
@pointer-down-outside="onPointerDownOutside"
|
|
@@ -2,6 +2,8 @@ import type { ModalThemeSlots } from '../theme/modal.js';
|
|
|
2
2
|
import type { UiProp } from '../utils/ui.js';
|
|
3
3
|
export interface ModalProps {
|
|
4
4
|
open?: boolean;
|
|
5
|
+
/** Initial visibility for an uncontrolled modal. Supplying `open` makes the parent authoritative. */
|
|
6
|
+
defaultOpen?: boolean;
|
|
5
7
|
title?: string;
|
|
6
8
|
description?: string;
|
|
7
9
|
/** Full-viewport layout instead of the default centered card. Still the initial state when `maximizable` is set - the toggle button takes over from there, optionally controllable via `v-model:fullscreen`. */
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { onUnmounted } from "vue";
|
|
3
|
+
import { useModalService } from "../internal/programmatic-services";
|
|
4
|
+
import ProgrammaticTheme from "../internal/ProgrammaticTheme.vue";
|
|
3
5
|
import Modal from "./Modal.vue";
|
|
4
|
-
const { modals, close, remove } =
|
|
6
|
+
const { instances: modals, close, remove, dispose } = useModalService();
|
|
7
|
+
onUnmounted(dispose);
|
|
5
8
|
</script>
|
|
6
9
|
|
|
7
10
|
<template>
|
|
8
|
-
<
|
|
11
|
+
<ProgrammaticTheme
|
|
9
12
|
v-for="instance in modals"
|
|
10
13
|
:key="instance.id"
|
|
11
|
-
:
|
|
12
|
-
:title="instance.title"
|
|
13
|
-
:description="instance.description"
|
|
14
|
-
:dismissible="instance.dismissible"
|
|
15
|
-
:modal="instance.modal"
|
|
16
|
-
:overlay="instance.overlay"
|
|
17
|
-
:transition="instance.transition"
|
|
18
|
-
@update:open="(open) => !open && close(instance.id)"
|
|
19
|
-
@after-leave="remove(instance.id)"
|
|
14
|
+
:snapshot="instance._theme"
|
|
20
15
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
<Modal
|
|
17
|
+
:open="instance.isOpen"
|
|
18
|
+
:title="instance.title"
|
|
19
|
+
:description="instance.description"
|
|
20
|
+
:dismissible="instance.dismissible"
|
|
21
|
+
:modal="instance.modal"
|
|
22
|
+
:overlay="instance.overlay"
|
|
23
|
+
:transition="instance.transition"
|
|
24
|
+
@update:open="(open) => !open && close(instance.id)"
|
|
25
|
+
@after-leave="remove(instance.id)"
|
|
26
|
+
>
|
|
27
|
+
<template #content>
|
|
28
|
+
<component :is="instance.component" v-bind="instance.props" @close="(value) => close(instance.id, value)" />
|
|
29
|
+
</template>
|
|
30
|
+
</Modal>
|
|
31
|
+
</ProgrammaticTheme>
|
|
25
32
|
</template>
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { buttonTheme } from '../theme/button.js';
|
|
3
1
|
import type { NavigationMenuThemeSlots } from '../theme/navigation-menu.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
3
|
import type { NavigationMenuItem } from '../utils/navigation-menu.js';
|
|
5
4
|
import type { UiProp } from '../utils/ui.js';
|
|
6
|
-
type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
7
5
|
export interface NavigationMenuProps {
|
|
8
6
|
items: NavigationMenuItem[];
|
|
9
7
|
/** Horizontal uses Reka's real shared-viewport flyout for a single level of dropdown children. Vertical falls back to a recursive accordion (see NavigationMenuAccordionItem.vue) for arbitrary depth - Reka's own NavigationMenuContent isn't built for deep nested trees. */
|
|
10
8
|
orientation?: 'horizontal' | 'vertical';
|
|
11
|
-
color?:
|
|
9
|
+
color?: ColorRole;
|
|
12
10
|
variant?: 'pill' | 'link';
|
|
13
11
|
/** Draws a bar/underline next to the active item, in addition to its own color styling. */
|
|
14
12
|
highlight?: boolean;
|
|
@@ -14,6 +14,7 @@ import { useRoute } from "#imports";
|
|
|
14
14
|
import { useIcons } from "../composables/use-icons";
|
|
15
15
|
import { navigationMenuTheme } from "../theme/navigation-menu";
|
|
16
16
|
import { isNavigationMenuItemActive } from "../utils/navigation-menu";
|
|
17
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
17
18
|
import { resolveSlot, useComponentTheme } from "../utils/ui";
|
|
18
19
|
import Icon from "./Icon.vue";
|
|
19
20
|
import NavigationMenuAccordionItem from "./NavigationMenuAccordionItem.vue";
|
|
@@ -37,17 +38,18 @@ function slotName(item, suffix) {
|
|
|
37
38
|
return `item${suffix}`;
|
|
38
39
|
}
|
|
39
40
|
const theme = useComponentTheme("navigationMenu", navigationMenuTheme);
|
|
40
|
-
const
|
|
41
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
42
|
+
const ui = computed(() => theme.value({ orientation: props.orientation, color: effectiveColor.value, variant: props.variant, highlight: props.highlight, collapsed: props.collapsed }));
|
|
41
43
|
const rootProps = computed(() => resolveSlot(ui.value.root, props.ui?.root));
|
|
42
44
|
const listProps = computed(() => resolveSlot(ui.value.list, props.ui?.list));
|
|
43
45
|
function isActive(item) {
|
|
44
46
|
return isNavigationMenuItemActive(item, route.path);
|
|
45
47
|
}
|
|
46
48
|
function linkProps(item) {
|
|
47
|
-
return resolveSlot(theme.value({ orientation: props.orientation, color:
|
|
49
|
+
return resolveSlot(theme.value({ orientation: props.orientation, color: effectiveColor.value, variant: props.variant, highlight: props.highlight, collapsed: props.collapsed, active: isActive(item), disabled: item.disabled }).link, props.ui?.link);
|
|
48
50
|
}
|
|
49
51
|
function childLinkProps(item) {
|
|
50
|
-
return resolveSlot(theme.value({ orientation: props.orientation, color:
|
|
52
|
+
return resolveSlot(theme.value({ orientation: props.orientation, color: effectiveColor.value, variant: props.variant, highlight: props.highlight, collapsed: props.collapsed, active: isActive(item), disabled: item.disabled }).childLink, props.ui?.childLink);
|
|
51
53
|
}
|
|
52
54
|
const openFlyoutLabel = ref(null);
|
|
53
55
|
function onFlyoutOpenChange(item, value) {
|
|
@@ -69,7 +71,7 @@ function onSelect(item, event) {
|
|
|
69
71
|
</script>
|
|
70
72
|
|
|
71
73
|
<template>
|
|
72
|
-
<NavigationMenuRoot :orientation="orientation" v-bind="rootProps">
|
|
74
|
+
<NavigationMenuRoot :orientation="orientation" :data-selaras-color="effectiveColor" v-bind="rootProps">
|
|
73
75
|
<slot name="list-leading" />
|
|
74
76
|
<NavigationMenuList v-bind="listProps">
|
|
75
77
|
<template v-for="item in items" :key="item.label">
|
|
@@ -120,6 +122,7 @@ function onSelect(item, event) {
|
|
|
120
122
|
<component
|
|
121
123
|
:is="child.to ? NuxtLink : 'button'" :to="child.to" :type="child.to ? void 0 : 'button'"
|
|
122
124
|
:disabled="child.to ? void 0 : child.disabled" v-bind="childLinkProps(child)"
|
|
125
|
+
:target="child.target" :rel="child.rel" :aria-label="child.ariaLabel"
|
|
123
126
|
:aria-disabled="child.to && child.disabled ? 'true' : void 0" @click="onSelect(child, $event)"
|
|
124
127
|
>
|
|
125
128
|
<slot :name="slotName(child, '')" :item="child" :active="isActive(child)">
|
|
@@ -142,6 +145,7 @@ function onSelect(item, event) {
|
|
|
142
145
|
<component
|
|
143
146
|
:is="item.to ? NuxtLink : 'button'" :to="item.to" :type="item.to ? void 0 : 'button'"
|
|
144
147
|
:disabled="item.to ? void 0 : item.disabled" v-bind="linkProps(item)"
|
|
148
|
+
:target="item.target" :rel="item.rel" :aria-label="item.ariaLabel"
|
|
145
149
|
:aria-disabled="item.to && item.disabled ? 'true' : void 0" @click="onSelect(item, $event)"
|
|
146
150
|
>
|
|
147
151
|
<slot :name="slotName(item, '')" :item="item" :active="isActive(item)">
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { buttonTheme } from '../theme/button.js';
|
|
3
1
|
import type { NavigationMenuThemeSlots } from '../theme/navigation-menu.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
3
|
import type { NavigationMenuItem } from '../utils/navigation-menu.js';
|
|
5
4
|
import type { UiProp } from '../utils/ui.js';
|
|
6
|
-
type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
7
5
|
export interface NavigationMenuProps {
|
|
8
6
|
items: NavigationMenuItem[];
|
|
9
7
|
/** Horizontal uses Reka's real shared-viewport flyout for a single level of dropdown children. Vertical falls back to a recursive accordion (see NavigationMenuAccordionItem.vue) for arbitrary depth - Reka's own NavigationMenuContent isn't built for deep nested trees. */
|
|
10
8
|
orientation?: 'horizontal' | 'vertical';
|
|
11
|
-
color?:
|
|
9
|
+
color?: ColorRole;
|
|
12
10
|
variant?: 'pill' | 'link';
|
|
13
11
|
/** Draws a bar/underline next to the active item, in addition to its own color styling. */
|
|
14
12
|
highlight?: boolean;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { buttonTheme } from '../theme/button.js';
|
|
3
1
|
import type { NavigationMenuThemeSlots } from '../theme/navigation-menu.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
3
|
import type { NavigationMenuItem } from '../utils/navigation-menu.js';
|
|
5
4
|
import type { UiProp } from '../utils/ui.js';
|
|
6
|
-
type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
7
5
|
export interface NavigationMenuAccordionItemProps {
|
|
8
6
|
item: NavigationMenuItem;
|
|
9
|
-
color?:
|
|
7
|
+
color?: ColorRole;
|
|
10
8
|
variant?: 'pill' | 'link';
|
|
11
9
|
highlight?: boolean;
|
|
12
10
|
ui?: UiProp<NavigationMenuThemeSlots>;
|
|
@@ -4,6 +4,7 @@ import { NuxtLink } from "#components";
|
|
|
4
4
|
import { useRoute } from "#imports";
|
|
5
5
|
import { navigationMenuTheme } from "../theme/navigation-menu";
|
|
6
6
|
import { isNavigationMenuItemActive } from "../utils/navigation-menu";
|
|
7
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
7
8
|
import { resolveSlot, useComponentTheme } from "../utils/ui";
|
|
8
9
|
import Accordion from "./Accordion.vue";
|
|
9
10
|
import Icon from "./Icon.vue";
|
|
@@ -25,7 +26,8 @@ function slotName(item, suffix) {
|
|
|
25
26
|
return `item${suffix}`;
|
|
26
27
|
}
|
|
27
28
|
const theme = useComponentTheme("navigationMenu", navigationMenuTheme);
|
|
28
|
-
const
|
|
29
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
30
|
+
const ui = computed(() => theme.value({ orientation: "vertical", color: effectiveColor.value, variant: props.variant, highlight: props.highlight }));
|
|
29
31
|
const accordionValue = useId();
|
|
30
32
|
const accordionItems = computed(() => [{ value: accordionValue, label: props.item.label, disabled: props.item.disabled }]);
|
|
31
33
|
const groupUi = computed(() => ({
|
|
@@ -39,7 +41,7 @@ function isActive(item) {
|
|
|
39
41
|
return isNavigationMenuItemActive(item, route.path);
|
|
40
42
|
}
|
|
41
43
|
function linkProps(child) {
|
|
42
|
-
return resolveSlot(theme.value({ orientation: "vertical", color:
|
|
44
|
+
return resolveSlot(theme.value({ orientation: "vertical", color: effectiveColor.value, variant: props.variant, highlight: props.highlight, active: isActive(child), disabled: child.disabled }).link, props.ui?.link);
|
|
43
45
|
}
|
|
44
46
|
function onSelect(item, event) {
|
|
45
47
|
if (item.disabled) {
|
|
@@ -51,7 +53,7 @@ function onSelect(item, event) {
|
|
|
51
53
|
</script>
|
|
52
54
|
|
|
53
55
|
<template>
|
|
54
|
-
<Accordion :items="accordionItems" :default-value="[]" :ui="groupUi">
|
|
56
|
+
<Accordion :items="accordionItems" :default-value="[]" :ui="groupUi" :data-selaras-color="effectiveColor">
|
|
55
57
|
<template #label>
|
|
56
58
|
<slot :name="slotName(item, '')" :item="item" :active="false">
|
|
57
59
|
<slot :name="slotName(item, '-leading')" :item="item" :active="false">
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { buttonTheme } from '../theme/button.js';
|
|
3
1
|
import type { NavigationMenuThemeSlots } from '../theme/navigation-menu.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
3
|
import type { NavigationMenuItem } from '../utils/navigation-menu.js';
|
|
5
4
|
import type { UiProp } from '../utils/ui.js';
|
|
6
|
-
type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
7
5
|
export interface NavigationMenuAccordionItemProps {
|
|
8
6
|
item: NavigationMenuItem;
|
|
9
|
-
color?:
|
|
7
|
+
color?: ColorRole;
|
|
10
8
|
variant?: 'pill' | 'link';
|
|
11
9
|
highlight?: boolean;
|
|
12
10
|
ui?: UiProp<NavigationMenuThemeSlots>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { buttonTheme } from '../theme/button.js';
|
|
3
1
|
import type { NavigationMenuThemeSlots } from '../theme/navigation-menu.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
3
|
import type { NavigationMenuItem } from '../utils/navigation-menu.js';
|
|
5
4
|
import type { UiProp } from '../utils/ui.js';
|
|
6
|
-
type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
7
5
|
export interface NavigationMenuFlyoutListProps {
|
|
8
6
|
items: NavigationMenuItem[];
|
|
9
|
-
color?:
|
|
7
|
+
color?: ColorRole;
|
|
10
8
|
variant?: 'pill' | 'link';
|
|
11
9
|
highlight?: boolean;
|
|
12
10
|
onSelect: (item: NavigationMenuItem, event: Event) => void;
|
|
@@ -4,7 +4,8 @@ import { NuxtLink } from "#components";
|
|
|
4
4
|
import { useRoute } from "#imports";
|
|
5
5
|
import { navigationMenuTheme } from "../theme/navigation-menu";
|
|
6
6
|
import { isNavigationMenuItemActive } from "../utils/navigation-menu";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
8
|
+
import { resolveSlot, useComponentTheme, useThemeBindings } from "../utils/ui";
|
|
8
9
|
import Icon from "./Icon.vue";
|
|
9
10
|
import NavigationMenuAccordionItem from "./NavigationMenuAccordionItem.vue";
|
|
10
11
|
const props = defineProps({
|
|
@@ -21,14 +22,16 @@ function isActive(item) {
|
|
|
21
22
|
return isNavigationMenuItemActive(item, route.path);
|
|
22
23
|
}
|
|
23
24
|
const theme = useComponentTheme("navigationMenu", navigationMenuTheme);
|
|
24
|
-
const
|
|
25
|
+
const themeBindings = useThemeBindings();
|
|
26
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
27
|
+
const ui = computed(() => theme.value({ orientation: "vertical", color: effectiveColor.value, variant: props.variant, highlight: props.highlight, collapsed: false, flyoutRoot: props.root }));
|
|
25
28
|
function linkProps(item) {
|
|
26
|
-
return resolveSlot(theme.value({ orientation: "vertical", color:
|
|
29
|
+
return resolveSlot(theme.value({ orientation: "vertical", color: effectiveColor.value, variant: props.variant, highlight: props.highlight, collapsed: false, active: isActive(item), disabled: item.disabled }).link, props.ui?.link);
|
|
27
30
|
}
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
33
|
<template>
|
|
31
|
-
<ul v-bind="resolveSlot(ui.childList, props.ui?.childList)">
|
|
34
|
+
<ul :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" :data-selaras-color="effectiveColor" v-bind="resolveSlot(ui.childList, props.ui?.childList)">
|
|
32
35
|
<li v-for="item in items" :key="item.label" v-bind="resolveSlot(ui.childItem, props.ui?.childItem)">
|
|
33
36
|
<NavigationMenuAccordionItem v-if="item.children?.length" :item="item" :color="color" :variant="variant" :highlight="highlight" :ui="props.ui" />
|
|
34
37
|
<component
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { buttonTheme } from '../theme/button.js';
|
|
3
1
|
import type { NavigationMenuThemeSlots } from '../theme/navigation-menu.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
3
|
import type { NavigationMenuItem } from '../utils/navigation-menu.js';
|
|
5
4
|
import type { UiProp } from '../utils/ui.js';
|
|
6
|
-
type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
7
5
|
export interface NavigationMenuFlyoutListProps {
|
|
8
6
|
items: NavigationMenuItem[];
|
|
9
|
-
color?:
|
|
7
|
+
color?: ColorRole;
|
|
10
8
|
variant?: 'pill' | 'link';
|
|
11
9
|
highlight?: boolean;
|
|
12
10
|
onSelect: (item: NavigationMenuItem, event: Event) => void;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { buttonTheme } from '../theme/button.js';
|
|
3
1
|
import type { NavigationMenuThemeSlots } from '../theme/navigation-menu.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
3
|
import type { NavigationMenuItem } from '../utils/navigation-menu.js';
|
|
5
4
|
import type { UiProp } from '../utils/ui.js';
|
|
6
|
-
type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
7
5
|
export interface NavigationMenuFlyoutTriggerProps {
|
|
8
6
|
item: NavigationMenuItem;
|
|
9
|
-
color?:
|
|
7
|
+
color?: ColorRole;
|
|
10
8
|
variant?: 'pill' | 'link';
|
|
11
9
|
highlight?: boolean;
|
|
12
10
|
open: boolean;
|