@sewadah/selaras 0.8.0 → 0.10.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 (77) hide show
  1. package/README.md +12 -1
  2. package/dist/agent/catalog.json +1 -1
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/Autocomplete.vue +6 -0
  5. package/dist/runtime/components/Checkbox.d.vue.ts +6 -4
  6. package/dist/runtime/components/Checkbox.vue +30 -22
  7. package/dist/runtime/components/Checkbox.vue.d.ts +6 -4
  8. package/dist/runtime/components/DatePicker.d.vue.ts +27 -27
  9. package/dist/runtime/components/DatePicker.vue +58 -99
  10. package/dist/runtime/components/DatePicker.vue.d.ts +27 -27
  11. package/dist/runtime/components/Editable.d.vue.ts +91 -0
  12. package/dist/runtime/components/Editable.vue +257 -0
  13. package/dist/runtime/components/Editable.vue.d.ts +91 -0
  14. package/dist/runtime/components/Input.d.vue.ts +7 -4
  15. package/dist/runtime/components/Input.vue +41 -25
  16. package/dist/runtime/components/Input.vue.d.ts +7 -4
  17. package/dist/runtime/components/Select.vue +6 -0
  18. package/dist/runtime/components/Textarea.d.vue.ts +7 -4
  19. package/dist/runtime/components/Textarea.vue +42 -28
  20. package/dist/runtime/components/Textarea.vue.d.ts +7 -4
  21. package/dist/runtime/components/Toolbar.d.vue.ts +25 -0
  22. package/dist/runtime/components/Toolbar.vue +35 -0
  23. package/dist/runtime/components/Toolbar.vue.d.ts +25 -0
  24. package/dist/runtime/components/ToolbarButton.d.vue.ts +20 -0
  25. package/dist/runtime/components/ToolbarButton.vue +46 -0
  26. package/dist/runtime/components/ToolbarButton.vue.d.ts +20 -0
  27. package/dist/runtime/components/ToolbarSeparator.d.vue.ts +10 -0
  28. package/dist/runtime/components/ToolbarSeparator.vue +22 -0
  29. package/dist/runtime/components/ToolbarSeparator.vue.d.ts +10 -0
  30. package/dist/runtime/components/ToolbarToggleGroup.d.vue.ts +37 -0
  31. package/dist/runtime/components/ToolbarToggleGroup.vue +44 -0
  32. package/dist/runtime/components/ToolbarToggleGroup.vue.d.ts +37 -0
  33. package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +7 -63
  34. package/dist/runtime/internal/ComboboxSelectBase.vue +58 -54
  35. package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +7 -63
  36. package/dist/runtime/internal/FieldClearButton.d.vue.ts +21 -0
  37. package/dist/runtime/internal/FieldClearButton.vue +30 -0
  38. package/dist/runtime/internal/FieldClearButton.vue.d.ts +21 -0
  39. package/dist/runtime/internal/ListboxOption.d.vue.ts +2 -1
  40. package/dist/runtime/internal/ListboxOption.vue +3 -2
  41. package/dist/runtime/internal/ListboxOption.vue.d.ts +2 -1
  42. package/dist/runtime/theme/date-picker.d.ts +27 -0
  43. package/dist/runtime/theme/date-picker.js +6 -3
  44. package/dist/runtime/theme/editable.d.ts +155 -0
  45. package/dist/runtime/theme/editable.js +25 -0
  46. package/dist/runtime/theme/field-clear-button.d.ts +56 -0
  47. package/dist/runtime/theme/field-clear-button.js +15 -0
  48. package/dist/runtime/theme/input.d.ts +6 -9
  49. package/dist/runtime/theme/input.js +7 -12
  50. package/dist/runtime/theme/listbox.js +1 -1
  51. package/dist/runtime/theme/select.d.ts +15 -0
  52. package/dist/runtime/theme/select.js +13 -10
  53. package/dist/runtime/theme/textarea.d.ts +6 -9
  54. package/dist/runtime/theme/textarea.js +6 -4
  55. package/dist/runtime/theme/toolbar-button.d.ts +65 -0
  56. package/dist/runtime/theme/toolbar-button.js +21 -0
  57. package/dist/runtime/theme/toolbar-separator.d.ts +35 -0
  58. package/dist/runtime/theme/toolbar-separator.js +8 -0
  59. package/dist/runtime/theme/toolbar-toggle-group.d.ts +74 -0
  60. package/dist/runtime/theme/toolbar-toggle-group.js +13 -0
  61. package/dist/runtime/theme/toolbar.d.ts +35 -0
  62. package/dist/runtime/theme/toolbar.js +11 -0
  63. package/dist/runtime/theme-config.d.ts +36 -0
  64. package/dist/runtime/types/index.d.ts +6 -0
  65. package/dist/runtime/utils/field-adornments.d.ts +14 -0
  66. package/dist/runtime/utils/field-adornments.js +36 -0
  67. package/dist/runtime/utils/field-clear.d.ts +9 -0
  68. package/dist/runtime/utils/field-clear.js +7 -0
  69. package/dist/runtime/utils/icons.d.ts +1 -0
  70. package/dist/runtime/utils/icons.js +1 -0
  71. package/dist/runtime/utils/messages.d.ts +4 -0
  72. package/dist/runtime/utils/messages.js +4 -0
  73. package/dist/runtime/utils/select-contracts.d.ts +3 -0
  74. package/dist/runtime/utils/toolbar.d.ts +9 -0
  75. package/dist/runtime/utils/toolbar.js +1 -0
  76. package/package.json +13 -5
  77. package/skills/selaras/SKILL.md +11 -7
