@aleph-alpha/ui-library 2.4.3 → 2.5.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 (82) hide show
  1. package/config.d.ts +13 -0
  2. package/config.js +156 -12
  3. package/dist/system/components/UiAvatar/UiAvatar.vue.d.ts +4 -1
  4. package/dist/system/components/UiAvatar/UiAvatarGroup.vue.d.ts +18 -0
  5. package/dist/system/components/UiAvatar/index.d.ts +1 -0
  6. package/dist/system/components/UiAvatar/types.d.ts +12 -1
  7. package/dist/system/components/UiFileItem/UiFileItem.vue.d.ts +6 -1
  8. package/dist/system/components/UiFileItem/types.d.ts +30 -10
  9. package/dist/system/components/UiFileType/UiFileType.vue.d.ts +8 -0
  10. package/dist/system/components/UiFileType/index.d.ts +2 -0
  11. package/dist/system/components/UiFileType/types.d.ts +33 -0
  12. package/dist/system/components/UiItem/UiItem.vue.d.ts +8 -1
  13. package/dist/system/components/UiItem/constants.d.ts +4 -3
  14. package/dist/system/components/UiItem/index.d.ts +1 -1
  15. package/dist/system/components/UiItem/types.d.ts +53 -13
  16. package/dist/system/components/core/avatar/Avatar.vue.d.ts +2 -0
  17. package/dist/system/components/core/avatar/index.d.ts +1 -0
  18. package/dist/system/components/core/item/Item.vue.d.ts +1 -1
  19. package/dist/system/components/core/item/ItemAction.vue.d.ts +25 -0
  20. package/dist/system/components/core/item/index.d.ts +8 -4
  21. package/dist/system/components/index.d.ts +1 -0
  22. package/dist/system/lib/activeIndicator.d.ts +1 -0
  23. package/dist/system/lib.js +6574 -6357
  24. package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -15
  25. package/docs/public-docs/quick-start.md +2 -1
  26. package/package.json +1 -1
  27. package/src/components/UiAvatar/UiAvatar.stories.ts +103 -12
  28. package/src/components/UiAvatar/UiAvatar.vue +6 -1
  29. package/src/components/UiAvatar/UiAvatarGroup.vue +16 -0
  30. package/src/components/UiAvatar/UiAvatarImage.vue +1 -1
  31. package/src/components/UiAvatar/__tests__/UiAvatar.test.ts +86 -0
  32. package/src/components/UiAvatar/index.ts +1 -0
  33. package/src/components/UiAvatar/types.ts +15 -1
  34. package/src/components/UiButton/UiButton.stories.ts +60 -0
  35. package/src/components/UiCodeBlock/UiCodeBlock.vue +1 -1
  36. package/src/components/UiFileItem/UiFileItem.stories.ts +344 -185
  37. package/src/components/UiFileItem/UiFileItem.vue +110 -70
  38. package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +64 -3
  39. package/src/components/UiFileItem/types.ts +33 -10
  40. package/src/components/UiFileType/UiFileType.stories.ts +134 -0
  41. package/src/components/UiFileType/UiFileType.vue +116 -0
  42. package/src/components/UiFileType/__tests__/UiFileType.test.ts +41 -0
  43. package/src/components/UiFileType/index.ts +2 -0
  44. package/src/components/UiFileType/types.ts +38 -0
  45. package/src/components/UiItem/UiItem.stories.ts +555 -855
  46. package/src/components/UiItem/UiItem.vue +59 -4
  47. package/src/components/UiItem/UiItemMedia.vue +1 -1
  48. package/src/components/UiItem/__tests__/UiItem.test.ts +432 -26
  49. package/src/components/UiItem/constants.ts +16 -2
  50. package/src/components/UiItem/index.ts +1 -1
  51. package/src/components/UiItem/types.ts +64 -13
  52. package/src/components/UiKbd/UiKbd.stories.ts +1 -1
  53. package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +4 -4
  54. package/src/components/UiSelect/__tests__/UiSelectGroup.test.ts +2 -2
  55. package/src/components/UiTable/__tests__/UiTableRow.test.ts +4 -2
  56. package/src/components/core/avatar/Avatar.vue +17 -1
  57. package/src/components/core/avatar/AvatarFallback.vue +1 -1
  58. package/src/components/core/{item/ItemActions.vue → avatar/AvatarGroup.vue} +7 -2
  59. package/src/components/core/avatar/index.ts +1 -0
  60. package/src/components/core/button/index.ts +1 -1
  61. package/src/components/core/drawer/DrawerContent.vue +1 -1
  62. package/src/components/core/item/Item.vue +2 -2
  63. package/src/components/core/item/ItemAction.vue +30 -0
  64. package/src/components/core/item/ItemContent.vue +1 -1
  65. package/src/components/core/item/ItemDescription.vue +1 -1
  66. package/src/components/core/item/ItemGroup.vue +0 -1
  67. package/src/components/core/item/index.ts +32 -9
  68. package/src/components/core/kbd/Kbd.vue +1 -1
  69. package/src/components/core/skeleton/Skeleton.vue +3 -1
  70. package/src/components/core/slider/Slider.vue +1 -1
  71. package/src/components/core/table/TableFooter.vue +4 -1
  72. package/src/components/core/table/TableRow.vue +1 -1
  73. package/src/components/index.ts +1 -0
  74. package/src/lib/activeIndicator.ts +1 -0
  75. package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +2 -2
  76. package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +2 -2
  77. package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +2 -2
  78. package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +2 -2
  79. package/src/patterns/UiSidebar/__tests__/UiSidebarMenuButton.test.ts +33 -0
  80. package/src/patterns/UiSidebar/activeIndicator.ts +1 -16
  81. package/src/theme/BorderRadius.stories.ts +115 -0
  82. /package/dist/system/components/core/{item/ItemActions.vue.d.ts → avatar/AvatarGroup.vue.d.ts} +0 -0
