@kanso-labs/kanso-ui 0.45.21 → 0.45.23

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 (269) hide show
  1. package/dist/badge/index.js.map +1 -1
  2. package/dist/button/context.js.map +1 -1
  3. package/dist/button/group.js.map +1 -1
  4. package/dist/button/hooks.js.map +1 -1
  5. package/dist/button/index.d.ts +3 -4
  6. package/dist/button/index.js.map +1 -1
  7. package/dist/button/styles.js.map +1 -1
  8. package/dist/button/toggle.js.map +1 -1
  9. package/dist/calendar/index.js +119 -11
  10. package/dist/calendar/index.js.map +1 -1
  11. package/dist/calendar/styles.js +19 -1
  12. package/dist/calendar/styles.js.map +1 -1
  13. package/dist/carousel/arrangement.d.ts +1 -2
  14. package/dist/carousel/arrangement.js.map +1 -1
  15. package/dist/chip/index.js.map +1 -1
  16. package/dist/chip/label.js.map +1 -1
  17. package/dist/chip/styles.js.map +1 -1
  18. package/dist/collection/empty.js.map +1 -1
  19. package/dist/collection/index.js.map +1 -1
  20. package/dist/collection/styles.js.map +1 -1
  21. package/dist/collection/text.js.map +1 -1
  22. package/dist/color-scheme.d.ts +1 -2
  23. package/dist/color-scheme.js.map +1 -1
  24. package/dist/components/app-bar/index.d.ts +9 -4
  25. package/dist/components/app-bar/index.js +123 -73
  26. package/dist/components/app-bar/index.js.map +1 -1
  27. package/dist/components/autocomplete/index.d.ts +1 -2
  28. package/dist/components/autocomplete/index.js.map +1 -1
  29. package/dist/components/avatar/index.d.ts +1 -2
  30. package/dist/components/avatar/index.js.map +1 -1
  31. package/dist/components/badge/index.d.ts +1 -2
  32. package/dist/components/badge/index.js.map +1 -1
  33. package/dist/components/breadcrumbs/index.d.ts +1 -2
  34. package/dist/components/breadcrumbs/index.js.map +1 -1
  35. package/dist/components/button/index.d.ts +1 -2
  36. package/dist/components/button/index.js.map +1 -1
  37. package/dist/components/button-group/index.d.ts +1 -2
  38. package/dist/components/button-group/index.js.map +1 -1
  39. package/dist/components/calendar/index.d.ts +4 -5
  40. package/dist/components/calendar/index.js +8 -19
  41. package/dist/components/calendar/index.js.map +1 -1
  42. package/dist/components/card/index.d.ts +1 -2
  43. package/dist/components/card/index.js.map +1 -1
  44. package/dist/components/carousel/index.d.ts +22 -4
  45. package/dist/components/carousel/index.js +26 -14
  46. package/dist/components/carousel/index.js.map +1 -1
  47. package/dist/components/checkbox/index.d.ts +1 -2
  48. package/dist/components/checkbox/index.js.map +1 -1
  49. package/dist/components/checkbox-group/index.d.ts +1 -2
  50. package/dist/components/checkbox-group/index.js.map +1 -1
  51. package/dist/components/chip/index.d.ts +1 -2
  52. package/dist/components/chip/index.js.map +1 -1
  53. package/dist/components/chip-group/index.d.ts +1 -2
  54. package/dist/components/chip-group/index.js +3 -0
  55. package/dist/components/chip-group/index.js.map +1 -1
  56. package/dist/components/code/index.d.ts +1 -2
  57. package/dist/components/code/index.js.map +1 -1
  58. package/dist/components/color-area/index.d.ts +1 -2
  59. package/dist/components/color-area/index.js.map +1 -1
  60. package/dist/components/color-field/index.d.ts +1 -2
  61. package/dist/components/color-field/index.js.map +1 -1
  62. package/dist/components/color-picker/index.d.ts +1 -2
  63. package/dist/components/color-picker/index.js +64 -46
  64. package/dist/components/color-picker/index.js.map +1 -1
  65. package/dist/components/color-slider/index.d.ts +1 -2
  66. package/dist/components/color-slider/index.js.map +1 -1
  67. package/dist/components/color-swatch/index.d.ts +1 -2
  68. package/dist/components/color-swatch/index.js +20 -16
  69. package/dist/components/color-swatch/index.js.map +1 -1
  70. package/dist/components/color-swatch-picker/index.d.ts +1 -2
  71. package/dist/components/color-swatch-picker/index.js.map +1 -1
  72. package/dist/components/color-wheel/index.d.ts +1 -2
  73. package/dist/components/color-wheel/index.js.map +1 -1
  74. package/dist/components/combo-box/index.d.ts +1 -2
  75. package/dist/components/combo-box/index.js.map +1 -1
  76. package/dist/components/container/index.d.ts +1 -2
  77. package/dist/components/container/index.js.map +1 -1
  78. package/dist/components/copy-field/index.d.ts +1 -2
  79. package/dist/components/copy-field/index.js +1 -0
  80. package/dist/components/copy-field/index.js.map +1 -1
  81. package/dist/components/currency/index.d.ts +1 -2
  82. package/dist/components/currency/index.js.map +1 -1
  83. package/dist/components/date-field/index.d.ts +1 -2
  84. package/dist/components/date-field/index.js.map +1 -1
  85. package/dist/components/date-picker/index.d.ts +1 -2
  86. package/dist/components/date-picker/index.js.map +1 -1
  87. package/dist/components/date-range-picker/index.d.ts +1 -2
  88. package/dist/components/date-range-picker/index.js +165 -81
  89. package/dist/components/date-range-picker/index.js.map +1 -1
  90. package/dist/components/dialog/index.d.ts +1 -2
  91. package/dist/components/dialog/index.js.map +1 -1
  92. package/dist/components/disclosure/index.d.ts +1 -2
  93. package/dist/components/disclosure/index.js.map +1 -1
  94. package/dist/components/disclosure-group/index.d.ts +1 -2
  95. package/dist/components/disclosure-group/index.js.map +1 -1
  96. package/dist/components/drop-zone/index.d.ts +1 -2
  97. package/dist/components/drop-zone/index.js.map +1 -1
  98. package/dist/components/drop-zone/styles.js.map +1 -1
  99. package/dist/components/fab/index.d.ts +1 -2
  100. package/dist/components/fab/index.js.map +1 -1
  101. package/dist/components/fab-menu/index.d.ts +1 -2
  102. package/dist/components/fab-menu/index.js.map +1 -1
  103. package/dist/components/feed/index.d.ts +1 -2
  104. package/dist/components/feed/index.js.map +1 -1
  105. package/dist/components/form/index.d.ts +1 -2
  106. package/dist/components/form/index.js.map +1 -1
  107. package/dist/components/icon-button/index.d.ts +1 -2
  108. package/dist/components/icon-button/index.js.map +1 -1
  109. package/dist/components/index.d.ts +2 -2
  110. package/dist/components/keycap/index.d.ts +1 -2
  111. package/dist/components/keycap/index.js.map +1 -1
  112. package/dist/components/link/index.d.ts +1 -2
  113. package/dist/components/link/index.js.map +1 -1
  114. package/dist/components/list/index.d.ts +1 -2
  115. package/dist/components/list/index.js.map +1 -1
  116. package/dist/components/list-box/index.d.ts +1 -2
  117. package/dist/components/list-box/index.js.map +1 -1
  118. package/dist/components/list-detail/index.d.ts +1 -2
  119. package/dist/components/list-detail/index.js.map +1 -1
  120. package/dist/components/list-item/index.d.ts +1 -2
  121. package/dist/components/list-item/index.js.map +1 -1
  122. package/dist/components/loading-indicator/index.d.ts +1 -2
  123. package/dist/components/loading-indicator/index.js.map +1 -1
  124. package/dist/components/menu/index.d.ts +1 -2
  125. package/dist/components/menu/index.js.map +1 -1
  126. package/dist/components/meter/index.d.ts +1 -2
  127. package/dist/components/meter/index.js.map +1 -1
  128. package/dist/components/navigation-bar/index.d.ts +1 -2
  129. package/dist/components/navigation-bar/index.js.map +1 -1
  130. package/dist/components/navigation-rail/index.d.ts +1 -2
  131. package/dist/components/navigation-rail/index.js.map +1 -1
  132. package/dist/components/navigation-tree/index.d.ts +1 -2
  133. package/dist/components/navigation-tree/index.js.map +1 -1
  134. package/dist/components/number-field/index.d.ts +1 -2
  135. package/dist/components/number-field/index.js.map +1 -1
  136. package/dist/components/popover/index.d.ts +1 -2
  137. package/dist/components/popover/index.js +14 -4
  138. package/dist/components/popover/index.js.map +1 -1
  139. package/dist/components/product-icon/index.d.ts +1 -2
  140. package/dist/components/product-icon/index.js.map +1 -1
  141. package/dist/components/progress-indicator/index.d.ts +1 -2
  142. package/dist/components/progress-indicator/index.js.map +1 -1
  143. package/dist/components/radio-group/index.d.ts +1 -2
  144. package/dist/components/radio-group/index.js.map +1 -1
  145. package/dist/components/range-calendar/index.d.ts +1 -2
  146. package/dist/components/range-calendar/index.js +53 -80
  147. package/dist/components/range-calendar/index.js.map +1 -1
  148. package/dist/components/search-field/index.d.ts +1 -2
  149. package/dist/components/search-field/index.js.map +1 -1
  150. package/dist/components/search-view/index.d.ts +1 -2
  151. package/dist/components/search-view/index.js.map +1 -1
  152. package/dist/components/segmented-button/index.d.ts +1 -2
  153. package/dist/components/segmented-button/index.js +261 -145
  154. package/dist/components/segmented-button/index.js.map +1 -1
  155. package/dist/components/select/index.d.ts +1 -2
  156. package/dist/components/select/index.js.map +1 -1
  157. package/dist/components/separator/index.d.ts +1 -2
  158. package/dist/components/separator/index.js.map +1 -1
  159. package/dist/components/sheet/index.d.ts +1 -2
  160. package/dist/components/sheet/index.js +149 -82
  161. package/dist/components/sheet/index.js.map +1 -1
  162. package/dist/components/slider/index.d.ts +1 -2
  163. package/dist/components/slider/index.js.map +1 -1
  164. package/dist/components/snackbar/index.d.ts +1 -2
  165. package/dist/components/snackbar/index.js.map +1 -1
  166. package/dist/components/split-button/index.d.ts +1 -2
  167. package/dist/components/split-button/index.js.map +1 -1
  168. package/dist/components/stack/index.d.ts +1 -2
  169. package/dist/components/stack/index.js.map +1 -1
  170. package/dist/components/supporting-pane/index.d.ts +1 -2
  171. package/dist/components/supporting-pane/index.js.map +1 -1
  172. package/dist/components/switch/index.d.ts +1 -2
  173. package/dist/components/switch/index.js.map +1 -1
  174. package/dist/components/table/index.d.ts +1 -2
  175. package/dist/components/table/index.js +251 -123
  176. package/dist/components/table/index.js.map +1 -1
  177. package/dist/components/tabs/index.d.ts +1 -2
  178. package/dist/components/tabs/index.js.map +1 -1
  179. package/dist/components/tag/index.d.ts +1 -2
  180. package/dist/components/tag/index.js.map +1 -1
  181. package/dist/components/text/index.d.ts +1 -2
  182. package/dist/components/text/index.js.map +1 -1
  183. package/dist/components/text-area/index.d.ts +1 -2
  184. package/dist/components/text-area/index.js.map +1 -1
  185. package/dist/components/text-field/index.d.ts +1 -2
  186. package/dist/components/text-field/index.js.map +1 -1
  187. package/dist/components/time-field/index.d.ts +1 -2
  188. package/dist/components/time-field/index.js.map +1 -1
  189. package/dist/components/time-picker/index.d.ts +1 -2
  190. package/dist/components/time-picker/index.js.map +1 -1
  191. package/dist/components/token-field/index.d.ts +1 -2
  192. package/dist/components/token-field/index.js.map +1 -1
  193. package/dist/components/toolbar/index.d.ts +1 -2
  194. package/dist/components/toolbar/index.js.map +1 -1
  195. package/dist/components/tooltip/index.d.ts +1 -2
  196. package/dist/components/tooltip/index.js.map +1 -1
  197. package/dist/components/tree/index.d.ts +1 -2
  198. package/dist/components/tree/index.js.map +1 -1
  199. package/dist/control/index.js.map +1 -1
  200. package/dist/control/styles.js.map +1 -1
  201. package/dist/drag/hooks.d.ts +1 -2
  202. package/dist/drag/hooks.js.map +1 -1
  203. package/dist/drag/index.js.map +1 -1
  204. package/dist/drag/styles.js.map +1 -1
  205. package/dist/fab/styles.js.map +1 -1
  206. package/dist/field/index.d.ts +3 -4
  207. package/dist/field/index.js.map +1 -1
  208. package/dist/field/press.js.map +1 -1
  209. package/dist/field/root.js.map +1 -1
  210. package/dist/field/styles.js.map +1 -1
  211. package/dist/glyphs/index.js.map +1 -1
  212. package/dist/glyphs/styles.js.map +1 -1
  213. package/dist/hooks/useAppBarScroll.d.ts +1 -2
  214. package/dist/hooks/useAppBarScroll.js.map +1 -1
  215. package/dist/hooks/useBottomEdge.js.map +1 -1
  216. package/dist/hooks/useClippedTitle.js.map +1 -1
  217. package/dist/hooks/useImageLoadingStatus.js.map +1 -1
  218. package/dist/hooks/useRipple.js +3 -2
  219. package/dist/hooks/useRipple.js.map +1 -1
  220. package/dist/hooks/useScrollStop.js.map +1 -1
  221. package/dist/hooks/useToggleGroupDisabled.js.map +1 -1
  222. package/dist/i18n/index.js.map +1 -1
  223. package/dist/i18n/messages.js.map +1 -1
  224. package/dist/index.d.ts +2 -2
  225. package/dist/indicator/index.js.map +1 -1
  226. package/dist/indicator/styles.d.ts +1 -2
  227. package/dist/indicator/styles.js.map +1 -1
  228. package/dist/kanso-ui-core/defaults-DMH0HWCw.d.ts +1 -2
  229. package/dist/keycap/context.js.map +1 -1
  230. package/dist/layout.d.ts +1 -2
  231. package/dist/layout.js.map +1 -1
  232. package/dist/mark/index.js.map +1 -1
  233. package/dist/mark/initials.js.map +1 -1
  234. package/dist/mark/styles.js.map +1 -1
  235. package/dist/navigation/context.js.map +1 -1
  236. package/dist/navigation/index.d.ts +2 -3
  237. package/dist/navigation/index.js.map +1 -1
  238. package/dist/navigation/styles.js.map +1 -1
  239. package/dist/overlay/index.js.map +1 -1
  240. package/dist/render/aria.js.map +1 -1
  241. package/dist/render/content.js.map +1 -1
  242. package/dist/render/name.d.ts +1 -2
  243. package/dist/render/ref.js.map +1 -1
  244. package/dist/render/useRender.d.ts +1 -2
  245. package/dist/render/useRender.js.map +1 -1
  246. package/dist/row/index.js.map +1 -1
  247. package/dist/row/styles.js.map +1 -1
  248. package/dist/segments/index.js +2 -1
  249. package/dist/segments/index.js.map +1 -1
  250. package/dist/segments/styles.js +5 -1
  251. package/dist/segments/styles.js.map +1 -1
  252. package/dist/styles/chequer.js.map +1 -1
  253. package/dist/styles/color.js.map +1 -1
  254. package/dist/styles/focus.js.map +1 -1
  255. package/dist/styles/icon-button.js.map +1 -1
  256. package/dist/styles/merge.js.map +1 -1
  257. package/dist/styles/overlay.d.ts +2 -3
  258. package/dist/styles/overlay.js.map +1 -1
  259. package/dist/styles/picker.js.map +1 -1
  260. package/dist/styles/ripple.js.map +1 -1
  261. package/dist/styles/scheme.js.map +1 -1
  262. package/dist/styles.css +40 -8
  263. package/dist/swatch/index.js +19 -0
  264. package/dist/swatch/index.js.map +1 -0
  265. package/dist/theme-scope.d.ts +1 -2
  266. package/dist/theme-scope.js.map +1 -1
  267. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  268. package/dist/tokens/values.js.map +1 -1
  269. package/package.json +16 -16
@@ -1,4 +1,4 @@
1
- import { ReactNode, RefAttributes } from "react";
1
+ import { ReactNode } from "react";
2
2
  import { LinkProps } from "react-aria-components";
3
3
  type NavigationItemProps = {
4
4
  /**
@@ -36,5 +36,4 @@ type NavigationItemProps = {
36
36
  /** A function may compute the style from the destination's render state. */
37
37
  style?: LinkProps['style'];
38
38
  } & Omit<LinkProps, 'children' | 'className' | 'href' | 'style'>;
