@noxlovette/material 0.3.2 → 0.4.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 (299) hide show
  1. package/README.md +1 -0
  2. package/dist/actions/index.d.ts +1 -0
  3. package/dist/actions/index.js +1 -0
  4. package/dist/actions/rovingFocusGroup.d.ts +20 -0
  5. package/dist/actions/rovingFocusGroup.js +82 -0
  6. package/dist/components/badge/theme.d.ts +8 -8
  7. package/dist/components/buttons/button-group/ButtonGroup.stories.svelte +83 -0
  8. package/dist/components/buttons/button-group/ButtonGroup.stories.svelte.d.ts +19 -0
  9. package/dist/components/buttons/button-group/ButtonGroup.svelte +10 -29
  10. package/dist/components/buttons/button-group/ButtonGroup.svelte.d.ts +7 -3
  11. package/dist/components/buttons/button-group/index.d.ts +0 -1
  12. package/dist/components/buttons/button-group/index.js +3 -1
  13. package/dist/components/buttons/button-group/theme.d.ts +17 -103
  14. package/dist/components/buttons/button-group/theme.js +7 -35
  15. package/dist/components/buttons/button-group/types.d.ts +9 -20
  16. package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte +118 -0
  17. package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte.d.ts +19 -0
  18. package/dist/components/buttons/connected/ConnectedButtonGroup.svelte +52 -0
  19. package/dist/components/buttons/connected/ConnectedButtonGroup.svelte.d.ts +12 -0
  20. package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte +37 -0
  21. package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte.d.ts +9 -0
  22. package/dist/components/buttons/connected/index.d.ts +3 -1
  23. package/dist/components/buttons/connected/index.js +3 -1
  24. package/dist/components/buttons/connected/theme.d.ts +125 -0
  25. package/dist/components/buttons/connected/theme.js +38 -0
  26. package/dist/components/buttons/connected/types.d.ts +32 -13
  27. package/dist/components/buttons/index.d.ts +1 -0
  28. package/dist/components/buttons/index.js +1 -0
  29. package/dist/components/buttons/split-button/SplitButton.stories.svelte +103 -0
  30. package/dist/components/buttons/split-button/SplitButton.stories.svelte.d.ts +19 -0
  31. package/dist/components/buttons/split-button/SplitButton.svelte +104 -0
  32. package/dist/components/buttons/split-button/SplitButton.svelte.d.ts +19 -0
  33. package/dist/components/buttons/split-button/index.d.ts +3 -0
  34. package/dist/components/{containers/panes → buttons/split-button}/index.js +1 -3
  35. package/dist/components/buttons/split-button/theme.d.ts +35 -0
  36. package/dist/components/buttons/split-button/theme.js +26 -0
  37. package/dist/components/buttons/split-button/types.d.ts +33 -0
  38. package/dist/components/buttons/theme.d.ts +142 -142
  39. package/dist/components/buttons/theme.js +2 -2
  40. package/dist/components/cards/Card.stories.svelte +58 -0
  41. package/dist/components/cards/Card.stories.svelte.d.ts +2 -17
  42. package/dist/components/cards/Card.svelte +76 -8
  43. package/dist/components/cards/theme.d.ts +26 -14
  44. package/dist/components/cards/theme.js +5 -1
  45. package/dist/components/cards/types.d.ts +39 -1
  46. package/dist/components/chips/Chip.stories.svelte +64 -0
  47. package/dist/components/chips/Chip.stories.svelte.d.ts +19 -0
  48. package/dist/components/chips/Chip.svelte +115 -0
  49. package/dist/components/chips/Chip.svelte.d.ts +14 -0
  50. package/dist/components/chips/index.d.ts +3 -0
  51. package/dist/components/chips/index.js +6 -0
  52. package/dist/components/chips/theme.d.ts +78 -0
  53. package/dist/components/chips/theme.js +72 -0
  54. package/dist/components/chips/types.d.ts +43 -0
  55. package/dist/components/containers/action-rail/ActionRail.stories.svelte +36 -0
  56. package/dist/components/containers/{panes/SinglePane.stories.svelte.d.ts → action-rail/ActionRail.stories.svelte.d.ts} +4 -4
  57. package/dist/components/containers/action-rail/ActionRail.svelte +35 -0
  58. package/dist/components/containers/action-rail/ActionRail.svelte.d.ts +17 -0
  59. package/dist/components/containers/action-rail/index.d.ts +3 -0
  60. package/dist/components/containers/action-rail/index.js +6 -0
  61. package/dist/components/containers/action-rail/theme.d.ts +45 -0
  62. package/dist/components/containers/action-rail/theme.js +26 -0
  63. package/dist/components/containers/action-rail/types.d.ts +20 -0
  64. package/dist/components/containers/action-rail/types.js +1 -0
  65. package/dist/components/containers/app/App.svelte +6 -6
  66. package/dist/components/containers/app/App.svelte.d.ts +4 -2
  67. package/dist/components/containers/app/theme.d.ts +1 -1
  68. package/dist/components/containers/app/types.d.ts +9 -4
  69. package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte +1 -1
  70. package/dist/components/containers/bottom-sheet/BottomSheet.svelte +1 -1
  71. package/dist/components/containers/context-menu/ContextMenu.stories.svelte +44 -0
  72. package/dist/components/containers/context-menu/ContextMenu.svelte +21 -5
  73. package/dist/components/containers/context-menu/ContextMenu.svelte.d.ts +11 -0
  74. package/dist/components/containers/context-menu/theme.d.ts +20 -2
  75. package/dist/components/containers/context-menu/theme.js +31 -8
  76. package/dist/components/containers/context-menu/types.d.ts +14 -2
  77. package/dist/components/containers/dialogue/theme.d.ts +20 -20
  78. package/dist/components/containers/divider/theme.d.ts +17 -17
  79. package/dist/components/containers/index.d.ts +2 -3
  80. package/dist/components/containers/index.js +2 -3
  81. package/dist/components/containers/link-preview/theme.d.ts +11 -11
  82. package/dist/components/containers/list/ListItem.stories.svelte +100 -0
  83. package/dist/components/containers/list/ListItem.stories.svelte.d.ts +19 -0
  84. package/dist/components/containers/list/theme.d.ts +14 -14
  85. package/dist/components/containers/list/theme.js +3 -3
  86. package/dist/components/containers/menu/Menu.stories.svelte +105 -3
  87. package/dist/components/containers/menu/Menu.stories.svelte.d.ts +2 -17
  88. package/dist/components/containers/menu/Menu.svelte +9 -7
  89. package/dist/components/containers/menu/MenuCheckboxItem.svelte +55 -0
  90. package/dist/components/containers/menu/MenuCheckboxItem.svelte.d.ts +25 -0
  91. package/dist/components/containers/menu/MenuGroup.svelte +43 -0
  92. package/dist/components/containers/menu/MenuGroup.svelte.d.ts +28 -0
  93. package/dist/components/containers/menu/MenuRadioGroup.svelte +39 -0
  94. package/dist/components/containers/menu/MenuRadioGroup.svelte.d.ts +27 -0
  95. package/dist/components/containers/menu/MenuRadioItem.svelte +49 -0
  96. package/dist/components/containers/menu/MenuRadioItem.svelte.d.ts +17 -0
  97. package/dist/components/containers/menu/MenuSub.svelte +91 -0
  98. package/dist/components/containers/menu/MenuSub.svelte.d.ts +29 -0
  99. package/dist/components/containers/menu/index.d.ts +7 -0
  100. package/dist/components/containers/menu/index.js +8 -0
  101. package/dist/components/containers/menu/menu-item/MenuItem.svelte +71 -0
  102. package/dist/components/containers/{menu-item → menu/menu-item}/MenuItem.svelte.d.ts +2 -1
  103. package/dist/components/containers/{menu-item → menu/menu-item}/types.d.ts +5 -1
  104. package/dist/components/containers/menu/menu-item/types.js +1 -0
  105. package/dist/components/containers/menu/theme.d.ts +68 -0
  106. package/dist/components/containers/menu/theme.js +36 -0
  107. package/dist/components/containers/menu/types.d.ts +113 -2
  108. package/dist/components/containers/pane/DraggablePane.stories.svelte +199 -0
  109. package/dist/components/containers/pane/DraggablePane.stories.svelte.d.ts +4 -0
  110. package/dist/components/containers/pane/DraggablePane.svelte +533 -0
  111. package/dist/components/containers/pane/DraggablePane.svelte.d.ts +29 -0
  112. package/dist/components/containers/pane/Pane.stories.svelte +104 -0
  113. package/dist/components/containers/pane/Pane.stories.svelte.d.ts +19 -0
  114. package/dist/components/containers/pane/Pane.svelte +78 -0
  115. package/dist/components/containers/pane/Pane.svelte.d.ts +18 -0
  116. package/dist/components/containers/pane/PaneGrid.stories.svelte +134 -0
  117. package/dist/components/containers/pane/PaneGrid.stories.svelte.d.ts +19 -0
  118. package/dist/components/containers/pane/PaneGrid.svelte +43 -0
  119. package/dist/components/containers/pane/PaneGrid.svelte.d.ts +13 -0
  120. package/dist/components/containers/pane/PaneHandle.svelte +90 -0
  121. package/dist/components/containers/pane/PaneHandle.svelte.d.ts +12 -0
  122. package/dist/components/containers/pane/dragStore.svelte.d.ts +16 -0
  123. package/dist/components/containers/pane/dragStore.svelte.js +38 -0
  124. package/dist/components/containers/pane/index.d.ts +8 -0
  125. package/dist/components/containers/pane/index.js +11 -0
  126. package/dist/components/containers/pane/resizeStore.svelte.d.ts +10 -0
  127. package/dist/components/containers/pane/resizeStore.svelte.js +30 -0
  128. package/dist/components/containers/pane/theme.d.ts +571 -0
  129. package/dist/components/containers/pane/theme.js +211 -0
  130. package/dist/components/containers/pane/types.d.ts +249 -0
  131. package/dist/components/containers/pane/types.js +1 -0
  132. package/dist/components/containers/popover/Popover.stories.svelte +4 -4
  133. package/dist/components/containers/popover/Popover.svelte +3 -1
  134. package/dist/components/containers/popover/theme.d.ts +20 -20
  135. package/dist/components/containers/popover/types.d.ts +6 -2
  136. package/dist/components/containers/scroll-area/theme.d.ts +2 -2
  137. package/dist/components/containers/side-sheet/SideSheet.stories.svelte +16 -24
  138. package/dist/components/containers/side-sheet/SideSheet.svelte +73 -7
  139. package/dist/components/containers/side-sheet/SideSheet.svelte.d.ts +5 -0
  140. package/dist/components/containers/stack/theme.d.ts +44 -44
  141. package/dist/components/date/DateField.stories.svelte +57 -0
  142. package/dist/components/{containers/panes/SplitPane.stories.svelte.d.ts → date/DateField.stories.svelte.d.ts} +4 -4
  143. package/dist/components/date/DateField.svelte +11 -2
  144. package/dist/components/date/DateRangeField.stories.svelte +53 -0
  145. package/dist/components/{containers/panes/SupportingPane.stories.svelte.d.ts → date/DateRangeField.stories.svelte.d.ts} +4 -4
  146. package/dist/components/date/DateRangeField.svelte +2 -1
  147. package/dist/components/date/theme.d.ts +73 -4
  148. package/dist/components/date/theme.js +95 -26
  149. package/dist/components/date/types.d.ts +5 -0
  150. package/dist/components/forms/checkbox/Checkbox.svelte +7 -9
  151. package/dist/components/forms/checkbox/theme.d.ts +8 -8
  152. package/dist/components/forms/checkbox/theme.js +31 -9
  153. package/dist/components/forms/command/Command.stories.svelte +86 -0
  154. package/dist/components/forms/command/Command.stories.svelte.d.ts +19 -0
  155. package/dist/components/forms/command/theme.d.ts +35 -35
  156. package/dist/components/forms/command/theme.js +4 -4
  157. package/dist/components/forms/pin/theme.d.ts +2 -2
  158. package/dist/components/forms/radio-group/theme.d.ts +2 -2
  159. package/dist/components/forms/search/theme.d.ts +8 -8
  160. package/dist/components/forms/select/Select.svelte +3 -2
  161. package/dist/components/forms/select/theme.d.ts +26 -2
  162. package/dist/components/forms/select/theme.js +56 -22
  163. package/dist/components/forms/slider/theme.d.ts +20 -20
  164. package/dist/components/forms/switch/theme.d.ts +2 -2
  165. package/dist/components/forms/textfield/Textfield.stories.svelte +22 -0
  166. package/dist/components/forms/textfield/Textfield.svelte +10 -1
  167. package/dist/components/forms/textfield/theme.d.ts +44 -2
  168. package/dist/components/forms/textfield/theme.js +56 -16
  169. package/dist/components/forms/toggle-group/ToggleGroup.svelte +2 -2
  170. package/dist/components/forms/toggle-group/ToggleGroup.svelte.d.ts +2 -2
  171. package/dist/components/forms/toggle-group/ToggleGroupItem.svelte +1 -1
  172. package/dist/components/forms/toggle-group/ToggleGroupItem.svelte.d.ts +1 -1
  173. package/dist/components/forms/toggle-group/theme.d.ts +16 -16
  174. package/dist/components/forms/toggle-group/types.d.ts +2 -2
  175. package/dist/components/forms/tooltip/Tooltip.stories.svelte +90 -0
  176. package/dist/components/forms/tooltip/Tooltip.stories.svelte.d.ts +19 -0
  177. package/dist/components/forms/tooltip/Tooltip.svelte +5 -4
  178. package/dist/components/forms/tooltip/theme.d.ts +5 -2
  179. package/dist/components/forms/tooltip/theme.js +6 -5
  180. package/dist/components/index.d.ts +1 -0
  181. package/dist/components/index.js +1 -0
  182. package/dist/components/misc/Avatar.stories.svelte +63 -0
  183. package/dist/components/misc/Avatar.stories.svelte.d.ts +19 -0
  184. package/dist/components/misc/Avatar.svelte +35 -10
  185. package/dist/components/misc/DicebearAvatarBuilder.d.ts +59 -0
  186. package/dist/components/misc/DicebearAvatarBuilder.js +115 -0
  187. package/dist/components/misc/ThemeSettings.svelte +1 -1
  188. package/dist/components/misc/ThemeSwitcher.svelte +2 -2
  189. package/dist/components/misc/dicebearStyles.d.ts +21 -0
  190. package/dist/components/misc/dicebearStyles.js +169 -0
  191. package/dist/components/misc/index.d.ts +3 -0
  192. package/dist/components/misc/index.js +3 -0
  193. package/dist/components/misc/materialAvatarPalette.d.ts +6 -0
  194. package/dist/components/misc/materialAvatarPalette.js +44 -0
  195. package/dist/components/misc/theme.d.ts +20 -2
  196. package/dist/components/misc/theme.js +9 -3
  197. package/dist/components/misc/types.d.ts +20 -2
  198. package/dist/components/nav/appbar/AppBar.stories.svelte +1 -1
  199. package/dist/components/nav/appbar/AppBar.svelte +46 -15
  200. package/dist/components/nav/appbar/AppBar.svelte.d.ts +5 -0
  201. package/dist/components/nav/appbar/theme.d.ts +20 -14
  202. package/dist/components/nav/appbar/theme.js +11 -7
  203. package/dist/components/nav/appbar/types.d.ts +3 -1
  204. package/dist/components/nav/breadcrumb/Breadcrumb.stories.svelte +50 -0
  205. package/dist/components/nav/breadcrumb/Breadcrumb.stories.svelte.d.ts +19 -0
  206. package/dist/components/nav/breadcrumb/Breadcrumb.svelte +46 -0
  207. package/dist/components/nav/breadcrumb/Breadcrumb.svelte.d.ts +13 -0
  208. package/dist/components/nav/breadcrumb/index.d.ts +3 -0
  209. package/dist/components/nav/breadcrumb/index.js +6 -0
  210. package/dist/components/nav/breadcrumb/theme.d.ts +84 -0
  211. package/dist/components/nav/breadcrumb/theme.js +35 -0
  212. package/dist/components/nav/breadcrumb/types.d.ts +14 -0
  213. package/dist/components/nav/breadcrumb/types.js +1 -0
  214. package/dist/components/nav/index.d.ts +1 -0
  215. package/dist/components/nav/index.js +1 -0
  216. package/dist/components/nav/navbar/theme.d.ts +19 -19
  217. package/dist/components/nav/rail/Rail.stories.svelte +1 -5
  218. package/dist/components/nav/rail/Rail.svelte +3 -25
  219. package/dist/components/nav/rail/theme.d.ts +4 -4
  220. package/dist/components/nav/rail/types.d.ts +0 -5
  221. package/dist/components/nav/tabs/TabHolder.svelte +2 -1
  222. package/dist/components/nav/tabs/theme.d.ts +21 -21
  223. package/dist/components/nav/tabs/theme.js +6 -0
  224. package/dist/components/nav/tabs/types.d.ts +2 -2
  225. package/dist/components/pill/theme.d.ts +35 -35
  226. package/dist/components/snackbar/theme.d.ts +8 -8
  227. package/dist/components/table/Table.stories.svelte +267 -0
  228. package/dist/components/table/Table.stories.svelte.d.ts +19 -0
  229. package/dist/components/table/Table.svelte +1 -1
  230. package/dist/components/table/TableBody.svelte +16 -3
  231. package/dist/components/table/TableBody.svelte.d.ts +5 -1
  232. package/dist/components/table/TableRow.svelte +1 -1
  233. package/dist/components/table/theme.d.ts +2 -2
  234. package/dist/components/table/theme.js +2 -2
  235. package/dist/components/table/types.d.ts +7 -0
  236. package/dist/components/time/theme.d.ts +29 -29
  237. package/dist/components/time/theme.js +2 -2
  238. package/dist/components/toolbar/Toolbar.stories.svelte +71 -0
  239. package/dist/components/toolbar/Toolbar.stories.svelte.d.ts +19 -0
  240. package/dist/components/toolbar/Toolbar.svelte +19 -3
  241. package/dist/components/toolbar/Toolbar.svelte.d.ts +8 -2
  242. package/dist/components/toolbar/ToolbarButton.svelte +28 -4
  243. package/dist/components/toolbar/ToolbarDivider.svelte +4 -3
  244. package/dist/components/toolbar/ToolbarGroup.svelte +7 -2
  245. package/dist/components/toolbar/ToolbarGroupItem.svelte +29 -4
  246. package/dist/components/toolbar/ToolbarSection.svelte +35 -0
  247. package/dist/components/toolbar/ToolbarSection.svelte.d.ts +9 -0
  248. package/dist/components/toolbar/ToolbarSpacer.svelte +18 -0
  249. package/dist/components/toolbar/ToolbarSpacer.svelte.d.ts +9 -0
  250. package/dist/components/toolbar/index.d.ts +2 -0
  251. package/dist/components/toolbar/index.js +2 -0
  252. package/dist/components/toolbar/theme.d.ts +36 -21
  253. package/dist/components/toolbar/theme.js +27 -11
  254. package/dist/components/toolbar/types.d.ts +37 -4
  255. package/dist/components/typography/body/theme.d.ts +14 -14
  256. package/dist/components/typography/display/theme.d.ts +14 -14
  257. package/dist/components/typography/headline/theme.d.ts +14 -14
  258. package/dist/components/typography/kbd/Kbd.stories.svelte +41 -0
  259. package/dist/components/typography/kbd/Kbd.stories.svelte.d.ts +19 -0
  260. package/dist/components/typography/kbd/theme.d.ts +9 -9
  261. package/dist/components/typography/kbd/theme.js +2 -2
  262. package/dist/components/typography/label/theme.d.ts +14 -14
  263. package/dist/components/typography/title/theme.d.ts +14 -14
  264. package/dist/styles/component.css +126 -4
  265. package/dist/styles/motion.css +6 -3
  266. package/dist/utils/Layer.svelte +7 -3
  267. package/dist/utils/Theme.svelte +20 -20
  268. package/dist/utils/ThemeScript.svelte +1 -1
  269. package/dist/utils/icon/theme.d.ts +14 -14
  270. package/package.json +38 -37
  271. package/bin/install-skill.js +0 -29
  272. package/dist/components/buttons/button-group/ButtonGroupItem.svelte +0 -41
  273. package/dist/components/buttons/button-group/ButtonGroupItem.svelte.d.ts +0 -8
  274. package/dist/components/buttons/connected/ConnectedButtons.svelte +0 -14
  275. package/dist/components/buttons/connected/ConnectedButtons.svelte.d.ts +0 -8
  276. package/dist/components/containers/menu-item/MenuItem.svelte +0 -74
  277. package/dist/components/containers/merger/InputMerger.svelte +0 -29
  278. package/dist/components/containers/merger/InputMerger.svelte.d.ts +0 -14
  279. package/dist/components/containers/merger/index.d.ts +0 -1
  280. package/dist/components/containers/merger/index.js +0 -3
  281. package/dist/components/containers/panes/SinglePane.stories.svelte +0 -67
  282. package/dist/components/containers/panes/SinglePane.svelte +0 -32
  283. package/dist/components/containers/panes/SinglePane.svelte.d.ts +0 -5
  284. package/dist/components/containers/panes/SplitPane.stories.svelte +0 -124
  285. package/dist/components/containers/panes/SplitPane.svelte +0 -144
  286. package/dist/components/containers/panes/SplitPane.svelte.d.ts +0 -8
  287. package/dist/components/containers/panes/SupportingPane.stories.svelte +0 -113
  288. package/dist/components/containers/panes/SupportingPane.svelte +0 -175
  289. package/dist/components/containers/panes/SupportingPane.svelte.d.ts +0 -9
  290. package/dist/components/containers/panes/index.d.ts +0 -5
  291. package/dist/components/containers/panes/theme.d.ts +0 -490
  292. package/dist/components/containers/panes/theme.js +0 -185
  293. package/dist/components/containers/panes/types.d.ts +0 -108
  294. package/dist/components/nav/rail/RailNavContext.svelte +0 -14
  295. package/dist/components/nav/rail/RailNavContext.svelte.d.ts +0 -8
  296. /package/dist/components/{containers/menu-item → buttons/split-button}/types.js +0 -0
  297. /package/dist/components/{containers/panes → chips}/types.js +0 -0
  298. /package/dist/components/containers/{menu-item → menu/menu-item}/index.d.ts +0 -0
  299. /package/dist/components/containers/{menu-item → menu/menu-item}/index.js +0 -0
