@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.
- package/config.d.ts +13 -0
- package/config.js +156 -12
- package/dist/system/components/UiAvatar/UiAvatar.vue.d.ts +4 -1
- package/dist/system/components/UiAvatar/UiAvatarGroup.vue.d.ts +18 -0
- package/dist/system/components/UiAvatar/index.d.ts +1 -0
- package/dist/system/components/UiAvatar/types.d.ts +12 -1
- package/dist/system/components/UiFileItem/UiFileItem.vue.d.ts +6 -1
- package/dist/system/components/UiFileItem/types.d.ts +30 -10
- package/dist/system/components/UiFileType/UiFileType.vue.d.ts +8 -0
- package/dist/system/components/UiFileType/index.d.ts +2 -0
- package/dist/system/components/UiFileType/types.d.ts +33 -0
- package/dist/system/components/UiItem/UiItem.vue.d.ts +8 -1
- package/dist/system/components/UiItem/constants.d.ts +4 -3
- package/dist/system/components/UiItem/index.d.ts +1 -1
- package/dist/system/components/UiItem/types.d.ts +53 -13
- package/dist/system/components/core/avatar/Avatar.vue.d.ts +2 -0
- package/dist/system/components/core/avatar/index.d.ts +1 -0
- package/dist/system/components/core/item/Item.vue.d.ts +1 -1
- package/dist/system/components/core/item/ItemAction.vue.d.ts +25 -0
- package/dist/system/components/core/item/index.d.ts +8 -4
- package/dist/system/components/index.d.ts +1 -0
- package/dist/system/lib/activeIndicator.d.ts +1 -0
- package/dist/system/lib.js +6574 -6357
- package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -15
- package/docs/public-docs/quick-start.md +2 -1
- package/package.json +1 -1
- package/src/components/UiAvatar/UiAvatar.stories.ts +103 -12
- package/src/components/UiAvatar/UiAvatar.vue +6 -1
- package/src/components/UiAvatar/UiAvatarGroup.vue +16 -0
- package/src/components/UiAvatar/UiAvatarImage.vue +1 -1
- package/src/components/UiAvatar/__tests__/UiAvatar.test.ts +86 -0
- package/src/components/UiAvatar/index.ts +1 -0
- package/src/components/UiAvatar/types.ts +15 -1
- package/src/components/UiButton/UiButton.stories.ts +60 -0
- package/src/components/UiCodeBlock/UiCodeBlock.vue +1 -1
- package/src/components/UiFileItem/UiFileItem.stories.ts +344 -185
- package/src/components/UiFileItem/UiFileItem.vue +110 -70
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +64 -3
- package/src/components/UiFileItem/types.ts +33 -10
- package/src/components/UiFileType/UiFileType.stories.ts +134 -0
- package/src/components/UiFileType/UiFileType.vue +116 -0
- package/src/components/UiFileType/__tests__/UiFileType.test.ts +41 -0
- package/src/components/UiFileType/index.ts +2 -0
- package/src/components/UiFileType/types.ts +38 -0
- package/src/components/UiItem/UiItem.stories.ts +555 -855
- package/src/components/UiItem/UiItem.vue +59 -4
- package/src/components/UiItem/UiItemMedia.vue +1 -1
- package/src/components/UiItem/__tests__/UiItem.test.ts +432 -26
- package/src/components/UiItem/constants.ts +16 -2
- package/src/components/UiItem/index.ts +1 -1
- package/src/components/UiItem/types.ts +64 -13
- package/src/components/UiKbd/UiKbd.stories.ts +1 -1
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +4 -4
- package/src/components/UiSelect/__tests__/UiSelectGroup.test.ts +2 -2
- package/src/components/UiTable/__tests__/UiTableRow.test.ts +4 -2
- package/src/components/core/avatar/Avatar.vue +17 -1
- package/src/components/core/avatar/AvatarFallback.vue +1 -1
- package/src/components/core/{item/ItemActions.vue → avatar/AvatarGroup.vue} +7 -2
- package/src/components/core/avatar/index.ts +1 -0
- package/src/components/core/button/index.ts +1 -1
- package/src/components/core/drawer/DrawerContent.vue +1 -1
- package/src/components/core/item/Item.vue +2 -2
- package/src/components/core/item/ItemAction.vue +30 -0
- package/src/components/core/item/ItemContent.vue +1 -1
- package/src/components/core/item/ItemDescription.vue +1 -1
- package/src/components/core/item/ItemGroup.vue +0 -1
- package/src/components/core/item/index.ts +32 -9
- package/src/components/core/kbd/Kbd.vue +1 -1
- package/src/components/core/skeleton/Skeleton.vue +3 -1
- package/src/components/core/slider/Slider.vue +1 -1
- package/src/components/core/table/TableFooter.vue +4 -1
- package/src/components/core/table/TableRow.vue +1 -1
- package/src/components/index.ts +1 -0
- package/src/lib/activeIndicator.ts +1 -0
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +2 -2
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +2 -2
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +2 -2
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +2 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarMenuButton.test.ts +33 -0
- package/src/patterns/UiSidebar/activeIndicator.ts +1 -16
- package/src/theme/BorderRadius.stories.ts +115 -0
- /package/dist/system/components/core/{item/ItemActions.vue.d.ts → avatar/AvatarGroup.vue.d.ts} +0 -0
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { computed, useAttrs } from 'vue';
|
|
3
3
|
import { SidebarMenuButton } from '@/components/core/sidebar';
|
|
4
4
|
import { UiIcon } from '@/components/UiIcon';
|
|
5
|
+
import { ACTIVE_INDICATOR_CLASS } from '@/lib/activeIndicator';
|
|
5
6
|
import { cn } from '@/lib/utils';
|
|
6
|
-
import { SIDEBAR_ACTIVE_INDICATOR_CLASS } from './activeIndicator';
|
|
7
7
|
import type { UiSidebarPopoverTriggerProps } from './types';
|
|
8
8
|
|
|
9
9
|
defineOptions({
|
|
@@ -25,7 +25,7 @@ const containerClass = computed(() =>
|
|
|
25
25
|
'has-[:focus-visible]:border-border-surface-focus-ring has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-ring/50',
|
|
26
26
|
// Row hover/active fill for transparent sidebar triggers.
|
|
27
27
|
'hover:bg-background-surface-muted-subtle data-[active=true]:bg-background-surface-muted-subtle',
|
|
28
|
-
|
|
28
|
+
ACTIVE_INDICATOR_CLASS,
|
|
29
29
|
),
|
|
30
30
|
);
|
|
31
31
|
|
|
@@ -45,6 +45,39 @@ describe('UiSidebarMenuButton', () => {
|
|
|
45
45
|
expect(getAllByRole('button', { name: 'Item' })).toHaveLength(1);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
+
test('uses the shared active indicator class', () => {
|
|
49
|
+
const Harness = defineComponent({
|
|
50
|
+
components: {
|
|
51
|
+
UiSidebarProvider,
|
|
52
|
+
UiSidebar,
|
|
53
|
+
UiSidebarContent,
|
|
54
|
+
UiSidebarMenu,
|
|
55
|
+
UiSidebarMenuItem,
|
|
56
|
+
UiSidebarMenuButton,
|
|
57
|
+
},
|
|
58
|
+
template: `
|
|
59
|
+
<UiSidebarProvider :default-open="true">
|
|
60
|
+
<UiSidebar collapsible="none">
|
|
61
|
+
<UiSidebarContent>
|
|
62
|
+
<UiSidebarMenu>
|
|
63
|
+
<UiSidebarMenuItem>
|
|
64
|
+
<UiSidebarMenuButton :is-active="true">
|
|
65
|
+
Item
|
|
66
|
+
</UiSidebarMenuButton>
|
|
67
|
+
</UiSidebarMenuItem>
|
|
68
|
+
</UiSidebarMenu>
|
|
69
|
+
</UiSidebarContent>
|
|
70
|
+
</UiSidebar>
|
|
71
|
+
</UiSidebarProvider>
|
|
72
|
+
`,
|
|
73
|
+
});
|
|
74
|
+
const { container } = render(Harness);
|
|
75
|
+
|
|
76
|
+
const activeIndicator = container.querySelector('.ui-active-indicator');
|
|
77
|
+
expect(activeIndicator).toBeInTheDocument();
|
|
78
|
+
expect(activeIndicator).toHaveAttribute('data-active', 'true');
|
|
79
|
+
});
|
|
80
|
+
|
|
48
81
|
test('renders label and emits end-icon-click when endIconClickable', async () => {
|
|
49
82
|
const user = userEvent.setup();
|
|
50
83
|
const onEndIconClick = vi.fn();
|
|
@@ -1,16 +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 const SIDEBAR_ACTIVE_INDICATOR_CLASS =
|
|
16
|
-
'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';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { defineComponent, h } from 'vue';
|
|
3
|
+
|
|
4
|
+
const ThemePlaceholder = defineComponent({
|
|
5
|
+
name: 'ThemePlaceholder',
|
|
6
|
+
render() {
|
|
7
|
+
return h('div');
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof ThemePlaceholder> = {
|
|
12
|
+
title: 'CSS utility/Border radius',
|
|
13
|
+
component: ThemePlaceholder,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: 'fullscreen',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof ThemePlaceholder>;
|
|
22
|
+
|
|
23
|
+
const copyScript = `
|
|
24
|
+
function copyToClipboard(text, el) {
|
|
25
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
26
|
+
el.classList.add('copied');
|
|
27
|
+
setTimeout(() => el.classList.remove('copied'), 1500);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Border radius utilities generated from `aa.corner-radius` in `tokens.json`.
|
|
34
|
+
* Use `rounded-xs` … `rounded-4xl` and `rounded-full` instead of raw radius values.
|
|
35
|
+
*/
|
|
36
|
+
export const RadiusScale: Story = {
|
|
37
|
+
render: () => ({
|
|
38
|
+
template: `
|
|
39
|
+
<div class="p-8 bg-background-surface-secondary min-h-screen">
|
|
40
|
+
<style>
|
|
41
|
+
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
42
|
+
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
43
|
+
.copy-btn.copied { background: #22c55e22; }
|
|
44
|
+
.copy-btn.copied::after { content: ' ✓'; color: #22c55e; }
|
|
45
|
+
</style>
|
|
46
|
+
<script>${copyScript}</script>
|
|
47
|
+
|
|
48
|
+
<div class="mb-8 max-w-3xl">
|
|
49
|
+
<h2 class="heading-s text-content-on-surface-primary mb-1">Border radius</h2>
|
|
50
|
+
<p class="body-14-regular text-content-on-surface-muted">
|
|
51
|
+
Token-backed radius utilities from <code class="label-12-medium">aa.corner-radius</code>.
|
|
52
|
+
Click a class name to copy.
|
|
53
|
+
</p>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 gap-6">
|
|
57
|
+
<div class="text-center">
|
|
58
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-none"></div>
|
|
59
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-none', this)">rounded-none</code>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div class="text-center">
|
|
63
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-xs"></div>
|
|
64
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-xs', this)">rounded-xs</code>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="text-center">
|
|
68
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-sm"></div>
|
|
69
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-sm', this)">rounded-sm</code>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="text-center">
|
|
73
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded"></div>
|
|
74
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded', this)">rounded</code>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="text-center">
|
|
78
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-md"></div>
|
|
79
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-md', this)">rounded-md</code>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div class="text-center">
|
|
83
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-lg"></div>
|
|
84
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-lg', this)">rounded-lg</code>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="text-center">
|
|
88
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-xl"></div>
|
|
89
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-xl', this)">rounded-xl</code>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div class="text-center">
|
|
93
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-2xl"></div>
|
|
94
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-2xl', this)">rounded-2xl</code>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="text-center">
|
|
98
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-3xl"></div>
|
|
99
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-3xl', this)">rounded-3xl</code>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="text-center">
|
|
103
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-4xl"></div>
|
|
104
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-4xl', this)">rounded-4xl</code>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="text-center">
|
|
108
|
+
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-full"></div>
|
|
109
|
+
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded-full', this)">rounded-full</code>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
`,
|
|
114
|
+
}),
|
|
115
|
+
};
|
/package/dist/system/components/core/{item/ItemActions.vue.d.ts → avatar/AvatarGroup.vue.d.ts}
RENAMED
|
File without changes
|