@@ -1,15 +1 @@
1
- /**
2
- * Shared class string for the left-edge active indicator used by every
3
- * sidebar row (menu button, sub-menu item, popover trigger, popover menu item).
4
- *
5
- * The `::before` pseudo-element is always mounted so CSS has something to
6
- * transition. At rest it's painted from `scale-x-0` + `opacity-0` with its
7
- * transform anchored on the left edge (`origin-left`); when the row's
8
- * `data-active="true"` flips on, the bar paints in from left to right while
9
- * fading in, using a 200ms linear curve that matches the sidebar collapse
10
- * and group-content height transitions so all sidebar motion stays in sync.
11
- *
12
- * Kept as a string constant (rather than generated via `cn`) so UnoCSS's
13
- * static scanner picks up every utility class for atomic CSS generation.
14
- */
15
- export declare const SIDEBAR_ACTIVE_INDICATOR_CLASS = "before:absolute before:z-10 before:top-1/2 before:left-0 before:h-1/2 before:w-0.5 before:-translate-y-1/2 before:origin-left before:scale-x-0 before:rounded-full before:bg-background-accent-default before:opacity-0 before:transition-[transform,opacity] before:duration-200 before:ease-linear before:content-[\"\"] data-[active=true]:before:scale-x-100 data-[active=true]:before:opacity-100";
1
+ export { ACTIVE_INDICATOR_CLASS as SIDEBAR_ACTIVE_INDICATOR_CLASS } from '../../lib/activeIndicator';
@@ -200,12 +200,13 @@ All config functions are exported from `@aleph-alpha/ui-library/config`:
200
200
  |--------|-------------|
201
201
  | `defineUiLibraryConfig(options?)` | **Recommended.** Complete UnoCSS config with all presets, content scanning, fonts, and tokens. Options: `extend`, `darkSelector`, `presets`, `rules`, `shortcuts`, and any other UnoCSS config |
202
202
  | `getUiLibraryContentConfig()` | UnoCSS content/pipeline config to scan library classes |
