@common-origin/design-system 3.0.0 → 3.2.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.
Files changed (126) hide show
  1. package/dist/client.js +2622 -830
  2. package/dist/client.js.map +1 -1
  3. package/dist/components/atoms/Badge/Badge.d.mts +2 -2
  4. package/dist/components/atoms/Badge/Badge.d.ts +2 -2
  5. package/dist/components/atoms/Badge/Badge.mjs +15 -9
  6. package/dist/components/atoms/Box/Box.d.mts +3 -2
  7. package/dist/components/atoms/Box/Box.d.ts +3 -2
  8. package/dist/components/atoms/Button/Button.mjs +1 -1
  9. package/dist/components/atoms/Chip/shared/ChipBase.mjs +1 -1
  10. package/dist/components/atoms/IconButton/IconButton.mjs +1 -1
  11. package/dist/components/atoms/ProgressBar/ProgressBar.d.mts +1 -1
  12. package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +1 -1
  13. package/dist/components/atoms/Tag/Tag.d.mts +1 -1
  14. package/dist/components/atoms/Tag/Tag.d.ts +1 -1
  15. package/dist/components/atoms/Tooltip/Tooltip.d.mts +47 -0
  16. package/dist/components/atoms/Tooltip/Tooltip.d.ts +47 -0
  17. package/dist/components/atoms/Tooltip/Tooltip.mjs +214 -0
  18. package/dist/components/atoms/Tooltip/Tooltip.mjs.map +1 -0
  19. package/dist/components/atoms/Tooltip/index.d.mts +2 -0
  20. package/dist/components/atoms/Tooltip/index.d.ts +2 -0
  21. package/dist/components/atoms/index.d.mts +1 -0
  22. package/dist/components/atoms/index.d.ts +1 -0
  23. package/dist/components/index.d.mts +1 -0
  24. package/dist/components/index.d.ts +1 -0
  25. package/dist/components/molecules/ActionSheet/ActionSheet.mjs +3 -2
  26. package/dist/components/molecules/Alert/Alert.mjs +2 -2
  27. package/dist/components/molecules/Checkbox/SelectableInputBase.mjs +1 -1
  28. package/dist/components/molecules/ChipGroup/ChipGroup.mjs +1 -0
  29. package/dist/components/molecules/Dropdown/Dropdown.mjs +1 -1
  30. package/dist/components/molecules/List/List.d.mts +2 -0
  31. package/dist/components/molecules/List/List.d.ts +2 -0
  32. package/dist/components/molecules/List/ListItem.d.mts +2 -0
  33. package/dist/components/molecules/List/ListItem.d.ts +2 -0
  34. package/dist/components/molecules/List/ListItem.mjs +7 -7
  35. package/dist/components/molecules/Menu/Menu.d.mts +124 -0
  36. package/dist/components/molecules/Menu/Menu.d.ts +124 -0
  37. package/dist/components/molecules/Menu/Menu.mjs +476 -0
  38. package/dist/components/molecules/Menu/Menu.mjs.map +1 -0
  39. package/dist/components/molecules/Menu/index.d.mts +2 -0
  40. package/dist/components/molecules/Menu/index.d.ts +2 -0
  41. package/dist/components/molecules/Modal/Modal.mjs +1 -1
  42. package/dist/components/molecules/NumberInput/NumberInput.mjs +2 -1
  43. package/dist/components/molecules/PasswordField/PasswordField.mjs +3 -2
  44. package/dist/components/molecules/SearchField/SearchField.mjs +5 -3
  45. package/dist/components/molecules/Sheet/Sheet.mjs +3 -3
  46. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.d.mts +13 -0
  47. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.d.ts +13 -0
  48. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.mjs +13 -0
  49. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.mjs.map +1 -0
  50. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.mts +44 -0
  51. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.ts +44 -0
  52. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.mjs +235 -0
  53. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.mjs.map +1 -0
  54. package/dist/components/molecules/SidebarNavItem/index.d.mts +2 -0
  55. package/dist/components/molecules/SidebarNavItem/index.d.ts +2 -0
  56. package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.d.mts +30 -0
  57. package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.d.ts +30 -0
  58. package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.mjs +69 -0
  59. package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.mjs.map +1 -0
  60. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.d.mts +36 -0
  61. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.d.ts +36 -0
  62. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.mjs +202 -0
  63. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.mjs.map +1 -0
  64. package/dist/components/molecules/SidebarNavSection/index.d.mts +2 -0
  65. package/dist/components/molecules/SidebarNavSection/index.d.ts +2 -0
  66. package/dist/components/molecules/TabBar/TabBar.mjs +3 -3
  67. package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs +1 -1
  68. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.d.mts +39 -0
  69. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.d.ts +39 -0
  70. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.mjs +133 -0
  71. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.mjs.map +1 -0
  72. package/dist/components/molecules/WorkspaceSwitcher/index.d.mts +2 -0
  73. package/dist/components/molecules/WorkspaceSwitcher/index.d.ts +2 -0
  74. package/dist/components/molecules/index.d.mts +4 -0
  75. package/dist/components/molecules/index.d.ts +4 -0
  76. package/dist/components/organisms/SidebarNav/SidebarNav.d.mts +52 -0
  77. package/dist/components/organisms/SidebarNav/SidebarNav.d.ts +52 -0
  78. package/dist/components/organisms/SidebarNav/SidebarNav.mjs +346 -0
  79. package/dist/components/organisms/SidebarNav/SidebarNav.mjs.map +1 -0
  80. package/dist/components/organisms/SidebarNav/index.d.mts +2 -0
  81. package/dist/components/organisms/SidebarNav/index.d.ts +2 -0
  82. package/dist/components/organisms/index.d.mts +1 -0
  83. package/dist/components/organisms/index.d.ts +1 -0
  84. package/dist/data.js +155 -68
  85. package/dist/data.js.map +1 -1
  86. package/dist/index.js +11 -0
  87. package/dist/index.js.map +1 -1
  88. package/dist/index.mjs +6 -0
  89. package/dist/index.mjs.map +1 -1
  90. package/dist/lib/floatingPosition.d.mts +43 -0
  91. package/dist/lib/floatingPosition.d.ts +43 -0
  92. package/dist/lib/floatingPosition.mjs +86 -0
  93. package/dist/lib/floatingPosition.mjs.map +1 -0
  94. package/dist/lib/keyboardFocus.d.mts +6 -0
  95. package/dist/lib/keyboardFocus.d.ts +6 -0
  96. package/dist/lib/keyboardFocus.mjs +17 -0
  97. package/dist/lib/keyboardFocus.mjs.map +1 -0
  98. package/dist/lib/styleUtils.d.mts +4 -0
  99. package/dist/lib/styleUtils.d.ts +4 -0
  100. package/dist/lib/styleUtils.mjs +5 -1
  101. package/dist/lib/styleUtils.mjs.map +1 -1
  102. package/dist/lib/tokenAliases.mjs +1 -0
  103. package/dist/lib/tokenAliases.mjs.map +1 -1
  104. package/dist/lib/useFloatingLayer.d.mts +32 -0
  105. package/dist/lib/useFloatingLayer.d.ts +32 -0
  106. package/dist/lib/useFloatingLayer.mjs +95 -0
  107. package/dist/lib/useFloatingLayer.mjs.map +1 -0
  108. package/dist/styles/icons.json +30 -1
  109. package/dist/styles/icons.json.mjs +34 -3
  110. package/dist/styles/icons.json.mjs.map +1 -1
  111. package/dist/styles/tokens.d.mts +139 -32
  112. package/dist/styles/tokens.d.ts +139 -32
  113. package/dist/styles/tokens.json +122 -66
  114. package/dist/styles/tokens.json.mjs +122 -66
  115. package/dist/styles/tokens.json.mjs.map +1 -1
  116. package/dist/tokens/index.js +122 -66
  117. package/dist/tokens/index.js.map +1 -1
  118. package/dist/tokens/index.mjs +122 -66
  119. package/dist/tokens/index.mjs.map +1 -1
  120. package/dist/tokens/styles/tokens.d.mts +139 -32
  121. package/dist/tokens/styles/tokens.d.ts +139 -32
  122. package/dist/tokens.css +1137 -86
  123. package/dist/types/icons.d.mts +1 -1
  124. package/dist/types/icons.d.ts +1 -1
  125. package/dist/types/icons.mjs.map +1 -1
  126. package/package.json +4 -2
