@getmicdrop/svelte-components 4.1.4 → 5.1.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/dist/components/Layout/Grid.svelte +110 -0
- package/dist/components/Layout/Grid.svelte.d.ts +48 -0
- package/dist/components/Layout/Grid.svelte.d.ts.map +1 -0
- package/dist/components/Layout/Section.svelte +81 -0
- package/dist/components/Layout/Section.svelte.d.ts +48 -0
- package/dist/components/Layout/Section.svelte.d.ts.map +1 -0
- package/dist/components/Layout/Sidebar.svelte +104 -0
- package/dist/components/Layout/Sidebar.svelte.d.ts +52 -0
- package/dist/components/Layout/Sidebar.svelte.d.ts.map +1 -0
- package/dist/components/Layout/Stack.svelte +139 -0
- package/dist/components/Layout/Stack.svelte.d.ts +52 -0
- package/dist/components/Layout/Stack.svelte.d.ts.map +1 -0
- 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/dist/tailwind/preset.cjs +82 -0
- package/dist/tailwind/preset.d.cts +78 -0
- package/dist/tailwind/preset.d.cts.map +1 -0
- package/dist/tokens/colors.d.ts +255 -0
- package/dist/tokens/colors.d.ts.map +1 -0
- package/dist/tokens/colors.js +141 -0
- package/dist/tokens/index.d.ts +11 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +10 -0
- package/dist/tokens/radius.d.ts +28 -0
- package/dist/tokens/radius.d.ts.map +1 -0
- package/dist/tokens/radius.js +25 -0
- package/dist/tokens/shadows.d.ts +46 -0
- package/dist/tokens/shadows.d.ts.map +1 -0
- package/dist/tokens/shadows.js +28 -0
- package/dist/tokens/spacing.d.ts +62 -0
- package/dist/tokens/spacing.d.ts.map +1 -0
- package/dist/tokens/spacing.js +59 -0
- package/dist/tokens/tokens.css +87 -0
- package/dist/tokens/typography.d.ts +174 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/dist/tokens/typography.js +66 -0
- package/dist/tokens/z-index.d.ts +32 -0
- package/dist/tokens/z-index.d.ts.map +1 -0
- package/dist/tokens/z-index.js +29 -0
- package/package.json +35 -2
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Grid - Responsive grid container with automatic column sizing
|
|
4
|
+
*
|
|
5
|
+
* Use Grid for laying out cards, stats, or any items in a responsive grid.
|
|
6
|
+
* Automatically stacks on mobile and expands on larger screens.
|
|
7
|
+
*
|
|
8
|
+
* @example Numeric gap
|
|
9
|
+
* <Grid cols="3" gap="6">
|
|
10
|
+
* <StatsCard>Revenue</StatsCard>
|
|
11
|
+
* <StatsCard>Users</StatsCard>
|
|
12
|
+
* <StatsCard>Orders</StatsCard>
|
|
13
|
+
* </Grid>
|
|
14
|
+
*
|
|
15
|
+
* @example Semantic gap (recommended)
|
|
16
|
+
* <Grid cols="3" gap="section">
|
|
17
|
+
* <Card>Card 1</Card>
|
|
18
|
+
* <Card>Card 2</Card>
|
|
19
|
+
* <Card>Card 3</Card>
|
|
20
|
+
* </Grid>
|
|
21
|
+
*
|
|
22
|
+
* @example Auto-fit columns
|
|
23
|
+
* <Grid cols="auto" minWidth="300px" gap="section">
|
|
24
|
+
* {#each items as item}
|
|
25
|
+
* <Card>{item.name}</Card>
|
|
26
|
+
* {/each}
|
|
27
|
+
* </Grid>
|
|
28
|
+
*
|
|
29
|
+
* Semantic Gap Values (Flowbite/8px grid):
|
|
30
|
+
* - tight: 16px (4) - Tight grid items
|
|
31
|
+
* - standard: 24px (6) - Standard grid items (default)
|
|
32
|
+
* - spacious: 32px (8) - Spacious grid items
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Number of columns or 'auto' for auto-fit
|
|
37
|
+
* @type {'1' | '2' | '3' | '4' | '6' | 'auto'}
|
|
38
|
+
*/
|
|
39
|
+
export let cols = '3';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Gap between grid items - semantic names or Tailwind spacing scale
|
|
43
|
+
* @type {'tight' | 'standard' | 'spacious' | '0' | '2' | '3' | '4' | '6' | '8'}
|
|
44
|
+
*/
|
|
45
|
+
export let gap = '4';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Minimum width for auto-fit columns (only used when cols='auto')
|
|
49
|
+
* @type {string}
|
|
50
|
+
*/
|
|
51
|
+
export let minWidth = '280px';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* HTML element to render as
|
|
55
|
+
* @type {'div' | 'section' | 'ul'}
|
|
56
|
+
*/
|
|
57
|
+
export let as = 'div';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Additional CSS classes
|
|
61
|
+
* @type {string}
|
|
62
|
+
*/
|
|
63
|
+
let className = '';
|
|
64
|
+
export { className as class };
|
|
65
|
+
|
|
66
|
+
// Semantic gap names for grids
|
|
67
|
+
const semanticGapMap = {
|
|
68
|
+
'tight': 'gap-4', // 16px - Tight grid items
|
|
69
|
+
'standard': 'gap-6', // 24px - Standard grid items
|
|
70
|
+
'spacious': 'gap-8', // 32px - Spacious grid items
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Numeric gap values (backwards compatible)
|
|
74
|
+
const numericGapMap = {
|
|
75
|
+
'0': 'gap-0',
|
|
76
|
+
'2': 'gap-2',
|
|
77
|
+
'3': 'gap-3',
|
|
78
|
+
'4': 'gap-4',
|
|
79
|
+
'6': 'gap-6',
|
|
80
|
+
'8': 'gap-8'
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// Combined map
|
|
84
|
+
const gapMap = { ...numericGapMap, ...semanticGapMap };
|
|
85
|
+
|
|
86
|
+
// Responsive column mappings - stack on mobile, expand on larger screens
|
|
87
|
+
const colsMap = {
|
|
88
|
+
'1': 'grid-cols-1',
|
|
89
|
+
'2': 'grid-cols-1 md:grid-cols-2',
|
|
90
|
+
'3': 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
|
91
|
+
'4': 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',
|
|
92
|
+
'6': 'grid-cols-2 md:grid-cols-3 lg:grid-cols-6',
|
|
93
|
+
'auto': '' // Uses inline style
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
$: gridStyle = cols === 'auto'
|
|
97
|
+
? `grid-template-columns: repeat(auto-fit, minmax(${minWidth}, 1fr));`
|
|
98
|
+
: '';
|
|
99
|
+
|
|
100
|
+
$: classes = [
|
|
101
|
+
'grid',
|
|
102
|
+
cols !== 'auto' ? colsMap[cols] : '',
|
|
103
|
+
gapMap[gap] || 'gap-4',
|
|
104
|
+
className
|
|
105
|
+
].filter(Boolean).join(' ');
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<svelte:element this={as} class={classes} style={gridStyle || undefined}>
|
|
109
|
+
<slot />
|
|
110
|
+
</svelte:element>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export default Grid;
|
|
2
|
+
type Grid = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
class?: string | undefined;
|
|
4
|
+
minWidth?: string | undefined;
|
|
5
|
+
cols?: "1" | "2" | "4" | "3" | "6" | "auto" | undefined;
|
|
6
|
+
gap?: "0" | "2" | "4" | "3" | "6" | "8" | "tight" | "standard" | "spacious" | undefined;
|
|
7
|
+
as?: "div" | "section" | "ul" | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}>, {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {
|
|
13
|
+
default: {};
|
|
14
|
+
}> & {
|
|
15
|
+
$$bindings?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
declare const Grid: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
18
|
+
class?: string | undefined;
|
|
19
|
+
minWidth?: string | undefined;
|
|
20
|
+
cols?: "1" | "2" | "4" | "3" | "6" | "auto" | undefined;
|
|
21
|
+
gap?: "0" | "2" | "4" | "3" | "6" | "8" | "tight" | "standard" | "spacious" | undefined;
|
|
22
|
+
as?: "div" | "section" | "ul" | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
default: {};
|
|
25
|
+
}>, {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {
|
|
28
|
+
default: {};
|
|
29
|
+
}, {}, string>;
|
|
30
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
31
|
+
default: any;
|
|
32
|
+
} ? Props extends Record<string, never> ? any : {
|
|
33
|
+
children?: any;
|
|
34
|
+
} : {});
|
|
35
|
+
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> {
|
|
36
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
37
|
+
$$bindings?: Bindings;
|
|
38
|
+
} & Exports;
|
|
39
|
+
(internal: unknown, props: Props & {
|
|
40
|
+
$$events?: Events;
|
|
41
|
+
$$slots?: Slots;
|
|
42
|
+
}): Exports & {
|
|
43
|
+
$set?: any;
|
|
44
|
+
$on?: any;
|
|
45
|
+
};
|
|
46
|
+
z_$$bindings?: Bindings;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Grid.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Layout/Grid.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsJA;;;;;;;;;;;;eAA8J;sCATxH,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,81 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Section - Semantic section wrapper with optional title
|
|
4
|
+
*
|
|
5
|
+
* Use Section to group related content with consistent spacing.
|
|
6
|
+
* Provides proper HTML5 semantics with <section> element.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <Section title="Recent Orders">
|
|
10
|
+
* <OrdersTable />
|
|
11
|
+
* </Section>
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Section>
|
|
15
|
+
* <Chart />
|
|
16
|
+
* </Section>
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Section title (optional)
|
|
21
|
+
* @type {string}
|
|
22
|
+
*/
|
|
23
|
+
export let title = '';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Title size
|
|
27
|
+
* @type {'sm' | 'md' | 'lg'}
|
|
28
|
+
*/
|
|
29
|
+
export let titleSize = 'md';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Gap between title and content
|
|
33
|
+
* @type {'2' | '3' | '4' | '6'}
|
|
34
|
+
*/
|
|
35
|
+
export let gap = '4';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Additional CSS classes for the section
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
let className = '';
|
|
42
|
+
export { className as class };
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Additional CSS classes for the title
|
|
46
|
+
* @type {string}
|
|
47
|
+
*/
|
|
48
|
+
export let titleClass = '';
|
|
49
|
+
|
|
50
|
+
const titleSizeMap = {
|
|
51
|
+
sm: 'text-base font-medium',
|
|
52
|
+
md: 'text-lg font-semibold',
|
|
53
|
+
lg: 'text-xl font-semibold'
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const gapMap = {
|
|
57
|
+
'2': 'space-y-2',
|
|
58
|
+
'3': 'space-y-3',
|
|
59
|
+
'4': 'space-y-4',
|
|
60
|
+
'6': 'space-y-6'
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
$: sectionClasses = [
|
|
64
|
+
title ? gapMap[gap] || 'space-y-4' : '',
|
|
65
|
+
className
|
|
66
|
+
].filter(Boolean).join(' ');
|
|
67
|
+
|
|
68
|
+
$: titleClasses = [
|
|
69
|
+
titleSizeMap[titleSize] || titleSizeMap.md,
|
|
70
|
+
'text-gray-900 dark:text-white',
|
|
71
|
+
titleClass
|
|
72
|
+
].filter(Boolean).join(' ');
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<section class={sectionClasses} aria-label={title || undefined}>
|
|
76
|
+
{#if title}
|
|
77
|
+
<h2 class={titleClasses}>{title}</h2>
|
|
78
|
+
{/if}
|
|
79
|
+
|
|
80
|
+
<slot />
|
|
81
|
+
</section>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export default Section;
|
|
2
|
+
type Section = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
class?: string | undefined;
|
|
4
|
+
title?: string | undefined;
|
|
5
|
+
gap?: "2" | "4" | "3" | "6" | undefined;
|
|
6
|
+
titleSize?: "sm" | "md" | "lg" | undefined;
|
|
7
|
+
titleClass?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}>, {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {
|
|
13
|
+
default: {};
|
|
14
|
+
}> & {
|
|
15
|
+
$$bindings?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
declare const Section: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
18
|
+
class?: string | undefined;
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
gap?: "2" | "4" | "3" | "6" | undefined;
|
|
21
|
+
titleSize?: "sm" | "md" | "lg" | undefined;
|
|
22
|
+
titleClass?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
default: {};
|
|
25
|
+
}>, {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {
|
|
28
|
+
default: {};
|
|
29
|
+
}, {}, string>;
|
|
30
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
31
|
+
default: any;
|
|
32
|
+
} ? Props extends Record<string, never> ? any : {
|
|
33
|
+
children?: any;
|
|
34
|
+
} : {});
|
|
35
|
+
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> {
|
|
36
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
37
|
+
$$bindings?: Bindings;
|
|
38
|
+
} & Exports;
|
|
39
|
+
(internal: unknown, props: Props & {
|
|
40
|
+
$$events?: Events;
|
|
41
|
+
$$slots?: Slots;
|
|
42
|
+
}): Exports & {
|
|
43
|
+
$set?: any;
|
|
44
|
+
$on?: any;
|
|
45
|
+
};
|
|
46
|
+
z_$$bindings?: Bindings;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Section.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Layout/Section.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAyHA;;;;;;;;;;;;eAA2K;sCATrI,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,104 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Sidebar - Main content with sidebar layout
|
|
4
|
+
*
|
|
5
|
+
* Use Sidebar for pages that have a main content area plus a sidebar.
|
|
6
|
+
* Common patterns: dashboard stats on right, filters on left, etc.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <Sidebar>
|
|
10
|
+
* <div>Main content here</div>
|
|
11
|
+
* <svelte:fragment slot="sidebar">
|
|
12
|
+
* <StatsCard />
|
|
13
|
+
* </svelte:fragment>
|
|
14
|
+
* </Sidebar>
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Sidebar sidebarPosition="left" sidebarWidth="narrow">
|
|
18
|
+
* <Table />
|
|
19
|
+
* <svelte:fragment slot="sidebar">
|
|
20
|
+
* <Filters />
|
|
21
|
+
* </svelte:fragment>
|
|
22
|
+
* </Sidebar>
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Sidebar width preset
|
|
27
|
+
* - narrow: ~25% (col-span-3 of 12)
|
|
28
|
+
* - medium: ~30% (col-span-4 of 12)
|
|
29
|
+
* - wide: ~40% (col-span-5 of 12)
|
|
30
|
+
* @type {'narrow' | 'medium' | 'wide'}
|
|
31
|
+
*/
|
|
32
|
+
export let sidebarWidth = 'medium';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Sidebar position
|
|
36
|
+
* @type {'left' | 'right'}
|
|
37
|
+
*/
|
|
38
|
+
export let sidebarPosition = 'right';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Gap between main and sidebar
|
|
42
|
+
* @type {'4' | '6' | '8'}
|
|
43
|
+
*/
|
|
44
|
+
export let gap = '6';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Stack vertically on mobile
|
|
48
|
+
* @type {boolean}
|
|
49
|
+
*/
|
|
50
|
+
export let stackOnMobile = true;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Additional CSS classes
|
|
54
|
+
* @type {string}
|
|
55
|
+
*/
|
|
56
|
+
let className = '';
|
|
57
|
+
export { className as class };
|
|
58
|
+
|
|
59
|
+
const gapMap = {
|
|
60
|
+
'4': 'gap-4',
|
|
61
|
+
'6': 'gap-6',
|
|
62
|
+
'8': 'gap-8'
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Using 12-column grid for flexibility
|
|
66
|
+
// Main content gets remaining columns
|
|
67
|
+
const sidebarWidthMap = {
|
|
68
|
+
narrow: { sidebar: 'lg:col-span-3', main: 'lg:col-span-9' },
|
|
69
|
+
medium: { sidebar: 'lg:col-span-4', main: 'lg:col-span-8' },
|
|
70
|
+
wide: { sidebar: 'lg:col-span-5', main: 'lg:col-span-7' }
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
$: widthConfig = sidebarWidthMap[sidebarWidth] || sidebarWidthMap.medium;
|
|
74
|
+
|
|
75
|
+
$: containerClasses = [
|
|
76
|
+
'grid',
|
|
77
|
+
stackOnMobile ? 'grid-cols-1' : '',
|
|
78
|
+
'lg:grid-cols-12',
|
|
79
|
+
gapMap[gap] || 'gap-6',
|
|
80
|
+
className
|
|
81
|
+
].filter(Boolean).join(' ');
|
|
82
|
+
|
|
83
|
+
$: mainClasses = [
|
|
84
|
+
'col-span-1',
|
|
85
|
+
widthConfig.main,
|
|
86
|
+
sidebarPosition === 'left' ? 'lg:order-2' : 'lg:order-1'
|
|
87
|
+
].filter(Boolean).join(' ');
|
|
88
|
+
|
|
89
|
+
$: sidebarClasses = [
|
|
90
|
+
'col-span-1',
|
|
91
|
+
widthConfig.sidebar,
|
|
92
|
+
sidebarPosition === 'left' ? 'lg:order-1' : 'lg:order-2'
|
|
93
|
+
].filter(Boolean).join(' ');
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<div class={containerClasses}>
|
|
97
|
+
<div class={mainClasses}>
|
|
98
|
+
<slot />
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<aside class={sidebarClasses}>
|
|
102
|
+
<slot name="sidebar" />
|
|
103
|
+
</aside>
|
|
104
|
+
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default Sidebar;
|
|
2
|
+
type Sidebar = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
class?: string | undefined;
|
|
4
|
+
gap?: "4" | "6" | "8" | undefined;
|
|
5
|
+
sidebarWidth?: "medium" | "narrow" | "wide" | undefined;
|
|
6
|
+
sidebarPosition?: "left" | "right" | undefined;
|
|
7
|
+
stackOnMobile?: boolean | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
sidebar: {};
|
|
11
|
+
}>, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {
|
|
14
|
+
default: {};
|
|
15
|
+
sidebar: {};
|
|
16
|
+
}> & {
|
|
17
|
+
$$bindings?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
declare const Sidebar: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
class?: string | undefined;
|
|
21
|
+
gap?: "4" | "6" | "8" | undefined;
|
|
22
|
+
sidebarWidth?: "medium" | "narrow" | "wide" | undefined;
|
|
23
|
+
sidebarPosition?: "left" | "right" | undefined;
|
|
24
|
+
stackOnMobile?: boolean | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
sidebar: {};
|
|
28
|
+
}>, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {
|
|
31
|
+
default: {};
|
|
32
|
+
sidebar: {};
|
|
33
|
+
}, {}, string>;
|
|
34
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
35
|
+
default: any;
|
|
36
|
+
} ? Props extends Record<string, never> ? any : {
|
|
37
|
+
children?: any;
|
|
38
|
+
} : {});
|
|
39
|
+
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> {
|
|
40
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
41
|
+
$$bindings?: Bindings;
|
|
42
|
+
} & Exports;
|
|
43
|
+
(internal: unknown, props: Props & {
|
|
44
|
+
$$events?: Events;
|
|
45
|
+
$$slots?: Slots;
|
|
46
|
+
}): Exports & {
|
|
47
|
+
$set?: any;
|
|
48
|
+
$on?: any;
|
|
49
|
+
};
|
|
50
|
+
z_$$bindings?: Bindings;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=Sidebar.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Layout/Sidebar.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAmJA;;;;;;;;;;;;;;eAA2L;sCATrJ,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,139 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Stack - Vertical or horizontal flex container with consistent gap spacing
|
|
4
|
+
*
|
|
5
|
+
* Use Stack when you need to space children vertically or horizontally.
|
|
6
|
+
* Stack controls spacing via gap - children should NOT have external margins.
|
|
7
|
+
*
|
|
8
|
+
* @example Numeric gap (Tailwind scale)
|
|
9
|
+
* <Stack gap="4">
|
|
10
|
+
* <Card>First</Card>
|
|
11
|
+
* <Card>Second</Card>
|
|
12
|
+
* </Stack>
|
|
13
|
+
*
|
|
14
|
+
* @example Semantic gap (recommended)
|
|
15
|
+
* <Stack gap="section">
|
|
16
|
+
* <Card>First card</Card>
|
|
17
|
+
* <Card>Second card</Card>
|
|
18
|
+
* </Stack>
|
|
19
|
+
*
|
|
20
|
+
* @example Horizontal with alignment
|
|
21
|
+
* <Stack direction="horizontal" gap="group" align="center">
|
|
22
|
+
* <Button>Save</Button>
|
|
23
|
+
* <Button variant="secondary">Cancel</Button>
|
|
24
|
+
* </Stack>
|
|
25
|
+
*
|
|
26
|
+
* Semantic Gap Values (Flowbite/8px grid):
|
|
27
|
+
* - tight: 4px (1) - Icon + text, inline elements
|
|
28
|
+
* - compact: 6px (1.5) - Label + input, tight relationships
|
|
29
|
+
* - item: 8px (2) - List items, form fields
|
|
30
|
+
* - group: 12px (3) - Form groups, related content
|
|
31
|
+
* - content: 16px (4) - Card sections, sidebar groups
|
|
32
|
+
* - section: 24px (6) - Between cards, major sections
|
|
33
|
+
* - layout: 32px (8) - Page sections, layout divisions
|
|
34
|
+
* - page: 48px (12) - Hero sections, page divisions
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Gap between children - semantic names or Tailwind spacing scale
|
|
39
|
+
* @type {'tight' | 'compact' | 'item' | 'group' | 'content' | 'section' | 'layout' | 'page' | '0' | '1' | '1.5' | '2' | '3' | '4' | '6' | '8' | '12' | '16'}
|
|
40
|
+
*/
|
|
41
|
+
export let gap = '4';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Stack direction
|
|
45
|
+
* @type {'vertical' | 'horizontal'}
|
|
46
|
+
*/
|
|
47
|
+
export let direction = 'vertical';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Cross-axis alignment (align-items)
|
|
51
|
+
* @type {'start' | 'center' | 'end' | 'stretch' | 'baseline' | undefined}
|
|
52
|
+
*/
|
|
53
|
+
export let align = undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Main-axis alignment (justify-content)
|
|
57
|
+
* @type {'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' | undefined}
|
|
58
|
+
*/
|
|
59
|
+
export let justify = undefined;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Whether children should wrap
|
|
63
|
+
* @type {boolean}
|
|
64
|
+
*/
|
|
65
|
+
export let wrap = false;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* HTML element to render as
|
|
69
|
+
* @type {'div' | 'section' | 'article' | 'aside' | 'main' | 'nav' | 'ul' | 'ol'}
|
|
70
|
+
*/
|
|
71
|
+
export let as = 'div';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Additional CSS classes
|
|
75
|
+
* @type {string}
|
|
76
|
+
*/
|
|
77
|
+
let className = '';
|
|
78
|
+
export { className as class };
|
|
79
|
+
|
|
80
|
+
// Semantic gap names → Tailwind gap classes (Flowbite/8px grid)
|
|
81
|
+
const semanticGapMap = {
|
|
82
|
+
'tight': 'gap-1', // 4px - Icon + text, inline elements
|
|
83
|
+
'compact': 'gap-1.5', // 6px - Label + input, tight relationships
|
|
84
|
+
'item': 'gap-2', // 8px - List items, form fields
|
|
85
|
+
'group': 'gap-3', // 12px - Form groups, related content
|
|
86
|
+
'content': 'gap-4', // 16px - Card sections, sidebar groups
|
|
87
|
+
'section': 'gap-6', // 24px - Between cards, major sections
|
|
88
|
+
'layout': 'gap-8', // 32px - Page sections, layout divisions
|
|
89
|
+
'page': 'gap-12', // 48px - Hero sections, page divisions
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// Numeric gap values (backwards compatible)
|
|
93
|
+
const numericGapMap = {
|
|
94
|
+
'0': 'gap-0',
|
|
95
|
+
'1': 'gap-1',
|
|
96
|
+
'1.5': 'gap-1.5',
|
|
97
|
+
'2': 'gap-2',
|
|
98
|
+
'3': 'gap-3',
|
|
99
|
+
'4': 'gap-4',
|
|
100
|
+
'6': 'gap-6',
|
|
101
|
+
'8': 'gap-8',
|
|
102
|
+
'12': 'gap-12',
|
|
103
|
+
'16': 'gap-16'
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// Combined map - semantic names take precedence
|
|
107
|
+
const gapMap = { ...numericGapMap, ...semanticGapMap };
|
|
108
|
+
|
|
109
|
+
const alignMap = {
|
|
110
|
+
start: 'items-start',
|
|
111
|
+
center: 'items-center',
|
|
112
|
+
end: 'items-end',
|
|
113
|
+
stretch: 'items-stretch',
|
|
114
|
+
baseline: 'items-baseline'
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const justifyMap = {
|
|
118
|
+
start: 'justify-start',
|
|
119
|
+
center: 'justify-center',
|
|
120
|
+
end: 'justify-end',
|
|
121
|
+
between: 'justify-between',
|
|
122
|
+
around: 'justify-around',
|
|
123
|
+
evenly: 'justify-evenly'
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
$: classes = [
|
|
127
|
+
'flex',
|
|
128
|
+
direction === 'vertical' ? 'flex-col' : 'flex-row',
|
|
129
|
+
gapMap[gap] || 'gap-4',
|
|
130
|
+
align ? alignMap[align] : '',
|
|
131
|
+
justify ? justifyMap[justify] : '',
|
|
132
|
+
wrap ? 'flex-wrap' : '',
|
|
133
|
+
className
|
|
134
|
+
].filter(Boolean).join(' ');
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<svelte:element this={as} class={classes}>
|
|
138
|
+
<slot />
|
|
139
|
+
</svelte:element>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default Stack;
|
|
2
|
+
type Stack = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
class?: string | undefined;
|
|
4
|
+
direction?: "horizontal" | "vertical" | undefined;
|
|
5
|
+
gap?: "0" | "1" | "2" | "1.5" | "12" | "4" | "3" | "6" | "8" | "section" | "16" | "page" | "group" | "tight" | "compact" | "item" | "content" | "layout" | undefined;
|
|
6
|
+
align?: "center" | "end" | "start" | "stretch" | "baseline" | undefined;
|
|
7
|
+
justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | undefined;
|
|
8
|
+
wrap?: boolean | undefined;
|
|
9
|
+
as?: "div" | "nav" | "ol" | "article" | "aside" | "main" | "section" | "ul" | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
default: {};
|
|
12
|
+
}>, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> & {
|
|
17
|
+
$$bindings?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
declare const Stack: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
class?: string | undefined;
|
|
21
|
+
direction?: "horizontal" | "vertical" | undefined;
|
|
22
|
+
gap?: "0" | "1" | "2" | "1.5" | "12" | "4" | "3" | "6" | "8" | "section" | "16" | "page" | "group" | "tight" | "compact" | "item" | "content" | "layout" | undefined;
|
|
23
|
+
align?: "start" | "center" | "end" | "stretch" | "baseline" | undefined;
|
|
24
|
+
justify?: "start" | "center" | "end" | "between" | "around" | "evenly" | undefined;
|
|
25
|
+
wrap?: boolean | undefined;
|
|
26
|
+
as?: "div" | "nav" | "ol" | "article" | "aside" | "main" | "section" | "ul" | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
default: {};
|
|
29
|
+
}>, {
|
|
30
|
+
[evt: string]: CustomEvent<any>;
|
|
31
|
+
}, {
|
|
32
|
+
default: {};
|
|
33
|
+
}, {}, string>;
|
|
34
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
35
|
+
default: any;
|
|
36
|
+
} ? Props extends Record<string, never> ? any : {
|
|
37
|
+
children?: any;
|
|
38
|
+
} : {});
|
|
39
|
+
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> {
|
|
40
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
41
|
+
$$bindings?: Bindings;
|
|
42
|
+
} & Exports;
|
|
43
|
+
(internal: unknown, props: Props & {
|
|
44
|
+
$$events?: Events;
|
|
45
|
+
$$slots?: Slots;
|
|
46
|
+
}): Exports & {
|
|
47
|
+
$set?: any;
|
|
48
|
+
$on?: any;
|
|
49
|
+
};
|
|
50
|
+
z_$$bindings?: Bindings;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=Stack.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Layout/Stack.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA2LA;;;;YAhCY,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS;cAI/D,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS;;;;;;;;;eA4B8F;sCAT5I,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"}
|