@streamscloud/kit 0.10.4 → 0.10.6
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/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 +7 -10
- package/dist/ui/grid-card/fields/cmp.grid-card-button.svelte.d.ts +7 -4
- package/package.json +1 -1
|
@@ -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 (14 / 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 (14 / 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';
|
|
@@ -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,5 @@
|
|
|
1
1
|
<script lang="ts">import { Button } from '../../button';
|
|
2
|
-
|
|
3
|
-
const { icon, text, on } = $props();
|
|
2
|
+
const { icon, text, variant = 'ghost', on } = $props();
|
|
4
3
|
const handleClick = (e) => {
|
|
5
4
|
e.stopPropagation();
|
|
6
5
|
on.click(e);
|
|
@@ -8,19 +7,17 @@ const handleClick = (e) => {
|
|
|
8
7
|
</script>
|
|
9
8
|
|
|
10
9
|
<span class="grid-card-button">
|
|
11
|
-
<Button type="button" variant=
|
|
12
|
-
|
|
13
|
-
{#if text}{text}{/if}
|
|
14
|
-
</IconText>
|
|
10
|
+
<Button type="button" variant={variant} icon={icon} size="xs" on={{ click: handleClick }}>
|
|
11
|
+
{text}
|
|
15
12
|
</Button>
|
|
16
13
|
</span>
|
|
17
14
|
|
|
18
15
|
<!--
|
|
19
16
|
@component
|
|
20
|
-
Internal compact action button for `GridCard` rows. Kit `Button` `size='
|
|
21
|
-
|
|
22
|
-
on delete) without coloring the whole button. Click handler stops
|
|
23
|
-
the card's `on.activate`.
|
|
17
|
+
Internal compact action button for `GridCard` rows. Kit `Button` at `size='xs'`, `variant='ghost'` by
|
|
18
|
+
default — override via `variant`. Pass the `{ src, color }` icon object form to tint an individual
|
|
19
|
+
action icon (e.g. `'danger'` on delete) without coloring the whole button. Click handler stops
|
|
20
|
+
propagation so it doesn't fire the card's `on.activate`.
|
|
24
21
|
-->
|
|
25
22
|
|
|
26
23
|
<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
|
-
*
|
|
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` at `size='xs'`, `variant='ghost'` by
|
|
14
|
+
* default — override via `variant`. Pass the `{ src, color }` icon object form to tint an individual
|
|
15
|
+
* action icon (e.g. `'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>;
|