@kanso-labs/kanso-ui 0.26.2 → 0.26.3

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 (177) hide show
  1. package/dist/calendar/index.js +1 -1
  2. package/dist/calendar/index.js.map +1 -1
  3. package/dist/calendar/months.js.map +1 -1
  4. package/dist/calendar/styles.js.map +1 -1
  5. package/dist/chip/styles.js.map +1 -1
  6. package/dist/components/app-bar/index.js +148 -40
  7. package/dist/components/app-bar/index.js.map +1 -1
  8. package/dist/components/autocomplete/index.js +1 -1
  9. package/dist/components/autocomplete/index.js.map +1 -1
  10. package/dist/components/avatar/index.js +46 -14
  11. package/dist/components/avatar/index.js.map +1 -1
  12. package/dist/components/breadcrumbs/index.js +1 -1
  13. package/dist/components/breadcrumbs/index.js.map +1 -1
  14. package/dist/components/button/index.js +67 -18
  15. package/dist/components/button/index.js.map +1 -1
  16. package/dist/components/calendar/index.js +1 -1
  17. package/dist/components/calendar/index.js.map +1 -1
  18. package/dist/components/card/index.js +71 -19
  19. package/dist/components/card/index.js.map +1 -1
  20. package/dist/components/checkbox/index.js +1 -1
  21. package/dist/components/checkbox/index.js.map +1 -1
  22. package/dist/components/checkbox-group/index.js +1 -1
  23. package/dist/components/checkbox-group/index.js.map +1 -1
  24. package/dist/components/chip/index.js +1 -1
  25. package/dist/components/chip/index.js.map +1 -1
  26. package/dist/components/chip-group/index.js +118 -28
  27. package/dist/components/chip-group/index.js.map +1 -1
  28. package/dist/components/code/index.js.map +1 -1
  29. package/dist/components/color-area/index.js +66 -12
  30. package/dist/components/color-area/index.js.map +1 -1
  31. package/dist/components/color-field/index.js +61 -12
  32. package/dist/components/color-field/index.js.map +1 -1
  33. package/dist/components/color-picker/index.js +146 -43
  34. package/dist/components/color-picker/index.js.map +1 -1
  35. package/dist/components/color-slider/index.js +116 -21
  36. package/dist/components/color-slider/index.js.map +1 -1
  37. package/dist/components/color-swatch/index.js +1 -1
  38. package/dist/components/color-swatch/index.js.map +1 -1
  39. package/dist/components/color-swatch-picker/index.js +1 -1
  40. package/dist/components/color-swatch-picker/index.js.map +1 -1
  41. package/dist/components/color-wheel/index.js +75 -11
  42. package/dist/components/color-wheel/index.js.map +1 -1
  43. package/dist/components/combo-box/index.js +113 -32
  44. package/dist/components/combo-box/index.js.map +1 -1
  45. package/dist/components/container/index.js +53 -10
  46. package/dist/components/container/index.js.map +1 -1
  47. package/dist/components/copy-field/index.js +95 -40
  48. package/dist/components/copy-field/index.js.map +1 -1
  49. package/dist/components/currency/index.js +68 -11
  50. package/dist/components/currency/index.js.map +1 -1
  51. package/dist/components/date-field/index.js +64 -15
  52. package/dist/components/date-field/index.js.map +1 -1
  53. package/dist/components/date-picker/index.js +121 -38
  54. package/dist/components/date-picker/index.js.map +1 -1
  55. package/dist/components/date-range-picker/index.js +154 -52
  56. package/dist/components/date-range-picker/index.js.map +1 -1
  57. package/dist/components/dialog/index.js +87 -19
  58. package/dist/components/dialog/index.js.map +1 -1
  59. package/dist/components/disclosure/index.js +43 -10
  60. package/dist/components/disclosure/index.js.map +1 -1
  61. package/dist/components/disclosure-group/index.js +49 -6
  62. package/dist/components/disclosure-group/index.js.map +1 -1
  63. package/dist/components/drop-zone/index.js +1 -1
  64. package/dist/components/drop-zone/index.js.map +1 -1
  65. package/dist/components/drop-zone/styles.js.map +1 -1
  66. package/dist/components/feed/index.js +52 -9
  67. package/dist/components/feed/index.js.map +1 -1
  68. package/dist/components/form/index.js +39 -6
  69. package/dist/components/form/index.js.map +1 -1
  70. package/dist/components/icon-button/index.js +89 -29
  71. package/dist/components/icon-button/index.js.map +1 -1
  72. package/dist/components/keycap/index.js.map +1 -1
  73. package/dist/components/link/index.js +52 -11
  74. package/dist/components/link/index.js.map +1 -1
  75. package/dist/components/list/index.js +96 -16
  76. package/dist/components/list/index.js.map +1 -1
  77. package/dist/components/list-box/index.js +45 -8
  78. package/dist/components/list-box/index.js.map +1 -1
  79. package/dist/components/list-detail/index.js +99 -20
  80. package/dist/components/list-detail/index.js.map +1 -1
  81. package/dist/components/list-item/index.js +42 -15
  82. package/dist/components/list-item/index.js.map +1 -1
  83. package/dist/components/menu/index.js +139 -23
  84. package/dist/components/menu/index.js.map +1 -1
  85. package/dist/components/meter/index.js +68 -8
  86. package/dist/components/meter/index.js.map +1 -1
  87. package/dist/components/navigation-tree/index.js +1 -1
  88. package/dist/components/navigation-tree/index.js.map +1 -1
  89. package/dist/components/number-field/index.js +135 -47
  90. package/dist/components/number-field/index.js.map +1 -1
  91. package/dist/components/popover/index.js +226 -49
  92. package/dist/components/popover/index.js.map +1 -1
  93. package/dist/components/product-icon/index.js +50 -17
  94. package/dist/components/product-icon/index.js.map +1 -1
  95. package/dist/components/progress-indicator/index.js +92 -9
  96. package/dist/components/progress-indicator/index.js.map +1 -1
  97. package/dist/components/radio-group/index.js +44 -10
  98. package/dist/components/radio-group/index.js.map +1 -1
  99. package/dist/components/range-calendar/index.js +1 -1
  100. package/dist/components/range-calendar/index.js.map +1 -1
  101. package/dist/components/search-field/index.js +44 -9
  102. package/dist/components/search-field/index.js.map +1 -1
  103. package/dist/components/segmented-button/index.js +111 -19
  104. package/dist/components/segmented-button/index.js.map +1 -1
  105. package/dist/components/select/index.js +48 -10
  106. package/dist/components/select/index.js.map +1 -1
  107. package/dist/components/separator/index.js +21 -6
  108. package/dist/components/separator/index.js.map +1 -1
  109. package/dist/components/sheet/index.js +87 -19
  110. package/dist/components/sheet/index.js.map +1 -1
  111. package/dist/components/slider/index.js +90 -18
  112. package/dist/components/slider/index.js.map +1 -1
  113. package/dist/components/snackbar/index.js +1 -1
  114. package/dist/components/snackbar/index.js.map +1 -1
  115. package/dist/components/stack/index.js +54 -9
  116. package/dist/components/stack/index.js.map +1 -1
  117. package/dist/components/supporting-pane/index.js +91 -20
  118. package/dist/components/supporting-pane/index.js.map +1 -1
  119. package/dist/components/switch/index.js +57 -12
  120. package/dist/components/switch/index.js.map +1 -1
  121. package/dist/components/table/index.js +229 -46
  122. package/dist/components/table/index.js.map +1 -1
  123. package/dist/components/tabs/index.js +1 -1
  124. package/dist/components/tabs/index.js.map +1 -1
  125. package/dist/components/tag/index.js +53 -10
  126. package/dist/components/tag/index.js.map +1 -1
  127. package/dist/components/text/index.js +54 -9
  128. package/dist/components/text/index.js.map +1 -1
  129. package/dist/components/text-area/index.js +70 -15
  130. package/dist/components/text-area/index.js.map +1 -1
  131. package/dist/components/text-field/index.js +73 -16
  132. package/dist/components/text-field/index.js.map +1 -1
  133. package/dist/components/time-field/index.js +64 -15
  134. package/dist/components/time-field/index.js.map +1 -1
  135. package/dist/components/token-field/index.js +133 -18
  136. package/dist/components/token-field/index.js.map +1 -1
  137. package/dist/components/toolbar/index.js +68 -11
  138. package/dist/components/toolbar/index.js.map +1 -1
  139. package/dist/components/tooltip/index.js +87 -11
  140. package/dist/components/tooltip/index.js.map +1 -1
  141. package/dist/components/tree/index.js +96 -16
  142. package/dist/components/tree/index.js.map +1 -1
  143. package/dist/drag/hooks.js +1 -1
  144. package/dist/drag/hooks.js.map +1 -1
  145. package/dist/drag/index.js +1 -1
  146. package/dist/drag/index.js.map +1 -1
  147. package/dist/drag/styles.js.map +1 -1
  148. package/dist/field/index.js +338 -96
  149. package/dist/field/index.js.map +1 -1
  150. package/dist/field/root.js.map +1 -1
  151. package/dist/glyphs/index.js +1 -1
  152. package/dist/glyphs/index.js.map +1 -1
  153. package/dist/hooks/useImageLoadingStatus.js +1 -1
  154. package/dist/hooks/useImageLoadingStatus.js.map +1 -1
  155. package/dist/hooks/useRipple.js +1 -1
  156. package/dist/hooks/useRipple.js.map +1 -1
  157. package/dist/indicator/index.js +1 -1
  158. package/dist/indicator/index.js.map +1 -1
  159. package/dist/indicator/styles.js.map +1 -1
  160. package/dist/layout.js.map +1 -1
  161. package/dist/render/aria.js.map +1 -1
  162. package/dist/render/useRender.js +66 -21
  163. package/dist/render/useRender.js.map +1 -1
  164. package/dist/row/index.js +97 -23
  165. package/dist/row/index.js.map +1 -1
  166. package/dist/row/styles.js.map +1 -1
  167. package/dist/segments/index.js.map +1 -1
  168. package/dist/segments/styles.js.map +1 -1
  169. package/dist/styles/chequer.js.map +1 -1
  170. package/dist/styles/color.js.map +1 -1
  171. package/dist/styles/merge.js.map +1 -1
  172. package/dist/styles/overlay.js.map +1 -1
  173. package/dist/styles/picker.js.map +1 -1
  174. package/dist/styles/ripple.js.map +1 -1
  175. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  176. package/dist/tokens/values.js.map +1 -1
  177. package/package.json +8 -6
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["leading","state","label","children","trailing","trigger"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport type { ButtonProps, GroupProps, GroupRenderProps, InputProps, InputRenderProps, LabelProps, TextAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { FieldError, FieldErrorContext, Group, Input, InputContext, Label, Button as RACButton, SelectStateContext, Text, TextArea, TextAreaContext, useSlottedContext } from 'react-aria-components';\nimport { mergeStatefulStyles, mergeStyles } from '../styles/merge';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\nimport { useInsideForm } from './root';\n\n// The chrome every field shares: the filled box with its label at the top, the\n// control inside it, and the line of supporting text under it. TextField drew\n// all of it on its own until the coverage plan brought a dozen more fields,\n// each of which would otherwise have written the same box a second time.\n//\n// Not a component of the library's own and not exported. Each field is still\n// React Aria's field component — TextField, NumberField, DateField — and these\n// are the parts it renders inside, which is what keeps the label association,\n// the description and error wiring, and validation on React Aria's side.\n//\n// The focus indicator is an inset box-shadow on the bottom edge rather than a\n// border that thickens. A real border going 1px -> 2px on focus grows the\n// box, which pushes every sibling below it down by a pixel — so a form\n// twitches each time focus moves between its fields. A shadow is drawn inside\n// the box and changes nothing about its size.\n//\n// The label floats, as the text fields page draws it: body-large and centred\n// in an empty, unfocused box, body-small at the top once the field is focused\n// or holds a value. `floatingLabel={false}` keeps it small at the top in\n// every state instead.\n//\n// Where the label sits depends on the box's state, and a child cannot select\n// on its parent's state while the box can select on its own. So the label's\n// type is set on the box and inherited: the box changes the font size and\n// line height it hands down when focus is within it, or when its control\n// shows something other than its placeholder, and the label transitions\n// between the two. Resting, the line is the box less its padding, which is\n// what centres the label without a position to move — the move to the top is\n// a change of type alone. The control sets its own type, so none of this\n// reaches it.\n//\n// The label's colour follows the control's focus the same way: the box is\n// React Aria's Group, which reports focus within it as render state, and the\n// label takes `labelFocused` from that.\n//\n// The box is a row: an icon slot at either end, if the field has one, with\n// the label and control between them. The page gives the icons 24dp, 12dp\n// from the box's edge and 16dp from the text, centred in the box's height;\n// the slot cancels the box's top padding and stretches to its full height,\n// so it centres whatever it holds — a 24dp icon, or an icon button around\n// one. The label and the control sit in a column of their own, which is\n// what the label is positioned against, so it moves past a leading icon\n// with the text.\n//\n// A prefix or suffix sits on the control's line, in the control's type and\n// the muted role, and shows only while the field is focused or holds a\n// value, as the placeholder does — at rest the label is where it would be.\n// It is the column's colour it takes, inherited, since the column can\n// select on its own focus and content and the affix cannot select on\n// either.\n//\n// The outlined variant is the page's outlined text field: no fill, a 1dp\n// outline in the outline role with 4dp corners all round, 2dp and primary\n// while focused, on surface while hovered, the error role with an error,\n// and the label cutting the outline once it floats, with the page's 4dp\n// beside it. The value is centred, 16dp from the top and bottom, and the\n// label rests on its line and moves up onto the outline — a move, where the\n// filled label only changes type.\n//\n// The outline is a fieldset laid over the box: a browser draws a fieldset's\n// border around its legend, so a legend holding a copy of the label, in the\n// label's floated type, is what cuts the outline to the label's width with\n// nothing measured. Empty, it cuts nothing, which is the closed notch.\n//\n// Neither the notch nor the label can select on the state that drives them.\n// Both are children of the box and the state is the box's, and the filled\n// label reads it in CSS only because it changes type alone, which the box\n// hands down inherited — where the notch changes what it holds and the\n// label changes where it sits, and neither of those inherits. So the box's\n// content computes that state in React instead: focus from the box's own\n// render state, and a value from the control's context, which is where the\n// character counter reads it too. The border's colour is the box's,\n// inherited, which is what carries the hover, focus, error and disabled\n// roles to it.\nconst styles = {\n autosizeCell: {\n kJuA4N: \"x1b1wf8y\",\n $$css: true\n },\n box: {\n kGNEyG: \"x1cy8zhl\",\n kWkggS: \"x1rrhr5q\",\n kZKoxP: \"xnnlda6\",\n kT0f0o: \"x16uus16\",\n kVL7Gh: \"xbiv7yw\",\n kfmiAY: \"xirz1nw\",\n krdFHd: \"xzcck0f\",\n kGVxlE: \"x89kqus x18rfq6m\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xxj4525\",\n kGO01o: \"x18d9i69\",\n kLKAdn: \"xi7mcox\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xkdsq27\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n boxDisabled: {\n kWkggS: \"xepofeg\",\n kGVxlE: \"x1pqbjc1\",\n $$css: true\n },\n boxError: {\n kGVxlE: \"x1lxxh4i x1d6xoej\",\n $$css: true\n },\n boxFixed: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n $$css: true\n },\n boxFloating: {\n kMv6JI: \"x1ps135g xnc7ww3 x16svsjw\",\n kGuDYH: \"x52kfa xys1t9b x1848etk\",\n k63SB2: \"xz4f7ai xn9xqko x1c52epr\",\n kb6lSQ: \"x19wmx12 x1t00fh7 x1qn8t5l\",\n kLWn49: \"xsv50tp x1f5c3pk x181fmp8\",\n $$css: true\n },\n boxLeading: {\n kZCmMZ: \"xwde665\",\n $$css: true\n },\n boxMultiline: {\n kZKoxP: \"xt7dq6l\",\n kAzted: \"xbktkl8\",\n kGO01o: \"xqf7pud\",\n $$css: true\n },\n boxOutlined: {\n kWkggS: \"xjbqb8w\",\n kT0f0o: \"x4gcak0\",\n kVL7Gh: \"xqs30sb\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x158cnre x1igw6b7 x1sa41d3\",\n kGO01o: \"xzfxn0k\",\n kLKAdn: \"x1clyivc\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n boxOutlinedDisabled: {\n kWkggS: \"xjbqb8w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1ldq0ta\",\n $$css: true\n },\n boxOutlinedError: {\n kMwMTN: \"x12voer2 x1h298ve x4ii1qj\",\n $$css: true\n },\n boxOutlinedFloating: {\n kLWn49: \"xsv50tp x1f5c3pk xay82u3\",\n $$css: true\n },\n boxTrailing: {\n kwRFfy: \"xk163s\",\n $$css: true\n },\n column: {\n kMwMTN: \"x1w5n3ug\",\n kzQI83: \"x1iyjqo2\",\n k7Eaqz: \"xeuugli\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n columnDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n columnDisabledFloating: {\n kMwMTN: \"xspc5gk x19co3pv\",\n $$css: true\n },\n columnFloating: {\n kMwMTN: \"x1dfuzvz x6phwhp x19co3pv\",\n $$css: true\n },\n input: {\n k8Qsv1: \"x1hgeflb\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k3XXqK: \"x1t137rt\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n inputDisabled: {\n k8Qsv1: \"x7ip5l3\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n inputUnderFloatingLabel: {\n k8Qsv1: \"x1mvm7v4 xxqzaim\",\n $$css: true\n },\n inputUnderLabel: {\n keoZOQ: \"xwuztrq\",\n $$css: true\n },\n textArea: {\n k1xSpc: \"x1lliihq\",\n kVQacm: \"xysyzu8\",\n kHenm0: \"xtt52l0\",\n $$css: true\n },\n textAreaAutosize: {\n kVQacm: \"xb3r6kr\",\n $$css: true\n }\n};\n\n// What a control needs to know about the box around it: how the label is\n// drawn, and whether the control clears it with a margin — it does under\n// the filled box's label, and not under the outlined box's, whose label\n// sits on the outline rather than over the value.\ninterface BoxControl {\n label: BoxLabel;\n underLabel: boolean;\n}\n\n// How the box draws its label, for the control inside it — see the context\n// below.\ntype BoxLabel = 'fixed' | 'floating' | 'none';\ntype FieldBoxProps = {\n children?: ReactNode;\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, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * Whether the control is holding anything, for a field whose control the\n * chrome cannot ask. It reads an input, a text area and a select's own\n * state; a control that is none of those — a token field's editable area,\n * say — says so here, and the floating label floats on it.\n */\n isPopulated?: boolean;\n /** What the field is for. */\n label: string;\n /** An icon at the start of the box, before the label and the control. */\n leading?: ReactNode;\n /**\n * Whether the box takes its height from the control inside it rather\n * than the page's 56dp, for a text area.\n * @default false\n */\n multiline?: boolean;\n /**\n * The box's own element. A field whose box is what something else is\n * anchored to needs it — a select's list is positioned against the box and\n * takes its width from it, which is what makes the two the same width.\n */\n ref?: Ref<HTMLDivElement>;\n /** An icon at the end of the box, after the control. */\n trailing?: ReactNode;\n /**\n * A press target covering the whole box, for a field whose box opens\n * something rather than taking a keystroke — {@link FieldTrigger}. Drawn\n * in the box itself rather than in the column the label and the control\n * share, so the padding and the icons open it too.\n */\n trigger?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<GroupProps, 'children'>;\n\n// `prefix` is also an HTML attribute — the RDFa one, which nothing here\n// wants — and React's element types carry it as a string, so it is left out\n// of the props taken from React Aria to make room for the affix.\ntype FieldInputProps = Omit<InputProps, 'prefix'> & {\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, shown while the field is focused or\n * holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, shown while the field is focused or\n * holds a value.\n */\n suffix?: ReactNode;\n};\ntype FieldLabelProps = LabelProps & {\n /**\n * The states the colour follows. Disabled wins over error, and error over\n * focus, so a focused invalid field keeps its error colour.\n */\n state?: Partial<FieldLabelState>;\n};\ntype FieldLabelState = Pick<GroupRenderProps, 'isDisabled' | 'isFocusWithin' | 'isInvalid'>;\ninterface FieldMessageProps {\n /**\n * Whether to count the characters the control holds at the end of the\n * line, against `maxLength` where there is one. The count is read off the\n * field's own input or text area context.\n * @default false\n */\n characterCount?: boolean;\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 | undefined;\n /** The problem with the current value, in words. */\n error?: string | undefined;\n /**\n * Whether the line is indented to a box's inline padding, so it starts\n * where a value above it does. Off for a field with no box to line up with.\n * @default true\n */\n inset?: boolean;\n /** The limit the count is shown against. */\n maxLength?: number | undefined;\n}\ntype FieldTextAreaProps = TextAreaProps & {\n /**\n * Whether the control grows with the text it holds, from the rows it asks\n * for. Off, it keeps its rows and scrolls.\n * @default false\n */\n autosize?: boolean;\n};\ntype FieldTriggerProps = ButtonProps;\ntype FieldValueProps = HTMLAttributes<HTMLElement> & {\n /**\n * Whether the field has focus. A hidden placeholder appears while it does,\n * the way an input's does.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether nothing has been chosen yet, so what is drawn is the placeholder\n * rather than a value.\n * @default false\n */\n isPlaceholder?: boolean;\n};\ntype FieldVariant = 'filled' | 'outlined';\n\n// A control under a floating label carries a placeholder so the box can\n// tell when it is populated, shown only while focused. The default is what\n// a control rendered outside any box gets — a search bar's, which has no\n// label over it and shows its placeholder in every state. The four a box\n// provides are hoisted so each is one stable object.\nconst OUTSIDE_BOX: BoxControl = {\n label: 'none',\n underLabel: false\n};\nconst BOX_CONTROLS = {\n filled: {\n fixed: {\n label: 'fixed',\n underLabel: true\n },\n floating: {\n label: 'floating',\n underLabel: true\n }\n },\n outlined: {\n fixed: {\n label: 'fixed',\n underLabel: false\n },\n floating: {\n label: 'floating',\n underLabel: false\n }\n }\n} satisfies Record<FieldVariant, Record<'fixed' | 'floating', BoxControl>>;\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX);\n\n// Written as calls rather than function literals at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// each result on its inputs.\nfunction boxContent(label: string, children: ReactNode, floatingLabel: boolean, isPopulated: boolean | undefined, leading: ReactNode, trailing: ReactNode, trigger: ReactNode, variant: FieldVariant) {\n return (state: GroupRenderProps) => <BoxContent floatingLabel={floatingLabel} isPopulated={isPopulated} label={label} leading={leading} state={state} trailing={trailing} trigger={trigger} variant={variant}>\n {children}\n </BoxContent>;\n}\n\n/**\n * What a box holds: its icons, its label and the control between them, plus\n * the outline when it has one. A component rather than the render function\n * itself, so it can read whether the control holds a value — which is what\n * the outlined box's notch and label follow, and what CSS cannot express\n * for them. See the outlined variant's note above.\n */\nfunction BoxContent({\n children,\n floatingLabel,\n isPopulated,\n label,\n leading,\n state,\n trailing,\n trigger,\n variant\n}: {\n children: ReactNode;\n floatingLabel: boolean;\n isPopulated: boolean | undefined;\n label: string;\n leading: ReactNode;\n state: GroupRenderProps;\n trailing: ReactNode;\n trigger: ReactNode;\n variant: FieldVariant;\n}) {\n const read = useFieldPopulated();\n const populated = isPopulated ?? read;\n const outlined = variant === 'outlined';\n const floated = !floatingLabel || state.isFocusWithin || populated;\n return <BoxContext value={BOX_CONTROLS[variant][floatingLabel ? 'floating' : 'fixed']}>\n {outlined ? <fieldset aria-hidden=\"true\" {...{\n 0: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 xmkeg23 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7\"\n },\n 2: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 xmkeg23 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7 x167ah0f\"\n },\n 1: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7 xdh2fpr\"\n },\n 3: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7 x167ah0f xdh2fpr\"\n }\n }[!!(leading !== undefined) << 1 | !!state.isFocusWithin << 0]}>\n <legend {...{\n 0: {\n className: \"xqtp20y x14ju556 x193iq5w xb3r6kr x1717udv xlshs6z xuxw1ft\"\n },\n 1: {\n className: \"xqtp20y x14ju556 x193iq5w xb3r6kr x1717udv xlshs6z xuxw1ft ximhkdq\"\n }\n }[!!floated << 0]}>\n {floated ? label : null}\n </legend>\n </fieldset> : null}\n {trigger}\n {leading === undefined ? null : <span {...{\n 0: {\n className: \"x6s0dn4 xkh2ocl x1w5n3ug x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7\"\n },\n 1: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x1xj74d8\"\n }\n }[!!state.isDisabled << 0]}>\n {leading}\n </span>}\n <div {...stylex.props(styles.column, floatingLabel && styles.columnFloating, state.isDisabled && (floatingLabel ? styles.columnDisabledFloating : styles.columnDisabled))}>\n <FieldLabel state={state} {...{\n 0: {\n className: \"x13vifvy x1o0tod x10l6tqk\"\n },\n 4: {\n className: \"x13vifvy x1o0tod x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh\"\n },\n 2: {\n className: \"x13vifvy x10l6tqk x10k232c ximhkdq\"\n },\n 6: {\n className: \"x13vifvy x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10k232c ximhkdq\"\n },\n 1: {\n className: \"x1o0tod x10l6tqk x1qjp6zz\"\n },\n 5: {\n className: \"x1o0tod x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x1qjp6zz\"\n },\n 3: {\n className: \"x10l6tqk x10k232c ximhkdq x1qjp6zz\"\n },\n 7: {\n className: \"x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10k232c ximhkdq x1qjp6zz\"\n }\n }[!!(floatingLabel && floated) << 2 | !!outlined << 1 | !!(outlined && floated) << 0]}>\n {label}\n </FieldLabel>\n {children}\n </div>\n {trailing === undefined ? null : <span {...{\n 0: {\n className: \"x6s0dn4 xkh2ocl x1w5n3ug x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7\"\n },\n 2: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 1: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x1xj74d8\"\n },\n 3: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x1xj74d8\"\n }\n }[!!state.isInvalid << 1 | !!state.isDisabled << 0]}>\n {trailing}\n </span>}\n </BoxContext>;\n}\nfunction boxStyles(floatingLabel: boolean, multiline: boolean, leading: boolean, trailing: boolean, variant: FieldVariant) {\n const outlined = variant === 'outlined';\n return (state: GroupRenderProps) => stylex.props(styles.box, floatingLabel ? styles.boxFloating : styles.boxFixed, multiline && styles.boxMultiline, leading && styles.boxLeading, trailing && styles.boxTrailing, outlined && styles.boxOutlined, outlined && floatingLabel && styles.boxOutlinedFloating, state.isInvalid && (outlined ? styles.boxOutlinedError : styles.boxError), state.isDisabled && (outlined ? styles.boxOutlinedDisabled : styles.boxDisabled));\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. React\n * Aria's `Group`, so\n * the field around it hands down `isDisabled` and `isInvalid` through context\n * and the box reports focus within it as render state, which is what the\n * label's colour follows. A field that provides no group context — one built\n * on a button rather than an input — passes the two states itself.\n */\nfunction FieldBox({\n children,\n floatingLabel = true,\n isPopulated,\n label,\n leading,\n multiline = false,\n trailing,\n trigger,\n variant = 'filled',\n ...props\n}: FieldBoxProps) {\n return <Group {...props} {...mergeStatefulStyles(boxStyles(floatingLabel, multiline, leading !== undefined, trailing !== undefined, variant), props)}>\n {boxContent(label, children, floatingLabel, isPopulated, leading, trailing, trigger, variant)}\n </Group>;\n}\n\n/**\n * A field's text control, in a {@link FieldBox} or on its own. React Aria's\n * `Input`, which takes its label association, value and validation from the\n * field around it and reports its disabled state as render state.\n *\n * In a box it clears the label at the top, and under a floating label it\n * always carries a placeholder, since that is what the box reads to tell a\n * populated control from an empty one: its own where it was given one, a\n * blank otherwise. Outside a box it has no label over it and shows the\n * placeholder it was given in every state.\n */\nfunction FieldInput({\n numeric = false,\n placeholder,\n prefix,\n suffix,\n ...props\n}: FieldInputProps) {\n const box = useContext(BoxContext);\n const control = <Input placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => ({\n 0: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv\"\n },\n 8: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq\"\n },\n 4: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x1mvm7v4 xxqzaim\"\n },\n 12: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x1mvm7v4 xxqzaim\"\n },\n 2: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xbppi91 xss6m8b\"\n },\n 10: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq xbppi91 xss6m8b\"\n },\n 6: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x1mvm7v4 xxqzaim xbppi91 xss6m8b\"\n },\n 14: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x1mvm7v4 xxqzaim xbppi91 xss6m8b\"\n },\n 1: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x7ip5l3 x1xj74d8\"\n },\n 9: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x7ip5l3 x1xj74d8\"\n },\n 5: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x7ip5l3 x1xj74d8\"\n },\n 13: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x7ip5l3 x1xj74d8\"\n },\n 3: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n },\n 11: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n },\n 7: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n },\n 15: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n }\n })[!!box.underLabel << 3 | !!(box.label === 'floating') << 2 | !!numeric << 1 | !!state.isDisabled << 0], props)} />;\n if (prefix === undefined && suffix === undefined) {\n return control;\n }\n return <span className=\"x1pha0wt x78zum5 x14qo01y\">\n {prefix === undefined ? null : <span {...{\n 0: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft\"\n },\n 1: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft xwuztrq\"\n }\n }[!!box.underLabel << 0]}>\n {prefix}\n </span>}\n {control}\n {suffix === undefined ? null : <span {...{\n 0: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft\"\n },\n 1: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft xwuztrq\"\n }\n }[!!box.underLabel << 0]}>\n {suffix}\n </span>}\n </span>;\n}\n\n/**\n * A field's multi-line text control, in a {@link FieldBox} drawn `multiline`.\n * React Aria's `TextArea`, with the same label association, value and\n * validation {@link FieldInput} takes from the field around it, and the same\n * placeholder under a floating label.\n *\n * Given `autosize` it grows with its text from the rows it asks for. The\n * value it grows to fit is read off the field's context rather than\n * measured: the box holds a hidden replica of it in the control's own type,\n * in the same grid cell as the control, and the cell is as tall as whichever\n * of the two is taller.\n */\nfunction FieldTextArea({\n autosize = false,\n placeholder,\n ...props\n}: FieldTextAreaProps) {\n const box = useContext(BoxContext);\n const context = useSlottedContext(TextAreaContext);\n const value = typeof context?.value === 'string' ? context.value : '';\n const control = <TextArea placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(styles.input, box.underLabel && styles.inputUnderLabel, box.label === 'floating' && styles.inputUnderFloatingLabel, styles.textArea, autosize && styles.textAreaAutosize, autosize && styles.autosizeCell, state.isDisabled && styles.inputDisabled), props)} />;\n if (!autosize) {\n return control;\n }\n\n // A trailing space keeps a final line break of the value as a line of the\n // replica, which is how the control renders it.\n return <div className=\"xrvj5dj\">\n {control}\n <div aria-hidden=\"true\" {...{\n 0: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x1mzt3pk xlshs6z x126k92a x1b1wf8y\"\n },\n 1: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x1mzt3pk xlshs6z x126k92a x1b1wf8y\"\n }\n }[!!box.underLabel << 0]}>\n {value}{' '}\n </div>\n </div>;\n}\n\n/**\n * The press target over a {@link FieldBox} whose whole surface opens\n * something — a select's list, a picker's calendar. React Aria's `Button`,\n * which takes the trigger's props from the field around it through context.\n *\n * It covers the box rather than sitting on its value's line, so the box's\n * own padding opens the field too. It draws nothing: the box already carries\n * the fill, the underline and the focus indicator, and it lights up while\n * this has focus because the indicator follows focus within.\n */\nfunction FieldTrigger(props: FieldTriggerProps) {\n return <RACButton {...props} {...mergeStatefulStyles({\n className: \"xjbqb8w xc342km x9f619 x1ypdohk x10a8y8t x1t137rt x1717udv x10l6tqk\"\n }, props)} />;\n}\n\n/**\n * A field's value where it was chosen rather than typed, in a\n * {@link FieldBox}. Put React Aria's own element inside it — a select's\n * `SelectValue`, a picker's display — and this is what carries the input's\n * type and its place on the line, clearing the label at the top and\n * truncating rather than wrapping.\n *\n * The wrapper is the styled one rather than React Aria's element, because\n * this is the box's flex item: styling the element inside instead left it\n * sizing itself against a parent that had already shrink-wrapped to it.\n *\n * `isPlaceholder` says nothing has been chosen, which takes the muted role;\n * under a floating label it is hidden until the field is focused, exactly as\n * an input's placeholder is.\n */\nfunction FieldValue({\n isFocused = false,\n isPlaceholder = false,\n ...props\n}: FieldValueProps) {\n const box = useContext(BoxContext);\n const hidden = isPlaceholder && box.label === 'floating' && !isFocused;\n return <span {...props} {...mergeStyles({\n 0: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft\"\n },\n 4: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq\"\n },\n 2: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft x1w5n3ug\"\n },\n 6: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq x1w5n3ug\"\n },\n 1: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft x19co3pv\"\n },\n 5: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq x19co3pv\"\n },\n 3: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft x19co3pv\"\n },\n 7: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq x19co3pv\"\n }\n }[!!box.underLabel << 2 | !!isPlaceholder << 1 | !!hidden << 0], props)} />;\n}\nfunction useFieldPopulated() {\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n // A field whose value is chosen rather than typed holds no input at all,\n // so being populated is a question for its own state — without this a\n // select's floating label never floats, however much is chosen.\n const select = useContext(SelectStateContext);\n if (select !== null) {\n return select.selectionManager.selectedKeys.size > 0;\n }\n const value = input?.value ?? textArea?.value ?? '';\n return String(value).length > 0;\n}\n\n/**\n * Whether the control in this box is holding anything, read off React\n * Aria's context for whichever control the field renders. The filled box\n * reads the same thing in CSS through `:placeholder-shown`; this is for\n * what CSS cannot express — see the outlined variant's note above.\n */\n/**\n * A field's label: the colour alone, positioned and given its type by whatever\n * renders it. React Aria's `Label`, which the field around it associates with\n * its control through context.\n */\n// Hoisted rather than written as the parameter's default, which would be a\n// new object on every render.\nconst NO_STATE: Partial<FieldLabelState> = {};\nfunction FieldLabel({\n state = NO_STATE,\n ...props\n}: FieldLabelProps) {\n const {\n isDisabled = false,\n isFocusWithin = false,\n isInvalid = false\n } = state;\n return <Label {...props} {...mergeStyles({\n 0: {\n className: \"x1w5n3ug xkzkux9 xixa3zk xpc4ca7\"\n },\n 4: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1xj74d8\"\n },\n 2: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x4ii1qj\"\n },\n 6: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x4ii1qj\"\n },\n 1: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n },\n 5: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n },\n 3: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n },\n 7: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n }\n }[!!isDisabled << 2 | !!isInvalid << 1 | !!(!isDisabled && !isInvalid && isFocusWithin) << 0], props)} />;\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise. The error goes through React Aria's `FieldError`, which renders\n * only while the field is invalid and falls back to whatever validation\n * errors the field carries when no message is given — which is how a `Form`\n * with server-side errors, or the browser's own, reaches it without any\n * field changing. The description steps aside for those too, which is what\n * the field's validation state is read for.\n */\nfunction FieldMessage({\n characterCount = false,\n description,\n error,\n inset = true,\n maxLength\n}: FieldMessageProps) {\n const validation = useContext(FieldErrorContext);\n const invalid = error !== undefined || (validation?.isInvalid ?? false);\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n const insideForm = useInsideForm();\n\n // Nothing to say, and nowhere a message could arrive from: the field ends\n // at its control. Inside a form the line is drawn anyway, empty, since a\n // form is where a message appears after the fact — a server's answer, or\n // the browser's own on submit — and every field below this one would\n // otherwise move by the line's height when it does.\n if (!invalid && description === undefined && !characterCount && !insideForm) {\n return null;\n }\n const value = input?.value ?? textArea?.value ?? '';\n const length = String(value).length;\n return <div {...{\n 0: {\n className: \"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1pha0wt x78zum5 xxj4525 x1y88zpp x17jz683\"\n },\n 1: {\n className: \"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1pha0wt x78zum5 xxj4525 x1y88zpp x17jz683 xboopgi\"\n }\n }[!!inset << 0]}>\n {validation === null && error !== undefined ?\n // Outside a field that validates there is nothing to hand React\n // Aria's `FieldError`, and it draws nothing without it — a group of\n // chips is a group rather than a form control, so the error it was\n // given is written out instead.\n <span className=\"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x4ii1qj\">\n {error}\n </span> : <FieldError className=\"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x4ii1qj\">\n {error}\n </FieldError>}\n {!invalid && description !== undefined ? <Text slot=\"description\" className=\"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j\">\n {description}\n </Text> : null}\n {characterCount ? <span {...{\n 0: {\n className: \"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x2lah0s xss6m8b xvc5jky xuxw1ft\"\n },\n 1: {\n className: \"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x2lah0s xss6m8b xvc5jky xuxw1ft x4ii1qj\"\n }\n }[!!invalid << 0]}>\n {maxLength === undefined ? length : `${length}/${maxLength}`}\n </span> : null}\n </div>;\n}\nexport type { FieldBoxProps, FieldInputProps, FieldLabelProps, FieldLabelState, FieldMessageProps, FieldTextAreaProps, FieldVariant };\nexport { FieldBox, FieldInput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","ReactNode","Ref","ButtonProps","GroupProps","GroupRenderProps","InputProps","InputRenderProps","LabelProps","TextAreaProps","stylex","createContext","useContext","FieldError","FieldErrorContext","Group","Input","InputContext","Label","Button","RACButton","SelectStateContext","Text","TextArea","TextAreaContext","useSlottedContext","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","stateLayerOpacity","typography","useInsideForm","styles","autosizeCell","kJuA4N","$$css","box","kGNEyG","kWkggS","kZKoxP","kT0f0o","kVL7Gh","kfmiAY","krdFHd","kGVxlE","kB7OPa","k1xSpc","kOIVth","kGO01o","kLKAdn","kg3NbH","kVAEAm","kIyJzY","k1ekBW","kAMwcw","boxDisabled","boxError","boxFixed","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","boxFloating","boxLeading","kZCmMZ","boxMultiline","kAzted","boxOutlined","kMwMTN","boxOutlinedDisabled","boxOutlinedError","boxOutlinedFloating","boxTrailing","kwRFfy","column","kzQI83","k7Eaqz","columnDisabled","columnDisabledFloating","columnFloating","input","k8Qsv1","kMzoRj","kzqmXN","k3XXqK","kmVPX3","inputDisabled","inputUnderFloatingLabel","inputUnderLabel","keoZOQ","textArea","kVQacm","kHenm0","textAreaAutosize","BoxControl","label","BoxLabel","underLabel","FieldBoxProps","children","floatingLabel","isPopulated","leading","multiline","ref","HTMLDivElement","trailing","trigger","variant","FieldVariant","Omit","FieldInputProps","numeric","prefix","suffix","FieldLabelProps","state","Partial","FieldLabelState","Pick","FieldMessageProps","characterCount","description","error","inset","maxLength","FieldTextAreaProps","autosize","FieldTriggerProps","FieldValueProps","HTMLElement","isFocused","isPlaceholder","OUTSIDE_BOX","BOX_CONTROLS","filled","fixed","floating","outlined","Record","BoxContext","boxContent","BoxContent","t0","$","_c","read","useFieldPopulated","populated","floated","isFocusWithin","t1","t2","0","className","2","1","3","undefined","t3","isDisabled","t4","props","t5","Symbol","for","4","6","5","7","t6","t7","t8","t9","isInvalid","t10","boxStyles","FieldBox","T0","t11","FieldInput","placeholder","8","12","10","14","9","13","11","15","control","FieldTextArea","context","value","FieldTrigger","FieldValue","hidden","select","selectionManager","selectedKeys","size","String","length","NO_STATE","FieldLabel","FieldMessage","validation","invalid","insideForm"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport type { ButtonProps, GroupProps, GroupRenderProps, InputProps, InputRenderProps, LabelProps, TextAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { FieldError, FieldErrorContext, Group, Input, InputContext, Label, Button as RACButton, SelectStateContext, Text, TextArea, TextAreaContext, useSlottedContext } from 'react-aria-components';\nimport { mergeStatefulStyles, mergeStyles } from '../styles/merge';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\nimport { useInsideForm } from './root';\n\n// The chrome every field shares: the filled box with its label at the top, the\n// control inside it, and the line of supporting text under it. TextField drew\n// all of it on its own until the coverage plan brought a dozen more fields,\n// each of which would otherwise have written the same box a second time.\n//\n// Not a component of the library's own and not exported. Each field is still\n// React Aria's field component — TextField, NumberField, DateField — and these\n// are the parts it renders inside, which is what keeps the label association,\n// the description and error wiring, and validation on React Aria's side.\n//\n// The focus indicator is an inset box-shadow on the bottom edge rather than a\n// border that thickens. A real border going 1px -> 2px on focus grows the\n// box, which pushes every sibling below it down by a pixel — so a form\n// twitches each time focus moves between its fields. A shadow is drawn inside\n// the box and changes nothing about its size.\n//\n// The label floats, as the text fields page draws it: body-large and centred\n// in an empty, unfocused box, body-small at the top once the field is focused\n// or holds a value. `floatingLabel={false}` keeps it small at the top in\n// every state instead.\n//\n// Where the label sits depends on the box's state, and a child cannot select\n// on its parent's state while the box can select on its own. So the label's\n// type is set on the box and inherited: the box changes the font size and\n// line height it hands down when focus is within it, or when its control\n// shows something other than its placeholder, and the label transitions\n// between the two. Resting, the line is the box less its padding, which is\n// what centres the label without a position to move — the move to the top is\n// a change of type alone. The control sets its own type, so none of this\n// reaches it.\n//\n// The label's colour follows the control's focus the same way: the box is\n// React Aria's Group, which reports focus within it as render state, and the\n// label takes `labelFocused` from that.\n//\n// The box is a row: an icon slot at either end, if the field has one, with\n// the label and control between them. The page gives the icons 24dp, 12dp\n// from the box's edge and 16dp from the text, centred in the box's height;\n// the slot cancels the box's top padding and stretches to its full height,\n// so it centres whatever it holds — a 24dp icon, or an icon button around\n// one. The label and the control sit in a column of their own, which is\n// what the label is positioned against, so it moves past a leading icon\n// with the text.\n//\n// A prefix or suffix sits on the control's line, in the control's type and\n// the muted role, and shows only while the field is focused or holds a\n// value, as the placeholder does — at rest the label is where it would be.\n// It is the column's colour it takes, inherited, since the column can\n// select on its own focus and content and the affix cannot select on\n// either.\n//\n// The outlined variant is the page's outlined text field: no fill, a 1dp\n// outline in the outline role with 4dp corners all round, 2dp and primary\n// while focused, on surface while hovered, the error role with an error,\n// and the label cutting the outline once it floats, with the page's 4dp\n// beside it. The value is centred, 16dp from the top and bottom, and the\n// label rests on its line and moves up onto the outline — a move, where the\n// filled label only changes type.\n//\n// The outline is a fieldset laid over the box: a browser draws a fieldset's\n// border around its legend, so a legend holding a copy of the label, in the\n// label's floated type, is what cuts the outline to the label's width with\n// nothing measured. Empty, it cuts nothing, which is the closed notch.\n//\n// Neither the notch nor the label can select on the state that drives them.\n// Both are children of the box and the state is the box's, and the filled\n// label reads it in CSS only because it changes type alone, which the box\n// hands down inherited — where the notch changes what it holds and the\n// label changes where it sits, and neither of those inherits. So the box's\n// content computes that state in React instead: focus from the box's own\n// render state, and a value from the control's context, which is where the\n// character counter reads it too. The border's colour is the box's,\n// inherited, which is what carries the hover, focus, error and disabled\n// roles to it.\nconst styles = {\n autosizeCell: {\n kJuA4N: \"x1b1wf8y\",\n $$css: true\n },\n box: {\n kGNEyG: \"x1cy8zhl\",\n kWkggS: \"x1rrhr5q\",\n kZKoxP: \"xnnlda6\",\n kT0f0o: \"x16uus16\",\n kVL7Gh: \"xbiv7yw\",\n kfmiAY: \"xirz1nw\",\n krdFHd: \"xzcck0f\",\n kGVxlE: \"x89kqus x18rfq6m\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xxj4525\",\n kGO01o: \"x18d9i69\",\n kLKAdn: \"xi7mcox\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xkdsq27\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n boxDisabled: {\n kWkggS: \"xepofeg\",\n kGVxlE: \"x1pqbjc1\",\n $$css: true\n },\n boxError: {\n kGVxlE: \"x1lxxh4i x1d6xoej\",\n $$css: true\n },\n boxFixed: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n $$css: true\n },\n boxFloating: {\n kMv6JI: \"x1ps135g xnc7ww3 x16svsjw\",\n kGuDYH: \"x52kfa xys1t9b x1848etk\",\n k63SB2: \"xz4f7ai xn9xqko x1c52epr\",\n kb6lSQ: \"x19wmx12 x1t00fh7 x1qn8t5l\",\n kLWn49: \"xsv50tp x1f5c3pk x181fmp8\",\n $$css: true\n },\n boxLeading: {\n kZCmMZ: \"xwde665\",\n $$css: true\n },\n boxMultiline: {\n kZKoxP: \"xt7dq6l\",\n kAzted: \"xbktkl8\",\n kGO01o: \"xqf7pud\",\n $$css: true\n },\n boxOutlined: {\n kWkggS: \"xjbqb8w\",\n kT0f0o: \"x4gcak0\",\n kVL7Gh: \"xqs30sb\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x158cnre x1igw6b7 x1sa41d3\",\n kGO01o: \"xzfxn0k\",\n kLKAdn: \"x1clyivc\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n boxOutlinedDisabled: {\n kWkggS: \"xjbqb8w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1ldq0ta\",\n $$css: true\n },\n boxOutlinedError: {\n kMwMTN: \"x12voer2 x1h298ve x4ii1qj\",\n $$css: true\n },\n boxOutlinedFloating: {\n kLWn49: \"xsv50tp x1f5c3pk xay82u3\",\n $$css: true\n },\n boxTrailing: {\n kwRFfy: \"xk163s\",\n $$css: true\n },\n column: {\n kMwMTN: \"x1w5n3ug\",\n kzQI83: \"x1iyjqo2\",\n k7Eaqz: \"xeuugli\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n columnDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n columnDisabledFloating: {\n kMwMTN: \"xspc5gk x19co3pv\",\n $$css: true\n },\n columnFloating: {\n kMwMTN: \"x1dfuzvz x6phwhp x19co3pv\",\n $$css: true\n },\n input: {\n k8Qsv1: \"x1hgeflb\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k3XXqK: \"x1t137rt\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n inputDisabled: {\n k8Qsv1: \"x7ip5l3\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n inputUnderFloatingLabel: {\n k8Qsv1: \"x1mvm7v4 xxqzaim\",\n $$css: true\n },\n inputUnderLabel: {\n keoZOQ: \"xwuztrq\",\n $$css: true\n },\n textArea: {\n k1xSpc: \"x1lliihq\",\n kVQacm: \"xysyzu8\",\n kHenm0: \"xtt52l0\",\n $$css: true\n },\n textAreaAutosize: {\n kVQacm: \"xb3r6kr\",\n $$css: true\n }\n};\n\n// What a control needs to know about the box around it: how the label is\n// drawn, and whether the control clears it with a margin — it does under\n// the filled box's label, and not under the outlined box's, whose label\n// sits on the outline rather than over the value.\ninterface BoxControl {\n label: BoxLabel;\n underLabel: boolean;\n}\n\n// How the box draws its label, for the control inside it — see the context\n// below.\ntype BoxLabel = 'fixed' | 'floating' | 'none';\ntype FieldBoxProps = {\n children?: ReactNode;\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, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * Whether the control is holding anything, for a field whose control the\n * chrome cannot ask. It reads an input, a text area and a select's own\n * state; a control that is none of those — a token field's editable area,\n * say — says so here, and the floating label floats on it.\n */\n isPopulated?: boolean;\n /** What the field is for. */\n label: string;\n /** An icon at the start of the box, before the label and the control. */\n leading?: ReactNode;\n /**\n * Whether the box takes its height from the control inside it rather\n * than the page's 56dp, for a text area.\n * @default false\n */\n multiline?: boolean;\n /**\n * The box's own element. A field whose box is what something else is\n * anchored to needs it — a select's list is positioned against the box and\n * takes its width from it, which is what makes the two the same width.\n */\n ref?: Ref<HTMLDivElement>;\n /** An icon at the end of the box, after the control. */\n trailing?: ReactNode;\n /**\n * A press target covering the whole box, for a field whose box opens\n * something rather than taking a keystroke — {@link FieldTrigger}. Drawn\n * in the box itself rather than in the column the label and the control\n * share, so the padding and the icons open it too.\n */\n trigger?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<GroupProps, 'children'>;\n\n// `prefix` is also an HTML attribute — the RDFa one, which nothing here\n// wants — and React's element types carry it as a string, so it is left out\n// of the props taken from React Aria to make room for the affix.\ntype FieldInputProps = Omit<InputProps, 'prefix'> & {\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, shown while the field is focused or\n * holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, shown while the field is focused or\n * holds a value.\n */\n suffix?: ReactNode;\n};\ntype FieldLabelProps = LabelProps & {\n /**\n * The states the colour follows. Disabled wins over error, and error over\n * focus, so a focused invalid field keeps its error colour.\n */\n state?: Partial<FieldLabelState>;\n};\ntype FieldLabelState = Pick<GroupRenderProps, 'isDisabled' | 'isFocusWithin' | 'isInvalid'>;\ninterface FieldMessageProps {\n /**\n * Whether to count the characters the control holds at the end of the\n * line, against `maxLength` where there is one. The count is read off the\n * field's own input or text area context.\n * @default false\n */\n characterCount?: boolean;\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 | undefined;\n /** The problem with the current value, in words. */\n error?: string | undefined;\n /**\n * Whether the line is indented to a box's inline padding, so it starts\n * where a value above it does. Off for a field with no box to line up with.\n * @default true\n */\n inset?: boolean;\n /** The limit the count is shown against. */\n maxLength?: number | undefined;\n}\ntype FieldTextAreaProps = TextAreaProps & {\n /**\n * Whether the control grows with the text it holds, from the rows it asks\n * for. Off, it keeps its rows and scrolls.\n * @default false\n */\n autosize?: boolean;\n};\ntype FieldTriggerProps = ButtonProps;\ntype FieldValueProps = HTMLAttributes<HTMLElement> & {\n /**\n * Whether the field has focus. A hidden placeholder appears while it does,\n * the way an input's does.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether nothing has been chosen yet, so what is drawn is the placeholder\n * rather than a value.\n * @default false\n */\n isPlaceholder?: boolean;\n};\ntype FieldVariant = 'filled' | 'outlined';\n\n// A control under a floating label carries a placeholder so the box can\n// tell when it is populated, shown only while focused. The default is what\n// a control rendered outside any box gets — a search bar's, which has no\n// label over it and shows its placeholder in every state. The four a box\n// provides are hoisted so each is one stable object.\nconst OUTSIDE_BOX: BoxControl = {\n label: 'none',\n underLabel: false\n};\nconst BOX_CONTROLS = {\n filled: {\n fixed: {\n label: 'fixed',\n underLabel: true\n },\n floating: {\n label: 'floating',\n underLabel: true\n }\n },\n outlined: {\n fixed: {\n label: 'fixed',\n underLabel: false\n },\n floating: {\n label: 'floating',\n underLabel: false\n }\n }\n} satisfies Record<FieldVariant, Record<'fixed' | 'floating', BoxControl>>;\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX);\n\n// Written as calls rather than function literals at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// each result on its inputs.\nfunction boxContent(label: string, children: ReactNode, floatingLabel: boolean, isPopulated: boolean | undefined, leading: ReactNode, trailing: ReactNode, trigger: ReactNode, variant: FieldVariant) {\n return (state: GroupRenderProps) => <BoxContent floatingLabel={floatingLabel} isPopulated={isPopulated} label={label} leading={leading} state={state} trailing={trailing} trigger={trigger} variant={variant}>\n {children}\n </BoxContent>;\n}\n\n/**\n * What a box holds: its icons, its label and the control between them, plus\n * the outline when it has one. A component rather than the render function\n * itself, so it can read whether the control holds a value — which is what\n * the outlined box's notch and label follow, and what CSS cannot express\n * for them. See the outlined variant's note above.\n */\nfunction BoxContent({\n children,\n floatingLabel,\n isPopulated,\n label,\n leading,\n state,\n trailing,\n trigger,\n variant\n}: {\n children: ReactNode;\n floatingLabel: boolean;\n isPopulated: boolean | undefined;\n label: string;\n leading: ReactNode;\n state: GroupRenderProps;\n trailing: ReactNode;\n trigger: ReactNode;\n variant: FieldVariant;\n}) {\n const read = useFieldPopulated();\n const populated = isPopulated ?? read;\n const outlined = variant === 'outlined';\n const floated = !floatingLabel || state.isFocusWithin || populated;\n return <BoxContext value={BOX_CONTROLS[variant][floatingLabel ? 'floating' : 'fixed']}>\n {outlined ? <fieldset aria-hidden=\"true\" {...{\n 0: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 xmkeg23 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7\"\n },\n 2: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 xmkeg23 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7 x167ah0f\"\n },\n 1: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7 xdh2fpr\"\n },\n 3: {\n className: \"x1r7ld26 x1tfhd1 x1y0btm7 x9f619 x1yicsit x1b35g6e x9d6959 x10a8y8t xwth0xh x1ghz6dp xeuugli xt970qd x1mhv0kc x47corl x10l6tqk x1qno0dh x1aqzbqr xpc4ca7 x167ah0f xdh2fpr\"\n }\n }[!!(leading !== undefined) << 1 | !!state.isFocusWithin << 0]}>\n <legend {...{\n 0: {\n className: \"xqtp20y x14ju556 x193iq5w xb3r6kr x1717udv xlshs6z xuxw1ft\"\n },\n 1: {\n className: \"xqtp20y x14ju556 x193iq5w xb3r6kr x1717udv xlshs6z xuxw1ft ximhkdq\"\n }\n }[!!floated << 0]}>\n {floated ? label : null}\n </legend>\n </fieldset> : null}\n {trigger}\n {leading === undefined ? null : <span {...{\n 0: {\n className: \"x6s0dn4 xkh2ocl x1w5n3ug x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7\"\n },\n 1: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x1xj74d8\"\n }\n }[!!state.isDisabled << 0]}>\n {leading}\n </span>}\n <div {...stylex.props(styles.column, floatingLabel && styles.columnFloating, state.isDisabled && (floatingLabel ? styles.columnDisabledFloating : styles.columnDisabled))}>\n <FieldLabel state={state} {...{\n 0: {\n className: \"x13vifvy x1o0tod x10l6tqk\"\n },\n 4: {\n className: \"x13vifvy x1o0tod x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh\"\n },\n 2: {\n className: \"x13vifvy x10l6tqk x10k232c ximhkdq\"\n },\n 6: {\n className: \"x13vifvy x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10k232c ximhkdq\"\n },\n 1: {\n className: \"x1o0tod x10l6tqk x1qjp6zz\"\n },\n 5: {\n className: \"x1o0tod x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x1qjp6zz\"\n },\n 3: {\n className: \"x10l6tqk x10k232c ximhkdq x1qjp6zz\"\n },\n 7: {\n className: \"x10l6tqk x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10k232c ximhkdq x1qjp6zz\"\n }\n }[!!(floatingLabel && floated) << 2 | !!outlined << 1 | !!(outlined && floated) << 0]}>\n {label}\n </FieldLabel>\n {children}\n </div>\n {trailing === undefined ? null : <span {...{\n 0: {\n className: \"x6s0dn4 xkh2ocl x1w5n3ug x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7\"\n },\n 2: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 1: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x1xj74d8\"\n },\n 3: {\n className: \"x6s0dn4 xkh2ocl x78zum5 x2lah0s x1pvqxga xl56j7k x1motrhk xkzkux9 xt3l3uh xpc4ca7 x1xj74d8\"\n }\n }[!!state.isInvalid << 1 | !!state.isDisabled << 0]}>\n {trailing}\n </span>}\n </BoxContext>;\n}\nfunction boxStyles(floatingLabel: boolean, multiline: boolean, leading: boolean, trailing: boolean, variant: FieldVariant) {\n const outlined = variant === 'outlined';\n return (state: GroupRenderProps) => stylex.props(styles.box, floatingLabel ? styles.boxFloating : styles.boxFixed, multiline && styles.boxMultiline, leading && styles.boxLeading, trailing && styles.boxTrailing, outlined && styles.boxOutlined, outlined && floatingLabel && styles.boxOutlinedFloating, state.isInvalid && (outlined ? styles.boxOutlinedError : styles.boxError), state.isDisabled && (outlined ? styles.boxOutlinedDisabled : styles.boxDisabled));\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. React\n * Aria's `Group`, so\n * the field around it hands down `isDisabled` and `isInvalid` through context\n * and the box reports focus within it as render state, which is what the\n * label's colour follows. A field that provides no group context — one built\n * on a button rather than an input — passes the two states itself.\n */\nfunction FieldBox({\n children,\n floatingLabel = true,\n isPopulated,\n label,\n leading,\n multiline = false,\n trailing,\n trigger,\n variant = 'filled',\n ...props\n}: FieldBoxProps) {\n return <Group {...props} {...mergeStatefulStyles(boxStyles(floatingLabel, multiline, leading !== undefined, trailing !== undefined, variant), props)}>\n {boxContent(label, children, floatingLabel, isPopulated, leading, trailing, trigger, variant)}\n </Group>;\n}\n\n/**\n * A field's text control, in a {@link FieldBox} or on its own. React Aria's\n * `Input`, which takes its label association, value and validation from the\n * field around it and reports its disabled state as render state.\n *\n * In a box it clears the label at the top, and under a floating label it\n * always carries a placeholder, since that is what the box reads to tell a\n * populated control from an empty one: its own where it was given one, a\n * blank otherwise. Outside a box it has no label over it and shows the\n * placeholder it was given in every state.\n */\nfunction FieldInput({\n numeric = false,\n placeholder,\n prefix,\n suffix,\n ...props\n}: FieldInputProps) {\n const box = useContext(BoxContext);\n const control = <Input placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => ({\n 0: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv\"\n },\n 8: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq\"\n },\n 4: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x1mvm7v4 xxqzaim\"\n },\n 12: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x1mvm7v4 xxqzaim\"\n },\n 2: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xbppi91 xss6m8b\"\n },\n 10: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq xbppi91 xss6m8b\"\n },\n 6: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x1mvm7v4 xxqzaim xbppi91 xss6m8b\"\n },\n 14: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x1mvm7v4 xxqzaim xbppi91 xss6m8b\"\n },\n 1: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x7ip5l3 x1xj74d8\"\n },\n 9: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x7ip5l3 x1xj74d8\"\n },\n 5: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x7ip5l3 x1xj74d8\"\n },\n 13: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x7ip5l3 x1xj74d8\"\n },\n 3: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n },\n 11: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n },\n 7: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n },\n 15: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq xbppi91 xss6m8b x7ip5l3 x1xj74d8\"\n }\n })[!!box.underLabel << 3 | !!(box.label === 'floating') << 2 | !!numeric << 1 | !!state.isDisabled << 0], props)} />;\n if (prefix === undefined && suffix === undefined) {\n return control;\n }\n return <span className=\"x1pha0wt x78zum5 x14qo01y\">\n {prefix === undefined ? null : <span {...{\n 0: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft\"\n },\n 1: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft xwuztrq\"\n }\n }[!!box.underLabel << 0]}>\n {prefix}\n </span>}\n {control}\n {suffix === undefined ? null : <span {...{\n 0: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft\"\n },\n 1: {\n className: \"x2lah0s x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej xkzkux9 xt3l3uh xpc4ca7 xuxw1ft xwuztrq\"\n }\n }[!!box.underLabel << 0]}>\n {suffix}\n </span>}\n </span>;\n}\n\n/**\n * A field's multi-line text control, in a {@link FieldBox} drawn `multiline`.\n * React Aria's `TextArea`, with the same label association, value and\n * validation {@link FieldInput} takes from the field around it, and the same\n * placeholder under a floating label.\n *\n * Given `autosize` it grows with its text from the rows it asks for. The\n * value it grows to fit is read off the field's context rather than\n * measured: the box holds a hidden replica of it in the control's own type,\n * in the same grid cell as the control, and the cell is as tall as whichever\n * of the two is taller.\n */\nfunction FieldTextArea({\n autosize = false,\n placeholder,\n ...props\n}: FieldTextAreaProps) {\n const box = useContext(BoxContext);\n const context = useSlottedContext(TextAreaContext);\n const value = typeof context?.value === 'string' ? context.value : '';\n const control = <TextArea placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(styles.input, box.underLabel && styles.inputUnderLabel, box.label === 'floating' && styles.inputUnderFloatingLabel, styles.textArea, autosize && styles.textAreaAutosize, autosize && styles.autosizeCell, state.isDisabled && styles.inputDisabled), props)} />;\n if (!autosize) {\n return control;\n }\n\n // A trailing space keeps a final line break of the value as a line of the\n // replica, which is how the control renders it.\n return <div className=\"xrvj5dj\">\n {control}\n <div aria-hidden=\"true\" {...{\n 0: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x1mzt3pk xlshs6z x126k92a x1b1wf8y\"\n },\n 1: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv xwuztrq x1mzt3pk xlshs6z x126k92a x1b1wf8y\"\n }\n }[!!box.underLabel << 0]}>\n {value}{' '}\n </div>\n </div>;\n}\n\n/**\n * The press target over a {@link FieldBox} whose whole surface opens\n * something — a select's list, a picker's calendar. React Aria's `Button`,\n * which takes the trigger's props from the field around it through context.\n *\n * It covers the box rather than sitting on its value's line, so the box's\n * own padding opens the field too. It draws nothing: the box already carries\n * the fill, the underline and the focus indicator, and it lights up while\n * this has focus because the indicator follows focus within.\n */\nfunction FieldTrigger(props: FieldTriggerProps) {\n return <RACButton {...props} {...mergeStatefulStyles({\n className: \"xjbqb8w xc342km x9f619 x1ypdohk x10a8y8t x1t137rt x1717udv x10l6tqk\"\n }, props)} />;\n}\n\n/**\n * A field's value where it was chosen rather than typed, in a\n * {@link FieldBox}. Put React Aria's own element inside it — a select's\n * `SelectValue`, a picker's display — and this is what carries the input's\n * type and its place on the line, clearing the label at the top and\n * truncating rather than wrapping.\n *\n * The wrapper is the styled one rather than React Aria's element, because\n * this is the box's flex item: styling the element inside instead left it\n * sizing itself against a parent that had already shrink-wrapped to it.\n *\n * `isPlaceholder` says nothing has been chosen, which takes the muted role;\n * under a floating label it is hidden until the field is focused, exactly as\n * an input's placeholder is.\n */\nfunction FieldValue({\n isFocused = false,\n isPlaceholder = false,\n ...props\n}: FieldValueProps) {\n const box = useContext(BoxContext);\n const hidden = isPlaceholder && box.label === 'floating' && !isFocused;\n return <span {...props} {...mergeStyles({\n 0: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft\"\n },\n 4: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq\"\n },\n 2: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft x1w5n3ug\"\n },\n 6: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq x1w5n3ug\"\n },\n 1: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft x19co3pv\"\n },\n 5: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq x19co3pv\"\n },\n 3: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft x19co3pv\"\n },\n 7: {\n className: \"x1hgeflb xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1t137rt x1717udv x6s0dn4 x78zum5 xb3r6kr xlyipyv xuxw1ft xwuztrq x19co3pv\"\n }\n }[!!box.underLabel << 2 | !!isPlaceholder << 1 | !!hidden << 0], props)} />;\n}\nfunction useFieldPopulated() {\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n // A field whose value is chosen rather than typed holds no input at all,\n // so being populated is a question for its own state — without this a\n // select's floating label never floats, however much is chosen.\n const select = useContext(SelectStateContext);\n if (select !== null) {\n return select.selectionManager.selectedKeys.size > 0;\n }\n const value = input?.value ?? textArea?.value ?? '';\n return String(value).length > 0;\n}\n\n/**\n * Whether the control in this box is holding anything, read off React\n * Aria's context for whichever control the field renders. The filled box\n * reads the same thing in CSS through `:placeholder-shown`; this is for\n * what CSS cannot express — see the outlined variant's note above.\n */\n/**\n * A field's label: the colour alone, positioned and given its type by whatever\n * renders it. React Aria's `Label`, which the field around it associates with\n * its control through context.\n */\n// Hoisted rather than written as the parameter's default, which would be a\n// new object on every render.\nconst NO_STATE: Partial<FieldLabelState> = {};\nfunction FieldLabel({\n state = NO_STATE,\n ...props\n}: FieldLabelProps) {\n const {\n isDisabled = false,\n isFocusWithin = false,\n isInvalid = false\n } = state;\n return <Label {...props} {...mergeStyles({\n 0: {\n className: \"x1w5n3ug xkzkux9 xixa3zk xpc4ca7\"\n },\n 4: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1xj74d8\"\n },\n 2: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x4ii1qj\"\n },\n 6: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x4ii1qj\"\n },\n 1: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n },\n 5: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n },\n 3: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n },\n 7: {\n className: \"xkzkux9 xixa3zk xpc4ca7 x1mxwv8y\"\n }\n }[!!isDisabled << 2 | !!isInvalid << 1 | !!(!isDisabled && !isInvalid && isFocusWithin) << 0], props)} />;\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise. The error goes through React Aria's `FieldError`, which renders\n * only while the field is invalid and falls back to whatever validation\n * errors the field carries when no message is given — which is how a `Form`\n * with server-side errors, or the browser's own, reaches it without any\n * field changing. The description steps aside for those too, which is what\n * the field's validation state is read for.\n */\nfunction FieldMessage({\n characterCount = false,\n description,\n error,\n inset = true,\n maxLength\n}: FieldMessageProps) {\n const validation = useContext(FieldErrorContext);\n const invalid = error !== undefined || (validation?.isInvalid ?? false);\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n const insideForm = useInsideForm();\n\n // Nothing to say, and nowhere a message could arrive from: the field ends\n // at its control. Inside a form the line is drawn anyway, empty, since a\n // form is where a message appears after the fact — a server's answer, or\n // the browser's own on submit — and every field below this one would\n // otherwise move by the line's height when it does.\n if (!invalid && description === undefined && !characterCount && !insideForm) {\n return null;\n }\n const value = input?.value ?? textArea?.value ?? '';\n const length = String(value).length;\n return <div {...{\n 0: {\n className: \"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1pha0wt x78zum5 xxj4525 x1y88zpp x17jz683\"\n },\n 1: {\n className: \"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1pha0wt x78zum5 xxj4525 x1y88zpp x17jz683 xboopgi\"\n }\n }[!!inset << 0]}>\n {validation === null && error !== undefined ?\n // Outside a field that validates there is nothing to hand React\n // Aria's `FieldError`, and it draws nothing without it — a group of\n // chips is a group rather than a form control, so the error it was\n // given is written out instead.\n <span className=\"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x4ii1qj\">\n {error}\n </span> : <FieldError className=\"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x4ii1qj\">\n {error}\n </FieldError>}\n {!invalid && description !== undefined ? <Text slot=\"description\" className=\"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j\">\n {description}\n </Text> : null}\n {characterCount ? <span {...{\n 0: {\n className: \"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x2lah0s xss6m8b xvc5jky xuxw1ft\"\n },\n 1: {\n className: \"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x2lah0s xss6m8b xvc5jky xuxw1ft x4ii1qj\"\n }\n }[!!invalid << 0]}>\n {maxLength === undefined ? length : `${length}/${maxLength}`}\n </span> : null}\n </div>;\n}\nexport type { FieldBoxProps, FieldInputProps, FieldLabelProps, FieldLabelState, FieldMessageProps, FieldTextAreaProps, FieldVariant };\nexport { FieldBox, FieldInput, FieldLabel, FieldMessage, FieldTextArea, FieldTrigger, FieldValue };"],"mappings":";;;;;;;;AAoFA,MAAMmC,SAAS;CACbC,cAAc;EACZC,QAAQ;EACRC,OAAO;CACT;CACAC,KAAK;EACHC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC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AvB;EAAAuB,EAAA,KAAA+D;EAAA/D,EAAA,KAAA0D;EAAA1D,EAAA,MAAAnB;EAAAmB,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,IAAA4B;CAAA,IAAA5B,EAAA,QAAAiB,MAAAjB,EAAA,QAAAmB,MAAAnB,EAAA,QAAA0B,MAAA1B,EAAA,QAAA2B,IAAA;EA9BbC,KAAA,qBAAA,OAAA;GA+BC,GA/BQX;GAAT,UAAA;IAQFE;IAUAO;IAGAC;GAUG;;EAAA3B,EAAA,MAAAiB;EAAAjB,EAAA,MAAAmB;EAAAnB,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;CAAA,OAAAA,KAAA5B,EAAA;CAAA,OA/BD4B;AA+BC"}
@@ -1 +1 @@
1
- {"version":3,"file":"root.js","names":[],"sources":["../../src/field/root.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport { FormContext, useSlottedContext } from 'react-aria-components';\n\n// What a field applies to its own root, which is React Aria's field element\n// rather than a part of the chrome. Apart from the parts in ./index.tsx so\n// that file exports components alone, which is what keeps fast refresh working\n// for it.\n\n/**\n * What a field passes React Aria for `validationBehavior` outside a `Form`.\n * The message under a field is the library's to show, so validation only\n * marks the control rather than surfacing the browser's own constraint UI.\n * One constant rather than a literal in each field, so the decision has one\n * place to be changed.\n */\nconst FIELD_VALIDATION_BEHAVIOR = 'aria';\n\n/**\n * What a field passes React Aria for `isInvalid`, from its `error` prop. Any\n * value there, `false` included, makes the field's validation controlled: it\n * is exactly as invalid as the prop says, and what a `Form` reports for it —\n * a server's errors, or the browser's own — is never shown. So the prop is\n * left unset while the field has no error of its own, which is what lets\n * the form's reach it.\n */\nfunction invalidFrom(error: string | undefined): true | undefined {\n return error === undefined ? undefined : true;\n}\n\n/**\n * The validation behaviour a field passes React Aria: its `Form`'s, where it\n * is inside one, and {@link FIELD_VALIDATION_BEHAVIOR} otherwise. React Aria\n * takes a field's own prop over its form's, so a field that passed the\n * constant could never be opted into the native behaviour by the form around\n * it; reading the form here is what lets `Form` decide for every field at\n * once.\n */\nfunction useFieldValidationBehavior(): 'aria' | 'native' {\n const form = useSlottedContext(FormContext);\n return form?.validationBehavior ?? FIELD_VALIDATION_BEHAVIOR;\n}\n\n/**\n * Whether this field is inside a `Form`. A form is where a message arrives\n * after the fact — a server's answer, or the browser's own on submit — so it\n * is where the line under a field is kept clear whether or not there is\n * anything to say, and the fields below it stay where they are.\n */\nfunction useInsideForm() {\n return useSlottedContext(FormContext) !== null;\n}\nconst fieldStyles = {\n root: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n $$css: true\n }\n};\nexport { FIELD_VALIDATION_BEHAVIOR, fieldStyles, invalidFrom, useFieldValidationBehavior, useInsideForm };"],"mappings":";;;;;;;;;AAeA,MAAM,4BAA4B;;;;;;;;;AAUlC,SAAS,YAAY,OAA6C;CAChE,OAAO,UAAU,KAAA,IAAY,KAAA,IAAY;AAC3C;;;;;;;;;AAUA,SAAA,6BAAA;CAC8C,OAA/B,kBAAkB,WACxB,CAAI,EAAA,sBAAA;AAAiD;;;;;;;AAS9D,SAAA,gBAAA;CAAA,OACS,kBAAkB,WAAW,MAAM;AAAI;AAEhD,MAAM,cAAc,EAClB,MAAM;CACJ,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,OAAO;AACT,EACF"}
1
+ {"version":3,"file":"root.js","names":["stylex","FormContext","useSlottedContext","FIELD_VALIDATION_BEHAVIOR","invalidFrom","error","undefined","useFieldValidationBehavior","form","validationBehavior","useInsideForm","fieldStyles","root","kB7OPa","k1xSpc","kXwgrk","$$css"],"sources":["../../src/field/root.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport { FormContext, useSlottedContext } from 'react-aria-components';\n\n// What a field applies to its own root, which is React Aria's field element\n// rather than a part of the chrome. Apart from the parts in ./index.tsx so\n// that file exports components alone, which is what keeps fast refresh working\n// for it.\n\n/**\n * What a field passes React Aria for `validationBehavior` outside a `Form`.\n * The message under a field is the library's to show, so validation only\n * marks the control rather than surfacing the browser's own constraint UI.\n * One constant rather than a literal in each field, so the decision has one\n * place to be changed.\n */\nconst FIELD_VALIDATION_BEHAVIOR = 'aria';\n\n/**\n * What a field passes React Aria for `isInvalid`, from its `error` prop. Any\n * value there, `false` included, makes the field's validation controlled: it\n * is exactly as invalid as the prop says, and what a `Form` reports for it —\n * a server's errors, or the browser's own — is never shown. So the prop is\n * left unset while the field has no error of its own, which is what lets\n * the form's reach it.\n */\nfunction invalidFrom(error: string | undefined): true | undefined {\n return error === undefined ? undefined : true;\n}\n\n/**\n * The validation behaviour a field passes React Aria: its `Form`'s, where it\n * is inside one, and {@link FIELD_VALIDATION_BEHAVIOR} otherwise. React Aria\n * takes a field's own prop over its form's, so a field that passed the\n * constant could never be opted into the native behaviour by the form around\n * it; reading the form here is what lets `Form` decide for every field at\n * once.\n */\nfunction useFieldValidationBehavior(): 'aria' | 'native' {\n const form = useSlottedContext(FormContext);\n return form?.validationBehavior ?? FIELD_VALIDATION_BEHAVIOR;\n}\n\n/**\n * Whether this field is inside a `Form`. A form is where a message arrives\n * after the fact — a server's answer, or the browser's own on submit — so it\n * is where the line under a field is kept clear whether or not there is\n * anything to say, and the fields below it stay where they are.\n */\nfunction useInsideForm() {\n return useSlottedContext(FormContext) !== null;\n}\nconst fieldStyles = {\n root: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n $$css: true\n }\n};\nexport { FIELD_VALIDATION_BEHAVIOR, fieldStyles, invalidFrom, useFieldValidationBehavior, useInsideForm };"],"mappings":";;;;;;;;;AAeA,MAAMG,4BAA4B;;;;;;;;;AAUlC,SAASC,YAAYC,OAA6C;CAChE,OAAOA,UAAUC,KAAAA,IAAYA,KAAAA,IAAY;AAC3C;;;;;;;;;AAUA,SAAAC,6BAAA;CAC8C,OAA/BL,kBAAkBD,WACxBO,CAAI,EAAAC,sBAAAA;AAAiD;;;;;;;AAS9D,SAAAC,gBAAA;CAAA,OACSR,kBAAkBD,WAAW,MAAM;AAAI;AAEhD,MAAMU,cAAc,EAClBC,MAAM;CACJC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF"}
@@ -1,5 +1,5 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { c } from "react/compiler-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  //#region src/glyphs/index.tsx
4
4
  function ArrowDownwardGlyph(props) {
5
5
  const $ = c(3);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { SVGProps } from 'react'\n\n// The glyphs the library's own controls draw: the check and the dash a\n// checkbox shows, the plus and minus a number field's steppers show, and\n// the magnifier and cross a search field shows. Inline SVG in\n// `currentColor`, sized by whatever renders them, and private to the\n// library — a call site with icons of its own passes them to IconButton and\n// the slots that take a node, which is why nothing here is exported from\n// the package.\n//\n// The paths are the check, the horizontal rule, the plus, the search, the\n// close, the right chevron, the two sort arrows and the calendar from\n// Material Symbols on their 24-unit grid, which is what the checkbox page\n// draws at 18dp, the icon buttons page at 20 and the search, menus and date\n// picker pages at 24.\n\ntype GlyphProps = Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'>\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending, which is the direction the data tables page puts beside a\n// column header's name. Neither mirrors under a right-to-left writing mode:\n// they say \"up\" and \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\n </svg>\n )\n}\n\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </svg>\n )\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </svg>\n )\n}\n\nfunction CheckGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\n </svg>\n )\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 13H5v-2h14v2z\" />\n </svg>\n )\n}\n\nconst IndeterminateGlyph = MinusGlyph\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so whatever renders it mirrors it under a right-to-left\n// writing mode — the glyph itself carries no direction of its own, since a\n// transform here would be an inline style.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </svg>\n )\n}\n\nfunction CloseGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n </svg>\n )\n}\n\nfunction PlusGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </svg>\n )\n}\n\nfunction SearchGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </svg>\n )\n}\n\nexport type { GlyphProps }\n\nexport {\n ArrowDownwardGlyph,\n ArrowUpwardGlyph,\n CalendarGlyph,\n CheckGlyph,\n ChevronEndGlyph,\n CloseGlyph,\n IndeterminateGlyph,\n MinusGlyph,\n PlusGlyph,\n SearchGlyph,\n}\n"],"mappings":";;;AAsBA,SAAA,mBAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAGM,KAAA,oBAAA,QAAA,EAAQ,GAAA,iEAAgE,CAAA;EAAG,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EAD7E,KAAA,oBAAA,OAAA;GAAiB,eAAA;GAAY,MAAA;GAAuB,SAAA;GAAW,GAAK;GAClE,UAAA;EACI,CAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;AAIV,SAAA,iBAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,E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AAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;AAIV,SAAA,UAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAGM,KAAA,oBAAA,QAAA,EAAQ,GAAA,sCAAqC,CAAA;EAAG,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EADlD,KAAA,oBAAA,OAAA;GAAiB,eAAA;GAAY,MAAA;GAAuB,SAAA;GAAW,GAAK;GAClE,UAAA;EACI,CAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;AAIV,SAAA,YAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAGM,KAAA,oBAAA,QAAA,EAAQ,GAAA,6MAA4M,CAAA;EAAG,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EADzN,KAAA,oBAAA,OAAA;GAAiB,eAAA;GAAY,MAAA;GAAuB,SAAA;GAAW,GAAK;GAClE,UAAA;EACI,CAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM"}
1
+ {"version":3,"file":"index.js","names":["SVGProps","GlyphProps","Omit","SVGSVGElement","ArrowDownwardGlyph","props","$","_c","t0","Symbol","for","t1","ArrowUpwardGlyph","CalendarGlyph","CheckGlyph","MinusGlyph","IndeterminateGlyph","ChevronEndGlyph","CloseGlyph","PlusGlyph","SearchGlyph"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { SVGProps } from 'react'\n\n// The glyphs the library's own controls draw: the check and the dash a\n// checkbox shows, the plus and minus a number field's steppers show, and\n// the magnifier and cross a search field shows. Inline SVG in\n// `currentColor`, sized by whatever renders them, and private to the\n// library — a call site with icons of its own passes them to IconButton and\n// the slots that take a node, which is why nothing here is exported from\n// the package.\n//\n// The paths are the check, the horizontal rule, the plus, the search, the\n// close, the right chevron, the two sort arrows and the calendar from\n// Material Symbols on their 24-unit grid, which is what the checkbox page\n// draws at 18dp, the icon buttons page at 20 and the search, menus and date\n// picker pages at 24.\n\ntype GlyphProps = Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'>\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending, which is the direction the data tables page puts beside a\n// column header's name. Neither mirrors under a right-to-left writing mode:\n// they say \"up\" and \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\n </svg>\n )\n}\n\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </svg>\n )\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </svg>\n )\n}\n\nfunction CheckGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\n </svg>\n )\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 13H5v-2h14v2z\" />\n </svg>\n )\n}\n\nconst IndeterminateGlyph = MinusGlyph\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so whatever renders it mirrors it under a right-to-left\n// writing mode — the glyph itself carries no direction of its own, since a\n// transform here would be an inline style.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </svg>\n )\n}\n\nfunction CloseGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n </svg>\n )\n}\n\nfunction PlusGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </svg>\n )\n}\n\nfunction SearchGlyph(props: GlyphProps) {\n return (\n <svg aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />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AAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADlDM,KAAA,oBAAA,OAAA;GAAiB,eAAA;GAAY,MAAA;GAAuB,SAAA;GAAW,GAAKN;GAClEG,UAAAA;EACI,CAAA;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFNK;AAEM;AAIV,SAAAS,YAAAf,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAGMF,KAAA,oBAAA,QAAA,EAAQ,GAAA,6MAA4M,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADzNM,KAAA,oBAAA,OAAA;GAAiB,eAAA;GAAY,MAAA;GAAuB,SAAA;GAAW,GAAKN;GAClEG,UAAAA;EACI,CAAA;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFNK;AAEM"}
@@ -1,5 +1,5 @@
1
- import { useEffect, useState } from "react";
2
1
  import { c } from "react/compiler-runtime";
2
+ import { useEffect, useState } from "react";
3
3
  //#region src/hooks/useImageLoadingStatus.ts
4
4
  /**
5
5
  * Whether an image at `src` can be shown yet. It is loaded off-screen first,
@@ -1 +1 @@
1
- {"version":3,"file":"useImageLoadingStatus.js","names":["mounted"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Settled {\n src: string\n status: 'error' | 'loaded'\n}\n\n/**\n * Whether an image at `src` can be shown yet. It is loaded off-screen first,\n * so a component can keep its fallback in place until the picture is ready\n * and bring the fallback back if the picture fails — an `<img>` swapped in\n * as soon as `src` is known would show the browser's broken-image glyph in\n * between.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. What settled is remembered against the `src` it settled for, so a\n * change of `src` reads as loading again rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined): ImageLoadingStatus {\n const [settled, setSettled] = useState<null | Settled>(null)\n\n useEffect(() => {\n if (src === undefined) {\n return undefined\n }\n\n let mounted = true\n const settle = (status: Settled['status']) => () => {\n if (mounted) {\n setSettled({ src, status })\n }\n }\n\n const image = new window.Image()\n image.addEventListener('load', settle('loaded'), { once: true })\n image.addEventListener('error', settle('error'), { once: true })\n image.src = src\n\n return () => {\n mounted = false\n }\n }, [src])\n\n if (src === undefined) {\n return 'error'\n }\n return settled?.src === src ? settled.status : 'loading'\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAA,sBAAA,KAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CACE,MAAA,CAAA,SAAA,cAA8B,SAAyB,IAAI;CAAC,IAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,KAAA;EAElD,WAAA;GACR,IAAI,QAAQ,KAAA,GAAS;GAIrB,IAAA,UAAc;GACd,MAAA,UAAe,iBAA+B;IAC5C,IAAI,SACF,WAAW;KAAA;KAAA;IAAc,CAAC;GAC3B;GAGH,MAAA,QAAc,IAAI,OAAM,MAAO;GAC/B,MAAK,iBAAkB,QAAQ,OAAO,QAAQ,GAAG,EAAA,MAAQ,KAAK,CAAC;GAC/D,MAAK,iBAAkB,SAAS,OAAO,OAAO,GAAG,EAAA,MAAQ,KAAK,CAAC;GAC/D,MAAK,MAAO;GAAH,aAEF;IACL,UAAUA;GAAH;EACR;EACA,KAAA,CAAC,GAAG;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA;EAAA,KAAA,EAAA;EAAA,KAAA,EAAA;CAAA;CApBR,UAAU,IAoBP,EAAK;CAER,IAAI,QAAQ,KAAA,GAAS,OACZ;CACR,OACM,SAAO,QAAU,MAAM,QAAO,SAA9B;AAAiD"}
1
+ {"version":3,"file":"useImageLoadingStatus.js","names":["useEffect","useState","ImageLoadingStatus","Settled","src","status","useImageLoadingStatus","$","_c","settled","setSettled","t0","t1","undefined","mounted","settle","image","window","Image","addEventListener","once"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Settled {\n src: string\n status: 'error' | 'loaded'\n}\n\n/**\n * Whether an image at `src` can be shown yet. It is loaded off-screen first,\n * so a component can keep its fallback in place until the picture is ready\n * and bring the fallback back if the picture fails — an `<img>` swapped in\n * as soon as `src` is known would show the browser's broken-image glyph in\n * between.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. What settled is remembered against the `src` it settled for, so a\n * change of `src` reads as loading again rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined): ImageLoadingStatus {\n const [settled, setSettled] = useState<null | Settled>(null)\n\n useEffect(() => {\n if (src === undefined) {\n return undefined\n }\n\n let mounted = true\n const settle = (status: Settled['status']) => () => {\n if (mounted) {\n setSettled({ src, status })\n }\n }\n\n const image = new window.Image()\n image.addEventListener('load', settle('loaded'), { once: true })\n image.addEventListener('error', settle('error'), { once: true })\n image.src = src\n\n return () => {\n mounted = false\n }\n }, [src])\n\n if (src === undefined) {\n return 'error'\n }\n return settled?.src === src ? settled.status : 'loading'\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAAM,sBAAAF,KAAA;CAAA,MAAAG,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,SAAAC,cAA8BT,SAAyB,IAAI;CAAC,IAAAU;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAH,KAAA;EAElDO,WAAA;GACR,IAAIP,QAAQS,KAAAA,GAAS;GAIrB,IAAAC,UAAc;GACd,MAAAC,UAAeV,iBAA+B;IAC5C,IAAIS,SACFJ,WAAW;KAAAN;KAAAC;IAAc,CAAC;GAC3B;GAGH,MAAAW,QAAc,IAAIC,OAAMC,MAAO;GAC/BF,MAAKG,iBAAkB,QAAQJ,OAAO,QAAQ,GAAG,EAAAK,MAAQ,KAAK,CAAC;GAC/DJ,MAAKG,iBAAkB,SAASJ,OAAO,OAAO,GAAG,EAAAK,MAAQ,KAAK,CAAC;GAC/DJ,MAAKZ,MAAOA;GAAH,aAEF;IACLU,UAAUA;GAAH;EACR;EACAF,KAAA,CAACR,GAAG;EAACG,EAAA,KAAAH;EAAAG,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CApBRP,UAAUW,IAoBPC,EAAK;CAER,IAAIR,QAAQS,KAAAA,GAAS,OACZ;CACR,OACMJ,SAAOL,QAAUA,MAAMK,QAAOJ,SAA9B;AAAiD"}
@@ -1,9 +1,9 @@
1
1
  import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
2
  import { rippleStyles as styles } from "../styles/ripple.js";
3
3
  import { motionDurationMs, motionEasing, spacingPx } from "../tokens/values.js";
4
+ import { c } from "react/compiler-runtime";
4
5
  import { useRef, useState } from "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
- import { c } from "react/compiler-runtime";
7
7
  //#region src/hooks/useRipple.tsx
8
8
  /** How far the ripple grows past the host's corners. `spacing.sm`. */
9
9
  const PADDING = spacingPx.sm;
@@ -1 +1 @@
1
- {"version":3,"file":"useRipple.js","names":["rect","width","size","height","positionEvent","startPoint","endPoint","event","target","rippleRef","resolve"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * `handlers` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n if (startEvent && startEvent.pointerId !== event.pointerId) {\n return false;\n }\n return isTouch(event) || event.buttons === 1;\n }, []);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: HostElement, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // target's rect, and a second `getBoundingClientRect()` call back to\n // back with the first would be a redundant layout read.\n const rect = target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n duration: motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n return;\n }\n if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n }, [shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => ({\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }), [onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n surface\n }), [handlers, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n surface: null\n }), [externalHandlers]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAM,UAAU,UAAU;AAI1B,MAAM,uBAAuB;AAC7B,MAAM,yBAAyB;AAC/B,MAAM,4BAA4B;AAIlC,MAAM,eAAe,MAAa,OAAa,OAAO;;;;;;;;AAStD,MAAM,cAAc;;CAElB,SAAS;;CAET,UAAU;;CAEV,YAAY;;CAEZ,iBAAiB;AACnB;AAUA,SAAS,QAAQ,OAAqB;CACpC,OAAO,MAAM,gBAAgB;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAA,UAAA,IAAA,IAAA;CAAA,MAAA,IAAA,EAAA,EAAA;CAA0D,MAAA,UAAA,OAAA,KAAA,IAAA,OAAA;CAAc,IAAA;CAAA,IAAA,EAAA,OAAA,IAAA;EAAE,KAAA,OAAA,KAAA,IAAA,CAAsD,IAAtD;EAAuD,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAvD,MAAA,mBAAA;CAIxE,MAAA,CAAA,SAAA,cAA8B,SAAS,KAAK;CAC5C,MAAA,YAAkB,OAAwB,IAAI;CAC9C,MAAA,QAAc,OAAoB,YAAW,QAAS;CACtD,MAAA,gBAAsB,OAA8B,KAAA,CAAS;CAC7D,MAAA,mBAAyB,OAA8C,KAAA,C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A,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAPD,MAAA,WAAgC;CAO2D,IAAA;CAAA,IAAA,EAAA,QAAA,SAAA;EAE3D,MAAA,MAAa,OAAY,OAAQ,WAAW,OAAY,OAAQ;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,KAAA;EADnE,MAAA,oBAAA,QAAA;GAAkB,eAAA;GAAM,GAAK;GACrD,UAAA,oBAAA,QAAA;IAAWE,KAAA;IAAS,GAAM;GAAiE,CAAA;EACtF,CAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAFX,MAAA,UAA8B;CAEN,IAAA;CAAA,IAAA,EAAA,QAAA,YAAA,EAAA,QAAA,SAAA;EAOa,MAAA;GAAA;GAAA;EAGrC;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAHD,MAAA,gBAAqC;CAGZ,IAAA;CAAA,IAAA,EAAA,QAAA,kBAAA;EACa,MAAA;GAAA,UAC1B;GAAgB,SACjB;EACX;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAAuB,OACjB,UAAA,gBAAA;AAAwC;AAxPjD,SAAA,MAAA,WAAA;CAwIM,WAAWC,WAAS,iBAAgB,MAAO;AAAC"}
1
+ {"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","RippleEventHandlers","Element","onClick","HostElement","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","useRipple","t0","t1","$","_c","enabled","undefined","t2","externalHandlers","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","t3","Symbol","for","isPrimary","startEvent","current","pointerId","buttons","shouldReactToEvent","t4","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t5","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t6","target","positionEvent_0","ripple","cancel","rect_1","getBoundingClientRect","size_1","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t7","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t8","getState","t9","event_0","target_0","currentTarget","_temp","handlePointerDownAsync","t10","event_1","handlePointerDown","t11","event_2","handlePointerUp","t12","event_3","handlePointerLeave","t13","event_4","handlePointerCancel","t14","event_5","handleClick","t15","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t16","event_6","t17","event_7","t18","event_8","t19","event_9","t20","event_10","t21","event_11","t22","handlers","t23","press","t24","t25","enabledResult","t26","disabledResult","resolve_0","short2"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * `handlers` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n if (startEvent && startEvent.pointerId !== event.pointerId) {\n return false;\n }\n return isTouch(event) || event.buttons === 1;\n }, []);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: HostElement, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // target's rect, and a second `getBoundingClientRect()` call back to\n // back with the first would be a redundant layout read.\n const rect = target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n duration: motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n return;\n }\n if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n }, [shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => ({\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }), [onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n surface\n }), [handlers, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n surface: null\n }), [externalHandlers]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMc,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAIlC,MAAMC,eAAed,MAAaK,OAAaW,OAAO;;;;;;;;AAStD,MAAMC,cAAc;;CAElBC,SAAS;;CAETC,UAAU;;CAEVC,YAAY;;CAEZC,iBAAiB;AACnB;AAUA,SAASW,QAAQC,OAAqB;CACpC,OAAOA,MAAMC,gBAAgB;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAAC,UAAAC,IAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA0D,MAAAC,UAAAJ,OAAAK,KAAAA,IAAA,OAAAL;CAAc,IAAAM;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAEK,KAAAL,OAAAI,KAAAA,IAAA,CAAsD,IAAtDJ;EAAuDC,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAvD,MAAAK,mBAAAD;CAIxE,MAAA,CAAAE,SAAAC,cAA8BzC,SAAS,KAAK;CAC5C,MAAA0C,YAAkB3C,OAAwB,IAAI;CAC9C,MAAA4C,QAAc5C,OAAoBc,YAAWE,QAAS;CACtD,MAAA6B,gBAAsB7C,OAA8BsC,KAAAA,CAAS;CAC7D,MAAAQ,mBAAyB9C,OAA8CsC,KAAAA,CAAS;CAChF,MAAAS,cAAoB/C,OAAO,CAAC;CAC5B,MAAAgD,cAAoBhD,OAAO,GAAG;CAAE,IAAAiD;CAAA,IAAAd,EAAA,OAAAe,OAAAC,IAAA,2BAAA,GAAA;EACO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AAA/H,EAAA,MAAA+H;EAAA/H,EAAA,MAAAiI;CAAA,OAAAA,MAAAjI,EAAA;CAFX,MAAAtB,UAA8BuJ;CAEN,IAAAC;CAAA,IAAAlI,EAAA,QAAA8H,YAAA9H,EAAA,QAAAtB,SAAA;EAOawJ,MAAA;GAAAJ;GAAApJ;EAGrC;EAACsB,EAAA,MAAA8H;EAAA9H,EAAA,MAAAtB;EAAAsB,EAAA,MAAAkI;CAAA,OAAAA,MAAAlI,EAAA;CAHD,MAAAmI,gBAAqCD;CAGZ,IAAAE;CAAA,IAAApI,EAAA,QAAAK,kBAAA;EACa+H,MAAA;GAAAN,UAC1BzH;GAAgB3B,SACjB;EACX;EAACsB,EAAA,MAAAK;EAAAL,EAAA,MAAAoI;CAAA,OAAAA,MAAApI,EAAA;CAAuB,OACjBE,UAAAiI,gBAAAE;AAAwC;AAxPjD,SAAA7C,MAAA8C,WAAA;CAwIMtD,WAAWD,WAAS/G,iBAAgBuK,MAAO;AAAC"}
@@ -1,7 +1,7 @@
1
1
  import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
2
  import { indicatorStyles } from "./styles.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { c } from "react/compiler-runtime";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Label } from "react-aria-components";
6
6
  //#region src/indicator/index.tsx
7
7
  const ACTIVE_TONES = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["label","value","children"],"sources":["../../src/indicator/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Label } from 'react-aria-components';\nimport type { IndicatorTone } from './styles';\nimport { indicatorStyles } from './styles';\n\n// The two pieces a linear indicator is drawn from, shared by\n// ProgressIndicator and Meter. The styles they use are in ./styles.ts.\n\n// What each tone draws the active indicator and the stop indicator in.\n// `primary` is the style they already carry, so it adds nothing.\nconst ACTIVE_TONES = {\n inherit: indicatorStyles.inheritActive,\n negative: indicatorStyles.negativeActive,\n positive: indicatorStyles.positiveActive,\n primary: null\n} as const;\n\n/**\n * The label and, optionally, the value, on a line above the indicator.\n * React Aria's `Label` reads the surrounding context, so the same element\n * names a progress bar and a meter alike. Renders nothing when there is\n * neither to show.\n */\nexport function IndicatorLabels({\n label,\n value\n}: {\n label: ReactNode;\n value: ReactNode;\n}) {\n if (label === undefined && value === undefined) {\n return null;\n }\n return <div {...stylex.props(indicatorStyles.labels)}>\n {label === undefined ? null : <Label {...stylex.props(indicatorStyles.label)}>{label}</Label>}\n {value === undefined ? null : <span {...stylex.props(indicatorStyles.label)}>{value}</span>}\n </div>;\n}\n\n/**\n * The page's line: the active indicator at its share of the width, the track\n * taking what is left, and the stop indicator at the end. Anything passed as\n * `children` is drawn inside the track, which is what the progress\n * indicator's buffer fills it with; with none the track is solid.\n */\nexport function IndicatorLine({\n children,\n percentage,\n tone\n}: {\n children?: ReactNode;\n percentage: number;\n tone: IndicatorTone;\n}) {\n const active = ACTIVE_TONES[tone];\n const solid = children === undefined;\n return <div {...stylex.props(indicatorStyles.line)}>\n <span {...stylex.props(indicatorStyles.active, indicatorStyles.activeAt(percentage), active)} />\n <span {...stylex.props(indicatorStyles.track, solid && indicatorStyles.trackSolid, solid && tone === 'inherit' && indicatorStyles.inheritTrack)}>\n {children}\n </span>\n <span {...stylex.props(indicatorStyles.stop, active)} />\n </div>;\n}"],"mappings":";;;;;;AAWA,MAAM,eAAe;CACnB,SAAS,gBAAgB;CACzB,UAAU,gBAAgB;CAC1B,UAAU,gBAAgB;CAC1B,SAAS;AACX;;;;;;;AAQA,SAAO,gBAAA,IAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAyB,MAAA,EAAA,OAAA,UAAA;CAO9B,IAAI,UAAU,KAAA,KAAa,UAAU,KAAA,GAAS,OACrC;CACR,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EACe,KAAA,MAAa,gBAAe,MAAO;EAAC,EAAA,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AA,EAAgG,GAAtF,GAAkF,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,MAAA;EACtF,KAAA,MAAa,gBAAe,OAAQ,SAAS,gBAAe,YAAa,SAAS,SAAS,aAAa,gBAAe,YAAa;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,YAAA,EAAA,QAAA,IAAA;EAA/I,KAAA,oBAAA,QAAA;GAEO,GAFG;GACP;EACI,CAAA;EAAA,EAAA,KAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,QAAA;EACG,KAAA,MAAa,gBAAe,MAAO,MAAM;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,IAAA;EAApD,KAAA,oBAAA,QAAA,EAAwD,GAA9C,GAA0C,CAAA;EAAI,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,MAAA,EAAA,QAAA,MAAA,EAAA,QAAA,IAAA;EALrD,KAAA,qBAAA,OAAA;GAMC,GANQ;GAAT,UAAA;IACH;IACA;IAGA;GACI;;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAND;AAMC"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","stylex","Label","IndicatorTone","indicatorStyles","ACTIVE_TONES","inherit","inheritActive","negative","negativeActive","positive","positiveActive","primary","const","IndicatorLabels","t0","$","_c","label","value","undefined","t1","Symbol","for","props","labels","t2","t3","t4","IndicatorLine","children","percentage","tone","active","solid","line","activeAt","track","trackSolid","inheritTrack","t5","t6","stop","t7","t8"],"sources":["../../src/indicator/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Label } from 'react-aria-components';\nimport type { IndicatorTone } from './styles';\nimport { indicatorStyles } from './styles';\n\n// The two pieces a linear indicator is drawn from, shared by\n// ProgressIndicator and Meter. The styles they use are in ./styles.ts.\n\n// What each tone draws the active indicator and the stop indicator in.\n// `primary` is the style they already carry, so it adds nothing.\nconst ACTIVE_TONES = {\n inherit: indicatorStyles.inheritActive,\n negative: indicatorStyles.negativeActive,\n positive: indicatorStyles.positiveActive,\n primary: null\n} as const;\n\n/**\n * The label and, optionally, the value, on a line above the indicator.\n * React Aria's `Label` reads the surrounding context, so the same element\n * names a progress bar and a meter alike. Renders nothing when there is\n * neither to show.\n */\nexport function IndicatorLabels({\n label,\n value\n}: {\n label: ReactNode;\n value: ReactNode;\n}) {\n if (label === undefined && value === undefined) {\n return null;\n }\n return <div {...stylex.props(indicatorStyles.labels)}>\n {label === undefined ? null : <Label {...stylex.props(indicatorStyles.label)}>{label}</Label>}\n {value === undefined ? null : <span {...stylex.props(indicatorStyles.label)}>{value}</span>}\n </div>;\n}\n\n/**\n * The page's line: the active indicator at its share of the width, the track\n * taking what is left, and the stop indicator at the end. Anything passed as\n * `children` is drawn inside the track, which is what the progress\n * indicator's buffer fills it with; with none the track is solid.\n */\nexport function IndicatorLine({\n children,\n percentage,\n tone\n}: {\n children?: ReactNode;\n percentage: number;\n tone: IndicatorTone;\n}) {\n const active = ACTIVE_TONES[tone];\n const solid = children === undefined;\n return <div {...stylex.props(indicatorStyles.line)}>\n <span {...stylex.props(indicatorStyles.active, indicatorStyles.activeAt(percentage), active)} />\n <span {...stylex.props(indicatorStyles.track, solid && indicatorStyles.trackSolid, solid && tone === 'inherit' && indicatorStyles.inheritTrack)}>\n {children}\n </span>\n <span {...stylex.props(indicatorSty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