@@ -0,0 +1,43 @@
1
+ export type FloatingSide = 'top' | 'right' | 'bottom' | 'left';
2
+ export type FloatingAlign = 'start' | 'center' | 'end';
3
+ export interface FloatingRect {
4
+ top: number;
5
+ left: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface FloatingOptions {
10
+ /** The anchor's box, from getBoundingClientRect */
11
+ anchor: FloatingRect;
12
+ /** The floating element's size */
13
+ floating: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ /** The side to place it on; it flips to the opposite side when that has more room */
18
+ side: FloatingSide;
19
+ /** Where it lines up along the anchor's edge */
20
+ align: FloatingAlign;
21
+ /** The gap between the anchor and the floating element, in px */
22
+ offset: number;
23
+ /** The viewport's size */
24
+ viewport: {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ /** The smallest distance kept from the viewport's edges, in px */
29
+ margin: number;
30
+ }
31
+ export interface FloatingPosition {
32
+ top: number;
33
+ left: number;
34
+ /** The side it ended up on, after any flip */
35
+ side: FloatingSide;
36
+ }
37
+ export declare function placeFloating(options: FloatingOptions): FloatingPosition;
38
+ /**
39
+ * The element that actually has a box inside a wrapper: Tooltip and Menu wrap their trigger in a
40
+ * `display: contents` span, and a trigger can be nested in more than one (a Tooltip inside a Menu's
41
+ * trigger), so this steps down until it finds an element that lays out.
42
+ */
43
+ export declare function laidOutElement(wrapper: Element | null): Element | null;
@@ -0,0 +1,43 @@
1
+ export type FloatingSide = 'top' | 'right' | 'bottom' | 'left';
2
+ export type FloatingAlign = 'start' | 'center' | 'end';
3
+ export interface FloatingRect {
4
+ top: number;
5
+ left: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface FloatingOptions {
10
+ /** The anchor's box, from getBoundingClientRect */
11
+ anchor: FloatingRect;
12
+ /** The floating element's size */
13
+ floating: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ /** The side to place it on; it flips to the opposite side when that has more room */
18
+ side: FloatingSide;
19
+ /** Where it lines up along the anchor's edge */
20
+ align: FloatingAlign;
21
+ /** The gap between the anchor and the floating element, in px */
22
+ offset: number;
23
+ /** The viewport's size */
24
+ viewport: {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ /** The smallest distance kept from the viewport's edges, in px */
29
+ margin: number;
30
+ }
31
+ export interface FloatingPosition {
32
+ top: number;
33
+ left: number;
34
+ /** The side it ended up on, after any flip */
35
+ side: FloatingSide;
36
+ }
37
+ export declare function placeFloating(options: FloatingOptions): FloatingPosition;
38
+ /**
39
+ * The element that actually has a box inside a wrapper: Tooltip and Menu wrap their trigger in a
40
+ * `display: contents` span, and a trigger can be nested in more than one (a Tooltip inside a Menu's
41
+ * trigger), so this steps down until it finds an element that lays out.
42
+ */
43
+ export declare function laidOutElement(wrapper: Element | null): Element | null;
@@ -0,0 +1,86 @@
1
+ 'use client';
2
+ // Places a floating element (Tooltip, Menu) next to its anchor, without a positioning library
3
+ // (P8). Pure geometry, so it can be tested without a browser: the caller measures both elements
4
+ // and applies the result as `top` and `left` on a `position: fixed` element.
5
+ var opposite = {
6
+ top: 'bottom',
7
+ bottom: 'top',
8
+ left: 'right',
9
+ right: 'left'
10
+ };
11
+ // The room between the anchor and the viewport edge on each side
12
+ var room = function room(side, _a) {
13
+ var anchor = _a.anchor,
14
+ viewport = _a.viewport,
15
+ margin = _a.margin;
16
+ switch (side) {
17
+ case 'top':
18
+ return anchor.top - margin;
19
+ case 'bottom':
20
+ return viewport.height - (anchor.top + anchor.height) - margin;
21
+ case 'left':
22
+ return anchor.left - margin;
23
+ case 'right':
24
+ return viewport.width - (anchor.left + anchor.width) - margin;
25
+ }
26
+ };
27
+ var clamp = function clamp(value, min, max) {
28
+ return Math.max(min, Math.min(value, max));
29
+ };
30
+ function placeFloating(options) {
31
+ var anchor = options.anchor,
32
+ floating = options.floating,
33
+ align = options.align,
34
+ offset = options.offset,
35
+ viewport = options.viewport,
36
+ margin = options.margin;
37
+ var vertical = function vertical(s) {
38
+ return s === 'top' || s === 'bottom';
39
+ };
40
+ // Flip when the preferred side is too small and the opposite side has more room
41
+ var side = options.side;
42
+ var needed = (vertical(side) ? floating.height : floating.width) + offset;
43
+ if (room(side, options) < needed && room(opposite[side], options) > room(side, options)) {
44
+ side = opposite[side];
45
+ }
46
+ // Main axis: beside the anchor, `offset` away
47
+ var top = 0;
48
+ var left = 0;
49
+ if (side === 'top') top = anchor.top - offset - floating.height;
50
+ if (side === 'bottom') top = anchor.top + anchor.height + offset;
51
+ if (side === 'left') left = anchor.left - offset - floating.width;
52
+ if (side === 'right') left = anchor.left + anchor.width + offset;
53
+ // Cross axis: aligned to the anchor's start, centre or end, then kept inside the viewport
54
+ if (vertical(side)) {
55
+ if (align === 'start') left = anchor.left;
56
+ if (align === 'center') left = anchor.left + (anchor.width - floating.width) / 2;
57
+ if (align === 'end') left = anchor.left + anchor.width - floating.width;
58
+ left = clamp(left, margin, viewport.width - floating.width - margin);
59
+ } else {
60
+ if (align === 'start') top = anchor.top;
61
+ if (align === 'center') top = anchor.top + (anchor.height - floating.height) / 2;
62
+ if (align === 'end') top = anchor.top + anchor.height - floating.height;
63
+ top = clamp(top, margin, viewport.height - floating.height - margin);
64
+ }
65
+ return {
66
+ top: Math.round(top),
67
+ left: Math.round(left),
68
+ side: side
69
+ };
70
+ }
71
+ /**
72
+ * The element that actually has a box inside a wrapper: Tooltip and Menu wrap their trigger in a
73
+ * `display: contents` span, and a trigger can be nested in more than one (a Tooltip inside a Menu's
74
+ * trigger), so this steps down until it finds an element that lays out.
75
+ */
76
+ function laidOutElement(wrapper) {
77
+ var _a;
78
+ var element = (_a = wrapper === null || wrapper === void 0 ? void 0 : wrapper.firstElementChild) !== null && _a !== void 0 ? _a : null;
79
+ while (element && typeof getComputedStyle !== 'undefined' && getComputedStyle(element).display === 'contents') {
80
+ element = element.firstElementChild;
81
+ }
82
+ return element;
83
+ }
84
+
85
+ export { laidOutElement, placeFloating };
86
+ //# sourceMappingURL=floatingPosition.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floatingPosition.mjs","sources":["../../src/lib/floatingPosition.ts"],"sourcesContent":["// Places a floating element (Tooltip, Menu) next to its anchor, without a positioning library\n// (P8). Pure geometry, so it can be tested without a browser: the caller measures both elements\n// and applies the result as `top` and `left` on a `position: fixed` element.\n\nexport type FloatingSide = 'top' | 'right' | 'bottom' | 'left'\nexport type FloatingAlign = 'start' | 'center' | 'end'\n\nexport interface FloatingRect {\n top: number\n left: number\n width: number\n height: number\n}\n\nexport interface FloatingOptions {\n /** The anchor's box, from getBoundingClientRect */\n anchor: FloatingRect\n /** The floating element's size */\n floating: { width: number; height: number }\n /** The side to place it on; it flips to the opposite side when that has more room */\n side: FloatingSide\n /** Where it lines up along the anchor's edge */\n align: FloatingAlign\n /** The gap between the anchor and the floating element, in px */\n offset: number\n /** The viewport's size */\n viewport: { width: number; height: number }\n /** The smallest distance kept from the viewport's edges, in px */\n margin: number\n}\n\nexport interface FloatingPosition {\n top: number\n left: number\n /** The side it ended up on, after any flip */\n side: FloatingSide\n}\n\nconst opposite: Record<FloatingSide, FloatingSide> = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' }\n\n// The room between the anchor and the viewport edge on each side\nconst room = (side: FloatingSide, { anchor, viewport, margin }: FloatingOptions) => {\n switch (side) {\n case 'top': return anchor.top - margin\n case 'bottom': return viewport.height - (anchor.top + anchor.height) - margin\n case 'left': return anchor.left - margin\n case 'right': return viewport.width - (anchor.left + anchor.width) - margin\n }\n}\n\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(value, max))\n\nexport function placeFloating(options: FloatingOptions): FloatingPosition {\n const { anchor, floating, align, offset, viewport, margin } = options\n const vertical = (s: FloatingSide) => s === 'top' || s === 'bottom'\n\n // Flip when the preferred side is too small and the opposite side has more room\n let side = options.side\n const needed = (vertical(side) ? floating.height : floating.width) + offset\n if (room(side, options) < needed && room(opposite[side], options) > room(side, options)) {\n side = opposite[side]\n }\n\n // Main axis: beside the anchor, `offset` away\n let top = 0\n let left = 0\n if (side === 'top') top = anchor.top - offset - floating.height\n if (side === 'bottom') top = anchor.top + anchor.height + offset\n if (side === 'left') left = anchor.left - offset - floating.width\n if (side === 'right') left = anchor.left + anchor.width + offset\n\n // Cross axis: aligned to the anchor's start, centre or end, then kept inside the viewport\n if (vertical(side)) {\n if (align === 'start') left = anchor.left\n if (align === 'center') left = anchor.left + (anchor.width - floating.width) / 2\n if (align === 'end') left = anchor.left + anchor.width - floating.width\n left = clamp(left, margin, viewport.width - floating.width - margin)\n } else {\n if (align === 'start') top = anchor.top\n if (align === 'center') top = anchor.top + (anchor.height - floating.height) / 2\n if (align === 'end') top = anchor.top + anchor.height - floating.height\n top = clamp(top, margin, viewport.height - floating.height - margin)\n }\n\n return { top: Math.round(top), left: Math.round(left), side }\n}\n\n/**\n * The element that actually has a box inside a wrapper: Tooltip and Menu wrap their trigger in a\n * `display: contents` span, and a trigger can be nested in more than one (a Tooltip inside a Menu's\n * trigger), so this steps down until it finds an element that lays out.\n */\nexport function laidOutElement(wrapper: Element | null): Element | null {\n let element = wrapper?.firstElementChild ?? null\n while (element && typeof getComputedStyle !== 'undefined' && getComputedStyle(element).display === 'contents') {\n element = element.firstElementChild\n }\n return element\n}\n"],"names":["opposite","top","bottom","left","right","room","side","_a","anchor","viewport","margin","height","width","clamp","value","min","max","Math","placeFloating","options","floating","align","offset","vertical","s","needed","round","laidOutElement","wrapper","element","firstElementChild","getComputedStyle","display"],"mappings":";AAAA;AACA;AACA;AAoCA,IAAMA,QAAQ,GAAuC;AAAEC,EAAAA,GAAG,EAAE,QAAQ;AAAEC,EAAAA,MAAM,EAAE,KAAK;AAAEC,EAAAA,IAAI,EAAE,OAAO;AAAEC,EAAAA,KAAK,EAAE,MAAA;CAAQ,CAAA;AAEnH;AACA,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAIC,IAAkB,EAAEC,EAA6C,EAAA;AAA3C,EAAA,IAAAC,MAAM,YAAA;IAAEC,QAAQ,GAAAF,EAAA,CAAAE,QAAA;IAAEC,MAAM,GAAAH,EAAA,CAAAG,MAAA,CAAA;AA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AAvB,EAAA,KAAA,KAAA,CAAA,GAAAA,EAAA,GAAA,IAAI,CAAA;AAChD,EAAA,OAAOsB,OAAO,IAAI,OAAOE,gBAAgB,KAAK,WAAW,IAAIA,gBAAgB,CAACF,OAAO,CAAC,CAACG,OAAO,KAAK,UAAU,EAAE;IAC7GH,OAAO,GAAGA,OAAO,CAACC,iBAAiB,CAAA;AACrC,GAAA;AACA,EAAA,OAAOD,OAAO,CAAA;AAChB;;;;"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Whether focus arrived from the keyboard rather than a click or tap, so a component can show
3
+ * something on keyboard focus only (a Tooltip, SidebarNav's highlight). Browsers without
4
+ * `:focus-visible` treat every focus as keyboard focus.
5
+ */
6
+ export declare function isKeyboardFocus(target: EventTarget | null): boolean;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Whether focus arrived from the keyboard rather than a click or tap, so a component can show
3
+ * something on keyboard focus only (a Tooltip, SidebarNav's highlight). Browsers without
4
+ * `:focus-visible` treat every focus as keyboard focus.
5
+ */
6
+ export declare function isKeyboardFocus(target: EventTarget | null): boolean;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ /**
3
+ * Whether focus arrived from the keyboard rather than a click or tap, so a component can show
4
+ * something on keyboard focus only (a Tooltip, SidebarNav's highlight). Browsers without
5
+ * `:focus-visible` treat every focus as keyboard focus.
6
+ */
7
+ function isKeyboardFocus(target) {
8
+ if (!(target instanceof Element)) return false;
9
+ try {
10
+ return target.matches(':focus-visible');
11
+ } catch (_a) {
12
+ return true;
13
+ }
14
+ }
15
+
16
+ export { isKeyboardFocus };
17
+ //# sourceMappingURL=keyboardFocus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardFocus.mjs","sources":["../../src/lib/keyboardFocus.ts"],"sourcesContent":["/**\n * Whether focus arrived from the keyboard rather than a click or tap, so a component can show\n * something on keyboard focus only (a Tooltip, SidebarNav's highlight). Browsers without\n * `:focus-visible` treat every focus as keyboard focus.\n */\nexport function isKeyboardFocus(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) return false\n try {\n return target.matches(':focus-visible')\n } catch {\n return true\n }\n}\n"],"names":["isKeyboardFocus","target","Element","matches","_a"],"mappings":";AAAA;;;;AAIG;AACG,SAAUA,eAAeA,CAACC,MAA0B,EAAA;AACxD,EAAA,IAAI,EAAEA,MAAM,YAAYC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;EAC9C,IAAI;AACF,IAAA,OAAOD,MAAM,CAACE,OAAO,CAAC,gBAAgB,CAAC,CAAA;GACxC,CAAC,OAAAC,EAAA,EAAM;AACN,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AACF;;;;"}
@@ -21,6 +21,10 @@ export declare const forcedColorsEdge: string;
21
21
  export declare const reducedMotion = "@media (prefers-reduced-motion: reduce)";
22
22
  export declare const exitAnimation: import("styled-components").RuleSet<object>;
23
23
  export declare const visuallyHidden: import("styled-components").RuleSet<object>;
24
+ /** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */
25
+ export declare const fieldButtonRadius: string;
26
+ /** Corner radius every row and tab shares: the control radius (decision 0055). */
27
+ export declare const rowRadius: string;
24
28
  export interface RowState {
25
29
  background: string;
26
30
  text?: string;
@@ -21,6 +21,10 @@ export declare const forcedColorsEdge: string;
21
21
  export declare const reducedMotion = "@media (prefers-reduced-motion: reduce)";
22
22
  export declare const exitAnimation: import("styled-components").RuleSet<object>;
23
23
  export declare const visuallyHidden: import("styled-components").RuleSet<object>;
24
+ /** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */
25
+ export declare const fieldButtonRadius: string;
26
+ /** Corner radius every row and tab shares: the control radius (decision 0055). */
27
+ export declare const rowRadius: string;
24
28
  export interface RowState {
25
29
  background: string;
26
30
  text?: string;
@@ -69,6 +69,10 @@ var visuallyHidden = css(templateObject_3 || (templateObject_3 = __makeTemplateO
69
69
  var _a = tokens.semantic.color,
70
70
  rowFill = _a.fill,
71
71
  rowText = _a.text;
72
+ /** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */
73
+ var fieldButtonRadius = tokens.semantic.radius.sm;
74
+ /** Corner radius every row and tab shares: the control radius (decision 0055). */
75
+ var rowRadius = tokens.semantic.radius.md;
72
76
  var rowStates = {
73
77
  unselected: {
74
78
  rest: {
@@ -156,5 +160,5 @@ var rowForcedColors = function rowForcedColors(_a) {
156
160
  };
157
161
  var templateObject_1, templateObject_2, templateObject_3;
158
162
 
159
- export { breakpoints, exitAnimation, forcedColors, forcedColorsEdge, interactiveRow, media, reducedMotion, rowStates, visuallyHidden };
163
+ export { breakpoints, exitAnimation, fieldButtonRadius, forcedColors, forcedColorsEdge, interactiveRow, media, reducedMotion, rowRadius, rowStates, visuallyHidden };
160
164
  //# sourceMappingURL=styleUtils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"styleUtils.mjs","sources":["../../src/lib/styleUtils.ts"],"sourcesContent":["import { css, keyframes } from 'styled-components'\nimport tokens from './cssTokens'\n\n// Breakpoints from the semantic tokens (decision 0014)\nexport const breakpoints = {\n xs: tokens.semantic.breakpoint.xs,\n sm: tokens.semantic.breakpoint.sm,\n md: tokens.semantic.breakpoint.md,\n lg: tokens.semantic.breakpoint.lg,\n xl: tokens.semantic.breakpoint.xl,\n '2xl': tokens.semantic.breakpoint['2xl'],\n}\n\n// Media query helpers\nexport const media = {\n xs: `@media (min-width: ${breakpoints.xs})`,\n sm: `@media (min-width: ${breakpoints.sm})`,\n md: `@media (min-width: ${breakpoints.md})`,\n lg: `@media (min-width: ${breakpoints.lg})`,\n xl: `@media (min-width: ${breakpoints.xl})`,\n '2xl': `@media (min-width: ${breakpoints['2xl']})`,\n}\n\n// Windows Contrast Themes and other forced-colours modes (decision 0038). The browser swaps in\n// the user's system colours, drops background colours and box-shadows, and keeps borders and\n// outlines. Inside this query, give a control that shows its edge with a fill alone a border,\n// and draw selected and checked states with system colours: ButtonText for control edges,\n// Highlight and HighlightText for selected and checked, GrayText for disabled, CanvasText for\n// content. Use forced-color-adjust: none only on a fill that carries state.\nexport const forcedColors = '@media (forced-colors: active)'\n\n/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The\n * border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */\nexport const forcedColorsEdge = `${forcedColors} {\n border: ${tokens.semantic.border.width.thin} solid currentColor;\n}`\n\n// Wrap fallbacks for people who ask for less motion (decision 0005): movement becomes\n// an instant change or a simple fade. Colour and opacity transitions need no fallback.\nexport const reducedMotion = '@media (prefers-reduced-motion: reduce)'\n\n// No `from` keyframe: the fade starts from the element's current opacity, including a\n// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.\nconst fadeOut = keyframes`\n to { opacity: 0; }\n`\n\n// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of\n// the element's `animation` declarations while it exits: the entrance stays in the list,\n// so it isn't restarted, and the fade runs on top of it. A fade is already the\n// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop\n// still catches clicks (so they can't reach the page behind it) and the panel is inert.\n// Exits accelerate: things leaving speed up as they go (decision 0037).\nexport const exitAnimation = css`, ${fadeOut} ${tokens.semantic.motion.duration.fast} ${tokens.semantic.motion.easing.accelerate} forwards`\n\n// Content for screen readers only. The 1px size and -1px margin are part of the standard\n// visually-hidden technique, not design values, so they aren't tokens.\nexport const visuallyHidden = css`\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n`\n\n// One interaction pattern for rows and items: list items, menu and listbox options, sidebars\n// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the\n// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected\n// rows leave their text colour to the component, so a destructive row can stay red.\nconst { fill: rowFill, text: rowText } = tokens.semantic.color\n\nexport interface RowState {\n background: string\n text?: string\n}\n\nexport const rowStates: Record<'unselected' | 'selected', Record<'rest' | 'hover' | 'pressed', RowState>> = {\n unselected: {\n rest: { background: 'transparent' },\n hover: { background: rowFill.muted },\n pressed: { background: rowFill.default },\n },\n selected: {\n rest: { background: rowFill['accent-muted'], text: rowText.accent },\n hover: { background: rowFill['accent-muted-hover'], text: rowText.accent },\n pressed: { background: rowFill['accent-muted-pressed'], text: rowText.accent },\n },\n}\n\nconst rowDeclarations = ({ background, text }: RowState, textSelector?: string) => {\n if (!text) return `background-color: ${background};`\n return textSelector\n ? `background-color: ${background};\\n ${textSelector} { color: ${text}; }`\n : `background-color: ${background};\\n color: ${text};`\n}\n\n/**\n * The background (and, when selected, text) of an interactive row in every state.\n * - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under\n * aria-activedescendant. It shows the hover state.\n * - `disabled`: shows the resting state, with no hover or press.\n * - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example\n * text set by Typography. Pass it without `&`.\n */\nexport const interactiveRow = ({\n selected = false,\n focused = false,\n disabled = false,\n textSelector,\n}: {\n selected?: boolean\n focused?: boolean\n disabled?: boolean\n textSelector?: string\n} = {}) => {\n const states = selected ? rowStates.selected : rowStates.unselected\n if (disabled) return `${rowDeclarations(states.rest, textSelector)}\\n${rowForcedColors({ selected, focused, disabled, textSelector })}`\n return `\n ${rowDeclarations(focused ? states.hover : states.rest, textSelector)}\n\n &:hover {\n ${rowDeclarations(states.hover, textSelector)}\n }\n\n &:active {\n ${rowDeclarations(states.pressed, textSelector)}\n }\n\n ${rowForcedColors({ selected, focused, disabled, textSelector })}\n`\n}\n\n// Rows in forced colours (decision 0038): fills are dropped, so a selected row takes the system\n// selection colours, and a hovered or keyboard-active row is outlined in Highlight.\nconst rowForcedColors = ({\n selected,\n focused,\n disabled,\n textSelector,\n}: {\n selected: boolean\n focused: boolean\n disabled: boolean\n textSelector?: string\n}) => {\n const text = (color: string) => (textSelector ? `color: ${color};\\n ${textSelector} { color: ${color}; }` : `color: ${color};`)\n const hover = `outline: ${tokens.semantic.border.width.thin} solid Highlight;\\n outline-offset: calc(-1 * ${tokens.semantic.border.width.thin});`\n // A row that doesn't respond (disabled, or not interactive at all) keeps its selection but has\n // no hover outline. Disabled text is the component's to colour: callers also pass this for\n // static rows, which must stay CanvasText.\n // A selected row keeps forced-color-adjust: auto: the browser keeps system colours an author\n // sets, so the row stays Highlight with HighlightText. Its descendants' own colours would be\n // forced to CanvasText, so they inherit HighlightText, and anything drawn with a fill inside\n // (a chip or tag as the row's badge) drops it and keeps its edge. The doubled class outranks\n // the descendants' own rules.\n return `${forcedColors} {\n ${selected ? `background-color: Highlight;\\n ${text('HighlightText')}\\n && * {\\n color: inherit;\\n background-color: transparent;\\n }` : ''}\n ${!disabled && focused ? hover : ''}\n ${disabled ? '' : `&:hover {\\n ${hover}\\n }`}\n }`\n}\n"],"names":["breakpoints","xs","tokens","semantic","breakpoint","sm","md","lg","xl","media","concat","forcedColors","forcedColorsEdge","border","width","thin","reducedMotion","fadeOut","keyframes","templateObject_1","__makeTemplateObject","exitAnimation","css","templateObject_2","motion","duration","fast","easing","accelerate","visuallyHidden","_a","color","rowFill","fill","rowText","text","rowStates","unselected","rest","background","hover","muted","pressed","selected","accent","rowDeclarations","textSelector","interactiveRow","_b","_c","_d","focused","_e","disabled","states","rowForcedColors"],"mappings":";;;;;AAGA;AACO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,EAAE,EAAEC,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACH,EAAE;AACjCI,EAAAA,EAAE,EAAEH,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACC,EAAE;AACjCC,EAAAA,EAAE,EAAEJ,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACE,EAAE;AACjCC,EAAAA,EAAE,EAAEL,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACG,EAAE;AACjCC,EAAAA,EAAE,EAAEN,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACI,EAAE;AACjC,EAAA,KAAK,EAAEN,MAAM,C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KAAA,CAAA,GAAG,SAAU,CAAArB,MAAA,CAAAqB,KAAK,EAAG,GAAA,CAAA,CAAA;GAAC,CAAA;AAClI,EAAA,IAAMS,KAAK,GAAG,WAAY,CAAA9B,MAAA,CAAAR,MAAM,CAACC,QAAQ,CAACU,MAAM,CAACC,KAAK,CAACC,IAAI,EAAsD,qDAAA,CAAA,CAAAL,MAAA,CAAAR,MAAM,CAACC,QAAQ,CAACU,MAAM,CAACC,KAAK,CAACC,IAAI,EAAA,IAAA,CAAI,CAAA;AACtJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,OAAO,UAAGJ,YAAY,EAAA,UAAA,CAAA,CAAAD,MAAA,CAClBiC,QAAQ,GAAG,oCAAqC,CAAAjC,MAAA,CAAAyB,IAAI,CAAC,eAAe,CAAC,qFAAkF,GAAG,EAAE,EAAA,QAAA,CAAA,CAAAzB,MAAA,CAC5J,CAAC2C,QAAQ,IAAIF,OAAO,GAAGX,KAAK,GAAG,EAAE,mBACjCa,QAAQ,GAAG,EAAE,GAAG,2BAAoBb,KAAK,EAAA,SAAA,CAAS,UACpD,CAAA;AACJ,CAAC,CAAA;;;;;"}
1
+ {"version":3,"file":"styleUtils.mjs","sources":["../../src/lib/styleUtils.ts"],"sourcesContent":["import { css, keyframes } from 'styled-components'\nimport tokens from './cssTokens'\n\n// Breakpoints from the semantic tokens (decision 0014)\nexport const breakpoints = {\n xs: tokens.semantic.breakpoint.xs,\n sm: tokens.semantic.breakpoint.sm,\n md: tokens.semantic.breakpoint.md,\n lg: tokens.semantic.breakpoint.lg,\n xl: tokens.semantic.breakpoint.xl,\n '2xl': tokens.semantic.breakpoint['2xl'],\n}\n\n// Media query helpers\nexport const media = {\n xs: `@media (min-width: ${breakpoints.xs})`,\n sm: `@media (min-width: ${breakpoints.sm})`,\n md: `@media (min-width: ${breakpoints.md})`,\n lg: `@media (min-width: ${breakpoints.lg})`,\n xl: `@media (min-width: ${breakpoints.xl})`,\n '2xl': `@media (min-width: ${breakpoints['2xl']})`,\n}\n\n// Windows Contrast Themes and other forced-colours modes (decision 0038). The browser swaps in\n// the user's system colours, drops background colours and box-shadows, and keeps borders and\n// outlines. Inside this query, give a control that shows its edge with a fill alone a border,\n// and draw selected and checked states with system colours: ButtonText for control edges,\n// Highlight and HighlightText for selected and checked, GrayText for disabled, CanvasText for\n// content. Use forced-color-adjust: none only on a fill that carries state.\nexport const forcedColors = '@media (forced-colors: active)'\n\n/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The\n * border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */\nexport const forcedColorsEdge = `${forcedColors} {\n border: ${tokens.semantic.border.width.thin} solid currentColor;\n}`\n\n// Wrap fallbacks for people who ask for less motion (decision 0005): movement becomes\n// an instant change or a simple fade. Colour and opacity transitions need no fallback.\nexport const reducedMotion = '@media (prefers-reduced-motion: reduce)'\n\n// No `from` keyframe: the fade starts from the element's current opacity, including a\n// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.\nconst fadeOut = keyframes`\n to { opacity: 0; }\n`\n\n// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of\n// the element's `animation` declarations while it exits: the entrance stays in the list,\n// so it isn't restarted, and the fade runs on top of it. A fade is already the\n// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop\n// still catches clicks (so they can't reach the page behind it) and the panel is inert.\n// Exits accelerate: things leaving speed up as they go (decision 0037).\nexport const exitAnimation = css`, ${fadeOut} ${tokens.semantic.motion.duration.fast} ${tokens.semantic.motion.easing.accelerate} forwards`\n\n// Content for screen readers only. The 1px size and -1px margin are part of the standard\n// visually-hidden technique, not design values, so they aren't tokens.\nexport const visuallyHidden = css`\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n`\n\n// One interaction pattern for rows and items: list items, menu and listbox options, sidebars\n// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the\n// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected\n// rows leave their text colour to the component, so a destructive row can stay red.\nconst { fill: rowFill, text: rowText } = tokens.semantic.color\n\n/** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */\nexport const fieldButtonRadius = tokens.semantic.radius.sm\n\n/** Corner radius every row and tab shares: the control radius (decision 0055). */\nexport const rowRadius = tokens.semantic.radius.md\n\nexport interface RowState {\n background: string\n text?: string\n}\n\nexport const rowStates: Record<'unselected' | 'selected', Record<'rest' | 'hover' | 'pressed', RowState>> = {\n unselected: {\n rest: { background: 'transparent' },\n hover: { background: rowFill.muted },\n pressed: { background: rowFill.default },\n },\n selected: {\n rest: { background: rowFill['accent-muted'], text: rowText.accent },\n hover: { background: rowFill['accent-muted-hover'], text: rowText.accent },\n pressed: { background: rowFill['accent-muted-pressed'], text: rowText.accent },\n },\n}\n\nconst rowDeclarations = ({ background, text }: RowState, textSelector?: string) => {\n if (!text) return `background-color: ${background};`\n return textSelector\n ? `background-color: ${background};\\n ${textSelector} { color: ${text}; }`\n : `background-color: ${background};\\n color: ${text};`\n}\n\n/**\n * The background (and, when selected, text) of an interactive row in every state.\n * - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under\n * aria-activedescendant. It shows the hover state.\n * - `disabled`: shows the resting state, with no hover or press.\n * - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example\n * text set by Typography. Pass it without `&`.\n */\nexport const interactiveRow = ({\n selected = false,\n focused = false,\n disabled = false,\n textSelector,\n}: {\n selected?: boolean\n focused?: boolean\n disabled?: boolean\n textSelector?: string\n} = {}) => {\n const states = selected ? rowStates.selected : rowStates.unselected\n if (disabled) return `${rowDeclarations(states.rest, textSelector)}\\n${rowForcedColors({ selected, focused, disabled, textSelector })}`\n return `\n ${rowDeclarations(focused ? states.hover : states.rest, textSelector)}\n\n &:hover {\n ${rowDeclarations(states.hover, textSelector)}\n }\n\n &:active {\n ${rowDeclarations(states.pressed, textSelector)}\n }\n\n ${rowForcedColors({ selected, focused, disabled, textSelector })}\n`\n}\n\n// Rows in forced colours (decision 0038): fills are dropped, so a selected row takes the system\n// selection colours, and a hovered or keyboard-active row is outlined in Highlight.\nconst rowForcedColors = ({\n selected,\n focused,\n disabled,\n textSelector,\n}: {\n selected: boolean\n focused: boolean\n disabled: boolean\n textSelector?: string\n}) => {\n const text = (color: string) => (textSelector ? `color: ${color};\\n ${textSelector} { color: ${color}; }` : `color: ${color};`)\n const hover = `outline: ${tokens.semantic.border.width.thin} solid Highlight;\\n outline-offset: calc(-1 * ${tokens.semantic.border.width.thin});`\n // A row that doesn't respond (disabled, or not interactive at all) keeps its selection but has\n // no hover outline. Disabled text is the component's to colour: callers also pass this for\n // static rows, which must stay CanvasText.\n // A selected row keeps forced-color-adjust: auto: the browser keeps system colours an author\n // sets, so the row stays Highlight with HighlightText. Its descendants' own colours would be\n // forced to CanvasText, so they inherit HighlightText, and anything drawn with a fill inside\n // (a chip or tag as the row's badge) drops it and keeps its edge. The doubled class outranks\n // the descendants' own rules.\n return `${forcedColors} {\n ${selected ? `background-color: Highlight;\\n ${text('HighlightText')}\\n && * {\\n color: inherit;\\n background-color: transparent;\\n }` : ''}\n ${!disabled && focused ? hover : ''}\n ${disabled ? '' : `&:hover {\\n ${hover}\\n }`}\n }`\n}\n"],"names":["breakpoints","xs","tokens","semantic","breakpoint","sm","md","lg","xl","media","concat","forcedColors","forcedColorsEdge","border","width","thin","reducedMotion","fadeOut","keyframes","templateObject_1","__makeTemplateObject","exitAnimation","css","templateObject_2","motion","duration","fast","easing","accelerate","visuallyHidden","_a","color","rowFill","fill","rowText","text","fieldButtonRadius","radius","rowRadius","rowStates","unselected","rest","background","hover","muted","pressed","selected","accent","rowDeclarations","textSelector","interactiveRow","_b","_c","_d","focused","_e","disabled","states","rowForcedColors"],"mappings":";;;;;AAGA;AACO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,EAAE,EAAEC,MAAM,CAACC,QA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AC,CAAA;;;;;"}
@@ -47,6 +47,7 @@ var radiusByKey = {
47
47
  var backgroundByPath = {
48
48
  'surface.base': surface.base,
49
49
  'surface.raised': surface.raised,
50
+ 'surface.overlay': surface.overlay,
50
51
  'surface.scrim': surface.scrim,
51
52
  'color.fill.emphasis': color.fill.emphasis,
52
53
  'color.fill.muted': color.fill.muted,
@@ -1 +1 @@
1
- {"version":3,"file":"tokenAliases.mjs","sources":["../../src/lib/tokenAliases.ts"],"sourcesContent":["import tokens from './cssTokens'\nimport type { Tokens } from '../types/tokens'\n\n// Box's spacing and radius props keep their own names, which 3.0 decoupled from the removed\n// spacing.layout and border.radius tokens (P7, #99), and read the semantic grammar's tokens\n// (decision 0031). Each map covers every key the prop type allows, so TypeScript fails here if a\n// key is added without a mapping.\nconst { semantic } = tokens\nconst { color, space, radius, surface } = semantic\n\ntype Semantic = Tokens['semantic']\n\n/** Box's spacing values (`p`, `m`, `gap`…), each a `space` step, plus `auto`. */\nexport type BoxSpace =\n | 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl' | '10xl' | '11xl'\n | 'auto'\n\n/** Box's spacing props: each name maps to the space step that replaced its spacing.layout token. */\nexport const spaceByLayoutKey: Record<BoxSpace, string> = {\n none: space[0],\n xs: space[100],\n sm: space[200],\n md: space[300],\n lg: space[400],\n xl: space[500],\n '2xl': space[600],\n '3xl': space[700],\n '4xl': space[800],\n '5xl': space[900],\n '6xl': space[1000],\n '7xl': space[1200],\n '8xl': space[1400],\n '9xl': space[1600],\n '10xl': space[2000],\n '11xl': space[2400],\n // A keyword, not a step (0031)\n auto: semantic.spacing.layout.auto,\n}\n\n/** Box's `borderRadius` values: the `radius` steps, with `circle` for `full`. */\nexport type BoxRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'circle'\n\n/** Box's `borderRadius` prop, read from `radius`. */\nexport const radiusByKey: Record<BoxRadius, string> = {\n none: radius.none,\n xs: radius.xs,\n sm: radius.sm,\n md: radius.md,\n lg: radius.lg,\n xl: radius.xl,\n '2xl': radius['2xl'],\n '3xl': radius['3xl'],\n circle: radius.full,\n}\n\n/**\n * Box's `bg` values in the semantic grammar (decision 0031, #304): the token's path below\n * `semantic`, such as `surface.raised` or `color.fill.muted`.\n */\nexport type BackgroundPath =\n | `surface.${keyof Semantic['surface']}`\n | `color.fill.${keyof Semantic['color']['fill']}`\n\n/** Box's `bg` prop: the grammar's token paths, read from the token at that path. */\nexport const backgroundByPath: Record<BackgroundPath, string> = {\n 'surface.base': surface.base,\n 'surface.raised': surface.raised,\n 'surface.scrim': surface.scrim,\n 'color.fill.emphasis': color.fill.emphasis,\n 'color.fill.muted': color.fill.muted,\n 'color.fill.inverse': color.fill.inverse,\n 'color.fill.accent': color.fill.accent,\n 'color.fill.accent-hover': color.fill['accent-hover'],\n 'color.fill.accent-pressed': color.fill['accent-pressed'],\n 'color.fill.accent-muted': color.fill['accent-muted'],\n 'color.fill.accent-muted-hover': color.fill['accent-muted-hover'],\n 'color.fill.accent-muted-pressed': color.fill['accent-muted-pressed'],\n 'color.fill.danger': color.fill.danger,\n 'color.fill.danger-hover': color.fill['danger-hover'],\n 'color.fill.danger-pressed': color.fill['danger-pressed'],\n 'color.fill.danger-muted': color.fill['danger-muted'],\n 'color.fill.success': color.fill.success,\n 'color.fill.success-muted': color.fill['success-muted'],\n 'color.fill.warning': color.fill.warning,\n 'color.fill.warning-muted': color.fill['warning-muted'],\n 'color.fill.serious': color.fill.serious,\n 'color.fill.serious-muted': color.fill['serious-muted'],\n 'color.fill.ai-muted': color.fill['ai-muted'],\n 'color.fill.disabled': color.fill.disabled,\n 'color.fill.default': color.fill.default,\n 'color.fill.default-hover': color.fill['default-hover'],\n 'color.fill.default-pressed': color.fill['default-pressed'],\n 'color.fill.none': color.fill.none,\n 'color.fill.none-hover': color.fill['none-hover'],\n 'color.fill.none-pressed': color.fill['none-pressed'],\n 'color.fill.inverse-none-hover': color.fill['inverse-none-hover'],\n}\n\n/** Box's `color` prop: the text colours. */\nexport const textColorByKey: Record<keyof Semantic['color']['text'], string> = color.text\n\n/** Box's border props: the border colours. */\nexport const borderColorByKey: Record<keyof Semantic['color']['border'], string> = color.border\n"],"names":["semantic","tokens","color","space","radius","surface","spaceByLayoutKey","none","xs","sm","md","lg","xl","auto","spacing","layout","radiusByKey","circle","full","backgroundByPath","base","raised","scrim","fill","emphasis","muted","inverse","accent","danger","success","warning","serious","disabled","textColorByKey","text","borderColorByKey","border"],"mappings":";;;AAGA;AACA;AACA;AACA;AACQ,IAAAA,QAAQ,GAAKC,MAAM,CAAAD,QAAX,CAAA;AACR,IAAAE,KAAK,GAA6BF,QAAQ,MAArC;EAAEG,KAAK,GAAsBH,QAAQ,CAAAG,KAA9B;EAAEC,MAAM,GAAcJ,QAAQ,CAAtBI,MAAA;EAAEC,OAAO,GAAKL,QAAQ,QAAb,CAAA;AAUrC;AACO,IAAMM,gBAAgB,GAA6B;AACxDC,EAAAA,IAAI,EAAEJ,KAAK,CAAC,CAAC,CAAC;AACdK,EAAAA,EAAE,EAAEL,KAAK,CAAC,GAAG,CAAC;AACdM,EAAAA,EAAE,EAAEN,KAAK,CAAC,GAAG,CAAC;AACdO,EAAAA,EAAE,EAAEP,KAAK,CAAC,GAAG,CAAC;AACdQ,EAAAA,EAAE,EAAER,KAAK,CAAC,GAAG,CAAC;AACdS,EAAAA,EAAE,EAAET,KAAK,CAAC,GAAG,CAAC;AACd,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,IAAI,CAAC;AAClB,EAAA,KAAK,EAAEA,KAAK,CAAC,IAAI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AAEL,KAAK,CAACqB,IAAI,CAAC,YAAY,CAAC;AACjD,EAAA,yBAAyB,EAAErB,KAAK,CAACqB,IAAI,CAAC,cAAc,CAAC;AACrD,EAAA,+BAA+B,EAAErB,KAAK,CAACqB,IAAI,CAAC,oBAAoB,CAAA;EACjE;AAED;AACaU,IAAAA,cAAc,GAAoD/B,KAAK,CAACgC,KAAI;AAEzF;AACaC,IAAAA,gBAAgB,GAAsDjC,KAAK,CAACkC;;;;"}
1
+ {"version":3,"file":"tokenAliases.mjs","sources":["../../src/lib/tokenAliases.ts"],"sourcesContent":["import tokens from './cssTokens'\nimport type { Tokens } from '../types/tokens'\n\n// Box's spacing and radius props keep their own names, which 3.0 decoupled from the removed\n// spacing.layout and border.radius tokens (P7, #99), and read the semantic grammar's tokens\n// (decision 0031). Each map covers every key the prop type allows, so TypeScript fails here if a\n// key is added without a mapping.\nconst { semantic } = tokens\nconst { color, space, radius, surface } = semantic\n\ntype Semantic = Tokens['semantic']\n\n/** Box's spacing values (`p`, `m`, `gap`…), each a `space` step, plus `auto`. */\nexport type BoxSpace =\n | 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl' | '10xl' | '11xl'\n | 'auto'\n\n/** Box's spacing props: each name maps to the space step that replaced its spacing.layout token. */\nexport const spaceByLayoutKey: Record<BoxSpace, string> = {\n none: space[0],\n xs: space[100],\n sm: space[200],\n md: space[300],\n lg: space[400],\n xl: space[500],\n '2xl': space[600],\n '3xl': space[700],\n '4xl': space[800],\n '5xl': space[900],\n '6xl': space[1000],\n '7xl': space[1200],\n '8xl': space[1400],\n '9xl': space[1600],\n '10xl': space[2000],\n '11xl': space[2400],\n // A keyword, not a step (0031)\n auto: semantic.spacing.layout.auto,\n}\n\n/** Box's `borderRadius` values: the `radius` steps, with `circle` for `full`. */\nexport type BoxRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'circle'\n\n/** Box's `borderRadius` prop, read from `radius`. */\nexport const radiusByKey: Record<BoxRadius, string> = {\n none: radius.none,\n xs: radius.xs,\n sm: radius.sm,\n md: radius.md,\n lg: radius.lg,\n xl: radius.xl,\n '2xl': radius['2xl'],\n '3xl': radius['3xl'],\n circle: radius.full,\n}\n\n/**\n * Box's `bg` values in the semantic grammar (decision 0031, #304): the token's path below\n * `semantic`, such as `surface.raised` or `color.fill.muted`.\n */\nexport type BackgroundPath =\n | `surface.${keyof Semantic['surface']}`\n | `color.fill.${keyof Semantic['color']['fill']}`\n\n/** Box's `bg` prop: the grammar's token paths, read from the token at that path. */\nexport const backgroundByPath: Record<BackgroundPath, string> = {\n 'surface.base': surface.base,\n 'surface.raised': surface.raised,\n 'surface.overlay': surface.overlay,\n 'surface.scrim': surface.scrim,\n 'color.fill.emphasis': color.fill.emphasis,\n 'color.fill.muted': color.fill.muted,\n 'color.fill.inverse': color.fill.inverse,\n 'color.fill.accent': color.fill.accent,\n 'color.fill.accent-hover': color.fill['accent-hover'],\n 'color.fill.accent-pressed': color.fill['accent-pressed'],\n 'color.fill.accent-muted': color.fill['accent-muted'],\n 'color.fill.accent-muted-hover': color.fill['accent-muted-hover'],\n 'color.fill.accent-muted-pressed': color.fill['accent-muted-pressed'],\n 'color.fill.danger': color.fill.danger,\n 'color.fill.danger-hover': color.fill['danger-hover'],\n 'color.fill.danger-pressed': color.fill['danger-pressed'],\n 'color.fill.danger-muted': color.fill['danger-muted'],\n 'color.fill.success': color.fill.success,\n 'color.fill.success-muted': color.fill['success-muted'],\n 'color.fill.warning': color.fill.warning,\n 'color.fill.warning-muted': color.fill['warning-muted'],\n 'color.fill.serious': color.fill.serious,\n 'color.fill.serious-muted': color.fill['serious-muted'],\n 'color.fill.ai-muted': color.fill['ai-muted'],\n 'color.fill.disabled': color.fill.disabled,\n 'color.fill.default': color.fill.default,\n 'color.fill.default-hover': color.fill['default-hover'],\n 'color.fill.default-pressed': color.fill['default-pressed'],\n 'color.fill.none': color.fill.none,\n 'color.fill.none-hover': color.fill['none-hover'],\n 'color.fill.none-pressed': color.fill['none-pressed'],\n 'color.fill.inverse-none-hover': color.fill['inverse-none-hover'],\n}\n\n/** Box's `color` prop: the text colours. */\nexport const textColorByKey: Record<keyof Semantic['color']['text'], string> = color.text\n\n/** Box's border props: the border colours. */\nexport const borderColorByKey: Record<keyof Semantic['color']['border'], string> = color.border\n"],"names":["semantic","tokens","color","space","radius","surface","spaceByLayoutKey","none","xs","sm","md","lg","xl","auto","spacing","layout","radiusByKey","circle","full","backgroundByPath","base","raised","overlay","scrim","fill","emphasis","muted","inverse","accent","danger","success","warning","serious","disabled","textColorByKey","text","borderColorByKey","border"],"mappings":";;;AAGA;AACA;AACA;AACA;AACQ,IAAAA,QAAQ,GAAKC,MAAM,CAAAD,QAAX,CAAA;AACR,IAAAE,KAAK,GAA6BF,QAAQ,MAArC;EAAEG,KAAK,GAAsBH,QAAQ,CAAAG,KAA9B;EAAEC,MAAM,GAAcJ,QAAQ,CAAtBI,MAAA;EAAEC,OAAO,GAAKL,QAAQ,QAAb,CAAA;AAUrC;AACO,IAAMM,gBAAgB,GAA6B;AACxDC,EAAAA,IAAI,EAAEJ,KAAK,CAAC,CAAC,CAAC;AACdK,EAAAA,EAAE,EAAEL,KAAK,CAAC,GAAG,CAAC;AACdM,EAAAA,EAAE,EAAEN,KAAK,CAAC,GAAG,CAAC;AACdO,EAAAA,EAAE,EAAEP,KAAK,CAAC,GAAG,CAAC;AACdQ,EAAAA,EAAE,EAAER,KAAK,CAAC,GAAG,CAAC;AACdS,EAAAA,EAAE,EAAET,KAAK,CAAC,GAAG,CAAC;AACd,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,E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A,4BAA4B,EAAEtB,KAAK,CAACsB,IAAI,CAAC,iBAAiB,CAAC;AAC3D,EAAA,iBAAiB,EAAEtB,KAAK,CAACsB,IAAI,CAACjB,IAAI;AAClC,EAAA,uBAAuB,EAAEL,KAAK,CAACsB,IAAI,CAAC,YAAY,CAAC;AACjD,EAAA,yBAAyB,EAAEtB,KAAK,CAACsB,IAAI,CAAC,cAAc,CAAC;AACrD,EAAA,+BAA+B,EAAEtB,KAAK,CAACsB,IAAI,CAAC,oBAAoB,CAAA;EACjE;AAED;AACaU,IAAAA,cAAc,GAAoDhC,KAAK,CAACiC,KAAI;AAEzF;AACaC,IAAAA,gBAAgB,GAAsDlC,KAAK,CAACmC;;;;"}
@@ -0,0 +1,32 @@
1
+ import { useEffect, type RefObject } from 'react';
2
+ import { type FloatingAlign, type FloatingSide } from './floatingPosition.mjs';
3
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
4
+ /** The trigger's width in px, set on the floating element when `matchAnchorWidth` is on */
5
+ export declare const ANCHOR_WIDTH_VAR = "--co-floating-anchor-width";
6
+ interface FloatingLayerOptions {
7
+ /** Whether the floating element is rendered */
8
+ isPresent: boolean;
9
+ /** The floating element: `position: fixed`, placed with top and left */
10
+ floatingRef: RefObject<HTMLElement | null>;
11
+ /** The `display: contents` wrapper around the trigger */
12
+ anchorRef: RefObject<Element | null>;
13
+ side: FloatingSide;
14
+ align: FloatingAlign;
15
+ /**
16
+ * Writes the trigger's width to `ANCHOR_WIDTH_VAR` on the floating element before each placement,
17
+ * so its CSS can be at least as wide as the trigger
18
+ */
19
+ matchAnchorWidth?: boolean;
20
+ /**
21
+ * Called when the trigger may have moved away from the floating element: the page or a container
22
+ * scrolled (anything but the floating element itself), or the window resized
23
+ */
24
+ onDetach: () => void;
25
+ }
26
+ /**
27
+ * Shows a floating element (Tooltip, Menu) in the top layer beside its trigger, before the browser
28
+ * paints, and places it again whenever its size changes. A gap of `space.100` separates it from the
29
+ * trigger, and it keeps `space.200` from the viewport's edges.
30
+ */
31
+ export declare function useFloatingLayer({ isPresent, floatingRef, anchorRef, side, align, matchAnchorWidth, onDetach, }: FloatingLayerOptions): void;
32
+ export {};
@@ -0,0 +1,32 @@
1
+ import { useEffect, type RefObject } from 'react';
2
+ import { type FloatingAlign, type FloatingSide } from './floatingPosition';
3
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
4
+ /** The trigger's width in px, set on the floating element when `matchAnchorWidth` is on */
5
+ export declare const ANCHOR_WIDTH_VAR = "--co-floating-anchor-width";
6
+ interface FloatingLayerOptions {
7
+ /** Whether the floating element is rendered */
8
+ isPresent: boolean;
9
+ /** The floating element: `position: fixed`, placed with top and left */
10
+ floatingRef: RefObject<HTMLElement | null>;
11
+ /** The `display: contents` wrapper around the trigger */
12
+ anchorRef: RefObject<Element | null>;
13
+ side: FloatingSide;
14
+ align: FloatingAlign;
15
+ /**
16
+ * Writes the trigger's width to `ANCHOR_WIDTH_VAR` on the floating element before each placement,
17
+ * so its CSS can be at least as wide as the trigger
18
+ */
19
+ matchAnchorWidth?: boolean;
20
+ /**
21
+ * Called when the trigger may have moved away from the floating element: the page or a container
22
+ * scrolled (anything but the floating element itself), or the window resized
23
+ */
24
+ onDetach: () => void;
25
+ }
26
+ /**
27
+ * Shows a floating element (Tooltip, Menu) in the top layer beside its trigger, before the browser
28
+ * paints, and places it again whenever its size changes. A gap of `space.100` separates it from the
29
+ * trigger, and it keeps `space.200` from the viewport's edges.
30
+ */
31
+ export declare function useFloatingLayer({ isPresent, floatingRef, anchorRef, side, align, matchAnchorWidth, onDetach, }: FloatingLayerOptions): void;
32
+ export {};
@@ -0,0 +1,95 @@
1
+ 'use client';
2
+ import { useLayoutEffect, useEffect } from 'react';
3
+ import tokensJson from '../styles/tokens.json.mjs';
4
+ import { laidOutElement, placeFloating } from './floatingPosition.mjs';
5
+
6
+ var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
7
+ // The Popover API puts a floating element in the top layer: above everything, Modal included,
8
+ // never clipped by a scroll container, with no z-index (#326). It's in every current browser;
9
+ // without it the element is still position: fixed, so it escapes overflow clipping.
10
+ var supportsPopover = function supportsPopover() {
11
+ return typeof HTMLElement !== 'undefined' && 'showPopover' in HTMLElement.prototype;
12
+ };
13
+ /** The trigger's width in px, set on the floating element when `matchAnchorWidth` is on */
14
+ var ANCHOR_WIDTH_VAR = '--co-floating-anchor-width';
15
+ var remToPx = function remToPx(value) {
16
+ return parseFloat(value) * (parseFloat(getComputedStyle(document.documentElement).fontSize) || 16);
17
+ };
18
+ /**
19
+ * Shows a floating element (Tooltip, Menu) in the top layer beside its trigger, before the browser
20
+ * paints, and places it again whenever its size changes. A gap of `space.100` separates it from the
21
+ * trigger, and it keeps `space.200` from the viewport's edges.
22
+ */
23
+ function useFloatingLayer(_a) {
24
+ var isPresent = _a.isPresent,
25
+ floatingRef = _a.floatingRef,
26
+ anchorRef = _a.anchorRef,
27
+ side = _a.side,
28
+ align = _a.align,
29
+ _b = _a.matchAnchorWidth,
30
+ matchAnchorWidth = _b === void 0 ? false : _b,
31
+ onDetach = _a.onDetach;
32
+ useIsomorphicLayoutEffect(function () {
33
+ var floating = floatingRef.current;
34
+ if (!isPresent || !floating) return;
35
+ if (supportsPopover() && !floating.matches(':popover-open')) {
36
+ floating.setAttribute('popover', 'manual');
37
+ floating.showPopover();
38
+ }
39
+ var place = function place() {
40
+ var trigger = laidOutElement(anchorRef.current);
41
+ if (!trigger) return;
42
+ var anchor = trigger.getBoundingClientRect();
43
+ // Before measuring, since it can widen the floating element
44
+ if (matchAnchorWidth) floating.style.setProperty(ANCHOR_WIDTH_VAR, "".concat(anchor.width, "px"));else floating.style.removeProperty(ANCHOR_WIDTH_VAR);
45
+ var _a = floating.getBoundingClientRect(),
46
+ width = _a.width,
47
+ height = _a.height;
48
+ var position = placeFloating({
49
+ anchor: anchor,
50
+ floating: {
51
+ width: width,
52
+ height: height
53
+ },
54
+ side: side,
55
+ align: align,
56
+ offset: remToPx(tokensJson.semantic.space[100]),
57
+ viewport: {
58
+ width: window.innerWidth,
59
+ height: window.innerHeight
60
+ },
61
+ margin: remToPx(tokensJson.semantic.space[200])
62
+ });
63
+ floating.style.top = "".concat(position.top, "px");
64
+ floating.style.left = "".concat(position.left, "px");
65
+ floating.dataset.side = position.side;
66
+ };
67
+ place();
68
+ if (typeof ResizeObserver === 'undefined') return;
69
+ var observer = new ResizeObserver(place);
70
+ observer.observe(floating);
71
+ // Its width follows the trigger's, so a trigger that resizes while it's open places it again
72
+ var trigger = matchAnchorWidth ? laidOutElement(anchorRef.current) : null;
73
+ if (trigger) observer.observe(trigger);
74
+ return function () {
75
+ return observer.disconnect();
76
+ };
77
+ }, [isPresent, side, align, matchAnchorWidth, floatingRef, anchorRef]);
78
+ useEffect(function () {
79
+ if (!isPresent) return;
80
+ var onScroll = function onScroll(event) {
81
+ var _a;
82
+ if (event.target instanceof Node && ((_a = floatingRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) return;
83
+ onDetach();
84
+ };
85
+ window.addEventListener('scroll', onScroll, true);
86
+ window.addEventListener('resize', onDetach);
87
+ return function () {
88
+ window.removeEventListener('scroll', onScroll, true);
89
+ window.removeEventListener('resize', onDetach);
90
+ };
91
+ }, [isPresent, floatingRef, onDetach]);
92
+ }
93
+
94
+ export { ANCHOR_WIDTH_VAR, useFloatingLayer, useIsomorphicLayoutEffect };
95
+ //# sourceMappingURL=useFloatingLayer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFloatingLayer.mjs","sources":["../../src/lib/useFloatingLayer.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, type RefObject } from 'react'\n// Placement needs resolved lengths, not CSS variables (decision 0041)\nimport tokenValues from '../styles/tokens.json'\nimport { laidOutElement, placeFloating, type FloatingAlign, type FloatingSide } from './floatingPosition'\n\nexport const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\n// The Popover API puts a floating element in the top layer: above everything, Modal included,\n// never clipped by a scroll container, with no z-index (#326). It's in every current browser;\n// without it the element is still position: fixed, so it escapes overflow clipping.\nconst supportsPopover = () => typeof HTMLElement !== 'undefined' && 'showPopover' in HTMLElement.prototype\n\n/** The trigger's width in px, set on the floating element when `matchAnchorWidth` is on */\nexport const ANCHOR_WIDTH_VAR = '--co-floating-anchor-width'\n\nconst remToPx = (value: string) =>\n parseFloat(value) * (parseFloat(getComputedStyle(document.documentElement).fontSize) || 16)\n\ninterface FloatingLayerOptions {\n /** Whether the floating element is rendered */\n isPresent: boolean\n /** The floating element: `position: fixed`, placed with top and left */\n floatingRef: RefObject<HTMLElement | null>\n /** The `display: contents` wrapper around the trigger */\n anchorRef: RefObject<Element | null>\n side: FloatingSide\n align: FloatingAlign\n /**\n * Writes the trigger's width to `ANCHOR_WIDTH_VAR` on the floating element before each placement,\n * so its CSS can be at least as wide as the trigger\n */\n matchAnchorWidth?: boolean\n /**\n * Called when the trigger may have moved away from the floating element: the page or a container\n * scrolled (anything but the floating element itself), or the window resized\n */\n onDetach: () => void\n}\n\n/**\n * Shows a floating element (Tooltip, Menu) in the top layer beside its trigger, before the browser\n * paints, and places it again whenever its size changes. A gap of `space.100` separates it from the\n * trigger, and it keeps `space.200` from the viewport's edges.\n */\nexport function useFloatingLayer({\n isPresent,\n floatingRef,\n anchorRef,\n side,\n align,\n matchAnchorWidth = false,\n onDetach,\n}: FloatingLayerOptions) {\n useIsomorphicLayoutEffect(() => {\n const floating = floatingRef.current\n if (!isPresent || !floating) return\n if (supportsPopover() && !floating.matches(':popover-open')) {\n floating.setAttribute('popover', 'manual')\n floating.showPopover()\n }\n const place = () => {\n const trigger = laidOutElement(anchorRef.current)\n if (!trigger) return\n const anchor = trigger.getBoundingClientRect()\n // Before measuring, since it can widen the floating element\n if (matchAnchorWidth) floating.style.setProperty(ANCHOR_WIDTH_VAR, `${anchor.width}px`)\n else floating.style.removeProperty(ANCHOR_WIDTH_VAR)\n const { width, height } = floating.getBoundingClientRect()\n const position = placeFloating({\n anchor,\n floating: { width, height },\n side,\n align,\n offset: remToPx(tokenValues.semantic.space[100]),\n viewport: { width: window.innerWidth, height: window.innerHeight },\n margin: remToPx(tokenValues.semantic.space[200]),\n })\n floating.style.top = `${position.top}px`\n floating.style.left = `${position.left}px`\n floating.dataset.side = position.side\n }\n place()\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(place)\n observer.observe(floating)\n // Its width follows the trigger's, so a trigger that resizes while it's open places it again\n const trigger = matchAnchorWidth ? laidOutElement(anchorRef.current) : null\n if (trigger) observer.observe(trigger)\n return () => observer.disconnect()\n }, [isPresent, side, align, matchAnchorWidth, floatingRef, anchorRef])\n\n useEffect(() => {\n if (!isPresent) return\n const onScroll = (event: Event) => {\n if (event.target instanceof Node && floatingRef.current?.contains(event.target)) return\n onDetach()\n }\n window.addEventListener('scroll', onScroll, true)\n window.addEventListener('resize', onDetach)\n return () => {\n window.removeEventListener('scroll', onScroll, true)\n window.removeEventListener('resize', onDetach)\n }\n }, [isPresent, floatingRef, onDetach])\n}\n"],"names":["useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","supportsPopover","HTMLElement","prototype","ANCHOR_WIDTH_VAR","remToPx","value","parseFloat","getComputedStyle","document","documentElement","fontSize","useFloatingLayer","_a","isPresent","floatingRef","anchorRef","side","align","_b","matchAnchorWidth","onDetach","floating","current","matches","setAttribute","showPopover","place","trigger","laidOutElement","anchor","getBoundingClientRect","style","setProperty","concat","width","removeProperty","height","position","placeFloating","offset","tokenValues","semantic","space","viewport","innerWidth","innerHeight","margin","top","left","dataset","ResizeObserver","observer","observe","disconnect","onScroll","event","target","Node","contains","addEventListener","removeEventListener"],"mappings":";;;;;AAKO,IAAMA,yBAAyB,GAAG,OAAOC,MAAM,KAAK,WAAW,GAAGC,eAAe,GAAGC,UAAS;AAEpG;AACA;AACA;AACA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,GAAG;EAAM,OAAA,OAAOC,WAAW,KAAK,WAAW,IAAI,aAAa,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