@@ -1,23 +1,56 @@
1
- import type { IconProps } from '../../utils/index.js';
1
+ import type { DivAttrs, IconProps } from '../../utils/index.js';
2
2
  import type { ToolbarButtonProps as BitsToolbarButtonProps, ToolbarGroupItemProps as BitsToolbarGroupItemProps, ToolbarGroupProps as BitsToolbarGroupProps, ToolbarRootProps } from 'bits-ui';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { ToolbarVariants } from './theme.js';
5
5
  export type ToolbarColor = 'standard' | 'vibrant';
6
- export type ToolbarProps = ToolbarVariants & Omit<ToolbarRootProps, 'children' | 'child'> & {
6
+ export type ToolbarProps = ToolbarVariants & Omit<ToolbarRootProps, 'children' | 'child' | 'orientation'> & {
7
7
  children?: Snippet;
8
8
  fab?: Snippet;
9
9
  ghost?: boolean;
10
+ /**
11
+ * Splits the toolbar into independently painted surfaces instead of one continuous
12
+ * pill/bar — compose `children` from `ToolbarSection` + `ToolbarSpacer` when true.
13
+ */
14
+ sections?: boolean;
10
15
  class?: string;
11
16
  };
17
+ export type ToolbarSectionProps = DivAttrs & {
18
+ children?: Snippet;
19
+ };
12
20
  export type ToolbarButtonProps = Omit<BitsToolbarButtonProps, 'children' | 'child'> & {
13
- iconProps: IconProps;
21
+ /** Configuration for the leading icon. Omit when `avatar` is provided. */
22
+ iconProps?: IconProps;
23
+ /**
24
+ * Custom leading content (e.g. an avatar/image) rendered instead of `iconProps`.
25
+ */
26
+ avatar?: Snippet;
27
+ /**
28
+ * Content to display in a tooltip when hovering over the button.
29
+ * If omitted, no tooltip is shown.
30
+ */
31
+ tooltipContent?: string;
32
+ /** CSS class added to the tooltip trigger wrapper. */
33
+ triggerClass?: string;
14
34
  class?: string;
15
35
  };
16
36
  export type ToolbarGroupProps = Omit<BitsToolbarGroupProps, 'children' | 'child'> & {
17
37
  children?: Snippet;
18
38
  class?: string;
19
39
  };
40
+ export type ToolbarSpacerProps = DivAttrs;
20
41
  export type ToolbarGroupItemProps = Omit<BitsToolbarGroupItemProps, 'children' | 'child'> & {
21
- iconProps: IconProps;
42
+ /** Configuration for the leading icon. Omit when `avatar` is provided. */
43
+ iconProps?: IconProps;
44
+ /**
45
+ * Custom leading content (e.g. an avatar/image) rendered instead of `iconProps`.
46
+ */
47
+ avatar?: Snippet;
48
+ /**
49
+ * Content to display in a tooltip when hovering over the button.
50
+ * If omitted, no tooltip is shown.
51
+ */
52
+ tooltipContent?: string;
53
+ /** CSS class added to the tooltip trigger wrapper. */
54
+ triggerClass?: string;
22
55
  class?: string;
23
56
  };
@@ -2,29 +2,29 @@ import { type VariantProps } from 'tailwind-variants';
2
2
  export type BodyVariants = VariantProps<typeof body>;
3
3
  export declare const body: import("tailwind-variants").TVReturnType<{
4
4
  emphasized: {
5
- true: string;
5
+ true: "font-medium";
6
6
  };
7
7
  size: {
8
- small: string;
9
- medium: string;
10
- large: string;
8
+ small: "md-sys-typescale-body-small";
9
+ medium: "md-sys-typescale-body-medium";
10
+ large: "md-sys-typescale-body-large";
11
11
  };
12
12
  }, undefined, "", {
13
13
  emphasized: {
14
- true: string;
14
+ true: "font-medium";
15
15
  };
16
16
  size: {
17
- small: string;
18
- medium: string;
19
- large: string;
17
+ small: "md-sys-typescale-body-small";
18
+ medium: "md-sys-typescale-body-medium";
19
+ large: "md-sys-typescale-body-large";
20
20
  };
21
- }, undefined, import("tailwind-variants").TVReturnType<{
21
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
22
22
  emphasized: {
23
- true: string;
23
+ true: "font-medium";
24
24
  };
25
25
  size: {
26
- small: string;
27
- medium: string;
28
- large: string;
26
+ small: "md-sys-typescale-body-small";
27
+ medium: "md-sys-typescale-body-medium";
28
+ large: "md-sys-typescale-body-large";
29
29
  };
30
- }, undefined, "", unknown, unknown, undefined>>;
30
+ }, undefined>>;
@@ -2,29 +2,29 @@ import { type VariantProps } from 'tailwind-variants';
2
2
  export type DisplayVariants = VariantProps<typeof display>;
