@kanso-labs/kanso-ui 0.26.2 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/calendar/index.js +1 -1
  2. package/dist/calendar/index.js.map +1 -1
  3. package/dist/calendar/months.js.map +1 -1
  4. package/dist/calendar/styles.js.map +1 -1
  5. package/dist/chip/styles.js.map +1 -1
  6. package/dist/components/app-bar/index.js +148 -40
  7. package/dist/components/app-bar/index.js.map +1 -1
  8. package/dist/components/autocomplete/index.js +1 -1
  9. package/dist/components/autocomplete/index.js.map +1 -1
  10. package/dist/components/avatar/index.js +46 -14
  11. package/dist/components/avatar/index.js.map +1 -1
  12. package/dist/components/breadcrumbs/index.js +1 -1
  13. package/dist/components/breadcrumbs/index.js.map +1 -1
  14. package/dist/components/button/index.js +67 -18
  15. package/dist/components/button/index.js.map +1 -1
  16. package/dist/components/calendar/index.js +1 -1
  17. package/dist/components/calendar/index.js.map +1 -1
  18. package/dist/components/card/index.js +71 -19
  19. package/dist/components/card/index.js.map +1 -1
  20. package/dist/components/checkbox/index.js +1 -1
  21. package/dist/components/checkbox/index.js.map +1 -1
  22. package/dist/components/checkbox-group/index.js +1 -1
  23. package/dist/components/checkbox-group/index.js.map +1 -1
  24. package/dist/components/chip/index.js +1 -1
  25. package/dist/components/chip/index.js.map +1 -1
  26. package/dist/components/chip-group/index.js +118 -28
  27. package/dist/components/chip-group/index.js.map +1 -1
  28. package/dist/components/code/index.js.map +1 -1
  29. package/dist/components/color-area/index.js +66 -12
  30. package/dist/components/color-area/index.js.map +1 -1
  31. package/dist/components/color-field/index.js +61 -12
  32. package/dist/components/color-field/index.js.map +1 -1
  33. package/dist/components/color-picker/index.js +146 -43
  34. package/dist/components/color-picker/index.js.map +1 -1
  35. package/dist/components/color-slider/index.js +116 -21
  36. package/dist/components/color-slider/index.js.map +1 -1
  37. package/dist/components/color-swatch/index.js +1 -1
  38. package/dist/components/color-swatch/index.js.map +1 -1
  39. package/dist/components/color-swatch-picker/index.js +1 -1
  40. package/dist/components/color-swatch-picker/index.js.map +1 -1
  41. package/dist/components/color-wheel/index.js +75 -11
  42. package/dist/components/color-wheel/index.js.map +1 -1
  43. package/dist/components/combo-box/index.js +113 -32
  44. package/dist/components/combo-box/index.js.map +1 -1
  45. package/dist/components/container/index.js +53 -10
  46. package/dist/components/container/index.js.map +1 -1
  47. package/dist/components/copy-field/index.js +95 -40
  48. package/dist/components/copy-field/index.js.map +1 -1
  49. package/dist/components/currency/index.js +68 -11
  50. package/dist/components/currency/index.js.map +1 -1
  51. package/dist/components/date-field/index.js +64 -15
  52. package/dist/components/date-field/index.js.map +1 -1
  53. package/dist/components/date-picker/index.js +121 -38
  54. package/dist/components/date-picker/index.js.map +1 -1
  55. package/dist/components/date-range-picker/index.js +154 -52
  56. package/dist/components/date-range-picker/index.js.map +1 -1
  57. package/dist/components/dialog/index.js +87 -19
  58. package/dist/components/dialog/index.js.map +1 -1
  59. package/dist/components/disclosure/index.js +43 -10
  60. package/dist/components/disclosure/index.js.map +1 -1
  61. package/dist/components/disclosure-group/index.js +49 -6
  62. package/dist/components/disclosure-group/index.js.map +1 -1
  63. package/dist/components/drop-zone/index.js +1 -1
  64. package/dist/components/drop-zone/index.js.map +1 -1
  65. package/dist/components/drop-zone/styles.js.map +1 -1
  66. package/dist/components/feed/index.js +52 -9
  67. package/dist/components/feed/index.js.map +1 -1
  68. package/dist/components/form/index.js +39 -6
  69. package/dist/components/form/index.js.map +1 -1
  70. package/dist/components/icon-button/index.js +89 -29
  71. package/dist/components/icon-button/index.js.map +1 -1
  72. package/dist/components/keycap/index.js.map +1 -1
  73. package/dist/components/link/index.js +52 -11
  74. package/dist/components/link/index.js.map +1 -1
  75. package/dist/components/list/index.js +96 -16
  76. package/dist/components/list/index.js.map +1 -1
  77. package/dist/components/list-box/index.js +45 -8
  78. package/dist/components/list-box/index.js.map +1 -1
  79. package/dist/components/list-detail/index.js +99 -20
  80. package/dist/components/list-detail/index.js.map +1 -1
  81. package/dist/components/list-item/index.js +42 -15
  82. package/dist/components/list-item/index.js.map +1 -1
  83. package/dist/components/menu/index.js +139 -23
  84. package/dist/components/menu/index.js.map +1 -1
  85. package/dist/components/meter/index.js +68 -8
  86. package/dist/components/meter/index.js.map +1 -1
  87. package/dist/components/navigation-tree/index.js +1 -1
  88. package/dist/components/navigation-tree/index.js.map +1 -1
  89. package/dist/components/number-field/index.js +135 -47
  90. package/dist/components/number-field/index.js.map +1 -1
  91. package/dist/components/popover/index.js +226 -49
  92. package/dist/components/popover/index.js.map +1 -1
  93. package/dist/components/product-icon/index.js +50 -17
  94. package/dist/components/product-icon/index.js.map +1 -1
  95. package/dist/components/progress-indicator/index.js +92 -9
  96. package/dist/components/progress-indicator/index.js.map +1 -1
  97. package/dist/components/radio-group/index.js +44 -10
  98. package/dist/components/radio-group/index.js.map +1 -1
  99. package/dist/components/range-calendar/index.js +1 -1
  100. package/dist/components/range-calendar/index.js.map +1 -1
  101. package/dist/components/search-field/index.js +44 -9
  102. package/dist/components/search-field/index.js.map +1 -1
  103. package/dist/components/segmented-button/index.js +111 -19
  104. package/dist/components/segmented-button/index.js.map +1 -1
  105. package/dist/components/select/index.js +48 -10
  106. package/dist/components/select/index.js.map +1 -1
  107. package/dist/components/separator/index.js +21 -6
  108. package/dist/components/separator/index.js.map +1 -1
  109. package/dist/components/sheet/index.js +87 -19
  110. package/dist/components/sheet/index.js.map +1 -1
  111. package/dist/components/slider/index.js +90 -18
  112. package/dist/components/slider/index.js.map +1 -1
  113. package/dist/components/snackbar/index.js +1 -1
  114. package/dist/components/snackbar/index.js.map +1 -1
  115. package/dist/components/stack/index.js +54 -9
  116. package/dist/components/stack/index.js.map +1 -1
  117. package/dist/components/supporting-pane/index.js +91 -20
  118. package/dist/components/supporting-pane/index.js.map +1 -1
  119. package/dist/components/switch/index.js +57 -12
  120. package/dist/components/switch/index.js.map +1 -1
  121. package/dist/components/table/index.js +229 -46
  122. package/dist/components/table/index.js.map +1 -1
  123. package/dist/components/tabs/index.js +1 -1
  124. package/dist/components/tabs/index.js.map +1 -1
  125. package/dist/components/tag/index.js +53 -10
  126. package/dist/components/tag/index.js.map +1 -1
  127. package/dist/components/text/index.js +54 -9
  128. package/dist/components/text/index.js.map +1 -1
  129. package/dist/components/text-area/index.js +70 -15
  130. package/dist/components/text-area/index.js.map +1 -1
  131. package/dist/components/text-field/index.js +73 -16
  132. package/dist/components/text-field/index.js.map +1 -1
  133. package/dist/components/time-field/index.js +64 -15
  134. package/dist/components/time-field/index.js.map +1 -1
  135. package/dist/components/token-field/index.js +133 -18
  136. package/dist/components/token-field/index.js.map +1 -1
  137. package/dist/components/toolbar/index.js +68 -11
  138. package/dist/components/toolbar/index.js.map +1 -1
  139. package/dist/components/tooltip/index.js +87 -11
  140. package/dist/components/tooltip/index.js.map +1 -1
  141. package/dist/components/tree/index.js +96 -16
  142. package/dist/components/tree/index.js.map +1 -1
  143. package/dist/drag/hooks.js +1 -1
  144. package/dist/drag/hooks.js.map +1 -1
  145. package/dist/drag/index.js +1 -1
  146. package/dist/drag/index.js.map +1 -1
  147. package/dist/drag/styles.js.map +1 -1
  148. package/dist/field/index.js +338 -96
  149. package/dist/field/index.js.map +1 -1
  150. package/dist/field/root.js.map +1 -1
  151. package/dist/glyphs/index.js +1 -1
  152. package/dist/glyphs/index.js.map +1 -1
  153. package/dist/hooks/useImageLoadingStatus.js +1 -1
  154. package/dist/hooks/useImageLoadingStatus.js.map +1 -1
  155. package/dist/hooks/useRipple.js +1 -1
  156. package/dist/hooks/useRipple.js.map +1 -1
  157. package/dist/indicator/index.js +1 -1
  158. package/dist/indicator/index.js.map +1 -1
  159. package/dist/indicator/styles.js.map +1 -1
  160. package/dist/layout.js.map +1 -1
  161. package/dist/render/aria.js.map +1 -1
  162. package/dist/render/useRender.js +66 -21
  163. package/dist/render/useRender.js.map +1 -1
  164. package/dist/row/index.js +97 -23
  165. package/dist/row/index.js.map +1 -1
  166. package/dist/row/styles.js.map +1 -1
  167. package/dist/segments/index.js.map +1 -1
  168. package/dist/segments/styles.js.map +1 -1
  169. package/dist/styles/chequer.js.map +1 -1
  170. package/dist/styles/color.js.map +1 -1
  171. package/dist/styles/merge.js.map +1 -1
  172. package/dist/styles/overlay.js.map +1 -1
  173. package/dist/styles/picker.js.map +1 -1
  174. package/dist/styles/ripple.js.map +1 -1
  175. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  176. package/dist/tokens/values.js.map +1 -1
  177. package/package.json +8 -6
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["props","header","children"],"sources":["../../../src/components/list-box/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ListBoxItemRenderProps, ListBoxItemProps as RACListBoxItemProps, ListBoxLoadMoreItemProps as RACListBoxLoadMoreItemProps, ListBoxProps as RACListBoxProps, ListBoxSectionProps as RACListBoxSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxLoadMoreItem as RACListBoxLoadMoreItem, ListBoxSection as RACListBoxSection } from 'react-aria-components';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport ProgressIndicator from '../progress-indicator';\n\n// The lists page's selectable list. Each option is the row every list here\n// draws — `src/row`, shared with ListItem and with every collection the\n// coverage plan adds after this one — so the 56dp floor, the body-large\n// headline, the body-medium supporting line, the state layers and the\n// disabled treatment are all that module's and none of them is written\n// again. What is here is the container around those rows, the section and\n// its header, and the row the list shows while it is fetching more.\n//\n// The container takes the page's 8dp above and below its rows and no\n// background of its own, which is what lets the same list sit on the page\n// and inside a popover without knowing which it is in. Select, ComboBox and\n// Autocomplete are each a field plus one of these in an overlay, so that is\n// not a detail — it is the reason the container is transparent.\n//\n// A selected option takes primary container and on primary container, the\n// page's selected state, through the row module's `list` variant. The page\n// also draws a checkbox in the trailing slot on a list that selects more\n// than one; that is left to the call site rather than added by the option,\n// since which of the two affordances a list wants is the list's decision and\n// the slot is already there for it.\n//\n// Three things are worth knowing about how this maps onto React Aria.\n//\n// **The option's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function — the same mechanism Tabs and Chip use, wrapped in\n// `mergeStatefulStyles` so a call site's own `className` survives.\n//\n// **A section's heading is React Aria's `Header`**, which is what points the\n// section's `aria-labelledby` at it. The lists page names no subhead in its\n// anatomy, so the type is title-small in on surface variant at the row's own\n// 16dp inline padding, which is what the page's own guidance draws.\n//\n// **The load-more row is a sentinel, not a button.** React Aria's\n// `ListBoxLoadMoreItem` calls `onLoadMore` when it comes into view and\n// renders whatever it is given while `isLoading`; ours renders the ring, so\n// a list that fetches as it scrolls says so with the same indicator every\n// other pending state in the library uses.\n\ntype ListBoxItemProps<T extends object = object> = {\n /** The option's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the option's render state. */\n className?: RACListBoxItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /** A function may compute the style from the option's render state. */\n style?: RACListBoxItemProps<T>['style'];\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} & Omit<RACListBoxItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListBoxLoadMoreProps = Omit<RACListBoxLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype ListBoxProps<T extends object> = Omit<RACListBoxProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the list's render state. */\n className?: RACListBoxProps<T>['className'];\n /** A function may compute the style from the list's render state. */\n style?: RACListBoxProps<T>['style'];\n};\ntype ListBoxSectionProps<T extends object = object> = Omit<RACListBoxSectionProps<T>, 'children'> & {\n /**\n * The options in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// What the option draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// It reads the render state for one thing: which colour the supporting line\n// takes. The muted role the page gives it holds only on the surface — over a\n// selected row's container it is a second colour family, and on a disabled\n// row it stays at full strength while the headline above it fades. The row\n// module decides; this hands it the two flags.\nfunction itemContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: ListBoxItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// option's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n//\n// A supporting line moves the option from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what an option is doing and not what it holds; the row is built by\n// a call for the same reason `itemContent` is.\nfunction itemStyles(supporting: ReactNode) {\n return (state: ListBoxItemRenderProps) => stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, supporting !== undefined && rowStyles.twoLine, state.isSelected && rowStyles.selectedList, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of options one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the option instead.\n *\n * Composed from parts, since an option's slots take arbitrary content:\n * `ListBox.Item`, `ListBox.Section` and `ListBox.LoadMore`. Name the list\n * with `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction ListBox<T extends object>(props: ListBoxProps<T>) {\n return <RACListBox {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt x1cmllll\"\n }, props)} />;\n}\n\n/**\n * One option. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every option an `id` — that is\n * the key selection is reported by.\n */\nfunction ListBoxItem<T extends object = object>({\n children,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListBoxItemProps<T>) {\n return <RACListBoxItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(itemStyles(supporting), props)}>\n {itemContent(children, leading, supporting, trailing)}\n </RACListBoxItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading` — so a list that pages as it scrolls needs nothing else.\n */\nfunction ListBoxLoadMore({\n label = 'Loading more',\n ...props\n}: ListBoxLoadMoreProps) {\n return <RACListBoxLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k xbktkl8\"\n }, props)}>\n <ProgressIndicator aria-label={label} isIndeterminate size=\"24px\" variant=\"circular\" />\n </RACListBoxLoadMoreItem>;\n}\n\n/**\n * A named group of options. `header` names it, and is what a screen reader\n * reads before the options inside.\n */\nfunction ListBoxSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListBoxSectionProps<T>) {\n return <RACListBoxSection {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x1clyivc x790zyz\">{header}</Header>}\n {children}\n </RACListBoxSection>;\n}\n\n// What the option is worth as text, for the things React Aria does with an\n// option's words rather than its element: typeahead, a combo box's filter,\n// and the value a select shows once it is chosen. React Aria reads it off\n// the children when they are a string and finds nothing when they are not —\n// and an option here is always an element, since the row wraps its headline.\n// So a plain-string headline becomes the text value, and anything else has\n// to say what it is worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\nListBox.Item = ListBoxItem;\nListBox.LoadMore = ListBoxLoadMore;\nListBox.Section = ListBoxSection;\nexport type { ListBoxItemProps, ListBoxLoadMoreProps, ListBoxProps, ListBoxSectionProps };\nexport default ListBox;"],"mappings":";;;;;;;;;AAuGA,SAAS,YAAY,UAAqB,SAAoB,YAAuB,UAAqB;CACxG,QAAQ,UAAkC,oBAAC,YAAD;EAAY,YAAY,MAAM;EAAY,YAAY,MAAM;EAAqB;EAAqB;EAAsB;EACjK;CACS,CAAA;AAChB;AAcA,SAAS,WAAW,YAAuB;CACzC,QAAQ,UAAkC,MAAa,UAAU,MAAM,UAAU,MAAM,UAAU,aAAa,eAAe,KAAA,KAAa,UAAU,SAAS,MAAM,cAAc,UAAU,cAAc,MAAM,cAAc,UAAU,QAAQ;AACjP;;;;;;;;;;;;;;;AAgBA,SAAA,UAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACoC,KAAA,oBAAoB,EAAA,WACzC,2CACb,GAAG,KAAK;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,IAAA;EAFF,KAAA,oBAAC,SAAD;GAAW,GAAK;GAAK,GAAM;EAEzB,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;;;;;;AAQf,SAAA,cAAA,IAAA;CA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AAA,EAAA,OAAA,YAAA,EAAA,QAAA,MAAA,EAAA,QAAA,MAAA,EAAA,QAAA,IAAA;EAHpJ,KAAA,qBAAC,IAAD;GAAkB,GAAKA;GAAK,GAAM;GAAlC,UAAA,CAGF,IACA,QAJoB;;EAKH,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OALf;AAKe;AAUxB,SAAS,OAAO,UAAqB;CACnC,OAAO,OAAO,aAAa,WAAW,WAAW,KAAA;AACnD;AACA,UAAQ,OAAO;AACf,UAAQ,WAAW;AACnB,UAAQ,UAAU"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","ListBoxItemRenderProps","ListBoxItemProps","RACListBoxItemProps","ListBoxLoadMoreItemProps","RACListBoxLoadMoreItemProps","ListBoxProps","RACListBoxProps","ListBoxSectionProps","RACListBoxSectionProps","stylex","Header","ListBox","RACListBox","ListBoxItem","RACListBoxItem","ListBoxLoadMoreItem","RACListBoxLoadMoreItem","ListBoxSection","RACListBoxSection","RowContent","rowStyles","mergeStatefulStyles","mergeStyles","colors","spacing","typography","ProgressIndicator","children","className","T","leading","style","supporting","trailing","Omit","ListBoxLoadMoreProps","label","header","itemContent","state","isDisabled","isSelected","itemStyles","props","base","list","interactive","undefined","twoLine","selectedList","disabled","$","_c","t0","t1","T0","t2","t3","t4","t5","t6","textValue","t7","textOf","ListBoxLoadMore","Item","LoadMore","Section"],"sources":["../../../src/components/list-box/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ListBoxItemRenderProps, ListBoxItemProps as RACListBoxItemProps, ListBoxLoadMoreItemProps as RACListBoxLoadMoreItemProps, ListBoxProps as RACListBoxProps, ListBoxSectionProps as RACListBoxSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxLoadMoreItem as RACListBoxLoadMoreItem, ListBoxSection as RACListBoxSection } from 'react-aria-components';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport ProgressIndicator from '../progress-indicator';\n\n// The lists page's selectable list. Each option is the row every list here\n// draws — `src/row`, shared with ListItem and with every collection the\n// coverage plan adds after this one — so the 56dp floor, the body-large\n// headline, the body-medium supporting line, the state layers and the\n// disabled treatment are all that module's and none of them is written\n// again. What is here is the container around those rows, the section and\n// its header, and the row the list shows while it is fetching more.\n//\n// The container takes the page's 8dp above and below its rows and no\n// background of its own, which is what lets the same list sit on the page\n// and inside a popover without knowing which it is in. Select, ComboBox and\n// Autocomplete are each a field plus one of these in an overlay, so that is\n// not a detail — it is the reason the container is transparent.\n//\n// A selected option takes primary container and on primary container, the\n// page's selected state, through the row module's `list` variant. The page\n// also draws a checkbox in the trailing slot on a list that selects more\n// than one; that is left to the call site rather than added by the option,\n// since which of the two affordances a list wants is the list's decision and\n// the slot is already there for it.\n//\n// Three things are worth knowing about how this maps onto React Aria.\n//\n// **The option's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function — the same mechanism Tabs and Chip use, wrapped in\n// `mergeStatefulStyles` so a call site's own `className` survives.\n//\n// **A section's heading is React Aria's `Header`**, which is what points the\n// section's `aria-labelledby` at it. The lists page names no subhead in its\n// anatomy, so the type is title-small in on surface variant at the row's own\n// 16dp inline padding, which is what the page's own guidance draws.\n//\n// **The load-more row is a sentinel, not a button.** React Aria's\n// `ListBoxLoadMoreItem` calls `onLoadMore` when it comes into view and\n// renders whatever it is given while `isLoading`; ours renders the ring, so\n// a list that fetches as it scrolls says so with the same indicator every\n// other pending state in the library uses.\n\ntype ListBoxItemProps<T extends object = object> = {\n /** The option's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the option's render state. */\n className?: RACListBoxItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /** A function may compute the style from the option's render state. */\n style?: RACListBoxItemProps<T>['style'];\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} & Omit<RACListBoxItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListBoxLoadMoreProps = Omit<RACListBoxLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype ListBoxProps<T extends object> = Omit<RACListBoxProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the list's render state. */\n className?: RACListBoxProps<T>['className'];\n /** A function may compute the style from the list's render state. */\n style?: RACListBoxProps<T>['style'];\n};\ntype ListBoxSectionProps<T extends object = object> = Omit<RACListBoxSectionProps<T>, 'children'> & {\n /**\n * The options in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// What the option draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// It reads the render state for one thing: which colour the supporting line\n// takes. The muted role the page gives it holds only on the surface — over a\n// selected row's container it is a second colour family, and on a disabled\n// row it stays at full strength while the headline above it fades. The row\n// module decides; this hands it the two flags.\nfunction itemContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: ListBoxItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// option's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n//\n// A supporting line moves the option from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what an option is doing and not what it holds; the row is built by\n// a call for the same reason `itemContent` is.\nfunction itemStyles(supporting: ReactNode) {\n return (state: ListBoxItemRenderProps) => stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, supporting !== undefined && rowStyles.twoLine, state.isSelected && rowStyles.selectedList, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of options one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the option instead.\n *\n * Composed from parts, since an option's slots take arbitrary content:\n * `ListBox.Item`, `ListBox.Section` and `ListBox.LoadMore`. Name the list\n * with `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction ListBox<T extends object>(props: ListBoxProps<T>) {\n return <RACListBox {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt x1cmllll\"\n }, props)} />;\n}\n\n/**\n * One option. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every option an `id` — that is\n * the key selection is reported by.\n */\nfunction ListBoxItem<T extends object = object>({\n children,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListBoxItemProps<T>) {\n return <RACListBoxItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(itemStyles(supporting), props)}>\n {itemContent(children, leading, supporting, trailing)}\n </RACListBoxItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading` — so a list that pages as it scrolls needs nothing else.\n */\nfunction ListBoxLoadMore({\n label = 'Loading more',\n ...props\n}: ListBoxLoadMoreProps) {\n return <RACListBoxLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k xbktkl8\"\n }, props)}>\n <ProgressIndicator aria-label={label} isIndeterminate size=\"24px\" variant=\"circular\" />\n </RACListBoxLoadMoreItem>;\n}\n\n/**\n * A named group of options. `header` names it, and is what a screen reader\n * reads before the options inside.\n */\nfunction ListBoxSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListBoxSectionProps<T>) {\n return <RACListBoxSection {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x1clyivc x790zyz\">{header}</Header>}\n {children}\n </RACListBoxSection>;\n}\n\n// What the option is worth as text, for the things React Aria does with an\n// option's words rather than its element: typeahead, a combo box's filter,\n// and the value a select shows once it is chosen. React Aria reads it off\n// the children when they are a string and finds nothing when they are not —\n// and an option here is always an element, since the row wraps its headline.\n// So a plain-string headline becomes the text value, and anything else has\n// to say what it is worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\nListBox.Item = ListBoxItem;\nListBox.LoadMore = ListBoxLoadMore;\nListBox.Section = ListBoxSection;\nexport type { ListBoxItemProps, ListBoxLoadMoreProps, ListBoxProps, ListBoxSectionProps };\nexport default ListBox;"],"mappings":";;;;;;;;;AAuGA,SAASuC,YAAYX,UAAqBG,SAAoBE,YAAuBC,UAAqB;CACxG,QAAQM,UAAkC,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAqBX;EAAqBE;EAAsBC;EACjKN;CACS,CAAA;AAChB;AAcA,SAASe,WAAWV,YAAuB;CACzC,QAAQO,UAAkC9B,MAAa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";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
5
  //#region src/components/list-detail/index.tsx
