@ds-mo/ui 2.14.0 → 3.0.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/components/ds-app-shell.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-banner.js.map +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-bar.js +1 -1
- package/dist/components/ds-chart-bar.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-chart-line.js +1 -1
- package/dist/components/ds-chart-line.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-divider.js +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-field.js.map +1 -1
- package/dist/components/ds-icon.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-input.js.map +1 -1
- package/dist/components/ds-loader.js +1 -1
- package/dist/components/ds-loader.js.map +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-modal.js.map +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-slider.js.map +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-tag.js.map +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-toggle.js +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-tooltip-data-viz.js.map +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/p-8WTsyLQ9.js +2 -0
- package/dist/components/p-8WTsyLQ9.js.map +1 -0
- package/dist/components/{p-B82KZX9D.js → p-9Qu1ls2y.js} +2 -2
- package/dist/components/p-BSNlp8Di.js +2 -0
- package/dist/components/p-BSNlp8Di.js.map +1 -0
- package/dist/components/p-BVNJnFI9.js +2 -0
- package/dist/components/p-BVNJnFI9.js.map +1 -0
- package/dist/components/p-B_ENgncs.js +2 -0
- package/dist/components/p-B_ENgncs.js.map +1 -0
- package/dist/components/p-CNgNgezy.js +2 -0
- package/dist/components/p-CNgNgezy.js.map +1 -0
- package/dist/components/p-CQmul5NK.js +2 -0
- package/dist/components/p-CQmul5NK.js.map +1 -0
- package/dist/components/p-CsaW5gDM.js +2 -0
- package/dist/components/{p-CYmVDfd_.js.map → p-CsaW5gDM.js.map} +1 -1
- package/dist/components/p-Cx-ywr1e.js +2 -0
- package/dist/components/p-Cx-ywr1e.js.map +1 -0
- package/dist/components/p-DQ3l2TXw.js +2 -0
- package/dist/components/p-DQ3l2TXw.js.map +1 -0
- package/dist/components/p-DRqJ3RUb.js +2 -0
- package/dist/components/p-DRqJ3RUb.js.map +1 -0
- package/dist/components/p-V2qW8NL0.js +2 -0
- package/dist/components/p-V2qW8NL0.js.map +1 -0
- package/dist/components/p-sBx2MuF2.js +2 -0
- package/dist/components/p-sBx2MuF2.js.map +1 -0
- package/dist/lib/components/Text/text-types.d.ts +9 -0
- package/dist/lib/utils/control-text.d.ts +5 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.js +8 -0
- package/dist/lib/utils/index.js.map +3 -3
- package/dist/types/components/ButtonFilled/ButtonFilled.d.ts +1 -1
- package/dist/types/components/ButtonUnfilled/ButtonUnfilled.d.ts +1 -1
- package/dist/types/components/ChartDonut/ChartDonut.d.ts +2 -7
- package/dist/types/components/Loader/Loader.d.ts +7 -3
- package/dist/types/components/Loader/index.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Text/Text.d.ts +9 -9
- package/dist/types/components/Text/index.d.ts +2 -1
- package/dist/types/components/Text/text-types.d.ts +10 -0
- package/dist/types/components/Text/text-utils.d.ts +6 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/types/components/TooltipDataViz/TooltipDataViz.d.ts +3 -2
- package/dist/types/components.d.ts +54 -19
- package/dist/types/utils/control-text.d.ts +6 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +7 -7
- package/src/angular/proxies.ts +4 -4
- package/src/wc/components/Badge/Badge.tsx +6 -8
- package/src/wc/components/Banner/Banner.tsx +3 -1
- package/src/wc/components/BarNav/BarNav.tsx +10 -1
- package/src/wc/components/ButtonFilled/ButtonFilled.tsx +10 -11
- package/src/wc/components/ButtonUnfilled/ButtonUnfilled.tsx +10 -11
- package/src/wc/components/Card/Card.tsx +9 -10
- package/src/wc/components/ChartDonut/ChartDonut.tsx +4 -47
- package/src/wc/components/ChartLegend/ChartLegend.tsx +23 -15
- package/src/wc/components/Checkbox/Checkbox.tsx +2 -2
- package/src/wc/components/Chip/Chip.tsx +4 -10
- package/src/wc/components/EmptyState/EmptyState.tsx +3 -5
- package/src/wc/components/Field/Field.tsx +3 -1
- package/src/wc/components/Input/Input.tsx +10 -3
- package/src/wc/components/Loader/Loader.tsx +77 -30
- package/src/wc/components/Loader/index.ts +1 -1
- package/src/wc/components/Menu/Menu.tsx +21 -6
- package/src/wc/components/Modal/Modal.tsx +16 -3
- package/src/wc/components/Pagination/Pagination.tsx +5 -5
- package/src/wc/components/PanelNav/PanelNav.tsx +30 -30
- package/src/wc/components/PanelTools/PanelTools.tsx +10 -7
- package/src/wc/components/RadioGroup/RadioGroup.tsx +3 -1
- package/src/wc/components/Select/Select.tsx +15 -17
- package/src/wc/components/Slider/Slider.tsx +6 -2
- package/src/wc/components/TabGroup/TabGroup.tsx +3 -2
- package/src/wc/components/TabGroupNav/TabGroupNav.tsx +3 -2
- package/src/wc/components/Table/Table.tsx +21 -16
- package/src/wc/components/Tag/Tag.tsx +4 -10
- package/src/wc/components/Text/Text.tsx +54 -59
- package/src/wc/components/Text/index.ts +12 -1
- package/src/wc/components/Text/text-types.ts +23 -0
- package/src/wc/components/Text/text-utils.ts +13 -0
- package/src/wc/components/Tooltip/Tooltip.tsx +64 -41
- package/src/wc/components/TooltipDataViz/TooltipDataViz.tsx +20 -12
- package/src/wc/components.d.ts +54 -19
- package/src/wc/utils/control-density.css +1 -0
- package/src/wc/utils/control-text.ts +11 -0
- package/src/wc/utils/index.ts +2 -0
- package/src/wc/utils/interaction-fill.css +2 -2
- package/src/wc/utils/typography.css +146 -0
- package/dist/components/p-1m8r0wFg.js +0 -2
- package/dist/components/p-1m8r0wFg.js.map +0 -1
- package/dist/components/p-B2_D4IDN.js +0 -2
- package/dist/components/p-B2_D4IDN.js.map +0 -1
- package/dist/components/p-B5NcWtpp.js +0 -2
- package/dist/components/p-B5NcWtpp.js.map +0 -1
- package/dist/components/p-BAeKw2pj.js +0 -2
- package/dist/components/p-BAeKw2pj.js.map +0 -1
- package/dist/components/p-B_g8X0eh.js +0 -2
- package/dist/components/p-B_g8X0eh.js.map +0 -1
- package/dist/components/p-CDHRJqea.js +0 -2
- package/dist/components/p-CDHRJqea.js.map +0 -1
- package/dist/components/p-CYmVDfd_.js +0 -2
- package/dist/components/p-CtwNUCnp.js +0 -2
- package/dist/components/p-CtwNUCnp.js.map +0 -1
- package/dist/components/p-CuRjYmBk.js +0 -2
- package/dist/components/p-CuRjYmBk.js.map +0 -1
- package/dist/components/p-Dlol7hPg.js +0 -2
- package/dist/components/p-Dlol7hPg.js.map +0 -1
- package/dist/components/p-EK1hOP19.js +0 -2
- package/dist/components/p-EK1hOP19.js.map +0 -1
- package/dist/components/p-XNHSe8Mg.js +0 -2
- package/dist/components/p-XNHSe8Mg.js.map +0 -1
- /package/dist/components/{p-B82KZX9D.js.map → p-9Qu1ls2y.js.map} +0 -0
package/src/wc/components.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { DividerInset, DividerLength, DividerOrientation, DividerSurface } from
|
|
|
22
22
|
import { EmptyStateType } from "./components/EmptyState/EmptyState";
|
|
23
23
|
import { IconColor, IconSize } from "./components/Icon/Icon";
|
|
24
24
|
import { InputType } from "./components/Input/Input";
|
|
25
|
+
import { LoaderColor, LoaderSize } from "./components/Loader/Loader";
|
|
25
26
|
import { MenuItemData, MenuSection } from "./components/Menu/menu-types";
|
|
26
27
|
import { MenuAlign, MenuSide } from "./components/Menu/menu-position";
|
|
27
28
|
import { ModalWidth } from "./components/Modal/Modal";
|
|
@@ -37,7 +38,7 @@ import { TabBackground } from "./components/TabGroup/TabGroup";
|
|
|
37
38
|
import { TabGroupNavBackground } from "./components/TabGroupNav/TabGroupNav";
|
|
38
39
|
import { SortState, TableColumn } from "./components/Table/Table";
|
|
39
40
|
import { TagContrast, TagIntent, TagSize } from "./components/Tag/Tag";
|
|
40
|
-
import { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, TextFontFeature, TextVariant, TextWrap } from "./components/Text/
|
|
41
|
+
import { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, TextFontFeature, TextVariant, TextWrap } from "./components/Text/text-types";
|
|
41
42
|
import { TooltipAlign, TooltipSide, TooltipSize } from "./components/Tooltip/Tooltip";
|
|
42
43
|
export { NavChromeStyle } from "./nav/nav-chrome";
|
|
43
44
|
export { ShellGradientPreset } from "./nav/shell-gradient-presets";
|
|
@@ -56,6 +57,7 @@ export { DividerInset, DividerLength, DividerOrientation, DividerSurface } from
|
|
|
56
57
|
export { EmptyStateType } from "./components/EmptyState/EmptyState";
|
|
57
58
|
export { IconColor, IconSize } from "./components/Icon/Icon";
|
|
58
59
|
export { InputType } from "./components/Input/Input";
|
|
60
|
+
export { LoaderColor, LoaderSize } from "./components/Loader/Loader";
|
|
59
61
|
export { MenuItemData, MenuSection } from "./components/Menu/menu-types";
|
|
60
62
|
export { MenuAlign, MenuSide } from "./components/Menu/menu-position";
|
|
61
63
|
export { ModalWidth } from "./components/Modal/Modal";
|
|
@@ -71,7 +73,7 @@ export { TabBackground } from "./components/TabGroup/TabGroup";
|
|
|
71
73
|
export { TabGroupNavBackground } from "./components/TabGroupNav/TabGroupNav";
|
|
72
74
|
export { SortState, TableColumn } from "./components/Table/Table";
|
|
73
75
|
export { TagContrast, TagIntent, TagSize } from "./components/Tag/Tag";
|
|
74
|
-
export { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, TextFontFeature, TextVariant, TextWrap } from "./components/Text/
|
|
76
|
+
export { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, TextFontFeature, TextVariant, TextWrap } from "./components/Text/text-types";
|
|
75
77
|
export { TooltipAlign, TooltipSide, TooltipSize } from "./components/Tooltip/Tooltip";
|
|
76
78
|
export namespace Components {
|
|
77
79
|
interface DsAppShell {
|
|
@@ -401,7 +403,7 @@ export namespace Components {
|
|
|
401
403
|
}
|
|
402
404
|
interface DsChartDonut {
|
|
403
405
|
/**
|
|
404
|
-
* Externally controlled highlight, matched by `label` — e.g. drive this from a sibling `ds-chart-legend`'s `dsItemHover` event to keep chart and legend hover in sync. Falls back to this component's own pointer/focus hover when unset.
|
|
406
|
+
* Externally controlled highlight, matched by `label` — e.g. drive this from a sibling `ds-chart-legend`'s `dsItemHover` event to keep chart and legend hover in sync. Falls back to this component's own pointer/focus hover when unset. Slice hover dims peer slices and emits `dsSliceHover` for legend sync — no data-viz tooltip (the legend already surfaces label/value).
|
|
405
407
|
* @default null
|
|
406
408
|
*/
|
|
407
409
|
"activeLabel": string | null;
|
|
@@ -639,15 +641,19 @@ export namespace Components {
|
|
|
639
641
|
"value": string;
|
|
640
642
|
}
|
|
641
643
|
interface DsLoader {
|
|
644
|
+
/**
|
|
645
|
+
* Semantic foreground color token, or a raw CSS var reference. Same tokens as `ds-icon`.
|
|
646
|
+
*/
|
|
647
|
+
"color": LoaderColor | undefined;
|
|
642
648
|
/**
|
|
643
649
|
* Accessible label for standalone usage. Wraps the spinner in a live region and renders the label visually-hidden. Omit when the host element already conveys busy state via aria-busy.
|
|
644
650
|
*/
|
|
645
651
|
"label": string | undefined;
|
|
646
652
|
/**
|
|
647
|
-
*
|
|
648
|
-
* @default
|
|
653
|
+
* Iconography size token. Maps to `--dimension-iconography-{size}`. Default `md` = 20 px.
|
|
654
|
+
* @default 'md'
|
|
649
655
|
*/
|
|
650
|
-
"size":
|
|
656
|
+
"size": LoaderSize;
|
|
651
657
|
}
|
|
652
658
|
interface DsMenu {
|
|
653
659
|
/**
|
|
@@ -1069,6 +1075,11 @@ export namespace Components {
|
|
|
1069
1075
|
"as": TextElement;
|
|
1070
1076
|
"color": TextColor | undefined;
|
|
1071
1077
|
"decoration": TextDecoration | undefined;
|
|
1078
|
+
/**
|
|
1079
|
+
* Heavier weight + tighter letter-spacing for the variant. `false` (default): regular weight (caption stays medium). `true`: display bold, title/caption semibold, body medium.
|
|
1080
|
+
* @default false
|
|
1081
|
+
*/
|
|
1082
|
+
"emphasis": boolean;
|
|
1072
1083
|
/**
|
|
1073
1084
|
* @default 'normal'
|
|
1074
1085
|
*/
|
|
@@ -1085,6 +1096,10 @@ export namespace Components {
|
|
|
1085
1096
|
* @default 'none'
|
|
1086
1097
|
*/
|
|
1087
1098
|
"lineTruncation": LineTruncation;
|
|
1099
|
+
/**
|
|
1100
|
+
* Forwarded to the inner element (e.g. aria-labelledby targets).
|
|
1101
|
+
*/
|
|
1102
|
+
"textId": string | undefined;
|
|
1088
1103
|
/**
|
|
1089
1104
|
* @default 'text-body-medium'
|
|
1090
1105
|
*/
|
|
@@ -1147,8 +1162,9 @@ export namespace Components {
|
|
|
1147
1162
|
"size": TooltipSize;
|
|
1148
1163
|
}
|
|
1149
1164
|
/**
|
|
1150
|
-
* Positioned value/label callout for chart hover interactions (
|
|
1151
|
-
*
|
|
1165
|
+
* Positioned value/label callout for chart hover interactions (bar, line point, …).
|
|
1166
|
+
* Donut charts skip this — legend sync already surfaces the hovered slice.
|
|
1167
|
+
* Unlike `ds-tooltip`, this doesn't bind to a slotted anchor element —
|
|
1152
1168
|
* charts hover-highlight data that lives inside an SVG, so the chart itself computes
|
|
1153
1169
|
* the anchor point (e.g. the cursor position while hovering) and passes it in as `x`/`y`.
|
|
1154
1170
|
* Renders `position: absolute` — place inside a `position: relative` chart wrapper,
|
|
@@ -1842,8 +1858,9 @@ declare global {
|
|
|
1842
1858
|
new (): HTMLDsTooltipElement;
|
|
1843
1859
|
};
|
|
1844
1860
|
/**
|
|
1845
|
-
* Positioned value/label callout for chart hover interactions (
|
|
1846
|
-
*
|
|
1861
|
+
* Positioned value/label callout for chart hover interactions (bar, line point, …).
|
|
1862
|
+
* Donut charts skip this — legend sync already surfaces the hovered slice.
|
|
1863
|
+
* Unlike `ds-tooltip`, this doesn't bind to a slotted anchor element —
|
|
1847
1864
|
* charts hover-highlight data that lives inside an SVG, so the chart itself computes
|
|
1848
1865
|
* the anchor point (e.g. the cursor position while hovering) and passes it in as `x`/`y`.
|
|
1849
1866
|
* Renders `position: absolute` — place inside a `position: relative` chart wrapper,
|
|
@@ -2246,7 +2263,7 @@ declare namespace LocalJSX {
|
|
|
2246
2263
|
}
|
|
2247
2264
|
interface DsChartDonut {
|
|
2248
2265
|
/**
|
|
2249
|
-
* Externally controlled highlight, matched by `label` — e.g. drive this from a sibling `ds-chart-legend`'s `dsItemHover` event to keep chart and legend hover in sync. Falls back to this component's own pointer/focus hover when unset.
|
|
2266
|
+
* Externally controlled highlight, matched by `label` — e.g. drive this from a sibling `ds-chart-legend`'s `dsItemHover` event to keep chart and legend hover in sync. Falls back to this component's own pointer/focus hover when unset. Slice hover dims peer slices and emits `dsSliceHover` for legend sync — no data-viz tooltip (the legend already surfaces label/value).
|
|
2250
2267
|
* @default null
|
|
2251
2268
|
*/
|
|
2252
2269
|
"activeLabel"?: string | null;
|
|
@@ -2502,15 +2519,19 @@ declare namespace LocalJSX {
|
|
|
2502
2519
|
"value"?: string;
|
|
2503
2520
|
}
|
|
2504
2521
|
interface DsLoader {
|
|
2522
|
+
/**
|
|
2523
|
+
* Semantic foreground color token, or a raw CSS var reference. Same tokens as `ds-icon`.
|
|
2524
|
+
*/
|
|
2525
|
+
"color"?: LoaderColor | undefined;
|
|
2505
2526
|
/**
|
|
2506
2527
|
* Accessible label for standalone usage. Wraps the spinner in a live region and renders the label visually-hidden. Omit when the host element already conveys busy state via aria-busy.
|
|
2507
2528
|
*/
|
|
2508
2529
|
"label"?: string | undefined;
|
|
2509
2530
|
/**
|
|
2510
|
-
*
|
|
2511
|
-
* @default
|
|
2531
|
+
* Iconography size token. Maps to `--dimension-iconography-{size}`. Default `md` = 20 px.
|
|
2532
|
+
* @default 'md'
|
|
2512
2533
|
*/
|
|
2513
|
-
"size"?:
|
|
2534
|
+
"size"?: LoaderSize;
|
|
2514
2535
|
}
|
|
2515
2536
|
interface DsMenu {
|
|
2516
2537
|
/**
|
|
@@ -2975,6 +2996,11 @@ declare namespace LocalJSX {
|
|
|
2975
2996
|
"as"?: TextElement;
|
|
2976
2997
|
"color"?: TextColor | undefined;
|
|
2977
2998
|
"decoration"?: TextDecoration | undefined;
|
|
2999
|
+
/**
|
|
3000
|
+
* Heavier weight + tighter letter-spacing for the variant. `false` (default): regular weight (caption stays medium). `true`: display bold, title/caption semibold, body medium.
|
|
3001
|
+
* @default false
|
|
3002
|
+
*/
|
|
3003
|
+
"emphasis"?: boolean;
|
|
2978
3004
|
/**
|
|
2979
3005
|
* @default 'normal'
|
|
2980
3006
|
*/
|
|
@@ -2991,6 +3017,10 @@ declare namespace LocalJSX {
|
|
|
2991
3017
|
* @default 'none'
|
|
2992
3018
|
*/
|
|
2993
3019
|
"lineTruncation"?: LineTruncation;
|
|
3020
|
+
/**
|
|
3021
|
+
* Forwarded to the inner element (e.g. aria-labelledby targets).
|
|
3022
|
+
*/
|
|
3023
|
+
"textId"?: string | undefined;
|
|
2994
3024
|
/**
|
|
2995
3025
|
* @default 'text-body-medium'
|
|
2996
3026
|
*/
|
|
@@ -3054,8 +3084,9 @@ declare namespace LocalJSX {
|
|
|
3054
3084
|
"size"?: TooltipSize;
|
|
3055
3085
|
}
|
|
3056
3086
|
/**
|
|
3057
|
-
* Positioned value/label callout for chart hover interactions (
|
|
3058
|
-
*
|
|
3087
|
+
* Positioned value/label callout for chart hover interactions (bar, line point, …).
|
|
3088
|
+
* Donut charts skip this — legend sync already surfaces the hovered slice.
|
|
3089
|
+
* Unlike `ds-tooltip`, this doesn't bind to a slotted anchor element —
|
|
3059
3090
|
* charts hover-highlight data that lives inside an SVG, so the chart itself computes
|
|
3060
3091
|
* the anchor point (e.g. the cursor position while hovering) and passes it in as `x`/`y`.
|
|
3061
3092
|
* Renders `position: absolute` — place inside a `position: relative` chart wrapper,
|
|
@@ -3246,7 +3277,8 @@ declare namespace LocalJSX {
|
|
|
3246
3277
|
"ariaDescribedby": string | undefined;
|
|
3247
3278
|
}
|
|
3248
3279
|
interface DsLoaderAttributes {
|
|
3249
|
-
"size":
|
|
3280
|
+
"size": LoaderSize;
|
|
3281
|
+
"color": LoaderColor | undefined;
|
|
3250
3282
|
"label": string | undefined;
|
|
3251
3283
|
}
|
|
3252
3284
|
interface DsMenuAttributes {
|
|
@@ -3367,6 +3399,7 @@ declare namespace LocalJSX {
|
|
|
3367
3399
|
}
|
|
3368
3400
|
interface DsTextAttributes {
|
|
3369
3401
|
"variant": TextVariant;
|
|
3402
|
+
"emphasis": boolean;
|
|
3370
3403
|
"color": TextColor | undefined;
|
|
3371
3404
|
"decoration": TextDecoration | undefined;
|
|
3372
3405
|
"italic": boolean;
|
|
@@ -3376,6 +3409,7 @@ declare namespace LocalJSX {
|
|
|
3376
3409
|
"fontFeature": TextFontFeature;
|
|
3377
3410
|
"as": TextElement;
|
|
3378
3411
|
"for": string | undefined;
|
|
3412
|
+
"textId": string | undefined;
|
|
3379
3413
|
}
|
|
3380
3414
|
interface DsToggleAttributes {
|
|
3381
3415
|
"checked": boolean;
|
|
@@ -3517,8 +3551,9 @@ declare module "@stencil/core" {
|
|
|
3517
3551
|
*/
|
|
3518
3552
|
"ds-tooltip": LocalJSX.IntrinsicElements["ds-tooltip"] & JSXBase.HTMLAttributes<HTMLDsTooltipElement>;
|
|
3519
3553
|
/**
|
|
3520
|
-
* Positioned value/label callout for chart hover interactions (
|
|
3521
|
-
*
|
|
3554
|
+
* Positioned value/label callout for chart hover interactions (bar, line point, …).
|
|
3555
|
+
* Donut charts skip this — legend sync already surfaces the hovered slice.
|
|
3556
|
+
* Unlike `ds-tooltip`, this doesn't bind to a slotted anchor element —
|
|
3522
3557
|
* charts hover-highlight data that lives inside an SVG, so the chart itself computes
|
|
3523
3558
|
* the anchor point (e.g. the cursor position while hovering) and passes it in as `x`/`y`.
|
|
3524
3559
|
* Renders `position: absolute` — place inside a `position: relative` chart wrapper,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Apply `.ds-control--md|sm|xs` on the control (host or inner row). Then use the
|
|
6
6
|
* `--ds-control-*` vars for height, padding, icon box, label inset, gap, and radius.
|
|
7
|
+
* Text line-height belongs exclusively to the selected `ds-text` variant.
|
|
7
8
|
*
|
|
8
9
|
* Both `:host(.ds-control--*)` and `.ds-control--*` are listed so Stencil scoped
|
|
9
10
|
* components work whether the class is on the host (Tag) or an inner item (PanelNav).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TextVariant } from '../components/Text/text-types';
|
|
2
|
+
|
|
3
|
+
/** Shared public control sizes. Typography is derived; it is not a separate density API. */
|
|
4
|
+
export type ControlSize = 'md' | 'sm' | 'xs';
|
|
5
|
+
|
|
6
|
+
/** Complete text variant selected internally by each control size. */
|
|
7
|
+
export const CONTROL_TEXT_VARIANT: Record<ControlSize, TextVariant> = {
|
|
8
|
+
md: 'text-body-medium',
|
|
9
|
+
sm: 'text-body-small',
|
|
10
|
+
xs: 'text-caption',
|
|
11
|
+
};
|
package/src/wc/utils/index.ts
CHANGED
|
@@ -23,3 +23,5 @@ export { TOKEN_DEFAULTS, TOKEN_CSS_LENGTHS } from './token-defaults';
|
|
|
23
23
|
export type { TokenDefaultKey } from './token-defaults';
|
|
24
24
|
export { controlWidthClass } from './control-width';
|
|
25
25
|
export type { ControlWidth } from './control-width';
|
|
26
|
+
export { CONTROL_TEXT_VARIANT } from './control-text';
|
|
27
|
+
export type { ControlSize } from './control-text';
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
box-shadow: inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/* Opt-in
|
|
79
|
+
/* Opt-in secondary inset border (override color via `--ds-interaction-border-color`). */
|
|
80
80
|
:host(.ds-interaction-fill--bordered),
|
|
81
81
|
.ds-interaction-fill--bordered {
|
|
82
82
|
--ds-interaction-border-width: var(--dimension-stroke-width-012);
|
|
83
|
-
--ds-interaction-border-color: var(--color-border-
|
|
83
|
+
--ds-interaction-border-color: var(--color-border-secondary);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
:host(.ds-interaction-fill--selected)::before,
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Internal typography recipes shared by ds-text and native text surfaces that
|
|
3
|
+
* cannot render a custom element (for example, an <input> value).
|
|
4
|
+
*
|
|
5
|
+
* Each variant owns its font-size + line-height pairing. Never override one
|
|
6
|
+
* without the other from a consuming component.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
:host(.ds-text--display-medium),
|
|
10
|
+
.ds-text--display-medium {
|
|
11
|
+
font-size: var(--typography-fontsize-3xl);
|
|
12
|
+
line-height: var(--typography-lineheight-3xl);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host(.ds-text--display-small),
|
|
16
|
+
.ds-text--display-small {
|
|
17
|
+
font-size: var(--typography-fontsize-2xl);
|
|
18
|
+
line-height: var(--typography-lineheight-2xl);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host(.ds-text--title-large),
|
|
22
|
+
.ds-text--title-large {
|
|
23
|
+
font-size: var(--typography-fontsize-xl);
|
|
24
|
+
line-height: var(--typography-lineheight-xl);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host(.ds-text--title-medium),
|
|
28
|
+
.ds-text--title-medium {
|
|
29
|
+
font-size: var(--typography-fontsize-lg);
|
|
30
|
+
line-height: var(--typography-lineheight-lg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host(.ds-text--title-small),
|
|
34
|
+
.ds-text--title-small {
|
|
35
|
+
font-size: var(--typography-fontsize-md);
|
|
36
|
+
line-height: var(--typography-lineheight-md);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host(.ds-text--body-large),
|
|
40
|
+
.ds-text--body-large {
|
|
41
|
+
font-size: var(--typography-fontsize-lg);
|
|
42
|
+
line-height: var(--typography-lineheight-lg);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host(.ds-text--body-medium),
|
|
46
|
+
.ds-text--body-medium {
|
|
47
|
+
font-size: var(--typography-fontsize-md);
|
|
48
|
+
line-height: var(--typography-lineheight-md);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host(.ds-text--body-small),
|
|
52
|
+
.ds-text--body-small {
|
|
53
|
+
font-size: var(--typography-fontsize-sm);
|
|
54
|
+
line-height: var(--typography-lineheight-sm);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host(.ds-text--caption),
|
|
58
|
+
.ds-text--caption {
|
|
59
|
+
font-size: var(--typography-fontsize-xs);
|
|
60
|
+
line-height: var(--typography-lineheight-xs);
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host(.ds-text--display-medium.ds-text--emphasis),
|
|
65
|
+
:host(.ds-text--display-small.ds-text--emphasis),
|
|
66
|
+
.ds-text--display-medium.ds-text--emphasis,
|
|
67
|
+
.ds-text--display-small.ds-text--emphasis {
|
|
68
|
+
font-weight: var(--typography-weight-bold);
|
|
69
|
+
letter-spacing: var(--typography-letterspacing-negative-double);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host(.ds-text--display-medium.ds-text--regular),
|
|
73
|
+
:host(.ds-text--display-small.ds-text--regular),
|
|
74
|
+
.ds-text--display-medium.ds-text--regular,
|
|
75
|
+
.ds-text--display-small.ds-text--regular {
|
|
76
|
+
font-weight: var(--typography-weight-regular);
|
|
77
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host(.ds-text--title-large.ds-text--emphasis),
|
|
81
|
+
.ds-text--title-large.ds-text--emphasis {
|
|
82
|
+
font-weight: var(--typography-weight-semibold);
|
|
83
|
+
letter-spacing: var(--typography-letterspacing-negative-double);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host(.ds-text--title-large.ds-text--regular),
|
|
87
|
+
.ds-text--title-large.ds-text--regular {
|
|
88
|
+
font-weight: var(--typography-weight-regular);
|
|
89
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host(.ds-text--title-medium.ds-text--emphasis),
|
|
93
|
+
:host(.ds-text--title-small.ds-text--emphasis),
|
|
94
|
+
.ds-text--title-medium.ds-text--emphasis,
|
|
95
|
+
.ds-text--title-small.ds-text--emphasis {
|
|
96
|
+
font-weight: var(--typography-weight-semibold);
|
|
97
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host(.ds-text--title-medium.ds-text--regular),
|
|
101
|
+
:host(.ds-text--title-small.ds-text--regular),
|
|
102
|
+
.ds-text--title-medium.ds-text--regular,
|
|
103
|
+
.ds-text--title-small.ds-text--regular {
|
|
104
|
+
font-weight: var(--typography-weight-regular);
|
|
105
|
+
letter-spacing: var(--typography-letterspacing-negative-half);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host(.ds-text--body-large.ds-text--emphasis),
|
|
109
|
+
:host(.ds-text--body-medium.ds-text--emphasis),
|
|
110
|
+
.ds-text--body-large.ds-text--emphasis,
|
|
111
|
+
.ds-text--body-medium.ds-text--emphasis {
|
|
112
|
+
font-weight: var(--typography-weight-medium);
|
|
113
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host(.ds-text--body-large.ds-text--regular),
|
|
117
|
+
:host(.ds-text--body-medium.ds-text--regular),
|
|
118
|
+
.ds-text--body-large.ds-text--regular,
|
|
119
|
+
.ds-text--body-medium.ds-text--regular {
|
|
120
|
+
font-weight: var(--typography-weight-regular);
|
|
121
|
+
letter-spacing: var(--typography-letterspacing-negative-half);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host(.ds-text--body-small.ds-text--emphasis),
|
|
125
|
+
.ds-text--body-small.ds-text--emphasis {
|
|
126
|
+
font-weight: var(--typography-weight-medium);
|
|
127
|
+
letter-spacing: var(--typography-letterspacing-negative-half);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host(.ds-text--body-small.ds-text--regular),
|
|
131
|
+
.ds-text--body-small.ds-text--regular {
|
|
132
|
+
font-weight: var(--typography-weight-regular);
|
|
133
|
+
letter-spacing: var(--typography-letterspacing-none);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host(.ds-text--caption.ds-text--emphasis),
|
|
137
|
+
.ds-text--caption.ds-text--emphasis {
|
|
138
|
+
font-weight: var(--typography-weight-semibold);
|
|
139
|
+
letter-spacing: var(--typography-letterspacing-positive);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host(.ds-text--caption.ds-text--regular),
|
|
143
|
+
.ds-text--caption.ds-text--regular {
|
|
144
|
+
font-weight: var(--typography-weight-medium);
|
|
145
|
+
letter-spacing: var(--typography-letterspacing-positive);
|
|
146
|
+
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as o,H as r,c as t,h as s,a as n,t as a}from"./index.js";import{g as i,i as e}from"./p-BQq26pt9.js";import{d}from"./p-EK1hOP19.js";const c=()=>`.sc-ds-tab-group-nav-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-tab-group-nav:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-tab-group-nav{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-tab-group-nav:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-tab-group-nav:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-tab-group-nav{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-tab-group-nav::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-control-inactive.sc-ds-tab-group-nav-h,.ds-control-inactive.sc-ds-tab-group-nav{opacity:0.25;pointer-events:none;cursor:not-allowed}.sc-ds-tab-group-nav-h{display:block}.tab-list.sc-ds-tab-group-nav{display:flex;align-items:center;gap:var(--dimension-space-050);position:relative}.tab-list--vertical.sc-ds-tab-group-nav{flex-direction:column;align-items:stretch}.tab.sc-ds-tab-group-nav{display:flex;align-items:center;justify-content:center;gap:var(--dimension-space-050);padding:var(--dimension-space-075);background-color:transparent;border:none;border-radius:var(--dimension-radius-025);cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--color-foreground-secondary);position:relative;transition:color var(--effect-motion-short-2);flex-shrink:0;height:var(--dimension-size-400);min-width:var(--dimension-size-400);box-sizing:border-box;--_hover-bg:var(--color-interaction-hover);--_pressed-bg:var(--color-interaction-pressed);--_dot:var(--color-foreground-bold-brand);--_dot-ring:var(--color-background-secondary)}.tab.sc-ds-tab-group-nav::after{content:'';position:absolute;inset:0;border-radius:var(--dimension-radius-025, 2px);background:transparent;pointer-events:none;transition:none}.tab.sc-ds-tab-group-nav:hover::after{background:var(--_hover-bg);transition:none}.tab.sc-ds-tab-group-nav:active::after{background:var(--_pressed-bg);transition:none}.tab--selected.sc-ds-tab-group-nav{color:var(--color-foreground-primary)}.tab-list--vertical.sc-ds-tab-group-nav .tab.sc-ds-tab-group-nav{justify-content:flex-start}.tab__label.sc-ds-tab-group-nav{position:relative;display:inline-flex;align-items:center;padding:0 var(--dimension-space-025);white-space:nowrap}.tab__label--dot.sc-ds-tab-group-nav{padding-right:calc(var(--dimension-space-025) + var(--dimension-space-050))}.tab__dot.sc-ds-tab-group-nav{position:absolute;top:0;right:0;pointer-events:none}.on-medium.sc-ds-tab-group-nav{--_hover-bg:var(--color-interaction-on-medium-background-hover);--_pressed-bg:var(--color-interaction-on-medium-background-pressed);--_dot-ring:var(--color-background-medium-neutral);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.on-bold.sc-ds-tab-group-nav{--_hover-bg:var(--color-interaction-on-bold-background-hover);--_pressed-bg:var(--color-interaction-on-bold-background-pressed);--_dot-ring:var(--color-background-bold-neutral);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus);color:var(--color-foreground-on-bold-background-secondary)}.on-bold.tab--selected.sc-ds-tab-group-nav{color:var(--color-foreground-on-bold-background-primary)}.on-strong.sc-ds-tab-group-nav{--_hover-bg:var(--color-interaction-on-strong-background-hover);--_pressed-bg:var(--color-interaction-on-strong-background-pressed);--_dot-ring:var(--color-background-strong-neutral);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus);color:var(--color-foreground-on-bold-background-secondary)}.on-strong.tab--selected.sc-ds-tab-group-nav{color:var(--color-foreground-on-bold-background-primary)}.on-always-dark.sc-ds-tab-group-nav{--_hover-bg:var(--color-always-dark-interaction-hover);--_pressed-bg:var(--color-always-dark-interaction-pressed);--_dot-ring:var(--color-always-dark-background);--ds-focus-ring-color:var(--color-always-dark-interaction-focus);color:var(--color-always-dark-foreground-secondary)}.on-always-dark.tab--selected.sc-ds-tab-group-nav{color:var(--color-always-dark-foreground-primary)}.on-navigation.sc-ds-tab-group-nav{color:var(--color-navigation-foreground-secondary);--_hover-bg:var(--color-navigation-interaction-hover);--_pressed-bg:var(--color-navigation-interaction-pressed);--_dot:var(--color-navigation-foreground-brand);--_dot-ring:var(--color-navigation-background);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.on-navigation.tab--selected.sc-ds-tab-group-nav{color:var(--color-navigation-foreground-primary)}.tab-list--on-navigation.sc-ds-tab-group-nav .tab-divider__line.sc-ds-tab-group-nav{background-color:var(--color-navigation-border-tertiary)}.tab-divider.sc-ds-tab-group-nav{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--dimension-space-100);height:var(--dimension-size-400);padding-block:var(--dimension-space-075);flex-shrink:0;pointer-events:none}.tab-divider__line.sc-ds-tab-group-nav{width:var(--dimension-stroke-width-012);align-self:stretch;background-color:var(--color-border-secondary)}.tab-divider--vertical.sc-ds-tab-group-nav{width:auto;height:var(--dimension-space-100);align-self:stretch;padding-block:0;padding-inline:var(--dimension-space-075)}.tab-divider--vertical.sc-ds-tab-group-nav .tab-divider__line.sc-ds-tab-group-nav{width:auto;height:var(--dimension-stroke-width-012);align-self:stretch}`;const l=o(class o extends r{constructor(o){super();if(o!==false){this.__registerHost()}this.dsChange=t(this,"dsChange");this.dsRovingExit=t(this,"dsRovingExit");this.value="";this.tabs=[];this.orientation="horizontal";this.selectionFollowsFocus=true;this.rovingEnabled=true;this.focusedTabId=""}get selectableTabs(){return i(this.tabs)}componentWillLoad(){this.syncFocusedTabId(this.value)}onValueChange(o,r){if(!this.selectionFollowsFocus){if(r===undefined||o!==this.focusedTabId){this.syncFocusedTabId(o)}return}if(r===undefined||o===r)return;requestAnimationFrame((()=>{const r=document.activeElement;if(!r||!this.el.contains(r))return;const t=r.getAttribute("data-tab-id");if(t===o)return;const s=this.el.querySelector(`[data-tab-id="${o}"]`);if(s){s.focus({preventScroll:true})}else{r.blur()}}))}onTabsChange(){if(!this.selectableTabs.some((o=>o.id===this.focusedTabId))){this.syncFocusedTabId(this.value)}}async focusTab(o){this.focusedTabId=o;const r=this.el.querySelector(`[data-tab-id="${o}"]`);r?.focus({preventScroll:true})}async focusLastTab(){const o=this.selectableTabs;const r=[...o].reverse().find((o=>!o.isInactive));if(r)await this.focusTab(r.id)}async focusFirstTab(){const o=this.selectableTabs.find((o=>!o.isInactive));if(o)await this.focusTab(o.id)}syncFocusedTabId(o){const r=this.selectableTabs;if(r.some((r=>r.id===o&&!r.isInactive))){this.focusedTabId=o;return}const t=r.find((o=>!o.isInactive));this.focusedTabId=t?.id??""}selectTab(o,r){this.value=o;this.focusedTabId=o;this.dsChange.emit(o);if(r?.focus!==false){void this.focusTab(o)}}getFocusedIndex(){return this.selectableTabs.findIndex((o=>o.id===this.focusedTabId))}findEnabledLinear(o,r){const t=this.selectableTabs;for(let s=o+r;s>=0&&s<t.length;s+=r){if(!t[s]?.isInactive)return s}return null}findEnabled(o,r){const t=this.selectableTabs;const s=t.length;for(let n=0;n<s;n++){const a=(o+r*(n+1)+s*(n+1))%s;if(!t[a]?.isInactive)return a}return o}moveFocusToIndex(o){const r=this.selectableTabs[o];if(!r)return;this.focusedTabId=r.id;void this.focusTab(r.id)}activateFocusedTab(o){if(o.key!=="Enter"&&o.key!==" ")return;const r=this.selectableTabs.find((o=>o.id===this.focusedTabId));if(!r||r.isInactive)return;o.preventDefault();this.selectTab(r.id,{focus:true})}handleKeyDown(o){const r=this.selectableTabs;if(!r.length)return;if(!this.selectionFollowsFocus){if(o.key==="Enter"||o.key===" "){this.activateFocusedTab(o);return}}const t=this.selectionFollowsFocus?r.findIndex((o=>o.id===this.value)):this.getFocusedIndex();if(t<0)return;const s=this.orientation==="vertical";let n=null;let a=null;if(!s){if(o.key==="ArrowRight"){if(this.selectionFollowsFocus){n=this.findEnabled(t,1)}else{const o=this.findEnabledLinear(t,1);if(o===null)a="end";else n=o}}else if(o.key==="ArrowLeft"){if(this.selectionFollowsFocus){n=this.findEnabled(t,-1)}else{const o=this.findEnabledLinear(t,-1);if(o===null)a="start";else n=o}}}else{if(o.key==="ArrowDown"){if(this.selectionFollowsFocus){n=this.findEnabled(t,1)}else{const o=this.findEnabledLinear(t,1);if(o===null)a="end";else n=o}}else if(o.key==="ArrowUp"){if(this.selectionFollowsFocus){n=this.findEnabled(t,-1)}else{const o=this.findEnabledLinear(t,-1);if(o===null)a="start";else n=o}}}if(o.key==="Home"){const o=r.findIndex((o=>!o.isInactive));n=o===-1?null:o}else if(o.key==="End"){const o=[...r].reverse().findIndex((o=>!o.isInactive));n=o===-1?null:r.length-1-o}if(a){o.preventDefault();this.dsRovingExit.emit(a);return}if(n!==null&&n!==t){o.preventDefault();const t=r[n];if(this.selectionFollowsFocus){this.selectTab(t.id)}else{this.moveFocusToIndex(n)}}}getBgClass(){if(!this.background||this.background==="faint")return"";if(this.background==="always-dark")return"on-always-dark";if(this.background==="navigation")return"on-navigation";return`on-${this.background}`}tabIndexForTab(o){if(!this.rovingEnabled)return-1;if(this.selectionFollowsFocus){return o.id===this.value?0:-1}return o.id===this.focusedTabId?0:-1}render(){const o=this.getBgClass();const r=this.orientation==="vertical";const t=this.background==="navigation";return s(n,{key:"78efd00569e0f71d8a3cecc991d3ced1b369353f",class:"tab-group-nav-host"},s("div",{key:"d810f8b9d3a081271c52747a751ca5ad0347f8dd",role:"tablist",class:{"tab-list":true,"tab-list--vertical":r,"tab-list--on-navigation":t},"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-orientation":r?"vertical":undefined},this.tabs.map(((t,n)=>{if(e(t)){return s("div",{key:`divider-${n}`,class:{"tab-divider":true,"tab-divider--vertical":r},"aria-hidden":"true"},s("div",{class:"tab-divider__line"}))}const a=t.id===this.value;return s("button",{key:t.id,type:"button",role:"tab","data-tab-id":t.id,class:{tab:true,"tab--selected":a,"ds-focus-ring-inset":true,"ds-control-inactive":!!t.isInactive,[o]:!!o},"aria-selected":a,"aria-disabled":t.isInactive||undefined,"aria-controls":t.panelId??undefined,disabled:t.isInactive,tabIndex:this.tabIndexForTab(t),onClick:()=>!t.isInactive&&this.selectTab(t.id),onFocus:()=>{if(!this.selectionFollowsFocus){this.focusedTabId=t.id}}},s("span",{class:{tab__label:true,"tab__label--dot":!!t.dot,[a?"text-body-medium-emphasis":"text-body-medium"]:true}},t.label,t.dot&&s("ds-badge",{class:"tab__dot",variant:"dot",background:"var(--_dot-ring)",label:"","aria-hidden":"true"})))}))))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}],tabs:[{onTabsChange:0}]}}static get style(){return c()}},[2,"ds-tab-group-nav",{value:[1025],tabs:[16],background:[1],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],orientation:[1],selectionFollowsFocus:[4,"selection-follows-focus"],rovingEnabled:[4,"roving-enabled"],focusedTabId:[32],focusTab:[64],focusLastTab:[64],focusFirstTab:[64]},[[0,"keydown","handleKeyDown"]],{value:[{onValueChange:0}],tabs:[{onTabsChange:0}]}]);function u(){if(typeof customElements==="undefined"){return}const o=["ds-tab-group-nav","ds-badge"];o.forEach((o=>{switch(o){case"ds-tab-group-nav":if(!customElements.get(a(o))){customElements.define(a(o),l)}break;case"ds-badge":if(!customElements.get(a(o))){d()}break}}))}u();export{l as T,u as d};
|
|
2
|
-
//# sourceMappingURL=p-1m8r0wFg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["tabGroupNavCss","TabGroupNav","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","value","tabs","orientation","selectionFollowsFocus","rovingEnabled","focusedTabId","selectableTabs","getSelectableTabs","componentWillLoad","syncFocusedTabId","onValueChange","next","prev","undefined","requestAnimationFrame","active","document","activeElement","el","contains","activeId","getAttribute","nextTab","querySelector","focus","preventScroll","blur","onTabsChange","some","tab","id","focusTab","btn","focusLastTab","last","reverse","find","isInactive","focusFirstTab","first","preferred","selectTab","options","dsChange","emit","getFocusedIndex","findIndex","findEnabledLinear","from","step","i","length","findEnabled","len","n","moveFocusToIndex","nextIdx","activateFocusedTab","e","key","item","preventDefault","handleKeyDown","currentIdx","t","isVertical","exit","candidate","lastEnabled","dsRovingExit","getBgClass","background","tabIndexForTab","render","bgClass","isNavigation","h","Host","class","role","ariaLabel","ariaLabelledby","map","index","isTabDivider","isSelected","type","panelId","disabled","tabIndex","onClick","onFocus","tab__label","dot","label","variant"],"sources":["src/wc/components/TabGroupNav/TabGroupNav.css?tag=ds-tab-group-nav&encapsulation=scoped","src/wc/components/TabGroupNav/TabGroupNav.tsx"],"sourcesContent":["@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n:host {\n display: block;\n}\n\n.tab-list {\n display: flex;\n align-items: center;\n gap: var(--dimension-space-050);\n position: relative;\n}\n\n/* Vertical orientation */\n.tab-list--vertical {\n flex-direction: column;\n align-items: stretch;\n}\n\n.tab {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--dimension-space-050);\n padding: var(--dimension-space-075);\n background-color: transparent;\n border: none;\n border-radius: var(--dimension-radius-025);\n cursor: pointer;\n -webkit-user-select: none;\n user-select: none;\n color: var(--color-foreground-secondary);\n position: relative;\n /* Only transition color — hover bg is instant (see ::after below) */\n transition: color var(--effect-motion-short-2);\n flex-shrink: 0;\n height: var(--dimension-size-400);\n min-width: var(--dimension-size-400);\n box-sizing: border-box;\n --_hover-bg: var(--color-interaction-hover);\n --_pressed-bg: var(--color-interaction-pressed);\n --_dot: var(--color-foreground-bold-brand);\n --_dot-ring: var(--color-background-secondary);\n}\n\n/* Interaction layer — same pattern as PanelNav */\n.tab::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: var(--dimension-radius-025, 2px);\n background: transparent;\n pointer-events: none;\n transition: none;\n}\n\n.tab:hover::after { background: var(--_hover-bg); transition: none; }\n.tab:active::after { background: var(--_pressed-bg); transition: none; }\n\n.tab--selected { color: var(--color-foreground-primary); }\n\n/* Inactive: `.ds-control-inactive` (25% opacity) — applied via class in TSX. */\n\n/* Vertical tabs read as a list — left-align the label */\n.tab-list--vertical .tab { justify-content: flex-start; }\n\n/* Label — dot anchors top-right like BarNav action icon zone */\n.tab__label {\n position: relative;\n display: inline-flex;\n align-items: center;\n padding: 0 var(--dimension-space-025);\n white-space: nowrap;\n}\n\n/* Clearance for top-right dot — slightly less than space-025 + space-075 */\n.tab__label--dot {\n padding-right: calc(var(--dimension-space-025) + var(--dimension-space-050));\n}\n\n/* Notification dot — top-right corner of the label zone */\n.tab__dot {\n position: absolute;\n top: 0;\n right: 0;\n pointer-events: none;\n}\n\n/* Background context */\n.on-medium {\n --_hover-bg: var(--color-interaction-on-medium-background-hover);\n --_pressed-bg: var(--color-interaction-on-medium-background-pressed);\n --_dot-ring: var(--color-background-medium-neutral);\n --ds-focus-ring-color: var(--color-interaction-on-medium-background-focus);\n}\n\n.on-bold {\n --_hover-bg: var(--color-interaction-on-bold-background-hover);\n --_pressed-bg: var(--color-interaction-on-bold-background-pressed);\n --_dot-ring: var(--color-background-bold-neutral);\n --ds-focus-ring-color: var(--color-interaction-on-bold-background-focus);\n color: var(--color-foreground-on-bold-background-secondary);\n}\n\n.on-bold.tab--selected { color: var(--color-foreground-on-bold-background-primary); }\n\n.on-strong {\n --_hover-bg: var(--color-interaction-on-strong-background-hover);\n --_pressed-bg: var(--color-interaction-on-strong-background-pressed);\n --_dot-ring: var(--color-background-strong-neutral);\n --ds-focus-ring-color: var(--color-interaction-on-strong-background-focus);\n color: var(--color-foreground-on-bold-background-secondary);\n}\n\n.on-strong.tab--selected { color: var(--color-foreground-on-bold-background-primary); }\n\n.on-always-dark {\n --_hover-bg: var(--color-always-dark-interaction-hover);\n --_pressed-bg: var(--color-always-dark-interaction-pressed);\n --_dot-ring: var(--color-always-dark-background);\n --ds-focus-ring-color: var(--color-always-dark-interaction-focus);\n color: var(--color-always-dark-foreground-secondary);\n}\n\n.on-always-dark.tab--selected { color: var(--color-always-dark-foreground-primary); }\n\n.on-navigation {\n color: var(--color-navigation-foreground-secondary);\n --_hover-bg: var(--color-navigation-interaction-hover);\n --_pressed-bg: var(--color-navigation-interaction-pressed);\n --_dot: var(--color-navigation-foreground-brand);\n --_dot-ring: var(--color-navigation-background);\n --ds-focus-ring-color: var(--color-navigation-interaction-focus);\n}\n\n.on-navigation.tab--selected { color: var(--color-navigation-foreground-primary); }\n\n.tab-list--on-navigation .tab-divider__line {\n background-color: var(--color-navigation-border-tertiary);\n}\n\n/* In-tablist visual group separator — not focusable, skipped by keyboard nav */\n.tab-divider {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--dimension-space-100);\n height: var(--dimension-size-400);\n padding-block: var(--dimension-space-075);\n flex-shrink: 0;\n pointer-events: none;\n}\n\n.tab-divider__line {\n width: var(--dimension-stroke-width-012);\n align-self: stretch;\n background-color: var(--color-border-secondary);\n}\n\n.tab-divider--vertical {\n width: auto;\n height: var(--dimension-space-100);\n align-self: stretch;\n padding-block: 0;\n padding-inline: var(--dimension-space-075);\n}\n\n.tab-divider--vertical .tab-divider__line {\n width: auto;\n height: var(--dimension-stroke-width-012);\n align-self: stretch;\n}\n","import { Component, Prop, Event, EventEmitter, Element, Listen, Watch, Method, State, h, Host } from '@stencil/core';\nimport {\n getSelectableTabs,\n isTabDivider,\n type TabItem,\n type TabItemTab,\n} from '../TabGroup/tab-item-utils';\n\nexport type TabGroupNavBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark' | 'navigation';\n\n@Component({\n tag: 'ds-tab-group-nav',\n styleUrl: 'TabGroupNav.css',\n scoped: true,\n})\nexport class TabGroupNav {\n @Element() el!: HTMLElement;\n\n @Prop({ mutable: true }) value: string = '';\n @Prop() tabs: TabItem[] = [];\n @Prop() background: TabGroupNavBackground | undefined;\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | undefined;\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n @Prop() orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * When `false`, arrow keys move focus only — Space/Enter (or click) commits selection.\n * Used by bar nav where each tab is a full page transition.\n */\n @Prop() selectionFollowsFocus: boolean = true;\n\n /** When `false`, every tab uses `tabindex=\"-1\"` (another chrome control owns the tab stop). */\n @Prop() rovingEnabled: boolean = true;\n\n @Event() dsChange!: EventEmitter<string>;\n\n /** Fired when arrow navigation reaches the first/last tab in manual selection mode. */\n @Event() dsRovingExit!: EventEmitter<'start' | 'end'>;\n\n @State() private focusedTabId: string = '';\n\n private get selectableTabs(): TabItemTab[] {\n return getSelectableTabs(this.tabs);\n }\n\n componentWillLoad() {\n this.syncFocusedTabId(this.value);\n }\n\n @Watch('value')\n onValueChange(next: string, prev: string | undefined) {\n if (!this.selectionFollowsFocus) {\n if (prev === undefined || next !== this.focusedTabId) {\n this.syncFocusedTabId(next);\n }\n return;\n }\n\n if (prev === undefined || next === prev) return;\n\n requestAnimationFrame(() => {\n const active = document.activeElement as HTMLElement | null;\n if (!active || !this.el.contains(active)) return;\n\n const activeId = active.getAttribute('data-tab-id');\n if (activeId === next) return;\n\n const nextTab = this.el.querySelector(`[data-tab-id=\"${next}\"]`) as HTMLElement | null;\n if (nextTab) {\n nextTab.focus({ preventScroll: true });\n } else {\n active.blur();\n }\n });\n }\n\n @Watch('tabs')\n onTabsChange() {\n if (!this.selectableTabs.some(tab => tab.id === this.focusedTabId)) {\n this.syncFocusedTabId(this.value);\n }\n }\n\n @Method()\n async focusTab(id: string) {\n this.focusedTabId = id;\n const btn = this.el.querySelector(`[data-tab-id=\"${id}\"]`) as HTMLElement | null;\n btn?.focus({ preventScroll: true });\n }\n\n @Method()\n async focusLastTab() {\n const tabs = this.selectableTabs;\n const last = [...tabs].reverse().find(tab => !tab.isInactive);\n if (last) await this.focusTab(last.id);\n }\n\n @Method()\n async focusFirstTab() {\n const first = this.selectableTabs.find(tab => !tab.isInactive);\n if (first) await this.focusTab(first.id);\n }\n\n private syncFocusedTabId(preferred: string) {\n const tabs = this.selectableTabs;\n if (tabs.some(tab => tab.id === preferred && !tab.isInactive)) {\n this.focusedTabId = preferred;\n return;\n }\n const first = tabs.find(tab => !tab.isInactive);\n this.focusedTabId = first?.id ?? '';\n }\n\n private selectTab(id: string, options?: { focus?: boolean }) {\n this.value = id;\n this.focusedTabId = id;\n this.dsChange.emit(id);\n if (options?.focus !== false) {\n void this.focusTab(id);\n }\n }\n\n private getFocusedIndex(): number {\n return this.selectableTabs.findIndex(tab => tab.id === this.focusedTabId);\n }\n\n private findEnabledLinear(from: number, step: 1 | -1): number | null {\n const tabs = this.selectableTabs;\n for (let i = from + step; i >= 0 && i < tabs.length; i += step) {\n if (!tabs[i]?.isInactive) return i;\n }\n return null;\n }\n\n /**\n * Find the next non-inactive tab index relative to `from`, stepping by `step`.\n * Returns `from` unchanged if no other enabled tab exists.\n */\n private findEnabled(from: number, step: 1 | -1): number {\n const tabs = this.selectableTabs;\n const len = tabs.length;\n for (let n = 0; n < len; n++) {\n const i = (from + step * (n + 1) + len * (n + 1)) % len;\n if (!tabs[i]?.isInactive) return i;\n }\n return from;\n }\n\n private moveFocusToIndex(nextIdx: number) {\n const next = this.selectableTabs[nextIdx];\n if (!next) return;\n this.focusedTabId = next.id;\n void this.focusTab(next.id);\n }\n\n private activateFocusedTab(e: KeyboardEvent) {\n if (e.key !== 'Enter' && e.key !== ' ') return;\n const tab = this.selectableTabs.find(item => item.id === this.focusedTabId);\n if (!tab || tab.isInactive) return;\n e.preventDefault();\n this.selectTab(tab.id, { focus: true });\n }\n\n @Listen('keydown')\n handleKeyDown(e: KeyboardEvent) {\n const tabs = this.selectableTabs;\n if (!tabs.length) return;\n\n if (!this.selectionFollowsFocus) {\n if (e.key === 'Enter' || e.key === ' ') {\n this.activateFocusedTab(e);\n return;\n }\n }\n\n const currentIdx = this.selectionFollowsFocus\n ? tabs.findIndex(t => t.id === this.value)\n : this.getFocusedIndex();\n if (currentIdx < 0) return;\n\n const isVertical = this.orientation === 'vertical';\n let nextIdx: number | null = null;\n let exit: 'start' | 'end' | null = null;\n\n if (!isVertical) {\n if (e.key === 'ArrowRight') {\n if (this.selectionFollowsFocus) {\n nextIdx = this.findEnabled(currentIdx, 1);\n } else {\n const candidate = this.findEnabledLinear(currentIdx, 1);\n if (candidate === null) exit = 'end';\n else nextIdx = candidate;\n }\n } else if (e.key === 'ArrowLeft') {\n if (this.selectionFollowsFocus) {\n nextIdx = this.findEnabled(currentIdx, -1);\n } else {\n const candidate = this.findEnabledLinear(currentIdx, -1);\n if (candidate === null) exit = 'start';\n else nextIdx = candidate;\n }\n }\n } else {\n if (e.key === 'ArrowDown') {\n if (this.selectionFollowsFocus) {\n nextIdx = this.findEnabled(currentIdx, 1);\n } else {\n const candidate = this.findEnabledLinear(currentIdx, 1);\n if (candidate === null) exit = 'end';\n else nextIdx = candidate;\n }\n } else if (e.key === 'ArrowUp') {\n if (this.selectionFollowsFocus) {\n nextIdx = this.findEnabled(currentIdx, -1);\n } else {\n const candidate = this.findEnabledLinear(currentIdx, -1);\n if (candidate === null) exit = 'start';\n else nextIdx = candidate;\n }\n }\n }\n\n if (e.key === 'Home') {\n const first = tabs.findIndex(t => !t.isInactive);\n nextIdx = first === -1 ? null : first;\n } else if (e.key === 'End') {\n const lastEnabled = [...tabs].reverse().findIndex(t => !t.isInactive);\n nextIdx = lastEnabled === -1 ? null : tabs.length - 1 - lastEnabled;\n }\n\n if (exit) {\n e.preventDefault();\n this.dsRovingExit.emit(exit);\n return;\n }\n\n if (nextIdx !== null && nextIdx !== currentIdx) {\n e.preventDefault();\n const next = tabs[nextIdx];\n if (this.selectionFollowsFocus) {\n this.selectTab(next.id);\n } else {\n this.moveFocusToIndex(nextIdx);\n }\n }\n }\n\n private getBgClass(): string {\n if (!this.background || this.background === 'faint') return '';\n if (this.background === 'always-dark') return 'on-always-dark';\n if (this.background === 'navigation') return 'on-navigation';\n return `on-${this.background}`;\n }\n\n private tabIndexForTab(tab: TabItemTab): number {\n if (!this.rovingEnabled) return -1;\n if (this.selectionFollowsFocus) {\n return tab.id === this.value ? 0 : -1;\n }\n return tab.id === this.focusedTabId ? 0 : -1;\n }\n\n render() {\n const bgClass = this.getBgClass();\n const isVertical = this.orientation === 'vertical';\n const isNavigation = this.background === 'navigation';\n\n return (\n <Host class=\"tab-group-nav-host\">\n <div\n role=\"tablist\"\n class={{\n 'tab-list': true,\n 'tab-list--vertical': isVertical,\n 'tab-list--on-navigation': isNavigation,\n }}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-orientation={isVertical ? 'vertical' : undefined}\n >\n {this.tabs.map((tab, index) => {\n if (isTabDivider(tab)) {\n return (\n <div\n key={`divider-${index}`}\n class={{\n 'tab-divider': true,\n 'tab-divider--vertical': isVertical,\n }}\n aria-hidden=\"true\"\n >\n <div class=\"tab-divider__line\" />\n </div>\n );\n }\n\n const isSelected = tab.id === this.value;\n return (\n <button\n key={tab.id}\n type=\"button\"\n role=\"tab\"\n data-tab-id={tab.id}\n class={{\n tab: true,\n 'tab--selected': isSelected,\n 'ds-focus-ring-inset': true,\n 'ds-control-inactive': !!tab.isInactive,\n [bgClass]: !!bgClass,\n }}\n aria-selected={isSelected}\n aria-disabled={tab.isInactive || undefined}\n aria-controls={tab.panelId ?? undefined}\n disabled={tab.isInactive}\n tabIndex={this.tabIndexForTab(tab)}\n onClick={() => !tab.isInactive && this.selectTab(tab.id)}\n onFocus={() => {\n if (!this.selectionFollowsFocus) {\n this.focusedTabId = tab.id;\n }\n }}\n >\n <span class={{\n tab__label: true,\n 'tab__label--dot': !!tab.dot,\n [isSelected ? 'text-body-medium-emphasis' : 'text-body-medium']: true,\n }}>\n {tab.label}\n {tab.dot && (\n <ds-badge\n class=\"tab__dot\"\n variant=\"dot\"\n background=\"var(--_dot-ring)\"\n label=\"\"\n aria-hidden=\"true\"\n />\n )}\n </span>\n </button>\n );\n })}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as d,H as a,h as r,a as e,t as i}from"./index.js";import{d as s}from"./p-CtwNUCnp.js";const c=()=>`.sc-ds-card-h{display:flex;flex-direction:column;box-sizing:border-box;width:var(--_card-width);min-height:var(--_card-min-height);max-width:100%;border:none;border-radius:var(--dimension-radius-025);background-color:var(--color-background-primary);box-shadow:0 0 0 var(--dimension-stroke-width-012) var(--color-border-tertiary);overflow:hidden}.card--editing.sc-ds-card-h{background-color:var(--color-background-bold-brand);box-shadow:0 0 0 var(--dimension-stroke-width-025) var(--color-border-bold-brand)}.card__header.sc-ds-card{display:flex;align-items:center;justify-content:space-between;gap:var(--dimension-space-100);height:var(--dimension-size-600);flex-shrink:0;padding:var(--dimension-space-100);background-color:var(--color-background-secondary);border-bottom:var(--dimension-stroke-width-012) solid var(--color-border-tertiary);box-sizing:border-box}.card--editing.sc-ds-card-h .card__header.sc-ds-card{background-color:transparent;border-bottom-color:transparent}.card__title-wrap.sc-ds-card{flex:1 1 auto;min-width:0;display:flex;align-items:center;padding:var(--dimension-space-075);box-sizing:border-box;-webkit-user-select:none;user-select:none}.card__title.sc-ds-card{display:inline-flex;align-items:center;min-width:0;padding:var(--dimension-space-025)}.card__actions.sc-ds-card{display:flex;flex-shrink:0;align-items:center;gap:var(--dimension-space-100)}.card__actions.sc-ds-card:empty{display:none}.card__body.sc-ds-card{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;border-radius:0 0 var(--dimension-radius-025) var(--dimension-radius-025);background-color:var(--color-background-primary);box-sizing:border-box}.card--editing.sc-ds-card-h .card__body.sc-ds-card{border-radius:var(--dimension-radius-025)}`;const o={sm:"var(--dimension-card-width-sm)",md:"var(--dimension-card-width-md)",lg:"var(--dimension-card-width-lg)"};const n={sm:"var(--dimension-card-height-sm)",md:"var(--dimension-card-height-md)",lg:"var(--dimension-card-height-lg)"};const t="var(--color-foreground-faint-brand)";const l=d(class d extends a{constructor(d){super();if(d!==false){this.__registerHost()}this.cardWidth="md";this.appearance="default"}render(){const d=this.appearance==="editing";return r(e,{key:"c0a1a2eed24f2fae229f75d8b27527ae0c5b832f",class:{card:true,"card--editing":d},style:{"--_card-width":o[this.cardWidth],"--_card-min-height":n[this.cardWidth]}},r("header",{key:"120832c3d2391a079bbe2cd034c339d7778ef98f",class:"card__header"},r("div",{key:"5579ce0f79d5d4bbd4df742216a7465614399daa",class:"card__title-wrap"},r("ds-text",{key:"759e9a6e4e13574ef6e9715a5d0aa62a6425a64d",class:"card__title",variant:"text-title-small",color:d?t:"primary",as:"h2"},this.heading)),r("div",{key:"a8a092f8e4dd0250975afdac050ab7d74fef46ff",class:"card__actions"},r("slot",{key:"dc531217d9737775310ebf04d7da3bf749dbd874",name:"actions"}))),r("div",{key:"31223265fa3b2efb8a39ecd86a6c8b3156fc0d2e",class:"card__body"},r("slot",{key:"92fc459b514100a0f2e29855dc62539625b85525"})))}static get style(){return c()}},[262,"ds-card",{heading:[1],cardWidth:[1,"card-width"],appearance:[1]}]);function b(){if(typeof customElements==="undefined"){return}const d=["ds-card","ds-text"];d.forEach((d=>{switch(d){case"ds-card":if(!customElements.get(i(d))){customElements.define(i(d),l)}break;case"ds-text":if(!customElements.get(i(d))){s()}break}}))}b();export{l as C,b as d};
|
|
2
|
-
//# sourceMappingURL=p-B2_D4IDN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["cardCss","CARD_WIDTH_VARS","sm","md","lg","CARD_HEIGHT_VARS","FAINT_BRAND_TITLE_COLOR","Card","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","cardWidth","appearance","render","editing","h","Host","key","class","card","style","variant","color","as","heading","name"],"sources":["src/wc/components/Card/Card.css?tag=ds-card&encapsulation=scoped","src/wc/components/Card/Card.tsx"],"sourcesContent":[":host {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: var(--_card-width);\n min-height: var(--_card-min-height);\n max-width: 100%;\n border: none;\n border-radius: var(--dimension-radius-025);\n background-color: var(--color-background-primary);\n box-shadow: 0 0 0 var(--dimension-stroke-width-012) var(--color-border-tertiary);\n overflow: hidden;\n}\n\n:host(.card--editing) {\n background-color: var(--color-background-bold-brand);\n box-shadow: 0 0 0 var(--dimension-stroke-width-025) var(--color-border-bold-brand);\n}\n\n.card__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--dimension-space-100);\n height: var(--dimension-size-600);\n flex-shrink: 0;\n padding: var(--dimension-space-100);\n background-color: var(--color-background-secondary);\n border-bottom: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n box-sizing: border-box;\n}\n\n:host(.card--editing) .card__header {\n background-color: transparent;\n border-bottom-color: transparent;\n}\n\n.card__title-wrap {\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n align-items: center;\n padding: var(--dimension-space-075);\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.card__title {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n padding: var(--dimension-space-025);\n}\n\n.card__actions {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n gap: var(--dimension-space-100);\n}\n\n.card__actions:empty {\n display: none;\n}\n\n.card__body {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n border-radius: 0 0 var(--dimension-radius-025) var(--dimension-radius-025);\n background-color: var(--color-background-primary);\n box-sizing: border-box;\n}\n\n:host(.card--editing) .card__body {\n border-radius: var(--dimension-radius-025);\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\nexport type CardWidth = 'sm' | 'md' | 'lg';\n\n/** Visual chrome recipe — default app surface, or settings edit wash. */\nexport type CardAppearance = 'default' | 'editing';\n\nconst CARD_WIDTH_VARS: Record<CardWidth, string> = {\n sm: 'var(--dimension-card-width-sm)',\n md: 'var(--dimension-card-width-md)',\n lg: 'var(--dimension-card-width-lg)',\n};\n\nconst CARD_HEIGHT_VARS: Record<CardWidth, string> = {\n sm: 'var(--dimension-card-height-sm)',\n md: 'var(--dimension-card-height-md)',\n lg: 'var(--dimension-card-height-lg)',\n};\n\nconst FAINT_BRAND_TITLE_COLOR = 'var(--color-foreground-faint-brand)';\n\n/**\n * Shared card chrome — width + matching min-height tokens, header (title + actions),\n * and a flex body that fills leftover space. Compose this from settings / data-viz cards.\n */\n@Component({\n tag: 'ds-card',\n styleUrl: 'Card.css',\n scoped: true,\n})\nexport class Card {\n /** Section heading shown in the card header. */\n @Prop() heading!: string;\n\n /**\n * Card width token (`sm` / `md` / `lg`). Also sets host `min-height` to the\n * matching `--dimension-card-height-*` so empty bodies still fill the card.\n */\n @Prop() cardWidth: CardWidth = 'md';\n\n /** Chrome recipe — `editing` applies the settings edit wash. */\n @Prop() appearance: CardAppearance = 'default';\n\n render() {\n const editing = this.appearance === 'editing';\n\n return (\n <Host\n class={{\n card: true,\n 'card--editing': editing,\n }}\n style={{\n '--_card-width': CARD_WIDTH_VARS[this.cardWidth],\n '--_card-min-height': CARD_HEIGHT_VARS[this.cardWidth],\n }}\n >\n <header class=\"card__header\">\n <div class=\"card__title-wrap\">\n <ds-text\n class=\"card__title\"\n variant=\"text-title-small\"\n color={editing ? FAINT_BRAND_TITLE_COLOR : 'primary'}\n as=\"h2\"\n >\n {this.heading}\n </ds-text>\n </div>\n <div class=\"card__actions\">\n <slot name=\"actions\" />\n </div>\n </header>\n <div class=\"card__body\">\n <slot />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"+FAAA,MAAMA,EAAU,IAAM,mtDCOtB,MAAMC,EAA6C,CACjDC,GAAI,iCACJC,GAAI,iCACJC,GAAI,kCAGN,MAAMC,EAA8C,CAClDH,GAAI,kCACJC,GAAI,kCACJC,GAAI,mCAGN,MAAME,EAA0B,sC,MAWnBC,EAAIC,EAAA,MAAAD,UAAAE,EALjB,WAAAC,CAAAC,G,4CAaUC,KAAAC,UAAuB,KAGvBD,KAAAE,WAA6B,SAqCtC,CAnCC,MAAAC,GACE,MAAMC,EAAUJ,KAAKE,aAAe,UAEpC,OACEG,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACLC,KAAM,KACN,gBAAiBL,GAEnBM,MAAO,CACL,gBAAiBrB,EAAgBW,KAAKC,WACtC,qBAAsBR,EAAiBO,KAAKC,aAG9CI,EAAA,UAAAE,IAAA,2CAAQC,MAAM,gBACZH,EAAA,OAAAE,IAAA,2CAAKC,MAAM,oBACTH,EAAA,WAAAE,IAAA,2CACEC,MAAM,cACNG,QAAQ,mBACRC,MAAOR,EAAUV,EAA0B,UAC3CmB,GAAG,MAEFb,KAAKc,UAGVT,EAAA,OAAAE,IAAA,2CAAKC,MAAM,iBACTH,EAAA,QAAAE,IAAA,2CAAMQ,KAAK,cAGfV,EAAA,OAAAE,IAAA,2CAAKC,MAAM,cACTH,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as t,H as o,c as n,h as i,a as d,t as l}from"./index.js";import{c as e}from"./p-DuFm-ieS.js";import{d as r}from"./p-B82KZX9D.js";const s=()=>`.sc-ds-button-filled-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-button-filled:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-button-filled{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-button-filled:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-button-filled:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-button-filled{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-button-filled::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-interaction-fill.sc-ds-button-filled-h,.ds-interaction-fill.sc-ds-button-filled{position:relative;z-index:0;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent}.ds-interaction-fill.sc-ds-button-filled-h::before,.ds-interaction-fill.sc-ds-button-filled::before,.ds-interaction-fill.sc-ds-button-filled-h::after,.ds-interaction-fill.sc-ds-button-filled::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;transition:none}.ds-interaction-fill.sc-ds-button-filled-h::before,.ds-interaction-fill.sc-ds-button-filled::before{z-index:1}.ds-interaction-fill.sc-ds-button-filled-h::after,.ds-interaction-fill.sc-ds-button-filled::after{z-index:3;box-shadow:inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-button-filled-h,.ds-interaction-fill--bordered.sc-ds-button-filled{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-tertiary)}.ds-interaction-fill--selected.sc-ds-button-filled-h::before,.ds-interaction-fill--selected.sc-ds-button-filled::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-button-filled-h,.ds-interaction-fill--selected.sc-ds-button-filled{--ds-interaction-dot-ring:var(--ds-interaction-active)}.ds-interaction-fill.sc-ds-button-filled-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-button-filled:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}.ds-interaction-fill.sc-ds-button-filled-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-button-filled:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill.sc-ds-button-filled-h>.ds-interaction-fill__content.sc-ds-button-filled,.ds-interaction-fill.sc-ds-button-filled>.ds-interaction-fill__content.sc-ds-button-filled,.ds-interaction-fill__content.sc-ds-button-filled{position:relative;z-index:2}.ds-interaction-fill--on-medium.sc-ds-button-filled-h,.ds-interaction-fill--on-medium.sc-ds-button-filled{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-button-filled-h,.ds-interaction-fill--on-bold.sc-ds-button-filled{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-button-filled-h,.ds-interaction-fill--on-strong.sc-ds-button-filled{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-always-dark.sc-ds-button-filled-h,.ds-interaction-fill--on-always-dark.sc-ds-button-filled{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-button-filled-h,.ds-interaction-fill--on-navigation.sc-ds-button-filled{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-control-inactive.sc-ds-button-filled-h,.ds-control-inactive.sc-ds-button-filled{opacity:0.25;pointer-events:none;cursor:not-allowed}.ds-control--md.sc-ds-button-filled-h,.ds-control--md.sc-ds-button-filled{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050);--ds-control-radius:var(--dimension-radius-025)}.ds-control--sm.sc-ds-button-filled-h,.ds-control--sm.sc-ds-button-filled{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025);--ds-control-radius:var(--dimension-radius-025)}.ds-control--xs.sc-ds-button-filled-h,.ds-control--xs.sc-ds-button-filled{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025);--ds-control-radius:var(--dimension-radius-025)}.ds-control-width--hug.sc-ds-button-filled-h,.ds-control-width--hug.sc-ds-button-filled{width:fit-content;max-width:100%;flex:0 0 auto;align-self:flex-start}.ds-control-width--fill.sc-ds-button-filled-h,.ds-control-width--fill.sc-ds-button-filled{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.sc-ds-button-filled-h{display:inline-flex;outline:none;--ds-button-filled-bg:var(--color-background-bold-brand);--ds-button-filled-fg:var(--color-foreground-faint-brand)}.button-filled-host--icon.ds-control-width--hug.sc-ds-button-filled-h{width:var(--ds-control-height, var(--dimension-size-400));height:var(--ds-control-height, var(--dimension-size-400));min-width:var(--ds-control-height, var(--dimension-size-400));min-height:var(--ds-control-height, var(--dimension-size-400))}.button-filled-host--icon.ds-control-width--fill.sc-ds-button-filled-h{height:var(--ds-control-height, var(--dimension-size-400));min-height:var(--ds-control-height, var(--dimension-size-400))}.ds-control-width--fill.sc-ds-button-filled-h .button-filled.sc-ds-button-filled{width:100%}.button-filled.sc-ds-button-filled{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));background-color:var(--ds-button-filled-bg);color:var(--ds-button-filled-fg);cursor:pointer;-webkit-user-select:none;user-select:none;overflow:hidden;transition:background-color var(--effect-motion-short-2), color var(--effect-motion-short-2), transform var(--effect-motion-short-2)}.button-filled--icon.sc-ds-button-filled{width:100%;height:100%;padding:0}.button-filled.sc-ds-button-filled:active:not(:disabled):not(.ds-control-inactive){transform:scale(var(--dimension-scale-subtle))}.button-filled__icon-wrap.sc-ds-button-filled{position:relative;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;z-index:2}.button-filled__label.sc-ds-button-filled{position:relative;z-index:2;line-height:0;padding:0 var(--ds-control-label-inset, var(--dimension-space-025));white-space:nowrap;flex-shrink:0;min-width:0}.button-filled--intent-neutral.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-neutral);--ds-button-filled-fg:var(--color-foreground-faint-neutral)}.button-filled--intent-brand.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-brand);--ds-button-filled-fg:var(--color-foreground-faint-brand)}.button-filled--intent-ai.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-ai);--ds-button-filled-fg:var(--color-foreground-faint-ai)}.button-filled--intent-negative.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-negative);--ds-button-filled-fg:var(--color-foreground-faint-negative)}.button-filled--intent-warning.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-warning);--ds-button-filled-fg:var(--color-foreground-faint-warning)}.button-filled--intent-caution.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-caution);--ds-button-filled-fg:var(--color-foreground-faint-caution)}.button-filled--intent-positive.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-positive);--ds-button-filled-fg:var(--color-foreground-faint-positive)}.button-filled--intent-guide.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-guide);--ds-button-filled-fg:var(--color-foreground-faint-guide)}.button-filled--intent-walkthrough.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-bold-walkthrough);--ds-button-filled-fg:var(--color-foreground-faint-walkthrough)}.button-filled--contrast-strong.button-filled--intent-neutral.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-neutral);--ds-button-filled-fg:var(--color-foreground-medium-neutral)}.button-filled--contrast-strong.button-filled--intent-brand.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-brand);--ds-button-filled-fg:var(--color-foreground-medium-brand)}.button-filled--contrast-strong.button-filled--intent-ai.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-ai);--ds-button-filled-fg:var(--color-foreground-medium-ai)}.button-filled--contrast-strong.button-filled--intent-negative.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-negative);--ds-button-filled-fg:var(--color-foreground-medium-negative)}.button-filled--contrast-strong.button-filled--intent-warning.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-warning);--ds-button-filled-fg:var(--color-foreground-medium-warning)}.button-filled--contrast-strong.button-filled--intent-caution.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-caution);--ds-button-filled-fg:var(--color-foreground-medium-caution)}.button-filled--contrast-strong.button-filled--intent-positive.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-positive);--ds-button-filled-fg:var(--color-foreground-medium-positive)}.button-filled--contrast-strong.button-filled--intent-guide.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-guide);--ds-button-filled-fg:var(--color-foreground-medium-guide)}.button-filled--contrast-strong.button-filled--intent-walkthrough.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-strong-walkthrough);--ds-button-filled-fg:var(--color-foreground-medium-walkthrough)}.button-filled--contrast-medium.button-filled--intent-neutral.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-neutral);--ds-button-filled-fg:var(--color-foreground-strong-neutral)}.button-filled--contrast-medium.button-filled--intent-brand.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-brand);--ds-button-filled-fg:var(--color-foreground-strong-brand)}.button-filled--contrast-medium.button-filled--intent-ai.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-ai);--ds-button-filled-fg:var(--color-foreground-strong-ai)}.button-filled--contrast-medium.button-filled--intent-negative.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-negative);--ds-button-filled-fg:var(--color-foreground-strong-negative)}.button-filled--contrast-medium.button-filled--intent-warning.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-warning);--ds-button-filled-fg:var(--color-foreground-strong-warning)}.button-filled--contrast-medium.button-filled--intent-caution.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-caution);--ds-button-filled-fg:var(--color-foreground-strong-caution)}.button-filled--contrast-medium.button-filled--intent-positive.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-positive);--ds-button-filled-fg:var(--color-foreground-strong-positive)}.button-filled--contrast-medium.button-filled--intent-guide.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-guide);--ds-button-filled-fg:var(--color-foreground-strong-guide)}.button-filled--contrast-medium.button-filled--intent-walkthrough.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-medium-walkthrough);--ds-button-filled-fg:var(--color-foreground-strong-walkthrough)}.button-filled--contrast-faint.button-filled--intent-neutral.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-neutral);--ds-button-filled-fg:var(--color-foreground-bold-neutral)}.button-filled--contrast-faint.button-filled--intent-brand.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-brand);--ds-button-filled-fg:var(--color-foreground-bold-brand)}.button-filled--contrast-faint.button-filled--intent-ai.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-ai);--ds-button-filled-fg:var(--color-foreground-bold-ai)}.button-filled--contrast-faint.button-filled--intent-negative.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-negative);--ds-button-filled-fg:var(--color-foreground-bold-negative)}.button-filled--contrast-faint.button-filled--intent-warning.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-warning);--ds-button-filled-fg:var(--color-foreground-bold-warning)}.button-filled--contrast-faint.button-filled--intent-caution.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-caution);--ds-button-filled-fg:var(--color-foreground-bold-caution)}.button-filled--contrast-faint.button-filled--intent-positive.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-positive);--ds-button-filled-fg:var(--color-foreground-bold-positive)}.button-filled--contrast-faint.button-filled--intent-guide.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-guide);--ds-button-filled-fg:var(--color-foreground-bold-guide)}.button-filled--contrast-faint.button-filled--intent-walkthrough.sc-ds-button-filled{--ds-button-filled-bg:var(--color-background-faint-walkthrough);--ds-button-filled-fg:var(--color-foreground-bold-walkthrough)}`;const a={md:"text-body-medium-emphasis",sm:"text-body-small-emphasis",xs:"text-caption-emphasis"};const c={md:"md",sm:"sm",xs:"xs"};const u=t(class t extends o{constructor(t){super();if(t!==false){this.__registerHost()}this.dsClick=n(this,"dsClick");this.variant="label";this.size="md";this.width="hug";this.label="";this.icon="";this.intent="brand";this.contrast="bold";this.isInactive=false;this.type="button";this.buttonEl=null;this.handleClick=t=>{if(this.isInactive)return;this.dsClick.emit(t)}}async setFocus(){this.buttonEl?.focus()}get showIcon(){return this.variant==="icon"||this.variant==="icon-label"}get showLabel(){return this.variant==="label"||this.variant==="icon-label"}get accessibleName(){if(this.ariaLabel)return this.ariaLabel;if(this.showLabel&&this.label)return undefined;if(this.variant==="icon")return this.icon||"action";return this.label||"action"}render(){const t=a[this.size];const o=c[this.size];const n={"button-filled":true,"ds-focus-ring-inset":true,"ds-interaction-fill":!this.isInactive,"ds-interaction-fill--on-bold":this.contrast==="bold","ds-interaction-fill--on-strong":this.contrast==="strong","ds-interaction-fill--on-medium":this.contrast==="medium","ds-control-inactive":this.isInactive,"ds-control--md":this.size==="md","ds-control--sm":this.size==="sm","ds-control--xs":this.size==="xs","button-filled--icon":this.variant==="icon","button-filled--label":this.variant==="label","button-filled--icon-label":this.variant==="icon-label",[`button-filled--intent-${this.intent}`]:true,[`button-filled--contrast-${this.contrast}`]:this.contrast!=="bold"};return i(d,{key:"5dca400b9d213bf9d07ea0bdcdaddced4d122cb9",class:{"button-filled-host":true,"button-filled-host--icon":this.variant==="icon","ds-control--md":this.size==="md","ds-control--sm":this.size==="sm","ds-control--xs":this.size==="xs",...e(this.width)},tabIndex:-1},i("button",{key:"dbb6bf749620b38120bbfc28eaeda7311e652a49",ref:t=>{this.buttonEl=t??null},type:this.type,class:n,disabled:this.isInactive,"aria-label":this.accessibleName,onClick:this.handleClick},this.showIcon&&i("span",{key:"0796f5b04bbec883101990e42525347d56e984eb",class:"button-filled__icon-wrap ds-interaction-fill__content"},i("ds-icon",{key:"54de2b4933f0f1b47d816486c8211963b12e87c2",name:this.icon,size:o,color:"inherit"})),this.showLabel&&i("span",{key:"83b9de7f4a8ae1d5bd5c91c4da6d3dad1a777a2e",class:{"button-filled__label":true,[t]:true,"ds-interaction-fill__content":true}},this.label)))}get el(){return this}static get style(){return s()}},[2,"ds-button-filled",{variant:[1],size:[1],width:[1],label:[1],icon:[1],intent:[1],contrast:[1],isInactive:[4,"is-inactive"],type:[1],ariaLabel:[1,"aria-label"],setFocus:[64]}]);function f(){if(typeof customElements==="undefined"){return}const t=["ds-button-filled","ds-icon"];t.forEach((t=>{switch(t){case"ds-button-filled":if(!customElements.get(l(t))){customElements.define(l(t),u)}break;case"ds-icon":if(!customElements.get(l(t))){r()}break}}))}f();export{u as B,f as d};
|
|
2
|
-
//# sourceMappingURL=p-B5NcWtpp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["buttonFilledCss","TEXT_VARIANT","md","sm","xs","ICON_SIZE","ButtonFilled","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","variant","size","width","label","icon","intent","contrast","isInactive","type","buttonEl","handleClick","event","dsClick","emit","setFocus","focus","showIcon","showLabel","accessibleName","ariaLabel","undefined","render","textVariant","iconSize","cls","h","Host","key","class","controlWidthClass","tabIndex","ref","el","disabled","onClick","name","color"],"sources":["src/wc/components/ButtonFilled/ButtonFilled.css?tag=ds-button-filled&encapsulation=scoped","src/wc/components/ButtonFilled/ButtonFilled.tsx"],"sourcesContent":["@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n@import '../../utils/control-inactive.css';\n@import '../../utils/control-density.css';\n@import '../../utils/control-width.css';\n\n:host {\n display: inline-flex;\n outline: none;\n --ds-button-filled-bg: var(--color-background-bold-brand);\n --ds-button-filled-fg: var(--color-foreground-faint-brand);\n}\n\n/* Icon-only: fixed square from density height (hug). Fill stretches the hit target. */\n:host(.button-filled-host--icon.ds-control-width--hug) {\n width: var(--ds-control-height, var(--dimension-size-400));\n height: var(--ds-control-height, var(--dimension-size-400));\n min-width: var(--ds-control-height, var(--dimension-size-400));\n min-height: var(--ds-control-height, var(--dimension-size-400));\n}\n\n:host(.button-filled-host--icon.ds-control-width--fill) {\n height: var(--ds-control-height, var(--dimension-size-400));\n min-height: var(--ds-control-height, var(--dimension-size-400));\n}\n\n:host(.ds-control-width--fill) .button-filled {\n width: 100%;\n}\n\n.button-filled {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: var(--ds-control-height, var(--dimension-size-400));\n padding: 0 var(--ds-control-padding-inline, var(--dimension-space-075));\n gap: var(--ds-control-gap, var(--dimension-space-050));\n border: none;\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n background-color: var(--ds-button-filled-bg);\n color: var(--ds-button-filled-fg);\n cursor: pointer;\n -webkit-user-select: none;\n user-select: none;\n overflow: hidden;\n transition:\n background-color var(--effect-motion-short-2),\n color var(--effect-motion-short-2),\n transform var(--effect-motion-short-2);\n /* Hover/press: `.ds-interaction-fill` + contrast → `--on-*` (token overlay, not color-mix). */\n}\n\n.button-filled--icon {\n width: 100%;\n height: 100%;\n padding: 0;\n}\n\n.button-filled:active:not(:disabled):not(.ds-control-inactive) {\n transform: scale(var(--dimension-scale-subtle));\n}\n\n/* Inactive: `.ds-control-inactive` (25% opacity). */\n\n.button-filled__icon-wrap {\n position: relative;\n width: var(--ds-control-icon, var(--dimension-iconography-md));\n height: var(--ds-control-icon, var(--dimension-iconography-md));\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n z-index: 2;\n}\n\n.button-filled__label {\n position: relative;\n z-index: 2;\n line-height: 0;\n padding: 0 var(--ds-control-label-inset, var(--dimension-space-025));\n white-space: nowrap;\n flex-shrink: 0;\n min-width: 0;\n}\n\n/* ── Intent + contrast (bold default) ─────────────────────────────────────── */\n\n.button-filled--intent-neutral {\n --ds-button-filled-bg: var(--color-background-bold-neutral);\n --ds-button-filled-fg: var(--color-foreground-faint-neutral);\n}\n\n.button-filled--intent-brand {\n --ds-button-filled-bg: var(--color-background-bold-brand);\n --ds-button-filled-fg: var(--color-foreground-faint-brand);\n}\n\n.button-filled--intent-ai {\n --ds-button-filled-bg: var(--color-background-bold-ai);\n --ds-button-filled-fg: var(--color-foreground-faint-ai);\n}\n\n.button-filled--intent-negative {\n --ds-button-filled-bg: var(--color-background-bold-negative);\n --ds-button-filled-fg: var(--color-foreground-faint-negative);\n}\n\n.button-filled--intent-warning {\n --ds-button-filled-bg: var(--color-background-bold-warning);\n --ds-button-filled-fg: var(--color-foreground-faint-warning);\n}\n\n.button-filled--intent-caution {\n --ds-button-filled-bg: var(--color-background-bold-caution);\n --ds-button-filled-fg: var(--color-foreground-faint-caution);\n}\n\n.button-filled--intent-positive {\n --ds-button-filled-bg: var(--color-background-bold-positive);\n --ds-button-filled-fg: var(--color-foreground-faint-positive);\n}\n\n.button-filled--intent-guide {\n --ds-button-filled-bg: var(--color-background-bold-guide);\n --ds-button-filled-fg: var(--color-foreground-faint-guide);\n}\n\n.button-filled--intent-walkthrough {\n --ds-button-filled-bg: var(--color-background-bold-walkthrough);\n --ds-button-filled-fg: var(--color-foreground-faint-walkthrough);\n}\n\n/* strong → medium fg */\n.button-filled--contrast-strong.button-filled--intent-neutral {\n --ds-button-filled-bg: var(--color-background-strong-neutral);\n --ds-button-filled-fg: var(--color-foreground-medium-neutral);\n}\n\n.button-filled--contrast-strong.button-filled--intent-brand {\n --ds-button-filled-bg: var(--color-background-strong-brand);\n --ds-button-filled-fg: var(--color-foreground-medium-brand);\n}\n\n.button-filled--contrast-strong.button-filled--intent-ai {\n --ds-button-filled-bg: var(--color-background-strong-ai);\n --ds-button-filled-fg: var(--color-foreground-medium-ai);\n}\n\n.button-filled--contrast-strong.button-filled--intent-negative {\n --ds-button-filled-bg: var(--color-background-strong-negative);\n --ds-button-filled-fg: var(--color-foreground-medium-negative);\n}\n\n.button-filled--contrast-strong.button-filled--intent-warning {\n --ds-button-filled-bg: var(--color-background-strong-warning);\n --ds-button-filled-fg: var(--color-foreground-medium-warning);\n}\n\n.button-filled--contrast-strong.button-filled--intent-caution {\n --ds-button-filled-bg: var(--color-background-strong-caution);\n --ds-button-filled-fg: var(--color-foreground-medium-caution);\n}\n\n.button-filled--contrast-strong.button-filled--intent-positive {\n --ds-button-filled-bg: var(--color-background-strong-positive);\n --ds-button-filled-fg: var(--color-foreground-medium-positive);\n}\n\n.button-filled--contrast-strong.button-filled--intent-guide {\n --ds-button-filled-bg: var(--color-background-strong-guide);\n --ds-button-filled-fg: var(--color-foreground-medium-guide);\n}\n\n.button-filled--contrast-strong.button-filled--intent-walkthrough {\n --ds-button-filled-bg: var(--color-background-strong-walkthrough);\n --ds-button-filled-fg: var(--color-foreground-medium-walkthrough);\n}\n\n/* medium → strong fg */\n.button-filled--contrast-medium.button-filled--intent-neutral {\n --ds-button-filled-bg: var(--color-background-medium-neutral);\n --ds-button-filled-fg: var(--color-foreground-strong-neutral);\n}\n\n.button-filled--contrast-medium.button-filled--intent-brand {\n --ds-button-filled-bg: var(--color-background-medium-brand);\n --ds-button-filled-fg: var(--color-foreground-strong-brand);\n}\n\n.button-filled--contrast-medium.button-filled--intent-ai {\n --ds-button-filled-bg: var(--color-background-medium-ai);\n --ds-button-filled-fg: var(--color-foreground-strong-ai);\n}\n\n.button-filled--contrast-medium.button-filled--intent-negative {\n --ds-button-filled-bg: var(--color-background-medium-negative);\n --ds-button-filled-fg: var(--color-foreground-strong-negative);\n}\n\n.button-filled--contrast-medium.button-filled--intent-warning {\n --ds-button-filled-bg: var(--color-background-medium-warning);\n --ds-button-filled-fg: var(--color-foreground-strong-warning);\n}\n\n.button-filled--contrast-medium.button-filled--intent-caution {\n --ds-button-filled-bg: var(--color-background-medium-caution);\n --ds-button-filled-fg: var(--color-foreground-strong-caution);\n}\n\n.button-filled--contrast-medium.button-filled--intent-positive {\n --ds-button-filled-bg: var(--color-background-medium-positive);\n --ds-button-filled-fg: var(--color-foreground-strong-positive);\n}\n\n.button-filled--contrast-medium.button-filled--intent-guide {\n --ds-button-filled-bg: var(--color-background-medium-guide);\n --ds-button-filled-fg: var(--color-foreground-strong-guide);\n}\n\n.button-filled--contrast-medium.button-filled--intent-walkthrough {\n --ds-button-filled-bg: var(--color-background-medium-walkthrough);\n --ds-button-filled-fg: var(--color-foreground-strong-walkthrough);\n}\n\n/* faint → bold fg */\n.button-filled--contrast-faint.button-filled--intent-neutral {\n --ds-button-filled-bg: var(--color-background-faint-neutral);\n --ds-button-filled-fg: var(--color-foreground-bold-neutral);\n}\n\n.button-filled--contrast-faint.button-filled--intent-brand {\n --ds-button-filled-bg: var(--color-background-faint-brand);\n --ds-button-filled-fg: var(--color-foreground-bold-brand);\n}\n\n.button-filled--contrast-faint.button-filled--intent-ai {\n --ds-button-filled-bg: var(--color-background-faint-ai);\n --ds-button-filled-fg: var(--color-foreground-bold-ai);\n}\n\n.button-filled--contrast-faint.button-filled--intent-negative {\n --ds-button-filled-bg: var(--color-background-faint-negative);\n --ds-button-filled-fg: var(--color-foreground-bold-negative);\n}\n\n.button-filled--contrast-faint.button-filled--intent-warning {\n --ds-button-filled-bg: var(--color-background-faint-warning);\n --ds-button-filled-fg: var(--color-foreground-bold-warning);\n}\n\n.button-filled--contrast-faint.button-filled--intent-caution {\n --ds-button-filled-bg: var(--color-background-faint-caution);\n --ds-button-filled-fg: var(--color-foreground-bold-caution);\n}\n\n.button-filled--contrast-faint.button-filled--intent-positive {\n --ds-button-filled-bg: var(--color-background-faint-positive);\n --ds-button-filled-fg: var(--color-foreground-bold-positive);\n}\n\n.button-filled--contrast-faint.button-filled--intent-guide {\n --ds-button-filled-bg: var(--color-background-faint-guide);\n --ds-button-filled-fg: var(--color-foreground-bold-guide);\n}\n\n.button-filled--contrast-faint.button-filled--intent-walkthrough {\n --ds-button-filled-bg: var(--color-background-faint-walkthrough);\n --ds-button-filled-fg: var(--color-foreground-bold-walkthrough);\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core';\nimport { controlWidthClass, type ControlWidth } from '../../utils/control-width';\n\nexport type ButtonFilledIntent =\n | 'neutral'\n | 'brand'\n | 'ai'\n | 'negative'\n | 'warning'\n | 'caution'\n | 'positive'\n | 'guide'\n | 'walkthrough';\n\nexport type ButtonFilledContrast = 'bold' | 'strong' | 'medium' | 'faint';\n\nexport type ButtonFilledVariant = 'icon' | 'label' | 'icon-label';\n\nexport type ButtonFilledSize = 'md' | 'sm' | 'xs';\n\nexport type ButtonFilledWidth = ControlWidth;\n\n/** Emphasis text per control-density size (buttons use emphasis, unlike Tag). */\nconst TEXT_VARIANT: Record<ButtonFilledSize, string> = {\n md: 'text-body-medium-emphasis',\n sm: 'text-body-small-emphasis',\n xs: 'text-caption-emphasis',\n};\n\n/**\n * `ds-icon` size prop matching control-density icon metrics\n * (md→20 / sm→16 / xs→12 via `--dimension-iconography-*`).\n */\nconst ICON_SIZE: Record<ButtonFilledSize, 'md' | 'sm' | 'xs'> = {\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\n@Component({\n tag: 'ds-button-filled',\n styleUrl: 'ButtonFilled.css',\n scoped: true,\n})\nexport class ButtonFilled {\n @Element() el!: HTMLElement;\n\n /**\n * Content layout. Default is label-only; pass `icon` for icon-only chrome\n * (nav / tool rails) or `icon-label` for leading icon + text.\n */\n @Prop() variant: ButtonFilledVariant = 'label';\n\n /** Control density (height, padding, icon, type). */\n @Prop() size: ButtonFilledSize = 'md';\n\n /** Width fit — hug content (default) or fill the parent. */\n @Prop() width: ButtonFilledWidth = 'hug';\n\n /** Visible text for `label` / `icon-label` variants. */\n @Prop() label: string = '';\n\n /** Icon name passed to <ds-icon> for `icon` / `icon-label` variants. */\n @Prop() icon: string = '';\n\n /** Semantic colour intent. */\n @Prop() intent: ButtonFilledIntent = 'brand';\n\n /**\n * Background fill weight. Foreground uses the paired contrast token:\n * bold → faint, strong → medium, medium → strong, faint → bold.\n */\n @Prop() contrast: ButtonFilledContrast = 'bold';\n\n /** Disables interaction. */\n @Prop() isInactive: boolean = false;\n\n /** Native button type. */\n @Prop() type: 'button' | 'submit' | 'reset' = 'button';\n\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | undefined;\n\n @Event() dsClick!: EventEmitter<MouseEvent>;\n\n private buttonEl: HTMLButtonElement | null = null;\n\n @Method()\n async setFocus() {\n this.buttonEl?.focus();\n }\n\n private handleClick = (event: MouseEvent) => {\n if (this.isInactive) return;\n this.dsClick.emit(event);\n };\n\n private get showIcon(): boolean {\n return this.variant === 'icon' || this.variant === 'icon-label';\n }\n\n private get showLabel(): boolean {\n return this.variant === 'label' || this.variant === 'icon-label';\n }\n\n private get accessibleName(): string | undefined {\n if (this.ariaLabel) return this.ariaLabel;\n if (this.showLabel && this.label) return undefined;\n if (this.variant === 'icon') return this.icon || 'action';\n return this.label || 'action';\n }\n\n render() {\n const textVariant = TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n\n const cls: Record<string, boolean> = {\n 'button-filled': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': !this.isInactive,\n /* Bold is the default filled contrast — on-bold interaction tokens. */\n 'ds-interaction-fill--on-bold': this.contrast === 'bold',\n 'ds-interaction-fill--on-strong': this.contrast === 'strong',\n 'ds-interaction-fill--on-medium': this.contrast === 'medium',\n /* faint → default app interaction tokens (no --on-*). */\n 'ds-control-inactive': this.isInactive,\n 'ds-control--md': this.size === 'md',\n 'ds-control--sm': this.size === 'sm',\n 'ds-control--xs': this.size === 'xs',\n 'button-filled--icon': this.variant === 'icon',\n 'button-filled--label': this.variant === 'label',\n 'button-filled--icon-label': this.variant === 'icon-label',\n [`button-filled--intent-${this.intent}`]: true,\n [`button-filled--contrast-${this.contrast}`]: this.contrast !== 'bold',\n };\n\n return (\n <Host\n class={{\n 'button-filled-host': true,\n 'button-filled-host--icon': this.variant === 'icon',\n 'ds-control--md': this.size === 'md',\n 'ds-control--sm': this.size === 'sm',\n 'ds-control--xs': this.size === 'xs',\n ...controlWidthClass(this.width),\n }}\n tabIndex={-1}\n >\n <button\n ref={el => {\n this.buttonEl = el ?? null;\n }}\n type={this.type}\n class={cls}\n disabled={this.isInactive}\n aria-label={this.accessibleName}\n onClick={this.handleClick}\n >\n {this.showIcon && (\n <span class=\"button-filled__icon-wrap ds-interaction-fill__content\">\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n </span>\n )}\n {this.showLabel && (\n <span class={{ 'button-filled__label': true, [textVariant]: true, 'ds-interaction-fill__content': true }}>\n {this.label}\n </span>\n )}\n </button>\n </Host>\n );\n }\n}\n"],"mappings":"0IAAA,MAAMA,EAAkB,IAAM,o8eCuB9B,MAAMC,EAAiD,CACrDC,GAAI,4BACJC,GAAI,2BACJC,GAAI,yBAON,MAAMC,EAA0D,CAC9DH,GAAI,KACJC,GAAI,KACJC,GAAI,M,MAQOE,EAAYC,EAAA,MAAAD,UAAAE,EALzB,WAAAC,CAAAC,G,2EAYUC,KAAAC,QAA+B,QAG/BD,KAAAE,KAAyB,KAGzBF,KAAAG,MAA2B,MAG3BH,KAAAI,MAAgB,GAGhBJ,KAAAK,KAAe,GAGfL,KAAAM,OAA6B,QAM7BN,KAAAO,SAAiC,OAGjCP,KAAAQ,WAAsB,MAGtBR,KAAAS,KAAsC,SAMtCT,KAAAU,SAAqC,KAOrCV,KAAAW,YAAeC,IACrB,GAAIZ,KAAKQ,WAAY,OACrBR,KAAKa,QAAQC,KAAKF,EAAM,CA8E3B,CApFC,cAAMG,GACJf,KAAKU,UAAUM,O,CAQjB,YAAYC,GACV,OAAOjB,KAAKC,UAAY,QAAUD,KAAKC,UAAY,Y,CAGrD,aAAYiB,GACV,OAAOlB,KAAKC,UAAY,SAAWD,KAAKC,UAAY,Y,CAGtD,kBAAYkB,GACV,GAAInB,KAAKoB,UAAW,OAAOpB,KAAKoB,UAChC,GAAIpB,KAAKkB,WAAalB,KAAKI,MAAO,OAAOiB,UACzC,GAAIrB,KAAKC,UAAY,OAAQ,OAAOD,KAAKK,MAAQ,SACjD,OAAOL,KAAKI,OAAS,Q,CAGvB,MAAAkB,GACE,MAAMC,EAAcjC,EAAaU,KAAKE,MACtC,MAAMsB,EAAW9B,EAAUM,KAAKE,MAEhC,MAAMuB,EAA+B,CACnC,gBAAiB,KACjB,sBAAuB,KACvB,uBAAwBzB,KAAKQ,WAE7B,+BAAgCR,KAAKO,WAAa,OAClD,iCAAkCP,KAAKO,WAAa,SACpD,iCAAkCP,KAAKO,WAAa,SAEpD,sBAAuBP,KAAKQ,WAC5B,iBAAkBR,KAAKE,OAAS,KAChC,iBAAkBF,KAAKE,OAAS,KAChC,iBAAkBF,KAAKE,OAAS,KAChC,sBAAuBF,KAAKC,UAAY,OACxC,uBAAwBD,KAAKC,UAAY,QACzC,4BAA6BD,KAAKC,UAAY,aAC9C,CAAC,yBAAyBD,KAAKM,UAAW,KAC1C,CAAC,2BAA2BN,KAAKO,YAAaP,KAAKO,WAAa,QAGlE,OACEmB,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACL,qBAAsB,KACtB,2BAA4B7B,KAAKC,UAAY,OAC7C,iBAAkBD,KAAKE,OAAS,KAChC,iBAAkBF,KAAKE,OAAS,KAChC,iBAAkBF,KAAKE,OAAS,QAC7B4B,EAAkB9B,KAAKG,QAE5B4B,UAAU,GAEVL,EAAA,UAAAE,IAAA,2CACEI,IAAKC,IACHjC,KAAKU,SAAWuB,GAAM,IAAI,EAE5BxB,KAAMT,KAAKS,KACXoB,MAAOJ,EACPS,SAAUlC,KAAKQ,WAAU,aACbR,KAAKmB,eACjBgB,QAASnC,KAAKW,aAEbX,KAAKiB,UACJS,EAAA,QAAAE,IAAA,2CAAMC,MAAM,yDACVH,EAAA,WAAAE,IAAA,2CAASQ,KAAMpC,KAAKK,KAAMH,KAAMsB,EAAUa,MAAM,aAGnDrC,KAAKkB,WACJQ,EAAA,QAAAE,IAAA,2CAAMC,MAAO,CAAE,uBAAwB,KAAMN,CAACA,GAAc,KAAM,+BAAgC,OAC/FvB,KAAKI,Q","ignoreList":[]}
|