3
3
  export declare const display: import("tailwind-variants").TVReturnType<{
4
4
  emphasized: {
5
- true: string;
5
+ true: "font-medium";
6
6
  };
7
7
  size: {
8
- small: string;
9
- medium: string;
10
- large: string;
8
+ small: "md-sys-typescale-display-small";
9
+ medium: "md-sys-typescale-display-medium";
10
+ large: "md-sys-typescale-display-large";
11
11
  };
12
12
  }, undefined, "", {
13
13
  emphasized: {
14
- true: string;
14
+ true: "font-medium";
15
15
  };
16
16
  size: {
17
- small: string;
18
- medium: string;
19
- large: string;
17
+ small: "md-sys-typescale-display-small";
18
+ medium: "md-sys-typescale-display-medium";
19
+ large: "md-sys-typescale-display-large";
20
20
  };
21
- }, undefined, import("tailwind-variants").TVReturnType<{
21
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
22
22
  emphasized: {
23
- true: string;
23
+ true: "font-medium";
24
24
  };
25
25
  size: {
26
- small: string;
27
- medium: string;
28
- large: string;
26
+ small: "md-sys-typescale-display-small";
27
+ medium: "md-sys-typescale-display-medium";
28
+ large: "md-sys-typescale-display-large";
29
29
  };
30
- }, undefined, "", unknown, unknown, undefined>>;
30
+ }, undefined>>;
@@ -2,29 +2,29 @@ import { type VariantProps } from 'tailwind-variants';
2
2
  export type HeadlineVariants = VariantProps<typeof headline>;
