@tfn-design/design-system 0.3.0 → 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/README.md +2 -2
- package/dist/accordion/accordion.d.ts +1 -1
- package/dist/accordion/accordion.js +1 -1
- package/dist/accordion/web/ds-accordion.js +5 -4
- package/dist/account-password-field/account-password-field.js +1 -1
- package/dist/account-switcher/account-switcher.d.ts +11 -4
- package/dist/account-switcher/account-switcher.js +2 -1
- package/dist/account-switcher/web/ds-account-switcher.js +12 -4
- package/dist/ai-attachment/ai-attachment.d.ts +1 -1
- package/dist/ai-attachment/ai-attachment.js +1 -1
- package/dist/ai-attachment/web/ds-ai-attachment.js +1 -1
- package/dist/ai-branch-switcher/web/ds-ai-branch-switcher.js +2 -2
- package/dist/ai-composer/ai-composer.d.ts +1 -1
- package/dist/ai-composer/ai-composer.js +1 -1
- package/dist/ai-composer/native/ds-ai-composer.js +4 -2
- package/dist/ai-composer/web/ds-ai-composer.js +2 -3
- package/dist/ai-confirmation/ai-confirmation.d.ts +19 -3
- package/dist/ai-confirmation/ai-confirmation.js +18 -3
- package/dist/ai-confirmation/native/ds-ai-confirmation.js +18 -13
- package/dist/ai-confirmation/web/ds-ai-confirmation.d.ts +1 -1
- package/dist/ai-confirmation/web/ds-ai-confirmation.js +22 -11
- package/dist/ai-context-scope/ai-context-scope.d.ts +10 -2
- package/dist/ai-context-scope/ai-context-scope.js +11 -2
- package/dist/ai-context-scope/native/ds-ai-context-scope.js +4 -3
- package/dist/ai-context-scope/web/ds-ai-context-scope.js +19 -5
- package/dist/ai-conversation-list/ai-conversation-list.d.ts +16 -0
- package/dist/ai-conversation-list/ai-conversation-list.js +8 -0
- package/dist/ai-conversation-list/web/ds-ai-conversation-list.d.ts +10 -6
- package/dist/ai-conversation-list/web/ds-ai-conversation-list.js +89 -47
- package/dist/ai-diff/ai-diff.d.ts +13 -1
- package/dist/ai-diff/ai-diff.js +12 -1
- package/dist/ai-diff/native/ds-ai-diff.d.ts +1 -1
- package/dist/ai-diff/native/ds-ai-diff.js +4 -6
- package/dist/ai-diff/web/ds-ai-diff.d.ts +0 -4
- package/dist/ai-diff/web/ds-ai-diff.js +16 -9
- package/dist/ai-draft-panel/ai-draft-panel.d.ts +2 -0
- package/dist/ai-draft-panel/ai-draft-panel.js +5 -0
- package/dist/ai-draft-panel/web/ds-ai-draft-panel.d.ts +3 -1
- package/dist/ai-draft-panel/web/ds-ai-draft-panel.js +4 -4
- package/dist/ai-empty-state/native/ds-ai-empty-state.js +2 -2
- package/dist/ai-empty-state/web/ds-ai-empty-state.js +3 -1
- package/dist/ai-error-state/ai-error-state.d.ts +2 -2
- package/dist/ai-error-state/ai-error-state.js +2 -2
- package/dist/ai-error-state/native/ds-ai-error-state.d.ts +5 -1
- package/dist/ai-error-state/native/ds-ai-error-state.js +2 -1
- package/dist/ai-error-state/web/ds-ai-error-state.d.ts +5 -1
- package/dist/ai-error-state/web/ds-ai-error-state.js +3 -2
- package/dist/ai-label/native/ds-ai-label.js +2 -1
- package/dist/ai-label/web/ds-ai-label.js +1 -1
- package/dist/ai-message/ai-message.d.ts +1 -1
- package/dist/ai-message/ai-message.js +1 -1
- package/dist/ai-message/native/ds-ai-message.js +4 -3
- package/dist/ai-message/web/ds-ai-message-markdown.js +3 -3
- package/dist/ai-message/web/ds-ai-message.js +4 -3
- package/dist/ai-message-actions/ai-message-actions.d.ts +1 -1
- package/dist/ai-message-actions/ai-message-actions.js +1 -1
- package/dist/ai-message-actions/native/ds-ai-message-actions.js +1 -1
- package/dist/ai-message-actions/web/ds-ai-message-actions.js +1 -1
- package/dist/ai-plan/ai-plan.d.ts +1 -1
- package/dist/ai-plan/ai-plan.js +1 -1
- package/dist/ai-plan/web/ds-ai-plan.js +2 -2
- package/dist/ai-side-nav/web/ds-ai-side-nav.js +4 -3
- package/dist/ai-summary-card/native/ds-ai-summary-card.js +2 -1
- package/dist/ai-summary-card/web/ds-ai-summary-card.js +2 -1
- package/dist/ai-thread/web/ds-ai-thread.js +1 -1
- package/dist/ai-tool-call/ai-tool-call.d.ts +1 -1
- package/dist/ai-tool-call/ai-tool-call.js +1 -1
- package/dist/ai-tool-call/native/ds-ai-tool-call.js +3 -2
- package/dist/ai-tool-call/web/ds-ai-tool-call.js +4 -3
- package/dist/alert/native/ds-alert.js +4 -4
- package/dist/alert/web/ds-alert.js +5 -5
- package/dist/ambient-gradient/ambient-gradient.d.ts +1 -1
- package/dist/amount/amount.d.ts +1 -1
- package/dist/amount/amount.js +3 -2
- package/dist/amount/native/ds-amount.js +1 -1
- package/dist/amount/web/ds-amount.js +1 -1
- package/dist/amount-cell/amount-cell.d.ts +5 -2
- package/dist/amount-cell/web/ds-amount-cell.d.ts +1 -1
- package/dist/amount-cell/web/ds-amount-cell.js +7 -1
- package/dist/amount-entry/amount-entry.d.ts +28 -2
- package/dist/amount-entry/amount-entry.js +19 -12
- package/dist/amount-entry/native/ds-amount-entry.d.ts +1 -1
- package/dist/amount-entry/native/ds-amount-entry.js +5 -4
- package/dist/amount-entry/web/ds-amount-entry.d.ts +1 -1
- package/dist/amount-entry/web/ds-amount-entry.js +5 -4
- package/dist/app-shell/app-shell.d.ts +2 -0
- package/dist/app-shell/web/ds-app-shell.js +26 -3
- package/dist/approval-chain/approval-chain.d.ts +6 -2
- package/dist/approval-chain/approval-chain.js +4 -4
- package/dist/approval-chain/native/ds-approval-chain.js +16 -9
- package/dist/approval-chain/web/ds-approval-chain.d.ts +7 -1
- package/dist/approval-chain/web/ds-approval-chain.js +12 -11
- package/dist/auth-shell/web/ds-auth-shell.d.ts +5 -1
- package/dist/auth-shell/web/ds-auth-shell.js +5 -2
- package/dist/balance-header/balance-header.d.ts +8 -4
- package/dist/balance-header/native/ds-balance-header.d.ts +3 -3
- package/dist/balance-header/native/ds-balance-header.js +11 -4
- package/dist/balance-header/web/ds-balance-header.d.ts +1 -1
- package/dist/balance-header/web/ds-balance-header.js +7 -4
- package/dist/bar-chart/bar-chart.d.ts +46 -5
- package/dist/bar-chart/bar-chart.js +64 -6
- package/dist/bar-chart/web/ds-bar-chart.d.ts +21 -4
- package/dist/bar-chart/web/ds-bar-chart.js +121 -50
- package/dist/bottom-nav/bottom-nav.d.ts +8 -3
- package/dist/bottom-nav/bottom-nav.js +2 -2
- package/dist/bottom-nav/web/ds-bottom-nav.js +2 -2
- package/dist/box-plot/box-plot.d.ts +150 -0
- package/dist/box-plot/box-plot.js +124 -0
- package/dist/box-plot/web/ds-box-plot.d.ts +8 -0
- package/dist/box-plot/web/ds-box-plot.js +57 -0
- package/dist/brand-lockup/native/ds-brand-lockup.js +1 -1
- package/dist/brand-provider/brand-provider.d.ts +29 -0
- package/dist/brand-provider/brand-provider.js +9 -0
- package/dist/brand-provider/native/ds-brand-provider.d.ts +11 -0
- package/dist/brand-provider/native/ds-brand-provider.js +18 -0
- package/dist/brand-provider/web/ds-brand-provider.d.ts +10 -0
- package/dist/brand-provider/web/ds-brand-provider.js +20 -0
- package/dist/bullet-chart/bullet-chart.d.ts +12 -7
- package/dist/bullet-chart/bullet-chart.js +5 -4
- package/dist/bullet-chart/web/ds-bullet-chart.d.ts +1 -1
- package/dist/bullet-chart/web/ds-bullet-chart.js +9 -4
- package/dist/button/button.d.ts +1 -1
- package/dist/button/native/ds-button.js +2 -2
- package/dist/button/web/ds-button.js +1 -1
- package/dist/button-group/button-group.d.ts +1 -1
- package/dist/button-group/web/ds-button-group.d.ts +2 -2
- package/dist/calendar/calendar.d.ts +13 -2
- package/dist/calendar/calendar.js +4 -3
- package/dist/calendar/web/ds-calendar.d.ts +1 -1
- package/dist/calendar/web/ds-calendar.js +6 -5
- package/dist/card-carousel/native/ds-card-carousel.js +1 -1
- package/dist/card-carousel/web/ds-card-carousel.js +2 -2
- package/dist/chart/chart.d.ts +180 -64
- package/dist/chart/chart.js +367 -118
- package/dist/chart/web/ds-chart.d.ts +17 -7
- package/dist/chart/web/ds-chart.js +85 -108
- package/dist/check-option/check-option.d.ts +1 -1
- package/dist/check-option/check-option.js +1 -1
- package/dist/check-option/web/ds-check-option.d.ts +6 -1
- package/dist/check-option/web/ds-check-option.js +10 -6
- package/dist/checkbox/checkbox.d.ts +2 -2
- package/dist/checkbox/checkbox.js +2 -2
- package/dist/checkbox/native/ds-checkbox.js +1 -1
- package/dist/checkbox/web/checkbox-mark.js +1 -1
- package/dist/checkbox/web/ds-checkbox.d.ts +2 -2
- package/dist/checkbox/web/ds-checkbox.js +17 -6
- package/dist/chip/chip.d.ts +11 -11
- package/dist/chip/chip.js +5 -3
- package/dist/chip/native/ds-chip.js +1 -1
- package/dist/chip/web/ds-chip.js +6 -6
- package/dist/code-block/web/ds-code-block.js +3 -3
- package/dist/column-picker/web/ds-column-picker.js +2 -1
- package/dist/combobox/combobox.d.ts +2 -2
- package/dist/combobox/web/ds-combobox.js +4 -2
- package/dist/command-palette/command-palette.d.ts +4 -0
- package/dist/comment-thread/comment-thread.d.ts +2 -2
- package/dist/comment-thread/comment-thread.js +2 -2
- package/dist/comment-thread/native/ds-comment-thread.js +10 -9
- package/dist/comment-thread/web/ds-comment-thread.js +11 -10
- package/dist/condition-builder/condition-builder.d.ts +96 -4
- package/dist/condition-builder/condition-builder.js +68 -28
- package/dist/condition-builder/web/ds-condition-builder.d.ts +4 -2
- package/dist/condition-builder/web/ds-condition-builder.js +97 -57
- package/dist/context-switcher/context-switcher.d.ts +10 -1
- package/dist/context-switcher/context-switcher.js +5 -2
- package/dist/context-switcher/web/ds-context-switcher.d.ts +1 -1
- package/dist/context-switcher/web/ds-context-switcher.js +4 -3
- package/dist/coordinate-field/coordinate-field.d.ts +46 -5
- package/dist/coordinate-field/coordinate-field.js +35 -18
- package/dist/coordinate-field/native/ds-coordinate-field.d.ts +1 -1
- package/dist/coordinate-field/native/ds-coordinate-field.js +9 -8
- package/dist/coordinate-field/web/ds-coordinate-field.d.ts +1 -1
- package/dist/coordinate-field/web/ds-coordinate-field.js +10 -9
- package/dist/copy-field/copy-field.d.ts +23 -9
- package/dist/copy-field/copy-field.js +11 -6
- package/dist/copy-field/web/ds-copy-field.d.ts +1 -1
- package/dist/copy-field/web/ds-copy-field.js +6 -5
- package/dist/copy.d.ts +8 -0
- package/dist/copy.js +7 -0
- package/dist/count-badge/web/ds-count-badge.js +1 -1
- package/dist/countdown/native/ds-countdown.js +1 -1
- package/dist/countdown/web/ds-countdown.js +1 -1
- package/dist/dashboard-shell/dashboard-shell.d.ts +4 -2
- package/dist/data-table/web/data-table-theme.css +340 -52
- package/dist/data-table/web/ds-data-table.d.ts +43 -1
- package/dist/data-table/web/ds-data-table.js +165 -17
- package/dist/date-field/web/ds-date-field.d.ts +1 -1
- package/dist/date-field/web/ds-date-field.js +6 -5
- package/dist/date-input/date-input.d.ts +26 -5
- package/dist/date-input/date-input.js +34 -2
- package/dist/date-input/web/ds-date-input.js +13 -4
- package/dist/date-picker/date-picker.d.ts +38 -67
- package/dist/date-picker/date-picker.js +26 -60
- package/dist/date-picker/web/ds-date-picker.d.ts +13 -6
- package/dist/date-picker/web/ds-date-picker.js +41 -10
- package/dist/date-range-picker/web/ds-date-range-picker.d.ts +10 -4
- package/dist/date-range-picker/web/ds-date-range-picker.js +8 -5
- package/dist/day-picker/day-picker.d.ts +1 -1
- package/dist/day-picker/web/ds-day-picker.js +1 -1
- package/dist/delta/delta.d.ts +15 -1
- package/dist/delta/delta.js +20 -0
- package/dist/delta/native/ds-delta.d.ts +5 -2
- package/dist/delta/native/ds-delta.js +4 -3
- package/dist/delta/web/ds-delta.d.ts +5 -2
- package/dist/delta/web/ds-delta.js +4 -3
- package/dist/description-list/description-list.d.ts +4 -2
- package/dist/description-list/native/ds-description-list.d.ts +2 -2
- package/dist/description-list/native/ds-description-list.js +49 -27
- package/dist/description-list/web/ds-description-list.d.ts +2 -2
- package/dist/description-list/web/ds-description-list.js +40 -17
- package/dist/dialog/dialog.d.ts +12 -1
- package/dist/dialog/web/ds-dialog.d.ts +1 -1
- package/dist/dialog/web/ds-dialog.js +5 -3
- package/dist/diverging-bar-chart/diverging-bar-chart.d.ts +2 -1
- package/dist/diverging-bar-chart/diverging-bar-chart.js +2 -1
- package/dist/diverging-bar-chart/web/ds-diverging-bar-chart.d.ts +1 -1
- package/dist/diverging-bar-chart/web/ds-diverging-bar-chart.js +28 -5
- package/dist/donut-chart/donut-chart.d.ts +7 -1
- package/dist/donut-chart/donut-chart.js +4 -0
- package/dist/donut-chart/web/ds-donut-chart.d.ts +4 -1
- package/dist/donut-chart/web/ds-donut-chart.js +43 -24
- package/dist/drawer/drawer.d.ts +42 -5
- package/dist/drawer/drawer.js +10 -4
- package/dist/drawer/native/ds-drawer.d.ts +1 -1
- package/dist/drawer/native/ds-drawer.js +17 -7
- package/dist/drawer/web/ds-drawer.d.ts +1 -1
- package/dist/drawer/web/ds-drawer.js +32 -17
- package/dist/dropdown-menu/dropdown-menu.d.ts +10 -5
- package/dist/dropdown-menu/dropdown-menu.js +13 -4
- package/dist/dropdown-menu/web/ds-dropdown-menu-surface.d.ts +4 -2
- package/dist/dropdown-menu/web/ds-dropdown-menu-surface.js +6 -6
- package/dist/dropdown-menu/web/ds-dropdown-menu.d.ts +5 -2
- package/dist/dropdown-menu/web/ds-dropdown-menu.js +2 -2
- package/dist/dumbbell-chart/dumbbell-chart.d.ts +10 -9
- package/dist/dumbbell-chart/dumbbell-chart.js +18 -4
- package/dist/dumbbell-chart/web/ds-dumbbell-chart.d.ts +4 -1
- package/dist/dumbbell-chart/web/ds-dumbbell-chart.js +13 -3
- package/dist/editable-row/editable-row.d.ts +5 -1
- package/dist/editable-row/editable-row.js +7 -1
- package/dist/editable-row/web/ds-editable-row.js +7 -5
- package/dist/empty-state/empty-state.d.ts +39 -0
- package/dist/empty-state/empty-state.js +21 -0
- package/dist/empty-state/web/ds-empty-state.d.ts +19 -8
- package/dist/empty-state/web/ds-empty-state.js +15 -3
- package/dist/environment-banner/environment-banner.d.ts +1 -1
- package/dist/environment-banner/environment-banner.js +1 -1
- package/dist/environment-banner/web/ds-environment-banner.js +3 -3
- package/dist/evaluation-trace/evaluation-trace.d.ts +1 -1
- package/dist/evaluation-trace/evaluation-trace.js +1 -1
- package/dist/evaluation-trace/web/ds-evaluation-trace.js +1 -1
- package/dist/event-row/web/ds-event-row.d.ts +1 -1
- package/dist/event-row/web/ds-event-row.js +2 -1
- package/dist/facet-button/facet-button.d.ts +9 -1
- package/dist/facet-button/facet-button.js +2 -2
- package/dist/facet-button/web/ds-facet-button.d.ts +1 -1
- package/dist/facet-button/web/ds-facet-button.js +9 -5
- package/dist/facet-menu/facet-menu.d.ts +1 -1
- package/dist/facet-menu/facet-menu.js +2 -1
- package/dist/facet-menu/web/ds-facet-menu.js +1 -1
- package/dist/fact/native/ds-fact.d.ts +4 -1
- package/dist/file-dropzone/file-dropzone.d.ts +54 -5
- package/dist/file-dropzone/file-dropzone.js +38 -20
- package/dist/file-dropzone/web/ds-file-dropzone.d.ts +1 -1
- package/dist/file-dropzone/web/ds-file-dropzone.js +16 -15
- package/dist/file-field/file-field.d.ts +26 -5
- package/dist/file-field/file-field.js +18 -8
- package/dist/file-field/web/ds-file-field.d.ts +5 -2
- package/dist/file-field/web/ds-file-field.js +6 -5
- package/dist/file-import/file-import.d.ts +50 -4
- package/dist/file-import/file-import.js +30 -11
- package/dist/file-import/web/ds-file-import.d.ts +7 -3
- package/dist/file-import/web/ds-file-import.js +11 -10
- package/dist/file-upload/file-upload.d.ts +64 -15
- package/dist/file-upload/file-upload.js +44 -30
- package/dist/file-upload/web/ds-file-upload.d.ts +11 -2
- package/dist/file-upload/web/ds-file-upload.js +17 -12
- package/dist/filter-bar/web/ds-filter-bar.js +1 -1
- package/dist/filter-button/filter-button.d.ts +5 -4
- package/dist/filter-button/filter-button.js +1 -1
- package/dist/filter-chip/web/ds-filter-chip.js +2 -2
- package/dist/filter-popover/web/ds-filter-popover.js +2 -1
- package/dist/form-field-group/form-field-group.d.ts +7 -2
- package/dist/form-field-group/form-field-group.js +2 -0
- package/dist/form-field-group/web/ds-form-field-group.js +2 -1
- package/dist/form-section/form-section.d.ts +4 -2
- package/dist/form-section/form-section.js +1 -1
- package/dist/funnel/funnel.d.ts +2 -1
- package/dist/funnel/web/ds-funnel.d.ts +1 -1
- package/dist/funnel/web/ds-funnel.js +22 -12
- package/dist/gauge/gauge.d.ts +6 -1
- package/dist/gauge/gauge.js +9 -1
- package/dist/gauge/web/ds-gauge.d.ts +8 -3
- package/dist/gauge/web/ds-gauge.js +26 -15
- package/dist/geo/geo.d.ts +15 -0
- package/dist/geo/geo.js +112 -0
- package/dist/geofence-editor/geofence-editor.d.ts +14 -5
- package/dist/geofence-editor/geofence-editor.js +32 -7
- package/dist/geofence-editor/web/ds-geofence-editor.d.ts +18 -3
- package/dist/geofence-editor/web/ds-geofence-editor.js +28 -13
- package/dist/group-header/web/ds-group-header.d.ts +1 -1
- package/dist/heatmap/heatmap-calendar.d.ts +95 -0
- package/dist/heatmap/heatmap-calendar.js +130 -0
- package/dist/heatmap/heatmap.d.ts +35 -8
- package/dist/heatmap/heatmap.js +61 -7
- package/dist/heatmap/web/ds-heatmap-calendar.d.ts +22 -0
- package/dist/heatmap/web/ds-heatmap-calendar.js +33 -0
- package/dist/heatmap/web/ds-heatmap.d.ts +21 -1
- package/dist/heatmap/web/ds-heatmap.js +59 -31
- package/dist/helper-text/native/ds-helper-text.js +2 -2
- package/dist/helper-text/web/ds-helper-text.js +2 -2
- package/dist/histogram/histogram.d.ts +2 -3
- package/dist/histogram/web/ds-histogram.d.ts +1 -1
- package/dist/histogram/web/ds-histogram.js +8 -2
- package/dist/icon/icon.d.ts +11 -0
- package/dist/icon/icon.js +52 -0
- package/dist/icon/native/ds-icon-provider.d.ts +6 -1
- package/dist/icon/native/ds-icon-provider.js +4 -2
- package/dist/icon/native/icon-direction.d.ts +10 -0
- package/dist/icon/native/icon-direction.js +6 -0
- package/dist/icon/native/use-icon-size.d.ts +6 -0
- package/dist/icon/native/use-icon-size.js +12 -0
- package/dist/icon/web/ds-icon-provider.d.ts +3 -1
- package/dist/icon/web/ds-icon-provider.js +1 -0
- package/dist/icon/web/icon-direction.css +45 -0
- package/dist/icon-button/icon-button.d.ts +6 -0
- package/dist/icon-button/native/ds-icon-button.d.ts +1 -1
- package/dist/icon-button/native/ds-icon-button.js +2 -1
- package/dist/icon-button/web/ds-icon-button.d.ts +1 -1
- package/dist/icon-button/web/ds-icon-button.js +8 -5
- package/dist/icon-frame/icon-frame.d.ts +2 -2
- package/dist/icon-frame/native/ds-icon-frame.js +3 -3
- package/dist/icon-frame/web/ds-icon-frame.js +3 -3
- package/dist/ident/ident.d.ts +2 -0
- package/dist/ident/ident.js +5 -0
- package/dist/ident/native/ds-ident.d.ts +30 -0
- package/dist/ident/native/ds-ident.js +13 -0
- package/dist/index.d.ts +88 -65
- package/dist/index.js +47 -36
- package/dist/inline-edit/inline-edit.d.ts +34 -4
- package/dist/inline-edit/inline-edit.js +19 -7
- package/dist/inline-edit/web/ds-inline-edit.d.ts +1 -1
- package/dist/inline-edit/web/ds-inline-edit.js +13 -8
- package/dist/input/input.d.ts +18 -5
- package/dist/input/input.js +17 -13
- package/dist/input/native/ds-input.js +1 -1
- package/dist/input/web/ds-input.d.ts +7 -1
- package/dist/input/web/ds-input.js +11 -9
- package/dist/interaction.d.ts +7 -5
- package/dist/interaction.js +1 -1
- package/dist/json-viewer/web/ds-json-viewer.js +1 -1
- package/dist/key-value-editor/key-value-editor.d.ts +57 -3
- package/dist/key-value-editor/key-value-editor.js +56 -26
- package/dist/key-value-editor/web/ds-key-value-editor.d.ts +1 -1
- package/dist/key-value-editor/web/ds-key-value-editor.js +15 -16
- package/dist/keypad/keypad.d.ts +21 -11
- package/dist/keypad/keypad.js +16 -10
- package/dist/keypad/native/ds-keypad.d.ts +1 -1
- package/dist/keypad/native/ds-keypad.js +10 -8
- package/dist/keypad/web/ds-keypad.d.ts +1 -1
- package/dist/keypad/web/ds-keypad.js +5 -4
- package/dist/label-picker/label-picker.d.ts +34 -4
- package/dist/label-picker/label-picker.js +28 -17
- package/dist/label-picker/native/ds-label-picker.d.ts +1 -1
- package/dist/label-picker/native/ds-label-picker.js +11 -10
- package/dist/label-picker/web/ds-label-picker.d.ts +1 -1
- package/dist/label-picker/web/ds-label-picker.js +11 -10
- package/dist/labeled-field/labeled-field.d.ts +17 -2
- package/dist/labeled-field/labeled-field.js +7 -5
- package/dist/labeled-field/web/ds-labeled-field.d.ts +1 -1
- package/dist/labeled-field/web/ds-labeled-field.js +6 -2
- package/dist/leaderboard/leaderboard.d.ts +4 -3
- package/dist/leaderboard/leaderboard.js +4 -1
- package/dist/leaderboard/web/ds-leaderboard.d.ts +1 -1
- package/dist/leaderboard/web/ds-leaderboard.js +8 -3
- package/dist/legend/legend.d.ts +4 -0
- package/dist/legend/legend.js +1 -0
- package/dist/legend/web/ds-legend.js +18 -11
- package/dist/lib/chart-context.d.ts +23 -3
- package/dist/lib/chart-context.js +9 -3
- package/dist/lib/chart-finish.d.ts +13 -6
- package/dist/lib/chart-finish.js +8 -2
- package/dist/lib/chart-library.d.ts +1 -1
- package/dist/lib/chart-series.d.ts +7 -4
- package/dist/lib/chart-series.js +2 -4
- package/dist/lib/chart-ticks.d.ts +11 -0
- package/dist/lib/chart-ticks.js +11 -0
- package/dist/lib/chart-value.d.ts +1 -1
- package/dist/lib/chart-value.js +3 -1
- package/dist/lib/cn.d.ts +1 -0
- package/dist/lib/cn.js +7 -2
- package/dist/lib/time-of-day.d.ts +21 -0
- package/dist/lib/time-of-day.js +37 -0
- package/dist/lib/web/chart-finish.d.ts +1 -1
- package/dist/lib/web/chart-finish.js +1 -1
- package/dist/lib/web/density.d.ts +1 -0
- package/dist/lib/web/density.js +7 -0
- package/dist/lib/web/focus-habits.js +20 -8
- package/dist/lib/web/focus-trap.d.ts +10 -0
- package/dist/lib/web/focus-trap.js +4 -1
- package/dist/lib/web/live-announcer.d.ts +2 -0
- package/dist/lib/web/live-announcer.js +2 -1
- package/dist/lib/web/touch-target.d.ts +4 -4
- package/dist/lib/web/touch-target.js +3 -3
- package/dist/lib/web/use-anchored-surface.js +3 -2
- package/dist/lib/web/use-overlay.js +7 -1
- package/dist/list-page/list-page.d.ts +2 -1
- package/dist/list-page/web/ds-list-page.js +1 -5
- package/dist/list-row/list-row.d.ts +6 -6
- package/dist/list-row/list-row.js +4 -5
- package/dist/list-row/native/ds-list-row.js +7 -2
- package/dist/list-row/web/ds-list-row-group.d.ts +6 -2
- package/dist/list-row/web/ds-list-row-group.js +4 -2
- package/dist/list-row/web/ds-list-row.js +9 -9
- package/dist/loading-screen/native/ds-loading-screen.js +1 -1
- package/dist/log-viewer/log-viewer.d.ts +2 -2
- package/dist/log-viewer/log-viewer.js +1 -1
- package/dist/log-viewer/web/ds-log-viewer.js +6 -5
- package/dist/map/map.d.ts +5 -0
- package/dist/map/map.js +2 -0
- package/dist/map/web/ds-map.js +9 -3
- package/dist/map-banner/native/ds-map-banner.js +3 -3
- package/dist/map-banner/web/ds-map-banner.js +4 -4
- package/dist/map-controls/map-controls.d.ts +3 -5
- package/dist/map-controls/map-controls.js +4 -4
- package/dist/map-controls/native/ds-map-controls.js +1 -1
- package/dist/map-controls/web/ds-map-controls.js +1 -1
- package/dist/map-draw-toolbar/web/ds-map-draw-toolbar.js +3 -2
- package/dist/map-heatmap-layer/map-heatmap-layer.d.ts +1 -1
- package/dist/map-layers/map-layers.d.ts +1 -1
- package/dist/map-layers/map-layers.js +1 -1
- package/dist/map-layers/native/ds-map-layers.d.ts +4 -2
- package/dist/map-layers/native/ds-map-layers.js +5 -4
- package/dist/map-layers/web/ds-map-layers.js +4 -4
- package/dist/map-list/map-list.d.ts +2 -1
- package/dist/map-list/web/ds-map-list.d.ts +1 -1
- package/dist/map-list/web/ds-map-list.js +19 -16
- package/dist/map-marker/map-marker.d.ts +5 -0
- package/dist/map-marker/map-marker.js +6 -0
- package/dist/map-marker/web/ds-map-marker.d.ts +12 -3
- package/dist/map-marker/web/ds-map-marker.js +18 -8
- package/dist/map-search/map-search.d.ts +9 -0
- package/dist/map-search/map-search.js +13 -0
- package/dist/map-search/native/ds-map-search.d.ts +10 -3
- package/dist/map-search/native/ds-map-search.js +32 -19
- package/dist/map-search/web/ds-map-search.d.ts +8 -3
- package/dist/map-search/web/ds-map-search.js +37 -27
- package/dist/map-search-area/native/ds-map-search-area.js +2 -1
- package/dist/map-search-area/web/ds-map-search-area.js +2 -1
- package/dist/map-sheet/native/ds-map-sheet.js +1 -1
- package/dist/map-sheet/web/ds-map-sheet.js +2 -2
- package/dist/map-summary/map-summary.d.ts +2 -1
- package/dist/map-summary/web/ds-map-summary.d.ts +2 -2
- package/dist/map-summary/web/ds-map-summary.js +18 -9
- package/dist/mention-input/mention-input.d.ts +23 -2
- package/dist/mention-input/mention-input.js +15 -8
- package/dist/mention-input/native/ds-mention-input.d.ts +1 -1
- package/dist/mention-input/native/ds-mention-input.js +6 -9
- package/dist/mention-input/web/ds-mention-input.d.ts +1 -1
- package/dist/mention-input/web/ds-mention-input.js +6 -5
- package/dist/menu-button/web/ds-menu-button.d.ts +2 -2
- package/dist/menu-button/web/ds-menu-button.js +9 -4
- package/dist/meter/meter.d.ts +5 -2
- package/dist/meter/meter.js +2 -1
- package/dist/meter/native/ds-meter.d.ts +2 -2
- package/dist/meter/native/ds-meter.js +13 -3
- package/dist/meter/web/ds-meter.d.ts +1 -1
- package/dist/meter/web/ds-meter.js +16 -9
- package/dist/metric/metric.d.ts +13 -9
- package/dist/metric/native/ds-metric.d.ts +1 -1
- package/dist/metric/native/ds-metric.js +26 -16
- package/dist/metric/web/ds-metric.d.ts +1 -1
- package/dist/metric/web/ds-metric.js +21 -5
- package/dist/metric-card/metric-card.d.ts +4 -3
- package/dist/metric-card/web/ds-metric-card.d.ts +1 -1
- package/dist/metric-card/web/ds-metric-card.js +4 -2
- package/dist/month-picker/web/ds-month-picker.js +2 -1
- package/dist/month-strip/web/ds-month-strip.js +1 -1
- package/dist/motion.d.ts +18 -3
- package/dist/motion.js +3 -1
- package/dist/multi-select/multi-select.d.ts +39 -9
- package/dist/multi-select/multi-select.js +35 -22
- package/dist/multi-select/web/ds-multi-select.d.ts +1 -1
- package/dist/multi-select/web/ds-multi-select.js +42 -24
- package/dist/native.d.ts +12 -0
- package/dist/native.js +8 -0
- package/dist/notification-list/native/ds-notification-list.d.ts +1 -1
- package/dist/notification-list/native/ds-notification-list.js +14 -7
- package/dist/notification-list/notification-list.d.ts +2 -1
- package/dist/notification-list/web/ds-notification-list.d.ts +1 -1
- package/dist/notification-list/web/ds-notification-list.js +10 -4
- package/dist/number-field/native/ds-number-field.js +1 -1
- package/dist/number-field/web/ds-number-field.js +1 -1
- package/dist/otp/native/ds-otp-field.js +3 -21
- package/dist/otp/native/ds-otp.js +3 -3
- package/dist/otp/otp.d.ts +3 -3
- package/dist/otp/web/ds-otp.js +3 -3
- package/dist/overflow-menu/web/ds-overflow-menu.js +7 -2
- package/dist/page-head/web/ds-page-head.js +2 -2
- package/dist/panel/native/ds-panel.js +1 -1
- package/dist/panel/panel.d.ts +1 -1
- package/dist/panel/web/ds-panel.d.ts +3 -1
- package/dist/panel/web/ds-panel.js +3 -2
- package/dist/password-feedback/web/ds-password-feedback.d.ts +1 -1
- package/dist/password-feedback/web/ds-password-feedback.js +3 -3
- package/dist/password-input/web/ds-password-input.d.ts +7 -2
- package/dist/password-input/web/ds-password-input.js +28 -3
- package/dist/password-requirements/password-requirements.d.ts +12 -2
- package/dist/password-requirements/password-requirements.js +6 -8
- package/dist/password-requirements/web/ds-password-requirements.js +5 -5
- package/dist/password-strength/web/ds-password-strength.js +2 -2
- package/dist/payment-card/native/ds-payment-card.d.ts +1 -1
- package/dist/payment-card/native/ds-payment-card.js +1 -1
- package/dist/payment-card/web/ds-payment-card.d.ts +1 -1
- package/dist/payment-card/web/ds-payment-card.js +1 -1
- package/dist/people-cell/people-cell.d.ts +5 -2
- package/dist/people-cell/web/ds-people-cell.d.ts +1 -1
- package/dist/people-cell/web/ds-people-cell.js +6 -2
- package/dist/person-cell/person-cell.d.ts +5 -2
- package/dist/person-cell/web/ds-person-cell.d.ts +1 -1
- package/dist/person-cell/web/ds-person-cell.js +11 -1
- package/dist/phone-field/native/ds-phone-field.js +2 -2
- package/dist/phone-field/phone-field.d.ts +35 -0
- package/dist/phone-field/phone-field.js +38 -0
- package/dist/phone-field/web/ds-phone-field.d.ts +31 -3
- package/dist/phone-field/web/ds-phone-field.js +45 -8
- package/dist/place-card/native/ds-place-card.d.ts +7 -3
- package/dist/place-card/native/ds-place-card.js +32 -21
- package/dist/place-card/place-card.d.ts +12 -6
- package/dist/place-card/place-card.js +6 -3
- package/dist/place-card/web/ds-place-card.d.ts +5 -3
- package/dist/place-card/web/ds-place-card.js +39 -27
- package/dist/plan-chart/plan-chart.d.ts +2 -3
- package/dist/plan-chart/web/ds-plan-chart.d.ts +1 -1
- package/dist/plan-chart/web/ds-plan-chart.js +34 -6
- package/dist/popover/popover.d.ts +7 -3
- package/dist/popover/web/ds-popover.d.ts +5 -1
- package/dist/popover/web/ds-popover.js +4 -2
- package/dist/priority-indicator/native/ds-priority-indicator.js +4 -4
- package/dist/priority-indicator/priority-indicator.d.ts +3 -3
- package/dist/priority-indicator/priority-indicator.js +3 -3
- package/dist/priority-indicator/web/ds-priority-indicator.js +4 -4
- package/dist/profile-card/profile-card.d.ts +2 -1
- package/dist/profile-card/web/ds-profile-card.d.ts +2 -2
- package/dist/profile-card/web/ds-profile-card.js +16 -3
- package/dist/progress-bar/native/ds-progress-bar.js +2 -1
- package/dist/progress-bar/web/ds-progress-bar.js +2 -1
- package/dist/progress-cell/progress-cell.d.ts +8 -3
- package/dist/progress-cell/progress-cell.js +1 -1
- package/dist/progress-cell/web/ds-progress-cell.d.ts +5 -2
- package/dist/progress-cell/web/ds-progress-cell.js +6 -2
- package/dist/progress-ring/native/ds-progress-ring.js +16 -11
- package/dist/progress-ring/progress-ring.d.ts +8 -4
- package/dist/progress-ring/progress-ring.js +7 -3
- package/dist/progress-ring/web/ds-progress-ring.js +16 -10
- package/dist/proportion-bar/native/ds-proportion-bar.d.ts +2 -2
- package/dist/proportion-bar/native/ds-proportion-bar.js +18 -7
- package/dist/proportion-bar/proportion-bar.d.ts +10 -3
- package/dist/proportion-bar/proportion-bar.js +6 -1
- package/dist/proportion-bar/web/ds-proportion-bar.d.ts +1 -1
- package/dist/proportion-bar/web/ds-proportion-bar.js +21 -14
- package/dist/quick-actions/native/ds-quick-actions.js +17 -2
- package/dist/quick-actions/quick-actions.d.ts +32 -2
- package/dist/quick-actions/quick-actions.js +9 -1
- package/dist/quick-actions/web/ds-quick-actions.js +20 -6
- package/dist/radar-chart/radar-chart.d.ts +11 -3
- package/dist/radar-chart/radar-chart.js +21 -3
- package/dist/radar-chart/web/ds-radar-chart.d.ts +1 -1
- package/dist/radar-chart/web/ds-radar-chart.js +34 -22
- package/dist/radial-progress/native/ds-radial-progress.d.ts +6 -2
- package/dist/radial-progress/native/ds-radial-progress.js +34 -11
- package/dist/radial-progress/radial-progress.d.ts +11 -2
- package/dist/radial-progress/radial-progress.js +9 -0
- package/dist/radial-progress/web/ds-radial-progress.d.ts +6 -2
- package/dist/radial-progress/web/ds-radial-progress.js +24 -10
- package/dist/radio/radio.d.ts +4 -4
- package/dist/radio/radio.js +4 -4
- package/dist/radio/web/ds-radio.d.ts +6 -2
- package/dist/radio/web/ds-radio.js +22 -10
- package/dist/radio-group/radio-group.d.ts +41 -5
- package/dist/radio-group/radio-group.js +5 -0
- package/dist/radio-group/web/ds-radio-group.d.ts +1 -1
- package/dist/radio-group/web/ds-radio-group.js +7 -2
- package/dist/rating-badge/rating-badge.d.ts +8 -2
- package/dist/rating-badge/rating-badge.js +5 -0
- package/dist/rating-badge/web/ds-rating-badge.d.ts +2 -2
- package/dist/rating-badge/web/ds-rating-badge.js +6 -4
- package/dist/recipient-select/recipient-select.d.ts +7 -0
- package/dist/recipient-select/recipient-select.js +3 -0
- package/dist/recipient-select/web/ds-recipient-select.js +4 -4
- package/dist/record-panel/record-panel.d.ts +17 -2
- package/dist/record-panel/web/ds-record-panel.d.ts +48 -13
- package/dist/record-panel/web/ds-record-panel.js +27 -18
- package/dist/reorder-list/reorder-list.d.ts +3 -0
- package/dist/reorder-list/web/ds-reorder-list.d.ts +6 -1
- package/dist/reorder-list/web/ds-reorder-list.js +6 -4
- package/dist/resend-control/native/ds-resend-control.d.ts +24 -0
- package/dist/resend-control/native/ds-resend-control.js +73 -0
- package/dist/resend-control/resend-control.d.ts +2 -0
- package/dist/resend-control/resend-control.js +2 -0
- package/dist/resend-control/web/ds-resend-control.js +3 -3
- package/dist/route-fields/route-fields.d.ts +79 -0
- package/dist/route-fields/route-fields.js +71 -0
- package/dist/route-fields/web/ds-route-fields.d.ts +5 -0
- package/dist/route-fields/web/ds-route-fields.js +83 -0
- package/dist/route-line/web/ds-route-line.js +2 -2
- package/dist/save-bar/save-bar.d.ts +1 -1
- package/dist/save-bar/save-bar.js +1 -1
- package/dist/save-bar/web/ds-save-bar.js +2 -2
- package/dist/scanner/scanner.d.ts +1 -1
- package/dist/scanner/scanner.js +2 -1
- package/dist/scatter-chart/scatter-chart.d.ts +2 -3
- package/dist/scatter-chart/web/ds-scatter-chart.d.ts +1 -1
- package/dist/scatter-chart/web/ds-scatter-chart.js +13 -4
- package/dist/schedule-chart/schedule-chart.d.ts +187 -0
- package/dist/schedule-chart/schedule-chart.js +285 -0
- package/dist/schedule-chart/web/ds-schedule-chart.d.ts +24 -0
- package/dist/schedule-chart/web/ds-schedule-chart.js +143 -0
- package/dist/segmented-control/native/ds-segmented-control.d.ts +1 -1
- package/dist/segmented-control/native/ds-segmented-control.js +1 -1
- package/dist/segmented-control/segmented-control.d.ts +7 -0
- package/dist/segmented-control/web/ds-segmented-control.d.ts +1 -1
- package/dist/segmented-control/web/ds-segmented-control.js +4 -3
- package/dist/select/native/ds-select.js +6 -3
- package/dist/select/select.d.ts +5 -0
- package/dist/select/web/ds-select.d.ts +14 -1
- package/dist/select/web/ds-select.js +22 -12
- package/dist/settings-directory/native/ds-settings-directory.js +1 -1
- package/dist/settings-directory/web/ds-settings-directory.js +1 -1
- package/dist/settings-row/web/ds-settings-row.d.ts +3 -1
- package/dist/settings-row/web/ds-settings-row.js +2 -2
- package/dist/sheet/web/ds-sheet.js +3 -3
- package/dist/side-nav/side-nav.d.ts +2 -1
- package/dist/side-nav/web/ds-side-nav-collapse.d.ts +4 -1
- package/dist/side-nav/web/ds-side-nav-collapse.js +6 -3
- package/dist/side-nav/web/ds-side-nav-header.js +1 -1
- package/dist/side-nav/web/ds-side-nav-primary.js +1 -1
- package/dist/side-nav/web/ds-side-nav-profile.js +1 -1
- package/dist/side-nav/web/ds-side-nav.d.ts +1 -1
- package/dist/side-nav/web/ds-side-nav.js +3 -3
- package/dist/skeleton/skeleton.d.ts +20 -0
- package/dist/skeleton/skeleton.js +4 -0
- package/dist/slider/native/ds-slider.js +1 -1
- package/dist/small-multiples/small-multiples.d.ts +3 -4
- package/dist/small-multiples/small-multiples.js +2 -1
- package/dist/small-multiples/web/ds-small-multiples.d.ts +1 -1
- package/dist/small-multiples/web/ds-small-multiples.js +8 -2
- package/dist/sparkline/sparkline.d.ts +19 -7
- package/dist/sparkline/sparkline.js +42 -17
- package/dist/sparkline/web/ds-sparkline.d.ts +1 -1
- package/dist/sparkline/web/ds-sparkline.js +4 -3
- package/dist/split-pane/web/ds-split-pane.js +2 -2
- package/dist/stat-tile/native/ds-stat-tile.d.ts +3 -3
- package/dist/stat-tile/native/ds-stat-tile.js +14 -7
- package/dist/stat-tile/stat-tile.d.ts +14 -8
- package/dist/stat-tile/web/ds-stat-tile.d.ts +4 -2
- package/dist/stat-tile/web/ds-stat-tile.js +8 -5
- package/dist/state-message/web/ds-state-message.d.ts +6 -2
- package/dist/state-message/web/ds-state-message.js +5 -2
- package/dist/status-badge/native/ds-status-badge.js +3 -3
- package/dist/status-badge/status-badge.d.ts +3 -3
- package/dist/status-badge/status-badge.js +1 -1
- package/dist/status-badge/web/ds-status-badge.js +4 -4
- package/dist/status-cell/status-cell.d.ts +5 -2
- package/dist/status-cell/web/ds-status-cell.d.ts +6 -2
- package/dist/status-cell/web/ds-status-cell.js +7 -2
- package/dist/status-control/web/ds-status-control.js +3 -3
- package/dist/status-dot/native/ds-status-dot.js +1 -1
- package/dist/status-dot/status-dot.d.ts +2 -2
- package/dist/status-dot/status-dot.js +2 -2
- package/dist/status-dot/web/ds-status-dot.js +2 -2
- package/dist/stepper-form/stepper-form.d.ts +27 -4
- package/dist/stepper-form/stepper-form.js +17 -9
- package/dist/stepper-form/web/ds-stepper-form.d.ts +1 -1
- package/dist/stepper-form/web/ds-stepper-form.js +7 -5
- package/dist/stick-chart/stick-chart.d.ts +2 -1
- package/dist/stick-chart/stick-chart.js +2 -1
- package/dist/stick-chart/web/ds-stick-chart.d.ts +1 -1
- package/dist/stick-chart/web/ds-stick-chart.js +17 -3
- package/dist/switch/native/ds-switch.js +1 -1
- package/dist/system-state/native/ds-system-state.d.ts +29 -0
- package/dist/system-state/native/ds-system-state.js +68 -0
- package/dist/system-state/system-state.js +4 -3
- package/dist/system-state/web/ds-system-state.js +2 -2
- package/dist/table-toolbar/web/ds-table-toolbar.js +1 -1
- package/dist/tabs/tabs.d.ts +5 -0
- package/dist/tabs/tabs.js +2 -0
- package/dist/tabs/web/ds-tabs.js +2 -2
- package/dist/task-shell/task-shell.d.ts +15 -6
- package/dist/task-shell/task-shell.js +5 -2
- package/dist/task-shell/web/ds-task-shell.d.ts +21 -6
- package/dist/task-shell/web/ds-task-shell.js +52 -18
- package/dist/text/native/ds-text.js +1 -1
- package/dist/text/text.d.ts +1 -1
- package/dist/text/text.js +1 -1
- package/dist/text/web/ds-text.js +1 -1
- package/dist/textarea/native/ds-textarea.d.ts +1 -1
- package/dist/textarea/native/ds-textarea.js +9 -8
- package/dist/textarea/web/ds-textarea.d.ts +1 -1
- package/dist/textarea/web/ds-textarea.js +8 -7
- package/dist/time-field/time-field.d.ts +37 -0
- package/dist/time-field/time-field.js +23 -0
- package/dist/time-field/web/ds-time-field.d.ts +8 -0
- package/dist/time-field/web/ds-time-field.js +28 -0
- package/dist/time-range/time-range.d.ts +35 -26
- package/dist/time-range/time-range.js +28 -46
- package/dist/time-range/web/ds-time-range.d.ts +1 -1
- package/dist/time-range/web/ds-time-range.js +9 -6
- package/dist/timeline/native/ds-timeline.d.ts +2 -2
- package/dist/timeline/native/ds-timeline.js +21 -7
- package/dist/timeline/timeline.d.ts +2 -1
- package/dist/timeline/web/ds-timeline.d.ts +2 -2
- package/dist/timeline/web/ds-timeline.js +18 -9
- package/dist/toast/native/ds-toast.js +1 -1
- package/dist/toggle-group/native/ds-toggle-group.js +1 -1
- package/dist/token-roles.d.ts +1 -1
- package/dist/token-roles.js +18 -0
- package/dist/tone.d.ts +4 -4
- package/dist/tone.js +1 -5
- package/dist/toolbar/toolbar.d.ts +19 -7
- package/dist/toolbar/toolbar.js +4 -3
- package/dist/toolbar/web/ds-toolbar.d.ts +5 -2
- package/dist/toolbar/web/ds-toolbar.js +3 -3
- package/dist/track-bars/track-bars.d.ts +3 -4
- package/dist/track-bars/web/ds-track-bars.d.ts +1 -1
- package/dist/track-bars/web/ds-track-bars.js +9 -3
- package/dist/tree/tree.d.ts +1 -1
- package/dist/tree/tree.js +1 -1
- package/dist/tree/web/ds-tree.js +2 -2
- package/dist/treemap/treemap.d.ts +2 -3
- package/dist/treemap/web/ds-treemap.d.ts +1 -1
- package/dist/treemap/web/ds-treemap.js +14 -3
- package/dist/two-line-cell/two-line-cell.d.ts +5 -2
- package/dist/two-line-cell/web/ds-two-line-cell.d.ts +1 -1
- package/dist/two-line-cell/web/ds-two-line-cell.js +5 -1
- package/dist/vehicle-marker/vehicle-marker.d.ts +5 -4
- package/dist/vehicle-marker/vehicle-marker.js +3 -3
- package/dist/vehicle-marker/web/ds-vehicle-marker.js +9 -6
- package/dist/waterfall-chart/waterfall-chart.d.ts +10 -5
- package/dist/waterfall-chart/waterfall-chart.js +17 -12
- package/dist/waterfall-chart/web/ds-waterfall-chart.d.ts +7 -2
- package/dist/waterfall-chart/web/ds-waterfall-chart.js +49 -11
- package/dist/web.d.ts +20 -5
- package/dist/web.js +10 -2
- package/dist/week-schedule/web/ds-week-schedule.d.ts +1 -1
- package/dist/week-schedule/web/ds-week-schedule.js +4 -4
- package/dist/week-schedule/week-schedule.d.ts +23 -4
- package/dist/week-schedule/week-schedule.js +19 -13
- package/forced-colors.css +8 -5
- package/package.json +10 -15
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
-
import { type ChartContract, type ChartPoint, type ChartTrendContract } from '../chart';
|
|
2
|
+
import { type ChartContract, type ChartPoint, type ChartForecastSentence, type ChartTrendContract } from '../chart';
|
|
3
3
|
export type DSChartSeriesProps = Omit<ComponentProps<'div'>, 'title' | 'children'> & ChartContract & {
|
|
4
|
-
/** Draws the series in as the chart first appears
|
|
5
|
-
* the left
|
|
6
|
-
*
|
|
4
|
+
/** Draws the series in as the chart first appears, a line uncovered from
|
|
5
|
+
* the left. On by default; a person who has asked for less motion sees the
|
|
6
|
+
* finished chart at once. */
|
|
7
7
|
reveal?: boolean | undefined;
|
|
8
8
|
/** How a figure reads on the axis, in the table and in the summary,
|
|
9
9
|
* a currency, litres, a count. Defaults to en-ZA grouping. */
|
|
10
10
|
formatValue?: ((value: number) => string) | undefined;
|
|
11
|
+
/** How a band's two ends are joined in the readout, the table and the
|
|
12
|
+
* summary, given both already formatted: `(low, high) => \`${low} to ${high}\``.
|
|
13
|
+
* The words are the caller's: this package joins nothing in a language of
|
|
14
|
+
* its own. Defaults to "low – high". */
|
|
15
|
+
formatBandRange?: ((low: string, high: string) => string) | undefined;
|
|
16
|
+
/** How the summary says where a forecast ends, given every part already
|
|
17
|
+
* formatted: `(f) => \`${f.series} is expected to reach ${f.value} by day ${f.at}.\``.
|
|
18
|
+
* The words are the caller's. Without it the parts are set side by side. */
|
|
19
|
+
formatForecast?: ((forecast: ChartForecastSentence) => string) | undefined;
|
|
11
20
|
};
|
|
12
21
|
export type DSChartTrendProps = Omit<ComponentProps<'div'>, 'role' | 'aria-label' | 'children'> & ChartTrendContract & {
|
|
13
22
|
/** What the plot is OF. Required for the reason `DSMeter`'s is: a graphic
|
|
@@ -53,9 +62,10 @@ export type DSChartTrendProps = Omit<ComponentProps<'div'>, 'role' | 'aria-label
|
|
|
53
62
|
/** What the period before is called in the readout and to a screen reader, "Last month". Required whenever `compare` is passed. */
|
|
54
63
|
compareLabel?: string;
|
|
55
64
|
};
|
|
56
|
-
/** Either shape: the full chart (`kind` 'line' | '
|
|
65
|
+
/** Either shape: the full chart (`kind` 'line' | 'stacked-area'), or the
|
|
57
66
|
* trend (`kind` 'trend', or absent with a bare `values` array). */
|
|
58
67
|
export type DSChartProps = DSChartSeriesProps | DSChartTrendProps;
|
|
59
|
-
/** A line
|
|
60
|
-
*
|
|
68
|
+
/** A line or stacked-area chart with a legend, a text summary and its data as a
|
|
69
|
+
* table, or, given only `values`, a trend line for a metric card. For bars, use
|
|
70
|
+
* `DSBarChart`. */
|
|
61
71
|
export declare function DSChart(props: DSChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useId, useRef, useState, } from 'react';
|
|
3
3
|
import { DSButton } from '../../button/web/ds-button';
|
|
4
4
|
import { DSEmptyState } from '../../empty-state/web/ds-empty-state';
|
|
5
5
|
import { DSSkeleton } from '../../skeleton/web/ds-skeleton';
|
|
6
|
+
import { loadingSpoken } from '../../skeleton/skeleton';
|
|
7
|
+
import { SpokenRegion } from '../../lib/web/spoken-region';
|
|
6
8
|
import { DSText } from '../../text/web/ds-text';
|
|
7
|
-
import { CHART_FINISH_GRID_MIN_PX, CHART_FINISH_PARTNER, chartFinishGlowStops, chartFinishGridLines, chartFinishHueVar,
|
|
9
|
+
import { CHART_FINISH_GRID_MIN_PX, CHART_FINISH_PARTNER, chartFinishGlowStops, chartFinishGridLines, chartFinishHueVar, chartFinishSvgId, chartSeriesWashStops, } from '../../lib/chart-finish';
|
|
8
10
|
import { CHART_ACCENT, CHART_QUIET, CHART_SERIES_BG, CHART_SERIES_FILL, CHART_SERIES_STROKE, chartSeriesSlot, } from '../../lib/chart-series';
|
|
9
|
-
import { CHART_FINISH_ORNAMENT, CHART_FINISH_READOUT, ChartFinishGradient,
|
|
11
|
+
import { CHART_FINISH_ORNAMENT, CHART_FINISH_READOUT, ChartFinishGradient, } from '../../lib/web/chart-finish';
|
|
10
12
|
import { CHART_TABLE_CLASSES } from '../../lib/chart-table';
|
|
11
13
|
import { cn } from '../../lib/cn';
|
|
12
|
-
import { CHART_AXIS_BAND_PX, CHART_AXIS_GAP_PX, CHART_CATEGORY_BASELINE_PX,
|
|
14
|
+
import { CHART_AXIS_BAND_PX, CHART_AXIS_GAP_PX, CHART_CATEGORY_BASELINE_PX, CHART_DASH_ARRAYS, CHART_MAX_SERIES, CHART_PLAIN_LOOK, CHART_RIGHT_PAD_PX, CHART_TOP_PAD_PX, CHART_TREND_KIND, CHART_VIEWBOX, allSeries, axisGutter, bandLayout, categorySpacing, chartBandAt, chartBandPath, chartBandRangeDefault, chartCategoryAt, chartCategoryStep, chartNearest, chartScale, chartDrawsWash, chartForecastIssues, chartIsExpected, chartProjectionIndex, chartRangeFor, chartReadingRows, chartSeriesCapIssue, chartSeriesCapNote, chartSeriesLooks, chartSeriesPaths, chartSpec, chartStep, chartTrendSpec, chartCompareNeedsALabel, CHART_COMPARE_NEEDS_A_LABEL, describeChart, chartReferenceLabelPlace, chartOverReference, describeMarks, chartStack, chartStackPaths, formatChartValue, isChartEmpty, labelStride, tableToggleLabel, valueY, visibleSeries, } from '../chart';
|
|
13
15
|
const INK_SLOT = {
|
|
14
16
|
'chart-series-1': 1,
|
|
15
17
|
'chart-series-2': 2,
|
|
@@ -79,17 +81,6 @@ function useBoxSize(ref, active) {
|
|
|
79
81
|
}, [ref, active]);
|
|
80
82
|
return size;
|
|
81
83
|
}
|
|
82
|
-
function barPaint(spec, patternId) {
|
|
83
|
-
return spec.pattern === 'solid'
|
|
84
|
-
? { className: INK_FILL[spec.ink], fill: undefined, ink: 'fill' }
|
|
85
|
-
: { className: INK_STROKE[spec.ink], fill: `url(#${patternId})`, ink: 'stroke' };
|
|
86
|
-
}
|
|
87
|
-
function seriesLooks(kind, series, texture) {
|
|
88
|
-
const looks = chartSeriesLooks(series, texture);
|
|
89
|
-
return kind === 'bar' && series.length === 1
|
|
90
|
-
? looks.map((look) => ({ ...look, ink: 'chart-quiet' }))
|
|
91
|
-
: looks;
|
|
92
|
-
}
|
|
93
84
|
function lookAt(looks, index) {
|
|
94
85
|
return looks[index] ?? { ink: 'chart-series-1', ...CHART_PLAIN_LOOK };
|
|
95
86
|
}
|
|
@@ -106,36 +97,26 @@ function Marker({ shape, ink }) {
|
|
|
106
97
|
return _jsx("path", { d: "M0,-4.6 L4.6,0 L0,4.6 L-4.6,0 Z", className: className, "data-chart-ink": "fill" });
|
|
107
98
|
}
|
|
108
99
|
}
|
|
109
|
-
function
|
|
110
|
-
return (_jsx("svg", { width: 0, height: 0, className: "absolute", "aria-hidden": "true", focusable: "false", children: _jsx("defs", { children: looks.map((spec, j) => {
|
|
111
|
-
if (spec.pattern === 'solid')
|
|
112
|
-
return null;
|
|
113
|
-
const stroke = INK_STROKE[spec.ink];
|
|
114
|
-
return (_jsxs("pattern", { id: idFor(j), width: 6, height: 6, patternUnits: "userSpaceOnUse", children: [spec.pattern === 'hatch' && (_jsx("path", { d: "M-1,1 l2,-2 M0,6 l6,-6 M5,7 l2,-2", strokeWidth: 1.5, className: stroke, "data-chart-ink": "stroke" })), spec.pattern === 'dots' && (_jsx("circle", { cx: 3, cy: 3, r: 1.4, className: INK_FILL[spec.ink], "data-chart-ink": "fill" })), spec.pattern === 'cross' && (_jsx("path", { d: "M0,0 L6,6 M6,0 L0,6", strokeWidth: 1, className: stroke, "data-chart-ink": "stroke" }))] }, j));
|
|
115
|
-
}) }) }));
|
|
116
|
-
}
|
|
117
|
-
function Swatch({ kind, count, index, look, patternId, emphasis, }) {
|
|
100
|
+
function Swatch({ kind, count, index, look, emphasis, }) {
|
|
118
101
|
const spec = look;
|
|
119
102
|
const comparison = spec.ink === 'chart-comparison';
|
|
120
|
-
if (comparison
|
|
103
|
+
if (comparison) {
|
|
121
104
|
return (_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 1.5, strokeLinecap: "round", className: INK_STROKE[spec.ink], "data-chart-ink": "stroke" }) }));
|
|
122
105
|
}
|
|
123
|
-
if (kind === 'line' &&
|
|
106
|
+
if (kind === 'line' && emphasis !== undefined && emphasis >= 0 && emphasis < count) {
|
|
124
107
|
const story = emphasis === index;
|
|
125
108
|
return (_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: story ? 2.5 : 1.5, strokeLinecap: "round", className: story ? CHART_ACCENT.stroke : 'stroke-muted-foreground opacity-40', "data-chart-ink": "stroke" }) }));
|
|
126
109
|
}
|
|
127
|
-
|
|
128
|
-
return (_jsxs("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: [_jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 2, strokeDasharray: CHART_DASH_ARRAYS[spec.dash], strokeLinecap: "round", className: INK_STROKE[spec.ink], "data-chart-ink": "stroke" }), _jsx("g", { transform: "translate(14,6)", children: _jsx(Marker, { shape: spec.marker, ink: spec.ink }) })] }));
|
|
129
|
-
}
|
|
130
|
-
const paint = barPaint(spec, patternId);
|
|
131
|
-
return (_jsx("svg", { width: 14, height: 14, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("rect", { x: 1, y: 1, width: 12, height: 12, rx: 3, strokeWidth: paint.ink === 'stroke' ? 1.5 : 0, fill: paint.fill, className: paint.className, "data-chart-ink": paint.ink }) }));
|
|
110
|
+
return (_jsxs("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: [_jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 2, strokeDasharray: CHART_DASH_ARRAYS[spec.dash], strokeLinecap: "round", className: INK_STROKE[spec.ink], "data-chart-ink": "stroke" }), _jsx("g", { transform: "translate(14,6)", children: _jsx(Marker, { shape: spec.marker, ink: spec.ink }) })] }));
|
|
132
111
|
}
|
|
133
|
-
function
|
|
112
|
+
function ChartSkeleton() {
|
|
113
|
+
return (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3", "data-chart-loading": "", children: [_jsxs("div", { className: "flex gap-4", children: [_jsx(DSSkeleton, { fits: "body-sm", className: "w-20" }), _jsx(DSSkeleton, { fits: "body-sm", className: "w-16" })] }), _jsxs("div", { className: "flex min-h-0 flex-1 gap-3", children: [_jsx("div", { className: "flex w-10 flex-col justify-between pb-6", children: Array.from({ length: 4 }, (_, i) => (_jsx(DSSkeleton, { fits: "body-xs", className: "w-full" }, i))) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [_jsx("div", { className: "flex min-h-0 flex-1 items-end gap-2", children: _jsx(DSSkeleton, { className: "h-full w-full rounded-xs" }) }), _jsx("div", { className: "flex justify-between", children: Array.from({ length: 6 }, (_, i) => (_jsx(DSSkeleton, { fits: "body-xs", className: "w-8" }, i))) })] })] }), _jsxs("div", { className: "flex flex-col", children: [_jsx(DSSkeleton, { fits: "body-sm", className: "w-full" }), _jsx(DSSkeleton, { fits: "body-sm", className: "w-2/3" })] })] }));
|
|
114
|
+
}
|
|
115
|
+
function SeriesChart({ kind, title, categoryLabel, categories, series, emptyDescription, loading = false, loadingLabel, summary, area = true, texture = false, reveal = true, formatValue = formatChartValue, references = [], events = [], emphasis, projectFrom, projectionLabel, projectionMarkerLabel, bandLabel, valueRange, formatBandRange = chartBandRangeDefault, formatForecast, className, ...props }) {
|
|
134
116
|
const uid = useId().replace(/[^a-zA-Z0-9_-]/g, '');
|
|
135
117
|
const summaryId = `${uid}-summary`;
|
|
136
118
|
const tableId = `${uid}-table`;
|
|
137
119
|
const captionId = `${uid}-caption`;
|
|
138
|
-
const patternId = (j) => `${uid}-pattern-${String(j)}`;
|
|
139
120
|
const [open, setOpen] = useState(false);
|
|
140
121
|
const plotRef = useRef(null);
|
|
141
122
|
const [active, setActive] = useState(undefined);
|
|
@@ -145,22 +126,33 @@ function SeriesChart({ kind, title, categoryLabel, categories, series, emptyDesc
|
|
|
145
126
|
const shown = visibleSeries(categories, series);
|
|
146
127
|
const everySeries = allSeries(categories, series);
|
|
147
128
|
const capNote = chartSeriesCapNote(series.length);
|
|
129
|
+
const bandColumns = kind === 'line' && (bandLabel ?? '') !== ''
|
|
130
|
+
? everySeries.flatMap((s, j) => (s.comparison !== true && s.band !== undefined ? [j] : []))
|
|
131
|
+
: [];
|
|
148
132
|
if (process.env['NODE_ENV'] !== 'production' && series.length > CHART_MAX_SERIES) {
|
|
149
133
|
console.warn(`DSChart: ${chartSeriesCapIssue(series.length)}`);
|
|
150
134
|
}
|
|
151
|
-
const looks =
|
|
135
|
+
const looks = chartSeriesLooks(shown, texture);
|
|
152
136
|
const spec = chartSpec();
|
|
153
137
|
const reach = references.map((r) => r.value);
|
|
154
|
-
const
|
|
138
|
+
const split = kind === 'line' ? chartProjectionIndex(projectFrom, categories.length) : undefined;
|
|
139
|
+
const bandSeries = kind === 'line' ? shown.flatMap((s, j) => (s.comparison !== true && s.band !== undefined ? [j] : [])) : [];
|
|
140
|
+
const leadSeries = shown.findIndex((s) => s.comparison !== true);
|
|
141
|
+
if (process.env['NODE_ENV'] !== 'production') {
|
|
142
|
+
for (const issue of chartForecastIssues({ kind, categories, series, projectFrom, projectionLabel, projectionMarkerLabel, bandLabel, valueRange })) {
|
|
143
|
+
console.error(`DSChart: ${issue}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const range = chartRangeFor(kind, valueRange);
|
|
147
|
+
const scale = chartScale(kind === 'stacked-area' ? chartStack(shown) : shown, undefined, reach, range);
|
|
155
148
|
const gutter = axisGutter(scale.ticks.map(formatValue));
|
|
156
149
|
const plotWidth = Math.max(0, width - gutter - CHART_RIGHT_PAD_PX);
|
|
157
|
-
const bands = bandLayout(categories.length,
|
|
150
|
+
const bands = bandLayout(categories.length, plotWidth);
|
|
158
151
|
const reported = active ?? Math.max(0, categories.length - 1);
|
|
152
|
+
const words = { projectFrom: split, projectionLabel, bandLabel };
|
|
153
|
+
const readingRows = (i) => chartReadingRows(shown, i, words, formatValue, formatBandRange);
|
|
159
154
|
function describePoint(i) {
|
|
160
|
-
const parts =
|
|
161
|
-
const v = s.values[i] ?? null;
|
|
162
|
-
return `${s.label} ${v === null ? 'no figure' : formatValue(v)}`;
|
|
163
|
-
});
|
|
155
|
+
const parts = readingRows(i).map((row) => `${row.label} ${row.text}`);
|
|
164
156
|
return `${categories[i] ?? ''}: ${parts.join(', ')}`;
|
|
165
157
|
}
|
|
166
158
|
function onPointer(event) {
|
|
@@ -195,98 +187,83 @@ function SeriesChart({ kind, title, categoryLabel, categories, series, emptyDesc
|
|
|
195
187
|
}
|
|
196
188
|
const description = summary !== undefined && summary.trim() !== ''
|
|
197
189
|
? summary
|
|
198
|
-
: describeChart({ kind, categories, series }, formatValue);
|
|
199
|
-
const marks = describeMarks(references, events, categories, formatValue);
|
|
200
|
-
return (_jsxs("div", { className: cn('min-w-0', className), "data-forced-colors": "chart", ...props, children: [_jsx(
|
|
190
|
+
: describeChart({ kind, categories, series, projectFrom: split, projectionLabel, bandLabel }, formatValue, formatBandRange, formatForecast);
|
|
191
|
+
const marks = describeMarks(references, events, categories, formatValue, shown, { kind, projectFrom: split });
|
|
192
|
+
return (_jsxs("div", { className: cn('min-w-0', className), "data-forced-colors": "chart", ...props, children: [_jsx(SpokenRegion, { text: loadingSpoken(loading, loadingLabel) }), _jsxs("div", { className: "flex h-80 min-w-0 flex-col gap-3", "aria-busy": loading ? true : undefined, "data-chart-body": "", children: [loading && _jsx(ChartSkeleton, {}), empty && (_jsx(DSEmptyState, { description: emptyDescription, className: "flex h-full flex-col items-center justify-center" })), drawn && (_jsxs(_Fragment, { children: [_jsxs("ul", { className: "flex flex-wrap gap-x-4 gap-y-1", "aria-label": "Series", children: [shown.map((s, j) => (_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(Swatch, { kind: kind, count: shown.length, index: j, look: lookAt(looks, j), emphasis: emphasis }), _jsx(DSText, { variant: "body-sm", children: s.label })] }, j))), split !== undefined && (projectionLabel ?? '') !== '' && leadSeries >= 0 && (_jsxs("li", { className: "flex items-center gap-2", "data-chart-legend": "projection", children: [_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 2, strokeDasharray: CHART_DASH_ARRAYS.dashed, strokeLinecap: "round", className: emphasis === leadSeries ? CHART_ACCENT.stroke : INK_STROKE[lookAt(looks, leadSeries).ink], "data-chart-ink": "stroke" }) }), _jsx(DSText, { variant: "body-sm", children: projectionLabel })] })), bandSeries.length > 0 && (bandLabel ?? '') !== '' && (_jsxs("li", { className: "flex items-center gap-2", "data-chart-legend": "band", children: [_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("rect", { x: 1, y: 1, width: 26, height: 10, rx: 3, className: cn(INK_FILL[lookAt(looks, bandSeries[0] ?? 0).ink], CHART_BAND_OPACITY), "data-chart-ink": "fill" }) }), _jsx(DSText, { variant: "body-sm", children: bandLabel })] }))] }), _jsx("div", { ref: plotRef, role: "slider", tabIndex: 0, "aria-label": title, "aria-describedby": summaryId, "aria-orientation": "horizontal", "aria-valuemin": 0, "aria-valuemax": Math.max(0, categories.length - 1), "aria-valuenow": reported, "aria-valuetext": describePoint(reported), className: "focusable relative min-h-0 min-w-0 flex-1 cursor-crosshair touch-pan-y rounded-xs", onPointerMove: onPointer, onPointerDown: onPointer, onPointerUp: onPointerEnd, onPointerLeave: onPointerEnd, onPointerCancel: onPointerEnd, onKeyDown: onKeyDown, onBlur: () => {
|
|
201
193
|
setActive(undefined);
|
|
202
|
-
}, children: _jsx(Plot, { kind: kind, uid: uid, title: title, categories: categories, series: shown, width: width, height: height, formatValue: formatValue,
|
|
194
|
+
}, children: _jsx(Plot, { kind: kind, uid: uid, title: title, categories: categories, series: shown, width: width, height: height, formatValue: formatValue, spec: spec, area: area, looks: looks, reveal: reveal, active: active, references: references, events: events, emphasis: emphasis, range: range, split: split, markerLabel: projectionMarkerLabel, readingRows: readingRows }) }), _jsx(DSText, { as: "p", id: summaryId, variant: "body-sm", tone: "muted", children: marks === '' ? description : `${description} ${marks}` }), capNote !== '' && (_jsx(DSText, { as: "p", variant: "body-sm", tone: "muted", "data-chart-cap": "", children: capNote })), _jsx("div", { children: _jsx(DSButton, { variant: "link", quiet: true, labelSize: "sm", "aria-expanded": open, "aria-controls": tableId, onClick: () => {
|
|
203
195
|
setOpen((was) => !was);
|
|
204
|
-
}, children: tableToggleLabel(open) }) })] }))] }), drawn && (_jsx("div", { id: tableId, hidden: !open, role: "region", "aria-labelledby": captionId, tabIndex: 0, className: "focusable mt-3 overflow-x-auto rounded-xs", children: _jsxs("table", { className: "w-full border-collapse text-body-sm text-card-foreground", children: [_jsx("caption", { id: captionId, className: CHART_TABLE_CLASSES.caption, children: title }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "py-1 pr-4 text-left text-label-sm text-muted-foreground", children: categoryLabel }), everySeries.map((s, j) => (_jsx("th", { scope: "col", className: "py-1 pl-4 text-right text-label-sm text-muted-foreground", children: s.label }, j)))] }) }), _jsx("tbody", { children: categories.map((category, i) => (_jsxs("tr", { className: "border-t border-border", children: [_jsx("th", { scope: "row", className: "py-1 pr-4 text-left font-normal", children: category }), everySeries.map((s, j) => {
|
|
196
|
+
}, children: tableToggleLabel(open) }) })] }))] }), drawn && (_jsx("div", { id: tableId, hidden: !open, role: "region", "aria-labelledby": captionId, tabIndex: 0, className: "focusable mt-3 overflow-x-auto rounded-xs", children: _jsxs("table", { className: "w-full border-collapse text-body-sm text-card-foreground", children: [_jsx("caption", { id: captionId, className: CHART_TABLE_CLASSES.caption, children: title }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "py-1 pr-4 text-left text-label-sm text-muted-foreground", children: categoryLabel }), everySeries.map((s, j) => (_jsx("th", { scope: "col", className: "py-1 pl-4 text-right text-label-sm text-muted-foreground", children: s.label }, j))), bandColumns.map((j) => (_jsx("th", { scope: "col", className: CHART_TABLE_CLASSES.figureHead, children: bandColumns.length === 1 ? bandLabel : `${everySeries[j]?.label ?? ''} ${bandLabel ?? ''}` }, `band-${String(j)}`)))] }) }), _jsx("tbody", { children: categories.map((category, i) => (_jsxs("tr", { className: "border-t border-border", children: [_jsx("th", { scope: "row", className: "py-1 pr-4 text-left font-normal", children: category }), everySeries.map((s, j) => {
|
|
205
197
|
const value = s.values[i] ?? null;
|
|
206
|
-
return (_jsx("td", { className: "py-1 pl-4 text-right tabular-nums", children: value === null ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u2014" }), _jsx("span", { className: "sr-only", children: "No figure" })] })) : (formatValue(value)) }, j));
|
|
198
|
+
return (_jsx("td", { className: "py-1 pl-4 text-right tabular-nums", children: value === null ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u2014" }), _jsx("span", { className: "sr-only", children: "No figure" })] })) : (_jsxs(_Fragment, { children: [formatValue(value), split !== undefined && (projectionLabel ?? '') !== '' && chartIsExpected(s, i, split) && (_jsx(DSText, { as: "span", variant: "label-sm", tone: "muted", className: "pl-2", children: projectionLabel }))] })) }, j));
|
|
199
|
+
}), bandColumns.map((j) => {
|
|
200
|
+
const band = chartBandAt(everySeries[j] ?? { label: '', values: [] }, i);
|
|
201
|
+
return (_jsx("td", { className: "py-1 pl-4 text-right tabular-nums", children: band === undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u2014" }), _jsx("span", { className: "sr-only", children: "No figure" })] })) : (formatBandRange(formatValue(band.low), formatValue(band.high))) }, `band-${String(j)}`));
|
|
207
202
|
})] }, i))) })] }) }))] }));
|
|
208
203
|
}
|
|
209
204
|
const CHART_WASH_LEAD_SHARE = 0.7;
|
|
205
|
+
const CHART_BAND_OPACITY = 'opacity-16';
|
|
210
206
|
const TOOLTIP_GAP_PX = 12;
|
|
211
|
-
function Plot({ kind, uid, categories, series, width, height, formatValue,
|
|
207
|
+
function Plot({ kind, uid, categories, series, width, height, formatValue, spec, area, looks, reveal, active, references, events, emphasis, range, split, markerLabel, readingRows, }) {
|
|
212
208
|
const isComparison = (j) => series[j]?.comparison === true;
|
|
213
209
|
const quiet = (j) => emphasis !== undefined && emphasis >= 0 && emphasis < series.length && j !== emphasis && !isComparison(j);
|
|
214
|
-
const
|
|
210
|
+
const hasBand = kind === 'line' && series.some((s, j) => s.comparison !== true && s.band !== undefined && !quiet(j));
|
|
211
|
+
const washed = kind === 'line' && !hasBand && chartDrawsWash(series, area);
|
|
215
212
|
const washOwner = series.findIndex((s) => s.comparison !== true);
|
|
216
213
|
const stack = kind === 'stacked-area' ? chartStack(series) : [];
|
|
217
|
-
const scale = chartScale(kind === 'stacked-area' ? stack : series, undefined, references.map((r) => r.value));
|
|
214
|
+
const scale = chartScale(kind === 'stacked-area' ? stack : series, undefined, references.map((r) => r.value), range);
|
|
218
215
|
const tickLabels = scale.ticks.map(formatValue);
|
|
219
216
|
const gutter = axisGutter(tickLabels);
|
|
220
217
|
const plotWidth = Math.max(0, width - gutter - CHART_RIGHT_PAD_PX);
|
|
221
218
|
const plotHeight = Math.max(0, height - CHART_TOP_PAD_PX - CHART_AXIS_BAND_PX);
|
|
222
219
|
const ready = plotWidth > 0 && plotHeight > 0;
|
|
223
|
-
const bands = bandLayout(categories.length,
|
|
220
|
+
const bands = bandLayout(categories.length, plotWidth);
|
|
224
221
|
const stride = labelStride(categories.length, plotWidth, categorySpacing(categories));
|
|
225
|
-
const edge = bands.barWidth < CHART_THIN_BAR_PX ? 0.75 : 1.5;
|
|
226
222
|
const y = (value) => valueY(value, scale, plotHeight);
|
|
227
223
|
const zero = y(Math.min(Math.max(0, scale.min), scale.max));
|
|
228
224
|
const clipId = `${uid}-reveal`;
|
|
229
225
|
const inspecting = active !== undefined;
|
|
230
|
-
const
|
|
226
|
+
const drawnLines = kind === 'line'
|
|
227
|
+
? series.map((s) => s.values.flatMap((value, i) => (value === null ? [] : [{ x: bands.centre(i), y: y(value) }])))
|
|
228
|
+
: [];
|
|
231
229
|
const activeCentre = active === undefined ? 0 : bands.centre(active);
|
|
232
230
|
const beside = activeCentre > plotWidth / 2 ? 'left' : 'right';
|
|
233
|
-
return (_jsxs(_Fragment, { children: [_jsx("svg", { "aria-hidden": "true", focusable: "false", width: width, height: height, className: "pointer-events-none absolute inset-0 block overflow-visible", "data-chart-plot": kind, children: ready && (_jsxs(_Fragment, { children: [_jsxs("defs", { children: [reveal && (_jsx("clipPath", { id: clipId, children: _jsx("rect", { x: 0, y: -CHART_TOP_PAD_PX, width: plotWidth, height: plotHeight + CHART_TOP_PAD_PX * 2, className: "transform-fill origin-left animate-reveal-x" }) })),
|
|
231
|
+
return (_jsxs(_Fragment, { children: [_jsx("svg", { "aria-hidden": "true", focusable: "false", width: width, height: height, className: "pointer-events-none absolute inset-0 block overflow-visible", "data-chart-plot": kind, children: ready && (_jsxs(_Fragment, { children: [_jsxs("defs", { children: [reveal && (_jsx("clipPath", { id: clipId, children: _jsx("rect", { x: 0, y: -CHART_TOP_PAD_PX, width: plotWidth, height: plotHeight + CHART_TOP_PAD_PX * 2, className: "transform-fill origin-left animate-reveal-x" }) })), washed && washOwner >= 0 && (_jsx(ChartFinishGradient, { id: `${uid}-wash-${String(washOwner)}`, vertical: true, stops: chartSeriesWashStops(INK_SLOT[lookAt(looks, washOwner).ink], CHART_WASH_LEAD_SHARE) }))] }), _jsxs("g", { transform: `translate(${String(gutter)},${String(CHART_TOP_PAD_PX)})`, className: "text-label-sm", children: [scale.ticks.map((tick, t) => (_jsxs("g", { children: [_jsx("line", { x1: 0, x2: plotWidth, y1: y(tick), y2: y(tick), strokeWidth: 1, className: GRID_STROKE[spec.grid], "data-chart-ink": "grid" }), _jsx("text", { x: -CHART_AXIS_GAP_PX, y: y(tick), textAnchor: "end", dominantBaseline: "middle", className: cn('tabular-nums', AXIS_FILL[spec.axis]), "data-chart-ink": "axis", children: tickLabels[t] })] }, t))), events.map((e) => categories[e.index] === undefined ? null : (_jsxs("g", { "data-chart-event": "", children: [_jsx("line", { x1: bands.centre(e.index), x2: bands.centre(e.index), y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-muted-foreground", "data-chart-ink": "axis-line" }), _jsx("circle", { cx: bands.centre(e.index), cy: 0, r: 4, strokeWidth: 1.5, className: "fill-card stroke-muted-foreground", "data-chart-ink": "axis-line" })] }, `${e.label}-${String(e.index)}`))), split !== undefined && (_jsx("line", { x1: bands.centre(split - 1), x2: bands.centre(split - 1), y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-border-subtle", "data-chart-today": "", "data-chart-ink": "grid" })), inspecting && (_jsx("line", { x1: activeCentre, x2: activeCentre, y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-muted-foreground", "data-chart-ink": "axis-line" })), kind === 'stacked-area' ? (_jsx("g", { ...(reveal ? { clipPath: `url(#${clipId})` } : {}), children: chartStackPaths(stack, (i) => bands.centre(i), y, zero).map((paths, j) => {
|
|
234
232
|
const seriesSpec = lookAt(looks, j);
|
|
235
233
|
return (_jsxs("g", { "data-chart-series": j, children: [_jsx("path", { d: paths.band, className: cn(INK_FILL[seriesSpec.ink], 'opacity-55 forced-colors:hidden print:hidden'), "data-chart-ink": "wash" }), _jsx("path", { d: paths.line, fill: "none", strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: CHART_DASH_ARRAYS[seriesSpec.dash], className: INK_STROKE[seriesSpec.ink], "data-chart-ink": "stroke" })] }, j));
|
|
236
|
-
}) })) :
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
: INK_STROKE[seriesSpec.ink], "data-chart-ink": "stroke" }), s.values.map((value, i) => value !== null && (paths.lone.includes(i) || active === i) ? (_jsx("g", { transform: `translate(${String(bands.centre(i))},${String(y(value))})`, children: _jsx("circle", { r: active === i ? 5 : 4, strokeWidth: 2, className: cn(INK_FILL[seriesSpec.ink], 'stroke-card'), "data-chart-ink": "fill" }) }, i)) : null)] }, j));
|
|
251
|
-
}) })) : (_jsxs(_Fragment, { children: [active !== undefined && (_jsx("path", { d: chartBarPath(bands.barX(active, 0), 0, bands.barX(active, series.length - 1) + bands.barWidth - bands.barX(active, 0), plotHeight, true), className: "fill-accent opacity-60 forced-colors:hidden", "data-chart-track": "" })), series.map((s, j) => {
|
|
234
|
+
}) })) : (_jsxs("g", { ...(reveal ? { clipPath: `url(#${clipId})` } : {}), children: [series.map((s, j) => {
|
|
235
|
+
if (s.band === undefined || isComparison(j) || quiet(j))
|
|
236
|
+
return null;
|
|
237
|
+
const d = chartBandPath(s.band, (i) => bands.centre(i), y);
|
|
238
|
+
if (d === '')
|
|
239
|
+
return null;
|
|
240
|
+
return (_jsx("path", { d: d, className: cn(emphasis === j ? CHART_ACCENT.fill : INK_FILL[lookAt(looks, j).ink], CHART_BAND_OPACITY, 'forced-colors:hidden print:hidden'), "data-chart-band": j, "data-chart-ink": "wash" }, `band-${String(j)}`));
|
|
241
|
+
}), [...series.keys()]
|
|
242
|
+
.reverse()
|
|
243
|
+
.toSorted((a, b) => Number(!isComparison(a)) + Number(!quiet(a)) - (Number(!isComparison(b)) + Number(!quiet(b))))
|
|
244
|
+
.map((j) => {
|
|
245
|
+
const s = series[j];
|
|
246
|
+
if (s === undefined)
|
|
247
|
+
return null;
|
|
252
248
|
const seriesSpec = lookAt(looks, j);
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const paint = barPaint(look, patternId(j));
|
|
269
|
-
if (look.ink === 'chart-comparison')
|
|
270
|
-
return null;
|
|
271
|
-
return s.values.map((value, i) => {
|
|
272
|
-
if (value === null || (paint.ink !== 'fill' && !(single && active === i)))
|
|
273
|
-
return null;
|
|
274
|
-
const top = Math.min(y(value), zero);
|
|
275
|
-
const length = Math.abs(zero - y(value));
|
|
276
|
-
return (_jsx("path", { d: chartBarPath(bands.barX(i, j), top, bands.barWidth, length, value >= 0), fill: `url(#${uid}-sheen)`, className: cn(reveal && 'transform-fill origin-bottom animate-rise-y'), style: {
|
|
277
|
-
...(reveal
|
|
278
|
-
? { animationDelay: `${String(chartFinishStagger(i, categories.length))}ms` }
|
|
279
|
-
: {}),
|
|
280
|
-
fillOpacity: 'calc(1 - var(--chart-bar-mark, 0))',
|
|
281
|
-
} }, `${String(j)}-${String(i)}`));
|
|
282
|
-
});
|
|
283
|
-
}) })] })), references.map((r) => (_jsxs("g", { "data-chart-reference": "", children: [_jsx("line", { x1: 0, x2: plotWidth, y1: y(r.value), y2: y(r.value), strokeWidth: 1, strokeDasharray: "4 3", className: "stroke-card-foreground", "data-chart-ink": "axis-line" }), _jsx("text", { x: plotWidth, y: y(r.value) - 4, textAnchor: "end", strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: "fill-card-foreground stroke-card", "data-chart-ink": "axis", children: r.label })] }, `${r.label}-${String(r.value)}`))), events.map((e) => categories[e.index] === undefined ? null : (_jsx("text", { x: bands.centre(e.index) + 8, y: 4, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: cn('stroke-card', AXIS_FILL[spec.axis]), "data-chart-ink": "axis", children: e.label }, `${e.label}-${String(e.index)}`))), _jsx("line", { x1: 0, x2: plotWidth, y1: zero, y2: zero, strokeWidth: 1, className: GRID_STROKE[spec.grid], "data-chart-ink": "grid" }), categories.map((category, i) => i % stride === 0 ? (_jsx("text", { x: bands.centre(i), y: plotHeight + CHART_AXIS_BAND_PX - CHART_CATEGORY_BASELINE_PX, textAnchor: "middle", className: cn(AXIS_FILL[spec.axis], active === i && 'font-semibold'), "data-chart-ink": "axis", children: category }, i)) : null)] })] })) }), ready && active !== undefined && (_jsxs("div", { "aria-hidden": "true", "data-chart-tooltip": "", className: cn(CHART_FINISH_READOUT, 'absolute flex flex-col gap-1 px-2 py-2 whitespace-nowrap', beside === 'left' && '-translate-x-full'), style: {
|
|
249
|
+
const comparison = isComparison(j);
|
|
250
|
+
const paths = chartSeriesPaths(s.values, (i) => bands.centre(i), y, plotHeight, comparison ? undefined : split);
|
|
251
|
+
const lineClass = quiet(j)
|
|
252
|
+
? 'stroke-muted-foreground opacity-40'
|
|
253
|
+
: emphasis === j
|
|
254
|
+
? CHART_ACCENT.stroke
|
|
255
|
+
: INK_STROKE[seriesSpec.ink];
|
|
256
|
+
const lineWeight = comparison || quiet(j) ? 1.5 : emphasis === j ? 2.5 : 2;
|
|
257
|
+
const endValue = paths.end === undefined ? null : (s.values[paths.end] ?? null);
|
|
258
|
+
return (_jsxs("g", { "data-chart-series": j, "data-chart-quiet": quiet(j) ? '' : undefined, children: [washed && j === washOwner && paths.area !== '' && (_jsx("path", { d: paths.area, fill: `url(#${uid}-wash-${String(j)})`, className: "forced-colors:hidden print:hidden", "data-chart-ink": "wash" })), _jsx("path", { d: paths.line, fill: "none", strokeWidth: lineWeight, strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: quiet(j) || emphasis === j ? undefined : CHART_DASH_ARRAYS[seriesSpec.dash], className: lineClass, "data-chart-ink": "stroke" }), paths.projection !== '' && (_jsx("path", { d: paths.projection, fill: "none", strokeWidth: lineWeight, strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: CHART_DASH_ARRAYS.dashed, className: lineClass, "data-chart-projection": "", "data-chart-ink": "stroke" })), paths.end !== undefined && endValue !== null && (_jsx("circle", { cx: bands.centre(paths.end), cy: y(endValue), r: 4, strokeWidth: 2, className: cn(emphasis === j ? CHART_ACCENT.fill : INK_FILL[seriesSpec.ink], 'stroke-card'), "data-chart-end": "", "data-chart-ink": "fill" })), s.values.map((value, i) => value !== null && i !== paths.end && (paths.lone.includes(i) || active === i) ? (_jsx("g", { transform: `translate(${String(bands.centre(i))},${String(y(value))})`, children: _jsx("circle", { r: active === i ? 5 : 4, strokeWidth: 2, className: cn(INK_FILL[seriesSpec.ink], 'stroke-card'), "data-chart-ink": "fill" }) }, i)) : null)] }, j));
|
|
259
|
+
})] })), references.map((r) => {
|
|
260
|
+
const place = chartReferenceLabelPlace(y(r.value), r.label, plotWidth, drawnLines);
|
|
261
|
+
return (_jsxs("g", { "data-chart-reference": "", children: [_jsx("line", { x1: 0, x2: plotWidth, y1: y(r.value), y2: y(r.value), strokeWidth: 1, strokeDasharray: "4 3", className: "stroke-card-foreground", "data-chart-ink": "axis-line" }), _jsx("text", { x: place.x, y: place.y, textAnchor: place.anchor, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: "fill-card-foreground stroke-card", "data-chart-ink": "axis", children: r.label })] }, `${r.label}-${String(r.value)}`));
|
|
262
|
+
}), kind === 'line' &&
|
|
263
|
+
chartOverReference(series, references, { kind, projectFrom: split }).map((o) => (_jsx("circle", { cx: bands.centre(o.index), cy: y(o.value), r: 4, strokeWidth: 2, className: "fill-chart-needs-you stroke-card", "data-chart-over": "" }, `over-${String(o.series)}-${String(o.index)}`))), events.map((e) => categories[e.index] === undefined ? null : (_jsx("text", { x: bands.centre(e.index) + 8, y: 4, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: cn('stroke-card', AXIS_FILL[spec.axis]), "data-chart-ink": "axis", children: e.label }, `${e.label}-${String(e.index)}`))), split !== undefined && (markerLabel ?? '') !== '' && (_jsx("text", { x: bands.centre(split - 1) + 8, y: plotHeight - 6, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: cn('stroke-card', AXIS_FILL[spec.axis]), "data-chart-today-label": "", "data-chart-ink": "axis", children: markerLabel })), _jsx("line", { x1: 0, x2: plotWidth, y1: zero, y2: zero, strokeWidth: 1, className: GRID_STROKE[spec.grid], "data-chart-ink": "grid" }), categories.map((category, i) => i % stride === 0 ? (_jsx("text", { x: bands.centre(i), y: plotHeight + CHART_AXIS_BAND_PX - CHART_CATEGORY_BASELINE_PX, textAnchor: "middle", className: cn(AXIS_FILL[spec.axis], active === i && 'font-semibold'), "data-chart-ink": "axis", children: category }, i)) : null)] })] })) }), ready && active !== undefined && (_jsxs("div", { "aria-hidden": "true", "data-chart-tooltip": "", className: cn(CHART_FINISH_READOUT, 'absolute flex flex-col gap-1 px-2 py-2 whitespace-nowrap', beside === 'left' && '-translate-x-full'), style: {
|
|
284
264
|
top: CHART_TOP_PAD_PX,
|
|
285
265
|
left: gutter + activeCentre + (beside === 'left' ? -TOOLTIP_GAP_PX : TOOLTIP_GAP_PX),
|
|
286
|
-
}, children: [_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: categories[active] }),
|
|
287
|
-
const value = s.values[active] ?? null;
|
|
288
|
-
return (_jsxs("span", { className: "flex items-center gap-2 text-label-sm tabular-nums", children: [_jsx("span", { "data-forced-colors": "mark", className: cn('size-2 shrink-0 rounded-full', INK_BG[lookAt(looks, j).ink]) }), _jsx("span", { className: "text-muted-foreground", children: s.label }), _jsx("span", { className: "ml-auto pl-3", children: value === null ? 'No figure' : formatValue(value) })] }, j));
|
|
289
|
-
})] }))] }));
|
|
266
|
+
}, children: [_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: categories[active] }), readingRows(active).map((row, r) => (_jsxs("span", { className: "flex items-center gap-2 text-label-sm tabular-nums", "data-chart-reading": row.kind, children: [_jsx("span", { "data-forced-colors": "mark", className: cn('size-2 shrink-0', row.kind === 'band' ? ['rounded-xs', CHART_BAND_OPACITY] : 'rounded-full', INK_BG[lookAt(looks, row.series).ink]) }), _jsx("span", { className: "text-muted-foreground", children: row.label }), _jsx("span", { className: "ml-auto pl-3", children: row.missing ? 'No figure' : row.text })] }, r)))] }))] }));
|
|
290
267
|
}
|
|
291
268
|
const hueStroke = (hue) => CHART_SERIES_STROKE[chartSeriesSlot(hue)];
|
|
292
269
|
const hueDot = (hue) => CHART_SERIES_BG[chartSeriesSlot(hue)];
|
|
@@ -294,7 +271,7 @@ const READOUT_EDGE_PERCENT = 15;
|
|
|
294
271
|
const TREND_LABEL_GUTTER_PX = 40;
|
|
295
272
|
const LINE_WEIGHT = 2;
|
|
296
273
|
const REFLECTION_SHARE = 0.55;
|
|
297
|
-
function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, compareLabel, series = 1, shape = 'line', reflection = false, label, height = 64, startLabel, endLabel, valueLabel, emptyLabel, reveal = false, scrub = false, formatValue =
|
|
274
|
+
function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, compareLabel, series = 1, shape = 'line', reflection = false, label, height = 64, startLabel, endLabel, valueLabel, emptyLabel, reveal = false, scrub = false, formatValue = formatChartValue, pointLabel, onScrub, className, ...props }) {
|
|
298
275
|
const spec = chartTrendSpec({ values, projectFrom, series, ...(compare === undefined ? {} : { compare }) });
|
|
299
276
|
if (process.env['NODE_ENV'] !== 'production' && chartCompareNeedsALabel(compare, compareLabel)) {
|
|
300
277
|
console.error(`DSChart: ${CHART_COMPARE_NEEDS_A_LABEL}`);
|
|
@@ -378,12 +355,12 @@ function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, com
|
|
|
378
355
|
const dotClass = silhouette ? 'bg-hero-foreground' : hueDot(spec.series);
|
|
379
356
|
const mirrorHeight = Math.round(height * REFLECTION_SHARE);
|
|
380
357
|
const hero = height >= CHART_FINISH_GRID_MIN_PX;
|
|
381
|
-
const grid = filled ? [] :
|
|
358
|
+
const grid = filled || chartFinishGridLines(height).length === 0 ? [] : [spec.zero];
|
|
382
359
|
const viewBox = `0 0 ${String(CHART_VIEWBOX.width)} ${String(CHART_VIEWBOX.height)}`;
|
|
383
360
|
const clip = reveal ? { clipPath: `url(#${clipId})` } : {};
|
|
384
361
|
const across = { x1: 0, y1: 0, x2: CHART_VIEWBOX.width, y2: 0 };
|
|
385
362
|
return (_jsxs("div", { className: cn('flex w-full flex-col gap-2 overflow-x-clip', className), "data-forced-colors": "chart", "data-chart-kind": kind, ...props, children: [_jsx("div", { className: "relative w-full", style: { height }, children: spec.empty ? (_jsx("div", { role: "img", "aria-label": `${label}: ${emptyLabel}`, className: "border-border text-muted-foreground flex h-full w-full items-center justify-center rounded-xs border border-dashed", children: _jsx("span", { className: "bg-muted rounded-xs px-3 py-2 text-body-sm", children: emptyLabel }) })) : (_jsxs(_Fragment, { children: [_jsxs("div", { ref: plotRef, className: cn('absolute inset-y-0 left-0', scrubbing &&
|
|
386
|
-
'focusable cursor-crosshair touch-pan-y rounded-xs
|
|
363
|
+
'focusable-inset cursor-crosshair touch-pan-y rounded-xs'), style: { right: gutter }, ...(scrubbing && reported !== undefined
|
|
387
364
|
? {
|
|
388
365
|
role: 'slider',
|
|
389
366
|
tabIndex: 0,
|
|
@@ -408,7 +385,7 @@ function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, com
|
|
|
408
385
|
] }), _jsx("mask", { id: mountainMaskId, children: _jsx("rect", { x: 0, y: 0, width: CHART_VIEWBOX.width, height: CHART_VIEWBOX.height, fill: `url(#${mountainFadeId})` }) })] })), silhouette && (_jsx(ChartFinishGradient, { id: frostId, vertical: true, stops: [
|
|
409
386
|
{ offset: 0, color: 'var(--color-hero-foreground)', opacity: 0.32 },
|
|
410
387
|
{ offset: 1, color: 'var(--color-hero-foreground)', opacity: 0.06 },
|
|
411
|
-
] }))] }), spec.compare !== '' && (_jsx("path", { d: spec.compare, fill: "none", strokeWidth: weight * 0.75, strokeDasharray: "3 3", strokeLinecap: "round", vectorEffect: "non-scaling-stroke", className: "stroke-muted-foreground opacity-60", "data-chart-compare": "" })), _jsxs("g", { ...clip, children: [mountain ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${mountainId})`, mask: `url(#${mountainMaskId})`, className: CHART_FINISH_ORNAMENT })) : silhouette ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${frostId})`, className: CHART_FINISH_ORNAMENT })) : (_jsx("path", { d: spec.curveArea, className: CHART_FINISH_ORNAMENT, fill: `url(#${washId})` })), _jsx("path", { d: spec.curve, fill: "none", strokeWidth: weight, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }), spec.curveProjection !== '' && (_jsx("path", { d: spec.curveProjection, fill: "none", strokeWidth: weight, strokeDasharray: "3 3", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }))] })] }), spec.head !== undefined && active === undefined && (_jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(spec.head.x)}%`, top: `${String(spec.head.y)}%` }, children: [_jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hero ? 'size-6' : 'size-4', dotClass, CHART_FINISH_ORNAMENT) }), changed && (_jsx("span", { className: cn('animate-value-flash absolute size-5 -translate-x-1/2 -translate-y-1/2 rounded-full', hueDot(spec.series), CHART_FINISH_ORNAMENT) }, String(spec.last))), _jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full', silhouette ? 'ring-hero' : 'ring-card', hero ? 'size-2 ring-2' : 'size-1.5 ring-1', dotClass) })] })), scrubbing && active !== undefined && (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": true, className: "via-muted-foreground pointer-events-none absolute inset-y-0 w-px bg-linear-to-b from-transparent to-transparent opacity-60", style: { left: `${String(active.x)}%` } }), _jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(active.x)}%`, top: `${String(active.y)}%` }, children: [_jsx("span", { className: cn('absolute size-7 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hueDot(spec.series), CHART_FINISH_ORNAMENT) }), _jsx("span", { className: cn('ring-card shadow-low absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2', hueDot(spec.series)) })] }), _jsxs("div", { "aria-hidden": true, className: cn(CHART_FINISH_READOUT, 'absolute bottom-full mb-2 flex flex-col gap-1 px-3 py-2 whitespace-nowrap', readoutAt), style: { left: `${String(active.x)}%` }, children: [pointLabel !== undefined && (_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: pointLabel(active.index) })), _jsxs("span", { className: "text-body-sm flex items-center gap-2 font-medium tabular-nums", children: [_jsx("span", { className: cn('size-2 shrink-0 rounded-full', hueDot(spec.series)) }), formatValue(active.value)] }), before(active) !== undefined && (_jsxs(DSText, { as: "span", variant: "body-xs", className: "text-muted-foreground flex items-center gap-2 tabular-nums", children: [_jsx("span", { className: "border-muted-foreground w-2 shrink-0 border-t border-dashed" }), compareLabel === undefined
|
|
388
|
+
] }))] }), spec.compare !== '' && (_jsx("path", { d: spec.compare, fill: "none", strokeWidth: weight * 0.75, strokeDasharray: "3 3", strokeLinecap: "round", vectorEffect: "non-scaling-stroke", className: "stroke-muted-foreground opacity-60", "data-chart-compare": "" })), _jsxs("g", { ...clip, children: [mountain ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${mountainId})`, mask: `url(#${mountainMaskId})`, className: CHART_FINISH_ORNAMENT })) : silhouette ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${frostId})`, className: CHART_FINISH_ORNAMENT })) : (_jsx("path", { d: spec.curveArea, className: CHART_FINISH_ORNAMENT, fill: `url(#${washId})` })), _jsx("path", { d: spec.curve, fill: "none", strokeWidth: weight, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }), spec.curveProjection !== '' && (_jsx("path", { d: spec.curveProjection, fill: "none", strokeWidth: weight, strokeDasharray: "3 3", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }))] })] }), spec.lone.map((p) => (_jsx("span", { "aria-hidden": true, "data-chart-lone": "", className: cn('pointer-events-none absolute size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full', dotClass), style: { left: `${String(p.x)}%`, top: `${String(p.y)}%` } }, p.index))), spec.head !== undefined && active === undefined && (_jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(spec.head.x)}%`, top: `${String(spec.head.y)}%` }, children: [_jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hero ? 'size-6' : 'size-4', dotClass, CHART_FINISH_ORNAMENT) }), changed && (_jsx("span", { className: cn('animate-value-flash absolute size-5 -translate-x-1/2 -translate-y-1/2 rounded-full', hueDot(spec.series), CHART_FINISH_ORNAMENT) }, String(spec.last))), _jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full', silhouette ? 'ring-hero' : 'ring-card', hero ? 'size-2 ring-2' : 'size-1.5 ring-1', dotClass) })] })), scrubbing && active !== undefined && (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": true, className: "via-muted-foreground pointer-events-none absolute inset-y-0 w-px bg-linear-to-b from-transparent to-transparent opacity-60", style: { left: `${String(active.x)}%` } }), _jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(active.x)}%`, top: `${String(active.y)}%` }, children: [_jsx("span", { className: cn('absolute size-7 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hueDot(spec.series), CHART_FINISH_ORNAMENT) }), _jsx("span", { className: cn('ring-card shadow-low absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2', hueDot(spec.series)) })] }), _jsxs("div", { "aria-hidden": true, className: cn(CHART_FINISH_READOUT, 'absolute bottom-full mb-2 flex flex-col gap-1 px-3 py-2 whitespace-nowrap', readoutAt), style: { left: `${String(active.x)}%` }, children: [pointLabel !== undefined && (_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: pointLabel(active.index) })), _jsxs("span", { className: "text-body-sm flex items-center gap-2 font-medium tabular-nums", children: [_jsx("span", { className: cn('size-2 shrink-0 rounded-full', hueDot(spec.series)) }), formatValue(active.value)] }), before(active) !== undefined && (_jsxs(DSText, { as: "span", variant: "body-xs", className: "text-muted-foreground flex items-center gap-2 tabular-nums", children: [_jsx("span", { className: "border-muted-foreground w-2 shrink-0 border-t border-dashed" }), compareLabel === undefined
|
|
412
389
|
? formatValue(before(active)?.value ?? 0)
|
|
413
390
|
: `${compareLabel} ${formatValue(before(active)?.value ?? 0)}`] }))] })] }))] }), valueLabel !== undefined && (_jsx(DSText, { as: "span", variant: "body-xs", className: cn('text-muted-foreground absolute right-0 -translate-y-1/2 tabular-nums', active !== undefined && 'opacity-0'), style: { top: `${String(spec.lastY)}%` }, children: valueLabel }))] })) }), reflection && filled && !spec.empty && (_jsxs("svg", { "aria-hidden": true, width: "100%", height: mirrorHeight, className: cn('-mt-2 block w-full', CHART_FINISH_ORNAMENT), viewBox: viewBox, preserveAspectRatio: "none", style: { marginRight: gutter }, children: [_jsxs("defs", { children: [_jsx(ChartFinishGradient, { id: mirrorFadeId, vertical: true, stops: [
|
|
414
391
|
{ offset: 0, color: 'var(--color-hero-foreground)', opacity: 0.4 },
|
|
@@ -15,7 +15,7 @@ export type CheckOptionAppearance = (typeof CHECK_OPTION_APPEARANCES)[number];
|
|
|
15
15
|
/** The card's resting fill. A neutral step, not the brand tint, see above. */
|
|
16
16
|
export declare const CHECK_OPTION_CARD_SURFACE: "muted";
|
|
17
17
|
export declare const CHECK_OPTION_CHECKED_SURFACE: "background";
|
|
18
|
-
export declare const CHECK_OPTION_CHECKED_BORDER: "
|
|
18
|
+
export declare const CHECK_OPTION_CHECKED_BORDER: "border-selected";
|
|
19
19
|
/** The card's inset. Wider than it is tall, which is what stops a two-line
|
|
20
20
|
* option reading as a paragraph with a tick in front of it. Both even. */
|
|
21
21
|
export declare const CHECK_OPTION_CARD_PADDING_BLOCK_PX = 16;
|
|
@@ -6,7 +6,7 @@ export const CHECK_OPTION_CONTROLS = ['checkbox', 'radio'];
|
|
|
6
6
|
export const CHECK_OPTION_APPEARANCES = ['row', 'card'];
|
|
7
7
|
export const CHECK_OPTION_CARD_SURFACE = 'muted';
|
|
8
8
|
export const CHECK_OPTION_CHECKED_SURFACE = 'background';
|
|
9
|
-
export const CHECK_OPTION_CHECKED_BORDER = '
|
|
9
|
+
export const CHECK_OPTION_CHECKED_BORDER = 'border-selected';
|
|
10
10
|
export const CHECK_OPTION_CARD_PADDING_BLOCK_PX = 16;
|
|
11
11
|
export const CHECK_OPTION_CARD_PADDING_INLINE_PX = 20;
|
|
12
12
|
export const CHECK_OPTION_CARD_BORDER_PX = 1;
|
|
@@ -22,7 +22,12 @@ export type DSCheckOptionProps = Omit<ComponentProps<'div'>, 'onChange' | 'title
|
|
|
22
22
|
label: string;
|
|
23
23
|
content: ReactNode;
|
|
24
24
|
};
|
|
25
|
+
/** Why a box that must be ticked has not been: "Accept the terms to
|
|
26
|
+
* continue". Drawn under the title in the error ink and read with the box,
|
|
27
|
+
* and it marks the box invalid. For ONE box standing alone (terms, an
|
|
28
|
+
* agreement). A group's rule is the group's to say, see `invalid`. */
|
|
29
|
+
error?: ReactNode;
|
|
25
30
|
onCheckedChange: (next: boolean) => void;
|
|
26
31
|
};
|
|
27
32
|
/** A checkbox and the sentence it belongs to. */
|
|
28
|
-
export declare function DSCheckOption({ checked, appearance, control, name, disabled, invalid, title, description, meta, info, onCheckedChange, className, ...props }: DSCheckOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function DSCheckOption({ checked, appearance, control, name, disabled, invalid, title, description, meta, info, error, onCheckedChange, className, ...props }: DSCheckOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,9 +3,10 @@ import { useId } from 'react';
|
|
|
3
3
|
import { Info } from 'lucide-react';
|
|
4
4
|
import { checkOptionSpec, CHECK_OPTION_DESCRIPTION_INK, CHECK_OPTION_META_INK, } from '../check-option';
|
|
5
5
|
import { DSCheckbox } from '../../checkbox/web/ds-checkbox';
|
|
6
|
+
import { DSHelperText } from '../../helper-text/web/ds-helper-text';
|
|
6
7
|
import { DSTooltip } from '../../tooltip/web/ds-tooltip';
|
|
7
8
|
import { cn } from '../../lib/cn';
|
|
8
|
-
import {
|
|
9
|
+
import { SMALL_CONTROL_HIT_AREA } from '../../lib/web/touch-target';
|
|
9
10
|
import { DSText } from '../../text/web/ds-text';
|
|
10
11
|
const GEOMETRY = {
|
|
11
12
|
row: 'rounded-field p-3 -mx-3',
|
|
@@ -17,7 +18,7 @@ const SURFACE = {
|
|
|
17
18
|
};
|
|
18
19
|
const CHECKED = {
|
|
19
20
|
row: '',
|
|
20
|
-
card: 'border border-transparent has-[input:checked]:bg-background has-[input:checked]:border-
|
|
21
|
+
card: 'border border-transparent has-[input:checked]:bg-background has-[input:checked]:border-border-selected',
|
|
21
22
|
};
|
|
22
23
|
const STATE = {
|
|
23
24
|
row: 'state-layer',
|
|
@@ -38,17 +39,20 @@ const DESCRIPTION_TYPE = {
|
|
|
38
39
|
row: 'text-label-sm',
|
|
39
40
|
card: 'text-body-sm',
|
|
40
41
|
};
|
|
41
|
-
export function DSCheckOption({ checked, appearance = 'row', control = 'checkbox', name, disabled, invalid, title, description, meta, info, onCheckedChange, className, ...props }) {
|
|
42
|
+
export function DSCheckOption({ checked, appearance = 'row', control = 'checkbox', name, disabled, invalid, title, description, meta, info, error, onCheckedChange, className, ...props }) {
|
|
42
43
|
const spec = checkOptionSpec(appearance);
|
|
43
44
|
const isDisabled = disabled === true;
|
|
44
45
|
const generated = useId();
|
|
45
46
|
const inputId = `${generated}-control`;
|
|
46
47
|
const descriptionId = description === undefined ? undefined : `${generated}-description`;
|
|
47
48
|
const infoId = info === undefined ? undefined : `${generated}-info`;
|
|
48
|
-
const
|
|
49
|
-
|
|
49
|
+
const hasError = error !== undefined && error !== null && error !== false && error !== '';
|
|
50
|
+
const errorId = hasError ? `${generated}-error` : undefined;
|
|
51
|
+
const isInvalid = invalid === true || hasError;
|
|
52
|
+
const describedBy = [descriptionId, infoId, errorId].filter(Boolean).join(' ') || undefined;
|
|
53
|
+
return (_jsxs("div", { className: cn('relative flex cursor-pointer items-start gap-3', GEOMETRY[spec.appearance], SURFACE[spec.appearance], CHECKED[spec.appearance], isDisabled ? cn('cursor-not-allowed', DISABLED_INK) : STATE[spec.appearance], 'focusable-within', className), ...(isDisabled ? { 'aria-disabled': true } : {}), ...props, children: [_jsx("span", { className: "flex h-5 flex-none items-center", children: _jsx(DSCheckbox, { id: inputId, control: control, size: spec.box, name: name, checked: checked, disabled: isDisabled, ...(isInvalid ? { invalid: true } : {}), ...(describedBy === undefined ? {} : { 'aria-describedby': describedBy }), onCheckedChange: (next) => {
|
|
50
54
|
if (control === 'radio' && !next)
|
|
51
55
|
return;
|
|
52
56
|
onCheckedChange(next);
|
|
53
|
-
}, className: "focus-visible:outline-none focus-visible:shadow-none" }) }), _jsxs("
|
|
57
|
+
}, className: "focus-visible:outline-none focus-visible:shadow-none" }) }), _jsxs("div", { className: "block min-w-0 flex-1", children: [_jsxs("span", { className: cn('flex items-center gap-1', TITLE_TYPE[spec.appearance]), children: [_jsx("label", { htmlFor: inputId, className: "min-w-0 after:absolute after:inset-0", children: title }), info === undefined ? null : (_jsx(DSTooltip, { content: info.content, id: infoId, children: _jsx("button", { type: "button", "aria-label": info.label, className: cn('state-layer relative grid size-5 shrink-0 place-items-center rounded-xxs text-muted-foreground focusable', SMALL_CONTROL_HIT_AREA), children: _jsx(Info, { "aria-hidden": true, className: "size-3.5" }) }) }))] }), description === undefined ? null : (_jsx("span", { id: descriptionId, className: cn('mt-1 block', DESCRIPTION_TYPE[spec.appearance], isDisabled ? DISABLED_INK : DESCRIPTION_INK[CHECK_OPTION_DESCRIPTION_INK]), children: description })), !hasError ? null : (_jsx(DSHelperText, { id: errorId, tone: "error", className: "mt-1", children: error }))] }), meta === undefined ? null : (_jsx(DSText, { as: "span", variant: "label-sm", className: cn('flex-none tabular-nums', isDisabled ? DISABLED_INK : META_INK[CHECK_OPTION_META_INK]), children: meta }))] }));
|
|
54
58
|
}
|
|
@@ -35,7 +35,7 @@ export declare const CHECKBOX_STATE_SPECS: {
|
|
|
35
35
|
readonly invalid: {
|
|
36
36
|
readonly surface: "card";
|
|
37
37
|
readonly mark: "primary-foreground";
|
|
38
|
-
readonly border: "
|
|
38
|
+
readonly border: "error";
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
export declare const CHECKBOX_DISABLED_SPEC: {
|
|
@@ -44,7 +44,7 @@ export declare const CHECKBOX_DISABLED_SPEC: {
|
|
|
44
44
|
readonly border: "disabled-border";
|
|
45
45
|
};
|
|
46
46
|
/** The edge a box takes when its answer is wrong, ticked or not. */
|
|
47
|
-
export declare const CHECKBOX_INVALID_BORDER: "
|
|
47
|
+
export declare const CHECKBOX_INVALID_BORDER: "error";
|
|
48
48
|
export type CheckboxSurfaceRole = (typeof CHECKBOX_STATE_SPECS)[CheckboxState]['surface'] | typeof CHECKBOX_DISABLED_SPEC.surface;
|
|
49
49
|
export type CheckboxMarkRole = (typeof CHECKBOX_STATE_SPECS)[CheckboxState]['mark'] | typeof CHECKBOX_DISABLED_SPEC.mark;
|
|
50
50
|
export type CheckboxBorderRole = (typeof CHECKBOX_STATE_SPECS)[CheckboxState]['border'] | typeof CHECKBOX_DISABLED_SPEC.border;
|
|
@@ -4,14 +4,14 @@ export const CHECKBOX_STATE_SPECS = {
|
|
|
4
4
|
unchecked: { surface: 'card', mark: 'primary-foreground', border: 'input' },
|
|
5
5
|
checked: { surface: 'primary', mark: 'primary-foreground', border: 'primary' },
|
|
6
6
|
indeterminate: { surface: 'primary', mark: 'primary-foreground', border: 'primary' },
|
|
7
|
-
invalid: { surface: 'card', mark: 'primary-foreground', border: '
|
|
7
|
+
invalid: { surface: 'card', mark: 'primary-foreground', border: 'error' },
|
|
8
8
|
};
|
|
9
9
|
export const CHECKBOX_DISABLED_SPEC = {
|
|
10
10
|
surface: 'disabled',
|
|
11
11
|
mark: 'disabled-foreground',
|
|
12
12
|
border: 'disabled-border',
|
|
13
13
|
};
|
|
14
|
-
export const CHECKBOX_INVALID_BORDER = '
|
|
14
|
+
export const CHECKBOX_INVALID_BORDER = 'error';
|
|
15
15
|
export const CHECKBOX_SIZE_SPECS = {
|
|
16
16
|
sm: { box: 3.5, radius: 'sm', minHeight: 'touch' },
|
|
17
17
|
md: { box: 4.5, radius: 'sm', minHeight: 'touch' },
|
|
@@ -14,7 +14,7 @@ const SURFACE = {
|
|
|
14
14
|
const BORDER = {
|
|
15
15
|
input: 'border border-input',
|
|
16
16
|
primary: 'border border-primary',
|
|
17
|
-
|
|
17
|
+
error: 'border border-error',
|
|
18
18
|
'disabled-border': 'border border-disabled-border',
|
|
19
19
|
};
|
|
20
20
|
const MARK = {
|