@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.
Files changed (76) hide show
  1. package/claude-skill/material-design/SKILL.md +3 -1
  2. package/claude-skill/material-design/references/component-patterns.md +15 -0
  3. package/dist/components/badge/Badge.stories.svelte +58 -0
  4. package/dist/components/badge/Badge.stories.svelte.d.ts +19 -0
  5. package/dist/components/buttons/Button.stories.svelte +50 -0
  6. package/dist/components/buttons/Button.stories.svelte.d.ts +19 -0
  7. package/dist/components/buttons/ButtonIcon.stories.svelte +74 -0
  8. package/dist/components/buttons/ButtonIcon.stories.svelte.d.ts +19 -0
  9. package/dist/components/buttons/FAB.stories.svelte +59 -0
  10. package/dist/components/buttons/FAB.stories.svelte.d.ts +19 -0
  11. package/dist/components/buttons/Toggle.stories.svelte +46 -0
  12. package/dist/components/buttons/Toggle.stories.svelte.d.ts +19 -0
  13. package/dist/components/cards/Card.stories.svelte +72 -0
  14. package/dist/components/cards/Card.stories.svelte.d.ts +19 -0
  15. package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte +35 -0
  16. package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte.d.ts +4 -0
  17. package/dist/components/containers/dialogue/Dialogue.stories.svelte +86 -0
  18. package/dist/components/containers/dialogue/Dialogue.stories.svelte.d.ts +4 -0
  19. package/dist/components/containers/menu/Menu.stories.svelte +62 -0
  20. package/dist/components/containers/menu/Menu.stories.svelte.d.ts +19 -0
  21. package/dist/components/containers/panes/SinglePane.stories.svelte +67 -0
  22. package/dist/components/containers/panes/SinglePane.stories.svelte.d.ts +19 -0
  23. package/dist/components/containers/panes/SplitPane.stories.svelte +124 -0
  24. package/dist/components/containers/panes/SplitPane.stories.svelte.d.ts +19 -0
  25. package/dist/components/containers/panes/SplitPane.svelte +25 -21
  26. package/dist/components/containers/panes/SplitPane.svelte.d.ts +4 -1
  27. package/dist/components/containers/panes/SupportingPane.stories.svelte +113 -0
  28. package/dist/components/containers/panes/SupportingPane.stories.svelte.d.ts +19 -0
  29. package/dist/components/containers/panes/theme.d.ts +18 -0
  30. package/dist/components/containers/panes/theme.js +11 -0
  31. package/dist/components/containers/panes/types.d.ts +17 -1
  32. package/dist/components/containers/popover/Popover.stories.svelte +65 -0
  33. package/dist/components/containers/popover/Popover.stories.svelte.d.ts +19 -0
  34. package/dist/components/containers/side-sheet/SideSheet.stories.svelte +54 -0
  35. package/dist/components/containers/side-sheet/SideSheet.stories.svelte.d.ts +4 -0
  36. package/dist/components/forms/checkbox/Checkbox.stories.svelte +42 -0
  37. package/dist/components/forms/checkbox/Checkbox.stories.svelte.d.ts +19 -0
  38. package/dist/components/forms/search/Search.stories.svelte +41 -0
  39. package/dist/components/forms/search/Search.stories.svelte.d.ts +19 -0
  40. package/dist/components/forms/select/Select.stories.svelte +89 -0
  41. package/dist/components/forms/select/Select.stories.svelte.d.ts +19 -0
  42. package/dist/components/forms/select/Select.svelte +1 -1
  43. package/dist/components/forms/slider/Slider.stories.svelte +76 -0
  44. package/dist/components/forms/slider/Slider.stories.svelte.d.ts +19 -0
  45. package/dist/components/forms/switch/Switch.stories.svelte +47 -0
  46. package/dist/components/forms/switch/Switch.stories.svelte.d.ts +19 -0
  47. package/dist/components/forms/textfield/Textfield.stories.svelte +74 -0
  48. package/dist/components/forms/textfield/Textfield.stories.svelte.d.ts +19 -0
  49. package/dist/components/misc/Avatar.svelte +2 -2
  50. package/dist/components/misc/types.d.ts +4 -0
  51. package/dist/components/nav/appbar/AppBar.stories.svelte +49 -0
  52. package/dist/components/nav/appbar/AppBar.stories.svelte.d.ts +19 -0
  53. package/dist/components/nav/navbar/Navbar.stories.svelte +33 -0
  54. package/dist/components/nav/navbar/Navbar.stories.svelte.d.ts +19 -0
  55. package/dist/components/nav/rail/Rail.stories.svelte +73 -0
  56. package/dist/components/nav/rail/Rail.stories.svelte.d.ts +19 -0
  57. package/dist/components/nav/rail/types.d.ts +1 -1
  58. package/dist/components/nav/tabs/Tabs.stories.svelte +55 -0
  59. package/dist/components/nav/tabs/Tabs.stories.svelte.d.ts +18 -0
  60. package/dist/components/pill/Pill.stories.svelte +48 -0
  61. package/dist/components/pill/Pill.stories.svelte.d.ts +19 -0
  62. package/dist/components/progress/Progress.stories.svelte +64 -0
  63. package/dist/components/progress/Progress.stories.svelte.d.ts +18 -0
  64. package/dist/components/snackbar/Snackbar.stories.svelte +76 -0
  65. package/dist/components/snackbar/Snackbar.stories.svelte.d.ts +4 -0
  66. package/dist/components/typography/body/Body.stories.svelte +30 -0
  67. package/dist/components/typography/body/Body.stories.svelte.d.ts +19 -0
  68. package/dist/components/typography/display/Display.stories.svelte +30 -0
  69. package/dist/components/typography/display/Display.stories.svelte.d.ts +19 -0
  70. package/dist/components/typography/headline/Headline.stories.svelte +30 -0
  71. package/dist/components/typography/headline/Headline.stories.svelte.d.ts +19 -0
  72. package/dist/components/typography/label/Label.stories.svelte +30 -0
  73. package/dist/components/typography/label/Label.stories.svelte.d.ts +19 -0
  74. package/dist/components/typography/title/Title.stories.svelte +30 -0
  75. package/dist/components/typography/title/Title.stories.svelte.d.ts +19 -0
  76. package/package.json +12 -4