3
3
  export declare const headline: import("tailwind-variants").TVReturnType<{
4
4
  emphasized: {
5
- true: string;
5
+ true: "font-medium";
6
6
  };
7
7
  size: {
8
- small: string;
9
- medium: string;
10
- large: string;
8
+ small: "md-sys-typescale-headline-small";
9
+ medium: "md-sys-typescale-headline-medium";
10
+ large: "md-sys-typescale-headline-large";
11
11
  };
12
12
  }, undefined, "", {
13
13
  emphasized: {
14
- true: string;
14
+ true: "font-medium";
15
15
  };
16
16
  size: {
17
- small: string;
18
- medium: string;
19
- large: string;
17
+ small: "md-sys-typescale-headline-small";
18
+ medium: "md-sys-typescale-headline-medium";
19
+ large: "md-sys-typescale-headline-large";
20
20
  };
21
- }, undefined, import("tailwind-variants").TVReturnType<{
21
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
22
22
  emphasized: {
23
- true: string;
23
+ true: "font-medium";
24
24
  };
25
25
  size: {
26
- small: string;
27
- medium: string;
28
- large: string;
26
+ small: "md-sys-typescale-headline-small";
27
+ medium: "md-sys-typescale-headline-medium";
28
+ large: "md-sys-typescale-headline-large";
29
29
  };
30
- }, undefined, "", unknown, unknown, undefined>>;
30
+ }, undefined>>;
@@ -0,0 +1,41 @@
1
+ <!--
2
+ `position="absolute"` anchors Kbd to the bottom-right corner of a `relative` ancestor (and is
3
+ hidden below the `md` breakpoint) — typically used to show a keyboard shortcut hint inside a
4
+ search/command input. `position="relative"` renders it inline instead.
5
+ -->
6
+ <script module lang="ts">
7
+ import { defineMeta } from '@storybook/addon-svelte-csf';
8
+ import Kbd from './Kbd.svelte';
9
+
10
+ const { Story } = defineMeta({
11
+ title: 'Typography/Kbd',
12
+ component: Kbd,
13
+ argTypes: {
14
+ position: { control: 'select', options: ['relative', 'absolute'] }
15
+ },
16
+ args: {
17
+ position: 'relative'
18
+ }
19
+ });
20
+ </script>
21
+
22
+ <Story name="Playground">
23
+ {#snippet template(args)}
24
+ <Kbd position={args.position}>⌘K</Kbd>
25
+ {/snippet}
26
+ </Story>
27
+
28
+ <Story name="Inline Shortcut" asChild>
29
+ <p class="md-sys-typescale-body-medium text-md-sys-color-on-surface">
30
+ Press <Kbd position="relative">⌘K</Kbd> to open the command palette.
31
+ </p>
32
+ </Story>
33
+
34
+ <Story name="Anchored in a Search Field" asChild>
35
+ <div
36
+ class="bg-md-sys-color-surface-container-high md-sys-typescale-body-large text-md-sys-color-on-surface-variant relative flex h-12 w-80 items-center rounded-full px-4"
37
+ >
38
+ Search...
39
+ <Kbd position="absolute">⌘K</Kbd>
40
+ </div>
41
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Kbd from './Kbd.svelte';
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ declare const Kbd: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Kbd = InstanceType<typeof Kbd>;
19
+ export default Kbd;
@@ -2,17 +2,17 @@ import { type VariantProps } from 'tailwind-variants';
2
2
  export type KbdVariants = VariantProps<typeof kbd>;
3
3
  export declare const kbd: import("tailwind-variants").TVReturnType<{
4
4
  position: {
5
- absolute: string;
6
- relative: string;
5
+ absolute: "right-1.5 bottom-1.5 hidden md:absolute md:right-2 md:bottom-2 md:inline-flex";
6
+ relative: "";
7
7
  };
8
- }, undefined, "text-xs font-semibold text-text-tertiary", {
8
+ }, undefined, "md-sys-typescale-label-small font-semibold text-md-sys-color-on-surface-variant", {
9
9
  position: {
10
- absolute: string;
11
- relative: string;
10
+ absolute: "right-1.5 bottom-1.5 hidden md:absolute md:right-2 md:bottom-2 md:inline-flex";
11
+ relative: "";
12
12
  };
13
- }, undefined, import("tailwind-variants").TVReturnType<{
13
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
14
14
  position: {
15
- absolute: string;
16
- relative: string;
15
+ absolute: "right-1.5 bottom-1.5 hidden md:absolute md:right-2 md:bottom-2 md:inline-flex";
16
+ relative: "";
17
17
  };
18
- }, undefined, "text-xs font-semibold text-text-tertiary", unknown, unknown, undefined>>;
18
+ }, undefined>>;
@@ -1,9 +1,9 @@
1
1
  import { tv } from 'tailwind-variants';
