@windmorph/react 0.0.0-stage → 0.1.1

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,38 @@
1
+ import { MaterialShapes } from "../shapes/material-shapes.js";
2
+ import { Morph } from "../shapes/morph.js";
3
+ import { morphToPath, polygonToPath } from "../shapes/path.js";
4
+ //#region src/primitives/morph-path.ts
5
+ const morphCache = /* @__PURE__ */ new WeakMap();
6
+ /** The (cached) morph between two shapes. */
7
+ function getMorph(from, to) {
8
+ let byEnd = morphCache.get(from);
9
+ if (!byEnd) morphCache.set(from, byEnd = /* @__PURE__ */ new WeakMap());
10
+ let morph = byEnd.get(to);
11
+ if (!morph) byEnd.set(to, morph = new Morph(from, to));
12
+ return morph;
13
+ }
14
+ const resolve = (shape) => typeof shape === "string" ? MaterialShapes[shape] : shape;
15
+ /**
16
+ * SVG path data for `shapes` at `progress`, where 0 is the first shape, 1 the second and so
17
+ * on. Values outside `[0, n - 1]` extrapolate the first or last morph, so springs can
18
+ * overshoot.
19
+ */
20
+ function morphPathAt(shapes, progress, { size = 1, startAngle = 0 } = {}) {
21
+ if (shapes.length === 0) return "";
22
+ if (shapes.length === 1) return polygonToPath(resolve(shapes[0]), {
23
+ scale: size,
24
+ startAngle
25
+ });
26
+ const index = Math.min(Math.max(Math.floor(progress), 0), shapes.length - 2);
27
+ const morph = getMorph(resolve(shapes[index]), resolve(shapes[index + 1]));
28
+ return morphToPath(morph, progress - index, {
29
+ scale: size,
30
+ startAngle,
31
+ rotationPivotX: .5,
32
+ rotationPivotY: .5
33
+ });
34
+ }
35
+ //#endregion
36
+ export { getMorph, morphPathAt };
37
+
38
+ //# sourceMappingURL=morph-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"morph-path.js","names":[],"sources":["../../src/primitives/morph-path.ts"],"sourcesContent":["import { MaterialShapes, type MaterialShapeName } from '../shapes/material-shapes';\nimport { Morph } from '../shapes/morph';\nimport { morphToPath, polygonToPath } from '../shapes/path';\nimport type { RoundedPolygon } from '../shapes/rounded-polygon';\n\nexport type MorphShape = RoundedPolygon | MaterialShapeName;\n\nexport interface M3MorphOptions {\n /**\n * Scales the unit-square shapes, e.g. to the SVG `viewBox` size. Default 1. Mid-morph\n * control points can poke up to ~1% outside the square, so give the `<svg>`\n * `overflow=\"visible\"` or a little padding.\n */\n size?: number;\n /** Rotates each frame so its first point sits at this angle (degrees). Default 0. */\n startAngle?: number;\n}\n\n// Matching is the expensive part of a morph, so pairs are shared across components.\nconst morphCache = new WeakMap<RoundedPolygon, WeakMap<RoundedPolygon, Morph>>();\n\n/** The (cached) morph between two shapes. */\nexport function getMorph(from: RoundedPolygon, to: RoundedPolygon): Morph {\n let byEnd = morphCache.get(from);\n if (!byEnd) morphCache.set(from, (byEnd = new WeakMap()));\n let morph = byEnd.get(to);\n if (!morph) byEnd.set(to, (morph = new Morph(from, to)));\n return morph;\n}\n\nconst resolve = (shape: MorphShape) => (typeof shape === 'string' ? MaterialShapes[shape] : shape);\n\n/**\n * SVG path data for `shapes` at `progress`, where 0 is the first shape, 1 the second and so\n * on. Values outside `[0, n - 1]` extrapolate the first or last morph, so springs can\n * overshoot.\n */\nexport function morphPathAt(\n shapes: readonly MorphShape[],\n progress: number,\n { size = 1, startAngle = 0 }: M3MorphOptions = {},\n): string {\n if (shapes.length === 0) return '';\n if (shapes.length === 1) return polygonToPath(resolve(shapes[0]!), { scale: size, startAngle });\n const index = Math.min(Math.max(Math.floor(progress), 0), shapes.length - 2);\n const morph = getMorph(resolve(shapes[index]!), resolve(shapes[index + 1]!));\n // Rotation pivots in shape space, before scaling; normalized shapes center on (0.5, 0.5).\n return morphToPath(morph, progress - index, {\n scale: size,\n startAngle,\n rotationPivotX: 0.5,\n rotationPivotY: 0.5,\n });\n}\n"],"mappings":";;;;AAmBA,MAAM,6BAAa,IAAI,QAAwD;;AAG/E,SAAgB,SAAS,MAAsB,IAA2B;CACxE,IAAI,QAAQ,WAAW,IAAI,IAAI;CAC/B,IAAI,CAAC,OAAO,WAAW,IAAI,MAAO,wBAAQ,IAAI,QAAQ,CAAE;CACxD,IAAI,QAAQ,MAAM,IAAI,EAAE;CACxB,IAAI,CAAC,OAAO,MAAM,IAAI,IAAK,QAAQ,IAAI,MAAM,MAAM,EAAE,CAAE;CACvD,OAAO;AACT;AAEA,MAAM,WAAW,UAAuB,OAAO,UAAU,WAAW,eAAe,SAAS;;;;;;AAO5F,SAAgB,YACd,QACA,UACA,EAAE,OAAO,GAAG,aAAa,MAAsB,CAAC,GACxC;CACR,IAAI,OAAO,WAAW,GAAG,OAAO;CAChC,IAAI,OAAO,WAAW,GAAG,OAAO,cAAc,QAAQ,OAAO,EAAG,GAAG;EAAE,OAAO;EAAM;CAAW,CAAC;CAC9F,MAAM,QAAQ,KAAK,IAAI,KAAK,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC,GAAG,OAAO,SAAS,CAAC;CAC3E,MAAM,QAAQ,SAAS,QAAQ,OAAO,MAAO,GAAG,QAAQ,OAAO,QAAQ,EAAG,CAAC;CAE3E,OAAO,YAAY,OAAO,WAAW,OAAO;EAC1C,OAAO;EACP;EACA,gBAAgB;EAChB,gBAAgB;CAClB,CAAC;AACH"}
@@ -0,0 +1,54 @@
1
+ //#region src/primitives/selection-control-styles.d.ts
2
+ /**
3
+ * Shared anatomy of checkboxes, radio buttons and switches: a root `<label>`, the
4
+ * control (focus ring, touch target; for `kind: 'circle'` also the 40px round state
5
+ * layer, which web density shrinks) and the label text. State layers
6
+ * follow the M3 spec: on-surface when unselected, primary when selected, inverted while
7
+ * pressed, error when invalid. Recipes `extend` this and style their own indicator with
8
+ * `group-data-*\/control:` variants. Every class is written out in full.
9
+ */
10
+ export declare const selectionControlStyles: import("tailwind-variants").TVReturnType<{
11
+ kind: {
12
+ circle: {
13
+ control: string[];
14
+ };
15
+ track: {
16
+ control: string;
17
+ label: string;
18
+ };
19
+ };
20
+ }, {
21
+ root: string[];
22
+ control: string;
23
+ label: string;
24
+ }, undefined, {
25
+ kind: {
26
+ circle: {
27
+ control: string[];
28
+ };
29
+ track: {
30
+ control: string;
31
+ label: string;
32
+ };
33
+ };
34
+ }, {
35
+ root: string[];
36
+ control: string;
37
+ label: string;
38
+ }, import("tailwind-variants").TVReturnTypeLike<{
39
+ kind: {
40
+ circle: {
41
+ control: string[];
42
+ };
43
+ track: {
44
+ control: string;
45
+ label: string;
46
+ };
47
+ };
48
+ }, {
49
+ root: string[];
50
+ control: string;
51
+ label: string;
52
+ }>>;
53
+ //#endregion
54
+ //# sourceMappingURL=selection-control-styles.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { tv } from "../utils/tv.js";
2
+ //#region src/primitives/selection-control-styles.ts
3
+ /**
4
+ * Shared anatomy of checkboxes, radio buttons and switches: a root `<label>`, the
5
+ * control (focus ring, touch target; for `kind: 'circle'` also the 40px round state
6
+ * layer, which web density shrinks) and the label text. State layers
7
+ * follow the M3 spec: on-surface when unselected, primary when selected, inverted while
8
+ * pressed, error when invalid. Recipes `extend` this and style their own indicator with
9
+ * `group-data-*\/control:` variants. Every class is written out in full.
10
+ */
11
+ const selectionControlStyles = tv({
12
+ slots: {
13
+ root: [
14
+ "group/control inline-flex cursor-pointer items-center align-middle select-none",
15
+ "text-body-large text-on-surface",
16
+ "data-disabled:cursor-default data-disabled:text-on-surface/38"
17
+ ],
18
+ control: "relative inline-flex shrink-0 items-center justify-center focus-ring",
19
+ label: "min-w-0 pe-[8px]"
20
+ },
21
+ variants: { kind: {
22
+ circle: { control: [
23
+ "size-[calc(40px+var(--md-sys-density,0)*4px)] rounded-full state-layer",
24
+ "[--m3-ripple-size:calc(20px+var(--md-sys-density,0)*2px)] [--m3-ripple-start:calc(12px+var(--md-sys-density,0)*1.2px)]",
25
+ "[--m3-state-layer-color:var(--md-sys-color-on-surface)]",
26
+ "data-checked:[--m3-state-layer-color:var(--md-sys-color-primary)] data-indeterminate:[--m3-state-layer-color:var(--md-sys-color-primary)]",
27
+ "data-pressed:[--m3-state-layer-color:var(--md-sys-color-primary)]",
28
+ "data-checked:data-pressed:[--m3-state-layer-color:var(--md-sys-color-on-surface)] data-indeterminate:data-pressed:[--m3-state-layer-color:var(--md-sys-color-on-surface)]",
29
+ "data-invalid:[--m3-state-layer-color:var(--md-sys-color-error)]",
30
+ "data-invalid:data-checked:[--m3-state-layer-color:var(--md-sys-color-error)] data-invalid:data-indeterminate:[--m3-state-layer-color:var(--md-sys-color-error)]",
31
+ "data-invalid:data-pressed:[--m3-state-layer-color:var(--md-sys-color-error)]",
32
+ "data-invalid:data-checked:data-pressed:[--m3-state-layer-color:var(--md-sys-color-error)] data-invalid:data-indeterminate:data-pressed:[--m3-state-layer-color:var(--md-sys-color-error)]"
33
+ ] },
34
+ track: {
35
+ control: "rounded-full",
36
+ label: "ps-[12px]"
37
+ }
38
+ } },
39
+ defaultVariants: { kind: "circle" }
40
+ });
41
+ //#endregion
42
+ export { selectionControlStyles };
43
+
44
+ //# sourceMappingURL=selection-control-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection-control-styles.js","names":[],"sources":["../../src/primitives/selection-control-styles.ts"],"sourcesContent":["import { tv } from '../utils/tv';\n\n/**\n * Shared anatomy of checkboxes, radio buttons and switches: a root `<label>`, the\n * control (focus ring, touch target; for `kind: 'circle'` also the 40px round state\n * layer, which web density shrinks) and the label text. State layers\n * follow the M3 spec: on-surface when unselected, primary when selected, inverted while\n * pressed, error when invalid. Recipes `extend` this and style their own indicator with\n * `group-data-*\\/control:` variants. Every class is written out in full.\n */\nexport const selectionControlStyles = tv({\n slots: {\n root: [\n 'group/control inline-flex cursor-pointer items-center align-middle select-none',\n 'text-body-large text-on-surface',\n 'data-disabled:cursor-default data-disabled:text-on-surface/38',\n ],\n // Library-owned inner wrapper holding the indicator, focus ring and touch target.\n control: 'relative inline-flex shrink-0 items-center justify-center focus-ring',\n label: 'min-w-0 pe-[8px]',\n },\n variants: {\n kind: {\n // Checkboxes and radio buttons: the control is the 40px state-layer circle, 4px less per\n // density step (40 → 36 → 32 → 28px, Material Components Web's checkbox and radio\n // density); the ripple keeps its proportions (half the size, from 30%).\n circle: {\n control: [\n 'size-[calc(40px+var(--md-sys-density,0)*4px)] rounded-full state-layer',\n '[--m3-ripple-size:calc(20px+var(--md-sys-density,0)*2px)] [--m3-ripple-start:calc(12px+var(--md-sys-density,0)*1.2px)]',\n '[--m3-state-layer-color:var(--md-sys-color-on-surface)]',\n 'data-checked:[--m3-state-layer-color:var(--md-sys-color-primary)] data-indeterminate:[--m3-state-layer-color:var(--md-sys-color-primary)]',\n 'data-pressed:[--m3-state-layer-color:var(--md-sys-color-primary)]',\n 'data-checked:data-pressed:[--m3-state-layer-color:var(--md-sys-color-on-surface)] data-indeterminate:data-pressed:[--m3-state-layer-color:var(--md-sys-color-on-surface)]',\n // Invalid wins in every state (stacked, so it never depends on CSS order): the\n // state layer is `error` selected or not, pressed or not (md.comp.checkbox.error.*).\n 'data-invalid:[--m3-state-layer-color:var(--md-sys-color-error)]',\n 'data-invalid:data-checked:[--m3-state-layer-color:var(--md-sys-color-error)] data-invalid:data-indeterminate:[--m3-state-layer-color:var(--md-sys-color-error)]',\n 'data-invalid:data-pressed:[--m3-state-layer-color:var(--md-sys-color-error)]',\n 'data-invalid:data-checked:data-pressed:[--m3-state-layer-color:var(--md-sys-color-error)] data-invalid:data-indeterminate:data-pressed:[--m3-state-layer-color:var(--md-sys-color-error)]',\n ],\n },\n // Switches: the control is the track; the recipe adds a state layer that follows the thumb.\n track: { control: 'rounded-full', label: 'ps-[12px]' },\n },\n },\n defaultVariants: { kind: 'circle' },\n});\n"],"mappings":";;;;;;;;;;AAUA,MAAa,yBAAyB,GAAG;CACvC,OAAO;EACL,MAAM;GACJ;GACA;GACA;EACF;EAEA,SAAS;EACT,OAAO;CACT;CACA,UAAU,EACR,MAAM;EAIJ,QAAQ,EACN,SAAS;GACP;GACA;GACA;GACA;GACA;GACA;GAGA;GACA;GACA;GACA;EACF,EACF;EAEA,OAAO;GAAE,SAAS;GAAgB,OAAO;EAAY;CACvD,EACF;CACA,iBAAiB,EAAE,MAAM,SAAS;AACpC,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { DOMAttributes, RefObject } from "react";
2
+ import { PressEvents } from "react-aria";
3
+ //#region src/primitives/use-m3-interaction.d.ts
4
+ export interface M3InteractionOptions extends PressEvents {
5
+ isDisabled?: boolean;
6
+ isSelected?: boolean;
7
+ isDragged?: boolean;
8
+ /**
9
+ * Pressed state from another React Aria hook (e.g. `useButton`). When provided,
10
+ * this hook does not attach its own press handling.
11
+ */
12
+ isPressed?: boolean;
13
+ /** Treat focus inside the element as focus on the element (e.g. text fields). */
14
+ within?: boolean;
15
+ /** Whether the element is a text input; focus is then always visible. */
16
+ isTextInput?: boolean;
17
+ autoFocus?: boolean;
18
+ }
19
+ export interface M3InteractionState {
20
+ isHovered: boolean;
21
+ isPressed: boolean;
22
+ isFocused: boolean;
23
+ isFocusVisible: boolean;
24
+ }
25
+ /** `data-*` attributes read by the `state-layer` and `focus-ring` utilities. */
26
+ export interface M3InteractionDataAttributes {
27
+ 'data-hovered'?: true;
28
+ 'data-pressed'?: true;
29
+ /** The ripple is showing: from press start until release, but at least 225ms. */
30
+ 'data-rippling'?: true;
31
+ 'data-focused'?: true;
32
+ 'data-focus-visible'?: true;
33
+ 'data-disabled'?: true;
34
+ 'data-selected'?: true;
35
+ 'data-dragged'?: true;
36
+ }
37
+ export interface M3InteractionResult {
38
+ /** Event handlers to spread on the interactive element. */
39
+ interactionProps: DOMAttributes<HTMLElement>;
40
+ dataAttributes: M3InteractionDataAttributes;
41
+ state: M3InteractionState;
42
+ }
43
+ /**
44
+ * M3 interaction states for any element: hover, press, focus-visible, selected,
45
+ * dragged and disabled, exposed as `data-*` attributes, plus the ripple origin.
46
+ * Pair with the `state-layer` and `focus-ring` utilities, which paint the state
47
+ * layer and ripple as background layers on the element itself (no child nodes).
48
+ */
49
+ export declare function useM3Interaction(options: M3InteractionOptions, ref: RefObject<HTMLElement | null>): M3InteractionResult;
50
+ //#endregion
51
+ //# sourceMappingURL=use-m3-interaction.d.ts.map
@@ -0,0 +1,149 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ import { mergeProps, useFocusRing, useHover, usePress } from "react-aria";
4
+ //#region src/primitives/use-m3-interaction.ts
5
+ const flag = (value) => value ? true : void 0;
6
+ /** The ripple's animated properties, pinned at the start of a new ripple. */
7
+ const RIPPLE_START = {
8
+ "--m3-ripple-opacity": "0",
9
+ "--m3-ripple-radius": "var(--m3-ripple-start, 0px)",
10
+ "--m3-ripple-x": "var(--m3-ripple-origin-x, 50%)",
11
+ "--m3-ripple-y": "var(--m3-ripple-origin-y, 50%)"
12
+ };
13
+ /**
14
+ * Starts a fresh ripple on `element`, as Compose does for every press, even while the last
15
+ * one is still growing or fading. The ripple's animated properties are pinned to their start
16
+ * values with their transitions off and flushed to style, then released: they transition
17
+ * from this press's start to whatever the state layer's rules say (growing if
18
+ * `data-rippling` is on, or once it turns on). Only the ripple's transitions are switched
19
+ * off: the component's own (`--m3-transition-property`, such as a running corner morph) keep
20
+ * running, so a quick second press doesn't make the corners jump.
21
+ */
22
+ function restartRipple(element) {
23
+ const { style } = element;
24
+ const transitionProperty = style.transitionProperty;
25
+ style.transitionProperty = "var(--m3-transition-property, --m3-none)";
26
+ for (const [name, value] of Object.entries(RIPPLE_START)) style.setProperty(name, value);
27
+ getComputedStyle(element).getPropertyValue("--m3-ripple-x");
28
+ for (const name of Object.keys(RIPPLE_START)) style.removeProperty(name);
29
+ style.transitionProperty = transitionProperty;
30
+ }
31
+ /**
32
+ * Positions a new ripple at the press point (Compose `RippleAnimation`): it grows from 30%
33
+ * of the element's longer side to half its diagonal plus 10px while its centre moves to the
34
+ * middle. Without a point (a key press) it starts in the middle. For a state layer on a
35
+ * child of the pressed element (a navigation item's pill), pass that child.
36
+ */
37
+ function setRippleOrigin(element, clientX, clientY) {
38
+ const rect = element.getBoundingClientRect();
39
+ const x = clientX === void 0 ? rect.width / 2 : clientX - rect.left;
40
+ const y = clientY === void 0 ? rect.height / 2 : clientY - rect.top;
41
+ const { style } = element;
42
+ style.setProperty("--m3-ripple-origin-x", `${x}px`);
43
+ style.setProperty("--m3-ripple-origin-y", `${y}px`);
44
+ style.setProperty("--m3-ripple-center-x", `${rect.width / 2}px`);
45
+ style.setProperty("--m3-ripple-center-y", `${rect.height / 2}px`);
46
+ style.setProperty("--m3-ripple-start", `${Math.max(rect.width, rect.height) * .3}px`);
47
+ style.setProperty("--m3-ripple-size", `${Math.ceil(Math.hypot(rect.width, rect.height) / 2 + 10)}px`);
48
+ restartRipple(element);
49
+ }
50
+ /**
51
+ * Flags a press that starts while the element's corner morph is still running
52
+ * (`data-rapid-press`). M3's buttons note that the web can use "a modified motion curve to
53
+ * avoid resonant effects from overlapping animations": the `container-motion` utility then
54
+ * morphs on the fast effects spring, which doesn't overshoot, instead of the fast spatial
55
+ * one. The attribute is set on the element directly, before React renders the press, so
56
+ * the morph that press starts already uses the modified curve. Call it before anything
57
+ * that resets the element's transitions (such as `restartRipple`).
58
+ */
59
+ function markRapidPress(element) {
60
+ const morphing = typeof element.getAnimations === "function" && element.getAnimations().some((animation) => animation instanceof CSSTransition && animation.transitionProperty.endsWith("radius") && animation.playState === "running");
61
+ element.toggleAttribute("data-rapid-press", morphing);
62
+ }
63
+ /**
64
+ * Whether a ripple should be showing. Compose always finishes a ripple's 225ms growth
65
+ * before fading it out, so a quick tap still reaches the edges: this stays true from press
66
+ * start until release, but for at least 225ms.
67
+ */
68
+ function useRippleHold(isPressed) {
69
+ const [wasPressed, setWasPressed] = useState(isPressed);
70
+ const [held, setHeld] = useState(false);
71
+ const [presses, setPresses] = useState(0);
72
+ if (isPressed !== wasPressed) {
73
+ setWasPressed(isPressed);
74
+ if (isPressed) {
75
+ setHeld(true);
76
+ setPresses((n) => n + 1);
77
+ }
78
+ }
79
+ useEffect(() => {
80
+ if (!held) return;
81
+ const timer = setTimeout(() => setHeld(false), 225);
82
+ return () => clearTimeout(timer);
83
+ }, [held, presses]);
84
+ return isPressed || held;
85
+ }
86
+ /**
87
+ * M3 interaction states for any element: hover, press, focus-visible, selected,
88
+ * dragged and disabled, exposed as `data-*` attributes, plus the ripple origin.
89
+ * Pair with the `state-layer` and `focus-ring` utilities, which paint the state
90
+ * layer and ripple as background layers on the element itself (no child nodes).
91
+ */
92
+ function useM3Interaction(options, ref) {
93
+ const { isDisabled, isSelected, isDragged, within, isTextInput, autoFocus, onPress, onPressStart, onPressEnd, onPressChange, onPressUp, onClick } = options;
94
+ const hasExternalPress = options.isPressed !== void 0;
95
+ const { pressProps, isPressed: isOwnPressed } = usePress({
96
+ onPress,
97
+ onPressStart,
98
+ onPressEnd,
99
+ onPressChange,
100
+ onPressUp,
101
+ onClick,
102
+ ref,
103
+ isDisabled: isDisabled || hasExternalPress
104
+ });
105
+ const { hoverProps, isHovered } = useHover({ isDisabled });
106
+ const { focusProps, isFocused, isFocusVisible } = useFocusRing({
107
+ within,
108
+ isTextInput,
109
+ autoFocus
110
+ });
111
+ const isPressed = hasExternalPress ? Boolean(options.isPressed) : isOwnPressed;
112
+ const isRippling = useRippleHold(isPressed && !isDisabled);
113
+ return {
114
+ interactionProps: mergeProps(hasExternalPress ? {} : pressProps, hoverProps, focusProps, {
115
+ onPointerDown: (event) => {
116
+ if (!isDisabled && event.button === 0) {
117
+ markRapidPress(event.currentTarget);
118
+ setRippleOrigin(event.currentTarget, event.clientX, event.clientY);
119
+ }
120
+ },
121
+ onKeyDown: (event) => {
122
+ if (!isDisabled && (event.key === "Enter" || event.key === " ")) {
123
+ markRapidPress(event.currentTarget);
124
+ setRippleOrigin(event.currentTarget);
125
+ }
126
+ }
127
+ }),
128
+ dataAttributes: {
129
+ "data-hovered": flag(isHovered && !isDisabled),
130
+ "data-pressed": flag(isPressed && !isDisabled),
131
+ "data-rippling": flag(isRippling),
132
+ "data-focused": flag(isFocused),
133
+ "data-focus-visible": flag(isFocusVisible),
134
+ "data-disabled": flag(isDisabled),
135
+ "data-selected": flag(isSelected),
136
+ "data-dragged": flag(isDragged)
137
+ },
138
+ state: {
139
+ isHovered,
140
+ isPressed,
141
+ isFocused,
142
+ isFocusVisible
143
+ }
144
+ };
145
+ }
146
+ //#endregion
147
+ export { markRapidPress, restartRipple, setRippleOrigin, useM3Interaction, useRippleHold };
148
+
149
+ //# sourceMappingURL=use-m3-interaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-m3-interaction.js","names":[],"sources":["../../src/primitives/use-m3-interaction.ts"],"sourcesContent":["'use client';\n\nimport { mergeProps, useFocusRing, useHover, usePress, type PressEvents } from 'react-aria';\nimport {\n useEffect,\n useState,\n type DOMAttributes,\n type KeyboardEvent,\n type PointerEvent,\n type RefObject,\n} from 'react';\n\nexport interface M3InteractionOptions extends PressEvents {\n isDisabled?: boolean;\n isSelected?: boolean;\n isDragged?: boolean;\n /**\n * Pressed state from another React Aria hook (e.g. `useButton`). When provided,\n * this hook does not attach its own press handling.\n */\n isPressed?: boolean;\n /** Treat focus inside the element as focus on the element (e.g. text fields). */\n within?: boolean;\n /** Whether the element is a text input; focus is then always visible. */\n isTextInput?: boolean;\n autoFocus?: boolean;\n}\n\nexport interface M3InteractionState {\n isHovered: boolean;\n isPressed: boolean;\n isFocused: boolean;\n isFocusVisible: boolean;\n}\n\n/** `data-*` attributes read by the `state-layer` and `focus-ring` utilities. */\nexport interface M3InteractionDataAttributes {\n 'data-hovered'?: true;\n 'data-pressed'?: true;\n /** The ripple is showing: from press start until release, but at least 225ms. */\n 'data-rippling'?: true;\n 'data-focused'?: true;\n 'data-focus-visible'?: true;\n 'data-disabled'?: true;\n 'data-selected'?: true;\n 'data-dragged'?: true;\n}\n\nexport interface M3InteractionResult {\n /** Event handlers to spread on the interactive element. */\n interactionProps: DOMAttributes<HTMLElement>;\n dataAttributes: M3InteractionDataAttributes;\n state: M3InteractionState;\n}\n\nconst flag = (value: boolean | undefined): true | undefined => (value ? true : undefined);\n\n/** Compose `RippleAnimation`: the radius grows (and the centre travels) over 225ms. */\nexport const RIPPLE_GROW_MS = 225;\n\n/** The ripple's animated properties, pinned at the start of a new ripple. */\nconst RIPPLE_START = {\n '--m3-ripple-opacity': '0',\n '--m3-ripple-radius': 'var(--m3-ripple-start, 0px)',\n '--m3-ripple-x': 'var(--m3-ripple-origin-x, 50%)',\n '--m3-ripple-y': 'var(--m3-ripple-origin-y, 50%)',\n} as const;\n\n/**\n * Starts a fresh ripple on `element`, as Compose does for every press, even while the last\n * one is still growing or fading. The ripple's animated properties are pinned to their start\n * values with their transitions off and flushed to style, then released: they transition\n * from this press's start to whatever the state layer's rules say (growing if\n * `data-rippling` is on, or once it turns on). Only the ripple's transitions are switched\n * off: the component's own (`--m3-transition-property`, such as a running corner morph) keep\n * running, so a quick second press doesn't make the corners jump.\n */\nexport function restartRipple(element: HTMLElement) {\n const { style } = element;\n const transitionProperty = style.transitionProperty;\n style.transitionProperty = 'var(--m3-transition-property, --m3-none)';\n for (const [name, value] of Object.entries(RIPPLE_START)) style.setProperty(name, value);\n getComputedStyle(element).getPropertyValue('--m3-ripple-x');\n for (const name of Object.keys(RIPPLE_START)) style.removeProperty(name);\n style.transitionProperty = transitionProperty;\n}\n\n/**\n * Positions a new ripple at the press point (Compose `RippleAnimation`): it grows from 30%\n * of the element's longer side to half its diagonal plus 10px while its centre moves to the\n * middle. Without a point (a key press) it starts in the middle. For a state layer on a\n * child of the pressed element (a navigation item's pill), pass that child.\n */\nexport function setRippleOrigin(element: HTMLElement, clientX?: number, clientY?: number) {\n const rect = element.getBoundingClientRect();\n const x = clientX === undefined ? rect.width / 2 : clientX - rect.left;\n const y = clientY === undefined ? rect.height / 2 : clientY - rect.top;\n const { style } = element;\n style.setProperty('--m3-ripple-origin-x', `${x}px`);\n style.setProperty('--m3-ripple-origin-y', `${y}px`);\n style.setProperty('--m3-ripple-center-x', `${rect.width / 2}px`);\n style.setProperty('--m3-ripple-center-y', `${rect.height / 2}px`);\n style.setProperty('--m3-ripple-start', `${Math.max(rect.width, rect.height) * 0.3}px`);\n style.setProperty(\n '--m3-ripple-size',\n `${Math.ceil(Math.hypot(rect.width, rect.height) / 2 + 10)}px`,\n );\n restartRipple(element);\n}\n\n/**\n * Flags a press that starts while the element's corner morph is still running\n * (`data-rapid-press`). M3's buttons note that the web can use \"a modified motion curve to\n * avoid resonant effects from overlapping animations\": the `container-motion` utility then\n * morphs on the fast effects spring, which doesn't overshoot, instead of the fast spatial\n * one. The attribute is set on the element directly, before React renders the press, so\n * the morph that press starts already uses the modified curve. Call it before anything\n * that resets the element's transitions (such as `restartRipple`).\n */\nexport function markRapidPress(element: HTMLElement) {\n const morphing =\n typeof element.getAnimations === 'function' &&\n element\n .getAnimations()\n .some(\n (animation) =>\n animation instanceof CSSTransition &&\n animation.transitionProperty.endsWith('radius') &&\n animation.playState === 'running',\n );\n element.toggleAttribute('data-rapid-press', morphing);\n}\n\n/**\n * Whether a ripple should be showing. Compose always finishes a ripple's 225ms growth\n * before fading it out, so a quick tap still reaches the edges: this stays true from press\n * start until release, but for at least 225ms.\n */\nexport function useRippleHold(isPressed: boolean): boolean {\n const [wasPressed, setWasPressed] = useState(isPressed);\n const [held, setHeld] = useState(false);\n const [presses, setPresses] = useState(0);\n // Adjust state while rendering when a press starts (no effect, no extra paint).\n if (isPressed !== wasPressed) {\n setWasPressed(isPressed);\n if (isPressed) {\n setHeld(true);\n setPresses((n) => n + 1);\n }\n }\n useEffect(() => {\n if (!held) return;\n const timer = setTimeout(() => setHeld(false), RIPPLE_GROW_MS);\n return () => clearTimeout(timer);\n }, [held, presses]);\n return isPressed || held;\n}\n\n/**\n * M3 interaction states for any element: hover, press, focus-visible, selected,\n * dragged and disabled, exposed as `data-*` attributes, plus the ripple origin.\n * Pair with the `state-layer` and `focus-ring` utilities, which paint the state\n * layer and ripple as background layers on the element itself (no child nodes).\n */\nexport function useM3Interaction(\n options: M3InteractionOptions,\n ref: RefObject<HTMLElement | null>,\n): M3InteractionResult {\n const {\n isDisabled,\n isSelected,\n isDragged,\n within,\n isTextInput,\n autoFocus,\n onPress,\n onPressStart,\n onPressEnd,\n onPressChange,\n onPressUp,\n onClick,\n } = options;\n const hasExternalPress = options.isPressed !== undefined;\n\n // Only `usePress`'s own options: it spreads any others onto the props it returns, so this\n // hook's options (`isDragged`, `within` …) would reach the DOM as unknown attributes.\n const { pressProps, isPressed: isOwnPressed } = usePress({\n onPress,\n onPressStart,\n onPressEnd,\n onPressChange,\n onPressUp,\n onClick,\n ref,\n isDisabled: isDisabled || hasExternalPress,\n });\n const { hoverProps, isHovered } = useHover({ isDisabled });\n const { focusProps, isFocused, isFocusVisible } = useFocusRing({\n within,\n isTextInput,\n autoFocus,\n });\n\n const isPressed = hasExternalPress ? Boolean(options.isPressed) : isOwnPressed;\n const isRippling = useRippleHold(isPressed && !isDisabled);\n\n const rippleProps: DOMAttributes<HTMLElement> = {\n onPointerDown: (event: PointerEvent<HTMLElement>) => {\n if (!isDisabled && event.button === 0) {\n markRapidPress(event.currentTarget);\n setRippleOrigin(event.currentTarget, event.clientX, event.clientY);\n }\n },\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => {\n if (!isDisabled && (event.key === 'Enter' || event.key === ' ')) {\n markRapidPress(event.currentTarget);\n setRippleOrigin(event.currentTarget);\n }\n },\n };\n\n return {\n interactionProps: mergeProps(\n hasExternalPress ? {} : pressProps,\n hoverProps,\n focusProps,\n rippleProps,\n ),\n dataAttributes: {\n 'data-hovered': flag(isHovered && !isDisabled),\n 'data-pressed': flag(isPressed && !isDisabled),\n 'data-rippling': flag(isRippling),\n 'data-focused': flag(isFocused),\n 'data-focus-visible': flag(isFocusVisible),\n 'data-disabled': flag(isDisabled),\n 'data-selected': flag(isSelected),\n 'data-dragged': flag(isDragged),\n },\n state: { isHovered, isPressed, isFocused, isFocusVisible },\n };\n}\n"],"mappings":";;;;AAuDA,MAAM,QAAQ,UAAkD,QAAQ,OAAO,KAAA;;AAM/E,MAAM,eAAe;CACnB,uBAAuB;CACvB,sBAAsB;CACtB,iBAAiB;CACjB,iBAAiB;AACnB;;;;;;;;;;AAWA,SAAgB,cAAc,SAAsB;CAClD,MAAM,EAAE,UAAU;CAClB,MAAM,qBAAqB,MAAM;CACjC,MAAM,qBAAqB;CAC3B,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,YAAY,GAAG,MAAM,YAAY,MAAM,KAAK;CACvF,iBAAiB,OAAO,CAAC,CAAC,iBAAiB,eAAe;CAC1D,KAAK,MAAM,QAAQ,OAAO,KAAK,YAAY,GAAG,MAAM,eAAe,IAAI;CACvE,MAAM,qBAAqB;AAC7B;;;;;;;AAQA,SAAgB,gBAAgB,SAAsB,SAAkB,SAAkB;CACxF,MAAM,OAAO,QAAQ,sBAAsB;CAC3C,MAAM,IAAI,YAAY,KAAA,IAAY,KAAK,QAAQ,IAAI,UAAU,KAAK;CAClE,MAAM,IAAI,YAAY,KAAA,IAAY,KAAK,SAAS,IAAI,UAAU,KAAK;CACnE,MAAM,EAAE,UAAU;CAClB,MAAM,YAAY,wBAAwB,GAAG,EAAE,GAAG;CAClD,MAAM,YAAY,wBAAwB,GAAG,EAAE,GAAG;CAClD,MAAM,YAAY,wBAAwB,GAAG,KAAK,QAAQ,EAAE,GAAG;CAC/D,MAAM,YAAY,wBAAwB,GAAG,KAAK,SAAS,EAAE,GAAG;CAChE,MAAM,YAAY,qBAAqB,GAAG,KAAK,IAAI,KAAK,OAAO,KAAK,MAAM,IAAI,GAAI,GAAG;CACrF,MAAM,YACJ,oBACA,GAAG,KAAK,KAAK,KAAK,MAAM,KAAK,OAAO,KAAK,MAAM,IAAI,IAAI,EAAE,EAAE,GAC7D;CACA,cAAc,OAAO;AACvB;;;;;;;;;;AAWA,SAAgB,eAAe,SAAsB;CACnD,MAAM,WACJ,OAAO,QAAQ,kBAAkB,cACjC,QACG,cAAc,CAAC,CACf,MACE,cACC,qBAAqB,iBACrB,UAAU,mBAAmB,SAAS,QAAQ,KAC9C,UAAU,cAAc,SAC5B;CACJ,QAAQ,gBAAgB,oBAAoB,QAAQ;AACtD;;;;;;AAOA,SAAgB,cAAc,WAA6B;CACzD,MAAM,CAAC,YAAY,iBAAiB,SAAS,SAAS;CACtD,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC;CAExC,IAAI,cAAc,YAAY;EAC5B,cAAc,SAAS;EACvB,IAAI,WAAW;GACb,QAAQ,IAAI;GACZ,YAAY,MAAM,IAAI,CAAC;EACzB;CACF;CACA,gBAAgB;EACd,IAAI,CAAC,MAAM;EACX,MAAM,QAAQ,iBAAiB,QAAQ,KAAK,GAAA,GAAiB;EAC7D,aAAa,aAAa,KAAK;CACjC,GAAG,CAAC,MAAM,OAAO,CAAC;CAClB,OAAO,aAAa;AACtB;;;;;;;AAQA,SAAgB,iBACd,SACA,KACqB;CACrB,MAAM,EACJ,YACA,YACA,WACA,QACA,aACA,WACA,SACA,cACA,YACA,eACA,WACA,YACE;CACJ,MAAM,mBAAmB,QAAQ,cAAc,KAAA;CAI/C,MAAM,EAAE,YAAY,WAAW,iBAAiB,SAAS;EACvD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY,cAAc;CAC5B,CAAC;CACD,MAAM,EAAE,YAAY,cAAc,SAAS,EAAE,WAAW,CAAC;CACzD,MAAM,EAAE,YAAY,WAAW,mBAAmB,aAAa;EAC7D;EACA;EACA;CACF,CAAC;CAED,MAAM,YAAY,mBAAmB,QAAQ,QAAQ,SAAS,IAAI;CAClE,MAAM,aAAa,cAAc,aAAa,CAAC,UAAU;CAiBzD,OAAO;EACL,kBAAkB,WAChB,mBAAmB,CAAC,IAAI,YACxB,YACA,YACA;GAnBF,gBAAgB,UAAqC;IACnD,IAAI,CAAC,cAAc,MAAM,WAAW,GAAG;KACrC,eAAe,MAAM,aAAa;KAClC,gBAAgB,MAAM,eAAe,MAAM,SAAS,MAAM,OAAO;IACnE;GACF;GACA,YAAY,UAAsC;IAChD,IAAI,CAAC,eAAe,MAAM,QAAQ,WAAW,MAAM,QAAQ,MAAM;KAC/D,eAAe,MAAM,aAAa;KAClC,gBAAgB,MAAM,aAAa;IACrC;GACF;EAQY,CACZ;EACA,gBAAgB;GACd,gBAAgB,KAAK,aAAa,CAAC,UAAU;GAC7C,gBAAgB,KAAK,aAAa,CAAC,UAAU;GAC7C,iBAAiB,KAAK,UAAU;GAChC,gBAAgB,KAAK,SAAS;GAC9B,sBAAsB,KAAK,cAAc;GACzC,iBAAiB,KAAK,UAAU;GAChC,iBAAiB,KAAK,UAAU;GAChC,gBAAgB,KAAK,SAAS;EAChC;EACA,OAAO;GAAE;GAAW;GAAW;GAAW;EAAe;CAC3D;AACF"}
@@ -0,0 +1,18 @@
1
+ import { M3MorphOptions, MorphShape } from "./morph-path.js";
2
+ import { MotionValue } from "motion/react";
3
+ //#region src/primitives/use-m3-morph.d.ts
4
+ /**
5
+ * Morphs through Material shapes with a Motion value, for an `m.path`'s `d`. Shapes are the
6
+ * 35 `MaterialShapes` (by name) or any normalized `RoundedPolygon`; corners are matched
7
+ * between consecutive shapes as in Compose.
8
+ *
9
+ * Reduced motion is the caller's call: snap `progress` instead of springing it.
10
+ *
11
+ * @example
12
+ * const progress = useSpring(0, useM3Spring('spatial'));
13
+ * const d = useM3Morph(['Circle', 'Cookie9Sided'], progress, { size: 48 });
14
+ * <svg viewBox="0 0 48 48"><m.path d={d} /></svg>
15
+ */
16
+ export declare function useM3Morph(shapes: readonly MorphShape[], progress: MotionValue<number>, options?: M3MorphOptions): MotionValue<string>;
17
+ //#endregion
18
+ //# sourceMappingURL=use-m3-morph.d.ts.map
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { morphPathAt } from "./morph-path.js";
3
+ import { useLayoutEffect, useRef } from "react";
4
+ import { useTransform } from "motion/react";
5
+ //#region src/primitives/use-m3-morph.ts
6
+ /**
7
+ * Morphs through Material shapes with a Motion value, for an `m.path`'s `d`. Shapes are the
8
+ * 35 `MaterialShapes` (by name) or any normalized `RoundedPolygon`; corners are matched
9
+ * between consecutive shapes as in Compose.
10
+ *
11
+ * Reduced motion is the caller's call: snap `progress` instead of springing it.
12
+ *
13
+ * @example
14
+ * const progress = useSpring(0, useM3Spring('spatial'));
15
+ * const d = useM3Morph(['Circle', 'Cookie9Sided'], progress, { size: 48 });
16
+ * <svg viewBox="0 0 48 48"><m.path d={d} /></svg>
17
+ */
18
+ function useM3Morph(shapes, progress, options = {}) {
19
+ const { size = 1, startAngle = 0 } = options;
20
+ const compute = (p) => morphPathAt(shapes, p, {
21
+ size,
22
+ startAngle
23
+ });
24
+ const computeRef = useRef(compute);
25
+ const d = useTransform(progress, (p) => computeRef.current(p));
26
+ useLayoutEffect(() => {
27
+ computeRef.current = compute;
28
+ const next = compute(progress.get());
29
+ if (next !== d.get()) d.set(next);
30
+ });
31
+ return d;
32
+ }
33
+ //#endregion
34
+ export { useM3Morph };
35
+
36
+ //# sourceMappingURL=use-m3-morph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-m3-morph.js","names":[],"sources":["../../src/primitives/use-m3-morph.ts"],"sourcesContent":["'use client';\n\nimport { useTransform, type MotionValue } from 'motion/react';\nimport { useLayoutEffect, useRef } from 'react';\nimport { morphPathAt, type M3MorphOptions, type MorphShape } from './morph-path';\n\n/**\n * Morphs through Material shapes with a Motion value, for an `m.path`'s `d`. Shapes are the\n * 35 `MaterialShapes` (by name) or any normalized `RoundedPolygon`; corners are matched\n * between consecutive shapes as in Compose.\n *\n * Reduced motion is the caller's call: snap `progress` instead of springing it.\n *\n * @example\n * const progress = useSpring(0, useM3Spring('spatial'));\n * const d = useM3Morph(['Circle', 'Cookie9Sided'], progress, { size: 48 });\n * <svg viewBox=\"0 0 48 48\"><m.path d={d} /></svg>\n */\nexport function useM3Morph(\n shapes: readonly MorphShape[],\n progress: MotionValue<number>,\n options: M3MorphOptions = {},\n): MotionValue<string> {\n const { size = 1, startAngle = 0 } = options;\n const compute = (p: number) => morphPathAt(shapes, p, { size, startAngle });\n const computeRef = useRef(compute);\n const d = useTransform(progress, (p) => computeRef.current(p));\n // New shapes or options update the path without waiting for progress to change. This runs\n // every render; morphs are cached, so it costs one path build.\n useLayoutEffect(() => {\n computeRef.current = compute;\n const next = compute(progress.get());\n if (next !== d.get()) d.set(next);\n });\n return d;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,WACd,QACA,UACA,UAA0B,CAAC,GACN;CACrB,MAAM,EAAE,OAAO,GAAG,aAAa,MAAM;CACrC,MAAM,WAAW,MAAc,YAAY,QAAQ,GAAG;EAAE;EAAM;CAAW,CAAC;CAC1E,MAAM,aAAa,OAAO,OAAO;CACjC,MAAM,IAAI,aAAa,WAAW,MAAM,WAAW,QAAQ,CAAC,CAAC;CAG7D,sBAAsB;EACpB,WAAW,UAAU;EACrB,MAAM,OAAO,QAAQ,SAAS,IAAI,CAAC;EACnC,IAAI,SAAS,EAAE,IAAI,GAAG,EAAE,IAAI,IAAI;CAClC,CAAC;CACD,OAAO;AACT"}
@@ -0,0 +1,19 @@
1
+ import { TransitionEvent } from "react";
2
+ //#region src/primitives/use-presence.d.ts
3
+ /**
4
+ * Keeps an overlay mounted while it animates out. `isPresent` turns true as soon as
5
+ * `isOpen` does and stays true until the exit transition ends (or a fallback timeout).
6
+ * Spread `exitProps` on the element whose transition of `property` (default `opacity`)
7
+ * marks the end; with several properties, the first of them to end does, so an exit that
8
+ * slides normally and fades under reduced motion passes both. With `animated` false there is
9
+ * no exit motion to wait for, so `isPresent` follows `isOpen` at once.
10
+ */
11
+ export declare function usePresence(isOpen: boolean, property?: string | readonly string[], animated?: boolean): {
12
+ isPresent: boolean;
13
+ isExiting: boolean;
14
+ exitProps: {
15
+ onTransitionEnd: (event: TransitionEvent<HTMLElement>) => void;
16
+ };
17
+ };
18
+ //#endregion
19
+ //# sourceMappingURL=use-presence.d.ts.map
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ /**
4
+ * Keeps an overlay mounted while it animates out. `isPresent` turns true as soon as
5
+ * `isOpen` does and stays true until the exit transition ends (or a fallback timeout).
6
+ * Spread `exitProps` on the element whose transition of `property` (default `opacity`)
7
+ * marks the end; with several properties, the first of them to end does, so an exit that
8
+ * slides normally and fades under reduced motion passes both. With `animated` false there is
9
+ * no exit motion to wait for, so `isPresent` follows `isOpen` at once.
10
+ */
11
+ function usePresence(isOpen, property = "opacity", animated = true) {
12
+ const [isPresent, setPresent] = useState(isOpen);
13
+ const [wasOpen, setWasOpen] = useState(isOpen);
14
+ if (isOpen !== wasOpen) {
15
+ setWasOpen(isOpen);
16
+ if (isOpen) setPresent(true);
17
+ }
18
+ if (!animated && isPresent !== isOpen) setPresent(isOpen);
19
+ const isExiting = animated && isPresent && !isOpen;
20
+ useEffect(() => {
21
+ if (!isExiting) return;
22
+ const timer = setTimeout(() => setPresent(false), 800);
23
+ return () => clearTimeout(timer);
24
+ }, [isExiting]);
25
+ return {
26
+ isPresent,
27
+ isExiting,
28
+ exitProps: { onTransitionEnd: (event) => {
29
+ const ends = typeof property === "string" ? [property] : property;
30
+ if (isExiting && event.target === event.currentTarget && ends.includes(event.propertyName)) setPresent(false);
31
+ } }
32
+ };
33
+ }
34
+ //#endregion
35
+ export { usePresence };
36
+
37
+ //# sourceMappingURL=use-presence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-presence.js","names":[],"sources":["../../src/primitives/use-presence.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useState, type TransitionEvent } from 'react';\n\n/**\n * Upper bound for an exit transition, in case `transitionend` never fires. Presence normally\n * ends on that event; this only has to outlast the longest exit the motion tokens can build\n * (checked in `use-presence.test.tsx`), so it never cuts a fade short.\n */\nexport const EXIT_FALLBACK_MS = 800;\n\n/**\n * Keeps an overlay mounted while it animates out. `isPresent` turns true as soon as\n * `isOpen` does and stays true until the exit transition ends (or a fallback timeout).\n * Spread `exitProps` on the element whose transition of `property` (default `opacity`)\n * marks the end; with several properties, the first of them to end does, so an exit that\n * slides normally and fades under reduced motion passes both. With `animated` false there is\n * no exit motion to wait for, so `isPresent` follows `isOpen` at once.\n */\nexport function usePresence(\n isOpen: boolean,\n property: string | readonly string[] = 'opacity',\n animated = true,\n) {\n const [isPresent, setPresent] = useState(isOpen);\n const [wasOpen, setWasOpen] = useState(isOpen);\n // Adjust state while rendering when `isOpen` changes (no effect, no extra paint).\n if (isOpen !== wasOpen) {\n setWasOpen(isOpen);\n if (isOpen) setPresent(true);\n }\n if (!animated && isPresent !== isOpen) setPresent(isOpen);\n const isExiting = animated && isPresent && !isOpen;\n\n useEffect(() => {\n if (!isExiting) return;\n const timer = setTimeout(() => setPresent(false), EXIT_FALLBACK_MS);\n return () => clearTimeout(timer);\n }, [isExiting]);\n\n const exitProps = {\n onTransitionEnd: (event: TransitionEvent<HTMLElement>) => {\n const ends = typeof property === 'string' ? [property] : property;\n if (isExiting && event.target === event.currentTarget && ends.includes(event.propertyName)) {\n setPresent(false);\n }\n },\n };\n\n return { isPresent, isExiting, exitProps };\n}\n"],"mappings":";;;;;;;;;;AAmBA,SAAgB,YACd,QACA,WAAuC,WACvC,WAAW,MACX;CACA,MAAM,CAAC,WAAW,cAAc,SAAS,MAAM;CAC/C,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,IAAI,WAAW,SAAS;EACtB,WAAW,MAAM;EACjB,IAAI,QAAQ,WAAW,IAAI;CAC7B;CACA,IAAI,CAAC,YAAY,cAAc,QAAQ,WAAW,MAAM;CACxD,MAAM,YAAY,YAAY,aAAa,CAAC;CAE5C,gBAAgB;EACd,IAAI,CAAC,WAAW;EAChB,MAAM,QAAQ,iBAAiB,WAAW,KAAK,GAAA,GAAmB;EAClE,aAAa,aAAa,KAAK;CACjC,GAAG,CAAC,SAAS,CAAC;CAWd,OAAO;EAAE;EAAW;EAAW,WAAA,EAR7B,kBAAkB,UAAwC;GACxD,MAAM,OAAO,OAAO,aAAa,WAAW,CAAC,QAAQ,IAAI;GACzD,IAAI,aAAa,MAAM,WAAW,MAAM,iBAAiB,KAAK,SAAS,MAAM,YAAY,GACvF,WAAW,KAAK;EAEpB,EAGqC;CAAE;AAC3C"}
@@ -0,0 +1,36 @@
1
+ import { ThemeScopeContext } from "./theme/context.js";
2
+ import { getM3Spring } from "./motion/get-m3-spring.js";
3
+ import { useM3Spring } from "./motion/use-m3-spring.js";
4
+ import { ButtonBase, ButtonBaseActionProps, ButtonBaseDivActionProps, ButtonBaseLinkProps, ButtonBasePendingProps, ButtonBaseProps, ButtonBaseRenderState, ButtonBaseToggleProps } from "./primitives/ButtonBase.js";
5
+ import { DescriptionAria, RootDOMProps, SplitRootProps, SplitRootPropsOptions, WidgetAria, WrapperRootDOMProps, pickDescriptionAria, pickWidgetAria, splitRootProps } from "./utils/root-props.js";
6
+ import { CornerRounding } from "./shapes/corner-rounding.js";
7
+ import { PointTransformer } from "./shapes/point.js";
8
+ import { Cubic } from "./shapes/cubic.js";
9
+ import { RoundedPolygon } from "./shapes/rounded-polygon.js";
10
+ import { MaterialShapePath } from "./shapes/shape-path.js";
11
+ import { MaterialShapeName, archShape, arrowShape, boomShape, bunShape, burstShape, circleShape, clamShellShape, clover4LeafShape, clover8LeafShape, cookie12SidedShape, cookie4SidedShape, cookie6SidedShape, cookie7SidedShape, cookie9SidedShape, diamondShape, fanShape, flowerShape, gemShape, ghostishShape, heartShape, materialShapeNames, ovalShape, pentagonShape, pillShape, pixelCircleShape, pixelTriangleShape, puffyDiamondShape, puffyShape, semiCircleShape, slantedShape, softBoomShape, softBurstShape, squareShape, sunnyShape, triangleShape, verySunnyShape } from "./shapes/generated/material-shape-paths.js";
12
+ import { MaterialShapes } from "./shapes/material-shapes.js";
13
+ import { Morph } from "./shapes/morph.js";
14
+ import { M3MorphOptions, MorphShape, getMorph, morphPathAt } from "./primitives/morph-path.js";
15
+ import { SelectionControl, SelectionControlClassNames, SelectionControlProps } from "./primitives/SelectionControl.js";
16
+ import { M3InteractionDataAttributes, M3InteractionOptions, M3InteractionResult, M3InteractionState, useM3Interaction } from "./primitives/use-m3-interaction.js";
17
+ import { Surface, SurfaceProps, SurfaceVariants, surfaceStyles } from "./primitives/Surface.js";
18
+ import { Overlay, OverlayProps } from "./primitives/Overlay.js";
19
+ import { TouchTarget, TouchTargetProps } from "./primitives/TouchTarget.js";
20
+ import { CharacterCounter, CharacterCounterProps, ErrorText, ErrorTextProps, FieldErrorIcon, FieldErrorIconProps, FieldLabel, FieldLabelProps, SupportingText, SupportingTextProps } from "./primitives/Field.js";
21
+ import { springProgressWithVelocity, springWithVelocityToLinearEasing } from "./tokens/spring-velocity.js";
22
+ import { selectionControlStyles } from "./primitives/selection-control-styles.js";
23
+ import { TriggerContext, TriggerContextValue, useTriggerProps } from "./primitives/TriggerContext.js";
24
+ import { usePresence } from "./primitives/use-presence.js";
25
+ import { DomDirectionLocale, DomDirectionLocaleProps } from "./primitives/DomDirectionLocale.js";
26
+ import { localeWithDirection } from "./primitives/locale-with-direction.js";
27
+ import { useM3Morph } from "./primitives/use-m3-morph.js";
28
+ import { KeepPressedInPlaceResult, useKeepPressedInPlace } from "./utils/keep-pressed-in-place.js";
29
+ import { mergeDataTokens } from "./utils/merge-data-tokens.js";
30
+ import { splitDataAttributes } from "./utils/split-data-attributes.js";
31
+ import { generateSchemeColors } from "./theme/scheme.js";
32
+ import { materialShapeMask } from "./shapes/mask.js";
33
+ import { materialShapePaths } from "./shapes/generated/material-shape-path-record.js";
34
+ import { MorphPathOptions, PathOptions, cubicsToPath, morphToPath, polygonToPath } from "./shapes/path.js";
35
+ import { circle, pill, pillStar, rectangle, star } from "./shapes/shapes.js";
36
+ export { ButtonBase, type ButtonBaseActionProps, type ButtonBaseDivActionProps, type ButtonBaseLinkProps, type ButtonBasePendingProps, type ButtonBaseProps, type ButtonBaseRenderState, type ButtonBaseToggleProps, CharacterCounter, type CharacterCounterProps, CornerRounding, Cubic, type DescriptionAria, DomDirectionLocale, type DomDirectionLocaleProps, ErrorText, type ErrorTextProps, FieldErrorIcon, type FieldErrorIconProps, FieldLabel, type FieldLabelProps, type KeepPressedInPlaceResult, type M3InteractionDataAttributes, type M3InteractionOptions, type M3InteractionResult, type M3InteractionState, type M3MorphOptions, MaterialShapeName, type MaterialShapePath, MaterialShapes, Morph, type MorphPathOptions, type MorphShape, Overlay, type OverlayProps, type PathOptions, type PointTransformer, type RootDOMProps, RoundedPolygon, SelectionControl, type SelectionControlClassNames, type SelectionControlProps, type SplitRootProps, type SplitRootPropsOptions, SupportingText, type SupportingTextProps, Surface, type SurfaceProps, type SurfaceVariants, ThemeScopeContext, TouchTarget, type TouchTargetProps, TriggerContext, type TriggerContextValue, type WidgetAria, type WrapperRootDOMProps, archShape, arrowShape, boomShape, bunShape, burstShape, circle, circleShape, clamShellShape, clover4LeafShape, clover8LeafShape, cookie12SidedShape, cookie4SidedShape, cookie6SidedShape, cookie7SidedShape, cookie9SidedShape, cubicsToPath, diamondShape, fanShape, flowerShape, gemShape, generateSchemeColors, getM3Spring, getMorph, ghostishShape, heartShape, localeWithDirection, materialShapeMask, materialShapeNames, materialShapePaths, mergeDataTokens, morphPathAt, morphToPath, ovalShape, pentagonShape, pickDescriptionAria, pickWidgetAria, pill, pillShape, pillStar, pixelCircleShape, pixelTriangleShape, polygonToPath, puffyDiamondShape, puffyShape, rectangle, selectionControlStyles, semiCircleShape, slantedShape, softBoomShape, softBurstShape, splitDataAttributes, splitRootProps, springProgressWithVelocity, springWithVelocityToLinearEasing, squareShape, star, sunnyShape, surfaceStyles, triangleShape, useKeepPressedInPlace, useM3Interaction, useM3Morph, useM3Spring, usePresence, useTriggerProps, verySunnyShape };
@@ -0,0 +1,34 @@
1
+ import { ThemeScopeContext } from "./theme/context.js";
2
+ import { generateSchemeColors } from "./theme/scheme.js";
3
+ import { getM3Spring } from "./motion/get-m3-spring.js";
4
+ import { useM3Spring } from "./motion/use-m3-spring.js";
5
+ import { TriggerContext, useTriggerProps } from "./primitives/TriggerContext.js";
6
+ import { useM3Interaction } from "./primitives/use-m3-interaction.js";
7
+ import { ButtonBase } from "./primitives/ButtonBase.js";
8
+ import { TouchTarget } from "./primitives/TouchTarget.js";
9
+ import { mergeDataTokens } from "./utils/merge-data-tokens.js";
10
+ import { usePresence } from "./primitives/use-presence.js";
11
+ import { localeWithDirection } from "./primitives/locale-with-direction.js";
12
+ import { DomDirectionLocale } from "./primitives/DomDirectionLocale.js";
13
+ import { CornerRounding } from "./shapes/corner-rounding.js";
14
+ import { Cubic } from "./shapes/cubic.js";
15
+ import { RoundedPolygon } from "./shapes/rounded-polygon.js";
16
+ import { circle, pill, pillStar, rectangle, star } from "./shapes/shapes.js";
17
+ import { MaterialShapes } from "./shapes/material-shapes.js";
18
+ import { Morph } from "./shapes/morph.js";
19
+ import { cubicsToPath, morphToPath, polygonToPath } from "./shapes/path.js";
20
+ import { getMorph, morphPathAt } from "./primitives/morph-path.js";
21
+ import { Overlay } from "./primitives/Overlay.js";
22
+ import { pickDescriptionAria, pickWidgetAria, splitRootProps } from "./utils/root-props.js";
23
+ import { CharacterCounter, ErrorText, FieldErrorIcon, FieldLabel, SupportingText } from "./primitives/Field.js";
24
+ import { selectionControlStyles } from "./primitives/selection-control-styles.js";
25
+ import { SelectionControl } from "./primitives/SelectionControl.js";
26
+ import { useKeepPressedInPlace } from "./utils/keep-pressed-in-place.js";
27
+ import { springProgressWithVelocity, springWithVelocityToLinearEasing } from "./tokens/spring-velocity.js";
28
+ import { Surface, surfaceStyles } from "./primitives/Surface.js";
29
+ import { useM3Morph } from "./primitives/use-m3-morph.js";
30
+ import { splitDataAttributes } from "./utils/split-data-attributes.js";
31
+ import { materialShapeMask } from "./shapes/mask.js";
32
+ import { archShape, arrowShape, boomShape, bunShape, burstShape, circleShape, clamShellShape, clover4LeafShape, clover8LeafShape, cookie12SidedShape, cookie4SidedShape, cookie6SidedShape, cookie7SidedShape, cookie9SidedShape, diamondShape, fanShape, flowerShape, gemShape, ghostishShape, heartShape, materialShapeNames, ovalShape, pentagonShape, pillShape, pixelCircleShape, pixelTriangleShape, puffyDiamondShape, puffyShape, semiCircleShape, slantedShape, softBoomShape, softBurstShape, squareShape, sunnyShape, triangleShape, verySunnyShape } from "./shapes/generated/material-shape-paths.js";
33
+ import { materialShapePaths } from "./shapes/generated/material-shape-path-record.js";
34
+ export { ButtonBase, CharacterCounter, CornerRounding, Cubic, DomDirectionLocale, ErrorText, FieldErrorIcon, FieldLabel, MaterialShapes, Morph, Overlay, RoundedPolygon, SelectionControl, SupportingText, Surface, ThemeScopeContext, TouchTarget, TriggerContext, archShape, arrowShape, boomShape, bunShape, burstShape, circle, circleShape, clamShellShape, clover4LeafShape, clover8LeafShape, cookie12SidedShape, cookie4SidedShape, cookie6SidedShape, cookie7SidedShape, cookie9SidedShape, cubicsToPath, diamondShape, fanShape, flowerShape, gemShape, generateSchemeColors, getM3Spring, getMorph, ghostishShape, heartShape, localeWithDirection, materialShapeMask, materialShapeNames, materialShapePaths, mergeDataTokens, morphPathAt, morphToPath, ovalShape, pentagonShape, pickDescriptionAria, pickWidgetAria, pill, pillShape, pillStar, pixelCircleShape, pixelTriangleShape, polygonToPath, puffyDiamondShape, puffyShape, rectangle, selectionControlStyles, semiCircleShape, slantedShape, softBoomShape, softBurstShape, splitDataAttributes, splitRootProps, springProgressWithVelocity, springWithVelocityToLinearEasing, squareShape, star, sunnyShape, surfaceStyles, triangleShape, useKeepPressedInPlace, useM3Interaction, useM3Morph, useM3Spring, usePresence, useTriggerProps, verySunnyShape };
@@ -0,0 +1,13 @@
1
+ //#region src/shapes/corner-rounding.d.ts
2
+ /**
3
+ * How a polygon corner is rounded: `radius` of the circular arc, and `smoothing` (0..1) that
4
+ * blends the arc into the edges with flanking curves.
5
+ */
6
+ export declare class CornerRounding {
7
+ readonly radius: number;
8
+ readonly smoothing: number;
9
+ static readonly Unrounded: CornerRounding;
10
+ constructor(radius?: number, smoothing?: number);
11
+ }
12
+ //#endregion
13
+ //# sourceMappingURL=corner-rounding.d.ts.map
@@ -0,0 +1,18 @@
1
+ //#region src/shapes/corner-rounding.ts
2
+ /**
3
+ * How a polygon corner is rounded: `radius` of the circular arc, and `smoothing` (0..1) that
4
+ * blends the arc into the edges with flanking curves.
5
+ */
6
+ var CornerRounding = class CornerRounding {
7
+ radius;
8
+ smoothing;
9
+ static Unrounded = new CornerRounding();
10
+ constructor(radius = 0, smoothing = 0) {
11
+ this.radius = radius;
12
+ this.smoothing = smoothing;
13
+ }
14
+ };
15
+ //#endregion
16
+ export { CornerRounding };
17
+
18
+ //# sourceMappingURL=corner-rounding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corner-rounding.js","names":[],"sources":["../../src/shapes/corner-rounding.ts"],"sourcesContent":["/*\n * Port of androidx.graphics.shapes CornerRounding.kt (Apache-2.0, see LICENSE-androidx.md).\n */\n\n/**\n * How a polygon corner is rounded: `radius` of the circular arc, and `smoothing` (0..1) that\n * blends the arc into the edges with flanking curves.\n */\nexport class CornerRounding {\n static readonly Unrounded = new CornerRounding();\n\n constructor(\n readonly radius = 0,\n readonly smoothing = 0,\n ) {}\n}\n"],"mappings":";;;;;AAQA,IAAa,iBAAb,MAAa,eAAe;CAIf;CACA;CAJX,OAAgB,YAAY,IAAI,eAAe;CAE/C,YACE,SAAkB,GAClB,YAAqB,GACrB;EAFS,KAAA,SAAA;EACA,KAAA,YAAA;CACR;AACL"}