@windmorph/react 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (761) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +23 -0
  3. package/README.md +149 -2
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +112 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/components/app-bar/AppBarItems.js +23 -0
  8. package/dist/components/app-bar/AppBarItems.js.map +1 -0
  9. package/dist/components/app-bar/TopAppBar.d.ts +89 -0
  10. package/dist/components/app-bar/TopAppBar.js +103 -0
  11. package/dist/components/app-bar/TopAppBar.js.map +1 -0
  12. package/dist/components/app-bar/app-bar-styles.d.ts +280 -0
  13. package/dist/components/app-bar/app-bar-styles.js +142 -0
  14. package/dist/components/app-bar/app-bar-styles.js.map +1 -0
  15. package/dist/components/app-bar/app-bar-tokens.d.ts +7 -0
  16. package/dist/components/app-bar/app-bar-tokens.js +64 -0
  17. package/dist/components/app-bar/app-bar-tokens.js.map +1 -0
  18. package/dist/components/app-bar/use-app-bar-scroll.d.ts +6 -0
  19. package/dist/components/app-bar/use-app-bar-scroll.js +139 -0
  20. package/dist/components/app-bar/use-app-bar-scroll.js.map +1 -0
  21. package/dist/components/autocomplete/Autocomplete.d.ts +142 -0
  22. package/dist/components/autocomplete/Autocomplete.js +284 -0
  23. package/dist/components/autocomplete/Autocomplete.js.map +1 -0
  24. package/dist/components/badge/Badge.d.ts +71 -0
  25. package/dist/components/badge/Badge.js +72 -0
  26. package/dist/components/badge/Badge.js.map +1 -0
  27. package/dist/components/badge/badge-styles.d.ts +100 -0
  28. package/dist/components/badge/badge-styles.js +43 -0
  29. package/dist/components/badge/badge-styles.js.map +1 -0
  30. package/dist/components/badge/badge-tokens.d.ts +7 -0
  31. package/dist/components/badge/badge-tokens.js +40 -0
  32. package/dist/components/badge/badge-tokens.js.map +1 -0
  33. package/dist/components/button/Button.d.ts +91 -0
  34. package/dist/components/button/Button.js +96 -0
  35. package/dist/components/button/Button.js.map +1 -0
  36. package/dist/components/button/ButtonContext.d.ts +30 -0
  37. package/dist/components/button/ButtonContext.js +18 -0
  38. package/dist/components/button/ButtonContext.js.map +1 -0
  39. package/dist/components/button/DensityZeroButtons.js +25 -0
  40. package/dist/components/button/DensityZeroButtons.js.map +1 -0
  41. package/dist/components/button/button-pending.d.ts +10 -0
  42. package/dist/components/button/button-pending.js +166 -0
  43. package/dist/components/button/button-pending.js.map +1 -0
  44. package/dist/components/button/button-styles.d.ts +216 -0
  45. package/dist/components/button/button-styles.js +199 -0
  46. package/dist/components/button/button-styles.js.map +1 -0
  47. package/dist/components/button/button-tokens.d.ts +10 -0
  48. package/dist/components/button/button-tokens.js +257 -0
  49. package/dist/components/button/button-tokens.js.map +1 -0
  50. package/dist/components/button/connected-shapes.js +152 -0
  51. package/dist/components/button/connected-shapes.js.map +1 -0
  52. package/dist/components/card/Card.d.ts +60 -0
  53. package/dist/components/card/Card.js +69 -0
  54. package/dist/components/card/Card.js.map +1 -0
  55. package/dist/components/card/card-styles.d.ts +42 -0
  56. package/dist/components/card/card-styles.js +64 -0
  57. package/dist/components/card/card-styles.js.map +1 -0
  58. package/dist/components/card/card-tokens.d.ts +7 -0
  59. package/dist/components/card/card-tokens.js +84 -0
  60. package/dist/components/card/card-tokens.js.map +1 -0
  61. package/dist/components/carousel/Carousel.d.ts +124 -0
  62. package/dist/components/carousel/Carousel.js +387 -0
  63. package/dist/components/carousel/Carousel.js.map +1 -0
  64. package/dist/components/carousel/carousel-keylines.js +486 -0
  65. package/dist/components/carousel/carousel-keylines.js.map +1 -0
  66. package/dist/components/carousel/carousel-press-area.js +35 -0
  67. package/dist/components/carousel/carousel-press-area.js.map +1 -0
  68. package/dist/components/carousel/carousel-styles.d.ts +188 -0
  69. package/dist/components/carousel/carousel-styles.js +116 -0
  70. package/dist/components/carousel/carousel-styles.js.map +1 -0
  71. package/dist/components/carousel/carousel-tokens.d.ts +7 -0
  72. package/dist/components/carousel/carousel-tokens.js +18 -0
  73. package/dist/components/carousel/carousel-tokens.js.map +1 -0
  74. package/dist/components/checkbox/Checkbox.d.ts +78 -0
  75. package/dist/components/checkbox/Checkbox.js +77 -0
  76. package/dist/components/checkbox/Checkbox.js.map +1 -0
  77. package/dist/components/checkbox/checkbox-box.js +34 -0
  78. package/dist/components/checkbox/checkbox-box.js.map +1 -0
  79. package/dist/components/checkbox/checkbox-styles.d.ts +100 -0
  80. package/dist/components/checkbox/checkbox-styles.js +54 -0
  81. package/dist/components/checkbox/checkbox-styles.js.map +1 -0
  82. package/dist/components/checkbox/checkbox-tokens.d.ts +7 -0
  83. package/dist/components/checkbox/checkbox-tokens.js +41 -0
  84. package/dist/components/checkbox/checkbox-tokens.js.map +1 -0
  85. package/dist/components/chip/Chip.d.ts +171 -0
  86. package/dist/components/chip/Chip.js +348 -0
  87. package/dist/components/chip/Chip.js.map +1 -0
  88. package/dist/components/chip/ChipSet.d.ts +70 -0
  89. package/dist/components/chip/ChipSet.js +198 -0
  90. package/dist/components/chip/ChipSet.js.map +1 -0
  91. package/dist/components/chip/chip-styles.d.ts +263 -0
  92. package/dist/components/chip/chip-styles.js +360 -0
  93. package/dist/components/chip/chip-styles.js.map +1 -0
  94. package/dist/components/chip/chip-tokens.d.ts +13 -0
  95. package/dist/components/chip/chip-tokens.js +185 -0
  96. package/dist/components/chip/chip-tokens.js.map +1 -0
  97. package/dist/components/date-picker/CalendarGrid.js +94 -0
  98. package/dist/components/date-picker/CalendarGrid.js.map +1 -0
  99. package/dist/components/date-picker/CompactDateDialog.js +63 -0
  100. package/dist/components/date-picker/CompactDateDialog.js.map +1 -0
  101. package/dist/components/date-picker/DateField.d.ts +161 -0
  102. package/dist/components/date-picker/DateField.js +393 -0
  103. package/dist/components/date-picker/DateField.js.map +1 -0
  104. package/dist/components/date-picker/DateInput.d.ts +20 -0
  105. package/dist/components/date-picker/DateInput.js +99 -0
  106. package/dist/components/date-picker/DateInput.js.map +1 -0
  107. package/dist/components/date-picker/DatePicker.d.ts +165 -0
  108. package/dist/components/date-picker/DatePicker.js +492 -0
  109. package/dist/components/date-picker/DatePicker.js.map +1 -0
  110. package/dist/components/date-picker/PickerDialog.d.ts +121 -0
  111. package/dist/components/date-picker/PickerDialog.js +161 -0
  112. package/dist/components/date-picker/PickerDialog.js.map +1 -0
  113. package/dist/components/date-picker/calendar-parts.js +141 -0
  114. package/dist/components/date-picker/calendar-parts.js.map +1 -0
  115. package/dist/components/date-picker/date-format.js +72 -0
  116. package/dist/components/date-picker/date-format.js.map +1 -0
  117. package/dist/components/date-picker/date-picker-styles.d.ts +247 -0
  118. package/dist/components/date-picker/date-picker-styles.js +163 -0
  119. package/dist/components/date-picker/date-picker-styles.js.map +1 -0
  120. package/dist/components/date-picker/date-picker-tokens.d.ts +7 -0
  121. package/dist/components/date-picker/date-picker-tokens.js +104 -0
  122. package/dist/components/date-picker/date-picker-tokens.js.map +1 -0
  123. package/dist/components/date-picker/picker-dialog-context.js +8 -0
  124. package/dist/components/date-picker/picker-dialog-context.js.map +1 -0
  125. package/dist/components/date-picker/picker-dialog-styles.d.ts +95 -0
  126. package/dist/components/date-picker/picker-dialog-styles.js +57 -0
  127. package/dist/components/date-picker/picker-dialog-styles.js.map +1 -0
  128. package/dist/components/date-picker/picker-icons.js +24 -0
  129. package/dist/components/date-picker/picker-icons.js.map +1 -0
  130. package/dist/components/date-picker/use-media-query.js +21 -0
  131. package/dist/components/date-picker/use-media-query.js.map +1 -0
  132. package/dist/components/date-picker/use-size-transform.js +62 -0
  133. package/dist/components/date-picker/use-size-transform.js.map +1 -0
  134. package/dist/components/date-picker/use-view-exit.js +68 -0
  135. package/dist/components/date-picker/use-view-exit.js.map +1 -0
  136. package/dist/components/dialog/Dialog.d.ts +267 -0
  137. package/dist/components/dialog/Dialog.js +521 -0
  138. package/dist/components/dialog/Dialog.js.map +1 -0
  139. package/dist/components/dialog/dialog-styles.d.ts +335 -0
  140. package/dist/components/dialog/dialog-styles.js +377 -0
  141. package/dist/components/dialog/dialog-styles.js.map +1 -0
  142. package/dist/components/dialog/dialog-tokens.d.ts +7 -0
  143. package/dist/components/dialog/dialog-tokens.js +57 -0
  144. package/dist/components/dialog/dialog-tokens.js.map +1 -0
  145. package/dist/components/divider/Divider.d.ts +59 -0
  146. package/dist/components/divider/Divider.js +53 -0
  147. package/dist/components/divider/Divider.js.map +1 -0
  148. package/dist/components/divider/divider-styles.d.ts +90 -0
  149. package/dist/components/divider/divider-styles.js +66 -0
  150. package/dist/components/divider/divider-styles.js.map +1 -0
  151. package/dist/components/divider/divider-tokens.d.ts +7 -0
  152. package/dist/components/divider/divider-tokens.js +16 -0
  153. package/dist/components/divider/divider-tokens.js.map +1 -0
  154. package/dist/components/fab/Fab.d.ts +130 -0
  155. package/dist/components/fab/Fab.js +137 -0
  156. package/dist/components/fab/Fab.js.map +1 -0
  157. package/dist/components/fab/FabTooltip.js +36 -0
  158. package/dist/components/fab/FabTooltip.js.map +1 -0
  159. package/dist/components/fab/fab-styles.d.ts +286 -0
  160. package/dist/components/fab/fab-styles.js +131 -0
  161. package/dist/components/fab/fab-styles.js.map +1 -0
  162. package/dist/components/fab/fab-tokens.d.ts +12 -0
  163. package/dist/components/fab/fab-tokens.js +105 -0
  164. package/dist/components/fab/fab-tokens.js.map +1 -0
  165. package/dist/components/fab-menu/FabMenu.d.ts +156 -0
  166. package/dist/components/fab-menu/FabMenu.js +291 -0
  167. package/dist/components/fab-menu/FabMenu.js.map +1 -0
  168. package/dist/components/fab-menu/fab-menu-stagger.js +51 -0
  169. package/dist/components/fab-menu/fab-menu-stagger.js.map +1 -0
  170. package/dist/components/fab-menu/fab-menu-styles.d.ts +166 -0
  171. package/dist/components/fab-menu/fab-menu-styles.js +107 -0
  172. package/dist/components/fab-menu/fab-menu-styles.js.map +1 -0
  173. package/dist/components/fab-menu/fab-menu-tokens.d.ts +7 -0
  174. package/dist/components/fab-menu/fab-menu-tokens.js +120 -0
  175. package/dist/components/fab-menu/fab-menu-tokens.js.map +1 -0
  176. package/dist/components/icon-button/IconButton.d.ts +125 -0
  177. package/dist/components/icon-button/IconButton.js +112 -0
  178. package/dist/components/icon-button/IconButton.js.map +1 -0
  179. package/dist/components/icon-button/icon-button-styles.d.ts +217 -0
  180. package/dist/components/icon-button/icon-button-styles.js +244 -0
  181. package/dist/components/icon-button/icon-button-styles.js.map +1 -0
  182. package/dist/components/icon-button/icon-button-tokens.d.ts +11 -0
  183. package/dist/components/icon-button/icon-button-tokens.js +215 -0
  184. package/dist/components/icon-button/icon-button-tokens.js.map +1 -0
  185. package/dist/components/list/List.d.ts +265 -0
  186. package/dist/components/list/List.js +1386 -0
  187. package/dist/components/list/List.js.map +1 -0
  188. package/dist/components/list/ListMedia.d.ts +88 -0
  189. package/dist/components/list/ListMedia.js +132 -0
  190. package/dist/components/list/ListMedia.js.map +1 -0
  191. package/dist/components/list/list-styles.d.ts +375 -0
  192. package/dist/components/list/list-styles.js +220 -0
  193. package/dist/components/list/list-styles.js.map +1 -0
  194. package/dist/components/list/list-tokens.d.ts +7 -0
  195. package/dist/components/list/list-tokens.js +92 -0
  196. package/dist/components/list/list-tokens.js.map +1 -0
  197. package/dist/components/loading-indicator/LoadingIndicator.d.ts +65 -0
  198. package/dist/components/loading-indicator/LoadingIndicator.js +92 -0
  199. package/dist/components/loading-indicator/LoadingIndicator.js.map +1 -0
  200. package/dist/components/loading-indicator/lazy-loading-indicator.js +25 -0
  201. package/dist/components/loading-indicator/lazy-loading-indicator.js.map +1 -0
  202. package/dist/components/loading-indicator/loading-indicator-frames.js +149 -0
  203. package/dist/components/loading-indicator/loading-indicator-frames.js.map +1 -0
  204. package/dist/components/loading-indicator/loading-indicator-styles.d.ts +36 -0
  205. package/dist/components/loading-indicator/loading-indicator-styles.js +22 -0
  206. package/dist/components/loading-indicator/loading-indicator-styles.js.map +1 -0
  207. package/dist/components/loading-indicator/loading-indicator-tokens.d.ts +7 -0
  208. package/dist/components/loading-indicator/loading-indicator-tokens.js +44 -0
  209. package/dist/components/loading-indicator/loading-indicator-tokens.js.map +1 -0
  210. package/dist/components/menu/Menu.d.ts +215 -0
  211. package/dist/components/menu/Menu.js +715 -0
  212. package/dist/components/menu/Menu.js.map +1 -0
  213. package/dist/components/menu/menu-styles.d.ts +354 -0
  214. package/dist/components/menu/menu-styles.js +219 -0
  215. package/dist/components/menu/menu-styles.js.map +1 -0
  216. package/dist/components/menu/menu-tokens.d.ts +7 -0
  217. package/dist/components/menu/menu-tokens.js +93 -0
  218. package/dist/components/menu/menu-tokens.js.map +1 -0
  219. package/dist/components/menu/menu-trigger.d.ts +51 -0
  220. package/dist/components/menu/menu-trigger.js +100 -0
  221. package/dist/components/menu/menu-trigger.js.map +1 -0
  222. package/dist/components/menu/use-reveal-entering.js +42 -0
  223. package/dist/components/menu/use-reveal-entering.js.map +1 -0
  224. package/dist/components/navigation/NavItem.d.ts +54 -0
  225. package/dist/components/navigation/NavItem.js +182 -0
  226. package/dist/components/navigation/NavItem.js.map +1 -0
  227. package/dist/components/navigation/NavigationBar.d.ts +64 -0
  228. package/dist/components/navigation/NavigationBar.js +121 -0
  229. package/dist/components/navigation/NavigationBar.js.map +1 -0
  230. package/dist/components/navigation/NavigationRail.d.ts +91 -0
  231. package/dist/components/navigation/NavigationRail.js +285 -0
  232. package/dist/components/navigation/NavigationRail.js.map +1 -0
  233. package/dist/components/navigation/nav-item-styles.d.ts +190 -0
  234. package/dist/components/navigation/nav-item-styles.js +123 -0
  235. package/dist/components/navigation/nav-item-styles.js.map +1 -0
  236. package/dist/components/navigation/navigation-styles.d.ts +239 -0
  237. package/dist/components/navigation/navigation-styles.js +134 -0
  238. package/dist/components/navigation/navigation-styles.js.map +1 -0
  239. package/dist/components/navigation/navigation-tokens.d.ts +9 -0
  240. package/dist/components/navigation/navigation-tokens.js +114 -0
  241. package/dist/components/navigation/navigation-tokens.js.map +1 -0
  242. package/dist/components/navigation/use-hide-on-scroll.js +115 -0
  243. package/dist/components/navigation/use-hide-on-scroll.js.map +1 -0
  244. package/dist/components/navigation/use-item-arrow-keys.js +37 -0
  245. package/dist/components/navigation/use-item-arrow-keys.js.map +1 -0
  246. package/dist/components/navigation/use-rail-item-morph.js +61 -0
  247. package/dist/components/navigation/use-rail-item-morph.js.map +1 -0
  248. package/dist/components/progress/ProgressIndicator.d.ts +95 -0
  249. package/dist/components/progress/ProgressIndicator.js +426 -0
  250. package/dist/components/progress/ProgressIndicator.js.map +1 -0
  251. package/dist/components/progress/progress-geometry.js +285 -0
  252. package/dist/components/progress/progress-geometry.js.map +1 -0
  253. package/dist/components/progress/progress-styles.d.ts +81 -0
  254. package/dist/components/progress/progress-styles.js +43 -0
  255. package/dist/components/progress/progress-styles.js.map +1 -0
  256. package/dist/components/progress/progress-tokens.d.ts +7 -0
  257. package/dist/components/progress/progress-tokens.js +39 -0
  258. package/dist/components/progress/progress-tokens.js.map +1 -0
  259. package/dist/components/pull-to-refresh/PullToRefresh.d.ts +94 -0
  260. package/dist/components/pull-to-refresh/PullToRefresh.js +395 -0
  261. package/dist/components/pull-to-refresh/PullToRefresh.js.map +1 -0
  262. package/dist/components/pull-to-refresh/pull-to-refresh-math.js +37 -0
  263. package/dist/components/pull-to-refresh/pull-to-refresh-math.js.map +1 -0
  264. package/dist/components/pull-to-refresh/pull-to-refresh-styles.d.ts +53 -0
  265. package/dist/components/pull-to-refresh/pull-to-refresh-styles.js +14 -0
  266. package/dist/components/pull-to-refresh/pull-to-refresh-styles.js.map +1 -0
  267. package/dist/components/radio/RadioGroup.d.ts +121 -0
  268. package/dist/components/radio/RadioGroup.js +163 -0
  269. package/dist/components/radio/RadioGroup.js.map +1 -0
  270. package/dist/components/radio/radio-ring.js +21 -0
  271. package/dist/components/radio/radio-ring.js.map +1 -0
  272. package/dist/components/radio/radio-styles.d.ts +155 -0
  273. package/dist/components/radio/radio-styles.js +60 -0
  274. package/dist/components/radio/radio-styles.js.map +1 -0
  275. package/dist/components/radio/radio-tokens.d.ts +7 -0
  276. package/dist/components/radio/radio-tokens.js +31 -0
  277. package/dist/components/radio/radio-tokens.js.map +1 -0
  278. package/dist/components/search/SearchAppBar.d.ts +45 -0
  279. package/dist/components/search/SearchAppBar.js +61 -0
  280. package/dist/components/search/SearchAppBar.js.map +1 -0
  281. package/dist/components/search/SearchBar.d.ts +147 -0
  282. package/dist/components/search/SearchBar.js +412 -0
  283. package/dist/components/search/SearchBar.js.map +1 -0
  284. package/dist/components/search/search-styles.d.ts +243 -0
  285. package/dist/components/search/search-styles.js +143 -0
  286. package/dist/components/search/search-styles.js.map +1 -0
  287. package/dist/components/search/search-tokens.d.ts +9 -0
  288. package/dist/components/search/search-tokens.js +70 -0
  289. package/dist/components/search/search-tokens.js.map +1 -0
  290. package/dist/components/select/Select.d.ts +187 -0
  291. package/dist/components/select/Select.js +319 -0
  292. package/dist/components/select/Select.js.map +1 -0
  293. package/dist/components/select/field-shell.d.ts +29 -0
  294. package/dist/components/select/field-shell.js +135 -0
  295. package/dist/components/select/field-shell.js.map +1 -0
  296. package/dist/components/select/option-list.d.ts +81 -0
  297. package/dist/components/select/option-list.js +291 -0
  298. package/dist/components/select/option-list.js.map +1 -0
  299. package/dist/components/select/search-list.js +135 -0
  300. package/dist/components/select/search-list.js.map +1 -0
  301. package/dist/components/select/selection-cap.js +30 -0
  302. package/dist/components/select/selection-cap.js.map +1 -0
  303. package/dist/components/sheet/BottomSheet.d.ts +154 -0
  304. package/dist/components/sheet/BottomSheet.js +442 -0
  305. package/dist/components/sheet/BottomSheet.js.map +1 -0
  306. package/dist/components/sheet/SheetTrigger.d.ts +25 -0
  307. package/dist/components/sheet/SheetTrigger.js +46 -0
  308. package/dist/components/sheet/SheetTrigger.js.map +1 -0
  309. package/dist/components/sheet/SideSheet.d.ts +139 -0
  310. package/dist/components/sheet/SideSheet.js +289 -0
  311. package/dist/components/sheet/SideSheet.js.map +1 -0
  312. package/dist/components/sheet/bottom-sheet-gesture.js +30 -0
  313. package/dist/components/sheet/bottom-sheet-gesture.js.map +1 -0
  314. package/dist/components/sheet/lazy-bottom-sheet.js +33 -0
  315. package/dist/components/sheet/lazy-bottom-sheet.js.map +1 -0
  316. package/dist/components/sheet/sheet-gesture.js +48 -0
  317. package/dist/components/sheet/sheet-gesture.js.map +1 -0
  318. package/dist/components/sheet/sheet-icons.js +31 -0
  319. package/dist/components/sheet/sheet-icons.js.map +1 -0
  320. package/dist/components/sheet/sheet-settle.js +58 -0
  321. package/dist/components/sheet/sheet-settle.js.map +1 -0
  322. package/dist/components/sheet/sheet-styles.d.ts +312 -0
  323. package/dist/components/sheet/sheet-styles.js +229 -0
  324. package/dist/components/sheet/sheet-styles.js.map +1 -0
  325. package/dist/components/sheet/sheet-tokens.d.ts +12 -0
  326. package/dist/components/sheet/sheet-tokens.js +115 -0
  327. package/dist/components/sheet/sheet-tokens.js.map +1 -0
  328. package/dist/components/sheet/side-swipe-gesture.js +22 -0
  329. package/dist/components/sheet/side-swipe-gesture.js.map +1 -0
  330. package/dist/components/sheet/use-peek-inert.js +32 -0
  331. package/dist/components/sheet/use-peek-inert.js.map +1 -0
  332. package/dist/components/sheet/use-side-swipe.js +174 -0
  333. package/dist/components/sheet/use-side-swipe.js.map +1 -0
  334. package/dist/components/slider/Slider.d.ts +129 -0
  335. package/dist/components/slider/Slider.js +295 -0
  336. package/dist/components/slider/Slider.js.map +1 -0
  337. package/dist/components/slider/slider-geometry.js +138 -0
  338. package/dist/components/slider/slider-geometry.js.map +1 -0
  339. package/dist/components/slider/slider-styles.d.ts +133 -0
  340. package/dist/components/slider/slider-styles.js +97 -0
  341. package/dist/components/slider/slider-styles.js.map +1 -0
  342. package/dist/components/slider/slider-tokens.d.ts +7 -0
  343. package/dist/components/slider/slider-tokens.js +66 -0
  344. package/dist/components/slider/slider-tokens.js.map +1 -0
  345. package/dist/components/slider/use-touch-track.js +138 -0
  346. package/dist/components/slider/use-touch-track.js.map +1 -0
  347. package/dist/components/snackbar/Snackbar.d.ts +96 -0
  348. package/dist/components/snackbar/Snackbar.js +253 -0
  349. package/dist/components/snackbar/Snackbar.js.map +1 -0
  350. package/dist/components/snackbar/snackbar-state.d.ts +58 -0
  351. package/dist/components/snackbar/snackbar-state.js +73 -0
  352. package/dist/components/snackbar/snackbar-state.js.map +1 -0
  353. package/dist/components/snackbar/snackbar-styles.d.ts +109 -0
  354. package/dist/components/snackbar/snackbar-styles.js +67 -0
  355. package/dist/components/snackbar/snackbar-styles.js.map +1 -0
  356. package/dist/components/snackbar/snackbar-tokens.d.ts +7 -0
  357. package/dist/components/snackbar/snackbar-tokens.js +54 -0
  358. package/dist/components/snackbar/snackbar-tokens.js.map +1 -0
  359. package/dist/components/split-button/SplitButton.d.ts +109 -0
  360. package/dist/components/split-button/SplitButton.js +195 -0
  361. package/dist/components/split-button/SplitButton.js.map +1 -0
  362. package/dist/components/split-button/split-button-styles.d.ts +214 -0
  363. package/dist/components/split-button/split-button-styles.js +164 -0
  364. package/dist/components/split-button/split-button-styles.js.map +1 -0
  365. package/dist/components/split-button/split-button-tokens.d.ts +7 -0
  366. package/dist/components/split-button/split-button-tokens.js +36 -0
  367. package/dist/components/split-button/split-button-tokens.js.map +1 -0
  368. package/dist/components/switch/Switch.d.ts +82 -0
  369. package/dist/components/switch/Switch.js +165 -0
  370. package/dist/components/switch/Switch.js.map +1 -0
  371. package/dist/components/switch/switch-styles.d.ts +96 -0
  372. package/dist/components/switch/switch-styles.js +68 -0
  373. package/dist/components/switch/switch-styles.js.map +1 -0
  374. package/dist/components/switch/switch-thumb.js +41 -0
  375. package/dist/components/switch/switch-thumb.js.map +1 -0
  376. package/dist/components/switch/switch-tokens.d.ts +7 -0
  377. package/dist/components/switch/switch-tokens.js +78 -0
  378. package/dist/components/switch/switch-tokens.js.map +1 -0
  379. package/dist/components/tabs/Tabs.d.ts +120 -0
  380. package/dist/components/tabs/Tabs.js +346 -0
  381. package/dist/components/tabs/Tabs.js.map +1 -0
  382. package/dist/components/tabs/tabs-styles.d.ts +198 -0
  383. package/dist/components/tabs/tabs-styles.js +99 -0
  384. package/dist/components/tabs/tabs-styles.js.map +1 -0
  385. package/dist/components/tabs/tabs-tokens.d.ts +7 -0
  386. package/dist/components/tabs/tabs-tokens.js +121 -0
  387. package/dist/components/tabs/tabs-tokens.js.map +1 -0
  388. package/dist/components/text-field/TextField.d.ts +175 -0
  389. package/dist/components/text-field/TextField.js +250 -0
  390. package/dist/components/text-field/TextField.js.map +1 -0
  391. package/dist/components/text-field/text-field-styles.d.ts +252 -0
  392. package/dist/components/text-field/text-field-styles.js +209 -0
  393. package/dist/components/text-field/text-field-styles.js.map +1 -0
  394. package/dist/components/text-field/text-field-tokens.d.ts +7 -0
  395. package/dist/components/text-field/text-field-tokens.js +177 -0
  396. package/dist/components/text-field/text-field-tokens.js.map +1 -0
  397. package/dist/components/time-picker/TimePicker.d.ts +142 -0
  398. package/dist/components/time-picker/TimePicker.js +700 -0
  399. package/dist/components/time-picker/TimePicker.js.map +1 -0
  400. package/dist/components/time-picker/time-picker-styles.d.ts +175 -0
  401. package/dist/components/time-picker/time-picker-styles.js +112 -0
  402. package/dist/components/time-picker/time-picker-styles.js.map +1 -0
  403. package/dist/components/time-picker/time-picker-tokens.d.ts +7 -0
  404. package/dist/components/time-picker/time-picker-tokens.js +86 -0
  405. package/dist/components/time-picker/time-picker-tokens.js.map +1 -0
  406. package/dist/components/toolbar/Toolbar.d.ts +209 -0
  407. package/dist/components/toolbar/Toolbar.js +282 -0
  408. package/dist/components/toolbar/Toolbar.js.map +1 -0
  409. package/dist/components/toolbar/toolbar-styles.d.ts +403 -0
  410. package/dist/components/toolbar/toolbar-styles.js +253 -0
  411. package/dist/components/toolbar/toolbar-styles.js.map +1 -0
  412. package/dist/components/toolbar/toolbar-tokens.d.ts +27 -0
  413. package/dist/components/toolbar/toolbar-tokens.js +117 -0
  414. package/dist/components/toolbar/toolbar-tokens.js.map +1 -0
  415. package/dist/components/toolbar/use-toolbar-scroll-expansion.d.ts +56 -0
  416. package/dist/components/toolbar/use-toolbar-scroll-expansion.js +86 -0
  417. package/dist/components/toolbar/use-toolbar-scroll-expansion.js.map +1 -0
  418. package/dist/components/tooltip/Tooltip.d.ts +131 -0
  419. package/dist/components/tooltip/Tooltip.js +388 -0
  420. package/dist/components/tooltip/Tooltip.js.map +1 -0
  421. package/dist/components/tooltip/lazy-tooltip.js +35 -0
  422. package/dist/components/tooltip/lazy-tooltip.js.map +1 -0
  423. package/dist/components/tooltip/tooltip-placement.d.ts +16 -0
  424. package/dist/components/tooltip/tooltip-placement.js +14 -0
  425. package/dist/components/tooltip/tooltip-placement.js.map +1 -0
  426. package/dist/components/tooltip/tooltip-styles.d.ts +142 -0
  427. package/dist/components/tooltip/tooltip-styles.js +81 -0
  428. package/dist/components/tooltip/tooltip-styles.js.map +1 -0
  429. package/dist/components/tooltip/tooltip-tokens.d.ts +9 -0
  430. package/dist/components/tooltip/tooltip-tokens.js +72 -0
  431. package/dist/components/tooltip/tooltip-tokens.js.map +1 -0
  432. package/dist/components/tooltip/tooltip-trigger.d.ts +42 -0
  433. package/dist/components/tooltip/tooltip-trigger.js +115 -0
  434. package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
  435. package/dist/composites/button-group/ButtonGroup.d.ts +116 -0
  436. package/dist/composites/button-group/ButtonGroup.js +270 -0
  437. package/dist/composites/button-group/ButtonGroup.js.map +1 -0
  438. package/dist/composites/button-group/button-group-styles.d.ts +73 -0
  439. package/dist/composites/button-group/button-group-styles.js +87 -0
  440. package/dist/composites/button-group/button-group-styles.js.map +1 -0
  441. package/dist/composites/button-group/lazy-overflow-menu.js +43 -0
  442. package/dist/composites/button-group/lazy-overflow-menu.js.map +1 -0
  443. package/dist/composites/button-group/overflow-menu-list.js +26 -0
  444. package/dist/composites/button-group/overflow-menu-list.js.map +1 -0
  445. package/dist/composites/button-group/use-overflow.js +75 -0
  446. package/dist/composites/button-group/use-overflow.js.map +1 -0
  447. package/dist/composites/button-group/use-press-expansion.js +155 -0
  448. package/dist/composites/button-group/use-press-expansion.js.map +1 -0
  449. package/dist/index.d.ts +142 -0
  450. package/dist/index.js +136 -0
  451. package/dist/motion/get-m3-spring.d.ts +6 -0
  452. package/dist/motion/get-m3-spring.js +10 -0
  453. package/dist/motion/get-m3-spring.js.map +1 -0
  454. package/dist/motion/reduced-motion.js +19 -0
  455. package/dist/motion/reduced-motion.js.map +1 -0
  456. package/dist/motion/use-m3-spring.d.ts +13 -0
  457. package/dist/motion/use-m3-spring.js +22 -0
  458. package/dist/motion/use-m3-spring.js.map +1 -0
  459. package/dist/next/NextRouterProvider.d.ts +13 -0
  460. package/dist/next/NextRouterProvider.js +26 -0
  461. package/dist/next/NextRouterProvider.js.map +1 -0
  462. package/dist/next/get-theme-from-cookies.d.ts +32 -0
  463. package/dist/next/get-theme-from-cookies.js +27 -0
  464. package/dist/next/get-theme-from-cookies.js.map +1 -0
  465. package/dist/next/navigation-guard.d.ts +30 -0
  466. package/dist/next/navigation-guard.js +68 -0
  467. package/dist/next/navigation-guard.js.map +1 -0
  468. package/dist/next.d.ts +5 -0
  469. package/dist/next.js +5 -0
  470. package/dist/primitives/ButtonBase.d.ts +115 -0
  471. package/dist/primitives/ButtonBase.js +231 -0
  472. package/dist/primitives/ButtonBase.js.map +1 -0
  473. package/dist/primitives/DomDirectionLocale.d.ts +18 -0
  474. package/dist/primitives/DomDirectionLocale.js +28 -0
  475. package/dist/primitives/DomDirectionLocale.js.map +1 -0
  476. package/dist/primitives/Field.d.ts +50 -0
  477. package/dist/primitives/Field.js +74 -0
  478. package/dist/primitives/Field.js.map +1 -0
  479. package/dist/primitives/IconFaces.js +23 -0
  480. package/dist/primitives/IconFaces.js.map +1 -0
  481. package/dist/primitives/Overlay.d.ts +39 -0
  482. package/dist/primitives/Overlay.js +86 -0
  483. package/dist/primitives/Overlay.js.map +1 -0
  484. package/dist/primitives/SelectionControl.d.ts +55 -0
  485. package/dist/primitives/SelectionControl.js +58 -0
  486. package/dist/primitives/SelectionControl.js.map +1 -0
  487. package/dist/primitives/Surface.d.ts +123 -0
  488. package/dist/primitives/Surface.js +68 -0
  489. package/dist/primitives/Surface.js.map +1 -0
  490. package/dist/primitives/ToolbarContext.js +12 -0
  491. package/dist/primitives/ToolbarContext.js.map +1 -0
  492. package/dist/primitives/TouchTarget.d.ts +14 -0
  493. package/dist/primitives/TouchTarget.js +20 -0
  494. package/dist/primitives/TouchTarget.js.map +1 -0
  495. package/dist/primitives/TriggerContext.d.ts +34 -0
  496. package/dist/primitives/TriggerContext.js +24 -0
  497. package/dist/primitives/TriggerContext.js.map +1 -0
  498. package/dist/primitives/hidden-input-focus.js +27 -0
  499. package/dist/primitives/hidden-input-focus.js.map +1 -0
  500. package/dist/primitives/icon-faces-styles.d.ts +9 -0
  501. package/dist/primitives/icon-faces-styles.js +45 -0
  502. package/dist/primitives/icon-faces-styles.js.map +1 -0
  503. package/dist/primitives/locale-with-direction.d.ts +9 -0
  504. package/dist/primitives/locale-with-direction.js +17 -0
  505. package/dist/primitives/locale-with-direction.js.map +1 -0
  506. package/dist/primitives/morph-path.d.ts +25 -0
  507. package/dist/primitives/morph-path.js +38 -0
  508. package/dist/primitives/morph-path.js.map +1 -0
  509. package/dist/primitives/selection-control-styles.d.ts +54 -0
  510. package/dist/primitives/selection-control-styles.js +44 -0
  511. package/dist/primitives/selection-control-styles.js.map +1 -0
  512. package/dist/primitives/use-m3-interaction.d.ts +51 -0
  513. package/dist/primitives/use-m3-interaction.js +149 -0
  514. package/dist/primitives/use-m3-interaction.js.map +1 -0
  515. package/dist/primitives/use-m3-morph.d.ts +18 -0
  516. package/dist/primitives/use-m3-morph.js +36 -0
  517. package/dist/primitives/use-m3-morph.js.map +1 -0
  518. package/dist/primitives/use-presence.d.ts +19 -0
  519. package/dist/primitives/use-presence.js +37 -0
  520. package/dist/primitives/use-presence.js.map +1 -0
  521. package/dist/primitives.d.ts +36 -0
  522. package/dist/primitives.js +34 -0
  523. package/dist/shapes/corner-rounding.d.ts +13 -0
  524. package/dist/shapes/corner-rounding.js +18 -0
  525. package/dist/shapes/corner-rounding.js.map +1 -0
  526. package/dist/shapes/cubic.d.ts +52 -0
  527. package/dist/shapes/cubic.js +189 -0
  528. package/dist/shapes/cubic.js.map +1 -0
  529. package/dist/shapes/feature-mapping.js +80 -0
  530. package/dist/shapes/feature-mapping.js.map +1 -0
  531. package/dist/shapes/features.d.ts +23 -0
  532. package/dist/shapes/features.js +82 -0
  533. package/dist/shapes/features.js.map +1 -0
  534. package/dist/shapes/float-mapping.js +65 -0
  535. package/dist/shapes/float-mapping.js.map +1 -0
  536. package/dist/shapes/generated/material-shape-path-record.d.ts +11 -0
  537. package/dist/shapes/generated/material-shape-path-record.js +48 -0
  538. package/dist/shapes/generated/material-shape-path-record.js.map +1 -0
  539. package/dist/shapes/generated/material-shape-paths.d.ts +78 -0
  540. package/dist/shapes/generated/material-shape-paths.js +218 -0
  541. package/dist/shapes/generated/material-shape-paths.js.map +1 -0
  542. package/dist/shapes/mask.d.ts +14 -0
  543. package/dist/shapes/mask.js +24 -0
  544. package/dist/shapes/mask.js.map +1 -0
  545. package/dist/shapes/material-shapes.d.ts +11 -0
  546. package/dist/shapes/material-shapes.js +250 -0
  547. package/dist/shapes/material-shapes.js.map +1 -0
  548. package/dist/shapes/morph.d.ts +25 -0
  549. package/dist/shapes/morph.js +97 -0
  550. package/dist/shapes/morph.js.map +1 -0
  551. package/dist/shapes/path.d.ts +33 -0
  552. package/dist/shapes/path.js +47 -0
  553. package/dist/shapes/path.js.map +1 -0
  554. package/dist/shapes/point.d.ts +28 -0
  555. package/dist/shapes/point.js +103 -0
  556. package/dist/shapes/point.js.map +1 -0
  557. package/dist/shapes/polygon-measure.js +140 -0
  558. package/dist/shapes/polygon-measure.js.map +1 -0
  559. package/dist/shapes/rounded-polygon.d.ts +44 -0
  560. package/dist/shapes/rounded-polygon.js +278 -0
  561. package/dist/shapes/rounded-polygon.js.map +1 -0
  562. package/dist/shapes/shape-path.d.ts +15 -0
  563. package/dist/shapes/shapes.d.ts +53 -0
  564. package/dist/shapes/shapes.js +171 -0
  565. package/dist/shapes/shapes.js.map +1 -0
  566. package/dist/styles/generated/components.css +710 -0
  567. package/dist/styles/generated/theme.css +247 -0
  568. package/dist/styles/generated/themes.css +3361 -0
  569. package/dist/styles/generated/tokens.css +284 -0
  570. package/dist/styles/styles.css +15 -0
  571. package/dist/styles/utilities.css +283 -0
  572. package/dist/styles.compiled.css +2 -0
  573. package/dist/theme/ThemeProvider.d.ts +72 -0
  574. package/dist/theme/ThemeProvider.js +144 -0
  575. package/dist/theme/ThemeProvider.js.map +1 -0
  576. package/dist/theme/ThemeScope.d.ts +32 -0
  577. package/dist/theme/ThemeScope.js +67 -0
  578. package/dist/theme/ThemeScope.js.map +1 -0
  579. package/dist/theme/ThemeScript.d.ts +26 -0
  580. package/dist/theme/ThemeScript.js +44 -0
  581. package/dist/theme/ThemeScript.js.map +1 -0
  582. package/dist/theme/context.d.ts +32 -0
  583. package/dist/theme/context.js +47 -0
  584. package/dist/theme/context.js.map +1 -0
  585. package/dist/theme/create-theme.d.ts +60 -0
  586. package/dist/theme/create-theme.js +47 -0
  587. package/dist/theme/create-theme.js.map +1 -0
  588. package/dist/theme/css.js +54 -0
  589. package/dist/theme/css.js.map +1 -0
  590. package/dist/theme/parse-palettes.js +40 -0
  591. package/dist/theme/parse-palettes.js.map +1 -0
  592. package/dist/theme/scheme.d.ts +6 -0
  593. package/dist/theme/scheme.js +118 -0
  594. package/dist/theme/scheme.js.map +1 -0
  595. package/dist/theme/state.d.ts +38 -0
  596. package/dist/theme/state.js +93 -0
  597. package/dist/theme/state.js.map +1 -0
  598. package/dist/theme/storage.js +21 -0
  599. package/dist/theme/storage.js.map +1 -0
  600. package/dist/tokens/breakpoints.d.ts +15 -0
  601. package/dist/tokens/breakpoints.js +16 -0
  602. package/dist/tokens/breakpoints.js.map +1 -0
  603. package/dist/tokens/color.d.ts +104 -0
  604. package/dist/tokens/color.js +147 -0
  605. package/dist/tokens/color.js.map +1 -0
  606. package/dist/tokens/component.d.ts +110 -0
  607. package/dist/tokens/component.js +67 -0
  608. package/dist/tokens/component.js.map +1 -0
  609. package/dist/tokens/density.d.ts +20 -0
  610. package/dist/tokens/density.js +27 -0
  611. package/dist/tokens/density.js.map +1 -0
  612. package/dist/tokens/elevation.d.ts +44 -0
  613. package/dist/tokens/elevation.js +45 -0
  614. package/dist/tokens/elevation.js.map +1 -0
  615. package/dist/tokens/motion.d.ts +79 -0
  616. package/dist/tokens/motion.js +126 -0
  617. package/dist/tokens/motion.js.map +1 -0
  618. package/dist/tokens/shape.d.ts +22 -0
  619. package/dist/tokens/shape.js +22 -0
  620. package/dist/tokens/shape.js.map +1 -0
  621. package/dist/tokens/spring-velocity.d.ts +19 -0
  622. package/dist/tokens/spring-velocity.js +44 -0
  623. package/dist/tokens/spring-velocity.js.map +1 -0
  624. package/dist/tokens/state.d.ts +18 -0
  625. package/dist/tokens/state.js +19 -0
  626. package/dist/tokens/state.js.map +1 -0
  627. package/dist/tokens/typography.d.ts +64 -0
  628. package/dist/tokens/typography.js +60 -0
  629. package/dist/tokens/typography.js.map +1 -0
  630. package/dist/tokens/z-index.d.ts +17 -0
  631. package/dist/tokens/z-index.js +18 -0
  632. package/dist/tokens/z-index.js.map +1 -0
  633. package/dist/utils/announce.js +51 -0
  634. package/dist/utils/announce.js.map +1 -0
  635. package/dist/utils/assert-collection-children.js +26 -0
  636. package/dist/utils/assert-collection-children.js.map +1 -0
  637. package/dist/utils/closed-by.d.ts +9 -0
  638. package/dist/utils/closed-by.js +12 -0
  639. package/dist/utils/closed-by.js.map +1 -0
  640. package/dist/utils/cn.d.ts +31 -0
  641. package/dist/utils/cn.js +37 -0
  642. package/dist/utils/cn.js.map +1 -0
  643. package/dist/utils/composite-keys.js +32 -0
  644. package/dist/utils/composite-keys.js.map +1 -0
  645. package/dist/utils/focus-visible.js +14 -0
  646. package/dist/utils/focus-visible.js.map +1 -0
  647. package/dist/utils/focus.js +51 -0
  648. package/dist/utils/focus.js.map +1 -0
  649. package/dist/utils/focusable-disabled.js +12 -0
  650. package/dist/utils/focusable-disabled.js.map +1 -0
  651. package/dist/utils/keep-pressed-in-place.d.ts +60 -0
  652. package/dist/utils/keep-pressed-in-place.js +127 -0
  653. package/dist/utils/keep-pressed-in-place.js.map +1 -0
  654. package/dist/utils/load-on-demand.js +111 -0
  655. package/dist/utils/load-on-demand.js.map +1 -0
  656. package/dist/utils/merge-data-tokens.d.ts +9 -0
  657. package/dist/utils/merge-data-tokens.js +15 -0
  658. package/dist/utils/merge-data-tokens.js.map +1 -0
  659. package/dist/utils/natural-size.js +53 -0
  660. package/dist/utils/natural-size.js.map +1 -0
  661. package/dist/utils/nearest-reveal.js +28 -0
  662. package/dist/utils/nearest-reveal.js.map +1 -0
  663. package/dist/utils/placement.js +14 -0
  664. package/dist/utils/placement.js.map +1 -0
  665. package/dist/utils/radio-group-keys.js +74 -0
  666. package/dist/utils/radio-group-keys.js.map +1 -0
  667. package/dist/utils/rendered-description.js +17 -0
  668. package/dist/utils/rendered-description.js.map +1 -0
  669. package/dist/utils/root-props.d.ts +103 -0
  670. package/dist/utils/root-props.js +51 -0
  671. package/dist/utils/root-props.js.map +1 -0
  672. package/dist/utils/search.d.ts +11 -0
  673. package/dist/utils/search.js +18 -0
  674. package/dist/utils/search.js.map +1 -0
  675. package/dist/utils/shortcut.js +20 -0
  676. package/dist/utils/shortcut.js.map +1 -0
  677. package/dist/utils/split-data-attributes.d.ts +12 -0
  678. package/dist/utils/split-data-attributes.js +20 -0
  679. package/dist/utils/split-data-attributes.js.map +1 -0
  680. package/dist/utils/toolbar-keys.js +28 -0
  681. package/dist/utils/toolbar-keys.js.map +1 -0
  682. package/dist/utils/tv.d.ts +7 -0
  683. package/dist/utils/tv.js +9 -0
  684. package/dist/utils/tv.js.map +1 -0
  685. package/dist/utils/typeahead.js +64 -0
  686. package/dist/utils/typeahead.js.map +1 -0
  687. package/dist/utils/warn-once.js +30 -0
  688. package/dist/utils/warn-once.js.map +1 -0
  689. package/dist/vendor/material-color-utilities/blend/blend.js +88 -0
  690. package/dist/vendor/material-color-utilities/blend/blend.js.map +1 -0
  691. package/dist/vendor/material-color-utilities/contrast/contrast.js +131 -0
  692. package/dist/vendor/material-color-utilities/contrast/contrast.js.map +1 -0
  693. package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js +58 -0
  694. package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js.map +1 -0
  695. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js +620 -0
  696. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js.map +1 -0
  697. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js +786 -0
  698. package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js.map +1 -0
  699. package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js +59 -0
  700. package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js.map +1 -0
  701. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js +420 -0
  702. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js.map +1 -0
  703. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js +701 -0
  704. package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js.map +1 -0
  705. package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js +374 -0
  706. package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js.map +1 -0
  707. package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js +65 -0
  708. package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js.map +1 -0
  709. package/dist/vendor/material-color-utilities/dynamiccolor/variant.js +38 -0
  710. package/dist/vendor/material-color-utilities/dynamiccolor/variant.js.map +1 -0
  711. package/dist/vendor/material-color-utilities/hct/cam16.js +309 -0
  712. package/dist/vendor/material-color-utilities/hct/cam16.js.map +1 -0
  713. package/dist/vendor/material-color-utilities/hct/hct.js +148 -0
  714. package/dist/vendor/material-color-utilities/hct/hct.js.map +1 -0
  715. package/dist/vendor/material-color-utilities/hct/hct_solver.js +660 -0
  716. package/dist/vendor/material-color-utilities/hct/hct_solver.js.map +1 -0
  717. package/dist/vendor/material-color-utilities/hct/viewing_conditions.js +117 -0
  718. package/dist/vendor/material-color-utilities/hct/viewing_conditions.js.map +1 -0
  719. package/dist/vendor/material-color-utilities/index.js +51 -0
  720. package/dist/vendor/material-color-utilities/index.js.map +1 -0
  721. package/dist/vendor/material-color-utilities/palettes/core_palette.js +22 -0
  722. package/dist/vendor/material-color-utilities/palettes/core_palette.js.map +1 -0
  723. package/dist/vendor/material-color-utilities/palettes/tonal_palette.js +134 -0
  724. package/dist/vendor/material-color-utilities/palettes/tonal_palette.js.map +1 -0
  725. package/dist/vendor/material-color-utilities/scheme/scheme.js +21 -0
  726. package/dist/vendor/material-color-utilities/scheme/scheme.js.map +1 -0
  727. package/dist/vendor/material-color-utilities/scheme/scheme_android.js +21 -0
  728. package/dist/vendor/material-color-utilities/scheme/scheme_android.js.map +1 -0
  729. package/dist/vendor/material-color-utilities/scheme/scheme_content.js +22 -0
  730. package/dist/vendor/material-color-utilities/scheme/scheme_content.js.map +1 -0
  731. package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js +38 -0
  732. package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js.map +1 -0
  733. package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js +22 -0
  734. package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js.map +1 -0
  735. package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js +22 -0
  736. package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js.map +1 -0
  737. package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js +22 -0
  738. package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js.map +1 -0
  739. package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js +36 -0
  740. package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js.map +1 -0
  741. package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js +22 -0
  742. package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js.map +1 -0
  743. package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js +41 -0
  744. package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js.map +1 -0
  745. package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js +39 -0
  746. package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js.map +1 -0
  747. package/dist/vendor/material-color-utilities/score/score.js +115 -0
  748. package/dist/vendor/material-color-utilities/score/score.js.map +1 -0
  749. package/dist/vendor/material-color-utilities/temperature/temperature_cache.js +227 -0
  750. package/dist/vendor/material-color-utilities/temperature/temperature_cache.js.map +1 -0
  751. package/dist/vendor/material-color-utilities/utils/color_utils.js +246 -0
  752. package/dist/vendor/material-color-utilities/utils/color_utils.js.map +1 -0
  753. package/dist/vendor/material-color-utilities/utils/image_utils.js +21 -0
  754. package/dist/vendor/material-color-utilities/utils/image_utils.js.map +1 -0
  755. package/dist/vendor/material-color-utilities/utils/math_utils.js +119 -0
  756. package/dist/vendor/material-color-utilities/utils/math_utils.js.map +1 -0
  757. package/dist/vendor/material-color-utilities/utils/string_utils.js +74 -0
  758. package/dist/vendor/material-color-utilities/utils/string_utils.js.map +1 -0
  759. package/dist/vendor/material-color-utilities/utils/theme_utils.js +24 -0
  760. package/dist/vendor/material-color-utilities/utils/theme_utils.js.map +1 -0
  761. package/package.json +114 -3
