@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,1386 @@
1
+ "use client";
2
+ import { densityAttribute } from "../../tokens/density.js";
3
+ import { cn } from "../../utils/cn.js";
4
+ import { useM3Interaction } from "../../primitives/use-m3-interaction.js";
5
+ import { TouchTarget } from "../../primitives/TouchTarget.js";
6
+ import { mergeDataTokens } from "../../utils/merge-data-tokens.js";
7
+ import { warnOnce } from "../../utils/warn-once.js";
8
+ import { DomDirectionLocale } from "../../primitives/DomDirectionLocale.js";
9
+ import { FOCUSABLE_DISABLED_OPTIONS } from "../../utils/focusable-disabled.js";
10
+ import { assertCollectionChildren } from "../../utils/assert-collection-children.js";
11
+ import { useNearestReveal } from "../../utils/nearest-reveal.js";
12
+ import { splitRootProps } from "../../utils/root-props.js";
13
+ import { preventHiddenInputScroll } from "../../primitives/hidden-input-focus.js";
14
+ import { CheckboxBox } from "../checkbox/checkbox-box.js";
15
+ import { RadioRing } from "../radio/radio-ring.js";
16
+ import { switchStyles } from "../switch/switch-styles.js";
17
+ import { CheckIcon, CloseIcon, SwitchThumb, thumbGeometry } from "../switch/switch-thumb.js";
18
+ import { useKeepPressedInPlace } from "../../utils/keep-pressed-in-place.js";
19
+ import { listStyles } from "./list-styles.js";
20
+ import { ListMediaContext } from "./ListMedia.js";
21
+ import { Children, createContext, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
22
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
23
+ import { VisuallyHidden, mergeProps, mergeRefs, useButton, useCheckbox, useFocusRing, useGridList, useGridListItem, useGridListSection, useHover, useLink, useListBox, useListBoxSection, useObjectRef, useOption, useRadio, useRadioGroup, useTree, useTreeItem } from "react-aria";
24
+ import { useListState, useRadioGroupState, useToggleState, useTreeState } from "react-stately";
25
+ //#region src/components/list/List.tsx
26
+ /**
27
+ * A `ListItem` renders itself only in a plain or radio list, which hand it its place through
28
+ * context. Interactive lists read its props through `getCollectionNode` and never render it.
29
+ */
30
+ function ListItemElement(props) {
31
+ const entry = useContext(ListEntryContext);
32
+ const radio = useContext(RadioListContext);
33
+ const plain = useContext(StaticListContext);
34
+ if (!entry) return null;
35
+ if (radio) return /* @__PURE__ */ jsx(RadioListItem, {
36
+ item: props,
37
+ radio,
38
+ position: entry.position
39
+ });
40
+ if (plain) return /* @__PURE__ */ jsx(StaticListItem, {
41
+ item: props,
42
+ list: plain,
43
+ entry
44
+ });
45
+ return null;
46
+ }
47
+ /**
48
+ * Describes the item to React Stately's collection builder, as its `Item` does: the
49
+ * headline is the item's content, and `childItems` are its nested items.
50
+ */
51
+ ListItemElement.getCollectionNode = function* getCollectionNode(props) {
52
+ const rendered = props.children;
53
+ const textValue = props.textValue || (typeof rendered === "string" ? rendered : "") || props["aria-label"] || "";
54
+ if (!textValue) warnOnce("list-item-text-value", "[@windmorph/react] A ListItem whose headline is not plain text needs a textValue for type-ahead.");
55
+ const children = listItems(props.childItems);
56
+ yield {
57
+ type: "item",
58
+ props,
59
+ rendered,
60
+ textValue,
61
+ "aria-label": props["aria-label"],
62
+ hasChildNodes: children.length > 0,
63
+ *childNodes() {
64
+ for (const element of children) yield {
65
+ type: "item",
66
+ element
67
+ };
68
+ }
69
+ };
70
+ };
71
+ /**
72
+ * An item of a {@link List}. Like React Stately's collection `Item`, the list reads its
73
+ * props; identify it with a React `key`.
74
+ */
75
+ const ListItem = ListItemElement;
76
+ /**
77
+ * A `ListSection` renders itself only in a plain list: its subheader, and its items, each
78
+ * told through context that it sits in this section and where. Interactive lists read it
79
+ * through `getCollectionNode`. It never needs its type compared, so a section created in a
80
+ * Server Component (whose type reaches the client as a lazy client reference) renders the
81
+ * same as one created in the browser.
82
+ */
83
+ function ListSectionElement(props) {
84
+ const entry = useContext(ListEntryContext);
85
+ const plain = useContext(StaticListContext);
86
+ if (useContext(RadioListContext)) throw new Error("[@windmorph/react] List: a radio list can't hold ListSections. Use one radio list per group, or a list with selectionMode=\"single\".");
87
+ const register = plain?.registerSection;
88
+ const index = entry?.index;
89
+ useLayoutEffect(() => {
90
+ if (register == null || index == null || entry?.inSection) return void 0;
91
+ return register(index);
92
+ }, [
93
+ register,
94
+ index,
95
+ entry?.inSection
96
+ ]);
97
+ if (!plain || !entry) return null;
98
+ const items = listItems(props.children);
99
+ return /* @__PURE__ */ jsx(StaticSection, {
100
+ section: props,
101
+ variant: plain.variant,
102
+ classNames: plain.classNames,
103
+ children: items.map((item, itemIndex) => /* @__PURE__ */ jsx(ListEntryContext, {
104
+ value: {
105
+ index: itemIndex,
106
+ position: position(itemIndex, items.length),
107
+ inSection: true,
108
+ disabled: plain.isKeyDisabled(item.key)
109
+ },
110
+ children: item
111
+ }, item.key ?? itemIndex))
112
+ });
113
+ }
114
+ /** Describes the section to React Stately's collection builder, as its `Section` does. */
115
+ ListSectionElement.getCollectionNode = function* getCollectionNode(props) {
116
+ const children = listItems(props.children);
117
+ yield {
118
+ type: "section",
119
+ props,
120
+ rendered: props.title,
121
+ "aria-label": props["aria-label"],
122
+ hasChildNodes: true,
123
+ *childNodes() {
124
+ for (const element of children) yield {
125
+ type: "item",
126
+ element
127
+ };
128
+ }
129
+ };
130
+ };
131
+ /**
132
+ * A labelled group of items in a {@link List}, under a subheader (`title`). Identify it with
133
+ * a React `key`, like its items. Arrow keys move across sections as through one list.
134
+ * Sections go in static, action (grid) and selection (list box) lists, not in radio lists
135
+ * or lists with `childItems`.
136
+ *
137
+ * @example
138
+ * <List aria-label="Settings" onAction={open}>
139
+ * <ListSection key="network" title="Network">
140
+ * <ListItem key="wifi">Wi‑Fi</ListItem>
141
+ * </ListSection>
142
+ * </List>
143
+ */
144
+ const ListSection = ListSectionElement;
145
+ const ListOptionsContext = createContext({});
146
+ /**
147
+ * M3 Expressive list: items with a headline, optional overline and supporting text, and
148
+ * leading and trailing content, flush (standard) or segmented into rounded groups.
149
+ *
150
+ * With `selectionMode` it is a list box of options (`listbox` / `option`), and selected items
151
+ * show a check. With `onAction` or links it is an interactive grid list, where ← / → reach
152
+ * trailing controls. Items with `childItems` expand and collapse (a tree grid). Interactive
153
+ * items get state layers and morph their corners on hover, focus, press and selection, and
154
+ * ↑ / ↓ move between them, wrapping at the ends. Otherwise it is a plain `ul`.
155
+ *
156
+ * Items can lead with M3's image or video thumbnail (`ListItemImage`, `ListItemVideo`),
157
+ * limit their lines (`headlineLines`, `supportingTextLines`), and standard lists can draw
158
+ * `dividers`.
159
+ *
160
+ * @example
161
+ * <List variant="segmented" aria-label="Settings" onAction={open}>
162
+ * <ListItem key="wifi" leading={<WifiIcon />} supportingText="Connected">Wi‑Fi</ListItem>
163
+ * <ListItem key="bluetooth" leading={<BluetoothIcon />}>Bluetooth</ListItem>
164
+ * </List>
165
+ */
166
+ function List({ density, ...props }) {
167
+ const { headlineLines, supportingTextLines, dividers, selectionIndicator, classNames } = props;
168
+ if (dividers != null && props.variant === "segmented") throw new Error("[@windmorph/react] List: dividers are for standard lists; segmented items are already apart.");
169
+ return /* @__PURE__ */ jsx(ListOptionsContext, {
170
+ value: {
171
+ headlineLines,
172
+ supportingTextLines,
173
+ dividers,
174
+ selectionIndicator
175
+ },
176
+ children: /* @__PURE__ */ jsx(ListMediaContext, {
177
+ value: classNames?.media,
178
+ children: /* @__PURE__ */ jsx(ListBody, {
179
+ ...props,
180
+ ...densityAttribute(density)
181
+ })
182
+ })
183
+ });
184
+ }
185
+ const RADIO_ITEM_ERROR = "[@windmorph/react] List: every item of a radio list (one with value, defaultValue or onChange) needs a value, and none can have a control or an href.";
186
+ const CONTROL_ERROR = "[@windmorph/react] List: switch and checkbox items (control) can't be in a list with onAction, links, selectionMode or childItems. Put them in their own list, or put a Switch in an item's trailing content.";
187
+ const EXPANDABLE_SECTIONS_ERROR = "[@windmorph/react] List: a list with childItems can't hold ListSections; nest the groups as expandable items instead.";
188
+ /**
189
+ * Picks the list's kind from its own props and its top-level entries' props; it never looks
190
+ * at an entry's element type. A plain or radio list renders its entries, which place
191
+ * themselves through context (`ListEntryContext`); an interactive list hands them to React
192
+ * Stately's collection builder, which reads each through its `getCollectionNode`.
193
+ */
194
+ function ListBody(props) {
195
+ const entries = listItems(props.children);
196
+ if (props.value !== void 0 || props.defaultValue !== void 0 || props.onChange !== void 0) return /* @__PURE__ */ jsx(RadioList, {
197
+ ...props,
198
+ entries
199
+ });
200
+ const selectable = props.selectionMode != null && props.selectionMode !== "none";
201
+ const expandable = entries.some((entry) => listItems(entry.props.childItems).length > 0);
202
+ if (!(props.onAction != null || selectable || expandable)) return /* @__PURE__ */ jsx(StaticList, {
203
+ ...props,
204
+ entries
205
+ });
206
+ return /* @__PURE__ */ jsx(InteractiveList, {
207
+ ...props,
208
+ expandable
209
+ });
210
+ }
211
+ function itemLines(item) {
212
+ const extra = Number(item.overline != null) + Number(item.supportingText != null);
213
+ return extra === 2 ? 3 : extra === 1 ? 2 : 1;
214
+ }
215
+ function itemStylesOptions(item, variant, interactive, options) {
216
+ const headlineLines = item.headlineLines ?? options.headlineLines;
217
+ const supportingTextLines = item.supportingTextLines ?? options.supportingTextLines;
218
+ return {
219
+ variant,
220
+ interactive,
221
+ lines: itemLines(item),
222
+ ...item.verticalAlignment && { align: item.verticalAlignment },
223
+ ...options.dividers && { dividers: options.dividers },
224
+ ...headlineLines && { headlineLines },
225
+ ...supportingTextLines && { supportingTextLines }
226
+ };
227
+ }
228
+ function itemStyles(item, variant, interactive, options) {
229
+ return listStyles(itemStylesOptions(item, variant, interactive, options));
230
+ }
231
+ /**
232
+ * The component tokens' hooks (`list-tokens.ts`), on a list's root and on each item, so an
233
+ * item's own state (`data-selected`) picks its colours. On the root, any set the app passed
234
+ * (`props`) follows the list's own.
235
+ */
236
+ function tokenAttributes(variant, props) {
237
+ return {
238
+ "data-tokens": mergeDataTokens("md-comp-list", props),
239
+ "data-variant": variant ?? "standard"
240
+ };
241
+ }
242
+ /** An item's token hooks and its `data-slot`. */
243
+ function itemAttributes(variant) {
244
+ return {
245
+ ...tokenAttributes(variant),
246
+ "data-slot": "item"
247
+ };
248
+ }
249
+ function position(index, count) {
250
+ if (count === 1) return "only";
251
+ if (index === 0) return "first";
252
+ return index === count - 1 ? "last" : "middle";
253
+ }
254
+ function ItemContent({ item, styles, classNames, ids, control, controlPlacement, headline, sideClassName, end, textHidden }) {
255
+ const leading = controlPlacement === "start" ? control : null;
256
+ const trailing = controlPlacement === "end" ? control : end;
257
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
258
+ (item.leading != null || leading != null) && /* @__PURE__ */ jsxs("span", {
259
+ ref: (cell) => hideDecorativeIcons(cell),
260
+ "data-slot": "leading",
261
+ className: styles.leading({ class: cn(sideClassName, classNames?.leading) }),
262
+ children: [leading, item.leading]
263
+ }),
264
+ /* @__PURE__ */ jsxs("span", {
265
+ "aria-hidden": textHidden || void 0,
266
+ className: styles.text({ class: classNames?.text }),
267
+ children: [
268
+ item.overline != null && /* @__PURE__ */ jsx("span", {
269
+ id: ids?.overline,
270
+ "data-slot": "overline",
271
+ className: styles.overline({ class: classNames?.overline }),
272
+ children: item.overline
273
+ }),
274
+ /* @__PURE__ */ jsx("span", {
275
+ id: ids?.headline,
276
+ "data-slot": "headline",
277
+ className: styles.headline({ class: classNames?.headline }),
278
+ children: headline ? headline(item.children) : item.children
279
+ }),
280
+ item.supportingText != null && /* @__PURE__ */ jsx("span", {
281
+ id: ids?.supporting,
282
+ "data-slot": "supporting",
283
+ className: styles.supporting({ class: classNames?.supportingText }),
284
+ children: item.supportingText
285
+ })
286
+ ]
287
+ }),
288
+ (item.trailing != null || trailing != null) && /* @__PURE__ */ jsxs("span", {
289
+ ref: (cell) => hideDecorativeIcons(cell),
290
+ "data-slot": "trailing",
291
+ className: styles.trailing({ class: cn(sideClassName, classNames?.trailing) }),
292
+ children: [item.trailing, trailing]
293
+ })
294
+ ] });
295
+ }
296
+ /**
297
+ * Hides the bare icons of an item's leading or trailing content from assistive tech: an
298
+ * `<svg>` child with no name of its own (`aria-label`, `aria-labelledby`, `role`, `<title>`)
299
+ * is decorative, since the item's text names the item, and would otherwise be listed as an
300
+ * unnamed image. A ref callback, so it also reaches icons that components render; it runs
301
+ * on every render (no layout reads), so a replaced icon is hidden too.
302
+ */
303
+ function hideDecorativeIcons(cell) {
304
+ if (!cell) return;
305
+ for (const svg of cell.querySelectorAll(":scope > svg")) {
306
+ if (svg.hasAttribute("aria-label") || svg.hasAttribute("aria-labelledby") || svg.hasAttribute("role") || svg.querySelector(":scope > title")) continue;
307
+ svg.setAttribute("aria-hidden", "true");
308
+ }
309
+ }
310
+ const StaticListContext = createContext(null);
311
+ const ListEntryContext = createContext(null);
312
+ /**
313
+ * The positions of a plain list's top-level entries: each run of items between sections is
314
+ * its own group. Sections are known once they've told the list (`registerSection`); before
315
+ * that (the server render and the first client render) every entry counts as an item.
316
+ */
317
+ function entryPositions(count, sections) {
318
+ const positions = [];
319
+ let start = 0;
320
+ for (let index = 0; index <= count; index += 1) {
321
+ if (index < count && !sections.has(index)) continue;
322
+ for (let item = start; item < index; item += 1) positions[item] = position(item - start, index - start);
323
+ if (index < count) positions[index] = "only";
324
+ start = index + 1;
325
+ }
326
+ return positions;
327
+ }
328
+ function StaticList({ variant, disabled, classNames, className, style, ref, entries, ...rest }) {
329
+ const { root: data } = splitRootProps(rest);
330
+ const rootTokens = tokenAttributes(variant, data);
331
+ const { "aria-label": label, "aria-labelledby": labelledBy } = rest;
332
+ const root = listStyles({ variant }).root({ class: cn(classNames?.root, className) });
333
+ const [sections, setSections] = useState(() => /* @__PURE__ */ new Set());
334
+ const registerSection = useCallback((index) => {
335
+ setSections((current) => current.has(index) ? current : new Set(current).add(index));
336
+ return () => setSections((current) => {
337
+ const next = new Set(current);
338
+ next.delete(index);
339
+ return next;
340
+ });
341
+ }, []);
342
+ const disabledKeys = rest.disabledKeys;
343
+ const list = useMemo(() => {
344
+ const keys = new Set(disabledKeys ?? []);
345
+ return {
346
+ variant,
347
+ classNames,
348
+ isKeyDisabled: (key) => Boolean(disabled) || key != null && keys.has(key),
349
+ registerSection
350
+ };
351
+ }, [
352
+ variant,
353
+ classNames,
354
+ disabled,
355
+ disabledKeys,
356
+ registerSection
357
+ ]);
358
+ const positions = entryPositions(entries.length, sections);
359
+ return /* @__PURE__ */ jsx("ul", {
360
+ ...data,
361
+ ...rootTokens,
362
+ id: rest.id,
363
+ ref,
364
+ style,
365
+ "aria-label": label,
366
+ "aria-labelledby": labelledBy,
367
+ onKeyDown: onLinkArrowKeys,
368
+ className: root,
369
+ children: /* @__PURE__ */ jsx(StaticListContext, {
370
+ value: list,
371
+ children: entries.map((entry, index) => /* @__PURE__ */ jsx(ListEntryContext, {
372
+ value: {
373
+ index,
374
+ position: positions[index],
375
+ inSection: false,
376
+ disabled: list.isKeyDisabled(entry.key)
377
+ },
378
+ children: entry
379
+ }, entry.key ?? index))
380
+ })
381
+ });
382
+ }
383
+ /** An item of a plain list: a link, a switch or checkbox, or a plain row. */
384
+ function StaticListItem({ item, list, entry }) {
385
+ const options = useContext(ListOptionsContext);
386
+ if (entry.inSection && listItems(item.childItems).length > 0) throw new Error(EXPANDABLE_SECTIONS_ERROR);
387
+ const { variant, classNames } = list;
388
+ const isDisabled = Boolean(entry.disabled || item.disabled);
389
+ if (item.href != null) return /* @__PURE__ */ jsx(LinkItem, {
390
+ item,
391
+ variant,
392
+ classNames,
393
+ position: entry.position,
394
+ isDisabled
395
+ });
396
+ if (item.control != null) return /* @__PURE__ */ jsx("li", {
397
+ "data-list-entry": "",
398
+ children: /* @__PURE__ */ jsx(ToggleItem, {
399
+ item,
400
+ control: item.control,
401
+ variant,
402
+ classNames,
403
+ position: entry.position,
404
+ listDisabled: isDisabled
405
+ })
406
+ });
407
+ const styles = itemStyles(item, variant, false, options);
408
+ return /* @__PURE__ */ jsx("li", {
409
+ "data-list-entry": "",
410
+ "data-shape": "rest",
411
+ "data-position": entry.position,
412
+ ...itemAttributes(variant),
413
+ className: styles.item({ class: cn(classNames?.item, item.className) }),
414
+ children: /* @__PURE__ */ jsx("span", {
415
+ className: styles.cell(),
416
+ children: /* @__PURE__ */ jsx(ItemContent, {
417
+ item,
418
+ styles,
419
+ classNames
420
+ })
421
+ })
422
+ });
423
+ }
424
+ /**
425
+ * Arrow keys between a list's links (M3: "navigate within the list using arrow keys"):
426
+ * ↑ / ↓ move focus to the previous or next link, wrapping at the ends, and Home / End to
427
+ * the first and last. Each link stays a real anchor and a Tab stop; disabled items have no
428
+ * link and are skipped.
429
+ */
430
+ function onLinkArrowKeys(event) {
431
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
432
+ if (![
433
+ "ArrowUp",
434
+ "ArrowDown",
435
+ "Home",
436
+ "End"
437
+ ].includes(event.key)) return;
438
+ const links = [...event.currentTarget.querySelectorAll("a[href][data-list-link]")];
439
+ const index = links.indexOf(event.target);
440
+ if (index === -1) return;
441
+ const last = links.length - 1;
442
+ const target = event.key === "Home" ? 0 : event.key === "End" ? last : event.key === "ArrowDown" ? index === last ? 0 : index + 1 : index === 0 ? last : index - 1;
443
+ event.preventDefault();
444
+ links[target].focus();
445
+ }
446
+ /** The collection's top-level nodes as groups: each section, and each run of items. */
447
+ function groupNodes(collection) {
448
+ const groups = [];
449
+ for (const node of collection) {
450
+ if (node.type === "section") {
451
+ const items = [...collection.getChildren(node.key)].filter((child) => child.type === "item");
452
+ groups.push({
453
+ section: node,
454
+ items
455
+ });
456
+ continue;
457
+ }
458
+ const last = groups.at(-1);
459
+ if (last?.section === null) last.items.push(node);
460
+ else groups.push({
461
+ section: null,
462
+ items: [node]
463
+ });
464
+ }
465
+ return groups;
466
+ }
467
+ /** The name of a section's group: its `aria-label`, else its subheader. */
468
+ function sectionNaming(section, headingId) {
469
+ return section["aria-label"] != null ? { "aria-label": section["aria-label"] } : { "aria-labelledby": headingId };
470
+ }
471
+ /** A section of a plain list: a subheader and a nested list named by it. */
472
+ function StaticSection({ section, variant, classNames, children }) {
473
+ const headingId = useId();
474
+ const styles = listStyles({
475
+ variant,
476
+ titled: section.title != null
477
+ });
478
+ return /* @__PURE__ */ jsxs("li", {
479
+ "data-slot": "section",
480
+ className: styles.section({ class: cn(classNames?.section, section.className) }),
481
+ children: [section.title != null && /* @__PURE__ */ jsx("div", {
482
+ id: headingId,
483
+ className: styles.subheader({ class: classNames?.subheader }),
484
+ children: section.title
485
+ }), /* @__PURE__ */ jsx("ul", {
486
+ ...sectionNaming(section, headingId),
487
+ className: styles.group(),
488
+ children
489
+ })]
490
+ });
491
+ }
492
+ function InteractiveList(props) {
493
+ return /* @__PURE__ */ jsx(DomDirectionLocale, { children: (directionRef) => /* @__PURE__ */ jsx(CollectionList, {
494
+ ...props,
495
+ directionRef
496
+ }) });
497
+ }
498
+ /** Material Symbols "check" and "expand_more" (Apache-2.0). */
499
+ function CheckIcon20() {
500
+ return /* @__PURE__ */ jsx("svg", {
501
+ viewBox: "0 -960 960 960",
502
+ fill: "currentColor",
503
+ "aria-hidden": "true",
504
+ focusable: "false",
505
+ children: /* @__PURE__ */ jsx("path", { d: "M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z" })
506
+ });
507
+ }
508
+ function ExpandMoreIcon() {
509
+ return /* @__PURE__ */ jsx("svg", {
510
+ viewBox: "0 -960 960 960",
511
+ "aria-hidden": "true",
512
+ focusable: "false",
513
+ children: /* @__PURE__ */ jsx("path", { d: "M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z" })
514
+ });
515
+ }
516
+ /**
517
+ * A grid list (`onAction`, links), a list box (selection) or a tree grid (`childItems`),
518
+ * from React Aria's collection hooks. Arrow keys wrap at the ends, as M3 asks.
519
+ */
520
+ function CollectionList({ expandable, variant, disabled, deselectable = true, classNames, className, style, ref, directionRef, ...rest }) {
521
+ const { root: data, rest: ariaProps } = splitRootProps(rest);
522
+ assertCollectionChildren(rest.children, "List", "ListItem elements");
523
+ const scan = useCollectionScan(rest.children);
524
+ if (scan.items.some((item) => item.control != null)) throw new Error(CONTROL_ERROR);
525
+ if (expandable && scan.sectioned) throw new Error(EXPANDABLE_SECTIONS_ERROR);
526
+ const selectable = rest.selectionMode != null && rest.selectionMode !== "none";
527
+ const kind = expandable ? "tree" : selectable && rest.onAction == null && !scan.items.some((item) => item.href != null) ? "listbox" : "grid";
528
+ const disabledKeys = new Set(rest.disabledKeys ?? []);
529
+ for (const [key, item] of scan.entries) if (disabled || item.disabled) disabledKeys.add(key);
530
+ const root = {
531
+ options: {
532
+ ...ariaProps,
533
+ disabledKeys: disabledKeys.size > 0 ? disabledKeys : rest.disabledKeys,
534
+ disallowEmptySelection: !deselectable,
535
+ ...FOCUSABLE_DISABLED_OPTIONS,
536
+ shouldFocusWrap: true
537
+ },
538
+ listRef: ref,
539
+ directionRef,
540
+ data: {
541
+ ...data,
542
+ ...tokenAttributes(variant, data)
543
+ },
544
+ style,
545
+ className: listStyles({ variant }).root({ class: cn(classNames?.root, className) }),
546
+ variant,
547
+ classNames
548
+ };
549
+ if (kind === "tree") return /* @__PURE__ */ jsx(TreeList, { ...root });
550
+ if (kind === "listbox") return /* @__PURE__ */ jsx(ListBoxList, { ...root });
551
+ return /* @__PURE__ */ jsx(GridList, { ...root });
552
+ }
553
+ function GridList({ options, listRef, directionRef, data, style, className, variant, classNames }) {
554
+ const rootRef = useObjectRef(listRef);
555
+ const state = useListState(options);
556
+ const { gridProps } = useGridList(options, state, rootRef);
557
+ useNearestReveal(rootRef);
558
+ return /* @__PURE__ */ jsx("div", {
559
+ ...mergeProps(data, gridProps),
560
+ ref: (element) => {
561
+ rootRef.current = element;
562
+ directionRef(element);
563
+ },
564
+ style,
565
+ className,
566
+ children: groupNodes(state.collection).map((group) => {
567
+ const rows = group.items.map((node, index) => /* @__PURE__ */ jsx(GridListRow, {
568
+ node,
569
+ state,
570
+ variant,
571
+ classNames,
572
+ position: position(index, group.items.length)
573
+ }, node.key));
574
+ return group.section ? /* @__PURE__ */ jsx(GridListSection, {
575
+ node: group.section,
576
+ state,
577
+ variant,
578
+ classNames,
579
+ children: rows
580
+ }, group.section.key) : rows;
581
+ })
582
+ });
583
+ }
584
+ /**
585
+ * A section of a grid list: a row group named by its subheader, a header row holding a row
586
+ * header (React Aria's `GridListSection` structure), then the items' rows.
587
+ */
588
+ function GridListSection({ node, state, variant, classNames, children }) {
589
+ const ref = useRef(null);
590
+ const section = node.props;
591
+ const { rowProps, rowHeaderProps, rowGroupProps } = useGridListSection({ "aria-label": section["aria-label"] }, state, ref);
592
+ const styles = listStyles({
593
+ variant,
594
+ titled: section.title != null
595
+ });
596
+ return /* @__PURE__ */ jsxs("div", {
597
+ ...rowGroupProps,
598
+ ...section["aria-label"] != null && { "aria-labelledby": void 0 },
599
+ ref,
600
+ className: styles.section({ class: cn(classNames?.section, section.className) }),
601
+ children: [section.title != null && /* @__PURE__ */ jsx("div", {
602
+ ...rowProps,
603
+ children: /* @__PURE__ */ jsx("div", {
604
+ ...rowHeaderProps,
605
+ className: styles.subheader({ class: classNames?.subheader }),
606
+ children: section.title
607
+ })
608
+ }), /* @__PURE__ */ jsx("div", {
609
+ role: "presentation",
610
+ className: styles.group(),
611
+ children
612
+ })]
613
+ });
614
+ }
615
+ /** Compose's shape precedence: pressed, then selected or focused (16px), then hovered (12px). */
616
+ function shapeOf(state) {
617
+ if (state.isPressed && !state.isDisabled || state.isSelected || state.isFocusVisible) return "active";
618
+ return state.isHovered && !state.isDisabled ? "hovered" : "rest";
619
+ }
620
+ /** The check a selected item shows at its end, when the list selects and shows it. */
621
+ function useSelectionCheck(styles, selectable, className) {
622
+ const { selectionIndicator = true } = useContext(ListOptionsContext);
623
+ if (!selectable || !selectionIndicator) return null;
624
+ return /* @__PURE__ */ jsx("span", {
625
+ "aria-hidden": "true",
626
+ "data-selection-indicator": "",
627
+ className: styles.selectionIndicator({ class: className }),
628
+ children: /* @__PURE__ */ jsx(CheckIcon20, {})
629
+ });
630
+ }
631
+ function GridListRow({ node, state, variant, classNames, position: itemPosition }) {
632
+ const item = node.props;
633
+ const ref = useRef(null);
634
+ const { rowProps: ownRowProps, gridCellProps, descriptionProps, isPressed, isSelected } = useGridListItem({ node }, state, ref);
635
+ const isDisabled = state.disabledKeys.has(node.key);
636
+ const rowProps = isDisabled ? focusOnly(ownRowProps) : ownRowProps;
637
+ const { hoverProps, isHovered } = useHover({ isDisabled });
638
+ const { interactionProps, dataAttributes } = useM3Interaction({
639
+ isDisabled,
640
+ isPressed
641
+ }, ref);
642
+ const shape = shapeOf({
643
+ isPressed,
644
+ isSelected,
645
+ isFocusVisible: dataAttributes["data-focus-visible"] != null,
646
+ isHovered,
647
+ isDisabled
648
+ });
649
+ const styles = itemStyles(item, variant, true, useContext(ListOptionsContext));
650
+ const check = useSelectionCheck(styles, state.selectionManager.selectionMode !== "none", classNames?.selectionIndicator);
651
+ return /* @__PURE__ */ jsx("div", {
652
+ ...mergeProps(rowProps, hoverProps, interactionProps),
653
+ ...dataAttributes,
654
+ "aria-disabled": isDisabled || void 0,
655
+ ref,
656
+ "data-selected": isSelected || void 0,
657
+ "data-shape": shape,
658
+ "data-position": itemPosition,
659
+ ...itemAttributes(variant),
660
+ className: styles.item({ class: cn(classNames?.item, item.className) }),
661
+ children: /* @__PURE__ */ jsx("div", {
662
+ ...gridCellProps,
663
+ className: styles.cell(),
664
+ children: /* @__PURE__ */ jsx(ItemContent, {
665
+ item,
666
+ styles,
667
+ classNames,
668
+ ids: { supporting: descriptionProps.id },
669
+ end: check
670
+ })
671
+ })
672
+ });
673
+ }
674
+ const FOCUSABLE = "a[href], button, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])";
675
+ /**
676
+ * A disabled item's props: its role, ARIA, id, tab index and focus handlers, but no press, key
677
+ * or pointer handlers, so it takes focus (APG) and does nothing else.
678
+ */
679
+ function focusOnly(props) {
680
+ return Object.fromEntries(Object.entries(props).filter(([name]) => !/^on[A-Z]/.test(name) || name === "onFocus" || name === "onBlur"));
681
+ }
682
+ /** A list box of options: M3's single- and multi-select lists on the web. */
683
+ function ListBoxList({ options, listRef, directionRef, data, style, className, variant, classNames }) {
684
+ const rootRef = useObjectRef(listRef);
685
+ const listBoxOptions = options;
686
+ const state = useListState(listBoxOptions);
687
+ const { listBoxProps } = useListBox(listBoxOptions, state, rootRef);
688
+ useNearestReveal(rootRef);
689
+ return /* @__PURE__ */ jsx("div", {
690
+ ...mergeProps(data, listBoxProps),
691
+ ref: (element) => {
692
+ rootRef.current = element;
693
+ directionRef(element);
694
+ },
695
+ style,
696
+ className,
697
+ children: groupNodes(state.collection).map((group) => {
698
+ const rows = group.items.map((node, index) => /* @__PURE__ */ jsx(OptionRow, {
699
+ node,
700
+ state,
701
+ variant,
702
+ classNames,
703
+ position: position(index, group.items.length)
704
+ }, node.key));
705
+ return group.section ? /* @__PURE__ */ jsx(ListBoxSection, {
706
+ node: group.section,
707
+ variant,
708
+ classNames,
709
+ children: rows
710
+ }, group.section.key) : rows;
711
+ })
712
+ });
713
+ }
714
+ /** A section of a list box: a subheader and a group of options named by it. */
715
+ function ListBoxSection({ node, variant, classNames, children }) {
716
+ const section = node.props;
717
+ const { itemProps, headingProps, groupProps } = useListBoxSection({
718
+ heading: section.title,
719
+ "aria-label": section["aria-label"]
720
+ });
721
+ const styles = listStyles({
722
+ variant,
723
+ titled: section.title != null
724
+ });
725
+ return /* @__PURE__ */ jsxs("div", {
726
+ ...itemProps,
727
+ className: styles.section({ class: cn(classNames?.section, section.className) }),
728
+ children: [section.title != null && /* @__PURE__ */ jsx("div", {
729
+ ...headingProps,
730
+ className: styles.subheader({ class: classNames?.subheader }),
731
+ children: section.title
732
+ }), /* @__PURE__ */ jsx("div", {
733
+ ...groupProps,
734
+ ...section["aria-label"] != null && { "aria-labelledby": void 0 },
735
+ className: styles.group(),
736
+ children
737
+ })]
738
+ });
739
+ }
740
+ function OptionRow({ node, state, variant, classNames, position: itemPosition }) {
741
+ const item = node.props;
742
+ const ref = useRef(null);
743
+ const { optionProps: ownOptionProps, isPressed, isSelected } = useOption({ key: node.key }, state, ref);
744
+ const isDisabled = state.disabledKeys.has(node.key);
745
+ const optionProps = isDisabled ? {
746
+ ...focusOnly(ownOptionProps),
747
+ "aria-disabled": true
748
+ } : ownOptionProps;
749
+ const { hoverProps, isHovered } = useHover({ isDisabled });
750
+ const { interactionProps, dataAttributes } = useM3Interaction({
751
+ isDisabled,
752
+ isPressed
753
+ }, ref);
754
+ const shape = shapeOf({
755
+ isPressed,
756
+ isSelected,
757
+ isFocusVisible: dataAttributes["data-focus-visible"] != null,
758
+ isHovered,
759
+ isDisabled
760
+ });
761
+ const styles = itemStyles(item, variant, true, useContext(ListOptionsContext));
762
+ const check = useSelectionCheck(styles, true, classNames?.selectionIndicator);
763
+ useEffect(() => {
764
+ if (process.env.NODE_ENV === "production") return;
765
+ const nested = ref.current?.querySelector(FOCUSABLE);
766
+ if (nested) console.warn("[@windmorph/react] List: an item of a selection list is one option and must not hold buttons, links or fields. Give the list onAction to keep separate trailing actions.", nested);
767
+ });
768
+ return /* @__PURE__ */ jsx("div", {
769
+ ...mergeProps(optionProps, hoverProps, interactionProps),
770
+ ...dataAttributes,
771
+ "aria-labelledby": void 0,
772
+ "aria-describedby": void 0,
773
+ ref,
774
+ "data-selected": isSelected || void 0,
775
+ "data-shape": shape,
776
+ "data-position": itemPosition,
777
+ ...itemAttributes(variant),
778
+ className: styles.item({ class: cn(classNames?.item, item.className) }),
779
+ children: /* @__PURE__ */ jsx("span", {
780
+ className: styles.cell(),
781
+ children: /* @__PURE__ */ jsx(ItemContent, {
782
+ item,
783
+ styles,
784
+ classNames,
785
+ end: check
786
+ })
787
+ })
788
+ });
789
+ }
790
+ /** A tree grid: items with `childItems` expand and collapse to show their nested items. */
791
+ function TreeList({ options, listRef, directionRef, data, style, className, variant, classNames }) {
792
+ const rootRef = useObjectRef(listRef);
793
+ const treeOptions = options;
794
+ const state = useTreeState(treeOptions);
795
+ const { gridProps } = useTree(treeOptions, state, rootRef);
796
+ const { shown, onExited, version } = useRowPresence([...state.collection.getKeys()].map((key) => state.collection.getItem(key)).filter((node) => node?.type === "item"));
797
+ const { capture, release } = useKeepPressedInPlace("[role=row]", version, shown.some((row) => row.exiting));
798
+ const reveal = listStyles({ variant });
799
+ return /* @__PURE__ */ jsx("div", {
800
+ ...mergeProps(data, gridProps, {
801
+ onPointerDownCapture: capture,
802
+ onKeyDownCapture: capture,
803
+ onPointerUpCapture: release,
804
+ onKeyUpCapture: release,
805
+ onClickCapture: (event) => {
806
+ if (event.detail === 0) capture(event);
807
+ release();
808
+ }
809
+ }),
810
+ ref: (element) => {
811
+ rootRef.current = element;
812
+ directionRef(element);
813
+ },
814
+ style,
815
+ className,
816
+ children: shown.map((row) => /* @__PURE__ */ jsx(TreeRowReveal, {
817
+ row,
818
+ onExited,
819
+ className: reveal.reveal(),
820
+ clipClassName: reveal.revealClip(),
821
+ children: row.exiting ? /* @__PURE__ */ jsx(TreeRowGhost, {
822
+ node: row.node,
823
+ selectable: state.selectionManager.selectionMode !== "none",
824
+ variant,
825
+ classNames,
826
+ position: row.position
827
+ }) : /* @__PURE__ */ jsx(TreeRow, {
828
+ node: row.node,
829
+ state,
830
+ variant,
831
+ classNames,
832
+ position: row.position
833
+ })
834
+ }, row.node.key))
835
+ });
836
+ }
837
+ /** Whether the reader asks for reduced motion (read on a change, never on the server). */
838
+ const prefersReducedMotion = () => typeof window !== "undefined" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false);
839
+ /**
840
+ * The rows to render: the tree's visible rows, plus rows that just left it (a collapsed
841
+ * item's nested rows) in their old place until their closing transition ends. Rows added
842
+ * after the first render are marked to open in.
843
+ */
844
+ function useRowPresence(rows) {
845
+ const live = (node, index, appear) => ({
846
+ node,
847
+ position: position(index, rows.length),
848
+ appear,
849
+ exiting: false
850
+ });
851
+ const keys = rows.map((node) => node.key);
852
+ const [presence, setPresence] = useState(() => ({
853
+ keys,
854
+ shown: rows.map((node, index) => live(node, index, false))
855
+ }));
856
+ let { shown } = presence;
857
+ if (keys.length !== presence.keys.length || keys.some((key, i) => key !== presence.keys[i])) {
858
+ const indexOf = new Map(rows.map((node, index) => [node.key, index]));
859
+ const before = new Map(shown.map((row) => [row.node.key, row]));
860
+ const next = [];
861
+ let cursor = 0;
862
+ const takeUpTo = (end) => {
863
+ for (; cursor <= end; cursor += 1) {
864
+ const node = rows[cursor];
865
+ const previous = before.get(node.key);
866
+ next.push(live(node, cursor, previous ? previous.appear : true));
867
+ }
868
+ };
869
+ for (const row of shown) {
870
+ const index = indexOf.get(row.node.key);
871
+ if (index === void 0) next.push({
872
+ ...row,
873
+ exiting: true
874
+ });
875
+ else if (index >= cursor) takeUpTo(index);
876
+ }
877
+ takeUpTo(rows.length - 1);
878
+ shown = next.some((row) => !row.exiting && !before.has(row.node.key)) && next.some((row) => row.exiting) && prefersReducedMotion() ? next.filter((row) => !row.exiting) : next;
879
+ setPresence({
880
+ keys,
881
+ shown
882
+ });
883
+ }
884
+ const onExited = useCallback((key) => setPresence((current) => ({
885
+ ...current,
886
+ shown: current.shown.filter((row) => !(row.exiting && row.node.key === key))
887
+ })), []);
888
+ const current = new Map(rows.map((node) => [node.key, node]));
889
+ return {
890
+ shown: shown.map((row) => row.exiting ? row : {
891
+ ...row,
892
+ node: current.get(row.node.key)
893
+ }),
894
+ onExited,
895
+ /** Changes whenever the rows shown change. */
896
+ version: presence
897
+ };
898
+ }
899
+ /**
900
+ * A tree row's wrapper, which opens its height and fades it in when the row appears, and
901
+ * closes it when the row leaves, then lets it go. Nothing in a leaving row can be focused
902
+ * or read.
903
+ */
904
+ function TreeRowReveal({ row, onExited, className, clipClassName, children }) {
905
+ const ref = useRef(null);
906
+ const { exiting, node } = row;
907
+ useEffect(() => {
908
+ if (!exiting) return;
909
+ const transitions = ref.current?.getAnimations?.() ?? [];
910
+ if (transitions.length === 0) {
911
+ onExited(node.key);
912
+ return;
913
+ }
914
+ let current = true;
915
+ Promise.allSettled(transitions.map((transition) => transition.finished)).then(() => {
916
+ if (current) onExited(node.key);
917
+ });
918
+ return () => {
919
+ current = false;
920
+ };
921
+ }, [
922
+ exiting,
923
+ node.key,
924
+ onExited
925
+ ]);
926
+ return /* @__PURE__ */ jsx("div", {
927
+ ref,
928
+ "data-appear": row.appear || void 0,
929
+ "data-exiting": exiting || void 0,
930
+ inert: exiting || void 0,
931
+ className,
932
+ children: /* @__PURE__ */ jsx("div", {
933
+ className: clipClassName,
934
+ children
935
+ })
936
+ });
937
+ }
938
+ /** A leaving row's picture while it closes: the row at rest, hidden from assistive tech. */
939
+ function TreeRowGhost({ node, selectable, variant, classNames, position: itemPosition }) {
940
+ const item = node.props;
941
+ const options = useContext(ListOptionsContext);
942
+ const styles = listStyles({
943
+ ...itemStylesOptions(item, variant, true, options),
944
+ nested: node.level > 0
945
+ });
946
+ const check = useSelectionCheck(styles, selectable, classNames?.selectionIndicator);
947
+ const chevron = node.hasChildNodes && /* @__PURE__ */ jsx("span", {
948
+ className: styles.expand({ class: classNames?.expandButton }),
949
+ children: /* @__PURE__ */ jsx(ExpandMoreIcon, {})
950
+ });
951
+ return /* @__PURE__ */ jsx("div", {
952
+ "aria-hidden": "true",
953
+ style: { "--m3-list-level": node.level },
954
+ "data-shape": "rest",
955
+ "data-position": itemPosition,
956
+ ...itemAttributes(variant),
957
+ className: styles.item({ class: cn(classNames?.item, item.className) }),
958
+ children: /* @__PURE__ */ jsx("div", {
959
+ className: styles.cell(),
960
+ children: /* @__PURE__ */ jsx(ItemContent, {
961
+ item,
962
+ styles,
963
+ classNames,
964
+ end: check || chevron ? /* @__PURE__ */ jsxs(Fragment$1, { children: [check, chevron] }) : null
965
+ })
966
+ })
967
+ });
968
+ }
969
+ /**
970
+ * React Aria's tree item reads a row's siblings (for `aria-posinset` and `aria-setsize`)
971
+ * through `collection.getChildren` and each sibling's `nextKey`, which React Stately's
972
+ * `TreeCollection` doesn't provide: its `nextKey` and `index` follow the visible rows, as
973
+ * keyboard navigation needs. While the row's hook runs, this gives the collection the
974
+ * nested items' own order, and the returned function restores it. React Aria keys its
975
+ * per-list data by the state object, so the state itself has to be the one patched.
976
+ */
977
+ function withSiblingOrder(state, node) {
978
+ const collection = state.collection;
979
+ const visibleItem = collection.getItem.bind(collection);
980
+ const siblingsOf = (parentKey) => (parentKey == null ? [...collection] : [...visibleItem(parentKey)?.childNodes ?? []]).filter((sibling) => sibling.type === "item");
981
+ const inSiblingOrder = (item) => {
982
+ const siblings = siblingsOf(item.parentKey);
983
+ const index = siblings.findIndex((sibling) => sibling.key === item.key);
984
+ return {
985
+ ...item,
986
+ index,
987
+ nextKey: siblings[index + 1]?.key ?? null
988
+ };
989
+ };
990
+ collection.getItem = (key) => {
991
+ const item = visibleItem(key);
992
+ return item ? inSiblingOrder(item) : null;
993
+ };
994
+ collection.getChildren = (key) => siblingsOf(key).map(inSiblingOrder);
995
+ return {
996
+ node: inSiblingOrder(node),
997
+ restore: () => {
998
+ delete collection.getItem;
999
+ delete collection.getChildren;
1000
+ }
1001
+ };
1002
+ }
1003
+ function ExpandButton({ props, className }) {
1004
+ const ref = useRef(null);
1005
+ const { buttonProps, isPressed } = useButton(props, ref);
1006
+ const { interactionProps, dataAttributes } = useM3Interaction({
1007
+ isDisabled: props.isDisabled,
1008
+ isPressed
1009
+ }, ref);
1010
+ return /* @__PURE__ */ jsxs("button", {
1011
+ ...mergeProps(buttonProps, interactionProps),
1012
+ ...dataAttributes,
1013
+ ref,
1014
+ className,
1015
+ children: [/* @__PURE__ */ jsx(TouchTarget, { className: "h-[min(48px,calc(56px+var(--md-sys-density,0)*4px))]" }), /* @__PURE__ */ jsx(ExpandMoreIcon, {})]
1016
+ });
1017
+ }
1018
+ function TreeRow({ node, state, variant, classNames, position: itemPosition }) {
1019
+ const item = node.props;
1020
+ const ref = useRef(null);
1021
+ const siblingOrder = withSiblingOrder(state, node);
1022
+ const { rowProps, gridCellProps, descriptionProps, expandButtonProps, isPressed, isSelected } = useTreeItem({
1023
+ node: siblingOrder.node,
1024
+ hasChildItems: node.hasChildNodes
1025
+ }, state, ref);
1026
+ siblingOrder.restore();
1027
+ const isDisabled = state.disabledKeys.has(node.key);
1028
+ const { hoverProps, isHovered } = useHover({ isDisabled });
1029
+ const { interactionProps, dataAttributes } = useM3Interaction({
1030
+ isDisabled,
1031
+ isPressed
1032
+ }, ref);
1033
+ const shape = shapeOf({
1034
+ isPressed,
1035
+ isSelected,
1036
+ isFocusVisible: dataAttributes["data-focus-visible"] != null,
1037
+ isHovered,
1038
+ isDisabled
1039
+ });
1040
+ const options = useContext(ListOptionsContext);
1041
+ const styles = listStyles({
1042
+ ...itemStylesOptions(item, variant, true, options),
1043
+ nested: node.level > 0
1044
+ });
1045
+ const check = useSelectionCheck(styles, state.selectionManager.selectionMode !== "none", classNames?.selectionIndicator);
1046
+ const end = check != null || node.hasChildNodes ? /* @__PURE__ */ jsxs(Fragment$1, { children: [check, node.hasChildNodes && /* @__PURE__ */ jsx(ExpandButton, {
1047
+ props: {
1048
+ ...expandButtonProps,
1049
+ isDisabled
1050
+ },
1051
+ className: styles.expand({ class: classNames?.expandButton })
1052
+ })] }) : null;
1053
+ return /* @__PURE__ */ jsx("div", {
1054
+ ...mergeProps(isDisabled ? focusOnly(rowProps) : rowProps, hoverProps, interactionProps),
1055
+ ...dataAttributes,
1056
+ "aria-disabled": isDisabled || void 0,
1057
+ ref,
1058
+ style: { "--m3-list-level": node.level },
1059
+ "data-selected": isSelected || void 0,
1060
+ "data-shape": shape,
1061
+ "data-position": itemPosition,
1062
+ ...itemAttributes(variant),
1063
+ className: styles.item({ class: cn(classNames?.item, item.className) }),
1064
+ children: /* @__PURE__ */ jsx("div", {
1065
+ ...gridCellProps,
1066
+ className: styles.cell(),
1067
+ children: /* @__PURE__ */ jsx(ItemContent, {
1068
+ item,
1069
+ styles,
1070
+ classNames,
1071
+ ids: { supporting: descriptionProps.id },
1072
+ end
1073
+ })
1074
+ })
1075
+ });
1076
+ }
1077
+ /**
1078
+ * The items of an interactive list's collection, as React Stately's collection builder reads
1079
+ * them (each entry describes itself through `getCollectionNode`), top-level and in sections,
1080
+ * and whether it has sections. The list picks its kind and its disabled keys from these.
1081
+ */
1082
+ function useCollectionScan(children) {
1083
+ const { collection } = useListState({ children });
1084
+ return useMemo(() => {
1085
+ const entries = [];
1086
+ let sectioned = false;
1087
+ for (const node of collection) if (node.type === "section") {
1088
+ sectioned = true;
1089
+ for (const child of collection.getChildren(node.key)) if (child.type === "item") entries.push([child.key, child.props]);
1090
+ } else if (node.type === "item") entries.push([node.key, node.props]);
1091
+ return {
1092
+ entries,
1093
+ items: entries.map(([, item]) => item),
1094
+ sectioned
1095
+ };
1096
+ }, [collection]);
1097
+ }
1098
+ /** Ids that name an item that is a control (its headline) and describe it (the rest). */
1099
+ function useItemIds(item) {
1100
+ const id = useId();
1101
+ const ids = {
1102
+ headline: `${id}-headline`,
1103
+ ...item.overline != null && { overline: `${id}-overline` },
1104
+ ...item.supportingText != null && { supporting: `${id}-supporting` }
1105
+ };
1106
+ const described = [ids.overline, ids.supporting].filter(Boolean).join(" ");
1107
+ return {
1108
+ ids,
1109
+ naming: {
1110
+ ...item["aria-label"] != null ? { "aria-label": item["aria-label"] } : { "aria-labelledby": ids.headline },
1111
+ ...described && { "aria-describedby": described }
1112
+ }
1113
+ };
1114
+ }
1115
+ /** A switch or checkbox item: a visually hidden native input, the item as its label. */
1116
+ function ToggleItem({ item, control, listDisabled, ...view }) {
1117
+ const inputRef = useRef(null);
1118
+ const { ids, naming } = useItemIds(item);
1119
+ const isDisabled = Boolean(listDisabled || item.disabled);
1120
+ const options = {
1121
+ ...naming,
1122
+ children: item.children,
1123
+ isSelected: item.checked,
1124
+ defaultSelected: item.defaultChecked,
1125
+ onChange: item.onCheckedChange,
1126
+ isDisabled,
1127
+ name: item.name,
1128
+ value: item.value
1129
+ };
1130
+ const state = useToggleState(options);
1131
+ const { inputProps, labelProps, isSelected, isPressed } = useCheckbox(options, state, inputRef);
1132
+ return /* @__PURE__ */ jsx(ControlItem, {
1133
+ ...view,
1134
+ item,
1135
+ ids,
1136
+ kind: control,
1137
+ inputProps: control === "switch" ? {
1138
+ ...inputProps,
1139
+ role: "switch"
1140
+ } : inputProps,
1141
+ inputRef,
1142
+ labelProps,
1143
+ isSelected,
1144
+ isDisabled,
1145
+ isPressed,
1146
+ placement: item.controlPlacement ?? (control === "switch" ? "end" : "start")
1147
+ });
1148
+ }
1149
+ function RadioList({ variant, classNames, className, style, ref, value, defaultValue, onChange, name, required, disabled, controlPlacement = "start", entries, ...rest }) {
1150
+ const { root: data } = splitRootProps(rest);
1151
+ const { "aria-label": label, "aria-labelledby": labelledBy } = rest;
1152
+ const options = {
1153
+ id: rest.id,
1154
+ "aria-label": label,
1155
+ "aria-labelledby": labelledBy,
1156
+ value,
1157
+ defaultValue,
1158
+ onChange,
1159
+ name,
1160
+ isRequired: required,
1161
+ isDisabled: disabled
1162
+ };
1163
+ const state = useRadioGroupState(options);
1164
+ const { radioGroupProps } = useRadioGroup(options, state);
1165
+ return /* @__PURE__ */ jsx("div", {
1166
+ ...mergeProps(data, radioGroupProps),
1167
+ ...tokenAttributes(variant, data),
1168
+ ref,
1169
+ style,
1170
+ className: listStyles({ variant }).root({ class: cn(classNames?.root, className) }),
1171
+ children: /* @__PURE__ */ jsx(RadioListContext, {
1172
+ value: {
1173
+ state,
1174
+ variant,
1175
+ classNames,
1176
+ controlPlacement
1177
+ },
1178
+ children: entries.map((entry, index) => /* @__PURE__ */ jsx(ListEntryContext, {
1179
+ value: {
1180
+ index,
1181
+ position: position(index, entries.length),
1182
+ inSection: false,
1183
+ disabled: false
1184
+ },
1185
+ children: entry
1186
+ }, entry.key ?? index))
1187
+ })
1188
+ });
1189
+ }
1190
+ const RadioListContext = createContext(null);
1191
+ /** An item of a radio list: a radio button with the item's `value`. */
1192
+ function RadioListItem({ item, radio, position: itemPosition }) {
1193
+ if (item.value == null || item.control != null || item.href != null) throw new Error(RADIO_ITEM_ERROR);
1194
+ return /* @__PURE__ */ jsx(RadioItem, {
1195
+ item,
1196
+ state: radio.state,
1197
+ variant: radio.variant,
1198
+ classNames: radio.classNames,
1199
+ position: itemPosition,
1200
+ placement: item.controlPlacement ?? radio.controlPlacement
1201
+ });
1202
+ }
1203
+ function RadioItem({ item, state, placement, ...view }) {
1204
+ const inputRef = useRef(null);
1205
+ const { ids, naming } = useItemIds(item);
1206
+ const { inputProps, labelProps, isSelected, isDisabled, isPressed } = useRadio({
1207
+ ...naming,
1208
+ children: item.children,
1209
+ value: item.value ?? "",
1210
+ isDisabled: item.disabled
1211
+ }, state, inputRef);
1212
+ return /* @__PURE__ */ jsx(ControlItem, {
1213
+ ...view,
1214
+ item,
1215
+ ids,
1216
+ kind: "radio",
1217
+ inputProps,
1218
+ inputRef,
1219
+ labelProps,
1220
+ isSelected,
1221
+ isDisabled,
1222
+ isPressed,
1223
+ placement
1224
+ });
1225
+ }
1226
+ /**
1227
+ * An item that is a switch, checkbox or radio button (Compose's toggleable and selectable
1228
+ * `ListItem`s): the item is the input's `<label>`, so pressing anywhere on it changes it,
1229
+ * with the list item's state layer, shapes and selected colours. The drawn control only
1230
+ * shows the state.
1231
+ */
1232
+ function ControlItem({ item, ids, kind, inputProps, inputRef, labelProps, isSelected, isDisabled, isPressed, placement, variant, classNames, position: itemPosition }) {
1233
+ const ref = useRef(null);
1234
+ const hiddenInputRef = useMemo(() => mergeRefs(inputRef, preventHiddenInputScroll), [inputRef]);
1235
+ const { interactionProps, dataAttributes, state } = useM3Interaction({
1236
+ isDisabled,
1237
+ isPressed,
1238
+ isSelected,
1239
+ within: true
1240
+ }, ref);
1241
+ const shape = isPressed && !isDisabled || isSelected || state.isFocusVisible ? "active" : state.isHovered && !isDisabled ? "hovered" : "rest";
1242
+ const styles = itemStyles(item, variant, true, useContext(ListOptionsContext));
1243
+ const controlState = {
1244
+ "data-checked": isSelected || void 0,
1245
+ "data-disabled": isDisabled || void 0
1246
+ };
1247
+ return /* @__PURE__ */ jsxs("label", {
1248
+ ...mergeProps(labelProps, interactionProps),
1249
+ ...dataAttributes,
1250
+ ref,
1251
+ "data-shape": shape,
1252
+ "data-position": itemPosition,
1253
+ ...itemAttributes(variant),
1254
+ className: styles.item({ class: cn(classNames?.item, item.className) }),
1255
+ children: [/* @__PURE__ */ jsx(VisuallyHidden, {
1256
+ elementType: "span",
1257
+ children: /* @__PURE__ */ jsx("input", {
1258
+ ...inputProps,
1259
+ ref: hiddenInputRef
1260
+ })
1261
+ }), /* @__PURE__ */ jsx("span", {
1262
+ className: styles.cell(),
1263
+ children: /* @__PURE__ */ jsx(ItemContent, {
1264
+ item,
1265
+ styles,
1266
+ classNames,
1267
+ ids,
1268
+ controlPlacement: placement,
1269
+ textHidden: true,
1270
+ control: /* @__PURE__ */ jsxs("span", {
1271
+ ...controlState,
1272
+ "aria-hidden": "true",
1273
+ className: styles.control({ class: classNames?.control }),
1274
+ children: [
1275
+ kind === "radio" && /* @__PURE__ */ jsx(RadioRing, {}),
1276
+ kind === "checkbox" && /* @__PURE__ */ jsx(CheckboxBox, {}),
1277
+ kind === "switch" && /* @__PURE__ */ jsx(SwitchTrack, {
1278
+ selected: isSelected,
1279
+ icons: item.switchIcons
1280
+ })
1281
+ ]
1282
+ })
1283
+ })
1284
+ })]
1285
+ });
1286
+ }
1287
+ /** A switch's track and thumb, at rest (the item, not the switch, takes the interaction). */
1288
+ function SwitchTrack({ selected, icons }) {
1289
+ const styles = switchStyles();
1290
+ const icon = icons ? selected ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CloseIcon, {}) : null;
1291
+ const { size, center } = thumbGeometry(selected, false, Boolean(icon));
1292
+ return /* @__PURE__ */ jsx("span", {
1293
+ "data-tokens": "md-comp-switch",
1294
+ "data-slot": "track",
1295
+ className: styles.control(),
1296
+ style: {
1297
+ "--m3-thumb-size": `${size}px`,
1298
+ "--m3-thumb-center": `${center}px`
1299
+ },
1300
+ children: /* @__PURE__ */ jsx(SwitchThumb, {
1301
+ styles,
1302
+ icon
1303
+ })
1304
+ });
1305
+ }
1306
+ /**
1307
+ * The `ListItem` elements, flattened from arrays, with the keys they were given. `Children`
1308
+ * also unwraps lazy elements, which a server component's items can arrive as (Next's dev
1309
+ * server sends some that way), so they're never dropped from the server render.
1310
+ */
1311
+ function listItems(children) {
1312
+ const items = [];
1313
+ Children.forEach(children, (node) => {
1314
+ if (isValidElement(node)) items.push(node);
1315
+ });
1316
+ return items;
1317
+ }
1318
+ /**
1319
+ * A link item: the item holds a real `<a>` on its headline, whose overlay covers the whole
1320
+ * item, so the item is the link (the browser's link menu and modified clicks included)
1321
+ * while buttons in its leading or trailing content stay separate controls, never nested in
1322
+ * the link. The link is named by the headline and described by the overline and supporting
1323
+ * text. React Aria's `useLink` routes a plain click through the `RouterProvider`; a disabled
1324
+ * item has no `href`.
1325
+ */
1326
+ function LinkItem({ item, variant, classNames, position: itemPosition, isDisabled }) {
1327
+ const itemRef = useRef(null);
1328
+ const linkRef = useRef(null);
1329
+ const { ids, naming } = useItemIds(item);
1330
+ const href = isDisabled ? void 0 : item.href;
1331
+ const { linkProps, isPressed } = useLink({
1332
+ href,
1333
+ target: item.target,
1334
+ isDisabled,
1335
+ elementType: "a"
1336
+ }, linkRef);
1337
+ const { focusProps, isFocusVisible } = useFocusRing();
1338
+ const current = Boolean(item.current);
1339
+ const { interactionProps, dataAttributes, state } = useM3Interaction({
1340
+ isDisabled,
1341
+ isPressed,
1342
+ isSelected: current
1343
+ }, itemRef);
1344
+ const shape = isPressed && !isDisabled || current || isFocusVisible ? "active" : state.isHovered && !isDisabled ? "hovered" : "rest";
1345
+ const styles = itemStyles(item, variant, true, useContext(ListOptionsContext));
1346
+ const rel = item.rel ?? (item.target === "_blank" ? "noopener noreferrer" : void 0);
1347
+ return /* @__PURE__ */ jsx("li", {
1348
+ ...interactionProps,
1349
+ ...dataAttributes,
1350
+ "data-focused": isFocusVisible || void 0,
1351
+ "data-focus-visible": isFocusVisible || void 0,
1352
+ ref: itemRef,
1353
+ "data-list-entry": "",
1354
+ "data-shape": shape,
1355
+ "data-position": itemPosition,
1356
+ ...itemAttributes(variant),
1357
+ className: styles.item({ class: cn("relative", classNames?.item, item.className) }),
1358
+ children: /* @__PURE__ */ jsx("span", {
1359
+ className: styles.cell(),
1360
+ children: /* @__PURE__ */ jsx(ItemContent, {
1361
+ item,
1362
+ styles,
1363
+ classNames,
1364
+ ids,
1365
+ sideClassName: styles.raised(),
1366
+ headline: (children) => /* @__PURE__ */ jsx("a", {
1367
+ ...mergeProps(linkProps, focusProps),
1368
+ ...naming,
1369
+ ref: linkRef,
1370
+ href,
1371
+ target: item.target,
1372
+ rel,
1373
+ download: item.download,
1374
+ "aria-current": current ? "page" : void 0,
1375
+ "data-list-link": "",
1376
+ className: styles.link(),
1377
+ children
1378
+ })
1379
+ })
1380
+ })
1381
+ });
1382
+ }
1383
+ //#endregion
1384
+ export { List, ListItem, ListSection };
1385
+
1386
+ //# sourceMappingURL=List.js.map