@kanso-labs/kanso-ui 0.45.27 → 0.45.29

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 (144) hide show
  1. package/dist/calendar/index.js +4 -4
  2. package/dist/calendar/index.js.map +1 -1
  3. package/dist/components/app-bar/index.js +1 -0
  4. package/dist/components/app-bar/index.js.map +1 -1
  5. package/dist/components/autocomplete/index.d.ts +6 -6
  6. package/dist/components/autocomplete/index.js +4 -4
  7. package/dist/components/autocomplete/index.js.map +1 -1
  8. package/dist/components/breadcrumbs/index.d.ts +5 -5
  9. package/dist/components/breadcrumbs/index.js +5 -5
  10. package/dist/components/breadcrumbs/index.js.map +1 -1
  11. package/dist/components/button/index.d.ts +3 -3
  12. package/dist/components/button/index.js +2 -2
  13. package/dist/components/button/index.js.map +1 -1
  14. package/dist/components/calendar/index.d.ts +7 -7
  15. package/dist/components/calendar/index.js +4 -4
  16. package/dist/components/calendar/index.js.map +1 -1
  17. package/dist/components/checkbox-group/index.d.ts +5 -5
  18. package/dist/components/checkbox-group/index.js +4 -4
  19. package/dist/components/checkbox-group/index.js.map +1 -1
  20. package/dist/components/color-area/index.d.ts +4 -4
  21. package/dist/components/color-area/index.js +4 -4
  22. package/dist/components/color-area/index.js.map +1 -1
  23. package/dist/components/color-field/index.d.ts +7 -7
  24. package/dist/components/color-field/index.js +4 -4
  25. package/dist/components/color-field/index.js.map +1 -1
  26. package/dist/components/color-picker/index.d.ts +4 -4
  27. package/dist/components/color-picker/index.js +4 -4
  28. package/dist/components/color-picker/index.js.map +1 -1
  29. package/dist/components/color-slider/index.d.ts +6 -6
  30. package/dist/components/color-slider/index.js +4 -4
  31. package/dist/components/color-slider/index.js.map +1 -1
  32. package/dist/components/color-swatch/index.d.ts +4 -4
  33. package/dist/components/color-swatch/index.js +4 -4
  34. package/dist/components/color-swatch/index.js.map +1 -1
  35. package/dist/components/color-swatch-picker/index.d.ts +12 -12
  36. package/dist/components/color-swatch-picker/index.js +7 -7
  37. package/dist/components/color-swatch-picker/index.js.map +1 -1
  38. package/dist/components/color-wheel/index.d.ts +6 -6
  39. package/dist/components/color-wheel/index.js +4 -4
  40. package/dist/components/color-wheel/index.js.map +1 -1
  41. package/dist/components/combo-box/index.d.ts +5 -5
  42. package/dist/components/combo-box/index.js +4 -4
  43. package/dist/components/combo-box/index.js.map +1 -1
  44. package/dist/components/date-field/index.d.ts +6 -6
  45. package/dist/components/date-field/index.js +4 -4
  46. package/dist/components/date-field/index.js.map +1 -1
  47. package/dist/components/date-picker/index.d.ts +6 -6
  48. package/dist/components/date-picker/index.js +4 -4
  49. package/dist/components/date-picker/index.js.map +1 -1
  50. package/dist/components/date-range-picker/index.d.ts +6 -6
  51. package/dist/components/date-range-picker/index.js +4 -4
  52. package/dist/components/date-range-picker/index.js.map +1 -1
  53. package/dist/components/dialog/index.d.ts +6 -6
  54. package/dist/components/dialog/index.js +9 -9
  55. package/dist/components/dialog/index.js.map +1 -1
  56. package/dist/components/disclosure/index.d.ts +10 -10
  57. package/dist/components/disclosure/index.js +8 -8
  58. package/dist/components/disclosure/index.js.map +1 -1
  59. package/dist/components/disclosure-group/index.d.ts +4 -4
  60. package/dist/components/disclosure-group/index.js +4 -4
  61. package/dist/components/disclosure-group/index.js.map +1 -1
  62. package/dist/components/drop-zone/index.d.ts +8 -8
  63. package/dist/components/drop-zone/index.js +6 -6
  64. package/dist/components/drop-zone/index.js.map +1 -1
  65. package/dist/components/form/index.d.ts +5 -5
  66. package/dist/components/form/index.js +4 -4
  67. package/dist/components/form/index.js.map +1 -1
  68. package/dist/components/link/index.d.ts +6 -6
  69. package/dist/components/link/index.js +4 -4
  70. package/dist/components/link/index.js.map +1 -1
  71. package/dist/components/list-box/index.d.ts +18 -18
  72. package/dist/components/list-box/index.js +11 -11
  73. package/dist/components/list-box/index.js.map +1 -1
  74. package/dist/components/menu/index.d.ts +16 -16
  75. package/dist/components/menu/index.js +14 -14
  76. package/dist/components/menu/index.js.map +1 -1
  77. package/dist/components/meter/index.d.ts +6 -6
  78. package/dist/components/meter/index.js +4 -4
  79. package/dist/components/meter/index.js.map +1 -1
  80. package/dist/components/navigation-tree/index.d.ts +15 -15
  81. package/dist/components/navigation-tree/index.js +13 -13
  82. package/dist/components/navigation-tree/index.js.map +1 -1
  83. package/dist/components/number-field/index.d.ts +5 -5
  84. package/dist/components/number-field/index.js +4 -4
  85. package/dist/components/number-field/index.js.map +1 -1
  86. package/dist/components/popover/index.d.ts +3 -3
  87. package/dist/components/popover/index.js +12 -12
  88. package/dist/components/popover/index.js.map +1 -1
  89. package/dist/components/radio-group/index.d.ts +5 -5
  90. package/dist/components/radio-group/index.js +4 -4
  91. package/dist/components/radio-group/index.js.map +1 -1
  92. package/dist/components/range-calendar/index.d.ts +7 -7
  93. package/dist/components/range-calendar/index.js +4 -4
  94. package/dist/components/range-calendar/index.js.map +1 -1
  95. package/dist/components/search-field/index.d.ts +6 -6
  96. package/dist/components/search-field/index.js +4 -4
  97. package/dist/components/search-field/index.js.map +1 -1
  98. package/dist/components/select/index.d.ts +5 -5
  99. package/dist/components/select/index.js +4 -4
  100. package/dist/components/select/index.js.map +1 -1
  101. package/dist/components/separator/index.d.ts +5 -5
  102. package/dist/components/separator/index.js +4 -4
  103. package/dist/components/separator/index.js.map +1 -1
  104. package/dist/components/sheet/index.d.ts +5 -5
  105. package/dist/components/sheet/index.js +12 -12
  106. package/dist/components/sheet/index.js.map +1 -1
  107. package/dist/components/slider/index.d.ts +4 -4
  108. package/dist/components/slider/index.js +4 -4
  109. package/dist/components/slider/index.js.map +1 -1
  110. package/dist/components/table/index.d.ts +20 -20
  111. package/dist/components/table/index.js +17 -17
  112. package/dist/components/table/index.js.map +1 -1
  113. package/dist/components/tabs/index.d.ts +5 -5
  114. package/dist/components/tabs/index.js +8 -8
  115. package/dist/components/tabs/index.js.map +1 -1
  116. package/dist/components/text-area/index.d.ts +2 -2
  117. package/dist/components/text-area/index.js +2 -2
  118. package/dist/components/text-area/index.js.map +1 -1
  119. package/dist/components/text-field/index.d.ts +4 -4
  120. package/dist/components/text-field/index.js +4 -4
  121. package/dist/components/text-field/index.js.map +1 -1
  122. package/dist/components/time-field/index.d.ts +6 -6
  123. package/dist/components/time-field/index.js +4 -4
  124. package/dist/components/time-field/index.js.map +1 -1
  125. package/dist/components/token-field/index.d.ts +7 -7
  126. package/dist/components/token-field/index.js +4 -4
  127. package/dist/components/token-field/index.js.map +1 -1
  128. package/dist/components/toolbar/index.d.ts +6 -6
  129. package/dist/components/toolbar/index.js +4 -4
  130. package/dist/components/toolbar/index.js.map +1 -1
  131. package/dist/components/tooltip/index.d.ts +2 -2
  132. package/dist/components/tooltip/index.js +4 -4
  133. package/dist/components/tooltip/index.js.map +1 -1
  134. package/dist/components/tree/index.d.ts +17 -17
  135. package/dist/components/tree/index.js +14 -14
  136. package/dist/components/tree/index.js.map +1 -1
  137. package/dist/drag/hooks.d.ts +3 -3
  138. package/dist/drag/hooks.js +4 -4
  139. package/dist/drag/hooks.js.map +1 -1
  140. package/dist/drag/index.js +4 -4
  141. package/dist/drag/index.js.map +1 -1
  142. package/dist/react-aria.d.ts +2 -2
  143. package/dist/react-aria.js +2 -2
  144. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","useContext","ColorSwatch","chequer","mergeStyles","SwatchSquareContext","styles","ground","kZKoxP","kaIpWk","kB7OPa","k1xSpc","kzqmXN","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"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useContext","ColorSwatch","chequer","mergeStyles","SwatchSquareContext","styles","ground","kZKoxP","kaIpWk","kB7OPa","k1xSpc","kzqmXN","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,YAAAe,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,eAAD;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"}
