@kanso-labs/kanso-ui 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.md +90 -9
  2. package/dist/button/context.js +7 -0
  3. package/dist/button/context.js.map +1 -0
  4. package/dist/button/group.js +25 -0
  5. package/dist/button/group.js.map +1 -0
  6. package/dist/button/hooks.js +81 -0
  7. package/dist/button/hooks.js.map +1 -0
  8. package/dist/button/index.d.ts +11 -0
  9. package/dist/button/index.js +273 -0
  10. package/dist/button/index.js.map +1 -0
  11. package/dist/button/styles.js +23 -0
  12. package/dist/button/styles.js.map +1 -0
  13. package/dist/calendar/index.js +473 -7
  14. package/dist/calendar/index.js.map +1 -1
  15. package/dist/calendar/styles.js +132 -4
  16. package/dist/calendar/styles.js.map +1 -1
  17. package/dist/chip/index.js +74 -9
  18. package/dist/chip/index.js.map +1 -1
  19. package/dist/chip/styles.js +78 -4
  20. package/dist/chip/styles.js.map +1 -1
  21. package/dist/collection/index.js +12 -9
  22. package/dist/collection/index.js.map +1 -1
  23. package/dist/collection/styles.js +21 -2
  24. package/dist/collection/styles.js.map +1 -1
  25. package/dist/color-scheme.d.ts +29 -0
  26. package/dist/color-scheme.js +32 -0
  27. package/dist/color-scheme.js.map +1 -0
  28. package/dist/components/avatar/index.js +35 -22
  29. package/dist/components/avatar/index.js.map +1 -1
  30. package/dist/components/badge/index.d.ts +40 -0
  31. package/dist/components/badge/index.js +102 -0
  32. package/dist/components/badge/index.js.map +1 -0
  33. package/dist/components/breadcrumbs/index.d.ts +1 -1
  34. package/dist/components/breadcrumbs/index.js +1 -1
  35. package/dist/components/breadcrumbs/index.js.map +1 -1
  36. package/dist/components/button/index.d.ts +58 -14
  37. package/dist/components/button/index.js +400 -147
  38. package/dist/components/button/index.js.map +1 -1
  39. package/dist/components/button-group/index.d.ts +54 -0
  40. package/dist/components/button-group/index.js +272 -0
  41. package/dist/components/button-group/index.js.map +1 -0
  42. package/dist/components/calendar/index.d.ts +9 -1
  43. package/dist/components/calendar/index.js +71 -44
  44. package/dist/components/calendar/index.js.map +1 -1
  45. package/dist/components/card/index.d.ts +1 -1
  46. package/dist/components/card/index.js +4 -4
  47. package/dist/components/card/index.js.map +1 -1
  48. package/dist/components/checkbox/index.js +15 -1
  49. package/dist/components/checkbox/index.js.map +1 -1
  50. package/dist/components/checkbox-group/index.js +1 -0
  51. package/dist/components/checkbox-group/index.js.map +1 -1
  52. package/dist/components/chip/index.d.ts +55 -8
  53. package/dist/components/chip/index.js +174 -63
  54. package/dist/components/chip/index.js.map +1 -1
  55. package/dist/components/chip-group/index.d.ts +16 -7
  56. package/dist/components/chip-group/index.js +58 -35
  57. package/dist/components/chip-group/index.js.map +1 -1
  58. package/dist/components/color-field/index.js +25 -23
  59. package/dist/components/color-field/index.js.map +1 -1
  60. package/dist/components/color-picker/index.js +42 -31
  61. package/dist/components/color-picker/index.js.map +1 -1
  62. package/dist/components/color-swatch-picker/index.d.ts +1 -1
  63. package/dist/components/color-swatch-picker/index.js +17 -13
  64. package/dist/components/color-swatch-picker/index.js.map +1 -1
  65. package/dist/components/combo-box/index.d.ts +5 -3
  66. package/dist/components/combo-box/index.js +63 -58
  67. package/dist/components/combo-box/index.js.map +1 -1
  68. package/dist/components/copy-field/index.d.ts +7 -6
  69. package/dist/components/copy-field/index.js +92 -90
  70. package/dist/components/copy-field/index.js.map +1 -1
  71. package/dist/components/currency/index.d.ts +8 -7
  72. package/dist/components/currency/index.js +43 -65
  73. package/dist/components/currency/index.js.map +1 -1
  74. package/dist/components/date-field/index.js +24 -22
  75. package/dist/components/date-field/index.js.map +1 -1
  76. package/dist/components/date-picker/index.d.ts +10 -2
  77. package/dist/components/date-picker/index.js +76 -69
  78. package/dist/components/date-picker/index.js.map +1 -1
  79. package/dist/components/date-range-picker/index.d.ts +10 -2
  80. package/dist/components/date-range-picker/index.js +93 -86
  81. package/dist/components/date-range-picker/index.js.map +1 -1
  82. package/dist/components/dialog/index.d.ts +1 -1
  83. package/dist/components/dialog/index.js +2 -2
  84. package/dist/components/dialog/index.js.map +1 -1
  85. package/dist/components/disclosure/index.d.ts +1 -1
  86. package/dist/components/disclosure/index.js +6 -6
  87. package/dist/components/disclosure/index.js.map +1 -1
  88. package/dist/components/fab/index.d.ts +72 -0
  89. package/dist/components/fab/index.js +89 -0
  90. package/dist/components/fab/index.js.map +1 -0
  91. package/dist/components/fab-menu/index.d.ts +90 -0
  92. package/dist/components/fab-menu/index.js +297 -0
  93. package/dist/components/fab-menu/index.js.map +1 -0
  94. package/dist/components/feed/index.d.ts +2 -1
  95. package/dist/components/feed/index.js +1 -1
  96. package/dist/components/feed/index.js.map +1 -1
  97. package/dist/components/icon-button/index.d.ts +11 -8
  98. package/dist/components/icon-button/index.js +244 -181
  99. package/dist/components/icon-button/index.js.map +1 -1
  100. package/dist/components/index.d.ts +30 -21
  101. package/dist/components/list/index.d.ts +15 -13
  102. package/dist/components/list/index.js +60 -61
  103. package/dist/components/list/index.js.map +1 -1
  104. package/dist/components/list-box/index.d.ts +3 -2
  105. package/dist/components/list-box/index.js +16 -16
  106. package/dist/components/list-box/index.js.map +1 -1
  107. package/dist/components/list-item/index.js +1 -1
  108. package/dist/components/list-item/index.js.map +1 -1
  109. package/dist/components/menu/index.d.ts +3 -2
  110. package/dist/components/menu/index.js +2 -2
  111. package/dist/components/menu/index.js.map +1 -1
  112. package/dist/components/navigation-bar/index.d.ts +50 -0
  113. package/dist/components/navigation-bar/index.js +129 -0
  114. package/dist/components/navigation-bar/index.js.map +1 -0
  115. package/dist/components/navigation-rail/index.d.ts +59 -0
  116. package/dist/components/navigation-rail/index.js +166 -0
  117. package/dist/components/navigation-rail/index.js.map +1 -0
  118. package/dist/components/navigation-tree/index.d.ts +1 -5
  119. package/dist/components/navigation-tree/index.js +3 -3
  120. package/dist/components/navigation-tree/index.js.map +1 -1
  121. package/dist/components/number-field/index.d.ts +6 -4
  122. package/dist/components/number-field/index.js +84 -84
  123. package/dist/components/number-field/index.js.map +1 -1
  124. package/dist/components/popover/index.d.ts +1 -1
  125. package/dist/components/popover/index.js +1 -1
  126. package/dist/components/popover/index.js.map +1 -1
  127. package/dist/components/radio-group/index.js +22 -11
  128. package/dist/components/radio-group/index.js.map +1 -1
  129. package/dist/components/range-calendar/index.d.ts +7 -1
  130. package/dist/components/range-calendar/index.js +71 -44
  131. package/dist/components/range-calendar/index.js.map +1 -1
  132. package/dist/components/search-field/index.d.ts +2 -1
  133. package/dist/components/search-field/index.js +24 -25
  134. package/dist/components/search-field/index.js.map +1 -1
  135. package/dist/components/search-view/index.d.ts +79 -0
  136. package/dist/components/search-view/index.js +255 -0
  137. package/dist/components/search-view/index.js.map +1 -0
  138. package/dist/components/segmented-button/index.d.ts +2 -2
  139. package/dist/components/segmented-button/index.js +60 -31
  140. package/dist/components/segmented-button/index.js.map +1 -1
  141. package/dist/components/select/index.js +1 -0
  142. package/dist/components/select/index.js.map +1 -1
  143. package/dist/components/sheet/index.d.ts +1 -1
  144. package/dist/components/sheet/index.js +2 -2
  145. package/dist/components/sheet/index.js.map +1 -1
  146. package/dist/components/slider/index.js +1 -1
  147. package/dist/components/slider/index.js.map +1 -1
  148. package/dist/components/snackbar/index.d.ts +2 -2
  149. package/dist/components/snackbar/index.js +28 -13
  150. package/dist/components/snackbar/index.js.map +1 -1
  151. package/dist/components/split-button/index.d.ts +83 -0
  152. package/dist/components/split-button/index.js +341 -0
  153. package/dist/components/split-button/index.js.map +1 -0
  154. package/dist/components/switch/index.js +11 -1
  155. package/dist/components/switch/index.js.map +1 -1
  156. package/dist/components/table/index.d.ts +11 -9
  157. package/dist/components/table/index.js +87 -31
  158. package/dist/components/table/index.js.map +1 -1
  159. package/dist/components/tabs/index.d.ts +35 -4
  160. package/dist/components/tabs/index.js +403 -93
  161. package/dist/components/tabs/index.js.map +1 -1
  162. package/dist/components/tag/index.d.ts +1 -1
  163. package/dist/components/tag/index.js.map +1 -1
  164. package/dist/components/text-area/index.d.ts +7 -5
  165. package/dist/components/text-area/index.js +28 -26
  166. package/dist/components/text-area/index.js.map +1 -1
  167. package/dist/components/text-field/index.d.ts +7 -5
  168. package/dist/components/text-field/index.js +28 -26
  169. package/dist/components/text-field/index.js.map +1 -1
  170. package/dist/components/time-field/index.js +24 -22
  171. package/dist/components/time-field/index.js.map +1 -1
  172. package/dist/components/tree/index.d.ts +7 -9
  173. package/dist/components/tree/index.js +15 -16
  174. package/dist/components/tree/index.js.map +1 -1
  175. package/dist/drag/index.js.map +1 -1
  176. package/dist/drag/styles.js +4 -1
  177. package/dist/drag/styles.js.map +1 -1
  178. package/dist/fab/styles.js +161 -0
  179. package/dist/fab/styles.js.map +1 -0
  180. package/dist/field/index.js +260 -214
  181. package/dist/field/index.js.map +1 -1
  182. package/dist/field/styles.js +10 -2
  183. package/dist/field/styles.js.map +1 -1
  184. package/dist/glyphs/index.js +55 -1
  185. package/dist/glyphs/index.js.map +1 -1
  186. package/dist/hooks/useRipple.js +199 -162
  187. package/dist/hooks/useRipple.js.map +1 -1
  188. package/dist/hooks/useToggleGroupDisabled.js +24 -0
  189. package/dist/hooks/useToggleGroupDisabled.js.map +1 -0
  190. package/dist/i18n/index.js +43 -0
  191. package/dist/i18n/index.js.map +1 -0
  192. package/dist/i18n/messages.js +387 -0
  193. package/dist/i18n/messages.js.map +1 -0
  194. package/dist/index.d.ts +31 -21
  195. package/dist/index.js +25 -16
  196. package/dist/navigation/context.js +7 -0
  197. package/dist/navigation/context.js.map +1 -0
  198. package/dist/navigation/index.d.ts +28 -0
  199. package/dist/navigation/index.js +96 -0
  200. package/dist/navigation/index.js.map +1 -0
  201. package/dist/navigation/styles.js +312 -0
  202. package/dist/navigation/styles.js.map +1 -0
  203. package/dist/react-aria.d.ts +2 -2
  204. package/dist/react-aria.js +2 -2
  205. package/dist/render/useRender.js +0 -1
  206. package/dist/render/useRender.js.map +1 -1
  207. package/dist/row/styles.js +33 -11
  208. package/dist/row/styles.js.map +1 -1
  209. package/dist/styles/focus.js.map +1 -1
  210. package/dist/styles/icon-button.js +9 -1
  211. package/dist/styles/icon-button.js.map +1 -1
  212. package/dist/styles/overlay.js +1 -0
  213. package/dist/styles/overlay.js.map +1 -1
  214. package/dist/styles/picker.js +1 -1
  215. package/dist/styles/picker.js.map +1 -1
  216. package/dist/styles.css +1104 -336
  217. package/dist/tokens/design.tokens.stylex.js +42 -1
  218. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  219. package/dist/tokens.css +166 -53
  220. package/package.json +9 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","Key","TabsProps","RACTabsProps","TabListProps","TabPanelProps","TabPanelsProps","TabProps","TabRenderProps","stylex","createContext","useCallback","useContext","useEffect","useState","SelectionIndicator","RACSelectionIndicator","TabPanels","RACTabPanels","Tabs","RACTabs","Tab","TabList","TabPanel","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","sizing","spacing","stateLayerOpacity","typography","styles","panel","kB7OPa","$$css","NO_PANELS","ReadonlySet","Set","PanelsContext","RegisterPanelContext","id","Omit","children","tabContent","state","defaultChildren","tabRenderer","hasPanel","render","NonNullable","domProps","adjusted","undefined","t0","$","props","panels","setPanels","t1","Symbol","for","previous","has","next","add","previous_0","next_0","delete","register","t2","t3","TabsList","className","TabsPanel","ring","TabsPanels","TabsTab","T0","tabStyles","t4","isSelected","isDisabled","List","Panel","Panels","TabsListProps","TabsPanelProps","TabsPanelsProps","TabsTabProps","RACSelectionIndicator","Tabs","_c","RACTabs","props","stylex.props","RACTabPanels"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { Key, TabsProps as RACTabsProps, TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useState } from 'react';\nimport { SelectionIndicator as RACSelectionIndicator, TabPanels as RACTabPanels, Tabs as RACTabs, Tab, TabList, TabPanel } from 'react-aria-components';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The tabs page's primary tabs: a 48dp bar on the surface, divided into equal\n// sections, with a 1dp outline-variant divider inside the bar along its\n// bottom edge and, under the active tab's label, a 3dp primary indicator\n// rounded along its top. The indicator follows the label rather than the\n// tab, inset 2dp from the label's ends and never shorter than 24dp, which is\n// what the page draws.\n//\n// The indicator is React Aria's `SelectionIndicator`, which is a shared\n// element: it is rendered inside every tab but drawn in the selected one,\n// and on a change it keeps the old one until it has finished moving to the\n// new one's place. No `SharedElementTransition` is rendered here — `Tab`\n// scopes its own, and one added around the list changes nothing, which is\n// worth knowing because the primitive throws outside a scope when it is put\n// anywhere else.\n//\n// The label is wrapped in a span of its own so the indicator has the label's\n// width to follow: it is the span's `::after`, and the span is as tall as the\n// tab so the indicator reaches the bottom of the bar. Which tab carries it\n// comes from React Aria's render state rather than a selector, since StyleX\n// cannot target [data-selected] on the element it is styling.\nconst styles = {\n panel: {\n kB7OPa: \"x9f619\",\n $$css: true\n }\n};\nconst NO_PANELS: ReadonlySet<Key> = new Set();\n\n// Which panels are mounted, by id. React Aria points a selected tab's\n// `aria-controls` at the panel it would control whether or not one exists,\n// and a strip used on its own — tabs that filter the content below rather\n// than swapping a panel — then references an id nothing carries, which axe\n// reports as an invalid attribute value. Each panel registers itself here so\n// a tab can leave the attribute off when its panel is not there.\nconst PanelsContext = createContext<ReadonlySet<Key>>(NO_PANELS);\nconst RegisterPanelContext = createContext<(id: Key) => () => void>(() => () => {});\n\n// `children` is narrowed to nodes. React Aria also accepts a function there,\n// to hand the children the tabs' render state, and that form cannot be\n// wrapped in a context provider without calling it first — which would be\n// doing React Aria's job with none of its state. Nothing here needs it, so\n// the narrower type says so rather than leaving a signature that type-checks\n// and then fails to render.\ntype TabsProps = Omit<RACTabsProps, 'children'> & {\n children?: ReactNode;\n};\n\n// The label, wrapped so the indicator has its width to follow. Built by a\n// call for the same reason as `tabRenderer` below; React Aria hands the\n// function the tab's state, and it is passed on when the children are a\n// function too.\nfunction tabContent(children: TabProps['children']) {\n return (state: TabRenderProps & {\n defaultChildren: ReactNode;\n }) => <span className=\"x6s0dn4 x5yr21d x9f619 x3nfvp2 x1n2onr6\">\n {typeof children === 'function' ? children(state) : children}\n <RACSelectionIndicator className=\"x12w9bfk xnety89 xuoj239 x1pixlao xyooppx x9f619 x17v02zk x1ey2m1c x17y0mx6 xvueqy4 xnei2rj x10l6tqk xioksi3 x1mxbss1 x1seskgd\" />\n </span>;\n}\n\n// React Aria renders a tab with `href` as an anchor and any other as a div,\n// and expects a `render` function to return the same element it would have.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its two inputs. See PanelsContext for why the attribute is\n// dropped.\nfunction tabRenderer(hasPanel: boolean, render: TabProps['render']): NonNullable<TabProps['render']> {\n return (domProps, state) => {\n const adjusted = hasPanel ? domProps : {\n ...domProps,\n 'aria-controls': undefined\n };\n if (render !== undefined) {\n return render(adjusted, state);\n }\n if ('href' in adjusted) {\n // oxlint-disable-next-line jsx-a11y/anchor-has-content -- filled by React Aria\n return <a {...adjusted} />;\n }\n return <div {...adjusted} />;\n };\n}\n\n/**\n * A tab bar and its panels. Selection is React Aria's `selectedKey`: pass\n * it with `onSelectionChange` to control it, or `defaultSelectedKey` to let\n * it keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it controls through\n * a shared `id`, and a strip may stand alone without panels.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs({\n children,\n ...props\n}: RefAttributes<HTMLDivElement> & TabsProps) {\n const [panels, setPanels] = useState<ReadonlySet<Key>>(NO_PANELS);\n const register = useCallback((id: Key) => {\n setPanels(previous => {\n if (previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.add(id);\n return next;\n });\n return () => {\n setPanels(previous => {\n if (!previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.delete(id);\n return next;\n });\n };\n }, []);\n return <RACTabs {...props}>\n <RegisterPanelContext value={register}>\n <PanelsContext value={panels}>{children}</PanelsContext>\n </RegisterPanelContext>\n </RACTabs>;\n}\nfunction TabsList(props: TabsListProps) {\n return <TabList {...props} {...mergeStatefulStyles({\n className: \"xp05xdj x9f619 x78zum5\"\n }, props)} />;\n}\nfunction TabsPanel(props: TabsPanelProps) {\n const register = useContext(RegisterPanelContext);\n const {\n id\n } = props;\n useEffect(() => {\n if (id === undefined) {\n return undefined;\n }\n return register(id);\n }, [id, register]);\n return <TabPanel {...props} {...mergeStatefulStyles(stylex.props(styles.panel, focus.ring), props)} />;\n}\n\n/**\n * An optional box around the panels, which animates its height as one panel\n * gives way to the next. Without it the panels still work; the box around\n * them simply jumps from one height to the other.\n */\nfunction TabsPanels(props: TabsPanelsProps) {\n return <RACTabPanels {...props} {...mergeStyles({\n className: \"x12w9bfk x1t2j4n3 x9f619 xb3r6kr xioksi3 x1f55p5c x1seskgd\"\n }, props)} />;\n}\nfunction TabsTab({\n children,\n render,\n ...props\n}: TabsTabProps) {\n const panels = useContext(PanelsContext);\n const hasPanel = props.id !== undefined && panels.has(props.id);\n return <Tab {...props} render={tabRenderer(hasPanel, render)} {...mergeStatefulStyles(tabStyles, props)}>\n {tabContent(children)}\n </Tab>;\n}\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active tab cannot be chosen in CSS. React Aria's answer is a className that\n// is a function of the tab's own state, the same mechanism Chip uses —\n// mergeStatefulStyles wraps this one so a tab still keeps a className the call\n// site passed.\nfunction tabStyles(state: TabRenderProps) {\n return {\n 0: {\n className: \"x12w9bfk x6s0dn4 xbg5kjn xc342km x9f619 x1ypdohk x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 x12vej0r x1p2om7n xjbqb8w x1w5n3ug\"\n },\n 2: {\n className: \"x12w9bfk x6s0dn4 xbg5kjn xc342km x9f619 x1ypdohk x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 x12vej0r x14dcer4 xjbqb8w x1mxwv8y\"\n },\n 1: {\n className: \"x12w9bfk x6s0dn4 xbg5kjn xc342km x9f619 x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n },\n 3: {\n className: \"x12w9bfk x6s0dn4 xbg5kjn xc342km x9f619 x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n }\n }[!!state.isSelected << 1 | !!state.isDisabled << 0];\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Panels = TabsPanels;\nTabs.Tab = TabsTab;\ntype TabsListProps = TabListProps<object>;\ntype TabsPanelProps = TabPanelProps;\ntype TabsPanelsProps = Omit<TabPanelsProps<object>, 'children'> & {\n children?: ReactNode;\n};\ntype TabsTabProps = TabProps;\nexport type { TabsListProps, TabsPanelProps, TabsPanelsProps, TabsProps, TabsTabProps };\nexport default Tabs;"],"mappings":";;;;;;;;;AAgCA,MAAMqC,SAAS,EACbC,OAAO;CACLC,QAAQ;CACRC,OAAO;AACT,EACF;AACA,MAAMC,4BAA8B,IAAIE,IAAI;AAQ5C,MAAMC,gBAAgB/B,cAAgC4B,SAAS;AAC/D,MAAMI,uBAAuBhC,0BAAmD,CAAC,CAAC;AAgBlF,SAASoC,WAAWD,UAAgC;CAClD,QAAQE,UAEF,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACD,OAAOF,aAAa,aAAaA,SAASE,KAAK,IAAIF,UACpD,oBAAC+C,oBAAD,EAAuB,WAAU,iIAAgI,CAAA,CAC7J;;AACV;AAQA,SAAS3C,YAAYC,UAAmBC,QAA6D;CACnG,QAAQE,UAAUN,UAAU;EAC1B,MAAMO,WAAWJ,WAAWG,WAAW;GACrC,GAAGA;GACH,iBAAiBE,KAAAA;EACnB;EACA,IAAIJ,WAAWI,KAAAA,GACb,OAAOJ,OAAOG,UAAUP,KAAK;EAE/B,IAAI,UAAUO,UAEZ,OAAO,oBAAC,KAAD,EAAG,GAAIA,SAAS,CAAA;EAEzB,OAAO,oBAAC,OAAD,EAAK,GAAIA,SAAS,CAAA;CAC3B;AACF;;;;;;;;;;;AAYA,SAAAnC,OAAAqC,IAAA;CAAA,MAAAC,IAAA3D,EAAA,EAAA;CAAA,IAAA+C;CAAA,IAAAa;CAAA,IAAAD,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAX,UAAA,GAAAa,SAAAF;EAG8BC,EAAA,KAAAD;EAAAC,EAAA,KAAAZ;EAAAY,EAAA,KAAAC;CAAA,OAAA;EAAAb,WAAAY,EAAA;EAAAC,QAAAD,EAAA;CAAA;CAC1C,MAAA,CAAAE,QAAAC,aAA4B9C,SAA2BwB,SAAS;CAAE,IAAAuB;CAAA,IAAAJ,EAA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EAAA,KAAAe;EAAAf,EAAA,KAAAgB;EAAAhB,EAAA,KAAAyB;CAAA,OAAAA,KAAAzB,EAAA;CAAA,OAFDyB;AAEC;AAQV,SAASD,UAAUlC,OAAuB;CACxC,OAAO;EACL,GAAG,EACD4B,WAAW,uRACb;EACA,GAAG,EACDA,WAAW,uRACb;EACA,GAAG,EACDA,WAAW,qQACb;EACA,GAAG,EACDA,WAAW,qQACb;CACF,EAAE,CAAC,CAAC5B,MAAMoC,cAAc,IAAI,CAAC,CAACpC,MAAMqC,cAAc;AACpD;AACAjE,OAAKkE,OAAOX;AACZvD,OAAKmE,QAAQV;AACbzD,OAAKoE,SAAST;AACd3D,OAAKE,MAAM0D"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","Key","TabsProps","RACTabsProps","TabListProps","TabPanelProps","TabPanelsProps","TabProps","TabRenderProps","stylex","createContext","useCallback","useContext","useEffect","useMemo","useState","SelectionIndicator","RACSelectionIndicator","TabPanels","RACTabPanels","Tabs","RACTabs","Tab","TabList","TabPanel","mergeStatefulStyles","mergeStyles","colors","motion","radii","sizing","spacing","stateLayerOpacity","typography","Badge","FORCED_COLORS","styles","indicator","k6CgDc","kWkggS","kZKoxP","kLZC3w","kPef9Z","kEafiO","kfmiAY","krdFHd","kB7OPa","kzqmXN","krVfgx","kkqhue","kUOVxO","k7Eaqz","kVAEAm","kIyJzY","k1ekBW","kAMwcw","$$css","indicatorSecondary","indicatorSecondaryVertical","kBCPoo","k8ry5P","ke9TFa","kYYq5F","kt4wiu","indicatorVertical","kVL7Gh","kqGvvJ","kAzted","label","kGNEyG","k1xSpc","kjj79g","ks0D6T","labelInline","kOIVth","labelStacked","kXwgrk","tab","kMzoRj","kMwMTN","kkrTdU","kCS8Yb","kzQI83","kmuXW","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kjBf7l","kInvED","k3XXqK","kMeerF","k8WAf4","kg3NbH","kybGjl","tabActive","tabActiveHovered","tabActiveSecondary","tabDisabled","tabInactive","tabInactiveHovered","tabPressed","tabScrollable","tabSecondaryHovered","tabSecondaryPressed","tabStacked","tabVertical","TabsVariant","VARIANTS","primary","active","activeHovered","inactiveHovered","horizontal","vertical","pressed","secondary","Record","Bar","layout","TabsLayout","orientation","Orientation","variant","NonNullable","BarContext","revealed","WeakSet","Element","NO_PANELS","ReadonlySet","Set","PanelsContext","RegisterPanelContext","id","Omit","children","badgeFor","badge","icon","undefined","className","revealInBar","element","HTMLElement","closest","bar","first","has","add","box","getBoundingClientRect","room","left","Math","min","max","right","top","bottom","scrollBy","behavior","tabClasses","stacked","roles","state","props","isSelected","isHovered","isPressed","isDisabled","tabContent","hasIcon","after","underLabel","defaultChildren","text","tabRenderer","hasPanel","render","domProps","adjusted","t0","$","t1","t2","t3","t4","panels","setPanels","t5","Symbol","for","previous","next","previous_0","next_0","delete","register","T0","t6","0","1","t7","t8","t9","t10","TabsList","2","3","TabsPanel","TabsPanels","TabsTab","List","Panel","Panels","TabsListProps","TabsPanelProps","TabsPanelsProps","TabsTabProps","stylex.props","RACSelectionIndicator","Tabs","_c","RACTabs","RACTabPanels"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { Key, TabsProps as RACTabsProps, TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport { SelectionIndicator as RACSelectionIndicator, TabPanels as RACTabPanels, Tabs as RACTabs, Tab, TabList, TabPanel } from 'react-aria-components';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Badge from '../badge';\n\n// The tabs page's primary and secondary tabs. Both are a 48dp bar on the\n// surface, divided into equal sections, with a 1dp outline-variant divider\n// inside the bar along its bottom edge.\n//\n// **Primary** draws the active tab in the primary role and, under its label,\n// a 3dp primary indicator rounded along its top. The indicator follows the\n// label rather than the tab, inset 2dp from the label's ends and never\n// shorter than 24dp, which is what the page draws. A primary tab given an\n// icon stacks the page's 24dp icon over its label, 2dp apart, and the bar\n// grows to the page's 64dp.\n//\n// **Secondary** is the strip that sits under a primary one. Its active tab\n// keeps the on-surface role, and its 2dp primary indicator spans the whole\n// tab. An icon sits before the label, 8dp from it, which is the page's\n// spacing for an inline icon and material-web's layout for a secondary tab:\n// the strip keeps its 48dp under the primary one either way.\n//\n// A badge sits on the icon where a primary tab stacks one, placed as the\n// badges page places it, and 4dp after the label anywhere else.\n//\n// **The bar is equal sections unless `layout` says otherwise.**\n// `layout=\"scrollable\"` is the page's scrollable tabs: each tab as wide as\n// its label, between MDC-Android's 72dp and 264dp, in a bar that scrolls\n// without a scrollbar and brings the selected tab into view, as\n// material-web's does.\n//\n// **`orientation=\"vertical\"` turns the bar on its side.** The page draws no\n// vertical tabs, so this follows the horizontal bar's own measurements: the\n// tabs stack, the divider runs down the bar's inline end, and each\n// indicator lies along that edge — 3dp and rounded toward the tab on a\n// primary bar, 2dp and square on a secondary one — spanning the tab rather\n// than a label that no longer runs along it. The bar sits beside the panels\n// rather than above them.\n//\n// The indicator is React Aria's `SelectionIndicator`, which is a shared\n// element: it is rendered inside every tab but drawn in the selected one,\n// and on a change it keeps the old one until it has finished moving to the\n// new one's place. No `SharedElementTransition` is rendered here — `Tab`\n// scopes its own, and one added around the list changes nothing, which is\n// worth knowing because the primitive throws outside a scope when it is put\n// anywhere else.\n//\n// The label is wrapped in a span of its own so a primary indicator has the\n// label's width to follow: it is drawn inside the span, and the span is as\n// tall as the tab so the indicator reaches the bottom of the bar. Which tab\n// carries it comes from React Aria's render state rather than a selector,\n// since StyleX cannot target [data-selected] on the element it is styling.\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n indicator: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"xuoj239\",\n kLZC3w: \"x4hsqty\",\n kPef9Z: \"x4z998w\",\n kEafiO: \"x1cuxy5d\",\n kfmiAY: \"x1pixlao\",\n krdFHd: \"xyooppx\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x17v02zk\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n kUOVxO: \"xvueqy4\",\n k7Eaqz: \"xnei2rj\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x1mxbss1\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorSecondary: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"x36qwtl\",\n kLZC3w: \"x4hsqty\",\n kPef9Z: \"x4z998w\",\n kEafiO: \"x7sdbh0\",\n kB7OPa: \"x9f619\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x1mxbss1\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorSecondaryVertical: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kBCPoo: \"x1ksdfms\",\n k8ry5P: \"xf1j0q2\",\n ke9TFa: \"x12inkfj\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"xfo62xy\",\n kYYq5F: \"x10no89f\",\n kt4wiu: \"xtijo5x\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"xcxfjh9\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n indicatorVertical: {\n k6CgDc: \"x12w9bfk\",\n kWkggS: \"xnety89\",\n kZKoxP: \"x1qu6c4t\",\n kVL7Gh: \"x25gbn0\",\n kBCPoo: \"x1ksdfms\",\n k8ry5P: \"xf1j0q2\",\n ke9TFa: \"x1o9zed4\",\n krdFHd: \"xyooppx\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"x1g8rjiy\",\n kYYq5F: \"x10no89f\",\n kt4wiu: \"xtijo5x\",\n kqGvvJ: \"x1nkss2m\",\n kAzted: \"xjwf9q1\",\n kVAEAm: \"x10l6tqk\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"xcxfjh9\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n label: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x5yr21d\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kjj79g: \"xl56j7k\",\n ks0D6T: \"x193iq5w\",\n k7Eaqz: \"xeuugli\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n labelInline: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n labelStacked: {\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n tab: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kAzted: \"x1dry9sr\",\n k7Eaqz: \"xeuugli\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n k8WAf4: \"xt970qd\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n tabActive: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n tabActiveHovered: {\n kWkggS: \"x659ado\",\n $$css: true\n },\n tabActiveSecondary: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n tabDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n tabInactive: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n tabInactiveHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n tabPressed: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n },\n tabScrollable: {\n kCS8Yb: \"xdl72j9\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n ks0D6T: \"x1pdpmub\",\n k7Eaqz: \"x187xtus\",\n $$css: true\n },\n tabSecondaryHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n tabSecondaryPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n tabStacked: {\n kAzted: \"x8nclml\",\n $$css: true\n },\n tabVertical: {\n kCS8Yb: \"xdl72j9\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"x1nhvcw1\",\n $$css: true\n }\n};\n\n// A vertical bar beside its panels, which take the rest of the row. A style\n// of its own rather than one of the list's, since it is the root that holds\n// the two.\n\n/** The tabs page's two styles of tab bar. */\ntype TabsVariant = 'primary' | 'secondary';\n\n// What each style draws a tab's states in. A table rather than a branch per\n// state, so the two styles cannot differ in which states they answer.\nconst VARIANTS = {\n primary: {\n active: styles.tabActive,\n activeHovered: styles.tabActiveHovered,\n inactiveHovered: styles.tabInactiveHovered,\n indicator: {\n horizontal: styles.indicator,\n vertical: styles.indicatorVertical\n },\n pressed: styles.tabPressed\n },\n secondary: {\n active: styles.tabActiveSecondary,\n activeHovered: styles.tabSecondaryHovered,\n inactiveHovered: styles.tabSecondaryHovered,\n indicator: {\n horizontal: styles.indicatorSecondary,\n vertical: styles.indicatorSecondaryVertical\n },\n pressed: styles.tabSecondaryPressed\n }\n} satisfies Record<TabsVariant, unknown>;\n\n// The bar's three decisions, from the root to the list and every tab in it.\n// A context rather than props on each part, since they are the bar's and\n// repeating them on every tab is how the two drift.\ntype Bar = {\n layout: TabsLayout;\n orientation: Orientation;\n variant: TabsVariant;\n};\ntype Orientation = NonNullable<RACTabsProps['orientation']>;\n\n/** How the bar shares its room among the tabs. */\ntype TabsLayout = 'fixed' | 'scrollable';\nconst BarContext = createContext<Bar>({\n layout: 'fixed',\n orientation: 'horizontal',\n variant: 'primary'\n});\n\n// The bars a reveal has already scrolled, so that only the first is instant.\nconst revealed = new WeakSet<Element>();\nconst NO_PANELS: ReadonlySet<Key> = new Set();\n\n// Which panels are mounted, by id. React Aria points a selected tab's\n// `aria-controls` at the panel it would control whether or not one exists,\n// and a strip used on its own — tabs that filter the content below rather\n// than swapping a panel — then references an id nothing carries, which axe\n// reports as an invalid attribute value. Each panel registers itself here so\n// a tab can leave the attribute off when its panel is not there.\nconst PanelsContext = createContext<ReadonlySet<Key>>(NO_PANELS);\nconst RegisterPanelContext = createContext<(id: Key) => () => void>(() => () => {});\n\n// `children` is narrowed to nodes. React Aria also accepts a function there,\n// to hand the children the tabs' render state, and that form cannot be\n// wrapped in a context provider without calling it first — which would be\n// doing React Aria's job with none of its state. Nothing here needs it, so\n// the narrower type says so rather than leaving a signature that type-checks\n// and then fails to render.\ntype TabsProps = Omit<RACTabsProps, 'children'> & {\n children?: ReactNode;\n /**\n * How the bar shares its room: `fixed` divides it into equal sections, and\n * `scrollable` gives each tab its label's width in a bar that scrolls,\n * which is the page's choice for more tabs than the room has sections for.\n * @default 'fixed'\n */\n layout?: TabsLayout;\n /**\n * Which of the page's two tab bars this is: `primary` for the main one,\n * `secondary` for a strip under a primary one.\n * @default 'primary'\n */\n variant?: TabsVariant;\n};\n\n// The badge, which wraps the icon where a primary tab stacks one and stands\n// after the label anywhere else: `true` for the small dot, a number for the\n// large badge, and nothing for `false`.\nfunction badgeFor(badge: boolean | number | undefined, icon?: ReactNode): ReactNode {\n if (badge === undefined || badge === false) {\n return icon ?? null;\n }\n return <Badge count={badge === true ? undefined : badge} {...{\n 0: {},\n 1: {\n className: \"x2lah0s\"\n }\n }[!!(icon === undefined) << 0]}>\n {icon}\n </Badge>;\n}\n\n// Scrolls a scrollable bar just far enough to show its selected tab whole,\n// handed to the selected tab's label as a ref so it runs as that tab\n// becomes the selected one. The bar alone, never the page: `scrollIntoView`\n// would scroll every scrolling ancestor, the window included, to bring a\n// bar below the fold up to it. The first reveal is instant, so a bar opens\n// on its selected tab rather than sliding to it; the rest take the bar's own\n// smooth scrolling.\nfunction revealInBar(element: HTMLElement | null) {\n const tab = element?.closest('[role=\"tab\"]');\n const bar = tab?.closest('[role=\"tablist\"]');\n if (tab === undefined || tab === null || bar === undefined || bar === null) {\n return;\n }\n const first = !revealed.has(bar);\n revealed.add(bar);\n const box = tab.getBoundingClientRect();\n const room = bar.getBoundingClientRect();\n const left = Math.min(0, box.left - room.left) + Math.max(0, box.right - room.right);\n const top = Math.min(0, box.top - room.top) + Math.max(0, box.bottom - room.bottom);\n if (left !== 0 || top !== 0) {\n bar.scrollBy({\n behavior: first ? 'instant' : 'auto',\n left,\n top\n });\n }\n}\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active tab cannot be chosen in CSS. React Aria's answer is a className that\n// is a function of the tab's own state, the same mechanism Chip uses —\n// mergeStatefulStyles wraps this one so a tab still keeps a className the call\n// site passed.\nfunction tabClasses({\n layout,\n orientation,\n variant\n}: Bar, stacked: boolean) {\n const roles = VARIANTS[variant];\n const vertical = orientation === 'vertical';\n return (state: TabRenderProps) => stylex.props(styles.tab, layout === 'scrollable' && !vertical && styles.tabScrollable, vertical && styles.tabVertical, stacked && styles.tabStacked, state.isSelected ? roles.active : styles.tabInactive, state.isHovered && (state.isSelected ? roles.activeHovered : roles.inactiveHovered), state.isPressed && roles.pressed, state.isDisabled && styles.tabDisabled);\n}\n\n// The tab's content: the icon, if any, then the label, wrapped so the\n// indicator has its width to follow. A badge after the label shares a line\n// with it, which is the one wrapper a tab without one goes without. Built by\n// a call for the same reason as `tabRenderer` below; React Aria hands the\n// function the tab's state, and it is passed on when the children are a\n// function too.\nfunction tabContent(children: TabProps['children'], {\n layout,\n orientation,\n variant\n}: Bar, icon: ReactNode, badge: boolean | number | undefined) {\n const hasIcon = icon !== undefined && icon !== null;\n const stacked = hasIcon && variant === 'primary';\n const after = stacked ? null : badgeFor(badge);\n const indicator = <RACSelectionIndicator {...stylex.props(VARIANTS[variant].indicator[orientation])} />;\n // A primary indicator follows the label along a horizontal bar, and lies\n // along the tab's edge everywhere else.\n const underLabel = variant === 'primary' && orientation === 'horizontal';\n return (state: TabRenderProps & {\n defaultChildren: ReactNode;\n }) => {\n const text = <span {...{\n 0: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub x1h7i4cw\"\n },\n 2: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub xh0615m\"\n },\n 1: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub x1h7i4cw x1yc453h\"\n },\n 3: {\n className: \"x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub xh0615m x1yc453h\"\n }\n }[!!stacked << 1 | !!(orientation === 'vertical') << 0]}>\n {typeof children === 'function' ? children(state) : children}\n </span>;\n return <>\n <span ref={layout === 'scrollable' && state.isSelected ? revealInBar : undefined} {...stylex.props(styles.label, hasIcon && (stacked ? styles.labelStacked : styles.labelInline))}>\n {hasIcon ? <span className=\"x6s0dn4 xxk0z11 x3nfvp2 x2lah0s x1pvqxga xvy4d1p xl56j7k\">\n {stacked ? badgeFor(badge, icon) : icon}\n </span> : null}\n {after === null ? text : <span className=\"x6s0dn4 x9f619 x3nfvp2 xzoy561 x193iq5w xeuugli\">\n {text}\n {after}\n </span>}\n {underLabel ? indicator : null}\n </span>\n {underLabel ? null : indicator}\n </>;\n };\n}\n\n// React Aria renders a tab with `href` as an anchor and any other as a div,\n// and expects a `render` function to return the same element it would have.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its two inputs. See PanelsContext for why the attribute is\n// dropped.\nfunction tabRenderer(hasPanel: boolean, render: TabProps['render']): NonNullable<TabProps['render']> {\n return (domProps, state) => {\n const adjusted = hasPanel ? domProps : {\n ...domProps,\n 'aria-controls': undefined\n };\n if (render !== undefined) {\n return render(adjusted, state);\n }\n if ('href' in adjusted) {\n // oxlint-disable-next-line jsx-a11y/anchor-has-content -- filled by React Aria\n return <a {...adjusted} />;\n }\n return <div {...adjusted} />;\n };\n}\n\n/**\n * A tab bar and its panels. Selection is React Aria's `selectedKey`: pass\n * it with `onSelectionChange` to control it, or `defaultSelectedKey` to let\n * it keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it controls through\n * a shared `id`, and a strip may stand alone without panels.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs({\n children,\n layout = 'fixed',\n orientation = 'horizontal',\n variant = 'primary',\n ...props\n}: RefAttributes<HTMLDivElement> & TabsProps) {\n const bar = useMemo(() => ({\n layout,\n orientation,\n variant\n }), [layout, orientation, variant]);\n const [panels, setPanels] = useState<ReadonlySet<Key>>(NO_PANELS);\n const register = useCallback((id: Key) => {\n setPanels(previous => {\n if (previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.add(id);\n return next;\n });\n return () => {\n setPanels(previous => {\n if (!previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.delete(id);\n return next;\n });\n };\n }, []);\n return <RACTabs {...props} orientation={orientation} {...mergeStatefulStyles({\n 0: {},\n 1: {\n className: \"x78zum5\"\n }\n }[!!(orientation === 'vertical') << 0], props)}>\n <RegisterPanelContext value={register}>\n <PanelsContext value={panels}>\n <BarContext value={bar}>{children}</BarContext>\n </PanelsContext>\n </RegisterPanelContext>\n </RACTabs>;\n}\nfunction TabsList(props: TabsListProps) {\n const {\n layout,\n orientation\n } = useContext(BarContext);\n return <TabList {...props} {...mergeStatefulStyles({\n 0: {\n className: \"xp05xdj x9f619 x78zum5\"\n },\n 2: {\n className: \"xp05xdj x9f619 x78zum5 xfk6m8 xysyzu8 x1rohswg xkcv6ua xg83hb1\"\n },\n 1: {\n className: \"x9f619 x78zum5 x1kbcym6 xiwn18o xdt5ytf x2lah0s\"\n },\n 3: {\n className: \"x9f619 x78zum5 xfk6m8 xysyzu8 x1rohswg xkcv6ua xg83hb1 x1kbcym6 xiwn18o xdt5ytf x2lah0s\"\n }\n }[!!(layout === 'scrollable') << 1 | !!(orientation === 'vertical') << 0], props)} />;\n}\nfunction TabsPanel(props: TabsPanelProps) {\n const register = useContext(RegisterPanelContext);\n const {\n id\n } = props;\n useEffect(() => {\n if (id === undefined) {\n return undefined;\n }\n return register(id);\n }, [id, register]);\n return <TabPanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 x1iyjqo2 xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n }, props)} />;\n}\n\n/**\n * An optional box around the panels, which animates its height as one panel\n * gives way to the next. Without it the panels still work; the box around\n * them simply jumps from one height to the other.\n */\nfunction TabsPanels(props: TabsPanelsProps) {\n return <RACTabPanels {...props} {...mergeStyles({\n className: \"x12w9bfk x1t2j4n3 x9f619 x1iyjqo2 xeuugli x7giv3 x1hm618n xioksi3 x1f55p5c x1seskgd\"\n }, props)} />;\n}\nfunction TabsTab({\n badge,\n children,\n icon,\n render,\n ...props\n}: TabsTabProps) {\n const panels = useContext(PanelsContext);\n const bar = useContext(BarContext);\n const hasPanel = props.id !== undefined && panels.has(props.id);\n const stacked = icon !== undefined && icon !== null && bar.variant === 'primary';\n return <Tab {...props} render={tabRenderer(hasPanel, render)} {...mergeStatefulStyles(tabClasses(bar, stacked), props)}>\n {tabContent(children, bar, icon, badge)}\n </Tab>;\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Panels = TabsPanels;\nTabs.Tab = TabsTab;\ntype TabsListProps = TabListProps<object>;\ntype TabsPanelProps = TabPanelProps;\ntype TabsPanelsProps = Omit<TabPanelsProps<object>, 'children'> & {\n children?: ReactNode;\n};\ntype TabsTabProps = {\n /**\n * A badge on the tab: `true` for the badges page's small dot, a number for\n * the large badge holding it. It sits on a primary tab's icon, and after\n * the label anywhere else. The badge is hidden from assistive technology,\n * so say what it says in the tab's name too — \"First item, 3 new\".\n */\n badge?: boolean | number;\n /**\n * An icon with the label, at the page's 24dp: over it on a primary tab,\n * whose bar grows to 64dp, and before it on a secondary one. An icon drawn\n * in `em` takes its size from the slot.\n */\n icon?: ReactNode;\n} & TabProps;\nexport type { TabsLayout, TabsListProps, TabsPanelProps, TabsPanelsProps, TabsProps, TabsTabProps, TabsVariant };\nexport { TabsList, TabsPanel, TabsPanels, TabsTab };\nexport default Tabs;"],"mappings":";;;;;;;;;AAgEA,MAAMuC,SAAS;CACbC,WAAW;EACTC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,oBAAoB;EAClBnB,QAAQ;EACRC,QAAQ;EACR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EAAA4C,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAgB,MAAAhB,EAAA,OAAAjB,SAAAiB,EAAA,OAAAC,MAAAD,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EADpCC,KAAA,oBAAC,IAAD;GAAI,GAAKrB;GAAe,QAAAkB;GAA6B,GAAMC;GAC7DC,UAAAA;EADM,CAAA;EAEHH,EAAA,KAAAgB;EAAAhB,EAAA,KAAAjB;EAAAiB,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,MAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAFDI;AAEC;AAEVxK,OAAKkM,OAAON;AACZ5L,OAAKmM,QAAQJ;AACb/L,OAAKoM,SAASJ;AACdhM,OAAKE,MAAM+L"}
