@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
package/README.md
CHANGED
|
@@ -9,23 +9,23 @@ A UI component library for Nuxt, built on Reka UI and Tailwind v4. Every
|
|
|
9
9
|
component ships a `tailwind-variants` theme and a single `:ui` prop for
|
|
10
10
|
overrides - no separate pass-through prop to juggle, no specificity fights
|
|
11
11
|
between the library's own classes and yours. Design tokens are plain CSS
|
|
12
|
-
variables (`@theme`
|
|
12
|
+
variables (`@theme` foundations plus semantic `--selaras-*` inputs), so re-theming an app is a
|
|
13
13
|
matter of overriding variables, not rebuilding the library.
|
|
14
14
|
|
|
15
15
|
- [✨ Release Notes](/CHANGELOG.md)
|
|
16
16
|
|
|
17
17
|
> **Status:** pre-1.0 and still moving - component APIs, the color token
|
|
18
18
|
> system, and internal structure can change between minor versions until
|
|
19
|
-
> things settle.
|
|
19
|
+
> things settle.
|
|
20
20
|
|
|
21
21
|
## Features
|
|
22
22
|
|
|
23
23
|
- **One override prop, not two.** `:ui` accepts a string (tailwind-merge'd
|
|
24
24
|
against the theme) or an object (merged via `mergeProps` for the rare
|
|
25
25
|
non-class case) per slot - the same mental model everywhere in the library.
|
|
26
|
-
- **CSS variable design tokens.** Colors, radii, shadows, and z-index
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
- **CSS variable design tokens.** Colors, radii, shadows, and z-index use
|
|
27
|
+
semantic `--selaras-*` inputs and `--selaras-resolved-*` reads, so swapping
|
|
28
|
+
a brand color is a CSS override, not a rebuild.
|
|
29
29
|
- **CSS-only animation.** Open/close and hover/focus transitions run on
|
|
30
30
|
`data-state` attributes and Tailwind variants - no motion library
|
|
31
31
|
dependency.
|
|
@@ -42,7 +42,7 @@ matter of overriding variables, not rebuilding the library.
|
|
|
42
42
|
Install the module to your Nuxt application with one command:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
npx nuxt module add selaras
|
|
45
|
+
npx nuxt module add @sewadah/selaras
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Tailwind CSS is a peer dependency - install it alongside Selaras too, so
|
|
@@ -56,9 +56,23 @@ Import the CSS in your own stylesheet, after Tailwind itself:
|
|
|
56
56
|
|
|
57
57
|
```css
|
|
58
58
|
@import "tailwindcss";
|
|
59
|
-
@import "selaras";
|
|
59
|
+
@import "@sewadah/selaras";
|
|
60
|
+
@import "#selaras/tailwind.css";
|
|
60
61
|
```
|
|
61
62
|
|
|
63
|
+
For a mature design system that supplies complete semantic role recipes and
|
|
64
|
+
`--selaras-*` functional inputs, import `@sewadah/selaras/structural.css`
|
|
65
|
+
instead. It keeps Selaras's source discovery, variants, motion and semantic
|
|
66
|
+
bindings while omitting Selaras-owned foundation colors. The default aggregate
|
|
67
|
+
import remains the recommended path for most applications. Structural CSS is
|
|
68
|
+
not an unthemed fallback: an incomplete theme has no default palette or runtime
|
|
69
|
+
diagnostic, so provide every role and functional value your components use.
|
|
70
|
+
|
|
71
|
+
The Nuxt-generated import supplies library class candidates and the adaptive
|
|
72
|
+
breakpoint binding to the same Tailwind compilation as your app. Breakpoint
|
|
73
|
+
values come from your CSS (`@theme { --breakpoint-md: 60rem; }`); select another
|
|
74
|
+
name with `selaras.adaptive.breakpoint` in `nuxt.config.ts`.
|
|
75
|
+
|
|
62
76
|
Wrap your root `app.vue` in `<SApp>`, once - required for Tooltip's shared
|
|
63
77
|
hover-delay behavior and the `useModal`/`useDrawer`/`useSlideover` composables
|
|
64
78
|
to work:
|
|
@@ -82,6 +96,26 @@ Every component is now auto-imported and ready to use:
|
|
|
82
96
|
</SButton>
|
|
83
97
|
```
|
|
84
98
|
|
|
99
|
+
## Theming
|
|
100
|
+
|
|
101
|
+
Selaras is CSS-first for design values.
|
|
102
|
+
|
|
103
|
+
For normal theme changes, override the public `--selaras-*` CSS variables or
|
|
104
|
+
the Selaras foundation palettes in Tailwind `@theme`. You do not need
|
|
105
|
+
`nuxt.config.ts` to change built-in roles such as `primary`, `warning`,
|
|
106
|
+
`danger`, or `neutral`.
|
|
107
|
+
|
|
108
|
+
Use `selaras.theme.colors` in `nuxt.config.ts` when you must register a new
|
|
109
|
+
role name, such as `tertiary`, or when you intentionally want to author a
|
|
110
|
+
complete build-time recipe.
|
|
111
|
+
|
|
112
|
+
`defineColorFromSeed()` is an optional accessibility-oriented generator. The
|
|
113
|
+
supplied color remains the exact resting solid fill; Selaras derives readable
|
|
114
|
+
content, interaction states, text, borders, focus, and essential indicators
|
|
115
|
+
around it. Use `defineColor()` when you need to author every leaf yourself.
|
|
116
|
+
|
|
117
|
+
See the full [Theming guide](./docs/content/overview/theming.md).
|
|
118
|
+
|
|
85
119
|
## Contribution
|
|
86
120
|
|
|
87
121
|
<details>
|
|
@@ -91,14 +125,14 @@ Every component is now auto-imported and ready to use:
|
|
|
91
125
|
# Install dependencies
|
|
92
126
|
npm install
|
|
93
127
|
|
|
94
|
-
# Generate type stubs
|
|
95
|
-
npm run
|
|
128
|
+
# Generate type stubs and prepare the docs site
|
|
129
|
+
npm run docs:prepare
|
|
96
130
|
|
|
97
|
-
# Develop with the
|
|
98
|
-
npm run dev
|
|
131
|
+
# Develop with the docs site (documentation + component showcase)
|
|
132
|
+
npm run docs:dev
|
|
99
133
|
|
|
100
|
-
#
|
|
101
|
-
npm run
|
|
134
|
+
# Generate the static docs site
|
|
135
|
+
npm run docs:generate
|
|
102
136
|
|
|
103
137
|
# Type-check
|
|
104
138
|
npm run test:types
|
|
@@ -110,22 +144,35 @@ Every component is now auto-imported and ready to use:
|
|
|
110
144
|
npm run test
|
|
111
145
|
npm run test:watch
|
|
112
146
|
|
|
113
|
-
#
|
|
147
|
+
# Build and test source consumers plus an isolated installed tarball
|
|
148
|
+
# Requires Bun for the temporary consumer's dependency installation
|
|
149
|
+
npm run test:compat
|
|
150
|
+
|
|
151
|
+
# Release new versions (selaras, docs layer, or both)
|
|
114
152
|
npm run release
|
|
153
|
+
npm run release:selaras
|
|
154
|
+
npm run release:docs
|
|
155
|
+
|
|
156
|
+
# Each package has its own version stream, so one run can bump them at
|
|
157
|
+
# different levels - Selaras major alongside a docs patch, for example.
|
|
158
|
+
# The release workflow exposes per-package bump/version inputs for this.
|
|
159
|
+
# Locally, drive each half through its own env:
|
|
160
|
+
RELEASE_BUMP=major npm run release:selaras
|
|
161
|
+
RELEASE_BUMP=patch npm run release:docs
|
|
115
162
|
```
|
|
116
163
|
|
|
117
164
|
</details>
|
|
118
165
|
|
|
119
166
|
|
|
120
167
|
<!-- Badges -->
|
|
121
|
-
[npm-version-src]: https://img.shields.io/npm/v/selaras/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
122
|
-
[npm-version-href]: https://npmjs.com/package/selaras
|
|
168
|
+
[npm-version-src]: https://img.shields.io/npm/v/@sewadah/selaras/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
169
|
+
[npm-version-href]: https://npmjs.com/package/@sewadah/selaras
|
|
123
170
|
|
|
124
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/selaras.svg?style=flat&colorA=020420&colorB=00DC82
|
|
125
|
-
[npm-downloads-href]: https://npm.chart.dev/selaras
|
|
171
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@sewadah/selaras.svg?style=flat&colorA=020420&colorB=00DC82
|
|
172
|
+
[npm-downloads-href]: https://npm.chart.dev/@sewadah/selaras
|
|
126
173
|
|
|
127
|
-
[license-src]: https://img.shields.io/npm/l/selaras.svg?style=flat&colorA=020420&colorB=00DC82
|
|
128
|
-
[license-href]: https://npmjs.com/package/selaras
|
|
174
|
+
[license-src]: https://img.shields.io/npm/l/@sewadah/selaras.svg?style=flat&colorA=020420&colorB=00DC82
|
|
175
|
+
[license-href]: https://npmjs.com/package/@sewadah/selaras
|
|
129
176
|
|
|
130
177
|
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt
|
|
131
178
|
[nuxt-href]: https://nuxt.com
|
package/dist/module.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { ColorModePair, ColorRecipeInput } from '../dist/runtime/utils/color-registry.js';
|
|
2
3
|
|
|
3
4
|
interface ModuleOptions {
|
|
4
5
|
/**
|
|
@@ -15,6 +16,15 @@ interface ModuleOptions {
|
|
|
15
16
|
* installation docs before setting this.
|
|
16
17
|
*/
|
|
17
18
|
classPrefix?: string;
|
|
19
|
+
/** Adaptive presentation uses this Tailwind `--breakpoint-*` condition. */
|
|
20
|
+
adaptive?: {
|
|
21
|
+
/** Breakpoint name; its value is owned by the consumer's CSS. @default 'md' */
|
|
22
|
+
breakpoint?: string;
|
|
23
|
+
};
|
|
24
|
+
/** Build-time semantic color roles. Both light and dark recipes are required. */
|
|
25
|
+
theme?: {
|
|
26
|
+
colors?: Record<string, ColorModePair<ColorRecipeInput>>;
|
|
27
|
+
};
|
|
18
28
|
}
|
|
19
29
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
20
30
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addVitePlugin, addComponentsDir,
|
|
1
|
+
import { defineNuxtModule, createResolver, addVitePlugin, addComponentsDir, addImports, addTemplate, addTypeTemplate } from '@nuxt/kit';
|
|
2
2
|
import { Scanner } from '@tailwindcss/oxide';
|
|
3
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
+
import { builtinColorNames, createColorRegistry, generateColorRoleCss } from '../dist/runtime/utils/color-registry.js';
|
|
5
|
+
|
|
6
|
+
const foundationPaletteByRole = {
|
|
7
|
+
primary: "indigo",
|
|
8
|
+
secondary: "plum",
|
|
9
|
+
success: "green",
|
|
10
|
+
info: "blue",
|
|
11
|
+
warning: "yellow",
|
|
12
|
+
danger: "red",
|
|
13
|
+
neutral: "gray"
|
|
14
|
+
};
|
|
15
|
+
const fillShadesByRole = {
|
|
16
|
+
primary: { light: [500, 600, 700], dark: [400, 300, 200] },
|
|
17
|
+
secondary: { light: [600, 700, 800], dark: [400, 300, 200] },
|
|
18
|
+
success: { light: [500, 600, 700], dark: [500, 400, 300] },
|
|
19
|
+
info: { light: [600, 700, 800], dark: [500, 400, 300] },
|
|
20
|
+
warning: { light: [500, 600, 700], dark: [500, 400, 300] },
|
|
21
|
+
danger: { light: [500, 600, 700], dark: [500, 400, 300] },
|
|
22
|
+
neutral: { light: [950, 900, 800], dark: [200, 100, 50] }
|
|
23
|
+
};
|
|
24
|
+
function createBuiltinColorRegistry(classPrefix) {
|
|
25
|
+
const foundation = (role, shade) => `var(--${classPrefix ? `${classPrefix}-` : ""}color-selaras-${foundationPaletteByRole[role]}-${shade})`;
|
|
26
|
+
const recipes = Object.fromEntries(builtinColorNames.map((role) => {
|
|
27
|
+
const mode = (dark) => {
|
|
28
|
+
const neutral = role === "neutral";
|
|
29
|
+
const brightIntent = role === "success" || role === "warning" || role === "danger";
|
|
30
|
+
const modeName = dark ? "dark" : "light";
|
|
31
|
+
const [fillShade, hoverShade, pressedShade] = fillShadesByRole[role][modeName];
|
|
32
|
+
const textShade = brightIntent ? 800 : role === "info" ? 700 : fillShade;
|
|
33
|
+
const fill = foundation(role, fillShade);
|
|
34
|
+
const hover = brightIntent ? `color-mix(in oklab, ${fill} ${!dark && role === "danger" ? 98 : 94}%, ${dark ? "white" : "black"})` : foundation(role, hoverShade);
|
|
35
|
+
const pressed = brightIntent ? `color-mix(in oklab, ${fill} ${!dark && role === "danger" ? 96 : 88}%, ${dark ? "white" : "black"})` : foundation(role, pressedShade);
|
|
36
|
+
const text = foundation(role, neutral ? dark ? 50 : 950 : dark ? 300 : textShade);
|
|
37
|
+
const subtle = neutral ? foundation(role, dark ? 900 : 100) : dark ? `color-mix(in oklab, ${fill} ${brightIntent ? 16 : 24}%, var(--selaras-resolved-surface-default))` : foundation(role, brightIntent ? 50 : 100);
|
|
38
|
+
const indicatorShade = dark ? 400 : role === "success" || role === "warning" ? 700 : role === "danger" ? 500 : fillShade;
|
|
39
|
+
const indicator = neutral ? foundation(role, 500) : foundation(role, indicatorShade);
|
|
40
|
+
return {
|
|
41
|
+
fill,
|
|
42
|
+
fillHover: hover,
|
|
43
|
+
fillPressed: pressed,
|
|
44
|
+
onFill: foundation("neutral", brightIntent ? 950 : dark ? 950 : 25),
|
|
45
|
+
indicator,
|
|
46
|
+
subtle,
|
|
47
|
+
subtleHover: brightIntent ? `color-mix(in oklab, ${subtle} 96%, ${text})` : dark ? `color-mix(in oklab, ${foundation(role, 500)} 32%, var(--selaras-resolved-surface-default))` : `color-mix(in oklab, ${subtle} 94%, ${text})`,
|
|
48
|
+
subtlePressed: brightIntent ? `color-mix(in oklab, ${subtle} 92%, ${text})` : dark ? `color-mix(in oklab, ${foundation(role, 500)} 40%, var(--selaras-resolved-surface-default))` : `color-mix(in oklab, ${subtle} 90%, ${text})`,
|
|
49
|
+
onSubtle: text,
|
|
50
|
+
text,
|
|
51
|
+
textHover: foundation(role, neutral ? dark ? 100 : 900 : dark ? 200 : Math.min(textShade + 100, 950)),
|
|
52
|
+
textPressed: foundation(role, neutral ? dark ? 200 : 800 : dark ? 100 : Math.min(textShade + 200, 950)),
|
|
53
|
+
border: indicator,
|
|
54
|
+
focus: brightIntent ? indicator : text
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
return [role, { light: mode(false), dark: mode(true) }];
|
|
58
|
+
}));
|
|
59
|
+
return createColorRegistry(recipes);
|
|
60
|
+
}
|
|
4
61
|
|
|
5
62
|
const module$1 = defineNuxtModule({
|
|
6
63
|
meta: {
|
|
@@ -58,7 +115,18 @@ const module$1 = defineNuxtModule({
|
|
|
58
115
|
priority: 10
|
|
59
116
|
});
|
|
60
117
|
}
|
|
61
|
-
|
|
118
|
+
addImports([
|
|
119
|
+
{ name: "useCommandPalette", from: resolver.resolve("./runtime/composables/use-command-palette") },
|
|
120
|
+
{ name: "useDrawer", from: resolver.resolve("./runtime/composables/use-drawer") },
|
|
121
|
+
{ name: "useIcons", from: resolver.resolve("./runtime/composables/use-icons") },
|
|
122
|
+
{ name: "useLocale", from: resolver.resolve("./runtime/composables/use-locale") },
|
|
123
|
+
{ name: "useMessages", from: resolver.resolve("./runtime/composables/use-messages") },
|
|
124
|
+
{ name: "useModal", from: resolver.resolve("./runtime/composables/use-modal") },
|
|
125
|
+
{ name: "useRippleEnabled", from: resolver.resolve("./runtime/composables/use-ripple") },
|
|
126
|
+
{ name: "useSlideover", from: resolver.resolve("./runtime/composables/use-slideover") },
|
|
127
|
+
{ name: "createTableColumnHelper", from: resolver.resolve("./runtime/composables/use-table") },
|
|
128
|
+
{ name: "useToast", from: resolver.resolve("./runtime/composables/use-toast") }
|
|
129
|
+
]);
|
|
62
130
|
nuxt.hook("prepare:types", ({ references }) => {
|
|
63
131
|
references.push({ path: resolver.resolve("./runtime/types/app-config.d.ts") });
|
|
64
132
|
});
|
|
@@ -72,13 +140,53 @@ const module$1 = defineNuxtModule({
|
|
|
72
140
|
getContents: () => `export const classPrefix = ${JSON.stringify(options.classPrefix ?? null)}
|
|
73
141
|
`
|
|
74
142
|
});
|
|
143
|
+
const colorRegistry = {
|
|
144
|
+
...createBuiltinColorRegistry(options.classPrefix),
|
|
145
|
+
...createColorRegistry(options.theme?.colors ?? {})
|
|
146
|
+
};
|
|
147
|
+
addTemplate({
|
|
148
|
+
filename: "selaras-color-roles.mjs",
|
|
149
|
+
getContents: () => `export const colorRoles = ${JSON.stringify(Object.keys(colorRegistry).sort())}
|
|
150
|
+
`
|
|
151
|
+
});
|
|
152
|
+
addTypeTemplate({
|
|
153
|
+
filename: "selaras-color-roles.d.ts",
|
|
154
|
+
getContents: () => {
|
|
155
|
+
const roles = Object.keys(colorRegistry).sort();
|
|
156
|
+
const declarations = roles.map((role) => ` ${JSON.stringify(role)}: true`).join("\n");
|
|
157
|
+
return `declare global {
|
|
158
|
+
interface SelarasColorRegistry {
|
|
159
|
+
${declarations}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export {}
|
|
164
|
+
`;
|
|
165
|
+
},
|
|
166
|
+
write: true
|
|
167
|
+
});
|
|
168
|
+
if (Object.keys(colorRegistry).length > 0) {
|
|
169
|
+
const colorsTemplate = addTemplate({
|
|
170
|
+
filename: "selaras-color-roles.css",
|
|
171
|
+
getContents: () => generateColorRoleCss(colorRegistry),
|
|
172
|
+
write: true
|
|
173
|
+
});
|
|
174
|
+
nuxt.options.css.push(colorsTemplate.dst);
|
|
175
|
+
}
|
|
176
|
+
const breakpoint = options.adaptive?.breakpoint ?? "md";
|
|
177
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(breakpoint))
|
|
178
|
+
throw new Error('Selaras adaptive.breakpoint must name a Tailwind breakpoint (for example "md" or "tablet").');
|
|
179
|
+
let safelist = "";
|
|
75
180
|
if (options.classPrefix) {
|
|
76
181
|
const runtimeBase = resolver.resolve("./runtime");
|
|
77
182
|
const scanner = new Scanner({
|
|
78
183
|
sources: [
|
|
79
184
|
{ base: runtimeBase, pattern: "./components/**/*.vue", negated: false },
|
|
80
|
-
{ base: runtimeBase, pattern: "./
|
|
81
|
-
|
|
185
|
+
{ base: runtimeBase, pattern: "./internal/**/*.vue", negated: false },
|
|
186
|
+
// Published recipes/utilities are JS; directory globs cover both
|
|
187
|
+
// source TS and built files, matching theme.css's @source entries.
|
|
188
|
+
{ base: runtimeBase, pattern: "./theme/**/*", negated: false },
|
|
189
|
+
{ base: runtimeBase, pattern: "./utils/**/*", negated: false }
|
|
82
190
|
]
|
|
83
191
|
});
|
|
84
192
|
const candidates = scanner.scan().filter((candidate) => {
|
|
@@ -88,39 +196,18 @@ const module$1 = defineNuxtModule({
|
|
|
88
196
|
return false;
|
|
89
197
|
return true;
|
|
90
198
|
});
|
|
91
|
-
|
|
92
|
-
const safelistTemplate = addTemplate({
|
|
93
|
-
filename: "selaras-prefix-safelist.css",
|
|
94
|
-
// Tailwind's split entry points (`tailwindcss/theme.css` +
|
|
95
|
-
// `tailwindcss/utilities.css`, each with their own `prefix(...)`)
|
|
96
|
-
// emit only the utilities layer for this file's own safelist
|
|
97
|
-
// candidates, instead of a second full copy of Preflight/theme
|
|
98
|
-
// output the plain `@import "tailwindcss" prefix(...)` form would
|
|
99
|
-
// otherwise duplicate (confirmed: ~3.4KB vs ~190KB for an
|
|
100
|
-
// equivalent safelist). `theme(reference)` on the theme import:
|
|
101
|
-
// this file only needs to *resolve* Tailwind's own theme values
|
|
102
|
-
// for candidate generation, not emit them again.
|
|
103
|
-
//
|
|
104
|
-
// `tw-animate-css` and `@custom-variant dark` are also imported/
|
|
105
|
-
// declared here, matching theme.css's own - both live only in
|
|
106
|
-
// theme.css's (separate) compilation otherwise, so without them
|
|
107
|
-
// every `${prefix}:animate-in`/`${prefix}:fade-in-0`/etc class
|
|
108
|
-
// (every Modal/Dropdown/Select/Toast/Tooltip/Drawer open-close
|
|
109
|
-
// transition) would silently generate no CSS at all under a
|
|
110
|
-
// configured prefix - confirmed empirically. `dark:` isn't used
|
|
111
|
-
// by any real component class yet, but costs nothing to close now.
|
|
112
|
-
getContents: () => [
|
|
113
|
-
`@import "tailwindcss/theme.css" theme(reference) prefix(${options.classPrefix});`,
|
|
114
|
-
`@import "tailwindcss/utilities.css" layer(utilities) prefix(${options.classPrefix});`,
|
|
115
|
-
`@import "tw-animate-css";`,
|
|
116
|
-
`@custom-variant dark (&:where(.dark, .dark *));`,
|
|
117
|
-
`@source inline("${safelist}");`,
|
|
118
|
-
""
|
|
119
|
-
].join("\n"),
|
|
120
|
-
write: true
|
|
121
|
-
});
|
|
122
|
-
nuxt.options.css.push(safelistTemplate.dst);
|
|
199
|
+
safelist = candidates.map((candidate) => `${options.classPrefix}:${candidate}`).join(" ");
|
|
123
200
|
}
|
|
201
|
+
const tailwindTemplate = addTemplate({
|
|
202
|
+
filename: "selaras-tailwind.css",
|
|
203
|
+
getContents: () => [
|
|
204
|
+
safelist ? `@source inline("${safelist}");` : "",
|
|
205
|
+
`:root { --selaras-adaptive-breakpoint: var(--${options.classPrefix ? `${options.classPrefix}-` : ""}breakpoint-${breakpoint}); }`,
|
|
206
|
+
""
|
|
207
|
+
].join("\n"),
|
|
208
|
+
write: true
|
|
209
|
+
});
|
|
210
|
+
nuxt.options.alias["#selaras/tailwind.css"] = tailwindTemplate.dst;
|
|
124
211
|
}
|
|
125
212
|
});
|
|
126
213
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { AccordionThemeSlots } from '../theme/accordion.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { accordionTheme } from '../theme/accordion.js';
|
|
5
6
|
type AccordionVariants = VariantProps<typeof accordionTheme>;
|
|
@@ -23,6 +24,8 @@ export interface AccordionProps {
|
|
|
23
24
|
variant?: AccordionVariants['variant'];
|
|
24
25
|
/** @default 'end' */
|
|
25
26
|
chevronPosition?: AccordionVariants['chevronPosition'];
|
|
27
|
+
/** The trigger hover accent. @default 'primary' */
|
|
28
|
+
color?: ColorRole;
|
|
26
29
|
ui?: UiProp<AccordionThemeSlots>;
|
|
27
30
|
}
|
|
28
31
|
export interface AccordionEmits {
|
|
@@ -3,6 +3,7 @@ import { AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, Accord
|
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
import { useIcons } from "../composables/use-icons";
|
|
5
5
|
import { accordionTheme } from "../theme/accordion";
|
|
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 });
|
|
@@ -16,17 +17,20 @@ const props = defineProps({
|
|
|
16
17
|
size: { type: null, required: false },
|
|
17
18
|
variant: { type: null, required: false },
|
|
18
19
|
chevronPosition: { type: null, required: false },
|
|
20
|
+
color: { type: null, required: false },
|
|
19
21
|
ui: { type: Object, required: false }
|
|
20
22
|
});
|
|
21
23
|
defineEmits(["update:modelValue"]);
|
|
22
24
|
const icons = useIcons();
|
|
23
25
|
const theme = useComponentTheme("accordion", accordionTheme);
|
|
24
|
-
const
|
|
26
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "primary", "primary"));
|
|
27
|
+
const ui = computed(() => theme.value({ size: props.size, variant: props.variant, chevronPosition: props.chevronPosition, color: effectiveColor.value }));
|
|
25
28
|
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
31
|
<template>
|
|
29
32
|
<AccordionRoot
|
|
33
|
+
:data-selaras-color="effectiveColor"
|
|
30
34
|
:type="type"
|
|
31
35
|
:default-value="defaultValue"
|
|
32
36
|
:model-value="modelValue"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { AccordionThemeSlots } from '../theme/accordion.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { accordionTheme } from '../theme/accordion.js';
|
|
5
6
|
type AccordionVariants = VariantProps<typeof accordionTheme>;
|
|
@@ -23,6 +24,8 @@ export interface AccordionProps {
|
|
|
23
24
|
variant?: AccordionVariants['variant'];
|
|
24
25
|
/** @default 'end' */
|
|
25
26
|
chevronPosition?: AccordionVariants['chevronPosition'];
|
|
27
|
+
/** The trigger hover accent. @default 'primary' */
|
|
28
|
+
color?: ColorRole;
|
|
26
29
|
ui?: UiProp<AccordionThemeSlots>;
|
|
27
30
|
}
|
|
28
31
|
export interface AccordionEmits {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { AlertThemeSlots } from '../theme/alert.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { alertTheme } from '../theme/alert.js';
|
|
5
6
|
type AlertVariants = VariantProps<typeof alertTheme>;
|
|
@@ -11,7 +12,7 @@ export interface AlertProps {
|
|
|
11
12
|
icon?: string;
|
|
12
13
|
/** Shows a dismiss button and emits `close` when clicked. The alert has no open state of its own - closing it is left to the consumer's own v-if/v-for, the same way Chip's own `removable` + `remove` already works. */
|
|
13
14
|
closable?: boolean;
|
|
14
|
-
color?:
|
|
15
|
+
color?: ColorRole;
|
|
15
16
|
variant?: AlertVariants['variant'];
|
|
16
17
|
ui?: UiProp<AlertThemeSlots>;
|
|
17
18
|
}
|
|
@@ -3,6 +3,8 @@ import { computed } from "vue";
|
|
|
3
3
|
import { useIcons } from "../composables/use-icons";
|
|
4
4
|
import { useMessages } from "../composables/use-messages";
|
|
5
5
|
import { alertTheme } from "../theme/alert";
|
|
6
|
+
import { isFeedbackIntent } from "../utils/icons";
|
|
7
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
6
8
|
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
7
9
|
import Button from "./Button.vue";
|
|
8
10
|
import Icon from "./Icon.vue";
|
|
@@ -20,9 +22,10 @@ const emit = defineEmits(["close"]);
|
|
|
20
22
|
defineSlots();
|
|
21
23
|
const icons = useIcons();
|
|
22
24
|
const messages = useMessages();
|
|
23
|
-
const
|
|
25
|
+
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? "info", "info"));
|
|
26
|
+
const iconName = computed(() => props.icon ?? (props.color && isFeedbackIntent(effectiveColor.value) ? icons.value[effectiveColor.value] : void 0));
|
|
24
27
|
const theme = useComponentTheme("alert", alertTheme);
|
|
25
|
-
const ui = computed(() => theme.value({ color:
|
|
28
|
+
const ui = computed(() => theme.value({ color: effectiveColor.value, variant: props.variant }));
|
|
26
29
|
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
27
30
|
const iconProps = computed(() => resolveSlot(ui.value.icon, props.ui?.icon));
|
|
28
31
|
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
@@ -33,7 +36,7 @@ const closeProps = computed(() => resolveSlot(ui.value.close, props.ui?.close));
|
|
|
33
36
|
</script>
|
|
34
37
|
|
|
35
38
|
<template>
|
|
36
|
-
<div v-bind="rootProps">
|
|
39
|
+
<div :data-selaras-color="effectiveColor" v-bind="rootProps">
|
|
37
40
|
<Icon v-if="iconName" :name="iconName" v-bind="iconProps" />
|
|
38
41
|
<div v-bind="contentProps">
|
|
39
42
|
<p v-if="title || $slots.title" v-bind="titleProps">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
2
2
|
import type { AlertThemeSlots } from '../theme/alert.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
3
4
|
import type { UiProp } from '../utils/ui.js';
|
|
4
5
|
import { alertTheme } from '../theme/alert.js';
|
|
5
6
|
type AlertVariants = VariantProps<typeof alertTheme>;
|
|
@@ -11,7 +12,7 @@ export interface AlertProps {
|
|
|
11
12
|
icon?: string;
|
|
12
13
|
/** Shows a dismiss button and emits `close` when clicked. The alert has no open state of its own - closing it is left to the consumer's own v-if/v-for, the same way Chip's own `removable` + `remove` already works. */
|
|
13
14
|
closable?: boolean;
|
|
14
|
-
color?:
|
|
15
|
+
color?: ColorRole;
|
|
15
16
|
variant?: AlertVariants['variant'];
|
|
16
17
|
ui?: UiProp<AlertThemeSlots>;
|
|
17
18
|
}
|
|
@@ -3,6 +3,8 @@ import type { UiProp } from '../utils/ui.js';
|
|
|
3
3
|
import type { ButtonProps } from './Button.vue.js';
|
|
4
4
|
export interface AlertDialogProps {
|
|
5
5
|
open?: boolean;
|
|
6
|
+
/** Initial visibility for an uncontrolled alert dialog. Supplying `open` makes the parent authoritative. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
6
8
|
title?: string;
|
|
7
9
|
description?: string;
|
|
8
10
|
/** Label for the default Cancel button - only rendered when no `footer` slot is given. @default 'Cancel' */
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger } 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 { useMessages } from "../composables/use-messages";
|
|
5
5
|
import { alertDialogTheme } from "../theme/alert-dialog";
|
|
6
|
-
import { resolveSlot, useComponentTheme } from "../utils/ui";
|
|
6
|
+
import { resolveSlot, useComponentTheme, useThemeBindings } from "../utils/ui";
|
|
7
7
|
import Button from "./Button.vue";
|
|
8
8
|
const props = defineProps({
|
|
9
|
-
open: { type: Boolean, required: false },
|
|
9
|
+
open: { type: Boolean, required: false, default: void 0 },
|
|
10
|
+
defaultOpen: { type: Boolean, required: false },
|
|
10
11
|
title: { type: String, required: false },
|
|
11
12
|
description: { type: String, required: false },
|
|
12
13
|
cancelLabel: { type: String, required: false },
|
|
@@ -32,13 +33,15 @@ function onContentAnimationEnd(event) {
|
|
|
32
33
|
if (event.target.getAttribute("data-state") === "closed")
|
|
33
34
|
emit("afterLeave");
|
|
34
35
|
}
|
|
35
|
-
const
|
|
36
|
+
const isControlled = Object.hasOwn(getCurrentInstance()?.vnode.props ?? {}, "open");
|
|
37
|
+
const internalOpen = ref(props.open ?? props.defaultOpen ?? false);
|
|
36
38
|
watch(() => props.open, (value) => {
|
|
37
|
-
if (
|
|
38
|
-
internalOpen.value = value;
|
|
39
|
+
if (isControlled)
|
|
40
|
+
internalOpen.value = value ?? false;
|
|
39
41
|
});
|
|
40
42
|
function onUpdateOpen(value) {
|
|
41
|
-
|
|
43
|
+
if (!isControlled)
|
|
44
|
+
internalOpen.value = value;
|
|
42
45
|
emit("update:open", value);
|
|
43
46
|
}
|
|
44
47
|
watch(internalOpen, (value) => {
|
|
@@ -60,6 +63,7 @@ if (import.meta.dev) {
|
|
|
60
63
|
}
|
|
61
64
|
const messages = useMessages();
|
|
62
65
|
const theme = useComponentTheme("alertDialog", alertDialogTheme);
|
|
66
|
+
const themeBindings = useThemeBindings();
|
|
63
67
|
const ui = computed(() => theme.value({ transition: props.transition }));
|
|
64
68
|
const overlayProps = computed(() => resolveSlot(ui.value.overlay, props.ui?.overlay));
|
|
65
69
|
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
@@ -76,8 +80,17 @@ const footerProps = computed(() => resolveSlot(ui.value.footer, props.ui?.footer
|
|
|
76
80
|
<slot />
|
|
77
81
|
</AlertDialogTrigger>
|
|
78
82
|
<AlertDialogPortal>
|
|
79
|
-
<AlertDialogOverlay
|
|
83
|
+
<AlertDialogOverlay
|
|
84
|
+
v-if="overlay"
|
|
85
|
+
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
86
|
+
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
87
|
+
:style="themeBindings.style"
|
|
88
|
+
v-bind="overlayProps"
|
|
89
|
+
/>
|
|
80
90
|
<AlertDialogContent
|
|
91
|
+
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
92
|
+
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
93
|
+
:style="themeBindings.style"
|
|
81
94
|
v-bind="contentProps"
|
|
82
95
|
@escape-key-down="onEscapeKeyDown"
|
|
83
96
|
@pointer-down-outside="onPointerDownOutside"
|
|
@@ -3,6 +3,8 @@ import type { UiProp } from '../utils/ui.js';
|
|
|
3
3
|
import type { ButtonProps } from './Button.vue.js';
|
|
4
4
|
export interface AlertDialogProps {
|
|
5
5
|
open?: boolean;
|
|
6
|
+
/** Initial visibility for an uncontrolled alert dialog. Supplying `open` makes the parent authoritative. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
6
8
|
title?: string;
|
|
7
9
|
description?: string;
|
|
8
10
|
/** Label for the default Cancel button - only rendered when no `footer` slot is given. @default 'Cancel' */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ConfigProvider, ToastProvider, TooltipProvider } from "reka-ui";
|
|
3
|
-
import {
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
import { useAppConfig, useHead } from "#imports";
|
|
4
5
|
import { useLocale } from "../composables/use-locale";
|
|
6
|
+
import { generateRuntimeTokenOverrideCss } from "../utils/color-registry";
|
|
5
7
|
import DrawerRenderer from "./DrawerRenderer.vue";
|
|
6
8
|
import ModalRenderer from "./ModalRenderer.vue";
|
|
7
9
|
import SlideoverRenderer from "./SlideoverRenderer.vue";
|
|
@@ -9,7 +11,12 @@ const props = defineProps({
|
|
|
9
11
|
dir: { type: String, required: false, default: "ltr" }
|
|
10
12
|
});
|
|
11
13
|
const locale = useLocale();
|
|
12
|
-
|
|
14
|
+
const appConfig = useAppConfig();
|
|
15
|
+
const runtimeTokenCss = computed(() => generateRuntimeTokenOverrideCss(appConfig.selaras?.tokens ?? {}));
|
|
16
|
+
useHead({
|
|
17
|
+
htmlAttrs: { dir: () => props.dir, lang: () => locale.value },
|
|
18
|
+
style: [{ key: "selaras-runtime-tokens", textContent: () => runtimeTokenCss.value || void 0 }]
|
|
19
|
+
});
|
|
13
20
|
</script>
|
|
14
21
|
|
|
15
22
|
<template>
|