@aleph-alpha/ui-library 5.4.0 → 5.6.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 (59) hide show
  1. package/config.d.ts +9 -0
  2. package/config.js +12 -3
  3. package/dist/system/components/UiAutocomplete/UiAutocomplete.vue.d.ts +2 -0
  4. package/dist/system/components/UiButtonGroup/UiButtonGroup.vue.d.ts +20 -0
  5. package/dist/system/components/UiButtonGroup/index.d.ts +2 -0
  6. package/dist/system/components/UiButtonGroup/types.d.ts +20 -0
  7. package/dist/system/components/core/button-group/ButtonGroup.vue.d.ts +23 -0
  8. package/dist/system/components/core/button-group/ButtonGroupSeparator.vue.d.ts +9 -0
  9. package/dist/system/components/core/button-group/ButtonGroupText.vue.d.ts +26 -0
  10. package/dist/system/components/core/button-group/index.d.ts +8 -0
  11. package/dist/system/components/index.d.ts +1 -0
  12. package/dist/system/lib.js +8878 -8692
  13. package/dist/system/patterns/UiFloatActions/UiFloatActionItems.vue.d.ts +173 -2
  14. package/dist/system/patterns/UiFloatActions/floatActionItemContext.d.ts +15 -1
  15. package/dist/system/patterns/UiFloatActions/types.d.ts +25 -1
  16. package/dist/system/story-sidebar-icons.json +8 -1
  17. package/package.json +5 -3
  18. package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +620 -0
  19. package/src/components/UiAutocomplete/UiAutocomplete.vue +28 -3
  20. package/src/components/UiAutocomplete/__tests__/UiAutocomplete.test.ts +14 -69
  21. package/src/components/UiButton/UiButton.stories.ts +9 -9
  22. package/src/components/UiButtonGroup/UiButtonGroup.stories.ts +690 -0
  23. package/src/components/UiButtonGroup/UiButtonGroup.vue +18 -0
  24. package/src/components/UiButtonGroup/__tests__/UiButtonGroup.test.ts +68 -0
  25. package/src/components/UiButtonGroup/index.ts +2 -0
  26. package/src/components/UiButtonGroup/types.ts +21 -0
  27. package/src/components/UiCheckbox/UiCheckbox.stories.ts +253 -0
  28. package/src/components/UiCheckbox/__tests__/UiCheckbox.test.ts +3 -18
  29. package/src/components/UiField/UiField.stories.ts +608 -1
  30. package/src/components/UiField/UiFieldDescription.vue +7 -2
  31. package/src/components/UiInput/UiInput.stories.ts +336 -2
  32. package/src/components/UiInput/__tests__/UiInput.test.ts +20 -28
  33. package/src/components/UiItem/UiItem.stories.ts +236 -1
  34. package/src/components/UiItem/__tests__/UiItem.test.ts +11 -72
  35. package/src/components/UiSelect/UiSelect.stories.ts +769 -0
  36. package/src/components/UiSelect/__tests__/UiSelect.test.ts +4 -73
  37. package/src/components/UiSelect/__tests__/UiSelectItem.test.ts +3 -31
  38. package/src/components/UiSelect/__tests__/UiSelectTrigger.test.ts +14 -5
  39. package/src/components/UiSnackbar/UiSnackbar.stories.ts +6 -6
  40. package/src/components/UiSnackbar/UiSnackbar.vue +4 -4
  41. package/src/components/UiSnackbar/UiSnackbarContent.vue +4 -4
  42. package/src/components/core/button-group/ButtonGroup.vue +24 -0
  43. package/src/components/core/button-group/ButtonGroupSeparator.vue +29 -0
  44. package/src/components/core/button-group/ButtonGroupText.vue +33 -0
  45. package/src/components/core/button-group/index.ts +25 -0
  46. package/src/components/core/checkbox/Checkbox.vue +0 -1
  47. package/src/components/core/select/SelectTrigger.vue +1 -1
  48. package/src/components/core/tabs/TabsTrigger.vue +1 -1
  49. package/src/components/index.ts +1 -0
  50. package/src/patterns/UiDataTable/UiDataTable.stories.ts +495 -8
  51. package/src/patterns/UiDataTable/UiDataTableFilterMenu.vue +1 -1
  52. package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +7 -184
  53. package/src/patterns/UiFloatActions/UiFloatActionItems.vue +138 -11
  54. package/src/patterns/UiFloatActions/UiFloatActions.stories.ts +890 -3
  55. package/src/patterns/UiFloatActions/__tests__/UiFloatActionItems.test.ts +46 -24
  56. package/src/patterns/UiFloatActions/floatActionItemContext.ts +16 -1
  57. package/src/patterns/UiFloatActions/types.ts +28 -1
  58. package/src/components/UiField/__tests__/UiFieldError.test.ts +0 -39
  59. package/src/patterns/UiFloatActions/__tests__/UiFloatActions.a11y.test.ts +0 -152
