@kanso-labs/kanso-ui 0.35.0 → 0.37.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 (220) hide show
  1. package/README.md +90 -9
  2. package/dist/button/context.js +7 -0
  3. package/dist/button/context.js.map +1 -0
  4. package/dist/button/group.js +25 -0
  5. package/dist/button/group.js.map +1 -0
  6. package/dist/button/hooks.js +81 -0
  7. package/dist/button/hooks.js.map +1 -0
  8. package/dist/button/index.d.ts +11 -0
  9. package/dist/button/index.js +273 -0
  10. package/dist/button/index.js.map +1 -0
  11. package/dist/button/styles.js +23 -0
  12. package/dist/button/styles.js.map +1 -0
  13. package/dist/calendar/index.js +473 -7
  14. package/dist/calendar/index.js.map +1 -1
  15. package/dist/calendar/styles.js +132 -4
  16. package/dist/calendar/styles.js.map +1 -1
  17. package/dist/chip/index.js +74 -9
  18. package/dist/chip/index.js.map +1 -1
  19. package/dist/chip/styles.js +78 -4
  20. package/dist/chip/styles.js.map +1 -1
  21. package/dist/collection/index.js +12 -9
  22. package/dist/collection/index.js.map +1 -1
  23. package/dist/collection/styles.js +21 -2
  24. package/dist/collection/styles.js.map +1 -1
  25. package/dist/color-scheme.d.ts +29 -0
  26. package/dist/color-scheme.js +32 -0
  27. package/dist/color-scheme.js.map +1 -0
  28. package/dist/components/avatar/index.js +35 -22
  29. package/dist/components/avatar/index.js.map +1 -1
  30. package/dist/components/badge/index.d.ts +40 -0
  31. package/dist/components/badge/index.js +102 -0
  32. package/dist/components/badge/index.js.map +1 -0
  33. package/dist/components/breadcrumbs/index.d.ts +1 -1
  34. package/dist/components/breadcrumbs/index.js +1 -1
  35. package/dist/components/breadcrumbs/index.js.map +1 -1
  36. package/dist/components/button/index.d.ts +58 -14
  37. package/dist/components/button/index.js +400 -147
  38. package/dist/components/button/index.js.map +1 -1
  39. package/dist/components/button-group/index.d.ts +54 -0
  40. package/dist/components/button-group/index.js +272 -0
  41. package/dist/components/button-group/index.js.map +1 -0
  42. package/dist/components/calendar/index.d.ts +9 -1
  43. package/dist/components/calendar/index.js +71 -44
  44. package/dist/components/calendar/index.js.map +1 -1
  45. package/dist/components/card/index.d.ts +1 -1
  46. package/dist/components/card/index.js +4 -4
  47. package/dist/components/card/index.js.map +1 -1
  48. package/dist/components/checkbox/index.js +15 -1
  49. package/dist/components/checkbox/index.js.map +1 -1
  50. package/dist/components/checkbox-group/index.js +1 -0
  51. package/dist/components/checkbox-group/index.js.map +1 -1
  52. package/dist/components/chip/index.d.ts +55 -8
  53. package/dist/components/chip/index.js +174 -63
  54. package/dist/components/chip/index.js.map +1 -1
  55. package/dist/components/chip-group/index.d.ts +16 -7
  56. package/dist/components/chip-group/index.js +58 -35
  57. package/dist/components/chip-group/index.js.map +1 -1
  58. package/dist/components/color-field/index.js +25 -23
  59. package/dist/components/color-field/index.js.map +1 -1
  60. package/dist/components/color-picker/index.js +42 -31
  61. package/dist/components/color-picker/index.js.map +1 -1
  62. package/dist/components/color-swatch-picker/index.d.ts +1 -1
  63. package/dist/components/color-swatch-picker/index.js +17 -13
  64. package/dist/components/color-swatch-picker/index.js.map +1 -1
  65. package/dist/components/combo-box/index.d.ts +5 -3
  66. package/dist/components/combo-box/index.js +63 -58
  67. package/dist/components/combo-box/index.js.map +1 -1
  68. package/dist/components/copy-field/index.d.ts +7 -6
  69. package/dist/components/copy-field/index.js +92 -90
  70. package/dist/components/copy-field/index.js.map +1 -1
  71. package/dist/components/currency/index.d.ts +8 -7
  72. package/dist/components/currency/index.js +43 -65
  73. package/dist/components/currency/index.js.map +1 -1
  74. package/dist/components/date-field/index.js +24 -22
  75. package/dist/components/date-field/index.js.map +1 -1
  76. package/dist/components/date-picker/index.d.ts +10 -2
  77. package/dist/components/date-picker/index.js +76 -69
  78. package/dist/components/date-picker/index.js.map +1 -1
  79. package/dist/components/date-range-picker/index.d.ts +10 -2
  80. package/dist/components/date-range-picker/index.js +93 -86
  81. package/dist/components/date-range-picker/index.js.map +1 -1
  82. package/dist/components/dialog/index.d.ts +1 -1
  83. package/dist/components/dialog/index.js +2 -2
  84. package/dist/components/dialog/index.js.map +1 -1
  85. package/dist/components/disclosure/index.d.ts +1 -1
  86. package/dist/components/disclosure/index.js +6 -6
  87. package/dist/components/disclosure/index.js.map +1 -1
  88. package/dist/components/fab/index.d.ts +72 -0
  89. package/dist/components/fab/index.js +89 -0
  90. package/dist/components/fab/index.js.map +1 -0
  91. package/dist/components/fab-menu/index.d.ts +90 -0
  92. package/dist/components/fab-menu/index.js +297 -0
  93. package/dist/components/fab-menu/index.js.map +1 -0
  94. package/dist/components/feed/index.d.ts +2 -1
  95. package/dist/components/feed/index.js +1 -1
  96. package/dist/components/feed/index.js.map +1 -1
  97. package/dist/components/icon-button/index.d.ts +11 -8
  98. package/dist/components/icon-button/index.js +244 -181
  99. package/dist/components/icon-button/index.js.map +1 -1
  100. package/dist/components/index.d.ts +30 -21
  101. package/dist/components/list/index.d.ts +15 -13
  102. package/dist/components/list/index.js +60 -61
  103. package/dist/components/list/index.js.map +1 -1
  104. package/dist/components/list-box/index.d.ts +3 -2
  105. package/dist/components/list-box/index.js +16 -16
  106. package/dist/components/list-box/index.js.map +1 -1
  107. package/dist/components/list-item/index.js +1 -1
  108. package/dist/components/list-item/index.js.map +1 -1
  109. package/dist/components/menu/index.d.ts +3 -2
  110. package/dist/components/menu/index.js +2 -2
  111. package/dist/components/menu/index.js.map +1 -1
  112. package/dist/components/navigation-bar/index.d.ts +50 -0
  113. package/dist/components/navigation-bar/index.js +129 -0
  114. package/dist/components/navigation-bar/index.js.map +1 -0
  115. package/dist/components/navigation-rail/index.d.ts +59 -0
  116. package/dist/components/navigation-rail/index.js +166 -0
  117. package/dist/components/navigation-rail/index.js.map +1 -0
  118. package/dist/components/navigation-tree/index.d.ts +1 -5
  119. package/dist/components/navigation-tree/index.js +3 -3
  120. package/dist/components/navigation-tree/index.js.map +1 -1
  121. package/dist/components/number-field/index.d.ts +6 -4
  122. package/dist/components/number-field/index.js +84 -84
  123. package/dist/components/number-field/index.js.map +1 -1
  124. package/dist/components/popover/index.d.ts +1 -1
  125. package/dist/components/popover/index.js +1 -1
  126. package/dist/components/popover/index.js.map +1 -1
  127. package/dist/components/radio-group/index.js +22 -11
  128. package/dist/components/radio-group/index.js.map +1 -1
  129. package/dist/components/range-calendar/index.d.ts +7 -1
  130. package/dist/components/range-calendar/index.js +71 -44
  131. package/dist/components/range-calendar/index.js.map +1 -1
  132. package/dist/components/search-field/index.d.ts +2 -1
  133. package/dist/components/search-field/index.js +24 -25
  134. package/dist/components/search-field/index.js.map +1 -1
  135. package/dist/components/search-view/index.d.ts +79 -0
  136. package/dist/components/search-view/index.js +255 -0
  137. package/dist/components/search-view/index.js.map +1 -0
  138. package/dist/components/segmented-button/index.d.ts +2 -2
  139. package/dist/components/segmented-button/index.js +60 -31
  140. package/dist/components/segmented-button/index.js.map +1 -1
  141. package/dist/components/select/index.js +1 -0
  142. package/dist/components/select/index.js.map +1 -1
  143. package/dist/components/sheet/index.d.ts +1 -1
  144. package/dist/components/sheet/index.js +2 -2
  145. package/dist/components/sheet/index.js.map +1 -1
  146. package/dist/components/slider/index.js +1 -1
  147. package/dist/components/slider/index.js.map +1 -1
  148. package/dist/components/snackbar/index.d.ts +2 -2
  149. package/dist/components/snackbar/index.js +28 -13
  150. package/dist/components/snackbar/index.js.map +1 -1
  151. package/dist/components/split-button/index.d.ts +83 -0
  152. package/dist/components/split-button/index.js +341 -0
  153. package/dist/components/split-button/index.js.map +1 -0
  154. package/dist/components/switch/index.js +11 -1
  155. package/dist/components/switch/index.js.map +1 -1
  156. package/dist/components/table/index.d.ts +11 -9
  157. package/dist/components/table/index.js +87 -31
  158. package/dist/components/table/index.js.map +1 -1
  159. package/dist/components/tabs/index.d.ts +35 -4
  160. package/dist/components/tabs/index.js +403 -93
  161. package/dist/components/tabs/index.js.map +1 -1
  162. package/dist/components/tag/index.d.ts +1 -1
  163. package/dist/components/tag/index.js.map +1 -1
  164. package/dist/components/text-area/index.d.ts +7 -5
  165. package/dist/components/text-area/index.js +28 -26
  166. package/dist/components/text-area/index.js.map +1 -1
  167. package/dist/components/text-field/index.d.ts +7 -5
  168. package/dist/components/text-field/index.js +28 -26
  169. package/dist/components/text-field/index.js.map +1 -1
  170. package/dist/components/time-field/index.js +24 -22
  171. package/dist/components/time-field/index.js.map +1 -1
  172. package/dist/components/tree/index.d.ts +7 -9
  173. package/dist/components/tree/index.js +15 -16
  174. package/dist/components/tree/index.js.map +1 -1
  175. package/dist/drag/index.js.map +1 -1
  176. package/dist/drag/styles.js +4 -1
  177. package/dist/drag/styles.js.map +1 -1
  178. package/dist/fab/styles.js +161 -0
  179. package/dist/fab/styles.js.map +1 -0
  180. package/dist/field/index.js +260 -214
  181. package/dist/field/index.js.map +1 -1
  182. package/dist/field/styles.js +10 -2
  183. package/dist/field/styles.js.map +1 -1
  184. package/dist/glyphs/index.js +55 -1
  185. package/dist/glyphs/index.js.map +1 -1
  186. package/dist/hooks/useRipple.js +199 -162
  187. package/dist/hooks/useRipple.js.map +1 -1
  188. package/dist/hooks/useToggleGroupDisabled.js +24 -0
  189. package/dist/hooks/useToggleGroupDisabled.js.map +1 -0
  190. package/dist/i18n/index.js +43 -0
  191. package/dist/i18n/index.js.map +1 -0
  192. package/dist/i18n/messages.js +387 -0
  193. package/dist/i18n/messages.js.map +1 -0
  194. package/dist/index.d.ts +31 -21
  195. package/dist/index.js +25 -16
  196. package/dist/navigation/context.js +7 -0
  197. package/dist/navigation/context.js.map +1 -0
  198. package/dist/navigation/index.d.ts +28 -0
  199. package/dist/navigation/index.js +96 -0
  200. package/dist/navigation/index.js.map +1 -0
  201. package/dist/navigation/styles.js +312 -0
  202. package/dist/navigation/styles.js.map +1 -0
  203. package/dist/react-aria.d.ts +2 -2
  204. package/dist/react-aria.js +2 -2
  205. package/dist/render/useRender.js +0 -1
  206. package/dist/render/useRender.js.map +1 -1
  207. package/dist/row/styles.js +33 -11
  208. package/dist/row/styles.js.map +1 -1
  209. package/dist/styles/focus.js.map +1 -1
  210. package/dist/styles/icon-button.js +9 -1
  211. package/dist/styles/icon-button.js.map +1 -1
  212. package/dist/styles/overlay.js +1 -0
  213. package/dist/styles/overlay.js.map +1 -1
  214. package/dist/styles/picker.js +1 -1
  215. package/dist/styles/picker.js.map +1 -1
  216. package/dist/styles.css +1104 -336
  217. package/dist/tokens/design.tokens.stylex.js +42 -1
  218. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  219. package/dist/tokens.css +166 -53
  220. package/package.json +9 -5