2
2
  export const kbd = tv({
3
- base: 'text-xs font-semibold text-text-tertiary',
3
+ base: 'md-sys-typescale-label-small font-semibold text-md-sys-color-on-surface-variant',
4
4
  variants: {
5
5
  position: {
6
- absolute: 'right-1.5 bottom-1.5 hidden md:absolute md:right-2 md:bottom-2',
6
+ absolute: 'right-1.5 bottom-1.5 hidden md:absolute md:right-2 md:bottom-2 md:inline-flex',
7
7
  relative: ''
8
8
  }
9
9
  }
@@ -1,28 +1,28 @@
1
1
  export declare const label: import("tailwind-variants").TVReturnType<{
2
2
  emphasized: {
3
- true: string;
3
+ true: "font-semibold";
4
4
  };
5
5
  size: {
6
- small: string;
7
- medium: string;
8
- large: string;
6
+ small: "md-sys-typescale-label-small";
7
+ medium: "md-sys-typescale-label-medium";
8
+ large: "md-sys-typescale-label-large";
9
9
  };
10
10
  }, undefined, "", {
11
11
  emphasized: {
12
- true: string;
12
+ true: "font-semibold";
13
13
  };
14
14
  size: {
15
- small: string;
16
- medium: string;
17
- large: string;
15
+ small: "md-sys-typescale-label-small";
16
+ medium: "md-sys-typescale-label-medium";
17
+ large: "md-sys-typescale-label-large";
18
18
  };
19
- }, undefined, import("tailwind-variants").TVReturnType<{
19
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
20
20
  emphasized: {
21
- true: string;
21
+ true: "font-semibold";
22
22
  };
23
23
  size: {
24
- small: string;
25
- medium: string;
26
- large: string;
24
+ small: "md-sys-typescale-label-small";
25
+ medium: "md-sys-typescale-label-medium";
26
+ large: "md-sys-typescale-label-large";
27
27
  };
28
- }, undefined, "", unknown, unknown, undefined>>;
28
+ }, undefined>>;
@@ -2,29 +2,29 @@ import { type VariantProps } from 'tailwind-variants';
2
2
  export type TitleVariants = VariantProps<typeof title>;
3
3
  export declare const title: import("tailwind-variants").TVReturnType<{
4
4
  emphasized: {
5
- true: string;
5
+ true: "font-semibold";
6
6
  };
7
7
  size: {
8
- small: string;
9
- medium: string;
10
- large: string;
8
+ small: "md-sys-typescale-title-small";
9
+ medium: "md-sys-typescale-title-medium";
10
+ large: "md-sys-typescale-title-large";
11
11
  };
12
12
  }, undefined, "", {
13
13
  emphasized: {
14
- true: string;
14
+ true: "font-semibold";
15
15
  };
16
16
  size: {
17
- small: string;
18
- medium: string;
19
- large: string;
17
+ small: "md-sys-typescale-title-small";
18
+ medium: "md-sys-typescale-title-medium";
19
+ large: "md-sys-typescale-title-large";
20
20
  };
21
- }, undefined, import("tailwind-variants").TVReturnType<{
21
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
22
22
  emphasized: {
23
- true: string;
23
+ true: "font-semibold";
24
24
  };
25
25
  size: {
26
- small: string;
27
- medium: string;
28
- large: string;
26
+ small: "md-sys-typescale-title-small";
27
+ medium: "md-sys-typescale-title-medium";
28
+ large: "md-sys-typescale-title-large";
29
29
  };
30
- }, undefined, "", unknown, unknown, undefined>>;
30
+ }, undefined>>;
@@ -7,9 +7,13 @@
7
7
  }