@@ -0,0 +1,295 @@
1
+ "use client";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { mergeDataTokens } from "../../utils/merge-data-tokens.js";
4
+ import { DomDirectionLocale } from "../../primitives/DomDirectionLocale.js";
5
+ import { splitRootProps } from "../../utils/root-props.js";
6
+ import { useTouchTrack } from "./use-touch-track.js";
7
+ import { iconSizeWhenFits, movedStartIcon, segmentLength, trackGeometry } from "./slider-geometry.js";
8
+ import { sliderStyles } from "./slider-styles.js";
9
+ import { useRef, useState } from "react";
10
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
+ import { VisuallyHidden, mergeProps, useFocusRing, useLocale, useNumberFormatter, useObjectRef, useSlider, useSliderThumb } from "react-aria";
12
+ import { useSliderState } from "react-stately";
13
+ //#region src/components/slider/Slider.tsx
14
+ const DEFAULT_LABELS = {
15
+ start: "Minimum",
16
+ end: "Maximum"
17
+ };
18
+ /**
19
+ * M3 Expressive slider: XS–XL sizes, horizontal or vertical, continuous or discrete with
20
+ * stop indicators, optionally centred, with inset icons and a value indicator. Arrow keys,
21
+ * Page Up / Down and Home / End adjust it (mirrored in RTL).
22
+ *
23
+ * @example
24
+ * <Slider aria-label="Volume" size="md" leadingIcon={<VolumeIcon />} defaultValue={40} />
25
+ */
26
+ function Slider(props) {
27
+ return /* @__PURE__ */ jsx(DomDirectionLocale, { children: (directionRef) => /* @__PURE__ */ jsx(SliderRoot, {
28
+ ...props,
29
+ range: false,
30
+ directionRef
31
+ }) });
32
+ }
33
+ /**
34
+ * M3 Expressive range slider: two thumbs selecting a range, with the same sizes,
35
+ * orientations and discrete stops as {@link Slider}.
36
+ *
37
+ * @example
38
+ * <RangeSlider aria-label="Price" defaultValue={[20, 80]} />
39
+ */
40
+ function RangeSlider(props) {
41
+ return /* @__PURE__ */ jsx(DomDirectionLocale, { children: (directionRef) => /* @__PURE__ */ jsx(SliderRoot, {
42
+ ...props,
43
+ range: true,
44
+ directionRef
45
+ }) });
46
+ }
47
+ function SliderRoot(props) {
48
+ const { size = "xs", orientation = "horizontal", min = 0, max = 100, step = 1, ticks = false, disabled = false, valueLabel = false, formatOptions, name, id, ref, className, style, classNames, range, directionRef, value, defaultValue, onChange, onChangeEnd, ...rest } = props;
49
+ const { centered = false, leadingIcon: startIconProp, trailingIcon: endIconProp } = props;
50
+ const iconSize = size === "md" || size === "lg" || size === "xl";
51
+ const startIcon = iconSize && !centered ? startIconProp : void 0;
52
+ const endIcon = iconSize && !centered ? endIconProp : void 0;
53
+ const labels = {
54
+ ...DEFAULT_LABELS,
55
+ ...props.labels
56
+ };
57
+ const { root: data, rest: labelling } = splitRootProps(rest);
58
+ const { "aria-label": label, "aria-labelledby": labelledBy, "aria-describedby": describedBy, "aria-details": details, "aria-errormessage": errorMessage } = labelling;
59
+ const numberFormatter = useNumberFormatter(formatOptions);
60
+ const wrap = (v) => v === void 0 ? void 0 : Array.isArray(v) ? v : [v];
61
+ const unwrap = (v) => range ? v : v[0];
62
+ const ariaProps = {
63
+ id,
64
+ minValue: min,
65
+ maxValue: max,
66
+ step,
67
+ orientation,
68
+ isDisabled: disabled,
69
+ "aria-label": label,
70
+ "aria-labelledby": labelledBy,
71
+ "aria-describedby": describedBy,
72
+ "aria-details": details,
73
+ value: wrap(value),
74
+ defaultValue: wrap(defaultValue) ?? (range ? [min, max] : [min]),
75
+ onChange: onChange && ((v) => onChange(unwrap(v))),
76
+ onChangeEnd: onChangeEnd && ((v) => onChangeEnd(unwrap(v)))
77
+ };
78
+ const state = useSliderState({
79
+ ...ariaProps,
80
+ numberFormatter
81
+ });
82
+ const rootRef = useObjectRef(ref);
83
+ const trackRef = useRef(null);
84
+ const { groupProps, trackProps } = useSlider(ariaProps, state, trackRef);
85
+ const { direction } = useLocale();
86
+ const count = Math.round((max - min) / step);
87
+ const touchTrackProps = useTouchTrack(trackProps, {
88
+ state,
89
+ trackRef,
90
+ orientation,
91
+ direction,
92
+ disabled,
93
+ discrete: ticks && count > 0
94
+ });
95
+ const tickFractions = ticks && count > 0 ? Array.from({ length: count + 1 }, (_, i) => i / count) : [];
96
+ const fractions = state.values.map((_, index) => state.getThumbPercent(index));
97
+ const geometry = trackGeometry({
98
+ fractions,
99
+ ticks: tickFractions,
100
+ centered: centered && !range
101
+ });
102
+ const styles = sliderStyles({
103
+ size,
104
+ orientation
105
+ });
106
+ if (process.env.NODE_ENV !== "production" && (startIconProp != null || endIconProp != null)) {
107
+ if (centered) console.warn("Slider: inset icons are not used on centred sliders (M3), so they are ignored.");
108
+ else if (!iconSize) console.warn("Slider: inset icons need size md, lg or xl (M3), so they are ignored.");
109
+ }
110
+ if (process.env.NODE_ENV !== "production" && range && orientation === "vertical") console.warn("RangeSlider: M3 advises against vertical range sliders.");
111
+ const activeSegment = geometry.segments.find((segment) => segment.icon === "start");
112
+ const moved = activeSegment && startIcon != null && movedStartIcon(activeSegment, geometry.thumbs[0]);
113
+ return /* @__PURE__ */ jsx("div", {
114
+ ...mergeProps(data, groupProps),
115
+ ref: (element) => {
116
+ rootRef.current = element;
117
+ directionRef(element);
118
+ },
119
+ style,
120
+ "data-tokens": mergeDataTokens("md-comp-slider", data),
121
+ "data-size": size,
122
+ "data-orientation": orientation,
123
+ "data-disabled": disabled || void 0,
124
+ className: styles.root({ class: cn(classNames?.root, className) }),
125
+ children: /* @__PURE__ */ jsxs("div", {
126
+ ...touchTrackProps,
127
+ ref: trackRef,
128
+ className: styles.track({ class: classNames?.track }),
129
+ children: [
130
+ geometry.segments.map((segment, index) => /* @__PURE__ */ jsx(Segment, {
131
+ segment,
132
+ styles,
133
+ classNames,
134
+ icon: segment.icon === "start" ? startIcon : segment.icon === "end" ? endIcon : void 0
135
+ }, index)),
136
+ moved && /* @__PURE__ */ jsx("span", {
137
+ "aria-hidden": "true",
138
+ "data-moved-icon": "",
139
+ style: {
140
+ marginInlineStart: moved.start,
141
+ inlineSize: moved.size
142
+ },
143
+ className: styles.movedIcon({ class: classNames?.icon }),
144
+ children: startIcon
145
+ }),
146
+ geometry.ticks.map((tick, index) => /* @__PURE__ */ jsx("span", {
147
+ "aria-hidden": "true",
148
+ "data-slot": "stop-indicator",
149
+ "data-active": tick.active || void 0,
150
+ style: { marginInlineStart: `calc(${tick.at} - 2px)` },
151
+ className: styles.tick({ class: classNames?.stop })
152
+ }, index)),
153
+ geometry.thumbs.map((at, index) => /* @__PURE__ */ jsx(Thumb, {
154
+ index,
155
+ at,
156
+ state,
157
+ trackRef,
158
+ name,
159
+ label: range ? index === 0 ? labels.start : labels.end : void 0,
160
+ errorMessage,
161
+ valueLabel,
162
+ styles,
163
+ classNames
164
+ }, index))
165
+ ]
166
+ })
167
+ });
168
+ }
169
+ function Segment({ segment, styles, classNames, icon }) {
170
+ const radius = {
171
+ borderStartStartRadius: segment.startRadius,
172
+ borderEndStartRadius: segment.startRadius,
173
+ borderStartEndRadius: segment.endRadius,
174
+ borderEndEndRadius: segment.endRadius
175
+ };
176
+ const iconBox = /* @__PURE__ */ jsx("span", {
177
+ "aria-hidden": "true",
178
+ style: {
179
+ inlineSize: iconSizeWhenFits("100%"),
180
+ marginInlineStart: segment.icon === "start" ? "10px" : "auto",
181
+ marginInlineEnd: segment.icon === "end" ? "10px" : void 0
182
+ },
183
+ className: styles.icon({ class: classNames?.icon }),
184
+ children: icon
185
+ });
186
+ const stop = (at) => /* @__PURE__ */ jsx("span", {
187
+ "aria-hidden": "true",
188
+ "data-slot": "stop-indicator",
189
+ style: at === "start" ? { marginInlineStart: "calc(var(--m3-slider-corner) - 2px)" } : {
190
+ marginInlineStart: "auto",
191
+ marginInlineEnd: "calc(var(--m3-slider-corner) - 2px)"
192
+ },
193
+ className: styles.stop({ class: classNames?.stop })
194
+ });
195
+ return /* @__PURE__ */ jsxs("span", {
196
+ "data-tone": segment.tone,
197
+ "data-slot": `${segment.tone}-track`,
198
+ style: {
199
+ marginInlineStart: segment.start,
200
+ inlineSize: segmentLength(segment),
201
+ ...radius
202
+ },
203
+ className: styles.segment({ class: segment.tone === "active" ? classNames?.activeTrack : classNames?.inactiveTrack }),
204
+ children: [
205
+ segment.stopAtStart && stop("start"),
206
+ icon != null && iconBox,
207
+ segment.stopAtEnd && icon == null && stop("end")
208
+ ]
209
+ });
210
+ }
211
+ /** Whether each arrow key increases the value (true) or decreases it (false), by direction. */
212
+ const INCREASE_KEYS = {
213
+ ltr: {
214
+ ArrowRight: true,
215
+ ArrowUp: true,
216
+ ArrowLeft: false,
217
+ ArrowDown: false
218
+ },
219
+ rtl: {
220
+ ArrowLeft: true,
221
+ ArrowUp: true,
222
+ ArrowRight: false,
223
+ ArrowDown: false
224
+ }
225
+ };
226
+ function Thumb({ index, at, state, trackRef, name, label, errorMessage, valueLabel, styles, classNames }) {
227
+ const inputRef = useRef(null);
228
+ const { thumbProps, inputProps, isDragging } = useSliderThumb({
229
+ index,
230
+ trackRef,
231
+ inputRef,
232
+ name,
233
+ "aria-label": label,
234
+ "aria-errormessage": errorMessage
235
+ }, state);
236
+ const thumbInputProps = {
237
+ ...inputProps,
238
+ "aria-describedby": inputProps["aria-describedby"] || void 0,
239
+ "aria-details": inputProps["aria-details"] || void 0
240
+ };
241
+ const { focusProps, isFocusVisible } = useFocusRing();
242
+ const { direction } = useLocale();
243
+ const [spaceHeld, setSpaceHeld] = useState(false);
244
+ const intervalKeys = {
245
+ onKeyDown: (event) => {
246
+ if (event.key === " ") {
247
+ event.preventDefault();
248
+ setSpaceHeld(true);
249
+ return;
250
+ }
251
+ const increase = INCREASE_KEYS[direction][event.key];
252
+ if (!spaceHeld || increase === void 0) return;
253
+ event.preventDefault();
254
+ event.stopPropagation();
255
+ state.setThumbDragging(index, true);
256
+ if (increase) state.incrementThumb(index, state.pageSize);
257
+ else state.decrementThumb(index, state.pageSize);
258
+ state.setThumbDragging(index, false);
259
+ },
260
+ onKeyUp: (event) => {
261
+ if (event.key === " ") setSpaceHeld(false);
262
+ },
263
+ onBlur: () => setSpaceHeld(false)
264
+ };
265
+ const active = isDragging || isFocusVisible;
266
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
267
+ ...thumbProps,
268
+ "data-thumb": index,
269
+ "data-focus-visible": isFocusVisible || void 0,
270
+ "data-dragging": isDragging || void 0,
271
+ style: { marginInlineStart: `calc(${at} - 2px)` },
272
+ className: styles.thumb({ class: classNames?.thumb }),
273
+ children: [/* @__PURE__ */ jsx("span", {
274
+ "data-slot": "handle",
275
+ "data-active": active || void 0,
276
+ className: styles.handle({ class: classNames?.handle })
277
+ }), /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("input", {
278
+ ref: inputRef,
279
+ ...mergeProps(thumbInputProps, focusProps, intervalKeys)
280
+ }) })]
281
+ }), valueLabel && (isDragging || isFocusVisible) && /* @__PURE__ */ jsx("span", {
282
+ "aria-hidden": "true",
283
+ style: { marginInlineStart: at },
284
+ className: styles.labelAnchor(),
285
+ children: /* @__PURE__ */ jsx("span", {
286
+ "data-slot": "value-indicator",
287
+ className: styles.label({ class: classNames?.label }),
288
+ children: state.getThumbValueLabel(index)
289
+ })
290
+ })] });
291
+ }
292
+ //#endregion
293
+ export { RangeSlider, Slider };
294
+
295
+ //# sourceMappingURL=Slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Slider.js","names":[],"sources":["../../../src/components/slider/Slider.tsx"],"sourcesContent":["'use client';\n\nimport {\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n type RefObject,\n} from 'react';\nimport {\n mergeProps,\n useFocusRing,\n useLocale,\n useNumberFormatter,\n useObjectRef,\n useSlider,\n useSliderThumb,\n VisuallyHidden,\n} from 'react-aria';\nimport { useSliderState, type SliderState } from 'react-stately';\nimport { DomDirectionLocale } from '../../primitives/DomDirectionLocale';\nimport { cn } from '../../utils/cn';\nimport { mergeDataTokens } from '../../utils/merge-data-tokens';\nimport { splitRootProps, type RootDOMProps } from '../../utils/root-props';\nimport { useTouchTrack } from './use-touch-track';\nimport {\n iconSizeWhenFits,\n movedStartIcon,\n segmentLength,\n trackGeometry,\n type TrackSegment,\n} from './slider-geometry';\nimport { sliderStyles, type SliderOrientation, type SliderSize } from './slider-styles';\n\nexport interface SliderClassNames {\n /** The outer element. */\n root?: string;\n /** The track, holding the active and inactive segments and the stop indicators. */\n track?: string;\n /** Each active track segment (the filled part, from the start or the centre). */\n activeTrack?: string;\n /** Each inactive track segment. */\n inactiveTrack?: string;\n /** The stop indicators: at the track's ends, and at every step with `ticks`. */\n stop?: string;\n /** The inset icons (`leadingIcon`, `trailingIcon`). */\n icon?: string;\n /** Each thumb, the pressable area around its handle. */\n thumb?: string;\n /** The handle bar drawn inside each thumb. */\n handle?: string;\n /** The value indicator above a thumb (`valueLabel`). */\n label?: string;\n}\n\n/** A slider needs a name: `aria-label`, or `aria-labelledby` pointing at a visible label. */\ntype Naming =\n | {\n /** Accessible name when there's no visible label. */\n 'aria-label': string;\n }\n | {\n /** The id of the visible label that names the slider. */\n 'aria-labelledby': string;\n };\n\ninterface SliderCommonProps extends RootDOMProps {\n /** The track's thickness, from XS (a 16px track) to XL. @default \"xs\" */\n size?: SliderSize;\n /**\n * The direction the slider runs. Vertical sliders run bottom to top and default to 240px\n * tall. @default \"horizontal\"\n */\n orientation?: SliderOrientation;\n /** The lowest value. @default 0 */\n min?: number;\n /** The highest value. @default 100 */\n max?: number;\n /** The amount the value changes by in one step. @default 1 */\n step?: number;\n /** Discrete: show a stop indicator at every step (use a coarse `step`). @default false */\n ticks?: boolean;\n /** Turns the slider off: it can't be moved or focused. @default false */\n disabled?: boolean;\n /** Show the value above the thumb while it is dragged or keyboard-focused. @default false */\n valueLabel?: boolean;\n /** Formats the value for the value indicator and assistive tech. */\n formatOptions?: Intl.NumberFormatOptions;\n /** Form field name (one hidden input per thumb). */\n name?: string;\n /** The id of the slider's root, its `group` (an error summary can link to it). */\n id?: string;\n /** Ref to the root `<div>` element. */\n ref?: Ref<HTMLDivElement>;\n /** Classes for the root element, merged with `classNames.root`; consumer classes win. */\n className?: string;\n /** Inline styles for the root element. */\n style?: CSSProperties;\n /** Classes for each part, by slot. `classNames.root` is merged with `className`. */\n classNames?: SliderClassNames;\n /** `data-*` attributes, like the other DOM attributes, go to the root. */\n [data: `data-${string}`]: string | number | boolean | undefined;\n}\n\nexport type SliderProps = SliderCommonProps &\n Naming & {\n /** The value (controlled). */\n value?: number;\n /** The initial value when uncontrolled. @default min */\n defaultValue?: number;\n /** Called as the value changes, while dragging too. */\n onChange?: (value: number) => void;\n /** Called when the user stops dragging or releases a key. */\n onChangeEnd?: (value: number) => void;\n /**\n * Fill the track from its centre (for values around a midpoint). M3 doesn't use inset\n * icons on centred sliders, so `leadingIcon` and `trailingIcon` are ignored. @default false\n */\n centered?: boolean;\n /**\n * An icon inside the active track at its start (sizes md and up; ignored, with a dev\n * warning, on xs and sm). When the active track is too short for it, it moves to the\n * start of the inactive track.\n */\n leadingIcon?: ReactNode;\n /** An icon inside the inactive track at its end (sizes md and up; ignored on xs and sm). */\n trailingIcon?: ReactNode;\n };\n\nexport interface RangeSliderLabels {\n /** Name of the start thumb. @default \"Minimum\" */\n start: string;\n /** Name of the end thumb. @default \"Maximum\" */\n end: string;\n}\n\nconst DEFAULT_LABELS: RangeSliderLabels = { start: 'Minimum', end: 'Maximum' };\n\nexport type RangeSliderProps = SliderCommonProps &\n Naming & {\n /** The range, as `[start, end]` (controlled). */\n value?: [number, number];\n /** The initial range when uncontrolled. @default [min, max] */\n defaultValue?: [number, number];\n /** Called as the range changes, while dragging too. */\n onChange?: (value: [number, number]) => void;\n /** Called when the user stops dragging or releases a key. */\n onChangeEnd?: (value: [number, number]) => void;\n /** Words the range slider announces (its thumbs' names), with English defaults. */\n labels?: Partial<RangeSliderLabels>;\n };\n\n/**\n * M3 Expressive slider: XS–XL sizes, horizontal or vertical, continuous or discrete with\n * stop indicators, optionally centred, with inset icons and a value indicator. Arrow keys,\n * Page Up / Down and Home / End adjust it (mirrored in RTL).\n *\n * @example\n * <Slider aria-label=\"Volume\" size=\"md\" leadingIcon={<VolumeIcon />} defaultValue={40} />\n */\nexport function Slider(props: SliderProps) {\n return (\n <DomDirectionLocale>\n {(directionRef) => <SliderRoot {...props} range={false} directionRef={directionRef} />}\n </DomDirectionLocale>\n );\n}\n\n/**\n * M3 Expressive range slider: two thumbs selecting a range, with the same sizes,\n * orientations and discrete stops as {@link Slider}.\n *\n * @example\n * <RangeSlider aria-label=\"Price\" defaultValue={[20, 80]} />\n */\nexport function RangeSlider(props: RangeSliderProps) {\n return (\n <DomDirectionLocale>\n {(directionRef) => <SliderRoot {...props} range directionRef={directionRef} />}\n </DomDirectionLocale>\n );\n}\n\ntype RootProps = (SliderProps | RangeSliderProps) & {\n range: boolean;\n directionRef: (element: HTMLElement | null) => void;\n};\n\nfunction SliderRoot(props: RootProps) {\n const {\n size = 'xs',\n orientation = 'horizontal',\n min = 0,\n max = 100,\n step = 1,\n ticks = false,\n disabled = false,\n valueLabel = false,\n formatOptions,\n name,\n id,\n ref,\n className,\n style,\n classNames,\n range,\n directionRef,\n value,\n defaultValue,\n onChange,\n onChangeEnd,\n ...rest\n } = props;\n const {\n centered = false,\n leadingIcon: startIconProp,\n trailingIcon: endIconProp,\n } = props as SliderProps;\n // M3: only M, L and XL standard sliders take inset icons (\"Avoid adding inset icons to XS\n // or S\"; none on centred sliders).\n const iconSize = size === 'md' || size === 'lg' || size === 'xl';\n const startIcon = iconSize && !centered ? startIconProp : undefined;\n const endIcon = iconSize && !centered ? endIconProp : undefined;\n const labels = { ...DEFAULT_LABELS, ...(props as RangeSliderProps).labels };\n // The root is the slider's group: its DOM attributes join the hook's.\n const { root: data, rest: labelling } = splitRootProps(rest);\n // The naming attributes: the name goes to the group and each thumb (React Aria), and the\n // description, details and error message to each thumb's input, which takes focus.\n const {\n 'aria-label': label,\n 'aria-labelledby': labelledBy,\n 'aria-describedby': describedBy,\n 'aria-details': details,\n 'aria-errormessage': errorMessage,\n } = labelling as {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-details'?: string;\n 'aria-errormessage'?: string;\n };\n\n const numberFormatter = useNumberFormatter(formatOptions);\n // React Stately works with arrays; a single slider wraps and unwraps its number.\n const wrap = (v: number | [number, number] | undefined) =>\n v === undefined ? undefined : Array.isArray(v) ? v : [v];\n const unwrap = (v: number[]) => (range ? (v as [number, number]) : v[0]!);\n const ariaProps = {\n id,\n minValue: min,\n maxValue: max,\n step,\n orientation,\n isDisabled: disabled,\n 'aria-label': label,\n 'aria-labelledby': labelledBy,\n 'aria-describedby': describedBy,\n 'aria-details': details,\n value: wrap(value),\n defaultValue: wrap(defaultValue) ?? (range ? [min, max] : [min]),\n onChange: onChange && ((v: number[]) => (onChange as (x: unknown) => void)(unwrap(v))),\n onChangeEnd: onChangeEnd && ((v: number[]) => (onChangeEnd as (x: unknown) => void)(unwrap(v))),\n };\n const state = useSliderState({ ...ariaProps, numberFormatter });\n const rootRef = useObjectRef(ref);\n const trackRef = useRef<HTMLDivElement>(null);\n const { groupProps, trackProps } = useSlider(ariaProps, state, trackRef);\n const { direction } = useLocale();\n const count = Math.round((max - min) / step);\n const touchTrackProps = useTouchTrack(trackProps, {\n state,\n trackRef,\n orientation,\n direction,\n disabled,\n discrete: ticks && count > 0,\n });\n\n const tickFractions =\n ticks && count > 0 ? Array.from({ length: count + 1 }, (_, i) => i / count) : [];\n const fractions = state.values.map((_, index) => state.getThumbPercent(index));\n const geometry = trackGeometry({ fractions, ticks: tickFractions, centered: centered && !range });\n const styles = sliderStyles({ size, orientation });\n if (process.env.NODE_ENV !== 'production' && (startIconProp != null || endIconProp != null)) {\n if (centered) {\n console.warn(\n 'Slider: inset icons are not used on centred sliders (M3), so they are ignored.',\n );\n } else if (!iconSize) {\n console.warn('Slider: inset icons need size md, lg or xl (M3), so they are ignored.');\n }\n }\n if (process.env.NODE_ENV !== 'production' && range && orientation === 'vertical') {\n console.warn('RangeSlider: M3 advises against vertical range sliders.');\n }\n const activeSegment = geometry.segments.find((segment) => segment.icon === 'start');\n const moved =\n activeSegment && startIcon != null && movedStartIcon(activeSegment, geometry.thumbs[0]!);\n\n return (\n <div\n {...mergeProps(data, groupProps)}\n ref={(element) => {\n rootRef.current = element;\n directionRef(element);\n }}\n style={style}\n data-tokens={mergeDataTokens('md-comp-slider', data)}\n data-size={size}\n data-orientation={orientation}\n data-disabled={disabled || undefined}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n <div\n {...touchTrackProps}\n ref={trackRef}\n className={styles.track({ class: classNames?.track })}\n >\n {geometry.segments.map((segment, index) => (\n <Segment\n key={index}\n segment={segment}\n styles={styles}\n classNames={classNames}\n icon={\n segment.icon === 'start' ? startIcon : segment.icon === 'end' ? endIcon : undefined\n }\n />\n ))}\n {moved && (\n <span\n aria-hidden=\"true\"\n data-moved-icon=\"\"\n style={{ marginInlineStart: moved.start, inlineSize: moved.size }}\n className={styles.movedIcon({ class: classNames?.icon })}\n >\n {startIcon}\n </span>\n )}\n {geometry.ticks.map((tick, index) => (\n <span\n key={index}\n aria-hidden=\"true\"\n data-slot=\"stop-indicator\"\n data-active={tick.active || undefined}\n style={{ marginInlineStart: `calc(${tick.at} - 2px)` }}\n className={styles.tick({ class: classNames?.stop })}\n />\n ))}\n {geometry.thumbs.map((at, index) => (\n <Thumb\n key={index}\n index={index as 0 | 1}\n at={at}\n state={state}\n trackRef={trackRef}\n name={name}\n label={range ? (index === 0 ? labels.start : labels.end) : undefined}\n errorMessage={errorMessage}\n valueLabel={valueLabel}\n styles={styles}\n classNames={classNames}\n />\n ))}\n </div>\n </div>\n );\n}\n\nfunction Segment({\n segment,\n styles,\n classNames,\n icon,\n}: {\n segment: TrackSegment;\n styles: ReturnType<typeof sliderStyles>;\n classNames: SliderClassNames | undefined;\n icon: ReactNode;\n}) {\n const radius = {\n borderStartStartRadius: segment.startRadius,\n borderEndStartRadius: segment.startRadius,\n borderStartEndRadius: segment.endRadius,\n borderEndEndRadius: segment.endRadius,\n };\n // Inset icons sit 10px inside and show only when the segment fits them (MDC).\n const iconBox = (\n <span\n aria-hidden=\"true\"\n style={{\n inlineSize: iconSizeWhenFits('100%'),\n marginInlineStart: segment.icon === 'start' ? '10px' : 'auto',\n marginInlineEnd: segment.icon === 'end' ? '10px' : undefined,\n }}\n className={styles.icon({ class: classNames?.icon })}\n >\n {icon}\n </span>\n );\n // Stop indicators sit a corner's length in from the track's ends.\n const stop = (at: 'start' | 'end') => (\n <span\n aria-hidden=\"true\"\n data-slot=\"stop-indicator\"\n style={\n at === 'start'\n ? { marginInlineStart: 'calc(var(--m3-slider-corner) - 2px)' }\n : { marginInlineStart: 'auto', marginInlineEnd: 'calc(var(--m3-slider-corner) - 2px)' }\n }\n className={styles.stop({ class: classNames?.stop })}\n />\n );\n return (\n <span\n data-tone={segment.tone}\n data-slot={`${segment.tone}-track`}\n style={{ marginInlineStart: segment.start, inlineSize: segmentLength(segment), ...radius }}\n className={styles.segment({\n class: segment.tone === 'active' ? classNames?.activeTrack : classNames?.inactiveTrack,\n })}\n >\n {segment.stopAtStart && stop('start')}\n {icon != null && iconBox}\n {/* An end icon takes the stop indicator's place. */}\n {segment.stopAtEnd && icon == null && stop('end')}\n </span>\n );\n}\n\n/** Whether each arrow key increases the value (true) or decreases it (false), by direction. */\nconst INCREASE_KEYS: Record<'ltr' | 'rtl', Record<string, boolean>> = {\n ltr: { ArrowRight: true, ArrowUp: true, ArrowLeft: false, ArrowDown: false },\n rtl: { ArrowLeft: true, ArrowUp: true, ArrowRight: false, ArrowDown: false },\n};\n\nfunction Thumb({\n index,\n at,\n state,\n trackRef,\n name,\n label,\n errorMessage,\n valueLabel,\n styles,\n classNames,\n}: {\n index: 0 | 1;\n at: string;\n state: SliderState;\n trackRef: RefObject<HTMLDivElement | null>;\n name?: string;\n label?: string;\n errorMessage?: string;\n valueLabel: boolean;\n styles: ReturnType<typeof sliderStyles>;\n classNames?: SliderClassNames;\n}) {\n const inputRef = useRef<HTMLInputElement>(null);\n const { thumbProps, inputProps, isDragging } = useSliderThumb(\n { index, trackRef, inputRef, name, 'aria-label': label, 'aria-errormessage': errorMessage },\n state,\n );\n // React Aria joins the description's ids into an empty string when there are none.\n const thumbInputProps = {\n ...inputProps,\n 'aria-describedby': inputProps['aria-describedby'] || undefined,\n 'aria-details': inputProps['aria-details'] || undefined,\n };\n const { focusProps, isFocusVisible } = useFocusRing();\n const { direction } = useLocale();\n // M3: \"Space & Arrows — Increase and decrease the value by one interval\", so arrows step\n // by React Aria's page size while Space is held (as Shift + arrows already do).\n const [spaceHeld, setSpaceHeld] = useState(false);\n const intervalKeys = {\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === ' ') {\n event.preventDefault();\n setSpaceHeld(true);\n return;\n }\n const increase = INCREASE_KEYS[direction][event.key];\n if (!spaceHeld || increase === undefined) return;\n event.preventDefault();\n event.stopPropagation();\n state.setThumbDragging(index, true);\n if (increase) state.incrementThumb(index, state.pageSize);\n else state.decrementThumb(index, state.pageSize);\n state.setThumbDragging(index, false);\n },\n onKeyUp: (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === ' ') setSpaceHeld(false);\n },\n onBlur: () => setSpaceHeld(false),\n };\n // The handle narrows to 2px while it is pressed or dragged (M3), or keyboard-focused.\n const active = isDragging || isFocusVisible;\n return (\n <>\n <div\n {...thumbProps}\n data-thumb={index}\n data-focus-visible={isFocusVisible || undefined}\n data-dragging={isDragging || undefined}\n style={{ marginInlineStart: `calc(${at} - 2px)` }}\n className={styles.thumb({ class: classNames?.thumb })}\n >\n <span\n data-slot=\"handle\"\n data-active={active || undefined}\n className={styles.handle({ class: classNames?.handle })}\n />\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(thumbInputProps, focusProps, intervalKeys)} />\n </VisuallyHidden>\n </div>\n {valueLabel && (isDragging || isFocusVisible) && (\n <span aria-hidden=\"true\" style={{ marginInlineStart: at }} className={styles.labelAnchor()}>\n <span data-slot=\"value-indicator\" className={styles.label({ class: classNames?.label })}>\n {state.getThumbValueLabel(index)}\n </span>\n </span>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0IA,MAAM,iBAAoC;CAAE,OAAO;CAAW,KAAK;AAAU;;;;;;;;;AAwB7E,SAAgB,OAAO,OAAoB;CACzC,OACE,oBAAC,oBAAD,EAAA,WACI,iBAAiB,oBAAC,YAAD;EAAY,GAAI;EAAO,OAAO;EAAqB;CAAe,CAAA,EACnE,CAAA;AAExB;;;;;;;;AASA,SAAgB,YAAY,OAAyB;CACnD,OACE,oBAAC,oBAAD,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AU;GAAkB,WAAW,OAAO,MAAM,EAAE,OAAO,YAAY,MAAM,CAAC;GACnF,UAAA,MAAM,mBAAmB,KAAK;EAC3B,CAAA;CACF,CAAA,CAER,EAAA,CAAA;AAEN"}
@@ -0,0 +1,138 @@
1
+ //#region src/components/slider/slider-geometry.ts
2
+ const CORNER = "var(--m3-slider-corner)";
3
+ const gap = (thumb) => `var(--m3-slider-gap-${thumb})`;
4
+ const halfAndGap = (thumb) => `(2px + ${gap(thumb)})`;
5
+ /**
6
+ * Where a fraction sits: Compose spreads discrete values between the corners, except at
7
+ * the first and last ticks, so the thumb lines up with the stop indicators.
8
+ */
9
+ function positionOf(fraction, ticks) {
10
+ const onEnd = fraction === ticks[0] || fraction === ticks[ticks.length - 1];
11
+ return ticks.length > 0 && !onEnd ? `calc(${CORNER} + (100% - 2 * ${CORNER}) * ${fraction})` : `calc(100% * ${fraction})`;
12
+ }
13
+ /** The CSS length of a segment, or 0 when Compose wouldn't draw it. */
14
+ function segmentLength(segment) {
15
+ const length = `(${segment.end} - ${segment.start})`;
16
+ return `max(0px, min(${length}, max(0px, (${length} - ${segment.threshold}) * 10000)))`;
17
+ }
18
+ /** Shows an inset icon when `length` fits it plus 10px on each side, else 0 (MDC). */
19
+ const ICON = "var(--m3-slider-icon, 0px)";
20
+ const iconSizeWhenFits = (length) => `min(${ICON}, max(0px, (${length} - ${ICON} - 20px) * 10000))`;
21
+ /**
22
+ * Where the start icon goes when the active track is too short for it (M3: "the icon moves
23
+ * to the inactive track"): 10px after the inactive track's start, shown only while the
24
+ * active segment (`active`, from {@link trackGeometry}) is shorter than the icon plus 20px.
25
+ */
26
+ function movedStartIcon(active, thumb) {
27
+ return {
28
+ start: `calc(${thumb} + ${halfAndGap(0)} + 10px)`,
29
+ size: `min(${ICON}, max(0px, (${ICON} + 20px - ${segmentLength(active)}) * 10000))`
30
+ };
31
+ }
32
+ function trackGeometry({ fractions, ticks, centered }) {
33
+ const discrete = ticks.length > 0;
34
+ const thumbs = fractions.map((fraction) => positionOf(fraction, ticks));
35
+ const segments = [];
36
+ let activeRange;
37
+ if (fractions.length === 2) {
38
+ const [start, end] = thumbs;
39
+ segments.push({
40
+ tone: "inactive",
41
+ start: "0px",
42
+ end: `calc(${start} - ${halfAndGap(0)})`,
43
+ threshold: CORNER,
44
+ startRadius: CORNER,
45
+ endRadius: "2px",
46
+ stopAtStart: true
47
+ }, {
48
+ tone: "active",
49
+ start: `calc(${start} + ${halfAndGap(0)})`,
50
+ end: `calc(${end} - ${halfAndGap(1)})`,
51
+ threshold: "2px",
52
+ startRadius: "2px",
53
+ endRadius: "2px"
54
+ }, {
55
+ tone: "inactive",
56
+ start: `calc(${end} + ${halfAndGap(1)})`,
57
+ end: "100%",
58
+ threshold: CORNER,
59
+ startRadius: "2px",
60
+ endRadius: CORNER,
61
+ stopAtEnd: true
62
+ });
63
+ activeRange = [fractions[0], fractions[1]];
64
+ } else if (centered) {
65
+ const fraction = fractions[0];
66
+ const thumb = thumbs[0];
67
+ const threshold = discrete ? CORNER : "0px";
68
+ const activeThreshold = discrete ? "2px" : "0px";
69
+ const startGap = fraction <= .5 ? halfAndGap(0) : gap(0);
70
+ const endGap = fraction >= .5 ? halfAndGap(0) : gap(0);
71
+ segments.push({
72
+ tone: "inactive",
73
+ start: "0px",
74
+ end: fraction < .5 ? `calc(${thumb} - ${startGap})` : `calc(50% - ${startGap})`,
75
+ threshold,
76
+ startRadius: CORNER,
77
+ endRadius: "2px",
78
+ stopAtStart: true
79
+ });
80
+ segments.push({
81
+ tone: "active",
82
+ start: fraction < .5 ? `calc(${thumb} + ${startGap})` : "50%",
83
+ end: fraction > .5 ? `calc(${thumb} - ${endGap})` : "50%",
84
+ threshold: activeThreshold,
85
+ startRadius: "2px",
86
+ endRadius: "2px"
87
+ });
88
+ segments.push({
89
+ tone: "inactive",
90
+ start: fraction > .5 ? `calc(${thumb} + ${endGap})` : `calc(50% + ${endGap})`,
91
+ end: "100%",
92
+ threshold,
93
+ startRadius: "2px",
94
+ endRadius: CORNER,
95
+ stopAtEnd: true
96
+ });
97
+ activeRange = [Math.min(fraction, .5), Math.max(fraction, .5)];
98
+ } else {
99
+ const thumb = thumbs[0];
100
+ segments.push({
101
+ tone: "active",
102
+ start: "0px",
103
+ end: `calc(${thumb} - ${halfAndGap(0)})`,
104
+ threshold: CORNER,
105
+ startRadius: CORNER,
106
+ endRadius: "2px",
107
+ icon: "start"
108
+ }, {
109
+ tone: "inactive",
110
+ start: `calc(${thumb} + ${halfAndGap(0)})`,
111
+ end: "100%",
112
+ threshold: CORNER,
113
+ startRadius: "2px",
114
+ endRadius: CORNER,
115
+ stopAtEnd: true,
116
+ icon: "end"
117
+ });
118
+ activeRange = [0, fractions[0]];
119
+ }
120
+ const hasStartStop = centered || fractions.length === 2;
121
+ const near = (a, b) => Math.abs(a - b) < 1e-9;
122
+ return {
123
+ segments,
124
+ ticks: ticks.filter((tick, index) => {
125
+ if (index === ticks.length - 1 || hasStartStop && index === 0) return false;
126
+ if (fractions.some((fraction) => near(fraction, tick))) return false;
127
+ return !(centered && near(tick, .5));
128
+ }).map((tick) => ({
129
+ at: `calc(${CORNER} + (100% - 2 * ${CORNER}) * ${tick})`,
130
+ active: tick > activeRange[0] - 1e-9 && tick < activeRange[1] + 1e-9
131
+ })),
132
+ thumbs
133
+ };
134
+ }
135
+ //#endregion
136
+ export { CORNER, iconSizeWhenFits, movedStartIcon, positionOf, segmentLength, trackGeometry };
137
+
138
+ //# sourceMappingURL=slider-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slider-geometry.js","names":[],"sources":["../../../src/components/slider/slider-geometry.ts"],"sourcesContent":["/*\n * Track geometry, ported from Compose's `SliderDefaults.drawTrack` (Slider.kt) and the\n * thumb placement in `SliderImpl`, as CSS length expressions along the track's inline axis\n * (0 = the minimum end, 100% = the maximum end). Expressions use custom properties set by\n * the slider: `--m3-slider-corner` (the track corner) and `--m3-slider-gap-0` / `-1` (the\n * gap between each thumb and the track, 6px, 10px while focused). The thumb is 4px wide,\n * so a thumb's half plus its gap is `2px + gap`.\n *\n * Pure functions, so they can be unit-tested against Compose's drawing rules.\n */\n\nexport const CORNER = 'var(--m3-slider-corner)';\nconst gap = (thumb: 0 | 1) => `var(--m3-slider-gap-${thumb})`;\nconst halfAndGap = (thumb: 0 | 1) => `(2px + ${gap(thumb)})`;\n\nexport interface TrackSegment {\n tone: 'active' | 'inactive';\n /** Start and end along the track. */\n start: string;\n end: string;\n /** Compose draws a segment only when it is longer than this. */\n threshold: string;\n startRadius: string;\n endRadius: string;\n /** Draw the track's stop indicator at this segment's start / end. */\n stopAtStart?: boolean;\n stopAtEnd?: boolean;\n /** Which inset icon this segment holds (active start / inactive end). */\n icon?: 'start' | 'end';\n}\n\nexport interface TrackTick {\n at: string;\n active: boolean;\n}\n\nexport interface SliderGeometryInput {\n /** Thumb positions as fractions (one, or two for a range). */\n fractions: number[];\n /** Tick fractions (discrete sliders), including both ends; empty when continuous. */\n ticks: number[];\n centered: boolean;\n}\n\n/**\n * Where a fraction sits: Compose spreads discrete values between the corners, except at\n * the first and last ticks, so the thumb lines up with the stop indicators.\n */\nexport function positionOf(fraction: number, ticks: number[]): string {\n const onEnd = fraction === ticks[0] || fraction === ticks[ticks.length - 1];\n return ticks.length > 0 && !onEnd\n ? `calc(${CORNER} + (100% - 2 * ${CORNER}) * ${fraction})`\n : `calc(100% * ${fraction})`;\n}\n\n/** The CSS length of a segment, or 0 when Compose wouldn't draw it. */\nexport function segmentLength(segment: TrackSegment): string {\n const length = `(${segment.end} - ${segment.start})`;\n // min(length, max(0, (length − threshold) × 10⁴)) is the length when it exceeds the\n // threshold and 0 otherwise.\n return `max(0px, min(${length}, max(0px, (${length} - ${segment.threshold}) * 10000)))`;\n}\n\n/** Shows an inset icon when `length` fits it plus 10px on each side, else 0 (MDC). */\nconst ICON = 'var(--m3-slider-icon, 0px)';\nexport const iconSizeWhenFits = (length: string) =>\n `min(${ICON}, max(0px, (${length} - ${ICON} - 20px) * 10000))`;\n\n/**\n * Where the start icon goes when the active track is too short for it (M3: \"the icon moves\n * to the inactive track\"): 10px after the inactive track's start, shown only while the\n * active segment (`active`, from {@link trackGeometry}) is shorter than the icon plus 20px.\n */\nexport function movedStartIcon(active: TrackSegment, thumb: string) {\n return {\n start: `calc(${thumb} + ${halfAndGap(0)} + 10px)`,\n size: `min(${ICON}, max(0px, (${ICON} + 20px - ${segmentLength(active)}) * 10000))`,\n };\n}\n\nexport function trackGeometry({ fractions, ticks, centered }: SliderGeometryInput): {\n segments: TrackSegment[];\n ticks: TrackTick[];\n thumbs: string[];\n} {\n const discrete = ticks.length > 0;\n const thumbs = fractions.map((fraction) => positionOf(fraction, ticks));\n const segments: TrackSegment[] = [];\n let activeRange: [number, number];\n\n if (fractions.length === 2) {\n const [start, end] = thumbs as [string, string];\n segments.push(\n {\n tone: 'inactive',\n start: '0px',\n end: `calc(${start} - ${halfAndGap(0)})`,\n threshold: CORNER,\n startRadius: CORNER,\n endRadius: '2px',\n stopAtStart: true,\n },\n {\n tone: 'active',\n start: `calc(${start} + ${halfAndGap(0)})`,\n end: `calc(${end} - ${halfAndGap(1)})`,\n threshold: '2px',\n startRadius: '2px',\n endRadius: '2px',\n },\n {\n tone: 'inactive',\n start: `calc(${end} + ${halfAndGap(1)})`,\n end: '100%',\n threshold: CORNER,\n startRadius: '2px',\n endRadius: CORNER,\n stopAtEnd: true,\n },\n );\n activeRange = [fractions[0]!, fractions[1]!];\n } else if (centered) {\n const fraction = fractions[0]!;\n const thumb = thumbs[0]!;\n // Compose shrinks corners in a centred track, so segments draw down to 0 length\n // (or the corner, with ticks). The gap at the centre omits the thumb's half.\n const threshold = discrete ? CORNER : '0px';\n const activeThreshold = discrete ? '2px' : '0px';\n const startGap = fraction <= 0.5 ? halfAndGap(0) : gap(0);\n const endGap = fraction >= 0.5 ? halfAndGap(0) : gap(0);\n segments.push({\n tone: 'inactive',\n start: '0px',\n end: fraction < 0.5 ? `calc(${thumb} - ${startGap})` : `calc(50% - ${startGap})`,\n threshold,\n startRadius: CORNER,\n endRadius: '2px',\n stopAtStart: true,\n });\n segments.push({\n tone: 'active',\n start: fraction < 0.5 ? `calc(${thumb} + ${startGap})` : '50%',\n end: fraction > 0.5 ? `calc(${thumb} - ${endGap})` : '50%',\n threshold: activeThreshold,\n startRadius: '2px',\n endRadius: '2px',\n });\n segments.push({\n tone: 'inactive',\n start: fraction > 0.5 ? `calc(${thumb} + ${endGap})` : `calc(50% + ${endGap})`,\n end: '100%',\n threshold,\n startRadius: '2px',\n endRadius: CORNER,\n stopAtEnd: true,\n });\n activeRange = [Math.min(fraction, 0.5), Math.max(fraction, 0.5)];\n } else {\n const thumb = thumbs[0]!;\n segments.push(\n {\n tone: 'active',\n start: '0px',\n end: `calc(${thumb} - ${halfAndGap(0)})`,\n threshold: CORNER,\n startRadius: CORNER,\n endRadius: '2px',\n icon: 'start',\n },\n {\n tone: 'inactive',\n start: `calc(${thumb} + ${halfAndGap(0)})`,\n end: '100%',\n threshold: CORNER,\n startRadius: '2px',\n endRadius: CORNER,\n stopAtEnd: true,\n icon: 'end',\n },\n );\n activeRange = [0, fractions[0]!];\n }\n\n // Ticks: the stop indicators replace the last tick (and the first, when both ends have\n // one); ticks under a thumb, or at the centre of a centred track, are left out.\n const hasStartStop = centered || fractions.length === 2;\n const near = (a: number, b: number) => Math.abs(a - b) < 1e-9;\n const trackTicks = ticks\n .filter((tick, index) => {\n if (index === ticks.length - 1 || (hasStartStop && index === 0)) return false;\n if (fractions.some((fraction) => near(fraction, tick))) return false;\n return !(centered && near(tick, 0.5));\n })\n .map((tick) => ({\n at: `calc(${CORNER} + (100% - 2 * ${CORNER}) * ${tick})`,\n active: tick > activeRange[0] - 1e-9 && tick < activeRange[1] + 1e-9,\n }));\n\n return { segments, ticks: trackTicks, thumbs };\n}\n"],"mappings":";AAWA,MAAa,SAAS;AACtB,MAAM,OAAO,UAAiB,uBAAuB,MAAM;AAC3D,MAAM,cAAc,UAAiB,UAAU,IAAI,KAA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,cAAc,CAAC,GAAG,UAAU,EAAG;CACjC;CAIA,MAAM,eAAe,YAAY,UAAU,WAAW;CACtD,MAAM,QAAQ,GAAW,MAAc,KAAK,IAAI,IAAI,CAAC,IAAI;CAYzD,OAAO;EAAE;EAAU,OAXA,MAChB,QAAQ,MAAM,UAAU;GACvB,IAAI,UAAU,MAAM,SAAS,KAAM,gBAAgB,UAAU,GAAI,OAAO;GACxE,IAAI,UAAU,MAAM,aAAa,KAAK,UAAU,IAAI,CAAC,GAAG,OAAO;GAC/D,OAAO,EAAE,YAAY,KAAK,MAAM,EAAG;EACrC,CAAC,CAAC,CACD,KAAK,UAAU;GACd,IAAI,QAAQ,OAAO,iBAAiB,OAAO,MAAM,KAAK;GACtD,QAAQ,OAAO,YAAY,KAAK,QAAQ,OAAO,YAAY,KAAK;EAClE,EAEiC;EAAG;CAAO;AAC/C"}
@@ -0,0 +1,133 @@
1
+ import { VariantProps } from "../../utils/tv.js";
2
+ //#region src/components/slider/slider-styles.d.ts
3
+ /** Variant definitions for {@link Slider} and {@link RangeSlider}; extend them to add sizes. */
4
+ export declare const sliderStyles: import("tailwind-variants").TVReturnType<{
5
+ orientation: {
6
+ horizontal: {
7
+ root: string;
8
+ track: string;
9
+ };
10
+ vertical: {
11
+ root: string;
12
+ track: string;
13
+ };
14
+ };
15
+ size: {
16
+ xs: {
17
+ root: string;
18
+ };
19
+ sm: {
20
+ root: string;
21
+ };
22
+ md: {
23
+ root: string;
24
+ };
25
+ lg: {
26
+ root: string;
27
+ };
28
+ xl: {
29
+ root: string;
30
+ };
31
+ };
32
+ }, {
33
+ root: string[];
34
+ track: string[];
35
+ segment: string[];
36
+ stop: string[];
37
+ tick: string[];
38
+ icon: string[];
39
+ movedIcon: string[];
40
+ thumb: string[];
41
+ handle: string[];
42
+ labelAnchor: string;
43
+ label: string[];
44
+ }, undefined, {
45
+ orientation: {
46
+ horizontal: {
47
+ root: string;
48
+ track: string;
49
+ };
50
+ vertical: {
51
+ root: string;
52
+ track: string;
53
+ };
54
+ };
55
+ size: {
56
+ xs: {
57
+ root: string;
58
+ };
59
+ sm: {
60
+ root: string;
61
+ };
62
+ md: {
63
+ root: string;
64
+ };
65
+ lg: {
66
+ root: string;
67
+ };
68
+ xl: {
69
+ root: string;
70
+ };
71
+ };
72
+ }, {
73
+ root: string[];
74
+ track: string[];
75
+ segment: string[];
76
+ stop: string[];
77
+ tick: string[];
78
+ icon: string[];
79
+ movedIcon: string[];
80
+ thumb: string[];
81
+ handle: string[];
82
+ labelAnchor: string;
83
+ label: string[];
84
+ }, import("tailwind-variants").TVReturnTypeLike<{
85
+ orientation: {
86
+ horizontal: {
87
+ root: string;
88
+ track: string;
89
+ };
90
+ vertical: {
91
+ root: string;
92
+ track: string;
93
+ };
94
+ };
95
+ size: {
96
+ xs: {
97
+ root: string;
98
+ };
99
+ sm: {
100
+ root: string;
101
+ };
102
+ md: {
103
+ root: string;
104
+ };
105
+ lg: {
106
+ root: string;
107
+ };
108
+ xl: {
109
+ root: string;
110
+ };
111
+ };
112
+ }, {
113
+ root: string[];
114
+ track: string[];
115
+ segment: string[];
116
+ stop: string[];
117
+ tick: string[];
118
+ icon: string[];
119
+ movedIcon: string[];
120
+ thumb: string[];
121
+ handle: string[];
122
+ labelAnchor: string;
123
+ label: string[];
124
+ }>>;
125
+ /**
126
+ * The variants of {@link sliderStyles}, for building on its styles. They are the recipe's keys, not
127
+ * component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.
128
+ */
129
+ export type SliderStyleProps = VariantProps<typeof sliderStyles>;
130
+ export type SliderSize = NonNullable<SliderStyleProps['size']>;
131
+ export type SliderOrientation = NonNullable<SliderStyleProps['orientation']>;
132
+ //#endregion
133
+ //# sourceMappingURL=slider-styles.d.ts.map