@ds-mo/ui 9.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/.build-stamp +1 -1
- package/dist/agent-patterns.json +233 -0
- package/dist/agent.json +155 -19
- package/dist/angular/ds-menu.d.ts +6 -1
- package/dist/angular/ds-menu.js +7 -4
- package/dist/angular/ds-swatch-picker.d.ts +15 -0
- package/dist/angular/ds-swatch-picker.js +42 -0
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +1 -0
- package/dist/angular/proxies.d.ts +1 -0
- package/dist/angular/proxies.js +1 -0
- package/dist/components/ds-app-shell.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-nav.js.map +1 -1
- package/dist/components/ds-menu.js +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-select-multi.js +1 -1
- package/dist/components/ds-select-multi.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-picker.js.map +1 -1
- package/dist/components/ds-shell-gradient-swatch.js +1 -1
- package/dist/components/ds-shell-gradient-swatch.js.map +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-slider.js.map +1 -1
- package/dist/components/ds-swatch-picker.d.ts +11 -0
- package/dist/components/ds-swatch-picker.js +2 -0
- package/dist/components/ds-swatch-picker.js.map +1 -0
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/p-D1HFMTdC.js +2 -0
- package/dist/components/p-D1HFMTdC.js.map +1 -0
- package/dist/components/p-HBIxvS5C.js +2 -0
- package/dist/components/p-HBIxvS5C.js.map +1 -0
- package/dist/components/p-l6PmnW_P.js +2 -0
- package/dist/components/p-l6PmnW_P.js.map +1 -0
- package/dist/components/p-tQ1QHeOE.js +2 -0
- package/dist/components/p-tQ1QHeOE.js.map +1 -0
- package/dist/docs/components.json +268 -30
- package/dist/lib/components/Menu/menu-placement.d.ts +6 -3
- package/dist/lib/shell/index.d.ts +2 -2
- package/dist/lib/shell/index.js +40 -39
- package/dist/lib/shell/index.js.map +3 -3
- package/dist/lib/shell/shell-gradient-presets.d.ts +15 -0
- package/dist/lib/utils/choice-popup-alignment.d.ts +20 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.js +16 -0
- package/dist/lib/utils/index.js.map +3 -3
- package/dist/mcp/cli.js +31409 -0
- package/dist/mcp-data/registry/app-shell.json +210 -0
- package/dist/mcp-data/registry/badge.json +289 -0
- package/dist/mcp-data/registry/banner.json +206 -0
- package/dist/mcp-data/registry/bar-nav.json +341 -0
- package/dist/mcp-data/registry/button-filled.json +386 -0
- package/dist/mcp-data/registry/button-unfilled.json +537 -0
- package/dist/mcp-data/registry/card-data-viz-donut.json +143 -0
- package/dist/mcp-data/registry/card-setting.json +194 -0
- package/dist/mcp-data/registry/card-shell-data-viz.json +173 -0
- package/dist/mcp-data/registry/card.json +126 -0
- package/dist/mcp-data/registry/chart-bar.json +121 -0
- package/dist/mcp-data/registry/chart-donut.json +257 -0
- package/dist/mcp-data/registry/chart-legend.json +209 -0
- package/dist/mcp-data/registry/chart-line.json +153 -0
- package/dist/mcp-data/registry/checkbox.json +361 -0
- package/dist/mcp-data/registry/chip.json +276 -0
- package/dist/mcp-data/registry/divider.json +225 -0
- package/dist/mcp-data/registry/empty-state.json +197 -0
- package/dist/mcp-data/registry/field.json +222 -0
- package/dist/mcp-data/registry/icon.json +242 -0
- package/dist/mcp-data/registry/input.json +597 -0
- package/dist/mcp-data/registry/loader.json +192 -0
- package/dist/mcp-data/registry/menu.json +459 -0
- package/dist/mcp-data/registry/modal.json +150 -0
- package/dist/mcp-data/registry/panel-nav.json +622 -0
- package/dist/mcp-data/registry/panel-sub-nav.json +249 -0
- package/dist/mcp-data/registry/panel-tools.json +374 -0
- package/dist/mcp-data/registry/radio.json +374 -0
- package/dist/mcp-data/registry/registry.json +5389 -0
- package/dist/mcp-data/registry/select-multi.json +755 -0
- package/dist/mcp-data/registry/select.json +740 -0
- package/dist/mcp-data/registry/shell-gradient-picker.json +195 -0
- package/dist/mcp-data/registry/shell-gradient-swatch.json +215 -0
- package/dist/mcp-data/registry/skeleton.json +282 -0
- package/dist/mcp-data/registry/slider.json +657 -0
- package/dist/mcp-data/registry/swatch-picker.json +231 -0
- package/dist/mcp-data/registry/switch.json +361 -0
- package/dist/mcp-data/registry/tab-group.json +255 -0
- package/dist/mcp-data/registry/tag.json +352 -0
- package/dist/mcp-data/registry/text.json +371 -0
- package/dist/mcp-data/registry/tooltip-data-viz.json +158 -0
- package/dist/mcp-data/registry/tooltip.json +311 -0
- package/dist/react/components.d.ts +1 -0
- package/dist/react/components.js +1 -0
- package/dist/react/ds-menu.d.ts +1 -0
- package/dist/react/ds-menu.js +2 -1
- package/dist/react/ds-swatch-picker.d.ts +12 -0
- package/dist/react/ds-swatch-picker.js +12 -0
- package/dist/types/components/Menu/Menu.d.ts +7 -1
- package/dist/types/components/Menu/menu-placement.d.ts +6 -3
- package/dist/types/components/Menu/menu-types.d.ts +14 -1
- package/dist/types/components/ShellGradientPicker/ShellGradientPicker.d.ts +2 -5
- package/dist/types/components/ShellGradientSwatch/ShellGradientSwatch.d.ts +1 -0
- package/dist/types/components/SwatchPicker/SwatchPicker.d.ts +21 -0
- package/dist/types/components/SwatchPicker/swatch-picker-types.d.ts +26 -0
- package/dist/types/components.d.ts +117 -0
- package/dist/types/shell/index.d.ts +2 -2
- package/dist/types/shell/shell-gradient-presets.d.ts +15 -0
- package/dist/types/utils/choice-popup-alignment.d.ts +21 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +6 -2
- package/dist/components/p-Bafp65bw.js +0 -2
- package/dist/components/p-Bafp65bw.js.map +0 -1
- package/dist/components/p-BdnR3jxi.js +0 -2
- package/dist/components/p-BdnR3jxi.js.map +0 -1
- package/dist/components/p-C_cu-HIT.js +0 -2
- package/dist/components/p-C_cu-HIT.js.map +0 -1
- package/dist/components/p-D0B9uDTP.js +0 -2
- package/dist/components/p-D0B9uDTP.js.map +0 -1
- package/dist/components/p-DF0yLZG_.js +0 -2
- package/dist/components/p-DF0yLZG_.js.map +0 -1
|
@@ -26,6 +26,7 @@ import { InputSize, InputType, InputWidth } from "./components/Input/Input";
|
|
|
26
26
|
import { LoaderColor, LoaderSize } from "./components/Loader/Loader";
|
|
27
27
|
import { MenuItemData, MenuSection } from "./components/Menu/menu-types";
|
|
28
28
|
import { MenuAlign, MenuSide } from "./components/Menu/menu-position";
|
|
29
|
+
import { ChoicePopupAnchorAlignment } from "./utils";
|
|
29
30
|
import { ModalWidth } from "./components/Modal/Modal";
|
|
30
31
|
import { PanelNavGroup, PanelNavRouterMode, PanelNavUserActionDetail } from "./components/PanelNav/panel-nav-types";
|
|
31
32
|
import { ChromeTransitionDetail } from "./shell/chrome-transition";
|
|
@@ -41,6 +42,7 @@ import { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, Text
|
|
|
41
42
|
import { IconSize as IconSize1 } from "./components/Icon/Icon";
|
|
42
43
|
import { ControlSize } from "./utils/control-text";
|
|
43
44
|
import { SliderOrientation, SliderSize, SliderThumbAlignment, SliderValue } from "./components/Slider/Slider";
|
|
45
|
+
import { SwatchPickerOption, SwatchPickerSection } from "./components/SwatchPicker/swatch-picker-types";
|
|
44
46
|
import { SwitchSize } from "./components/Switch/Switch";
|
|
45
47
|
import { TabGroupItem } from "./components/TabGroup/tab-item-utils";
|
|
46
48
|
import { TabBackground } from "./components/TabGroup/TabGroup";
|
|
@@ -67,6 +69,7 @@ export { InputSize, InputType, InputWidth } from "./components/Input/Input";
|
|
|
67
69
|
export { LoaderColor, LoaderSize } from "./components/Loader/Loader";
|
|
68
70
|
export { MenuItemData, MenuSection } from "./components/Menu/menu-types";
|
|
69
71
|
export { MenuAlign, MenuSide } from "./components/Menu/menu-position";
|
|
72
|
+
export { ChoicePopupAnchorAlignment } from "./utils";
|
|
70
73
|
export { ModalWidth } from "./components/Modal/Modal";
|
|
71
74
|
export { PanelNavGroup, PanelNavRouterMode, PanelNavUserActionDetail } from "./components/PanelNav/panel-nav-types";
|
|
72
75
|
export { ChromeTransitionDetail } from "./shell/chrome-transition";
|
|
@@ -82,6 +85,7 @@ export { LineTruncation, TextAlign, TextColor, TextDecoration, TextElement, Text
|
|
|
82
85
|
export { IconSize as IconSize1 } from "./components/Icon/Icon";
|
|
83
86
|
export { ControlSize } from "./utils/control-text";
|
|
84
87
|
export { SliderOrientation, SliderSize, SliderThumbAlignment, SliderValue } from "./components/Slider/Slider";
|
|
88
|
+
export { SwatchPickerOption, SwatchPickerSection } from "./components/SwatchPicker/swatch-picker-types";
|
|
85
89
|
export { SwitchSize } from "./components/Switch/Switch";
|
|
86
90
|
export { TabGroupItem } from "./components/TabGroup/tab-item-utils";
|
|
87
91
|
export { TabBackground } from "./components/TabGroup/TabGroup";
|
|
@@ -857,6 +861,11 @@ export namespace Components {
|
|
|
857
861
|
* External trigger element to position against. Set via JS: menuEl.anchor = buttonEl
|
|
858
862
|
*/
|
|
859
863
|
"anchor": HTMLElement | undefined;
|
|
864
|
+
/**
|
|
865
|
+
* Align choice-row edges to the anchor by default; use `popup-frame` only for custom frame geometry.
|
|
866
|
+
* @default 'choice-cell'
|
|
867
|
+
*/
|
|
868
|
+
"anchorAlignment": ChoicePopupAnchorAlignment;
|
|
860
869
|
/**
|
|
861
870
|
* ID of the external trigger element for positioning
|
|
862
871
|
*/
|
|
@@ -1411,6 +1420,9 @@ export namespace Components {
|
|
|
1411
1420
|
*/
|
|
1412
1421
|
"width": SelectMultiWidth;
|
|
1413
1422
|
}
|
|
1423
|
+
/**
|
|
1424
|
+
* @deprecated Use `ds-swatch-picker` with shell preset options.
|
|
1425
|
+
*/
|
|
1414
1426
|
interface DsShellGradientPicker {
|
|
1415
1427
|
/**
|
|
1416
1428
|
* @default 'Shell gradient theme'
|
|
@@ -1422,6 +1434,9 @@ export namespace Components {
|
|
|
1422
1434
|
*/
|
|
1423
1435
|
"value": ShellGradientPreset1;
|
|
1424
1436
|
}
|
|
1437
|
+
/**
|
|
1438
|
+
* @deprecated Use `ds-swatch-picker`; individual swatches are implementation detail.
|
|
1439
|
+
*/
|
|
1425
1440
|
interface DsShellGradientSwatch {
|
|
1426
1441
|
/**
|
|
1427
1442
|
* @default null
|
|
@@ -1599,6 +1614,28 @@ export namespace Components {
|
|
|
1599
1614
|
*/
|
|
1600
1615
|
"valueTexts": string[];
|
|
1601
1616
|
}
|
|
1617
|
+
interface DsSwatchPicker {
|
|
1618
|
+
/**
|
|
1619
|
+
* Accessible name for the complete one-of-many choice.
|
|
1620
|
+
* @default 'Swatch options'
|
|
1621
|
+
*/
|
|
1622
|
+
"groupLabel": string;
|
|
1623
|
+
/**
|
|
1624
|
+
* Flat option list. Sections take precedence when supplied. Assign as a JavaScript property.
|
|
1625
|
+
* @default []
|
|
1626
|
+
*/
|
|
1627
|
+
"options": SwatchPickerOption[];
|
|
1628
|
+
/**
|
|
1629
|
+
* Visually separated option groups that remain one radio group. Assign as a JavaScript property.
|
|
1630
|
+
* @default []
|
|
1631
|
+
*/
|
|
1632
|
+
"sections": SwatchPickerSection[];
|
|
1633
|
+
/**
|
|
1634
|
+
* Selected option value.
|
|
1635
|
+
* @default ''
|
|
1636
|
+
*/
|
|
1637
|
+
"value": string;
|
|
1638
|
+
}
|
|
1602
1639
|
interface DsSwitch {
|
|
1603
1640
|
/**
|
|
1604
1641
|
* Current on/off state. The initial value is restored when the owning form resets.
|
|
@@ -1931,6 +1968,10 @@ export interface DsSliderCustomEvent<T> extends CustomEvent<T> {
|
|
|
1931
1968
|
detail: T;
|
|
1932
1969
|
target: HTMLDsSliderElement;
|
|
1933
1970
|
}
|
|
1971
|
+
export interface DsSwatchPickerCustomEvent<T> extends CustomEvent<T> {
|
|
1972
|
+
detail: T;
|
|
1973
|
+
target: HTMLDsSwatchPickerElement;
|
|
1974
|
+
}
|
|
1934
1975
|
export interface DsSwitchCustomEvent<T> extends CustomEvent<T> {
|
|
1935
1976
|
detail: T;
|
|
1936
1977
|
target: HTMLDsSwitchElement;
|
|
@@ -2229,6 +2270,7 @@ declare global {
|
|
|
2229
2270
|
"dsClose": void;
|
|
2230
2271
|
"dsSelect": MenuItemData;
|
|
2231
2272
|
"dsGradientSelect": ShellGradientPreset;
|
|
2273
|
+
"dsSwatchSelect": string;
|
|
2232
2274
|
}
|
|
2233
2275
|
interface HTMLDsMenuElement extends Components.DsMenu, HTMLStencilElement {
|
|
2234
2276
|
addEventListener<K extends keyof HTMLDsMenuElementEventMap>(type: K, listener: (this: HTMLDsMenuElement, ev: DsMenuCustomEvent<HTMLDsMenuElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -2380,6 +2422,9 @@ declare global {
|
|
|
2380
2422
|
interface HTMLDsShellGradientPickerElementEventMap {
|
|
2381
2423
|
"dsChange": ShellGradientPreset1;
|
|
2382
2424
|
}
|
|
2425
|
+
/**
|
|
2426
|
+
* @deprecated Use `ds-swatch-picker` with shell preset options.
|
|
2427
|
+
*/
|
|
2383
2428
|
interface HTMLDsShellGradientPickerElement extends Components.DsShellGradientPicker, HTMLStencilElement {
|
|
2384
2429
|
addEventListener<K extends keyof HTMLDsShellGradientPickerElementEventMap>(type: K, listener: (this: HTMLDsShellGradientPickerElement, ev: DsShellGradientPickerCustomEvent<HTMLDsShellGradientPickerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2385
2430
|
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -2397,6 +2442,9 @@ declare global {
|
|
|
2397
2442
|
interface HTMLDsShellGradientSwatchElementEventMap {
|
|
2398
2443
|
"dsSelect": ShellGradientPreset1;
|
|
2399
2444
|
}
|
|
2445
|
+
/**
|
|
2446
|
+
* @deprecated Use `ds-swatch-picker`; individual swatches are implementation detail.
|
|
2447
|
+
*/
|
|
2400
2448
|
interface HTMLDsShellGradientSwatchElement extends Components.DsShellGradientSwatch, HTMLStencilElement {
|
|
2401
2449
|
addEventListener<K extends keyof HTMLDsShellGradientSwatchElementEventMap>(type: K, listener: (this: HTMLDsShellGradientSwatchElement, ev: DsShellGradientSwatchCustomEvent<HTMLDsShellGradientSwatchElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2402
2450
|
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -2435,6 +2483,23 @@ declare global {
|
|
|
2435
2483
|
prototype: HTMLDsSliderElement;
|
|
2436
2484
|
new (): HTMLDsSliderElement;
|
|
2437
2485
|
};
|
|
2486
|
+
interface HTMLDsSwatchPickerElementEventMap {
|
|
2487
|
+
"dsChange": string;
|
|
2488
|
+
}
|
|
2489
|
+
interface HTMLDsSwatchPickerElement extends Components.DsSwatchPicker, HTMLStencilElement {
|
|
2490
|
+
addEventListener<K extends keyof HTMLDsSwatchPickerElementEventMap>(type: K, listener: (this: HTMLDsSwatchPickerElement, ev: DsSwatchPickerCustomEvent<HTMLDsSwatchPickerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2491
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2492
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2493
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2494
|
+
removeEventListener<K extends keyof HTMLDsSwatchPickerElementEventMap>(type: K, listener: (this: HTMLDsSwatchPickerElement, ev: DsSwatchPickerCustomEvent<HTMLDsSwatchPickerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2495
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2496
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2497
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2498
|
+
}
|
|
2499
|
+
var HTMLDsSwatchPickerElement: {
|
|
2500
|
+
prototype: HTMLDsSwatchPickerElement;
|
|
2501
|
+
new (): HTMLDsSwatchPickerElement;
|
|
2502
|
+
};
|
|
2438
2503
|
interface HTMLDsSwitchElementEventMap {
|
|
2439
2504
|
"dsChange": boolean;
|
|
2440
2505
|
}
|
|
@@ -2558,6 +2623,7 @@ declare global {
|
|
|
2558
2623
|
"ds-shell-gradient-swatch": HTMLDsShellGradientSwatchElement;
|
|
2559
2624
|
"ds-skeleton": HTMLDsSkeletonElement;
|
|
2560
2625
|
"ds-slider": HTMLDsSliderElement;
|
|
2626
|
+
"ds-swatch-picker": HTMLDsSwatchPickerElement;
|
|
2561
2627
|
"ds-switch": HTMLDsSwitchElement;
|
|
2562
2628
|
"ds-tab-group": HTMLDsTabGroupElement;
|
|
2563
2629
|
"ds-tag": HTMLDsTagElement;
|
|
@@ -3377,6 +3443,11 @@ declare namespace LocalJSX {
|
|
|
3377
3443
|
* External trigger element to position against. Set via JS: menuEl.anchor = buttonEl
|
|
3378
3444
|
*/
|
|
3379
3445
|
"anchor"?: HTMLElement | undefined;
|
|
3446
|
+
/**
|
|
3447
|
+
* Align choice-row edges to the anchor by default; use `popup-frame` only for custom frame geometry.
|
|
3448
|
+
* @default 'choice-cell'
|
|
3449
|
+
*/
|
|
3450
|
+
"anchorAlignment"?: ChoicePopupAnchorAlignment;
|
|
3380
3451
|
/**
|
|
3381
3452
|
* ID of the external trigger element for positioning
|
|
3382
3453
|
*/
|
|
@@ -3403,6 +3474,10 @@ declare namespace LocalJSX {
|
|
|
3403
3474
|
*/
|
|
3404
3475
|
"onDsGradientSelect"?: (event: DsMenuCustomEvent<ShellGradientPreset>) => void;
|
|
3405
3476
|
"onDsSelect"?: (event: DsMenuCustomEvent<MenuItemData>) => void;
|
|
3477
|
+
/**
|
|
3478
|
+
* Emitted when a generic `swatch-picker` section option is chosen.
|
|
3479
|
+
*/
|
|
3480
|
+
"onDsSwatchSelect"?: (event: DsMenuCustomEvent<string>) => void;
|
|
3406
3481
|
/**
|
|
3407
3482
|
* @default false
|
|
3408
3483
|
*/
|
|
@@ -3994,6 +4069,9 @@ declare namespace LocalJSX {
|
|
|
3994
4069
|
*/
|
|
3995
4070
|
"width"?: SelectMultiWidth;
|
|
3996
4071
|
}
|
|
4072
|
+
/**
|
|
4073
|
+
* @deprecated Use `ds-swatch-picker` with shell preset options.
|
|
4074
|
+
*/
|
|
3997
4075
|
interface DsShellGradientPicker {
|
|
3998
4076
|
/**
|
|
3999
4077
|
* @default 'Shell gradient theme'
|
|
@@ -4006,6 +4084,9 @@ declare namespace LocalJSX {
|
|
|
4006
4084
|
*/
|
|
4007
4085
|
"value"?: ShellGradientPreset1;
|
|
4008
4086
|
}
|
|
4087
|
+
/**
|
|
4088
|
+
* @deprecated Use `ds-swatch-picker`; individual swatches are implementation detail.
|
|
4089
|
+
*/
|
|
4009
4090
|
interface DsShellGradientSwatch {
|
|
4010
4091
|
/**
|
|
4011
4092
|
* @default null
|
|
@@ -4191,6 +4272,29 @@ declare namespace LocalJSX {
|
|
|
4191
4272
|
*/
|
|
4192
4273
|
"valueTexts"?: string[];
|
|
4193
4274
|
}
|
|
4275
|
+
interface DsSwatchPicker {
|
|
4276
|
+
/**
|
|
4277
|
+
* Accessible name for the complete one-of-many choice.
|
|
4278
|
+
* @default 'Swatch options'
|
|
4279
|
+
*/
|
|
4280
|
+
"groupLabel"?: string;
|
|
4281
|
+
"onDsChange"?: (event: DsSwatchPickerCustomEvent<string>) => void;
|
|
4282
|
+
/**
|
|
4283
|
+
* Flat option list. Sections take precedence when supplied. Assign as a JavaScript property.
|
|
4284
|
+
* @default []
|
|
4285
|
+
*/
|
|
4286
|
+
"options"?: SwatchPickerOption[];
|
|
4287
|
+
/**
|
|
4288
|
+
* Visually separated option groups that remain one radio group. Assign as a JavaScript property.
|
|
4289
|
+
* @default []
|
|
4290
|
+
*/
|
|
4291
|
+
"sections"?: SwatchPickerSection[];
|
|
4292
|
+
/**
|
|
4293
|
+
* Selected option value.
|
|
4294
|
+
* @default ''
|
|
4295
|
+
*/
|
|
4296
|
+
"value"?: string;
|
|
4297
|
+
}
|
|
4194
4298
|
interface DsSwitch {
|
|
4195
4299
|
/**
|
|
4196
4300
|
* Current on/off state. The initial value is restored when the owning form resets.
|
|
@@ -4642,6 +4746,7 @@ declare namespace LocalJSX {
|
|
|
4642
4746
|
"open": boolean;
|
|
4643
4747
|
"side": MenuSide;
|
|
4644
4748
|
"align": MenuAlign;
|
|
4749
|
+
"anchorAlignment": ChoicePopupAnchorAlignment;
|
|
4645
4750
|
"sideOffset": string;
|
|
4646
4751
|
"alignOffset": string;
|
|
4647
4752
|
"menuWidth": string | undefined;
|
|
@@ -4810,6 +4915,10 @@ declare namespace LocalJSX {
|
|
|
4810
4915
|
"rangeSeparator": string;
|
|
4811
4916
|
"inputId": string | undefined;
|
|
4812
4917
|
}
|
|
4918
|
+
interface DsSwatchPickerAttributes {
|
|
4919
|
+
"value": string;
|
|
4920
|
+
"groupLabel": string;
|
|
4921
|
+
}
|
|
4813
4922
|
interface DsSwitchAttributes {
|
|
4814
4923
|
"checked": boolean;
|
|
4815
4924
|
"name": string | undefined;
|
|
@@ -4912,6 +5021,7 @@ declare namespace LocalJSX {
|
|
|
4912
5021
|
"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] };
|
|
4913
5022
|
"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] };
|
|
4914
5023
|
"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] };
|
|
5024
|
+
"ds-swatch-picker": Omit<DsSwatchPicker, keyof DsSwatchPickerAttributes> & { [K in keyof DsSwatchPicker & keyof DsSwatchPickerAttributes]?: DsSwatchPicker[K] } & { [K in keyof DsSwatchPicker & keyof DsSwatchPickerAttributes as `attr:${K}`]?: DsSwatchPickerAttributes[K] } & { [K in keyof DsSwatchPicker & keyof DsSwatchPickerAttributes as `prop:${K}`]?: DsSwatchPicker[K] };
|
|
4915
5025
|
"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] };
|
|
4916
5026
|
"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] };
|
|
4917
5027
|
"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"]>;
|
|
@@ -4979,10 +5089,17 @@ declare module "@stencil/core" {
|
|
|
4979
5089
|
"ds-radio": LocalJSX.IntrinsicElements["ds-radio"] & JSXBase.HTMLAttributes<HTMLDsRadioElement>;
|
|
4980
5090
|
"ds-select": LocalJSX.IntrinsicElements["ds-select"] & JSXBase.HTMLAttributes<HTMLDsSelectElement>;
|
|
4981
5091
|
"ds-select-multi": LocalJSX.IntrinsicElements["ds-select-multi"] & JSXBase.HTMLAttributes<HTMLDsSelectMultiElement>;
|
|
5092
|
+
/**
|
|
5093
|
+
* @deprecated Use `ds-swatch-picker` with shell preset options.
|
|
5094
|
+
*/
|
|
4982
5095
|
"ds-shell-gradient-picker": LocalJSX.IntrinsicElements["ds-shell-gradient-picker"] & JSXBase.HTMLAttributes<HTMLDsShellGradientPickerElement>;
|
|
5096
|
+
/**
|
|
5097
|
+
* @deprecated Use `ds-swatch-picker`; individual swatches are implementation detail.
|
|
5098
|
+
*/
|
|
4983
5099
|
"ds-shell-gradient-swatch": LocalJSX.IntrinsicElements["ds-shell-gradient-swatch"] & JSXBase.HTMLAttributes<HTMLDsShellGradientSwatchElement>;
|
|
4984
5100
|
"ds-skeleton": LocalJSX.IntrinsicElements["ds-skeleton"] & JSXBase.HTMLAttributes<HTMLDsSkeletonElement>;
|
|
4985
5101
|
"ds-slider": LocalJSX.IntrinsicElements["ds-slider"] & JSXBase.HTMLAttributes<HTMLDsSliderElement>;
|
|
5102
|
+
"ds-swatch-picker": LocalJSX.IntrinsicElements["ds-swatch-picker"] & JSXBase.HTMLAttributes<HTMLDsSwatchPickerElement>;
|
|
4986
5103
|
"ds-switch": LocalJSX.IntrinsicElements["ds-switch"] & JSXBase.HTMLAttributes<HTMLDsSwitchElement>;
|
|
4987
5104
|
"ds-tab-group": LocalJSX.IntrinsicElements["ds-tab-group"] & JSXBase.HTMLAttributes<HTMLDsTabGroupElement>;
|
|
4988
5105
|
"ds-tag": LocalJSX.IntrinsicElements["ds-tag"] & JSXBase.HTMLAttributes<HTMLDsTagElement>;
|
|
@@ -6,8 +6,8 @@ export { SHELL_GRADIENT_IMAGE_VAR, SHELL_GRADIENT_SIZE_VAR, SHELL_GRADIENT_POSIT
|
|
|
6
6
|
export type { ShellGradientLayout, ShellViewportDimensions } from './shell-gradient';
|
|
7
7
|
export type { MenuPlacement } from '../components/Menu/menu-placement';
|
|
8
8
|
export { PANEL_NAV_USER_MENU_PLACEMENT, } from '../components/Menu/menu-placement';
|
|
9
|
-
export type { ShellGradientPreset } from './shell-gradient-presets';
|
|
10
|
-
export { DEFAULT_SHELL_GRADIENT_PRESET, SHELL_GRADIENT_PRESETS, SHELL_GRADIENT_PRESET_LABELS, buildShellRadialGradientForPreset, isShellGradientPreset, normalizeShellGradientPreset, shellGradientPresetStopToken, } from './shell-gradient-presets';
|
|
9
|
+
export type { ShellGradientPickerOption, ShellGradientPickerPreview, ShellGradientPickerSection, ShellGradientPreset, } from './shell-gradient-presets';
|
|
10
|
+
export { DEFAULT_SHELL_GRADIENT_PRESET, SHELL_GRADIENT_PRESETS, SHELL_GRADIENT_PRESET_LABELS, buildShellRadialGradientForPreset, isShellGradientPreset, normalizeShellGradientPreset, shellGradientPickerSections, shellGradientPresetStopToken, } from './shell-gradient-presets';
|
|
11
11
|
export type { ChromeTransitionDetail, ChromeTransitionSource } from './chrome-transition';
|
|
12
12
|
export { CHROME_TRANSITION_END, CHROME_TRANSITION_START, ChromeTransitionDepth, createRafCoalescer, readChromeTransitionSource, readChromeTransitionPhase, } from './chrome-transition';
|
|
13
13
|
export { barGradientPositionFromPanelWidth, isPanelNavCollapsed, panelWidthPxFromTokens, readCssVarWidthPx, readPanelNavWidthTokens, } from './shell-chrome-metrics';
|
|
@@ -14,6 +14,19 @@ export interface ShellGradientRecipe {
|
|
|
14
14
|
opacity: number;
|
|
15
15
|
stops: readonly ShellGradientStop[];
|
|
16
16
|
}
|
|
17
|
+
export interface ShellGradientPickerPreview {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
backgroundImage?: string;
|
|
20
|
+
opacity?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ShellGradientPickerOption {
|
|
23
|
+
value: ShellGradientPreset;
|
|
24
|
+
label: string;
|
|
25
|
+
preview: ShellGradientPickerPreview;
|
|
26
|
+
}
|
|
27
|
+
export interface ShellGradientPickerSection {
|
|
28
|
+
options: ShellGradientPickerOption[];
|
|
29
|
+
}
|
|
17
30
|
export declare function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null;
|
|
18
31
|
export declare function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null;
|
|
19
32
|
export declare function shellGradientPresetOpacity(preset: ShellGradientPreset): string;
|
|
@@ -30,4 +43,6 @@ export declare function normalizeShellGradientPreset(value: string | null | unde
|
|
|
30
43
|
export declare function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string;
|
|
31
44
|
/** Build the production shell geometry from an ordered set of design-time stops. */
|
|
32
45
|
export declare function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string;
|
|
46
|
+
/** Generic SwatchPicker sections for the fixed shell appearance presets. */
|
|
47
|
+
export declare function shellGradientPickerSections(): ShellGradientPickerSection[];
|
|
33
48
|
//# sourceMappingURL=shell-gradient-presets.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AnchoredPopupAlign } from './anchored-popup';
|
|
2
|
+
/**
|
|
3
|
+
* `choice-cell` aligns the first/last interactive row edge with the anchor,
|
|
4
|
+
* allowing the popup frame to extend by the section inset. `popup-frame`
|
|
5
|
+
* aligns the popup frame itself and is reserved for deliberate custom geometry.
|
|
6
|
+
*/
|
|
7
|
+
export type ChoicePopupAnchorAlignment = 'choice-cell' | 'popup-frame';
|
|
8
|
+
export interface ChoicePopupAlignOffsetInput {
|
|
9
|
+
align: AnchoredPopupAlign;
|
|
10
|
+
alignOffsetPx: number;
|
|
11
|
+
sectionInsetPx: number;
|
|
12
|
+
anchorAlignment?: ChoicePopupAnchorAlignment;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the cross-axis offset for a choice popup. Authored `alignOffsetPx`
|
|
16
|
+
* remains an additive nudge after the shared inner-cell alignment is applied.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveChoicePopupAlignOffset({ align, alignOffsetPx, sectionInsetPx, anchorAlignment, }: ChoicePopupAlignOffsetInput): number;
|
|
19
|
+
/** Minimum popup width that keeps both choice-cell edges aligned to a trigger. */
|
|
20
|
+
export declare function choicePopupMinWidth(anchorWidth: number, sectionInsetPx: number): number;
|
|
21
|
+
//# sourceMappingURL=choice-popup-alignment.d.ts.map
|
|
@@ -13,4 +13,6 @@ export { controlWidthClass } from './control-width';
|
|
|
13
13
|
export type { ControlWidth } from './control-width';
|
|
14
14
|
export { CONTROL_TEXT_VARIANT } from './control-text';
|
|
15
15
|
export type { ControlSize } from './control-text';
|
|
16
|
+
export { choicePopupMinWidth, resolveChoicePopupAlignOffset, } from './choice-popup-alignment';
|
|
17
|
+
export type { ChoicePopupAnchorAlignment } from './choice-popup-alignment';
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ds-mo/ui",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "CompoMo — composable web components styled with TokoMo design tokens",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"main": "./dist/components/index.js",
|
|
25
25
|
"module": "./dist/components/index.js",
|
|
26
26
|
"types": "./dist/types/components.d.ts",
|
|
27
|
+
"bin": {
|
|
28
|
+
"compomo-mcp": "./dist/mcp/cli.js"
|
|
29
|
+
},
|
|
27
30
|
"exports": {
|
|
28
31
|
".": {
|
|
29
32
|
"types": "./dist/types/components.d.ts",
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
"import": "./dist/lib/utils/index.js"
|
|
59
62
|
},
|
|
60
63
|
"./agent": "./dist/agent.json",
|
|
64
|
+
"./agent/patterns": "./dist/agent-patterns.json",
|
|
61
65
|
"./dist/components/*": "./dist/components/*",
|
|
62
66
|
"./components/*": "./dist/components/*"
|
|
63
67
|
},
|
|
@@ -68,7 +72,7 @@
|
|
|
68
72
|
"prebuild": "npm run clean && npm run clean:framework-proxies && node scripts/generate-icon-catalog.mjs",
|
|
69
73
|
"pretypecheck": "node scripts/generate-icon-catalog.mjs",
|
|
70
74
|
"pretest": "node scripts/generate-icon-catalog.mjs",
|
|
71
|
-
"build": "stencil build && node scripts/verify-framework-proxies.mjs && 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 && node scripts/verify-framework-proxies.mjs",
|
|
75
|
+
"build": "stencil build && node scripts/verify-framework-proxies.mjs && 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 && node scripts/build-mcp.mjs && node scripts/verify-framework-proxies.mjs",
|
|
72
76
|
"verify:pack": "node scripts/verify-framework-proxies.mjs && node scripts/verify-npm-pack.mjs && node scripts/verify-package-imports.mjs",
|
|
73
77
|
"test": "node --import tsx/esm --test tests/*.test.ts",
|
|
74
78
|
"test:e2e": "npm run build && playwright test",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as s,H as e,c as t,h as a,a as i,t as r}from"./index.js";import{D as n,b as c,s as l,c as d}from"./p-D0B9uDTP.js";const o=()=>`.sc-ds-shell-gradient-swatch-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-shell-gradient-swatch-h:focus-visible,.ds-focus-ring.sc-ds-shell-gradient-swatch: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-shell-gradient-swatch-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-shell-gradient-swatch{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-shell-gradient-swatch-h:focus-visible,.ds-focus-ring-inset.sc-ds-shell-gradient-swatch:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-shell-gradient-swatch-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-shell-gradient-swatch: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-shell-gradient-swatch-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-shell-gradient-swatch{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-shell-gradient-swatch-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-shell-gradient-swatch::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-shell-gradient-swatch-h,.ds-control-inactive.sc-ds-shell-gradient-swatch{opacity:0.25;pointer-events:none;cursor:not-allowed}.sc-ds-shell-gradient-swatch-h{box-sizing:border-box;display:inline-flex;flex:0 0 auto;width:var(--dimension-size-300);height:var(--dimension-size-300);--_swatch-inner-inset:calc( var(--dimension-stroke-width-025) + var(--dimension-space-025) );--_swatch-ring-bg:var(--color-background-primary);--_swatch-select-motion:var(--effect-motion-short-3)}.shell-gradient-swatch.sc-ds-shell-gradient-swatch{position:relative;box-sizing:border-box;width:var(--dimension-size-300);height:var(--dimension-size-300);padding:0;border:none;border-radius:var(--dimension-radius-half);background:transparent;cursor:pointer;flex-shrink:0;isolation:isolate}.shell-gradient-swatch__fill.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__border.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__interaction.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__halo.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__stroke.sc-ds-shell-gradient-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none}.shell-gradient-swatch__fill.sc-ds-shell-gradient-swatch{z-index:1;background-color:var(--color-background-secondary);background-image:var(--_swatch-gradient-image);background-repeat:no-repeat;background-size:cover;background-position:0 0;transition:top var(--_swatch-select-motion), right var(--_swatch-select-motion), bottom var(--_swatch-select-motion), left var(--_swatch-select-motion)}.shell-gradient-swatch--none.sc-ds-shell-gradient-swatch .shell-gradient-swatch__fill.sc-ds-shell-gradient-swatch{background-image:none}.shell-gradient-swatch.sc-ds-shell-gradient-swatch:not(.shell-gradient-swatch--none) .shell-gradient-swatch__fill.sc-ds-shell-gradient-swatch{opacity:var(--ds-shell-gradient-opacity, 0.1)}.shell-gradient-swatch__border.sc-ds-shell-gradient-swatch{z-index:2;box-shadow:inset 0 0 0 var(--dimension-stroke-width-012) var(--color-border-secondary);transition:top var(--_swatch-select-motion), right var(--_swatch-select-motion), bottom var(--_swatch-select-motion), left var(--_swatch-select-motion)}.shell-gradient-swatch__interaction.sc-ds-shell-gradient-swatch{z-index:3;background:transparent;transition:top var(--_swatch-select-motion), right var(--_swatch-select-motion), bottom var(--_swatch-select-motion), left var(--_swatch-select-motion), background-color 0s}.shell-gradient-swatch.sc-ds-shell-gradient-swatch:hover:not(:disabled) .shell-gradient-swatch__interaction.sc-ds-shell-gradient-swatch{background:var(--color-interaction-hover)}.shell-gradient-swatch.sc-ds-shell-gradient-swatch:active:not(:disabled) .shell-gradient-swatch__interaction.sc-ds-shell-gradient-swatch{background:var(--color-interaction-pressed)}.shell-gradient-swatch__halo.sc-ds-shell-gradient-swatch{z-index:4;opacity:0;transform:scale(1.2);transform-origin:center;box-shadow:inset 0 0 0 var(--_swatch-inner-inset) var(--_swatch-ring-bg);transition:opacity var(--_swatch-select-motion), transform var(--_swatch-select-motion)}.shell-gradient-swatch__stroke.sc-ds-shell-gradient-swatch{z-index:5;opacity:0;transform:scale(1.2);transform-origin:center;box-shadow:inset 0 0 0 var(--dimension-stroke-width-025) var(--color-border-bold-brand);transition:opacity var(--_swatch-select-motion), transform var(--_swatch-select-motion)}.shell-gradient-swatch--selected.sc-ds-shell-gradient-swatch .shell-gradient-swatch__fill.sc-ds-shell-gradient-swatch,.shell-gradient-swatch--selected.sc-ds-shell-gradient-swatch .shell-gradient-swatch__border.sc-ds-shell-gradient-swatch,.shell-gradient-swatch--selected.sc-ds-shell-gradient-swatch .shell-gradient-swatch__interaction.sc-ds-shell-gradient-swatch{top:var(--_swatch-inner-inset);right:var(--_swatch-inner-inset);bottom:var(--_swatch-inner-inset);left:var(--_swatch-inner-inset)}.shell-gradient-swatch--selected.sc-ds-shell-gradient-swatch .shell-gradient-swatch__halo.sc-ds-shell-gradient-swatch,.shell-gradient-swatch--selected.sc-ds-shell-gradient-swatch .shell-gradient-swatch__stroke.sc-ds-shell-gradient-swatch{opacity:1;transform:scale(1)}@media (prefers-reduced-motion: reduce){.shell-gradient-swatch__fill.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__border.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__interaction.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__halo.sc-ds-shell-gradient-swatch,.shell-gradient-swatch__stroke.sc-ds-shell-gradient-swatch{transition:none}}`;const h=s(class s extends e{constructor(s){super();if(s!==false){this.__registerHost()}this.dsSelect=t(this,"dsSelect");this.preset=n;this.selected=false;this.isInactive=false;this.ariaLabel=null;this.handleClick=()=>{if(this.isInactive)return;this.dsSelect.emit(this.preset)}}render(){const s=this.ariaLabel??c[this.preset];return a(i,{key:"6bcd0c5306d90f820a9a175bb57f523bc5c6cf94"},a("button",{key:"52e0c4b536c7df59b6cae3e3df48e30a359e4e4c",type:"button",class:{"shell-gradient-swatch":true,"ds-focus-ring-inset":true,"ds-control-inactive":this.isInactive,"shell-gradient-swatch--selected":this.selected,"shell-gradient-swatch--none":this.preset==="none"},style:this.preset==="none"?undefined:{"--_swatch-gradient-image":d(this.preset),"--ds-shell-gradient-opacity":l(this.preset)},"aria-label":s,role:"radio","aria-checked":this.selected?"true":"false",tabIndex:this.selected?0:-1,disabled:this.isInactive,onClick:this.handleClick},a("span",{key:"43a1fdcc1b33b7a4e9e575103dbd8009c3cd0f2b",class:"shell-gradient-swatch__fill","aria-hidden":"true"}),a("span",{key:"a4cd425142ea73a1a56ff486ef79af31802c2e71",class:"shell-gradient-swatch__border","aria-hidden":"true"}),a("span",{key:"6ec35d86347163fc17270c97e1ce4f9317d75198",class:"shell-gradient-swatch__interaction","aria-hidden":"true"}),a("span",{key:"bbbca3920e62b652a66bab12efc85b5f17ee7561",class:"shell-gradient-swatch__halo","aria-hidden":"true"}),a("span",{key:"7146d6435c55218e4e48037195b62726bda8fd10",class:"shell-gradient-swatch__stroke","aria-hidden":"true"})))}static get style(){return o()}},[2,"ds-shell-gradient-swatch",{preset:[513],selected:[516],isInactive:[4,"is-inactive"],ariaLabel:[1,"aria-label"]}]);function g(){if(typeof customElements==="undefined"){return}const s=["ds-shell-gradient-swatch"];s.forEach((s=>{switch(s){case"ds-shell-gradient-swatch":if(!customElements.get(r(s))){customElements.define(r(s),h)}break}}))}g();export{h as S,g as d};
|
|
2
|
-
//# sourceMappingURL=p-Bafp65bw.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["shellGradientSwatchCss","ShellGradientSwatch","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","preset","DEFAULT_SHELL_GRADIENT_PRESET","selected","isInactive","ariaLabel","handleClick","dsSelect","emit","render","label","SHELL_GRADIENT_PRESET_LABELS","h","Host","key","type","class","style","undefined","buildShellRadialGradientForPreset","shellGradientPresetOpacity","role","tabIndex","disabled","onClick"],"sources":["src/wc/components/ShellGradientSwatch/ShellGradientSwatch.css?tag=ds-shell-gradient-swatch&encapsulation=scoped","src/wc/components/ShellGradientSwatch/ShellGradientSwatch.tsx"],"sourcesContent":["@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n/**\n * Swatch — 24×24 orb (size-300). Spacing lives on the picker row.\n *\n * Layer stack (bottom → top):\n * Default: fill → border → interaction (hover/press)\n * Selected: fill → border → interaction → halo → stroke (brand)\n */\n\n:host {\n box-sizing: border-box;\n display: inline-flex;\n flex: 0 0 auto;\n width: var(--dimension-size-300);\n height: var(--dimension-size-300);\n --_swatch-inner-inset: calc(\n var(--dimension-stroke-width-025) + var(--dimension-space-025)\n );\n --_swatch-ring-bg: var(--color-background-primary);\n --_swatch-select-motion: var(--effect-motion-short-3);\n}\n\n.shell-gradient-swatch {\n position: relative;\n box-sizing: border-box;\n width: var(--dimension-size-300);\n height: var(--dimension-size-300);\n padding: 0;\n border: none;\n border-radius: var(--dimension-radius-half);\n background: transparent;\n cursor: pointer;\n flex-shrink: 0;\n isolation: isolate;\n}\n\n.shell-gradient-swatch__fill,\n.shell-gradient-swatch__border,\n.shell-gradient-swatch__interaction,\n.shell-gradient-swatch__halo,\n.shell-gradient-swatch__stroke {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: inherit;\n pointer-events: none;\n}\n\n/* 1 — fill */\n.shell-gradient-swatch__fill {\n z-index: 1;\n background-color: var(--color-background-secondary);\n background-image: var(--_swatch-gradient-image);\n background-repeat: no-repeat;\n background-size: cover;\n background-position: 0 0;\n transition:\n top var(--_swatch-select-motion),\n right var(--_swatch-select-motion),\n bottom var(--_swatch-select-motion),\n left var(--_swatch-select-motion);\n}\n\n.shell-gradient-swatch--none .shell-gradient-swatch__fill {\n background-image: none;\n}\n\n.shell-gradient-swatch:not(.shell-gradient-swatch--none) .shell-gradient-swatch__fill {\n opacity: var(--ds-shell-gradient-opacity, 0.1);\n}\n\n/* 2 — secondary border (matches ds-interaction-fill--bordered) */\n.shell-gradient-swatch__border {\n z-index: 2;\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-012) var(--color-border-secondary);\n transition:\n top var(--_swatch-select-motion),\n right var(--_swatch-select-motion),\n bottom var(--_swatch-select-motion),\n left var(--_swatch-select-motion);\n}\n\n/* 3 — hover / press (over border, under selected chrome) */\n.shell-gradient-swatch__interaction {\n z-index: 3;\n background: transparent;\n transition:\n top var(--_swatch-select-motion),\n right var(--_swatch-select-motion),\n bottom var(--_swatch-select-motion),\n left var(--_swatch-select-motion),\n background-color 0s;\n}\n\n.shell-gradient-swatch:hover:not(:disabled) .shell-gradient-swatch__interaction {\n background: var(--color-interaction-hover);\n}\n\n.shell-gradient-swatch:active:not(:disabled) .shell-gradient-swatch__interaction {\n background: var(--color-interaction-pressed);\n}\n\n/* 4 — halo gap (selected only) */\n.shell-gradient-swatch__halo {\n z-index: 4;\n opacity: 0;\n transform: scale(1.2);\n transform-origin: center;\n box-shadow: inset 0 0 0 var(--_swatch-inner-inset) var(--_swatch-ring-bg);\n transition:\n opacity var(--_swatch-select-motion),\n transform var(--_swatch-select-motion);\n}\n\n/* 5 — brand stroke (selected only) */\n.shell-gradient-swatch__stroke {\n z-index: 5;\n opacity: 0;\n transform: scale(1.2);\n transform-origin: center;\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-025) var(--color-border-bold-brand);\n transition:\n opacity var(--_swatch-select-motion),\n transform var(--_swatch-select-motion);\n}\n\n.shell-gradient-swatch--selected .shell-gradient-swatch__fill,\n.shell-gradient-swatch--selected .shell-gradient-swatch__border,\n.shell-gradient-swatch--selected .shell-gradient-swatch__interaction {\n top: var(--_swatch-inner-inset);\n right: var(--_swatch-inner-inset);\n bottom: var(--_swatch-inner-inset);\n left: var(--_swatch-inner-inset);\n}\n\n.shell-gradient-swatch--selected .shell-gradient-swatch__halo,\n.shell-gradient-swatch--selected .shell-gradient-swatch__stroke {\n opacity: 1;\n transform: scale(1);\n}\n\n/* Inactive: `.ds-control-inactive` (25% opacity). */\n\n@media (prefers-reduced-motion: reduce) {\n .shell-gradient-swatch__fill,\n .shell-gradient-swatch__border,\n .shell-gradient-swatch__interaction,\n .shell-gradient-swatch__halo,\n .shell-gradient-swatch__stroke {\n transition: none;\n }\n}\n","import { Component, Prop, Event, EventEmitter, h, Host } from '@stencil/core';\nimport {\n SHELL_GRADIENT_PRESET_LABELS,\n buildShellRadialGradientForPreset,\n DEFAULT_SHELL_GRADIENT_PRESET,\n type ShellGradientPreset,\n} from './shell-gradient-swatch-types';\nimport { shellGradientPresetOpacity } from '../../shell/shell-gradient-presets';\n\n@Component({\n tag: 'ds-shell-gradient-swatch',\n styleUrl: 'ShellGradientSwatch.css',\n scoped: true,\n})\nexport class ShellGradientSwatch {\n /** Wash preset this orb previews. */\n @Prop({ reflect: true }) preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET;\n\n /** Selected — brand stroke + halo over inner fill/border/interaction stack. */\n @Prop({ reflect: true }) selected = false;\n\n @Prop() isInactive = false;\n\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n\n @Event() dsSelect!: EventEmitter<ShellGradientPreset>;\n\n private handleClick = () => {\n if (this.isInactive) return;\n this.dsSelect.emit(this.preset);\n };\n\n render() {\n const label = this.ariaLabel ?? SHELL_GRADIENT_PRESET_LABELS[this.preset];\n\n return (\n <Host>\n <button\n type=\"button\"\n class={{\n 'shell-gradient-swatch': true,\n 'ds-focus-ring-inset': true,\n 'ds-control-inactive': this.isInactive,\n 'shell-gradient-swatch--selected': this.selected,\n 'shell-gradient-swatch--none': this.preset === 'none',\n }}\n style={\n this.preset === 'none'\n ? undefined\n : {\n '--_swatch-gradient-image': buildShellRadialGradientForPreset(this.preset),\n '--ds-shell-gradient-opacity': shellGradientPresetOpacity(this.preset),\n }\n }\n aria-label={label}\n role=\"radio\"\n aria-checked={this.selected ? 'true' : 'false'}\n tabIndex={this.selected ? 0 : -1}\n disabled={this.isInactive}\n onClick={this.handleClick}\n >\n <span class=\"shell-gradient-swatch__fill\" aria-hidden=\"true\" />\n <span class=\"shell-gradient-swatch__border\" aria-hidden=\"true\" />\n <span class=\"shell-gradient-swatch__interaction\" aria-hidden=\"true\" />\n <span class=\"shell-gradient-swatch__halo\" aria-hidden=\"true\" />\n <span class=\"shell-gradient-swatch__stroke\" aria-hidden=\"true\" />\n </button>\n </Host>\n );\n }\n}\n"],"mappings":"2HAAA,MAAMA,EAAyB,IAAM,k9L,MCcxBC,EAAmBC,EAAA,MAAAD,UAAAE,EALhC,WAAAC,CAAAC,G,6EAO2BC,KAAAC,OAA8BC,EAG9BF,KAAAG,SAAW,MAE5BH,KAAAI,WAAa,MAEcJ,KAAAK,UAA2B,KAItDL,KAAAM,YAAc,KACpB,GAAIN,KAAKI,WAAY,OACrBJ,KAAKO,SAASC,KAAKR,KAAKC,OAAO,CAyClC,CAtCC,MAAAQ,GACE,MAAMC,EAAQV,KAAKK,WAAaM,EAA6BX,KAAKC,QAElE,OACEW,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,UAAAE,IAAA,2CACEC,KAAK,SACLC,MAAO,CACL,wBAAyB,KACzB,sBAAuB,KACvB,sBAAuBhB,KAAKI,WAC5B,kCAAmCJ,KAAKG,SACxC,8BAA+BH,KAAKC,SAAW,QAEjDgB,MACEjB,KAAKC,SAAW,OACZiB,UACA,CACE,2BAA4BC,EAAkCnB,KAAKC,QACnE,8BAA+BmB,EAA2BpB,KAAKC,SAChE,aAEKS,EACZW,KAAK,QAAO,eACErB,KAAKG,SAAW,OAAS,QACvCmB,SAAUtB,KAAKG,SAAW,GAAI,EAC9BoB,SAAUvB,KAAKI,WACfoB,QAASxB,KAAKM,aAEdM,EAAA,QAAAE,IAAA,2CAAME,MAAM,8BAA6B,cAAa,SACtDJ,EAAA,QAAAE,IAAA,2CAAME,MAAM,gCAA+B,cAAa,SACxDJ,EAAA,QAAAE,IAAA,2CAAME,MAAM,qCAAoC,cAAa,SAC7DJ,EAAA,QAAAE,IAAA,2CAAME,MAAM,8BAA6B,cAAa,SACtDJ,EAAA,QAAAE,IAAA,2CAAME,MAAM,gCAA+B,cAAa,U","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as i,a as r,t as a}from"./index.js";import{d as n}from"./p-Bafp65bw.js";import{D as l,n as d,S as o,a as c}from"./p-D0B9uDTP.js";const h=()=>`.sc-ds-shell-gradient-picker-h{display:block;width:100%}.shell-gradient-picker.sc-ds-shell-gradient-picker{box-sizing:border-box;display:flex;align-items:center;width:100%;min-height:var(--dimension-size-400);gap:var(--dimension-space-100);padding:var(--dimension-space-100)}.shell-gradient-picker__divider.sc-ds-shell-gradient-picker{flex:0 0 auto;align-self:center;width:var(--dimension-stroke-width-012);height:var(--dimension-size-300);background-color:var(--color-border-tertiary)}`;const p=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsChange=t(this,"dsChange");this.value=l;this.groupLabel="Shell gradient theme";this.handleSwatchSelect=e=>{const s=d(e);if(s===d(this.value))return;this.value=s;this.dsChange.emit(s)};this.handleSwatchKeyDown=(e,s)=>{const t=o.indexOf(s);let i=null;if(e.key==="ArrowRight"||e.key==="ArrowDown"){i=(t+1)%o.length}else if(e.key==="ArrowLeft"||e.key==="ArrowUp"){i=(t-1+o.length)%o.length}else if(e.key==="Home"){i=0}else if(e.key==="End"){i=o.length-1}if(i===null)return;e.preventDefault();const r=o[i];this.handleSwatchSelect(r);this.focusSwatch(r)}}focusSwatch(e){requestAnimationFrame((()=>{const s=this.el.querySelector(`ds-shell-gradient-swatch[preset="${e}"]`);s?.querySelector("button")?.focus()}))}renderSwatch(e){const s=d(this.value)===e;return i("ds-shell-gradient-swatch",{key:e,preset:e,selected:s,onKeyDown:s=>this.handleSwatchKeyDown(s,e),onDsSelect:e=>{e.stopPropagation();this.handleSwatchSelect(e.detail)}})}render(){return i(r,{key:"fb848126515d0dcaa9a0954f3540d6559935e9ea"},i("div",{key:"67968c77205ab52e584feb37781e65154adfb3ab",class:"shell-gradient-picker",role:"radiogroup","aria-label":this.groupLabel},this.renderSwatch("none"),i("div",{key:"929eb0709b4811dba9a50ab50c78b69653735be3",class:"shell-gradient-picker__divider","aria-hidden":"true"}),c.map((e=>this.renderSwatch(e)))))}get el(){return this}static get style(){return h()}},[2,"ds-shell-gradient-picker",{value:[1537],groupLabel:[1,"group-label"]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-shell-gradient-picker","ds-shell-gradient-swatch"];e.forEach((e=>{switch(e){case"ds-shell-gradient-picker":if(!customElements.get(a(e))){customElements.define(a(e),p)}break;case"ds-shell-gradient-swatch":if(!customElements.get(a(e))){n()}break}}))}g();export{p as S,g as d};
|
|
2
|
-
//# sourceMappingURL=p-BdnR3jxi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["shellGradientPickerCss","ShellGradientPicker","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","value","DEFAULT_SHELL_GRADIENT_PRESET","groupLabel","handleSwatchSelect","preset","normalized","normalizeShellGradientPreset","dsChange","emit","handleSwatchKeyDown","event","currentIndex","SHELL_GRADIENT_PRESETS","indexOf","nextIndex","key","length","preventDefault","nextPreset","focusSwatch","requestAnimationFrame","swatch","el","querySelector","focus","renderSwatch","selected","h","onKeyDown","onDsSelect","e","stopPropagation","detail","render","Host","class","role","SHELL_GRADIENT_WASH_PRESETS","map"],"sources":["src/wc/components/ShellGradientPicker/ShellGradientPicker.css?tag=ds-shell-gradient-picker&encapsulation=scoped","src/wc/components/ShellGradientPicker/ShellGradientPicker.tsx"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n}\n\n/* One row — same width footprint as menu items; 24px orbs + divider inside. */\n.shell-gradient-picker {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--dimension-size-400);\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-100);\n}\n\n.shell-gradient-picker__divider {\n flex: 0 0 auto;\n align-self: center;\n width: var(--dimension-stroke-width-012);\n height: var(--dimension-size-300);\n background-color: var(--color-border-tertiary);\n}\n","import { Component, Prop, Event, EventEmitter, Element, h, Host } from '@stencil/core';\nimport {\n SHELL_GRADIENT_PRESETS,\n SHELL_GRADIENT_WASH_PRESETS,\n DEFAULT_SHELL_GRADIENT_PRESET,\n normalizeShellGradientPreset,\n type ShellGradientPreset,\n} from '../ShellGradientSwatch/shell-gradient-swatch-types';\n\n@Component({\n tag: 'ds-shell-gradient-picker',\n styleUrl: 'ShellGradientPicker.css',\n scoped: true,\n})\nexport class ShellGradientPicker {\n /** Active shell wash preset. */\n @Prop({ mutable: true, reflect: true }) value: ShellGradientPreset =\n DEFAULT_SHELL_GRADIENT_PRESET;\n @Prop() groupLabel: string = 'Shell gradient theme';\n\n @Event() dsChange!: EventEmitter<ShellGradientPreset>;\n\n @Element() el!: HTMLElement;\n\n private handleSwatchSelect = (preset: ShellGradientPreset) => {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === normalizeShellGradientPreset(this.value)) return;\n this.value = normalized;\n this.dsChange.emit(normalized);\n };\n\n private focusSwatch(preset: ShellGradientPreset) {\n requestAnimationFrame(() => {\n const swatch = this.el.querySelector<HTMLElement>(\n `ds-shell-gradient-swatch[preset=\"${preset}\"]`,\n );\n swatch?.querySelector<HTMLButtonElement>('button')?.focus();\n });\n }\n\n private handleSwatchKeyDown = (event: KeyboardEvent, preset: ShellGradientPreset) => {\n const currentIndex = SHELL_GRADIENT_PRESETS.indexOf(preset);\n let nextIndex: number | null = null;\n\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n nextIndex = (currentIndex + 1) % SHELL_GRADIENT_PRESETS.length;\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n nextIndex = (currentIndex - 1 + SHELL_GRADIENT_PRESETS.length) % SHELL_GRADIENT_PRESETS.length;\n } else if (event.key === 'Home') {\n nextIndex = 0;\n } else if (event.key === 'End') {\n nextIndex = SHELL_GRADIENT_PRESETS.length - 1;\n }\n\n if (nextIndex === null) return;\n event.preventDefault();\n const nextPreset = SHELL_GRADIENT_PRESETS[nextIndex];\n this.handleSwatchSelect(nextPreset);\n this.focusSwatch(nextPreset);\n };\n\n private renderSwatch(preset: ShellGradientPreset) {\n const selected = normalizeShellGradientPreset(this.value) === preset;\n return (\n <ds-shell-gradient-swatch\n key={preset}\n preset={preset}\n selected={selected}\n onKeyDown={(event: KeyboardEvent) => this.handleSwatchKeyDown(event, preset)}\n onDsSelect={(e: CustomEvent<ShellGradientPreset>) => {\n e.stopPropagation();\n this.handleSwatchSelect(e.detail);\n }}\n />\n );\n }\n\n render() {\n return (\n <Host>\n <div\n class=\"shell-gradient-picker\"\n role=\"radiogroup\"\n aria-label={this.groupLabel}\n >\n {this.renderSwatch('none')}\n <div class=\"shell-gradient-picker__divider\" aria-hidden=\"true\" />\n {SHELL_GRADIENT_WASH_PRESETS.map(preset => this.renderSwatch(preset))}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"+JAAA,MAAMA,EAAyB,IAAM,ye,MCcxBC,EAAmBC,EAAA,MAAAD,UAAAE,EALhC,WAAAC,CAAAC,G,6EAO0CC,KAAAC,MACtCC,EACMF,KAAAG,WAAqB,uBAMrBH,KAAAI,mBAAsBC,IAC5B,MAAMC,EAAaC,EAA6BF,GAChD,GAAIC,IAAeC,EAA6BP,KAAKC,OAAQ,OAC7DD,KAAKC,MAAQK,EACbN,KAAKQ,SAASC,KAAKH,EAAW,EAYxBN,KAAAU,oBAAsB,CAACC,EAAsBN,KACnD,MAAMO,EAAeC,EAAuBC,QAAQT,GACpD,IAAIU,EAA2B,KAE/B,GAAIJ,EAAMK,MAAQ,cAAgBL,EAAMK,MAAQ,YAAa,CAC3DD,GAAaH,EAAe,GAAKC,EAAuBI,M,MACnD,GAAIN,EAAMK,MAAQ,aAAeL,EAAMK,MAAQ,UAAW,CAC/DD,GAAaH,EAAe,EAAIC,EAAuBI,QAAUJ,EAAuBI,M,MACnF,GAAIN,EAAMK,MAAQ,OAAQ,CAC/BD,EAAY,C,MACP,GAAIJ,EAAMK,MAAQ,MAAO,CAC9BD,EAAYF,EAAuBI,OAAS,C,CAG9C,GAAIF,IAAc,KAAM,OACxBJ,EAAMO,iBACN,MAAMC,EAAaN,EAAuBE,GAC1Cf,KAAKI,mBAAmBe,GACxBnB,KAAKoB,YAAYD,EAAW,CAkC/B,CA7DS,WAAAC,CAAYf,GAClBgB,uBAAsB,KACpB,MAAMC,EAAStB,KAAKuB,GAAGC,cACrB,oCAAoCnB,OAEtCiB,GAAQE,cAAiC,WAAWC,OAAO,G,CAyBvD,YAAAC,CAAarB,GACnB,MAAMsB,EAAWpB,EAA6BP,KAAKC,SAAWI,EAC9D,OACEuB,EAAA,4BACEZ,IAAKX,EACLA,OAAQA,EACRsB,SAAUA,EACVE,UAAYlB,GAAyBX,KAAKU,oBAAoBC,EAAON,GACrEyB,WAAaC,IACXA,EAAEC,kBACFhC,KAAKI,mBAAmB2B,EAAEE,OAAO,G,CAMzC,MAAAC,GACE,OACEN,EAACO,EAAI,CAAAnB,IAAA,4CACHY,EAAA,OAAAZ,IAAA,2CACEoB,MAAM,wBACNC,KAAK,aAAY,aACLrC,KAAKG,YAEhBH,KAAK0B,aAAa,QACnBE,EAAA,OAAAZ,IAAA,2CAAKoB,MAAM,iCAAgC,cAAa,SACvDE,EAA4BC,KAAIlC,GAAUL,KAAK0B,aAAarB,M","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t){const{anchorRect:e,popupWidth:a,popupHeight:r,side:s,align:i,sideOffsetPx:o,alignOffsetPx:h,viewportPadPx:n,viewportWidth:p,viewportHeight:c}=t;let d=0;let f=0;switch(s){case"top":f=e.top-r-o;d=i==="start"?e.left+h:i==="end"?e.right-a+h:e.left+e.width/2-a/2+h;break;case"bottom":f=e.bottom+o;d=i==="start"?e.left+h:i==="end"?e.right-a+h:e.left+e.width/2-a/2+h;break;case"left":d=e.left-a-o;f=i==="start"?e.top+h:i==="end"?e.bottom-r+h:e.top+e.height/2-r/2+h;break;case"right":d=e.right+o;f=i==="start"?e.top+h:i==="end"?e.bottom-r+h:e.top+e.height/2-r/2+h;break}return{x:Math.min(Math.max(d,n),p-a-n),y:Math.min(Math.max(f,n),c-r-n)}}export{t as c};
|
|
2
|
-
//# sourceMappingURL=p-C_cu-HIT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["computeAnchoredPopupPosition","input","anchorRect","anchor","popupWidth","popupHeight","side","align","sideOffsetPx","alignOffsetPx","viewportPadPx","viewportWidth","viewportHeight","x","y","top","left","right","width","bottom","height","Math","min","max"],"sources":["src/wc/utils/anchored-popup.ts"],"sourcesContent":["export type AnchoredPopupSide = 'top' | 'right' | 'bottom' | 'left';\nexport type AnchoredPopupAlign = 'start' | 'center' | 'end';\n\nexport interface AnchoredPopupPositionInput {\n anchorRect: Pick<DOMRectReadOnly, 'top' | 'left' | 'right' | 'bottom' | 'width' | 'height'>;\n popupWidth: number;\n popupHeight: number;\n side: AnchoredPopupSide;\n align: AnchoredPopupAlign;\n sideOffsetPx: number;\n alignOffsetPx: number;\n viewportPadPx: number;\n viewportWidth: number;\n viewportHeight: number;\n}\n\n/** Pure viewport-fixed anchored-popup layout math shared by menus and selects. */\nexport function computeAnchoredPopupPosition(\n input: AnchoredPopupPositionInput,\n): { x: number; y: number } {\n const {\n anchorRect: anchor,\n popupWidth,\n popupHeight,\n side,\n align,\n sideOffsetPx,\n alignOffsetPx,\n viewportPadPx,\n viewportWidth,\n viewportHeight,\n } = input;\n\n let x = 0;\n let y = 0;\n\n switch (side) {\n case 'top':\n y = anchor.top - popupHeight - sideOffsetPx;\n x =\n align === 'start'\n ? anchor.left + alignOffsetPx\n : align === 'end'\n ? anchor.right - popupWidth + alignOffsetPx\n : anchor.left + anchor.width / 2 - popupWidth / 2 + alignOffsetPx;\n break;\n case 'bottom':\n y = anchor.bottom + sideOffsetPx;\n x =\n align === 'start'\n ? anchor.left + alignOffsetPx\n : align === 'end'\n ? anchor.right - popupWidth + alignOffsetPx\n : anchor.left + anchor.width / 2 - popupWidth / 2 + alignOffsetPx;\n break;\n case 'left':\n x = anchor.left - popupWidth - sideOffsetPx;\n y =\n align === 'start'\n ? anchor.top + alignOffsetPx\n : align === 'end'\n ? anchor.bottom - popupHeight + alignOffsetPx\n : anchor.top + anchor.height / 2 - popupHeight / 2 + alignOffsetPx;\n break;\n case 'right':\n x = anchor.right + sideOffsetPx;\n y =\n align === 'start'\n ? anchor.top + alignOffsetPx\n : align === 'end'\n ? anchor.bottom - popupHeight + alignOffsetPx\n : anchor.top + anchor.height / 2 - popupHeight / 2 + alignOffsetPx;\n break;\n }\n\n return {\n x: Math.min(Math.max(x, viewportPadPx), viewportWidth - popupWidth - viewportPadPx),\n y: Math.min(Math.max(y, viewportPadPx), viewportHeight - popupHeight - viewportPadPx),\n };\n}\n"],"mappings":"AAiBM,SAAUA,EACdC,GAEA,MACEC,WAAYC,EAAMC,WAClBA,EAAUC,YACVA,EAAWC,KACXA,EAAIC,MACJA,EAAKC,aACLA,EAAYC,cACZA,EAAaC,cACbA,EAAaC,cACbA,EAAaC,eACbA,GACEX,EAEJ,IAAIY,EAAI,EACR,IAAIC,EAAI,EAER,OAAQR,GACN,IAAK,MACHQ,EAAIX,EAAOY,IAAMV,EAAcG,EAC/BK,EACEN,IAAU,QACNJ,EAAOa,KAAOP,EACdF,IAAU,MACRJ,EAAOc,MAAQb,EAAaK,EAC5BN,EAAOa,KAAOb,EAAOe,MAAQ,EAAId,EAAa,EAAIK,EAC1D,MACF,IAAK,SACHK,EAAIX,EAAOgB,OAASX,EACpBK,EACEN,IAAU,QACNJ,EAAOa,KAAOP,EACdF,IAAU,MACRJ,EAAOc,MAAQb,EAAaK,EAC5BN,EAAOa,KAAOb,EAAOe,MAAQ,EAAId,EAAa,EAAIK,EAC1D,MACF,IAAK,OACHI,EAAIV,EAAOa,KAAOZ,EAAaI,EAC/BM,EACEP,IAAU,QACNJ,EAAOY,IAAMN,EACbF,IAAU,MACRJ,EAAOgB,OAASd,EAAcI,EAC9BN,EAAOY,IAAMZ,EAAOiB,OAAS,EAAIf,EAAc,EAAII,EAC3D,MACF,IAAK,QACHI,EAAIV,EAAOc,MAAQT,EACnBM,EACEP,IAAU,QACNJ,EAAOY,IAAMN,EACbF,IAAU,MACRJ,EAAOgB,OAASd,EAAcI,EAC9BN,EAAOY,IAAMZ,EAAOiB,OAAS,EAAIf,EAAc,EAAII,EAC3D,MAGJ,MAAO,CACLI,EAAGQ,KAAKC,IAAID,KAAKE,IAAIV,EAAGH,GAAgBC,EAAgBP,EAAaM,GACrEI,EAAGO,KAAKC,IAAID,KAAKE,IAAIT,EAAGJ,GAAgBE,EAAiBP,EAAcK,GAE3E,Q","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const o=["none","cool","neutral","warm","fresh"];const n=["cool","neutral","warm","fresh"];const r="neutral";const t={none:"None",cool:"Cool",neutral:"Neutral",warm:"Warm",fresh:"Fresh"};const c={cool:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-blue-strong-background)",position:100}]},neutral:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-grey-strong-background)",position:100}]},warm:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-yellow-strong-background)",position:100}]},fresh:{opacity:.4,stops:[{color:"var(--color-color-intent-cyan-faint-background)",position:0},{color:"var(--color-background-transparent)",position:47},{color:"var(--color-background-transparent)",position:58},{color:"var(--color-color-intent-red-faint-background)",position:83},{color:"var(--color-color-intent-pink-faint-background)",position:100}]}};const a="100% 100% at 0% 0%";function s(o){const n=e(o);return n==="none"?null:c[n]}function l(o){return String(s(o)?.opacity??0)}function i(n){return o.includes(n)}function e(o){return o!=null&&i(o)?o:r}function u(o){const n=e(o);if(n==="none")return"none";return p(c[n].stops)}function p(o){const n=o.map((o=>`${o.color} ${o.position}%`)).join(", ");return`radial-gradient(${a}, ${n})`}export{r as D,o as S,n as a,t as b,u as c,e as n,l as s};
|
|
2
|
-
//# sourceMappingURL=p-D0B9uDTP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SHELL_GRADIENT_PRESETS","SHELL_GRADIENT_WASH_PRESETS","DEFAULT_SHELL_GRADIENT_PRESET","SHELL_GRADIENT_PRESET_LABELS","none","cool","neutral","warm","fresh","SHELL_GRADIENT_RECIPES","opacity","stops","color","position","GRADIENT_GEOMETRY","shellGradientPresetRecipe","preset","normalized","normalizeShellGradientPreset","shellGradientPresetOpacity","String","isShellGradientPreset","value","includes","buildShellRadialGradientForPreset","buildShellRadialGradientFromStops","serialized","map","stop","join"],"sources":["src/wc/shell/shell-gradient-presets.ts"],"sourcesContent":["/** Built-in shell chrome wash presets. */\nexport type ShellGradientPreset = 'none' | 'cool' | 'neutral' | 'warm' | 'fresh';\n\nexport const SHELL_GRADIENT_PRESETS: ShellGradientPreset[] = [\n 'none',\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Wash presets shown after the `none` option in pickers. */\nexport const SHELL_GRADIENT_WASH_PRESETS: Exclude<ShellGradientPreset, 'none'>[] = [\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Default wash when `gradient-preset` is omitted. */\nexport const DEFAULT_SHELL_GRADIENT_PRESET: ShellGradientPreset = 'neutral';\n\nexport const SHELL_GRADIENT_PRESET_LABELS: Record<ShellGradientPreset, string> = {\n none: 'None',\n cool: 'Cool',\n neutral: 'Neutral',\n warm: 'Warm',\n fresh: 'Fresh',\n};\n\nexport interface ShellGradientStop {\n color: string;\n position: number;\n}\n\nexport interface ShellGradientRecipe {\n opacity: number;\n stops: readonly ShellGradientStop[];\n}\n\nconst SHELL_GRADIENT_RECIPES: Record<Exclude<ShellGradientPreset, 'none'>, ShellGradientRecipe> = {\n cool: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-blue-strong-background)', position: 100 },\n ],\n },\n neutral: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-grey-strong-background)', position: 100 },\n ],\n },\n warm: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-yellow-strong-background)', position: 100 },\n ],\n },\n fresh: {\n opacity: 0.4,\n stops: [\n { color: 'var(--color-color-intent-cyan-faint-background)', position: 0 },\n { color: 'var(--color-background-transparent)', position: 47 },\n { color: 'var(--color-background-transparent)', position: 58 },\n { color: 'var(--color-color-intent-red-faint-background)', position: 83 },\n { color: 'var(--color-color-intent-pink-faint-background)', position: 100 },\n ],\n },\n};\n\nconst GRADIENT_GEOMETRY = '100% 100% at 0% 0%';\n\nexport function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null {\n if (preset === 'none') return null;\n const stops = SHELL_GRADIENT_RECIPES[preset].stops;\n return stops[stops.length - 1]?.color ?? null;\n}\n\nexport function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null {\n const normalized = normalizeShellGradientPreset(preset);\n return normalized === 'none' ? null : SHELL_GRADIENT_RECIPES[normalized];\n}\n\nexport function shellGradientPresetOpacity(preset: ShellGradientPreset): string {\n return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);\n}\n\nexport function isShellGradientPreset(value: string): value is ShellGradientPreset {\n return (SHELL_GRADIENT_PRESETS as string[]).includes(value);\n}\n\n/**\n * Coerce unknown/absent presets to the default. Runtime values escape the\n * type: removing the reflected `gradient-preset` attribute (e.g. an Angular\n * `[attr.gradient-preset]=\"null\"` binding) drives the prop to null past its\n * field default — without normalization the stop lookup interpolates the\n * literal string \"undefined\" into CSS and the wash silently disappears.\n */\nexport function normalizeShellGradientPreset(\n value: string | null | undefined,\n): ShellGradientPreset {\n return value != null && isShellGradientPreset(value) ? value : DEFAULT_SHELL_GRADIENT_PRESET;\n}\n\n/** Radial wash for a preset — transparent at top-left into the intent stop. `none` returns no image. */\nexport function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === 'none') return 'none';\n\n return buildShellRadialGradientFromStops(SHELL_GRADIENT_RECIPES[normalized].stops);\n}\n\n/** Build the production shell geometry from an ordered set of design-time stops. */\nexport function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string {\n const serialized = stops.map(stop => `${stop.color} ${stop.position}%`).join(', ');\n return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;\n}\n"],"mappings":"AAGO,MAAMA,EAAgD,CAC3D,OACA,OACA,UACA,OACA,SAIK,MAAMC,EAAsE,CACjF,OACA,UACA,OACA,SAIK,MAAMC,EAAqD,UAE3D,MAAMC,EAAoE,CAC/EC,KAAM,OACNC,KAAM,OACNC,QAAS,UACTC,KAAM,OACNC,MAAO,SAaT,MAAMC,EAA4F,CAChGJ,KAAM,CACJK,QAAS,GACTC,MAAO,CACL,CAAEC,MAAO,sCAAuCC,SAAU,GAC1D,CAAED,MAAO,mDAAoDC,SAAU,OAG3EP,QAAS,CACPI,QAAS,GACTC,MAAO,CACL,CAAEC,MAAO,sCAAuCC,SAAU,GAC1D,CAAED,MAAO,mDAAoDC,SAAU,OAG3EN,KAAM,CACJG,QAAS,GACTC,MAAO,CACL,CAAEC,MAAO,sCAAuCC,SAAU,GAC1D,CAAED,MAAO,qDAAsDC,SAAU,OAG7EL,MAAO,CACLE,QAAS,GACTC,MAAO,CACL,CAAEC,MAAO,kDAAmDC,SAAU,GACtE,CAAED,MAAO,sCAAuCC,SAAU,IAC1D,CAAED,MAAO,sCAAuCC,SAAU,IAC1D,CAAED,MAAO,iDAAkDC,SAAU,IACrE,CAAED,MAAO,kDAAmDC,SAAU,QAK5E,MAAMC,EAAoB,qBAQpB,SAAUC,EAA0BC,GACxC,MAAMC,EAAaC,EAA6BF,GAChD,OAAOC,IAAe,OAAS,KAAOR,EAAuBQ,EAC/D,CAEM,SAAUE,EAA2BH,GACzC,OAAOI,OAAOL,EAA0BC,IAASN,SAAW,EAC9D,CAEM,SAAUW,EAAsBC,GACpC,OAAQtB,EAAoCuB,SAASD,EACvD,CASM,SAAUJ,EACdI,GAEA,OAAOA,GAAS,MAAQD,EAAsBC,GAASA,EAAQpB,CACjE,CAGM,SAAUsB,EAAkCR,GAChD,MAAMC,EAAaC,EAA6BF,GAChD,GAAIC,IAAe,OAAQ,MAAO,OAElC,OAAOQ,EAAkChB,EAAuBQ,GAAYN,MAC9E,CAGM,SAAUc,EAAkCd,GAChD,MAAMe,EAAaf,EAAMgB,KAAIC,GAAQ,GAAGA,EAAKhB,SAASgB,EAAKf,cAAagB,KAAK,MAC7E,MAAO,mBAAmBf,MAAsBY,IAClD,Q","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as i,H as e,c as s,h as n,a as t,t as o}from"./index.js";import{c as r}from"./p-C_cu-HIT.js";import{d as c}from"./p-BbV68F23.js";import{d as a}from"./p-BdnR3jxi.js";import{d}from"./p-Bafp65bw.js";import{d as l}from"./p-C7UFYvsO.js";import{d as u}from"./p-CbS_WWs2.js";import{a as h,T as m}from"./p-drBA73M_.js";import{r as f}from"./p-BWUTr_XN.js";import{r as p}from"./p-BHtg1fh3.js";const v=r;function g(i){return"variant"in i&&i.variant==="gradient-picker"}const b=()=>`.sc-ds-menu-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-menu-h:focus-visible,.ds-focus-ring.sc-ds-menu: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-menu-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-menu{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-menu-h:focus-visible,.ds-focus-ring-inset.sc-ds-menu:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-menu-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-menu: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-menu-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-menu{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-menu-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-menu::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-menu-h,.ds-interaction-fill.sc-ds-menu{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-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent}.ds-interaction-fill.sc-ds-menu-h::before,.ds-interaction-fill.sc-ds-menu::before,.ds-interaction-fill.sc-ds-menu-h::after,.ds-interaction-fill.sc-ds-menu::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;transition:none}.ds-interaction-fill.sc-ds-menu-h::before,.ds-interaction-fill.sc-ds-menu::before{z-index:1}.ds-interaction-fill.sc-ds-menu-h::after,.ds-interaction-fill.sc-ds-menu::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-menu-h,.ds-interaction-fill--bordered.sc-ds-menu{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-menu-h::before,.ds-interaction-fill--selected.sc-ds-menu::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-menu-h,.ds-interaction-fill--selected.sc-ds-menu{--ds-interaction-dot-ring:var(--ds-interaction-active)}.ds-interaction-fill.sc-ds-menu-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-menu:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}.ds-interaction-fill.sc-ds-menu-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-menu:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill.sc-ds-menu-h>.ds-interaction-fill__content.sc-ds-menu,.ds-interaction-fill.sc-ds-menu>.ds-interaction-fill__content.sc-ds-menu,.ds-interaction-fill__content.sc-ds-menu{position:relative;z-index:2}.ds-interaction-fill--on-faint.sc-ds-menu-h,.ds-interaction-fill--on-faint.sc-ds-menu{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-menu-h,.ds-interaction-fill--on-medium.sc-ds-menu{--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-menu-h,.ds-interaction-fill--on-bold.sc-ds-menu{--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-menu-h,.ds-interaction-fill--on-strong.sc-ds-menu{--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-translucent.sc-ds-menu-h,.ds-interaction-fill--on-translucent.sc-ds-menu{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-menu-h,.ds-interaction-fill--on-inverted.sc-ds-menu{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-menu-h,.ds-interaction-fill--on-media.sc-ds-menu{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-menu-h,.ds-interaction-fill--on-always-dark.sc-ds-menu{--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-menu-h,.ds-interaction-fill--on-navigation.sc-ds-menu{--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-menu-h,.ds-control-inactive.sc-ds-menu{opacity:0.25;pointer-events:none;cursor:not-allowed}.ds-control--md.sc-ds-menu-h,.ds-control--md.sc-ds-menu{--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-menu-h,.ds-control--sm.sc-ds-menu{--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-menu-h,.ds-control--xs.sc-ds-menu{--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-choice-popup.sc-ds-menu{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--dimension-menu-width-xs);max-width:min( var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)) );max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;background-color:var(--color-background-primary);border-radius:var(--dimension-radius-075);box-shadow:var(--effect-shadow-elevated-floating);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-menu::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-menu{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-menu{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-menu{opacity:0}}.ds-choice-list.sc-ds-menu{display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain}.ds-choice-section.sc-ds-menu{display:flex;flex-direction:column;gap:var(--dimension-space-050);padding:var(--dimension-space-050)}.ds-choice-section--divided.sc-ds-menu{border-bottom:var(--dimension-stroke-width-015) solid var(--color-border-tertiary)}ds-text.ds-choice-section__header.sc-ds-menu{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding:0 calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) );text-align:start;-webkit-user-select:none;user-select:none}.ds-choice-item.sc-ds-menu{display:flex;align-items:center;gap:var(--ds-control-gap, var(--dimension-space-050));width:100%;height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));box-sizing:border-box;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));background:transparent;cursor:pointer;-webkit-user-select:none;user-select:none;text-align:left;color:inherit}.ds-choice-item.sc-ds-menu:has(.ds-choice-item__subtext){height:auto;min-height:var(--ds-control-height, var(--dimension-size-400));padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));align-items:flex-start}.ds-choice-item__content.sc-ds-menu{display:flex;flex:1;flex-direction:column;gap:var(--dimension-space-025);min-width:0}ds-text.ds-choice-item__label.sc-ds-menu,.ds-choice-item__subtext.sc-ds-menu,ds-text.ds-choice-item__subtext.sc-ds-menu{padding:0 var(--ds-control-label-inset, var(--dimension-space-025))}ds-text.ds-choice-item__label.sc-ds-menu{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ds-text.ds-choice-item__subtext.sc-ds-menu{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.ds-choice-item__icon.sc-ds-menu,.ds-choice-item__suffix.sc-ds-menu{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));pointer-events:none}.ds-choice-empty.sc-ds-menu,.ds-choice-loading.sc-ds-menu{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:var(--dimension-size-600);padding:var(--dimension-space-100)}.ds-choice-footer.sc-ds-menu{position:relative;box-sizing:border-box;padding:var(--dimension-space-050)}.ds-choice-footer.sc-ds-menu::before{content:'';position:absolute;inset:0 0 auto;height:var(--dimension-stroke-width-012);background-color:var(--color-border-tertiary);pointer-events:none}.ds-choice-footer__content.sc-ds-menu{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--dimension-size-400);padding:0 var(--ds-control-padding-inline, var(--dimension-space-075))}.ds-choice-footer__summary.sc-ds-menu,.ds-choice-footer__clear.sc-ds-menu ds-text.sc-ds-menu{padding:0 var(--ds-control-label-inset, var(--dimension-space-025))}.ds-choice-footer__clear.sc-ds-menu{appearance:none;display:inline-flex;align-items:center;padding:0;border:0;border-radius:var(--dimension-radius-025);background:transparent;color:var(--color-foreground-bold-brand);cursor:pointer}.ds-choice-footer__clear.sc-ds-menu:hover{text-decoration:underline}.menu-item--destructive.sc-ds-menu .menu-item__label.sc-ds-menu{color:var(--color-foreground-bold-negative) !important}.menu-item__dot-box.sc-ds-menu{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));pointer-events:none}.menu-item__switch.sc-ds-menu{flex-shrink:0}`;const x=8;const w=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");const y=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.dsClose=s(this,"dsClose");this.dsSelect=s(this,"dsSelect");this.dsGradientSelect=s(this,"dsGradientSelect");this.open=false;this.items=[];this.sections=[];this.side="bottom";this.align="start";this.sideOffset=h.space050;this.alignOffset=0;this.initialFocusVisible=false;this.menuLabel="Menu";this.shouldRender=false;this.closing=false;this.pos={x:0,y:0};this.focusedIndex=0;this.positionReady=false;this.focusRingVisible=false;this.clickOutsideHandler=null;this.scrollResizeHandler=null;this.closeTimer=null;this.itemEls=[];this.positionRetryRaf=null;this.listenersReady=false}componentDidLoad(){if(this.open)this.onOpenChange(true)}disconnectedCallback(){this.cancelPositionRetry();this.teardownListeners()}onOpenChange(i){if(i){this.teardownListeners();this.shouldRender=true;this.closing=false;this.positionReady=false;this.listenersReady=false;this.focusRingVisible=this.initialFocusVisible;this.listenersReady=true;this.setupListeners();this.schedulePositionUpdate((()=>{this.focusInitialItem()}))}else if(this.shouldRender){this.cancelPositionRetry();this.closing=true;this.teardownListeners();this.listenersReady=false;const i=this.closeAnimationMs;if(i<=0){this.finishClose();return}this.closeTimer=setTimeout((()=>{this.closeTimer=null;this.finishClose()}),i)}}onAnchorChange(){if(this.open)this.schedulePositionUpdate()}onPositionPropsChange(){if(this.open)this.schedulePositionUpdate()}get viewportPadPx(){return f(m.space050,m.space050)}get sideOffsetPx(){return f(this.sideOffset,m.space050)}get alignOffsetPx(){return f(this.alignOffset,0)}get popupFallbackWidthPx(){return f(m.menuWidthXs,m.menuWidthXs)}get popupFallbackHeightPx(){return f(m.menuFallbackHeight,m.menuFallbackHeight)}get closeAnimationMs(){return p(m.motionShort2,m.animationDurationShort3)}finishClose(){this.shouldRender=false;this.closing=false}get resolvedAnchor(){if(this.anchor)return this.anchor;if(this.anchorId)return document.getElementById(this.anchorId);return null}get anchorFocusTarget(){const i=this.resolvedAnchor;if(!i)return null;if(i.matches(w))return i;return i.querySelector(w)??i}focusAnchor(){const i=this.resolvedAnchor;if(i?.setFocus){i.setFocus();return}this.anchorFocusTarget?.focus()}moveFocusAfterTab(i){const e=this.anchorFocusTarget;if(!e)return;if(i){e.focus();return}const s=Array.from(document.querySelectorAll(w)).filter((i=>!i.closest(".menu-popup")&&!i.closest("[inert]")&&i.getClientRects().length>0));const n=s.indexOf(e);(s[n+1]??e).focus()}compositeTabLeavesPopup(i){const e=this.el.querySelector(".menu-popup");if(!e)return true;const s=Array.from(e.querySelectorAll(w)).filter((i=>i.getClientRects().length>0));const n=s.indexOf(i.target);if(n<0)return true;return i.shiftKey?n===0:n===s.length-1}get activeSections(){if(this.sections.length>0)return this.sections;if(this.items.length>0)return[{items:this.items}];return[]}get flatItems(){return this.activeSections.flatMap((i=>g(i)?[]:i.items))}get hasCompositeSections(){return this.activeSections.some(g)}cancelPositionRetry(){if(this.positionRetryRaf!==null){cancelAnimationFrame(this.positionRetryRaf);this.positionRetryRaf=null}}schedulePositionUpdate(i){if(!this.open)return;this.cancelPositionRetry();this.positionReady=false;let e=x;const s=()=>{this.positionRetryRaf=null;if(!this.open)return;if(this.calculatePosition()){this.positionReady=true;i?.();return}if(e>0){e-=1;this.positionRetryRaf=requestAnimationFrame(s)}};this.positionRetryRaf=requestAnimationFrame(s)}calculatePosition(){const i=this.resolvedAnchor;if(!i)return false;const e=this.el.querySelector(".menu-popup");if(!e)return false;this.pos=v({anchorRect:i.getBoundingClientRect(),popupWidth:e.offsetWidth||this.popupFallbackWidthPx,popupHeight:e.offsetHeight||this.popupFallbackHeightPx,side:this.side,align:this.align,sideOffsetPx:this.sideOffsetPx,alignOffsetPx:this.alignOffsetPx,viewportPadPx:this.viewportPadPx,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});return true}focusInitialItem(){if(this.hasCompositeSections){requestAnimationFrame((()=>{this.el.querySelector('.menu-popup [tabindex="0"]')?.focus()}));return}const i=this.flatItems;const e=i.findIndex((i=>i.isSelected&&!i.isInactive));const s=i.findIndex((i=>!i.isInactive));this.focusedIndex=e>=0?e:s>=0?s:0;requestAnimationFrame((()=>{const i=this.el.querySelectorAll(".menu-item");i[this.focusedIndex]?.focus()}))}setupListeners(){this.clickOutsideHandler=i=>{const e=i.target;const s=this.el.querySelector(".menu-popup");const n=this.resolvedAnchor;if(s?.contains(e)||n?.contains(e))return;this.close()};this.scrollResizeHandler=()=>{if(this.shouldRender&&!this.closing)this.calculatePosition()};document.addEventListener("mousedown",this.clickOutsideHandler,true);window.addEventListener("scroll",this.scrollResizeHandler,true);window.addEventListener("resize",this.scrollResizeHandler)}teardownListeners(){if(this.clickOutsideHandler){document.removeEventListener("mousedown",this.clickOutsideHandler,true);this.clickOutsideHandler=null}if(this.scrollResizeHandler){window.removeEventListener("scroll",this.scrollResizeHandler,true);window.removeEventListener("resize",this.scrollResizeHandler);this.scrollResizeHandler=null}if(this.closeTimer){clearTimeout(this.closeTimer);this.closeTimer=null}}close(i=true){if(i)this.focusAnchor();this.dsClose.emit();this.open=false;this.onOpenChange(false)}handleKeyDown(i){if(!this.shouldRender||this.closing)return;if(i.key==="Escape"){i.preventDefault();this.close();return}if(i.key==="Tab"){if(this.hasCompositeSections&&!this.compositeTabLeavesPopup(i))return;i.preventDefault();this.close(false);this.moveFocusAfterTab(i.shiftKey);return}if(this.hasCompositeSections)return;const e=this.flatItems;const s=e.map(((i,e)=>({it:i,i:e}))).filter((({it:i})=>!i.isInactive)).map((({i})=>i));if(!s.length)return;const n=s.indexOf(this.focusedIndex);const t=n<0?0:n;switch(i.key){case"ArrowDown":i.preventDefault();i.stopPropagation();this.focusRingVisible=true;this.focusedIndex=s[(t+1)%s.length];this.focusItem(this.focusedIndex);break;case"ArrowUp":i.preventDefault();i.stopPropagation();this.focusRingVisible=true;this.focusedIndex=s[(t-1+s.length)%s.length];this.focusItem(this.focusedIndex);break;case"Home":i.preventDefault();i.stopPropagation();this.focusRingVisible=true;this.focusedIndex=s[0];this.focusItem(this.focusedIndex);break;case"End":i.preventDefault();i.stopPropagation();this.focusRingVisible=true;this.focusedIndex=s[s.length-1];this.focusItem(this.focusedIndex);break}}focusItem(i){const e=this.el.querySelectorAll(".menu-item");e[i]?.focus()}handleItemClick(i){if(i.isInactive)return;this.dsSelect.emit(i)}handleGradientSelect(i){this.dsGradientSelect.emit(i)}render(){if(!this.shouldRender)return n(t,{style:{display:"contents"}});const i=this.activeSections;let e=0;const s={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,zIndex:"9998",visibility:this.positionReady?"visible":"hidden"};if(this.menuWidth)s["width"]=this.menuWidth;if(this.minWidth)s["min-width"]=this.minWidth;return n(t,{style:{display:"contents"}},n("div",{class:{"menu-popup":true,"menu-popup--closing":this.closing,"ds-choice-popup":true,"ds-choice-popup--closing":this.closing},style:s,role:this.hasCompositeSections?"dialog":"menu","aria-label":this.menuLabel,"aria-orientation":this.hasCompositeSections?undefined:"vertical"},n("div",{class:"ds-choice-list"},i.map(((s,t)=>n("div",{key:t,class:{"menu-section":true,"menu-section--divided":t<i.length-1,"menu-section--gradient-picker":g(s),"ds-choice-section":true,"ds-choice-section--divided":t<i.length-1},role:s.header?"group":undefined,"aria-label":s.header},s.header&&n("ds-text",{class:"section-header ds-choice-section__header ds-control--md",as:"span",variant:"text-body-small",emphasis:true,color:"primary","aria-hidden":"true"},s.header),g(s)?n("ds-shell-gradient-picker",{value:s.value,onDsChange:i=>{i.stopPropagation();this.handleGradientSelect(i.detail)}}):s.items.map((i=>{const s=e++;const t=this.focusedIndex===s;return n("button",{key:s,type:"button",class:{"menu-item":true,"ds-choice-item":true,"ds-control--md":true,"ds-focus-ring-inset":true,"ds-focus-ring--visible":t&&this.focusRingVisible,"ds-interaction-fill":!i.isInactive,"ds-interaction-fill--selected":!!i.isSelected&&!i.isInactive,"menu-item--selected":!!i.isSelected,"ds-control-inactive":!!i.isInactive,"menu-item--destructive":!!i.isDestructive,"menu-item--focused":t},role:this.hasCompositeSections?undefined:i.showSwitch?"menuitemcheckbox":"menuitem","aria-checked":!this.hasCompositeSections&&i.showSwitch?String(!!i.switchValue):undefined,"aria-pressed":this.hasCompositeSections?String(i.showSwitch?!!i.switchValue:!!i.isSelected):undefined,"aria-current":!this.hasCompositeSections&&!i.showSwitch&&i.isSelected?"true":undefined,disabled:i.isInactive,tabIndex:this.hasCompositeSections?0:t?0:-1,onMouseDown:()=>{this.focusRingVisible=false},onClick:()=>this.handleItemClick(i),onFocus:()=>{this.focusedIndex=s}},n("div",{class:"menu-item__content ds-choice-item__content ds-interaction-fill__content"},n("ds-text",{class:"menu-item__label ds-choice-item__label",as:"span",variant:"text-body-medium",color:i.isSelected?"primary":"secondary"},i.label),i.subtext&&n("ds-text",{class:"menu-item__subtext ds-choice-item__subtext",as:"span",variant:"text-body-small",color:"secondary"},i.subtext)),i.dot&&n("span",{class:"menu-item__dot-box ds-interaction-fill__content","aria-hidden":"true"},n("ds-badge",{class:"menu-item__dot",variant:"dot",hasRing:false,label:""})),i.showSwitch&&n("ds-switch",{class:"menu-item__switch ds-interaction-fill__content",size:"md",checked:!!i.switchValue,presentation:true}))}))))))))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}],anchor:[{onAnchorChange:0}],anchorId:[{onAnchorChange:0}],side:[{onPositionPropsChange:0}],align:[{onPositionPropsChange:0}],sideOffset:[{onPositionPropsChange:0}],alignOffset:[{onPositionPropsChange:0}]}}static get style(){return b()}},[2,"ds-menu",{open:[1028],items:[16],sections:[16],side:[1],align:[1],sideOffset:[8,"side-offset"],alignOffset:[8,"align-offset"],menuWidth:[1,"menu-width"],minWidth:[1,"min-width"],anchor:[16],anchorId:[1,"anchor-id"],initialFocusVisible:[4,"initial-focus-visible"],menuLabel:[1,"menu-label"],shouldRender:[32],closing:[32],pos:[32],focusedIndex:[32],positionReady:[32],focusRingVisible:[32]},[[0,"keydown","handleKeyDown"]],{open:[{onOpenChange:0}],anchor:[{onAnchorChange:0}],anchorId:[{onAnchorChange:0}],side:[{onPositionPropsChange:0}],align:[{onPositionPropsChange:0}],sideOffset:[{onPositionPropsChange:0}],alignOffset:[{onPositionPropsChange:0}]}]);function _(){if(typeof customElements==="undefined"){return}const i=["ds-menu","ds-badge","ds-shell-gradient-picker","ds-shell-gradient-swatch","ds-switch","ds-text"];i.forEach((i=>{switch(i){case"ds-menu":if(!customElements.get(o(i))){customElements.define(o(i),y)}break;case"ds-badge":if(!customElements.get(o(i))){c()}break;case"ds-shell-gradient-picker":if(!customElements.get(o(i))){a()}break;case"ds-shell-gradient-swatch":if(!customElements.get(o(i))){d()}break;case"ds-switch":if(!customElements.get(o(i))){l()}break;case"ds-text":if(!customElements.get(o(i))){u()}break}}))}_();export{y as M,_ as d};
|
|
2
|
-
//# sourceMappingURL=p-DF0yLZG_.js.map
|