@ds-mo/ui 5.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/agent.json +242 -66
  3. package/dist/angular/boolean-value-accessor.d.ts +1 -1
  4. package/dist/angular/boolean-value-accessor.js +2 -2
  5. package/dist/angular/ds-badge.d.ts +1 -1
  6. package/dist/angular/ds-badge.js +3 -3
  7. package/dist/angular/ds-switch.d.ts +15 -0
  8. package/dist/angular/{ds-toggle.js → ds-switch.js} +12 -12
  9. package/dist/angular/index.d.ts +1 -1
  10. package/dist/angular/index.js +1 -1
  11. package/dist/angular/proxies.d.ts +1 -1
  12. package/dist/angular/proxies.js +1 -1
  13. package/dist/components/ds-app-shell.js +1 -1
  14. package/dist/components/ds-app-shell.js.map +1 -1
  15. package/dist/components/ds-badge.js +1 -1
  16. package/dist/components/ds-banner.js +1 -1
  17. package/dist/components/ds-banner.js.map +1 -1
  18. package/dist/components/ds-bar-nav.js +1 -1
  19. package/dist/components/ds-bar-nav.js.map +1 -1
  20. package/dist/components/ds-button-filled.js +1 -1
  21. package/dist/components/ds-button-unfilled.js +1 -1
  22. package/dist/components/ds-card-data-viz-donut.js +1 -1
  23. package/dist/components/ds-card-data-viz-donut.js.map +1 -1
  24. package/dist/components/ds-card-setting.js +1 -1
  25. package/dist/components/ds-card.js +1 -1
  26. package/dist/components/ds-chart-bar.js +1 -1
  27. package/dist/components/ds-chart-donut.js +1 -1
  28. package/dist/components/ds-chart-donut.js.map +1 -1
  29. package/dist/components/ds-chart-legend.js +1 -1
  30. package/dist/components/ds-chart-legend.js.map +1 -1
  31. package/dist/components/ds-chart-line.js +1 -1
  32. package/dist/components/ds-checkbox.js +1 -1
  33. package/dist/components/ds-checkbox.js.map +1 -1
  34. package/dist/components/ds-chip.js +1 -1
  35. package/dist/components/ds-chip.js.map +1 -1
  36. package/dist/components/ds-empty-state.js +1 -1
  37. package/dist/components/ds-field.js +1 -1
  38. package/dist/components/ds-input.js +1 -1
  39. package/dist/components/ds-loader.js +1 -1
  40. package/dist/components/ds-loader.js.map +1 -1
  41. package/dist/components/ds-menu.js +1 -1
  42. package/dist/components/ds-modal.js +1 -1
  43. package/dist/components/ds-modal.js.map +1 -1
  44. package/dist/components/ds-pagination.js +1 -1
  45. package/dist/components/ds-panel-nav.js +1 -1
  46. package/dist/components/ds-panel-nav.js.map +1 -1
  47. package/dist/components/ds-panel-tools.js +1 -1
  48. package/dist/components/ds-panel-tools.js.map +1 -1
  49. package/dist/components/ds-radio-group.js +1 -1
  50. package/dist/components/ds-radio-group.js.map +1 -1
  51. package/dist/components/ds-select.js +1 -1
  52. package/dist/components/ds-select.js.map +1 -1
  53. package/dist/components/ds-shell-gradient-picker.js +1 -1
  54. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  55. package/dist/components/ds-slider.js +1 -1
  56. package/dist/components/ds-slider.js.map +1 -1
  57. package/dist/components/{ds-toggle.d.ts → ds-switch.d.ts} +4 -4
  58. package/dist/components/ds-switch.js +2 -0
  59. package/dist/components/ds-switch.js.map +1 -0
  60. package/dist/components/ds-tab-group-nav.js +1 -1
  61. package/dist/components/ds-tab-group.js +1 -1
  62. package/dist/components/ds-tab-group.js.map +1 -1
  63. package/dist/components/ds-table.js +1 -1
  64. package/dist/components/ds-tag.js +1 -1
  65. package/dist/components/ds-tag.js.map +1 -1
  66. package/dist/components/ds-text.js +1 -1
  67. package/dist/components/ds-tooltip-data-viz.js +1 -1
  68. package/dist/components/ds-tooltip-data-viz.js.map +1 -1
  69. package/dist/components/ds-tooltip.js +1 -1
  70. package/dist/components/p-B5kfuVQz.js +2 -0
  71. package/dist/components/p-B5kfuVQz.js.map +1 -0
  72. package/dist/components/{p-BvmooLHV.js → p-BHtg1fh3.js} +2 -2
  73. package/dist/components/p-BHtg1fh3.js.map +1 -0
  74. package/dist/components/p-BmiNX9Mc.js +2 -0
  75. package/dist/components/p-BmiNX9Mc.js.map +1 -0
  76. package/dist/components/{p-CKjNw4Tl.js → p-CWd8L7Fk.js} +2 -2
  77. package/dist/components/p-CxOQaZ4f.js +2 -0
  78. package/dist/components/{p-DhO43V4c.js.map → p-CxOQaZ4f.js.map} +1 -1
  79. package/dist/components/p-D5wc8lKR.js +2 -0
  80. package/dist/components/p-D5wc8lKR.js.map +1 -0
  81. package/dist/components/p-DHwtgzjP.js +2 -0
  82. package/dist/components/{p-CRrGwSt7.js.map → p-DHwtgzjP.js.map} +1 -1
  83. package/dist/components/p-DPxfMUfH.js +2 -0
  84. package/dist/components/{p-BX7jIHFD.js.map → p-DPxfMUfH.js.map} +1 -1
  85. package/dist/components/p-DhgDNluD.js +2 -0
  86. package/dist/components/p-DhgDNluD.js.map +1 -0
  87. package/dist/components/{p-ZdSNIObv.js → p-RBe9XqjU.js} +2 -2
  88. package/dist/components/{p-D7RssoPm.js → p-bl7d1jB2.js} +2 -2
  89. package/dist/components/p-cgo-rgl4.js +2 -0
  90. package/dist/components/p-cgo-rgl4.js.map +1 -0
  91. package/dist/docs/components.json +504 -364
  92. package/dist/lib/nav/index.js +15 -2
  93. package/dist/lib/nav/index.js.map +2 -2
  94. package/dist/lib/utils/index.d.ts +1 -1
  95. package/dist/lib/utils/index.js +8 -0
  96. package/dist/lib/utils/index.js.map +2 -2
  97. package/dist/lib/utils/resolve-css-time-ms.d.ts +7 -0
  98. package/dist/react/components.d.ts +1 -1
  99. package/dist/react/components.js +1 -1
  100. package/dist/react/{ds-toggle.d.ts → ds-switch.d.ts} +5 -5
  101. package/dist/react/{ds-toggle.js → ds-switch.js} +5 -5
  102. package/dist/types/components/Badge/Badge.d.ts +0 -2
  103. package/dist/types/components/Menu/Menu.d.ts +1 -0
  104. package/dist/types/components/Menu/menu-types.d.ts +3 -2
  105. package/dist/types/components/Modal/Modal.d.ts +1 -0
  106. package/dist/types/components/PanelTools/PanelTools.d.ts +7 -0
  107. package/dist/types/components/PanelTools/panel-tools-utils.d.ts +7 -0
  108. package/dist/types/components/Select/Select.d.ts +1 -1
  109. package/dist/types/components/Switch/Switch.d.ts +40 -0
  110. package/dist/types/components/Switch/index.d.ts +2 -0
  111. package/dist/types/components/Tooltip/Tooltip.d.ts +14 -2
  112. package/dist/types/components/Tooltip/tooltip-position.d.ts +21 -0
  113. package/dist/types/components.d.ts +143 -105
  114. package/dist/types/utils/index.d.ts +1 -1
  115. package/dist/types/utils/resolve-css-time-ms.d.ts +7 -0
  116. package/package.json +2 -2
  117. package/dist/angular/ds-toggle.d.ts +0 -15
  118. package/dist/components/ds-toggle.js +0 -2
  119. package/dist/components/ds-toggle.js.map +0 -1
  120. package/dist/components/p-BCiKXnx7.js +0 -2
  121. package/dist/components/p-BCiKXnx7.js.map +0 -1
  122. package/dist/components/p-BX7jIHFD.js +0 -2
  123. package/dist/components/p-BieM8MH5.js +0 -2
  124. package/dist/components/p-BieM8MH5.js.map +0 -1
  125. package/dist/components/p-BvmooLHV.js.map +0 -1
  126. package/dist/components/p-CRrGwSt7.js +0 -2
  127. package/dist/components/p-D-7A_rRS.js +0 -2
  128. package/dist/components/p-D-7A_rRS.js.map +0 -1
  129. package/dist/components/p-DhO43V4c.js +0 -2
  130. package/dist/components/p-K6uLVQKX.js +0 -2
  131. package/dist/components/p-K6uLVQKX.js.map +0 -1
  132. package/dist/types/components/Toggle/Toggle.d.ts +0 -22
  133. package/dist/types/components/Toggle/index.d.ts +0 -2
  134. /package/dist/components/{p-CKjNw4Tl.js.map → p-CWd8L7Fk.js.map} +0 -0
  135. /package/dist/components/{p-ZdSNIObv.js.map → p-RBe9XqjU.js.map} +0 -0
  136. /package/dist/components/{p-D7RssoPm.js.map → p-bl7d1jB2.js.map} +0 -0