8
8
 
9
9
  .md-component-button-base {
10
- @apply state-layer md-sys-state-focus-indicator disabled:bg-md-sys-color-on-surface/10 disabled:text-md-sys-color-on-surface/38 disabled:before:bg-md-sys-color-on-surface/38 relative inline-flex items-center justify-center select-none disabled:cursor-not-allowed;
10
+ /* `relative` is applied as a literal utility token at each call site (theme.ts), not
11
+ * baked in here — that lets tailwind-merge dedupe it against a caller-supplied
12
+ * `fixed`/`absolute`/`sticky` override. Baking it into this custom class's own compiled
13
+ * CSS rule would set `position` outside of anything twMerge can see or override. */
14
+ @apply state-layer md-sys-state-focus-indicator disabled:bg-md-sys-color-on-surface/10 disabled:text-md-sys-color-on-surface/38 disabled:before:bg-md-sys-color-on-surface/38 inline-flex items-center justify-center select-none disabled:cursor-not-allowed;
11
15
  transition: box-shadow var(--md-sys-motion-duration, 200ms)
12
- var(--md-sys-motion-timing-function, cubic-bezier(0.34, 0.8, 0.34, 1));
16
+ var(--md-sys-motion-timing-function, cubic-bezier(0.2, 0, 0, 1));
13
17
  }
14
18
 
15
19
  .md-btn-morph {
@@ -30,6 +34,124 @@
30
34
  }
31
35
  }
32
36
 
