@tfn-design/design-system 0.3.0 → 0.4.1
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/native/animated.d.ts +4 -5
- package/dist/lib/native/animated.js +3 -4
- 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,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import { ChevronsUpDown, Check } from 'lucide-react';
|
|
4
4
|
import { selectFilter, selectGroupedOptions, selectInitialActiveIndex, selectIsSearchable, selectMoveIndex, selectSpec, selectTypeaheadSearch, SELECT_LONG_LIST_NEEDS_SEARCH_COPY, SELECT_TYPEAHEAD_RESET_MS, } from '../select';
|
|
@@ -40,7 +40,7 @@ const TRIGGER_INK = {
|
|
|
40
40
|
};
|
|
41
41
|
const TRIGGER_BORDER = {
|
|
42
42
|
input: 'border-field-edge',
|
|
43
|
-
|
|
43
|
+
error: 'border-error',
|
|
44
44
|
};
|
|
45
45
|
const DISABLED_INK = 'text-disabled-foreground';
|
|
46
46
|
const PLACEHOLDER_INK = {
|
|
@@ -73,12 +73,18 @@ function anchoredMotion(side, exiting) {
|
|
|
73
73
|
return 'animate-fade-out';
|
|
74
74
|
return side === 'top' ? 'animate-toast-in' : 'animate-alert-in';
|
|
75
75
|
}
|
|
76
|
-
export function DSSelect({ options, value, invalid = false, size = 'md', disabled, open: openProp, onOpenChange, labelledBy, placeholder, onValueChange, searchLabel, searchPlaceholder, emptyLabel, name, className, 'aria-label': ariaLabel, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, id: triggerId, ...props }) {
|
|
76
|
+
export function DSSelect({ options, value, invalid = false, size = 'md', disabled, readOnly = false, open: openProp, onOpenChange, labelledBy, placeholder, onValueChange, searchLabel, searchPlaceholder, emptyLabel, name, appearance = 'field', className, 'aria-label': ariaLabel, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, id: triggerId, ...props }) {
|
|
77
77
|
const spec = selectSpec();
|
|
78
78
|
const isInvalid = invalid || ariaInvalid === true || ariaInvalid === 'true';
|
|
79
79
|
const field = inputSpec(size, isInvalid);
|
|
80
80
|
const id = useId();
|
|
81
|
-
const [
|
|
81
|
+
const [held, setOpen] = useControllable(openProp, onOpenChange, false);
|
|
82
|
+
const isReadOnly = readOnly && disabled !== true;
|
|
83
|
+
const open = held && !isReadOnly;
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (isReadOnly && held)
|
|
86
|
+
setOpen(false);
|
|
87
|
+
}, [isReadOnly, held, setOpen]);
|
|
82
88
|
const [query, setQuery] = useState('');
|
|
83
89
|
const [active, setActive] = useState(0);
|
|
84
90
|
const typed = useRef({ text: '', at: 0 });
|
|
@@ -126,7 +132,7 @@ export function DSSelect({ options, value, invalid = false, size = 'md', disable
|
|
|
126
132
|
};
|
|
127
133
|
const pick = (index) => {
|
|
128
134
|
const option = visible[index];
|
|
129
|
-
if (option === undefined)
|
|
135
|
+
if (option === undefined || option.disabled === true)
|
|
130
136
|
return;
|
|
131
137
|
onValueChange?.(option.value);
|
|
132
138
|
close(true);
|
|
@@ -178,7 +184,7 @@ export function DSSelect({ options, value, invalid = false, size = 'md', disable
|
|
|
178
184
|
announceLive(emptyLabel);
|
|
179
185
|
}, [empty, emptyLabel]);
|
|
180
186
|
const onTriggerKeyDown = (event) => {
|
|
181
|
-
if (disabled === true)
|
|
187
|
+
if (disabled === true || isReadOnly)
|
|
182
188
|
return;
|
|
183
189
|
if (event.key === 'Tab') {
|
|
184
190
|
if (open)
|
|
@@ -266,18 +272,22 @@ export function DSSelect({ options, value, invalid = false, size = 'md', disable
|
|
|
266
272
|
let row = -1;
|
|
267
273
|
return (_jsxs("div", { "data-role": "select-field", className: cn('relative', className), ...props, children: [_jsxs("select", { "aria-hidden": "true", tabIndex: -1, name: name, value: value ?? '', disabled: disabled, onChange: (event) => {
|
|
268
274
|
onValueChange?.(event.target.value);
|
|
269
|
-
}, className: "absolute -m-px size-px overflow-hidden border-0 p-0 [clip-path:inset(50%)]", children: [_jsx("option", { value: "" }), real.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] }), _jsxs("button", { ref: triggerRef, ...(triggerId === undefined ? {} : { id: triggerId }), type: "button", role: "combobox", "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": `${id}-list`, ...(labelledBy === undefined
|
|
275
|
+
}, className: "absolute -m-px size-px overflow-hidden border-0 p-0 [clip-path:inset(50%)]", children: [_jsx("option", { value: "" }), real.map((option) => (_jsx("option", { value: option.value, disabled: option.disabled === true && option.value !== value, children: option.label }, option.value)))] }), _jsxs("button", { ref: triggerRef, ...(triggerId === undefined ? {} : { id: triggerId }), type: "button", role: "combobox", "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": `${id}-list`, ...(labelledBy === undefined
|
|
270
276
|
? { 'aria-label': ariaLabel }
|
|
271
277
|
: { 'aria-labelledby': `${labelledBy} ${id}-value` }), ...triggerActiveDescendant, ...(describedBy === undefined || describedBy === ''
|
|
272
278
|
? {}
|
|
273
|
-
: { 'aria-describedby': describedBy }), "aria-invalid": isInvalid || undefined, disabled: disabled, onClick: () => {
|
|
279
|
+
: { 'aria-describedby': describedBy }), "aria-invalid": isInvalid || undefined, "aria-readonly": isReadOnly || undefined, disabled: disabled, onClick: () => {
|
|
280
|
+
if (isReadOnly)
|
|
281
|
+
return;
|
|
274
282
|
if (open)
|
|
275
283
|
close(true);
|
|
276
284
|
else
|
|
277
285
|
openList();
|
|
278
|
-
}, onKeyDown: onTriggerKeyDown, className: cn('flex w-full
|
|
286
|
+
}, onKeyDown: onTriggerKeyDown, className: cn('flex w-full items-center justify-between gap-2 rounded-field text-left transition-control focusable-field', isReadOnly ? 'cursor-default' : 'cursor-pointer', appearance === 'inset'
|
|
287
|
+
? cn('state-layer-press min-h-touch px-1', TRIGGER_INK[field.label], 'disabled:cursor-not-allowed disabled:text-disabled-foreground')
|
|
288
|
+
: cn(!isInvalid && !isReadOnly && 'state-layer-edge', !isReadOnly && 'state-layer-press enabled:hover:bg-field-hover', TRIGGER_SURFACE[field.surface], TRIGGER_INK[field.label], TRIGGER_BORDER[field.border], TRIGGER_PADDING[field.paddingX], TRIGGER_TEXT[field.text], !setsTypeRecipe(className) && 'font-normal', TRIGGER_HEIGHT[field.minHeight], COMPACT_HEIGHT[field.minHeight], 'border', isReadOnly && 'border-dashed bg-transparent', DISABLED)), children: [chosen?.leading !== undefined && (_jsx("span", { "aria-hidden": true, className: "flex shrink-0 items-center", children: chosen.leading })), chosen?.labelColour !== undefined && (_jsx(DSSelectOptionLabelDot, { colour: chosen.labelColour })), _jsx("span", { id: `${id}-value`, className: cn('min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap', disabled === true
|
|
279
289
|
? DISABLED_INK
|
|
280
|
-
: chosen === undefined && PLACEHOLDER_INK[field.placeholder]), children: chosen?.label ?? placeholder }), _jsx(ChevronsUpDown, { "aria-hidden": true, className: cn('size-3.5 shrink-0', disabled === true ? DISABLED_INK : CARET_INK[spec.caretInk]) })] }), present &&
|
|
290
|
+
: chosen === undefined && PLACEHOLDER_INK[field.placeholder]), children: chosen?.triggerLabel === undefined ? ((chosen?.label ?? placeholder)) : (_jsxs(_Fragment, { children: [appearance === 'inset' ? (_jsx(DSText, { as: "span", variant: "heading-sm", "aria-hidden": "true", className: "text-inherit", children: chosen.triggerLabel })) : (_jsx("span", { "aria-hidden": "true", children: chosen.triggerLabel })), _jsx("span", { className: "sr-only", children: chosen.label })] })) }), !isReadOnly && (_jsx(ChevronsUpDown, { "aria-hidden": true, className: cn('size-3.5 shrink-0', disabled === true ? DISABLED_INK : CARET_INK[spec.caretInk]) }))] }), present &&
|
|
281
291
|
host !== null &&
|
|
282
292
|
createPortal(_jsxs("div", { ref: surfaceRef, style: { ...style, minWidth: triggerRef.current?.offsetWidth }, onAnimationEnd: onAnimationEnd, className: cn('max-w-md overflow-y-auto overscroll-contain rounded-pop border p-1 shadow-medium', searchable && 'scroll-pt-12 pointer-coarse:scroll-pt-14', anchoredMotion(side, exiting), LIST_SURFACE[spec.listSurface], OPTION_INK[spec.optionInk], LIST_BORDER[spec.listBorder]), children: [searchable && (_jsx("input", { ref: searchRef, type: "search", value: query, "aria-label": searchLabel, "aria-controls": `${id}-list`, ...searchActiveDescendant, placeholder: searchPlaceholder, onChange: (event) => {
|
|
283
293
|
setQuery(event.target.value);
|
|
@@ -292,12 +302,12 @@ export function DSSelect({ options, value, invalid = false, size = 'md', disable
|
|
|
292
302
|
const selected = option.value === value;
|
|
293
303
|
return (_jsxs("div", { ref: (node) => {
|
|
294
304
|
rowRefs.current[index] = node;
|
|
295
|
-
}, id: `${id}-o${String(index)}`, role: "option", "aria-selected": selected, "data-value": option.value, onClick: (event) => {
|
|
305
|
+
}, id: `${id}-o${String(index)}`, role: "option", "aria-selected": selected, "aria-disabled": option.disabled === true || undefined, "data-value": option.value, onClick: (event) => {
|
|
296
306
|
event.stopPropagation();
|
|
297
307
|
pick(index);
|
|
298
308
|
}, onMouseMove: () => {
|
|
299
309
|
move(index);
|
|
300
|
-
}, className: cn('flex cursor-pointer items-center gap-2 rounded-field px-3 py-2 text-body-sm', 'mb-0.5 last:mb-0', OPTION_HEIGHT, selected && 'font-semibold text-selected-foreground', index === active && [
|
|
310
|
+
}, className: cn('flex cursor-pointer items-center gap-2 rounded-field px-3 py-2 text-body-sm', 'mb-0.5 last:mb-0', OPTION_HEIGHT, 'aria-disabled:cursor-not-allowed aria-disabled:text-muted-foreground', selected && 'font-semibold text-selected-foreground', index === active && [
|
|
301
311
|
ACTIVE_SURFACE[spec.optionActiveSurface],
|
|
302
312
|
FORCED_ACTIVE,
|
|
303
313
|
]), children: [option.leading !== undefined && (_jsx("span", { "aria-hidden": true, className: "flex shrink-0 items-center", children: option.leading })), option.labelColour !== undefined && (_jsx(DSSelectOptionLabelDot, { colour: option.labelColour })), option.hint === undefined ? (_jsx("span", { children: option.label })) : (_jsxs("span", { className: "flex min-w-0 flex-col", children: [_jsx("span", { children: option.label }), _jsx(DSText, { as: "span", variant: "body-sm", className: cn(NONE_INK[spec.noneInk]), children: option.hint })] })), option.labels !== undefined && (_jsx(DSSelectOptionLabels, { labels: option.labels })), _jsx("span", { "aria-hidden": true, className: cn('ml-auto w-4 shrink-0', TICK_INK[spec.tickInk]), children: selected ? _jsx(Check, { className: "size-4" }) : null })] }, option.value));
|
|
@@ -13,5 +13,5 @@ export function DSSettingsDirectory({ title, items, onNavigate }) {
|
|
|
13
13
|
? { transform: [{ scale: PRESS_SCALES.subtle }] }
|
|
14
14
|
: null, onPress: () => {
|
|
15
15
|
onNavigate(item.key);
|
|
16
|
-
}, className: "min-h-touch flex-row items-start gap-3 rounded-
|
|
16
|
+
}, className: "min-h-touch flex-row items-start gap-3 rounded-tile p-3 active:bg-muted android:ripple-primary", children: [_jsx(View, { accessible: false, "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", className: "size-8 items-center justify-center rounded-control bg-muted", children: inkChild(item.icon, 'text-link') }), _jsxs(View, { className: "min-w-0 flex-1", children: [_jsx(DSText, { variant: "body-md-strong", className: "text-link", children: item.title }), _jsx(DSText, { variant: "body-sm", className: "mt-1 text-foreground", children: item.description })] })] }, `${item.key}|${epoch}`))) })] }));
|
|
17
17
|
}
|
|
@@ -3,5 +3,5 @@ import { useId } from 'react';
|
|
|
3
3
|
import { DSText } from '../../text/web/ds-text';
|
|
4
4
|
export function DSSettingsDirectory({ title, items }) {
|
|
5
5
|
const id = useId();
|
|
6
|
-
return (_jsxs("section", { "aria-labelledby": id, className: "@container", children: [_jsx("h2", { id: id, className: "mb-4 text-label-md text-heading-foreground", children: title }), _jsx("ul", { className: "m-0 grid list-none grid-cols-1 gap-4 p-0 @xl:grid-cols-2 @4xl:grid-cols-3", children: items.map((item) => (_jsx("li", { className: "min-w-0", children: _jsxs("a", { href: item.href, className: "focusable state-layer flex h-full items-start gap-3 rounded-
|
|
6
|
+
return (_jsxs("section", { "aria-labelledby": id, className: "@container", children: [_jsx("h2", { id: id, className: "mb-4 text-label-md text-heading-foreground", children: title }), _jsx("ul", { className: "m-0 grid list-none grid-cols-1 gap-4 p-0 @xl:grid-cols-2 @4xl:grid-cols-3", children: items.map((item) => (_jsx("li", { className: "min-w-0", children: _jsxs("a", { href: item.href, className: "focusable state-layer flex h-full items-start gap-3 rounded-tile p-3", children: [_jsx("span", { "aria-hidden": true, className: "flex size-8 shrink-0 items-center justify-center rounded-field bg-muted text-link [&>svg]:size-5", children: item.icon }), _jsxs("span", { className: "min-w-0 pt-1", children: [_jsx(DSText, { as: "span", variant: "body-md-strong", className: "block break-words text-link", children: item.title }), _jsx(DSText, { as: "span", variant: "body-sm", className: "mt-1 block break-words text-foreground", children: item.description })] })] }) }, item.key))) })] }));
|
|
7
7
|
}
|
|
@@ -18,6 +18,8 @@ export type DSSettingsRowProps = Omit<ComponentProps<'div'>, 'children'> & Setti
|
|
|
18
18
|
learnMoreHref?: string | undefined;
|
|
19
19
|
/** Whether the row draws the rule under it. Off when something of the row's own follows it, such as its error. */
|
|
20
20
|
rule?: boolean;
|
|
21
|
+
/** The id the label points at, for a control that must keep an id of its own. The row makes one when it is left out. */
|
|
22
|
+
controlId?: string | undefined;
|
|
21
23
|
};
|
|
22
24
|
/** One standing choice: its label, what it changes, the control that makes it, an optional "Learn more" and a stated reason when it is locked. */
|
|
23
|
-
export declare function DSSettingsRow({ label, description, lockedReason, disabled, unsaved, unsavedText, learnMoreText, learnMoreName, learnMoreHref, control, rule, className, ...props }: DSSettingsRowProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function DSSettingsRow({ label, description, lockedReason, disabled, unsaved, unsavedText, learnMoreText, learnMoreName, learnMoreHref, control, rule, controlId: ownControlId, className, ...props }: DSSettingsRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ const UNSAVED_INK = {
|
|
|
16
16
|
const DIVIDER = {
|
|
17
17
|
'border-subtle': 'border-border-subtle',
|
|
18
18
|
};
|
|
19
|
-
export function DSSettingsRow({ label, description, lockedReason, disabled, unsaved, unsavedText = SETTINGS_ROW_UNSAVED_TEXT, learnMoreText = 'Learn more', learnMoreName, learnMoreHref, control, rule = true, className, ...props }) {
|
|
19
|
+
export function DSSettingsRow({ label, description, lockedReason, disabled, unsaved, unsavedText = SETTINGS_ROW_UNSAVED_TEXT, learnMoreText = 'Learn more', learnMoreName, learnMoreHref, control, rule = true, controlId: ownControlId, className, ...props }) {
|
|
20
20
|
const id = useId();
|
|
21
21
|
const labelId = `${id}-label`;
|
|
22
22
|
const descriptionId = `${id}-description`;
|
|
@@ -24,7 +24,7 @@ export function DSSettingsRow({ label, description, lockedReason, disabled, unsa
|
|
|
24
24
|
const unsavedId = `${id}-unsaved`;
|
|
25
25
|
const state = settingsRowControlState({ disabled, lockedReason });
|
|
26
26
|
const hasDescription = description !== undefined && description.trim() !== '';
|
|
27
|
-
const controlId = `${id}-control`;
|
|
27
|
+
const controlId = ownControlId ?? `${id}-control`;
|
|
28
28
|
const a11y = {
|
|
29
29
|
id: controlId,
|
|
30
30
|
'aria-labelledby': labelId,
|
|
@@ -5,7 +5,7 @@ import { X } from 'lucide-react';
|
|
|
5
5
|
import { sheetSpec, } from '../sheet';
|
|
6
6
|
import { cn } from '../../lib/cn';
|
|
7
7
|
import { SCRIM_BLUR_CLASS } from '../../scrim';
|
|
8
|
-
import {
|
|
8
|
+
import { TABBABLE, trapTab } from '../../lib/web/focus-trap';
|
|
9
9
|
import { useOverlay } from '../../lib/web/use-overlay';
|
|
10
10
|
import { lockBodyScroll } from '../../lib/web/scroll-lock';
|
|
11
11
|
import { useOverflows } from '../../lib/web/focus-habits';
|
|
@@ -72,7 +72,7 @@ export function DSSheet({ open, title, sub, dirty = false, dirtyClosePending = f
|
|
|
72
72
|
}, [open]);
|
|
73
73
|
useEffect(() => {
|
|
74
74
|
if (open) {
|
|
75
|
-
const first = bodyRef.current?.querySelector(
|
|
75
|
+
const first = bodyRef.current?.querySelector(TABBABLE) ?? null;
|
|
76
76
|
(first ?? sheetRef.current)?.focus({ preventScroll: true });
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
@@ -111,5 +111,5 @@ export function DSSheet({ open, title, sub, dirty = false, dirtyClosePending = f
|
|
|
111
111
|
const overflows = useOverflows(bodyRef, present ? children : null);
|
|
112
112
|
if (!open && !exiting)
|
|
113
113
|
return null;
|
|
114
|
-
return createPortal(_jsxs(_Fragment, { children: [_jsx("div", { "data-role": "sheet-backdrop", "aria-hidden": "true", onClick: exiting ? undefined : requestClose, style: z === null ? undefined : { zIndex: z - 1 }, className: cn('fixed inset-0', SCRIM_BLUR_CLASS, exiting ? 'animate-fade-out' : 'animate-fade-in', BACKDROP[spec.backdrop]) }), _jsxs("div", { ref: sheetRef, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, ...(sub === undefined ? {} : { 'aria-describedby': subId }), tabIndex: -1, onKeyDown: handleKeyDown, ...(exiting ? { inert: true } : {}), style: z === null ? undefined : { zIndex: z }, onAnimationEnd: finishExit, className: cn('fixed inset-y-0 right-0 flex w-full max-w-4xl flex-col border-l shadow-high', exiting ? 'animate-sheet-out' : 'animate-sheet-in', SURFACE[spec.surface], PANEL_EDGE, className), ...props, children: [_jsxs("div", { className: cn('sheet-head-inset flex flex-none items-start gap-3 border-b', BORDER[spec.border]), children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx(DSText, { as: "h2", variant: "heading-md", id: titleId, className: cn('sheet-title m-0 break-words', TITLE_INK[spec.titleInk]), children: title }), sub !== undefined && (_jsx(DSText, { as: "p", variant: "body-sm", id: subId, className: cn('m-0 break-words', SUB_INK[spec.subInk]), children: sub }))] }), _jsx(DSIconButton, { label: closeLabel, variant: "ghost", icon: _jsx(X, {}), onClick: requestClose, className: "-my-2 shrink-0" })] }), _jsx("div", { ref: bodyRef, ...(overflows ? { tabIndex: 0 } : {}), className: "sheet-body-inset min-h-0 flex-1 overflow-y-auto focusable
|
|
114
|
+
return createPortal(_jsxs(_Fragment, { children: [_jsx("div", { "data-role": "sheet-backdrop", "aria-hidden": "true", onClick: exiting ? undefined : requestClose, style: z === null ? undefined : { zIndex: z - 1 }, className: cn('fixed inset-0', SCRIM_BLUR_CLASS, exiting ? 'animate-fade-out' : 'animate-fade-in', BACKDROP[spec.backdrop]) }), _jsxs("div", { ref: sheetRef, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, ...(sub === undefined ? {} : { 'aria-describedby': subId }), tabIndex: -1, onKeyDown: handleKeyDown, ...(exiting ? { inert: true } : {}), style: z === null ? undefined : { zIndex: z }, onAnimationEnd: finishExit, className: cn('fixed inset-y-0 right-0 flex w-full max-w-4xl flex-col border-l shadow-high', exiting ? 'animate-sheet-out' : 'animate-sheet-in', SURFACE[spec.surface], PANEL_EDGE, className), ...props, children: [_jsxs("div", { className: cn('sheet-head-inset flex flex-none items-start gap-3 border-b', BORDER[spec.border]), children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx(DSText, { as: "h2", variant: "heading-md", id: titleId, className: cn('sheet-title m-0 break-words', TITLE_INK[spec.titleInk]), children: title }), sub !== undefined && (_jsx(DSText, { as: "p", variant: "body-sm", id: subId, className: cn('m-0 break-words', SUB_INK[spec.subInk]), children: sub }))] }), _jsx(DSIconButton, { label: closeLabel, variant: "ghost", icon: _jsx(X, {}), onClick: requestClose, className: "-my-2 shrink-0" })] }), _jsx("div", { ref: bodyRef, ...(overflows ? { tabIndex: 0 } : {}), className: "sheet-body-inset min-h-0 flex-1 overflow-y-auto focusable-inset", children: children }), footer !== undefined && (_jsx("div", { className: cn('sheet-foot-inset flex flex-none flex-wrap items-center justify-end gap-3 border-t', BORDER[spec.border]), children: footer }))] })] }), portalNode);
|
|
115
115
|
}
|
|
@@ -224,7 +224,8 @@ export interface SideNavContract {
|
|
|
224
224
|
* thing that outlives a render. Seed it with `sideNavExpandedFor`. */
|
|
225
225
|
expanded: readonly string[];
|
|
226
226
|
onExpandedChange: (expanded: readonly string[]) => void;
|
|
227
|
-
/**
|
|
227
|
+
/** Keep several groups open at once. On by default; pass `false` to close
|
|
228
|
+
* the others when one opens. See `toggleSideNavGroup`. */
|
|
228
229
|
allowMultiple?: Forwarded<boolean>;
|
|
229
230
|
/** Names the landmark. Required: a page may carry more than one `<nav>`, a
|
|
230
231
|
* sidebar, a breadcrumb, a footer and unlabelled landmarks are announced
|
|
@@ -7,6 +7,9 @@ export type DSSideNavCollapseProps = Omit<ComponentProps<'button'>, 'children' |
|
|
|
7
7
|
collapseLabel?: string | undefined;
|
|
8
8
|
/** The name while the nav is a rail. Absent, the English default is used. */
|
|
9
9
|
expandLabel?: string | undefined;
|
|
10
|
+
/** The single key the app binds to the same toggle, e.g. `[`. Shown in the
|
|
11
|
+
* tooltip and announced. Absent, the tooltip is the words alone. */
|
|
12
|
+
shortcut?: string | undefined;
|
|
10
13
|
};
|
|
11
14
|
/** The button that collapses the nav to a rail and expands it again, named for what it will do. */
|
|
12
|
-
export declare function DSSideNavCollapse({ collapsed, onCollapsedChange, collapseLabel, expandLabel, ...props }: DSSideNavCollapseProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function DSSideNavCollapse({ collapsed, onCollapsedChange, collapseLabel, expandLabel, shortcut, ...props }: DSSideNavCollapseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PanelLeftClose, PanelLeftOpen } from 'lucide-react';
|
|
3
3
|
import { sideNavCollapseLabel } from '../side-nav';
|
|
4
4
|
import { DSIconButton } from '../../icon-button/web/ds-icon-button';
|
|
5
|
-
|
|
5
|
+
import { DSKbd } from '../../kbd/web/ds-kbd';
|
|
6
|
+
import { DSTooltip } from '../../tooltip/web/ds-tooltip';
|
|
7
|
+
export function DSSideNavCollapse({ collapsed, onCollapsedChange, collapseLabel, expandLabel, shortcut, ...props }) {
|
|
6
8
|
const label = (collapsed ? expandLabel : collapseLabel) ?? sideNavCollapseLabel(collapsed);
|
|
7
|
-
|
|
9
|
+
const button = (_jsx(DSIconButton, { ...props, variant: "ghost", size: "sm", label: label, tooltip: shortcut === undefined, "aria-keyshortcuts": shortcut, icon: collapsed ? _jsx(PanelLeftOpen, {}) : _jsx(PanelLeftClose, {}), onClick: () => {
|
|
8
10
|
onCollapsedChange(!collapsed);
|
|
9
11
|
} }));
|
|
12
|
+
return shortcut === undefined ? (button) : (_jsx(DSTooltip, { names: true, content: _jsxs("span", { className: "inline-flex items-center gap-2", children: [label, _jsx(DSKbd, { keys: [shortcut] })] }), children: button }));
|
|
10
13
|
}
|
|
@@ -3,5 +3,5 @@ import { useSideNavRail } from './side-nav-rail-context';
|
|
|
3
3
|
import { cn } from '../../lib/cn';
|
|
4
4
|
export function DSSideNavHeader({ brand, search, notifications, toggle, primary, mark, className, ...props }) {
|
|
5
5
|
const rail = useSideNavRail();
|
|
6
|
-
return (_jsxs("div", { ...props, className: cn(rail ? 'flex flex-col items-center gap-1' : 'flex flex-col gap-2', className), children: [_jsxs("div", { className: cn(rail ? 'flex flex-col items-center gap-1' : 'flex min-h-9 items-center gap-1 ps-2'), children: [rail ? (mark !== undefined ? (_jsx("div", { className: "grid size-10 place-items-center", children: mark })) : null) : (_jsx("div", { className: "flex min-w-0 flex-1 items-center", children: brand })), rail ? null : notifications, toggle] }), search, rail ? notifications : null, primary] }));
|
|
6
|
+
return (_jsxs("div", { ...props, className: cn(rail ? 'flex flex-col items-center gap-1' : 'flex flex-col gap-2', className), children: [_jsxs("div", { ...(rail ? {} : { 'data-side-nav-brand': '' }), className: cn(rail ? 'flex flex-col items-center gap-1' : 'flex min-h-9 items-center gap-1 ps-2'), children: [rail ? (mark !== undefined ? (_jsx("div", { className: "grid size-10 place-items-center", children: mark })) : null) : (_jsx("div", { className: "flex min-w-0 flex-1 items-center", children: brand })), rail ? null : notifications, toggle] }), search, rail ? notifications : null, primary] }));
|
|
7
7
|
}
|
|
@@ -8,7 +8,7 @@ export function DSSideNavPrimary({ label, icon, onPress, className, ...props })
|
|
|
8
8
|
if (rail) {
|
|
9
9
|
return (_jsx(DSTooltip, { content: label, names: true, children: _jsxs("button", { ...props, type: "button", onClick: () => {
|
|
10
10
|
onPress();
|
|
11
|
-
}, className: cn('state-layer-press focusable grid size-10 place-items-center rounded-control hover:bg-foreground/4 pointer-coarse:size-
|
|
11
|
+
}, className: cn('state-layer-press focusable grid size-10 place-items-center rounded-control hover:bg-foreground/4 pointer-coarse:size-touch-floor', className), children: [disc, _jsx("span", { className: "sr-only", children: label })] }) }));
|
|
12
12
|
}
|
|
13
13
|
return (_jsxs("button", { ...props, type: "button", onClick: () => {
|
|
14
14
|
onPress();
|
|
@@ -15,7 +15,7 @@ export function DSSideNavProfile({ name, secondary, imageUrl, open: openProp, on
|
|
|
15
15
|
const avatar = (_jsx(DSAvatar, { name: name, size: 28, ...(imageUrl === undefined ? {} : { imageUrl }) }));
|
|
16
16
|
return (_jsxs("div", { ...props, className: cn('relative flex justify-center', className), children: [_jsx(DSTooltip, { content: name, names: true, children: menu === undefined ? (_jsx("span", { role: "img", tabIndex: 0, "aria-label": accessibleName, className: "focusable grid size-10 place-items-center rounded-control", children: avatar })) : (_jsx("button", { type: "button", "aria-label": accessibleName, "aria-haspopup": "menu", "aria-expanded": open, onClick: () => {
|
|
17
17
|
setOpen(!open);
|
|
18
|
-
}, className: cn('state-layer-press focusable grid size-10 place-items-center rounded-control pointer-coarse:size-
|
|
18
|
+
}, className: cn('state-layer-press focusable grid size-10 place-items-center rounded-control pointer-coarse:size-touch-floor', open ? 'bg-foreground/4' : 'hover:bg-foreground/4'), children: _jsx("span", { "aria-hidden": true, className: "flex", children: avatar }) })) }), menu] }));
|
|
19
19
|
}
|
|
20
20
|
const body = (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "flex shrink-0", children: _jsx(DSAvatar, { name: name, size: 28, ...(imageUrl === undefined ? {} : { imageUrl }) }) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx(DSText, { as: "span", variant: "body-sm-strong", className: "truncate text-foreground", children: name }), secondary !== undefined && (_jsx(DSText, { as: "span", variant: "label-sm", className: "truncate text-muted-foreground", children: secondary }))] })] }));
|
|
21
21
|
if (menu === undefined) {
|
|
@@ -66,7 +66,7 @@ export interface DSSideNavSection {
|
|
|
66
66
|
export type DSSideNavProps = Omit<ComponentProps<'nav'>, 'aria-label' | 'children' | 'onSelect'> & Omit<SideNavContract, 'sections'> & {
|
|
67
67
|
sections: readonly DSSideNavSection[];
|
|
68
68
|
/** HOW ROOMY THE ROWS ARE. `dense` is the portal's, 32px a row. `comfortable`
|
|
69
|
-
* is the
|
|
69
|
+
* is the source app's LCV sidebar's (2026-10-09): 48px rows with an 8px corner,
|
|
70
70
|
* the current row on the brand tint, a 236px width. A prop and not a
|
|
71
71
|
* change to the default, because the portal's navigation is dense on
|
|
72
72
|
* purpose. */
|
|
@@ -75,7 +75,7 @@ function RowAction({ icon, label, onActivate, reveal, shown = false, popup, butt
|
|
|
75
75
|
event.preventDefault();
|
|
76
76
|
event.stopPropagation();
|
|
77
77
|
onActivate(event.currentTarget);
|
|
78
|
-
}, className: cn('focusable state-layer-press state-layer-fill grid size-5 shrink-0 place-items-center rounded-xxs text-muted-foreground', 'pointer-coarse:h-11 pointer-coarse:w-9', 'hover:bg-foreground/12 hover:text-foreground', shown
|
|
78
|
+
}, className: cn('focusable state-layer-press state-layer-fill relative grid size-5 shrink-0 place-items-center rounded-xxs text-muted-foreground', 'before:absolute before:-inset-0.5 pointer-coarse:before:inset-0', 'pointer-coarse:h-11 pointer-coarse:w-9', 'hover:bg-foreground/12 hover:text-foreground', shown
|
|
79
79
|
? 'opacity-100'
|
|
80
80
|
: 'opacity-0 transition-control focus-visible:opacity-100 pointer-coarse:opacity-100', !shown && reveal), children: icon }) }));
|
|
81
81
|
}
|
|
@@ -373,11 +373,11 @@ export function DSSideNav({ sections, current, expanded, onExpandedChange, allow
|
|
|
373
373
|
? { 'aria-current': 'true', ...currentMarks(true) }
|
|
374
374
|
: {}), onClick: () => {
|
|
375
375
|
onCollapsedSectionsChange?.(toggleSideNavSection(collapsedSections, section.key));
|
|
376
|
-
}, className: cn('focusable state-layer-press flex max-w-full items-center gap-1 rounded-xxs text-left hover:text-foreground pointer-coarse:min-h-touch', holdsCurrent && 'text-foreground'), children: [_jsx("span", { className: "truncate", children: section.label }), _jsx(ChevronDown, { "aria-hidden": true, size: 14, className: cn('shrink-0 transition-control', shut && '-rotate-90') }), holdsCurrent && (_jsx("span", { "aria-hidden": true, "data-role": "side-nav-section-current", className: "size-1.5 shrink-0 rounded-full bg-foreground" }))] })) : (section.label) }), section.action !== undefined && (_jsx(RowAction, { icon: section.action.icon, label: section.action.label, onActivate: () => {
|
|
376
|
+
}, className: cn('focusable state-layer-press flex max-w-full items-center gap-1 rounded-xxs text-left hover:text-foreground pointer-coarse:min-h-touch', holdsCurrent && 'text-foreground'), children: [_jsx("span", { className: "truncate", children: section.label }), _jsx(ChevronDown, { "aria-hidden": true, size: 14, className: cn('shrink-0 transition-control', shut && '-rotate-90 rtl:rotate-90') }), holdsCurrent && (_jsx("span", { "aria-hidden": true, "data-role": "side-nav-section-current", className: "size-1.5 shrink-0 rounded-full bg-foreground" }))] })) : (section.label) }), section.action !== undefined && (_jsx(RowAction, { icon: section.action.icon, label: section.action.label, onActivate: () => {
|
|
377
377
|
section.action?.onPress();
|
|
378
378
|
}, reveal: "group-hover/section:opacity-100 group-focus-within/section:opacity-100", className: "ml-auto" }))] })), _jsx("ul", { id: listId, className: "m-0 flex list-none flex-col gap-1 p-0", ...(section.label === undefined ? {} : { 'aria-label': section.label }), ...(shut ? { hidden: true } : {}), children: section.entries.map((entry) => renderEntry(entry)) })] }, section.key));
|
|
379
379
|
}
|
|
380
|
-
return (_jsx(SideNavRailContext.Provider, { value: collapsed, children: _jsxs("nav", { ref: rootRef, "aria-label": label, "data-collapsed": collapsed ? '' : undefined, style: { ...(resizable ? { width: resolvedWidth } : {}), ...style }, className: cn('relative flex h-full shrink-0 flex-col border-e', collapsed ? 'w-14' : !resizable && (comfy ? 'w-side-nav-comfortable' : 'w-60'), SURFACE[spec.surface], EDGE[spec.edge], comfy && 'side-nav-roomy-frame', dragging && 'cursor-col-resize select-none', className), ...props, children: [header !== undefined && (_jsx("div", { className: cn('flex min-h-12 shrink-0 flex-col justify-center border-b py-1.5', collapsed ? 'px-2' : 'px-3', EDGE[spec.edge], 'shell-band-subtle'), children: header })), _jsx("div", { ref: railRef, "data-role": "side-nav-rail", ...(header === undefined ? {} : { 'data-headed': '' }), className: cn('min-h-0 flex-1 overflow-y-auto pb-3', collapsed ? 'px-2' : 'px-3', header === undefined ? 'pt-4' : '
|
|
380
|
+
return (_jsx(SideNavRailContext.Provider, { value: collapsed, children: _jsxs("nav", { ref: rootRef, "aria-label": label, "data-collapsed": collapsed ? '' : undefined, style: { ...(resizable ? { width: resolvedWidth } : {}), ...style }, className: cn('relative flex h-full shrink-0 flex-col border-e', collapsed ? 'w-14' : !resizable && (comfy ? 'w-side-nav-comfortable' : 'w-60'), SURFACE[spec.surface], EDGE[spec.edge], comfy && 'side-nav-roomy-frame', dragging && 'cursor-col-resize select-none', className), ...props, children: [header !== undefined && (_jsx("div", { className: cn('flex min-h-12 shrink-0 flex-col justify-center border-b py-1.5', collapsed ? 'px-2' : 'px-3', comfy && !collapsed && 'side-nav-roomy-band', EDGE[spec.edge], 'shell-band-subtle'), children: header })), _jsx("div", { ref: railRef, "data-role": "side-nav-rail", ...(header === undefined ? {} : { 'data-headed': '' }), className: cn('min-h-0 flex-1 overflow-y-auto pb-3 scroll-py-1', collapsed ? 'px-2' : 'px-3', header === undefined ? 'pt-4' : 'side-nav-first-line', comfy && !collapsed && 'side-nav-roomy-scroll', comfy && collapsed && 'side-nav-roomy-rail'), children: placed.start.map(renderSection) }), placed.end.length > 0 && (_jsx("div", { "data-role": "side-nav-end", className: cn('shrink-0 pb-3', collapsed ? 'px-2' : 'px-3', comfy && !collapsed && 'side-nav-roomy-end', dividers || collapsed ? cn('border-t pt-2', EDGE[spec.edge]) : 'pt-2'), children: placed.end.map(renderSection) })), footer !== undefined && (_jsx("div", { className: cn('shrink-0 border-t p-3', EDGE[spec.edge]), children: footer })), _jsx(DSSideNavMenu, { open: menu !== null, onOpenChange: (open) => {
|
|
381
381
|
if (!open)
|
|
382
382
|
setOpenKey(null);
|
|
383
383
|
}, anchor: menu?.anchor ?? null, entries: menu?.entries ?? [], label: menu?.label ?? '', side: menu?.flyout === true ? 'right' : 'bottom', flyout: menu?.flyout === true, focusFallback: () => (menu === null ? undefined : neighbourRow(menu.row)), onAction: (itemKey) => {
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
+
import type { Forwarded } from '../props';
|
|
1
2
|
import type { TextRecipe } from '../text/text';
|
|
3
|
+
/** How many rows a list draws while it loads, when it cannot know its count. */
|
|
4
|
+
export declare const LOADING_ROWS = 3;
|
|
5
|
+
/** The props every component that shows loaded data accepts, on web and native. */
|
|
6
|
+
export interface LoadingContract {
|
|
7
|
+
/** The first load: the data is on its way and there is nothing to show yet. Draws a skeleton in the loaded layout, so nothing moves when the data lands. Not for a refresh: data already on screen stays while new data comes. */
|
|
8
|
+
loading?: Forwarded<boolean>;
|
|
9
|
+
/** What a screen reader hears, once, as the load starts: "Loading fuel spend". Pass it whenever you pass `loading`; without it the region is marked busy and nothing is said. */
|
|
10
|
+
loadingLabel?: Forwarded<string>;
|
|
11
|
+
}
|
|
12
|
+
/** A cell's props: its data while ready, nothing but `loading` while its value is on its way. */
|
|
13
|
+
export type Loadable<T> = (T & {
|
|
14
|
+
loading?: false | undefined;
|
|
15
|
+
loadingLabel?: Forwarded<string>;
|
|
16
|
+
}) | (Partial<T> & {
|
|
17
|
+
loading: true;
|
|
18
|
+
loadingLabel?: Forwarded<string>;
|
|
19
|
+
});
|
|
20
|
+
/** What the status region says: the caller's words while loading, nothing otherwise. */
|
|
21
|
+
export declare function loadingSpoken(loading: boolean | undefined, loadingLabel: string | undefined): string;
|
|
2
22
|
declare const SKELETON_SURFACE: "track";
|
|
3
23
|
export type SkeletonSurfaceRole = typeof SKELETON_SURFACE;
|
|
4
24
|
export type SkeletonFit = TextRecipe | 'control';
|
|
@@ -125,7 +125,7 @@ export function DSSlider({ label, min, max, step, value, onValueChange, formatVa
|
|
|
125
125
|
const next = sliderKeyValue(key, thumbValue, bounds, limits);
|
|
126
126
|
if (next !== undefined)
|
|
127
127
|
moveThumb(thumb, next);
|
|
128
|
-
}, className: cn('absolute top-1/2 rounded-full border-2', !isDisabled && 'shadow-
|
|
128
|
+
}, className: cn('absolute top-1/2 rounded-full border-2', !isDisabled && 'shadow-low', sizing.thumb, THUMB[spec.thumb], THUMB_EDGE[spec.thumbEdge]), style: {
|
|
129
129
|
left: pct(sliderPositionOf(thumbValue, min, max)),
|
|
130
130
|
marginLeft: -sizing.radius,
|
|
131
131
|
marginTop: -sizing.radius,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Forwarded } from '../props';
|
|
2
|
+
import type { LoadingContract } from '../skeleton/skeleton';
|
|
2
3
|
export declare const SMALL_MULTIPLES_COLUMNS: readonly [2, 3, 4];
|
|
3
4
|
export type SmallMultiplesColumns = (typeof SMALL_MULTIPLES_COLUMNS)[number];
|
|
4
5
|
/** Each panel's drawing box, in viewBox units; stretched to the panel by the adapter. */
|
|
@@ -14,7 +15,7 @@ export interface SmallMultiplesItem {
|
|
|
14
15
|
* line breaks there and the readings after it keep their place in time. */
|
|
15
16
|
values: readonly number[];
|
|
16
17
|
}
|
|
17
|
-
export interface SmallMultiplesContract {
|
|
18
|
+
export interface SmallMultiplesContract extends LoadingContract {
|
|
18
19
|
/** What the grid shows: "Spend per site, last 8 weeks". */
|
|
19
20
|
label: string;
|
|
20
21
|
items: readonly SmallMultiplesItem[];
|
|
@@ -22,8 +23,6 @@ export interface SmallMultiplesContract {
|
|
|
22
23
|
columns?: Forwarded<SmallMultiplesColumns>;
|
|
23
24
|
/** What the grid says when there is nothing to draw. Required, this package owns no copy. */
|
|
24
25
|
emptyLabel: string;
|
|
25
|
-
/** The figures are on their way: the grid draws a skeleton at its own height, so nothing around it moves when they land. */
|
|
26
|
-
loading?: Forwarded<boolean>;
|
|
27
26
|
/** Keep the name for a screen reader but do not draw it, when a panel around the chart already shows its title. */
|
|
28
27
|
labelHidden?: Forwarded<boolean>;
|
|
29
28
|
}
|
|
@@ -45,5 +44,5 @@ export interface SmallMultiplesResolvedSpec {
|
|
|
45
44
|
max: number;
|
|
46
45
|
panels: SmallMultiplesPanel[];
|
|
47
46
|
}
|
|
48
|
-
/** Puts every panel on one scale from zero to the highest reading anywhere in the grid. */
|
|
47
|
+
/** Puts every panel on one scale from zero, or the lowest reading under it, to the highest reading anywhere in the grid. */
|
|
49
48
|
export declare function smallMultiplesSpec(items: readonly SmallMultiplesItem[]): SmallMultiplesResolvedSpec;
|
|
@@ -5,7 +5,8 @@ export function smallMultiplesSpec(items) {
|
|
|
5
5
|
const { width: W, height: H } = SMALL_MULTIPLES_VIEWBOX;
|
|
6
6
|
const finite = (vs) => vs.filter((v) => Number.isFinite(v));
|
|
7
7
|
const max = Math.max(0, ...items.flatMap((i) => finite(i.values)));
|
|
8
|
-
const
|
|
8
|
+
const min = Math.min(0, ...items.flatMap((i) => finite(i.values)));
|
|
9
|
+
const y = (v) => (max === min ? H : H - ((v - min) / (max - min)) * (H - 2) - 1);
|
|
9
10
|
const panels = items.map((item) => {
|
|
10
11
|
const n = item.values.length;
|
|
11
12
|
const x = (i) => (n === 1 ? W : (i / (n - 1)) * W);
|
|
@@ -7,4 +7,4 @@ export type DSSmallMultiplesProps = Omit<ComponentProps<'section'>, 'children' |
|
|
|
7
7
|
headingLevel?: 2 | 3 | 4;
|
|
8
8
|
};
|
|
9
9
|
/** The same small line once per thing, every panel on one scale, each ending on its latest figure. */
|
|
10
|
-
export declare function DSSmallMultiples({ label, items, columns, emptyLabel, loading, labelHidden, formatValue, headingLevel, className, ...props }: DSSmallMultiplesProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function DSSmallMultiples({ label, items, columns, emptyLabel, loading, loadingLabel, labelHidden, formatValue, headingLevel, className, ...props }: DSSmallMultiplesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,8 @@ import { useId } from 'react';
|
|
|
3
3
|
import { DSEmptyState } from '../../empty-state/web/ds-empty-state';
|
|
4
4
|
import { formatChartValue } from '../../lib/chart-value';
|
|
5
5
|
import { cn } from '../../lib/cn';
|
|
6
|
+
import { SpokenRegion } from '../../lib/web/spoken-region';
|
|
7
|
+
import { loadingSpoken } from '../../skeleton/skeleton';
|
|
6
8
|
import { DSSkeleton } from '../../skeleton/web/ds-skeleton';
|
|
7
9
|
import { DSText } from '../../text/web/ds-text';
|
|
8
10
|
import { SMALL_MULTIPLES_VIEWBOX, smallMultiplesSpec, } from '../small-multiples';
|
|
@@ -12,10 +14,14 @@ const COLUMNS = {
|
|
|
12
14
|
4: 'grid-cols-2 sm:grid-cols-4',
|
|
13
15
|
};
|
|
14
16
|
const PANEL_PX = 44;
|
|
17
|
+
const PANEL_HEIGHT = { '--panel-h': `${String(PANEL_PX)}px` };
|
|
15
18
|
const HEADINGS = { 2: 'h2', 3: 'h3', 4: 'h4' };
|
|
16
|
-
|
|
19
|
+
function SmallMultiplesSkeleton({ columns }) {
|
|
20
|
+
return (_jsx("div", { "aria-busy": true, className: cn('grid gap-4', COLUMNS[columns]), "data-chart-loading": "", children: Array.from({ length: columns }, (_, i) => (_jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx(DSSkeleton, { fits: "body-xs", className: "w-1/2" }), _jsx(DSSkeleton, { fits: "body-xs", className: "w-1/4" })] }), _jsx(DSSkeleton, { className: "h-(--panel-h) w-full rounded-xs", style: PANEL_HEIGHT })] }, i))) }));
|
|
21
|
+
}
|
|
22
|
+
export function DSSmallMultiples({ label, items, columns = 3, emptyLabel, loading = false, loadingLabel, labelHidden = false, formatValue = formatChartValue, headingLevel = 2, className, ...props }) {
|
|
17
23
|
const spec = smallMultiplesSpec(items);
|
|
18
24
|
const headingId = useId();
|
|
19
25
|
const viewBox = `0 0 ${String(SMALL_MULTIPLES_VIEWBOX.width)} ${String(SMALL_MULTIPLES_VIEWBOX.height)}`;
|
|
20
|
-
return (_jsxs("section", { "aria-labelledby": headingId,
|
|
26
|
+
return (_jsxs("section", { "aria-labelledby": headingId, className: cn('flex min-w-0 flex-col gap-3', className), ...props, children: [_jsx(DSText, { as: labelHidden ? 'span' : HEADINGS[headingLevel], id: headingId, variant: "body-sm-strong", className: labelHidden ? 'sr-only' : undefined, children: label }), _jsx(SpokenRegion, { text: loadingSpoken(loading, loadingLabel) }), loading ? (_jsx(SmallMultiplesSkeleton, { columns: columns })) : spec.empty ? (_jsx(DSEmptyState, { description: emptyLabel, className: "flex h-24 flex-col items-center justify-center" })) : (_jsx("ul", { className: cn('m-0 grid list-none gap-4 p-0', COLUMNS[columns]), children: spec.panels.map((panel) => (_jsxs("li", { className: "flex min-w-0 flex-col gap-1", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [_jsx(DSText, { as: "span", variant: "body-xs", className: "text-muted-foreground truncate", children: panel.label }), panel.last !== undefined && (_jsx(DSText, { as: "span", variant: "body-xs", className: "text-card-foreground shrink-0 font-semibold tabular-nums", children: formatValue(panel.last) }))] }), _jsxs("div", { className: "relative", style: { height: PANEL_PX }, children: [_jsxs("svg", { role: "img", "aria-label": `${panel.label}: ${panel.readings.map(formatValue).join(', ')}`, viewBox: viewBox, preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full overflow-visible", children: [_jsx("line", { x1: 0, x2: SMALL_MULTIPLES_VIEWBOX.width, y1: SMALL_MULTIPLES_VIEWBOX.height, y2: SMALL_MULTIPLES_VIEWBOX.height, strokeWidth: 1, vectorEffect: "non-scaling-stroke", className: "stroke-border" }), panel.line !== '' && (_jsx("path", { d: panel.line, fill: "none", strokeWidth: 2, strokeLinecap: "round", vectorEffect: "non-scaling-stroke", className: "stroke-chart-accent" }))] }), panel.last !== undefined && (_jsx("span", { "aria-hidden": true, "data-forced-colors": "mark", className: "bg-chart-accent ring-card absolute size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-1", style: { left: `${String(panel.lastX)}%`, top: `${String(panel.lastY)}%` } }))] })] }, panel.key))) }))] }));
|
|
21
27
|
}
|
|
@@ -15,20 +15,30 @@ export declare const SPARKLINE_WIDTH = 96;
|
|
|
15
15
|
export declare const SPARKLINE_HEIGHT = 32;
|
|
16
16
|
/** Room left round the line so its stroke is never clipped at an edge. */
|
|
17
17
|
export declare const SPARKLINE_PAD = 2;
|
|
18
|
-
/** The points of the line, `x,y` pairs
|
|
19
|
-
|
|
18
|
+
/** The points of the line, `x,y` pairs left to right, each reading in its own
|
|
19
|
+
* slot. A polyline joins every pair, so it cannot show a gap: draw with
|
|
20
|
+
* `sparklineCurve`, which breaks at one. Empty under two readings. */
|
|
21
|
+
export declare function sparklinePoints(values: readonly (number | null)[], width?: number, height?: number, pad?: number): string;
|
|
22
|
+
/** Where the last reading sits, for the end dot: the end of the last run, so
|
|
23
|
+
* a gap at the end leaves the dot on the last reading there is. Undefined
|
|
24
|
+
* under two readings. */
|
|
25
|
+
export declare function sparklineEnd(values: readonly (number | null)[], width?: number, height?: number, pad?: number): readonly [number, number] | undefined;
|
|
20
26
|
/** The same readings as a smooth monotone curve (it never rises above the
|
|
21
27
|
* higher of two neighbours or falls below the lower, so it cannot draw a peak
|
|
22
|
-
* that did not happen) and the area under it closed to the floor.
|
|
23
|
-
*
|
|
24
|
-
|
|
28
|
+
* that did not happen) and the area under it closed to the floor. One piece
|
|
29
|
+
* per unbroken run, so a gap stays a gap; a lone reading is a dot, drawn as a
|
|
30
|
+
* line of no length that the round cap turns into one. Both empty under two
|
|
31
|
+
* readings. */
|
|
32
|
+
export declare function sparklineCurve(values: readonly (number | null)[], width?: number, height?: number, pad?: number): {
|
|
25
33
|
line: string;
|
|
26
34
|
area: string;
|
|
27
35
|
};
|
|
28
36
|
/** The props every Sparkline implementation accepts. */
|
|
29
37
|
export interface SparklineContract {
|
|
30
|
-
/** The readings, oldest first
|
|
31
|
-
|
|
38
|
+
/** The readings, oldest first, one per even step. `null` or any other
|
|
39
|
+
* non-finite value is a missing reading: it keeps its step and the line
|
|
40
|
+
* breaks there. */
|
|
41
|
+
values: readonly (number | null)[];
|
|
32
42
|
/** What the line shows, said as a sentence: it is the drawing's accessible name. */
|
|
33
43
|
label: string;
|
|
34
44
|
/** The line's ink: the calm brand ink, or `muted` to sit further back.
|
|
@@ -39,4 +49,6 @@ export interface SparklineContract {
|
|
|
39
49
|
* of a KPI card's trend. Off by default, so a sparkline in a table row stays
|
|
40
50
|
* a line. */
|
|
41
51
|
area?: Forwarded<boolean>;
|
|
52
|
+
/** Marks the last reading with a dot, joining the line to the figure beside it. */
|
|
53
|
+
endDot?: Forwarded<boolean>;
|
|
42
54
|
}
|
|
@@ -9,36 +9,61 @@ export const SPARKLINE_TONE_INK = {
|
|
|
9
9
|
export const SPARKLINE_WIDTH = 96;
|
|
10
10
|
export const SPARKLINE_HEIGHT = 32;
|
|
11
11
|
export const SPARKLINE_PAD = 2;
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function isReading(value) {
|
|
13
|
+
return value !== null && value !== undefined && Number.isFinite(value);
|
|
14
|
+
}
|
|
15
|
+
function sparklineRuns(values, width, height, pad) {
|
|
16
|
+
const readings = values.filter(isReading);
|
|
14
17
|
if (readings.length < 2)
|
|
15
18
|
return [];
|
|
16
19
|
const low = Math.min(...readings);
|
|
17
20
|
const high = Math.max(...readings);
|
|
18
21
|
const span = high - low;
|
|
19
|
-
const step = (width - pad * 2) / (
|
|
20
|
-
|
|
22
|
+
const step = (width - pad * 2) / Math.max(1, values.length - 1);
|
|
23
|
+
const runs = [];
|
|
24
|
+
let run = [];
|
|
25
|
+
for (const [index, value] of values.entries()) {
|
|
26
|
+
if (!isReading(value)) {
|
|
27
|
+
if (run.length > 0)
|
|
28
|
+
runs.push(run);
|
|
29
|
+
run = [];
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
21
32
|
const x = pad + index * step;
|
|
22
33
|
const y = span === 0 ? height / 2 : height - pad - ((value - low) / span) * (height - pad * 2);
|
|
23
|
-
|
|
24
|
-
}
|
|
34
|
+
run.push([round(x), round(y)]);
|
|
35
|
+
}
|
|
36
|
+
if (run.length > 0)
|
|
37
|
+
runs.push(run);
|
|
38
|
+
return runs;
|
|
25
39
|
}
|
|
26
40
|
export function sparklinePoints(values, width = SPARKLINE_WIDTH, height = SPARKLINE_HEIGHT, pad = SPARKLINE_PAD) {
|
|
27
|
-
return
|
|
41
|
+
return sparklineRuns(values, width, height, pad)
|
|
42
|
+
.flat()
|
|
28
43
|
.map(([x, y]) => `${String(x)},${String(y)}`)
|
|
29
44
|
.join(' ');
|
|
30
45
|
}
|
|
46
|
+
export function sparklineEnd(values, width = SPARKLINE_WIDTH, height = SPARKLINE_HEIGHT, pad = SPARKLINE_PAD) {
|
|
47
|
+
return sparklineRuns(values, width, height, pad).at(-1)?.at(-1);
|
|
48
|
+
}
|
|
31
49
|
export function sparklineCurve(values, width = SPARKLINE_WIDTH, height = SPARKLINE_HEIGHT, pad = SPARKLINE_PAD) {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const lines = [];
|
|
51
|
+
const areas = [];
|
|
52
|
+
for (const run of sparklineRuns(values, width, height, pad)) {
|
|
53
|
+
const first = run[0];
|
|
54
|
+
const last = run.at(-1);
|
|
55
|
+
if (first === undefined || last === undefined)
|
|
56
|
+
continue;
|
|
57
|
+
const start = `M${String(first[0])},${String(first[1])}`;
|
|
58
|
+
if (run.length === 1) {
|
|
59
|
+
lines.push(`${start} L${String(first[0])},${String(first[1])}`);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const line = `${start} ${chartCurveSegments(run).join(' ')}`;
|
|
63
|
+
lines.push(line);
|
|
64
|
+
areas.push(`${line} L${String(last[0])},${String(height)} L${String(first[0])},${String(height)} Z`);
|
|
65
|
+
}
|
|
66
|
+
return { line: lines.join(' '), area: areas.join(' ') };
|
|
42
67
|
}
|
|
43
68
|
function round(value) {
|
|
44
69
|
return Math.round(value * 100) / 100;
|
|
@@ -2,4 +2,4 @@ import { type ComponentProps } from 'react';
|
|
|
2
2
|
import { type SparklineContract } from '../sparkline';
|
|
3
3
|
export type DSSparklineProps = Omit<ComponentProps<'svg'>, 'role' | 'aria-label' | 'values'> & SparklineContract;
|
|
4
4
|
/** A small, smooth trend line with no axes, named by one sentence. */
|
|
5
|
-
export declare function DSSparkline({ values, label, tone, area, className, ...props }: DSSparklineProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function DSSparkline({ values, label, tone, area, endDot, className, ...props }: DSSparklineProps): import("react/jsx-runtime").JSX.Element;
|