@@ -29,5 +29,5 @@ type TagVariant = 'filled' | 'outlined';
29
29
  */
30
30
  declare function Tag({ render, tone, variant, ...props }: TagProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
31
31
  //#endregion
32
- export { type TagProps, Tag as default };
32
+ export { type TagProps, type TagTone, type TagVariant, Tag as default };
33
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","stylex","RenderComponentProps","useRender","mergeStyles","colors","radii","spacing","typography","styles","base","kGNEyG","kaIpWk","ksu8eU","kMzoRj","kB7OPa","k1xSpc","kmuXW","kMv6JI","kGuDYH","kcqcaj","k63SB2","kOIVth","kb6lSQ","kLWn49","k8WAf4","kg3NbH","khDVqt","$$css","filledTones","negative","kWkggS","kVAM5u","kMwMTN","neutral","positive","primary","outlinedTones","TagProps","tone","TagTone","variant","TagVariant","Tag","t0","$","render","t1","t2","t3","t4","t5","t6","t7","props","undefined","toned","defaultTagName","_c","props","stylex.props"],"sources":["../../../src/components/tag/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// A tag states something about what it sits beside — a count, a status, a\n// version — and is never itself the thing you press. That is the whole line\n// between this and Chip: a chip is a two-state button announcing itself\n// through `aria-pressed`, so reaching for one to render a read-only label\n// puts a control in the accessibility tree that nothing can operate.\n//\n// Both variants carry a 1px border and `filled` makes it transparent rather\n// than dropping it, so a tag is the same size either way. Emphasising one\n// tag in a row otherwise nudges its neighbours by a pixel each side.\n//\n// Tabular figures are unconditional, for the same reason Currency sets them:\n// what ends up in a tag is mostly numeric — counts, versions, ports — and a\n// stack of them down a list wobbles on proportional digits. Text that happens\n// to carry no digits is unaffected.\n//\n// No Material Design page draws a tag; the badges page's large badge is the\n// nearest, a label-small count on an 8dp corner, and that is the type and the\n// corner here. A tag stands beside a word rather than on an icon, so it takes\n// the padding and 1dp rule above in place of the badge's 16dp box, and the\n// container roles in place of the badge's error pair, since it names a state\n// rather than flagging one.\nconst styles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kaIpWk: \"x1xdvaa9\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n kcqcaj: \"xss6m8b\",\n k63SB2: \"x1su64ma\",\n kOIVth: \"xzoy561\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n k8WAf4: \"xpg5a72\",\n kg3NbH: \"xn60lsn\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n }\n};\n\n// `neutral` draws from the surface roles rather than a colour of its own,\n// which is what lets it state something without ranking it. The other three\n// name a direction, and are the same three Currency uses, plus primary for\n// the notable-but-not-good-or-bad case.\nconst filledTones = {\n negative: {\n kWkggS: \"xkz0cvf\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"xylzu7l\",\n $$css: true\n },\n neutral: {\n kWkggS: \"x1rrhr5q\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n positive: {\n kWkggS: \"xa3zu90\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1di7zbg\",\n $$css: true\n },\n primary: {\n kWkggS: \"xp89om9\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\n\n// Outlined takes the tone at full strength for both the rule and the text,\n// rather than the on-container pairing filled uses. There is no container\n// here for an on-colour to be legible against — the page is the background —\n// so the container roles would read as washed out.\nconst outlinedTones = {\n negative: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x1xdi1zw\",\n kMwMTN: \"x12gp0t\",\n $$css: true\n },\n neutral: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n positive: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xm76mbg\",\n kMwMTN: \"x4no3js\",\n $$css: true\n },\n primary: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x1uajy3w\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n }\n};\ntype TagProps = {\n /**\n * Which colour role the tag carries. `neutral` states without ranking;\n * the other three read as good, bad, or worth noticing.\n *\n * Each is a container under its own on-colour, guaranteed legible on the\n * surface family — which is what the library's own tokens and every demo\n * scheme are held to. Over a container of its own the pair is one colour\n * family on top of another and is not guaranteed, so a custom theme placing\n * a tag there has to check that pair itself.\n * @default 'neutral'\n */\n tone?: TagTone;\n /**\n * How much weight the tag pulls. `filled` sits on a container of its own;\n * `outlined` is a rule on the page, for a tag that should not compete\n * with the thing it labels.\n * @default 'filled'\n */\n variant?: TagVariant;\n} & RenderComponentProps<'span'>;\ntype TagTone = 'negative' | 'neutral' | 'positive' | 'primary';\ntype TagVariant = 'filled' | 'outlined';\n\n/**\n * A short, read-only label attached to something else. It renders a `<span>`\n * and takes no interaction — for a label that can be selected, reach for Chip.\n */\nfunction Tag({\n render,\n tone = 'neutral',\n variant = 'filled',\n ...props\n}: TagProps) {\n const toned = variant === 'filled' ? filledTones[tone] : outlinedTones[tone];\n return useRender({\n defaultTagName: 'span',\n props: {\n ...props,\n ...mergeStyles(stylex.props(styles.base, toned), props)\n },\n render\n });\n}\nexport type { TagProps };\nexport default Tag;"],"mappings":";;;;;;AA8BA,MAAMU,SAAS,EACbC,MAAM;CACJC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AAMA,MAAMC,cAAc;CAClBC,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,SAAS;EACPH,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAO,UAAU;EACRJ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAQ,SAAS;EACPL,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;AACF;AAMA,MAAMS,gBAAgB;CACpBP,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,SAAS;EACPH,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAO,UAAU;EACRJ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAQ,SAAS;EACPL,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;C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AC"}
1
+ {"version":3,"file":"index.js","names":["c","_c","stylex","RenderComponentProps","useRender","mergeStyles","colors","radii","spacing","typography","styles","base","kGNEyG","kaIpWk","ksu8eU","kMzoRj","kB7OPa","k1xSpc","kmuXW","kMv6JI","kGuDYH","kcqcaj","k63SB2","kOIVth","kb6lSQ","kLWn49","k8WAf4","kg3NbH","khDVqt","$$css","filledTones","negative","kWkggS","kVAM5u","kMwMTN","neutral","positive","primary","outlinedTones","TagProps","tone","TagTone","variant","TagVariant","Tag","t0","$","render","t1","t2","t3","t4","t5","t6","t7","props","undefined","toned","defaultTagName","_c","props","stylex.props"],"sources":["../../../src/components/tag/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// A tag states something about what it sits beside — a count, a status, a\n// version — and is never itself the thing you press. That is the whole line\n// between this and Chip: a chip is a two-state button announcing itself\n// through `aria-pressed`, so reaching for one to render a read-only label\n// puts a control in the accessibility tree that nothing can operate.\n//\n// Both variants carry a 1px border and `filled` makes it transparent rather\n// than dropping it, so a tag is the same size either way. Emphasising one\n// tag in a row otherwise nudges its neighbours by a pixel each side.\n//\n// Tabular figures are unconditional, for the same reason Currency sets them:\n// what ends up in a tag is mostly numeric — counts, versions, ports — and a\n// stack of them down a list wobbles on proportional digits. Text that happens\n// to carry no digits is unaffected.\n//\n// No Material Design page draws a tag; the badges page's large badge, which\n// `Badge` draws, is the nearest, a label-small count on an 8dp corner, and\n// that is the type and the corner here. A tag stands beside a word rather than on an icon, so it takes\n// the padding and 1dp rule above in place of the badge's 16dp box, and the\n// container roles in place of the badge's error pair, since it names a state\n// rather than flagging one.\nconst styles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kaIpWk: \"x1xdvaa9\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n kcqcaj: \"xss6m8b\",\n k63SB2: \"x1su64ma\",\n kOIVth: \"xzoy561\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n k8WAf4: \"xpg5a72\",\n kg3NbH: \"xn60lsn\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n }\n};\n\n// `neutral` draws from the surface roles rather than a colour of its own,\n// which is what lets it state something without ranking it. The other three\n// name a direction, and are the same three Currency uses, plus primary for\n// the notable-but-not-good-or-bad case.\nconst filledTones = {\n negative: {\n kWkggS: \"xkz0cvf\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"xylzu7l\",\n $$css: true\n },\n neutral: {\n kWkggS: \"x1rrhr5q\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n positive: {\n kWkggS: \"xa3zu90\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1di7zbg\",\n $$css: true\n },\n primary: {\n kWkggS: \"xp89om9\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\n\n// Outlined takes the tone at full strength for both the rule and the text,\n// rather than the on-container pairing filled uses. There is no container\n// here for an on-colour to be legible against — the page is the background —\n// so the container roles would read as washed out.\nconst outlinedTones = {\n negative: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x1xdi1zw\",\n kMwMTN: \"x12gp0t\",\n $$css: true\n },\n neutral: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n positive: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xm76mbg\",\n kMwMTN: \"x4no3js\",\n $$css: true\n },\n primary: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x1uajy3w\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n }\n};\ntype TagProps = {\n /**\n * Which colour role the tag carries. `neutral` states without ranking;\n * the other three read as good, bad, or worth noticing.\n *\n * Each is a container under its own on-colour, guaranteed legible on the\n * surface family — which is what the library's own tokens and every demo\n * scheme are held to. Over a container of its own the pair is one colour\n * family on top of another and is not guaranteed, so a custom theme placing\n * a tag there has to check that pair itself.\n * @default 'neutral'\n */\n tone?: TagTone;\n /**\n * How much weight the tag pulls. `filled` sits on a container of its own;\n * `outlined` is a rule on the page, for a tag that should not compete\n * with the thing it labels.\n * @default 'filled'\n */\n variant?: TagVariant;\n} & RenderComponentProps<'span'>;\ntype TagTone = 'negative' | 'neutral' | 'positive' | 'primary';\ntype TagVariant = 'filled' | 'outlined';\n\n/**\n * A short, read-only label attached to something else. It renders a `<span>`\n * and takes no interaction — for a label that can be selected, reach for Chip.\n */\nfunction Tag({\n render,\n tone = 'neutral',\n variant = 'filled',\n ...props\n}: TagProps) {\n const toned = variant === 'filled' ? filledTones[tone] : outlinedTones[tone];\n return useRender({\n defaultTagName: 'span',\n props: {\n ...props,\n ...mergeStyles(stylex.props(styles.base, toned), props)\n },\n render\n });\n}\nexport type { TagProps, TagTone, TagVariant };\nexport default Tag;"],"mappings":";;;;;;AA8BA,MAAMU,SAAS,EACbC,MAAM;CACJC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AAMA,MAAMC,cAAc;CAClBC,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,SAAS;EACPH,QAAQ;EACRC,QAAQ;EACR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M;CAAA,IAAAN,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EAFlDG,KAAA;GAAA,GACFG;GAAK,GACLN;EACL;EAACH,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAC,UAAAD,EAAA,QAAAI,MAAAJ,EAAA,QAAAM,IAAA;EALcC,KAAA;GAAAK,gBACCR;GAAMK,OACfH;GAGNL;EAEH;EAACD,EAAA,KAAAC;EAAAD,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAPM1C,GAAUiD,EAOhB;AAAC"}
@@ -2,7 +2,7 @@ import { FieldVariant } from "../../field/index.js";
2
2
  import { ReactNode, Ref, RefAttributes } from "react";
3
3
  import { TextFieldProps } from "react-aria-components";
4
4
  //#region src/components/text-area/index.d.ts
5
- type TextAreaProps = {
5
+ type TextAreaProps = Omit<TextFieldProps, 'children' | 'isInvalid' | 'validationBehavior'> & {
6
6
  /**
7
7
  * Whether the field grows with the text it holds, from `rows` up. `false`
8
8
  * keeps it at `rows` and scrolls the text inside.
@@ -12,7 +12,8 @@ type TextAreaProps = {
12
12
  /**
13
13
  * Whether to count the characters the field holds at the end of the
14
14
  * supporting line, against `maxLength` where there is one, as the text
15
- * fields page's character counter does.
15
+ * fields page's character counter does. The count is written in the
16
+ * `I18nProvider`'s digits and grouping.
16
17
  * @default false
17
18
  */
18
19
  characterCount?: boolean;
@@ -20,8 +21,9 @@ type TextAreaProps = {
20
21
  * How the limit is said to a screen reader, where there is a `maxLength`.
21
22
  * Read with the field on focus rather than as the value changes, so it
22
23
  * names the limit and not what is left of it. The visible count is hidden
23
- * from the tree, which is what this replaces.
24
- * @default `Up to ${maxLength} characters`, singular for a limit of one
24
+ * from the tree, which is what this replaces. Left out, it is the
25
+ * sentence for it in the I18nProvider's locale — "Up to 20 characters" in
26
+ * English, singular for a limit of one.
25
27
  */
26
28
  characterLimitLabel?: string;
27
29
  /**
@@ -82,7 +84,7 @@ type TextAreaProps = {
82
84
  * @default 'filled'
83
85
  */
84
86
  variant?: FieldVariant;
85
- } & Omit<TextFieldProps, 'children' | 'isInvalid' | 'validationBehavior'>;
87
+ };
86
88
  /**
87
89
  * A labelled multi-line input. Its value is React Aria's: pass `value` with
88
90
  * `onChange` to control it, or `defaultValue` to let it keep its own — and
@@ -23,7 +23,7 @@ import { TextField } from "react-aria-components";
23
23
  * `TextField` puts around them.
24
24
  */
25
25
  function TextArea$1(t0) {
26
- const $ = c(28);
26
+ const $ = c(29);
27
27
  const { autosize: t1, characterCount: t2, characterLimitLabel, description, error, floatingLabel: t3, inputRef, isDisabled: t4, label, leadingIcon, rows: t5, trailingIcon, variant: t6, ...props$1 } = t0;
28
28
  const autosize = t1 === void 0 ? true : t1;
29
29
  const characterCount = t2 === void 0 ? false : t2;
@@ -53,9 +53,10 @@ function TextArea$1(t0) {
53
53
  $[5] = t9;
54
54
  } else t9 = $[5];
55
55
  let t10;
56
- if ($[6] !== floatingLabel || $[7] !== label || $[8] !== leadingIcon || $[9] !== t9 || $[10] !== trailingIcon || $[11] !== variant) {
56
+ if ($[6] !== floatingLabel || $[7] !== label || $[8] !== leadingIcon || $[9] !== props$1.isRequired || $[10] !== t9 || $[11] !== trailingIcon || $[12] !== variant) {
57
57
  t10 = /* @__PURE__ */ jsx(FieldBox, {
58
58
  floatingLabel,
59
+ isRequired: props$1.isRequired,
59
60
  label,
60
61
  leading: leadingIcon,
61
62
  multiline: true,
@@ -66,13 +67,14 @@ function TextArea$1(t0) {
66
67
  $[6] = floatingLabel;
67
68
  $[7] = label;
68
69
  $[8] = leadingIcon;
69
- $[9] = t9;
70
- $[10] = trailingIcon;
71
- $[11] = variant;
72
- $[12] = t10;
73
- } else t10 = $[12];
70
+ $[9] = props$1.isRequired;
71
+ $[10] = t9;
72
+ $[11] = trailingIcon;
73
+ $[12] = variant;
74
+ $[13] = t10;
75
+ } else t10 = $[13];
74
76
  let t11;
75
- if ($[13] !== characterCount || $[14] !== characterLimitLabel || $[15] !== description || $[16] !== error || $[17] !== props$1.maxLength) {
77
+ if ($[14] !== characterCount || $[15] !== characterLimitLabel || $[16] !== description || $[17] !== error || $[18] !== props$1.maxLength) {
76
78
  t11 = /* @__PURE__ */ jsx(FieldMessage, {
77
79
  characterCount,
78
80
  characterLimitLabel,
@@ -80,15 +82,15 @@ function TextArea$1(t0) {
80
82
  error,
81
83
  maxLength: props$1.maxLength
82
84
  });
83
- $[13] = characterCount;
84
- $[14] = characterLimitLabel;
85
- $[15] = description;
86
- $[16] = error;
87
- $[17] = props$1.maxLength;
88
- $[18] = t11;
89
- } else t11 = $[18];
85
+ $[14] = characterCount;
86
+ $[15] = characterLimitLabel;
87
+ $[16] = description;
88
+ $[17] = error;
89
+ $[18] = props$1.maxLength;
90
+ $[19] = t11;
91
+ } else t11 = $[19];
90
92
  let t12;
91
- if ($[19] !== T0 || $[20] !== isDisabled || $[21] !== props$1 || $[22] !== t10 || $[23] !== t11 || $[24] !== t7 || $[25] !== t8 || $[26] !== validationBehavior) {
93
+ if ($[20] !== T0 || $[21] !== isDisabled || $[22] !== props$1 || $[23] !== t10 || $[24] !== t11 || $[25] !== t7 || $[26] !== t8 || $[27] !== validationBehavior) {
92
94
  t12 = /* @__PURE__ */ jsxs(T0, {
93
95
  isDisabled,
94
96
  isInvalid: t7,
@@ -97,16 +99,16 @@ function TextArea$1(t0) {
97
99
  ...t8,
98
100
  children: [t10, t11]
99
101
  });
100
- $[19] = T0;
101
- $[20] = isDisabled;
102
- $[21] = props$1;
103
- $[22] = t10;
104
- $[23] = t11;
105
- $[24] = t7;
106
- $[25] = t8;
107
- $[26] = validationBehavior;
108
- $[27] = t12;
109
- } else t12 = $[27];
102
+ $[20] = T0;
103
+ $[21] = isDisabled;
104
+ $[22] = props$1;
105
+ $[23] = t10;
106
+ $[24] = t11;
107
+ $[25] = t7;
108
+ $[26] = t8;
109
+ $[27] = validationBehavior;
110
+ $[28] = t12;
111
+ } else t12 = $[28];
110
112
  return t12;
111
113
  }
112
114
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","TextFieldProps","RACTextFieldProps","stylex","TextField","RACTextField","FieldVariant","FieldBox","FieldMessage","FieldTextArea","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","TextAreaProps","autosize","characterCount","characterLimitLabel","description","error","floatingLabel","inputRef","HTMLTextAreaElement","label","leadingIcon","rows","trailingIcon","variant","Omit","TextArea","t0","$","t1","t2","t3","isDisabled","t4","t5","t6","props","undefined","validationBehavior","T0","t7","t8","root","t9","t10","t11","maxLength","t12","TextArea","_c","props","RACTextField","stylex.props"],"sources":["../../../src/components/text-area/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldTextArea } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The text fields page's multi-line configuration of the filled field: the\n// same box, floating label, icons, underline and message as TextField,\n// holding a text area rather than an input. The page gives the box 56dp by\n// default and 8dp of padding above and below, with the label vertically\n// centred while the field is empty; a box holding more than one line keeps\n// the padding and grows, which is the chrome's `multiline` box, and its\n// icons stay centred in its height as it does. The page draws no resize\n// handle, and none is drawn here.\n//\n// Its own component rather than a prop of TextField, so `rows` and\n// `autosize` stay off TextField's type and `numeric` stays off this one.\n\ntype TextAreaProps = {\n /**\n * Whether the field grows with the text it holds, from `rows` up. `false`\n * keeps it at `rows` and scrolls the text inside.\n * @default true\n */\n autosize?: boolean;\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces.\n * @default `Up to ${maxLength} characters`, singular for a limit of one\n */\n characterLimitLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, 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 * A ref to the field's own `<textarea>`, which is the element a call site\n * moves focus to — after a server's error, say. `ref` is the field as a\n * whole.\n */\n inputRef?: Ref<HTMLTextAreaElement>;\n /**\n * What the field is for. Required rather than optional: a text area with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the text: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * How many lines of text the field shows: the least it shows while it\n * grows, or all it shows when it does not.\n * @default 3\n */\n rows?: number;\n /**\n * An icon at the end of the box, after the text: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: 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 — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'validationBehavior'>;\n\n/**\n * A labelled multi-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * The text fields page's configurations are props: `leadingIcon` and\n * `trailingIcon` at the box's ends, and `characterCount` opposite the\n * supporting text, counting against `maxLength`.\n *\n * The box, label, control and message are the field chrome in `src/field`,\n * shared with every other field; this component is what React Aria's\n * `TextField` puts around them.\n */\nfunction TextArea({\n autosize = true,\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n rows = 3,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextAreaProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} label={label} leading={leadingIcon} multiline trailing={trailingIcon} variant={variant}>\n <FieldTextArea autosize={autosize} ref={inputRef} rows={rows} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type { TextAreaProps };\nexport default TextArea;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwHA,SAAAiC,WAAAC,IAAA;CAAA,MAAAC,IAAAlC,EAAA,EAAA;CAAkB,MAAA,EAAAkB,UAAAiB,IAAAhB,gBAAAiB,IAAAhB,qBAAAC,aAAAC,OAAAC,eAAAc,IAAAb,UAAAc,YAAAC,IAAAb,OAAAC,aAAAC,MAAAY,IAAAX,cAAAC,SAAAW,IAAA,GAAAC,YAAAT;CAChB,MAAAf,WAAAiB,OAAAQ,KAAAA,IAAA,OAAAR;CACA,MAAAhB,iBAAAiB,OAAAO,KAAAA,IAAA,QAAAP;CAIA,MAAAb,gBAAAc,OAAAM,K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AAc,EAAA,QAAAb,eAAAa,EAAA,QAAAZ,SAAAY,EAAA,QAAAQ,QAAAU,WAAA;EACXD,MAAA,oBAAC,cAAD;GAA8BhC;GAAqCC;GAAkCC;GAAoBC;GAAkB,WAAAoB,QAAKU;EAAU,CAAA;EAAIlB,EAAA,MAAAf;EAAAe,EAAA,MAAAd;EAAAc,EAAA,MAAAb;EAAAa,EAAA,MAAAZ;EAAAY,EAAA,MAAAQ,QAAAU;EAAAlB,EAAA,MAAAiB;CAAA,OAAAA,MAAAjB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,QAAAW,MAAAX,EAAA,QAAAI,cAAAJ,EAAA,QAAAQ,WAAAR,EAAA,QAAAgB,OAAAhB,EAAA,QAAAiB,OAAAjB,EAAA,QAAAY,MAAAZ,EAAA,QAAAa,MAAAb,EAAA,QAAAU,oBAAA;EAJ3JS,MAAA,qBAAC,IAAD;GAA0Bf;GAAuB,WAAAQ;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA5H,UAAA,CACHG,KAGAC,GAJgB;;EAKHjB,EAAA,MAAAW;EAAAX,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;EAAAR,EAAA,MAAAgB;EAAAhB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAU;EAAAV,EAAA,MAAAmB;CAAA,OAAAA,MAAAnB,EAAA;CAAA,OALVmB;AAKU"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","TextFieldProps","RACTextFieldProps","stylex","TextField","RACTextField","FieldVariant","FieldBox","FieldMessage","FieldTextArea","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","TextAreaProps","Omit","autosize","characterCount","characterLimitLabel","description","error","floatingLabel","inputRef","HTMLTextAreaElement","label","leadingIcon","rows","trailingIcon","variant","TextArea","t0","$","t1","t2","t3","isDisabled","t4","t5","t6","props","undefined","validationBehavior","T0","t7","t8","root","t9","t10","isRequired","t11","maxLength","t12","TextArea","_c","props","RACTextField","stylex.props"],"sources":["../../../src/components/text-area/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldTextArea } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The text fields page's multi-line configuration of the filled field: the\n// same box, floating label, icons, underline and message as TextField,\n// holding a text area rather than an input. The page gives the box 56dp by\n// default and 8dp of padding above and below, with the label vertically\n// centred while the field is empty; a box holding more than one line keeps\n// the padding and grows, which is the chrome's `multiline` box, and its\n// icons stay centred in its height as it does. The page draws no resize\n// handle, and none is drawn here.\n//\n// Its own component rather than a prop of TextField, so `rows` and\n// `autosize` stay off TextField's type and `numeric` stays off this one.\n\ntype TextAreaProps = Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'validationBehavior'> & {\n /**\n * Whether the field grows with the text it holds, from `rows` up. `false`\n * keeps it at `rows` and scrolls the text inside.\n * @default true\n */\n autosize?: boolean;\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does. The count is written in the\n * `I18nProvider`'s digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, 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 * A ref to the field's own `<textarea>`, which is the element a call site\n * moves focus to — after a server's error, say. `ref` is the field as a\n * whole.\n */\n inputRef?: Ref<HTMLTextAreaElement>;\n /**\n * What the field is for. Required rather than optional: a text area with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the text: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * How many lines of text the field shows: the least it shows while it\n * grows, or all it shows when it does not.\n * @default 3\n */\n rows?: number;\n /**\n * An icon at the end of the box, after the text: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: 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 — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A labelled multi-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * The text fields page's configurations are props: `leadingIcon` and\n * `trailingIcon` at the box's ends, and `characterCount` opposite the\n * supporting text, counting against `maxLength`.\n *\n * The box, label, control and message are the field chrome in `src/field`,\n * shared with every other field; this component is what React Aria's\n * `TextField` puts around them.\n */\nfunction TextArea({\n autosize = true,\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n rows = 3,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextAreaProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} multiline trailing={trailingIcon} variant={variant}>\n <FieldTextArea autosize={autosize} ref={inputRef} rows={rows} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type { TextAreaProps };\nexport default TextArea;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0HA,SAAAiC,WAAAC,IAAA;CAAA,MAAAC,IAAAlC,EAAA,EAAA;CAAkB,MAAA,EAAAmB,UAAAgB,IAAAf,gBAAAgB,IAAAf,qBAAAC,aAAAC,OAAAC,eAAAa,IAAAZ,UAAAa,YAAAC,IAAAZ,OAAAC,aAAAC,MAAAW,IAAAV,cAAAC,SAAAU,IAAA,GAAAC,YAAAT;CAChB,MAAAd,WAAAgB,OAAAQ,KAAAA,IAAA,OAAAR;CACA,MAAAf,iBAAAgB,OAAAO,KAAAA,IAAA,QAAAP;CAIA,MAAAZ,gBAAAa,OAAAM,KAAAA,IAAA,OAAAN;CAEA,MAAAC,aAAAC,OAAAI,KAAAA,IAAA,QAAAJ;CAGA,MAAAV,OAAAW,OAAAG,KAAAA,IAAA,IAAAH;CAEA,MAAAT,UAAAU,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2B7B,2BAA2B;CAC9C,MAAA8B,KAAArC;CAAY,IAAAsC;CAAA,IAAAZ,EAAA,OAAAX,OAAA;EAAoCuB,KAAAhC,YAAYS,KAAK;EAACW,EAAA,KAAAX;EAAAW,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAy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AAkB;CAAA,OAAAA,MAAAlB,EAAA;CAAA,IAAAoB;CAAA,IAAApB,EAAA,QAAAW,MAAAX,EAAA,QAAAI,cAAAJ,EAAA,QAAAQ,WAAAR,EAAA,QAAAgB,OAAAhB,EAAA,QAAAkB,OAAAlB,EAAA,QAAAY,MAAAZ,EAAA,QAAAa,MAAAb,EAAA,QAAAU,oBAAA;EAJ3JU,MAAA,qBAAC,IAAD;GAA0BhB;GAAuB,WAAAQ;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA5H,UAAA,CACHG,KAGAE,GAJgB;;EAKHlB,EAAA,MAAAW;EAAAX,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;EAAAR,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAU;EAAAV,EAAA,MAAAoB;CAAA,OAAAA,MAAApB,EAAA;CAAA,OALVoB;AAKU"}
@@ -2,11 +2,12 @@ import { FieldVariant } from "../../field/index.js";
2
2
  import { ReactNode, Ref, RefAttributes } from "react";
3
3
  import { TextFieldProps } from "react-aria-components";
4
4
  //#region src/components/text-field/index.d.ts
5
- type TextFieldProps$1 = {
5
+ type TextFieldProps$1 = Omit<TextFieldProps, 'children' | 'isInvalid' | 'prefix' | 'validationBehavior'> & {
6
6
  /**
7
7
  * Whether to count the characters the field holds at the end of the
8
8
  * supporting line, against `maxLength` where there is one, as the text
9
- * fields page's character counter does.
9
+ * fields page's character counter does. The count is written in the
10
+ * `I18nProvider`'s digits and grouping.
10
11
  * @default false
11
12
  */
12
13
  characterCount?: boolean;
@@ -14,8 +15,9 @@ type TextFieldProps$1 = {
14
15
  * How the limit is said to a screen reader, where there is a `maxLength`.
15
16
  * Read with the field on focus rather than as the value changes, so it
16
17
  * names the limit and not what is left of it. The visible count is hidden
17
- * from the tree, which is what this replaces.
18
- * @default `Up to ${maxLength} characters`, singular for a limit of one
18
+ * from the tree, which is what this replaces. Left out, it is the
19
+ * sentence for it in the I18nProvider's locale — "Up to 20 characters" in
20
+ * English, singular for a limit of one.
19
21
  */
20
22
  characterLimitLabel?: string;
21
23
  /**
@@ -85,7 +87,7 @@ type TextFieldProps$1 = {
85
87
  * @default 'filled'
86
88
  */
87
89
  variant?: FieldVariant;
88
- } & Omit<TextFieldProps, 'children' | 'isInvalid' | 'prefix' | 'validationBehavior'>;
90
+ };
89
91
  /**
90
92
  * A labelled single-line input. Its value is React Aria's: pass `value` with
91
93
  * `onChange` to control it, or `defaultValue` to let it keep its own — and
@@ -24,7 +24,7 @@ import { TextField } from "react-aria-components";
24
24
  * `TextField` puts around them.
25
25
  */
26
26
  function TextField$1(t0) {
27
- const $ = c(29);
27
+ const $ = c(30);
28
28
  const { characterCount: t1, characterLimitLabel, description, error, floatingLabel: t2, inputRef, isDisabled: t3, label, leadingIcon, numeric: t4, prefix, suffix, trailingIcon, variant: t5, ...props$1 } = t0;
29
29
  const characterCount = t1 === void 0 ? false : t1;
30
30
  const floatingLabel = t2 === void 0 ? true : t2;
@@ -55,9 +55,10 @@ function TextField$1(t0) {
55
55
  $[6] = t8;
56
56
  } else t8 = $[6];
57
57
  let t9;
58
- if ($[7] !== floatingLabel || $[8] !== label || $[9] !== leadingIcon || $[10] !== t8 || $[11] !== trailingIcon || $[12] !== variant) {
58
+ if ($[7] !== floatingLabel || $[8] !== label || $[9] !== leadingIcon || $[10] !== props$1.isRequired || $[11] !== t8 || $[12] !== trailingIcon || $[13] !== variant) {
59
59
  t9 = /* @__PURE__ */ jsx(FieldBox, {
60
60
  floatingLabel,
61
+ isRequired: props$1.isRequired,
61
62
  label,
62
63
  leading: leadingIcon,
63
64
  trailing: trailingIcon,
@@ -67,13 +68,14 @@ function TextField$1(t0) {
67
68
  $[7] = floatingLabel;
68
69
  $[8] = label;
69
70
  $[9] = leadingIcon;
70
- $[10] = t8;
71
- $[11] = trailingIcon;
72
- $[12] = variant;
73
- $[13] = t9;
74
- } else t9 = $[13];
71
+ $[10] = props$1.isRequired;
72
+ $[11] = t8;
73
+ $[12] = trailingIcon;
74
+ $[13] = variant;
75
+ $[14] = t9;
76
+ } else t9 = $[14];
75
77
  let t10;
76
- if ($[14] !== characterCount || $[15] !== characterLimitLabel || $[16] !== description || $[17] !== error || $[18] !== props$1.maxLength) {
78
+ if ($[15] !== characterCount || $[16] !== characterLimitLabel || $[17] !== description || $[18] !== error || $[19] !== props$1.maxLength) {
77
79
  t10 = /* @__PURE__ */ jsx(FieldMessage, {
78
80
  characterCount,
79
81
  characterLimitLabel,
@@ -81,15 +83,15 @@ function TextField$1(t0) {
81
83
  error,
82
84
  maxLength: props$1.maxLength
83
85
  });
84
- $[14] = characterCount;
85
- $[15] = characterLimitLabel;
86
- $[16] = description;
87
- $[17] = error;
88
- $[18] = props$1.maxLength;
89
- $[19] = t10;
90
- } else t10 = $[19];
86
+ $[15] = characterCount;
87
+ $[16] = characterLimitLabel;
88
+ $[17] = description;
89
+ $[18] = error;
90
+ $[19] = props$1.maxLength;
91
+ $[20] = t10;
92
+ } else t10 = $[20];
91
93
  let t11;
92
- if ($[20] !== T0 || $[21] !== isDisabled || $[22] !== props$1 || $[23] !== t10 || $[24] !== t6 || $[25] !== t7 || $[26] !== t9 || $[27] !== validationBehavior) {
94
+ if ($[21] !== T0 || $[22] !== isDisabled || $[23] !== props$1 || $[24] !== t10 || $[25] !== t6 || $[26] !== t7 || $[27] !== t9 || $[28] !== validationBehavior) {
93
95
  t11 = /* @__PURE__ */ jsxs(T0, {
94
96
  isDisabled,
95
97
  isInvalid: t6,
@@ -98,16 +100,16 @@ function TextField$1(t0) {
98
100
  ...t7,
99
101
  children: [t9, t10]
100
102
  });
101
- $[20] = T0;
102
- $[21] = isDisabled;
103
- $[22] = props$1;
104
- $[23] = t10;
105
- $[24] = t6;
106
- $[25] = t7;
107
- $[26] = t9;
108
- $[27] = validationBehavior;
109
- $[28] = t11;
110
- } else t11 = $[28];
103
+ $[21] = T0;
104
+ $[22] = isDisabled;
105
+ $[23] = props$1;
106
+ $[24] = t10;
107
+ $[25] = t6;
108
+ $[26] = t7;
109
+ $[27] = t9;
110
+ $[28] = validationBehavior;
111
+ $[29] = t11;
112
+ } else t11 = $[29];
111
113
  return t11;
112
114
  }
113
115
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","TextFieldProps","RACTextFieldProps","stylex","TextField","RACTextField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","characterCount","characterLimitLabel","description","error","floatingLabel","inputRef","HTMLInputElement","label","leadingIcon","numeric","prefix","suffix","trailingIcon","variant","Omit","t0","$","t1","t2","isDisabled","t3","t4","t5","props","undefined","validationBehavior","T0","t6","t7","root","t8","t9","t10","maxLength","t11","TextField","_c","props","RACTextField","stylex.props"],"sources":["../../../src/components/text-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\ntype TextFieldProps = {\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces.\n * @default `Up to ${maxLength} characters`, singular for a limit of one\n */\n characterLimitLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, 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 * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field is for. Required rather than optional: a text field with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em`\n * takes that size from the slot.\n */\n leadingIcon?: ReactNode;\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, in the muted role, shown while the\n * field is focused or holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, in the muted role, shown while the\n * field is focused or holds a value.\n */\n suffix?: ReactNode;\n /**\n * An icon at the end of the box, after the value: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: 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 — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'prefix' | 'validationBehavior'>;\n\n/**\n * A labelled single-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * The text fields page's configurations are props: `leadingIcon` and\n * `trailingIcon` at the box's ends, `prefix` and `suffix` on the value's\n * line, and `characterCount` opposite the supporting text, counting against\n * `maxLength`.\n *\n * The box, label, input and message are the field chrome in `src/field`,\n * shared with every other field; this component is what React Aria's\n * `TextField` puts around them.\n */\nfunction TextField({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n numeric = false,\n prefix,\n suffix,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextFieldProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput numeric={numeric} prefix={prefix} ref={inputRef} suffix={suffix} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type { TextFieldProps };\nexport default TextField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,SAAAQ,YAAAyB,IAAA;CAAA,MAAAC,IAAAjC,EAAA,EAAA;CAAmB,MAAA,EAAAiB,gBAAAiB,IAAAhB,qBAAAC,aAAAC,OAAAC,eAAAc,IAAAb,UAAAc,YAAAC,IAAAb,OAAAC,aAAAC,SAAAY,IAAAX,QAAAC,QAAAC,cAAAC,SAAAS,IAAA,GAAAC,YAAAR;CACjB,MAAAf,iBAAAiB,OAAAO,KAAAA,IAAA,QAAAP;CAIA,MAAAb,gBAAAc,OAAAM,KAAAA,IAAA,OAAAN;CAEA,MAAAC,aAAAC,OAAAI,KAAAA,IAAA,QAAAJ;CAGA,MAAAX,UAAAY,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAR,UAAAS,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2B3B,2BAA2B;CAC9C,MAAA4B,KAAAnC;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AAgB,EAAA,MAAAf;EAAAe,EAAA,MAAAd;EAAAc,EAAA,MAAAb;EAAAa,EAAA,MAAAO,QAAAU;EAAAjB,EAAA,MAAAgB;CAAA,OAAAA,MAAAhB,EAAA;CAAA,IAAAkB;CAAA,IAAAlB,EAAA,QAAAU,MAAAV,EAAA,QAAAG,cAAAH,EAAA,QAAAO,WAAAP,EAAA,QAAAgB,OAAAhB,EAAA,QAAAW,MAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAe,MAAAf,EAAA,QAAAS,oBAAA;EAJ3JS,MAAA,qBAAC,IAAD;GAA0Bf;GAAuB,WAAAQ;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA5H,UAAA,CACHG,IAGAC,GAJgB;;EAKHhB,EAAA,MAAAU;EAAAV,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAgB;EAAAhB,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAe;EAAAf,EAAA,MAAAS;EAAAT,EAAA,MAAAkB;CAAA,OAAAA,MAAAlB,EAAA;CAAA,OALVkB;AAKU"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","TextFieldProps","RACTextFieldProps","stylex","TextField","RACTextField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","Omit","characterCount","characterLimitLabel","description","error","floatingLabel","inputRef","HTMLInputElement","label","leadingIcon","numeric","prefix","suffix","trailingIcon","variant","t0","$","t1","t2","isDisabled","t3","t4","t5","props","undefined","validationBehavior","T0","t6","t7","root","t8","t9","isRequired","t10","maxLength","t11","TextField","_c","props","RACTextField","stylex.props"],"sources":["../../../src/components/text-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { TextFieldProps as RACTextFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { TextField as RACTextField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\ntype TextFieldProps = Omit<RACTextFieldProps, 'children' | 'isInvalid' | 'prefix' | 'validationBehavior'> & {\n /**\n * Whether to count the characters the field holds at the end of the\n * supporting line, against `maxLength` where there is one, as the text\n * fields page's character counter does. The count is written in the\n * `I18nProvider`'s digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * Read with the field on focus rather than as the value changes, so it\n * names the limit and not what is left of it. The visible count is hidden\n * from the tree, which is what this replaces. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, 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 * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field is for. Required rather than optional: a text field with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em`\n * takes that size from the slot.\n */\n leadingIcon?: ReactNode;\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, in the muted role, shown while the\n * field is focused or holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, in the muted role, shown while the\n * field is focused or holds a value.\n */\n suffix?: ReactNode;\n /**\n * An icon at the end of the box, after the value: the page's 24dp trailing\n * icon, in the muted role and the error role while the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: 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 — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A labelled single-line input. Its value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue` to let it keep its own — and\n * `onChange` is handed the string, not the event. The call site's\n * `className` and `style` land on the field as a whole, which is the element\n * a layout positions.\n *\n * The text fields page's configurations are props: `leadingIcon` and\n * `trailingIcon` at the box's ends, `prefix` and `suffix` on the value's\n * line, and `characterCount` opposite the supporting text, counting against\n * `maxLength`.\n *\n * The box, label, input and message are the field chrome in `src/field`,\n * shared with every other field; this component is what React Aria's\n * `TextField` puts around them.\n */\nfunction TextField({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n numeric = false,\n prefix,\n suffix,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TextFieldProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTextField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput numeric={numeric} prefix={prefix} ref={inputRef} suffix={suffix} />\n </FieldBox>\n <FieldMessage characterCount={characterCount} characterLimitLabel={characterLimitLabel} description={description} error={error} maxLength={props.maxLength} />\n </RACTextField>;\n}\nexport type {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