37
+ /*
38
+ * Standard button group (https://m3.material.io/components/button-groups/overview).
39
+ * A plain flex row/column of otherwise-untouched Button/ButtonIcon/Toggle children.
40
+ * `data-size` drives both the fixed gap between buttons and the padding-inline
41
+ * "squeeze" below — pressing one button grows its own padding and shrinks its
42
+ * immediate neighbors', which is the M3-specified adjacent-button interaction.
43
+ * `:has()` scopes the shrink to only the pressed button's direct neighbors.
44
+ */
45
+ .md-btn-group-standard {
46
+ display: inline-flex;
47
+ align-items: center;
48
+ flex-wrap: nowrap;
49
+ width: max-content;
50
+
51
+ &[data-orientation='vertical'] {
52
+ flex-direction: column;
53
+ align-items: stretch;
54
+ width: auto;
55
+ }
56
+
57
+ &[data-size='xs'] {
58
+ --btn-group-gap: 1.125rem;
59
+ --btn-group-base-px: 1rem;
60
+ --btn-group-squeeze: 0.375rem;
61
+ }
62
+ &[data-size='sm'] {
63
+ --btn-group-gap: 0.75rem;
64
+ --btn-group-base-px: 1rem;
65
+ --btn-group-squeeze: 0.375rem;
66
+ }
67
+ &[data-size='md'] {
68
+ --btn-group-gap: 0.5rem;
69
+ --btn-group-base-px: 1.5rem;
70
+ --btn-group-squeeze: 0.5rem;
71
+ }
72
+ &[data-size='lg'] {
73
+ --btn-group-gap: 0.5rem;
74
+ --btn-group-base-px: 3rem;
75
+ --btn-group-squeeze: 0.75rem;
76
+ }
77
+ &[data-size='xl'] {
78
+ --btn-group-gap: 0.5rem;
79
+ --btn-group-base-px: 4rem;
80
+ --btn-group-squeeze: 1rem;
81
+ }
82
+
83
+ gap: var(--btn-group-gap, 0.5rem);
84
+
85
+ > * {
86
+ padding-inline: var(--btn-group-base-px, 1rem);
87
+ transition:
88
+ padding-inline var(--md-sys-motion-duration-fast-spatial, 350ms)
89
+ var(--md-sys-motion-timing-function-fast-spatial, cubic-bezier(0.42, 1.67, 0.21, 0.9)),
90
+ border-radius 200ms var(--md-sys-motion-timing-function-emphasized-accel);
91
+ }
92
+
93
+ > *:active:not(:disabled) {
94
+ padding-inline: calc(var(--btn-group-base-px, 1rem) + var(--btn-group-squeeze, 0.5rem));
95
+ }
96
+
97
+ > *:has(+ *:active:not(:disabled)),
98
+ > *:active:not(:disabled) + * {
99
+ padding-inline: max(
100
+ 0px,
101
+ calc(var(--btn-group-base-px, 1rem) - var(--btn-group-squeeze, 0.5rem))
102
+ );
103
+ }
104
+ }
105
+
106
+ /*
107
+ * Connected button group item — replaces the deprecated segmented button.
108
+ * `--cbg-inner` (per size) is the shared radius facing a neighbor; `--cbg-outer`
109
+ * defaults to fully round and is only overridden (to equal --cbg-inner) for the
110
+ * square shape, so the position rules below become no-ops in that case.
111
+ * Selecting/pressing an item collapses all four of its own corners to
112
+ * --cbg-inner ("round to square") without touching its neighbors' shape.
113
+ */
114
+ .md-btn-connected {
115
+ border-radius: var(--cbg-inner, 9999px);
116
+ transition:
117
+ border-radius 250ms var(--md-sys-motion-timing-function-emphasized-accel),
118
+ background-color var(--md-sys-motion-duration-fast, 150ms)
119
+ var(--md-sys-motion-timing-function, cubic-bezier(0.2, 0, 0, 1)),
120
+ color var(--md-sys-motion-duration-fast, 150ms)
121
+ var(--md-sys-motion-timing-function, cubic-bezier(0.2, 0, 0, 1));
122
+
123
+ &:only-child {
124
+ border-radius: var(--cbg-outer, 9999px);
125
+ }
126
+
127
+ &[data-orientation='horizontal']:first-child:not(:only-child) {
128
+ border-top-left-radius: var(--cbg-outer, 9999px);
129
+ border-bottom-left-radius: var(--cbg-outer, 9999px);
130
+ }
131
+ &[data-orientation='horizontal']:last-child:not(:only-child) {
132
+ border-top-right-radius: var(--cbg-outer, 9999px);
133
+ border-bottom-right-radius: var(--cbg-outer, 9999px);
134
+ }
135
+ &[data-orientation='vertical']:first-child:not(:only-child) {
136
+ border-top-left-radius: var(--cbg-outer, 9999px);
137
+ border-top-right-radius: var(--cbg-outer, 9999px);
138
+ }
139
+ &[data-orientation='vertical']:last-child:not(:only-child) {
140
+ border-bottom-left-radius: var(--cbg-outer, 9999px);
141
+ border-bottom-right-radius: var(--cbg-outer, 9999px);
142
+ }
143
+
144
+ &:active:not(:disabled),
145
+ &[data-state='on'] {
146
+ border-radius: var(--cbg-inner, 4px) !important;
147
+ transition-timing-function: var(--md-sys-motion-timing-function-emphasized-decel);
148
+ }
149
+
150
+ &:active:not(:disabled) {
151
+ transition-duration: 150ms;
152
+ }
153
+ }
154
+
33
155
  .md-component-button-filled-primary {
34
156
  @apply bg-md-sys-color-primary text-md-sys-color-on-primary;
35
157
  }
@@ -124,7 +246,7 @@
124
246
  .text-link {
125
247
  @apply text-md-sys-color-primary hover:text-md-sys-color-secondary underline;
126
248
  transition: color var(--md-sys-motion-duration, 200ms)
127
- var(--md-sys-motion-timing-function, cubic-bezier(0.34, 0.8, 0.34, 1));
249
+ var(--md-sys-motion-timing-function, cubic-bezier(0.2, 0, 0, 1));
128
250
  }
129
251
 
130
252
  .text-link.md-sys-typescale-label-small {
@@ -149,6 +271,6 @@
149
271
  @apply before:pointer-events-none before:absolute before:inset-0 before:content-[''];
150
272
  &::before {
151
273
  transition: background-color var(--md-sys-motion-duration-fast, 150ms)
152
- var(--md-sys-motion-timing-function, cubic-bezier(0.34, 0.8, 0.34, 1));
274
+ var(--md-sys-motion-timing-function, cubic-bezier(0.2, 0, 0, 1));
153
275
  }
154
276
  }
