@jcsoftdev/ui 0.2.3 → 0.4.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/CHANGELOG.md +390 -7
- package/README.md +57 -3
- package/bin/ui-theme.mjs +1162 -25
- package/dist/ai/attachment/attachment.js +1 -1
- package/dist/ai/chat-list/group.js +3 -1
- package/dist/ai/conversation/conversation.js +1 -1
- package/dist/ai/internal/use-copy.d.ts +1 -5
- package/dist/ai/internal/use-copy.js +1 -32
- package/dist/ai/markdown/parse.js +59 -17
- package/dist/ai/source/source.js +1 -1
- package/dist/atoms/avatar/avatar.d.ts +13 -3
- package/dist/atoms/avatar/avatar.js +40 -2
- package/dist/atoms/avatar/index.d.ts +1 -1
- package/dist/atoms/avatar/index.js +3 -1
- package/dist/atoms/button/button.d.ts +4 -1
- package/dist/atoms/button/button.js +4 -2
- package/dist/atoms/checkbox/checkbox.d.ts +8 -3
- package/dist/atoms/checkbox/checkbox.js +26 -3
- package/dist/atoms/chip/chip.d.ts +19 -5
- package/dist/atoms/chip/chip.js +34 -5
- package/dist/atoms/chip/index.d.ts +1 -1
- package/dist/atoms/chip/index.js +6 -1
- package/dist/atoms/due-chip/due-chip.d.ts +31 -0
- package/dist/atoms/due-chip/due-chip.js +41 -0
- package/dist/atoms/due-chip/index.d.ts +2 -0
- package/dist/atoms/due-chip/index.js +6 -0
- package/dist/atoms/due-chip/model.d.ts +25 -0
- package/dist/atoms/due-chip/model.js +44 -0
- package/dist/atoms/icon-button/icon-button.d.ts +22 -0
- package/dist/atoms/icon-button/icon-button.js +38 -0
- package/dist/atoms/icon-button/index.d.ts +1 -0
- package/dist/atoms/icon-button/index.js +8 -0
- package/dist/atoms/index.d.ts +5 -0
- package/dist/atoms/index.js +5 -0
- package/dist/atoms/internal/hit-area.d.ts +6 -0
- package/dist/atoms/internal/hit-area.js +4 -0
- package/dist/atoms/kbd/index.d.ts +1 -0
- package/dist/atoms/kbd/index.js +4 -0
- package/dist/atoms/kbd/kbd.d.ts +7 -0
- package/dist/atoms/kbd/kbd.js +17 -0
- package/dist/atoms/radio-group/radio-group.js +6 -2
- package/dist/atoms/seal/index.d.ts +1 -0
- package/dist/atoms/seal/index.js +4 -0
- package/dist/atoms/seal/seal.d.ts +30 -0
- package/dist/atoms/seal/seal.js +71 -0
- package/dist/atoms/spinner/index.d.ts +1 -0
- package/dist/atoms/spinner/index.js +5 -0
- package/dist/atoms/spinner/spinner.d.ts +19 -0
- package/dist/atoms/spinner/spinner.js +31 -0
- package/dist/atoms/status-dot/index.d.ts +1 -1
- package/dist/atoms/status-dot/status-dot.d.ts +4 -2
- package/dist/atoms/status-dot/status-dot.js +5 -1
- package/dist/atoms/switch/switch.js +3 -1
- package/dist/calendar/date-calendar/date-calendar.d.ts +32 -0
- package/dist/calendar/date-calendar/date-calendar.js +189 -0
- package/dist/calendar/date-calendar/index.d.ts +1 -0
- package/dist/calendar/date-calendar/index.js +6 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +1 -0
- package/dist/calendar/internal/date-utils.d.ts +26 -0
- package/dist/calendar/internal/date-utils.js +95 -1
- package/dist/charts/bar-chart/bar-race-chart.js +1 -0
- package/dist/charts/beeswarm-chart/beeswarm-chart.js +1 -1
- package/dist/charts/chord-chart/chord-chart.js +13 -5
- package/dist/charts/core/cartesian/cartesian-chart.d.ts +1 -1
- package/dist/charts/core/cartesian/cartesian-chart.js +48 -11
- package/dist/charts/core/cartesian/layout.d.ts +6 -1
- package/dist/charts/core/cartesian/layout.js +14 -5
- package/dist/charts/core/cartesian/marks.d.ts +2 -2
- package/dist/charts/core/cartesian/marks.js +1 -1
- package/dist/charts/core/cartesian/types.d.ts +28 -2
- package/dist/charts/core/category-explorer.d.ts +2 -2
- package/dist/charts/core/category-explorer.js +8 -4
- package/dist/charts/core/chart-dock.d.ts +26 -0
- package/dist/charts/core/chart-dock.js +45 -0
- package/dist/charts/core/chart-frame.d.ts +9 -2
- package/dist/charts/core/chart-frame.js +105 -25
- package/dist/charts/core/distribution/explorer.d.ts +5 -2
- package/dist/charts/core/distribution/explorer.js +12 -5
- package/dist/charts/core/distribution/xy-points.js +1 -1
- package/dist/charts/core/index.d.ts +3 -0
- package/dist/charts/core/index.js +3 -0
- package/dist/charts/core/leave-grace.d.ts +11 -0
- package/dist/charts/core/leave-grace.js +26 -0
- package/dist/charts/core/nearest.d.ts +14 -0
- package/dist/charts/core/nearest.js +22 -0
- package/dist/charts/core/plot-overlay.js +9 -3
- package/dist/charts/core/pointer.test-utils.d.ts +38 -0
- package/dist/charts/core/pointer.test-utils.js +123 -0
- package/dist/charts/core/tooltip.d.ts +25 -2
- package/dist/charts/core/tooltip.js +115 -40
- package/dist/charts/core/touch-select.d.ts +20 -0
- package/dist/charts/core/touch-select.js +184 -0
- package/dist/charts/core/types.d.ts +8 -4
- package/dist/charts/core/types.js +5 -0
- package/dist/charts/core/use-index-navigation.d.ts +17 -6
- package/dist/charts/core/use-index-navigation.js +47 -10
- package/dist/charts/donut-chart/donut-chart.d.ts +5 -1
- package/dist/charts/donut-chart/donut-chart.js +40 -1
- package/dist/charts/donut-chart/slice-labels.d.ts +20 -0
- package/dist/charts/donut-chart/slice-labels.js +20 -0
- package/dist/charts/dumbbell-chart/dumbbell-chart.js +6 -3
- package/dist/charts/fill-gauge-chart/fill-gauge-chart.js +1 -0
- package/dist/charts/funnel-chart/funnel-chart.js +2 -1
- package/dist/charts/gauge-chart/gauge-chart.js +2 -1
- package/dist/charts/heatmap-chart/heatmap-chart.d.ts +4 -1
- package/dist/charts/heatmap-chart/heatmap-chart.js +3 -1
- package/dist/charts/heatmap-chart/heatmap-grid.d.ts +4 -1
- package/dist/charts/heatmap-chart/heatmap-grid.js +3 -1
- package/dist/charts/hex-tile-map/hex-tile-map.js +124 -115
- package/dist/charts/hierarchy-morph/hierarchy-morph.js +2 -1
- package/dist/charts/icicle-chart/icicle-chart.js +7 -9
- package/dist/charts/lollipop-chart/lollipop-chart.js +6 -3
- package/dist/charts/maps/geo/map-viewport.js +1 -1
- package/dist/charts/polar-area-chart/polar-area-chart.js +42 -12
- package/dist/charts/progress-units/progress-units.js +1 -0
- package/dist/charts/radar-chart/radar-chart.js +1 -1
- package/dist/charts/radial-bar-chart/radial-bar-chart.js +2 -1
- package/dist/charts/range-area-chart/range-area-chart.js +3 -2
- package/dist/charts/sankey-chart/sankey-chart.js +12 -4
- package/dist/charts/tree-chart/tree-chart.js +1 -0
- package/dist/charts/treemap-chart/treemap-chart.js +2 -7
- package/dist/charts/waterfall-chart/waterfall-chart.js +6 -3
- package/dist/containers/action-bar/action-bar.d.ts +11 -2
- package/dist/containers/action-bar/action-bar.js +4 -1
- package/dist/containers/aside/aside.d.ts +14 -0
- package/dist/containers/aside/aside.js +25 -0
- package/dist/containers/aside/index.d.ts +1 -0
- package/dist/containers/aside/index.js +5 -0
- package/dist/containers/banner/banner.d.ts +4 -1
- package/dist/containers/banner/banner.js +9 -1
- package/dist/containers/card/card.d.ts +21 -3
- package/dist/containers/card/card.js +20 -5
- package/dist/containers/description-list/description-list.d.ts +29 -6
- package/dist/containers/description-list/description-list.js +47 -6
- package/dist/containers/feed/feed.d.ts +23 -0
- package/dist/containers/feed/feed.js +77 -0
- package/dist/containers/feed/index.d.ts +2 -0
- package/dist/containers/feed/index.js +10 -0
- package/dist/containers/feed/model.d.ts +19 -0
- package/dist/containers/feed/model.js +38 -0
- package/dist/containers/grid/grid.d.ts +15 -0
- package/dist/containers/grid/grid.js +24 -0
- package/dist/containers/grid/index.d.ts +1 -0
- package/dist/containers/grid/index.js +4 -0
- package/dist/containers/index.d.ts +9 -0
- package/dist/containers/index.js +9 -0
- package/dist/containers/kpi/kpi.d.ts +60 -7
- package/dist/containers/kpi/kpi.js +142 -28
- package/dist/containers/kpi-group/index.d.ts +1 -1
- package/dist/containers/kpi-group/index.js +3 -1
- package/dist/containers/kpi-group/kpi-group.d.ts +9 -1
- package/dist/containers/kpi-group/kpi-group.js +11 -1
- package/dist/containers/list-detail/index.d.ts +1 -0
- package/dist/containers/list-detail/index.js +20 -0
- package/dist/containers/list-detail/list-detail.d.ts +55 -0
- package/dist/containers/list-detail/list-detail.js +221 -0
- package/dist/containers/note/index.d.ts +1 -0
- package/dist/containers/note/index.js +4 -0
- package/dist/containers/note/note.d.ts +13 -0
- package/dist/containers/note/note.js +27 -0
- package/dist/containers/page/index.d.ts +1 -0
- package/dist/containers/page/index.js +4 -0
- package/dist/containers/page/page.d.ts +7 -0
- package/dist/containers/page/page.js +14 -0
- package/dist/containers/page-header/page-header.d.ts +8 -3
- package/dist/containers/page-header/page-header.js +35 -8
- package/dist/containers/responsive-list/responsive-list.d.ts +1 -1
- package/dist/containers/responsive-list/responsive-list.js +6 -3
- package/dist/containers/section/index.d.ts +1 -0
- package/dist/containers/section/index.js +6 -0
- package/dist/containers/section/section.d.ts +68 -0
- package/dist/containers/section/section.js +198 -0
- package/dist/containers/shortcuts/index.d.ts +1 -0
- package/dist/containers/shortcuts/index.js +8 -0
- package/dist/containers/shortcuts/shortcuts.d.ts +18 -0
- package/dist/containers/shortcuts/shortcuts.js +50 -0
- package/dist/containers/stack/index.d.ts +1 -0
- package/dist/containers/stack/index.js +6 -0
- package/dist/containers/stack/stack.d.ts +15 -0
- package/dist/containers/stack/stack.js +43 -0
- package/dist/containers/table/selection.d.ts +9 -0
- package/dist/containers/table/selection.js +20 -0
- package/dist/containers/table/table.d.ts +66 -4
- package/dist/containers/table/table.js +128 -7
- package/dist/containers/timeline/index.d.ts +1 -1
- package/dist/containers/timeline/index.js +4 -2
- package/dist/containers/timeline/timeline.d.ts +32 -5
- package/dist/containers/timeline/timeline.js +154 -90
- package/dist/forms/chip-group/chip-group.d.ts +54 -0
- package/dist/forms/chip-group/chip-group.js +114 -0
- package/dist/forms/chip-group/index.d.ts +1 -0
- package/dist/forms/chip-group/index.js +6 -0
- package/dist/forms/combobox/combobox.d.ts +60 -0
- package/dist/forms/combobox/combobox.js +281 -0
- package/dist/forms/combobox/index.d.ts +1 -0
- package/dist/forms/combobox/index.js +6 -0
- package/dist/forms/copy-field/copy-field.d.ts +17 -0
- package/dist/forms/copy-field/copy-field.js +72 -0
- package/dist/forms/copy-field/index.d.ts +1 -0
- package/dist/forms/copy-field/index.js +4 -0
- package/dist/forms/date-picker/date-picker.d.ts +40 -0
- package/dist/forms/date-picker/date-picker.js +183 -0
- package/dist/forms/date-picker/date-time-picker.d.ts +43 -0
- package/dist/forms/date-picker/date-time-picker.js +121 -0
- package/dist/forms/date-picker/index.d.ts +2 -0
- package/dist/forms/date-picker/index.js +10 -0
- package/dist/forms/date-picker/model.d.ts +35 -0
- package/dist/forms/date-picker/model.js +83 -0
- package/dist/forms/dropzone/dropzone.d.ts +30 -2
- package/dist/forms/dropzone/dropzone.js +153 -23
- package/dist/forms/emoji-picker/emoji-picker.js +1 -1
- package/dist/forms/field/field.d.ts +16 -10
- package/dist/forms/field/field.js +41 -5
- package/dist/forms/form/form.d.ts +15 -0
- package/dist/forms/form/form.js +29 -0
- package/dist/forms/form/index.d.ts +1 -0
- package/dist/forms/form/index.js +10 -0
- package/dist/forms/index.d.ts +6 -0
- package/dist/forms/index.js +6 -0
- package/dist/forms/input/index.d.ts +1 -1
- package/dist/forms/input/index.js +6 -2
- package/dist/forms/input/input.d.ts +23 -3
- package/dist/forms/input/input.js +78 -7
- package/dist/forms/input-icon/input-icon.d.ts +1 -1
- package/dist/forms/internal/listbox-items.d.ts +18 -0
- package/dist/forms/internal/listbox-items.js +88 -0
- package/dist/forms/internal/listbox.d.ts +44 -0
- package/dist/forms/internal/listbox.js +74 -0
- package/dist/forms/number-stepper/model.d.ts +16 -0
- package/dist/forms/number-stepper/model.js +23 -0
- package/dist/forms/number-stepper/number-stepper.d.ts +36 -6
- package/dist/forms/number-stepper/number-stepper.js +86 -37
- package/dist/forms/select-menu/index.d.ts +1 -0
- package/dist/forms/select-menu/index.js +6 -0
- package/dist/forms/select-menu/select-menu.d.ts +35 -0
- package/dist/forms/select-menu/select-menu.js +230 -0
- package/dist/glass/crystal-map.d.ts +70 -0
- package/dist/glass/crystal-map.js +88 -0
- package/dist/glass/displacement-map.d.ts +117 -0
- package/dist/glass/displacement-map.js +201 -0
- package/dist/glass/index.d.ts +8 -0
- package/dist/glass/index.js +63 -0
- package/dist/glass/lens-crystal.d.ts +29 -0
- package/dist/glass/lens-crystal.js +161 -0
- package/dist/glass/lens-dispersion.d.ts +11 -0
- package/dist/glass/lens-dispersion.js +19 -0
- package/dist/glass/liquid-glass.d.ts +41 -0
- package/dist/glass/liquid-glass.js +256 -0
- package/dist/glass/liquid-motion.d.ts +53 -0
- package/dist/glass/liquid-motion.js +302 -0
- package/dist/glass/liquid-options.d.ts +162 -0
- package/dist/glass/liquid-options.js +179 -0
- package/dist/glass/refraction.d.ts +100 -0
- package/dist/glass/refraction.js +714 -0
- package/dist/glass/specular-map.d.ts +26 -0
- package/dist/glass/specular-map.js +75 -0
- package/dist/glass/spring.d.ts +79 -0
- package/dist/glass/spring.js +58 -0
- package/dist/glass/support.d.ts +13 -0
- package/dist/glass/support.js +14 -0
- package/dist/glass/use-glass-refraction.d.ts +8 -0
- package/dist/glass/use-glass-refraction.js +16 -0
- package/dist/i18n/strings.d.ts +113 -0
- package/dist/i18n/strings.js +70 -2
- package/dist/i18n/ui-strings-provider.d.ts +1 -1
- package/dist/i18n/ui-strings-provider.js +6 -2
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +4 -0
- package/dist/icons/key.d.ts +2 -0
- package/dist/icons/key.js +12 -0
- package/dist/icons/webhook.d.ts +2 -0
- package/dist/icons/webhook.js +12 -0
- package/dist/liquid/index.d.ts +3 -0
- package/dist/liquid/index.js +29 -0
- package/dist/navigation/breadcrumbs/breadcrumbs.d.ts +29 -0
- package/dist/navigation/breadcrumbs/breadcrumbs.js +70 -0
- package/dist/navigation/breadcrumbs/index.d.ts +1 -0
- package/dist/navigation/breadcrumbs/index.js +6 -0
- package/dist/navigation/index.d.ts +2 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/segmented/index.d.ts +1 -1
- package/dist/navigation/segmented/model.d.ts +5 -0
- package/dist/navigation/segmented/model.js +6 -0
- package/dist/navigation/segmented/segmented.d.ts +17 -3
- package/dist/navigation/segmented/segmented.js +20 -4
- package/dist/navigation/stepper/index.d.ts +1 -1
- package/dist/navigation/stepper/index.js +3 -1
- package/dist/navigation/stepper/stepper.d.ts +8 -0
- package/dist/navigation/stepper/stepper.js +68 -45
- package/dist/navigation/tabs/index.d.ts +1 -0
- package/dist/navigation/tabs/index.js +6 -0
- package/dist/navigation/tabs/tabs-nav.d.ts +37 -0
- package/dist/navigation/tabs/tabs-nav.js +57 -0
- package/dist/navigation/wizard/index.d.ts +1 -0
- package/dist/navigation/wizard/index.js +6 -0
- package/dist/navigation/wizard/model.d.ts +33 -0
- package/dist/navigation/wizard/model.js +34 -0
- package/dist/navigation/wizard/wizard.d.ts +45 -0
- package/dist/navigation/wizard/wizard.js +169 -0
- package/dist/overlays/alert-dialog/alert-dialog.d.ts +103 -0
- package/dist/overlays/alert-dialog/alert-dialog.js +342 -0
- package/dist/overlays/alert-dialog/index.d.ts +1 -0
- package/dist/overlays/alert-dialog/index.js +26 -0
- package/dist/overlays/context-menu/context-menu.d.ts +9 -1
- package/dist/overlays/context-menu/context-menu.js +4 -1
- package/dist/overlays/dialog/dialog.d.ts +9 -1
- package/dist/overlays/dialog/dialog.js +3 -0
- package/dist/overlays/drawer/drawer.d.ts +9 -1
- package/dist/overlays/drawer/drawer.js +3 -0
- package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +25 -1
- package/dist/overlays/dropdown-menu/dropdown-menu.js +14 -4
- package/dist/overlays/dropdown-menu/index.d.ts +1 -1
- package/dist/overlays/dropdown-menu/index.js +8 -2
- package/dist/overlays/hover-card/hover-card.d.ts +10 -1
- package/dist/overlays/hover-card/hover-card.js +4 -1
- package/dist/overlays/index.d.ts +2 -0
- package/dist/overlays/index.js +2 -0
- package/dist/overlays/popover/popover.d.ts +9 -1
- package/dist/overlays/popover/popover.js +3 -0
- package/dist/overlays/testing/index.d.ts +5 -0
- package/dist/overlays/testing/index.js +4 -0
- package/dist/overlays/toaster/index.d.ts +2 -1
- package/dist/overlays/toaster/index.js +4 -2
- package/dist/overlays/toaster/toast-store.d.ts +6 -2
- package/dist/overlays/toaster/toast.d.ts +3 -0
- package/dist/overlays/toaster/toast.js +3 -0
- package/dist/overlays/toaster/toaster.d.ts +3 -0
- package/dist/overlays/toaster/toaster.js +36 -3
- package/dist/overlays/tooltip/index.d.ts +1 -0
- package/dist/overlays/tooltip/index.js +4 -0
- package/dist/overlays/tooltip/model.d.ts +10 -0
- package/dist/overlays/tooltip/model.js +13 -0
- package/dist/overlays/tooltip/tooltip.d.ts +41 -0
- package/dist/overlays/tooltip/tooltip.js +116 -0
- package/dist/palette/command-palette/command-palette.d.ts +12 -2
- package/dist/palette/command-palette/command-palette.js +5 -0
- package/dist/primitives/command/command.d.ts +3 -2
- package/dist/primitives/command/command.js +2 -0
- package/dist/primitives/menu/menu.js +1 -1
- package/dist/primitives/popper/popper.js +5 -0
- package/dist/primitives/use-dismissable-layer.js +1 -1
- package/dist/rich-text/rich-text-editor.js +94 -8
- package/dist/rich-text/sanitize.js +70 -20
- package/dist/shell/app-shell/app-shell.d.ts +17 -0
- package/dist/shell/app-shell/app-shell.js +44 -4
- package/dist/shell/bottom-nav/bottom-nav.d.ts +34 -0
- package/dist/shell/bottom-nav/bottom-nav.js +124 -0
- package/dist/shell/bottom-nav/index.d.ts +2 -0
- package/dist/shell/bottom-nav/index.js +9 -0
- package/dist/shell/bottom-nav/split.d.ts +11 -0
- package/dist/shell/bottom-nav/split.js +10 -0
- package/dist/shell/sidebar/sidebar.d.ts +16 -2
- package/dist/shell/sidebar/sidebar.js +46 -4
- package/dist/shell/topbar/topbar.d.ts +20 -9
- package/dist/shell/topbar/topbar.js +16 -9
- package/dist/states/empty-state/empty-state.d.ts +3 -1
- package/dist/states/empty-state/empty-state.js +9 -1
- package/dist/states/error-state/error-state.d.ts +8 -1
- package/dist/states/error-state/error-state.js +15 -9
- package/dist/states/index.d.ts +1 -0
- package/dist/states/index.js +1 -0
- package/dist/states/live-status-bar/index.d.ts +1 -0
- package/dist/states/live-status-bar/index.js +6 -0
- package/dist/states/live-status-bar/live-status-bar.d.ts +17 -0
- package/dist/states/live-status-bar/live-status-bar.js +49 -0
- package/dist/states/offline-banner/offline-banner.d.ts +3 -1
- package/dist/states/offline-banner/offline-banner.js +8 -4
- package/dist/states/skeleton/skeleton.d.ts +8 -2
- package/dist/states/skeleton/skeleton.js +44 -2
- package/dist/utils/class-groups.js +17 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/material.d.ts +13 -0
- package/dist/utils/material.js +6 -0
- package/dist/utils/tone.d.ts +8 -0
- package/dist/utils/tone.js +17 -0
- package/dist/utils/use-copy.d.ts +5 -0
- package/dist/utils/use-copy.js +35 -0
- package/icons/svg/key.svg +5 -0
- package/icons/svg/webhook.svg +5 -0
- package/package.json +31 -21
- package/scripts/build-theme.d.mts +22 -0
- package/scripts/build-theme.mjs +248 -5
- package/src/ai/attachment/attachment.tsx +1 -1
- package/src/ai/chat-list/group.ts +3 -1
- package/src/ai/conversation/conversation.tsx +1 -1
- package/src/ai/internal/use-copy.ts +1 -38
- package/src/ai/markdown/parse.ts +74 -17
- package/src/ai/source/source.tsx +1 -1
- package/src/atoms/avatar/avatar.tsx +57 -4
- package/src/atoms/avatar/index.ts +8 -1
- package/src/atoms/button/button.tsx +8 -3
- package/src/atoms/checkbox/checkbox.tsx +33 -4
- package/src/atoms/chip/chip.tsx +55 -8
- package/src/atoms/chip/index.ts +9 -1
- package/src/atoms/due-chip/due-chip.tsx +75 -0
- package/src/atoms/due-chip/index.ts +2 -0
- package/src/atoms/due-chip/model.ts +67 -0
- package/src/atoms/icon-button/icon-button.tsx +58 -0
- package/src/atoms/icon-button/index.ts +6 -0
- package/src/atoms/index.ts +5 -0
- package/src/atoms/internal/hit-area.ts +7 -0
- package/src/atoms/kbd/index.ts +1 -0
- package/src/atoms/kbd/kbd.tsx +20 -0
- package/src/atoms/radio-group/radio-group.tsx +8 -2
- package/src/atoms/seal/index.ts +1 -0
- package/src/atoms/seal/seal.tsx +107 -0
- package/src/atoms/spinner/index.ts +1 -0
- package/src/atoms/spinner/spinner.tsx +49 -0
- package/src/atoms/status-dot/index.ts +1 -0
- package/src/atoms/status-dot/status-dot.tsx +15 -3
- package/src/atoms/switch/switch.tsx +3 -1
- package/src/calendar/date-calendar/date-calendar.tsx +230 -0
- package/src/calendar/date-calendar/index.ts +5 -0
- package/src/calendar/index.ts +1 -0
- package/src/calendar/internal/date-utils.ts +115 -0
- package/src/charts/README.md +21 -0
- package/src/charts/bar-chart/bar-race-chart.tsx +1 -0
- package/src/charts/beeswarm-chart/beeswarm-chart.tsx +1 -1
- package/src/charts/chord-chart/chord-chart.tsx +13 -5
- package/src/charts/core/cartesian/cartesian-chart.tsx +55 -10
- package/src/charts/core/cartesian/layout.ts +29 -10
- package/src/charts/core/cartesian/marks.tsx +3 -3
- package/src/charts/core/cartesian/types.ts +30 -2
- package/src/charts/core/category-explorer.tsx +12 -6
- package/src/charts/core/chart-dock.tsx +68 -0
- package/src/charts/core/chart-frame.tsx +116 -27
- package/src/charts/core/distribution/explorer.tsx +17 -7
- package/src/charts/core/distribution/xy-points.tsx +1 -1
- package/src/charts/core/index.ts +3 -0
- package/src/charts/core/leave-grace.ts +35 -0
- package/src/charts/core/nearest.ts +38 -0
- package/src/charts/core/plot-overlay.tsx +9 -3
- package/src/charts/core/pointer.test-utils.ts +146 -0
- package/src/charts/core/tooltip.tsx +129 -15
- package/src/charts/core/touch-select.ts +250 -0
- package/src/charts/core/types.ts +13 -4
- package/src/charts/core/use-index-navigation.ts +70 -11
- package/src/charts/donut-chart/donut-chart.tsx +53 -3
- package/src/charts/donut-chart/slice-labels.ts +39 -0
- package/src/charts/dumbbell-chart/dumbbell-chart.tsx +8 -3
- package/src/charts/fill-gauge-chart/fill-gauge-chart.tsx +1 -0
- package/src/charts/funnel-chart/funnel-chart.tsx +2 -1
- package/src/charts/gauge-chart/gauge-chart.tsx +2 -1
- package/src/charts/heatmap-chart/heatmap-chart.tsx +5 -0
- package/src/charts/heatmap-chart/heatmap-grid.tsx +5 -1
- package/src/charts/hex-tile-map/hex-tile-map.tsx +6 -1
- package/src/charts/hierarchy-morph/hierarchy-morph.tsx +2 -1
- package/src/charts/icicle-chart/icicle-chart.tsx +8 -9
- package/src/charts/lollipop-chart/lollipop-chart.tsx +8 -3
- package/src/charts/maps/geo/map-viewport.tsx +1 -1
- package/src/charts/polar-area-chart/polar-area-chart.tsx +37 -12
- package/src/charts/progress-units/progress-units.tsx +1 -0
- package/src/charts/radar-chart/radar-chart.tsx +1 -1
- package/src/charts/radial-bar-chart/radial-bar-chart.tsx +2 -1
- package/src/charts/range-area-chart/range-area-chart.tsx +3 -2
- package/src/charts/sankey-chart/sankey-chart.tsx +12 -4
- package/src/charts/tree-chart/tree-chart.tsx +1 -0
- package/src/charts/treemap-chart/treemap-chart.tsx +2 -7
- package/src/charts/waterfall-chart/waterfall-chart.tsx +8 -3
- package/src/containers/action-bar/action-bar.tsx +13 -2
- package/src/containers/aside/aside.tsx +40 -0
- package/src/containers/aside/index.ts +1 -0
- package/src/containers/banner/banner.tsx +18 -1
- package/src/containers/card/card.tsx +43 -4
- package/src/containers/description-list/description-list.tsx +85 -9
- package/src/containers/feed/feed.tsx +99 -0
- package/src/containers/feed/index.ts +8 -0
- package/src/containers/feed/model.ts +54 -0
- package/src/containers/grid/grid.tsx +37 -0
- package/src/containers/grid/index.ts +1 -0
- package/src/containers/index.ts +9 -0
- package/src/containers/kpi/kpi.tsx +231 -38
- package/src/containers/kpi-group/index.ts +7 -1
- package/src/containers/kpi-group/kpi-group.tsx +26 -1
- package/src/containers/list-detail/index.ts +15 -0
- package/src/containers/list-detail/list-detail.tsx +293 -0
- package/src/containers/note/index.ts +1 -0
- package/src/containers/note/note.tsx +38 -0
- package/src/containers/page/index.ts +1 -0
- package/src/containers/page/page.tsx +17 -0
- package/src/containers/page-header/page-header.tsx +38 -8
- package/src/containers/responsive-list/responsive-list.tsx +7 -4
- package/src/containers/section/index.ts +11 -0
- package/src/containers/section/section.tsx +281 -0
- package/src/containers/shortcuts/index.ts +6 -0
- package/src/containers/shortcuts/shortcuts.tsx +92 -0
- package/src/containers/stack/index.ts +7 -0
- package/src/containers/stack/stack.tsx +55 -0
- package/src/containers/table/selection.ts +26 -0
- package/src/containers/table/table.tsx +215 -13
- package/src/containers/timeline/index.ts +3 -0
- package/src/containers/timeline/timeline.tsx +204 -93
- package/src/forms/chip-group/chip-group.tsx +184 -0
- package/src/forms/chip-group/index.ts +8 -0
- package/src/forms/combobox/combobox.tsx +359 -0
- package/src/forms/combobox/index.ts +7 -0
- package/src/forms/copy-field/copy-field.tsx +88 -0
- package/src/forms/copy-field/index.ts +1 -0
- package/src/forms/date-picker/date-picker.tsx +239 -0
- package/src/forms/date-picker/date-time-picker.tsx +178 -0
- package/src/forms/date-picker/index.ts +10 -0
- package/src/forms/date-picker/model.ts +108 -0
- package/src/forms/dropzone/dropzone.tsx +217 -35
- package/src/forms/emoji-picker/emoji-picker.tsx +1 -1
- package/src/forms/field/field.tsx +72 -7
- package/src/forms/form/form.tsx +46 -0
- package/src/forms/form/index.ts +8 -0
- package/src/forms/index.ts +6 -0
- package/src/forms/input/index.ts +8 -1
- package/src/forms/input/input.tsx +103 -7
- package/src/forms/input-icon/input-icon.tsx +1 -1
- package/src/forms/internal/listbox-items.tsx +103 -0
- package/src/forms/internal/listbox.ts +124 -0
- package/src/forms/number-stepper/model.ts +35 -0
- package/src/forms/number-stepper/number-stepper.tsx +132 -42
- package/src/forms/select-menu/index.ts +7 -0
- package/src/forms/select-menu/select-menu.tsx +280 -0
- package/src/glass/crystal-map.ts +150 -0
- package/src/glass/displacement-map.ts +317 -0
- package/src/glass/index.ts +43 -0
- package/src/glass/lens-crystal.ts +226 -0
- package/src/glass/lens-dispersion.ts +34 -0
- package/src/glass/liquid-glass.tsx +371 -0
- package/src/glass/liquid-motion.ts +395 -0
- package/src/glass/liquid-options.ts +306 -0
- package/src/glass/refraction.ts +1010 -0
- package/src/glass/specular-map.ts +95 -0
- package/src/glass/spring.ts +98 -0
- package/src/glass/support.ts +27 -0
- package/src/glass/use-glass-refraction.ts +21 -0
- package/src/i18n/strings.ts +113 -0
- package/src/i18n/ui-strings-provider.tsx +15 -4
- package/src/icons/index.ts +2 -0
- package/src/icons/key.tsx +13 -0
- package/src/icons/webhook.tsx +13 -0
- package/src/liquid/index.ts +24 -0
- package/src/navigation/breadcrumbs/breadcrumbs.tsx +103 -0
- package/src/navigation/breadcrumbs/index.ts +8 -0
- package/src/navigation/index.ts +2 -0
- package/src/navigation/segmented/index.ts +1 -0
- package/src/navigation/segmented/model.ts +11 -0
- package/src/navigation/segmented/segmented.tsx +45 -6
- package/src/navigation/stepper/index.ts +7 -1
- package/src/navigation/stepper/stepper.tsx +41 -5
- package/src/navigation/tabs/index.ts +7 -0
- package/src/navigation/tabs/tabs-nav.tsx +131 -0
- package/src/navigation/wizard/index.ts +7 -0
- package/src/navigation/wizard/model.ts +61 -0
- package/src/navigation/wizard/wizard.tsx +222 -0
- package/src/overlays/alert-dialog/alert-dialog.tsx +486 -0
- package/src/overlays/alert-dialog/index.ts +19 -0
- package/src/overlays/context-menu/context-menu.tsx +11 -1
- package/src/overlays/dialog/dialog.tsx +10 -0
- package/src/overlays/drawer/drawer.tsx +10 -0
- package/src/overlays/dropdown-menu/dropdown-menu.tsx +38 -4
- package/src/overlays/dropdown-menu/index.ts +3 -0
- package/src/overlays/hover-card/hover-card.tsx +12 -1
- package/src/overlays/index.ts +2 -0
- package/src/overlays/popover/popover.tsx +10 -0
- package/src/overlays/testing/index.ts +5 -0
- package/src/overlays/toaster/index.ts +2 -0
- package/src/overlays/toaster/toast-store.ts +6 -2
- package/src/overlays/toaster/toast.ts +6 -0
- package/src/overlays/toaster/toaster.tsx +44 -2
- package/src/overlays/tooltip/index.ts +1 -0
- package/src/overlays/tooltip/model.ts +18 -0
- package/src/overlays/tooltip/tooltip.tsx +166 -0
- package/src/palette/command-palette/command-palette.tsx +15 -1
- package/src/primitives/command/command.tsx +4 -0
- package/src/primitives/menu/menu.tsx +1 -1
- package/src/primitives/popper/popper.tsx +10 -0
- package/src/primitives/use-dismissable-layer.ts +7 -2
- package/src/rich-text/rich-text-editor.tsx +116 -13
- package/src/rich-text/sanitize.ts +94 -23
- package/src/shell/app-shell/app-shell.tsx +60 -4
- package/src/shell/bottom-nav/bottom-nav.tsx +187 -0
- package/src/shell/bottom-nav/index.ts +8 -0
- package/src/shell/bottom-nav/split.ts +20 -0
- package/src/shell/sidebar/sidebar.tsx +51 -5
- package/src/shell/topbar/topbar.tsx +81 -58
- package/src/states/empty-state/empty-state.tsx +11 -1
- package/src/states/error-state/error-state.tsx +23 -8
- package/src/states/index.ts +1 -0
- package/src/states/live-status-bar/index.ts +6 -0
- package/src/states/live-status-bar/live-status-bar.tsx +62 -0
- package/src/states/offline-banner/offline-banner.tsx +13 -5
- package/src/states/skeleton/skeleton.tsx +68 -2
- package/src/utils/class-groups.ts +17 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/material.ts +16 -0
- package/src/utils/tone.ts +29 -0
- package/src/utils/use-copy.ts +38 -0
- package/styles/Theme.kt +64 -3
- package/styles/base.css +51 -0
- package/styles/tailwind.css +836 -0
- package/styles/theme.css +579 -34
- package/styles/tokens.css +788 -15
- package/tokens/default.json +918 -29
- package/scripts/build-theme.d.ts +0 -18
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { type ReactNode, useEffect, useRef } from "react";
|
|
3
|
+
import { type CSSProperties, type ReactNode, useEffect, useRef } from "react";
|
|
4
4
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
5
5
|
import { cn } from "../../utils/cn.js";
|
|
6
|
+
import { type Material, materialClass } from "../../utils/material.js";
|
|
6
7
|
import { useAppShell, useCompactContainer } from "../app-shell/app-shell.js";
|
|
7
8
|
|
|
8
9
|
export interface SidebarLinkProps {
|
|
@@ -10,6 +11,8 @@ export interface SidebarLinkProps {
|
|
|
10
11
|
className: string;
|
|
11
12
|
children: ReactNode;
|
|
12
13
|
"aria-current"?: "page";
|
|
14
|
+
/** Set in rail mode, where the label is visually hidden. */
|
|
15
|
+
title?: string;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
/** Renders a navigation link; inject your router's link component here. */
|
|
@@ -58,7 +61,18 @@ export interface SidebarProps {
|
|
|
58
61
|
/** Drawer state when the app container is under 900 px. Ignored above it, where the sidebar is always visible. */
|
|
59
62
|
open?: boolean;
|
|
60
63
|
onClose?: () => void;
|
|
64
|
+
/** Icons-only rail with the labels as tooltips. Ignored while the sidebar is a drawer. */
|
|
65
|
+
collapsed?: boolean;
|
|
61
66
|
className?: string;
|
|
67
|
+
/** Inline style of the root (for example `liquidStyle()` options). */
|
|
68
|
+
style?: CSSProperties;
|
|
69
|
+
/**
|
|
70
|
+
* Surface material. Omitted keeps the default for this layer (opaque, glass in the glass
|
|
71
|
+
* preset); `"glass"` and `"glass-clear"` are frosted glass, `"liquid"` and `"liquid-clear"`
|
|
72
|
+
* Liquid Glass, `"solid"` forces opaque. Liquid options go in `style` (`liquidStyle()` from
|
|
73
|
+
* `@jcsoftdev/ui/liquid`); the lens needs `<LiquidGlass />` mounted once.
|
|
74
|
+
*/
|
|
75
|
+
material?: Material;
|
|
62
76
|
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
63
77
|
classNames?: ClassNames<SidebarPart>;
|
|
64
78
|
}
|
|
@@ -81,7 +95,10 @@ export function Sidebar({
|
|
|
81
95
|
renderLink = defaultRenderLink,
|
|
82
96
|
open = false,
|
|
83
97
|
onClose,
|
|
98
|
+
collapsed = false,
|
|
99
|
+
material,
|
|
84
100
|
className,
|
|
101
|
+
style,
|
|
85
102
|
classNames,
|
|
86
103
|
}: SidebarProps) {
|
|
87
104
|
const shell = useAppShell();
|
|
@@ -90,6 +107,7 @@ export function Sidebar({
|
|
|
90
107
|
const isMobile = shell ? shell.compact : parentCompact;
|
|
91
108
|
const closedOnMobile = isMobile && !open;
|
|
92
109
|
const openOnMobile = isMobile && open;
|
|
110
|
+
const rail = collapsed && !isMobile;
|
|
93
111
|
|
|
94
112
|
useEffect(() => {
|
|
95
113
|
if (!openOnMobile) return;
|
|
@@ -113,7 +131,8 @@ export function Sidebar({
|
|
|
113
131
|
aria-label={ariaLabel}
|
|
114
132
|
inert={closedOnMobile || undefined}
|
|
115
133
|
className={cn(
|
|
116
|
-
"fixed inset-y-0 left-0 z-45 flex h-screen
|
|
134
|
+
"fixed inset-y-0 left-0 z-45 flex h-screen flex-col gap-4.5 overflow-y-auto border-r-divider surface-side pt-3.5 pb-3 transition-transform duration-200",
|
|
135
|
+
rail ? "w-[4.5rem] px-2" : "w-side-width px-3",
|
|
117
136
|
// Inside AppShell the container query decides before any script runs (no flash on a
|
|
118
137
|
// narrow first paint); the measured state only drives inert, the scrim and focus.
|
|
119
138
|
shell
|
|
@@ -126,9 +145,11 @@ export function Sidebar({
|
|
|
126
145
|
closedOnMobile ? "-translate-x-full" : "translate-x-0",
|
|
127
146
|
),
|
|
128
147
|
openOnMobile && "shadow-overlay",
|
|
148
|
+
materialClass(material, "surface-solid [--surface-solid:var(--surface)]"),
|
|
129
149
|
classNames?.root,
|
|
130
150
|
className,
|
|
131
151
|
)}
|
|
152
|
+
style={style}
|
|
132
153
|
>
|
|
133
154
|
{header}
|
|
134
155
|
{groups.map((group) => (
|
|
@@ -137,7 +158,13 @@ export function Sidebar({
|
|
|
137
158
|
aria-label={group.label}
|
|
138
159
|
className={cn("flex flex-col gap-px", classNames?.group)}
|
|
139
160
|
>
|
|
140
|
-
<div
|
|
161
|
+
<div
|
|
162
|
+
className={cn(
|
|
163
|
+
"px-2.5 pb-1.5 text-overline text-ink-3",
|
|
164
|
+
rail && "sr-only",
|
|
165
|
+
classNames?.groupLabel,
|
|
166
|
+
)}
|
|
167
|
+
>
|
|
141
168
|
{group.label}
|
|
142
169
|
</div>
|
|
143
170
|
{group.items.map((item) => {
|
|
@@ -150,18 +177,37 @@ export function Sidebar({
|
|
|
150
177
|
{renderLink({
|
|
151
178
|
href: item.href,
|
|
152
179
|
"aria-current": item.active ? "page" : undefined,
|
|
180
|
+
title: rail ? item.label : undefined,
|
|
153
181
|
className: cn(
|
|
154
182
|
"flex items-center gap-2.5 rounded-control px-2.5 py-2 text-control text-ink-2 hover:bg-surface-2 hover:text-ink [&_svg]:size-4.25 [&_svg]:shrink-0",
|
|
183
|
+
rail && "relative justify-center in-data-[density=touch]:min-h-11",
|
|
155
184
|
item.active && "bg-accent-soft font-bold text-accent-ink",
|
|
156
185
|
classNames?.link,
|
|
157
186
|
),
|
|
158
187
|
children: (
|
|
159
188
|
<>
|
|
160
189
|
{item.icon}
|
|
161
|
-
<span
|
|
190
|
+
<span
|
|
191
|
+
className={cn("min-w-0 truncate", rail && "sr-only", classNames?.label)}
|
|
192
|
+
>
|
|
162
193
|
{item.label}
|
|
163
194
|
</span>
|
|
164
|
-
{item.badge !== undefined ? (
|
|
195
|
+
{item.badge !== undefined && rail ? (
|
|
196
|
+
<>
|
|
197
|
+
<span
|
|
198
|
+
aria-hidden="true"
|
|
199
|
+
className={cn(
|
|
200
|
+
"absolute top-1 right-1 size-2 rounded-full ring-2 ring-surface",
|
|
201
|
+
item.badgeTone === "danger" ? "bg-danger" : "bg-accent",
|
|
202
|
+
classNames?.badge,
|
|
203
|
+
)}
|
|
204
|
+
/>
|
|
205
|
+
<span className="sr-only">
|
|
206
|
+
{item.badge}
|
|
207
|
+
{item.badgeLabel ? ` ${item.badgeLabel}` : null}
|
|
208
|
+
</span>
|
|
209
|
+
</>
|
|
210
|
+
) : item.badge !== undefined ? (
|
|
165
211
|
<span
|
|
166
212
|
className={cn(
|
|
167
213
|
"ml-auto shrink-0 rounded-chip px-1.5 py-0.75 text-count",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { type ReactNode, type Ref, useEffect, useState } from "react";
|
|
3
|
+
import { type CSSProperties, type ReactNode, type Ref, useEffect, useState } from "react";
|
|
4
4
|
import { Menu, Search } from "../../icons/index.js";
|
|
5
5
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
6
6
|
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { type Material, materialClass } from "../../utils/material.js";
|
|
7
8
|
|
|
8
9
|
function isApplePlatform(): boolean {
|
|
9
10
|
if (typeof navigator === "undefined") return false;
|
|
@@ -23,24 +24,34 @@ export type TopbarPart =
|
|
|
23
24
|
| "shortcut";
|
|
24
25
|
|
|
25
26
|
export interface TopbarProps {
|
|
26
|
-
/** Breadcrumb trail in order; the last entry is the current view. */
|
|
27
|
-
breadcrumbs
|
|
27
|
+
/** Breadcrumb trail in order; the last entry is the current view. Nothing renders when absent or empty. */
|
|
28
|
+
breadcrumbs?: string[];
|
|
28
29
|
/** Accessible name of the breadcrumb landmark. */
|
|
29
|
-
breadcrumbsLabel
|
|
30
|
+
breadcrumbsLabel?: string;
|
|
30
31
|
/** Menu button (shown when the `AppShell` container is under 900 px, matching the Sidebar drawer) that opens the sidebar drawer. Needs an `@container/app` ancestor, which `AppShell` provides. Omitted when not set. */
|
|
31
32
|
onOpenMenu?: () => void;
|
|
32
33
|
menuLabel?: string;
|
|
33
34
|
/** Ref to the menu button so the opener can restore focus when the drawer closes. */
|
|
34
35
|
menuButtonRef?: Ref<HTMLButtonElement>;
|
|
35
|
-
/** Called by the search trigger and by Cmd/Ctrl+K. */
|
|
36
|
-
onSearch
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
/** Called by the search trigger and by Cmd/Ctrl+K. The trigger and the shortcut are absent without it. */
|
|
37
|
+
onSearch?: () => void;
|
|
38
|
+
/** Accessible name of the search trigger; defaults to the placeholder. */
|
|
39
|
+
searchLabel?: string;
|
|
40
|
+
searchPlaceholder?: string;
|
|
39
41
|
/** Slot between the search trigger and the end block (status, notifications, primary action). */
|
|
40
42
|
actions?: ReactNode;
|
|
41
43
|
/** Slot at the far end (e.g. the account menu). */
|
|
42
44
|
end?: ReactNode;
|
|
43
45
|
className?: string;
|
|
46
|
+
/** Inline style of the root (for example `liquidStyle()` options). */
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
/**
|
|
49
|
+
* Surface material. Omitted keeps the default for this layer (opaque, glass in the glass
|
|
50
|
+
* preset); `"glass"` and `"glass-clear"` are frosted glass, `"liquid"` and `"liquid-clear"`
|
|
51
|
+
* Liquid Glass, `"solid"` forces opaque. Liquid options go in `style` (`liquidStyle()` from
|
|
52
|
+
* `@jcsoftdev/ui/liquid`); the lens needs `<LiquidGlass />` mounted once.
|
|
53
|
+
*/
|
|
54
|
+
material?: Material;
|
|
44
55
|
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
45
56
|
classNames?: ClassNames<TopbarPart>;
|
|
46
57
|
}
|
|
@@ -56,6 +67,8 @@ export function Topbar({
|
|
|
56
67
|
searchPlaceholder,
|
|
57
68
|
actions,
|
|
58
69
|
end,
|
|
70
|
+
material,
|
|
71
|
+
style,
|
|
59
72
|
className,
|
|
60
73
|
classNames,
|
|
61
74
|
}: TopbarProps) {
|
|
@@ -66,25 +79,29 @@ export function Topbar({
|
|
|
66
79
|
}, []);
|
|
67
80
|
|
|
68
81
|
useEffect(() => {
|
|
82
|
+
if (!onSearch) return;
|
|
69
83
|
function onKeyDown(event: KeyboardEvent) {
|
|
70
84
|
if (!(event.metaKey || event.ctrlKey) || event.key.toLowerCase() !== "k") return;
|
|
71
85
|
event.preventDefault();
|
|
72
|
-
onSearch();
|
|
86
|
+
onSearch?.();
|
|
73
87
|
}
|
|
74
88
|
window.addEventListener("keydown", onKeyDown);
|
|
75
89
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
76
90
|
}, [onSearch]);
|
|
77
91
|
|
|
78
|
-
const
|
|
79
|
-
const
|
|
92
|
+
const trail = breadcrumbs ?? [];
|
|
93
|
+
const current = trail.at(-1);
|
|
94
|
+
const previous = trail.slice(0, -1);
|
|
80
95
|
|
|
81
96
|
return (
|
|
82
97
|
<header
|
|
83
98
|
className={cn(
|
|
84
|
-
"@container/topbar sticky top-0 z-30 h-top-height border-b-divider
|
|
99
|
+
"@container/topbar sticky top-0 z-30 h-top-height border-b-divider surface-nav",
|
|
100
|
+
materialClass(material, "surface-solid [--surface-solid:var(--bg)]"),
|
|
85
101
|
classNames?.root,
|
|
86
102
|
className,
|
|
87
103
|
)}
|
|
104
|
+
style={style}
|
|
88
105
|
>
|
|
89
106
|
<div
|
|
90
107
|
className={cn(
|
|
@@ -107,57 +124,63 @@ export function Topbar({
|
|
|
107
124
|
</button>
|
|
108
125
|
) : null}
|
|
109
126
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{previous.map((crumb) => (
|
|
118
|
-
<span
|
|
119
|
-
key={crumb}
|
|
120
|
-
className={cn(
|
|
121
|
-
"flex items-center gap-2 @max-[560px]/topbar:hidden",
|
|
122
|
-
classNames?.crumb,
|
|
123
|
-
)}
|
|
124
|
-
>
|
|
125
|
-
<span>{crumb}</span>
|
|
126
|
-
<span aria-hidden="true" className={cn("text-line-control", classNames?.separator)}>
|
|
127
|
-
/
|
|
128
|
-
</span>
|
|
129
|
-
</span>
|
|
130
|
-
))}
|
|
131
|
-
<strong
|
|
132
|
-
aria-current="page"
|
|
133
|
-
className={cn("min-w-0 truncate font-semibold text-ink", classNames?.current)}
|
|
127
|
+
{trail.length > 0 ? (
|
|
128
|
+
<nav
|
|
129
|
+
aria-label={breadcrumbsLabel}
|
|
130
|
+
className={cn(
|
|
131
|
+
"flex min-w-0 shrink items-center gap-2 whitespace-nowrap text-ink-3 text-meta",
|
|
132
|
+
classNames?.breadcrumbs,
|
|
133
|
+
)}
|
|
134
134
|
>
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
{previous.map((crumb) => (
|
|
136
|
+
<span
|
|
137
|
+
key={crumb}
|
|
138
|
+
className={cn(
|
|
139
|
+
"flex items-center gap-2 @max-[560px]/topbar:hidden",
|
|
140
|
+
classNames?.crumb,
|
|
141
|
+
)}
|
|
142
|
+
>
|
|
143
|
+
<span>{crumb}</span>
|
|
144
|
+
<span aria-hidden="true" className={cn("text-line-control", classNames?.separator)}>
|
|
145
|
+
/
|
|
146
|
+
</span>
|
|
147
|
+
</span>
|
|
148
|
+
))}
|
|
149
|
+
<strong
|
|
150
|
+
aria-current="page"
|
|
151
|
+
className={cn("min-w-0 truncate font-semibold text-ink", classNames?.current)}
|
|
152
|
+
>
|
|
153
|
+
{current}
|
|
154
|
+
</strong>
|
|
155
|
+
</nav>
|
|
156
|
+
) : null}
|
|
138
157
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"ml-auto flex h-8.5 w-[min(320px,38cqw)] shrink-0 items-center gap-2 rounded-input border-control bg-surface-control pr-2 pl-2.5 text-ink-3 text-meta @max-[700px]/topbar:w-8.5 @max-[700px]/topbar:justify-center @max-[700px]/topbar:px-0",
|
|
145
|
-
classNames?.search,
|
|
146
|
-
)}
|
|
147
|
-
>
|
|
148
|
-
<Search className="size-4 shrink-0" aria-hidden="true" />
|
|
149
|
-
<span className={cn("truncate @max-[700px]/topbar:hidden", classNames?.searchText)}>
|
|
150
|
-
{searchPlaceholder}
|
|
151
|
-
</span>
|
|
152
|
-
<span
|
|
158
|
+
{onSearch ? (
|
|
159
|
+
<button
|
|
160
|
+
type="button"
|
|
161
|
+
aria-label={searchLabel ?? searchPlaceholder}
|
|
162
|
+
onClick={onSearch}
|
|
153
163
|
className={cn(
|
|
154
|
-
"ml-auto rounded-
|
|
155
|
-
classNames?.
|
|
164
|
+
"ml-auto flex h-8.5 w-[min(320px,38cqw)] shrink-0 items-center gap-2 rounded-input border-control bg-surface-control pr-2 pl-2.5 text-ink-3 text-meta @max-[700px]/topbar:w-8.5 @max-[700px]/topbar:justify-center @max-[700px]/topbar:px-0",
|
|
165
|
+
classNames?.search,
|
|
156
166
|
)}
|
|
157
167
|
>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
<Search className="size-4 shrink-0" aria-hidden="true" />
|
|
169
|
+
<span className={cn("truncate @max-[700px]/topbar:hidden", classNames?.searchText)}>
|
|
170
|
+
{searchPlaceholder}
|
|
171
|
+
</span>
|
|
172
|
+
<span
|
|
173
|
+
className={cn(
|
|
174
|
+
"ml-auto rounded-xs border-divider bg-surface-2 px-1.25 py-0.5 font-mono text-count text-ink-2 @max-[700px]/topbar:hidden",
|
|
175
|
+
classNames?.shortcut,
|
|
176
|
+
)}
|
|
177
|
+
>
|
|
178
|
+
{shortcut}
|
|
179
|
+
</span>
|
|
180
|
+
</button>
|
|
181
|
+
) : (
|
|
182
|
+
<span aria-hidden="true" className="ml-auto" />
|
|
183
|
+
)}
|
|
161
184
|
|
|
162
185
|
{actions}
|
|
163
186
|
{end}
|
|
@@ -8,14 +8,24 @@ export interface EmptyStateProps {
|
|
|
8
8
|
description?: ReactNode;
|
|
9
9
|
/** Primary call to action. */
|
|
10
10
|
action?: ReactNode;
|
|
11
|
+
/** `outlined` draws a dashed border around the state. */
|
|
12
|
+
variant?: "plain" | "outlined";
|
|
11
13
|
className?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
export function EmptyState({
|
|
16
|
+
export function EmptyState({
|
|
17
|
+
icon,
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
action,
|
|
21
|
+
variant = "plain",
|
|
22
|
+
className,
|
|
23
|
+
}: EmptyStateProps) {
|
|
15
24
|
return (
|
|
16
25
|
<div
|
|
17
26
|
className={cn(
|
|
18
27
|
"@container/empty flex min-w-0 flex-col items-center gap-2 px-4 py-8 text-center @min-[360px]/empty:px-6 @min-[360px]/empty:py-12",
|
|
28
|
+
variant === "outlined" && "rounded-card border border-line-control border-dashed",
|
|
19
29
|
className,
|
|
20
30
|
)}
|
|
21
31
|
>
|
|
@@ -17,6 +17,13 @@ export interface ErrorStateProps {
|
|
|
17
17
|
correlationLabel?: string;
|
|
18
18
|
onRetry?: () => void;
|
|
19
19
|
retryLabel?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Extra actions (buttons or links) in the same row as the retry button, under the message.
|
|
22
|
+
* Use it for "Go back" or "Contact support"; `onRetry` stays the shortcut for a plain retry.
|
|
23
|
+
*/
|
|
24
|
+
actions?: ReactNode;
|
|
25
|
+
/** `outlined` draws a danger border around the state. */
|
|
26
|
+
variant?: "plain" | "outlined";
|
|
20
27
|
className?: string;
|
|
21
28
|
}
|
|
22
29
|
|
|
@@ -28,6 +35,8 @@ export function ErrorState({
|
|
|
28
35
|
correlationLabel,
|
|
29
36
|
onRetry,
|
|
30
37
|
retryLabel,
|
|
38
|
+
actions,
|
|
39
|
+
variant = "plain",
|
|
31
40
|
className,
|
|
32
41
|
}: ErrorStateProps) {
|
|
33
42
|
const strings = useUiStrings();
|
|
@@ -39,6 +48,7 @@ export function ErrorState({
|
|
|
39
48
|
role="alert"
|
|
40
49
|
className={cn(
|
|
41
50
|
"@container/state flex min-w-0 flex-col items-center gap-2 px-4 py-8 text-center @min-[360px]/state:px-6 @min-[360px]/state:py-10",
|
|
51
|
+
variant === "outlined" && "rounded-card border border-danger",
|
|
42
52
|
className,
|
|
43
53
|
)}
|
|
44
54
|
>
|
|
@@ -53,14 +63,19 @@ export function ErrorState({
|
|
|
53
63
|
{correlationLabel ?? strings.correlationPrefix} {correlationId}
|
|
54
64
|
</p>
|
|
55
65
|
) : null}
|
|
56
|
-
{onRetry ? (
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
{onRetry || displayable(actions) !== undefined ? (
|
|
67
|
+
<div className="mt-2 flex flex-wrap items-center justify-center gap-2">
|
|
68
|
+
{onRetry ? (
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
onClick={onRetry}
|
|
72
|
+
className="inline-flex h-control-sm cursor-pointer items-center rounded-input border-control bg-surface-control px-3 font-semibold text-fs-130 text-ink hover:bg-surface-2"
|
|
73
|
+
>
|
|
74
|
+
{retryLabel ?? strings.retry}
|
|
75
|
+
</button>
|
|
76
|
+
) : null}
|
|
77
|
+
{displayable(actions)}
|
|
78
|
+
</div>
|
|
64
79
|
) : null}
|
|
65
80
|
</div>
|
|
66
81
|
);
|
package/src/states/index.ts
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
4
|
+
import { useUiStrings } from "../../i18n/index.js";
|
|
5
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
|
|
8
|
+
export type LiveStatus = "live" | "reconnecting" | "offline";
|
|
9
|
+
|
|
10
|
+
export type LiveStatusBarPart = "root" | "indicator" | "label";
|
|
11
|
+
|
|
12
|
+
const dotClasses: Record<LiveStatus, string> = {
|
|
13
|
+
live: "bg-success",
|
|
14
|
+
reconnecting: "animate-pulse bg-warning motion-reduce:animate-none",
|
|
15
|
+
offline: "bg-danger",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export interface LiveStatusBarProps extends Omit<ComponentPropsWithoutRef<"div">, "role"> {
|
|
19
|
+
status: LiveStatus;
|
|
20
|
+
/** Replaces the localized text of a status, e.g. `{ live: "Connected" }`. */
|
|
21
|
+
labels?: Partial<Record<LiveStatus, string>>;
|
|
22
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
23
|
+
classNames?: ClassNames<LiveStatusBarPart>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Connection status for a realtime view: a colored dot plus its text, and `children` for what
|
|
28
|
+
* the view shows next to it (counts, a last-update time). A polite `role="status"`, so a change
|
|
29
|
+
* of `status` is announced without interrupting. Meaning never relies on color alone.
|
|
30
|
+
*/
|
|
31
|
+
export function LiveStatusBar({
|
|
32
|
+
status,
|
|
33
|
+
labels,
|
|
34
|
+
className,
|
|
35
|
+
classNames,
|
|
36
|
+
children,
|
|
37
|
+
...props
|
|
38
|
+
}: LiveStatusBarProps) {
|
|
39
|
+
const strings = useUiStrings();
|
|
40
|
+
const text = labels?.[status] ?? strings[status];
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
role="status"
|
|
44
|
+
data-status={status}
|
|
45
|
+
className={cn(
|
|
46
|
+
"flex flex-wrap items-center gap-x-4 gap-y-1 rounded-card bg-surface-2 px-3.5 py-2.5 text-control",
|
|
47
|
+
classNames?.root,
|
|
48
|
+
className,
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
<span className={cn("inline-flex items-center gap-2 font-semibold", classNames?.label)}>
|
|
53
|
+
<span
|
|
54
|
+
aria-hidden="true"
|
|
55
|
+
className={cn("size-2.5 rounded-pill", dotClasses[status], classNames?.indicator)}
|
|
56
|
+
/>
|
|
57
|
+
{text}
|
|
58
|
+
</span>
|
|
59
|
+
{children}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -7,6 +7,8 @@ export interface OfflineBannerProps {
|
|
|
7
7
|
/** Screen reader text for the queue counter. */
|
|
8
8
|
queuedLabel?: string;
|
|
9
9
|
message: ReactNode;
|
|
10
|
+
/** Optional action next to the message, e.g. a retry `Button`. Shown after the queue counter. */
|
|
11
|
+
action?: ReactNode;
|
|
10
12
|
className?: string;
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -14,6 +16,7 @@ export function OfflineBanner({
|
|
|
14
16
|
queuedChanges = 0,
|
|
15
17
|
queuedLabel,
|
|
16
18
|
message,
|
|
19
|
+
action,
|
|
17
20
|
className,
|
|
18
21
|
}: OfflineBannerProps) {
|
|
19
22
|
return (
|
|
@@ -21,11 +24,16 @@ export function OfflineBanner({
|
|
|
21
24
|
tone="warning"
|
|
22
25
|
className={className}
|
|
23
26
|
action={
|
|
24
|
-
queuedChanges > 0 ? (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
queuedChanges > 0 || action ? (
|
|
28
|
+
<>
|
|
29
|
+
{queuedChanges > 0 ? (
|
|
30
|
+
<span className="font-semibold text-fs-120 tabular-nums">
|
|
31
|
+
<span aria-hidden="true">{queuedChanges}</span>
|
|
32
|
+
<span className="sr-only">{queuedLabel ?? String(queuedChanges)}</span>
|
|
33
|
+
</span>
|
|
34
|
+
) : null}
|
|
35
|
+
{action}
|
|
36
|
+
</>
|
|
29
37
|
) : undefined
|
|
30
38
|
}
|
|
31
39
|
>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import type { ReactNode } from "react";
|
|
3
4
|
import { useUiStrings } from "../../i18n/index.js";
|
|
4
5
|
import { cn } from "../../utils/cn.js";
|
|
5
6
|
|
|
6
|
-
export type SkeletonVariant = "lines" | "table" | "card";
|
|
7
|
+
export type SkeletonVariant = "lines" | "table" | "card" | "list" | "kpis" | "key-value" | "bar";
|
|
7
8
|
|
|
8
9
|
const PLACEHOLDER_IDS = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"] as const;
|
|
9
10
|
|
|
@@ -13,15 +14,33 @@ export interface SkeletonProps {
|
|
|
13
14
|
lines?: number;
|
|
14
15
|
/** Number of rows for the `table` variant. */
|
|
15
16
|
rows?: number;
|
|
17
|
+
/** Number of items for the `list`, `kpis` and `key-value` variants. Defaults to 4, at most 12. */
|
|
18
|
+
count?: number;
|
|
16
19
|
/** Text announced to screen readers while loading. */
|
|
17
20
|
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Classes on the root. The `bar` variant is one block sized by them (`h-8 w-32`), 12px tall and
|
|
23
|
+
* full width otherwise.
|
|
24
|
+
*/
|
|
18
25
|
className?: string;
|
|
19
26
|
}
|
|
20
27
|
|
|
28
|
+
/** A decorative placeholder bar; the status region around it carries the announcement. */
|
|
29
|
+
function Bar({ className }: { className?: string }) {
|
|
30
|
+
return <span aria-hidden="true" className={cn("block h-3 rounded-xs bg-surface-2", className)} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function items(count: number, render: (id: string, index: number) => ReactNode): ReactNode[] {
|
|
34
|
+
return PLACEHOLDER_IDS.slice(0, Math.max(0, count)).map((id, index) => render(id, index));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// None of the variants pads the inline edges: the container the skeleton sits in owns its inset,
|
|
38
|
+
// so the placeholder lines up with the content it stands in for.
|
|
21
39
|
export function Skeleton({
|
|
22
40
|
variant = "lines",
|
|
23
41
|
lines = 3,
|
|
24
42
|
rows = 4,
|
|
43
|
+
count = 4,
|
|
25
44
|
label,
|
|
26
45
|
className,
|
|
27
46
|
}: SkeletonProps) {
|
|
@@ -31,7 +50,11 @@ export function Skeleton({
|
|
|
31
50
|
role="status"
|
|
32
51
|
aria-busy="true"
|
|
33
52
|
aria-label={label ?? strings.loading}
|
|
34
|
-
className={cn(
|
|
53
|
+
className={cn(
|
|
54
|
+
"animate-pulse",
|
|
55
|
+
variant === "bar" && "block h-3 w-full rounded-xs bg-surface-2",
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
35
58
|
>
|
|
36
59
|
{variant === "lines" ? (
|
|
37
60
|
<div className="flex flex-col gap-2">
|
|
@@ -52,6 +75,49 @@ export function Skeleton({
|
|
|
52
75
|
</div>
|
|
53
76
|
) : null}
|
|
54
77
|
{variant === "card" ? <div className="h-40 rounded-card bg-surface-2" /> : null}
|
|
78
|
+
{variant === "list" ? (
|
|
79
|
+
<div className="flex flex-col">
|
|
80
|
+
{items(count, (id, index) => (
|
|
81
|
+
<div
|
|
82
|
+
key={id}
|
|
83
|
+
className="grid min-h-11 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b-divider py-2.5 in-data-[density=touch]:min-h-14"
|
|
84
|
+
>
|
|
85
|
+
<span className="flex flex-col gap-1.5">
|
|
86
|
+
<Bar className={index % 2 === 0 ? "w-2/5" : "w-1/2"} />
|
|
87
|
+
<Bar className="h-2.5 w-1/4" />
|
|
88
|
+
</span>
|
|
89
|
+
<Bar className="w-14" />
|
|
90
|
+
</div>
|
|
91
|
+
))}
|
|
92
|
+
</div>
|
|
93
|
+
) : null}
|
|
94
|
+
{variant === "kpis" ? (
|
|
95
|
+
<div className="grid gap-3 [grid-template-columns:repeat(auto-fit,minmax(min(168px,100%),1fr))]">
|
|
96
|
+
{items(count, (id) => (
|
|
97
|
+
<div
|
|
98
|
+
key={id}
|
|
99
|
+
className="flex flex-col gap-2.5 rounded-card border-card bg-surface px-4 py-3.5"
|
|
100
|
+
>
|
|
101
|
+
<Bar className="w-1/2" />
|
|
102
|
+
<Bar className="h-6.5 w-2/3" />
|
|
103
|
+
<Bar className="w-1/3" />
|
|
104
|
+
</div>
|
|
105
|
+
))}
|
|
106
|
+
</div>
|
|
107
|
+
) : null}
|
|
108
|
+
{variant === "key-value" ? (
|
|
109
|
+
<div className="grid gap-x-4 gap-y-2.5 py-3 [grid-template-columns:minmax(min(6.5rem,40%),10rem)_minmax(0,1fr)]">
|
|
110
|
+
{items(count, (id, index) => (
|
|
111
|
+
<div key={id} className="contents">
|
|
112
|
+
<Bar className="w-3/4" />
|
|
113
|
+
<Bar className={KEY_VALUE_WIDTHS[index % KEY_VALUE_WIDTHS.length]} />
|
|
114
|
+
</div>
|
|
115
|
+
))}
|
|
116
|
+
</div>
|
|
117
|
+
) : null}
|
|
55
118
|
</div>
|
|
56
119
|
);
|
|
57
120
|
}
|
|
121
|
+
|
|
122
|
+
// Decorative width rhythm so stacked values do not read as one block.
|
|
123
|
+
const KEY_VALUE_WIDTHS = ["w-11/12", "w-3/4", "w-5/6", "w-2/3"] as const;
|
|
@@ -519,6 +519,23 @@ export const GROUPS: GroupEntry[] = [
|
|
|
519
519
|
...perSide("border-w", "border", AXES, borderWidth, "-"),
|
|
520
520
|
["divide-x", "divide-x", borderWidth],
|
|
521
521
|
["divide-x-reverse", "", ["divide-x-reverse"]],
|
|
522
|
+
// The kit's surface materials: a later one replaces an earlier one, so `glass` in a className
|
|
523
|
+
// wins over a component's default `surface-card`.
|
|
524
|
+
[
|
|
525
|
+
"surface-material",
|
|
526
|
+
"",
|
|
527
|
+
[
|
|
528
|
+
"surface-card",
|
|
529
|
+
"surface-overlay",
|
|
530
|
+
"surface-nav",
|
|
531
|
+
"surface-side",
|
|
532
|
+
"glass",
|
|
533
|
+
"glass-clear",
|
|
534
|
+
"liquid",
|
|
535
|
+
"liquid-clear",
|
|
536
|
+
"surface-solid",
|
|
537
|
+
],
|
|
538
|
+
],
|
|
522
539
|
["divide-y", "divide-y", borderWidth],
|
|
523
540
|
["divide-y-reverse", "", ["divide-y-reverse"]],
|
|
524
541
|
["border-style", "border", [...lineStyle, "hidden", "none"]],
|