@aleph-alpha/ui-library 2.9.0 → 2.11.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 (32) hide show
  1. package/config.js +10 -0
  2. package/dist/system/components/UiAutocomplete/UiAutocomplete.vue.d.ts +0 -1
  3. package/dist/system/components/UiAutocomplete/types.d.ts +2 -6
  4. package/dist/system/components/UiSelect/UiSelect.vue.d.ts +4 -5
  5. package/dist/system/components/UiSelect/UiSelectContent.vue.d.ts +0 -1
  6. package/dist/system/components/UiSelect/UiSelectItem.vue.d.ts +2 -9
  7. package/dist/system/components/UiSelect/UiSelectTrigger.vue.d.ts +0 -2
  8. package/dist/system/components/UiSelect/UiSelectValue.vue.d.ts +0 -3
  9. package/dist/system/components/UiSelect/types.d.ts +26 -6
  10. package/dist/system/lib.js +18370 -18530
  11. package/dist/system/patterns/UiDataTable/UiDataTableToolbar.vue.d.ts +2 -2
  12. package/docs/public-docs/component-lifecycle.md +177 -0
  13. package/docs/public-docs/quick-start.md +43 -4
  14. package/package.json +5 -3
  15. package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +1 -1
  16. package/src/components/UiAutocomplete/UiAutocomplete.vue +9 -9
  17. package/src/components/UiAutocomplete/__tests__/UiAutocomplete.test.ts +76 -5
  18. package/src/components/UiAutocomplete/types.ts +2 -6
  19. package/src/components/UiSelect/UiSelect.stories.ts +4 -90
  20. package/src/components/UiSelect/UiSelect.vue +66 -144
  21. package/src/components/UiSelect/UiSelectContent.vue +10 -21
  22. package/src/components/UiSelect/UiSelectItem.vue +0 -82
  23. package/src/components/UiSelect/UiSelectTrigger.vue +1 -62
  24. package/src/components/UiSelect/UiSelectValue.vue +1 -47
  25. package/src/components/UiSelect/__tests__/UiSelect.test.ts +47 -98
  26. package/src/components/UiSelect/__tests__/UiSelectContent.test.ts +36 -3
  27. package/src/components/UiSelect/__tests__/UiSelectItem.test.ts +1 -1
  28. package/src/components/UiSelect/__tests__/UiSelectTrigger.test.ts +2 -2
  29. package/src/components/UiSelect/types.ts +29 -6
  30. package/src/patterns/UiDataTable/UiDataTableToolbar.vue +1 -1
  31. package/dist/system/components/UiSelect/context.d.ts +0 -28
  32. package/src/components/UiSelect/context.ts +0 -42