39
- export type { NavigationItemProps };
40
- //# sourceMappingURL=index.d.ts.map
39
+ export type { NavigationItemProps };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","RefAttributes","FocusableElement","LinkRenderProps","LinkProps","RACLinkProps","stylex","useContext","useId","Link","RACLink","NavigationForm","BadgeMarkContext","Badge","useClippedTitle","useRipple","focus","mergeStatefulStyles","NavigationContext","barItemStyles","collapsedItemStyles","crampedBarItemStyles","expandedItemStyles","navigationItemStyles","navigationListStyles","FORMS","bar","barCramped","item","list","listItem","collapsed","expanded","RINGS","indicator","indicatorRing","itemRing","ringVisible","Naming","badgeId","badgeLabel","labelId","NavigationItemProps","badge","children","className","href","icon","isCurrent","style","Omit","itemClasses","form","styles","state","props","link","fade","itemCurrent","isHovered","itemHoveredCurrent","itemHovered","isFocusVisible","itemFocusedCurrent","itemFocused","isPressed","itemPressedCurrent","itemPressed","isDisabled","itemDisabled","itemContent","label","naming","ripple","glyph","undefined","badgeMark","pill","indicatorCurrent","indicatorHoveredCurrent","indicatorHovered","indicatorFocusedCurrent","indicatorFocused","indicatorPressedCurrent","indicatorPressed","labelCurrent","NavigationItem","t0","$","_c","isCurrentProp","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","selectedRoute","t1","t2","T0","t3","t4","t5","handlers","t6","t7","surface","t8","t9","NavigationLabel","id","styling","clipped","NavigationList","layout","stylex.props","_c","props","RACLink"],"sources":["../../src/navigation/index.tsx"],"sourcesContent":["import type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, LinkRenderProps, LinkProps as RACLinkProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useId } from 'react';\nimport { Link as RACLink } from 'react-aria-components';\nimport type { NavigationForm } from './context';\nimport { BadgeMarkContext } from '../badge';\nimport Badge from '../components/badge';\nimport { useClippedTitle } from '../hooks/useClippedTitle';\nimport { useRipple } from '../hooks/useRipple';\nimport { focus } from '../styles/focus';\nimport { mergeStatefulStyles } from '../styles/merge';\nimport { NavigationContext } from './context';\nimport { barItemStyles, collapsedItemStyles, crampedBarItemStyles, expandedItemStyles, navigationItemStyles, navigationListStyles } from './styles';\n\n// The destination NavigationBar and NavigationRail both render, and the\n// context each hands it: which of the three forms to draw and which route is\n// current. See ./styles.ts for the forms.\n//\n// A destination is a link — it goes somewhere, rather than selecting\n// something — so it is React Aria's `Link`, which routes through a\n// `RouterProvider` when an app has one. The current one is the one whose\n// `href` is the bar's or the rail's `selectedRoute`, the same matching\n// NavigationTree does, and it carries `aria-current=\"page\"`. A destination's\n// own `isCurrent` overrides that match, which is how an app on a route\n// nested under a destination marks the destination it is under: the match\n// is exact, and a top-level destination's `href` is rarely the whole route.\n// The attribute, the indicator and the label all read the one answer.\n//\n// A badge is hidden from assistive technology — see the Badge component for\n// why — so what it says reaches the link's name through `badgeLabel`: the\n// link is named by its label and that text together, through\n// `aria-labelledby`, rather than by an `aria-label` the call site would keep\n// in step with both the label and the count, in every language. The text\n// sits in a hidden span beside the badge, which a name can still be read\n// from, so the label's own text and the width the bar measures it at are\n// untouched. An `aria-label` or `aria-labelledby` the call site passes still\n// names the link instead.\n//\n// The destinations are a list, each in an item of its own, which is what has\n// a screen reader say how many there are and which one it is on, as the\n// WAI-ARIA navigation examples do. The bar and the rail draw the list, and\n// each destination draws its item: the item takes the destination's place in\n// the row or the column, and the link fills it, so the class, the ref and\n// `aria-current` stay on the link.\n\nconst FORMS = {\n bar: barItemStyles,\n barCramped: {\n ...collapsedItemStyles,\n item: crampedBarItemStyles.item,\n list: crampedBarItemStyles.list,\n listItem: crampedBarItemStyles.listItem\n },\n collapsed: collapsedItemStyles,\n expanded: expandedItemStyles\n};\n\n// The focus ring goes around the pill, wherever a form draws it: the\n// indicator in a vertical destination, the whole destination in a horizontal\n// one. The rail's two forms take the library's shared ring. The bar's pill\n// moves from one element to the other at the medium breakpoint, so its rings\n// are its own, each giving way at the width the other takes over.\nconst RINGS = {\n bar: {\n indicator: barItemStyles.indicatorRing,\n item: barItemStyles.itemRing\n },\n barCramped: {\n indicator: focus.ringVisible,\n item: null\n },\n collapsed: {\n indicator: focus.ringVisible,\n item: null\n },\n expanded: {\n indicator: null,\n item: focus.ringVisible\n }\n};\n\n// The ids a destination naming its badge gives its label and the badge's\n// words, which its link is labelled by.\ntype Naming = {\n badgeId: string;\n badgeLabel: string;\n labelId: string;\n};\ntype NavigationItemProps = {\n /**\n * A badge on the icon: `true` for the badges page's small dot, a number\n * for the large badge holding it. The badge is hidden from assistive\n * technology, so say what it says in `badgeLabel`.\n */\n badge?: boolean | number;\n /**\n * What the badge says, in words and in the reader's language — \"3 new\",\n * or \"new\" for the dot. It follows the label in the destination's\n * accessible name, \"First item 3 new\", and is read only while the badge is\n * drawn.\n */\n badgeLabel?: string;\n /** The destination's name, drawn as its label. */\n children: ReactNode;\n /** A function may compute the class from the destination's render state. */\n className?: RACLinkProps['className'];\n /**\n * Where the destination goes, and what the bar's or the rail's\n * `selectedRoute` is matched against.\n */\n href: string;\n /** The destination's icon, at the pages' 24dp. */\n icon: ReactNode;\n /**\n * Whether this is the current destination, in place of matching its\n * `href` against the bar's or the rail's `selectedRoute`. Pass it for a\n * route nested under the destination, `/first/42` under `/first`, which\n * the exact match leaves without a current destination; `false` turns\n * the match off. Left out, the match decides.\n */\n isCurrent?: boolean;\n /** A function may compute the style from the destination's render state. */\n style?: RACLinkProps['style'];\n} & Omit<RACLinkProps, 'children' | 'className' | 'href' | 'style'>;\n\n// A destination's own classes, from React Aria's render state: the pill in a\n// horizontal form, and the layers over it.\nfunction itemClasses(form: NavigationForm, isCurrent: boolean) {\n const styles = FORMS[form];\n return (state: LinkRenderProps) => stylex.props(navigationItemStyles.link, navigationItemStyles.fade, styles.item, isCurrent && styles.itemCurrent, state.isHovered && (isCurrent ? styles.itemHoveredCurrent : styles.itemHovered), state.isFocusVisible && (isCurrent ? styles.itemFocusedCurrent : styles.itemFocused), state.isPressed && (isCurrent ? styles.itemPressedCurrent : styles.itemPressed), state.isFocusVisible && RINGS[form].item, state.isDisabled && navigationItemStyles.itemDisabled);\n}\n\n// What a destination draws, from React Aria's render state: the indicator\n// holding the icon and the press ripple, and the label beside or under it.\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.\n//\n// The ripple comes first, so a count badge drawn after it stays over it.\nfunction itemContent(form: NavigationForm, isCurrent: boolean, badge: boolean | number | undefined, icon: ReactNode, label: ReactNode, naming: Naming | undefined, ripple: ReactNode) {\n const styles = FORMS[form];\n const glyph = badge === undefined || badge === false ? icon : <BadgeMarkContext value={styles.badgeMark}>\n <Badge count={badge === true ? undefined : badge}>{icon}</Badge>\n </BadgeMarkContext>;\n return (state: LinkRenderProps) => <>\n <span {...stylex.props(navigationItemStyles.pill, navigationItemStyles.fade, styles.indicator, isCurrent && styles.indicatorCurrent, state.isHovered && (isCurrent ? styles.indicatorHoveredCurrent : styles.indicatorHovered), state.isFocusVisible && (isCurrent ? styles.indicatorFocusedCurrent : styles.indicatorFocused), state.isPressed && (isCurrent ? styles.indicatorPressedCurrent : styles.indicatorPressed), state.isFocusVisible && RINGS[form].indicator, state.isDisabled && navigationItemStyles.itemDisabled)}>\n {ripple}\n <span {...stylex.props(navigationItemStyles.icon)}>{glyph}</span>\n {naming && <span hidden id={naming.badgeId}>\n {naming.badgeLabel}\n </span>}\n </span>\n <NavigationLabel id={naming?.labelId} styling={stylex.props(navigationItemStyles.label, navigationItemStyles.fade, styles.label, isCurrent && styles.labelCurrent, state.isDisabled && navigationItemStyles.itemDisabled)}>\n {label}\n </NavigationLabel>\n </>;\n}\n\n/**\n * One destination in a navigation bar or rail: an icon, a label and, when\n * it is the current one, the active indicator behind them.\n */\nfunction NavigationItem({\n badge,\n badgeLabel,\n children,\n href,\n icon,\n isCurrent: isCurrentProp,\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n ...props\n}: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n const {\n form,\n selectedRoute\n } = useContext(NavigationContext);\n // The call site's handlers run after the ripple's own.\n const ripple = useRipple<FocusableElement>(props.isDisabled !== true, {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n });\n const isCurrent = isCurrentProp ?? (selectedRoute !== undefined && href === selectedRoute);\n const labelId = useId();\n const badgeId = useId();\n // Only while the badge is drawn, and only where the call site names the\n // link no other way.\n const naming = badge !== undefined && badge !== false && badgeLabel !== undefined && props['aria-label'] === undefined && props['aria-labelledby'] === undefined ? {\n badgeId,\n badgeLabel,\n labelId\n } : undefined;\n return <li {...stylex.props(navigationListStyles.item, FORMS[form].listItem)}>\n <RACLink aria-current={isCurrent ? 'page' : undefined} aria-labelledby={naming && `${naming.labelId} ${naming.badgeId}`} href={href} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemClasses(form, isCurrent), props)}>\n {itemContent(form, isCurrent, badge, icon, children, naming, ripple.surface)}\n </RACLink>\n </li>;\n}\n\n// The label, kept to one line, which shows its full text in the browser's\n// tooltip on hover once it is cut short — see `useClippedTitle`. A component\n// because the title is state, and `itemContent` runs inside React Aria's\n// render function.\nfunction NavigationLabel({\n children,\n id,\n styling\n}: {\n children: ReactNode;\n id: string | undefined;\n styling: ReturnType<typeof stylex.props>;\n}) {\n const clipped = useClippedTitle(children);\n return <span {...clipped} id={id} {...styling}>\n {children}\n </span>;\n}\n\n/**\n * The list a bar or a rail holds its destinations in, laid out as `layout`\n * says, the bar's row or the rail's column, with the space between them its\n * form's.\n */\nfunction NavigationList({\n children,\n layout\n}: {\n children: ReactNode;\n layout: stylex.StyleXStyles;\n}) {\n const {\n form\n } = useContext(NavigationContext);\n return <ul\n // oxlint-disable-next-line jsx-a11y/no-redundant-roles -- Safari's VoiceOver drops the role once the markers are cleared\n role=\"list\" {...stylex.props(navigationListStyles.list, layout, FORMS[form].list)}>\n {children}\n </ul>;\n}\nexport type { NavigationItemProps };\nexport { NavigationItem, NavigationList };"],"mappings":";;;;;;;;;;;;;;AA8CA,MAAMyB,QAAQ;CACZC,KAAKP;CACLQ,YAAY;EACV,GAAGP;EACHQ,MAAMP,qBAAqBO;EAC3BC,MAAMR,qBAAqBQ;EAC3BC,UAAUT,qBAAqBS;CACjC;CACA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AAE,IAAAgF;CAAA,IAAAV,EAAA,OAAApC,QAAAoC,EAAA,OAAA2B,QAAA;EAGlBjB,KAAA5F,MAAakB,qBAAoBK,MAAOsF,QAAQ1F,MAAM2B,KAAK,CAAAvB,IAAK;EAAC2D,EAAA,KAAApC;EAAAoC,EAAA,KAAA2B;EAAA3B,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAA5C,YAAA4C,EAAA,OAAAU,IAAA;EAF1EC,KAAA,oBAAA,MAAA;GAEF,MAAA;GAAM,GAAKD;GACXtD;EACE,CAAA;EAAA4C,EAAA,KAAA5C;EAAA4C,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAJAW;AAIA"}
1
+ {"version":3,"file":"index.js","names":["stylex","useContext","useId","RACLink","useClippedTitle","useRipple","focus","mergeStatefulStyles","NavigationContext","barItemStyles","collapsedItemStyles","crampedBarItemStyles","expandedItemStyles","navigationItemStyles","navigationListStyles","FORMS","bar","barCramped","item","list","listItem","collapsed","expanded","RINGS","indicator","indicatorRing","itemRing","ringVisible","badgeId","badgeLabel","labelId","badge","children","href","icon","isCurrent","itemClasses","form","styles","state","props","link","fade","itemCurrent","isHovered","itemHoveredCurrent","itemHovered","isFocusVisible","itemFocusedCurrent","itemFocused","isPressed","itemPressedCurrent","itemPressed","isDisabled","itemDisabled","itemContent","label","naming","ripple","glyph","undefined","badgeMark","pill","indicatorCurrent","indicatorHoveredCurrent","indicatorHovered","indicatorFocusedCurrent","indicatorFocused","indicatorPressedCurrent","indicatorPressed","labelCurrent","NavigationItem","t0","$","_c","isCurrentProp","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","selectedRoute","t1","t2","T0","t3","t4","t5","handlers","t6","t7","surface","t8","t9","NavigationLabel","id","styling","clipped","NavigationList","layout"],"sources":["../../src/navigation/index.tsx"],"sourcesContent":["import type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, LinkRenderProps, LinkProps as RACLinkProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useId } from 'react';\nimport { Link as RACLink } from 'react-aria-components';\nimport type { NavigationForm } from './context';\nimport { BadgeMarkContext } from '../badge';\nimport Badge from '../components/badge';\nimport { useClippedTitle } from '../hooks/useClippedTitle';\nimport { useRipple } from '../hooks/useRipple';\nimport { focus } from '../styles/focus';\nimport { mergeStatefulStyles } from '../styles/merge';\nimport { NavigationContext } from './context';\nimport { barItemStyles, collapsedItemStyles, crampedBarItemStyles, expandedItemStyles, navigationItemStyles, navigationListStyles } from './styles';\n\n// The destination NavigationBar and NavigationRail both render, and the\n// context each hands it: which of the three forms to draw and which route is\n// current. See ./styles.ts for the forms.\n//\n// A destination is a link — it goes somewhere, rather than selecting\n// something — so it is React Aria's `Link`, which routes through a\n// `RouterProvider` when an app has one. The current one is the one whose\n// `href` is the bar's or the rail's `selectedRoute`, the same matching\n// NavigationTree does, and it carries `aria-current=\"page\"`. A destination's\n// own `isCurrent` overrides that match, which is how an app on a route\n// nested under a destination marks the destination it is under: the match\n// is exact, and a top-level destination's `href` is rarely the whole route.\n// The attribute, the indicator and the label all read the one answer.\n//\n// A badge is hidden from assistive technology — see the Badge component for\n// why — so what it says reaches the link's name through `badgeLabel`: the\n// link is named by its label and that text together, through\n// `aria-labelledby`, rather than by an `aria-label` the call site would keep\n// in step with both the label and the count, in every language. The text\n// sits in a hidden span beside the badge, which a name can still be read\n// from, so the label's own text and the width the bar measures it at are\n// untouched. An `aria-label` or `aria-labelledby` the call site passes still\n// names the link instead.\n//\n// The destinations are a list, each in an item of its own, which is what has\n// a screen reader say how many there are and which one it is on, as the\n// WAI-ARIA navigation examples do. The bar and the rail draw the list, and\n// each destination draws its item: the item takes the destination's place in\n// the row or the column, and the link fills it, so the class, the ref and\n// `aria-current` stay on the link.\n\nconst FORMS = {\n bar: barItemStyles,\n barCramped: {\n ...collapsedItemStyles,\n item: crampedBarItemStyles.item,\n list: crampedBarItemStyles.list,\n listItem: crampedBarItemStyles.listItem\n },\n collapsed: collapsedItemStyles,\n expanded: expandedItemStyles\n};\n\n// The focus ring goes around the pill, wherever a form draws it: the\n// indicator in a vertical destination, the whole destination in a horizontal\n// one. The rail's two forms take the library's shared ring. The bar's pill\n// moves from one element to the other at the medium breakpoint, so its rings\n// are its own, each giving way at the width the other takes over.\nconst RINGS = {\n bar: {\n indicator: barItemStyles.indicatorRing,\n item: barItemStyles.itemRing\n },\n barCramped: {\n indicator: focus.ringVisible,\n item: null\n },\n collapsed: {\n indicator: focus.ringVisible,\n item: null\n },\n expanded: {\n indicator: null,\n item: focus.ringVisible\n }\n};\n\n// The ids a destination naming its badge gives its label and the badge's\n// words, which its link is labelled by.\ntype Naming = {\n badgeId: string;\n badgeLabel: string;\n labelId: string;\n};\ntype NavigationItemProps = {\n /**\n * A badge on the icon: `true` for the badges page's small dot, a number\n * for the large badge holding it. The badge is hidden from assistive\n * technology, so say what it says in `badgeLabel`.\n */\n badge?: boolean | number;\n /**\n * What the badge says, in words and in the reader's language — \"3 new\",\n * or \"new\" for the dot. It follows the label in the destination's\n * accessible name, \"First item 3 new\", and is read only while the badge is\n * drawn.\n */\n badgeLabel?: string;\n /** The destination's name, drawn as its label. */\n children: ReactNode;\n /** A function may compute the class from the destination's render state. */\n className?: RACLinkProps['className'];\n /**\n * Where the destination goes, and what the bar's or the rail's\n * `selectedRoute` is matched against.\n */\n href: string;\n /** The destination's icon, at the pages' 24dp. */\n icon: ReactNode;\n /**\n * Whether this is the current destination, in place of matching its\n * `href` against the bar's or the rail's `selectedRoute`. Pass it for a\n * route nested under the destination, `/first/42` under `/first`, which\n * the exact match leaves without a current destination; `false` turns\n * the match off. Left out, the match decides.\n */\n isCurrent?: boolean;\n /** A function may compute the style from the destination's render state. */\n style?: RACLinkProps['style'];\n} & Omit<RACLinkProps, 'children' | 'className' | 'href' | 'style'>;\n\n// A destination's own classes, from React Aria's render state: the pill in a\n// horizontal form, and the layers over it.\nfunction itemClasses(form: NavigationForm, isCurrent: boolean) {\n const styles = FORMS[form];\n return (state: LinkRenderProps) => stylex.props(navigationItemStyles.link, navigationItemStyles.fade, styles.item, isCurrent && styles.itemCurrent, state.isHovered && (isCurrent ? styles.itemHoveredCurrent : styles.itemHovered), state.isFocusVisible && (isCurrent ? styles.itemFocusedCurrent : styles.itemFocused), state.isPressed && (isCurrent ? styles.itemPressedCurrent : styles.itemPressed), state.isFocusVisible && RINGS[form].item, state.isDisabled && navigationItemStyles.itemDisabled);\n}\n\n// What a destination draws, from React Aria's render state: the indicator\n// holding the icon and the press ripple, and the label beside or under it.\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.\n//\n// The ripple comes first, so a count badge drawn after it stays over it.\nfunction itemContent(form: NavigationForm, isCurrent: boolean, badge: boolean | number | undefined, icon: ReactNode, label: ReactNode, naming: Naming | undefined, ripple: ReactNode) {\n const styles = FORMS[form];\n const glyph = badge === undefined || badge === false ? icon : <BadgeMarkContext value={styles.badgeMark}>\n <Badge count={badge === true ? undefined : badge}>{icon}</Badge>\n </BadgeMarkContext>;\n return (state: LinkRenderProps) => <>\n <span {...stylex.props(navigationItemStyles.pill, navigationItemStyles.fade, styles.indicator, isCurrent && styles.indicatorCurrent, state.isHovered && (isCurrent ? styles.indicatorHoveredCurrent : styles.indicatorHovered), state.isFocusVisible && (isCurrent ? styles.indicatorFocusedCurrent : styles.indicatorFocused), state.isPressed && (isCurrent ? styles.indicatorPressedCurrent : styles.indicatorPressed), state.isFocusVisible && RINGS[form].indicator, state.isDisabled && navigationItemStyles.itemDisabled)}>\n {ripple}\n <span {...stylex.props(navigationItemStyles.icon)}>{glyph}</span>\n {naming && <span hidden id={naming.badgeId}>\n {naming.badgeLabel}\n </span>}\n </span>\n <NavigationLabel id={naming?.labelId} styling={stylex.props(navigationItemStyles.label, navigationItemStyles.fade, styles.label, isCurrent && styles.labelCurrent, state.isDisabled && navigationItemStyles.itemDisabled)}>\n {label}\n </NavigationLabel>\n </>;\n}\n\n/**\n * One destination in a navigation bar or rail: an icon, a label and, when\n * it is the current one, the active indicator behind them.\n */\nfunction NavigationItem({\n badge,\n badgeLabel,\n children,\n href,\n icon,\n isCurrent: isCurrentProp,\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n ...props\n}: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n const {\n form,\n selectedRoute\n } = useContext(NavigationContext);\n // The call site's handlers run after the ripple's own.\n const ripple = useRipple<FocusableElement>(props.isDisabled !== true, {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n });\n const isCurrent = isCurrentProp ?? (selectedRoute !== undefined && href === selectedRoute);\n const labelId = useId();\n const badgeId = useId();\n // Only while the badge is drawn, and only where the call site names the\n // link no other way.\n const naming = badge !== undefined && badge !== false && badgeLabel !== undefined && props['aria-label'] === undefined && props['aria-labelledby'] === undefined ? {\n badgeId,\n badgeLabel,\n labelId\n } : undefined;\n return <li {...stylex.props(navigationListStyles.item, FORMS[form].listItem)}>\n <RACLink aria-current={isCurrent ? 'page' : undefined} aria-labelledby={naming && `${naming.labelId} ${naming.badgeId}`} href={href} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemClasses(form, isCurrent), props)}>\n {itemContent(form, isCurrent, badge, icon, children, naming, ripple.surface)}\n </RACLink>\n </li>;\n}\n\n// The label, kept to one line, which shows its full text in the browser's\n// tooltip on hover once it is cut short — see `useClippedTitle`. A component\n// because the title is state, and `itemContent` runs inside React Aria's\n// render function.\nfunction NavigationLabel({\n children,\n id,\n styling\n}: {\n children: ReactNode;\n id: string | undefined;\n styling: ReturnType<typeof stylex.props>;\n}) {\n const clipped = useClippedTitle(children);\n return <span {...clipped} id={id} {...styling}>\n {children}\n </span>;\n}\n\n/**\n * The list a bar or a rail holds its destinations in, laid out as `layout`\n * says, the bar's row or the rail's column, with the space between them its\n * form's.\n */\nfunction NavigationList({\n children,\n layout\n}: {\n children: ReactNode;\n layout: stylex.StyleXStyles;\n}) {\n const {\n form\n } = useContext(NavigationContext);\n return <ul\n // oxlint-disable-next-line jsx-a11y/no-redundant-roles -- Safari's VoiceOver drops the role once the markers are cleared\n role=\"list\" {...stylex.props(navigationListStyles.list, layout, FORMS[form].list)}>\n {children}\n </ul>;\n}\nexport type { NavigationItemProps };\nexport { NavigationItem, NavigationList };"],"mappings":";;;;;;;;;;;;;;AA8CA,MAAMe,QAAQ;CACZC,KAAKP;CACLQ,YAAY;EACV,GAAGP;EACHQ,MAAMP,qBAAqBO;EAC3BC,MAAMR,qBAAqBQ;EAC3BC,UAAUT,qBAAqBS;CACjC;CACAC,WAAWX;CACXY,UAAUV;AACZ;AAOA,MAAMW,QAAQ;CACZP,KAAK;EACHQ,WAAWf,cAAcgB;EACzBP,MAAMT,cAAciB;CACtB;CACAT,YAAY;EACVO,WAAWlB,MAAMqB;EACjBT,MAAM;CACR;CACAG,WAAW;EACTG,WAAWlB,MAAMqB;EACjBT,MAAM;CACR;CACAI,UAAU;EACRE,WAAW;EACXN,MAAMZ,MAAMqB;CACd;AACF;AAgDA,SAASS,YAAYC,MAAsBF,WAAoB;CAC7D,MAAMG,SAASvB,MAAMsB;CACrB,QAAQE,UAA2BvC,MAAaa,qBAAqB4B,MAAM5B,qBAAqB6B,MAAMJ,OAAOpB,MAAMiB,aAAaG,OAAOK,aAAaJ,MAAMK,cAAcT,YAAYG,OAAOO,qBAAqBP,OAAOQ,cAAcP,MAAMQ,mBAAmBZ,YAAYG,OAAOU,qBAAqBV,OAAOW,cAAcV,MAAMW,cAAcf,YAAYG,OAAOa,qBAAqBb,OAAOc,cAAcb,MAAMQ,kBAAkBxB,MAAMc,KAAK,CAACnB,MAAMqB,MAAMc,cAAcxC,qBAAqByC,YAAY;AAC7e;AAQA,SAASC,YAAYlB,MAAsBF,WAAoBJ,OAAqCG,MAAiBsB,OAAkBC,QAA4BC,QAAmB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,EAAA,OAAAuB,MAAAvB,EAAA,OAAAwB,SAAA;EACnCd,KAAA,oBAAA,QAAA;GAEE,GAFQe;GAAaF;GAAE,GAAMC;GACjCjE;EACI,CAAA;EAAAyC,EAAA,KAAAzC;EAAAyC,EAAA,KAAAyB;EAAAzB,EAAA,KAAAuB;EAAAvB,EAAA,KAAAwB;EAAAxB,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAFFU;AAEE;;;;;;AAQX,SAAAgB,eAAA3B,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAwB,MAAA,EAAA1C,UAAAoE,WAAA5B;CAOtB,MAAA,EAAAnC,SAEIpC,WAAWO,iBAAiB;CAAE,IAAA2E;CAAA,IAAAV,EAAA,OAAApC,QAAAoC,EAAA,OAAA2B,QAAA;EAGlBjB,KAAAnF,MAAac,qBAAoBK,MAAOiF,QAAQrF,MAAMsB,KAAK,CAAAlB,IAAK;EAACsD,EAAA,KAAApC;EAAAoC,EAAA,KAAA2B;EAAA3B,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAAzC,YAAAyC,EAAA,OAAAU,IAAA;EAF1EC,KAAA,oBAAA,MAAA;GAEF,MAAA;GAAM,GAAKD;GACXnD;EACE,CAAA;EAAAyC,EAAA,KAAAzC;EAAAyC,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAJAW;AAIA"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["stylex","colors","media","motion","radii","spacing","stateLayerOpacity","typography","FORCED_COLORS","HOVERED_OVER_NOTHING","onSecondaryContainer","hover","FOCUSED_OVER_NOTHING","focus","PRESSED_OVER_NOTHING","pressed","HOVERED_OVER_CURRENT","secondaryContainer","FOCUSED_OVER_CURRENT","PRESSED_OVER_CURRENT","navigationItemStyles","fade","kIyJzY","k1ekBW","kAMwcw","$$css","icon","kGNEyG","k1xSpc","kGuDYH","kjj79g","itemDisabled","kMwMTN","kkrTdU","label","kXHlph","kORKVm","kg5iWk","khDVqt","link","kB7OPa","k3XXqK","kVAEAm","kMnn75","pill","kWkggS","kaIpWk","navigationListStyles","item","list","kH6xsr","kogj98","kmVPX3","TARGET_SIZE","BAR_ROW","PILL","barItemStyles","badgeMark","kSGwAc","kLqNvP","keTefX","indicator","kZKoxP","kmuXW","kzqmXN","indicatorCurrent","kVAM5u","ksu8eU","kMzoRj","indicatorFocused","indicatorFocusedCurrent","indicatorHovered","indicatorHoveredCurrent","indicatorPressed","indicatorPressedCurrent","indicatorRing","kjBf7l","kInvED","kMeerF","k5JduY","kSy8m5","kcktkL","kwXMNM","kCS8Yb","kXwgrk","kzQI83","kOIVth","kqGvvJ","kAzted","k7Eaqz","k8WAf4","kg3NbH","itemCurrent","itemFocused","itemFocusedCurrent","itemHovered","itemHoveredCurrent","itemPressed","itemPressedCurrent","itemRing","kMv6JI","k63SB2","kb6lSQ","kLWn49","ks0D6T","labelCurrent","listItem","collapsedItemStyles","expandedItemStyles","crampedBarItemStyles"],"sources":["../../src/navigation/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The destinations NavigationBar and NavigationRail both draw, in the three\n// forms the two pages give them. Apart from either component so the two\n// cannot drift, and outside `src/components` for the reason src/row gives.\n//\n// A vertical destination puts its icon in the page's 56dp by 32dp active\n// indicator with the label 4dp under it, in label medium: the navigation bar\n// below the medium breakpoint, and the collapsed rail. A horizontal one is a\n// pill holding the icon and the label side by side, 16dp in at either end:\n// the bar at and above the medium breakpoint at 40dp with 4dp between the\n// two, and the expanded rail at 56dp with 8dp between them, in label large.\n//\n// The current destination's pill is the secondary container, with its icon\n// in on secondary container and, under the pill, its label in secondary;\n// every other is on surface variant. A label set inside the pill, as a\n// horizontal destination sets it, takes on secondary container instead — the\n// library's own call. Secondary over secondary container is not a pair a\n// scheme is held to, and the Poster scheme's came to 4:1, short of the 4.5:1\n// text needs; on secondary container is the pair every scheme guarantees.\n//\n// The hover, focus and pressed layers are the on secondary container role\n// over whatever the pill is, at the pages' 8%, 10% and 10%, drawn on the\n// pill — the indicator in a vertical destination, the whole destination in a\n// horizontal one. They are applied in that order, so where two hold the\n// later wins, as the pages draw one layer at a time. A focused destination's\n// ring goes around the same pill; ./index.tsx says whose ring it is.\n//\n// A change from one of those states to another fades, over the pages' short\n// duration on the standard curve, rather than landing in one frame. A press\n// also draws the library's ripple over the pressed layer, clipped to the\n// pill: inside the indicator in a vertical destination, which positions it,\n// and across the whole destination in a horizontal one, whose indicator is\n// left unpositioned so the ripple fills the link and takes the indicator's\n// pill corner.\n//\n// Under forced colours the mode paints the secondary container over in its\n// background, which left the current destination looking like every other.\n// The pill takes a 2px border in `Highlight` there, which the mode keeps.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The pill's ground and the layers over it, written out whole for each\n// ground, since StyleX replaces a property whole.\nconst HOVERED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), transparent)`;\nconst FOCUSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), transparent)`;\nconst PRESSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), transparent)`;\nconst HOVERED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), ${colors.secondaryContainer})`;\nconst FOCUSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), ${colors.secondaryContainer})`;\nconst PRESSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), ${colors.secondaryContainer})`;\n\n// What every destination draws whatever its form.\nconst navigationItemStyles = {\n fade: {\n kIyJzY: \"x1qno0dh x12w9bfk\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n icon: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"x1pvqxga\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n itemDisabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n label: {\n kMwMTN: \"x1w5n3ug\",\n kXHlph: \"x101abm8\",\n kORKVm: \"xryxfnj\",\n kg5iWk: \"xlyipyv\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n link: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n kVAEAm: \"x1n2onr6\",\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n pill: {\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n }\n};\n\n// The list a bar or a rail holds its destinations in, and the item each\n// destination sits in — see `NavigationList` in ./index.tsx. The list clears\n// the margin, padding and markers a `<ul>` comes with, and each form gives\n// the space between its destinations as its `list`. The item takes the\n// destination's place in the bar's row or the rail's column, which each form\n// gives as its `listItem`, and the link fills it.\nconst navigationListStyles = {\n item: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n list: {\n kB7OPa: \"x9f619\",\n kH6xsr: \"x3ct3a4\",\n kogj98: \"x1ghz6dp\",\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\n\n// The pages' least touch target, which a horizontal bar destination's 40dp\n// pill falls short of.\nconst TARGET_SIZE = '48px';\n\n// The navigation bar page's 64dp row, and the 40dp pill a horizontal\n// destination draws inside it.\nconst BAR_ROW = '64px';\nconst PILL = '40px';\n\n// The navigation bar's destination: vertical below the medium breakpoint and\n// horizontal at it and above, so every value that differs is a pair.\nconst barItemStyles = {\n badgeMark: {\n kSGwAc: \"xcspwbw\",\n kLqNvP: \"xty0069 x19sl9hu\",\n keTefX: \"xhi6r6q\",\n kVAEAm: \"x10l6tqk x15m4ytg\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97 x10qpgbh\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f x11lewyt\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6 xtke4eg\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4 x8jqrm0\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck xnqlxux\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su x8jqrm0\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g x8jqrm0\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf x8jqrm0\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6 x8jqrm0\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj x8jqrm0\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9 x8jqrm0\",\n $$css: true\n },\n indicatorRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59 x1t601oj\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n item: {\n k5JduY: \"x1ktxc2h\",\n kSy8m5: \"xfmxh57\",\n kcktkL: \"xb7ltuz\",\n kwXMNM: \"x1j6awrg\",\n kZKoxP: \"xiioxts\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kXwgrk: \"xdt5ytf xapwh9g\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n kqGvvJ: \"x10im51j xap7i12\",\n kAzted: \"x8nclml xtyuij1\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8 x1nouyz5\",\n kg3NbH: \"xnjsko4 xze1m75\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"xjbqb8w x1xec0pq\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"x1xldtvv x1wx4lrg\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"xjbqb8w xdodzsd\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"xjbqb8w xnmt8re\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"xjbqb8w xdenq60\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"xjbqb8w xjq3nej\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"xjbqb8w x7fq6vu\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xjbqb8w x9wewpu\",\n $$css: true\n },\n itemRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt xxgb522\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9 x16ybrrz\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t x110hqo6\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\n\n// The collapsed rail's destination: always vertical, the pitch from one to\n// the next the rail's 4dp gap.\nconst collapsedItemStyles = {\n badgeMark: {\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n item: {\n kXwgrk: \"xdt5ytf\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"xzoy561\",\n kzqmXN: \"xh8yej3\",\n kjj79g: \"xl56j7k\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"ximhkdq\",\n $$css: true\n },\n itemCurrent: {\n $$css: true\n },\n itemFocused: {\n $$css: true\n },\n itemFocusedCurrent: {\n $$css: true\n },\n itemHovered: {\n $$css: true\n },\n itemHoveredCurrent: {\n $$css: true\n },\n itemPressed: {\n $$css: true\n },\n itemPressedCurrent: {\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9\",\n $$css: true\n },\n list: {\n kOIVth: \"xzoy561\",\n $$css: true\n },\n listItem: {\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n }\n};\n\n// The expanded rail's destination: always horizontal, a 56dp pill as wide as\n// what it holds.\nconst expandedItemStyles = {\n badgeMark: {\n kSGwAc: \"xqcrz7y\",\n kLqNvP: \"x1o0tod\",\n keTefX: \"x18xomjl\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n indicatorCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n $$css: true\n },\n indicatorFocusedCurrent: {\n $$css: true\n },\n indicatorHovered: {\n $$css: true\n },\n indicatorHoveredCurrent: {\n $$css: true\n },\n indicatorPressed: {\n $$css: true\n },\n indicatorPressedCurrent: {\n $$css: true\n },\n item: {\n kSGwAc: \"xqcrz7y\",\n kZKoxP: \"xnnlda6\",\n kaIpWk: \"x1dkaolv\",\n kXwgrk: \"x1q0g3np\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x126z3so\",\n ks0D6T: \"x193iq5w\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n label: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n list: {\n $$css: true\n },\n listItem: {\n kSGwAc: \"xqcrz7y\",\n kmuXW: \"x2lah0s\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n }\n};\n\n// The bar's destination when the bar is too narrow for its horizontal form\n// at a width that would otherwise draw it — see NavigationBar. Vertical at\n// every width: the bar's own vertical item, with the collapsed rail's\n// indicator, label and badge placement, which are the bar's vertical ones.\nconst crampedBarItemStyles = {\n item: {\n kZKoxP: \"x5yr21d\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\nexport { barItemStyles, collapsedItemStyles, crampedBarItemStyles, expandedItemStyles, navigationItemStyles, navigationListStyles };"],"mappings":";;AAkD6B,GAAsBC,OAAOS,uBAA6BJ,kBAAkBK;AAC5E,GAAsBV,OAAOS,uBAA6BJ,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;EACRwE,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR9E,OAAO;CACT;CACAgF,cAAc;EACZzE,QAAQ;EACRP,OAAO;CACT;CACAwB,MAAM,EACJxB,OAAO,KACT;CACAiF,UAAU;EACRhD,QAAQ;EACRK,OAAO;EACPyC,QAAQ;EACR/E,OAAO;CACT;AACF;AAMA,MAAMoF,uBAAuB;CAC3B7D,MAAM;EACJc,QAAQ;EACRhB,QAAQ;EACRqC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRxD,QAAQ;EACR2D,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlE,OAAO;CACT;CACAwB,MAAM;EACJqC,QAAQ;EACR7D,OAAO;CACT;CACAiF,UAAU;EACRvB,QAAQ;EACRE,QAAQ;EACRI,QAAQ;EACRhE,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"styles.js","names":["colors","stateLayerOpacity","onSecondaryContainer","hover","focus","pressed","secondaryContainer","navigationItemStyles","fade","kIyJzY","k1ekBW","kAMwcw","$$css","icon","kGNEyG","k1xSpc","kGuDYH","kjj79g","itemDisabled","kMwMTN","kkrTdU","label","kXHlph","kORKVm","kg5iWk","khDVqt","link","kB7OPa","k3XXqK","kVAEAm","kMnn75","pill","kWkggS","kaIpWk","navigationListStyles","item","list","kH6xsr","kogj98","kmVPX3","barItemStyles","badgeMark","kSGwAc","kLqNvP","keTefX","indicator","kZKoxP","kmuXW","kzqmXN","indicatorCurrent","kVAM5u","ksu8eU","kMzoRj","indicatorFocused","indicatorFocusedCurrent","indicatorHovered","indicatorHoveredCurrent","indicatorPressed","indicatorPressedCurrent","indicatorRing","kjBf7l","kInvED","kMeerF","k5JduY","kSy8m5","kcktkL","kwXMNM","kCS8Yb","kXwgrk","kzQI83","kOIVth","kqGvvJ","kAzted","k7Eaqz","k8WAf4","kg3NbH","itemCurrent","itemFocused","itemFocusedCurrent","itemHovered","itemHoveredCurrent","itemPressed","itemPressedCurrent","itemRing","kMv6JI","k63SB2","kb6lSQ","kLWn49","ks0D6T","labelCurrent","listItem","collapsedItemStyles","expandedItemStyles","crampedBarItemStyles"],"sources":["../../src/navigation/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The destinations NavigationBar and NavigationRail both draw, in the three\n// forms the two pages give them. Apart from either component so the two\n// cannot drift, and outside `src/components` for the reason src/row gives.\n//\n// A vertical destination puts its icon in the page's 56dp by 32dp active\n// indicator with the label 4dp under it, in label medium: the navigation bar\n// below the medium breakpoint, and the collapsed rail. A horizontal one is a\n// pill holding the icon and the label side by side, 16dp in at either end:\n// the bar at and above the medium breakpoint at 40dp with 4dp between the\n// two, and the expanded rail at 56dp with 8dp between them, in label large.\n//\n// The current destination's pill is the secondary container, with its icon\n// in on secondary container and, under the pill, its label in secondary;\n// every other is on surface variant. A label set inside the pill, as a\n// horizontal destination sets it, takes on secondary container instead — the\n// library's own call. Secondary over secondary container is not a pair a\n// scheme is held to, and the Poster scheme's came to 4:1, short of the 4.5:1\n// text needs; on secondary container is the pair every scheme guarantees.\n//\n// The hover, focus and pressed layers are the on secondary container role\n// over whatever the pill is, at the pages' 8%, 10% and 10%, drawn on the\n// pill — the indicator in a vertical destination, the whole destination in a\n// horizontal one. They are applied in that order, so where two hold the\n// later wins, as the pages draw one layer at a time. A focused destination's\n// ring goes around the same pill; ./index.tsx says whose ring it is.\n//\n// A change from one of those states to another fades, over the pages' short\n// duration on the standard curve, rather than landing in one frame. A press\n// also draws the library's ripple over the pressed layer, clipped to the\n// pill: inside the indicator in a vertical destination, which positions it,\n// and across the whole destination in a horizontal one, whose indicator is\n// left unpositioned so the ripple fills the link and takes the indicator's\n// pill corner.\n//\n// Under forced colours the mode paints the secondary container over in its\n// background, which left the current destination looking like every other.\n// The pill takes a 2px border in `Highlight` there, which the mode keeps.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The pill's ground and the layers over it, written out whole for each\n// ground, since StyleX replaces a property whole.\nconst HOVERED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), transparent)`;\nconst FOCUSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), transparent)`;\nconst PRESSED_OVER_NOTHING = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), transparent)`;\nconst HOVERED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.hover} * 100%), ${colors.secondaryContainer})`;\nconst FOCUSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.focus} * 100%), ${colors.secondaryContainer})`;\nconst PRESSED_OVER_CURRENT = `color-mix(in srgb, ${colors.onSecondaryContainer} calc(${stateLayerOpacity.pressed} * 100%), ${colors.secondaryContainer})`;\n\n// What every destination draws whatever its form.\nconst navigationItemStyles = {\n fade: {\n kIyJzY: \"x1qno0dh x12w9bfk\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n icon: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kGuDYH: \"x1pvqxga\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n itemDisabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n label: {\n kMwMTN: \"x1w5n3ug\",\n kXHlph: \"x101abm8\",\n kORKVm: \"xryxfnj\",\n kg5iWk: \"xlyipyv\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n link: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n kVAEAm: \"x1n2onr6\",\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n pill: {\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n }\n};\n\n// The list a bar or a rail holds its destinations in, and the item each\n// destination sits in — see `NavigationList` in ./index.tsx. The list clears\n// the margin, padding and markers a `<ul>` comes with, and each form gives\n// the space between its destinations as its `list`. The item takes the\n// destination's place in the bar's row or the rail's column, which each form\n// gives as its `listItem`, and the link fills it.\nconst navigationListStyles = {\n item: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n list: {\n kB7OPa: \"x9f619\",\n kH6xsr: \"x3ct3a4\",\n kogj98: \"x1ghz6dp\",\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\n\n// The pages' least touch target, which a horizontal bar destination's 40dp\n// pill falls short of.\nconst TARGET_SIZE = '48px';\n\n// The navigation bar page's 64dp row, and the 40dp pill a horizontal\n// destination draws inside it.\nconst BAR_ROW = '64px';\nconst PILL = '40px';\n\n// The navigation bar's destination: vertical below the medium breakpoint and\n// horizontal at it and above, so every value that differs is a pair.\nconst barItemStyles = {\n badgeMark: {\n kSGwAc: \"xcspwbw\",\n kLqNvP: \"xty0069 x19sl9hu\",\n keTefX: \"xhi6r6q\",\n kVAEAm: \"x10l6tqk x15m4ytg\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97 x10qpgbh\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f x11lewyt\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6 xtke4eg\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4 x8jqrm0\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck xnqlxux\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su x8jqrm0\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g x8jqrm0\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf x8jqrm0\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6 x8jqrm0\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj x8jqrm0\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9 x8jqrm0\",\n $$css: true\n },\n indicatorRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59 x1t601oj\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n item: {\n k5JduY: \"x1ktxc2h\",\n kSy8m5: \"xfmxh57\",\n kcktkL: \"xb7ltuz\",\n kwXMNM: \"x1j6awrg\",\n kZKoxP: \"xiioxts\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kXwgrk: \"xdt5ytf xapwh9g\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n kqGvvJ: \"x10im51j xap7i12\",\n kAzted: \"x8nclml xtyuij1\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8 x1nouyz5\",\n kg3NbH: \"xnjsko4 xze1m75\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"xjbqb8w x1xec0pq\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"x1xldtvv x1wx4lrg\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"xjbqb8w xdodzsd\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"xjbqb8w xnmt8re\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"xjbqb8w xdenq60\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"xjbqb8w xjq3nej\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"xjbqb8w x7fq6vu\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xjbqb8w x9wewpu\",\n $$css: true\n },\n itemRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt xxgb522\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9 x16ybrrz\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t x110hqo6\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery x1a6ly76\",\n kzQI83: \"x1iyjqo2 x10cb59y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\n\n// The collapsed rail's destination: always vertical, the pitch from one to\n// the next the rail's 4dp gap.\nconst collapsedItemStyles = {\n badgeMark: {\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"x10w6t97\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x15yg21f\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicatorCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n indicatorFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n indicatorHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n indicatorHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n indicatorPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n indicatorPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n item: {\n kXwgrk: \"xdt5ytf\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"xzoy561\",\n kzqmXN: \"xh8yej3\",\n kjj79g: \"xl56j7k\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"ximhkdq\",\n $$css: true\n },\n itemCurrent: {\n $$css: true\n },\n itemFocused: {\n $$css: true\n },\n itemFocusedCurrent: {\n $$css: true\n },\n itemHovered: {\n $$css: true\n },\n itemHoveredCurrent: {\n $$css: true\n },\n itemPressed: {\n $$css: true\n },\n itemPressedCurrent: {\n $$css: true\n },\n label: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"xzakmg9\",\n $$css: true\n },\n list: {\n kOIVth: \"xzoy561\",\n $$css: true\n },\n listItem: {\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n }\n};\n\n// The expanded rail's destination: always horizontal, a 56dp pill as wide as\n// what it holds.\nconst expandedItemStyles = {\n badgeMark: {\n kSGwAc: \"xqcrz7y\",\n kLqNvP: \"x1o0tod\",\n keTefX: \"x18xomjl\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n indicator: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n indicatorCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n indicatorFocused: {\n $$css: true\n },\n indicatorFocusedCurrent: {\n $$css: true\n },\n indicatorHovered: {\n $$css: true\n },\n indicatorHoveredCurrent: {\n $$css: true\n },\n indicatorPressed: {\n $$css: true\n },\n indicatorPressedCurrent: {\n $$css: true\n },\n item: {\n kSGwAc: \"xqcrz7y\",\n kZKoxP: \"xnnlda6\",\n kaIpWk: \"x1dkaolv\",\n kXwgrk: \"x1q0g3np\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x126z3so\",\n ks0D6T: \"x193iq5w\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n itemCurrent: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x1n2ykn\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"x2h6xq1\",\n $$css: true\n },\n itemFocused: {\n kWkggS: \"x1syr9su\",\n $$css: true\n },\n itemFocusedCurrent: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n itemHovered: {\n kWkggS: \"x173luhf\",\n $$css: true\n },\n itemHoveredCurrent: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n itemPressed: {\n kWkggS: \"x1rydsgj\",\n $$css: true\n },\n itemPressedCurrent: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n label: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n labelCurrent: {\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n list: {\n $$css: true\n },\n listItem: {\n kSGwAc: \"xqcrz7y\",\n kmuXW: \"x2lah0s\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n }\n};\n\n// The bar's destination when the bar is too narrow for its horizontal form\n// at a width that would otherwise draw it — see NavigationBar. Vertical at\n// every width: the bar's own vertical item, with the collapsed rail's\n// indicator, label and badge placement, which are the bar's vertical ones.\nconst crampedBarItemStyles = {\n item: {\n kZKoxP: \"x5yr21d\",\n kaIpWk: \"x1dkaolv\",\n kCS8Yb: \"x1r8uery\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"xzoy561\",\n kjj79g: \"xl56j7k\",\n k7Eaqz: \"xeuugli\",\n k8WAf4: \"x1t0vds8\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n list: {\n kOIVth: \"xxhr3t\",\n $$css: true\n },\n listItem: {\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\nexport { barItemStyles, collapsedItemStyles, crampedBarItemStyles, expandedItemStyles, navigationItemStyles, navigationListStyles };"],"mappings":";;AAkD6B,GAAsBA,OAAOE,uBAA6BD,kBAAkBE;AAC5E,GAAsBH,OAAOE,uBAA6BD,kBAAkBG;AAC5E,GAAsBJ,OAAOE,uBAA6BD,kBAAkBI;AAC5E,GAAsBL,OAAOE,uBAA6BD,kBAAkBE,QAAkBH,OAAOM;AACrG,GAAsBN,OAAOE,uBAA6BD,kBAAkBG,QAAkBJ,OAAOM;AACrG,GAAsBN,OAAOE,uBAA6BD,kBAAkBI,UAAoBL,OAAOM;AAGpI,MAAMC,uBAAuB;CAC3BC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAS,OAAO;EACLF,QAAQ;EACRG,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRb,OAAO;CACT;CACAc,MAAM;EACJZ,QAAQ;EACRa,QAAQ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KACT;CACA6C,kBAAkB,EAChB7C,OAAO,KACT;CACA8C,yBAAyB,EACvB9C,OAAO,KACT;CACAuB,MAAM;EACJO,QAAQ;EACRI,QAAQ;EACRb,QAAQ;EACRmC,QAAQ;EACRrB,OAAO;EACPuB,QAAQ;EACRkB,QAAQ;EACRb,QAAQ;EACR/D,OAAO;CACT;CACAgE,aAAa;EACX5C,QAAQ;EACRkB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRxC,OAAO;CACT;CACAiE,aAAa;EACX7C,QAAQ;EACRpB,OAAO;CACT;CACAkE,oBAAoB;EAClB9C,QAAQ;EACRpB,OAAO;CACT;CACAmE,aAAa;EACX/C,QAAQ;EACRpB,OAAO;CACT;CACAoE,oBAAoB;EAClBhD,QAAQ;EACRpB,OAAO;CACT;CACAqE,aAAa;EACXjD,QAAQ;EACRpB,OAAO;CACT;CACAsE,oBAAoB;EAClBlD,QAAQ;EACRpB,OAAO;CACT;CACAS,OAAO;EACL+D,QAAQ;EACRpE,QAAQ;EACRqE,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR3E,OAAO;CACT;CACA6E,cAAc;EACZtE,QAAQ;EACRP,OAAO;CACT;CACAwB,MAAM,EACJxB,OAAO,KACT;CACA8E,UAAU;EACRhD,QAAQ;EACRK,OAAO;EACPyC,QAAQ;EACR5E,OAAO;CACT;AACF;AAMA,MAAMiF,uBAAuB;CAC3B1D,MAAM;EACJW,QAAQ;EACRb,QAAQ;EACRkC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRrD,QAAQ;EACRwD,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR/D,OAAO;CACT;CACAwB,MAAM;EACJkC,QAAQ;EACR1D,OAAO;CACT;CACA8E,UAAU;EACRvB,QAAQ;EACRE,QAAQ;EACRI,QAAQ;EACR7D,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","SeparatorContext","NO_SEPARATOR","OverlayScope","t0","$","_c","children","t1","_c"],"sources":["../../src/overlay/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { SeparatorContext } from 'react-aria-components'\n\n// React context crosses the portal an overlay renders through, so what a\n// component around the trigger sets for its own children reaches into the\n// overlay as well. `Toolbar` sets the one that matters: it turns a\n// `Separator` across the bar, and a horizontal rule in a popover opened from\n// the bar took that orientation and drew as a vertical rule 0px long, told\n// to assistive technology as vertical too. An overlay is a surface of its\n// own, so its content starts from none of it, and a `Separator` there falls\n// back to its own horizontal default — as one inside React Aria's `Menu`\n// already did, since `Menu` provides a separator context of its own.\n//\n// Empty rather than null, so the separator reads no props from it rather\n// than finding no context and looking further out; a module constant, so the\n// value is the same object on every render.\nconst NO_SEPARATOR = {}\n\n/** Clears, for an overlay's content, the contexts that reach it from outside. */\nfunction OverlayScope({ children }: { children: ReactNode }) {\n return <SeparatorContext value={NO_SEPARATOR}>{children}</SeparatorContext>\n}\n\nexport { OverlayScope }\n"],"mappings":";;;;AAiBA,MAAME,eAAe,CAAC;;AAGtB,SAAAC,aAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAsB,MAAA,EAAAC,aAAAH;CAAqC,IAAAI;CAAA,IAAAH,EAAA,OAAAE,UAAA;EAClDC,KAAA,oBAAC,kBAAD;GAAyBN,OAAAA;GAAeK;EAAvB,CAAA;EAAmDF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAApEG;AAAoE"}
1
+ {"version":3,"file":"index.js","names":["NO_SEPARATOR","OverlayScope","t0","$","_c","children","t1"],"sources":["../../src/overlay/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { SeparatorContext } from 'react-aria-components'\n\n// React context crosses the portal an overlay renders through, so what a\n// component around the trigger sets for its own children reaches into the\n// overlay as well. `Toolbar` sets the one that matters: it turns a\n// `Separator` across the bar, and a horizontal rule in a popover opened from\n// the bar took that orientation and drew as a vertical rule 0px long, told\n// to assistive technology as vertical too. An overlay is a surface of its\n// own, so its content starts from none of it, and a `Separator` there falls\n// back to its own horizontal default — as one inside React Aria's `Menu`\n// already did, since `Menu` provides a separator context of its own.\n//\n// Empty rather than null, so the separator reads no props from it rather\n// than finding no context and looking further out; a module constant, so the\n// value is the same object on every render.\nconst NO_SEPARATOR = {}\n\n/** Clears, for an overlay's content, the contexts that reach it from outside. */\nfunction OverlayScope({ children }: { children: ReactNode }) {\n return <SeparatorContext value={NO_SEPARATOR}>{children}</SeparatorContext>\n}\n\nexport { OverlayScope }\n"],"mappings":";;;;AAiBA,MAAMA,eAAe,CAAC;;AAGtB,SAAAC,aAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAsB,MAAA,EAAAC,aAAAH;CAAqC,IAAAI;CAAA,IAAAH,EAAA,OAAAE,UAAA;EAClDC,KAAA,oBAAC,kBAAD;GAAyBN,OAAAA;GAAeK;EAAvB,CAAA;EAAmDF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAApEG;AAAoE"}
@@ -1 +1 @@
1
- {"version":3,"file":"aria.js","names":["AriaAttributes","KeyboardEventHandler","ButtonProps","LinkProps","ToggleButtonProps","createElement","LABELLING","Set","ElementProps","aria","onKeyDown","HTMLElement","onKeyUp","ariaAttributesOf","props","Record","key","value","Object","entries","startsWith","has","buttonRenderer","element","render","NonNullable","domProps","state","merged","withElementProps","undefined","chain","first","event","Event","second","linkRenderer","isDisabled","href","toggleButtonRenderer","Props","dom"],"sources":["../../src/render/aria.tsx"],"sourcesContent":["import type { AriaAttributes, KeyboardEventHandler } from 'react'\nimport type {\n ButtonProps,\n LinkProps,\n ToggleButtonProps,\n} from 'react-aria-components'\n\nimport { createElement } from 'react'\n\n// The four React Aria forwards on its own, and may combine with what a parent\n// provides through context — a dialog's trigger names its dialog this way.\n// Everything else it drops, so those stay out of the spread below rather\n// than overriding a value React Aria computed.\nconst LABELLING = new Set([\n 'aria-describedby',\n 'aria-details',\n 'aria-label',\n 'aria-labelledby',\n])\n\n/**\n * What a component puts on the element itself, past React Aria: the `aria-*`\n * props it would drop, and the keyboard handlers it would wrap.\n *\n * React Aria forwards only the labelling attributes, which is right for the\n * states it manages but leaves a call site no way to mark a button as\n * expanded, pressed, or in control of something React Aria does not know\n * about. Its keyboard handlers stop propagation unless the handler asks\n * otherwise, which is its own convention rather than the DOM's; attached to\n * the element directly they bubble as a call site expects, and an Escape\n * pressed on a button inside a dialog still reaches the dialog.\n */\ninterface ElementProps {\n aria: AriaAttributes\n onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined\n onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined\n}\n\n/** The `aria-*` props React Aria would drop, collected for {@link ElementProps}. */\nfunction ariaAttributesOf(props: object): AriaAttributes {\n const aria: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(props)) {\n if (key.startsWith('aria-') && !LABELLING.has(key)) {\n aria[key] = value\n }\n }\n return aria\n}\n\n/**\n * The `render` function for a React Aria `Button`: the element it would have\n * rendered, plus {@link ElementProps}, handed on to the call site's own\n * `render` when there is one. Built by a call rather than written inline at\n * the prop, which is what react-perf's no-new-function-as-prop is after.\n *\n * `createElement` rather than JSX, here and below: React Aria types the\n * props it hands over as a union of the elements it might have rendered, and\n * a spread of that union onto one tag does not type-check, where the plain\n * call takes any props object.\n */\nfunction buttonRenderer(\n element: ElementProps,\n render: ButtonProps['render'],\n): NonNullable<ButtonProps['render']> {\n return (domProps, state) => {\n const merged = withElementProps(domProps, element)\n if (render !== undefined) {\n return render(merged, state)\n }\n return createElement('button', merged)\n }\n}\n\n// React Aria's own keyboard handling comes first, then the call site's.\nfunction chain<Event>(\n first: ((event: Event) => void) | undefined,\n second: ((event: Event) => void) | undefined,\n) {\n if (second === undefined) {\n return first\n }\n return (event: Event) => {\n first?.(event)\n second(event)\n }\n}\n\n/**\n * The same for a React Aria `Link`, handed on to the call site's own `render`\n * when there is one. React Aria expects an anchor while the link is enabled\n * and has somewhere to go, and a span in every other case — a disabled anchor\n * is no link at all, and one without `href` is a placeholder — and it leaves\n * `href` out of what it hands over in both span cases, which is what the\n * element is chosen from.\n */\nfunction linkRenderer(\n element: ElementProps,\n render?: LinkProps['render'],\n): NonNullable<LinkProps['render']> {\n return (domProps, state) => {\n const merged = withElementProps(domProps, element)\n if (render !== undefined) {\n return render(merged, state)\n }\n if (state.isDisabled || !('href' in merged)) {\n return createElement('span', { ...merged, href: undefined })\n }\n return createElement('a', merged)\n }\n}\n\n/**\n * The same for a React Aria `ToggleButton`. Written out rather than made\n * generic over `buttonRenderer`: React Aria hands a toggle button a render\n * state of its own — no `isPending`, plus `isSelected` — and a function\n * written against the plain button's state does not type-check where that\n * one is expected.\n */\nfunction toggleButtonRenderer(\n element: ElementProps,\n render: ToggleButtonProps['render'],\n): NonNullable<ToggleButtonProps['render']> {\n return (domProps, state) => {\n const merged = withElementProps(domProps, element)\n if (render !== undefined) {\n return render(merged, state)\n }\n return createElement('button', merged)\n }\n}\n\nfunction withElementProps<Props extends object>(\n domProps: Props,\n element: ElementProps,\n) {\n const dom = domProps as Props & {\n onKeyDown?: KeyboardEventHandler<HTMLElement>\n onKeyUp?: KeyboardEventHandler<HTMLElement>\n }\n return {\n ...domProps,\n ...element.aria,\n onKeyDown: chain(dom.onKeyDown, element.onKeyDown),\n onKeyUp: chain(dom.onKeyUp, element.onKeyUp),\n }\n}\n\nexport type { ElementProps }\n\nexport { ariaAttributesOf, buttonRenderer, linkRenderer, toggleButtonRenderer }\n"],"mappings":";;AAaA,MAAMM,4BAAY,IAAIC,IAAI;CACxB;CACA;CACA;CACA;AAAiB,CAClB;;AAqBD,SAASM,iBAAiBC,OAA+B;CACvD,MAAML,OAAgC,CAAC;CACvC,KAAK,MAAM,CAACO,KAAKC,UAAUC,OAAOC,QAAQL,KAAK,GAC7C,IAAIE,IAAII,WAAW,OAAO,KAAK,CAACd,UAAUe,IAAIL,GAAG,GAC/CP,KAAKO,OAAOC;CAGhB,OAAOR;AACT;;;;;;;;;;;;AAaA,SAASa,eACPC,SACAC,QACoC;CACpC,QAAQE,UAAUC,UAAU;EAC1B,MAAMC,SAASC,iBAAiBH,UAAUH,OAAO;EACjD,IAAIC,WAAWM,KAAAA,GACb,OAAON,OAAOI,QAAQD,KAAK;EAE7B,OAAOtB,cAAc,UAAUuB,MAAM;CACvC;AACF;AAGA,SAASG,MACPC,OACAG,QACA;CACA,IAAIA,WAAWL,KAAAA,GACb,OAAOE;CAET,QAAQC,UAAiB;EACvBD,QAAQC,KAAK;EACbE,OAAOF,KAAK;CACd;AACF;;;;;;;;;AAUA,SAASG,aACPb,SACAC,QACkC;CAClC,QAAQE,UAAUC,UAAU;EAC1B,MAAMC,SAASC,iBAAiBH,UAAUH,OAAO;EACjD,IAAIC,WAAWM,KAAAA,GACb,OAAON,OAAOI,QAAQD,KAAK;EAE7B,IAAIA,MAAMU,cAAc,EAAE,UAAUT,SAClC,OAAOvB,cAAc,QAAQ;GAAE,GAAGuB;GAAQU,MAAMR,KAAAA;EAAU,CAAC;EAE7D,OAAOzB,cAAc,KAAKuB,MAAM;CAClC;AACF;;;;;;;;AASA,SAASW,qBACPhB,SACAC,QAC0C;CAC1C,QAAQE,UAAUC,UAAU;EAC1B,MAAMC,SAASC,iBAAiBH,UAAUH,OAAO;EACjD,IAAIC,WAAWM,KAAAA,GACb,OAAON,OAAOI,QAAQD,KAAK;EAE7B,OAAOtB,cAAc,UAAUuB,MAAM;CACvC;AACF;AAEA,SAASC,iBACPH,UACAH,SACA;CACA,MAAMkB,MAAMf;CAIZ,OAAO;EACL,GAAGA;EACH,GAAGH,QAAQd;EACXC,WAAWqB,MAAMU,IAAI/B,WAAWa,QAAQb,SAAS;EACjDE,SAASmB,MAAMU,IAAI7B,SAASW,QAAQX,OAAO;CAC7C;AACF"}
1
+ {"version":3,"file":"aria.js","names":["createElement","LABELLING","Set","aria","onKeyDown","onKeyUp","ariaAttributesOf","props","key","value","Object","entries","startsWith","has","buttonRenderer","element","render","domProps","state","merged","withElementProps","undefined","chain","first","event","second","linkRenderer","isDisabled","href","toggleButtonRenderer","dom"],"sources":["../../src/render/aria.tsx"],"sourcesContent":["import type { AriaAttributes, KeyboardEventHandler } from 'react'\nimport type {\n ButtonProps,\n LinkProps,\n ToggleButtonProps,\n} from 'react-aria-components'\n\nimport { createElement } from 'react'\n\n// The four React Aria forwards on its own, and may combine with what a parent\n// provides through context — a dialog's trigger names its dialog this way.\n// Everything else it drops, so those stay out of the spread below rather\n// than overriding a value React Aria computed.\nconst LABELLING = new Set([\n 'aria-describedby',\n 'aria-details',\n 'aria-label',\n 'aria-labelledby',\n])\n\n/**\n * What a component puts on the element itself, past React Aria: the `aria-*`\n * props it would drop, and the keyboard handlers it would wrap.\n *\n * React Aria forwards only the labelling attributes, which is right for the\n * states it manages but leaves a call site no way to mark a button as\n * expanded, pressed, or in control of something React Aria does not know\n * about. Its keyboard handlers stop propagation unless the handler asks\n * otherwise, which is its own convention rather than the DOM's; attached to\n * the element directly they bubble as a call site expects, and an Escape\n * pressed on a button inside a dialog still reaches the dialog.\n */\ninterface ElementProps {\n aria: AriaAttributes\n onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined\n onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined\n}\n\n/** The `aria-*` props React Aria would drop, collected for {@link ElementProps}. */\nfunction ariaAttributesOf(props: object): AriaAttributes {\n const aria: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(props)) {\n if (key.startsWith('aria-') && !LABELLING.has(key)) {\n aria[key] = value\n }\n }\n return aria\n}\n\n/**\n * The `render` function for a React Aria `Button`: the element it would have\n * rendered, plus {@link ElementProps}, handed on to the call site's own\n * `render` when there is one. Built by a call rather than written inline at\n * the prop, which is what react-perf's no-new-function-as-prop is after.\n *\n * `createElement` rather than JSX, here and below: React Aria types the\n * props it hands over as a union of the elements it might have rendered, and\n * a spread of that union onto one tag does not type-check, where the plain\n * call takes any props object.\n */\nfunction buttonRenderer(\n element: ElementProps,\n render: ButtonProps['render'],\n): NonNullable<ButtonProps['render']> {\n return (domProps, state) => {\n const merged = withElementProps(domProps, element)\n if (render !== undefined) {\n return render(merged, state)\n }\n return createElement('button', merged)\n }\n}\n\n// React Aria's own keyboard handling comes first, then the call site's.\nfunction chain<Event>(\n first: ((event: Event) => void) | undefined,\n second: ((event: Event) => void) | undefined,\n) {\n if (second === undefined) {\n return first\n }\n return (event: Event) => {\n first?.(event)\n second(event)\n }\n}\n\n/**\n * The same for a React Aria `Link`, handed on to the call site's own `render`\n * when there is one. React Aria expects an anchor while the link is enabled\n * and has somewhere to go, and a span in every other case — a disabled anchor\n * is no link at all, and one without `href` is a placeholder — and it leaves\n * `href` out of what it hands over in both span cases, which is what the\n * element is chosen from.\n */\nfunction linkRenderer(\n element: ElementProps,\n render?: LinkProps['render'],\n): NonNullable<LinkProps['render']> {\n return (domProps, state) => {\n const merged = withElementProps(domProps, element)\n if (render !== undefined) {\n return render(merged, state)\n }\n if (state.isDisabled || !('href' in merged)) {\n return createElement('span', { ...merged, href: undefined })\n }\n return createElement('a', merged)\n }\n}\n\n/**\n * The same for a React Aria `ToggleButton`. Written out rather than made\n * generic over `buttonRenderer`: React Aria hands a toggle button a render\n * state of its own — no `isPending`, plus `isSelected` — and a function\n * written against the plain button's state does not type-check where that\n * one is expected.\n */\nfunction toggleButtonRenderer(\n element: ElementProps,\n render: ToggleButtonProps['render'],\n): NonNullable<ToggleButtonProps['render']> {\n return (domProps, state) => {\n const merged = withElementProps(domProps, element)\n if (render !== undefined) {\n return render(merged, state)\n }\n return createElement('button', merged)\n }\n}\n\nfunction withElementProps<Props extends object>(\n domProps: Props,\n element: ElementProps,\n) {\n const dom = domProps as Props & {\n onKeyDown?: KeyboardEventHandler<HTMLElement>\n onKeyUp?: KeyboardEventHandler<HTMLElement>\n }\n return {\n ...domProps,\n ...element.aria,\n onKeyDown: chain(dom.onKeyDown, element.onKeyDown),\n onKeyUp: chain(dom.onKeyUp, element.onKeyUp),\n }\n}\n\nexport type { ElementProps }\n\nexport { ariaAttributesOf, buttonRenderer, linkRenderer, toggleButtonRenderer }\n"],"mappings":";;AAaA,MAAMC,4BAAY,IAAIC,IAAI;CACxB;CACA;CACA;CACA;AAAiB,CAClB;;AAqBD,SAASI,iBAAiBC,OAA+B;CACvD,MAAMJ,OAAgC,CAAC;CACvC,KAAK,MAAM,CAACK,KAAKC,UAAUC,OAAOC,QAAQJ,KAAK,GAC7C,IAAIC,IAAII,WAAW,OAAO,KAAK,CAACX,UAAUY,IAAIL,GAAG,GAC/CL,KAAKK,OAAOC;CAGhB,OAAON;AACT;;;;;;;;;;;;AAaA,SAASW,eACPC,SACAC,QACoC;CACpC,QAAQC,UAAUC,UAAU;EAC1B,MAAMC,SAASC,iBAAiBH,UAAUF,OAAO;EACjD,IAAIC,WAAWK,KAAAA,GACb,OAAOL,OAAOG,QAAQD,KAAK;EAE7B,OAAOlB,cAAc,UAAUmB,MAAM;CACvC;AACF;AAGA,SAASG,MACPC,OACAE,QACA;CACA,IAAIA,WAAWJ,KAAAA,GACb,OAAOE;CAET,QAAQC,UAAiB;EACvBD,QAAQC,KAAK;EACbC,OAAOD,KAAK;CACd;AACF;;;;;;;;;AAUA,SAASE,aACPX,SACAC,QACkC;CAClC,QAAQC,UAAUC,UAAU;EAC1B,MAAMC,SAASC,iBAAiBH,UAAUF,OAAO;EACjD,IAAIC,WAAWK,KAAAA,GACb,OAAOL,OAAOG,QAAQD,KAAK;EAE7B,IAAIA,MAAMS,cAAc,EAAE,UAAUR,SAClC,OAAOnB,cAAc,QAAQ;GAAE,GAAGmB;GAAQS,MAAMP,KAAAA;EAAU,CAAC;EAE7D,OAAOrB,cAAc,KAAKmB,MAAM;CAClC;AACF;;;;;;;;AASA,SAASU,qBACPd,SACAC,QAC0C;CAC1C,QAAQC,UAAUC,UAAU;EAC1B,MAAMC,SAASC,iBAAiBH,UAAUF,OAAO;EACjD,IAAIC,WAAWK,KAAAA,GACb,OAAOL,OAAOG,QAAQD,KAAK;EAE7B,OAAOlB,cAAc,UAAUmB,MAAM;CACvC;AACF;AAEA,SAASC,iBACPH,UACAF,SACA;CACA,MAAMe,MAAMb;CAIZ,OAAO;EACL,GAAGA;EACH,GAAGF,QAAQZ;EACXC,WAAWkB,MAAMQ,IAAI1B,WAAWW,QAAQX,SAAS;EACjDC,SAASiB,MAAMQ,IAAIzB,SAASU,QAAQV,OAAO;CAC7C;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","names":["ReactNode","hasContent","node","undefined"],"sources":["../../src/render/content.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * Whether a slot was handed anything to draw. React draws nothing for\n * `null`, `false`, `true` or an empty string, and a call site passes them\n * for \"nothing here\" — `leading={user.avatar && <Avatar />}`, or a note that\n * is `null` — so a slot that asked only whether it was `undefined` drew an\n * empty wrapper for them, and a row counted a line it never showed. `0` is\n * content, since React draws it, and so is a string of spaces.\n */\nfunction hasContent(node: ReactNode): boolean {\n return (\n node !== undefined &&\n node !== null &&\n node !== false &&\n node !== true &&\n node !== ''\n )\n}\n\nexport { hasContent }\n"],"mappings":";;;;;;;;;AAUA,SAASC,WAAWC,MAA0B;CAC5C,OACEA,SAASC,KAAAA,KACTD,SAAS,QACTA,SAAS,SACTA,SAAS,QACTA,SAAS;AAEb"}
1
+ {"version":3,"file":"content.js","names":["hasContent","node","undefined"],"sources":["../../src/render/content.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * Whether a slot was handed anything to draw. React draws nothing for\n * `null`, `false`, `true` or an empty string, and a call site passes them\n * for \"nothing here\" — `leading={user.avatar && <Avatar />}`, or a note that\n * is `null` — so a slot that asked only whether it was `undefined` drew an\n * empty wrapper for them, and a row counted a line it never showed. `0` is\n * content, since React draws it, and so is a string of spaces.\n */\nfunction hasContent(node: ReactNode): boolean {\n return (\n node !== undefined &&\n node !== null &&\n node !== false &&\n node !== true &&\n node !== ''\n )\n}\n\nexport { hasContent }\n"],"mappings":";;;;;;;;;AAUA,SAASA,WAAWC,MAA0B;CAC5C,OACEA,SAASC,KAAAA,KACTD,SAAS,QACTA,SAAS,SACTA,SAAS,QACTA,SAAS;AAEb"}
@@ -16,5 +16,4 @@ type LabelledByAttribute = {
16
16
  'aria-label'?: string;
17
17
  'aria-labelledby': string;
18
18
  };
19
- export type { AccessibleName, LabelledByAttribute };
20
- //# sourceMappingURL=name.d.ts.map
19
+ export type { AccessibleName, LabelledByAttribute };
@@ -1 +1 @@
1
- {"version":3,"file":"ref.js","names":["Ref","RefCallback","AttachableRef","NonNullable","E","attach","ref","node","cleanup","current","mergeRefs","a","b","undefined","detachA","detachB","refCallback","element"],"sources":["../../src/render/ref.ts"],"sourcesContent":["import type { Ref, RefCallback } from 'react'\n\n// A ref that can be written through. React reads a `null` ref as none at all,\n// so a merge is only ever handed one that is there.\ntype AttachableRef<E> = NonNullable<Ref<E>>\n\nfunction attach<E>(ref: AttachableRef<E>, node: E | null): () => void {\n if (typeof ref === 'function') {\n const cleanup = ref(node)\n return typeof cleanup === 'function'\n ? cleanup\n : () => {\n ref(null)\n }\n }\n ref.current = node\n return () => {\n ref.current = null\n }\n}\n\n/**\n * One ref that feeds both, or whichever one there is. Attaching through a\n * callback lets each side keep its own cleanup: React 19 calls a callback\n * ref's returned function on detach in place of calling it with `null`, so\n * the merged callback returns one that does the same for each of the two.\n *\n * For an element that needs a ref of its own — a body measuring whether it\n * scrolls, a row clearing an attribute React Aria sets — and is handed the\n * call site's as well.\n */\nfunction mergeRefs<E>(\n a: AttachableRef<E> | undefined,\n b: AttachableRef<E> | undefined,\n): AttachableRef<E> | undefined {\n if (a === undefined) {\n return b\n }\n if (b === undefined) {\n return a\n }\n return (node: E | null) => {\n const detachA = attach(a, node)\n const detachB = attach(b, node)\n return () => {\n detachA()\n detachB()\n }\n }\n}\n\n/**\n * A call site's ref, as a callback that writes the element into it.\n *\n * For a component that renders one of two elements — Button and IconButton a\n * `<button>` or an `<a>`, ListItem a `<div>` or a `<button>` — whose ref is\n * typed as either. React Aria types each of its elements' refs to the one\n * element it renders, and a ref object typed to two cannot be handed to\n * either: its `current` could hold the other. A callback can, since it only\n * ever receives the element, and an element of either type is one the ref\n * accepts. A callback the call site passed is handed through as it is.\n */\nfunction refCallback<E>(ref: Ref<E> | undefined): RefCallback<E> | undefined {\n if (ref === undefined || ref === null) {\n return undefined\n }\n\n if (typeof ref === 'function') {\n return ref\n }\n\n return (element) => {\n ref.current = element\n }\n}\n\nexport type { AttachableRef }\n\nexport { mergeRefs, refCallback }\n"],"mappings":";AAMA,SAASK,OAAUC,KAAuBC,MAA4B;CACpE,IAAI,OAAOD,QAAQ,YAAY;EAC7B,MAAME,UAAUF,IAAIC,IAAI;EACxB,OAAO,OAAOC,YAAY,aACtBA,gBACM;GACJF,IAAI,IAAI;EACV;CACN;CACAA,IAAIG,UAAUF;CACd,aAAa;EACXD,IAAIG,UAAU;CAChB;AACF;;;;;;;;;;;AAYA,SAASC,UACPC,GACAC,GAC8B;CAC9B,IAAID,MAAME,KAAAA,GACR,OAAOD;CAET,IAAIA,MAAMC,KAAAA,GACR,OAAOF;CAET,QAAQJ,SAAmB;EACzB,MAAMO,UAAUT,OAAOM,GAAGJ,IAAI;EAC9B,MAAMQ,UAAUV,OAAOO,GAAGL,IAAI;EAC9B,aAAa;GACXO,QAAQ;GACRC,QAAQ;EACV;CACF;AACF;;;;;;;;;;;;AAaA,SAASC,YAAeV,KAAqD;CAC3E,IAAIA,QAAQO,KAAAA,KAAaP,QAAQ,MAC/B;CAGF,IAAI,OAAOA,QAAQ,YACjB,OAAOA;CAGT,QAAQW,YAAY;EAClBX,IAAIG,UAAUQ;CAChB;AACF"}
1
+ {"version":3,"file":"ref.js","names":["attach","ref","node","cleanup","current","mergeRefs","a","b","undefined","detachA","detachB","refCallback","element"],"sources":["../../src/render/ref.ts"],"sourcesContent":["import type { Ref, RefCallback } from 'react'\n\n// A ref that can be written through. React reads a `null` ref as none at all,\n// so a merge is only ever handed one that is there.\ntype AttachableRef<E> = NonNullable<Ref<E>>\n\nfunction attach<E>(ref: AttachableRef<E>, node: E | null): () => void {\n if (typeof ref === 'function') {\n const cleanup = ref(node)\n return typeof cleanup === 'function'\n ? cleanup\n : () => {\n ref(null)\n }\n }\n ref.current = node\n return () => {\n ref.current = null\n }\n}\n\n/**\n * One ref that feeds both, or whichever one there is. Attaching through a\n * callback lets each side keep its own cleanup: React 19 calls a callback\n * ref's returned function on detach in place of calling it with `null`, so\n * the merged callback returns one that does the same for each of the two.\n *\n * For an element that needs a ref of its own — a body measuring whether it\n * scrolls, a row clearing an attribute React Aria sets — and is handed the\n * call site's as well.\n */\nfunction mergeRefs<E>(\n a: AttachableRef<E> | undefined,\n b: AttachableRef<E> | undefined,\n): AttachableRef<E> | undefined {\n if (a === undefined) {\n return b\n }\n if (b === undefined) {\n return a\n }\n return (node: E | null) => {\n const detachA = attach(a, node)\n const detachB = attach(b, node)\n return () => {\n detachA()\n detachB()\n }\n }\n}\n\n/**\n * A call site's ref, as a callback that writes the element into it.\n *\n * For a component that renders one of two elements — Button and IconButton a\n * `<button>` or an `<a>`, ListItem a `<div>` or a `<button>` — whose ref is\n * typed as either. React Aria types each of its elements' refs to the one\n * element it renders, and a ref object typed to two cannot be handed to\n * either: its `current` could hold the other. A callback can, since it only\n * ever receives the element, and an element of either type is one the ref\n * accepts. A callback the call site passed is handed through as it is.\n */\nfunction refCallback<E>(ref: Ref<E> | undefined): RefCallback<E> | undefined {\n if (ref === undefined || ref === null) {\n return undefined\n }\n\n if (typeof ref === 'function') {\n return ref\n }\n\n return (element) => {\n ref.current = element\n }\n}\n\nexport type { AttachableRef }\n\nexport { mergeRefs, refCallback }\n"],"mappings":";AAMA,SAASA,OAAUC,KAAuBC,MAA4B;CACpE,IAAI,OAAOD,QAAQ,YAAY;EAC7B,MAAME,UAAUF,IAAIC,IAAI;EACxB,OAAO,OAAOC,YAAY,aACtBA,gBACM;GACJF,IAAI,IAAI;EACV;CACN;CACAA,IAAIG,UAAUF;CACd,aAAa;EACXD,IAAIG,UAAU;CAChB;AACF;;;;;;;;;;;AAYA,SAASC,UACPC,GACAC,GAC8B;CAC9B,IAAID,MAAME,KAAAA,GACR,OAAOD;CAET,IAAIA,MAAMC,KAAAA,GACR,OAAOF;CAET,QAAQJ,SAAmB;EACzB,MAAMO,UAAUT,OAAOM,GAAGJ,IAAI;EAC9B,MAAMQ,UAAUV,OAAOO,GAAGL,IAAI;EAC9B,aAAa;GACXO,QAAQ;GACRC,QAAQ;EACV;CACF;AACF;;;;;;;;;;;;AAaA,SAASC,YAAeV,KAAqD;CAC3E,IAAIA,QAAQO,KAAAA,KAAaP,QAAQ,MAC/B;CAGF,IAAI,OAAOA,QAAQ,YACjB,OAAOA;CAGT,QAAQW,YAAY;EAClBX,IAAIG,UAAUQ;CAChB;AACF"}
@@ -22,5 +22,4 @@ type RenderFunctionProps = HTMLAttributes<any> & {
22
22
  ref?: Ref<any> | undefined;
23
23
  };
24
24
  type RenderProp = ((props: RenderFunctionProps) => ReactElement) | ReactElement;
25
- export type { RenderComponentProps, RenderFunctionProps };
26
- //# sourceMappingURL=useRender.d.ts.map
25
+ export type { RenderComponentProps, RenderFunctionProps };
@@ -1 +1 @@
1
- {"version":3,"file":"useRender.js","names":["ComponentPropsWithRef","CSSProperties","HTMLAttributes","JSX","ReactElement","Ref","RefCallback","RefObject","cloneElement","createElement","isValidElement","useMemo","AttachableRef","SharedAttachableRef","mergeRefs","Element","Handler","args","ReadonlyArray","IntrinsicTag","IntrinsicElements","RenderComponentProps","Tag","render","RenderProp","RenderFunctionProps","ref","props","UseRenderParameters","defaultTagName","Record","isHandler","value","isHandlerKey","key","test","isRefCallback","isRefObject","joinClassNames","names","filter","Boolean","join","undefined","mergeElementProps","ours","theirs","merged","className","stringOf","style","mergeStyleObjects","styleOf","Object","keys","own","their","refOf","useRender","t0","$","_c","t1","t2","t3","element","t4","t5","type","_c"],"sources":["../../src/render/useRender.tsx"],"sourcesContent":["import type {\n ComponentPropsWithRef,\n CSSProperties,\n HTMLAttributes,\n JSX,\n ReactElement,\n Ref,\n RefCallback,\n RefObject,\n} from 'react'\n\nimport { cloneElement, createElement, isValidElement, useMemo } from 'react'\n\nimport type { AttachableRef as SharedAttachableRef } from './ref'\n\nimport { mergeRefs } from './ref'\n\n// A ref the hook can write through. `refOf` turns a `null` one into\n// `undefined` before a merge sees it.\ntype AttachableRef = SharedAttachableRef<Element>\n\ntype Handler = (...args: ReadonlyArray<unknown>) => unknown\n\ntype IntrinsicTag = keyof JSX.IntrinsicElements\n\n/**\n * The props of a component rendered through {@link useRender}: everything the\n * element accepts, plus `render`.\n */\ntype RenderComponentProps<Tag extends IntrinsicTag> =\n ComponentPropsWithRef<Tag> & {\n /**\n * Replaces the element the component renders by default: another tag, as\n * `render={<h2 />}`, or a function returning the element to render, given\n * the props the component would have put on its own.\n */\n render?: RenderProp | undefined\n }\n\n/**\n * What a `render` function is handed: the element's props, merged and ready\n * to spread onto whatever element it returns. `any` on purpose, in the one\n * place it appears — the function may return any element, and a ref typed for\n * one of them would refuse every other.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\ntype RenderFunctionProps = HTMLAttributes<any> & { ref?: Ref<any> | undefined }\n\ntype RenderProp = ((props: RenderFunctionProps) => ReactElement) | ReactElement\n\ninterface UseRenderParameters {\n /**\n * The tag rendered when `render` is not given.\n * @default 'div'\n */\n defaultTagName?: IntrinsicTag | undefined\n /** The props to put on whichever element ends up rendered. */\n props?: Record<string, unknown> | undefined\n render?: RenderProp | undefined\n}\n\nfunction isHandler(value: unknown): value is Handler {\n return typeof value === 'function'\n}\n\nfunction isHandlerKey(key: string) {\n return /^on[A-Z]/u.test(key)\n}\n\nfunction isRefCallback(value: unknown): value is RefCallback<Element> {\n return typeof value === 'function'\n}\n\nfunction isRefObject(value: unknown): value is RefObject<Element | null> {\n return typeof value === 'object' && value !== null && 'current' in value\n}\n\n// undefined rather than '' when there is nothing to say, so an element with\n// no classes on either side renders without a class attribute at all.\nfunction joinClassNames(...names: ReadonlyArray<string | undefined>) {\n return names.filter(Boolean).join(' ') || undefined\n}\n\n/**\n * The component's props over the element's own. The element wins a plain\n * conflict — it is the more specific of the two — while class names, styles\n * and handlers are combined rather than chosen between. `ref` is left out:\n * the hook merges the two refs itself.\n */\nfunction mergeElementProps(\n ours: Record<string, unknown>,\n theirs: Record<string, unknown>,\n) {\n const merged: Record<string, unknown> = { ...ours, ...theirs }\n\n merged.className = joinClassNames(\n stringOf(ours.className),\n stringOf(theirs.className),\n )\n merged.style = mergeStyleObjects(styleOf(ours.style), styleOf(theirs.style))\n\n for (const key of Object.keys(theirs)) {\n const own = ours[key]\n const their = theirs[key]\n if (isHandlerKey(key) && isHandler(own) && isHandler(their)) {\n // The element's own handler runs first, as the more specific one.\n merged[key] = (...args: ReadonlyArray<unknown>) => {\n their(...args)\n own(...args)\n }\n }\n }\n\n delete merged.ref\n return merged\n}\n\nfunction mergeStyleObjects(\n ours: CSSProperties | undefined,\n theirs: CSSProperties | undefined,\n) {\n if (ours === undefined && theirs === undefined) {\n return undefined\n }\n return { ...ours, ...theirs }\n}\n\nfunction refOf(value: unknown): AttachableRef | undefined {\n if (isRefCallback(value) || isRefObject(value)) {\n return value\n }\n return undefined\n}\n\nfunction stringOf(value: unknown) {\n return typeof value === 'string' ? value : undefined\n}\n\nfunction styleOf(value: unknown) {\n return typeof value === 'object' && value !== null\n ? (value as CSSProperties)\n : undefined\n}\n\n/**\n * Renders a component's element, or whatever its `render` prop asks for\n * instead.\n *\n * `render` is either a React element, cloned with the component's props\n * merged over its own — class names joined, styles merged, event handlers\n * chained, the element's own value winning any other conflict — or a function\n * handed those merged props to return an element of its choosing. Without one,\n * `defaultTagName` is rendered. A default `button` is given `type=\"button\"`,\n * since a bare one submits any form it happens to sit in.\n *\n * The element form is the point of owning this. React Aria's own `render`\n * is a function that must return the element the component would have\n * rendered itself, which suits its interactive components and nothing else;\n * the non-interactive ones here take `render={<h2 />}`, and keeping that\n * contract in a hook of the library's own is what lets them stay put\n * whichever behaviour library sits underneath the rest.\n */\nfunction useRender({\n defaultTagName = 'div',\n props = {},\n render,\n}: UseRenderParameters): ReactElement {\n const element = isValidElement<Record<string, unknown>>(render)\n ? render\n : undefined\n\n // Both refs, when there are two, have to land on one node. The merged\n // callback is memoised so React does not detach and re-attach it on every\n // render — a new identity each time would.\n //\n // The dependencies are the props the refs are read from rather than the\n // refs themselves. React writes through a ref object, so the compiler reads\n // one as a value that may be modified later and declines to preserve a\n // memoisation keyed on it — which, under the panic threshold this lands\n // beside, fails the build. A prop it can prove holds still.\n const ref = useMemo(\n () => mergeRefs(refOf(props.ref), refOf(element?.props.ref)),\n [props.ref, element?.props.ref],\n )\n\n if (element !== undefined) {\n return cloneElement(element, {\n ...mergeElementProps(props, element.props),\n ref,\n })\n }\n\n if (typeof render === 'function') {\n return render({ ...props, ref } as RenderFunctionProps)\n }\n\n return createElement(\n defaultTagName,\n defaultTagName === 'button'\n ? { type: 'button', ...props, ref }\n : { ...props, ref },\n )\n}\n\nexport type { RenderComponentProps, RenderFunctionProps, UseRenderParameters }\n\nexport { useRender }\n"],"mappings":";;;;AA6DA,SAAS+B,UAAUC,OAAkC;CACnD,OAAO,OAAOA,UAAU;AAC1B;AAEA,SAASC,aAAaC,KAAa;CACjC,OAAO,YAAYC,KAAKD,GAAG;AAC7B;AAEA,SAASE,cAAcJ,OAA+C;CACpE,OAAO,OAAOA,UAAU;AAC1B;AAEA,SAASK,YAAYL,OAAoD;CACvE,OAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQ,aAAaA;AACrE;AAIA,SAASM,eAAe,GAAGC,OAA0C;CACnE,OAAOA,MAAMC,OAAOC,OAAO,CAAC,CAACC,KAAK,GAAG,KAAKC,KAAAA;AAC5C;;;;;;;AAQA,SAASC,kBACPC,MACAC,QACA;CACA,MAAMC,SAAkC;EAAE,GAAGF;EAAM,GAAGC;CAAO;CAE7DC,OAAOC,YAAYV,eACjBW,SAASJ,KAAKG,SAAS,G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C,MACY;GAAQ,GAAKzC;GAAKD;EACV,IAFpB;GAAA,GAESC;GAAKD;EAAM,CACtB;EAACkC,EAAA,MAAA/B;EAAA+B,EAAA,MAAAjC;EAAAiC,EAAA,MAAAlC;EAAAkC,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OALMO;AAKN"}
1
+ {"version":3,"file":"useRender.js","names":["cloneElement","createElement","isValidElement","mergeRefs","args","render","ref","props","defaultTagName","isHandler","value","isHandlerKey","key","test","isRefCallback","isRefObject","joinClassNames","names","filter","Boolean","join","undefined","mergeElementProps","ours","theirs","merged","className","stringOf","style","mergeStyleObjects","styleOf","Object","keys","own","their","refOf","useRender","t0","$","_c","t1","t2","t3","element","t4","t5","type"],"sources":["../../src/render/useRender.tsx"],"sourcesContent":["import type {\n ComponentPropsWithRef,\n CSSProperties,\n HTMLAttributes,\n JSX,\n ReactElement,\n Ref,\n RefCallback,\n RefObject,\n} from 'react'\n\nimport { cloneElement, createElement, isValidElement, useMemo } from 'react'\n\nimport type { AttachableRef as SharedAttachableRef } from './ref'\n\nimport { mergeRefs } from './ref'\n\n// A ref the hook can write through. `refOf` turns a `null` one into\n// `undefined` before a merge sees it.\ntype AttachableRef = SharedAttachableRef<Element>\n\ntype Handler = (...args: ReadonlyArray<unknown>) => unknown\n\ntype IntrinsicTag = keyof JSX.IntrinsicElements\n\n/**\n * The props of a component rendered through {@link useRender}: everything the\n * element accepts, plus `render`.\n */\ntype RenderComponentProps<Tag extends IntrinsicTag> =\n ComponentPropsWithRef<Tag> & {\n /**\n * Replaces the element the component renders by default: another tag, as\n * `render={<h2 />}`, or a function returning the element to render, given\n * the props the component would have put on its own.\n */\n render?: RenderProp | undefined\n }\n\n/**\n * What a `render` function is handed: the element's props, merged and ready\n * to spread onto whatever element it returns. `any` on purpose, in the one\n * place it appears — the function may return any element, and a ref typed for\n * one of them would refuse every other.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\ntype RenderFunctionProps = HTMLAttributes<any> & { ref?: Ref<any> | undefined }\n\ntype RenderProp = ((props: RenderFunctionProps) => ReactElement) | ReactElement\n\ninterface UseRenderParameters {\n /**\n * The tag rendered when `render` is not given.\n * @default 'div'\n */\n defaultTagName?: IntrinsicTag | undefined\n /** The props to put on whichever element ends up rendered. */\n props?: Record<string, unknown> | undefined\n render?: RenderProp | undefined\n}\n\nfunction isHandler(value: unknown): value is Handler {\n return typeof value === 'function'\n}\n\nfunction isHandlerKey(key: string) {\n return /^on[A-Z]/u.test(key)\n}\n\nfunction isRefCallback(value: unknown): value is RefCallback<Element> {\n return typeof value === 'function'\n}\n\nfunction isRefObject(value: unknown): value is RefObject<Element | null> {\n return typeof value === 'object' && value !== null && 'current' in value\n}\n\n// undefined rather than '' when there is nothing to say, so an element with\n// no classes on either side renders without a class attribute at all.\nfunction joinClassNames(...names: ReadonlyArray<string | undefined>) {\n return names.filter(Boolean).join(' ') || undefined\n}\n\n/**\n * The component's props over the element's own. The element wins a plain\n * conflict — it is the more specific of the two — while class names, styles\n * and handlers are combined rather than chosen between. `ref` is left out:\n * the hook merges the two refs itself.\n */\nfunction mergeElementProps(\n ours: Record<string, unknown>,\n theirs: Record<string, unknown>,\n) {\n const merged: Record<string, unknown> = { ...ours, ...theirs }\n\n merged.className = joinClassNames(\n stringOf(ours.className),\n stringOf(theirs.className),\n )\n merged.style = mergeStyleObjects(styleOf(ours.style), styleOf(theirs.style))\n\n for (const key of Object.keys(theirs)) {\n const own = ours[key]\n const their = theirs[key]\n if (isHandlerKey(key) && isHandler(own) && isHandler(their)) {\n // The element's own handler runs first, as the more specific one.\n merged[key] = (...args: ReadonlyArray<unknown>) => {\n their(...args)\n own(...args)\n }\n }\n }\n\n delete merged.ref\n return merged\n}\n\nfunction mergeStyleObjects(\n ours: CSSProperties | undefined,\n theirs: CSSProperties | undefined,\n) {\n if (ours === undefined && theirs === undefined) {\n return undefined\n }\n return { ...ours, ...theirs }\n}\n\nfunction refOf(value: unknown): AttachableRef | undefined {\n if (isRefCallback(value) || isRefObject(value)) {\n return value\n }\n return undefined\n}\n\nfunction stringOf(value: unknown) {\n return typeof value === 'string' ? value : undefined\n}\n\nfunction styleOf(value: unknown) {\n return typeof value === 'object' && value !== null\n ? (value as CSSProperties)\n : undefined\n}\n\n/**\n * Renders a component's element, or whatever its `render` prop asks for\n * instead.\n *\n * `render` is either a React element, cloned with the component's props\n * merged over its own — class names joined, styles merged, event handlers\n * chained, the element's own value winning any other conflict — or a function\n * handed those merged props to return an element of its choosing. Without one,\n * `defaultTagName` is rendered. A default `button` is given `type=\"button\"`,\n * since a bare one submits any form it happens to sit in.\n *\n * The element form is the point of owning this. React Aria's own `render`\n * is a function that must return the element the component would have\n * rendered itself, which suits its interactive components and nothing else;\n * the non-interactive ones here take `render={<h2 />}`, and keeping that\n * contract in a hook of the library's own is what lets them stay put\n * whichever behaviour library sits underneath the rest.\n */\nfunction useRender({\n defaultTagName = 'div',\n props = {},\n render,\n}: UseRenderParameters): ReactElement {\n const element = isValidElement<Record<string, unknown>>(render)\n ? render\n : undefined\n\n // Both refs, when there are two, have to land on one node. The merged\n // callback is memoised so React does not detach and re-attach it on every\n // render — a new identity each time would.\n //\n // The dependencies are the props the refs are read from rather than the\n // refs themselves. React writes through a ref object, so the compiler reads\n // one as a value that may be modified later and declines to preserve a\n // memoisation keyed on it — which, under the panic threshold this lands\n // beside, fails the build. A prop it can prove holds still.\n const ref = useMemo(\n () => mergeRefs(refOf(props.ref), refOf(element?.props.ref)),\n [props.ref, element?.props.ref],\n )\n\n if (element !== undefined) {\n return cloneElement(element, {\n ...mergeElementProps(props, element.props),\n ref,\n })\n }\n\n if (typeof render === 'function') {\n return render({ ...props, ref } as RenderFunctionProps)\n }\n\n return createElement(\n defaultTagName,\n defaultTagName === 'button'\n ? { type: 'button', ...props, ref }\n : { ...props, ref },\n )\n}\n\nexport type { RenderComponentProps, RenderFunctionProps, UseRenderParameters }\n\nexport { useRender }\n"],"mappings":";;;;AA6DA,SAASS,UAAUC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AA,KAAAP,EAAA;EAAA,OAHKO;CAGL;CAGJ,IAAI,OAAOxC,WAAW,YAAU;EAAA,IAAAwC;EAAA,IAAAP,EAAA,OAAA/B,SAAA+B,EAAA,QAAAhC,OAAAgC,EAAA,QAAAjC,QAAA;GACvBwC,KAAAxC,OAAO;IAAA,GAAKE;IAAKD;GAAM,CAAwB;GAACgC,EAAA,KAAA/B;GAAA+B,EAAA,MAAAhC;GAAAgC,EAAA,MAAAjC;GAAAiC,EAAA,MAAAO;EAAA,OAAAA,KAAAP,EAAA;EAAA,OAAhDO;CAAgD;CACxD,IAAAA;CAAA,IAAAP,EAAA,QAAA9B,kBAAA8B,EAAA,QAAA/B,SAAA+B,EAAA,QAAAhC,KAAA;EAEMuC,KAAA5C,cACLO,gBACAA,mBAAmB,WAAnB;GAAAsC,MACY;GAAQ,GAAKvC;GAAKD;EACV,IAFpB;GAAA,GAESC;GAAKD;EAAM,CACtB;EAACgC,EAAA,MAAA9B;EAAA8B,EAAA,MAAA/B;EAAA+B,EAAA,MAAAhC;EAAAgC,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OALMO;AAKN"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","stylex","hasContent","rowStyles","supportingTone","RowContentProps","chevron","children","isDisabled","isEmphasized","isSelected","leading","overline","selection","supporting","trailing","variant","RowVariant","RowContent","t0","$","_c","t1","t2","t3","t4","undefined","label","faded","t5","t6","t7","t8","t9","tone","slotDisabled","t10","props","slot","leadingSlot","Symbol","for","main","t11","headlineMenu","headlineList","headlineEmphasis","t12","_c","stylex.props"],"sources":["../../src/row/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { hasContent } from '../render/content';\nimport { rowStyles, supportingTone } from './styles';\ninterface RowContentProps {\n /**\n * The caret a tree row opens with, ahead of `selection` and `leading`.\n * Faded with `leading` while the row is disabled.\n */\n chevron?: ReactNode;\n /** The row's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /**\n * Whether the row is disabled. The supporting line takes the row's own\n * faded colour when it is, rather than staying at full strength in the\n * muted role, and the leading and trailing content fades with it.\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Whether the headline is drawn heavier than its variant's own weight, for\n * a row marked without the container a selected one takes. The navigation\n * drawer's trail to the current row is what asks for it.\n * @default false\n */\n isEmphasized?: boolean;\n /**\n * Whether the row is selected. The supporting line takes the selected\n * container's own content role when it is, rather than staying in the\n * muted role it draws on the surface.\n * @default false\n */\n isSelected?: boolean;\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /**\n * A line above the headline, in the page's label-small and the same muted\n * role the supporting line takes.\n */\n overline?: ReactNode;\n /**\n * The checkbox a selecting row draws, between `chevron` and `leading`.\n * React Aria disables it with the row and it draws that state itself, so\n * it stays out of the fade the rest of the slot takes rather than fading\n * twice.\n */\n selection?: ReactNode;\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n /**\n * Which spec page's row this is. A list item's headline is body-large; a\n * menu item's label and a navigation drawer row's are label-large. The\n * element around the content applies the matching `rowStyles.list`,\n * `rowStyles.menu` or `rowStyles.drawer` beside `rowStyles.base`.\n * @default 'list'\n */\n variant?: RowVariant;\n}\ntype RowVariant = 'drawer' | 'list' | 'menu';\n\n/**\n * The inside of a row: the leading slot, the headline with its supporting\n * line, and the trailing slot, each rendered only when given. The element\n * around it is the caller's — ListItem's div or button, a collection's item —\n * and takes `rowStyles.base`, the variant's own style, and whichever states\n * apply; this is what every one of them puts inside it, so a list, a menu, a\n * tree and a drawer draw the same row.\n *\n * Not a component of the library's own and not exported; see `src/field` for\n * the same arrangement around a field.\n */\nfunction RowContent({\n chevron,\n children,\n isDisabled = false,\n isEmphasized = false,\n isSelected = false,\n leading,\n overline,\n selection,\n supporting,\n trailing,\n variant = 'list'\n}: RowContentProps) {\n // The drawer's label is the menu's, so the two share the headline style;\n // what they do not share is the container a selected row brings, which is\n // why the tone below still asks which variant this is.\n const label = variant === 'drawer' || variant === 'menu';\n const tone = supportingTone(variant, {\n isDisabled,\n isSelected\n });\n const faded = isDisabled && rowStyles.slotDisabled;\n const leadingSlot = !hasContent(leading) ? null : <span {...stylex.props(rowStyles.slot, faded)}>{leading}</span>;\n return <>\n {/*\n * The caret, the checkbox and the leading content share one slot, with\n * nothing between them, so a column of rows lines each of them up. The\n * two that fade are slots of their own inside it.\n */}\n {!hasContent(chevron) && !hasContent(selection) ? leadingSlot : <span {...stylex.props(rowStyles.slot)}>\n {!hasContent(chevron) ? null : <span {...stylex.props(rowStyles.slot, faded)}>{chevron}</span>}\n {selection}\n {leadingSlot}\n </span>}\n <span {...stylex.props(rowStyles.main)}>\n {!hasContent(overline) ? null : <span {...stylex.props(rowStyles.overline, tone)}>{overline}</span>}\n <span {...stylex.props(label ? rowStyles.headlineMenu : rowStyles.headlineList, isEmphasized && rowStyles.headlineEmphasis)}>\n {children}\n </span>\n {!hasContent(supporting) ? null : <span {...stylex.props(rowStyles.supporting, tone)}>\n {supporting}\n </span>}\n </span>\n {!hasContent(trailing) ? null : <span {...stylex.props(rowStyles.slot, faded)}>{trailing}</span>}\n </>;\n}\nexport type { RowContentProps, RowVariant };\nexport { RowContent };"],"mappings":";;;;;;;;;;;;;;;;;AAyEA,SAAAkB,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAoB,MAAA,EAAAf,SAAAC,UAAAC,YAAAc,IAAAb,cAAAc,IAAAb,YAAAc,IAAAb,SAAAC,UAAAC,WAAAC,YAAAC,UAAAC,SAAAS,OAAAN;CAGlB,MAAAX,aAAAc,OAAAI,KAAAA,IAAA,QAAAJ;CACA,MAAAb,eAAAc,OAAAG,KAAAA,IAAA,QAAAH;CACA,MAAAb,aAAAc,OAAAE,KAAAA,IAAA,QAAAF;CAMA,MAAAR,UAAAS,OAAAC,KAAAA,IAAA,SAAAD;CAKA,MAAAE,QAAc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A,MAAAY;EAAAZ,EAAA,MAAAa;CAAA,OAAA;EAAAL,QAAAR,EAAA;EAAAS,KAAAT,EAAA;EAAAU,KAAAV,EAAA;EAAAW,KAAAX,EAAA;EAAAY,KAAAZ,EAAA;EAAAa,KAAAb,EAAA;CAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAW,MAAAX,EAAA,QAAAY,IAAA;EAPXI,MAAA,qBAAA,QAAA;GAQO,GARGP;GAAV,UAAA;IACGC;IACDC;IAGCC;GAGI;;EAAAZ,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAgB;CAAA,OAAAA,MAAAhB,EAAA;CAAA,IAAAuB;CAAA,IAAAvB,EAAA,QAAAQ,SAAAR,EAAA,QAAAL,UAAA;EACN4B,MAAA,CAACzC,WAAWa,QAAQ,IAApB,OAA+B,oBAAA,QAAA;GAAgE,GAAtDd,MAAaE,UAASmC,MAAOV,KAAK;GAAIb,UAAAA;EAAgB,CAAA;EAAAK,EAAA,MAAAQ;EAAAR,EAAA,MAAAL;EAAAK,EAAA,MAAAuB;CAAA,OAAAA,MAAAvB,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAgB,OAAAhB,EAAA,QAAAuB,OAAAvB,EAAA,QAAAa,IAAA;EApB7Fc,MAAA,qBAAA,UAAA,EAAA,UAAA;GAMFd;GAKDG;GASCO;EAA+F,EAAA,CAAA;EAC/FvB,EAAA,MAAAgB;EAAAhB,EAAA,MAAAuB;EAAAvB,EAAA,MAAAa;EAAAb,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,OArBE2B;AAqBF"}
1
+ {"version":3,"file":"index.js","names":["stylex","hasContent","rowStyles","supportingTone","chevron","children","isDisabled","isEmphasized","isSelected","leading","overline","selection","supporting","trailing","variant","RowContent","t0","$","_c","t1","t2","t3","t4","undefined","label","faded","t5","t6","t7","t8","t9","tone","slotDisabled","t10","slot","leadingSlot","Symbol","for","main","t11","headlineMenu","headlineList","headlineEmphasis","t12"],"sources":["../../src/row/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { hasContent } from '../render/content';\nimport { rowStyles, supportingTone } from './styles';\ninterface RowContentProps {\n /**\n * The caret a tree row opens with, ahead of `selection` and `leading`.\n * Faded with `leading` while the row is disabled.\n */\n chevron?: ReactNode;\n /** The row's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /**\n * Whether the row is disabled. The supporting line takes the row's own\n * faded colour when it is, rather than staying at full strength in the\n * muted role, and the leading and trailing content fades with it.\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Whether the headline is drawn heavier than its variant's own weight, for\n * a row marked without the container a selected one takes. The navigation\n * drawer's trail to the current row is what asks for it.\n * @default false\n */\n isEmphasized?: boolean;\n /**\n * Whether the row is selected. The supporting line takes the selected\n * container's own content role when it is, rather than staying in the\n * muted role it draws on the surface.\n * @default false\n */\n isSelected?: boolean;\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /**\n * A line above the headline, in the page's label-small and the same muted\n * role the supporting line takes.\n */\n overline?: ReactNode;\n /**\n * The checkbox a selecting row draws, between `chevron` and `leading`.\n * React Aria disables it with the row and it draws that state itself, so\n * it stays out of the fade the rest of the slot takes rather than fading\n * twice.\n */\n selection?: ReactNode;\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n /**\n * Which spec page's row this is. A list item's headline is body-large; a\n * menu item's label and a navigation drawer row's are label-large. The\n * element around the content applies the matching `rowStyles.list`,\n * `rowStyles.menu` or `rowStyles.drawer` beside `rowStyles.base`.\n * @default 'list'\n */\n variant?: RowVariant;\n}\ntype RowVariant = 'drawer' | 'list' | 'menu';\n\n/**\n * The inside of a row: the leading slot, the headline with its supporting\n * line, and the trailing slot, each rendered only when given. The element\n * around it is the caller's — ListItem's div or button, a collection's item —\n * and takes `rowStyles.base`, the variant's own style, and whichever states\n * apply; this is what every one of them puts inside it, so a list, a menu, a\n * tree and a drawer draw the same row.\n *\n * Not a component of the library's own and not exported; see `src/field` for\n * the same arrangement around a field.\n */\nfunction RowContent({\n chevron,\n children,\n isDisabled = false,\n isEmphasized = false,\n isSelected = false,\n leading,\n overline,\n selection,\n supporting,\n trailing,\n variant = 'list'\n}: RowContentProps) {\n // The drawer's label is the menu's, so the two share the headline style;\n // what they do not share is the container a selected row brings, which is\n // why the tone below still asks which variant this is.\n const label = variant === 'drawer' || variant === 'menu';\n const tone = supportingTone(variant, {\n isDisabled,\n isSelected\n });\n const faded = isDisabled && rowStyles.slotDisabled;\n const leadingSlot = !hasContent(leading) ? null : <span {...stylex.props(rowStyles.slot, faded)}>{leading}</span>;\n return <>\n {/*\n * The caret, the checkbox and the leading content share one slot, with\n * nothing between them, so a column of rows lines each of them up. The\n * two that fade are slots of their own inside it.\n */}\n {!hasContent(chevron) && !hasContent(selection) ? leadingSlot : <span {...stylex.props(rowStyles.slot)}>\n {!hasContent(chevron) ? null : <span {...stylex.props(rowStyles.slot, faded)}>{chevron}</span>}\n {selection}\n {leadingSlot}\n </span>}\n <span {...stylex.props(rowStyles.main)}>\n {!hasContent(overline) ? null : <span {...stylex.props(rowStyles.overline, tone)}>{overline}</span>}\n <span {...stylex.props(label ? rowStyles.headlineMenu : rowStyles.headlineList, isEmphasized && rowStyles.headlineEmphasis)}>\n {children}\n </span>\n {!hasContent(supporting) ? null : <span {...stylex.props(rowStyles.supporting, tone)}>\n {supporting}\n </span>}\n </span>\n {!hasContent(trailing) ? null : <span {...stylex.props(rowStyles.slot, faded)}>{trailing}</span>}\n </>;\n}\nexport type { RowContentProps, RowVariant };\nexport { RowContent };"],"mappings":";;;;;;;;;;;;;;;;;AAyEA,SAAAe,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA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A;EApB7Fa,MAAA,qBAAA,UAAA,EAAA,UAAA;GAMFb;GAKDG;GASCM;EAA+F,EAAA,CAAA;EAC/FtB,EAAA,MAAAgB;EAAAhB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAa;EAAAb,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,OArBE0B;AAqBF"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["stylex","RowVariant","colors","radii","shadows","sizing","spacing","stateLayerOpacity","typography","HOVER_CAPABLE","FORCED_COLORS","rowStyles","base","kGNEyG","kWkggS","kMzoRj","kB7OPa","kMwMTN","k1xSpc","kOIVth","kzqmXN","k8WAf4","kg3NbH","kVAEAm","k9WMMc","kMnn75","$$css","disabled","kkrTdU","kAXs8y","dragging","kKwaWg","kGVxlE","kY2c9j","drawer","kaIpWk","kUOVxO","kAzted","drawerSurface","dropTarget","kjBf7l","kInvED","k3XXqK","kMeerF","focusVisible","headlineEmphasis","k63SB2","headlineList","kMv6JI","kGuDYH","kb6lSQ","kLWn49","kHjlTd","headlineMenu","hovered","interactive","kVVagm","interactiveLayers","list","main","kXwgrk","kzQI83","k7Eaqz","menu","overline","pressed","selectedDrawer","selectedList","selectedMenu","slot","kmuXW","slotDisabled","kSiTet","supporting","supportingInherit","supportingSelectedDrawer","supportingSelectedList","supportingSelectedMenu","threeLine","twoLine","supportingTone","variant","isDisabled","isSelected"],"sources":["../../src/row/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport type { RowVariant } from '.';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The row every list draws: ListItem's, and from here on the item of every\n// collection the coverage plan adds — ListBox, Menu, List, Tree, the options\n// of Select and ComboBox. Apart from the RowContent component in ./index.tsx\n// so that file exports components alone, which is what keeps fast refresh\n// working for it.\n//\n// Three variants, because three spec pages draw three rows. The lists page\n// gives a list item a 56dp floor, a body-large headline and a body-medium\n// supporting line, and primary container when selected. The menus page gives\n// a menu item 48dp, a label-large label, and tertiary container when\n// selected. The navigation drawer page gives its row 56dp too, with a\n// label-large label like a menu's, and marks the current one with a\n// secondary-container pill held 12dp off each edge — 336dp of indicator in a\n// 360dp container, which is what that inset comes to. The layout, the\n// padding, the state layers and the disabled treatment are one row; `list`,\n// `menu` and `drawer` carry only what the three pages disagree on, and a\n// consumer applies one of them beside `base`.\n//\n// The block padding is the lists page's 8dp, which is what puts a row's\n// 40dp leading element — an avatar, a selection checkbox — on the 56dp\n// one-line height, and a 56dp one on 72. The page pads a three-line row 12dp\n// instead, which `threeLine` carries. A menu item and a drawer row hold one\n// line of text inside a taller floor, so their padding shows only on a label\n// that wraps.\n//\n// Laid out with flex rather than the grid the design draws. The design's\n// three columns are `auto 1fr auto`, which is what flex does natively — and\n// unlike a fixed three-column grid it stays correct when a row has no leading\n// or no trailing content, where the remaining children would otherwise slide\n// into the wrong columns.\n//\n// Rows align with each other through their leading content being the same\n// size, not through a fixed column width: a list of Avatars all at one size\n// lines up, and that is the same thing the design's 40px column achieves.\n//\n// The state layer composites over `transparent` rather than over a container\n// colour, because a row's own background is transparent and it therefore\n// tints whatever it happens to be sitting on — a card, a menu, or the page.\n// The two selected states are the ones that bring a container of their own.\n\n// A pointer that can hover, for `interactiveLayers` — a plain element with no\n// render state, so its hover layer is a pseudo-class, and Chromium leaves\n// `:hover` on whatever a touch last tapped. Inside this query a touch screen\n// draws no hover at all; a touchscreen laptop still matches it for its\n// trackpad.\nconst HOVER_CAPABLE = '@media (hover: hover)';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst rowStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf xs5hli\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xxj4525\",\n kzqmXN: \"xh8yej3\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n k9WMMc: \"x1yc453h\",\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n disabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n dragging: {\n kWkggS: \"x14s9m32\",\n kKwaWg: \"xdiex0u\",\n kGVxlE: \"x4r79n0\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n drawer: {\n kaIpWk: \"x1dkaolv\",\n kzqmXN: \"x14atkfc\",\n kUOVxO: \"xd2r6sq\",\n kAzted: \"xyax5pk\",\n $$css: true\n },\n drawerSurface: {\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xjp7ctv\",\n $$css: true\n },\n dropTarget: {\n kKwaWg: \"xu73ib2\",\n kjBf7l: \"xrgy624 x1x84bn5\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n focusVisible: {\n kKwaWg: \"x17vw94z\",\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n headlineEmphasis: {\n k63SB2: \"x1sfltvt\",\n $$css: true\n },\n headlineList: {\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n headlineMenu: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n hovered: {\n kKwaWg: \"xbmfk57\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n interactive: {\n kkrTdU: \"x1ypdohk\",\n kVVagm: \"xln7xf2\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n interactiveLayers: {\n kWkggS: \"x83qkoq x1yl1wq7 x10oam47 xkl27de xjqqt44 xjbqb8w\",\n $$css: true\n },\n list: {\n kAzted: \"xyax5pk\",\n $$css: true\n },\n main: {\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"x14qo01y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n },\n menu: {\n kAzted: \"x1ddmzdj\",\n $$css: true\n },\n overline: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n k63SB2: \"x1su64ma\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n pressed: {\n kKwaWg: \"xdiex0u\",\n $$css: true\n },\n selectedDrawer: {\n kWkggS: \"x15dekr4 x1jzqe4\",\n kMwMTN: \"x1sawysd x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectedList: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectedMenu: {\n kWkggS: \"xs6yvni x1jzqe4\",\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n slot: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n slotDisabled: {\n kMwMTN: \"x139gbkf x1bhcspo\",\n kSiTet: \"x1ppv7y9 x1tbh5bv\",\n $$css: true\n },\n supporting: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n supportingInherit: {\n kMwMTN: \"x1heor9g\",\n $$css: true\n },\n supportingSelectedDrawer: {\n kMwMTN: \"x1sawysd x1k5gbb1\",\n $$css: true\n },\n supportingSelectedList: {\n kMwMTN: \"xscdzaa x1k5gbb1\",\n $$css: true\n },\n supportingSelectedMenu: {\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n $$css: true\n },\n threeLine: {\n kGNEyG: \"x1cy8zhl\",\n kAzted: \"x1bt55z4\",\n k8WAf4: \"x1uvvd8r\",\n $$css: true\n },\n twoLine: {\n kAzted: \"x304zwk\",\n $$css: true\n }\n};\n\n/**\n * The tone a row's muted text takes over its own muted style: the supporting\n * line and the overline, and a menu item's shortcut. Nothing while the row is\n * drawn on the surface, where the muted style's on surface variant holds;\n * the selected container's own on-colour while selected; and the row's own\n * colour while disabled. Disabled is asked first, since a disabled row's own\n * colour is already the faded one and so wins over the selected container's\n * content role. One function for every caller, so a shortcut and the\n * supporting line beside it cannot come to disagree.\n */\nfunction supportingTone(variant: RowVariant, {\n isDisabled,\n isSelected\n}: {\n isDisabled: boolean;\n isSelected: boolean;\n}) {\n if (isDisabled) {\n return rowStyles.supportingInherit;\n }\n if (!isSelected) {\n return null;\n }\n // Each variant's container is a different colour family, and the muted\n // role is not guaranteed to be readable over any of them.\n if (variant === 'drawer') {\n return rowStyles.supportingSelectedDrawer;\n }\n if (variant === 'menu') {\n return rowStyles.supportingSelectedMenu;\n }\n return rowStyles.supportingSelectedList;\n}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,cAIC;CACD,IAAID,YACF,OAAOvE,UAAU+D;CAEnB,IAAI,CAACS,YACH,OAAO;CAIT,IAAIF,YAAY,UACd,OAAOtE,UAAUgE;CAEnB,IAAIM,YAAY,QACd,OAAOtE,UAAUkE;CAEnB,OAAOlE,UAAUiE;AACnB"}
1
+ {"version":3,"file":"styles.js","names":["rowStyles","base","kGNEyG","kWkggS","kMzoRj","kB7OPa","kMwMTN","k1xSpc","kOIVth","kzqmXN","k8WAf4","kg3NbH","kVAEAm","k9WMMc","kMnn75","$$css","disabled","kkrTdU","kAXs8y","dragging","kKwaWg","kGVxlE","kY2c9j","drawer","kaIpWk","kUOVxO","kAzted","drawerSurface","dropTarget","kjBf7l","kInvED","k3XXqK","kMeerF","focusVisible","headlineEmphasis","k63SB2","headlineList","kMv6JI","kGuDYH","kb6lSQ","kLWn49","kHjlTd","headlineMenu","hovered","interactive","kVVagm","interactiveLayers","list","main","kXwgrk","kzQI83","k7Eaqz","menu","overline","pressed","selectedDrawer","selectedList","selectedMenu","slot","kmuXW","slotDisabled","kSiTet","supporting","supportingInherit","supportingSelectedDrawer","supportingSelectedList","supportingSelectedMenu","threeLine","twoLine","supportingTone","variant","isDisabled","isSelected"],"sources":["../../src/row/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport type { RowVariant } from '.';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The row every list draws: ListItem's, and from here on the item of every\n// collection the coverage plan adds — ListBox, Menu, List, Tree, the options\n// of Select and ComboBox. Apart from the RowContent component in ./index.tsx\n// so that file exports components alone, which is what keeps fast refresh\n// working for it.\n//\n// Three variants, because three spec pages draw three rows. The lists page\n// gives a list item a 56dp floor, a body-large headline and a body-medium\n// supporting line, and primary container when selected. The menus page gives\n// a menu item 48dp, a label-large label, and tertiary container when\n// selected. The navigation drawer page gives its row 56dp too, with a\n// label-large label like a menu's, and marks the current one with a\n// secondary-container pill held 12dp off each edge — 336dp of indicator in a\n// 360dp container, which is what that inset comes to. The layout, the\n// padding, the state layers and the disabled treatment are one row; `list`,\n// `menu` and `drawer` carry only what the three pages disagree on, and a\n// consumer applies one of them beside `base`.\n//\n// The block padding is the lists page's 8dp, which is what puts a row's\n// 40dp leading element — an avatar, a selection checkbox — on the 56dp\n// one-line height, and a 56dp one on 72. The page pads a three-line row 12dp\n// instead, which `threeLine` carries. A menu item and a drawer row hold one\n// line of text inside a taller floor, so their padding shows only on a label\n// that wraps.\n//\n// Laid out with flex rather than the grid the design draws. The design's\n// three columns are `auto 1fr auto`, which is what flex does natively — and\n// unlike a fixed three-column grid it stays correct when a row has no leading\n// or no trailing content, where the remaining children would otherwise slide\n// into the wrong columns.\n//\n// Rows align with each other through their leading content being the same\n// size, not through a fixed column width: a list of Avatars all at one size\n// lines up, and that is the same thing the design's 40px column achieves.\n//\n// The state layer composites over `transparent` rather than over a container\n// colour, because a row's own background is transparent and it therefore\n// tints whatever it happens to be sitting on — a card, a menu, or the page.\n// The two selected states are the ones that bring a container of their own.\n\n// A pointer that can hover, for `interactiveLayers` — a plain element with no\n// render state, so its hover layer is a pseudo-class, and Chromium leaves\n// `:hover` on whatever a touch last tapped. Inside this query a touch screen\n// draws no hover at all; a touchscreen laptop still matches it for its\n// trackpad.\nconst HOVER_CAPABLE = '@media (hover: hover)';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst rowStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf xs5hli\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xxj4525\",\n kzqmXN: \"xh8yej3\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n kVAEAm: \"x1n2onr6\",\n k9WMMc: \"x1yc453h\",\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n disabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n dragging: {\n kWkggS: \"x14s9m32\",\n kKwaWg: \"xdiex0u\",\n kGVxlE: \"x4r79n0\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n drawer: {\n kaIpWk: \"x1dkaolv\",\n kzqmXN: \"x14atkfc\",\n kUOVxO: \"xd2r6sq\",\n kAzted: \"xyax5pk\",\n $$css: true\n },\n drawerSurface: {\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xjp7ctv\",\n $$css: true\n },\n dropTarget: {\n kKwaWg: \"xu73ib2\",\n kjBf7l: \"xrgy624 x1x84bn5\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n focusVisible: {\n kKwaWg: \"x17vw94z\",\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n headlineEmphasis: {\n k63SB2: \"x1sfltvt\",\n $$css: true\n },\n headlineList: {\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n headlineMenu: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n hovered: {\n kKwaWg: \"xbmfk57\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n interactive: {\n kkrTdU: \"x1ypdohk\",\n kVVagm: \"xln7xf2\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n interactiveLayers: {\n kWkggS: \"x83qkoq x1yl1wq7 x10oam47 xkl27de xjqqt44 xjbqb8w\",\n $$css: true\n },\n list: {\n kAzted: \"xyax5pk\",\n $$css: true\n },\n main: {\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"x14qo01y\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n },\n menu: {\n kAzted: \"x1ddmzdj\",\n $$css: true\n },\n overline: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n k63SB2: \"x1su64ma\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n pressed: {\n kKwaWg: \"xdiex0u\",\n $$css: true\n },\n selectedDrawer: {\n kWkggS: \"x15dekr4 x1jzqe4\",\n kMwMTN: \"x1sawysd x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectedList: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectedMenu: {\n kWkggS: \"xs6yvni x1jzqe4\",\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n slot: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n $$css: true\n },\n slotDisabled: {\n kMwMTN: \"x139gbkf x1bhcspo\",\n kSiTet: \"x1ppv7y9 x1tbh5bv\",\n $$css: true\n },\n supporting: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n supportingInherit: {\n kMwMTN: \"x1heor9g\",\n $$css: true\n },\n supportingSelectedDrawer: {\n kMwMTN: \"x1sawysd x1k5gbb1\",\n $$css: true\n },\n supportingSelectedList: {\n kMwMTN: \"xscdzaa x1k5gbb1\",\n $$css: true\n },\n supportingSelectedMenu: {\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n $$css: true\n },\n threeLine: {\n kGNEyG: \"x1cy8zhl\",\n kAzted: \"x1bt55z4\",\n k8WAf4: \"x1uvvd8r\",\n $$css: true\n },\n twoLine: {\n kAzted: \"x304zwk\",\n $$css: true\n }\n};\n\n/**\n * The tone a row's muted text takes over its own muted style: the supporting\n * line and the overline, and a menu item's shortcut. Nothing while the row is\n * drawn on the surface, where the muted style's on surface variant holds;\n * the selected container's own on-colour while selected; and the row's own\n * colour while disabled. Disabled is asked first, since a disabled row's own\n * colour is already the faded one and so wins over the selected container's\n * content role. One function for every caller, so a shortcut and the\n * supporting line beside it cannot come to disagree.\n */\nfunction supportingTone(variant: RowVariant, {\n isDisabled,\n isSelected\n}: {\n isDisabled: boolean;\n isSelected: boolean;\n}) {\n if (isDisabled) {\n return rowStyles.supportingInherit;\n }\n if (!isSelected) {\n return null;\n }\n // Each variant's container is a different colour family, and the muted\n // role is not guaranteed to be readable over any of them.\n if (variant === 'drawer') {\n return rowStyles.supportingSelectedDrawer;\n }\n if (variant === 'menu') {\n return rowStyles.supportingSelectedMenu;\n }\n return rowStyles.supportingSelectedList;\n}\nexport { rowStyles, supportingTone };"],"mappings":";AAyDA,MAAMA,YAAY;CAChBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ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Y,QACd,OAAOtE,UAAUkE;CAEnB,OAAOlE,UAAUiE;AACnB"}
@@ -3,9 +3,10 @@ import { segmentStyles } from "./styles.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { DateSegment } from "react-aria-components";
5
5
  // src/segments/index.tsx
6
+ const UNSEEN = /^[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]*$/u;
6
7
  function renderSegment(segment) {
7
8
  if (segment.type === "literal") return /* @__PURE__ */ jsx(DateSegment, {
8
- ...props(segmentStyles.segment, segmentStyles.segmentLiteral),
9
+ ...props(segmentStyles.segment, segmentStyles.segmentLiteral, !UNSEEN.test(segment.text) && segmentStyles.segmentSeparator),
9
10
  segment
10
11
  });
11
12
  return /* @__PURE__ */ jsx(DateSegment, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactElement","stylex","DateInput","RACDateInput","DateSegment","RACDateSegment","segmentStyles","Segment","Parameters","NonNullable","renderSegment","segment","type","props","segmentLiteral","segmentClassName","state","isDisabled","isFocused","isPlaceholder","segmentPlaceholder","segmentFocused","segmentDisabled","className","RACDateSegment","stylex.props"],"sources":["../../src/segments/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, DateSegment as RACDateSegment } from 'react-aria-components';\nimport { segmentStyles } from './styles';\n\n// How a date or a time is drawn once React Aria has decided what its parts\n// are. Shared by DateField and TimeField, which differ only in the value they\n// hold: the segments, their order and their number all come from React Aria,\n// so what is here is the same for both.\n\n// What React Aria hands the input for each part of the date. Taken off the\n// component rather than imported, since the segment type is not on the\n// package's public surface.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// What each segment draws. A literal — the slash or colon between two\n// segments — takes a style of its own, since it is punctuation rather than\n// something a reader types into.\nfunction renderSegment(segment: Segment): ReactElement {\n if (segment.type === 'literal') {\n return <RACDateSegment {...stylex.props(segmentStyles.segment, segmentStyles.segmentLiteral)} segment={segment} />;\n }\n return <RACDateSegment className={segmentClassName} segment={segment} />;\n}\n\n// A segment's classes, from React Aria's render state. StyleX cannot target\n// `[data-placeholder]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters: `disabled` is last, and StyleX replaces a property\n// whole, so it wins over both the placeholder and the focused branches.\nfunction segmentClassName(state: {\n isDisabled: boolean;\n isFocused: boolean;\n isPlaceholder: boolean;\n}) {\n return stylex.props(segmentStyles.segment, state.isPlaceholder && segmentStyles.segmentPlaceholder, state.isFocused && segmentStyles.segmentFocused, state.isDisabled && segmentStyles.segmentDisabled).className ?? '';\n}\nexport { renderSegment };"],"mappings":";;;;;AAkBA,SAASU,cAAcC,SAAgC;CACrD,IAAIA,QAAQC,SAAS,WACnB,OAAO,oBAACY,aAAD;EAAgB,GAAIvB,MAAaK,cAAcK,SAASL,cAAcQ,cAAc;EAAYH;CAAQ,CAAA;CAEjH,OAAO,oBAACa,aAAD;EAAgB,WAAWT;EAA2BJ;CAAQ,CAAA;AACvE;AAQA,SAASI,iBAAiBC,OAIvB;CACD,OAAOf,MAAaK,cAAcK,SAASK,MAAMG,iBAAiBb,cAAcc,oBAAoBJ,MAAME,aAAaZ,cAAce,gBAAgBL,MAAMC,cAAcX,cAAcgB,eAAe,CAAC,CAACC,aAAa;AACvN"}
1
+ {"version":3,"file":"index.js","names":["stylex","segmentStyles","UNSEEN","renderSegment","segment","type","segmentLiteral","test","text","segmentSeparator","segmentClassName","state","isDisabled","isFocused","isPlaceholder","segmentPlaceholder","segmentFocused","segmentDisabled","className","RACDateSegment"],"sources":["../../src/segments/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, DateSegment as RACDateSegment } from 'react-aria-components';\nimport { segmentStyles } from './styles';\n\n// How a date or a time is drawn once React Aria has decided what its parts\n// are. Shared by DateField and TimeField, which differ only in the value they\n// hold: the segments, their order and their number all come from React Aria,\n// so what is here is the same for both.\n\n// What React Aria hands the input for each part of the date. Taken off the\n// component rather than imported, since the segment type is not on the\n// package's public surface.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// The invisible marks that keep a value's direction, which a locale can put\n// at either end of it as a literal of their own.\nconst UNSEEN = /^[\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]*$/u;\n\n// What each segment draws. A literal — the slash or colon between two\n// segments — takes a style of its own, since it is punctuation rather than\n// something a reader types into, and the room either side of it only where\n// it takes up room: a direction mark at the start of a time is a literal\n// too, and spaced, it moved the value off the label's edge. A space is spaced\n// like a slash, since it is what stands between a time and its AM or PM.\nfunction renderSegment(segment: Segment): ReactElement {\n if (segment.type === 'literal') {\n return <RACDateSegment {...stylex.props(segmentStyles.segment, segmentStyles.segmentLiteral, !UNSEEN.test(segment.text) && segmentStyles.segmentSeparator)} segment={segment} />;\n }\n return <RACDateSegment className={segmentClassName} segment={segment} />;\n}\n\n// A segment's classes, from React Aria's render state. StyleX cannot target\n// `[data-placeholder]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters: `disabled` is last, and StyleX replaces a property\n// whole, so it wins over both the placeholder and the focused branches.\nfunction segmentClassName(state: {\n isDisabled: boolean;\n isFocused: boolean;\n isPlaceholder: boolean;\n}) {\n return stylex.props(segmentStyles.segment, state.isPlaceholder && segmentStyles.segmentPlaceholder, state.isFocused && segmentStyles.segmentFocused, state.isDisabled && segmentStyles.segmentDisabled).className ?? '';\n}\nexport { renderSegment };"],"mappings":";;;;;AAiBA,MAAME,SAAS;AAQf,SAASC,cAAcC,SAAgC;CACrD,IAAIA,QAAQC,SAAS,WACnB,OAAO,oBAACc,aAAD;EAAgB,GAAInB,MAAaC,cAAcG,SAASH,cAAcK,gBAAgB,CAACJ,OAAOK,KAAKH,QAAQI,IAAI,KAAKP,cAAcQ,gBAAgB;EAAYL;CAAQ,CAAA;CAE/K,OAAO,oBAACe,aAAD;EAAgB,WAAWT;EAA2BN;CAAQ,CAAA;AACvE;AAQA,SAASM,iBAAiBC,OAIvB;CACD,OAAOX,MAAaC,cAAcG,SAASO,MAAMG,iBAAiBb,cAAcc,oBAAoBJ,MAAME,aAAaZ,cAAce,gBAAgBL,MAAMC,cAAcX,cAAcgB,eAAe,CAAC,CAACC,aAAa;AACvN"}
@@ -13,7 +13,7 @@ const segmentStyles = {
13
13
  knGrYV: "xbuiw85",
14
14
  kMwMTN: "x139gbkf",
15
15
  kjBf7l: "x1x84bn5",
16
- kInvED: "xnrgvoc",
16
+ kInvED: "xs9jlpd",
17
17
  k3XXqK: "x1t137rt xc0lcac x1894zjx",
18
18
  kMeerF: "x1jrff4x",
19
19
  kg3NbH: "xdomwbk",
@@ -37,6 +37,10 @@ const segmentStyles = {
37
37
  segmentPlaceholder: {
38
38
  kMwMTN: "x1w5n3ug",
39
39
  $$css: true
40
+ },
41
+ segmentSeparator: {
42
+ kg3NbH: "ximhkdq",
43
+ $$css: true
40
44
  }
41
45
  };
42
46
  export { segmentStyles };
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["stylex","colors","radii","spacing","stateLayerOpacity","FORCED_COLORS","segmentStyles","input","kGNEyG","kB7OPa","k1xSpc","k3XXqK","$$css","segment","kaIpWk","knGrYV","kMwMTN","kjBf7l","kInvED","kMeerF","kg3NbH","k9WMMc","segmentDisabled","segmentFocused","kWkggS","segmentLiteral","segmentPlaceholder"],"sources":["../../src/segments/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The segments a date or a time is typed into, shared by DateField and\n// TimeField. Apart from either component so the two cannot drift, and outside\n// `src/components` because a directory there is a public component with\n// stories, a barrel entry and a `styling.test.tsx` case — which shared styles\n// are none of.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst segmentStyles = {\n input: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n segment: {\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kjBf7l: \"x1x84bn5\",\n kInvED: \"xnrgvoc\",\n k3XXqK: \"x1t137rt xc0lcac x1894zjx\",\n kMeerF: \"x1jrff4x\",\n kg3NbH: \"xdomwbk\",\n k9WMMc: \"xp4054r\",\n $$css: true\n },\n segmentDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n segmentFocused: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n segmentLiteral: {\n kMwMTN: \"x1w5n3ug\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n segmentPlaceholder: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n }\n};\nexport { segmentStyles };"],"mappings":";AAeA,MAAMM,gBAAgB;CACpBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRL,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,iBAAiB;EACfN,QAAQ;EACRJ,OAAO;CACT;CACAW,gBAAgB;EACdC,QAAQ;EACRR,QAAQ;EACRJ,OAAO;CACT;CACAa,gBAAgB;EACdT,QAAQ;EACRI,QAAQ;EACRR,OAAO;CACT;CACAc,oBAAoB;EAClBV,QAAQ;EACRJ,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"styles.js","names":["segmentStyles","input","kGNEyG","kB7OPa","k1xSpc","k3XXqK","$$css","segment","kaIpWk","knGrYV","kMwMTN","kjBf7l","kInvED","kMeerF","kg3NbH","k9WMMc","segmentDisabled","segmentFocused","kWkggS","segmentLiteral","segmentPlaceholder","segmentSeparator"],"sources":["../../src/segments/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The segments a date or a time is typed into, shared by DateField and\n// TimeField. Apart from either component so the two cannot drift, and outside\n// `src/components` because a directory there is a public component with\n// stories, a barrel entry and a `styling.test.tsx` case — which shared styles\n// are none of.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst segmentStyles = {\n input: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n segment: {\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kjBf7l: \"x1x84bn5\",\n kInvED: \"xs9jlpd\",\n k3XXqK: \"x1t137rt xc0lcac x1894zjx\",\n kMeerF: \"x1jrff4x\",\n kg3NbH: \"xdomwbk\",\n k9WMMc: \"xp4054r\",\n $$css: true\n },\n segmentDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n segmentFocused: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n segmentLiteral: {\n kMwMTN: \"x1w5n3ug\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n segmentPlaceholder: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n segmentSeparator: {\n kg3NbH: \"ximhkdq\",\n $$css: true\n }\n};\nexport { segmentStyles };"],"mappings":";AAeA,MAAMA,gBAAgB;CACpBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRL,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,iBAAiB;EACfN,QAAQ;EACRJ,OAAO;CACT;CACAW,gBAAgB;EACdC,QAAQ;EACRR,QAAQ;EACRJ,OAAO;CACT;CACAa,gBAAgB;EACdT,QAAQ;EACRI,QAAQ;EACRR,OAAO;CACT;CACAc,oBAAoB;EAClBV,QAAQ;EACRJ,OAAO;CACT;CACAe,kBAAkB;EAChBP,QAAQ;EACRR,OAAO;CACT;AACF"}