@streamscloud/kit 0.16.2 → 0.18.0

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 (113) hide show
  1. package/dist/styles/_semantic.scss +3 -0
  2. package/dist/ui/badge/cmp.badge.svelte +4 -0
  3. package/dist/ui/badge/cmp.badge.svelte.d.ts +1 -0
  4. package/dist/ui/button/cmp.button.svelte +6 -2
  5. package/dist/ui/button/cmp.button.svelte.d.ts +1 -1
  6. package/dist/ui/date-picker/cmp.date-picker.svelte +21 -18
  7. package/dist/ui/date-picker/cmp.date-picker.svelte.d.ts +1 -1
  8. package/dist/ui/form-field/cmp.form-field-validatable.svelte +1 -1
  9. package/dist/ui/form-field/cmp.form-field-validatable.svelte.d.ts +1 -1
  10. package/dist/ui/input/cmp.input.svelte +21 -18
  11. package/dist/ui/input/cmp.input.svelte.d.ts +1 -1
  12. package/dist/ui/numeral-input/cmp.numeral-input.svelte +21 -18
  13. package/dist/ui/numeral-input/cmp.numeral-input.svelte.d.ts +1 -1
  14. package/dist/ui/page-toolbar/cmp.reorderable-checkbox-list.svelte +131 -0
  15. package/dist/ui/page-toolbar/cmp.reorderable-checkbox-list.svelte.d.ts +31 -0
  16. package/dist/ui/page-toolbar/cmp.toolbar-checkbox.svelte +14 -0
  17. package/dist/ui/page-toolbar/cmp.toolbar-checkbox.svelte.d.ts +19 -0
  18. package/dist/ui/page-toolbar/cmp.toolbar-divider.svelte +19 -0
  19. package/dist/ui/page-toolbar/cmp.toolbar-divider.svelte.d.ts +35 -0
  20. package/dist/ui/page-toolbar/cmp.toolbar-filter-select.svelte +143 -0
  21. package/dist/ui/page-toolbar/cmp.toolbar-filter-select.svelte.d.ts +68 -0
  22. package/dist/ui/page-toolbar/cmp.toolbar-icon-button.svelte +71 -0
  23. package/dist/ui/page-toolbar/cmp.toolbar-icon-button.svelte.d.ts +32 -0
  24. package/dist/ui/page-toolbar/cmp.toolbar-option.svelte +189 -0
  25. package/dist/ui/page-toolbar/cmp.toolbar-option.svelte.d.ts +47 -0
  26. package/dist/ui/page-toolbar/cmp.toolbar-popover.svelte +23 -8
  27. package/dist/ui/page-toolbar/cmp.toolbar-popover.svelte.d.ts +14 -6
  28. package/dist/ui/page-toolbar/cmp.toolbar-section-title.svelte +46 -0
  29. package/dist/ui/page-toolbar/cmp.toolbar-section-title.svelte.d.ts +24 -0
  30. package/dist/ui/page-toolbar/cmp.toolbar-sort-select.svelte +31 -0
  31. package/dist/ui/page-toolbar/cmp.toolbar-sort-select.svelte.d.ts +44 -0
  32. package/dist/ui/page-toolbar/{cmp.toolbar-switch-item.svelte → cmp.toolbar-switch.svelte} +10 -10
  33. package/dist/ui/page-toolbar/{cmp.toolbar-switch-item.svelte.d.ts → cmp.toolbar-switch.svelte.d.ts} +2 -2
  34. package/dist/ui/page-toolbar/cmp.toolbar-toggle.svelte +14 -0
  35. package/dist/ui/page-toolbar/cmp.toolbar-toggle.svelte.d.ts +19 -0
  36. package/dist/ui/page-toolbar/cmp.toolbar-value-stepper.svelte +4 -1
  37. package/dist/ui/page-toolbar/cmp.toolbar-view-controls.svelte +51 -0
  38. package/dist/ui/page-toolbar/cmp.toolbar-view-controls.svelte.d.ts +27 -0
  39. package/dist/ui/page-toolbar/index.d.ts +12 -7
  40. package/dist/ui/page-toolbar/index.js +11 -6
  41. package/dist/ui/page-toolbar/reorderable-checkbox-list-localization.d.ts +5 -0
  42. package/dist/ui/page-toolbar/reorderable-checkbox-list-localization.js +17 -0
  43. package/dist/ui/page-toolbar/toolbar-filter-select-localization.d.ts +5 -0
  44. package/dist/ui/page-toolbar/toolbar-filter-select-localization.js +20 -0
  45. package/dist/ui/page-toolbar/toolbar-sort-select-localization.d.ts +3 -0
  46. package/dist/ui/page-toolbar/toolbar-sort-select-localization.js +9 -0
  47. package/dist/ui/page-toolbar/toolbar-view-controls-localization.d.ts +5 -0
  48. package/dist/ui/page-toolbar/toolbar-view-controls-localization.js +17 -0
  49. package/dist/ui/page-toolbar/types.d.ts +1 -1
  50. package/dist/ui/rich-text-input/cmp.rich-text-input.svelte +9 -6
  51. package/dist/ui/rich-text-input/cmp.rich-text-input.svelte.d.ts +1 -1
  52. package/dist/ui/segmented-control/cmp.segmented-control.svelte +4 -2
  53. package/dist/ui/segmented-control/cmp.segmented-control.svelte.d.ts +1 -1
  54. package/dist/ui/select/_select-trigger.scss +20 -17
  55. package/dist/ui/select/cmp.singleselect-async.svelte +20 -17
  56. package/dist/ui/select/index.d.ts +1 -0
  57. package/dist/ui/select/index.js +1 -0
  58. package/dist/ui/select/multiselect-base.svelte +21 -18
  59. package/dist/ui/select/select-listbox.svelte +11 -5
  60. package/dist/ui/select/select-listbox.svelte.d.ts +1 -1
  61. package/dist/ui/table/_table-styles.scss +156 -0
  62. package/dist/ui/table/cmp.table-draggable.svelte +338 -0
  63. package/dist/ui/table/cmp.table-draggable.svelte.d.ts +79 -0
  64. package/dist/ui/table/cmp.table.svelte +96 -265
  65. package/dist/ui/table/cmp.table.svelte.d.ts +16 -8
  66. package/dist/ui/table/index.d.ts +1 -0
  67. package/dist/ui/table/index.js +1 -0
  68. package/dist/ui/table/table-cells/index.d.ts +1 -12
  69. package/dist/ui/table/table-cells/index.js +1 -12
  70. package/dist/ui/table/table-cells/table-cell.svelte +77 -0
  71. package/dist/ui/table/table-cells/{table-select-cell.svelte.d.ts → table-cell.svelte.d.ts} +12 -6
  72. package/dist/ui/table/table-column-models.svelte.d.ts +1 -2
  73. package/dist/ui/table/table-column-models.svelte.js +0 -1
  74. package/dist/ui/table/table-columns-manager/cmp.table-columns-manager.svelte +20 -47
  75. package/dist/ui/table/table-columns-manager/cmp.table-columns-manager.svelte.d.ts +3 -7
  76. package/dist/ui/table/table-columns-manager/table-columns-manager-localization.d.ts +1 -1
  77. package/dist/ui/table/table-columns-manager/table-columns-manager-localization.js +7 -7
  78. package/dist/ui/table/table-localization.d.ts +0 -2
  79. package/dist/ui/table/table-localization.js +0 -14
  80. package/dist/ui/table/table-model.svelte.d.ts +2 -3
  81. package/dist/ui/table/table-model.svelte.js +5 -35
  82. package/dist/ui/table/table-view.svelte.d.ts +14 -0
  83. package/dist/ui/table/table-view.svelte.js +32 -0
  84. package/dist/ui/table/types.d.ts +5 -28
  85. package/dist/ui/textarea/cmp.textarea.svelte +17 -14
  86. package/dist/ui/textarea/cmp.textarea.svelte.d.ts +1 -1
  87. package/dist/ui/toggle/cmp.toggle.svelte +32 -26
  88. package/dist/ui/toggle/cmp.toggle.svelte.d.ts +2 -0
  89. package/dist/ui/tree/cmp.tree-node-view.svelte +7 -2
  90. package/dist/ui/tree/cmp.tree.svelte +9 -1
  91. package/dist/ui/tree/cmp.tree.svelte.d.ts +1 -1
  92. package/dist/ui/tree/tree-navigation.svelte.d.ts +2 -0
  93. package/dist/ui/tree/tree-navigation.svelte.js +3 -0
  94. package/dist/ui/validatable/cmp.validatable.svelte +5 -5
  95. package/dist/ui/validatable/cmp.validatable.svelte.d.ts +2 -2
  96. package/dist/ui/validatable/cmp.validation-error.svelte +4 -4
  97. package/dist/ui/validatable/cmp.validation-error.svelte.d.ts +1 -1
  98. package/dist/ui/validatable/{cmp.field-error.svelte → field-frame.svelte} +6 -6
  99. package/dist/ui/validatable/{cmp.field-error.svelte.d.ts → field-frame.svelte.d.ts} +4 -4
  100. package/package.json +1 -1
  101. package/dist/ui/page-toolbar/cmp.reorderable-toggle-list.svelte +0 -153
  102. package/dist/ui/page-toolbar/cmp.reorderable-toggle-list.svelte.d.ts +0 -20
  103. package/dist/ui/page-toolbar/cmp.toolbar-checkbox-item.svelte +0 -19
  104. package/dist/ui/page-toolbar/cmp.toolbar-checkbox-item.svelte.d.ts +0 -12
  105. package/dist/ui/page-toolbar/cmp.toolbar-panel-button.svelte +0 -42
  106. package/dist/ui/page-toolbar/cmp.toolbar-panel-button.svelte.d.ts +0 -20
  107. package/dist/ui/page-toolbar/cmp.toolbar-panel.svelte +0 -57
  108. package/dist/ui/page-toolbar/cmp.toolbar-panel.svelte.d.ts +0 -19
  109. package/dist/ui/page-toolbar/cmp.toolbar-toggle-item.svelte +0 -16
  110. package/dist/ui/page-toolbar/cmp.toolbar-toggle-item.svelte.d.ts +0 -12
  111. package/dist/ui/table/table-cells/table-select-cell.svelte +0 -28
  112. package/dist/ui/table/table-cells/table-text-input-cell.svelte +0 -69
  113. package/dist/ui/table/table-cells/table-text-input-cell.svelte.d.ts +0 -38
