@sentropic/design-system-svelte 0.10.5 → 0.12.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/Avatar.svelte +161 -0
- package/dist/Avatar.svelte.d.ts +21 -0
- package/dist/Avatar.svelte.d.ts.map +1 -0
- package/dist/AvatarGroup.svelte +114 -0
- package/dist/AvatarGroup.svelte.d.ts +17 -0
- package/dist/AvatarGroup.svelte.d.ts.map +1 -0
- package/dist/ButtonGroup.svelte +130 -0
- package/dist/ButtonGroup.svelte.d.ts +21 -0
- package/dist/ButtonGroup.svelte.d.ts.map +1 -0
- package/dist/CheckboxGroup.svelte +116 -0
- package/dist/CheckboxGroup.svelte.d.ts +29 -0
- package/dist/CheckboxGroup.svelte.d.ts.map +1 -0
- package/dist/Col.svelte +118 -0
- package/dist/Col.svelte.d.ts +24 -0
- package/dist/Col.svelte.d.ts.map +1 -0
- package/dist/Collapsible.svelte +130 -0
- package/dist/Collapsible.svelte.d.ts +15 -0
- package/dist/Collapsible.svelte.d.ts.map +1 -0
- package/dist/Container.svelte +73 -0
- package/dist/Container.svelte.d.ts +15 -0
- package/dist/Container.svelte.d.ts.map +1 -0
- package/dist/Divider.svelte +129 -0
- package/dist/Divider.svelte.d.ts +16 -0
- package/dist/Divider.svelte.d.ts.map +1 -0
- package/dist/Flex.svelte +110 -0
- package/dist/Flex.svelte.d.ts +25 -0
- package/dist/Flex.svelte.d.ts.map +1 -0
- package/dist/Hidden.svelte +94 -0
- package/dist/Hidden.svelte.d.ts +16 -0
- package/dist/Hidden.svelte.d.ts.map +1 -0
- package/dist/Inline.svelte +37 -0
- package/dist/Inline.svelte.d.ts +17 -0
- package/dist/Inline.svelte.d.ts.map +1 -0
- package/dist/RadioGroup.svelte +111 -0
- package/dist/RadioGroup.svelte.d.ts +26 -0
- package/dist/RadioGroup.svelte.d.ts.map +1 -0
- package/dist/Row.svelte +57 -0
- package/dist/Row.svelte.d.ts +17 -0
- package/dist/Row.svelte.d.ts.map +1 -0
- package/dist/Stack.svelte +35 -0
- package/dist/Stack.svelte.d.ts +16 -0
- package/dist/Stack.svelte.d.ts.map +1 -0
- package/dist/Stepper.svelte +257 -0
- package/dist/Stepper.svelte.d.ts +22 -0
- package/dist/Stepper.svelte.d.ts.map +1 -0
- package/dist/Typography.svelte +219 -0
- package/dist/Typography.svelte.d.ts +22 -0
- package/dist/Typography.svelte.d.ts.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
export type HiddenBreakpoint = "sm" | "md" | "lg" | "xl";
|
|
6
|
+
|
|
7
|
+
export type HiddenProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
8
|
+
/** Hide when viewport is narrower than this breakpoint. */
|
|
9
|
+
below?: HiddenBreakpoint;
|
|
10
|
+
/** Hide when viewport is at or wider than this breakpoint. */
|
|
11
|
+
above?: HiddenBreakpoint;
|
|
12
|
+
as?: string;
|
|
13
|
+
class?: string;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
let {
|
|
20
|
+
below,
|
|
21
|
+
above,
|
|
22
|
+
as = "div",
|
|
23
|
+
class: className,
|
|
24
|
+
children,
|
|
25
|
+
...rest
|
|
26
|
+
}: HiddenProps = $props();
|
|
27
|
+
|
|
28
|
+
const classes = $derived(
|
|
29
|
+
[
|
|
30
|
+
"st-hidden",
|
|
31
|
+
below && `st-hidden--below-${below}`,
|
|
32
|
+
above && `st-hidden--above-${above}`,
|
|
33
|
+
className
|
|
34
|
+
]
|
|
35
|
+
.filter(Boolean)
|
|
36
|
+
.join(" ")
|
|
37
|
+
);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<svelte:element this={as} {...rest} class={classes}>
|
|
41
|
+
{@render children?.()}
|
|
42
|
+
</svelte:element>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
.st-hidden {
|
|
46
|
+
display: contents;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Breakpoints: sm 640 / md 768 / lg 1024 / xl 1280. */
|
|
50
|
+
|
|
51
|
+
/* below: hidden when viewport < breakpoint */
|
|
52
|
+
@media (max-width: 639.98px) {
|
|
53
|
+
.st-hidden--below-sm {
|
|
54
|
+
display: none !important;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
@media (max-width: 767.98px) {
|
|
58
|
+
.st-hidden--below-md {
|
|
59
|
+
display: none !important;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
@media (max-width: 1023.98px) {
|
|
63
|
+
.st-hidden--below-lg {
|
|
64
|
+
display: none !important;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
@media (max-width: 1279.98px) {
|
|
68
|
+
.st-hidden--below-xl {
|
|
69
|
+
display: none !important;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* above: hidden when viewport >= breakpoint */
|
|
74
|
+
@media (min-width: 640px) {
|
|
75
|
+
.st-hidden--above-sm {
|
|
76
|
+
display: none !important;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
@media (min-width: 768px) {
|
|
80
|
+
.st-hidden--above-md {
|
|
81
|
+
display: none !important;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
@media (min-width: 1024px) {
|
|
85
|
+
.st-hidden--above-lg {
|
|
86
|
+
display: none !important;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
@media (min-width: 1280px) {
|
|
90
|
+
.st-hidden--above-xl {
|
|
91
|
+
display: none !important;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
export type HiddenBreakpoint = "sm" | "md" | "lg" | "xl";
|
|
4
|
+
export type HiddenProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
5
|
+
/** Hide when viewport is narrower than this breakpoint. */
|
|
6
|
+
below?: HiddenBreakpoint;
|
|
7
|
+
/** Hide when viewport is at or wider than this breakpoint. */
|
|
8
|
+
above?: HiddenBreakpoint;
|
|
9
|
+
as?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
};
|
|
13
|
+
declare const Hidden: import("svelte").Component<HiddenProps, {}, "">;
|
|
14
|
+
type Hidden = ReturnType<typeof Hidden>;
|
|
15
|
+
export default Hidden;
|
|
16
|
+
//# sourceMappingURL=Hidden.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Hidden.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Hidden.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IACrE,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAkCJ,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import type { FlexAlign, FlexJustify } from "./Flex.svelte";
|
|
5
|
+
|
|
6
|
+
export type InlineProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
7
|
+
/** Spacing scale step (0..12) mapped to `--st-spacing-*`. */
|
|
8
|
+
gap?: number;
|
|
9
|
+
align?: FlexAlign;
|
|
10
|
+
justify?: FlexJustify;
|
|
11
|
+
wrap?: boolean;
|
|
12
|
+
as?: string;
|
|
13
|
+
class?: string;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import Flex from "./Flex.svelte";
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
gap,
|
|
23
|
+
align,
|
|
24
|
+
justify,
|
|
25
|
+
wrap = true,
|
|
26
|
+
as = "div",
|
|
27
|
+
class: className,
|
|
28
|
+
children,
|
|
29
|
+
...rest
|
|
30
|
+
}: InlineProps = $props();
|
|
31
|
+
|
|
32
|
+
const classes = $derived(["st-inline", className].filter(Boolean).join(" "));
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<Flex {...rest} {as} {gap} {align} {justify} {wrap} direction="row" class={classes}>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</Flex>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { FlexAlign, FlexJustify } from "./Flex.svelte";
|
|
4
|
+
export type InlineProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
5
|
+
/** Spacing scale step (0..12) mapped to `--st-spacing-*`. */
|
|
6
|
+
gap?: number;
|
|
7
|
+
align?: FlexAlign;
|
|
8
|
+
justify?: FlexJustify;
|
|
9
|
+
wrap?: boolean;
|
|
10
|
+
as?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
};
|
|
14
|
+
declare const Inline: import("svelte").Component<InlineProps, {}, "">;
|
|
15
|
+
type Inline = ReturnType<typeof Inline>;
|
|
16
|
+
export default Inline;
|
|
17
|
+
//# sourceMappingURL=Inline.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Inline.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Inline.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IACrE,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA8BJ,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export interface RadioGroupOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
helperText?: string;
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import type { Snippet } from "svelte";
|
|
12
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
13
|
+
import Radio from "./Radio.svelte";
|
|
14
|
+
|
|
15
|
+
type RadioGroupProps = Omit<HTMLAttributes<HTMLFieldSetElement>, "class" | "onchange"> & {
|
|
16
|
+
legend: string;
|
|
17
|
+
/** Valeur sélectionnée (contrôlée). */
|
|
18
|
+
value?: string;
|
|
19
|
+
onchange?: (value: string) => void;
|
|
20
|
+
orientation?: "vertical" | "horizontal";
|
|
21
|
+
/** Nom partagé garantissant l'exclusivité radio. Requis. */
|
|
22
|
+
name: string;
|
|
23
|
+
options?: RadioGroupOption[];
|
|
24
|
+
helperText?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
class?: string;
|
|
27
|
+
children?: Snippet;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
let {
|
|
31
|
+
legend,
|
|
32
|
+
value,
|
|
33
|
+
onchange,
|
|
34
|
+
orientation = "vertical",
|
|
35
|
+
name,
|
|
36
|
+
options = [],
|
|
37
|
+
helperText,
|
|
38
|
+
disabled = false,
|
|
39
|
+
class: className,
|
|
40
|
+
children,
|
|
41
|
+
...rest
|
|
42
|
+
}: RadioGroupProps = $props();
|
|
43
|
+
|
|
44
|
+
const classes = $derived(
|
|
45
|
+
["st-radioGroup", `st-radioGroup--${orientation}`, className].filter(Boolean).join(" ")
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
function select(optionValue: string) {
|
|
49
|
+
if (optionValue === value) return;
|
|
50
|
+
onchange?.(optionValue);
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<fieldset {...rest} class={classes} {disabled}>
|
|
55
|
+
<legend class="st-radioGroup__legend">{legend}</legend>
|
|
56
|
+
{#if helperText}
|
|
57
|
+
<p class="st-radioGroup__help">{helperText}</p>
|
|
58
|
+
{/if}
|
|
59
|
+
<div class="st-radioGroup__options">
|
|
60
|
+
{#each options as option (option.value)}
|
|
61
|
+
<Radio
|
|
62
|
+
label={option.label}
|
|
63
|
+
helperText={option.helperText}
|
|
64
|
+
{name}
|
|
65
|
+
value={option.value}
|
|
66
|
+
checked={value === option.value}
|
|
67
|
+
disabled={option.disabled}
|
|
68
|
+
onchange={() => select(option.value)}
|
|
69
|
+
/>
|
|
70
|
+
{/each}
|
|
71
|
+
{@render children?.()}
|
|
72
|
+
</div>
|
|
73
|
+
</fieldset>
|
|
74
|
+
|
|
75
|
+
<style>
|
|
76
|
+
.st-radioGroup {
|
|
77
|
+
border: 0;
|
|
78
|
+
margin: 0;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
padding: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.st-radioGroup__legend {
|
|
84
|
+
color: var(--st-component-field-labelText, var(--st-semantic-text-primary));
|
|
85
|
+
font-size: 0.9375rem;
|
|
86
|
+
font-weight: 650;
|
|
87
|
+
line-height: 1.3;
|
|
88
|
+
padding: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.st-radioGroup__help {
|
|
92
|
+
color: var(--st-component-field-helpText, var(--st-semantic-text-secondary));
|
|
93
|
+
font-size: 0.8125rem;
|
|
94
|
+
margin: 0.25rem 0 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.st-radioGroup__options {
|
|
98
|
+
display: flex;
|
|
99
|
+
gap: var(--st-spacing-3, 0.75rem);
|
|
100
|
+
margin-top: var(--st-spacing-2, 0.5rem);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.st-radioGroup--vertical .st-radioGroup__options {
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.st-radioGroup--horizontal .st-radioGroup__options {
|
|
108
|
+
flex-direction: row;
|
|
109
|
+
flex-wrap: wrap;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface RadioGroupOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
helperText?: string;
|
|
6
|
+
}
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
9
|
+
type RadioGroupProps = Omit<HTMLAttributes<HTMLFieldSetElement>, "class" | "onchange"> & {
|
|
10
|
+
legend: string;
|
|
11
|
+
/** Valeur sélectionnée (contrôlée). */
|
|
12
|
+
value?: string;
|
|
13
|
+
onchange?: (value: string) => void;
|
|
14
|
+
orientation?: "vertical" | "horizontal";
|
|
15
|
+
/** Nom partagé garantissant l'exclusivité radio. Requis. */
|
|
16
|
+
name: string;
|
|
17
|
+
options?: RadioGroupOption[];
|
|
18
|
+
helperText?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
class?: string;
|
|
21
|
+
children?: Snippet;
|
|
22
|
+
};
|
|
23
|
+
declare const RadioGroup: import("svelte").Component<RadioGroupProps, {}, "">;
|
|
24
|
+
type RadioGroup = ReturnType<typeof RadioGroup>;
|
|
25
|
+
export default RadioGroup;
|
|
26
|
+
//# sourceMappingURL=RadioGroup.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.svelte.d.ts","sourceRoot":"","sources":["../src/lib/RadioGroup.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIpD,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IACvF,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAkDJ,QAAA,MAAM,UAAU,qDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
package/dist/Row.svelte
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import type { FlexAlign, FlexJustify } from "./Flex.svelte";
|
|
5
|
+
|
|
6
|
+
export type RowProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
7
|
+
/** Spacing scale step (0..12) used for the column gutter. */
|
|
8
|
+
gutter?: number;
|
|
9
|
+
align?: FlexAlign;
|
|
10
|
+
justify?: FlexJustify;
|
|
11
|
+
wrap?: boolean;
|
|
12
|
+
as?: string;
|
|
13
|
+
class?: string;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { spacingToken, alignValue, justifyValue } from "./Flex.svelte";
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
gutter = 4,
|
|
23
|
+
align,
|
|
24
|
+
justify,
|
|
25
|
+
wrap = true,
|
|
26
|
+
as = "div",
|
|
27
|
+
class: className,
|
|
28
|
+
children,
|
|
29
|
+
...rest
|
|
30
|
+
}: RowProps = $props();
|
|
31
|
+
|
|
32
|
+
const classes = $derived(["st-row", className].filter(Boolean).join(" "));
|
|
33
|
+
const gap = $derived(spacingToken(gutter) ?? "0");
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<svelte:element
|
|
37
|
+
this={as}
|
|
38
|
+
{...rest}
|
|
39
|
+
class={classes}
|
|
40
|
+
style:flex-wrap={wrap ? "wrap" : "nowrap"}
|
|
41
|
+
style:align-items={alignValue(align)}
|
|
42
|
+
style:justify-content={justifyValue(justify)}
|
|
43
|
+
style:gap={gap}
|
|
44
|
+
style:--st-row-gutter={gap}
|
|
45
|
+
>
|
|
46
|
+
{@render children?.()}
|
|
47
|
+
</svelte:element>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.st-row {
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
inline-size: 100%;
|
|
55
|
+
min-width: 0;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { FlexAlign, FlexJustify } from "./Flex.svelte";
|
|
4
|
+
export type RowProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
5
|
+
/** Spacing scale step (0..12) used for the column gutter. */
|
|
6
|
+
gutter?: number;
|
|
7
|
+
align?: FlexAlign;
|
|
8
|
+
justify?: FlexJustify;
|
|
9
|
+
wrap?: boolean;
|
|
10
|
+
as?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
};
|
|
14
|
+
declare const Row: import("svelte").Component<RowProps, {}, "">;
|
|
15
|
+
type Row = ReturnType<typeof Row>;
|
|
16
|
+
export default Row;
|
|
17
|
+
//# sourceMappingURL=Row.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Row.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IAClE,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAiCJ,QAAA,MAAM,GAAG,8CAAwC,CAAC;AAClD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;AAClC,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import type { FlexAlign, FlexJustify } from "./Flex.svelte";
|
|
5
|
+
|
|
6
|
+
export type StackProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
7
|
+
/** Spacing scale step (0..12) mapped to `--st-spacing-*`. */
|
|
8
|
+
gap?: number;
|
|
9
|
+
align?: FlexAlign;
|
|
10
|
+
justify?: FlexJustify;
|
|
11
|
+
as?: string;
|
|
12
|
+
class?: string;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import Flex from "./Flex.svelte";
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
gap,
|
|
22
|
+
align,
|
|
23
|
+
justify,
|
|
24
|
+
as = "div",
|
|
25
|
+
class: className,
|
|
26
|
+
children,
|
|
27
|
+
...rest
|
|
28
|
+
}: StackProps = $props();
|
|
29
|
+
|
|
30
|
+
const classes = $derived(["st-stack", className].filter(Boolean).join(" "));
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<Flex {...rest} {as} {gap} {align} {justify} direction="column" class={classes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</Flex>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { FlexAlign, FlexJustify } from "./Flex.svelte";
|
|
4
|
+
export type StackProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
5
|
+
/** Spacing scale step (0..12) mapped to `--st-spacing-*`. */
|
|
6
|
+
gap?: number;
|
|
7
|
+
align?: FlexAlign;
|
|
8
|
+
justify?: FlexJustify;
|
|
9
|
+
as?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
};
|
|
13
|
+
declare const Stack: import("svelte").Component<StackProps, {}, "">;
|
|
14
|
+
type Stack = ReturnType<typeof Stack>;
|
|
15
|
+
export default Stack;
|
|
16
|
+
//# sourceMappingURL=Stack.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Stack.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IACpE,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA6BJ,QAAA,MAAM,KAAK,gDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|