@aleph-alpha/ui-library 1.22.0 → 1.23.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 (71) hide show
  1. package/dist/system/index.d.ts +545 -329
  2. package/dist/system/lib.js +18800 -18015
  3. package/package.json +1 -1
  4. package/src/components/UiIconButton/UiIconButton.vue +5 -1
  5. package/src/components/UiIconButton/types.ts +1 -1
  6. package/src/components/core/button/index.ts +6 -4
  7. package/src/components/core/sidebar/SidebarContent.vue +11 -3
  8. package/src/components/core/sidebar/SidebarFooter.vue +10 -2
  9. package/src/components/core/sidebar/SidebarGroup.vue +10 -2
  10. package/src/components/core/sidebar/SidebarGroupLabel.vue +1 -1
  11. package/src/components/core/sidebar/SidebarHeader.vue +10 -2
  12. package/src/components/core/sidebar/SidebarMenu.vue +12 -2
  13. package/src/components/core/sidebar/SidebarMenuButton.vue +2 -2
  14. package/src/components/core/sidebar/SidebarSeparator.vue +10 -2
  15. package/src/components/core/sidebar/SidebarTrigger.vue +2 -2
  16. package/src/components/core/sidebar/index.ts +1 -1
  17. package/src/components/core/sidebar/utils.ts +11 -2
  18. package/src/components/index.ts +0 -1
  19. package/src/directives/index.ts +1 -0
  20. package/src/directives/vOverlay.ts +94 -0
  21. package/src/patterns/UiSidebar/UiSidebar.stories.ts +346 -0
  22. package/src/{components → patterns}/UiSidebar/UiSidebar.vue +9 -3
  23. package/src/patterns/UiSidebar/UiSidebarChatHistory.stories.ts +77 -0
  24. package/src/patterns/UiSidebar/UiSidebarChatHistory.vue +35 -0
  25. package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.stories.ts +85 -0
  26. package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.vue +139 -0
  27. package/src/patterns/UiSidebar/UiSidebarContent.vue +11 -0
  28. package/src/patterns/UiSidebar/UiSidebarFooter.vue +11 -0
  29. package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +91 -0
  30. package/src/patterns/UiSidebar/UiSidebarGroup.vue +42 -0
  31. package/src/patterns/UiSidebar/UiSidebarGroupContent.vue +15 -0
  32. package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +163 -0
  33. package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +131 -0
  34. package/src/patterns/UiSidebar/UiSidebarHeader.vue +48 -0
  35. package/src/patterns/UiSidebar/UiSidebarInset.vue +11 -0
  36. package/src/patterns/UiSidebar/UiSidebarMenu.vue +11 -0
  37. package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +205 -0
  38. package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +121 -0
  39. package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +67 -0
  40. package/src/patterns/UiSidebar/UiSidebarMenuItem.vue +11 -0
  41. package/src/patterns/UiSidebar/UiSidebarMenuSub.vue +38 -0
  42. package/src/patterns/UiSidebar/UiSidebarMenuSubItem.stories.ts +66 -0
  43. package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +67 -0
  44. package/src/patterns/UiSidebar/UiSidebarPopover.vue +43 -0
  45. package/src/patterns/UiSidebar/UiSidebarPopoverMenu.stories.ts +56 -0
  46. package/src/patterns/UiSidebar/UiSidebarPopoverMenu.vue +56 -0
  47. package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.stories.ts +42 -0
  48. package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +79 -0
  49. package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +61 -0
  50. package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +81 -0
  51. package/src/patterns/UiSidebar/UiSidebarProvider.vue +11 -0
  52. package/src/patterns/UiSidebar/UiSidebarRail.vue +9 -0
  53. package/src/patterns/UiSidebar/UiSidebarTrigger.vue +35 -0
  54. package/src/patterns/UiSidebar/groupContext.ts +9 -0
  55. package/src/patterns/UiSidebar/index.ts +42 -0
  56. package/src/patterns/UiSidebar/types.ts +375 -0
  57. package/src/patterns/index.ts +1 -0
  58. package/src/components/UiSidebar/UiSidebar.stories.ts +0 -1188
  59. package/src/components/UiSidebar/UiSidebarGroupAction.vue +0 -18
  60. package/src/components/UiSidebar/UiSidebarGroupLabel.vue +0 -18
  61. package/src/components/UiSidebar/UiSidebarHeaderTrigger.vue +0 -53
  62. package/src/components/UiSidebar/UiSidebarInput.vue +0 -14
  63. package/src/components/UiSidebar/UiSidebarMenuAction.vue +0 -19
  64. package/src/components/UiSidebar/UiSidebarMenuButton.vue +0 -27
  65. package/src/components/UiSidebar/UiSidebarMenuSkeleton.vue +0 -16
  66. package/src/components/UiSidebar/UiSidebarMenuSubButton.vue +0 -24
  67. package/src/components/UiSidebar/UiSidebarProvider.vue +0 -16
  68. package/src/components/UiSidebar/UiSidebarSeparator.vue +0 -13
  69. package/src/components/UiSidebar/__tests__/UiSidebar.test.ts +0 -221
  70. package/src/components/UiSidebar/index.ts +0 -34
  71. package/src/components/UiSidebar/types.ts +0 -165
