@svelte-atoms/core 1.0.0-alpha.32 → 1.0.0-alpha.34
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/dist/components/atom/html-atom.svelte +95 -93
- package/dist/components/atom/html-atom.svelte.d.ts +1 -1
- package/dist/components/button/button.svelte +31 -31
- package/dist/components/chip/chip.svelte +41 -0
- package/dist/components/chip/chip.svelte.d.ts +6 -0
- package/dist/components/chip/index.d.ts +1 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/chip/types.d.ts +11 -0
- package/dist/components/chip/types.js +1 -0
- package/dist/components/combobox/atoms.d.ts +2 -1
- package/dist/components/combobox/atoms.js +2 -1
- package/dist/components/combobox/bond.svelte.d.ts +16 -13
- package/dist/components/combobox/bond.svelte.js +57 -13
- package/dist/components/combobox/combobox-control.svelte +27 -13
- package/dist/components/combobox/combobox-control.svelte.d.ts +2 -10
- package/dist/components/combobox/combobox-item.svelte +3 -3
- package/dist/components/combobox/combobox-root.svelte +65 -65
- package/dist/components/combobox/combobox-root.svelte.d.ts +4 -4
- package/dist/components/combobox/combobox-selections.svelte +17 -0
- package/dist/components/combobox/combobox-selections.svelte.d.ts +4 -0
- package/dist/components/combobox/combobox.stories.svelte +25 -12
- package/dist/components/combobox/types.d.ts +17 -3
- package/dist/components/date-picker/bond.svelte.js +2 -1
- package/dist/components/date-picker/date-picker-calendar.svelte +60 -67
- package/dist/components/dropdown/atoms.d.ts +2 -3
- package/dist/components/dropdown/atoms.js +3 -3
- package/dist/components/dropdown/bond.svelte.d.ts +4 -4
- package/dist/components/dropdown/bond.svelte.js +10 -11
- package/dist/components/dropdown/dropdown-query.svelte +43 -54
- package/dist/components/dropdown/dropdown-query.svelte.d.ts +3 -34
- package/dist/components/dropdown/dropdown-root.svelte +15 -2
- package/dist/components/dropdown/dropdown-root.svelte.d.ts +4 -16
- package/dist/components/dropdown/dropdown-selection.svelte +55 -0
- package/dist/components/dropdown/{dropdown-value.svelte.d.ts → dropdown-selection.svelte.d.ts} +5 -15
- package/dist/components/dropdown/dropdown-selections.svelte +62 -0
- package/dist/components/dropdown/dropdown-selections.svelte.d.ts +5 -0
- package/dist/components/dropdown/dropdown.stories.svelte +93 -49
- package/dist/components/dropdown/index.d.ts +5 -1
- package/dist/components/dropdown/index.js +5 -1
- package/dist/components/dropdown/item/controller.svelte.d.ts +1 -1
- package/dist/components/dropdown/item/controller.svelte.js +2 -2
- package/dist/components/dropdown/item/dropdown-item.svelte +0 -2
- package/dist/components/dropdown/runes.svelte.d.ts +6 -2
- package/dist/components/dropdown/runes.svelte.js +1 -1
- package/dist/components/dropdown/types.d.ts +34 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/menu/bond.svelte.js +4 -2
- package/dist/components/menu/item/controller.svelte.d.ts +1 -0
- package/dist/components/menu/item/controller.svelte.js +5 -0
- package/dist/components/popover/bond.svelte.js +1 -2
- package/dist/components/root/root.css +119 -119
- package/dist/components/stepper/README.md +38 -0
- package/dist/components/stepper/atoms.d.ts +5 -0
- package/dist/components/stepper/atoms.js +5 -0
- package/dist/components/stepper/attachments.svelte.d.ts +2 -0
- package/dist/components/stepper/attachments.svelte.js +5 -0
- package/dist/components/stepper/bond.svelte.d.ts +56 -0
- package/dist/components/stepper/bond.svelte.js +99 -0
- package/dist/components/stepper/index.d.ts +3 -0
- package/dist/components/stepper/index.js +3 -0
- package/dist/components/stepper/step/README.md +97 -0
- package/dist/components/stepper/step/atoms.d.ts +7 -0
- package/dist/components/stepper/step/atoms.js +7 -0
- package/dist/components/stepper/step/attachments.svelte.d.ts +2 -0
- package/dist/components/stepper/step/attachments.svelte.js +5 -0
- package/dist/components/stepper/step/bond.svelte.d.ts +99 -0
- package/dist/components/stepper/step/bond.svelte.js +153 -0
- package/dist/components/stepper/step/index.d.ts +3 -0
- package/dist/components/stepper/step/index.js +2 -0
- package/dist/components/stepper/step/step-body.svelte +39 -0
- package/dist/components/stepper/step/step-body.svelte.d.ts +26 -0
- package/dist/components/stepper/step/step-description.svelte +33 -0
- package/dist/components/stepper/step/step-description.svelte.d.ts +26 -0
- package/dist/components/stepper/step/step-header.svelte +34 -0
- package/dist/components/stepper/step/step-header.svelte.d.ts +26 -0
- package/dist/components/stepper/step/step-indicator.svelte +63 -0
- package/dist/components/stepper/step/step-indicator.svelte.d.ts +26 -0
- package/dist/components/stepper/step/step-root.svelte +42 -0
- package/dist/components/stepper/step/step-root.svelte.d.ts +31 -0
- package/dist/components/stepper/step/step-separator.svelte +48 -0
- package/dist/components/stepper/step/step-separator.svelte.d.ts +26 -0
- package/dist/components/stepper/step/step-title.svelte +33 -0
- package/dist/components/stepper/step/step-title.svelte.d.ts +26 -0
- package/dist/components/stepper/step/types.d.ts +91 -0
- package/dist/components/stepper/step/types.js +1 -0
- package/dist/components/stepper/stepper-body.svelte +43 -0
- package/dist/components/stepper/stepper-body.svelte.d.ts +26 -0
- package/dist/components/stepper/stepper-content.svelte +45 -0
- package/dist/components/stepper/stepper-content.svelte.d.ts +26 -0
- package/dist/components/stepper/stepper-footer.svelte +31 -0
- package/dist/components/stepper/stepper-footer.svelte.d.ts +26 -0
- package/dist/components/stepper/stepper-header.svelte +39 -0
- package/dist/components/stepper/stepper-header.svelte.d.ts +26 -0
- package/dist/components/stepper/stepper-root.svelte +60 -0
- package/dist/components/stepper/stepper-root.svelte.d.ts +31 -0
- package/dist/components/stepper/stepper.stories.svelte +264 -0
- package/dist/components/stepper/stepper.stories.svelte.d.ts +4 -0
- package/dist/components/stepper/types.d.ts +63 -0
- package/dist/components/stepper/types.js +1 -0
- package/dist/components/tabs/atoms.d.ts +1 -0
- package/dist/components/tabs/atoms.js +1 -0
- package/dist/components/tabs/bond.svelte.d.ts +18 -5
- package/dist/components/tabs/bond.svelte.js +13 -0
- package/dist/components/tabs/tab/bond.svelte.d.ts +7 -7
- package/dist/components/tabs/tab/bond.svelte.js +9 -15
- package/dist/components/tabs/tab/tab-body.svelte +43 -52
- package/dist/components/tabs/tab/tab-description.svelte +33 -41
- package/dist/components/tabs/tab/tab-header.svelte +61 -71
- package/dist/components/tabs/tab/tab-header.svelte.d.ts +1 -1
- package/dist/components/tabs/tab/tab-root.svelte +51 -86
- package/dist/components/tabs/tab/tab-root.svelte.d.ts +1 -7
- package/dist/components/tabs/tabs-body.svelte +35 -41
- package/dist/components/tabs/tabs-body.svelte.d.ts +2 -11
- package/dist/components/tabs/tabs-content.svelte +51 -0
- package/dist/components/tabs/tabs-content.svelte.d.ts +26 -0
- package/dist/components/tabs/tabs-header.svelte +32 -40
- package/dist/components/tabs/tabs-header.svelte.d.ts +2 -10
- package/dist/components/tabs/tabs-root.svelte +55 -66
- package/dist/components/tabs/tabs-root.svelte.d.ts +5 -16
- package/dist/components/tabs/tabs.stories.svelte +70 -56
- package/dist/components/tabs/types.d.ts +24 -29
- package/dist/context/preset.svelte.d.ts +1 -1
- package/package.json +33 -6
- package/dist/components/dropdown/dropdown-value.svelte +0 -60
- package/dist/components/dropdown/dropdown-values.svelte +0 -17
- package/dist/components/dropdown/dropdown-values.svelte.d.ts +0 -5
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
--background: oklch(1 0 0);
|
|
5
|
-
--foreground: oklch(0.145 0 0);
|
|
6
|
-
--card: oklch(1 0 0);
|
|
7
|
-
--card-foreground: oklch(0.145 0 0);
|
|
8
|
-
--popover: oklch(1 0 0);
|
|
9
|
-
--popover-foreground: oklch(0.145 0 0);
|
|
10
|
-
--primary: oklch(0.205 0 0);
|
|
11
|
-
--primary-foreground: oklch(0.985 0 0);
|
|
12
|
-
--secondary: oklch(0.97 0 0);
|
|
13
|
-
--secondary-foreground: oklch(0.205 0 0);
|
|
14
|
-
--muted: oklch(0.97 0 0);
|
|
15
|
-
--muted-foreground: oklch(0.556 0 0);
|
|
16
|
-
--accent: oklch(0.97 0 0);
|
|
17
|
-
--accent-foreground: oklch(0.205 0 0);
|
|
18
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
19
|
-
--destructive-foreground: oklch(1 0 0);
|
|
20
|
-
--border: oklch(0.922 0 0);
|
|
21
|
-
--input: oklch(0.99 0 0);
|
|
22
|
-
--ring: oklch(0.708 0 0);
|
|
23
|
-
--chart-1: oklch(0.646 0.222 41.116);
|
|
24
|
-
--chart-2: oklch(0.6 0.118 184.704);
|
|
25
|
-
--chart-3: oklch(0.398 0.07 227.392);
|
|
26
|
-
--chart-4: oklch(0.828 0.189 84.429);
|
|
27
|
-
--chart-5: oklch(0.769 0.188 70.08);
|
|
28
|
-
--radius: 0.625rem;
|
|
29
|
-
--sidebar: oklch(0.985 0 0);
|
|
30
|
-
--sidebar-foreground: oklch(0.145 0 0);
|
|
31
|
-
--sidebar-primary: oklch(0.205 0 0);
|
|
32
|
-
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
33
|
-
--sidebar-accent: oklch(0.97 0 0);
|
|
34
|
-
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
35
|
-
--sidebar-border: oklch(0.922 0 0);
|
|
36
|
-
--sidebar-ring: oklch(0.708 0 0);
|
|
37
|
-
--radius: 0.625rem;
|
|
38
|
-
--shadow-x: 0px;
|
|
39
|
-
--shadow-y: 1px;
|
|
40
|
-
--shadow-blur: 2px;
|
|
41
|
-
--shadow-spread: 0px;
|
|
42
|
-
--shadow-opacity: 0.18;
|
|
43
|
-
--shadow-color: hsl(0 0% 0%);
|
|
44
|
-
--tracking-normal: 0em;
|
|
45
|
-
--spacing: 0.25rem;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.dark {
|
|
49
|
-
--background: oklch(0.145 0 0);
|
|
50
|
-
--foreground: oklch(0.985 0 0);
|
|
51
|
-
--card: oklch(0.205 0 0);
|
|
52
|
-
--card-foreground: oklch(0.985 0 0);
|
|
53
|
-
--popover: oklch(0.205 0 0);
|
|
54
|
-
--popover-foreground: oklch(0.985 0 0);
|
|
55
|
-
--primary: oklch(0.922 0 0);
|
|
56
|
-
--primary-foreground: oklch(0.205 0 0);
|
|
57
|
-
--secondary: oklch(0.269 0 0);
|
|
58
|
-
--secondary-foreground: oklch(0.985 0 0);
|
|
59
|
-
--muted: oklch(0.269 0 0);
|
|
60
|
-
--muted-foreground: oklch(0.708 0 0);
|
|
61
|
-
--accent: oklch(0.269 0 0);
|
|
62
|
-
--accent-foreground: oklch(0.985 0 0);
|
|
63
|
-
--destructive: oklch(0.704 0.191 22.216);
|
|
64
|
-
--destructive-foreground: oklch(0.985 0 0);
|
|
65
|
-
--border: oklch(1 0 0 / 10%);
|
|
66
|
-
--input: oklch(1 0 0 / 5%);
|
|
67
|
-
--ring: oklch(0.556 0 0);
|
|
68
|
-
--chart-1: oklch(0.488 0.243 264.376);
|
|
69
|
-
--chart-2: oklch(0.696 0.17 162.48);
|
|
70
|
-
--chart-3: oklch(0.769 0.188 70.08);
|
|
71
|
-
--chart-4: oklch(0.627 0.265 303.9);
|
|
72
|
-
--chart-5: oklch(0.645 0.246 16.439);
|
|
73
|
-
--sidebar: oklch(0.205 0 0);
|
|
74
|
-
--sidebar-foreground: oklch(0.985 0 0);
|
|
75
|
-
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
76
|
-
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
77
|
-
--sidebar-accent: oklch(0.269 0 0);
|
|
78
|
-
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
79
|
-
--sidebar-border: oklch(1 0 0 / 10%);
|
|
80
|
-
--sidebar-ring: oklch(0.556 0 0);
|
|
81
|
-
--shadow-color: hsl(0, 0%, 100%);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@theme inline {
|
|
85
|
-
--color-background: var(--background);
|
|
86
|
-
--color-foreground: var(--foreground);
|
|
87
|
-
--color-card: var(--card);
|
|
88
|
-
--color-card-foreground: var(--card-foreground);
|
|
89
|
-
--color-popover: var(--popover);
|
|
90
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
91
|
-
--color-primary: var(--primary);
|
|
92
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
93
|
-
--color-secondary: var(--secondary);
|
|
94
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
95
|
-
--color-muted: var(--muted);
|
|
96
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
97
|
-
--color-accent: var(--accent);
|
|
98
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
99
|
-
--color-destructive: var(--destructive);
|
|
100
|
-
--color-destructive-foreground: var(--destructive-foreground);
|
|
101
|
-
--color-border: var(--border);
|
|
102
|
-
--color-input: var(--input);
|
|
103
|
-
--color-ring: var(--ring);
|
|
104
|
-
--color-chart-1: var(--chart-1);
|
|
105
|
-
--color-chart-2: var(--chart-2);
|
|
106
|
-
--color-chart-3: var(--chart-3);
|
|
107
|
-
--color-chart-4: var(--chart-4);
|
|
108
|
-
--color-chart-5: var(--chart-5);
|
|
109
|
-
--color-sidebar: var(--sidebar);
|
|
110
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
111
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
112
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
113
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
114
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
115
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
116
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
117
|
-
|
|
118
|
-
--radius-inherit: inherit;
|
|
119
|
-
}
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--background: oklch(1 0 0);
|
|
5
|
+
--foreground: oklch(0.145 0 0);
|
|
6
|
+
--card: oklch(1 0 0);
|
|
7
|
+
--card-foreground: oklch(0.145 0 0);
|
|
8
|
+
--popover: oklch(1 0 0);
|
|
9
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
10
|
+
--primary: oklch(0.205 0 0);
|
|
11
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
12
|
+
--secondary: oklch(0.97 0 0);
|
|
13
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
14
|
+
--muted: oklch(0.97 0 0);
|
|
15
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
16
|
+
--accent: oklch(0.97 0 0);
|
|
17
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
18
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
19
|
+
--destructive-foreground: oklch(1 0 0);
|
|
20
|
+
--border: oklch(0.922 0 0);
|
|
21
|
+
--input: oklch(0.99 0 0);
|
|
22
|
+
--ring: oklch(0.708 0 0);
|
|
23
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
24
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
25
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
26
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
27
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
28
|
+
--radius: 0.625rem;
|
|
29
|
+
--sidebar: oklch(0.985 0 0);
|
|
30
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
31
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
32
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
33
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
34
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
35
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
36
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
37
|
+
--radius: 0.625rem;
|
|
38
|
+
--shadow-x: 0px;
|
|
39
|
+
--shadow-y: 1px;
|
|
40
|
+
--shadow-blur: 2px;
|
|
41
|
+
--shadow-spread: 0px;
|
|
42
|
+
--shadow-opacity: 0.18;
|
|
43
|
+
--shadow-color: hsl(0 0% 0%);
|
|
44
|
+
--tracking-normal: 0em;
|
|
45
|
+
--spacing: 0.25rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dark {
|
|
49
|
+
--background: oklch(0.145 0 0);
|
|
50
|
+
--foreground: oklch(0.985 0 0);
|
|
51
|
+
--card: oklch(0.205 0 0);
|
|
52
|
+
--card-foreground: oklch(0.985 0 0);
|
|
53
|
+
--popover: oklch(0.205 0 0);
|
|
54
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
55
|
+
--primary: oklch(0.922 0 0);
|
|
56
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
57
|
+
--secondary: oklch(0.269 0 0);
|
|
58
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
59
|
+
--muted: oklch(0.269 0 0);
|
|
60
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
61
|
+
--accent: oklch(0.269 0 0);
|
|
62
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
63
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
64
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
65
|
+
--border: oklch(1 0 0 / 10%);
|
|
66
|
+
--input: oklch(1 0 0 / 5%);
|
|
67
|
+
--ring: oklch(0.556 0 0);
|
|
68
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
69
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
70
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
71
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
72
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
73
|
+
--sidebar: oklch(0.205 0 0);
|
|
74
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
75
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
76
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
77
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
78
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
79
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
80
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
81
|
+
--shadow-color: hsl(0, 0%, 100%);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@theme inline {
|
|
85
|
+
--color-background: var(--background);
|
|
86
|
+
--color-foreground: var(--foreground);
|
|
87
|
+
--color-card: var(--card);
|
|
88
|
+
--color-card-foreground: var(--card-foreground);
|
|
89
|
+
--color-popover: var(--popover);
|
|
90
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
91
|
+
--color-primary: var(--primary);
|
|
92
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
93
|
+
--color-secondary: var(--secondary);
|
|
94
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
95
|
+
--color-muted: var(--muted);
|
|
96
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
97
|
+
--color-accent: var(--accent);
|
|
98
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
99
|
+
--color-destructive: var(--destructive);
|
|
100
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
101
|
+
--color-border: var(--border);
|
|
102
|
+
--color-input: var(--input);
|
|
103
|
+
--color-ring: var(--ring);
|
|
104
|
+
--color-chart-1: var(--chart-1);
|
|
105
|
+
--color-chart-2: var(--chart-2);
|
|
106
|
+
--color-chart-3: var(--chart-3);
|
|
107
|
+
--color-chart-4: var(--chart-4);
|
|
108
|
+
--color-chart-5: var(--chart-5);
|
|
109
|
+
--color-sidebar: var(--sidebar);
|
|
110
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
111
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
112
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
113
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
114
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
115
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
116
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
117
|
+
|
|
118
|
+
--radius-inherit: inherit;
|
|
119
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
A flexible stepper component for building multi-step workflows, forms, and guided processes. The stepper module provides a complete set of composable components to create linear or non-linear step-based interfaces.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
The stepper module consists of two main components and their sub-components:
|
|
8
|
+
|
|
9
|
+
### Stepper (Root Container)
|
|
10
|
+
|
|
11
|
+
The main container component that manages the overall stepper state and layout.
|
|
12
|
+
|
|
13
|
+
- **`Stepper.Root`** - The root stepper container
|
|
14
|
+
- **`Stepper.Header`** - Container for step indicators/navigation
|
|
15
|
+
- **`Stepper.Body`** - Container for step content
|
|
16
|
+
- **`Stepper.Content`** - Individual step content wrapper
|
|
17
|
+
- **`Stepper.Footer`** - Container for navigation buttons/actions
|
|
18
|
+
|
|
19
|
+
### Step (Individual Step)
|
|
20
|
+
|
|
21
|
+
Represents a single step in the workflow with its own state and content.
|
|
22
|
+
|
|
23
|
+
- **`Step.Root`** - The root step container
|
|
24
|
+
- **`Step.Header`** - Step header with title/indicator
|
|
25
|
+
- **`Step.Title`** - Step title text
|
|
26
|
+
- **`Step.Description`** - Step description/subtitle
|
|
27
|
+
- **`Step.Indicator`** - Visual step indicator (number, icon, status)
|
|
28
|
+
- **`Step.Separator`** - Visual separator between steps
|
|
29
|
+
- **`Step.Body`** - Step content area
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- **Flexible Layout** - Horizontal or vertical orientation
|
|
34
|
+
- **State Management** - Built-in step state (active, completed, disabled, optional)
|
|
35
|
+
- **Navigation Control** - Linear or non-linear step progression
|
|
36
|
+
- **Composable** - Mix and match components to build custom steppers
|
|
37
|
+
- **Accessible** - ARIA attributes and keyboard navigation support
|
|
38
|
+
- **Customizable** - Full control over styling and behavior through the atoms system
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Root } from './stepper-root.svelte';
|
|
2
|
+
export { default as Header } from './stepper-header.svelte';
|
|
3
|
+
export { default as Body } from './stepper-body.svelte';
|
|
4
|
+
export { default as Content } from './stepper-content.svelte';
|
|
5
|
+
export { default as Footer } from './stepper-footer.svelte';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Root } from './stepper-root.svelte';
|
|
2
|
+
export { default as Header } from './stepper-header.svelte';
|
|
3
|
+
export { default as Body } from './stepper-body.svelte';
|
|
4
|
+
export { default as Content } from './stepper-content.svelte';
|
|
5
|
+
export { default as Footer } from './stepper-footer.svelte';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StepBond } from './step/bond.svelte';
|
|
2
|
+
import { Bond, BondState, type BondStateProps } from '../../shared/bond.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
export type StepperStateProps = BondStateProps & {
|
|
5
|
+
step: number;
|
|
6
|
+
linear?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type StepperElements = {
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
export type StepContentSnippet = {
|
|
12
|
+
props: Record<string, unknown>;
|
|
13
|
+
children: Snippet<[{
|
|
14
|
+
step?: StepBond;
|
|
15
|
+
}]>;
|
|
16
|
+
};
|
|
17
|
+
export declare class StepperBond extends Bond<StepperStateProps, StepperState, StepperElements> {
|
|
18
|
+
static CONTEXT_KEY: string;
|
|
19
|
+
constructor(s: StepperState);
|
|
20
|
+
share(): this;
|
|
21
|
+
root(): {
|
|
22
|
+
[x: symbol]: (node: HTMLElement) => void;
|
|
23
|
+
'data-atom': string;
|
|
24
|
+
id: string;
|
|
25
|
+
role: string;
|
|
26
|
+
};
|
|
27
|
+
static get(): StepperBond | undefined;
|
|
28
|
+
static set(bond: StepperBond): StepperBond;
|
|
29
|
+
}
|
|
30
|
+
export declare class StepperState extends BondState<StepperStateProps> {
|
|
31
|
+
#private;
|
|
32
|
+
constructor(props: () => StepperStateProps);
|
|
33
|
+
get activeStep(): number;
|
|
34
|
+
get totalSteps(): number;
|
|
35
|
+
get isFirstStep(): boolean;
|
|
36
|
+
get isLastStep(): boolean;
|
|
37
|
+
get activeStepContent(): {
|
|
38
|
+
props: Record<string, unknown>;
|
|
39
|
+
children: Snippet<[{
|
|
40
|
+
step?: StepBond;
|
|
41
|
+
}]>;
|
|
42
|
+
} | undefined;
|
|
43
|
+
get navigation(): {
|
|
44
|
+
next: () => void;
|
|
45
|
+
previous: () => void;
|
|
46
|
+
reset: () => void;
|
|
47
|
+
goto: (step: number) => void;
|
|
48
|
+
};
|
|
49
|
+
mountStep(index: number, step: StepBond): void;
|
|
50
|
+
unmountStep(index: number): void;
|
|
51
|
+
getStep(index: number): StepBond | undefined;
|
|
52
|
+
registerStepContent(index: number, props: Record<string, unknown>, children: Snippet<[{
|
|
53
|
+
step?: StepBond;
|
|
54
|
+
}]>): void;
|
|
55
|
+
unregisterStepContent(index: number): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
2
|
+
import { createAttachmentKey } from 'svelte/attachments';
|
|
3
|
+
import { Bond, BondState } from '../../shared/bond.svelte';
|
|
4
|
+
import { getContext, setContext } from 'svelte';
|
|
5
|
+
export class StepperBond extends Bond {
|
|
6
|
+
static CONTEXT_KEY = '@atoms/context/stepper';
|
|
7
|
+
constructor(s) {
|
|
8
|
+
super(s);
|
|
9
|
+
}
|
|
10
|
+
share() {
|
|
11
|
+
return StepperBond.set(this);
|
|
12
|
+
}
|
|
13
|
+
root() {
|
|
14
|
+
return {
|
|
15
|
+
'data-atom': this.id ?? '',
|
|
16
|
+
id: `stepper-${this.id}`,
|
|
17
|
+
role: 'group',
|
|
18
|
+
[createAttachmentKey()]: (node) => {
|
|
19
|
+
this.elements.root = node;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get() {
|
|
24
|
+
return getContext(StepperBond.CONTEXT_KEY);
|
|
25
|
+
}
|
|
26
|
+
static set(bond) {
|
|
27
|
+
return setContext(StepperBond.CONTEXT_KEY, bond);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class StepperState extends BondState {
|
|
31
|
+
#steps = new SvelteMap();
|
|
32
|
+
#stepContents = new SvelteMap();
|
|
33
|
+
#totalSteps = $state(0);
|
|
34
|
+
constructor(props) {
|
|
35
|
+
super(props);
|
|
36
|
+
}
|
|
37
|
+
get activeStep() {
|
|
38
|
+
return this.props.step;
|
|
39
|
+
}
|
|
40
|
+
get totalSteps() {
|
|
41
|
+
return this.#totalSteps;
|
|
42
|
+
}
|
|
43
|
+
get isFirstStep() {
|
|
44
|
+
return this.props.step === 0;
|
|
45
|
+
}
|
|
46
|
+
get isLastStep() {
|
|
47
|
+
return this.props.step === this.#totalSteps - 1;
|
|
48
|
+
}
|
|
49
|
+
get activeStepContent() {
|
|
50
|
+
return this.#stepContents.get(this.props.step);
|
|
51
|
+
}
|
|
52
|
+
get navigation() {
|
|
53
|
+
return {
|
|
54
|
+
next: () => {
|
|
55
|
+
if (!this.isLastStep) {
|
|
56
|
+
this.props.step = this.props.step + 1;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
previous: () => {
|
|
60
|
+
if (!this.isFirstStep) {
|
|
61
|
+
this.props.step = this.props.step - 1;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
reset: () => {
|
|
65
|
+
this.props.step = 0;
|
|
66
|
+
},
|
|
67
|
+
goto: (step) => {
|
|
68
|
+
if (step >= 0 && step < this.#totalSteps) {
|
|
69
|
+
// In linear mode, only allow going to previous steps or next immediate step
|
|
70
|
+
if (this.props.linear) {
|
|
71
|
+
if (step <= this.props.step + 1) {
|
|
72
|
+
this.props.step = step;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.props.step = step;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
mountStep(index, step) {
|
|
83
|
+
this.#steps.set(index, step);
|
|
84
|
+
this.#totalSteps = this.#steps.size;
|
|
85
|
+
}
|
|
86
|
+
unmountStep(index) {
|
|
87
|
+
this.#steps.delete(index);
|
|
88
|
+
this.#totalSteps = this.#steps.size;
|
|
89
|
+
}
|
|
90
|
+
getStep(index) {
|
|
91
|
+
return this.#steps.get(index);
|
|
92
|
+
}
|
|
93
|
+
registerStepContent(index, props, children) {
|
|
94
|
+
this.#stepContents.set(index, { props, children });
|
|
95
|
+
}
|
|
96
|
+
unregisterStepContent(index) {
|
|
97
|
+
this.#stepContents.delete(index);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Step
|
|
2
|
+
|
|
3
|
+
The Step component represents an individual step within a Stepper workflow. It manages its own state (active, completed, disabled, optional) and provides a composable structure for building step indicators, headers, and content.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Steps are typically used within a `Stepper.Root` component to create multi-step workflows. Each step can display an indicator, title, description, and content.
|
|
8
|
+
|
|
9
|
+
```svelte
|
|
10
|
+
<script>
|
|
11
|
+
import { Stepper, Step } from '@svelte-atoms/core';
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Stepper.Root>
|
|
15
|
+
<Step.Root index={0} header="Account Setup" body="Create your account">
|
|
16
|
+
{#snippet children({ step })}
|
|
17
|
+
<Step.Header>
|
|
18
|
+
<Step.Indicator />
|
|
19
|
+
<Step.Separator />
|
|
20
|
+
|
|
21
|
+
<div>
|
|
22
|
+
<Step.Title>Account Setup</Step.Title>
|
|
23
|
+
<Step.Description>Create your account</Step.Description>
|
|
24
|
+
</div>
|
|
25
|
+
</Step.Header>
|
|
26
|
+
|
|
27
|
+
<Step.Body>
|
|
28
|
+
<!-- Step content goes here -->
|
|
29
|
+
</Step.Body>
|
|
30
|
+
{/snippet}
|
|
31
|
+
</Step.Root>
|
|
32
|
+
</Stepper.Root>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Components
|
|
36
|
+
|
|
37
|
+
### Step.Root
|
|
38
|
+
|
|
39
|
+
The root container for a step. Manages step state and provides context to child components.
|
|
40
|
+
|
|
41
|
+
**Props:**
|
|
42
|
+
- `index` - Step index in the stepper sequence
|
|
43
|
+
- `header` - Step header text
|
|
44
|
+
- `body` - Step body/description text
|
|
45
|
+
- `optional` - Whether the step is optional
|
|
46
|
+
- `disabled` - Whether the step is disabled
|
|
47
|
+
|
|
48
|
+
### Step.Header
|
|
49
|
+
|
|
50
|
+
Container for the step's header section, typically containing the indicator, title, and description.
|
|
51
|
+
|
|
52
|
+
### Step.Indicator
|
|
53
|
+
|
|
54
|
+
Visual indicator showing the step's state (number, icon, checkmark for completed steps).
|
|
55
|
+
|
|
56
|
+
### Step.Separator
|
|
57
|
+
|
|
58
|
+
Visual separator line between step indicators, typically used in horizontal steppers.
|
|
59
|
+
|
|
60
|
+
### Step.Title
|
|
61
|
+
|
|
62
|
+
The main title/label for the step.
|
|
63
|
+
|
|
64
|
+
### Step.Description
|
|
65
|
+
|
|
66
|
+
Secondary description or subtitle for the step.
|
|
67
|
+
|
|
68
|
+
### Step.Body
|
|
69
|
+
|
|
70
|
+
Container for the step's main content area. This content is rendered when the step is active.
|
|
71
|
+
|
|
72
|
+
## Step States
|
|
73
|
+
|
|
74
|
+
Each step can be in one of several states:
|
|
75
|
+
|
|
76
|
+
- **Active** - Currently visible/selected step
|
|
77
|
+
- **Completed** - Step that has been completed
|
|
78
|
+
- **Disabled** - Step that cannot be accessed
|
|
79
|
+
- **Optional** - Step that can be skipped
|
|
80
|
+
- **Pending** - Step that hasn't been reached yet
|
|
81
|
+
|
|
82
|
+
## Integration
|
|
83
|
+
|
|
84
|
+
Steps work seamlessly with the Stepper component's navigation system. The step's state is automatically managed based on the active step index and user interactions.
|
|
85
|
+
|
|
86
|
+
```svelte
|
|
87
|
+
<Step.Root index={0}>
|
|
88
|
+
{#snippet children({ step })}
|
|
89
|
+
{@const isActive = step?.state?.isActive}
|
|
90
|
+
{@const isCompleted = step?.state?.isCompleted}
|
|
91
|
+
|
|
92
|
+
<Step.Title class={isActive ? 'font-bold' : ''}>
|
|
93
|
+
Step 1
|
|
94
|
+
</Step.Title>
|
|
95
|
+
{/snippet}
|
|
96
|
+
</Step.Root>
|
|
97
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Root } from './step-root.svelte';
|
|
2
|
+
export { default as Indicator } from './step-indicator.svelte';
|
|
3
|
+
export { default as Header } from './step-header.svelte';
|
|
4
|
+
export { default as Separator } from './step-separator.svelte';
|
|
5
|
+
export { default as Body } from './step-body.svelte';
|
|
6
|
+
export { default as Title } from './step-title.svelte';
|
|
7
|
+
export { default as Description } from './step-description.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Root } from './step-root.svelte';
|
|
2
|
+
export { default as Indicator } from './step-indicator.svelte';
|
|
3
|
+
export { default as Header } from './step-header.svelte';
|
|
4
|
+
export { default as Separator } from './step-separator.svelte';
|
|
5
|
+
export { default as Body } from './step-body.svelte';
|
|
6
|
+
export { default as Title } from './step-title.svelte';
|
|
7
|
+
export { default as Description } from './step-description.svelte';
|