@@ -2,21 +2,29 @@ import type { IconProp } from '../icon';
2
2
  import type { Placement } from '@floating-ui/dom';
3
3
  import type { Snippet } from 'svelte';
4
4
  type Props = {
5
- title: string;
6
5
  triggerLabel: string;
7
6
  /** Leading icon on the trigger button. */
8
7
  icon?: IconProp;
9
8
  /** Button size preset — shared with the kit Button. @default 'sm' */
10
9
  size?: 'sm' | 'md' | 'lg';
11
- /** @default 'bottom-end' */
10
+ /** Render the trigger as a borderless (ghost) button instead of secondary. @default false */
11
+ borderless?: boolean;
12
+ /** @default 'bottom-start' */
12
13
  position?: Placement;
14
+ /** Lay the panel content out as a flex column, so callers don't wrap it themselves. @default true */
15
+ columnFlex?: boolean;
13
16
  children: Snippet;
14
- footer?: Snippet;
15
17
  };
16
18
  /**
17
- * A toolbar popover button. Opens a `ToolbarPanel` with a title, body content, and optional footer.
18
- * The trigger is a secondary `Button` so size shares the same `sm | md | lg` preset as other field-shaped
19
- * toolbar controls keeps everything aligned at the same row height.
19
+ * A toolbar popover button a secondary `Button` trigger (sharing the `sm | md | lg` field size preset)
20
+ * opening a `Popover` panel. By default the content is laid out as a flex column (`columnFlex`); pass
21
+ * `columnFlex={false}` to render it raw. Compose the panel from `ToolbarOption`, `ToolbarSectionTitle`,
22
+ * `ToolbarDivider`, etc.
23
+ *
24
+ * ### CSS Custom Properties
25
+ * | Property | Description | Default |
26
+ * |---|---|---|
27
+ * | `--sc-kit--toolbar-popover--gap` | Gap between flex-column children | `0.125rem` (2px) |
20
28
  */
