@noxlovette/material 0.5.1 → 0.6.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 (296) hide show
  1. package/bin/material-claude-skill.js +31 -0
  2. package/claude-skill/material-design/SKILL.md +68 -0
  3. package/claude-skill/material-design/references/accessibility-checklist.md +29 -0
  4. package/claude-skill/material-design/references/component-patterns.md +55 -0
  5. package/claude-skill/material-design/references/motion-guide.md +163 -0
  6. package/claude-skill/material-design/references/tokens-and-styles.md +68 -0
  7. package/dist/animation/Shapes.stories.svelte +10 -6
  8. package/dist/animation/TransitionPatterns.stories.svelte +30 -20
  9. package/dist/animation/containerTransform.d.ts +4 -2
  10. package/dist/animation/containerTransform.js +4 -2
  11. package/dist/animation/enterExit.js +5 -2
  12. package/dist/animation/skeleton.d.ts +1 -1
  13. package/dist/animation/skeleton.js +1 -1
  14. package/dist/components/badge/Badge.mdx +70 -0
  15. package/dist/components/badge/Badge.stories.svelte +38 -20
  16. package/dist/components/badge/Badge.svelte +12 -5
  17. package/dist/components/badge/theme.d.ts +30 -7
  18. package/dist/components/badge/theme.js +24 -4
  19. package/dist/components/badge/types.d.ts +18 -4
  20. package/dist/components/buttons/Button.mdx +85 -0
  21. package/dist/components/buttons/Button.stories.svelte +62 -27
  22. package/dist/components/buttons/Button.svelte +29 -25
  23. package/dist/components/buttons/Button.svelte.d.ts +11 -9
  24. package/dist/components/buttons/ButtonIcon.mdx +52 -0
  25. package/dist/components/buttons/ButtonIcon.stories.svelte +72 -48
  26. package/dist/components/buttons/ButtonIcon.svelte +58 -36
  27. package/dist/components/buttons/ButtonIcon.svelte.d.ts +9 -7
  28. package/dist/components/buttons/FAB.mdx +84 -0
  29. package/dist/components/buttons/FAB.stories.svelte +103 -24
  30. package/dist/components/buttons/FAB.stories.svelte.d.ts +2 -17
  31. package/dist/components/buttons/FAB.svelte +353 -29
  32. package/dist/components/buttons/FAB.svelte.d.ts +11 -6
  33. package/dist/components/buttons/FABMenu.svelte +27 -8
  34. package/dist/components/buttons/FABMenu.svelte.d.ts +7 -3
  35. package/dist/components/buttons/FABMenuItem.svelte +20 -16
  36. package/dist/components/buttons/FABMenuItem.svelte.d.ts +3 -3
  37. package/dist/components/buttons/Toggle.stories.svelte +31 -23
  38. package/dist/components/buttons/Toggle.stories.svelte.d.ts +2 -17
  39. package/dist/components/buttons/Toggle.svelte +28 -25
  40. package/dist/components/buttons/Toggle.svelte.d.ts +5 -5
  41. package/dist/components/buttons/button-group/ButtonGroup.mdx +39 -0
  42. package/dist/components/buttons/button-group/ButtonGroup.stories.svelte +62 -43
  43. package/dist/components/buttons/button-group/ButtonGroup.stories.svelte.d.ts +2 -17
  44. package/dist/components/buttons/button-group/ButtonGroup.svelte +102 -8
  45. package/dist/components/buttons/button-group/ButtonGroup.svelte.d.ts +6 -7
  46. package/dist/components/buttons/button-group/theme.d.ts +45 -15
  47. package/dist/components/buttons/button-group/theme.js +13 -8
  48. package/dist/components/buttons/button-group/types.d.ts +13 -7
  49. package/dist/components/buttons/connected/ConnectedButtonGroup.mdx +43 -0
  50. package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte +56 -74
  51. package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte.d.ts +2 -17
  52. package/dist/components/buttons/connected/ConnectedButtonGroup.svelte +16 -4
  53. package/dist/components/buttons/connected/ConnectedButtonGroup.svelte.d.ts +4 -4
  54. package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte +35 -8
  55. package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte.d.ts +2 -3
  56. package/dist/components/buttons/connected/theme.d.ts +33 -18
  57. package/dist/components/buttons/connected/theme.js +32 -9
  58. package/dist/components/buttons/connected/types.d.ts +36 -9
  59. package/dist/components/buttons/shapeMorph.d.ts +26 -0
  60. package/dist/components/buttons/shapeMorph.js +142 -0
  61. package/dist/components/buttons/split-button/SplitButton.mdx +48 -0
  62. package/dist/components/buttons/split-button/SplitButton.stories.svelte +9 -14
  63. package/dist/components/buttons/split-button/SplitButton.svelte +65 -48
  64. package/dist/components/buttons/split-button/SplitButton.svelte.d.ts +6 -11
  65. package/dist/components/buttons/split-button/theme.d.ts +110 -17
  66. package/dist/components/buttons/split-button/theme.js +74 -16
  67. package/dist/components/buttons/split-button/types.d.ts +24 -18
  68. package/dist/components/buttons/theme.d.ts +422 -230
  69. package/dist/components/buttons/theme.js +286 -380
  70. package/dist/components/buttons/types.d.ts +130 -125
  71. package/dist/components/cards/Card.mdx +44 -0
  72. package/dist/components/cards/Card.stories.svelte +11 -11
  73. package/dist/components/cards/theme.js +5 -5
  74. package/dist/components/chips/Chip.mdx +68 -0
  75. package/dist/components/chips/Chip.stories.svelte +4 -4
  76. package/dist/components/chips/theme.js +3 -3
  77. package/dist/components/containers/action-rail/ActionRail.stories.svelte +1 -0
  78. package/dist/components/containers/action-rail/theme.js +1 -1
  79. package/dist/components/containers/bottom-sheet/BottomSheet.mdx +64 -0
  80. package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte +108 -12
  81. package/dist/components/containers/bottom-sheet/BottomSheet.svelte +179 -109
  82. package/dist/components/containers/bottom-sheet/BottomSheet.svelte.d.ts +10 -5
  83. package/dist/components/containers/bottom-sheet/index.d.ts +1 -0
  84. package/dist/components/containers/bottom-sheet/index.js +1 -0
  85. package/dist/components/containers/bottom-sheet/theme.d.ts +45 -0
  86. package/dist/components/containers/bottom-sheet/theme.js +42 -0
  87. package/dist/components/containers/bottom-sheet/types.d.ts +37 -5
  88. package/dist/components/containers/carousel/Carousel.mdx +80 -0
  89. package/dist/components/containers/carousel/Carousel.stories.svelte +131 -0
  90. package/dist/components/containers/carousel/Carousel.stories.svelte.d.ts +4 -0
  91. package/dist/components/containers/carousel/Carousel.svelte +194 -0
  92. package/dist/components/containers/carousel/Carousel.svelte.d.ts +25 -0
  93. package/dist/components/containers/carousel/index.d.ts +3 -0
  94. package/dist/components/containers/{stack → carousel}/index.js +1 -2
  95. package/dist/components/containers/carousel/keylines.d.ts +32 -0
  96. package/dist/components/containers/carousel/keylines.js +88 -0
  97. package/dist/components/containers/carousel/theme.d.ts +162 -0
  98. package/dist/components/containers/carousel/theme.js +67 -0
  99. package/dist/components/containers/carousel/types.d.ts +52 -0
  100. package/dist/components/containers/context-menu/ContextMenu.stories.svelte +1 -0
  101. package/dist/components/containers/context-menu/ContextMenu.svelte +2 -2
  102. package/dist/components/containers/context-menu/ContextMenu.svelte.d.ts +1 -1
  103. package/dist/components/containers/context-menu/theme.js +10 -10
  104. package/dist/components/containers/dialogue/Dialogue.mdx +65 -0
  105. package/dist/components/containers/dialogue/Dialogue.stories.svelte +4 -4
  106. package/dist/components/containers/dialogue/Dialogue.svelte +1 -1
  107. package/dist/components/containers/dialogue/theme.js +3 -3
  108. package/dist/components/containers/divider/Divider.stories.svelte +2 -1
  109. package/dist/components/containers/divider/Divider.svelte +2 -2
  110. package/dist/components/containers/divider/theme.d.ts +6 -6
  111. package/dist/components/containers/divider/theme.js +2 -2
  112. package/dist/components/containers/index.d.ts +1 -1
  113. package/dist/components/containers/index.js +1 -1
  114. package/dist/components/containers/link-preview/theme.js +2 -2
  115. package/dist/components/containers/list/List.svelte +18 -0
  116. package/dist/components/containers/list/List.svelte.d.ts +4 -0
  117. package/dist/components/containers/list/ListItem.mdx +100 -0
  118. package/dist/components/containers/list/ListItem.stories.svelte +177 -42
  119. package/dist/components/containers/list/ListItem.stories.svelte.d.ts +2 -17
  120. package/dist/components/containers/list/ListItem.svelte +92 -37
  121. package/dist/components/containers/list/ListItem.svelte.d.ts +1 -1
  122. package/dist/components/containers/list/context.d.ts +6 -0
  123. package/dist/components/containers/list/context.js +4 -0
  124. package/dist/components/containers/list/index.d.ts +1 -0
  125. package/dist/components/containers/list/index.js +1 -0
  126. package/dist/components/containers/list/theme.d.ts +487 -12
  127. package/dist/components/containers/list/theme.js +140 -13
  128. package/dist/components/containers/list/types.d.ts +39 -5
  129. package/dist/components/containers/menu/Menu.mdx +52 -0
  130. package/dist/components/containers/menu/Menu.stories.svelte +14 -14
  131. package/dist/components/containers/menu/Menu.svelte +1 -1
  132. package/dist/components/containers/menu/MenuGroup.svelte +1 -1
  133. package/dist/components/containers/menu/MenuGroup.svelte.d.ts +1 -1
  134. package/dist/components/containers/menu/menu-item/MenuItem.svelte +1 -1
  135. package/dist/components/containers/menu/theme.js +8 -8
  136. package/dist/components/containers/pane/DraggablePane.stories.svelte +4 -3
  137. package/dist/components/containers/pane/DraggablePane.svelte +2 -2
  138. package/dist/components/containers/pane/Pane.stories.svelte +11 -10
  139. package/dist/components/containers/pane/Pane.svelte +24 -2
  140. package/dist/components/containers/pane/PaneGrid.stories.svelte +19 -18
  141. package/dist/components/containers/pane/PaneGrid.svelte +3 -2
  142. package/dist/components/containers/pane/PaneGrid.svelte.d.ts +2 -1
  143. package/dist/components/containers/pane/PaneHandle.svelte +48 -2
  144. package/dist/components/containers/pane/PaneHandle.svelte.d.ts +4 -0
  145. package/dist/components/containers/pane/resizeStore.svelte.d.ts +10 -1
  146. package/dist/components/containers/pane/resizeStore.svelte.js +13 -2
  147. package/dist/components/containers/pane/theme.js +129 -45
  148. package/dist/components/containers/pane/types.d.ts +3 -2
  149. package/dist/components/containers/popover/Popover.mdx +45 -0
  150. package/dist/components/containers/popover/Popover.stories.svelte +1 -1
  151. package/dist/components/containers/popover/Popover.svelte +1 -1
  152. package/dist/components/containers/popover/theme.js +3 -3
  153. package/dist/components/containers/scroll-area/theme.js +2 -2
  154. package/dist/components/containers/side-sheet/SideSheet.mdx +71 -0
  155. package/dist/components/containers/side-sheet/SideSheet.stories.svelte +113 -17
  156. package/dist/components/containers/side-sheet/SideSheet.svelte +113 -66
  157. package/dist/components/containers/side-sheet/SideSheet.svelte.d.ts +8 -7
  158. package/dist/components/containers/side-sheet/index.d.ts +1 -0
  159. package/dist/components/containers/side-sheet/index.js +1 -0
  160. package/dist/components/containers/side-sheet/theme.d.ts +108 -0
  161. package/dist/components/containers/side-sheet/theme.js +72 -0
  162. package/dist/components/containers/side-sheet/types.d.ts +35 -7
  163. package/dist/components/date/DateField.stories.svelte +4 -3
  164. package/dist/components/date/DateField.svelte +11 -2
  165. package/dist/components/date/DateRangeField.stories.svelte +4 -3
  166. package/dist/components/date/DateRangeField.svelte +12 -3
  167. package/dist/components/date/theme.d.ts +7 -7
  168. package/dist/components/date/theme.js +31 -31
  169. package/dist/components/forms/checkbox/Checkbox.mdx +35 -0
  170. package/dist/components/forms/checkbox/Checkbox.stories.svelte +2 -2
  171. package/dist/components/forms/checkbox/Checkbox.svelte +1 -1
  172. package/dist/components/forms/checkbox/theme.js +3 -3
  173. package/dist/components/forms/command/Command.stories.svelte +1 -0
  174. package/dist/components/forms/command/theme.js +9 -9
  175. package/dist/components/forms/pin/theme.js +4 -4
  176. package/dist/components/forms/radio-group/RadioGroup.svelte +1 -1
  177. package/dist/components/forms/radio-group/theme.js +5 -5
  178. package/dist/components/forms/search/Search.mdx +38 -0
  179. package/dist/components/forms/search/Search.stories.svelte +19 -9
  180. package/dist/components/forms/search/Search.svelte +40 -17
  181. package/dist/components/forms/search/Search.svelte.d.ts +2 -2
  182. package/dist/components/forms/search/theme.d.ts +45 -12
  183. package/dist/components/forms/search/theme.js +13 -8
  184. package/dist/components/forms/search/types.d.ts +18 -12
  185. package/dist/components/forms/select/Select.mdx +53 -0
  186. package/dist/components/forms/select/Select.stories.svelte +4 -4
  187. package/dist/components/forms/select/Select.svelte +10 -2
  188. package/dist/components/forms/select/SelectItem.svelte +1 -1
  189. package/dist/components/forms/select/theme.js +12 -12
  190. package/dist/components/forms/slider/Slider.mdx +85 -0
  191. package/dist/components/forms/slider/Slider.stories.svelte +7 -7
  192. package/dist/components/forms/slider/Slider.svelte +46 -28
  193. package/dist/components/forms/slider/theme.d.ts +14 -0
  194. package/dist/components/forms/slider/theme.js +28 -17
  195. package/dist/components/forms/slider/types.d.ts +3 -2
  196. package/dist/components/forms/switch/Switch.mdx +38 -0
  197. package/dist/components/forms/switch/Switch.stories.svelte +3 -3
  198. package/dist/components/forms/switch/theme.js +6 -6
  199. package/dist/components/forms/textfield/Textfield.mdx +53 -0
  200. package/dist/components/forms/textfield/Textfield.stories.svelte +6 -6
  201. package/dist/components/forms/textfield/Textfield.svelte +1 -0
  202. package/dist/components/forms/textfield/theme.js +19 -19
  203. package/dist/components/forms/toggle-group/theme.js +2 -2
  204. package/dist/components/forms/tooltip/Tooltip.stories.svelte +1 -0
  205. package/dist/components/forms/tooltip/theme.js +3 -3
  206. package/dist/components/misc/Avatar.stories.svelte +5 -4
  207. package/dist/components/misc/ThemeSettings.svelte +9 -9
  208. package/dist/components/misc/ThemeSwitcher.svelte +3 -3
  209. package/dist/components/misc/theme.js +4 -4
  210. package/dist/components/nav/appbar/AppBar.mdx +71 -0
  211. package/dist/components/nav/appbar/AppBar.stories.svelte +93 -3
  212. package/dist/components/nav/appbar/AppBar.stories.svelte.d.ts +2 -17
  213. package/dist/components/nav/appbar/AppBar.svelte +90 -37
  214. package/dist/components/nav/appbar/AppBar.svelte.d.ts +9 -2
  215. package/dist/components/nav/appbar/theme.d.ts +85 -18
  216. package/dist/components/nav/appbar/theme.js +159 -23
  217. package/dist/components/nav/appbar/types.d.ts +46 -9
  218. package/dist/components/nav/breadcrumb/Breadcrumb.stories.svelte +1 -0
  219. package/dist/components/nav/breadcrumb/theme.js +5 -5
  220. package/dist/components/nav/navbar/Navbar.mdx +38 -0
  221. package/dist/components/nav/navbar/Navbar.svelte +1 -1
  222. package/dist/components/nav/navbar/NavbarItem.svelte +12 -9
  223. package/dist/components/nav/navbar/theme.js +6 -6
  224. package/dist/components/nav/rail/Rail.mdx +73 -0
  225. package/dist/components/nav/rail/Rail.stories.svelte +3 -7
  226. package/dist/components/nav/rail/Rail.svelte +1 -0
  227. package/dist/components/nav/rail/RailItem.svelte +12 -9
  228. package/dist/components/nav/rail/theme.js +13 -13
  229. package/dist/components/nav/rail/types.d.ts +4 -1
  230. package/dist/components/nav/tabs/Tabs.mdx +62 -0
  231. package/dist/components/nav/tabs/Tabs.stories.svelte +1 -1
  232. package/dist/components/nav/tabs/theme.js +4 -4
  233. package/dist/components/pill/Pill.mdx +32 -0
  234. package/dist/components/pill/Pill.stories.svelte +1 -1
  235. package/dist/components/pill/theme.d.ts +1 -1
  236. package/dist/components/pill/theme.js +1 -1
  237. package/dist/components/progress/LinearProgress.svelte +1 -1
  238. package/dist/components/progress/Progress.mdx +50 -0
  239. package/dist/components/progress/Progress.stories.svelte +6 -6
  240. package/dist/components/snackbar/Snackbar.mdx +52 -0
  241. package/dist/components/snackbar/Snackbar.stories.svelte +5 -5
  242. package/dist/components/snackbar/Snackbar.svelte +1 -1
  243. package/dist/components/snackbar/theme.d.ts +3 -3
  244. package/dist/components/snackbar/theme.js +4 -4
  245. package/dist/components/table/Table.stories.svelte +1 -0
  246. package/dist/components/table/TableHeader.svelte +1 -1
  247. package/dist/components/table/theme.js +3 -3
  248. package/dist/components/time/TimeField.stories.svelte +3 -2
  249. package/dist/components/time/TimeField.svelte +1 -1
  250. package/dist/components/time/TimepickerInput.svelte +1 -1
  251. package/dist/components/time/theme.js +5 -5
  252. package/dist/components/toolbar/Toolbar.stories.svelte +1 -0
  253. package/dist/components/toolbar/Toolbar.svelte +1 -1
  254. package/dist/components/toolbar/Toolbar.svelte.d.ts +1 -1
  255. package/dist/components/toolbar/theme.js +14 -14
  256. package/dist/components/typography/Typography.mdx +67 -0
  257. package/dist/components/typography/body/Body.stories.svelte +2 -1
  258. package/dist/components/typography/body/theme.d.ts +15 -12
  259. package/dist/components/typography/body/theme.js +19 -4
  260. package/dist/components/typography/body/types.d.ts +2 -1
  261. package/dist/components/typography/display/Display.stories.svelte +2 -1
  262. package/dist/components/typography/display/theme.d.ts +15 -12
  263. package/dist/components/typography/display/theme.js +19 -4
  264. package/dist/components/typography/display/types.d.ts +2 -1
  265. package/dist/components/typography/headline/Headline.stories.svelte +2 -1
  266. package/dist/components/typography/headline/theme.d.ts +15 -12
  267. package/dist/components/typography/headline/theme.js +19 -4
  268. package/dist/components/typography/headline/types.d.ts +2 -1
  269. package/dist/components/typography/kbd/Kbd.stories.svelte +2 -1
  270. package/dist/components/typography/kbd/theme.d.ts +4 -4
  271. package/dist/components/typography/kbd/theme.js +2 -2
  272. package/dist/components/typography/label/Label.stories.svelte +2 -1
  273. package/dist/components/typography/label/theme.d.ts +15 -12
  274. package/dist/components/typography/label/theme.js +19 -4
  275. package/dist/components/typography/label/types.d.ts +2 -1
  276. package/dist/components/typography/title/Title.stories.svelte +2 -1
  277. package/dist/components/typography/title/theme.d.ts +15 -12
  278. package/dist/components/typography/title/theme.js +19 -4
  279. package/dist/components/typography/title/types.d.ts +2 -1
  280. package/dist/index.css +1 -0
  281. package/dist/styles/component.css +78 -175
  282. package/dist/styles/elevation.css +9 -0
  283. package/dist/styles/spacing.css +29 -0
  284. package/dist/styles/typescale.css +635 -20
  285. package/dist/utils/Layer.svelte +1 -1
  286. package/dist/utils/icon/Icon.svelte +8 -6
  287. package/package.json +19 -15
  288. package/dist/components/containers/stack/HStack.svelte +0 -23
  289. package/dist/components/containers/stack/HStack.svelte.d.ts +0 -5
  290. package/dist/components/containers/stack/VStack.svelte +0 -23
  291. package/dist/components/containers/stack/VStack.svelte.d.ts +0 -5
  292. package/dist/components/containers/stack/index.d.ts +0 -4
  293. package/dist/components/containers/stack/theme.d.ts +0 -66
  294. package/dist/components/containers/stack/theme.js +0 -26
  295. package/dist/components/containers/stack/types.d.ts +0 -12
  296. /package/dist/components/containers/{stack → carousel}/types.js +0 -0
