@selvajs/ui 6.6.0-beta.9 → 7.0.1-beta.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 +0 -3
- package/dist/components/ErrorScreen.svelte +1 -1
- package/dist/components/compute/AppLayout.svelte +230 -85
- package/dist/components/compute/AppLayout.svelte.d.ts +14 -2
- package/dist/components/compute/CollapsedPanelStrip.svelte +4 -2
- package/dist/components/compute/ComputeApp.svelte +6 -2
- package/dist/components/compute/ComputeApp.svelte.d.ts +1 -1
- package/dist/components/compute/ComputeMessagesDialog.svelte +3 -3
- package/dist/components/compute/ParameterPresetManager.svelte +1 -1
- package/dist/components/compute/SolveMessages.svelte +79 -88
- package/dist/components/compute/SolveMessages.svelte.d.ts +5 -0
- package/dist/components/layout/AppShell.svelte +2 -2
- package/dist/components/layout/FooterItemRenderer.svelte +2 -2
- package/dist/components/layout/FooterItemRenderer.svelte.d.ts +1 -1
- package/dist/components/layout/PageContent.svelte +3 -2
- package/dist/components/layout/PageFooter.svelte +9 -6
- package/dist/components/layout/PageHeader.svelte +3 -3
- package/dist/components/layout/SideNav.svelte +3 -3
- package/dist/components/layout/SubNav.svelte +2 -2
- package/dist/components/preview/ChartOutput.svelte +141 -50
- package/dist/components/preview/Group.svelte +9 -9
- package/dist/components/preview/HelpButton.svelte +1 -1
- package/dist/components/preview/ImageOutput.svelte +13 -10
- package/dist/components/preview/InputControl.svelte +13 -12
- package/dist/components/preview/OutputDisplay.svelte +26 -17
- package/dist/components/preview/TabBar.svelte +8 -6
- package/dist/components/preview/TabBar.svelte.d.ts +2 -0
- package/dist/components/preview/TabContent.svelte +8 -8
- package/dist/components/preview/TabLayout.svelte +6 -7
- package/dist/components/preview/inputs/CheckboxInput.svelte +1 -1
- package/dist/components/preview/inputs/ChecklistInput.svelte +5 -5
- package/dist/components/preview/inputs/ColorInput.svelte +356 -14
- package/dist/components/preview/inputs/ColorInput.svelte.d.ts +1 -0
- package/dist/components/preview/inputs/DropdownInput.svelte +3 -3
- package/dist/components/preview/inputs/FileInput.svelte +17 -12
- package/dist/components/preview/inputs/GeometryInput.svelte +4 -4
- package/dist/components/preview/inputs/GeometryInput.svelte.d.ts +1 -1
- package/dist/components/preview/inputs/NumberInput.svelte +8 -8
- package/dist/components/preview/inputs/OptionGlyph.svelte +1 -1
- package/dist/components/preview/inputs/OptionGlyph.svelte.d.ts +1 -1
- package/dist/components/preview/inputs/SegmentedInput.svelte +3 -2
- package/dist/components/preview/inputs/TextInput.svelte +5 -5
- package/dist/components/preview/inputs/TileInput.svelte +8 -5
- package/dist/components/primitives/CalculateButton.svelte +10 -4
- package/dist/components/primitives/Callout.svelte +8 -6
- package/dist/components/primitives/Callout.svelte.d.ts +4 -4
- package/dist/components/primitives/DataTable.svelte +1 -1
- package/dist/components/primitives/FilterableDropdown.svelte +13 -1
- package/dist/components/primitives/FilterableDropdown.svelte.d.ts +5 -0
- package/dist/components/primitives/ImageUploadField.svelte +1 -1
- package/dist/components/primitives/SolvingIndicator.svelte +242 -41
- package/dist/components/primitives/SolvingIndicator.svelte.d.ts +13 -5
- package/dist/components/primitives/alert-dialog/alert-dialog-content.svelte +1 -1
- package/dist/components/primitives/badge/badge.svelte +2 -2
- package/dist/components/primitives/badge/badge.svelte.d.ts +6 -6
- package/dist/components/primitives/button/button.svelte +7 -8
- package/dist/components/primitives/button/button.svelte.d.ts +19 -19
- package/dist/components/primitives/card/card.svelte +1 -1
- package/dist/components/primitives/card/card.svelte.d.ts +1 -1
- package/dist/components/primitives/checkbox/checkbox.svelte +1 -1
- package/dist/components/primitives/command/command-input.svelte +1 -1
- package/dist/components/primitives/command/command-item.svelte +1 -1
- package/dist/components/primitives/command/command-link-item.svelte +1 -1
- package/dist/components/primitives/command/command.svelte +1 -1
- package/dist/components/primitives/context-menu/context-menu-checkbox-item.svelte +1 -1
- package/dist/components/primitives/context-menu/context-menu-content.svelte +1 -1
- package/dist/components/primitives/context-menu/context-menu-item.svelte +1 -1
- package/dist/components/primitives/context-menu/context-menu-radio-item.svelte +1 -1
- package/dist/components/primitives/context-menu/context-menu-sub-content.svelte +1 -1
- package/dist/components/primitives/context-menu/context-menu-sub-trigger.svelte +1 -1
- package/dist/components/primitives/dialog/dialog-content.svelte +3 -3
- package/dist/components/primitives/drawer/Drawer.svelte +1 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu-checkbox-item.svelte +31 -11
- package/dist/components/primitives/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +2 -0
- package/dist/components/primitives/dropdown-menu/dropdown-menu-content.svelte +5 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu-content.svelte.d.ts +2 -0
- package/dist/components/primitives/dropdown-menu/dropdown-menu-item.svelte +4 -2
- package/dist/components/primitives/dropdown-menu/dropdown-menu-item.svelte.d.ts +2 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu-shortcut.svelte +1 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -1
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/index.js +1 -1
- package/dist/components/primitives/input/input.svelte +2 -2
- package/dist/components/primitives/input-group/input-group-input.svelte.d.ts +1 -1
- package/dist/components/primitives/input-group/input-group.svelte +1 -1
- package/dist/components/primitives/mode-toggle/mode-toggle.svelte +2 -2
- package/dist/components/primitives/popover/popover-content.svelte +1 -1
- package/dist/components/primitives/resizable/resizable-handle.svelte +2 -2
- package/dist/components/primitives/search/search.svelte +1 -1
- package/dist/components/primitives/select/select-content.svelte +1 -1
- package/dist/components/primitives/select/select-item.svelte +1 -1
- package/dist/components/primitives/select/select-trigger.svelte +1 -1
- package/dist/components/primitives/slider/slider.svelte +1 -1
- package/dist/components/primitives/switch/switch.svelte +1 -1
- package/dist/components/primitives/tabs/tabs-list.svelte +2 -2
- package/dist/components/primitives/tabs/tabs-list.svelte.d.ts +6 -6
- package/dist/components/primitives/tabs/tabs-trigger.svelte +2 -2
- package/dist/components/primitives/tabs/tabs-trigger.svelte.d.ts +6 -6
- package/dist/components/primitives/textarea/textarea.svelte +1 -1
- package/dist/components/primitives/toggle/toggle.svelte +8 -2
- package/dist/components/primitives/toggle/toggle.svelte.d.ts +10 -4
- package/dist/components/primitives/toggle-group/toggle-group-item.svelte +1 -1
- package/dist/components/primitives/toggle-group/toggle-group.svelte +1 -1
- package/dist/components/primitives/tooltip/index.d.ts +6 -0
- package/dist/components/primitives/tooltip/index.js +8 -0
- package/dist/components/primitives/tooltip/tooltip-content.svelte +34 -0
- package/dist/components/primitives/tooltip/tooltip-content.svelte.d.ts +10 -0
- package/dist/components/primitives/tooltip/tooltip-portal.svelte +7 -0
- package/dist/components/primitives/tooltip/tooltip-portal.svelte.d.ts +4 -0
- package/dist/components/primitives/tooltip/tooltip-provider.svelte +7 -0
- package/dist/components/primitives/tooltip/tooltip-provider.svelte.d.ts +4 -0
- package/dist/components/primitives/tooltip/tooltip-trigger.svelte +7 -0
- package/dist/components/primitives/tooltip/tooltip-trigger.svelte.d.ts +4 -0
- package/dist/components/primitives/tooltip/tooltip.svelte +7 -0
- package/dist/components/primitives/tooltip/tooltip.svelte.d.ts +4 -0
- package/dist/components/viewer/MeshMetadataPanel.svelte +2 -2
- package/dist/components/viewer/SceneManager.svelte +32 -21
- package/dist/components/viewer/SceneManager.svelte.d.ts +3 -1
- package/dist/components/viewer/Viewer.svelte +128 -178
- package/dist/components/viewer/Viewer.svelte.d.ts +7 -2
- package/dist/components/viewer/ViewerDock.svelte +452 -0
- package/dist/components/viewer/ViewerDock.svelte.d.ts +42 -0
- package/dist/composables/useFooterItem.svelte.d.ts +1 -1
- package/dist/composables/useFooterItem.svelte.js +1 -1
- package/dist/compute/liveProgress.svelte.d.ts +16 -0
- package/dist/compute/liveProgress.svelte.js +90 -0
- package/dist/compute/solving.svelte.d.ts +7 -9
- package/dist/compute/solving.svelte.js +56 -48
- package/dist/constants.d.ts +6 -8
- package/dist/constants.js +8 -11
- package/dist/contexts/hostContext.svelte.d.ts +1 -1
- package/dist/features/chart/plotly-compat.d.ts +15 -0
- package/dist/features/chart/plotly-compat.js +124 -0
- package/dist/i18n/messages.d.ts +17 -0
- package/dist/i18n/messages.js +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/public.d.ts +1 -0
- package/dist/public.js +1 -0
- package/dist/schema/visibility-rules.d.ts +7 -1
- package/dist/schema/visibility-rules.js +17 -0
- package/dist/styles/base.css +100 -86
- package/dist/utils/color-space.d.ts +21 -0
- package/dist/utils/color-space.js +90 -0
- package/package.json +31 -23
- package/src/lib/components/ErrorScreen.svelte +1 -1
- package/src/lib/components/compute/AppLayout.svelte +231 -86
- package/src/lib/components/compute/CollapsedPanelStrip.svelte +4 -2
- package/src/lib/components/compute/ComputeApp.svelte +6 -2
- package/src/lib/components/compute/ComputeMessagesDialog.svelte +4 -4
- package/src/lib/components/compute/ParameterPresetManager.svelte +1 -1
- package/src/lib/components/compute/SolveMessages.svelte +81 -90
- package/src/lib/components/layout/AppShell.svelte +2 -2
- package/src/lib/components/layout/FooterItemRenderer.svelte +2 -2
- package/src/lib/components/layout/PageContent.svelte +3 -2
- package/src/lib/components/layout/PageFooter.svelte +9 -6
- package/src/lib/components/layout/PageHeader.svelte +3 -3
- package/src/lib/components/layout/SideNav.svelte +4 -4
- package/src/lib/components/layout/SubNav.svelte +2 -2
- package/src/lib/components/preview/ChartOutput.svelte +141 -50
- package/src/lib/components/preview/Group.svelte +9 -9
- package/src/lib/components/preview/HelpButton.svelte +1 -1
- package/src/lib/components/preview/ImageOutput.svelte +13 -10
- package/src/lib/components/preview/InputControl.svelte +13 -12
- package/src/lib/components/preview/OutputDisplay.svelte +26 -17
- package/src/lib/components/preview/TabBar.svelte +8 -6
- package/src/lib/components/preview/TabContent.svelte +8 -8
- package/src/lib/components/preview/TabLayout.svelte +6 -7
- package/src/lib/components/preview/inputs/CheckboxInput.svelte +1 -1
- package/src/lib/components/preview/inputs/ChecklistInput.svelte +5 -5
- package/src/lib/components/preview/inputs/ColorInput.svelte +356 -14
- package/src/lib/components/preview/inputs/DropdownInput.svelte +3 -3
- package/src/lib/components/preview/inputs/FileInput.svelte +17 -12
- package/src/lib/components/preview/inputs/GeometryInput.svelte +4 -4
- package/src/lib/components/preview/inputs/NumberInput.svelte +8 -8
- package/src/lib/components/preview/inputs/OptionGlyph.svelte +2 -2
- package/src/lib/components/preview/inputs/SegmentedInput.svelte +3 -2
- package/src/lib/components/preview/inputs/TextInput.svelte +5 -5
- package/src/lib/components/preview/inputs/TileInput.svelte +8 -5
- package/src/lib/components/primitives/CalculateButton.svelte +10 -4
- package/src/lib/components/primitives/Callout.svelte +9 -7
- package/src/lib/components/primitives/DataTable.svelte +1 -1
- package/src/lib/components/primitives/FilterableDropdown.svelte +14 -2
- package/src/lib/components/primitives/ImageUploadField.svelte +1 -1
- package/src/lib/components/primitives/IssueList.svelte +1 -1
- package/src/lib/components/primitives/SeverityIcon.svelte +1 -1
- package/src/lib/components/primitives/SolvingIndicator.svelte +242 -41
- package/src/lib/components/primitives/StateDisplay.svelte +1 -1
- package/src/lib/components/primitives/alert-dialog/alert-dialog-action.svelte +2 -2
- package/src/lib/components/primitives/alert-dialog/alert-dialog-cancel.svelte +2 -2
- package/src/lib/components/primitives/alert-dialog/alert-dialog-content.svelte +2 -2
- package/src/lib/components/primitives/alert-dialog/alert-dialog-description.svelte +1 -1
- package/src/lib/components/primitives/alert-dialog/alert-dialog-footer.svelte +1 -1
- package/src/lib/components/primitives/alert-dialog/alert-dialog-header.svelte +1 -1
- package/src/lib/components/primitives/alert-dialog/alert-dialog-overlay.svelte +1 -1
- package/src/lib/components/primitives/alert-dialog/alert-dialog-title.svelte +1 -1
- package/src/lib/components/primitives/badge/badge.svelte +3 -3
- package/src/lib/components/primitives/button/button.svelte +7 -8
- package/src/lib/components/primitives/button-group/button-group-separator.svelte +2 -2
- package/src/lib/components/primitives/button-group/button-group-text.svelte +1 -1
- package/src/lib/components/primitives/button-group/button-group.svelte +1 -1
- package/src/lib/components/primitives/card/card-content.svelte +1 -1
- package/src/lib/components/primitives/card/card-description.svelte +1 -1
- package/src/lib/components/primitives/card/card-footer.svelte +1 -1
- package/src/lib/components/primitives/card/card-header.svelte +1 -1
- package/src/lib/components/primitives/card/card-title.svelte +1 -1
- package/src/lib/components/primitives/card/card.svelte +2 -2
- package/src/lib/components/primitives/checkbox/checkbox.svelte +2 -2
- package/src/lib/components/primitives/command/command-dialog.svelte +2 -2
- package/src/lib/components/primitives/command/command-empty.svelte +1 -1
- package/src/lib/components/primitives/command/command-group.svelte +1 -1
- package/src/lib/components/primitives/command/command-input.svelte +3 -3
- package/src/lib/components/primitives/command/command-item.svelte +2 -2
- package/src/lib/components/primitives/command/command-link-item.svelte +2 -2
- package/src/lib/components/primitives/command/command-list.svelte +1 -1
- package/src/lib/components/primitives/command/command-separator.svelte +1 -1
- package/src/lib/components/primitives/command/command-shortcut.svelte +1 -1
- package/src/lib/components/primitives/command/command.svelte +2 -2
- package/src/lib/components/primitives/context-menu/context-menu-checkbox-item.svelte +2 -2
- package/src/lib/components/primitives/context-menu/context-menu-content.svelte +2 -2
- package/src/lib/components/primitives/context-menu/context-menu-group-heading.svelte +1 -1
- package/src/lib/components/primitives/context-menu/context-menu-item.svelte +2 -2
- package/src/lib/components/primitives/context-menu/context-menu-label.svelte +1 -1
- package/src/lib/components/primitives/context-menu/context-menu-radio-item.svelte +2 -2
- package/src/lib/components/primitives/context-menu/context-menu-separator.svelte +1 -1
- package/src/lib/components/primitives/context-menu/context-menu-shortcut.svelte +1 -1
- package/src/lib/components/primitives/context-menu/context-menu-sub-content.svelte +2 -2
- package/src/lib/components/primitives/context-menu/context-menu-sub-trigger.svelte +2 -2
- package/src/lib/components/primitives/dialog/dialog-content.svelte +4 -4
- package/src/lib/components/primitives/dialog/dialog-description.svelte +1 -1
- package/src/lib/components/primitives/dialog/dialog-footer.svelte +1 -1
- package/src/lib/components/primitives/dialog/dialog-header.svelte +1 -1
- package/src/lib/components/primitives/dialog/dialog-overlay.svelte +1 -1
- package/src/lib/components/primitives/dialog/dialog-title.svelte +1 -1
- package/src/lib/components/primitives/drawer/Drawer.svelte +1 -1
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-checkbox-item.svelte +32 -12
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-content.svelte +6 -2
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-group-heading.svelte +1 -1
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-item.svelte +5 -3
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-label.svelte +1 -1
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-radio-item.svelte +2 -2
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-separator.svelte +1 -1
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-shortcut.svelte +2 -2
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-sub-content.svelte +2 -2
- package/src/lib/components/primitives/dropdown-menu/dropdown-menu-sub-trigger.svelte +2 -2
- package/src/lib/components/primitives/empty/empty-content.svelte +1 -1
- package/src/lib/components/primitives/empty/empty-description.svelte +1 -1
- package/src/lib/components/primitives/empty/empty-header.svelte +1 -1
- package/src/lib/components/primitives/empty/empty-media.svelte +1 -1
- package/src/lib/components/primitives/empty/empty-title.svelte +1 -1
- package/src/lib/components/primitives/empty/empty.svelte +1 -1
- package/src/lib/components/primitives/field/field-content.svelte +1 -1
- package/src/lib/components/primitives/field/field-description.svelte +1 -1
- package/src/lib/components/primitives/field/field-error.svelte +1 -1
- package/src/lib/components/primitives/field/field-group.svelte +1 -1
- package/src/lib/components/primitives/field/field-label.svelte +2 -2
- package/src/lib/components/primitives/field/field-legend.svelte +1 -1
- package/src/lib/components/primitives/field/field-separator.svelte +2 -2
- package/src/lib/components/primitives/field/field-set.svelte +1 -1
- package/src/lib/components/primitives/field/field-title.svelte +1 -1
- package/src/lib/components/primitives/field/field.svelte +1 -1
- package/src/lib/components/primitives/index.ts +1 -1
- package/src/lib/components/primitives/input/input.svelte +3 -3
- package/src/lib/components/primitives/input-group/input-group-addon.svelte +1 -1
- package/src/lib/components/primitives/input-group/input-group-button.svelte +2 -2
- package/src/lib/components/primitives/input-group/input-group-input.svelte +2 -2
- package/src/lib/components/primitives/input-group/input-group-text.svelte +1 -1
- package/src/lib/components/primitives/input-group/input-group-textarea.svelte +2 -2
- package/src/lib/components/primitives/input-group/input-group.svelte +2 -2
- package/src/lib/components/primitives/label/label.svelte +1 -1
- package/src/lib/components/primitives/mode-toggle/mode-toggle.svelte +2 -2
- package/src/lib/components/primitives/popover/popover-content.svelte +2 -2
- package/src/lib/components/primitives/popover/popover-description.svelte +1 -1
- package/src/lib/components/primitives/popover/popover-header.svelte +1 -1
- package/src/lib/components/primitives/popover/popover-title.svelte +1 -1
- package/src/lib/components/primitives/popover/popover-trigger.svelte +1 -1
- package/src/lib/components/primitives/resizable/resizable-handle.svelte +3 -3
- package/src/lib/components/primitives/resizable/resizable-pane-group.svelte +1 -1
- package/src/lib/components/primitives/scroll-area/scroll-area-scrollbar.svelte +1 -1
- package/src/lib/components/primitives/scroll-area/scroll-area.svelte +1 -1
- package/src/lib/components/primitives/search/search.svelte +2 -2
- package/src/lib/components/primitives/select/select-content.svelte +2 -2
- package/src/lib/components/primitives/select/select-group-heading.svelte +1 -1
- package/src/lib/components/primitives/select/select-item.svelte +2 -2
- package/src/lib/components/primitives/select/select-label.svelte +1 -1
- package/src/lib/components/primitives/select/select-scroll-down-button.svelte +1 -1
- package/src/lib/components/primitives/select/select-scroll-up-button.svelte +1 -1
- package/src/lib/components/primitives/select/select-separator.svelte +2 -2
- package/src/lib/components/primitives/select/select-trigger.svelte +2 -2
- package/src/lib/components/primitives/separator/separator.svelte +1 -1
- package/src/lib/components/primitives/slider/slider.svelte +2 -2
- package/src/lib/components/primitives/spinner/spinner.svelte +1 -1
- package/src/lib/components/primitives/switch/switch.svelte +2 -2
- package/src/lib/components/primitives/tabs/tabs-content.svelte +1 -1
- package/src/lib/components/primitives/tabs/tabs-list.svelte +3 -3
- package/src/lib/components/primitives/tabs/tabs-trigger.svelte +3 -3
- package/src/lib/components/primitives/tabs/tabs.svelte +1 -1
- package/src/lib/components/primitives/textarea/textarea.svelte +2 -2
- package/src/lib/components/primitives/toggle/toggle.svelte +9 -3
- package/src/lib/components/primitives/toggle-group/toggle-group-item.svelte +3 -3
- package/src/lib/components/primitives/toggle-group/toggle-group.svelte +3 -3
- package/src/lib/components/primitives/tooltip/index.ts +19 -0
- package/src/lib/components/primitives/tooltip/tooltip-content.svelte +34 -0
- package/src/lib/components/primitives/tooltip/tooltip-portal.svelte +7 -0
- package/src/lib/components/primitives/tooltip/tooltip-provider.svelte +7 -0
- package/src/lib/components/primitives/tooltip/tooltip-trigger.svelte +7 -0
- package/src/lib/components/primitives/tooltip/tooltip.svelte +7 -0
- package/src/lib/components/viewer/MeshMetadataPanel.svelte +2 -2
- package/src/lib/components/viewer/SceneManager.svelte +32 -21
- package/src/lib/components/viewer/Viewer.svelte +129 -179
- package/src/lib/components/viewer/ViewerDock.svelte +452 -0
- package/src/lib/composables/useFooterItem.svelte.ts +1 -1
- package/src/lib/compute/liveProgress.svelte.ts +103 -0
- package/src/lib/compute/solving.svelte.ts +56 -55
- package/src/lib/constants.ts +8 -11
- package/src/lib/contexts/hostContext.svelte.ts +1 -1
- package/src/lib/features/chart/plotly-compat.ts +141 -0
- package/src/lib/i18n/messages.ts +43 -0
- package/src/lib/index.ts +2 -0
- package/src/lib/public.ts +1 -0
- package/src/lib/schema/visibility-rules.ts +27 -1
- package/src/lib/styles/base.css +100 -86
- package/src/lib/utils/color-space.ts +107 -0
- package/dist/components/primitives/theme-switcher/ThemeSwitcher.svelte +0 -39
- package/dist/components/primitives/theme-switcher/ThemeSwitcher.svelte.d.ts +0 -3
- package/dist/components/primitives/theme-switcher/index.d.ts +0 -1
- package/dist/components/primitives/theme-switcher/index.js +0 -1
- package/dist/styles/themes/cyberpunk.css +0 -98
- package/dist/styles/themes/neutral.css +0 -72
- package/dist/styles/themes/ocean.css +0 -75
- package/dist/styles/themes/selva.css +0 -105
- package/dist/theme/themeStore.svelte.d.ts +0 -12
- package/dist/theme/themeStore.svelte.js +0 -40
- package/dist/theme/themes.d.ts +0 -5
- package/dist/theme/themes.js +0 -13
- package/src/lib/components/primitives/theme-switcher/ThemeSwitcher.svelte +0 -39
- package/src/lib/components/primitives/theme-switcher/index.ts +0 -1
- package/src/lib/styles/themes/cyberpunk.css +0 -98
- package/src/lib/styles/themes/neutral.css +0 -72
- package/src/lib/styles/themes/ocean.css +0 -75
- package/src/lib/styles/themes/selva.css +0 -105
- package/src/lib/theme/themeStore.svelte.ts +0 -50
- package/src/lib/theme/themes.ts +0 -18
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { TabConfig } from '@selvajs/schemas';
|
|
3
|
-
import * as Tabs from '
|
|
3
|
+
import * as Tabs from '#lib/components/primitives/tabs/index.js';
|
|
4
4
|
import { ChevronLeft, ChevronRight } from '@lucide/svelte';
|
|
5
5
|
import Icon from '@iconify/svelte';
|
|
6
|
-
import { getLocaleContext } from '
|
|
6
|
+
import { getLocaleContext } from '#lib/i18n/localeContext.svelte.js';
|
|
7
7
|
|
|
8
8
|
const locale = getLocaleContext();
|
|
9
9
|
const t = $derived(locale.messages);
|
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
tabs: TabConfig[];
|
|
13
13
|
activeTabId: string;
|
|
14
14
|
onTabChange: (tabId: string) => void;
|
|
15
|
+
/** Matches TabContent's tighter gutter in the stacked phone layout. */
|
|
16
|
+
bare?: boolean;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
let { tabs, activeTabId, onTabChange }: Props = $props();
|
|
19
|
+
let { tabs, activeTabId, onTabChange, bare = false }: Props = $props();
|
|
18
20
|
|
|
19
21
|
const SCROLL_BUTTON_WIDTH = 32;
|
|
20
22
|
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
}
|
|
65
67
|
</script>
|
|
66
68
|
|
|
67
|
-
<div class="tab-bar relative shrink-0 border-b border-border">
|
|
69
|
+
<div class="tab-bar relative shrink-0 border-b border-border {bare ? 'mx-1' : 'mx-3'}">
|
|
68
70
|
<Tabs.List bind:ref={listRef} variant="line" onscroll={updateOverflow} onwheel={handleWheel}>
|
|
69
71
|
{#each tabs as tab (tab.id)}
|
|
70
72
|
<Tabs.Trigger value={tab.id} onclick={() => onTabChange(tab.id)} variant="line">
|
|
@@ -127,11 +129,11 @@
|
|
|
127
129
|
.scroll-button.back {
|
|
128
130
|
left: 0;
|
|
129
131
|
padding: 0 1.25rem 0 0.375rem;
|
|
130
|
-
background: linear-gradient(to right, var(--
|
|
132
|
+
background: linear-gradient(to right, var(--tab-bar-bg, var(--background)) 55%, transparent);
|
|
131
133
|
}
|
|
132
134
|
.scroll-button.forward {
|
|
133
135
|
right: 0;
|
|
134
136
|
padding: 0 0.375rem 0 1.25rem;
|
|
135
|
-
background: linear-gradient(to left, var(--
|
|
137
|
+
background: linear-gradient(to left, var(--tab-bar-bg, var(--background)) 55%, transparent);
|
|
136
138
|
}
|
|
137
139
|
</style>
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
InputLayoutItem,
|
|
9
9
|
OutputLayoutItem
|
|
10
10
|
} from '@selvajs/schemas';
|
|
11
|
-
import * as Tabs from '
|
|
12
|
-
import { ScrollArea } from '
|
|
11
|
+
import * as Tabs from '#lib/components/primitives/tabs/index.js';
|
|
12
|
+
import { ScrollArea } from '#lib/components/primitives/scroll-area/index.js';
|
|
13
13
|
import StateDisplay from '../primitives/StateDisplay.svelte';
|
|
14
14
|
import Group from './Group.svelte';
|
|
15
15
|
import InputControl from './InputControl.svelte';
|
|
16
16
|
import OutputDisplay from './OutputDisplay.svelte';
|
|
17
|
-
import { evaluateGroupVisibility } from '
|
|
18
|
-
import { isSupportedOn, layoutItemKind } from '
|
|
19
|
-
import { getHostContext } from '
|
|
20
|
-
import { getLocaleContext } from '
|
|
17
|
+
import { evaluateGroupVisibility } from '#lib/schema/visibility-rules.js';
|
|
18
|
+
import { isSupportedOn, layoutItemKind } from '#lib/schema/host-support.js';
|
|
19
|
+
import { getHostContext } from '#lib/contexts/hostContext.svelte.js';
|
|
20
|
+
import { getLocaleContext } from '#lib/i18n/localeContext.svelte.js';
|
|
21
21
|
|
|
22
22
|
const locale = getLocaleContext();
|
|
23
23
|
const t = $derived(locale.messages);
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
{#if visibleGroups.length === 0}
|
|
114
114
|
<StateDisplay type="empty" size="medium" message={t.tabNoGroups} />
|
|
115
115
|
{:else}
|
|
116
|
-
<div class="gap-
|
|
116
|
+
<div class="gap-4 py-4 flex flex-col">
|
|
117
117
|
{#each visibleGroups as group (group.id)}
|
|
118
118
|
<Group
|
|
119
119
|
label={group.label}
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
{#if bare}
|
|
138
138
|
{@render body()}
|
|
139
139
|
{:else}
|
|
140
|
-
<div class="h-full
|
|
140
|
+
<div class="h-full">
|
|
141
141
|
<!-- `auto`, not the default `hover`: a hover-only bar comes and goes with the pointer,
|
|
142
142
|
and a host that freezes mid-solve drops the pointer state with it. -->
|
|
143
143
|
<ScrollArea class="h-full" orientation="vertical" type="auto">
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { UISchema, SupportedTypes } from '@selvajs/schemas';
|
|
3
|
-
import * as
|
|
4
|
-
import * as Tabs from '$lib/components/primitives/tabs';
|
|
3
|
+
import * as Tabs from '#lib/components/primitives/tabs/index.js';
|
|
5
4
|
import TabBar from './TabBar.svelte';
|
|
6
5
|
import TabContent from './TabContent.svelte';
|
|
7
|
-
import { isTabVisible } from '
|
|
8
|
-
import { buildDynamicValueListOptions } from '
|
|
6
|
+
import { isTabVisible } from '#lib/schema/visibility-rules.js';
|
|
7
|
+
import { buildDynamicValueListOptions } from '#lib/schema/dynamic-value-list.js';
|
|
9
8
|
|
|
10
9
|
interface Props {
|
|
11
10
|
schema: UISchema;
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
{#snippet tabs()}
|
|
82
81
|
<Tabs.Root value={activeTabId} variant="line" class="min-h-0 flex-1">
|
|
83
82
|
{#if showTabBar}
|
|
84
|
-
<TabBar tabs={visibleTabs} {activeTabId} onTabChange={handleTabChange} />
|
|
83
|
+
<TabBar tabs={visibleTabs} {activeTabId} onTabChange={handleTabChange} {bare} />
|
|
85
84
|
{/if}
|
|
86
85
|
|
|
87
86
|
{#each visibleTabs as tab (tab.id)}
|
|
@@ -104,7 +103,7 @@
|
|
|
104
103
|
{#if bare}
|
|
105
104
|
{@render tabs()}
|
|
106
105
|
{:else}
|
|
107
|
-
<
|
|
106
|
+
<div class="min-h-0 flex flex-1 flex-col">
|
|
108
107
|
{@render tabs()}
|
|
109
|
-
</
|
|
108
|
+
</div>
|
|
110
109
|
{/if}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { SupportedTypes } from '@selvajs/schemas';
|
|
4
|
-
import { Checkbox } from '
|
|
4
|
+
import { Checkbox } from '#lib/components/primitives/checkbox/index.js';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
inputId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { DropdownWidgetConfig, SupportedTypes, UISchema } from '@selvajs/schemas';
|
|
3
|
-
import { Checkbox } from '
|
|
4
|
-
import { optionGlyph } from '
|
|
3
|
+
import { Checkbox } from '#lib/components/primitives/checkbox/index.js';
|
|
4
|
+
import { optionGlyph } from '#lib/schema/option-display.js';
|
|
5
5
|
import OptionGlyph from './OptionGlyph.svelte';
|
|
6
6
|
import { SvelteSet } from 'svelte/reactivity';
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
<div class="divide-y divide-border
|
|
33
|
+
<div class="divide-y divide-border overflow-hidden rounded-md border border-input">
|
|
34
34
|
{#each Object.entries(options) as [name, expr] (name)}
|
|
35
35
|
{@const optionValue = expr ?? name}
|
|
36
36
|
{@const optionId = `${inputId}-${optionValue}`}
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
{@const glyph = optionGlyph(config?.optionMedia?.[name], assets)}
|
|
39
39
|
<label
|
|
40
40
|
for={optionId}
|
|
41
|
-
class="gap-3 px-3 py-2 text-sm flex items-center transition-colors select-none hover:bg-
|
|
42
|
-
? 'bg-
|
|
41
|
+
class="gap-3 px-3 py-2 text-sm flex items-center transition-colors select-none hover:bg-hover {isSelected
|
|
42
|
+
? 'bg-selected'
|
|
43
43
|
: ''} {disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'}"
|
|
44
44
|
>
|
|
45
45
|
<Checkbox
|
|
@@ -1,23 +1,365 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
3
|
+
import { Check, Pipette } from '@lucide/svelte';
|
|
4
|
+
import * as Popover from '#lib/components/primitives/popover/index.js';
|
|
5
|
+
import { Input } from '#lib/components/primitives/input/index.js';
|
|
6
|
+
import { getLocaleContext } from '#lib/i18n/localeContext.svelte.js';
|
|
7
|
+
import { formatMessage } from '#lib/i18n/messages.js';
|
|
8
|
+
import { debounce } from '#lib/utils/debounce.js';
|
|
9
|
+
import {
|
|
10
|
+
contrastRatio,
|
|
11
|
+
hexToHsv,
|
|
12
|
+
hsvToHex,
|
|
13
|
+
normalizeHex,
|
|
14
|
+
type Hsv
|
|
15
|
+
} from '#lib/utils/color-space.js';
|
|
16
|
+
|
|
2
17
|
interface Props {
|
|
3
18
|
inputId: string;
|
|
4
19
|
value?: string;
|
|
5
20
|
onChange: (value: string) => void;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let { inputId, value = '#000000', onChange, disabled = false }: Props = $props();
|
|
25
|
+
|
|
26
|
+
const PRESETS = [
|
|
27
|
+
'#000000',
|
|
28
|
+
'#ffffff',
|
|
29
|
+
'#9ca3af',
|
|
30
|
+
'#ef4444',
|
|
31
|
+
'#f97316',
|
|
32
|
+
'#eab308',
|
|
33
|
+
'#22c55e',
|
|
34
|
+
'#14b8a6',
|
|
35
|
+
'#3b82f6',
|
|
36
|
+
'#8b5cf6',
|
|
37
|
+
'#ec4899',
|
|
38
|
+
'#78350f'
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
interface EyeDropperApi {
|
|
42
|
+
open(): Promise<{ sRGBHex: string }>;
|
|
43
|
+
}
|
|
44
|
+
const eyeDropperCtor = (globalThis as { EyeDropper?: new () => EyeDropperApi }).EyeDropper;
|
|
45
|
+
|
|
46
|
+
const locale = getLocaleContext();
|
|
47
|
+
const t = $derived(locale.messages);
|
|
48
|
+
|
|
49
|
+
const parse = (hex: string): Hsv => hexToHsv(normalizeHex(hex) ?? '#000000')!;
|
|
50
|
+
|
|
51
|
+
let hsv = $state<Hsv>(untrack(() => parse(value)));
|
|
52
|
+
let draft = $state('');
|
|
53
|
+
let hexError = $state(false);
|
|
54
|
+
let areaEl = $state<HTMLElement | null>(null);
|
|
55
|
+
|
|
56
|
+
const currentHex = $derived(hsvToHex(hsv));
|
|
57
|
+
const hueColor = $derived(hsvToHex({ h: hsv.h, s: 1, v: 1 }));
|
|
58
|
+
|
|
59
|
+
// An external value only replaces the picker's state when it names a different color.
|
|
60
|
+
// Rebuilding from the hex alone would reset the hue whenever s or v hits 0.
|
|
61
|
+
$effect(() => {
|
|
62
|
+
const next = normalizeHex(value) ?? '#000000';
|
|
63
|
+
if (next !== untrack(() => currentHex)) hsv = parse(next);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
$effect(() => {
|
|
67
|
+
draft = currentHex;
|
|
68
|
+
hexError = false;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Dragging only updates local state; the host sees one change per gesture, since each
|
|
72
|
+
// change can trigger a solve.
|
|
73
|
+
function commit() {
|
|
74
|
+
commitDebounced.cancel();
|
|
75
|
+
if (currentHex !== normalizeHex(value)) onChange(currentHex);
|
|
76
|
+
}
|
|
77
|
+
const commitDebounced = debounce(commit, 150);
|
|
78
|
+
|
|
79
|
+
const clamp01 = (n: number) => Math.min(1, Math.max(0, n));
|
|
80
|
+
|
|
81
|
+
function setFromPointer(e: PointerEvent) {
|
|
82
|
+
if (!areaEl) return;
|
|
83
|
+
const rect = areaEl.getBoundingClientRect();
|
|
84
|
+
hsv = {
|
|
85
|
+
h: hsv.h,
|
|
86
|
+
s: clamp01((e.clientX - rect.left) / rect.width),
|
|
87
|
+
v: clamp01(1 - (e.clientY - rect.top) / rect.height)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function onAreaPointerDown(e: PointerEvent) {
|
|
92
|
+
if (disabled || e.button !== 0) return;
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
areaEl?.focus();
|
|
95
|
+
areaEl?.setPointerCapture(e.pointerId);
|
|
96
|
+
setFromPointer(e);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function onAreaPointerMove(e: PointerEvent) {
|
|
100
|
+
if (areaEl?.hasPointerCapture(e.pointerId)) setFromPointer(e);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function onAreaPointerUp(e: PointerEvent) {
|
|
104
|
+
if (!areaEl?.hasPointerCapture(e.pointerId)) return;
|
|
105
|
+
areaEl.releasePointerCapture(e.pointerId);
|
|
106
|
+
commit();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function onAreaKeydown(e: KeyboardEvent) {
|
|
110
|
+
const step = e.shiftKey ? 0.1 : 0.01;
|
|
111
|
+
let { s, v } = hsv;
|
|
112
|
+
switch (e.key) {
|
|
113
|
+
case 'ArrowLeft':
|
|
114
|
+
s -= step;
|
|
115
|
+
break;
|
|
116
|
+
case 'ArrowRight':
|
|
117
|
+
s += step;
|
|
118
|
+
break;
|
|
119
|
+
case 'ArrowUp':
|
|
120
|
+
v += step;
|
|
121
|
+
break;
|
|
122
|
+
case 'ArrowDown':
|
|
123
|
+
v -= step;
|
|
124
|
+
break;
|
|
125
|
+
case 'PageUp':
|
|
126
|
+
v += 0.1;
|
|
127
|
+
break;
|
|
128
|
+
case 'PageDown':
|
|
129
|
+
v -= 0.1;
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
hsv = { h: hsv.h, s: clamp01(s), v: clamp01(v) };
|
|
136
|
+
commitDebounced();
|
|
6
137
|
}
|
|
7
138
|
|
|
8
|
-
|
|
139
|
+
function onHueInput(e: Event) {
|
|
140
|
+
hsv = { ...hsv, h: Number((e.currentTarget as HTMLInputElement).value) };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function applyHex(hex: string) {
|
|
144
|
+
hsv = parse(hex);
|
|
145
|
+
commit();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function commitDraft() {
|
|
149
|
+
const hex = normalizeHex(draft);
|
|
150
|
+
if (!hex) {
|
|
151
|
+
hexError = true;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
hexError = false;
|
|
155
|
+
applyHex(hex);
|
|
156
|
+
draft = hex;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function onHexKeydown(e: KeyboardEvent) {
|
|
160
|
+
if (e.key === 'Enter') {
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
commitDraft();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function onHexBlur() {
|
|
167
|
+
if (normalizeHex(draft)) commitDraft();
|
|
168
|
+
else {
|
|
169
|
+
draft = currentHex;
|
|
170
|
+
hexError = false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async function pickFromScreen() {
|
|
175
|
+
if (!eyeDropperCtor) return;
|
|
176
|
+
try {
|
|
177
|
+
const { sRGBHex } = await new eyeDropperCtor().open();
|
|
178
|
+
applyHex(sRGBHex);
|
|
179
|
+
} catch {
|
|
180
|
+
// The user dismissed the eyedropper.
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const checkOn = (hex: string) =>
|
|
185
|
+
(contrastRatio(hex, '#000000') ?? 0) > (contrastRatio(hex, '#ffffff') ?? 0)
|
|
186
|
+
? 'text-black'
|
|
187
|
+
: 'text-white';
|
|
9
188
|
</script>
|
|
10
189
|
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
190
|
+
<Popover.Root>
|
|
191
|
+
<Popover.Trigger>
|
|
192
|
+
{#snippet child({ props })}
|
|
193
|
+
<button
|
|
194
|
+
{...props}
|
|
195
|
+
type="button"
|
|
196
|
+
id={inputId}
|
|
197
|
+
{disabled}
|
|
198
|
+
aria-label={formatMessage(t.colorPick, { color: currentHex })}
|
|
199
|
+
class="h-9 gap-2.5 px-2.5 shadow-xs max-w-48 flex w-full cursor-pointer items-center rounded-md border border-input bg-background text-left outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"
|
|
200
|
+
>
|
|
201
|
+
<span
|
|
202
|
+
class="size-5 shrink-0 rounded-md bg-(--swatch) ring-1 ring-border ring-inset"
|
|
203
|
+
style:--swatch={currentHex}
|
|
204
|
+
></span>
|
|
205
|
+
<span class="font-mono text-sm text-muted-foreground">{currentHex}</span>
|
|
206
|
+
</button>
|
|
207
|
+
{/snippet}
|
|
208
|
+
</Popover.Trigger>
|
|
209
|
+
|
|
210
|
+
<Popover.Content align="start">
|
|
211
|
+
<div
|
|
212
|
+
bind:this={areaEl}
|
|
213
|
+
role="slider"
|
|
214
|
+
tabindex={disabled ? -1 : 0}
|
|
215
|
+
aria-label={t.colorArea}
|
|
216
|
+
aria-valuemin={0}
|
|
217
|
+
aria-valuemax={100}
|
|
218
|
+
aria-valuenow={Math.round(hsv.v * 100)}
|
|
219
|
+
aria-valuetext={formatMessage(t.colorAreaValue, {
|
|
220
|
+
s: Math.round(hsv.s * 100),
|
|
221
|
+
v: Math.round(hsv.v * 100)
|
|
222
|
+
})}
|
|
223
|
+
aria-disabled={disabled}
|
|
224
|
+
class="color-area h-36 relative w-full cursor-crosshair touch-none rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring"
|
|
225
|
+
style:--hue={hueColor}
|
|
226
|
+
onpointerdown={onAreaPointerDown}
|
|
227
|
+
onpointermove={onAreaPointerMove}
|
|
228
|
+
onpointerup={onAreaPointerUp}
|
|
229
|
+
onpointercancel={onAreaPointerUp}
|
|
230
|
+
onkeydown={onAreaKeydown}
|
|
231
|
+
>
|
|
232
|
+
<span
|
|
233
|
+
class="color-thumb size-4 border-white pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 rounded-full border-2 bg-(--swatch)"
|
|
234
|
+
style:--x="{hsv.s * 100}%"
|
|
235
|
+
style:--y="{(1 - hsv.v) * 100}%"
|
|
236
|
+
style:--swatch={currentHex}
|
|
237
|
+
></span>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<input
|
|
241
|
+
type="range"
|
|
242
|
+
class="color-hue"
|
|
243
|
+
min="0"
|
|
244
|
+
max="360"
|
|
245
|
+
step="1"
|
|
246
|
+
aria-label={t.colorHue}
|
|
247
|
+
value={Math.round(hsv.h)}
|
|
248
|
+
{disabled}
|
|
249
|
+
oninput={onHueInput}
|
|
250
|
+
onchange={commit}
|
|
251
|
+
/>
|
|
252
|
+
|
|
253
|
+
<div class="gap-2 flex items-start">
|
|
254
|
+
<div class="min-w-0 flex-1">
|
|
255
|
+
<Input
|
|
256
|
+
type="text"
|
|
257
|
+
aria-label={t.colorHex}
|
|
258
|
+
aria-invalid={hexError}
|
|
259
|
+
aria-describedby={hexError ? `${inputId}-hex-error` : undefined}
|
|
260
|
+
autocomplete="off"
|
|
261
|
+
spellcheck={false}
|
|
262
|
+
maxlength={7}
|
|
263
|
+
{disabled}
|
|
264
|
+
bind:value={draft}
|
|
265
|
+
onkeydown={onHexKeydown}
|
|
266
|
+
onblur={onHexBlur}
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
{#if eyeDropperCtor}
|
|
270
|
+
<button
|
|
271
|
+
type="button"
|
|
272
|
+
{disabled}
|
|
273
|
+
aria-label={t.colorEyedropper}
|
|
274
|
+
title={t.colorEyedropper}
|
|
275
|
+
class="size-9 flex shrink-0 cursor-pointer items-center justify-center rounded-md border border-input bg-background outline-none hover:bg-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"
|
|
276
|
+
onclick={pickFromScreen}
|
|
277
|
+
>
|
|
278
|
+
<Pipette class="size-4" aria-hidden="true" />
|
|
279
|
+
</button>
|
|
280
|
+
{/if}
|
|
281
|
+
</div>
|
|
282
|
+
{#if hexError}
|
|
283
|
+
<p id="{inputId}-hex-error" role="alert" class="text-xs text-destructive">
|
|
284
|
+
{t.colorHexInvalid}
|
|
285
|
+
</p>
|
|
286
|
+
{/if}
|
|
287
|
+
|
|
288
|
+
<div role="group" aria-label={t.colorPresets} class="gap-1.5 grid grid-cols-6">
|
|
289
|
+
{#each PRESETS as preset (preset)}
|
|
290
|
+
{@const selected = preset === currentHex}
|
|
291
|
+
<button
|
|
292
|
+
type="button"
|
|
293
|
+
{disabled}
|
|
294
|
+
aria-label={preset}
|
|
295
|
+
aria-pressed={selected}
|
|
296
|
+
class="h-6 flex cursor-pointer items-center justify-center rounded-md bg-(--swatch) ring-1 ring-border outline-none ring-inset focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed"
|
|
297
|
+
style:--swatch={preset}
|
|
298
|
+
onclick={() => applyHex(preset)}
|
|
299
|
+
>
|
|
300
|
+
{#if selected}
|
|
301
|
+
<Check class="size-3.5 {checkOn(preset)}" aria-hidden="true" />
|
|
302
|
+
{/if}
|
|
303
|
+
</button>
|
|
304
|
+
{/each}
|
|
305
|
+
</div>
|
|
306
|
+
</Popover.Content>
|
|
307
|
+
</Popover.Root>
|
|
308
|
+
|
|
309
|
+
<style>
|
|
310
|
+
.color-area {
|
|
311
|
+
background-color: var(--hue);
|
|
312
|
+
background-image:
|
|
313
|
+
linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
|
|
314
|
+
}
|
|
315
|
+
.color-thumb {
|
|
316
|
+
left: var(--x);
|
|
317
|
+
top: var(--y);
|
|
318
|
+
box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4);
|
|
319
|
+
}
|
|
320
|
+
.color-hue {
|
|
321
|
+
appearance: none;
|
|
322
|
+
-webkit-appearance: none;
|
|
323
|
+
height: 0.75rem;
|
|
324
|
+
width: 100%;
|
|
325
|
+
margin: 0;
|
|
326
|
+
border-radius: 9999px;
|
|
327
|
+
cursor: pointer;
|
|
328
|
+
outline: none;
|
|
329
|
+
background: linear-gradient(
|
|
330
|
+
to right,
|
|
331
|
+
#f00 0%,
|
|
332
|
+
#ff0 16.67%,
|
|
333
|
+
#0f0 33.33%,
|
|
334
|
+
#0ff 50%,
|
|
335
|
+
#00f 66.67%,
|
|
336
|
+
#f0f 83.33%,
|
|
337
|
+
#f00 100%
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
.color-hue::-webkit-slider-thumb {
|
|
341
|
+
-webkit-appearance: none;
|
|
342
|
+
height: 1rem;
|
|
343
|
+
width: 1rem;
|
|
344
|
+
border-radius: 9999px;
|
|
345
|
+
border: 2px solid #fff;
|
|
346
|
+
background: transparent;
|
|
347
|
+
box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4);
|
|
348
|
+
}
|
|
349
|
+
.color-hue::-moz-range-thumb {
|
|
350
|
+
height: 1rem;
|
|
351
|
+
width: 1rem;
|
|
352
|
+
box-sizing: border-box;
|
|
353
|
+
border-radius: 9999px;
|
|
354
|
+
border: 2px solid #fff;
|
|
355
|
+
background: transparent;
|
|
356
|
+
box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4);
|
|
357
|
+
}
|
|
358
|
+
.color-hue:focus-visible {
|
|
359
|
+
box-shadow: 0 0 0 3px var(--ring);
|
|
360
|
+
}
|
|
361
|
+
.color-hue:disabled {
|
|
362
|
+
cursor: not-allowed;
|
|
363
|
+
opacity: 0.5;
|
|
364
|
+
}
|
|
365
|
+
</style>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { DropdownWidgetConfig, SupportedTypes, UISchema } from '@selvajs/schemas';
|
|
3
|
-
import * as Select from '
|
|
4
|
-
import { optionGlyph } from '
|
|
3
|
+
import * as Select from '#lib/components/primitives/select/index.js';
|
|
4
|
+
import { optionGlyph } from '#lib/schema/option-display.js';
|
|
5
5
|
import OptionGlyph from './OptionGlyph.svelte';
|
|
6
|
-
import { getLocaleContext } from '
|
|
6
|
+
import { getLocaleContext } from '#lib/i18n/localeContext.svelte.js';
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
9
|
value?: string;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Input } from '
|
|
3
|
-
import { Button } from '
|
|
4
|
-
import { Label } from '
|
|
5
|
-
import { toast } from '
|
|
2
|
+
import { Input } from '#lib/components/primitives/input/index.js';
|
|
3
|
+
import { Button } from '#lib/components/primitives/button/index.js';
|
|
4
|
+
import { Label } from '#lib/components/primitives/label/index.js';
|
|
5
|
+
import { toast } from '#lib/components/primitives/sonner/index.js';
|
|
6
6
|
import { FileUp, Link, CircleAlert, CircleCheck } from '@lucide/svelte';
|
|
7
|
-
import { APP_DEFAULTS } from '
|
|
8
|
-
import { getLocaleContext } from '
|
|
9
|
-
import { formatMessage } from '
|
|
10
|
-
import { pickFile } from '
|
|
11
|
-
import {
|
|
7
|
+
import { APP_DEFAULTS } from '#lib/constants.js';
|
|
8
|
+
import { getLocaleContext } from '#lib/i18n/localeContext.svelte.js';
|
|
9
|
+
import { formatMessage } from '#lib/i18n/messages.js';
|
|
10
|
+
import { pickFile } from '#lib/utils/host-files.js';
|
|
11
|
+
import {
|
|
12
|
+
acceptsFileEnding,
|
|
13
|
+
isWebp,
|
|
14
|
+
shouldConvertWebp,
|
|
15
|
+
webpToPng
|
|
16
|
+
} from '#lib/utils/webp-to-png.js';
|
|
12
17
|
|
|
13
18
|
interface Props {
|
|
14
19
|
value?: string;
|
|
@@ -282,10 +287,10 @@
|
|
|
282
287
|
type="button"
|
|
283
288
|
onclick={() => (activeMode = mode)}
|
|
284
289
|
aria-pressed={activeMode === mode}
|
|
285
|
-
class={`px-3 py-1 font-medium flex-1 rounded-sm transition-colors ${
|
|
290
|
+
class={`px-3 py-1 font-medium flex-1 rounded-sm border transition-colors ${
|
|
286
291
|
activeMode === mode
|
|
287
|
-
? 'shadow-xs bg-
|
|
288
|
-
: 'text-muted-foreground hover:text-foreground'
|
|
292
|
+
? 'shadow-xs border-border-strong bg-raised text-foreground'
|
|
293
|
+
: 'border-transparent text-muted-foreground hover:text-foreground'
|
|
289
294
|
}`}
|
|
290
295
|
>
|
|
291
296
|
{mode === 'upload' ? t.fileModeUpload : t.fileModeUrl}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import type { GeometryPickResult, PickKind } from '
|
|
4
|
-
import { getLocaleContext } from '
|
|
5
|
-
import type { ViewerMessages } from '
|
|
2
|
+
import { Button } from '#lib/components/primitives/button/index.js';
|
|
3
|
+
import type { GeometryPickResult, PickKind } from '#lib/contexts/hostContext.svelte.js';
|
|
4
|
+
import { getLocaleContext } from '#lib/i18n/localeContext.svelte.js';
|
|
5
|
+
import type { ViewerMessages } from '#lib/i18n/messages.js';
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
inputId: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { NumberWidgetConfig, SupportedTypes } from '@selvajs/schemas';
|
|
3
|
-
import { debounce } from '
|
|
4
|
-
import { Input } from '
|
|
5
|
-
import { Slider } from '
|
|
6
|
-
import * as InputGroup from '
|
|
7
|
-
import { Separator } from '
|
|
8
|
-
import * as Field from '
|
|
9
|
-
import { getLocaleContext } from '
|
|
10
|
-
import { formatMessage } from '
|
|
3
|
+
import { debounce } from '#lib/utils/debounce.js';
|
|
4
|
+
import { Input } from '#lib/components/primitives/input/index.js';
|
|
5
|
+
import { Slider } from '#lib/components/primitives/slider/index.js';
|
|
6
|
+
import * as InputGroup from '#lib/components/primitives/input-group/index.js';
|
|
7
|
+
import { Separator } from '#lib/components/primitives/separator/index.js';
|
|
8
|
+
import * as Field from '#lib/components/primitives/field/index.js';
|
|
9
|
+
import { getLocaleContext } from '#lib/i18n/localeContext.svelte.js';
|
|
10
|
+
import { formatMessage } from '#lib/i18n/messages.js';
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
13
13
|
inputId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { GlyphSource } from '
|
|
3
|
-
import { cn } from '
|
|
2
|
+
import type { GlyphSource } from '#lib/schema/option-display.js';
|
|
3
|
+
import { cn } from '#lib/utils.js';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
glyph: GlyphSource;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { DropdownWidgetConfig, SupportedTypes, UISchema } from '@selvajs/schemas';
|
|
3
|
-
import * as ToggleGroup from '
|
|
4
|
-
import { optionGlyph } from '
|
|
3
|
+
import * as ToggleGroup from '#lib/components/primitives/toggle-group/index.js';
|
|
4
|
+
import { optionGlyph } from '#lib/schema/option-display.js';
|
|
5
5
|
import OptionGlyph from './OptionGlyph.svelte';
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<ToggleGroup.Root
|
|
25
25
|
type="single"
|
|
26
26
|
variant="outline"
|
|
27
|
+
spacing={0}
|
|
27
28
|
size={hasIcons ? 'stacked' : 'default'}
|
|
28
29
|
class="w-full"
|
|
29
30
|
aria-labelledby={labelId}
|