5
6
  /**
@@ -14,28 +15,106 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
15
  * Material Design asks of co-planar panes: focus order has to match the
15
16
  * arrangement on screen.
16
17
  */
17
- function ListDetail({ detail, list, render, showing = "list", ...props }) {
18
- return useRender({
19
- defaultTagName: "div",
20
- props: {
21
- ...props,
22
- children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
23
- ...{
24
- 0: { className: "x9f619 xeuugli" },
25
- 1: { className: "x9f619 xeuugli x1s85apg x9a4l8x" }
26
- }[!!(showing === "detail") << 0],
18
+ function ListDetail(t0) {
19
+ const $ = c(26);
20
+ let render;
21
+ let t1;
22
+ let t2;
23
+ let t3;
24
+ let t4;
25
+ let t5;
26
+ if ($[0] !== t0) {
27
+ const { detail, list, render: t6, showing: t7, ...props } = t0;
28
+ render = t6;
29
+ const showing = t7 === void 0 ? "list" : t7;
30
+ t5 = useRender;
31
+ t4 = "div";
32
+ t1 = props;
33
+ let t8;
34
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
35
+ t8 = {
36
+ 0: { className: "x9f619 xeuugli" },
37
+ 1: { className: "x9f619 xeuugli x1s85apg x9a4l8x" }
38
+ };
39
+ $[7] = t8;
40
+ } else t8 = $[7];
41
+ const t9 = t8[!!(showing === "detail") << 0];
42
+ let t10;
43
+ if ($[8] !== list || $[9] !== t9) {
44
+ t10 = /* @__PURE__ */ jsx("div", {
45
+ ...t9,
27
46
  children: list
28
- }), /* @__PURE__ */ jsx("div", {
29
- ...{
30
- 0: { className: "x9f619 xeuugli" },
31
- 1: { className: "x9f619 xeuugli x1s85apg x9a4l8x" }
32
- }[!!(showing === "list") << 0],
47
+ });
48
+ $[8] = list;
49
+ $[9] = t9;
50
+ $[10] = t10;
51
+ } else t10 = $[10];
52
+ let t11;
53
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
54
+ t11 = {
55
+ 0: { className: "x9f619 xeuugli" },
56
+ 1: { className: "x9f619 xeuugli x1s85apg x9a4l8x" }
57
+ };
58
+ $[11] = t11;
59
+ } else t11 = $[11];
60
+ const t12 = t11[!!(showing === "list") << 0];
61
+ let t13;
62
+ if ($[12] !== detail || $[13] !== t12) {
63
+ t13 = /* @__PURE__ */ jsx("div", {
64
+ ...t12,
33
65
  children: detail
34
- })] }),
35
- ...mergeStyles({ className: "x9f619 xrvj5dj xj2l1yv x1mkdm3x xkgydl7 xxxc7o5" }, props)
36
- },
37
- render
38
- });
66
+ });
67
+ $[12] = detail;
68
+ $[13] = t12;
69
+ $[14] = t13;
70
+ } else t13 = $[14];
71
+ if ($[15] !== t10 || $[16] !== t13) {
72
+ t2 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t13] });
73
+ $[15] = t10;
74
+ $[16] = t13;
75
+ $[17] = t2;
76
+ } else t2 = $[17];
77
+ t3 = mergeStyles({ className: "x9f619 xrvj5dj xj2l1yv x1mkdm3x xkgydl7 xxxc7o5" }, props);
78
+ $[0] = t0;
79
+ $[1] = render;
80
+ $[2] = t1;
81
+ $[3] = t2;
82
+ $[4] = t3;
83
+ $[5] = t4;
84
+ $[6] = t5;
85
+ } else {
86
+ render = $[1];
87
+ t1 = $[2];
88
+ t2 = $[3];
89
+ t3 = $[4];
90
+ t4 = $[5];
91
+ t5 = $[6];
92
+ }
93
+ let t6;
94
+ if ($[18] !== t1 || $[19] !== t2 || $[20] !== t3) {
95
+ t6 = {
96
+ ...t1,
97
+ children: t2,
98
+ ...t3
99
+ };
100
+ $[18] = t1;
101
+ $[19] = t2;
102
+ $[20] = t3;
103
+ $[21] = t6;
104
+ } else t6 = $[21];
105
+ let t7;
106
+ if ($[22] !== render || $[23] !== t4 || $[24] !== t6) {
107
+ t7 = {
108
+ defaultTagName: t4,
109
+ props: t6,
110
+ render
111
+ };
112
+ $[22] = render;
113
+ $[23] = t4;
114
+ $[24] = t6;
115
+ $[25] = t7;
116
+ } else t7 = $[25];
117
+ return t5(t7);
39
118
  }
