@kanso-labs/kanso-ui 0.45.22 → 0.45.24

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 (247) hide show
  1. package/dist/badge/index.js.map +1 -1
  2. package/dist/button/context.js.map +1 -1
  3. package/dist/button/group.js.map +1 -1
  4. package/dist/button/hooks.js.map +1 -1
  5. package/dist/button/index.d.ts +3 -4
  6. package/dist/button/index.js.map +1 -1
  7. package/dist/button/styles.js.map +1 -1
  8. package/dist/button/toggle.js.map +1 -1
  9. package/dist/calendar/index.js.map +1 -1
  10. package/dist/calendar/styles.js.map +1 -1
  11. package/dist/carousel/arrangement.d.ts +1 -2
  12. package/dist/carousel/arrangement.js.map +1 -1
  13. package/dist/chip/index.js.map +1 -1
  14. package/dist/chip/label.js.map +1 -1
  15. package/dist/chip/styles.js.map +1 -1
  16. package/dist/collection/empty.js.map +1 -1
  17. package/dist/collection/index.js.map +1 -1
  18. package/dist/collection/styles.js.map +1 -1
  19. package/dist/collection/text.js.map +1 -1
  20. package/dist/color-scheme.d.ts +1 -2
  21. package/dist/color-scheme.js.map +1 -1
  22. package/dist/components/app-bar/index.d.ts +1 -2
  23. package/dist/components/app-bar/index.js.map +1 -1
  24. package/dist/components/autocomplete/index.d.ts +1 -2
  25. package/dist/components/autocomplete/index.js.map +1 -1
  26. package/dist/components/avatar/index.d.ts +1 -2
  27. package/dist/components/avatar/index.js.map +1 -1
  28. package/dist/components/badge/index.d.ts +1 -2
  29. package/dist/components/badge/index.js.map +1 -1
  30. package/dist/components/breadcrumbs/index.d.ts +1 -2
  31. package/dist/components/breadcrumbs/index.js.map +1 -1
  32. package/dist/components/button/index.d.ts +1 -2
  33. package/dist/components/button/index.js.map +1 -1
  34. package/dist/components/button-group/index.d.ts +1 -2
  35. package/dist/components/button-group/index.js.map +1 -1
  36. package/dist/components/calendar/index.d.ts +1 -2
  37. package/dist/components/calendar/index.js.map +1 -1
  38. package/dist/components/card/index.d.ts +1 -2
  39. package/dist/components/card/index.js.map +1 -1
  40. package/dist/components/carousel/index.d.ts +1 -2
  41. package/dist/components/carousel/index.js.map +1 -1
  42. package/dist/components/checkbox/index.d.ts +1 -2
  43. package/dist/components/checkbox/index.js.map +1 -1
  44. package/dist/components/checkbox-group/index.d.ts +1 -2
  45. package/dist/components/checkbox-group/index.js.map +1 -1
  46. package/dist/components/chip/index.d.ts +1 -2
  47. package/dist/components/chip/index.js.map +1 -1
  48. package/dist/components/chip-group/index.d.ts +1 -2
  49. package/dist/components/chip-group/index.js.map +1 -1
  50. package/dist/components/code/index.d.ts +1 -2
  51. package/dist/components/code/index.js.map +1 -1
  52. package/dist/components/color-area/index.d.ts +1 -2
  53. package/dist/components/color-area/index.js.map +1 -1
  54. package/dist/components/color-field/index.d.ts +1 -2
  55. package/dist/components/color-field/index.js.map +1 -1
  56. package/dist/components/color-picker/index.d.ts +1 -2
  57. package/dist/components/color-picker/index.js.map +1 -1
  58. package/dist/components/color-slider/index.d.ts +1 -2
  59. package/dist/components/color-slider/index.js.map +1 -1
  60. package/dist/components/color-swatch/index.d.ts +1 -2
  61. package/dist/components/color-swatch/index.js.map +1 -1
  62. package/dist/components/color-swatch-picker/index.d.ts +1 -2
  63. package/dist/components/color-swatch-picker/index.js.map +1 -1
  64. package/dist/components/color-wheel/index.d.ts +1 -2
  65. package/dist/components/color-wheel/index.js.map +1 -1
  66. package/dist/components/combo-box/index.d.ts +1 -2
  67. package/dist/components/combo-box/index.js.map +1 -1
  68. package/dist/components/container/index.d.ts +1 -2
  69. package/dist/components/container/index.js.map +1 -1
  70. package/dist/components/copy-field/index.d.ts +1 -2
  71. package/dist/components/copy-field/index.js.map +1 -1
  72. package/dist/components/currency/index.d.ts +1 -2
  73. package/dist/components/currency/index.js.map +1 -1
  74. package/dist/components/date-field/index.d.ts +1 -2
  75. package/dist/components/date-field/index.js.map +1 -1
  76. package/dist/components/date-picker/index.d.ts +1 -2
  77. package/dist/components/date-picker/index.js.map +1 -1
  78. package/dist/components/date-range-picker/index.d.ts +1 -2
  79. package/dist/components/date-range-picker/index.js.map +1 -1
  80. package/dist/components/dialog/index.d.ts +1 -2
  81. package/dist/components/dialog/index.js.map +1 -1
  82. package/dist/components/disclosure/index.d.ts +1 -2
  83. package/dist/components/disclosure/index.js.map +1 -1
  84. package/dist/components/disclosure-group/index.d.ts +1 -2
  85. package/dist/components/disclosure-group/index.js.map +1 -1
  86. package/dist/components/drop-zone/index.d.ts +1 -2
  87. package/dist/components/drop-zone/index.js.map +1 -1
  88. package/dist/components/drop-zone/styles.js.map +1 -1
  89. package/dist/components/fab/index.d.ts +1 -2
  90. package/dist/components/fab/index.js.map +1 -1
  91. package/dist/components/fab-menu/index.d.ts +1 -2
  92. package/dist/components/fab-menu/index.js.map +1 -1
  93. package/dist/components/feed/index.d.ts +1 -2
  94. package/dist/components/feed/index.js.map +1 -1
  95. package/dist/components/form/index.d.ts +1 -2
  96. package/dist/components/form/index.js.map +1 -1
  97. package/dist/components/icon-button/index.d.ts +1 -2
  98. package/dist/components/icon-button/index.js.map +1 -1
  99. package/dist/components/keycap/index.d.ts +1 -2
  100. package/dist/components/keycap/index.js.map +1 -1
  101. package/dist/components/link/index.d.ts +1 -2
  102. package/dist/components/link/index.js.map +1 -1
  103. package/dist/components/list/index.d.ts +1 -2
  104. package/dist/components/list/index.js.map +1 -1
  105. package/dist/components/list-box/index.d.ts +1 -2
  106. package/dist/components/list-box/index.js.map +1 -1
  107. package/dist/components/list-detail/index.d.ts +1 -2
  108. package/dist/components/list-detail/index.js.map +1 -1
  109. package/dist/components/list-item/index.d.ts +1 -2
  110. package/dist/components/list-item/index.js.map +1 -1
  111. package/dist/components/loading-indicator/index.d.ts +1 -2
  112. package/dist/components/loading-indicator/index.js.map +1 -1
  113. package/dist/components/menu/index.d.ts +1 -2
  114. package/dist/components/menu/index.js.map +1 -1
  115. package/dist/components/meter/index.d.ts +1 -2
  116. package/dist/components/meter/index.js.map +1 -1
  117. package/dist/components/navigation-bar/index.d.ts +1 -2
  118. package/dist/components/navigation-bar/index.js.map +1 -1
  119. package/dist/components/navigation-rail/index.d.ts +1 -2
  120. package/dist/components/navigation-rail/index.js.map +1 -1
  121. package/dist/components/navigation-tree/index.d.ts +1 -2
  122. package/dist/components/navigation-tree/index.js.map +1 -1
  123. package/dist/components/number-field/index.d.ts +1 -2
  124. package/dist/components/number-field/index.js.map +1 -1
  125. package/dist/components/popover/index.d.ts +1 -2
  126. package/dist/components/popover/index.js.map +1 -1
  127. package/dist/components/product-icon/index.d.ts +1 -2
  128. package/dist/components/product-icon/index.js.map +1 -1
  129. package/dist/components/progress-indicator/index.d.ts +1 -2
  130. package/dist/components/progress-indicator/index.js.map +1 -1
  131. package/dist/components/radio-group/index.d.ts +1 -2
  132. package/dist/components/radio-group/index.js.map +1 -1
  133. package/dist/components/range-calendar/index.d.ts +1 -2
  134. package/dist/components/range-calendar/index.js.map +1 -1
  135. package/dist/components/search-field/index.d.ts +1 -2
  136. package/dist/components/search-field/index.js.map +1 -1
  137. package/dist/components/search-view/index.d.ts +1 -2
  138. package/dist/components/search-view/index.js.map +1 -1
  139. package/dist/components/segmented-button/index.d.ts +1 -2
  140. package/dist/components/segmented-button/index.js.map +1 -1
  141. package/dist/components/select/index.d.ts +1 -2
  142. package/dist/components/select/index.js.map +1 -1
  143. package/dist/components/separator/index.d.ts +1 -2
  144. package/dist/components/separator/index.js.map +1 -1
  145. package/dist/components/sheet/index.d.ts +1 -2
  146. package/dist/components/sheet/index.js.map +1 -1
  147. package/dist/components/slider/index.d.ts +1 -2
  148. package/dist/components/slider/index.js.map +1 -1
  149. package/dist/components/snackbar/index.d.ts +1 -2
  150. package/dist/components/snackbar/index.js.map +1 -1
  151. package/dist/components/split-button/index.d.ts +1 -2
  152. package/dist/components/split-button/index.js.map +1 -1
  153. package/dist/components/stack/index.d.ts +1 -2
  154. package/dist/components/stack/index.js.map +1 -1
  155. package/dist/components/supporting-pane/index.d.ts +1 -2
  156. package/dist/components/supporting-pane/index.js.map +1 -1
  157. package/dist/components/switch/index.d.ts +1 -2
  158. package/dist/components/switch/index.js.map +1 -1
  159. package/dist/components/table/index.d.ts +1 -2
  160. package/dist/components/table/index.js.map +1 -1
  161. package/dist/components/tabs/index.d.ts +1 -2
  162. package/dist/components/tabs/index.js.map +1 -1
  163. package/dist/components/tag/index.d.ts +1 -2
  164. package/dist/components/tag/index.js.map +1 -1
  165. package/dist/components/text/index.d.ts +1 -2
  166. package/dist/components/text/index.js.map +1 -1
  167. package/dist/components/text-area/index.d.ts +1 -2
  168. package/dist/components/text-area/index.js.map +1 -1
  169. package/dist/components/text-field/index.d.ts +1 -2
  170. package/dist/components/text-field/index.js.map +1 -1
  171. package/dist/components/time-field/index.d.ts +1 -2
  172. package/dist/components/time-field/index.js.map +1 -1
  173. package/dist/components/time-picker/index.d.ts +1 -2
  174. package/dist/components/time-picker/index.js.map +1 -1
  175. package/dist/components/token-field/index.d.ts +1 -2
  176. package/dist/components/token-field/index.js.map +1 -1
  177. package/dist/components/toolbar/index.d.ts +1 -2
  178. package/dist/components/toolbar/index.js.map +1 -1
  179. package/dist/components/tooltip/index.d.ts +1 -2
  180. package/dist/components/tooltip/index.js.map +1 -1
  181. package/dist/components/tree/index.d.ts +1 -2
  182. package/dist/components/tree/index.js.map +1 -1
  183. package/dist/control/index.js.map +1 -1
  184. package/dist/control/styles.js.map +1 -1
  185. package/dist/drag/hooks.d.ts +1 -2
  186. package/dist/drag/hooks.js.map +1 -1
  187. package/dist/drag/index.js.map +1 -1
  188. package/dist/drag/styles.js.map +1 -1
  189. package/dist/fab/styles.js.map +1 -1
  190. package/dist/field/index.d.ts +3 -4
  191. package/dist/field/index.js.map +1 -1
  192. package/dist/field/press.js.map +1 -1
  193. package/dist/field/root.js.map +1 -1
  194. package/dist/field/styles.js.map +1 -1
  195. package/dist/glyphs/index.js.map +1 -1
  196. package/dist/glyphs/styles.js.map +1 -1
  197. package/dist/hooks/useAppBarScroll.d.ts +1 -2
  198. package/dist/hooks/useAppBarScroll.js.map +1 -1
  199. package/dist/hooks/useBottomEdge.js.map +1 -1
  200. package/dist/hooks/useClippedTitle.js.map +1 -1
  201. package/dist/hooks/useImageLoadingStatus.js.map +1 -1
  202. package/dist/hooks/useRipple.js.map +1 -1
  203. package/dist/hooks/useScrollStop.js.map +1 -1
  204. package/dist/hooks/useToggleGroupDisabled.js.map +1 -1
  205. package/dist/i18n/index.js.map +1 -1
  206. package/dist/i18n/messages.js.map +1 -1
  207. package/dist/indicator/index.js.map +1 -1
  208. package/dist/indicator/styles.d.ts +1 -2
  209. package/dist/indicator/styles.js.map +1 -1
  210. package/dist/kanso-ui-core/defaults-DMH0HWCw.d.ts +1 -2
  211. package/dist/keycap/context.js.map +1 -1
  212. package/dist/layout.d.ts +1 -2
  213. package/dist/layout.js.map +1 -1
  214. package/dist/mark/index.js.map +1 -1
  215. package/dist/mark/initials.js.map +1 -1
  216. package/dist/mark/styles.js.map +1 -1
  217. package/dist/navigation/context.js.map +1 -1
  218. package/dist/navigation/index.d.ts +2 -3
  219. package/dist/navigation/index.js.map +1 -1
  220. package/dist/navigation/styles.js.map +1 -1
  221. package/dist/overlay/index.js.map +1 -1
  222. package/dist/render/aria.js.map +1 -1
  223. package/dist/render/content.js.map +1 -1
  224. package/dist/render/name.d.ts +1 -2
  225. package/dist/render/ref.js.map +1 -1
  226. package/dist/render/useRender.d.ts +1 -2
  227. package/dist/render/useRender.js.map +1 -1
  228. package/dist/row/index.js.map +1 -1
  229. package/dist/row/styles.js.map +1 -1
  230. package/dist/segments/index.js.map +1 -1
  231. package/dist/segments/styles.js.map +1 -1
  232. package/dist/styles/chequer.js.map +1 -1
  233. package/dist/styles/color.js.map +1 -1
  234. package/dist/styles/focus.js.map +1 -1
  235. package/dist/styles/icon-button.js.map +1 -1
  236. package/dist/styles/merge.js.map +1 -1
  237. package/dist/styles/overlay.d.ts +2 -3
  238. package/dist/styles/overlay.js.map +1 -1
  239. package/dist/styles/picker.js.map +1 -1
  240. package/dist/styles/ripple.js.map +1 -1
  241. package/dist/styles/scheme.js.map +1 -1
  242. package/dist/swatch/index.js.map +1 -1
  243. package/dist/theme-scope.d.ts +1 -2
  244. package/dist/theme-scope.js.map +1 -1
  245. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  246. package/dist/tokens/values.js.map +1 -1
  247. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","CSSProperties","RefAttributes","ColorAreaProps","RACColorAreaProps","stylex","ColorArea","RACColorArea","ColorThumb","RACColorThumb","thumbClassName","mergeStyles","radii","stateLayerOpacity","Omit","className","style","t0","$","props","ref","t1","isDisabled","undefined","t2","0","1","t3","Symbol","for","t4","t5","t6","t7","ColorArea","_c","RACColorThumb","RACColorArea"],"sources":["../../../src/components/color-area/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } from 'react';\nimport type { ColorAreaProps as RACColorAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorArea as RACColorArea, ColorThumb as RACColorThumb } from 'react-aria-components';\nimport { thumbClassName } from '../../styles/color';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// Two channels of a colour at once, as a plane: one runs along the inline\n// axis and one along the block axis, and the handle sits where they meet.\n// React Aria paints both gradients on the plane's own inline `background`\n// and moves the handle in two axes, so what is here is the plane's shape and\n// the handle `ColorSlider` already draws, from `src/styles/color.ts`.\n//\n// The design carries no page for this, so the two choices below are the\n// library's own.\n//\n// **It is square, and takes the width it is given.** A plane has no natural\n// size, and a box that was not square would give its two channels unequal\n// travel — the same drag would move one further than the other, which is a\n// difference a reader cannot see and would feel as the control being wrong.\n//\n// **It carries no chequer, unlike a swatch or a colour slider's alpha\n// track.** Those two show the surface behind them where a colour thins out,\n// and a plane does not: React Aria stacks its gradients so the topmost is\n// opaque across the whole box, so nothing laid behind the plane is ever\n// seen. A chequer here was written first and then taken out, because it\n// could not be made to show under any pairing tried — including the RGB\n// alpha pairing whose gradient really does carry a `rgba(0, 0, 0, 0)` stop.\n//\n// **Alpha is a channel here only in RGB, and even there it does not thin\n// the plane.** Asked for it in HSL, React Aria draws the saturation and\n// lightness plane instead and says nothing — the gradients come out\n// identical to the pair it would have drawn anyway. It does not throw the\n// way an unknown channel does, so the only sign is a plane that will not\n// change, which is why it is written down here.\n\ntype ColorAreaProps = Omit<RACColorAreaProps, 'children' | 'className' | 'style'> & {\n /**\n * Lands on the square around the plane, which is the element a layout\n * positions and the one that carries its size.\n */\n className?: string;\n /** Lands on the square around the plane, as `className` does. */\n style?: CSSProperties;\n};\n\n/**\n * Two channels of a colour as a plane, with a handle where they meet. The\n * value is React Aria's: pass `value` with `onChange` to control it, or\n * `defaultValue`, as a CSS colour string or a `Color` from `parseColor`,\n * which this package re-exports.\n *\n * ```tsx\n * <ColorArea\n * defaultValue=\"hsl(200, 100%, 50%)\"\n * xChannel=\"saturation\"\n * yChannel=\"lightness\"\n * />\n * ```\n *\n * **`xChannel` and `yChannel` have to name channels the value's own space\n * has.** A hex or `rgb()` value parses as RGB, which has no saturation, so\n * naming one against it throws rather than converting — pass `colorSpace` to\n * convert it, or give the value in the space you mean to work in. The same\n * trap `ColorSlider` documents.\n *\n * **`alpha` is a channel here only in RGB.** Asked for it in HSL, React Aria\n * quietly draws the saturation and lightness plane instead, so a plane that\n * will not fade is the only sign anything was ignored.\n *\n * React Aria names the handle \"Color picker\" and announces both channels;\n * pass `aria-label` to say what the plane is for instead.\n *\n * The call site's `className` and `style` land on the square around the\n * plane rather than on the plane itself, so setting an `inlineSize` is what\n * resizes one — and it stays square, since two channels sharing a box want\n * equal travel. React Aria's function forms are not taken here for the same\n * reason `ColorSwatch` does not take them: the element they would read\n * state for is not the one a layout reaches.\n */\n// The ref lands on the chequered ground, the element the call site's class\n// and style do, rather than on React Aria's area inside it.\nfunction ColorArea({\n className,\n isDisabled = false,\n ref,\n style,\n ...props\n}: ColorAreaProps & RefAttributes<HTMLDivElement>) {\n return <div ref={ref} {...mergeStyles({\n 0: {\n className: \"x1plog1 x1xdvaa9 x9f619 xh8yej3\"\n },\n 1: {\n className: \"x1plog1 x1xdvaa9 x9f619 xh8yej3 x1ppv7y9\"\n }\n }[!!isDisabled << 0], {\n className,\n style\n })}>\n <RACColorArea isDisabled={isDisabled} {...props} {...{\n 0: {\n className: \"x5yr21d x1xdvaa9 x9f619 xsid9ct xh8yej3 x5ve5x3\"\n },\n 1: {\n className: \"x5yr21d x1xdvaa9 x9f619 xh8yej3 x5ve5x3 x1h6gzvc\"\n }\n }[!!isDisabled << 0]}>\n <RACColorThumb className={thumbClassName} />\n </RACColorArea>\n </div>;\n}\nexport type { ColorAreaProps };\nexport default ColorArea;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,SAAAO,YAAAW,IAAA;CAAA,MAAAC,IAAAlB,EAAA,EAAA;CAAA,IAAAe;CAAA,IAAAI;CAAA,IAAAC;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAF,WAAAO,YAAAD,IAAAD,KAAAJ,OAAA,GAAAG,SAAAF;EAM8BC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAA;EAAAN,YAAAG,EAAA;EAAAC,QAAAD,EAAA;EAAAE,MAAAF,EAAA;EAAAF,QAAAE,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAJ/C,MAAAI,aAAAD,OAAAE,KAAAA,IAAA,QAAAF;CAAkB,IAAAG;CAAA,IAAAN,EAAA,OAAAH,aAAAG,EAAA,OAAAI,cAAAJ,EAAA,OAAAF,OAAA;EAKQQ,KAAAb,YAAY;GAAAc,GACjC,EAAAV,WACU,kCACb;GAACW,GACE,EAAA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","$","props","ref","t1","isDisabled","undefined","t2","0","1","t3","Symbol","for","t4","t5","t6","t7","RACColorThumb","RACColorArea"],"sources":["../../../src/components/color-area/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } from 'react';\nimport type { ColorAreaProps as RACColorAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorArea as RACColorArea, ColorThumb as RACColorThumb } from 'react-aria-components';\nimport { thumbClassName } from '../../styles/color';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// Two channels of a colour at once, as a plane: one runs along the inline\n// axis and one along the block axis, and the handle sits where they meet.\n// React Aria paints both gradients on the plane's own inline `background`\n// and moves the handle in two axes, so what is here is the plane's shape and\n// the handle `ColorSlider` already draws, from `src/styles/color.ts`.\n//\n// The design carries no page for this, so the two choices below are the\n// library's own.\n//\n// **It is square, and takes the width it is given.** A plane has no natural\n// size, and a box that was not square would give its two channels unequal\n// travel — the same drag would move one further than the other, which is a\n// difference a reader cannot see and would feel as the control being wrong.\n//\n// **It carries no chequer, unlike a swatch or a colour slider's alpha\n// track.** Those two show the surface behind them where a colour thins out,\n// and a plane does not: React Aria stacks its gradients so the topmost is\n// opaque across the whole box, so nothing laid behind the plane is ever\n// seen. A chequer here was written first and then taken out, because it\n// could not be made to show under any pairing tried — including the RGB\n// alpha pairing whose gradient really does carry a `rgba(0, 0, 0, 0)` stop.\n//\n// **Alpha is a channel here only in RGB, and even there it does not thin\n// the plane.** Asked for it in HSL, React Aria draws the saturation and\n// lightness plane instead and says nothing — the gradients come out\n// identical to the pair it would have drawn anyway. It does not throw the\n// way an unknown channel does, so the only sign is a plane that will not\n// change, which is why it is written down here.\n\ntype ColorAreaProps = Omit<RACColorAreaProps, 'children' | 'className' | 'style'> & {\n /**\n * Lands on the square around the plane, which is the element a layout\n * positions and the one that carries its size.\n */\n className?: string;\n /** Lands on the square around the plane, as `className` does. */\n style?: CSSProperties;\n};\n\n/**\n * Two channels of a colour as a plane, with a handle where they meet. The\n * value is React Aria's: pass `value` with `onChange` to control it, or\n * `defaultValue`, as a CSS colour string or a `Color` from `parseColor`,\n * which this package re-exports.\n *\n * ```tsx\n * <ColorArea\n * defaultValue=\"hsl(200, 100%, 50%)\"\n * xChannel=\"saturation\"\n * yChannel=\"lightness\"\n * />\n * ```\n *\n * **`xChannel` and `yChannel` have to name channels the value's own space\n * has.** A hex or `rgb()` value parses as RGB, which has no saturation, so\n * naming one against it throws rather than converting — pass `colorSpace` to\n * convert it, or give the value in the space you mean to work in. The same\n * trap `ColorSlider` documents.\n *\n * **`alpha` is a channel here only in RGB.** Asked for it in HSL, React Aria\n * quietly draws the saturation and lightness plane instead, so a plane that\n * will not fade is the only sign anything was ignored.\n *\n * React Aria names the handle \"Color picker\" and announces both channels;\n * pass `aria-label` to say what the plane is for instead.\n *\n * The call site's `className` and `style` land on the square around the\n * plane rather than on the plane itself, so setting an `inlineSize` is what\n * resizes one — and it stays square, since two channels sharing a box want\n * equal travel. React Aria's function forms are not taken here for the same\n * reason `ColorSwatch` does not take them: the element they would read\n * state for is not the one a layout reaches.\n */\n// The ref lands on the chequered ground, the element the call site's class\n// and style do, rather than on React Aria's area inside it.\nfunction ColorArea({\n className,\n isDisabled = false,\n ref,\n style,\n ...props\n}: ColorAreaProps & RefAttributes<HTMLDivElement>) {\n return <div ref={ref} {...mergeStyles({\n 0: {\n className: \"x1plog1 x1xdvaa9 x9f619 xh8yej3\"\n },\n 1: {\n className: \"x1plog1 x1xdvaa9 x9f619 xh8yej3 x1ppv7y9\"\n }\n }[!!isDisabled << 0], {\n className,\n style\n })}>\n <RACColorArea isDisabled={isDisabled} {...props} {...{\n 0: {\n className: \"x5yr21d x1xdvaa9 x9f619 xsid9ct xh8yej3 x5ve5x3\"\n },\n 1: {\n className: \"x5yr21d x1xdvaa9 x9f619 xh8yej3 x5ve5x3 x1h6gzvc\"\n }\n }[!!isDisabled << 0]}>\n <RACColorThumb className={thumbClassName} />\n </RACColorArea>\n </div>;\n}\nexport type { ColorAreaProps };\nexport default ColorArea;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,SAAAC,YAAAK,IAAA;CAAA,MAAAC,IAAAP,EAAA,EAAA;CAAA,IAAAI;CAAA,IAAAI;CAAA,IAAAC;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAF,WAAAO,YAAAD,IAAAD,KAAAJ,OAAA,GAAAG,SAAAF;EAM8BC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAA;EAAAN,YAAAG,EAAA;EAAAC,QAAAD,EAAA;EAAAE,MAAAF,EAAA;EAAAF,QAAAE,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAJ/C,MAAAI,aAAAD,OAAAE,KAAAA,IAAA,QAAAF;CAAkB,IAAAG;CAAA,IAAAN,EAAA,OAAAH,aAAAG,EAAA,OAAAI,cAAAJ,EAAA,OAAAF,OAAA;EAKQQ,KAAAV,YAAY;GAAAW,GACjC,EAAAV,WACU,kCACb;GAACW,GACE,EAAAX,WACU,2CACb;EACF,EAAE,CAAC,CAACO,cAAc,IAAI;GAAAP;GAAAC;EAGtB,CAAC;EAACE,EAAA,KAAAH;EAAAG,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAU,OAAAC,IAAA,2BAAA,GAAA;EACuDF,KAAA;GAAAF,GAClD,EAAAV,WACU,kDACb;GAACW,GACE,EAAAX,WACU,mDACb;EACF;EAACG,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAPsD,MAAAY,KAAAH,GAOrD,CAAC,CAACL,cAAc;CAAE,IAAAS;CAAA,IAAAb,EAAA,QAAAU,OAAAC,IAAA,2BAAA,GAAA;EAChBE,KAAA,oBAACG,YAAD,EAA0BrB,WAAAA,eAAc,CAAA;EAAIK,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,QAAAI,cAAAJ,EAAA,QAAAC,SAAAD,EAAA,QAAAY,IAAA;EAR9CE,KAAA,oBAACG,WAAD;GAA0Bb;GAAU,GAAMH;GAAK,GAAMW;GAQnDC,UAAAA;EARW,CAAA;EASEb,EAAA,MAAAI;EAAAJ,EAAA,MAAAC;EAAAD,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAE,OAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAc,IAAA;EApBZC,KAAA,oBAAA,OAAA;GAAUb;GAAG,GAAMI;GAWtBQ,UAAAA;EAUI,CAAA;EAAAd,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAc;EAAAd,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OArBDe;AAqBC"}
