@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
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { CHART_MAX_SERIES, chartSeriesSlot } from '../lib/chart-series';
|
|
2
|
+
import { CHART_GLYPH_PX } from '../lib/chart-ticks';
|
|
3
|
+
export const SCHEDULE_MAX_TICKS = 8;
|
|
4
|
+
export const SCHEDULE_TICK_GAP_PX = 8;
|
|
5
|
+
export const SCHEDULE_LANE_PX = 24;
|
|
6
|
+
export const SCHEDULE_BAR_PX = 20;
|
|
7
|
+
export const SCHEDULE_NOMINAL_PLOT_PX = 640;
|
|
8
|
+
export const SCHEDULE_LABEL_PAD_PX = 16;
|
|
9
|
+
export const SCHEDULE_UNITS = ['hour', 'day', 'week', 'month'];
|
|
10
|
+
const LADDER = [
|
|
11
|
+
{ unit: 'hour', step: 1 },
|
|
12
|
+
{ unit: 'hour', step: 2 },
|
|
13
|
+
{ unit: 'hour', step: 3 },
|
|
14
|
+
{ unit: 'hour', step: 6 },
|
|
15
|
+
{ unit: 'hour', step: 12 },
|
|
16
|
+
{ unit: 'day', step: 1 },
|
|
17
|
+
{ unit: 'day', step: 2 },
|
|
18
|
+
{ unit: 'week', step: 1 },
|
|
19
|
+
{ unit: 'week', step: 2 },
|
|
20
|
+
{ unit: 'month', step: 1 },
|
|
21
|
+
{ unit: 'month', step: 2 },
|
|
22
|
+
{ unit: 'month', step: 3 },
|
|
23
|
+
{ unit: 'month', step: 6 },
|
|
24
|
+
{ unit: 'month', step: 12 },
|
|
25
|
+
];
|
|
26
|
+
const LOOP_CAP = 2_000;
|
|
27
|
+
export const toMs = (time) => (time instanceof Date ? time.getTime() : time);
|
|
28
|
+
function ticksOf(unit, step, start, end) {
|
|
29
|
+
const at = new Date(start);
|
|
30
|
+
if (unit === 'hour') {
|
|
31
|
+
at.setMinutes(0, 0, 0);
|
|
32
|
+
if (at.getTime() < start)
|
|
33
|
+
at.setHours(at.getHours() + 1);
|
|
34
|
+
for (let guard = 0; at.getHours() % step !== 0 && guard < 24; guard += 1)
|
|
35
|
+
at.setHours(at.getHours() + 1);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
at.setHours(0, 0, 0, 0);
|
|
39
|
+
if (unit === 'month') {
|
|
40
|
+
at.setDate(1);
|
|
41
|
+
if (at.getTime() < start)
|
|
42
|
+
at.setMonth(at.getMonth() + 1);
|
|
43
|
+
for (let guard = 0; at.getMonth() % step !== 0 && guard < 12; guard += 1)
|
|
44
|
+
at.setMonth(at.getMonth() + 1);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
if (at.getTime() < start)
|
|
48
|
+
at.setDate(at.getDate() + 1);
|
|
49
|
+
if (unit === 'week') {
|
|
50
|
+
for (let guard = 0; at.getDay() !== 1 && guard < 7; guard += 1)
|
|
51
|
+
at.setDate(at.getDate() + 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const out = [];
|
|
56
|
+
for (let guard = 0; at.getTime() <= end && guard < LOOP_CAP; guard += 1) {
|
|
57
|
+
out.push(at.getTime());
|
|
58
|
+
if (unit === 'hour')
|
|
59
|
+
at.setHours(at.getHours() + step);
|
|
60
|
+
else if (unit === 'day')
|
|
61
|
+
at.setDate(at.getDate() + step);
|
|
62
|
+
else if (unit === 'week')
|
|
63
|
+
at.setDate(at.getDate() + 7 * step);
|
|
64
|
+
else
|
|
65
|
+
at.setMonth(at.getMonth() + step);
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
function ticksFit(found, unit, share, fit) {
|
|
70
|
+
const width = (at) => fit.label(at, unit).length * CHART_GLYPH_PX;
|
|
71
|
+
return found.every((at, i) => {
|
|
72
|
+
const next = found[i + 1];
|
|
73
|
+
if (next === undefined)
|
|
74
|
+
return true;
|
|
75
|
+
const apart = ((share(next) - share(at)) / 100) * fit.plotPx;
|
|
76
|
+
return apart >= (width(at) + width(next)) / 2 + SCHEDULE_TICK_GAP_PX;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export function scheduleTicks(start, end, fit) {
|
|
80
|
+
const span = end - start;
|
|
81
|
+
const share = (at) => (span <= 0 ? 0 : ((at - start) / span) * 100);
|
|
82
|
+
let chosen = LADDER[LADDER.length - 1] ?? { unit: 'month', step: 12 };
|
|
83
|
+
let at = [];
|
|
84
|
+
for (const rung of LADDER) {
|
|
85
|
+
const found = ticksOf(rung.unit, rung.step, start, end);
|
|
86
|
+
if (found.length === 0)
|
|
87
|
+
continue;
|
|
88
|
+
chosen = rung;
|
|
89
|
+
at = found;
|
|
90
|
+
if (found.length <= SCHEDULE_MAX_TICKS && (fit === undefined || ticksFit(found, rung.unit, share, fit)))
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
unit: chosen.unit,
|
|
95
|
+
step: chosen.step,
|
|
96
|
+
ticks: at.map((moment) => ({ at: moment, share: share(moment) })),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export const SCHEDULE_WEEKEND_MAX_DAYS = 62;
|
|
100
|
+
export function scheduleWeekends(start, end) {
|
|
101
|
+
const days = (end - start) / 86_400_000;
|
|
102
|
+
if (days < 2 || days > SCHEDULE_WEEKEND_MAX_DAYS)
|
|
103
|
+
return [];
|
|
104
|
+
const span = end - start;
|
|
105
|
+
const out = [];
|
|
106
|
+
const at = new Date(start);
|
|
107
|
+
at.setHours(0, 0, 0, 0);
|
|
108
|
+
at.setDate(at.getDate() - ((at.getDay() + 1) % 7));
|
|
109
|
+
for (let guard = 0; at.getTime() < end && guard < LOOP_CAP; guard += 1) {
|
|
110
|
+
const from = at.getTime();
|
|
111
|
+
const monday = new Date(at);
|
|
112
|
+
monday.setDate(monday.getDate() + 2);
|
|
113
|
+
const to = monday.getTime();
|
|
114
|
+
if (to > start && from < end) {
|
|
115
|
+
out.push({ from: ((Math.max(from, start) - start) / span) * 100, to: ((Math.min(to, end) - start) / span) * 100 });
|
|
116
|
+
}
|
|
117
|
+
at.setDate(at.getDate() + 7);
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
export function scheduleLabelFits(widthPx, label) {
|
|
122
|
+
if (label.length === 0)
|
|
123
|
+
return false;
|
|
124
|
+
return widthPx >= label.length * CHART_GLYPH_PX + SCHEDULE_LABEL_PAD_PX;
|
|
125
|
+
}
|
|
126
|
+
export function scheduleLanes(spans) {
|
|
127
|
+
const order = spans
|
|
128
|
+
.map((span, i) => ({ ...span, i }))
|
|
129
|
+
.toSorted((a, b) => a.start - b.start || b.end - a.end || a.i - b.i);
|
|
130
|
+
const laneEnds = [];
|
|
131
|
+
const lanes = new Array(spans.length).fill(0);
|
|
132
|
+
for (const span of order) {
|
|
133
|
+
let lane = laneEnds.findIndex((laneEnd) => laneEnd <= span.start);
|
|
134
|
+
if (lane === -1) {
|
|
135
|
+
lane = laneEnds.length;
|
|
136
|
+
laneEnds.push(span.end);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
laneEnds[lane] = span.end;
|
|
140
|
+
}
|
|
141
|
+
lanes[span.i] = lane;
|
|
142
|
+
}
|
|
143
|
+
return { lanes, count: Math.max(1, laneEnds.length) };
|
|
144
|
+
}
|
|
145
|
+
export function scheduleGaps(spans, start, end) {
|
|
146
|
+
const covered = spans
|
|
147
|
+
.filter((span) => span.visible)
|
|
148
|
+
.map((span) => ({ start: Math.max(start, span.start), end: Math.min(end, span.end) }))
|
|
149
|
+
.toSorted((a, b) => a.start - b.start);
|
|
150
|
+
const gaps = [];
|
|
151
|
+
let cursor = start;
|
|
152
|
+
for (const span of covered) {
|
|
153
|
+
if (span.start > cursor)
|
|
154
|
+
gaps.push({ start: cursor, end: span.start });
|
|
155
|
+
cursor = Math.max(cursor, span.end);
|
|
156
|
+
}
|
|
157
|
+
if (cursor < end)
|
|
158
|
+
gaps.push({ start: cursor, end });
|
|
159
|
+
return gaps;
|
|
160
|
+
}
|
|
161
|
+
export function scheduleSpec(contract, options = {}) {
|
|
162
|
+
const start = toMs(contract.range.start);
|
|
163
|
+
const end = toMs(contract.range.end);
|
|
164
|
+
const plotPx = options.plotPx ?? SCHEDULE_NOMINAL_PLOT_PX;
|
|
165
|
+
const valid = Number.isFinite(start) && Number.isFinite(end) && end > start;
|
|
166
|
+
const range = { start, end };
|
|
167
|
+
if (!valid || contract.rows.length === 0) {
|
|
168
|
+
return {
|
|
169
|
+
empty: true,
|
|
170
|
+
range,
|
|
171
|
+
axis: { unit: 'day', step: 1, ticks: [] },
|
|
172
|
+
weekends: [],
|
|
173
|
+
now: undefined,
|
|
174
|
+
kinds: [],
|
|
175
|
+
foldedKinds: [],
|
|
176
|
+
rows: [],
|
|
177
|
+
order: [],
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const axisSpan = end - start;
|
|
181
|
+
const share = (at) => ((at - start) / axisSpan) * 100;
|
|
182
|
+
const seen = scheduleKindOrder(contract);
|
|
183
|
+
const kinds = seen.length > 1
|
|
184
|
+
? seen.slice(0, CHART_MAX_SERIES).flatMap((key, i) => {
|
|
185
|
+
const slot = chartSeriesSlot(i + 1);
|
|
186
|
+
return slot === undefined ? [] : [{ key, slot }];
|
|
187
|
+
})
|
|
188
|
+
: [];
|
|
189
|
+
const foldedKinds = seen.slice(CHART_MAX_SERIES);
|
|
190
|
+
const slotOf = (kind) => kind === undefined ? undefined : kinds.find((k) => k.key === kind)?.slot;
|
|
191
|
+
const rows = contract.rows.map((row) => {
|
|
192
|
+
const usable = row.spans
|
|
193
|
+
.map((span, i) => ({ span, i }))
|
|
194
|
+
.filter(({ span }) => Number.isFinite(toMs(span.start)));
|
|
195
|
+
const base = usable.map(({ span, i }) => {
|
|
196
|
+
const a = toMs(span.start);
|
|
197
|
+
const b = span.end === undefined ? undefined : toMs(span.end);
|
|
198
|
+
const ongoing = b === undefined || !Number.isFinite(b);
|
|
199
|
+
const from = ongoing ? a : Math.min(a, b);
|
|
200
|
+
const to = ongoing ? Math.max(end, a) : Math.max(a, b);
|
|
201
|
+
return { span, i, start: from, end: to, ongoing };
|
|
202
|
+
});
|
|
203
|
+
const visibleOf = (s) => s.start < end && (s.end > start || (s.end === s.start && s.start >= start));
|
|
204
|
+
const drawn = base.filter(visibleOf);
|
|
205
|
+
const packed = scheduleLanes(drawn);
|
|
206
|
+
const placed = base.map((s) => {
|
|
207
|
+
const visible = visibleOf(s);
|
|
208
|
+
const at = drawn.indexOf(s);
|
|
209
|
+
const from = visible ? Math.max(0, share(s.start)) : 0;
|
|
210
|
+
const to = visible ? Math.min(100, share(s.end)) : 0;
|
|
211
|
+
const width = Math.max(0, to - from);
|
|
212
|
+
return {
|
|
213
|
+
key: s.span.key ?? `${row.key}-${String(s.i)}`,
|
|
214
|
+
rowKey: row.key,
|
|
215
|
+
label: s.span.label,
|
|
216
|
+
kind: s.span.kind,
|
|
217
|
+
slot: slotOf(s.span.kind),
|
|
218
|
+
folded: s.span.kind !== undefined && foldedKinds.includes(s.span.kind),
|
|
219
|
+
start: s.start,
|
|
220
|
+
end: s.ongoing ? end : s.end,
|
|
221
|
+
ongoing: s.ongoing,
|
|
222
|
+
visible,
|
|
223
|
+
from,
|
|
224
|
+
width,
|
|
225
|
+
clippedStart: s.start < start,
|
|
226
|
+
clippedEnd: s.ongoing ? false : s.end > end,
|
|
227
|
+
lane: at === -1 ? 0 : (packed.lanes[at] ?? 0),
|
|
228
|
+
labelled: visible && scheduleLabelFits((width / 100) * plotPx, s.span.label),
|
|
229
|
+
index: -1,
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
const byStart = placed.toSorted((a, b) => a.start - b.start || a.end - b.end);
|
|
233
|
+
const gaps = scheduleGaps(placed, start, end);
|
|
234
|
+
const lines = [
|
|
235
|
+
...byStart.map((span) => ({ type: 'span', span })),
|
|
236
|
+
...gaps.map((gap) => ({ type: 'gap', gap })),
|
|
237
|
+
].toSorted((a, b) => {
|
|
238
|
+
const at = (line) => (line.type === 'span' ? line.span.start : line.gap.start);
|
|
239
|
+
return at(a) - at(b);
|
|
240
|
+
});
|
|
241
|
+
return {
|
|
242
|
+
key: row.key,
|
|
243
|
+
label: row.label,
|
|
244
|
+
sublabel: row.sublabel,
|
|
245
|
+
spans: byStart,
|
|
246
|
+
laneCount: packed.count,
|
|
247
|
+
gaps,
|
|
248
|
+
lines,
|
|
249
|
+
};
|
|
250
|
+
});
|
|
251
|
+
const order = rows.flatMap((row) => row.spans.filter((span) => span.visible));
|
|
252
|
+
order.forEach((span, i) => {
|
|
253
|
+
span.index = i;
|
|
254
|
+
});
|
|
255
|
+
const nowAt = contract.now === undefined ? undefined : toMs(contract.now.at);
|
|
256
|
+
return {
|
|
257
|
+
empty: false,
|
|
258
|
+
range,
|
|
259
|
+
axis: scheduleTicks(start, end, options.tickLabel === undefined ? undefined : { plotPx, label: options.tickLabel }),
|
|
260
|
+
weekends: scheduleWeekends(start, end),
|
|
261
|
+
now: nowAt !== undefined && Number.isFinite(nowAt) && nowAt >= start && nowAt <= end ? share(nowAt) : undefined,
|
|
262
|
+
kinds,
|
|
263
|
+
foldedKinds,
|
|
264
|
+
rows,
|
|
265
|
+
order,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function scheduleKindOrder(contract) {
|
|
269
|
+
const seen = [...(contract.kinds ?? [])];
|
|
270
|
+
for (const row of contract.rows) {
|
|
271
|
+
for (const span of row.spans) {
|
|
272
|
+
if (span.kind !== undefined && !seen.includes(span.kind))
|
|
273
|
+
seen.push(span.kind);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return seen;
|
|
277
|
+
}
|
|
278
|
+
export function scheduleChartIssues(contract) {
|
|
279
|
+
const issues = [];
|
|
280
|
+
const count = scheduleKindOrder(contract).length;
|
|
281
|
+
if (count > CHART_MAX_SERIES && (contract.otherKindsLabel ?? '').trim() === '') {
|
|
282
|
+
issues.push(`${String(count)} kinds given and six take a colour. The rest are drawn quiet together and need otherKindsLabel to name them.`);
|
|
283
|
+
}
|
|
284
|
+
return issues;
|
|
285
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { type ScheduleChartContract, type ScheduleUnit } from '../schedule-chart';
|
|
3
|
+
export type DSScheduleChartProps = Omit<ComponentProps<'figure'>, 'children' | 'aria-labelledby' | 'aria-describedby' | 'aria-busy'> & ScheduleChartContract & {
|
|
4
|
+
/** The words on an axis tick: "Mon 26", "08:00". Told the unit the axis chose, so a day tick and an hour tick can read differently. Required, this package owns no locale. */
|
|
5
|
+
formatTick: (date: Date, unit: ScheduleUnit) => string;
|
|
6
|
+
/** A moment in the readout and the table: "Mon 08:00". */
|
|
7
|
+
formatTime: (date: Date) => string;
|
|
8
|
+
/** A closed span in a sentence, from the two moments already written: (a, b) => `${a} to ${b}`. */
|
|
9
|
+
rangeLabel: (from: string, to: string) => string;
|
|
10
|
+
/** What a span with no end says in place of one: "still running". */
|
|
11
|
+
ongoingLabel: string;
|
|
12
|
+
/** The table's column words, and the name of the key to the kinds. */
|
|
13
|
+
tableLabels: {
|
|
14
|
+
row: string;
|
|
15
|
+
span: string;
|
|
16
|
+
start: string;
|
|
17
|
+
end: string;
|
|
18
|
+
kind: string;
|
|
19
|
+
};
|
|
20
|
+
/** One spoken sentence about what the chart shows, read after its name. */
|
|
21
|
+
summary?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** Bars along a time axis, one row per thing, one lane per overlap, with the same figures as a table. */
|
|
24
|
+
export declare function DSScheduleChart({ label, rows, range, kinds, otherKindsLabel, now, unassignedLabel, emptyLabel, loading, loadingLabel, labelHidden, formatTick, formatTime, rangeLabel, ongoingLabel, tableLabels, summary, className, ...props }: DSScheduleChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useState } from 'react';
|
|
3
|
+
import { DSButton } from '../../button/web/ds-button';
|
|
4
|
+
import { DSEmptyState } from '../../empty-state/web/ds-empty-state';
|
|
5
|
+
import { DSLegend } from '../../legend/web/ds-legend';
|
|
6
|
+
import { CHART_CONTEXT_TRACK } from '../../lib/chart-context';
|
|
7
|
+
import { CHART_SERIES_BORDER, CHART_QUIET } from '../../lib/chart-series';
|
|
8
|
+
import { CHART_TABLE_CLASSES as T } from '../../lib/chart-table';
|
|
9
|
+
import { cn } from '../../lib/cn';
|
|
10
|
+
import { ChartFigures, useChartFigures } from '../../lib/web/chart-figures';
|
|
11
|
+
import { useChartPoints } from '../../lib/web/use-chart-points';
|
|
12
|
+
import { SpokenRegion } from '../../lib/web/spoken-region';
|
|
13
|
+
import { LOADING_ROWS, loadingSpoken } from '../../skeleton/skeleton';
|
|
14
|
+
import { DSSkeleton } from '../../skeleton/web/ds-skeleton';
|
|
15
|
+
import { DSText } from '../../text/web/ds-text';
|
|
16
|
+
import { SCHEDULE_BAR_PX, SCHEDULE_LANE_PX, SCHEDULE_NOMINAL_PLOT_PX, scheduleChartIssues, scheduleSpec, } from '../schedule-chart';
|
|
17
|
+
const WASH = {
|
|
18
|
+
1: 'bg-chart-series-1/25',
|
|
19
|
+
2: 'bg-chart-series-2/25',
|
|
20
|
+
3: 'bg-chart-series-3/25',
|
|
21
|
+
4: 'bg-chart-series-4/25',
|
|
22
|
+
5: 'bg-chart-series-5/25',
|
|
23
|
+
6: 'bg-chart-series-6/25',
|
|
24
|
+
};
|
|
25
|
+
const WASH_HOT = {
|
|
26
|
+
1: 'bg-chart-series-1/50',
|
|
27
|
+
2: 'bg-chart-series-2/50',
|
|
28
|
+
3: 'bg-chart-series-3/50',
|
|
29
|
+
4: 'bg-chart-series-4/50',
|
|
30
|
+
5: 'bg-chart-series-5/50',
|
|
31
|
+
6: 'bg-chart-series-6/50',
|
|
32
|
+
};
|
|
33
|
+
const QUIET_WASH = 'bg-chart-quiet/25';
|
|
34
|
+
const QUIET_WASH_HOT = 'bg-chart-quiet/50';
|
|
35
|
+
const POINT = {
|
|
36
|
+
clipPath: 'polygon(0 0, calc(100% - var(--spacing) * 2) 0, 100% 50%, calc(100% - var(--spacing) * 2) 100%, 0 100%)',
|
|
37
|
+
};
|
|
38
|
+
const LABEL_COLUMN = 'minmax(6rem, 12rem)';
|
|
39
|
+
const ROW_PAD_PX = 4;
|
|
40
|
+
const rowHeight = (lanes) => lanes * SCHEDULE_LANE_PX + ROW_PAD_PX * 2;
|
|
41
|
+
function tickPlace(share) {
|
|
42
|
+
if (share < 3)
|
|
43
|
+
return '';
|
|
44
|
+
if (share > 97)
|
|
45
|
+
return '-translate-x-full';
|
|
46
|
+
return '-translate-x-1/2';
|
|
47
|
+
}
|
|
48
|
+
const SKELETON_SPANS = ['left-0 w-1/2', 'left-1/4 w-1/2', 'left-1/2 w-1/3'];
|
|
49
|
+
function ScheduleSkeleton() {
|
|
50
|
+
return (_jsxs("div", { "aria-busy": true, className: "flex flex-col gap-3", "data-chart-loading": "", children: [_jsx("div", { className: "min-h-5" }), _jsxs("div", { className: "grid gap-x-2", style: { gridTemplateColumns: `${LABEL_COLUMN} minmax(0, 1fr)` }, children: [_jsx("span", {}), _jsx("div", { className: "flex h-5 justify-between", children: Array.from({ length: 5 }, (_, i) => (_jsx(DSSkeleton, { fits: "label-sm", className: "w-10" }, i))) }), _jsx("div", { className: "flex flex-col", children: Array.from({ length: LOADING_ROWS }, (_, i) => (_jsx("div", { className: "border-border-subtle flex flex-col justify-center border-t pe-2", style: { height: rowHeight(1) }, children: _jsx(DSSkeleton, { fits: "body-sm", className: "w-3/4" }) }, i))) }), _jsx("div", { className: "flex flex-col", children: Array.from({ length: LOADING_ROWS }, (_, i) => (_jsx("div", { className: "border-border-subtle relative border-t", style: { height: rowHeight(1) }, children: _jsx(DSSkeleton, { className: cn('absolute h-(--bar-h) rounded-xs', SKELETON_SPANS[i % SKELETON_SPANS.length]), style: {
|
|
51
|
+
top: ROW_PAD_PX + (SCHEDULE_LANE_PX - SCHEDULE_BAR_PX) / 2,
|
|
52
|
+
'--bar-h': `${String(SCHEDULE_BAR_PX)}px`,
|
|
53
|
+
} }) }, i))) })] })] }));
|
|
54
|
+
}
|
|
55
|
+
export function DSScheduleChart({ label, rows, range, kinds, otherKindsLabel, now, unassignedLabel, emptyLabel, loading = false, loadingLabel, labelHidden = false, formatTick, formatTime, rangeLabel, ongoingLabel, tableLabels, summary, className, ...props }) {
|
|
56
|
+
const [plotPx, setPlotPx] = useState(SCHEDULE_NOMINAL_PLOT_PX);
|
|
57
|
+
const spec = scheduleSpec({ rows, range, kinds, now }, { plotPx, tickLabel: (at, unit) => formatTick(new Date(at), unit) });
|
|
58
|
+
if (process.env['NODE_ENV'] !== 'production') {
|
|
59
|
+
for (const issue of scheduleChartIssues({ rows, kinds, otherKindsLabel })) {
|
|
60
|
+
console.error(`DSScheduleChart: ${issue}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const otherWord = (otherKindsLabel ?? '').trim() === '' ? undefined : otherKindsLabel;
|
|
64
|
+
const keyItems = [
|
|
65
|
+
...spec.kinds.map((kind) => ({ key: kind.key, label: kind.key, series: kind.slot })),
|
|
66
|
+
...(spec.foldedKinds.length === 0
|
|
67
|
+
? []
|
|
68
|
+
: otherWord !== undefined
|
|
69
|
+
? [{ key: `other-kinds:${otherWord}`, label: otherWord, quiet: true }]
|
|
70
|
+
: spec.foldedKinds.map((kind) => ({ key: kind, label: kind, quiet: true }))),
|
|
71
|
+
];
|
|
72
|
+
const captionId = useId();
|
|
73
|
+
const summaryId = useId();
|
|
74
|
+
const figures = useChartFigures();
|
|
75
|
+
const roving = useChartPoints(spec.order.length);
|
|
76
|
+
const plotRef = roving.group.ref;
|
|
77
|
+
const inspected = roving.inspected === undefined ? undefined : spec.order[roving.inspected];
|
|
78
|
+
const drawn = !loading && !spec.empty;
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const element = plotRef.current;
|
|
81
|
+
if (!drawn || element === null)
|
|
82
|
+
return undefined;
|
|
83
|
+
const read = () => {
|
|
84
|
+
const width = Math.floor(element.getBoundingClientRect().width);
|
|
85
|
+
if (width > 0)
|
|
86
|
+
setPlotPx((was) => (was === width ? was : width));
|
|
87
|
+
};
|
|
88
|
+
read();
|
|
89
|
+
if (typeof ResizeObserver === 'undefined')
|
|
90
|
+
return undefined;
|
|
91
|
+
const observer = new ResizeObserver(read);
|
|
92
|
+
observer.observe(element);
|
|
93
|
+
return () => {
|
|
94
|
+
observer.disconnect();
|
|
95
|
+
};
|
|
96
|
+
}, [plotRef, drawn]);
|
|
97
|
+
const rowLabelOf = (span) => spec.rows.find((row) => row.key === span.rowKey)?.label ?? '';
|
|
98
|
+
const when = (span) => span.ongoing
|
|
99
|
+
? `${formatTime(new Date(span.start))}, ${ongoingLabel}`
|
|
100
|
+
: rangeLabel(formatTime(new Date(span.start)), formatTime(new Date(span.end)));
|
|
101
|
+
const parts = (span) => [
|
|
102
|
+
span.label,
|
|
103
|
+
rowLabelOf(span),
|
|
104
|
+
when(span),
|
|
105
|
+
...(spec.kinds.length > 0 && span.kind !== undefined && span.kind !== span.label ? [span.kind] : []),
|
|
106
|
+
];
|
|
107
|
+
const reading = (span) => parts(span).join(', ');
|
|
108
|
+
const fillOf = (span) => {
|
|
109
|
+
const hot = inspected === span;
|
|
110
|
+
return span.slot === undefined
|
|
111
|
+
? { wash: hot ? QUIET_WASH_HOT : QUIET_WASH, edge: CHART_QUIET.border }
|
|
112
|
+
: { wash: hot ? WASH_HOT[span.slot] : WASH[span.slot], edge: CHART_SERIES_BORDER[span.slot] };
|
|
113
|
+
};
|
|
114
|
+
return (_jsxs("figure", { "aria-labelledby": captionId, "aria-describedby": summary === undefined ? undefined : summaryId, "data-forced-colors": "chart", className: cn('m-0 flex min-w-0 flex-col gap-3', className), ...props, children: [_jsx("figcaption", { id: captionId, className: labelHidden ? 'sr-only' : undefined, children: _jsx(DSText, { as: "span", variant: "body-sm-strong", children: label }) }), summary !== undefined && (_jsx("span", { id: summaryId, className: "sr-only", children: summary })), _jsx(SpokenRegion, { text: loadingSpoken(loading, loadingLabel) }), loading ? (_jsx(ScheduleSkeleton, {})) : spec.empty ? (_jsx(DSEmptyState, { description: emptyLabel, className: "flex h-48 flex-col items-center justify-center" })) : (_jsxs(_Fragment, { children: [spec.kinds.length > 0 && (_jsx(DSLegend, { label: tableLabels.kind, items: keyItems, "data-schedule-key": "" })), _jsx("div", { "aria-hidden": true, className: "flex min-h-5 flex-wrap items-baseline gap-x-2", "data-schedule-readout": "", children: inspected !== undefined && (_jsxs(_Fragment, { children: [_jsx(DSText, { as: "span", variant: "label-sm", className: "text-foreground", children: inspected.label }), _jsx(DSText, { as: "span", variant: "body-xs", className: "text-muted-foreground", children: parts(inspected).slice(1).join(', ') })] })) }), _jsxs("div", { className: "grid gap-x-2", style: { gridTemplateColumns: `${LABEL_COLUMN} minmax(0, 1fr)` }, children: [_jsx("span", { "aria-hidden": true }), _jsxs("div", { "aria-hidden": true, className: "relative tabular-nums", "data-schedule-axis": spec.axis.unit, children: [spec.now !== undefined && now !== undefined && (_jsx("div", { className: "relative h-5", children: _jsx(DSText, { as: "span", variant: "label-sm", className: cn('text-foreground absolute whitespace-nowrap font-semibold', tickPlace(spec.now)), style: { left: `${String(spec.now)}%` }, children: now.label }) })), _jsx("div", { className: "relative h-5", children: spec.axis.ticks.map((tick) => (_jsx(DSText, { as: "span", variant: "label-sm", className: cn('text-muted-foreground absolute whitespace-nowrap', tickPlace(tick.share)), style: { left: `${String(tick.share)}%` }, children: formatTick(new Date(tick.at), spec.axis.unit) }, tick.at))) })] }), _jsx("div", { "aria-hidden": true, className: "flex flex-col", "data-schedule-names": "", children: spec.rows.map((row) => (_jsxs("div", { className: "border-border-subtle flex min-w-0 flex-col justify-center border-t pe-2", style: { height: rowHeight(row.laneCount) }, title: row.sublabel === undefined ? row.label : `${row.label}, ${row.sublabel}`, children: [_jsx(DSText, { as: "span", variant: "body-sm", className: "text-card-foreground truncate", children: row.label }), row.sublabel !== undefined && (_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground truncate", children: row.sublabel }))] }, row.key))) }), _jsxs("div", { role: "group", "aria-label": label, className: "relative", "data-schedule-plot": "", ...roving.group, children: [_jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0", children: [spec.weekends.map((weekend) => (_jsx("span", { "data-schedule-weekend": "", className: "absolute inset-y-0", style: {
|
|
115
|
+
left: `${String(weekend.from)}%`,
|
|
116
|
+
width: `${String(weekend.to - weekend.from)}%`,
|
|
117
|
+
background: CHART_CONTEXT_TRACK,
|
|
118
|
+
} }, weekend.from))), spec.axis.ticks.map((tick) => (_jsx("span", { "data-chart-ink": "grid", className: cn('bg-border-subtle absolute inset-y-0 w-px', tick.share >= 100 && '-translate-x-px'), style: { left: `${String(tick.share)}%` } }, tick.at))), spec.now !== undefined && (_jsx("span", { "data-schedule-now": "", className: "bg-border-subtle absolute inset-y-0 w-0.5 -translate-x-1/2", style: { left: `${String(spec.now)}%` } }))] }), spec.rows.map((row) => (_jsx("div", { className: "border-border-subtle relative border-t", style: { height: rowHeight(row.laneCount) }, "data-schedule-row": row.key, "data-schedule-lanes": row.laneCount, children: row.spans
|
|
119
|
+
.filter((span) => span.visible)
|
|
120
|
+
.map((span) => {
|
|
121
|
+
const fill = fillOf(span);
|
|
122
|
+
return (_jsx("div", { role: "img", "aria-label": reading(span), ...roving.point(span.index), "data-schedule-span": span.key, "data-schedule-lane": span.lane, "data-schedule-ongoing": span.ongoing ? '' : undefined, className: "focusable absolute rounded-xs focus-visible:-outline-offset-2", style: {
|
|
123
|
+
left: `${String(span.from)}%`,
|
|
124
|
+
width: `${String(span.width)}%`,
|
|
125
|
+
minWidth: 'var(--spacing)',
|
|
126
|
+
top: ROW_PAD_PX + span.lane * SCHEDULE_LANE_PX + (SCHEDULE_LANE_PX - SCHEDULE_BAR_PX) / 2,
|
|
127
|
+
height: SCHEDULE_BAR_PX,
|
|
128
|
+
}, children: _jsx("div", { "aria-hidden": true, "data-schedule-bar": span.slot ?? 'quiet', "data-forced-colors": "mark", className: cn('absolute inset-y-0 inset-x-px flex items-center overflow-hidden rounded-xs border', fill.wash, fill.edge, span.clippedStart && 'rounded-l-none', (span.clippedEnd || span.ongoing) && 'rounded-r-none'), style: span.ongoing ? POINT : undefined, children: span.labelled && (_jsx(DSText, { as: "span", variant: "label-sm", className: "text-card-foreground ps-2 pe-1 font-semibold whitespace-nowrap", "data-schedule-label": "", children: span.label })) }) }, span.key));
|
|
129
|
+
}) }, row.key)))] })] }), _jsx("div", { children: _jsx(DSButton, { variant: "link", quiet: true, labelSize: "sm", ...figures.toggle, children: figures.label }) }), _jsxs(ChartFigures, { figures: figures, caption: label, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: T.columnHead, children: tableLabels.row }), _jsx("th", { scope: "col", className: T.columnHead, children: tableLabels.span }), _jsx("th", { scope: "col", className: T.noteHead, children: tableLabels.start }), _jsx("th", { scope: "col", className: T.noteHead, children: tableLabels.end }), _jsx("th", { scope: "col", className: T.noteHead, children: tableLabels.kind })] }) }), _jsx("tbody", { children: spec.rows.flatMap((row) => {
|
|
130
|
+
const lines = row.lines.filter((line) => line.type === 'span' || unassignedLabel !== undefined);
|
|
131
|
+
if (lines.length === 0) {
|
|
132
|
+
return [
|
|
133
|
+
_jsxs("tr", { className: T.row, "data-schedule-line": "none", children: [_jsx("th", { scope: "row", className: T.rowHead, children: row.label }), _jsx("td", { className: T.note, colSpan: 4 })] }, row.key),
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
return lines.map((line) => {
|
|
137
|
+
const span = line.type === 'span' ? line.span : undefined;
|
|
138
|
+
const start = line.type === 'span' ? line.span.start : line.gap.start;
|
|
139
|
+
const end = line.type === 'span' ? line.span.end : line.gap.end;
|
|
140
|
+
return (_jsxs("tr", { className: T.row, "data-schedule-line": span === undefined ? 'gap' : 'span', children: [_jsx("th", { scope: "row", className: T.rowHead, children: row.label }), _jsx("td", { className: cn(T.rowHead, span === undefined && 'text-muted-foreground'), children: span === undefined ? unassignedLabel : span.label }), _jsx("td", { className: T.note, children: formatTime(new Date(start)) }), _jsx("td", { className: T.note, children: span?.ongoing === true ? ongoingLabel : formatTime(new Date(end)) }), _jsxs("td", { className: T.note, children: [span?.kind ?? '', span?.folded === true && otherWord !== undefined && (_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground block", "data-schedule-folded": "", children: otherWord }))] })] }, `${row.key}-${span?.key ?? `gap-${String(start)}`}`));
|
|
141
|
+
});
|
|
142
|
+
}) })] })] }))] }));
|
|
143
|
+
}
|
|
@@ -16,4 +16,4 @@ export type DSSegmentedControlProps<T extends string> = Omit<ViewProps, 'childre
|
|
|
16
16
|
'aria-label': string;
|
|
17
17
|
};
|
|
18
18
|
/** A pick-one track for a small, fixed set of alternatives. */
|
|
19
|
-
export declare function DSSegmentedControl<T extends string>({ segments, value, onValueChange, disabled, block, 'aria-label': label, className, ...props }: DSSegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function DSSegmentedControl<T extends string>({ segments, value, onValueChange, disabled, block, size: _size, 'aria-label': label, className, ...props }: DSSegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,7 +21,7 @@ const INK = {
|
|
|
21
21
|
const WEIGHT = { chosen: 'text-label-md', resting: 'text-body-sm' };
|
|
22
22
|
const IOS_PRESS = ({ pressed }) => pressed && Platform.OS === 'ios' ? { transform: [{ scale: PRESS_SCALES.firm }] } : null;
|
|
23
23
|
const NATIVE_DRIVER = Platform.OS !== 'web';
|
|
24
|
-
export function DSSegmentedControl({ segments, value, onValueChange, disabled = false, block = false, 'aria-label': label, className, ...props }) {
|
|
24
|
+
export function DSSegmentedControl({ segments, value, onValueChange, disabled = false, block = false, size: _size, 'aria-label': label, className, ...props }) {
|
|
25
25
|
const epoch = useThemeEpoch();
|
|
26
26
|
const reduced = useReducedMotion();
|
|
27
27
|
const track = segmentedTrackSpec();
|
|
@@ -80,4 +80,11 @@ export interface SegmentedControlContract {
|
|
|
80
80
|
* The same word `ButtonModifiers.block` already uses, for the same thing.
|
|
81
81
|
*/
|
|
82
82
|
block?: Forwarded<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* The control's height. `md` (the default) gives every option the touch floor. `sm` stands the
|
|
85
|
+
* whole track at the 42px a field and the controls in a table's bar stand at, with a mouse; under
|
|
86
|
+
* a finger the options keep the touch floor. The phone always draws the touch floor, so `sm`
|
|
87
|
+
* changes nothing there.
|
|
88
|
+
*/
|
|
89
|
+
size?: Forwarded<'md' | 'sm'>;
|
|
83
90
|
}
|
|
@@ -11,4 +11,4 @@ export type DSSegmentedControlProps<T extends string> = Omit<ComponentProps<'div
|
|
|
11
11
|
'aria-label': string;
|
|
12
12
|
};
|
|
13
13
|
/** A pick-one track for a small, fixed set of alternatives. */
|
|
14
|
-
export declare function DSSegmentedControl<T extends string>({ segments, value, onValueChange, disabled, block, className, ...props }: DSSegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function DSSegmentedControl<T extends string>({ segments, value, onValueChange, disabled, block, size, className, ...props }: DSSegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,8 +23,9 @@ const MOVES = {
|
|
|
23
23
|
Home: 'first',
|
|
24
24
|
End: 'last',
|
|
25
25
|
};
|
|
26
|
-
export function DSSegmentedControl({ segments, value, onValueChange, disabled = false, block = false, className, ...props }) {
|
|
26
|
+
export function DSSegmentedControl({ segments, value, onValueChange, disabled = false, block = false, size = 'md', className, ...props }) {
|
|
27
27
|
const track = segmentedTrackSpec();
|
|
28
|
+
const small = size === 'sm';
|
|
28
29
|
const refs = useRef([]);
|
|
29
30
|
const selectedIndex = segments.findIndex((segment) => segment.value === value);
|
|
30
31
|
function onKeyDown(event) {
|
|
@@ -40,7 +41,7 @@ export function DSSegmentedControl({ segments, value, onValueChange, disabled =
|
|
|
40
41
|
refs.current[next]?.focus();
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
return (_jsx("div", { role: "radiogroup", onKeyDown: onKeyDown, className: cn('gap-1 rounded-control p-px', 'segmented-track', block ? 'flex w-full' : 'inline-flex', disabled ? DISABLED_TRACK_EDGE : TRACK_EDGE[track.edge], className), ...props, children: segments.map((segment, index) => {
|
|
44
|
+
return (_jsx("div", { role: "radiogroup", onKeyDown: onKeyDown, className: cn('gap-1 rounded-control p-px', 'segmented-track', block ? 'flex w-full' : 'inline-flex', small && 'min-h-10.5', disabled ? DISABLED_TRACK_EDGE : TRACK_EDGE[track.edge], className), ...props, children: segments.map((segment, index) => {
|
|
44
45
|
const selected = segment.value === value;
|
|
45
46
|
const spec = segmentSpec(selected);
|
|
46
47
|
const name = segmentName(segment);
|
|
@@ -49,6 +50,6 @@ export function DSSegmentedControl({ segments, value, onValueChange, disabled =
|
|
|
49
50
|
}, type: "button", role: "radio", "aria-checked": selected, disabled: disabled, ...(segment.label === undefined && name !== null ? { 'aria-label': name } : {}), tabIndex: selected || (selectedIndex < 0 && index === 0) ? 0 : -1, onClick: () => {
|
|
50
51
|
if (!selected)
|
|
51
52
|
onValueChange(segment.value);
|
|
52
|
-
}, className: cn('focusable inline-flex min-
|
|
53
|
+
}, className: cn('focusable inline-flex min-w-touch items-center justify-center gap-2 rounded-control px-3 compact:min-h-dense-pick compact:min-w-8', small ? 'min-h-0 pointer-coarse:min-h-touch' : 'min-h-touch', 'segmented-option', 'cursor-pointer transition-control state-layer-press', 'disabled:cursor-not-allowed', block && 'min-w-0 flex-1', disabled ? DISABLED_INK : INK[spec.ink], WEIGHT[spec.emphasised ? 'chosen' : 'resting'], spec.fill === undefined ? undefined : disabled ? DISABLED_CHOSEN : FILL[spec.fill], spec.hoverTint === undefined ? undefined : HOVER_TINT[spec.hoverTint]), children: [segment.icon, segment.label] }, segment.value));
|
|
53
54
|
}) }));
|
|
54
55
|
}
|
|
@@ -50,7 +50,7 @@ const DISABLED = 'border-disabled-border bg-disabled';
|
|
|
50
50
|
const DISABLED_INK = 'text-disabled-foreground';
|
|
51
51
|
const TRIGGER_BORDER = {
|
|
52
52
|
input: 'border-input',
|
|
53
|
-
|
|
53
|
+
error: 'border-error',
|
|
54
54
|
};
|
|
55
55
|
const PLACEHOLDER_INK = {
|
|
56
56
|
'placeholder-foreground': 'text-muted-foreground',
|
|
@@ -112,16 +112,19 @@ export function DSSelect({ options, value, invalid = false, size = 'md', disable
|
|
|
112
112
|
? PLACEHOLDER_INK[field.placeholder]
|
|
113
113
|
: TRIGGER_INK[field.label]), children: chosen?.label ?? placeholder }), _jsx(CaretIcon, { size: 18, "aria-hidden": true, className: isDisabled ? DISABLED_INK : CARET_INK[spec.caretInk] })] }, epoch), _jsx(DSSheet, { open: open, title: label, closeLabel: closeLabel, onRequestClose: close, children: _jsxs(View, { className: "gap-1", children: [searchable && (_jsx(View, { className: "pb-2", children: _jsx(DSInput, { testID: "select-search", value: query, accessibilityLabel: searchLabel, placeholder: searchPlaceholder, onValueChange: setQuery, keyboardType: "default", autoCorrect: false }) })), visible.length === 0 ? (_jsx(DSText, { variant: "body-sm", testID: "select-none", className: cn('p-3', NONE_INK[spec.noneInk]), children: emptyLabel })) : (groups.map((entry, groupIndex) => (_jsxs(View, { children: [entry.group !== undefined && (_jsx(DSText, { variant: "caps", testID: "select-group", accessibilityRole: "header", className: cn('mb-1 mt-3 px-3 uppercase', GROUP_INK[spec.groupInk]), children: entry.group })), entry.options.map((option) => {
|
|
114
114
|
const selected = option.value === value;
|
|
115
|
+
const unavailable = option.disabled === true;
|
|
115
116
|
const labels = option.labels ?? [];
|
|
116
117
|
const dots = labelOverflow(labels, 3);
|
|
117
118
|
const withHint = option.hint === undefined ? option.label : `${option.label}, ${option.hint}`;
|
|
118
119
|
const name = labels.length === 0
|
|
119
120
|
? withHint
|
|
120
121
|
: `${withHint}, ${labelGroupSummary(labels.map(labelText), 0)}`;
|
|
121
|
-
return (_jsxs(Pressable, { testID: "select-option", accessibilityRole: "button", accessibilityLabel: name, accessibilityState: { selected }, onPress: () => {
|
|
122
|
+
return (_jsxs(Pressable, { testID: "select-option", accessibilityRole: "button", accessibilityLabel: name, accessibilityState: { selected, disabled: unavailable }, "aria-disabled": unavailable, disabled: unavailable, onPress: () => {
|
|
123
|
+
if (unavailable)
|
|
124
|
+
return;
|
|
122
125
|
pick(option.value);
|
|
123
126
|
}, style: ({ pressed: down }) => down && Platform.OS === 'ios'
|
|
124
127
|
? { transform: [{ scale: PRESS_SCALES.subtle }] }
|
|
125
|
-
: null, className: cn('min-h-12 flex-row items-center gap-2 rounded-card-sm px-3 py-2 android:ripple-border', selected && SELECTED_SURFACE[spec.optionActiveSurface]), children: [_jsx(View, { "aria-hidden": true, className: "w-4", children: selected && _jsx(TickIcon, { size: 16, className: TICK_INK[spec.tickInk] }) }), option.labelColour !== undefined && (_jsx(DSLabelDot, { colour: option.labelColour, size: "md" })), option.hint === undefined ? (_jsx(DSText, { variant: "body-md", className: cn('flex-1', OPTION_INK[spec.optionInk], selected && 'font-semibold'), children: option.label })) : (_jsxs(View, { className: "flex-1", children: [_jsx(DSText, { variant: "body-md", className: cn('', OPTION_INK[spec.optionInk], selected && 'font-semibold'), children: option.label }), _jsx(DSText, { variant: "body-sm", testID: "select-hint", className: cn(NONE_INK[spec.noneInk]), children: option.hint })] })), dots.shown.length > 0 && (_jsxs(View, { "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", className: "flex-row items-center gap-1", children: [dots.shown.map((label) => (_jsx(DSLabelDot, { colour: label.colour, size: "sm" }, label.id))), dots.hidden.length > 0 && (_jsx(DSText, { variant: "label-sm", className: "text-muted-foreground", children: labelGroupMoreText(dots.hidden.length) }))] }))] }, `${option.value}-${epoch}`));
|
|
128
|
+
: null, className: cn('min-h-12 flex-row items-center gap-2 rounded-card-sm px-3 py-2 android:ripple-border', selected && SELECTED_SURFACE[spec.optionActiveSurface]), children: [_jsx(View, { "aria-hidden": true, className: "w-4", children: selected && _jsx(TickIcon, { size: 16, className: TICK_INK[spec.tickInk] }) }), option.labelColour !== undefined && (_jsx(DSLabelDot, { colour: option.labelColour, size: "md" })), option.hint === undefined ? (_jsx(DSText, { variant: "body-md", className: cn('flex-1', unavailable ? DISABLED_INK : OPTION_INK[spec.optionInk], selected && 'font-semibold'), children: option.label })) : (_jsxs(View, { className: "flex-1", children: [_jsx(DSText, { variant: "body-md", className: cn('', unavailable ? DISABLED_INK : OPTION_INK[spec.optionInk], selected && 'font-semibold'), children: option.label }), _jsx(DSText, { variant: "body-sm", testID: "select-hint", className: cn(NONE_INK[spec.noneInk]), children: option.hint })] })), dots.shown.length > 0 && (_jsxs(View, { "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", className: "flex-row items-center gap-1", children: [dots.shown.map((label) => (_jsx(DSLabelDot, { colour: label.colour, size: "sm" }, label.id))), dots.hidden.length > 0 && (_jsx(DSText, { variant: "label-sm", className: "text-muted-foreground", children: labelGroupMoreText(dots.hidden.length) }))] }))] }, `${option.value}-${epoch}`));
|
|
126
129
|
})] }, entry.group ?? `ungrouped-${String(groupIndex)}`))))] }) })] }));
|
|
127
130
|
}
|
package/dist/select/select.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export interface SelectOption {
|
|
|
12
12
|
/** A second, quieter line under the label saying what choosing it does or adds: "Any
|
|
13
13
|
* Engen station in the province", "Adds 5 km round the town". Read with the option. */
|
|
14
14
|
hint?: Forwarded<string>;
|
|
15
|
+
/** An option that is shown and cannot be chosen: a vehicle already in another group, a
|
|
16
|
+
* station that is closed. It stays in the list and the arrows still reach it, so a reader
|
|
17
|
+
* hears that it is there and why it is out, the rule the menus keep. It is announced as
|
|
18
|
+
* unavailable and a press or Enter does nothing. Say why in `hint`. */
|
|
19
|
+
disabled?: Forwarded<boolean>;
|
|
15
20
|
}
|
|
16
21
|
/** A run of options under one optional heading, see `selectGroupedOptions`. */
|
|
17
22
|
export interface SelectOptionGroup<T extends SelectOption = SelectOption> {
|
|
@@ -33,6 +33,15 @@ export type DSSelectProps = Omit<ComponentProps<'div'>, 'onChange' | 'defaultVal
|
|
|
33
33
|
/** Submitted with the form by the hidden native `<select>`, see the
|
|
34
34
|
* contract header on why that element stays. */
|
|
35
35
|
name?: string;
|
|
36
|
+
/** Shows the chosen value to read, focus and copy but not change. The list
|
|
37
|
+
* never opens and the caret goes, as a read-only date field drops its
|
|
38
|
+
* calendar: a control that answers no press should not look like one. */
|
|
39
|
+
readOnly?: boolean | undefined;
|
|
40
|
+
/** `'field'` (the default) is a field of its own. `'inset'` is a picker set
|
|
41
|
+
* inside another field's box, as the phone field's dialling code is: no
|
|
42
|
+
* edge, no fill and no height of its own, so the box around it draws them
|
|
43
|
+
* once. Focus still rings the trigger. */
|
|
44
|
+
appearance?: 'field' | 'inset';
|
|
36
45
|
};
|
|
37
46
|
/** An option, plus the slot the contract cannot carry.
|
|
38
47
|
*
|
|
@@ -45,6 +54,10 @@ export interface DSSelectOption extends SelectOption {
|
|
|
45
54
|
/** Drawn before the label, in the trigger AND in the list. Rendered verbatim,
|
|
46
55
|
* never cloned and never given a className, the caller sizes it. */
|
|
47
56
|
leading?: ReactNode;
|
|
57
|
+
/** What the trigger shows once this is chosen, where the list's words are too
|
|
58
|
+
* long for it: "+263" for "Zimbabwe +263". The full label is still what a
|
|
59
|
+
* screen reader hears. */
|
|
60
|
+
triggerLabel?: string;
|
|
48
61
|
}
|
|
49
62
|
/** A single-choice picker over a list of options, which gains a search box past twelve. */
|
|
50
|
-
export declare function DSSelect({ options, value, invalid, size, disabled, open: openProp, onOpenChange, labelledBy, placeholder, onValueChange, searchLabel, searchPlaceholder, emptyLabel, name, className, 'aria-label': ariaLabel, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, id: triggerId, ...props }: DSSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export declare function DSSelect({ options, value, invalid, size, disabled, readOnly, open: openProp, onOpenChange, labelledBy, placeholder, onValueChange, searchLabel, searchPlaceholder, emptyLabel, name, appearance, className, 'aria-label': ariaLabel, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, id: triggerId, ...props }: DSSelectProps): import("react/jsx-runtime").JSX.Element;
|