@@ -0,0 +1,65 @@
1
+ <!--
2
+ Popover owns its own open/close state internally (bits-ui Popover.Root bind:open, defaulting to
3
+ closed) and requires a `trigger` snippet — clicking that trigger toggles it, so no external open
4
+ state is needed here (same as Menu).
5
+ -->
6
+ <script module lang="ts">
7
+ import { defineMeta } from '@storybook/addon-svelte-csf';
8
+ import Popover from './Popover.svelte';
9
+ import Button from '../../buttons/Button.svelte';
10
+ import ButtonIcon from '../../buttons/ButtonIcon.svelte';
11
+ import { Body } from '../../../index.js';
12
+
13
+ const { Story } = defineMeta({
14
+ title: 'Containers/Popover',
15
+ component: Popover,
16
+ argTypes: {
17
+ title: { control: 'text' },
18
+ showClose: { control: 'boolean' },
19
+ side: { control: 'select', options: ['top', 'right', 'bottom', 'left'] },
20
+ align: { control: 'select', options: ['start', 'center', 'end'] },
21
+ sideOffset: { control: 'number' }
22
+ },
23
+ args: {
24
+ title: 'Storage',
25
+ showClose: true,
26
+ side: 'bottom',
27
+ align: 'start',
28
+ sideOffset: 8
29
+ }
30
+ });
31
+ </script>
32
+
33
+ <Story name="Playground">
34
+ {#snippet template(args)}
35
+ <div class="p-24">
36
+ <Popover
37
+ title={args.title}
38
+ showClose={args.showClose}
39
+ side={args.side}
40
+ align={args.align}
41
+ sideOffset={args.sideOffset}
42
+ >
43
+ {#snippet trigger()}
44
+ <Button variant="outlined">Show info</Button>
45
+ {/snippet}
46
+ <Body class="text-md-sys-color-on-surface-variant">
47
+ 75% of your storage has been used. Consider upgrading your plan.
48
+ </Body>
49
+ </Popover>
50
+ </div>
51
+ {/snippet}
52
+ </Story>
53
+
54
+ <Story name="Icon Trigger, No Title" asChild>
55
+ <div class="p-24">
56
+ <Popover showClose={false}>
57
+ {#snippet trigger()}
58
+ <ButtonIcon iconProps={{ name: 'info' }} variant="text" />
59
+ {/snippet}
60
+ <Body class="text-md-sys-color-on-surface-variant">
61
+ A minimal popover with no header — just an icon trigger and body text.
62
+ </Body>
63
+ </Popover>
64
+ </div>
65
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Popover from './Popover.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 Popover: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Popover = InstanceType<typeof Popover>;
19
+ export default Popover;
@@ -0,0 +1,54 @@
1
+ <!--
2
+ SideSheet is a content template only — a headline row with a close button, followed by
3
+ `children`. It renders no backdrop, no fixed/absolute positioning, and no open/close
4
+ transition of its own (unlike Dialogue and BottomSheet, which own their overlay). Consumers
5
+ are expected to place it inside their own positioned container (e.g. a fixed aside, or a
6
+ SplitPane right pane) — the wrapping <div> below is that story-only host, not part of the
7
+ component.
8
+ -->
9
+ <script module lang="ts">
10
+ import { defineMeta } from '@storybook/addon-svelte-csf';
11
+ import SideSheet from './SideSheet.svelte';
12
+ import Button from '../../buttons/Button.svelte';
13
+ import { Body } from '../../../index.js';
14
+
15
+ const { Story } = defineMeta({
16
+ title: 'Containers/Side Sheet',
17
+ component: SideSheet,
18
+ argTypes: {
19
+ headline: { control: 'text' }
20
+ },
21
+ args: {
22
+ headline: 'Details'
23
+ }
24
+ });
25
+ </script>
26
+
27
+ <script lang="ts">
28
+ let playgroundOpen = $state(true);
29
+ </script>
30
+
31
+ <Story name="Playground">
32
+ {#snippet template(args)}
33
+ <div class="bg-md-sys-color-surface relative h-[420px] overflow-hidden">
34
+ {#if playgroundOpen}
35
+ <div
36
+ class="bg-md-sys-color-surface-container-low shadow-elevation-1 absolute top-0 right-0 h-full w-80"
37
+ >
38
+ <SideSheet headline={args.headline} close={() => (playgroundOpen = false)}>
39
+ <div class="flex flex-col gap-3 px-6 pb-6">
40
+ <Body class="text-md-sys-color-on-surface-variant">
41
+ Supplementary content and actions, anchored to the edge of the screen while the main
42
+ content stays visible.
43
+ </Body>
44
+ </div>
45
+ </SideSheet>
46
+ </div>
47
+ {:else}
48
+ <div class="p-6">
49
+ <Button onclick={() => (playgroundOpen = true)}>Show side sheet</Button>
50
+ </div>
51
+ {/if}
52
+ </div>
53
+ {/snippet}
54
+ </Story>
@@ -0,0 +1,4 @@
1
+ import SideSheet from './SideSheet.svelte';
2
+ declare const SideSheet: import("svelte").Component<Record<string, never>, {}, "">;
3
+ type SideSheet = ReturnType<typeof SideSheet>;
4
+ export default SideSheet;
@@ -0,0 +1,42 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Checkbox from './Checkbox.svelte';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'Forms/Checkbox',
7
+ component: Checkbox,
8
+ argTypes: {
9
+ labelText: { control: 'text' },
10
+ checked: { control: 'boolean' },
11
+ indeterminate: { control: 'boolean' },
12
+ disabled: { control: 'boolean' },
13
+ error: { control: 'boolean' }
14
+ },
15
+ args: {
16
+ labelText: 'Accept terms and conditions',
17
+ checked: false,
18
+ indeterminate: false,
19
+ disabled: false,
20
+ error: false
21
+ }
22
+ });
23
+ </script>
24
+
25
+ <Story name="Playground">
26
+ {#snippet template(args)}
27
+ <div class="p-6">
28
+ <Checkbox {...args} />
29
+ </div>
30
+ {/snippet}
31
+ </Story>
32
+
33
+ <Story name="States" asChild>
34
+ <div class="flex flex-col gap-4 p-6">
35
+ <Checkbox labelText="Unchecked" checked={false} />
36
+ <Checkbox labelText="Checked" checked={true} />
37
+ <Checkbox labelText="Indeterminate" indeterminate={true} />
38
+ <Checkbox labelText="Error" checked={true} error />
39
+ <Checkbox labelText="Disabled unchecked" disabled />
40
+ <Checkbox labelText="Disabled checked" checked disabled />
41
+ </div>
42
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Checkbox from './Checkbox.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 Checkbox: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Checkbox = InstanceType<typeof Checkbox>;
19
+ export default Checkbox;
@@ -0,0 +1,41 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Search from './Search.svelte';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'Forms/Search',
7
+ component: Search,
8
+ argTypes: {
9
+ placeholder: { control: 'text' },
10
+ value: { control: 'text' }
11
+ },
12
+ args: {
13
+ placeholder: 'Search',
14
+ value: ''
15
+ }
16
+ });
17
+ </script>
18
+
19
+ <Story name="Playground">
20
+ {#snippet template(args)}
21
+ <div class="max-w-md p-6">
22
+ <Search {...args} />
23
+ </div>
24
+ {/snippet}
25
+ </Story>
26
+
27
+ <Story name="With Value" asChild>
28
+ <div class="max-w-md p-6">
29
+ <Search value="Material Design" />
30
+ </div>
31
+ </Story>
32
+
33
+ <Story name="Custom Icons" asChild>
34
+ <div class="max-w-md p-6">
35
+ <Search
36
+ value="query"
37
+ leadingIconProps={{ name: 'search' }}
38
+ trailingIconProps={{ name: 'mic' }}
39
+ />
40
+ </div>
41
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Search from './Search.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 Search: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Search = InstanceType<typeof Search>;
19
+ export default Search;
@@ -0,0 +1,89 @@
1
+ <!--
2
+ NOTE: Select.svelte renders its Content entirely from the `options` prop — it does not
3
+ expose a `children` snippet, so SelectItem/SelectGroup/SelectLabel/SelectSeparator cannot
4
+ be composed as children of <Select> (unlike Navbar+NavbarItem). Those four are themed
5
+ primitives for consumers who build a custom dropdown directly against bits-ui's
6
+ Select.Root instead of this component. The Playground below uses the actual `options`
7
+ API, which is how this component is meant to be driven.
8
+ -->
9
+ <script module lang="ts">
10
+ import { defineMeta } from '@storybook/addon-svelte-csf';
11
+ import Select from './Select.svelte';
12
+ import type { SelectOption } from './types.js';
13
+
14
+ const fruitOptions: SelectOption[] = [
15
+ { value: 'apple', label: 'Apple' },
16
+ { value: 'banana', label: 'Banana' },
17
+ { value: 'cherry', label: 'Cherry' },
18
+ { value: 'date', label: 'Date', disabled: true }
19
+ ];
20
+
21
+ const groupedOptions: SelectOption[] = [
22
+ {
23
+ type: 'group',
24
+ heading: 'Citrus',
25
+ items: [
26
+ { value: 'orange', label: 'Orange' },
27
+ { value: 'lemon', label: 'Lemon' }
28
+ ]
29
+ },
30
+ {
31
+ type: 'group',
32
+ heading: 'Berries',
33
+ items: [
34
+ { value: 'strawberry', label: 'Strawberry' },
35
+ { value: 'blueberry', label: 'Blueberry' }
36
+ ]
37
+ }
38
+ ];
39
+
40
+ const { Story } = defineMeta({
41
+ title: 'Forms/Select',
42
+ component: Select,
43
+ argTypes: {
44
+ placeholder: { control: 'text' },
45
+ disabled: { control: 'boolean' },
46
+ error: { control: 'boolean' }
47
+ },
48
+ args: {
49
+ type: 'single',
50
+ placeholder: 'Choose a fruit',
51
+ disabled: false,
52
+ error: false,
53
+ options: fruitOptions
54
+ }
55
+ });
56
+ </script>
57
+
58
+ <Story name="Playground">
59
+ {#snippet template(args)}
60
+ <div class="max-w-sm p-6">
61
+ <Select {...args} />
62
+ </div>
63
+ {/snippet}
64
+ </Story>
65
+
66
+ <Story name="Grouped Options" asChild>
67
+ <div class="max-w-sm p-6">
68
+ <Select type="single" placeholder="Choose a fruit" options={groupedOptions} />
69
+ </div>
70
+ </Story>
71
+
72
+ <Story name="With Leading Icon" asChild>
73
+ <div class="max-w-sm p-6">
74
+ <Select
75
+ type="single"
76
+ placeholder="Choose a fruit"
77
+ options={fruitOptions}
78
+ leadingIconProps={{ name: 'nutrition' }}
79
+ />
80
+ </div>
81
+ </Story>
82
+
83
+ <Story name="States" asChild>
84
+ <div class="flex max-w-sm flex-col gap-6 p-6">
85
+ <Select type="single" placeholder="Default" options={fruitOptions} />
86
+ <Select type="single" placeholder="Error" options={fruitOptions} error value="apple" />
87
+ <Select type="single" placeholder="Disabled" options={fruitOptions} disabled />
88
+ </div>
89
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Select from './Select.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 Select: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Select = InstanceType<typeof Select>;
19
+ export default Select;
@@ -47,7 +47,7 @@ Powered by bits-ui for accessibility and behavior.
47
47
  });
48
48
  </script>
49
49
 
50
- <div class={clsx('relative w-full', className)}>
50
+ <div class={cls.root({ class: className })}>
51
51
  <div class={cls.base()}>
52
52
  {#if leadingIconProps}
53
53
  <Icon class={cls.leadingIcon()} {...leadingIconProps} />
@@ -0,0 +1,76 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Slider from './Slider.svelte';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'Forms/Slider',
7
+ component: Slider,
8
+ argTypes: {
9
+ value: { control: 'number' },
10
+ min: { control: 'number' },
11
+ max: { control: 'number' },
12
+ step: { control: 'number' },
13
+ disabled: { control: 'boolean' },
14
+ showValue: { control: 'boolean' },
15
+ size: {
16
+ control: 'select',
17
+ options: ['xs', 's', 'm', 'l', 'xl']
18
+ },
19
+ stops: { control: 'boolean' },
20
+ endStops: { control: 'boolean' },
21
+ vertical: { control: 'boolean' }
22
+ },
23
+ args: {
24
+ value: 40,
25
+ min: 0,
26
+ max: 100,
27
+ disabled: false,
28
+ showValue: true,
29
+ size: 'xs',
30
+ stops: false,
31
+ endStops: true,
32
+ vertical: false
33
+ }
34
+ });
35
+ </script>
36
+
37
+ <Story name="Playground">
38
+ {#snippet template(args)}
39
+ <div class="max-w-sm p-10">
40
+ <Slider {...args} />
41
+ </div>
42
+ {/snippet}
43
+ </Story>
44
+
45
+ <Story name="Sizes" asChild>
46
+ <div class="flex max-w-sm flex-col gap-8 p-10">
47
+ <Slider value={30} size="xs" />
48
+ <Slider value={30} size="s" />
49
+ <Slider value={30} size="m" />
50
+ <Slider value={30} size="l" />
51
+ <Slider value={30} size="xl" />
52
+ </div>
53
+ </Story>
54
+
55
+ <Story name="With Icons" asChild>
56
+ <div class="max-w-sm p-10">
57
+ <Slider
58
+ value={60}
59
+ size="m"
60
+ leadingIconProps={{ name: 'volume_down' }}
61
+ trailingIconProps={{ name: 'volume_up' }}
62
+ />
63
+ </div>
64
+ </Story>
65
+
66
+ <Story name="Discrete With Stops" asChild>
67
+ <div class="max-w-sm p-10">
68
+ <Slider value={40} step={20} stops />
69
+ </div>
70
+ </Story>
71
+
72
+ <Story name="Disabled" asChild>
73
+ <div class="max-w-sm p-10">
74
+ <Slider value={40} disabled />
75
+ </div>
76
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Slider from './Slider.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 Slider: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Slider = InstanceType<typeof Slider>;
19
+ export default Slider;
@@ -0,0 +1,47 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Switch from './Switch.svelte';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'Forms/Switch',
7
+ component: Switch,
8
+ argTypes: {
9
+ checked: { control: 'boolean' },
10
+ disabled: { control: 'boolean' },
11
+ icons: {
12
+ control: 'select',
13
+ options: ['checked', 'both', 'none']
14
+ }
15
+ },
16
+ args: {
17
+ checked: false,
18
+ disabled: false,
19
+ icons: 'checked'
20
+ }
21
+ });
22
+ </script>
23
+
24
+ <Story name="Playground">
25
+ {#snippet template(args)}
26
+ <div class="p-6">
27
+ <Switch {...args} />
28
+ </div>
29
+ {/snippet}
30
+ </Story>
31
+
32
+ <Story name="Icon Modes" asChild>
33
+ <div class="flex flex-col gap-4 p-6">
34
+ <Switch checked icons="checked" />
35
+ <Switch checked icons="both" />
36
+ <Switch checked icons="none" />
37
+ </div>
38
+ </Story>
39
+
40
+ <Story name="States" asChild>
41
+ <div class="flex flex-col gap-4 p-6">
42
+ <Switch checked={false} />
43
+ <Switch checked={true} />
44
+ <Switch checked={false} disabled />
45
+ <Switch checked={true} disabled />
46
+ </div>
47
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Switch from './Switch.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 Switch: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Switch = InstanceType<typeof Switch>;
19
+ export default Switch;
@@ -0,0 +1,74 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Textfield from './Textfield.svelte';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'Forms/Textfield',
7
+ component: Textfield,
8
+ argTypes: {
9
+ label: { control: 'text' },
10
+ placeholder: { control: 'text' },
11
+ disabled: { control: 'boolean' },
12
+ error: { control: 'boolean' },
13
+ required: { control: 'boolean' },
14
+ characterLimit: { control: 'number' }
15
+ },
16
+ args: {
17
+ label: 'Label',
18
+ disabled: false,
19
+ error: false,
20
+ required: false
21
+ }
22
+ });
23
+ </script>
24
+
25
+ <Story name="Playground">
26
+ {#snippet template(args)}
27
+ <div class="max-w-sm p-6">
28
+ <Textfield {...args} />
29
+ </div>
30
+ {/snippet}
31
+ </Story>
32
+
33
+ <Story name="With Supporting Text" asChild>
34
+ <div class="max-w-sm p-6">
35
+ <Textfield label="Email">
36
+ {#snippet supportingText()}
37
+ We'll never share your email.
38
+ {/snippet}
39
+ </Textfield>
40
+ </div>
41
+ </Story>
42
+
43
+ <Story name="With Icons" asChild>
44
+ <div class="max-w-sm p-6">
45
+ <Textfield
46
+ label="Search"
47
+ leadingIconProps={{ name: 'search' }}
48
+ trailingIconProps={{ name: 'close' }}
49
+ />
50
+ </div>
51
+ </Story>
52
+
53
+ <Story name="Character Limit" asChild>
54
+ <div class="max-w-sm p-6">
55
+ <Textfield label="Bio" characterLimit={80} value="">
56
+ {#snippet supportingText()}
57
+ Keep it short.
58
+ {/snippet}
59
+ </Textfield>
60
+ </div>
61
+ </Story>
62
+
63
+ <Story name="States" asChild>
64
+ <div class="flex max-w-sm flex-col gap-6 p-6">
65
+ <Textfield label="Default" />
66
+ <Textfield label="Required" required />
67
+ <Textfield label="Error" error value="Invalid value">
68
+ {#snippet supportingText()}
69
+ This field is required.
70
+ {/snippet}
71
+ </Textfield>
72
+ <Textfield label="Disabled" disabled value="Can't edit" />
73
+ </div>
74
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Textfield from './Textfield.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 Textfield: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Textfield = InstanceType<typeof Textfield>;
19
+ export default Textfield;
@@ -14,6 +14,7 @@ Avatars can be used to represent people or objects.
14
14
  src,
15
15
  alt = 'User avatar',
16
16
  seed = 'ogonek',
17
+ dicebearStyle = 'shapes',
17
18
  size = 'lg',
18
19
  loadingStatus = $bindable('loading'),
19
20
  class: className,
@@ -22,7 +23,6 @@ Avatars can be used to represent people or objects.
22
23
  }: AvatarProps = $props();
23
24
 
24
25
  const materialPalette = ['e8f0fe', 'e8f5e9', 'fff7e6', 'fde7ec', 'e3f2fd'];
25
- const dicebearBaseUrl = 'https://api.dicebear.com/9.x/shapes/svg';
26
26
  const sizeMap = {
27
27
  sm: 48,
28
28
  md: 72,
@@ -38,7 +38,7 @@ Avatars can be used to represent people or objects.
38
38
  backgroundColor: materialPalette.join(',')
39
39
  });
40
40
 
41
- return `${dicebearBaseUrl}?${params.toString()}`;
41
+ return `https://api.dicebear.com/9.x/${dicebearStyle}/svg?${params.toString()}`;
42
42
  });
43
43
 
44
44
  const { root, image, fallback, button } = $derived(avatar({ size }));