203
- | `presetUiLibraryThemeFromTokens(options?)` | Token preset. Bundles token CSS variables, theme colors, semantic overrides, and typography classes. Options: `darkSelector` (default: `'html.dark'`), `includeAllTokens` (default: `true`), `extend`, `theme` |
203
+ | `presetUiLibraryThemeFromTokens(options?)` | Token preset. Bundles token CSS variables, theme colors, border radius utilities, semantic overrides, and typography classes. Options: `darkSelector` (default: `'html.dark'`), `includeAllTokens` (default: `true`), `extend`, `theme` |
204
204
  | `presetUiLibraryUtils()` | Utility rules required by library components (`w-(--var)`, `h-(--var)`, etc.) |
205
205
  | `presetUiLibraryTheme(theme, options?)` | Low-level preset with manually provided theme variables (for custom themes) |
206
206
  | `getUiLibraryThemeFromTokens()` | Returns the raw theme object derived from `tokens.json` |
207
207
  | `getUiLibraryTokenVars()` | Returns all token-based CSS variables for light and dark modes |
208
208
  | `getUiLibraryTokenColors()` | Returns UnoCSS theme colors config for all token-based colors (included automatically by `presetUiLibraryThemeFromTokens`) |
209
+ | `getUiLibraryTokenBorderRadius()` | Returns UnoCSS `theme.borderRadius` config from corner-radius tokens (included automatically by `presetUiLibraryThemeFromTokens`) |
209
210
  | `getUiLibraryTypographyShortcuts()` | Returns typography class definitions as `[className, cssProperties]` tuples (included automatically by `presetUiLibraryThemeFromTokens`) |
210
211
  | `defineThemeConfig(config)` | Type-safe helper for external theme config files |
211
212
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleph-alpha/ui-library",
3
- "version": "2.4.3",
3
+ "version": "2.5.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/system/lib.js",
@@ -1,5 +1,10 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
- import { UiAvatar, UiAvatarFallback, UiAvatarImage } from './index';
2
+ import {
3
+ UiAvatar,
4
+ UiAvatarFallback,
5
+ UiAvatarGroup,
6
+ UiAvatarImage,
7
+ } from './index';
3
8
 
4
9
  /**
5
10
  * UiAvatar is a small image-based representation of a user or entity, with a graceful text or icon fallback when the image fails to load.
@@ -9,8 +14,17 @@ const meta: Meta<typeof UiAvatar> = {
9
14
  title: 'Components/UiAvatar',
10
15
  component: UiAvatar,
11
16
  tags: ['autodocs'],
12
- argTypes: {},
13
- args: {},
17
+ argTypes: {
18
+ size: {
19
+ control: 'select',
20
+ options: [5, 6, 8, 10, 12],
21
+ description:
22
+ 'Avatar width and height token. Maps to `size-5`, `size-6`, `size-8`, `size-10`, or `size-12`.',
23
+ },
24
+ },
25
+ args: {
26
+ size: 8,
27
+ },
14
28
  };
15
29
 
16
30
  export default meta;
@@ -32,14 +46,17 @@ import { UiAvatar, UiAvatarFallback, UiAvatarImage } from '@aleph-alpha/ui-libra
32
46
  * Default avatar with image and fallback.
33
47
  */