@@ -4,19 +4,16 @@ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
4
4
  base: string;
5
5
  leadingIcon: string;
6
6
  trailingIcon: string;
7
- clear: string;
8
7
  };
9
8
  md: {
10
9
  base: string;
11
10
  leadingIcon: string;
12
11
  trailingIcon: string;
13
- clear: string;
14
12
  };
15
13
  lg: {
16
14
  base: string;
17
15
  leadingIcon: string;
18
16
  trailingIcon: string;
19
- clear: string;
20
17
  };
21
18
  };
22
19
  color: {
@@ -51,6 +48,8 @@ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
51
48
  }, {
52
49
  root: string;
53
50
  base: string;
51
+ leading: string;
52
+ trailing: string;
54
53
  leadingIcon: string;
55
54
  trailingIcon: string;
56
55
  clear: string;
@@ -60,19 +59,16 @@ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
60
59
  base: string;
61
60
  leadingIcon: string;
62
61
  trailingIcon: string;
63
- clear: string;
64
62
  };
65
63
  md: {
66
64
  base: string;
67
65
  leadingIcon: string;
68
66
  trailingIcon: string;
69
- clear: string;
70
67
  };
71
68
  lg: {
72
69
  base: string;
73
70
  leadingIcon: string;
74
71
  trailingIcon: string;
75
- clear: string;
76
72
  };
77
73
  };
78
74
  color: {
@@ -107,6 +103,8 @@ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
107
103
  }, {
108
104
  root: string;
109
105
  base: string;
106
+ leading: string;
107
+ trailing: string;
110
108
  leadingIcon: string;
111
109
  trailingIcon: string;
112
110
  clear: string;
@@ -116,19 +114,16 @@ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
116
114
  base: string;
117
115
  leadingIcon: string;
118
116
  trailingIcon: string;
119
- clear: string;
120
117
  };
121
118
  md: {
122
119
  base: string;
123
120
  leadingIcon: string;
124
121
  trailingIcon: string;
125
- clear: string;
126
122
  };
127
123
  lg: {
128
124
  base: string;
129
125
  leadingIcon: string;
130
126
  trailingIcon: string;
131
- clear: string;
132
127
  };
133
128
  };
