@ds-mo/ui 3.0.1 → 3.1.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/dist/.build-stamp +1 -1
- package/dist/angular/angular-component-lib/utils.d.ts +9 -0
- package/dist/angular/angular-component-lib/utils.js +58 -0
- package/dist/angular/boolean-value-accessor.d.ts +9 -0
- package/dist/angular/boolean-value-accessor.js +37 -0
- package/dist/angular/ds-app-shell.d.ts +12 -0
- package/dist/angular/ds-app-shell.js +38 -0
- package/dist/angular/ds-badge.d.ts +12 -0
- package/dist/angular/ds-badge.js +38 -0
- package/dist/angular/ds-banner.d.ts +15 -0
- package/dist/angular/ds-banner.js +42 -0
- package/dist/angular/ds-bar-nav.d.ts +18 -0
- package/dist/angular/ds-bar-nav.js +42 -0
- package/dist/angular/ds-button-filled.d.ts +15 -0
- package/dist/angular/ds-button-filled.js +43 -0
- package/dist/angular/ds-button-unfilled.d.ts +17 -0
- package/dist/angular/ds-button-unfilled.js +46 -0
- package/dist/angular/ds-card-data-viz-donut.d.ts +18 -0
- package/dist/angular/ds-card-data-viz-donut.js +42 -0
- package/dist/angular/ds-card-setting.d.ts +18 -0
- package/dist/angular/ds-card-setting.js +42 -0
- package/dist/angular/ds-card.d.ts +12 -0
- package/dist/angular/ds-card.js +38 -0
- package/dist/angular/ds-chart-bar.d.ts +12 -0
- package/dist/angular/ds-chart-bar.js +38 -0
- package/dist/angular/ds-chart-donut.d.ts +19 -0
- package/dist/angular/ds-chart-donut.js +42 -0
- package/dist/angular/ds-chart-legend.d.ts +30 -0
- package/dist/angular/ds-chart-legend.js +45 -0
- package/dist/angular/ds-chart-line.d.ts +12 -0
- package/dist/angular/ds-chart-line.js +38 -0
- package/dist/angular/ds-checkbox.d.ts +15 -0
- package/dist/angular/ds-checkbox.js +42 -0
- package/dist/angular/ds-chip.d.ts +18 -0
- package/dist/angular/ds-chip.js +42 -0
- package/dist/angular/ds-divider.d.ts +12 -0
- package/dist/angular/ds-divider.js +38 -0
- package/dist/angular/ds-empty-state.d.ts +12 -0
- package/dist/angular/ds-empty-state.js +38 -0
- package/dist/angular/ds-field.d.ts +12 -0
- package/dist/angular/ds-field.js +38 -0
- package/dist/angular/ds-icon.d.ts +12 -0
- package/dist/angular/ds-icon.js +38 -0
- package/dist/angular/ds-input.d.ts +17 -0
- package/dist/angular/ds-input.js +46 -0
- package/dist/angular/ds-loader.d.ts +12 -0
- package/dist/angular/ds-loader.js +38 -0
- package/dist/angular/ds-menu.d.ts +24 -0
- package/dist/angular/ds-menu.js +48 -0
- package/dist/angular/ds-modal.d.ts +15 -0
- package/dist/angular/ds-modal.js +42 -0
- package/dist/angular/ds-pagination.d.ts +15 -0
- package/dist/angular/ds-pagination.js +42 -0
- package/dist/angular/ds-panel-nav.d.ts +42 -0
- package/dist/angular/ds-panel-nav.js +58 -0
- package/dist/angular/ds-panel-tools.d.ts +33 -0
- package/dist/angular/ds-panel-tools.js +49 -0
- package/dist/angular/ds-radio-group.d.ts +15 -0
- package/dist/angular/ds-radio-group.js +42 -0
- package/dist/angular/ds-select.d.ts +18 -0
- package/dist/angular/ds-select.js +42 -0
- package/dist/angular/ds-shell-gradient-picker.d.ts +16 -0
- package/dist/angular/ds-shell-gradient-picker.js +42 -0
- package/dist/angular/ds-shell-gradient-swatch.d.ts +16 -0
- package/dist/angular/ds-shell-gradient-swatch.js +42 -0
- package/dist/angular/ds-skeleton.d.ts +12 -0
- package/dist/angular/ds-skeleton.js +38 -0
- package/dist/angular/ds-slider.d.ts +15 -0
- package/dist/angular/ds-slider.js +42 -0
- package/dist/angular/ds-tab-group-nav.d.ts +20 -0
- package/dist/angular/ds-tab-group-nav.js +46 -0
- package/dist/angular/ds-tab-group.d.ts +15 -0
- package/dist/angular/ds-tab-group.js +42 -0
- package/dist/angular/ds-table.d.ts +33 -0
- package/dist/angular/ds-table.js +48 -0
- package/dist/angular/ds-tag.d.ts +12 -0
- package/dist/angular/ds-tag.js +38 -0
- package/dist/angular/ds-text.d.ts +12 -0
- package/dist/angular/ds-text.js +38 -0
- package/dist/angular/ds-toggle.d.ts +15 -0
- package/dist/angular/ds-toggle.js +42 -0
- package/dist/angular/ds-tooltip-data-viz.d.ts +12 -0
- package/dist/angular/ds-tooltip-data-viz.js +38 -0
- package/dist/angular/ds-tooltip.d.ts +12 -0
- package/dist/angular/ds-tooltip.js +38 -0
- package/dist/angular/index.d.ts +2 -0
- package/dist/angular/index.js +43 -0
- package/dist/angular/proxies.d.ts +44 -0
- package/dist/angular/proxies.js +45 -0
- package/dist/angular/radio-value-accessor.d.ts +8 -0
- package/dist/angular/radio-value-accessor.js +34 -0
- package/dist/angular/select-value-accessor.d.ts +8 -0
- package/dist/angular/select-value-accessor.js +34 -0
- package/dist/angular/text-value-accessor.d.ts +8 -0
- package/dist/angular/text-value-accessor.js +34 -0
- package/dist/angular/value-accessor.d.ts +18 -0
- package/dist/angular/value-accessor.js +39 -0
- package/dist/components/ds-app-shell.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-nav.js.map +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-card-data-viz-donut.js +1 -1
- package/dist/components/ds-card-data-viz-donut.js.map +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card-setting.js.map +1 -1
- package/dist/components/ds-chart-donut.js +1 -1
- package/dist/components/ds-chart-donut.js.map +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart-legend.js.map +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-checkbox.js.map +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-chip.js.map +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-empty-state.js.map +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-input.js.map +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-pagination.js.map +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-nav.js.map +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-panel-tools.js.map +1 -1
- package/dist/components/ds-radio-group.js +1 -1
- package/dist/components/ds-radio-group.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-select.js.map +1 -1
- package/dist/components/ds-shell-gradient-picker.js +1 -1
- package/dist/components/ds-shell-gradient-swatch.js +1 -1
- package/dist/components/ds-tab-group-nav.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-tab-group.js.map +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-toggle.js +1 -1
- package/dist/components/ds-toggle.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-BBpASejH.js +2 -0
- package/dist/components/p-BBpASejH.js.map +1 -0
- package/dist/components/{p-D0gBLLJx.js → p-BFiaUYu7.js} +2 -2
- package/dist/components/p-BFiaUYu7.js.map +1 -0
- package/dist/components/p-CTK82RIw.js +2 -0
- package/dist/components/p-CTK82RIw.js.map +1 -0
- package/dist/components/{p-BSNlp8Di.js → p-Cp86p-11.js} +2 -2
- package/dist/components/{p-BSNlp8Di.js.map → p-Cp86p-11.js.map} +1 -1
- package/dist/components/{p-vlwhuqVn.js → p-DHjjwgku.js} +2 -2
- package/dist/components/{p-vlwhuqVn.js.map → p-DHjjwgku.js.map} +1 -1
- package/dist/components/{p-boPMASaQ.js → p-DOEMwKBb.js} +2 -2
- package/dist/components/{p-boPMASaQ.js.map → p-DOEMwKBb.js.map} +1 -1
- package/dist/components/{p-Co2kLhWu.js → p-DolYlDbY.js} +2 -2
- package/dist/components/p-DolYlDbY.js.map +1 -0
- package/dist/components/p-NkAPA-Dz.js +2 -0
- package/dist/components/p-NkAPA-Dz.js.map +1 -0
- package/dist/framework/angular.d.ts +6 -0
- package/dist/framework/angular.js +6 -0
- package/dist/lib/nav/chrome-transition.d.ts +8 -0
- package/dist/lib/nav/index.js.map +2 -2
- package/dist/lib/utils/format-compact-number.d.ts +1 -1
- package/dist/lib/utils/index.js +8 -1
- package/dist/lib/utils/index.js.map +2 -2
- package/dist/react/components.d.ts +44 -0
- package/{src/react/components.ts → dist/react/components.js} +0 -1
- package/dist/react/ds-app-shell.d.ts +9 -0
- package/dist/react/ds-app-shell.js +12 -0
- package/dist/react/ds-badge.d.ts +9 -0
- package/dist/react/ds-badge.js +12 -0
- package/dist/react/ds-banner.d.ts +12 -0
- package/dist/react/ds-banner.js +12 -0
- package/dist/react/ds-bar-nav.d.ts +12 -0
- package/dist/react/ds-bar-nav.js +12 -0
- package/dist/react/ds-button-filled.d.ts +12 -0
- package/dist/react/ds-button-filled.js +12 -0
- package/dist/react/ds-button-unfilled.d.ts +13 -0
- package/dist/react/ds-button-unfilled.js +15 -0
- package/dist/react/ds-card-data-viz-donut.d.ts +12 -0
- package/dist/react/ds-card-data-viz-donut.js +12 -0
- package/dist/react/ds-card-setting.d.ts +12 -0
- package/dist/react/ds-card-setting.js +12 -0
- package/dist/react/ds-card.d.ts +9 -0
- package/dist/react/ds-card.js +12 -0
- package/dist/react/ds-chart-bar.d.ts +9 -0
- package/dist/react/ds-chart-bar.js +12 -0
- package/dist/react/ds-chart-donut.d.ts +12 -0
- package/dist/react/ds-chart-donut.js +12 -0
- package/dist/react/ds-chart-legend.d.ts +16 -0
- package/dist/react/ds-chart-legend.js +15 -0
- package/dist/react/ds-chart-line.d.ts +9 -0
- package/dist/react/ds-chart-line.js +12 -0
- package/dist/react/ds-checkbox.d.ts +12 -0
- package/dist/react/ds-checkbox.js +12 -0
- package/dist/react/ds-chip.d.ts +12 -0
- package/dist/react/ds-chip.js +12 -0
- package/dist/react/ds-divider.d.ts +9 -0
- package/dist/react/ds-divider.js +12 -0
- package/dist/react/ds-empty-state.d.ts +9 -0
- package/dist/react/ds-empty-state.js +12 -0
- package/dist/react/ds-field.d.ts +9 -0
- package/dist/react/ds-field.js +12 -0
- package/dist/react/ds-icon.d.ts +9 -0
- package/dist/react/ds-icon.js +12 -0
- package/dist/react/ds-input.d.ts +13 -0
- package/dist/react/ds-input.js +15 -0
- package/dist/react/ds-loader.d.ts +9 -0
- package/dist/react/ds-loader.js +12 -0
- package/dist/react/ds-menu.d.ts +14 -0
- package/dist/react/ds-menu.js +16 -0
- package/dist/react/ds-modal.d.ts +12 -0
- package/dist/react/ds-modal.js +12 -0
- package/dist/react/ds-pagination.d.ts +12 -0
- package/dist/react/ds-pagination.js +12 -0
- package/dist/react/ds-panel-nav.d.ts +17 -0
- package/dist/react/ds-panel-nav.js +19 -0
- package/dist/react/ds-panel-tools.d.ts +17 -0
- package/dist/react/ds-panel-tools.js +16 -0
- package/dist/react/ds-radio-group.d.ts +12 -0
- package/dist/react/ds-radio-group.js +12 -0
- package/dist/react/ds-select.d.ts +12 -0
- package/dist/react/ds-select.js +12 -0
- package/dist/react/ds-shell-gradient-picker.d.ts +12 -0
- package/dist/react/ds-shell-gradient-picker.js +12 -0
- package/dist/react/ds-shell-gradient-swatch.d.ts +12 -0
- package/dist/react/ds-shell-gradient-swatch.js +12 -0
- package/dist/react/ds-skeleton.d.ts +9 -0
- package/dist/react/ds-skeleton.js +12 -0
- package/dist/react/ds-slider.d.ts +12 -0
- package/dist/react/ds-slider.js +12 -0
- package/dist/react/ds-tab-group-nav.d.ts +13 -0
- package/dist/react/ds-tab-group-nav.js +15 -0
- package/dist/react/ds-tab-group.d.ts +12 -0
- package/dist/react/ds-tab-group.js +12 -0
- package/dist/react/ds-table.d.ts +21 -0
- package/dist/react/ds-table.js +16 -0
- package/dist/react/ds-tag.d.ts +9 -0
- package/dist/react/ds-tag.js +12 -0
- package/dist/react/ds-text.d.ts +9 -0
- package/dist/react/ds-text.js +12 -0
- package/dist/react/ds-toggle.d.ts +12 -0
- package/dist/react/ds-toggle.js +12 -0
- package/dist/react/ds-tooltip-data-viz.d.ts +9 -0
- package/dist/react/ds-tooltip-data-viz.js +12 -0
- package/dist/react/ds-tooltip.d.ts +9 -0
- package/dist/react/ds-tooltip.js +12 -0
- package/dist/types/components/BarNav/BarNav.d.ts +1 -0
- package/dist/types/components/ButtonFilled/ButtonFilled.d.ts +1 -1
- package/dist/types/components/ButtonUnfilled/ButtonUnfilled.d.ts +1 -1
- package/dist/types/components/CardDataVizDonut/CardDataVizDonut.d.ts +1 -0
- package/dist/types/components/CardSetting/CardSetting.d.ts +3 -0
- package/dist/types/components/ChartDonut/ChartDonut.d.ts +2 -0
- package/dist/types/components/ChartLegend/ChartLegend.d.ts +1 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/types/components/Chip/Chip.d.ts +2 -0
- package/dist/types/components/EmptyState/EmptyState.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +14 -1
- package/dist/types/components/Menu/Menu.d.ts +2 -0
- package/dist/types/components/Pagination/Pagination.d.ts +3 -0
- package/dist/types/components/PanelNav/PanelNav.d.ts +7 -0
- package/dist/types/components/PanelTools/PanelTools.d.ts +2 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +13 -1
- package/dist/types/components/Select/Select.d.ts +13 -1
- package/dist/types/components/ShellGradientPicker/ShellGradientPicker.d.ts +1 -0
- package/dist/types/components/ShellGradientSwatch/ShellGradientSwatch.d.ts +1 -1
- package/dist/types/components/TabGroup/TabGroup.d.ts +1 -1
- package/dist/types/components/TabGroupNav/TabGroupNav.d.ts +1 -1
- package/dist/types/components/Table/Table.d.ts +6 -0
- package/dist/types/components/Toggle/Toggle.d.ts +12 -0
- package/dist/types/components.d.ts +525 -30
- package/dist/types/nav/chrome-transition.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/format-compact-number.d.ts +1 -1
- package/package.json +58 -41
- package/dist/components/p-BiM6QBTF.js +0 -2
- package/dist/components/p-BiM6QBTF.js.map +0 -1
- package/dist/components/p-Co2kLhWu.js.map +0 -1
- package/dist/components/p-CsaW5gDM.js +0 -2
- package/dist/components/p-CsaW5gDM.js.map +0 -1
- package/dist/components/p-D0gBLLJx.js.map +0 -1
- package/dist/components/p-DEpLlQZK.js +0 -2
- package/dist/components/p-DEpLlQZK.js.map +0 -1
- package/src/angular/angular-component-lib/utils.ts +0 -65
- package/src/angular/index.ts +0 -45
- package/src/angular/proxies.ts +0 -1156
- package/src/react/ds-app-shell.ts +0 -26
- package/src/react/ds-badge.ts +0 -26
- package/src/react/ds-banner.ts +0 -27
- package/src/react/ds-bar-nav.ts +0 -27
- package/src/react/ds-button-filled.ts +0 -27
- package/src/react/ds-button-unfilled.ts +0 -33
- package/src/react/ds-card-data-viz-donut.ts +0 -27
- package/src/react/ds-card-setting.ts +0 -27
- package/src/react/ds-card.ts +0 -26
- package/src/react/ds-chart-bar.ts +0 -26
- package/src/react/ds-chart-donut.ts +0 -27
- package/src/react/ds-chart-legend.ts +0 -33
- package/src/react/ds-chart-line.ts +0 -26
- package/src/react/ds-checkbox.ts +0 -27
- package/src/react/ds-chip.ts +0 -27
- package/src/react/ds-divider.ts +0 -26
- package/src/react/ds-empty-state.ts +0 -26
- package/src/react/ds-field.ts +0 -26
- package/src/react/ds-icon.ts +0 -26
- package/src/react/ds-input.ts +0 -33
- package/src/react/ds-loader.ts +0 -26
- package/src/react/ds-menu.ts +0 -35
- package/src/react/ds-modal.ts +0 -27
- package/src/react/ds-pagination.ts +0 -27
- package/src/react/ds-panel-nav.ts +0 -41
- package/src/react/ds-panel-tools.ts +0 -35
- package/src/react/ds-radio-group.ts +0 -27
- package/src/react/ds-select.ts +0 -27
- package/src/react/ds-shell-gradient-picker.ts +0 -27
- package/src/react/ds-shell-gradient-swatch.ts +0 -27
- package/src/react/ds-skeleton.ts +0 -26
- package/src/react/ds-slider.ts +0 -27
- package/src/react/ds-tab-group-nav.ts +0 -33
- package/src/react/ds-tab-group.ts +0 -27
- package/src/react/ds-table.ts +0 -35
- package/src/react/ds-tag.ts +0 -26
- package/src/react/ds-text.ts +0 -26
- package/src/react/ds-toggle.ts +0 -27
- package/src/react/ds-tooltip-data-viz.ts +0 -26
- package/src/react/ds-tooltip.ts +0 -26
- package/src/wc/components/AppShell/AppShell.tsx +0 -377
- package/src/wc/components/Badge/Badge.tsx +0 -179
- package/src/wc/components/Badge/index.ts +0 -1
- package/src/wc/components/Banner/Banner.tsx +0 -156
- package/src/wc/components/BarNav/BarNav.tsx +0 -745
- package/src/wc/components/BarNav/bar-nav-dom-utils.ts +0 -23
- package/src/wc/components/BarNav/bar-nav-tabs-menu-utils.ts +0 -114
- package/src/wc/components/BarNav/bar-nav-types.ts +0 -3
- package/src/wc/components/BarNav/bar-nav-utils.ts +0 -67
- package/src/wc/components/BarNav/index.ts +0 -2
- package/src/wc/components/ButtonFilled/ButtonFilled.tsx +0 -171
- package/src/wc/components/ButtonFilled/index.ts +0 -7
- package/src/wc/components/ButtonUnfilled/ButtonUnfilled.tsx +0 -229
- package/src/wc/components/ButtonUnfilled/index.ts +0 -7
- package/src/wc/components/Card/Card.tsx +0 -78
- package/src/wc/components/Card/index.ts +0 -1
- package/src/wc/components/CardDataVizDonut/CardDataVizDonut.tsx +0 -108
- package/src/wc/components/CardDataVizDonut/index.ts +0 -1
- package/src/wc/components/CardSetting/CardSetting.tsx +0 -81
- package/src/wc/components/CardSetting/index.ts +0 -1
- package/src/wc/components/ChartBar/ChartBar.tsx +0 -88
- package/src/wc/components/ChartBar/index.ts +0 -1
- package/src/wc/components/ChartDonut/ChartDonut.tsx +0 -289
- package/src/wc/components/ChartDonut/index.ts +0 -1
- package/src/wc/components/ChartLegend/ChartLegend.tsx +0 -125
- package/src/wc/components/ChartLegend/index.ts +0 -2
- package/src/wc/components/ChartLine/ChartLine.tsx +0 -102
- package/src/wc/components/ChartLine/index.ts +0 -1
- package/src/wc/components/Checkbox/Checkbox.tsx +0 -60
- package/src/wc/components/Checkbox/index.ts +0 -1
- package/src/wc/components/Chip/Chip.tsx +0 -104
- package/src/wc/components/Chip/index.ts +0 -1
- package/src/wc/components/Divider/Divider.tsx +0 -107
- package/src/wc/components/Divider/index.ts +0 -2
- package/src/wc/components/EmptyState/EmptyState.tsx +0 -30
- package/src/wc/components/Field/Field.tsx +0 -30
- package/src/wc/components/Icon/Icon.tsx +0 -172
- package/src/wc/components/Icon/flag-icon-catalog.ts +0 -36
- package/src/wc/components/Icon/icon-cache.ts +0 -47
- package/src/wc/components/Icon/icon-svg.ts +0 -73
- package/src/wc/components/Icon/index.ts +0 -1
- package/src/wc/components/Icon/system-icon-catalog.ts +0 -401
- package/src/wc/components/Input/Input.tsx +0 -107
- package/src/wc/components/Input/index.ts +0 -1
- package/src/wc/components/Loader/Loader.tsx +0 -99
- package/src/wc/components/Loader/index.ts +0 -1
- package/src/wc/components/Menu/Menu.tsx +0 -437
- package/src/wc/components/Menu/menu-placement.ts +0 -26
- package/src/wc/components/Menu/menu-position.ts +0 -78
- package/src/wc/components/Menu/menu-types.ts +0 -39
- package/src/wc/components/Modal/Modal.tsx +0 -213
- package/src/wc/components/Pagination/Pagination.tsx +0 -97
- package/src/wc/components/PanelNav/PanelNav.tsx +0 -714
- package/src/wc/components/PanelNav/index.ts +0 -17
- package/src/wc/components/PanelNav/panel-nav-types.ts +0 -36
- package/src/wc/components/PanelNav/panel-nav-utils.ts +0 -79
- package/src/wc/components/PanelTools/PanelTools.tsx +0 -366
- package/src/wc/components/PanelTools/index.ts +0 -7
- package/src/wc/components/PanelTools/panel-tools-types.ts +0 -44
- package/src/wc/components/PanelTools/panel-tools-utils.ts +0 -50
- package/src/wc/components/RadioGroup/RadioGroup.tsx +0 -130
- package/src/wc/components/RadioGroup/index.ts +0 -1
- package/src/wc/components/Select/Select.tsx +0 -274
- package/src/wc/components/Select/index.ts +0 -1
- package/src/wc/components/ShellGradientPicker/ShellGradientPicker.tsx +0 -55
- package/src/wc/components/ShellGradientSwatch/ShellGradientSwatch.tsx +0 -69
- package/src/wc/components/ShellGradientSwatch/shell-gradient-swatch-types.ts +0 -17
- package/src/wc/components/Skeleton/Skeleton.tsx +0 -64
- package/src/wc/components/Skeleton/index.ts +0 -1
- package/src/wc/components/Slider/Slider.tsx +0 -76
- package/src/wc/components/Slider/index.ts +0 -1
- package/src/wc/components/TabGroup/TabGroup.tsx +0 -204
- package/src/wc/components/TabGroup/tab-item-utils.ts +0 -25
- package/src/wc/components/TabGroupNav/TabGroupNav.tsx +0 -347
- package/src/wc/components/Table/Table.tsx +0 -273
- package/src/wc/components/Tag/Tag.tsx +0 -63
- package/src/wc/components/Tag/index.ts +0 -1
- package/src/wc/components/Text/Text.tsx +0 -99
- package/src/wc/components/Text/index.ts +0 -12
- package/src/wc/components/Text/text-types.ts +0 -23
- package/src/wc/components/Text/text-utils.ts +0 -13
- package/src/wc/components/Toggle/Toggle.tsx +0 -43
- package/src/wc/components/Toggle/index.ts +0 -1
- package/src/wc/components/Tooltip/Tooltip.tsx +0 -413
- package/src/wc/components/TooltipDataViz/TooltipDataViz.tsx +0 -145
- package/src/wc/components/TooltipDataViz/index.ts +0 -1
- package/src/wc/components.d.ts +0 -3569
- package/src/wc/nav/badge-gradient-ring.ts +0 -109
- package/src/wc/nav/chrome-transition.ts +0 -62
- package/src/wc/nav/index.ts +0 -80
- package/src/wc/nav/nav-chrome.ts +0 -47
- package/src/wc/nav/shell-chrome-metrics.ts +0 -49
- package/src/wc/nav/shell-gradient-presets.ts +0 -60
- package/src/wc/nav/shell-gradient.ts +0 -94
- package/src/wc/nav/shell-shortcuts.ts +0 -63
- package/src/wc/nav/shell-view-transition.ts +0 -122
- package/src/wc/utils/chart-colors.ts +0 -7
- package/src/wc/utils/chart-types.ts +0 -25
- package/src/wc/utils/control-density.css +0 -43
- package/src/wc/utils/control-inactive.css +0 -20
- package/src/wc/utils/control-text.ts +0 -11
- package/src/wc/utils/control-width.css +0 -28
- package/src/wc/utils/control-width.ts +0 -10
- package/src/wc/utils/focus-ring.css +0 -33
- package/src/wc/utils/format-compact-number.ts +0 -27
- package/src/wc/utils/index.ts +0 -27
- package/src/wc/utils/interaction-fill.css +0 -162
- package/src/wc/utils/resolve-css-length-px.ts +0 -66
- package/src/wc/utils/resolve-css-time-ms.ts +0 -46
- package/src/wc/utils/scroll-edge-fade.css +0 -80
- package/src/wc/utils/scroll-edge-fade.ts +0 -148
- package/src/wc/utils/token-defaults.ts +0 -81
- package/src/wc/utils/truncate-svg-text.ts +0 -25
- package/src/wc/utils/typography.css +0 -146
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Component, h, Host, Prop } from '@stencil/core';
|
|
2
|
-
|
|
3
|
-
export type CardWidth = 'sm' | 'md' | 'lg';
|
|
4
|
-
|
|
5
|
-
/** Visual chrome recipe — default app surface, or settings edit wash. */
|
|
6
|
-
export type CardAppearance = 'default' | 'editing';
|
|
7
|
-
|
|
8
|
-
const CARD_WIDTH_VARS: Record<CardWidth, string> = {
|
|
9
|
-
sm: 'var(--dimension-card-width-sm)',
|
|
10
|
-
md: 'var(--dimension-card-width-md)',
|
|
11
|
-
lg: 'var(--dimension-card-width-lg)',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const CARD_HEIGHT_VARS: Record<CardWidth, string> = {
|
|
15
|
-
sm: 'var(--dimension-card-height-sm)',
|
|
16
|
-
md: 'var(--dimension-card-height-md)',
|
|
17
|
-
lg: 'var(--dimension-card-height-lg)',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const FAINT_BRAND_TITLE_COLOR = 'var(--color-foreground-faint-brand)';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Shared card chrome — width + matching min-height tokens, header (title + actions),
|
|
24
|
-
* and a flex body that fills leftover space. Compose this from settings / data-viz cards.
|
|
25
|
-
*/
|
|
26
|
-
@Component({
|
|
27
|
-
tag: 'ds-card',
|
|
28
|
-
styleUrl: 'Card.css',
|
|
29
|
-
scoped: true,
|
|
30
|
-
})
|
|
31
|
-
export class Card {
|
|
32
|
-
/** Section heading shown in the card header. */
|
|
33
|
-
@Prop() heading!: string;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Card width token (`sm` / `md` / `lg`). Also sets host `min-height` to the
|
|
37
|
-
* matching `--dimension-card-height-*` so empty bodies still fill the card.
|
|
38
|
-
*/
|
|
39
|
-
@Prop() cardWidth: CardWidth = 'md';
|
|
40
|
-
|
|
41
|
-
/** Chrome recipe — `editing` applies the settings edit wash. */
|
|
42
|
-
@Prop() appearance: CardAppearance = 'default';
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
const editing = this.appearance === 'editing';
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Host
|
|
49
|
-
class={{
|
|
50
|
-
card: true,
|
|
51
|
-
'card--editing': editing,
|
|
52
|
-
}}
|
|
53
|
-
style={{
|
|
54
|
-
'--_card-width': CARD_WIDTH_VARS[this.cardWidth],
|
|
55
|
-
'--_card-min-height': CARD_HEIGHT_VARS[this.cardWidth],
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
<header class="card__header">
|
|
59
|
-
<ds-text
|
|
60
|
-
class="card__title"
|
|
61
|
-
variant="text-title-small"
|
|
62
|
-
emphasis
|
|
63
|
-
color={editing ? FAINT_BRAND_TITLE_COLOR : 'primary'}
|
|
64
|
-
as="h2"
|
|
65
|
-
>
|
|
66
|
-
{this.heading}
|
|
67
|
-
</ds-text>
|
|
68
|
-
<div class="card__actions">
|
|
69
|
-
<slot name="actions" />
|
|
70
|
-
</div>
|
|
71
|
-
</header>
|
|
72
|
-
<div class="card__body">
|
|
73
|
-
<slot />
|
|
74
|
-
</div>
|
|
75
|
-
</Host>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CardWidth, CardAppearance } from './Card';
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Component, Element, Event, EventEmitter, State, h, Host, Prop } from '@stencil/core';
|
|
2
|
-
import type { CardWidth } from '../Card/Card';
|
|
3
|
-
|
|
4
|
-
export type CardDataVizDonutWidth = CardWidth;
|
|
5
|
-
|
|
6
|
-
/** Matches the `dsSliceHover`/`dsItemHover` detail shape emitted by `ds-chart-*` and `ds-chart-legend`. */
|
|
7
|
-
type HoveredDatum = { label: string } | null;
|
|
8
|
-
|
|
9
|
-
/** A slotted chart/legend that opts into hover sync by exposing an `activeLabel` prop. */
|
|
10
|
-
type SyncableSlot = HTMLElement & { activeLabel?: string | null };
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Donut data-viz card — shared `ds-card` chrome with a fill chart region and
|
|
14
|
-
* content-sized legend. Hover sync between chart and legend stays here.
|
|
15
|
-
*/
|
|
16
|
-
@Component({
|
|
17
|
-
tag: 'ds-card-data-viz-donut',
|
|
18
|
-
styleUrl: 'CardDataVizDonut.css',
|
|
19
|
-
scoped: true,
|
|
20
|
-
})
|
|
21
|
-
export class CardDataVizDonut {
|
|
22
|
-
@Element() el!: HTMLElement;
|
|
23
|
-
|
|
24
|
-
/** Widget heading shown in the card header. */
|
|
25
|
-
@Prop() heading!: string;
|
|
26
|
-
|
|
27
|
-
/** Card width token — also sets matching min-height. */
|
|
28
|
-
@Prop() cardWidth: CardDataVizDonutWidth = 'md';
|
|
29
|
-
|
|
30
|
-
/** Emits when the header filter control is activated. */
|
|
31
|
-
@Event() dsFilterClick!: EventEmitter<void>;
|
|
32
|
-
|
|
33
|
-
// Scoped (light-DOM) components have no native slot projection to detect emptiness from CSS —
|
|
34
|
-
// check the actual children so an unused region (e.g. no legend) doesn't render a dangling
|
|
35
|
-
// padded box plus a body gap next to nothing.
|
|
36
|
-
@State() private hasChartSlot = false;
|
|
37
|
-
@State() private hasLegendSlot = false;
|
|
38
|
-
|
|
39
|
-
componentWillRender() {
|
|
40
|
-
// Not `:scope >` — Stencil's scoped slot polyfill relocates slotted children into
|
|
41
|
-
// region wrappers (and here into nested `ds-card`), so they may not stay direct
|
|
42
|
-
// host children across renders.
|
|
43
|
-
this.hasChartSlot = !!this.el.querySelector('[slot="chart"]');
|
|
44
|
-
this.hasLegendSlot = !!this.el.querySelector('[slot="legend"]');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
componentDidLoad() {
|
|
48
|
-
// Sync the chart's and legend's `activeLabel` from each other's hover events, so any
|
|
49
|
-
// ds-chart-donut + ds-chart-legend pair cross-highlights without every consumer having to
|
|
50
|
-
// wire it up by hand. Delegated on the host (rather than bound to the specific slotted
|
|
51
|
-
// elements) since Stencil events bubble and the slot content can be swapped at runtime.
|
|
52
|
-
this.el.addEventListener('dsSliceHover', this.handleChartHover);
|
|
53
|
-
this.el.addEventListener('dsItemHover', this.handleLegendHover);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
disconnectedCallback() {
|
|
57
|
-
this.el.removeEventListener('dsSliceHover', this.handleChartHover);
|
|
58
|
-
this.el.removeEventListener('dsItemHover', this.handleLegendHover);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
private handleChartHover = (e: Event) => {
|
|
62
|
-
// Not `:scope >` — Stencil's slot polyfill for scoped (non-shadow) components relocates
|
|
63
|
-
// slotted children into an inner region wrapper on render, so they're no longer direct
|
|
64
|
-
// children of the host by the time this fires.
|
|
65
|
-
const legend = this.el.querySelector('[slot="legend"]') as SyncableSlot | null;
|
|
66
|
-
if (!legend || !('activeLabel' in legend)) return;
|
|
67
|
-
legend.activeLabel = (e as CustomEvent<HoveredDatum>).detail?.label ?? null;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
private handleLegendHover = (e: Event) => {
|
|
71
|
-
const chart = this.el.querySelector('[slot="chart"]') as SyncableSlot | null;
|
|
72
|
-
if (!chart || !('activeLabel' in chart)) return;
|
|
73
|
-
chart.activeLabel = (e as CustomEvent<HoveredDatum>).detail?.label ?? null;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
private handleFilterClick = () => {
|
|
77
|
-
this.dsFilterClick.emit();
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
render() {
|
|
81
|
-
return (
|
|
82
|
-
<Host class="card-data-viz-donut">
|
|
83
|
-
<ds-card heading={this.heading} cardWidth={this.cardWidth}>
|
|
84
|
-
<ds-button-unfilled
|
|
85
|
-
slot="actions"
|
|
86
|
-
variant="icon"
|
|
87
|
-
type="button"
|
|
88
|
-
icon="Filters"
|
|
89
|
-
aria-label="Filter"
|
|
90
|
-
onDsClick={this.handleFilterClick}
|
|
91
|
-
/>
|
|
92
|
-
<div class="card-data-viz-donut__layout">
|
|
93
|
-
{this.hasChartSlot && (
|
|
94
|
-
<div class="card-data-viz-donut__chart-region">
|
|
95
|
-
<slot name="chart" />
|
|
96
|
-
</div>
|
|
97
|
-
)}
|
|
98
|
-
{this.hasLegendSlot && (
|
|
99
|
-
<div class="card-data-viz-donut__legend-region">
|
|
100
|
-
<slot name="legend" />
|
|
101
|
-
</div>
|
|
102
|
-
)}
|
|
103
|
-
</div>
|
|
104
|
-
</ds-card>
|
|
105
|
-
</Host>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CardDataVizDonutWidth } from './CardDataVizDonut';
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';
|
|
2
|
-
import type { CardWidth } from '../Card/Card';
|
|
3
|
-
|
|
4
|
-
export type CardSettingWidth = CardWidth;
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
tag: 'ds-card-setting',
|
|
8
|
-
styleUrl: 'CardSetting.css',
|
|
9
|
-
scoped: true,
|
|
10
|
-
})
|
|
11
|
-
export class CardSetting {
|
|
12
|
-
/** Section heading shown in the card header. */
|
|
13
|
-
@Prop() heading!: string;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Card width token (`sm` / `md` / `lg`). Also sets host `min-height` to the
|
|
17
|
-
* matching `--dimension-card-height-*` so the body fills available space
|
|
18
|
-
* even when the slot is empty.
|
|
19
|
-
*/
|
|
20
|
-
@Prop() cardWidth: CardSettingWidth = 'md';
|
|
21
|
-
|
|
22
|
-
/** Controlled edit state — parent owns single-edit orchestration. */
|
|
23
|
-
@Prop() editing = false;
|
|
24
|
-
|
|
25
|
-
/** Emits when the user enters or exits edit mode. */
|
|
26
|
-
@Event() dsEditingChange!: EventEmitter<boolean>;
|
|
27
|
-
|
|
28
|
-
private enterEdit = () => {
|
|
29
|
-
this.dsEditingChange.emit(true);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
private exitEdit = () => {
|
|
33
|
-
this.dsEditingChange.emit(false);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
render() {
|
|
37
|
-
const editing = this.editing;
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Host class="card-setting">
|
|
41
|
-
<ds-card
|
|
42
|
-
heading={this.heading}
|
|
43
|
-
cardWidth={this.cardWidth}
|
|
44
|
-
appearance={editing ? 'editing' : 'default'}
|
|
45
|
-
>
|
|
46
|
-
{!editing ? (
|
|
47
|
-
<ds-button-unfilled
|
|
48
|
-
slot="actions"
|
|
49
|
-
variant="icon"
|
|
50
|
-
type="button"
|
|
51
|
-
icon="Pencil"
|
|
52
|
-
aria-label="Edit"
|
|
53
|
-
onDsClick={this.enterEdit}
|
|
54
|
-
/>
|
|
55
|
-
) : (
|
|
56
|
-
<div slot="actions" class="card-setting__actions">
|
|
57
|
-
<ds-button-unfilled
|
|
58
|
-
variant="icon"
|
|
59
|
-
type="button"
|
|
60
|
-
icon="Cross"
|
|
61
|
-
backgroundContrast="bold"
|
|
62
|
-
aria-label="Cancel"
|
|
63
|
-
onDsClick={this.exitEdit}
|
|
64
|
-
/>
|
|
65
|
-
<ds-button-filled
|
|
66
|
-
variant="icon"
|
|
67
|
-
type="button"
|
|
68
|
-
icon="Check"
|
|
69
|
-
intent="brand"
|
|
70
|
-
contrast="faint"
|
|
71
|
-
aria-label="Save"
|
|
72
|
-
onDsClick={this.exitEdit}
|
|
73
|
-
/>
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
76
|
-
<slot />
|
|
77
|
-
</ds-card>
|
|
78
|
-
</Host>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CardSettingWidth } from './CardSetting';
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Component, Prop, h, Host } from '@stencil/core';
|
|
2
|
-
import { scaleBand, scaleLinear } from 'd3-scale';
|
|
3
|
-
import { max } from 'd3-array';
|
|
4
|
-
import { categoryColor } from '../../utils/chart-colors';
|
|
5
|
-
import type { ChartDatum } from '../../utils/chart-types';
|
|
6
|
-
|
|
7
|
-
const MARGIN = { top: 16, right: 16, bottom: 24, left: 32 };
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
tag: 'ds-chart-bar',
|
|
11
|
-
styleUrl: 'ChartBar.css',
|
|
12
|
-
scoped: true,
|
|
13
|
-
})
|
|
14
|
-
export class ChartBar {
|
|
15
|
-
/** Bars to render. Set as a JS property (not an HTML attribute). */
|
|
16
|
-
@Prop() data: ChartDatum[] = [];
|
|
17
|
-
@Prop() width: number = 480;
|
|
18
|
-
@Prop() height: number = 240;
|
|
19
|
-
|
|
20
|
-
render() {
|
|
21
|
-
const innerWidth = this.width - MARGIN.left - MARGIN.right;
|
|
22
|
-
const innerHeight = this.height - MARGIN.top - MARGIN.bottom;
|
|
23
|
-
|
|
24
|
-
const yMax = max(this.data, d => d.value) ?? 0;
|
|
25
|
-
|
|
26
|
-
const xScale = scaleBand()
|
|
27
|
-
.domain(this.data.map(d => d.label))
|
|
28
|
-
.range([0, innerWidth])
|
|
29
|
-
.padding(0.35);
|
|
30
|
-
|
|
31
|
-
const yScale = scaleLinear()
|
|
32
|
-
.domain([0, yMax || 1])
|
|
33
|
-
.range([innerHeight, 0])
|
|
34
|
-
.nice();
|
|
35
|
-
|
|
36
|
-
const yTicks = yScale.ticks(4);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Host class="chart-bar">
|
|
40
|
-
<svg
|
|
41
|
-
class="chart-bar__svg"
|
|
42
|
-
viewBox={`0 0 ${this.width} ${this.height}`}
|
|
43
|
-
width={this.width}
|
|
44
|
-
height={this.height}
|
|
45
|
-
role="img"
|
|
46
|
-
aria-label={this.data.map(d => `${d.label}: ${d.value}`).join(', ')}
|
|
47
|
-
>
|
|
48
|
-
<g transform={`translate(${MARGIN.left}, ${MARGIN.top})`}>
|
|
49
|
-
{yTicks.map(tick => (
|
|
50
|
-
<g key={`grid-${tick}`} transform={`translate(0, ${yScale(tick)})`}>
|
|
51
|
-
<line class="chart-bar__gridline" x1={0} x2={innerWidth} />
|
|
52
|
-
<text class="chart-bar__axis-label" x={-8} text-anchor="end" dominant-baseline="middle">
|
|
53
|
-
{tick}
|
|
54
|
-
</text>
|
|
55
|
-
</g>
|
|
56
|
-
))}
|
|
57
|
-
|
|
58
|
-
{this.data.map((d, i) => {
|
|
59
|
-
const barWidth = xScale.bandwidth();
|
|
60
|
-
const barX = xScale(d.label) ?? 0;
|
|
61
|
-
const barY = yScale(d.value);
|
|
62
|
-
return (
|
|
63
|
-
<g key={d.label}>
|
|
64
|
-
<rect
|
|
65
|
-
class="chart-bar__bar"
|
|
66
|
-
x={barX}
|
|
67
|
-
y={barY}
|
|
68
|
-
width={barWidth}
|
|
69
|
-
height={innerHeight - barY}
|
|
70
|
-
fill={d.color ?? categoryColor(i)}
|
|
71
|
-
/>
|
|
72
|
-
<text
|
|
73
|
-
class="chart-bar__axis-label"
|
|
74
|
-
x={barX + barWidth / 2}
|
|
75
|
-
y={innerHeight + 16}
|
|
76
|
-
text-anchor="middle"
|
|
77
|
-
>
|
|
78
|
-
{d.label}
|
|
79
|
-
</text>
|
|
80
|
-
</g>
|
|
81
|
-
);
|
|
82
|
-
})}
|
|
83
|
-
</g>
|
|
84
|
-
</svg>
|
|
85
|
-
</Host>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { ChartDatum } from '../../utils/chart-types';
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { Component, Prop, State, Event, EventEmitter, Element, Watch, h, Host } from '@stencil/core';
|
|
2
|
-
import { arc, pie } from 'd3-shape';
|
|
3
|
-
import { categoryColor } from '../../utils/chart-colors';
|
|
4
|
-
import { formatCompactNumber, resolveCssLengthPx, truncateSvgTextToWidth, TOKEN_DEFAULTS } from '../../utils';
|
|
5
|
-
import type { ChartDatum } from '../../utils/chart-types';
|
|
6
|
-
|
|
7
|
-
const DIMMED_OPACITY = 0.25;
|
|
8
|
-
/** Gap between the center value and caption line boxes. */
|
|
9
|
-
const CENTER_GAP_PX = 0;
|
|
10
|
-
/** Fraction of the inner-circle diameter center text is allowed to use before truncating. */
|
|
11
|
-
const CENTER_TEXT_SAFE_WIDTH_RATIO = 0.82;
|
|
12
|
-
/** Fallback when filling before the first ResizeObserver measurement (matches fill min). */
|
|
13
|
-
const FILL_FALLBACK_PX = 128;
|
|
14
|
-
|
|
15
|
-
@Component({
|
|
16
|
-
tag: 'ds-chart-donut',
|
|
17
|
-
styleUrl: 'ChartDonut.css',
|
|
18
|
-
scoped: true,
|
|
19
|
-
})
|
|
20
|
-
export class ChartDonut {
|
|
21
|
-
@Element() el!: HTMLElement;
|
|
22
|
-
|
|
23
|
-
/** Slices to render. Set as a JS property (not an HTML attribute). */
|
|
24
|
-
@Prop() data: ChartDatum[] = [];
|
|
25
|
-
/**
|
|
26
|
-
* Explicit diameter in px. When unset, the donut sizes to its container
|
|
27
|
-
* (ResizeObserver) clamped between `--dimension-size-base * 16` (128px) and
|
|
28
|
-
* `* 24` (192px), and stays centered in the leftover space. Prefer unset
|
|
29
|
-
* inside card layouts.
|
|
30
|
-
*/
|
|
31
|
-
@Prop() size: number | undefined;
|
|
32
|
-
/** Ring thickness — number (px) or TokoMo length. Defaults to `--dimension-size-200` (16px). */
|
|
33
|
-
@Prop() thickness: number | string = TOKEN_DEFAULTS.size200;
|
|
34
|
-
/** Corner radius on each slice — number (px) or TokoMo length. Defaults to `--dimension-radius-025` (2px). */
|
|
35
|
-
@Prop() cornerRadius: number | string = TOKEN_DEFAULTS.radius025;
|
|
36
|
-
/** Gap between slices, in degrees. */
|
|
37
|
-
@Prop() gap: number = 1;
|
|
38
|
-
/** Primary center value; defaults to the sum of `data` values (e.g. "187", "40.9%"). */
|
|
39
|
-
@Prop() centerValue: string | undefined;
|
|
40
|
-
/** Secondary caption below the center value (e.g. "Total", "Normal"). Rendered uppercase. */
|
|
41
|
-
@Prop() centerCaption: string | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Externally controlled highlight, matched by `label` — e.g. drive this from a sibling
|
|
44
|
-
* `ds-chart-legend`'s `dsItemHover` event to keep chart and legend hover in sync.
|
|
45
|
-
* Falls back to this component's own pointer/focus hover when unset.
|
|
46
|
-
* Slice hover dims peer slices and emits `dsSliceHover` for legend sync — no data-viz
|
|
47
|
-
* tooltip (the legend already surfaces label/value).
|
|
48
|
-
*/
|
|
49
|
-
@Prop() activeLabel: string | null = null;
|
|
50
|
-
|
|
51
|
-
@State() private hoveredLabel: string | null = null;
|
|
52
|
-
/** Center text, truncated with an ellipsis if it doesn't fit inside the inner circle. */
|
|
53
|
-
@State() private displayedValueText: string = '';
|
|
54
|
-
@State() private displayedCaptionText: string = '';
|
|
55
|
-
/** Measured fill diameter when `size` is unset. */
|
|
56
|
-
@State() private measuredSize: number = FILL_FALLBACK_PX;
|
|
57
|
-
|
|
58
|
-
/** Fires with the hovered/focused slice's datum, or `null` on leave/blur. */
|
|
59
|
-
@Event() dsSliceHover!: EventEmitter<ChartDatum | null>;
|
|
60
|
-
|
|
61
|
-
private valueTextEl?: SVGTextElement;
|
|
62
|
-
private captionTextEl?: SVGTextElement;
|
|
63
|
-
private resizeObserver: ResizeObserver | null = null;
|
|
64
|
-
|
|
65
|
-
private get isFillMode(): boolean {
|
|
66
|
-
return this.size == null || !Number.isFinite(this.size) || this.size <= 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
private get fillMinPx(): number {
|
|
70
|
-
return resolveCssLengthPx(TOKEN_DEFAULTS.donutFillMin, FILL_FALLBACK_PX);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
private get fillMaxPx(): number {
|
|
74
|
-
return resolveCssLengthPx(TOKEN_DEFAULTS.donutFillMax, 192);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** Clamp available square side into the fill min/max band. */
|
|
78
|
-
private clampFillSize(availablePx: number): number {
|
|
79
|
-
const minPx = this.fillMinPx;
|
|
80
|
-
const maxPx = this.fillMaxPx;
|
|
81
|
-
if (!(availablePx > 0)) return minPx;
|
|
82
|
-
return Math.round(Math.min(maxPx, Math.max(minPx, availablePx)));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
private get resolvedSize(): number {
|
|
86
|
-
if (!this.isFillMode) return this.size as number;
|
|
87
|
-
return this.clampFillSize(this.measuredSize);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
componentDidLoad() {
|
|
91
|
-
this.syncResizeObserver();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@Watch('size')
|
|
95
|
-
onSizePropChange() {
|
|
96
|
-
this.syncResizeObserver();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
disconnectedCallback() {
|
|
100
|
-
this.teardownResizeObserver();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
private syncResizeObserver() {
|
|
104
|
-
this.teardownResizeObserver();
|
|
105
|
-
if (!this.isFillMode) return;
|
|
106
|
-
// Observe the host (which fills its parent), not the wrapper — the wrapper
|
|
107
|
-
// only wraps the SVG and would collapse to the clamped size, locking fill at min.
|
|
108
|
-
const target = this.el;
|
|
109
|
-
if (!target || typeof ResizeObserver === 'undefined') return;
|
|
110
|
-
|
|
111
|
-
this.resizeObserver = new ResizeObserver(entries => {
|
|
112
|
-
const entry = entries[0];
|
|
113
|
-
if (!entry) return;
|
|
114
|
-
this.applyAvailableSize(entry.contentRect.width, entry.contentRect.height);
|
|
115
|
-
});
|
|
116
|
-
this.resizeObserver.observe(target);
|
|
117
|
-
this.measureHost();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
private measureHost() {
|
|
121
|
-
const rect = this.el.getBoundingClientRect();
|
|
122
|
-
this.applyAvailableSize(rect.width, rect.height);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
private applyAvailableSize(width: number, height: number) {
|
|
126
|
-
const available = Math.floor(Math.min(width, height));
|
|
127
|
-
if (available > 0 && available !== this.measuredSize) {
|
|
128
|
-
this.measuredSize = available;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
private teardownResizeObserver() {
|
|
133
|
-
this.resizeObserver?.disconnect();
|
|
134
|
-
this.resizeObserver = null;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
private handleHover(datum: ChartDatum | null) {
|
|
138
|
-
this.hoveredLabel = datum?.label ?? null;
|
|
139
|
-
this.dsSliceHover.emit(datum);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
componentDidRender() {
|
|
143
|
-
// Re-bind after HMR when DidLoad's observer was dropped.
|
|
144
|
-
if (this.isFillMode && !this.resizeObserver) {
|
|
145
|
-
this.syncResizeObserver();
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const size = this.resolvedSize;
|
|
149
|
-
const radius = size / 2;
|
|
150
|
-
const thicknessPx = resolveCssLengthPx(this.thickness, TOKEN_DEFAULTS.size200);
|
|
151
|
-
const innerRadius = radius - thicknessPx;
|
|
152
|
-
const maxWidth = innerRadius * 2 * CENTER_TEXT_SAFE_WIDTH_RATIO;
|
|
153
|
-
const total = this.data.reduce((sum, d) => sum + d.value, 0);
|
|
154
|
-
|
|
155
|
-
const fullValueText = this.centerValue ?? formatCompactNumber(total);
|
|
156
|
-
if (this.valueTextEl) {
|
|
157
|
-
const truncated = truncateSvgTextToWidth(this.valueTextEl, fullValueText, maxWidth);
|
|
158
|
-
if (truncated !== this.displayedValueText) this.displayedValueText = truncated;
|
|
159
|
-
else this.valueTextEl.textContent = truncated;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const fullCaptionText = this.centerCaption ?? '';
|
|
163
|
-
if (this.captionTextEl && fullCaptionText) {
|
|
164
|
-
const truncated = truncateSvgTextToWidth(this.captionTextEl, fullCaptionText, maxWidth);
|
|
165
|
-
if (truncated !== this.displayedCaptionText) this.displayedCaptionText = truncated;
|
|
166
|
-
else this.captionTextEl.textContent = truncated;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
render() {
|
|
171
|
-
const size = this.resolvedSize;
|
|
172
|
-
const radius = size / 2;
|
|
173
|
-
const thicknessPx = resolveCssLengthPx(this.thickness, TOKEN_DEFAULTS.size200);
|
|
174
|
-
const cornerRadiusPx = resolveCssLengthPx(this.cornerRadius, TOKEN_DEFAULTS.radius025);
|
|
175
|
-
const innerRadius = radius - thicknessPx;
|
|
176
|
-
const total = this.data.reduce((sum, d) => sum + d.value, 0);
|
|
177
|
-
// d3's pie() divides each value by the total to get an angle — with an all-zero total
|
|
178
|
-
// that's 0/0, producing NaN angles and broken paths. Render a flat neutral ring instead.
|
|
179
|
-
const isEmpty = total <= 0;
|
|
180
|
-
// Highlight/dim from either this component's own hover or an externally-synced label
|
|
181
|
-
// (e.g. a sibling ds-chart-legend row).
|
|
182
|
-
const highlightLabel = this.activeLabel ?? this.hoveredLabel;
|
|
183
|
-
|
|
184
|
-
const arcGenerator = arc<{ startAngle: number; endAngle: number }>()
|
|
185
|
-
.innerRadius(innerRadius)
|
|
186
|
-
.outerRadius(radius)
|
|
187
|
-
.cornerRadius(cornerRadiusPx)
|
|
188
|
-
.padAngle((this.gap * Math.PI) / 180);
|
|
189
|
-
|
|
190
|
-
const slices = isEmpty
|
|
191
|
-
? []
|
|
192
|
-
: pie<ChartDatum>()
|
|
193
|
-
.value(d => d.value)
|
|
194
|
-
.sort(null)(this.data);
|
|
195
|
-
|
|
196
|
-
const emptyRingPath = isEmpty
|
|
197
|
-
? arc<{ startAngle: number; endAngle: number }>()
|
|
198
|
-
.innerRadius(innerRadius)
|
|
199
|
-
.outerRadius(radius)({ startAngle: 0, endAngle: Math.PI * 2 })
|
|
200
|
-
: null;
|
|
201
|
-
|
|
202
|
-
// Precise vertical centering for the two-line center text, using the real line-height of
|
|
203
|
-
// text-title-large (value) and text-body-medium (caption) rather than eyeballed em offsets.
|
|
204
|
-
const valueLineHeight = resolveCssLengthPx(TOKEN_DEFAULTS.lineheightXl, 32);
|
|
205
|
-
const captionLineHeight = resolveCssLengthPx(TOKEN_DEFAULTS.lineheightMd, 20);
|
|
206
|
-
const centerValueY = this.centerCaption ? radius - (CENTER_GAP_PX + captionLineHeight) / 2 : radius;
|
|
207
|
-
const centerCaptionY = radius + (valueLineHeight + CENTER_GAP_PX) / 2;
|
|
208
|
-
|
|
209
|
-
// Show the full text before the post-render truncation pass has measured it (avoids a blank first paint).
|
|
210
|
-
const fullValueText = this.centerValue ?? formatCompactNumber(total);
|
|
211
|
-
const fullCaptionText = this.centerCaption ?? '';
|
|
212
|
-
const fill = this.isFillMode;
|
|
213
|
-
|
|
214
|
-
return (
|
|
215
|
-
<Host
|
|
216
|
-
class={{
|
|
217
|
-
'chart-donut': true,
|
|
218
|
-
'chart-donut--fill': fill,
|
|
219
|
-
'chart-donut--fixed': !fill,
|
|
220
|
-
}}
|
|
221
|
-
style={!fill ? { width: `${size}px`, height: `${size}px` } : undefined}
|
|
222
|
-
>
|
|
223
|
-
<div
|
|
224
|
-
class="chart-donut__wrapper"
|
|
225
|
-
style={!fill ? { width: `${size}px`, height: `${size}px` } : undefined}
|
|
226
|
-
>
|
|
227
|
-
<svg
|
|
228
|
-
class="chart-donut__svg"
|
|
229
|
-
viewBox={`0 0 ${size} ${size}`}
|
|
230
|
-
width={size}
|
|
231
|
-
height={size}
|
|
232
|
-
>
|
|
233
|
-
<g transform={`translate(${radius}, ${radius})`}>
|
|
234
|
-
{isEmpty ? (
|
|
235
|
-
<path d={emptyRingPath ?? undefined} fill="var(--color-background-faint-neutral)" aria-label="No data" />
|
|
236
|
-
) : (
|
|
237
|
-
slices.map((slice, i) => {
|
|
238
|
-
const datum = this.data[i];
|
|
239
|
-
const isDimmed = highlightLabel != null && datum.label !== highlightLabel;
|
|
240
|
-
return (
|
|
241
|
-
<path
|
|
242
|
-
key={datum.label}
|
|
243
|
-
d={arcGenerator(slice) ?? undefined}
|
|
244
|
-
fill={datum.color ?? categoryColor(i)}
|
|
245
|
-
opacity={isDimmed ? DIMMED_OPACITY : 1}
|
|
246
|
-
tabindex={0}
|
|
247
|
-
role="img"
|
|
248
|
-
aria-label={`${datum.label}: ${datum.value}`}
|
|
249
|
-
onMouseEnter={() => this.handleHover(datum)}
|
|
250
|
-
onMouseLeave={() => this.handleHover(null)}
|
|
251
|
-
onFocus={() => this.handleHover(datum)}
|
|
252
|
-
onBlur={() => this.handleHover(null)}
|
|
253
|
-
/>
|
|
254
|
-
);
|
|
255
|
-
})
|
|
256
|
-
)}
|
|
257
|
-
</g>
|
|
258
|
-
<text
|
|
259
|
-
class="chart-donut__center-value"
|
|
260
|
-
x={radius}
|
|
261
|
-
y={centerValueY}
|
|
262
|
-
text-anchor="middle"
|
|
263
|
-
dominant-baseline="central"
|
|
264
|
-
ref={el => {
|
|
265
|
-
this.valueTextEl = (el as SVGTextElement) ?? undefined;
|
|
266
|
-
}}
|
|
267
|
-
>
|
|
268
|
-
{this.displayedValueText || fullValueText}
|
|
269
|
-
</text>
|
|
270
|
-
{fullCaptionText && (
|
|
271
|
-
<text
|
|
272
|
-
class="chart-donut__center-caption"
|
|
273
|
-
x={radius}
|
|
274
|
-
y={centerCaptionY}
|
|
275
|
-
text-anchor="middle"
|
|
276
|
-
dominant-baseline="central"
|
|
277
|
-
ref={el => {
|
|
278
|
-
this.captionTextEl = (el as SVGTextElement) ?? undefined;
|
|
279
|
-
}}
|
|
280
|
-
>
|
|
281
|
-
{this.displayedCaptionText || fullCaptionText}
|
|
282
|
-
</text>
|
|
283
|
-
)}
|
|
284
|
-
</svg>
|
|
285
|
-
</div>
|
|
286
|
-
</Host>
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { ChartDatum } from '../../utils/chart-types';
|