@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
|
@@ -11,6 +11,9 @@ import { DSHelperText } from '../../helper-text/native/ds-helper-text';
|
|
|
11
11
|
import { DSTextarea } from '../../textarea/native/ds-textarea';
|
|
12
12
|
import { cn } from '../../lib/cn';
|
|
13
13
|
import { DSText } from '../../text/native/ds-text';
|
|
14
|
+
import { COMMON_COPY } from '../../copy';
|
|
15
|
+
import { iconMirrorStyle } from '../../icon/native/icon-direction';
|
|
16
|
+
import { useIconSize } from '../../icon/native/use-icon-size';
|
|
14
17
|
const ICON_STYLING = {
|
|
15
18
|
className: { target: 'style', nativeStyleMapping: { color: 'color' } },
|
|
16
19
|
};
|
|
@@ -22,6 +25,9 @@ const GLYPH = {
|
|
|
22
25
|
skip: styled(SkipForward, ICON_STYLING),
|
|
23
26
|
escalate: styled(ChevronsUp, ICON_STYLING),
|
|
24
27
|
};
|
|
28
|
+
const GLYPH_MIRROR = {
|
|
29
|
+
arrow: iconMirrorStyle('arrow-right'),
|
|
30
|
+
};
|
|
25
31
|
const EscalatedIcon = styled(ArrowUpRight, ICON_STYLING);
|
|
26
32
|
const GroupIcon = styled(Users, ICON_STYLING);
|
|
27
33
|
const MARKER_SURFACE = {
|
|
@@ -29,14 +35,14 @@ const MARKER_SURFACE = {
|
|
|
29
35
|
'info-surface': 'bg-info-surface',
|
|
30
36
|
'success-surface': 'bg-success-surface',
|
|
31
37
|
'warning-surface': 'bg-warning-surface',
|
|
32
|
-
'
|
|
38
|
+
'error-surface': 'bg-error-surface',
|
|
33
39
|
};
|
|
34
40
|
const MARKER_INK = {
|
|
35
41
|
'muted-foreground': 'text-muted-foreground',
|
|
36
42
|
info: 'text-info',
|
|
37
43
|
success: 'text-success',
|
|
38
44
|
warning: 'text-warning',
|
|
39
|
-
|
|
45
|
+
error: 'text-error',
|
|
40
46
|
};
|
|
41
47
|
const RAIL = { border: 'bg-border' };
|
|
42
48
|
const INK = { foreground: 'text-foreground' };
|
|
@@ -60,18 +66,19 @@ function Decide({ step, pending, onDecide, }) {
|
|
|
60
66
|
setRejecting(true);
|
|
61
67
|
}, children: "Reject" })] }));
|
|
62
68
|
}
|
|
63
|
-
return (_jsxs(View, { className: "mt-3 gap-2", children: [_jsx(DSText, { variant: "body-sm-strong", className: cn(INK[APPROVAL_CHAIN_INK]), children: "Reason for rejecting" }), _jsx(DSTextarea, { autoFocus: true, accessibilityLabel: "Reason for rejecting", value: reason, invalid: error !== undefined, rows: 3, onValueChange: setReason }), error === undefined ? (_jsx(DSHelperText, { children: "The requester sees this." })) : (_jsx(DSHelperText, { tone: "error", accessibilityLiveRegion: "polite", children: error })), _jsxs(View, { className: "flex-row flex-wrap gap-2", children: [_jsx(DSButton, { size: "sm", variant: "
|
|
69
|
+
return (_jsxs(View, { className: "mt-3 gap-2", children: [_jsx(DSText, { variant: "body-sm-strong", className: cn(INK[APPROVAL_CHAIN_INK]), children: "Reason for rejecting" }), _jsx(DSTextarea, { autoFocus: true, accessibilityLabel: "Reason for rejecting", value: reason, invalid: error !== undefined, rows: 3, onValueChange: setReason }), error === undefined ? (_jsx(DSHelperText, { children: "The requester sees this." })) : (_jsx(DSHelperText, { tone: "error", accessibilityLiveRegion: "polite", children: error })), _jsxs(View, { className: "flex-row flex-wrap justify-end gap-2", children: [_jsx(DSButton, { size: "sm", variant: "secondary", disabled: pending, onPress: () => {
|
|
70
|
+
setRejecting(false);
|
|
71
|
+
setTried(false);
|
|
72
|
+
}, children: COMMON_COPY.cancel }), _jsx(DSButton, { size: "sm", variant: "destructive", pending: pending, onPress: () => {
|
|
64
73
|
setTried(true);
|
|
65
74
|
if (approvalChainReasonError(reason) !== undefined)
|
|
66
75
|
return;
|
|
67
76
|
onDecide?.({ stepKey: step.key, verdict: 'rejected', comment: reason.trim() });
|
|
68
|
-
}, children: "Reject request" })
|
|
69
|
-
setRejecting(false);
|
|
70
|
-
setTried(false);
|
|
71
|
-
}, children: "Cancel" })] })] }));
|
|
77
|
+
}, children: "Reject request" })] })] }));
|
|
72
78
|
}
|
|
73
79
|
export function DSApprovalChain({ steps, viewerId, label, pending = false, onDecide, className, ...props }) {
|
|
74
80
|
const resolved = approvalChainStates(steps);
|
|
81
|
+
const noteIconSize = useIconSize(16);
|
|
75
82
|
const viewerStep = approvalChainViewerStep(steps, viewerId);
|
|
76
83
|
return (_jsxs(View, { className: cn('gap-4', className), ...props, children: [_jsx(DSText, { variant: "body-md-strong", accessibilityLiveRegion: "polite", className: cn(INK[APPROVAL_CHAIN_INK]), children: approvalChainSummary(steps) }), _jsx(View, { role: "list", "aria-label": label, children: steps.map((step, index) => {
|
|
77
84
|
const state = resolved[index] ?? { state: 'waiting' };
|
|
@@ -79,11 +86,11 @@ export function DSApprovalChain({ steps, viewerId, label, pending = false, onDec
|
|
|
79
86
|
const Glyph = GLYPH[marker.glyph];
|
|
80
87
|
const last = index === steps.length - 1;
|
|
81
88
|
const quorum = approvalChainQuorumLabel(step);
|
|
82
|
-
return (_jsxs(View, { role: "listitem", className: cn('flex-row gap-3', !last && 'pb-6'), children: [!last && (_jsx(View, { "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: "no", className: cn('absolute bottom-0 left-4 top-9 w-px', RAIL[APPROVAL_CHAIN_RAIL]) })), _jsx(View, { "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", className: cn('z-10 size-8 items-center justify-center rounded-full', MARKER_SURFACE[marker.surface]), children: _jsx(Glyph, { size: 16, className: MARKER_INK[marker.ink] }) }), _jsxs(View, { className: "min-w-0 flex-1 gap-2 pt-1", children: [_jsxs(View, { className: "flex-row flex-wrap items-baseline gap-x-2 gap-y-1", children: [_jsx(DSText, { variant: "body-md-strong", className: cn(INK[APPROVAL_CHAIN_INK]), children: step.role }), quorum !== undefined && (_jsx(DSText, { variant: "body-sm", className: cn(META_INK[APPROVAL_CHAIN_META_INK]), children: quorum })), _jsx(DSText, { variant: "body-sm-strong", className: cn(MARKER_INK[marker.ink]), children: marker.label })] }), step.approvers.map((approver) => {
|
|
89
|
+
return (_jsxs(View, { role: "listitem", className: cn('flex-row gap-3', !last && 'pb-6'), children: [!last && (_jsx(View, { "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: "no", className: cn('absolute bottom-0 left-4 top-9 w-px', RAIL[APPROVAL_CHAIN_RAIL]) })), _jsx(View, { "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", className: cn('z-10 size-8 items-center justify-center rounded-full', MARKER_SURFACE[marker.surface]), children: _jsx(Glyph, { size: 16, style: GLYPH_MIRROR[marker.glyph], className: MARKER_INK[marker.ink] }) }), _jsxs(View, { className: "min-w-0 flex-1 gap-2 pt-1", children: [_jsxs(View, { className: "flex-row flex-wrap items-baseline gap-x-2 gap-y-1", children: [_jsx(DSText, { variant: "body-md-strong", className: cn(INK[APPROVAL_CHAIN_INK]), children: step.role }), quorum !== undefined && (_jsx(DSText, { variant: "body-sm", className: cn(META_INK[APPROVAL_CHAIN_META_INK]), children: quorum })), _jsx(DSText, { variant: "body-sm-strong", className: cn(MARKER_INK[marker.ink]), children: marker.label })] }), step.approvers.map((approver) => {
|
|
83
90
|
const decision = [...(step.decisions ?? [])]
|
|
84
91
|
.reverse()
|
|
85
92
|
.find((d) => d.approverId === approver.id);
|
|
86
93
|
return (_jsxs(View, { className: "flex-row items-start gap-2", children: [_jsx(Face, { approver: approver }), _jsxs(View, { className: "min-w-0 flex-1", children: [_jsxs(DSText, { variant: "body-sm", className: cn(INK[APPROVAL_CHAIN_INK]), children: [approver.name, approver.id === viewerId && (_jsx(Text, { className: cn('font-sans', META_INK[APPROVAL_CHAIN_META_INK]), children: " (you)" }))] }), decision !== undefined && (_jsx(DSText, { variant: "body-sm", accessibilityLabel: `${approvalChainDecisionSentence(approver.name, decision.verdict)}, ${decision.at}`, className: cn('tabular-nums', META_INK[APPROVAL_CHAIN_META_INK]), children: `${decision.verdict === 'approved' ? 'Approved' : 'Rejected'} · ${decision.at}` })), decision?.comment !== undefined && decision.comment !== '' && (_jsx(DSText, { variant: "body-sm", className: cn('mt-1 rounded-control px-3 py-2', NOTE_SURFACE[APPROVAL_CHAIN_NOTE_SURFACE], INK[APPROVAL_CHAIN_INK]), children: decision.comment }))] })] }, approver.id));
|
|
87
|
-
}), state.note !== undefined && (_jsx(DSText, { variant: "body-sm", className: cn(META_INK[APPROVAL_CHAIN_META_INK]), children: state.note })), state.state === 'escalated' && step.escalationNote !== undefined && (_jsxs(View, { className: cn('flex-row items-start gap-2 rounded-control px-3 py-2', NOTE_SURFACE[APPROVAL_CHAIN_NOTE_SURFACE]), children: [_jsx(EscalatedIcon, { size:
|
|
94
|
+
}), state.note !== undefined && (_jsx(DSText, { variant: "body-sm", className: cn(META_INK[APPROVAL_CHAIN_META_INK]), children: state.note })), state.state === 'escalated' && step.escalationNote !== undefined && (_jsxs(View, { className: cn('flex-row items-start gap-2 rounded-control px-3 py-2', NOTE_SURFACE[APPROVAL_CHAIN_NOTE_SURFACE]), children: [_jsx(EscalatedIcon, { size: noteIconSize, style: iconMirrorStyle('arrow-up-right'), className: INK[APPROVAL_CHAIN_INK] }), _jsxs(DSText, { variant: "body-sm", className: cn('min-w-0 flex-1', INK[APPROVAL_CHAIN_INK]), children: [_jsx(DSText, { variant: "body-sm-strong", className: cn(INK[APPROVAL_CHAIN_INK]), children: 'Escalated: ' }), step.escalationNote] })] })), viewerStep === index && (_jsx(Decide, { step: step, pending: pending, onDecide: onDecide }))] })] }, step.key));
|
|
88
95
|
}) })] }));
|
|
89
96
|
}
|
|
@@ -4,6 +4,12 @@ export type DSApprovalChainProps = Omit<ComponentProps<'div'>, 'children'> & App
|
|
|
4
4
|
/** Fires when the viewer approves or rejects their step. A rejection always
|
|
5
5
|
* carries a reason that is not blank. */
|
|
6
6
|
onDecide?: (decision: ApprovalChainDecisionEvent) => void;
|
|
7
|
+
/** Draws each approver's face beside their name. On by default. Off in a
|
|
8
|
+
* narrow panel, where the step's marker already holds a column and a face
|
|
9
|
+
* under it pushed the names, decisions and notes onto edges of their own:
|
|
10
|
+
* they then start on the step's edge and a decision's note is quoted rather
|
|
11
|
+
* than boxed. */
|
|
12
|
+
avatars?: boolean;
|
|
7
13
|
};
|
|
8
14
|
/** The approval path of a request: each approver's step, its state as a glyph and a word and the viewer's own decision when it is their turn. */
|
|
9
|
-
export declare function DSApprovalChain({ steps, viewerId, label, pending, onDecide, className, ...props }: DSApprovalChainProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function DSApprovalChain({ steps, viewerId, label, pending, onDecide, avatars, className, ...props }: DSApprovalChainProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,19 +9,20 @@ import { DSTextarea } from '../../textarea/web/ds-textarea';
|
|
|
9
9
|
import { cn } from '../../lib/cn';
|
|
10
10
|
import { useFocusFallback } from '../../lib/web/focus-habits';
|
|
11
11
|
import { DSText } from '../../text/web/ds-text';
|
|
12
|
+
import { COMMON_COPY } from '../../copy';
|
|
12
13
|
const MARKER_SURFACE = {
|
|
13
14
|
muted: 'bg-muted',
|
|
14
15
|
'info-surface': 'bg-info-surface',
|
|
15
16
|
'success-surface': 'bg-success-surface',
|
|
16
17
|
'warning-surface': 'bg-warning-surface',
|
|
17
|
-
'
|
|
18
|
+
'error-surface': 'bg-error-surface',
|
|
18
19
|
};
|
|
19
20
|
const MARKER_INK = {
|
|
20
21
|
'muted-foreground': 'text-muted-foreground',
|
|
21
22
|
info: 'text-info',
|
|
22
23
|
success: 'text-success',
|
|
23
24
|
warning: 'text-warning',
|
|
24
|
-
|
|
25
|
+
error: 'text-error',
|
|
25
26
|
};
|
|
26
27
|
const RAIL = { border: 'bg-border' };
|
|
27
28
|
const INK = { foreground: 'text-foreground' };
|
|
@@ -37,10 +38,10 @@ const GLYPH = {
|
|
|
37
38
|
skip: SkipForward,
|
|
38
39
|
escalate: ChevronsUp,
|
|
39
40
|
};
|
|
40
|
-
function DecisionLine({ decision, name, }) {
|
|
41
|
+
function DecisionLine({ decision, name, boxed, }) {
|
|
41
42
|
if (decision === undefined)
|
|
42
43
|
return null;
|
|
43
|
-
return (_jsxs(_Fragment, { children: [_jsxs(DSText, { as: "span", variant: "body-sm", className: cn(META_INK[APPROVAL_CHAIN_META_INK]), children: [_jsx("span", { className: "sr-only", children: approvalChainDecisionSentence(name, decision.verdict) }), _jsx("span", { "aria-hidden": true, children: decision.verdict === 'approved' ? 'Approved' : 'Rejected' }), _jsx("span", { "aria-hidden": true, children: ' · ' }), _jsx("span", { className: "sr-only", children: ", " }), _jsx("time", { className: "tabular-nums", ...(decision.dateTime === undefined ? {} : { dateTime: decision.dateTime }), children: decision.at })] }), decision.comment !== undefined && decision.comment !== '' && (_jsx(DSText, { as: "p", variant: "body-sm", className: cn('m-0 mt-1 rounded-field px-3 py-2', NOTE_SURFACE[APPROVAL_CHAIN_NOTE_SURFACE], INK[APPROVAL_CHAIN_INK]), children: decision.comment }))] }));
|
|
44
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DSText, { as: "span", variant: "body-sm", className: cn(META_INK[APPROVAL_CHAIN_META_INK]), children: [_jsx("span", { className: "sr-only", children: approvalChainDecisionSentence(name, decision.verdict) }), _jsx("span", { "aria-hidden": true, children: decision.verdict === 'approved' ? 'Approved' : 'Rejected' }), _jsx("span", { "aria-hidden": true, children: ' · ' }), _jsx("span", { className: "sr-only", children: ", " }), _jsx("time", { className: "tabular-nums", ...(decision.dateTime === undefined ? {} : { dateTime: decision.dateTime }), children: decision.at })] }), decision.comment !== undefined && decision.comment !== '' && (_jsx(DSText, { as: "p", variant: "body-sm", className: cn('m-0 mt-1', boxed && ['rounded-field px-3 py-2', NOTE_SURFACE[APPROVAL_CHAIN_NOTE_SURFACE]], INK[APPROVAL_CHAIN_INK]), children: boxed ? decision.comment : `“${decision.comment}”` }))] }));
|
|
44
45
|
}
|
|
45
46
|
function Decide({ step, pending, onDecide, onPressed, }) {
|
|
46
47
|
const [rejecting, setRejecting] = useState(false);
|
|
@@ -69,15 +70,15 @@ function Decide({ step, pending, onDecide, onPressed, }) {
|
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
72
|
onDecide?.({ stepKey: step.key, verdict: 'rejected', comment: reason.trim() });
|
|
72
|
-
}, children: [_jsx(DSLabeledField, { label: "Reason for rejecting", helper: "The requester sees this.", ...(error === undefined ? {} : { error }), children: _jsx(DSTextarea, { ref: reasonRef, rows: 3, value: reason, required: true, onValueChange: setReason }) }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx(DSButton, { type: "
|
|
73
|
-
onPressed(event, step.key);
|
|
74
|
-
}, children: "Reject request" }), _jsx(DSButton, { type: "button", size: "sm", variant: "ghost", disabled: pending, onClick: () => {
|
|
73
|
+
}, children: [_jsx(DSLabeledField, { label: "Reason for rejecting", helper: "The requester sees this.", ...(error === undefined ? {} : { error }), children: _jsx(DSTextarea, { ref: reasonRef, rows: 3, value: reason, required: true, onValueChange: setReason }) }), _jsxs("div", { className: "flex flex-wrap justify-end gap-2", children: [_jsx(DSButton, { type: "button", size: "sm", variant: "secondary", disabled: pending, onClick: () => {
|
|
75
74
|
setRejecting(false);
|
|
76
75
|
setTried(false);
|
|
77
76
|
requestAnimationFrame(() => rejectRef.current?.focus());
|
|
78
|
-
}, children:
|
|
77
|
+
}, children: COMMON_COPY.cancel }), _jsx(DSButton, { type: "submit", size: "sm", variant: "destructive", pending: pending, onClick: (event) => {
|
|
78
|
+
onPressed(event, step.key);
|
|
79
|
+
}, children: "Reject request" })] })] }));
|
|
79
80
|
}
|
|
80
|
-
export function DSApprovalChain({ steps, viewerId, label, pending = false, onDecide, className, ...props }) {
|
|
81
|
+
export function DSApprovalChain({ steps, viewerId, label, pending = false, onDecide, avatars = true, className, ...props }) {
|
|
81
82
|
const resolved = approvalChainStates(steps);
|
|
82
83
|
const viewerStep = approvalChainViewerStep(steps, viewerId);
|
|
83
84
|
const summaryId = useId();
|
|
@@ -102,9 +103,9 @@ export function DSApprovalChain({ steps, viewerId, label, pending = false, onDec
|
|
|
102
103
|
const decision = [...(step.decisions ?? [])]
|
|
103
104
|
.reverse()
|
|
104
105
|
.find((d) => d.approverId === approver.id);
|
|
105
|
-
return (_jsxs("li", { className: "flex items-start gap-2", children: [approver.group === true ? (_jsx(DSAvatar, { "aria-hidden": true, shape: "square", size: 24, icon: _jsx(Users, { size: 12 }) })) : (_jsx(DSAvatar, { "aria-hidden": true, name: approver.name, size: 24, ...(approver.imageUrl === undefined
|
|
106
|
+
return (_jsxs("li", { className: "flex items-start gap-2", children: [!avatars ? null : approver.group === true ? (_jsx(DSAvatar, { "aria-hidden": true, shape: "square", size: 24, icon: _jsx(Users, { size: 12 }) })) : (_jsx(DSAvatar, { "aria-hidden": true, name: approver.name, size: 24, ...(approver.imageUrl === undefined
|
|
106
107
|
? {}
|
|
107
|
-
: { imageUrl: approver.imageUrl }) })), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsxs(DSText, { as: "span", variant: "body-sm", className: cn(INK[APPROVAL_CHAIN_INK]), children: [approver.name, approver.id === viewerId && (_jsx("span", { className: META_INK[APPROVAL_CHAIN_META_INK], children: " (you)" }))] }), _jsx(DecisionLine, { decision: decision, name: approver.name })] })] }, approver.id));
|
|
108
|
+
: { imageUrl: approver.imageUrl }) })), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsxs(DSText, { as: "span", variant: "body-sm", className: cn(INK[APPROVAL_CHAIN_INK]), children: [approver.name, approver.id === viewerId && (_jsx("span", { className: META_INK[APPROVAL_CHAIN_META_INK], children: " (you)" }))] }), _jsx(DecisionLine, { decision: decision, name: approver.name, boxed: avatars })] })] }, approver.id));
|
|
108
109
|
}) })), state.note !== undefined && (_jsx(DSText, { as: "p", variant: "body-sm", className: cn('m-0', META_INK[APPROVAL_CHAIN_META_INK]), children: state.note })), state.state === 'escalated' && step.escalationNote !== undefined && (_jsxs(DSText, { as: "p", variant: "body-sm", className: cn('m-0 flex items-start gap-2 rounded-field px-3 py-2', NOTE_SURFACE[APPROVAL_CHAIN_NOTE_SURFACE], INK[APPROVAL_CHAIN_INK]), children: [_jsx(ArrowUpRight, { "aria-hidden": true, className: "mt-0.5 size-4 flex-none" }), _jsxs("span", { children: [_jsx("span", { className: "font-semibold", children: "Escalated: " }), step.escalationNote] })] })), viewerStep === index && (_jsx(Decide, { step: step, pending: pending, onDecide: onDecide, onPressed: (event, stepKey) => {
|
|
109
110
|
decidedStep.current = stepKey;
|
|
110
111
|
decisionPressed(event);
|
|
@@ -42,6 +42,10 @@ export type DSAuthShellProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
|
42
42
|
brandBackdrop?: boolean;
|
|
43
43
|
/** A tinted strip along the card's foot, such as "New here? Create an account". */
|
|
44
44
|
cardFoot?: ReactNode;
|
|
45
|
+
/** The brand's mark at the top of the card, above its title, as a dialog draws its masthead. */
|
|
46
|
+
cardMasthead?: ReactNode;
|
|
47
|
+
/** Where the card's mark and title sit. `start` by default; `center` puts both on the card's middle. */
|
|
48
|
+
cardHeaderAlign?: 'start' | 'center';
|
|
45
49
|
} & ({
|
|
46
50
|
onBack?: undefined;
|
|
47
51
|
backLabel?: never;
|
|
@@ -52,4 +56,4 @@ export type DSAuthShellProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
|
52
56
|
backLabel: string;
|
|
53
57
|
});
|
|
54
58
|
/** The full-page frame an auth flow sits in. */
|
|
55
|
-
export declare function DSAuthShell({ children, header, footer, hero, banner, backdrop, veil, arrangement, panelSide, contentAlign, cardTitle, brandBackdrop, onBack, backLabel, cardFoot, className, ...props }: DSAuthShellProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare function DSAuthShell({ children, header, footer, hero, banner, backdrop, veil, arrangement, panelSide, contentAlign, cardTitle, brandBackdrop, onBack, backLabel, cardFoot, cardMasthead, cardHeaderAlign, className, ...props }: DSAuthShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,9 +29,12 @@ function Orbit({ layer }) {
|
|
|
29
29
|
function BrandBackdrop() {
|
|
30
30
|
return (_jsxs("div", { className: "relative size-full overflow-hidden bg-background", children: [_jsx(Orbit, { layer: "ember" }), _jsx(Orbit, { layer: "tide" }), _jsx(Orbit, { layer: "aurora" })] }));
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
function BackButton({ label, onBack }) {
|
|
33
|
+
return (_jsx(DSIconButton, { icon: _jsx(ArrowLeft, { "aria-hidden": true, className: "size-4.5 text-placeholder-foreground" }), label: label, variant: "ghost", size: "sm", className: "-my-2 -ms-3 self-start", onClick: onBack }));
|
|
34
|
+
}
|
|
35
|
+
export function DSAuthShell({ children, header, footer, hero, banner, backdrop, veil = false, arrangement = AUTH_SHELL_DEFAULT_ARRANGEMENT, panelSide = AUTH_SHELL_DEFAULT_PANEL_SIDE, contentAlign = 'center', cardTitle, brandBackdrop = false, onBack, backLabel, cardFoot, cardMasthead, cardHeaderAlign = 'start', className, ...props }) {
|
|
33
36
|
const spec = authShellSpec();
|
|
34
37
|
const shownBackdrop = backdrop === undefined && brandBackdrop ? _jsx(BrandBackdrop, {}) : backdrop;
|
|
35
|
-
const content = cardTitle === undefined ? (children) : (_jsxs("section", { className: "w-full max-w-110 overflow-hidden rounded-dock border border-panel-border bg-card shadow-medium", children: [_jsxs("div", { className: "flex flex-col gap-6 p-8", children: [onBack !== undefined && (_jsx(
|
|
38
|
+
const content = cardTitle === undefined ? (children) : (_jsxs("section", { className: "w-full max-w-110 overflow-hidden rounded-dock border border-panel-border bg-card shadow-medium", children: [_jsxs("div", { className: "flex flex-col gap-6 p-6 sm:p-8", children: [onBack !== undefined && cardMasthead === undefined && (_jsx(BackButton, { label: backLabel, onBack: onBack })), _jsxs("div", { className: cn('flex flex-col gap-3', cardHeaderAlign === 'center' && 'text-center'), children: [cardMasthead !== undefined && (_jsxs("div", { className: cn('relative flex min-h-8 items-center', cardHeaderAlign === 'center' ? 'justify-center' : 'justify-start', onBack !== undefined && cardHeaderAlign === 'start' && 'ps-8'), children: [onBack !== undefined && (_jsx("div", { className: "absolute start-0 top-1/2 -translate-y-1/2", children: _jsx(BackButton, { label: backLabel, onBack: onBack }) })), cardMasthead] })), _jsx(DSText, { as: "h1", variant: "heading-lg", className: "auth-card-title outline-none", tabIndex: -1, children: cardTitle })] }), children] }), cardFoot] }));
|
|
36
39
|
return (_jsxs("div", { className: cn('@container relative isolate min-h-dvh', SURFACE[spec.surface], className), ...props, children: [shownBackdrop !== null && shownBackdrop !== undefined && (_jsxs("div", { "aria-hidden": true, inert: true, className: "pointer-events-none absolute inset-0", children: [shownBackdrop, veil && _jsx("div", { "data-testid": "auth-shell-veil", className: "absolute inset-0 scrim-veil" })] })), _jsxs("div", { className: "relative flex h-dvh flex-col overflow-y-auto", children: [header !== undefined && (_jsx("header", { className: "auth-shell-head flex shrink-0", children: header })), arrangement === 'panel' ? (_jsxs("main", { className: cn('flex flex-1', PANEL_SIDE[panelSide]), style: { padding: spec.panelInset }, children: [hero !== undefined && (_jsx("div", { className: "hidden min-w-0 flex-1 items-center justify-center @auth-split:flex", children: _jsx("div", { className: "min-w-0", style: { maxWidth: spec.heroMaxWidth }, children: hero }) })), _jsx("div", { className: "flex w-full min-w-0 flex-col [&>*]:flex-1", style: { maxWidth: spec.panelMaxWidth }, children: content })] })) : (_jsx("main", { className: cn('flex flex-1 justify-center', contentAlign === 'start' ? 'items-start' : 'items-center'), style: { padding: spec.insetInline }, children: hero === undefined ? (content) : (_jsxs("div", { className: "flex w-full items-center justify-center gap-12", children: [_jsx("div", { className: "hidden min-w-0 flex-1 @auth-split:block", style: { maxWidth: spec.heroMaxWidth }, children: hero }), _jsx("div", { className: "flex min-w-0 flex-1 justify-center", children: content })] })) })), footer !== undefined && (_jsx("footer", { className: "auth-shell-foot flex shrink-0", children: footer })), banner !== undefined && (_jsx("div", { "data-testid": "auth-shell-banner", className: "sticky bottom-0 z-(--layer-raised) shrink-0", children: banner }))] })] }));
|
|
37
40
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Forwarded } from '../props';
|
|
2
2
|
import { type DeltaInkRole, type DeltaSentiment } from '../delta/delta';
|
|
3
|
+
import type { Loadable } from '../skeleton/skeleton';
|
|
3
4
|
/** The figure the header shows: the drawn text and the exact spoken label. */
|
|
4
5
|
export interface BalanceHeaderFigure {
|
|
5
6
|
/** What a sighted reader sees, `R3 260.00`. */
|
|
@@ -22,10 +23,8 @@ export declare const BALANCE_HEADER_LABEL_INK = "muted-foreground";
|
|
|
22
23
|
export declare const BALANCE_HEADER_CAPTION_INK = "muted-foreground";
|
|
23
24
|
export type BalanceHeaderLabelInkRole = typeof BALANCE_HEADER_LABEL_INK;
|
|
24
25
|
export type BalanceHeaderCaptionInkRole = typeof BALANCE_HEADER_CAPTION_INK;
|
|
25
|
-
/**
|
|
26
|
-
export interface
|
|
27
|
-
/** What the figure is, "Available balance", "Spent this month". */
|
|
28
|
-
label: string;
|
|
26
|
+
/** A Balance Header's data: everything but its label, which is known before it loads. */
|
|
27
|
+
export interface BalanceHeaderFields {
|
|
29
28
|
/** The balance, in currency units. */
|
|
30
29
|
value: number;
|
|
31
30
|
/** The currency symbol drawn before the figure. */
|
|
@@ -41,3 +40,8 @@ export interface BalanceHeaderContract {
|
|
|
41
40
|
/** What the change is measured against, "vs last month". */
|
|
42
41
|
deltaCaption?: Forwarded<string>;
|
|
43
42
|
}
|
|
43
|
+
/** The props every Balance Header implementation accepts: the label always, the data while ready. */
|
|
44
|
+
export type BalanceHeaderContract = Loadable<BalanceHeaderFields> & {
|
|
45
|
+
/** What the figure is, "Available balance", "Spent this month". */
|
|
46
|
+
label: string;
|
|
47
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ViewProps } from 'react-native';
|
|
3
3
|
import { type BalanceHeaderContract } from '../balance-header';
|
|
4
|
-
export type DSBalanceHeaderProps = Omit<ViewProps, 'children'> & BalanceHeaderContract & {
|
|
4
|
+
export type DSBalanceHeaderProps = Omit<ViewProps, 'children' | 'accessibilityState' | 'aria-busy'> & BalanceHeaderContract & {
|
|
5
5
|
/** A control for the period the figure covers, drawn beside the label. */
|
|
6
6
|
period?: ReactNode;
|
|
7
7
|
/** A small chart of the figure's recent history, drawn under the change line. */
|
|
8
8
|
sparkline?: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
/** The top of a wallet screen: a label, the balance large, its change and room for a period and a sparkline. */
|
|
11
|
-
export declare function DSBalanceHeader({ label, value, currency, fractionDigits, roll, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }: DSBalanceHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function DSBalanceHeader({ loading, loadingLabel, label, value, currency, fractionDigits, roll, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }: DSBalanceHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
4
|
import { balanceHeaderDeltaSpoken, BALANCE_HEADER_DELTA_NEUTRAL_INK, balanceHeaderFigure, } from '../balance-header';
|
|
4
5
|
import { DSAmount } from '../../amount/native/ds-amount';
|
|
@@ -6,6 +7,8 @@ import { DSDelta } from '../../delta/native/ds-delta';
|
|
|
6
7
|
import { DSMetric } from '../../metric/native/ds-metric';
|
|
7
8
|
import { cn } from '../../lib/cn';
|
|
8
9
|
import { DSText } from '../../text/native/ds-text';
|
|
10
|
+
import { DSSkeleton } from '../../skeleton/native/ds-skeleton';
|
|
11
|
+
import { announce } from '../../lib/native/announce';
|
|
9
12
|
const LABEL_INK = {
|
|
10
13
|
'muted-foreground': 'text-muted-foreground',
|
|
11
14
|
};
|
|
@@ -15,8 +18,12 @@ const CAPTION_INK = {
|
|
|
15
18
|
const NEUTRAL_DELTA_INK = {
|
|
16
19
|
foreground: 'text-foreground',
|
|
17
20
|
};
|
|
18
|
-
export function DSBalanceHeader({ label, value, currency, fractionDigits, roll = false, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }) {
|
|
19
|
-
const figure = balanceHeaderFigure(value, { currency, fractionDigits });
|
|
21
|
+
export function DSBalanceHeader({ loading, loadingLabel, label, value, currency, fractionDigits, roll = false, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }) {
|
|
22
|
+
const figure = loading === true ? undefined : balanceHeaderFigure(value, { currency, fractionDigits });
|
|
20
23
|
const spokenDelta = delta === undefined ? '' : balanceHeaderDeltaSpoken(delta, deltaCaption);
|
|
21
|
-
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (loading === true && loadingLabel)
|
|
26
|
+
announce(loadingLabel);
|
|
27
|
+
}, [loading, loadingLabel]);
|
|
28
|
+
return (_jsxs(View, { className: cn('gap-2', className), accessibilityState: { busy: loading === true }, "aria-busy": loading === true, ...props, children: [_jsxs(View, { className: "flex-row items-center justify-between gap-3", children: [_jsx(View, { accessible: true, accessibilityLabel: figure === undefined ? label : `${label}, ${figure.label}`, className: "shrink", children: _jsx(DSText, { variant: "body-sm", className: cn(LABEL_INK['muted-foreground']), children: label }) }), period] }), loading === true ? (_jsxs(_Fragment, { children: [_jsx(DSSkeleton, { fits: "heading-xl", className: "w-40" }), _jsx(DSSkeleton, { fits: "label-sm", className: "w-28" }), sparkline !== undefined && _jsx(DSSkeleton, { className: "mt-1 h-10 w-full rounded-xs" })] })) : (_jsxs(_Fragment, { children: [_jsx(View, { importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true, children: roll ? (_jsx(DSMetric, { roll: true, children: figure?.text ?? '' })) : (_jsx(DSAmount, { value: value, currency: currency, fractionDigits: fractionDigits, size: "lg", quietCents: true })) }), spokenDelta !== '' && (_jsxs(View, { accessible: true, accessibilityLabel: spokenDelta, className: "flex-row flex-wrap items-center gap-x-1", children: [deltaSentiment === undefined ? (_jsx(DSText, { variant: "label-sm", className: cn('font-semibold tabular-nums', NEUTRAL_DELTA_INK[BALANCE_HEADER_DELTA_NEUTRAL_INK]), children: delta ?? '' })) : (_jsx(DSDelta, { sentiment: deltaSentiment, children: delta ?? '' })), deltaCaption !== undefined && deltaCaption !== '' && (_jsx(DSText, { variant: "body-xs", className: cn(CAPTION_INK['muted-foreground']), children: deltaCaption }))] })), sparkline !== undefined && _jsx(View, { className: "pt-1", children: sparkline })] }))] }));
|
|
22
29
|
}
|
|
@@ -7,4 +7,4 @@ export type DSBalanceHeaderProps = Omit<ComponentProps<'div'>, 'role' | 'aria-la
|
|
|
7
7
|
sparkline?: ReactNode;
|
|
8
8
|
};
|
|
9
9
|
/** The top of a wallet screen: a label, the balance large, its change and room for a period and a sparkline. */
|
|
10
|
-
export declare function DSBalanceHeader({ label, value, currency, fractionDigits, roll, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }: DSBalanceHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function DSBalanceHeader({ loading, loadingLabel, label, value, currency, fractionDigits, roll, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }: DSBalanceHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
import { BALANCE_HEADER_DELTA_NEUTRAL_INK, balanceHeaderFigure, } from '../balance-header';
|
|
4
4
|
import { DSAmount } from '../../amount/web/ds-amount';
|
|
@@ -6,6 +6,9 @@ import { DSDelta } from '../../delta/web/ds-delta';
|
|
|
6
6
|
import { DSMetric } from '../../metric/web/ds-metric';
|
|
7
7
|
import { cn } from '../../lib/cn';
|
|
8
8
|
import { DSText } from '../../text/web/ds-text';
|
|
9
|
+
import { DSSkeleton } from '../../skeleton/web/ds-skeleton';
|
|
10
|
+
import { loadingSpoken } from '../../skeleton/skeleton';
|
|
11
|
+
import { SpokenRegion } from '../../lib/web/spoken-region';
|
|
9
12
|
const LABEL_INK = {
|
|
10
13
|
'muted-foreground': 'text-muted-foreground',
|
|
11
14
|
};
|
|
@@ -15,9 +18,9 @@ const CAPTION_INK = {
|
|
|
15
18
|
const NEUTRAL_DELTA_INK = {
|
|
16
19
|
foreground: 'text-foreground',
|
|
17
20
|
};
|
|
18
|
-
export function DSBalanceHeader({ label, value, currency, fractionDigits, roll = false, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }) {
|
|
21
|
+
export function DSBalanceHeader({ loading, loadingLabel, label, value, currency, fractionDigits, roll = false, delta, deltaSentiment, deltaCaption, period, sparkline, className, ...props }) {
|
|
19
22
|
const labelId = useId();
|
|
20
|
-
const figure = balanceHeaderFigure(value, { currency, fractionDigits });
|
|
23
|
+
const figure = loading === true ? undefined : balanceHeaderFigure(value, { currency, fractionDigits });
|
|
21
24
|
const hasDelta = delta !== undefined && delta.trim() !== '';
|
|
22
|
-
return (_jsxs("div", { ...props, role: "group", "aria-labelledby": labelId, className: cn('flex flex-col gap-2', className), children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(DSText, { as: "span", variant: "body-sm", id: labelId, className: cn('min-w-0', LABEL_INK['muted-foreground']), children: label }), period] }), roll ? (_jsxs("span", { className: "self-start", children: [_jsx("span", { className: "sr-only", children: figure
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx(SpokenRegion, { text: loadingSpoken(loading, loadingLabel) }), _jsxs("div", { ...props, role: "group", "aria-labelledby": labelId, "aria-busy": loading === true ? true : undefined, className: cn('flex flex-col gap-2', className), children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(DSText, { as: "span", variant: "body-sm", id: labelId, className: cn('min-w-0', LABEL_INK['muted-foreground']), children: label }), period] }), loading === true ? (_jsxs(_Fragment, { children: [_jsx(DSSkeleton, { fits: "heading-xl", className: "w-40" }), _jsx(DSSkeleton, { fits: "label-sm", className: "w-28" }), sparkline !== undefined && _jsx(DSSkeleton, { className: "mt-1 h-10 w-full rounded-xs" })] })) : (_jsxs(_Fragment, { children: [roll ? (_jsxs("span", { className: "self-start", children: [_jsx("span", { className: "sr-only", children: figure?.label }), _jsx(DSMetric, { "aria-hidden": true, roll: true, children: figure?.text ?? '' })] })) : (_jsx(DSAmount, { className: "self-start", value: value, currency: currency, fractionDigits: fractionDigits, size: "lg", quietCents: true })), hasDelta && (_jsxs("p", { className: "flex flex-wrap items-center gap-x-1 gap-y-1", children: [deltaSentiment === undefined ? (_jsx(DSText, { as: "span", variant: "label-sm", className: cn('inline-flex items-center gap-1 font-semibold tabular-nums', NEUTRAL_DELTA_INK[BALANCE_HEADER_DELTA_NEUTRAL_INK]), children: delta })) : (_jsx(DSDelta, { sentiment: deltaSentiment, children: delta })), deltaCaption !== undefined && deltaCaption !== '' && (_jsx(DSText, { as: "span", variant: "body-xs", className: cn(CAPTION_INK['muted-foreground']), children: deltaCaption }))] })), sparkline !== undefined && _jsx("div", { className: "pt-1", children: sparkline })] }))] })] }));
|
|
23
26
|
}
|
|
@@ -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 drawing box. Stretched to the container by the adapter, as the line
|
|
4
5
|
* chart's is, so these are ratios rather than pixels. */
|
|
5
6
|
export declare const BAR_CHART_VIEWBOX: {
|
|
@@ -23,16 +24,29 @@ export interface BarChartSeries {
|
|
|
23
24
|
* list, first series first. */
|
|
24
25
|
series?: Forwarded<ChartHue>;
|
|
25
26
|
}
|
|
26
|
-
export interface BarChartContract {
|
|
27
|
+
export interface BarChartContract extends LoadingContract {
|
|
27
28
|
/** The category names, in the order they are drawn. */
|
|
28
29
|
categories: readonly string[];
|
|
29
|
-
/** One series draws plain bars; several stack within each category.
|
|
30
|
-
*
|
|
30
|
+
/** One series draws plain bars; several stack within each category. There
|
|
31
|
+
* are six hues, so past six the fifth onward fold into one "Other" series
|
|
32
|
+
* whose values are their sums: no figure leaves the totals or the table. */
|
|
31
33
|
series: readonly BarChartSeries[];
|
|
32
34
|
/** Bars rising from the bottom, or running from the left. */
|
|
33
35
|
orientation?: Forwarded<BarChartOrientation>;
|
|
34
36
|
/** The keys of series left out of the drawing and the scale. */
|
|
35
37
|
hiddenKeys?: Forwarded<readonly string[]>;
|
|
38
|
+
/** Draws every bar to the full length, each part as its share of the bar's
|
|
39
|
+
* total, on a 0 to 100 per cent axis. For a mix that changes over time or
|
|
40
|
+
* across categories. Off by default. */
|
|
41
|
+
share?: Forwarded<boolean>;
|
|
42
|
+
/** Fixes the top of the value scale so several charts can share one, rounded
|
|
43
|
+
* up to a round figure and never below the data's own largest total. For
|
|
44
|
+
* small multiples. Unset, the scale follows the data. Ignored with `share`,
|
|
45
|
+
* whose top is always 100 per cent. */
|
|
46
|
+
max?: Forwarded<number>;
|
|
47
|
+
/** First load. Draws a skeleton at the plot's own height, so a dashboard
|
|
48
|
+
* does not jump when the figures arrive. */
|
|
49
|
+
loading?: Forwarded<boolean>;
|
|
36
50
|
}
|
|
37
51
|
/** One series' share of one bar, placed in the box. */
|
|
38
52
|
export interface BarChartSegment {
|
|
@@ -42,6 +56,10 @@ export interface BarChartSegment {
|
|
|
42
56
|
/** The caller's value, as given, negative if it was negative. `undefined`
|
|
43
57
|
* for a hole. */
|
|
44
58
|
value: number | undefined;
|
|
59
|
+
/** In a share chart, the part's whole-number percent of the bar (they add up
|
|
60
|
+
* to 100 per bar). `undefined` for a hole, for a bar with no readings and
|
|
61
|
+
* in every chart that is not a share chart. */
|
|
62
|
+
share: number | undefined;
|
|
45
63
|
x: number;
|
|
46
64
|
y: number;
|
|
47
65
|
width: number;
|
|
@@ -59,6 +77,10 @@ export interface BarChartBar {
|
|
|
59
77
|
missing: boolean;
|
|
60
78
|
/** At least one value was below zero and was drawn at zero. */
|
|
61
79
|
clamped: boolean;
|
|
80
|
+
/** Share chart only: the bar has figures but its drawn parts add up to
|
|
81
|
+
* nothing, so there is no mix to show. It keeps its place and draws no
|
|
82
|
+
* parts. Always `false` outside a share chart and for a `missing` bar. */
|
|
83
|
+
noReadings: boolean;
|
|
62
84
|
/** The whole stack's box, in viewBox units. Zero-length when missing or
|
|
63
85
|
* zero. */
|
|
64
86
|
x: number;
|
|
@@ -75,6 +97,8 @@ export interface BarChartBar {
|
|
|
75
97
|
segments: readonly BarChartSegment[];
|
|
76
98
|
}
|
|
77
99
|
export interface BarChartResolvedSpec {
|
|
100
|
+
/** Every bar is drawn to the full length as shares of its own total. */
|
|
101
|
+
share: boolean;
|
|
78
102
|
/** Nothing to draw: no categories, every series hidden, or every value a
|
|
79
103
|
* hole. The adapter renders the placeholder plot at the same height. */
|
|
80
104
|
empty: boolean;
|
|
@@ -87,7 +111,7 @@ export interface BarChartResolvedSpec {
|
|
|
87
111
|
* nothing to divide. */
|
|
88
112
|
ticks: readonly number[];
|
|
89
113
|
bars: readonly BarChartBar[];
|
|
90
|
-
/** The drawable series (the
|
|
114
|
+
/** The drawable series (six at most, the rest folded into Other), with their resolved hue and whether
|
|
91
115
|
* each is hidden, what a legend lists. */
|
|
92
116
|
series: readonly {
|
|
93
117
|
key: string;
|
|
@@ -96,11 +120,19 @@ export interface BarChartResolvedSpec {
|
|
|
96
120
|
hidden: boolean;
|
|
97
121
|
}[];
|
|
98
122
|
}
|
|
123
|
+
/** Whole-number percents of a bar's parts that add up to exactly 100 (largest
|
|
124
|
+
* remainder, ties to the earlier part). A hole is `undefined`; a negative part
|
|
125
|
+
* is nothing, as it is in the drawing. All zero when nothing is drawn. */
|
|
126
|
+
export declare function barChartPercents(values: readonly (number | undefined)[]): (number | undefined)[];
|
|
127
|
+
/** The key of the series the extras fold into. */
|
|
128
|
+
export declare const BAR_CHART_OTHER_KEY = "other";
|
|
129
|
+
/** The series a bar chart draws: all of them up to six, else the first five and one "Other". */
|
|
130
|
+
export declare function barChartSeries(series: readonly BarChartSeries[], otherLabel?: string): BarChartSeries[];
|
|
99
131
|
/**
|
|
100
132
|
* The one function an adapter calls: cleans the values, stacks the visible
|
|
101
133
|
* series and places every bar in the box.
|
|
102
134
|
*/
|
|
103
|
-
export declare function barChartSpec({ categories, series, orientation, hiddenKeys, }: BarChartContract): BarChartResolvedSpec;
|
|
135
|
+
export declare function barChartSpec({ categories, series, orientation, hiddenKeys, share, max: fixedMax, }: BarChartContract): BarChartResolvedSpec;
|
|
104
136
|
/**
|
|
105
137
|
* The bar whose band holds a point along the category axis, given as a
|
|
106
138
|
* fraction of the plot, what a pointer or a finger is over. Missing bars
|
|
@@ -125,6 +157,15 @@ export declare function barChartGapped(segments: readonly BarChartSegment[], ori
|
|
|
125
157
|
* are the written figures, in step with `ticks`. All of them before the plot
|
|
126
158
|
* is measured. */
|
|
127
159
|
export declare function barChartAxisTicks(ticks: readonly number[], labels: readonly string[], orientation: BarChartOrientation, extentPx: number): number[];
|
|
160
|
+
/** Whether `text` fits inside a part. `false` before the plot is measured: a
|
|
161
|
+
* label whose room is not known is not written. */
|
|
162
|
+
export declare function barChartLabelFits(segment: {
|
|
163
|
+
width: number;
|
|
164
|
+
height: number;
|
|
165
|
+
}, text: string, plot: {
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
}): boolean;
|
|
128
169
|
/** How far an inspected bar lifts off the rest, in pixels. */
|
|
129
170
|
export declare const BAR_CHART_LIFT_PX = 4;
|
|
130
171
|
/** The radii, in box units across and down, that draw a `radiusPx` corner on
|
|
@@ -5,14 +5,51 @@ export const BAR_CHART_MAX_SERIES = 6;
|
|
|
5
5
|
export const BAR_CHART_BAND_GAP = 0.3;
|
|
6
6
|
export const BAR_CHART_MIN_BANDS = 4;
|
|
7
7
|
const { width: W, height: H } = BAR_CHART_VIEWBOX;
|
|
8
|
+
const SHARE_TOP = 100;
|
|
9
|
+
const SHARE_TICKS = [0, 25, 50, 75, 100];
|
|
10
|
+
export function barChartPercents(values) {
|
|
11
|
+
const parts = values.map((v) => (v === undefined ? undefined : Math.max(0, v)));
|
|
12
|
+
const total = parts.reduce((sum, v) => sum + (v ?? 0), 0);
|
|
13
|
+
if (total <= 0)
|
|
14
|
+
return parts.map((v) => (v === undefined ? undefined : 0));
|
|
15
|
+
const exact = parts.map((v) => ((v ?? 0) / total) * 100);
|
|
16
|
+
const floors = exact.map(Math.floor);
|
|
17
|
+
let left = 100 - floors.reduce((a, b) => a + b, 0);
|
|
18
|
+
const order = exact
|
|
19
|
+
.map((x, i) => ({ i, rest: x - Math.floor(x), live: parts[i] !== undefined && (parts[i] ?? 0) > 0 }))
|
|
20
|
+
.filter((o) => o.live)
|
|
21
|
+
.sort((a, b) => b.rest - a.rest || a.i - b.i);
|
|
22
|
+
for (const { i } of order) {
|
|
23
|
+
if (left <= 0)
|
|
24
|
+
break;
|
|
25
|
+
floors[i] = (floors[i] ?? 0) + 1;
|
|
26
|
+
left -= 1;
|
|
27
|
+
}
|
|
28
|
+
return parts.map((v, i) => (v === undefined ? undefined : (floors[i] ?? 0)));
|
|
29
|
+
}
|
|
8
30
|
function round(n) {
|
|
9
31
|
return Math.round(n * 100) / 100;
|
|
10
32
|
}
|
|
33
|
+
export const BAR_CHART_OTHER_KEY = 'other';
|
|
34
|
+
export function barChartSeries(series, otherLabel = 'Other') {
|
|
35
|
+
if (series.length <= BAR_CHART_MAX_SERIES)
|
|
36
|
+
return [...series];
|
|
37
|
+
const kept = series.slice(0, BAR_CHART_MAX_SERIES - 1);
|
|
38
|
+
const rest = series.slice(BAR_CHART_MAX_SERIES - 1);
|
|
39
|
+
const length = Math.max(0, ...rest.map((s) => s.values.length));
|
|
40
|
+
const values = Array.from({ length }, (_, i) => {
|
|
41
|
+
const finite = rest
|
|
42
|
+
.map((s) => s.values[i])
|
|
43
|
+
.filter((v) => v !== undefined && Number.isFinite(v));
|
|
44
|
+
return finite.length === 0 ? Number.NaN : finite.reduce((a, b) => a + b, 0);
|
|
45
|
+
});
|
|
46
|
+
return [...kept, { key: BAR_CHART_OTHER_KEY, label: otherLabel, values }];
|
|
47
|
+
}
|
|
11
48
|
function hueAt(position) {
|
|
12
49
|
return ((position % BAR_CHART_MAX_SERIES) + 1);
|
|
13
50
|
}
|
|
14
|
-
export function barChartSpec({ categories, series, orientation = 'vertical', hiddenKeys = [], }) {
|
|
15
|
-
const drawable = series
|
|
51
|
+
export function barChartSpec({ categories, series, orientation = 'vertical', hiddenKeys = [], share = false, max: fixedMax, }) {
|
|
52
|
+
const drawable = barChartSeries(series).map((s, position) => ({
|
|
16
53
|
...s,
|
|
17
54
|
hue: s.series ?? hueAt(position),
|
|
18
55
|
hidden: hiddenKeys.includes(s.key),
|
|
@@ -42,22 +79,33 @@ export function barChartSpec({ categories, series, orientation = 'vertical', hid
|
|
|
42
79
|
});
|
|
43
80
|
const empty = visible.length === 0 || raw.every((r) => r.missing);
|
|
44
81
|
const largest = empty ? 0 : Math.max(0, ...raw.map((r) => r.drawn));
|
|
45
|
-
const
|
|
46
|
-
const
|
|
82
|
+
const wanted = fixedMax !== undefined && Number.isFinite(fixedMax) && fixedMax > 0 ? fixedMax : 0;
|
|
83
|
+
const top = Math.max(largest, wanted);
|
|
84
|
+
const scale = share
|
|
85
|
+
? { max: SHARE_TOP, ticks: [...SHARE_TICKS] }
|
|
86
|
+
: top === 0
|
|
87
|
+
? { max: 0, ticks: [0] }
|
|
88
|
+
: chartTicks(0, top);
|
|
89
|
+
const max = empty ? 0 : scale.max;
|
|
90
|
+
const ticks = empty ? [0] : scale.ticks;
|
|
47
91
|
const count = Math.max(1, categories.length);
|
|
48
92
|
const band = (orientation === 'vertical' ? W : H) / count;
|
|
49
93
|
const thickness = Math.min(band, (orientation === 'vertical' ? W : H) / BAR_CHART_MIN_BANDS) *
|
|
50
94
|
(1 - BAR_CHART_BAND_GAP);
|
|
51
95
|
const extent = orientation === 'vertical' ? H : W;
|
|
52
|
-
const length = (v) => (max === 0 ? 0 : (Math.max(0, v) / max) * extent);
|
|
53
96
|
const bars = raw.map((r) => {
|
|
54
97
|
const centre = round(r.index * band + band / 2);
|
|
55
98
|
const start = round(centre - thickness / 2);
|
|
99
|
+
const whole = share ? r.drawn : max;
|
|
100
|
+
const length = (v) => (whole === 0 ? 0 : (Math.max(0, v) / whole) * extent);
|
|
101
|
+
const noReadings = share && !r.missing && r.drawn === 0;
|
|
102
|
+
const percents = share ? barChartPercents(r.values) : [];
|
|
56
103
|
let cumulative = 0;
|
|
57
104
|
const segments = visible.map((s, i) => {
|
|
58
105
|
const value = r.values[i];
|
|
59
106
|
const from = cumulative;
|
|
60
107
|
const size = length(value ?? 0);
|
|
108
|
+
const percent = share && !noReadings ? percents[i] : undefined;
|
|
61
109
|
cumulative += size;
|
|
62
110
|
return orientation === 'vertical'
|
|
63
111
|
? {
|
|
@@ -65,6 +113,7 @@ export function barChartSpec({ categories, series, orientation = 'vertical', hid
|
|
|
65
113
|
label: s.label,
|
|
66
114
|
series: s.hue,
|
|
67
115
|
value,
|
|
116
|
+
share: percent,
|
|
68
117
|
x: start,
|
|
69
118
|
y: round(H - from - size),
|
|
70
119
|
width: round(thickness),
|
|
@@ -75,6 +124,7 @@ export function barChartSpec({ categories, series, orientation = 'vertical', hid
|
|
|
75
124
|
label: s.label,
|
|
76
125
|
series: s.hue,
|
|
77
126
|
value,
|
|
127
|
+
share: percent,
|
|
78
128
|
x: round(from),
|
|
79
129
|
y: start,
|
|
80
130
|
width: round(size),
|
|
@@ -88,6 +138,7 @@ export function barChartSpec({ categories, series, orientation = 'vertical', hid
|
|
|
88
138
|
total: r.total,
|
|
89
139
|
missing: r.missing,
|
|
90
140
|
clamped: r.clamped,
|
|
141
|
+
noReadings,
|
|
91
142
|
...(orientation === 'vertical'
|
|
92
143
|
? { x: start, y: round(H - end), width: round(thickness), height: end }
|
|
93
144
|
: { x: 0, y: start, width: end, height: round(thickness) }),
|
|
@@ -96,7 +147,7 @@ export function barChartSpec({ categories, series, orientation = 'vertical', hid
|
|
|
96
147
|
segments,
|
|
97
148
|
};
|
|
98
149
|
});
|
|
99
|
-
return { empty, orientation, max, ticks
|
|
150
|
+
return { share, empty, orientation, max, ticks, bars: empty ? [] : bars, series: legend };
|
|
100
151
|
}
|
|
101
152
|
export function barChartNearest(bars, fraction) {
|
|
102
153
|
if (bars.length === 0)
|
|
@@ -140,6 +191,13 @@ export function barChartAxisTicks(ticks, labels, orientation, extentPx) {
|
|
|
140
191
|
const stride = Math.max(1, Math.ceil(need / spacing));
|
|
141
192
|
return ticks.filter((_, i) => i % stride === 0);
|
|
142
193
|
}
|
|
194
|
+
export function barChartLabelFits(segment, text, plot) {
|
|
195
|
+
if (text === '' || !(plot.width > 0) || !(plot.height > 0))
|
|
196
|
+
return false;
|
|
197
|
+
const widthPx = (segment.width / W) * plot.width;
|
|
198
|
+
const heightPx = (segment.height / H) * plot.height;
|
|
199
|
+
return widthPx >= text.length * AXIS_GLYPH_PX + AXIS_GAP_PX && heightPx >= AXIS_LINE_PX;
|
|
200
|
+
}
|
|
143
201
|
export const BAR_CHART_LIFT_PX = 4;
|
|
144
202
|
export function barChartCapRadii(widthPx, heightPx, radiusPx = BAR_CHART_CAP_RADIUS_PX) {
|
|
145
203
|
if (!(widthPx > 0) || !(heightPx > 0))
|