@streamscloud/kit 0.10.3 → 0.10.5
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/ui/button/cmp.button.svelte +32 -22
- package/dist/ui/button/cmp.button.svelte.d.ts +1 -0
- package/dist/ui/button/types.d.ts +1 -1
- package/dist/ui/divider/cmp.divider.svelte +2 -1
- package/dist/ui/duration/cmp.duration.svelte +2 -1
- package/dist/ui/grid-card/fields/cmp.grid-card-actions-field.svelte +1 -1
- package/dist/ui/grid-card/fields/cmp.grid-card-actions-field.svelte.d.ts +3 -0
- package/dist/ui/grid-card/fields/cmp.grid-card-button.svelte +6 -6
- package/dist/ui/grid-card/fields/cmp.grid-card-button.svelte.d.ts +7 -4
- package/dist/ui/grid-card/fields/cmp.grid-card-id-field.svelte +2 -1
- package/dist/ui/logo/cmp.logo.svelte +2 -1
- package/dist/ui/navigation/cmp.nav-menu-divider.svelte +2 -1
- package/dist/ui/pin-input/cmp.pin-input.svelte +2 -1
- package/dist/ui/progress/cmp.progress.svelte +2 -1
- package/dist/ui/radio/cmp.radio-card.svelte +2 -1
- package/dist/ui/segmented-control/cmp.segmented-control.svelte +2 -1
- package/dist/ui/skeleton/cmp.skeleton.svelte +2 -1
- package/dist/ui/slider/cmp.slider.svelte +2 -1
- package/dist/ui/spinner/cmp.spinner.svelte +2 -1
- package/dist/ui/table/table-cells/table-badge-cell.svelte +1 -1
- package/dist/ui/table/types.d.ts +2 -0
- package/package.json +3 -3
|
@@ -103,6 +103,7 @@ Pass `type="anchor"` to render as `<a>` with `href`. Otherwise `type` is the nat
|
|
|
103
103
|
| `--sc-kit--button--padding-inline` | Inline (horizontal) padding | per size |
|
|
104
104
|
| `--sc-kit--button--font-size` | Label font size | per size |
|
|
105
105
|
| `--sc-kit--button--gap` | Gap between icon and label | per size |
|
|
106
|
+
| `--sc-kit--button--icon-size` | Icon / spinner size | per size (12 / 14 / 16 / 20 px for xs/sm/md/lg) |
|
|
106
107
|
| `--sc-kit--button--border-radius` | Corner rounding | `var(--sc-kit--radius--md)` |
|
|
107
108
|
| `--sc-kit--button--font-weight` | Font weight | `var(--sc-kit--font-weight--regular)` |
|
|
108
109
|
| `--sc-kit--button--width` | Explicit width | `fit-content` |
|
|
@@ -118,10 +119,11 @@ Pass `type="anchor"` to render as `<a>` with `href`. Otherwise `type` is the nat
|
|
|
118
119
|
--_btn--border: var(--sc-kit--button--border, 1px solid transparent);
|
|
119
120
|
--_btn--box-shadow: var(--sc-kit--button--box-shadow, inset 0 2px 0 rgba(255, 255, 255, 0.3));
|
|
120
121
|
--_btn--focus-ring-color: var(--sc-kit--button--focus-ring-color, var(--sc-kit--color--border--focus));
|
|
121
|
-
--_btn--height: var(--sc-kit--button--height,
|
|
122
|
-
--_btn--padding-inline: var(--sc-kit--button--padding-inline, var(--
|
|
123
|
-
--_btn--font-size: var(--sc-kit--button--font-size, var(--
|
|
124
|
-
--_btn--gap: var(--sc-kit--button--gap, var(--
|
|
122
|
+
--_btn--height: var(--sc-kit--button--height, var(--_btn--size-height));
|
|
123
|
+
--_btn--padding-inline: var(--sc-kit--button--padding-inline, var(--_btn--size-padding-inline));
|
|
124
|
+
--_btn--font-size: var(--sc-kit--button--font-size, var(--_btn--size-font-size));
|
|
125
|
+
--_btn--gap: var(--sc-kit--button--gap, var(--_btn--size-gap));
|
|
126
|
+
--_btn--icon-size: var(--sc-kit--button--icon-size, var(--_btn--size-icon-size));
|
|
125
127
|
--_btn--width: var(--sc-kit--button--width, fit-content);
|
|
126
128
|
--_btn--min-width: var(--sc-kit--button--min-width, 0);
|
|
127
129
|
--_btn--max-width: var(--sc-kit--button--max-width, 100%);
|
|
@@ -173,15 +175,16 @@ Pass `type="anchor"` to render as `<a>` with `href`. Otherwise `type` is the nat
|
|
|
173
175
|
text-overflow: ellipsis;
|
|
174
176
|
}
|
|
175
177
|
.btn__icon {
|
|
178
|
+
--sc-kit--icon--size: var(--_btn--icon-size);
|
|
176
179
|
flex-shrink: 0;
|
|
177
180
|
display: inline-flex;
|
|
178
181
|
align-items: center;
|
|
179
182
|
justify-content: center;
|
|
180
|
-
width: var(--
|
|
181
|
-
height: var(--
|
|
183
|
+
width: var(--_btn--icon-size);
|
|
184
|
+
height: var(--_btn--icon-size);
|
|
182
185
|
}
|
|
183
186
|
.btn__spinner {
|
|
184
|
-
--sc-kit--spinner--size: var(--
|
|
187
|
+
--sc-kit--spinner--size: var(--_btn--icon-size);
|
|
185
188
|
flex-shrink: 0;
|
|
186
189
|
display: inline-flex;
|
|
187
190
|
align-items: center;
|
|
@@ -194,26 +197,33 @@ Pass `type="anchor"` to render as `<a>` with `href`. Otherwise `type` is the nat
|
|
|
194
197
|
.btn--disabled {
|
|
195
198
|
cursor: default;
|
|
196
199
|
}
|
|
200
|
+
.btn--xs {
|
|
201
|
+
--_btn--size-height: 1.5rem;
|
|
202
|
+
--_btn--size-padding-inline: var(--sc-kit--space--2);
|
|
203
|
+
--_btn--size-font-size: var(--sc-kit--font-size--xs);
|
|
204
|
+
--_btn--size-gap: var(--sc-kit--space--1);
|
|
205
|
+
--_btn--size-icon-size: 0.875rem;
|
|
206
|
+
}
|
|
197
207
|
.btn--sm {
|
|
198
|
-
--
|
|
199
|
-
--
|
|
200
|
-
--
|
|
201
|
-
--
|
|
202
|
-
--
|
|
208
|
+
--_btn--size-height: 1.75rem;
|
|
209
|
+
--_btn--size-padding-inline: var(--sc-kit--space--3);
|
|
210
|
+
--_btn--size-font-size: var(--sc-kit--font-size--sm);
|
|
211
|
+
--_btn--size-gap: var(--sc-kit--space--1);
|
|
212
|
+
--_btn--size-icon-size: 0.875rem;
|
|
203
213
|
}
|
|
204
214
|
.btn--md {
|
|
205
|
-
--
|
|
206
|
-
--
|
|
207
|
-
--
|
|
208
|
-
--
|
|
209
|
-
--
|
|
215
|
+
--_btn--size-height: 2rem;
|
|
216
|
+
--_btn--size-padding-inline: var(--sc-kit--space--4);
|
|
217
|
+
--_btn--size-font-size: var(--sc-kit--font-size--md);
|
|
218
|
+
--_btn--size-gap: var(--sc-kit--space--2);
|
|
219
|
+
--_btn--size-icon-size: 1rem;
|
|
210
220
|
}
|
|
211
221
|
.btn--lg {
|
|
212
|
-
--
|
|
213
|
-
--
|
|
214
|
-
--
|
|
215
|
-
--
|
|
216
|
-
--
|
|
222
|
+
--_btn--size-height: 2.5rem;
|
|
223
|
+
--_btn--size-padding-inline: var(--sc-kit--space--6);
|
|
224
|
+
--_btn--size-font-size: var(--sc-kit--font-size--lg);
|
|
225
|
+
--_btn--size-gap: var(--sc-kit--space--2);
|
|
226
|
+
--_btn--size-icon-size: 1.25rem;
|
|
217
227
|
}
|
|
218
228
|
.btn--icon-only {
|
|
219
229
|
--sc-kit--button--padding-inline: 0;
|
|
@@ -61,6 +61,7 @@ type Props = ButtonModeProps | AnchorModeProps;
|
|
|
61
61
|
* | `--sc-kit--button--padding-inline` | Inline (horizontal) padding | per size |
|
|
62
62
|
* | `--sc-kit--button--font-size` | Label font size | per size |
|
|
63
63
|
* | `--sc-kit--button--gap` | Gap between icon and label | per size |
|
|
64
|
+
* | `--sc-kit--button--icon-size` | Icon / spinner size | per size (12 / 14 / 16 / 20 px for xs/sm/md/lg) |
|
|
64
65
|
* | `--sc-kit--button--border-radius` | Corner rounding | `var(--sc-kit--radius--md)` |
|
|
65
66
|
* | `--sc-kit--button--font-weight` | Font weight | `var(--sc-kit--font-weight--regular)` |
|
|
66
67
|
* | `--sc-kit--button--width` | Explicit width | `fit-content` |
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'info' | 'success' | 'warning' | 'danger';
|
|
2
|
-
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
2
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">"use strict";
|
|
2
|
+
const { seconds, variant = 'raw', showZero = false } = $props();
|
|
2
3
|
const format = (secs) => {
|
|
3
4
|
const total = Math.max(0, Math.round(secs));
|
|
4
5
|
const hours = Math.floor(total / 3600);
|
|
@@ -6,7 +6,7 @@ const { label, actions } = $props();
|
|
|
6
6
|
<GridCardField label={label}>
|
|
7
7
|
<div class="grid-card-actions-field">
|
|
8
8
|
{#each actions as action (action)}
|
|
9
|
-
<GridCardButton icon={action.icon} text={action.text} on={action.on} />
|
|
9
|
+
<GridCardButton icon={action.icon} text={action.text} variant={action.variant} on={action.on} />
|
|
10
10
|
{/each}
|
|
11
11
|
</div>
|
|
12
12
|
</GridCardField>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { ButtonVariant } from '../../button';
|
|
1
2
|
import type { IconProp } from '../../icon';
|
|
2
3
|
export type GridCardAction = {
|
|
3
4
|
/** Use the `{ src, color }` object form to tint the icon (e.g. `'danger'` for delete) without coloring the whole button. */
|
|
4
5
|
icon: IconProp;
|
|
5
6
|
text?: string;
|
|
7
|
+
/** @default 'ghost' */
|
|
8
|
+
variant?: ButtonVariant;
|
|
6
9
|
on: {
|
|
7
10
|
click: (e: MouseEvent) => void;
|
|
8
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { Button } from '../../button';
|
|
2
2
|
import { IconText } from '../../icon-text';
|
|
3
|
-
const { icon, text, on } = $props();
|
|
3
|
+
const { icon, text, variant = 'ghost', on } = $props();
|
|
4
4
|
const handleClick = (e) => {
|
|
5
5
|
e.stopPropagation();
|
|
6
6
|
on.click(e);
|
|
@@ -8,7 +8,7 @@ const handleClick = (e) => {
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<span class="grid-card-button">
|
|
11
|
-
<Button type="button" variant=
|
|
11
|
+
<Button type="button" variant={variant} size="xs" on={{ click: handleClick }}>
|
|
12
12
|
<IconText icon={icon} hideText={!text} trimText>
|
|
13
13
|
{#if text}{text}{/if}
|
|
14
14
|
</IconText>
|
|
@@ -17,10 +17,10 @@ const handleClick = (e) => {
|
|
|
17
17
|
|
|
18
18
|
<!--
|
|
19
19
|
@component
|
|
20
|
-
Internal compact action button for `GridCard` rows. Kit `Button` `size='
|
|
21
|
-
wrapping an `IconText` so individual action icons can be tinted
|
|
22
|
-
on delete) without coloring the whole button. Click handler stops
|
|
23
|
-
the card's `on.activate`.
|
|
20
|
+
Internal compact action button for `GridCard` rows. Kit `Button` (`size='xs'`, `variant='ghost'` by
|
|
21
|
+
default — override via `variant`) wrapping an `IconText` so individual action icons can be tinted
|
|
22
|
+
(e.g. `{ src, color: 'danger' }` on delete) without coloring the whole button. Click handler stops
|
|
23
|
+
propagation so it doesn't fire the card's `on.activate`.
|
|
24
24
|
-->
|
|
25
25
|
|
|
26
26
|
<style>.grid-card-button {
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
import { type ButtonVariant } from '../../button';
|
|
1
2
|
import type { IconProp } from '../../icon';
|
|
2
3
|
type Props = {
|
|
3
4
|
icon: IconProp;
|
|
4
5
|
text?: string;
|
|
6
|
+
/** @default 'ghost' */
|
|
7
|
+
variant?: ButtonVariant;
|
|
5
8
|
on: {
|
|
6
9
|
click: (e: MouseEvent) => void;
|
|
7
10
|
};
|
|
8
11
|
};
|
|
9
12
|
/**
|
|
10
|
-
* Internal compact action button for `GridCard` rows. Kit `Button` `size='
|
|
11
|
-
* wrapping an `IconText` so individual action icons can be tinted
|
|
12
|
-
* on delete) without coloring the whole button. Click handler stops
|
|
13
|
-
* the card's `on.activate`.
|
|
13
|
+
* Internal compact action button for `GridCard` rows. Kit `Button` (`size='xs'`, `variant='ghost'` by
|
|
14
|
+
* default — override via `variant`) wrapping an `IconText` so individual action icons can be tinted
|
|
15
|
+
* (e.g. `{ src, color: 'danger' }` on delete) without coloring the whole button. Click handler stops
|
|
16
|
+
* propagation so it doesn't fire the card's `on.activate`.
|
|
14
17
|
*/
|
|
15
18
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
16
19
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">"use strict";
|
|
2
|
+
let { mark = false, subheading = null, variant = 'mono', ariaLabel } = $props();
|
|
2
3
|
// Resolve fills per variant. `mono` keeps the existing currentColor behavior;
|
|
3
4
|
// `standard` paints the mark in the brand accent and the type in primary text,
|
|
4
5
|
// matching the Figma master Standard lockup.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">"use strict";
|
|
2
|
+
const { value, length = 6, mask = false, disabled = false, error = false, 'aria-label': ariaLabel, on } = $props();
|
|
2
3
|
let cells = $state([]);
|
|
3
4
|
const cellValue = (i) => value[i] ?? '';
|
|
4
5
|
const emit = (next) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">"use strict";
|
|
2
|
+
let { value, size = 'md', color, label } = $props();
|
|
2
3
|
const clamped = $derived(Math.max(0, Math.min(1, value)));
|
|
3
4
|
const cssWidth = $derived(`${100 * clamped}%`);
|
|
4
5
|
const percent = $derived(Math.round(100 * clamped));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">"use strict";
|
|
2
|
+
const { selected, title, description, disabled = false, name, on } = $props();
|
|
2
3
|
const handleClick = (event) => {
|
|
3
4
|
event.stopPropagation();
|
|
4
5
|
if (disabled || selected) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts" module>export {};
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<script lang="ts" generics="T">
|
|
4
|
+
<script lang="ts" generics="T">"use strict";
|
|
5
|
+
const { value, segments, variant = 'tray', size = 'md', fullWidth = false, compare, on } = $props();
|
|
5
6
|
const isActive = (segment) => (compare ? compare(value, segment.value) : value === segment.value);
|
|
6
7
|
const handleClick = (segment) => {
|
|
7
8
|
if (segment.disabled || isActive(segment)) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">"use strict";
|
|
2
|
+
let { value, min = 0, max = 100, step = 1, disabled = false, showValue = false, withInput = false, ticks = [], valueSuffix = '', on } = $props();
|
|
2
3
|
let focused = $state(false);
|
|
3
4
|
const fillPct = $derived(max === min ? 0 : ((value - min) / (max - min)) * 100);
|
|
4
5
|
const handleInput = (e) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">"use strict";
|
|
2
|
+
let { size = 'md', color, label, position, blocking = false, timeout = 0 } = $props();
|
|
2
3
|
let visible = $state(false);
|
|
3
4
|
$effect(() => {
|
|
4
5
|
if (timeout <= 0) {
|
|
@@ -6,7 +6,7 @@ const variant = $derived(column.variantFactory ? column.variantFactory(item) : '
|
|
|
6
6
|
|
|
7
7
|
{#if getValueForColumn(column, item) !== null}
|
|
8
8
|
<div class="table-badge-cell">
|
|
9
|
-
<Badge variant={variant}>{getValueForColumn(column, item)}</Badge>
|
|
9
|
+
<Badge variant={variant} fullWidth={column.fullWidth}>{getValueForColumn(column, item)}</Badge>
|
|
10
10
|
</div>
|
|
11
11
|
{/if}
|
|
12
12
|
|
package/dist/ui/table/types.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export interface ITableBadgeColumn<T> extends ITableColumn<T> {
|
|
|
40
40
|
type: 'badge';
|
|
41
41
|
variantFactory?: ((item: T) => BadgeVariant) | null;
|
|
42
42
|
valueFactory?: ((item: T) => string) | null;
|
|
43
|
+
/** Stretch the badge to fill the column width. @default false */
|
|
44
|
+
fullWidth?: boolean;
|
|
43
45
|
}
|
|
44
46
|
export interface ITableByColumn<T> extends ITableColumn<T> {
|
|
45
47
|
type: 'by';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamscloud/kit",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"author": "StreamsCloud",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -519,7 +519,7 @@
|
|
|
519
519
|
"nanoid": "^5.1.11",
|
|
520
520
|
"p-limit": "^7.3.0",
|
|
521
521
|
"prettier": "^3.8.3",
|
|
522
|
-
"prettier-plugin-svelte": "^
|
|
522
|
+
"prettier-plugin-svelte": "^4.1.0",
|
|
523
523
|
"publint": "^0.3.21",
|
|
524
524
|
"rfdc": "^1.4.1",
|
|
525
525
|
"sass": "^1.99.0",
|
|
@@ -528,7 +528,7 @@
|
|
|
528
528
|
"svelte-check": "^4.4.8",
|
|
529
529
|
"svelte-dnd-action": "^0.9.69",
|
|
530
530
|
"svelte-preprocess": "^6.0.3",
|
|
531
|
-
"typescript": "^
|
|
531
|
+
"typescript": "^6.0.3",
|
|
532
532
|
"typescript-eslint": "^8.59.3",
|
|
533
533
|
"vite": "^8.0.13",
|
|
534
534
|
"vite-tsconfig-paths": "^6.1.1",
|