Skip to content

Commit ae35610

Browse files
committed
chore: fix modals div
1 parent 4fed857 commit ae35610

File tree

3 files changed

+21
-28
lines changed

3 files changed

+21
-28
lines changed

unraid-ui/.storybook/preview.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ const preview: Preview = {
1414
},
1515
},
1616
},
17+
// Add decorator to include modals container in every story
18+
decorators: [
19+
(story) => ({
20+
components: { story },
21+
template: `
22+
<div>
23+
<div id="modals"></div>
24+
<story />
25+
</div>
26+
`,
27+
}),
28+
],
1729
};
1830

1931
export default preview;

unraid-ui/stories/components/common/Tooltip.stories.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import type { Meta, StoryObj } from "@storybook/vue3";
2-
import { Tooltip as TooltipComponent, TooltipTrigger, TooltipContent, TooltipProvider } from "../../../src/components/common/tooltip";
3-
import { Button } from "../../../src/components/common/button";
1+
import type { Meta, StoryObj } from '@storybook/vue3';
2+
import { Button } from '../../../src/components/common/button';
3+
import {
4+
Tooltip as TooltipComponent,
5+
TooltipContent,
6+
TooltipProvider,
7+
TooltipTrigger,
8+
} from '../../../src/components/common/tooltip';
49

510
const meta = {
6-
title: "Components/Common",
11+
title: 'Components/Common',
712
component: TooltipComponent,
813
} satisfies Meta<typeof TooltipComponent>;
914

@@ -21,8 +26,6 @@ export const Tooltip: Story = {
2126
return { args };
2227
},
2328
template: `
24-
<div>
25-
<div id="modals"></div>
2629
<div class="p-20 flex items-center justify-start">
2730
<TooltipProvider>
2831
<TooltipComponent :default-open="args.defaultOpen">
@@ -35,7 +38,6 @@ export const Tooltip: Story = {
3538
</TooltipComponent>
3639
</TooltipProvider>
3740
</div>
38-
</div>
3941
`,
4042
}),
4143
};

unraid-ui/stories/components/form/Select.stories.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,6 @@ import {
99
SelectValue,
1010
} from '../../../src/components/form/select';
1111

12-
// Define the custom element for modals
13-
class ModalsContainer extends HTMLElement {
14-
constructor() {
15-
super();
16-
const shadow = this.attachShadow({ mode: 'open' });
17-
const parent = document.createElement('div');
18-
const container = document.createElement('div');
19-
container.id = 'modals';
20-
21-
parent.appendChild(container);
22-
23-
shadow.appendChild(parent);
24-
}
25-
}
26-
27-
// Register the custom element
28-
customElements.define('unraid-modals', ModalsContainer);
29-
3012
const meta = {
3113
title: 'Components/Form/Select',
3214
component: SelectComponent,
@@ -51,8 +33,6 @@ export const Select: Story = {
5133
return { args };
5234
},
5335
template: `
54-
<div>
55-
<unraid-modals></unraid-modals>
5636
<SelectComponent>
5737
<SelectTrigger class="w-[180px]">
5838
<SelectValue placeholder="Select a fruit" />
@@ -67,7 +47,6 @@ export const Select: Story = {
6747
</SelectGroup>
6848
</SelectContent>
6949
</SelectComponent>
70-
</div>
7150
`,
7251
}),
7352
};

0 commit comments

Comments
 (0)