@@ -1,479 +1,385 @@
1
1
  import { tv } from 'tailwind-variants';
2
- export const button = tv({
3
- slots: {
4
- base: 'md-component-button-base relative md-btn-morph group max-w-max',
5
- icon: 'inline-flex items-center justify-center leading-none'
6
- },
2
+ /** Container, border and content colours for one button colour style in one state. */
3
+ export const buttonColor = tv({
4
+ base: '',
7
5
  variants: {
8
6
  variant: {
9
7
  elevated: '',
10
8
  filled: '',
11
9
  tonal: '',
12
- outlined: '',
10
+ outlined: '[border-width:var(--btn-outline)] border-solid',
13
11
  text: '',
14
- bare: ''
12
+ standard: ''
15
13
  },
16
- color: {
14
+ /** `default` for plain buttons; `unselected`/`selected` for toggles. */
15
+ state: {
17
16
  default: '',
18
- primary: '',
19
- secondary: '',
20
- tertiary: '',
21
- error: ''
22
- },
23
- usage: {
24
- selection: '',
25
- default: ''
26
- },
27
- size: {
28
- xs: {
29
- base: 'h-8 gap-2 px-4 md-sys-typescale-label-large font-medium [--btn-shape:1rem] [--btn-pressed-shape:4px]',
30
- icon: 'text-[20px] size-5'
31
- },
32
- sm: {
33
- base: 'h-10 gap-2 px-4 md-sys-typescale-label-large font-medium [--btn-shape:1.25rem] [--btn-pressed-shape:4px]',
34
- icon: 'size-5 text-[20px]'
35
- },
36
- md: {
37
- base: 'h-14 px-6 gap-2 md-sys-typescale-title-medium font-medium [--btn-shape:1.75rem] [--btn-pressed-shape:12px]',
38
- icon: 'size-6 text-[24px]'
39
- },
40
- lg: {
41
- base: 'h-24 px-12 gap-3 md-sys-typescale-headline-small [--btn-shape:3rem] [--btn-pressed-shape:16px]',
42
- icon: 'size-8 text-[32px]'
43
- },
44
- xl: {
45
- base: 'h-34 px-16 md-sys-typescale-headline-large gap-4 [--btn-shape:4.25rem] [--btn-pressed-shape:28px]',
46
- icon: 'text-[40px] size-10'
47
- }
48
- },
49
- shape: {
50
- round: '',
51
- square: '[--btn-shape-override:0.375rem]'
52
- },
53
- selected: {
54
- true: '',
55
- false: ''
17
+ unselected: '',
18
+ selected: ''
56
19
  }
57
20
  },
58
21
  compoundVariants: [
59
22
  {
60
- usage: 'selection',
61
- selected: true,
62
- class: {
63
- base: 'bg-md-sys-color-primary text-md-sys-color-on-primary [--btn-shape-override:0.75rem]'
64
- }
65
- },
66
- {
67
- usage: 'selection',
68
- selected: false,
69
- class: { base: 'bg-md-sys-color-surface-container-high text-md-sys-color-on-surface-variant' }
70
- },
71
- {
72
- variant: 'text',
73
- class: { base: 'bg-transparent' }
74
- },
75
- {
76
- variant: 'bare',
77
- class: { base: 'bg-transparent' }
78
- },
79
- {
80
- variant: 'filled',
81
- color: 'default',
82
- class: { base: 'md-component-button-filled-primary' }
83
- },
84
- {
85
- variant: 'filled',
86
- color: 'primary',
87
- class: { base: 'md-component-button-filled-primary' }
23
+ variant: 'elevated',
24
+ state: ['default', 'unselected'],
25
+ class: 'bg-md-sys-color-surface-container-low text-md-sys-color-primary'
88
26
  },
89
27
  {
90
- variant: 'filled',
91
- color: 'secondary',
92
- class: { base: 'md-component-button-filled-secondary' }
28
+ variant: 'elevated',
29
+ state: 'selected',
30
+ class: 'bg-md-sys-color-primary text-md-sys-color-on-primary'
93
31
  },
94
32
  {
95
33
  variant: 'filled',
96
- color: 'tertiary',
97
- class: { base: 'md-component-button-filled-tertiary' }
34
+ state: ['default', 'selected'],
35
+ class: 'bg-md-sys-color-primary text-md-sys-color-on-primary'
98
36
  },
99
37
  {
100
38
  variant: 'filled',
101
- color: 'error',
102
- class: { base: 'md-component-button-filled-error' }
103
- },
104
- {
105
- variant: 'tonal',
106
- color: 'default',
107
- class: { base: 'md-component-button-tonal-primary' }
108
- },
109
- {
110
- variant: 'tonal',
111
- color: 'primary',
112
- class: { base: 'md-component-button-tonal-primary' }
113
- },
114
- {
115
- variant: 'tonal',
116
- color: 'secondary',
117
- class: { base: 'md-component-button-tonal-secondary' }
39
+ state: 'unselected',
40
+ class: 'bg-md-sys-color-surface-container text-md-sys-color-on-surface-variant'
118
41
  },
119
42
  {
120
43
  variant: 'tonal',
121
- color: 'tertiary',
122
- class: { base: 'md-component-button-tonal-tertiary' }
44
+ state: ['default', 'unselected'],
45
+ class: 'bg-md-sys-color-secondary-container text-md-sys-color-on-secondary-container'
123
46
  },
124
47
  {
125
48
  variant: 'tonal',
126
- color: 'error',
127
- class: { base: 'md-component-button-tonal-error' }
128
- },
129
- {
130
- variant: 'outlined',
131
- color: 'default',
132
- class: { base: 'md-component-button-outline-default' }
49
+ state: 'selected',
50
+ class: 'bg-md-sys-color-secondary text-md-sys-color-on-secondary'
133
51
  },
134
52
  {
135
53
  variant: 'outlined',
136
- color: 'primary',
137
- class: { base: 'md-component-button-outline-primary' }
54
+ state: ['default', 'unselected'],
55
+ class: 'border-md-sys-color-outline-variant text-md-sys-color-on-surface-variant disabled:bg-transparent aria-disabled:bg-transparent'
138
56
  },
139
57
  {
140
58
  variant: 'outlined',
141
- color: 'secondary',
142
- class: { base: 'md-component-button-outline-secondary' }
143
- },
144
- {
145
- variant: 'outlined',
146
- color: 'tertiary',
147
- class: { base: 'md-component-button-outline-tertiary' }
148
- },
149
- {
150
- variant: 'outlined',
151
- color: 'error',
152
- class: { base: 'md-component-button-outline-error' }
59
+ state: 'selected',
60
+ class: 'bg-md-sys-color-inverse-surface text-md-sys-color-inverse-on-surface border-transparent'
153
61
  },
154
62
  {
155
63
  variant: 'text',
156
- color: 'default',
157
- class: { base: 'md-component-button-text-default' }
64
+ class: 'text-md-sys-color-primary disabled:bg-transparent aria-disabled:bg-transparent'
158
65
  },
159
66
  {
160
- variant: 'text',
161
- color: 'primary',
162
- class: { base: 'md-component-button-text-primary' }
67
+ variant: 'standard',
68
+ state: ['default', 'unselected'],
69
+ class: 'text-md-sys-color-on-surface-variant disabled:bg-transparent aria-disabled:bg-transparent'
163
70
  },
164
71
  {
165
- variant: 'text',
166
- color: 'secondary',
167
- class: { base: 'md-component-button-text-secondary' }
168
- },
169
- {
170
- variant: 'text',
171
- color: 'tertiary',
172
- class: { base: 'md-component-button-text-tertiary' }
173
- },
174
- {
175
- variant: 'text',
176
- color: 'error',
177
- class: { base: 'md-component-button-text-error' }
178
- },
179
- {
180
- variant: 'elevated',
181
- color: 'default',
182
- class: { base: 'md-component-button-elevated-default' }
183
- },
184
- {
185
- variant: 'elevated',
186
- color: 'primary',
187
- class: { base: 'md-component-button-elevated-primary' }
188
- },
189
- {
190
- variant: 'elevated',
191
- color: 'secondary',
192
- class: { base: 'md-component-button-elevated-secondary' }
72
+ variant: 'standard',
73
+ state: 'selected',
74
+ class: 'text-md-sys-color-primary disabled:bg-transparent aria-disabled:bg-transparent'
75
+ }
76
+ ]
77
+ });
78
+ // Disabled: a 10% on-surface container (styles without a container drop it again above) and 38%
79
+ // on-surface content, no elevation.
80
+ export const buttonBase = 'md-btn md-sys-state-focus-indicator relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap select-none disabled:cursor-not-allowed disabled:bg-md-sys-color-on-surface/10 disabled:text-md-sys-color-on-surface/38 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:bg-md-sys-color-on-surface/10 aria-disabled:text-md-sys-color-on-surface/38 aria-disabled:shadow-none';
81
+ /** Button measurements per size: height, padding, icon-label gap, label type, shape and outline. */
82
+ export const buttonSizes = {
83
+ xs: {
84
+ base: 'md-sys-typescale-label-large h-spacing-400 gap-spacing-50 px-spacing-150 [--btn-outline:1px] [--btn-pressed:0.5rem] [--btn-round:1rem] [--btn-square:0.75rem]',
85
+ icon: 'size-spacing-250 text-[20px]'
86
+ },
87
+ sm: {
88
+ base: 'md-sys-typescale-label-large h-spacing-500 gap-spacing-100 px-spacing-200 [--btn-outline:1px] [--btn-pressed:0.5rem] [--btn-round:1.25rem] [--btn-square:0.75rem]',
89
+ icon: 'size-spacing-250 text-[20px]'
90
+ },
91
+ md: {
92
+ base: 'md-sys-typescale-title-medium h-spacing-700 gap-spacing-100 px-spacing-300 [--btn-outline:1px] [--btn-pressed:0.75rem] [--btn-round:1.75rem] [--btn-square:1rem]',
93
+ icon: 'size-spacing-300 text-[24px]'
94
+ },
95
+ lg: {
96
+ base: 'md-sys-typescale-headline-small h-24 gap-spacing-150 px-spacing-600 [--btn-outline:2px] [--btn-pressed:1rem] [--btn-round:3rem] [--btn-square:1.75rem]',
97
+ icon: 'size-spacing-400 text-[32px]'
98
+ },
99
+ xl: {
100
+ base: 'md-sys-typescale-headline-large h-34 gap-spacing-200 px-spacing-800 [--btn-outline:3px] [--btn-pressed:1rem] [--btn-round:4.25rem] [--btn-square:1.75rem]',
101
+ icon: 'size-spacing-500 text-[40px]'
102
+ }
103
+ };
104
+ /** Resting elevation and hover lift per colour style (the text and outlined styles have none). */
105
+ export const buttonElevation = {
106
+ elevated: 'shadow-elevation-1 not-disabled:hover:shadow-elevation-2',
107
+ filled: 'not-disabled:hover:shadow-elevation-1',
108
+ tonal: 'not-disabled:hover:shadow-elevation-1',
109
+ outlined: '',
110
+ text: ''
111
+ };
112
+ export const button = tv({
113
+ slots: {
114
+ base: ['md-btn-shape', buttonBase],
115
+ icon: 'shrink-0'
116
+ },
117
+ variants: {
118
+ variant: {
119
+ elevated: { base: buttonElevation.elevated },
120
+ filled: { base: buttonElevation.filled },
121
+ tonal: { base: buttonElevation.tonal },
122
+ outlined: {},
123
+ text: {}
193
124
  },
194
- {
195
- variant: 'elevated',
196
- color: 'tertiary',
197
- class: { base: 'md-component-button-elevated-tertiary' }
125
+ size: buttonSizes,
126
+ shape: {
127
+ round: { base: '[--btn-shape:var(--btn-round)]' },
128
+ square: { base: '[--btn-shape:var(--btn-square)]' }
198
129
  },
199
- {
200
- variant: 'elevated',
201
- color: 'error',
202
- class: { base: 'md-component-button-elevated-error' }
130
+ /** Toggle buttons only: selected swaps the resting shape (round ↔ square). */
131
+ selected: {
132
+ true: {},
133
+ false: {}
203
134
  }
204
- ]
135
+ },
136
+ compoundVariants: [
137
+ { selected: true, shape: 'round', class: { base: '[--btn-shape:var(--btn-square)]' } },
138
+ { selected: true, shape: 'square', class: { base: '[--btn-shape:var(--btn-round)]' } }
139
+ ],
140
+ defaultVariants: {
141
+ variant: 'filled',
142
+ size: 'sm',
143
+ shape: 'round'
144
+ }
205
145
  });
206
146
  export const buttonIcon = tv({
207
147
  slots: {
208
- base: 'md-component-button-base relative md-btn-morph group max-w-max',
209
- icon: 'inline-flex items-center justify-center leading-none'
148
+ base: ['md-btn-shape', buttonBase],
149
+ icon: 'shrink-0'
210
150
  },
211
151
  variants: {
212
152
  variant: {
213
- elevated: '',
214
- filled: '',
215
- tonal: '',
216
- outlined: '',
217
- text: '',
218
- bare: ''
219
- },
220
- color: {
221
- default: '',
222
- primary: '',
223
- secondary: '',
224
- tertiary: '',
225
- error: ''
153
+ filled: {},
154
+ tonal: {},
155
+ outlined: {},
156
+ standard: {}
226
157
  },
227
158
  size: {
228
159
  xs: {
229
- base: 'h-8 gap-2 px-4 md-sys-typescale-label-large font-medium [--btn-shape:1rem] [--btn-pressed-shape:4px]',
230
- icon: 'text-[20px] size-5'
160
+ base: 'h-spacing-400 [--btn-outline:1px] [--btn-pressed:0.5rem] [--btn-round:1rem] [--btn-square:0.75rem]',
161
+ icon: 'size-spacing-250 text-[20px]'
231
162
  },
232
163
  sm: {
233
- base: 'h-10 gap-2 px-4 md-sys-typescale-label-large font-medium [--btn-shape:1.25rem] [--btn-pressed-shape:4px]',
234
- icon: 'size-5 text-[20px]'
164
+ base: 'h-spacing-500 [--btn-outline:1px] [--btn-pressed:0.5rem] [--btn-round:1.25rem] [--btn-square:0.75rem]',
165
+ icon: 'size-spacing-300 text-[24px]'
235
166
  },
236
167
  md: {
237
- base: 'h-14 px-6 gap-2 md-sys-typescale-title-medium font-medium [--btn-shape:1.75rem] [--btn-pressed-shape:12px]',
238
- icon: 'size-6 text-[24px]'
168
+ base: 'h-spacing-700 [--btn-outline:1px] [--btn-pressed:0.75rem] [--btn-round:1.75rem] [--btn-square:1rem]',
169
+ icon: 'size-spacing-300 text-[24px]'
239
170
  },
240
171
  lg: {
241
- base: 'h-24 px-12 gap-3 md-sys-typescale-headline-small [--btn-shape:3rem] [--btn-pressed-shape:16px]',
242
- icon: 'size-8 text-[32px]'
172
+ base: 'h-24 [--btn-outline:2px] [--btn-pressed:1rem] [--btn-round:3rem] [--btn-square:1.75rem]',
173
+ icon: 'size-spacing-400 text-[32px]'
243
174
  },
244
175
  xl: {
245
- base: 'h-34 px-16 md-sys-typescale-headline-large gap-4 [--btn-shape:4.25rem] [--btn-pressed-shape:28px]',
246
- icon: 'text-[40px] size-10'
176
+ base: 'h-34 [--btn-outline:3px] [--btn-pressed:1rem] [--btn-round:4.25rem] [--btn-square:1.75rem]',
177
+ icon: 'size-spacing-500 text-[40px]'
247
178
  }
248
179
  },
180
+ /** Container width: the icon plus the size's narrow, default or wide leading/trailing space. */
249
181
  width: {
250
- narrow: '',
251
- wide: '',
252
- default: 'aspect-square'
182
+ narrow: {},
183
+ default: {},
184
+ wide: {}
253
185
  },
254
186
  shape: {
255
- round: '',
256
- square: '[--btn-shape-override:0.75rem]'
187
+ round: { base: '[--btn-shape:var(--btn-round)]' },
188
+ square: { base: '[--btn-shape:var(--btn-square)]' }
257
189
  },
258
190
  selected: {
259
- true: '',
260
- false: ''
261
- },
262
- variation: {
263
- toggle: '',
264
- default: ''
191
+ true: {},
192
+ false: {}
265
193
  }
266
194
  },
267
195
  compoundVariants: [
268
- {
269
- variation: 'toggle',
270
- selected: true,
271
- class: {
272
- base: 'bg-md-sys-color-primary text-md-sys-color-on-primary [--btn-shape-override:0.75rem]'
273
- }
274
- },
275
- {
276
- variation: 'toggle',
277
- selected: false,
278
- class: { base: 'bg-md-sys-color-surface-container-high text-md-sys-color-on-surface-variant' }
279
- },
280
- {
281
- variant: 'text',
282
- class: { base: 'bg-transparent' }
283
- },
284
- {
285
- variant: 'bare',
286
- class: { base: 'bg-transparent' }
287
- },
288
- {
289
- variant: 'filled',
290
- color: 'default',
291
- class: { base: 'md-component-button-filled-primary' }
292
- },
293
- {
294
- variant: 'filled',
295
- color: 'primary',
296
- class: { base: 'md-component-button-filled-primary' }
297
- },
298
- {
299
- variant: 'filled',
300
- color: 'secondary',
301
- class: { base: 'md-component-button-filled-secondary' }
302
- },
303
- {
304
- variant: 'filled',
305
- color: 'tertiary',
306
- class: { base: 'md-component-button-filled-tertiary' }
307
- },
308
- {
309
- variant: 'filled',
310
- color: 'error',
311
- class: { base: 'md-component-button-filled-error' }
312
- },
313
- {
314
- variant: 'tonal',
315
- color: 'default',
316
- class: { base: 'md-component-button-tonal-primary' }
317
- },
318
- {
319
- variant: 'tonal',
320
- color: 'primary',
321
- class: { base: 'md-component-button-tonal-primary' }
322
- },
323
- {
324
- variant: 'tonal',
325
- color: 'secondary',
326
- class: { base: 'md-component-button-tonal-secondary' }
327
- },
328
- {
329
- variant: 'tonal',
330
- color: 'tertiary',
331
- class: { base: 'md-component-button-tonal-tertiary' }
332
- },
333
- {
334
- variant: 'tonal',
335
- color: 'error',
336
- class: { base: 'md-component-button-tonal-error' }
337
- },
338
- {
339
- variant: 'outlined',
340
- color: 'default',
341
- class: { base: 'md-component-button-outline-default' }
342
- },
343
- {
344
- variant: 'outlined',
345
- color: 'primary',
346
- class: { base: 'md-component-button-outline-primary' }
347
- },
348
- {
349
- variant: 'outlined',
350
- color: 'secondary',
351
- class: { base: 'md-component-button-outline-secondary' }
352
- },
353
- {
354
- variant: 'outlined',
355
- color: 'tertiary',
356
- class: { base: 'md-component-button-outline-tertiary' }
357
- },
358
- {
359
- variant: 'outlined',
360
- color: 'error',
361
- class: { base: 'md-component-button-outline-error' }
362
- },
363
- {
364
- variant: 'text',
365
- color: 'default',
366
- class: { base: 'md-component-button-text-default' }
367
- },
368
- {
369
- variant: 'text',
370
- color: 'primary',
371
- class: { base: 'md-component-button-text-primary' }
372
- },
373
- {
374
- variant: 'text',
375
- color: 'secondary',
376
- class: { base: 'md-component-button-text-secondary' }
377
- },
378
- {
379
- variant: 'text',
380
- color: 'tertiary',
381
- class: { base: 'md-component-button-text-tertiary' }
382
- },
383
- {
384
- variant: 'text',
385
- color: 'error',
386
- class: { base: 'md-component-button-text-error' }
387
- },
388
- {
389
- variant: 'elevated',
390
- color: 'default',
391
- class: { base: 'md-component-button-elevated-default' }
392
- },
393
- {
394
- variant: 'elevated',
395
- color: 'primary',
396
- class: { base: 'md-component-button-elevated-primary' }
397
- },
398
- {
399
- variant: 'elevated',
400
- color: 'secondary',
401
- class: { base: 'md-component-button-elevated-secondary' }
402
- },
403
- {
404
- variant: 'elevated',
405
- color: 'tertiary',
406
- class: { base: 'md-component-button-elevated-tertiary' }
407
- },
408
- {
409
- variant: 'elevated',
410
- color: 'error',
411
- class: { base: 'md-component-button-elevated-error' }
412
- }
413
- ]
196
+ { size: 'xs', width: 'narrow', class: { base: 'w-7' } },
197
+ { size: 'xs', width: 'default', class: { base: 'w-spacing-400' } },
198
+ { size: 'xs', width: 'wide', class: { base: 'w-spacing-500' } },
199
+ { size: 'sm', width: 'narrow', class: { base: 'w-spacing-400' } },
200
+ { size: 'sm', width: 'default', class: { base: 'w-spacing-500' } },
201
+ { size: 'sm', width: 'wide', class: { base: 'w-13' } },
202
+ { size: 'md', width: 'narrow', class: { base: 'w-spacing-600' } },
203
+ { size: 'md', width: 'default', class: { base: 'w-spacing-700' } },
204
+ { size: 'md', width: 'wide', class: { base: 'w-spacing-900' } },
205
+ { size: 'lg', width: 'narrow', class: { base: 'w-spacing-800' } },
206
+ { size: 'lg', width: 'default', class: { base: 'w-24' } },
207
+ { size: 'lg', width: 'wide', class: { base: 'w-32' } },
208
+ { size: 'xl', width: 'narrow', class: { base: 'w-26' } },
209
+ { size: 'xl', width: 'default', class: { base: 'w-34' } },
210
+ { size: 'xl', width: 'wide', class: { base: 'w-46' } },
211
+ { selected: true, shape: 'round', class: { base: '[--btn-shape:var(--btn-square)]' } },
212
+ { selected: true, shape: 'square', class: { base: '[--btn-shape:var(--btn-round)]' } }
213
+ ],
214
+ defaultVariants: {
215
+ variant: 'filled',
216
+ size: 'sm',
217
+ width: 'default',
218
+ shape: 'round'
219
+ }
414
220
  });
221
+ /** The FAB menu's colour set follows the FAB's colour family. */
222
+ export const fabMenuSet = (color) => color.startsWith('secondary')
223
+ ? 'secondary'
224
+ : color.startsWith('tertiary')
225
+ ? 'tertiary'
226
+ : 'primary';
227
+ /*
228
+ * FAB and extended FAB. Collapsed, the padding centres the icon in the square FAB
229
+ * ((size - icon) / 2); extended, it is the extended FAB's leading/trailing space and the label
230
+ * opens beside the icon.
231
+ */
415
232
  export const fab = tv({
416
233
  slots: {
417
- base: 'md-component-button-base relative z-50',
418
- icon: '',
419
- label: ''
234
+ base: 'md-btn md-sys-state-focus-indicator relative inline-flex shrink-0 cursor-pointer items-center justify-start whitespace-nowrap select-none shadow-elevation-3 not-disabled:hover:shadow-elevation-4 disabled:cursor-not-allowed disabled:bg-md-sys-color-on-surface/10 disabled:text-md-sys-color-on-surface/38 disabled:shadow-none',
235
+ icon: 'shrink-0',
236
+ labelTrack: 'grid',
237
+ labelClip: 'min-w-spacing-0 overflow-hidden',
238
+ label: 'block'
420
239
  },
421
240
  variants: {
422
- config: {
423
- primary: {
424
- base: 'md-component-button-filled-primary shadow-elevation-1 hover:shadow-elevation-2',
425
- icon: 'text-md-sys-color-on-primary',
426
- label: 'text-md-sys-color-on-primary'
241
+ color: {
242
+ 'primary-container': {
243
+ base: 'bg-md-sys-color-primary-container text-md-sys-color-on-primary-container'
427
244
  },
428
- secondary: {
429
- base: 'md-component-button-filled-secondary shadow-elevation-1 hover:shadow-elevation-2',
430
- icon: 'text-md-sys-color-on-secondary',
431
- label: 'text-md-sys-color-on-secondary'
245
+ 'secondary-container': {
246
+ base: 'bg-md-sys-color-secondary-container text-md-sys-color-on-secondary-container'
432
247
  },
433
- tertiary: {
434
- base: 'md-component-button-filled-tertiary shadow-elevation-1 hover:shadow-elevation-2',
435
- icon: 'text-md-sys-color-on-tertiary',
436
- label: 'text-md-sys-color-on-tertiary'
437
- }
438
- },
439
- expanded: {
440
- true: 'gap-3 px-4',
441
- false: 'aspect-square'
248
+ 'tertiary-container': {
249
+ base: 'bg-md-sys-color-tertiary-container text-md-sys-color-on-tertiary-container'
250
+ },
251
+ primary: { base: 'bg-md-sys-color-primary text-md-sys-color-on-primary' },
252
+ secondary: { base: 'bg-md-sys-color-secondary text-md-sys-color-on-secondary' },
253
+ tertiary: { base: 'bg-md-sys-color-tertiary text-md-sys-color-on-tertiary' }
442
254
  },
443
255
  size: {
256
+ /** Baseline small FAB. No longer recommended by M3; kept for dense layouts. */
444
257
  small: {
445
- base: 'h-10 rounded-xl before:rounded-xl',
446
- icon: 'size-6 text-[24px]',
447
- label: 'md-sys-typescale-label-large'
258
+ base: 'h-spacing-500 rounded-xl px-spacing-100',
259
+ icon: 'size-spacing-300 text-[24px]'
448
260
  },
449
261
  regular: {
450
- base: 'h-14 rounded-2xl before:rounded-2xl',
451
- icon: 'size-6 text-[24px]',
452
- label: 'md-sys-typescale-fab-label'
262
+ base: 'md-sys-typescale-title-medium h-spacing-700 rounded-2xl px-spacing-200',
263
+ icon: 'size-spacing-300 text-[24px]',
264
+ label: 'ps-spacing-100'
265
+ },
266
+ medium: {
267
+ base: 'md-sys-typescale-title-large h-20 rounded-[1.25rem] px-[1.625rem]',
268
+ icon: 'size-7 text-[28px]',
269
+ label: 'ps-spacing-150'
453
270
  },
454
271
  large: {
455
- base: 'h-24 rounded-[28px] before:rounded-[28px]',
456
- icon: 'size-9 text-[36px]',
457
- label: 'md-sys-typescale-headline-small'
272
+ base: 'md-sys-typescale-headline-small h-24 rounded-[1.75rem] px-[1.875rem]',
273
+ icon: 'size-spacing-450 text-[36px]',
274
+ label: 'ps-spacing-200'
458
275
  }
276
+ },
277
+ /**
278
+ * The FAB menu's open state: the FAB becomes the round close button, label shut. Its size and
279
+ * corners spring to 56dp round in FAB.svelte.
280
+ */
281
+ menuOpen: {
282
+ true: {
283
+ base: 'justify-center px-spacing-0',
284
+ icon: 'size-spacing-250 text-[20px]',
285
+ labelTrack: 'grid-cols-[0fr]!'
286
+ },
287
+ false: {}
288
+ },
289
+ menuSet: {
290
+ primary: {},
291
+ secondary: {},
292
+ tertiary: {}
293
+ }
294
+ },
295
+ compoundVariants: [
296
+ {
297
+ menuOpen: true,
298
+ menuSet: 'primary',
299
+ class: { base: 'bg-md-sys-color-primary text-md-sys-color-on-primary' }
300
+ },
301
+ {
302
+ menuOpen: true,
303
+ menuSet: 'secondary',
304
+ class: { base: 'bg-md-sys-color-secondary text-md-sys-color-on-secondary' }
305
+ },
306
+ {
307
+ menuOpen: true,
308
+ menuSet: 'tertiary',
309
+ class: { base: 'bg-md-sys-color-tertiary text-md-sys-color-on-tertiary' }
459
310
  }
311
+ ],
312
+ defaultVariants: {
313
+ color: 'primary-container',
314
+ size: 'regular',
315
+ menuOpen: false,
316
+ menuSet: 'primary'
317
+ }
318
+ });
319
+ // 5px padding leaves room for the items' focus ring inside the scroll box; the negative end
320
+ // margin puts the items back on the close button's trailing edge, and 3px offset + 5px padding
321
+ // is the spec's 8dp above it.
322
+ /*
323
+ * `expanded` is responsive (FAB on compact windows, extended FAB with room to spare), so it
324
+ * resolves to per-tier classes rather than a tv variant: the label track opens, and the large
325
+ * FAB's padding moves from centring its icon (30dp) to the extended FAB's 28dp. These classes
326
+ * decide the layout (and the first paint); FAB.svelte springs the change between them.
327
+ */
328
+ export const fabExpandedClasses = {
329
+ small: {
330
+ true: { track: 'grid-cols-[1fr]', large: 'px-7' },
331
+ false: { track: 'grid-cols-[0fr]', large: 'px-[1.875rem]' }
332
+ },
333
+ medium: {
334
+ true: { track: 'md:grid-cols-[1fr]', large: 'md:px-7' },
335
+ false: { track: 'md:grid-cols-[0fr]', large: 'md:px-[1.875rem]' }
336
+ },
337
+ large: {
338
+ true: { track: 'lg:grid-cols-[1fr]', large: 'lg:px-7' },
339
+ false: { track: 'lg:grid-cols-[0fr]', large: 'lg:px-[1.875rem]' }
340
+ },
341
+ extraLarge: {
342
+ true: { track: 'xl:grid-cols-[1fr]', large: 'xl:px-7' },
343
+ false: { track: 'xl:grid-cols-[0fr]', large: 'xl:px-[1.875rem]' }
344
+ }
345
+ };
346
+ /**
347
+ * The surface a FAB opens into with a container transform, anchored at the FAB's corner. It is
348
+ * `surface`, the colour lists and most content paint, so padding doesn't show as bands. The
349
+ * shadow is a filter on the wrapper, because the surface's shape is a clip-path while it morphs.
350
+ */
351
+ export const fabSurface = tv({
352
+ slots: {
353
+ anchor: 'relative inline-grid',
354
+ wrapper: 'drop-shadow-elevation-3 absolute end-spacing-0 bottom-spacing-0 z-50',
355
+ surface: 'bg-md-sys-color-surface text-md-sys-color-on-surface max-h-[min(36rem,calc(100dvh-2rem))] w-max max-w-[calc(100vw-2rem)] min-w-60 overflow-y-auto rounded-3xl py-spacing-100 outline-none'
460
356
  }
461
357
  });
462
358
  export const fabMenu = tv({
463
359
  slots: {
464
- base: 'gap-2 pb-2 flex flex-col z-[9999] overflow-visible p-1'
360
+ base: '-me-[5px] flex flex-col items-end gap-spacing-50 overflow-y-auto p-[5px]'
465
361
  }
466
362
  });
363
+ /** FAB menu items share the medium button's measurements, fully round, without elevation. */
467
364
  export const fabMenuItem = tv({
468
365
  slots: {
469
- base: 'md-component-button-base group relative w-full h-14 rounded-full before:rounded-full gap-2 px-6 md-sys-typescale-fab-label z-[100] shadow-elevation-2 hover:shadow-elevation-3',
470
- icon: 'size-6 text-[24px]'
366
+ base: 'md-btn md-sys-state-focus-indicator md-sys-typescale-title-medium relative inline-flex h-spacing-700 shrink-0 cursor-pointer items-center gap-spacing-100 rounded-full px-spacing-300 whitespace-nowrap select-none data-disabled:cursor-not-allowed data-disabled:bg-md-sys-color-on-surface/10 data-disabled:text-md-sys-color-on-surface/38',
367
+ icon: 'size-spacing-300 shrink-0 text-[24px]'
471
368
  },
472
369
  variants: {
473
- variant: {
474
- primary: 'md-component-button-filled-primary',
475
- secondary: 'md-component-button-tonal-secondary',
476
- tertiary: 'md-component-button-outline-tertiary'
370
+ set: {
371
+ primary: {
372
+ base: 'bg-md-sys-color-primary-container text-md-sys-color-on-primary-container'
373
+ },
374
+ secondary: {
375
+ base: 'bg-md-sys-color-secondary-container text-md-sys-color-on-secondary-container'
376
+ },
377
+ tertiary: {
378
+ base: 'bg-md-sys-color-tertiary-container text-md-sys-color-on-tertiary-container'
379
+ }
477
380
  }
381
+ },
382
+ defaultVariants: {
383
+ set: 'primary'
478
384
  }
479
385
  });