@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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
inset?: boolean | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
+
inset?: boolean | undefined;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const DropdownMenuShortcut: {
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<import("@radix-ui/react-dropdown-menu").DropdownMenuProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
dir?: ("ltr" | "rtl") | undefined;
|
|
11
|
+
open?: boolean | undefined;
|
|
12
|
+
defaultOpen?: boolean | undefined;
|
|
13
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
14
|
+
modal?: boolean | undefined;
|
|
15
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
export declare const Default: {
|
|
19
|
+
args: {};
|
|
20
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export declare const WithIcon: {
|
|
23
|
+
args: {};
|
|
24
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
export declare const WithLabel: {
|
|
27
|
+
args: {};
|
|
28
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
};
|
|
30
|
+
export declare const Checkboxes: {
|
|
31
|
+
args: {};
|
|
32
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
};
|
|
34
|
+
export declare const SubMenu: {
|
|
35
|
+
args: {};
|
|
36
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
};
|
|
38
|
+
export declare const OnIcon: {
|
|
39
|
+
args: {};
|
|
40
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
};
|
|
42
|
+
export declare const AsChild: {
|
|
43
|
+
args: {};
|
|
44
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
};
|
|
46
|
+
export declare const Position: {
|
|
47
|
+
args: {
|
|
48
|
+
side: string;
|
|
49
|
+
align: string;
|
|
50
|
+
sideOffset: number;
|
|
51
|
+
alignOffset: number;
|
|
52
|
+
};
|
|
53
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type TextProps = {
|
|
2
|
+
export type TextProps<T extends React.ElementType> = {
|
|
3
3
|
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitile1" | "subtitile2" | "subtitile3" | "subtitile4" | "subtitile5" | "subtitile6" | "body1" | "body2" | "body3" | "body4" | "small1" | "small2" | "small3" | "small4" | "small5" | "label1" | "label2" | "buttonL" | "buttonMS";
|
|
4
4
|
color?: "primary" | "secondary" | "success" | "tertiary" | "info" | "warning" | "error";
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
-
tag?:
|
|
7
|
+
tag?: T;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
id?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
} & React.ComponentProps<T>;
|
|
11
|
+
type TextComponent<T extends React.ElementType> = React.ForwardRefExoticComponent<TextProps<T> & React.RefAttributes<HTMLElement>>;
|
|
12
|
+
declare const ForwardedText: TextComponent<any>;
|
|
13
|
+
export default ForwardedText;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.ForwardRefExoticComponent<
|
|
4
|
+
component: React.ForwardRefExoticComponent<any>;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
|
9
9
|
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
10
|
-
|
|
11
|
-
color?: "primary" | "secondary" | "tertiary" | "success" | "info" | "warning" | "error" | undefined;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
className?: string | undefined;
|
|
14
|
-
tag?: keyof JSX.IntrinsicElements | undefined;
|
|
15
|
-
style?: React.CSSProperties | undefined;
|
|
16
|
-
id?: string | undefined;
|
|
17
|
-
ref?: React.LegacyRef<keyof JSX.IntrinsicElements | undefined> | undefined;
|
|
18
|
-
key?: React.Key | null | undefined;
|
|
10
|
+
[x: string]: any;
|
|
19
11
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
20
12
|
};
|
|
21
13
|
export default meta;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
16
|
+
import { cn } from "@/utils/cn";
|
|
17
|
+
import Icon from "../Icon/Icon";
|
|
18
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
19
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
20
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
21
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
22
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
23
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
24
|
+
const DropdownMenuSubTrigger = React.forwardRef((_a, ref) => {
|
|
25
|
+
var { className, inset, children } = _a, props = __rest(_a, ["className", "inset", "children"]);
|
|
26
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, Object.assign({ ref: ref, className: cn(
|
|
27
|
+
// "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-primary data-[state=open]:bg-primary",
|
|
28
|
+
"relative flex gap-3 cursor-pointer select-none box-border items-center py-4 pl-9 pr-4 typography-subtitile4 outline-none transition-colors data-[disabled]:pointer-events-none", "bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]", "active:opacity-75", "focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]", "data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]", inset && "pl-8", className) }, props, { children: [children, _jsx(Icon, { type: "heroicons", name: "chevron-right", className: "ml-auto h-4 w-4" })] })));
|
|
29
|
+
});
|
|
30
|
+
DropdownMenuSubTrigger.displayName =
|
|
31
|
+
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
32
|
+
const DropdownMenuSubContent = React.forwardRef((_a, ref) => {
|
|
33
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
34
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, Object.assign({ ref: ref, className: cn("z-50 min-w-[154px] overflow-hidden rounded-md bg-base-popup text-base-popup-foreground shadow-[var(--dropdown-menu-shadow)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className) }, props)));
|
|
35
|
+
});
|
|
36
|
+
DropdownMenuSubContent.displayName =
|
|
37
|
+
DropdownMenuPrimitive.SubContent.displayName;
|
|
38
|
+
const DropdownMenuContent = React.forwardRef((_a, ref) => {
|
|
39
|
+
var { className, sideOffset = 4 } = _a, props = __rest(_a, ["className", "sideOffset"]);
|
|
40
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, Object.assign({ ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[154px] overflow-hidden rounded-md bg-base-popup text-base-popup-foreground shadow-[0px_2px_24px_0px_rgba(145,_158,_171,_0.24)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className) }, props)) }));
|
|
41
|
+
});
|
|
42
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
43
|
+
const DropdownMenuItem = React.forwardRef((_a, ref) => {
|
|
44
|
+
var { className, inset } = _a, props = __rest(_a, ["className", "inset"]);
|
|
45
|
+
return (_jsx(DropdownMenuPrimitive.Item, Object.assign({ ref: ref, className: cn("relative flex gap-3 cursor-pointer select-none box-border items-center py-4 pl-9 pr-xxl typography-subtitile4 outline-none transition-colors data-[disabled]:pointer-events-none", "bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]", "active:opacity-75", "focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]", "data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]", inset && "pl-8", className) }, props)));
|
|
46
|
+
});
|
|
47
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
48
|
+
const DropdownMenuCheckboxItem = React.forwardRef((_a, ref) => {
|
|
49
|
+
var { className, children, checked } = _a, props = __rest(_a, ["className", "children", "checked"]);
|
|
50
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, Object.assign({ ref: ref, className: cn("relative flex gap-3 cursor-pointer select-none box-border items-center py-4 pl-9 pr-xxl typography-subtitile4 outline-none transition-colors data-[disabled]:pointer-events-none", "bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]", "active:opacity-75", "focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]", "data-[state='checked']:bg-[var(--dropdown-menu-selected-bg)] data-[state='checked']:text-[var(--dropdown-menu-selected-text)] data-[state='checked']:typography-subtitile5", "data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]", className), checked: checked }, props, { children: [_jsx("span", { className: "absolute left-4 flex items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Icon, { type: "heroicons", name: "check", className: "size-4" }) }) }), children] })));
|
|
51
|
+
});
|
|
52
|
+
DropdownMenuCheckboxItem.displayName =
|
|
53
|
+
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
54
|
+
const DropdownMenuRadioItem = React.forwardRef((_a, ref) => {
|
|
55
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
56
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, Object.assign({ ref: ref, className: cn("relative flex gap-3 cursor-pointer select-none box-border items-center py-4 pl-9 pr-xxl typography-subtitile4 outline-none transition-colors data-[disabled]:pointer-events-none", "bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]", "active:opacity-75", "focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]", "data-[state='checked']:bg-[var(--dropdown-menu-selected-bg)] data-[state='checked']:text-[var(--dropdown-menu-selected-text)] data-[state='checked']:typography-subtitile5", "data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]", className) }, props, { children: [_jsx("span", { className: "absolute left-4 flex items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Icon, { type: "heroicons", name: "circle", className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
57
|
+
});
|
|
58
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
59
|
+
const DropdownMenuLabel = React.forwardRef((_a, ref) => {
|
|
60
|
+
var { className, inset } = _a, props = __rest(_a, ["className", "inset"]);
|
|
61
|
+
return (_jsx(DropdownMenuPrimitive.Label, Object.assign({ ref: ref, className: cn("px-3 py-2 typography-small4 text-text-grey-medium", inset && "pl-8", className) }, props)));
|
|
62
|
+
});
|
|
63
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
64
|
+
const DropdownMenuSeparator = React.forwardRef((_a, ref) => {
|
|
65
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
66
|
+
return (_jsx(DropdownMenuPrimitive.Separator, Object.assign({ ref: ref, className: cn("-mx-2 my-2 h-px bg-[var(--dropdown-menu-seperator-bg)]", className) }, props)));
|
|
67
|
+
});
|
|
68
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
69
|
+
const DropdownMenuShortcut = (_a) => {
|
|
70
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
71
|
+
return (_jsx("span", Object.assign({ className: cn("ml-auto text-xs tracking-widest opacity-60", className) }, props)));
|
|
72
|
+
};
|
|
73
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
74
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "./DropdownMenu";
|
|
3
|
+
import Button from "../Button/Button";
|
|
4
|
+
import Icon from "../Icon/Icon";
|
|
5
|
+
import ActionButton from "../ActionButton/ActionButton";
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/DropdownMenu",
|
|
8
|
+
component: DropdownMenu,
|
|
9
|
+
// tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "fullscreen",
|
|
12
|
+
},
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
export const Default = {
|
|
19
|
+
args: {
|
|
20
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
21
|
+
// value: "Lorem Ipsum",
|
|
22
|
+
// fullwidth: true,
|
|
23
|
+
},
|
|
24
|
+
render: (args) => {
|
|
25
|
+
console.log("args ", args);
|
|
26
|
+
const props = Object.assign({}, args);
|
|
27
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { children: "Open" }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { disabled: true, children: "Option Description" }), _jsxs(DropdownMenuItem, { children: [_jsx(Icon, { type: "heroicons", name: "check", className: "size-4" }), "Option Description"] }), _jsx(DropdownMenuItem, { children: "Option Description" })] })] }) }) }));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const WithIcon = {
|
|
31
|
+
args: {
|
|
32
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
33
|
+
// value: "Lorem Ipsum",
|
|
34
|
+
// fullwidth: true,
|
|
35
|
+
},
|
|
36
|
+
render: (args) => {
|
|
37
|
+
console.log("args ", args);
|
|
38
|
+
const props = Object.assign({}, args);
|
|
39
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Open" }) }), _jsxs(DropdownMenuContent, { children: [_jsxs(DropdownMenuItem, { children: [_jsx(Icon, { type: "heroicons", name: "rocket-launch", className: "size-4" }), _jsx("span", { children: "Option Description" })] }), _jsxs(DropdownMenuItem, { children: [_jsx(Icon, { type: "heroicons", name: "rocket-launch", className: "size-4" }), _jsx("span", { children: "Option Description" })] }), _jsxs(DropdownMenuItem, { disabled: true, children: [_jsx(Icon, { type: "heroicons", name: "rocket-launch", className: "size-4" }), _jsx("span", { children: "Option Description" })] })] })] }) }) }));
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export const WithLabel = {
|
|
43
|
+
args: {
|
|
44
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
45
|
+
// value: "Lorem Ipsum",
|
|
46
|
+
// fullwidth: true,
|
|
47
|
+
},
|
|
48
|
+
render: (args) => {
|
|
49
|
+
console.log("args ", args);
|
|
50
|
+
const props = Object.assign({}, args);
|
|
51
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Open" }) }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { children: "Sort by" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" })] })] }) }) }));
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const Checkboxes = {
|
|
55
|
+
args: {
|
|
56
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
57
|
+
// value: "Lorem Ipsum",
|
|
58
|
+
// fullwidth: true,
|
|
59
|
+
},
|
|
60
|
+
render: (args) => {
|
|
61
|
+
console.log("args ", args);
|
|
62
|
+
const props = Object.assign({}, args);
|
|
63
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Open" }) }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuCheckboxItem, { children: "Option Description" }), _jsx(DropdownMenuCheckboxItem, { checked: true, children: "Option Description" }), _jsx(DropdownMenuCheckboxItem, { disabled: true, children: "Option Description" }), _jsx(DropdownMenuCheckboxItem, { checked: true, disabled: true, children: "Option Description" }), _jsxs(DropdownMenuCheckboxItem, { children: [_jsx(Icon, { type: "heroicons", name: "rocket-launch", className: "size-4" }), _jsx("span", { children: "Option Description" })] }), _jsxs(DropdownMenuCheckboxItem, { checked: true, children: [_jsx(Icon, { type: "heroicons", name: "rocket-launch", className: "size-4" }), _jsx("span", { children: "Option Description" })] }), _jsxs(DropdownMenuCheckboxItem, { disabled: true, children: [_jsx(Icon, { type: "heroicons", name: "rocket-launch", className: "size-4" }), _jsx("span", { children: "Option Description" })] }), _jsxs(DropdownMenuCheckboxItem, { checked: true, disabled: true, children: [_jsx(Icon, { type: "heroicons", name: "rocket-launch", className: "size-4" }), _jsx("span", { children: "Option Description" })] })] })] }) }) }));
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
export const SubMenu = {
|
|
67
|
+
args: {
|
|
68
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
69
|
+
// value: "Lorem Ipsum",
|
|
70
|
+
// fullwidth: true,
|
|
71
|
+
},
|
|
72
|
+
render: (args) => {
|
|
73
|
+
console.log("args ", args);
|
|
74
|
+
const props = Object.assign({}, args);
|
|
75
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { children: "Open" }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuLabel, { children: "My Account" }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { children: "Profile" }), _jsx(DropdownMenuItem, { children: "Billing" }), _jsx(DropdownMenuItem, { children: "Team" }), _jsx(DropdownMenuItem, { children: "Subscription" }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { children: _jsx("span", { children: "Invite users" }) }), _jsx(DropdownMenuPortal, { children: _jsxs(DropdownMenuSubContent, { children: [_jsx(DropdownMenuItem, { children: _jsx("span", { children: "Email" }) }), _jsx(DropdownMenuItem, { children: _jsx("span", { children: "Message" }) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { children: _jsx("span", { children: "More..." }) })] }) })] }), _jsx(DropdownMenuCheckboxItem, { children: "Panel" })] })] })] }) }) }));
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
export const OnIcon = {
|
|
79
|
+
args: {
|
|
80
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
81
|
+
// value: "Lorem Ipsum",
|
|
82
|
+
// fullwidth: true,
|
|
83
|
+
},
|
|
84
|
+
render: (args) => {
|
|
85
|
+
console.log("args ", args);
|
|
86
|
+
const props = Object.assign({}, args);
|
|
87
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { children: _jsx(Icon, { type: "heroicons", name: "ellipsis-vertical" }) }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" })] })] }) }) }));
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
export const AsChild = {
|
|
91
|
+
args: {
|
|
92
|
+
// DropdownMenu: "Lorem Ipsum",
|
|
93
|
+
// value: "Lorem Ipsum",
|
|
94
|
+
// fullwidth: true,
|
|
95
|
+
},
|
|
96
|
+
render: (args) => {
|
|
97
|
+
console.log("args ", args);
|
|
98
|
+
const props = Object.assign({}, args);
|
|
99
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(ActionButton, { variant: "icon", children: _jsx(Icon, { type: "heroicons", name: "ellipsis-vertical" }) }) }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" })] })] }) }) }));
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
export const Position = {
|
|
103
|
+
args: {
|
|
104
|
+
side: "bottom",
|
|
105
|
+
align: "center",
|
|
106
|
+
sideOffset: 5,
|
|
107
|
+
alignOffset: 0,
|
|
108
|
+
},
|
|
109
|
+
render: (args) => {
|
|
110
|
+
console.log("args ", args);
|
|
111
|
+
const props = Object.assign({}, args);
|
|
112
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx("div", { className: "flex flex-1 justify-center items-center space-x-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(ActionButton, { variant: "icon", children: _jsx(Icon, { type: "heroicons", name: "ellipsis-vertical" }) }) }), _jsxs(DropdownMenuContent, Object.assign({}, args, { side: "bottom" // controls the side (top, bottom, left, right)
|
|
113
|
+
, align: "start" // controls the alignment (start, center, end)
|
|
114
|
+
, sideOffset: 5, alignOffset: 0, children: [_jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" }), _jsx(DropdownMenuItem, { children: "Option Description" })] }))] }) }) }));
|
|
115
|
+
},
|
|
116
|
+
};
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
13
|
import { cn } from "@/utils/cn";
|
|
3
14
|
import { forwardRef } from "react";
|
|
@@ -15,8 +26,13 @@ const textVariants = cva(["text-foreground"], {
|
|
|
15
26
|
},
|
|
16
27
|
},
|
|
17
28
|
});
|
|
29
|
+
// montserrat: ["Montserrat", "sans-serif"],
|
|
30
|
+
// poppins: ["Poppins", "sans-serif"], font-montserrat, font-poppins
|
|
18
31
|
// TODO font, fontBold, elipt
|
|
19
|
-
const Text =
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
|
|
32
|
+
const Text = (_a, ref) => {
|
|
33
|
+
var { variant = "body1", tag: Tag = "p", children, className = "", color, style } = _a, props = __rest(_a, ["variant", "tag", "children", "className", "color", "style"]);
|
|
34
|
+
return (_jsx(Tag, Object.assign({ ref: ref, className: cn(`typography-${variant}`, textVariants({ color }), className), style: style }, props, { children: children })));
|
|
35
|
+
};
|
|
36
|
+
const ForwardedText = forwardRef(Text);
|
|
37
|
+
ForwardedText.displayName = "Text";
|
|
38
|
+
export default ForwardedText;
|