@@ -1,18 +1,18 @@
1
1
  import { ReactNode, RefAttributes } from "react";
2
- import { ColorSwatchPickerItemProps, ColorSwatchPickerProps } from "react-aria-components";
3
- type ColorSwatchPickerItemProps$1 = Omit<ColorSwatchPickerItemProps, 'children' | 'className' | 'style'> & {
2
+ import { ColorSwatchPickerItemProps as ColorSwatchPickerItemProps$1, ColorSwatchPickerProps as ColorSwatchPickerProps$1 } from "react-aria-components";
3
+ type ColorSwatchPickerItemProps = Omit<ColorSwatchPickerItemProps$1, 'children' | 'className' | 'style'> & {
4
4
  /** What the item draws. A `ColorSwatch` with no `color` of its own by default. */
5
5
  children?: ReactNode;
6
6
  /** A function may compute the class from the item's render state. */
7
- className?: ColorSwatchPickerItemProps['className'];
7
+ className?: ColorSwatchPickerItemProps$1['className'];
8
8
  /** A function may compute the style from the item's render state. */
9
- style?: ColorSwatchPickerItemProps['style'];
9
+ style?: ColorSwatchPickerItemProps$1['style'];
10
10
  };
11
- type ColorSwatchPickerProps$1 = Omit<ColorSwatchPickerProps, 'className' | 'style'> & {
11
+ type ColorSwatchPickerProps = Omit<ColorSwatchPickerProps$1, 'className' | 'style'> & {
12
12
  /** A function may compute the class from the picker's render state. */
13
- className?: ColorSwatchPickerProps['className'];
13
+ className?: ColorSwatchPickerProps$1['className'];
14
14
  /** A function may compute the style from the picker's render state. */
15
- style?: ColorSwatchPickerProps['style'];
15
+ style?: ColorSwatchPickerProps$1['style'];
16
16
  };
17
17
  /**
18
18
  * A row of colours to choose one from, drawn as swatches. The value is React
@@ -34,13 +34,13 @@ type ColorSwatchPickerProps$1 = Omit<ColorSwatchPickerProps, 'className' | 'styl
34
34
  * The call site's `className` and `style` land on the picker, which is the
35
35
  * element a layout positions.
36
36
  */
37
- declare function ColorSwatchPicker$1(props: ColorSwatchPickerProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
38
- declare namespace ColorSwatchPicker$1 {
39
- var Item: typeof ColorSwatchPickerItem$1;
37
+ declare function ColorSwatchPicker(props: ColorSwatchPickerProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
38
+ declare namespace ColorSwatchPicker {
39
+ var Item: typeof ColorSwatchPickerItem;
40
40
  }
41
41
  /**
42
42
  * One swatch in a {@link ColorSwatchPicker}. Renders a `ColorSwatch` of its
43
43
  * own `color` unless given different children.
44
44
  */
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 };
45
+ declare function ColorSwatchPickerItem({ children, ...props }: ColorSwatchPickerItemProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
46
+ export { ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, ColorSwatchPicker as default };
@@ -4,7 +4,7 @@ import { mergeStatefulStyles } from "../../styles/merge.js";
4
4
  import ColorSwatch$1 from "../color-swatch/index.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { jsx } from "react/jsx-runtime";
7
- import { ColorSwatchPicker, ColorSwatchPickerItem } from "react-aria-components";
7
+ import { ColorSwatchPicker as ColorSwatchPicker$1, ColorSwatchPickerItem as ColorSwatchPickerItem$1 } from "react-aria-components";
8
8
  // src/components/color-swatch-picker/index.tsx
9
9
  const styles = {
10
10
  item: {
@@ -72,7 +72,7 @@ const styles = {
72
72
  * The call site's `className` and `style` land on the picker, which is the
73
73
  * element a layout positions.
74
74
  */
75
- function ColorSwatchPicker$1(props) {
75
+ function ColorSwatchPicker(props) {
76
76
  const $ = c(5);
77
77
  let t0;
78
78
  if ($[0] !== props) {
@@ -82,7 +82,7 @@ function ColorSwatchPicker$1(props) {
82
82
  } else t0 = $[1];
83
83
  let t1;
84
84
  if ($[2] !== props || $[3] !== t0) {
85
- t1 = /* @__PURE__ */ jsx(ColorSwatchPicker, {
85
+ t1 = /* @__PURE__ */ jsx(ColorSwatchPicker$1, {
86
86
  ...props,
87
87
  ...t0
88
88
  });
@@ -96,7 +96,7 @@ function ColorSwatchPicker$1(props) {
96
96
  * One swatch in a {@link ColorSwatchPicker}. Renders a `ColorSwatch` of its
97
97
  * own `color` unless given different children.
98
98
  */
99
- function ColorSwatchPickerItem$1(t0) {
99
+ function ColorSwatchPickerItem(t0) {
100
100
  const $ = c(12);
101
101
  let T0;
102
102
  let children;
@@ -105,7 +105,7 @@ function ColorSwatchPickerItem$1(t0) {
105
105
  if ($[0] !== t0) {
106
106
  const { children: t3, ...props } = t0;
107
107
  children = t3;
108
- T0 = ColorSwatchPickerItem;
108
+ T0 = ColorSwatchPickerItem$1;
109
109
  t1 = props;
110
110
  t2 = mergeStatefulStyles(itemStyles, props);
111
111
  $[0] = t0;
@@ -143,7 +143,7 @@ function ColorSwatchPickerItem$1(t0) {
143
143
  function itemStyles(state) {
144
144
  return props(styles.item, state.isHovered && styles.itemHovered, state.isPressed && styles.itemPressed, state.isSelected && styles.itemSelected, state.isFocusVisible && styles.itemFocused, state.isDisabled && styles.itemDisabled);
145
145
  }
146
- ColorSwatchPicker$1.Item = ColorSwatchPickerItem$1;
147
- export { ColorSwatchPickerItem$1 as ColorSwatchPickerItem, ColorSwatchPicker$1 as default };
146
+ ColorSwatchPicker.Item = ColorSwatchPickerItem;
147
+ export { ColorSwatchPickerItem, ColorSwatchPicker as default };
148
148
 
149
149
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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;E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AK;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,OAAO3C,MAAaK,OAAOC,MAAMqC,MAAMG,aAAazC,OAAOuB,aAAae,MAAMI,aAAa1C,OAAOyB,aAAaa,MAAMK,cAAc3C,OAAO0B,cAAcY,MAAME,kBAAkBxC,OAAOmB,aAAamB,MAAMC,cAAcvC,OAAOiB,YAAY;AAC7O;AACArB,oBAAkBgD,OAAO/C"}
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 ColorSw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AAA,EAAAJ,UAAAQ,IAAA,GAAAN,UAAAE;EAAAJ,WAAAQ;EAIrBF,KAAAnC;EAA6B+B,KAAAA;EAAWK,KAAAnC,oBAAoBqC,YAAYP,KAAK;EAACC,EAAA,KAAAC;EAAAD,EAAA,KAAAG;EAAAH,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAA;EAAAD,KAAAH,EAAA;EAAAH,WAAAG,EAAA;EAAAE,KAAAF,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAH,UAAA;EACjFQ,KAAAR,YAAY,oBAACmB,eAAD,CAAY,CAAA;EAAGhB,EAAA,KAAAH;EAAAG,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,OAAO3C,MAAaK,OAAOC,MAAMqC,MAAMG,aAAazC,OAAOuB,aAAae,MAAMI,aAAa1C,OAAOyB,aAAaa,MAAMK,cAAc3C,OAAO0B,cAAcY,MAAME,kBAAkBxC,OAAOmB,aAAamB,MAAMC,cAAcvC,OAAOiB,YAAY;AAC7O;AACArB,kBAAkBgD,OAAO/C"}
@@ -1,8 +1,8 @@
1
1
  import { RefAttributes } from "react";
2
- import { ColorWheelProps } from "react-aria-components";
3
- type ColorWheelProps$1 = Omit<ColorWheelProps, 'children' | 'className' | 'innerRadius' | 'outerRadius' | 'style'> & {
2
+ import { ColorWheelProps as ColorWheelProps$1 } from "react-aria-components";
3
+ type ColorWheelProps = Omit<ColorWheelProps$1, 'children' | 'className' | 'innerRadius' | 'outerRadius' | 'style'> & {
4
4
  /** A function may compute the class from the wheel's render state. */
5
- className?: ColorWheelProps['className'];
5
+ className?: ColorWheelProps$1['className'];
6
6
  /**
7
7
  * How far the ring reaches from the centre, in pixels. The wheel is twice
8
8
  * this across.
@@ -10,7 +10,7 @@ type ColorWheelProps$1 = Omit<ColorWheelProps, 'children' | 'className' | 'inner
10
10
  */
11
11
  outerRadius?: number;
12
12
  /** A function may compute the style from the wheel's render state. */
13
- style?: ColorWheelProps['style'];
13
+ style?: ColorWheelProps$1['style'];
14
14
  /**
15
15
  * How wide the band is, in pixels. The inner radius is this in from
16
16
  * `outerRadius`, so the two cannot disagree.
@@ -38,5 +38,5 @@ type ColorWheelProps$1 = Omit<ColorWheelProps, 'children' | 'className' | 'inner
38
38
  * The call site's `className` and `style` land on the wheel, which is the
39
39
  * element a layout positions. Its size comes from `outerRadius`.
40
40
  */
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 };
41
+ declare function ColorWheel({ className, isDisabled, outerRadius, style, thickness, ...props }: ColorWheelProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
42
+ export { type ColorWheelProps, ColorWheel as default };
@@ -4,7 +4,7 @@ import { thumbClassName } from "../../styles/color.js";
4
4
  import { mergeStatefulStyles } from "../../styles/merge.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
- import { ColorThumb, ColorWheel, ColorWheelTrack } from "react-aria-components";
7
+ import { ColorThumb, ColorWheel as ColorWheel$1, ColorWheelTrack } from "react-aria-components";
8
8
  // src/components/color-wheel/index.tsx
9
9
  const DEFAULT_OUTER_RADIUS = 100;
10
10
  const DEFAULT_THICKNESS = 16;
@@ -43,7 +43,7 @@ const styles = {
43
43
  * The call site's `className` and `style` land on the wheel, which is the
44
44
  * element a layout positions. Its size comes from `outerRadius`.
45
45
  */
46
- function ColorWheel$1(t0) {
46
+ function ColorWheel(t0) {
47
47
  const $ = c(24);
48
48
  let className;
49
49
  let props$1;
@@ -105,7 +105,7 @@ function ColorWheel$1(t0) {
105
105
  } else t7 = $[16];
106
106
  let t8;
107
107
  if ($[17] !== innerRadius || $[18] !== isDisabled || $[19] !== outerRadius || $[20] !== props$1 || $[21] !== t4 || $[22] !== t6) {
108
- t8 = /* @__PURE__ */ jsxs(ColorWheel, {
108
+ t8 = /* @__PURE__ */ jsxs(ColorWheel$1, {
109
109
  innerRadius,
110
110
  isDisabled,
111
111
  outerRadius,
@@ -123,6 +123,6 @@ function ColorWheel$1(t0) {
123
123
  } else t8 = $[23];
124
124
  return t8;
125
125
  }
126
- export { ColorWheel$1 as default };
126
+ export { ColorWheel as default };
127
127
 
128
128
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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,O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FAULT_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,WAAAqB,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,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AAAM,eAAAN,EAAA,QAAAK,cAAAL,EAAA,QAAAJ,eAAAI,EAAA,QAAAC,WAAAD,EAAA,QAAAO,MAAAP,EAAA,QAAAW,IAAA;EAZzCI,KAAA,qBAACG,cAAD;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"}
@@ -1,7 +1,7 @@
1
1
  import { FieldVariant } from "../../field/index.js";
2
2
  import { ReactElement, ReactNode, Ref, RefAttributes } from "react";
3
- import { ComboBoxProps } from "react-aria-components";
4
- type ComboBoxProps$1<T extends object = object, M extends ComboBoxSelectionMode = 'single'> = {
3
+ import { ComboBoxProps as ComboBoxProps$1 } from "react-aria-components";
4
+ type ComboBoxProps<T extends object = object, M extends ComboBoxSelectionMode = 'single'> = {
5
5
  /**
6
6
  * Where to portal the list. Defaults to the container of the `ThemeScope`
7
7
  * around it, which keeps the list on that scope's tokens, or to the end of
@@ -60,7 +60,7 @@ type ComboBoxProps$1<T extends object = object, M extends ComboBoxSelectionMode
60
60
  * @default 'filled'
61
61
  */
62
62
  variant?: FieldVariant;
63
- } & Omit<ComboBoxProps<T, M>, 'children' | 'defaultSelectedKey' | 'isInvalid' | 'onSelectionChange' | 'selectedKey' | 'validationBehavior'>;
63
+ } & Omit<ComboBoxProps$1<T, M>, 'children' | 'defaultSelectedKey' | 'isInvalid' | 'onSelectionChange' | 'selectedKey' | 'validationBehavior'>;
64
64
  type ComboBoxSelectionMode = 'multiple' | 'single';
65
65
  /**
66
66
  * A labelled text field that filters a list as it is typed. Its value is
@@ -94,5 +94,5 @@ type ComboBoxSelectionMode = 'multiple' | 'single';
94
94
  * The call site's `className` and `style` land on the field as a whole,
95
95
  * which is the element a layout positions.
96
96
  */
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 };
97
+ declare function ComboBox<T extends object = object, M extends ComboBoxSelectionMode = 'single'>({ container, description, error, floatingLabel, inputRef, isDisabled, label, leadingIcon, options, variant, ...props }: ComboBoxProps<T, M> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
98
+ export { type ComboBoxProps, type ComboBoxSelectionMode, ComboBox as default };
@@ -10,7 +10,7 @@ import ListBox$1 from "../list-box/index.js";
10
10
  import { c } from "react/compiler-runtime";
11
11
  import { useContext, useRef } from "react";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
- import { Button, ComboBox, ComboBoxStateContext, ComboBoxValue, Popover } from "react-aria-components";
13
+ import { Button, ComboBox as ComboBox$1, ComboBoxStateContext, ComboBoxValue, Popover } from "react-aria-components";
14
14
  // src/components/combo-box/index.tsx
15
15
  const TOGGLE = /* @__PURE__ */ jsx(ComboToggle, {});
16
16
  const styles = {
@@ -87,7 +87,7 @@ function ChosenValues() {
87
87
  * The call site's `className` and `style` land on the field as a whole,
88
88
  * which is the element a layout positions.
89
89
  */
90
- function ComboBox$1(t0) {
90
+ function ComboBox(t0) {
91
91
  const $ = c(32);
92
92
  const { container, description, error, floatingLabel: t1, inputRef, isDisabled: t2, label, leadingIcon, options, variant: t3, ...props$1 } = t0;
93
93
  const floatingLabel = t1 === void 0 ? true : t1;
@@ -95,7 +95,7 @@ function ComboBox$1(t0) {
95
95
  const variant = t3 === void 0 ? "filled" : t3;
96
96
  const validationBehavior = useFieldValidationBehavior();
97
97
  const boxRef = useRef(null);
98
- const T0 = ComboBox;
98
+ const T0 = ComboBox$1;
99
99
  let t4;
100
100
  if ($[0] !== error) {
101
101
  t4 = invalidFrom(error);
@@ -281,6 +281,6 @@ function ComboToggle() {
281
281
  function listClassName(state) {
282
282
  return props(overlay.popup, styles.list, popupOrigin(state.placement)).className ?? "";
283
283
  }
284
- export { ComboBox$1 as default };
284
+ export { ComboBox as default };
285
285
 
286
286
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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;CAC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C,IAAA,2BAAA,GAAA;EACpCC,KAAA;GAAA+B,GAClB,EAAAC,WACU,6DACb;GAACC,GACE,EAAAD,WACU,4DACb;EACF;EAACpC,EAAA,KAAAI;CAAA,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"}
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,QAAQ;EACRd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRV,OAAO;CACT;AACF;;;;;;AAwEA,SAAAoB,eAAA;CAAA,MAAAC,IAAA9C,EAAA,CAAA;CAAA,IAAA+C;CAAA,IAAAD,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EACSF,KAAA,oBAAC,YAAD,EAAA,UACH,oBAACwC,eAAD,EAA4B,WAAA,0BAAyB,CAAA,EADvC,CAAA;EAEHzC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAFRC;AAEQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCjB,SAAA1C,SAAA0C,IAAA;CAAA,MAAAD,IAAA9C,EAAA,EAAA;CAAyF,MAAA,EAAAoC,WAAAC,aAAAC,OAAAC,eAAAW,IAAAV,UAAAW,YAAAC,IAAAX,OAAAC,aAAAC,SAAAC,SAAAS,IAAA,GAAAC,YAAAP;CAIvF,MAAAR,gBAAAW,OAAAK,KAAAA,IAAA,OAAAL;CAEA,MAAAC,aAAAC,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAR,UAAAS,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2B/C,2BAA2B;CAGtD,M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AAA;CAAA,OATNO;AASM;;;;;;;;AAUf,SAAA0B,cAAA;CAAA,MAAAjC,IAAA9C,EAAA,CAAA;CACE,MAAA4E,QAAc1E,WAAWE,oBAAoB;CAAE,IAAA2C;CAAA,IAAAD,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EACzBF,KAAA9C,MAAac,OAAMW,QAAShB,MAAKsE,IAAK;EAAClC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EACpCC,KAAA;GAAA+B,GAClB,EAAAC,WACU,6DACb;GAACC,GACE,EAAAD,WACU,4DACb;EACF;EAACpC,EAAA,KAAAI;CAAA,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"}
@@ -1,9 +1,9 @@
1
1
  import { FieldVariant } from "../../field/index.js";
2
2
  import { ReactNode, RefAttributes } from "react";
3
- import { DateFieldProps, DateValue } from "react-aria-components";
4
- type DateFieldProps$1<T extends DateValue = DateValue> = Omit<DateFieldProps<T>, 'children' | 'className' | 'style'> & {
3
+ import { DateFieldProps as DateFieldProps$1, DateValue } from "react-aria-components";
4
+ type DateFieldProps<T extends DateValue = DateValue> = Omit<DateFieldProps$1<T>, 'children' | 'className' | 'style'> & {
5
5
  /** A function may compute the class from the field's render state. */
6
- className?: DateFieldProps<T>['className'];
6
+ className?: DateFieldProps$1<T>['className'];
7
7
  /** Supporting text under the field. */
8
8
  description?: string;
9
9
  /**
@@ -29,7 +29,7 @@ type DateFieldProps$1<T extends DateValue = DateValue> = Omit<DateFieldProps<T>,
29
29
  */
30
30
  leadingIcon?: ReactNode;
31
31
  /** A function may compute the style from the field's render state. */
32
- style?: DateFieldProps<T>['style'];
32
+ style?: DateFieldProps$1<T>['style'];
33
33
  /**
34
34
  * An icon at the box's trailing end, in the page's 24dp size. An icon
35
35
  * drawn in `em` takes that size from the slot.
@@ -61,5 +61,5 @@ type DateFieldProps$1<T extends DateValue = DateValue> = Omit<DateFieldProps<T>,
61
61
  * with every other field. The call site's `className` and `style` land on
62
62
  * the field as a whole, which is the element a layout positions.
63
63
  */
64
- declare function DateField$1<T extends DateValue>({ description, error, floatingLabel, isDisabled, label, leadingIcon, trailingIcon, variant, ...props }: DateFieldProps$1<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
65
- export { type DateFieldProps$1 as DateFieldProps, DateField$1 as default };
64
+ declare function DateField<T extends DateValue>({ description, error, floatingLabel, isDisabled, label, leadingIcon, trailingIcon, variant, ...props }: DateFieldProps<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
65
+ export { type DateFieldProps, DateField as default };
@@ -7,7 +7,7 @@ import { segmentStyles } from "../../segments/styles.js";
7
7
  import { mergeStatefulStyles } from "../../styles/merge.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
- import { DateField, DateInput } from "react-aria-components";
10
+ import { DateField as DateField$1, DateInput } from "react-aria-components";
11
11
  // src/components/date-field/index.tsx
12
12
  /**
13
13
  * A date typed rather than picked: one segment per part, each its own focus
@@ -29,14 +29,14 @@ import { DateField, DateInput } from "react-aria-components";
29
29
  * with every other field. The call site's `className` and `style` land on
30
30
  * the field as a whole, which is the element a layout positions.
31
31
  */
32
- function DateField$1(t0) {
32
+ function DateField(t0) {
33
33
  const $ = c(22);
34
34
  const { description, error, floatingLabel: t1, isDisabled: t2, label, leadingIcon, trailingIcon, variant: t3, ...props$1 } = t0;
35
35
  const floatingLabel = t1 === void 0 ? true : t1;
36
36
  const isDisabled = t2 === void 0 ? false : t2;
37
37
  const variant = t3 === void 0 ? "filled" : t3;
38
38
  const validationBehavior = useFieldValidationBehavior();
39
- const T0 = DateField;
39
+ const T0 = DateField$1;
40
40
  let t4;
41
41
  if ($[0] !== error) {
42
42
  t4 = invalidFrom(error);
@@ -104,6 +104,6 @@ function DateField$1(t0) {
104
104
  } else t9 = $[21];
105
105
  return t9;
106
106
  }
107
- export { DateField$1 as default };
107
+ export { DateField as default };
108
108
 
109
109
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","DateField","RACDateField","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","description","error","floatingLabel","label","leadingIcon","trailingIcon","variant","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","isRequired","t8","t9","RACDateInput"],"sources":["../../../src/components/date-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DateValue, DateFieldProps as RACDateFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateField as RACDateField, DateInput as RACDateInput } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A date typed a segment at a time, rather than picked from a calendar. The\n// box, label and message are the field chrome in `src/field`, shared with\n// every other field, so a date field on a form is the same box as the text\n// field beside it — which is what the date pickers page means by a date in a\n// text field.\n//\n// Three things are this component's own.\n//\n// **Each segment is its own focus stop, and React Aria decides how many.**\n// The order and the count come from the locale rather than from here: a\n// reader under `I18nProvider` with a British locale gets day before month,\n// and `granularity` of `minute` adds two more. So the segments are rendered\n// from what React Aria hands the input, never written out.\n//\n// **A segment not yet filled is muted, and the label floats from the\n// start.** The placeholder text is the segment's own — `mm`, `dd`, `yyyy` —\n// and it takes the muted role so a half-typed date reads as half-typed. The\n// segments show it whether or not a date is in them, so the floating label\n// sits above them even while the field is empty, rather than resting on top\n// of the placeholders.\n//\n// **A focused segment is a filled shape rather than a ring.** A caret cannot\n// show which of three spinbuttons has focus, since React Aria hides it — the\n// segment is what has to say so, and it does it the way a selected row does.\n\ntype DateFieldProps<T extends DateValue = DateValue> = Omit<RACDateFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACDateFieldProps<T>['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 /** 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. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACDateFieldProps<T>['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};\n\n/**\n * A date typed rather than picked: one segment per part, each its own focus\n * stop. The value is React Aria's — pass `value` with `onChange` to control\n * it, or `defaultValue` — as an `@internationalized/date` value from this\n * package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DateField defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * How many segments there are and what order they come in is the reader's\n * locale, through React Aria's `I18nProvider` — `granularity` adds time\n * segments, and `minValue` and `maxValue` bound what may be typed.\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 DateField<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: DateFieldProps<T> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDateField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys the outlined notch. The box decides\n // populated twice over — in CSS for the label's type, and in React\n // for the notch, since CSS cannot cut an outline to a width it has\n // no way to measure. React Aria renders a hidden\n // `<input type=\"date\">` carrying no placeholder, so the CSS half\n // reads as populated on its own; the React half reads React Aria's\n // input context, which a date field does not provide. Without this\n // the notch stays shut across segments already showing `mm/dd/yyyy`.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACDateField>;\n}\nexport type { DateFieldProps };\nexport default DateField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,SAAAE,YAAAe,IAAA;CAAA,MAAAC,IAAAlB,EAAA,EAAA;CAAwC,MAAA,EAAAU,aAAAC,OAAAC,eAAAO,IAAAC,YAAAC,IAAAR,OAAAC,aAAAC,cAAAC,SAAAM,IA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P,OAAA;EACXyB,KAAA,oBAAC,cAAD;GAA2B1B;GAAoBC;EAAK,CAAA;EAAIO,EAAA,MAAAR;EAAAQ,EAAA,MAAAP;EAAAO,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,QAAAQ,MAAAR,EAAA,QAAAE,cAAAF,EAAA,QAAAK,WAAAL,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAgB,MAAAhB,EAAA,QAAAkB,MAAAlB,EAAA,QAAAO,oBAAA;EAjBrDY,KAAA,qBAAC,IAAD;GAA6BjB;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA/H,UAAA,CACHM,IAgBAE,EAjBgB;;EAkBHlB,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAO;EAAAP,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAlBVmB;AAkBU"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","DateField","RACDateField","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","description","error","floatingLabel","label","leadingIcon","trailingIcon","variant","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","isRequired","t8","t9","RACDateInput"],"sources":["../../../src/components/date-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DateValue, DateFieldProps as RACDateFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateField as RACDateField, DateInput as RACDateInput } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A date typed a segment at a time, rather than picked from a calendar. The\n// box, label and message are the field chrome in `src/field`, shared with\n// every other field, so a date field on a form is the same box as the text\n// field beside it — which is what the date pickers page means by a date in a\n// text field.\n//\n// Three things are this component's own.\n//\n// **Each segment is its own focus stop, and React Aria decides how many.**\n// The order and the count come from the locale rather than from here: a\n// reader under `I18nProvider` with a British locale gets day before month,\n// and `granularity` of `minute` adds two more. So the segments are rendered\n// from what React Aria hands the input, never written out.\n//\n// **A segment not yet filled is muted, and the label floats from the\n// start.** The placeholder text is the segment's own — `mm`, `dd`, `yyyy` —\n// and it takes the muted role so a half-typed date reads as half-typed. The\n// segments show it whether or not a date is in them, so the floating label\n// sits above them even while the field is empty, rather than resting on top\n// of the placeholders.\n//\n// **A focused segment is a filled shape rather than a ring.** A caret cannot\n// show which of three spinbuttons has focus, since React Aria hides it — the\n// segment is what has to say so, and it does it the way a selected row does.\n\ntype DateFieldProps<T extends DateValue = DateValue> = Omit<RACDateFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACDateFieldProps<T>['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 /** 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. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACDateFieldProps<T>['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};\n\n/**\n * A date typed rather than picked: one segment per part, each its own focus\n * stop. The value is React Aria's — pass `value` with `onChange` to control\n * it, or `defaultValue` — as an `@internationalized/date` value from this\n * package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DateField defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * How many segments there are and what order they come in is the reader's\n * locale, through React Aria's `I18nProvider` — `granularity` adds time\n * segments, and `minValue` and `maxValue` bound what may be typed.\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 DateField<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: DateFieldProps<T> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDateField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys the outlined notch. The box decides\n // populated twice over — in CSS for the label's type, and in React\n // for the notch, since CSS cannot cut an outline to a width it has\n // no way to measure. React Aria renders a hidden\n // `<input type=\"date\">` carrying no placeholder, so the CSS half\n // reads as populated on its own; the React half reads React Aria's\n // input context, which a date field does not provide. Without this\n // the notch stays shut across segments already showing `mm/dd/yyyy`.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACDateField>;\n}\nex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AN;EAAAM,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAK,QAAAY;EAAAjB,EAAA,KAAAH;EAAAG,EAAA,KAAAF;EAAAE,EAAA,KAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,IAAAkB;CAAA,IAAAlB,EAAA,QAAAR,eAAAQ,EAAA,QAAAP,OAAA;EACXyB,KAAA,oBAAC,cAAD;GAA2B1B;GAAoBC;EAAK,CAAA;EAAIO,EAAA,MAAAR;EAAAQ,EAAA,MAAAP;EAAAO,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,QAAAQ,MAAAR,EAAA,QAAAE,cAAAF,EAAA,QAAAK,WAAAL,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAgB,MAAAhB,EAAA,QAAAkB,MAAAlB,EAAA,QAAAO,oBAAA;EAjBrDY,KAAA,qBAAC,IAAD;GAA6BjB;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA/H,UAAA,CACHM,IAgBAE,EAjBgB;;EAkBHlB,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAO;EAAAP,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAlBVmB;AAkBU"}
@@ -1,10 +1,10 @@
1
1
  import { FieldVariant } from "../../field/index.js";
2
2
  import { ReactNode, RefAttributes } from "react";
3
- import { DatePickerProps, DateValue } from "react-aria-components";
3
+ import { DatePickerProps as DatePickerProps$1, DateValue } from "react-aria-components";
4
4
  import { DateDuration } from "@internationalized/date";
5
- type DatePickerProps$1<T extends DateValue = DateValue> = Omit<DatePickerProps<T>, 'children' | 'className' | 'style'> & {
5
+ type DatePickerProps<T extends DateValue = DateValue> = Omit<DatePickerProps$1<T>, 'children' | 'className' | 'style'> & {
6
6
  /** A function may compute the class from the picker's render state. */
7
- className?: DatePickerProps<T>['className'];
7
+ className?: DatePickerProps$1<T>['className'];
8
8
  /**
9
9
  * Where to portal the calendar. Defaults to the container of the `ThemeScope`
10
10
  * around it, which keeps the calendar on that scope's tokens, or to the end
@@ -45,7 +45,7 @@ type DatePickerProps$1<T extends DateValue = DateValue> = Omit<DatePickerProps<T
45
45
  */
46
46
  showMonthYearMenus?: boolean;
47
47
  /** A function may compute the style from the picker's render state. */
48
- style?: DatePickerProps<T>['style'];
48
+ style?: DatePickerProps$1<T>['style'];
49
49
  /**
50
50
  * What the button that opens the calendar is called, for a screen reader.
51
51
  * Left out, React Aria names it in the reader's locale — "Calendar" in
@@ -85,5 +85,5 @@ type DatePickerProps$1<T extends DateValue = DateValue> = Omit<DatePickerProps<T
85
85
  * The call site's `className` and `style` land on the picker as a whole,
86
86
  * which is the element a layout positions.
87
87
  */
88
- declare function DatePicker$1<T extends DateValue>({ container, description, error, floatingLabel, isDisabled, label, leadingIcon, showMonthYearMenus, triggerLabel, variant, visibleDuration, ...props }: DatePickerProps$1<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
89
- export { type DatePickerProps$1 as DatePickerProps, DatePicker$1 as default };
88
+ declare function DatePicker<T extends DateValue>({ container, description, error, floatingLabel, isDisabled, label, leadingIcon, showMonthYearMenus, triggerLabel, variant, visibleDuration, ...props }: DatePickerProps<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
89
+ export { type DatePickerProps, DatePicker as default };