@sewadah/selaras 0.1.1 → 0.2.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 +31 -13
- package/dist/module.d.mts +10 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +120 -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 +8 -5
- 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 +6 -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/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 +29 -50
- package/dist/runtime/theme/prose.js +22 -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 +60 -0
- package/dist/runtime/utils/color-registry.js +187 -0
- package/dist/runtime/utils/dtcg-colors.d.ts +25 -0
- package/dist/runtime/utils/dtcg-colors.js +40 -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/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 +18 -0
- package/dist/runtime/utils/seed-colors.js +199 -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 +66 -10
- package/dist/runtime/composables/use-combobox-select.d.ts +0 -45
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from "reka-ui";
|
|
3
|
-
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { computed, getCurrentInstance, ref, watch } from "vue";
|
|
4
4
|
import { useIcons } from "../composables/use-icons";
|
|
5
5
|
import { collapsibleTheme } from "../theme/collapsible";
|
|
6
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
6
7
|
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
7
8
|
import Icon from "./Icon.vue";
|
|
8
9
|
defineOptions({ inheritAttrs: false });
|
|
@@ -12,13 +13,16 @@ const props = defineProps({
|
|
|
12
13
|
disabled: { type: Boolean, required: false },
|
|
13
14
|
size: { type: null, required: false },
|
|
14
15
|
direction: { type: null, required: false },
|
|
16
|
+
color: { type: null, required: false },
|
|
15
17
|
ui: { type: Object, required: false }
|
|
16
18
|
});
|
|
17
19
|
const emit = defineEmits(["update:open"]);
|
|
18
20
|
defineSlots();
|
|
21
|
+
const isControlled = Object.hasOwn(getCurrentInstance()?.vnode.props ?? {}, "open");
|
|
19
22
|
const icons = useIcons();
|
|
20
23
|
const theme = useComponentTheme("collapsible", collapsibleTheme);
|
|
21
|
-
const
|
|
24
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
25
|
+
const ui = computed(() => theme.value({ size: props.size, direction: props.direction, color: effectiveColor.value }));
|
|
22
26
|
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
23
27
|
const triggerProps = computed(() => resolveSlot(ui.value.trigger, props.ui?.trigger));
|
|
24
28
|
const chevronProps = computed(() => resolveSlot(ui.value.chevron, props.ui?.chevron));
|
|
@@ -26,17 +30,18 @@ const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.cont
|
|
|
26
30
|
const contentInnerProps = computed(() => resolveSlot(ui.value.contentInner, props.ui?.contentInner));
|
|
27
31
|
const internalOpen = ref(props.open ?? props.defaultOpen ?? false);
|
|
28
32
|
watch(() => props.open, (value) => {
|
|
29
|
-
if (
|
|
30
|
-
internalOpen.value = value;
|
|
33
|
+
if (isControlled)
|
|
34
|
+
internalOpen.value = value ?? false;
|
|
31
35
|
});
|
|
32
36
|
function onUpdateOpen(value) {
|
|
33
|
-
|
|
37
|
+
if (!isControlled)
|
|
38
|
+
internalOpen.value = value;
|
|
34
39
|
emit("update:open", value);
|
|
35
40
|
}
|
|
36
41
|
</script>
|
|
37
42
|
|
|
38
43
|
<template>
|
|
39
|
-
<CollapsibleRoot :open="internalOpen" :disabled="disabled" v-bind="rootProps" @update:open="onUpdateOpen">
|
|
44
|
+
<CollapsibleRoot :open="internalOpen" :disabled="disabled" :data-selaras-color="effectiveColor" v-bind="rootProps" @update:open="onUpdateOpen">
|
|
40
45
|
<CollapsibleTrigger v-bind="triggerProps">
|
|
41
46
|
<slot name="trigger" :open="internalOpen" />
|
|
42
47
|
<slot name="chevron-icon" :open="internalOpen">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { CollapsibleThemeSlots } from '../theme/collapsible.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { collapsibleTheme } from '../theme/collapsible.js';
|
|
5
6
|
type CollapsibleVariants = VariantProps<typeof collapsibleTheme>;
|
|
@@ -11,6 +12,8 @@ export interface CollapsibleProps {
|
|
|
11
12
|
size?: CollapsibleVariants['size'];
|
|
12
13
|
/** Which way the content reveals - `down` expands below the trigger, `up` above it. Flips the chevron's rest/open rotation to match. @default 'down' */
|
|
13
14
|
direction?: CollapsibleVariants['direction'];
|
|
15
|
+
/** The trigger hover accent. @default 'primary' */
|
|
16
|
+
color?: ColorRole;
|
|
14
17
|
ui?: UiProp<CollapsibleThemeSlots>;
|
|
15
18
|
}
|
|
16
19
|
export interface CollapsibleEmits {
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { ColorPickerThemeSlots } from '../theme/color-picker.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { colorPickerTheme } from '../theme/color-picker.js';
|
|
5
6
|
type ColorPickerVariants = VariantProps<typeof colorPickerTheme>;
|
|
6
7
|
export interface ColorPickerProps {
|
|
8
|
+
name?: string;
|
|
9
|
+
/** ID of an associated form outside the component's ancestors. */
|
|
10
|
+
form?: string;
|
|
7
11
|
modelValue?: string;
|
|
8
12
|
defaultValue?: string;
|
|
13
|
+
open?: boolean;
|
|
14
|
+
/** Initial uncontrolled open state. */
|
|
15
|
+
defaultOpen?: boolean;
|
|
9
16
|
disabled?: boolean;
|
|
10
17
|
/** Shows an alpha (opacity) slider alongside hue. Reka's own hex output already extends to 8-digit hex (`#RRGGBBAA`) once alpha drops below 1, so this only toggles whether that channel is reachable in the UI - not a format change. @default true */
|
|
11
18
|
alpha?: boolean;
|
|
12
19
|
/** A row of preset colors shown below the hex field - omitted entirely (no swatch row) unless given. */
|
|
13
20
|
swatches?: string[];
|
|
14
21
|
placeholder?: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
22
|
+
/** Opts into the picker's accessible small-screen modal presentation. */
|
|
23
|
+
adaptive?: boolean;
|
|
17
24
|
size?: ColorPickerVariants['size'];
|
|
18
|
-
color?:
|
|
25
|
+
color?: ColorRole;
|
|
19
26
|
ui?: UiProp<ColorPickerThemeSlots>;
|
|
20
27
|
}
|
|
21
28
|
export interface ColorPickerEmits {
|
|
29
|
+
'update:open': [value: boolean];
|
|
22
30
|
'update:modelValue': [value: string];
|
|
23
31
|
}
|
|
24
32
|
declare const __VLS_export: import("vue").DefineComponent<ColorPickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
33
|
"update:modelValue": (value: string) => any;
|
|
34
|
+
"update:open": (value: boolean) => any;
|
|
26
35
|
}, string, import("vue").PublicProps, Readonly<ColorPickerProps> & Readonly<{
|
|
27
36
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
37
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
28
38
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
39
|
declare const _default: typeof __VLS_export;
|
|
30
40
|
export default _default;
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ColorSwatch } from "reka-ui";
|
|
3
|
-
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { computed, getCurrentInstance, onMounted, onUnmounted, ref, watch } from "vue";
|
|
4
4
|
import { useIsMobile } from "../composables/use-media-query";
|
|
5
5
|
import { useMessages } from "../composables/use-messages";
|
|
6
6
|
import ColorPickerBody from "../internal/ColorPickerBody.vue";
|
|
7
7
|
import { colorPickerTheme } from "../theme/color-picker";
|
|
8
|
-
import {
|
|
8
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
9
|
+
import { resolveSlot, useComponentTheme, useThemeBindings } from "../utils/ui";
|
|
9
10
|
import Modal from "./Modal.vue";
|
|
10
11
|
import Popover from "./Popover.vue";
|
|
11
12
|
const props = defineProps({
|
|
13
|
+
name: { type: String, required: false },
|
|
14
|
+
form: { type: String, required: false },
|
|
12
15
|
modelValue: { type: String, required: false },
|
|
13
16
|
defaultValue: { type: String, required: false },
|
|
17
|
+
open: { type: Boolean, required: false },
|
|
18
|
+
defaultOpen: { type: Boolean, required: false },
|
|
14
19
|
disabled: { type: Boolean, required: false },
|
|
15
20
|
alpha: { type: Boolean, required: false, default: true },
|
|
16
21
|
swatches: { type: Array, required: false },
|
|
17
22
|
placeholder: { type: String, required: false },
|
|
18
|
-
|
|
23
|
+
adaptive: { type: Boolean, required: false },
|
|
19
24
|
size: { type: null, required: false },
|
|
20
25
|
color: { type: null, required: false },
|
|
21
26
|
ui: { type: Object, required: false }
|
|
22
27
|
});
|
|
23
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
28
|
+
const emit = defineEmits(["update:open", "update:modelValue"]);
|
|
24
29
|
const messages = useMessages();
|
|
25
|
-
const
|
|
30
|
+
const instance = getCurrentInstance();
|
|
31
|
+
const formAnchor = ref();
|
|
32
|
+
const initialColor = props.defaultValue ?? "#000000";
|
|
33
|
+
let ownerForm = null;
|
|
34
|
+
const internalColor = ref(props.modelValue ?? initialColor);
|
|
26
35
|
watch(() => props.modelValue, (value) => {
|
|
27
36
|
if (value !== void 0)
|
|
28
37
|
internalColor.value = value;
|
|
@@ -31,14 +40,41 @@ function onUpdateColor(value) {
|
|
|
31
40
|
internalColor.value = value;
|
|
32
41
|
emit("update:modelValue", value);
|
|
33
42
|
}
|
|
34
|
-
|
|
43
|
+
function resetColor(event) {
|
|
44
|
+
queueMicrotask(() => {
|
|
45
|
+
if (event.defaultPrevented || Object.hasOwn(instance.vnode.props ?? {}, "modelValue") || Object.hasOwn(instance.vnode.props ?? {}, "model-value"))
|
|
46
|
+
return;
|
|
47
|
+
internalColor.value = initialColor;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
onMounted(() => {
|
|
51
|
+
ownerForm = formAnchor.value?.form ?? null;
|
|
52
|
+
ownerForm?.addEventListener("reset", resetColor);
|
|
53
|
+
});
|
|
54
|
+
onUnmounted(() => ownerForm?.removeEventListener("reset", resetColor));
|
|
55
|
+
const localOpen = ref(props.defaultOpen ?? false);
|
|
56
|
+
const isOpenControlled = () => Object.hasOwn(instance.vnode.props ?? {}, "open");
|
|
57
|
+
const open = computed(() => isOpenControlled() ? props.open ?? false : localOpen.value);
|
|
35
58
|
function onUpdateOpen(value) {
|
|
36
|
-
|
|
59
|
+
if (!isOpenControlled())
|
|
60
|
+
localOpen.value = value;
|
|
61
|
+
emit("update:open", value);
|
|
37
62
|
}
|
|
38
63
|
const isMobile = useIsMobile();
|
|
39
|
-
const
|
|
64
|
+
const mobilePresentation = ref(false);
|
|
65
|
+
watch(open, (open2) => {
|
|
66
|
+
mobilePresentation.value = open2 && !!props.adaptive && isMobile.value;
|
|
67
|
+
});
|
|
68
|
+
onMounted(() => {
|
|
69
|
+
if (open.value)
|
|
70
|
+
mobilePresentation.value = !!props.adaptive && isMobile.value;
|
|
71
|
+
});
|
|
72
|
+
const showMobileModal = computed(() => mobilePresentation.value);
|
|
40
73
|
const theme = useComponentTheme("colorPicker", colorPickerTheme);
|
|
41
|
-
const
|
|
74
|
+
const themeBindings = useThemeBindings();
|
|
75
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
76
|
+
const colorRoleMarker = computed(() => effectiveColor.value);
|
|
77
|
+
const ui = computed(() => theme.value({ size: props.size, color: effectiveColor.value }));
|
|
42
78
|
const triggerProps = computed(() => resolveSlot(ui.value.trigger, props.ui?.trigger));
|
|
43
79
|
const triggerSwatchProps = computed(() => resolveSlot(ui.value.triggerSwatch, props.ui?.triggerSwatch));
|
|
44
80
|
const triggerValueProps = computed(() => resolveSlot(ui.value.triggerValue, props.ui?.triggerValue));
|
|
@@ -65,19 +101,24 @@ const bodyProps = computed(() => ({
|
|
|
65
101
|
swatchListProps: swatchListProps.value,
|
|
66
102
|
swatchProps: swatchProps.value,
|
|
67
103
|
swatchFillProps: swatchFillProps.value,
|
|
68
|
-
swatchIndicatorProps: swatchIndicatorProps.value
|
|
104
|
+
swatchIndicatorProps: swatchIndicatorProps.value,
|
|
105
|
+
colorRoleMarker: colorRoleMarker.value
|
|
69
106
|
}));
|
|
70
107
|
const popoverUi = computed(() => ({ content: resolveSlot(ui.value.content, props.ui?.content) }));
|
|
71
|
-
const
|
|
108
|
+
const adaptiveUi = computed(() => ({ content: "rounded-[var(--selaras-resolved-radius-md)]" }));
|
|
72
109
|
const mobileContentProps = computed(() => resolveSlot(ui.value.mobileContent, props.ui?.mobileContent));
|
|
73
110
|
</script>
|
|
74
111
|
|
|
75
112
|
<template>
|
|
76
|
-
<Popover v-if="!showMobileModal" :open="
|
|
113
|
+
<Popover v-if="!showMobileModal" :open="open" :ui="popoverUi" @update:open="onUpdateOpen">
|
|
77
114
|
<button
|
|
78
115
|
type="button"
|
|
79
116
|
:disabled="disabled"
|
|
80
117
|
:aria-label="messages.colorPicker"
|
|
118
|
+
:data-selaras-color="colorRoleMarker"
|
|
119
|
+
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
120
|
+
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
121
|
+
:style="themeBindings.style"
|
|
81
122
|
v-bind="triggerProps"
|
|
82
123
|
>
|
|
83
124
|
<ColorSwatch :color="internalColor" v-bind="triggerSwatchProps" />
|
|
@@ -90,13 +131,17 @@ const mobileContentProps = computed(() => resolveSlot(ui.value.mobileContent, pr
|
|
|
90
131
|
</Popover>
|
|
91
132
|
|
|
92
133
|
<Modal
|
|
93
|
-
v-else :open="
|
|
94
|
-
:ui="
|
|
134
|
+
v-else :open="open" :title="messages.colorPicker" :description="messages.colorPickerDescription"
|
|
135
|
+
:ui="adaptiveUi" @update:open="onUpdateOpen"
|
|
95
136
|
>
|
|
96
137
|
<button
|
|
97
138
|
type="button"
|
|
98
139
|
:disabled="disabled"
|
|
99
140
|
:aria-label="messages.colorPicker"
|
|
141
|
+
:data-selaras-color="colorRoleMarker"
|
|
142
|
+
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
143
|
+
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
144
|
+
:style="themeBindings.style"
|
|
100
145
|
v-bind="triggerProps"
|
|
101
146
|
>
|
|
102
147
|
<ColorSwatch :color="internalColor" v-bind="triggerSwatchProps" />
|
|
@@ -109,4 +154,5 @@ const mobileContentProps = computed(() => resolveSlot(ui.value.mobileContent, pr
|
|
|
109
154
|
</div>
|
|
110
155
|
</template>
|
|
111
156
|
</Modal>
|
|
157
|
+
<input ref="formAnchor" type="hidden" :name="name" :form="form" :value="internalColor">
|
|
112
158
|
</template>
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { ColorPickerThemeSlots } from '../theme/color-picker.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { colorPickerTheme } from '../theme/color-picker.js';
|
|
5
6
|
type ColorPickerVariants = VariantProps<typeof colorPickerTheme>;
|
|
6
7
|
export interface ColorPickerProps {
|
|
8
|
+
name?: string;
|
|
9
|
+
/** ID of an associated form outside the component's ancestors. */
|
|
10
|
+
form?: string;
|
|
7
11
|
modelValue?: string;
|
|
8
12
|
defaultValue?: string;
|
|
13
|
+
open?: boolean;
|
|
14
|
+
/** Initial uncontrolled open state. */
|
|
15
|
+
defaultOpen?: boolean;
|
|
9
16
|
disabled?: boolean;
|
|
10
17
|
/** Shows an alpha (opacity) slider alongside hue. Reka's own hex output already extends to 8-digit hex (`#RRGGBBAA`) once alpha drops below 1, so this only toggles whether that channel is reachable in the UI - not a format change. @default true */
|
|
11
18
|
alpha?: boolean;
|
|
12
19
|
/** A row of preset colors shown below the hex field - omitted entirely (no swatch row) unless given. */
|
|
13
20
|
swatches?: string[];
|
|
14
21
|
placeholder?: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
22
|
+
/** Opts into the picker's accessible small-screen modal presentation. */
|
|
23
|
+
adaptive?: boolean;
|
|
17
24
|
size?: ColorPickerVariants['size'];
|
|
18
|
-
color?:
|
|
25
|
+
color?: ColorRole;
|
|
19
26
|
ui?: UiProp<ColorPickerThemeSlots>;
|
|
20
27
|
}
|
|
21
28
|
export interface ColorPickerEmits {
|
|
29
|
+
'update:open': [value: boolean];
|
|
22
30
|
'update:modelValue': [value: string];
|
|
23
31
|
}
|
|
24
32
|
declare const __VLS_export: import("vue").DefineComponent<ColorPickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
33
|
"update:modelValue": (value: string) => any;
|
|
34
|
+
"update:open": (value: boolean) => any;
|
|
26
35
|
}, string, import("vue").PublicProps, Readonly<ColorPickerProps> & Readonly<{
|
|
27
36
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
37
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
28
38
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
39
|
declare const _default: typeof __VLS_export;
|
|
30
40
|
export default _default;
|
|
@@ -67,6 +67,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
67
67
|
footer: string;
|
|
68
68
|
sortable: boolean;
|
|
69
69
|
filterable: boolean;
|
|
70
|
-
pinned: "
|
|
70
|
+
pinned: "left" | "right" | undefined;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
72
|
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogRoot, DialogTitle } from "reka-ui";
|
|
3
|
-
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
|
|
3
|
+
import { computed, onMounted, onUnmounted, ref, useId, watch } from "vue";
|
|
4
4
|
import { useCommandPalette } from "../composables/use-command-palette";
|
|
5
5
|
import { useIcons } from "../composables/use-icons";
|
|
6
6
|
import { useMessages } from "../composables/use-messages";
|
|
7
7
|
import { commandPaletteTheme } from "../theme/command-palette";
|
|
8
8
|
import { fuzzyScore } from "../utils/fuzzy-match";
|
|
9
|
-
import { applyClassPrefix, resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
9
|
+
import { applyClassPrefix, resolveSlot, useComponentTheme, useRootProps, useThemeBindings } from "../utils/ui";
|
|
10
10
|
import Icon from "./Icon.vue";
|
|
11
11
|
import Kbd from "./Kbd.vue";
|
|
12
12
|
defineOptions({ inheritAttrs: false });
|
|
@@ -19,15 +19,9 @@ const props = defineProps({
|
|
|
19
19
|
const emit = defineEmits(["update:open"]);
|
|
20
20
|
const shared = useCommandPalette();
|
|
21
21
|
const isControlled = computed(() => props.open !== void 0);
|
|
22
|
-
const
|
|
23
|
-
watch(() => props.open, (value) => {
|
|
24
|
-
if (value !== void 0)
|
|
25
|
-
internalOpen.value = value;
|
|
26
|
-
});
|
|
27
|
-
const isOpen = computed(() => isControlled.value ? internalOpen.value : shared.isOpen.value);
|
|
22
|
+
const isOpen = computed(() => isControlled.value ? props.open : shared.isOpen.value);
|
|
28
23
|
function close() {
|
|
29
24
|
if (isControlled.value) {
|
|
30
|
-
internalOpen.value = false;
|
|
31
25
|
emit("update:open", false);
|
|
32
26
|
} else {
|
|
33
27
|
shared.close();
|
|
@@ -35,8 +29,7 @@ function close() {
|
|
|
35
29
|
}
|
|
36
30
|
function toggle() {
|
|
37
31
|
if (isControlled.value) {
|
|
38
|
-
|
|
39
|
-
emit("update:open", internalOpen.value);
|
|
32
|
+
emit("update:open", !isOpen.value);
|
|
40
33
|
} else {
|
|
41
34
|
shared.toggle();
|
|
42
35
|
}
|
|
@@ -46,6 +39,7 @@ const messages = useMessages();
|
|
|
46
39
|
const query = ref("");
|
|
47
40
|
const highlightedIndex = ref(0);
|
|
48
41
|
const inputRef = ref();
|
|
42
|
+
const listboxId = `selaras-command-palette-list-${useId()}`;
|
|
49
43
|
watch(isOpen, (open) => {
|
|
50
44
|
if (!open) {
|
|
51
45
|
query.value = "";
|
|
@@ -119,6 +113,7 @@ function onGlobalKeydown(event) {
|
|
|
119
113
|
onMounted(() => window.addEventListener("keydown", onGlobalKeydown));
|
|
120
114
|
onUnmounted(() => window.removeEventListener("keydown", onGlobalKeydown));
|
|
121
115
|
const theme = useComponentTheme("commandPalette", commandPaletteTheme);
|
|
116
|
+
const themeBindings = useThemeBindings();
|
|
122
117
|
const ui = computed(() => theme.value());
|
|
123
118
|
const overlayProps = useRootProps(() => ui.value.overlay, () => props.ui?.overlay);
|
|
124
119
|
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
@@ -136,15 +131,22 @@ const emptyProps = computed(() => resolveSlot(ui.value.empty, props.ui?.empty));
|
|
|
136
131
|
const footerProps = computed(() => resolveSlot(ui.value.footer, props.ui?.footer));
|
|
137
132
|
const footerKeyProps = computed(() => resolveSlot(ui.value.footerKey, props.ui?.footerKey));
|
|
138
133
|
function itemId(index) {
|
|
139
|
-
return
|
|
134
|
+
return `${listboxId}-item-${index}`;
|
|
140
135
|
}
|
|
141
136
|
</script>
|
|
142
137
|
|
|
143
138
|
<template>
|
|
144
139
|
<DialogRoot :open="isOpen" @update:open="(value) => value ? void 0 : close()">
|
|
145
140
|
<DialogPortal>
|
|
146
|
-
<DialogOverlay
|
|
147
|
-
|
|
141
|
+
<DialogOverlay
|
|
142
|
+
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
143
|
+
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
144
|
+
:style="themeBindings.style"
|
|
145
|
+
v-bind="overlayProps"
|
|
146
|
+
/>
|
|
147
|
+
<!-- CommandPalette has one built-in search field, so it uses the same
|
|
148
|
+
primary focus role as the other default form controls. -->
|
|
149
|
+
<DialogContent :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" data-selaras-color="primary" v-bind="contentProps" @open-auto-focus="onOpenAutoFocus">
|
|
148
150
|
<DialogTitle :class="applyClassPrefix('sr-only')">
|
|
149
151
|
{{ messages.commandPalette }}
|
|
150
152
|
</DialogTitle>
|
|
@@ -159,14 +161,14 @@ function itemId(index) {
|
|
|
159
161
|
type="text"
|
|
160
162
|
role="combobox"
|
|
161
163
|
aria-expanded="true"
|
|
162
|
-
aria-controls="
|
|
164
|
+
:aria-controls="listboxId"
|
|
163
165
|
:aria-activedescendant="highlightedItemId"
|
|
164
166
|
:placeholder="messages.search"
|
|
165
167
|
v-bind="inputProps"
|
|
166
168
|
@keydown="onInputKeydown"
|
|
167
169
|
>
|
|
168
170
|
</div>
|
|
169
|
-
<div id="
|
|
171
|
+
<div :id="listboxId" v-bind="listProps" role="listbox">
|
|
170
172
|
<template v-if="filteredGroups.length">
|
|
171
173
|
<div v-for="(group, groupIndex) in filteredGroups" :key="group.label ?? groupIndex" v-bind="groupProps">
|
|
172
174
|
<p v-if="group.label" v-bind="groupLabelProps">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentNavigationThemeSlots } from '../theme/content-navigation.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface ContentNavigationLink {
|
|
4
5
|
title: string;
|
|
@@ -9,6 +10,8 @@ export interface ContentNavigationLink {
|
|
|
9
10
|
type __VLS_Slots = ContentNavigationSlots;
|
|
10
11
|
export interface ContentNavigationProps {
|
|
11
12
|
navigation: ContentNavigationLink[];
|
|
13
|
+
/** The active-link accent. @default 'primary' */
|
|
14
|
+
color?: ColorRole;
|
|
12
15
|
/** Set only by this component's own recursive self-call, one level down for each nested group - gates the tree-connector rail (see `content-navigation.ts`'s own `isNested` variant), since a root-level entry has no parent trunk to its left to branch off of. */
|
|
13
16
|
isNested?: boolean;
|
|
14
17
|
ui?: UiProp<ContentNavigationThemeSlots>;
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useRoute } from "#imports";
|
|
4
4
|
import { contentNavigationTheme } from "../theme/content-navigation";
|
|
5
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
5
6
|
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
6
7
|
import Accordion from "./Accordion.vue";
|
|
7
8
|
import Icon from "./Icon.vue";
|
|
8
9
|
defineOptions({ inheritAttrs: false });
|
|
9
10
|
const props = defineProps({
|
|
10
11
|
navigation: { type: Array, required: true },
|
|
12
|
+
color: { type: null, required: false },
|
|
11
13
|
isNested: { type: Boolean, required: false },
|
|
12
14
|
ui: { type: Object, required: false }
|
|
13
15
|
});
|
|
@@ -17,7 +19,8 @@ function isActive(link) {
|
|
|
17
19
|
return route.path === link.path;
|
|
18
20
|
}
|
|
19
21
|
const theme = useComponentTheme("contentNavigation", contentNavigationTheme);
|
|
20
|
-
const
|
|
22
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
23
|
+
const ui = computed(() => theme.value({ isNested: props.isNested, color: effectiveColor.value }));
|
|
21
24
|
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
22
25
|
const groupUi = computed(() => ({
|
|
23
26
|
item: "",
|
|
@@ -29,7 +32,7 @@ const groupUi = computed(() => ({
|
|
|
29
32
|
</script>
|
|
30
33
|
|
|
31
34
|
<template>
|
|
32
|
-
<ul v-bind="rootProps">
|
|
35
|
+
<ul :data-selaras-color="effectiveColor" v-bind="rootProps">
|
|
33
36
|
<li v-for="link in navigation" :key="link.path" v-bind="resolveSlot(ui.item, props.ui?.item)">
|
|
34
37
|
<Accordion
|
|
35
38
|
v-if="link.children?.length"
|
|
@@ -46,7 +49,7 @@ const groupUi = computed(() => ({
|
|
|
46
49
|
<template #[link.path]>
|
|
47
50
|
<!-- Vue's SFC self-recursion resolves by this file's own bare name -
|
|
48
51
|
keep it unprefixed even though the public component is SContentNavigation. -->
|
|
49
|
-
<ContentNavigation :navigation="link.children" is-nested :ui="props.ui">
|
|
52
|
+
<ContentNavigation :navigation="link.children" is-nested :color="color" :ui="props.ui">
|
|
50
53
|
<template #link="scope">
|
|
51
54
|
<slot name="link" v-bind="scope" />
|
|
52
55
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentNavigationThemeSlots } from '../theme/content-navigation.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface ContentNavigationLink {
|
|
4
5
|
title: string;
|
|
@@ -9,6 +10,8 @@ export interface ContentNavigationLink {
|
|
|
9
10
|
type __VLS_Slots = ContentNavigationSlots;
|
|
10
11
|
export interface ContentNavigationProps {
|
|
11
12
|
navigation: ContentNavigationLink[];
|
|
13
|
+
/** The active-link accent. @default 'primary' */
|
|
14
|
+
color?: ColorRole;
|
|
12
15
|
/** Set only by this component's own recursive self-call, one level down for each nested group - gates the tree-connector rail (see `content-navigation.ts`'s own `isNested` variant), since a root-level entry has no parent trunk to its left to branch off of. */
|
|
13
16
|
isNested?: boolean;
|
|
14
17
|
ui?: UiProp<ContentNavigationThemeSlots>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentSurroundThemeSlots } from '../theme/content-surround.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface ContentSurroundLink {
|
|
4
5
|
title: string;
|
|
@@ -9,6 +10,8 @@ export interface ContentSurroundProps {
|
|
|
9
10
|
prev?: ContentSurroundLink;
|
|
10
11
|
/** The next page in reading order. */
|
|
11
12
|
next?: ContentSurroundLink;
|
|
13
|
+
/** The navigation-card hover and focus accent. @default 'primary' */
|
|
14
|
+
color?: ColorRole;
|
|
12
15
|
ui?: UiProp<ContentSurroundThemeSlots>;
|
|
13
16
|
}
|
|
14
17
|
declare const __VLS_export: import("vue").DefineComponent<ContentSurroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContentSurroundProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -3,20 +3,23 @@ import { computed } from "vue";
|
|
|
3
3
|
import { useIcons } from "../composables/use-icons";
|
|
4
4
|
import { useMessages } from "../composables/use-messages";
|
|
5
5
|
import { contentSurroundTheme } from "../theme/content-surround";
|
|
6
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
6
7
|
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
7
8
|
import Icon from "./Icon.vue";
|
|
8
9
|
defineOptions({ inheritAttrs: false });
|
|
9
10
|
const props = defineProps({
|
|
10
11
|
prev: { type: Object, required: false },
|
|
11
12
|
next: { type: Object, required: false },
|
|
13
|
+
color: { type: null, required: false },
|
|
12
14
|
ui: { type: Object, required: false }
|
|
13
15
|
});
|
|
14
16
|
const icons = useIcons();
|
|
15
17
|
const messages = useMessages();
|
|
16
18
|
const theme = useComponentTheme("contentSurround", contentSurroundTheme);
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
19
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
20
|
+
const startUi = computed(() => theme.value({ align: "start", color: effectiveColor.value }));
|
|
21
|
+
const endUi = computed(() => theme.value({ align: "end", color: effectiveColor.value }));
|
|
22
|
+
const rootProps = useRootProps(() => theme.value({ color: effectiveColor.value }).root, () => props.ui?.root);
|
|
20
23
|
const prevLinkProps = computed(() => resolveSlot(startUi.value.link, props.ui?.link));
|
|
21
24
|
const nextLinkProps = computed(() => resolveSlot(endUi.value.link, props.ui?.link));
|
|
22
25
|
const prevLabelProps = computed(() => resolveSlot(startUi.value.label, props.ui?.label));
|
|
@@ -26,7 +29,7 @@ const titleProps = computed(() => resolveSlot(startUi.value.title, props.ui?.tit
|
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
31
|
<template>
|
|
29
|
-
<nav v-if="prev || next" v-bind="rootProps" :aria-label="`${messages.previous} / ${messages.next}`">
|
|
32
|
+
<nav v-if="prev || next" :data-selaras-color="effectiveColor" v-bind="rootProps" :aria-label="`${messages.previous} / ${messages.next}`">
|
|
30
33
|
<NuxtLink v-if="prev" :to="prev.path" v-bind="prevLinkProps">
|
|
31
34
|
<span v-bind="prevLabelProps">
|
|
32
35
|
<Icon :name="icons.chevronLeft" v-bind="iconProps" />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentSurroundThemeSlots } from '../theme/content-surround.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface ContentSurroundLink {
|
|
4
5
|
title: string;
|
|
@@ -9,6 +10,8 @@ export interface ContentSurroundProps {
|
|
|
9
10
|
prev?: ContentSurroundLink;
|
|
10
11
|
/** The next page in reading order. */
|
|
11
12
|
next?: ContentSurroundLink;
|
|
13
|
+
/** The navigation-card hover and focus accent. @default 'primary' */
|
|
14
|
+
color?: ColorRole;
|
|
12
15
|
ui?: UiProp<ContentSurroundThemeSlots>;
|
|
13
16
|
}
|
|
14
17
|
declare const __VLS_export: import("vue").DefineComponent<ContentSurroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContentSurroundProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentTocThemeSlots } from '../theme/content-toc.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface TocLink {
|
|
4
5
|
id: string;
|
|
@@ -10,6 +11,8 @@ type __VLS_Slots = ContentTocSlots;
|
|
|
10
11
|
export interface ContentTocProps {
|
|
11
12
|
links: TocLink[];
|
|
12
13
|
title?: string;
|
|
14
|
+
/** The active-heading link and rail accent. @default 'primary' */
|
|
15
|
+
color?: ColorRole;
|
|
13
16
|
/** Internal: set by recursive self-calls, omit when using this component directly. */
|
|
14
17
|
isNested?: boolean;
|
|
15
18
|
/** Internal: set by recursive self-calls, omit when using this component directly. */
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
|
3
3
|
import { useMessages } from "../composables/use-messages";
|
|
4
4
|
import { contentTocTheme } from "../theme/content-toc";
|
|
5
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
5
6
|
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
6
7
|
defineOptions({ inheritAttrs: false });
|
|
7
8
|
const props = defineProps({
|
|
8
9
|
links: { type: Array, required: true },
|
|
9
10
|
title: { type: String, required: false },
|
|
11
|
+
color: { type: null, required: false },
|
|
10
12
|
isNested: { type: Boolean, required: false, default: false },
|
|
11
13
|
activeIds: { type: Set, required: false },
|
|
12
14
|
ui: { type: Object, required: false }
|
|
@@ -64,7 +66,8 @@ onUnmounted(() => {
|
|
|
64
66
|
});
|
|
65
67
|
const messages = useMessages();
|
|
66
68
|
const theme = useComponentTheme("contentToc", contentTocTheme);
|
|
67
|
-
const
|
|
69
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
70
|
+
const ui = computed(() => theme.value({ color: effectiveColor.value }));
|
|
68
71
|
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
69
72
|
const RAIL_WIDTH = 20;
|
|
70
73
|
const RAIL_X_OUTER = 1;
|
|
@@ -189,7 +192,7 @@ if (isRoot) {
|
|
|
189
192
|
function linkProps(link) {
|
|
190
193
|
const active = activeIds.value.has(link.id);
|
|
191
194
|
return {
|
|
192
|
-
...resolveSlot(theme.value({ active }).link, props.ui?.link),
|
|
195
|
+
...resolveSlot(theme.value({ active, color: effectiveColor.value }).link, props.ui?.link),
|
|
193
196
|
"data-toc-link": "true",
|
|
194
197
|
"data-depth": link.depth,
|
|
195
198
|
"data-active": active || void 0,
|
|
@@ -204,7 +207,7 @@ function linkProps(link) {
|
|
|
204
207
|
</script>
|
|
205
208
|
|
|
206
209
|
<template>
|
|
207
|
-
<component :is="isRoot ? 'nav' : 'div'" v-bind="isRoot ? rootProps : void 0">
|
|
210
|
+
<component :is="isRoot ? 'nav' : 'div'" :data-selaras-color="effectiveColor" v-bind="isRoot ? rootProps : void 0">
|
|
208
211
|
<p v-if="isRoot" v-bind="resolveSlot(ui.title, props.ui?.title)">
|
|
209
212
|
<slot name="title">
|
|
210
213
|
{{ title ?? messages.onThisPage }}
|
|
@@ -237,7 +240,7 @@ function linkProps(link) {
|
|
|
237
240
|
<div v-if="link.children?.length" v-bind="resolveSlot(ui.content, props.ui?.content)">
|
|
238
241
|
<!-- Vue's SFC self-recursion resolves by this file's own bare name -
|
|
239
242
|
keep it unprefixed even though the public component is SContentToc. -->
|
|
240
|
-
<ContentToc :links="link.children" is-nested :active-ids="activeIds" :ui="props.ui">
|
|
243
|
+
<ContentToc :links="link.children" is-nested :active-ids="activeIds" :color="color" :ui="props.ui">
|
|
241
244
|
<template #link="scope">
|
|
242
245
|
<slot name="link" v-bind="scope" />
|
|
243
246
|
</template>
|
|
@@ -253,7 +256,7 @@ function linkProps(link) {
|
|
|
253
256
|
<slot name="link" :link="link" :active="activeIds.has(link.id)">{{ link.text }}</slot>
|
|
254
257
|
</a>
|
|
255
258
|
<div v-if="link.children?.length" v-bind="resolveSlot(ui.content, props.ui?.content)">
|
|
256
|
-
<ContentToc :links="link.children" is-nested :active-ids="activeIds" :ui="props.ui">
|
|
259
|
+
<ContentToc :links="link.children" is-nested :active-ids="activeIds" :color="color" :ui="props.ui">
|
|
257
260
|
<template #link="scope">
|
|
258
261
|
<slot name="link" v-bind="scope" />
|
|
259
262
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentTocThemeSlots } from '../theme/content-toc.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface TocLink {
|
|
4
5
|
id: string;
|
|
@@ -10,6 +11,8 @@ type __VLS_Slots = ContentTocSlots;
|
|
|
10
11
|
export interface ContentTocProps {
|
|
11
12
|
links: TocLink[];
|
|
12
13
|
title?: string;
|
|
14
|
+
/** The active-heading link and rail accent. @default 'primary' */
|
|
15
|
+
color?: ColorRole;
|
|
13
16
|
/** Internal: set by recursive self-calls, omit when using this component directly. */
|
|
14
17
|
isNested?: boolean;
|
|
15
18
|
/** Internal: set by recursive self-calls, omit when using this component directly. */
|