lecom-ui 5.2.12 → 5.2.13
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/README.md +1 -1
- package/dist/badge.js +26 -0
- package/dist/button-dropdown.js +117 -0
- package/dist/button.js +104 -0
- package/dist/calendar.js +62 -0
- package/dist/card.js +56 -0
- package/dist/checkbox.js +55 -0
- package/dist/collapse.js +60 -0
- package/dist/collapsible.js +7 -0
- package/dist/command.js +107 -0
- package/dist/data-table/data-table.js +490 -0
- package/dist/date-picker.js +92 -0
- package/dist/dialog.js +95 -0
- package/dist/dropdown-menu.js +138 -0
- package/dist/fonts/Montserrat-Bold.otf +0 -0
- package/dist/fonts/Montserrat-Medium.otf +0 -0
- package/dist/fonts/Montserrat-Regular.otf +0 -0
- package/dist/fonts/Roboto-Bold.otf +0 -0
- package/dist/fonts/Roboto-Light.otf +0 -0
- package/dist/fonts/Roboto-Medium.otf +0 -0
- package/dist/fonts/Roboto-Regular.otf +0 -0
- package/dist/form.js +102 -0
- package/dist/header.js +90 -0
- package/dist/hook/useDebounce.js +16 -0
- package/dist/icon-handler.js +72 -0
- package/dist/icons/brandModules.js +27 -0
- package/dist/icons/companyLogo.js +61 -0
- package/dist/icons/createUseAuxiliary.js +107 -0
- package/dist/icons/footerInfo.js +25 -0
- package/dist/icons/logo_lecom.svg.js +3 -0
- package/dist/icons/newUpdate.js +23 -0
- package/dist/icons/robertyRPA.js +30 -0
- package/dist/ilustrations/access_denied.js +252 -0
- package/dist/ilustrations/page_not_found.js +188 -0
- package/dist/input.js +42 -0
- package/dist/label.js +20 -0
- package/dist/modal.js +27 -0
- package/dist/pagination.js +474 -0
- package/dist/plugin/extend.js +78 -78
- package/dist/plugin/extend.ts +78 -0
- package/dist/plugin/fontFaces.js +172 -172
- package/dist/plugin/fontFaces.ts +172 -0
- package/dist/plugin/general.js +12 -12
- package/dist/plugin/general.ts +12 -0
- package/dist/plugin/pluginDev.cjs +5 -5
- package/dist/plugin/pluginDev.js +5 -0
- package/dist/plugin/pluginNext.cjs +5 -5
- package/dist/plugin/pluginNext.js +5 -0
- package/dist/plugin/pluginNextTurbo.cjs +5 -5
- package/dist/plugin/pluginVite.cjs +5 -5
- package/dist/plugin/pluginVite.js +5 -0
- package/dist/plugin/template.js +31 -31
- package/dist/plugin/template.ts +31 -0
- package/dist/plugin/typographies.js +152 -152
- package/dist/plugin/typographies.ts +152 -0
- package/dist/plugin/varsTheme.js +79 -79
- package/dist/plugin/varsTheme.ts +79 -0
- package/dist/plugin.cjs +298 -0
- package/dist/popover.js +24 -0
- package/dist/radio-group.js +74 -0
- package/dist/range-picker.js +99 -0
- package/dist/scroll-area.js +37 -0
- package/dist/search-bar.js +151 -0
- package/dist/select.js +156 -0
- package/dist/separator.js +24 -0
- package/dist/sheet.js +106 -0
- package/dist/sidebar.js +188 -0
- package/dist/skeleton.js +17 -0
- package/dist/slider.js +23 -0
- package/dist/status-screen.js +71 -0
- package/dist/switch.js +27 -0
- package/dist/table.js +83 -0
- package/dist/tabs.js +44 -0
- package/dist/tag.js +33 -0
- package/dist/textarea.js +22 -0
- package/dist/toast.js +105 -0
- package/dist/toaster.js +23 -0
- package/dist/tooltip.js +133 -0
- package/dist/use-toast.js +121 -0
- package/package.json +1 -1
package/dist/sidebar.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, forwardRef, useState, useEffect, Children, isValidElement, cloneElement, useContext } from 'react';
|
|
3
|
+
import { ReactSVG } from 'react-svg';
|
|
4
|
+
import { cn } from './lib/utils.js';
|
|
5
|
+
import { Skeleton } from './skeleton.js';
|
|
6
|
+
import { Tooltip, TooltipTrigger } from './tooltip.js';
|
|
7
|
+
|
|
8
|
+
const SideBarContext = createContext({
|
|
9
|
+
isCollapsed: false,
|
|
10
|
+
isLoading: false
|
|
11
|
+
});
|
|
12
|
+
function useSideBarContext() {
|
|
13
|
+
const context = useContext(SideBarContext);
|
|
14
|
+
if (!context) {
|
|
15
|
+
throw new Error("Erro ao renderizar SideBar.");
|
|
16
|
+
}
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
const SideBarProvider = ({
|
|
20
|
+
isCollapsed,
|
|
21
|
+
isLoading,
|
|
22
|
+
children
|
|
23
|
+
}) => {
|
|
24
|
+
return /* @__PURE__ */ jsx(SideBarContext.Provider, { value: { isCollapsed, isLoading }, children });
|
|
25
|
+
};
|
|
26
|
+
const Sidebar = forwardRef(
|
|
27
|
+
({
|
|
28
|
+
isCollapsed,
|
|
29
|
+
isLoading = false,
|
|
30
|
+
children,
|
|
31
|
+
className,
|
|
32
|
+
shouldHideOnResize = true
|
|
33
|
+
}, ref) => {
|
|
34
|
+
const [isHidden, setIsHidden] = useState(false);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const handleResize = () => {
|
|
37
|
+
if (shouldHideOnResize && window.innerWidth <= 768 && isCollapsed) {
|
|
38
|
+
setIsHidden(true);
|
|
39
|
+
} else {
|
|
40
|
+
setIsHidden(false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
window.addEventListener("resize", handleResize);
|
|
44
|
+
handleResize();
|
|
45
|
+
return () => {
|
|
46
|
+
window.removeEventListener("resize", handleResize);
|
|
47
|
+
};
|
|
48
|
+
}, [shouldHideOnResize, isCollapsed]);
|
|
49
|
+
return /* @__PURE__ */ jsx(SideBarProvider, { isCollapsed, isLoading, children: /* @__PURE__ */ jsx(
|
|
50
|
+
"aside",
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: cn(
|
|
54
|
+
`bg-white h-screen fixed left-0 top-[50px] z-[9998] shadow border-r-1 transition-all duration-200 ease-in-out`,
|
|
55
|
+
{
|
|
56
|
+
"w-[50px]": isCollapsed,
|
|
57
|
+
"w-[300px]": !isCollapsed,
|
|
58
|
+
hidden: isHidden
|
|
59
|
+
},
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
id: "sidebar",
|
|
63
|
+
children: /* @__PURE__ */ jsx(
|
|
64
|
+
"nav",
|
|
65
|
+
{
|
|
66
|
+
className: `flex h-auto pt-6 w-full items-center overflow-hidden`,
|
|
67
|
+
children: Children.map(children, (child) => {
|
|
68
|
+
if (isValidElement(child)) {
|
|
69
|
+
return cloneElement(child, {
|
|
70
|
+
isCollapsed,
|
|
71
|
+
isLoading
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
return child;
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
) });
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
Sidebar.displayName = "Sidebar";
|
|
84
|
+
const SidebarItem = forwardRef(
|
|
85
|
+
({ currentPath, menuItems = [], className, target, side }, ref) => {
|
|
86
|
+
const { isCollapsed, isLoading } = useSideBarContext();
|
|
87
|
+
const [selectedItem, setSelectedItem] = useState(() => currentPath);
|
|
88
|
+
return /* @__PURE__ */ jsx("ul", { className: cn(`flex flex-col w-full gap-2 items-center`), children: isLoading ? /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-2 w-full"), children: Array.from({ length: menuItems.length }, (_, index) => /* @__PURE__ */ jsx(
|
|
89
|
+
"li",
|
|
90
|
+
{
|
|
91
|
+
className: "flex items-center justify-center h-10 rounded-sm w-full",
|
|
92
|
+
children: /* @__PURE__ */ jsx(
|
|
93
|
+
Skeleton,
|
|
94
|
+
{
|
|
95
|
+
className: cn(
|
|
96
|
+
"relative flex justify-center items-center w-full h-10 overflow-hidden",
|
|
97
|
+
{
|
|
98
|
+
"m-2": !isCollapsed,
|
|
99
|
+
"m-1": isCollapsed
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
children: /* @__PURE__ */ jsx(
|
|
103
|
+
Skeleton,
|
|
104
|
+
{
|
|
105
|
+
className: cn(
|
|
106
|
+
"absolut h-6 rounded-sm w-11/12 animate-loading drop-shadow-2xl",
|
|
107
|
+
{
|
|
108
|
+
"m-2": !isCollapsed,
|
|
109
|
+
"m-1": isCollapsed
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
},
|
|
117
|
+
index
|
|
118
|
+
)) }) : menuItems.map((item, index) => {
|
|
119
|
+
const IconComponent = item.icon;
|
|
120
|
+
return /* @__PURE__ */ jsx(
|
|
121
|
+
"li",
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
className: cn(
|
|
125
|
+
`flex items-center justify-center text-gray-500 rounded-sm transition-colors duration-200 h-10 leading-8 px-2`,
|
|
126
|
+
{
|
|
127
|
+
"bg-dodgerblue hover:bg-electricblue": selectedItem === item.href,
|
|
128
|
+
"hover:bg-gray-scale12": selectedItem !== item.href
|
|
129
|
+
},
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
onClick: () => setSelectedItem(item.href),
|
|
133
|
+
style: { width: "calc(100% - 10px)" },
|
|
134
|
+
children: isCollapsed ? /* @__PURE__ */ jsx(Tooltip, { title: item.label, side, className: "ml-3", children: /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
135
|
+
"a",
|
|
136
|
+
{
|
|
137
|
+
className: cn(
|
|
138
|
+
`flex items-center w-full font-semibold leading-4`,
|
|
139
|
+
{
|
|
140
|
+
"text-letterblue": selectedItem === item.href,
|
|
141
|
+
"text-gray-scale60 hover:text-black": selectedItem !== item.href
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
href: item.href,
|
|
145
|
+
"aria-label": item.label,
|
|
146
|
+
target,
|
|
147
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex items-center w-6 justify-center", children: typeof item.icon === "string" ? /* @__PURE__ */ jsx(ReactSVG, { src: item.icon, className: "w-6 h-6" }) : /* @__PURE__ */ jsx(IconComponent, { className: "w-6 h-6" }) })
|
|
148
|
+
}
|
|
149
|
+
) }) }) : /* @__PURE__ */ jsxs(
|
|
150
|
+
"a",
|
|
151
|
+
{
|
|
152
|
+
className: cn(
|
|
153
|
+
`flex items-center w-full font-semibold leading-4`,
|
|
154
|
+
{
|
|
155
|
+
"text-letterblue": selectedItem === item.href,
|
|
156
|
+
"text-gray-scale60 hover:text-black": selectedItem !== item.href
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
href: item.href,
|
|
160
|
+
"aria-label": item.label,
|
|
161
|
+
target,
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center w-6 justify-center", children: typeof item.icon === "string" ? /* @__PURE__ */ jsx(ReactSVG, { src: item.icon, className: "w-6 h-6" }) : /* @__PURE__ */ jsx(IconComponent, { className: "w-6 h-6" }) }),
|
|
164
|
+
/* @__PURE__ */ jsx(
|
|
165
|
+
"span",
|
|
166
|
+
{
|
|
167
|
+
className: cn(
|
|
168
|
+
"ml-6 transition-opacity duration-1 ease-in-out text-[#7A7A7A]",
|
|
169
|
+
{
|
|
170
|
+
"opacity-0 duration-75": isCollapsed,
|
|
171
|
+
"opacity-100 duration-500": !isCollapsed
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
children: item.label
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
},
|
|
181
|
+
index
|
|
182
|
+
);
|
|
183
|
+
}) });
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
SidebarItem.displayName = "SidebarItem";
|
|
187
|
+
|
|
188
|
+
export { SideBarProvider, Sidebar, SidebarItem };
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from './lib/utils.js';
|
|
3
|
+
|
|
4
|
+
function Skeleton({
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: cn("animate-pulse rounded-md bg-primary/10", className),
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Skeleton };
|
package/dist/slider.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
4
|
+
import { cn } from './lib/utils.js';
|
|
5
|
+
|
|
6
|
+
const Slider = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7
|
+
SliderPrimitive.Root,
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
className: cn(
|
|
11
|
+
"relative flex w-full touch-none select-none items-center",
|
|
12
|
+
className
|
|
13
|
+
),
|
|
14
|
+
...props,
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
17
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
));
|
|
21
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
22
|
+
|
|
23
|
+
export { Slider };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { LogOutIcon } from 'lucide-react';
|
|
3
|
+
import { AccessDenied } from './ilustrations/access_denied.js';
|
|
4
|
+
import { PageNotFound } from './ilustrations/page_not_found.js';
|
|
5
|
+
import { cn } from './lib/utils.js';
|
|
6
|
+
import { Button } from './button.js';
|
|
7
|
+
import { IconHandler } from './icon-handler.js';
|
|
8
|
+
|
|
9
|
+
const StatusScreen = ({
|
|
10
|
+
imageUrl = "",
|
|
11
|
+
title,
|
|
12
|
+
paragraf_one,
|
|
13
|
+
paragraf_two,
|
|
14
|
+
type,
|
|
15
|
+
buttonText = "",
|
|
16
|
+
buttonIcon,
|
|
17
|
+
onActionClick,
|
|
18
|
+
className,
|
|
19
|
+
children
|
|
20
|
+
}) => {
|
|
21
|
+
const defaultImage = {
|
|
22
|
+
"403": {
|
|
23
|
+
imageUrl: AccessDenied
|
|
24
|
+
},
|
|
25
|
+
"404": {
|
|
26
|
+
imageUrl: PageNotFound
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const errorMessage = type ? defaultImage[type] : void 0;
|
|
30
|
+
const buttonBack = () => /* @__PURE__ */ jsxs(
|
|
31
|
+
Button,
|
|
32
|
+
{
|
|
33
|
+
className: "flex gap-2 mt-8 p-6 bg-buttonblue text-white rounded transition duration-300 ease-in-out hover:brightness-150 hover:delay-150",
|
|
34
|
+
onClick: onActionClick,
|
|
35
|
+
children: [
|
|
36
|
+
buttonIcon ? buttonIcon : /* @__PURE__ */ jsx(LogOutIcon, { className: "transform rotate-180 w-5 h-5" }),
|
|
37
|
+
/* @__PURE__ */ jsx("span", { className: "text-[18px]", children: buttonText })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: cn(
|
|
45
|
+
"flex flex-col justify-center items-center gap-10 bg-white pt-[calc(75px+59px)] max-h-full max-w-full",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
children: [
|
|
49
|
+
!imageUrl && errorMessage && errorMessage.imageUrl ? /* @__PURE__ */ jsx(
|
|
50
|
+
IconHandler,
|
|
51
|
+
{
|
|
52
|
+
icon: errorMessage.imageUrl,
|
|
53
|
+
className: "w-auto h-full",
|
|
54
|
+
width: "600px",
|
|
55
|
+
height: "550px"
|
|
56
|
+
}
|
|
57
|
+
) : imageUrl,
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center w-full max-w-8xl text-gray-scale29 font-normal", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold", children: title }),
|
|
60
|
+
/* @__PURE__ */ jsx("p", { className: "mt-4 text-[20px] flex flex-wrap", children: paragraf_one }),
|
|
61
|
+
paragraf_two !== "" && /* @__PURE__ */ jsx("p", { className: "text-[20px] flex flex-wrap", children: paragraf_two }),
|
|
62
|
+
type && (type === "403" || type === "404") && buttonBack(),
|
|
63
|
+
children
|
|
64
|
+
] })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
StatusScreen.displayName = "StatusScreen";
|
|
70
|
+
|
|
71
|
+
export { StatusScreen };
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
4
|
+
import { cn } from './lib/utils.js';
|
|
5
|
+
|
|
6
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
|
+
SwitchPrimitives.Root,
|
|
8
|
+
{
|
|
9
|
+
className: cn(
|
|
10
|
+
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
...props,
|
|
14
|
+
ref,
|
|
15
|
+
children: /* @__PURE__ */ jsx(
|
|
16
|
+
SwitchPrimitives.Thumb,
|
|
17
|
+
{
|
|
18
|
+
className: cn(
|
|
19
|
+
"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
));
|
|
25
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
26
|
+
|
|
27
|
+
export { Switch };
|
package/dist/table.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from './lib/utils.js';
|
|
4
|
+
|
|
5
|
+
const Table = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto scrollbar-thin", children: /* @__PURE__ */ jsx(
|
|
6
|
+
"table",
|
|
7
|
+
{
|
|
8
|
+
ref,
|
|
9
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
10
|
+
...props
|
|
11
|
+
}
|
|
12
|
+
) }));
|
|
13
|
+
Table.displayName = "Table";
|
|
14
|
+
const TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
15
|
+
TableHeader.displayName = "TableHeader";
|
|
16
|
+
const TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
17
|
+
"tbody",
|
|
18
|
+
{
|
|
19
|
+
ref,
|
|
20
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
));
|
|
24
|
+
TableBody.displayName = "TableBody";
|
|
25
|
+
const TableFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
26
|
+
"tfoot",
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
className: cn(
|
|
30
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
));
|
|
36
|
+
TableFooter.displayName = "TableFooter";
|
|
37
|
+
const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
38
|
+
"tr",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: cn(
|
|
42
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
));
|
|
48
|
+
TableRow.displayName = "TableRow";
|
|
49
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
50
|
+
"th",
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: cn(
|
|
54
|
+
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
));
|
|
60
|
+
TableHead.displayName = "TableHead";
|
|
61
|
+
const TableCell = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
62
|
+
"td",
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
className: cn(
|
|
66
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
TableCell.displayName = "TableCell";
|
|
73
|
+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
74
|
+
"caption",
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
78
|
+
...props
|
|
79
|
+
}
|
|
80
|
+
));
|
|
81
|
+
TableCaption.displayName = "TableCaption";
|
|
82
|
+
|
|
83
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
package/dist/tabs.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
import { cn } from './lib/utils.js';
|
|
5
|
+
|
|
6
|
+
const Tabs = TabsPrimitive.Root;
|
|
7
|
+
const TabsList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8
|
+
TabsPrimitive.List,
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: cn(
|
|
12
|
+
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
13
|
+
className
|
|
14
|
+
),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
));
|
|
18
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
19
|
+
const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
20
|
+
TabsPrimitive.Trigger,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: cn(
|
|
24
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
));
|
|
30
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
31
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
32
|
+
TabsPrimitive.Content,
|
|
33
|
+
{
|
|
34
|
+
ref,
|
|
35
|
+
className: cn(
|
|
36
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
37
|
+
className
|
|
38
|
+
),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
));
|
|
42
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
43
|
+
|
|
44
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
package/dist/tag.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { cn } from './lib/utils.js';
|
|
4
|
+
|
|
5
|
+
const tagVariants = cva(
|
|
6
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "border-default/30 bg-default/10 text-default",
|
|
11
|
+
magenta: "border-magenta/30 bg-magenta/10 text-magenta",
|
|
12
|
+
red: "border-red/30 bg-red/10 text-red",
|
|
13
|
+
volcano: "border-volcano/30 bg-volcano/10 text-volcano",
|
|
14
|
+
orange: "border-orange/30 bg-orange/10 text-orange",
|
|
15
|
+
gold: "border-gold/30 bg-gold/10 text-gold",
|
|
16
|
+
lime: "border-lime/30 bg-lime/10 text-lime",
|
|
17
|
+
green: "border-green/30 bg-green/10 text-green",
|
|
18
|
+
cyan: "border-cyan/30 bg-cyan/10 text-cyan",
|
|
19
|
+
blue: "border-blue/30 bg-blue/10 text-blue",
|
|
20
|
+
geekblue: "border-geekblue/30 bg-geekblue/10 text-geekblue",
|
|
21
|
+
purple: "border-purple/30 bg-purple/10 text-purple"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
function Tag({ className, variant, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx("div", { className: cn(tagVariants({ variant }), className), ...props });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { Tag, tagVariants };
|
package/dist/textarea.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from './lib/utils.js';
|
|
4
|
+
|
|
5
|
+
const Textarea = React.forwardRef(
|
|
6
|
+
({ className, ...props }, ref) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"textarea",
|
|
9
|
+
{
|
|
10
|
+
className: cn(
|
|
11
|
+
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
12
|
+
className
|
|
13
|
+
),
|
|
14
|
+
ref,
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
Textarea.displayName = "Textarea";
|
|
21
|
+
|
|
22
|
+
export { Textarea };
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { XIcon } from 'lucide-react';
|
|
6
|
+
import { cn } from './lib/utils.js';
|
|
7
|
+
|
|
8
|
+
const ToastProvider = ({ ...props }) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(ToastPrimitives.Provider, { ...props });
|
|
10
|
+
};
|
|
11
|
+
ToastProvider.displayName = ToastPrimitives.Provider.displayName;
|
|
12
|
+
const ToastViewport = React.forwardRef(({ className, swipeDirectionY = "bottom", swipeDirectionX = "left", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
13
|
+
ToastPrimitives.Viewport,
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
className: cn(
|
|
17
|
+
"fixed top-0 z-[9998] flex max-h-screen w-full flex-col-reverse p-4 sm:flex-col md:max-w-[420px]",
|
|
18
|
+
{
|
|
19
|
+
"sm:bottom-4 sm:left-2 sm:top-auto": swipeDirectionX === "left" && swipeDirectionY === "bottom",
|
|
20
|
+
"sm:top-2 sm:left-2 sm:bottom-auto": swipeDirectionX === "left" && swipeDirectionY === "top",
|
|
21
|
+
"sm:bottom-4 sm:right-2 sm:top-auto": swipeDirectionX === "right" && swipeDirectionY === "bottom",
|
|
22
|
+
"sm:top-2 sm:right-2 sm:bottom-auto": swipeDirectionX === "right" && swipeDirectionY === "top"
|
|
23
|
+
},
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
));
|
|
29
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
30
|
+
const toastVariants = cva(
|
|
31
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
variant: {
|
|
35
|
+
default: "border bg-background text-foreground",
|
|
36
|
+
destructive: "destructive group border-red-dark bg-red-dark text-destructive-foreground",
|
|
37
|
+
success: "success group border-brand-green-foreground bg-brand-green text-neutral-50",
|
|
38
|
+
info: "info group border-blue-dark bg-blue-dark text-neutral-50",
|
|
39
|
+
alert: "alert group border-yellow-dark bg-yellow-dark text-neutral-50"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
variant: "default"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const Toast = React.forwardRef(({ className, variant, ...props }, ref) => {
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
ToastPrimitives.Root,
|
|
50
|
+
{
|
|
51
|
+
ref,
|
|
52
|
+
className: cn(toastVariants({ variant }), className),
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
58
|
+
const ToastAction = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
59
|
+
ToastPrimitives.Action,
|
|
60
|
+
{
|
|
61
|
+
ref,
|
|
62
|
+
className: cn(
|
|
63
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
));
|
|
69
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
70
|
+
const ToastClose = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
71
|
+
ToastPrimitives.Close,
|
|
72
|
+
{
|
|
73
|
+
"aria-label": "Close",
|
|
74
|
+
ref,
|
|
75
|
+
className: cn(
|
|
76
|
+
"absolute right-1 top-1 rounded-md p-1 text-white opacity-80 transition-opacity focus:outline-none focus:ring-transparent hover:opacity-100",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
"toast-close": "T",
|
|
80
|
+
...props,
|
|
81
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "h-4 w-4", strokeWidth: "3" })
|
|
82
|
+
}
|
|
83
|
+
));
|
|
84
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
85
|
+
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
86
|
+
ToastPrimitives.Title,
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
className: cn("text-base font-semibold [&+div]:text-xs", className),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
));
|
|
93
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
94
|
+
const ToastDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
95
|
+
ToastPrimitives.Description,
|
|
96
|
+
{
|
|
97
|
+
ref,
|
|
98
|
+
style: { fontSize: "14px" },
|
|
99
|
+
className: cn("opacity-90", className),
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
));
|
|
103
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
104
|
+
|
|
105
|
+
export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport };
|
package/dist/toaster.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from './lib/utils.js';
|
|
3
|
+
import { ToastProvider, Toast, ToastTitle, ToastDescription, ToastClose, ToastViewport } from './toast.js';
|
|
4
|
+
import { useToast } from './use-toast.js';
|
|
5
|
+
|
|
6
|
+
function Toaster({ swipeDirectionY = "bottom", swipeDirectionX = "left" }) {
|
|
7
|
+
const { toasts } = useToast();
|
|
8
|
+
return /* @__PURE__ */ jsxs(ToastProvider, { children: [
|
|
9
|
+
toasts.map(function({ id, title, description, action, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsxs(Toast, { ...props, children: [
|
|
11
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-1", children: [
|
|
12
|
+
title && /* @__PURE__ */ jsx(ToastTitle, { children: title }),
|
|
13
|
+
description && /* @__PURE__ */ jsx(ToastDescription, { className: cn({ "px-1 py-1 min-w-full": !title }), children: description })
|
|
14
|
+
] }),
|
|
15
|
+
action,
|
|
16
|
+
/* @__PURE__ */ jsx(ToastClose, {})
|
|
17
|
+
] }, id);
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ jsx(ToastViewport, { swipeDirectionX, swipeDirectionY })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { Toaster };
|