@streamscloud/kit 0.10.6 → 0.10.7-1781470550424

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.
@@ -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} variant={action.variant} on={action.on} />
9
+ <GridCardButton icon={action.icon} text={action.text} ariaLabel={action.ariaLabel} variant={action.variant} on={action.on} />
10
10
  {/each}
11
11
  </div>
12
12
  </GridCardField>
@@ -4,6 +4,8 @@ export type GridCardAction = {
4
4
  /** Use the `{ src, color }` object form to tint the icon (e.g. `'danger'` for delete) without coloring the whole button. */
5
5
  icon: IconProp;
6
6
  text?: string;
7
+ /** Accessible name — required for text-less (icon-only) actions. */
8
+ ariaLabel?: string;
7
9
  /** @default 'ghost' */
8
10
  variant?: ButtonVariant;
9
11
  on: {
@@ -1,15 +1,22 @@
1
1
  <script lang="ts">import { Button } from '../../button';
2
- const { icon, text, variant = 'ghost', on } = $props();
2
+ const { icon, text, ariaLabel, variant = 'ghost', on } = $props();
3
3
  const handleClick = (e) => {
4
4
  e.stopPropagation();
5
5
  on.click(e);
6
6
  };
7
7
  </script>
8
8
 
9
+ {#snippet label()}{text}{/snippet}
10
+
9
11
  <span class="grid-card-button">
10
- <Button type="button" variant={variant} icon={icon} size="xs" on={{ click: handleClick }}>
11
- {text}
12
- </Button>
12
+ <Button
13
+ type="button"
14
+ variant={variant}
15
+ icon={icon}
16
+ size="xs"
17
+ aria-label={ariaLabel ?? text}
18
+ children={text ? label : undefined}
19
+ on={{ click: handleClick }} />
13
20
  </span>
14
21
 
15
22
  <!--
@@ -3,6 +3,8 @@ import type { IconProp } from '../../icon';
3
3
  type Props = {
4
4
  icon: IconProp;
5
5
  text?: string;
6
+ /** Accessible name — required for text-less (icon-only) actions. */
7
+ ariaLabel?: string;
6
8
  /** @default 'ghost' */
7
9
  variant?: ButtonVariant;
8
10
  on: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.10.6",
3
+ "version": "0.10.7-1781470550424",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",