@jcsoftdev/ui 0.5.0 → 0.6.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 +337 -0
- package/README.md +25 -3
- package/bin/ui-theme.mjs +40 -6
- package/dist/ai/code-block/code-block.js +1 -1
- package/dist/atoms/big-date/big-date.js +2 -2
- package/dist/atoms/button/button.d.ts +6 -1
- package/dist/atoms/button/button.js +2 -2
- package/dist/atoms/chip/chip.d.ts +5 -0
- package/dist/atoms/chip/chip.js +3 -3
- package/dist/atoms/icon-button/icon-button.js +1 -1
- package/dist/atoms/internal/hit-area.d.ts +5 -4
- package/dist/atoms/internal/hit-area.js +1 -1
- package/dist/atoms/progress/index.d.ts +1 -1
- package/dist/atoms/progress/index.js +4 -1
- package/dist/atoms/progress/progress.d.ts +6 -1
- package/dist/atoms/progress/progress.js +19 -1
- package/dist/atoms/radio-group/radio-group.js +1 -1
- package/dist/atoms/status-pill/status-pill.d.ts +16 -5
- package/dist/atoms/status-pill/status-pill.js +43 -18
- package/dist/brand/logo-forge.js +1 -1
- package/dist/charts/candlestick-chart/candlestick-chart.js +2 -2
- package/dist/charts/chart-grid/chart-grid.js +2 -2
- package/dist/charts/chord-chart/chord-chart.js +1 -1
- package/dist/charts/core/axes.js +2 -2
- package/dist/charts/core/cartesian/annotations.js +2 -2
- package/dist/charts/core/cartesian/marks.js +1 -1
- package/dist/charts/core/distribution/marks.js +1 -1
- package/dist/charts/core/distribution/xy-points.js +1 -1
- package/dist/charts/core/export-menu.js +1 -1
- package/dist/charts/funnel-chart/funnel-chart.js +1 -1
- package/dist/charts/gantt-chart/gantt-chart.js +4 -4
- package/dist/charts/gantt-chart/gantt-marks.js +3 -3
- package/dist/charts/index.d.ts +2 -0
- package/dist/charts/index.js +2 -0
- package/dist/charts/maps/geo/map-data-table.js +1 -1
- package/dist/charts/polar-area-chart/polar-area-chart.js +1 -1
- package/dist/charts/radar-chart/radar-chart.js +1 -1
- package/dist/charts/stock-chart/stock-chart.js +1 -1
- package/dist/charts/stock-chart/stock-drawing-layer.js +3 -3
- package/dist/charts/stock-chart/stock-plot.js +2 -2
- package/dist/containers/chat-thread/chat-thread.d.ts +98 -0
- package/dist/containers/chat-thread/chat-thread.js +219 -0
- package/dist/containers/chat-thread/format.d.ts +20 -0
- package/dist/containers/chat-thread/format.js +50 -0
- package/dist/containers/chat-thread/index.d.ts +1 -0
- package/dist/containers/chat-thread/index.js +8 -0
- package/dist/containers/cols/cols.d.ts +1 -1
- package/dist/containers/cols/cols.js +7 -0
- package/dist/containers/comment/comment.js +1 -1
- package/dist/containers/context-rail/context-rail.d.ts +62 -0
- package/dist/containers/context-rail/context-rail.js +175 -0
- package/dist/containers/context-rail/index.d.ts +1 -0
- package/dist/containers/context-rail/index.js +6 -0
- package/dist/containers/dashboard/dashboard.d.ts +40 -0
- package/dist/containers/dashboard/dashboard.js +84 -0
- package/dist/containers/dashboard/index.d.ts +1 -0
- package/dist/containers/dashboard/index.js +14 -0
- package/dist/containers/data-grid/data-grid.demos.js +4 -4
- package/dist/containers/data-grid/data-grid.js +6 -6
- package/dist/containers/data-grid/filter-builder-editor.js +2 -2
- package/dist/containers/data-grid/grid-toolbar.js +1 -1
- package/dist/containers/data-grid/spreadsheet.demos.d.ts +1 -1
- package/dist/containers/data-grid/spreadsheet.demos.js +1 -1
- package/dist/containers/detail-header/detail-header.d.ts +24 -0
- package/dist/containers/detail-header/detail-header.js +32 -0
- package/dist/containers/detail-header/index.d.ts +1 -0
- package/dist/containers/detail-header/index.js +6 -0
- package/dist/containers/facts/facts.js +1 -1
- package/dist/containers/filter-bar/filter-bar.d.ts +58 -0
- package/dist/containers/filter-bar/filter-bar.js +123 -0
- package/dist/containers/filter-bar/index.d.ts +1 -0
- package/dist/containers/filter-bar/index.js +6 -0
- package/dist/containers/hbars/hbars.js +2 -2
- package/dist/containers/index.d.ts +9 -0
- package/dist/containers/index.js +9 -0
- package/dist/containers/kanban/kanban.d.ts +23 -2
- package/dist/containers/kanban/kanban.js +101 -21
- package/dist/containers/kanban/model.d.ts +12 -0
- package/dist/containers/kanban/model.js +8 -0
- package/dist/containers/kpi/kpi.js +1 -1
- package/dist/containers/kpi-group/kpi-group.d.ts +6 -1
- package/dist/containers/kpi-group/kpi-group.js +6 -2
- package/dist/containers/list-detail/index.d.ts +1 -1
- package/dist/containers/list-detail/index.js +4 -0
- package/dist/containers/list-detail/list-detail.d.ts +51 -3
- package/dist/containers/list-detail/list-detail.js +109 -15
- package/dist/containers/page/page.d.ts +17 -4
- package/dist/containers/page/page.js +33 -4
- package/dist/containers/page-header/back.d.ts +10 -0
- package/dist/containers/page-header/back.js +28 -0
- package/dist/containers/page-header/index.d.ts +1 -0
- package/dist/containers/page-header/index.js +1 -0
- package/dist/containers/page-header/page-header.d.ts +19 -2
- package/dist/containers/page-header/page-header.js +26 -2
- package/dist/containers/pagination/cursor-pagination.d.ts +28 -0
- package/dist/containers/pagination/cursor-pagination.js +48 -0
- package/dist/containers/pagination/index.d.ts +3 -0
- package/dist/containers/pagination/index.js +10 -0
- package/dist/containers/pagination/pagination.d.ts +52 -0
- package/dist/containers/pagination/pagination.js +216 -0
- package/dist/containers/pagination/range.d.ts +29 -0
- package/dist/containers/pagination/range.js +42 -0
- package/dist/containers/pagination/use-pagination.d.ts +18 -0
- package/dist/containers/pagination/use-pagination.js +22 -0
- package/dist/containers/responsive-list/responsive-list.d.ts +28 -2
- package/dist/containers/responsive-list/responsive-list.js +134 -25
- package/dist/containers/row-actions/index.d.ts +1 -0
- package/dist/containers/row-actions/index.js +4 -0
- package/dist/containers/row-actions/row-actions.d.ts +26 -0
- package/dist/containers/row-actions/row-actions.js +78 -0
- package/dist/containers/selectable-card/index.d.ts +1 -0
- package/dist/containers/selectable-card/index.js +6 -0
- package/dist/containers/selectable-card/selectable-card.d.ts +26 -0
- package/dist/containers/selectable-card/selectable-card.js +57 -0
- package/dist/containers/settings-layout/settings-layout.d.ts +24 -7
- package/dist/containers/settings-layout/settings-layout.js +63 -8
- package/dist/containers/shortcuts/shortcuts.js +1 -1
- package/dist/containers/table/cell-padding.d.ts +2 -0
- package/dist/containers/table/cell-padding.js +4 -0
- package/dist/containers/table/index.d.ts +1 -0
- package/dist/containers/table/index.js +8 -0
- package/dist/containers/table/sort.d.ts +14 -0
- package/dist/containers/table/sort.js +11 -0
- package/dist/containers/table/table-parts.d.ts +24 -0
- package/dist/containers/table/table-parts.js +52 -0
- package/dist/containers/table/table.d.ts +37 -3
- package/dist/containers/table/table.js +120 -19
- package/dist/containers/table-columns-menu/index.d.ts +1 -0
- package/dist/containers/table-columns-menu/index.js +6 -0
- package/dist/containers/table-columns-menu/table-columns-menu.d.ts +14 -0
- package/dist/containers/table-columns-menu/table-columns-menu.js +46 -0
- package/dist/dashboards/layout.d.ts +1 -27
- package/dist/dashboards/layout.js +8 -40
- package/dist/forms/chip-group/chip-group.d.ts +5 -0
- package/dist/forms/chip-group/chip-group.js +3 -1
- package/dist/forms/combobox/combobox.js +1 -1
- package/dist/forms/copy-field/copy-field.js +1 -1
- package/dist/forms/date-picker/date-picker.d.ts +3 -1
- package/dist/forms/date-picker/date-picker.js +4 -2
- package/dist/forms/date-picker/date-time-picker.d.ts +8 -2
- package/dist/forms/date-picker/date-time-picker.js +13 -2
- package/dist/forms/field/field.d.ts +9 -2
- package/dist/forms/field/field.js +18 -4
- package/dist/forms/fieldset/fieldset.d.ts +11 -0
- package/dist/forms/fieldset/fieldset.js +12 -0
- package/dist/forms/fieldset/index.d.ts +1 -0
- package/dist/forms/fieldset/index.js +4 -0
- package/dist/forms/form-footer/form-footer.d.ts +26 -0
- package/dist/forms/form-footer/form-footer.js +44 -0
- package/dist/forms/form-footer/index.d.ts +1 -0
- package/dist/forms/form-footer/index.js +4 -0
- package/dist/forms/form-grid/form-grid.d.ts +21 -4
- package/dist/forms/form-grid/form-grid.js +20 -3
- package/dist/forms/form-grid/index.d.ts +1 -1
- package/dist/forms/form-grid/index.js +6 -2
- package/dist/forms/form-section/form-section.d.ts +12 -0
- package/dist/forms/form-section/form-section.js +30 -0
- package/dist/forms/form-section/index.d.ts +1 -0
- package/dist/forms/form-section/index.js +4 -0
- package/dist/forms/index.d.ts +3 -0
- package/dist/forms/index.js +3 -0
- package/dist/forms/input/input.d.ts +6 -2
- package/dist/forms/input/input.js +4 -1
- package/dist/forms/internal/listbox-items.d.ts +1 -1
- package/dist/forms/internal/listbox-items.js +3 -2
- package/dist/forms/native-select/native-select.js +1 -1
- package/dist/forms/select/index.d.ts +1 -1
- package/dist/forms/select/select.d.ts +5 -2
- package/dist/forms/select/select.js +7 -2
- package/dist/forms/select-menu/select-menu.js +1 -1
- package/dist/forms/time-input/time-input.d.ts +4 -2
- package/dist/forms/time-input/time-input.js +3 -1
- package/dist/i18n/strings.d.ts +86 -0
- package/dist/i18n/strings.js +46 -0
- package/dist/motion/count-up.d.ts +20 -0
- package/dist/motion/count-up.js +59 -0
- package/dist/motion/cross-fade.d.ts +21 -0
- package/dist/motion/cross-fade.js +86 -0
- package/dist/motion/index.d.ts +5 -0
- package/dist/motion/index.js +14 -0
- package/dist/motion/model.d.ts +15 -0
- package/dist/motion/model.js +68 -0
- package/dist/motion/motion-styles.d.ts +1 -0
- package/dist/motion/motion-styles.js +35 -0
- package/dist/motion/reveal.d.ts +37 -0
- package/dist/motion/reveal.js +69 -0
- package/dist/motion/use-enter-phase.d.ts +11 -0
- package/dist/motion/use-enter-phase.js +40 -0
- package/dist/motion/use-highlight-row.d.ts +22 -0
- package/dist/motion/use-highlight-row.js +38 -0
- package/dist/navigation/tabs/tabs.js +1 -1
- package/dist/navigation/wizard/wizard.d.ts +4 -1
- package/dist/navigation/wizard/wizard.js +3 -0
- package/dist/overlays/alert-dialog/alert-dialog.js +8 -1
- package/dist/overlays/context-menu/context-menu.js +3 -1
- package/dist/overlays/dialog/dialog.js +10 -2
- package/dist/overlays/drawer/drawer.d.ts +18 -4
- package/dist/overlays/drawer/drawer.js +53 -4
- package/dist/overlays/drawer/index.d.ts +1 -1
- package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/overlays/dropdown-menu/dropdown-menu.js +5 -4
- package/dist/overlays/hover-card/hover-card.js +2 -0
- package/dist/overlays/popover/popover.js +2 -0
- package/dist/overlays/toaster/index.d.ts +1 -1
- package/dist/overlays/toaster/toaster.d.ts +28 -2
- package/dist/overlays/toaster/toaster.js +73 -29
- package/dist/overlays/tooltip/tooltip.js +2 -0
- package/dist/primitives/use-presence.js +9 -0
- package/dist/shell/app-shell/app-shell.d.ts +8 -1
- package/dist/shell/app-shell/app-shell.js +50 -3
- package/dist/shell/index.d.ts +1 -0
- package/dist/shell/index.js +1 -0
- package/dist/shell/sidebar/sidebar.d.ts +17 -1
- package/dist/shell/sidebar/sidebar.js +126 -76
- package/dist/shell/topbar/topbar.d.ts +4 -2
- package/dist/shell/topbar/topbar.js +2 -0
- package/dist/showcase/operations-bento.js +2 -2
- package/dist/states/empty-state/empty-state.d.ts +10 -3
- package/dist/states/empty-state/empty-state.js +46 -5
- package/dist/states/error-state/error-state.js +1 -1
- package/dist/states/skeleton/skeleton.js +1 -1
- package/dist/utils/class-tokens.generated.js +4 -6
- package/dist/utils/list-navigation.d.ts +14 -0
- package/dist/utils/list-navigation.js +44 -0
- package/dist/utils/overlay-motion.d.ts +12 -0
- package/dist/utils/overlay-motion.js +14 -0
- package/dist/utils/use-container-width.d.ts +6 -0
- package/dist/utils/use-container-width.js +19 -0
- package/package.json +2 -2
- package/scripts/build-theme.mjs +46 -5
- package/src/ai/code-block/code-block.tsx +1 -1
- package/src/atoms/big-date/big-date.tsx +2 -2
- package/src/atoms/button/button.tsx +8 -3
- package/src/atoms/chip/chip.tsx +8 -3
- package/src/atoms/icon-button/icon-button.tsx +1 -1
- package/src/atoms/internal/hit-area.ts +5 -4
- package/src/atoms/progress/index.ts +8 -1
- package/src/atoms/progress/progress.tsx +30 -1
- package/src/atoms/radio-group/radio-group.tsx +1 -1
- package/src/atoms/status-pill/status-pill.tsx +59 -18
- package/src/brand/logo-forge.tsx +1 -1
- package/src/charts/candlestick-chart/candlestick-chart.tsx +2 -2
- package/src/charts/chart-grid/chart-grid.tsx +2 -2
- package/src/charts/chord-chart/chord-chart.tsx +1 -1
- package/src/charts/core/axes.tsx +2 -2
- package/src/charts/core/cartesian/annotations.tsx +2 -2
- package/src/charts/core/cartesian/marks.tsx +1 -1
- package/src/charts/core/distribution/marks.tsx +1 -1
- package/src/charts/core/distribution/xy-points.tsx +1 -1
- package/src/charts/core/export-menu.tsx +1 -1
- package/src/charts/funnel-chart/funnel-chart.tsx +1 -1
- package/src/charts/gantt-chart/gantt-chart.tsx +4 -4
- package/src/charts/gantt-chart/gantt-marks.tsx +3 -3
- package/src/charts/index.ts +2 -0
- package/src/charts/maps/geo/map-data-table.tsx +1 -1
- package/src/charts/polar-area-chart/polar-area-chart.tsx +1 -1
- package/src/charts/radar-chart/radar-chart.tsx +1 -1
- package/src/charts/stock-chart/stock-chart.tsx +1 -1
- package/src/charts/stock-chart/stock-drawing-layer.tsx +3 -3
- package/src/charts/stock-chart/stock-plot.tsx +2 -2
- package/src/containers/chat-thread/chat-thread.tsx +331 -0
- package/src/containers/chat-thread/format.ts +67 -0
- package/src/containers/chat-thread/index.ts +12 -0
- package/src/containers/cols/cols.tsx +13 -1
- package/src/containers/comment/comment.tsx +1 -1
- package/src/containers/context-rail/context-rail.tsx +229 -0
- package/src/containers/context-rail/index.ts +7 -0
- package/src/containers/dashboard/dashboard.tsx +142 -0
- package/src/containers/dashboard/index.ts +12 -0
- package/src/containers/data-grid/data-grid.demos.tsx +4 -4
- package/src/containers/data-grid/data-grid.tsx +6 -6
- package/src/containers/data-grid/filter-builder-editor.tsx +2 -2
- package/src/containers/data-grid/grid-toolbar.tsx +1 -1
- package/src/containers/data-grid/spreadsheet.demos.tsx +1 -1
- package/src/containers/detail-header/detail-header.tsx +64 -0
- package/src/containers/detail-header/index.ts +5 -0
- package/src/containers/facts/facts.tsx +1 -1
- package/src/containers/filter-bar/filter-bar.tsx +201 -0
- package/src/containers/filter-bar/index.ts +7 -0
- package/src/containers/hbars/hbars.tsx +2 -2
- package/src/containers/index.ts +9 -0
- package/src/containers/kanban/kanban.tsx +146 -39
- package/src/containers/kanban/model.ts +20 -0
- package/src/containers/kpi/kpi.tsx +1 -1
- package/src/containers/kpi-group/kpi-group.tsx +17 -2
- package/src/containers/list-detail/index.ts +5 -0
- package/src/containers/list-detail/list-detail.tsx +157 -9
- package/src/containers/page/page.tsx +61 -7
- package/src/containers/page-header/back.tsx +42 -0
- package/src/containers/page-header/index.ts +1 -0
- package/src/containers/page-header/page-header.tsx +49 -3
- package/src/containers/pagination/cursor-pagination.tsx +79 -0
- package/src/containers/pagination/index.ts +7 -0
- package/src/containers/pagination/pagination.tsx +266 -0
- package/src/containers/pagination/range.ts +68 -0
- package/src/containers/pagination/use-pagination.ts +44 -0
- package/src/containers/responsive-list/responsive-list.tsx +183 -46
- package/src/containers/row-actions/index.ts +1 -0
- package/src/containers/row-actions/row-actions.tsx +114 -0
- package/src/containers/selectable-card/index.ts +5 -0
- package/src/containers/selectable-card/selectable-card.tsx +84 -0
- package/src/containers/settings-layout/settings-layout.tsx +104 -13
- package/src/containers/shortcuts/shortcuts.tsx +1 -1
- package/src/containers/table/cell-padding.ts +2 -0
- package/src/containers/table/index.ts +6 -0
- package/src/containers/table/sort.ts +23 -0
- package/src/containers/table/table-parts.tsx +81 -0
- package/src/containers/table/table.tsx +212 -45
- package/src/containers/table-columns-menu/index.ts +5 -0
- package/src/containers/table-columns-menu/table-columns-menu.tsx +68 -0
- package/src/dashboards/layout.tsx +8 -75
- package/src/forms/chip-group/chip-group.tsx +8 -1
- package/src/forms/combobox/combobox.tsx +1 -1
- package/src/forms/copy-field/copy-field.tsx +1 -1
- package/src/forms/date-picker/date-picker.tsx +7 -2
- package/src/forms/date-picker/date-time-picker.tsx +28 -2
- package/src/forms/field/field.tsx +30 -3
- package/src/forms/fieldset/fieldset.tsx +22 -0
- package/src/forms/fieldset/index.ts +1 -0
- package/src/forms/form-footer/form-footer.tsx +74 -0
- package/src/forms/form-footer/index.ts +1 -0
- package/src/forms/form-grid/form-grid.tsx +42 -5
- package/src/forms/form-grid/index.ts +8 -1
- package/src/forms/form-section/form-section.tsx +41 -0
- package/src/forms/form-section/index.ts +1 -0
- package/src/forms/index.ts +3 -0
- package/src/forms/input/input.tsx +10 -3
- package/src/forms/internal/listbox-items.tsx +3 -4
- package/src/forms/native-select/native-select.tsx +1 -1
- package/src/forms/select/index.ts +1 -1
- package/src/forms/select/select.tsx +14 -3
- package/src/forms/select-menu/select-menu.tsx +1 -1
- package/src/forms/time-input/time-input.tsx +6 -2
- package/src/i18n/strings.ts +86 -0
- package/src/motion/count-up.tsx +83 -0
- package/src/motion/cross-fade.tsx +139 -0
- package/src/motion/index.ts +5 -0
- package/src/motion/model.ts +86 -0
- package/src/motion/motion-styles.tsx +47 -0
- package/src/motion/reveal.tsx +115 -0
- package/src/motion/use-enter-phase.ts +50 -0
- package/src/motion/use-highlight-row.ts +63 -0
- package/src/navigation/tabs/tabs.tsx +1 -1
- package/src/navigation/wizard/wizard.tsx +6 -1
- package/src/overlays/alert-dialog/alert-dialog.tsx +5 -1
- package/src/overlays/context-menu/context-menu.tsx +3 -2
- package/src/overlays/dialog/dialog.tsx +7 -2
- package/src/overlays/drawer/drawer.tsx +68 -6
- package/src/overlays/drawer/index.ts +1 -0
- package/src/overlays/dropdown-menu/dropdown-menu.tsx +5 -4
- package/src/overlays/hover-card/hover-card.tsx +2 -0
- package/src/overlays/popover/popover.tsx +2 -0
- package/src/overlays/toaster/index.ts +2 -0
- package/src/overlays/toaster/toaster.tsx +113 -17
- package/src/overlays/tooltip/tooltip.tsx +2 -0
- package/src/primitives/use-presence.ts +13 -0
- package/src/shell/app-shell/app-shell.tsx +54 -2
- package/src/shell/index.ts +1 -0
- package/src/shell/sidebar/sidebar.tsx +154 -75
- package/src/shell/topbar/topbar.tsx +8 -0
- package/src/showcase/operations-bento.tsx +2 -2
- package/src/states/empty-state/empty-state.tsx +52 -9
- package/src/states/error-state/error-state.tsx +1 -1
- package/src/states/skeleton/skeleton.tsx +1 -1
- package/src/utils/class-tokens.generated.ts +4 -6
- package/src/utils/list-navigation.ts +63 -0
- package/src/utils/overlay-motion.ts +33 -0
- package/src/utils/use-container-width.ts +24 -0
- package/styles/Theme.kt +15 -18
- package/styles/tailwind.css +29 -28
- package/styles/theme.css +29 -28
- package/styles/tokens.css +46 -0
- package/tokens/default.json +51 -29
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
export type ProgressBuiltinTone = "accent" | "neutral" | "success" | "warning" | "danger" | "info";
|
|
4
|
+
/** A built-in tone, or the name of a tone declared in `tonePalettes`. */
|
|
5
|
+
export type ProgressTone = ProgressBuiltinTone | (string & {});
|
|
3
6
|
export type ProgressPart = "root" | "indicator";
|
|
4
7
|
export interface ProgressProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
5
8
|
value: number;
|
|
6
9
|
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
7
10
|
classNames?: ClassNames<ProgressPart>;
|
|
8
11
|
max?: number;
|
|
12
|
+
/** Colour of the indicator. Defaults to `"accent"`. The value is always exposed through the progressbar semantics, never by colour alone. */
|
|
13
|
+
tone?: ProgressTone;
|
|
9
14
|
/** Text announced as `aria-valuetext`; defaults to the rounded percentage. */
|
|
10
15
|
getValueLabel?: (value: number, max: number) => string;
|
|
11
16
|
}
|
|
12
|
-
export declare function Progress({ value, max: maxProp, getValueLabel, className, classNames, ...props }: ProgressProps): import("react").JSX.Element;
|
|
17
|
+
export declare function Progress({ value, max: maxProp, getValueLabel, tone, className, classNames, style, ...props }: ProgressProps): import("react").JSX.Element;
|
|
13
18
|
/** Thinner progress bar. */
|
|
14
19
|
export declare function Meter({ className, ...props }: ProgressProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { customToneStyle, isCustomTone } from "../../utils/tone.js";
|
|
5
|
+
const toneClasses = {
|
|
6
|
+
accent: "bg-accent",
|
|
7
|
+
neutral: "bg-ink-3",
|
|
8
|
+
success: "bg-success",
|
|
9
|
+
warning: "bg-warning",
|
|
10
|
+
danger: "bg-danger",
|
|
11
|
+
info: "bg-info"
|
|
12
|
+
};
|
|
13
|
+
const builtinTones = new Set(Object.keys(toneClasses));
|
|
4
14
|
const DEFAULT_MAX = 100;
|
|
5
15
|
function isValidMax(max) {
|
|
6
16
|
return typeof max === "number" && !Number.isNaN(max) && max > 0;
|
|
@@ -15,8 +25,10 @@ function Progress({
|
|
|
15
25
|
value,
|
|
16
26
|
max: maxProp = DEFAULT_MAX,
|
|
17
27
|
getValueLabel = defaultGetValueLabel,
|
|
28
|
+
tone = "accent",
|
|
18
29
|
className,
|
|
19
30
|
classNames,
|
|
31
|
+
style,
|
|
20
32
|
...props
|
|
21
33
|
}) {
|
|
22
34
|
const max = isValidMax(maxProp) ? maxProp : DEFAULT_MAX;
|
|
@@ -33,6 +45,8 @@ function Progress({
|
|
|
33
45
|
"data-state": state,
|
|
34
46
|
"data-value": current ?? void 0,
|
|
35
47
|
"data-max": max,
|
|
48
|
+
"data-tone": tone === "accent" ? void 0 : tone,
|
|
49
|
+
style: customToneStyle(tone, builtinTones, style),
|
|
36
50
|
className: cn("h-1.5 overflow-hidden rounded-pill bg-track", classNames?.root, className),
|
|
37
51
|
...props,
|
|
38
52
|
children: /* @__PURE__ */ jsx(
|
|
@@ -41,7 +55,11 @@ function Progress({
|
|
|
41
55
|
"data-state": state,
|
|
42
56
|
"data-value": current ?? void 0,
|
|
43
57
|
"data-max": max,
|
|
44
|
-
className: cn(
|
|
58
|
+
className: cn(
|
|
59
|
+
"block h-full transition-transform",
|
|
60
|
+
isCustomTone(tone, builtinTones) ? "bg-(--tone-c)" : toneClasses[tone] ?? toneClasses.accent,
|
|
61
|
+
classNames?.indicator
|
|
62
|
+
),
|
|
45
63
|
style: { transform: `translateX(-${100 - (current ?? 0) / max * 100}%)` }
|
|
46
64
|
}
|
|
47
65
|
)
|
|
@@ -27,7 +27,7 @@ function RadioGroup({ options, className, classNames, ...props }) {
|
|
|
27
27
|
{
|
|
28
28
|
htmlFor: id,
|
|
29
29
|
className: cn(
|
|
30
|
-
"flex cursor-pointer items-start gap-2 rounded-control border-divider p-2.5 text-body
|
|
30
|
+
"flex cursor-pointer items-start gap-2 rounded-control border-divider p-2.5 text-body min-h-(--touch-target) has-[[data-state=checked]]:border-accent has-[[data-state=checked]]:shadow-[inset_0_0_0_1px_var(--accent)]",
|
|
31
31
|
classNames?.option
|
|
32
32
|
),
|
|
33
33
|
children: [
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef } from "react";
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
2
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
3
|
import { type LedStatus } from "../led/index.js";
|
|
4
|
-
export type StatusPillPart = "root" | "dot" | "label";
|
|
4
|
+
export type StatusPillPart = "root" | "icon" | "dot" | "label";
|
|
5
5
|
export interface StatusPillProps extends Omit<ComponentPropsWithRef<"button">, "children" | "onSelect"> {
|
|
6
6
|
status: LedStatus;
|
|
7
7
|
label: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Decorative leading icon, hidden from screen readers; the label still names the status. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** Shows the status dot. Defaults to `true` without an `icon` and `false` with one, where the icon carries the look; the label still names the status either way. */
|
|
11
|
+
dot?: boolean;
|
|
12
|
+
/** Hides the visible label when the surrounding container is narrower than 700 px (the status stays announced). Defaults to `false`: the label is always visible. */
|
|
13
|
+
collapseLabel?: boolean;
|
|
14
|
+
/** Makes the pill a button. Without it, and without `onClick`, the pill is a plain `span`. */
|
|
9
15
|
onSelect?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Forces the element: `true` renders a button even without a handler, `false` a `span` even
|
|
18
|
+
* with one. Omitted, the pill is a button only when `onSelect` or `onClick` is given.
|
|
19
|
+
*/
|
|
20
|
+
interactive?: boolean;
|
|
10
21
|
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
11
22
|
classNames?: ClassNames<StatusPillPart>;
|
|
12
23
|
}
|
|
13
|
-
/** Pill showing a status LED and its label; the label
|
|
14
|
-
export declare function StatusPill({ status, label, onSelect, className, classNames, ...props }: StatusPillProps): import("react").JSX.Element;
|
|
24
|
+
/** Pill showing a status LED and its label; `collapseLabel` hides the label when the surrounding container is narrow. */
|
|
25
|
+
export declare function StatusPill({ status, label, icon, dot, collapseLabel, onSelect, interactive, className, classNames, ...props }: StatusPillProps): import("react").JSX.Element;
|
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { Led } from "../led/index.js";
|
|
5
5
|
function StatusPill({
|
|
6
6
|
status,
|
|
7
7
|
label,
|
|
8
|
+
icon,
|
|
9
|
+
dot,
|
|
10
|
+
collapseLabel = false,
|
|
8
11
|
onSelect,
|
|
12
|
+
interactive,
|
|
9
13
|
className,
|
|
10
14
|
classNames,
|
|
11
15
|
...props
|
|
12
16
|
}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
className: cn(
|
|
21
|
-
"flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-badge border-divider bg-surface-control px-2.5 font-semibold text-fs-120 text-ink-2 hover:enabled:border-line-strong disabled:cursor-default",
|
|
22
|
-
classNames?.root,
|
|
23
|
-
className
|
|
24
|
-
),
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ jsx(Led, { status, label, classNames: { dot: classNames?.dot } }),
|
|
27
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("@max-[700px]:hidden", classNames?.label), children: label })
|
|
28
|
-
]
|
|
29
|
-
}
|
|
17
|
+
const isButton = interactive ?? (onSelect !== void 0 || props.onClick !== void 0);
|
|
18
|
+
const showDot = dot ?? icon == null;
|
|
19
|
+
const rootClass = cn(
|
|
20
|
+
"flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-badge border-divider bg-surface-control px-2.5 font-semibold text-fs-120 text-ink-2",
|
|
21
|
+
isButton && "hover:enabled:border-line-strong disabled:cursor-default",
|
|
22
|
+
classNames?.root,
|
|
23
|
+
className
|
|
30
24
|
);
|
|
25
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
+
icon ? /* @__PURE__ */ jsx(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: cn("inline-flex shrink-0 [&_svg]:size-3.5", classNames?.icon),
|
|
31
|
+
children: icon
|
|
32
|
+
}
|
|
33
|
+
) : null,
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
Led,
|
|
36
|
+
{
|
|
37
|
+
status,
|
|
38
|
+
label,
|
|
39
|
+
classNames: { dot: cn(!showDot && "hidden", classNames?.dot) }
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
className: cn(collapseLabel && "@max-[700px]:hidden", classNames?.label),
|
|
47
|
+
children: label
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] });
|
|
51
|
+
if (!isButton) {
|
|
52
|
+
const { ref, type: _type, disabled: _disabled, onClick: _onClick, ...rest } = props;
|
|
53
|
+
return /* @__PURE__ */ jsx("span", { ...rest, ref, className: rootClass, children: content });
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick: onSelect, ...props, className: rootClass, children: content });
|
|
31
56
|
}
|
|
32
57
|
export {
|
|
33
58
|
StatusPill
|
package/dist/brand/logo-forge.js
CHANGED
|
@@ -99,7 +99,7 @@ function Field({
|
|
|
99
99
|
children
|
|
100
100
|
] });
|
|
101
101
|
}
|
|
102
|
-
const choiceBase = "inline-flex h-control-sm cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-chip px-3 font-semibold text-fs-
|
|
102
|
+
const choiceBase = "inline-flex h-control-sm cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-chip px-3 font-semibold text-fs-120 pressable focus-visible:focus-ring";
|
|
103
103
|
function choiceClass(on) {
|
|
104
104
|
return cn(
|
|
105
105
|
choiceBase,
|
|
@@ -314,7 +314,7 @@ function CandlePlot({
|
|
|
314
314
|
y: 4,
|
|
315
315
|
dy: "0.34em",
|
|
316
316
|
textAnchor: "end",
|
|
317
|
-
className: "fill-ink-3 font-medium text-fs-
|
|
317
|
+
className: "fill-ink-3 font-medium text-fs-110 tabular-nums",
|
|
318
318
|
children: vfmt(maxVolume)
|
|
319
319
|
}
|
|
320
320
|
),
|
|
@@ -403,7 +403,7 @@ function CandlePlot({
|
|
|
403
403
|
y: 0,
|
|
404
404
|
dy: "0.34em",
|
|
405
405
|
textAnchor: "middle",
|
|
406
|
-
className: "font-bold text-fs-
|
|
406
|
+
className: "font-bold text-fs-110 tabular-nums",
|
|
407
407
|
style: { fill: "var(--surface)" },
|
|
408
408
|
children: fmt(last.close)
|
|
409
409
|
}
|
|
@@ -81,11 +81,11 @@ function ChartGrid({
|
|
|
81
81
|
"h3",
|
|
82
82
|
{
|
|
83
83
|
id: headingId,
|
|
84
|
-
className: "m-0 truncate font-bold text-fs-
|
|
84
|
+
className: "m-0 truncate font-bold text-fs-120 text-ink-2 leading-tight",
|
|
85
85
|
children: panel.title
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
|
-
panel.subtitle ? /* @__PURE__ */ jsx("span", { className: "shrink-0 font-semibold text-fs-
|
|
88
|
+
panel.subtitle ? /* @__PURE__ */ jsx("span", { className: "shrink-0 font-semibold text-fs-120 text-ink-3 tabular-nums", children: panel.subtitle }) : null
|
|
89
89
|
] }),
|
|
90
90
|
/* @__PURE__ */ jsx("div", { className: "relative min-w-0", children: children(panel, {
|
|
91
91
|
index,
|
|
@@ -361,7 +361,7 @@ function ChordPlot({
|
|
|
361
361
|
x: at.x,
|
|
362
362
|
y: at.y + (cos > 0.4 ? -2 : cos < -0.4 ? 10 : 4),
|
|
363
363
|
textAnchor: sin > 0.25 ? "start" : sin < -0.25 ? "end" : "middle",
|
|
364
|
-
className: "pointer-events-none select-none fill-ink-2 font-semibold text-fs-
|
|
364
|
+
className: "pointer-events-none select-none fill-ink-2 font-semibold text-fs-120",
|
|
365
365
|
style: { opacity: dim ? 0.4 : 1, transition: "opacity 150ms" },
|
|
366
366
|
children: groups[group.index]?.name
|
|
367
367
|
},
|
package/dist/charts/core/axes.js
CHANGED
|
@@ -70,7 +70,7 @@ const AxisLeft = memo(function AxisLeft2({ ticks, offset, title, color }) {
|
|
|
70
70
|
x: -10,
|
|
71
71
|
y: -16,
|
|
72
72
|
textAnchor: "end",
|
|
73
|
-
className: "fill-ink-3 font-bold text-fs-
|
|
73
|
+
className: "fill-ink-3 font-bold text-fs-110",
|
|
74
74
|
style: color ? { fill: color } : void 0,
|
|
75
75
|
children: title
|
|
76
76
|
}
|
|
@@ -98,7 +98,7 @@ const AxisRight = memo(function AxisRight2({ ticks, offset, title, color }) {
|
|
|
98
98
|
x: 10,
|
|
99
99
|
y: -16,
|
|
100
100
|
textAnchor: "start",
|
|
101
|
-
className: "fill-ink-3 font-bold text-fs-
|
|
101
|
+
className: "fill-ink-3 font-bold text-fs-110",
|
|
102
102
|
style: color ? { fill: color } : void 0,
|
|
103
103
|
children: title
|
|
104
104
|
}
|
|
@@ -21,7 +21,7 @@ function Pill({
|
|
|
21
21
|
y,
|
|
22
22
|
dy: "0.35em",
|
|
23
23
|
textAnchor: "middle",
|
|
24
|
-
className: "font-bold text-fs-
|
|
24
|
+
className: "font-bold text-fs-110",
|
|
25
25
|
style: { fill: ink },
|
|
26
26
|
children: text
|
|
27
27
|
}
|
|
@@ -89,7 +89,7 @@ const AnnotationLayer = memo(function AnnotationLayer2({
|
|
|
89
89
|
{
|
|
90
90
|
x: (horizontal ? 0 : note.from) + 6,
|
|
91
91
|
y: (horizontal ? note.from : 0) + 13,
|
|
92
|
-
className: "font-bold text-fs-
|
|
92
|
+
className: "font-bold text-fs-110",
|
|
93
93
|
style: { fill: ink },
|
|
94
94
|
children: note.label
|
|
95
95
|
}
|
|
@@ -95,7 +95,7 @@ const DataLabels = memo(function DataLabels2({ geometry, dimmed }) {
|
|
|
95
95
|
strokeWidth: label.inside ? 0 : 3,
|
|
96
96
|
strokeLinejoin: "round",
|
|
97
97
|
className: cn(
|
|
98
|
-
"font-bold text-fs-
|
|
98
|
+
"font-bold text-fs-110 tabular-nums",
|
|
99
99
|
label.inside ? "fill-surface" : "fill-ink-2 stroke-surface"
|
|
100
100
|
),
|
|
101
101
|
children: label.text
|
|
@@ -2,7 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { AxisBottom, AxisLeft, GridLines } from "../axes.js";
|
|
4
4
|
import { ChartDataTable } from "../data-table.js";
|
|
5
|
-
const TITLE = "fill-ink-3 font-bold text-fs-
|
|
5
|
+
const TITLE = "fill-ink-3 font-bold text-fs-110";
|
|
6
6
|
const CategoryAxes = memo(function CategoryAxes2({
|
|
7
7
|
layout,
|
|
8
8
|
title,
|
|
@@ -741,7 +741,7 @@ function XYPointPlot({
|
|
|
741
741
|
x: Math.min(trend.x2, innerWidth) - 4,
|
|
742
742
|
y: trend.y2 - 8,
|
|
743
743
|
textAnchor: "end",
|
|
744
|
-
className: "font-bold text-fs-
|
|
744
|
+
className: "font-bold text-fs-110 tabular-nums",
|
|
745
745
|
style: { fill: trend.series.color },
|
|
746
746
|
children: `R\xB2 ${formatNumber(trend.fit.r2, { maximumFractionDigits: 2 })}`
|
|
747
747
|
}
|
|
@@ -37,7 +37,7 @@ function ExportMenu({
|
|
|
37
37
|
type: "button",
|
|
38
38
|
"aria-label": `${texts.export} ${texts[kind]}`,
|
|
39
39
|
onClick: () => run(kind),
|
|
40
|
-
className: "cursor-pointer rounded-button px-2 py-1 font-semibold text-fs-
|
|
40
|
+
className: "cursor-pointer rounded-button px-2 py-1 font-semibold text-fs-120 text-ink-3 outline-none hover:bg-surface hover:text-ink focus-visible:outline-2 focus-visible:outline-accent-ink",
|
|
41
41
|
children: texts[kind]
|
|
42
42
|
},
|
|
43
43
|
kind
|
|
@@ -351,7 +351,7 @@ function FunnelPlot({
|
|
|
351
351
|
x,
|
|
352
352
|
y: y + 4,
|
|
353
353
|
textAnchor: "middle",
|
|
354
|
-
className: cn("fill-ink-2 font-bold text-fs-
|
|
354
|
+
className: cn("fill-ink-2 font-bold text-fs-110 tabular-nums"),
|
|
355
355
|
children: formatPercent(conversion, { decimals: 0 })
|
|
356
356
|
}
|
|
357
357
|
)
|
|
@@ -747,7 +747,7 @@ function GanttBody({
|
|
|
747
747
|
"aria-label": texts.zoomLevels[level2],
|
|
748
748
|
onClick: () => onZoom(level2),
|
|
749
749
|
className: cn(
|
|
750
|
-
"cursor-pointer rounded-button px-2 py-1 font-semibold text-fs-
|
|
750
|
+
"cursor-pointer rounded-button px-2 py-1 font-semibold text-fs-120 outline-none focus-visible:outline-2 focus-visible:outline-accent-ink @md/chart:px-3",
|
|
751
751
|
zoom === level2 ? "bg-surface text-ink shadow-xs" : "text-ink-3 hover:text-ink"
|
|
752
752
|
),
|
|
753
753
|
children: [
|
|
@@ -758,7 +758,7 @@ function GanttBody({
|
|
|
758
758
|
level2
|
|
759
759
|
))
|
|
760
760
|
] }),
|
|
761
|
-
critical || baselines ? /* @__PURE__ */ jsxs("ul", { className: "m-0 hidden min-w-0 list-none items-center gap-3 p-0 text-fs-
|
|
761
|
+
critical || baselines ? /* @__PURE__ */ jsxs("ul", { className: "m-0 hidden min-w-0 list-none items-center gap-3 p-0 text-fs-120 text-ink-3 @xl/chart:flex", children: [
|
|
762
762
|
critical ? /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-1.5 whitespace-nowrap", children: [
|
|
763
763
|
/* @__PURE__ */ jsx(
|
|
764
764
|
"span",
|
|
@@ -827,7 +827,7 @@ function GanttBody({
|
|
|
827
827
|
{
|
|
828
828
|
type: "button",
|
|
829
829
|
onClick: () => scrollToTime(todayTime, true),
|
|
830
|
-
className: "shrink-0 cursor-pointer rounded-button border-divider bg-surface-control px-3 py-1 font-semibold text-fs-
|
|
830
|
+
className: "shrink-0 cursor-pointer rounded-button border-divider bg-surface-control px-3 py-1 font-semibold text-fs-120 text-ink-2 outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent-ink",
|
|
831
831
|
children: texts.today
|
|
832
832
|
}
|
|
833
833
|
) : null
|
|
@@ -1001,7 +1001,7 @@ function GanttBody({
|
|
|
1001
1001
|
"span",
|
|
1002
1002
|
{
|
|
1003
1003
|
"aria-hidden": "true",
|
|
1004
|
-
className: "shrink-0 truncate pr-3 text-right text-fs-
|
|
1004
|
+
className: "shrink-0 truncate pr-3 text-right text-fs-120 text-ink-3 tabular-nums",
|
|
1005
1005
|
style: { width: COLUMN_WIDTH[column] },
|
|
1006
1006
|
children: column === "start" ? columnDate(row.start) : column === "end" ? row.task.milestone && !row.parent ? "" : columnDate(withTime ? row.end : displayEnd(row.start, row.end)) : row.task.milestone && !row.parent ? "" : formatPercent(row.progress, { decimals: 0 })
|
|
1007
1007
|
},
|
|
@@ -64,7 +64,7 @@ const TimelineHeader = memo(function TimelineHeader2({
|
|
|
64
64
|
x,
|
|
65
65
|
y: HEADER_ROW / 2,
|
|
66
66
|
dy: "0.34em",
|
|
67
|
-
className: "fill-ink-2 font-semibold text-fs-
|
|
67
|
+
className: "fill-ink-2 font-semibold text-fs-120",
|
|
68
68
|
children: cell.label
|
|
69
69
|
}
|
|
70
70
|
) : null
|
|
@@ -100,7 +100,7 @@ const TimelineHeader = memo(function TimelineHeader2({
|
|
|
100
100
|
y: HEADER_ROW + HEADER_ROW / 2,
|
|
101
101
|
dy: "0.34em",
|
|
102
102
|
textAnchor: "middle",
|
|
103
|
-
className: "fill-ink-3 font-medium text-fs-
|
|
103
|
+
className: "fill-ink-3 font-medium text-fs-110 tabular-nums",
|
|
104
104
|
children: cell.label
|
|
105
105
|
}
|
|
106
106
|
) : null
|
|
@@ -580,7 +580,7 @@ const AnnotationLayer = memo(function AnnotationLayer2({
|
|
|
580
580
|
x: item.x0 + 10,
|
|
581
581
|
y: y + 7.5,
|
|
582
582
|
dy: "0.34em",
|
|
583
|
-
className: "fill-ink font-semibold text-fs-
|
|
583
|
+
className: "fill-ink font-semibold text-fs-110",
|
|
584
584
|
children: item.label
|
|
585
585
|
}
|
|
586
586
|
)
|
package/dist/charts/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./beeswarm-chart/index.js";
|
|
|
4
4
|
export * from "./box-plot/index.js";
|
|
5
5
|
export * from "./bubble-chart/index.js";
|
|
6
6
|
export * from "./bubble-map/index.js";
|
|
7
|
+
export * from "./bullet-chart/index.js";
|
|
7
8
|
export * from "./candlestick-chart/index.js";
|
|
8
9
|
export * from "./chart-grid/index.js";
|
|
9
10
|
export * from "./chord-chart/index.js";
|
|
@@ -25,6 +26,7 @@ export * from "./histogram/index.js";
|
|
|
25
26
|
export * from "./icicle-chart/index.js";
|
|
26
27
|
export * from "./isotype-rows/index.js";
|
|
27
28
|
export * from "./line-chart/index.js";
|
|
29
|
+
export * from "./lollipop-chart/index.js";
|
|
28
30
|
export * from "./maps/index.js";
|
|
29
31
|
export * from "./parliament-chart/index.js";
|
|
30
32
|
export * from "./pictogram-chart/index.js";
|
package/dist/charts/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./beeswarm-chart/index.js";
|
|
|
4
4
|
export * from "./box-plot/index.js";
|
|
5
5
|
export * from "./bubble-chart/index.js";
|
|
6
6
|
export * from "./bubble-map/index.js";
|
|
7
|
+
export * from "./bullet-chart/index.js";
|
|
7
8
|
export * from "./candlestick-chart/index.js";
|
|
8
9
|
export * from "./chart-grid/index.js";
|
|
9
10
|
export * from "./chord-chart/index.js";
|
|
@@ -25,6 +26,7 @@ export * from "./histogram/index.js";
|
|
|
25
26
|
export * from "./icicle-chart/index.js";
|
|
26
27
|
export * from "./isotype-rows/index.js";
|
|
27
28
|
export * from "./line-chart/index.js";
|
|
29
|
+
export * from "./lollipop-chart/index.js";
|
|
28
30
|
export * from "./maps/index.js";
|
|
29
31
|
export * from "./parliament-chart/index.js";
|
|
30
32
|
export * from "./pictogram-chart/index.js";
|
|
@@ -49,7 +49,7 @@ function MapDataTable({
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
return /* @__PURE__ */ jsx("div", { className: "@container/table overflow-auto rounded-event border-divider", style: { height }, children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-fs-
|
|
52
|
+
return /* @__PURE__ */ jsx("div", { className: "@container/table overflow-auto rounded-event border-divider", style: { height }, children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-fs-120", children: [
|
|
53
53
|
/* @__PURE__ */ jsx("caption", { className: "sr-only", children: caption }),
|
|
54
54
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b-divider", children: [
|
|
55
55
|
header("name", labels.region),
|
|
@@ -330,7 +330,7 @@ function RosePlot({
|
|
|
330
330
|
x: cx + 4,
|
|
331
331
|
y: cy - ring.r - 3,
|
|
332
332
|
...DECORATIVE,
|
|
333
|
-
className: "pointer-events-none fill-ink-3 text-fs-
|
|
333
|
+
className: "pointer-events-none fill-ink-3 text-fs-100 tabular-nums",
|
|
334
334
|
style: { paintOrder: "stroke", stroke: "var(--surface)", strokeWidth: 3 },
|
|
335
335
|
children: axisFormat(ring.value)
|
|
336
336
|
},
|
|
@@ -289,7 +289,7 @@ function StockChart({
|
|
|
289
289
|
setRange(rangeWindow(dates, preset));
|
|
290
290
|
},
|
|
291
291
|
className: cn(
|
|
292
|
-
"cursor-pointer rounded-button px-2 py-1 font-semibold text-fs-
|
|
292
|
+
"cursor-pointer rounded-button px-2 py-1 font-semibold text-fs-120 tabular-nums outline-none focus-visible:outline-2 focus-visible:outline-accent-ink @md/chart:px-2.5",
|
|
293
293
|
activePreset?.id === preset.id ? "bg-surface text-ink shadow-xs" : "text-ink-3 hover:text-ink"
|
|
294
294
|
),
|
|
295
295
|
children: preset.label
|
|
@@ -94,7 +94,7 @@ function DrawingShape({
|
|
|
94
94
|
{
|
|
95
95
|
x: 6,
|
|
96
96
|
y: py - 5,
|
|
97
|
-
className: "font-semibold text-fs-
|
|
97
|
+
className: "font-semibold text-fs-110 tabular-nums",
|
|
98
98
|
style: { fill: COLORS.horizontal },
|
|
99
99
|
children: fmt(drawing.price)
|
|
100
100
|
}
|
|
@@ -149,7 +149,7 @@ function DrawingShape({
|
|
|
149
149
|
{
|
|
150
150
|
x: left2 + 6,
|
|
151
151
|
y: top + 14,
|
|
152
|
-
className: "font-bold text-fs-
|
|
152
|
+
className: "font-bold text-fs-110 tabular-nums",
|
|
153
153
|
style: { fill: COLORS.range },
|
|
154
154
|
children: [
|
|
155
155
|
change > 0 ? "+" : "",
|
|
@@ -251,7 +251,7 @@ function MeasureShape({
|
|
|
251
251
|
y: boxY + 11,
|
|
252
252
|
dy: "0.34em",
|
|
253
253
|
textAnchor: "middle",
|
|
254
|
-
className: "font-bold text-fs-
|
|
254
|
+
className: "font-bold text-fs-110 tabular-nums",
|
|
255
255
|
style: { fill: "var(--surface)" },
|
|
256
256
|
children: label
|
|
257
257
|
}
|
|
@@ -677,7 +677,7 @@ function StockPlot({
|
|
|
677
677
|
] }, `${index}-${level}-${flag.label}`);
|
|
678
678
|
}),
|
|
679
679
|
lower && oscillator ? /* @__PURE__ */ jsxs("g", { transform: `translate(0,${lowerTop})`, children: [
|
|
680
|
-
/* @__PURE__ */ jsxs("text", { ...DECORATIVE, x: 0, y: -7, className: "fill-ink-3 font-semibold text-fs-
|
|
680
|
+
/* @__PURE__ */ jsxs("text", { ...DECORATIVE, x: 0, y: -7, className: "fill-ink-3 font-semibold text-fs-110", children: [
|
|
681
681
|
oscillator.name,
|
|
682
682
|
(() => {
|
|
683
683
|
const index = active ?? view.length - 1;
|
|
@@ -990,7 +990,7 @@ function AxisTag({
|
|
|
990
990
|
y: 0,
|
|
991
991
|
dy: "0.34em",
|
|
992
992
|
textAnchor: "middle",
|
|
993
|
-
className: "font-bold text-fs-
|
|
993
|
+
className: "font-bold text-fs-110 tabular-nums",
|
|
994
994
|
style: { fill: "var(--surface)" },
|
|
995
995
|
children: text
|
|
996
996
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
import { type ChatTimestamp } from "./format.js";
|
|
4
|
+
export type ChatAuthorKind = "customer" | "bot" | "staff";
|
|
5
|
+
export type ChatDeliveryStatus = "sending" | "sent" | "delivered" | "read" | "failed";
|
|
6
|
+
export interface ChatThreadMessage {
|
|
7
|
+
id: string;
|
|
8
|
+
kind?: "message";
|
|
9
|
+
/** Who wrote it: the customer (incoming), the bot or a staff member (outgoing). */
|
|
10
|
+
author: ChatAuthorKind;
|
|
11
|
+
/** Name shown above the bubble. Defaults to the localized author kind. */
|
|
12
|
+
name?: string;
|
|
13
|
+
at: ChatTimestamp;
|
|
14
|
+
content: ReactNode;
|
|
15
|
+
/** Delivery state, shown under outgoing messages only. Omit it to show none. */
|
|
16
|
+
status?: ChatDeliveryStatus;
|
|
17
|
+
}
|
|
18
|
+
/** A line in the middle of the thread that is not a message, e.g. "The customer asked for a person". */
|
|
19
|
+
export interface ChatThreadNote {
|
|
20
|
+
id: string;
|
|
21
|
+
kind: "note";
|
|
22
|
+
at: ChatTimestamp;
|
|
23
|
+
content: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export type ChatThreadItem = ChatThreadMessage | ChatThreadNote;
|
|
26
|
+
export interface ChatThreadLabels {
|
|
27
|
+
conversation: string;
|
|
28
|
+
today: string;
|
|
29
|
+
yesterday: string;
|
|
30
|
+
customer: string;
|
|
31
|
+
bot: string;
|
|
32
|
+
staff: string;
|
|
33
|
+
sending: string;
|
|
34
|
+
sent: string;
|
|
35
|
+
delivered: string;
|
|
36
|
+
read: string;
|
|
37
|
+
notSent: string;
|
|
38
|
+
}
|
|
39
|
+
/** Ready-made labels; the thread defaults to `en`. Pass `chatThreadLabels.es` for Spanish. */
|
|
40
|
+
export declare const chatThreadLabels: {
|
|
41
|
+
readonly en: {
|
|
42
|
+
readonly conversation: "Conversation";
|
|
43
|
+
readonly today: "Today";
|
|
44
|
+
readonly yesterday: "Yesterday";
|
|
45
|
+
readonly customer: "Customer";
|
|
46
|
+
readonly bot: "Bot";
|
|
47
|
+
readonly staff: "Staff";
|
|
48
|
+
readonly sending: "Sending";
|
|
49
|
+
readonly sent: "Sent";
|
|
50
|
+
readonly delivered: "Delivered";
|
|
51
|
+
readonly read: "Read";
|
|
52
|
+
readonly notSent: "Not sent";
|
|
53
|
+
};
|
|
54
|
+
readonly es: {
|
|
55
|
+
readonly conversation: "Conversación";
|
|
56
|
+
readonly today: "Hoy";
|
|
57
|
+
readonly yesterday: "Ayer";
|
|
58
|
+
readonly customer: "Cliente";
|
|
59
|
+
readonly bot: "Bot";
|
|
60
|
+
readonly staff: "Equipo";
|
|
61
|
+
readonly sending: "Enviando";
|
|
62
|
+
readonly sent: "Enviado";
|
|
63
|
+
readonly delivered: "Entregado";
|
|
64
|
+
readonly read: "Leído";
|
|
65
|
+
readonly notSent: "No se envió";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export type ChatThreadPart = "root" | "log" | "day" | "message" | "bubble" | "author" | "meta" | "note" | "composer";
|
|
69
|
+
export interface ChatThreadProps {
|
|
70
|
+
items: readonly ChatThreadItem[];
|
|
71
|
+
/** Slot under the thread, usually a `Textarea` or `PromptInput` with a send button. */
|
|
72
|
+
composer?: ReactNode;
|
|
73
|
+
/** Texts of the thread (name, day labels, authors, delivery states). English by default; see `chatThreadLabels`. */
|
|
74
|
+
labels?: Partial<ChatThreadLabels>;
|
|
75
|
+
/** Accessible name of the thread. Defaults to `labels.conversation`. */
|
|
76
|
+
label?: string;
|
|
77
|
+
/** Called by the retry button of a `failed` message. Without it the button is not shown. */
|
|
78
|
+
onRetry?: (id: string) => void;
|
|
79
|
+
/** Shown instead of the log while there are no items. */
|
|
80
|
+
empty?: ReactNode;
|
|
81
|
+
/** `Intl` locale for times and day labels. */
|
|
82
|
+
locale?: string;
|
|
83
|
+
/** Time zone for times and day breaks; the local one when omitted. */
|
|
84
|
+
timeZone?: string;
|
|
85
|
+
/** The instant "Today" refers to. Pass a fixed value for stable output. Defaults to the current time. */
|
|
86
|
+
now?: ChatTimestamp;
|
|
87
|
+
className?: string;
|
|
88
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
89
|
+
classNames?: ClassNames<ChatThreadPart>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Business conversation between a customer, a bot and staff: incoming messages on the start side,
|
|
93
|
+
* outgoing ones (bot, staff) on the end side with distinct tones, day separators, optional delivery
|
|
94
|
+
* status, system notes and a composer slot. It is a live `log` that stays at the bottom while new
|
|
95
|
+
* items arrive and you are already there. Colors come from the kit tokens in both schemes. The
|
|
96
|
+
* `ai/` chat parts model user and assistant only; this one models the three authors of a shop chat.
|
|
97
|
+
*/
|
|
98
|
+
export declare function ChatThread({ items, composer, labels: labelsProp, label, onRetry, empty, locale, timeZone, now, className, classNames, }: ChatThreadProps): import("react").JSX.Element;
|