@getmicdrop/svelte-components 5.0.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/primitives/Button/Button.stories.svelte +46 -79
- package/dist/primitives/Button/Button.stories.svelte.d.ts.map +1 -1
- package/dist/primitives/Button/Button.svelte +11 -5
- package/dist/primitives/Button/Button.svelte.d.ts +2 -0
- package/dist/primitives/Button/Button.svelte.d.ts.map +1 -1
- package/dist/primitives/Button/ButtonVariantShowcase.svelte +137 -0
- package/dist/primitives/Button/ButtonVariantShowcase.svelte.d.ts +27 -0
- package/dist/primitives/Button/ButtonVariantShowcase.svelte.d.ts.map +1 -0
- package/dist/recipes/SuperLogin/SuperLogin.svelte +5 -5
- package/dist/stories/ButtonAuditDashboard.stories.svelte +14 -0
- package/dist/stories/ButtonAuditDashboard.stories.svelte.d.ts +28 -0
- package/dist/stories/ButtonAuditDashboard.stories.svelte.d.ts.map +1 -0
- package/dist/stories/ButtonAuditDashboard.svelte +444 -0
- package/dist/stories/ButtonAuditDashboard.svelte.d.ts +7 -0
- package/dist/stories/ButtonAuditDashboard.svelte.d.ts.map +1 -0
- package/dist/stories/ButtonAuditReview.stories.svelte +14 -0
- package/dist/stories/ButtonAuditReview.stories.svelte.d.ts +28 -0
- package/dist/stories/ButtonAuditReview.stories.svelte.d.ts.map +1 -0
- package/dist/stories/ButtonAuditReview.svelte +463 -0
- package/dist/stories/ButtonAuditReview.svelte.d.ts +7 -0
- package/dist/stories/ButtonAuditReview.svelte.d.ts.map +1 -0
- package/dist/stories/ButtonGridView.stories.svelte +14 -0
- package/dist/stories/ButtonGridView.stories.svelte.d.ts +28 -0
- package/dist/stories/ButtonGridView.stories.svelte.d.ts.map +1 -0
- package/dist/stories/ButtonGridView.svelte +146 -0
- package/dist/stories/ButtonGridView.svelte.d.ts +7 -0
- package/dist/stories/ButtonGridView.svelte.d.ts.map +1 -0
- package/dist/stories/ButtonShowcase.stories.svelte +14 -0
- package/dist/stories/ButtonShowcase.stories.svelte.d.ts +28 -0
- package/dist/stories/ButtonShowcase.stories.svelte.d.ts.map +1 -0
- package/dist/stories/ButtonShowcase.svelte +529 -0
- package/dist/stories/ButtonShowcase.svelte.d.ts +7 -0
- package/dist/stories/ButtonShowcase.svelte.d.ts.map +1 -0
- package/dist/stories/DesignSystemAudit.stories.svelte +4 -12
- package/dist/stories/DesignSystemAudit.stories.svelte.d.ts.map +1 -1
- package/dist/stories/button-audit-manifest.json +11187 -0
- package/package.json +5 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
3
|
import Button from "./Button.svelte";
|
|
4
4
|
import ButtonSaveDemo from "./ButtonSaveDemo.svelte";
|
|
5
|
+
import ButtonVariantShowcase from "./ButtonVariantShowcase.svelte";
|
|
5
6
|
|
|
6
7
|
import Add from "./../../assets/svg/add-main.svg";
|
|
7
8
|
import ArrowLeft from "./../../assets/svg/arrow-left-02.svg";
|
|
@@ -10,100 +11,66 @@
|
|
|
10
11
|
const { Story } = defineMeta({
|
|
11
12
|
title: "Components/Button",
|
|
12
13
|
component: Button,
|
|
14
|
+
tags: ['autodocs'],
|
|
13
15
|
argTypes: {
|
|
14
16
|
variant: {
|
|
15
17
|
control: "select",
|
|
16
|
-
options: ["
|
|
18
|
+
options: ["default", "alternative", "outline", "red", "red-outline", "ghost", "ghost-red", "link", "toggle", "icon"],
|
|
17
19
|
},
|
|
18
20
|
size: {
|
|
19
21
|
control: "select",
|
|
20
|
-
options: ["", "
|
|
22
|
+
options: ["xs", "sm", "md", "lg", "xl", "xl-medium", "full", "full-md-auto", "half"],
|
|
21
23
|
},
|
|
22
24
|
disabled: { control: "boolean" },
|
|
23
25
|
loading: { control: "boolean" },
|
|
24
26
|
success: { control: "boolean" },
|
|
25
|
-
|
|
27
|
+
successText: { control: "text" },
|
|
28
|
+
active: { control: "boolean" },
|
|
29
|
+
},
|
|
30
|
+
args: {
|
|
31
|
+
children: "Button",
|
|
26
32
|
},
|
|
27
33
|
});
|
|
28
|
-
|
|
29
|
-
function handleAlert() {
|
|
30
|
-
alert("Hii, This is Function Alert");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
34
|
</script>
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<Button on:click={handleAlert} beforeIcon={Add}>Add New</Button>
|
|
41
|
-
</Story>
|
|
42
|
-
|
|
43
|
-
<!-- Blue Outline Buttons -->
|
|
44
|
-
<Story name="Blue Outline" args={{ label: "View Details", variant: "blue-outline" }} />
|
|
45
|
-
|
|
46
|
-
<!-- Gray Outline Buttons -->
|
|
47
|
-
<Story name="Gray Outline" args={{ label: "Cancel", variant: "gray-outline" }} />
|
|
48
|
-
|
|
49
|
-
<!-- Red Solid Buttons -->
|
|
50
|
-
<Story name="Red Solid" args={{ label: "Delete", variant: "red-solid" }} />
|
|
51
|
-
|
|
52
|
-
<!-- Red Outline Buttons -->
|
|
53
|
-
<Story name="Red Outline">
|
|
54
|
-
<Button variant="red-outline" on:click={handleAlert} beforeIcon={DeleteIcon}>
|
|
55
|
-
Delete Item
|
|
56
|
-
</Button>
|
|
36
|
+
<!-- Full Showcase (uses dedicated component) -->
|
|
37
|
+
<Story name="All Variants Showcase">
|
|
38
|
+
{#snippet template()}
|
|
39
|
+
<ButtonVariantShowcase />
|
|
40
|
+
{/snippet}
|
|
57
41
|
</Story>
|
|
58
42
|
|
|
59
|
-
<!--
|
|
60
|
-
<Story name="
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<Story name="
|
|
68
|
-
<Story name="
|
|
69
|
-
<Story name="
|
|
70
|
-
<Story name="
|
|
71
|
-
<Story name="
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<Story name="
|
|
77
|
-
|
|
78
|
-
<Story name="
|
|
79
|
-
|
|
80
|
-
<Story name="
|
|
43
|
+
<!-- Interactive Playground -->
|
|
44
|
+
<Story name="Playground" args={{ children: "Click me" }} />
|
|
45
|
+
|
|
46
|
+
<!-- ========== VARIANTS ========== -->
|
|
47
|
+
<Story name="default" args={{ variant: "default", children: "Primary Button" }} />
|
|
48
|
+
<Story name="alternative" args={{ variant: "alternative", children: "Secondary" }} />
|
|
49
|
+
<Story name="outline" args={{ variant: "outline", children: "Outline" }} />
|
|
50
|
+
<Story name="ghost" args={{ variant: "ghost", children: "Ghost" }} />
|
|
51
|
+
<Story name="link" args={{ variant: "link", children: "Link style" }} />
|
|
52
|
+
<Story name="red" args={{ variant: "red", children: "Delete" }} />
|
|
53
|
+
<Story name="red-outline" args={{ variant: "red-outline", children: "Remove" }} />
|
|
54
|
+
<Story name="ghost-red" args={{ variant: "ghost-red", children: "Sign out" }} />
|
|
55
|
+
<Story name="toggle" args={{ variant: "toggle", children: "Filter" }} />
|
|
56
|
+
<Story name="toggle (active)" args={{ variant: "toggle", active: true, children: "Selected" }} />
|
|
57
|
+
|
|
58
|
+
<!-- ========== SIZES ========== -->
|
|
59
|
+
<Story name="Size: xs" args={{ size: "xs", children: "Extra Small" }} />
|
|
60
|
+
<Story name="Size: sm" args={{ size: "sm", children: "Small" }} />
|
|
61
|
+
<Story name="Size: md" args={{ size: "md", children: "Medium" }} />
|
|
62
|
+
<Story name="Size: lg" args={{ size: "lg", children: "Large" }} />
|
|
63
|
+
<Story name="Size: xl" args={{ size: "xl", children: "Extra Large" }} />
|
|
64
|
+
<Story name="Size: full" args={{ size: "full", children: "Full Width" }} />
|
|
65
|
+
<Story name="Size: xl-medium" args={{ size: "xl-medium", children: "Login Button" }} />
|
|
66
|
+
<Story name="Size: half" args={{ size: "half", children: "Half Width" }} />
|
|
67
|
+
|
|
68
|
+
<!-- ========== STATES ========== -->
|
|
69
|
+
<Story name="Disabled" args={{ disabled: true, children: "Disabled" }} />
|
|
70
|
+
<Story name="Loading" args={{ loading: true, children: "Saving..." }} />
|
|
71
|
+
<Story name="Success" args={{ success: true, successText: "Saved!", children: "Save" }} />
|
|
72
|
+
|
|
73
|
+
<!-- ========== INTERACTIVE DEMO ========== -->
|
|
74
|
+
<Story name="Save Flow Demo" asChild>
|
|
81
75
|
<ButtonSaveDemo />
|
|
82
76
|
</Story>
|
|
83
|
-
|
|
84
|
-
<!-- All Variants Grid -->
|
|
85
|
-
<Story name="All Variants">
|
|
86
|
-
<div class="space-y-4 p-4">
|
|
87
|
-
<h3 class="text-lg font-semibold">All Button Variants</h3>
|
|
88
|
-
<div class="flex flex-wrap gap-4">
|
|
89
|
-
<Button>blue-solid (default)</Button>
|
|
90
|
-
<Button variant="blue-outline">blue-outline</Button>
|
|
91
|
-
<Button variant="gray-outline">gray-outline</Button>
|
|
92
|
-
<Button variant="red-solid">red-solid</Button>
|
|
93
|
-
<Button variant="red-outline">red-outline</Button>
|
|
94
|
-
<Button variant="red-text">red-text</Button>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<h3 class="text-lg font-semibold mt-6">All Sizes</h3>
|
|
98
|
-
<div class="space-y-2">
|
|
99
|
-
<div><Button size="full">size="full"</Button></div>
|
|
100
|
-
<div class="flex flex-wrap gap-2 items-end">
|
|
101
|
-
<Button size="lg">size="lg"</Button>
|
|
102
|
-
<Button size="md">size="md"</Button>
|
|
103
|
-
<Button>default</Button>
|
|
104
|
-
<Button size="sm">size="sm"</Button>
|
|
105
|
-
<Button size="xs">size="xs"</Button>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
</Story>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/Button.stories.svelte.js"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"Button.stories.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/Button.stories.svelte.js"],"names":[],"mappings":";;;;;;;;AA0FA;;;;mBAAkH;mBAtF7F,iBAAiB;6CA6EO,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,eAAe,QAAQ,CAAC"}
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
export let successText = "";
|
|
28
28
|
export let active = false;
|
|
29
29
|
export let href = null;
|
|
30
|
+
/** @type {string} Text content (alternative to slot, for Storybook) */
|
|
31
|
+
export let children = "";
|
|
30
32
|
/** @type {string} Additional CSS classes */
|
|
31
33
|
let className = "";
|
|
32
34
|
export { className as class };
|
|
@@ -50,9 +52,12 @@
|
|
|
50
52
|
xs: "px-3 py-1.5 text-xs",
|
|
51
53
|
sm: "px-3 py-2 text-sm",
|
|
52
54
|
md: "px-4 py-2.5 text-sm",
|
|
53
|
-
lg: "px-5 py-3 text-
|
|
54
|
-
xl: "px-6 py-3.5 text-
|
|
55
|
-
|
|
55
|
+
lg: "px-5 py-3 text-sm",
|
|
56
|
+
xl: "px-6 py-3.5 text-sm",
|
|
57
|
+
"xl-medium": "w-full px-6 py-3.5 text-sm",
|
|
58
|
+
full: "w-full px-5 py-3 text-sm",
|
|
59
|
+
"full-md-auto": "w-full px-5 py-3 text-sm md:w-auto",
|
|
60
|
+
half: "w-1/2 px-4 py-2.5 text-sm",
|
|
56
61
|
};
|
|
57
62
|
|
|
58
63
|
// Icon variant sizes
|
|
@@ -103,6 +108,7 @@
|
|
|
103
108
|
})();
|
|
104
109
|
|
|
105
110
|
$: buttonClasses = [
|
|
111
|
+
"relative",
|
|
106
112
|
"inline-flex items-center justify-center",
|
|
107
113
|
"rounded-lg",
|
|
108
114
|
"font-medium leading-none",
|
|
@@ -124,7 +130,7 @@
|
|
|
124
130
|
{...$$restProps}
|
|
125
131
|
>
|
|
126
132
|
<span class="inline-flex items-center gap-1.5" class:invisible={loading || success}>
|
|
127
|
-
<slot />
|
|
133
|
+
{#if children}{children}{:else}<slot />{/if}
|
|
128
134
|
</span>
|
|
129
135
|
{#if loading}
|
|
130
136
|
<span class="absolute inset-0 flex items-center justify-center">
|
|
@@ -140,7 +146,7 @@
|
|
|
140
146
|
{...$$restProps}
|
|
141
147
|
>
|
|
142
148
|
<span class="inline-flex items-center gap-1.5" class:invisible={loading || success}>
|
|
143
|
-
<slot />
|
|
149
|
+
{#if children}{children}{:else}<slot />{/if}
|
|
144
150
|
</span>
|
|
145
151
|
{#if loading}
|
|
146
152
|
<span class="absolute inset-0 flex items-center justify-center">
|
|
@@ -10,6 +10,7 @@ type Button = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
|
10
10
|
successText?: string | undefined;
|
|
11
11
|
active?: boolean | undefined;
|
|
12
12
|
href?: null | undefined;
|
|
13
|
+
children?: string | undefined;
|
|
13
14
|
}, {
|
|
14
15
|
default: {};
|
|
15
16
|
}>, {
|
|
@@ -32,6 +33,7 @@ declare const Button: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWit
|
|
|
32
33
|
successText?: string | undefined;
|
|
33
34
|
active?: boolean | undefined;
|
|
34
35
|
href?: null | undefined;
|
|
36
|
+
children?: string | undefined;
|
|
35
37
|
}, {
|
|
36
38
|
default: {};
|
|
37
39
|
}>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/Button.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/Button.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkLA;;;;;;;;;;;;;;;;;;;;eAAqO;sCAT/L,KAAK,EAAE,KAAK;;;;;6CALL,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Button from './Button.svelte';
|
|
3
|
+
|
|
4
|
+
const variants = [
|
|
5
|
+
{ name: 'default', label: 'Primary Blue', desc: 'Main action' },
|
|
6
|
+
{ name: 'alternative', label: 'Gray Outline', desc: 'Secondary action' },
|
|
7
|
+
{ name: 'outline', label: 'Blue Outline', desc: 'Tertiary action' },
|
|
8
|
+
{ name: 'ghost', label: 'Ghost', desc: 'Subtle action' },
|
|
9
|
+
{ name: 'link', label: 'Link', desc: 'Inline text action' },
|
|
10
|
+
{ name: 'red', label: 'Red Solid', desc: 'Destructive' },
|
|
11
|
+
{ name: 'red-outline', label: 'Red Outline', desc: 'Less intense destructive' },
|
|
12
|
+
{ name: 'ghost-red', label: 'Ghost Red', desc: 'Subtle destructive' },
|
|
13
|
+
{ name: 'toggle', label: 'Toggle', desc: 'Filter/tab pills' },
|
|
14
|
+
{ name: 'icon', label: 'Icon', desc: 'Square icon buttons' },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
18
|
+
const widthSizes = ['full', 'xl-medium', 'full-md-auto', 'half'];
|
|
19
|
+
|
|
20
|
+
let isDark = false;
|
|
21
|
+
|
|
22
|
+
function toggleDark() {
|
|
23
|
+
isDark = !isDark;
|
|
24
|
+
document.documentElement.classList.toggle('dark', isDark);
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div class="min-h-screen p-6 space-y-8 {isDark ? 'bg-gray-900' : 'bg-gray-50'}">
|
|
29
|
+
<!-- Header -->
|
|
30
|
+
<div class="flex items-center justify-between">
|
|
31
|
+
<div>
|
|
32
|
+
<h1 class="text-2xl font-bold {isDark ? 'text-white' : 'text-gray-900'}">Button Variants</h1>
|
|
33
|
+
<p class="{isDark ? 'text-gray-400' : 'text-gray-600'}">All variants × all sizes</p>
|
|
34
|
+
</div>
|
|
35
|
+
<button
|
|
36
|
+
on:click={toggleDark}
|
|
37
|
+
class="px-4 py-2 rounded-lg font-medium {isDark ? 'bg-yellow-500 text-black' : 'bg-gray-800 text-white'}"
|
|
38
|
+
>
|
|
39
|
+
{isDark ? '☀️ Light' : '🌙 Dark'}
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<!-- Variants Grid -->
|
|
44
|
+
{#each variants as v}
|
|
45
|
+
<section class="rounded-xl p-5 {isDark ? 'bg-gray-800' : 'bg-white'} border {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
46
|
+
<div class="mb-3">
|
|
47
|
+
<h2 class="text-lg font-semibold {isDark ? 'text-white' : 'text-gray-900'}">{v.name}</h2>
|
|
48
|
+
<p class="text-sm {isDark ? 'text-gray-400' : 'text-gray-500'}">{v.label} — {v.desc}</p>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
{#if v.name === 'icon'}
|
|
52
|
+
<!-- Icon variant uses different sizing -->
|
|
53
|
+
<div class="flex flex-wrap gap-3 items-end">
|
|
54
|
+
<Button variant="icon" size="xs">×</Button>
|
|
55
|
+
<Button variant="icon" size="sm">×</Button>
|
|
56
|
+
<Button variant="icon" size="md">×</Button>
|
|
57
|
+
<Button variant="icon" size="lg">×</Button>
|
|
58
|
+
</div>
|
|
59
|
+
{:else if v.name === 'toggle'}
|
|
60
|
+
<!-- Toggle shows active state -->
|
|
61
|
+
<div class="flex flex-wrap gap-3 items-center">
|
|
62
|
+
{#each sizes as size}
|
|
63
|
+
<Button variant="toggle" {size}>{size}</Button>
|
|
64
|
+
{/each}
|
|
65
|
+
<Button variant="toggle" active={true}>active</Button>
|
|
66
|
+
</div>
|
|
67
|
+
{:else}
|
|
68
|
+
<div class="flex flex-wrap gap-3 items-end">
|
|
69
|
+
{#each sizes as size}
|
|
70
|
+
<Button variant={v.name} {size}>{size}</Button>
|
|
71
|
+
{/each}
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
</section>
|
|
75
|
+
{/each}
|
|
76
|
+
|
|
77
|
+
<!-- Width Sizes -->
|
|
78
|
+
<section class="rounded-xl p-5 {isDark ? 'bg-gray-800' : 'bg-white'} border {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
79
|
+
<div class="mb-3">
|
|
80
|
+
<h2 class="text-lg font-semibold {isDark ? 'text-white' : 'text-gray-900'}">Width Sizes</h2>
|
|
81
|
+
<p class="text-sm {isDark ? 'text-gray-400' : 'text-gray-500'}">Full-width and responsive options</p>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="max-w-md space-y-3">
|
|
84
|
+
<Button size="full">full</Button>
|
|
85
|
+
<Button size="xl-medium">xl-medium</Button>
|
|
86
|
+
<Button size="full-md-auto">full-md-auto</Button>
|
|
87
|
+
<div class="flex gap-2">
|
|
88
|
+
<Button size="half" variant="alternative">half</Button>
|
|
89
|
+
<Button size="half">half</Button>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</section>
|
|
93
|
+
|
|
94
|
+
<!-- States -->
|
|
95
|
+
<section class="rounded-xl p-5 {isDark ? 'bg-gray-800' : 'bg-white'} border {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
96
|
+
<div class="mb-3">
|
|
97
|
+
<h2 class="text-lg font-semibold {isDark ? 'text-white' : 'text-gray-900'}">States</h2>
|
|
98
|
+
<p class="text-sm {isDark ? 'text-gray-400' : 'text-gray-500'}">Loading, success, disabled</p>
|
|
99
|
+
</div>
|
|
100
|
+
<div class="flex flex-wrap gap-4 items-center">
|
|
101
|
+
<Button disabled>Disabled</Button>
|
|
102
|
+
<Button loading>Loading</Button>
|
|
103
|
+
<Button success successText="Saved!">Success</Button>
|
|
104
|
+
</div>
|
|
105
|
+
</section>
|
|
106
|
+
|
|
107
|
+
<!-- Common Patterns -->
|
|
108
|
+
<section class="rounded-xl p-5 {isDark ? 'bg-gray-800' : 'bg-white'} border {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
109
|
+
<div class="mb-3">
|
|
110
|
+
<h2 class="text-lg font-semibold {isDark ? 'text-white' : 'text-gray-900'}">Common Patterns</h2>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="space-y-4">
|
|
113
|
+
<div>
|
|
114
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Cancel / Save</p>
|
|
115
|
+
<div class="flex gap-2">
|
|
116
|
+
<Button variant="ghost">Cancel</Button>
|
|
117
|
+
<Button>Save</Button>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div>
|
|
121
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Delete Confirmation</p>
|
|
122
|
+
<div class="flex gap-2">
|
|
123
|
+
<Button variant="alternative">Cancel</Button>
|
|
124
|
+
<Button variant="red">Delete</Button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div>
|
|
128
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Toggle Group</p>
|
|
129
|
+
<div class="flex gap-2">
|
|
130
|
+
<Button variant="toggle" active={true}>Active</Button>
|
|
131
|
+
<Button variant="toggle">Inactive</Button>
|
|
132
|
+
<Button variant="toggle">All</Button>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</section>
|
|
137
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default ButtonVariantShowcase;
|
|
2
|
+
type ButtonVariantShowcase = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const ButtonVariantShowcase: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
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> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ButtonVariantShowcase.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonVariantShowcase.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/ButtonVariantShowcase.svelte.js"],"names":[],"mappings":";;;;;;;;AAuJA;;;;mBAAiI;6CATpF,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,eAAe,QAAQ,CAAC"}
|
|
@@ -749,7 +749,7 @@
|
|
|
749
749
|
|
|
750
750
|
<div class="space-y-4">
|
|
751
751
|
<Button
|
|
752
|
-
size="
|
|
752
|
+
size="xl-medium"
|
|
753
753
|
type="submit"
|
|
754
754
|
loading={isLoading}
|
|
755
755
|
disabled={!isFormValid}
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
|
|
773
773
|
<Button
|
|
774
774
|
variant="gray-outline"
|
|
775
|
-
size="
|
|
775
|
+
size="xl-medium"
|
|
776
776
|
type="button"
|
|
777
777
|
onclick={() => {
|
|
778
778
|
view = "login-link";
|
|
@@ -924,7 +924,7 @@
|
|
|
924
924
|
|
|
925
925
|
<div class="space-y-4">
|
|
926
926
|
<Button
|
|
927
|
-
size="
|
|
927
|
+
size="xl-medium"
|
|
928
928
|
type="submit"
|
|
929
929
|
loading={isLoading}
|
|
930
930
|
disabled={!isSetupValid}
|
|
@@ -994,7 +994,7 @@
|
|
|
994
994
|
|
|
995
995
|
<div class="space-y-4">
|
|
996
996
|
<Button
|
|
997
|
-
size="
|
|
997
|
+
size="xl-medium"
|
|
998
998
|
type="submit"
|
|
999
999
|
loading={isLoading}
|
|
1000
1000
|
disabled={!email}
|
|
@@ -1075,7 +1075,7 @@
|
|
|
1075
1075
|
|
|
1076
1076
|
<div class="space-y-4">
|
|
1077
1077
|
<Button
|
|
1078
|
-
size="
|
|
1078
|
+
size="xl-medium"
|
|
1079
1079
|
type="submit"
|
|
1080
1080
|
loading={isLoading}
|
|
1081
1081
|
disabled={!email}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
+
import ButtonAuditDashboard from "./ButtonAuditDashboard.svelte";
|
|
4
|
+
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: "Design System/Button Audit Dashboard",
|
|
7
|
+
component: ButtonAuditDashboard,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Full Audit" />
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default ButtonAuditDashboard;
|
|
2
|
+
type ButtonAuditDashboard = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const ButtonAuditDashboard: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
import ButtonAuditDashboard from "./ButtonAuditDashboard.svelte";
|
|
15
|
+
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> {
|
|
16
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
+
$$bindings?: Bindings;
|
|
18
|
+
} & Exports;
|
|
19
|
+
(internal: unknown, props: {
|
|
20
|
+
$$events?: Events;
|
|
21
|
+
$$slots?: Slots;
|
|
22
|
+
}): Exports & {
|
|
23
|
+
$set?: any;
|
|
24
|
+
$on?: any;
|
|
25
|
+
};
|
|
26
|
+
z_$$bindings?: Bindings;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ButtonAuditDashboard.stories.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonAuditDashboard.stories.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/stories/ButtonAuditDashboard.stories.svelte.js"],"names":[],"mappings":";;;;;;;;AA4BA;;;;mBAAgI;iCAxB7F,+BAA+B;6CAerB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,eAAe,QAAQ,CAAC"}
|