@@ -1 +1 @@
1
- {"version":3,"file":"useRender.js","names":["ComponentPropsWithRef","CSSProperties","HTMLAttributes","JSX","ReactElement","Ref","RefCallback","RefObject","cloneElement","createElement","isValidElement","useMemo","Handler","args","ReadonlyArray","IntrinsicTag","IntrinsicElements","RenderComponentProps","Tag","render","RenderProp","RenderFunctionProps","ref","props","UseRenderParameters","defaultTagName","Record","attach","Element","node","cleanup","current","isHandler","value","isHandlerKey","key","test","isRefCallback","isRefObject","joinClassNames","names","filter","Boolean","join","undefined","mergeElementProps","ours","theirs","merged","className","stringOf","style","mergeStyleObjects","styleOf","Object","keys","own","their","mergeRefs","a","b","detachA","detachB","refOf","useRender","t0","$","_c","t1","t2","t3","element","t4","t5","type","_c"],"sources":["../../src/render/useRender.tsx"],"sourcesContent":["import type {\n ComponentPropsWithRef,\n CSSProperties,\n HTMLAttributes,\n JSX,\n ReactElement,\n Ref,\n RefCallback,\n RefObject,\n} from 'react'\n\nimport { cloneElement, createElement, isValidElement, useMemo } from 'react'\n\ntype Handler = (...args: ReadonlyArray<unknown>) => unknown\n\ntype IntrinsicTag = keyof JSX.IntrinsicElements\n\n/**\n * The props of a component rendered through {@link useRender}: everything the\n * element accepts, plus `render`.\n */\ntype RenderComponentProps<Tag extends IntrinsicTag> =\n ComponentPropsWithRef<Tag> & {\n /**\n * Replaces the element the component renders by default: another tag, as\n * `render={<h2 />}`, or a function returning the element to render, given\n * the props the component would have put on its own.\n */\n render?: RenderProp | undefined\n }\n\n/**\n * What a `render` function is handed: the element's props, merged and ready\n * to spread onto whatever element it returns. `any` on purpose, in the one\n * place it appears — the function may return any element, and a ref typed for\n * one of them would refuse every other.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\ntype RenderFunctionProps = HTMLAttributes<any> & { ref?: Ref<any> | undefined }\n\ntype RenderProp = ((props: RenderFunctionProps) => ReactElement) | ReactElement\n\ninterface UseRenderParameters {\n /**\n * The tag rendered when `render` is not given.\n * @default 'div'\n */\n defaultTagName?: IntrinsicTag | undefined\n /** The props to put on whichever element ends up rendered. */\n props?: Record<string, unknown> | undefined\n render?: RenderProp | undefined\n}\n\nfunction attach(ref: Ref<Element>, node: Element | null): () => void {\n if (ref === null) {\n return () => {}\n }\n if (typeof ref === 'function') {\n const cleanup = ref(node)\n return typeof cleanup === 'function'\n ? cleanup\n : () => {\n ref(null)\n }\n }\n ref.current = node\n return () => {\n ref.current = null\n }\n}\n\nfunction isHandler(value: unknown): value is Handler {\n return typeof value === 'function'\n}\n\nfunction isHandlerKey(key: string) {\n return /^on[A-Z]/u.test(key)\n}\n\nfunction isRefCallback(value: unknown): value is RefCallback<Element> {\n return typeof value === 'function'\n}\n\nfunction isRefObject(value: unknown): value is RefObject<Element | null> {\n return typeof value === 'object' && value !== null && 'current' in value\n}\n\n// undefined rather than '' when there is nothing to say, so an element with\n// no classes on either side renders without a class attribute at all.\nfunction joinClassNames(...names: ReadonlyArray<string | undefined>) {\n return names.filter(Boolean).join(' ') || undefined\n}\n\n/**\n * The component's props over the element's own. The element wins a plain\n * conflict — it is the more specific of the two — while class names, styles\n * and handlers are combined rather than chosen between. `ref` is left out:\n * the hook merges the two refs itself.\n */\nfunction mergeElementProps(\n ours: Record<string, unknown>,\n theirs: Record<string, unknown>,\n) {\n const merged: Record<string, unknown> = { ...ours, ...theirs }\n\n merged.className = joinClassNames(\n stringOf(ours.className),\n stringOf(theirs.className),\n )\n merged.style = mergeStyleObjects(styleOf(ours.style), styleOf(theirs.style))\n\n for (const key of Object.keys(theirs)) {\n const own = ours[key]\n const their = theirs[key]\n if (isHandlerKey(key) && isHandler(own) && isHandler(their)) {\n // The element's own handler runs first, as the more specific one.\n merged[key] = (...args: ReadonlyArray<unknown>) => {\n their(...args)\n own(...args)\n }\n }\n }\n\n delete merged.ref\n return merged\n}\n\n/**\n * One ref that feeds both, or whichever one there is. Attaching through a\n * callback lets each side keep its own cleanup: React 19 calls a callback\n * ref's returned function on detach in place of calling it with `null`, so\n * the merged callback returns one that does the same for each of the two.\n */\nfunction mergeRefs(\n a: Ref<Element> | undefined,\n b: Ref<Element> | undefined,\n): Ref<Element> | undefined {\n if (a === undefined) {\n return b\n }\n if (b === undefined) {\n return a\n }\n return (node: Element | null) => {\n const detachA = attach(a, node)\n const detachB = attach(b, node)\n return () => {\n detachA()\n detachB()\n }\n }\n}\n\nfunction mergeStyleObjects(\n ours: CSSProperties | undefined,\n theirs: CSSProperties | undefined,\n) {\n if (ours === undefined && theirs === undefined) {\n return undefined\n }\n return { ...ours, ...theirs }\n}\n\nfunction refOf(value: unknown): Ref<Element> | undefined {\n if (isRefCallback(value) || isRefObject(value)) {\n return value\n }\n return undefined\n}\n\nfunction stringOf(value: unknown) {\n return typeof value === 'string' ? value : undefined\n}\n\nfunction styleOf(value: unknown) {\n return typeof value === 'object' && value !== null\n ? (value as CSSProperties)\n : undefined\n}\n\n/**\n * Renders a component's element, or whatever its `render` prop asks for\n * instead.\n *\n * `render` is either a React element, cloned with the component's props\n * merged over its own — class names joined, styles merged, event handlers\n * chained, the element's own value winning any other conflict — or a function\n * handed those merged props to return an element of its choosing. Without one,\n * `defaultTagName` is rendered. A default `button` is given `type=\"button\"`,\n * since a bare one submits any form it happens to sit in.\n *\n * The element form is the point of owning this. React Aria's own `render`\n * is a function that must return the element the component would have\n * rendered itself, which suits its interactive components and nothing else;\n * the non-interactive ones here take `render={<h2 />}`, and keeping that\n * contract in a hook of the library's own is what lets them stay put\n * whichever behaviour library sits underneath the rest.\n */\nfunction useRender({\n defaultTagName = 'div',\n props = {},\n render,\n}: UseRenderParameters): ReactElement {\n const element = isValidElement<Record<string, unknown>>(render)\n ? render\n : undefined\n\n // Both refs, when there are two, have to land on one node. The merged\n // callback is memoised so React does not detach and re-attach it on every\n // render — a new identity each time would.\n //\n // The dependencies are the props the refs are read from rather than the\n // refs themselves. React writes through a ref object, so the compiler reads\n // one as a value that may be modified later and declines to preserve a\n // memoisation keyed on it — which, under the panic threshold this lands\n // beside, fails the build. A prop it can prove holds still.\n const ref = useMemo(\n () => mergeRefs(refOf(props.ref), refOf(element?.props.ref)),\n [props.ref, element?.props.ref],\n )\n\n if (element !== undefined) {\n return cloneElement(element, {\n ...mergeElementProps(props, element.props),\n ref,\n })\n }\n\n if (typeof render === 'function') {\n return render({ ...props, ref } as RenderFunctionProps)\n }\n\n return createElement(\n defaultTagName,\n defaultTagName === 'button'\n ? { type: 'button', ...props, ref }\n : { ...props, ref },\n )\n}\n\nexport type { RenderComponentProps, RenderFunctionProps, UseRenderParameters }\n\nexport { useRender }\n"],"mappings":";;;AAqDA,SAAS2B,OAAOL,KAAmBO,MAAkC;CACnE,IAAIP,QAAQ,MACV,aAAa,CAAC;CAEhB,IAAI,OAAOA,QAAQ,YAAY;EAC7B,MAAMQ,UAAUR,IAAIO,IAAI;EACxB,OAAO,OAAOC,YAAY,aACtBA,gBACM;GACJR,IAAI,IAAI;EACV;CACN;CACAA,IAAIS,UAAUF;CACd,aAAa;EACXP,IAAIS,UAAU;CAChB;AACF;AAEA,SAASC,UAAUC,OAAkC;CACnD,OAAO,OAAOA,UAAU;AAC1B;AAEA,SAASC,aAAaC,KAAa;CACjC,OAAO,YAAYC,KAAKD,GAAG;AAC7B;AAEA,SAASE,cAAcJ,OAA+C;CACpE,OAAO,OAAOA,UAAU;AAC1B;AAEA,SAASK,YAAYL,OAAoD;CACvE,OAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQ,aAAaA;AACrE;AAIA,SAASM,eAAe,GAAGC,OAA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A,KAAAO;EAAA,OAAAA,KAAAP,EAAA;EAAA,OAHKO;CAGL;CAGJ,IAAI,OAAOtD,WAAW,YAAU;EAAA,IAAAsD;EAAA,IAAAP,EAAA,OAAA3C,SAAA2C,EAAA,QAAA5C,OAAA4C,EAAA,QAAA/C,QAAA;GACvBsD,KAAAtD,OAAO;IAAA,GAAKI;IAAKD;GAAM,CAAwB;GAAC4C,EAAA,KAAA3C;GAAA2C,EAAA,MAAA5C;GAAA4C,EAAA,MAAA/C;GAAA+C,EAAA,MAAAO;EAAA,OAAAA,KAAAP,EAAA;EAAA,OAAhDO;CAAgD;CACxD,IAAAA;CAAA,IAAAP,EAAA,QAAAzC,kBAAAyC,EAAA,QAAA3C,SAAA2C,EAAA,QAAA5C,KAAA;EAEMmD,KAAAhE,cACLgB,gBACAA,mBAAmB,WAAnB;GAAAiD,MACY;GAAQ,GAAKnD;GAAKD;EACV,IAFpB;GAAA,GAESC;GAAKD;EAAM,CACtB;EAAC4C,EAAA,MAAAzC;EAAAyC,EAAA,MAAA3C;EAAA2C,EAAA,MAAA5C;EAAA4C,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OALMO;AAKN"}
1
+ {"version":3,"file":"useRender.js","names":["ComponentPropsWithRef","CSSProperties","HTMLAttributes","JSX","ReactElement","Ref","RefCallback","RefObject","cloneElement","createElement","isValidElement","useMemo","AttachableRef","NonNullable","Element","Handler","args","ReadonlyArray","IntrinsicTag","IntrinsicElements","RenderComponentProps","Tag","render","RenderProp","RenderFunctionProps","ref","props","UseRenderParameters","defaultTagName","Record","attach","node","cleanup","current","isHandler","value","isHandlerKey","key","test","isRefCallback","isRefObject","joinClassNames","names","filter","Boolean","join","undefined","mergeElementProps","ours","theirs","merged","className","stringOf","style","mergeStyleObjects","styleOf","Object","keys","own","their","mergeRefs","a","b","detachA","detachB","refOf","useRender","t0","$","_c","t1","t2","t3","element","t4","t5","type","_c"],"sources":["../../src/render/useRender.tsx"],"sourcesContent":["import type {\n ComponentPropsWithRef,\n CSSProperties,\n HTMLAttributes,\n JSX,\n ReactElement,\n Ref,\n RefCallback,\n RefObject,\n} from 'react'\n\nimport { cloneElement, createElement, isValidElement, useMemo } from 'react'\n\n// A ref the hook can write through. React reads a `null` ref as none at all,\n// and `refOf` turns one into `undefined` before a merge sees it.\ntype AttachableRef = NonNullable<Ref<Element>>\n\ntype Handler = (...args: ReadonlyArray<unknown>) => unknown\n\ntype IntrinsicTag = keyof JSX.IntrinsicElements\n\n/**\n * The props of a component rendered through {@link useRender}: everything the\n * element accepts, plus `render`.\n */\ntype RenderComponentProps<Tag extends IntrinsicTag> =\n ComponentPropsWithRef<Tag> & {\n /**\n * Replaces the element the component renders by default: another tag, as\n * `render={<h2 />}`, or a function returning the element to render, given\n * the props the component would have put on its own.\n */\n render?: RenderProp | undefined\n }\n\n/**\n * What a `render` function is handed: the element's props, merged and ready\n * to spread onto whatever element it returns. `any` on purpose, in the one\n * place it appears — the function may return any element, and a ref typed for\n * one of them would refuse every other.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\ntype RenderFunctionProps = HTMLAttributes<any> & { ref?: Ref<any> | undefined }\n\ntype RenderProp = ((props: RenderFunctionProps) => ReactElement) | ReactElement\n\ninterface UseRenderParameters {\n /**\n * The tag rendered when `render` is not given.\n * @default 'div'\n */\n defaultTagName?: IntrinsicTag | undefined\n /** The props to put on whichever element ends up rendered. */\n props?: Record<string, unknown> | undefined\n render?: RenderProp | undefined\n}\n\nfunction attach(ref: AttachableRef, node: Element | null): () => void {\n if (typeof ref === 'function') {\n const cleanup = ref(node)\n return typeof cleanup === 'function'\n ? cleanup\n : () => {\n ref(null)\n }\n }\n ref.current = node\n return () => {\n ref.current = null\n }\n}\n\nfunction isHandler(value: unknown): value is Handler {\n return typeof value === 'function'\n}\n\nfunction isHandlerKey(key: string) {\n return /^on[A-Z]/u.test(key)\n}\n\nfunction isRefCallback(value: unknown): value is RefCallback<Element> {\n return typeof value === 'function'\n}\n\nfunction isRefObject(value: unknown): value is RefObject<Element | null> {\n return typeof value === 'object' && value !== null && 'current' in value\n}\n\n// undefined rather than '' when there is nothing to say, so an element with\n// no classes on either side renders without a class attribute at all.\nfunction joinClassNames(...names: ReadonlyArray<string | undefined>) {\n return names.filter(Boolean).join(' ') || undefined\n}\n\n/**\n * The component's props over the element's own. The element wins a plain\n * conflict — it is the more specific of the two — while class names, styles\n * and handlers are combined rather than chosen between. `ref` is left out:\n * the hook merges the two refs itself.\n */\nfunction mergeElementProps(\n ours: Record<string, unknown>,\n theirs: Record<string, unknown>,\n) {\n const merged: Record<string, unknown> = { ...ours, ...theirs }\n\n merged.className = joinClassNames(\n stringOf(ours.className),\n stringOf(theirs.className),\n )\n merged.style = mergeStyleObjects(styleOf(ours.style), styleOf(theirs.style))\n\n for (const key of Object.keys(theirs)) {\n const own = ours[key]\n const their = theirs[key]\n if (isHandlerKey(key) && isHandler(own) && isHandler(their)) {\n // The element's own handler runs first, as the more specific one.\n merged[key] = (...args: ReadonlyArray<unknown>) => {\n their(...args)\n own(...args)\n }\n }\n }\n\n delete merged.ref\n return merged\n}\n\n/**\n * One ref that feeds both, or whichever one there is. Attaching through a\n * callback lets each side keep its own cleanup: React 19 calls a callback\n * ref's returned function on detach in place of calling it with `null`, so\n * the merged callback returns one that does the same for each of the two.\n */\nfunction mergeRefs(\n a: AttachableRef | undefined,\n b: AttachableRef | undefined,\n): AttachableRef | undefined {\n if (a === undefined) {\n return b\n }\n if (b === undefined) {\n return a\n }\n return (node: Element | null) => {\n const detachA = attach(a, node)\n const detachB = attach(b, node)\n return () => {\n detachA()\n detachB()\n }\n }\n}\n\nfunction mergeStyleObjects(\n ours: CSSProperties | undefined,\n theirs: CSSProperties | undefined,\n) {\n if (ours === undefined && theirs === undefined) {\n return undefined\n }\n return { ...ours, ...theirs }\n}\n\nfunction refOf(value: unknown): AttachableRef | undefined {\n if (isRefCallback(value) || isRefObject(value)) {\n return value\n }\n return undefined\n}\n\nfunction stringOf(value: unknown) {\n return typeof value === 'string' ? value : undefined\n}\n\nfunction styleOf(value: unknown) {\n return typeof value === 'object' && value !== null\n ? (value as CSSProperties)\n : undefined\n}\n\n/**\n * Renders a component's element, or whatever its `render` prop asks for\n * instead.\n *\n * `render` is either a React element, cloned with the component's props\n * merged over its own — class names joined, styles merged, event handlers\n * chained, the element's own value winning any other conflict — or a function\n * handed those merged props to return an element of its choosing. Without one,\n * `defaultTagName` is rendered. A default `button` is given `type=\"button\"`,\n * since a bare one submits any form it happens to sit in.\n *\n * The element form is the point of owning this. React Aria's own `render`\n * is a function that must return the element the component would have\n * rendered itself, which suits its interactive components and nothing else;\n * the non-interactive ones here take `render={<h2 />}`, and keeping that\n * contract in a hook of the library's own is what lets them stay put\n * whichever behaviour library sits underneath the rest.\n */\nfunction useRender({\n defaultTagName = 'div',\n props = {},\n render,\n}: UseRenderParameters): ReactElement {\n const element = isValidElement<Record<string, unknown>>(render)\n ? render\n : undefined\n\n // Both refs, when there are two, have to land on one node. The merged\n // callback is memoised so React does not detach and re-attach it on every\n // render — a new identity each time would.\n //\n // The dependencies are the props the refs are read from rather than the\n // refs themselves. React writes through a ref object, so the compiler reads\n // one as a value that may be modified later and declines to preserve a\n // memoisation keyed on it — which, under the panic threshold this lands\n // beside, fails the build. A prop it can prove holds still.\n const ref = useMemo(\n () => mergeRefs(refOf(props.ref), refOf(element?.props.ref)),\n [props.ref, element?.props.ref],\n )\n\n if (element !== undefined) {\n return cloneElement(element, {\n ...mergeElementProps(props, element.props),\n ref,\n })\n }\n\n if (typeof render === 'function') {\n return render({ ...props, ref } as RenderFunctionProps)\n }\n\n return createElement(\n defaultTagName,\n defaultTagName === 'button'\n ? { type: 'button', ...props, ref }\n : { ...props, ref },\n )\n}\n\nexport type { RenderComponentProps, RenderFunctionProps, UseRenderParameters }\n\nexport { useRender }\n"],"mappings":";;;AAyDA,SAAS8B,OAAOL,KAAoBM,MAAkC;CACpE,IAAI,OAAON,QAAQ,YAAY;EAC7B,MAAMO,UA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w",
20
20
  kMwMTN: "x1xj74d8",
21
21
  kkrTdU: "x1h6gzvc",
22
+ kAXs8y: "xr5dkdi",
23
+ $$css: true
24
+ },
25
+ dragging: {
26
+ kWkggS: "x14s9m32",
27
+ kKwaWg: "xdiex0u",
28
+ kGVxlE: "x4r79n0",
29
+ kY2c9j: "x1vjfegm",
22
30
  $$css: true
23
31
  },