package/config.d.ts CHANGED
@@ -304,6 +304,15 @@ export declare const getSparkTokenPresetWithoutUiLibraryTypography: () => Preset
304
304
  * Combines theme customization with additional UnoCSS config.
305
305
  */
306
306
  export interface UiLibraryConfigOptions extends UiLibraryPresetOptions {
307
+ /**
308
+ * Include the legacy Spark design-system token preset (emits `--core-*`,
309
+ * `--brand-*`, `--semantic-*`, `--primitives-*` plus Spark spacing/shadow
310
+ * vars and utilities). Enabled by default for coexistence with
311
+ * `ds-components-vue`. Pure ui-library apps can set this to `false` so only
312
+ * ui-library theme tokens are emitted.
313
+ * @default true
314
+ */
315
+ includeSparkTokens?: boolean;
307
316
  /** Additional UnoCSS presets to append after the built-in ones */
308
317
  presets?: Preset[];
309
318
  /** Additional UnoCSS rules */
package/config.js CHANGED
@@ -646,6 +646,9 @@ const getBorderRadiusExactUtilityRules = () => {
646
646
  const className = key === 'DEFAULT' ? 'rounded' : `rounded-${key}`;
647
647
  entries.push([className, { 'border-radius': value }]);
648
648
  }
649
+ // Manual intermediate radius between the `xl` and `2xl` tokens; not sourced
650
+ // from Figma, so it's declared here rather than in tokens.json.
651
+ entries.push(['rounded-xl-2xl', { 'border-radius': '1.375rem' }]);
649
652
  return entriesToRules(entries);
650
653
  };
651
654
 
@@ -1255,6 +1258,7 @@ export const defineUiLibraryConfig = (options = {}) => {
1255
1258
  extend,
1256
1259
  theme,
1257
1260
  includeAllTokens,
1261
+ includeSparkTokens = true,
1258
1262
  themeMode,
1259
1263
  accessible,
1260
1264
  accessibleTheme,
@@ -1290,9 +1294,14 @@ export const defineUiLibraryConfig = (options = {}) => {
1290
1294
  color: 'neutral',
1291
1295
  darkSelector: darkSelector ?? 'html.dark',
1292
1296
  }),
1293
- // Spark Colors / Spacings / Box-shadow tokens. Typography utilities are
1294
- // filtered out where ui-library owns the same class names.
1295
- getSparkTokenPresetWithoutUiLibraryTypography(),
1297
+ // Legacy Spark Colors / Spacings / Box-shadow tokens, bundled for
1298
+ // coexistence with ds-components-vue. Typography utilities are filtered
1299
+ // out where ui-library owns the same class names. Pure ui-library apps
1300
+ // can opt out via `includeSparkTokens: false` so only ui-library theme
1301
+ // tokens are emitted.
1302
+ ...(includeSparkTokens
1303
+ ? [getSparkTokenPresetWithoutUiLibraryTypography()]
1304
+ : []),
1296
1305
  presetUiLibraryThemeFromTokens(themeOptions),
1297
1306
  presetUiLibraryUtils(),
