@ds-mo/ui 3.0.0 → 3.1.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/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-badge.js +1 -1
- package/dist/components/ds-banner.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-card.js +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-field.js +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-modal.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-slider.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-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-toggle.js +1 -1
- package/dist/components/ds-toggle.js.map +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-tooltip.js +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-V2qW8NL0.js → p-BFiaUYu7.js} +2 -2
- package/dist/components/p-BFiaUYu7.js.map +1 -0
- package/dist/components/p-BOQRM49Q.js +2 -0
- package/dist/components/{p-sBx2MuF2.js.map → p-BOQRM49Q.js.map} +1 -1
- 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-DQ3l2TXw.js → p-DEgY_Lnb.js} +2 -2
- package/dist/components/{p-CNgNgezy.js → p-DHjjwgku.js} +2 -2
- package/dist/components/{p-CNgNgezy.js.map → p-DHjjwgku.js.map} +1 -1
- package/dist/components/p-DI8rHm9u.js +2 -0
- package/dist/components/p-DI8rHm9u.js.map +1 -0
- package/dist/components/p-DMD-RO1W.js +2 -0
- package/dist/components/p-DMD-RO1W.js.map +1 -0
- package/dist/components/{p-BVNJnFI9.js → p-DOEMwKBb.js} +2 -2
- package/dist/components/{p-BVNJnFI9.js.map → p-DOEMwKBb.js.map} +1 -1
- package/dist/components/p-DolYlDbY.js +2 -0
- package/dist/components/p-DolYlDbY.js.map +1 -0
- package/dist/framework/angular.d.ts +6 -0
- package/dist/framework/angular.js +6 -0
- 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/Text/Text.d.ts +2 -1
- package/dist/types/components/Toggle/Toggle.d.ts +12 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +6 -0
- package/dist/types/components.d.ts +527 -32
- 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-B_ENgncs.js +0 -2
- package/dist/components/p-B_ENgncs.js.map +0 -1
- package/dist/components/p-CQmul5NK.js +0 -2
- package/dist/components/p-CQmul5NK.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-DEpLlQZK.js +0 -2
- package/dist/components/p-DEpLlQZK.js.map +0 -1
- package/dist/components/p-DRqJ3RUb.js +0 -2
- package/dist/components/p-DRqJ3RUb.js.map +0 -1
- package/dist/components/p-V2qW8NL0.js.map +0 -1
- package/dist/components/p-sBx2MuF2.js +0 -2
- 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 -742
- 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 -707
- 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 -98
- 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 -372
- 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
- /package/dist/components/{p-DQ3l2TXw.js.map → p-DEgY_Lnb.js.map} +0 -0
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
import { Component, Prop, Element, Watch, h, Host } from '@stencil/core';
|
|
2
|
-
import {
|
|
3
|
-
CONTROL_TEXT_VARIANT,
|
|
4
|
-
resolveCssLengthPx,
|
|
5
|
-
resolveCssTimeMs,
|
|
6
|
-
TOKEN_CSS_LENGTHS,
|
|
7
|
-
TOKEN_DEFAULTS,
|
|
8
|
-
} from '../../utils';
|
|
9
|
-
import type { TextVariant } from '../Text/text-types';
|
|
10
|
-
// Side-effect: register `ds-text` — the portal builds it via createElement, not JSX.
|
|
11
|
-
import '../Text/Text';
|
|
12
|
-
|
|
13
|
-
export type TooltipSide = 'top' | 'right' | 'bottom' | 'left';
|
|
14
|
-
export type TooltipAlign = 'start' | 'center' | 'end';
|
|
15
|
-
export type TooltipSize = 'md' | 'sm' | 'xs';
|
|
16
|
-
|
|
17
|
-
const FALLBACK_HEIGHT: Record<TooltipSize, string> = {
|
|
18
|
-
md: TOKEN_DEFAULTS.size400,
|
|
19
|
-
sm: TOKEN_DEFAULTS.size300,
|
|
20
|
-
xs: TOKEN_DEFAULTS.size200,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
let lastDismissedAt = 0;
|
|
24
|
-
let tooltipIdCounter = 0;
|
|
25
|
-
/** Currently open tooltip — force-cleared on warm handoff so tips don't cross-fade. */
|
|
26
|
-
let activeTooltip: Tooltip | null = null;
|
|
27
|
-
|
|
28
|
-
type DsTextEl = HTMLElement & {
|
|
29
|
-
as: string;
|
|
30
|
-
variant: TextVariant;
|
|
31
|
-
emphasis: boolean;
|
|
32
|
-
color: string;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function createDsText(opts: {
|
|
36
|
-
variant: TextVariant;
|
|
37
|
-
emphasis?: boolean;
|
|
38
|
-
color?: string;
|
|
39
|
-
className?: string;
|
|
40
|
-
text: string;
|
|
41
|
-
}): DsTextEl {
|
|
42
|
-
const el = document.createElement('ds-text') as DsTextEl;
|
|
43
|
-
if (opts.className) el.className = opts.className;
|
|
44
|
-
el.as = 'span';
|
|
45
|
-
el.variant = opts.variant;
|
|
46
|
-
el.emphasis = opts.emphasis ?? false;
|
|
47
|
-
el.color = opts.color ?? 'inherit';
|
|
48
|
-
el.textContent = opts.text;
|
|
49
|
-
return el;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Imperative body portal for the popup.
|
|
54
|
-
* Stencil must not own the portaled node — moving a VDOM child to `document.body`
|
|
55
|
-
* causes recreate → re-portal → @State loops that freeze the page.
|
|
56
|
-
*/
|
|
57
|
-
@Component({
|
|
58
|
-
tag: 'ds-tooltip',
|
|
59
|
-
styleUrl: 'Tooltip.css',
|
|
60
|
-
scoped: true,
|
|
61
|
-
})
|
|
62
|
-
export class Tooltip {
|
|
63
|
-
@Element() el!: HTMLElement;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Tooltip text. Empty/whitespace skips show — useful when the wrapper must stay
|
|
67
|
-
* mounted for layout/animation stability (e.g. PanelNav expand/collapse).
|
|
68
|
-
*/
|
|
69
|
-
@Prop() label!: string;
|
|
70
|
-
|
|
71
|
-
/** Control density (height, padding, type). */
|
|
72
|
-
@Prop() size: TooltipSize = 'md';
|
|
73
|
-
|
|
74
|
-
@Prop() side: TooltipSide = 'top';
|
|
75
|
-
@Prop() align: TooltipAlign = 'center';
|
|
76
|
-
/** Gap between anchor and tooltip — number (px) or TokoMo length. */
|
|
77
|
-
@Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;
|
|
78
|
-
/** Cross-axis offset — number (px) or TokoMo length. */
|
|
79
|
-
@Prop() alignOffset: number | string = 0;
|
|
80
|
-
/**
|
|
81
|
-
* Hover show delay before the tooltip appears.
|
|
82
|
-
* Default: `--effect-animation-delay-medium-3` (1000ms). Accepts a number (ms)
|
|
83
|
-
* or a TokoMo time token / `var(--effect-animation-delay-*)`. Applies to the
|
|
84
|
-
* initial hover/focus show only — after a recent dismiss, reopen is instant.
|
|
85
|
-
* Prefer the default; override only for denser chrome or rare/destructive actions.
|
|
86
|
-
*/
|
|
87
|
-
@Prop() delay: number | string = TOKEN_DEFAULTS.animationDelayMedium3;
|
|
88
|
-
@Prop() shortcutKey: string | undefined;
|
|
89
|
-
@Prop() shortcutKeyPosition: 'start' | 'end' = 'end';
|
|
90
|
-
|
|
91
|
-
private tooltipId = `ds-tooltip-${++tooltipIdCounter}`;
|
|
92
|
-
private delayTimer: ReturnType<typeof setTimeout> | null = null;
|
|
93
|
-
private closeTimer: ReturnType<typeof setTimeout> | null = null;
|
|
94
|
-
private anchor: HTMLElement | null = null;
|
|
95
|
-
private popupEl: HTMLElement | null = null;
|
|
96
|
-
private skipEnterAnimation = false;
|
|
97
|
-
private isOpen = false;
|
|
98
|
-
private mouseEnterHandler: () => void = () => this.show();
|
|
99
|
-
private mouseLeaveHandler: () => void = () => this.hide();
|
|
100
|
-
/** focusin/focusout so nested focus targets (e.g. ds-button-* inner button) still open the tip. */
|
|
101
|
-
private focusHandler: () => void = () => this.show();
|
|
102
|
-
private blurHandler: (e: FocusEvent) => void = (e) => {
|
|
103
|
-
const next = e.relatedTarget as Node | null;
|
|
104
|
-
if (next && this.anchor?.contains(next)) return;
|
|
105
|
-
this.hide();
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
componentDidLoad() {
|
|
109
|
-
this.bindAnchor();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
disconnectedCallback() {
|
|
113
|
-
if (activeTooltip === this) activeTooltip = null;
|
|
114
|
-
this.unbindAnchor();
|
|
115
|
-
this.clearTimers();
|
|
116
|
-
this.destroyPopup();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@Watch('label')
|
|
120
|
-
@Watch('size')
|
|
121
|
-
@Watch('side')
|
|
122
|
-
@Watch('align')
|
|
123
|
-
@Watch('sideOffset')
|
|
124
|
-
@Watch('alignOffset')
|
|
125
|
-
@Watch('shortcutKey')
|
|
126
|
-
@Watch('shortcutKeyPosition')
|
|
127
|
-
onContentOrPositionChange() {
|
|
128
|
-
if (!this.label?.trim()) {
|
|
129
|
-
if (this.isOpen || this.popupEl) this.hideInstant();
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
if (!this.popupEl || !this.isOpen) return;
|
|
133
|
-
this.renderPopupContent();
|
|
134
|
-
this.calculatePosition();
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
private get viewportPadPx(): number {
|
|
138
|
-
return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
private get sideOffsetPx(): number {
|
|
142
|
-
return resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
private get alignOffsetPx(): number {
|
|
146
|
-
return resolveCssLengthPx(this.alignOffset, 0);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
private get hoverDelayMs(): number {
|
|
150
|
-
return resolveCssTimeMs(this.delay, TOKEN_DEFAULTS.animationDelayMedium3);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
private get instantReopenMs(): number {
|
|
154
|
-
return resolveCssTimeMs(
|
|
155
|
-
TOKEN_DEFAULTS.animationDurationMedium1,
|
|
156
|
-
TOKEN_DEFAULTS.animationDurationMedium1,
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
private get fadeOutMs(): number {
|
|
161
|
-
return resolveCssTimeMs(TOKEN_DEFAULTS.motionShort3, TOKEN_DEFAULTS.animationDurationShort3);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
private get tooltipFallbackWidthPx(): number {
|
|
165
|
-
return resolveCssLengthPx(TOKEN_DEFAULTS.tooltipFallbackWidth, TOKEN_DEFAULTS.tooltipFallbackWidth);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
private get tooltipFallbackHeightPx(): number {
|
|
169
|
-
const token = FALLBACK_HEIGHT[this.size];
|
|
170
|
-
return resolveCssLengthPx(token, token);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
private bindAnchor() {
|
|
174
|
-
const slot = this.el.querySelector('slot') as HTMLSlotElement | null;
|
|
175
|
-
const slotted = slot?.assignedElements?.() ?? [];
|
|
176
|
-
const child = (slotted[0] ?? this.el.firstElementChild) as HTMLElement | null;
|
|
177
|
-
if (!child) return;
|
|
178
|
-
this.anchor = child;
|
|
179
|
-
child.setAttribute('aria-describedby', this.tooltipId);
|
|
180
|
-
child.addEventListener('mouseenter', this.mouseEnterHandler);
|
|
181
|
-
child.addEventListener('mouseleave', this.mouseLeaveHandler);
|
|
182
|
-
child.addEventListener('focusin', this.focusHandler);
|
|
183
|
-
child.addEventListener('focusout', this.blurHandler);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
private unbindAnchor() {
|
|
187
|
-
if (!this.anchor) return;
|
|
188
|
-
this.anchor.removeAttribute('aria-describedby');
|
|
189
|
-
this.anchor.removeEventListener('mouseenter', this.mouseEnterHandler);
|
|
190
|
-
this.anchor.removeEventListener('mouseleave', this.mouseLeaveHandler);
|
|
191
|
-
this.anchor.removeEventListener('focusin', this.focusHandler);
|
|
192
|
-
this.anchor.removeEventListener('focusout', this.blurHandler);
|
|
193
|
-
this.anchor = null;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
private clearTimers() {
|
|
197
|
-
if (this.delayTimer) { clearTimeout(this.delayTimer); this.delayTimer = null; }
|
|
198
|
-
if (this.closeTimer) { clearTimeout(this.closeTimer); this.closeTimer = null; }
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
private destroyPopup() {
|
|
202
|
-
if (!this.popupEl) return;
|
|
203
|
-
this.popupEl.remove();
|
|
204
|
-
this.popupEl = null;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/** Drop the open tip immediately (warm handoff to another tooltip). */
|
|
208
|
-
private hideInstant() {
|
|
209
|
-
this.clearTimers();
|
|
210
|
-
lastDismissedAt = Date.now();
|
|
211
|
-
if (activeTooltip === this) activeTooltip = null;
|
|
212
|
-
this.destroyPopup();
|
|
213
|
-
this.isOpen = false;
|
|
214
|
-
this.skipEnterAnimation = false;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
private show() {
|
|
218
|
-
// Empty label = wrapper present for DOM stability (e.g. PanelNav expand/collapse)
|
|
219
|
-
// but no tip should appear.
|
|
220
|
-
if (!this.label?.trim()) return;
|
|
221
|
-
this.clearTimers();
|
|
222
|
-
let instant = Date.now() - lastDismissedAt < this.instantReopenMs;
|
|
223
|
-
if (activeTooltip && activeTooltip !== this) {
|
|
224
|
-
activeTooltip.hideInstant();
|
|
225
|
-
instant = true;
|
|
226
|
-
}
|
|
227
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias -- module singleton tracks the active instance
|
|
228
|
-
activeTooltip = this;
|
|
229
|
-
this.skipEnterAnimation = instant;
|
|
230
|
-
if (instant) {
|
|
231
|
-
this.mountPopup();
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
this.delayTimer = setTimeout(() => {
|
|
235
|
-
this.delayTimer = null;
|
|
236
|
-
if (!this.label?.trim()) return;
|
|
237
|
-
this.mountPopup();
|
|
238
|
-
}, this.hoverDelayMs);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
private hide() {
|
|
242
|
-
this.clearTimers();
|
|
243
|
-
if (!this.popupEl && !this.isOpen) return;
|
|
244
|
-
lastDismissedAt = Date.now();
|
|
245
|
-
if (activeTooltip === this) activeTooltip = null;
|
|
246
|
-
if (!this.popupEl) {
|
|
247
|
-
this.isOpen = false;
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
this.popupEl.classList.remove('tooltip-popup--instant');
|
|
251
|
-
this.popupEl.classList.add('tooltip-popup--closing');
|
|
252
|
-
this.closeTimer = setTimeout(() => {
|
|
253
|
-
this.closeTimer = null;
|
|
254
|
-
this.destroyPopup();
|
|
255
|
-
this.isOpen = false;
|
|
256
|
-
this.skipEnterAnimation = false;
|
|
257
|
-
}, this.fadeOutMs);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
private mountPopup() {
|
|
261
|
-
if (!this.popupEl) {
|
|
262
|
-
const tip = document.createElement('div');
|
|
263
|
-
tip.id = this.tooltipId;
|
|
264
|
-
tip.setAttribute('role', 'tooltip');
|
|
265
|
-
// `sc-ds-tooltip` is required for Stencil scoped CSS to match outside the host.
|
|
266
|
-
tip.className = 'tooltip-popup sc-ds-tooltip';
|
|
267
|
-
Object.assign(tip.style, {
|
|
268
|
-
position: 'fixed',
|
|
269
|
-
left: '0',
|
|
270
|
-
top: '0',
|
|
271
|
-
zIndex: 'var(--dimension-z-index-tooltip)',
|
|
272
|
-
pointerEvents: 'none',
|
|
273
|
-
});
|
|
274
|
-
document.body.appendChild(tip);
|
|
275
|
-
this.popupEl = tip;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
this.popupEl.classList.toggle('tooltip-popup--instant', this.skipEnterAnimation);
|
|
279
|
-
this.popupEl.classList.remove('tooltip-popup--closing');
|
|
280
|
-
this.renderPopupContent();
|
|
281
|
-
this.calculatePosition();
|
|
282
|
-
this.isOpen = true;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
private renderPopupContent() {
|
|
286
|
-
if (!this.popupEl) return;
|
|
287
|
-
const textVariant = CONTROL_TEXT_VARIANT[this.size];
|
|
288
|
-
const density =
|
|
289
|
-
this.size === 'md' ? 'ds-control--md' : this.size === 'sm' ? 'ds-control--sm' : 'ds-control--xs';
|
|
290
|
-
// Every layout node needs `sc-ds-tooltip` so scoped selectors (`.foo.sc-ds-tooltip`) match.
|
|
291
|
-
const sc = 'sc-ds-tooltip';
|
|
292
|
-
|
|
293
|
-
const inner = document.createElement('div');
|
|
294
|
-
inner.className = `tooltip-inner ${density} ${sc}`;
|
|
295
|
-
|
|
296
|
-
const appendShortcut = (position: 'start' | 'end') => {
|
|
297
|
-
if (!this.shortcutKey || this.shortcutKeyPosition !== position) return;
|
|
298
|
-
const hint = document.createElement('div');
|
|
299
|
-
hint.className = `key-hint ${sc}`;
|
|
300
|
-
hint.setAttribute('aria-hidden', 'true');
|
|
301
|
-
hint.appendChild(
|
|
302
|
-
createDsText({ variant: 'text-caption', emphasis: true, text: this.shortcutKey }),
|
|
303
|
-
);
|
|
304
|
-
inner.appendChild(hint);
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
appendShortcut('start');
|
|
308
|
-
|
|
309
|
-
inner.appendChild(
|
|
310
|
-
createDsText({
|
|
311
|
-
className: `tooltip-label ${sc}`,
|
|
312
|
-
variant: textVariant,
|
|
313
|
-
text: this.label,
|
|
314
|
-
}),
|
|
315
|
-
);
|
|
316
|
-
|
|
317
|
-
appendShortcut('end');
|
|
318
|
-
|
|
319
|
-
this.popupEl.replaceChildren(inner);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
private calculatePosition() {
|
|
323
|
-
if (!this.anchor || !this.popupEl) return;
|
|
324
|
-
const tip = this.popupEl;
|
|
325
|
-
const a = this.anchor.getBoundingClientRect();
|
|
326
|
-
const tw = tip.offsetWidth || this.tooltipFallbackWidthPx;
|
|
327
|
-
const th = tip.offsetHeight || this.tooltipFallbackHeightPx;
|
|
328
|
-
const sideOffset = this.sideOffsetPx;
|
|
329
|
-
const alignOffset = this.alignOffsetPx;
|
|
330
|
-
const vpPad = this.viewportPadPx;
|
|
331
|
-
let x = 0, y = 0;
|
|
332
|
-
|
|
333
|
-
switch (this.side) {
|
|
334
|
-
case 'top':
|
|
335
|
-
y = a.top - th - sideOffset;
|
|
336
|
-
x = this.align === 'start' ? a.left + alignOffset
|
|
337
|
-
: this.align === 'end' ? a.right - tw + alignOffset
|
|
338
|
-
: a.left + a.width / 2 - tw / 2 + alignOffset;
|
|
339
|
-
break;
|
|
340
|
-
case 'bottom':
|
|
341
|
-
y = a.bottom + sideOffset;
|
|
342
|
-
x = this.align === 'start' ? a.left + alignOffset
|
|
343
|
-
: this.align === 'end' ? a.right - tw + alignOffset
|
|
344
|
-
: a.left + a.width / 2 - tw / 2 + alignOffset;
|
|
345
|
-
break;
|
|
346
|
-
case 'left':
|
|
347
|
-
x = a.left - tw - sideOffset;
|
|
348
|
-
y = this.align === 'start' ? a.top + alignOffset
|
|
349
|
-
: this.align === 'end' ? a.bottom - th + alignOffset
|
|
350
|
-
: a.top + a.height / 2 - th / 2 + alignOffset;
|
|
351
|
-
break;
|
|
352
|
-
case 'right':
|
|
353
|
-
x = a.right + sideOffset;
|
|
354
|
-
y = this.align === 'start' ? a.top + alignOffset
|
|
355
|
-
: this.align === 'end' ? a.bottom - th + alignOffset
|
|
356
|
-
: a.top + a.height / 2 - th / 2 + alignOffset;
|
|
357
|
-
break;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
const nextX = Math.min(Math.max(x, vpPad), window.innerWidth - tw - vpPad);
|
|
361
|
-
const nextY = Math.min(Math.max(y, vpPad), window.innerHeight - th - vpPad);
|
|
362
|
-
tip.style.transform = `translate(${Math.round(nextX)}px, ${Math.round(nextY)}px)`;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
render() {
|
|
366
|
-
return (
|
|
367
|
-
<Host style={{ display: 'contents' }}>
|
|
368
|
-
<slot />
|
|
369
|
-
</Host>
|
|
370
|
-
);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { Component, Prop, State, Element, Watch, h, Host } from '@stencil/core';
|
|
2
|
-
import { resolveCssTimeMs, TOKEN_DEFAULTS } from '../../utils';
|
|
3
|
-
|
|
4
|
-
const CURSOR_OFFSET_PX = 12;
|
|
5
|
-
const VIEWPORT_PAD_PX = 8;
|
|
6
|
-
|
|
7
|
-
export type TooltipDataVizSide = 'left' | 'right';
|
|
8
|
-
export type TooltipDataVizAlign = 'top' | 'bottom';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Positioned value/label callout for chart hover interactions (bar, line point, …).
|
|
12
|
-
* Donut charts skip this — legend sync already surfaces the hovered slice.
|
|
13
|
-
* Unlike `ds-tooltip`, this doesn't bind to a slotted anchor element —
|
|
14
|
-
* charts hover-highlight data that lives inside an SVG, so the chart itself computes
|
|
15
|
-
* the anchor point (e.g. the cursor position while hovering) and passes it in as `x`/`y`.
|
|
16
|
-
*
|
|
17
|
-
* Renders `position: absolute` — place inside a `position: relative` chart wrapper,
|
|
18
|
-
* with `x`/`y` as pixel coordinates within that wrapper. Defaults to sitting below-right
|
|
19
|
-
* of the anchor (matching cursor-following tooltips), flipping to whichever side/edge
|
|
20
|
-
* keeps it on-screen.
|
|
21
|
-
*
|
|
22
|
-
* Mount (or remount) when a hover session starts so `delay` applies once per hover;
|
|
23
|
-
* keep the instance mounted while the cursor moves so tracking stays instant.
|
|
24
|
-
*/
|
|
25
|
-
@Component({
|
|
26
|
-
tag: 'ds-tooltip-data-viz',
|
|
27
|
-
styleUrl: 'TooltipDataViz.css',
|
|
28
|
-
scoped: true,
|
|
29
|
-
})
|
|
30
|
-
export class TooltipDataViz {
|
|
31
|
-
@Element() el!: HTMLElement;
|
|
32
|
-
|
|
33
|
-
@Prop() value: string | number = '';
|
|
34
|
-
@Prop() label: string = '';
|
|
35
|
-
/** Anchor point in px, relative to the nearest `position: relative` ancestor — e.g. the cursor. */
|
|
36
|
-
@Prop() x: number = 0;
|
|
37
|
-
@Prop() y: number = 0;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Show delay after mount before the callout appears.
|
|
41
|
-
* Default: `--effect-animation-delay-instant` (0ms). Accepts a number (ms)
|
|
42
|
-
* or a TokoMo time token / `var(--effect-animation-delay-*)`. Charts need
|
|
43
|
-
* immediate feedback while scrubbing; prefer the default. Mount once per
|
|
44
|
-
* hover session so any non-zero delay runs once, then track `x`/`y` instantly.
|
|
45
|
-
*/
|
|
46
|
-
@Prop() delay: number | string = TOKEN_DEFAULTS.animationDelayInstant;
|
|
47
|
-
|
|
48
|
-
@State() private side: TooltipDataVizSide = 'right';
|
|
49
|
-
@State() private align: TooltipDataVizAlign = 'bottom';
|
|
50
|
-
@State() private visible: boolean = false;
|
|
51
|
-
|
|
52
|
-
private delayTimer: ReturnType<typeof setTimeout> | null = null;
|
|
53
|
-
|
|
54
|
-
componentDidLoad() {
|
|
55
|
-
this.scheduleShow();
|
|
56
|
-
this.calculatePlacement();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
disconnectedCallback() {
|
|
60
|
-
this.clearDelayTimer();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@Watch('x')
|
|
64
|
-
@Watch('y')
|
|
65
|
-
onAnchorChange() {
|
|
66
|
-
requestAnimationFrame(() => this.calculatePlacement());
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@Watch('delay')
|
|
70
|
-
onDelayChange() {
|
|
71
|
-
if (!this.visible) this.scheduleShow();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
private get showDelayMs(): number {
|
|
75
|
-
return resolveCssTimeMs(this.delay, TOKEN_DEFAULTS.animationDelayInstant);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
private clearDelayTimer() {
|
|
79
|
-
if (this.delayTimer) {
|
|
80
|
-
clearTimeout(this.delayTimer);
|
|
81
|
-
this.delayTimer = null;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
private scheduleShow() {
|
|
86
|
-
this.clearDelayTimer();
|
|
87
|
-
this.visible = false;
|
|
88
|
-
const ms = this.showDelayMs;
|
|
89
|
-
if (ms <= 0) {
|
|
90
|
-
this.visible = true;
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
this.delayTimer = setTimeout(() => {
|
|
94
|
-
this.delayTimer = null;
|
|
95
|
-
this.visible = true;
|
|
96
|
-
requestAnimationFrame(() => this.calculatePlacement());
|
|
97
|
-
}, ms);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
private calculatePlacement() {
|
|
101
|
-
const rect = this.el.getBoundingClientRect();
|
|
102
|
-
if (!rect.width || !rect.height) return;
|
|
103
|
-
|
|
104
|
-
const nextSide: TooltipDataVizSide = rect.right > window.innerWidth - VIEWPORT_PAD_PX ? 'left' : 'right';
|
|
105
|
-
const nextAlign: TooltipDataVizAlign = rect.bottom > window.innerHeight - VIEWPORT_PAD_PX ? 'top' : 'bottom';
|
|
106
|
-
|
|
107
|
-
if (nextSide !== this.side) this.side = nextSide;
|
|
108
|
-
if (nextAlign !== this.align) this.align = nextAlign;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
render() {
|
|
112
|
-
const translateX = this.side === 'right' ? `${CURSOR_OFFSET_PX}px` : `calc(-100% - ${CURSOR_OFFSET_PX}px)`;
|
|
113
|
-
const translateY = this.align === 'bottom' ? `${CURSOR_OFFSET_PX}px` : `calc(-100% - ${CURSOR_OFFSET_PX}px)`;
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<Host
|
|
117
|
-
class={{
|
|
118
|
-
'tooltip-data-viz': true,
|
|
119
|
-
'tooltip-data-viz--visible': this.visible,
|
|
120
|
-
}}
|
|
121
|
-
style={{ left: `${this.x}px`, top: `${this.y}px`, transform: `translate(${translateX}, ${translateY})` }}
|
|
122
|
-
>
|
|
123
|
-
<div class="tooltip-data-viz__item ds-control--md">
|
|
124
|
-
<ds-text
|
|
125
|
-
class="tooltip-data-viz__label"
|
|
126
|
-
as="span"
|
|
127
|
-
variant="text-body-medium"
|
|
128
|
-
color="var(--color-foreground-on-translucent-background-secondary)"
|
|
129
|
-
>
|
|
130
|
-
{this.label}
|
|
131
|
-
</ds-text>
|
|
132
|
-
<ds-text
|
|
133
|
-
class="tooltip-data-viz__value"
|
|
134
|
-
as="span"
|
|
135
|
-
variant="text-body-medium"
|
|
136
|
-
emphasis
|
|
137
|
-
color="var(--color-foreground-on-translucent-background-primary)"
|
|
138
|
-
>
|
|
139
|
-
{this.value}
|
|
140
|
-
</ds-text>
|
|
141
|
-
</div>
|
|
142
|
-
</Host>
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { TooltipDataVizSide, TooltipDataVizAlign } from './TooltipDataViz';
|