@rovula/ui 0.0.22 → 0.0.24
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/dist/cjs/bundle.css +143 -0
- package/dist/cjs/bundle.js +1 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/DropdownMenu/DropdownMenu.d.ts +27 -0
- package/dist/cjs/types/components/DropdownMenu/DropdownMenu.stories.d.ts +54 -0
- package/dist/cjs/types/components/Text/Text.d.ts +6 -5
- package/dist/cjs/types/components/Text/Text.stories.d.ts +2 -10
- package/dist/components/DropdownMenu/DropdownMenu.js +74 -0
- package/dist/components/DropdownMenu/DropdownMenu.stories.js +116 -0
- package/dist/components/Tabs/Tabs.js +0 -1
- package/dist/components/Text/Text.js +20 -4
- package/dist/esm/bundle.css +143 -0
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/DropdownMenu/DropdownMenu.d.ts +27 -0
- package/dist/esm/types/components/DropdownMenu/DropdownMenu.stories.d.ts +54 -0
- package/dist/esm/types/components/Text/Text.d.ts +6 -5
- package/dist/esm/types/components/Text/Text.stories.d.ts +2 -10
- package/dist/index.d.ts +6 -5
- package/dist/src/theme/global.css +247 -1
- package/dist/theme/main-preset.js +24 -0
- package/dist/theme/plugins/utilities/typography.js +9 -0
- package/dist/theme/presets/colors.js +6 -0
- package/dist/theme/themes/xspector/baseline.css +2 -1
- package/dist/theme/themes/xspector/color.css +2 -1
- package/dist/theme/themes/xspector/components/dropdown-menu.css +28 -0
- package/dist/theme/tokens/baseline.css +2 -1
- package/dist/theme/tokens/color.css +1 -0
- package/dist/theme/tokens/components/dropdown-menu.css +27 -0
- package/dist/theme/tokens/typography.css +21 -0
- package/package.json +8 -3
- package/src/components/Button/Button.tsx +1 -4
- package/src/components/Collapsible/Collapsible.tsx +1 -1
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +394 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +222 -0
- package/src/components/Slider/Slider.tsx +0 -1
- package/src/components/Tabs/Tabs.tsx +0 -1
- package/src/components/Text/Text.tsx +37 -22
- package/src/theme/main-preset.js +24 -0
- package/src/theme/plugins/utilities/typography.js +9 -0
- package/src/theme/presets/colors.js +6 -0
- package/src/theme/themes/xspector/baseline.css +2 -1
- package/src/theme/themes/xspector/color.css +2 -1
- package/src/theme/themes/xspector/components/dropdown-menu.css +28 -0
- package/src/theme/tokens/baseline.css +2 -1
- package/src/theme/tokens/color.css +1 -0
- package/src/theme/tokens/components/dropdown-menu.css +27 -0
- package/src/theme/tokens/typography.css +21 -0
|
@@ -81,6 +81,12 @@ module.exports = {
|
|
|
81
81
|
"--base-color-popup-foreground"
|
|
82
82
|
),
|
|
83
83
|
"base-stroke": withColorMixin("--base-color-workspace-stroke"),
|
|
84
|
+
"base-workspace-stroke": withColorMixin(
|
|
85
|
+
"--base-color-workspace-stroke"
|
|
86
|
+
),
|
|
87
|
+
"base-guideline-stroke": withColorMixin(
|
|
88
|
+
"--base-color-guideline-stroke"
|
|
89
|
+
),
|
|
84
90
|
|
|
85
91
|
"common-white": withColorMixin("--common-white"),
|
|
86
92
|
"common-black": withColorMixin("--common-black"),
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
--base-color-bg2: #282c31;
|
|
24
24
|
--base-color-bg3: #d8d8d8;
|
|
25
25
|
--base-color-workspace-stroke: #e2e2e2;
|
|
26
|
+
--base-color-guideline-stroke: #c5c5c5;
|
|
26
27
|
--base-color-popup: #2d2e30;
|
|
27
28
|
--base-color-popup-hightlight: #343638;
|
|
28
29
|
--base-color-popup-curtain: rgba(0 0 0 / 0.6);
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
--primary-foreground: var(--common-white);
|
|
64
65
|
--secondary-foreground: var(--common-white);
|
|
65
66
|
|
|
66
|
-
--base-color-popup-foreground: var(--
|
|
67
|
+
--base-color-popup-foreground: var(--text-grey-light);
|
|
67
68
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
:root[data-theme="xspector"] {
|
|
2
|
+
/* ------------------------------------------------------------------ */
|
|
3
|
+
/* DropdownMenu Component Tokens */
|
|
4
|
+
/* ------------------------------------------------------------------ */
|
|
5
|
+
/* Naming Convention: --[component]-[state]-[property] */
|
|
6
|
+
/* Element: [default, hover, selected, disabled] */
|
|
7
|
+
/* ------------------------------------------------------------------ */
|
|
8
|
+
|
|
9
|
+
--dropdown-menu-seperator-bg: var(--other-transparency-white-08);
|
|
10
|
+
--dropdown-menu-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.12);
|
|
11
|
+
|
|
12
|
+
/* Default State */
|
|
13
|
+
--dropdown-menu-default-bg: transparent;
|
|
14
|
+
--dropdown-menu-default-text: inherit;
|
|
15
|
+
|
|
16
|
+
/* Hover State */
|
|
17
|
+
--dropdown-menu-hover-bg: var(--other-transparency-white-08);
|
|
18
|
+
--dropdown-menu-hover-text: inherit;
|
|
19
|
+
|
|
20
|
+
/* Selected State */
|
|
21
|
+
--dropdown-menu-selected-bg: var(--grey-grey-150);
|
|
22
|
+
--dropdown-menu-selected-text: inherit;
|
|
23
|
+
|
|
24
|
+
/* Disabled State */
|
|
25
|
+
--dropdown-menu-disabled-bg: transparent;
|
|
26
|
+
--dropdown-menu-disabled-text: var(--grey-grey-140);
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
--base-color-bg2: #f5f5f5;
|
|
24
24
|
--base-color-bg3: #d8d8d8;
|
|
25
25
|
--base-color-workspace-stroke: #e2e2e2;
|
|
26
|
+
--base-color-guideline-stroke: #c5c5c5;
|
|
26
27
|
--base-color-popup: #ffffff;
|
|
27
28
|
--base-color-popup-hightlight: #343638;
|
|
28
29
|
--base-color-popup-curtain: rgba(0 0 0 / 0.6);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* ------------------------------------------------------------------ */
|
|
3
|
+
/* DropdownMenu Component Tokens */
|
|
4
|
+
/* ------------------------------------------------------------------ */
|
|
5
|
+
/* Naming Convention: --[component]-[state]-[property] */
|
|
6
|
+
/* Element: [default, hover, selected, disabled] */
|
|
7
|
+
/* ------------------------------------------------------------------ */
|
|
8
|
+
|
|
9
|
+
--dropdown-menu-seperator-bg: var(--base-color-workspace-stroke);
|
|
10
|
+
--dropdown-menu-shadow: 0px 2px 24px 0px rgba(145, 158, 171, 0.24);
|
|
11
|
+
|
|
12
|
+
/* Default State */
|
|
13
|
+
--dropdown-menu-default-bg: transparent;
|
|
14
|
+
--dropdown-menu-default-text: inherit;
|
|
15
|
+
|
|
16
|
+
/* Hover State */
|
|
17
|
+
--dropdown-menu-hover-bg: var(--state-color-primary-hover-bg);
|
|
18
|
+
--dropdown-menu-hover-text: inherit;
|
|
19
|
+
|
|
20
|
+
/* Selected State */
|
|
21
|
+
--dropdown-menu-selected-bg: transparent;
|
|
22
|
+
--dropdown-menu-selected-text: inherit;
|
|
23
|
+
|
|
24
|
+
/* Disabled State */
|
|
25
|
+
--dropdown-menu-disabled-bg: transparent;
|
|
26
|
+
--dropdown-menu-disabled-text: var(--state-color-disable-outline);
|
|
27
|
+
}
|
|
@@ -147,6 +147,27 @@
|
|
|
147
147
|
--small5-style: normal;
|
|
148
148
|
--small5-line-height: 12px;
|
|
149
149
|
--small5-line-height-rem: 0.75rem;
|
|
150
|
+
--small6-family: "Montserrat";
|
|
151
|
+
--small6-size: 10px;
|
|
152
|
+
--small6-size-rem: 0.625rem;
|
|
153
|
+
--small6-weight: 600;
|
|
154
|
+
--small6-style: normal;
|
|
155
|
+
--small6-line-height: 12px;
|
|
156
|
+
--small6-line-height-rem: 0.75rem;
|
|
157
|
+
--small7-family: "Montserrat";
|
|
158
|
+
--small7-size: 8px;
|
|
159
|
+
--small7-size-rem: 0.5rem;
|
|
160
|
+
--small7-weight: 600;
|
|
161
|
+
--small7-style: normal;
|
|
162
|
+
--small7-line-height: 10px;
|
|
163
|
+
--small7-line-height-rem: 0.625rem;
|
|
164
|
+
--small8-family: "Montserrat";
|
|
165
|
+
--small8-size: 8px;
|
|
166
|
+
--small8-size-rem: 0.5rem;
|
|
167
|
+
--small8-weight: 700;
|
|
168
|
+
--small8-style: normal;
|
|
169
|
+
--small8-line-height: 10px;
|
|
170
|
+
--small8-line-height-rem: 0.625rem;
|
|
150
171
|
--label-label1-family: "Montserrat";
|
|
151
172
|
--label-label1-size: 12px;
|
|
152
173
|
--label-label1-size-rem: 0.75rem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rovula/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"main": "dist/cjs/bundle.js",
|
|
5
5
|
"module": "dist/esm/bundle.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,14 +15,17 @@
|
|
|
15
15
|
"public": "npm run build:package && npm publish --access=public",
|
|
16
16
|
"storybook:serve-css": "npx tailwindcss -i ./src/theme/global.css -o ./dist/src/theme/global.css",
|
|
17
17
|
"storybook": "storybook dev -p 6006",
|
|
18
|
-
"build-storybook": "storybook build"
|
|
18
|
+
"build-storybook": "storybook build",
|
|
19
|
+
"chromatic": "npx chromatic --project-token=chpt_cee098dd3b9b3ee"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"dist/**/*",
|
|
22
23
|
"src/**/*"
|
|
23
24
|
],
|
|
24
25
|
"keywords": [],
|
|
25
|
-
"author":
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "NuttapongSa"
|
|
28
|
+
},
|
|
26
29
|
"license": "ISC",
|
|
27
30
|
"devDependencies": {
|
|
28
31
|
"@babel/core": "^7.24.5",
|
|
@@ -50,6 +53,7 @@
|
|
|
50
53
|
"@types/node": "^20.12.12",
|
|
51
54
|
"autoprefixer": "^10.4.19",
|
|
52
55
|
"babel-loader": "^9.1.3",
|
|
56
|
+
"chromatic": "^11.7.1",
|
|
53
57
|
"copyfiles": "^2.4.1",
|
|
54
58
|
"css-loader": "^7.1.2",
|
|
55
59
|
"postcss": "^8.4.38",
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
"@radix-ui/react-avatar": "^1.1.0",
|
|
73
77
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
74
78
|
"@radix-ui/react-dialog": "^1.0.5",
|
|
79
|
+
"@radix-ui/react-dropdown-menu": "^2.1.1",
|
|
75
80
|
"@radix-ui/react-label": "^2.0.2",
|
|
76
81
|
"@radix-ui/react-popover": "^1.1.1",
|
|
77
82
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactElement, forwardRef } from "react";
|
|
2
2
|
import { buttonVariants } from "./Button.styles";
|
|
3
3
|
import { cn } from "@/utils/cn";
|
|
4
|
-
import { title } from "process";
|
|
5
|
-
import { ref } from "yup";
|
|
6
4
|
import Loading from "../Loading/Loading";
|
|
7
|
-
import { EyeIcon } from "@heroicons/react/16/solid";
|
|
8
5
|
|
|
9
6
|
export type ButtonProps = {
|
|
10
7
|
title?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef,
|
|
1
|
+
import React, { forwardRef, useEffect, useRef, useState } from "react";
|
|
2
2
|
import { ChevronDownIcon } from "@heroicons/react/16/solid";
|
|
3
3
|
import { CollapsibleProvider, useCollapsible } from "./CollapsibleContext";
|
|
4
4
|
import { cn } from "@/utils/cn";
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuCheckboxItem,
|
|
6
|
+
DropdownMenuContent,
|
|
7
|
+
DropdownMenuGroup,
|
|
8
|
+
DropdownMenuItem,
|
|
9
|
+
DropdownMenuLabel,
|
|
10
|
+
DropdownMenuPortal,
|
|
11
|
+
DropdownMenuSeparator,
|
|
12
|
+
DropdownMenuSub,
|
|
13
|
+
DropdownMenuSubContent,
|
|
14
|
+
DropdownMenuSubTrigger,
|
|
15
|
+
DropdownMenuTrigger,
|
|
16
|
+
} from "./DropdownMenu";
|
|
17
|
+
import Button from "../Button/Button";
|
|
18
|
+
import { DropdownMenuCheckboxItemProps } from "@radix-ui/react-dropdown-menu";
|
|
19
|
+
import Icon from "../Icon/Icon";
|
|
20
|
+
import ActionButton from "../ActionButton/ActionButton";
|
|
21
|
+
|
|
22
|
+
const meta = {
|
|
23
|
+
title: "Components/DropdownMenu",
|
|
24
|
+
component: DropdownMenu,
|
|
25
|
+
// tags: ["autodocs"],
|
|
26
|
+
parameters: {
|
|
27
|
+
layout: "fullscreen",
|
|
28
|
+
},
|
|
29
|
+
decorators: [
|
|
30
|
+
(Story) => (
|
|
31
|
+
<div className="p-5 flex w-full">
|
|
32
|
+
<Story />
|
|
33
|
+
</div>
|
|
34
|
+
),
|
|
35
|
+
],
|
|
36
|
+
} satisfies Meta<typeof DropdownMenu>;
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
export const Default = {
|
|
41
|
+
args: {
|
|
42
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
43
|
+
// value: "Lorem Ipsum",
|
|
44
|
+
// fullwidth: true,
|
|
45
|
+
},
|
|
46
|
+
render: (args) => {
|
|
47
|
+
console.log("args ", args);
|
|
48
|
+
const props: typeof args = {
|
|
49
|
+
...args,
|
|
50
|
+
};
|
|
51
|
+
return (
|
|
52
|
+
<div className="flex flex-row gap-4 w-full">
|
|
53
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
54
|
+
<DropdownMenu>
|
|
55
|
+
<DropdownMenuTrigger>Open</DropdownMenuTrigger>
|
|
56
|
+
<DropdownMenuContent>
|
|
57
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
58
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
59
|
+
<DropdownMenuItem disabled>Option Description</DropdownMenuItem>
|
|
60
|
+
<DropdownMenuItem>
|
|
61
|
+
<Icon type="heroicons" name="check" className="size-4" />
|
|
62
|
+
Option Description
|
|
63
|
+
</DropdownMenuItem>
|
|
64
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
65
|
+
</DropdownMenuContent>
|
|
66
|
+
</DropdownMenu>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
} satisfies StoryObj;
|
|
72
|
+
|
|
73
|
+
export const WithIcon = {
|
|
74
|
+
args: {
|
|
75
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
76
|
+
// value: "Lorem Ipsum",
|
|
77
|
+
// fullwidth: true,
|
|
78
|
+
},
|
|
79
|
+
render: (args) => {
|
|
80
|
+
console.log("args ", args);
|
|
81
|
+
const props: typeof args = {
|
|
82
|
+
...args,
|
|
83
|
+
};
|
|
84
|
+
return (
|
|
85
|
+
<div className="flex flex-row gap-4 w-full">
|
|
86
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
87
|
+
<DropdownMenu>
|
|
88
|
+
<DropdownMenuTrigger asChild>
|
|
89
|
+
<Button variant="outline">Open</Button>
|
|
90
|
+
</DropdownMenuTrigger>
|
|
91
|
+
<DropdownMenuContent>
|
|
92
|
+
<DropdownMenuItem>
|
|
93
|
+
<Icon
|
|
94
|
+
type="heroicons"
|
|
95
|
+
name="rocket-launch"
|
|
96
|
+
className="size-4"
|
|
97
|
+
/>
|
|
98
|
+
<span>Option Description</span>
|
|
99
|
+
</DropdownMenuItem>
|
|
100
|
+
<DropdownMenuItem>
|
|
101
|
+
<Icon
|
|
102
|
+
type="heroicons"
|
|
103
|
+
name="rocket-launch"
|
|
104
|
+
className="size-4"
|
|
105
|
+
/>
|
|
106
|
+
<span>Option Description</span>
|
|
107
|
+
</DropdownMenuItem>
|
|
108
|
+
<DropdownMenuItem disabled>
|
|
109
|
+
<Icon
|
|
110
|
+
type="heroicons"
|
|
111
|
+
name="rocket-launch"
|
|
112
|
+
className="size-4"
|
|
113
|
+
/>
|
|
114
|
+
<span>Option Description</span>
|
|
115
|
+
</DropdownMenuItem>
|
|
116
|
+
</DropdownMenuContent>
|
|
117
|
+
</DropdownMenu>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
} satisfies StoryObj;
|
|
123
|
+
|
|
124
|
+
export const WithLabel = {
|
|
125
|
+
args: {
|
|
126
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
127
|
+
// value: "Lorem Ipsum",
|
|
128
|
+
// fullwidth: true,
|
|
129
|
+
},
|
|
130
|
+
render: (args) => {
|
|
131
|
+
console.log("args ", args);
|
|
132
|
+
const props: typeof args = {
|
|
133
|
+
...args,
|
|
134
|
+
};
|
|
135
|
+
return (
|
|
136
|
+
<div className="flex flex-row gap-4 w-full">
|
|
137
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
138
|
+
<DropdownMenu>
|
|
139
|
+
<DropdownMenuTrigger asChild>
|
|
140
|
+
<Button variant="outline">Open</Button>
|
|
141
|
+
</DropdownMenuTrigger>
|
|
142
|
+
<DropdownMenuContent>
|
|
143
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
144
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
145
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
146
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
147
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
148
|
+
<DropdownMenuSeparator />
|
|
149
|
+
<DropdownMenuLabel>Sort by</DropdownMenuLabel>
|
|
150
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
151
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
152
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
153
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
154
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
155
|
+
</DropdownMenuContent>
|
|
156
|
+
</DropdownMenu>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
160
|
+
},
|
|
161
|
+
} satisfies StoryObj;
|
|
162
|
+
|
|
163
|
+
export const Checkboxes = {
|
|
164
|
+
args: {
|
|
165
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
166
|
+
// value: "Lorem Ipsum",
|
|
167
|
+
// fullwidth: true,
|
|
168
|
+
},
|
|
169
|
+
render: (args) => {
|
|
170
|
+
type Checked = DropdownMenuCheckboxItemProps["checked"];
|
|
171
|
+
console.log("args ", args);
|
|
172
|
+
const props: typeof args = {
|
|
173
|
+
...args,
|
|
174
|
+
};
|
|
175
|
+
return (
|
|
176
|
+
<div className="flex flex-row gap-4 w-full">
|
|
177
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
178
|
+
<DropdownMenu>
|
|
179
|
+
<DropdownMenuTrigger asChild>
|
|
180
|
+
<Button variant="outline">Open</Button>
|
|
181
|
+
</DropdownMenuTrigger>
|
|
182
|
+
<DropdownMenuContent>
|
|
183
|
+
<DropdownMenuCheckboxItem>
|
|
184
|
+
Option Description
|
|
185
|
+
</DropdownMenuCheckboxItem>
|
|
186
|
+
<DropdownMenuCheckboxItem checked>
|
|
187
|
+
Option Description
|
|
188
|
+
</DropdownMenuCheckboxItem>
|
|
189
|
+
<DropdownMenuCheckboxItem disabled>
|
|
190
|
+
Option Description
|
|
191
|
+
</DropdownMenuCheckboxItem>
|
|
192
|
+
<DropdownMenuCheckboxItem checked disabled>
|
|
193
|
+
Option Description
|
|
194
|
+
</DropdownMenuCheckboxItem>
|
|
195
|
+
<DropdownMenuCheckboxItem>
|
|
196
|
+
<Icon
|
|
197
|
+
type="heroicons"
|
|
198
|
+
name="rocket-launch"
|
|
199
|
+
className="size-4"
|
|
200
|
+
/>
|
|
201
|
+
<span>Option Description</span>
|
|
202
|
+
</DropdownMenuCheckboxItem>
|
|
203
|
+
<DropdownMenuCheckboxItem checked>
|
|
204
|
+
<Icon
|
|
205
|
+
type="heroicons"
|
|
206
|
+
name="rocket-launch"
|
|
207
|
+
className="size-4"
|
|
208
|
+
/>
|
|
209
|
+
<span>Option Description</span>
|
|
210
|
+
</DropdownMenuCheckboxItem>
|
|
211
|
+
<DropdownMenuCheckboxItem disabled>
|
|
212
|
+
<Icon
|
|
213
|
+
type="heroicons"
|
|
214
|
+
name="rocket-launch"
|
|
215
|
+
className="size-4"
|
|
216
|
+
/>
|
|
217
|
+
<span>Option Description</span>
|
|
218
|
+
</DropdownMenuCheckboxItem>
|
|
219
|
+
<DropdownMenuCheckboxItem checked disabled>
|
|
220
|
+
<Icon
|
|
221
|
+
type="heroicons"
|
|
222
|
+
name="rocket-launch"
|
|
223
|
+
className="size-4"
|
|
224
|
+
/>
|
|
225
|
+
<span>Option Description</span>
|
|
226
|
+
</DropdownMenuCheckboxItem>
|
|
227
|
+
</DropdownMenuContent>
|
|
228
|
+
</DropdownMenu>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
},
|
|
233
|
+
} satisfies StoryObj;
|
|
234
|
+
|
|
235
|
+
export const SubMenu = {
|
|
236
|
+
args: {
|
|
237
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
238
|
+
// value: "Lorem Ipsum",
|
|
239
|
+
// fullwidth: true,
|
|
240
|
+
},
|
|
241
|
+
render: (args) => {
|
|
242
|
+
console.log("args ", args);
|
|
243
|
+
const props: typeof args = {
|
|
244
|
+
...args,
|
|
245
|
+
};
|
|
246
|
+
return (
|
|
247
|
+
<div className="flex flex-row gap-4 w-full">
|
|
248
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
249
|
+
<DropdownMenu>
|
|
250
|
+
<DropdownMenuTrigger>Open</DropdownMenuTrigger>
|
|
251
|
+
<DropdownMenuContent>
|
|
252
|
+
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
253
|
+
<DropdownMenuSeparator />
|
|
254
|
+
<DropdownMenuItem>Profile</DropdownMenuItem>
|
|
255
|
+
<DropdownMenuItem>Billing</DropdownMenuItem>
|
|
256
|
+
<DropdownMenuItem>Team</DropdownMenuItem>
|
|
257
|
+
<DropdownMenuItem>Subscription</DropdownMenuItem>
|
|
258
|
+
<DropdownMenuSeparator />
|
|
259
|
+
<DropdownMenuGroup>
|
|
260
|
+
<DropdownMenuSub>
|
|
261
|
+
<DropdownMenuSubTrigger>
|
|
262
|
+
<span>Invite users</span>
|
|
263
|
+
</DropdownMenuSubTrigger>
|
|
264
|
+
<DropdownMenuPortal>
|
|
265
|
+
<DropdownMenuSubContent>
|
|
266
|
+
<DropdownMenuItem>
|
|
267
|
+
<span>Email</span>
|
|
268
|
+
</DropdownMenuItem>
|
|
269
|
+
<DropdownMenuItem>
|
|
270
|
+
<span>Message</span>
|
|
271
|
+
</DropdownMenuItem>
|
|
272
|
+
<DropdownMenuSeparator />
|
|
273
|
+
<DropdownMenuItem>
|
|
274
|
+
<span>More...</span>
|
|
275
|
+
</DropdownMenuItem>
|
|
276
|
+
</DropdownMenuSubContent>
|
|
277
|
+
</DropdownMenuPortal>
|
|
278
|
+
</DropdownMenuSub>
|
|
279
|
+
<DropdownMenuCheckboxItem>Panel</DropdownMenuCheckboxItem>
|
|
280
|
+
</DropdownMenuGroup>
|
|
281
|
+
</DropdownMenuContent>
|
|
282
|
+
</DropdownMenu>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
);
|
|
286
|
+
},
|
|
287
|
+
} satisfies StoryObj;
|
|
288
|
+
|
|
289
|
+
export const OnIcon = {
|
|
290
|
+
args: {
|
|
291
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
292
|
+
// value: "Lorem Ipsum",
|
|
293
|
+
// fullwidth: true,
|
|
294
|
+
},
|
|
295
|
+
render: (args) => {
|
|
296
|
+
console.log("args ", args);
|
|
297
|
+
const props: typeof args = {
|
|
298
|
+
...args,
|
|
299
|
+
};
|
|
300
|
+
return (
|
|
301
|
+
<div className="flex flex-row gap-4 w-full">
|
|
302
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
303
|
+
<DropdownMenu>
|
|
304
|
+
<DropdownMenuTrigger>
|
|
305
|
+
<Icon type="heroicons" name="ellipsis-vertical" />
|
|
306
|
+
</DropdownMenuTrigger>
|
|
307
|
+
<DropdownMenuContent>
|
|
308
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
309
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
310
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
311
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
312
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
313
|
+
</DropdownMenuContent>
|
|
314
|
+
</DropdownMenu>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
);
|
|
318
|
+
},
|
|
319
|
+
} satisfies StoryObj;
|
|
320
|
+
|
|
321
|
+
export const AsChild = {
|
|
322
|
+
args: {
|
|
323
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
324
|
+
// value: "Lorem Ipsum",
|
|
325
|
+
// fullwidth: true,
|
|
326
|
+
},
|
|
327
|
+
render: (args) => {
|
|
328
|
+
console.log("args ", args);
|
|
329
|
+
const props: typeof args = {
|
|
330
|
+
...args,
|
|
331
|
+
};
|
|
332
|
+
return (
|
|
333
|
+
<div className="flex flex-row gap-4 w-full">
|
|
334
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
335
|
+
<DropdownMenu>
|
|
336
|
+
<DropdownMenuTrigger asChild>
|
|
337
|
+
<ActionButton variant="icon">
|
|
338
|
+
<Icon type="heroicons" name="ellipsis-vertical" />
|
|
339
|
+
</ActionButton>
|
|
340
|
+
</DropdownMenuTrigger>
|
|
341
|
+
<DropdownMenuContent>
|
|
342
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
343
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
344
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
345
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
346
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
347
|
+
</DropdownMenuContent>
|
|
348
|
+
</DropdownMenu>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
);
|
|
352
|
+
},
|
|
353
|
+
} satisfies StoryObj;
|
|
354
|
+
|
|
355
|
+
export const Position = {
|
|
356
|
+
args: {
|
|
357
|
+
side: "bottom",
|
|
358
|
+
align: "center",
|
|
359
|
+
sideOffset: 5,
|
|
360
|
+
alignOffset: 0,
|
|
361
|
+
},
|
|
362
|
+
render: (args) => {
|
|
363
|
+
console.log("args ", args);
|
|
364
|
+
const props: typeof args = {
|
|
365
|
+
...args,
|
|
366
|
+
};
|
|
367
|
+
return (
|
|
368
|
+
<div className="flex flex-row gap-4 w-full">
|
|
369
|
+
<div className="flex flex-1 justify-center items-center space-x-2">
|
|
370
|
+
<DropdownMenu>
|
|
371
|
+
<DropdownMenuTrigger asChild>
|
|
372
|
+
<ActionButton variant="icon">
|
|
373
|
+
<Icon type="heroicons" name="ellipsis-vertical" />
|
|
374
|
+
</ActionButton>
|
|
375
|
+
</DropdownMenuTrigger>
|
|
376
|
+
<DropdownMenuContent
|
|
377
|
+
{...args}
|
|
378
|
+
side="bottom" // controls the side (top, bottom, left, right)
|
|
379
|
+
align="start" // controls the alignment (start, center, end)
|
|
380
|
+
sideOffset={5} // offset from the side
|
|
381
|
+
alignOffset={0} // offset from the alignment
|
|
382
|
+
>
|
|
383
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
384
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
385
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
386
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
387
|
+
<DropdownMenuItem>Option Description</DropdownMenuItem>
|
|
388
|
+
</DropdownMenuContent>
|
|
389
|
+
</DropdownMenu>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
);
|
|
393
|
+
},
|
|
394
|
+
} satisfies StoryObj;
|