1298
1307
  ...extraPresets,
@@ -33,6 +33,7 @@ declare function __VLS_template(): {
33
33
  }): any;
34
34
  };
35
35
  refs: {
36
+ rootEl: HTMLDivElement;
36
37
  inputEl: HTMLInputElement;
37
38
  };
38
39
  rootEl: HTMLDivElement;
@@ -74,6 +75,7 @@ declare const __VLS_component: import('vue').DefineComponent<UiAutocompleteProps
74
75
  emptyText: string;
75
76
  showIndicator: boolean;
76
77
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
78
+ rootEl: HTMLDivElement;
77
79
  inputEl: HTMLInputElement;
78
80
  }, HTMLDivElement>;
79
81
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -0,0 +1,20 @@
1
+ import { UiButtonGroupProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: HTMLDivElement;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<UiButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiButtonGroupProps> & Readonly<{}>, {
12
+ orientation: import('./types').UiButtonGroupOrientation;
13
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
14
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
15
+ export default _default;
16
+ type __VLS_WithTemplateSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,2 @@
1
+ export { default as UiButtonGroup } from './UiButtonGroup.vue';
2
+ export type { UiButtonGroupProps, UiButtonGroupOrientation } from './types';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Layout direction for the buttons inside a `UiButtonGroup`.
3
+ */
4
+ export type UiButtonGroupOrientation = 'horizontal' | 'vertical';
5
+ /**
6
+ * Visually joins a set of related actions (and inputs) into a single, connected
7
+ * control. Renders a `role="group"` container and merges the borders and radii
8
+ * of its children so they read as one unit.
9
+ * @category Actions
10
+ * @useCases toolbar, segmented actions, split button, input with buttons, pagination controls
11
+ * @keywords button group, group, toolbar, segmented, joined, split button
12
+ * @related UiButton, UiInput
13
+ */
14
+ export interface UiButtonGroupProps {
15
+ /**
16
+ * The layout direction of the grouped buttons.
17
+ * @default 'horizontal'
18
+ */
19
+ orientation?: UiButtonGroupOrientation;
20
+ }
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { ButtonGroupVariants } from '.';
3
+ type __VLS_Props = {
4
+ class?: HTMLAttributes['class'];
5
+ orientation?: ButtonGroupVariants['orientation'];
6
+ };
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: HTMLDivElement;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,9 @@
1
+ import { SeparatorProps } from 'reka-ui';
2
+ import { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = SeparatorProps & {
4
+ class?: HTMLAttributes['class'];
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ orientation: "vertical" | "horizontal";
8
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -0,0 +1,26 @@
1
+ import { PrimitiveProps } from 'reka-ui';
2
+ import { HTMLAttributes } from 'vue';
3
+ import { ButtonGroupVariants } from '.';
4
+ interface Props extends PrimitiveProps {
5
+ class?: HTMLAttributes['class'];
6
+ orientation?: ButtonGroupVariants['orientation'];
7
+ }
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ default?(_: {}): any;
12
+ };
13
+ refs: {};
14
+ rootEl: any;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
18
+ as: import('reka-ui').AsTag | import('vue').Component;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
+ export default _default;
22
+ type __VLS_WithTemplateSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,8 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export { default as ButtonGroup } from './ButtonGroup.vue';
3
+ export { default as ButtonGroupSeparator } from './ButtonGroupSeparator.vue';
4
+ export { default as ButtonGroupText } from './ButtonGroupText.vue';
5
+ export declare const buttonGroupVariants: (props?: ({
6
+ orientation?: "vertical" | "horizontal" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ export type ButtonGroupVariants = VariantProps<typeof buttonGroupVariants>;
@@ -9,6 +9,7 @@ export * from './UiAutocomplete';
9
9
  export * from './UiAvatar';
10
10
  export * from './UiBadge';
11
11
  export * from './UiButton';
12
+ export * from './UiButtonGroup';
12
13
  export * from './UiCalendar';
13
14
  export * from './UiCard';
14
15
  export * from './UiCheckbox';