@@ -38,13 +38,20 @@ export declare class Tooltip {
38
38
  private anchor;
39
39
  private popupEl;
40
40
  private positionObserver;
41
+ private anchorObserver;
42
+ private positionFrame;
41
43
  private skipEnterAnimation;
42
44
  private isOpen;
43
- private mouseEnterHandler;
44
- private mouseLeaveHandler;
45
+ private lastInteractionWasKeyboard;
46
+ private pointerEnterHandler;
47
+ private pointerLeaveHandler;
48
+ private pointerDownHandler;
49
+ private keyDownHandler;
45
50
  /** focusin/focusout so nested focus targets (e.g. ds-button-* inner button) still open the tip. */
46
51
  private focusHandler;
47
52
  private blurHandler;
53
+ private scrollResizeHandler;
54
+ private escapeHandler;
48
55
  componentDidLoad(): void;
49
56
  disconnectedCallback(): void;
50
57
  onContentOrPositionChange(): void;
@@ -58,7 +65,12 @@ export declare class Tooltip {
58
65
  private get tooltipFallbackHeightPx();
59
66
  private bindAnchor;
60
67
  private unbindAnchor;
68
+ private linkDescribedBy;
69
+ private unlinkDescribedBy;
70
+ private handleSlotChange;
61
71
  private clearTimers;
72
+ private setupOpenListeners;
73
+ private teardownOpenListeners;
62
74
  private destroyPopup;
63
75
  /**
64
76
  * Position after `ds-text` upgrades and lays out. Measuring synchronously in
@@ -0,0 +1,21 @@
1
+ import type { TooltipAlign, TooltipSide } from './Tooltip';
2
+ export interface TooltipPositionInput {
3
+ anchorRect: Pick<DOMRectReadOnly, 'top' | 'left' | 'right' | 'bottom' | 'width' | 'height'>;
4
+ popupWidth: number;
5
+ popupHeight: number;
6
+ side: TooltipSide;
7
+ align: TooltipAlign;
8
+ sideOffsetPx: number;
9
+ alignOffsetPx: number;
10
+ viewportPadPx: number;
11
+ viewportWidth: number;
12
+ viewportHeight: number;
13
+ }
14
+ export interface TooltipPosition {
15
+ x: number;
16
+ y: number;
17
+ resolvedSide: TooltipSide;
18
+ }
19
+ /** Flip on the preferred axis when needed, then clamp within the viewport. */
20
+ export declare function computeTooltipPosition(input: TooltipPositionInput): TooltipPosition;
21
+ //# sourceMappingURL=tooltip-position.d.ts.map
@@ -36,6 +36,7 @@ import { SkeletonSurface, SkeletonVariant } from "./components/Skeleton/Skeleton
36
36
  import { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, TextFontFeature, TextVariant, TextWrap } from "./components/Text/text-types";
37
37
  import { IconSize as IconSize1 } from "./components/Icon/Icon";
38
38
  import { ControlSize } from "./utils/control-text";
39
+ import { SwitchSize } from "./components/Switch/Switch";
39
40
  import { TabItem } from "./components/TabGroup/tab-item-utils";
40
41
  import { TabBackground } from "./components/TabGroup/TabGroup";
41
42
  import { TabGroupNavBackground } from "./components/TabGroupNav/TabGroupNav";
@@ -73,6 +74,7 @@ export { SkeletonSurface, SkeletonVariant } from "./components/Skeleton/Skeleton
73
74
  export { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, TextFontFeature, TextVariant, TextWrap } from "./components/Text/text-types";
74
75
  export { IconSize as IconSize1 } from "./components/Icon/Icon";
75
76
  export { ControlSize } from "./utils/control-text";
77
+ export { SwitchSize } from "./components/Switch/Switch";
76
78
  export { TabItem } from "./components/TabGroup/tab-item-utils";
77
79
  export { TabBackground } from "./components/TabGroup/TabGroup";
78
80
  export { TabGroupNavBackground } from "./components/TabGroupNav/TabGroupNav";
@@ -112,11 +114,6 @@ export namespace Components {
112
114
  * @default false
113
115
  */
114
116
  "gradientBackground": boolean;
115
- /**
116
- * Deprecated alias for selected counter styling. Prefer context-specific color in the parent.
117
- * @default false
118
- */
119
- "isSelected": boolean;
120
117
  /**
121
118
  * Accessible label. Defaults to the count as a string.
122
119
  */
@@ -996,7 +993,7 @@ export namespace Components {
996
993
  */
997
994
  interface DsSelect {
998
995
  /**
999
- * When a value is selected, render the selected interaction fill (same recipe as unfilled-button `activeFill`). Default `true`. Pass `false` for foreground-only selection (primary label, no fill). Selected/open promotes the label to primary; chevron stays secondary.
996
+ * When a value is selected, render the selected interaction fill (same recipe as unfilled-button `activeFill`). Default `true`. Pass `false` for foreground-only selection (primary label, no fill). A selected value promotes the label to primary; chevron stays secondary.
1000
997
  * @default true
1001
998
  */
1002
999
  "activeFill": boolean;
@@ -1154,6 +1151,56 @@ export namespace Components {
1154
1151
  "value": number;
1155
1152
  "valueText": string | undefined;
1156
1153
  }
1154
+ interface DsSwitch {
1155
+ /**
1156
+ * Current on/off state. The initial value is restored when the owning form resets.
1157
+ * @default false
1158
+ */
1159
+ "checked": boolean;
1160
+ /**
1161
+ * @default false
1162
+ */
1163
+ "disabled": boolean;
1164
+ /**
1165
+ * Associates the switch with a form by id when it is rendered outside that form.
1166
+ */
1167
+ "form": string | undefined;
1168
+ /**
1169
+ * @default false
1170
+ */
1171
+ "isInactive": boolean;
1172
+ "name": string | undefined;
1173
+ /**
1174
+ * Removes standalone control semantics so a composite owner such as a `menuitemcheckbox` can use the switch as an aria-hidden visual indicator.
1175
+ * @default false
1176
+ */
1177
+ "presentation": boolean;
1178
+ /**
1179
+ * @default false
1180
+ */
1181
+ "readOnly": boolean;
1182
+ /**
1183
+ * @default false
1184
+ */
1185
+ "required": boolean;
1186
+ /**
1187
+ * @default 'This field is required.'
1188
+ */
1189
+ "requiredMessage": string;
1190
+ /**
1191
+ * Compact track size for placement inside controls, menus, and form rows.
1192
+ * @default 'md'
1193
+ */
1194
+ "size": SwitchSize;
1195
+ /**
1196
+ * Optional value submitted when unchecked; omitted by default like a native checkbox.
1197
+ */
1198
+ "uncheckedValue": string | undefined;
1199
+ /**
1200
+ * @default 'on'
1201
+ */
1202
+ "value": string;
1203
+ }
1157
1204
  interface DsTabGroup {
1158
1205
  /**
1159
1206
  * @default null
@@ -1321,33 +1368,6 @@ export namespace Components {
1321
1368
  "variant": TextVariant;
1322
1369
  "wrap": TextWrap | undefined;
1323
1370
  }
1324
- interface DsToggle {
1325
- /**
1326
- * @default false
1327
- */
1328
- "checked": boolean;
1329
- /**
1330
- * @default false
1331
- */
1332
- "disabled": boolean;
1333
- /**
1334
- * @default false
1335
- */
1336
- "isInactive": boolean;
1337
- "name": string | undefined;
1338
- /**
1339
- * @default false
1340
- */
1341
- "required": boolean;
1342
- /**
1343
- * @default 'This field is required.'
1344
- */
1345
- "requiredMessage": string;
1346
- /**
1347
- * @default 'on'
1348
- */
1349
- "value": string;
1350
- }
1351
1371
  /**
1352
1372
  * Imperative body portal for the popup.
1353
1373
  * Stencil must not own the portaled node — moving a VDOM child to `document.body`
@@ -1515,6 +1535,10 @@ export interface DsSliderCustomEvent<T> extends CustomEvent<T> {
1515
1535
  detail: T;
1516
1536
  target: HTMLDsSliderElement;
1517
1537
  }
1538
+ export interface DsSwitchCustomEvent<T> extends CustomEvent<T> {
1539
+ detail: T;
1540
+ target: HTMLDsSwitchElement;
1541
+ }
1518
1542
  export interface DsTabGroupCustomEvent<T> extends CustomEvent<T> {
1519
1543
  detail: T;
1520
1544
  target: HTMLDsTabGroupElement;
@@ -1527,10 +1551,6 @@ export interface DsTableCustomEvent<T> extends CustomEvent<T> {
1527
1551
  detail: T;
1528
1552
  target: HTMLDsTableElement;
1529
1553
  }
1530
- export interface DsToggleCustomEvent<T> extends CustomEvent<T> {
1531
- detail: T;
1532
- target: HTMLDsToggleElement;
1533
- }
1534
1554
  declare global {
1535
1555
  interface HTMLDsAppShellElement extends Components.DsAppShell, HTMLStencilElement {
1536
1556
  }
@@ -1994,6 +2014,23 @@ declare global {
1994
2014
  prototype: HTMLDsSliderElement;
1995
2015
  new (): HTMLDsSliderElement;
1996
2016
  };
2017
+ interface HTMLDsSwitchElementEventMap {
2018
+ "dsChange": boolean;
2019
+ }
2020
+ interface HTMLDsSwitchElement extends Components.DsSwitch, HTMLStencilElement {
2021
+ addEventListener<K extends keyof HTMLDsSwitchElementEventMap>(type: K, listener: (this: HTMLDsSwitchElement, ev: DsSwitchCustomEvent<HTMLDsSwitchElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
2022
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2023
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2024
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2025
+ removeEventListener<K extends keyof HTMLDsSwitchElementEventMap>(type: K, listener: (this: HTMLDsSwitchElement, ev: DsSwitchCustomEvent<HTMLDsSwitchElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
2026
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2027
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2028
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2029
+ }
2030
+ var HTMLDsSwitchElement: {
2031
+ prototype: HTMLDsSwitchElement;
2032
+ new (): HTMLDsSwitchElement;
2033
+ };
1997
2034
  interface HTMLDsTabGroupElementEventMap {
1998
2035
  "dsChange": string;
1999
2036
  }
@@ -2060,23 +2097,6 @@ declare global {
2060
2097
  prototype: HTMLDsTextElement;
2061
2098
  new (): HTMLDsTextElement;
2062
2099
  };
2063
- interface HTMLDsToggleElementEventMap {
2064
- "dsChange": boolean;
2065
- }
2066
- interface HTMLDsToggleElement extends Components.DsToggle, HTMLStencilElement {
2067
- addEventListener<K extends keyof HTMLDsToggleElementEventMap>(type: K, listener: (this: HTMLDsToggleElement, ev: DsToggleCustomEvent<HTMLDsToggleElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
2068
- addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2069
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2070
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2071
- removeEventListener<K extends keyof HTMLDsToggleElementEventMap>(type: K, listener: (this: HTMLDsToggleElement, ev: DsToggleCustomEvent<HTMLDsToggleElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
2072
- removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2073
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2074
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2075
- }
2076
- var HTMLDsToggleElement: {
2077
- prototype: HTMLDsToggleElement;
2078
- new (): HTMLDsToggleElement;
2079
- };
2080
2100
  /**
2081
2101
  * Imperative body portal for the popup.
2082
2102
  * Stencil must not own the portaled node — moving a VDOM child to `document.body`
@@ -2141,12 +2161,12 @@ declare global {
2141
2161
  "ds-shell-gradient-swatch": HTMLDsShellGradientSwatchElement;
2142
2162
  "ds-skeleton": HTMLDsSkeletonElement;
2143
2163
  "ds-slider": HTMLDsSliderElement;
2164
+ "ds-switch": HTMLDsSwitchElement;
2144
2165
  "ds-tab-group": HTMLDsTabGroupElement;
2145
2166
  "ds-tab-group-nav": HTMLDsTabGroupNavElement;
2146
2167
  "ds-table": HTMLDsTableElement;
2147
2168
  "ds-tag": HTMLDsTagElement;
2148
2169
  "ds-text": HTMLDsTextElement;
2149
- "ds-toggle": HTMLDsToggleElement;
2150
2170
  "ds-tooltip": HTMLDsTooltipElement;
2151
2171
  "ds-tooltip-data-viz": HTMLDsTooltipDataVizElement;
2152
2172
  }
@@ -2186,11 +2206,6 @@ declare namespace LocalJSX {
2186
2206
  * @default false
2187
2207
  */
2188
2208
  "gradientBackground"?: boolean;
2189
- /**
2190
- * Deprecated alias for selected counter styling. Prefer context-specific color in the parent.
2191
- * @default false
2192
- */
2193
- "isSelected"?: boolean;
2194
2209
  /**
2195
2210
  * Accessible label. Defaults to the count as a string.
2196
2211
  */
@@ -3144,7 +3159,7 @@ declare namespace LocalJSX {
3144
3159
  */
3145
3160
  interface DsSelect {
3146
3161
  /**
3147
- * When a value is selected, render the selected interaction fill (same recipe as unfilled-button `activeFill`). Default `true`. Pass `false` for foreground-only selection (primary label, no fill). Selected/open promotes the label to primary; chevron stays secondary.
3162
+ * When a value is selected, render the selected interaction fill (same recipe as unfilled-button `activeFill`). Default `true`. Pass `false` for foreground-only selection (primary label, no fill). A selected value promotes the label to primary; chevron stays secondary.
3148
3163
  * @default true
3149
3164
  */
3150
3165
  "activeFill"?: boolean;
@@ -3313,6 +3328,57 @@ declare namespace LocalJSX {
3313
3328
  "value"?: number;
3314
3329
  "valueText"?: string | undefined;
3315
3330
  }
3331
+ interface DsSwitch {
3332
+ /**
3333
+ * Current on/off state. The initial value is restored when the owning form resets.
3334
+ * @default false
3335
+ */
3336
+ "checked"?: boolean;
3337
+ /**
3338
+ * @default false
3339
+ */
3340
+ "disabled"?: boolean;
3341
+ /**
3342
+ * Associates the switch with a form by id when it is rendered outside that form.
3343
+ */
3344
+ "form"?: string | undefined;
3345
+ /**
3346
+ * @default false
3347
+ */
3348
+ "isInactive"?: boolean;
3349
+ "name"?: string | undefined;
3350
+ "onDsChange"?: (event: DsSwitchCustomEvent<boolean>) => void;
3351
+ /**
3352
+ * Removes standalone control semantics so a composite owner such as a `menuitemcheckbox` can use the switch as an aria-hidden visual indicator.
3353
+ * @default false
3354
+ */
3355
+ "presentation"?: boolean;
3356
+ /**
3357
+ * @default false
3358
+ */
3359
+ "readOnly"?: boolean;
3360
+ /**
3361
+ * @default false
3362
+ */
3363
+ "required"?: boolean;
3364
+ /**
3365
+ * @default 'This field is required.'
3366
+ */
3367
+ "requiredMessage"?: string;
3368
+ /**
3369
+ * Compact track size for placement inside controls, menus, and form rows.
3370
+ * @default 'md'
3371
+ */
3372
+ "size"?: SwitchSize;
3373
+ /**
3374
+ * Optional value submitted when unchecked; omitted by default like a native checkbox.
3375
+ */
3376
+ "uncheckedValue"?: string | undefined;
3377
+ /**
3378
+ * @default 'on'
3379
+ */
3380
+ "value"?: string;
3381
+ }
3316
3382
  interface DsTabGroup {
3317
3383
  /**
3318
3384
  * @default null
@@ -3486,38 +3552,6 @@ declare namespace LocalJSX {
3486
3552
  "variant"?: TextVariant;
3487
3553
  "wrap"?: TextWrap | undefined;
3488
3554
  }
3489
- interface DsToggle {
3490
- /**
3491
- * @default false
3492
- */
3493
- "checked"?: boolean;
3494
- /**
3495
- * @default false
3496
- */
3497
- "disabled"?: boolean;
3498
- /**
3499
- * The `id` of a `<form>` element to associate this element with.
3500
- */
3501
- "form"?: string;
3502
- /**
3503
- * @default false
3504
- */
3505
- "isInactive"?: boolean;
3506
- "name"?: string | undefined;
3507
- "onDsChange"?: (event: DsToggleCustomEvent<boolean>) => void;
3508
- /**
3509
- * @default false
3510
- */
3511
- "required"?: boolean;
3512
- /**
3513
- * @default 'This field is required.'
3514
- */
3515
- "requiredMessage"?: string;
3516
- /**
3517
- * @default 'on'
3518
- */
3519
- "value"?: string;
3520
- }
3521
3555
  /**
3522
3556
  * Imperative body portal for the popup.
3523
3557
  * Stencil must not own the portaled node — moving a VDOM child to `document.body`
@@ -3613,7 +3647,6 @@ declare namespace LocalJSX {
3613
3647
  "surface": BadgeSurface;
3614
3648
  "background": string | undefined;
3615
3649
  "gradientBackground": boolean;
3616
- "isSelected": boolean;
3617
3650
  "label": string | undefined;
3618
3651
  }
3619
3652
  interface DsBannerAttributes {
@@ -3889,6 +3922,20 @@ declare namespace LocalJSX {
3889
3922
  "valueText": string | undefined;
3890
3923
  "inputId": string | undefined;
3891
3924
  }
3925
+ interface DsSwitchAttributes {
3926
+ "checked": boolean;
3927
+ "name": string | undefined;
3928
+ "value": string;
3929
+ "uncheckedValue": string | undefined;
3930
+ "form": string | undefined;
3931
+ "disabled": boolean;
3932
+ "readOnly": boolean;
3933
+ "required": boolean;
3934
+ "requiredMessage": string;
3935
+ "isInactive": boolean;
3936
+ "size": SwitchSize;
3937
+ "presentation": boolean;
3938
+ }
3892
3939
  interface DsTabGroupAttributes {
3893
3940
  "value": string;
3894
3941
  "background": TabBackground | undefined;
@@ -3940,15 +3987,6 @@ declare namespace LocalJSX {
3940
3987
  "for": string | undefined;
3941
3988
  "textId": string | undefined;
3942
3989
  }
3943
- interface DsToggleAttributes {
3944
- "checked": boolean;
3945
- "name": string | undefined;
3946
- "value": string;
3947
- "disabled": boolean;
3948
- "required": boolean;
3949
- "requiredMessage": string;
3950
- "isInactive": boolean;
3951
- }
3952
3990
  interface DsTooltipAttributes {
3953
3991
  "label": string;
3954
3992
  "size": TooltipSize;
@@ -4001,12 +4039,12 @@ declare namespace LocalJSX {
4001
4039
  "ds-shell-gradient-swatch": Omit<DsShellGradientSwatch, keyof DsShellGradientSwatchAttributes> & { [K in keyof DsShellGradientSwatch & keyof DsShellGradientSwatchAttributes]?: DsShellGradientSwatch[K] } & { [K in keyof DsShellGradientSwatch & keyof DsShellGradientSwatchAttributes as `attr:${K}`]?: DsShellGradientSwatchAttributes[K] } & { [K in keyof DsShellGradientSwatch & keyof DsShellGradientSwatchAttributes as `prop:${K}`]?: DsShellGradientSwatch[K] };
4002
4040
  "ds-skeleton": Omit<DsSkeleton, keyof DsSkeletonAttributes> & { [K in keyof DsSkeleton & keyof DsSkeletonAttributes]?: DsSkeleton[K] } & { [K in keyof DsSkeleton & keyof DsSkeletonAttributes as `attr:${K}`]?: DsSkeletonAttributes[K] } & { [K in keyof DsSkeleton & keyof DsSkeletonAttributes as `prop:${K}`]?: DsSkeleton[K] };
4003
4041
  "ds-slider": Omit<DsSlider, keyof DsSliderAttributes> & { [K in keyof DsSlider & keyof DsSliderAttributes]?: DsSlider[K] } & { [K in keyof DsSlider & keyof DsSliderAttributes as `attr:${K}`]?: DsSliderAttributes[K] } & { [K in keyof DsSlider & keyof DsSliderAttributes as `prop:${K}`]?: DsSlider[K] } & OneOf<"label", DsSlider["label"], DsSliderAttributes["label"]>;
4042
+ "ds-switch": Omit<DsSwitch, keyof DsSwitchAttributes> & { [K in keyof DsSwitch & keyof DsSwitchAttributes]?: DsSwitch[K] } & { [K in keyof DsSwitch & keyof DsSwitchAttributes as `attr:${K}`]?: DsSwitchAttributes[K] } & { [K in keyof DsSwitch & keyof DsSwitchAttributes as `prop:${K}`]?: DsSwitch[K] };
4004
4043
  "ds-tab-group": Omit<DsTabGroup, keyof DsTabGroupAttributes> & { [K in keyof DsTabGroup & keyof DsTabGroupAttributes]?: DsTabGroup[K] } & { [K in keyof DsTabGroup & keyof DsTabGroupAttributes as `attr:${K}`]?: DsTabGroupAttributes[K] } & { [K in keyof DsTabGroup & keyof DsTabGroupAttributes as `prop:${K}`]?: DsTabGroup[K] };
4005
4044
  "ds-tab-group-nav": Omit<DsTabGroupNav, keyof DsTabGroupNavAttributes> & { [K in keyof DsTabGroupNav & keyof DsTabGroupNavAttributes]?: DsTabGroupNav[K] } & { [K in keyof DsTabGroupNav & keyof DsTabGroupNavAttributes as `attr:${K}`]?: DsTabGroupNavAttributes[K] } & { [K in keyof DsTabGroupNav & keyof DsTabGroupNavAttributes as `prop:${K}`]?: DsTabGroupNav[K] };
4006
4045
  "ds-table": Omit<DsTable, keyof DsTableAttributes> & { [K in keyof DsTable & keyof DsTableAttributes]?: DsTable[K] } & { [K in keyof DsTable & keyof DsTableAttributes as `attr:${K}`]?: DsTableAttributes[K] } & { [K in keyof DsTable & keyof DsTableAttributes as `prop:${K}`]?: DsTable[K] };
4007
4046
  "ds-tag": Omit<DsTag, keyof DsTagAttributes> & { [K in keyof DsTag & keyof DsTagAttributes]?: DsTag[K] } & { [K in keyof DsTag & keyof DsTagAttributes as `attr:${K}`]?: DsTagAttributes[K] } & { [K in keyof DsTag & keyof DsTagAttributes as `prop:${K}`]?: DsTag[K] } & OneOf<"label", DsTag["label"], DsTagAttributes["label"]>;
4008
4047
  "ds-text": Omit<DsText, keyof DsTextAttributes> & { [K in keyof DsText & keyof DsTextAttributes]?: DsText[K] } & { [K in keyof DsText & keyof DsTextAttributes as `attr:${K}`]?: DsTextAttributes[K] } & { [K in keyof DsText & keyof DsTextAttributes as `prop:${K}`]?: DsText[K] };
4009
- "ds-toggle": Omit<DsToggle, keyof DsToggleAttributes> & { [K in keyof DsToggle & keyof DsToggleAttributes]?: DsToggle[K] } & { [K in keyof DsToggle & keyof DsToggleAttributes as `attr:${K}`]?: DsToggleAttributes[K] } & { [K in keyof DsToggle & keyof DsToggleAttributes as `prop:${K}`]?: DsToggle[K] };
4010
4048
  "ds-tooltip": Omit<DsTooltip, keyof DsTooltipAttributes> & { [K in keyof DsTooltip & keyof DsTooltipAttributes]?: DsTooltip[K] } & { [K in keyof DsTooltip & keyof DsTooltipAttributes as `attr:${K}`]?: DsTooltipAttributes[K] } & { [K in keyof DsTooltip & keyof DsTooltipAttributes as `prop:${K}`]?: DsTooltip[K] } & OneOf<"label", DsTooltip["label"], DsTooltipAttributes["label"]>;
4011
4049
  "ds-tooltip-data-viz": Omit<DsTooltipDataViz, keyof DsTooltipDataVizAttributes> & { [K in keyof DsTooltipDataViz & keyof DsTooltipDataVizAttributes]?: DsTooltipDataViz[K] } & { [K in keyof DsTooltipDataViz & keyof DsTooltipDataVizAttributes as `attr:${K}`]?: DsTooltipDataVizAttributes[K] } & { [K in keyof DsTooltipDataViz & keyof DsTooltipDataVizAttributes as `prop:${K}`]?: DsTooltipDataViz[K] };
4012
4050
  }
@@ -4071,12 +4109,12 @@ declare module "@stencil/core" {
4071
4109
  "ds-shell-gradient-swatch": LocalJSX.IntrinsicElements["ds-shell-gradient-swatch"] & JSXBase.HTMLAttributes<HTMLDsShellGradientSwatchElement>;
4072
4110
  "ds-skeleton": LocalJSX.IntrinsicElements["ds-skeleton"] & JSXBase.HTMLAttributes<HTMLDsSkeletonElement>;
4073
4111
  "ds-slider": LocalJSX.IntrinsicElements["ds-slider"] & JSXBase.HTMLAttributes<HTMLDsSliderElement>;
4112
+ "ds-switch": LocalJSX.IntrinsicElements["ds-switch"] & JSXBase.HTMLAttributes<HTMLDsSwitchElement>;
4074
4113
  "ds-tab-group": LocalJSX.IntrinsicElements["ds-tab-group"] & JSXBase.HTMLAttributes<HTMLDsTabGroupElement>;
4075
4114
  "ds-tab-group-nav": LocalJSX.IntrinsicElements["ds-tab-group-nav"] & JSXBase.HTMLAttributes<HTMLDsTabGroupNavElement>;
4076
4115
  "ds-table": LocalJSX.IntrinsicElements["ds-table"] & JSXBase.HTMLAttributes<HTMLDsTableElement>;
4077
4116
  "ds-tag": LocalJSX.IntrinsicElements["ds-tag"] & JSXBase.HTMLAttributes<HTMLDsTagElement>;
4078
4117
  "ds-text": LocalJSX.IntrinsicElements["ds-text"] & JSXBase.HTMLAttributes<HTMLDsTextElement>;
4079
- "ds-toggle": LocalJSX.IntrinsicElements["ds-toggle"] & JSXBase.HTMLAttributes<HTMLDsToggleElement>;
4080
4118
  /**
4081
4119
  * Imperative body portal for the popup.
4082
4120
  * Stencil must not own the portaled node — moving a VDOM child to `document.body`
@@ -2,7 +2,7 @@ export { registerIcons } from '../components/Icon/icon-cache';
2
2
  export { clearCssLengthPxCache, resolveCssLengthPx } from './resolve-css-length-px';
3
3
  export { formatCompactNumber } from './format-compact-number';
4
4
  export { truncateSvgTextToWidth } from './truncate-svg-text';
5
- export { parseCssTimeMs, resolveCssTimeMs } from './resolve-css-time-ms';
5
+ export { parseCssTimeMs, prefersReducedMotion, resolveCssTimeMs, resolveMotionTimeMs, } from './resolve-css-time-ms';
6
6
  export { SCROLL_EDGE_FADE_DEFAULT_SIZE, SCROLL_EDGE_FADE_SIZE_VAR, isScrollAtEdge, resolveScrollEdgeFadeSize, scrollEdgeFadeClassMap, scrollEdgeFadeMaskImage, scrollEdgeFadeMaskStyle, scrollEdgeFadeSizeStyle, } from './scroll-edge-fade';
7
7
  export type { ScrollEdgeFadeEdge, ScrollEdgeFadeOptions, ScrollEdgeFadeSize, ScrollEdgeFadeSizeToken, } from './scroll-edge-fade';
8
8
  export { TOKEN_DEFAULTS, TOKEN_CSS_LENGTHS } from './token-defaults';
@@ -5,4 +5,11 @@ export declare function parseCssTimeMs(value: string, fallback: number): number;
5
5
  * Accepts numbers (ms), raw times (`200ms`, `0.75s`), or `var(--effect-*)` references.
6
6
  */
7
7
  export declare function resolveCssTimeMs(value: number | string | undefined, fallbackToken: string): number;
8
+ /** Whether the user has requested reduced non-essential motion. */
9
+ export declare function prefersReducedMotion(): boolean;
10
+ /**
11
+ * Resolve an animation-coupled duration. Returns zero under reduced motion so
12
+ * JS cleanup stays synchronized with CSS that removes the corresponding motion.
13
+ */
14
+ export declare function resolveMotionTimeMs(value: number | string | undefined, fallbackToken: string): number;
8
15
  //# sourceMappingURL=resolve-css-time-ms.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ds-mo/ui",
3
- "version": "5.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "CompoMo — composable web components styled with TokoMo design tokens",
5
5
  "keywords": [
6
6
  "web-components",
@@ -70,7 +70,7 @@
70
70
  "pretest": "node scripts/generate-icon-catalog.mjs",
71
71
  "build": "stencil build && node scripts/patch-index-types.mjs && node scripts/verify-icons-externalized.mjs && node scripts/write-build-stamp.mjs && node scripts/build-lib-exports.mjs && node scripts/build-framework-exports.mjs && node scripts/build-registry.mjs && node scripts/build-agent-manifest.mjs",
72
72
  "verify:pack": "node scripts/verify-npm-pack.mjs && node scripts/verify-package-imports.mjs",
73
- "test": "node --import tsx/esm --test tests/component-inventory.test.ts tests/agent-contract.test.ts tests/panel-nav-utils.test.ts tests/panel-tools.test.ts tests/text.test.ts tests/eslint-plugin-local.test.ts tests/stylelint-plugin-local.test.ts tests/shell-shortcuts.test.ts tests/shell-gradient-presets.test.ts tests/shell-view-transition.test.ts tests/shell-gradient.test.ts tests/shell-chrome-metrics.test.ts tests/shell-chrome-layer.test.ts tests/chrome-transition.test.ts tests/bar-nav-overflow-hysteresis.test.ts tests/badge-gradient-ring.test.ts tests/scroll-edge-fade.test.ts tests/resolve-css-length-px.test.ts tests/resolve-css-time-ms.test.ts tests/overlay-positioning.test.ts tests/menu-position.test.ts tests/menu-placement.test.ts tests/bar-nav-utils.test.ts tests/bar-nav-tabs-menu-utils.test.ts tests/bar-nav-dom-utils.test.ts tests/icon-catalog.test.ts tests/icon-cache.test.ts tests/icon-svg.test.ts",
73
+ "test": "node --import tsx/esm --test tests/component-inventory.test.ts tests/agent-contract.test.ts tests/panel-nav-utils.test.ts tests/panel-tools.test.ts tests/text.test.ts tests/eslint-plugin-local.test.ts tests/stylelint-plugin-local.test.ts tests/shell-shortcuts.test.ts tests/shell-gradient-presets.test.ts tests/shell-view-transition.test.ts tests/shell-gradient.test.ts tests/shell-chrome-metrics.test.ts tests/shell-chrome-layer.test.ts tests/chrome-transition.test.ts tests/bar-nav-overflow-hysteresis.test.ts tests/badge-gradient-ring.test.ts tests/scroll-edge-fade.test.ts tests/resolve-css-length-px.test.ts tests/resolve-css-time-ms.test.ts tests/overlay-positioning.test.ts tests/menu-position.test.ts tests/tooltip-position.test.ts tests/menu-placement.test.ts tests/bar-nav-utils.test.ts tests/bar-nav-tabs-menu-utils.test.ts tests/bar-nav-dom-utils.test.ts tests/icon-catalog.test.ts tests/icon-cache.test.ts tests/icon-svg.test.ts",
74
74
  "test:e2e": "npm run build && playwright test",
75
75
  "test:e2e:install": "playwright install chromium firefox webkit",
76
76
  "build:docs": "stencil build --docs",
@@ -1,15 +0,0 @@
1
- import { ChangeDetectorRef, ElementRef, NgZone, EventEmitter } from '@angular/core';
2
- import type { Components } from '@ds-mo/ui/components';
3
- import type { DsToggleCustomEvent } from '@ds-mo/ui/components';
4
- import * as i0 from "@angular/core";
5
- export declare class DsToggle {
6
- protected z: NgZone;
7
- protected el: HTMLDsToggleElement;
8
- dsChange: EventEmitter<DsToggleCustomEvent<boolean>>;
9
- constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
10
- static ɵfac: i0.ɵɵFactoryDeclaration<DsToggle, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<DsToggle, "ds-toggle", never, { "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isInactive": { "alias": "isInactive"; "required": false; }; "name": { "alias": "name"; "required": false; }; "required": { "alias": "required"; "required": false; }; "requiredMessage": { "alias": "requiredMessage"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "dsChange": "dsChange"; }, never, ["*"], true, never>;
12
- }
13
- export declare interface DsToggle extends Components.DsToggle {
14
- dsChange: EventEmitter<DsToggleCustomEvent<boolean>>;
15
- }
@@ -1,2 +0,0 @@
1
- import{p as e,H as t,c as s,h as i,a as o,t as n}from"./index.js";const r=()=>`:host(.ds-control-inactive),.ds-control-inactive{opacity:0.25;pointer-events:none;cursor:not-allowed}:host{position:relative;display:inline-flex;align-items:center;justify-content:flex-start;width:var(--dimension-size-400);height:var(--dimension-size-250);padding:0 var(--dimension-space-025);border:none;border-radius:var(--dimension-radius-half);cursor:pointer;user-select:none;outline:none;flex-shrink:0;background-color:var(--color-background-medium-neutral);box-shadow:var(--effect-highlight-depressed-sm);transition:background-color var(--effect-motion-short-2);box-sizing:border-box}:host::before{content:'';position:absolute;inset:0;border-radius:inherit;box-shadow:var(--effect-shadow-depressed-sm);pointer-events:none}:host(:focus-visible){outline:var(--dimension-stroke-width-025) solid var(--color-interaction-focus);outline-offset:var(--dimension-space-025)}:host(.checked){background-color:var(--color-foreground-bold-brand)}.thumb{position:relative;flex-shrink:0;width:var(--dimension-size-200);height:var(--dimension-size-200);background-color:var(--color-background-primary);border-radius:var(--dimension-radius-half);box-shadow:var(--effect-elevation-elevated-sm);transition:transform var(--effect-motion-short-2);transform:translateX(0);z-index:1}.thumb::after{content:'';position:absolute;inset:0;background-color:transparent;border-radius:inherit;transition:background-color var(--effect-motion-instant, 100ms);pointer-events:none}:host(:hover:not(.ds-control-inactive)) .thumb::after{background-color:var(--color-interaction-hover)}:host(:active:not(.ds-control-inactive)) .thumb::after{background-color:var(--color-interaction-pressed)}:host(.checked) .thumb{transform:translateX(var(--dimension-offset-150))}:host(:active:not(.ds-control-inactive)) .thumb{transform:translateX(0) scale(var(--dimension-scale-subtle)) !important;transition:transform var(--effect-motion-instant)}:host(.checked:active:not(.ds-control-inactive)) .thumb{transform:translateX(var(--dimension-offset-150)) scale(var(--dimension-scale-subtle)) !important;transition:transform var(--effect-motion-instant)}`;const a=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.dsChange=s(this,"dsChange");this.internals=this.attachInternals();this.checked=false;this.value="on";this.disabled=false;this.required=false;this.requiredMessage="This field is required.";this.isInactive=false;this.initialChecked=false;this.formDisabled=false;this.handleClick=()=>{if(this.isInactive||this.disabled||this.formDisabled)return;this.checked=!this.checked;this.dsChange.emit(this.checked)};this.handleKeyDown=e=>{if(this.isInactive||this.disabled||this.formDisabled)return;if(e.key===" "||e.key==="Enter"){e.preventDefault();this.handleClick()}}}componentWillLoad(){this.initialChecked=this.checked;this.syncFormValue()}syncFormValue(){const e=this.isInactive||this.disabled||this.formDisabled;this.internals.setFormValue(!e&&this.checked?this.value:null);const t=this.required&&!e&&!this.checked;this.internals.setValidity(t?{valueMissing:true}:{},t?this.requiredMessage:"")}formDisabledCallback(e){this.formDisabled=e;this.syncFormValue()}formResetCallback(){this.checked=this.initialChecked}render(){const e=this.isInactive||this.disabled||this.formDisabled;return i(o,{key:"66d2af20beb0fddfb3b01f64dc8e8838893e3bb6",role:"switch","aria-checked":String(this.checked),"aria-disabled":e?"true":undefined,tabIndex:e?-1:0,class:{toggle:true,checked:this.checked,"ds-control-inactive":e},onClick:this.handleClick,onKeyDown:this.handleKeyDown},i("span",{key:"209a9f0faf75dd57c74408dc4958d97ad1a7a624",class:"thumb"}))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncFormValue:0}],value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}}static get style(){return r()}},[65,"ds-toggle",{checked:[1028],name:[513],value:[1],disabled:[516],required:[516],requiredMessage:[1,"required-message"],isInactive:[4,"is-inactive"],formDisabled:[32]},undefined,{checked:[{syncFormValue:0}],value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ds-toggle"];e.forEach((e=>{switch(e){case"ds-toggle":if(!customElements.get(n(e))){customElements.define(n(e),a)}break}}))}c();const d=a;const l=c;export{d as DsToggle,l as defineCustomElement};
2
- //# sourceMappingURL=ds-toggle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["toggleCss","Toggle","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","checked","value","disabled","required","requiredMessage","isInactive","initialChecked","formDisabled","handleClick","dsChange","emit","handleKeyDown","e","key","preventDefault","componentWillLoad","syncFormValue","inactive","internals","setFormValue","missing","setValidity","valueMissing","formDisabledCallback","formResetCallback","render","h","Host","role","String","undefined","tabIndex","class","toggle","onClick","onKeyDown"],"sources":["src/wc/components/Toggle/Toggle.css?tag=ds-toggle&encapsulation=shadow","src/wc/components/Toggle/Toggle.tsx"],"sourcesContent":["@import '../../utils/control-inactive.css';\n\n:host {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n width: var(--dimension-size-400);\n height: var(--dimension-size-250);\n padding: 0 var(--dimension-space-025);\n border: none;\n border-radius: var(--dimension-radius-half);\n cursor: pointer;\n user-select: none;\n outline: none;\n flex-shrink: 0;\n background-color: var(--color-background-medium-neutral);\n box-shadow: var(--effect-highlight-depressed-sm);\n transition: background-color var(--effect-motion-short-2);\n box-sizing: border-box;\n}\n\n:host::before {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n box-shadow: var(--effect-shadow-depressed-sm);\n pointer-events: none;\n}\n\n:host(:focus-visible) {\n outline: var(--dimension-stroke-width-025) solid var(--color-interaction-focus);\n outline-offset: var(--dimension-space-025);\n}\n\n:host(.checked) {\n background-color: var(--color-foreground-bold-brand);\n}\n\n/* Inactive: `.ds-control-inactive` (25% opacity). */\n\n/* ── Thumb ───────────────────────────────────────────────────────────────── */\n\n.thumb {\n position: relative;\n flex-shrink: 0;\n width: var(--dimension-size-200);\n height: var(--dimension-size-200);\n background-color: var(--color-background-primary);\n border-radius: var(--dimension-radius-half);\n box-shadow: var(--effect-elevation-elevated-sm);\n transition: transform var(--effect-motion-short-2);\n transform: translateX(0);\n z-index: 1;\n}\n\n.thumb::after {\n content: '';\n position: absolute;\n inset: 0;\n background-color: transparent;\n border-radius: inherit;\n transition: background-color var(--effect-motion-instant, 100ms);\n pointer-events: none;\n}\n\n:host(:hover:not(.ds-control-inactive)) .thumb::after {\n background-color: var(--color-interaction-hover);\n}\n\n:host(:active:not(.ds-control-inactive)) .thumb::after {\n background-color: var(--color-interaction-pressed);\n}\n\n:host(.checked) .thumb {\n transform: translateX(var(--dimension-offset-150));\n}\n\n:host(:active:not(.ds-control-inactive)) .thumb {\n transform: translateX(0) scale(var(--dimension-scale-subtle)) !important;\n transition: transform var(--effect-motion-instant);\n}\n\n:host(.checked:active:not(.ds-control-inactive)) .thumb {\n transform: translateX(var(--dimension-offset-150)) scale(var(--dimension-scale-subtle)) !important;\n transition: transform var(--effect-motion-instant);\n}\n","import { AttachInternals, Component, Prop, State, Event, EventEmitter, Watch, h, Host } from '@stencil/core';\n\n@Component({\n tag: 'ds-toggle',\n styleUrl: 'Toggle.css',\n shadow: true,\n formAssociated: true,\n})\nexport class Toggle {\n @AttachInternals() internals!: ElementInternals;\n @Prop({ mutable: true }) checked: boolean = false;\n @Prop({ reflect: true }) name: string | undefined;\n @Prop() value: string = 'on';\n @Prop({ reflect: true }) disabled: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = 'This field is required.';\n @Prop() isInactive: boolean = false;\n\n @Event() dsChange!: EventEmitter<boolean>;\n\n private initialChecked = false;\n @State() private formDisabled = false;\n\n componentWillLoad() {\n this.initialChecked = this.checked;\n this.syncFormValue();\n }\n\n @Watch('checked')\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n this.internals.setFormValue(!inactive && this.checked ? this.value : null);\n const missing = this.required && !inactive && !this.checked;\n this.internals.setValidity(missing ? { valueMissing: true } : {}, missing ? this.requiredMessage : '');\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.checked = this.initialChecked;\n }\n\n private handleClick = () => {\n if (this.isInactive || this.disabled || this.formDisabled) return;\n this.checked = !this.checked;\n this.dsChange.emit(this.checked);\n };\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.isInactive || this.disabled || this.formDisabled) return;\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n this.handleClick();\n }\n };\n\n render() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n return (\n <Host\n role=\"switch\"\n aria-checked={String(this.checked)}\n aria-disabled={inactive ? 'true' : undefined}\n tabIndex={inactive ? -1 : 0}\n class={{ toggle: true, checked: this.checked, 'ds-control-inactive': inactive }}\n onClick={this.handleClick}\n onKeyDown={this.handleKeyDown}\n >\n <span class=\"thumb\" />\n </Host>\n );\n }\n}\n"],"mappings":"kEAAA,MAAMA,EAAY,IAAM,6jE,MCQXC,EAAMC,EAAA,MAAAD,UAAAE,EANnB,WAAAC,CAAAC,G,yIAQ2BC,KAAAC,QAAmB,MAEpCD,KAAAE,MAAgB,KACCF,KAAAG,SAAoB,MACpBH,KAAAI,SAAoB,MACrCJ,KAAAK,gBAA0B,0BAC1BL,KAAAM,WAAsB,MAItBN,KAAAO,eAAiB,MACRP,KAAAQ,aAAe,MA4BxBR,KAAAS,YAAc,KACpB,GAAIT,KAAKM,YAAcN,KAAKG,UAAYH,KAAKQ,aAAc,OAC3DR,KAAKC,SAAWD,KAAKC,QACrBD,KAAKU,SAASC,KAAKX,KAAKC,QAAQ,EAG1BD,KAAAY,cAAiBC,IACvB,GAAIb,KAAKM,YAAcN,KAAKG,UAAYH,KAAKQ,aAAc,OAC3D,GAAIK,EAAEC,MAAQ,KAAOD,EAAEC,MAAQ,QAAS,CACtCD,EAAEE,iBACFf,KAAKS,a,EAoBV,CAxDC,iBAAAO,GACEhB,KAAKO,eAAiBP,KAAKC,QAC3BD,KAAKiB,e,CAQP,aAAAA,GACE,MAAMC,EAAWlB,KAAKM,YAAcN,KAAKG,UAAYH,KAAKQ,aAC1DR,KAAKmB,UAAUC,cAAcF,GAAYlB,KAAKC,QAAUD,KAAKE,MAAQ,MACrE,MAAMmB,EAAUrB,KAAKI,WAAac,IAAalB,KAAKC,QACpDD,KAAKmB,UAAUG,YAAYD,EAAU,CAAEE,aAAc,MAAS,GAAIF,EAAUrB,KAAKK,gBAAkB,G,CAGrG,oBAAAmB,CAAqBrB,GACnBH,KAAKQ,aAAeL,EACpBH,KAAKiB,e,CAGP,iBAAAQ,GACEzB,KAAKC,QAAUD,KAAKO,c,CAiBtB,MAAAmB,GACE,MAAMR,EAAWlB,KAAKM,YAAcN,KAAKG,UAAYH,KAAKQ,aAC1D,OACEmB,EAACC,EAAI,CAAAd,IAAA,2CACHe,KAAK,SAAQ,eACCC,OAAO9B,KAAKC,SAAQ,gBACnBiB,EAAW,OAASa,UACnCC,SAAUd,GAAW,EAAK,EAC1Be,MAAO,CAAEC,OAAQ,KAAMjC,QAASD,KAAKC,QAAS,sBAAuBiB,GACrEiB,QAASnC,KAAKS,YACd2B,UAAWpC,KAAKY,eAEhBe,EAAA,QAAAb,IAAA,2CAAMmB,MAAM,U","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{d as e}from"./p-9Qu1ls2y.js";import{d as r}from"./p-CKjNw4Tl.js";import{C as s}from"./p-Cx-ywr1e.js";import{c as a}from"./p-DuFm-ieS.js";const c=()=>`.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-secondary)}.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:0;--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;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 u={md:"md",sm:"sm",xs:"xs"};const f=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.ariaLabel=null;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=s[this.size];const o=u[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:"618114abfee2b998f3426ab282928a1727ac1a67",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",...a(this.width)},tabIndex:-1},i("button",{key:"a67a6a0b907879b53e5c6ba14bee49a5abbba8cc",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:"74682d9d33b26c0d2bf8946db979b30e05ce873b",class:"button-filled__icon-wrap ds-interaction-fill__content"},i("ds-icon",{key:"633eb6022d1efd850a3ea814c219fcf1cac2d640",name:this.icon,size:o,color:"inherit"})),this.showLabel&&i("ds-text",{key:"0d7c6b95a244aec87d5f52da3ee3251aa19242a5",class:"button-filled__label ds-interaction-fill__content",as:"span",variant:t,emphasis:true,color:"inherit"},this.label)))}get el(){return this}static get style(){return c()}},[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 b(){if(typeof customElements==="undefined"){return}const t=["ds-button-filled","ds-icon","ds-text"];t.forEach((t=>{switch(t){case"ds-button-filled":if(!customElements.get(l(t))){customElements.define(l(t),f)}break;case"ds-icon":if(!customElements.get(l(t))){e()}break;case"ds-text":if(!customElements.get(l(t))){r()}break}}))}b();export{f as B,b as d};
2
- //# sourceMappingURL=p-BCiKXnx7.js.map