@softov/scena 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/controls/command.d.ts +18 -0
- package/dist/controls/command.js +150 -0
- package/dist/controls/events.d.ts +3 -0
- package/dist/controls/events.js +43 -0
- package/dist/controls/index.d.ts +10 -0
- package/dist/controls/index.js +10 -0
- package/dist/controls/keybinding.d.ts +9 -0
- package/dist/controls/keybinding.js +94 -0
- package/dist/controls/layout.d.ts +16 -0
- package/dist/controls/layout.js +201 -0
- package/dist/controls/manifest.d.ts +21 -0
- package/dist/controls/manifest.js +219 -0
- package/dist/controls/session.d.ts +16 -0
- package/dist/controls/session.js +95 -0
- package/dist/controls/shell.d.ts +8 -0
- package/dist/controls/shell.js +48 -0
- package/dist/controls/storage/layout-local.d.ts +6 -0
- package/dist/controls/storage/layout-local.js +47 -0
- package/dist/controls/storage/session-local.d.ts +5 -0
- package/dist/controls/storage/session-local.js +38 -0
- package/dist/controls/when.d.ts +7 -0
- package/dist/controls/when.js +226 -0
- package/dist/converters/a2ui-v0.10.d.ts +23 -0
- package/dist/converters/a2ui-v0.10.js +136 -0
- package/dist/converters/index.d.ts +1 -0
- package/dist/converters/index.js +1 -0
- package/dist/core/backends/modus-backend.d.ts +13 -0
- package/dist/core/backends/modus-backend.js +115 -0
- package/dist/core/backends/storage-backend.d.ts +7 -0
- package/dist/core/backends/storage-backend.js +73 -0
- package/dist/core/backends/yjs-backend.d.ts +3 -0
- package/dist/core/backends/yjs-backend.js +44 -0
- package/dist/core/binding-resolver.d.ts +7 -0
- package/dist/core/binding-resolver.js +106 -0
- package/dist/core/component-graph.d.ts +6 -0
- package/dist/core/component-graph.js +77 -0
- package/dist/core/component-registry.d.ts +7 -0
- package/dist/core/component-registry.js +87 -0
- package/dist/core/computed-dsl.d.ts +2 -0
- package/dist/core/computed-dsl.js +267 -0
- package/dist/core/converter-registry.d.ts +2 -0
- package/dist/core/converter-registry.js +37 -0
- package/dist/core/disposable.d.ts +3 -0
- package/dist/core/disposable.js +19 -0
- package/dist/core/dynamic-resolver.d.ts +12 -0
- package/dist/core/dynamic-resolver.js +134 -0
- package/dist/core/index.d.ts +44 -0
- package/dist/core/index.js +48 -0
- package/dist/core/label.d.ts +2 -0
- package/dist/core/label.js +14 -0
- package/dist/core/mount-menu.d.ts +2 -0
- package/dist/core/mount-menu.js +23 -0
- package/dist/core/mount-surface.d.ts +15 -0
- package/dist/core/mount-surface.js +214 -0
- package/dist/core/path-resolver.d.ts +14 -0
- package/dist/core/path-resolver.js +169 -0
- package/dist/core/permissions.d.ts +2 -0
- package/dist/core/permissions.js +50 -0
- package/dist/core/reactive-store.d.ts +17 -0
- package/dist/core/reactive-store.js +496 -0
- package/dist/core/scena.d.ts +2 -0
- package/dist/core/scena.js +115 -0
- package/dist/core/surface-presentation.d.ts +6 -0
- package/dist/core/surface-presentation.js +12 -0
- package/dist/i18n/i18n-backend.d.ts +2 -0
- package/dist/i18n/i18n-backend.js +35 -0
- package/dist/i18n/registry.d.ts +32 -0
- package/dist/i18n/registry.js +200 -0
- package/dist/porta/Limen.css +50 -0
- package/dist/porta/Limen.d.ts +16 -0
- package/dist/porta/Limen.js +14 -0
- package/dist/porta/PortaContext.d.ts +10 -0
- package/dist/porta/PortaContext.js +20 -0
- package/dist/porta/PortaLock.css +14 -0
- package/dist/porta/PortaLock.d.ts +10 -0
- package/dist/porta/PortaLock.js +13 -0
- package/dist/porta/SigillumGate.d.ts +8 -0
- package/dist/porta/SigillumGate.js +7 -0
- package/dist/porta/commands.d.ts +3 -0
- package/dist/porta/commands.js +125 -0
- package/dist/porta/index.d.ts +18 -0
- package/dist/porta/index.js +22 -0
- package/dist/porta/login-form.block.d.ts +2 -0
- package/dist/porta/login-form.block.js +7 -0
- package/dist/porta/match.d.ts +2 -0
- package/dist/porta/match.js +20 -0
- package/dist/porta/provider.d.ts +59 -0
- package/dist/porta/provider.js +1 -0
- package/dist/porta/providers/examples/google-oauth.d.ts +6 -0
- package/dist/porta/providers/examples/google-oauth.js +21 -0
- package/dist/porta/providers/examples/index.d.ts +6 -0
- package/dist/porta/providers/examples/index.js +3 -0
- package/dist/porta/providers/examples/magic-link.d.ts +8 -0
- package/dist/porta/providers/examples/magic-link.js +31 -0
- package/dist/porta/providers/examples/sms-otp.d.ts +9 -0
- package/dist/porta/providers/examples/sms-otp.js +31 -0
- package/dist/porta/providers/password.d.ts +12 -0
- package/dist/porta/providers/password.js +46 -0
- package/dist/porta/register-blocks.d.ts +3 -0
- package/dist/porta/register-blocks.js +31 -0
- package/dist/porta/register.d.ts +15 -0
- package/dist/porta/register.js +31 -0
- package/dist/porta/sigillum.d.ts +19 -0
- package/dist/porta/sigillum.js +41 -0
- package/dist/react/DefaultShell.d.ts +1 -0
- package/dist/react/DefaultShell.js +37 -0
- package/dist/react/Scena.d.ts +9 -0
- package/dist/react/Scena.js +20 -0
- package/dist/react/ScenaProvider.d.ts +8 -0
- package/dist/react/ScenaProvider.js +13 -0
- package/dist/react/ShellSplitter.d.ts +13 -0
- package/dist/react/ShellSplitter.js +88 -0
- package/dist/react/SurfaceArea.d.ts +13 -0
- package/dist/react/SurfaceArea.js +75 -0
- package/dist/react/Translate.d.ts +8 -0
- package/dist/react/Translate.js +10 -0
- package/dist/react/ViewMount.d.ts +12 -0
- package/dist/react/ViewMount.js +268 -0
- package/dist/react/core.d.ts +6 -0
- package/dist/react/core.js +10 -0
- package/dist/react/hooks/useCommand.d.ts +1 -0
- package/dist/react/hooks/useCommand.js +6 -0
- package/dist/react/hooks/useI18n.d.ts +9 -0
- package/dist/react/hooks/useI18n.js +16 -0
- package/dist/react/hooks/useLabel.d.ts +2 -0
- package/dist/react/hooks/useLabel.js +19 -0
- package/dist/react/hooks/useLayout.d.ts +2 -0
- package/dist/react/hooks/useLayout.js +10 -0
- package/dist/react/hooks/useMounts.d.ts +2 -0
- package/dist/react/hooks/useMounts.js +17 -0
- package/dist/react/hooks/useStore.d.ts +3 -0
- package/dist/react/hooks/useStore.js +40 -0
- package/dist/react/hooks/useStoreLabel.d.ts +3 -0
- package/dist/react/hooks/useStoreLabel.js +25 -0
- package/dist/react/hooks/useSurfacePresentation.d.ts +4 -0
- package/dist/react/hooks/useSurfacePresentation.js +16 -0
- package/dist/react/index.d.ts +20 -0
- package/dist/react/index.js +20 -0
- package/dist/react/mount-context.d.ts +8 -0
- package/dist/react/mount-context.js +20 -0
- package/dist/react/useSurfaceResize.d.ts +39 -0
- package/dist/react/useSurfaceResize.js +135 -0
- package/dist/runtime/args-schema.d.ts +11 -0
- package/dist/runtime/args-schema.js +45 -0
- package/dist/runtime/builtins.d.ts +3 -0
- package/dist/runtime/builtins.js +193 -0
- package/dist/runtime/client-handlers.d.ts +3 -0
- package/dist/runtime/client-handlers.js +19 -0
- package/dist/runtime/in-memory-socket.d.ts +7 -0
- package/dist/runtime/in-memory-socket.js +53 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.js +7 -0
- package/dist/runtime/layout-commands.d.ts +5 -0
- package/dist/runtime/layout-commands.js +548 -0
- package/dist/runtime/opener-commands.d.ts +17 -0
- package/dist/runtime/opener-commands.js +96 -0
- package/dist/runtime/surface-bridge.d.ts +15 -0
- package/dist/runtime/surface-bridge.js +116 -0
- package/dist/styles/bar.css +155 -0
- package/dist/styles/base.css +285 -0
- package/dist/styles/geometry.css +32 -0
- package/dist/styles/index.d.ts +29 -0
- package/dist/styles/index.js +109 -0
- package/dist/styles/scrollbar.css +45 -0
- package/dist/styles/surface.css +179 -0
- package/dist/styles/theme.css +3 -0
- package/dist/styles/themes/dark.css +30 -0
- package/dist/styles/themes/light.css +1 -0
- package/dist/styles/themes/tokens.css +222 -0
- package/dist/types/binding-resolver.d.ts +30 -0
- package/dist/types/binding-resolver.js +1 -0
- package/dist/types/colors.d.ts +7 -0
- package/dist/types/colors.js +59 -0
- package/dist/types/command.d.ts +62 -0
- package/dist/types/command.js +1 -0
- package/dist/types/component-graph.d.ts +72 -0
- package/dist/types/component-graph.js +40 -0
- package/dist/types/component-registry.d.ts +70 -0
- package/dist/types/component-registry.js +1 -0
- package/dist/types/converter-registry.d.ts +17 -0
- package/dist/types/converter-registry.js +1 -0
- package/dist/types/disposable.d.ts +3 -0
- package/dist/types/disposable.js +1 -0
- package/dist/types/events.d.ts +75 -0
- package/dist/types/events.js +1 -0
- package/dist/types/host.d.ts +50 -0
- package/dist/types/host.js +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.js +23 -0
- package/dist/types/keybinding.d.ts +36 -0
- package/dist/types/keybinding.js +1 -0
- package/dist/types/label.d.ts +9 -0
- package/dist/types/label.js +1 -0
- package/dist/types/layout.d.ts +117 -0
- package/dist/types/layout.js +1 -0
- package/dist/types/manifest.d.ts +152 -0
- package/dist/types/manifest.js +1 -0
- package/dist/types/mount-menu.d.ts +8 -0
- package/dist/types/mount-menu.js +1 -0
- package/dist/types/mount-surface.d.ts +87 -0
- package/dist/types/mount-surface.js +1 -0
- package/dist/types/permissions.d.ts +18 -0
- package/dist/types/permissions.js +1 -0
- package/dist/types/query.d.ts +34 -0
- package/dist/types/query.js +7 -0
- package/dist/types/reactive-store.d.ts +39 -0
- package/dist/types/reactive-store.js +1 -0
- package/dist/types/scena.d.ts +53 -0
- package/dist/types/scena.js +1 -0
- package/dist/types/scope-backend.d.ts +16 -0
- package/dist/types/scope-backend.js +1 -0
- package/dist/types/session.d.ts +39 -0
- package/dist/types/session.js +1 -0
- package/dist/types/shell.d.ts +21 -0
- package/dist/types/shell.js +1 -0
- package/dist/types/when.d.ts +10 -0
- package/dist/types/when.js +1 -0
- package/dist/ui/_utils.d.ts +8 -0
- package/dist/ui/_utils.js +53 -0
- package/dist/ui/campus/CampusMappa.d.ts +18 -0
- package/dist/ui/campus/CampusMappa.js +106 -0
- package/dist/ui/campus/CampusNodus.d.ts +25 -0
- package/dist/ui/campus/CampusNodus.js +211 -0
- package/dist/ui/campus/CampusStratum.d.ts +13 -0
- package/dist/ui/campus/CampusStratum.js +20 -0
- package/dist/ui/campus/CampusVelum.d.ts +7 -0
- package/dist/ui/campus/CampusVelum.js +12 -0
- package/dist/ui/campus/CampusView.d.ts +27 -0
- package/dist/ui/campus/CampusView.js +420 -0
- package/dist/ui/campus/context.d.ts +13 -0
- package/dist/ui/campus/context.js +12 -0
- package/dist/ui/campus/index.d.ts +14 -0
- package/dist/ui/campus/index.js +11 -0
- package/dist/ui/campus/stratum-context.d.ts +2 -0
- package/dist/ui/campus/stratum-context.js +10 -0
- package/dist/ui/campus/types.d.ts +47 -0
- package/dist/ui/campus/types.js +4 -0
- package/dist/ui/chart/BarChart.css +53 -0
- package/dist/ui/chart/BarChart.d.ts +24 -0
- package/dist/ui/chart/BarChart.js +32 -0
- package/dist/ui/chart/Donut.css +15 -0
- package/dist/ui/chart/Donut.d.ts +15 -0
- package/dist/ui/chart/Donut.js +18 -0
- package/dist/ui/chart/LineChart.css +8 -0
- package/dist/ui/chart/LineChart.d.ts +24 -0
- package/dist/ui/chart/LineChart.js +29 -0
- package/dist/ui/chart/catalog.d.ts +2 -0
- package/dist/ui/chart/catalog.js +7 -0
- package/dist/ui/chart/index.d.ts +6 -0
- package/dist/ui/chart/index.js +4 -0
- package/dist/ui/control/Button.css +7 -0
- package/dist/ui/control/Button.d.ts +17 -0
- package/dist/ui/control/Button.js +17 -0
- package/dist/ui/control/CheckBox.css +16 -0
- package/dist/ui/control/CheckBox.d.ts +15 -0
- package/dist/ui/control/CheckBox.js +23 -0
- package/dist/ui/control/Checks.css +6 -0
- package/dist/ui/control/Checks.d.ts +9 -0
- package/dist/ui/control/Checks.js +10 -0
- package/dist/ui/control/ChoicePicker.css +16 -0
- package/dist/ui/control/ChoicePicker.d.ts +25 -0
- package/dist/ui/control/ChoicePicker.js +38 -0
- package/dist/ui/control/DateTimeInput.css +1 -0
- package/dist/ui/control/DateTimeInput.d.ts +22 -0
- package/dist/ui/control/DateTimeInput.js +41 -0
- package/dist/ui/control/LocaleToggle.css +38 -0
- package/dist/ui/control/LocaleToggle.d.ts +11 -0
- package/dist/ui/control/LocaleToggle.js +23 -0
- package/dist/ui/control/ReloadButton.d.ts +6 -0
- package/dist/ui/control/ReloadButton.js +9 -0
- package/dist/ui/control/Slider.css +2 -0
- package/dist/ui/control/Slider.d.ts +21 -0
- package/dist/ui/control/Slider.js +37 -0
- package/dist/ui/control/TextField.css +0 -0
- package/dist/ui/control/TextField.d.ts +25 -0
- package/dist/ui/control/TextField.js +36 -0
- package/dist/ui/control/_field-parts.css +102 -0
- package/dist/ui/control/_field-parts.d.ts +15 -0
- package/dist/ui/control/_field-parts.js +17 -0
- package/dist/ui/control/catalog.d.ts +2 -0
- package/dist/ui/control/catalog.js +10 -0
- package/dist/ui/control/index.d.ts +13 -0
- package/dist/ui/control/index.js +11 -0
- package/dist/ui/data/DataTable.d.ts +19 -0
- package/dist/ui/data/DataTable.js +20 -0
- package/dist/ui/data/Filter.d.ts +13 -0
- package/dist/ui/data/Filter.js +56 -0
- package/dist/ui/data/List.css +16 -0
- package/dist/ui/data/List.d.ts +15 -0
- package/dist/ui/data/List.js +18 -0
- package/dist/ui/data/Listable.css +245 -0
- package/dist/ui/data/Listable.d.ts +60 -0
- package/dist/ui/data/Listable.js +209 -0
- package/dist/ui/data/Pagination.d.ts +5 -0
- package/dist/ui/data/Pagination.js +43 -0
- package/dist/ui/data/Tree.css +118 -0
- package/dist/ui/data/Tree.d.ts +45 -0
- package/dist/ui/data/Tree.js +170 -0
- package/dist/ui/data/catalog.d.ts +2 -0
- package/dist/ui/data/catalog.js +7 -0
- package/dist/ui/data/index.d.ts +11 -0
- package/dist/ui/data/index.js +7 -0
- package/dist/ui/display/AddPlaceholder.d.ts +6 -0
- package/dist/ui/display/AddPlaceholder.js +24 -0
- package/dist/ui/display/Alert.css +42 -0
- package/dist/ui/display/Alert.d.ts +14 -0
- package/dist/ui/display/Alert.js +13 -0
- package/dist/ui/display/Avatar.css +19 -0
- package/dist/ui/display/Avatar.d.ts +16 -0
- package/dist/ui/display/Avatar.js +52 -0
- package/dist/ui/display/Badge.css +26 -0
- package/dist/ui/display/Badge.d.ts +16 -0
- package/dist/ui/display/Badge.js +9 -0
- package/dist/ui/display/Card.css +15 -0
- package/dist/ui/display/Card.d.ts +11 -0
- package/dist/ui/display/Card.js +8 -0
- package/dist/ui/display/DetailContainer.d.ts +6 -0
- package/dist/ui/display/DetailContainer.js +7 -0
- package/dist/ui/display/DetailHeader.css +53 -0
- package/dist/ui/display/DetailHeader.d.ts +22 -0
- package/dist/ui/display/DetailHeader.js +8 -0
- package/dist/ui/display/DetailList.css +26 -0
- package/dist/ui/display/DetailList.d.ts +13 -0
- package/dist/ui/display/DetailList.js +5 -0
- package/dist/ui/display/DetailNotFound.d.ts +17 -0
- package/dist/ui/display/DetailNotFound.js +39 -0
- package/dist/ui/display/Divider.css +6 -0
- package/dist/ui/display/Divider.d.ts +8 -0
- package/dist/ui/display/Divider.js +16 -0
- package/dist/ui/display/Divisor.css +30 -0
- package/dist/ui/display/Divisor.d.ts +11 -0
- package/dist/ui/display/Divisor.js +43 -0
- package/dist/ui/display/Icon.css +10 -0
- package/dist/ui/display/Icon.d.ts +14 -0
- package/dist/ui/display/Icon.js +144 -0
- package/dist/ui/display/Image.css +1 -0
- package/dist/ui/display/Image.d.ts +16 -0
- package/dist/ui/display/Image.js +19 -0
- package/dist/ui/display/Markdown.css +38 -0
- package/dist/ui/display/Markdown.d.ts +8 -0
- package/dist/ui/display/Markdown.js +140 -0
- package/dist/ui/display/Progress.css +39 -0
- package/dist/ui/display/Progress.d.ts +15 -0
- package/dist/ui/display/Progress.js +17 -0
- package/dist/ui/display/SectionTitle.d.ts +6 -0
- package/dist/ui/display/SectionTitle.js +6 -0
- package/dist/ui/display/Skeleton.css +20 -0
- package/dist/ui/display/Skeleton.d.ts +11 -0
- package/dist/ui/display/Skeleton.js +11 -0
- package/dist/ui/display/Spinner.css +20 -0
- package/dist/ui/display/Spinner.d.ts +12 -0
- package/dist/ui/display/Spinner.js +12 -0
- package/dist/ui/display/Svg.d.ts +13 -0
- package/dist/ui/display/Svg.js +17 -0
- package/dist/ui/display/Text.css +20 -0
- package/dist/ui/display/Text.d.ts +13 -0
- package/dist/ui/display/Text.js +15 -0
- package/dist/ui/display/catalog.d.ts +2 -0
- package/dist/ui/display/catalog.js +12 -0
- package/dist/ui/display/index.d.ts +22 -0
- package/dist/ui/display/index.js +14 -0
- package/dist/ui/embed/HtmlEmbed.d.ts +12 -0
- package/dist/ui/embed/HtmlEmbed.js +16 -0
- package/dist/ui/embed/index.d.ts +2 -0
- package/dist/ui/embed/index.js +1 -0
- package/dist/ui/forms/DangerZone.d.ts +8 -0
- package/dist/ui/forms/DangerZone.js +31 -0
- package/dist/ui/forms/Field.css +15 -0
- package/dist/ui/forms/Field.d.ts +28 -0
- package/dist/ui/forms/Field.js +25 -0
- package/dist/ui/forms/FieldGroup.css +15 -0
- package/dist/ui/forms/FieldGroup.d.ts +7 -0
- package/dist/ui/forms/FieldGroup.js +7 -0
- package/dist/ui/forms/Form.css +14 -0
- package/dist/ui/forms/Form.d.ts +18 -0
- package/dist/ui/forms/Form.js +17 -0
- package/dist/ui/forms/FormActions.css +11 -0
- package/dist/ui/forms/FormActions.d.ts +18 -0
- package/dist/ui/forms/FormActions.js +10 -0
- package/dist/ui/forms/FormSection.css +19 -0
- package/dist/ui/forms/FormSection.d.ts +7 -0
- package/dist/ui/forms/FormSection.js +7 -0
- package/dist/ui/forms/LoginForm.css +105 -0
- package/dist/ui/forms/LoginForm.d.ts +12 -0
- package/dist/ui/forms/LoginForm.js +137 -0
- package/dist/ui/forms/SchemaForm.css +81 -0
- package/dist/ui/forms/SchemaForm.d.ts +26 -0
- package/dist/ui/forms/SchemaForm.js +186 -0
- package/dist/ui/forms/SettingsContainer.d.ts +8 -0
- package/dist/ui/forms/SettingsContainer.js +8 -0
- package/dist/ui/forms/catalog.d.ts +2 -0
- package/dist/ui/forms/catalog.js +11 -0
- package/dist/ui/forms/index.d.ts +19 -0
- package/dist/ui/forms/index.js +12 -0
- package/dist/ui/forms/schema-walk.d.ts +50 -0
- package/dist/ui/forms/schema-walk.js +116 -0
- package/dist/ui/index.d.ts +58 -0
- package/dist/ui/index.js +63 -0
- package/dist/ui/layout/BarLayout.d.ts +2 -0
- package/dist/ui/layout/BarLayout.js +18 -0
- package/dist/ui/layout/Column.css +6 -0
- package/dist/ui/layout/Column.d.ts +12 -0
- package/dist/ui/layout/Column.js +13 -0
- package/dist/ui/layout/FloatingLayout.d.ts +2 -0
- package/dist/ui/layout/FloatingLayout.js +12 -0
- package/dist/ui/layout/Grid.css +5 -0
- package/dist/ui/layout/Grid.d.ts +13 -0
- package/dist/ui/layout/Grid.js +19 -0
- package/dist/ui/layout/InlineLayout.d.ts +2 -0
- package/dist/ui/layout/InlineLayout.js +13 -0
- package/dist/ui/layout/MountTitle.d.ts +12 -0
- package/dist/ui/layout/MountTitle.js +42 -0
- package/dist/ui/layout/RailLayout.d.ts +2 -0
- package/dist/ui/layout/RailLayout.js +38 -0
- package/dist/ui/layout/Row.css +16 -0
- package/dist/ui/layout/Row.d.ts +13 -0
- package/dist/ui/layout/Row.js +21 -0
- package/dist/ui/layout/SectionHeader.d.ts +10 -0
- package/dist/ui/layout/SectionHeader.js +65 -0
- package/dist/ui/layout/SingleLayout.d.ts +2 -0
- package/dist/ui/layout/SingleLayout.js +25 -0
- package/dist/ui/layout/SpatialCard.d.ts +9 -0
- package/dist/ui/layout/SpatialCard.js +30 -0
- package/dist/ui/layout/SpatialLayout.d.ts +2 -0
- package/dist/ui/layout/SpatialLayout.js +446 -0
- package/dist/ui/layout/SplitLayout.d.ts +2 -0
- package/dist/ui/layout/SplitLayout.js +159 -0
- package/dist/ui/layout/Splitter.d.ts +12 -0
- package/dist/ui/layout/Splitter.js +64 -0
- package/dist/ui/layout/StackHeader.d.ts +9 -0
- package/dist/ui/layout/StackHeader.js +87 -0
- package/dist/ui/layout/StackLayout.d.ts +2 -0
- package/dist/ui/layout/StackLayout.js +137 -0
- package/dist/ui/layout/TabLayout.d.ts +2 -0
- package/dist/ui/layout/TabLayout.js +145 -0
- package/dist/ui/layout/TabPanelLayout.d.ts +20 -0
- package/dist/ui/layout/TabPanelLayout.js +615 -0
- package/dist/ui/layout/catalog.d.ts +2 -0
- package/dist/ui/layout/catalog.js +10 -0
- package/dist/ui/layout/index.d.ts +17 -0
- package/dist/ui/layout/index.js +17 -0
- package/dist/ui/layout/register.d.ts +3 -0
- package/dist/ui/layout/register.js +25 -0
- package/dist/ui/media/Audio.css +1 -0
- package/dist/ui/media/Audio.d.ts +12 -0
- package/dist/ui/media/Audio.js +8 -0
- package/dist/ui/media/Video.css +1 -0
- package/dist/ui/media/Video.d.ts +16 -0
- package/dist/ui/media/Video.js +9 -0
- package/dist/ui/media/catalog.d.ts +2 -0
- package/dist/ui/media/catalog.js +5 -0
- package/dist/ui/media/index.d.ts +2 -0
- package/dist/ui/media/index.js +3 -0
- package/dist/ui/menu/ActionList.css +262 -0
- package/dist/ui/menu/ActionList.d.ts +19 -0
- package/dist/ui/menu/ActionList.js +369 -0
- package/dist/ui/menu/ContainerMenu.d.ts +13 -0
- package/dist/ui/menu/ContainerMenu.js +57 -0
- package/dist/ui/menu/ContextMenu.d.ts +27 -0
- package/dist/ui/menu/ContextMenu.js +93 -0
- package/dist/ui/menu/index.d.ts +10 -0
- package/dist/ui/menu/index.js +7 -0
- package/dist/ui/menu/token.d.ts +22 -0
- package/dist/ui/menu/token.js +145 -0
- package/dist/ui/menu/useChatPicker.d.ts +24 -0
- package/dist/ui/menu/useChatPicker.js +210 -0
- package/dist/ui/navigation/Breadcrumb.css +30 -0
- package/dist/ui/navigation/Breadcrumb.d.ts +14 -0
- package/dist/ui/navigation/Breadcrumb.js +12 -0
- package/dist/ui/navigation/Link.css +13 -0
- package/dist/ui/navigation/Link.d.ts +18 -0
- package/dist/ui/navigation/Link.js +43 -0
- package/dist/ui/navigation/Tabs.css +39 -0
- package/dist/ui/navigation/Tabs.d.ts +18 -0
- package/dist/ui/navigation/Tabs.js +55 -0
- package/dist/ui/navigation/Toolbar.css +25 -0
- package/dist/ui/navigation/Toolbar.d.ts +12 -0
- package/dist/ui/navigation/Toolbar.js +21 -0
- package/dist/ui/navigation/catalog.d.ts +2 -0
- package/dist/ui/navigation/catalog.js +5 -0
- package/dist/ui/navigation/index.d.ts +8 -0
- package/dist/ui/navigation/index.js +5 -0
- package/dist/ui/overlay/Modal.css +35 -0
- package/dist/ui/overlay/Modal.d.ts +12 -0
- package/dist/ui/overlay/Modal.js +57 -0
- package/dist/ui/overlay/Popup.d.ts +12 -0
- package/dist/ui/overlay/Popup.js +74 -0
- package/dist/ui/overlay/catalog.d.ts +2 -0
- package/dist/ui/overlay/catalog.js +4 -0
- package/dist/ui/overlay/index.d.ts +1 -0
- package/dist/ui/overlay/index.js +2 -0
- package/dist/ui/register.d.ts +6 -0
- package/dist/ui/register.js +26 -0
- package/package.json +115 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import './Donut.css';
|
|
3
|
+
export interface DonutSlice {
|
|
4
|
+
value: number;
|
|
5
|
+
color: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DonutProps {
|
|
9
|
+
slices: DonutSlice[];
|
|
10
|
+
size?: number;
|
|
11
|
+
thickness?: number;
|
|
12
|
+
centerLabel?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
export declare function Donut({ slices, size, thickness, centerLabel, style }: DonutProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './Donut.css';
|
|
3
|
+
export function Donut({ slices, size = 96, thickness = 12, centerLabel, style }) {
|
|
4
|
+
// Bound props can resolve to undefined before their store path is seeded.
|
|
5
|
+
slices = slices ?? [];
|
|
6
|
+
const total = slices.reduce((sum, s) => sum + s.value, 0) || 1;
|
|
7
|
+
const r = (size - thickness) / 2;
|
|
8
|
+
const c = 2 * Math.PI * r;
|
|
9
|
+
const cx = size / 2;
|
|
10
|
+
let acc = 0;
|
|
11
|
+
return (_jsxs("div", { className: "oo-donut", style: { width: size, height: size, ...style }, children: [_jsx("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: _jsxs("g", { transform: `rotate(-90 ${cx} ${cx})`, children: [_jsx("circle", { cx: cx, cy: cx, r: r, fill: "none", stroke: "var(--oo-color-border)", strokeWidth: thickness }), slices.map((s, i) => {
|
|
12
|
+
const frac = s.value / total;
|
|
13
|
+
const dash = frac * c;
|
|
14
|
+
const arc = (_jsx("circle", { cx: cx, cy: cx, r: r, fill: "none", stroke: s.color, strokeWidth: thickness, strokeDasharray: `${dash} ${c - dash}`, strokeDashoffset: -acc * c, children: s.label ? _jsx("title", { children: `${s.label}: ${s.value}` }) : null }, i));
|
|
15
|
+
acc += frac;
|
|
16
|
+
return arc;
|
|
17
|
+
})] }) }), centerLabel ? _jsx("div", { className: "oo-donut__center", children: centerLabel }) : null] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import './LineChart.css';
|
|
3
|
+
export interface LineSeries {
|
|
4
|
+
points: number[];
|
|
5
|
+
color?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LineChartProps {
|
|
9
|
+
series: LineSeries[];
|
|
10
|
+
height?: number;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
fill?: boolean;
|
|
13
|
+
showAxis?: boolean;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
export declare function LineChart({ series, height, width, fill, showAxis, style }: LineChartProps): import("react").JSX.Element;
|
|
17
|
+
export interface SparklineProps {
|
|
18
|
+
points: number[];
|
|
19
|
+
color?: string;
|
|
20
|
+
height?: number;
|
|
21
|
+
fill?: boolean;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
export declare function Sparkline({ points, color, height, fill, style }: SparklineProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './LineChart.css';
|
|
3
|
+
const DEFAULT_COLOR = 'var(--oo-color-accent)';
|
|
4
|
+
export function LineChart({ series, height = 80, width = '100%', fill, showAxis, style }) {
|
|
5
|
+
// Bound props can resolve to undefined before their store path is seeded.
|
|
6
|
+
const safeSeries = (series ?? []).map((s) => ({ ...s, points: s.points ?? [] }));
|
|
7
|
+
const all = safeSeries.flatMap((s) => s.points);
|
|
8
|
+
const min = all.length > 0 ? Math.min(...all) : 0;
|
|
9
|
+
const max = all.length > 0 ? Math.max(...all) : 1;
|
|
10
|
+
const span = max - min || 1;
|
|
11
|
+
const toXY = (points) => points
|
|
12
|
+
.map((v, i) => {
|
|
13
|
+
const x = points.length > 1 ? (i / (points.length - 1)) * 100 : 0;
|
|
14
|
+
const y = 100 - ((v - min) / span) * 100;
|
|
15
|
+
return `${x},${y}`;
|
|
16
|
+
})
|
|
17
|
+
.join(' ');
|
|
18
|
+
return (_jsxs("svg", { className: "oo-linechart", viewBox: "0 0 100 100", preserveAspectRatio: "none", style: { width, height, ...style }, children: [showAxis ? (_jsx("line", { className: "oo-linechart__axis", x1: "0", y1: "100", x2: "100", y2: "100", vectorEffect: "non-scaling-stroke" })) : null, safeSeries.map((s, i) => {
|
|
19
|
+
const color = s.color ?? DEFAULT_COLOR;
|
|
20
|
+
const xy = toXY(s.points);
|
|
21
|
+
if (!xy)
|
|
22
|
+
return null;
|
|
23
|
+
return (_jsxs("g", { children: [fill ? _jsx("polygon", { points: `0,100 ${xy} 100,100`, fill: color, opacity: 0.15 }) : null, _jsx("polyline", { points: xy, fill: "none", stroke: color, strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round", vectorEffect: "non-scaling-stroke" })] }, i));
|
|
24
|
+
})] }));
|
|
25
|
+
}
|
|
26
|
+
// A single-series LineChart, compact, no axis. The common inline use.
|
|
27
|
+
export function Sparkline({ points, color, height = 24, fill, style }) {
|
|
28
|
+
return _jsx(LineChart, { series: [{ points, color }], height: height, fill: fill, style: style });
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Catalog registration for chart components (dynamic import — no eager load).
|
|
2
|
+
export const CATALOG_CHART_MAP = [
|
|
3
|
+
{ component: 'BarChart', category: 'inline', renderer: { kind: 'react', load: () => import('./BarChart.js').then((m) => ({ default: m.BarChart })) } },
|
|
4
|
+
{ component: 'LineChart', category: 'inline', renderer: { kind: 'react', load: () => import('./LineChart.js').then((m) => ({ default: m.LineChart })) } },
|
|
5
|
+
{ component: 'Sparkline', category: 'inline', renderer: { kind: 'react', load: () => import('./LineChart.js').then((m) => ({ default: m.Sparkline })) } },
|
|
6
|
+
{ component: 'Donut', category: 'inline', renderer: { kind: 'react', load: () => import('./Donut.js').then((m) => ({ default: m.Donut })) } },
|
|
7
|
+
];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BarChart } from './BarChart.js';
|
|
2
|
+
export type { BarChartProps, BarChartBar, BarChartSegment } from './BarChart.js';
|
|
3
|
+
export { LineChart, Sparkline } from './LineChart.js';
|
|
4
|
+
export type { LineChartProps, LineSeries, SparklineProps } from './LineChart.js';
|
|
5
|
+
export { Donut } from './Donut.js';
|
|
6
|
+
export type { DonutProps, DonutSlice } from './Donut.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { SizeName } from '../../styles/index.js';
|
|
3
|
+
import './Button.css';
|
|
4
|
+
export interface ButtonProps {
|
|
5
|
+
type?: 'button' | 'submit' | 'reset';
|
|
6
|
+
weight?: number;
|
|
7
|
+
title?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'default' | 'borderless';
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onClick?: () => void | Promise<void>;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
size?: SizeName;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
rounded?: SizeName;
|
|
16
|
+
}
|
|
17
|
+
export declare function Button({ type, title, label, variant, disabled, onClick, weight, size, style, children, rounded, }: ButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { appearance, resolveVariableFontSize, resolveVariableSize } from '../../styles/index.js';
|
|
3
|
+
import { weightStyle } from '../_utils.js';
|
|
4
|
+
import './Button.css';
|
|
5
|
+
export function Button({ type = 'button', title, label, variant = 'default', disabled, onClick, weight, size = 'sm', style, children, rounded = 'sm', }) {
|
|
6
|
+
const inlineStyle = {
|
|
7
|
+
['--button-padding-y']: `var(${resolveVariableSize(size)})`,
|
|
8
|
+
['--button-padding-x']: `var(${resolveVariableSize(size)})`,
|
|
9
|
+
['--button-font-size']: `var(${resolveVariableFontSize(size)})`,
|
|
10
|
+
['--button-border-radius']: `var(${resolveVariableSize(rounded ?? size)})`,
|
|
11
|
+
...weightStyle(weight),
|
|
12
|
+
...style
|
|
13
|
+
};
|
|
14
|
+
return (_jsx("button", { type: type ?? 'button', disabled: disabled, onClick: () => {
|
|
15
|
+
void onClick?.();
|
|
16
|
+
}, "data-variant": variant, className: appearance('oo-btn', { variant }), style: inlineStyle, title: title, children: label ?? children ?? 'Button' }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.oo-checkbox-field {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--oo-spacing-xs);
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
}
|
|
7
|
+
.oo-checkbox {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--oo-spacing-xs);
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
}
|
|
13
|
+
.oo-checkbox[data-disabled="true"] {
|
|
14
|
+
cursor: not-allowed;
|
|
15
|
+
opacity: 0.5;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CheckRuleResolved } from './Checks.js';
|
|
2
|
+
import './CheckBox.css';
|
|
3
|
+
export interface CheckBoxProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: boolean;
|
|
6
|
+
weight?: number;
|
|
7
|
+
defaultValue?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
checks?: CheckRuleResolved[];
|
|
10
|
+
hint?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
onChange?: (next: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function CheckBox({ value, defaultValue, label, disabled, checks, weight, hint, error, required, onChange: onChangeProp, }: CheckBoxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useWriteBack } from '../../react/mount-context.js';
|
|
4
|
+
import { weightStyle } from '../_utils.js';
|
|
5
|
+
import { Checks } from './Checks.js';
|
|
6
|
+
import { ControlHint, ControlError } from './_field-parts.js';
|
|
7
|
+
import './CheckBox.css';
|
|
8
|
+
export function CheckBox({ value, defaultValue, label, disabled, checks, weight, hint, error, required, onChange: onChangeProp, }) {
|
|
9
|
+
const writeValue = useWriteBack('value');
|
|
10
|
+
const [internal, setInternal] = useState(value ?? defaultValue ?? false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (value === undefined)
|
|
13
|
+
return;
|
|
14
|
+
setInternal((current) => (current === value ? current : value));
|
|
15
|
+
}, [value]);
|
|
16
|
+
function onChange(e) {
|
|
17
|
+
const next = e.currentTarget.checked;
|
|
18
|
+
setInternal(next);
|
|
19
|
+
writeValue(next);
|
|
20
|
+
onChangeProp?.(next);
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs("div", { className: "oo-checkbox-field", style: weightStyle(weight), children: [_jsxs("label", { className: "oo-checkbox", "data-disabled": disabled ? 'true' : 'false', children: [_jsx("input", { type: "checkbox", checked: internal, disabled: disabled, onChange: onChange }), label ? (_jsxs("span", { children: [label, required ? _jsx("span", { className: "oo-field__required", children: "*" }) : null] })) : null] }), _jsx(ControlHint, { text: hint }), _jsx(ControlError, { text: error }), _jsx(Checks, { checks: checks })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './Checks.css';
|
|
2
|
+
export interface CheckRuleResolved {
|
|
3
|
+
condition: unknown;
|
|
4
|
+
message?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ChecksProps {
|
|
7
|
+
checks?: CheckRuleResolved[];
|
|
8
|
+
}
|
|
9
|
+
export declare function Checks({ checks }: ChecksProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './Checks.css';
|
|
3
|
+
export function Checks({ checks }) {
|
|
4
|
+
if (!checks || checks.length === 0)
|
|
5
|
+
return null;
|
|
6
|
+
const failed = checks.filter((c) => !c.condition);
|
|
7
|
+
if (failed.length === 0)
|
|
8
|
+
return null;
|
|
9
|
+
return (_jsx("div", { className: "oo-checks", children: failed.map((c, i) => (_jsx("div", { className: "oo-checks__item", children: c.message ?? 'invalid' }, i))) }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CheckRuleResolved } from './Checks.js';
|
|
2
|
+
import './ChoicePicker.css';
|
|
3
|
+
export type ChoiceOption = string | {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface ChoicePickerProps {
|
|
9
|
+
options?: ChoiceOption[];
|
|
10
|
+
value?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
displayStyle?: 'checkbox' | 'chips';
|
|
13
|
+
filterable?: boolean;
|
|
14
|
+
weight?: number;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
variant?: 'select' | 'radio';
|
|
18
|
+
checks?: CheckRuleResolved[];
|
|
19
|
+
hint?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
typeTag?: string;
|
|
23
|
+
onChange?: (next: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function ChoicePicker({ value, defaultValue, options, label, disabled, variant, displayStyle: _displayStyle, filterable, weight, checks, hint, error, required, typeTag, onChange: onChangeProp, }: ChoicePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useWriteBack } from '../../react/mount-context.js';
|
|
4
|
+
import { weightStyle } from '../_utils.js';
|
|
5
|
+
import { Checks } from './Checks.js';
|
|
6
|
+
import { ControlLabel, ControlHint, ControlError } from './_field-parts.js';
|
|
7
|
+
import './ChoicePicker.css';
|
|
8
|
+
function normalize(o) {
|
|
9
|
+
if (typeof o === 'string')
|
|
10
|
+
return { label: o, value: o };
|
|
11
|
+
return o;
|
|
12
|
+
}
|
|
13
|
+
export function ChoicePicker({ value, defaultValue, options = [], label, disabled, variant = 'select', displayStyle: _displayStyle, filterable, weight, checks, hint, error, required, typeTag, onChange: onChangeProp, }) {
|
|
14
|
+
// displayStyle is accepted for spec parity but visual treatment (chips
|
|
15
|
+
// rendering) is deferred to Group D rework.
|
|
16
|
+
void _displayStyle;
|
|
17
|
+
const writeValue = useWriteBack('value');
|
|
18
|
+
const opts = options.map(normalize);
|
|
19
|
+
const [internal, setInternal] = useState(value ?? defaultValue ?? opts[0]?.value ?? '');
|
|
20
|
+
const [filter, setFilter] = useState('');
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (value === undefined)
|
|
23
|
+
return;
|
|
24
|
+
setInternal((current) => (current === value ? current : value));
|
|
25
|
+
}, [value]);
|
|
26
|
+
function select(next) {
|
|
27
|
+
setInternal(next);
|
|
28
|
+
writeValue(next);
|
|
29
|
+
onChangeProp?.(next);
|
|
30
|
+
}
|
|
31
|
+
function onSelectChange(e) {
|
|
32
|
+
select(e.currentTarget.value);
|
|
33
|
+
}
|
|
34
|
+
const visibleOpts = filterable && filter
|
|
35
|
+
? opts.filter((o) => o.label.toLowerCase().includes(filter.toLowerCase()))
|
|
36
|
+
: opts;
|
|
37
|
+
return (_jsxs("label", { className: "oo-field", style: weightStyle(weight), children: [_jsx(ControlLabel, { label: label, required: required, typeTag: typeTag }), _jsx(ControlHint, { text: hint }), filterable ? (_jsx("div", { className: "oo-control", children: _jsx("input", { className: "oo-input", type: "search", placeholder: "Filter\u2026", value: filter, onChange: (e) => setFilter(e.currentTarget.value), disabled: disabled }) })) : null, variant === 'radio' ? (_jsx("div", { className: "oo-radios", children: visibleOpts.map((o) => (_jsxs("label", { className: "oo-radio", children: [_jsx("input", { type: "radio", value: o.value, checked: internal === o.value, disabled: disabled || o.disabled, onChange: () => select(o.value) }), _jsx("span", { children: o.label })] }, o.value))) })) : (_jsx("select", { className: "oo-select", value: internal, disabled: disabled, onChange: onSelectChange, children: visibleOpts.map((o) => (_jsx("option", { value: o.value, disabled: o.disabled, children: o.label }, o.value))) })), _jsx(ControlError, { text: error }), _jsx(Checks, { checks: checks })] }));
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* DateTimeInput reuses .oo-field + .oo-input from the shared input rules. */
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CheckRuleResolved } from './Checks.js';
|
|
2
|
+
import './DateTimeInput.css';
|
|
3
|
+
import './TextField.css';
|
|
4
|
+
export interface DateTimeInputProps {
|
|
5
|
+
value?: string;
|
|
6
|
+
enableDate?: boolean;
|
|
7
|
+
enableTime?: boolean;
|
|
8
|
+
label?: string;
|
|
9
|
+
min?: string;
|
|
10
|
+
max?: string;
|
|
11
|
+
weight?: number;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
mode?: 'date' | 'time' | 'datetime';
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
checks?: CheckRuleResolved[];
|
|
16
|
+
hint?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
typeTag?: string;
|
|
20
|
+
onChange?: (next: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function DateTimeInput({ value, defaultValue, mode, enableDate, enableTime, min, max, label, disabled, weight, checks, hint, error, required, typeTag, onChange: onChangeProp, }: DateTimeInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useWriteBack } from '../../react/mount-context.js';
|
|
4
|
+
import { weightStyle } from '../_utils.js';
|
|
5
|
+
import { Checks } from './Checks.js';
|
|
6
|
+
import { ControlLabel, ControlHint, ControlError } from './_field-parts.js';
|
|
7
|
+
import './DateTimeInput.css';
|
|
8
|
+
// DateTimeInput reuses .oo-field + .oo-input from TextField's CSS.
|
|
9
|
+
import './TextField.css';
|
|
10
|
+
function deriveType(opts) {
|
|
11
|
+
if (opts.mode === 'date')
|
|
12
|
+
return 'date';
|
|
13
|
+
if (opts.mode === 'time')
|
|
14
|
+
return 'time';
|
|
15
|
+
if (opts.mode === 'datetime')
|
|
16
|
+
return 'datetime-local';
|
|
17
|
+
// From enableDate / enableTime per spec:
|
|
18
|
+
if (opts.enableDate && opts.enableTime)
|
|
19
|
+
return 'datetime-local';
|
|
20
|
+
if (opts.enableTime)
|
|
21
|
+
return 'time';
|
|
22
|
+
if (opts.enableDate)
|
|
23
|
+
return 'date';
|
|
24
|
+
return 'datetime-local'; // sensible scena fallback
|
|
25
|
+
}
|
|
26
|
+
export function DateTimeInput({ value, defaultValue, mode, enableDate, enableTime, min, max, label, disabled, weight, checks, hint, error, required, typeTag, onChange: onChangeProp, }) {
|
|
27
|
+
const writeValue = useWriteBack('value');
|
|
28
|
+
const [internal, setInternal] = useState(value ?? defaultValue ?? '');
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (value === undefined)
|
|
31
|
+
return;
|
|
32
|
+
setInternal((current) => (current === value ? current : value));
|
|
33
|
+
}, [value]);
|
|
34
|
+
function onChange(e) {
|
|
35
|
+
const next = e.currentTarget.value;
|
|
36
|
+
setInternal(next);
|
|
37
|
+
writeValue(next);
|
|
38
|
+
onChangeProp?.(next);
|
|
39
|
+
}
|
|
40
|
+
return (_jsxs("label", { className: "oo-field", style: weightStyle(weight), children: [_jsx(ControlLabel, { label: label, required: required, typeTag: typeTag }), _jsx(ControlHint, { text: hint }), _jsx("div", { className: "oo-control", children: _jsx("input", { className: "oo-input", type: deriveType({ mode, enableDate, enableTime }), value: internal, min: min, max: max, disabled: disabled, onChange: onChange }) }), _jsx(ControlError, { text: error }), _jsx(Checks, { checks: checks })] }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.oo-locale-toggle {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
font-size: 13px;
|
|
6
|
+
line-height: 1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.oo-locale-toggle__sep {
|
|
10
|
+
color: var(--oo-color-muted, #8a8f98);
|
|
11
|
+
opacity: 0.4;
|
|
12
|
+
user-select: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.oo-locale-toggle__item {
|
|
16
|
+
appearance: none;
|
|
17
|
+
background: none;
|
|
18
|
+
border: none;
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 2px 4px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
font: inherit;
|
|
23
|
+
color: var(--oo-color-muted, #8a8f98);
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
transition: color 0.12s ease;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.oo-locale-toggle__item:hover {
|
|
29
|
+
color: var(--oo-color-text, #e6e8eb);
|
|
30
|
+
background: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.oo-locale-toggle__item--active {
|
|
34
|
+
/* color: var(--oo-color-text, #e6e8eb); */
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
/* box-shadow: inset 0 -2px 0 var(--oo-color-accent, #4c7fff); */
|
|
37
|
+
color: var(--oo-color-accent, #4c7fff);
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import './LocaleToggle.css';
|
|
3
|
+
export type LocaleToggleDisplay = 'text' | 'emoji' | 'both';
|
|
4
|
+
export interface LocaleToggleProps {
|
|
5
|
+
display?: LocaleToggleDisplay;
|
|
6
|
+
locales?: string[];
|
|
7
|
+
separator?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
export declare function LocaleToggle({ display, locales, separator, className, style, }: LocaleToggleProps): ReactNode;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { useI18n } from '../../react/hooks/useI18n.js';
|
|
4
|
+
import './LocaleToggle.css';
|
|
5
|
+
// A configurable language switcher. Reads the registered locales + active
|
|
6
|
+
// locale from the i18n registry (useI18n); clicking sets the locale, which
|
|
7
|
+
// re-renders every translated view. The active locale gets an accent.
|
|
8
|
+
export function LocaleToggle({ display = 'text', locales, separator = '|', className, style, }) {
|
|
9
|
+
const { locale: current, locales: all, setLocale } = useI18n();
|
|
10
|
+
const items = locales
|
|
11
|
+
? locales.map((l) => all.find((i) => i.locale === l)).filter(Boolean)
|
|
12
|
+
: all;
|
|
13
|
+
return (_jsx("div", { className: ['oo-locale-toggle', className].filter(Boolean).join(' '), style: style, role: "group", children: items.map((info, i) => (_jsxs(Fragment, { children: [i > 0 && separator != null ? (_jsx("span", { className: "oo-locale-toggle__sep", "aria-hidden": "true", children: separator })) : null, _jsx("button", { type: "button", className: 'oo-locale-toggle__item' +
|
|
14
|
+
(info.locale === current ? ' oo-locale-toggle__item--active' : ''), "aria-pressed": info.locale === current, title: info.name ?? info.locale, onClick: () => setLocale(info.locale), children: labelFor(info, display) })] }, info.locale))) }));
|
|
15
|
+
}
|
|
16
|
+
function labelFor(info, display) {
|
|
17
|
+
const text = (info.language ?? info.locale).toUpperCase();
|
|
18
|
+
if (display === 'emoji')
|
|
19
|
+
return info.emoji ?? text;
|
|
20
|
+
if (display === 'both')
|
|
21
|
+
return info.emoji ? `${info.emoji} ${text}` : text;
|
|
22
|
+
return text;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from './Button.js';
|
|
3
|
+
import { useI18n } from '../../react/hooks/useI18n.js';
|
|
4
|
+
// One consistent reload affordance for detail headers: an icon button with a
|
|
5
|
+
// tooltip. Use everywhere instead of hand-rolling a per-resource button.
|
|
6
|
+
export function ReloadButton({ onClick, title }) {
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
return _jsx(Button, { title: title ?? t('common/reload', 'Reload'), label: "\u27F3", variant: "ghost", onClick: onClick });
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CheckRuleResolved } from './Checks.js';
|
|
2
|
+
import './Slider.css';
|
|
3
|
+
export interface SliderProps {
|
|
4
|
+
value?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
min?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
weight?: number;
|
|
10
|
+
defaultValue?: number;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
checks?: CheckRuleResolved[];
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
hint?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
typeTag?: string;
|
|
19
|
+
onChange?: (next: number) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function Slider({ value, defaultValue, min, max, step, label, disabled, showValue, weight, checks, style, hint, error, required, typeTag, onChange: onChangeProp, }: SliderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useWriteBack } from '../../react/mount-context.js';
|
|
4
|
+
import { weightStyle } from '../_utils.js';
|
|
5
|
+
import { Checks } from './Checks.js';
|
|
6
|
+
import { ControlLabel, ControlHint, ControlError } from './_field-parts.js';
|
|
7
|
+
import './Slider.css';
|
|
8
|
+
export function Slider({ value, defaultValue, min = 0, max = 100, step = 1, label, disabled, showValue = true, weight, checks, style, hint, error, required, typeTag, onChange: onChangeProp, }) {
|
|
9
|
+
const writeValue = useWriteBack('value');
|
|
10
|
+
const [internal, setInternal] = useState(value ?? defaultValue ?? min);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (value === undefined)
|
|
13
|
+
return;
|
|
14
|
+
setInternal((current) => (current === value ? current : value));
|
|
15
|
+
}, [value]);
|
|
16
|
+
function onChange(e) {
|
|
17
|
+
const next = Number(e.currentTarget.value);
|
|
18
|
+
setInternal(next);
|
|
19
|
+
writeValue(next);
|
|
20
|
+
onChangeProp?.(next);
|
|
21
|
+
}
|
|
22
|
+
// function stepFromSegments(min: number, max: number, segments: number): number {
|
|
23
|
+
// const delta = max - min;
|
|
24
|
+
// if (!Number.isFinite(delta) || delta <= 0) return 1;
|
|
25
|
+
// if (!Number.isFinite(segments) || segments <= 0) return 1;
|
|
26
|
+
// return delta / segments;
|
|
27
|
+
// }
|
|
28
|
+
const rawMin = Number(min);
|
|
29
|
+
const rawMax = Number(max);
|
|
30
|
+
const defmin = Number.isFinite(rawMin) ? rawMin : 0;
|
|
31
|
+
const defmax = Number.isFinite(rawMax) ? Math.max(defmin + 1, rawMax) : defmin + 100;
|
|
32
|
+
const defStep = typeof step === 'number' && Number.isFinite(step) && step > 0
|
|
33
|
+
? step
|
|
34
|
+
: 1;
|
|
35
|
+
const htmlStep = Math.min(defStep, Math.min(defmax - defmin, 1));
|
|
36
|
+
return (_jsxs("label", { className: "oo-field", style: weightStyle(weight), children: [_jsx(ControlLabel, { label: label, required: required, typeTag: typeTag, extra: showValue ? _jsx("span", { className: "oo-slider__value", children: internal }) : null }), _jsx(ControlHint, { text: hint }), _jsx("div", { className: "oo-control", children: _jsx("input", { className: "oo-slider", type: "range", value: internal, min: min, max: max, step: htmlStep, disabled: disabled, onChange: onChange, style: style }) }), _jsx(ControlError, { text: error }), _jsx(Checks, { checks: checks })] }));
|
|
37
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CheckRuleResolved } from './Checks.js';
|
|
2
|
+
import './TextField.css';
|
|
3
|
+
export type InputType = React.HTMLInputTypeAttribute;
|
|
4
|
+
export interface TextFieldProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
weight?: number;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
type?: InputType;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
multiline?: boolean;
|
|
15
|
+
rows?: number;
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
checks?: CheckRuleResolved[];
|
|
19
|
+
hint?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
typeTag?: string;
|
|
23
|
+
onChange?: (next: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function TextField({ value, defaultValue, placeholder, label, type, disabled, readOnly, multiline, rows, min, max, checks, weight, hint, error, required, typeTag, onChange: onChangeProp, }: TextFieldProps): import("react").JSX.Element;
|