@ds-mo/ui 3.0.1 → 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-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/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/Toggle/Toggle.d.ts +12 -0
- package/dist/types/components.d.ts +525 -30
- 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-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,23 +0,0 @@
|
|
|
1
|
-
export type QueryableHost = {
|
|
2
|
-
shadowRoot?: ShadowRoot | null;
|
|
3
|
-
querySelector: (selectors: string) => Element | null;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Query within a Stencil custom-element host (light DOM today, shadow DOM–safe).
|
|
8
|
-
* Use for child nodes owned by ds-tab-group and similar components.
|
|
9
|
-
*/
|
|
10
|
-
export function queryWithinComponentHost(
|
|
11
|
-
host: QueryableHost | null | undefined,
|
|
12
|
-
selector: string,
|
|
13
|
-
): HTMLElement | null {
|
|
14
|
-
if (!host) return null;
|
|
15
|
-
const root = host.shadowRoot ?? host;
|
|
16
|
-
return root.querySelector(selector) as HTMLElement | null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function getTabListFromTabGroup(
|
|
20
|
-
tabGroupEl: QueryableHost | null | undefined,
|
|
21
|
-
): HTMLElement | null {
|
|
22
|
-
return queryWithinComponentHost(tabGroupEl, '[role="tablist"]');
|
|
23
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type { MenuItemData, MenuSection } from '../Menu/menu-types';
|
|
2
|
-
import {
|
|
3
|
-
getSelectableTabs,
|
|
4
|
-
isTabDivider,
|
|
5
|
-
type TabItem,
|
|
6
|
-
type TabItemTab,
|
|
7
|
-
} from '../TabGroup/tab-item-utils';
|
|
8
|
-
|
|
9
|
-
/** Map BarNav tabs to menu sections, preserving `{ type: 'divider' }` as section breaks. */
|
|
10
|
-
export function tabsToMenuSections(tabs: TabItem[], selectedId: string): MenuSection[] {
|
|
11
|
-
const sections: MenuSection[] = [];
|
|
12
|
-
let batch: MenuItemData[] = [];
|
|
13
|
-
|
|
14
|
-
for (const item of tabs) {
|
|
15
|
-
if (isTabDivider(item)) {
|
|
16
|
-
if (batch.length > 0) {
|
|
17
|
-
sections.push({ items: batch });
|
|
18
|
-
batch = [];
|
|
19
|
-
}
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
batch.push({
|
|
24
|
-
label: item.label,
|
|
25
|
-
value: item.id,
|
|
26
|
-
isSelected: item.id === selectedId,
|
|
27
|
-
isInactive: item.isInactive,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (batch.length > 0) {
|
|
32
|
-
sections.push({ items: batch });
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return sections;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function tabsToOverflowMenuSections(tabs: TabItem[], selectedId: string): MenuSection[] {
|
|
39
|
-
return tabsToMenuSections(trimLeadingDividers(tabs), selectedId);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function getActiveTab(tabs: TabItem[], selectedId: string): TabItemTab | undefined {
|
|
43
|
-
const selectable = getSelectableTabs(tabs);
|
|
44
|
-
return selectable.find(tab => tab.id === selectedId) ?? selectable[0];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function getActiveTabLabel(tabs: TabItem[], selectedId: string): string {
|
|
48
|
-
return getActiveTab(tabs, selectedId)?.label ?? 'Tabs';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** True when tablist content exceeds the available width (with optional hysteresis). */
|
|
52
|
-
export function tabsOverflowContainer(
|
|
53
|
-
tabListScrollWidth: number,
|
|
54
|
-
containerClientWidth: number,
|
|
55
|
-
collapsed: boolean,
|
|
56
|
-
hysteresis = 2,
|
|
57
|
-
): boolean {
|
|
58
|
-
const diff = tabListScrollWidth - containerClientWidth;
|
|
59
|
-
if (collapsed) {
|
|
60
|
-
return diff > -hysteresis;
|
|
61
|
-
}
|
|
62
|
-
return diff > hysteresis;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function visibleTabCountForWidth(
|
|
66
|
-
itemWidths: number[],
|
|
67
|
-
availableWidth: number,
|
|
68
|
-
overflowTriggerWidth: number,
|
|
69
|
-
itemGap: number,
|
|
70
|
-
listExtraWidth: number,
|
|
71
|
-
): number {
|
|
72
|
-
if (itemWidths.length === 0 || availableWidth <= 0) return 0;
|
|
73
|
-
|
|
74
|
-
const fullWidth = widthForItemCount(itemWidths, itemWidths.length, itemGap, listExtraWidth);
|
|
75
|
-
if (fullWidth <= availableWidth) return itemWidths.length;
|
|
76
|
-
|
|
77
|
-
const availableForTabs = Math.max(0, availableWidth - overflowTriggerWidth);
|
|
78
|
-
let count = 0;
|
|
79
|
-
|
|
80
|
-
for (let i = 1; i <= itemWidths.length; i++) {
|
|
81
|
-
const width = widthForItemCount(itemWidths, i, itemGap, listExtraWidth);
|
|
82
|
-
if (width > availableForTabs) break;
|
|
83
|
-
count = i;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return count;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function trimTrailingDividers(tabs: TabItem[]): TabItem[] {
|
|
90
|
-
let end = tabs.length;
|
|
91
|
-
while (end > 0 && isTabDivider(tabs[end - 1])) {
|
|
92
|
-
end -= 1;
|
|
93
|
-
}
|
|
94
|
-
return tabs.slice(0, end);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function trimLeadingDividers(tabs: TabItem[]): TabItem[] {
|
|
98
|
-
let start = 0;
|
|
99
|
-
while (start < tabs.length && isTabDivider(tabs[start])) {
|
|
100
|
-
start += 1;
|
|
101
|
-
}
|
|
102
|
-
return tabs.slice(start);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function widthForItemCount(
|
|
106
|
-
itemWidths: number[],
|
|
107
|
-
count: number,
|
|
108
|
-
itemGap: number,
|
|
109
|
-
listExtraWidth: number,
|
|
110
|
-
): number {
|
|
111
|
-
if (count <= 0) return 0;
|
|
112
|
-
const itemsWidth = itemWidths.slice(0, count).reduce((sum, width) => sum + width, 0);
|
|
113
|
-
return listExtraWidth + itemsWidth + itemGap * Math.max(0, count - 1);
|
|
114
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { getSelectableTabs } from '../TabGroup/tab-item-utils';
|
|
2
|
-
import type { BarNavTab } from './bar-nav-types';
|
|
3
|
-
|
|
4
|
-
export interface BarNavUrlState {
|
|
5
|
-
/** Tab id derived from the URL, or empty when none applies. */
|
|
6
|
-
value: string;
|
|
7
|
-
/** When true, tabs should be hidden (e.g. non-tab child routes like detail pages). */
|
|
8
|
-
hideTabs: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Derive BarNav tab selection from `currentUrl` relative to `basePath`.
|
|
12
|
-
* Mirrors motive-webapp-lab `resolveBarNavState` tab-selection semantics. */
|
|
13
|
-
export function deriveBarNavValueFromUrl(
|
|
14
|
-
path: string,
|
|
15
|
-
basePath: string,
|
|
16
|
-
tabs: BarNavTab[],
|
|
17
|
-
): BarNavUrlState {
|
|
18
|
-
if (!path || !basePath) {
|
|
19
|
-
return { value: '', hideTabs: false };
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (path !== basePath && !path.startsWith(`${basePath}/`)) {
|
|
23
|
-
return { value: '', hideTabs: false };
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const remainder = path.slice(basePath.length);
|
|
27
|
-
const seg = remainder.startsWith('/') ? remainder.slice(1).split('/')[0] : '';
|
|
28
|
-
const selectableTabs = getSelectableTabs(tabs);
|
|
29
|
-
|
|
30
|
-
if (!seg) {
|
|
31
|
-
return { value: selectableTabs[0]?.id ?? '', hideTabs: false };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const tab = selectableTabs.find(t => t.id === seg);
|
|
35
|
-
if (tab) {
|
|
36
|
-
return { value: tab.id, hideTabs: false };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return { value: '', hideTabs: true };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** True when host array/json props have data but resolved internal state is still empty. */
|
|
43
|
-
export function shouldResyncBarNavProps(
|
|
44
|
-
resolvedTabs: BarNavTab[],
|
|
45
|
-
tabs: BarNavTab[],
|
|
46
|
-
tabsJson: string,
|
|
47
|
-
): boolean {
|
|
48
|
-
const tabsIncoming = tabsJson
|
|
49
|
-
? parseJsonArrayProp(tabsJson, [])
|
|
50
|
-
: (tabs ?? []);
|
|
51
|
-
|
|
52
|
-
return resolvedTabs.length === 0 && tabsIncoming.length > 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Parse tabs from either a JSON attribute string or a JS property array. */
|
|
56
|
-
export function parseJsonArrayProp<T>(value: string | T[] | undefined, fallback: T[]): T[] {
|
|
57
|
-
if (Array.isArray(value)) return value;
|
|
58
|
-
if (typeof value === 'string' && value !== '') {
|
|
59
|
-
try {
|
|
60
|
-
const parsed = JSON.parse(value);
|
|
61
|
-
return Array.isArray(parsed) ? parsed : fallback;
|
|
62
|
-
} catch {
|
|
63
|
-
return fallback;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return fallback;
|
|
67
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core';
|
|
2
|
-
import { controlWidthClass, CONTROL_TEXT_VARIANT, type ControlWidth } from '../../utils';
|
|
3
|
-
|
|
4
|
-
export type ButtonFilledIntent =
|
|
5
|
-
| 'neutral'
|
|
6
|
-
| 'brand'
|
|
7
|
-
| 'ai'
|
|
8
|
-
| 'negative'
|
|
9
|
-
| 'warning'
|
|
10
|
-
| 'caution'
|
|
11
|
-
| 'positive'
|
|
12
|
-
| 'guide'
|
|
13
|
-
| 'walkthrough';
|
|
14
|
-
|
|
15
|
-
export type ButtonFilledContrast = 'bold' | 'strong' | 'medium' | 'faint';
|
|
16
|
-
|
|
17
|
-
export type ButtonFilledVariant = 'icon' | 'label' | 'icon-label';
|
|
18
|
-
|
|
19
|
-
export type ButtonFilledSize = 'md' | 'sm' | 'xs';
|
|
20
|
-
|
|
21
|
-
export type ButtonFilledWidth = ControlWidth;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* `ds-icon` size prop matching control-density icon metrics
|
|
25
|
-
* (md→20 / sm→16 / xs→12 via `--dimension-iconography-*`).
|
|
26
|
-
*/
|
|
27
|
-
const ICON_SIZE: Record<ButtonFilledSize, 'md' | 'sm' | 'xs'> = {
|
|
28
|
-
md: 'md',
|
|
29
|
-
sm: 'sm',
|
|
30
|
-
xs: 'xs',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
@Component({
|
|
34
|
-
tag: 'ds-button-filled',
|
|
35
|
-
styleUrl: 'ButtonFilled.css',
|
|
36
|
-
scoped: true,
|
|
37
|
-
})
|
|
38
|
-
export class ButtonFilled {
|
|
39
|
-
@Element() el!: HTMLElement;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Content layout. Default is label-only; pass `icon` for icon-only chrome
|
|
43
|
-
* (nav / tool rails) or `icon-label` for leading icon + text.
|
|
44
|
-
*/
|
|
45
|
-
@Prop() variant: ButtonFilledVariant = 'label';
|
|
46
|
-
|
|
47
|
-
/** Control density (height, padding, icon, type). */
|
|
48
|
-
@Prop() size: ButtonFilledSize = 'md';
|
|
49
|
-
|
|
50
|
-
/** Width fit — hug content (default) or fill the parent. */
|
|
51
|
-
@Prop() width: ButtonFilledWidth = 'hug';
|
|
52
|
-
|
|
53
|
-
/** Visible text for `label` / `icon-label` variants. */
|
|
54
|
-
@Prop() label: string = '';
|
|
55
|
-
|
|
56
|
-
/** Icon name passed to <ds-icon> for `icon` / `icon-label` variants. */
|
|
57
|
-
@Prop() icon: string = '';
|
|
58
|
-
|
|
59
|
-
/** Semantic colour intent. */
|
|
60
|
-
@Prop() intent: ButtonFilledIntent = 'brand';
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Background fill weight. Foreground uses the paired contrast token:
|
|
64
|
-
* bold → faint, strong → medium, medium → strong, faint → bold.
|
|
65
|
-
*/
|
|
66
|
-
@Prop() contrast: ButtonFilledContrast = 'bold';
|
|
67
|
-
|
|
68
|
-
/** Disables interaction. */
|
|
69
|
-
@Prop() isInactive: boolean = false;
|
|
70
|
-
|
|
71
|
-
/** Native button type. */
|
|
72
|
-
@Prop() type: 'button' | 'submit' | 'reset' = 'button';
|
|
73
|
-
|
|
74
|
-
@Prop({ attribute: 'aria-label' }) ariaLabel: string | undefined;
|
|
75
|
-
|
|
76
|
-
@Event() dsClick!: EventEmitter<MouseEvent>;
|
|
77
|
-
|
|
78
|
-
private buttonEl: HTMLButtonElement | null = null;
|
|
79
|
-
|
|
80
|
-
@Method()
|
|
81
|
-
async setFocus() {
|
|
82
|
-
this.buttonEl?.focus();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
private handleClick = (event: MouseEvent) => {
|
|
86
|
-
if (this.isInactive) return;
|
|
87
|
-
this.dsClick.emit(event);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
private get showIcon(): boolean {
|
|
91
|
-
return this.variant === 'icon' || this.variant === 'icon-label';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
private get showLabel(): boolean {
|
|
95
|
-
return this.variant === 'label' || this.variant === 'icon-label';
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
private get accessibleName(): string | undefined {
|
|
99
|
-
if (this.ariaLabel) return this.ariaLabel;
|
|
100
|
-
if (this.showLabel && this.label) return undefined;
|
|
101
|
-
if (this.variant === 'icon') return this.icon || 'action';
|
|
102
|
-
return this.label || 'action';
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
render() {
|
|
106
|
-
const textVariant = CONTROL_TEXT_VARIANT[this.size];
|
|
107
|
-
const iconSize = ICON_SIZE[this.size];
|
|
108
|
-
|
|
109
|
-
const cls: Record<string, boolean> = {
|
|
110
|
-
'button-filled': true,
|
|
111
|
-
'ds-focus-ring-inset': true,
|
|
112
|
-
'ds-interaction-fill': !this.isInactive,
|
|
113
|
-
/* Bold is the default filled contrast — on-bold interaction tokens. */
|
|
114
|
-
'ds-interaction-fill--on-bold': this.contrast === 'bold',
|
|
115
|
-
'ds-interaction-fill--on-strong': this.contrast === 'strong',
|
|
116
|
-
'ds-interaction-fill--on-medium': this.contrast === 'medium',
|
|
117
|
-
/* faint → default app interaction tokens (no --on-*). */
|
|
118
|
-
'ds-control-inactive': this.isInactive,
|
|
119
|
-
'ds-control--md': this.size === 'md',
|
|
120
|
-
'ds-control--sm': this.size === 'sm',
|
|
121
|
-
'ds-control--xs': this.size === 'xs',
|
|
122
|
-
'button-filled--icon': this.variant === 'icon',
|
|
123
|
-
'button-filled--label': this.variant === 'label',
|
|
124
|
-
'button-filled--icon-label': this.variant === 'icon-label',
|
|
125
|
-
[`button-filled--intent-${this.intent}`]: true,
|
|
126
|
-
[`button-filled--contrast-${this.contrast}`]: this.contrast !== 'bold',
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<Host
|
|
131
|
-
class={{
|
|
132
|
-
'button-filled-host': true,
|
|
133
|
-
'button-filled-host--icon': this.variant === 'icon',
|
|
134
|
-
'ds-control--md': this.size === 'md',
|
|
135
|
-
'ds-control--sm': this.size === 'sm',
|
|
136
|
-
'ds-control--xs': this.size === 'xs',
|
|
137
|
-
...controlWidthClass(this.width),
|
|
138
|
-
}}
|
|
139
|
-
tabIndex={-1}
|
|
140
|
-
>
|
|
141
|
-
<button
|
|
142
|
-
ref={el => {
|
|
143
|
-
this.buttonEl = el ?? null;
|
|
144
|
-
}}
|
|
145
|
-
type={this.type}
|
|
146
|
-
class={cls}
|
|
147
|
-
disabled={this.isInactive}
|
|
148
|
-
aria-label={this.accessibleName}
|
|
149
|
-
onClick={this.handleClick}
|
|
150
|
-
>
|
|
151
|
-
{this.showIcon && (
|
|
152
|
-
<span class="button-filled__icon-wrap ds-interaction-fill__content">
|
|
153
|
-
<ds-icon name={this.icon} size={iconSize} color="inherit" />
|
|
154
|
-
</span>
|
|
155
|
-
)}
|
|
156
|
-
{this.showLabel && (
|
|
157
|
-
<ds-text
|
|
158
|
-
class="button-filled__label ds-interaction-fill__content"
|
|
159
|
-
as="span"
|
|
160
|
-
variant={textVariant}
|
|
161
|
-
emphasis
|
|
162
|
-
color="inherit"
|
|
163
|
-
>
|
|
164
|
-
{this.label}
|
|
165
|
-
</ds-text>
|
|
166
|
-
)}
|
|
167
|
-
</button>
|
|
168
|
-
</Host>
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core';
|
|
2
|
-
import { controlWidthClass, CONTROL_TEXT_VARIANT, type ControlWidth } from '../../utils';
|
|
3
|
-
|
|
4
|
-
export type ButtonUnfilledOnBackgroundContrast = 'default' | 'medium' | 'bold' | 'strong';
|
|
5
|
-
|
|
6
|
-
export type ButtonUnfilledBackground = 'always-dark' | 'navigation';
|
|
7
|
-
|
|
8
|
-
export type ButtonUnfilledVariant = 'icon' | 'label' | 'icon-label';
|
|
9
|
-
|
|
10
|
-
export type ButtonUnfilledSize = 'md' | 'sm' | 'xs';
|
|
11
|
-
|
|
12
|
-
export type ButtonUnfilledWidth = ControlWidth;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* `ds-icon` size prop matching control-density icon metrics
|
|
16
|
-
* (md→20 / sm→16 / xs→12 via `--dimension-iconography-*`).
|
|
17
|
-
*/
|
|
18
|
-
const ICON_SIZE: Record<ButtonUnfilledSize, 'md' | 'sm' | 'xs'> = {
|
|
19
|
-
md: 'md',
|
|
20
|
-
sm: 'sm',
|
|
21
|
-
xs: 'xs',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
@Component({
|
|
25
|
-
tag: 'ds-button-unfilled',
|
|
26
|
-
styleUrl: 'ButtonUnfilled.css',
|
|
27
|
-
scoped: true,
|
|
28
|
-
})
|
|
29
|
-
export class ButtonUnfilled {
|
|
30
|
-
@Element() el!: HTMLElement;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Content layout. Default is label-only; pass `icon` for icon-only chrome
|
|
34
|
-
* (nav / tool rails) or `icon-label` for leading icon + text.
|
|
35
|
-
*/
|
|
36
|
-
@Prop() variant: ButtonUnfilledVariant = 'label';
|
|
37
|
-
|
|
38
|
-
/** Control density (height, padding, icon, type). */
|
|
39
|
-
@Prop() size: ButtonUnfilledSize = 'md';
|
|
40
|
-
|
|
41
|
-
/** Width fit — hug content (default) or fill the parent. */
|
|
42
|
-
@Prop() width: ButtonUnfilledWidth = 'hug';
|
|
43
|
-
|
|
44
|
-
/** Visible text for `label` / `icon-label` variants. */
|
|
45
|
-
@Prop() label: string = '';
|
|
46
|
-
|
|
47
|
-
/** Icon name passed to <ds-icon> for `icon` / `icon-label` variants. */
|
|
48
|
-
@Prop() icon: string = '';
|
|
49
|
-
|
|
50
|
-
/** Active/selected visual state. Always promotes foreground to primary. */
|
|
51
|
-
@Prop() isActive: boolean = false;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* When active, render the selected interaction fill.
|
|
55
|
-
* Default `true` for general UI. Shell chrome (nav / tool rails) should pass
|
|
56
|
-
* `false` so selection is foreground-only (primary color, no fill).
|
|
57
|
-
*/
|
|
58
|
-
@Prop() activeFill: boolean = true;
|
|
59
|
-
|
|
60
|
-
/** Show a 1px secondary inset border. Default on; shell chrome can pass `false`. */
|
|
61
|
-
@Prop() hasBorder: boolean = true;
|
|
62
|
-
|
|
63
|
-
/** Show a notification dot at the top-right of the icon zone (icon variant only). */
|
|
64
|
-
@Prop() dot: boolean = false;
|
|
65
|
-
|
|
66
|
-
/** Disables interaction. */
|
|
67
|
-
@Prop() isInactive: boolean = false;
|
|
68
|
-
|
|
69
|
-
/** Native button type. */
|
|
70
|
-
@Prop() type: 'button' | 'submit' | 'reset' = 'button';
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Foreground and interaction tokens when the button sits on a contrasting parent
|
|
74
|
-
* background (default, medium, bold, or strong).
|
|
75
|
-
*/
|
|
76
|
-
@Prop({ attribute: 'on-background-contrast' })
|
|
77
|
-
backgroundContrast?: ButtonUnfilledOnBackgroundContrast;
|
|
78
|
-
|
|
79
|
-
/** Parent surface context for navigation and always-dark chrome. */
|
|
80
|
-
@Prop() background: ButtonUnfilledBackground | undefined;
|
|
81
|
-
|
|
82
|
-
@Prop({ attribute: 'aria-label' }) ariaLabel: string | undefined;
|
|
83
|
-
@Prop() controls: string | undefined;
|
|
84
|
-
@Prop() expanded: boolean | undefined;
|
|
85
|
-
@Prop() haspopup: string | undefined;
|
|
86
|
-
@Prop() pressed: boolean | undefined;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Native `tabindex` for roving keyboard groups in shell chrome.
|
|
90
|
-
* Omit for the default button tab stop (`0`).
|
|
91
|
-
*/
|
|
92
|
-
@Prop({ attribute: 'tab-index' }) focusTabIndex?: number;
|
|
93
|
-
|
|
94
|
-
@Event() dsClick!: EventEmitter<MouseEvent>;
|
|
95
|
-
@Event() dsChange!: EventEmitter<boolean>;
|
|
96
|
-
|
|
97
|
-
private buttonEl: HTMLButtonElement | null = null;
|
|
98
|
-
|
|
99
|
-
@Method()
|
|
100
|
-
async setFocus() {
|
|
101
|
-
this.buttonEl?.focus();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
private handleClick = (event: MouseEvent) => {
|
|
105
|
-
if (this.isInactive) return;
|
|
106
|
-
this.dsClick.emit(event);
|
|
107
|
-
this.dsChange.emit(!this.isActive);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
private effectiveContrast(): ButtonUnfilledOnBackgroundContrast {
|
|
111
|
-
return this.backgroundContrast ?? 'default';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private get showIcon(): boolean {
|
|
115
|
-
return this.variant === 'icon' || this.variant === 'icon-label';
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
private get showLabel(): boolean {
|
|
119
|
-
return this.variant === 'label' || this.variant === 'icon-label';
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
private get showDot(): boolean {
|
|
123
|
-
return this.variant === 'icon' && this.dot;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Knock-out ring: selected fill → active wash; otherwise surface token. */
|
|
127
|
-
private get dotRing(): string {
|
|
128
|
-
if (this.isActive && this.activeFill) {
|
|
129
|
-
return 'var(--ds-interaction-active)';
|
|
130
|
-
}
|
|
131
|
-
return 'var(--ds-button-unfilled-dot-ring)';
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
private get accessibleName(): string | undefined {
|
|
135
|
-
if (this.ariaLabel) return this.ariaLabel;
|
|
136
|
-
if (this.showLabel && this.label) return undefined;
|
|
137
|
-
if (this.variant === 'icon') return this.icon || 'action';
|
|
138
|
-
return this.label || 'action';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
render() {
|
|
142
|
-
const bg = this.background;
|
|
143
|
-
const contrast = this.effectiveContrast();
|
|
144
|
-
const textVariant = CONTROL_TEXT_VARIANT[this.size];
|
|
145
|
-
const iconSize = ICON_SIZE[this.size];
|
|
146
|
-
|
|
147
|
-
const cls: Record<string, boolean> = {
|
|
148
|
-
'button-unfilled': true,
|
|
149
|
-
'ds-focus-ring-inset': true,
|
|
150
|
-
'ds-interaction-fill': true,
|
|
151
|
-
'ds-interaction-fill--selected': this.isActive && this.activeFill && !this.isInactive,
|
|
152
|
-
'ds-interaction-fill--on-medium': contrast === 'medium',
|
|
153
|
-
'ds-interaction-fill--on-bold': contrast === 'bold',
|
|
154
|
-
'ds-interaction-fill--on-strong': contrast === 'strong',
|
|
155
|
-
'ds-interaction-fill--on-always-dark': bg === 'always-dark',
|
|
156
|
-
'ds-interaction-fill--on-navigation': bg === 'navigation',
|
|
157
|
-
'button-unfilled--active': this.isActive,
|
|
158
|
-
'button-unfilled--bordered': this.hasBorder,
|
|
159
|
-
'ds-control-inactive': this.isInactive,
|
|
160
|
-
'ds-control--md': this.size === 'md',
|
|
161
|
-
'ds-control--sm': this.size === 'sm',
|
|
162
|
-
'ds-control--xs': this.size === 'xs',
|
|
163
|
-
'button-unfilled--icon': this.variant === 'icon',
|
|
164
|
-
'button-unfilled--label': this.variant === 'label',
|
|
165
|
-
'button-unfilled--icon-label': this.variant === 'icon-label',
|
|
166
|
-
'button-unfilled--contrast-medium': contrast === 'medium',
|
|
167
|
-
'button-unfilled--contrast-bold': contrast === 'bold',
|
|
168
|
-
'button-unfilled--contrast-strong': contrast === 'strong',
|
|
169
|
-
'button-unfilled--on-always-dark': bg === 'always-dark',
|
|
170
|
-
'button-unfilled--on-navigation': bg === 'navigation',
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
return (
|
|
174
|
-
<Host
|
|
175
|
-
class={{
|
|
176
|
-
'button-unfilled-host': true,
|
|
177
|
-
'button-unfilled-host--icon': this.variant === 'icon',
|
|
178
|
-
'ds-control--md': this.size === 'md',
|
|
179
|
-
'ds-control--sm': this.size === 'sm',
|
|
180
|
-
'ds-control--xs': this.size === 'xs',
|
|
181
|
-
...controlWidthClass(this.width),
|
|
182
|
-
}}
|
|
183
|
-
tabIndex={-1}
|
|
184
|
-
>
|
|
185
|
-
<button
|
|
186
|
-
ref={el => {
|
|
187
|
-
this.buttonEl = el ?? null;
|
|
188
|
-
}}
|
|
189
|
-
type={this.type}
|
|
190
|
-
class={cls}
|
|
191
|
-
disabled={this.isInactive}
|
|
192
|
-
tabIndex={this.focusTabIndex ?? 0}
|
|
193
|
-
aria-label={this.accessibleName}
|
|
194
|
-
aria-controls={this.controls}
|
|
195
|
-
aria-expanded={this.expanded === undefined ? undefined : String(this.expanded)}
|
|
196
|
-
aria-haspopup={this.haspopup}
|
|
197
|
-
aria-pressed={this.pressed === undefined ? undefined : String(this.pressed)}
|
|
198
|
-
onClick={this.handleClick}
|
|
199
|
-
>
|
|
200
|
-
{this.showIcon && (
|
|
201
|
-
<span class="button-unfilled__icon-wrap ds-interaction-fill__content">
|
|
202
|
-
<ds-icon name={this.icon} size={iconSize} color="inherit" />
|
|
203
|
-
{this.showDot && (
|
|
204
|
-
<ds-badge
|
|
205
|
-
class="button-unfilled__dot"
|
|
206
|
-
variant="dot"
|
|
207
|
-
background={this.dotRing}
|
|
208
|
-
label=""
|
|
209
|
-
aria-hidden="true"
|
|
210
|
-
/>
|
|
211
|
-
)}
|
|
212
|
-
</span>
|
|
213
|
-
)}
|
|
214
|
-
{this.showLabel && (
|
|
215
|
-
<ds-text
|
|
216
|
-
class="button-unfilled__label ds-interaction-fill__content"
|
|
217
|
-
as="span"
|
|
218
|
-
variant={textVariant}
|
|
219
|
-
emphasis
|
|
220
|
-
color="inherit"
|
|
221
|
-
>
|
|
222
|
-
{this.label}
|
|
223
|
-
</ds-text>
|
|
224
|
-
)}
|
|
225
|
-
</button>
|
|
226
|
-
</Host>
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
}
|