@streamscloud/kit 0.20.4 → 0.21.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.
|
@@ -116,6 +116,7 @@ Pass `type="anchor"` to render as `<a>` with `href`, or `type="presentational"`
|
|
|
116
116
|
| `--sc-kit--button--width` | Explicit width | `fit-content` |
|
|
117
117
|
| `--sc-kit--button--min-width` | Minimum width | `0` |
|
|
118
118
|
| `--sc-kit--button--max-width` | Maximum width | `100%` |
|
|
119
|
+
| `--sc-kit--button--justify-content` | Alignment of the button's content along the inline axis | `center` |
|
|
119
120
|
-->
|
|
120
121
|
|
|
121
122
|
<style>.btn {
|
|
@@ -134,12 +135,13 @@ Pass `type="anchor"` to render as `<a>` with `href`, or `type="presentational"`
|
|
|
134
135
|
--_btn--width: var(--sc-kit--button--width, fit-content);
|
|
135
136
|
--_btn--min-width: var(--sc-kit--button--min-width, 0);
|
|
136
137
|
--_btn--max-width: var(--sc-kit--button--max-width, 100%);
|
|
138
|
+
--_btn--justify-content: var(--sc-kit--button--justify-content, center);
|
|
137
139
|
--_btn--border-radius: var(--sc-kit--button--border-radius, var(--_btn--size-border-radius, var(--sc-kit--field--border-radius--md)));
|
|
138
140
|
--_btn--font-weight: var(--sc-kit--button--font-weight, var(--sc-kit--font-weight--regular));
|
|
139
141
|
box-sizing: border-box;
|
|
140
142
|
display: flex;
|
|
141
143
|
align-items: center;
|
|
142
|
-
justify-content:
|
|
144
|
+
justify-content: var(--_btn--justify-content);
|
|
143
145
|
gap: var(--_btn--gap);
|
|
144
146
|
width: var(--_btn--width);
|
|
145
147
|
min-width: var(--_btn--min-width);
|
|
@@ -73,6 +73,7 @@ type Props = ButtonModeProps | AnchorModeProps | PresentationalModeProps;
|
|
|
73
73
|
* | `--sc-kit--button--width` | Explicit width | `fit-content` |
|
|
74
74
|
* | `--sc-kit--button--min-width` | Minimum width | `0` |
|
|
75
75
|
* | `--sc-kit--button--max-width` | Maximum width | `100%` |
|
|
76
|
+
* | `--sc-kit--button--justify-content` | Alignment of the button's content along the inline axis | `center` |
|
|
76
77
|
*/
|
|
77
78
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
78
79
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script lang="ts">"use strict";
|
|
2
|
-
let { shape = 'rect', lines = 1 } = $props();
|
|
2
|
+
let { shape = 'rect', lines = 1, shimmer = false } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
{#if shape === 'text' && lines > 1}
|
|
6
6
|
<span class="skeleton-stack">
|
|
7
7
|
{#each Array(lines) as _, i (i)}
|
|
8
|
-
<span class="skeleton skeleton--text" class:skeleton--text-last={i === lines - 1}></span>
|
|
8
|
+
<span class="skeleton skeleton--text" class:skeleton--shimmer={shimmer} class:skeleton--text-last={i === lines - 1}></span>
|
|
9
9
|
{/each}
|
|
10
10
|
</span>
|
|
11
11
|
{:else}
|
|
12
|
-
<span class="skeleton skeleton--{shape}"></span>
|
|
12
|
+
<span class="skeleton skeleton--{shape}" class:skeleton--shimmer={shimmer}></span>
|
|
13
13
|
{/if}
|
|
14
14
|
|
|
15
15
|
<!--
|
|
@@ -24,10 +24,10 @@ Skeleton — content placeholder rendered while data is loading. Three shapes: `
|
|
|
24
24
|
| `--sc-kit--skeleton--text-height` | Per-line height in `shape='text'` | `0.75em` |
|
|
25
25
|
| `--sc-kit--skeleton--text-last-width` | Width of the last line in multi-line text | `70%` |
|
|
26
26
|
| `--sc-kit--skeleton--text-gap` | Vertical gap between text lines | `--sc-kit--space--2` |
|
|
27
|
-
| `--sc-kit--skeleton--base-color` |
|
|
28
|
-
| `--sc-kit--skeleton--highlight-color` | Shimmer peak (lighter stop) | `--sc-kit--color--bg--hover` |
|
|
27
|
+
| `--sc-kit--skeleton--base-color` | Placeholder fill / shimmer darker stop | `--sc-kit--color--bg--active` |
|
|
28
|
+
| `--sc-kit--skeleton--highlight-color` | Shimmer peak (lighter stop) — `shimmer` only | `--sc-kit--color--bg--hover` |
|
|
29
29
|
| `--sc-kit--skeleton--radius` | Corner radius (rect / text) | `--sc-kit--radius--sm` |
|
|
30
|
-
| `--sc-kit--skeleton--duration` |
|
|
30
|
+
| `--sc-kit--skeleton--duration` | Shimmer cycle length — `shimmer` only | `2.2s` |
|
|
31
31
|
-->
|
|
32
32
|
|
|
33
33
|
<style>.skeleton {
|
|
@@ -36,17 +36,26 @@ Skeleton — content placeholder rendered while data is loading. Three shapes: `
|
|
|
36
36
|
--_skeleton--text-height: var(--sc-kit--skeleton--text-height, 0.75em);
|
|
37
37
|
--_skeleton--text-last-width: var(--sc-kit--skeleton--text-last-width, 70%);
|
|
38
38
|
--_skeleton--base-color: var(--sc-kit--skeleton--base-color, var(--sc-kit--color--bg--active));
|
|
39
|
-
--_skeleton--highlight-color: var(--sc-kit--skeleton--highlight-color, var(--sc-kit--color--bg--hover));
|
|
40
39
|
--_skeleton--radius: var(--sc-kit--skeleton--radius, var(--sc-kit--radius--sm));
|
|
41
|
-
--_skeleton--duration: var(--sc-kit--skeleton--duration, 2.2s);
|
|
42
40
|
display: block;
|
|
43
|
-
background:
|
|
44
|
-
background-size: 200% 100%;
|
|
45
|
-
animation: kit-skeleton-shimmer var(--_skeleton--duration) ease-in-out infinite;
|
|
41
|
+
background: var(--_skeleton--base-color);
|
|
46
42
|
border-radius: var(--_skeleton--radius);
|
|
47
43
|
width: var(--_skeleton--width);
|
|
48
44
|
height: var(--_skeleton--height);
|
|
49
45
|
}
|
|
46
|
+
.skeleton--shimmer {
|
|
47
|
+
--_skeleton--highlight-color: var(--sc-kit--skeleton--highlight-color, var(--sc-kit--color--bg--hover));
|
|
48
|
+
--_skeleton--duration: var(--sc-kit--skeleton--duration, 2.2s);
|
|
49
|
+
background: linear-gradient(90deg, var(--_skeleton--base-color) 0%, var(--_skeleton--highlight-color) 50%, var(--_skeleton--base-color) 100%);
|
|
50
|
+
background-size: 200% 100%;
|
|
51
|
+
animation: kit-skeleton-shimmer var(--_skeleton--duration) ease-in-out infinite;
|
|
52
|
+
}
|
|
53
|
+
@media (prefers-reduced-motion: reduce) {
|
|
54
|
+
.skeleton--shimmer {
|
|
55
|
+
background: var(--_skeleton--base-color);
|
|
56
|
+
animation: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
50
59
|
.skeleton--circle {
|
|
51
60
|
border-radius: 50%;
|
|
52
61
|
}
|
|
@@ -57,12 +66,6 @@ Skeleton — content placeholder rendered while data is loading. Three shapes: `
|
|
|
57
66
|
width: var(--_skeleton--text-last-width);
|
|
58
67
|
}
|
|
59
68
|
|
|
60
|
-
.skeleton-stack {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
gap: var(--sc-kit--skeleton--text-gap, var(--sc-kit--space--2));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
69
|
@keyframes kit-skeleton-shimmer {
|
|
67
70
|
0% {
|
|
68
71
|
background-position: 200% 0;
|
|
@@ -70,4 +73,9 @@ Skeleton — content placeholder rendered while data is loading. Three shapes: `
|
|
|
70
73
|
100% {
|
|
71
74
|
background-position: -200% 0;
|
|
72
75
|
}
|
|
76
|
+
}
|
|
77
|
+
.skeleton-stack {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
gap: var(--sc-kit--skeleton--text-gap, var(--sc-kit--space--2));
|
|
73
81
|
}</style>
|
|
@@ -3,6 +3,8 @@ type Props = {
|
|
|
3
3
|
shape?: 'rect' | 'circle' | 'text';
|
|
4
4
|
/** For `shape='text'` only — render N stacked text lines (last one naturally shorter to suggest paragraph end). @default 1 */
|
|
5
5
|
lines?: number;
|
|
6
|
+
/** Animate a shimmer sweep instead of a flat static placeholder. @default false */
|
|
7
|
+
shimmer?: boolean;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
10
|
* Skeleton — content placeholder rendered while data is loading. Three shapes: `rect` (default — generic block), `circle` (avatars), `text` (one or more text lines via `lines` — the last line is naturally shorter to suggest a paragraph end). All dimensions are CSS-var driven; sizing is the consumer's concern.
|
|
@@ -15,10 +17,10 @@ type Props = {
|
|
|
15
17
|
* | `--sc-kit--skeleton--text-height` | Per-line height in `shape='text'` | `0.75em` |
|
|
16
18
|
* | `--sc-kit--skeleton--text-last-width` | Width of the last line in multi-line text | `70%` |
|
|
17
19
|
* | `--sc-kit--skeleton--text-gap` | Vertical gap between text lines | `--sc-kit--space--2` |
|
|
18
|
-
* | `--sc-kit--skeleton--base-color` |
|
|
19
|
-
* | `--sc-kit--skeleton--highlight-color` | Shimmer peak (lighter stop) | `--sc-kit--color--bg--hover` |
|
|
20
|
+
* | `--sc-kit--skeleton--base-color` | Placeholder fill / shimmer darker stop | `--sc-kit--color--bg--active` |
|
|
21
|
+
* | `--sc-kit--skeleton--highlight-color` | Shimmer peak (lighter stop) — `shimmer` only | `--sc-kit--color--bg--hover` |
|
|
20
22
|
* | `--sc-kit--skeleton--radius` | Corner radius (rect / text) | `--sc-kit--radius--sm` |
|
|
21
|
-
* | `--sc-kit--skeleton--duration` |
|
|
23
|
+
* | `--sc-kit--skeleton--duration` | Shimmer cycle length — `shimmer` only | `2.2s` |
|
|
22
24
|
*/
|
|
23
25
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
24
26
|
type Cmp = ReturnType<typeof Cmp>;
|