@aleph-alpha/ui-library 2.4.4 → 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.js +78 -9
- 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/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 +12 -12
- /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';
|
|
@@ -53,58 +53,58 @@ export const RadiusScale: Story = {
|
|
|
53
53
|
</p>
|
|
54
54
|
</div>
|
|
55
55
|
|
|
56
|
-
<div class="grid grid-cols-2 sm:grid-cols-3
|
|
57
|
-
<div class="
|
|
56
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 gap-6">
|
|
57
|
+
<div class="text-center">
|
|
58
58
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-none"></div>
|
|
59
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
60
|
</div>
|
|
61
61
|
|
|
62
|
-
<div class="
|
|
62
|
+
<div class="text-center">
|
|
63
63
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-xs"></div>
|
|
64
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
65
|
</div>
|
|
66
66
|
|
|
67
|
-
<div class="
|
|
67
|
+
<div class="text-center">
|
|
68
68
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-sm"></div>
|
|
69
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
70
|
</div>
|
|
71
71
|
|
|
72
|
-
<div class="
|
|
72
|
+
<div class="text-center">
|
|
73
73
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded"></div>
|
|
74
74
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mt-3" onclick="copyToClipboard('rounded', this)">rounded</code>
|
|
75
75
|
</div>
|
|
76
76
|
|
|
77
|
-
<div class="
|
|
77
|
+
<div class="text-center">
|
|
78
78
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-md"></div>
|
|
79
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
80
|
</div>
|
|
81
81
|
|
|
82
|
-
<div class="
|
|
82
|
+
<div class="text-center">
|
|
83
83
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-lg"></div>
|
|
84
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
85
|
</div>
|
|
86
86
|
|
|
87
|
-
<div class="
|
|
87
|
+
<div class="text-center">
|
|
88
88
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-xl"></div>
|
|
89
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
90
|
</div>
|
|
91
91
|
|
|
92
|
-
<div class="
|
|
92
|
+
<div class="text-center">
|
|
93
93
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-2xl"></div>
|
|
94
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
95
|
</div>
|
|
96
96
|
|
|
97
|
-
<div class="
|
|
97
|
+
<div class="text-center">
|
|
98
98
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-3xl"></div>
|
|
99
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
100
|
</div>
|
|
101
101
|
|
|
102
|
-
<div class="
|
|
102
|
+
<div class="text-center">
|
|
103
103
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-4xl"></div>
|
|
104
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
105
|
</div>
|
|
106
106
|
|
|
107
|
-
<div class="
|
|
107
|
+
<div class="text-center">
|
|
108
108
|
<div class="mx-auto h-40 w-32 bg-background-accent-soft border border-border-surface-default rounded-full"></div>
|
|
109
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
110
|
</div>
|
/package/dist/system/components/core/{item/ItemActions.vue.d.ts → avatar/AvatarGroup.vue.d.ts}
RENAMED
|
File without changes
|