@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,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, } from 'react';
|
|
3
|
-
import { GEOFENCE_DEFAULT_LIMITS, GEOFENCE_DEFAULT_STEP_M, GEOFENCE_MODES, GEOFENCE_SHIFT_FACTOR, GEOFENCE_UNDO_DEPTH, GEOFENCE_UNMEASURED_WORDS, geofenceAnnouncement, geofenceConvert, geofenceDrawing, geofenceEditorKey, geofenceIssueIsGuidance, geofenceIssueMessage, geofenceIssues, geofenceMidpointLabel, geofenceMoveHandle, geofenceNudge, geofenceNudgeStep, geofencePlace, geofenceRadiusKey, geofenceRadiusRange, geofenceReadout, geofenceTranslate, geofenceVertexLabel, } from '../geofence-editor';
|
|
4
|
-
import { destination, edgeMidpoints, formatCoordinate, formatDistance, haversineDistance, insertVertex, moveVertex, polygonSelfIntersections, removeVertex, shapeBounds, } from '../../geo/geo';
|
|
3
|
+
import { GEOFENCE_DEFAULT_LIMITS, GEOFENCE_DEFAULT_STEP_M, GEOFENCE_MODES, GEOFENCE_SHIFT_FACTOR, GEOFENCE_UNDO_DEPTH, GEOFENCE_UNMEASURED_WORDS, geofenceAnnouncement, geofenceConvert, geofenceDrawing, geofenceEditorKey, geofenceIssueIsGuidance, geofenceIssueMessage, geofenceIssues, geofenceMinPoints, geofenceMidpointLabel, geofenceMoveHandle, geofenceNudge, geofenceNudgeStep, geofencePlace, geofenceRadiusKey, geofenceRadiusRange, geofenceReadout, geofenceTranslate, geofenceVertexLabel, } from '../geofence-editor';
|
|
4
|
+
import { destination, edgeMidpoints, formatCoordinate, formatDistance, haversineDistance, insertVertex, lineCorridor, moveVertex, polygonSelfIntersections, removeVertex, shapeBounds, } from '../../geo/geo';
|
|
5
5
|
import { MAP_OFF_BOX_GRACE_PX, MAP_PRESS_SLOP_PX, mapInBox, mapShapePath, mapShapeScreenPoints, } from '../../map/map';
|
|
6
6
|
import { DSMap } from '../../map/web/ds-map';
|
|
7
|
+
import { DSMapFence } from '../../map/web/ds-map-fence';
|
|
7
8
|
import { useMapView } from '../../map/web/map-provider';
|
|
8
9
|
import { Move } from 'lucide-react';
|
|
9
10
|
import { DSSegmentedControl } from '../../segmented-control/web/ds-segmented-control';
|
|
@@ -259,7 +260,7 @@ function EditingLayer({ value, onValueChange, step, hue, range, announce, hintId
|
|
|
259
260
|
const b = points[(edge + 1) % points.length];
|
|
260
261
|
if (a === undefined || b === undefined)
|
|
261
262
|
return null;
|
|
262
|
-
return (_jsx("line", { x1: a.x, y1: a.y, x2: b.x, y2: b.y, className: "stroke-
|
|
263
|
+
return (_jsx("line", { x1: a.x, y1: a.y, x2: b.x, y2: b.y, className: "stroke-error", strokeWidth: 3, strokeDasharray: "4 3", "data-testid": "geofence-crossing" }, `cross-${String(i)}-${String(j)}-${String(edge)}`));
|
|
263
264
|
}))] }));
|
|
264
265
|
if (value.type === 'circle') {
|
|
265
266
|
return (_jsxs(_Fragment, { children: [outline, _jsx(CircleHandles, { circle: value, hue: hue, range: range, step: step, hintId: hintId, startDrag: startDrag, dragHandlers: dragHandlers, handle: handle, onValueChange: onValueChange, announce: announce, onEdgeHover: setEdgeHover })] }));
|
|
@@ -418,11 +419,15 @@ function RadiusField({ circle, range, onValueChange, announce, }) {
|
|
|
418
419
|
announce({ kind: 'radius', radius: next });
|
|
419
420
|
} })] }));
|
|
420
421
|
}
|
|
421
|
-
export function DSGeofenceEditor({ label, value, onValueChange, viewport, onViewportChange, modes = GEOFENCE_MODES, minArea = GEOFENCE_DEFAULT_LIMITS.minArea, maxArea = GEOFENCE_DEFAULT_LIMITS.maxArea, step = GEOFENCE_DEFAULT_STEP_M, hue = 1, height, attribution, scrollZoom = false, base = 'standard', readout = true, placing = true, tools = true, onUndoChange, highlighted = false, onFinish, clearOf = NO_POINTS, line = false, children, className, ...props }) {
|
|
422
|
+
export function DSGeofenceEditor({ label, value, onValueChange, viewport, onViewportChange, modes = GEOFENCE_MODES, minArea = GEOFENCE_DEFAULT_LIMITS.minArea, maxArea = GEOFENCE_DEFAULT_LIMITS.maxArea, step = GEOFENCE_DEFAULT_STEP_M, hue = 1, height, attribution, scrollZoom = false, base = 'standard', readout = true, placing = true, tools = true, onUndoChange, highlighted = false, onFinish, clearOf = NO_POINTS, line = false, fitTo, historyKey, width, widthLabel, children, className, ...props }) {
|
|
422
423
|
const limits = { minArea, maxArea };
|
|
423
424
|
const range = geofenceRadiusRange(limits);
|
|
424
|
-
const issues = geofenceIssues(value, limits);
|
|
425
|
-
const figures = geofenceReadout(value);
|
|
425
|
+
const issues = geofenceIssues(value, limits, line);
|
|
426
|
+
const figures = geofenceReadout(value, line);
|
|
427
|
+
const minPoints = geofenceMinPoints(line);
|
|
428
|
+
const corridor = line && !placing && width !== undefined && width > 0 && value.type === 'polygon'
|
|
429
|
+
? lineCorridor(value.vertices, width)
|
|
430
|
+
: [];
|
|
426
431
|
const hintId = useId();
|
|
427
432
|
const moveHintId = useId();
|
|
428
433
|
const rootRef = useRef(null);
|
|
@@ -452,7 +457,7 @@ export function DSGeofenceEditor({ label, value, onValueChange, viewport, onView
|
|
|
452
457
|
rootRef.current?.querySelector('[role="application"]')?.focus();
|
|
453
458
|
});
|
|
454
459
|
const inside = useFocusWithin();
|
|
455
|
-
const escapeEntry = useEscapeEntry(inside.within && geofenceDrawing(value), () => {
|
|
460
|
+
const escapeEntry = useEscapeEntry(inside.within && geofenceDrawing(value, line), () => {
|
|
456
461
|
keepFocus();
|
|
457
462
|
change({ type: 'polygon', vertices: [] });
|
|
458
463
|
say('Drawing stopped. The points are removed.');
|
|
@@ -485,6 +490,14 @@ export function DSGeofenceEditor({ label, value, onValueChange, viewport, onView
|
|
|
485
490
|
const undoFromPage = useCallback(() => {
|
|
486
491
|
latestUndo.current();
|
|
487
492
|
}, []);
|
|
493
|
+
const historyFor = useRef(historyKey);
|
|
494
|
+
useEffect(() => {
|
|
495
|
+
if (historyFor.current === historyKey)
|
|
496
|
+
return;
|
|
497
|
+
historyFor.current = historyKey;
|
|
498
|
+
past.current = [];
|
|
499
|
+
setUndoable(false);
|
|
500
|
+
}, [historyKey]);
|
|
488
501
|
useEffect(() => {
|
|
489
502
|
onUndoChange?.(undoable ? undoFromPage : undefined);
|
|
490
503
|
return () => {
|
|
@@ -499,9 +512,11 @@ export function DSGeofenceEditor({ label, value, onValueChange, viewport, onView
|
|
|
499
512
|
change(next);
|
|
500
513
|
announce(value.type === 'circle'
|
|
501
514
|
? { kind: 'centre', point }
|
|
502
|
-
: { kind: 'placed', index: value.vertices.length, point });
|
|
515
|
+
: { kind: 'placed', index: value.vertices.length, point, line });
|
|
503
516
|
}
|
|
504
|
-
const allowed =
|
|
517
|
+
const allowed = line
|
|
518
|
+
? []
|
|
519
|
+
: modes.filter((m) => GEOFENCE_MODES.includes(m));
|
|
505
520
|
const hint = value.type === 'circle'
|
|
506
521
|
? `Arrow keys move the centre ${formatDistance(step)}, or ${formatDistance(step * GEOFENCE_SHIFT_FACTOR)} with Shift.`
|
|
507
522
|
: `Arrow keys move this point ${formatDistance(step)}, or ${formatDistance(step * GEOFENCE_SHIFT_FACTOR)} with Shift. Delete removes it.`;
|
|
@@ -526,7 +541,7 @@ export function DSGeofenceEditor({ label, value, onValueChange, viewport, onView
|
|
|
526
541
|
return;
|
|
527
542
|
if (!placing || onFinish === undefined || value.type !== 'polygon')
|
|
528
543
|
return;
|
|
529
|
-
if (value.vertices.length <
|
|
544
|
+
if (value.vertices.length < minPoints || !(event.target instanceof Element))
|
|
530
545
|
return;
|
|
531
546
|
if (event.target.closest('[role="application"]') === null)
|
|
532
547
|
return;
|
|
@@ -548,7 +563,7 @@ export function DSGeofenceEditor({ label, value, onValueChange, viewport, onView
|
|
|
548
563
|
event.preventDefault();
|
|
549
564
|
if (vertices !== value.vertices)
|
|
550
565
|
onValueChange({ type: 'polygon', vertices });
|
|
551
|
-
if (vertices.length >=
|
|
566
|
+
if (vertices.length >= minPoints)
|
|
552
567
|
onFinish();
|
|
553
568
|
}, children: [escapeEntry, announcer, tools && (allowed.length > 1 || value.type === 'polygon') && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [allowed.length > 1 ? (_jsx(DSSegmentedControl, { "aria-label": "Fence shape", segments: allowed.map((m) => ({ value: m, label: MODE_LABELS[m] })), value: value.type, onValueChange: (mode) => {
|
|
554
569
|
change(geofenceConvert(value, mode, viewport.center));
|
|
@@ -558,8 +573,8 @@ export function DSGeofenceEditor({ label, value, onValueChange, viewport, onView
|
|
|
558
573
|
keepFocus();
|
|
559
574
|
change({ type: 'polygon', vertices: [] });
|
|
560
575
|
say('All points removed.');
|
|
561
|
-
}, children: _jsx("button", { type: "button", children: "Clear points" }) }))] })] })), _jsxs(DSMap, { label: label, viewport: viewport, onViewportChange: onViewportChange, fitTo: shapeBounds(value), ...(placing ? { onPick } : {}), finishable: placing &&
|
|
576
|
+
}, children: _jsx("button", { type: "button", children: "Clear points" }) }))] })] })), _jsxs(DSMap, { label: label, viewport: viewport, onViewportChange: onViewportChange, fitTo: fitTo ?? shapeBounds(value), ...(placing ? { onPick } : {}), finishable: placing &&
|
|
562
577
|
onFinish !== undefined &&
|
|
563
578
|
value.type === 'polygon' &&
|
|
564
|
-
value.vertices.length >=
|
|
579
|
+
value.vertices.length >= minPoints, attribution: attribution, scrollZoom: scrollZoom, base: base, ...(height === undefined ? {} : { height }), children: [corridor.length > 0 && (_jsx(DSMapFence, { shape: { type: 'polygon', vertices: corridor }, label: widthLabel ?? `Within ${formatDistance(width ?? 0)} of the line`, hue: hue })), _jsx("div", { className: "pointer-events-none absolute inset-0 z-(--layer-raised)", children: _jsx(EditingLayer, { value: value, onValueChange: change, step: step, hue: hue, range: range, announce: announce, hintId: hintId, moveHintId: moveHintId, onDragValue: onValueChange, remember: remember, highlighted: highlighted, placing: placing, onFinish: onFinish, clearOf: clearOf, line: line }) }), children] }), _jsx("p", { id: hintId, className: "sr-only", children: hint }), _jsx("p", { id: moveHintId, className: "sr-only", children: `Drag to move the whole area, or press the arrow keys to move it ${formatDistance(step)}, ${formatDistance(step * GEOFENCE_SHIFT_FACTOR)} with Shift.` }), readout && (_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-4", children: [_jsxs("dl", { className: "flex flex-wrap gap-x-6 gap-y-1 text-body-sm", children: [figures.length !== undefined && (_jsxs("div", { className: "flex flex-col", children: [_jsx("dt", { className: "text-muted-foreground", children: "Length" }), _jsx("dd", { className: "font-semibold tabular-nums text-foreground", "data-testid": "geofence-length", children: _jsx(Figure, { measured: figures.measured, text: figures.length }) })] })), figures.length !== undefined && width !== undefined && width > 0 && (_jsxs("div", { className: "flex flex-col", children: [_jsx("dt", { className: "text-muted-foreground", children: "Either side" }), _jsx("dd", { className: "font-semibold tabular-nums text-foreground", children: formatDistance(width) })] })), figures.radius !== undefined && (_jsxs("div", { className: "flex flex-col", children: [_jsx("dt", { className: "text-muted-foreground", children: "Radius" }), _jsx("dd", { className: "font-semibold tabular-nums text-foreground", children: figures.radius })] })), figures.length === undefined && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col", children: [_jsx("dt", { className: "text-muted-foreground", children: "Area" }), _jsx("dd", { className: "font-semibold tabular-nums text-foreground", "data-testid": "geofence-area", children: _jsx(Figure, { measured: figures.measured, text: figures.area }) })] }), _jsxs("div", { className: "flex flex-col", children: [_jsx("dt", { className: "text-muted-foreground", children: value.type === 'circle' ? 'Circumference' : 'Perimeter' }), _jsx("dd", { className: "font-semibold tabular-nums text-foreground", children: _jsx(Figure, { measured: figures.measured, text: figures.perimeter }) })] })] }))] }), value.type === 'circle' && (_jsx(RadiusField, { circle: value, range: range, onValueChange: change, announce: announce }))] })), tools && (_jsx("div", { "aria-live": "polite", className: "flex min-h-5 flex-col gap-1", "data-testid": "geofence-issues", children: issues.map((issue) => (_jsx(DSHelperText, { ...(geofenceIssueIsGuidance(issue) ? {} : { tone: 'error' }), children: geofenceIssueMessage(issue, value, limits, line) }, issue))) }))] }));
|
|
565
580
|
}
|
|
@@ -18,7 +18,7 @@ export type DSGroupHeaderProps = Omit<ComponentProps<'div'>, 'title' | 'children
|
|
|
18
18
|
selection?: DSGroupHeaderSelection;
|
|
19
19
|
/** A mark before the title: an icon, a bank's logo. */
|
|
20
20
|
leading?: ReactNode;
|
|
21
|
-
/** Something in the section that wants attention, after the count: a status badge
|
|
21
|
+
/** Something in the section that wants attention, after the count, in words: a status badge ("3 alerts"). A bare number beside the count reads as part of it. */
|
|
22
22
|
badge?: ReactNode;
|
|
23
23
|
/** At the end: a figure for the section, with its label. */
|
|
24
24
|
summary?: ReactNode;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ChartHue } from '../lib/chart-hue';
|
|
2
|
+
import type { Forwarded } from '../props';
|
|
3
|
+
import type { LoadingContract } from '../skeleton/skeleton';
|
|
4
|
+
export type HeatmapCalendarWeekStart = 'monday' | 'sunday';
|
|
5
|
+
export interface HeatmapCalendarDay {
|
|
6
|
+
/** The calendar day, "2026-10-14". */
|
|
7
|
+
date: string;
|
|
8
|
+
/** The reading, or `null` for no reading. */
|
|
9
|
+
value: number | null;
|
|
10
|
+
}
|
|
11
|
+
export interface HeatmapCalendarContract extends LoadingContract {
|
|
12
|
+
/** One reading per day. Order does not matter. */
|
|
13
|
+
days: readonly HeatmapCalendarDay[];
|
|
14
|
+
/** The first day drawn, "2026-01-01". Defaults to the earliest day sent. */
|
|
15
|
+
from?: string;
|
|
16
|
+
/** The last day drawn. Defaults to the latest day sent. */
|
|
17
|
+
to?: string;
|
|
18
|
+
/** Which weekday a week starts on, the top row. Monday unless said. */
|
|
19
|
+
weekStartsOn?: HeatmapCalendarWeekStart;
|
|
20
|
+
/** The seven weekday names, Sunday first (the order of `Date#getDay`), from the
|
|
21
|
+
* caller's own locale: `Intl.DateTimeFormat(locale, { weekday: 'short' })`. */
|
|
22
|
+
weekdayNames: readonly string[];
|
|
23
|
+
/** The twelve month names, January first, from the caller's own locale. */
|
|
24
|
+
monthNames: readonly string[];
|
|
25
|
+
/** Which categorical hue the scale is drawn in. Defaults to the first. */
|
|
26
|
+
series?: Forwarded<ChartHue>;
|
|
27
|
+
}
|
|
28
|
+
/** The weekday of each row, top first, in `Date#getDay` numbers. The same
|
|
29
|
+
* whatever the range, so a calendar still loading has its rows. */
|
|
30
|
+
export declare function heatmapCalendarRowWeekdays(weekStartsOn?: HeatmapCalendarWeekStart): number[];
|
|
31
|
+
/** Whole days since 1970-01-01 for "2026-10-14", or `null` if it is not a real day. */
|
|
32
|
+
export declare function heatmapCalendarDayNumber(date: string): number | null;
|
|
33
|
+
/** "2026-10-14" for a day number. */
|
|
34
|
+
export declare function heatmapCalendarDayText(dayNumber: number): string;
|
|
35
|
+
export interface HeatmapCalendarDateParts {
|
|
36
|
+
/** 0 is Sunday, as `Date#getDay`. */
|
|
37
|
+
weekday: number;
|
|
38
|
+
day: number;
|
|
39
|
+
/** 0 is January. */
|
|
40
|
+
month: number;
|
|
41
|
+
year: number;
|
|
42
|
+
}
|
|
43
|
+
/** The weekday, day, month and year of a day number. */
|
|
44
|
+
export declare function heatmapCalendarDateParts(dayNumber: number): HeatmapCalendarDateParts;
|
|
45
|
+
/** One month's name over the week it starts in. */
|
|
46
|
+
export interface HeatmapCalendarMonthMark {
|
|
47
|
+
/** The week (column) the name is written over. */
|
|
48
|
+
column: number;
|
|
49
|
+
/** 0 is January. */
|
|
50
|
+
month: number;
|
|
51
|
+
year: number;
|
|
52
|
+
/** The year is written with the name: the range crosses a new year and this is
|
|
53
|
+
* where it does, or where it begins. */
|
|
54
|
+
showYear: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface HeatmapCalendarSpec {
|
|
57
|
+
/** Nothing to draw: no valid day in the range, or a range that ends before it
|
|
58
|
+
* starts. */
|
|
59
|
+
empty: boolean;
|
|
60
|
+
/** The first and last day drawn, "2026-01-01". Empty text when `empty`. */
|
|
61
|
+
from: string;
|
|
62
|
+
to: string;
|
|
63
|
+
/** The number of days drawn. */
|
|
64
|
+
dayCount: number;
|
|
65
|
+
/** How many weeks (columns) the range touches. */
|
|
66
|
+
weeks: number;
|
|
67
|
+
/** The weekday (0 is Sunday) of each row, top to bottom. */
|
|
68
|
+
rowWeekdays: readonly number[];
|
|
69
|
+
/** `[row][week]`: the day's date, or `null` for a cell outside the range. */
|
|
70
|
+
dates: readonly (readonly (string | null)[])[];
|
|
71
|
+
/** `[row][week]`: the reading, or `null` for no reading (and for a cell outside). */
|
|
72
|
+
values: readonly (readonly (number | null)[])[];
|
|
73
|
+
/** `[row][week]`: `true` for a cell outside the range, which is not drawn. */
|
|
74
|
+
blank: readonly (readonly boolean[])[];
|
|
75
|
+
months: readonly HeatmapCalendarMonthMark[];
|
|
76
|
+
/** The range touches more than one calendar year. */
|
|
77
|
+
spansYears: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** The one function an adapter calls: places every day of the range in its week and weekday. */
|
|
80
|
+
export declare function heatmapCalendarSpec({ days, from, to, weekStartsOn, }: {
|
|
81
|
+
days: readonly HeatmapCalendarDay[];
|
|
82
|
+
from?: string | undefined;
|
|
83
|
+
to?: string | undefined;
|
|
84
|
+
weekStartsOn?: HeatmapCalendarWeekStart | undefined;
|
|
85
|
+
}): HeatmapCalendarSpec;
|
|
86
|
+
export interface HeatmapCalendarNames {
|
|
87
|
+
weekdayNames: readonly string[];
|
|
88
|
+
monthNames: readonly string[];
|
|
89
|
+
}
|
|
90
|
+
/** What a day is called in the readout and to a screen reader: "Tue 14 Oct", and
|
|
91
|
+
* "Tue 14 Oct 2026" when the range crosses a year so that two Octobers are two
|
|
92
|
+
* names. The word order is the caller's to change, with `format`. */
|
|
93
|
+
export declare function heatmapCalendarDayLabel(date: string, names: HeatmapCalendarNames, spansYears: boolean, format?: (parts: HeatmapCalendarDateParts, names: HeatmapCalendarNames) => string): string;
|
|
94
|
+
/** A month's name over its week: "Oct", and "Jan 2027" where the year turns. */
|
|
95
|
+
export declare function heatmapCalendarMonthText(mark: HeatmapCalendarMonthMark, names: HeatmapCalendarNames): string;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const DAYS_IN_WEEK = 7;
|
|
2
|
+
const MS_PER_DAY = 86_400_000;
|
|
3
|
+
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
4
|
+
export function heatmapCalendarRowWeekdays(weekStartsOn = 'monday') {
|
|
5
|
+
const weekStart = weekStartsOn === 'sunday' ? 0 : 1;
|
|
6
|
+
return Array.from({ length: DAYS_IN_WEEK }, (_, row) => (row + weekStart) % DAYS_IN_WEEK);
|
|
7
|
+
}
|
|
8
|
+
export function heatmapCalendarDayNumber(date) {
|
|
9
|
+
const match = ISO_DATE.exec(date);
|
|
10
|
+
if (match === null)
|
|
11
|
+
return null;
|
|
12
|
+
const year = Number(match[1]);
|
|
13
|
+
const month = Number(match[2]);
|
|
14
|
+
const day = Number(match[3]);
|
|
15
|
+
const ms = Date.UTC(year, month - 1, day);
|
|
16
|
+
const back = new Date(ms);
|
|
17
|
+
if (back.getUTCFullYear() !== year || back.getUTCMonth() !== month - 1 || back.getUTCDate() !== day) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return Math.round(ms / MS_PER_DAY);
|
|
21
|
+
}
|
|
22
|
+
export function heatmapCalendarDayText(dayNumber) {
|
|
23
|
+
const d = new Date(dayNumber * MS_PER_DAY);
|
|
24
|
+
const pad = (n, width) => String(n).padStart(width, '0');
|
|
25
|
+
return `${pad(d.getUTCFullYear(), 4)}-${pad(d.getUTCMonth() + 1, 2)}-${pad(d.getUTCDate(), 2)}`;
|
|
26
|
+
}
|
|
27
|
+
export function heatmapCalendarDateParts(dayNumber) {
|
|
28
|
+
const d = new Date(dayNumber * MS_PER_DAY);
|
|
29
|
+
return {
|
|
30
|
+
weekday: d.getUTCDay(),
|
|
31
|
+
day: d.getUTCDate(),
|
|
32
|
+
month: d.getUTCMonth(),
|
|
33
|
+
year: d.getUTCFullYear(),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const EMPTY = {
|
|
37
|
+
empty: true,
|
|
38
|
+
from: '',
|
|
39
|
+
to: '',
|
|
40
|
+
dayCount: 0,
|
|
41
|
+
weeks: 0,
|
|
42
|
+
rowWeekdays: [],
|
|
43
|
+
dates: [],
|
|
44
|
+
values: [],
|
|
45
|
+
blank: [],
|
|
46
|
+
months: [],
|
|
47
|
+
spansYears: false,
|
|
48
|
+
};
|
|
49
|
+
const MIN_WEEKS_BETWEEN_MONTH_NAMES = 2;
|
|
50
|
+
export function heatmapCalendarSpec({ days, from, to, weekStartsOn = 'monday', }) {
|
|
51
|
+
const readings = new Map();
|
|
52
|
+
for (const entry of days) {
|
|
53
|
+
const n = heatmapCalendarDayNumber(entry.date);
|
|
54
|
+
if (n === null)
|
|
55
|
+
continue;
|
|
56
|
+
readings.set(n, Number.isFinite(entry.value) ? entry.value : null);
|
|
57
|
+
}
|
|
58
|
+
const known = [...readings.keys()];
|
|
59
|
+
const firstGiven = from === undefined ? null : heatmapCalendarDayNumber(from);
|
|
60
|
+
const lastGiven = to === undefined ? null : heatmapCalendarDayNumber(to);
|
|
61
|
+
if ((from !== undefined && firstGiven === null) || (to !== undefined && lastGiven === null)) {
|
|
62
|
+
return EMPTY;
|
|
63
|
+
}
|
|
64
|
+
const first = firstGiven ?? (known.length === 0 ? null : Math.min(...known));
|
|
65
|
+
const last = lastGiven ?? (known.length === 0 ? null : Math.max(...known));
|
|
66
|
+
if (first === null || last === null || last < first)
|
|
67
|
+
return EMPTY;
|
|
68
|
+
const weekStart = weekStartsOn === 'sunday' ? 0 : 1;
|
|
69
|
+
const weekdayOf = (n) => (((n + 4) % DAYS_IN_WEEK) + DAYS_IN_WEEK) % DAYS_IN_WEEK;
|
|
70
|
+
const rowOf = (n) => (weekdayOf(n) - weekStart + DAYS_IN_WEEK) % DAYS_IN_WEEK;
|
|
71
|
+
const gridStart = first - rowOf(first);
|
|
72
|
+
const weeks = Math.floor((last - gridStart) / DAYS_IN_WEEK) + 1;
|
|
73
|
+
const rowWeekdays = heatmapCalendarRowWeekdays(weekStartsOn);
|
|
74
|
+
const dates = rowWeekdays.map(() => Array.from({ length: weeks }, () => null));
|
|
75
|
+
const values = rowWeekdays.map(() => Array.from({ length: weeks }, () => null));
|
|
76
|
+
const blank = rowWeekdays.map(() => Array.from({ length: weeks }, () => true));
|
|
77
|
+
for (let n = first; n <= last; n += 1) {
|
|
78
|
+
const row = rowOf(n);
|
|
79
|
+
const column = Math.floor((n - gridStart) / DAYS_IN_WEEK);
|
|
80
|
+
dates[row][column] = heatmapCalendarDayText(n);
|
|
81
|
+
values[row][column] = readings.get(n) ?? null;
|
|
82
|
+
blank[row][column] = false;
|
|
83
|
+
}
|
|
84
|
+
const start = heatmapCalendarDateParts(first);
|
|
85
|
+
const end = heatmapCalendarDateParts(last);
|
|
86
|
+
const spansYears = start.year !== end.year;
|
|
87
|
+
const months = [];
|
|
88
|
+
for (let year = start.year, month = start.month; year < end.year || (year === end.year && month <= end.month);) {
|
|
89
|
+
const firstOfMonth = Math.round(Date.UTC(year, month, 1) / MS_PER_DAY);
|
|
90
|
+
const column = firstOfMonth <= first ? 0 : Math.floor((firstOfMonth - gridStart) / DAYS_IN_WEEK);
|
|
91
|
+
months.push({ column, month, year, showYear: false });
|
|
92
|
+
month += 1;
|
|
93
|
+
if (month === 12) {
|
|
94
|
+
month = 0;
|
|
95
|
+
year += 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const next = months[1];
|
|
99
|
+
if (next !== undefined && next.column - (months[0]?.column ?? 0) < MIN_WEEKS_BETWEEN_MONTH_NAMES) {
|
|
100
|
+
months.shift();
|
|
101
|
+
}
|
|
102
|
+
const marks = months.map((m, i) => ({ ...m, showYear: spansYears && (i === 0 || m.month === 0) }));
|
|
103
|
+
return {
|
|
104
|
+
empty: false,
|
|
105
|
+
from: heatmapCalendarDayText(first),
|
|
106
|
+
to: heatmapCalendarDayText(last),
|
|
107
|
+
dayCount: last - first + 1,
|
|
108
|
+
weeks,
|
|
109
|
+
rowWeekdays,
|
|
110
|
+
dates,
|
|
111
|
+
values,
|
|
112
|
+
blank,
|
|
113
|
+
months: marks,
|
|
114
|
+
spansYears,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export function heatmapCalendarDayLabel(date, names, spansYears, format) {
|
|
118
|
+
const n = heatmapCalendarDayNumber(date);
|
|
119
|
+
if (n === null)
|
|
120
|
+
return date;
|
|
121
|
+
const parts = heatmapCalendarDateParts(n);
|
|
122
|
+
if (format !== undefined)
|
|
123
|
+
return format(parts, names);
|
|
124
|
+
const text = `${names.weekdayNames[parts.weekday] ?? ''} ${String(parts.day)} ${names.monthNames[parts.month] ?? ''}`;
|
|
125
|
+
return spansYears ? `${text} ${String(parts.year)}` : text;
|
|
126
|
+
}
|
|
127
|
+
export function heatmapCalendarMonthText(mark, names) {
|
|
128
|
+
const name = names.monthNames[mark.month] ?? '';
|
|
129
|
+
return mark.showYear ? `${name} ${String(mark.year)}` : name;
|
|
130
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ChartHue } from '../lib/chart-hue';
|
|
2
2
|
import type { Forwarded } from '../props';
|
|
3
|
+
import type { LoadingContract } from '../skeleton/skeleton';
|
|
3
4
|
/** The edge of a zero cell (and the key's empty box): the hairline that
|
|
4
5
|
* outlines a control at rest, with the ground showing through. */
|
|
5
6
|
export declare const HEATMAP_ZERO_EDGE = "border";
|
|
@@ -8,7 +9,7 @@ export type HeatmapZeroEdgeRole = typeof HEATMAP_ZERO_EDGE;
|
|
|
8
9
|
* no reading. */
|
|
9
10
|
export declare const HEATMAP_STEPS: readonly [1, 2, 3, 4, 5];
|
|
10
11
|
export type HeatmapStep = (typeof HEATMAP_STEPS)[number];
|
|
11
|
-
export interface HeatmapContract {
|
|
12
|
+
export interface HeatmapContract extends LoadingContract {
|
|
12
13
|
/** The row names, top to bottom. */
|
|
13
14
|
rows: readonly string[];
|
|
14
15
|
/** The column names, left to right. */
|
|
@@ -20,6 +21,8 @@ export interface HeatmapContract {
|
|
|
20
21
|
series?: Forwarded<ChartHue>;
|
|
21
22
|
/** Adds a total per row and per column and the grand total, headed by these words: "Total". */
|
|
22
23
|
totalsLabel?: Forwarded<string>;
|
|
24
|
+
/** `true` where a cell is not drawn at all: no box, no reading, no tab stop. */
|
|
25
|
+
blank?: readonly (readonly boolean[])[] | undefined;
|
|
23
26
|
}
|
|
24
27
|
export interface HeatmapCell {
|
|
25
28
|
row: number;
|
|
@@ -31,6 +34,9 @@ export interface HeatmapCell {
|
|
|
31
34
|
step: HeatmapStep | 0 | null;
|
|
32
35
|
/** The value was below zero and is drawn as zero. */
|
|
33
36
|
clamped: boolean;
|
|
37
|
+
/** Not drawn: outside the picture (see `HeatmapContract.blank`). Only ever
|
|
38
|
+
* present, as `true`, on such a cell. */
|
|
39
|
+
blank?: true;
|
|
34
40
|
}
|
|
35
41
|
/** One filled step's range: values above `from`, up to and including `to`. */
|
|
36
42
|
export interface HeatmapBucket {
|
|
@@ -58,7 +64,7 @@ export interface HeatmapResolvedSpec {
|
|
|
58
64
|
export declare function heatmapStep(value: number | null, max: number): HeatmapStep | 0 | null;
|
|
59
65
|
/** The one function an adapter calls: pads the grid, finds the range and
|
|
60
66
|
* puts every cell in its step. */
|
|
61
|
-
export declare function heatmapSpec({ rows, columns, values, series, }: HeatmapContract): HeatmapResolvedSpec;
|
|
67
|
+
export declare function heatmapSpec({ rows, columns, values, series, blank, }: HeatmapContract): HeatmapResolvedSpec;
|
|
62
68
|
/** What a bucket is called in the key. The first step reads "Up to …" because
|
|
63
69
|
* its lower edge is zero, which the key already names on its own; the rest
|
|
64
70
|
* read "429 L to 858 L", in words, as the time range writes a range. */
|
|
@@ -77,12 +83,33 @@ export declare const HEATMAP_PAGE_ROWS = 5;
|
|
|
77
83
|
* move `pageRows` rows in the same column and stop at the first and last row.
|
|
78
84
|
*/
|
|
79
85
|
export declare function heatmapMove(from: HeatmapPosition, key: string, rowCount: number, columnCount: number, ctrl?: boolean, pageRows?: number): HeatmapPosition | null;
|
|
86
|
+
/** The first cell that is drawn, reading down each column from the left: where
|
|
87
|
+
* a grid with blanks puts its tab stop and what Ctrl+Home reaches. `null`
|
|
88
|
+
* when every cell is blank. */
|
|
89
|
+
export declare function heatmapFirstDrawn(rowCount: number, columnCount: number, isBlank: (position: HeatmapPosition) => boolean): HeatmapPosition | null;
|
|
90
|
+
/**
|
|
91
|
+
* `heatmapMove` for a grid with cells that are not drawn. A blank cell takes no
|
|
92
|
+
* focus, so a move that would land on one goes to the nearest drawn cell
|
|
93
|
+
* instead, or stays where it is when there is none:
|
|
94
|
+
*
|
|
95
|
+
* an arrow keeps going the way it was pointed, past the blanks
|
|
96
|
+
* Home, End, Page come back toward the cell the move started from, along
|
|
97
|
+
* the same row or column, so End on a row whose last week
|
|
98
|
+
* is short lands on the last day that exists
|
|
99
|
+
* Ctrl+Home, End the first and last drawn cell, reading down each column
|
|
100
|
+
* from the left, which for a calendar is its first and
|
|
101
|
+
* last day
|
|
102
|
+
*
|
|
103
|
+
* With nothing blank it is exactly `heatmapMove`.
|
|
104
|
+
*/
|
|
105
|
+
export declare function heatmapMoveDrawn(from: HeatmapPosition, key: string, rowCount: number, columnCount: number, isBlank: (position: HeatmapPosition) => boolean, ctrl?: boolean, pageRows?: number): HeatmapPosition | null;
|
|
80
106
|
export interface HeatmapTotals {
|
|
81
|
-
/** One per row, left to right summed. */
|
|
82
|
-
rows: number[];
|
|
83
|
-
/** One per column, top to bottom summed. */
|
|
84
|
-
columns: number[];
|
|
85
|
-
|
|
107
|
+
/** One per row, left to right summed; `null` for a row with no reading at all. */
|
|
108
|
+
rows: (number | null)[];
|
|
109
|
+
/** One per column, top to bottom summed; `null` for a column with no reading at all. */
|
|
110
|
+
columns: (number | null)[];
|
|
111
|
+
/** `null` when the whole grid has no reading. */
|
|
112
|
+
all: number | null;
|
|
86
113
|
}
|
|
87
|
-
/** The row, column and grand totals. A cell with no reading adds nothing
|
|
114
|
+
/** The row, column and grand totals. A cell with no reading adds nothing; a line with none is `null`. */
|
|
88
115
|
export declare function heatmapTotals(values: readonly (readonly (number | null)[])[], columns: number): HeatmapTotals;
|
package/dist/heatmap/heatmap.js
CHANGED
|
@@ -8,11 +8,17 @@ export function heatmapStep(value, max) {
|
|
|
8
8
|
const step = Math.ceil((value / max) * HEATMAP_STEPS.length);
|
|
9
9
|
return Math.min(HEATMAP_STEPS.length, Math.max(1, step));
|
|
10
10
|
}
|
|
11
|
-
export function heatmapSpec({ rows, columns, values, series = 1, }) {
|
|
11
|
+
export function heatmapSpec({ rows, columns, values, series = 1, blank, }) {
|
|
12
12
|
const clean = (v) => v === null || v === undefined || !Number.isFinite(v) ? null : v;
|
|
13
|
-
const
|
|
13
|
+
const isBlank = (row, column) => blank?.[row]?.[column] === true;
|
|
14
|
+
const readings = rows.flatMap((_, r) => columns
|
|
15
|
+
.map((__, c) => (isBlank(r, c) ? null : clean(values[r]?.[c])))
|
|
16
|
+
.filter((v) => v !== null));
|
|
14
17
|
const max = Math.max(0, ...readings);
|
|
15
18
|
const cells = rows.map((_, row) => columns.map((__, column) => {
|
|
19
|
+
if (isBlank(row, column)) {
|
|
20
|
+
return { row, column, value: null, step: null, clamped: false, blank: true };
|
|
21
|
+
}
|
|
16
22
|
const value = clean(values[row]?.[column]);
|
|
17
23
|
return {
|
|
18
24
|
row,
|
|
@@ -22,7 +28,7 @@ export function heatmapSpec({ rows, columns, values, series = 1, }) {
|
|
|
22
28
|
clamped: value !== null && value < 0,
|
|
23
29
|
};
|
|
24
30
|
}));
|
|
25
|
-
const flat = cells.flat();
|
|
31
|
+
const flat = cells.flat().filter((c) => c.blank !== true);
|
|
26
32
|
return {
|
|
27
33
|
empty: readings.length === 0,
|
|
28
34
|
max,
|
|
@@ -75,9 +81,57 @@ export function heatmapMove(from, key, rowCount, columnCount, ctrl = false, page
|
|
|
75
81
|
return null;
|
|
76
82
|
}
|
|
77
83
|
}
|
|
84
|
+
export function heatmapFirstDrawn(rowCount, columnCount, isBlank) {
|
|
85
|
+
for (let column = 0; column < columnCount; column += 1) {
|
|
86
|
+
for (let row = 0; row < rowCount; row += 1) {
|
|
87
|
+
if (!isBlank({ row, column }))
|
|
88
|
+
return { row, column };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
export function heatmapMoveDrawn(from, key, rowCount, columnCount, isBlank, ctrl = false, pageRows = HEATMAP_PAGE_ROWS) {
|
|
94
|
+
const next = heatmapMove(from, key, rowCount, columnCount, ctrl, pageRows);
|
|
95
|
+
if (next === null || !isBlank(next))
|
|
96
|
+
return next;
|
|
97
|
+
if (ctrl && (key === 'Home' || key === 'End')) {
|
|
98
|
+
const forward = key === 'Home';
|
|
99
|
+
const last = rowCount * columnCount - 1;
|
|
100
|
+
for (let i = 0; i <= last; i += 1) {
|
|
101
|
+
const at = forward ? i : last - i;
|
|
102
|
+
const position = { row: at % rowCount, column: Math.floor(at / rowCount) };
|
|
103
|
+
if (!isBlank(position))
|
|
104
|
+
return position;
|
|
105
|
+
}
|
|
106
|
+
return from;
|
|
107
|
+
}
|
|
108
|
+
const arrow = {
|
|
109
|
+
ArrowRight: { row: 0, column: 1 },
|
|
110
|
+
ArrowLeft: { row: 0, column: -1 },
|
|
111
|
+
ArrowDown: { row: 1, column: 0 },
|
|
112
|
+
ArrowUp: { row: -1, column: 0 },
|
|
113
|
+
};
|
|
114
|
+
const way = arrow[key];
|
|
115
|
+
const step = way ?? {
|
|
116
|
+
row: Math.sign(from.row - next.row),
|
|
117
|
+
column: Math.sign(from.column - next.column),
|
|
118
|
+
};
|
|
119
|
+
if (step.row === 0 && step.column === 0)
|
|
120
|
+
return from;
|
|
121
|
+
let at = next;
|
|
122
|
+
while (at.row >= 0 && at.row < rowCount && at.column >= 0 && at.column < columnCount) {
|
|
123
|
+
if (!isBlank(at))
|
|
124
|
+
return at;
|
|
125
|
+
at = { row: at.row + step.row, column: at.column + step.column };
|
|
126
|
+
}
|
|
127
|
+
return from;
|
|
128
|
+
}
|
|
78
129
|
export function heatmapTotals(values, columns) {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
130
|
+
const sum = (line) => {
|
|
131
|
+
const finite = line.filter((v) => v !== null && v !== undefined && Number.isFinite(v));
|
|
132
|
+
return finite.length === 0 ? null : finite.reduce((a, b) => a + b, 0);
|
|
133
|
+
};
|
|
134
|
+
const rows = values.map((row) => sum(row));
|
|
135
|
+
const cols = Array.from({ length: columns }, (_, c) => sum(values.map((row) => row[c])));
|
|
136
|
+
return { rows, columns: cols, all: sum(rows) };
|
|
83
137
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { type HeatmapCalendarDateParts, type HeatmapCalendarContract, type HeatmapCalendarNames } from '../heatmap-calendar';
|
|
3
|
+
import { type DSHeatmapProps } from './ds-heatmap';
|
|
4
|
+
export type DSHeatmapCalendarProps = Omit<ComponentProps<'div'>, 'role' | 'aria-label' | 'children'> & HeatmapCalendarContract & Pick<DSHeatmapProps, 'legend' | 'emptyLabel' | 'onInspect'> & {
|
|
5
|
+
/** What the calendar is OF, "Litres drawn per day, 2026". Names the grid for a
|
|
6
|
+
* screen reader and the table. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** How a reading is written in the readout, the key and the table:
|
|
9
|
+
* "1 240 L". Defaults to the number grouped in en-ZA. */
|
|
10
|
+
formatValue?: (value: number) => string;
|
|
11
|
+
/** How a day is written in the readout and the table. Defaults to "Tue 14 Oct"
|
|
12
|
+
* (weekday, day, month, in that order). */
|
|
13
|
+
formatDate?: (parts: HeatmapCalendarDateParts, names: HeatmapCalendarNames) => string;
|
|
14
|
+
/** The table's column heads, and the words for a day with no reading. */
|
|
15
|
+
tableLabels: {
|
|
16
|
+
date: string;
|
|
17
|
+
value: string;
|
|
18
|
+
noData: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/** A value per day, drawn as a calendar of weeks and weekdays in one hue at five strengths. */
|
|
22
|
+
export declare function DSHeatmapCalendar({ days, from, to, weekStartsOn, weekdayNames, monthNames, series, label, formatValue, formatDate, tableLabels, legend, emptyLabel, onInspect, loading, loadingLabel, className, ...props }: DSHeatmapCalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import {} from 'react';
|
|
3
|
+
import { DSButton } from '../../button/web/ds-button';
|
|
4
|
+
import { CHART_TABLE_CLASSES as T } from '../../lib/chart-table';
|
|
5
|
+
import { formatChartValue } from '../../lib/chart-value';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
import { ChartFigures, useChartFigures } from '../../lib/web/chart-figures';
|
|
8
|
+
import { heatmapCalendarDayLabel, heatmapCalendarRowWeekdays, heatmapCalendarSpec, heatmapCalendarMonthText, } from '../heatmap-calendar';
|
|
9
|
+
import { DSHeatmap } from './ds-heatmap';
|
|
10
|
+
const HIT_TARGET_PX = 24;
|
|
11
|
+
export function DSHeatmapCalendar({ days, from, to, weekStartsOn = 'monday', weekdayNames, monthNames, series = 1, label, formatValue = formatChartValue, formatDate, tableLabels, legend = true, emptyLabel, onInspect, loading = false, loadingLabel, className, ...props }) {
|
|
12
|
+
const spec = heatmapCalendarSpec({ days, from, to, weekStartsOn });
|
|
13
|
+
const figures = useChartFigures();
|
|
14
|
+
const names = { weekdayNames, monthNames };
|
|
15
|
+
const dayLabel = (date) => heatmapCalendarDayLabel(date, names, spec.spansYears, formatDate);
|
|
16
|
+
const weekdays = loading && spec.empty ? heatmapCalendarRowWeekdays(weekStartsOn) : spec.rowWeekdays;
|
|
17
|
+
const rows = weekdays.map((weekday) => weekdayNames[weekday] ?? '');
|
|
18
|
+
const columns = Array.from({ length: spec.weeks }, (_, week) => {
|
|
19
|
+
const date = spec.dates.map((row) => row[week]).find((d) => d !== null);
|
|
20
|
+
return date === undefined ? '' : dayLabel(date);
|
|
21
|
+
});
|
|
22
|
+
const marks = Array.from({ length: spec.weeks }, () => undefined);
|
|
23
|
+
for (const month of spec.months)
|
|
24
|
+
marks[month.column] = heatmapCalendarMonthText(month, names);
|
|
25
|
+
const dates = spec.dates
|
|
26
|
+
.flatMap((row, r) => row.map((date, week) => (date === null ? undefined : { date, value: spec.values[r]?.[week] ?? null })))
|
|
27
|
+
.filter((d) => d !== undefined)
|
|
28
|
+
.sort((a, b) => (a.date < b.date ? -1 : a.date > b.date ? 1 : 0));
|
|
29
|
+
return (_jsxs("div", { className: cn('flex w-full flex-col gap-2', className), ...props, children: [_jsx(DSHeatmap, { label: label, rows: rows, columns: columns, values: spec.values, blank: spec.blank, series: series, size: "md", minCellWidth: HIT_TARGET_PX, rowHeaderWidth: "narrow", columnMarks: marks, cellLabel: (row, column) => {
|
|
30
|
+
const date = spec.dates[row]?.[column];
|
|
31
|
+
return date === null || date === undefined ? '' : dayLabel(date);
|
|
32
|
+
}, formatValue: formatValue, legend: legend, loading: loading, loadingLabel: loadingLabel, ...(emptyLabel === undefined ? {} : { emptyLabel }), ...(onInspect === undefined ? {} : { onInspect }) }), !loading && !spec.empty && (_jsxs(_Fragment, { children: [_jsx("div", { children: _jsx(DSButton, { variant: "link", quiet: true, labelSize: "sm", ...figures.toggle, children: figures.label }) }), figures.open && (_jsxs(ChartFigures, { figures: figures, caption: label, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: T.columnHead, children: tableLabels.date }), _jsx("th", { scope: "col", className: T.figureHead, children: tableLabels.value })] }) }), _jsx("tbody", { children: dates.map(({ date, value }) => (_jsxs("tr", { className: T.row, children: [_jsx("th", { scope: "row", className: T.rowHead, children: dayLabel(date) }), _jsx("td", { className: T.figure, children: value === null ? tableLabels.noData : formatValue(value) })] }, date))) })] }))] }))] }));
|
|
33
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
2
|
import { type HeatmapCell, type HeatmapContract } from '../heatmap';
|
|
3
|
+
declare const ROW_HEADER: {
|
|
4
|
+
readonly default: "5rem";
|
|
5
|
+
readonly narrow: "3rem";
|
|
6
|
+
};
|
|
3
7
|
export type DSHeatmapProps = Omit<ComponentProps<'div'>, 'role' | 'aria-label' | 'children'> & HeatmapContract & {
|
|
4
8
|
/** What the grid is OF, "Litres by hour, last 4 weeks". Names the grid
|
|
5
9
|
* for a screen reader. */
|
|
@@ -21,6 +25,22 @@ export type DSHeatmapProps = Omit<ComponentProps<'div'>, 'role' | 'aria-label' |
|
|
|
21
25
|
/** Told which cell is being inspected, by pointer or focus and
|
|
22
26
|
* `undefined` when the reader leaves the grid. */
|
|
23
27
|
onInspect?: (cell: HeatmapCell | undefined) => void;
|
|
28
|
+
/** What a cell is called, in the readout and to a screen reader, where
|
|
29
|
+
* "row, column" does not say it: a calendar's cell is a date, not a
|
|
30
|
+
* weekday and a week. Defaults to the row and column names. */
|
|
31
|
+
cellLabel?: (row: number, column: number) => string;
|
|
32
|
+
/** A word written over a column in place of its name, from the column's left
|
|
33
|
+
* edge and running over the empty columns after it: a calendar's month
|
|
34
|
+
* names. A column with no mark writes nothing; every column's own name is
|
|
35
|
+
* still read to a screen reader. Takes the place of `columnLabelEvery`. */
|
|
36
|
+
columnMarks?: readonly (string | undefined)[];
|
|
37
|
+
/** The narrowest a cell may be, in px. Set, the grid keeps that width however
|
|
38
|
+
* many columns there are and scrolls sideways inside its own box, with the
|
|
39
|
+
* row names held at the left; unset, the columns share the width. */
|
|
40
|
+
minCellWidth?: number;
|
|
41
|
+
/** How much room the row names take: `narrow` for short ones like weekdays. */
|
|
42
|
+
rowHeaderWidth?: keyof typeof ROW_HEADER;
|
|
24
43
|
};
|
|
25
44
|
/** A quantity across two categories, drawn as a grid of cells in one hue at five strengths. */
|
|
26
|
-
export declare function DSHeatmap({ rows, columns, values, series, totalsLabel, label, size, columnLabelEvery, rowHeading, legend, formatValue, emptyLabel, onInspect, className, ...props }: DSHeatmapProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function DSHeatmap({ rows, columns, values, series, totalsLabel, label, size, columnLabelEvery, rowHeading, legend, formatValue, emptyLabel, onInspect, blank, cellLabel, columnMarks, minCellWidth, rowHeaderWidth, loading, loadingLabel, className, ...props }: DSHeatmapProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export {};
|