@aleph-alpha/ui-library 2.4.0 → 2.4.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/ui-library",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/system/lib.js",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"http-server": "14.1.1",
|
|
63
63
|
"playwright": "^1.57.0",
|
|
64
64
|
"postcss": "8.5.10",
|
|
65
|
+
"sb-addon-versions": "^1.0.12",
|
|
65
66
|
"storybook": "10.2.17",
|
|
66
67
|
"storybook-addon-tag-badges": "^3.1.0",
|
|
67
68
|
"typescript": "^5.2.2",
|
|
@@ -40,7 +40,11 @@ const delegatedProps = reactiveOmit(props, 'tooltip');
|
|
|
40
40
|
<slot />
|
|
41
41
|
</SidebarMenuButtonChild>
|
|
42
42
|
|
|
43
|
-
<Tooltip
|
|
43
|
+
<Tooltip
|
|
44
|
+
v-else
|
|
45
|
+
:disabled="state !== 'collapsed' || isMobile"
|
|
46
|
+
:delay-duration="0"
|
|
47
|
+
>
|
|
44
48
|
<TooltipTrigger as-child>
|
|
45
49
|
<SidebarMenuButtonChild v-bind="{ ...delegatedProps, ...$attrs }">
|
|
46
50
|
<slot />
|
|
@@ -14,6 +14,37 @@ beforeEach(() => mockMatchMediaDesktop());
|
|
|
14
14
|
afterEach(() => vi.restoreAllMocks());
|
|
15
15
|
|
|
16
16
|
describe('UiSidebarMenuButton', () => {
|
|
17
|
+
test('renders only one button when tooltip is not provided', () => {
|
|
18
|
+
const Harness = defineComponent({
|
|
19
|
+
components: {
|
|
20
|
+
UiSidebarProvider,
|
|
21
|
+
UiSidebar,
|
|
22
|
+
UiSidebarContent,
|
|
23
|
+
UiSidebarMenu,
|
|
24
|
+
UiSidebarMenuItem,
|
|
25
|
+
UiSidebarMenuButton,
|
|
26
|
+
},
|
|
27
|
+
template: `
|
|
28
|
+
<UiSidebarProvider :default-open="true">
|
|
29
|
+
<UiSidebar collapsible="none">
|
|
30
|
+
<UiSidebarContent>
|
|
31
|
+
<UiSidebarMenu>
|
|
32
|
+
<UiSidebarMenuItem>
|
|
33
|
+
<UiSidebarMenuButton>
|
|
34
|
+
Item
|
|
35
|
+
</UiSidebarMenuButton>
|
|
36
|
+
</UiSidebarMenuItem>
|
|
37
|
+
</UiSidebarMenu>
|
|
38
|
+
</UiSidebarContent>
|
|
39
|
+
</UiSidebar>
|
|
40
|
+
</UiSidebarProvider>
|
|
41
|
+
`,
|
|
42
|
+
});
|
|
43
|
+
const { getAllByRole } = render(Harness);
|
|
44
|
+
|
|
45
|
+
expect(getAllByRole('button', { name: 'Item' })).toHaveLength(1);
|
|
46
|
+
});
|
|
47
|
+
|
|
17
48
|
test('renders label and emits end-icon-click when endIconClickable', async () => {
|
|
18
49
|
const user = userEvent.setup();
|
|
19
50
|
const onEndIconClick = vi.fn();
|