@@ -65,5 +65,4 @@ type ColorFieldProps$1 = {
65
65
  * the field as a whole, which is the element a layout positions.
66
66
  */
67
67
  declare function ColorField$1({ description, error, floatingLabel, inputRef, isDisabled, label, leadingIcon, trailingIcon, variant, ...props }: ColorFieldProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
68
- export { type ColorFieldProps$1 as ColorFieldProps, ColorField$1 as default };
69
- //# sourceMappingURL=index.d.ts.map
68
+ export { type ColorFieldProps$1 as ColorFieldProps, ColorField$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","ColorFieldProps","RACColorFieldProps","stylex","ColorField","RACColorField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","className","description","error","floatingLabel","inputRef","HTMLInputElement","label","leadingIcon","style","trailingIcon","variant","Omit","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","t7","isRequired","t8","t9","ColorField","_c","props","RACColorField","stylex.props"],"sources":["../../../src/components/color-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ColorFieldProps as RACColorFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorField as RACColorField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A colour typed rather than picked. React Aria renders a plain text input\n// holding the colour's own notation, so this is the text fields page's box\n// with nothing added — the same chrome `TextField` draws through, which is\n// what makes a colour field on a form the same shape as the field beside\n// it.\n//\n// Two things are worth knowing about what it holds.\n//\n// **`channel` turns it from a colour into a number.** Without one the field\n// holds the whole colour — `#6750A4` — and parses what is typed. With one\n// it holds that channel alone, as a number a reader can step, which is what\n// a picker's three boxes beside a plane are.\n//\n// **A swatch is the natural leading icon.** The field's value is a colour,\n// and the chrome already has a slot for something at the box's leading end;\n// passing a `ColorSwatch` there is what makes the field show the colour it\n// holds. It is left to the call site rather than drawn here, since a field\n// inside a picker sits beside a swatch already.\n\ntype ColorFieldProps = {\n /** A function may compute the class from the field's render state. */\n className?: RACColorFieldProps['className'];\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. A\n * `ColorSwatch` shows the value. An icon drawn in `em` takes that size\n * from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACColorFieldProps['style'];\n /**\n * An icon at the box's trailing end, in the page's 24dp size. An icon\n * drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACColorFieldProps, 'children' | 'className' | 'style'>;\n\n/**\n * A colour typed into a field. The value is React Aria's — pass `value` with\n * `onChange` to control it, or `defaultValue` — as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorField defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * Without `channel` the field holds the whole colour and parses what is\n * typed; with one it holds that channel alone as a number. `colorSpace`\n * decides which space a channel belongs to, the same as on `ColorSlider`.\n *\n * The box, label and message are the field chrome in `src/field`, shared\n * with every other field. The call site's `className` and `style` land on\n * the field as a whole, which is the element a layout positions.\n */\nfunction ColorField({\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: ColorFieldProps & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACColorField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput ref={inputRef} />\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACColorField>;\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AAA,KAAAK,QAAAS;EAAAd,EAAA,KAAAY;EAAAZ,EAAA,KAAAJ;EAAAI,EAAA,MAAAH;EAAAG,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAZ,eAAAY,EAAA,QAAAX,OAAA;EACX0B,KAAA,oBAAC,cAAD;GAA2B3B;GAAoBC;EAAK,CAAA;EAAIW,EAAA,MAAAZ;EAAAY,EAAA,MAAAX;EAAAW,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,QAAAQ,MAAAR,EAAA,QAAAE,cAAAF,EAAA,QAAAK,WAAAL,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAa,MAAAb,EAAA,QAAAe,MAAAf,EAAA,QAAAO,oBAAA;EAJrDS,KAAA,qBAAC,IAAD;GAA2Bd;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA7H,UAAA,CACHG,IAGAE,EAJiB;;EAKHf,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAO;EAAAP,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OALXgB;AAKW"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","ColorField","RACColorField","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","description","error","floatingLabel","inputRef","label","leadingIcon","trailingIcon","variant","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","t7","isRequired","t8","t9"],"sources":["../../../src/components/color-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ColorFieldProps as RACColorFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorField as RACColorField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A colour typed rather than picked. React Aria renders a plain text input\n// holding the colour's own notation, so this is the text fields page's box\n// with nothing added — the same chrome `TextField` draws through, which is\n// what makes a colour field on a form the same shape as the field beside\n// it.\n//\n// Two things are worth knowing about what it holds.\n//\n// **`channel` turns it from a colour into a number.** Without one the field\n// holds the whole colour — `#6750A4` — and parses what is typed. With one\n// it holds that channel alone, as a number a reader can step, which is what\n// a picker's three boxes beside a plane are.\n//\n// **A swatch is the natural leading icon.** The field's value is a colour,\n// and the chrome already has a slot for something at the box's leading end;\n// passing a `ColorSwatch` there is what makes the field show the colour it\n// holds. It is left to the call site rather than drawn here, since a field\n// inside a picker sits beside a swatch already.\n\ntype ColorFieldProps = {\n /** A function may compute the class from the field's render state. */\n className?: RACColorFieldProps['className'];\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. A\n * `ColorSwatch` shows the value. An icon drawn in `em` takes that size\n * from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACColorFieldProps['style'];\n /**\n * An icon at the box's trailing end, in the page's 24dp size. An icon\n * drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACColorFieldProps, 'children' | 'className' | 'style'>;\n\n/**\n * A colour typed into a field. The value is React Aria's — pass `value` with\n * `onChange` to control it, or `defaultValue` — as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorField defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * Without `channel` the field holds the whole colour and parses what is\n * typed; with one it holds that channel alone as a number. `colorSpace`\n * decides which space a channel belongs to, the same as on `ColorSlider`.\n *\n * The box, label and message are the field chrome in `src/field`, shared\n * with every other field. The call site's `className` and `style` land on\n * the field as a whole, which is the element a layout positions.\n */\nfunction ColorField({\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: ColorFieldProps & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACColorField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput ref={inputRef} />\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACColorField>;\n}\nexport type { ColorFieldProps };\nexport default ColorField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,SAAAE,aAAAc,IAAA;CAAA,MAAAC,IAAAjB,EAAA,EAAA;CAAoB,MAAA,EAAAQ,aAAAC,OAAAC,eAAAQ,IAAAP,UAAAQ,YAAAC,IAAAR,OAAAC,aAAAC,cAAAC,SAAAM,IAAA,GAAAC,YAAAN;CAGlB,MAAAN,gBAAAQ,OAAAK,KAAAA,IAAA,OAAAL;CAEA,MAAAC,aAAAC,OAAAG,KA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AA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,QAAAQ,MAAAR,EAAA,QAAAE,cAAAF,EAAA,QAAAK,WAAAL,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAa,MAAAb,EAAA,QAAAe,MAAAf,EAAA,QAAAO,oBAAA;EAJrDS,KAAA,qBAAC,IAAD;GAA2Bd;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA7H,UAAA,CACHG,IAGAE,EAJiB;;EAKHf,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAO;EAAAP,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OALXgB;AAKW"}
@@ -59,5 +59,4 @@ type ColorPickerProps$1 = Omit<ColorPickerProps, 'children'> & {
59
59
  * element a layout positions.
60
60
  */
61
61
  declare function ColorPicker$1({ alpha, children, className, container, defaultOpen, isDisabled, isOpen, label, onOpenChange, ref, style, ...props }: ColorPickerProps$1 & RefAttributes<HTMLButtonElement>): import("react").JSX.Element;
62
- export { type ColorPickerProps$1 as ColorPickerProps, ColorPicker$1 as default };
63
- //# sourceMappingURL=index.d.ts.map
62
+ export { type ColorPickerProps$1 as ColorPickerProps, ColorPicker$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","CSSProperties","ReactNode","RefAttributes","ButtonRenderProps","ColorPickerProps","RACColorPickerProps","stylex","parseColor","Button","RACButton","ColorPicker","RACColorPicker","Dialog","RACDialog","DialogTrigger","RACDialogTrigger","Popover","RACPopover","useLocale","focus","mergeStatefulStyles","overlay","popoverClassName","SwatchSquareContext","colors","radii","spacing","stateLayerOpacity","typography","ColorArea","ColorField","ColorSlider","ColorSwatch","styles","triggerSwatch","kZKoxP","kmuXW","kzqmXN","$$css","triggerSwatchDisabled","kSiTet","DISABLED_TRIGGER_SWATCH","triggerStyles","base","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","k8WAf4","kg3NbH","disabled","hovered","pressed","Omit","alpha","children","className","container","Element","defaultOpen","isDisabled","isOpen","label","onOpenChange","style","CHANNELS","t0","$","props","ref","t1","t2","undefined","locale","t3","_temp","t4","state_0","state","t5","t6","Symbol","for","popupDialog","ring","t7","getChannelName","t8","t9","t10","t11","isHovered","isPressed","ColorPicker","_c","props","ColorSwatch","RACButton","stylex.props","ColorArea","ColorSlider","ColorField","RACDialog","RACPopover","RACDialogTrigger","RACColorPicker"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } from 'react';\nimport type { ButtonRenderProps, ColorPickerProps as RACColorPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { parseColor, Button as RACButton, ColorPicker as RACColorPicker, Dialog as RACDialog, DialogTrigger as RACDialogTrigger, Popover as RACPopover, useLocale } from 'react-aria-components';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { popoverClassName } from '../../styles/picker';\nimport { SwatchSquareContext } from '../../swatch';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport ColorArea from '../color-area';\nimport ColorField from '../color-field';\nimport ColorSlider from '../color-slider';\nimport ColorSwatch from '../color-swatch';\n\n// Everything in this phase, in one control: a swatch and a label as the\n// trigger, and a plane, a hue slider, an alpha slider and a text field on\n// the surface it opens. React Aria's `ColorPicker` renders nothing of its\n// own — it is the state the five share — so what is here is the trigger,\n// the overlay and the arrangement inside it.\n//\n// The design carries no page for a colour picker. What it does carry is the\n// text fields page, which the field inside this one already draws through,\n// and the overlay surface every popover here shares. Three choices are the\n// library's own.\n//\n// **The trigger is a swatch beside a name, not a swatch alone.** A swatch\n// on its own is a coloured square with no affordance — nothing says it can\n// be pressed, and a screen reader is told a colour rather than an action.\n// The label is what makes it a button.\n//\n// **Hue is a slider rather than a wheel here.** A wheel and the plane want\n// the same space and would make the surface square and large; the strip\n// sits under the plane at the width it already has. `ColorWheel` is for a\n// picker that wants to be round, which is a different shape rather than a\n// different control.\n//\n// **It is docked above the medium breakpoint and modal below it**, centred\n// over a scrim there — the same swap `DatePicker` makes, at the width `Sheet`\n// changes presentation too, and the shared one in `src/styles/picker.ts`\n// rather than a third copy. A 280dp surface anchored to a trigger is\n// unreachable at 375px.\n//\n// One thing the picker has to do that its parts do not. **The plane and the\n// hue strip are pinned to HSL.** A channel has to belong to the value's own\n// space or React Aria throws, and a hex parses as RGB, which has no\n// saturation — so `<ColorPicker defaultValue=\"#6750A4\" />`, the call anyone\n// writes first, would throw outright. Converting here is what makes the\n// picker take any notation, and it costs the caller nothing: the value\n// handed back is still in whatever they passed.\n\nconst styles = {\n triggerSwatch: {\n kZKoxP: \"xxk0z11\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n triggerSwatchDisabled: {\n kSiTet: \"x1ppv7y9\",\n $$css: true\n }\n};\n\n// Hoisted so the context is handed one array rather than a new one on every\n// render, which would re-render every swatch reading it.\nconst DISABLED_TRIGGER_SWATCH = [styles.triggerSwatch, styles.triggerSwatchDisabled];\nconst triggerStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n disabled: {\n kWkggS: \"x19v6zzp\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n hovered: {\n kWkggS: \"x1ei6177\",\n $$css: true\n },\n pressed: {\n kWkggS: \"x1vt8e7r\",\n $$css: true\n }\n};\ntype ColorPickerProps = Omit<RACColorPickerProps, 'children'> & {\n /** Whether the alpha strip is drawn under the hue one. @default false */\n alpha?: boolean;\n /** Replaces everything on the surface, for a picker that arranges its own parts. */\n children?: ReactNode;\n /** Lands on the trigger, which is the element a layout positions. */\n className?: string;\n /**\n * Where to portal the surface. Defaults to the container of the `ThemeScope`\n * around it, which keeps the surface on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the surface\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /** Whether the surface starts open. Uncontrolled; pair `isOpen` with `onOpenChange` instead. */\n defaultOpen?: boolean;\n /**\n * Whether the whole picker is inert — the trigger, and the plane, strips\n * and field on the surface, which can be on screen while disabled since\n * the surface opens independently of the trigger. An arrangement passed\n * as `children` is the call site's own to disable.\n * @default false\n */\n isDisabled?: boolean;\n /** Whether the surface is open. Controlled; needs `onOpenChange`. */\n isOpen?: boolean;\n /** What the trigger says beside its swatch. Always rendered; it is the button's name. */\n label: string;\n /** Called when the surface opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Lands on the trigger, as `className` does. */\n style?: CSSProperties;\n};\n\n// Any HSL colour names the channels the two strips draw. The labels are read\n// off it in the reader's locale, as React Aria words them, rather than written\n// here in English.\nconst CHANNELS = parseColor('hsl(0, 0%, 0%)');\n\n/**\n * A colour picked from a plane, a hue strip and a text field, behind a\n * trigger showing the colour. The value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue`, as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorPicker defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * `alpha` adds the transparency strip. Above the medium breakpoint the\n * surface is docked to the trigger; below it, it opens centred, the same\n * swap `DatePicker` makes. `defaultOpen`, `isOpen` and `onOpenChange` reach\n * the overlay, since the picker itself carries no open state — React Aria\n * keeps that on the dialog trigger this renders inside.\n *\n * Every part inside is this package's own — `ColorArea`, `ColorSlider`,\n * `ColorField` and `ColorSwatch` — and they share the picker's value\n * through React Aria's context rather than props. Passing `children`\n * replaces all of them, for a picker that wants a different arrangement.\n *\n * The call site's `className` and `style` land on the trigger, which is the\n * element a layout positions.\n */\nfunction ColorPicker({\n alpha = false,\n children,\n className,\n container,\n defaultOpen,\n isDisabled = false,\n isOpen,\n label,\n onOpenChange,\n ref,\n style,\n ...props\n}: ColorPickerProps & RefAttributes<HTMLButtonElement>) {\n const {\n locale\n } = useLocale();\n return <RACColorPicker {...props}>\n <RACDialogTrigger defaultOpen={defaultOpen} isOpen={isOpen} onOpenChange={onOpenChange}>\n <RACButton isDisabled={isDisabled}\n // React Aria's picker renders no element of its own, so the ref\n // lands on the trigger, as the call site's class and style do.\n ref={ref} {...mergeStatefulStyles(\n // A function of the state rather than a fixed class, since the\n // trigger is the element a layout positions and the call site's\n // own class has to merge into it — a plain `className` would\n // overwrite one or the other.\n (state: ButtonRenderProps) => stylex.props(triggerStyles.base, focus.ring, state.isHovered && triggerStyles.hovered, state.isPressed && triggerStyles.pressed, state.isDisabled && triggerStyles.disabled), {\n className,\n style\n })}>\n {(state: ButtonRenderProps) => <>\n <SwatchSquareContext value={state.isDisabled ? DISABLED_TRIGGER_SWATCH : styles.triggerSwatch}>\n <ColorSwatch />\n </SwatchSquareContext>\n {label}\n </>}\n </RACButton>\n <RACPopover className={popoverClassName}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n {/*\n Disabled reaches every control here, not only the trigger.\n React Aria's colour picker carries no disabled state of its\n own — react-stately's `useColorPickerState` has no such\n concept — so nothing hands it down the way a field's context\n would. And the surface opens independently of the trigger, so\n a disabled picker can still be on screen: already open when a\n form disables it, or opened from outside. Without this the\n plane could be dragged, the strips moved with the arrow keys\n and the field typed into, all changing the value of something\n documented as inert.\n An arrangement a call site passes as `children` is its own to\n disable; there is no context to reach it through.\n */}\n {children ?? <div className=\"x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li\">\n <ColorArea aria-label={label} colorSpace=\"hsl\" isDisabled={isDisabled} xChannel=\"saturation\" yChannel=\"lightness\" />\n <ColorSlider channel=\"hue\" colorSpace=\"hsl\" isDisabled={isDisabled} label={CHANNELS.getChannelName('hue', locale)} />\n {alpha ? <ColorSlider channel=\"alpha\" isDisabled={isDisabled} label={CHANNELS.getChannelName('alpha', locale)} /> : null}\n <ColorField isDisabled={isDisabled} label={label} />\n </div>}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n </RACColorPicker>;\n}\nexport type { ColorPickerProps };\nexport default ColorPicker;"],"mappings":";;;;;;;;;;;;;;;AAsDA,MAAMmC,SAAS;CACbC,eAAe;EACbC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,OAAO;CACT;CACAC,uBAAuB;EACrBC,QAAQ;EACRF,OAAO;CACT;AACF;AAIA,MAAMG,0BAA0B,CAACR,OAAOC,eAAeD,OAAOM,qBAAqB;AACnF,MAAMG,gBAAgB;CACpBC,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,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRrB,O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ApBe;;EA8CErB,EAAA,MAAAR;EAAAQ,EAAA,MAAAN;EAAAM,EAAA,MAAAJ;EAAAI,EAAA,MAAAY;EAAAZ,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;CAAA,OAAAA,MAAAtB,EAAA;CAAA,IAAAuB;CAAA,IAAAvB,EAAA,QAAAC,WAAAD,EAAA,QAAAsB,KAAA;EA/ChBC,MAAA,oBAACe,aAAD;GAAe,GAAKrC;GACvBqB,UAAAA;EADkB,CAAA;EAgDHtB,EAAA,MAAAC;EAAAD,EAAA,MAAAsB;EAAAtB,EAAA,MAAAuB;CAAA,OAAAA,MAAAvB,EAAA;CAAA,OAhDZuB;AAgDY;AAjErB,SAAAf,MAAAG,OAAA;CAAA,OA2BoClF,MAAaoC,cAAaC,MAAOxB,MAAK2E,MAAON,MAAKa,aAAc3D,cAAamB,SAAU2B,MAAKc,aAAc5D,cAAaoB,SAAU0B,MAAKlB,cAAe5B,cAAakB,QAAS;AAAC"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","parseColor","ColorPicker","useLocale","focus","mergeStatefulStyles","overlay","popoverClassName","styles","triggerSwatch","kZKoxP","kmuXW","kzqmXN","$$css","triggerSwatchDisabled","kSiTet","DISABLED_TRIGGER_SWATCH","triggerStyles","base","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","k8WAf4","kg3NbH","disabled","hovered","pressed","alpha","children","className","container","defaultOpen","isDisabled","isOpen","label","onOpenChange","style","CHANNELS","t0","$","props","ref","t1","t2","undefined","locale","t3","_temp","t4","state_0","state","t5","t6","Symbol","for","popupDialog","ring","t7","getChannelName","t8","t9","t10","t11","isHovered","isPressed","ColorSwatch","RACButton","ColorArea","ColorSlider","ColorField","RACDialog","RACPopover","RACDialogTrigger","RACColorPicker"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } from 'react';\nimport type { ButtonRenderProps, ColorPickerProps as RACColorPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { parseColor, Button as RACButton, ColorPicker as RACColorPicker, Dialog as RACDialog, DialogTrigger as RACDialogTrigger, Popover as RACPopover, useLocale } from 'react-aria-components';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { popoverClassName } from '../../styles/picker';\nimport { SwatchSquareContext } from '../../swatch';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport ColorArea from '../color-area';\nimport ColorField from '../color-field';\nimport ColorSlider from '../color-slider';\nimport ColorSwatch from '../color-swatch';\n\n// Everything in this phase, in one control: a swatch and a label as the\n// trigger, and a plane, a hue slider, an alpha slider and a text field on\n// the surface it opens. React Aria's `ColorPicker` renders nothing of its\n// own — it is the state the five share — so what is here is the trigger,\n// the overlay and the arrangement inside it.\n//\n// The design carries no page for a colour picker. What it does carry is the\n// text fields page, which the field inside this one already draws through,\n// and the overlay surface every popover here shares. Three choices are the\n// library's own.\n//\n// **The trigger is a swatch beside a name, not a swatch alone.** A swatch\n// on its own is a coloured square with no affordance — nothing says it can\n// be pressed, and a screen reader is told a colour rather than an action.\n// The label is what makes it a button.\n//\n// **Hue is a slider rather than a wheel here.** A wheel and the plane want\n// the same space and would make the surface square and large; the strip\n// sits under the plane at the width it already has. `ColorWheel` is for a\n// picker that wants to be round, which is a different shape rather than a\n// different control.\n//\n// **It is docked above the medium breakpoint and modal below it**, centred\n// over a scrim there — the same swap `DatePicker` makes, at the width `Sheet`\n// changes presentation too, and the shared one in `src/styles/picker.ts`\n// rather than a third copy. A 280dp surface anchored to a trigger is\n// unreachable at 375px.\n//\n// One thing the picker has to do that its parts do not. **The plane and the\n// hue strip are pinned to HSL.** A channel has to belong to the value's own\n// space or React Aria throws, and a hex parses as RGB, which has no\n// saturation — so `<ColorPicker defaultValue=\"#6750A4\" />`, the call anyone\n// writes first, would throw outright. Converting here is what makes the\n// picker take any notation, and it costs the caller nothing: the value\n// handed back is still in whatever they passed.\n\nconst styles = {\n triggerSwatch: {\n kZKoxP: \"xxk0z11\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n triggerSwatchDisabled: {\n kSiTet: \"x1ppv7y9\",\n $$css: true\n }\n};\n\n// Hoisted so the context is handed one array rather than a new one on every\n// render, which would re-render every swatch reading it.\nconst DISABLED_TRIGGER_SWATCH = [styles.triggerSwatch, styles.triggerSwatchDisabled];\nconst triggerStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n disabled: {\n kWkggS: \"x19v6zzp\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n hovered: {\n kWkggS: \"x1ei6177\",\n $$css: true\n },\n pressed: {\n kWkggS: \"x1vt8e7r\",\n $$css: true\n }\n};\ntype ColorPickerProps = Omit<RACColorPickerProps, 'children'> & {\n /** Whether the alpha strip is drawn under the hue one. @default false */\n alpha?: boolean;\n /** Replaces everything on the surface, for a picker that arranges its own parts. */\n children?: ReactNode;\n /** Lands on the trigger, which is the element a layout positions. */\n className?: string;\n /**\n * Where to portal the surface. Defaults to the container of the `ThemeScope`\n * around it, which keeps the surface on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the surface\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /** Whether the surface starts open. Uncontrolled; pair `isOpen` with `onOpenChange` instead. */\n defaultOpen?: boolean;\n /**\n * Whether the whole picker is inert — the trigger, and the plane, strips\n * and field on the surface, which can be on screen while disabled since\n * the surface opens independently of the trigger. An arrangement passed\n * as `children` is the call site's own to disable.\n * @default false\n */\n isDisabled?: boolean;\n /** Whether the surface is open. Controlled; needs `onOpenChange`. */\n isOpen?: boolean;\n /** What the trigger says beside its swatch. Always rendered; it is the button's name. */\n label: string;\n /** Called when the surface opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Lands on the trigger, as `className` does. */\n style?: CSSProperties;\n};\n\n// Any HSL colour names the channels the two strips draw. The labels are read\n// off it in the reader's locale, as React Aria words them, rather than written\n// here in English.\nconst CHANNELS = parseColor('hsl(0, 0%, 0%)');\n\n/**\n * A colour picked from a plane, a hue strip and a text field, behind a\n * trigger showing the colour. The value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue`, as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorPicker defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * `alpha` adds the transparency strip. Above the medium breakpoint the\n * surface is docked to the trigger; below it, it opens centred, the same\n * swap `DatePicker` makes. `defaultOpen`, `isOpen` and `onOpenChange` reach\n * the overlay, since the picker itself carries no open state — React Aria\n * keeps that on the dialog trigger this renders inside.\n *\n * Every part inside is this package's own — `ColorArea`, `ColorSlider`,\n * `ColorField` and `ColorSwatch` — and they share the picker's value\n * through React Aria's context rather than props. Passing `children`\n * replaces all of them, for a picker that wants a different arrangement.\n *\n * The call site's `className` and `style` land on the trigger, which is the\n * element a layout positions.\n */\nfunction ColorPicker({\n alpha = false,\n children,\n className,\n container,\n defaultOpen,\n isDisabled = false,\n isOpen,\n label,\n onOpenChange,\n ref,\n style,\n ...props\n}: ColorPickerProps & RefAttributes<HTMLButtonElement>) {\n const {\n locale\n } = useLocale();\n return <RACColorPicker {...props}>\n <RACDialogTrigger defaultOpen={defaultOpen} isOpen={isOpen} onOpenChange={onOpenChange}>\n <RACButton isDisabled={isDisabled}\n // React Aria's picker renders no element of its own, so the ref\n // lands on the trigger, as the call site's class and style do.\n ref={ref} {...mergeStatefulStyles(\n // A function of the state rather than a fixed class, since the\n // trigger is the element a layout positions and the call site's\n // own class has to merge into it — a plain `className` would\n // overwrite one or the other.\n (state: ButtonRenderProps) => stylex.props(triggerStyles.base, focus.ring, state.isHovered && triggerStyles.hovered, state.isPressed && triggerStyles.pressed, state.isDisabled && triggerStyles.disabled), {\n className,\n style\n })}>\n {(state: ButtonRenderProps) => <>\n <SwatchSquareContext value={state.isDisabled ? DISABLED_TRIGGER_SWATCH : styles.triggerSwatch}>\n <ColorSwatch />\n </SwatchSquareContext>\n {label}\n </>}\n </RACButton>\n <RACPopover className={popoverClassName}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n {/*\n Disabled reaches every control here, not only the trigger.\n React Aria's colour picker carries no disabled state of its\n own — react-stately's `useColorPickerState` has no such\n concept — so nothing hands it down the way a field's context\n would. And the surface opens independently of the trigger, so\n a disabled picker can still be on screen: already open when a\n form disables it, or opened from outside. Without this the\n plane could be dragged, the strips moved with the arrow keys\n and the field typed into, all changing the value of something\n documented as inert.\n An arrangement a call site passes as `children` is its own to\n disable; there is no context to reach it through.\n */}\n {children ?? <div className=\"x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li\">\n <ColorArea aria-label={label} colorSpace=\"hsl\" isDisabled={isDisabled} xChannel=\"saturation\" yChannel=\"lightness\" />\n <ColorSlider channel=\"hue\" colorSpace=\"hsl\" isDisabled={isDisabled} label={CHANNELS.getChannelName('hue', locale)} />\n {alpha ? <ColorSlider channel=\"alpha\" isDisabled={isDisabled} label={CHANNELS.getChannelName('alpha', locale)} /> : null}\n <ColorField isDisabled={isDisabled} label={label} />\n </div>}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n </RACColorPicker>;\n}\nexport type { ColorPickerProps };\nexport default ColorPicker;"],"mappings":";;;;;;;;;;;;;;;AAsDA,MAAMS,SAAS;CACbC,eAAe;EACbC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,OAAO;CACT;CACAC,uBAAuB;EACrBC,QAAQ;EACRF,OAAO;CACT;AACF;AAIA,MAAMG,0BAA0B,CAACR,OAAOC,eAAeD,OAAOM,qBAAqB;AACnF,MAAMG,gBAAgB;CACpBC,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,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRrB,OAAO;CACT;CACAsB,UAAU;EACRf,QAAQ;EACRI,QAAQ;EACRC,QAAQ;EACRZ,OAAO;CACT;CACAuB,SAAS;EACPhB,QAAQ;EACRP,OAAO;CACT;CACAwB,SAAS;EACPjB,QAAQ;EACRP,OAAO;CACT;AACF;AAuCA,MAAMmC,WAAW/C,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;AA0B5C,SAAAC,cAAA+C,IAAA;CAAA,MAAAC,IAAAnD,EAAA,EAAA;CAAA,IAAAwC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAE;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAL;CAAA,IAAAM;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAqB,CAAA,CAAAX,OAAAe,IAAA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AAc1D,cAAaoB,SAAUwB,MAAKlB,cAAe1B,cAAakB,QAAS;AAAC"}
@@ -36,5 +36,4 @@ type ColorSliderProps$1 = Omit<ColorSliderProps, 'children' | 'className' | 'sty
36
36
  * which is the element a layout positions.
37
37
  */
38
38
  declare function ColorSlider$1({ isDisabled, label, showValue, ...props }: ColorSliderProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
39
- export { type ColorSliderProps$1 as ColorSliderProps, ColorSlider$1 as default };
40
- //# sourceMappingURL=index.d.ts.map
39
+ export { type ColorSliderProps$1 as ColorSliderProps, ColorSlider$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","RefAttributes","ColorSliderProps","RACColorSliderProps","stylex","ColorSlider","RACColorSlider","ColorThumb","RACColorThumb","SliderOutput","RACSliderOutput","SliderTrack","RACSliderTrack","FieldLabel","groupStyles","chequer","thumbClassName","verticalThumbClassName","mergeStatefulStyles","colors","radii","spacing","stateLayerOpacity","typography","styles","root","kzqmXN","$$css","rootVertical","kGNEyG","kZKoxP","trackGround","kaIpWk","kB7OPa","kqGvvJ","trackGroundDisabled","kSiTet","trackGroundVertical","kzQI83","kUOVxO","kAzted","Omit","className","label","showValue","style","t0","$","T0","isDisabled","t1","t2","t3","vertical","t4","t5","t6","props","undefined","orientation","t7","ground","t8","Symbol","for","0","2","1","3","t9","t10","t11","t12","t13","t14","ColorSlider","_c","props","RACColorSlider","stylex.props","RACSliderOutput","RACColorThumb","RACSliderTrack"],"sources":["../../../src/components/color-slider/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport type { ColorSliderProps as RACColorSliderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorSlider as RACColorSlider, ColorThumb as RACColorThumb, SliderOutput as RACSliderOutput, SliderTrack as RACSliderTrack } from 'react-aria-components';\nimport { FieldLabel } from '../../field';\nimport { groupStyles } from '../../field/styles';\nimport { chequer } from '../../styles/chequer';\nimport { thumbClassName, verticalThumbClassName } from '../../styles/color';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The sliders page's track, carrying one channel of a colour instead of an\n// active and an inactive part: the page's 16dp strip with its 8dp corner,\n// centred in the 44dp a handle takes, and the same label-large label above\n// it. React Aria paints the gradient itself, on the track's own inline\n// `background`, so what runs along the strip is the channel rather than\n// anything chosen here.\n//\n// Three things depart from the page, each because a colour slider shows a\n// value the page's slider does not have.\n//\n// **The handle is a circle carrying the colour, not the page's 4dp bar.**\n// The page's handle is a mark on a track whose colour it already knows; this\n// one has to show the value it sits on, and 4dp of a colour is not a colour\n// anyone can read. It keeps the page's 44dp of height as the target it is\n// centred in.\n//\n// **The handle is ringed rather than filled with primary.** Its fill is the\n// value, so the ring is what has to read against it — and against every\n// other colour the track runs through. It is a surface-coloured ring with a\n// hairline outside it, which reads on a light track and a dark one alike.\n//\n// **There is no stop at the inactive end.** The page puts one 6dp from the\n// end of the inactive part; a channel has no inactive part, so there is no\n// end for it to mark.\n//\n// Vertical, the strip stands up with the channel rising from the bottom, as\n// React Aria paints it, and takes Slider's geometry: 240px tall until the\n// call site's style says otherwise, the press target widened across rather\n// than along, and the handle centred across the strip.\n//\n// The alpha channel is the one that needs a chequer, for the reason\n// `src/styles/chequer.ts` gives: a track fading to transparent over a light\n// surface and one fading to white are the same pixels without it.\n\nconst styles = {\n root: {\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n rootVertical: {\n kGNEyG: \"x1cy8zhl\",\n kZKoxP: \"x1u5z0ei\",\n kzqmXN: \"x14atkfc\",\n $$css: true\n },\n trackGround: {\n kZKoxP: \"xlup9mm\",\n kaIpWk: \"x1xdvaa9\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"xh8yej3\",\n kqGvvJ: \"x2k5q2m\",\n $$css: true\n },\n trackGroundDisabled: {\n kSiTet: \"x1ppv7y9\",\n $$css: true\n },\n trackGroundVertical: {\n kZKoxP: \"xt7dq6l\",\n kzQI83: \"x1iyjqo2\",\n kzqmXN: \"x1kky2od\",\n kqGvvJ: \"x10im51j\",\n kUOVxO: \"xcwsfa8\",\n kAzted: \"x2lwn1j\",\n $$css: true\n }\n};\ntype ColorSliderProps = Omit<RACColorSliderProps, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the slider's render state. */\n className?: RACColorSliderProps['className'];\n /** What the slider is for. Always rendered; React Aria names the channel otherwise. */\n label?: string;\n /**\n * Whether the value React Aria announces is also shown, at the end of the\n * label's line.\n * @default true\n */\n showValue?: boolean;\n /** A function may compute the style from the slider's render state. */\n style?: RACColorSliderProps['style'];\n};\n\n/**\n * A slider over one channel of a colour — hue, saturation, lightness, alpha\n * and the rest. The value is React Aria's: pass `value` with `onChange` to\n * control it, or `defaultValue`, as a CSS colour string or a `Color` from\n * `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorSlider channel=\"hue\" defaultValue=\"hsl(200, 100%, 50%)\" label=\"Label\" />\n * ```\n *\n * **`channel` has to name a channel the value's own space has.** A hex or\n * `rgb()` value parses as RGB, which has no hue, so `channel=\"hue\"` against\n * one throws rather than converting — pass `colorSpace=\"hsl\"` to convert it,\n * or give the value in the space you mean to slide.\n *\n * React Aria paints the gradient and names the value — \"200°, cyan blue\" —\n * so the readout beside the label is what it announces.\n *\n * The call site's `className` and `style` land on the slider as a whole,\n * which is the element a layout positions.\n */\nfunction ColorSlider({\n isDisabled = false,\n label,\n showValue = true,\n ...props\n}: ColorSliderProps & RefAttributes<HTMLDivElement>) {\n const vertical = props.orientation === 'vertical';\n return <RACColorSlider isDisabled={isDisabled} {...props} {...mergeStatefulStyles(stylex.props(groupStyles.root, styles.root, vertical && styles.rootVertical), props)}>\n <div className=\"x1pha0wt x78zum5 x126z3so\">\n {label === undefined ? null : <FieldLabel variant=\"group\">{label}</FieldLabel>}\n {showValue ? <RACSliderOutput className=\"x1w5n3ug x1yicsit x1b35g6e xwth0xh xybisxh xvc5jky\" /> : null}\n </div>\n <div {...stylex.props(chequer.ground, styles.trackGround, vertical && styles.trackGroundVertical, isDisabled && styles.trackGroundDisabled)}>\n <RACSliderTrack {...{\n 0: {\n className: \"x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6\"\n },\n 2: {\n className: \"x1cpjm7i x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6 x1nc033x x8s3y0y\"\n },\n 1: {\n className: \"x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1h6gzvc\"\n },\n 3: {\n className: \"x1cpjm7i x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1nc033x x8s3y0y x1h6gzvc\"\n }\n }[!!vertical << 1 | !!isDisabled << 0]}>\n <RACColorThumb className={vertical ? verticalThumbClassName : thumbClassName} />\n </RACSliderTrack>\n </div>\n </RACColorSlider>;\n}\nexport type { ColorSliderProps };\nexport default ColorSlider;"],"mappings":";;;;;;;;;;;AAgDA,MAAMyB,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRJ,QAAQ;EACRC,OAAO;CACT;CACAI,aAAa;EACXD,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRP,OAAO;CACT;CACAQ,qBAAqB;EACnBC,QAAQ;EACRT,OAAO;CACT;CACAU,qBAAqB;EACnBP,QAAQ;EACRQ,QAAQ;EACRZ,QAAQ;EACRQ,QAAQ;EACRK,QAAQ;EACRC,QAAQ;EACRb,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAAtB,cAAAyC,IAAA;CAAA,MAAAC,IAAA/C,EAAA,EAAA;CAAA,IAAAgD;CAAA,IAAAC;CAAA,IAAAN;CAAA,IAAAC;CAAA,IA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A;CAAA,IAAA0B;CAAA,IAAA1B,EAAA,QAAAyB,OAAAzB,EAAA,QAAAa,IAAA;EAhBnBa,MAAA,oBAAA,OAAA;GAiBM,GAjBGb;GACPY,UAAAA;EAgBI,CAAA;EAAAzB,EAAA,MAAAyB;EAAAzB,EAAA,MAAAa;EAAAb,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAC,MAAAD,EAAA,QAAAG,MAAAH,EAAA,QAAA0B,OAAA1B,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAS,IAAA;EAtBHkB,MAAA,qBAAC,IAAD;GAA4BzB,YAAAA;GAAU,GAAMQ;GAAK,GAAML;GAAvD,UAAA,CACHI,IAIAiB,GALkB;;EAuBH1B,EAAA,MAAAC;EAAAD,EAAA,MAAAG;EAAAH,EAAA,MAAA0B;EAAA1B,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,OAvBZ2B;AAuBY"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","ColorSlider","RACColorSlider","groupStyles","chequer","thumbClassName","verticalThumbClassName","mergeStatefulStyles","styles","root","kzqmXN","$$css","rootVertical","kGNEyG","kZKoxP","trackGround","kaIpWk","kB7OPa","kqGvvJ","trackGroundDisabled","kSiTet","trackGroundVertical","kzQI83","kUOVxO","kAzted","className","label","showValue","t0","$","T0","isDisabled","t1","t2","t3","vertical","t4","t5","t6","props","undefined","orientation","t7","ground","t8","Symbol","for","0","2","1","3","t9","t10","t11","t12","t13","t14","RACSliderOutput","RACColorThumb","RACSliderTrack"],"sources":["../../../src/components/color-slider/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport type { ColorSliderProps as RACColorSliderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorSlider as RACColorSlider, ColorThumb as RACColorThumb, SliderOutput as RACSliderOutput, SliderTrack as RACSliderTrack } from 'react-aria-components';\nimport { FieldLabel } from '../../field';\nimport { groupStyles } from '../../field/styles';\nimport { chequer } from '../../styles/chequer';\nimport { thumbClassName, verticalThumbClassName } from '../../styles/color';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The sliders page's track, carrying one channel of a colour instead of an\n// active and an inactive part: the page's 16dp strip with its 8dp corner,\n// centred in the 44dp a handle takes, and the same label-large label above\n// it. React Aria paints the gradient itself, on the track's own inline\n// `background`, so what runs along the strip is the channel rather than\n// anything chosen here.\n//\n// Three things depart from the page, each because a colour slider shows a\n// value the page's slider does not have.\n//\n// **The handle is a circle carrying the colour, not the page's 4dp bar.**\n// The page's handle is a mark on a track whose colour it already knows; this\n// one has to show the value it sits on, and 4dp of a colour is not a colour\n// anyone can read. It keeps the page's 44dp of height as the target it is\n// centred in.\n//\n// **The handle is ringed rather than filled with primary.** Its fill is the\n// value, so the ring is what has to read against it — and against every\n// other colour the track runs through. It is a surface-coloured ring with a\n// hairline outside it, which reads on a light track and a dark one alike.\n//\n// **There is no stop at the inactive end.** The page puts one 6dp from the\n// end of the inactive part; a channel has no inactive part, so there is no\n// end for it to mark.\n//\n// Vertical, the strip stands up with the channel rising from the bottom, as\n// React Aria paints it, and takes Slider's geometry: 240px tall until the\n// call site's style says otherwise, the press target widened across rather\n// than along, and the handle centred across the strip.\n//\n// The alpha channel is the one that needs a chequer, for the reason\n// `src/styles/chequer.ts` gives: a track fading to transparent over a light\n// surface and one fading to white are the same pixels without it.\n\nconst styles = {\n root: {\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n rootVertical: {\n kGNEyG: \"x1cy8zhl\",\n kZKoxP: \"x1u5z0ei\",\n kzqmXN: \"x14atkfc\",\n $$css: true\n },\n trackGround: {\n kZKoxP: \"xlup9mm\",\n kaIpWk: \"x1xdvaa9\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"xh8yej3\",\n kqGvvJ: \"x2k5q2m\",\n $$css: true\n },\n trackGroundDisabled: {\n kSiTet: \"x1ppv7y9\",\n $$css: true\n },\n trackGroundVertical: {\n kZKoxP: \"xt7dq6l\",\n kzQI83: \"x1iyjqo2\",\n kzqmXN: \"x1kky2od\",\n kqGvvJ: \"x10im51j\",\n kUOVxO: \"xcwsfa8\",\n kAzted: \"x2lwn1j\",\n $$css: true\n }\n};\ntype ColorSliderProps = Omit<RACColorSliderProps, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the slider's render state. */\n className?: RACColorSliderProps['className'];\n /** What the slider is for. Always rendered; React Aria names the channel otherwise. */\n label?: string;\n /**\n * Whether the value React Aria announces is also shown, at the end of the\n * label's line.\n * @default true\n */\n showValue?: boolean;\n /** A function may compute the style from the slider's render state. */\n style?: RACColorSliderProps['style'];\n};\n\n/**\n * A slider over one channel of a colour — hue, saturation, lightness, alpha\n * and the rest. The value is React Aria's: pass `value` with `onChange` to\n * control it, or `defaultValue`, as a CSS colour string or a `Color` from\n * `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorSlider channel=\"hue\" defaultValue=\"hsl(200, 100%, 50%)\" label=\"Label\" />\n * ```\n *\n * **`channel` has to name a channel the value's own space has.** A hex or\n * `rgb()` value parses as RGB, which has no hue, so `channel=\"hue\"` against\n * one throws rather than converting — pass `colorSpace=\"hsl\"` to convert it,\n * or give the value in the space you mean to slide.\n *\n * React Aria paints the gradient and names the value — \"200°, cyan blue\" —\n * so the readout beside the label is what it announces.\n *\n * The call site's `className` and `style` land on the slider as a whole,\n * which is the element a layout positions.\n */\nfunction ColorSlider({\n isDisabled = false,\n label,\n showValue = true,\n ...props\n}: ColorSliderProps & RefAttributes<HTMLDivElement>) {\n const vertical = props.orientation === 'vertical';\n return <RACColorSlider isDisabled={isDisabled} {...props} {...mergeStatefulStyles(stylex.props(groupStyles.root, styles.root, vertical && styles.rootVertical), props)}>\n <div className=\"x1pha0wt x78zum5 x126z3so\">\n {label === undefined ? null : <FieldLabel variant=\"group\">{label}</FieldLabel>}\n {showValue ? <RACSliderOutput className=\"x1w5n3ug x1yicsit x1b35g6e xwth0xh xybisxh xvc5jky\" /> : null}\n </div>\n <div {...stylex.props(chequer.ground, styles.trackGround, vertical && styles.trackGroundVertical, isDisabled && styles.trackGroundDisabled)}>\n <RACSliderTrack {...{\n 0: {\n className: \"x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6\"\n },\n 2: {\n className: \"x1cpjm7i x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6 x1nc033x x8s3y0y\"\n },\n 1: {\n className: \"x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1h6gzvc\"\n },\n 3: {\n className: \"x1cpjm7i x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1nc033x x8s3y0y x1h6gzvc\"\n }\n }[!!vertical << 1 | !!isDisabled << 0]}>\n <RACColorThumb className={vertical ? verticalThumbClassName : thumbClassName} />\n </RACSliderTrack>\n </div>\n </RACColorSlider>;\n}\nexport type { ColorSliderProps };\nexport default ColorSlider;"],"mappings":";;;;;;;;;;;AAgDA,MAAMS,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRJ,QAAQ;EACRC,OAAO;CACT;CACAI,aAAa;EACXD,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRP,OAAO;CACT;CACAQ,qBAAqB;EACnBC,QAAQ;EACRT,OAAO;CACT;CACAU,qBAAqB;EACnBP,QAAQ;EACRQ,QAAQ;EACRZ,QAAQ;EACRQ,QAAQ;EACRK,QAAQ;EACRC,QAAQ;EACRb,OAAO;CACT;AACF;;;;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oBAACK,aAAD;GAAe,GAAKR;GAclBE,UAAAA;EAda,CAAA;EAeExB,EAAA,MAAAwB;EAAAxB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAyB;CAAA,OAAAA,MAAAzB,EAAA;CAAA,IAAA0B;CAAA,IAAA1B,EAAA,QAAAyB,OAAAzB,EAAA,QAAAa,IAAA;EAhBnBa,MAAA,oBAAA,OAAA;GAiBM,GAjBGb;GACPY,UAAAA;EAgBI,CAAA;EAAAzB,EAAA,MAAAyB;EAAAzB,EAAA,MAAAa;EAAAb,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAC,MAAAD,EAAA,QAAAG,MAAAH,EAAA,QAAA0B,OAAA1B,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAS,IAAA;EAtBHkB,MAAA,qBAAC,IAAD;GAA4BzB,YAAAA;GAAU,GAAMQ;GAAK,GAAML;GAAvD,UAAA,CACHI,IAIAiB,GALkB;;EAuBH1B,EAAA,MAAAC;EAAAD,EAAA,MAAAG;EAAAH,EAAA,MAAA0B;EAAA1B,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,OAvBZ2B;AAuBY"}
@@ -31,5 +31,4 @@ type ColorSwatchProps$1 = Omit<ColorSwatchProps, 'className' | 'style'> & {
31
31
  * interactive state for one to read.
32
32
  */
33
33
  declare function ColorSwatch$1({ className, ref, style, ...props }: ColorSwatchProps$1 & RefAttributes<HTMLSpanElement>): import("react").JSX.Element;
34
- export { type ColorSwatchProps$1 as ColorSwatchProps, ColorSwatch$1 as default };
35
- //# sourceMappingURL=index.d.ts.map
34
+ export { type ColorSwatchProps$1 as ColorSwatchProps, ColorSwatch$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","CSSProperties","RefAttributes","ColorSwatchProps","RACColorSwatchProps","stylex","useContext","ColorSwatch","RACColorSwatch","chequer","mergeStyles","SwatchSquareContext","colors","radii","SQUARE","styles","ground","kZKoxP","kaIpWk","kB7OPa","k1xSpc","kzqmXN","kVQacm","$$css","Omit","className","style","t0","$","props","ref","placed","t1","t2","t3","ColorSwatch","_c","props","stylex.props","RACColorSwatch"],"sources":["../../../src/components/color-swatch/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } from 'react';\nimport type { ColorSwatchProps as RACColorSwatchProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { ColorSwatch as RACColorSwatch } from 'react-aria-components';\nimport { chequer } from '../../styles/chequer';\nimport { mergeStyles } from '../../styles/merge';\nimport { SwatchSquareContext } from '../../swatch';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii } from '../../tokens/design.tokens.stylex';\n\n// A single colour, drawn as a square. The design carries no page for this —\n// its colour guidance is about the roles a component takes, not about\n// showing a colour as a value — so the shape here is the library's own,\n// built from what the rest of it already uses.\n//\n// Three things follow from that, and each is a choice rather than a reading.\n//\n// **A swatch is outlined.** Its own colour is the content, so it cannot\n// carry a contrasting one — and a white swatch on a light surface, or a\n// near-black one in dark mode, would otherwise have no edge at all. The\n// outline is the same hairline a field's box takes.\n//\n// **Transparency is drawn against a chequer rather than against the page.**\n// A half-transparent red over a white surface and an opaque pink are the\n// same pixels; the chequer is what tells them apart. It is built from two\n// surface tokens, so it follows the theme rather than being a fixed grey.\n//\n// **The chequer is a layer behind the swatch, not a background on it.**\n// React Aria sets the colour through the element's own inline\n// `background-color`, and CSS paints a background image over a background\n// colour rather than under it — so a chequer on the same element would\n// cover the colour it is there to reveal.\n\nconst SQUARE = '40px';\nconst styles = {\n ground: {\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x1rg5ohu\",\n kzqmXN: \"x100vrsf\",\n kVQacm: \"xb3r6kr\",\n $$css: true\n }\n};\ntype ColorSwatchProps = Omit<RACColorSwatchProps, 'className' | 'style'> & {\n /**\n * Lands on the square around the swatch, which is the element a layout\n * positions and the one that carries its size.\n */\n className?: string;\n /** Lands on the square around the swatch, as `className` does. */\n style?: CSSProperties;\n};\n\n/**\n * A colour shown as a value: a square of it, with a chequer behind so\n * transparency reads as transparency. The colour is React Aria's — a CSS\n * string, or a `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * import { parseColor } from '@kanso-labs/kanso-ui'\n *\n * <ColorSwatch color={parseColor('hsla(200, 100%, 50%, 0.4)')} />\n * ```\n *\n * React Aria names it from the colour itself — \"light vibrant cyan blue, 60%\n * transparent\" — so it needs no label. Pass `colorName` to say something\n * else instead.\n *\n * The call site's `className` and `style` land on the square around the\n * swatch rather than on the swatch itself, which is what makes setting a\n * size from outside work — the colour fills whatever square it is given.\n * React Aria's function forms are not taken here, since a swatch has no\n * interactive state for one to read.\n */\n// The ref lands on the chequered ground, the element the call site's class\n// and style do, rather than on React Aria's swatch inside it.\nfunction ColorSwatch({\n className,\n ref,\n style,\n ...props\n}: ColorSwatchProps & RefAttributes<HTMLSpanElement>) {\n const placed = useContext(SwatchSquareContext);\n return <span ref={ref} {...mergeStyles(stylex.props(chequer.ground, styles.ground, placed), {\n className,\n style\n })}>\n <RACColorSwatch {...props} className=\"x5yr21d x1tfhd1 xbd69nm x9f619 x1lliihq xh8yej3\" />\n </span>;\n}\nexport type { ColorSwatchProps };\nexport default ColorSwatch;"],"mappings":";;;;;;;;;;AAqCA,MAAMgB,SAAS,EACbC,QAAQ;CACNC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAAhB,cAAAoB,IAAA;CAAA,MAAAC,IAAA5B,EAAA,EAAA;CAAA,IAAAyB;CAAA,IAAAI;CAAA,IAA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","kVQacm","$$css","className","style","t0","$","props","ref","placed","t1","t2","t3","RACColorSwatch"],"sources":["../../../src/components/color-swatch/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } from 'react';\nimport type { ColorSwatchProps as RACColorSwatchProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { ColorSwatch as RACColorSwatch } from 'react-aria-components';\nimport { chequer } from '../../styles/chequer';\nimport { mergeStyles } from '../../styles/merge';\nimport { SwatchSquareContext } from '../../swatch';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii } from '../../tokens/design.tokens.stylex';\n\n// A single colour, drawn as a square. The design carries no page for this —\n// its colour guidance is about the roles a component takes, not about\n// showing a colour as a value — so the shape here is the library's own,\n// built from what the rest of it already uses.\n//\n// Three things follow from that, and each is a choice rather than a reading.\n//\n// **A swatch is outlined.** Its own colour is the content, so it cannot\n// carry a contrasting one — and a white swatch on a light surface, or a\n// near-black one in dark mode, would otherwise have no edge at all. The\n// outline is the same hairline a field's box takes.\n//\n// **Transparency is drawn against a chequer rather than against the page.**\n// A half-transparent red over a white surface and an opaque pink are the\n// same pixels; the chequer is what tells them apart. It is built from two\n// surface tokens, so it follows the theme rather than being a fixed grey.\n//\n// **The chequer is a layer behind the swatch, not a background on it.**\n// React Aria sets the colour through the element's own inline\n// `background-color`, and CSS paints a background image over a background\n// colour rather than under it — so a chequer on the same element would\n// cover the colour it is there to reveal.\n\nconst SQUARE = '40px';\nconst styles = {\n ground: {\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x1rg5ohu\",\n kzqmXN: \"x100vrsf\",\n kVQacm: \"xb3r6kr\",\n $$css: true\n }\n};\ntype ColorSwatchProps = Omit<RACColorSwatchProps, 'className' | 'style'> & {\n /**\n * Lands on the square around the swatch, which is the element a layout\n * positions and the one that carries its size.\n */\n className?: string;\n /** Lands on the square around the swatch, as `className` does. */\n style?: CSSProperties;\n};\n\n/**\n * A colour shown as a value: a square of it, with a chequer behind so\n * transparency reads as transparency. The colour is React Aria's — a CSS\n * string, or a `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * import { parseColor } from '@kanso-labs/kanso-ui'\n *\n * <ColorSwatch color={parseColor('hsla(200, 100%, 50%, 0.4)')} />\n * ```\n *\n * React Aria names it from the colour itself — \"light vibrant cyan blue, 60%\n * transparent\" — so it needs no label. Pass `colorName` to say something\n * else instead.\n *\n * The call site's `className` and `style` land on the square around the\n * swatch rather than on the swatch itself, which is what makes setting a\n * size from outside work — the colour fills whatever square it is given.\n * React Aria's function forms are not taken here, since a swatch has no\n * interactive state for one to read.\n */\n// The ref lands on the chequered ground, the element the call site's class\n// and style do, rather than on React Aria's swatch inside it.\nfunction ColorSwatch({\n className,\n ref,\n style,\n ...props\n}: ColorSwatchProps & RefAttributes<HTMLSpanElement>) {\n const placed = useContext(SwatchSquareContext);\n return <span ref={ref} {...mergeStyles(stylex.props(chequer.ground, styles.ground, placed), {\n className,\n style\n })}>\n <RACColorSwatch {...props} className=\"x5yr21d x1tfhd1 xbd69nm x9f619 x1lliihq xh8yej3\" />\n </span>;\n}\nexport type { ColorSwatchProps };\nexport default ColorSwatch;"],"mappings":";;;;;;;;;;AAqCA,MAAMO,SAAS,EACbC,QAAQ;CACNC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAAZ,cAAAe,IAAA;CAAA,MAAAC,IAAAnB,EAAA,EAAA;CAAA,IAAAgB;CAAA,IAAAI;CAAA,IAAAC;CAAA,IAAAJ;CAAA,IAAAE,EAAA,OAAAD,IAAA;EAAqB,CAAA,CAAAF,WAAAK,KAAAJ,OAAA,GAAAG,WAAAF;EAK+BC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAF;CAAA,OAAA;EAAAD,YAAAG,EAAA;EAAAC,UAAAD,EAAA;EAAAE,MAAAF,EAAA;EAAAF,QAAAE,EAAA;CAAA;CAClD,MAAAG,SAAepB,WAAWI,mBAAmB;CAAE,IAAAiB;CAAA,IAAAJ,EAAA,OAAAH,aAAAG,EAAA,OAAAG,UAAAH,EAAA,OAAAF,OAAA;EACpBM,KAAAlB,YAAYJ,MAAaG,QAAOI,QAASD,OAAMC,QAASc,MAAM,GAAG;GAAAN;GAAAC;EAG5F,CAAC;EAACE,EAAA,KAAAH;EAAAG,EAAA,KAAAG;EAAAH,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAC,SAAA;EACEI,KAAA,oBAACE,aAAD;GAAe,GAAKN;GAAiB,WAAA;EAAiD,CAAA;EAAGD,EAAA,KAAAC;EAAAD,EAAA,MAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,QAAAE,OAAAF,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EAJtFC,KAAA,oBAAA,QAAA;GAAWJ;GAAG,GAAME;GAIvBC,UAAAA;EACK,CAAA;EAAAL,EAAA,MAAAE;EAAAF,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OALFM;AAKE"}
@@ -43,5 +43,4 @@ declare namespace ColorSwatchPicker$1 {
43
43
  * own `color` unless given different children.
44
44
  */
45
45
  declare function ColorSwatchPickerItem$1({ children, ...props }: ColorSwatchPickerItemProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
46
- export { ColorSwatchPickerItem$1 as ColorSwatchPickerItem, type ColorSwatchPickerItemProps$1 as ColorSwatchPickerItemProps, type ColorSwatchPickerProps$1 as ColorSwatchPickerProps, ColorSwatchPicker$1 as default };
47
- //# sourceMappingURL=index.d.ts.map
46
+ export { ColorSwatchPickerItem$1 as ColorSwatchPickerItem, type ColorSwatchPickerItemProps$1 as ColorSwatchPickerItemProps, type ColorSwatchPickerProps$1 as ColorSwatchPickerProps, ColorSwatchPicker$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ColorSwatchPickerItemProps","RACColorSwatchPickerItemProps","ColorSwatchPickerProps","RACColorSwatchPickerProps","stylex","ColorSwatchPicker","RACColorSwatchPicker","ColorSwatchPickerItem","RACColorSwatchPickerItem","mergeStatefulStyles","colors","radii","spacing","stateLayerOpacity","ColorSwatch","FORCED_COLORS","styles","item","kUfP38","kbwMcY","kPGmMm","kWgvks","k5JduY","kv0HGH","kloYau","kwXMNM","kaIpWk","kB7OPa","kkrTdU","k1xSpc","k3XXqK","kVAEAm","$$css","itemDisabled","kSiTet","itemFocused","kjBf7l","kInvED","kMeerF","itemHovered","kXtpa","itemPressed","itemSelected","Omit","children","className","style","props","$","t0","t1","T0","t2","t3","itemStyles","t4","state","isDisabled","isFocusVisible","isHovered","isPressed","isSelected","Item","ColorSwatchPicker","_c","RACColorSwatchPicker","ColorSwatchPickerItem","RACColorSwatchPickerItem","ColorSwatch","stylex.props"],"sources":["../../../src/components/color-swatch-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ColorSwatchPickerItemProps as RACColorSwatchPickerItemProps, ColorSwatchPickerProps as RACColorSwatchPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorSwatchPicker as RACColorSwatchPicker, ColorSwatchPickerItem as RACColorSwatchPickerItem } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\nimport ColorSwatch from '../color-swatch';\n\n// A row of colours to choose one from. React Aria makes it a listbox of\n// swatches, so it is a selection control rather than a palette: arrow keys\n// move between colours and one of them is selected.\n//\n// The design carries no page for this either, so what an item looks like\n// when it is chosen is the library's own. Three choices, each with its\n// reason.\n//\n// **Selection is a ring around the swatch, not a mark on it.** A tick drawn\n// over a colour has to be readable against every colour in the row, which no\n// single ink is; a ring sits outside the swatch and needs only to read\n// against the surface behind it.\n//\n// **The ring is the primary role, and offset.** It is the same weight and\n// colour the focus ring takes elsewhere, one step out from the swatch so the\n// colour stays whole — a ring drawn on the swatch would eat two pixels of\n// the thing being chosen.\n//\n// **Focus and selection are drawn by different properties.** An element has\n// one outline, so with both drawn in it the second replaced the first, and a\n// keyboard arrowing onto the chosen colour saw a swatch that looked\n// unchosen. The focus ring is the item's outline, 6px out; the selection\n// ring is a border on a box laid 2px around the swatch, inside it. Both are\n// properties forced colours keep, which a box shadow is not.\n//\n// **Hover and press are a ring too, in the slot selection would take.** Every\n// other interactive element here answers the pointer with a state layer, but\n// a state layer is a fill and a swatch's fill is the colour being chosen:\n// behind it the tint is hidden, over it the tint changes the colour. So an\n// unselected swatch under the pointer takes a ring at the selection ring's\n// offset, drawn in the outline roles rather than primary so it cannot be read\n// as chosen — outline variant while a pointer is over it, and outline while a\n// touch or a pen holds it. Those are the only presses anyone sees: React Aria\n// chooses a swatch the moment a mouse or a key presses it, and on release for\n// a touch, so that press is the one a reader waits through before the swatch\n// is theirs. Under forced colours both roles become one system colour, so the\n// ring turns dashed there, where the selection ring stays solid.\n\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n item: {\n kUfP38: \"x1upluxz\",\n kbwMcY: \"x1v5kskh\",\n kPGmMm: \"x1941vk7\",\n kWgvks: \"xx38sju\",\n k5JduY: \"x1s928wv\",\n kv0HGH: \"xramuyw\",\n kloYau: \"x2q1x1w\",\n kwXMNM: \"x1j6awrg\",\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n k3XXqK: \"x1t137rt\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n itemDisabled: {\n kkrTdU: \"xt0e3qv\",\n kSiTet: \"x1ppv7y9\",\n $$css: true\n },\n itemFocused: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x8wkva7\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n itemHovered: {\n kXtpa: \"x1ek9lwj\",\n kbwMcY: \"x86avzo xssfeg4\",\n $$css: true\n },\n itemPressed: {\n kXtpa: \"xrwozs3\",\n kbwMcY: \"x86avzo xssfeg4\",\n $$css: true\n },\n itemSelected: {\n kXtpa: \"xtl7nvb\",\n kbwMcY: \"x86avzo\",\n $$css: true\n }\n};\ntype ColorSwatchPickerItemProps = Omit<RACColorSwatchPickerItemProps, 'children' | 'className' | 'style'> & {\n /** What the item draws. A `ColorSwatch` with no `color` of its own by default. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACColorSwatchPickerItemProps['className'];\n /** A function may compute the style from the item's render state. */\n style?: RACColorSwatchPickerItemProps['style'];\n};\ntype ColorSwatchPickerProps = Omit<RACColorSwatchPickerProps, 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACColorSwatchPickerProps['className'];\n /** A function may compute the style from the picker's render state. */\n style?: RACColorSwatchPickerProps['style'];\n};\n\n/**\n * A row of colours to choose one from, drawn as swatches. The value is React\n * Aria's — pass `value` with `onChange` to control it, or `defaultValue` —\n * as a CSS colour string or a `Color` from `parseColor`, which this package\n * re-exports.\n *\n * ```tsx\n * <ColorSwatchPicker defaultValue=\"#6750A4\">\n * <ColorSwatchPicker.Item color=\"#6750A4\" />\n * <ColorSwatchPicker.Item color=\"#625B71\" />\n * </ColorSwatchPicker>\n * ```\n *\n * It is a listbox, so arrow keys move between colours and the chosen one\n * carries a ring. Name it with `aria-label` or `aria-labelledby`; React Aria\n * calls it \"Color swatches\" otherwise.\n *\n * The call site's `className` and `style` land on the picker, which is the\n * element a layout positions.\n */\nfunction ColorSwatchPicker(props: ColorSwatchPickerProps & RefAttributes<HTMLDivElement>) {\n return <RACColorSwatchPicker {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 x1a02dak x126z3so x1t137rt\"\n }, props)} />;\n}\n\n/**\n * One swatch in a {@link ColorSwatchPicker}. Renders a `ColorSwatch` of its\n * own `color` unless given different children.\n */\nfunction ColorSwatchPickerItem({\n children,\n ...props\n}: ColorSwatchPickerItemProps & RefAttributes<HTMLDivElement>) {\n return <RACColorSwatchPickerItem {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {children ?? <ColorSwatch />}\n </RACColorSwatchPickerItem>;\n}\n\n// The item's styles, from React Aria's render state. StyleX cannot target\n// `[data-selected]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters where two styles draw on one property. The hover and\n// press rings come before `selected`, which draws on the same border, so a\n// chosen swatch keeps the ring that says so. `focused` draws on the outline,\n// which nothing else touches, so a swatch that is chosen and focused keeps\n// both. `disabled` is last, so it takes the cursor with it; React Aria\n// reports neither hover nor press on one.\nfunction itemStyles(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}) {\n return stylex.props(styles.item, state.isHovered && styles.itemHovered, state.isPressed && styles.itemPressed, state.isSelected && styles.itemSelected, state.isFocusVisible && styles.itemFocused, state.isDisabled && styles.itemDisabled);\n}\nColorSwatchPicker.Item = ColorSwatchPickerItem;\nexport type { ColorSwatchPickerItemProps, ColorSwatchPickerProps };\nexport { ColorSwatchPickerItem };\nexport default ColorSwatchPicker;"],"mappings":";;;;;;;;AAkDA,MAAMoB,SAAS;CACbC,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;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AF,EAAA,KAAAI;CAAA,OAAA;EAAAD,KAAAH,EAAA;EAAAJ,WAAAI,EAAA;EAAAE,KAAAF,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAJ,UAAA;EACjFS,KAAAT,YAAY,oBAACwB,eAAD,CAAY,CAAA;EAAGpB,EAAA,KAAAJ;EAAAI,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAG,MAAAH,EAAA,OAAAE,MAAAF,EAAA,OAAAI,MAAAJ,EAAA,QAAAK,IAAA;EADzBE,KAAA,oBAAC,IAAD;GAAyB,GAAKR;GAAK,GAAMK;GAC3CC,UAAAA;EAD2B,CAAA;EAEHL,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAFtBO;AAEsB;AAa/B,SAASD,WAAWE,OAMjB;CACD,OAAOpD,MAAaY,OAAOC,MAAMuC,MAAMG,aAAa3C,OAAOuB,aAAaiB,MAAMI,aAAa5C,OAAOyB,aAAae,MAAMK,cAAc7C,OAAO0B,cAAcc,MAAME,kBAAkB1C,OAAOmB,aAAaqB,MAAMC,cAAczC,OAAOiB,YAAY;AAC7O;AACA5B,oBAAkByD,OAAOvD"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","ColorSwatchPicker","ColorSwatchPickerItem","RACColorSwatchPickerItem","mergeStatefulStyles","styles","item","kUfP38","kbwMcY","kPGmMm","kWgvks","k5JduY","kv0HGH","kloYau","kwXMNM","kaIpWk","kB7OPa","kkrTdU","k1xSpc","k3XXqK","kVAEAm","$$css","itemDisabled","kSiTet","itemFocused","kjBf7l","kInvED","kMeerF","itemHovered","kXtpa","itemPressed","itemSelected","children","className","props","$","t0","t1","T0","t2","t3","itemStyles","t4","state","isDisabled","isFocusVisible","isHovered","isPressed","isSelected","Item","RACColorSwatchPicker","ColorSwatch"],"sources":["../../../src/components/color-swatch-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ColorSwatchPickerItemProps as RACColorSwatchPickerItemProps, ColorSwatchPickerProps as RACColorSwatchPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorSwatchPicker as RACColorSwatchPicker, ColorSwatchPickerItem as RACColorSwatchPickerItem } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\nimport ColorSwatch from '../color-swatch';\n\n// A row of colours to choose one from. React Aria makes it a listbox of\n// swatches, so it is a selection control rather than a palette: arrow keys\n// move between colours and one of them is selected.\n//\n// The design carries no page for this either, so what an item looks like\n// when it is chosen is the library's own. Three choices, each with its\n// reason.\n//\n// **Selection is a ring around the swatch, not a mark on it.** A tick drawn\n// over a colour has to be readable against every colour in the row, which no\n// single ink is; a ring sits outside the swatch and needs only to read\n// against the surface behind it.\n//\n// **The ring is the primary role, and offset.** It is the same weight and\n// colour the focus ring takes elsewhere, one step out from the swatch so the\n// colour stays whole — a ring drawn on the swatch would eat two pixels of\n// the thing being chosen.\n//\n// **Focus and selection are drawn by different properties.** An element has\n// one outline, so with both drawn in it the second replaced the first, and a\n// keyboard arrowing onto the chosen colour saw a swatch that looked\n// unchosen. The focus ring is the item's outline, 6px out; the selection\n// ring is a border on a box laid 2px around the swatch, inside it. Both are\n// properties forced colours keep, which a box shadow is not.\n//\n// **Hover and press are a ring too, in the slot selection would take.** Every\n// other interactive element here answers the pointer with a state layer, but\n// a state layer is a fill and a swatch's fill is the colour being chosen:\n// behind it the tint is hidden, over it the tint changes the colour. So an\n// unselected swatch under the pointer takes a ring at the selection ring's\n// offset, drawn in the outline roles rather than primary so it cannot be read\n// as chosen — outline variant while a pointer is over it, and outline while a\n// touch or a pen holds it. Those are the only presses anyone sees: React Aria\n// chooses a swatch the moment a mouse or a key presses it, and on release for\n// a touch, so that press is the one a reader waits through before the swatch\n// is theirs. Under forced colours both roles become one system colour, so the\n// ring turns dashed there, where the selection ring stays solid.\n\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n item: {\n kUfP38: \"x1upluxz\",\n kbwMcY: \"x1v5kskh\",\n kPGmMm: \"x1941vk7\",\n kWgvks: \"xx38sju\",\n k5JduY: \"x1s928wv\",\n kv0HGH: \"xramuyw\",\n kloYau: \"x2q1x1w\",\n kwXMNM: \"x1j6awrg\",\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n k3XXqK: \"x1t137rt\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n itemDisabled: {\n kkrTdU: \"xt0e3qv\",\n kSiTet: \"x1ppv7y9\",\n $$css: true\n },\n itemFocused: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x8wkva7\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n itemHovered: {\n kXtpa: \"x1ek9lwj\",\n kbwMcY: \"x86avzo xssfeg4\",\n $$css: true\n },\n itemPressed: {\n kXtpa: \"xrwozs3\",\n kbwMcY: \"x86avzo xssfeg4\",\n $$css: true\n },\n itemSelected: {\n kXtpa: \"xtl7nvb\",\n kbwMcY: \"x86avzo\",\n $$css: true\n }\n};\ntype ColorSwatchPickerItemProps = Omit<RACColorSwatchPickerItemProps, 'children' | 'className' | 'style'> & {\n /** What the item draws. A `ColorSwatch` with no `color` of its own by default. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACColorSwatchPickerItemProps['className'];\n /** A function may compute the style from the item's render state. */\n style?: RACColorSwatchPickerItemProps['style'];\n};\ntype ColorSwatchPickerProps = Omit<RACColorSwatchPickerProps, 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACColorSwatchPickerProps['className'];\n /** A function may compute the style from the picker's render state. */\n style?: RACColorSwatchPickerProps['style'];\n};\n\n/**\n * A row of colours to choose one from, drawn as swatches. The value is React\n * Aria's — pass `value` with `onChange` to control it, or `defaultValue` —\n * as a CSS colour string or a `Color` from `parseColor`, which this package\n * re-exports.\n *\n * ```tsx\n * <ColorSwatchPicker defaultValue=\"#6750A4\">\n * <ColorSwatchPicker.Item color=\"#6750A4\" />\n * <ColorSwatchPicker.Item color=\"#625B71\" />\n * </ColorSwatchPicker>\n * ```\n *\n * It is a listbox, so arrow keys move between colours and the chosen one\n * carries a ring. Name it with `aria-label` or `aria-labelledby`; React Aria\n * calls it \"Color swatches\" otherwise.\n *\n * The call site's `className` and `style` land on the picker, which is the\n * element a layout positions.\n */\nfunction ColorSwatchPicker(props: ColorSwatchPickerProps & RefAttributes<HTMLDivElement>) {\n return <RACColorSwatchPicker {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 x1a02dak x126z3so x1t137rt\"\n }, props)} />;\n}\n\n/**\n * One swatch in a {@link ColorSwatchPicker}. Renders a `ColorSwatch` of its\n * own `color` unless given different children.\n */\nfunction ColorSwatchPickerItem({\n children,\n ...props\n}: ColorSwatchPickerItemProps & RefAttributes<HTMLDivElement>) {\n return <RACColorSwatchPickerItem {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {children ?? <ColorSwatch />}\n </RACColorSwatchPickerItem>;\n}\n\n// The item's styles, from React Aria's render state. StyleX cannot target\n// `[data-selected]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters where two styles draw on one property. The hover and\n// press rings come before `selected`, which draws on the same border, so a\n// chosen swatch keeps the ring that says so. `focused` draws on the outline,\n// which nothing else touches, so a swatch that is chosen and focused keeps\n// both. `disabled` is last, so it takes the cursor with it; React Aria\n// reports neither hover nor press on one.\nfunction itemStyles(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}) {\n return stylex.props(styles.item, state.isHovered && styles.itemHovered, state.isPressed && styles.itemPressed, state.isSelected && styles.itemSelected, state.isFocusVisible && styles.itemFocused, state.isDisabled && styles.itemDisabled);\n}\nColorSwatchPicker.Item = ColorSwatchPickerItem;\nexport type { ColorSwatchPickerItemProps, ColorSwatchPickerProps };\nexport { ColorSwatchPickerItem };\nexport default ColorSwatchPicker;"],"mappings":";;;;;;;;AAkDA,MAAMM,SAAS;CACbC,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,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZL,QAAQ;EACRM,QAAQ;EACRF,OAAO;CACT;CACAG,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRN,OAAO;CACT;CACAO,aAAa;EACXC,OAAO;EACPrB,QAAQ;EACRa,OAAO;CACT;CACAS,aAAa;EACXD,OAAO;EACPrB,QAAQ;EACRa,OAAO;CACT;CACAU,cAAc;EACZF,OAAO;EACPrB,QAAQ;EACRa,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAApB,oBAAAiC,OAAA;CAAA,MAAAC,IAAApC,EAAA,CAAA;CAAA,IAAAqC;CAAA,IAAAD,EAAA,OAAAD,OAAA;EAC8CE,KAAAhC,oBAAoB,EAAA6B,WACnD,4CACb,GAAGC,KAAK;EAACC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAD,SAAAC,EAAA,OAAAC,IAAA;EAFFC,KAAA,oBAACa,mBAAD;GAAqB,GAAKhB;GAAK,GAAME;EAEnC,CAAA;EAAID,EAAA,KA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C,OAAO0B,cAAcY,MAAME,kBAAkBxC,OAAOmB,aAAamB,MAAMC,cAAcvC,OAAOiB,YAAY;AAC7O;AACArB,oBAAkBgD,OAAO/C"}
@@ -39,5 +39,4 @@ type ColorWheelProps$1 = Omit<ColorWheelProps, 'children' | 'className' | 'inner
39
39
  * element a layout positions. Its size comes from `outerRadius`.
40
40
  */
41
41
  declare function ColorWheel$1({ className, isDisabled, outerRadius, style, thickness, ...props }: ColorWheelProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
42
- export { type ColorWheelProps$1 as ColorWheelProps, ColorWheel$1 as default };
43
- //# sourceMappingURL=index.d.ts.map
42
+ export { type ColorWheelProps$1 as ColorWheelProps, ColorWheel$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","RefAttributes","ColorWheelProps","RACColorWheelProps","stylex","ColorThumb","RACColorThumb","ColorWheel","RACColorWheel","ColorWheelTrack","RACColorWheelTrack","thumbClassName","mergeStatefulStyles","stateLayerOpacity","DEFAULT_OUTER_RADIUS","DEFAULT_THICKNESS","_temp","kX1K2I","styles","track","kkrTdU","$$css","trackDisabled","trackRing","inner","Math","max","undefined","Omit","className","outerRadius","style","thickness","t0","$","props","t1","t2","t3","isDisabled","innerRadius","t4","0","1","t5","t6","t7","Symbol","for","t8","ColorWheel","_c","props","stylex.props","RACColorWheelTrack","RACColorThumb","RACColorWheel"],"sources":["../../../src/components/color-wheel/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport type { ColorWheelProps as RACColorWheelProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorThumb as RACColorThumb, ColorWheel as RACColorWheel, ColorWheelTrack as RACColorWheelTrack } from 'react-aria-components';\nimport { thumbClassName } from '../../styles/color';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// Hue as a ring. React Aria paints the conic gradient on the track's own\n// inline `background` and sizes it from `outerRadius`, so what is here is\n// the hole in the middle and the handle `ColorSlider` already draws, from\n// `src/styles/color.ts`.\n//\n// The design carries no page for this. Three things follow, each a choice\n// rather than a reading.\n//\n// **The ring's thickness is the sliders page's 16dp track.** A hue wheel and\n// a hue slider are the same control in two shapes, so the band a reader\n// drags along is the same width in both.\n//\n// **The thickness is a prop and the inner radius is not.** React Aria takes\n// both radii and would accept an inner one larger than the outer, which\n// draws nothing at all; deriving it is what stops the two disagreeing.\n//\n// **The hole is cut with a mask, not drawn with a disc on top.** A disc in\n// the wheel's own surface colour would be opaque, so anything the wheel is\n// placed over — a card, a photograph, another control — would be hidden by\n// a circle nothing explains. The mask leaves the middle genuinely empty,\n// which is also what lets a swatch or an area sit inside one.\n\nconst DEFAULT_OUTER_RADIUS = 100;\n// The sliders page's track, which is what a hue slider draws.\nconst DEFAULT_THICKNESS = 16;\nconst _temp = {\n kX1K2I: \"xwjwp01\",\n \"$$css\": true\n};\nconst styles = {\n track: {\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n trackDisabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n trackRing: (inner: number) => [_temp, {\n \"--x-maskImage\": `radial-gradient(circle at center, transparent ${Math.max(0, inner - 0.5)}px, #000 ${inner + 0.5}px)` != null ? `radial-gradient(circle at center, transparent ${Math.max(0, inner - 0.5)}px, #000 ${inner + 0.5}px)` : undefined\n }]\n};\ntype ColorWheelProps = Omit<RACColorWheelProps, 'children' | 'className' | 'innerRadius' | 'outerRadius' | 'style'> & {\n /** A function may compute the class from the wheel's render state. */\n className?: RACColorWheelProps['className'];\n /**\n * How far the ring reaches from the centre, in pixels. The wheel is twice\n * this across.\n * @default 100\n */\n outerRadius?: number;\n /** A function may compute the style from the wheel's render state. */\n style?: RACColorWheelProps['style'];\n /**\n * How wide the band is, in pixels. The inner radius is this in from\n * `outerRadius`, so the two cannot disagree.\n * @default 16\n */\n thickness?: number;\n};\n\n/**\n * Hue as a ring, with a handle on it. The value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue`, as a CSS colour\n * string or a `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorWheel defaultValue=\"hsl(200, 100%, 50%)\" />\n * ```\n *\n * A wheel slides hue and nothing else, so unlike `ColorSlider` and\n * `ColorArea` it names no channel and there is no space for one to be\n * missing from — a hex value works here.\n *\n * The middle is genuinely empty rather than filled, so a `ColorArea` or a\n * `ColorSwatch` can sit inside one. React Aria names the handle \"Hue\" and\n * announces the value; pass `aria-label` to say something else.\n *\n * The call site's `className` and `style` land on the wheel, which is the\n * element a layout positions. Its size comes from `outerRadius`.\n */\nfunction ColorWheel({\n className,\n isDisabled = false,\n outerRadius = DEFAULT_OUTER_RADIUS,\n style,\n thickness = DEFAULT_THICKNESS,\n ...props\n}: ColorWheelProps & RefAttributes<HTMLDivElement>) {\n const innerRadius = Math.max(0, outerRadius - thickness);\n return <RACColorWheel innerRadius={innerRadius} isDisabled={isDisabled} outerRadius={outerRadius} {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x9f619 x1rg5ohu x14ju556\"\n },\n 1: {\n className: \"x9f619 x1rg5ohu x14ju556 x1ppv7y9\"\n }\n }[!!isDisabled << 0], {\n className,\n style\n })}>\n <RACColorWheelTrack {...stylex.props(styles.track, styles.trackRing(innerRadius), isDisabled && styles.trackDisabled)} />\n <RACColorThumb className={thumbClassName} />\n </RACColorWheel>;\n}\nexport type { ColorWheelProps };\nexport default ColorWheel;"],"mappings":";;;;;;;;AAiCA,MAAMe,uBAAuB;AAE7B,MAAMC,oBAAoB;AAC1B,MAAMC,QAAQ;CACZC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,OAAO;CACT;CACAC,eAAe;EACbF,QAAQ;EACRC,OAAO;CACT;CACAE,YAAYC,UAAkB,CAACR,OAAO,EACpC,iBAAiB,iDAAiDS,KAAKC,IAAI,GAAG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AA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,QAAAM,eAAAN,EAAA,QAAAK,YAAA;EAC0BK,KAAAxC,MAAac,OAAMC,OAAQD,OAAMK,UAAWiB,WAAW,GAAGD,cAAcrB,OAAMI,aAAc;EAACY,EAAA,MAAAM;EAAAN,EAAA,MAAAK;EAAAL,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAU,IAAA;EAArHC,KAAA,oBAACS,iBAAD,EAAmB,GAAKV,GAA6F,CAAA;EAAIV,EAAA,MAAAU;EAAAV,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,QAAAa,OAAAC,IAAA,2BAAA,GAAA;EACzHF,KAAA,oBAACS,YAAD,EAA0B5C,WAAAA,eAAc,CAAA;EAAIuB,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAM,eAAAN,EAAA,QAAAK,cAAAL,EAAA,QAAAJ,eAAAI,EAAA,QAAAC,WAAAD,EAAA,QAAAO,MAAAP,EAAA,QAAAW,IAAA;EAZzCI,KAAA,qBAACO,YAAD;GAA4BhB;GAAyBD;GAAyBT;GAAW,GAAMK;GAAK,GAAMM;GAA1G,UAAA,CAWHI,IACAC,EAZiB;;EAaHZ,EAAA,MAAAM;EAAAN,EAAA,MAAAK;EAAAL,EAAA,MAAAJ;EAAAI,EAAA,MAAAC;EAAAD,EAAA,MAAAO;EAAAP,EAAA,MAAAW;EAAAX,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAbXe;AAaW"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","ColorWheel","thumbClassName","mergeStatefulStyles","DEFAULT_OUTER_RADIUS","DEFAULT_THICKNESS","_temp","kX1K2I","styles","track","kkrTdU","$$css","trackDisabled","trackRing","inner","Math","max","undefined","className","outerRadius","style","thickness","t0","$","props","t1","t2","t3","isDisabled","innerRadius","t4","0","1","t5","t6","t7","Symbol","for","t8","RACColorWheelTrack","RACColorThumb","RACColorWheel"],"sources":["../../../src/components/color-wheel/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport type { ColorWheelProps as RACColorWheelProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorThumb as RACColorThumb, ColorWheel as RACColorWheel, ColorWheelTrack as RACColorWheelTrack } from 'react-aria-components';\nimport { thumbClassName } from '../../styles/color';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// Hue as a ring. React Aria paints the conic gradient on the track's own\n// inline `background` and sizes it from `outerRadius`, so what is here is\n// the hole in the middle and the handle `ColorSlider` already draws, from\n// `src/styles/color.ts`.\n//\n// The design carries no page for this. Three things follow, each a choice\n// rather than a reading.\n//\n// **The ring's thickness is the sliders page's 16dp track.** A hue wheel and\n// a hue slider are the same control in two shapes, so the band a reader\n// drags along is the same width in both.\n//\n// **The thickness is a prop and the inner radius is not.** React Aria takes\n// both radii and would accept an inner one larger than the outer, which\n// draws nothing at all; deriving it is what stops the two disagreeing.\n//\n// **The hole is cut with a mask, not drawn with a disc on top.** A disc in\n// the wheel's own surface colour would be opaque, so anything the wheel is\n// placed over — a card, a photograph, another control — would be hidden by\n// a circle nothing explains. The mask leaves the middle genuinely empty,\n// which is also what lets a swatch or an area sit inside one.\n\nconst DEFAULT_OUTER_RADIUS = 100;\n// The sliders page's track, which is what a hue slider draws.\nconst DEFAULT_THICKNESS = 16;\nconst _temp = {\n kX1K2I: \"xwjwp01\",\n \"$$css\": true\n};\nconst styles = {\n track: {\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n trackDisabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n trackRing: (inner: number) => [_temp, {\n \"--x-maskImage\": `radial-gradient(circle at center, transparent ${Math.max(0, inner - 0.5)}px, #000 ${inner + 0.5}px)` != null ? `radial-gradient(circle at center, transparent ${Math.max(0, inner - 0.5)}px, #000 ${inner + 0.5}px)` : undefined\n }]\n};\ntype ColorWheelProps = Omit<RACColorWheelProps, 'children' | 'className' | 'innerRadius' | 'outerRadius' | 'style'> & {\n /** A function may compute the class from the wheel's render state. */\n className?: RACColorWheelProps['className'];\n /**\n * How far the ring reaches from the centre, in pixels. The wheel is twice\n * this across.\n * @default 100\n */\n outerRadius?: number;\n /** A function may compute the style from the wheel's render state. */\n style?: RACColorWheelProps['style'];\n /**\n * How wide the band is, in pixels. The inner radius is this in from\n * `outerRadius`, so the two cannot disagree.\n * @default 16\n */\n thickness?: number;\n};\n\n/**\n * Hue as a ring, with a handle on it. The value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue`, as a CSS colour\n * string or a `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorWheel defaultValue=\"hsl(200, 100%, 50%)\" />\n * ```\n *\n * A wheel slides hue and nothing else, so unlike `ColorSlider` and\n * `ColorArea` it names no channel and there is no space for one to be\n * missing from — a hex value works here.\n *\n * The middle is genuinely empty rather than filled, so a `ColorArea` or a\n * `ColorSwatch` can sit inside one. React Aria names the handle \"Hue\" and\n * announces the value; pass `aria-label` to say something else.\n *\n * The call site's `className` and `style` land on the wheel, which is the\n * element a layout positions. Its size comes from `outerRadius`.\n */\nfunction ColorWheel({\n className,\n isDisabled = false,\n outerRadius = DEFAULT_OUTER_RADIUS,\n style,\n thickness = DEFAULT_THICKNESS,\n ...props\n}: ColorWheelProps & RefAttributes<HTMLDivElement>) {\n const innerRadius = Math.max(0, outerRadius - thickness);\n return <RACColorWheel innerRadius={innerRadius} isDisabled={isDisabled} outerRadius={outerRadius} {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x9f619 x1rg5ohu x14ju556\"\n },\n 1: {\n className: \"x9f619 x1rg5ohu x14ju556 x1ppv7y9\"\n }\n }[!!isDisabled << 0], {\n className,\n style\n })}>\n <RACColorWheelTrack {...stylex.props(styles.track, styles.trackRing(innerRadius), isDisabled && styles.trackDisabled)} />\n <RACColorThumb className={thumbClassName} />\n </RACColorWheel>;\n}\nexport type { ColorWheelProps };\nexport default ColorWheel;"],"mappings":";;;;;;;;AAiCA,MAAMK,uBAAuB;AAE7B,MAAMC,oBAAoB;AAC1B,MAAMC,QAAQ;CACZC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,OAAO;CACT;CACAC,eAAe;EACbF,QAAQ;EACRC,OAAO;CACT;CACAE,YAAYC,UAAkB,CAACR,OAAO,EACpC,iBAAiB,iDAAiDS,KAAKC,IAAI,GAAGF,QAAQ,EAAG,EAAC,WAAYA,QAAQ,GAAG,QAAS,OAAO,iDAAiDC,KAAKC,IAAI,GAAGF,QAAQ,EAAG,EAAC,WAAYA,QAAQ,GAAG,OAAQG,KAAAA,EAC3O,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAAhB,aAAAqB,IAAA;CAAA,MAAAC,IAAAxB,EAAA,EAAA;CAAA,IAAAmB;CAAA,IAAAM;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAoB,CAAA,CAAAJ,WAAAU,YAAAH,IAAAN,aAAAO,IAAAN,OAAAC,WAAAM,IAAA,GAAAH,WAAAF;EAO8BC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAC;EAAAD,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAT,YAAAK,EAAA;EAAAC,UAAAD,EAAA;EAAAH,QAAAG,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CALhD,M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MAAAP,EAAA,QAAAW,IAAA;EAZzCI,KAAA,qBAACG,YAAD;GAA4BZ;GAAyBD;GAAyBT;GAAW,GAAMK;GAAK,GAAMM;GAA1G,UAAA,CAWHI,IACAC,EAZiB;;EAaHZ,EAAA,MAAAM;EAAAN,EAAA,MAAAK;EAAAL,EAAA,MAAAJ;EAAAI,EAAA,MAAAC;EAAAD,EAAA,MAAAO;EAAAP,EAAA,MAAAW;EAAAX,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAbXe;AAaW"}
@@ -95,5 +95,4 @@ type ComboBoxSelectionMode = 'multiple' | 'single';
95
95
  * which is the element a layout positions.
96
96
  */
97
97
  declare function ComboBox$1<T extends object = object, M extends ComboBoxSelectionMode = 'single'>({ container, description, error, floatingLabel, inputRef, isDisabled, label, leadingIcon, options, variant, ...props }: ComboBoxProps$1<T, M> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
98
- export { type ComboBoxProps$1 as ComboBoxProps, type ComboBoxSelectionMode, ComboBox$1 as default };
99
- //# sourceMappingURL=index.d.ts.map
98
+ export { type ComboBoxProps$1 as ComboBoxProps, type ComboBoxSelectionMode, ComboBox$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactElement","ReactNode","Ref","RefAttributes","RefObject","PopoverRenderProps","ComboBoxProps","RACComboBoxProps","stylex","useContext","useRef","ComboBoxStateContext","Button","RACButton","ComboBox","RACComboBox","ComboBoxValue","RACComboBoxValue","Popover","RACPopover","FieldVariant","FieldBox","FieldInput","FieldMessage","FieldValue","fieldStyles","invalidFrom","useFieldValidationBehavior","ChevronEndGlyph","focus","mergeStatefulStyles","overlay","popupOrigin","colors","motion","radii","spacing","ListBox","TOGGLE","styles","list","kWkggS","kaIpWk","kzqmXN","kskxy","ks0D6T","k7Eaqz","kORKVm","k8WAf4","$$css","toggle","kGNEyG","kZKoxP","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kjj79g","kmVPX3","ComboBoxSelectionMode","container","Element","description","error","floatingLabel","inputRef","HTMLInputElement","label","leadingIcon","options","item","T","variant","Omit","M","ChosenValues","$","t0","Symbol","for","t1","isDisabled","t2","t3","props","undefined","validationBehavior","boxRef","T0","t4","t5","root","t6","t7","isRequired","t8","selectionMode","t9","t10","t11","t12","listClassName","t13","ComboBoxBox","isInvalid","multiple","state","chosen","selectedItems","length","ComboToggle","ring","0","className","1","isOpen","popup","placement","_c","RACComboBoxValue","ComboBox","props","RACComboBox","stylex.props","ListBox","RACPopover","RACButton"],"sources":["../../../src/components/combo-box/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement, ReactNode, Ref, RefAttributes, RefObject } from 'react';\nimport type { PopoverRenderProps, ComboBoxProps as RACComboBoxProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useRef } from 'react';\nimport { ComboBoxStateContext, Button as RACButton, ComboBox as RACComboBox, ComboBoxValue as RACComboBoxValue, Popover as RACPopover } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing } from '../../tokens/design.tokens.stylex';\nimport ListBox from '../list-box';\n\n// The text fields page's autocomplete text field: a text field that filters a\n// list as it is typed. Everything above the list is the field chrome in\n// `src/field` — the same box, label, supporting line and error treatment\n// every other field draws — and the list is ListBox on the shared overlay\n// surface, positioned and sized against the box exactly as Select's is.\n//\n// It is Select's shape with two differences.\n//\n// The control is a real input, so the box is not a press target — typing has\n// to reach the input — and only the chevron at the end opens the list. That\n// is what the page draws too: an autocomplete text field is a text field,\n// with a button on it.\n//\n// And the field is an element tree rather than a function of React Aria's\n// render state, which every other component here writes. React Aria builds a\n// combo box's collection by walking its children for options, and a function\n// is opaque to that walk: with one, the collection is empty until the list\n// has been opened, so a `defaultSelectedKey` resolves to no text and the\n// field starts blank. What needed the render state — whether the list is\n// open — reads the combo box's own state from context instead.\n//\n// Two more things are this component's own.\n//\n// **Filtering is React Aria's, and stays theirs.** `defaultFilter` takes a\n// predicate, and the package re-exports `useFilter` for a locale-aware one;\n// `items` with `useAsyncList` is how a list that is fetched rather than\n// listed gets in. None of that is wrapped, because a combo box's whole job\n// is which options it shows and a wrapper would be a second place to decide\n// it.\n//\n// **A value that is not in the list is allowed or refused, not corrected.**\n// `allowsCustomValue` is React Aria's, and with it off the input reverts to\n// the last chosen option on blur rather than keeping text that means nothing.\n//\n// Choosing more than one is `selectionMode=\"multiple\"`, which draws the\n// chosen options before the input on its line, through React Aria's\n// `ComboBoxValue`, with the label floated over them. For a field that draws\n// each of them as a removable chip, the coverage plan has TokenField.\n\n// Hoisted so it is not a new element on every render, which is what\n// react-perf's jsx-no-jsx-as-prop is after.\nconst TOGGLE = <ComboToggle />;\nconst styles = {\n list: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n kzqmXN: \"xlvufjm\",\n kskxy: \"xedcshv\",\n ks0D6T: \"x1x1rfll\",\n k7Eaqz: \"xeuugli\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n toggle: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xxk0z11\",\n kaIpWk: \"x16fbrrb\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kzqmXN: \"xvy4d1p\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\ntype ComboBoxProps<T extends object = object, M extends ComboBoxSelectionMode = 'single'> = {\n /**\n * Where to portal the list. Defaults to the container of the `ThemeScope`\n * around it, which keeps the list on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the list\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value. `false` keeps it small at the top in\n * every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field is for. Required rather than optional: a combo box with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * The options. `ListBox.Item` for each, and `ListBox.Section` to group\n * them — the list inside is a ListBox, and takes everything one does. With\n * `items` or `defaultItems`, a function from an item to its option, which\n * React Aria calls for each item the list shows.\n */\n options?: ((item: T) => ReactElement) | ReactNode;\n /**\n * The filled box, or the outlined one, as the text fields page draws them.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACComboBoxProps<T, M>, 'children' | 'defaultSelectedKey' | 'isInvalid' | 'onSelectionChange' | 'selectedKey' | 'validationBehavior'>;\n\n// React Aria's combo box takes its own two-value selection mode rather than\n// the collection-wide one, which also has `none`; that type is local to its\n// module, so the two values are named again here.\ntype ComboBoxSelectionMode = 'multiple' | 'single';\n\n/**\n * The chosen options, drawn before the input on its line when more than one\n * may be chosen. The chrome's `FieldValue` is the styled element and React\n * Aria's `ComboBoxValue` sits inside it, as it does in Select.\n */\nfunction ChosenValues() {\n return <FieldValue>\n <RACComboBoxValue className=\"xb3r6kr xlyipyv xuxw1ft\" />\n </FieldValue>;\n}\n\n/**\n * A labelled text field that filters a list as it is typed. Its value is\n * React Aria's: pass `value` with `onChange` to control which option is\n * chosen, `inputValue` with `onInputChange` to control the text, or the\n * `default` forms of either to let it keep its own. React Aria's older\n * `selectedKey` names are deprecated and are left out of this component's\n * props rather than passed through.\n *\n * ```tsx\n * <ComboBox\n * label=\"Label\"\n * options={\n * <>\n * <ListBox.Item id=\"first\">First item</ListBox.Item>\n * <ListBox.Item id=\"second\">Second item</ListBox.Item>\n * </>\n * }\n * />\n * ```\n *\n * Filtering is React Aria's: `defaultFilter` takes a predicate, `useFilter`\n * is re-exported for a locale-aware one, and `items` with `useAsyncList`\n * feeds a list that is fetched rather than listed. `allowsCustomValue` lets\n * the field keep text that matches nothing.\n *\n * The box, label, input, supporting line and error are the field chrome in\n * `src/field`, shared with every other field; the list is ListBox on the\n * overlay surface every anchored panel here draws.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction ComboBox<T extends object = object, M extends ComboBoxSelectionMode = 'single'>({\n container,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n options,\n variant = 'filled',\n ...props\n}: ComboBoxProps<T, M> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n // What the list is anchored to and takes its width from: the box, not the\n // button inside it, which is a 24dp icon.\n const boxRef = useRef<HTMLDivElement>(null);\n return <RACComboBox<T, M> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <ComboBoxBox boxRef={boxRef} floatingLabel={floatingLabel} inputRef={inputRef} isDisabled={isDisabled} isInvalid={invalidFrom(error)} isRequired={props.isRequired ?? false} label={label} leadingIcon={leadingIcon} multiple={props.selectionMode === 'multiple'} variant={variant} />\n <FieldMessage description={description} error={error} />\n <RACPopover className={listClassName} triggerRef={boxRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <ListBox<T>>{options}</ListBox>\n </RACPopover>\n </RACComboBox>;\n}\n\n/**\n * The box and what it holds. Its own component so it can read React Aria's\n * state for what is chosen: with more than one option allowed, the input is\n * empty while options are chosen, so it cannot be what says the field holds\n * something. The box is told instead, and the label floats over the chosen\n * options rather than resting on them. Otherwise the box reads the input, as\n * it does for one option, which is what floats the label on typed text.\n */\nfunction ComboBoxBox({\n boxRef,\n floatingLabel,\n inputRef,\n isDisabled,\n isInvalid,\n isRequired,\n label,\n leadingIcon,\n multiple,\n variant\n}: {\n boxRef: RefObject<HTMLDivElement | null>;\n floatingLabel: boolean;\n inputRef: Ref<HTMLInputElement> | undefined;\n isDisabled: boolean;\n isInvalid: boolean | undefined;\n isRequired: boolean;\n label: string;\n leadingIcon: ReactNode;\n multiple: boolean;\n variant: FieldVariant;\n}) {\n const state = useContext(ComboBoxStateContext);\n const chosen = multiple && (state?.selectedItems.length ?? 0) > 0;\n return <FieldBox floatingLabel={floatingLabel}\n // React Aria's `TextField` hands its group the field's disabled and\n // invalid state through context; its `ComboBox` does not, so the box\n // is told outright or its label and its underline never turn.\n isDisabled={isDisabled} isInvalid={isInvalid} isPopulated={chosen ? true : undefined} isRequired={isRequired} label={label} leading={leadingIcon} ref={boxRef} trailing={TOGGLE} variant={variant}>\n {multiple ? <span className=\"xpr5407 xrvj5dj xuptkxw\">\n <ChosenValues />\n <FieldInput ref={inputRef} />\n </span> : <FieldInput ref={inputRef} />}\n </FieldBox>;\n}\n\n/**\n * The button that opens the list. It takes its press behaviour from the\n * combo box around it through React Aria's button context, and reads whether\n * the list is open from the combo box's state rather than from a render prop\n * — the whole field cannot be a render function, since React Aria builds its\n * collection by walking the children and a function is opaque to that walk.\n */\nfunction ComboToggle() {\n const state = useContext(ComboBoxStateContext);\n return <RACButton {...stylex.props(styles.toggle, focus.ring)}>\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p x1iffjtl xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x9tu13d\"\n }\n }[!!(state?.isOpen === true) << 0]} />\n </RACButton>;\n}\n\n// The list's classes, from React Aria's render state: it grows from the\n// edge it is anchored by, as every anchored overlay does, so a list that\n// opens above the field grows upward.\nfunction listClassName(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.list, popupOrigin(state.placement)).className ?? '';\n}\nexport type { ComboBoxProps, ComboBoxSelectionMode };\nexport default ComboBox;"],"mappings":";;;;;;;;;;;;;;AA2DA,MAAMwC,SAAS,oBAAC,aAAD,CAAY,CAAA;AAC3B,MAAMC,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRV,OAAO;CACT;AACF;;;;;;AAwEA,SAAA2B,eAAA;CAAA,MAAAC,IAAA9E,EAAA,CAAA;CAAA,IAAA+E;CAAA,IAAAD,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EACSF,KAAA,oBAAC,YAAD,EAAA,UACH,oBAAC0C,eAAD,EAA4B,WAAA,0BAAyB,CAAA,EADvC,CAAA;EAEH3C,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAFRC;AAE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,SAASkB,cAAcK,OAA2B;CAChD,OAAOnG,MAAauB,QAAQsF,OAAO9E,OAAOC,MAAMR,YAAY2E,MAAMW,SAAS,CAAC,CAAC,CAACJ,aAAa;AAC7F"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useContext","useRef","ComboBoxStateContext","ComboBox","RACComboBox","fieldStyles","invalidFrom","useFieldValidationBehavior","focus","mergeStatefulStyles","overlay","popupOrigin","TOGGLE","styles","list","kWkggS","kaIpWk","kzqmXN","kskxy","ks0D6T","k7Eaqz","kORKVm","k8WAf4","$$css","toggle","kGNEyG","kZKoxP","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kjj79g","kmVPX3","container","description","error","floatingLabel","inputRef","label","leadingIcon","options","variant","ChosenValues","$","t0","Symbol","for","t1","isDisabled","t2","t3","props","undefined","validationBehavior","boxRef","T0","t4","t5","root","t6","t7","isRequired","t8","selectionMode","t9","t10","t11","t12","listClassName","t13","ComboBoxBox","isInvalid","multiple","state","selectedItems","length","ComboToggle","ring","0","className","1","isOpen","popup","placement","RACComboBoxValue","ListBox","RACPopover","RACButton"],"sources":["../../../src/components/combo-box/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement, ReactNode, Ref, RefAttributes, RefObject } from 'react';\nimport type { PopoverRenderProps, ComboBoxProps as RACComboBoxProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useRef } from 'react';\nimport { ComboBoxStateContext, Button as RACButton, ComboBox as RACComboBox, ComboBoxValue as RACComboBoxValue, Popover as RACPopover } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing } from '../../tokens/design.tokens.stylex';\nimport ListBox from '../list-box';\n\n// The text fields page's autocomplete text field: a text field that filters a\n// list as it is typed. Everything above the list is the field chrome in\n// `src/field` — the same box, label, supporting line and error treatment\n// every other field draws — and the list is ListBox on the shared overlay\n// surface, positioned and sized against the box exactly as Select's is.\n//\n// It is Select's shape with two differences.\n//\n// The control is a real input, so the box is not a press target — typing has\n// to reach the input — and only the chevron at the end opens the list. That\n// is what the page draws too: an autocomplete text field is a text field,\n// with a button on it.\n//\n// And the field is an element tree rather than a function of React Aria's\n// render state, which every other component here writes. React Aria builds a\n// combo box's collection by walking its children for options, and a function\n// is opaque to that walk: with one, the collection is empty until the list\n// has been opened, so a `defaultSelectedKey` resolves to no text and the\n// field starts blank. What needed the render state — whether the list is\n// open — reads the combo box's own state from context instead.\n//\n// Two more things are this component's own.\n//\n// **Filtering is React Aria's, and stays theirs.** `defaultFilter` takes a\n// predicate, and the package re-exports `useFilter` for a locale-aware one;\n// `items` with `useAsyncList` is how a list that is fetched rather than\n// listed gets in. None of that is wrapped, because a combo box's whole job\n// is which options it shows and a wrapper would be a second place to decide\n// it.\n//\n// **A value that is not in the list is allowed or refused, not corrected.**\n// `allowsCustomValue` is React Aria's, and with it off the input reverts to\n// the last chosen option on blur rather than keeping text that means nothing.\n//\n// Choosing more than one is `selectionMode=\"multiple\"`, which draws the\n// chosen options before the input on its line, through React Aria's\n// `ComboBoxValue`, with the label floated over them. For a field that draws\n// each of them as a removable chip, the coverage plan has TokenField.\n\n// Hoisted so it is not a new element on every render, which is what\n// react-perf's jsx-no-jsx-as-prop is after.\nconst TOGGLE = <ComboToggle />;\nconst styles = {\n list: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n kzqmXN: \"xlvufjm\",\n kskxy: \"xedcshv\",\n ks0D6T: \"x1x1rfll\",\n k7Eaqz: \"xeuugli\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n toggle: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xxk0z11\",\n kaIpWk: \"x16fbrrb\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kzqmXN: \"xvy4d1p\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\ntype ComboBoxProps<T extends object = object, M extends ComboBoxSelectionMode = 'single'> = {\n /**\n * Where to portal the list. Defaults to the container of the `ThemeScope`\n * around it, which keeps the list on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the list\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value. `false` keeps it small at the top in\n * every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field is for. Required rather than optional: a combo box with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * The options. `ListBox.Item` for each, and `ListBox.Section` to group\n * them — the list inside is a ListBox, and takes everything one does. With\n * `items` or `defaultItems`, a function from an item to its option, which\n * React Aria calls for each item the list shows.\n */\n options?: ((item: T) => ReactElement) | ReactNode;\n /**\n * The filled box, or the outlined one, as the text fields page draws them.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACComboBoxProps<T, M>, 'children' | 'defaultSelectedKey' | 'isInvalid' | 'onSelectionChange' | 'selectedKey' | 'validationBehavior'>;\n\n// React Aria's combo box takes its own two-value selection mode rather than\n// the collection-wide one, which also has `none`; that type is local to its\n// module, so the two values are named again here.\ntype ComboBoxSelectionMode = 'multiple' | 'single';\n\n/**\n * The chosen options, drawn before the input on its line when more than one\n * may be chosen. The chrome's `FieldValue` is the styled element and React\n * Aria's `ComboBoxValue` sits inside it, as it does in Select.\n */\nfunction ChosenValues() {\n return <FieldValue>\n <RACComboBoxValue className=\"xb3r6kr xlyipyv xuxw1ft\" />\n </FieldValue>;\n}\n\n/**\n * A labelled text field that filters a list as it is typed. Its value is\n * React Aria's: pass `value` with `onChange` to control which option is\n * chosen, `inputValue` with `onInputChange` to control the text, or the\n * `default` forms of either to let it keep its own. React Aria's older\n * `selectedKey` names are deprecated and are left out of this component's\n * props rather than passed through.\n *\n * ```tsx\n * <ComboBox\n * label=\"Label\"\n * options={\n * <>\n * <ListBox.Item id=\"first\">First item</ListBox.Item>\n * <ListBox.Item id=\"second\">Second item</ListBox.Item>\n * </>\n * }\n * />\n * ```\n *\n * Filtering is React Aria's: `defaultFilter` takes a predicate, `useFilter`\n * is re-exported for a locale-aware one, and `items` with `useAsyncList`\n * feeds a list that is fetched rather than listed. `allowsCustomValue` lets\n * the field keep text that matches nothing.\n *\n * The box, label, input, supporting line and error are the field chrome in\n * `src/field`, shared with every other field; the list is ListBox on the\n * overlay surface every anchored panel here draws.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction ComboBox<T extends object = object, M extends ComboBoxSelectionMode = 'single'>({\n container,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n options,\n variant = 'filled',\n ...props\n}: ComboBoxProps<T, M> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n // What the list is anchored to and takes its width from: the box, not the\n // button inside it, which is a 24dp icon.\n const boxRef = useRef<HTMLDivElement>(null);\n return <RACComboBox<T, M> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <ComboBoxBox boxRef={boxRef} floatingLabel={floatingLabel} inputRef={inputRef} isDisabled={isDisabled} isInvalid={invalidFrom(error)} isRequired={props.isRequired ?? false} label={label} leadingIcon={leadingIcon} multiple={props.selectionMode === 'multiple'} variant={variant} />\n <FieldMessage description={description} error={error} />\n <RACPopover className={listClassName} triggerRef={boxRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <ListBox<T>>{options}</ListBox>\n </RACPopover>\n </RACComboBox>;\n}\n\n/**\n * The box and what it holds. Its own component so it can read React Aria's\n * state for what is chosen: with more than one option allowed, the input is\n * empty while options are chosen, so it cannot be what says the field holds\n * something. The box is told instead, and the label floats over the chosen\n * options rather than resting on them. Otherwise the box reads the input, as\n * it does for one option, which is what floats the label on typed text.\n */\nfunction ComboBoxBox({\n boxRef,\n floatingLabel,\n inputRef,\n isDisabled,\n isInvalid,\n isRequired,\n label,\n leadingIcon,\n multiple,\n variant\n}: {\n boxRef: RefObject<HTMLDivElement | null>;\n floatingLabel: boolean;\n inputRef: Ref<HTMLInputElement> | undefined;\n isDisabled: boolean;\n isInvalid: boolean | undefined;\n isRequired: boolean;\n label: string;\n leadingIcon: ReactNode;\n multiple: boolean;\n variant: FieldVariant;\n}) {\n const state = useContext(ComboBoxStateContext);\n const chosen = multiple && (state?.selectedItems.length ?? 0) > 0;\n return <FieldBox floatingLabel={floatingLabel}\n // React Aria's `TextField` hands its group the field's disabled and\n // invalid state through context; its `ComboBox` does not, so the box\n // is told outright or its label and its underline never turn.\n isDisabled={isDisabled} isInvalid={isInvalid} isPopulated={chosen ? true : undefined} isRequired={isRequired} label={label} leading={leadingIcon} ref={boxRef} trailing={TOGGLE} variant={variant}>\n {multiple ? <span className=\"xpr5407 xrvj5dj xuptkxw\">\n <ChosenValues />\n <FieldInput ref={inputRef} />\n </span> : <FieldInput ref={inputRef} />}\n </FieldBox>;\n}\n\n/**\n * The button that opens the list. It takes its press behaviour from the\n * combo box around it through React Aria's button context, and reads whether\n * the list is open from the combo box's state rather than from a render prop\n * — the whole field cannot be a render function, since React Aria builds its\n * collection by walking the children and a function is opaque to that walk.\n */\nfunction ComboToggle() {\n const state = useContext(ComboBoxStateContext);\n return <RACButton {...stylex.props(styles.toggle, focus.ring)}>\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p x1iffjtl xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x9tu13d\"\n }\n }[!!(state?.isOpen === true) << 0]} />\n </RACButton>;\n}\n\n// The list's classes, from React Aria's render state: it grows from the\n// edge it is anchored by, as every anchored overlay does, so a list that\n// opens above the field grows upward.\nfunction listClassName(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.list, popupOrigin(state.placement)).className ?? '';\n}\nexport type { ComboBoxProps, ComboBoxSelectionMode };\nexport default ComboBox;"],"mappings":";;;;;;;;;;;;;;AA2DA,MAAMc,SAAS,oBAAC,aAAD,CAAY,CAAA;AAC3B,MAAMC,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,Q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AA,OAAAA,KAAAJ,EAAA;CAPsB,MAAAM,KAAAF,GAOrB,CAAC,EAAE0B,OAAKQ,WAAa,SAAS;CAAE,IAAA/B;CAAA,IAAAP,EAAA,OAAAM,IAAA;EAR7BC,KAAA,oBAACqC,QAAD;GAAU,GAAK3C;GAClB,UAAA,oBAAC,iBAAD,EAAgB,GAAKK,GAOW,CAAA;EARnB,CAAA;EASHN,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OATPO;AASO;AAMhB,SAASkB,cAAcK,OAA2B;CAChD,OAAO3E,MAAaW,QAAQyE,OAAOtE,OAAOC,MAAMH,YAAY+D,MAAMU,SAAS,CAAC,CAAC,CAACJ,aAAa;AAC7F"}
@@ -30,5 +30,4 @@ type ContainerProps = RenderComponentProps<'div'> & {
30
30
  * `<section>` rather than a `<div>`.
31
31
  */
32
32
  declare function Container({ maxInlineSize, padding, render, ...props }: ContainerProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
33
- export { type ContainerProps, Container as default };
34
- //# sourceMappingURL=index.d.ts.map
33
+ export { type ContainerProps, Container as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","stylex","RenderComponentProps","useRender","mergeStyles","spacing","DEFAULT_MAX_INLINE_SIZE","MEDIUM_WINDOW","_temp","kB7OPa","kzqmXN","kUOVxO","ks0D6T","styles","paddingDefault","kg3NbH","$$css","paddingNone","root","maxInlineSize","val","undefined","ContainerProps","padding","Container","t0","$","render","t1","t2","t3","t4","t5","t6","t7","props","padded","defaultTagName","_c","props","stylex.props"],"sources":["../../../src/components/container/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// The width fourteen of this library's own story files already centre their\n// page on, which is what makes it the default rather than a number picked\n// here. A measure is a property of the content: 960px suits a page of mixed\n// components, and prose wants something nearer 58ch, which is what the story\n// files that hold prose use. Say which one you mean rather than taking this.\nconst DEFAULT_MAX_INLINE_SIZE = '960px';\n\n// One pixel of the layout pages' own breakpoint: a compact window is below\n// 600, and a medium window starts at it.\nconst MEDIUM_WINDOW = '@media (width >= 600px)';\n\n// A dynamic style rather than a static one, for the same reason Feed's is:\n// the measure comes from the call site and StyleX compiles its classes ahead\n// of time, so the value is written to a custom property inline instead.\n//\n// No Material Design page draws a page container; the layout pages give the\n// margins one keeps. The gutter is the margin those pages give a window of\n// each size — 16dp while the window is compact, 24dp from medium up — and\n// the measure is the call site's, since the pages leave a pane's width to\n// its content.\nconst _temp = {\n kB7OPa: \"x9f619\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xvueqy4\",\n ks0D6T: \"x13i5qev\",\n \"$$css\": true\n};\nconst styles = {\n paddingDefault: {\n kg3NbH: \"x790zyz x1njmi9r\",\n $$css: true\n },\n paddingNone: {\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n root: (maxInlineSize: string) => [_temp, {\n \"--x-maxInlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(maxInlineSize)\n }]\n};\ntype ContainerProps = RenderComponentProps<'div'> & {\n /**\n * How wide the content may run before it stops growing. The container is\n * centred in whatever space is left over.\n *\n * Worth setting. The default suits a page of mixed components; prose wants\n * a measure in `ch`, since what makes a line hard to read is how many\n * characters it holds rather than how many pixels.\n * @default '960px'\n */\n maxInlineSize?: string;\n /**\n * Inline padding, which is what keeps the content off the edge of the\n * window once it is narrower than the measure. `none` is for a container\n * nested inside one that already has it.\n * @default 'default'\n */\n padding?: 'default' | 'none';\n};\n\n/**\n * A centred measure for a page or a section of one: content grows to a width\n * and stops, with the leftover space split evenly either side.\n *\n * Layout only — it paints no surface and gives its children no container of\n * their own, which is what separates it from Card. It sets no gaps either, so\n * reach for Stack inside it for the rhythm between sections.\n *\n * `render` swaps the element, for a container that should be a `<main>` or a\n * `<section>` rather than a `<div>`.\n */\nfunction Container({\n maxInlineSize = DEFAULT_MAX_INLINE_SIZE,\n padding = 'default',\n render,\n ...props\n}: ContainerProps) {\n const padded = padding === 'none' ? styles.paddingNone : styles.paddingDefault;\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n ...mergeStyles(stylex.props(styles.root(maxInlineSize), padded), props)\n },\n render\n });\n}\nexport type { ContainerProps };\nexport default Container;"],"mappings":";;;;;;AAcA,MAAMO,0BAA0B;AAehC,MAAME,QAAQ;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,gBAAgB;EACdC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXF,QAAQ;EACRC,OAAO;CACT;CACAE,OAAOC,kBAA0B,CAACX,OAAO,EACvC,uBAAsBY,QAAO,OAAOA,QAAQ,WAAWA,MAAM,OAAOA,OAAO,OAAOA,MAAMC,KAAAA,EAAAA,CAAWF,aAAa,EAClH,CAAC;AACH;;;;;;;;;;;;AAgCA,SAAAK,UAAAC,IAAA;CAAA,MAAAC,IAAA1B,EAAA,EAAA;CAAA,IAAA2B;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAmB,MAAA,EAAAN,eAAAa,IAAAT,SAAAU,IAAAN,QAAAO,IAAA,GAAAC,YAAAV;EAAAE,SAAAO;EACjB,MAAAf,gBAAAa,OAAAX,KAAAA,IAAAf,0BAAA0B;EAKA,MAAAI,UAJAH,OAAAZ,KAAAA,IAAA,YAAAY,QAI2B,SAASpB,OAAMI,cAAeJ,OAAMC;EACxDX,KAAAA;EACW2B,KAAA;EAEXK,KAAAA;EACAN,KAAAzB,YAAYH,MAAaY,OAAMK,KAAMC,aAAa,GAAGiB,MAAM,GAAGD,OAAK;EAACT,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAJ,SAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EAFlEG,KAAA;GAAA,GACFG;GAAK,GACLN;EACL;EAACH,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAC,UAAAD,EAAA,QAAAI,MAAAJ,EAAA,QAAAM,IAAA;EALcC,KAAA;GAAAI,gBACCP;GAAKK,OACdH;GAGNL;EAEH;EAACD,EAAA,KAAAC;EAAAD,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAPMvB,GAAU8B,EAOhB;AAAC"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useRender","mergeStyles","DEFAULT_MAX_INLINE_SIZE","_temp","kB7OPa","kzqmXN","kUOVxO","ks0D6T","styles","paddingDefault","kg3NbH","$$css","paddingNone","root","maxInlineSize","val","undefined","padding","Container","t0","$","render","t1","t2","t3","t4","t5","t6","t7","props","padded","defaultTagName"],"sources":["../../../src/components/container/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// The width fourteen of this library's own story files already centre their\n// page on, which is what makes it the default rather than a number picked\n// here. A measure is a property of the content: 960px suits a page of mixed\n// components, and prose wants something nearer 58ch, which is what the story\n// files that hold prose use. Say which one you mean rather than taking this.\nconst DEFAULT_MAX_INLINE_SIZE = '960px';\n\n// One pixel of the layout pages' own breakpoint: a compact window is below\n// 600, and a medium window starts at it.\nconst MEDIUM_WINDOW = '@media (width >= 600px)';\n\n// A dynamic style rather than a static one, for the same reason Feed's is:\n// the measure comes from the call site and StyleX compiles its classes ahead\n// of time, so the value is written to a custom property inline instead.\n//\n// No Material Design page draws a page container; the layout pages give the\n// margins one keeps. The gutter is the margin those pages give a window of\n// each size — 16dp while the window is compact, 24dp from medium up — and\n// the measure is the call site's, since the pages leave a pane's width to\n// its content.\nconst _temp = {\n kB7OPa: \"x9f619\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xvueqy4\",\n ks0D6T: \"x13i5qev\",\n \"$$css\": true\n};\nconst styles = {\n paddingDefault: {\n kg3NbH: \"x790zyz x1njmi9r\",\n $$css: true\n },\n paddingNone: {\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n root: (maxInlineSize: string) => [_temp, {\n \"--x-maxInlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(maxInlineSize)\n }]\n};\ntype ContainerProps = RenderComponentProps<'div'> & {\n /**\n * How wide the content may run before it stops growing. The container is\n * centred in whatever space is left over.\n *\n * Worth setting. The default suits a page of mixed components; prose wants\n * a measure in `ch`, since what makes a line hard to read is how many\n * characters it holds rather than how many pixels.\n * @default '960px'\n */\n maxInlineSize?: string;\n /**\n * Inline padding, which is what keeps the content off the edge of the\n * window once it is narrower than the measure. `none` is for a container\n * nested inside one that already has it.\n * @default 'default'\n */\n padding?: 'default' | 'none';\n};\n\n/**\n * A centred measure for a page or a section of one: content grows to a width\n * and stops, with the leftover space split evenly either side.\n *\n * Layout only — it paints no surface and gives its children no container of\n * their own, which is what separates it from Card. It sets no gaps either, so\n * reach for Stack inside it for the rhythm between sections.\n *\n * `render` swaps the element, for a container that should be a `<main>` or a\n * `<section>` rather than a `<div>`.\n */\nfunction Container({\n maxInlineSize = DEFAULT_MAX_INLINE_SIZE,\n padding = 'default',\n render,\n ...props\n}: ContainerProps) {\n const padded = padding === 'none' ? styles.paddingNone : styles.paddingDefault;\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n ...mergeStyles(stylex.props(styles.root(maxInlineSize), padded), props)\n },\n render\n });\n}\nexport type { ContainerProps };\nexport default Container;"],"mappings":";;;;;;AAcA,MAAMI,0BAA0B;AAehC,MAAMC,QAAQ;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,gBAAgB;EACdC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXF,QAAQ;EACRC,OAAO;CACT;CACAE,OAAOC,kBAA0B,CAACX,OAAO,EACvC,uBAAsBY,QAAO,OAAOA,QAAQ,WAAWA,MAAM,OAAOA,OAAO,OAAOA,MAAMC,KAAAA,EAAAA,CAAWF,aAAa,EAClH,CAAC;AACH;;;;;;;;;;;;AAgCA,SAAAI,UAAAC,IAAA;CAAA,MAAAC,IAAAtB,EAAA,EAAA;CAAA,IAAAuB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAmB,MAAA,EAAAL,eAAAY,IAAAT,SAAAU,IAAAN,QAAAO,IAAA,GAAAC,YAAAV;EAAAE,SAAAO;EACjB,MAAAd,gBAAAY,OAAAV,KAAAA,IAAAd,0BAAAwB;EAKA,MAAAI,UAJAH,OAAAX,KAAAA,IAAA,YAAAW,QAI2B,SAASnB,OAAMI,cAAeJ,OAAMC;EACxDT,KAAAA;EACWwB,KAAA;EAEXK,KAAAA;EACAN,KAAAtB,YAAYF,MAAaS,OAAMK,KAAMC,aAAa,GAAGgB,MAAM,GAAGD,OAAK;EAACT,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KA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