@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,253 @@
1
+ "use client";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { mergeDataTokens } from "../../utils/merge-data-tokens.js";
4
+ import { usePresence } from "../../primitives/use-presence.js";
5
+ import { announcePolite } from "../../utils/announce.js";
6
+ import { Button } from "../button/Button.js";
7
+ import { IconButton } from "../icon-button/IconButton.js";
8
+ import { firstTabbable, tabbables } from "../../utils/focus.js";
9
+ import { matchesShortcut } from "../../utils/shortcut.js";
10
+ import { SnackbarHostState, durationMillis } from "./snackbar-state.js";
11
+ import { snackbarHostStyles, snackbarStyles } from "./snackbar-styles.js";
12
+ import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { useObjectRef } from "react-aria";
15
+ //#region src/components/snackbar/Snackbar.tsx
16
+ /** Whether a snackbar is inside a {@link SnackbarHost}, whose live region announces it. */
17
+ const InSnackbarHost = createContext(false);
18
+ /** Material Symbols "close" (Apache-2.0). */
19
+ function CloseIcon() {
20
+ return /* @__PURE__ */ jsx("svg", {
21
+ viewBox: "0 -960 960 960",
22
+ fill: "currentColor",
23
+ children: /* @__PURE__ */ jsx("path", { d: "m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" })
24
+ });
25
+ }
26
+ const DEFAULT_LABELS = { dismiss: "Dismiss" };
27
+ /**
28
+ * M3 snackbar: a brief message about an app process, with an optional action and dismiss
29
+ * button. Usually shown through a {@link SnackbarHost}; render it directly for custom
30
+ * placement. Escape dismisses it while focus is inside (`onEscape`, or `onDismiss`).
31
+ *
32
+ * Outside a host it announces its message politely itself, when it appears and when the
33
+ * message changes, without moving focus (the host's live region does this inside one).
34
+ *
35
+ * @example
36
+ * <Snackbar actionLabel="Undo" onAction={undo} onDismiss={close}>Message archived</Snackbar>
37
+ */
38
+ function Snackbar({ children, actionLabel, onAction, onDismiss, onEscape = onDismiss, labels: labelsProp, actionOnNewLine = false, classNames, className, onKeyDown, ...rest }) {
39
+ const styles = snackbarStyles({
40
+ newLine: actionOnNewLine && actionLabel !== void 0,
41
+ dismissible: onDismiss !== void 0
42
+ });
43
+ const labels = {
44
+ ...DEFAULT_LABELS,
45
+ ...labelsProp
46
+ };
47
+ const hasActions = actionLabel !== void 0 || onDismiss !== void 0;
48
+ const inHost = useContext(InSnackbarHost);
49
+ const messageRef = useRef(null);
50
+ const announced = useRef("");
51
+ useEffect(() => {
52
+ if (inHost) return;
53
+ const text = messageRef.current?.textContent?.trim() ?? "";
54
+ if (!text || text === announced.current) return;
55
+ announced.current = text;
56
+ announcePolite(text);
57
+ });
58
+ return /* @__PURE__ */ jsxs("div", {
59
+ ...rest,
60
+ onKeyDown: (event) => {
61
+ onKeyDown?.(event);
62
+ if (event.key === "Escape" && onEscape && !event.defaultPrevented) {
63
+ event.stopPropagation();
64
+ onEscape();
65
+ }
66
+ },
67
+ "data-tokens": mergeDataTokens("md-comp-snackbar", rest),
68
+ className: styles.root({ class: cn(classNames?.root, className) }),
69
+ children: [/* @__PURE__ */ jsx("div", {
70
+ ref: messageRef,
71
+ className: styles.message({ class: classNames?.message }),
72
+ children
73
+ }), hasActions && /* @__PURE__ */ jsxs("div", {
74
+ className: styles.actions({ class: classNames?.actions }),
75
+ children: [actionLabel !== void 0 && /* @__PURE__ */ jsx(Button, {
76
+ variant: "text",
77
+ onPress: onAction,
78
+ "data-slot": "action",
79
+ className: styles.action({ class: classNames?.action }),
80
+ children: actionLabel
81
+ }), onDismiss && /* @__PURE__ */ jsx(IconButton, {
82
+ variant: "standard",
83
+ density: 0,
84
+ icon: /* @__PURE__ */ jsx(CloseIcon, {}),
85
+ "aria-label": labels.dismiss,
86
+ onPress: onDismiss,
87
+ "data-slot": "dismiss",
88
+ className: styles.dismiss({ class: classNames?.dismiss })
89
+ })]
90
+ })]
91
+ });
92
+ }
93
+ /** A {@link SnackbarHostState} that lives as long as the component. */
94
+ function useSnackbarHostState() {
95
+ const [state] = useState(() => new SnackbarHostState());
96
+ return state;
97
+ }
98
+ /**
99
+ * Shows the snackbars of a {@link SnackbarHostState} one at a time, in a polite live
100
+ * region. Position it with `className` (e.g. `fixed inset-x-0 bottom-0`); a snackbar
101
+ * expands upward from the bottom edge as it enters.
102
+ *
103
+ * - Snackbars without an action leave after 4s (`short`) or 10s (`long`); the timer pauses
104
+ * while the pointer or focus is on the snackbar. On the web, use an auto-dismissing
105
+ * snackbar only alongside inline feedback for the same event: it may be gone before
106
+ * someone reads it. Snackbars with an action stay until acted on or dismissed.
107
+ * - The live region is rendered empty first: a snackbar shown before the host mounts (one
108
+ * at launch) appears once the region has been registered, so it's announced.
109
+ * - `focusShortcut` (F6) moves focus to a snackbar with actions; Escape dismisses it.
110
+ * When it leaves, focus returns to where it was before it entered the snackbar; if that
111
+ * element is gone (an undone row was removed, say), to the control that followed it in
112
+ * the Tab order, or else the one before it.
113
+ *
114
+ * @example
115
+ * const snackbar = useSnackbarHostState();
116
+ * <SnackbarHost state={snackbar} className="fixed inset-x-0 bottom-0" />
117
+ * snackbar.showSnackbar({ message: 'Saved' });
118
+ */
119
+ function SnackbarHost({ state, snackbar, labels, focusShortcut = "F6", className, ref, ...rest }) {
120
+ const current = useSyncExternalStore(state.subscribe, state.getSnapshot, () => null);
121
+ const [items, setItems] = useState([]);
122
+ const [shown, setShown] = useState(null);
123
+ if (current !== shown) {
124
+ setShown(current);
125
+ if (current && !items.includes(current)) setItems([...items, current]);
126
+ }
127
+ const rootRef = useObjectRef(ref);
128
+ const [regionReady, setRegionReady] = useState(false);
129
+ useEffect(() => {
130
+ const timer = setTimeout(() => setRegionReady(true), 100);
131
+ return () => clearTimeout(timer);
132
+ }, []);
133
+ useEffect(() => {
134
+ if (!focusShortcut || !current) return;
135
+ const onKeyDown = (event) => {
136
+ if (event.defaultPrevented || !matchesShortcut(event, focusShortcut)) return;
137
+ const item = rootRef.current?.querySelector(`[data-snackbar-id="${current.id}"]`);
138
+ const target = item ? firstTabbable(item) : null;
139
+ if (!target) return;
140
+ event.preventDefault();
141
+ target.focus();
142
+ };
143
+ document.addEventListener("keydown", onKeyDown);
144
+ return () => document.removeEventListener("keydown", onKeyDown);
145
+ }, [
146
+ focusShortcut,
147
+ current,
148
+ rootRef
149
+ ]);
150
+ const styles = snackbarHostStyles();
151
+ return /* @__PURE__ */ jsx("div", {
152
+ ...rest,
153
+ ref: rootRef,
154
+ "aria-live": "polite",
155
+ "aria-atomic": "false",
156
+ className: styles.root({ class: className }),
157
+ children: (regionReady ? items : []).map((data) => /* @__PURE__ */ jsx(HostItem, {
158
+ data,
159
+ visible: data === current,
160
+ shortcut: focusShortcut && (data.visuals.actionLabel !== void 0 || data.visuals.withDismissAction) ? focusShortcut : void 0,
161
+ onExited: () => setItems((all) => all.filter((item) => item !== data)),
162
+ className: styles.item(),
163
+ children: snackbar ? snackbar(data) : /* @__PURE__ */ jsx(Snackbar, {
164
+ actionLabel: data.visuals.actionLabel,
165
+ onAction: data.performAction,
166
+ onDismiss: data.visuals.withDismissAction ? data.dismiss : void 0,
167
+ onEscape: data.dismiss,
168
+ labels,
169
+ actionOnNewLine: data.visuals.actionOnNewLine,
170
+ children: data.visuals.message
171
+ })
172
+ }, data.id))
173
+ });
174
+ }
175
+ function HostItem({ data, visible, shortcut, onExited, className, children }) {
176
+ const { isPresent, isExiting, exitProps } = usePresence(visible);
177
+ const [paused, setPaused] = useState(false);
178
+ const ref = useRef(null);
179
+ const returnTo = useRef(null);
180
+ const focusInside = useRef(false);
181
+ useLayoutEffect(() => {
182
+ if (visible || !focusInside.current) return;
183
+ focusInside.current = false;
184
+ const record = returnTo.current;
185
+ returnTo.current = null;
186
+ if (record) focusFirstAvailable(record);
187
+ }, [visible]);
188
+ useEffect(() => {
189
+ if (!isPresent) onExited();
190
+ }, [isPresent, onExited]);
191
+ useEffect(() => {
192
+ const ms = durationMillis(data.visuals);
193
+ if (!visible || paused || !Number.isFinite(ms)) return;
194
+ const timer = setTimeout(data.dismiss, ms);
195
+ return () => clearTimeout(timer);
196
+ }, [
197
+ data,
198
+ visible,
199
+ paused
200
+ ]);
201
+ return /* @__PURE__ */ jsx("div", {
202
+ ...exitProps,
203
+ ref,
204
+ "data-exiting": isExiting || void 0,
205
+ "data-snackbar-id": data.id,
206
+ "aria-keyshortcuts": visible ? shortcut : void 0,
207
+ inert: !visible,
208
+ onPointerEnter: () => setPaused(true),
209
+ onPointerLeave: () => setPaused(ref.current?.contains(document.activeElement) ?? false),
210
+ onFocus: (event) => {
211
+ const from = event.relatedTarget;
212
+ if (!focusInside.current && !event.currentTarget.contains(from)) returnTo.current = from instanceof HTMLElement ? focusReturn(from, event.currentTarget) : null;
213
+ focusInside.current = true;
214
+ setPaused(true);
215
+ },
216
+ onBlur: (event) => {
217
+ if (event.currentTarget.contains(event.relatedTarget)) return;
218
+ if (visible) focusInside.current = false;
219
+ setPaused(false);
220
+ },
221
+ className,
222
+ children: /* @__PURE__ */ jsx(InSnackbarHost, {
223
+ value: true,
224
+ children
225
+ })
226
+ });
227
+ }
228
+ /**
229
+ * Records `target` with its neighbours in the page's Tab order (leaving out the snackbar),
230
+ * taken as focus enters the snackbar, so focus has somewhere sensible to go if `target` is
231
+ * removed while the snackbar is open (APG: when the element that had focus is gone, move
232
+ * focus to a logical place rather than letting it fall to the page).
233
+ */
234
+ function focusReturn(target, snackbar) {
235
+ const order = tabbables(target.ownerDocument.body, (el) => snackbar.contains(el));
236
+ const isOutside = (el) => !el.contains(target) && !target.contains(el);
237
+ return {
238
+ target,
239
+ next: order.find((el) => isOutside(el) && target.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING) ?? null,
240
+ previous: order.findLast((el) => isOutside(el) && target.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING) ?? null
241
+ };
242
+ }
243
+ function focusFirstAvailable({ target, next, previous }) {
244
+ [
245
+ target,
246
+ next,
247
+ previous
248
+ ].find((el) => el?.isConnected && !el.closest("[inert]") && !el.matches(":disabled"))?.focus({ preventScroll: true });
249
+ }
250
+ //#endregion
251
+ export { Snackbar, SnackbarHost, useSnackbarHostState };
252
+
253
+ //# sourceMappingURL=Snackbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Snackbar.js","names":[],"sources":["../../../src/components/snackbar/Snackbar.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n type ComponentPropsWithRef,\n type KeyboardEvent,\n} from 'react';\nimport { useObjectRef } from 'react-aria';\nimport { usePresence } from '../../primitives/use-presence';\nimport { announcePolite, LIVE_REGION_DELAY } from '../../utils/announce';\nimport { cn } from '../../utils/cn';\nimport { firstTabbable, tabbables } from '../../utils/focus';\nimport { matchesShortcut } from '../../utils/shortcut';\nimport { Button } from '../button/Button';\nimport { IconButton } from '../icon-button/IconButton';\nimport { durationMillis, SnackbarHostState, type SnackbarData } from './snackbar-state';\nimport { snackbarHostStyles, snackbarStyles } from './snackbar-styles';\nimport { mergeDataTokens } from '../../utils/merge-data-tokens';\n\n/** Whether a snackbar is inside a {@link SnackbarHost}, whose live region announces it. */\nconst InSnackbarHost = createContext(false);\n\n/** Material Symbols \"close\" (Apache-2.0). */\nfunction CloseIcon() {\n return (\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\n <path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" />\n </svg>\n );\n}\n\nexport interface SnackbarClassNames {\n /** The snackbar's container. */\n root?: string;\n /** The message text. */\n message?: string;\n /** The row holding the action and dismiss buttons. */\n actions?: string;\n /** The action button. */\n action?: string;\n /** The dismiss (×) button. */\n dismiss?: string;\n}\n\nexport interface SnackbarLabels {\n /** Name of the dismiss (×) button. @default \"Dismiss\" */\n dismiss: string;\n}\n\nconst DEFAULT_LABELS: SnackbarLabels = { dismiss: 'Dismiss' };\n\ninterface SnackbarOwnProps {\n /** The message. */\n children: React.ReactNode;\n /** Label of the action button. */\n actionLabel?: string;\n /** Called when the action button is pressed. */\n onAction?: () => void;\n /** Shows a dismiss (×) button that calls this. Escape calls it too. */\n onDismiss?: () => void;\n /**\n * Called on Escape while focus is inside, which dismisses a snackbar with or without the ×\n * button. @default onDismiss\n */\n onEscape?: () => void;\n /** Words the snackbar announces, with English defaults. */\n labels?: Partial<SnackbarLabels>;\n /** Put the actions under the message, for long action labels. @default false */\n actionOnNewLine?: boolean;\n /** Classes for each part, by slot. `classNames.root` is merged with `className`. */\n classNames?: SnackbarClassNames;\n}\n\nexport type SnackbarProps = SnackbarOwnProps &\n Omit<ComponentPropsWithRef<'div'>, keyof SnackbarOwnProps>;\n\n/**\n * M3 snackbar: a brief message about an app process, with an optional action and dismiss\n * button. Usually shown through a {@link SnackbarHost}; render it directly for custom\n * placement. Escape dismisses it while focus is inside (`onEscape`, or `onDismiss`).\n *\n * Outside a host it announces its message politely itself, when it appears and when the\n * message changes, without moving focus (the host's live region does this inside one).\n *\n * @example\n * <Snackbar actionLabel=\"Undo\" onAction={undo} onDismiss={close}>Message archived</Snackbar>\n */\nexport function Snackbar({\n children,\n actionLabel,\n onAction,\n onDismiss,\n onEscape = onDismiss,\n labels: labelsProp,\n actionOnNewLine = false,\n classNames,\n className,\n onKeyDown,\n ...rest\n}: SnackbarProps) {\n const styles = snackbarStyles({\n newLine: actionOnNewLine && actionLabel !== undefined,\n dismissible: onDismiss !== undefined,\n });\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const hasActions = actionLabel !== undefined || onDismiss !== undefined;\n const inHost = useContext(InSnackbarHost);\n const messageRef = useRef<HTMLDivElement>(null);\n const announced = useRef('');\n // Runs after every render, but announces only a new message.\n useEffect(() => {\n if (inHost) return;\n const text = messageRef.current?.textContent?.trim() ?? '';\n if (!text || text === announced.current) return;\n announced.current = text;\n announcePolite(text);\n });\n return (\n <div\n {...rest}\n onKeyDown={(event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.key === 'Escape' && onEscape && !event.defaultPrevented) {\n event.stopPropagation();\n onEscape();\n }\n }}\n // The component tokens' hook (snackbar-tokens.ts).\n data-tokens={mergeDataTokens('md-comp-snackbar', rest)}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n <div ref={messageRef} className={styles.message({ class: classNames?.message })}>\n {children}\n </div>\n {hasActions && (\n <div className={styles.actions({ class: classNames?.actions })}>\n {actionLabel !== undefined && (\n <Button\n variant=\"text\"\n onPress={onAction}\n data-slot=\"action\"\n className={styles.action({ class: classNames?.action })}\n >\n {actionLabel}\n </Button>\n )}\n {onDismiss && (\n <IconButton\n variant=\"standard\"\n // The snackbar keeps its 48px height at every density, as a dialog header does.\n density={0}\n icon={<CloseIcon />}\n aria-label={labels.dismiss}\n onPress={onDismiss}\n data-slot=\"dismiss\"\n className={styles.dismiss({ class: classNames?.dismiss })}\n />\n )}\n </div>\n )}\n </div>\n );\n}\n\n/** A {@link SnackbarHostState} that lives as long as the component. */\nexport function useSnackbarHostState(): SnackbarHostState {\n const [state] = useState(() => new SnackbarHostState());\n return state;\n}\n\nexport interface SnackbarHostProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {\n /** The queue of snackbars to show, from `useSnackbarHostState()`. */\n state: SnackbarHostState;\n /** Renders each snackbar; defaults to {@link Snackbar}. */\n snackbar?: (data: SnackbarData) => React.ReactNode;\n /** Words each default snackbar announces, with English defaults. */\n labels?: Partial<SnackbarLabels>;\n /**\n * The key combination that moves focus to a snackbar with actions, as the spec asks for on\n * the web. F6 by default, the key React Aria's toasts take (browsers use it to move between\n * the window's panes): while a snackbar with a control shows, F6 goes to it from anywhere on\n * the page, and pressed again there it stays. Document it where your app lists its\n * shortcuts. `false` turns it off.\n * @default \"F6\"\n */\n focusShortcut?: string | false;\n}\n\n/**\n * Shows the snackbars of a {@link SnackbarHostState} one at a time, in a polite live\n * region. Position it with `className` (e.g. `fixed inset-x-0 bottom-0`); a snackbar\n * expands upward from the bottom edge as it enters.\n *\n * - Snackbars without an action leave after 4s (`short`) or 10s (`long`); the timer pauses\n * while the pointer or focus is on the snackbar. On the web, use an auto-dismissing\n * snackbar only alongside inline feedback for the same event: it may be gone before\n * someone reads it. Snackbars with an action stay until acted on or dismissed.\n * - The live region is rendered empty first: a snackbar shown before the host mounts (one\n * at launch) appears once the region has been registered, so it's announced.\n * - `focusShortcut` (F6) moves focus to a snackbar with actions; Escape dismisses it.\n * When it leaves, focus returns to where it was before it entered the snackbar; if that\n * element is gone (an undone row was removed, say), to the control that followed it in\n * the Tab order, or else the one before it.\n *\n * @example\n * const snackbar = useSnackbarHostState();\n * <SnackbarHost state={snackbar} className=\"fixed inset-x-0 bottom-0\" />\n * snackbar.showSnackbar({ message: 'Saved' });\n */\nexport function SnackbarHost({\n state,\n snackbar,\n labels,\n focusShortcut = 'F6',\n className,\n ref,\n ...rest\n}: SnackbarHostProps) {\n const current = useSyncExternalStore(state.subscribe, state.getSnapshot, () => null);\n // Keep a leaving snackbar rendered while the next one fades in (Compose cross-fades).\n const [items, setItems] = useState<SnackbarData[]>([]);\n const [shown, setShown] = useState<SnackbarData | null>(null);\n if (current !== shown) {\n setShown(current);\n if (current && !items.includes(current)) setItems([...items, current]);\n }\n const rootRef = useObjectRef(ref);\n // Screen readers often skip content that arrives with its live region, so snackbars go in\n // only once the empty region has been on the page for a moment.\n const [regionReady, setRegionReady] = useState(false);\n useEffect(() => {\n const timer = setTimeout(() => setRegionReady(true), LIVE_REGION_DELAY);\n return () => clearTimeout(timer);\n }, []);\n\n // The shortcut focuses the shown snackbar's first control, if it has one.\n useEffect(() => {\n if (!focusShortcut || !current) return;\n const onKeyDown = (event: globalThis.KeyboardEvent) => {\n if (event.defaultPrevented || !matchesShortcut(event, focusShortcut)) return;\n const item = rootRef.current?.querySelector(`[data-snackbar-id=\"${current.id}\"]`);\n const target = item ? firstTabbable(item) : null;\n if (!target) return;\n event.preventDefault();\n target.focus();\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [focusShortcut, current, rootRef]);\n\n const styles = snackbarHostStyles();\n return (\n <div\n {...rest}\n ref={rootRef}\n aria-live=\"polite\"\n aria-atomic=\"false\"\n className={styles.root({ class: className })}\n >\n {(regionReady ? items : []).map((data) => (\n <HostItem\n key={data.id}\n data={data}\n visible={data === current}\n shortcut={\n focusShortcut &&\n (data.visuals.actionLabel !== undefined || data.visuals.withDismissAction)\n ? focusShortcut\n : undefined\n }\n onExited={() => setItems((all) => all.filter((item) => item !== data))}\n className={styles.item()}\n >\n {snackbar ? (\n snackbar(data)\n ) : (\n <Snackbar\n actionLabel={data.visuals.actionLabel}\n onAction={data.performAction}\n onDismiss={data.visuals.withDismissAction ? data.dismiss : undefined}\n onEscape={data.dismiss}\n labels={labels}\n actionOnNewLine={data.visuals.actionOnNewLine}\n >\n {data.visuals.message}\n </Snackbar>\n )}\n </HostItem>\n ))}\n </div>\n );\n}\n\nfunction HostItem({\n data,\n visible,\n shortcut,\n onExited,\n className,\n children,\n}: {\n data: SnackbarData;\n visible: boolean;\n shortcut: string | undefined;\n onExited: () => void;\n className: string;\n children: React.ReactNode;\n}) {\n const { isPresent, isExiting, exitProps } = usePresence(visible);\n const [paused, setPaused] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n // Where focus was before it entered, and whether it's still inside: when the snackbar\n // leaves with focus in it, focus goes back there rather than falling to the page.\n const returnTo = useRef<FocusReturn | null>(null);\n const focusInside = useRef(false);\n\n useLayoutEffect(() => {\n if (visible || !focusInside.current) return;\n focusInside.current = false;\n const record = returnTo.current;\n returnTo.current = null;\n if (record) focusFirstAvailable(record);\n }, [visible]);\n\n useEffect(() => {\n if (!isPresent) onExited();\n }, [isPresent, onExited]);\n\n // Auto-dismiss after the duration, paused while hovered or focused within.\n useEffect(() => {\n const ms = durationMillis(data.visuals);\n if (!visible || paused || !Number.isFinite(ms)) return;\n const timer = setTimeout(data.dismiss, ms);\n return () => clearTimeout(timer);\n }, [data, visible, paused]);\n\n return (\n <div\n {...exitProps}\n ref={ref}\n data-exiting={isExiting || undefined}\n data-snackbar-id={data.id}\n aria-keyshortcuts={visible ? shortcut : undefined}\n inert={!visible}\n onPointerEnter={() => setPaused(true)}\n onPointerLeave={() => setPaused(ref.current?.contains(document.activeElement) ?? false)}\n onFocus={(event) => {\n const from = event.relatedTarget;\n if (!focusInside.current && !event.currentTarget.contains(from as Node | null)) {\n returnTo.current =\n from instanceof HTMLElement ? focusReturn(from, event.currentTarget) : null;\n }\n focusInside.current = true;\n setPaused(true);\n }}\n onBlur={(event) => {\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return;\n // A snackbar that is leaving keeps the record, to hand focus back.\n if (visible) focusInside.current = false;\n setPaused(false);\n }}\n className={className}\n >\n <InSnackbarHost value>{children}</InSnackbarHost>\n </div>\n );\n}\n\n/** Where focus goes back to when a snackbar leaves, with fallbacks in Tab order. */\ninterface FocusReturn {\n target: HTMLElement;\n next: HTMLElement | null;\n previous: HTMLElement | null;\n}\n\n/**\n * Records `target` with its neighbours in the page's Tab order (leaving out the snackbar),\n * taken as focus enters the snackbar, so focus has somewhere sensible to go if `target` is\n * removed while the snackbar is open (APG: when the element that had focus is gone, move\n * focus to a logical place rather than letting it fall to the page).\n */\nfunction focusReturn(target: HTMLElement, snackbar: Element): FocusReturn {\n const order = tabbables(target.ownerDocument.body, (el) => snackbar.contains(el));\n const isOutside = (el: HTMLElement) => !el.contains(target) && !target.contains(el);\n const next =\n order.find(\n (el) =>\n isOutside(el) && target.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING,\n ) ?? null;\n const previous =\n order.findLast(\n (el) =>\n isOutside(el) && target.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING,\n ) ?? null;\n return { target, next, previous };\n}\n\nfunction focusFirstAvailable({ target, next, previous }: FocusReturn) {\n const available = [target, next, previous].find(\n (el) => el?.isConnected && !el.closest('[inert]') && !el.matches(':disabled'),\n );\n // The element may have scrolled out of view while the snackbar had focus; returning\n // focus never scrolls the page back to it (2026-10-15).\n available?.focus({ preventScroll: true });\n}\n"],"mappings":"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"}
@@ -0,0 +1,58 @@
1
+ //#region src/components/snackbar/snackbar-state.d.ts
2
+ export type SnackbarDuration = 'short' | 'long' | 'indefinite';
3
+ export type SnackbarResult = 'action-performed' | 'dismissed';
4
+ export interface SnackbarVisuals {
5
+ message: string;
6
+ /** Label of the action button. */
7
+ actionLabel?: string;
8
+ /** Show a dismiss (×) button. */
9
+ withDismissAction?: boolean;
10
+ /** Put the action under the message, for long action labels. */
11
+ actionOnNewLine?: boolean;
12
+ /**
13
+ * How long it stays without an action. A snackbar with an action always stays until it's
14
+ * acted on or dismissed, as the spec requires, so this is ignored then.
15
+ * @default "short"
16
+ */
17
+ duration?: SnackbarDuration;
18
+ }
19
+ export interface ShowSnackbarOptions {
20
+ /**
21
+ * Replace the snackbar on screen (which resolves `'dismissed'`) instead of queueing behind
22
+ * it, for a snackbar with updated information.
23
+ */
24
+ replace?: boolean;
25
+ }
26
+ export interface SnackbarData {
27
+ /** Unique per shown snackbar. */
28
+ id: number;
29
+ visuals: SnackbarVisuals;
30
+ performAction: () => void;
31
+ dismiss: () => void;
32
+ }
33
+ /**
34
+ * Holds the snackbar queue for a {@link SnackbarHost}. Create one per host with
35
+ * `useSnackbarHostState()`.
36
+ */
37
+ export declare class SnackbarHostState {
38
+ private current;
39
+ private queue;
40
+ private listeners;
41
+ /** The snackbar being shown, if any. */
42
+ get currentSnackbarData(): SnackbarData | null;
43
+ /**
44
+ * Shows a snackbar once any current one has gone (or at once with `replace`), and resolves
45
+ * with how it ended.
46
+ *
47
+ * @example
48
+ * const result = await snackbar.showSnackbar({ message: 'Archived', actionLabel: 'Undo' });
49
+ * if (result === 'action-performed') unarchive();
50
+ * snackbar.showSnackbar('3 files uploaded', { replace: true });
51
+ */
52
+ showSnackbar(visuals: SnackbarVisuals | string, { replace }?: ShowSnackbarOptions): Promise<SnackbarResult>;
53
+ subscribe: (listener: () => void) => () => void;
54
+ getSnapshot: () => SnackbarData | null;
55
+ private emit;
56
+ }
57
+ //#endregion
58
+ //# sourceMappingURL=snackbar-state.d.ts.map
@@ -0,0 +1,73 @@
1
+ //#region src/components/snackbar/snackbar-state.ts
2
+ /**
3
+ * Compose `SnackbarDuration.toMillis` (without the platform accessibility multiplier). A
4
+ * snackbar with an action never times out: "Snackbars with actions shouldn't auto-dismiss."
5
+ */
6
+ function durationMillis({ duration = "short", actionLabel }) {
7
+ if (actionLabel !== void 0) return Infinity;
8
+ return duration === "short" ? 4e3 : duration === "long" ? 1e4 : Infinity;
9
+ }
10
+ let nextId = 1;
11
+ /**
12
+ * Holds the snackbar queue for a {@link SnackbarHost}. Create one per host with
13
+ * `useSnackbarHostState()`.
14
+ */
15
+ var SnackbarHostState = class {
16
+ current = null;
17
+ queue = [];
18
+ listeners = /* @__PURE__ */ new Set();
19
+ /** The snackbar being shown, if any. */
20
+ get currentSnackbarData() {
21
+ return this.current;
22
+ }
23
+ /**
24
+ * Shows a snackbar once any current one has gone (or at once with `replace`), and resolves
25
+ * with how it ended.
26
+ *
27
+ * @example
28
+ * const result = await snackbar.showSnackbar({ message: 'Archived', actionLabel: 'Undo' });
29
+ * if (result === 'action-performed') unarchive();
30
+ * snackbar.showSnackbar('3 files uploaded', { replace: true });
31
+ */
32
+ showSnackbar(visuals, { replace = false } = {}) {
33
+ const resolved = typeof visuals === "string" ? { message: visuals } : visuals;
34
+ return new Promise((resolve) => {
35
+ const show = () => {
36
+ const finish = (result) => {
37
+ if (this.current?.id !== data.id) return;
38
+ this.current = null;
39
+ this.emit();
40
+ resolve(result);
41
+ this.queue.shift()?.();
42
+ };
43
+ const data = {
44
+ id: nextId++,
45
+ visuals: resolved,
46
+ performAction: () => finish("action-performed"),
47
+ dismiss: () => finish("dismissed")
48
+ };
49
+ this.current = data;
50
+ this.emit();
51
+ };
52
+ if (!this.current) show();
53
+ else if (replace) {
54
+ this.queue.unshift(show);
55
+ this.current.dismiss();
56
+ } else this.queue.push(show);
57
+ });
58
+ }
59
+ subscribe = (listener) => {
60
+ this.listeners.add(listener);
61
+ return () => {
62
+ this.listeners.delete(listener);
63
+ };
64
+ };
65
+ getSnapshot = () => this.current;
66
+ emit() {
67
+ this.listeners.forEach((listener) => listener());
68
+ }
69
+ };
70
+ //#endregion
71
+ export { SnackbarHostState, durationMillis };
72
+
73
+ //# sourceMappingURL=snackbar-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snackbar-state.js","names":[],"sources":["../../../src/components/snackbar/snackbar-state.ts"],"sourcesContent":["/*\n * Port of Compose's SnackbarHostState: snackbars are queued and shown one at a time;\n * `showSnackbar` resolves when the shown snackbar is acted on, dismissed or times out.\n */\n\nexport type SnackbarDuration = 'short' | 'long' | 'indefinite';\nexport type SnackbarResult = 'action-performed' | 'dismissed';\n\nexport interface SnackbarVisuals {\n message: string;\n /** Label of the action button. */\n actionLabel?: string;\n /** Show a dismiss (×) button. */\n withDismissAction?: boolean;\n /** Put the action under the message, for long action labels. */\n actionOnNewLine?: boolean;\n /**\n * How long it stays without an action. A snackbar with an action always stays until it's\n * acted on or dismissed, as the spec requires, so this is ignored then.\n * @default \"short\"\n */\n duration?: SnackbarDuration;\n}\n\nexport interface ShowSnackbarOptions {\n /**\n * Replace the snackbar on screen (which resolves `'dismissed'`) instead of queueing behind\n * it, for a snackbar with updated information.\n */\n replace?: boolean;\n}\n\nexport interface SnackbarData {\n /** Unique per shown snackbar. */\n id: number;\n visuals: SnackbarVisuals;\n performAction: () => void;\n dismiss: () => void;\n}\n\n/**\n * Compose `SnackbarDuration.toMillis` (without the platform accessibility multiplier). A\n * snackbar with an action never times out: \"Snackbars with actions shouldn't auto-dismiss.\"\n */\nexport function durationMillis({ duration = 'short', actionLabel }: SnackbarVisuals): number {\n if (actionLabel !== undefined) return Infinity;\n return duration === 'short' ? 4000 : duration === 'long' ? 10000 : Infinity;\n}\n\nlet nextId = 1;\n\n/**\n * Holds the snackbar queue for a {@link SnackbarHost}. Create one per host with\n * `useSnackbarHostState()`.\n */\nexport class SnackbarHostState {\n private current: SnackbarData | null = null;\n private queue: (() => void)[] = [];\n private listeners = new Set<() => void>();\n\n /** The snackbar being shown, if any. */\n get currentSnackbarData(): SnackbarData | null {\n return this.current;\n }\n\n /**\n * Shows a snackbar once any current one has gone (or at once with `replace`), and resolves\n * with how it ended.\n *\n * @example\n * const result = await snackbar.showSnackbar({ message: 'Archived', actionLabel: 'Undo' });\n * if (result === 'action-performed') unarchive();\n * snackbar.showSnackbar('3 files uploaded', { replace: true });\n */\n showSnackbar(\n visuals: SnackbarVisuals | string,\n { replace = false }: ShowSnackbarOptions = {},\n ): Promise<SnackbarResult> {\n const resolved = typeof visuals === 'string' ? { message: visuals } : visuals;\n return new Promise((resolve) => {\n const show = () => {\n const finish = (result: SnackbarResult) => {\n if (this.current?.id !== data.id) return;\n this.current = null;\n this.emit();\n resolve(result);\n this.queue.shift()?.();\n };\n const data: SnackbarData = {\n id: nextId++,\n visuals: resolved,\n performAction: () => finish('action-performed'),\n dismiss: () => finish('dismissed'),\n };\n this.current = data;\n this.emit();\n };\n if (!this.current) show();\n else if (replace) {\n this.queue.unshift(show);\n this.current.dismiss();\n } else this.queue.push(show);\n });\n }\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n getSnapshot = () => this.current;\n\n private emit() {\n this.listeners.forEach((listener) => listener());\n }\n}\n"],"mappings":";;;;;AA4CA,SAAgB,eAAe,EAAE,WAAW,SAAS,eAAwC;CAC3F,IAAI,gBAAgB,KAAA,GAAW,OAAO;CACtC,OAAO,aAAa,UAAU,MAAO,aAAa,SAAS,MAAQ;AACrE;AAEA,IAAI,SAAS;;;;;AAMb,IAAa,oBAAb,MAA+B;CAC7B,UAAuC;CACvC,QAAgC,CAAC;CACjC,4BAAoB,IAAI,IAAgB;;CAGxC,IAAI,sBAA2C;EAC7C,OAAO,KAAK;CACd;;;;;;;;;;CAWA,aACE,SACA,EAAE,UAAU,UAA+B,CAAC,GACnB;EACzB,MAAM,WAAW,OAAO,YAAY,WAAW,EAAE,SAAS,QAAQ,IAAI;EACtE,OAAO,IAAI,SAAS,YAAY;GAC9B,MAAM,aAAa;IACjB,MAAM,UAAU,WAA2B;KACzC,IAAI,KAAK,SAAS,OAAO,KAAK,IAAI;KAClC,KAAK,UAAU;KACf,KAAK,KAAK;KACV,QAAQ,MAAM;KACd,KAAK,MAAM,MAAM,CAAC,GAAG;IACvB;IACA,MAAM,OAAqB;KACzB,IAAI;KACJ,SAAS;KACT,qBAAqB,OAAO,kBAAkB;KAC9C,eAAe,OAAO,WAAW;IACnC;IACA,KAAK,UAAU;IACf,KAAK,KAAK;GACZ;GACA,IAAI,CAAC,KAAK,SAAS,KAAK;QACnB,IAAI,SAAS;IAChB,KAAK,MAAM,QAAQ,IAAI;IACvB,KAAK,QAAQ,QAAQ;GACvB,OAAO,KAAK,MAAM,KAAK,IAAI;EAC7B,CAAC;CACH;CAEA,aAAa,aAAyB;EACpC,KAAK,UAAU,IAAI,QAAQ;EAC3B,aAAa;GACX,KAAK,UAAU,OAAO,QAAQ;EAChC;CACF;CAEA,oBAAoB,KAAK;CAEzB,OAAe;EACb,KAAK,UAAU,SAAS,aAAa,SAAS,CAAC;CACjD;AACF"}
@@ -0,0 +1,109 @@
1
+ import { VariantProps } from "../../utils/tv.js";
2
+ //#region src/components/snackbar/snackbar-styles.d.ts
3
+ /** Variant definitions for {@link Snackbar}; extend them to add variants. */
4
+ export declare const snackbarStyles: import("tailwind-variants").TVReturnType<{
5
+ newLine: {
6
+ false: {
7
+ root: string;
8
+ message: string;
9
+ };
10
+ true: {
11
+ root: string;
12
+ message: string;
13
+ actions: string;
14
+ };
15
+ };
16
+ dismissible: {
17
+ true: {};
18
+ false: {};
19
+ };
20
+ }, {
21
+ root: string[];
22
+ message: string;
23
+ actions: string;
24
+ action: string;
25
+ dismiss: string;
26
+ }, undefined, {
27
+ newLine: {
28
+ false: {
29
+ root: string;
30
+ message: string;
31
+ };
32
+ true: {
33
+ root: string;
34
+ message: string;
35
+ actions: string;
36
+ };
37
+ };
38
+ dismissible: {
39
+ true: {};
40
+ false: {};
41
+ };
42
+ }, {
43
+ root: string[];
44
+ message: string;
45
+ actions: string;
46
+ action: string;
47
+ dismiss: string;
48
+ }, import("tailwind-variants").TVReturnTypeLike<{
49
+ newLine: {
50
+ false: {
51
+ root: string;
52
+ message: string;
53
+ };
54
+ true: {
55
+ root: string;
56
+ message: string;
57
+ actions: string;
58
+ };
59
+ };
60
+ dismissible: {
61
+ true: {};
62
+ false: {};
63
+ };
64
+ }, {
65
+ root: string[];
66
+ message: string;
67
+ actions: string;
68
+ action: string;
69
+ dismiss: string;
70
+ }>>;
71
+ /** Variant definitions for {@link SnackbarHost}. */
72
+ export declare const snackbarHostStyles: import("tailwind-variants").TVReturnType<{
73
+ [key: string]: {
74
+ [key: string]: import("tailwind-variants").ClassValue | {
75
+ root?: import("tailwind-variants").ClassValue;
76
+ item?: import("tailwind-variants").ClassValue;
77
+ };
78
+ };
79
+ } | {
80
+ [x: string]: {
81
+ [x: string]: import("tailwind-variants").ClassValue | {
82
+ root?: import("tailwind-variants").ClassValue;
83
+ item?: import("tailwind-variants").ClassValue;
84
+ };
85
+ };
86
+ } | {}, {
87
+ root: string;
88
+ item: string[];
89
+ }, undefined, {
90
+ [key: string]: {
91
+ [key: string]: import("tailwind-variants").ClassValue | {
92
+ root?: import("tailwind-variants").ClassValue;
93
+ item?: import("tailwind-variants").ClassValue;
94
+ };
95
+ };
96
+ } | {}, {
97
+ root: string;
98
+ item: string[];
99
+ }, import("tailwind-variants").TVReturnTypeLike<unknown, {
100
+ root: string;
101
+ item: string[];
102
+ }>>;
103
+ /**
104
+ * The variants of {@link snackbarStyles}, for building on its styles. They are the recipe's keys, not
105
+ * component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.
106
+ */
107
+ export type SnackbarStyleProps = VariantProps<typeof snackbarStyles>;
108
+ //#endregion
109
+ //# sourceMappingURL=snackbar-styles.d.ts.map
@@ -0,0 +1,67 @@
1
+ import { tv } from "../../utils/tv.js";
2
+ //#region src/components/snackbar/snackbar-styles.ts
3
+ /** Variant definitions for {@link Snackbar}; extend them to add variants. */
4
+ const snackbarStyles = tv({
5
+ slots: {
6
+ root: [
7
+ "flex w-full max-w-[600px] min-h-[48px] ps-[16px]",
8
+ "rounded-[var(--_md-comp-snackbar-container-shape)] bg-[var(--_md-comp-snackbar-container-color)]",
9
+ "text-body-medium text-[color:var(--_md-comp-snackbar-supporting-text-color)]",
10
+ "shadow-[shadow:var(--_md-comp-snackbar-container-elevation)]",
11
+ "forced-colors:outline-solid forced-colors:outline-1 forced-colors:outline-[CanvasText]"
12
+ ],
13
+ message: "min-w-0",
14
+ actions: "flex shrink-0 items-center",
15
+ action: "text-[color:var(--_md-comp-snackbar-action-label-text-color)]",
16
+ dismiss: "text-[color:var(--_md-comp-snackbar-icon-color)]"
17
+ },
18
+ variants: {
19
+ newLine: {
20
+ false: {
21
+ root: "items-center",
22
+ message: "flex-1 py-[14px]"
23
+ },
24
+ true: {
25
+ root: "flex-col",
26
+ message: "py-[14px] pe-[16px]",
27
+ actions: "self-end pb-[4px]"
28
+ }
29
+ },
30
+ dismissible: {
31
+ true: {},
32
+ false: {}
33
+ }
34
+ },
35
+ compoundVariants: [{
36
+ newLine: false,
37
+ dismissible: false,
38
+ class: {
39
+ root: "pe-[8px]",
40
+ message: "pe-[8px]"
41
+ }
42
+ }, {
43
+ newLine: true,
44
+ dismissible: false,
45
+ class: { actions: "pe-[8px]" }
46
+ }],
47
+ defaultVariants: {
48
+ newLine: false,
49
+ dismissible: false
50
+ }
51
+ });
52
+ /** Variant definitions for {@link SnackbarHost}. */
53
+ const snackbarHostStyles = tv({ slots: {
54
+ root: "grid justify-items-center",
55
+ item: [
56
+ "col-start-1 row-start-1 flex w-full justify-center p-[12px] opacity-100",
57
+ "[clip-path:inset(-32px)] starting:[clip-path:inset(100%_-32px_-32px_-32px)] data-exiting:[clip-path:inset(100%_-32px_-32px_-32px)]",
58
+ "[transition-property:opacity,clip-path] motion-reduce:[transition-property:opacity]",
59
+ "[transition-duration:var(--md-sys-motion-spring-effects-fast-duration),var(--md-sys-motion-spring-spatial-fast-duration)]",
60
+ "[transition-timing-function:var(--md-sys-motion-spring-effects-fast-easing),var(--md-sys-motion-spring-spatial-fast-easing)]",
61
+ "starting:opacity-0 data-exiting:opacity-0"
62
+ ]
63
+ } });
64
+ //#endregion
65
+ export { snackbarHostStyles, snackbarStyles };
66
+
67
+ //# sourceMappingURL=snackbar-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snackbar-styles.js","names":[],"sources":["../../../src/components/snackbar/snackbar-styles.ts"],"sourcesContent":["import { tv, type VariantProps } from '../../utils/tv';\n\n/*\n * Values follow Compose Material 3 (Snackbar.kt with its styling fix, SnackbarHost.kt,\n * SnackbarTokens): `inverse-surface` at level 3 with 4px corners, up to 600px wide and at\n * least 48px tall, `body-medium` `inverse-on-surface` text with 16px before it and 14px\n * above and below, an `inverse-primary` text-button action and an `inverse-on-surface`\n * dismiss icon button; 8px after the action when there is no dismiss button. On a new\n * line, the actions sit at the end, 4px from the bottom. The host pads each snackbar by\n * 12px and fades it on fast effects while it expands upward from the bottom edge on fast\n * spatial (a clip-path reveal: the spec avoids scale and z-axis motion, and \"a snackbar at\n * the bottom of the screen expands upwards\"). The clip rests 32px outside the box so the\n * shadow shows; reduced motion keeps only the fade.\n *\n * The colours, corners and shadow come from the snackbar's component tokens\n * (`snackbar-tokens.ts`, `--md-comp-snackbar-*`); the root carries\n * `data-tokens=\"md-comp-snackbar\"`, and the parts read one private variable each. A consumer\n * class (`bg-surface-container`) still wins.\n * Every class is written out in full so Tailwind can find it.\n */\n\n/** Variant definitions for {@link Snackbar}; extend them to add variants. */\nexport const snackbarStyles = tv({\n slots: {\n root: [\n 'flex w-full max-w-[600px] min-h-[48px] ps-[16px]',\n 'rounded-[var(--_md-comp-snackbar-container-shape)] bg-[var(--_md-comp-snackbar-container-color)]',\n 'text-body-medium text-[color:var(--_md-comp-snackbar-supporting-text-color)]',\n 'shadow-[shadow:var(--_md-comp-snackbar-container-elevation)]',\n // Forced colours drop the fill and shadow, so the snackbar draws its edge instead.\n 'forced-colors:outline-solid forced-colors:outline-1 forced-colors:outline-[CanvasText]',\n ],\n message: 'min-w-0',\n actions: 'flex shrink-0 items-center',\n action: 'text-[color:var(--_md-comp-snackbar-action-label-text-color)]',\n dismiss: 'text-[color:var(--_md-comp-snackbar-icon-color)]',\n },\n variants: {\n newLine: {\n false: { root: 'items-center', message: 'flex-1 py-[14px]' },\n true: {\n root: 'flex-col',\n message: 'py-[14px] pe-[16px]',\n actions: 'self-end pb-[4px]',\n },\n },\n dismissible: { true: {}, false: {} },\n },\n compoundVariants: [\n { newLine: false, dismissible: false, class: { root: 'pe-[8px]', message: 'pe-[8px]' } },\n { newLine: true, dismissible: false, class: { actions: 'pe-[8px]' } },\n ],\n defaultVariants: { newLine: false, dismissible: false },\n});\n\n/** Variant definitions for {@link SnackbarHost}. */\nexport const snackbarHostStyles = tv({\n slots: {\n root: 'grid justify-items-center',\n item: [\n 'col-start-1 row-start-1 flex w-full justify-center p-[12px] opacity-100',\n '[clip-path:inset(-32px)] starting:[clip-path:inset(100%_-32px_-32px_-32px)] data-exiting:[clip-path:inset(100%_-32px_-32px_-32px)]',\n '[transition-property:opacity,clip-path] motion-reduce:[transition-property:opacity]',\n '[transition-duration:var(--md-sys-motion-spring-effects-fast-duration),var(--md-sys-motion-spring-spatial-fast-duration)]',\n '[transition-timing-function:var(--md-sys-motion-spring-effects-fast-easing),var(--md-sys-motion-spring-spatial-fast-easing)]',\n 'starting:opacity-0 data-exiting:opacity-0',\n ],\n },\n});\n\n/**\n * The variants of {@link snackbarStyles}, for building on its styles. They are the recipe's keys, not\n * component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.\n */\nexport type SnackbarStyleProps = VariantProps<typeof snackbarStyles>;\n"],"mappings":";;;AAsBA,MAAa,iBAAiB,GAAG;CAC/B,OAAO;EACL,MAAM;GACJ;GACA;GACA;GACA;GAEA;EACF;EACA,SAAS;EACT,SAAS;EACT,QAAQ;EACR,SAAS;CACX;CACA,UAAU;EACR,SAAS;GACP,OAAO;IAAE,MAAM;IAAgB,SAAS;GAAmB;GAC3D,MAAM;IACJ,MAAM;IACN,SAAS;IACT,SAAS;GACX;EACF;EACA,aAAa;GAAE,MAAM,CAAC;GAAG,OAAO,CAAC;EAAE;CACrC;CACA,kBAAkB,CAChB;EAAE,SAAS;EAAO,aAAa;EAAO,OAAO;GAAE,MAAM;GAAY,SAAS;EAAW;CAAE,GACvF;EAAE,SAAS;EAAM,aAAa;EAAO,OAAO,EAAE,SAAS,WAAW;CAAE,CACtE;CACA,iBAAiB;EAAE,SAAS;EAAO,aAAa;CAAM;AACxD,CAAC;;AAGD,MAAa,qBAAqB,GAAG,EACnC,OAAO;CACL,MAAM;CACN,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;CACF;AACF,EACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ComponentTokenSet } from "../../tokens/component.js";
2
+ import "../../index.js";
3
+ //#region src/components/snackbar/snackbar-tokens.d.ts
4
+ /** The tokens of {@link Snackbar}: `--md-comp-snackbar-<part>`. */
5
+ export declare const snackbarTokenSet: ComponentTokenSet<"container-color" | "container-elevation" | "icon-color" | "container-shape" | "supporting-text-color" | "action-label-text-color">;
6
+ //#endregion
7
+ //# sourceMappingURL=snackbar-tokens.d.ts.map