40
119
  //#endregion
41
120
  export { ListDetail as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/list-detail/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { media, spacing } from '../../tokens/design.tokens.stylex';\n\n// Material Design's recommended snap widths for a fixed pane. The list is the\n// fixed one here — Material Design points a fixed pane at \"lists with light\n// information density\" — and the detail pane is the flexible one that absorbs\n// whatever is left, which satisfies the spec's rule that every layout carry at\n// least one flexible pane.\nconst LIST_PANE = '360px';\nconst LIST_PANE_EXTRA_LARGE = '412px';\n\n// One of Material Design's canonical layouts, and the fixed-and-flexible shape\n// of its two-pane layouts. Unlike SupportingPane, the detail pane here stands\n// on its own: a message, a product, a file. That is what makes showing it\n// *instead of* the list a coherent thing to do when only one pane fits, and\n// why this layout has to be told which pane is showing while SupportingPane\n// does not.\n//\n// Material Design puts the second pane on screen from expanded up. Below that\n// the spec shows one pane at a time, with selecting an item swapping to the\n// detail and back returning to the list — app navigation rather than layout,\n// which is why `showing` is controlled rather than held here.\n\ntype ListDetailProps = {\n /**\n * The selected item's content. Stands on its own, and takes the flexible\n * pane.\n */\n detail?: ReactNode;\n /**\n * The items to choose between. Takes the fixed pane — 360px wide, 412px at\n * extra-large.\n */\n list?: ReactNode;\n /**\n * Which pane to show while only one fits, below the expanded breakpoint.\n * Both are shown from expanded up, where this is ignored.\n *\n * Controlled, with no uncontrolled fallback: the layout cannot know that an\n * item was selected or that the reader went back, so holding that state\n * here would only ever be wrong.\n * @default 'list'\n */\n showing?: 'detail' | 'list';\n} & Omit<RenderComponentProps<'div'>, 'children'>;\n\n/**\n * Material Design's list-detail layout: a fixed list pane beside a flexible\n * detail pane, collapsing to one pane at a time below the expanded breakpoint.\n *\n * Layout only — neither pane paints a surface of its own, so what goes inside\n * them is composed at the call site. `render` swaps the container's element,\n * for a layout that should be a `<main>` rather than a `<div>`.\n *\n * The panes are written to the DOM in the order they are shown, which is what\n * Material Design asks of co-planar panes: focus order has to match the\n * arrangement on screen.\n */\nfunction ListDetail({\n detail,\n list,\n render,\n showing = 'list',\n ...props\n}: ListDetailProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n children: <>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'detail') << 0]}>\n {list}\n </div>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'list') << 0]}>\n {detail}\n </div>\n </>,\n ...mergeStyles({\n className: \"x9f619 xrvj5dj xj2l1yv x1mkdm3x xkgydl7 xxxc7o5\"\n }, props)\n },\n render\n });\n}\nexport type { ListDetailProps };\nexport default ListDetail;"],"mappings":";;;;;;;;;;;;;;;;AA+DA,SAAS,WAAW,EAClB,QACA,MACA,QACA,UAAU,QACV,GAAG,SACe;CAClB,OAAO,UAAU;EACf,gBAAgB;EAChB,OAAO;GACL,GAAG;GACH,UAAU,qBAAA,UAAA,EAAA,UAAA,CACN,oBAAC,OAAD;IAAK,GAAI;KACT,GAAG,EACD,WAAW,iBACb;KACA,GAAG,EACD,WAAW,kCACb;IACF,EAAE,CAAC,EAAE,YAAY,aAAa;IACzB,UAAA;GACE,CAAA,GACL,oBAAC,OAAD;IAAK,GAAI;KACT,GAAG,EACD,WAAW,iBACb;KACA,GAAG,EACD,WAAW,kCACb;IACF,EAAE,CAAC,EAAE,YAAY,WAAW;IACvB,UAAA;GACE,CAAA,CACP,EAAA,CAAA;GACF,GAAG,YAAY,EACb,WAAW,kDACb,GAAG,KAAK;EACV;EACA;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","stylex","RenderComponentProps","useRender","mergeStyles","media","spacing","LIST_PANE","LIST_PANE_EXTRA_LARGE","ListDetailProps","detail","list","showing","Omit","ListDetail","t0","$","_c","render","t1","t2","t3","t4","t5","t6","t7","props","undefined","t8","Symbol","for","0","className","1","t9","t10","t11","t12","t13","children","defaultTagName"],"sources":["../../../src/components/list-detail/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { media, spacing } from '../../tokens/design.tokens.stylex';\n\n// Material Design's recommended snap widths for a fixed pane. The list is the\n// fixed one here — Material Design points a fixed pane at \"lists with light\n// information density\" — and the detail pane is the flexible one that absorbs\n// whatever is left, which satisfies the spec's rule that every layout carry at\n// least one flexible pane.\nconst LIST_PANE = '360px';\nconst LIST_PANE_EXTRA_LARGE = '412px';\n\n// One of Material Design's canonical layouts, and the fixed-and-flexible shape\n// of its two-pane layouts. Unlike SupportingPane, the detail pane here stands\n// on its own: a message, a product, a file. That is what makes showing it\n// *instead of* the list a coherent thing to do when only one pane fits, and\n// why this layout has to be told which pane is showing while SupportingPane\n// does not.\n//\n// Material Design puts the second pane on screen from expanded up. Below that\n// the spec shows one pane at a time, with selecting an item swapping to the\n// detail and back returning to the list — app navigation rather than layout,\n// which is why `showing` is controlled rather than held here.\n\ntype ListDetailProps = {\n /**\n * The selected item's content. Stands on its own, and takes the flexible\n * pane.\n */\n detail?: ReactNode;\n /**\n * The items to choose between. Takes the fixed pane — 360px wide, 412px at\n * extra-large.\n */\n list?: ReactNode;\n /**\n * Which pane to show while only one fits, below the expanded breakpoint.\n * Both are shown from expanded up, where this is ignored.\n *\n * Controlled, with no uncontrolled fallback: the layout cannot know that an\n * item was selected or that the reader went back, so holding that state\n * here would only ever be wrong.\n * @default 'list'\n */\n showing?: 'detail' | 'list';\n} & Omit<RenderComponentProps<'div'>, 'children'>;\n\n/**\n * Material Design's list-detail layout: a fixed list pane beside a flexible\n * detail pane, collapsing to one pane at a time below the expanded breakpoint.\n *\n * Layout only — neither pane paints a surface of its own, so what goes inside\n * them is composed at the call site. `render` swaps the container's element,\n * for a layout that should be a `<main>` rather than a `<div>`.\n *\n * The panes are written to the DOM in the order they are shown, which is what\n * Material Design asks of co-planar panes: focus order has to match the\n * arrangement on screen.\n */\nfunction ListDetail({\n detail,\n list,\n render,\n showing = 'list',\n ...props\n}: ListDetailProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n children: <>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'detail') << 0]}>\n {list}\n </div>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'list') << 0]}>\n {detail}\n </div>\n </>,\n ...mergeStyles({\n className: \"x9f619 xrvj5dj xj2l1yv x1mkdm3x xkgydl7 xxxc7o5\"\n }, props)\n },\n render\n });\n}\nexport type { ListDetailProps };\nexport default ListDetail;"],"mappings":";;;;;;;;;;;;;;;;;AA+DA,SAAAc,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAoB,MAAA,EAAAL,QAAAC,MAAAO,QAAAM,IAAAZ,SAAAa,IAAA,GAAAC,UAAAX;EAAAG,SAAAM;EAIlB,MAAAZ,UAAAa,OAAAE,KAAAA,IAAA,SAAAF;EAGOtB,KAAAA;EACWmB,KAAA;EAEXI,KAAAA;EAAK,I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AAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAA;EAAAL,SAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;EAAAO,KAAAP,EAAA;CAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,QAAAG,MAAAH,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EA1BJG,KAAA;GAAA,GACFE;GAAKa,UACEnB;GAqBL,GACFC;EAGL;EAACL,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,UAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAQ,IAAA;EA7BcC,KAAA;GAAAe,gBACClB;GAAKI,OACdF;GA2BNN;EAEH;EAACF,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OA/BMb,GAAUsB,EA+BhB;AAAC"}
@@ -3,6 +3,7 @@ import { mergeStyles } from "../../styles/merge.js";
3
3
  import { useRipple } from "../../hooks/useRipple.js";
4
4
  import { rowStyles } from "../../row/styles.js";
5
5
  import { RowContent } from "../../row/index.js";
6
+ import { c } from "react/compiler-runtime";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  //#region src/components/list-item/index.tsx
8
9
  /**
@@ -17,30 +18,56 @@ import { jsx, jsxs } from "react/jsx-runtime";
17
18
  * here is the element around them — a `<div>` that presents, or a `<button>`
18
19
  * that ripples — and the props that fill the slots.
19
20
  */
20
- function ListItem({ children, interactive = false, leading, overline, supporting, trailing, ...props$1 }) {
21
+ function ListItem(t0) {
22
+ const $ = c(12);
23
+ const { children, interactive: t1, leading, overline, supporting, trailing, ...props$1 } = t0;
24
+ const interactive = t1 === void 0 ? false : t1;
21
25
  const ripple = useRipple(interactive);
22
26
  const extraLines = (overline === void 0 ? 0 : 1) + (supporting === void 0 ? 0 : 1);
23
27
  const twoLine = extraLines === 1;
24
28
  const threeLine = extraLines === 2;
25
- const content = /* @__PURE__ */ jsx(RowContent, {
26
- leading,
27
- overline,
28
- supporting,
29
- trailing,
30
- children
31
- });
29
+ let t2;
30
+ if ($[0] !== children || $[1] !== leading || $[2] !== overline || $[3] !== supporting || $[4] !== trailing) {
31
+ t2 = /* @__PURE__ */ jsx(RowContent, {
32
+ leading,
33
+ overline,
34
+ supporting,
35
+ trailing,
36
+ children
37
+ });
38
+ $[0] = children;
39
+ $[1] = leading;
40
+ $[2] = overline;
41
+ $[3] = supporting;
42
+ $[4] = trailing;
43
+ $[5] = t2;
44
+ } else t2 = $[5];
45
+ const content = t2;
32
46
  if (!interactive) return /* @__PURE__ */ jsx("div", {
33
47
  ...props$1,
34
48
  ...mergeStyles(props(rowStyles.base, rowStyles.list, twoLine && rowStyles.twoLine, threeLine && rowStyles.threeLine), props$1),
35
49
  children: content
36
50
  });
37
- return /* @__PURE__ */ jsxs("button", {
38
- type: "button",
39
- ...ripple.handlers,
40
- ...props$1,
41
- ...mergeStyles(props(rowStyles.base, rowStyles.list, rowStyles.interactive, twoLine && rowStyles.twoLine, threeLine && rowStyles.threeLine), props$1),
42
- children: [content, ripple.surface]
43
- });
51
+ const t3 = "button";
52
+ const t4 = ripple.handlers;
53
+ const t5 = mergeStyles(props(rowStyles.base, rowStyles.list, rowStyles.interactive, twoLine && rowStyles.twoLine, threeLine && rowStyles.threeLine), props$1);
54
+ let t6;
55
+ if ($[6] !== content || $[7] !== props$1 || $[8] !== ripple.handlers || $[9] !== ripple.surface || $[10] !== t5) {
56
+ t6 = /* @__PURE__ */ jsxs("button", {
57
+ type: t3,
58
+ ...t4,
59
+ ...props$1,
60
+ ...t5,
61
+ children: [content, ripple.surface]
62
+ });
63
+ $[6] = content;
64
+ $[7] = props$1;
65
+ $[8] = ripple.handlers;
66
+ $[9] = ripple.surface;
67
+ $[10] = t5;
68
+ $[11] = t6;
69
+ } else t6 = $[11];
70
+ return t6;
44
71
  }
45
72
  //#endregion
46
73
  export { ListItem as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/list-item/index.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStyles } from '../../styles/merge';\ntype ListItemProps = {\n /** The row's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /**\n * Renders a `<button>` that ripples and tints on hover, for a row that is\n * itself pressable. Leave it off for a row that only presents.\n * @default false\n */\n interactive?: 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 — a category, a date, a status. Given\n * alongside `supporting` it makes the row the page's three-line item.\n */\n overline?: 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} & HTMLAttributes<HTMLElement>;\n\n/**\n * A static row: the row every list draws, on its own, as the lists spec page\n * gives it — a 56px one-line container, a body-large headline and a\n * body-medium supporting line. A second line takes it to the page's 72px\n * two-line container; an `overline` puts that second line above the headline\n * instead of below it, and an overline with a supporting line makes the\n * page's three-line item, an 88px container with the leading and trailing\n * slots held at the top rather than centred. The layout and the states are\n * the row module's in `src/row`, shared with every collection item; what is\n * here is the element around them — a `<div>` that presents, or a `<button>`\n * that ripples — and the props that fill the slots.\n */\nfunction ListItem({\n children,\n interactive = false,\n leading,\n overline,\n supporting,\n trailing,\n ...props\n}: ListItemProps) {\n const ripple = useRipple<HTMLButtonElement>(interactive);\n\n // Which of the page's three items this row is, read from the content rather\n // than taken as a prop: a row holding all three lines already says it is\n // three lines, and a word for it would be a second place to get it wrong.\n // A line that wraps grows the row past its container height on its own and\n // keeps its slots centred, which is the shorter item made taller rather\n // than the next one along.\n //\n // The three-line item is the only row whose slots move, which is why it\n // alone carries an alignment as well as a height.\n const extraLines = (overline === undefined ? 0 : 1) + (supporting === undefined ? 0 : 1);\n const twoLine = extraLines === 1;\n const threeLine = extraLines === 2;\n const content = <RowContent leading={leading} overline={overline} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n if (!interactive) {\n return <div {...props} {...mergeStyles(stylex.props(rowStyles.base, rowStyles.list, twoLine && rowStyles.twoLine, threeLine && rowStyles.threeLine), props)}>\n {content}\n </div>;\n }\n return <button type=\"button\" {...ripple.handlers} {...props} {...mergeStyles(stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, twoLine && rowStyles.twoLine, threeLine && rowStyles.threeLine), props)}>\n {content}\n {ripple.surface}\n </button>;\n}\nexport type { ListItemProps };\nexport default ListItem;"],"mappings":";;;;;;;;;;;;;;;;;;;AAyCA,SAAS,SAAS,EAChB,UACA,cAAc,OACd,SACA,UACA,YACA,UACA,GAAG,WACa;CAChB,MAAM,SAAS,UAA6B,WAAW;CAWvD,MAAM,cAAc,aAAa,KAAA,IAAY,IAAI,MAAM,eAAe,KAAA,IAAY,IAAI;CACtF,MAAM,UAAU,eAAe;CAC/B,MAAM,YAAY,eAAe;CACjC,MAAM,UAAU,oBAAC,YAAD;EAAqB;EAAmB;EAAsB;EAAsB;EAC/F;CACS,CAAA;CACd,IAAI,CAAC,aACH,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAO,GAAI,YAAY,MAAa,UAAU,MAAM,UAAU,MAAM,WAAW,UAAU,SAAS,aAAa,UAAU,SAAS,GAAG,OAAK;EACrJ,UAAA;CACE,CAAA;CAET,OAAO,qBAAC,UAAD;EAAQ,MAAK;EAAS,GAAI,OAAO;EAAU,GAAI;EAAO,GAAI,YAAY,MAAa,UAAU,MAAM,UAAU,MAAM,UAAU,aAAa,WAAW,UAAU,SAAS,aAAa,UAAU,SAAS,GAAG,OAAK;EAAhN,UAAA,CACF,SACA,OAAO,OACF;;AACZ"}
1
+ {"version":3,"file":"index.js","names":["HTMLAttributes","ReactNode","stylex","useRipple","RowContent","rowStyles","mergeStyles","ListItemProps","children","interactive","leading","overline","supporting","trailing","HTMLElement","ListItem","t0","$","_c","t1","props","undefined","ripple","extraLines","twoLine","threeLine","t2","content","base","list","t3","t4","handlers","t5","t6","surface"],"sources":["../../../src/components/list-item/index.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStyles } from '../../styles/merge';\ntype ListItemProps = {\n /** The row's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /**\n * Renders a `<button>` that ripples and tints on hover, for a row that is\n * itself pressable. Leave it off for a row that only presents.\n * @default false\n */\n interactive?: 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 — a category, a date, a status. Given\n * alongside `supporting` it makes the row the page's three-line item.\n */\n overline?: 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} & HTMLAttributes<HTMLElement>;\n\n/**\n * A static row: the row every list draws, on its own, as the lists spec page\n * gives it — a 56px one-line container, a body-large headline and a\n * body-medium supporting line. A second line takes it to the page's 72px\n * two-line container; an `overline` puts that second line above the headline\n * instead of below it, and an overline with a supporting line makes the\n * page's three-line item, an 88px container with the leading and trailing\n * slots held at the top rather than centred. The layout and the states are\n * the row module's in `src/row`, shared with every collection item; what is\n * here is the element around them — a `<div>` that presents, or a `<button>`\n * that ripples — and the props that fill the slots.\n */\nfunction ListItem({\n children,\n interactive = false,\n leading,\n overline,\n supporting,\n trailing,\n ...props\n}: ListItemProps) {\n const ripple = useRipple<HTMLButtonElement>(interactive);\n\n // Which of the page's three items this row is, read from the content rather\n // than taken as a prop: a row holding all three lines already says it is\n // three lines, and a word for it would be a second place to get it wrong.\n // A line that wraps grows the row past its container height on its own and\n // keeps its slots centred, which is the shorter item made taller rather\n // than the next one along.\n //\n // The three-line item is the only row whose slots move, which is why it\n // alone carries an alignment as well as a height.\n const extraLines = (overline === undefined ? 0 : 1) + (supporting === undefined ? 0 : 1);\n const twoLine = extraLines === 1;\n const threeLine = extraLines === 2;\n const content = <RowContent leading={leading} overline={overline} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n if (!interactive) {\n return <div {...props} {...mergeStyles(stylex.props(rowStyles.base, rowStyles.list, twoLine && rowStyles.twoLine, threeLine && rowStyles.threeLine), props)}>\n {content}\n </div>;\n }\n return <button type=\"button\" {...ripple.handlers} {...props} {...mergeStyles(stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, twoLine && rowStyles.twoLine, threeLine && rowStyles.threeLine), props)}>\n {content}\n {ripple.surface}\n </button>;\n}\nexport type { ListItemProps };\nexport default ListItem;"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,SAAAe,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAkB,MAAA,EAAAV,UAAAC,aAAAU,IAAAT,SAAAC,UAAAC,YAAAC,UAAA,GAAAO,YAAAJ;CAEhB,MAAAP,cAAAU,OAAAE,KAAAA,IAAA,QAAAF;CAOA,MAAAG,SAAenB,UAA6BM,WAAW;CAWvD,MAAAc,cAAoBZ,aAAaU,KAAAA,IAAb,IAAA,MAAmCT,eAAeS,KAAAA,IAAf,IAAA;CACvD,MAAAG,UAAgBD,eAAe;CAC/B,MAAAE,YAAkBF,eAAe;CAAE,IAAAG;CAAA,IAAAT,EAAA,OAAAT,YAAAS,EAAA,OAA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
  import { rowStyles } from "../../row/styles.js";
7
7
  import { RowContent } from "../../row/index.js";
8
8
  import Separator$1 from "../separator/index.js";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
9
  import { c } from "react/compiler-runtime";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  import { Header, Keyboard, Menu, MenuItem, MenuLoadMoreItem, MenuSection, MenuTrigger, Popover, SubmenuTrigger, Text } from "react-aria-components";
12
12
  //#region src/components/menu/index.tsx
13
13
  const styles = { content: {
@@ -86,24 +86,103 @@ function Menu$1(t0) {
86
86
  * The call site's `className` and `style` land on the surface, which is the
87
87
  * element a layout positions.
88
88
  */
89
- function MenuContent({ align = "start", alignOffset, className, container, search, side = "bottom", sideOffset = 8, style, ...props }) {
90
- return /* @__PURE__ */ jsxs(Popover, {
91
- crossOffset: alignOffset,
92
- offset: sideOffset,
93
- placement: placementOf(side, align),
94
- UNSTABLE_portalContainer: container,
95
- ...mergeStatefulStyles(surfaceStyles, {}),
96
- children: [search === void 0 ? null : /* @__PURE__ */ jsx("div", {
89
+ function MenuContent(t0) {
90
+ const $ = c(29);
91
+ let alignOffset;
92
+ let className;
93
+ let container;
94
+ let props;
95
+ let search;
96
+ let style;
97
+ let t1;
98
+ let t2;
99
+ let t3;
100
+ if ($[0] !== t0) {
101
+ ({align: t1, alignOffset, className, container, search, side: t2, sideOffset: t3, style, ...props} = t0);
102
+ $[0] = t0;
103
+ $[1] = alignOffset;
104
+ $[2] = className;
105
+ $[3] = container;
106
+ $[4] = props;
107
+ $[5] = search;
108
+ $[6] = style;
109
+ $[7] = t1;
110
+ $[8] = t2;
111
+ $[9] = t3;
112
+ } else {
113
+ alignOffset = $[1];
114
+ className = $[2];
115
+ container = $[3];
116
+ props = $[4];
117
+ search = $[5];
118
+ style = $[6];
119
+ t1 = $[7];
120
+ t2 = $[8];
121
+ t3 = $[9];
122
+ }
123
+ const align = t1 === void 0 ? "start" : t1;
124
+ const side = t2 === void 0 ? "bottom" : t2;
125
+ const sideOffset = t3 === void 0 ? 8 : t3;
126
+ let t4;
127
+ if ($[10] !== align || $[11] !== side) {
128
+ t4 = placementOf(side, align);
129
+ $[10] = align;
130
+ $[11] = side;
131
+ $[12] = t4;
132
+ } else t4 = $[12];
133
+ let t5;
134
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
135
+ t5 = mergeStatefulStyles(surfaceStyles, {});
136
+ $[13] = t5;
137
+ } else t5 = $[13];
138
+ let t6;
139
+ if ($[14] !== search) {
140
+ t6 = search === void 0 ? null : /* @__PURE__ */ jsx("div", {
97
141
  className: "x9f619 xqf7pud xn60lsn",
98
142
  children: search
99
- }), /* @__PURE__ */ jsx(Menu, {
143
+ });
144
+ $[14] = search;
145
+ $[15] = t6;
146
+ } else t6 = $[15];
147
+ let t7;
148
+ if ($[16] !== className || $[17] !== style) {
149
+ t7 = mergeStatefulStyles({ className: "x9f619 x78zum5 xdt5ytf x1t137rt" }, {
150
+ className,
151
+ style
152
+ });
153
+ $[16] = className;
154
+ $[17] = style;
155
+ $[18] = t7;
156
+ } else t7 = $[18];
157
+ let t8;
158
+ if ($[19] !== props || $[20] !== t7) {
159
+ t8 = /* @__PURE__ */ jsx(Menu, {
100
160
  ...props,
101
- ...mergeStatefulStyles({ className: "x9f619 x78zum5 xdt5ytf x1t137rt" }, {
102
- className,
103
- style
104
- })
105
- })]
106
- });
161
+ ...t7
162
+ });
163
+ $[19] = props;
164
+ $[20] = t7;
165
+ $[21] = t8;
166
+ } else t8 = $[21];
167
+ let t9;
168
+ if ($[22] !== alignOffset || $[23] !== container || $[24] !== sideOffset || $[25] !== t4 || $[26] !== t6 || $[27] !== t8) {
169
+ t9 = /* @__PURE__ */ jsxs(Popover, {
170
+ crossOffset: alignOffset,
171
+ offset: sideOffset,
172
+ placement: t4,
173
+ UNSTABLE_portalContainer: container,
174
+ ...t5,
175
+ children: [t6, t8]
176
+ });
177
+ $[22] = alignOffset;
178
+ $[23] = container;
179
+ $[24] = sideOffset;
180
+ $[25] = t4;
181
+ $[26] = t6;
182
+ $[27] = t8;
183
+ $[28] = t9;
184
+ } else t9 = $[28];
185
+ return t9;
107
186
  }
108
187
  /**
109
188
  * One action. Its slots are the row's: `leading` before the label, the label
@@ -184,17 +263,54 @@ function MenuItem$1(t0) {
184
263
  * The row shown while more items are being fetched. React Aria calls
185
264
  * `onLoadMore` when it comes into view, and draws it only while `isLoading`.
186
265
  */
187
- function MenuLoadMore({ label = "Loading more", ...props }) {
188
- return /* @__PURE__ */ jsx(MenuLoadMoreItem, {
189
- ...props,
190
- ...mergeStyles({ className: "x6s0dn4 x9f619 x78zum5 xl56j7k x1wxaq2x" }, props),
191
- children: /* @__PURE__ */ jsx(ProgressIndicator, {
266
+ function MenuLoadMore(t0) {
267
+ const $ = c(12);
268
+ let T0;
269
+ let label;
270
+ let t1;
271
+ let t2;
272
+ if ($[0] !== t0) {
273
+ const { label: t3, ...props } = t0;
274
+ label = t3 === void 0 ? "Loading more" : t3;
275
+ T0 = MenuLoadMoreItem;
276
+ t1 = props;
277
+ t2 = mergeStyles({ className: "x6s0dn4 x9f619 x78zum5 xl56j7k x1wxaq2x" }, props);
278
+ $[0] = t0;
279
+ $[1] = T0;
280
+ $[2] = label;
281
+ $[3] = t1;
282
+ $[4] = t2;
283
+ } else {
284
+ T0 = $[1];
285
+ label = $[2];
286
+ t1 = $[3];
287
+ t2 = $[4];
288
+ }
289
+ let t3;
290
+ if ($[5] !== label) {
291
+ t3 = /* @__PURE__ */ jsx(ProgressIndicator, {
192
292
  "aria-label": label,
193
293
  isIndeterminate: true,
194
294
  size: "20px",
195
295
  variant: "circular"
196
- })
197
- });
296
+ });
297
+ $[5] = label;
298
+ $[6] = t3;
299
+ } else t3 = $[6];
300
+ let t4;
301
+ if ($[7] !== T0 || $[8] !== t1 || $[9] !== t2 || $[10] !== t3) {
302
+ t4 = /* @__PURE__ */ jsx(T0, {
303
+ ...t1,
304
+ ...t2,
305
+ children: t3
306
+ });
307
+ $[7] = T0;
308
+ $[8] = t1;
309
+ $[9] = t2;
310
+ $[10] = t3;
311
+ $[11] = t4;
312
+ } else t4 = $[11];
313
+ return t4;
198
314
  }
199
315
  /**
200
316
  * A named group of items. `header` names it, and is what a screen reader