34
48
  export const Default: Story = {
35
- render: () => ({
49
+ render: (args) => ({
36
50
  components: {
37
51
  UiAvatar,
38
52
  UiAvatarFallback,
39
53
  UiAvatarImage,
40
54
  },
55
+ setup() {
56
+ return { args };
57
+ },
41
58
  template: `
42
- <UiAvatar>
59
+ <UiAvatar :size="args.size">
43
60
  <UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
44
61
  <UiAvatarFallback>CN</UiAvatarFallback>
45
62
  </UiAvatar>
@@ -54,6 +71,79 @@ export const Default: Story = {
54
71
  },
55
72
  };
56
73
 
74
+ const sizesTemplateSource = `<script setup lang="ts">
75
+ import { UiAvatar, UiAvatarFallback, UiAvatarImage } from '@aleph-alpha/ui-library'
76
+ </script>
77
+
78
+ <template>
79
+ <div class="flex items-center gap-4">
80
+ <UiAvatar :size="5">
81
+ <UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
82
+ <UiAvatarFallback>CN</UiAvatarFallback>
83
+ </UiAvatar>
84
+ <UiAvatar :size="6">
85
+ <UiAvatarImage src="https://github.com/leerob.png" alt="@leerob" />
86
+ <UiAvatarFallback>LR</UiAvatarFallback>
87
+ </UiAvatar>
88
+ <UiAvatar :size="8">
89
+ <UiAvatarImage src="https://github.com/evilrabbit.png" alt="@evilrabbit" />
90
+ <UiAvatarFallback>ER</UiAvatarFallback>
91
+ </UiAvatar>
92
+ <UiAvatar :size="10">
93
+ <UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
94
+ <UiAvatarFallback>CN</UiAvatarFallback>
95
+ </UiAvatar>
96
+ <UiAvatar :size="12">
97
+ <UiAvatarImage src="https://github.com/leerob.png" alt="@leerob" />
98
+ <UiAvatarFallback>LR</UiAvatarFallback>
99
+ </UiAvatar>
100
+ </div>
101
+ </template>`;
102
+
103
+ /**
104
+ * Available avatar sizes.
105
+ */
106
+ export const Sizes: Story = {
107
+ render: () => ({
108
+ components: {
109
+ UiAvatar,
110
+ UiAvatarFallback,
111
+ UiAvatarImage,
112
+ },
113
+ template: `
114
+ <div class="flex items-center gap-4">
115
+ <UiAvatar :size="5">
116
+ <UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
117
+ <UiAvatarFallback>CN</UiAvatarFallback>
118
+ </UiAvatar>
119
+ <UiAvatar :size="6">
120
+ <UiAvatarImage src="https://github.com/leerob.png" alt="@leerob" />
121
+ <UiAvatarFallback>LR</UiAvatarFallback>
122
+ </UiAvatar>
123
+ <UiAvatar :size="8">
124
+ <UiAvatarImage src="https://github.com/evilrabbit.png" alt="@evilrabbit" />
125
+ <UiAvatarFallback>ER</UiAvatarFallback>
126
+ </UiAvatar>
127
+ <UiAvatar :size="10">
128
+ <UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
129
+ <UiAvatarFallback>CN</UiAvatarFallback>
130
+ </UiAvatar>
131
+ <UiAvatar :size="12">
132
+ <UiAvatarImage src="https://github.com/leerob.png" alt="@leerob" />
133
+ <UiAvatarFallback>LR</UiAvatarFallback>
134
+ </UiAvatar>
135
+ </div>
136
+ `,
137
+ }),
138
+ parameters: {
139
+ docs: {
140
+ source: {
141
+ code: sizesTemplateSource,
142
+ },
143
+ },
144
+ },
145
+ };
146
+
57
147
  const fallbackTemplateSource = `<script setup lang="ts">
58
148
  import { UiAvatar, UiAvatarFallback, UiAvatarImage } from '@aleph-alpha/ui-library'
59
149
  </script>
@@ -141,11 +231,11 @@ export const Multiple: Story = {
141
231
  };
142
232
 
143
233
  const stackedTemplateSource = `<script setup lang="ts">
144
- import { UiAvatar, UiAvatarFallback, UiAvatarImage } from '@aleph-alpha/ui-library'
234
+ import { UiAvatar, UiAvatarFallback, UiAvatarGroup, UiAvatarImage } from '@aleph-alpha/ui-library'
145
235
  </script>
146
236
 
147
237
  <template>
148
- <div class="flex [&>*+*]:-ml-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background">
238
+ <UiAvatarGroup>
149
239
  <UiAvatar>
150
240
  <UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
151
241
  <UiAvatarFallback>CN</UiAvatarFallback>
@@ -158,21 +248,22 @@ import { UiAvatar, UiAvatarFallback, UiAvatarImage } from '@aleph-alpha/ui-libra
158
248
  <UiAvatarImage src="https://github.com/evilrabbit.png" alt="@evilrabbit" />
159
249
  <UiAvatarFallback>ER</UiAvatarFallback>
160
250
  </UiAvatar>
161
- </div>
251
+ </UiAvatarGroup>
162
252
  </template>`;
163
253
 
164
254
  /**
165
- * Stacked avatars with overlapping layout.
255
+ * Avatar group with stacked avatars.
166
256
  */
167
- export const Stacked: Story = {
257
+ export const AvatarGroup: Story = {
168
258
  render: () => ({
169
259
  components: {
170
260
  UiAvatar,
171
261
  UiAvatarFallback,
262
+ UiAvatarGroup,
172
263
  UiAvatarImage,
173
264
  },
174
265
  template: `
175
- <div class="flex [&>*+*]:-ml-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background">
266
+ <UiAvatarGroup>
176
267
  <UiAvatar>
177
268
  <UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
178
269
  <UiAvatarFallback>CN</UiAvatarFallback>
@@ -185,7 +276,7 @@ export const Stacked: Story = {
185
276
  <UiAvatarImage src="https://github.com/evilrabbit.png" alt="@evilrabbit" />
186
277
  <UiAvatarFallback>ER</UiAvatarFallback>
187
278
  </UiAvatar>
188
- </div>
279
+ </UiAvatarGroup>
189
280
  `,
190
281
  }),
191
282
  parameters: {
@@ -1,13 +1,18 @@
1
1
  <script setup lang="ts">
2
2
  import { Avatar as ShadcnAvatar } from '@/components/core/avatar';
3
+ import type { UiAvatarProps } from './types';
3
4
 
4
5
  defineOptions({
5
6
  name: 'UiAvatar',
6
7
  });
8
+
9
+ const props = withDefaults(defineProps<UiAvatarProps>(), {
10
+ size: 8,
11
+ });
7
12
  </script>
8
13
 
9
14
  <template>
10
- <ShadcnAvatar>
15
+ <ShadcnAvatar :size="props.size" :class="props.class">
11
16
  <slot />
12
17
  </ShadcnAvatar>
13
18
  </template>
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ import { AvatarGroup as ShadcnAvatarGroup } from '@/components/core/avatar';
3
+ import type { UiAvatarGroupProps } from './types';
4
+
5
+ defineOptions({
6
+ name: 'UiAvatarGroup',
7
+ });
8
+
9
+ const props = defineProps<UiAvatarGroupProps>();
10
+ </script>
11
+
12
+ <template>
13
+ <ShadcnAvatarGroup v-bind="props">
14
+ <slot />
15
+ </ShadcnAvatarGroup>
16
+ </template>
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { AvatarImage as ShadcnAvatarImage } from '@/components/core/avatar';
3
- import { UiAvatarImageProps } from './types';
3
+ import type { UiAvatarImageProps } from './types';
4
4
 
5
5
  defineOptions({
6
6
  name: 'UiAvatarImage',
@@ -4,6 +4,7 @@ import { h } from 'vue';
4
4
  import UiAvatar from '../UiAvatar.vue';
5
5
  import UiAvatarImage from '../UiAvatarImage.vue';
6
6
  import UiAvatarFallback from '../UiAvatarFallback.vue';
7
+ import UiAvatarGroup from '../UiAvatarGroup.vue';
7
8
 
8
9
  describe('UiAvatar', () => {
9
10
  test('renders image with src and alt attributes', () => {
@@ -35,4 +36,89 @@ describe('UiAvatar', () => {
35
36
  ).toBeInTheDocument();
36
37
  expect(getByText('AB')).toBeInTheDocument();
37
38
  });
39
+
40
+ test('renders default size', () => {
41
+ const { container } = render(UiAvatar, {
42
+ slots: {
43
+ default: () => h(UiAvatarFallback, null, () => 'AB'),
44
+ },
45
+ });
46
+
47
+ expect(container.querySelector('[data-slot="avatar"]')).toHaveClass(
48
+ 'size-8',
49
+ );
50
+ });
51
+
52
+ test.each([
53
+ [5, 'size-5'],
54
+ [6, 'size-6'],
55
+ [8, 'size-8'],
56
+ [10, 'size-10'],
57
+ [12, 'size-12'],
58
+ ['12', 'size-12'],
59
+ ])('renders size %s as %s', (size, sizeClass) => {
60
+ const { container } = render(UiAvatar, {
61
+ props: {
62
+ size,
63
+ },
64
+ slots: {
65
+ default: () => h(UiAvatarFallback, null, () => 'AB'),
66
+ },
67
+ });
68
+
69
+ expect(container.querySelector('[data-slot="avatar"]')).toHaveClass(
70
+ sizeClass,
71
+ );
72
+ });
73
+
74
+ test('forwards custom class to avatar root', () => {
75
+ const { container } = render(UiAvatar, {
76
+ props: {
77
+ class: 'ring-1',
78
+ },
79
+ slots: {
80
+ default: () => h(UiAvatarFallback, null, () => 'AB'),
81
+ },
82
+ });
83
+
84
+ expect(container.querySelector('[data-slot="avatar"]')).toHaveClass(
85
+ 'ring-1',
86
+ );
87
+ });
88
+
89
+ test('renders grouped avatars', () => {
90
+ const { container } = render(UiAvatarGroup, {
91
+ slots: {
92
+ default: () => [
93
+ h(UiAvatar, null, () => h(UiAvatarFallback, null, () => 'AB')),
94
+ h(UiAvatar, null, () => h(UiAvatarFallback, null, () => 'CD')),
95
+ ],
96
+ },
97
+ });
98
+
99
+ const group = container.querySelector('[data-slot="avatar-group"]');
100
+ expect(group).toBeInTheDocument();
101
+ expect(group?.querySelectorAll('[data-slot="avatar"]')).toHaveLength(2);
102
+ });
103
+
104
+ test('applies avatar group stacking styles and custom classes', () => {
105
+ const { container } = render(UiAvatarGroup, {
106
+ props: {
107
+ class: 'custom-group',
108
+ },
109
+ slots: {
110
+ default: () =>
111
+ h(UiAvatar, null, () => h(UiAvatarFallback, null, () => 'AB')),
112
+ },
113
+ });
114
+
115
+ const group = container.querySelector('[data-slot="avatar-group"]');
116
+ expect(group).toHaveClass('flex');
117
+ expect(group).toHaveClass('items-center');
118
+ expect(group).toHaveClass('custom-group');
119
+ expect(group?.className).toContain('[&>*+*]:-ml-2');
120
+ expect(group?.className).toContain(
121
+ '*:data-[slot=avatar]:ring-background-surface-primary',
122
+ );
123
+ });
38
124
  });
@@ -1,4 +1,5 @@
1
1
  export { default as UiAvatar } from './UiAvatar.vue';
2
2
  export { default as UiAvatarFallback } from './UiAvatarFallback.vue';
3
+ export { default as UiAvatarGroup } from './UiAvatarGroup.vue';
3
4
  export { default as UiAvatarImage } from './UiAvatarImage.vue';
4
5
  export type * from './types';
@@ -1,4 +1,6 @@
1
- import { ImgHTMLAttributes } from 'vue';
1
+ import type { HTMLAttributes, ImgHTMLAttributes } from 'vue';
2
+
3
+ export type UiAvatarSize = 5 | 6 | 8 | 10 | 12 | '5' | '6' | '8' | '10' | '12';
2
4
 
3
5
  /**
4
6
  * A circular image for representing users or entities. Use for
@@ -8,6 +10,13 @@ import { ImgHTMLAttributes } from 'vue';
8
10
  * @keywords avatar, image, profile, picture, user, photo, initials
9
11
  * @related UiBadge
10
12
  */
13
+ export type UiAvatarProps = {
14
+ /** Avatar width and height token. Maps to `size-{value}` utilities. */
15
+ size?: UiAvatarSize;
16
+ /** Additional classes for the avatar root. */
17
+ class?: HTMLAttributes['class'];
18
+ };
19
+
11
20
  export type UiAvatarImageProps = {
12
21
  /** The source URL of the avatar image. */
13
22
  src: string;
@@ -18,3 +27,8 @@ export type UiAvatarImageProps = {
18
27
  /** The CORS setting for the image request. */
19
28
  crossOrigin?: ImgHTMLAttributes['crossorigin'];
20
29
  };
30
+
31
+ export type UiAvatarGroupProps = {
32
+ /** Additional classes for the avatar group container. */
33
+ class?: HTMLAttributes['class'];
34
+ };
@@ -556,6 +556,66 @@ export const AllVariants: Story = {
556
556
  },
557
557
  };
558
558
 
559
+ const disabledHoverBleedTemplateSource = `<script setup lang="ts">
560
+ import { UiButton } from '@aleph-alpha/ui-library'
561
+ </script>
562
+
563
+ <template>
564
+ <div class="flex flex-col gap-6">
565
+ <p class="body-14-regular text-muted-foreground max-w-xl">
566
+ Hover or move quickly over the disabled buttons. Any hover layer should
567
+ stay within the visual button bounds.
568
+ </p>
569
+ <div class="w-96 border border-dashed border-border-surface-default p-6">
570
+ <UiButton disabled>Disabled default</UiButton>
571
+ </div>
572
+ <div class="w-96 border border-dashed border-border-surface-default p-6">
573
+ <UiButton variant="secondary" disabled>Disabled secondary</UiButton>
574
+ </div>
575
+ <div class="w-96 border border-dashed border-border-surface-default p-6">
576
+ <UiButton variant="destructive" disabled>Disabled destructive</UiButton>
577
+ </div>
578
+ </div>
579
+ </template>`;
580
+
581
+ /**
582
+ * Reproduction story for disabled-button hover layers bleeding outside the
583
+ * visual button bounds.
584
+ */
585
+ export const DisabledHoverBleed: Story = {
586
+ render: () => ({
587
+ components: { UiButton },
588
+ template: `
589
+ <div class="flex flex-col gap-6">
590
+ <p class="body-14-regular text-muted-foreground max-w-xl">
591
+ Hover or move quickly over the disabled buttons. Any hover layer should
592
+ stay within the visual button bounds.
593
+ </p>
594
+ <div class="w-96 border border-dashed border-border-surface-default p-6">
595
+ <UiButton disabled>Disabled default</UiButton>
596
+ </div>
597
+ <div class="w-96 border border-dashed border-border-surface-default p-6">
598
+ <UiButton variant="secondary" disabled>Disabled secondary</UiButton>
599
+ </div>
600
+ <div class="w-96 border border-dashed border-border-surface-default p-6">
601
+ <UiButton variant="destructive" disabled>Disabled destructive</UiButton>
602
+ </div>
603
+ </div>
604
+ `,
605
+ }),
606
+ parameters: {
607
+ docs: {
608
+ description: {
609
+ story:
610
+ 'Use this story to reproduce hover-layer bleed on disabled buttons. The dashed containers make any misplaced absolute hover layer visible.',
611
+ },
612
+ source: {
613
+ code: disabledHoverBleedTemplateSource,
614
+ },
615
+ },
616
+ },
617
+ };
618
+
559
619
  const iconSizesTemplateSource = `<script setup lang="ts">
560
620
  import { UiButton, UiIcon } from '@aleph-alpha/ui-library'
561
621
  </script>
@@ -105,7 +105,7 @@ onUnmounted(() => {
105
105
  >
106
106
  <div
107
107
  v-if="showHeader"
108
- class="flex items-center justify-between border-b border-border bg-muted px-4 py-2"
108
+ class="flex items-center justify-between border-b border-border bg-background-surface-muted px-4 py-2"
109
109
  >
110
110
  <span class="font-mono text-sm text-muted-foreground">
111
111
  {{ headerLabel !== 'text' ? headerLabel : '' }}