@noxlovette/material 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/material-claude-skill.js +31 -0
- package/claude-skill/material-design/SKILL.md +68 -0
- package/claude-skill/material-design/references/accessibility-checklist.md +29 -0
- package/claude-skill/material-design/references/component-patterns.md +55 -0
- package/claude-skill/material-design/references/motion-guide.md +163 -0
- package/claude-skill/material-design/references/tokens-and-styles.md +68 -0
- package/dist/animation/Shapes.stories.svelte +10 -6
- package/dist/animation/TransitionPatterns.stories.svelte +30 -20
- package/dist/animation/containerTransform.d.ts +4 -2
- package/dist/animation/containerTransform.js +4 -2
- package/dist/animation/enterExit.js +5 -2
- package/dist/animation/skeleton.d.ts +1 -1
- package/dist/animation/skeleton.js +1 -1
- package/dist/components/badge/Badge.mdx +70 -0
- package/dist/components/badge/Badge.stories.svelte +38 -20
- package/dist/components/badge/Badge.svelte +12 -5
- package/dist/components/badge/theme.d.ts +30 -7
- package/dist/components/badge/theme.js +25 -5
- package/dist/components/badge/types.d.ts +18 -4
- package/dist/components/buttons/Button.mdx +85 -0
- package/dist/components/buttons/Button.stories.svelte +62 -27
- package/dist/components/buttons/Button.svelte +29 -25
- package/dist/components/buttons/Button.svelte.d.ts +11 -9
- package/dist/components/buttons/ButtonIcon.mdx +52 -0
- package/dist/components/buttons/ButtonIcon.stories.svelte +72 -48
- package/dist/components/buttons/ButtonIcon.svelte +58 -36
- package/dist/components/buttons/ButtonIcon.svelte.d.ts +9 -7
- package/dist/components/buttons/FAB.mdx +84 -0
- package/dist/components/buttons/FAB.stories.svelte +103 -24
- package/dist/components/buttons/FAB.stories.svelte.d.ts +2 -17
- package/dist/components/buttons/FAB.svelte +353 -29
- package/dist/components/buttons/FAB.svelte.d.ts +11 -6
- package/dist/components/buttons/FABMenu.svelte +27 -8
- package/dist/components/buttons/FABMenu.svelte.d.ts +7 -3
- package/dist/components/buttons/FABMenuItem.svelte +20 -16
- package/dist/components/buttons/FABMenuItem.svelte.d.ts +3 -3
- package/dist/components/buttons/Toggle.stories.svelte +31 -23
- package/dist/components/buttons/Toggle.stories.svelte.d.ts +2 -17
- package/dist/components/buttons/Toggle.svelte +28 -25
- package/dist/components/buttons/Toggle.svelte.d.ts +5 -5
- package/dist/components/buttons/button-group/ButtonGroup.mdx +39 -0
- package/dist/components/buttons/button-group/ButtonGroup.stories.svelte +62 -43
- package/dist/components/buttons/button-group/ButtonGroup.stories.svelte.d.ts +2 -17
- package/dist/components/buttons/button-group/ButtonGroup.svelte +102 -8
- package/dist/components/buttons/button-group/ButtonGroup.svelte.d.ts +6 -7
- package/dist/components/buttons/button-group/theme.d.ts +46 -16
- package/dist/components/buttons/button-group/theme.js +14 -9
- package/dist/components/buttons/button-group/types.d.ts +13 -7
- package/dist/components/buttons/connected/ConnectedButtonGroup.mdx +43 -0
- package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte +56 -74
- package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte.d.ts +2 -17
- package/dist/components/buttons/connected/ConnectedButtonGroup.svelte +16 -4
- package/dist/components/buttons/connected/ConnectedButtonGroup.svelte.d.ts +4 -4
- package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte +35 -8
- package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte.d.ts +2 -3
- package/dist/components/buttons/connected/theme.d.ts +34 -19
- package/dist/components/buttons/connected/theme.js +33 -10
- package/dist/components/buttons/connected/types.d.ts +36 -9
- package/dist/components/buttons/shapeMorph.d.ts +26 -0
- package/dist/components/buttons/shapeMorph.js +142 -0
- package/dist/components/buttons/split-button/SplitButton.mdx +48 -0
- package/dist/components/buttons/split-button/SplitButton.stories.svelte +9 -14
- package/dist/components/buttons/split-button/SplitButton.svelte +66 -49
- package/dist/components/buttons/split-button/SplitButton.svelte.d.ts +6 -11
- package/dist/components/buttons/split-button/theme.d.ts +111 -18
- package/dist/components/buttons/split-button/theme.js +75 -17
- package/dist/components/buttons/split-button/types.d.ts +24 -18
- package/dist/components/buttons/theme.d.ts +423 -231
- package/dist/components/buttons/theme.js +287 -381
- package/dist/components/buttons/types.d.ts +130 -125
- package/dist/components/cards/Card.mdx +44 -0
- package/dist/components/cards/Card.stories.svelte +11 -11
- package/dist/components/cards/theme.js +6 -6
- package/dist/components/chips/Chip.mdx +68 -0
- package/dist/components/chips/Chip.stories.svelte +4 -4
- package/dist/components/chips/theme.d.ts +1 -1
- package/dist/components/chips/theme.js +4 -4
- package/dist/components/containers/action-rail/ActionRail.stories.svelte +1 -0
- package/dist/components/containers/action-rail/theme.d.ts +1 -1
- package/dist/components/containers/action-rail/theme.js +2 -2
- package/dist/components/containers/app/theme.d.ts +1 -1
- package/dist/components/containers/app/theme.js +1 -1
- package/dist/components/containers/bottom-sheet/BottomSheet.mdx +64 -0
- package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte +108 -12
- package/dist/components/containers/bottom-sheet/BottomSheet.svelte +179 -109
- package/dist/components/containers/bottom-sheet/BottomSheet.svelte.d.ts +10 -5
- package/dist/components/containers/bottom-sheet/index.d.ts +1 -0
- package/dist/components/containers/bottom-sheet/index.js +1 -0
- package/dist/components/containers/bottom-sheet/theme.d.ts +45 -0
- package/dist/components/containers/bottom-sheet/theme.js +42 -0
- package/dist/components/containers/bottom-sheet/types.d.ts +37 -5
- package/dist/components/containers/carousel/Carousel.mdx +80 -0
- package/dist/components/containers/carousel/Carousel.stories.svelte +131 -0
- package/dist/components/containers/carousel/Carousel.stories.svelte.d.ts +4 -0
- package/dist/components/containers/carousel/Carousel.svelte +194 -0
- package/dist/components/containers/carousel/Carousel.svelte.d.ts +25 -0
- package/dist/components/containers/carousel/index.d.ts +3 -0
- package/dist/components/containers/{stack → carousel}/index.js +1 -2
- package/dist/components/containers/carousel/keylines.d.ts +32 -0
- package/dist/components/containers/carousel/keylines.js +88 -0
- package/dist/components/containers/carousel/theme.d.ts +162 -0
- package/dist/components/containers/carousel/theme.js +67 -0
- package/dist/components/containers/carousel/types.d.ts +52 -0
- package/dist/components/containers/context-menu/ContextMenu.stories.svelte +1 -0
- package/dist/components/containers/context-menu/ContextMenu.svelte +2 -2
- package/dist/components/containers/context-menu/ContextMenu.svelte.d.ts +1 -1
- package/dist/components/containers/context-menu/theme.d.ts +1 -1
- package/dist/components/containers/context-menu/theme.js +11 -11
- package/dist/components/containers/dialogue/Dialogue.mdx +65 -0
- package/dist/components/containers/dialogue/Dialogue.stories.svelte +4 -4
- package/dist/components/containers/dialogue/Dialogue.svelte +2 -2
- package/dist/components/containers/dialogue/theme.d.ts +1 -1
- package/dist/components/containers/dialogue/theme.js +4 -4
- package/dist/components/containers/dialogue/types.d.ts +1 -1
- package/dist/components/containers/divider/Divider.stories.svelte +2 -1
- package/dist/components/containers/divider/Divider.svelte +2 -2
- package/dist/components/containers/divider/theme.d.ts +7 -7
- package/dist/components/containers/divider/theme.js +3 -3
- package/dist/components/containers/index.d.ts +1 -1
- package/dist/components/containers/index.js +1 -1
- package/dist/components/containers/link-preview/theme.d.ts +1 -1
- package/dist/components/containers/link-preview/theme.js +3 -3
- package/dist/components/containers/list/List.svelte +18 -0
- package/dist/components/containers/list/List.svelte.d.ts +4 -0
- package/dist/components/containers/list/ListItem.mdx +100 -0
- package/dist/components/containers/list/ListItem.stories.svelte +177 -42
- package/dist/components/containers/list/ListItem.stories.svelte.d.ts +2 -17
- package/dist/components/containers/list/ListItem.svelte +92 -37
- package/dist/components/containers/list/ListItem.svelte.d.ts +1 -1
- package/dist/components/containers/list/context.d.ts +6 -0
- package/dist/components/containers/list/context.js +4 -0
- package/dist/components/containers/list/index.d.ts +1 -0
- package/dist/components/containers/list/index.js +1 -0
- package/dist/components/containers/list/theme.d.ts +487 -12
- package/dist/components/containers/list/theme.js +141 -14
- package/dist/components/containers/list/types.d.ts +39 -5
- package/dist/components/containers/menu/Menu.mdx +52 -0
- package/dist/components/containers/menu/Menu.stories.svelte +14 -14
- package/dist/components/containers/menu/Menu.svelte +2 -2
- package/dist/components/containers/menu/MenuGroup.svelte +1 -1
- package/dist/components/containers/menu/MenuGroup.svelte.d.ts +1 -1
- package/dist/components/containers/menu/MenuSub.svelte +1 -1
- package/dist/components/containers/menu/menu-item/MenuItem.svelte +1 -1
- package/dist/components/containers/menu/theme.d.ts +1 -1
- package/dist/components/containers/menu/theme.js +9 -9
- package/dist/components/containers/pane/DraggablePane.stories.svelte +4 -3
- package/dist/components/containers/pane/DraggablePane.svelte +2 -2
- package/dist/components/containers/pane/Pane.stories.svelte +11 -10
- package/dist/components/containers/pane/Pane.svelte +24 -2
- package/dist/components/containers/pane/PaneGrid.stories.svelte +19 -18
- package/dist/components/containers/pane/PaneGrid.svelte +3 -2
- package/dist/components/containers/pane/PaneGrid.svelte.d.ts +2 -1
- package/dist/components/containers/pane/PaneHandle.svelte +48 -2
- package/dist/components/containers/pane/PaneHandle.svelte.d.ts +4 -0
- package/dist/components/containers/pane/resizeStore.svelte.d.ts +10 -1
- package/dist/components/containers/pane/resizeStore.svelte.js +13 -2
- package/dist/components/containers/pane/theme.d.ts +1 -1
- package/dist/components/containers/pane/theme.js +131 -47
- package/dist/components/containers/pane/types.d.ts +3 -2
- package/dist/components/containers/popover/Popover.mdx +45 -0
- package/dist/components/containers/popover/Popover.stories.svelte +1 -1
- package/dist/components/containers/popover/Popover.svelte +1 -1
- package/dist/components/containers/popover/theme.d.ts +1 -1
- package/dist/components/containers/popover/theme.js +4 -4
- package/dist/components/containers/scroll-area/theme.js +3 -3
- package/dist/components/containers/side-sheet/SideSheet.mdx +71 -0
- package/dist/components/containers/side-sheet/SideSheet.stories.svelte +113 -17
- package/dist/components/containers/side-sheet/SideSheet.svelte +113 -66
- package/dist/components/containers/side-sheet/SideSheet.svelte.d.ts +8 -7
- package/dist/components/containers/side-sheet/index.d.ts +1 -0
- package/dist/components/containers/side-sheet/index.js +1 -0
- package/dist/components/containers/side-sheet/theme.d.ts +108 -0
- package/dist/components/containers/side-sheet/theme.js +72 -0
- package/dist/components/containers/side-sheet/types.d.ts +35 -7
- package/dist/components/date/DateField.stories.svelte +4 -3
- package/dist/components/date/DateField.svelte +11 -2
- package/dist/components/date/DateRangeField.stories.svelte +4 -3
- package/dist/components/date/DateRangeField.svelte +12 -3
- package/dist/components/date/theme.d.ts +8 -8
- package/dist/components/date/theme.js +32 -32
- package/dist/components/forms/checkbox/Checkbox.mdx +35 -0
- package/dist/components/forms/checkbox/Checkbox.stories.svelte +2 -2
- package/dist/components/forms/checkbox/Checkbox.svelte +1 -1
- package/dist/components/forms/checkbox/theme.d.ts +1 -1
- package/dist/components/forms/checkbox/theme.js +4 -4
- package/dist/components/forms/command/Command.stories.svelte +1 -0
- package/dist/components/forms/command/theme.d.ts +1 -1
- package/dist/components/forms/command/theme.js +10 -10
- package/dist/components/forms/pin/theme.d.ts +1 -1
- package/dist/components/forms/pin/theme.js +5 -5
- package/dist/components/forms/radio-group/RadioGroup.svelte +1 -1
- package/dist/components/forms/radio-group/theme.d.ts +1 -1
- package/dist/components/forms/radio-group/theme.js +6 -6
- package/dist/components/forms/search/Search.mdx +38 -0
- package/dist/components/forms/search/Search.stories.svelte +19 -9
- package/dist/components/forms/search/Search.svelte +40 -17
- package/dist/components/forms/search/Search.svelte.d.ts +2 -2
- package/dist/components/forms/search/theme.d.ts +46 -13
- package/dist/components/forms/search/theme.js +14 -9
- package/dist/components/forms/search/types.d.ts +18 -12
- package/dist/components/forms/select/Select.mdx +53 -0
- package/dist/components/forms/select/Select.stories.svelte +4 -4
- package/dist/components/forms/select/Select.svelte +12 -4
- package/dist/components/forms/select/SelectItem.svelte +1 -1
- package/dist/components/forms/select/theme.d.ts +1 -1
- package/dist/components/forms/select/theme.js +14 -14
- package/dist/components/forms/slider/Slider.mdx +85 -0
- package/dist/components/forms/slider/Slider.stories.svelte +7 -7
- package/dist/components/forms/slider/Slider.svelte +46 -28
- package/dist/components/forms/slider/theme.d.ts +15 -1
- package/dist/components/forms/slider/theme.js +29 -18
- package/dist/components/forms/slider/types.d.ts +3 -2
- package/dist/components/forms/switch/Switch.mdx +38 -0
- package/dist/components/forms/switch/Switch.stories.svelte +3 -3
- package/dist/components/forms/switch/theme.d.ts +1 -1
- package/dist/components/forms/switch/theme.js +7 -7
- package/dist/components/forms/textfield/Textfield.mdx +53 -0
- package/dist/components/forms/textfield/Textfield.stories.svelte +6 -6
- package/dist/components/forms/textfield/Textfield.svelte +1 -0
- package/dist/components/forms/textfield/theme.d.ts +1 -1
- package/dist/components/forms/textfield/theme.js +20 -20
- package/dist/components/forms/toggle-group/theme.d.ts +1 -1
- package/dist/components/forms/toggle-group/theme.js +3 -3
- package/dist/components/forms/tooltip/Tooltip.stories.svelte +1 -0
- package/dist/components/forms/tooltip/theme.d.ts +1 -1
- package/dist/components/forms/tooltip/theme.js +4 -4
- package/dist/components/misc/Avatar.stories.svelte +5 -4
- package/dist/components/misc/ThemeSettings.svelte +9 -9
- package/dist/components/misc/ThemeSwitcher.svelte +3 -3
- package/dist/components/misc/theme.js +5 -5
- package/dist/components/nav/appbar/AppBar.mdx +71 -0
- package/dist/components/nav/appbar/AppBar.stories.svelte +93 -3
- package/dist/components/nav/appbar/AppBar.stories.svelte.d.ts +2 -17
- package/dist/components/nav/appbar/AppBar.svelte +90 -37
- package/dist/components/nav/appbar/AppBar.svelte.d.ts +9 -2
- package/dist/components/nav/appbar/theme.d.ts +86 -19
- package/dist/components/nav/appbar/theme.js +160 -24
- package/dist/components/nav/appbar/types.d.ts +46 -9
- package/dist/components/nav/breadcrumb/Breadcrumb.stories.svelte +1 -0
- package/dist/components/nav/breadcrumb/theme.d.ts +1 -1
- package/dist/components/nav/breadcrumb/theme.js +6 -6
- package/dist/components/nav/navbar/Navbar.mdx +38 -0
- package/dist/components/nav/navbar/Navbar.svelte +1 -1
- package/dist/components/nav/navbar/NavbarItem.svelte +12 -9
- package/dist/components/nav/navbar/theme.d.ts +3 -3
- package/dist/components/nav/navbar/theme.js +7 -7
- package/dist/components/nav/rail/Rail.mdx +73 -0
- package/dist/components/nav/rail/Rail.stories.svelte +3 -7
- package/dist/components/nav/rail/Rail.svelte +5 -2
- package/dist/components/nav/rail/RailItem.svelte +12 -9
- package/dist/components/nav/rail/theme.d.ts +1 -1
- package/dist/components/nav/rail/theme.js +14 -14
- package/dist/components/nav/rail/types.d.ts +8 -1
- package/dist/components/nav/tabs/Tabs.mdx +62 -0
- package/dist/components/nav/tabs/Tabs.stories.svelte +1 -1
- package/dist/components/nav/tabs/theme.d.ts +1 -1
- package/dist/components/nav/tabs/theme.js +5 -5
- package/dist/components/pill/Pill.mdx +32 -0
- package/dist/components/pill/Pill.stories.svelte +1 -1
- package/dist/components/pill/theme.d.ts +2 -2
- package/dist/components/pill/theme.js +2 -2
- package/dist/components/progress/LinearProgress.svelte +2 -2
- package/dist/components/progress/Progress.mdx +50 -0
- package/dist/components/progress/Progress.stories.svelte +6 -6
- package/dist/components/snackbar/Snackbar.mdx +52 -0
- package/dist/components/snackbar/Snackbar.stories.svelte +5 -5
- package/dist/components/snackbar/Snackbar.svelte +1 -1
- package/dist/components/snackbar/theme.d.ts +4 -4
- package/dist/components/snackbar/theme.js +5 -5
- package/dist/components/table/Table.stories.svelte +1 -0
- package/dist/components/table/TableHeader.svelte +1 -1
- package/dist/components/table/theme.d.ts +1 -1
- package/dist/components/table/theme.js +4 -4
- package/dist/components/time/TimeField.stories.svelte +3 -2
- package/dist/components/time/TimeField.svelte +2 -2
- package/dist/components/time/TimepickerInput.svelte +1 -1
- package/dist/components/time/theme.d.ts +1 -1
- package/dist/components/time/theme.js +6 -6
- package/dist/components/toolbar/Toolbar.stories.svelte +1 -0
- package/dist/components/toolbar/Toolbar.svelte +1 -1
- package/dist/components/toolbar/Toolbar.svelte.d.ts +1 -1
- package/dist/components/toolbar/theme.d.ts +1 -1
- package/dist/components/toolbar/theme.js +15 -15
- package/dist/components/typography/Typography.mdx +67 -0
- package/dist/components/typography/body/Body.stories.svelte +2 -1
- package/dist/components/typography/body/theme.d.ts +16 -13
- package/dist/components/typography/body/theme.js +20 -5
- package/dist/components/typography/body/types.d.ts +2 -1
- package/dist/components/typography/display/Display.stories.svelte +2 -1
- package/dist/components/typography/display/theme.d.ts +16 -13
- package/dist/components/typography/display/theme.js +20 -5
- package/dist/components/typography/display/types.d.ts +2 -1
- package/dist/components/typography/headline/Headline.stories.svelte +2 -1
- package/dist/components/typography/headline/theme.d.ts +16 -13
- package/dist/components/typography/headline/theme.js +20 -5
- package/dist/components/typography/headline/types.d.ts +2 -1
- package/dist/components/typography/kbd/Kbd.stories.svelte +2 -1
- package/dist/components/typography/kbd/theme.d.ts +5 -5
- package/dist/components/typography/kbd/theme.js +3 -3
- package/dist/components/typography/label/Label.stories.svelte +2 -1
- package/dist/components/typography/label/theme.d.ts +15 -12
- package/dist/components/typography/label/theme.js +20 -5
- package/dist/components/typography/label/types.d.ts +2 -1
- package/dist/components/typography/title/Title.stories.svelte +2 -1
- package/dist/components/typography/title/theme.d.ts +16 -13
- package/dist/components/typography/title/theme.js +20 -5
- package/dist/components/typography/title/types.d.ts +2 -1
- package/dist/index.css +2 -0
- package/dist/styles/component.css +78 -175
- package/dist/styles/elevation.css +9 -0
- package/dist/styles/layers.css +33 -0
- package/dist/styles/spacing.css +29 -0
- package/dist/styles/typescale.css +635 -20
- package/dist/utils/Layer.svelte +1 -1
- package/dist/utils/icon/Icon.svelte +8 -6
- package/dist/utils/icon/theme.d.ts +1 -1
- package/dist/utils/icon/theme.js +1 -1
- package/dist/utils/tv.d.ts +6 -0
- package/dist/utils/tv.js +12 -0
- package/package.json +19 -15
- package/dist/components/containers/stack/HStack.svelte +0 -23
- package/dist/components/containers/stack/HStack.svelte.d.ts +0 -5
- package/dist/components/containers/stack/VStack.svelte +0 -23
- package/dist/components/containers/stack/VStack.svelte.d.ts +0 -5
- package/dist/components/containers/stack/index.d.ts +0 -4
- package/dist/components/containers/stack/theme.d.ts +0 -66
- package/dist/components/containers/stack/theme.js +0 -26
- package/dist/components/containers/stack/types.d.ts +0 -12
- /package/dist/components/containers/{stack → carousel}/types.js +0 -0
|
@@ -1,479 +1,385 @@
|
|
|
1
|
-
import { tv } from '
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
icon: 'inline-flex items-center justify-center leading-none'
|
|
6
|
-
},
|
|
1
|
+
import { tv } from '../../utils/tv.js';
|
|
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
|
-
|
|
12
|
+
standard: ''
|
|
15
13
|
},
|
|
16
|
-
|
|
14
|
+
/** `default` for plain buttons; `unselected`/`selected` for toggles. */
|
|
15
|
+
state: {
|
|
17
16
|
default: '',
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
61
|
-
|
|
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: '
|
|
91
|
-
|
|
92
|
-
class:
|
|
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
|
-
|
|
97
|
-
class:
|
|
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
|
-
|
|
102
|
-
class:
|
|
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
|
-
|
|
122
|
-
class:
|
|
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
|
-
|
|
127
|
-
class:
|
|
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
|
-
|
|
137
|
-
class:
|
|
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
|
-
|
|
142
|
-
class:
|
|
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: '
|
|
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: '
|
|
161
|
-
|
|
162
|
-
class:
|
|
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: '
|
|
166
|
-
|
|
167
|
-
class:
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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-
|
|
209
|
-
icon: '
|
|
148
|
+
base: ['md-btn-shape', buttonBase],
|
|
149
|
+
icon: 'shrink-0'
|
|
210
150
|
},
|
|
211
151
|
variants: {
|
|
212
152
|
variant: {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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-
|
|
230
|
-
icon: 'text-[20px]
|
|
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-
|
|
234
|
-
icon: 'size-
|
|
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-
|
|
238
|
-
icon: 'size-
|
|
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
|
|
242
|
-
icon: 'size-
|
|
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
|
|
246
|
-
icon: 'text-[40px]
|
|
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
|
-
|
|
252
|
-
|
|
182
|
+
narrow: {},
|
|
183
|
+
default: {},
|
|
184
|
+
wide: {}
|
|
253
185
|
},
|
|
254
186
|
shape: {
|
|
255
|
-
round: '',
|
|
256
|
-
square: '[--btn-shape-
|
|
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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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-
|
|
418
|
-
icon: '',
|
|
419
|
-
|
|
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
|
-
|
|
423
|
-
primary: {
|
|
424
|
-
base: 'md-
|
|
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-
|
|
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-
|
|
435
|
-
|
|
436
|
-
|
|
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-
|
|
446
|
-
icon: 'size-
|
|
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-
|
|
451
|
-
icon: 'size-
|
|
452
|
-
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-[
|
|
456
|
-
icon: 'size-
|
|
457
|
-
label: '
|
|
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-layer-modal',
|
|
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: '
|
|
360
|
+
base: 'z-layer-popup -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-
|
|
470
|
-
icon: 'size-
|
|
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
|
-
|
|
474
|
-
primary:
|
|
475
|
-
|
|
476
|
-
|
|
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
|
});
|