21
29
  declare const Cmp: import("svelte").Component<Props, {}, "">;
22
30
  type Cmp = ReturnType<typeof Cmp>;
@@ -0,0 +1,46 @@
1
+ <script lang="ts">const { size = 'xs', spaced = false, children } = $props();
2
+ export {};
3
+ </script>
4
+
5
+ <div class="toolbar-section-title toolbar-section-title--{size}" class:toolbar-section-title--spaced={spaced}>{@render children()}</div>
6
+
7
+ <!--
8
+ @component
9
+ A non-interactive section label inside a toolbar dropdown (e.g. `FIELDS` above a column list).
10
+ Matches the kit select listbox group-header style. `spaced` adds extra top padding to set the
11
+ section off from content above it.
12
+
13
+ ### CSS Custom Properties
14
+ | Property | Description | Default |
15
+ |---|---|---|
16
+ | `--sc-kit--toolbar-section-title--color` | Text color | `var(--sc-kit--color--text--muted)` |
17
+ | `--sc-kit--toolbar-section-title--font-family` | Font family | `var(--sc-kit--font--mono)` |
18
+ | `--sc-kit--toolbar-section-title--font-size` | Font size | per size (xs / sm / md) |
19
+ | `--sc-kit--toolbar-section-title--padding-block-start` | Top padding | per `spaced` |
20
+ -->
21
+
22
+ <style>.toolbar-section-title {
23
+ --_title--color: var(--sc-kit--toolbar-section-title--color, var(--sc-kit--color--text--muted));
24
+ --_title--font-family: var(--sc-kit--toolbar-section-title--font-family, var(--sc-kit--font--mono));
25
+ --_title--font-size: var(--sc-kit--toolbar-section-title--font-size, var(--_title--size-font-size));
26
+ --_title--padding-block-start: var(--sc-kit--toolbar-section-title--padding-block-start, var(--sc-kit--space--1));
27
+ padding: var(--_title--padding-block-start) var(--sc-kit--space--2) var(--sc-kit--space--1);
28
+ color: var(--_title--color);
29
+ font-family: var(--_title--font-family);
30
+ font-size: var(--_title--font-size);
31
+ font-weight: var(--sc-kit--font-weight--medium);
32
+ text-transform: uppercase;
33
+ letter-spacing: var(--sc-kit--letter-spacing--wide);
34
+ }
35
+ .toolbar-section-title--xs {
36
+ --_title--size-font-size: var(--sc-kit--font-size--xs);
37
+ }
38
+ .toolbar-section-title--sm {
39
+ --_title--size-font-size: var(--sc-kit--font-size--sm);
40
+ }
41
+ .toolbar-section-title--md {
42
+ --_title--size-font-size: var(--sc-kit--font-size--md);
43
+ }
44
+ .toolbar-section-title--spaced {
45
+ --_title--padding-block-start: var(--sc-kit--space--3);
46
+ }</style>
@@ -0,0 +1,24 @@
1
+ import type { Snippet } from 'svelte';
2
+ type Props = {
3
+ /** Font size. @default 'xs' */
4
+ size?: 'xs' | 'sm' | 'md';
5
+ /** Add extra top padding to separate the section from content above it. @default false */
6
+ spaced?: boolean;
7
+ children: Snippet;
8
+ };
9
+ /**
10
+ * A non-interactive section label inside a toolbar dropdown (e.g. `FIELDS` above a column list).
11
+ * Matches the kit select listbox group-header style. `spaced` adds extra top padding to set the
12
+ * section off from content above it.
13
+ *
14
+ * ### CSS Custom Properties
15
+ * | Property | Description | Default |
16
+ * |---|---|---|
17
+ * | `--sc-kit--toolbar-section-title--color` | Text color | `var(--sc-kit--color--text--muted)` |
18
+ * | `--sc-kit--toolbar-section-title--font-family` | Font family | `var(--sc-kit--font--mono)` |
19
+ * | `--sc-kit--toolbar-section-title--font-size` | Font size | per size (xs / sm / md) |
20
+ * | `--sc-kit--toolbar-section-title--padding-block-start` | Top padding | per `spaced` |
21
+ */
22
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
23
+ type Cmp = ReturnType<typeof Cmp>;
24
+ export default Cmp;
@@ -0,0 +1,31 @@
1
+ <script lang="ts" generics="S">import ToolbarFilterSelect from './cmp.toolbar-filter-select.svelte';
2
+ import ToolbarIconButton from './cmp.toolbar-icon-button.svelte';
3
+ import ToolbarSectionTitle from './cmp.toolbar-section-title.svelte';
4
+ import { ToolbarSortSelectLocalization } from './toolbar-sort-select-localization';
5
+ import IconFilter from '@fluentui/svg-icons/icons/filter_20_regular.svg?raw';
6
+ const { options, value, label, size = 'sm', icon, compare, on } = $props();
7
+ const localization = new ToolbarSortSelectLocalization();
8
+ const orderByLabel = $derived(label ?? localization.orderBy);
9
+ const selection = $derived([value]);
10
+ const onChange = (next) => {
11
+ if (next.length > 0) {
12
+ on?.change?.(next[0]);
13
+ }
14
+ };
15
+ </script>
16
+
17
+ <ToolbarFilterSelect label={orderByLabel} single footer={false} size={size} options={options} value={selection} compare={compare} on={{ change: onChange }}>
18
+ {#snippet header()}
19
+ <ToolbarSectionTitle>{orderByLabel}</ToolbarSectionTitle>
20
+ {/snippet}
21
+ {#snippet trigger()}
22
+ <ToolbarIconButton presentational icon={icon ?? IconFilter} size={size} />
23
+ {/snippet}
24
+ </ToolbarFilterSelect>
25
+
26
+ <!--
27
+ @component
28
+ A toolbar sort control: a `ToolbarFilterSelect` in single-select mode behind a flat icon trigger
29
+ (`ToolbarIconButton`), with an `Order by` section title above the options. Stand-alone, or composed into
30
+ `ToolbarViewControls` via its `prepend` snippet.
31
+ -->
@@ -0,0 +1,44 @@
1
+ import type { SelectItem } from '../select';
2
+ declare function $$render<S>(): {
3
+ props: {
4
+ options: SelectItem<S>[];
5
+ value: S;
6
+ /** Title shown above the options. @default localized `Order by` */
7
+ label?: string;
8
+ /** Button size preset — sm = 28px, md = 32px. @default 'sm' */
9
+ size?: "sm" | "md";
10
+ /** Trigger glyph (a string SVG source). @default a filter glyph */
11
+ icon?: string;
12
+ /** Equality comparator — required when `S` is an object. */
13
+ compare?: (a: S, b: S) => boolean;
14
+ on?: {
15
+ change?: (value: S) => void;
16
+ };
17
+ };
18
+ exports: {};
19
+ bindings: "";
20
+ slots: {};
21
+ events: {};
22
+ };
23
+ declare class __sveltets_Render<S> {
24
+ props(): ReturnType<typeof $$render<S>>['props'];
25
+ events(): ReturnType<typeof $$render<S>>['events'];
26
+ slots(): ReturnType<typeof $$render<S>>['slots'];
27
+ bindings(): "";
28
+ exports(): {};
29
+ }
30
+ interface $$IsomorphicComponent {
31
+ new <S>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<S>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<S>['props']>, ReturnType<__sveltets_Render<S>['events']>, ReturnType<__sveltets_Render<S>['slots']>> & {
32
+ $$bindings?: ReturnType<__sveltets_Render<S>['bindings']>;
33
+ } & ReturnType<__sveltets_Render<S>['exports']>;
34
+ <S>(internal: unknown, props: ReturnType<__sveltets_Render<S>['props']> & {}): ReturnType<__sveltets_Render<S>['exports']>;
35
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
36
+ }
37
+ /**
38
+ * A toolbar sort control: a `ToolbarFilterSelect` in single-select mode behind a flat icon trigger
39
+ * (`ToolbarIconButton`), with an `Order by` section title above the options. Stand-alone, or composed into
40
+ * `ToolbarViewControls` via its `prepend` snippet.
41
+ */
42
+ declare const Cmp: $$IsomorphicComponent;
43
+ type Cmp<S> = InstanceType<typeof Cmp<S>>;
44
+ export default Cmp;
@@ -2,45 +2,45 @@
2
2
  const { segments, value, children, on } = $props();
3
3
  </script>
4
4
 
5
- <div class="toolbar-switch-item">
6
- <div class="toolbar-switch-item__label">
5
+ <div class="toolbar-switch">
6
+ <div class="toolbar-switch__label">
7
7
  {@render children()}
8
8
  </div>
9
- <div class="toolbar-switch-item__switch">
9
+ <div class="toolbar-switch__switch">
10
10
  <SegmentedControl segments={segments} value={value} variant="outlined" size="sm" on={{ change: (v: T) => on?.change?.(v) }} />
11
11
  </div>
12
12
  </div>
13
13
 
14
14
  <!--
15
15
  @component
16
- A switch item for toolbar panels. Shows a label on the left and a segmented control on the right.
16
+ A labeled switch for toolbar dropdowns. Shows a label on the left and a segmented control on the right.
17
17
 
18
18
  ### CSS Custom Properties
19
19
  | Property | Description | Default |
20
20
  |---|---|---|
21
- | `--sc-kit--toolbar-switch-item--label--color` | Label text color | `var(--sc-kit--color--text--primary)` |
21
+ | `--sc-kit--toolbar-switch--label--color` | Label text color | `var(--sc-kit--color--text--primary)` |
22
22
  -->
23
23
 
24
- <style>.toolbar-switch-item {
25
- --_toolbar-switch-item--label--color: var(--sc-kit--toolbar-switch-item--label--color, var(--sc-kit--color--text--primary));
24
+ <style>.toolbar-switch {
25
+ --_toolbar-switch--label--color: var(--sc-kit--toolbar-switch--label--color, var(--sc-kit--color--text--primary));
26
26
  display: flex;
27
27
  align-items: center;
28
28
  justify-content: space-between;
29
29
  gap: var(--sc-kit--space--2);
30
30
  padding: var(--sc-kit--space--1) var(--sc-kit--space--2);
31
31
  }
32
- .toolbar-switch-item__label {
32
+ .toolbar-switch__label {
33
33
  font-size: var(--sc-kit--font-size--md);
34
34
  font-weight: var(--sc-kit--font-weight--regular);
35
35
  line-height: var(--sc-kit--line-height--md);
36
- color: var(--_toolbar-switch-item--label--color);
36
+ color: var(--_toolbar-switch--label--color);
37
37
  min-width: 0;
38
38
  text-overflow: ellipsis;
39
39
  max-width: 100%;
40
40
  white-space: nowrap;
41
41
  overflow: hidden;
42
42
  }
43
- .toolbar-switch-item__switch {
43
+ .toolbar-switch__switch {
44
44
  flex-shrink: 0;
45
45
  --sc-kit--segmented-control--border-radius: var(--sc-kit--radius--md);
46
46
  --sc-kit--segmented-control--background--active: var(--sc-kit--color--accent);
@@ -29,12 +29,12 @@ interface $$IsomorphicComponent {
29
29
  z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
30
30
  }
31
31
  /**
32
- * A switch item for toolbar panels. Shows a label on the left and a segmented control on the right.
32
+ * A labeled switch for toolbar dropdowns. Shows a label on the left and a segmented control on the right.
33
33
  *
34
34
  * ### CSS Custom Properties
35
35
  * | Property | Description | Default |
36
36
  * |---|---|---|
37
- * | `--sc-kit--toolbar-switch-item--label--color` | Label text color | `var(--sc-kit--color--text--primary)` |
37
+ * | `--sc-kit--toolbar-switch--label--color` | Label text color | `var(--sc-kit--color--text--primary)` |
38
38
  */
39
39
  declare const Cmp: $$IsomorphicComponent;
40
40
  type Cmp<T> = InstanceType<typeof Cmp<T>>;
@@ -0,0 +1,14 @@
1
+ <script lang="ts">import ToolbarOption from './cmp.toolbar-option.svelte';
2
+ const { checked, size = 'md', disabled = false, children, on } = $props();
3
+ </script>
4
+
5
+ <ToolbarOption size={size} disabled={disabled} selectable={{ selected: checked, display: 'switch' }} on={{ click: () => on?.change?.(!checked) }}>
6
+ {@render children()}
7
+ </ToolbarOption>
8
+
9
+ <!--
10
+ @component
11
+ A toggle row for toolbar dropdowns — a thin wrapper over `ToolbarOption` with a trailing switch. The
12
+ whole row is the click target; clicking flips `checked` through `on.change`. The switch is a
13
+ presentational `Toggle` sized to the option glyph; sizing and styling come from `ToolbarOption`.
14
+ -->
@@ -0,0 +1,19 @@
1
+ import type { Snippet } from 'svelte';
2
+ type Props = {
3
+ checked: boolean;
4
+ /** Row density — forwarded to `ToolbarOption`. @default 'md' */
5
+ size?: 'sm' | 'md';
6
+ disabled?: boolean;
7
+ children: Snippet;
8
+ on?: {
9
+ change?: (value: boolean) => void;
10
+ };
11
+ };
12
+ /**
13
+ * A toggle row for toolbar dropdowns — a thin wrapper over `ToolbarOption` with a trailing switch. The
14
+ * whole row is the click target; clicking flips `checked` through `on.change`. The switch is a
15
+ * presentational `Toggle` sized to the option glyph; sizing and styling come from `ToolbarOption`.
16
+ */
17
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
18
+ type Cmp = ReturnType<typeof Cmp>;
19
+ export default Cmp;
@@ -48,20 +48,23 @@ Shares the field-height preset so it lines up with other toolbar controls.
48
48
  block-size: var(--_toolbar-value-stepper--height);
49
49
  padding-inline: var(--sc-kit--space--2);
50
50
  border: 1px solid var(--sc-kit--color--border--field);
51
- border-radius: var(--sc-kit--radius--md);
51
+ border-radius: var(--_toolbar-value-stepper--border-radius, var(--sc-kit--field--border-radius--md));
52
52
  background: var(--sc-kit--color--bg--field);
53
53
  }
54
54
  .toolbar-value-stepper--sm {
55
55
  --_toolbar-value-stepper--height: var(--sc-kit--field--height--sm);
56
56
  --_toolbar-value-stepper--font-size: var(--sc-kit--font-size--sm);
57
+ --_toolbar-value-stepper--border-radius: var(--sc-kit--field--border-radius--sm);
57
58
  }
58
59
  .toolbar-value-stepper--md {
59
60
  --_toolbar-value-stepper--height: var(--sc-kit--field--height--md);
60
61
  --_toolbar-value-stepper--font-size: var(--sc-kit--font-size--md);
62
+ --_toolbar-value-stepper--border-radius: var(--sc-kit--field--border-radius--md);
61
63
  }
62
64
  .toolbar-value-stepper--lg {
63
65
  --_toolbar-value-stepper--height: var(--sc-kit--field--height--lg);
64
66
  --_toolbar-value-stepper--font-size: var(--sc-kit--font-size--lg);
67
+ --_toolbar-value-stepper--border-radius: var(--sc-kit--field--border-radius--md);
65
68
  }
66
69
  .toolbar-value-stepper__btn {
67
70
  display: inline-flex;
@@ -0,0 +1,51 @@
1
+ <script lang="ts">import { LocalStorageItem } from '../../core/local-storage';
2
+ import ToolbarIconButton from './cmp.toolbar-icon-button.svelte';
3
+ import { ToolbarViewControlsLocalization } from './toolbar-view-controls-localization';
4
+ import IconAppsList from '@fluentui/svg-icons/icons/apps_list_20_regular.svg?raw';
5
+ import IconGrid from '@fluentui/svg-icons/icons/grid_20_regular.svg?raw';
6
+ import { untrack } from 'svelte';
7
+ const { view, size = 'sm', viewStorageKey, prepend, on } = $props();
8
+ const localization = new ToolbarViewControlsLocalization();
9
+ let storage = null;
10
+ $effect(() => untrack(() => {
11
+ if (!viewStorageKey) {
12
+ return;
13
+ }
14
+ storage = LocalStorageItem.of(viewStorageKey);
15
+ const saved = storage.get();
16
+ if (saved === 'list' || saved === 'grid') {
17
+ on?.viewChange?.(saved);
18
+ }
19
+ }));
20
+ const setView = (next) => {
21
+ storage?.set(next);
22
+ on?.viewChange?.(next);
23
+ };
24
+ </script>
25
+
26
+ <div class="toolbar-view-controls" role="group" aria-label={localization.label}>
27
+ {#if prepend}
28
+ {@render prepend()}
29
+ {/if}
30
+ <ToolbarIconButton icon={IconAppsList} size={size} active={view === 'list'} aria-label={localization.listView} on={{ click: () => setView('list') }} />
31
+ <ToolbarIconButton icon={IconGrid} size={size} active={view === 'grid'} aria-label={localization.gridView} on={{ click: () => setView('grid') }} />
32
+ </div>
33
+
34
+ <!--
35
+ @component
36
+ A toolbar view switcher: a `list` / `grid` toggle built on the shared `ToolbarIconButton` (flat, 28px at
37
+ `sm` / 32px at `md`, 20px glyph). Pass `viewStorageKey` to persist the view across reloads, and compose a
38
+ leading control — e.g. `ToolbarSortSelect` — through the `prepend` snippet.
39
+
40
+ ### CSS Custom Properties
41
+ | Property | Description | Default |
42
+ |---|---|---|
43
+ | `--sc-kit--toolbar-view-controls--gap` | Gap between the controls | `var(--sc-kit--space--3)` |
44
+ -->
45
+
46
+ <style>.toolbar-view-controls {
47
+ --_tvc--gap: var(--sc-kit--toolbar-view-controls--gap, var(--sc-kit--space--3));
48
+ display: inline-flex;
49
+ align-items: center;
50
+ gap: var(--_tvc--gap);
51
+ }</style>
@@ -0,0 +1,27 @@
1
+ import type { Snippet } from 'svelte';
2
+ type ViewMode = 'list' | 'grid';
3
+ type Props = {
4
+ view: ViewMode;
5
+ /** Button size preset — sm = 28px, md = 32px. @default 'sm' */
6
+ size?: 'sm' | 'md';
7
+ /** Persist the view mode under this localStorage key. */
8
+ viewStorageKey?: string;
9
+ /** Leading content before the view toggle — e.g. a composed `ToolbarSortSelect`. */
10
+ prepend?: Snippet;
11
+ on?: {
12
+ viewChange?: (view: ViewMode) => void;
13
+ };
14
+ };
15
+ /**
16
+ * A toolbar view switcher: a `list` / `grid` toggle built on the shared `ToolbarIconButton` (flat, 28px at
17
+ * `sm` / 32px at `md`, 20px glyph). Pass `viewStorageKey` to persist the view across reloads, and compose a
18
+ * leading control — e.g. `ToolbarSortSelect` — through the `prepend` snippet.
19
+ *
20
+ * ### CSS Custom Properties
21
+ * | Property | Description | Default |
22
+ * |---|---|---|
23
+ * | `--sc-kit--toolbar-view-controls--gap` | Gap between the controls | `var(--sc-kit--space--3)` |
24
+ */
25
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
26
+ type Cmp = ReturnType<typeof Cmp>;
27
+ export default Cmp;
@@ -1,11 +1,16 @@
1
- export { default as ReorderableToggleList } from './cmp.reorderable-toggle-list.svelte';
2
- export { default as ToolbarCheckboxItem } from './cmp.toolbar-checkbox-item.svelte';
3
- export { default as ToolbarPanel } from './cmp.toolbar-panel.svelte';
4
- export { default as ToolbarPanelButton } from './cmp.toolbar-panel-button.svelte';
1
+ export { default as ReorderableCheckboxList } from './cmp.reorderable-checkbox-list.svelte';
2
+ export { default as ToolbarCheckbox } from './cmp.toolbar-checkbox.svelte';
3
+ export { default as ToolbarDivider } from './cmp.toolbar-divider.svelte';
4
+ export { default as ToolbarFilterSelect } from './cmp.toolbar-filter-select.svelte';
5
+ export { default as ToolbarIconButton } from './cmp.toolbar-icon-button.svelte';
6
+ export { default as ToolbarOption } from './cmp.toolbar-option.svelte';
5
7
  export { default as ToolbarPopover } from './cmp.toolbar-popover.svelte';
6
8
  export { default as ToolbarSearchInput } from './cmp.toolbar-search-input.svelte';
9
+ export { default as ToolbarSectionTitle } from './cmp.toolbar-section-title.svelte';
7
10
  export { default as ToolbarSegmentedControl } from './cmp.toolbar-segmented-control.svelte';
8
- export { default as ToolbarSwitchItem } from './cmp.toolbar-switch-item.svelte';
9
- export { default as ToolbarToggleItem } from './cmp.toolbar-toggle-item.svelte';
11
+ export { default as ToolbarSortSelect } from './cmp.toolbar-sort-select.svelte';
12
+ export { default as ToolbarSwitch } from './cmp.toolbar-switch.svelte';
13
+ export { default as ToolbarToggle } from './cmp.toolbar-toggle.svelte';
10
14
  export { default as ToolbarValueStepper } from './cmp.toolbar-value-stepper.svelte';
11
- export type { ReorderableToggleItem } from './types';
15
+ export { default as ToolbarViewControls } from './cmp.toolbar-view-controls.svelte';
16
+ export type { ReorderableCheckboxItem } from './types';
@@ -1,10 +1,15 @@
1
- export { default as ReorderableToggleList } from './cmp.reorderable-toggle-list.svelte';
2
- export { default as ToolbarCheckboxItem } from './cmp.toolbar-checkbox-item.svelte';
3
- export { default as ToolbarPanel } from './cmp.toolbar-panel.svelte';
4
- export { default as ToolbarPanelButton } from './cmp.toolbar-panel-button.svelte';
1
+ export { default as ReorderableCheckboxList } from './cmp.reorderable-checkbox-list.svelte';
2
+ export { default as ToolbarCheckbox } from './cmp.toolbar-checkbox.svelte';
3
+ export { default as ToolbarDivider } from './cmp.toolbar-divider.svelte';
4
+ export { default as ToolbarFilterSelect } from './cmp.toolbar-filter-select.svelte';
5
+ export { default as ToolbarIconButton } from './cmp.toolbar-icon-button.svelte';
6
+ export { default as ToolbarOption } from './cmp.toolbar-option.svelte';
5
7
  export { default as ToolbarPopover } from './cmp.toolbar-popover.svelte';
6
8
  export { default as ToolbarSearchInput } from './cmp.toolbar-search-input.svelte';
9
+ export { default as ToolbarSectionTitle } from './cmp.toolbar-section-title.svelte';
7
10
  export { default as ToolbarSegmentedControl } from './cmp.toolbar-segmented-control.svelte';
8
- export { default as ToolbarSwitchItem } from './cmp.toolbar-switch-item.svelte';
9
- export { default as ToolbarToggleItem } from './cmp.toolbar-toggle-item.svelte';
11
+ export { default as ToolbarSortSelect } from './cmp.toolbar-sort-select.svelte';
12
+ export { default as ToolbarSwitch } from './cmp.toolbar-switch.svelte';
13
+ export { default as ToolbarToggle } from './cmp.toolbar-toggle.svelte';
10
14
  export { default as ToolbarValueStepper } from './cmp.toolbar-value-stepper.svelte';
15
+ export { default as ToolbarViewControls } from './cmp.toolbar-view-controls.svelte';
@@ -0,0 +1,5 @@
1
+ export declare class ReorderableCheckboxListLocalization {
2
+ get clearAll(): string;
3
+ get standard(): string;
4
+ get allFields(): string;
5
+ }
@@ -0,0 +1,17 @@
1
+ import { AppLocale } from '../../core/locale';
2
+ const loc = {
3
+ clearAll: { en: 'Clear all', no: 'Tøm alt' },
4
+ standard: { en: 'Standard', no: 'Standard' },
5
+ allFields: { en: 'All fields', no: 'Alle felter' }
6
+ };
7
+ export class ReorderableCheckboxListLocalization {
8
+ get clearAll() {
9
+ return loc.clearAll[AppLocale.current];
10
+ }
11
+ get standard() {
12
+ return loc.standard[AppLocale.current];
13
+ }
14
+ get allFields() {
15
+ return loc.allFields[AppLocale.current];
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+ export declare class ToolbarFilterSelectLocalization {
2
+ get selectedCount(): (count: number) => string;
3
+ get clearAll(): string;
4
+ get clear(): string;
5
+ }
@@ -0,0 +1,20 @@
1
+ import { AppLocale } from '../../core/locale';
2
+ const loc = {
3
+ selectedCount: {
4
+ en: (count) => `${count} selected`,
5
+ no: (count) => `${count} valgt`
6
+ },
7
+ clearAll: { en: 'Clear all', no: 'Tøm alt' },
8
+ clear: { en: 'Clear', no: 'Tøm' }
9
+ };
10
+ export class ToolbarFilterSelectLocalization {
11
+ get selectedCount() {
12
+ return loc.selectedCount[AppLocale.current];
13
+ }
14
+ get clearAll() {
15
+ return loc.clearAll[AppLocale.current];
16
+ }
17
+ get clear() {
18
+ return loc.clear[AppLocale.current];
19
+ }
20
+ }
@@ -0,0 +1,3 @@
1
+ export declare class ToolbarSortSelectLocalization {
2
+ get orderBy(): string;
3
+ }
@@ -0,0 +1,9 @@
1
+ import { AppLocale } from '../../core/locale';
2
+ const loc = {
3
+ orderBy: { en: 'Order by', no: 'Sorter etter' }
4
+ };
5
+ export class ToolbarSortSelectLocalization {
6
+ get orderBy() {
7
+ return loc.orderBy[AppLocale.current];
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ export declare class ToolbarViewControlsLocalization {
2
+ get label(): string;
3
+ get listView(): string;
4
+ get gridView(): string;
5
+ }
@@ -0,0 +1,17 @@
1
+ import { AppLocale } from '../../core/locale';
2
+ const loc = {
3
+ label: { en: 'View options', no: 'Visningsalternativer' },
4
+ listView: { en: 'List view', no: 'Listevisning' },
5
+ gridView: { en: 'Grid view', no: 'Rutenettvisning' }
6
+ };
7
+ export class ToolbarViewControlsLocalization {
8
+ get label() {
9
+ return loc.label[AppLocale.current];
10
+ }
11
+ get listView() {
12
+ return loc.listView[AppLocale.current];
13
+ }
14
+ get gridView() {
15
+ return loc.gridView[AppLocale.current];
16
+ }
17
+ }
@@ -1,4 +1,4 @@
1
- export type ReorderableToggleItem = {
1
+ export type ReorderableCheckboxItem = {
2
2
  id: string;
3
3
  label: string;
4
4
  enabled: boolean;
@@ -172,14 +172,14 @@ body, or an external host element addressed by `options.fixedToolbarId`). Impera
172
172
  | `--sc-kit--rich-text-input--border-color` | Border color | `var(--sc-kit--color--border--field)` |
173
173
  | `--sc-kit--rich-text-input--border-color--hover` | Border color on hover | `var(--sc-kit--color--border--strong)` |
174
174
  | `--sc-kit--rich-text-input--border-color--error` | Border color in error state | `var(--sc-kit--color--danger)` |
175
- | `--sc-kit--rich-text-input--border-radius` | Border radius | `var(--sc-kit--radius--sm)` |
175
+ | `--sc-kit--rich-text-input--border-radius` | Border radius | per size — `sm` 4px, `md`/`lg` 6px |
176
176
  | `--sc-kit--rich-text-input--underline-color` | Inset bottom-underline (transparent default, accent on focus-within, danger on error) | `transparent` |
177
177
  | `--sc-kit--rich-text-input--color` | Text color | `var(--sc-kit--color--text--primary)` |
178
178
  | `--sc-kit--rich-text-input--placeholder--color` | Placeholder color | `var(--sc-kit--color--text--placeholder)` |
179
179
  -->
180
180
 
181
181
  <style>.rich-text-input {
182
- --_rti--root-font-size: var(--sc-kit--rich-text-input--root--font-size, 1rem);
182
+ --_rti--root-font-size: var(--sc-kit--rich-text-input--root--font-size, var(--_rti--size-root-font-size, 1rem));
183
183
  --_rti--padding-block: var(--sc-kit--rich-text-input--padding-block, 0.5em);
184
184
  --_rti--padding-inline: var(--sc-kit--rich-text-input--padding-inline, 0.75em);
185
185
  --_rti--width: var(--sc-kit--rich-text-input--width, 100%);
@@ -189,7 +189,7 @@ body, or an external host element addressed by `options.fixedToolbarId`). Impera
189
189
  --_rti--border-color: var(--sc-kit--rich-text-input--border-color, var(--sc-kit--color--border--field));
190
190
  --_rti--border-color-hover: var(--sc-kit--rich-text-input--border-color--hover, var(--sc-kit--color--border--strong));
191
191
  --_rti--border-color-error: var(--sc-kit--rich-text-input--border-color--error, var(--sc-kit--color--danger));
192
- --_rti--border-radius: var(--sc-kit--rich-text-input--border-radius, var(--sc-kit--radius--sm));
192
+ --_rti--border-radius: var(--sc-kit--rich-text-input--border-radius, var(--_rti--size-border-radius, var(--sc-kit--field--border-radius--md)));
193
193
  --_rti--underline-color: var(--sc-kit--rich-text-input--underline-color, transparent);
194
194
  --_rti--color: var(--sc-kit--rich-text-input--color, var(--sc-kit--color--text--primary));
195
195
  --_rti--placeholder-color: var(--sc-kit--rich-text-input--placeholder--color, var(--sc-kit--color--text--placeholder));
@@ -216,13 +216,16 @@ body, or an external host element addressed by `options.fixedToolbarId`). Impera
216
216
  transition: background-color var(--sc-kit--duration--base) var(--sc-kit--ease--default), border-color var(--sc-kit--duration--base) var(--sc-kit--ease--default), color var(--sc-kit--duration--base) var(--sc-kit--ease--default), box-shadow var(--sc-kit--duration--base) var(--sc-kit--ease--default);
217
217
  }
218
218
  .rich-text-input--sm {
219
- --sc-kit--rich-text-input--root--font-size: 0.8125rem;
219
+ --_rti--size-root-font-size: 0.8125rem;
220
+ --_rti--size-border-radius: var(--sc-kit--field--border-radius--sm);
220
221
  }
221
222
  .rich-text-input--md {
222
- --sc-kit--rich-text-input--root--font-size: 0.875rem;
223
+ --_rti--size-root-font-size: 0.875rem;
224
+ --_rti--size-border-radius: var(--sc-kit--field--border-radius--md);
223
225
  }
224
226
  .rich-text-input--lg {
225
- --sc-kit--rich-text-input--root--font-size: 1rem;
227
+ --_rti--size-root-font-size: 1rem;
228
+ --_rti--size-border-radius: var(--sc-kit--field--border-radius--md);
226
229
  }
227
230
  .rich-text-input:where(:hover:not(:focus-within)) {
228
231
  --sc-kit--rich-text-input--border-color: var(--_rti--border-color-hover);
@@ -55,7 +55,7 @@ type Props = {
55
55
  * | `--sc-kit--rich-text-input--border-color` | Border color | `var(--sc-kit--color--border--field)` |
56
56
  * | `--sc-kit--rich-text-input--border-color--hover` | Border color on hover | `var(--sc-kit--color--border--strong)` |
57
57
  * | `--sc-kit--rich-text-input--border-color--error` | Border color in error state | `var(--sc-kit--color--danger)` |
58
- * | `--sc-kit--rich-text-input--border-radius` | Border radius | `var(--sc-kit--radius--sm)` |
58
+ * | `--sc-kit--rich-text-input--border-radius` | Border radius | per size — `sm` 4px, `md`/`lg` 6px |
59
59
  * | `--sc-kit--rich-text-input--underline-color` | Inset bottom-underline (transparent default, accent on focus-within, danger on error) | `transparent` |
60
60
  * | `--sc-kit--rich-text-input--color` | Text color | `var(--sc-kit--color--text--primary)` |
61
61
  * | `--sc-kit--rich-text-input--placeholder--color` | Placeholder color | `var(--sc-kit--color--text--placeholder)` |