@streamscloud/kit 0.81.0 → 0.81.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.
Files changed (50) hide show
  1. package/dist/core/utils/html-helper.d.ts +2 -0
  2. package/dist/core/utils/html-helper.js +62 -8
  3. package/dist/styles/_mixins.scss +12 -0
  4. package/dist/ui/color-picker/cmp.color-picker.svelte +2 -2
  5. package/dist/ui/color-picker/cmp.color-picker.svelte.d.ts +2 -0
  6. package/dist/ui/dialog/cmp.dialog-container.svelte +9 -0
  7. package/dist/ui/dialog/cmp.dialog.svelte +1 -1
  8. package/dist/ui/dialog/cmp.dialog.svelte.d.ts +1 -1
  9. package/dist/ui/dialog/dialog-controller.d.ts +2 -0
  10. package/dist/ui/dialog/dialog-controller.js +3 -0
  11. package/dist/ui/dialog/layout/cmp.frameless-dialog.svelte +1 -1
  12. package/dist/ui/dialog/layout/cmp.stepper-dialog.svelte +1 -1
  13. package/dist/ui/file-uploader/cmp.file-uploader.svelte +4 -1
  14. package/dist/ui/file-uploader/file-uploader-localization.d.ts +1 -0
  15. package/dist/ui/file-uploader/file-uploader-localization.js +7 -0
  16. package/dist/ui/form-field/cmp.form-field-validatable.svelte +22 -37
  17. package/dist/ui/form-field/cmp.form-field-validatable.svelte.d.ts +3 -25
  18. package/dist/ui/form-field/cmp.form-field.svelte +23 -12
  19. package/dist/ui/form-field/cmp.form-field.svelte.d.ts +7 -7
  20. package/dist/ui/navigation/cmp.nav-rail-item.svelte +17 -0
  21. package/dist/ui/navigation/cmp.nav-rail-item.svelte.d.ts +1 -1
  22. package/dist/ui/navigation/cmp.nav-rail.svelte +4 -4
  23. package/dist/ui/navigation/cmp.nav-rail.svelte.d.ts +2 -0
  24. package/dist/ui/navigation/nav-rail-item-localization.d.ts +3 -0
  25. package/dist/ui/navigation/nav-rail-item-localization.js +12 -0
  26. package/dist/ui/pin-input/cmp.pin-input.svelte +5 -2
  27. package/dist/ui/pin-input/cmp.pin-input.svelte.d.ts +1 -0
  28. package/dist/ui/pin-input/pin-input-localization.d.ts +3 -0
  29. package/dist/ui/pin-input/pin-input-localization.js +12 -0
  30. package/dist/ui/segmented-control/cmp.segmented-control.svelte +52 -12
  31. package/dist/ui/segmented-control/cmp.segmented-control.svelte.d.ts +12 -10
  32. package/dist/ui/table/cmp.table-draggable.svelte.d.ts +6 -0
  33. package/dist/ui/table/cmp.table.svelte.d.ts +4 -0
  34. package/dist/ui/table/table-cells/table-actions-cell.svelte +3 -1
  35. package/dist/ui/table/table-cells/table-by-cell.svelte +1 -1
  36. package/dist/ui/table/table-core.svelte +51 -7
  37. package/dist/ui/table/table-core.svelte.d.ts +4 -0
  38. package/dist/ui/table/table-localization.d.ts +1 -0
  39. package/dist/ui/table/table-localization.js +7 -0
  40. package/dist/ui/toast/cmp.toast-item.svelte +29 -4
  41. package/dist/ui/toast/types.d.ts +1 -1
  42. package/dist/ui/tooltip/cmp.tooltip.svelte +15 -4
  43. package/dist/ui/tooltip/cmp.tooltip.svelte.d.ts +7 -2
  44. package/dist/ui/validatable/cmp.validatable.svelte +6 -42
  45. package/dist/ui/validatable/cmp.validatable.svelte.d.ts +9 -43
  46. package/dist/ui/validatable/cmp.validation-error.svelte +3 -2
  47. package/dist/ui/validatable/cmp.validation-error.svelte.d.ts +4 -1
  48. package/dist/ui/validatable/field-frame.svelte +2 -2
  49. package/dist/ui/validatable/field-frame.svelte.d.ts +2 -0
  50. package/package.json +1 -1
@@ -3,6 +3,8 @@ export type FieldBinding<V> = {
3
3
  name: string;
4
4
  value: V;
5
5
  error: boolean;
6
+ /** Id of the visible error message, set only while the error is shown. */
7
+ 'aria-describedby'?: string;
6
8
  on: {
7
9
  input: (v: V) => void;
8
10
  change: (v: V) => void;
@@ -47,8 +49,10 @@ declare function $$render<T extends Record<string, unknown>, K extends keyof T &
47
49
  blur?: () => void;
48
50
  };
49
51
  /**
50
- * Receives a wired `FieldBinding<T[K]>` to spread into a kit input, plus a `validating` flag —
51
- * true from the value change until the validator has caught up, debounce window included.
52
+ * Receives a wired `FieldBinding<T[K]>` to spread into a kit input (`aria-describedby` points at the visible error message; inputs without that
53
+ * prop ignore it; a control whose value prop is not `value`, e.g. `Checkbox`, is wired by hand), plus a `validating` flag — true from the value
54
+ * change until the validator has caught up, debounce window included, which `handler.isValidating` does not cover. With a `validateOn` that
55
+ * excludes `input` and `change` the flag stays true for the whole typing session.
52
56
  */
53
57
  children: Snippet<[FieldBinding<T[K]>, boolean]>;
54
58
  };
