@windmorph/react 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (761) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +23 -0
  3. package/README.md +149 -2
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +112 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/components/app-bar/AppBarItems.js +23 -0
  8. package/dist/components/app-bar/AppBarItems.js.map +1 -0
  9. package/dist/components/app-bar/TopAppBar.d.ts +89 -0
  10. package/dist/components/app-bar/TopAppBar.js +103 -0
  11. package/dist/components/app-bar/TopAppBar.js.map +1 -0
  12. package/dist/components/app-bar/app-bar-styles.d.ts +280 -0
  13. package/dist/components/app-bar/app-bar-styles.js +142 -0
  14. package/dist/components/app-bar/app-bar-styles.js.map +1 -0
  15. package/dist/components/app-bar/app-bar-tokens.d.ts +7 -0
  16. package/dist/components/app-bar/app-bar-tokens.js +64 -0
  17. package/dist/components/app-bar/app-bar-tokens.js.map +1 -0
  18. package/dist/components/app-bar/use-app-bar-scroll.d.ts +6 -0
  19. package/dist/components/app-bar/use-app-bar-scroll.js +139 -0
  20. package/dist/components/app-bar/use-app-bar-scroll.js.map +1 -0
  21. package/dist/components/autocomplete/Autocomplete.d.ts +142 -0
  22. package/dist/components/autocomplete/Autocomplete.js +284 -0
  23. package/dist/components/autocomplete/Autocomplete.js.map +1 -0
  24. package/dist/components/badge/Badge.d.ts +71 -0
  25. package/dist/components/badge/Badge.js +72 -0
  26. package/dist/components/badge/Badge.js.map +1 -0
  27. package/dist/components/badge/badge-styles.d.ts +100 -0
  28. package/dist/components/badge/badge-styles.js +43 -0
  29. package/dist/components/badge/badge-styles.js.map +1 -0
  30. package/dist/components/badge/badge-tokens.d.ts +7 -0
  31. package/dist/components/badge/badge-tokens.js +40 -0
  32. package/dist/components/badge/badge-tokens.js.map +1 -0
  33. package/dist/components/button/Button.d.ts +91 -0
  34. package/dist/components/button/Button.js +96 -0
  35. package/dist/components/button/Button.js.map +1 -0
  36. package/dist/components/button/ButtonContext.d.ts +30 -0
  37. package/dist/components/button/ButtonContext.js +18 -0
  38. package/dist/components/button/ButtonContext.js.map +1 -0
  39. package/dist/components/button/DensityZeroButtons.js +25 -0
  40. package/dist/components/button/DensityZeroButtons.js.map +1 -0
  41. package/dist/components/button/button-pending.d.ts +10 -0
  42. package/dist/components/button/button-pending.js +166 -0
  43. package/dist/components/button/button-pending.js.map +1 -0
  44. package/dist/components/button/button-styles.d.ts +216 -0
  45. package/dist/components/button/button-styles.js +199 -0
  46. package/dist/components/button/button-styles.js.map +1 -0
  47. package/dist/components/button/button-tokens.d.ts +10 -0
  48. package/dist/components/button/button-tokens.js +257 -0
  49. package/dist/components/button/button-tokens.js.map +1 -0
  50. package/dist/components/button/connected-shapes.js +152 -0
  51. package/dist/components/button/connected-shapes.js.map +1 -0
  52. package/dist/components/card/Card.d.ts +60 -0
  53. package/dist/components/card/Card.js +69 -0
  54. package/dist/components/card/Card.js.map +1 -0
  55. package/dist/components/card/card-styles.d.ts +42 -0
  56. package/dist/components/card/card-styles.js +64 -0
  57. package/dist/components/card/card-styles.js.map +1 -0
  58. package/dist/components/card/card-tokens.d.ts +7 -0
  59. package/dist/components/card/card-tokens.js +84 -0
  60. package/dist/components/card/card-tokens.js.map +1 -0
  61. package/dist/components/carousel/Carousel.d.ts +124 -0
  62. package/dist/components/carousel/Carousel.js +387 -0
  63. package/dist/components/carousel/Carousel.js.map +1 -0
  64. package/dist/components/carousel/carousel-keylines.js +486 -0
  65. package/dist/components/carousel/carousel-keylines.js.map +1 -0
  66. package/dist/components/carousel/carousel-press-area.js +35 -0
  67. package/dist/components/carousel/carousel-press-area.js.map +1 -0
  68. package/dist/components/carousel/carousel-styles.d.ts +188 -0
  69. package/dist/components/carousel/carousel-styles.js +116 -0
  70. package/dist/components/carousel/carousel-styles.js.map +1 -0
  71. package/dist/components/carousel/carousel-tokens.d.ts +7 -0
  72. package/dist/components/carousel/carousel-tokens.js +18 -0
  73. package/dist/components/carousel/carousel-tokens.js.map +1 -0
  74. package/dist/components/checkbox/Checkbox.d.ts +78 -0
  75. package/dist/components/checkbox/Checkbox.js +77 -0
  76. package/dist/components/checkbox/Checkbox.js.map +1 -0
  77. package/dist/components/checkbox/checkbox-box.js +34 -0
  78. package/dist/components/checkbox/checkbox-box.js.map +1 -0
  79. package/dist/components/checkbox/checkbox-styles.d.ts +100 -0
  80. package/dist/components/checkbox/checkbox-styles.js +54 -0
  81. package/dist/components/checkbox/checkbox-styles.js.map +1 -0
  82. package/dist/components/checkbox/checkbox-tokens.d.ts +7 -0
  83. package/dist/components/checkbox/checkbox-tokens.js +41 -0
  84. package/dist/components/checkbox/checkbox-tokens.js.map +1 -0
  85. package/dist/components/chip/Chip.d.ts +171 -0
  86. package/dist/components/chip/Chip.js +348 -0
  87. package/dist/components/chip/Chip.js.map +1 -0
  88. package/dist/components/chip/ChipSet.d.ts +70 -0
  89. package/dist/components/chip/ChipSet.js +198 -0
  90. package/dist/components/chip/ChipSet.js.map +1 -0
  91. package/dist/components/chip/chip-styles.d.ts +263 -0
  92. package/dist/components/chip/chip-styles.js +360 -0
  93. package/dist/components/chip/chip-styles.js.map +1 -0
  94. package/dist/components/chip/chip-tokens.d.ts +13 -0
  95. package/dist/components/chip/chip-tokens.js +185 -0
  96. package/dist/components/chip/chip-tokens.js.map +1 -0
  97. package/dist/components/date-picker/CalendarGrid.js +94 -0
  98. package/dist/components/date-picker/CalendarGrid.js.map +1 -0
  99. package/dist/components/date-picker/CompactDateDialog.js +63 -0
  100. package/dist/components/date-picker/CompactDateDialog.js.map +1 -0
  101. package/dist/components/date-picker/DateField.d.ts +161 -0
  102. package/dist/components/date-picker/DateField.js +393 -0
  103. package/dist/components/date-picker/DateField.js.map +1 -0
  104. package/dist/components/date-picker/DateInput.d.ts +20 -0
  105. package/dist/components/date-picker/DateInput.js +99 -0
  106. package/dist/components/date-picker/DateInput.js.map +1 -0
  107. package/dist/components/date-picker/DatePicker.d.ts +165 -0
  108. package/dist/components/date-picker/DatePicker.js +492 -0
  109. package/dist/components/date-picker/DatePicker.js.map +1 -0
  110. package/dist/components/date-picker/PickerDialog.d.ts +121 -0
  111. package/dist/components/date-picker/PickerDialog.js +161 -0
  112. package/dist/components/date-picker/PickerDialog.js.map +1 -0
  113. package/dist/components/date-picker/calendar-parts.js +141 -0
  114. package/dist/components/date-picker/calendar-parts.js.map +1 -0
  115. package/dist/components/date-picker/date-format.js +72 -0
  116. package/dist/components/date-picker/date-format.js.map +1 -0
  117. package/dist/components/date-picker/date-picker-styles.d.ts +247 -0
  118. package/dist/components/date-picker/date-picker-styles.js +163 -0
  119. package/dist/components/date-picker/date-picker-styles.js.map +1 -0
  120. package/dist/components/date-picker/date-picker-tokens.d.ts +7 -0
  121. package/dist/components/date-picker/date-picker-tokens.js +104 -0
  122. package/dist/components/date-picker/date-picker-tokens.js.map +1 -0
  123. package/dist/components/date-picker/picker-dialog-context.js +8 -0
  124. package/dist/components/date-picker/picker-dialog-context.js.map +1 -0
  125. package/dist/components/date-picker/picker-dialog-styles.d.ts +95 -0
  126. package/dist/components/date-picker/picker-dialog-styles.js +57 -0
  127. package/dist/components/date-picker/picker-dialog-styles.js.map +1 -0
  128. package/dist/components/date-picker/picker-icons.js +24 -0
  129. package/dist/components/date-picker/picker-icons.js.map +1 -0
  130. package/dist/components/date-picker/use-media-query.js +21 -0
  131. package/dist/components/date-picker/use-media-query.js.map +1 -0
  132. package/dist/components/date-picker/use-size-transform.js +62 -0
  133. package/dist/components/date-picker/use-size-transform.js.map +1 -0
  134. package/dist/components/date-picker/use-view-exit.js +68 -0
  135. package/dist/components/date-picker/use-view-exit.js.map +1 -0
  136. package/dist/components/dialog/Dialog.d.ts +267 -0
  137. package/dist/components/dialog/Dialog.js +521 -0
  138. package/dist/components/dialog/Dialog.js.map +1 -0
  139. package/dist/components/dialog/dialog-styles.d.ts +335 -0
  140. package/dist/components/dialog/dialog-styles.js +377 -0
  141. package/dist/components/dialog/dialog-styles.js.map +1 -0
  142. package/dist/components/dialog/dialog-tokens.d.ts +7 -0
  143. package/dist/components/dialog/dialog-tokens.js +57 -0
  144. package/dist/components/dialog/dialog-tokens.js.map +1 -0
  145. package/dist/components/divider/Divider.d.ts +59 -0
  146. package/dist/components/divider/Divider.js +53 -0
  147. package/dist/components/divider/Divider.js.map +1 -0
  148. package/dist/components/divider/divider-styles.d.ts +90 -0
  149. package/dist/components/divider/divider-styles.js +66 -0
  150. package/dist/components/divider/divider-styles.js.map +1 -0
  151. package/dist/components/divider/divider-tokens.d.ts +7 -0
  152. package/dist/components/divider/divider-tokens.js +16 -0
  153. package/dist/components/divider/divider-tokens.js.map +1 -0
  154. package/dist/components/fab/Fab.d.ts +130 -0
  155. package/dist/components/fab/Fab.js +137 -0
  156. package/dist/components/fab/Fab.js.map +1 -0
  157. package/dist/components/fab/FabTooltip.js +36 -0
  158. package/dist/components/fab/FabTooltip.js.map +1 -0
  159. package/dist/components/fab/fab-styles.d.ts +286 -0
  160. package/dist/components/fab/fab-styles.js +131 -0
  161. package/dist/components/fab/fab-styles.js.map +1 -0
  162. package/dist/components/fab/fab-tokens.d.ts +12 -0
  163. package/dist/components/fab/fab-tokens.js +105 -0
  164. package/dist/components/fab/fab-tokens.js.map +1 -0
  165. package/dist/components/fab-menu/FabMenu.d.ts +156 -0
  166. package/dist/components/fab-menu/FabMenu.js +291 -0
  167. package/dist/components/fab-menu/FabMenu.js.map +1 -0
  168. package/dist/components/fab-menu/fab-menu-stagger.js +51 -0
  169. package/dist/components/fab-menu/fab-menu-stagger.js.map +1 -0
  170. package/dist/components/fab-menu/fab-menu-styles.d.ts +166 -0
  171. package/dist/components/fab-menu/fab-menu-styles.js +107 -0
  172. package/dist/components/fab-menu/fab-menu-styles.js.map +1 -0
  173. package/dist/components/fab-menu/fab-menu-tokens.d.ts +7 -0
  174. package/dist/components/fab-menu/fab-menu-tokens.js +120 -0
  175. package/dist/components/fab-menu/fab-menu-tokens.js.map +1 -0
  176. package/dist/components/icon-button/IconButton.d.ts +125 -0
  177. package/dist/components/icon-button/IconButton.js +112 -0
  178. package/dist/components/icon-button/IconButton.js.map +1 -0
  179. package/dist/components/icon-button/icon-button-styles.d.ts +217 -0
  180. package/dist/components/icon-button/icon-button-styles.js +244 -0
  181. package/dist/components/icon-button/icon-button-styles.js.map +1 -0
  182. package/dist/components/icon-button/icon-button-tokens.d.ts +11 -0
  183. package/dist/components/icon-button/icon-button-tokens.js +215 -0
  184. package/dist/components/icon-button/icon-button-tokens.js.map +1 -0
  185. package/dist/components/list/List.d.ts +265 -0
  186. package/dist/components/list/List.js +1386 -0
  187. package/dist/components/list/List.js.map +1 -0
  188. package/dist/components/list/ListMedia.d.ts +88 -0
  189. package/dist/components/list/ListMedia.js +132 -0
  190. package/dist/components/list/ListMedia.js.map +1 -0
  191. package/dist/components/list/list-styles.d.ts +375 -0
  192. package/dist/components/list/list-styles.js +220 -0
  193. package/dist/components/list/list-styles.js.map +1 -0
  194. package/dist/components/list/list-tokens.d.ts +7 -0
  195. package/dist/components/list/list-tokens.js +92 -0
  196. package/dist/components/list/list-tokens.js.map +1 -0
  197. package/dist/components/loading-indicator/LoadingIndicator.d.ts +65 -0
  198. package/dist/components/loading-indicator/LoadingIndicator.js +92 -0
  199. package/dist/components/loading-indicator/LoadingIndicator.js.map +1 -0
  200. package/dist/components/loading-indicator/lazy-loading-indicator.js +25 -0
  201. package/dist/components/loading-indicator/lazy-loading-indicator.js.map +1 -0
  202. package/dist/components/loading-indicator/loading-indicator-frames.js +149 -0
  203. package/dist/components/loading-indicator/loading-indicator-frames.js.map +1 -0
  204. package/dist/components/loading-indicator/loading-indicator-styles.d.ts +36 -0
  205. package/dist/components/loading-indicator/loading-indicator-styles.js +22 -0
  206. package/dist/components/loading-indicator/loading-indicator-styles.js.map +1 -0
  207. package/dist/components/loading-indicator/loading-indicator-tokens.d.ts +7 -0
  208. package/dist/components/loading-indicator/loading-indicator-tokens.js +44 -0
  209. package/dist/components/loading-indicator/loading-indicator-tokens.js.map +1 -0
  210. package/dist/components/menu/Menu.d.ts +215 -0
  211. package/dist/components/menu/Menu.js +715 -0
  212. package/dist/components/menu/Menu.js.map +1 -0
  213. package/dist/components/menu/menu-styles.d.ts +354 -0
  214. package/dist/components/menu/menu-styles.js +219 -0
  215. package/dist/components/menu/menu-styles.js.map +1 -0
  216. package/dist/components/menu/menu-tokens.d.ts +7 -0
  217. package/dist/components/menu/menu-tokens.js +93 -0
  218. package/dist/components/menu/menu-tokens.js.map +1 -0
  219. package/dist/components/menu/menu-trigger.d.ts +51 -0
  220. package/dist/components/menu/menu-trigger.js +100 -0
  221. package/dist/components/menu/menu-trigger.js.map +1 -0
  222. package/dist/components/menu/use-reveal-entering.js +42 -0
  223. package/dist/components/menu/use-reveal-entering.js.map +1 -0
  224. package/dist/components/navigation/NavItem.d.ts +54 -0
  225. package/dist/components/navigation/NavItem.js +182 -0
  226. package/dist/components/navigation/NavItem.js.map +1 -0
  227. package/dist/components/navigation/NavigationBar.d.ts +64 -0
  228. package/dist/components/navigation/NavigationBar.js +121 -0
  229. package/dist/components/navigation/NavigationBar.js.map +1 -0
  230. package/dist/components/navigation/NavigationRail.d.ts +91 -0
  231. package/dist/components/navigation/NavigationRail.js +285 -0
  232. package/dist/components/navigation/NavigationRail.js.map +1 -0
  233. package/dist/components/navigation/nav-item-styles.d.ts +190 -0
  234. package/dist/components/navigation/nav-item-styles.js +123 -0
  235. package/dist/components/navigation/nav-item-styles.js.map +1 -0
  236. package/dist/components/navigation/navigation-styles.d.ts +239 -0
  237. package/dist/components/navigation/navigation-styles.js +134 -0
  238. package/dist/components/navigation/navigation-styles.js.map +1 -0
  239. package/dist/components/navigation/navigation-tokens.d.ts +9 -0
  240. package/dist/components/navigation/navigation-tokens.js +114 -0
  241. package/dist/components/navigation/navigation-tokens.js.map +1 -0
  242. package/dist/components/navigation/use-hide-on-scroll.js +115 -0
  243. package/dist/components/navigation/use-hide-on-scroll.js.map +1 -0
  244. package/dist/components/navigation/use-item-arrow-keys.js +37 -0
  245. package/dist/components/navigation/use-item-arrow-keys.js.map +1 -0
  246. package/dist/components/navigation/use-rail-item-morph.js +61 -0
  247. package/dist/components/navigation/use-rail-item-morph.js.map +1 -0
  248. package/dist/components/progress/ProgressIndicator.d.ts +95 -0
  249. package/dist/components/progress/ProgressIndicator.js +426 -0
  250. package/dist/components/progress/ProgressIndicator.js.map +1 -0
  251. package/dist/components/progress/progress-geometry.js +285 -0
  252. package/dist/components/progress/progress-geometry.js.map +1 -0
  253. package/dist/components/progress/progress-styles.d.ts +81 -0
  254. package/dist/components/progress/progress-styles.js +43 -0
  255. package/dist/components/progress/progress-styles.js.map +1 -0
  256. package/dist/components/progress/progress-tokens.d.ts +7 -0
  257. package/dist/components/progress/progress-tokens.js +39 -0
  258. package/dist/components/progress/progress-tokens.js.map +1 -0
  259. package/dist/components/pull-to-refresh/PullToRefresh.d.ts +94 -0
  260. package/dist/components/pull-to-refresh/PullToRefresh.js +395 -0
  261. package/dist/components/pull-to-refresh/PullToRefresh.js.map +1 -0
  262. package/dist/components/pull-to-refresh/pull-to-refresh-math.js +37 -0
  263. package/dist/components/pull-to-refresh/pull-to-refresh-math.js.map +1 -0
  264. package/dist/components/pull-to-refresh/pull-to-refresh-styles.d.ts +53 -0
  265. package/dist/components/pull-to-refresh/pull-to-refresh-styles.js +14 -0
  266. package/dist/components/pull-to-refresh/pull-to-refresh-styles.js.map +1 -0
  267. package/dist/components/radio/RadioGroup.d.ts +121 -0
  268. package/dist/components/radio/RadioGroup.js +163 -0
  269. package/dist/components/radio/RadioGroup.js.map +1 -0
  270. package/dist/components/radio/radio-ring.js +21 -0
  271. package/dist/components/radio/radio-ring.js.map +1 -0
  272. package/dist/components/radio/radio-styles.d.ts +155 -0
  273. package/dist/components/radio/radio-styles.js +60 -0
  274. package/dist/components/radio/radio-styles.js.map +1 -0
  275. package/dist/components/radio/radio-tokens.d.ts +7 -0
  276. package/dist/components/radio/radio-tokens.js +31 -0
  277. package/dist/components/radio/radio-tokens.js.map +1 -0
  278. package/dist/components/search/SearchAppBar.d.ts +45 -0
  279. package/dist/components/search/SearchAppBar.js +61 -0
  280. package/dist/components/search/SearchAppBar.js.map +1 -0
  281. package/dist/components/search/SearchBar.d.ts +147 -0
  282. package/dist/components/search/SearchBar.js +412 -0
  283. package/dist/components/search/SearchBar.js.map +1 -0
  284. package/dist/components/search/search-styles.d.ts +243 -0
  285. package/dist/components/search/search-styles.js +143 -0
  286. package/dist/components/search/search-styles.js.map +1 -0
  287. package/dist/components/search/search-tokens.d.ts +9 -0
  288. package/dist/components/search/search-tokens.js +70 -0
  289. package/dist/components/search/search-tokens.js.map +1 -0
  290. package/dist/components/select/Select.d.ts +187 -0
  291. package/dist/components/select/Select.js +319 -0
  292. package/dist/components/select/Select.js.map +1 -0
  293. package/dist/components/select/field-shell.d.ts +29 -0
  294. package/dist/components/select/field-shell.js +135 -0
  295. package/dist/components/select/field-shell.js.map +1 -0
  296. package/dist/components/select/option-list.d.ts +81 -0
  297. package/dist/components/select/option-list.js +291 -0
  298. package/dist/components/select/option-list.js.map +1 -0
  299. package/dist/components/select/search-list.js +135 -0
  300. package/dist/components/select/search-list.js.map +1 -0
  301. package/dist/components/select/selection-cap.js +30 -0
  302. package/dist/components/select/selection-cap.js.map +1 -0
  303. package/dist/components/sheet/BottomSheet.d.ts +154 -0
  304. package/dist/components/sheet/BottomSheet.js +442 -0
  305. package/dist/components/sheet/BottomSheet.js.map +1 -0
  306. package/dist/components/sheet/SheetTrigger.d.ts +25 -0
  307. package/dist/components/sheet/SheetTrigger.js +46 -0
  308. package/dist/components/sheet/SheetTrigger.js.map +1 -0
  309. package/dist/components/sheet/SideSheet.d.ts +139 -0
  310. package/dist/components/sheet/SideSheet.js +289 -0
  311. package/dist/components/sheet/SideSheet.js.map +1 -0
  312. package/dist/components/sheet/bottom-sheet-gesture.js +30 -0
  313. package/dist/components/sheet/bottom-sheet-gesture.js.map +1 -0
  314. package/dist/components/sheet/lazy-bottom-sheet.js +33 -0
  315. package/dist/components/sheet/lazy-bottom-sheet.js.map +1 -0
  316. package/dist/components/sheet/sheet-gesture.js +48 -0
  317. package/dist/components/sheet/sheet-gesture.js.map +1 -0
  318. package/dist/components/sheet/sheet-icons.js +31 -0
  319. package/dist/components/sheet/sheet-icons.js.map +1 -0
  320. package/dist/components/sheet/sheet-settle.js +58 -0
  321. package/dist/components/sheet/sheet-settle.js.map +1 -0
  322. package/dist/components/sheet/sheet-styles.d.ts +312 -0
  323. package/dist/components/sheet/sheet-styles.js +229 -0
  324. package/dist/components/sheet/sheet-styles.js.map +1 -0
  325. package/dist/components/sheet/sheet-tokens.d.ts +12 -0
  326. package/dist/components/sheet/sheet-tokens.js +115 -0
  327. package/dist/components/sheet/sheet-tokens.js.map +1 -0
  328. package/dist/components/sheet/side-swipe-gesture.js +22 -0
  329. package/dist/components/sheet/side-swipe-gesture.js.map +1 -0
  330. package/dist/components/sheet/use-peek-inert.js +32 -0
  331. package/dist/components/sheet/use-peek-inert.js.map +1 -0
  332. package/dist/components/sheet/use-side-swipe.js +174 -0
  333. package/dist/components/sheet/use-side-swipe.js.map +1 -0
  334. package/dist/components/slider/Slider.d.ts +129 -0
  335. package/dist/components/slider/Slider.js +295 -0
  336. package/dist/components/slider/Slider.js.map +1 -0
  337. package/dist/components/slider/slider-geometry.js +138 -0
  338. package/dist/components/slider/slider-geometry.js.map +1 -0
  339. package/dist/components/slider/slider-styles.d.ts +133 -0
  340. package/dist/components/slider/slider-styles.js +97 -0
  341. package/dist/components/slider/slider-styles.js.map +1 -0
  342. package/dist/components/slider/slider-tokens.d.ts +7 -0
  343. package/dist/components/slider/slider-tokens.js +66 -0
  344. package/dist/components/slider/slider-tokens.js.map +1 -0
  345. package/dist/components/slider/use-touch-track.js +138 -0
  346. package/dist/components/slider/use-touch-track.js.map +1 -0
  347. package/dist/components/snackbar/Snackbar.d.ts +96 -0
  348. package/dist/components/snackbar/Snackbar.js +253 -0
  349. package/dist/components/snackbar/Snackbar.js.map +1 -0
  350. package/dist/components/snackbar/snackbar-state.d.ts +58 -0
  351. package/dist/components/snackbar/snackbar-state.js +73 -0
  352. package/dist/components/snackbar/snackbar-state.js.map +1 -0
  353. package/dist/components/snackbar/snackbar-styles.d.ts +109 -0
  354. package/dist/components/snackbar/snackbar-styles.js +67 -0
  355. package/dist/components/snackbar/snackbar-styles.js.map +1 -0
  356. package/dist/components/snackbar/snackbar-tokens.d.ts +7 -0
  357. package/dist/components/snackbar/snackbar-tokens.js +54 -0
  358. package/dist/components/snackbar/snackbar-tokens.js.map +1 -0
  359. package/dist/components/split-button/SplitButton.d.ts +109 -0
  360. package/dist/components/split-button/SplitButton.js +195 -0
  361. package/dist/components/split-button/SplitButton.js.map +1 -0
  362. package/dist/components/split-button/split-button-styles.d.ts +214 -0
  363. package/dist/components/split-button/split-button-styles.js +164 -0
  364. package/dist/components/split-button/split-button-styles.js.map +1 -0
  365. package/dist/components/split-button/split-button-tokens.d.ts +7 -0
  366. package/dist/components/split-button/split-button-tokens.js +36 -0
  367. package/dist/components/split-button/split-button-tokens.js.map +1 -0
  368. package/dist/components/switch/Switch.d.ts +82 -0
  369. package/dist/components/switch/Switch.js +165 -0
  370. package/dist/components/switch/Switch.js.map +1 -0
  371. package/dist/components/switch/switch-styles.d.ts +96 -0
  372. package/dist/components/switch/switch-styles.js +68 -0
  373. package/dist/components/switch/switch-styles.js.map +1 -0
  374. package/dist/components/switch/switch-thumb.js +41 -0
  375. package/dist/components/switch/switch-thumb.js.map +1 -0
  376. package/dist/components/switch/switch-tokens.d.ts +7 -0
  377. package/dist/components/switch/switch-tokens.js +78 -0
  378. package/dist/components/switch/switch-tokens.js.map +1 -0
  379. package/dist/components/tabs/Tabs.d.ts +120 -0
  380. package/dist/components/tabs/Tabs.js +346 -0
  381. package/dist/components/tabs/Tabs.js.map +1 -0
  382. package/dist/components/tabs/tabs-styles.d.ts +198 -0
  383. package/dist/components/tabs/tabs-styles.js +99 -0
  384. package/dist/components/tabs/tabs-styles.js.map +1 -0
  385. package/dist/components/tabs/tabs-tokens.d.ts +7 -0
  386. package/dist/components/tabs/tabs-tokens.js +121 -0
  387. package/dist/components/tabs/tabs-tokens.js.map +1 -0
  388. package/dist/components/text-field/TextField.d.ts +175 -0
  389. package/dist/components/text-field/TextField.js +250 -0
  390. package/dist/components/text-field/TextField.js.map +1 -0
  391. package/dist/components/text-field/text-field-styles.d.ts +252 -0
  392. package/dist/components/text-field/text-field-styles.js +209 -0
  393. package/dist/components/text-field/text-field-styles.js.map +1 -0
  394. package/dist/components/text-field/text-field-tokens.d.ts +7 -0
  395. package/dist/components/text-field/text-field-tokens.js +177 -0
  396. package/dist/components/text-field/text-field-tokens.js.map +1 -0
  397. package/dist/components/time-picker/TimePicker.d.ts +142 -0
  398. package/dist/components/time-picker/TimePicker.js +700 -0
  399. package/dist/components/time-picker/TimePicker.js.map +1 -0
  400. package/dist/components/time-picker/time-picker-styles.d.ts +175 -0
  401. package/dist/components/time-picker/time-picker-styles.js +112 -0
  402. package/dist/components/time-picker/time-picker-styles.js.map +1 -0
  403. package/dist/components/time-picker/time-picker-tokens.d.ts +7 -0
  404. package/dist/components/time-picker/time-picker-tokens.js +86 -0
  405. package/dist/components/time-picker/time-picker-tokens.js.map +1 -0
  406. package/dist/components/toolbar/Toolbar.d.ts +209 -0
  407. package/dist/components/toolbar/Toolbar.js +282 -0
  408. package/dist/components/toolbar/Toolbar.js.map +1 -0
  409. package/dist/components/toolbar/toolbar-styles.d.ts +403 -0
  410. package/dist/components/toolbar/toolbar-styles.js +253 -0
  411. package/dist/components/toolbar/toolbar-styles.js.map +1 -0
  412. package/dist/components/toolbar/toolbar-tokens.d.ts +27 -0
  413. package/dist/components/toolbar/toolbar-tokens.js +117 -0
  414. package/dist/components/toolbar/toolbar-tokens.js.map +1 -0
  415. package/dist/components/toolbar/use-toolbar-scroll-expansion.d.ts +56 -0
  416. package/dist/components/toolbar/use-toolbar-scroll-expansion.js +86 -0
  417. package/dist/components/toolbar/use-toolbar-scroll-expansion.js.map +1 -0
  418. package/dist/components/tooltip/Tooltip.d.ts +131 -0
  419. package/dist/components/tooltip/Tooltip.js +388 -0
  420. package/dist/components/tooltip/Tooltip.js.map +1 -0
  421. package/dist/components/tooltip/lazy-tooltip.js +35 -0
  422. package/dist/components/tooltip/lazy-tooltip.js.map +1 -0
  423. package/dist/components/tooltip/tooltip-placement.d.ts +16 -0
  424. package/dist/components/tooltip/tooltip-placement.js +14 -0
  425. package/dist/components/tooltip/tooltip-placement.js.map +1 -0
  426. package/dist/components/tooltip/tooltip-styles.d.ts +142 -0
  427. package/dist/components/tooltip/tooltip-styles.js +81 -0
  428. package/dist/components/tooltip/tooltip-styles.js.map +1 -0
  429. package/dist/components/tooltip/tooltip-tokens.d.ts +9 -0
  430. package/dist/components/tooltip/tooltip-tokens.js +72 -0
  431. package/dist/components/tooltip/tooltip-tokens.js.map +1 -0
  432. package/dist/components/tooltip/tooltip-trigger.d.ts +42 -0
  433. package/dist/components/tooltip/tooltip-trigger.js +115 -0
  434. package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
  435. package/dist/composites/button-group/ButtonGroup.d.ts +116 -0
  436. package/dist/composites/button-group/ButtonGroup.js +270 -0
  437. package/dist/composites/button-group/ButtonGroup.js.map +1 -0
  438. package/dist/composites/button-group/button-group-styles.d.ts +73 -0
  439. package/dist/composites/button-group/button-group-styles.js +87 -0
  440. package/dist/composites/button-group/button-group-styles.js.map +1 -0
  441. package/dist/composites/button-group/lazy-overflow-menu.js +43 -0
  442. package/dist/composites/button-group/lazy-overflow-menu.js.map +1 -0
  443. package/dist/composites/button-group/overflow-menu-list.js +26 -0
  444. package/dist/composites/button-group/overflow-menu-list.js.map +1 -0
  445. package/dist/composites/button-group/use-overflow.js +75 -0
  446. package/dist/composites/button-group/use-overflow.js.map +1 -0
  447. package/dist/composites/button-group/use-press-expansion.js +155 -0
  448. package/dist/composites/button-group/use-press-expansion.js.map +1 -0
  449. package/dist/index.d.ts +142 -0
  450. package/dist/index.js +136 -0
  451. package/dist/motion/get-m3-spring.d.ts +6 -0
  452. package/dist/motion/get-m3-spring.js +10 -0
  453. package/dist/motion/get-m3-spring.js.map +1 -0
  454. package/dist/motion/reduced-motion.js +19 -0
  455. package/dist/motion/reduced-motion.js.map +1 -0
  456. package/dist/motion/use-m3-spring.d.ts +13 -0
  457. package/dist/motion/use-m3-spring.js +22 -0
  458. package/dist/motion/use-m3-spring.js.map +1 -0
  459. package/dist/next/NextRouterProvider.d.ts +13 -0
  460. package/dist/next/NextRouterProvider.js +26 -0
  461. package/dist/next/NextRouterProvider.js.map +1 -0
  462. package/dist/next/get-theme-from-cookies.d.ts +32 -0
  463. package/dist/next/get-theme-from-cookies.js +27 -0
  464. package/dist/next/get-theme-from-cookies.js.map +1 -0
  465. package/dist/next/navigation-guard.d.ts +30 -0
  466. package/dist/next/navigation-guard.js +68 -0
  467. package/dist/next/navigation-guard.js.map +1 -0
  468. package/dist/next.d.ts +5 -0
  469. package/dist/next.js +5 -0
  470. package/dist/primitives/ButtonBase.d.ts +115 -0
  471. package/dist/primitives/ButtonBase.js +231 -0
  472. package/dist/primitives/ButtonBase.js.map +1 -0
  473. package/dist/primitives/DomDirectionLocale.d.ts +18 -0
  474. package/dist/primitives/DomDirectionLocale.js +28 -0
  475. package/dist/primitives/DomDirectionLocale.js.map +1 -0
  476. package/dist/primitives/Field.d.ts +50 -0
  477. package/dist/primitives/Field.js +74 -0
  478. package/dist/primitives/Field.js.map +1 -0
  479. package/dist/primitives/IconFaces.js +23 -0
  480. package/dist/primitives/IconFaces.js.map +1 -0
  481. package/dist/primitives/Overlay.d.ts +39 -0
  482. package/dist/primitives/Overlay.js +86 -0
  483. package/dist/primitives/Overlay.js.map +1 -0
  484. package/dist/primitives/SelectionControl.d.ts +55 -0
  485. package/dist/primitives/SelectionControl.js +58 -0
  486. package/dist/primitives/SelectionControl.js.map +1 -0
  487. package/dist/primitives/Surface.d.ts +123 -0
  488. package/dist/primitives/Surface.js +68 -0
  489. package/dist/primitives/Surface.js.map +1 -0
  490. package/dist/primitives/ToolbarContext.js +12 -0
  491. package/dist/primitives/ToolbarContext.js.map +1 -0
  492. package/dist/primitives/TouchTarget.d.ts +14 -0
  493. package/dist/primitives/TouchTarget.js +20 -0
  494. package/dist/primitives/TouchTarget.js.map +1 -0
  495. package/dist/primitives/TriggerContext.d.ts +34 -0
  496. package/dist/primitives/TriggerContext.js +24 -0
  497. package/dist/primitives/TriggerContext.js.map +1 -0
  498. package/dist/primitives/hidden-input-focus.js +27 -0
  499. package/dist/primitives/hidden-input-focus.js.map +1 -0
  500. package/dist/primitives/icon-faces-styles.d.ts +9 -0
  501. package/dist/primitives/icon-faces-styles.js +45 -0
  502. package/dist/primitives/icon-faces-styles.js.map +1 -0
  503. package/dist/primitives/locale-with-direction.d.ts +9 -0
  504. package/dist/primitives/locale-with-direction.js +17 -0
  505. package/dist/primitives/locale-with-direction.js.map +1 -0
  506. package/dist/primitives/morph-path.d.ts +25 -0
  507. package/dist/primitives/morph-path.js +38 -0
  508. package/dist/primitives/morph-path.js.map +1 -0
  509. package/dist/primitives/selection-control-styles.d.ts +54 -0
  510. package/dist/primitives/selection-control-styles.js +44 -0
  511. package/dist/primitives/selection-control-styles.js.map +1 -0
  512. package/dist/primitives/use-m3-interaction.d.ts +51 -0
  513. package/dist/primitives/use-m3-interaction.js +149 -0
  514. package/dist/primitives/use-m3-interaction.js.map +1 -0
  515. package/dist/primitives/use-m3-morph.d.ts +18 -0
  516. package/dist/primitives/use-m3-morph.js +36 -0
  517. package/dist/primitives/use-m3-morph.js.map +1 -0
  518. package/dist/primitives/use-presence.d.ts +19 -0
  519. package/dist/primitives/use-presence.js +37 -0
  520. package/dist/primitives/use-presence.js.map +1 -0
  521. package/dist/primitives.d.ts +36 -0
  522. package/dist/primitives.js +34 -0
  523. package/dist/shapes/corner-rounding.d.ts +13 -0
  524. package/dist/shapes/corner-rounding.js +18 -0
  525. package/dist/shapes/corner-rounding.js.map +1 -0
  526. package/dist/shapes/cubic.d.ts +52 -0
  527. package/dist/shapes/cubic.js +189 -0
  528. package/dist/shapes/cubic.js.map +1 -0
  529. package/dist/shapes/feature-mapping.js +80 -0
  530. package/dist/shapes/feature-mapping.js.map +1 -0
  531. package/dist/shapes/features.d.ts +23 -0
  532. package/dist/shapes/features.js +82 -0
  533. package/dist/shapes/features.js.map +1 -0
  534. package/dist/shapes/float-mapping.js +65 -0
  535. package/dist/shapes/float-mapping.js.map +1 -0
  536. package/dist/shapes/generated/material-shape-path-record.d.ts +11 -0
  537. package/dist/shapes/generated/material-shape-path-record.js +48 -0
  538. package/dist/shapes/generated/material-shape-path-record.js.map +1 -0
  539. package/dist/shapes/generated/material-shape-paths.d.ts +78 -0
  540. package/dist/shapes/generated/material-shape-paths.js +218 -0
  541. package/dist/shapes/generated/material-shape-paths.js.map +1 -0
  542. package/dist/shapes/mask.d.ts +14 -0
  543. package/dist/shapes/mask.js +24 -0
  544. package/dist/shapes/mask.js.map +1 -0
  545. package/dist/shapes/material-shapes.d.ts +11 -0
  546. package/dist/shapes/material-shapes.js +250 -0
  547. package/dist/shapes/material-shapes.js.map +1 -0
  548. package/dist/shapes/morph.d.ts +25 -0
  549. package/dist/shapes/morph.js +97 -0
  550. package/dist/shapes/morph.js.map +1 -0
  551. package/dist/shapes/path.d.ts +33 -0
  552. package/dist/shapes/path.js +47 -0
  553. package/dist/shapes/path.js.map +1 -0
  554. package/dist/shapes/point.d.ts +28 -0
  555. package/dist/shapes/point.js +103 -0
  556. package/dist/shapes/point.js.map +1 -0
  557. package/dist/shapes/polygon-measure.js +140 -0
  558. package/dist/shapes/polygon-measure.js.map +1 -0
  559. package/dist/shapes/rounded-polygon.d.ts +44 -0
  560. package/dist/shapes/rounded-polygon.js +278 -0
  561. package/dist/shapes/rounded-polygon.js.map +1 -0
  562. package/dist/shapes/shape-path.d.ts +15 -0
  563. package/dist/shapes/shapes.d.ts +53 -0
  564. package/dist/shapes/shapes.js +171 -0
  565. package/dist/shapes/shapes.js.map +1 -0
  566. package/dist/styles/generated/components.css +710 -0
  567. package/dist/styles/generated/theme.css +247 -0
  568. package/dist/styles/generated/themes.css +3361 -0
  569. package/dist/styles/generated/tokens.css +284 -0
  570. package/dist/styles/styles.css +15 -0
  571. package/dist/styles/utilities.css +283 -0
  572. package/dist/styles.compiled.css +2 -0
  573. package/dist/theme/ThemeProvider.d.ts +72 -0
  574. package/dist/theme/ThemeProvider.js +144 -0
  575. package/dist/theme/ThemeProvider.js.map +1 -0
  576. package/dist/theme/ThemeScope.d.ts +32 -0
  577. package/dist/theme/ThemeScope.js +67 -0
  578. package/dist/theme/ThemeScope.js.map +1 -0
  579. package/dist/theme/ThemeScript.d.ts +26 -0
  580. package/dist/theme/ThemeScript.js +44 -0
  581. package/dist/theme/ThemeScript.js.map +1 -0
  582. package/dist/theme/context.d.ts +32 -0
  583. package/dist/theme/context.js +47 -0
  584. package/dist/theme/context.js.map +1 -0
  585. package/dist/theme/create-theme.d.ts +60 -0
  586. package/dist/theme/create-theme.js +47 -0
  587. package/dist/theme/create-theme.js.map +1 -0
  588. package/dist/theme/css.js +54 -0
  589. package/dist/theme/css.js.map +1 -0
  590. package/dist/theme/parse-palettes.js +40 -0
  591. package/dist/theme/parse-palettes.js.map +1 -0
  592. package/dist/theme/scheme.d.ts +6 -0
  593. package/dist/theme/scheme.js +118 -0
  594. package/dist/theme/scheme.js.map +1 -0
  595. package/dist/theme/state.d.ts +38 -0
  596. package/dist/theme/state.js +93 -0
  597. package/dist/theme/state.js.map +1 -0
  598. package/dist/theme/storage.js +21 -0
  599. package/dist/theme/storage.js.map +1 -0
  600. package/dist/tokens/breakpoints.d.ts +15 -0
  601. package/dist/tokens/breakpoints.js +16 -0
  602. package/dist/tokens/breakpoints.js.map +1 -0
  603. package/dist/tokens/color.d.ts +104 -0
  604. package/dist/tokens/color.js +147 -0
  605. package/dist/tokens/color.js.map +1 -0
  606. package/dist/tokens/component.d.ts +110 -0
  607. package/dist/tokens/component.js +67 -0
  608. package/dist/tokens/component.js.map +1 -0
  609. package/dist/tokens/density.d.ts +20 -0
  610. package/dist/tokens/density.js +27 -0
  611. package/dist/tokens/density.js.map +1 -0
  612. package/dist/tokens/elevation.d.ts +44 -0
  613. package/dist/tokens/elevation.js +45 -0
  614. package/dist/tokens/elevation.js.map +1 -0
  615. package/dist/tokens/motion.d.ts +79 -0
  616. package/dist/tokens/motion.js +126 -0
  617. package/dist/tokens/motion.js.map +1 -0
  618. package/dist/tokens/shape.d.ts +22 -0
  619. package/dist/tokens/shape.js +22 -0
  620. package/dist/tokens/shape.js.map +1 -0
  621. package/dist/tokens/spring-velocity.d.ts +19 -0
  622. package/dist/tokens/spring-velocity.js +44 -0
  623. package/dist/tokens/spring-velocity.js.map +1 -0
  624. package/dist/tokens/state.d.ts +18 -0
  625. package/dist/tokens/state.js +19 -0
  626. package/dist/tokens/state.js.map +1 -0
  627. package/dist/tokens/typography.d.ts +64 -0
  628. package/dist/tokens/typography.js +60 -0
  629. package/dist/tokens/typography.js.map +1 -0
  630. package/dist/tokens/z-index.d.ts +17 -0
  631. package/dist/tokens/z-index.js +18 -0
  632. package/dist/tokens/z-index.js.map +1 -0
  633. package/dist/utils/announce.js +51 -0
  634. package/dist/utils/announce.js.map +1 -0
  635. package/dist/utils/assert-collection-children.js +26 -0
  636. package/dist/utils/assert-collection-children.js.map +1 -0
  637. package/dist/utils/closed-by.d.ts +9 -0
  638. package/dist/utils/closed-by.js +12 -0
  639. package/dist/utils/closed-by.js.map +1 -0
  640. package/dist/utils/cn.d.ts +31 -0
  641. package/dist/utils/cn.js +37 -0
  642. package/dist/utils/cn.js.map +1 -0
  643. package/dist/utils/composite-keys.js +32 -0
  644. package/dist/utils/composite-keys.js.map +1 -0
  645. package/dist/utils/focus-visible.js +14 -0
  646. package/dist/utils/focus-visible.js.map +1 -0
  647. package/dist/utils/focus.js +51 -0
  648. package/dist/utils/focus.js.map +1 -0
  649. package/dist/utils/focusable-disabled.js +12 -0
  650. package/dist/utils/focusable-disabled.js.map +1 -0
  651. package/dist/utils/keep-pressed-in-place.d.ts +60 -0
  652. package/dist/utils/keep-pressed-in-place.js +127 -0
  653. package/dist/utils/keep-pressed-in-place.js.map +1 -0
  654. package/dist/utils/load-on-demand.js +111 -0
  655. package/dist/utils/load-on-demand.js.map +1 -0
  656. package/dist/utils/merge-data-tokens.d.ts +9 -0
  657. package/dist/utils/merge-data-tokens.js +15 -0
  658. package/dist/utils/merge-data-tokens.js.map +1 -0
  659. package/dist/utils/natural-size.js +53 -0
  660. package/dist/utils/natural-size.js.map +1 -0
  661. package/dist/utils/nearest-reveal.js +28 -0
  662. package/dist/utils/nearest-reveal.js.map +1 -0
  663. package/dist/utils/placement.js +14 -0
  664. package/dist/utils/placement.js.map +1 -0
  665. package/dist/utils/radio-group-keys.js +74 -0
  666. package/dist/utils/radio-group-keys.js.map +1 -0
  667. package/dist/utils/rendered-description.js +17 -0
  668. package/dist/utils/rendered-description.js.map +1 -0
  669. package/dist/utils/root-props.d.ts +103 -0
  670. package/dist/utils/root-props.js +51 -0
  671. package/dist/utils/root-props.js.map +1 -0
  672. package/dist/utils/search.d.ts +11 -0
  673. package/dist/utils/search.js +18 -0
  674. package/dist/utils/search.js.map +1 -0
  675. package/dist/utils/shortcut.js +20 -0
  676. package/dist/utils/shortcut.js.map +1 -0
  677. package/dist/utils/split-data-attributes.d.ts +12 -0
  678. package/dist/utils/split-data-attributes.js +20 -0
  679. package/dist/utils/split-data-attributes.js.map +1 -0
  680. package/dist/utils/toolbar-keys.js +28 -0
  681. package/dist/utils/toolbar-keys.js.map +1 -0
  682. package/dist/utils/tv.d.ts +7 -0
  683. package/dist/utils/tv.js +9 -0
  684. package/dist/utils/tv.js.map +1 -0
  685. package/dist/utils/typeahead.js +64 -0
  686. package/dist/utils/typeahead.js.map +1 -0
  687. package/dist/utils/warn-once.js +30 -0
  688. package/dist/utils/warn-once.js.map +1 -0
  689. package/dist/vendor/material-color-utilities/blend/blend.js +88 -0
  690. package/dist/vendor/material-color-utilities/blend/blend.js.map +1 -0
  691. package/dist/vendor/material-color-utilities/contrast/contrast.js +131 -0
  692. package/dist/vendor/material-color-utilities/contrast/contrast.js.map +1 -0
  693. package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js +58 -0
  694. package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js.map +1 -0
  695. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js +620 -0
  696. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js.map +1 -0
  697. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js +786 -0
  698. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js.map +1 -0
  699. package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js +59 -0
  700. package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js.map +1 -0
  701. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js +420 -0
  702. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js.map +1 -0
  703. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js +701 -0
  704. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js.map +1 -0
  705. package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js +374 -0
  706. package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js.map +1 -0
  707. package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js +65 -0
  708. package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js.map +1 -0
  709. package/dist/vendor/material-color-utilities/dynamiccolor/variant.js +38 -0
  710. package/dist/vendor/material-color-utilities/dynamiccolor/variant.js.map +1 -0
  711. package/dist/vendor/material-color-utilities/hct/cam16.js +309 -0
  712. package/dist/vendor/material-color-utilities/hct/cam16.js.map +1 -0
  713. package/dist/vendor/material-color-utilities/hct/hct.js +148 -0
  714. package/dist/vendor/material-color-utilities/hct/hct.js.map +1 -0
  715. package/dist/vendor/material-color-utilities/hct/hct_solver.js +660 -0
  716. package/dist/vendor/material-color-utilities/hct/hct_solver.js.map +1 -0
  717. package/dist/vendor/material-color-utilities/hct/viewing_conditions.js +117 -0
  718. package/dist/vendor/material-color-utilities/hct/viewing_conditions.js.map +1 -0
  719. package/dist/vendor/material-color-utilities/index.js +51 -0
  720. package/dist/vendor/material-color-utilities/index.js.map +1 -0
  721. package/dist/vendor/material-color-utilities/palettes/core_palette.js +22 -0
  722. package/dist/vendor/material-color-utilities/palettes/core_palette.js.map +1 -0
  723. package/dist/vendor/material-color-utilities/palettes/tonal_palette.js +134 -0
  724. package/dist/vendor/material-color-utilities/palettes/tonal_palette.js.map +1 -0
  725. package/dist/vendor/material-color-utilities/scheme/scheme.js +21 -0
  726. package/dist/vendor/material-color-utilities/scheme/scheme.js.map +1 -0
  727. package/dist/vendor/material-color-utilities/scheme/scheme_android.js +21 -0
  728. package/dist/vendor/material-color-utilities/scheme/scheme_android.js.map +1 -0
  729. package/dist/vendor/material-color-utilities/scheme/scheme_content.js +22 -0
  730. package/dist/vendor/material-color-utilities/scheme/scheme_content.js.map +1 -0
  731. package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js +38 -0
  732. package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js.map +1 -0
  733. package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js +22 -0
  734. package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js.map +1 -0
  735. package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js +22 -0
  736. package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js.map +1 -0
  737. package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js +22 -0
  738. package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js.map +1 -0
  739. package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js +36 -0
  740. package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js.map +1 -0
  741. package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js +22 -0
  742. package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js.map +1 -0
  743. package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js +41 -0
  744. package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js.map +1 -0
  745. package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js +39 -0
  746. package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js.map +1 -0
  747. package/dist/vendor/material-color-utilities/score/score.js +115 -0
  748. package/dist/vendor/material-color-utilities/score/score.js.map +1 -0
  749. package/dist/vendor/material-color-utilities/temperature/temperature_cache.js +227 -0
  750. package/dist/vendor/material-color-utilities/temperature/temperature_cache.js.map +1 -0
  751. package/dist/vendor/material-color-utilities/utils/color_utils.js +246 -0
  752. package/dist/vendor/material-color-utilities/utils/color_utils.js.map +1 -0
  753. package/dist/vendor/material-color-utilities/utils/image_utils.js +21 -0
  754. package/dist/vendor/material-color-utilities/utils/image_utils.js.map +1 -0
  755. package/dist/vendor/material-color-utilities/utils/math_utils.js +119 -0
  756. package/dist/vendor/material-color-utilities/utils/math_utils.js.map +1 -0
  757. package/dist/vendor/material-color-utilities/utils/string_utils.js +74 -0
  758. package/dist/vendor/material-color-utilities/utils/string_utils.js.map +1 -0
  759. package/dist/vendor/material-color-utilities/utils/theme_utils.js +24 -0
  760. package/dist/vendor/material-color-utilities/utils/theme_utils.js.map +1 -0
  761. package/package.json +114 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.js","names":[],"sources":["../../../src/components/list/List.tsx"],"sourcesContent":["'use client';\n\nimport {\n Children,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type InputHTMLAttributes,\n type JSX,\n type KeyboardEvent,\n type LabelHTMLAttributes,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n type RefObject,\n} from 'react';\nimport {\n mergeProps,\n mergeRefs,\n useButton,\n useCheckbox,\n useFocusRing,\n useGridList,\n useGridListItem,\n useGridListSection,\n useHover,\n useLink,\n useListBox,\n useListBoxSection,\n useObjectRef,\n useOption,\n useRadio,\n useRadioGroup,\n useTree,\n useTreeItem,\n VisuallyHidden,\n type AriaButtonProps,\n type AriaCheckboxProps,\n type AriaGridListProps,\n type AriaListBoxOptions,\n type AriaRadioGroupProps,\n type AriaTreeOptions,\n type Key,\n} from 'react-aria';\nimport {\n useListState,\n useRadioGroupState,\n useToggleState,\n useTreeState,\n type ListState,\n type Node,\n type RadioGroupState,\n type TreeState,\n} from 'react-stately';\nimport { DomDirectionLocale } from '../../primitives/DomDirectionLocale';\nimport { preventHiddenInputScroll } from '../../primitives/hidden-input-focus';\nimport { TouchTarget } from '../../primitives/TouchTarget';\nimport { useM3Interaction } from '../../primitives/use-m3-interaction';\nimport { CheckboxBox } from '../checkbox/checkbox-box';\nimport { RadioRing } from '../radio/radio-ring';\nimport { CheckIcon, CloseIcon, SwitchThumb, thumbGeometry } from '../switch/switch-thumb';\nimport { switchStyles } from '../switch/switch-styles';\nimport { FOCUSABLE_DISABLED_OPTIONS } from '../../utils/focusable-disabled';\nimport { assertCollectionChildren } from '../../utils/assert-collection-children';\nimport { useKeepPressedInPlace } from '../../utils/keep-pressed-in-place';\nimport { useNearestReveal } from '../../utils/nearest-reveal';\nimport { cn } from '../../utils/cn';\nimport { densityAttribute, type Density } from '../../tokens/density';\nimport { mergeDataTokens } from '../../utils/merge-data-tokens';\nimport { splitRootProps, type RootDOMProps } from '../../utils/root-props';\nimport { warnOnce } from '../../utils/warn-once';\nimport { listStyles, type ListDividers, type ListVariant } from './list-styles';\nimport { ListMediaContext } from './ListMedia';\n\n/** Props of a {@link ListItem}; the React `key` identifies it for `onAction` and selection. */\nexport interface ListItemProps {\n /** The headline. */\n children: ReactNode;\n /** A short line above the headline. */\n overline?: ReactNode;\n /** One or two lines below the headline. */\n supportingText?: ReactNode;\n /** Leading content: an icon, an avatar, a `ListItemImage` or `ListItemVideo`, or a control. */\n leading?: ReactNode;\n /** Trailing content: an icon, short text or a control (in an interactive list it gets focus with ← / →). */\n trailing?: ReactNode;\n /**\n * Makes the item a link. In a list without `onAction` or `selectionMode` the item is a\n * real `<a>`: its own Tab stop, with the browser's link menu and modified clicks, routed\n * through a `RouterProvider` (such as `NextRouterProvider`) on a plain click.\n */\n href?: string;\n /** Marks the link item for the page being shown: `aria-current=\"page\"` and the selected colours. */\n current?: boolean;\n /** A link item's target; `_blank` adds `rel=\"noopener noreferrer\"` unless `rel` is given. */\n target?: string;\n /** A link item's `rel`, e.g. `\"nofollow\"`. */\n rel?: string;\n /** Downloads the link item's file instead of opening it (optionally with a file name). */\n download?: boolean | string;\n /** Plain-text version of the headline, for type-ahead and announcements. */\n textValue?: string;\n /** Accessible name when the headline isn't plain text. */\n 'aria-label'?: string;\n /** Classes for the item, merged after `classNames.item`; consumer classes win. */\n className?: string;\n /**\n * Makes the whole item a switch or a checkbox (Compose's toggleable `ListItem`): pressing\n * anywhere on it toggles it, and it is one control for assistive tech. Not in lists with\n * `onAction`, links or `selectionMode`. Left out, the item is a plain row.\n */\n control?: 'switch' | 'checkbox';\n /** Whether a switch or checkbox item is on (controlled). */\n checked?: boolean;\n /** Whether a switch or checkbox item starts on (uncontrolled). */\n defaultChecked?: boolean;\n /** Called when a switch or checkbox item is toggled. */\n onCheckedChange?: (checked: boolean) => void;\n /** Where the switch, checkbox or radio button sits, at the start or end of the row. @default \"start\", or \"end\" for a switch */\n controlPlacement?: ControlPlacement;\n /** A radio list item's value, or the value a switch or checkbox item posts with its form. */\n value?: string;\n /** The form field name of a switch or checkbox item. */\n name?: string;\n /** Disables the item. @default false */\n disabled?: boolean;\n /**\n * Aligns the content; by default it is centred, and top-aligned in three-line items.\n * @default \"center\", or \"top\" in three-line items\n */\n verticalAlignment?: 'center' | 'top';\n /** Shows ✓ and ✕ in a switch item's thumb. @default false */\n switchIcons?: boolean;\n /** The most lines the headline shows, then \"…\". Left out, the list's `headlineLines` applies. */\n headlineLines?: LineLimit;\n /**\n * The most lines the supporting text shows, then \"…\". Left out, the list's\n * `supportingTextLines` applies.\n */\n supportingTextLines?: LineLimit;\n /**\n * Nested `ListItem`s (each with its own `key`): the item expands and collapses to show\n * them, in a folder-like way (M3's expand interaction). It ends with a chevron, and → / ←\n * expand and collapse it.\n */\n childItems?: ReactElement<ListItemProps> | ReactElement<ListItemProps>[];\n}\n\n/** How many lines a text shows before it ends with \"…\"; the full text stays in the DOM. */\nexport type LineLimit = 1 | 2 | 3;\n\ntype ControlPlacement = 'start' | 'end';\n\n/** A collection node as React Stately's collection builder reads it. */\ninterface ListItemNode {\n type: 'item';\n props?: ListItemProps;\n rendered?: ReactNode;\n textValue?: string;\n 'aria-label'?: string | undefined;\n hasChildNodes?: boolean;\n element?: ReactElement;\n childNodes?: () => Iterable<ListItemNode>;\n}\n\n/**\n * A `ListItem` renders itself only in a plain or radio list, which hand it its place through\n * context. Interactive lists read its props through `getCollectionNode` and never render it.\n */\nfunction ListItemElement(props: ListItemProps): ReactNode {\n const entry = useContext(ListEntryContext);\n const radio = useContext(RadioListContext);\n const plain = useContext(StaticListContext);\n if (!entry) return null;\n if (radio) return <RadioListItem item={props} radio={radio} position={entry.position} />;\n if (plain) return <StaticListItem item={props} list={plain} entry={entry} />;\n return null;\n}\n\n/**\n * Describes the item to React Stately's collection builder, as its `Item` does: the\n * headline is the item's content, and `childItems` are its nested items.\n */\nListItemElement.getCollectionNode = function* getCollectionNode(\n props: ListItemProps,\n): Generator<ListItemNode> {\n const rendered = props.children;\n const textValue =\n props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';\n // Once per page: the collection is rebuilt on every render of the list.\n if (!textValue) {\n warnOnce(\n 'list-item-text-value',\n '[@windmorph/react] A ListItem whose headline is not plain text needs a textValue for type-ahead.',\n );\n }\n const children = listItems(props.childItems);\n yield {\n type: 'item',\n props,\n rendered,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: children.length > 0,\n *childNodes() {\n for (const element of children) yield { type: 'item', element };\n },\n };\n};\n\n/**\n * An item of a {@link List}. Like React Stately's collection `Item`, the list reads its\n * props; identify it with a React `key`.\n */\nexport const ListItem = ListItemElement as unknown as (props: ListItemProps) => JSX.Element;\n\n/** Props of a {@link ListSection}: a subheader, or a name when it shows none. */\nexport type ListSectionProps = {\n /** `ListItem` elements, each with its own `key`. */\n children: ReactElement<ListItemProps> | ReactElement<ListItemProps>[];\n /** Classes for the section, merged after `classNames.section`; consumer classes win. */\n className?: string;\n} & (\n | {\n /** The subheader shown above the section's items, which names the group. */\n title: ReactNode;\n /** Accessible name for the group, instead of the subheader's text. */\n 'aria-label'?: string;\n }\n | {\n title?: undefined;\n /** Accessible name for the group when it shows no subheader. */\n 'aria-label': string;\n }\n);\n\n/** A collection node for a section, as React Stately's `Section` describes it. */\ninterface ListSectionNode {\n type: 'section';\n props: ListSectionProps;\n rendered: ReactNode;\n 'aria-label'?: string | undefined;\n hasChildNodes: true;\n childNodes: () => Iterable<ListItemNode>;\n}\n\n/**\n * A `ListSection` renders itself only in a plain list: its subheader, and its items, each\n * told through context that it sits in this section and where. Interactive lists read it\n * through `getCollectionNode`. It never needs its type compared, so a section created in a\n * Server Component (whose type reaches the client as a lazy client reference) renders the\n * same as one created in the browser.\n */\nfunction ListSectionElement(props: ListSectionProps): ReactNode {\n const entry = useContext(ListEntryContext);\n const plain = useContext(StaticListContext);\n if (useContext(RadioListContext)) {\n throw new Error(\n \"[@windmorph/react] List: a radio list can't hold ListSections. Use one radio list \" +\n 'per group, or a list with selectionMode=\"single\".',\n );\n }\n const register = plain?.registerSection;\n const index = entry?.index;\n // Tells the list this entry is a section, so the loose items around it form their own\n // groups. A layout effect, so the corrected corners are drawn before the first paint.\n useLayoutEffect(() => {\n if (register == null || index == null || entry?.inSection) return undefined;\n return register(index);\n }, [register, index, entry?.inSection]);\n if (!plain || !entry) return null;\n const items = listItems(props.children);\n return (\n <StaticSection section={props} variant={plain.variant} classNames={plain.classNames}>\n {items.map((item, itemIndex) => (\n <ListEntryContext\n key={item.key ?? itemIndex}\n value={{\n index: itemIndex,\n position: position(itemIndex, items.length),\n inSection: true,\n disabled: plain.isKeyDisabled(item.key),\n }}\n >\n {item}\n </ListEntryContext>\n ))}\n </StaticSection>\n );\n}\n\n/** Describes the section to React Stately's collection builder, as its `Section` does. */\nListSectionElement.getCollectionNode = function* getCollectionNode(\n props: ListSectionProps,\n): Generator<ListSectionNode> {\n const children = listItems(props.children);\n yield {\n type: 'section',\n props,\n rendered: props.title,\n 'aria-label': props['aria-label'],\n hasChildNodes: true,\n *childNodes() {\n for (const element of children) yield { type: 'item', element };\n },\n };\n};\n\n/**\n * A labelled group of items in a {@link List}, under a subheader (`title`). Identify it with\n * a React `key`, like its items. Arrow keys move across sections as through one list.\n * Sections go in static, action (grid) and selection (list box) lists, not in radio lists\n * or lists with `childItems`.\n *\n * @example\n * <List aria-label=\"Settings\" onAction={open}>\n * <ListSection key=\"network\" title=\"Network\">\n * <ListItem key=\"wifi\">Wi‑Fi</ListItem>\n * </ListSection>\n * </List>\n */\nexport const ListSection = ListSectionElement as unknown as (\n props: ListSectionProps,\n) => JSX.Element;\n\nexport interface ListClassNames {\n /** The root list element, merged with `className`. */\n root?: string;\n /** Each `ListSection`'s wrapper (its subheader and items). */\n section?: string;\n /** Each `ListSection`'s subheader. */\n subheader?: string;\n /** Each item. */\n item?: string;\n /** Each item's leading content (icon, avatar, media or control). */\n leading?: string;\n /** Each item's text column (overline, headline and supporting text). */\n text?: string;\n /** Each item's overline. */\n overline?: string;\n /** Each item's headline. */\n headline?: string;\n /** Each item's supporting text. */\n supportingText?: string;\n /** Each item's trailing content. */\n trailing?: string;\n /** The drawn switch, checkbox or radio button of an item that is one. */\n control?: string;\n /** The check that marks a selected item in a list with `selectionMode`. */\n selectionIndicator?: string;\n /** The chevron button that expands an item with nested items. */\n expandButton?: string;\n /** Every `ListItemImage` and `ListItemVideo` in the list (to round them, say). */\n media?: string;\n}\n\ntype Naming =\n | {\n /** Accessible name for the list (a list has no visible label of its own). */\n 'aria-label': string;\n }\n | {\n /** The id of the element that names the list, such as a heading above it. */\n 'aria-labelledby': string;\n };\n\ntype ListChild = ReactElement<ListItemProps> | ReactElement<ListSectionProps>;\n\ninterface ListOwnProps extends RootDOMProps {\n /** The root element's id. */\n id?: string;\n /** Flush items, or separate items 2px apart with rounded group corners. @default \"standard\" */\n variant?: ListVariant;\n /** `ListItem` elements, or `ListSection`s of them. */\n children: ListChild | ListChild[];\n /** Called when an item is pressed or Enter is pressed on it. Makes the list interactive. */\n onAction?: (key: Key) => void;\n /** Whether items can be selected: none, one or several. @default \"none\" */\n selectionMode?: 'none' | 'single' | 'multiple';\n /** The keys of the selected items (controlled). */\n selectedKeys?: 'all' | Iterable<Key>;\n /** The keys of the items selected at first (uncontrolled). */\n defaultSelectedKeys?: 'all' | Iterable<Key>;\n /** Called with the selected keys when the selection changes. */\n onSelectionChange?: (keys: Set<Key> | 'all') => void;\n /**\n * The last selected item can be deselected, leaving none. `false` keeps at least one item\n * selected. @default true\n */\n deselectable?: boolean;\n /** The keys of items that can't be pressed or selected. */\n disabledKeys?: Iterable<Key>;\n /**\n * The selected item of a radio list (Compose's single-selection `ListItem`): with `value`,\n * `defaultValue` or `onChange`, the list is a radio group whose items are radio\n * buttons, each with a `value`.\n */\n value?: string | null;\n /** The radio list's initially selected item value (uncontrolled). */\n defaultValue?: string;\n /** Called with the chosen item's value when a radio list's selection changes. */\n onChange?: (value: string) => void;\n /** The form field name of a radio list. */\n name?: string;\n /** A radio list needs a choice before its form submits. @default false */\n required?: boolean;\n /** Disables every item. @default false */\n disabled?: boolean;\n /** Where a radio list's radio buttons sit, at the start or end of each row. @default \"start\" */\n controlPlacement?: ControlPlacement;\n /**\n * M3's dividers between items: `full` width, or `inset` 16dp from each side. Standard\n * lists only (segmented items are already apart). Left out, there are no dividers.\n */\n dividers?: ListDividers;\n /**\n * Selected items show a check at their end besides their colour, so selection never\n * relies on colour alone (M3 lists accessibility). @default true\n */\n selectionIndicator?: boolean;\n /**\n * Web density, `0` to `-3` (M3: a list \"can adjust margins, spacing, or density\"): each step\n * takes 4px off every item (one line 56px at 0, 44px at -3; two lines 72 → 60px; three\n * lines 88 → 76px; items grown by an image or avatar too) and off section subheaders, and\n * the controls inside items follow. Left out, the list takes the density of the nearest\n * `ThemeProvider` or `ThemeScope`. Prefer setting it there, from a setting, since M3 makes\n * density the reader's choice.\n * @default 0\n */\n density?: Density;\n /** The expanded items of a list with `childItems` (controlled). */\n expandedKeys?: Iterable<Key>;\n /** The items expanded at first (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>;\n /** Called with the expanded keys when an item expands or collapses. */\n onExpandedChange?: (keys: Set<Key>) => void;\n /** The most lines each item's headline shows, then \"…\". M3: one or two. Left out, no limit. */\n headlineLines?: LineLimit;\n /**\n * The most lines each item's supporting text shows, then \"…\". M3: one in a two-line item,\n * two in a three-line item. Left out, no limit.\n */\n supportingTextLines?: LineLimit;\n /** Ref to the root element: a `<ul>`, or a `<div>` grid or listbox when interactive. */\n ref?: Ref<HTMLElement>;\n /** Classes for the root element, merged with `classNames.root`; consumer classes win. */\n className?: string;\n /** Inline styles for the root element. */\n style?: CSSProperties;\n /** Classes for each part, by slot. */\n classNames?: ListClassNames;\n /** `data-*` attributes go to the root. */\n [data: `data-${string}`]: string | number | boolean | undefined;\n}\n\nexport type ListProps = ListOwnProps & Naming;\n\n/** What every item of a list reads from it. */\ninterface ListOptions {\n headlineLines?: LineLimit | undefined;\n supportingTextLines?: LineLimit | undefined;\n dividers?: ListDividers | undefined;\n selectionIndicator?: boolean | undefined;\n}\n\nconst ListOptionsContext = createContext<ListOptions>({});\n\n/**\n * M3 Expressive list: items with a headline, optional overline and supporting text, and\n * leading and trailing content, flush (standard) or segmented into rounded groups.\n *\n * With `selectionMode` it is a list box of options (`listbox` / `option`), and selected items\n * show a check. With `onAction` or links it is an interactive grid list, where ← / → reach\n * trailing controls. Items with `childItems` expand and collapse (a tree grid). Interactive\n * items get state layers and morph their corners on hover, focus, press and selection, and\n * ↑ / ↓ move between them, wrapping at the ends. Otherwise it is a plain `ul`.\n *\n * Items can lead with M3's image or video thumbnail (`ListItemImage`, `ListItemVideo`),\n * limit their lines (`headlineLines`, `supportingTextLines`), and standard lists can draw\n * `dividers`.\n *\n * @example\n * <List variant=\"segmented\" aria-label=\"Settings\" onAction={open}>\n * <ListItem key=\"wifi\" leading={<WifiIcon />} supportingText=\"Connected\">Wi‑Fi</ListItem>\n * <ListItem key=\"bluetooth\" leading={<BluetoothIcon />}>Bluetooth</ListItem>\n * </List>\n */\nexport function List({ density, ...props }: ListProps) {\n const { headlineLines, supportingTextLines, dividers, selectionIndicator, classNames } = props;\n if (dividers != null && props.variant === 'segmented') {\n throw new Error(\n '[@windmorph/react] List: dividers are for standard lists; segmented items are already apart.',\n );\n }\n return (\n <ListOptionsContext\n value={{ headlineLines, supportingTextLines, dividers, selectionIndicator }}\n >\n <ListMediaContext value={classNames?.media}>\n <ListBody {...props} {...densityAttribute(density)} />\n </ListMediaContext>\n </ListOptionsContext>\n );\n}\n\nconst RADIO_ITEM_ERROR =\n '[@windmorph/react] List: every item of a radio list (one with value, defaultValue or ' +\n 'onChange) needs a value, and none can have a control or an href.';\n\nconst CONTROL_ERROR =\n \"[@windmorph/react] List: switch and checkbox items (control) can't be in a list with \" +\n 'onAction, links, selectionMode or childItems. Put them in their own list, or put a ' +\n \"Switch in an item's trailing content.\";\n\nconst EXPANDABLE_SECTIONS_ERROR =\n \"[@windmorph/react] List: a list with childItems can't hold ListSections; nest the \" +\n 'groups as expandable items instead.';\n\n/**\n * Picks the list's kind from its own props and its top-level entries' props; it never looks\n * at an entry's element type. A plain or radio list renders its entries, which place\n * themselves through context (`ListEntryContext`); an interactive list hands them to React\n * Stately's collection builder, which reads each through its `getCollectionNode`.\n */\nfunction ListBody(props: ListProps) {\n const entries = listItems(props.children);\n if (\n props.value !== undefined ||\n props.defaultValue !== undefined ||\n props.onChange !== undefined\n ) {\n return <RadioList {...props} entries={entries} />;\n }\n const selectable = props.selectionMode != null && props.selectionMode !== 'none';\n // A section has no `childItems`, so only a top-level item can make the list expandable;\n // an item inside a section that has them refuses to render (EXPANDABLE_SECTIONS_ERROR).\n const expandable = entries.some((entry) => listItems(entry.props.childItems).length > 0);\n // Links alone don't make a grid list: they render as real anchors in a plain list.\n const interactive = props.onAction != null || selectable || expandable;\n if (!interactive) return <StaticList {...props} entries={entries} />;\n return <InteractiveList {...props} expandable={expandable} />;\n}\n\nfunction itemLines(item: ListItemProps): 1 | 2 | 3 {\n const extra = Number(item.overline != null) + Number(item.supportingText != null);\n return extra === 2 ? 3 : extra === 1 ? 2 : 1;\n}\n\nfunction itemStylesOptions(\n item: ListItemProps,\n variant: ListVariant | undefined,\n interactive: boolean,\n options: ListOptions,\n) {\n const headlineLines = item.headlineLines ?? options.headlineLines;\n const supportingTextLines = item.supportingTextLines ?? options.supportingTextLines;\n return {\n variant,\n interactive,\n lines: itemLines(item),\n ...(item.verticalAlignment && { align: item.verticalAlignment }),\n ...(options.dividers && { dividers: options.dividers }),\n ...(headlineLines && { headlineLines }),\n ...(supportingTextLines && { supportingTextLines }),\n };\n}\n\nfunction itemStyles(\n item: ListItemProps,\n variant: ListVariant | undefined,\n interactive: boolean,\n options: ListOptions,\n) {\n return listStyles(itemStylesOptions(item, variant, interactive, options));\n}\n\n/**\n * The component tokens' hooks (`list-tokens.ts`), on a list's root and on each item, so an\n * item's own state (`data-selected`) picks its colours. On the root, any set the app passed\n * (`props`) follows the list's own.\n */\nfunction tokenAttributes(variant: ListVariant | undefined, props?: object) {\n return {\n 'data-tokens': mergeDataTokens('md-comp-list', props),\n 'data-variant': variant ?? 'standard',\n } as const;\n}\n\n/** An item's token hooks and its `data-slot`. */\nfunction itemAttributes(variant: ListVariant | undefined) {\n return { ...tokenAttributes(variant), 'data-slot': 'item' } as const;\n}\n\nfunction position(index: number, count: number) {\n if (count === 1) return 'only';\n if (index === 0) return 'first';\n return index === count - 1 ? 'last' : 'middle';\n}\n\ninterface ItemIds {\n headline?: string;\n overline?: string;\n supporting?: string;\n}\n\nfunction ItemContent({\n item,\n styles,\n classNames,\n ids,\n control,\n controlPlacement,\n headline,\n sideClassName,\n end,\n textHidden,\n}: {\n item: ListItemProps;\n styles: ReturnType<typeof listStyles>;\n classNames?: ListClassNames;\n ids?: ItemIds;\n control?: ReactNode;\n controlPlacement?: ControlPlacement;\n /** What the list adds after the trailing content: the selection check, the chevron. */\n end?: ReactNode;\n /** Wraps the headline (a link item's anchor). */\n headline?: (children: ReactNode) => ReactNode;\n /** Classes for the leading and trailing content (a link item raises its controls). */\n sideClassName?: string;\n /**\n * Hides the text from assistive tech: a control item's input is already named and\n * described by it, so it would be read twice.\n */\n textHidden?: boolean;\n}) {\n const leading = controlPlacement === 'start' ? control : null;\n const trailing = controlPlacement === 'end' ? control : end;\n return (\n <>\n {(item.leading != null || leading != null) && (\n <span\n ref={(cell) => hideDecorativeIcons(cell)}\n data-slot=\"leading\"\n className={styles.leading({ class: cn(sideClassName, classNames?.leading) })}\n >\n {leading}\n {item.leading}\n </span>\n )}\n <span\n aria-hidden={textHidden || undefined}\n className={styles.text({ class: classNames?.text })}\n >\n {item.overline != null && (\n <span\n id={ids?.overline}\n data-slot=\"overline\"\n className={styles.overline({ class: classNames?.overline })}\n >\n {item.overline}\n </span>\n )}\n <span\n id={ids?.headline}\n data-slot=\"headline\"\n className={styles.headline({ class: classNames?.headline })}\n >\n {headline ? headline(item.children) : item.children}\n </span>\n {item.supportingText != null && (\n <span\n id={ids?.supporting}\n data-slot=\"supporting\"\n className={styles.supporting({ class: classNames?.supportingText })}\n >\n {item.supportingText}\n </span>\n )}\n </span>\n {(item.trailing != null || trailing != null) && (\n <span\n ref={(cell) => hideDecorativeIcons(cell)}\n data-slot=\"trailing\"\n className={styles.trailing({ class: cn(sideClassName, classNames?.trailing) })}\n >\n {item.trailing}\n {trailing}\n </span>\n )}\n </>\n );\n}\n\n/**\n * Hides the bare icons of an item's leading or trailing content from assistive tech: an\n * `<svg>` child with no name of its own (`aria-label`, `aria-labelledby`, `role`, `<title>`)\n * is decorative, since the item's text names the item, and would otherwise be listed as an\n * unnamed image. A ref callback, so it also reaches icons that components render; it runs\n * on every render (no layout reads), so a replaced icon is hidden too.\n */\nfunction hideDecorativeIcons(cell: HTMLElement | null) {\n if (!cell) return;\n for (const svg of cell.querySelectorAll(':scope > svg')) {\n if (\n svg.hasAttribute('aria-label') ||\n svg.hasAttribute('aria-labelledby') ||\n svg.hasAttribute('role') ||\n svg.querySelector(':scope > title')\n ) {\n continue;\n }\n svg.setAttribute('aria-hidden', 'true');\n }\n}\n\n/** What a plain list hands its items and sections. */\ninterface StaticListValue {\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n /** Whether the item with this key is disabled by the list (`disabled`, `disabledKeys`). */\n isKeyDisabled: (key: Key | null) => boolean;\n /** Marks the top-level entry at `index` as a section; returns its cleanup. */\n registerSection: (index: number) => () => void;\n}\n\nconst StaticListContext = createContext<StaticListValue | null>(null);\n\n/** Where an entry of a plain or radio list sits, from the list or section that renders it. */\ninterface ListEntry {\n index: number;\n /** Its position in its group (segmented corners, dividers). */\n position: string;\n /** Whether a `ListSection` holds it. */\n inSection: boolean;\n /** Whether the list disables it by its key. */\n disabled: boolean;\n}\n\nconst ListEntryContext = createContext<ListEntry | null>(null);\n\n/**\n * The positions of a plain list's top-level entries: each run of items between sections is\n * its own group. Sections are known once they've told the list (`registerSection`); before\n * that (the server render and the first client render) every entry counts as an item.\n */\nfunction entryPositions(count: number, sections: ReadonlySet<number>): string[] {\n const positions: string[] = [];\n let start = 0;\n for (let index = 0; index <= count; index += 1) {\n if (index < count && !sections.has(index)) continue;\n for (let item = start; item < index; item += 1) {\n positions[item] = position(item - start, index - start);\n }\n if (index < count) positions[index] = 'only';\n start = index + 1;\n }\n return positions;\n}\n\nfunction StaticList({\n variant,\n disabled,\n classNames,\n className,\n style,\n ref,\n entries,\n ...rest\n}: ListProps & { entries: ReactElement[] }) {\n const { root: data } = splitRootProps(rest);\n const rootTokens = tokenAttributes(variant, data);\n const { 'aria-label': label, 'aria-labelledby': labelledBy } = rest as {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n };\n const root = listStyles({ variant }).root({ class: cn(classNames?.root, className) });\n const [sections, setSections] = useState<ReadonlySet<number>>(() => new Set());\n const registerSection = useCallback((index: number) => {\n setSections((current) => (current.has(index) ? current : new Set(current).add(index)));\n return () =>\n setSections((current) => {\n const next = new Set(current);\n next.delete(index);\n return next;\n });\n }, []);\n const disabledKeys = rest.disabledKeys;\n const list = useMemo<StaticListValue>(() => {\n const keys = new Set<Key>(disabledKeys ?? []);\n return {\n variant,\n classNames,\n isKeyDisabled: (key) => Boolean(disabled) || (key != null && keys.has(key)),\n registerSection,\n };\n }, [variant, classNames, disabled, disabledKeys, registerSection]);\n const positions = entryPositions(entries.length, sections);\n return (\n <ul\n {...data}\n {...rootTokens}\n id={rest.id}\n ref={ref as Ref<HTMLUListElement>}\n style={style}\n aria-label={label}\n aria-labelledby={labelledBy}\n onKeyDown={onLinkArrowKeys}\n className={root}\n >\n <StaticListContext value={list}>\n {entries.map((entry, index) => (\n <ListEntryContext\n key={entry.key ?? index}\n value={{\n index,\n position: positions[index]!,\n inSection: false,\n disabled: list.isKeyDisabled(entry.key),\n }}\n >\n {entry}\n </ListEntryContext>\n ))}\n </StaticListContext>\n </ul>\n );\n}\n\n/** An item of a plain list: a link, a switch or checkbox, or a plain row. */\nfunction StaticListItem({\n item,\n list,\n entry,\n}: {\n item: ListItemProps;\n list: StaticListValue;\n entry: ListEntry;\n}) {\n const options = useContext(ListOptionsContext);\n if (entry.inSection && listItems(item.childItems).length > 0) {\n throw new Error(EXPANDABLE_SECTIONS_ERROR);\n }\n const { variant, classNames } = list;\n const isDisabled = Boolean(entry.disabled || item.disabled);\n if (item.href != null) {\n return (\n <LinkItem\n item={item}\n variant={variant}\n classNames={classNames}\n position={entry.position}\n isDisabled={isDisabled}\n />\n );\n }\n if (item.control != null) {\n return (\n <li data-list-entry=\"\">\n <ToggleItem\n item={item}\n control={item.control}\n variant={variant}\n classNames={classNames}\n position={entry.position}\n listDisabled={isDisabled}\n />\n </li>\n );\n }\n const styles = itemStyles(item, variant, false, options);\n return (\n <li\n data-list-entry=\"\"\n data-shape=\"rest\"\n data-position={entry.position}\n {...itemAttributes(variant)}\n className={styles.item({ class: cn(classNames?.item, item.className) })}\n >\n <span className={styles.cell()}>\n <ItemContent item={item} styles={styles} classNames={classNames} />\n </span>\n </li>\n );\n}\n\n/**\n * Arrow keys between a list's links (M3: \"navigate within the list using arrow keys\"):\n * ↑ / ↓ move focus to the previous or next link, wrapping at the ends, and Home / End to\n * the first and last. Each link stays a real anchor and a Tab stop; disabled items have no\n * link and are skipped.\n */\nfunction onLinkArrowKeys(event: KeyboardEvent<HTMLUListElement>) {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n if (!['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) return;\n const links = [\n ...event.currentTarget.querySelectorAll<HTMLAnchorElement>('a[href][data-list-link]'),\n ];\n const index = links.indexOf(event.target as HTMLAnchorElement);\n if (index === -1) return;\n const last = links.length - 1;\n const target =\n event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? last\n : event.key === 'ArrowDown'\n ? index === last\n ? 0\n : index + 1\n : index === 0\n ? last\n : index - 1;\n event.preventDefault();\n links[target]!.focus();\n}\n\n/** The collection's top-level nodes as groups: each section, and each run of items. */\nfunction groupNodes(collection: ListState<object>['collection']) {\n const groups: { section: Node<object> | null; items: Node<object>[] }[] = [];\n for (const node of collection) {\n if (node.type === 'section') {\n const items = [...collection.getChildren!(node.key)].filter((child) => child.type === 'item');\n groups.push({ section: node, items });\n continue;\n }\n const last = groups.at(-1);\n if (last?.section === null) last.items.push(node);\n else groups.push({ section: null, items: [node] });\n }\n return groups;\n}\n\n/** The name of a section's group: its `aria-label`, else its subheader. */\nfunction sectionNaming(section: { title?: ReactNode; 'aria-label'?: string }, headingId: string) {\n return section['aria-label'] != null\n ? { 'aria-label': section['aria-label'] }\n : { 'aria-labelledby': headingId };\n}\n\n/** A section of a plain list: a subheader and a nested list named by it. */\nfunction StaticSection({\n section,\n variant,\n classNames,\n children,\n}: {\n section: ListSectionProps;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n children: ReactNode;\n}) {\n const headingId = useId();\n const styles = listStyles({ variant, titled: section.title != null });\n return (\n <li\n data-slot=\"section\"\n className={styles.section({ class: cn(classNames?.section, section.className) })}\n >\n {section.title != null && (\n <div id={headingId} className={styles.subheader({ class: classNames?.subheader })}>\n {section.title}\n </div>\n )}\n <ul {...sectionNaming(section, headingId)} className={styles.group()}>\n {children}\n </ul>\n </li>\n );\n}\n\ntype InteractiveKind = 'grid' | 'listbox' | 'tree';\n\nfunction InteractiveList(props: ListProps & { expandable: boolean }) {\n return (\n <DomDirectionLocale>\n {(directionRef) => <CollectionList {...props} directionRef={directionRef} />}\n </DomDirectionLocale>\n );\n}\n\n/** Material Symbols \"check\" and \"expand_more\" (Apache-2.0). */\nfunction CheckIcon20() {\n return (\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\n </svg>\n );\n}\n\nfunction ExpandMoreIcon() {\n return (\n <svg viewBox=\"0 -960 960 960\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z\" />\n </svg>\n );\n}\n\n/**\n * A grid list (`onAction`, links), a list box (selection) or a tree grid (`childItems`),\n * from React Aria's collection hooks. Arrow keys wrap at the ends, as M3 asks.\n */\nfunction CollectionList({\n expandable,\n variant,\n disabled,\n deselectable = true,\n classNames,\n className,\n style,\n ref,\n directionRef,\n ...rest\n}: ListProps & { expandable: boolean; directionRef: (element: HTMLElement | null) => void }) {\n const { root: data, rest: ariaProps } = splitRootProps(rest);\n assertCollectionChildren(rest.children, 'List', 'ListItem elements');\n const scan = useCollectionScan(rest.children);\n if (scan.items.some((item) => item.control != null)) throw new Error(CONTROL_ERROR);\n if (expandable && scan.sectioned) throw new Error(EXPANDABLE_SECTIONS_ERROR);\n const selectable = rest.selectionMode != null && rest.selectionMode !== 'none';\n // A selection list is a list box (M3: \"Container: List box · List item: Option\"); a list\n // whose items also act or link keeps the grid list's separate actions.\n const kind: InteractiveKind = expandable\n ? 'tree'\n : selectable && rest.onAction == null && !scan.items.some((item) => item.href != null)\n ? 'listbox'\n : 'grid';\n const disabledKeys = new Set<Key>(rest.disabledKeys ?? []);\n for (const [key, item] of scan.entries) {\n if (disabled || item.disabled) disabledKeys.add(key);\n }\n const options = {\n ...(ariaProps as unknown as AriaGridListProps<object>),\n disabledKeys: disabledKeys.size > 0 ? disabledKeys : rest.disabledKeys,\n disallowEmptySelection: !deselectable,\n // Disabled items stay focusable (WAI-ARIA APG, \"Focusability of disabled controls\"); each row\n // keeps only its focus handlers, so it can't be pressed, chosen, expanded or followed.\n ...FOCUSABLE_DISABLED_OPTIONS,\n shouldFocusWrap: true,\n };\n const root: CollectionRootProps = {\n options,\n listRef: ref,\n directionRef,\n data: { ...data, ...tokenAttributes(variant, data) },\n style,\n className: listStyles({ variant }).root({ class: cn(classNames?.root, className) }),\n variant,\n classNames,\n };\n if (kind === 'tree') return <TreeList {...root} />;\n if (kind === 'listbox') return <ListBoxList {...root} />;\n return <GridList {...root} />;\n}\n\ninterface CollectionRootProps {\n options: AriaGridListProps<object> & { shouldFocusWrap: boolean };\n listRef: Ref<HTMLElement> | undefined;\n directionRef: (element: HTMLElement | null) => void;\n data: Record<string, unknown>;\n style?: CSSProperties | undefined;\n className: string;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n}\n\nfunction GridList({\n options,\n listRef,\n directionRef,\n data,\n style,\n className,\n variant,\n classNames,\n}: CollectionRootProps) {\n const rootRef = useObjectRef(listRef as Ref<HTMLDivElement>);\n const state = useListState(options);\n const { gridProps } = useGridList(options, state, rootRef);\n // Arrow keys reveal a row at the nearest position, never centring the page on the list.\n useNearestReveal(rootRef);\n return (\n <div\n {...mergeProps(data, gridProps)}\n ref={(element) => {\n rootRef.current = element;\n directionRef(element);\n }}\n style={style}\n className={className}\n >\n {groupNodes(state.collection).map((group) => {\n const rows = group.items.map((node, index) => (\n <GridListRow\n key={node.key}\n node={node}\n state={state}\n variant={variant}\n classNames={classNames}\n position={position(index, group.items.length)}\n />\n ));\n return group.section ? (\n <GridListSection\n key={group.section.key}\n node={group.section}\n state={state}\n variant={variant}\n classNames={classNames}\n >\n {rows}\n </GridListSection>\n ) : (\n rows\n );\n })}\n </div>\n );\n}\n\n/**\n * A section of a grid list: a row group named by its subheader, a header row holding a row\n * header (React Aria's `GridListSection` structure), then the items' rows.\n */\nfunction GridListSection({\n node,\n state,\n variant,\n classNames,\n children,\n}: {\n node: Node<object>;\n state: ListState<object>;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const section = node.props as ListSectionProps;\n const { rowProps, rowHeaderProps, rowGroupProps } = useGridListSection(\n { 'aria-label': section['aria-label'] },\n state,\n ref,\n );\n const styles = listStyles({ variant, titled: section.title != null });\n return (\n <div\n {...rowGroupProps}\n {...(section['aria-label'] != null && { 'aria-labelledby': undefined })}\n ref={ref}\n className={styles.section({ class: cn(classNames?.section, section.className) })}\n >\n {section.title != null && (\n <div {...rowProps}>\n <div {...rowHeaderProps} className={styles.subheader({ class: classNames?.subheader })}>\n {section.title}\n </div>\n </div>\n )}\n <div role=\"presentation\" className={styles.group()}>\n {children}\n </div>\n </div>\n );\n}\n\n/** Compose's shape precedence: pressed, then selected or focused (16px), then hovered (12px). */\nfunction shapeOf(state: {\n isPressed: boolean;\n isSelected: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isDisabled: boolean;\n}) {\n if ((state.isPressed && !state.isDisabled) || state.isSelected || state.isFocusVisible) {\n return 'active';\n }\n return state.isHovered && !state.isDisabled ? 'hovered' : 'rest';\n}\n\n/** The check a selected item shows at its end, when the list selects and shows it. */\nfunction useSelectionCheck(\n styles: ReturnType<typeof listStyles>,\n selectable: boolean,\n className: string | undefined,\n): ReactNode {\n const { selectionIndicator = true } = useContext(ListOptionsContext);\n if (!selectable || !selectionIndicator) return null;\n return (\n <span\n aria-hidden=\"true\"\n data-selection-indicator=\"\"\n className={styles.selectionIndicator({ class: className })}\n >\n <CheckIcon20 />\n </span>\n );\n}\n\nfunction GridListRow({\n node,\n state,\n variant,\n classNames,\n position: itemPosition,\n}: {\n node: Node<object>;\n state: ListState<object>;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n position: string;\n}) {\n const item = node.props as ListItemProps;\n const ref = useRef<HTMLDivElement>(null);\n const {\n rowProps: ownRowProps,\n gridCellProps,\n descriptionProps,\n isPressed,\n isSelected,\n } = useGridListItem({ node }, state, ref);\n const isDisabled = state.disabledKeys.has(node.key);\n const rowProps = isDisabled ? focusOnly(ownRowProps) : ownRowProps;\n const { hoverProps, isHovered } = useHover({ isDisabled });\n const { interactionProps, dataAttributes } = useM3Interaction({ isDisabled, isPressed }, ref);\n const isFocusVisible = dataAttributes['data-focus-visible'] != null;\n const shape = shapeOf({ isPressed, isSelected, isFocusVisible, isHovered, isDisabled });\n const options = useContext(ListOptionsContext);\n const styles = itemStyles(item, variant, true, options);\n const check = useSelectionCheck(\n styles,\n state.selectionManager.selectionMode !== 'none',\n classNames?.selectionIndicator,\n );\n return (\n <div\n {...mergeProps(rowProps, hoverProps, interactionProps)}\n {...dataAttributes}\n aria-disabled={isDisabled || undefined}\n ref={ref}\n data-selected={isSelected || undefined}\n data-shape={shape}\n data-position={itemPosition}\n {...itemAttributes(variant)}\n className={styles.item({ class: cn(classNames?.item, item.className) })}\n >\n <div {...gridCellProps} className={styles.cell()}>\n <ItemContent\n item={item}\n styles={styles}\n classNames={classNames}\n ids={{ supporting: descriptionProps.id }}\n end={check}\n />\n </div>\n </div>\n );\n}\n\nconst FOCUSABLE = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * A disabled item's props: its role, ARIA, id, tab index and focus handlers, but no press, key\n * or pointer handlers, so it takes focus (APG) and does nothing else.\n */\nfunction focusOnly<T extends object>(props: T): T {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([name]) => !/^on[A-Z]/.test(name) || name === 'onFocus' || name === 'onBlur',\n ),\n ) as T;\n}\n\n/** A list box of options: M3's single- and multi-select lists on the web. */\nfunction ListBoxList({\n options,\n listRef,\n directionRef,\n data,\n style,\n className,\n variant,\n classNames,\n}: CollectionRootProps) {\n const rootRef = useObjectRef(listRef as Ref<HTMLDivElement>);\n const listBoxOptions = options as unknown as AriaListBoxOptions<object>;\n const state = useListState(listBoxOptions);\n const { listBoxProps } = useListBox(listBoxOptions, state, rootRef);\n useNearestReveal(rootRef);\n return (\n <div\n {...mergeProps(data, listBoxProps)}\n ref={(element) => {\n rootRef.current = element;\n directionRef(element);\n }}\n style={style}\n className={className}\n >\n {groupNodes(state.collection).map((group) => {\n const rows = group.items.map((node, index) => (\n <OptionRow\n key={node.key}\n node={node}\n state={state}\n variant={variant}\n classNames={classNames}\n position={position(index, group.items.length)}\n />\n ));\n return group.section ? (\n <ListBoxSection\n key={group.section.key}\n node={group.section}\n variant={variant}\n classNames={classNames}\n >\n {rows}\n </ListBoxSection>\n ) : (\n rows\n );\n })}\n </div>\n );\n}\n\n/** A section of a list box: a subheader and a group of options named by it. */\nfunction ListBoxSection({\n node,\n variant,\n classNames,\n children,\n}: {\n node: Node<object>;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n children: ReactNode;\n}) {\n const section = node.props as ListSectionProps;\n const { itemProps, headingProps, groupProps } = useListBoxSection({\n heading: section.title,\n 'aria-label': section['aria-label'],\n });\n const styles = listStyles({ variant, titled: section.title != null });\n return (\n <div\n {...itemProps}\n className={styles.section({ class: cn(classNames?.section, section.className) })}\n >\n {section.title != null && (\n <div {...headingProps} className={styles.subheader({ class: classNames?.subheader })}>\n {section.title}\n </div>\n )}\n <div\n {...groupProps}\n {...(section['aria-label'] != null && { 'aria-labelledby': undefined })}\n className={styles.group()}\n >\n {children}\n </div>\n </div>\n );\n}\n\nfunction OptionRow({\n node,\n state,\n variant,\n classNames,\n position: itemPosition,\n}: {\n node: Node<object>;\n state: ListState<object>;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n position: string;\n}) {\n const item = node.props as ListItemProps;\n const ref = useRef<HTMLDivElement>(null);\n const {\n optionProps: ownOptionProps,\n isPressed,\n isSelected,\n } = useOption({ key: node.key }, state, ref);\n const isDisabled = state.disabledKeys.has(node.key);\n const optionProps = isDisabled\n ? { ...focusOnly(ownOptionProps), 'aria-disabled': true }\n : ownOptionProps;\n const { hoverProps, isHovered } = useHover({ isDisabled });\n const { interactionProps, dataAttributes } = useM3Interaction({ isDisabled, isPressed }, ref);\n const isFocusVisible = dataAttributes['data-focus-visible'] != null;\n const shape = shapeOf({ isPressed, isSelected, isFocusVisible, isHovered, isDisabled });\n const options = useContext(ListOptionsContext);\n const styles = itemStyles(item, variant, true, options);\n const check = useSelectionCheck(styles, true, classNames?.selectionIndicator);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n const nested = ref.current?.querySelector(FOCUSABLE);\n if (nested) {\n console.warn(\n '[@windmorph/react] List: an item of a selection list is one option and must not hold ' +\n 'buttons, links or fields. Give the list onAction to keep separate trailing actions.',\n nested,\n );\n }\n });\n return (\n <div\n {...mergeProps(optionProps, hoverProps, interactionProps)}\n {...dataAttributes}\n // Named by its content: the overline, headline, supporting and trailing text in the\n // order they show, each read once. Naming it by the headline alone (React Aria's\n // default) leaves visible text out of its name (WCAG 2.5.3), and describing it by the\n // supporting text as well would read that twice. Select's options are named the same way.\n aria-labelledby={undefined}\n aria-describedby={undefined}\n ref={ref}\n data-selected={isSelected || undefined}\n data-shape={shape}\n data-position={itemPosition}\n {...itemAttributes(variant)}\n className={styles.item({ class: cn(classNames?.item, item.className) })}\n >\n <span className={styles.cell()}>\n <ItemContent item={item} styles={styles} classNames={classNames} end={check} />\n </span>\n </div>\n );\n}\n\n/** A tree grid: items with `childItems` expand and collapse to show their nested items. */\nfunction TreeList({\n options,\n listRef,\n directionRef,\n data,\n style,\n className,\n variant,\n classNames,\n}: CollectionRootProps) {\n const rootRef = useObjectRef(listRef as Ref<HTMLDivElement>);\n // `options` carries the list's `expandedKeys`, `defaultExpandedKeys` and `onExpandedChange`.\n const treeOptions = options as unknown as AriaTreeOptions<object> &\n Pick<ListProps, 'expandedKeys' | 'defaultExpandedKeys' | 'onExpandedChange'>;\n const state = useTreeState(treeOptions);\n const { gridProps } = useTree(treeOptions, state, rootRef);\n const rows = [...state.collection.getKeys()]\n .map((key) => state.collection.getItem(key))\n .filter((node): node is Node<object> => node?.type === 'item');\n const { shown, onExited, version } = useRowPresence(rows);\n // A press that opens an item while an open item above it folds keeps the pressed row\n // where it was: the page scrolls by the folded height as the rows close.\n const { capture, release } = useKeepPressedInPlace(\n '[role=row]',\n version,\n shown.some((row) => row.exiting),\n );\n const reveal = listStyles({ variant });\n return (\n <div\n {...mergeProps(data, gridProps, {\n onPointerDownCapture: capture,\n onKeyDownCapture: capture,\n onPointerUpCapture: release,\n onKeyUpCapture: release,\n onClickCapture: (event: MouseEvent<HTMLDivElement>) => {\n // A virtual click (assistive tech) presses with no pointer down before it.\n if (event.detail === 0) capture(event);\n release();\n },\n })}\n ref={(element) => {\n rootRef.current = element;\n directionRef(element);\n }}\n style={style}\n className={className}\n >\n {shown.map((row) => (\n <TreeRowReveal\n key={row.node.key}\n row={row}\n onExited={onExited}\n className={reveal.reveal()}\n clipClassName={reveal.revealClip()}\n >\n {row.exiting ? (\n <TreeRowGhost\n node={row.node}\n selectable={state.selectionManager.selectionMode !== 'none'}\n variant={variant}\n classNames={classNames}\n position={row.position}\n />\n ) : (\n <TreeRow\n node={row.node}\n state={state}\n variant={variant}\n classNames={classNames}\n position={row.position}\n />\n )}\n </TreeRowReveal>\n ))}\n </div>\n );\n}\n\n/** Whether the reader asks for reduced motion (read on a change, never on the server). */\nconst prefersReducedMotion = () =>\n typeof window !== 'undefined' &&\n (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false);\n\n/** A tree row as shown: live, opening in, or gone from the tree and closing. */\ninterface ShownRow {\n node: Node<object>;\n position: string;\n /** Added after the tree first rendered (an item was expanded), so it opens in. */\n appear: boolean;\n /** No longer in the tree (its parent collapsed); shown until it has closed. */\n exiting: boolean;\n}\n\n/**\n * The rows to render: the tree's visible rows, plus rows that just left it (a collapsed\n * item's nested rows) in their old place until their closing transition ends. Rows added\n * after the first render are marked to open in.\n */\nfunction useRowPresence(rows: Node<object>[]) {\n const live = (node: Node<object>, index: number, appear: boolean): ShownRow => ({\n node,\n position: position(index, rows.length),\n appear,\n exiting: false,\n });\n const keys = rows.map((node) => node.key);\n const [presence, setPresence] = useState(() => ({\n keys,\n shown: rows.map((node, index) => live(node, index, false)),\n }));\n let { shown } = presence;\n // Follow the tree while rendering (no effect, no extra paint) whenever its rows change.\n // A collection can be rebuilt with the same rows, so they're compared by key.\n if (keys.length !== presence.keys.length || keys.some((key, i) => key !== presence.keys[i])) {\n const indexOf = new Map(rows.map((node, index) => [node.key, index]));\n const before = new Map(shown.map((row) => [row.node.key, row]));\n const next: ShownRow[] = [];\n let cursor = 0;\n const takeUpTo = (end: number) => {\n for (; cursor <= end; cursor += 1) {\n const node = rows[cursor]!;\n const previous = before.get(node.key);\n next.push(live(node, cursor, previous ? previous.appear : true));\n }\n };\n for (const row of shown) {\n const index = indexOf.get(row.node.key);\n if (index === undefined) next.push({ ...row, exiting: true });\n else if (index >= cursor) takeUpTo(index);\n }\n takeUpTo(rows.length - 1);\n // A switch under reduced motion (2026-10-17): when rows open while others leave, the\n // leaving ones go at once instead of holding their height while they fade, and the\n // opening ones appear at full height and fade in, so the rows below shift once, never\n // twice. A lone fold still fades where it is.\n const opening = next.some((row) => !row.exiting && !before.has(row.node.key));\n shown =\n opening && next.some((row) => row.exiting) && prefersReducedMotion()\n ? next.filter((row) => !row.exiting)\n : next;\n setPresence({ keys, shown });\n }\n const onExited = useCallback(\n (key: Key) =>\n setPresence((current) => ({\n ...current,\n shown: current.shown.filter((row) => !(row.exiting && row.node.key === key)),\n })),\n [],\n );\n // Live rows render the tree's current nodes; leaving rows keep their last ones.\n const current = new Map(rows.map((node) => [node.key, node]));\n return {\n shown: shown.map((row) => (row.exiting ? row : { ...row, node: current.get(row.node.key)! })),\n onExited,\n /** Changes whenever the rows shown change. */\n version: presence,\n };\n}\n\n/**\n * A tree row's wrapper, which opens its height and fades it in when the row appears, and\n * closes it when the row leaves, then lets it go. Nothing in a leaving row can be focused\n * or read.\n */\nfunction TreeRowReveal({\n row,\n onExited,\n className,\n clipClassName,\n children,\n}: {\n row: ShownRow;\n onExited: (key: Key) => void;\n className: string;\n clipClassName: string;\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const { exiting, node } = row;\n useEffect(() => {\n if (!exiting) return;\n // Wait for the closing transitions, if any run (none without CSS or with no motion).\n const transitions = ref.current?.getAnimations?.() ?? [];\n if (transitions.length === 0) {\n onExited(node.key);\n return;\n }\n let current = true;\n void Promise.allSettled(transitions.map((transition) => transition.finished)).then(() => {\n if (current) onExited(node.key);\n });\n return () => {\n current = false;\n };\n }, [exiting, node.key, onExited]);\n return (\n <div\n ref={ref}\n data-appear={row.appear || undefined}\n data-exiting={exiting || undefined}\n inert={exiting || undefined}\n className={className}\n >\n <div className={clipClassName}>{children}</div>\n </div>\n );\n}\n\n/** A leaving row's picture while it closes: the row at rest, hidden from assistive tech. */\nfunction TreeRowGhost({\n node,\n selectable,\n variant,\n classNames,\n position: itemPosition,\n}: {\n node: Node<object>;\n selectable: boolean;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n position: string;\n}) {\n const item = node.props as ListItemProps;\n const options = useContext(ListOptionsContext);\n const styles = listStyles({\n ...itemStylesOptions(item, variant, true, options),\n nested: node.level > 0,\n });\n const check = useSelectionCheck(styles, selectable, classNames?.selectionIndicator);\n const chevron = node.hasChildNodes && (\n <span className={styles.expand({ class: classNames?.expandButton })}>\n <ExpandMoreIcon />\n </span>\n );\n return (\n <div\n aria-hidden=\"true\"\n style={{ '--m3-list-level': node.level } as CSSProperties}\n data-shape=\"rest\"\n data-position={itemPosition}\n {...itemAttributes(variant)}\n className={styles.item({ class: cn(classNames?.item, item.className) })}\n >\n <div className={styles.cell()}>\n <ItemContent\n item={item}\n styles={styles}\n classNames={classNames}\n end={\n check || chevron ? (\n <>\n {check}\n {chevron}\n </>\n ) : null\n }\n />\n </div>\n </div>\n );\n}\n\ntype TreeCollection = TreeState<object>['collection'] & {\n getChildren?: (key: Key) => Iterable<Node<object>>;\n};\n\n/**\n * React Aria's tree item reads a row's siblings (for `aria-posinset` and `aria-setsize`)\n * through `collection.getChildren` and each sibling's `nextKey`, which React Stately's\n * `TreeCollection` doesn't provide: its `nextKey` and `index` follow the visible rows, as\n * keyboard navigation needs. While the row's hook runs, this gives the collection the\n * nested items' own order, and the returned function restores it. React Aria keys its\n * per-list data by the state object, so the state itself has to be the one patched.\n */\nfunction withSiblingOrder(state: TreeState<object>, node: Node<object>) {\n const collection = state.collection as TreeCollection;\n const visibleItem = collection.getItem.bind(collection);\n const siblingsOf = (parentKey: Key | null | undefined) =>\n (parentKey == null ? [...collection] : [...(visibleItem(parentKey)?.childNodes ?? [])]).filter(\n (sibling) => sibling.type === 'item',\n );\n const inSiblingOrder = (item: Node<object>): Node<object> => {\n const siblings = siblingsOf(item.parentKey);\n const index = siblings.findIndex((sibling) => sibling.key === item.key);\n return { ...item, index, nextKey: siblings[index + 1]?.key ?? null };\n };\n collection.getItem = (key: Key) => {\n const item = visibleItem(key);\n return item ? inSiblingOrder(item) : null;\n };\n collection.getChildren = (key: Key) => siblingsOf(key).map(inSiblingOrder);\n return {\n node: inSiblingOrder(node),\n restore: () => {\n delete (collection as Partial<TreeCollection>).getItem;\n delete collection.getChildren;\n },\n };\n}\n\nfunction ExpandButton({ props, className }: { props: AriaButtonProps; className: string }) {\n const ref = useRef<HTMLButtonElement>(null);\n const { buttonProps, isPressed } = useButton(props, ref);\n const { interactionProps, dataAttributes } = useM3Interaction(\n { isDisabled: props.isDisabled, isPressed },\n ref,\n );\n return (\n <button\n {...mergeProps(buttonProps, interactionProps)}\n {...dataAttributes}\n ref={ref}\n className={className}\n >\n {/* 48px, but never taller than a one-line item (44px at density -3), so it stays in its row. */}\n <TouchTarget className=\"h-[min(48px,calc(56px+var(--md-sys-density,0)*4px))]\" />\n <ExpandMoreIcon />\n </button>\n );\n}\n\nfunction TreeRow({\n node,\n state,\n variant,\n classNames,\n position: itemPosition,\n}: {\n node: Node<object>;\n state: TreeState<object>;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n position: string;\n}) {\n const item = node.props as ListItemProps;\n const ref = useRef<HTMLDivElement>(null);\n const siblingOrder = withSiblingOrder(state, node);\n const { rowProps, gridCellProps, descriptionProps, expandButtonProps, isPressed, isSelected } =\n useTreeItem({ node: siblingOrder.node, hasChildItems: node.hasChildNodes }, state, ref);\n siblingOrder.restore();\n const isDisabled = state.disabledKeys.has(node.key);\n const { hoverProps, isHovered } = useHover({ isDisabled });\n const { interactionProps, dataAttributes } = useM3Interaction({ isDisabled, isPressed }, ref);\n const isFocusVisible = dataAttributes['data-focus-visible'] != null;\n const shape = shapeOf({ isPressed, isSelected, isFocusVisible, isHovered, isDisabled });\n const options = useContext(ListOptionsContext);\n const styles = listStyles({\n ...itemStylesOptions(item, variant, true, options),\n nested: node.level > 0,\n });\n const check = useSelectionCheck(\n styles,\n state.selectionManager.selectionMode !== 'none',\n classNames?.selectionIndicator,\n );\n // Only a check or a chevron makes a trailing cell (and its 12px gap).\n const end =\n check != null || node.hasChildNodes ? (\n <>\n {check}\n {node.hasChildNodes && (\n <ExpandButton\n props={{ ...expandButtonProps, isDisabled }}\n className={styles.expand({ class: classNames?.expandButton })}\n />\n )}\n </>\n ) : null;\n return (\n <div\n {...mergeProps(isDisabled ? focusOnly(rowProps) : rowProps, hoverProps, interactionProps)}\n {...dataAttributes}\n aria-disabled={isDisabled || undefined}\n ref={ref}\n style={{ '--m3-list-level': node.level } as CSSProperties}\n data-selected={isSelected || undefined}\n data-shape={shape}\n data-position={itemPosition}\n {...itemAttributes(variant)}\n className={styles.item({ class: cn(classNames?.item, item.className) })}\n >\n <div {...gridCellProps} className={styles.cell()}>\n <ItemContent\n item={item}\n styles={styles}\n classNames={classNames}\n ids={{ supporting: descriptionProps.id }}\n end={end}\n />\n </div>\n </div>\n );\n}\n\n/**\n * The items of an interactive list's collection, as React Stately's collection builder reads\n * them (each entry describes itself through `getCollectionNode`), top-level and in sections,\n * and whether it has sections. The list picks its kind and its disabled keys from these.\n */\nfunction useCollectionScan(children: ReactNode) {\n const { collection } = useListState<object>({\n children: children as AriaGridListProps<object>['children'],\n });\n return useMemo(() => {\n const entries: [Key, ListItemProps][] = [];\n let sectioned = false;\n for (const node of collection) {\n if (node.type === 'section') {\n sectioned = true;\n for (const child of collection.getChildren!(node.key)) {\n if (child.type === 'item') entries.push([child.key, child.props as ListItemProps]);\n }\n } else if (node.type === 'item') {\n entries.push([node.key, node.props as ListItemProps]);\n }\n }\n return { entries, items: entries.map(([, item]) => item), sectioned };\n }, [collection]);\n}\n\n/** Ids that name an item that is a control (its headline) and describe it (the rest). */\nfunction useItemIds(item: ListItemProps) {\n const id = useId();\n const ids: ItemIds = {\n headline: `${id}-headline`,\n ...(item.overline != null && { overline: `${id}-overline` }),\n ...(item.supportingText != null && { supporting: `${id}-supporting` }),\n };\n const described = [ids.overline, ids.supporting].filter(Boolean).join(' ');\n const naming =\n item['aria-label'] != null\n ? { 'aria-label': item['aria-label'] }\n : { 'aria-labelledby': ids.headline };\n return { ids, naming: { ...naming, ...(described && { 'aria-describedby': described }) } };\n}\n\ninterface ToggleItemProps {\n item: ListItemProps;\n control: 'switch' | 'checkbox';\n variant?: ListVariant;\n classNames?: ListClassNames;\n position: string;\n listDisabled?: boolean;\n}\n\n/** A switch or checkbox item: a visually hidden native input, the item as its label. */\nfunction ToggleItem({ item, control, listDisabled, ...view }: ToggleItemProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const { ids, naming } = useItemIds(item);\n const isDisabled = Boolean(listDisabled || item.disabled);\n const options: AriaCheckboxProps = {\n ...naming,\n children: item.children,\n isSelected: item.checked,\n defaultSelected: item.defaultChecked,\n onChange: item.onCheckedChange,\n isDisabled,\n name: item.name,\n value: item.value,\n };\n const state = useToggleState(options);\n const { inputProps, labelProps, isSelected, isPressed } = useCheckbox(options, state, inputRef);\n return (\n <ControlItem\n {...view}\n item={item}\n ids={ids}\n kind={control}\n // A native checkbox with the switch role, as React Aria's `useSwitch` renders it.\n inputProps={control === 'switch' ? { ...inputProps, role: 'switch' } : inputProps}\n inputRef={inputRef}\n labelProps={labelProps}\n isSelected={isSelected}\n isDisabled={isDisabled}\n isPressed={isPressed}\n placement={item.controlPlacement ?? (control === 'switch' ? 'end' : 'start')}\n />\n );\n}\n\nfunction RadioList({\n variant,\n classNames,\n className,\n style,\n ref,\n value,\n defaultValue,\n onChange,\n name,\n required,\n disabled,\n controlPlacement = 'start',\n entries,\n ...rest\n}: ListProps & { entries: ReactElement[] }) {\n const { root: data } = splitRootProps(rest);\n const { 'aria-label': label, 'aria-labelledby': labelledBy } = rest as {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n };\n const options: AriaRadioGroupProps = {\n id: rest.id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy,\n value,\n defaultValue,\n onChange,\n name,\n isRequired: required,\n isDisabled: disabled,\n };\n const state = useRadioGroupState(options);\n const { radioGroupProps } = useRadioGroup(options, state);\n return (\n <div\n {...mergeProps(data, radioGroupProps)}\n {...tokenAttributes(variant, data)}\n ref={ref as Ref<HTMLDivElement>}\n style={style}\n className={listStyles({ variant }).root({ class: cn(classNames?.root, className) })}\n >\n <RadioListContext value={{ state, variant, classNames, controlPlacement }}>\n {entries.map((entry, index) => (\n <ListEntryContext\n key={entry.key ?? index}\n value={{\n index,\n position: position(index, entries.length),\n inSection: false,\n disabled: false,\n }}\n >\n {entry}\n </ListEntryContext>\n ))}\n </RadioListContext>\n </div>\n );\n}\n\n/** What a radio list hands its items. */\ninterface RadioListValue {\n state: RadioGroupState;\n variant?: ListVariant | undefined;\n classNames?: ListClassNames | undefined;\n controlPlacement: ControlPlacement;\n}\n\nconst RadioListContext = createContext<RadioListValue | null>(null);\n\n/** An item of a radio list: a radio button with the item's `value`. */\nfunction RadioListItem({\n item,\n radio,\n position: itemPosition,\n}: {\n item: ListItemProps;\n radio: RadioListValue;\n position: string;\n}) {\n if (item.value == null || item.control != null || item.href != null) {\n throw new Error(RADIO_ITEM_ERROR);\n }\n return (\n <RadioItem\n item={item}\n state={radio.state}\n variant={radio.variant}\n classNames={radio.classNames}\n position={itemPosition}\n placement={item.controlPlacement ?? radio.controlPlacement}\n />\n );\n}\n\nfunction RadioItem({\n item,\n state,\n placement,\n ...view\n}: {\n item: ListItemProps;\n state: RadioGroupState;\n variant?: ListVariant;\n classNames?: ListClassNames;\n position: string;\n placement: ControlPlacement;\n}) {\n const inputRef = useRef<HTMLInputElement>(null);\n const { ids, naming } = useItemIds(item);\n const { inputProps, labelProps, isSelected, isDisabled, isPressed } = useRadio(\n { ...naming, children: item.children, value: item.value ?? '', isDisabled: item.disabled },\n state,\n inputRef,\n );\n return (\n <ControlItem\n {...view}\n item={item}\n ids={ids}\n kind=\"radio\"\n inputProps={inputProps}\n inputRef={inputRef}\n labelProps={labelProps}\n isSelected={isSelected}\n isDisabled={isDisabled}\n isPressed={isPressed}\n placement={placement}\n />\n );\n}\n\n/**\n * An item that is a switch, checkbox or radio button (Compose's toggleable and selectable\n * `ListItem`s): the item is the input's `<label>`, so pressing anywhere on it changes it,\n * with the list item's state layer, shapes and selected colours. The drawn control only\n * shows the state.\n */\nfunction ControlItem({\n item,\n ids,\n kind,\n inputProps,\n inputRef,\n labelProps,\n isSelected,\n isDisabled,\n isPressed,\n placement,\n variant,\n classNames,\n position: itemPosition,\n}: {\n item: ListItemProps;\n ids: ItemIds;\n kind: 'switch' | 'checkbox' | 'radio';\n inputProps: InputHTMLAttributes<HTMLInputElement>;\n inputRef: RefObject<HTMLInputElement | null>;\n labelProps: LabelHTMLAttributes<HTMLLabelElement>;\n isSelected: boolean;\n isDisabled: boolean;\n isPressed: boolean;\n placement: ControlPlacement;\n variant?: ListVariant;\n classNames?: ListClassNames;\n position: string;\n}) {\n const ref = useRef<HTMLLabelElement>(null);\n const hiddenInputRef = useMemo(() => mergeRefs(inputRef, preventHiddenInputScroll), [inputRef]);\n const { interactionProps, dataAttributes, state } = useM3Interaction(\n { isDisabled, isPressed, isSelected, within: true },\n ref,\n );\n // Compose's shape precedence: pressed, then selected or focused (16px), then hovered (12px).\n const shape =\n (isPressed && !isDisabled) || isSelected || state.isFocusVisible\n ? 'active'\n : state.isHovered && !isDisabled\n ? 'hovered'\n : 'rest';\n const options = useContext(ListOptionsContext);\n const styles = itemStyles(item, variant, true, options);\n const controlState = {\n 'data-checked': isSelected || undefined,\n 'data-disabled': isDisabled || undefined,\n };\n return (\n <label\n {...mergeProps(labelProps, interactionProps)}\n {...dataAttributes}\n ref={ref}\n data-shape={shape}\n data-position={itemPosition}\n {...itemAttributes(variant)}\n className={styles.item({ class: cn(classNames?.item, item.className) })}\n >\n <VisuallyHidden elementType=\"span\">\n <input {...inputProps} ref={hiddenInputRef} />\n </VisuallyHidden>\n <span className={styles.cell()}>\n <ItemContent\n item={item}\n styles={styles}\n classNames={classNames}\n ids={ids}\n controlPlacement={placement}\n textHidden\n control={\n <span\n {...controlState}\n aria-hidden=\"true\"\n className={styles.control({ class: classNames?.control })}\n >\n {kind === 'radio' && <RadioRing />}\n {kind === 'checkbox' && <CheckboxBox />}\n {kind === 'switch' && <SwitchTrack selected={isSelected} icons={item.switchIcons} />}\n </span>\n }\n />\n </span>\n </label>\n );\n}\n\n/** A switch's track and thumb, at rest (the item, not the switch, takes the interaction). */\nfunction SwitchTrack({ selected, icons }: { selected: boolean; icons?: boolean }) {\n const styles = switchStyles();\n const icon = icons ? selected ? <CheckIcon /> : <CloseIcon /> : null;\n const { size, center } = thumbGeometry(selected, false, Boolean(icon));\n return (\n <span\n // The switch's component tokens, resolved on its track as on a Switch.\n data-tokens=\"md-comp-switch\"\n data-slot=\"track\"\n className={styles.control()}\n style={\n { '--m3-thumb-size': `${size}px`, '--m3-thumb-center': `${center}px` } as CSSProperties\n }\n >\n <SwitchThumb styles={styles} icon={icon} />\n </span>\n );\n}\n\n/**\n * The `ListItem` elements, flattened from arrays, with the keys they were given. `Children`\n * also unwraps lazy elements, which a server component's items can arrive as (Next's dev\n * server sends some that way), so they're never dropped from the server render.\n */\nfunction listItems(children: ReactNode): ReactElement<ListItemProps>[] {\n const items: ReactElement<ListItemProps>[] = [];\n Children.forEach(children, (node) => {\n if (isValidElement<ListItemProps>(node)) items.push(node);\n });\n return items;\n}\n\n/**\n * A link item: the item holds a real `<a>` on its headline, whose overlay covers the whole\n * item, so the item is the link (the browser's link menu and modified clicks included)\n * while buttons in its leading or trailing content stay separate controls, never nested in\n * the link. The link is named by the headline and described by the overline and supporting\n * text. React Aria's `useLink` routes a plain click through the `RouterProvider`; a disabled\n * item has no `href`.\n */\nfunction LinkItem({\n item,\n variant,\n classNames,\n position: itemPosition,\n isDisabled,\n}: {\n item: ListItemProps;\n variant?: ListVariant;\n classNames?: ListClassNames;\n position: string;\n isDisabled: boolean;\n}) {\n const itemRef = useRef<HTMLLIElement>(null);\n const linkRef = useRef<HTMLAnchorElement>(null);\n const { ids, naming } = useItemIds(item);\n const href = isDisabled ? undefined : item.href;\n const { linkProps, isPressed } = useLink(\n { href, target: item.target, isDisabled, elementType: 'a' },\n linkRef,\n );\n const { focusProps, isFocusVisible } = useFocusRing();\n const current = Boolean(item.current);\n const { interactionProps, dataAttributes, state } = useM3Interaction(\n { isDisabled, isPressed, isSelected: current },\n itemRef,\n );\n // Compose's shape precedence: pressed, then selected or focused (16px), then hovered (12px).\n const shape =\n (isPressed && !isDisabled) || current || isFocusVisible\n ? 'active'\n : state.isHovered && !isDisabled\n ? 'hovered'\n : 'rest';\n const options = useContext(ListOptionsContext);\n const styles = itemStyles(item, variant, true, options);\n const rel = item.rel ?? (item.target === '_blank' ? 'noopener noreferrer' : undefined);\n return (\n <li\n {...interactionProps}\n {...dataAttributes}\n // The link's focus, not a control's in the trailing content, focuses the item.\n data-focused={isFocusVisible || undefined}\n data-focus-visible={isFocusVisible || undefined}\n ref={itemRef}\n data-list-entry=\"\"\n data-shape={shape}\n data-position={itemPosition}\n {...itemAttributes(variant)}\n className={styles.item({ class: cn('relative', classNames?.item, item.className) })}\n >\n <span className={styles.cell()}>\n <ItemContent\n item={item}\n styles={styles}\n classNames={classNames}\n ids={ids}\n sideClassName={styles.raised()}\n headline={(children) => (\n <a\n {...mergeProps(linkProps, focusProps)}\n {...naming}\n ref={linkRef}\n href={href}\n target={item.target}\n rel={rel}\n download={item.download}\n aria-current={current ? 'page' : undefined}\n data-list-link=\"\"\n className={styles.link()}\n >\n {children}\n </a>\n )}\n />\n </span>\n </li>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkLA,SAAS,gBAAgB,OAAiC;CACxD,MAAM,QAAQ,WAAW,gBAAgB;CACzC,MAAM,QAAQ,WAAW,gBAAgB;CACzC,MAAM,QAAQ,WAAW,iBAAiB;CAC1C,IAAI,CAAC,OAAO,OAAO;CACnB,IAAI,OAAO,OAAO,oBAAC,eAAD;EAAe,MAAM;EAAc;EAAO,UAAU,MAAM;CAAW,CAAA;CACvF,IAAI,OAAO,OAAO,oBAAC,gBAAD;EAAgB,MAAM;EAAO,MAAM;EAAc;CAAQ,CAA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mBAAgB;EAChB,cAAY;EACZ,iBAAe;EACf,GAAI,eAAe,OAAO;EAC1B,WAAW,OAAO,KAAK,EAAE,OAAO,GAAG,YAAY,YAAY,MAAM,KAAK,SAAS,EAAE,CAAC;EAElF,UAAA,oBAAC,QAAD;GAAM,WAAW,OAAO,KAAK;GAC3B,UAAA,oBAAC,aAAD;IACQ;IACE;IACI;IACP;IACL,eAAe,OAAO,OAAO;IAC7B,WAAW,aACT,oBAAC,KAAD;KACE,GAAI,WAAW,WAAW,UAAU;KACpC,GAAI;KACJ,KAAK;KACC;KACN,QAAQ,KAAK;KACR;KACL,UAAU,KAAK;KACf,gBAAc,UAAU,SAAS,KAAA;KACjC,kBAAe;KACf,WAAW,OAAO,KAAK;KAEtB;IACA,CAAA;GAEN,CAAA;EACG,CAAA;CACJ,CAAA;AAER"}
@@ -0,0 +1,88 @@
1
+ import { RootDOMProps } from "../../utils/root-props.js";
2
+ import { CSSProperties, ReactNode, Ref } from "react";
3
+ //#region src/components/list/ListMedia.d.ts
4
+ /** The frame (`<span>`) takes the DOM attributes, as it takes `className`, `style` and `ref`. */
5
+ type FrameDOMProps = RootDOMProps<HTMLSpanElement> & {
6
+ [data: `data-${string}`]: string | number | boolean | undefined;
7
+ };
8
+ interface MediaImageProps extends FrameDOMProps {
9
+ /** The image. Without it, or when it fails to load, `fallback` shows. */
10
+ src?: string | undefined;
11
+ /** What the image shows; `""` when the headline already says it. */
12
+ alt: string;
13
+ /** Image candidates for responsive loading, as `<img srcset>`. */
14
+ srcSet?: string | undefined;
15
+ /** The image's display sizes for `srcSet`, as `<img sizes>`. */
16
+ sizes?: string | undefined;
17
+ /**
18
+ * Replaces the `<img>`, such as a framework's image component; the frame still sizes it
19
+ * and crops it to fill.
20
+ */
21
+ children?: ReactNode;
22
+ /** Shown with no `src` or when the image fails: an icon on `secondary-container`. */
23
+ fallback?: ReactNode;
24
+ /** Classes for the frame, merged after `classNames.media`; consumer classes win. */
25
+ className?: string;
26
+ /** The frame's inline styles. */
27
+ style?: CSSProperties | undefined;
28
+ /** The frame's id. */
29
+ id?: string | undefined;
30
+ /** Ref to the frame (`<span>`). */
31
+ ref?: Ref<HTMLSpanElement> | undefined;
32
+ }
33
+ export type ListItemImageProps = MediaImageProps;
34
+ export interface ListItemVideoProps extends MediaImageProps {
35
+ /** The video's length, in its corner ("2:41"). */
36
+ duration?: string;
37
+ /** M3's small (`sm`, 100 × 56dp) or large (`lg`, 114 × 64dp) thumbnail. @default "sm" */
38
+ size?: 'sm' | 'lg';
39
+ }
40
+ /**
41
+ * M3's leading image for a {@link ListItem}: a 56dp square with 8dp corners, cropped to
42
+ * fill, with a `fallback` (an icon) when there's no image or it fails to load. Change its
43
+ * shape with the list's `classNames.media` or `className`.
44
+ *
45
+ * @example
46
+ * <ListItem key="1" leading={<ListItemImage src={url} alt="" fallback={<ArticleIcon />} />}>
47
+ * Dinner at our place
48
+ * </ListItem>
49
+ */
50
+ export declare function ListItemImage({ className, style, id, ref, src, alt, srcSet, sizes, children, fallback, ...dom }: ListItemImageProps): import("react").JSX.Element;
51
+ /**
52
+ * M3's leading video for a {@link ListItem}: the video's thumbnail (not a player) with 8dp
53
+ * corners, 100 × 56dp or 114 × 64dp (`size="lg"`), with a play badge and its `duration`
54
+ * in the corner. Pressing it is pressing the item.
55
+ */
56
+ export declare function ListItemVideo({ className, style, id, ref, duration, size, src, alt, srcSet, sizes, children, fallback, ...dom }: ListItemVideoProps): import("react").JSX.Element;
57
+ export interface ListItemAvatarProps extends FrameDOMProps {
58
+ /** The person's photo. Without it, or when it fails to load, `children` show. */
59
+ src?: string | undefined;
60
+ /** What the photo shows; `""` (the default) when the headline names the person. */
61
+ alt?: string;
62
+ /** Image candidates for responsive loading, as `<img srcset>`. */
63
+ srcSet?: string | undefined;
64
+ /** The image's display sizes for `srcSet`, as `<img sizes>`. */
65
+ sizes?: string | undefined;
66
+ /** Initials or an icon, shown with no `src` or when the photo fails; hidden from assistive tech. */
67
+ children?: ReactNode;
68
+ /** Classes for the avatar's circle; consumer classes win. */
69
+ className?: string;
70
+ /** The frame's inline styles. */
71
+ style?: CSSProperties | undefined;
72
+ /** The frame's id. */
73
+ id?: string | undefined;
74
+ /** Ref to the frame (`<span>`). */
75
+ ref?: Ref<HTMLSpanElement> | undefined;
76
+ }
77
+ /**
78
+ * M3's leading avatar for a {@link ListItem}: a 40dp circle in `primary-container` holding
79
+ * a photo, cropped to fill, or initials in `title-medium` `on-primary-container`.
80
+ *
81
+ * @example
82
+ * <ListItem key="alex" leading={<ListItemAvatar src={photo}>AL</ListItemAvatar>}>
83
+ * Alex Lee
84
+ * </ListItem>
85
+ */
86
+ export declare function ListItemAvatar({ className, style, id, ref, alt, children, src, srcSet, sizes, ...dom }: ListItemAvatarProps): import("react").JSX.Element;
87
+ //#endregion
88
+ //# sourceMappingURL=ListMedia.d.ts.map
@@ -0,0 +1,132 @@
1
+ "use client";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { listMediaStyles } from "./list-styles.js";
4
+ import { createContext, useContext, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/list/ListMedia.tsx
7
+ /** What a {@link List} passes to the media in its items: `classNames.media`. */
8
+ const ListMediaContext = createContext(void 0);
9
+ function MediaImage({ src, alt, srcSet, sizes, children, fallback }) {
10
+ const [failed, setFailed] = useState(null);
11
+ if (children != null) return children;
12
+ if (src == null || failed === src) return fallback ?? null;
13
+ return /* @__PURE__ */ jsx("img", {
14
+ src,
15
+ alt,
16
+ srcSet,
17
+ sizes,
18
+ loading: "lazy",
19
+ decoding: "async",
20
+ ref: (img) => {
21
+ if (img?.complete && img.naturalWidth === 0) img.decode().catch(() => setFailed(src));
22
+ },
23
+ onError: () => setFailed(src)
24
+ });
25
+ }
26
+ /**
27
+ * M3's leading image for a {@link ListItem}: a 56dp square with 8dp corners, cropped to
28
+ * fill, with a `fallback` (an icon) when there's no image or it fails to load. Change its
29
+ * shape with the list's `classNames.media` or `className`.
30
+ *
31
+ * @example
32
+ * <ListItem key="1" leading={<ListItemImage src={url} alt="" fallback={<ArticleIcon />} />}>
33
+ * Dinner at our place
34
+ * </ListItem>
35
+ */
36
+ function ListItemImage({ className, style, id, ref, src, alt, srcSet, sizes, children, fallback, ...dom }) {
37
+ const media = useContext(ListMediaContext);
38
+ const image = {
39
+ src,
40
+ alt,
41
+ srcSet,
42
+ sizes,
43
+ children,
44
+ fallback
45
+ };
46
+ return /* @__PURE__ */ jsx("span", {
47
+ ...dom,
48
+ style,
49
+ id,
50
+ ref,
51
+ className: listMediaStyles({ kind: "image" }).frame({ class: cn(media, className) }),
52
+ children: /* @__PURE__ */ jsx(MediaImage, { ...image })
53
+ });
54
+ }
55
+ /**
56
+ * M3's leading video for a {@link ListItem}: the video's thumbnail (not a player) with 8dp
57
+ * corners, 100 × 56dp or 114 × 64dp (`size="lg"`), with a play badge and its `duration`
58
+ * in the corner. Pressing it is pressing the item.
59
+ */
60
+ function ListItemVideo({ className, style, id, ref, duration, size = "sm", src, alt, srcSet, sizes, children, fallback, ...dom }) {
61
+ const media = useContext(ListMediaContext);
62
+ const styles = listMediaStyles({
63
+ kind: "video",
64
+ size
65
+ });
66
+ const image = {
67
+ src,
68
+ alt,
69
+ srcSet,
70
+ sizes,
71
+ children,
72
+ fallback
73
+ };
74
+ return /* @__PURE__ */ jsxs("span", {
75
+ ...dom,
76
+ style,
77
+ id,
78
+ ref,
79
+ className: styles.frame({ class: cn(media, className) }),
80
+ children: [
81
+ /* @__PURE__ */ jsx(MediaImage, { ...image }),
82
+ /* @__PURE__ */ jsx("span", {
83
+ "aria-hidden": "true",
84
+ className: styles.badge(),
85
+ children: /* @__PURE__ */ jsx("svg", {
86
+ viewBox: "0 -960 960 960",
87
+ children: /* @__PURE__ */ jsx("path", { d: "M320-200v-560l440 280-440 280Z" })
88
+ })
89
+ }),
90
+ duration != null && /* @__PURE__ */ jsx("span", {
91
+ className: styles.duration(),
92
+ children: duration
93
+ })
94
+ ]
95
+ });
96
+ }
97
+ /**
98
+ * M3's leading avatar for a {@link ListItem}: a 40dp circle in `primary-container` holding
99
+ * a photo, cropped to fill, or initials in `title-medium` `on-primary-container`.
100
+ *
101
+ * @example
102
+ * <ListItem key="alex" leading={<ListItemAvatar src={photo}>AL</ListItemAvatar>}>
103
+ * Alex Lee
104
+ * </ListItem>
105
+ */
106
+ function ListItemAvatar({ className, style, id, ref, alt = "", children, src, srcSet, sizes, ...dom }) {
107
+ const media = useContext(ListMediaContext);
108
+ const image = {
109
+ src,
110
+ srcSet,
111
+ sizes
112
+ };
113
+ return /* @__PURE__ */ jsx("span", {
114
+ ...dom,
115
+ style,
116
+ id,
117
+ ref,
118
+ className: listMediaStyles({ kind: "avatar" }).frame({ class: cn(media, className) }),
119
+ children: /* @__PURE__ */ jsx(MediaImage, {
120
+ ...image,
121
+ alt,
122
+ fallback: children != null ? /* @__PURE__ */ jsx("span", {
123
+ "aria-hidden": "true",
124
+ children
125
+ }) : null
126
+ })
127
+ });
128
+ }
129
+ //#endregion
130
+ export { ListItemAvatar, ListItemImage, ListItemVideo, ListMediaContext };
131
+
132
+ //# sourceMappingURL=ListMedia.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListMedia.js","names":[],"sources":["../../../src/components/list/ListMedia.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n useState,\n type CSSProperties,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport type { RootDOMProps } from '../../utils/root-props';\nimport { listMediaStyles } from './list-styles';\n\n/** What a {@link List} passes to the media in its items: `classNames.media`. */\nexport const ListMediaContext = createContext<string | undefined>(undefined);\n\n/** The frame (`<span>`) takes the DOM attributes, as it takes `className`, `style` and `ref`. */\ntype FrameDOMProps = RootDOMProps<HTMLSpanElement> & {\n [data: `data-${string}`]: string | number | boolean | undefined;\n};\n\ninterface MediaImageProps extends FrameDOMProps {\n /** The image. Without it, or when it fails to load, `fallback` shows. */\n src?: string | undefined;\n /** What the image shows; `\"\"` when the headline already says it. */\n alt: string;\n /** Image candidates for responsive loading, as `<img srcset>`. */\n srcSet?: string | undefined;\n /** The image's display sizes for `srcSet`, as `<img sizes>`. */\n sizes?: string | undefined;\n /**\n * Replaces the `<img>`, such as a framework's image component; the frame still sizes it\n * and crops it to fill.\n */\n children?: ReactNode;\n /** Shown with no `src` or when the image fails: an icon on `secondary-container`. */\n fallback?: ReactNode;\n /** Classes for the frame, merged after `classNames.media`; consumer classes win. */\n className?: string;\n /** The frame's inline styles. */\n style?: CSSProperties | undefined;\n /** The frame's id. */\n id?: string | undefined;\n /** Ref to the frame (`<span>`). */\n ref?: Ref<HTMLSpanElement> | undefined;\n}\n\nexport type ListItemImageProps = MediaImageProps;\n\nexport interface ListItemVideoProps extends MediaImageProps {\n /** The video's length, in its corner (\"2:41\"). */\n duration?: string;\n /** M3's small (`sm`, 100 × 56dp) or large (`lg`, 114 × 64dp) thumbnail. @default \"sm\" */\n size?: 'sm' | 'lg';\n}\n\ninterface ImageSource {\n src?: string | undefined;\n alt: string;\n srcSet?: string | undefined;\n sizes?: string | undefined;\n children?: ReactNode;\n fallback?: ReactNode;\n}\n\nfunction MediaImage({ src, alt, srcSet, sizes, children, fallback }: ImageSource) {\n const [failed, setFailed] = useState<string | null>(null);\n if (children != null) return children;\n if (src == null || failed === src) return fallback ?? null;\n return (\n <img\n src={src}\n alt={alt}\n srcSet={srcSet}\n sizes={sizes}\n loading=\"lazy\"\n decoding=\"async\"\n // An image that failed before hydration never fires `onError` here, so check on mount.\n // `decode()` confirms it: an SVG with no size also has no natural width, yet decodes.\n ref={(img) => {\n if (img?.complete && img.naturalWidth === 0) {\n img.decode().catch(() => setFailed(src));\n }\n }}\n onError={() => setFailed(src)}\n />\n );\n}\n\n/**\n * M3's leading image for a {@link ListItem}: a 56dp square with 8dp corners, cropped to\n * fill, with a `fallback` (an icon) when there's no image or it fails to load. Change its\n * shape with the list's `classNames.media` or `className`.\n *\n * @example\n * <ListItem key=\"1\" leading={<ListItemImage src={url} alt=\"\" fallback={<ArticleIcon />} />}>\n * Dinner at our place\n * </ListItem>\n */\nexport function ListItemImage({\n className,\n style,\n id,\n ref,\n src,\n alt,\n srcSet,\n sizes,\n children,\n fallback,\n ...dom\n}: ListItemImageProps) {\n const media = useContext(ListMediaContext);\n const image = { src, alt, srcSet, sizes, children, fallback };\n return (\n <span\n {...dom}\n style={style}\n id={id}\n ref={ref}\n className={listMediaStyles({ kind: 'image' }).frame({ class: cn(media, className) })}\n >\n <MediaImage {...image} />\n </span>\n );\n}\n\n/**\n * M3's leading video for a {@link ListItem}: the video's thumbnail (not a player) with 8dp\n * corners, 100 × 56dp or 114 × 64dp (`size=\"lg\"`), with a play badge and its `duration`\n * in the corner. Pressing it is pressing the item.\n */\nexport function ListItemVideo({\n className,\n style,\n id,\n ref,\n duration,\n size = 'sm',\n src,\n alt,\n srcSet,\n sizes,\n children,\n fallback,\n ...dom\n}: ListItemVideoProps) {\n const media = useContext(ListMediaContext);\n const styles = listMediaStyles({ kind: 'video', size });\n const image = { src, alt, srcSet, sizes, children, fallback };\n return (\n <span\n {...dom}\n style={style}\n id={id}\n ref={ref}\n className={styles.frame({ class: cn(media, className) })}\n >\n <MediaImage {...image} />\n <span aria-hidden=\"true\" className={styles.badge()}>\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"M320-200v-560l440 280-440 280Z\" />\n </svg>\n </span>\n {duration != null && <span className={styles.duration()}>{duration}</span>}\n </span>\n );\n}\n\nexport interface ListItemAvatarProps extends FrameDOMProps {\n /** The person's photo. Without it, or when it fails to load, `children` show. */\n src?: string | undefined;\n /** What the photo shows; `\"\"` (the default) when the headline names the person. */\n alt?: string;\n /** Image candidates for responsive loading, as `<img srcset>`. */\n srcSet?: string | undefined;\n /** The image's display sizes for `srcSet`, as `<img sizes>`. */\n sizes?: string | undefined;\n /** Initials or an icon, shown with no `src` or when the photo fails; hidden from assistive tech. */\n children?: ReactNode;\n /** Classes for the avatar's circle; consumer classes win. */\n className?: string;\n /** The frame's inline styles. */\n style?: CSSProperties | undefined;\n /** The frame's id. */\n id?: string | undefined;\n /** Ref to the frame (`<span>`). */\n ref?: Ref<HTMLSpanElement> | undefined;\n}\n\n/**\n * M3's leading avatar for a {@link ListItem}: a 40dp circle in `primary-container` holding\n * a photo, cropped to fill, or initials in `title-medium` `on-primary-container`.\n *\n * @example\n * <ListItem key=\"alex\" leading={<ListItemAvatar src={photo}>AL</ListItemAvatar>}>\n * Alex Lee\n * </ListItem>\n */\nexport function ListItemAvatar({\n className,\n style,\n id,\n ref,\n alt = '',\n children,\n src,\n srcSet,\n sizes,\n ...dom\n}: ListItemAvatarProps) {\n const media = useContext(ListMediaContext);\n const image = { src, srcSet, sizes };\n return (\n <span\n {...dom}\n style={style}\n id={id}\n ref={ref}\n className={listMediaStyles({ kind: 'avatar' }).frame({ class: cn(media, className) })}\n >\n <MediaImage\n {...image}\n alt={alt}\n fallback={children != null ? <span aria-hidden=\"true\">{children}</span> : null}\n />\n </span>\n );\n}\n"],"mappings":";;;;;;;AAeA,MAAa,mBAAmB,cAAkC,KAAA,CAAS;AAmD3E,SAAS,WAAW,EAAE,KAAK,KAAK,QAAQ,OAAO,UAAU,YAAyB;CAChF,MAAM,CAAC,QAAQ,aAAa,SAAwB,IAAI;CACxD,IAAI,YAAY,MAAM,OAAO;CAC7B,IAAI,OAAO,QAAQ,WAAW,KAAK,OAAO,YAAY;CACtD,OACE,oBAAC,OAAD;EACO;EACA;EACG;EACD;EACP,SAAQ;EACR,UAAS;EAGT,MAAM,QAAQ;GACZ,IAAI,KAAK,YAAY,IAAI,iBAAiB,GACxC,IAAI,OAAO,CAAC,CAAC,YAAY,UAAU,GAAG,CAAC;EAE3C;EACA,eAAe,UAAU,GAAG;CAC7B,CAAA;AAEL;;;;;;;;;;;AAYA,SAAgB,cAAc,EAC5B,WACA,OACA,IACA,KACA,KACA,KACA,QACA,OACA,UACA,UACA,GAAG,OACkB;CACrB,MAAM,QAAQ,WAAW,gBAAgB;CACzC,M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