@aleph-alpha/ui-library 2.0.0 → 2.2.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.
- package/config.d.ts +0 -19
- package/config.js +65 -81
- package/dist/system/components/UiSnackbar/UiSnackbar.vue.d.ts +5 -0
- package/dist/system/components/UiSnackbar/index.d.ts +3 -0
- package/dist/system/components/UiSnackbar/types.d.ts +96 -0
- package/dist/system/components/core/sonner/Sonner.vue.d.ts +3 -0
- package/dist/system/components/core/sonner/index.d.ts +1 -0
- package/dist/system/components/index.d.ts +1 -1
- package/dist/system/index.d.ts +3 -4
- package/dist/system/lib.js +20658 -19240
- package/dist/system/patterns/UiSidebar/UiSidebarGroupLabel.vue.d.ts +6 -6
- package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -2
- package/dist/system/patterns/UiSidebar/index.d.ts +1 -3
- package/dist/system/patterns/UiSidebar/types.d.ts +1 -95
- package/docs/public-docs/foundations.md +48 -38
- package/hover-mix.d.ts +8 -11
- package/hover-mix.js +7 -15
- package/package.json +6 -4
- package/src/components/UiAccordion/UiAccordion.stories.ts +2 -2
- package/src/components/UiAlert/UiAlert.stories.ts +4 -4
- package/src/components/UiAvatar/UiAvatar.stories.ts +2 -2
- package/src/components/UiButton/UiButton.stories.ts +1 -1
- package/src/components/UiCalendar/UiCalendar.stories.ts +1 -24
- package/src/components/UiCalendar/UiCalendar.vue +16 -0
- package/src/components/UiCard/UiCard.stories.ts +4 -4
- package/src/components/UiChip/UiChip.vue +1 -1
- package/src/components/UiDrawer/UiDrawer.stories.ts +6 -6
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +4 -4
- package/src/components/UiDropdownMenu/__tests__/UiDropdownMenu.test.ts +70 -3
- package/src/components/UiEmpty/UiEmpty.stories.ts +1 -0
- package/src/components/UiFileItem/UiFileItem.vue +1 -1
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +4 -1
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +2 -2
- package/src/components/UiIcon/UiIcon.stories.ts +90 -18
- package/src/components/UiInput/UiInput.stories.ts +2 -2
- package/src/components/UiKbd/UiKbd.stories.ts +10 -10
- package/src/components/UiLabel/UiLabel.stories.ts +2 -2
- package/src/components/UiListbox/UiListbox.stories.ts +14 -14
- package/src/components/UiListbox/UiListbox.vue +16 -0
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +24 -13
- package/src/components/UiPopover/UiPopover.stories.ts +6 -6
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +22 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.stories.ts +11 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.vue +16 -0
- package/src/components/UiSelect/UiSelectItem.vue +1 -1
- package/src/components/UiSeparator/UiSeparator.stories.ts +8 -8
- package/src/components/UiSheet/UiSheet.stories.ts +12 -12
- package/src/components/UiSkeleton/UiSkeleton.stories.ts +20 -20
- package/src/components/UiSlider/UiSlider.stories.ts +6 -6
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +508 -0
- package/src/components/UiSnackbar/UiSnackbar.vue +286 -0
- package/src/components/UiSnackbar/__tests__/UiSnackbar.test.ts +17 -0
- package/src/components/UiSnackbar/index.ts +4 -0
- package/src/components/UiSnackbar/types.ts +97 -0
- package/src/components/UiSwitch/UiSwitch.stories.ts +4 -4
- package/src/components/UiSwitch/__tests__/UiSwitch.test.ts +9 -2
- package/src/components/UiTable/__tests__/UiTableRow.test.ts +10 -0
- package/src/components/UiTabs/UiTabs.stories.ts +2 -2
- package/src/components/UiTabs/__tests__/UiTabs.test.ts +25 -0
- package/src/components/UiTagsInput/UiTagsInput.stories.ts +2 -0
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +9 -0
- package/src/components/UiToggleGroup/__tests__/UiToggleGroup.test.ts +18 -0
- package/src/components/UiTooltip/UiTooltip.stories.ts +7 -7
- package/src/components/core/alert/index.ts +3 -2
- package/src/components/core/button/index.ts +5 -6
- package/src/components/core/calendar/CalendarGrid.vue +1 -1
- package/src/components/core/card/Card.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +14 -13
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +23 -13
- package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/popover/PopoverContent.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarGrid.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/sidebar/SidebarGroupAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
- package/src/components/core/sidebar/SidebarTrigger.vue +4 -4
- package/src/components/core/sidebar/index.ts +4 -3
- package/src/components/core/sonner/Sonner.vue +43 -0
- package/src/components/core/sonner/index.ts +1 -0
- package/src/components/core/switch/Switch.vue +2 -2
- package/src/components/core/table/TableRow.vue +1 -1
- package/src/components/core/tabs/TabsList.vue +1 -1
- package/src/components/core/tabs/TabsTrigger.vue +1 -1
- package/src/components/core/toggle/index.ts +1 -1
- package/src/components/core/toggle-group/index.ts +1 -1
- package/src/components/index.ts +1 -1
- package/src/directives/vHover.stories.ts +1 -1
- package/src/index.ts +3 -0
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +15 -15
- package/src/patterns/UiDataTable/UiDataTableColumnHeader.vue +1 -1
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +3 -3
- package/src/patterns/UiDataTable/UiDataTableToolbar.vue +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +14 -0
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +4 -4
- package/src/patterns/UiDatePicker/UiDatePicker.vue +2 -0
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +27 -258
- package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +15 -10
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +20 -7
- package/src/patterns/UiSidebar/UiSidebarHeader.vue +0 -1
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +29 -40
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +9 -6
- package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +11 -13
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +8 -5
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.stories.ts +6 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +9 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +3 -3
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +11 -12
- package/src/patterns/UiSidebar/UiSidebarTrigger.vue +1 -1
- package/src/patterns/UiSidebar/activeIndicator.ts +1 -2
- package/src/patterns/UiSidebar/index.ts +0 -5
- package/src/patterns/UiSidebar/types.ts +1 -111
- package/src/theme/Background.stories.ts +5 -5
- package/src/theme/Border.stories.ts +3 -3
- package/src/theme/Extended.stories.ts +6 -6
- package/src/theme/Flex.stories.ts +10 -10
- package/src/theme/Grid.stories.ts +10 -10
- package/src/theme/HoverLayer.stories.ts +215 -0
- package/src/theme/Overlay.stories.ts +2 -2
- package/src/theme/Shadow.stories.ts +1 -1
- package/src/theme/Theme.stories.ts +4 -4
- package/src/theme/Typography.stories.ts +21 -21
- package/tokens.json +4835 -1369
- package/dist/system/components/UiIconButton/UiIconButton.vue.d.ts +0 -25
- package/dist/system/components/UiIconButton/index.d.ts +0 -7
- package/dist/system/components/UiIconButton/types.d.ts +0 -67
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistory.vue.d.ts +0 -20
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistoryItem.vue.d.ts +0 -34
- package/src/components/UiIconButton/UiIconButton.stories.ts +0 -470
- package/src/components/UiIconButton/UiIconButton.vue +0 -76
- package/src/components/UiIconButton/__tests__/UiIconButton.test.ts +0 -105
- package/src/components/UiIconButton/index.ts +0 -13
- package/src/components/UiIconButton/types.ts +0 -87
- package/src/patterns/UiSidebar/UiSidebarChatHistory.stories.ts +0 -104
- package/src/patterns/UiSidebar/UiSidebarChatHistory.vue +0 -43
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.stories.ts +0 -204
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.vue +0 -269
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistory.test.ts +0 -35
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistoryItem.test.ts +0 -49
- package/src/theme/BackgroundHover.stories.ts +0 -182
- package/src/theme/ContentHover.stories.ts +0 -171
|
@@ -9,19 +9,19 @@ declare function __VLS_template(): {
|
|
|
9
9
|
};
|
|
10
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
11
|
declare const __VLS_component: import('vue').DefineComponent<UiSidebarGroupLabelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
-
"action-click": (event: MouseEvent) => any;
|
|
13
12
|
"collapse-click": (event: MouseEvent) => any;
|
|
13
|
+
"action-click": (event: MouseEvent) => any;
|
|
14
14
|
}, string, import('vue').PublicProps, Readonly<UiSidebarGroupLabelProps> & Readonly<{
|
|
15
|
-
"onAction-click"?: ((event: MouseEvent) => any) | undefined;
|
|
16
15
|
"onCollapse-click"?: ((event: MouseEvent) => any) | undefined;
|
|
16
|
+
"onAction-click"?: ((event: MouseEvent) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
18
|
size: "sm" | "xs";
|
|
19
|
-
showAction: boolean;
|
|
20
|
-
showActionOnHover: boolean;
|
|
21
|
-
actionTooltip: string;
|
|
22
|
-
actionAriaLabel: string;
|
|
23
19
|
collapseTooltip: string;
|
|
24
20
|
collapseAriaLabel: string;
|
|
21
|
+
actionTooltip: string;
|
|
22
|
+
actionAriaLabel: string;
|
|
23
|
+
showAction: boolean;
|
|
24
|
+
showActionOnHover: boolean;
|
|
25
25
|
showCollapse: boolean;
|
|
26
26
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared class string for the left-edge active indicator used by every
|
|
3
|
-
* sidebar row (menu button, sub-menu item, popover trigger,
|
|
4
|
-
* item, popover menu item).
|
|
3
|
+
* sidebar row (menu button, sub-menu item, popover trigger, popover menu item).
|
|
5
4
|
*
|
|
6
5
|
* The `::before` pseudo-element is always mounted so CSS has something to
|
|
7
6
|
* transition. At rest it's painted from `scale-x-0` + `opacity-0` with its
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { default as UiSidebar } from './UiSidebar.vue';
|
|
2
2
|
export { default as UiSidebarContent } from './UiSidebarContent.vue';
|
|
3
|
-
export { default as UiSidebarChatHistory } from './UiSidebarChatHistory.vue';
|
|
4
|
-
export { default as UiSidebarChatHistoryItem } from './UiSidebarChatHistoryItem.vue';
|
|
5
3
|
export { default as UiSidebarFooter } from './UiSidebarFooter.vue';
|
|
6
4
|
export { default as UiSidebarGroup } from './UiSidebarGroup.vue';
|
|
7
5
|
export { default as UiSidebarGroupContent } from './UiSidebarGroupContent.vue';
|
|
@@ -21,4 +19,4 @@ export { default as UiSidebarSub } from './UiSidebarSub.vue';
|
|
|
21
19
|
export { default as UiSidebarProvider } from './UiSidebarProvider.vue';
|
|
22
20
|
export { default as UiSidebarRail } from './UiSidebarRail.vue';
|
|
23
21
|
export { default as UiSidebarTrigger } from './UiSidebarTrigger.vue';
|
|
24
|
-
export type {
|
|
22
|
+
export type { UiSidebarContentProps, UiSidebarFooterProps, UiSidebarGroupContentProps, UiSidebarGroupLabelEmits, UiSidebarGroupLabelProps, UiSidebarGroupProps, UiSidebarHeaderProps, UiSidebarInsetProps, UiSidebarMenuButtonEmits, UiSidebarMenuButtonProps, UiSidebarMenuItemProps, UiSidebarMenuProps, UiSidebarMenuSubItemProps, UiSidebarMenuSubProps, UiSidebarSubProps, UiSidebarPopoverMenuItemEmits, UiSidebarPopoverMenuItemProps, UiSidebarPopoverMenuProps, UiSidebarPopoverProps, UiSidebarPopoverTriggerProps, UiSidebarProviderProps, UiSidebarProps, UiSidebarRailProps, UiSidebarTriggerProps, } from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component
|
|
1
|
+
import { Component } from 'vue';
|
|
2
2
|
import { PrimitiveProps } from 'reka-ui';
|
|
3
3
|
import { SidebarProps } from '../../components/core/sidebar';
|
|
4
4
|
/**
|
|
@@ -192,100 +192,6 @@ export interface UiSidebarMenuSubItemProps extends PrimitiveProps {
|
|
|
192
192
|
*/
|
|
193
193
|
isActive?: boolean;
|
|
194
194
|
}
|
|
195
|
-
/**
|
|
196
|
-
* Pattern wrapper props for sidebar chat history lists.
|
|
197
|
-
* @deprecated Use `CkHistoryWrapperProps` from `@aleph-alpha/chat-kit` instead.
|
|
198
|
-
*/
|
|
199
|
-
export interface UiSidebarChatHistoryProps {
|
|
200
|
-
/**
|
|
201
|
-
* Space between history items.
|
|
202
|
-
* @default true
|
|
203
|
-
*/
|
|
204
|
-
withGap?: boolean;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Pattern wrapper props for sidebar chat history rows.
|
|
208
|
-
* @deprecated Use `CkHistoryItemProps` from `@aleph-alpha/chat-kit` instead.
|
|
209
|
-
*/
|
|
210
|
-
export interface UiSidebarChatHistoryItemProps extends PrimitiveProps {
|
|
211
|
-
/**
|
|
212
|
-
* Main title of the history item.
|
|
213
|
-
*/
|
|
214
|
-
title: string;
|
|
215
|
-
/**
|
|
216
|
-
* First metadata label shown under the title.
|
|
217
|
-
*/
|
|
218
|
-
metaStart?: string;
|
|
219
|
-
/**
|
|
220
|
-
* Second metadata label shown under the title.
|
|
221
|
-
*/
|
|
222
|
-
metaEnd?: string;
|
|
223
|
-
/**
|
|
224
|
-
* Marks the item as active.
|
|
225
|
-
* @default false
|
|
226
|
-
*/
|
|
227
|
-
isActive?: boolean;
|
|
228
|
-
/**
|
|
229
|
-
* Whether to render the end action button.
|
|
230
|
-
* @default true
|
|
231
|
-
*/
|
|
232
|
-
showAction?: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* Whether the end action should only appear on hover/focus.
|
|
235
|
-
* @default true
|
|
236
|
-
*/
|
|
237
|
-
showActionOnHover?: boolean;
|
|
238
|
-
/**
|
|
239
|
-
* Tooltip for the end action button.
|
|
240
|
-
*/
|
|
241
|
-
actionTooltip?: string;
|
|
242
|
-
/**
|
|
243
|
-
* Accessible label for the end action button.
|
|
244
|
-
* @default 'History item action'
|
|
245
|
-
*/
|
|
246
|
-
actionAriaLabel?: string;
|
|
247
|
-
/**
|
|
248
|
-
* Custom action icon rendered at the end of the row.
|
|
249
|
-
*/
|
|
250
|
-
actionIcon?: Component;
|
|
251
|
-
/**
|
|
252
|
-
* When true, the action control opens a popover (use `#action-popover` slot for body).
|
|
253
|
-
* Tooltip on the action is not used in this mode; set `actionAriaLabel` for accessibility.
|
|
254
|
-
* @default false
|
|
255
|
-
*/
|
|
256
|
-
actionPopover?: boolean;
|
|
257
|
-
/**
|
|
258
|
-
* Popover side relative to the action trigger.
|
|
259
|
-
* @default 'right'
|
|
260
|
-
*/
|
|
261
|
-
actionPopoverSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
262
|
-
/**
|
|
263
|
-
* Popover alignment relative to the trigger.
|
|
264
|
-
* @default 'start'
|
|
265
|
-
*/
|
|
266
|
-
actionPopoverAlign?: 'start' | 'center' | 'end';
|
|
267
|
-
/**
|
|
268
|
-
* Offset between trigger and popover content.
|
|
269
|
-
* @default 8
|
|
270
|
-
*/
|
|
271
|
-
actionPopoverSideOffset?: number;
|
|
272
|
-
/**
|
|
273
|
-
* Extra classes for the popover panel (merged with pattern defaults).
|
|
274
|
-
*/
|
|
275
|
-
actionPopoverContentClass?: HTMLAttributes['class'];
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Emitted events for `UiSidebarChatHistoryItem`.
|
|
279
|
-
* @deprecated Use `CkHistoryItemEmits` from `@aleph-alpha/chat-kit` instead.
|
|
280
|
-
*/
|
|
281
|
-
export interface UiSidebarChatHistoryItemEmits {
|
|
282
|
-
/**
|
|
283
|
-
* Fired when the end action button is clicked.
|
|
284
|
-
* Not emitted when `actionPopover` is `true` — in that mode the click opens
|
|
285
|
-
* the popover and consumers react to interactions inside the `#action-popover` slot.
|
|
286
|
-
*/
|
|
287
|
-
'action-click': [event: MouseEvent];
|
|
288
|
-
}
|
|
289
195
|
/**
|
|
290
196
|
* Pattern wrapper props for sidebar popover triggers.
|
|
291
197
|
*/
|
|
@@ -11,13 +11,23 @@ The foundations are the design tokens and CSS utilities that every component is
|
|
|
11
11
|
|
|
12
12
|
Color is delivered through semantic tokens (no raw hex values in app code). Tokens are grouped by purpose — `surface`, `accent`, `status`, `button`, `input` — and each has a paired `content.on-*` token for accessible foreground contrast.
|
|
13
13
|
|
|
14
|
-
| Group
|
|
15
|
-
|
|
16
|
-
| Background tokens (surface, button, input, accent, status) | [CSS utility / Background](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-background--docs)
|
|
17
|
-
|
|
|
18
|
-
| Foreground / text content tokens
|
|
19
|
-
|
|
|
20
|
-
|
|
14
|
+
| Group | Storybook |
|
|
15
|
+
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
16
|
+
| Background tokens (surface, button, input, accent, status) | [CSS utility / Background](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-background--docs) |
|
|
17
|
+
| Hover layer utilities | [CSS utility / Hover Layer](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-hover-layer--docs) |
|
|
18
|
+
| Foreground / text content tokens | [CSS utility / Content](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-content--docs) |
|
|
19
|
+
| Border tokens | [CSS utility / Border](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-border--docs) |
|
|
20
|
+
|
|
21
|
+
### Hover States
|
|
22
|
+
|
|
23
|
+
Use the hover treatment that matches the component's base fill:
|
|
24
|
+
|
|
25
|
+
| Component background | Hover classes |
|
|
26
|
+
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| No existing background color | `hover:bg-background-surface-muted-subtle` |
|
|
28
|
+
| Existing background color inherited by component | `hover-layer hover-layer-subtle`, `hover-layer hover-layer-default`, or `hover-layer hover-layer-strong` |
|
|
29
|
+
|
|
30
|
+
For existing backgrounds, the component keeps its base fill and the hover layer adds the second fill via `overlay-hover-*`. The design team defines the hover strength per component based on the underlying base color, so check the component's existing `hover-layer-*` strength before changing it.
|
|
21
31
|
|
|
22
32
|
**Dark mode** is driven by the `html.dark` class. Both `presetShadcn` and `presetUiLibraryThemeFromTokens` default to `darkSelector: 'html.dark'`, so all tokens flip automatically when the class is toggled:
|
|
23
33
|
|
|
@@ -33,10 +43,10 @@ See [Quick Start → Dark mode](quick-start.md#dark-mode) for the full setup.
|
|
|
33
43
|
|
|
34
44
|
Spacing follows the standard UnoCSS / Tailwind scale (`p-1`, `gap-4`, `mx-auto`, etc.) provided by `presetWind4`. Layout primitives are documented in dedicated CSS utility pages:
|
|
35
45
|
|
|
36
|
-
| Topic
|
|
37
|
-
|
|
38
|
-
| Grid columns, gaps, and template helpers
|
|
39
|
-
| Flex direction, alignment, and gap utilities
|
|
46
|
+
| Topic | Storybook |
|
|
47
|
+
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
48
|
+
| Grid columns, gaps, and template helpers | [CSS utility / Grid](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-grid--docs) |
|
|
49
|
+
| Flex direction, alignment, and gap utilities | [CSS utility / Flex](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-flex--docs) |
|
|
40
50
|
| Extended utilities (size, position, z-index, etc.) | [CSS utility / Extended](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-extended--docs) |
|
|
41
51
|
|
|
42
52
|
---
|
|
@@ -45,12 +55,12 @@ Spacing follows the standard UnoCSS / Tailwind scale (`p-1`, `gap-4`, `mx-auto`,
|
|
|
45
55
|
|
|
46
56
|
Typography is delivered as a fixed set of utility classes generated from `tokens.json` and registered by `presetUiLibraryThemeFromTokens()`. Use the class — never inline `font-size` / `line-height` — so styles stay consistent and themeable.
|
|
47
57
|
|
|
48
|
-
| Family
|
|
49
|
-
|
|
50
|
-
| Headings
|
|
51
|
-
| Body
|
|
52
|
-
| Labels
|
|
53
|
-
| Code / mono | `code-*`
|
|
58
|
+
| Family | Classes | Storybook |
|
|
59
|
+
| ----------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| Headings | `heading-2xl`, `heading-xl`, `heading-l`, `heading-m`, `heading-s`, `heading-xs` | [CSS utility / Typography](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-typography--docs) |
|
|
61
|
+
| Body | `body-16-{regular,medium,bold}`, `body-14-{regular,medium,bold}` | same page |
|
|
62
|
+
| Labels | `label-12-*`, `label-14-*`, `label-16-*` (each weight also exposes a `*-normal` alias) | same page |
|
|
63
|
+
| Code / mono | `code-*` | same page |
|
|
54
64
|
|
|
55
65
|
Example:
|
|
56
66
|
|
|
@@ -65,21 +75,21 @@ Example:
|
|
|
65
75
|
|
|
66
76
|
Surfaces and shadows together encode the elevation hierarchy. Use the surface token that matches the layer, and add a shadow only at floating / modal level.
|
|
67
77
|
|
|
68
|
-
| Layer
|
|
69
|
-
|
|
70
|
-
| Base app backdrop
|
|
71
|
-
| Sheet above base
|
|
72
|
-
| Sunken / highlighted inner container
|
|
73
|
-
| Floating overlay (popover, dropdown, menu) | `bg-background-surface-floating`
|
|
74
|
-
| Modal / dialog container
|
|
75
|
-
| Modal backdrop / scrim
|
|
76
|
-
| Form inputs
|
|
77
|
-
|
|
78
|
-
| Topic
|
|
79
|
-
|
|
78
|
+
| Layer | Token | Notes |
|
|
79
|
+
| ------------------------------------------ | ---------------------------------- | ------------------------------------ |
|
|
80
|
+
| Base app backdrop | `bg-background-surface-primary` | Sidebar lives on this layer. |
|
|
81
|
+
| Sheet above base | `bg-background-surface-secondary` | Use `shadow-lg`, no border. |
|
|
82
|
+
| Sunken / highlighted inner container | `bg-background-surface-muted` | Subtle non-floating differentiation. |
|
|
83
|
+
| Floating overlay (popover, dropdown, menu) | `bg-background-surface-floating` | `border-default` + `shadow-xs`. |
|
|
84
|
+
| Modal / dialog container | `bg-background-surface-modal` | `border-default` + `shadow-lg`. |
|
|
85
|
+
| Modal backdrop / scrim | `bg-overlay-surface-modal-overlay` | Used by `<UiDialog>` overlay. |
|
|
86
|
+
| Form inputs | `bg-background-input-default` | Text, textarea, file, OTP. |
|
|
87
|
+
|
|
88
|
+
| Topic | Storybook |
|
|
89
|
+
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
80
90
|
| All surface, overlay, and modal backgrounds | [CSS utility / Background — Surface](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-background--surface) |
|
|
81
|
-
| Drop shadows (`shadow-xs` … `shadow-xl`)
|
|
82
|
-
| Overlay scrims
|
|
91
|
+
| Drop shadows (`shadow-xs` … `shadow-xl`) | [CSS utility / Shadow](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-shadow--docs) |
|
|
92
|
+
| Overlay scrims | [CSS utility / Overlay](https://dev.aleph-alpha.de/ui-library/?path=/docs/css-utility-overlay--docs) |
|
|
83
93
|
|
|
84
94
|
---
|
|
85
95
|
|
|
@@ -89,7 +99,7 @@ Icons are rendered with `<UiIcon>`, which wraps the [Lucide](https://lucide.dev/
|
|
|
89
99
|
|
|
90
100
|
```vue
|
|
91
101
|
<script setup lang="ts">
|
|
92
|
-
import { UiIcon } from '@aleph-alpha/ui-library';
|
|
102
|
+
import { UiIcon } from '@aleph-alpha/ui-library';
|
|
93
103
|
</script>
|
|
94
104
|
|
|
95
105
|
<template>
|
|
@@ -97,12 +107,12 @@ import { UiIcon } from '@aleph-alpha/ui-library';
|
|
|
97
107
|
</template>
|
|
98
108
|
```
|
|
99
109
|
|
|
100
|
-
| Prop
|
|
101
|
-
|
|
102
|
-
| `name`
|
|
103
|
-
| `size`
|
|
104
|
-
| `strokeWidth` | Stroke width. Defaults to `2`.
|
|
105
|
-
| `ariaLabel`
|
|
110
|
+
| Prop | Description |
|
|
111
|
+
| ------------- | -------------------------------------------------------------------- |
|
|
112
|
+
| `name` | Lucide icon name in kebab-case (e.g. `circle-help`, `chevron-down`). |
|
|
113
|
+
| `size` | Pixel size. Defaults to `24`. |
|
|
114
|
+
| `strokeWidth` | Stroke width. Defaults to `2`. |
|
|
115
|
+
| `ariaLabel` | Accessible label. Omit for purely decorative icons. |
|
|
106
116
|
|
|
107
117
|
Resources:
|
|
108
118
|
|
package/hover-mix.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hover
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `text-content-on-surface-primary-hover-default`).
|
|
2
|
+
* @deprecated Hover colors are no longer precomputed. Background hover uses
|
|
3
|
+
* `hover-layer hover-layer-{subtle|default|strong}` pseudo-element utilities.
|
|
4
|
+
* This module is kept only for compatibility with older tooling.
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
7
|
/** One of the three hover overlay tiers used across the library. */
|
|
9
8
|
export type HoverVariant = 'subtle' | 'default' | 'strong';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
* Read-only ordered list of the three hover tiers.
|
|
13
|
-
* matches the order of the generated utility classes in the safelist.
|
|
11
|
+
* Read-only ordered list of the three hover tiers.
|
|
14
12
|
*/
|
|
15
13
|
export declare const HOVER_VARIANTS: readonly HoverVariant[];
|
|
16
14
|
|
|
@@ -26,7 +24,7 @@ export declare const HOVER_MIX_TOKEN_PREFIXES: readonly [
|
|
|
26
24
|
/** @deprecated Use {@link HOVER_MIX_TOKEN_PREFIXES}. */
|
|
27
25
|
export declare const HOVER_MIX_TOKEN_PREFIX: 'background.';
|
|
28
26
|
|
|
29
|
-
/** Suffix used in generated CSS variable
|
|
27
|
+
/** @deprecated Suffix previously used in generated CSS variable names. */
|
|
30
28
|
export declare const HOVER_MIX_CLASS_SUFFIX: 'hover';
|
|
31
29
|
|
|
32
30
|
/** Channels use 0–255; alpha uses 0–1. */
|
|
@@ -83,10 +81,9 @@ export interface BuildHoverMixVarsInput {
|
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
/**
|
|
86
|
-
* Build a map of CSS variable name → hex color for every
|
|
87
|
-
* `baseColors[name] × overlays[variant]` combination.
|
|
88
|
-
*
|
|
89
|
-
* `content-on-surface-primary-hover-default`.
|
|
84
|
+
* @deprecated Build a map of CSS variable name → hex color for every
|
|
85
|
+
* `baseColors[name] × overlays[variant]` combination. The current UI library
|
|
86
|
+
* hover classes no longer consume these generated variables.
|
|
90
87
|
*/
|
|
91
88
|
export declare const buildHoverMixVars: (
|
|
92
89
|
input: BuildHoverMixVarsInput,
|
package/hover-mix.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hover
|
|
3
|
-
* `
|
|
4
|
-
*
|
|
5
|
-
* `mix-blend-mode: overlay`.
|
|
2
|
+
* @deprecated Hover colors are no longer precomputed. Background hover uses
|
|
3
|
+
* `hover-layer hover-layer-{subtle|default|strong}` pseudo-element utilities.
|
|
4
|
+
* This module is kept only for compatibility with older tooling.
|
|
6
5
|
*
|
|
7
6
|
* Two-step compositing (both in sRGB, channels normalized to 0–1):
|
|
8
7
|
*
|
|
@@ -21,17 +20,13 @@
|
|
|
21
20
|
*/
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
|
-
* Ordered list of hover overlay tiers used throughout the library.
|
|
25
|
-
* maps to one `overlay.hover.<variant>` token and drives the generated
|
|
26
|
-
* `-hover-<variant>` utility classes (e.g. `bg-…-hover-subtle`).
|
|
23
|
+
* Ordered list of hover overlay tiers used throughout the library.
|
|
27
24
|
*/
|
|
28
25
|
export const HOVER_VARIANTS = Object.freeze(['subtle', 'default', 'strong']);
|
|
29
26
|
|
|
30
27
|
/**
|
|
31
|
-
* Prefixes (under the dot-path token tree)
|
|
32
|
-
*
|
|
33
|
-
* tints; `content.*` tokens produce text-color hover variants used in place of
|
|
34
|
-
* the `v-hover` directive.
|
|
28
|
+
* @deprecated Prefixes (under the dot-path token tree) previously expanded into
|
|
29
|
+
* precomputed hover colors.
|
|
35
30
|
*/
|
|
36
31
|
export const HOVER_MIX_TOKEN_PREFIXES = Object.freeze([
|
|
37
32
|
'background.',
|
|
@@ -44,10 +39,7 @@ export const HOVER_MIX_TOKEN_PREFIXES = Object.freeze([
|
|
|
44
39
|
*/
|
|
45
40
|
export const HOVER_MIX_TOKEN_PREFIX = HOVER_MIX_TOKEN_PREFIXES[0];
|
|
46
41
|
|
|
47
|
-
/**
|
|
48
|
-
* Suffix used for generated CSS variable and utility-class names.
|
|
49
|
-
* e.g. `background-surface-primary` → `background-surface-primary-hover-subtle`.
|
|
50
|
-
*/
|
|
42
|
+
/** @deprecated Suffix previously used in generated CSS variable names. */
|
|
51
43
|
export const HOVER_MIX_CLASS_SUFFIX = 'hover';
|
|
52
44
|
|
|
53
45
|
/** Clamp a number to the 0–255 integer range. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/ui-library",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/system/lib.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"vue-tsc": "^2.2.12",
|
|
77
77
|
"wait-on": "9.0.3",
|
|
78
78
|
"@aleph-alpha/eslint-config-frontend": "0.5.0",
|
|
79
|
-
"@aleph-alpha/prettier-config-frontend": "2.
|
|
79
|
+
"@aleph-alpha/prettier-config-frontend": "2.1.0",
|
|
80
80
|
"@aleph-alpha/tsconfig-frontend": "0.6.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
@@ -104,11 +104,13 @@
|
|
|
104
104
|
"class-variance-authority": "^0.7.1",
|
|
105
105
|
"clsx": "^2.1.1",
|
|
106
106
|
"date-fns": "4.1.0",
|
|
107
|
-
"lucide-vue-next": "
|
|
107
|
+
"lucide-vue-next": "1.0.0",
|
|
108
108
|
"radix-vue": "^1.9.17",
|
|
109
109
|
"reka-ui": "^2.7.0",
|
|
110
110
|
"shiki": "^3.0.0",
|
|
111
|
-
"tailwind-merge": "^3.4.0"
|
|
111
|
+
"tailwind-merge": "^3.4.0",
|
|
112
|
+
"vue-sonner": "^2.0.9",
|
|
113
|
+
"@aleph-alpha/config-css": "1.1.0"
|
|
112
114
|
},
|
|
113
115
|
"scripts": {
|
|
114
116
|
"build": "node scripts/prepare-build.cjs && vite build",
|
|
@@ -438,7 +438,7 @@ function closeAll() {
|
|
|
438
438
|
</script>
|
|
439
439
|
|
|
440
440
|
<template>
|
|
441
|
-
<div class="
|
|
441
|
+
<div class="gap-y-4">
|
|
442
442
|
<div class="flex items-center gap-4">
|
|
443
443
|
<p class="text-sm">Current: <strong>{{ activeItem ?? 'none' }}</strong></p>
|
|
444
444
|
<UiButton size="sm" @click="goToDetails">Go to Details</UiButton>
|
|
@@ -498,7 +498,7 @@ export const Controlled: Story = {
|
|
|
498
498
|
return { activeItem, goToDetails, closeAll };
|
|
499
499
|
},
|
|
500
500
|
template: `
|
|
501
|
-
<div class="
|
|
501
|
+
<div class="gap-y-4">
|
|
502
502
|
<div class="flex items-center gap-4">
|
|
503
503
|
<p class="text-sm">Current: <strong>{{ activeItem ?? 'none' }}</strong></p>
|
|
504
504
|
<UiButton size="sm" @click="goToDetails">Go to Details</UiButton>
|
|
@@ -85,7 +85,7 @@ import { UiAlert, UiAlertDescription, UiAlertTitle, UiIcon } from '@aleph-alpha/
|
|
|
85
85
|
<UiAlertTitle>Unable to process your payment.</UiAlertTitle>
|
|
86
86
|
<UiAlertDescription>
|
|
87
87
|
<p>Please verify your billing information and try again.</p>
|
|
88
|
-
<ul class="mt-2 list-inside list-disc
|
|
88
|
+
<ul class="mt-2 list-inside list-disc gap-y-1">
|
|
89
89
|
<li>Check your card details</li>
|
|
90
90
|
<li>Ensure sufficient funds</li>
|
|
91
91
|
<li>Verify billing address</li>
|
|
@@ -111,7 +111,7 @@ export const Destructive: Story = {
|
|
|
111
111
|
<UiAlertTitle>Unable to process your payment.</UiAlertTitle>
|
|
112
112
|
<UiAlertDescription>
|
|
113
113
|
<p>Please verify your billing information and try again.</p>
|
|
114
|
-
<ul class="mt-2 list-inside list-disc
|
|
114
|
+
<ul class="mt-2 list-inside list-disc gap-y-1">
|
|
115
115
|
<li>Check your card details</li>
|
|
116
116
|
<li>Ensure sufficient funds</li>
|
|
117
117
|
<li>Verify billing address</li>
|
|
@@ -148,7 +148,7 @@ import { UiAlert, UiAlertDescription, UiAlertTitle, UiIcon } from '@aleph-alpha/
|
|
|
148
148
|
<UiAlertTitle>Unable to process your payment.</UiAlertTitle>
|
|
149
149
|
<UiAlertDescription>
|
|
150
150
|
<p>Please verify your billing information and try again.</p>
|
|
151
|
-
<ul class="mt-2 list-inside list-disc
|
|
151
|
+
<ul class="mt-2 list-inside list-disc gap-y-1">
|
|
152
152
|
<li>Check your card details</li>
|
|
153
153
|
<li>Ensure sufficient funds</li>
|
|
154
154
|
<li>Verify billing address</li>
|
|
@@ -184,7 +184,7 @@ export const AllVariants: Story = {
|
|
|
184
184
|
<UiAlertTitle>Unable to process your payment.</UiAlertTitle>
|
|
185
185
|
<UiAlertDescription>
|
|
186
186
|
<p>Please verify your billing information and try again.</p>
|
|
187
|
-
<ul class="mt-2 list-inside list-disc
|
|
187
|
+
<ul class="mt-2 list-inside list-disc gap-y-1">
|
|
188
188
|
<li>Check your card details</li>
|
|
189
189
|
<li>Ensure sufficient funds</li>
|
|
190
190
|
<li>Verify billing address</li>
|
|
@@ -145,7 +145,7 @@ import { UiAvatar, UiAvatarFallback, UiAvatarImage } from '@aleph-alpha/ui-libra
|
|
|
145
145
|
</script>
|
|
146
146
|
|
|
147
147
|
<template>
|
|
148
|
-
<div class="flex -
|
|
148
|
+
<div class="flex [&>*+*]:-ml-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background">
|
|
149
149
|
<UiAvatar>
|
|
150
150
|
<UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
151
151
|
<UiAvatarFallback>CN</UiAvatarFallback>
|
|
@@ -172,7 +172,7 @@ export const Stacked: Story = {
|
|
|
172
172
|
UiAvatarImage,
|
|
173
173
|
},
|
|
174
174
|
template: `
|
|
175
|
-
<div class="flex -
|
|
175
|
+
<div class="flex [&>*+*]:-ml-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background">
|
|
176
176
|
<UiAvatar>
|
|
177
177
|
<UiAvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
178
178
|
<UiAvatarFallback>CN</UiAvatarFallback>
|
|
@@ -20,7 +20,7 @@ const MailIcon = {
|
|
|
20
20
|
/**
|
|
21
21
|
* UiButton is the primary interactive control for triggering actions.
|
|
22
22
|
* Use the `variant` and `size` props for emphasis and density, slot in icons, or use `as-child` to render an `<a>` for link-style navigation.
|
|
23
|
-
* For icon-only buttons,
|
|
23
|
+
* For icon-only buttons, use `UiButton` with an icon child and an `aria-label`.
|
|
24
24
|
*/
|
|
25
25
|
const meta: Meta<typeof UiButton> = {
|
|
26
26
|
title: 'Components/UiButton',
|