@@ -72,47 +76,9 @@ interface $$IsomorphicComponent {
72
76
  z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
73
77
  }
74
78
  /**
75
- * Binds a form field to any kit input via a render-prop snippet. The base inputs stay unchanged;
76
- * `Validatable` is the only place that knows about `FormValidationHandler`. Wraps children in an
77
- * internal `FieldFrame` that renders the error message below the field, placed per `errorPlacement`.
78
- *
79
- * ### Usage
80
- * ```svelte
81
- * <Validatable {handler} name="email">
82
- * {#snippet children(field)}
83
- * <Input {...field} placeholder="Email" />
84
- * {/snippet}
85
- * </Validatable>
86
- * ```
87
- *
88
- * The first snippet argument has shape `{ name, value, error, on: { input, change, blur } }` — the
89
- * minimal interface every kit input supports. Inputs whose primary value prop is not `value`
90
- * (e.g. `Checkbox` uses `checked`) wire the field explicitly inside the snippet.
91
- *
92
- * ### Validating flag
93
- * The second snippet argument is true from the value change until the validator has caught up — the
94
- * debounce window included, which `handler.isValidating` does not cover. Drives an inline async
95
- * indicator; everything else it might pair with is already public (`field.error` for the gated error
96
- * state, `handler.errors[name]` for the text, `handler.touched[name]`):
97
- *
98
- * ```svelte
99
- * <Validatable {handler} name="handle" debounceMs={400}>
100
- * {#snippet children(field, validating)}
101
- * <HandleInput {...field} status={validating ? 'checking' : field.error ? 'taken' : handler.touched.handle ? 'available' : undefined} />
102
- * {/snippet}
103
- * </Validatable>
104
- * ```
105
- *
106
- * With a `validateOn` that excludes `input` and `change`, the flag stays true for the whole typing
107
- * session — pair an async indicator with the default `validateOn` plus a `debounceMs`.
108
- *
109
- * ### Validation events
110
- * `validateOn` accepts an array. Default `['input', 'change', 'blur']` validates on every event.
111
- * Pass `['blur']` for blur-only validation, `['change', 'blur']` for the classic "validate on commit" pattern.
112
- *
113
- * ### Consumer callbacks
114
- * Pass extra callbacks via `Validatable`'s own `on={...}` — they run AFTER the validation wiring
115
- * and cannot override it.
79
+ * Binds any kit input to a `FormValidationHandler` through a render-prop snippet that receives the wired field, and renders the error message below
80
+ * it per `errorPlacement`. Inputs stay unaware of validation; around a `FormField`, keep `Validatable` on the outside so the error stays out of the
81
+ * field's name.
116
82
  */
117
83
  declare const Cmp: $$IsomorphicComponent;
118
84
  type Cmp<T extends Record<string, unknown>, K extends keyof T & string> = InstanceType<typeof Cmp<T, K>>;
@@ -1,10 +1,11 @@
1
1
  <script lang="ts" generics="T extends Record<string, unknown>">import { default as FieldFrame } from './field-frame.svelte';
2
2
  let { name, validationResult, errorPlacement = 'overlay', children } = $props();
3
3
  const errorText = $derived(validationResult?.errors[name] ?? null);
4
+ const messageId = $props.id();
4
5
  </script>
5
6
 
6
- <FieldFrame error={errorText} errorPlacement={errorPlacement}>
7
- {@render children()}
7
+ <FieldFrame error={errorText} errorPlacement={errorPlacement} messageId={messageId}>
8
+ {@render children({ 'aria-describedby': errorText ? messageId : undefined })}
8
9
  </FieldFrame>
9
10
 
10
11
  <!--
@@ -13,7 +13,10 @@ declare function $$render<T extends Record<string, unknown>>(): {
13
13
  * @default 'overlay'
14
14
  */
15
15
  errorPlacement?: ErrorPlacement;
16
- children: Snippet;
16
+ /** Receives `aria-describedby` pointing at the visible error message — spread it onto the field. */
17
+ children: Snippet<[{
18
+ "aria-describedby"?: string;
19
+ }]>;
17
20
  };
18
21
  exports: {};
19
22
  bindings: "";
@@ -1,11 +1,11 @@
1
- <script lang="ts">let { error, errorPlacement = 'overlay', children } = $props();
1
+ <script lang="ts">let { error, errorPlacement = 'overlay', messageId, children } = $props();
2
2
  export {};
3
3
  </script>
4
4
 
5
5
  <div class="field-frame" class:field-frame--reserved={errorPlacement === 'reserved'}>
6
6
  {@render children()}
7
7
  {#if error}
8
- <small class="field-frame__message field-frame__message--{errorPlacement}">{error}</small>
8
+ <small id={messageId} class="field-frame__message field-frame__message--{errorPlacement}">{error}</small>
9
9
  {/if}
10
10
  </div>
11
11
 
@@ -5,6 +5,8 @@ type Props = {
5
5
  error?: string | null | undefined;
6
6
  /** Where the error message sits relative to the field. @default 'overlay' */
7
7
  errorPlacement?: ErrorPlacement;
8
+ /** Id of the message element — the field points `aria-describedby` at it while the error is shown. */
9
+ messageId: string;
8
10
  children: Snippet;
9
11
  };
10
12
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.81.0",
3
+ "version": "0.81.1",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",