@@ -15,16 +15,19 @@
15
15
  --md-sys-motion-easing-slow-spatial: var(--md-sys-motion-timing-function-slow-spatial)
16
16
  var(--md-sys-motion-duration-slow-spatial);
17
17
 
18
- --md-sys-motion-timing-function-fast: cubic-bezier(0.31, 0.94, 0.34, 1);
18
+ /* Standard easing — md.sys.motion.easing.standard, cubic-bezier(0.2, 0, 0, 1) per
19
+ m3.material.io/styles/motion/easing-and-duration/tokens-specs. Same curve across all
20
+ three durations; only the duration changes per tier. */
21
+ --md-sys-motion-timing-function-fast: cubic-bezier(0.2, 0, 0, 1);
19
22
  --md-sys-motion-duration-fast: 150ms;
20
23
  --md-sys-motion-easing-fast: var(--md-sys-motion-timing-function-fast)
21
24
  var(--md-sys-motion-duration-fast);
22
25
 
23
- --md-sys-motion-timing-function: cubic-bezier(0.34, 0.8, 0.34, 1);
26
+ --md-sys-motion-timing-function: cubic-bezier(0.2, 0, 0, 1);
24
27
  --md-sys-motion-duration: 200ms;
25
28
  --md-sys-motion-easing: var(--md-sys-motion-timing-function) var(--md-sys-motion-duration);
26
29
 
27
- --md-sys-motion-timing-function-slow: cubic-bezier(0.34, 0.88, 0.34, 1);
30
+ --md-sys-motion-timing-function-slow: cubic-bezier(0.2, 0, 0, 1);
28
31
  --md-sys-motion-duration-slow: 300ms;
29
32
  --md-sys-motion-easing-slow: var(--md-sys-motion-timing-function-slow)
30
33
  var(--md-sys-motion-duration-slow);
@@ -54,7 +54,9 @@
54
54
  expand.setAttribute('dur', `${speed}ms`);
55
55
  expand.setAttribute('fill', 'freeze');
56
56
  expand.setAttribute('calcMode', 'spline');
57
- expand.setAttribute('keySplines', '0.4 0, 0.2 1');
57
+ // md.sys.motion.easing.standard: cubic-bezier(0.2, 0, 0, 1) — keep in sync with
58
+ // --md-sys-motion-timing-function in motion.css (SMIL keySplines can't reference CSS vars).
59
+ expand.setAttribute('keySplines', '0.2 0, 0 1');
58
60
  circle.appendChild(expand);
59
61
 
60
62
  const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
@@ -105,7 +107,9 @@
105
107
  fade.setAttribute('dur', '800ms');
106
108
  fade.setAttribute('fill', 'freeze');
107
109
  fade.setAttribute('calcMode', 'spline');
108
- fade.setAttribute('keySplines', '0.4 0, 0.2 1');
110
+ // md.sys.motion.easing.standard: cubic-bezier(0.2, 0, 0, 1) — keep in sync with
111
+ // --md-sys-motion-timing-function in motion.css (SMIL keySplines can't reference CSS vars).
112
+ fade.setAttribute('keySplines', '0.2 0, 0 1');
109
113
  circle.appendChild(fade);
110
114
  fade.beginElement();
111
115
  setTimeout(() => svg.remove(), 800);
@@ -196,7 +200,7 @@
196
200
  background-color: currentColor;
197
201
  opacity: 0;
198
202
  transition: opacity var(--md-sys-motion-duration-fast, 150ms)
199
- var(--md-sys-motion-timing-function, cubic-bezier(0.34, 0.8, 0.34, 1));
203
+ var(--md-sys-motion-timing-function, cubic-bezier(0.2, 0, 0, 1));
200
204
 
201
205
  &:not(
202
206
  :global(input:disabled + label) > .tint,
@@ -1,5 +1,16 @@
1
1
  <script lang="ts">
2
- import { generateThemeCSS, isDarkScheme, themeState, STORAGE_KEY } from './theme.svelte.js';
2
+ import { MediaQuery } from 'svelte/reactivity';
3
+ import { generateThemeCSS, themeState, STORAGE_KEY } from './theme.svelte.js';
4
+
5
+ /**
6
+ * Whether to generate and inject the M3 dynamic-color CSS custom properties
7
+ * derived from `themeState.sourceColor`. When `false`, this component still
8
+ * restores/persists `themeState.scheme` and keeps the `dark` class on
9
+ * `<html>` in sync with it (including system-preference changes) — it just
10
+ * skips generating dynamic-color CSS, for consumers supplying their own
11
+ * static `@noxlovette/material/theme/*` CSS.
12
+ */
13
+ let { generateCSS = true }: { generateCSS?: boolean } = $props();
3
14
 
4
15
  // Restore from localStorage on mount
5
16
  $effect(() => {
@@ -17,25 +28,12 @@
17
28
  });
18
29
 
19
30
  // Track dark mode, including system preference changes
20
- let finalIsDark = $state(isDarkScheme(themeState.scheme));
21
-
22
- $effect(() => {
23
- if (themeState.scheme !== 'system') {
24
- finalIsDark = themeState.scheme === 'dark';
25
- return;
26
- }
27
-
28
- const media = window.matchMedia('(prefers-color-scheme: dark)');
29
- const handler = (e: MediaQueryListEvent) => {
30
- finalIsDark = e.matches;
31
- };
32
-
33
- finalIsDark = media.matches;
34
- media.addEventListener('change', handler);
35
- return () => media.removeEventListener('change', handler);
36
- });
31
+ const systemDark = new MediaQuery('(prefers-color-scheme: dark)');
32
+ const finalIsDark = $derived(
33
+ themeState.scheme === 'system' ? systemDark.current : themeState.scheme === 'dark'
34
+ );
37
35
 
38
- const themeStyles = $derived(generateThemeCSS(themeState, finalIsDark));
36
+ const themeStyles = $derived(generateCSS ? generateThemeCSS(themeState, finalIsDark) : '');
39
37
 
40
38
  // Persist to localStorage on any change
41
39
  $effect(() => {
@@ -61,5 +59,7 @@
61
59
  </script>
62
60
 
63
61
  <svelte:head>
64
- {@html `<` + `style id="ogonek-m3-dynamic-theme">` + themeStyles + `</` + `style>`}
62
+ {#if generateCSS}
63
+ {@html `<` + `style id="ogonek-m3-dynamic-theme">` + themeStyles + `</` + `style>`}
64
+ {/if}
65
65
  </svelte:head>