24
32
  drawer: {
@@ -28,9 +36,17 @@ const rowStyles = {
28
36
  kAzted: "xyax5pk",
29
37
  $$css: true
30
38
  },
39
+ dropTarget: {
40
+ kKwaWg: "xu73ib2",
41
+ kjBf7l: "xrgy624 x1x84bn5",
42
+ kInvED: "x2ssjo2",
43
+ k3XXqK: "xaatb59",
44
+ kMeerF: "x1de99jn",
45
+ $$css: true
46
+ },
31
47
  focusVisible: {
32
48
  kKwaWg: "x17vw94z",
33
- kjBf7l: "xrgy624",
49
+ kjBf7l: "xrgy624 x1v8yhc2",
34
50
  kInvED: "x2ssjo2",
35
51
  k3XXqK: "xaatb59",
36
52
  kMeerF: "x1de99jn",
@@ -62,7 +78,6 @@ const rowStyles = {
62
78
  $$css: true
63
79
  },
64
80
  interactive: {
65
- kWkggS: "x83qkoq x1p2om7n xjbqb8w",
66
81
  kkrTdU: "x1ypdohk",
67
82
  kVVagm: "xln7xf2",
68
83
  kjBf7l: "xrgy624",
@@ -71,6 +86,10 @@ const rowStyles = {
71
86
  kMeerF: "x1de99jn",
72
87
  $$css: true
73
88
  },
89
+ interactiveLayers: {
90
+ kWkggS: "x83qkoq x1yl1wq7 xjqqt44 xjbqb8w",
91
+ $$css: true
92
+ },
74
93
  list: {
75
94
  kAzted: "xyax5pk",
76
95
  $$css: true
@@ -101,18 +120,21 @@ const rowStyles = {
101
120
  $$css: true
102
121
  },
103
122
  selectedDrawer: {
104
- kWkggS: "x15dekr4",
105
- kMwMTN: "x1sawysd",
123
+ kWkggS: "x15dekr4 x1jzqe4",
124
+ kMwMTN: "x1sawysd x1k5gbb1",
125
+ kAXs8y: "x1g12otp",
106
126
  $$css: true
107
127
  },
108
128
  selectedList: {
109
- kWkggS: "xp89om9",
110
- kMwMTN: "xscdzaa",
129
+ kWkggS: "xp89om9 x1jzqe4",
130
+ kMwMTN: "xscdzaa x1k5gbb1",
131
+ kAXs8y: "x1g12otp",
111
132
  $$css: true
112
133
  },
113
134
  selectedMenu: {
114
- kWkggS: "xs6yvni",
115
- kMwMTN: "x3cbcwg",
135
+ kWkggS: "xs6yvni x1jzqe4",
136
+ kMwMTN: "x3cbcwg x1k5gbb1",
137
+ kAXs8y: "x1g12otp",
116
138
  $$css: true
117
139
  },
118
140
  slot: {
@@ -135,15 +157,15 @@ const rowStyles = {
135
157
  $$css: true
136
158
  },
137
159
  supportingSelectedDrawer: {
138
- kMwMTN: "x1sawysd",
160
+ kMwMTN: "x1sawysd x1k5gbb1",
139
161
  $$css: true
140
162
  },
141
163
  supportingSelectedList: {
142
- kMwMTN: "xscdzaa",
164
+ kMwMTN: "xscdzaa x1k5gbb1",
143
165
  $$css: true
144
166
  },
145
167
  supportingSelectedMenu: {
146
- kMwMTN: "x3cbcwg",
168
+ kMwMTN: "x3cbcwg x1k5gbb1",
147
169
  $$css: true
148
170
  },
149
171
  threeLine: {
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["stylex","colors","radii","sizing","spacing","stateLayerOpacity","typography","rowStyles","base","kGNEyG","kWkggS","kMzoRj","kB7OPa","kMwMTN","k1xSpc","kOIVth","kzqmXN","k8WAf4","kg3NbH","kVAEAm","k9WMMc","$$css","disabled","kkrTdU","drawer","kaIpWk","kUOVxO","kAzted","focusVisible","kKwaWg","kjBf7l","kInvED","k3XXqK","kMeerF","headlineEmphasis","k63SB2","headlineList","kMv6JI","kGuDYH","kb6lSQ","kLWn49","headlineMenu","hovered","interactive","kVVagm","list","main","kXwgrk","kzQI83","k7Eaqz","menu","overline","pressed","selectedDrawer","selectedList","selectedMenu","slot","kmuXW","supporting","supportingInherit","supportingSelectedDrawer","supportingSelectedList","supportingSelectedMenu","threeLine","twoLine"],"sources":["../../src/row/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The row every list draws: ListItem's, and from here on the item of every\n// collection the coverage plan adds — ListBox, Menu, List, Tree, the options\n// of Select and ComboBox. Apart from the RowContent component in ./index.tsx\n// so that file exports components alone, which is what keeps fast refresh\n// working for it.\n//\n// Three variants, because three spec pages draw three rows. The lists page\n// gives a list item a 56dp floor, a body-large headline and a body-medium\n// supporting line, and primary container when selected. The menus page gives\n// a menu item 48dp, a label-large label, and tertiary container when\n// selected. The navigation drawer page gives its row 56dp too, with a\n// label-large label like a menu's, and marks the current one with a\n// secondary-container pill held 12dp off each edge — 336dp of indicator in a\n// 360dp container, which is what that inset comes to. The layout, the\n// padding, the state layers and the disabled treatment are one row; `list`,\n// `menu` and `drawer` carry only what the three pages disagree on, and a\n// consumer applies one of them beside `base`.\n//\n// Laid out with flex rather than the grid the design draws. The design's\n// three columns are `auto 1fr auto`, which is what flex does natively — and\n// unlike a fixed three-column grid it stays correct when a row has no leading\n// or no trailing content, where the remaining children would otherwise slide\n// into the wrong columns.\n//\n// Rows align with each other through their leading content being the same\n// size, not through a fixed column width: a list of Avatars all at one size\n// lines up, and that is the same thing the design's 40px column achieves.\n//\n// The state layer composites over `transparent` rather than over a container\n// colour, because a row's own background is transparent and it therefore\n// tints whatever it happens to be sitting on — a card, a menu, or the page.\n// The two selected states are the ones that bring a container of their own.\nconst rowStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xxj4525\",\n kzqmXN: \"xh8yej3\",\n k8WAf4: \"x1uvvd8r\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n },\n disabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n drawer: {\n kaIpWk: \"x1dkaolv\",\n kzqmXN: \"x14atkfc\",\n kUOVxO: \"xd2r6sq\",\n kAzted: \"xyax5pk\",\n $$css: true\n },\n focusVisible: {\n kKwaWg: \"x17vw94z\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n headlineEmphasis: {\n k63SB2: \"x1sfltvt\",\n $$css: true\n },\n headlineList: {\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n headlineMenu: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n hovered: {\n kKwaWg: \"xbmfk57\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n interactive: {\n kWkggS: \"x83qkoq x1p2om7n xjbqb8w\",\n kkrTdU: \"x1ypdohk\",\n kVVagm: \"xln7xf2\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n list: {\n kAzted: \"xyax5pk\",\n $$css: true\n },\n main: {\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"x14qo01y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n },\n menu: {\n kAzted: \"x1ddmzdj\",\n $$css: true\n },\n overline: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n k63SB2: \"x1su64ma\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n $$css: true\n },\n pressed: {\n kKwaWg: \"xdiex0u\",\n $$css: true\n },\n selectedDrawer: {\n kWkggS: \"x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n selectedList: {\n kWkggS: \"xp89om9\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n },\n selectedMenu: {\n kWkggS: \"xs6yvni\",\n kMwMTN: \"x3cbcwg\",\n $$css: true\n },\n slot: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n supporting: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n $$css: true\n },\n supportingInherit: {\n kMwMTN: \"x1heor9g\",\n $$css: true\n },\n supportingSelectedDrawer: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n supportingSelectedList: {\n kMwMTN: \"xscdzaa\",\n $$css: true\n },\n supportingSelectedMenu: {\n kMwMTN: \"x3cbcwg\",\n $$css: true\n },\n threeLine: {\n kGNEyG: \"x1cy8zhl\",\n kAzted: \"x1bt55z4\",\n $$css: true\n },\n twoLine: {\n kAzted: \"x304zwk\",\n $$css: true\n }\n};\nexport { rowStyles };"],"mappings":";AAoCA,MAAMO,YAAY;CAChBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRZ,QAAQ;EACRG,QAAQ;EACRU,QAAQ;EACRF,OAAO;CACT;CACAG,QAAQ;E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;EACRC,QAAQ;EACRH,QAAQ;EACRI,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAsC,mBAAmB;EACjB9C,QAAQ;EACRQ,OAAO;CACT;CACAuC,0BAA0B;EACxB/C,QAAQ;EACRQ,OAAO;CACT;CACAwC,wBAAwB;EACtBhD,QAAQ;EACRQ,OAAO;CACT;CACAyC,wBAAwB;EACtBjD,QAAQ;EACRQ,OAAO;CACT;CACA0C,WAAW;EACTtD,QAAQ;EACRkB,QAAQ;EACRN,OAAO;CACT;CACA2C,SAAS;EACPrC,QAAQ;EACRN,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"styles.js","names":["stylex","colors","radii","shadows","sizing","spacing","stateLayerOpacity","typography","HOVER_CAPABLE","FORCED_COLORS","rowStyles","base","kGNEyG","kWkggS","kMzoRj","kB7OPa","kMwMTN","k1xSpc","kOIVth","kzqmXN","k8WAf4","kg3NbH","kVAEAm","k9WMMc","$$css","disabled","kkrTdU","kAXs8y","dragging","kKwaWg","kGVxlE","kY2c9j","drawer","kaIpWk","kUOVxO","kAzted","dropTarget","kjBf7l","kInvED","k3XXqK","kMeerF","focusVisible","headlineEmphasis","k63SB2","headlineList","kMv6JI","kGuDYH","kb6lSQ","kLWn49","headlineMenu","hovered","interactive","kVVagm","interactiveLayers","list","main","kXwgrk","kzQI83","k7Eaqz","menu","overline","pressed","selectedDrawer","selectedList","selectedMenu","slot","kmuXW","supporting","supportingInherit","supportingSelectedDrawer","supportingSelectedList","supportingSelectedMenu","threeLine","twoLine"],"sources":["../../src/row/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The row every list draws: ListItem's, and from here on the item of every\n// collection the coverage plan adds — ListBox, Menu, List, Tree, the options\n// of Select and ComboBox. Apart from the RowContent component in ./index.tsx\n// so that file exports components alone, which is what keeps fast refresh\n// working for it.\n//\n// Three variants, because three spec pages draw three rows. The lists page\n// gives a list item a 56dp floor, a body-large headline and a body-medium\n// supporting line, and primary container when selected. The menus page gives\n// a menu item 48dp, a label-large label, and tertiary container when\n// selected. The navigation drawer page gives its row 56dp too, with a\n// label-large label like a menu's, and marks the current one with a\n// secondary-container pill held 12dp off each edge — 336dp of indicator in a\n// 360dp container, which is what that inset comes to. The layout, the\n// padding, the state layers and the disabled treatment are one row; `list`,\n// `menu` and `drawer` carry only what the three pages disagree on, and a\n// consumer applies one of them beside `base`.\n//\n// Laid out with flex rather than the grid the design draws. The design's\n// three columns are `auto 1fr auto`, which is what flex does natively — and\n// unlike a fixed three-column grid it stays correct when a row has no leading\n// or no trailing content, where the remaining children would otherwise slide\n// into the wrong columns.\n//\n// Rows align with each other through their leading content being the same\n// size, not through a fixed column width: a list of Avatars all at one size\n// lines up, and that is the same thing the design's 40px column achieves.\n//\n// The state layer composites over `transparent` rather than over a container\n// colour, because a row's own background is transparent and it therefore\n// tints whatever it happens to be sitting on — a card, a menu, or the page.\n// The two selected states are the ones that bring a container of their own.\n\n// A pointer that can hover, for `interactiveLayers` — a plain element with no\n// render state, so its hover layer is a pseudo-class, and Chromium leaves\n// `:hover` on whatever a touch last tapped. Inside this query a touch screen\n// draws no hover at all; a touchscreen laptop still matches it for its\n// trackpad.\nconst HOVER_CAPABLE = '@media (hover: hover)';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst rowStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xxj4525\",\n kzqmXN: \"xh8yej3\",\n k8WAf4: \"x1uvvd8r\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n },\n disabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n dragging: {\n kWkggS: \"x14s9m32\",\n kKwaWg: \"xdiex0u\",\n kGVxlE: \"x4r79n0\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n drawer: {\n kaIpWk: \"x1dkaolv\",\n kzqmXN: \"x14atkfc\",\n kUOVxO: \"xd2r6sq\",\n kAzted: \"xyax5pk\",\n $$css: true\n },\n dropTarget: {\n kKwaWg: \"xu73ib2\",\n kjBf7l: \"xrgy624 x1x84bn5\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n focusVisible: {\n kKwaWg: \"x17vw94z\",\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n headlineEmphasis: {\n k63SB2: \"x1sfltvt\",\n $$css: true\n },\n headlineList: {\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n headlineMenu: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n hovered: {\n kKwaWg: \"xbmfk57\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n interactive: {\n kkrTdU: \"x1ypdohk\",\n kVVagm: \"xln7xf2\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n interactiveLayers: {\n kWkggS: \"x83qkoq x1yl1wq7 xjqqt44 xjbqb8w\",\n $$css: true\n },\n list: {\n kAzted: \"xyax5pk\",\n $$css: true\n },\n main: {\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"x14qo01y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n },\n menu: {\n kAzted: \"x1ddmzdj\",\n $$css: true\n },\n overline: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n k63SB2: \"x1su64ma\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n $$css: true\n },\n pressed: {\n kKwaWg: \"xdiex0u\",\n $$css: true\n },\n selectedDrawer: {\n kWkggS: \"x15dekr4 x1jzqe4\",\n kMwMTN: \"x1sawysd x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectedList: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectedMenu: {\n kWkggS: \"xs6yvni x1jzqe4\",\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n slot: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n supporting: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n $$css: true\n },\n supportingInherit: {\n kMwMTN: \"x1heor9g\",\n $$css: true\n },\n supportingSelectedDrawer: {\n kMwMTN: \"x1sawysd x1k5gbb1\",\n $$css: true\n },\n supportingSelectedList: {\n kMwMTN: \"xscdzaa x1k5gbb1\",\n $$css: true\n },\n supportingSelectedMenu: {\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n $$css: true\n },\n threeLine: {\n kGNEyG: \"x1cy8zhl\",\n kAzted: \"x1bt55z4\",\n $$css: true\n },\n twoLine: {\n kAzted: \"x304zwk\",\n $$css: true\n }\n};\nexport { rowStyles };"],"mappings":";AAiDA,MAAMU,YAAY;CAChBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRZ,QAAQ;EACRG,QAAQ;EACRU,QAAQ;EACRC,QAAQ;EACRH,OAAO;CACT;CACAI,UAAU;EACRf,QAAQ;EACRgB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,OAAO;CACT;CACAQ,QAAQ;EACNC,QAAQ;EACRd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAY,YAAY;EACVP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRhB,OAAO;CACT;CACAiB,cAAc;EACZZ,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRhB,OAAO;CACT;CACAkB,kBAAkB;EAChBC,QAAQ;EACRnB,OAAO;CACT;CACAoB,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRH,QAAQ;EACRI,QAAQ;EACRC,QAAQ;EACRxB,OAAO;CACT;CACAyB,cAAc;EACZJ,QAAQ;EACRC,QAAQ;EACRH,QAAQ;EACRI,QAAQ;EACRC,QAAQ;EACRxB,OAAO;CACT;CACA0B,SAAS;EACPrB,QAAQ;EACRH,QAAQ;EACRF,OAAO;CACT;CACA2B,aAAa;EACXzB,QAAQ;EACR0B,QAAQ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","kjBf7l","kInvED","k3XXqK","kMeerF","$$css","ringVisible"],"sources":["../../src/styles/focus.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors } from '../tokens/design.tokens.stylex';\n\n// The focus ring, drawn once. Eighteen components spelled the same four\n// declarations out, which made a change to the ring eighteen edits with\n// nothing failing if one were missed.\n//\n// Only these two forms are shared, and the difference is who decides the\n// element has focus. `ring` lets the browser decide, through\n// `:focus-visible`, which is what a natively focusable element wants.\n// `ringVisible` is always solid, for a component that computes focus from\n// React Aria's render state and applies this style only when that state says\n// so — a checkbox, radio or switch, where the ring belongs on the drawn\n// control rather than on the input that actually holds focus.\n//\n// What deliberately stays with its component is every ring that differs, and\n// each of those already carries a comment saying why:\n//\n// - A different colour, because the surface underneath is not the default\n// one: Snackbar's action and close, and Chip's remove.\n// - A negative offset, drawing the ring inside the element rather than\n// around it: DropZone, NumberField, Table, a Tab, the shared row, and the\n// body of a Dialog or a Sheet while it scrolls.\n// - An offset of its own, sized to what the ring surrounds: the colour\n// thumb at 4px, the swatch at 6px, Chip's remove at 1px.\n// - A base of `outlineStyle: 'none'` that a separate style turns solid,\n// which is a different mechanism rather than a different value: the slider\n// thumb, the colour swatch picker, and the shared colour styles.\nconst focus = {\n ring: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n ringVisible: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n }\n};\nexport { focus };"],"mappings":";AA6BA,MAAME,QAAQ;CACZC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXL,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"focus.js","names":["stylex","colors","focus","ring","kjBf7l","kInvED","k3XXqK","kMeerF","$$css","ringVisible"],"sources":["../../src/styles/focus.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors } from '../tokens/design.tokens.stylex';\n\n// The focus ring, drawn once. Eighteen components spelled the same four\n// declarations out, which made a change to the ring eighteen edits with\n// nothing failing if one were missed.\n//\n// Only these two forms are shared, and the difference is who decides the\n// element has focus. `ring` lets the browser decide, through\n// `:focus-visible`, which is what a natively focusable element wants.\n// `ringVisible` is always solid, for a component that computes focus from\n// React Aria's render state and applies this style only when that state says\n// so — a checkbox, radio or switch, where the ring belongs on the drawn\n// control rather than on the input that actually holds focus.\n//\n// What deliberately stays with its component is every ring that differs, and\n// each of those already carries a comment saying why:\n//\n// - A different colour, because the surface underneath is not the default\n// one: Snackbar's action and close, and Chip's remove.\n// - A negative offset, drawing the ring inside the element rather than\n// around it: DropZone, NumberField, Table, a Tab and its panel, the shared\n// row, and the body of a Dialog or a Sheet while it scrolls.\n// - An offset of its own, sized to what the ring surrounds: the colour\n// thumb at 4px, the swatch at 6px, Chip's remove at 1px.\n// - A base of `outlineStyle: 'none'` that a separate style turns solid,\n// which is a different mechanism rather than a different value: the slider\n// thumb, the colour swatch picker, and the shared colour styles.\n// - An `outlineStyle` keyed on a breakpoint, for a ring that moves from one\n// element to another as the window widens: a navigation bar's destination.\nconst focus = {\n ring: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n ringVisible: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n }\n};\nexport { focus };"],"mappings":";AA+BA,MAAME,QAAQ;CACZC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXL,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;AACF"}
@@ -2,7 +2,7 @@
2
2
  const iconButton = {
3
3
  chrome: {
4
4
  kGNEyG: "x6s0dn4",
5
- kWkggS: "x1dg9itu x1728qcm xjbqb8w",
5
+ kWkggS: "xjbqb8w",
6
6
  kZKoxP: "x1rv7mn0",
7
7
  kaIpWk: "x1dkaolv",
8
8
  kMzoRj: "xc342km",
@@ -21,6 +21,14 @@ const iconButton = {
21
21
  kMwMTN: "x1gpw424",
22
22
  kkrTdU: "xt0e3qv",
23
23
  $$css: true
24
+ },
25
+ chromeHovered: {
26
+ kWkggS: "x14noynh",
27
+ $$css: true
28
+ },
29
+ chromePressed: {
30
+ kWkggS: "x123fei2",
31
+ $$css: true
24
32
  }
25
33
  };
26
34
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.js","names":["stylex","colors","radii","sizing","stateLayerOpacity","iconButton","chrome","kGNEyG","kWkggS","kZKoxP","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kzqmXN","kjj79g","kmVPX3","$$css","chromeDisabled"],"sources":["../../src/styles/icon-button.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, sizing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The icon buttons page's 40dp square and its state layer, drawn directly on\n// a button rather than through the `IconButton` component.\n//\n// Two places need that, and both said so in the same words while keeping\n// their own copy: a picker's trigger and the chevrons that move a calendar's\n// month. Neither can reach for `IconButton`, because React Aria carries each\n// of them on its own `Button` — the trigger through a picker's context, the\n// chevrons through a calendar's slots — so the chrome has to be drawn onto\n// the element React Aria renders.\n//\n// What each keeps is what it does not share. A calendar's chevron sits in a\n// 48dp column, so it adds the 4dp either side. Both take `chromeDisabled`\n// when React Aria disables them — a trigger when the field around it is\n// disabled, a chevron when there is no month to move to — and each reads\n// that from its own render state.\n//\n// This is deliberately narrow. Five other buttons in the library draw a bare\n// icon — a tree's caret, a navigation tree's, a combo box's toggle, a chip's\n// remove and `IconButton` itself — and each differs in size, content colour,\n// state-layer semantics or focus-ring offset, with a comment recording why.\n// At most eleven of these seventeen declarations survive into any of them, so\n// composing this and overriding the rest would hide those decisions rather\n// than record them.\nconst iconButton = {\n chrome: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x1dg9itu x1728qcm xjbqb8w\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1eujcsb\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n chromeDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1gpw424\",\n kkrTdU: \"xt0e3qv\",\n $$css: true\n }\n};\nexport { iconButton };"],"mappings":";AA2BA,MAAMK,aAAa;CACjBC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,gBAAgB;EACdb,QAAQ;EACRK,QAAQ;EACRC,QAAQ;EACRM,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"icon-button.js","names":["stylex","colors","radii","sizing","stateLayerOpacity","iconButton","chrome","kGNEyG","kWkggS","kZKoxP","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kzqmXN","kjj79g","kmVPX3","$$css","chromeDisabled","chromeHovered","chromePressed"],"sources":["../../src/styles/icon-button.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, sizing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The icon buttons page's 40dp square and its state layer, drawn directly on\n// a button rather than through the `IconButton` component.\n//\n// Two places need that, and both said so in the same words while keeping\n// their own copy: a picker's trigger and the chevrons that move a calendar's\n// month. Neither can reach for `IconButton`, because React Aria carries each\n// of them on its own `Button` — the trigger through a picker's context, the\n// chevrons through a calendar's slots — so the chrome has to be drawn onto\n// the element React Aria renders.\n//\n// What each keeps is what it does not share. A calendar's chevron sits in a\n// 48dp column, so it adds the 4dp either side. Both take `chromeDisabled`\n// when React Aria disables them — a trigger when the field around it is\n// disabled, a chevron when there is no month to move to — and each reads\n// that from its own render state, along with the hover and press that pick\n// `chromeHovered` and `chromePressed`. Those come from React Aria rather\n// than `:hover` and `:active`, for Button's reasons — see its header: a\n// hover layer stayed on after a tap, and no pressed layer showed for a press\n// made from the keyboard.\n//\n// This is deliberately narrow. Five other buttons in the library draw a bare\n// icon — a tree's caret, a navigation tree's, a combo box's toggle, a chip's\n// remove and `IconButton` itself — and each differs in size, content colour,\n// state-layer semantics or focus-ring offset, with a comment recording why.\n// At most eleven of these seventeen declarations survive into any of them, so\n// composing this and overriding the rest would hide those decisions rather\n// than record them.\nconst iconButton = {\n chrome: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1eujcsb\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n chromeDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1gpw424\",\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n chromeHovered: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n chromePressed: {\n kWkggS: \"x123fei2\",\n $$css: true\n }\n};\nexport { iconButton };"],"mappings":";AA+BA,MAAMK,aAAa;CACjBC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,gBAAgB;EACdb,QAAQ;EACRK,QAAQ;EACRC,QAAQ;EACRM,OAAO;CACT;CACAE,eAAe;EACbd,QAAQ;EACRY,OAAO;CACT;CACAG,eAAe;EACbf,QAAQ;EACRY,OAAO;CACT;AACF"}
@@ -45,6 +45,7 @@ const overlay = {
45
45
  kB7OPa: "x9f619",
46
46
  kMwMTN: "x139gbkf",
47
47
  kORKVm: "x1odjw0f",
48
+ kZeWKH: "xish69e",
48
49
  $$css: true
49
50
  },
50
51
  popupDialog: {
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.js","names":["PopoverRenderProps","stylex","colors","motion","radii","shadows","spacing","FORCED_COLORS","fadeIn","scaleIn","overlay","fromBottom","k3nNDw","$$css","fromLeft","fromRight","fromTop","modalBodyRing","kjBf7l","kInvED","k3XXqK","kMeerF","modalDialog","kZKoxP","kB7OPa","k1xSpc","kXwgrk","kAzted","popup","k44tkh","kKVMdj","kyAemX","kWkggS","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kGVxlE","kMwMTN","kORKVm","popupDialog","kOIVth","scrim","kpwlN0","kVAEAm","origins","bottom","center","left","right","top","OverlayAlign","OverlaySide","placementOf","side","align","const","popupOrigin","placement"],"sources":["../../src/styles/overlay.ts"],"sourcesContent":["import type { PopoverRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, spacing } from '../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// What every overlay shares, drawn once. Popover's anchored surface and its\n// entry, Sheet's scrim, and the element that carries the dialog role inside\n// each of them; the coverage plan brings a dozen more overlays — Menu, Select,\n// ComboBox, Tooltip, the date pickers, Dialog — and each would otherwise have\n// written the same surface and the same scrim a second time. Geometry stays\n// with the component: how wide a popover is, which edge a sheet is pinned to,\n// where a dialog sits, are each overlay's own decision.\n//\n// Every one of these is portalled to the end of the body, which is why each\n// component takes a `container` prop and documents the same caveat: an app\n// that scopes its StyleX theme to a subtree has to point the portal inside it,\n// or the surface renders outside the theme and falls back to the tokens'\n// `prefers-color-scheme` default.\n//\n// Entry only, and no exit animation, for the same reason in every overlay:\n// React Aria keeps a closing surface mounted only while an animation is\n// running on it, and a popover in particular is dismissed far more often than\n// it is closed deliberately — usually by pressing something else, where a\n// lingering surface is in the way of whatever the press was for.\n\n// The scrim settles before the panel it sits behind arrives: shorter than\n// any panel's entry, so the two do not finish together.\nconst fadeIn = \"x18re5ia-B\";\n\n// An anchored surface grows from the edge it is anchored by rather than from\n// its own centre, which is what makes it read as coming out of the trigger.\n// The origin is a separate style, chosen from the placement React Aria\n// reports, so the same keyframes serve all four sides.\nconst scaleIn = \"x1k48ry3-B\";\nconst overlay = {\n fromBottom: {\n k3nNDw: \"x18ouj0k\",\n $$css: true\n },\n fromLeft: {\n k3nNDw: \"x1nf803f\",\n $$css: true\n },\n fromRight: {\n k3nNDw: \"xyibjs4\",\n $$css: true\n },\n fromTop: {\n k3nNDw: \"x1dp6rp6\",\n $$css: true\n },\n modalBodyRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n modalDialog: {\n kZKoxP: \"x5yr21d\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kAzted: \"x2lwn1j\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n popup: {\n k44tkh: \"xvhm28k x1u6grsq\",\n kKVMdj: \"x97zbip\",\n kyAemX: \"x16dv9tl\",\n kWkggS: \"x1mjdul6\",\n kVAM5u: \"x1w1tqly\",\n kaIpWk: \"x62ce2h\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kGVxlE: \"x1os83gw\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kORKVm: \"x1odjw0f\",\n $$css: true\n },\n popupDialog: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x126z3so\",\n $$css: true\n },\n scrim: {\n k44tkh: \"x1vhuh8u\",\n kKVMdj: \"xqcmdr3\",\n kyAemX: \"x1yujl0p\",\n kWkggS: \"x1iqbvzf\",\n kB7OPa: \"x9f619\",\n kpwlN0: \"x10a8y8t\",\n kVAEAm: \"xixxii4\",\n $$css: true\n }\n};\n\n// Which side the surface opened on, and the origin its entry grows from.\n// Keyed on the placement React Aria reports rather than the one asked for,\n// since the surface flips to the opposite side when there is no room on its\n// own; `center` is the placement React Aria reports for an anchor it could\n// not place beside, and grows from the top like the default.\nconst origins = {\n bottom: overlay.fromTop,\n center: overlay.fromTop,\n left: overlay.fromRight,\n right: overlay.fromLeft,\n top: overlay.fromBottom\n};\n\n/** Where along that side it lines up with the anchor. */\ntype OverlayAlign = 'center' | 'end' | 'start';\n\n/** Which side of the anchor a surface opens on. */\ntype OverlaySide = 'bottom' | 'left' | 'right' | 'top';\n\n/**\n * React Aria's placement, from the side and the alignment a call site names.\n * Its own vocabulary pairs a side with `top`/`bottom` on the inline sides and\n * `start`/`end` on the block ones; a call site should not have to know which\n * of the two it is asking for, so this maps one onto the other.\n *\n * Shared by every anchored overlay rather than kept in one, since which side\n * a surface opens on is the same question for a popover, a menu and a\n * tooltip.\n */\nfunction placementOf(side: OverlaySide, align: OverlayAlign) {\n if (align === 'center') {\n return side;\n }\n if (side === 'top' || side === 'bottom') {\n return `${side} ${align}` as const;\n }\n return `${side} ${align === 'start' ? 'top' : 'bottom'}` as const;\n}\n\n/**\n * The origin an anchored surface grows from, for the placement React Aria\n * reports through its render state. `null`, before the surface has been\n * placed, grows from the top as `bottom` does.\n */\nfunction popupOrigin(placement: PopoverRenderProps['placement']) {\n return origins[placement ?? 'bottom'];\n}\nexport type { OverlayAlign, OverlaySide };\nexport { overlay, placementOf, popupOrigin };"],"mappings":";AAwCA,MAAMU,UAAU;CACdC,YAAY;EACVC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRF,QAAQ;EACRC,OAAO;CACT;CACAE,WAAW;EACTH,QAAQ;EACRC,OAAO;CACT;CACAG,SAAS;EACPJ,QAAQ;EACRC,OAAO;CACT;CACAI,eAAe;EACbC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAS,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRP,OAAO;CACT;CACAe,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRb,QAAQ;EACRc,QAAQ;EACRC,QAAQ;EACR1B,OAAO;CACT;CACA2B,aAAa;EACXhB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRe,QAAQ;EACR5B,OAAO;CACT;CACA6B,OAAO;EACLb,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRR,QAAQ;EACRmB,QAAQ;EACRC,QAAQ;EACR/B,OAAO;CACT;AACF;AAOA,MAAMgC,UAAU;CACdC,QAAQpC,QAAQM;CAChB+B,QAAQrC,QAAQM;CAChBgC,MAAMtC,QAAQK;CACdkC,OAAOvC,QAAQI;CACfoC,KAAKxC,QAAQC;AACf;;;;;;;;;;;AAkBA,SAAS0C,YAAYC,MAAmBC,OAAqB;CAC3D,IAAIA,UAAU,UACZ,OAAOD;CAET,IAAIA,SAAS,SAASA,SAAS,UAC7B,OAAO,GAAGA,KAAI,GAAIC;CAEpB,OAAO,GAAGD,KAAI,GAAIC,UAAU,UAAU,QAAQ;AAChD;;;;;;AAOA,SAASE,YAAYC,WAA4C;CAC/D,OAAOb,QAAQa,aAAa;AAC9B"}
1
+ {"version":3,"file":"overlay.js","names":["PopoverRenderProps","stylex","colors","motion","radii","shadows","spacing","FORCED_COLORS","fadeIn","scaleIn","overlay","fromBottom","k3nNDw","$$css","fromLeft","fromRight","fromTop","modalBodyRing","kjBf7l","kInvED","k3XXqK","kMeerF","modalDialog","kZKoxP","kB7OPa","k1xSpc","kXwgrk","kAzted","popup","k44tkh","kKVMdj","kyAemX","kWkggS","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kGVxlE","kMwMTN","kORKVm","kZeWKH","popupDialog","kOIVth","scrim","kpwlN0","kVAEAm","origins","bottom","center","left","right","top","OverlayAlign","OverlaySide","placementOf","side","align","const","popupOrigin","placement"],"sources":["../../src/styles/overlay.ts"],"sourcesContent":["import type { PopoverRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, spacing } from '../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// What every overlay shares, drawn once. Popover's anchored surface and its\n// entry, Sheet's scrim, and the element that carries the dialog role inside\n// each of them; the coverage plan brings a dozen more overlays — Menu, Select,\n// ComboBox, Tooltip, the date pickers, Dialog — and each would otherwise have\n// written the same surface and the same scrim a second time. Geometry stays\n// with the component: how wide a popover is, which edge a sheet is pinned to,\n// where a dialog sits, are each overlay's own decision.\n//\n// Every one of these is portalled to the end of the body, which is why each\n// component takes a `container` prop and documents the same caveat: an app\n// that scopes its StyleX theme to a subtree has to point the portal inside it,\n// or the surface renders outside the theme and falls back to the tokens'\n// `prefers-color-scheme` default.\n//\n// Entry only, and no exit animation, for the same reason in every overlay:\n// React Aria keeps a closing surface mounted only while an animation is\n// running on it, and a popover in particular is dismissed far more often than\n// it is closed deliberately — usually by pressing something else, where a\n// lingering surface is in the way of whatever the press was for.\n\n// The scrim settles before the panel it sits behind arrives: shorter than\n// any panel's entry, so the two do not finish together.\nconst fadeIn = \"x18re5ia-B\";\n\n// An anchored surface grows from the edge it is anchored by rather than from\n// its own centre, which is what makes it read as coming out of the trigger.\n// The origin is a separate style, chosen from the placement React Aria\n// reports, so the same keyframes serve all four sides.\nconst scaleIn = \"x1k48ry3-B\";\nconst overlay = {\n fromBottom: {\n k3nNDw: \"x18ouj0k\",\n $$css: true\n },\n fromLeft: {\n k3nNDw: \"x1nf803f\",\n $$css: true\n },\n fromRight: {\n k3nNDw: \"xyibjs4\",\n $$css: true\n },\n fromTop: {\n k3nNDw: \"x1dp6rp6\",\n $$css: true\n },\n modalBodyRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n modalDialog: {\n kZKoxP: \"x5yr21d\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kAzted: \"x2lwn1j\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n popup: {\n k44tkh: \"xvhm28k x1u6grsq\",\n kKVMdj: \"x97zbip\",\n kyAemX: \"x16dv9tl\",\n kWkggS: \"x1mjdul6\",\n kVAM5u: \"x1w1tqly\",\n kaIpWk: \"x62ce2h\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x13rsnn2\",\n kGVxlE: \"x1os83gw\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kORKVm: \"x1odjw0f\",\n kZeWKH: \"xish69e\",\n $$css: true\n },\n popupDialog: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x126z3so\",\n $$css: true\n },\n scrim: {\n k44tkh: \"x1vhuh8u\",\n kKVMdj: \"xqcmdr3\",\n kyAemX: \"x1yujl0p\",\n kWkggS: \"x1iqbvzf\",\n kB7OPa: \"x9f619\",\n kpwlN0: \"x10a8y8t\",\n kVAEAm: \"xixxii4\",\n $$css: true\n }\n};\n\n// Which side the surface opened on, and the origin its entry grows from.\n// Keyed on the placement React Aria reports rather than the one asked for,\n// since the surface flips to the opposite side when there is no room on its\n// own; `center` is the placement React Aria reports for an anchor it could\n// not place beside, and grows from the top like the default.\nconst origins = {\n bottom: overlay.fromTop,\n center: overlay.fromTop,\n left: overlay.fromRight,\n right: overlay.fromLeft,\n top: overlay.fromBottom\n};\n\n/** Where along that side it lines up with the anchor. */\ntype OverlayAlign = 'center' | 'end' | 'start';\n\n/** Which side of the anchor a surface opens on. */\ntype OverlaySide = 'bottom' | 'left' | 'right' | 'top';\n\n/**\n * React Aria's placement, from the side and the alignment a call site names.\n * Its own vocabulary pairs a side with `top`/`bottom` on the inline sides and\n * `start`/`end` on the block ones; a call site should not have to know which\n * of the two it is asking for, so this maps one onto the other.\n *\n * Shared by every anchored overlay rather than kept in one, since which side\n * a surface opens on is the same question for a popover, a menu and a\n * tooltip.\n */\nfunction placementOf(side: OverlaySide, align: OverlayAlign) {\n if (align === 'center') {\n return side;\n }\n if (side === 'top' || side === 'bottom') {\n return `${side} ${align}` as const;\n }\n return `${side} ${align === 'start' ? 'top' : 'bottom'}` as const;\n}\n\n/**\n * The origin an anchored surface grows from, for the placement React Aria\n * reports through its render state. `null`, before the surface has been\n * placed, grows from the top as `bottom` does.\n */\nfunction popupOrigin(placement: PopoverRenderProps['placement']) {\n return origins[placement ?? 'bottom'];\n}\nexport type { OverlayAlign, OverlaySide };\nexport { overlay, placementOf, popupOrigin };"],"mappings":";AAwCA,MAAMU,UAAU;CACdC,YAAY;EACVC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRF,QAAQ;EACRC,OAAO;CACT;CACAE,WAAW;EACTH,QAAQ;EACRC,OAAO;CACT;CACAG,SAAS;EACPJ,QAAQ;EACRC,OAAO;CACT;CACAI,eAAe;EACbC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAS,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRP,OAAO;CACT;CACAe,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRb,QAAQ;EACRc,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR3B,OAAO;CACT;CACA4B,aAAa;EACXjB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRgB,QAAQ;EACR7B,OAAO;CACT;CACA8B,OAAO;EACLd,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRR,QAAQ;EACRoB,QAAQ;EACRC,QAAQ;EACRhC,OAAO;CACT;AACF;AAOA,MAAMiC,UAAU;CACdC,QAAQrC,QAAQM;CAChBgC,QAAQtC,QAAQM;CAChBiC,MAAMvC,QAAQK;CACdmC,OAAOxC,QAAQI;CACfqC,KAAKzC,QAAQC;AACf;;;;;;;;;;;AAkBA,SAAS2C,YAAYC,MAAmBC,OAAqB;CAC3D,IAAIA,UAAU,UACZ,OAAOD;CAET,IAAIA,SAAS,SAASA,SAAS,UAC7B,OAAO,GAAGA,KAAI,GAAIC;CAEpB,OAAO,GAAGD,KAAI,GAAIC,UAAU,UAAU,QAAQ;AAChD;;;;;;AAOA,SAASE,YAAYC,WAA4C;CAC/D,OAAOb,QAAQa,aAAa;AAC9B"}
@@ -33,7 +33,7 @@ const picker = {
33
33
  }
34
34
  };
35
35
  function triggerClassName(state) {
36
- return props(iconButton.chrome, focus.ring, state.isDisabled && iconButton.chromeDisabled).className ?? "";
36
+ return props(iconButton.chrome, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? "";
37
37
  }
38
38
  //#endregion
39
39
  export { picker, triggerClassName };
@@ -1 +1 @@
1
- {"version":3,"file":"picker.js","names":["stylex","colors","media","shadows","spacing","focus","iconButton","picker","group","kGNEyG","kB7OPa","k1xSpc","kOIVth","kzqmXN","k3XXqK","$$css","popover","kZKoxP","kGVxlE","krVfgx","k87sOh","kt4wiu","kLqNvP","kogj98","kskxy","ks0D6T","kVAEAm","triggerGlyph","triggerClassName","state","isDisabled","props","chrome","ring","chromeDisabled","className","stylex.props"],"sources":["../../src/styles/picker.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, shadows, spacing } from '../tokens/design.tokens.stylex';\nimport { focus } from './focus';\nimport { iconButton } from './icon-button';\n\n// What a date picker and a date range picker draw in common: the line the\n// segments and the trigger share, the trigger itself, and the surface the\n// calendar opens on. Both put the same three on screen, and the breakpoint\n// swap below is why they are here rather than written twice — a docked\n// picker and a range picker that disagreed about where the modal sits would\n// be two bugs rather than one.\n//\n// In `src/styles` rather than a `src/picker` of its own, since this is\n// styles more than one component draws, which is what that directory holds.\n// Geometry belonging to one picker alone stays with that picker.\n\nconst picker = {\n group: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"x126z3so\",\n kzqmXN: \"xh8yej3\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n popover: {\n kZKoxP: \"x1poebcc\",\n kGVxlE: \"x1os83gw x1l41d60\",\n kzqmXN: \"xpxzbr4\",\n krVfgx: \"xudx362\",\n k87sOh: \"xbvrusa\",\n kt4wiu: \"x1v0tev1\",\n kLqNvP: \"x12sfaok\",\n kogj98: \"xucn3ve\",\n kskxy: \"xmjxpzh\",\n ks0D6T: \"x1x1rfll x1493c6o\",\n kVAEAm: \"x1mesnot\",\n $$css: true\n },\n triggerGlyph: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n }\n};\n\n// The trigger's classes, from React Aria's own render state. A picker's\n// trigger is disabled by the field around it rather than by a prop of its\n// own, so the fade comes off the state React Aria hands the className. It is\n// the same 38% the segments beside it take, so one disabled field fades as a\n// whole.\nfunction triggerClassName(state: {\n isDisabled: boolean;\n}) {\n return stylex.props(iconButton.chrome, focus.ring, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\nexport { picker, triggerClassName };"],"mappings":";;;;AAiBA,MAAMO,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRL,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAY,cAAc;EACZV,QAAQ;EACRJ,QAAQ;EACRE,OAAO;CACT;AACF;AAOA,SAASa,iBAAiBC,OAEvB;CACD,OAAO7B,MAAaM,WAAW0B,QAAQ3B,MAAM4B,MAAMJ,MAAMC,cAAcxB,WAAW4B,cAAc,CAAC,CAACC,aAAa;AACjH"}
1
+ {"version":3,"file":"picker.js","names":["stylex","colors","media","shadows","spacing","focus","iconButton","picker","group","kGNEyG","kB7OPa","k1xSpc","kOIVth","kzqmXN","k3XXqK","$$css","popover","kZKoxP","kGVxlE","krVfgx","k87sOh","kt4wiu","kLqNvP","kogj98","kskxy","ks0D6T","kVAEAm","triggerGlyph","triggerClassName","state","isDisabled","isHovered","isPressed","props","chrome","ring","chromeHovered","chromePressed","chromeDisabled","className","stylex.props"],"sources":["../../src/styles/picker.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, shadows, spacing } from '../tokens/design.tokens.stylex';\nimport { focus } from './focus';\nimport { iconButton } from './icon-button';\n\n// What a date picker and a date range picker draw in common: the line the\n// segments and the trigger share, the trigger itself, and the surface the\n// calendar opens on. Both put the same three on screen, and the breakpoint\n// swap below is why they are here rather than written twice — a docked\n// picker and a range picker that disagreed about where the modal sits would\n// be two bugs rather than one.\n//\n// In `src/styles` rather than a `src/picker` of its own, since this is\n// styles more than one component draws, which is what that directory holds.\n// Geometry belonging to one picker alone stays with that picker.\n\nconst picker = {\n group: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"x126z3so\",\n kzqmXN: \"xh8yej3\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n popover: {\n kZKoxP: \"x1poebcc\",\n kGVxlE: \"x1os83gw x1l41d60\",\n kzqmXN: \"xpxzbr4\",\n krVfgx: \"xudx362\",\n k87sOh: \"xbvrusa\",\n kt4wiu: \"x1v0tev1\",\n kLqNvP: \"x12sfaok\",\n kogj98: \"xucn3ve\",\n kskxy: \"xmjxpzh\",\n ks0D6T: \"x1x1rfll x1493c6o\",\n kVAEAm: \"x1mesnot\",\n $$css: true\n },\n triggerGlyph: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n }\n};\n\n// The trigger's classes, from React Aria's own render state. A picker's\n// trigger is disabled by the field around it rather than by a prop of its\n// own, so the fade comes off the state React Aria hands the className. It is\n// the same 38% the segments beside it take, so one disabled field fades as a\n// whole.\nfunction triggerClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(iconButton.chrome, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\nexport { picker, triggerClassName };"],"mappings":";;;;AAiBA,MAAMO,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRL,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAY,cAAc;EACZV,QAAQ;EACRJ,QAAQ;EACRE,OAAO;CACT;AACF;AAOA,SAASa,iBAAiBC,OAIvB;CACD,OAAO7B,MAAaM,WAAW4B,QAAQ7B,MAAM8B,MAAMN,MAAME,aAAazB,WAAW8B,eAAeP,MAAMG,aAAa1B,WAAW+B,eAAeR,MAAMC,cAAcxB,WAAWgC,cAAc,CAAC,CAACC,aAAa;AAC3M"}