package/config.js CHANGED
@@ -1027,6 +1027,10 @@ export const defineUiLibraryConfig = (options = {}) => {
1027
1027
  extend,
1028
1028
  theme,
1029
1029
  includeAllTokens,
1030
+ themeMode,
1031
+ accessible,
1032
+ accessibleTheme,
1033
+ accessibleSelector,
1030
1034
  presets: extraPresets = [],
1031
1035
  rules: extraRules = [],
1032
1036
  shortcuts: extraShortcuts = [],
@@ -1041,6 +1045,12 @@ export const defineUiLibraryConfig = (options = {}) => {
1041
1045
  if (theme !== undefined) themeOptions.theme = theme;
1042
1046
  if (includeAllTokens !== undefined)
1043
1047
  themeOptions.includeAllTokens = includeAllTokens;
1048
+ if (themeMode !== undefined) themeOptions.themeMode = themeMode;
1049
+ if (accessible !== undefined) themeOptions.accessible = accessible;
1050
+ if (accessibleTheme !== undefined)
1051
+ themeOptions.accessibleTheme = accessibleTheme;
1052
+ if (accessibleSelector !== undefined)
1053
+ themeOptions.accessibleSelector = accessibleSelector;
1044
1054
 
1045
1055
  return defineConfig({
1046
1056
  ...getUiLibraryContentConfig(),
@@ -61,7 +61,6 @@ declare const __VLS_component: import('vue').DefineComponent<UiAutocompleteProps
61
61
  dir: "ltr" | "rtl";
62
62
  modelValue: string | string[];
63
63
  defaultValue: string | string[];
64
- size: "default" | "sm";
65
64
  multiple: boolean;
66
65
  placeholder: string;
67
66
  open: boolean;
@@ -8,13 +8,11 @@ export type UiAutocompleteOption = {
8
8
  disabled?: boolean;
9
9
  };
10
10
  /**
11
- * Beta: Filterable select input for choosing one or many options.
11
+ * Filterable select input for choosing one or many options.
12
12
  *
13
- * This component is currently beta. Its API and behavior may still change
14
- * before it is considered stable.
15
13
  * @category Form Inputs
16
14
  * @useCases autocomplete, searchable select, multi select, command picker
17
- * @keywords autocomplete, combobox, select, search, filter, multi-select, beta
15
+ * @keywords autocomplete, combobox, select, search, filter, multi-select
18
16
  * @related UiSelect, UiTagsInput, UiListbox
19
17
  */
20
18
  export type UiAutocompleteProps = {
@@ -50,8 +48,6 @@ export type UiAutocompleteProps = {
50
48
  name?: string;
51
49
  /** Reading direction. */
52
50
  dir?: 'ltr' | 'rtl';
53
- /** Trigger/input size. */
54
- size?: 'default' | 'sm';
55
51
  /** Text shown when filtering returns no options. */
56
52
  emptyText?: string;
57
53
  /** Optional leading icon name. */
@@ -3,23 +3,22 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {}): any;
6
- default?(_: {}): any;
7
6
  };
8
7
  refs: {};
9
8
  rootEl: any;
10
9
  };
11
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
11
  declare const __VLS_component: import('vue').DefineComponent<UiSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
- "update:modelValue": (value: string | string[]) => any;
12
+ "update:modelValue": (value: import('./types').UiSelectValue) => any;
14
13
  "update:open": (value: boolean) => any;
15
14
  }, string, import('vue').PublicProps, Readonly<UiSelectProps> & Readonly<{
16
- "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
15
+ "onUpdate:modelValue"?: ((value: import('./types').UiSelectValue) => any) | undefined;
17
16
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
18
17
  }>, {
19
18
  disabled: boolean;
20
19
  dir: "ltr" | "rtl";
21
- modelValue: string | string[];
22
- defaultValue: string | string[];
20
+ modelValue: import('./types').UiSelectValue;
21
+ defaultValue: import('./types').UiSelectValue;
23
22
  multiple: boolean;
24
23
  open: boolean;
25
24
  defaultOpen: boolean;
@@ -3,7 +3,6 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {}): any;
6
- default?(_: {}): any;
7
6
  };
8
7
  refs: {};
9
8
  rootEl: any;
@@ -3,24 +3,17 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  'right-icon'?(_: {}): any;
6
- 'right-icon'?(_: {}): any;
7
- 'indicator-icon'?(_: {}): any;
8
6
  'indicator-icon'?(_: {}): any;
9
7
  default?(_: {}): any;
10
- default?(_: {}): any;
11
- };
12
- refs: {
13
- labelEl: HTMLSpanElement;
14
8
  };
9
+ refs: {};
15
10
  rootEl: any;
16
11
  };
17
12
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
13
  declare const __VLS_component: import('vue').DefineComponent<UiSelectItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiSelectItemProps> & Readonly<{}>, {
19
14
  disabled: boolean;
20
15
  textValue: string;
21
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
22
- labelEl: HTMLSpanElement;
23
- }, any>;
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
17
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
25
18
  export default _default;
26
19
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -3,7 +3,6 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {}): any;
6
- default?(_: {}): any;
7
6
  };
