@streamscloud/kit 0.10.4 → 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.
@@ -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, 2rem);
122
- --_btn--padding-inline: var(--sc-kit--button--padding-inline, var(--sc-kit--space--4));
123
- --_btn--font-size: var(--sc-kit--button--font-size, var(--sc-kit--font-size--md));
124
- --_btn--gap: var(--sc-kit--button--gap, var(--sc-kit--space--2));
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(--sc-kit--icon--size);
181
- height: var(--sc-kit--icon--size);
183
+ width: var(--_btn--icon-size);
184
+ height: var(--_btn--icon-size);
182
185
  }
183
186
  .btn__spinner {
184
- --sc-kit--spinner--size: var(--sc-kit--icon--size);
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
- --sc-kit--button--height: 1.75rem;
199
- --sc-kit--button--padding-inline: var(--sc-kit--space--3);
200
- --sc-kit--button--font-size: var(--sc-kit--font-size--sm);
201
- --sc-kit--button--gap: var(--sc-kit--space--1);
202
- --sc-kit--icon--size: 0.875rem;
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
- --sc-kit--button--height: 2rem;
206
- --sc-kit--button--padding-inline: var(--sc-kit--space--4);
207
- --sc-kit--button--font-size: var(--sc-kit--font-size--md);
208
- --sc-kit--button--gap: var(--sc-kit--space--2);
209
- --sc-kit--icon--size: 1rem;
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
- --sc-kit--button--height: 2.5rem;
213
- --sc-kit--button--padding-inline: var(--sc-kit--space--6);
214
- --sc-kit--button--font-size: var(--sc-kit--font-size--lg);
215
- --sc-kit--button--gap: var(--sc-kit--space--2);
216
- --sc-kit--icon--size: 1.25rem;
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';
@@ -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="ghost" size="sm" on={{ click: handleClick }}>
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='sm'` + `variant='ghost'`
21
- wrapping an `IconText` so individual action icons can be tinted (e.g. `{ src, color: 'danger' }`
22
- on delete) without coloring the whole button. Click handler stops propagation so it doesn't fire
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='sm'` + `variant='ghost'`
11
- * wrapping an `IconText` so individual action icons can be tinted (e.g. `{ src, color: 'danger' }`
12
- * on delete) without coloring the whole button. Click handler stops propagation so it doesn't fire
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",