134
129
  color: {
@@ -163,6 +158,8 @@ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
163
158
  }, {
164
159
  root: string;
165
160
  base: string;
161
+ leading: string;
162
+ trailing: string;
166
163
  leadingIcon: string;
167
164
  trailingIcon: string;
168
165
  clear: string;
@@ -9,15 +9,17 @@ export const textareaTheme = tv({
9
9
  // way Input's own icons are - once content wraps past one line,
10
10
  // centering against the whole (variable) box height would drift the
11
11
  // icon away from the first line of text it's meant to sit beside.
12
+ leading: "absolute top-1 start-0 m-0 flex min-w-0 items-center gap-1 border-0 p-0 ps-2.5 text-sm text-[var(--selaras-resolved-text-muted)] disabled:opacity-50",
13
+ trailing: "absolute top-1 end-0 m-0 flex min-w-0 items-center gap-1 border-0 p-0 pe-1 text-sm text-[var(--selaras-resolved-text-muted)] disabled:opacity-50",
12
14
  leadingIcon: "absolute start-3 top-2.5 shrink-0 text-[var(--selaras-resolved-text-muted)]",
13
15
  trailingIcon: "absolute end-3 top-2.5 shrink-0 text-[var(--selaras-resolved-text-muted)]",
14
- clear: "absolute end-1 top-1 shrink-0 rounded-full"
16
+ clear: "absolute end-1 top-1"
15
17
  },
16
18
  variants: {
17
19
  size: {
18
- sm: { base: "text-sm", leadingIcon: "size-4", trailingIcon: "size-4", clear: "size-7" },
19
- md: { base: "text-sm", leadingIcon: "size-4.5", trailingIcon: "size-4.5", clear: "size-9" },
20
- lg: { base: "text-base", leadingIcon: "size-5", trailingIcon: "size-5", clear: "size-10" }
20
+ sm: { base: "text-sm", leadingIcon: "size-4", trailingIcon: "size-4" },
21
+ md: { base: "text-sm", leadingIcon: "size-4.5", trailingIcon: "size-4.5" },
22
+ lg: { base: "text-base", leadingIcon: "size-5", trailingIcon: "size-5" }
21
23
  },
22
24
  // Focus-ring color only - the resting ring stays --selaras-resolved-border-default regardless
23
25
  // of `color`, matching Input's own scope (see input.ts).
@@ -0,0 +1,65 @@
1
+ export declare const toolbarButtonTheme: import("tailwind-variants").TVReturnType<{
2
+ size: {
3
+ sm: {};
4
+ md: {};
5
+ lg: {};
6
+ };
7
+ variant: {
8
+ solid: {};
9
+ soft: {};
10
+ subtle: {};
11
+ outline: {};
12
+ ghost: {
13
+ base: string;
14
+ };
15
+ text: {};
16
+ link: {};
17
+ };
18
+ }, {
19
+ base: string;
20
+ leadingIcon: string;
21
+ trailingIcon: string;
22
+ }, undefined, {
23
+ size: {
24
+ sm: {};
25
+ md: {};
26
+ lg: {};
27
+ };
28
+ variant: {
29
+ solid: {};
30
+ soft: {};
31
+ subtle: {};
32
+ outline: {};
33
+ ghost: {
34
+ base: string;
35
+ };
36
+ text: {};
37
+ link: {};
38
+ };
39
+ }, {
40
+ base: string;
41
+ leadingIcon: string;
42
+ trailingIcon: string;
43
+ }, import("tailwind-variants").TVReturnTypeLike<{
44
+ size: {
45
+ sm: {};
46
+ md: {};
47
+ lg: {};
48
+ };
49
+ variant: {
50
+ solid: {};
51
+ soft: {};
52
+ subtle: {};
53
+ outline: {};
54
+ ghost: {
55
+ base: string;
56
+ };
57
+ text: {};
58
+ link: {};
59
+ };
60
+ }, {
61
+ base: string;
62
+ leadingIcon: string;
63
+ trailingIcon: string;
64
+ }>>;
65
+ export type ToolbarButtonThemeSlots = keyof (typeof toolbarButtonTheme)['slots'];
@@ -0,0 +1,21 @@
1
+ import { tv } from "tailwind-variants";
2
+ export const toolbarButtonTheme = tv({
3
+ slots: {
4
+ base: "",
5
+ leadingIcon: "",
6
+ trailingIcon: ""
7
+ },
8
+ variants: {
9
+ size: { sm: {}, md: {}, lg: {} },
10
+ variant: {
11
+ solid: {},
12
+ soft: {},
13
+ subtle: {},
14
+ outline: {},
15
+ ghost: { base: "text-[var(--selaras-resolved-text-muted)] hover:bg-[var(--selaras-resolved-surface-elevated)] hover:text-[var(--selaras-resolved-text-default)] data-[state=on]:bg-[var(--_selaras-color-subtle)] data-[state=on]:text-[var(--_selaras-color-on-subtle)] data-[state=on]:hover:bg-[var(--_selaras-color-subtle-hover)]" },
16
+ text: {},
17
+ link: {}
18
+ }
19
+ },
20
+ defaultVariants: { variant: "ghost" }
21
+ });
@@ -0,0 +1,35 @@
1
+ export declare const toolbarSeparatorTheme: import("tailwind-variants").TVReturnType<{
2
+ orientation: {
3
+ vertical: {
4
+ root: string;
5
+ };
6
+ horizontal: {
7
+ root: string;
8
+ };
9
+ };
10
+ }, {
11
+ root: string;
12
+ }, undefined, {
13
+ orientation: {
14
+ vertical: {
15
+ root: string;
16
+ };
17
+ horizontal: {
18
+ root: string;
19
+ };
20
+ };
21
+ }, {
22
+ root: string;
23
+ }, import("tailwind-variants").TVReturnTypeLike<{
24
+ orientation: {
25
+ vertical: {
26
+ root: string;
27
+ };
28
+ horizontal: {
29
+ root: string;
30
+ };
31
+ };
32
+ }, {
33
+ root: string;
34
+ }>>;
35
+ export type ToolbarSeparatorThemeSlots = keyof (typeof toolbarSeparatorTheme)['slots'];
@@ -0,0 +1,8 @@
1
+ import { tv } from "tailwind-variants";
2
+ export const toolbarSeparatorTheme = tv({
3
+ slots: { root: "shrink-0 bg-[var(--selaras-resolved-border-default)]" },
4
+ variants: {
5
+ orientation: { vertical: { root: "mx-1 h-5 w-px" }, horizontal: { root: "my-1 h-px w-full" } }
6
+ },
7
+ defaultVariants: { orientation: "vertical" }
8
+ });
@@ -0,0 +1,74 @@
1
+ export declare const toolbarToggleGroupTheme: import("tailwind-variants").TVReturnType<{
2
+ orientation: {
3
+ horizontal: {
4
+ root: string;
5
+ };
6
+ vertical: {
7
+ root: string;
8
+ };
9
+ };
10
+ size: {
11
+ sm: {
12
+ icon: string;
13
+ };
14
+ md: {
15
+ icon: string;
16
+ };
17
+ lg: {
18
+ icon: string;
19
+ };
20
+ };
21
+ }, {
22
+ root: string;
23
+ item: string;
24
+ icon: string;
25
+ }, undefined, {
26
+ orientation: {
27
+ horizontal: {
28
+ root: string;
29
+ };
30
+ vertical: {
31
+ root: string;
32
+ };
33
+ };
34
+ size: {
35
+ sm: {
36
+ icon: string;
37
+ };
38
+ md: {
39
+ icon: string;
40
+ };
41
+ lg: {
42
+ icon: string;
43
+ };
44
+ };
45
+ }, {
46
+ root: string;
47
+ item: string;
48
+ icon: string;
49
+ }, import("tailwind-variants").TVReturnTypeLike<{
50
+ orientation: {
51
+ horizontal: {
52
+ root: string;
53
+ };
54
+ vertical: {
55
+ root: string;
56
+ };
57
+ };
58
+ size: {
59
+ sm: {
60
+ icon: string;
61
+ };
62
+ md: {
63
+ icon: string;
64
+ };
65
+ lg: {
66
+ icon: string;
67
+ };
68
+ };
69
+ }, {
70
+ root: string;
71
+ item: string;
72
+ icon: string;
73
+ }>>;
74
+ export type ToolbarToggleGroupThemeSlots = keyof (typeof toolbarToggleGroupTheme)['slots'];
@@ -0,0 +1,13 @@
1
+ import { tv } from "tailwind-variants";
2
+ export const toolbarToggleGroupTheme = tv({
3
+ slots: {
4
+ root: "inline-flex gap-1",
5
+ item: "text-[var(--selaras-resolved-text-muted)] hover:bg-[var(--selaras-resolved-surface-elevated)] hover:text-[var(--selaras-resolved-text-default)] data-[state=on]:bg-[var(--_selaras-color-subtle)] data-[state=on]:text-[var(--_selaras-color-on-subtle)] data-[state=on]:hover:bg-[var(--_selaras-color-subtle-hover)]",
6
+ icon: "shrink-0"
7
+ },
8
+ variants: {
9
+ orientation: { horizontal: { root: "flex-row" }, vertical: { root: "flex-col" } },
10
+ size: { sm: { icon: "size-4" }, md: { icon: "size-4.5" }, lg: { icon: "size-5" } }
11
+ },
12
+ defaultVariants: { orientation: "horizontal", size: "sm" }
13
+ });
@@ -0,0 +1,35 @@
1
+ export declare const toolbarTheme: import("tailwind-variants").TVReturnType<{
2
+ orientation: {
3
+ horizontal: {
4
+ root: string;
5
+ };
6
+ vertical: {
7
+ root: string;
8
+ };
9
+ };
10
+ }, {
11
+ root: string;
12
+ }, undefined, {
13
+ orientation: {
14
+ horizontal: {
15
+ root: string;
16
+ };
17
+ vertical: {
18
+ root: string;
19
+ };
20
+ };
21
+ }, {
22
+ root: string;
23
+ }, import("tailwind-variants").TVReturnTypeLike<{
24
+ orientation: {
25
+ horizontal: {
26
+ root: string;
27
+ };
28
+ vertical: {
29
+ root: string;
30
+ };
31
+ };
32
+ }, {
33
+ root: string;
34
+ }>>;
35
+ export type ToolbarThemeSlots = keyof (typeof toolbarTheme)['slots'];
@@ -0,0 +1,11 @@
1
+ import { tv } from "tailwind-variants";
2
+ export const toolbarTheme = tv({
3
+ slots: { root: "flex gap-1 rounded-[var(--selaras-resolved-radius-md)] border border-[var(--selaras-resolved-border-default)] bg-[var(--selaras-resolved-surface-default)] p-1" },
4
+ variants: {
5
+ orientation: {
6
+ horizontal: { root: "flex-row flex-wrap items-center" },
7
+ vertical: { root: "inline-flex flex-col items-stretch" }
8
+ }
9
+ },
10
+ defaultVariants: { orientation: "horizontal" }
11
+ });
@@ -32,6 +32,8 @@ import type { dashboardSidebarTheme, DashboardSidebarThemeSlots } from './theme/
32
32
  import type { datePickerTheme, DatePickerThemeSlots } from './theme/date-picker.js';
33
33
  import type { drawerTheme, DrawerThemeSlots } from './theme/drawer.js';
34
34
  import type { dropdownTheme, DropdownThemeSlots } from './theme/dropdown.js';
35
+ import type { editableTheme, EditableThemeSlots } from './theme/editable.js';
36
+ import type { fieldClearButtonTheme, FieldClearButtonThemeSlots } from './theme/field-clear-button.js';
35
37
  import type { fileTreeTheme, FileTreeThemeSlots } from './theme/file-tree.js';
36
38
  import type { fileUploadTheme, FileUploadThemeSlots } from './theme/file-upload.js';
37
39
  import type { formFieldTheme, FormFieldThemeSlots } from './theme/form-field.js';
@@ -72,6 +74,10 @@ import type { timelineTheme, TimelineThemeSlots } from './theme/timeline.js';
72
74
  import type { toastTheme, ToastThemeSlots } from './theme/toast.js';
73
75
  import type { toggleTheme, ToggleThemeSlots } from './theme/toggle.js';
74
76
  import type { toggleGroupTheme, ToggleGroupThemeSlots } from './theme/toggle-group.js';
77
+ import type { toolbarTheme, ToolbarThemeSlots } from './theme/toolbar.js';
78
+ import type { toolbarButtonTheme, ToolbarButtonThemeSlots } from './theme/toolbar-button.js';
79
+ import type { toolbarSeparatorTheme, ToolbarSeparatorThemeSlots } from './theme/toolbar-separator.js';
80
+ import type { toolbarToggleGroupTheme, ToolbarToggleGroupThemeSlots } from './theme/toolbar-toggle-group.js';
75
81
  import type { tooltipTheme, TooltipThemeSlots } from './theme/tooltip.js';
76
82
  import type { transferListTheme, TransferListThemeSlots } from './theme/transfer-list.js';
77
83
  import type { treeTheme, TreeThemeSlots } from './theme/tree.js';
@@ -101,6 +107,7 @@ type ContentNavigationVariants = VariantProps<typeof contentNavigationTheme>;
101
107
  type ContentSurroundVariants = VariantProps<typeof contentSurroundTheme>;
102
108
  type ContentTocVariants = VariantProps<typeof contentTocTheme>;
103
109
  type InputVariants = VariantProps<typeof inputTheme>;
110
+ type EditableVariants = VariantProps<typeof editableTheme>;
104
111
  type InputGroupVariants = VariantProps<typeof inputGroupTheme>;
105
112
  type InputNumberVariants = VariantProps<typeof inputNumberTheme>;
106
113
  type KbdVariants = VariantProps<typeof kbdTheme>;
@@ -279,6 +286,15 @@ export interface ThemeComponentRegistry {
279
286
  conditions: WithRegisteredColor<Pick<InputVariants, 'color' | 'size' | 'hasLeadingIcon' | 'hasTrailingIcon' | 'invalid'>>;
280
287
  defaults: WithRegisteredColor<Pick<InputVariants, 'color' | 'size'>>;
281
288
  };
289
+ fieldClearButton: {
290
+ slots: FieldClearButtonThemeSlots;
291
+ conditions: Pick<VariantProps<typeof fieldClearButtonTheme>, 'size'>;
292
+ };
293
+ editable: {
294
+ slots: EditableThemeSlots;
295
+ conditions: WithRegisteredColor<Pick<EditableVariants, 'color' | 'size' | 'invalid' | 'empty' | 'multiline'>>;
296
+ defaults: WithRegisteredColor<Pick<EditableVariants, 'color' | 'size'>>;
297
+ };
282
298
  inputGroup: {
283
299
  slots: InputGroupThemeSlots;
284
300
  conditions: Pick<InputGroupVariants, 'orientation'>;
@@ -458,6 +474,26 @@ export interface ThemeComponentRegistry {
458
474
  slots: SlideoverThemeSlots;
459
475
  conditions: Pick<SlideoverVariants, 'side' | 'inset' | 'transition'>;
460
476
  };
477
+ toolbar: {
478
+ slots: ToolbarThemeSlots;
479
+ conditions: Pick<VariantProps<typeof toolbarTheme>, 'orientation'>;
480
+ defaults: {
481
+ size?: 'sm' | 'md' | 'lg';
482
+ color?: ColorRole;
483
+ };
484
+ };
485
+ toolbarButton: {
486
+ slots: ToolbarButtonThemeSlots;
487
+ conditions: Pick<VariantProps<typeof toolbarButtonTheme>, 'size' | 'variant'>;
488
+ };
489
+ toolbarToggleGroup: {
490
+ slots: ToolbarToggleGroupThemeSlots;
491
+ conditions: Pick<VariantProps<typeof toolbarToggleGroupTheme>, 'size' | 'orientation'>;
492
+ };
493
+ toolbarSeparator: {
494
+ slots: ToolbarSeparatorThemeSlots;
495
+ conditions: Pick<VariantProps<typeof toolbarSeparatorTheme>, 'orientation'>;
496
+ };
461
497
  tooltip: {
462
498
  slots: TooltipThemeSlots;
463
499
  conditions: Pick<TooltipVariants, never>;
@@ -37,6 +37,7 @@ export type * from '../components/DashboardSidebarToggle.vue';
37
37
  export type * from '../components/DatePicker.vue';
38
38
  export type * from '../components/Drawer.vue';
39
39
  export type * from '../components/Dropdown.vue';
40
+ export type * from '../components/Editable.vue';
40
41
  export type * from '../components/FileTree.vue';
41
42
  export type * from '../components/FileUpload.vue';
42
43
  export type * from '../components/FormField.vue';
@@ -83,6 +84,10 @@ export type * from '../components/Timeline.vue';
83
84
  export type * from '../components/Toast.vue';
84
85
  export type * from '../components/Toggle.vue';
85
86
  export type * from '../components/ToggleGroup.vue';
87
+ export type * from '../components/Toolbar.vue';
88
+ export type * from '../components/ToolbarButton.vue';
89
+ export type * from '../components/ToolbarSeparator.vue';
90
+ export type * from '../components/ToolbarToggleGroup.vue';
86
91
  export type * from '../components/Tooltip.vue';
87
92
  export type * from '../components/TransferList.vue';
88
93
  export type * from '../components/Tree.vue';
@@ -97,6 +102,7 @@ export type { ThemeComponentRegistry, ThemeConfiguration, ThemeDefaults, ThemeUi
97
102
  export type { ArrowConfig, RoundedArrowConfig } from '../utils/arrow.js';
98
103
  export type { AutocompleteValue } from '../utils/autocomplete-contracts.js';
99
104
  export type { BuiltinColorName, ColorRecipe, ColorRecipeInput, ColorRole, RuntimeColorOverrides, RuntimeThemeMode, RuntimeTokenOverrides } from '../utils/color-registry.js';
105
+ export type { FieldAdornmentSlotProps } from '../utils/field-adornments.js';
100
106
  export type { FunctionalTokenOverrides, GeometryTokenOverrides, ThemeTokenOverrides } from '../utils/functional-tokens.js';
101
107
  export type { IconRegistry } from '../utils/icons.js';
102
108
  export { defaultIcons } from '../utils/icons.js';
@@ -0,0 +1,14 @@
1
+ import type { CSSProperties } from 'vue';
2
+ export interface FieldAdornmentSlotProps {
3
+ disabled: boolean;
4
+ size: 'sm' | 'md' | 'lg';
5
+ /** Button size that fits inside the field. */
6
+ buttonSize: 'sm' | 'md';
7
+ }
8
+ /** Reserve the rendered width of custom content, including dynamic suffixes. */
9
+ export declare function useFieldAdornments(): {
10
+ leading: import("vue").ShallowRef<HTMLElement | null, HTMLElement | null>;
11
+ trailing: import("vue").ShallowRef<HTMLElement | null, HTMLElement | null>;
12
+ padding: (hasLeading: boolean, hasTrailing: boolean, trailingExtra?: string) => CSSProperties | undefined;
13
+ clearOffset: () => CSSProperties;
14
+ };
@@ -0,0 +1,36 @@
1
+ import { shallowRef, watchEffect } from "vue";
2
+ export function useFieldAdornments() {
3
+ const leading = shallowRef(null);
4
+ const trailing = shallowRef(null);
5
+ const leadingWidth = shallowRef();
6
+ const trailingWidth = shallowRef();
7
+ watchEffect((onCleanup) => {
8
+ const start = leading.value;
9
+ const end = trailing.value;
10
+ function measure() {
11
+ leadingWidth.value = start ? `${start.getBoundingClientRect().width}px` : void 0;
12
+ trailingWidth.value = end ? `${end.getBoundingClientRect().width}px` : void 0;
13
+ }
14
+ measure();
15
+ if (!start && !end || typeof ResizeObserver === "undefined")
16
+ return;
17
+ const observer = new ResizeObserver(measure);
18
+ if (start)
19
+ observer.observe(start);
20
+ if (end)
21
+ observer.observe(end);
22
+ onCleanup(() => observer.disconnect());
23
+ }, { flush: "post" });
24
+ function padding(hasLeading, hasTrailing, trailingExtra = "0rem") {
25
+ if (!hasLeading && !hasTrailing)
26
+ return;
27
+ return {
28
+ paddingInlineStart: hasLeading ? `calc(${leadingWidth.value ?? "2rem"} + 0.5rem)` : void 0,
29
+ paddingInlineEnd: hasTrailing ? `calc(${trailingWidth.value ?? "2rem"} + 0.5rem + ${trailingExtra})` : void 0
30
+ };
31
+ }
32
+ function clearOffset() {
33
+ return { insetInlineEnd: `calc(${trailingWidth.value ?? "2rem"} + 0.25rem)` };
34
+ }
35
+ return { leading, trailing, padding, clearOffset };
36
+ }
@@ -0,0 +1,9 @@
1
+ /** Presence follows native boolean-attribute semantics, including readonly="". */
2
+ export declare function isFieldReadonly(value: unknown): boolean;
3
+ export declare function canClearField(clearable: boolean | undefined, hasContent: boolean, disabled: boolean | undefined, readonly?: boolean): boolean;
4
+ /** The clear target is smaller than the field; glyph sizing is independent. */
5
+ export declare const fieldClearWidths: {
6
+ readonly sm: "1.5rem";
7
+ readonly md: "1.75rem";
8
+ readonly lg: "2rem";
9
+ };
@@ -0,0 +1,7 @@
1
+ export function isFieldReadonly(value) {
2
+ return value !== void 0 && value !== null && value !== false;
3
+ }
4
+ export function canClearField(clearable, hasContent, disabled, readonly = false) {
5
+ return !!clearable && hasContent && !disabled && !readonly;
6
+ }
7
+ export const fieldClearWidths = { sm: "1.5rem", md: "1.75rem", lg: "2rem" };
@@ -1,4 +1,5 @@
1
1
  export interface IconRegistry {
2
+ edit: string;
2
3
  close: string;
3
4
  check: string;
4
5
  indeterminate: string;
@@ -3,6 +3,7 @@ export function isFeedbackIntent(value) {
3
3
  return feedbackIntentNames.includes(value);
4
4
  }
5
5
  export const defaultIcons = {
6
+ edit: "hugeicons:pencil-edit-01",
6
7
  close: "hugeicons:cancel-01",
7
8
  check: "hugeicons:tick-02",
8
9
  indeterminate: "hugeicons:minus-sign",
@@ -1,4 +1,8 @@
1
1
  export interface MessageRegistry {
2
+ edit: string;
3
+ save: string;
4
+ editableInput: string;
5
+ editablePlaceholder: string;
2
6
  loading: string;
3
7
  clear: string;
4
8
  close: string;
@@ -1,4 +1,8 @@
1
1
  export const defaultMessages = {
2
+ edit: "Edit",
3
+ save: "Save",
4
+ editableInput: "Editable text",
5
+ editablePlaceholder: "Click to edit",
2
6
  loading: "Loading",
3
7
  clear: "Clear",
4
8
  close: "Close",
@@ -2,6 +2,7 @@ import type { VariantProps } from 'tailwind-variants';
2
2
  import type { selectTheme, SelectThemeSlots } from '../theme/select.js';
3
3
  import type { RoundedArrowConfig } from './arrow.js';
4
4
  import type { ColorRole } from './color-registry.js';
5
+ import type { FieldAdornmentSlotProps } from './field-adornments.js';
5
6
  import type { OverlayPortal, OverlayPositioning } from './overlay.js';
6
7
  import type { UiProp } from './ui.js';
7
8
  export type SelectValue = string | number;
@@ -94,6 +95,8 @@ export interface SelectEmits<Entry extends SelectEntry = {
94
95
  'update:searchTerm': [value: string];
95
96
  }
96
97
  export interface SelectSlots<Entry extends SelectEntry, Key extends string = 'value'> {
98
+ 'leading'?: (props: FieldAdornmentSlotProps) => any;
99
+ 'trailing'?: (props: FieldAdornmentSlotProps) => any;
97
100
  'item'?: (props: {
98
101
  item: SelectEntryItem<Entry>;
99
102
  }) => any;
@@ -0,0 +1,9 @@
1
+ import type { ComputedRef, InjectionKey } from 'vue';
2
+ import type { ColorRole } from './color-registry.js';
3
+ export interface ToolbarContext {
4
+ size: 'sm' | 'md' | 'lg';
5
+ color: ColorRole;
6
+ disabled: boolean;
7
+ orientation: 'horizontal' | 'vertical';
8
+ }
9
+ export declare const TOOLBAR_CONTEXT: InjectionKey<ComputedRef<ToolbarContext>>;
@@ -0,0 +1 @@
1
+ export const TOOLBAR_CONTEXT = Symbol("selaras-toolbar");