8
7
  refs: {};
9
8
  rootEl: any;
@@ -11,7 +10,6 @@ declare function __VLS_template(): {
11
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
11
  declare const __VLS_component: import('vue').DefineComponent<UiSelectTriggerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiSelectTriggerProps> & Readonly<{}>, {
13
12
  disabled: boolean;
14
- size: "default" | "sm";
15
13
  ariaLabel: string;
16
14
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
15
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -3,9 +3,6 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {}): any;
6
- default?(_: {
7
- selected: string[];
8
- }): any;
9
6
  };
10
7
  refs: {};
11
8
  rootEl: any;
@@ -1,3 +1,23 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ /**
3
+ * Selected value shape used by `UiSelect`.
4
+ *
5
+ * - Single-select mode uses a string value.
6
+ * - Multi-select mode uses an array of string values.
7
+ *
8
+ * This type represents an actual selection payload, so it intentionally does
9
+ * not include `undefined`. Optional props such as `modelValue` and
10
+ * `defaultValue` become `undefined` through the optional property itself.
11
+ */
12
+ export type UiSelectValue = string | string[];
13
+ /**
14
+ * Optional selected value accepted by internal normalization helpers.
15
+ *
16
+ * Use this when code needs to handle the absence of a select value explicitly,
17
+ * for example while forwarding optional `modelValue` or `defaultValue` props
18
+ * to the underlying select primitive.
19
+ */
20
+ export type UiSelectOptionalValue = UiSelectValue | undefined;
1
21
  /**
2
22
  * A dropdown select for choosing from a list of options. Use for
3
23
  * form fields where users must pick one value from many.
@@ -12,9 +32,9 @@ export type UiSelectProps = {
12
32
  * - In single-select (default): a `string`.
13
33
  * - In multi-select (`multiple: true`): a `string[]`.
14
34
  */
15
- modelValue?: string | string[];
35
+ modelValue?: UiSelectValue;
16
36
  /** The value when initially rendered (uncontrolled). Same shape as `modelValue`. */
17
- defaultValue?: string | string[];
37
+ defaultValue?: UiSelectValue;
18
38
  /** Whether the select is open by default. */
19
39
  defaultOpen?: boolean;
20
40
  /** Controlled open state. */
@@ -39,7 +59,7 @@ export type UiSelectProps = {
39
59
  /** Reading direction. */
40
60
  dir?: 'ltr' | 'rtl';
41
61
  /**
42
- * When true, allows selecting multiple items. The popover stays open on
62
+ * When true, allows selecting multiple items. The dropdown stays open on
43
63
  * click and the trigger renders the selected values as a comma-separated
44
64
  * list. `modelValue` becomes a `string[]`.
45
65
  */
@@ -53,7 +73,7 @@ export type UiSelectEmits = {
53
73
  * Emitted when the selected value changes.
54
74
  * Payload is `string` in single-select and `string[]` in multi-select.
55
75
  */
56
- 'update:modelValue': [value: string | string[]];
76
+ 'update:modelValue': [value: UiSelectValue];
57
77
  /** Emitted when the open state changes. */
58
78
  'update:open': [value: boolean];
59
79
  };
@@ -65,13 +85,13 @@ export type UiSelectTriggerProps = {
65
85
  ariaLabel?: string;
66
86
  /** Whether the trigger is disabled. */
67
87
  disabled?: boolean;
68
- /** Size of the trigger. */
69
- size?: 'default' | 'sm';
70
88
  };
71
89
  /**
72
90
  * Props for the UiSelectContent component.
73
91
  */
74
92
  export type UiSelectContentProps = {
93
+ /** Additional classes for the floating content. */
94
+ class?: HTMLAttributes['class'];
75
95
  /** Preferred side of the trigger. */
76
96
  side?: 'top' | 'right' | 'bottom' | 'left';
77
97
  /** Distance from the trigger in pixels. */