@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,22 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
useCallback,
|
|
4
|
+
useEffect,
|
|
5
|
+
useRef,
|
|
6
|
+
useState
|
|
7
|
+
} from "react";
|
|
8
|
+
import { useLeaveGrace } from "./leave-grace.js";
|
|
9
|
+
const CHART_HIT = "data-chart-hit";
|
|
3
10
|
function useIndexNavigation(count, { wrap = false } = {}) {
|
|
4
11
|
const ref = useRef(null);
|
|
5
12
|
const [active, setActive] = useState(null);
|
|
6
13
|
const [pointer, setPointer] = useState(null);
|
|
14
|
+
const [pinned, setPinned] = useState(false);
|
|
7
15
|
useEffect(() => {
|
|
8
16
|
setActive((current) => current != null && current >= count ? null : current);
|
|
9
17
|
}, [count]);
|
|
10
|
-
const
|
|
11
|
-
const box = ref.current?.getBoundingClientRect();
|
|
12
|
-
if (!box) return;
|
|
13
|
-
setActive(index);
|
|
14
|
-
setPointer({ x: event.clientX - box.left, y: event.clientY - box.top });
|
|
15
|
-
}, []);
|
|
16
|
-
const leave = useCallback(() => {
|
|
18
|
+
const clear = useCallback(() => {
|
|
17
19
|
setActive(null);
|
|
18
20
|
setPointer(null);
|
|
21
|
+
setPinned(false);
|
|
19
22
|
}, []);
|
|
23
|
+
const { leave: leaveSoon, hold } = useLeaveGrace(clear);
|
|
24
|
+
const hover = useCallback(
|
|
25
|
+
(index, event) => {
|
|
26
|
+
hold();
|
|
27
|
+
const box = ref.current?.getBoundingClientRect();
|
|
28
|
+
if (!box) return;
|
|
29
|
+
setActive(index);
|
|
30
|
+
setPointer({ x: event.clientX - box.left, y: event.clientY - box.top });
|
|
31
|
+
setPinned(event.pointerType != null && event.pointerType !== "mouse");
|
|
32
|
+
},
|
|
33
|
+
[hold]
|
|
34
|
+
);
|
|
35
|
+
const leave = useCallback(() => {
|
|
36
|
+
hold();
|
|
37
|
+
clear();
|
|
38
|
+
}, [hold, clear]);
|
|
39
|
+
const pointerLeave = useCallback(
|
|
40
|
+
(event) => {
|
|
41
|
+
if (event?.pointerType == null || event.pointerType === "mouse") leaveSoon();
|
|
42
|
+
},
|
|
43
|
+
[leaveSoon]
|
|
44
|
+
);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!pinned) return;
|
|
47
|
+
const dismiss = (event) => {
|
|
48
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
49
|
+
if (!target?.closest(`[${CHART_HIT}]`) || !ref.current?.contains(target)) leave();
|
|
50
|
+
};
|
|
51
|
+
document.addEventListener("pointerdown", dismiss, true);
|
|
52
|
+
return () => document.removeEventListener("pointerdown", dismiss, true);
|
|
53
|
+
}, [pinned, leave]);
|
|
20
54
|
const onKeyDown = (event) => {
|
|
21
55
|
if (count === 0) return;
|
|
22
56
|
const last = count - 1;
|
|
@@ -37,10 +71,13 @@ function useIndexNavigation(count, { wrap = false } = {}) {
|
|
|
37
71
|
};
|
|
38
72
|
const sliderProps = {
|
|
39
73
|
onKeyDown,
|
|
40
|
-
onFocus: () =>
|
|
74
|
+
onFocus: (event) => {
|
|
75
|
+
if (event && !event.currentTarget.matches(":focus-visible")) return;
|
|
76
|
+
setActive((current) => current ?? 0);
|
|
77
|
+
},
|
|
41
78
|
onBlur: leave
|
|
42
79
|
};
|
|
43
|
-
return { ref, active, pointer, setActive, hover, leave, sliderProps };
|
|
80
|
+
return { ref, active, pointer, setActive, hover, leave, pointerLeave, sliderProps };
|
|
44
81
|
}
|
|
45
82
|
export {
|
|
46
83
|
useIndexNavigation
|
|
@@ -15,6 +15,8 @@ export interface DonutDatum {
|
|
|
15
15
|
/** How slices are painted: flat color, a radial gradient, or a texture over the color. */
|
|
16
16
|
export type DonutFill = "solid" | "gradient" | "pattern";
|
|
17
17
|
export type DonutOutsideLabels = boolean | "name" | "percent" | "both";
|
|
18
|
+
/** Labels inside the ring: `true` and "percent" show the share, "value" the formatted value. */
|
|
19
|
+
export type DonutSliceLabels = boolean | "percent" | "value";
|
|
18
20
|
export interface DonutChartProps {
|
|
19
21
|
/** Accessible name of the drawing. */
|
|
20
22
|
title: string;
|
|
@@ -54,6 +56,8 @@ export interface DonutChartProps {
|
|
|
54
56
|
centerValue?: string;
|
|
55
57
|
/** Names / percentages on leader lines around the ring. `true` shows both. */
|
|
56
58
|
outsideLabels?: DonutOutsideLabels;
|
|
59
|
+
/** Labels drawn inside the ring; slices too small to hold their label are skipped. */
|
|
60
|
+
sliceLabels?: DonutSliceLabels;
|
|
57
61
|
legend?: boolean | "top" | "bottom";
|
|
58
62
|
tooltip?: boolean;
|
|
59
63
|
loading?: boolean;
|
|
@@ -70,4 +74,4 @@ export interface DonutChartProps {
|
|
|
70
74
|
* on hover or keyboard focus, optional outside labels on leader lines (with
|
|
71
75
|
* collision avoidance) and a legend that toggles slices.
|
|
72
76
|
*/
|
|
73
|
-
export declare function DonutChart({ title, description, data, variant, semi, innerRadius, cornerRadius, gap, explode, startAngle, monochrome, fill, drilldown, rootLabel, breadcrumbLabel, height, aspectRatio, valueFormat, centerLabel, centerValue, outsideLabels, legend, tooltip, loading, animate, initialHidden, onSliceClick, labels: labelsProp, className, }: DonutChartProps): import("react").JSX.Element;
|
|
77
|
+
export declare function DonutChart({ title, description, data, variant, semi, innerRadius, cornerRadius, gap, explode, startAngle, monochrome, fill, drilldown, rootLabel, breadcrumbLabel, height, aspectRatio, valueFormat, centerLabel, centerValue, outsideLabels, sliceLabels, legend, tooltip, loading, animate, initialHidden, onSliceClick, labels: labelsProp, className, }: DonutChartProps): import("react").JSX.Element;
|
|
@@ -22,6 +22,7 @@ import { resolveLabels } from "../core/types.js";
|
|
|
22
22
|
import { useIndexNavigation } from "../core/use-index-navigation.js";
|
|
23
23
|
import { useSeriesState } from "../core/use-series-state.js";
|
|
24
24
|
import { fitCenterText } from "./center-fit.js";
|
|
25
|
+
import { fitSliceLabel } from "./slice-labels.js";
|
|
25
26
|
function labelMode(value) {
|
|
26
27
|
if (!value) return null;
|
|
27
28
|
return value === true ? "both" : value;
|
|
@@ -52,6 +53,7 @@ function DonutChart({
|
|
|
52
53
|
centerLabel,
|
|
53
54
|
centerValue,
|
|
54
55
|
outsideLabels = false,
|
|
56
|
+
sliceLabels = false,
|
|
55
57
|
legend,
|
|
56
58
|
tooltip = true,
|
|
57
59
|
loading = false,
|
|
@@ -175,6 +177,7 @@ function DonutChart({
|
|
|
175
177
|
centerLabel: centerLabel ?? labels.total,
|
|
176
178
|
centerValue,
|
|
177
179
|
outside: labelMode(outsideLabels),
|
|
180
|
+
sliceLabels,
|
|
178
181
|
tooltip,
|
|
179
182
|
animate,
|
|
180
183
|
labels,
|
|
@@ -210,6 +213,7 @@ function DonutPlot({
|
|
|
210
213
|
centerLabel,
|
|
211
214
|
centerValue,
|
|
212
215
|
outside: outsideProp,
|
|
216
|
+
sliceLabels,
|
|
213
217
|
tooltip,
|
|
214
218
|
animate,
|
|
215
219
|
labels,
|
|
@@ -335,6 +339,27 @@ function DonutPlot({
|
|
|
335
339
|
}
|
|
336
340
|
return out;
|
|
337
341
|
}, [outside, visible, slices, items, cx, cy, radius, height]);
|
|
342
|
+
const insideLabels = useMemo(() => {
|
|
343
|
+
if (!sliceLabels) return [];
|
|
344
|
+
const fontSize = 11;
|
|
345
|
+
const out = [];
|
|
346
|
+
for (const index of visible) {
|
|
347
|
+
const slice = slices[index];
|
|
348
|
+
const item = items[index];
|
|
349
|
+
if (!slice || !item) continue;
|
|
350
|
+
const text = sliceLabels === "value" ? item.format(item.datum.value) : formatPercent(slice.fraction, { decimals: 0 });
|
|
351
|
+
const fit2 = fitSliceLabel({
|
|
352
|
+
inner,
|
|
353
|
+
radius,
|
|
354
|
+
start: slice.start,
|
|
355
|
+
end: slice.end,
|
|
356
|
+
chars: text.length,
|
|
357
|
+
fontSize
|
|
358
|
+
});
|
|
359
|
+
if (fit2) out.push({ id: item.datum.id, x: cx + fit2.x, y: cy + fit2.y, text });
|
|
360
|
+
}
|
|
361
|
+
return out;
|
|
362
|
+
}, [sliceLabels, visible, slices, items, inner, radius, cx, cy]);
|
|
338
363
|
useEntryAnimation(
|
|
339
364
|
svgRef,
|
|
340
365
|
(root) => {
|
|
@@ -443,6 +468,19 @@ function DonutPlot({
|
|
|
443
468
|
item.datum.id
|
|
444
469
|
);
|
|
445
470
|
}),
|
|
471
|
+
insideLabels.map((label) => /* @__PURE__ */ jsx(
|
|
472
|
+
"text",
|
|
473
|
+
{
|
|
474
|
+
x: label.x,
|
|
475
|
+
y: label.y,
|
|
476
|
+
textAnchor: "middle",
|
|
477
|
+
dominantBaseline: "central",
|
|
478
|
+
pointerEvents: "none",
|
|
479
|
+
className: "fill-surface font-bold text-fs-110 tabular-nums",
|
|
480
|
+
children: label.text
|
|
481
|
+
},
|
|
482
|
+
label.id
|
|
483
|
+
)),
|
|
446
484
|
outsideLabels.map((label) => {
|
|
447
485
|
const dimmed = focusIndex != null && items[focusIndex]?.datum.id !== label.id;
|
|
448
486
|
const avail = Math.max(24, (label.side > 0 ? width - label.x : label.x) - 6);
|
|
@@ -504,7 +542,7 @@ function DonutPlot({
|
|
|
504
542
|
d,
|
|
505
543
|
clickable: onSliceClick != null,
|
|
506
544
|
onEnter: (event) => nav.hover(position, event),
|
|
507
|
-
onLeave: nav.
|
|
545
|
+
onLeave: nav.pointerLeave,
|
|
508
546
|
onClick: onSliceClick ? () => onSliceClick(item.datum) : void 0
|
|
509
547
|
},
|
|
510
548
|
item.datum.id
|
|
@@ -604,6 +642,7 @@ function SliceHitArea({ d, clickable, onEnter, onLeave, onClick }) {
|
|
|
604
642
|
"path",
|
|
605
643
|
{
|
|
606
644
|
"data-slice-hit": "",
|
|
645
|
+
"data-chart-hit": "",
|
|
607
646
|
d,
|
|
608
647
|
fill: "transparent",
|
|
609
648
|
onPointerEnter: onEnter,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SliceLabelInput {
|
|
2
|
+
/** Radius of the hole (0 for a pie). */
|
|
3
|
+
inner: number;
|
|
4
|
+
radius: number;
|
|
5
|
+
/** Angles in radians from 12 o'clock, clockwise. */
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
chars: number;
|
|
9
|
+
fontSize: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SliceLabelFit {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Where a horizontal label sits inside a ring slice, relative to the centre, or null when the text
|
|
17
|
+
* does not fit: the box is projected on the radial and the tangential direction of the slice and
|
|
18
|
+
* must stay within the ring thickness and the arc length at its middle radius.
|
|
19
|
+
*/
|
|
20
|
+
export declare function fitSliceLabel(input: SliceLabelInput): SliceLabelFit | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const CHAR_WIDTH_EM = 0.6;
|
|
2
|
+
const FILL_RATIO = 0.92;
|
|
3
|
+
function fitSliceLabel(input) {
|
|
4
|
+
const { inner, radius, start, end, chars, fontSize } = input;
|
|
5
|
+
const mid = (start + end) / 2;
|
|
6
|
+
const at = inner <= 0 ? radius * 0.62 : (inner + radius) / 2;
|
|
7
|
+
const thickness = inner <= 0 ? radius * 0.7 : radius - inner;
|
|
8
|
+
const arc = (end - start) * at;
|
|
9
|
+
const width = chars * fontSize * CHAR_WIDTH_EM;
|
|
10
|
+
const height = fontSize * 1.1;
|
|
11
|
+
const rx = Math.sin(mid);
|
|
12
|
+
const ry = -Math.cos(mid);
|
|
13
|
+
const radial = width * Math.abs(rx) + height * Math.abs(ry);
|
|
14
|
+
const tangent = width * Math.abs(ry) + height * Math.abs(rx);
|
|
15
|
+
if (radial > thickness * FILL_RATIO || tangent > arc * FILL_RATIO) return null;
|
|
16
|
+
return { x: at * rx, y: at * ry };
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
fitSliceLabel
|
|
20
|
+
};
|
|
@@ -15,7 +15,10 @@ import { DIRECTION_COLORS, directionOf, seriesColor } from "../core/palette.js";
|
|
|
15
15
|
import { PlotOverlay } from "../core/plot-overlay.js";
|
|
16
16
|
import { linearScale } from "../core/scales/linear.js";
|
|
17
17
|
import { ChartTooltip } from "../core/tooltip.js";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
resolveAxisBound,
|
|
20
|
+
resolveLabels
|
|
21
|
+
} from "../core/types.js";
|
|
19
22
|
const MARGIN = { top: 8, bottom: 30 };
|
|
20
23
|
const DELTA_COLUMN = 64;
|
|
21
24
|
const DOT_PAD = 40;
|
|
@@ -278,8 +281,8 @@ function DumbbellPlot({
|
|
|
278
281
|
const lo = all.length ? Math.min(...all) : 0;
|
|
279
282
|
const hi = all.length ? Math.max(...all) : 1;
|
|
280
283
|
const domain = [
|
|
281
|
-
xAxis?.min
|
|
282
|
-
xAxis?.max
|
|
284
|
+
resolveAxisBound(xAxis?.min, lo > 0 && lo < hi * 0.4 ? 0 : lo),
|
|
285
|
+
resolveAxisBound(xAxis?.max, hi)
|
|
283
286
|
];
|
|
284
287
|
const format = resolveAxisFormat(xAxis?.format ?? valueFormat);
|
|
285
288
|
if (vertical) {
|
|
@@ -243,7 +243,7 @@ function FunnelPlot({
|
|
|
243
243
|
opacity: shape.opacity,
|
|
244
244
|
dimmed: active != null && active !== i,
|
|
245
245
|
onEnter: (event) => nav.hover(i, event),
|
|
246
|
-
onLeave: nav.
|
|
246
|
+
onLeave: nav.pointerLeave
|
|
247
247
|
},
|
|
248
248
|
stages[i]?.id ?? i
|
|
249
249
|
)),
|
|
@@ -401,6 +401,7 @@ const StageMark = memo(function StageMark2({
|
|
|
401
401
|
"polygon",
|
|
402
402
|
{
|
|
403
403
|
"data-stage": "",
|
|
404
|
+
"data-chart-hit": "",
|
|
404
405
|
points,
|
|
405
406
|
strokeWidth: 2,
|
|
406
407
|
strokeLinejoin: "round",
|
|
@@ -304,7 +304,7 @@ function GaugePlot({
|
|
|
304
304
|
opacity: needle ? 0.92 : focused === index ? 0.32 : 0,
|
|
305
305
|
dimmed: needle && focused != null && focused !== index,
|
|
306
306
|
onEnter: (event) => nav.hover(index, event),
|
|
307
|
-
onLeave: nav.
|
|
307
|
+
onLeave: nav.pointerLeave
|
|
308
308
|
},
|
|
309
309
|
index
|
|
310
310
|
);
|
|
@@ -474,6 +474,7 @@ const BandMark = memo(function BandMark2({
|
|
|
474
474
|
"path",
|
|
475
475
|
{
|
|
476
476
|
"data-band": "",
|
|
477
|
+
"data-chart-hit": "",
|
|
477
478
|
d,
|
|
478
479
|
fill: "none",
|
|
479
480
|
strokeWidth: width,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColorRange, ScaleColors } from "../core/color-scale.js";
|
|
2
2
|
import { type ValueFormat } from "../core/format.js";
|
|
3
|
+
import type { TooltipRow } from "../core/tooltip.js";
|
|
3
4
|
import { type HeatmapCellInfo, type HeatmapLabels } from "./heatmap-grid.js";
|
|
4
5
|
export interface HeatmapChartProps {
|
|
5
6
|
/** Accessible name of the drawing and caption of the data table. */
|
|
@@ -48,6 +49,8 @@ export interface HeatmapChartProps {
|
|
|
48
49
|
loading?: boolean;
|
|
49
50
|
labels?: Partial<HeatmapLabels>;
|
|
50
51
|
onCellClick?: (cell: HeatmapCellInfo) => void;
|
|
52
|
+
/** Extra tooltip rows for a cell, shown under its value, e.g. an amount next to a count. */
|
|
53
|
+
cellDetail?: (row: number, column: number, value: number | null) => readonly TooltipRow[];
|
|
51
54
|
className?: string;
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
@@ -56,4 +59,4 @@ export interface HeatmapChartProps {
|
|
|
56
59
|
* `ranges` switches to stepped colors. Hover and keyboard focus light the
|
|
57
60
|
* row and column of the cell.
|
|
58
61
|
*/
|
|
59
|
-
export declare function HeatmapChart({ title, rows, columns, values, scale, domain, center, colors, ranges, valueFormat, cellLabels, gap, radius, shape, renderer, height, aspectRatio, legend, tooltip, animate, loading, labels: labelsProp, onCellClick, className, }: HeatmapChartProps): import("react").JSX.Element;
|
|
62
|
+
export declare function HeatmapChart({ title, rows, columns, values, scale, domain, center, colors, ranges, valueFormat, cellLabels, gap, radius, shape, renderer, height, aspectRatio, legend, tooltip, animate, loading, labels: labelsProp, onCellClick, cellDetail, className, }: HeatmapChartProps): import("react").JSX.Element;
|
|
@@ -36,6 +36,7 @@ function HeatmapChart({
|
|
|
36
36
|
loading,
|
|
37
37
|
labels: labelsProp,
|
|
38
38
|
onCellClick,
|
|
39
|
+
cellDetail,
|
|
39
40
|
className
|
|
40
41
|
}) {
|
|
41
42
|
const labels = resolveHeatmapLabels(labelsProp);
|
|
@@ -116,7 +117,8 @@ function HeatmapChart({
|
|
|
116
117
|
renderer,
|
|
117
118
|
tooltip,
|
|
118
119
|
animate,
|
|
119
|
-
onCellClick
|
|
120
|
+
onCellClick,
|
|
121
|
+
cellDetail
|
|
120
122
|
}
|
|
121
123
|
)
|
|
122
124
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ColorRange, type ScaleColors } from "../core/color-scale.js";
|
|
2
2
|
import type { ValueFormatter } from "../core/format.js";
|
|
3
|
+
import { type TooltipRow } from "../core/tooltip.js";
|
|
3
4
|
import { type ChartLabels } from "../core/types.js";
|
|
4
5
|
import type { HeatmapScale } from "./heatmap-scale.js";
|
|
5
6
|
/** Visible strings of the heatmaps. */
|
|
@@ -38,6 +39,8 @@ export interface HeatmapGridProps {
|
|
|
38
39
|
tooltip: boolean;
|
|
39
40
|
animate: boolean;
|
|
40
41
|
onCellClick?: (cell: HeatmapCellInfo) => void;
|
|
42
|
+
/** Extra tooltip rows under the cell value, e.g. a second measure of the same cell. */
|
|
43
|
+
cellDetail?: (row: number, column: number, value: number | null) => readonly TooltipRow[];
|
|
41
44
|
/** Name of the value in the tooltip; the row label by default. */
|
|
42
45
|
valueName?: string;
|
|
43
46
|
/** "hex" lays the cells out as a honeycomb (odd rows shifted half a cell). */
|
|
@@ -58,7 +61,7 @@ export declare function rowGutter(width: number, rowLabels: readonly string[]):
|
|
|
58
61
|
* column like a crosshair and dims the rest. Column labels thin out when they
|
|
59
62
|
* would collide; cell values only show where they fit.
|
|
60
63
|
*/
|
|
61
|
-
export declare function HeatmapGrid({ width, height, title, rowLabels, columnLabels, values, colorScale, format, cellTitle, labels, cellLabels, gap, radius, square, tooltip, animate, onCellClick, valueName, shape, renderer, }: HeatmapGridProps): import("react").JSX.Element;
|
|
64
|
+
export declare function HeatmapGrid({ width, height, title, rowLabels, columnLabels, values, colorScale, format, cellTitle, labels, cellLabels, gap, radius, square, tooltip, animate, onCellClick, cellDetail, valueName, shape, renderer, }: HeatmapGridProps): import("react").JSX.Element;
|
|
62
65
|
export interface HeatmapLegendProps {
|
|
63
66
|
kind: "sequential" | "diverging";
|
|
64
67
|
domain: readonly [number, number];
|
|
@@ -48,6 +48,7 @@ function HeatmapGrid({
|
|
|
48
48
|
tooltip,
|
|
49
49
|
animate,
|
|
50
50
|
onCellClick,
|
|
51
|
+
cellDetail,
|
|
51
52
|
valueName,
|
|
52
53
|
shape = "rect",
|
|
53
54
|
renderer = "svg"
|
|
@@ -426,7 +427,8 @@ function HeatmapGrid({
|
|
|
426
427
|
name: valueName ?? rowLabels[shown.row] ?? "",
|
|
427
428
|
value: shownValue == null ? labels.noData : format(shownValue),
|
|
428
429
|
color: shownColor
|
|
429
|
-
}
|
|
430
|
+
},
|
|
431
|
+
...cellDetail?.(shown.row, shown.column, shownValue ?? null) ?? []
|
|
430
432
|
]
|
|
431
433
|
}
|
|
432
434
|
) : null
|
|
@@ -181,126 +181,135 @@ function HexPlot({
|
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
const anchor = current && active != null ? grid.centers[active] ?? null : null;
|
|
184
|
-
return /* @__PURE__ */ jsxs(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
x: cx,
|
|
234
|
-
y: cy,
|
|
235
|
-
textAnchor: "middle",
|
|
236
|
-
className: "pointer-events-none font-bold tabular-nums",
|
|
237
|
-
style: { fill: cell.ink },
|
|
238
|
-
children: [
|
|
239
|
-
/* @__PURE__ */ jsx(
|
|
240
|
-
"tspan",
|
|
241
|
-
{
|
|
242
|
-
x: cx,
|
|
243
|
-
dy: text.length > 1 ? "-0.15em" : "0.35em",
|
|
244
|
-
fontSize: showCode ? codeSize : valueSize,
|
|
245
|
-
children: text[0]
|
|
184
|
+
return /* @__PURE__ */ jsxs(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
ref: nav.ref,
|
|
188
|
+
className: "relative",
|
|
189
|
+
style: { width, height },
|
|
190
|
+
onPointerLeave: nav.pointerLeave,
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
"svg",
|
|
194
|
+
{
|
|
195
|
+
ref: svgRef,
|
|
196
|
+
role: "img",
|
|
197
|
+
"aria-label": title,
|
|
198
|
+
width,
|
|
199
|
+
height,
|
|
200
|
+
className: "block overflow-visible",
|
|
201
|
+
children: cells.map((cell, index) => {
|
|
202
|
+
const [cx, cy] = grid.centers[index];
|
|
203
|
+
const isActive = index === active;
|
|
204
|
+
const text = [
|
|
205
|
+
showCode ? cell.tile.code : null,
|
|
206
|
+
showValue && cell.value != null ? format(cell.value) : null
|
|
207
|
+
].filter(Boolean);
|
|
208
|
+
return (
|
|
209
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: pointer mirror of the keyboard model on the slider below.
|
|
210
|
+
/* @__PURE__ */ jsxs(
|
|
211
|
+
"g",
|
|
212
|
+
{
|
|
213
|
+
"data-tile": "",
|
|
214
|
+
style: {
|
|
215
|
+
cursor: onTileClick ? "pointer" : "default",
|
|
216
|
+
transformBox: "fill-box",
|
|
217
|
+
transformOrigin: "center"
|
|
218
|
+
},
|
|
219
|
+
onPointerEnter: (event) => nav.hover(index, event),
|
|
220
|
+
onPointerMove: (event) => nav.hover(index, event),
|
|
221
|
+
onClick: () => click(index),
|
|
222
|
+
children: [
|
|
223
|
+
/* @__PURE__ */ jsx(
|
|
224
|
+
"polygon",
|
|
225
|
+
{
|
|
226
|
+
points: hexPoints(cx, cy, grid.size, gap / 2),
|
|
227
|
+
strokeLinejoin: "round",
|
|
228
|
+
className: "motion-safe:transition-[fill] motion-safe:duration-150",
|
|
229
|
+
style: {
|
|
230
|
+
fill: cell.color,
|
|
231
|
+
stroke: isActive ? "var(--ink)" : "var(--surface)",
|
|
232
|
+
strokeWidth: isActive ? 2.5 : 1
|
|
246
233
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
text.length > 0 ? /* @__PURE__ */ jsxs(
|
|
237
|
+
"text",
|
|
238
|
+
{
|
|
239
|
+
...DECORATIVE,
|
|
240
|
+
x: cx,
|
|
241
|
+
y: cy,
|
|
242
|
+
textAnchor: "middle",
|
|
243
|
+
className: "pointer-events-none font-bold tabular-nums",
|
|
244
|
+
style: { fill: cell.ink },
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ jsx(
|
|
247
|
+
"tspan",
|
|
248
|
+
{
|
|
249
|
+
x: cx,
|
|
250
|
+
dy: text.length > 1 ? "-0.15em" : "0.35em",
|
|
251
|
+
fontSize: showCode ? codeSize : valueSize,
|
|
252
|
+
children: text[0]
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
text.length > 1 ? /* @__PURE__ */ jsx("tspan", { x: cx, dy: "1.2em", fontSize: valueSize, className: "font-semibold", children: text[1] }) : null
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
) : null
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
cell.tile.id
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
})
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
/* @__PURE__ */ jsx(
|
|
268
|
+
"div",
|
|
269
|
+
{
|
|
270
|
+
role: "slider",
|
|
271
|
+
tabIndex: 0,
|
|
272
|
+
"aria-label": labels.explore,
|
|
273
|
+
"aria-valuemin": 1,
|
|
274
|
+
"aria-valuemax": Math.max(1, cells.length),
|
|
275
|
+
"aria-valuenow": (active ?? 0) + 1,
|
|
276
|
+
"aria-valuetext": valueText,
|
|
277
|
+
onKeyDown: (event) => {
|
|
278
|
+
if ((event.key === "Enter" || event.key === " ") && active != null) {
|
|
279
|
+
event.preventDefault();
|
|
280
|
+
click(active);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
nav.sliderProps.onKeyDown(event);
|
|
284
|
+
},
|
|
285
|
+
onFocus: nav.sliderProps.onFocus,
|
|
286
|
+
onBlur: nav.sliderProps.onBlur,
|
|
287
|
+
className: cn(
|
|
288
|
+
"pointer-events-none absolute inset-0 rounded-xs outline-none",
|
|
289
|
+
"focus-visible:outline-2 focus-visible:outline-accent-ink focus-visible:outline-offset-4"
|
|
255
290
|
)
|
|
256
|
-
);
|
|
257
|
-
})
|
|
258
|
-
}
|
|
259
|
-
),
|
|
260
|
-
/* @__PURE__ */ jsx(
|
|
261
|
-
"div",
|
|
262
|
-
{
|
|
263
|
-
role: "slider",
|
|
264
|
-
tabIndex: 0,
|
|
265
|
-
"aria-label": labels.explore,
|
|
266
|
-
"aria-valuemin": 1,
|
|
267
|
-
"aria-valuemax": Math.max(1, cells.length),
|
|
268
|
-
"aria-valuenow": (active ?? 0) + 1,
|
|
269
|
-
"aria-valuetext": valueText,
|
|
270
|
-
onKeyDown: (event) => {
|
|
271
|
-
if ((event.key === "Enter" || event.key === " ") && active != null) {
|
|
272
|
-
event.preventDefault();
|
|
273
|
-
click(active);
|
|
274
|
-
return;
|
|
275
291
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
onBlur: nav.sliderProps.onBlur,
|
|
280
|
-
className: cn(
|
|
281
|
-
"pointer-events-none absolute inset-0 rounded-xs outline-none",
|
|
282
|
-
"focus-visible:outline-2 focus-visible:outline-accent-ink focus-visible:outline-offset-4"
|
|
283
|
-
)
|
|
284
|
-
}
|
|
285
|
-
),
|
|
286
|
-
tooltip && current ? /* @__PURE__ */ jsx(
|
|
287
|
-
ChartTooltip,
|
|
288
|
-
{
|
|
289
|
-
x: nav.pointer?.x ?? anchor?.[0] ?? 0,
|
|
290
|
-
y: nav.pointer?.y ?? anchor?.[1] ?? 0,
|
|
291
|
-
containerWidth: width,
|
|
292
|
-
title: current.tile.name,
|
|
293
|
-
rows: [
|
|
292
|
+
),
|
|
293
|
+
tooltip && current ? /* @__PURE__ */ jsx(
|
|
294
|
+
ChartTooltip,
|
|
294
295
|
{
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
x: nav.pointer?.x ?? anchor?.[0] ?? 0,
|
|
297
|
+
y: nav.pointer?.y ?? anchor?.[1] ?? 0,
|
|
298
|
+
containerWidth: width,
|
|
299
|
+
title: current.tile.name,
|
|
300
|
+
rows: [
|
|
301
|
+
{
|
|
302
|
+
id: "value",
|
|
303
|
+
name: valueName,
|
|
304
|
+
value: current.value == null ? labels.noData : format(current.value),
|
|
305
|
+
color: current.color
|
|
306
|
+
}
|
|
307
|
+
]
|
|
299
308
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
309
|
+
) : null
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
);
|
|
304
313
|
}
|
|
305
314
|
export {
|
|
306
315
|
HexTileMap
|
|
@@ -254,9 +254,10 @@ function MorphPlot({
|
|
|
254
254
|
"path",
|
|
255
255
|
{
|
|
256
256
|
d: path,
|
|
257
|
+
"data-chart-hit": "",
|
|
257
258
|
onPointerEnter: (event) => nav.hover(index, event),
|
|
258
259
|
onPointerMove: (event) => nav.hover(index, event),
|
|
259
|
-
onPointerLeave: nav.
|
|
260
|
+
onPointerLeave: nav.pointerLeave,
|
|
260
261
|
style: {
|
|
261
262
|
fill: tint(base, strength),
|
|
262
263
|
opacity: faded * (dimmed ? 0.45 : 1),
|