@noxlovette/material 0.2.1 → 0.3.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/claude-skill/material-design/SKILL.md +3 -1
- package/claude-skill/material-design/references/component-patterns.md +15 -0
- package/dist/components/badge/Badge.stories.svelte +58 -0
- package/dist/components/badge/Badge.stories.svelte.d.ts +19 -0
- package/dist/components/buttons/Button.stories.svelte +50 -0
- package/dist/components/buttons/Button.stories.svelte.d.ts +19 -0
- package/dist/components/buttons/ButtonIcon.stories.svelte +74 -0
- package/dist/components/buttons/ButtonIcon.stories.svelte.d.ts +19 -0
- package/dist/components/buttons/FAB.stories.svelte +59 -0
- package/dist/components/buttons/FAB.stories.svelte.d.ts +19 -0
- package/dist/components/buttons/Toggle.stories.svelte +46 -0
- package/dist/components/buttons/Toggle.stories.svelte.d.ts +19 -0
- package/dist/components/cards/Card.stories.svelte +72 -0
- package/dist/components/cards/Card.stories.svelte.d.ts +19 -0
- package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte +35 -0
- package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte.d.ts +4 -0
- package/dist/components/containers/dialogue/Dialogue.stories.svelte +86 -0
- package/dist/components/containers/dialogue/Dialogue.stories.svelte.d.ts +4 -0
- package/dist/components/containers/menu/Menu.stories.svelte +62 -0
- package/dist/components/containers/menu/Menu.stories.svelte.d.ts +19 -0
- package/dist/components/containers/panes/SinglePane.stories.svelte +67 -0
- package/dist/components/containers/panes/SinglePane.stories.svelte.d.ts +19 -0
- package/dist/components/containers/panes/SplitPane.stories.svelte +124 -0
- package/dist/components/containers/panes/SplitPane.stories.svelte.d.ts +19 -0
- package/dist/components/containers/panes/SplitPane.svelte +25 -21
- package/dist/components/containers/panes/SplitPane.svelte.d.ts +4 -1
- package/dist/components/containers/panes/SupportingPane.stories.svelte +113 -0
- package/dist/components/containers/panes/SupportingPane.stories.svelte.d.ts +19 -0
- package/dist/components/containers/panes/theme.d.ts +18 -0
- package/dist/components/containers/panes/theme.js +11 -0
- package/dist/components/containers/panes/types.d.ts +17 -1
- package/dist/components/containers/popover/Popover.stories.svelte +65 -0
- package/dist/components/containers/popover/Popover.stories.svelte.d.ts +19 -0
- package/dist/components/containers/side-sheet/SideSheet.stories.svelte +54 -0
- package/dist/components/containers/side-sheet/SideSheet.stories.svelte.d.ts +4 -0
- package/dist/components/forms/checkbox/Checkbox.stories.svelte +42 -0
- package/dist/components/forms/checkbox/Checkbox.stories.svelte.d.ts +19 -0
- package/dist/components/forms/search/Search.stories.svelte +41 -0
- package/dist/components/forms/search/Search.stories.svelte.d.ts +19 -0
- package/dist/components/forms/select/Select.stories.svelte +89 -0
- package/dist/components/forms/select/Select.stories.svelte.d.ts +19 -0
- package/dist/components/forms/select/Select.svelte +1 -1
- package/dist/components/forms/slider/Slider.stories.svelte +76 -0
- package/dist/components/forms/slider/Slider.stories.svelte.d.ts +19 -0
- package/dist/components/forms/switch/Switch.stories.svelte +47 -0
- package/dist/components/forms/switch/Switch.stories.svelte.d.ts +19 -0
- package/dist/components/forms/textfield/Textfield.stories.svelte +74 -0
- package/dist/components/forms/textfield/Textfield.stories.svelte.d.ts +19 -0
- package/dist/components/misc/Avatar.svelte +2 -2
- package/dist/components/misc/types.d.ts +4 -0
- package/dist/components/nav/appbar/AppBar.stories.svelte +49 -0
- package/dist/components/nav/appbar/AppBar.stories.svelte.d.ts +19 -0
- package/dist/components/nav/navbar/Navbar.stories.svelte +33 -0
- package/dist/components/nav/navbar/Navbar.stories.svelte.d.ts +19 -0
- package/dist/components/nav/rail/Rail.stories.svelte +73 -0
- package/dist/components/nav/rail/Rail.stories.svelte.d.ts +19 -0
- package/dist/components/nav/rail/types.d.ts +1 -1
- package/dist/components/nav/tabs/Tabs.stories.svelte +55 -0
- package/dist/components/nav/tabs/Tabs.stories.svelte.d.ts +18 -0
- package/dist/components/pill/Pill.stories.svelte +48 -0
- package/dist/components/pill/Pill.stories.svelte.d.ts +19 -0
- package/dist/components/progress/Progress.stories.svelte +64 -0
- package/dist/components/progress/Progress.stories.svelte.d.ts +18 -0
- package/dist/components/snackbar/Snackbar.stories.svelte +76 -0
- package/dist/components/snackbar/Snackbar.stories.svelte.d.ts +4 -0
- package/dist/components/typography/body/Body.stories.svelte +30 -0
- package/dist/components/typography/body/Body.stories.svelte.d.ts +19 -0
- package/dist/components/typography/display/Display.stories.svelte +30 -0
- package/dist/components/typography/display/Display.stories.svelte.d.ts +19 -0
- package/dist/components/typography/headline/Headline.stories.svelte +30 -0
- package/dist/components/typography/headline/Headline.stories.svelte.d.ts +19 -0
- package/dist/components/typography/label/Label.stories.svelte +30 -0
- package/dist/components/typography/label/Label.stories.svelte.d.ts +19 -0
- package/dist/components/typography/title/Title.stories.svelte +30 -0
- package/dist/components/typography/title/Title.stories.svelte.d.ts +19 -0
- package/package.json +12 -4
|
@@ -2,6 +2,8 @@ import type { Avatar as AvatarPrimitive } from 'bits-ui';
|
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
3
|
import type { avatar } from './theme.js';
|
|
4
4
|
export type AvatarVariants = VariantProps<typeof avatar>;
|
|
5
|
+
/** Dicebear (https://www.dicebear.com) avatar styles available for the generated fallback avatar. */
|
|
6
|
+
export type DicebearStyle = 'shapes' | 'adventurer' | 'adventurer-neutral' | 'avataaars' | 'avataaars-neutral' | 'big-ears' | 'big-ears-neutral' | 'big-smile' | 'bottts' | 'bottts-neutral' | 'croodles' | 'croodles-neutral' | 'dylan' | 'fun-emoji' | 'glass' | 'icons' | 'identicon' | 'initials' | 'lorelei' | 'lorelei-neutral' | 'micah' | 'miniavs' | 'notionists' | 'notionists-neutral' | 'open-peeps' | 'personas' | 'pixel-art' | 'pixel-art-neutral' | 'rings' | 'thumbs';
|
|
5
7
|
export type AvatarProps = AvatarPrimitive.RootProps & {
|
|
6
8
|
/** The URL of the avatar image. If null or undefined, a generated avatar will be used. */
|
|
7
9
|
src?: string | null;
|
|
@@ -9,6 +11,8 @@ export type AvatarProps = AvatarPrimitive.RootProps & {
|
|
|
9
11
|
alt?: string;
|
|
10
12
|
/** The seed for the generated avatar if no src is provided. */
|
|
11
13
|
seed?: string;
|
|
14
|
+
/** The Dicebear style used for the generated fallback avatar. @default 'shapes' */
|
|
15
|
+
dicebearStyle?: DicebearStyle;
|
|
12
16
|
/** The loading status of the avatar image. */
|
|
13
17
|
loadingStatus?: 'loading' | 'loaded' | 'error';
|
|
14
18
|
/** Callback for when the avatar is clicked. If provided, the avatar is wrapped in a button. */
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import AppBar from './AppBar.svelte';
|
|
4
|
+
import ButtonIcon from '../../buttons/ButtonIcon.svelte';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Navigation/App Bar',
|
|
8
|
+
component: AppBar,
|
|
9
|
+
parameters: {
|
|
10
|
+
// AppBar is the mobile top bar (md:hidden) — preview it at a mobile viewport.
|
|
11
|
+
viewport: { defaultViewport: 'mobile1' }
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
title: { control: 'text' },
|
|
15
|
+
subtitle: { control: 'text' },
|
|
16
|
+
showBack: { control: 'boolean' },
|
|
17
|
+
ghost: { control: 'boolean' }
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
title: 'Inbox',
|
|
21
|
+
showBack: false,
|
|
22
|
+
ghost: true
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<Story name="Playground">
|
|
28
|
+
{#snippet template(args)}
|
|
29
|
+
<AppBar {...args}>
|
|
30
|
+
{#snippet trailing()}
|
|
31
|
+
<ButtonIcon variant="text" iconProps={{ name: 'search' }} />
|
|
32
|
+
<ButtonIcon variant="text" iconProps={{ name: 'more_vert' }} />
|
|
33
|
+
{/snippet}
|
|
34
|
+
</AppBar>
|
|
35
|
+
{/snippet}
|
|
36
|
+
</Story>
|
|
37
|
+
|
|
38
|
+
<Story
|
|
39
|
+
name="With Back and Subtitle"
|
|
40
|
+
args={{ title: 'Draft', subtitle: '3 recipients', showBack: true }}
|
|
41
|
+
>
|
|
42
|
+
{#snippet template(args)}
|
|
43
|
+
<AppBar {...args}>
|
|
44
|
+
{#snippet leading()}
|
|
45
|
+
<ButtonIcon variant="text" iconProps={{ name: 'arrow_back' }} />
|
|
46
|
+
{/snippet}
|
|
47
|
+
</AppBar>
|
|
48
|
+
{/snippet}
|
|
49
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AppBar from './AppBar.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const AppBar: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type AppBar = InstanceType<typeof AppBar>;
|
|
19
|
+
export default AppBar;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Navbar from './Navbar.svelte';
|
|
4
|
+
import NavbarItem from './NavbarItem.svelte';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Navigation/Navbar',
|
|
8
|
+
component: Navbar,
|
|
9
|
+
parameters: {
|
|
10
|
+
// Navbar is the mobile fallback (md:hidden) for Rail — preview it at a mobile viewport.
|
|
11
|
+
viewport: { defaultViewport: 'mobile1' }
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
ghost: { control: 'boolean' }
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
ghost: false
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Story name="Playground">
|
|
23
|
+
{#snippet template(args)}
|
|
24
|
+
<div class="relative h-24">
|
|
25
|
+
<Navbar ghost={args.ghost}>
|
|
26
|
+
<NavbarItem label="Home" href="/" iconProps={{ name: 'house' }} selected />
|
|
27
|
+
<NavbarItem label="Inbox" href="#" iconProps={{ name: 'mail' }} badge={4} />
|
|
28
|
+
<NavbarItem label="Chat" href="#" iconProps={{ name: 'chat' }} badge={-1} />
|
|
29
|
+
<NavbarItem label="Settings" href="#" iconProps={{ name: 'settings' }} />
|
|
30
|
+
</Navbar>
|
|
31
|
+
</div>
|
|
32
|
+
{/snippet}
|
|
33
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Navbar from './Navbar.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Navbar: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Navbar = InstanceType<typeof Navbar>;
|
|
19
|
+
export default Navbar;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Rail from './Rail.svelte';
|
|
4
|
+
import RailItem from './RailItem.svelte';
|
|
5
|
+
import FAB from '../../buttons/FAB.svelte';
|
|
6
|
+
import Avatar from '../../misc/Avatar.svelte';
|
|
7
|
+
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
title: 'Navigation/Rail',
|
|
10
|
+
component: Rail,
|
|
11
|
+
argTypes: {
|
|
12
|
+
collapsed: { control: 'boolean' },
|
|
13
|
+
expandable: { control: 'boolean' },
|
|
14
|
+
rounded: { control: 'boolean' },
|
|
15
|
+
anchor: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['viewport', 'parent']
|
|
18
|
+
},
|
|
19
|
+
withNavbar: { control: 'boolean' }
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
collapsed: true,
|
|
23
|
+
expandable: true,
|
|
24
|
+
rounded: false,
|
|
25
|
+
anchor: 'parent',
|
|
26
|
+
withNavbar: false
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<Story name="Playground">
|
|
32
|
+
{#snippet template(args)}
|
|
33
|
+
<div class="bg-md-sys-color-surface-variant relative h-[420px] overflow-hidden rounded-2xl">
|
|
34
|
+
<Rail
|
|
35
|
+
anchor={args.anchor}
|
|
36
|
+
collapsed={args.collapsed}
|
|
37
|
+
expandable={args.expandable}
|
|
38
|
+
rounded={args.rounded}
|
|
39
|
+
withNavbar={args.withNavbar}
|
|
40
|
+
>
|
|
41
|
+
<RailItem label="Home" href="/" iconProps={{ name: 'house' }} selected />
|
|
42
|
+
<RailItem label="Inbox" href="#" iconProps={{ name: 'mail' }} badge={4} />
|
|
43
|
+
<RailItem label="Chat" href="#" iconProps={{ name: 'chat' }} badge={-1} />
|
|
44
|
+
<RailItem label="Settings" href="#" iconProps={{ name: 'settings' }} />
|
|
45
|
+
<RailItem label="Disabled" href="#" iconProps={{ name: 'block' }} disabled />
|
|
46
|
+
</Rail>
|
|
47
|
+
</div>
|
|
48
|
+
{/snippet}
|
|
49
|
+
</Story>
|
|
50
|
+
|
|
51
|
+
<Story name="With FAB and Footer" args={{ withNavbar: false }}>
|
|
52
|
+
{#snippet template(args)}
|
|
53
|
+
<div class="bg-md-sys-color-surface-variant relative h-[420px] overflow-hidden rounded-2xl">
|
|
54
|
+
<Rail
|
|
55
|
+
anchor={args.anchor}
|
|
56
|
+
collapsed={args.collapsed}
|
|
57
|
+
expandable={args.expandable}
|
|
58
|
+
rounded={args.rounded}
|
|
59
|
+
withNavbar={args.withNavbar}
|
|
60
|
+
>
|
|
61
|
+
{#snippet fab()}
|
|
62
|
+
<FAB size="small" iconProps={{ name: 'add' }} label="New" />
|
|
63
|
+
{/snippet}
|
|
64
|
+
{#snippet railFooter()}
|
|
65
|
+
<Avatar seed="DV" />
|
|
66
|
+
{/snippet}
|
|
67
|
+
<RailItem label="Home" href="/" iconProps={{ name: 'house' }} selected />
|
|
68
|
+
<RailItem label="Inbox" href="#" iconProps={{ name: 'mail' }} badge={4} />
|
|
69
|
+
<RailItem label="Settings" href="#" iconProps={{ name: 'settings' }} />
|
|
70
|
+
</Rail>
|
|
71
|
+
</div>
|
|
72
|
+
{/snippet}
|
|
73
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Rail from './Rail.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Rail: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Rail = InstanceType<typeof Rail>;
|
|
19
|
+
export default Rail;
|
|
@@ -47,5 +47,5 @@ export type RailProps = RailVariants & HTMLAttributes<HTMLDivElement> & {
|
|
|
47
47
|
/** Render a bottom navbar on mobile. */
|
|
48
48
|
withNavbar?: boolean;
|
|
49
49
|
/** Customise the navbar inside the rail */
|
|
50
|
-
navbarProps?: NavBarProps
|
|
50
|
+
navbarProps?: Omit<NavBarProps, 'children'>;
|
|
51
51
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import TabHolder from './TabHolder.svelte';
|
|
4
|
+
import TabContent from './TabContent.svelte';
|
|
5
|
+
import Body from '../../typography/body/Body.svelte';
|
|
6
|
+
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
title: 'Navigation/Tabs',
|
|
9
|
+
component: TabHolder,
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['primary', 'secondary']
|
|
14
|
+
},
|
|
15
|
+
activationMode: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['automatic', 'manual']
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
variant: 'primary',
|
|
22
|
+
activationMode: 'automatic'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const items = [
|
|
27
|
+
{ value: 'flights', name: 'Flights', iconProps: { name: 'flight' } },
|
|
28
|
+
{ value: 'trips', name: 'Trips', iconProps: { name: 'luggage' } },
|
|
29
|
+
{ value: 'explore', name: 'Explore', iconProps: { name: 'explore' } }
|
|
30
|
+
];
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<Story name="Playground">
|
|
34
|
+
{#snippet template(args)}
|
|
35
|
+
<div class="flex flex-col gap-4">
|
|
36
|
+
<TabHolder {...args} {items} />
|
|
37
|
+
<TabContent value="flights"><Body>Flights panel content.</Body></TabContent>
|
|
38
|
+
<TabContent value="trips"><Body>Trips panel content.</Body></TabContent>
|
|
39
|
+
<TabContent value="explore"><Body>Explore panel content.</Body></TabContent>
|
|
40
|
+
</div>
|
|
41
|
+
{/snippet}
|
|
42
|
+
</Story>
|
|
43
|
+
|
|
44
|
+
<Story name="Navigation Tabs (href)" args={{ variant: 'primary' }}>
|
|
45
|
+
{#snippet template(args)}
|
|
46
|
+
<TabHolder
|
|
47
|
+
{...args}
|
|
48
|
+
items={[
|
|
49
|
+
{ value: 'home', name: 'Home', href: '#', iconProps: { name: 'house' } },
|
|
50
|
+
{ value: 'search', name: 'Search', href: '#', iconProps: { name: 'search' } },
|
|
51
|
+
{ value: 'settings', name: 'Settings', href: '#', iconProps: { name: 'settings' } }
|
|
52
|
+
]}
|
|
53
|
+
/>
|
|
54
|
+
{/snippet}
|
|
55
|
+
</Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Tabs: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Tabs = InstanceType<typeof Tabs>;
|
|
18
|
+
export default Tabs;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Pill from './Pill.svelte';
|
|
4
|
+
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: 'Pill/Pill',
|
|
7
|
+
component: Pill,
|
|
8
|
+
argTypes: {
|
|
9
|
+
variant: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: [
|
|
12
|
+
'primary',
|
|
13
|
+
'secondary',
|
|
14
|
+
'tertiary',
|
|
15
|
+
'error',
|
|
16
|
+
'container',
|
|
17
|
+
'primary-container',
|
|
18
|
+
'secondary-container',
|
|
19
|
+
'tertiary-container',
|
|
20
|
+
'error-container',
|
|
21
|
+
'yellow',
|
|
22
|
+
'green'
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
variant: 'primary'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<Story name="Playground">New</Story>
|
|
33
|
+
|
|
34
|
+
<Story name="Variants" asChild>
|
|
35
|
+
<div class="flex flex-wrap items-center gap-3 p-6">
|
|
36
|
+
<Pill variant="primary">Primary</Pill>
|
|
37
|
+
<Pill variant="secondary">Secondary</Pill>
|
|
38
|
+
<Pill variant="tertiary">Tertiary</Pill>
|
|
39
|
+
<Pill variant="error">Error</Pill>
|
|
40
|
+
<Pill variant="container">Container</Pill>
|
|
41
|
+
<Pill variant="primary-container">Primary Container</Pill>
|
|
42
|
+
<Pill variant="secondary-container">Secondary Container</Pill>
|
|
43
|
+
<Pill variant="tertiary-container">Tertiary Container</Pill>
|
|
44
|
+
<Pill variant="error-container">Error Container</Pill>
|
|
45
|
+
<Pill variant="yellow">Yellow</Pill>
|
|
46
|
+
<Pill variant="green">Green</Pill>
|
|
47
|
+
</div>
|
|
48
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Pill from './Pill.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Pill: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Pill = InstanceType<typeof Pill>;
|
|
19
|
+
export default Pill;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Three separate M3 progress-indicator components live under this folder — Circular, Linear, and
|
|
3
|
+
the library's custom Wavy variant — each with its own (non-identical) prop set. They share one
|
|
4
|
+
story file/title ('Feedback/Progress') with a Story block per component, each toggleable between
|
|
5
|
+
determinate (`percent`, 0-100) and indeterminate (omit `percent`, or pass null).
|
|
6
|
+
-->
|
|
7
|
+
<script module lang="ts">
|
|
8
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
9
|
+
import CircularProgress from './CircularProgress.svelte';
|
|
10
|
+
import LinearProgress from './LinearProgress.svelte';
|
|
11
|
+
import WavyLinearProgress from './WavyLinearProgress.svelte';
|
|
12
|
+
|
|
13
|
+
const { Story } = defineMeta({
|
|
14
|
+
title: 'Feedback/Progress',
|
|
15
|
+
argTypes: {
|
|
16
|
+
percent: { control: { type: 'range', min: 0, max: 100, step: 1 } }
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
percent: 65
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<Story name="Circular (Determinate)">
|
|
25
|
+
{#snippet template(args)}
|
|
26
|
+
<div class="flex items-center justify-center p-6">
|
|
27
|
+
<CircularProgress percent={args.percent} />
|
|
28
|
+
</div>
|
|
29
|
+
{/snippet}
|
|
30
|
+
</Story>
|
|
31
|
+
|
|
32
|
+
<Story name="Circular (Indeterminate)" asChild>
|
|
33
|
+
<div class="flex items-center justify-center p-6">
|
|
34
|
+
<CircularProgress />
|
|
35
|
+
</div>
|
|
36
|
+
</Story>
|
|
37
|
+
|
|
38
|
+
<Story name="Linear (Determinate)">
|
|
39
|
+
{#snippet template(args)}
|
|
40
|
+
<div class="flex items-center p-6">
|
|
41
|
+
<LinearProgress percent={args.percent} class="w-full max-w-sm" />
|
|
42
|
+
</div>
|
|
43
|
+
{/snippet}
|
|
44
|
+
</Story>
|
|
45
|
+
|
|
46
|
+
<Story name="Linear (Indeterminate)" asChild>
|
|
47
|
+
<div class="flex items-center p-6">
|
|
48
|
+
<LinearProgress class="w-full max-w-sm" />
|
|
49
|
+
</div>
|
|
50
|
+
</Story>
|
|
51
|
+
|
|
52
|
+
<Story name="Wavy (Determinate)">
|
|
53
|
+
{#snippet template(args)}
|
|
54
|
+
<div class="flex items-center p-6">
|
|
55
|
+
<WavyLinearProgress percent={args.percent} class="w-full max-w-sm" />
|
|
56
|
+
</div>
|
|
57
|
+
{/snippet}
|
|
58
|
+
</Story>
|
|
59
|
+
|
|
60
|
+
<Story name="Wavy (Indeterminate)" asChild>
|
|
61
|
+
<div class="flex items-center p-6">
|
|
62
|
+
<WavyLinearProgress class="w-full max-w-sm" />
|
|
63
|
+
</div>
|
|
64
|
+
</Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Progress: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Progress = InstanceType<typeof Progress>;
|
|
18
|
+
export default Progress;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Snackbar is a declarative, bindable-message component, not an imperative toast() call: mount
|
|
3
|
+
one instance per page/region with `bind:message`, then trigger it by assigning a string (or
|
|
4
|
+
Snippet) to that bound variable from anywhere else in your app. Setting `message` back to '' —
|
|
5
|
+
or letting the internal 4s auto-dismiss timer do it — hides it again. Because triggering is just
|
|
6
|
+
a variable assignment, each story below wires up its own local `$state` and a button to set it,
|
|
7
|
+
the same pattern used for Dialogue's bindable `open`.
|
|
8
|
+
-->
|
|
9
|
+
<script module lang="ts">
|
|
10
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
11
|
+
import Snackbar from './Snackbar.svelte';
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import Button from '../buttons/Button.svelte';
|
|
16
|
+
|
|
17
|
+
const { Story } = defineMeta({
|
|
18
|
+
title: 'Feedback/Snackbar',
|
|
19
|
+
component: Snackbar,
|
|
20
|
+
argTypes: {
|
|
21
|
+
label: { control: 'text' },
|
|
22
|
+
showClose: { control: 'boolean' },
|
|
23
|
+
static: { control: 'boolean' }
|
|
24
|
+
},
|
|
25
|
+
args: {
|
|
26
|
+
label: 'Undo',
|
|
27
|
+
showClose: true,
|
|
28
|
+
static: false
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
let playgroundMessage = $state('This is a snackbar message.');
|
|
33
|
+
let triggeredMessage = $state('');
|
|
34
|
+
let actionMessage = $state('Item archived.');
|
|
35
|
+
let staticMessage = $state('This snackbar stays until manually dismissed.');
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<Story name="Playground">
|
|
39
|
+
{#snippet template(args)}
|
|
40
|
+
<div class="relative flex min-h-24 items-center justify-center">
|
|
41
|
+
<Snackbar
|
|
42
|
+
bind:message={playgroundMessage}
|
|
43
|
+
label={args.label}
|
|
44
|
+
showClose={args.showClose}
|
|
45
|
+
static={args.static}
|
|
46
|
+
fixed={false}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
{/snippet}
|
|
50
|
+
</Story>
|
|
51
|
+
|
|
52
|
+
<Story name="Triggered" asChild>
|
|
53
|
+
<div class="relative flex min-h-32 flex-col items-center justify-center gap-4">
|
|
54
|
+
<Button
|
|
55
|
+
variant="tonal"
|
|
56
|
+
onclick={() => {
|
|
57
|
+
triggeredMessage = `Message sent at ${new Date().toLocaleTimeString()}`;
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
Show Snackbar
|
|
61
|
+
</Button>
|
|
62
|
+
<Snackbar bind:message={triggeredMessage} label="Undo" fixed={false} />
|
|
63
|
+
</div>
|
|
64
|
+
</Story>
|
|
65
|
+
|
|
66
|
+
<Story name="With Action" asChild>
|
|
67
|
+
<div class="relative flex min-h-24 items-center justify-center">
|
|
68
|
+
<Snackbar bind:message={actionMessage} label="Undo" fixed={false} />
|
|
69
|
+
</div>
|
|
70
|
+
</Story>
|
|
71
|
+
|
|
72
|
+
<Story name="Static (No Auto-Dismiss)" asChild>
|
|
73
|
+
<div class="relative flex min-h-24 items-center justify-center">
|
|
74
|
+
<Snackbar bind:message={staticMessage} static showClose fixed={false} />
|
|
75
|
+
</div>
|
|
76
|
+
</Story>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Body from './Body.svelte';
|
|
4
|
+
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: 'Typography/Body',
|
|
7
|
+
component: Body,
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: ['small', 'medium', 'large']
|
|
12
|
+
},
|
|
13
|
+
emphasized: { control: 'boolean' }
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
size: 'medium',
|
|
17
|
+
emphasized: false
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Story name="Playground">Body text used for longer passages of content.</Story>
|
|
23
|
+
|
|
24
|
+
<Story name="Sizes" asChild>
|
|
25
|
+
<div class="flex flex-col gap-4 p-6">
|
|
26
|
+
<Body size="small">Body small</Body>
|
|
27
|
+
<Body size="medium">Body medium</Body>
|
|
28
|
+
<Body size="large">Body large</Body>
|
|
29
|
+
</div>
|
|
30
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Body from './Body.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Body: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Body = InstanceType<typeof Body>;
|
|
19
|
+
export default Body;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Display from './Display.svelte';
|
|
4
|
+
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: 'Typography/Display',
|
|
7
|
+
component: Display,
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: ['small', 'medium', 'large']
|
|
12
|
+
},
|
|
13
|
+
emphasized: { control: 'boolean' }
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
size: 'medium',
|
|
17
|
+
emphasized: false
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Story name="Playground">Display text</Story>
|
|
23
|
+
|
|
24
|
+
<Story name="Sizes" asChild>
|
|
25
|
+
<div class="flex flex-col gap-4 p-6">
|
|
26
|
+
<Display size="small">Display small</Display>
|
|
27
|
+
<Display size="medium">Display medium</Display>
|
|
28
|
+
<Display size="large">Display large</Display>
|
|
29
|
+
</div>
|
|
30
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Display from './Display.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Display: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Display = InstanceType<typeof Display>;
|
|
19
|
+
export default Display;
|