@@ -0,0 +1,375 @@
1
+ import type { Component } from 'vue';
2
+ import type { PrimitiveProps } from 'reka-ui';
3
+ import type { SidebarProps } from '@/components/core/sidebar';
4
+
5
+ /**
6
+ * Pattern wrapper props for the application sidebar shell.
7
+ * Same API as the underlying core `Sidebar` component.
8
+ *
9
+ * @category Patterns
10
+ * @useCases app navigation, dashboard sidebar, collapsible layout
11
+ * @keywords sidebar, navigation, layout, shell
12
+ */
13
+ export type UiSidebarProps = SidebarProps;
14
+
15
+ /**
16
+ * Pattern wrapper props for sidebar groups.
17
+ */
18
+ export interface UiSidebarGroupProps {
19
+ /**
20
+ * Initial expanded state for the group content.
21
+ * @default true
22
+ */
23
+ defaultOpen?: boolean;
24
+ }
25
+
26
+ /**
27
+ * Group label row inside the sidebar pattern.
28
+ * Supports a title plus optional collapse and action icon buttons.
29
+ *
30
+ * @category Patterns
31
+ * @useCases sidebar section heading, collapsible group label, grouped navigation
32
+ * @keywords sidebar, group, label, collapse, action
33
+ */
34
+ export interface UiSidebarGroupLabelProps {
35
+ /**
36
+ * Typography size for the title.
37
+ * @default 'sm'
38
+ */
39
+ size?: 'sm' | 'xs';
40
+
41
+ /**
42
+ * Icon shown beside the title for the collapse action.
43
+ */
44
+ collapseIcon?: Component;
45
+
46
+ /**
47
+ * Tooltip for the collapse action button.
48
+ */
49
+ collapseTooltip?: string;
50
+
51
+ /**
52
+ * Accessible label for the collapse action button.
53
+ * @default 'Collapse group'
54
+ */
55
+ collapseAriaLabel?: string;
56
+
57
+ /**
58
+ * Icon shown at the far end of the row for the secondary action.
59
+ */
60
+ actionIcon?: Component;
61
+
62
+ /**
63
+ * Tooltip for the secondary action button.
64
+ */
65
+ actionTooltip?: string;
66
+
67
+ /**
68
+ * Accessible label for the secondary action button.
69
+ * @default 'Group action'
70
+ */
71
+ actionAriaLabel?: string;
72
+
73
+ /**
74
+ * Whether to render the secondary action button.
75
+ * @default true
76
+ */
77
+ showAction?: boolean;
78
+
79
+ /**
80
+ * Whether the secondary action button should only appear on hover/focus.
81
+ * @default true
82
+ */
83
+ showActionOnHover?: boolean;
84
+
85
+ /**
86
+ * Whether to render the collapse action button.
87
+ * @default true
88
+ */
89
+ showCollapse?: boolean;
90
+ }
91
+
92
+ /**
93
+ * Emitted events for `UiSidebarGroupLabel`.
94
+ */
95
+ export interface UiSidebarGroupLabelEmits {
96
+ /**
97
+ * Fired when the collapse action is clicked.
98
+ */
99
+ 'collapse-click': [event: MouseEvent];
100
+
101
+ /**
102
+ * Fired when the secondary action is clicked.
103
+ */
104
+ 'action-click': [event: MouseEvent];
105
+ }
106
+
107
+ /**
108
+ * Pattern wrapper props for the sidebar header.
109
+ */
110
+ export interface UiSidebarHeaderProps {
111
+ /**
112
+ * Tooltip text displayed for the trigger.
113
+ */
114
+ tooltip?: string;
115
+
116
+ /**
117
+ * Accessible label for the trigger.
118
+ * @default 'Toggle sidebar'
119
+ */
120
+ ariaLabel?: string;
121
+ }
122
+
123
+ /**
124
+ * Pattern wrapper props for the sidebar toggle trigger.
125
+ */
126
+ export interface UiSidebarTriggerProps {
127
+ /**
128
+ * Tooltip text displayed for the trigger.
129
+ */
130
+ tooltip?: string;
131
+
132
+ /**
133
+ * Accessible label for the trigger.
134
+ * @default 'Toggle sidebar'
135
+ */
136
+ ariaLabel?: string;
137
+ }
138
+
139
+ /**
140
+ * Pattern wrapper props for sidebar navigation buttons.
141
+ */
142
+ export interface UiSidebarMenuButtonProps {
143
+ /**
144
+ * Optional tooltip shown in collapsed mode.
145
+ */
146
+ tooltip?: string | Component;
147
+
148
+ /**
149
+ * Visual variant of the menu button.
150
+ * @default 'default'
151
+ */
152
+ variant?: 'default' | 'outline';
153
+
154
+ /**
155
+ * Size variant of the menu button.
156
+ * @default 'default'
157
+ */
158
+ size?: 'default' | 'sm' | 'lg';
159
+
160
+ /**
161
+ * Marks the button as active.
162
+ * @default false
163
+ */
164
+ isActive?: boolean;
165
+
166
+ /**
167
+ * Renders the end icon as a separate clickable action.
168
+ * @default false
169
+ */
170
+ endIconClickable?: boolean;
171
+
172
+ /**
173
+ * Accessible label for the end icon action button.
174
+ * @default 'Menu action'
175
+ */
176
+ endIconAriaLabel?: string;
177
+ }
178
+
179
+ /**
180
+ * Emitted events for `UiSidebarMenuButton`.
181
+ */
182
+ export interface UiSidebarMenuButtonEmits {
183
+ /**
184
+ * Fired when the end icon action is clicked.
185
+ */
186
+ 'end-icon-click': [event: MouseEvent];
187
+ }
188
+
189
+ /**
190
+ * Pattern wrapper props for sidebar sub-menu containers.
191
+ */
192
+ export interface UiSidebarMenuSubProps {
193
+ /**
194
+ * Visual presentation of the sub-menu group.
195
+ * @default 'default'
196
+ */
197
+ mode?: 'default' | 'border' | 'indent';
198
+ }
199
+
200
+ /**
201
+ * Pattern wrapper props for sidebar sub-menu rows.
202
+ */
203
+ export interface UiSidebarMenuSubItemProps extends PrimitiveProps {
204
+ /**
205
+ * Marks the sub-item as active.
206
+ * @default false
207
+ */
208
+ isActive?: boolean;
209
+ }
210
+
211
+ /**
212
+ * Pattern wrapper props for sidebar chat history lists.
213
+ */
214
+ export interface UiSidebarChatHistoryProps {
215
+ /**
216
+ * Space between history items.
217
+ * @default true
218
+ */
219
+ withGap?: boolean;
220
+ }
221
+
222
+ /**
223
+ * Pattern wrapper props for sidebar chat history rows.
224
+ */
225
+ export interface UiSidebarChatHistoryItemProps extends PrimitiveProps {
226
+ /**
227
+ * Main title of the history item.
228
+ */
229
+ title: string;
230
+
231
+ /**
232
+ * First metadata label shown under the title.
233
+ */
234
+ metaStart?: string;
235
+
236
+ /**
237
+ * Second metadata label shown under the title.
238
+ */
239
+ metaEnd?: string;
240
+
241
+ /**
242
+ * Marks the item as active.
243
+ * @default false
244
+ */
245
+ isActive?: boolean;
246
+
247
+ /**
248
+ * Whether to render the end action button.
249
+ * @default true
250
+ */
251
+ showAction?: boolean;
252
+
253
+ /**
254
+ * Whether the end action should only appear on hover/focus.
255
+ * @default true
256
+ */
257
+ showActionOnHover?: boolean;
258
+
259
+ /**
260
+ * Tooltip for the end action button.
261
+ */
262
+ actionTooltip?: string;
263
+
264
+ /**
265
+ * Accessible label for the end action button.
266
+ * @default 'History item action'
267
+ */
268
+ actionAriaLabel?: string;
269
+
270
+ /**
271
+ * Custom action icon rendered at the end of the row.
272
+ */
273
+ actionIcon?: Component;
274
+ }
275
+
276
+ /**
277
+ * Emitted events for `UiSidebarChatHistoryItem`.
278
+ */
279
+ export interface UiSidebarChatHistoryItemEmits {
280
+ /**
281
+ * Fired when the end action button is clicked.
282
+ */
283
+ 'action-click': [event: MouseEvent];
284
+ }
285
+
286
+ /**
287
+ * Pattern wrapper props for sidebar popover triggers.
288
+ */
289
+ export interface UiSidebarPopoverTriggerProps {
290
+ /**
291
+ * Trigger label shown inside the sidebar button.
292
+ */
293
+ label: string;
294
+
295
+ /**
296
+ * Optional tooltip shown for the trigger.
297
+ */
298
+ tooltip?: string;
299
+
300
+ /**
301
+ * Marks the trigger as active.
302
+ * @default false
303
+ */
304
+ isActive?: boolean;
305
+ }
306
+
307
+ /**
308
+ * Pattern wrapper props for sidebar popovers.
309
+ */
310
+ export interface UiSidebarPopoverProps {
311
+ /**
312
+ * Trigger label shown inside the sidebar button.
313
+ */
314
+ label: string;
315
+
316
+ /**
317
+ * Optional tooltip shown for the trigger.
318
+ */
319
+ tooltip?: string;
320
+
321
+ /**
322
+ * Popover side relative to the trigger.
323
+ * @default 'bottom'
324
+ */
325
+ side?: 'top' | 'right' | 'bottom' | 'left';
326
+
327
+ /**
328
+ * Popover alignment relative to the trigger.
329
+ * @default 'start'
330
+ */
331
+ align?: 'start' | 'center' | 'end';
332
+
333
+ /**
334
+ * Offset between trigger and content.
335
+ * @default 8
336
+ */
337
+ sideOffset?: number;
338
+ }
339
+
340
+ /**
341
+ * Pattern wrapper props for sidebar popover menus.
342
+ */
343
+ export interface UiSidebarPopoverMenuProps {
344
+ /**
345
+ * Optional section label displayed above the menu items.
346
+ */
347
+ label?: string;
348
+
349
+ /**
350
+ * Whether to render a separator above the footer slot.
351
+ * @default true
352
+ */
353
+ showFooterSeparator?: boolean;
354
+ }
355
+
356
+ /**
357
+ * Pattern wrapper props for sidebar popover menu items.
358
+ */
359
+ export interface UiSidebarPopoverMenuItemProps extends PrimitiveProps {
360
+ /**
361
+ * Main label of the menu item.
362
+ */
363
+ label: string;
364
+
365
+ /**
366
+ * Optional keyboard shortcut or hint shown at the end.
367
+ */
368
+ shortcut?: string;
369
+
370
+ /**
371
+ * Marks the menu item as active.
372
+ * @default false
373
+ */
374
+ isActive?: boolean;
375
+ }
@@ -6,3 +6,4 @@ export * from './UiDataTable';
6
6
  export * from './UiDatePicker';
7
7
  export * from './UiFileUpload';
8
8
  export * from './UiPlaceholder';
9
+ export * from './UiSidebar';