@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.
- 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 +24 -4
- 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 +45 -15
- package/dist/components/buttons/button-group/theme.js +13 -8
- 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 +33 -18
- package/dist/components/buttons/connected/theme.js +32 -9
- 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 +65 -48
- package/dist/components/buttons/split-button/SplitButton.svelte.d.ts +6 -11
- package/dist/components/buttons/split-button/theme.d.ts +110 -17
- package/dist/components/buttons/split-button/theme.js +74 -16
- package/dist/components/buttons/split-button/types.d.ts +24 -18
- package/dist/components/buttons/theme.d.ts +422 -230
- package/dist/components/buttons/theme.js +286 -380
- 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 +5 -5
- package/dist/components/chips/Chip.mdx +68 -0
- package/dist/components/chips/Chip.stories.svelte +4 -4
- package/dist/components/chips/theme.js +3 -3
- package/dist/components/containers/action-rail/ActionRail.stories.svelte +1 -0
- package/dist/components/containers/action-rail/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.js +10 -10
- 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 +1 -1
- package/dist/components/containers/dialogue/theme.js +3 -3
- 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 +6 -6
- package/dist/components/containers/divider/theme.js +2 -2
- package/dist/components/containers/index.d.ts +1 -1
- package/dist/components/containers/index.js +1 -1
- package/dist/components/containers/link-preview/theme.js +2 -2
- 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 +140 -13
- 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 +1 -1
- 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/menu-item/MenuItem.svelte +1 -1
- package/dist/components/containers/menu/theme.js +8 -8
- 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.js +129 -45
- 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.js +3 -3
- package/dist/components/containers/scroll-area/theme.js +2 -2
- 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 +7 -7
- package/dist/components/date/theme.js +31 -31
- 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.js +3 -3
- package/dist/components/forms/command/Command.stories.svelte +1 -0
- package/dist/components/forms/command/theme.js +9 -9
- package/dist/components/forms/pin/theme.js +4 -4
- package/dist/components/forms/radio-group/RadioGroup.svelte +1 -1
- package/dist/components/forms/radio-group/theme.js +5 -5
- 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 +45 -12
- package/dist/components/forms/search/theme.js +13 -8
- 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 +10 -2
- package/dist/components/forms/select/SelectItem.svelte +1 -1
- package/dist/components/forms/select/theme.js +12 -12
- 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 +14 -0
- package/dist/components/forms/slider/theme.js +28 -17
- 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.js +6 -6
- 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.js +19 -19
- package/dist/components/forms/toggle-group/theme.js +2 -2
- package/dist/components/forms/tooltip/Tooltip.stories.svelte +1 -0
- package/dist/components/forms/tooltip/theme.js +3 -3
- 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 +4 -4
- 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 +85 -18
- package/dist/components/nav/appbar/theme.js +159 -23
- 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.js +5 -5
- 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.js +6 -6
- 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 +1 -0
- package/dist/components/nav/rail/RailItem.svelte +12 -9
- package/dist/components/nav/rail/theme.js +13 -13
- package/dist/components/nav/rail/types.d.ts +4 -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.js +4 -4
- package/dist/components/pill/Pill.mdx +32 -0
- package/dist/components/pill/Pill.stories.svelte +1 -1
- package/dist/components/pill/theme.d.ts +1 -1
- package/dist/components/pill/theme.js +1 -1
- package/dist/components/progress/LinearProgress.svelte +1 -1
- 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 +3 -3
- package/dist/components/snackbar/theme.js +4 -4
- package/dist/components/table/Table.stories.svelte +1 -0
- package/dist/components/table/TableHeader.svelte +1 -1
- package/dist/components/table/theme.js +3 -3
- package/dist/components/time/TimeField.stories.svelte +3 -2
- package/dist/components/time/TimeField.svelte +1 -1
- package/dist/components/time/TimepickerInput.svelte +1 -1
- package/dist/components/time/theme.js +5 -5
- 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.js +14 -14
- 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 +15 -12
- package/dist/components/typography/body/theme.js +19 -4
- 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 +15 -12
- package/dist/components/typography/display/theme.js +19 -4
- 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 +15 -12
- package/dist/components/typography/headline/theme.js +19 -4
- 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 +4 -4
- package/dist/components/typography/kbd/theme.js +2 -2
- 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 +19 -4
- 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 +15 -12
- package/dist/components/typography/title/theme.js +19 -4
- package/dist/components/typography/title/types.d.ts +2 -1
- package/dist/index.css +1 -0
- package/dist/styles/component.css +78 -175
- package/dist/styles/elevation.css +9 -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/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,35 +1,128 @@
|
|
|
1
1
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
import type { ButtonMDVariants } from '../theme.js';
|
|
3
2
|
export type SplitButtonVariants = VariantProps<typeof splitButton>;
|
|
4
|
-
export declare const SPLIT_BUTTON_INNER_RADIUS: Record<NonNullable<ButtonMDVariants['size']>, string>;
|
|
5
3
|
export declare const splitButton: import("tailwind-variants").TVReturnType<{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
size: {
|
|
5
|
+
xs: {
|
|
6
|
+
leading: string[];
|
|
7
|
+
leadingIcon: "size-spacing-250 text-[20px]";
|
|
8
|
+
trailing: string[];
|
|
9
|
+
chevron: string;
|
|
10
|
+
};
|
|
11
|
+
sm: {
|
|
12
|
+
leading: string[];
|
|
13
|
+
leadingIcon: "size-spacing-250 text-[20px]";
|
|
14
|
+
trailing: string[];
|
|
15
|
+
chevron: string;
|
|
16
|
+
};
|
|
17
|
+
md: {
|
|
18
|
+
leading: string[];
|
|
19
|
+
leadingIcon: "size-spacing-300 text-[24px]";
|
|
20
|
+
trailing: string[];
|
|
21
|
+
chevron: string;
|
|
22
|
+
};
|
|
23
|
+
lg: {
|
|
24
|
+
leading: string[];
|
|
25
|
+
leadingIcon: "size-spacing-400 text-[32px]";
|
|
26
|
+
trailing: string[];
|
|
27
|
+
chevron: string;
|
|
28
|
+
};
|
|
29
|
+
xl: {
|
|
30
|
+
leading: string[];
|
|
31
|
+
leadingIcon: "size-spacing-500 text-[40px]";
|
|
32
|
+
trailing: string[];
|
|
33
|
+
chevron: string;
|
|
9
34
|
};
|
|
10
|
-
false: {};
|
|
11
35
|
};
|
|
12
36
|
}, {
|
|
13
37
|
root: string;
|
|
14
|
-
|
|
38
|
+
leading: string[];
|
|
39
|
+
leadingIcon: string;
|
|
40
|
+
trailing: string[];
|
|
41
|
+
chevron: string;
|
|
15
42
|
}, undefined, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
43
|
+
size: {
|
|
44
|
+
xs: {
|
|
45
|
+
leading: string[];
|
|
46
|
+
leadingIcon: "size-spacing-250 text-[20px]";
|
|
47
|
+
trailing: string[];
|
|
48
|
+
chevron: string;
|
|
49
|
+
};
|
|
50
|
+
sm: {
|
|
51
|
+
leading: string[];
|
|
52
|
+
leadingIcon: "size-spacing-250 text-[20px]";
|
|
53
|
+
trailing: string[];
|
|
54
|
+
chevron: string;
|
|
55
|
+
};
|
|
56
|
+
md: {
|
|
57
|
+
leading: string[];
|
|
58
|
+
leadingIcon: "size-spacing-300 text-[24px]";
|
|
59
|
+
trailing: string[];
|
|
60
|
+
chevron: string;
|
|
61
|
+
};
|
|
62
|
+
lg: {
|
|
63
|
+
leading: string[];
|
|
64
|
+
leadingIcon: "size-spacing-400 text-[32px]";
|
|
65
|
+
trailing: string[];
|
|
66
|
+
chevron: string;
|
|
67
|
+
};
|
|
68
|
+
xl: {
|
|
69
|
+
leading: string[];
|
|
70
|
+
leadingIcon: "size-spacing-500 text-[40px]";
|
|
71
|
+
trailing: string[];
|
|
72
|
+
chevron: string;
|
|
19
73
|
};
|
|
20
|
-
false: {};
|
|
21
74
|
};
|
|
22
75
|
}, {
|
|
23
76
|
root: string;
|
|
24
|
-
|
|
77
|
+
leading: string[];
|
|
78
|
+
leadingIcon: string;
|
|
79
|
+
trailing: string[];
|
|
80
|
+
chevron: string;
|
|
25
81
|
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
82
|
+
size: {
|
|
83
|
+
xs: {
|
|
84
|
+
leading: string[];
|
|
85
|
+
leadingIcon: "size-spacing-250 text-[20px]";
|
|
86
|
+
trailing: string[];
|
|
87
|
+
chevron: string;
|
|
88
|
+
};
|
|
89
|
+
sm: {
|
|
90
|
+
leading: string[];
|
|
91
|
+
leadingIcon: "size-spacing-250 text-[20px]";
|
|
92
|
+
trailing: string[];
|
|
93
|
+
chevron: string;
|
|
94
|
+
};
|
|
95
|
+
md: {
|
|
96
|
+
leading: string[];
|
|
97
|
+
leadingIcon: "size-spacing-300 text-[24px]";
|
|
98
|
+
trailing: string[];
|
|
99
|
+
chevron: string;
|
|
100
|
+
};
|
|
101
|
+
lg: {
|
|
102
|
+
leading: string[];
|
|
103
|
+
leadingIcon: "size-spacing-400 text-[32px]";
|
|
104
|
+
trailing: string[];
|
|
105
|
+
chevron: string;
|
|
106
|
+
};
|
|
107
|
+
xl: {
|
|
108
|
+
leading: string[];
|
|
109
|
+
leadingIcon: "size-spacing-500 text-[40px]";
|
|
110
|
+
trailing: string[];
|
|
111
|
+
chevron: string;
|
|
29
112
|
};
|
|
30
|
-
false: {};
|
|
31
113
|
};
|
|
32
114
|
}, {
|
|
33
115
|
root: string;
|
|
34
|
-
|
|
116
|
+
leading: string[];
|
|
117
|
+
leadingIcon: string;
|
|
118
|
+
trailing: string[];
|
|
119
|
+
chevron: string;
|
|
35
120
|
}>>;
|
|
121
|
+
/** The chevron's resting offset toward the leading button, in px (the `-translate-x-*` above). */
|
|
122
|
+
export declare const SPLIT_CHEVRON_OFFSET: {
|
|
123
|
+
readonly xs: 1;
|
|
124
|
+
readonly sm: 1;
|
|
125
|
+
readonly md: 2;
|
|
126
|
+
readonly lg: 3;
|
|
127
|
+
readonly xl: 6;
|
|
128
|
+
};
|
|
@@ -1,26 +1,84 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
2
|
+
import { buttonBase, buttonSizes } from '../theme.js';
|
|
3
|
+
/*
|
|
4
|
+
* Split button, per https://m3.material.io/components/split-button/specs. Both halves take the
|
|
5
|
+
* button's height, type and outline for their size. The leading button has its own padding, the
|
|
6
|
+
* trailing button a fixed width around a larger menu icon, and they sit 2dp apart. The corner
|
|
7
|
+
* rules are `.md-btn-split-*` in styles/component.css: inner corners --split-inner at rest,
|
|
8
|
+
* --split-active while hovered, focused or pressed, and fully round on the trailing button while
|
|
9
|
+
* the menu is open.
|
|
10
|
+
*/
|
|
12
11
|
export const splitButton = tv({
|
|
13
12
|
slots: {
|
|
14
|
-
root: 'inline-flex items-
|
|
15
|
-
|
|
13
|
+
root: 'inline-flex items-stretch gap-spacing-25',
|
|
14
|
+
leading: [buttonBase, 'md-btn-split-leading'],
|
|
15
|
+
leadingIcon: 'shrink-0',
|
|
16
|
+
trailing: [buttonBase, 'md-btn-split-trailing px-spacing-0'],
|
|
17
|
+
// Off centre toward the leading button while closed (it balances the round outer edge);
|
|
18
|
+
// SplitButton.svelte springs it to centre and flips it while open.
|
|
19
|
+
chevron: 'shrink-0'
|
|
16
20
|
},
|
|
17
21
|
variants: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
size: {
|
|
23
|
+
xs: {
|
|
24
|
+
leading: [
|
|
25
|
+
buttonSizes.xs.base,
|
|
26
|
+
'ps-spacing-150 pe-spacing-125 [--split-active:0.5rem] [--split-inner:0.25rem]'
|
|
27
|
+
],
|
|
28
|
+
leadingIcon: buttonSizes.xs.icon,
|
|
29
|
+
trailing: [
|
|
30
|
+
buttonSizes.xs.base,
|
|
31
|
+
'w-spacing-600 [--split-active:0.5rem] [--split-inner:0.25rem]'
|
|
32
|
+
],
|
|
33
|
+
chevron: 'size-[22px] -translate-x-px text-[22px]'
|
|
34
|
+
},
|
|
35
|
+
sm: {
|
|
36
|
+
leading: [
|
|
37
|
+
buttonSizes.sm.base,
|
|
38
|
+
'ps-spacing-200 pe-spacing-150 [--split-active:0.75rem] [--split-inner:0.25rem]'
|
|
39
|
+
],
|
|
40
|
+
leadingIcon: buttonSizes.sm.icon,
|
|
41
|
+
trailing: [
|
|
42
|
+
buttonSizes.sm.base,
|
|
43
|
+
'w-spacing-600 [--split-active:0.75rem] [--split-inner:0.25rem]'
|
|
44
|
+
],
|
|
45
|
+
chevron: 'size-[22px] -translate-x-px text-[22px]'
|
|
46
|
+
},
|
|
47
|
+
md: {
|
|
48
|
+
leading: [
|
|
49
|
+
buttonSizes.md.base,
|
|
50
|
+
'px-spacing-300 [--split-active:0.75rem] [--split-inner:0.25rem]'
|
|
51
|
+
],
|
|
52
|
+
leadingIcon: buttonSizes.md.icon,
|
|
53
|
+
trailing: [
|
|
54
|
+
buttonSizes.md.base,
|
|
55
|
+
'w-spacing-700 [--split-active:0.75rem] [--split-inner:0.25rem]'
|
|
56
|
+
],
|
|
57
|
+
chevron: 'size-[26px] -translate-x-spacing-25 text-[26px]'
|
|
58
|
+
},
|
|
59
|
+
lg: {
|
|
60
|
+
leading: [
|
|
61
|
+
buttonSizes.lg.base,
|
|
62
|
+
'px-spacing-600 [--split-active:1.25rem] [--split-inner:0.5rem]'
|
|
63
|
+
],
|
|
64
|
+
leadingIcon: buttonSizes.lg.icon,
|
|
65
|
+
trailing: [buttonSizes.lg.base, 'w-24 [--split-active:1.25rem] [--split-inner:0.5rem]'],
|
|
66
|
+
chevron: 'size-[38px] -translate-x-[3px] text-[38px]'
|
|
67
|
+
},
|
|
68
|
+
xl: {
|
|
69
|
+
leading: [
|
|
70
|
+
buttonSizes.xl.base,
|
|
71
|
+
'px-spacing-800 [--split-active:1.25rem] [--split-inner:0.75rem]'
|
|
72
|
+
],
|
|
73
|
+
leadingIcon: buttonSizes.xl.icon,
|
|
74
|
+
trailing: [buttonSizes.xl.base, 'w-34 [--split-active:1.25rem] [--split-inner:0.75rem]'],
|
|
75
|
+
chevron: 'size-[50px] -translate-x-spacing-75 text-[50px]'
|
|
76
|
+
}
|
|
21
77
|
}
|
|
22
78
|
},
|
|
23
79
|
defaultVariants: {
|
|
24
|
-
|
|
80
|
+
size: 'sm'
|
|
25
81
|
}
|
|
26
82
|
});
|
|
83
|
+
/** The chevron's resting offset toward the leading button, in px (the `-translate-x-*` above). */
|
|
84
|
+
export const SPLIT_CHEVRON_OFFSET = { xs: 1, sm: 1, md: 2, lg: 3, xl: 6 };
|
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
import type { IconProps } from '../../../utils/index.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ButtonSize } from '../theme.js';
|
|
4
4
|
export type SplitButtonProps = {
|
|
5
|
-
/**
|
|
6
|
-
children
|
|
7
|
-
/** `MenuItem` (or
|
|
5
|
+
/** The leading button's label. It can have a label, an icon, or both. */
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
/** The menu: `MenuItem`s (and dividers or headings), as in `Menu`. */
|
|
8
8
|
menuChildren: Snippet;
|
|
9
|
-
/**
|
|
9
|
+
/** The leading button's action. */
|
|
10
10
|
onclick?: (e: MouseEvent) => void;
|
|
11
|
-
/**
|
|
11
|
+
/** The leading button's icon. */
|
|
12
12
|
iconProps?: IconProps;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Colour style of both buttons. Same colours as `Button`; opening the menu doesn't change them.
|
|
15
|
+
* There is no text split button.
|
|
16
|
+
* @default 'filled'
|
|
17
|
+
*/
|
|
18
|
+
variant?: 'elevated' | 'filled' | 'tonal' | 'outlined';
|
|
19
|
+
/**
|
|
20
|
+
* Height 32, 40, 56, 96 or 136dp.
|
|
21
|
+
* @default 'sm'
|
|
22
|
+
*/
|
|
23
|
+
size?: ButtonSize;
|
|
24
|
+
/** Disables both buttons. */
|
|
20
25
|
disabled?: boolean;
|
|
21
|
-
/**
|
|
26
|
+
/** Whether the menu is open. Bindable. */
|
|
22
27
|
open?: boolean;
|
|
23
|
-
/**
|
|
28
|
+
/** Menu alignment against the trailing button. @default 'end' */
|
|
24
29
|
align?: 'start' | 'center' | 'end';
|
|
25
30
|
/**
|
|
26
|
-
* Accessible
|
|
27
|
-
* only a chevron), and the tooltip shown on hover.
|
|
31
|
+
* Accessible name of the trailing button, which shows only an icon.
|
|
28
32
|
* @default 'More options'
|
|
29
33
|
*/
|
|
30
34
|
menuLabel?: string;
|
|
31
|
-
/**
|
|
35
|
+
/** Accessible name of the leading button when it shows only an icon. */
|
|
36
|
+
'aria-label'?: string;
|
|
37
|
+
/** Classes for the wrapper. */
|
|
32
38
|
class?: string;
|
|
33
39
|
};
|