@phsa.tec/design-system-react 0.1.6 → 0.1.8
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 +390 -209
- package/dist/index.d.mts +485 -0
- package/dist/index.d.ts +485 -0
- package/dist/index.js +4259 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4186 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +46 -6
- package/.eslintrc.json +0 -7
- package/.github/workflows/deploy-storybook.yml +0 -75
- package/.storybook/main.ts +0 -16
- package/.storybook/preview.ts +0 -15
- package/components.json +0 -21
- package/jest.config.ts +0 -25
- package/next.config.ts +0 -7
- package/postcss.config.mjs +0 -8
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/window.svg +0 -1
- package/src/app/columns.tsx +0 -178
- package/src/app/favicon.ico +0 -0
- package/src/app/fonts/GeistMonoVF.woff +0 -0
- package/src/app/fonts/GeistVF.woff +0 -0
- package/src/app/globals.css +0 -94
- package/src/app/layout.tsx +0 -35
- package/src/app/page.tsx +0 -7
- package/src/components/actions/AlertDialog/AlertDialog.tsx +0 -45
- package/src/components/actions/AlertDialog/alert-dialog.stories.tsx +0 -21
- package/src/components/actions/AlertDialog/index.ts +0 -1
- package/src/components/actions/Button/Button.stories.ts +0 -38
- package/src/components/actions/Button/Button.tsx +0 -23
- package/src/components/actions/Button/index.ts +0 -1
- package/src/components/actions/Collapsible/index.ts +0 -1
- package/src/components/actions/Dialog/Dialog.stories.tsx +0 -70
- package/src/components/actions/Dialog/Dialog.tsx +0 -87
- package/src/components/actions/Dialog/components/DialogWithActions/index.tsx +0 -40
- package/src/components/actions/Dialog/index.ts +0 -1
- package/src/components/actions/Steps/Steps.stories.tsx +0 -25
- package/src/components/actions/Steps/Steps.tsx +0 -51
- package/src/components/actions/Steps/index.ts +0 -1
- package/src/components/actions/index.ts +0 -5
- package/src/components/dataDisplay/Avatar/Avatar.stories.tsx +0 -22
- package/src/components/dataDisplay/Avatar/Avatar.tsx +0 -21
- package/src/components/dataDisplay/Avatar/index.ts +0 -2
- package/src/components/dataDisplay/Badge/Badge.stories.tsx +0 -36
- package/src/components/dataDisplay/Badge/index.ts +0 -1
- package/src/components/dataDisplay/Card/Card.stories.tsx +0 -24
- package/src/components/dataDisplay/Card/Card.tsx +0 -34
- package/src/components/dataDisplay/Card/index.ts +0 -1
- package/src/components/dataDisplay/DataPairList/DataPairList.tsx +0 -56
- package/src/components/dataDisplay/DataPairList/data-pair-list.stories.tsx +0 -87
- package/src/components/dataDisplay/DataPairList/index.ts +0 -2
- package/src/components/dataDisplay/DataPairList/types.ts +0 -10
- package/src/components/dataDisplay/DropDownMenu/index.ts +0 -1
- package/src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx +0 -6
- package/src/components/dataDisplay/ErrorMessage/index.ts +0 -1
- package/src/components/dataDisplay/Icon/Icon.stories.tsx +0 -21
- package/src/components/dataDisplay/Icon/Icon.tsx +0 -47
- package/src/components/dataDisplay/Icon/index.ts +0 -1
- package/src/components/dataDisplay/Icon/types.ts +0 -6
- package/src/components/dataDisplay/Label/Label.stories.tsx +0 -21
- package/src/components/dataDisplay/Label/Label.tsx +0 -10
- package/src/components/dataDisplay/Label/index.ts +0 -1
- package/src/components/dataDisplay/Table/Table.tsx +0 -173
- package/src/components/dataDisplay/Table/columns.tsx +0 -223
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx +0 -72
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx +0 -91
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx +0 -17
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx +0 -58
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table.stories.tsx +0 -118
- package/src/components/dataDisplay/Table/components/DynamicTable/index.tsx +0 -136
- package/src/components/dataDisplay/Table/components/DynamicTable/types.ts +0 -43
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-column-header.tsx +0 -71
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-faceted-filter.tsx +0 -147
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-pagination.tsx +0 -97
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-row-actions.tsx +0 -78
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-toolbar.tsx +0 -60
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-view-options.tsx +0 -59
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table.tsx +0 -145
- package/src/components/dataDisplay/Table/custom/CustomTable/data.ts +0 -71
- package/src/components/dataDisplay/Table/custom/CustomTable/index.tsx +0 -34
- package/src/components/dataDisplay/Table/custom/CustomTable/schema.ts +0 -11
- package/src/components/dataDisplay/Table/index.ts +0 -2
- package/src/components/dataDisplay/Table/table.stories.tsx +0 -147
- package/src/components/dataDisplay/Table/types.ts +0 -15
- package/src/components/dataDisplay/Tabs/Tabs.stories.tsx +0 -34
- package/src/components/dataDisplay/Tabs/Tabs.tsx +0 -53
- package/src/components/dataDisplay/Tabs/index.ts +0 -1
- package/src/components/dataDisplay/Text/Text.stories.tsx +0 -66
- package/src/components/dataDisplay/Text/Text.tsx +0 -56
- package/src/components/dataDisplay/Text/index.ts +0 -1
- package/src/components/dataDisplay/index.ts +0 -8
- package/src/components/dataInput/Input/components/Input/Input.stories.tsx +0 -99
- package/src/components/dataInput/Input/components/Input/InputBase.tsx +0 -50
- package/src/components/dataInput/Input/components/Input/__tests__/input.test.tsx +0 -38
- package/src/components/dataInput/Input/components/Input/index.tsx +0 -48
- package/src/components/dataInput/Input/components/Input/types.ts +0 -15
- package/src/components/dataInput/Input/components/InputBase/index.tsx +0 -31
- package/src/components/dataInput/Input/components/MaskInput/__tests__/mask-input.test.tsx +0 -77
- package/src/components/dataInput/Input/components/MaskInput/index.ts +0 -1
- package/src/components/dataInput/Input/components/MaskInput/mask-input.stories.tsx +0 -85
- package/src/components/dataInput/Input/components/MaskInput/mask-input.tsx +0 -73
- package/src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx +0 -105
- package/src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx +0 -100
- package/src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx +0 -35
- package/src/components/dataInput/Input/components/MultipleInput/MultipleNumberInput.tsx +0 -35
- package/src/components/dataInput/Input/components/MultipleInput/__tests__/multiple-input.test.tsx +0 -152
- package/src/components/dataInput/Input/components/MultipleInput/index.ts +0 -2
- package/src/components/dataInput/Input/components/MultipleInput/multiple-input.stories.tsx +0 -96
- package/src/components/dataInput/Input/components/NumberInput/__tests__/number-input.test.tsx +0 -175
- package/src/components/dataInput/Input/components/NumberInput/index.ts +0 -1
- package/src/components/dataInput/Input/components/NumberInput/number-input.stories.tsx +0 -76
- package/src/components/dataInput/Input/components/NumberInput/number-input.tsx +0 -70
- package/src/components/dataInput/Input/index.ts +0 -4
- package/src/components/dataInput/Select/MultiSelect/MultiSelect.stories.tsx +0 -119
- package/src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx +0 -135
- package/src/components/dataInput/Select/MultiSelect/index.tsx +0 -75
- package/src/components/dataInput/Select/Select.stories.tsx +0 -61
- package/src/components/dataInput/Select/Select.tsx +0 -73
- package/src/components/dataInput/Select/SelectBase.tsx +0 -58
- package/src/components/dataInput/Select/index.ts +0 -2
- package/src/components/dataInput/Switch/Switch.stories.tsx +0 -75
- package/src/components/dataInput/Switch/Switch.tsx +0 -52
- package/src/components/dataInput/Switch/index.ts +0 -1
- package/src/components/dataInput/checkbox/Checkbox.tsx +0 -57
- package/src/components/dataInput/checkbox/Checkbox_old.tsx +0 -58
- package/src/components/dataInput/checkbox/Checkout.stories.tsx +0 -62
- package/src/components/dataInput/checkbox/index.ts +0 -1
- package/src/components/dataInput/form/Form.tsx +0 -47
- package/src/components/dataInput/form/index.ts +0 -3
- package/src/components/dataInput/index.ts +0 -5
- package/src/components/feedback/ErrorLabel/index.tsx +0 -24
- package/src/components/feedback/Spinner/index.ts +0 -1
- package/src/components/feedback/Toast/Toast.stories.tsx +0 -45
- package/src/components/feedback/Toast/index.ts +0 -2
- package/src/components/feedback/index.ts +0 -2
- package/src/components/index.ts +0 -6
- package/src/components/layout/Crud/components/Table/index.tsx +0 -183
- package/src/components/layout/Crud/components/Table/types.ts +0 -15
- package/src/components/layout/Crud/crud.stories.tsx +0 -317
- package/src/components/layout/Crud/hook/useCrudLayout/index.tsx +0 -94
- package/src/components/layout/Crud/hook/useRequest/index.tsx +0 -156
- package/src/components/layout/Crud/index.tsx +0 -295
- package/src/components/layout/Crud/store/CrudLayoutStore.ts +0 -75
- package/src/components/layout/Crud/types.ts +0 -14
- package/src/components/layout/Drawer/CustomDrawer/index.tsx +0 -33
- package/src/components/layout/Drawer/Drawer.stories.tsx +0 -80
- package/src/components/layout/Drawer/index.ts +0 -2
- package/src/components/layout/PageLayout/PageLayout.stories.tsx +0 -42
- package/src/components/layout/PageLayout/index.tsx +0 -28
- package/src/components/layout/Separator/index.ts +0 -1
- package/src/components/layout/Sheet/Sheet.stories.tsx +0 -28
- package/src/components/layout/Sheet/Sheet.tsx +0 -22
- package/src/components/layout/Sheet/index.ts +0 -1
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -116
- package/src/components/layout/Sidebar/Sidebar.tsx +0 -50
- package/src/components/layout/Sidebar/components/app-sidebar.tsx +0 -203
- package/src/components/layout/Sidebar/components/footer-sidebar.tsx +0 -17
- package/src/components/layout/Sidebar/components/header-sidebar.tsx +0 -90
- package/src/components/layout/Sidebar/components/menus.tsx +0 -55
- package/src/components/layout/Sidebar/components/nav-projects.tsx +0 -88
- package/src/components/layout/Sidebar/components/nav-user.tsx +0 -114
- package/src/components/layout/Sidebar/components/team-switcher.tsx +0 -85
- package/src/components/layout/Sidebar/index.ts +0 -2
- package/src/components/layout/Sidebar/provider/index.tsx +0 -51
- package/src/components/layout/Tabs/Tabs.tsx +0 -51
- package/src/components/layout/Tabs/index.ts +0 -1
- package/src/components/layout/Tabs/tabs.stories.tsx +0 -57
- package/src/components/layout/index.ts +0 -6
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +0 -66
- package/src/components/navigation/Breadcrumbs/index.ts +0 -2
- package/src/components/navigation/index.ts +0 -1
- package/src/components/ui/alert-dialog.tsx +0 -141
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/avatar.tsx +0 -50
- package/src/components/ui/badge.tsx +0 -40
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button.tsx +0 -57
- package/src/components/ui/card.tsx +0 -83
- package/src/components/ui/checkbox.tsx +0 -34
- package/src/components/ui/collapsible.tsx +0 -11
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/dialog.tsx +0 -124
- package/src/components/ui/drawer.tsx +0 -117
- package/src/components/ui/dropdown-menu.tsx +0 -201
- package/src/components/ui/form.tsx +0 -179
- package/src/components/ui/input.tsx +0 -24
- package/src/components/ui/label.tsx +0 -30
- package/src/components/ui/popover.tsx +0 -33
- package/src/components/ui/select.tsx +0 -161
- package/src/components/ui/separator.tsx +0 -31
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -763
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/sonner.tsx +0 -31
- package/src/components/ui/spinner.tsx +0 -54
- package/src/components/ui/switch.tsx +0 -33
- package/src/components/ui/table.tsx +0 -120
- package/src/components/ui/tabs.tsx +0 -55
- package/src/components/ui/toast.tsx +0 -130
- package/src/components/ui/toaster.tsx +0 -35
- package/src/components/ui/tooltip.tsx +0 -32
- package/src/hooks/use-conditional-controller.tsx +0 -35
- package/src/hooks/use-mask.tsx +0 -116
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-toast.ts +0 -191
- package/src/index.ts +0 -1
- package/src/introduction.mdx +0 -132
- package/src/lib/utils.ts +0 -6
- package/tailwind.config.ts +0 -83
- package/tsconfig.json +0 -27
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,4186 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
22
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
23
|
+
}) : x)(function(x) {
|
|
24
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
25
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
+
});
|
|
27
|
+
var __objRest = (source, exclude) => {
|
|
28
|
+
var target = {};
|
|
29
|
+
for (var prop in source)
|
|
30
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
if (source != null && __getOwnPropSymbols)
|
|
33
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
34
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
35
|
+
target[prop] = source[prop];
|
|
36
|
+
}
|
|
37
|
+
return target;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/components/dataDisplay/Table/components/DynamicTable/index.tsx
|
|
41
|
+
import * as React5 from "react";
|
|
42
|
+
import {
|
|
43
|
+
flexRender,
|
|
44
|
+
getCoreRowModel,
|
|
45
|
+
getSortedRowModel,
|
|
46
|
+
getPaginationRowModel,
|
|
47
|
+
useReactTable
|
|
48
|
+
} from "@tanstack/react-table";
|
|
49
|
+
|
|
50
|
+
// src/components/ui/table.tsx
|
|
51
|
+
import * as React from "react";
|
|
52
|
+
|
|
53
|
+
// src/lib/utils.ts
|
|
54
|
+
import { clsx } from "clsx";
|
|
55
|
+
import { twMerge } from "tailwind-merge";
|
|
56
|
+
function cn(...inputs) {
|
|
57
|
+
return twMerge(clsx(inputs));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/components/ui/table.tsx
|
|
61
|
+
import { jsx } from "react/jsx-runtime";
|
|
62
|
+
var Table = React.forwardRef((_a, ref) => {
|
|
63
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
64
|
+
return /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
65
|
+
"table",
|
|
66
|
+
__spreadValues({
|
|
67
|
+
ref,
|
|
68
|
+
className: cn("w-full caption-bottom text-sm", className)
|
|
69
|
+
}, props)
|
|
70
|
+
) });
|
|
71
|
+
});
|
|
72
|
+
Table.displayName = "Table";
|
|
73
|
+
var TableHeader = React.forwardRef((_a, ref) => {
|
|
74
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
75
|
+
return /* @__PURE__ */ jsx("thead", __spreadValues({ ref, className: cn("[&_tr]:border-b", className) }, props));
|
|
76
|
+
});
|
|
77
|
+
TableHeader.displayName = "TableHeader";
|
|
78
|
+
var TableBody = React.forwardRef((_a, ref) => {
|
|
79
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
"tbody",
|
|
82
|
+
__spreadValues({
|
|
83
|
+
ref,
|
|
84
|
+
className: cn("[&_tr:last-child]:border-0", className)
|
|
85
|
+
}, props)
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
TableBody.displayName = "TableBody";
|
|
89
|
+
var TableFooter = React.forwardRef((_a, ref) => {
|
|
90
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
91
|
+
return /* @__PURE__ */ jsx(
|
|
92
|
+
"tfoot",
|
|
93
|
+
__spreadValues({
|
|
94
|
+
ref,
|
|
95
|
+
className: cn(
|
|
96
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
97
|
+
className
|
|
98
|
+
)
|
|
99
|
+
}, props)
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
TableFooter.displayName = "TableFooter";
|
|
103
|
+
var TableRow = React.forwardRef((_a, ref) => {
|
|
104
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
"tr",
|
|
107
|
+
__spreadValues({
|
|
108
|
+
ref,
|
|
109
|
+
className: cn(
|
|
110
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
111
|
+
className
|
|
112
|
+
)
|
|
113
|
+
}, props)
|
|
114
|
+
);
|
|
115
|
+
});
|
|
116
|
+
TableRow.displayName = "TableRow";
|
|
117
|
+
var TableHead = React.forwardRef((_a, ref) => {
|
|
118
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
"th",
|
|
121
|
+
__spreadValues({
|
|
122
|
+
ref,
|
|
123
|
+
className: cn(
|
|
124
|
+
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
125
|
+
className
|
|
126
|
+
)
|
|
127
|
+
}, props)
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
TableHead.displayName = "TableHead";
|
|
131
|
+
var TableCell = React.forwardRef((_a, ref) => {
|
|
132
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
"td",
|
|
135
|
+
__spreadValues({
|
|
136
|
+
ref,
|
|
137
|
+
className: cn(
|
|
138
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
139
|
+
className
|
|
140
|
+
)
|
|
141
|
+
}, props)
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
TableCell.displayName = "TableCell";
|
|
145
|
+
var TableCaption = React.forwardRef((_a, ref) => {
|
|
146
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
147
|
+
return /* @__PURE__ */ jsx(
|
|
148
|
+
"caption",
|
|
149
|
+
__spreadValues({
|
|
150
|
+
ref,
|
|
151
|
+
className: cn("mt-4 text-sm text-muted-foreground", className)
|
|
152
|
+
}, props)
|
|
153
|
+
);
|
|
154
|
+
});
|
|
155
|
+
TableCaption.displayName = "TableCaption";
|
|
156
|
+
|
|
157
|
+
// src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx
|
|
158
|
+
import { DropdownMenuTrigger as DropdownMenuTrigger2 } from "@radix-ui/react-dropdown-menu";
|
|
159
|
+
import { MixerHorizontalIcon } from "@radix-ui/react-icons";
|
|
160
|
+
|
|
161
|
+
// src/components/ui/button.tsx
|
|
162
|
+
import * as React2 from "react";
|
|
163
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
164
|
+
import { cva } from "class-variance-authority";
|
|
165
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
166
|
+
var buttonVariants = cva(
|
|
167
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
168
|
+
{
|
|
169
|
+
variants: {
|
|
170
|
+
variant: {
|
|
171
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
172
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
173
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
174
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
175
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
176
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
177
|
+
},
|
|
178
|
+
size: {
|
|
179
|
+
default: "h-9 px-4 py-2",
|
|
180
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
181
|
+
lg: "h-10 rounded-md px-8",
|
|
182
|
+
icon: "h-9 w-9"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
defaultVariants: {
|
|
186
|
+
variant: "default",
|
|
187
|
+
size: "default"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
var Button = React2.forwardRef(
|
|
192
|
+
(_a, ref) => {
|
|
193
|
+
var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
|
|
194
|
+
const Comp = asChild ? Slot : "button";
|
|
195
|
+
return /* @__PURE__ */ jsx2(
|
|
196
|
+
Comp,
|
|
197
|
+
__spreadValues({
|
|
198
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
199
|
+
ref
|
|
200
|
+
}, props)
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
Button.displayName = "Button";
|
|
205
|
+
|
|
206
|
+
// src/components/ui/dropdown-menu.tsx
|
|
207
|
+
import * as React3 from "react";
|
|
208
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
209
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
210
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
211
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
212
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
213
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
214
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
215
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
216
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
217
|
+
var DropdownMenuSubTrigger = React3.forwardRef((_a, ref) => {
|
|
218
|
+
var _b = _a, { className, inset, children } = _b, props = __objRest(_b, ["className", "inset", "children"]);
|
|
219
|
+
return /* @__PURE__ */ jsxs(
|
|
220
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
221
|
+
__spreadProps(__spreadValues({
|
|
222
|
+
ref,
|
|
223
|
+
className: cn(
|
|
224
|
+
"flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
225
|
+
inset && "pl-8",
|
|
226
|
+
className
|
|
227
|
+
)
|
|
228
|
+
}, props), {
|
|
229
|
+
children: [
|
|
230
|
+
children,
|
|
231
|
+
/* @__PURE__ */ jsx3(ChevronRight, { className: "ml-auto" })
|
|
232
|
+
]
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
});
|
|
236
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
237
|
+
var DropdownMenuSubContent = React3.forwardRef((_a, ref) => {
|
|
238
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
239
|
+
return /* @__PURE__ */ jsx3(
|
|
240
|
+
DropdownMenuPrimitive.SubContent,
|
|
241
|
+
__spreadValues({
|
|
242
|
+
ref,
|
|
243
|
+
className: cn(
|
|
244
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
245
|
+
className
|
|
246
|
+
)
|
|
247
|
+
}, props)
|
|
248
|
+
);
|
|
249
|
+
});
|
|
250
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
251
|
+
var DropdownMenuContent = React3.forwardRef((_a, ref) => {
|
|
252
|
+
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
|
253
|
+
return /* @__PURE__ */ jsx3(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx3(
|
|
254
|
+
DropdownMenuPrimitive.Content,
|
|
255
|
+
__spreadValues({
|
|
256
|
+
ref,
|
|
257
|
+
sideOffset,
|
|
258
|
+
className: cn(
|
|
259
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
260
|
+
"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",
|
|
261
|
+
className
|
|
262
|
+
)
|
|
263
|
+
}, props)
|
|
264
|
+
) });
|
|
265
|
+
});
|
|
266
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
267
|
+
var DropdownMenuItem = React3.forwardRef((_a, ref) => {
|
|
268
|
+
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
269
|
+
return /* @__PURE__ */ jsx3(
|
|
270
|
+
DropdownMenuPrimitive.Item,
|
|
271
|
+
__spreadValues({
|
|
272
|
+
ref,
|
|
273
|
+
className: cn(
|
|
274
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
275
|
+
inset && "pl-8",
|
|
276
|
+
className
|
|
277
|
+
)
|
|
278
|
+
}, props)
|
|
279
|
+
);
|
|
280
|
+
});
|
|
281
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
282
|
+
var DropdownMenuCheckboxItem = React3.forwardRef((_a, ref) => {
|
|
283
|
+
var _b = _a, { className, children, checked } = _b, props = __objRest(_b, ["className", "children", "checked"]);
|
|
284
|
+
return /* @__PURE__ */ jsxs(
|
|
285
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
286
|
+
__spreadProps(__spreadValues({
|
|
287
|
+
ref,
|
|
288
|
+
className: cn(
|
|
289
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
290
|
+
className
|
|
291
|
+
),
|
|
292
|
+
checked
|
|
293
|
+
}, props), {
|
|
294
|
+
children: [
|
|
295
|
+
/* @__PURE__ */ jsx3("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx3(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx3(Check, { className: "h-4 w-4" }) }) }),
|
|
296
|
+
children
|
|
297
|
+
]
|
|
298
|
+
})
|
|
299
|
+
);
|
|
300
|
+
});
|
|
301
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
302
|
+
var DropdownMenuRadioItem = React3.forwardRef((_a, ref) => {
|
|
303
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
304
|
+
return /* @__PURE__ */ jsxs(
|
|
305
|
+
DropdownMenuPrimitive.RadioItem,
|
|
306
|
+
__spreadProps(__spreadValues({
|
|
307
|
+
ref,
|
|
308
|
+
className: cn(
|
|
309
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
310
|
+
className
|
|
311
|
+
)
|
|
312
|
+
}, props), {
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ jsx3("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx3(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx3(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
315
|
+
children
|
|
316
|
+
]
|
|
317
|
+
})
|
|
318
|
+
);
|
|
319
|
+
});
|
|
320
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
321
|
+
var DropdownMenuLabel = React3.forwardRef((_a, ref) => {
|
|
322
|
+
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
323
|
+
return /* @__PURE__ */ jsx3(
|
|
324
|
+
DropdownMenuPrimitive.Label,
|
|
325
|
+
__spreadValues({
|
|
326
|
+
ref,
|
|
327
|
+
className: cn(
|
|
328
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
329
|
+
inset && "pl-8",
|
|
330
|
+
className
|
|
331
|
+
)
|
|
332
|
+
}, props)
|
|
333
|
+
);
|
|
334
|
+
});
|
|
335
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
336
|
+
var DropdownMenuSeparator = React3.forwardRef((_a, ref) => {
|
|
337
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
338
|
+
return /* @__PURE__ */ jsx3(
|
|
339
|
+
DropdownMenuPrimitive.Separator,
|
|
340
|
+
__spreadValues({
|
|
341
|
+
ref,
|
|
342
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
343
|
+
}, props)
|
|
344
|
+
);
|
|
345
|
+
});
|
|
346
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
347
|
+
var DropdownMenuShortcut = (_a) => {
|
|
348
|
+
var _b = _a, {
|
|
349
|
+
className
|
|
350
|
+
} = _b, props = __objRest(_b, [
|
|
351
|
+
"className"
|
|
352
|
+
]);
|
|
353
|
+
return /* @__PURE__ */ jsx3(
|
|
354
|
+
"span",
|
|
355
|
+
__spreadValues({
|
|
356
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className)
|
|
357
|
+
}, props)
|
|
358
|
+
);
|
|
359
|
+
};
|
|
360
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
361
|
+
|
|
362
|
+
// src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx
|
|
363
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
364
|
+
function DataTableViewOptions({
|
|
365
|
+
table
|
|
366
|
+
}) {
|
|
367
|
+
return /* @__PURE__ */ jsxs2(DropdownMenu, { children: [
|
|
368
|
+
/* @__PURE__ */ jsx4(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs2(
|
|
369
|
+
Button,
|
|
370
|
+
{
|
|
371
|
+
variant: "outline",
|
|
372
|
+
size: "sm",
|
|
373
|
+
className: "ml-auto hidden h-8 lg:flex",
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ jsx4(MixerHorizontalIcon, { className: "mr-2 h-4 w-4" }),
|
|
376
|
+
"Colunas"
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
) }),
|
|
380
|
+
/* @__PURE__ */ jsxs2(DropdownMenuContent, { align: "end", className: "w-[150px]", children: [
|
|
381
|
+
/* @__PURE__ */ jsx4(DropdownMenuLabel, { children: "Colunas vis\xEDveis" }),
|
|
382
|
+
/* @__PURE__ */ jsx4(DropdownMenuSeparator, {}),
|
|
383
|
+
table.getAllColumns().filter(
|
|
384
|
+
(column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
385
|
+
).map((column) => {
|
|
386
|
+
return /* @__PURE__ */ jsx4(
|
|
387
|
+
DropdownMenuCheckboxItem,
|
|
388
|
+
{
|
|
389
|
+
className: "capitalize",
|
|
390
|
+
checked: column.getIsVisible(),
|
|
391
|
+
onCheckedChange: (value) => column.toggleVisibility(!!value),
|
|
392
|
+
children: column.id
|
|
393
|
+
},
|
|
394
|
+
column.id
|
|
395
|
+
);
|
|
396
|
+
})
|
|
397
|
+
] })
|
|
398
|
+
] });
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx
|
|
402
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
403
|
+
function DataTableToolbar({
|
|
404
|
+
table,
|
|
405
|
+
filters,
|
|
406
|
+
showColumnVisibility
|
|
407
|
+
}) {
|
|
408
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
|
|
409
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-1 items-center space-x-2", children: filters }),
|
|
410
|
+
showColumnVisibility && /* @__PURE__ */ jsx5(DataTableViewOptions, { table })
|
|
411
|
+
] });
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx
|
|
415
|
+
import {
|
|
416
|
+
ChevronLeftIcon,
|
|
417
|
+
ChevronRightIcon,
|
|
418
|
+
DoubleArrowLeftIcon,
|
|
419
|
+
DoubleArrowRightIcon
|
|
420
|
+
} from "@radix-ui/react-icons";
|
|
421
|
+
|
|
422
|
+
// src/components/ui/select.tsx
|
|
423
|
+
import * as React4 from "react";
|
|
424
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
425
|
+
import { Check as Check2, ChevronDown, ChevronUp } from "lucide-react";
|
|
426
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
427
|
+
var Select = SelectPrimitive.Root;
|
|
428
|
+
var SelectValue = SelectPrimitive.Value;
|
|
429
|
+
var SelectTrigger = React4.forwardRef((_a, ref) => {
|
|
430
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
431
|
+
return /* @__PURE__ */ jsxs4(
|
|
432
|
+
SelectPrimitive.Trigger,
|
|
433
|
+
__spreadProps(__spreadValues({
|
|
434
|
+
ref,
|
|
435
|
+
className: cn(
|
|
436
|
+
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
437
|
+
className
|
|
438
|
+
)
|
|
439
|
+
}, props), {
|
|
440
|
+
children: [
|
|
441
|
+
children,
|
|
442
|
+
/* @__PURE__ */ jsx6(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx6(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
443
|
+
]
|
|
444
|
+
})
|
|
445
|
+
);
|
|
446
|
+
});
|
|
447
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
448
|
+
var SelectScrollUpButton = React4.forwardRef((_a, ref) => {
|
|
449
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
450
|
+
return /* @__PURE__ */ jsx6(
|
|
451
|
+
SelectPrimitive.ScrollUpButton,
|
|
452
|
+
__spreadProps(__spreadValues({
|
|
453
|
+
ref,
|
|
454
|
+
className: cn(
|
|
455
|
+
"flex cursor-default items-center justify-center py-1",
|
|
456
|
+
className
|
|
457
|
+
)
|
|
458
|
+
}, props), {
|
|
459
|
+
children: /* @__PURE__ */ jsx6(ChevronUp, { className: "h-4 w-4" })
|
|
460
|
+
})
|
|
461
|
+
);
|
|
462
|
+
});
|
|
463
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
464
|
+
var SelectScrollDownButton = React4.forwardRef((_a, ref) => {
|
|
465
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
466
|
+
return /* @__PURE__ */ jsx6(
|
|
467
|
+
SelectPrimitive.ScrollDownButton,
|
|
468
|
+
__spreadProps(__spreadValues({
|
|
469
|
+
ref,
|
|
470
|
+
className: cn(
|
|
471
|
+
"flex cursor-default items-center justify-center py-1",
|
|
472
|
+
className
|
|
473
|
+
)
|
|
474
|
+
}, props), {
|
|
475
|
+
children: /* @__PURE__ */ jsx6(ChevronDown, { className: "h-4 w-4" })
|
|
476
|
+
})
|
|
477
|
+
);
|
|
478
|
+
});
|
|
479
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
480
|
+
var SelectContent = React4.forwardRef((_a, ref) => {
|
|
481
|
+
var _b = _a, { className, children, position = "popper" } = _b, props = __objRest(_b, ["className", "children", "position"]);
|
|
482
|
+
return /* @__PURE__ */ jsx6(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs4(
|
|
483
|
+
SelectPrimitive.Content,
|
|
484
|
+
__spreadProps(__spreadValues({
|
|
485
|
+
ref,
|
|
486
|
+
className: cn(
|
|
487
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
|
|
488
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
489
|
+
className
|
|
490
|
+
),
|
|
491
|
+
position
|
|
492
|
+
}, props), {
|
|
493
|
+
children: [
|
|
494
|
+
/* @__PURE__ */ jsx6(SelectScrollUpButton, {}),
|
|
495
|
+
/* @__PURE__ */ jsx6(
|
|
496
|
+
SelectPrimitive.Viewport,
|
|
497
|
+
{
|
|
498
|
+
className: cn(
|
|
499
|
+
"p-1",
|
|
500
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
501
|
+
),
|
|
502
|
+
children
|
|
503
|
+
}
|
|
504
|
+
),
|
|
505
|
+
/* @__PURE__ */ jsx6(SelectScrollDownButton, {})
|
|
506
|
+
]
|
|
507
|
+
})
|
|
508
|
+
) });
|
|
509
|
+
});
|
|
510
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
511
|
+
var SelectLabel = React4.forwardRef((_a, ref) => {
|
|
512
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
513
|
+
return /* @__PURE__ */ jsx6(
|
|
514
|
+
SelectPrimitive.Label,
|
|
515
|
+
__spreadValues({
|
|
516
|
+
ref,
|
|
517
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", className)
|
|
518
|
+
}, props)
|
|
519
|
+
);
|
|
520
|
+
});
|
|
521
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
522
|
+
var SelectItem = React4.forwardRef((_a, ref) => {
|
|
523
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
524
|
+
return /* @__PURE__ */ jsxs4(
|
|
525
|
+
SelectPrimitive.Item,
|
|
526
|
+
__spreadProps(__spreadValues({
|
|
527
|
+
ref,
|
|
528
|
+
className: cn(
|
|
529
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
530
|
+
className
|
|
531
|
+
)
|
|
532
|
+
}, props), {
|
|
533
|
+
children: [
|
|
534
|
+
/* @__PURE__ */ jsx6("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx6(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx6(Check2, { className: "h-4 w-4" }) }) }),
|
|
535
|
+
/* @__PURE__ */ jsx6(SelectPrimitive.ItemText, { children })
|
|
536
|
+
]
|
|
537
|
+
})
|
|
538
|
+
);
|
|
539
|
+
});
|
|
540
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
541
|
+
var SelectSeparator = React4.forwardRef((_a, ref) => {
|
|
542
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
543
|
+
return /* @__PURE__ */ jsx6(
|
|
544
|
+
SelectPrimitive.Separator,
|
|
545
|
+
__spreadValues({
|
|
546
|
+
ref,
|
|
547
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
548
|
+
}, props)
|
|
549
|
+
);
|
|
550
|
+
});
|
|
551
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
552
|
+
|
|
553
|
+
// src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx
|
|
554
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
555
|
+
function DataTablePagination({
|
|
556
|
+
table,
|
|
557
|
+
pageSizeOptions = [10, 20, 30, 40, 50]
|
|
558
|
+
}) {
|
|
559
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-2", children: [
|
|
560
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex-1 text-sm text-muted-foreground", children: [
|
|
561
|
+
table.getFilteredSelectedRowModel().rows.length,
|
|
562
|
+
" de",
|
|
563
|
+
" ",
|
|
564
|
+
table.getFilteredRowModel().rows.length,
|
|
565
|
+
" linha(s) selecionada(s)."
|
|
566
|
+
] }),
|
|
567
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
|
|
568
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center space-x-2", children: [
|
|
569
|
+
/* @__PURE__ */ jsx7("p", { className: "text-sm font-medium", children: "Linhas por p\xE1gina" }),
|
|
570
|
+
/* @__PURE__ */ jsxs5(
|
|
571
|
+
Select,
|
|
572
|
+
{
|
|
573
|
+
value: `${table.getState().pagination.pageSize}`,
|
|
574
|
+
onValueChange: (value) => {
|
|
575
|
+
table.setPageSize(Number(value));
|
|
576
|
+
},
|
|
577
|
+
children: [
|
|
578
|
+
/* @__PURE__ */ jsx7(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx7(SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
|
|
579
|
+
/* @__PURE__ */ jsx7(SelectContent, { side: "top", children: pageSizeOptions.map((pageSize) => /* @__PURE__ */ jsx7(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
|
|
580
|
+
]
|
|
581
|
+
}
|
|
582
|
+
)
|
|
583
|
+
] }),
|
|
584
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
|
|
585
|
+
"P\xE1gina ",
|
|
586
|
+
table.getState().pagination.pageIndex + 1,
|
|
587
|
+
" de",
|
|
588
|
+
" ",
|
|
589
|
+
table.getPageCount()
|
|
590
|
+
] }),
|
|
591
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center space-x-2", children: [
|
|
592
|
+
/* @__PURE__ */ jsx7(
|
|
593
|
+
Button,
|
|
594
|
+
{
|
|
595
|
+
variant: "outline",
|
|
596
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
597
|
+
onClick: () => table.setPageIndex(0),
|
|
598
|
+
disabled: !table.getCanPreviousPage(),
|
|
599
|
+
children: /* @__PURE__ */ jsx7(DoubleArrowLeftIcon, { className: "h-4 w-4" })
|
|
600
|
+
}
|
|
601
|
+
),
|
|
602
|
+
/* @__PURE__ */ jsx7(
|
|
603
|
+
Button,
|
|
604
|
+
{
|
|
605
|
+
variant: "outline",
|
|
606
|
+
className: "h-8 w-8 p-0",
|
|
607
|
+
onClick: () => table.previousPage(),
|
|
608
|
+
disabled: !table.getCanPreviousPage(),
|
|
609
|
+
children: /* @__PURE__ */ jsx7(ChevronLeftIcon, { className: "h-4 w-4" })
|
|
610
|
+
}
|
|
611
|
+
),
|
|
612
|
+
/* @__PURE__ */ jsx7(
|
|
613
|
+
Button,
|
|
614
|
+
{
|
|
615
|
+
variant: "outline",
|
|
616
|
+
className: "h-8 w-8 p-0",
|
|
617
|
+
onClick: () => table.nextPage(),
|
|
618
|
+
disabled: !table.getCanNextPage(),
|
|
619
|
+
children: /* @__PURE__ */ jsx7(ChevronRightIcon, { className: "h-4 w-4" })
|
|
620
|
+
}
|
|
621
|
+
),
|
|
622
|
+
/* @__PURE__ */ jsx7(
|
|
623
|
+
Button,
|
|
624
|
+
{
|
|
625
|
+
variant: "outline",
|
|
626
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
627
|
+
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
|
628
|
+
disabled: !table.getCanNextPage(),
|
|
629
|
+
children: /* @__PURE__ */ jsx7(DoubleArrowRightIcon, { className: "h-4 w-4" })
|
|
630
|
+
}
|
|
631
|
+
)
|
|
632
|
+
] })
|
|
633
|
+
] })
|
|
634
|
+
] });
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx
|
|
638
|
+
import {
|
|
639
|
+
ArrowDownIcon,
|
|
640
|
+
ArrowUpIcon,
|
|
641
|
+
CaretSortIcon,
|
|
642
|
+
EyeNoneIcon
|
|
643
|
+
} from "@radix-ui/react-icons";
|
|
644
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
645
|
+
function DataTableColumnHeader({
|
|
646
|
+
column,
|
|
647
|
+
title,
|
|
648
|
+
className
|
|
649
|
+
}) {
|
|
650
|
+
if (!column.getCanSort()) {
|
|
651
|
+
return /* @__PURE__ */ jsx8("div", { className: cn(className), children: title });
|
|
652
|
+
}
|
|
653
|
+
return /* @__PURE__ */ jsx8("div", { className: cn("flex items-center space-x-2", className), children: /* @__PURE__ */ jsxs6(DropdownMenu, { children: [
|
|
654
|
+
/* @__PURE__ */ jsx8(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(
|
|
655
|
+
Button,
|
|
656
|
+
{
|
|
657
|
+
variant: "ghost",
|
|
658
|
+
size: "sm",
|
|
659
|
+
className: "-ml-3 h-8 data-[state=open]:bg-accent",
|
|
660
|
+
children: [
|
|
661
|
+
/* @__PURE__ */ jsx8("span", { children: title }),
|
|
662
|
+
column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx8(ArrowDownIcon, { className: "ml-2 h-4 w-4" }) : column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx8(ArrowUpIcon, { className: "ml-2 h-4 w-4" }) : /* @__PURE__ */ jsx8(CaretSortIcon, { className: "ml-2 h-4 w-4" })
|
|
663
|
+
]
|
|
664
|
+
}
|
|
665
|
+
) }),
|
|
666
|
+
/* @__PURE__ */ jsxs6(DropdownMenuContent, { align: "start", children: [
|
|
667
|
+
/* @__PURE__ */ jsxs6(DropdownMenuItem, { onClick: () => column.toggleSorting(false), children: [
|
|
668
|
+
/* @__PURE__ */ jsx8(ArrowUpIcon, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground/70" }),
|
|
669
|
+
"Crescente"
|
|
670
|
+
] }),
|
|
671
|
+
/* @__PURE__ */ jsxs6(DropdownMenuItem, { onClick: () => column.toggleSorting(true), children: [
|
|
672
|
+
/* @__PURE__ */ jsx8(ArrowDownIcon, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground/70" }),
|
|
673
|
+
"Decrescente"
|
|
674
|
+
] }),
|
|
675
|
+
/* @__PURE__ */ jsx8(DropdownMenuSeparator, {}),
|
|
676
|
+
/* @__PURE__ */ jsxs6(DropdownMenuItem, { onClick: () => column.toggleVisibility(false), children: [
|
|
677
|
+
/* @__PURE__ */ jsx8(EyeNoneIcon, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground/70" }),
|
|
678
|
+
"Ocultar"
|
|
679
|
+
] })
|
|
680
|
+
] })
|
|
681
|
+
] }) });
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// src/components/dataDisplay/Table/components/DynamicTable/index.tsx
|
|
685
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
686
|
+
function DynamicTable({
|
|
687
|
+
data,
|
|
688
|
+
columns,
|
|
689
|
+
className,
|
|
690
|
+
toolbar,
|
|
691
|
+
pagination: showPagination = true,
|
|
692
|
+
sorting: showSorting = true,
|
|
693
|
+
columnVisibility: showColumnVisibility = true,
|
|
694
|
+
filters,
|
|
695
|
+
rowsPerPage = [10, 20, 30, 40, 50],
|
|
696
|
+
defaultSort = [],
|
|
697
|
+
defaultVisibility = {}
|
|
698
|
+
}) {
|
|
699
|
+
var _a;
|
|
700
|
+
const [sorting, setSorting] = React5.useState(defaultSort);
|
|
701
|
+
const [columnVisibility, setColumnVisibility] = React5.useState(defaultVisibility);
|
|
702
|
+
const [{ pageIndex, pageSize }, setPagination] = React5.useState({
|
|
703
|
+
pageIndex: 0,
|
|
704
|
+
pageSize: rowsPerPage[0]
|
|
705
|
+
});
|
|
706
|
+
const pagination = React5.useMemo(
|
|
707
|
+
() => ({
|
|
708
|
+
pageIndex,
|
|
709
|
+
pageSize
|
|
710
|
+
}),
|
|
711
|
+
[pageIndex, pageSize]
|
|
712
|
+
);
|
|
713
|
+
const table = useReactTable({
|
|
714
|
+
data,
|
|
715
|
+
columns,
|
|
716
|
+
getCoreRowModel: getCoreRowModel(),
|
|
717
|
+
onSortingChange: setSorting,
|
|
718
|
+
getSortedRowModel: showSorting ? getSortedRowModel() : void 0,
|
|
719
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
720
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
721
|
+
onPaginationChange: setPagination,
|
|
722
|
+
manualPagination: false,
|
|
723
|
+
pageCount: Math.ceil(data.length / pageSize),
|
|
724
|
+
state: {
|
|
725
|
+
sorting,
|
|
726
|
+
columnVisibility,
|
|
727
|
+
pagination
|
|
728
|
+
},
|
|
729
|
+
enableSorting: showSorting
|
|
730
|
+
});
|
|
731
|
+
return /* @__PURE__ */ jsxs7("div", { className: "space-y-4", children: [
|
|
732
|
+
(toolbar || filters || showColumnVisibility) && /* @__PURE__ */ jsx9(
|
|
733
|
+
DataTableToolbar,
|
|
734
|
+
{
|
|
735
|
+
table,
|
|
736
|
+
filters,
|
|
737
|
+
showColumnVisibility
|
|
738
|
+
}
|
|
739
|
+
),
|
|
740
|
+
/* @__PURE__ */ jsx9("div", { className: cn("rounded-md border", className), children: /* @__PURE__ */ jsxs7(Table, { children: [
|
|
741
|
+
/* @__PURE__ */ jsx9(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx9(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx9(TableHead, { children: header.isPlaceholder ? null : /* @__PURE__ */ jsx9(
|
|
742
|
+
DataTableColumnHeader,
|
|
743
|
+
{
|
|
744
|
+
column: header.column,
|
|
745
|
+
title: header.column.columnDef.header
|
|
746
|
+
}
|
|
747
|
+
) }, header.id)) }, headerGroup.id)) }),
|
|
748
|
+
/* @__PURE__ */ jsx9(TableBody, { children: ((_a = table.getRowModel().rows) == null ? void 0 : _a.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx9(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx9(TableCell, { children: flexRender(
|
|
749
|
+
cell.column.columnDef.cell,
|
|
750
|
+
cell.getContext()
|
|
751
|
+
) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx9(TableRow, { children: /* @__PURE__ */ jsx9(
|
|
752
|
+
TableCell,
|
|
753
|
+
{
|
|
754
|
+
colSpan: columns.length,
|
|
755
|
+
className: "h-24 text-center",
|
|
756
|
+
children: "Nenhum resultado encontrado."
|
|
757
|
+
}
|
|
758
|
+
) }) })
|
|
759
|
+
] }) }),
|
|
760
|
+
showPagination && /* @__PURE__ */ jsx9(DataTablePagination, { table, pageSizeOptions: rowsPerPage })
|
|
761
|
+
] });
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// src/components/ui/badge.tsx
|
|
765
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
766
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
767
|
+
var badgeVariants = cva2(
|
|
768
|
+
"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",
|
|
769
|
+
{
|
|
770
|
+
variants: {
|
|
771
|
+
variant: {
|
|
772
|
+
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
773
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
774
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
775
|
+
success: "border-transparent bg-success text-primary-foreground shadow hover:bg-success/80",
|
|
776
|
+
warning: "border-transparent bg-warning text-primary-foreground shadow hover:bg-warning/80",
|
|
777
|
+
outline: "text-foreground"
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
defaultVariants: {
|
|
781
|
+
variant: "default"
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
);
|
|
785
|
+
function Badge(_a) {
|
|
786
|
+
var _b = _a, { className, variant } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
787
|
+
return /* @__PURE__ */ jsx10("div", __spreadValues({ className: cn(badgeVariants({ variant }), className) }, props));
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
// src/components/dataDisplay/Icon/Icon.tsx
|
|
791
|
+
import { useCallback, useMemo as useMemo2 } from "react";
|
|
792
|
+
import { IconContext } from "react-icons";
|
|
793
|
+
import { Fragment, jsx as jsx11 } from "react/jsx-runtime";
|
|
794
|
+
var Icon2 = (_a) => {
|
|
795
|
+
var _b = _a, { name, size = 24 } = _b, rest = __objRest(_b, ["name", "size"]);
|
|
796
|
+
const nameIcon = useMemo2(() => name, [name]);
|
|
797
|
+
const iconsModulePath = useMemo2(
|
|
798
|
+
() => ({
|
|
799
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
800
|
+
md: __require("react-icons/md"),
|
|
801
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
802
|
+
fa: __require("react-icons/fa"),
|
|
803
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
804
|
+
bs: __require("react-icons/bs")
|
|
805
|
+
}),
|
|
806
|
+
[]
|
|
807
|
+
);
|
|
808
|
+
const typeIcon = useMemo2(() => {
|
|
809
|
+
var _a2;
|
|
810
|
+
const matches = [...nameIcon.matchAll(/[A-Z]/g)];
|
|
811
|
+
return String(
|
|
812
|
+
nameIcon.slice(0, (_a2 = matches[1]) == null ? void 0 : _a2.index) || ""
|
|
813
|
+
).toLocaleLowerCase();
|
|
814
|
+
}, [nameIcon]);
|
|
815
|
+
const Icon3 = useCallback(
|
|
816
|
+
(props) => {
|
|
817
|
+
var _a2, _b2;
|
|
818
|
+
try {
|
|
819
|
+
if (!typeIcon || !nameIcon) return /* @__PURE__ */ jsx11(Fragment, {});
|
|
820
|
+
return (_b2 = (_a2 = iconsModulePath[typeIcon])[nameIcon]) == null ? void 0 : _b2.call(_a2, props);
|
|
821
|
+
} catch (e) {
|
|
822
|
+
return /* @__PURE__ */ jsx11(Fragment, {});
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
[iconsModulePath, nameIcon, typeIcon]
|
|
826
|
+
);
|
|
827
|
+
return /* @__PURE__ */ jsx11(IconContext.Provider, { value: { size: String(size) }, children: /* @__PURE__ */ jsx11(Icon3, __spreadValues({}, rest)) });
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
// src/components/ui/avatar.tsx
|
|
831
|
+
import * as React7 from "react";
|
|
832
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
833
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
834
|
+
var Avatar = React7.forwardRef((_a, ref) => {
|
|
835
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
836
|
+
return /* @__PURE__ */ jsx12(
|
|
837
|
+
AvatarPrimitive.Root,
|
|
838
|
+
__spreadValues({
|
|
839
|
+
ref,
|
|
840
|
+
className: cn(
|
|
841
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
842
|
+
className
|
|
843
|
+
)
|
|
844
|
+
}, props)
|
|
845
|
+
);
|
|
846
|
+
});
|
|
847
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
848
|
+
var AvatarImage = React7.forwardRef((_a, ref) => {
|
|
849
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
850
|
+
return /* @__PURE__ */ jsx12(
|
|
851
|
+
AvatarPrimitive.Image,
|
|
852
|
+
__spreadValues({
|
|
853
|
+
ref,
|
|
854
|
+
className: cn("aspect-square h-full w-full", className)
|
|
855
|
+
}, props)
|
|
856
|
+
);
|
|
857
|
+
});
|
|
858
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
859
|
+
var AvatarFallback = React7.forwardRef((_a, ref) => {
|
|
860
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
861
|
+
return /* @__PURE__ */ jsx12(
|
|
862
|
+
AvatarPrimitive.Fallback,
|
|
863
|
+
__spreadValues({
|
|
864
|
+
ref,
|
|
865
|
+
className: cn(
|
|
866
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
867
|
+
className
|
|
868
|
+
)
|
|
869
|
+
}, props)
|
|
870
|
+
);
|
|
871
|
+
});
|
|
872
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
873
|
+
|
|
874
|
+
// src/components/dataDisplay/DataPairList/DataPairList.tsx
|
|
875
|
+
import { isEmpty } from "lodash";
|
|
876
|
+
|
|
877
|
+
// src/components/dataDisplay/Text/Text.tsx
|
|
878
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
879
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
880
|
+
var textVariants = cva3("", {
|
|
881
|
+
variants: {
|
|
882
|
+
variant: {
|
|
883
|
+
display: "text-5xl font-extrabold tracking-tight",
|
|
884
|
+
title: "text-3xl font-bold tracking-tight",
|
|
885
|
+
subtitle: "text-2xl font-semibold",
|
|
886
|
+
normal: "text-base font-normal",
|
|
887
|
+
caption: "text-sm font-medium",
|
|
888
|
+
muted: "text-sm font-normal text-muted-foreground"
|
|
889
|
+
},
|
|
890
|
+
align: {
|
|
891
|
+
left: "text-left",
|
|
892
|
+
center: "text-center",
|
|
893
|
+
right: "text-right",
|
|
894
|
+
justify: "text-justify"
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
defaultVariants: {
|
|
898
|
+
variant: "normal",
|
|
899
|
+
align: "left"
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
var tagMap = {
|
|
903
|
+
display: "h1",
|
|
904
|
+
title: "h2",
|
|
905
|
+
subtitle: "h3",
|
|
906
|
+
normal: "p",
|
|
907
|
+
caption: "small",
|
|
908
|
+
muted: "p"
|
|
909
|
+
};
|
|
910
|
+
function Text({
|
|
911
|
+
variant = "normal",
|
|
912
|
+
align,
|
|
913
|
+
className,
|
|
914
|
+
children
|
|
915
|
+
}) {
|
|
916
|
+
const Tag = tagMap[variant || "normal"] || "p";
|
|
917
|
+
return /* @__PURE__ */ jsx13(Tag, { className: cn(textVariants({ variant, align }), className), children });
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
// src/components/dataDisplay/DataPairList/DataPairList.tsx
|
|
921
|
+
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
922
|
+
var DataPairList = ({
|
|
923
|
+
title,
|
|
924
|
+
data,
|
|
925
|
+
labels,
|
|
926
|
+
className,
|
|
927
|
+
infoDirection = "horizontal",
|
|
928
|
+
direction = "vertical",
|
|
929
|
+
withBorder = false,
|
|
930
|
+
header = /* @__PURE__ */ jsx14(Fragment2, {})
|
|
931
|
+
}) => {
|
|
932
|
+
if (isEmpty(data)) return null;
|
|
933
|
+
return /* @__PURE__ */ jsxs8(
|
|
934
|
+
"div",
|
|
935
|
+
{
|
|
936
|
+
className: cn(
|
|
937
|
+
"flex flex-col gap-2 rounded-md p-4",
|
|
938
|
+
withBorder && "border border-muted",
|
|
939
|
+
className
|
|
940
|
+
),
|
|
941
|
+
children: [
|
|
942
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex gap-3", children: [
|
|
943
|
+
title && /* @__PURE__ */ jsx14(Text, { variant: "title", children: title }),
|
|
944
|
+
header
|
|
945
|
+
] }),
|
|
946
|
+
/* @__PURE__ */ jsx14(
|
|
947
|
+
"div",
|
|
948
|
+
{
|
|
949
|
+
className: cn(
|
|
950
|
+
"grid grid-cols-1 mt-5",
|
|
951
|
+
direction === "vertical" ? "gap-3" : "sm:grid-cols-2 md:grid-cols-4 gap-10"
|
|
952
|
+
),
|
|
953
|
+
children: Object.entries(data || {}).map(([key, value], index) => /* @__PURE__ */ jsxs8(
|
|
954
|
+
"div",
|
|
955
|
+
{
|
|
956
|
+
className: cn(
|
|
957
|
+
"flex gap-3",
|
|
958
|
+
infoDirection === "horizontal" ? "flex-row" : "flex-col"
|
|
959
|
+
),
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ jsxs8(Text, { className: "uppercase text-muted-foreground font-bold", children: [
|
|
962
|
+
(labels == null ? void 0 : labels[key]) || key,
|
|
963
|
+
":"
|
|
964
|
+
] }),
|
|
965
|
+
/* @__PURE__ */ jsx14(Text, { children: value })
|
|
966
|
+
]
|
|
967
|
+
},
|
|
968
|
+
index
|
|
969
|
+
))
|
|
970
|
+
}
|
|
971
|
+
)
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
);
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
// src/components/dataInput/checkbox/Checkbox.tsx
|
|
978
|
+
import { useFormContext as useFormContext3 } from "react-hook-form";
|
|
979
|
+
|
|
980
|
+
// src/components/ui/checkbox.tsx
|
|
981
|
+
import * as React8 from "react";
|
|
982
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
983
|
+
import { Check as Check3 } from "lucide-react";
|
|
984
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
985
|
+
var Checkbox = React8.forwardRef((_a, ref) => {
|
|
986
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
987
|
+
return /* @__PURE__ */ jsx15(
|
|
988
|
+
CheckboxPrimitive.Root,
|
|
989
|
+
__spreadProps(__spreadValues({
|
|
990
|
+
ref,
|
|
991
|
+
className: cn(
|
|
992
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
993
|
+
className
|
|
994
|
+
)
|
|
995
|
+
}, props), {
|
|
996
|
+
children: /* @__PURE__ */ jsx15(
|
|
997
|
+
CheckboxPrimitive.Indicator,
|
|
998
|
+
{
|
|
999
|
+
className: cn("flex items-center justify-center text-current"),
|
|
1000
|
+
children: /* @__PURE__ */ jsx15(Check3, { className: "h-4 w-4" })
|
|
1001
|
+
}
|
|
1002
|
+
)
|
|
1003
|
+
})
|
|
1004
|
+
);
|
|
1005
|
+
});
|
|
1006
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
1007
|
+
|
|
1008
|
+
// src/components/ui/label.tsx
|
|
1009
|
+
import * as React9 from "react";
|
|
1010
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
1011
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1012
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1013
|
+
var labelVariants = cva4(
|
|
1014
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1015
|
+
);
|
|
1016
|
+
var Label3 = React9.forwardRef((_a, ref) => {
|
|
1017
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1018
|
+
return /* @__PURE__ */ jsx16(
|
|
1019
|
+
LabelPrimitive.Root,
|
|
1020
|
+
__spreadValues({
|
|
1021
|
+
ref,
|
|
1022
|
+
className: cn(labelVariants(), className)
|
|
1023
|
+
}, props)
|
|
1024
|
+
);
|
|
1025
|
+
});
|
|
1026
|
+
Label3.displayName = LabelPrimitive.Root.displayName;
|
|
1027
|
+
|
|
1028
|
+
// src/components/dataInput/form/index.ts
|
|
1029
|
+
import { useFormContext as useFormContext2 } from "react-hook-form";
|
|
1030
|
+
|
|
1031
|
+
// src/components/ui/form.tsx
|
|
1032
|
+
import * as React10 from "react";
|
|
1033
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
1034
|
+
import {
|
|
1035
|
+
Controller,
|
|
1036
|
+
FormProvider,
|
|
1037
|
+
useFormContext
|
|
1038
|
+
} from "react-hook-form";
|
|
1039
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1040
|
+
var Form = FormProvider;
|
|
1041
|
+
var FormFieldContext = React10.createContext(
|
|
1042
|
+
{}
|
|
1043
|
+
);
|
|
1044
|
+
var FormField = (_a) => {
|
|
1045
|
+
var props = __objRest(_a, []);
|
|
1046
|
+
return /* @__PURE__ */ jsx17(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx17(Controller, __spreadValues({}, props)) });
|
|
1047
|
+
};
|
|
1048
|
+
var useFormField = () => {
|
|
1049
|
+
const fieldContext = React10.useContext(FormFieldContext);
|
|
1050
|
+
const itemContext = React10.useContext(FormItemContext);
|
|
1051
|
+
const { getFieldState, formState } = useFormContext();
|
|
1052
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
1053
|
+
if (!fieldContext) {
|
|
1054
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
1055
|
+
}
|
|
1056
|
+
const { id } = itemContext;
|
|
1057
|
+
return __spreadValues({
|
|
1058
|
+
id,
|
|
1059
|
+
name: fieldContext.name,
|
|
1060
|
+
formItemId: `${id}-form-item`,
|
|
1061
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
1062
|
+
formMessageId: `${id}-form-item-message`
|
|
1063
|
+
}, fieldState);
|
|
1064
|
+
};
|
|
1065
|
+
var FormItemContext = React10.createContext(
|
|
1066
|
+
{}
|
|
1067
|
+
);
|
|
1068
|
+
var FormItem = React10.forwardRef((_a, ref) => {
|
|
1069
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1070
|
+
const id = React10.useId();
|
|
1071
|
+
return /* @__PURE__ */ jsx17(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx17("div", __spreadValues({ ref, className: cn("space-y-2", className) }, props)) });
|
|
1072
|
+
});
|
|
1073
|
+
FormItem.displayName = "FormItem";
|
|
1074
|
+
var FormLabel = React10.forwardRef((_a, ref) => {
|
|
1075
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1076
|
+
const { error, formItemId } = useFormField();
|
|
1077
|
+
return /* @__PURE__ */ jsx17(
|
|
1078
|
+
Label3,
|
|
1079
|
+
__spreadValues({
|
|
1080
|
+
ref,
|
|
1081
|
+
className: cn(error && "text-destructive", className),
|
|
1082
|
+
htmlFor: formItemId
|
|
1083
|
+
}, props)
|
|
1084
|
+
);
|
|
1085
|
+
});
|
|
1086
|
+
FormLabel.displayName = "FormLabel";
|
|
1087
|
+
var FormControl = React10.forwardRef((_a, ref) => {
|
|
1088
|
+
var props = __objRest(_a, []);
|
|
1089
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1090
|
+
return /* @__PURE__ */ jsx17(
|
|
1091
|
+
Slot2,
|
|
1092
|
+
__spreadValues({
|
|
1093
|
+
ref,
|
|
1094
|
+
id: formItemId,
|
|
1095
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
1096
|
+
"aria-invalid": !!error
|
|
1097
|
+
}, props)
|
|
1098
|
+
);
|
|
1099
|
+
});
|
|
1100
|
+
FormControl.displayName = "FormControl";
|
|
1101
|
+
var FormDescription = React10.forwardRef((_a, ref) => {
|
|
1102
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1103
|
+
const { formDescriptionId } = useFormField();
|
|
1104
|
+
return /* @__PURE__ */ jsx17(
|
|
1105
|
+
"p",
|
|
1106
|
+
__spreadValues({
|
|
1107
|
+
ref,
|
|
1108
|
+
id: formDescriptionId,
|
|
1109
|
+
className: cn("text-[0.8rem] text-muted-foreground", className)
|
|
1110
|
+
}, props)
|
|
1111
|
+
);
|
|
1112
|
+
});
|
|
1113
|
+
FormDescription.displayName = "FormDescription";
|
|
1114
|
+
var FormMessage = React10.forwardRef((_a, ref) => {
|
|
1115
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1116
|
+
const { error, formMessageId } = useFormField();
|
|
1117
|
+
const body = error ? String(error == null ? void 0 : error.message) : children;
|
|
1118
|
+
if (!body) {
|
|
1119
|
+
return null;
|
|
1120
|
+
}
|
|
1121
|
+
return /* @__PURE__ */ jsx17(
|
|
1122
|
+
"p",
|
|
1123
|
+
__spreadProps(__spreadValues({
|
|
1124
|
+
ref,
|
|
1125
|
+
id: formMessageId,
|
|
1126
|
+
className: cn("text-[0.8rem] font-medium text-destructive", className)
|
|
1127
|
+
}, props), {
|
|
1128
|
+
children: body
|
|
1129
|
+
})
|
|
1130
|
+
);
|
|
1131
|
+
});
|
|
1132
|
+
FormMessage.displayName = "FormMessage";
|
|
1133
|
+
|
|
1134
|
+
// src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx
|
|
1135
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1136
|
+
var ErrorMessage = ({ children }) => {
|
|
1137
|
+
return /* @__PURE__ */ jsx18("p", { className: "text-sm font-medium text-destructive", children });
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
// src/components/dataInput/checkbox/Checkbox.tsx
|
|
1141
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1142
|
+
var Checkbox2 = (_a) => {
|
|
1143
|
+
var _b = _a, {
|
|
1144
|
+
label,
|
|
1145
|
+
error,
|
|
1146
|
+
withoutForm
|
|
1147
|
+
} = _b, props = __objRest(_b, [
|
|
1148
|
+
"label",
|
|
1149
|
+
"error",
|
|
1150
|
+
"withoutForm"
|
|
1151
|
+
]);
|
|
1152
|
+
var _a2;
|
|
1153
|
+
const form = useFormContext3();
|
|
1154
|
+
const hasForm = !withoutForm && !!form && !!props.name;
|
|
1155
|
+
if (!hasForm)
|
|
1156
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-2", children: [
|
|
1157
|
+
/* @__PURE__ */ jsx19(Checkbox, __spreadValues({}, props)),
|
|
1158
|
+
label && /* @__PURE__ */ jsx19(Label3, { htmlFor: props.id, children: label }),
|
|
1159
|
+
error && /* @__PURE__ */ jsx19(ErrorMessage, { children: error })
|
|
1160
|
+
] });
|
|
1161
|
+
return /* @__PURE__ */ jsx19(
|
|
1162
|
+
FormField,
|
|
1163
|
+
{
|
|
1164
|
+
control: form.control,
|
|
1165
|
+
name: (_a2 = props.name) != null ? _a2 : "",
|
|
1166
|
+
render: ({ field }) => /* @__PURE__ */ jsxs9(FormItem, { className: "flex flex-row items-start space-x-3 space-y-0 rounded-md border p-4", children: [
|
|
1167
|
+
/* @__PURE__ */ jsx19(FormControl, { children: /* @__PURE__ */ jsx19(
|
|
1168
|
+
Checkbox,
|
|
1169
|
+
{
|
|
1170
|
+
checked: field.value,
|
|
1171
|
+
onCheckedChange: field.onChange
|
|
1172
|
+
}
|
|
1173
|
+
) }),
|
|
1174
|
+
label && /* @__PURE__ */ jsx19("div", { className: "space-y-1 leading-none", children: /* @__PURE__ */ jsx19(FormLabel, { children: label }) })
|
|
1175
|
+
] })
|
|
1176
|
+
}
|
|
1177
|
+
);
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
// src/components/ui/input.tsx
|
|
1181
|
+
import * as React11 from "react";
|
|
1182
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1183
|
+
var Input = React11.forwardRef(
|
|
1184
|
+
(_a, ref) => {
|
|
1185
|
+
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
1186
|
+
return /* @__PURE__ */ jsx20(
|
|
1187
|
+
"input",
|
|
1188
|
+
__spreadValues({
|
|
1189
|
+
type,
|
|
1190
|
+
className: cn(
|
|
1191
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
1192
|
+
className
|
|
1193
|
+
),
|
|
1194
|
+
ref
|
|
1195
|
+
}, props)
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
);
|
|
1199
|
+
Input.displayName = "Input";
|
|
1200
|
+
|
|
1201
|
+
// src/components/dataInput/Input/components/Input/index.tsx
|
|
1202
|
+
import { useMemo as useMemo4 } from "react";
|
|
1203
|
+
|
|
1204
|
+
// src/components/feedback/ErrorLabel/index.tsx
|
|
1205
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1206
|
+
var ErrorLabel = ({
|
|
1207
|
+
children,
|
|
1208
|
+
className,
|
|
1209
|
+
"data-testid": dataTestId
|
|
1210
|
+
}) => {
|
|
1211
|
+
return /* @__PURE__ */ jsxs10(
|
|
1212
|
+
"div",
|
|
1213
|
+
{
|
|
1214
|
+
className: cn("flex items-center gap-2 my-2", className),
|
|
1215
|
+
"data-testid": `${dataTestId}-error-label`,
|
|
1216
|
+
children: [
|
|
1217
|
+
/* @__PURE__ */ jsx21(Icon2, { name: "MdErrorOutline", size: 18, className: "text-destructive" }),
|
|
1218
|
+
/* @__PURE__ */ jsx21("span", { className: "text-destructive text-sm", children })
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1224
|
+
// src/components/dataInput/Input/components/InputBase/index.tsx
|
|
1225
|
+
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1226
|
+
var InputBase = ({
|
|
1227
|
+
label,
|
|
1228
|
+
error,
|
|
1229
|
+
children,
|
|
1230
|
+
required,
|
|
1231
|
+
"data-testid": testId
|
|
1232
|
+
}) => {
|
|
1233
|
+
return /* @__PURE__ */ jsxs11("div", { children: [
|
|
1234
|
+
label && /* @__PURE__ */ jsxs11(Label3, { "data-testid": `${testId}-label`, children: [
|
|
1235
|
+
`${label} ${required ? "*" : ""}`,
|
|
1236
|
+
" "
|
|
1237
|
+
] }),
|
|
1238
|
+
children,
|
|
1239
|
+
error && /* @__PURE__ */ jsx22(ErrorLabel, { "data-testid": testId, children: error })
|
|
1240
|
+
] });
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
// src/hooks/use-conditional-controller.tsx
|
|
1244
|
+
import { useMemo as useMemo3 } from "react";
|
|
1245
|
+
import {
|
|
1246
|
+
useController,
|
|
1247
|
+
useForm,
|
|
1248
|
+
useFormContext as useFormContext4
|
|
1249
|
+
} from "react-hook-form";
|
|
1250
|
+
var useConditionalController = ({
|
|
1251
|
+
name,
|
|
1252
|
+
withoutForm
|
|
1253
|
+
}) => {
|
|
1254
|
+
const form = useFormContext4();
|
|
1255
|
+
const hasForm = useMemo3(() => {
|
|
1256
|
+
return !withoutForm && !!(form == null ? void 0 : form.control);
|
|
1257
|
+
}, [withoutForm, form]);
|
|
1258
|
+
const tempForm = useForm();
|
|
1259
|
+
const controlToUse = useMemo3(() => {
|
|
1260
|
+
return hasForm ? form.control : tempForm.control;
|
|
1261
|
+
}, [tempForm, form, hasForm]);
|
|
1262
|
+
const controller = useController({
|
|
1263
|
+
control: controlToUse,
|
|
1264
|
+
name: name || "temp"
|
|
1265
|
+
});
|
|
1266
|
+
return hasForm ? controller.field : {};
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1269
|
+
// src/components/dataInput/Input/components/Input/index.tsx
|
|
1270
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1271
|
+
var Input2 = (_a) => {
|
|
1272
|
+
var _b = _a, {
|
|
1273
|
+
"data-testid": dataTestId,
|
|
1274
|
+
withoutForm = false,
|
|
1275
|
+
extraElement,
|
|
1276
|
+
containerClassName
|
|
1277
|
+
} = _b, props = __objRest(_b, [
|
|
1278
|
+
"data-testid",
|
|
1279
|
+
"withoutForm",
|
|
1280
|
+
"extraElement",
|
|
1281
|
+
"containerClassName"
|
|
1282
|
+
]);
|
|
1283
|
+
const formData = useConditionalController({
|
|
1284
|
+
name: props.name || "",
|
|
1285
|
+
withoutForm
|
|
1286
|
+
});
|
|
1287
|
+
const inputProps = useMemo4(() => {
|
|
1288
|
+
return __spreadValues(__spreadValues({}, formData), props);
|
|
1289
|
+
}, [formData, props]);
|
|
1290
|
+
return /* @__PURE__ */ jsx23(
|
|
1291
|
+
InputBase,
|
|
1292
|
+
{
|
|
1293
|
+
label: props.label,
|
|
1294
|
+
error: props.error,
|
|
1295
|
+
required: props.required,
|
|
1296
|
+
"data-testid": dataTestId,
|
|
1297
|
+
children: /* @__PURE__ */ jsxs12("div", { className: cn("flex items-center gap-2", containerClassName), children: [
|
|
1298
|
+
/* @__PURE__ */ jsx23(
|
|
1299
|
+
Input,
|
|
1300
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
1301
|
+
"data-testid": dataTestId,
|
|
1302
|
+
className: cn(
|
|
1303
|
+
props.className,
|
|
1304
|
+
props.error && "border-destructive focus:border-destructive focus-visible:ring-0"
|
|
1305
|
+
)
|
|
1306
|
+
})
|
|
1307
|
+
),
|
|
1308
|
+
extraElement
|
|
1309
|
+
] })
|
|
1310
|
+
}
|
|
1311
|
+
);
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
// src/components/dataInput/Input/components/NumberInput/number-input.tsx
|
|
1315
|
+
import {
|
|
1316
|
+
NumericFormat
|
|
1317
|
+
} from "react-number-format";
|
|
1318
|
+
import { useCallback as useCallback2, useMemo as useMemo5 } from "react";
|
|
1319
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1320
|
+
var NumberInput = (props) => {
|
|
1321
|
+
const formData = useConditionalController({
|
|
1322
|
+
name: props.name || "",
|
|
1323
|
+
withoutForm: props.withoutForm
|
|
1324
|
+
});
|
|
1325
|
+
const inputProps = useMemo5(() => {
|
|
1326
|
+
return __spreadValues(__spreadValues({}, formData), props);
|
|
1327
|
+
}, [formData, props]);
|
|
1328
|
+
const onValueChange = useCallback2(
|
|
1329
|
+
(data, sourceInfo) => {
|
|
1330
|
+
var _a, _b;
|
|
1331
|
+
const syntheticEvent = {
|
|
1332
|
+
target: {
|
|
1333
|
+
value: data.formattedValue,
|
|
1334
|
+
name: props.name
|
|
1335
|
+
},
|
|
1336
|
+
currentTarget: {
|
|
1337
|
+
value: data.formattedValue,
|
|
1338
|
+
name: props.name
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, syntheticEvent);
|
|
1342
|
+
(_b = props.onValueChange) == null ? void 0 : _b.call(props, data, sourceInfo);
|
|
1343
|
+
if (formData.onChange) {
|
|
1344
|
+
formData.onChange(data.formattedValue);
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
[props, formData]
|
|
1348
|
+
);
|
|
1349
|
+
return /* @__PURE__ */ jsx24(InputBase, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx24(
|
|
1350
|
+
NumericFormat,
|
|
1351
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
1352
|
+
customInput: Input,
|
|
1353
|
+
value: props.value,
|
|
1354
|
+
onValueChange
|
|
1355
|
+
})
|
|
1356
|
+
) }));
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
// src/components/dataInput/Input/components/MaskInput/mask-input.tsx
|
|
1360
|
+
import * as React12 from "react";
|
|
1361
|
+
|
|
1362
|
+
// src/hooks/use-mask.tsx
|
|
1363
|
+
import { useState as useState2, useCallback as useCallback3 } from "react";
|
|
1364
|
+
var useMask = (_a) => {
|
|
1365
|
+
var _b = _a, { mask } = _b, options = __objRest(_b, ["mask"]);
|
|
1366
|
+
const [value, setValue] = useState2("");
|
|
1367
|
+
const applyMask = useCallback3(
|
|
1368
|
+
(inputValue) => {
|
|
1369
|
+
if (!inputValue || !mask) return "";
|
|
1370
|
+
const cleanValue = inputValue.replace(/[^a-zA-Z0-9]/g, "");
|
|
1371
|
+
let maskedValue = "";
|
|
1372
|
+
let cleanIndex = 0;
|
|
1373
|
+
for (let i = 0; i < mask.length && cleanIndex < cleanValue.length; i++) {
|
|
1374
|
+
const maskChar = mask[i];
|
|
1375
|
+
const inputChar = cleanValue[cleanIndex];
|
|
1376
|
+
if (maskChar === "9") {
|
|
1377
|
+
if (/\d/.test(inputChar)) {
|
|
1378
|
+
maskedValue += inputChar;
|
|
1379
|
+
cleanIndex++;
|
|
1380
|
+
} else {
|
|
1381
|
+
cleanIndex++;
|
|
1382
|
+
i--;
|
|
1383
|
+
}
|
|
1384
|
+
} else if (maskChar === "A") {
|
|
1385
|
+
if (/[a-zA-Z]/.test(inputChar)) {
|
|
1386
|
+
let char = inputChar;
|
|
1387
|
+
if (options.transform === "uppercase") char = char.toUpperCase();
|
|
1388
|
+
else if (options.transform === "lowercase")
|
|
1389
|
+
char = char.toLowerCase();
|
|
1390
|
+
maskedValue += char;
|
|
1391
|
+
cleanIndex++;
|
|
1392
|
+
} else {
|
|
1393
|
+
cleanIndex++;
|
|
1394
|
+
i--;
|
|
1395
|
+
}
|
|
1396
|
+
} else {
|
|
1397
|
+
maskedValue += maskChar;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
return maskedValue;
|
|
1401
|
+
},
|
|
1402
|
+
[mask, options.transform]
|
|
1403
|
+
);
|
|
1404
|
+
const handleSetValue = useCallback3(
|
|
1405
|
+
(newValue) => {
|
|
1406
|
+
const maskedValue = applyMask(newValue);
|
|
1407
|
+
setValue(maskedValue);
|
|
1408
|
+
},
|
|
1409
|
+
[applyMask]
|
|
1410
|
+
);
|
|
1411
|
+
const getRawValue = useCallback3(() => {
|
|
1412
|
+
return value.replace(/[^a-zA-Z0-9]/g, "");
|
|
1413
|
+
}, [value]);
|
|
1414
|
+
const isComplete = useCallback3(() => {
|
|
1415
|
+
return value.length === mask.length;
|
|
1416
|
+
}, [value, mask]);
|
|
1417
|
+
const isValid = useCallback3(() => {
|
|
1418
|
+
return isComplete() && value.length > 0;
|
|
1419
|
+
}, [isComplete, value]);
|
|
1420
|
+
const clear = useCallback3(() => {
|
|
1421
|
+
setValue("");
|
|
1422
|
+
}, []);
|
|
1423
|
+
const getFormProps = useCallback3(
|
|
1424
|
+
() => ({
|
|
1425
|
+
value,
|
|
1426
|
+
onChange: (e) => {
|
|
1427
|
+
handleSetValue(e.target.value);
|
|
1428
|
+
},
|
|
1429
|
+
placeholder: options.placeholder
|
|
1430
|
+
}),
|
|
1431
|
+
[value, handleSetValue, options.placeholder]
|
|
1432
|
+
);
|
|
1433
|
+
return {
|
|
1434
|
+
value,
|
|
1435
|
+
setValue: handleSetValue,
|
|
1436
|
+
rawValue: getRawValue(),
|
|
1437
|
+
isComplete: isComplete(),
|
|
1438
|
+
isValid: isValid(),
|
|
1439
|
+
applyMask,
|
|
1440
|
+
clear,
|
|
1441
|
+
placeholder: options.placeholder || mask.replace(/[9A]/g, "_"),
|
|
1442
|
+
formProps: getFormProps()
|
|
1443
|
+
};
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
// src/components/dataInput/Input/components/MaskInput/mask-input.tsx
|
|
1447
|
+
import { useRef } from "react";
|
|
1448
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1449
|
+
var MaskInput = (_a) => {
|
|
1450
|
+
var _b = _a, {
|
|
1451
|
+
"data-testid": dataTestId,
|
|
1452
|
+
withoutForm = false,
|
|
1453
|
+
extraElement,
|
|
1454
|
+
mask = ""
|
|
1455
|
+
} = _b, props = __objRest(_b, [
|
|
1456
|
+
"data-testid",
|
|
1457
|
+
"withoutForm",
|
|
1458
|
+
"extraElement",
|
|
1459
|
+
"mask"
|
|
1460
|
+
]);
|
|
1461
|
+
const formData = useConditionalController({
|
|
1462
|
+
name: props.name || "",
|
|
1463
|
+
withoutForm
|
|
1464
|
+
});
|
|
1465
|
+
const inputProps = React12.useMemo(() => {
|
|
1466
|
+
return __spreadValues(__spreadValues({}, formData), props);
|
|
1467
|
+
}, [formData, props]);
|
|
1468
|
+
const { applyMask } = useMask({ mask });
|
|
1469
|
+
const inputRef = useRef(null);
|
|
1470
|
+
const applyMaskToInput = React12.useCallback(
|
|
1471
|
+
(value) => {
|
|
1472
|
+
if (inputRef.current && mask) {
|
|
1473
|
+
const maskedValue = applyMask(value);
|
|
1474
|
+
inputRef.current.value = maskedValue;
|
|
1475
|
+
}
|
|
1476
|
+
},
|
|
1477
|
+
[applyMask, mask]
|
|
1478
|
+
);
|
|
1479
|
+
const handleChange = React12.useCallback(
|
|
1480
|
+
(e) => {
|
|
1481
|
+
var _a2;
|
|
1482
|
+
const maskedValue = mask ? applyMask(e.target.value) : e.target.value;
|
|
1483
|
+
const response = __spreadProps(__spreadValues({}, e), {
|
|
1484
|
+
target: __spreadProps(__spreadValues({}, e.target), {
|
|
1485
|
+
value: maskedValue
|
|
1486
|
+
})
|
|
1487
|
+
});
|
|
1488
|
+
applyMaskToInput(maskedValue);
|
|
1489
|
+
return (_a2 = inputProps == null ? void 0 : inputProps.onChange) == null ? void 0 : _a2.call(inputProps, response);
|
|
1490
|
+
},
|
|
1491
|
+
[applyMask, inputProps, mask, applyMaskToInput]
|
|
1492
|
+
);
|
|
1493
|
+
return /* @__PURE__ */ jsx25(
|
|
1494
|
+
Input2,
|
|
1495
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
1496
|
+
ref: inputRef,
|
|
1497
|
+
onChange: handleChange,
|
|
1498
|
+
extraElement,
|
|
1499
|
+
"data-testid": dataTestId,
|
|
1500
|
+
withoutForm: true
|
|
1501
|
+
})
|
|
1502
|
+
);
|
|
1503
|
+
};
|
|
1504
|
+
|
|
1505
|
+
// src/components/actions/Button/Button.tsx
|
|
1506
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
1507
|
+
|
|
1508
|
+
// src/components/ui/spinner.tsx
|
|
1509
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1510
|
+
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1511
|
+
var spinnerVariants = cva5("flex-col items-center justify-center", {
|
|
1512
|
+
variants: {
|
|
1513
|
+
show: {
|
|
1514
|
+
true: "flex",
|
|
1515
|
+
false: "hidden"
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
defaultVariants: {
|
|
1519
|
+
show: true
|
|
1520
|
+
}
|
|
1521
|
+
});
|
|
1522
|
+
var loaderVariants = cva5("animate-spin text-primary", {
|
|
1523
|
+
variants: {
|
|
1524
|
+
size: {
|
|
1525
|
+
small: "size-6",
|
|
1526
|
+
medium: "size-8",
|
|
1527
|
+
large: "size-12"
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
defaultVariants: {
|
|
1531
|
+
size: "medium"
|
|
1532
|
+
}
|
|
1533
|
+
});
|
|
1534
|
+
function Spinner({
|
|
1535
|
+
size,
|
|
1536
|
+
show,
|
|
1537
|
+
children,
|
|
1538
|
+
className
|
|
1539
|
+
}) {
|
|
1540
|
+
return /* @__PURE__ */ jsxs13("span", { className: spinnerVariants({ show }), children: [
|
|
1541
|
+
/* @__PURE__ */ jsx26(
|
|
1542
|
+
Icon2,
|
|
1543
|
+
{
|
|
1544
|
+
name: "FaSpinner",
|
|
1545
|
+
className: cn(loaderVariants({ size }), className)
|
|
1546
|
+
}
|
|
1547
|
+
),
|
|
1548
|
+
children
|
|
1549
|
+
] });
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
// src/hooks/use-toast.ts
|
|
1553
|
+
import * as React13 from "react";
|
|
1554
|
+
var TOAST_LIMIT = 1;
|
|
1555
|
+
var TOAST_REMOVE_DELAY = 1e6;
|
|
1556
|
+
var count = 0;
|
|
1557
|
+
function genId() {
|
|
1558
|
+
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
1559
|
+
return count.toString();
|
|
1560
|
+
}
|
|
1561
|
+
var toastTimeouts = /* @__PURE__ */ new Map();
|
|
1562
|
+
var addToRemoveQueue = (toastId) => {
|
|
1563
|
+
if (toastTimeouts.has(toastId)) {
|
|
1564
|
+
return;
|
|
1565
|
+
}
|
|
1566
|
+
const timeout = setTimeout(() => {
|
|
1567
|
+
toastTimeouts.delete(toastId);
|
|
1568
|
+
dispatch({
|
|
1569
|
+
type: "REMOVE_TOAST",
|
|
1570
|
+
toastId
|
|
1571
|
+
});
|
|
1572
|
+
}, TOAST_REMOVE_DELAY);
|
|
1573
|
+
toastTimeouts.set(toastId, timeout);
|
|
1574
|
+
};
|
|
1575
|
+
var reducer = (state, action) => {
|
|
1576
|
+
switch (action.type) {
|
|
1577
|
+
case "ADD_TOAST":
|
|
1578
|
+
return __spreadProps(__spreadValues({}, state), {
|
|
1579
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
|
|
1580
|
+
});
|
|
1581
|
+
case "UPDATE_TOAST":
|
|
1582
|
+
return __spreadProps(__spreadValues({}, state), {
|
|
1583
|
+
toasts: state.toasts.map(
|
|
1584
|
+
(t) => t.id === action.toast.id ? __spreadValues(__spreadValues({}, t), action.toast) : t
|
|
1585
|
+
)
|
|
1586
|
+
});
|
|
1587
|
+
case "DISMISS_TOAST": {
|
|
1588
|
+
const { toastId } = action;
|
|
1589
|
+
if (toastId) {
|
|
1590
|
+
addToRemoveQueue(toastId);
|
|
1591
|
+
} else {
|
|
1592
|
+
state.toasts.forEach((toast2) => {
|
|
1593
|
+
addToRemoveQueue(toast2.id);
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
return __spreadProps(__spreadValues({}, state), {
|
|
1597
|
+
toasts: state.toasts.map(
|
|
1598
|
+
(t) => t.id === toastId || toastId === void 0 ? __spreadProps(__spreadValues({}, t), {
|
|
1599
|
+
open: false
|
|
1600
|
+
}) : t
|
|
1601
|
+
)
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
case "REMOVE_TOAST":
|
|
1605
|
+
if (action.toastId === void 0) {
|
|
1606
|
+
return __spreadProps(__spreadValues({}, state), {
|
|
1607
|
+
toasts: []
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
return __spreadProps(__spreadValues({}, state), {
|
|
1611
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId)
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
var listeners = [];
|
|
1616
|
+
var memoryState = { toasts: [] };
|
|
1617
|
+
function dispatch(action) {
|
|
1618
|
+
memoryState = reducer(memoryState, action);
|
|
1619
|
+
listeners.forEach((listener) => {
|
|
1620
|
+
listener(memoryState);
|
|
1621
|
+
});
|
|
1622
|
+
}
|
|
1623
|
+
function toast(_a) {
|
|
1624
|
+
var props = __objRest(_a, []);
|
|
1625
|
+
const id = genId();
|
|
1626
|
+
const update = (props2) => dispatch({
|
|
1627
|
+
type: "UPDATE_TOAST",
|
|
1628
|
+
toast: __spreadProps(__spreadValues({}, props2), { id })
|
|
1629
|
+
});
|
|
1630
|
+
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
|
1631
|
+
dispatch({
|
|
1632
|
+
type: "ADD_TOAST",
|
|
1633
|
+
toast: __spreadProps(__spreadValues({}, props), {
|
|
1634
|
+
id,
|
|
1635
|
+
open: true,
|
|
1636
|
+
onOpenChange: (open) => {
|
|
1637
|
+
if (!open) dismiss();
|
|
1638
|
+
}
|
|
1639
|
+
})
|
|
1640
|
+
});
|
|
1641
|
+
return {
|
|
1642
|
+
id,
|
|
1643
|
+
dismiss,
|
|
1644
|
+
update
|
|
1645
|
+
};
|
|
1646
|
+
}
|
|
1647
|
+
function useToast() {
|
|
1648
|
+
const [state, setState] = React13.useState(memoryState);
|
|
1649
|
+
React13.useEffect(() => {
|
|
1650
|
+
listeners.push(setState);
|
|
1651
|
+
return () => {
|
|
1652
|
+
const index = listeners.indexOf(setState);
|
|
1653
|
+
if (index > -1) {
|
|
1654
|
+
listeners.splice(index, 1);
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
}, [state]);
|
|
1658
|
+
return __spreadProps(__spreadValues({}, state), {
|
|
1659
|
+
toast,
|
|
1660
|
+
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
// src/components/ui/toast.tsx
|
|
1665
|
+
import * as React14 from "react";
|
|
1666
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
1667
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
1668
|
+
import { X } from "lucide-react";
|
|
1669
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1670
|
+
var ToastProvider = ToastPrimitives.Provider;
|
|
1671
|
+
var ToastViewport = React14.forwardRef((_a, ref) => {
|
|
1672
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1673
|
+
return /* @__PURE__ */ jsx27(
|
|
1674
|
+
ToastPrimitives.Viewport,
|
|
1675
|
+
__spreadValues({
|
|
1676
|
+
ref,
|
|
1677
|
+
className: cn(
|
|
1678
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
1679
|
+
className
|
|
1680
|
+
)
|
|
1681
|
+
}, props)
|
|
1682
|
+
);
|
|
1683
|
+
});
|
|
1684
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
1685
|
+
var toastVariants = cva6(
|
|
1686
|
+
"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",
|
|
1687
|
+
{
|
|
1688
|
+
variants: {
|
|
1689
|
+
variant: {
|
|
1690
|
+
default: "border bg-background text-foreground",
|
|
1691
|
+
success: "border-success bg-success text-success-foreground",
|
|
1692
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
1693
|
+
}
|
|
1694
|
+
},
|
|
1695
|
+
defaultVariants: {
|
|
1696
|
+
variant: "default"
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1700
|
+
var Toast = React14.forwardRef((_a, ref) => {
|
|
1701
|
+
var _b = _a, { className, variant } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
1702
|
+
return /* @__PURE__ */ jsx27(
|
|
1703
|
+
ToastPrimitives.Root,
|
|
1704
|
+
__spreadValues({
|
|
1705
|
+
ref,
|
|
1706
|
+
className: cn(toastVariants({ variant }), className)
|
|
1707
|
+
}, props)
|
|
1708
|
+
);
|
|
1709
|
+
});
|
|
1710
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
1711
|
+
var ToastAction = React14.forwardRef((_a, ref) => {
|
|
1712
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1713
|
+
return /* @__PURE__ */ jsx27(
|
|
1714
|
+
ToastPrimitives.Action,
|
|
1715
|
+
__spreadValues({
|
|
1716
|
+
ref,
|
|
1717
|
+
className: cn(
|
|
1718
|
+
"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",
|
|
1719
|
+
className
|
|
1720
|
+
)
|
|
1721
|
+
}, props)
|
|
1722
|
+
);
|
|
1723
|
+
});
|
|
1724
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
1725
|
+
var ToastClose = React14.forwardRef((_a, ref) => {
|
|
1726
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1727
|
+
return /* @__PURE__ */ jsx27(
|
|
1728
|
+
ToastPrimitives.Close,
|
|
1729
|
+
__spreadProps(__spreadValues({
|
|
1730
|
+
ref,
|
|
1731
|
+
className: cn(
|
|
1732
|
+
"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
1733
|
+
className
|
|
1734
|
+
),
|
|
1735
|
+
"toast-close": ""
|
|
1736
|
+
}, props), {
|
|
1737
|
+
children: /* @__PURE__ */ jsx27(X, { className: "h-4 w-4" })
|
|
1738
|
+
})
|
|
1739
|
+
);
|
|
1740
|
+
});
|
|
1741
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
1742
|
+
var ToastTitle = React14.forwardRef((_a, ref) => {
|
|
1743
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1744
|
+
return /* @__PURE__ */ jsx27(
|
|
1745
|
+
ToastPrimitives.Title,
|
|
1746
|
+
__spreadValues({
|
|
1747
|
+
ref,
|
|
1748
|
+
className: cn("text-sm font-semibold [&+div]:text-xs", className)
|
|
1749
|
+
}, props)
|
|
1750
|
+
);
|
|
1751
|
+
});
|
|
1752
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
1753
|
+
var ToastDescription = React14.forwardRef((_a, ref) => {
|
|
1754
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1755
|
+
return /* @__PURE__ */ jsx27(
|
|
1756
|
+
ToastPrimitives.Description,
|
|
1757
|
+
__spreadValues({
|
|
1758
|
+
ref,
|
|
1759
|
+
className: cn("text-sm opacity-90", className)
|
|
1760
|
+
}, props)
|
|
1761
|
+
);
|
|
1762
|
+
});
|
|
1763
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
1764
|
+
|
|
1765
|
+
// src/components/ui/toaster.tsx
|
|
1766
|
+
import { jsx as jsx28, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1767
|
+
function Toaster() {
|
|
1768
|
+
const { toasts } = useToast();
|
|
1769
|
+
return /* @__PURE__ */ jsxs14(ToastProvider, { children: [
|
|
1770
|
+
toasts.map(function(_a) {
|
|
1771
|
+
var _b = _a, { id, title, description, action } = _b, props = __objRest(_b, ["id", "title", "description", "action"]);
|
|
1772
|
+
return /* @__PURE__ */ jsxs14(Toast, __spreadProps(__spreadValues({}, props), { children: [
|
|
1773
|
+
/* @__PURE__ */ jsxs14("div", { className: "grid gap-1", children: [
|
|
1774
|
+
title && /* @__PURE__ */ jsx28(ToastTitle, { children: title }),
|
|
1775
|
+
description && /* @__PURE__ */ jsx28(ToastDescription, { children: description })
|
|
1776
|
+
] }),
|
|
1777
|
+
action,
|
|
1778
|
+
/* @__PURE__ */ jsx28(ToastClose, {})
|
|
1779
|
+
] }), id);
|
|
1780
|
+
}),
|
|
1781
|
+
/* @__PURE__ */ jsx28(ToastViewport, {})
|
|
1782
|
+
] });
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
// src/components/actions/Button/Button.tsx
|
|
1786
|
+
import { jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1787
|
+
var Button2 = forwardRef11(
|
|
1788
|
+
(_a, ref) => {
|
|
1789
|
+
var _b = _a, { children, disabled, loading } = _b, rest = __objRest(_b, ["children", "disabled", "loading"]);
|
|
1790
|
+
return /* @__PURE__ */ jsxs15(Button, __spreadProps(__spreadValues({}, rest), { disabled: disabled || loading, ref, children: [
|
|
1791
|
+
loading && /* @__PURE__ */ jsx29(Spinner, { className: "fill-white" }),
|
|
1792
|
+
children
|
|
1793
|
+
] }));
|
|
1794
|
+
}
|
|
1795
|
+
);
|
|
1796
|
+
Button2.displayName = "Button";
|
|
1797
|
+
|
|
1798
|
+
// src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx
|
|
1799
|
+
import { useCallback as useCallback5, useMemo as useMemo7, useState as useState4 } from "react";
|
|
1800
|
+
import { jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1801
|
+
var MultipleInput = (_a) => {
|
|
1802
|
+
var _b = _a, {
|
|
1803
|
+
data = [],
|
|
1804
|
+
onAdd = () => {
|
|
1805
|
+
},
|
|
1806
|
+
defaultValue = "",
|
|
1807
|
+
onRemove = () => {
|
|
1808
|
+
},
|
|
1809
|
+
withoutForm = false
|
|
1810
|
+
} = _b, props = __objRest(_b, [
|
|
1811
|
+
"data",
|
|
1812
|
+
"onAdd",
|
|
1813
|
+
"defaultValue",
|
|
1814
|
+
"onRemove",
|
|
1815
|
+
"withoutForm"
|
|
1816
|
+
]);
|
|
1817
|
+
const [inputValue, setInputValue] = useState4(defaultValue);
|
|
1818
|
+
const formData = useConditionalController({
|
|
1819
|
+
name: props.name || "",
|
|
1820
|
+
withoutForm
|
|
1821
|
+
});
|
|
1822
|
+
const inputItems = useMemo7(() => {
|
|
1823
|
+
if (formData == null ? void 0 : formData.value) {
|
|
1824
|
+
return formData.value;
|
|
1825
|
+
}
|
|
1826
|
+
return data;
|
|
1827
|
+
}, [data, formData]);
|
|
1828
|
+
const onAddData = useCallback5(() => {
|
|
1829
|
+
const trimmedValue = inputValue.trim();
|
|
1830
|
+
if (trimmedValue) {
|
|
1831
|
+
if (formData == null ? void 0 : formData.onChange) {
|
|
1832
|
+
formData.onChange([...inputItems, trimmedValue]);
|
|
1833
|
+
} else {
|
|
1834
|
+
onAdd(trimmedValue);
|
|
1835
|
+
}
|
|
1836
|
+
setInputValue("");
|
|
1837
|
+
}
|
|
1838
|
+
}, [inputValue, formData, onAdd, inputItems]);
|
|
1839
|
+
const onRemoveData = useCallback5(
|
|
1840
|
+
(index) => {
|
|
1841
|
+
if (formData == null ? void 0 : formData.onChange) {
|
|
1842
|
+
const newData = inputItems.filter(
|
|
1843
|
+
(_2, i) => i !== index
|
|
1844
|
+
);
|
|
1845
|
+
formData.onChange(newData);
|
|
1846
|
+
} else {
|
|
1847
|
+
onRemove(index);
|
|
1848
|
+
}
|
|
1849
|
+
},
|
|
1850
|
+
[formData, inputItems, onRemove]
|
|
1851
|
+
);
|
|
1852
|
+
const renderItens = useCallback5(() => {
|
|
1853
|
+
return inputItems == null ? void 0 : inputItems.map((item, index) => {
|
|
1854
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex justify-between", children: [
|
|
1855
|
+
item,
|
|
1856
|
+
/* @__PURE__ */ jsx30(
|
|
1857
|
+
Button2,
|
|
1858
|
+
{
|
|
1859
|
+
variant: "ghost",
|
|
1860
|
+
className: "text-destructive",
|
|
1861
|
+
size: "icon",
|
|
1862
|
+
onClick: () => onRemoveData(index),
|
|
1863
|
+
children: /* @__PURE__ */ jsx30(Icon2, { name: "MdDelete" })
|
|
1864
|
+
}
|
|
1865
|
+
)
|
|
1866
|
+
] }, item);
|
|
1867
|
+
});
|
|
1868
|
+
}, [inputItems, onRemoveData]);
|
|
1869
|
+
const extraElement = useMemo7(
|
|
1870
|
+
() => /* @__PURE__ */ jsx30(Button2, { type: "button", onClick: onAddData, disabled: !inputValue, children: /* @__PURE__ */ jsx30(Icon2, { name: "MdAdd" }) }),
|
|
1871
|
+
[onAddData, inputValue]
|
|
1872
|
+
);
|
|
1873
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2", children: [
|
|
1874
|
+
/* @__PURE__ */ jsx30(
|
|
1875
|
+
MaskInput,
|
|
1876
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1877
|
+
withoutForm: true,
|
|
1878
|
+
extraElement,
|
|
1879
|
+
onChange: (e) => {
|
|
1880
|
+
setInputValue(e.target.value);
|
|
1881
|
+
},
|
|
1882
|
+
value: inputValue
|
|
1883
|
+
})
|
|
1884
|
+
),
|
|
1885
|
+
renderItens()
|
|
1886
|
+
] });
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
// src/components/ui/dialog.tsx
|
|
1890
|
+
import * as React15 from "react";
|
|
1891
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1892
|
+
import { X as X2 } from "lucide-react";
|
|
1893
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1894
|
+
var Dialog = DialogPrimitive.Root;
|
|
1895
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
1896
|
+
var DialogClose = DialogPrimitive.Close;
|
|
1897
|
+
var DialogOverlay = React15.forwardRef((_a, ref) => {
|
|
1898
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1899
|
+
return /* @__PURE__ */ jsx31(
|
|
1900
|
+
DialogPrimitive.Overlay,
|
|
1901
|
+
__spreadValues({
|
|
1902
|
+
ref,
|
|
1903
|
+
className: cn(
|
|
1904
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1905
|
+
className
|
|
1906
|
+
)
|
|
1907
|
+
}, props)
|
|
1908
|
+
);
|
|
1909
|
+
});
|
|
1910
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1911
|
+
var DialogContent = React15.forwardRef((_a, ref) => {
|
|
1912
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1913
|
+
return /* @__PURE__ */ jsxs17(DialogPortal, { children: [
|
|
1914
|
+
/* @__PURE__ */ jsx31(DialogOverlay, {}),
|
|
1915
|
+
/* @__PURE__ */ jsxs17(
|
|
1916
|
+
DialogPrimitive.Content,
|
|
1917
|
+
__spreadProps(__spreadValues({
|
|
1918
|
+
ref,
|
|
1919
|
+
className: cn(
|
|
1920
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg overflow-auto max-h-[80vh]",
|
|
1921
|
+
className
|
|
1922
|
+
)
|
|
1923
|
+
}, props), {
|
|
1924
|
+
children: [
|
|
1925
|
+
children,
|
|
1926
|
+
/* @__PURE__ */ jsxs17(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1927
|
+
/* @__PURE__ */ jsx31(X2, { className: "h-4 w-4" }),
|
|
1928
|
+
/* @__PURE__ */ jsx31("span", { className: "sr-only", children: "Close" })
|
|
1929
|
+
] })
|
|
1930
|
+
]
|
|
1931
|
+
})
|
|
1932
|
+
)
|
|
1933
|
+
] });
|
|
1934
|
+
});
|
|
1935
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1936
|
+
var DialogHeader = (_a) => {
|
|
1937
|
+
var _b = _a, {
|
|
1938
|
+
className
|
|
1939
|
+
} = _b, props = __objRest(_b, [
|
|
1940
|
+
"className"
|
|
1941
|
+
]);
|
|
1942
|
+
return /* @__PURE__ */ jsx31(
|
|
1943
|
+
"div",
|
|
1944
|
+
__spreadValues({
|
|
1945
|
+
className: cn(
|
|
1946
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
1947
|
+
className
|
|
1948
|
+
)
|
|
1949
|
+
}, props)
|
|
1950
|
+
);
|
|
1951
|
+
};
|
|
1952
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1953
|
+
var DialogFooter = (_a) => {
|
|
1954
|
+
var _b = _a, {
|
|
1955
|
+
className
|
|
1956
|
+
} = _b, props = __objRest(_b, [
|
|
1957
|
+
"className"
|
|
1958
|
+
]);
|
|
1959
|
+
return /* @__PURE__ */ jsx31(
|
|
1960
|
+
"div",
|
|
1961
|
+
__spreadValues({
|
|
1962
|
+
className: cn(
|
|
1963
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
1964
|
+
className
|
|
1965
|
+
)
|
|
1966
|
+
}, props)
|
|
1967
|
+
);
|
|
1968
|
+
};
|
|
1969
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1970
|
+
var DialogTitle = React15.forwardRef((_a, ref) => {
|
|
1971
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1972
|
+
return /* @__PURE__ */ jsx31(
|
|
1973
|
+
DialogPrimitive.Title,
|
|
1974
|
+
__spreadValues({
|
|
1975
|
+
ref,
|
|
1976
|
+
className: cn(
|
|
1977
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
1978
|
+
className
|
|
1979
|
+
)
|
|
1980
|
+
}, props)
|
|
1981
|
+
);
|
|
1982
|
+
});
|
|
1983
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1984
|
+
var DialogDescription = React15.forwardRef((_a, ref) => {
|
|
1985
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1986
|
+
return /* @__PURE__ */ jsx31(
|
|
1987
|
+
DialogPrimitive.Description,
|
|
1988
|
+
__spreadValues({
|
|
1989
|
+
ref,
|
|
1990
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
1991
|
+
}, props)
|
|
1992
|
+
);
|
|
1993
|
+
});
|
|
1994
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1995
|
+
|
|
1996
|
+
// src/components/actions/Dialog/Dialog.tsx
|
|
1997
|
+
import { useRef as useRef2 } from "react";
|
|
1998
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1999
|
+
function Dialog2(_a) {
|
|
2000
|
+
var _b = _a, {
|
|
2001
|
+
title,
|
|
2002
|
+
description,
|
|
2003
|
+
className,
|
|
2004
|
+
children,
|
|
2005
|
+
footer = () => null
|
|
2006
|
+
} = _b, props = __objRest(_b, [
|
|
2007
|
+
"title",
|
|
2008
|
+
"description",
|
|
2009
|
+
"className",
|
|
2010
|
+
"children",
|
|
2011
|
+
"footer"
|
|
2012
|
+
]);
|
|
2013
|
+
return /* @__PURE__ */ jsx32(Dialog, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxs18(DialogContent, { className, children: [
|
|
2014
|
+
/* @__PURE__ */ jsxs18(DialogHeader, { children: [
|
|
2015
|
+
title && /* @__PURE__ */ jsx32(DialogTitle, { children: title }),
|
|
2016
|
+
description && /* @__PURE__ */ jsx32(DialogDescription, { children: description })
|
|
2017
|
+
] }),
|
|
2018
|
+
children,
|
|
2019
|
+
footer && /* @__PURE__ */ jsx32(DialogFooter, { children: footer() })
|
|
2020
|
+
] }) }));
|
|
2021
|
+
}
|
|
2022
|
+
var DialogWithForm = (_a) => {
|
|
2023
|
+
var _b = _a, {
|
|
2024
|
+
title,
|
|
2025
|
+
description,
|
|
2026
|
+
className,
|
|
2027
|
+
children,
|
|
2028
|
+
footer = () => null,
|
|
2029
|
+
onSubmit = () => {
|
|
2030
|
+
}
|
|
2031
|
+
} = _b, props = __objRest(_b, [
|
|
2032
|
+
"title",
|
|
2033
|
+
"description",
|
|
2034
|
+
"className",
|
|
2035
|
+
"children",
|
|
2036
|
+
"footer",
|
|
2037
|
+
"onSubmit"
|
|
2038
|
+
]);
|
|
2039
|
+
const dialogRef = useRef2(null);
|
|
2040
|
+
return /* @__PURE__ */ jsx32(Dialog, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx32(DialogContent, { className, ref: dialogRef, children: /* @__PURE__ */ jsxs18("form", { onSubmit, className: "flex flex-col gap-4", children: [
|
|
2041
|
+
/* @__PURE__ */ jsxs18(DialogHeader, { children: [
|
|
2042
|
+
title && /* @__PURE__ */ jsx32(DialogTitle, { children: title }),
|
|
2043
|
+
description && /* @__PURE__ */ jsx32(DialogDescription, { children: description })
|
|
2044
|
+
] }),
|
|
2045
|
+
children,
|
|
2046
|
+
footer && /* @__PURE__ */ jsx32(DialogFooter, { children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between w-full", children: [
|
|
2047
|
+
/* @__PURE__ */ jsx32(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx32(Button2, { type: "button", variant: "secondary", children: "Fechar" }) }),
|
|
2048
|
+
footer()
|
|
2049
|
+
] }) })
|
|
2050
|
+
] }) }) }));
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
// src/components/ui/collapsible.tsx
|
|
2054
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2055
|
+
var Collapsible = CollapsiblePrimitive.Root;
|
|
2056
|
+
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
2057
|
+
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
2058
|
+
|
|
2059
|
+
// src/components/actions/Steps/Steps.tsx
|
|
2060
|
+
import { useCallback as useCallback8 } from "react";
|
|
2061
|
+
|
|
2062
|
+
// src/components/ui/drawer.tsx
|
|
2063
|
+
import * as React16 from "react";
|
|
2064
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
2065
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2066
|
+
var Drawer = (_a) => {
|
|
2067
|
+
var _b = _a, { shouldScaleBackground = true } = _b, props = __objRest(_b, ["shouldScaleBackground"]);
|
|
2068
|
+
return /* @__PURE__ */ jsx33(
|
|
2069
|
+
DrawerPrimitive.Root,
|
|
2070
|
+
__spreadValues({
|
|
2071
|
+
shouldScaleBackground
|
|
2072
|
+
}, props)
|
|
2073
|
+
);
|
|
2074
|
+
};
|
|
2075
|
+
Drawer.displayName = "Drawer";
|
|
2076
|
+
var DrawerTrigger = DrawerPrimitive.Trigger;
|
|
2077
|
+
var DrawerPortal = DrawerPrimitive.Portal;
|
|
2078
|
+
var DrawerClose = DrawerPrimitive.Close;
|
|
2079
|
+
var DrawerOverlay = React16.forwardRef((_a, ref) => {
|
|
2080
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2081
|
+
return /* @__PURE__ */ jsx33(
|
|
2082
|
+
DrawerPrimitive.Overlay,
|
|
2083
|
+
__spreadValues({
|
|
2084
|
+
ref,
|
|
2085
|
+
className: cn("fixed inset-0 z-50 bg-black/80", className)
|
|
2086
|
+
}, props)
|
|
2087
|
+
);
|
|
2088
|
+
});
|
|
2089
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
2090
|
+
var DrawerContent = React16.forwardRef((_a, ref) => {
|
|
2091
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
2092
|
+
return /* @__PURE__ */ jsxs19(DrawerPortal, { children: [
|
|
2093
|
+
/* @__PURE__ */ jsx33(DrawerOverlay, {}),
|
|
2094
|
+
/* @__PURE__ */ jsxs19(
|
|
2095
|
+
DrawerPrimitive.Content,
|
|
2096
|
+
__spreadProps(__spreadValues({
|
|
2097
|
+
ref,
|
|
2098
|
+
className: cn(
|
|
2099
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
2100
|
+
className
|
|
2101
|
+
)
|
|
2102
|
+
}, props), {
|
|
2103
|
+
children: [
|
|
2104
|
+
/* @__PURE__ */ jsx33("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
|
|
2105
|
+
children
|
|
2106
|
+
]
|
|
2107
|
+
})
|
|
2108
|
+
)
|
|
2109
|
+
] });
|
|
2110
|
+
});
|
|
2111
|
+
DrawerContent.displayName = "DrawerContent";
|
|
2112
|
+
var DrawerHeader = (_a) => {
|
|
2113
|
+
var _b = _a, {
|
|
2114
|
+
className
|
|
2115
|
+
} = _b, props = __objRest(_b, [
|
|
2116
|
+
"className"
|
|
2117
|
+
]);
|
|
2118
|
+
return /* @__PURE__ */ jsx33(
|
|
2119
|
+
"div",
|
|
2120
|
+
__spreadValues({
|
|
2121
|
+
className: cn("grid gap-1.5 p-4 text-center sm:text-left", className)
|
|
2122
|
+
}, props)
|
|
2123
|
+
);
|
|
2124
|
+
};
|
|
2125
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
2126
|
+
var DrawerFooter = (_a) => {
|
|
2127
|
+
var _b = _a, {
|
|
2128
|
+
className
|
|
2129
|
+
} = _b, props = __objRest(_b, [
|
|
2130
|
+
"className"
|
|
2131
|
+
]);
|
|
2132
|
+
return /* @__PURE__ */ jsx33(
|
|
2133
|
+
"div",
|
|
2134
|
+
__spreadValues({
|
|
2135
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className)
|
|
2136
|
+
}, props)
|
|
2137
|
+
);
|
|
2138
|
+
};
|
|
2139
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
2140
|
+
var DrawerTitle = React16.forwardRef((_a, ref) => {
|
|
2141
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2142
|
+
return /* @__PURE__ */ jsx33(
|
|
2143
|
+
DrawerPrimitive.Title,
|
|
2144
|
+
__spreadValues({
|
|
2145
|
+
ref,
|
|
2146
|
+
className: cn(
|
|
2147
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
2148
|
+
className
|
|
2149
|
+
)
|
|
2150
|
+
}, props)
|
|
2151
|
+
);
|
|
2152
|
+
});
|
|
2153
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
2154
|
+
var DrawerDescription = React16.forwardRef((_a, ref) => {
|
|
2155
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2156
|
+
return /* @__PURE__ */ jsx33(
|
|
2157
|
+
DrawerPrimitive.Description,
|
|
2158
|
+
__spreadValues({
|
|
2159
|
+
ref,
|
|
2160
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
2161
|
+
}, props)
|
|
2162
|
+
);
|
|
2163
|
+
});
|
|
2164
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
2165
|
+
|
|
2166
|
+
// src/components/layout/Drawer/CustomDrawer/index.tsx
|
|
2167
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2168
|
+
function CustomDrawer(_a) {
|
|
2169
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2170
|
+
return /* @__PURE__ */ jsx34(Drawer, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx34(DrawerContent, { className, children: props.children }) }));
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
// src/components/ui/sheet.tsx
|
|
2174
|
+
import * as React17 from "react";
|
|
2175
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
2176
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
2177
|
+
import { X as X3 } from "lucide-react";
|
|
2178
|
+
import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2179
|
+
var Sheet = SheetPrimitive.Root;
|
|
2180
|
+
var SheetPortal = SheetPrimitive.Portal;
|
|
2181
|
+
var SheetOverlay = React17.forwardRef((_a, ref) => {
|
|
2182
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2183
|
+
return /* @__PURE__ */ jsx35(
|
|
2184
|
+
SheetPrimitive.Overlay,
|
|
2185
|
+
__spreadProps(__spreadValues({
|
|
2186
|
+
className: cn(
|
|
2187
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2188
|
+
className
|
|
2189
|
+
)
|
|
2190
|
+
}, props), {
|
|
2191
|
+
ref
|
|
2192
|
+
})
|
|
2193
|
+
);
|
|
2194
|
+
});
|
|
2195
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
2196
|
+
var sheetVariants = cva7(
|
|
2197
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2198
|
+
{
|
|
2199
|
+
variants: {
|
|
2200
|
+
side: {
|
|
2201
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
2202
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
2203
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
2204
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
2205
|
+
}
|
|
2206
|
+
},
|
|
2207
|
+
defaultVariants: {
|
|
2208
|
+
side: "right"
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
);
|
|
2212
|
+
var SheetContent = React17.forwardRef((_a, ref) => {
|
|
2213
|
+
var _b = _a, { side = "right", className, children } = _b, props = __objRest(_b, ["side", "className", "children"]);
|
|
2214
|
+
return /* @__PURE__ */ jsxs20(SheetPortal, { children: [
|
|
2215
|
+
/* @__PURE__ */ jsx35(SheetOverlay, {}),
|
|
2216
|
+
/* @__PURE__ */ jsxs20(
|
|
2217
|
+
SheetPrimitive.Content,
|
|
2218
|
+
__spreadProps(__spreadValues({
|
|
2219
|
+
ref,
|
|
2220
|
+
className: cn(sheetVariants({ side }), className)
|
|
2221
|
+
}, props), {
|
|
2222
|
+
children: [
|
|
2223
|
+
/* @__PURE__ */ jsxs20(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
2224
|
+
/* @__PURE__ */ jsx35(X3, { className: "h-4 w-4" }),
|
|
2225
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Close" })
|
|
2226
|
+
] }),
|
|
2227
|
+
children
|
|
2228
|
+
]
|
|
2229
|
+
})
|
|
2230
|
+
)
|
|
2231
|
+
] });
|
|
2232
|
+
});
|
|
2233
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
2234
|
+
var SheetHeader = (_a) => {
|
|
2235
|
+
var _b = _a, {
|
|
2236
|
+
className
|
|
2237
|
+
} = _b, props = __objRest(_b, [
|
|
2238
|
+
"className"
|
|
2239
|
+
]);
|
|
2240
|
+
return /* @__PURE__ */ jsx35(
|
|
2241
|
+
"div",
|
|
2242
|
+
__spreadValues({
|
|
2243
|
+
className: cn(
|
|
2244
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
2245
|
+
className
|
|
2246
|
+
)
|
|
2247
|
+
}, props)
|
|
2248
|
+
);
|
|
2249
|
+
};
|
|
2250
|
+
SheetHeader.displayName = "SheetHeader";
|
|
2251
|
+
var SheetFooter = (_a) => {
|
|
2252
|
+
var _b = _a, {
|
|
2253
|
+
className
|
|
2254
|
+
} = _b, props = __objRest(_b, [
|
|
2255
|
+
"className"
|
|
2256
|
+
]);
|
|
2257
|
+
return /* @__PURE__ */ jsx35(
|
|
2258
|
+
"div",
|
|
2259
|
+
__spreadValues({
|
|
2260
|
+
className: cn(
|
|
2261
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
2262
|
+
className
|
|
2263
|
+
)
|
|
2264
|
+
}, props)
|
|
2265
|
+
);
|
|
2266
|
+
};
|
|
2267
|
+
SheetFooter.displayName = "SheetFooter";
|
|
2268
|
+
var SheetTitle = React17.forwardRef((_a, ref) => {
|
|
2269
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2270
|
+
return /* @__PURE__ */ jsx35(
|
|
2271
|
+
SheetPrimitive.Title,
|
|
2272
|
+
__spreadValues({
|
|
2273
|
+
ref,
|
|
2274
|
+
className: cn("text-lg font-semibold text-foreground", className)
|
|
2275
|
+
}, props)
|
|
2276
|
+
);
|
|
2277
|
+
});
|
|
2278
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
2279
|
+
var SheetDescription = React17.forwardRef((_a, ref) => {
|
|
2280
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2281
|
+
return /* @__PURE__ */ jsx35(
|
|
2282
|
+
SheetPrimitive.Description,
|
|
2283
|
+
__spreadValues({
|
|
2284
|
+
ref,
|
|
2285
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
2286
|
+
}, props)
|
|
2287
|
+
);
|
|
2288
|
+
});
|
|
2289
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
2290
|
+
|
|
2291
|
+
// src/components/layout/Sheet/Sheet.tsx
|
|
2292
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2293
|
+
function Sheet2(_a) {
|
|
2294
|
+
var _b = _a, { side, className, children } = _b, props = __objRest(_b, ["side", "className", "children"]);
|
|
2295
|
+
return /* @__PURE__ */ jsx36(Sheet, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx36(SheetContent, { side, className, children }) }));
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
// src/components/ui/sidebar.tsx
|
|
2299
|
+
import * as React21 from "react";
|
|
2300
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
2301
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
2302
|
+
import { PanelLeft } from "lucide-react";
|
|
2303
|
+
|
|
2304
|
+
// src/hooks/use-mobile.tsx
|
|
2305
|
+
import * as React18 from "react";
|
|
2306
|
+
var MOBILE_BREAKPOINT = 768;
|
|
2307
|
+
function useIsMobile() {
|
|
2308
|
+
const [isMobile, setIsMobile] = React18.useState(void 0);
|
|
2309
|
+
React18.useEffect(() => {
|
|
2310
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
2311
|
+
const onChange = () => {
|
|
2312
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
2313
|
+
};
|
|
2314
|
+
mql.addEventListener("change", onChange);
|
|
2315
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
2316
|
+
return () => mql.removeEventListener("change", onChange);
|
|
2317
|
+
}, []);
|
|
2318
|
+
return !!isMobile;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
// src/components/ui/separator.tsx
|
|
2322
|
+
import * as React19 from "react";
|
|
2323
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2324
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2325
|
+
var Separator3 = React19.forwardRef(
|
|
2326
|
+
(_a, ref) => {
|
|
2327
|
+
var _b = _a, { className, orientation = "horizontal", decorative = true } = _b, props = __objRest(_b, ["className", "orientation", "decorative"]);
|
|
2328
|
+
return /* @__PURE__ */ jsx37(
|
|
2329
|
+
SeparatorPrimitive.Root,
|
|
2330
|
+
__spreadValues({
|
|
2331
|
+
ref,
|
|
2332
|
+
decorative,
|
|
2333
|
+
orientation,
|
|
2334
|
+
className: cn(
|
|
2335
|
+
"shrink-0 bg-border",
|
|
2336
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
2337
|
+
className
|
|
2338
|
+
)
|
|
2339
|
+
}, props)
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
);
|
|
2343
|
+
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
2344
|
+
|
|
2345
|
+
// src/components/ui/skeleton.tsx
|
|
2346
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
2347
|
+
function Skeleton(_a) {
|
|
2348
|
+
var _b = _a, {
|
|
2349
|
+
className
|
|
2350
|
+
} = _b, props = __objRest(_b, [
|
|
2351
|
+
"className"
|
|
2352
|
+
]);
|
|
2353
|
+
return /* @__PURE__ */ jsx38(
|
|
2354
|
+
"div",
|
|
2355
|
+
__spreadValues({
|
|
2356
|
+
className: cn("animate-pulse rounded-md bg-primary/10", className)
|
|
2357
|
+
}, props)
|
|
2358
|
+
);
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
// src/components/ui/tooltip.tsx
|
|
2362
|
+
import * as React20 from "react";
|
|
2363
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2364
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2365
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2366
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
2367
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2368
|
+
var TooltipContent = React20.forwardRef((_a, ref) => {
|
|
2369
|
+
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
|
2370
|
+
return /* @__PURE__ */ jsx39(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx39(
|
|
2371
|
+
TooltipPrimitive.Content,
|
|
2372
|
+
__spreadValues({
|
|
2373
|
+
ref,
|
|
2374
|
+
sideOffset,
|
|
2375
|
+
className: cn(
|
|
2376
|
+
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
|
|
2377
|
+
className
|
|
2378
|
+
)
|
|
2379
|
+
}, props)
|
|
2380
|
+
) });
|
|
2381
|
+
});
|
|
2382
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2383
|
+
|
|
2384
|
+
// src/components/ui/sidebar.tsx
|
|
2385
|
+
import { jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2386
|
+
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
2387
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
2388
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
2389
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
2390
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
2391
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
2392
|
+
var SidebarContext = React21.createContext(null);
|
|
2393
|
+
function useSidebar() {
|
|
2394
|
+
const context = React21.useContext(SidebarContext);
|
|
2395
|
+
if (!context) {
|
|
2396
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
2397
|
+
}
|
|
2398
|
+
return context;
|
|
2399
|
+
}
|
|
2400
|
+
var SidebarProvider = React21.forwardRef(
|
|
2401
|
+
(_a, ref) => {
|
|
2402
|
+
var _b = _a, {
|
|
2403
|
+
defaultOpen = true,
|
|
2404
|
+
open: openProp,
|
|
2405
|
+
onOpenChange: setOpenProp,
|
|
2406
|
+
className,
|
|
2407
|
+
style,
|
|
2408
|
+
children
|
|
2409
|
+
} = _b, props = __objRest(_b, [
|
|
2410
|
+
"defaultOpen",
|
|
2411
|
+
"open",
|
|
2412
|
+
"onOpenChange",
|
|
2413
|
+
"className",
|
|
2414
|
+
"style",
|
|
2415
|
+
"children"
|
|
2416
|
+
]);
|
|
2417
|
+
const isMobile = useIsMobile();
|
|
2418
|
+
const [openMobile, setOpenMobile] = React21.useState(false);
|
|
2419
|
+
const [_open, _setOpen] = React21.useState(defaultOpen);
|
|
2420
|
+
const open = openProp != null ? openProp : _open;
|
|
2421
|
+
const setOpen = React21.useCallback(
|
|
2422
|
+
(value) => {
|
|
2423
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
2424
|
+
if (setOpenProp) {
|
|
2425
|
+
setOpenProp(openState);
|
|
2426
|
+
} else {
|
|
2427
|
+
_setOpen(openState);
|
|
2428
|
+
}
|
|
2429
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
2430
|
+
},
|
|
2431
|
+
[setOpenProp, open]
|
|
2432
|
+
);
|
|
2433
|
+
const toggleSidebar = React21.useCallback(() => {
|
|
2434
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
2435
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
2436
|
+
React21.useEffect(() => {
|
|
2437
|
+
const handleKeyDown = (event) => {
|
|
2438
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
2439
|
+
event.preventDefault();
|
|
2440
|
+
toggleSidebar();
|
|
2441
|
+
}
|
|
2442
|
+
};
|
|
2443
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
2444
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2445
|
+
}, [toggleSidebar]);
|
|
2446
|
+
const state = open ? "expanded" : "collapsed";
|
|
2447
|
+
const contextValue = React21.useMemo(
|
|
2448
|
+
() => ({
|
|
2449
|
+
state,
|
|
2450
|
+
open,
|
|
2451
|
+
setOpen,
|
|
2452
|
+
isMobile,
|
|
2453
|
+
openMobile,
|
|
2454
|
+
setOpenMobile,
|
|
2455
|
+
toggleSidebar
|
|
2456
|
+
}),
|
|
2457
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
2458
|
+
);
|
|
2459
|
+
return /* @__PURE__ */ jsx40(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx40(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx40(
|
|
2460
|
+
"div",
|
|
2461
|
+
__spreadProps(__spreadValues({
|
|
2462
|
+
style: __spreadValues({
|
|
2463
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
2464
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON
|
|
2465
|
+
}, style),
|
|
2466
|
+
className: cn(
|
|
2467
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
|
|
2468
|
+
className
|
|
2469
|
+
),
|
|
2470
|
+
ref
|
|
2471
|
+
}, props), {
|
|
2472
|
+
children
|
|
2473
|
+
})
|
|
2474
|
+
) }) });
|
|
2475
|
+
}
|
|
2476
|
+
);
|
|
2477
|
+
SidebarProvider.displayName = "SidebarProvider";
|
|
2478
|
+
var Sidebar = React21.forwardRef(
|
|
2479
|
+
(_a, ref) => {
|
|
2480
|
+
var _b = _a, {
|
|
2481
|
+
side = "left",
|
|
2482
|
+
variant = "sidebar",
|
|
2483
|
+
collapsible = "offcanvas",
|
|
2484
|
+
className,
|
|
2485
|
+
children
|
|
2486
|
+
} = _b, props = __objRest(_b, [
|
|
2487
|
+
"side",
|
|
2488
|
+
"variant",
|
|
2489
|
+
"collapsible",
|
|
2490
|
+
"className",
|
|
2491
|
+
"children"
|
|
2492
|
+
]);
|
|
2493
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
2494
|
+
if (collapsible === "none") {
|
|
2495
|
+
return /* @__PURE__ */ jsx40(
|
|
2496
|
+
"div",
|
|
2497
|
+
__spreadProps(__spreadValues({
|
|
2498
|
+
className: cn(
|
|
2499
|
+
"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
|
|
2500
|
+
className
|
|
2501
|
+
),
|
|
2502
|
+
ref
|
|
2503
|
+
}, props), {
|
|
2504
|
+
children
|
|
2505
|
+
})
|
|
2506
|
+
);
|
|
2507
|
+
}
|
|
2508
|
+
if (isMobile) {
|
|
2509
|
+
return /* @__PURE__ */ jsx40(Sheet, __spreadProps(__spreadValues({ open: openMobile, onOpenChange: setOpenMobile }, props), { children: /* @__PURE__ */ jsx40(
|
|
2510
|
+
SheetContent,
|
|
2511
|
+
{
|
|
2512
|
+
"data-sidebar": "sidebar",
|
|
2513
|
+
"data-mobile": "true",
|
|
2514
|
+
className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
2515
|
+
style: {
|
|
2516
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
2517
|
+
},
|
|
2518
|
+
side,
|
|
2519
|
+
children: /* @__PURE__ */ jsx40("div", { className: "flex h-full w-full flex-col", children })
|
|
2520
|
+
}
|
|
2521
|
+
) }));
|
|
2522
|
+
}
|
|
2523
|
+
return /* @__PURE__ */ jsxs21(
|
|
2524
|
+
"div",
|
|
2525
|
+
{
|
|
2526
|
+
ref,
|
|
2527
|
+
className: "group peer hidden md:block text-sidebar-foreground",
|
|
2528
|
+
"data-state": state,
|
|
2529
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
2530
|
+
"data-variant": variant,
|
|
2531
|
+
"data-side": side,
|
|
2532
|
+
children: [
|
|
2533
|
+
/* @__PURE__ */ jsx40(
|
|
2534
|
+
"div",
|
|
2535
|
+
{
|
|
2536
|
+
className: cn(
|
|
2537
|
+
"duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear",
|
|
2538
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
2539
|
+
"group-data-[side=right]:rotate-180",
|
|
2540
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
|
2541
|
+
)
|
|
2542
|
+
}
|
|
2543
|
+
),
|
|
2544
|
+
/* @__PURE__ */ jsx40(
|
|
2545
|
+
"div",
|
|
2546
|
+
__spreadProps(__spreadValues({
|
|
2547
|
+
className: cn(
|
|
2548
|
+
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",
|
|
2549
|
+
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
2550
|
+
// Adjust the padding for floating and inset variants.
|
|
2551
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
2552
|
+
className
|
|
2553
|
+
)
|
|
2554
|
+
}, props), {
|
|
2555
|
+
children: /* @__PURE__ */ jsx40(
|
|
2556
|
+
"div",
|
|
2557
|
+
{
|
|
2558
|
+
"data-sidebar": "sidebar",
|
|
2559
|
+
className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",
|
|
2560
|
+
children
|
|
2561
|
+
}
|
|
2562
|
+
)
|
|
2563
|
+
})
|
|
2564
|
+
)
|
|
2565
|
+
]
|
|
2566
|
+
}
|
|
2567
|
+
);
|
|
2568
|
+
}
|
|
2569
|
+
);
|
|
2570
|
+
Sidebar.displayName = "Sidebar";
|
|
2571
|
+
var SidebarTrigger = React21.forwardRef((_a, ref) => {
|
|
2572
|
+
var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
|
|
2573
|
+
const { toggleSidebar } = useSidebar();
|
|
2574
|
+
return /* @__PURE__ */ jsxs21(
|
|
2575
|
+
Button,
|
|
2576
|
+
__spreadProps(__spreadValues({
|
|
2577
|
+
ref,
|
|
2578
|
+
"data-sidebar": "trigger",
|
|
2579
|
+
variant: "ghost",
|
|
2580
|
+
size: "icon",
|
|
2581
|
+
className: cn("h-7 w-7", className),
|
|
2582
|
+
onClick: (event) => {
|
|
2583
|
+
onClick == null ? void 0 : onClick(event);
|
|
2584
|
+
toggleSidebar();
|
|
2585
|
+
}
|
|
2586
|
+
}, props), {
|
|
2587
|
+
children: [
|
|
2588
|
+
/* @__PURE__ */ jsx40(PanelLeft, {}),
|
|
2589
|
+
/* @__PURE__ */ jsx40("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
2590
|
+
]
|
|
2591
|
+
})
|
|
2592
|
+
);
|
|
2593
|
+
});
|
|
2594
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
2595
|
+
var SidebarRail = React21.forwardRef((_a, ref) => {
|
|
2596
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2597
|
+
const { toggleSidebar } = useSidebar();
|
|
2598
|
+
return /* @__PURE__ */ jsx40(
|
|
2599
|
+
"button",
|
|
2600
|
+
__spreadValues({
|
|
2601
|
+
ref,
|
|
2602
|
+
"data-sidebar": "rail",
|
|
2603
|
+
"aria-label": "Toggle Sidebar",
|
|
2604
|
+
tabIndex: -1,
|
|
2605
|
+
onClick: toggleSidebar,
|
|
2606
|
+
title: "Toggle Sidebar",
|
|
2607
|
+
className: cn(
|
|
2608
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
2609
|
+
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
2610
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
2611
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
|
2612
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
2613
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
2614
|
+
className
|
|
2615
|
+
)
|
|
2616
|
+
}, props)
|
|
2617
|
+
);
|
|
2618
|
+
});
|
|
2619
|
+
SidebarRail.displayName = "SidebarRail";
|
|
2620
|
+
var SidebarInset = React21.forwardRef((_a, ref) => {
|
|
2621
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2622
|
+
return /* @__PURE__ */ jsx40(
|
|
2623
|
+
"main",
|
|
2624
|
+
__spreadValues({
|
|
2625
|
+
ref,
|
|
2626
|
+
className: cn(
|
|
2627
|
+
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
2628
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
|
|
2629
|
+
className
|
|
2630
|
+
)
|
|
2631
|
+
}, props)
|
|
2632
|
+
);
|
|
2633
|
+
});
|
|
2634
|
+
SidebarInset.displayName = "SidebarInset";
|
|
2635
|
+
var SidebarInput = React21.forwardRef((_a, ref) => {
|
|
2636
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2637
|
+
return /* @__PURE__ */ jsx40(
|
|
2638
|
+
Input,
|
|
2639
|
+
__spreadValues({
|
|
2640
|
+
ref,
|
|
2641
|
+
"data-sidebar": "input",
|
|
2642
|
+
className: cn(
|
|
2643
|
+
"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
|
2644
|
+
className
|
|
2645
|
+
)
|
|
2646
|
+
}, props)
|
|
2647
|
+
);
|
|
2648
|
+
});
|
|
2649
|
+
SidebarInput.displayName = "SidebarInput";
|
|
2650
|
+
var SidebarHeader = React21.forwardRef((_a, ref) => {
|
|
2651
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2652
|
+
return /* @__PURE__ */ jsx40(
|
|
2653
|
+
"div",
|
|
2654
|
+
__spreadValues({
|
|
2655
|
+
ref,
|
|
2656
|
+
"data-sidebar": "header",
|
|
2657
|
+
className: cn("flex flex-col gap-2 p-2", className)
|
|
2658
|
+
}, props)
|
|
2659
|
+
);
|
|
2660
|
+
});
|
|
2661
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
2662
|
+
var SidebarFooter = React21.forwardRef((_a, ref) => {
|
|
2663
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2664
|
+
return /* @__PURE__ */ jsx40(
|
|
2665
|
+
"div",
|
|
2666
|
+
__spreadValues({
|
|
2667
|
+
ref,
|
|
2668
|
+
"data-sidebar": "footer",
|
|
2669
|
+
className: cn("flex flex-col gap-2 p-2", className)
|
|
2670
|
+
}, props)
|
|
2671
|
+
);
|
|
2672
|
+
});
|
|
2673
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
2674
|
+
var SidebarSeparator = React21.forwardRef((_a, ref) => {
|
|
2675
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2676
|
+
return /* @__PURE__ */ jsx40(
|
|
2677
|
+
Separator3,
|
|
2678
|
+
__spreadValues({
|
|
2679
|
+
ref,
|
|
2680
|
+
"data-sidebar": "separator",
|
|
2681
|
+
className: cn("mx-2 w-auto bg-sidebar-border", className)
|
|
2682
|
+
}, props)
|
|
2683
|
+
);
|
|
2684
|
+
});
|
|
2685
|
+
SidebarSeparator.displayName = "SidebarSeparator";
|
|
2686
|
+
var SidebarContent = React21.forwardRef((_a, ref) => {
|
|
2687
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2688
|
+
return /* @__PURE__ */ jsx40(
|
|
2689
|
+
"div",
|
|
2690
|
+
__spreadValues({
|
|
2691
|
+
ref,
|
|
2692
|
+
"data-sidebar": "content",
|
|
2693
|
+
className: cn(
|
|
2694
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
2695
|
+
className
|
|
2696
|
+
)
|
|
2697
|
+
}, props)
|
|
2698
|
+
);
|
|
2699
|
+
});
|
|
2700
|
+
SidebarContent.displayName = "SidebarContent";
|
|
2701
|
+
var SidebarGroup = React21.forwardRef((_a, ref) => {
|
|
2702
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2703
|
+
return /* @__PURE__ */ jsx40(
|
|
2704
|
+
"div",
|
|
2705
|
+
__spreadValues({
|
|
2706
|
+
ref,
|
|
2707
|
+
"data-sidebar": "group",
|
|
2708
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className)
|
|
2709
|
+
}, props)
|
|
2710
|
+
);
|
|
2711
|
+
});
|
|
2712
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
2713
|
+
var SidebarGroupLabel = React21.forwardRef((_a, ref) => {
|
|
2714
|
+
var _b = _a, { className, asChild = false } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
2715
|
+
const Comp = asChild ? Slot3 : "div";
|
|
2716
|
+
return /* @__PURE__ */ jsx40(
|
|
2717
|
+
Comp,
|
|
2718
|
+
__spreadValues({
|
|
2719
|
+
ref,
|
|
2720
|
+
"data-sidebar": "group-label",
|
|
2721
|
+
className: cn(
|
|
2722
|
+
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2723
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
2724
|
+
className
|
|
2725
|
+
)
|
|
2726
|
+
}, props)
|
|
2727
|
+
);
|
|
2728
|
+
});
|
|
2729
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
2730
|
+
var SidebarGroupAction = React21.forwardRef((_a, ref) => {
|
|
2731
|
+
var _b = _a, { className, asChild = false } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
2732
|
+
const Comp = asChild ? Slot3 : "button";
|
|
2733
|
+
return /* @__PURE__ */ jsx40(
|
|
2734
|
+
Comp,
|
|
2735
|
+
__spreadValues({
|
|
2736
|
+
ref,
|
|
2737
|
+
"data-sidebar": "group-action",
|
|
2738
|
+
className: cn(
|
|
2739
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2740
|
+
// Increases the hit area of the button on mobile.
|
|
2741
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
2742
|
+
"group-data-[collapsible=icon]:hidden",
|
|
2743
|
+
className
|
|
2744
|
+
)
|
|
2745
|
+
}, props)
|
|
2746
|
+
);
|
|
2747
|
+
});
|
|
2748
|
+
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
2749
|
+
var SidebarGroupContent = React21.forwardRef((_a, ref) => {
|
|
2750
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2751
|
+
return /* @__PURE__ */ jsx40(
|
|
2752
|
+
"div",
|
|
2753
|
+
__spreadValues({
|
|
2754
|
+
ref,
|
|
2755
|
+
"data-sidebar": "group-content",
|
|
2756
|
+
className: cn("w-full text-sm", className)
|
|
2757
|
+
}, props)
|
|
2758
|
+
);
|
|
2759
|
+
});
|
|
2760
|
+
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
2761
|
+
var SidebarMenu = React21.forwardRef((_a, ref) => {
|
|
2762
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2763
|
+
return /* @__PURE__ */ jsx40(
|
|
2764
|
+
"ul",
|
|
2765
|
+
__spreadValues({
|
|
2766
|
+
ref,
|
|
2767
|
+
"data-sidebar": "menu",
|
|
2768
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className)
|
|
2769
|
+
}, props)
|
|
2770
|
+
);
|
|
2771
|
+
});
|
|
2772
|
+
SidebarMenu.displayName = "SidebarMenu";
|
|
2773
|
+
var SidebarMenuItem = React21.forwardRef((_a, ref) => {
|
|
2774
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2775
|
+
return /* @__PURE__ */ jsx40(
|
|
2776
|
+
"li",
|
|
2777
|
+
__spreadValues({
|
|
2778
|
+
ref,
|
|
2779
|
+
"data-sidebar": "menu-item",
|
|
2780
|
+
className: cn("group/menu-item relative", className)
|
|
2781
|
+
}, props)
|
|
2782
|
+
);
|
|
2783
|
+
});
|
|
2784
|
+
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
2785
|
+
var sidebarMenuButtonVariants = cva8(
|
|
2786
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2787
|
+
{
|
|
2788
|
+
variants: {
|
|
2789
|
+
variant: {
|
|
2790
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
2791
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
2792
|
+
},
|
|
2793
|
+
size: {
|
|
2794
|
+
default: "h-8 text-sm",
|
|
2795
|
+
sm: "h-7 text-xs",
|
|
2796
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0"
|
|
2797
|
+
}
|
|
2798
|
+
},
|
|
2799
|
+
defaultVariants: {
|
|
2800
|
+
variant: "default",
|
|
2801
|
+
size: "default"
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
);
|
|
2805
|
+
var SidebarMenuButton = React21.forwardRef(
|
|
2806
|
+
(_a, ref) => {
|
|
2807
|
+
var _b = _a, {
|
|
2808
|
+
asChild = false,
|
|
2809
|
+
isActive = false,
|
|
2810
|
+
variant = "default",
|
|
2811
|
+
size = "default",
|
|
2812
|
+
tooltip,
|
|
2813
|
+
className
|
|
2814
|
+
} = _b, props = __objRest(_b, [
|
|
2815
|
+
"asChild",
|
|
2816
|
+
"isActive",
|
|
2817
|
+
"variant",
|
|
2818
|
+
"size",
|
|
2819
|
+
"tooltip",
|
|
2820
|
+
"className"
|
|
2821
|
+
]);
|
|
2822
|
+
const Comp = asChild ? Slot3 : "button";
|
|
2823
|
+
const { isMobile, state } = useSidebar();
|
|
2824
|
+
const button = /* @__PURE__ */ jsx40(
|
|
2825
|
+
Comp,
|
|
2826
|
+
__spreadValues({
|
|
2827
|
+
ref,
|
|
2828
|
+
"data-sidebar": "menu-button",
|
|
2829
|
+
"data-size": size,
|
|
2830
|
+
"data-active": isActive,
|
|
2831
|
+
className: cn(sidebarMenuButtonVariants({ variant, size }), className)
|
|
2832
|
+
}, props)
|
|
2833
|
+
);
|
|
2834
|
+
if (!tooltip) {
|
|
2835
|
+
return button;
|
|
2836
|
+
}
|
|
2837
|
+
if (typeof tooltip === "string") {
|
|
2838
|
+
tooltip = {
|
|
2839
|
+
children: tooltip
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2842
|
+
return /* @__PURE__ */ jsxs21(Tooltip, { children: [
|
|
2843
|
+
/* @__PURE__ */ jsx40(TooltipTrigger, { asChild: true, children: button }),
|
|
2844
|
+
/* @__PURE__ */ jsx40(
|
|
2845
|
+
TooltipContent,
|
|
2846
|
+
__spreadValues({
|
|
2847
|
+
side: "right",
|
|
2848
|
+
align: "center",
|
|
2849
|
+
hidden: state !== "collapsed" || isMobile
|
|
2850
|
+
}, tooltip)
|
|
2851
|
+
)
|
|
2852
|
+
] });
|
|
2853
|
+
}
|
|
2854
|
+
);
|
|
2855
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
2856
|
+
var SidebarMenuAction = React21.forwardRef((_a, ref) => {
|
|
2857
|
+
var _b = _a, { className, asChild = false, showOnHover = false } = _b, props = __objRest(_b, ["className", "asChild", "showOnHover"]);
|
|
2858
|
+
const Comp = asChild ? Slot3 : "button";
|
|
2859
|
+
return /* @__PURE__ */ jsx40(
|
|
2860
|
+
Comp,
|
|
2861
|
+
__spreadValues({
|
|
2862
|
+
ref,
|
|
2863
|
+
"data-sidebar": "menu-action",
|
|
2864
|
+
className: cn(
|
|
2865
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2866
|
+
// Increases the hit area of the button on mobile.
|
|
2867
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
2868
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
2869
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
2870
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
2871
|
+
"group-data-[collapsible=icon]:hidden",
|
|
2872
|
+
showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
|
|
2873
|
+
className
|
|
2874
|
+
)
|
|
2875
|
+
}, props)
|
|
2876
|
+
);
|
|
2877
|
+
});
|
|
2878
|
+
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
2879
|
+
var SidebarMenuBadge = React21.forwardRef((_a, ref) => {
|
|
2880
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2881
|
+
return /* @__PURE__ */ jsx40(
|
|
2882
|
+
"div",
|
|
2883
|
+
__spreadValues({
|
|
2884
|
+
ref,
|
|
2885
|
+
"data-sidebar": "menu-badge",
|
|
2886
|
+
className: cn(
|
|
2887
|
+
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none",
|
|
2888
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
2889
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
2890
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
2891
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
2892
|
+
"group-data-[collapsible=icon]:hidden",
|
|
2893
|
+
className
|
|
2894
|
+
)
|
|
2895
|
+
}, props)
|
|
2896
|
+
);
|
|
2897
|
+
});
|
|
2898
|
+
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
|
2899
|
+
var SidebarMenuSkeleton = React21.forwardRef((_a, ref) => {
|
|
2900
|
+
var _b = _a, { className, showIcon = false } = _b, props = __objRest(_b, ["className", "showIcon"]);
|
|
2901
|
+
const width = React21.useMemo(() => {
|
|
2902
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
2903
|
+
}, []);
|
|
2904
|
+
return /* @__PURE__ */ jsxs21(
|
|
2905
|
+
"div",
|
|
2906
|
+
__spreadProps(__spreadValues({
|
|
2907
|
+
ref,
|
|
2908
|
+
"data-sidebar": "menu-skeleton",
|
|
2909
|
+
className: cn("rounded-md h-8 flex gap-2 px-2 items-center", className)
|
|
2910
|
+
}, props), {
|
|
2911
|
+
children: [
|
|
2912
|
+
showIcon && /* @__PURE__ */ jsx40(
|
|
2913
|
+
Skeleton,
|
|
2914
|
+
{
|
|
2915
|
+
className: "size-4 rounded-md",
|
|
2916
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
2917
|
+
}
|
|
2918
|
+
),
|
|
2919
|
+
/* @__PURE__ */ jsx40(
|
|
2920
|
+
Skeleton,
|
|
2921
|
+
{
|
|
2922
|
+
className: "h-4 flex-1 max-w-[--skeleton-width]",
|
|
2923
|
+
"data-sidebar": "menu-skeleton-text",
|
|
2924
|
+
style: {
|
|
2925
|
+
"--skeleton-width": width
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
)
|
|
2929
|
+
]
|
|
2930
|
+
})
|
|
2931
|
+
);
|
|
2932
|
+
});
|
|
2933
|
+
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
2934
|
+
var SidebarMenuSub = React21.forwardRef((_a, ref) => {
|
|
2935
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2936
|
+
return /* @__PURE__ */ jsx40(
|
|
2937
|
+
"ul",
|
|
2938
|
+
__spreadValues({
|
|
2939
|
+
ref,
|
|
2940
|
+
"data-sidebar": "menu-sub",
|
|
2941
|
+
className: cn(
|
|
2942
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
|
|
2943
|
+
"group-data-[collapsible=icon]:hidden",
|
|
2944
|
+
className
|
|
2945
|
+
)
|
|
2946
|
+
}, props)
|
|
2947
|
+
);
|
|
2948
|
+
});
|
|
2949
|
+
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
2950
|
+
var SidebarMenuSubItem = React21.forwardRef((_a, ref) => {
|
|
2951
|
+
var props = __objRest(_a, []);
|
|
2952
|
+
return /* @__PURE__ */ jsx40("li", __spreadValues({ ref }, props));
|
|
2953
|
+
});
|
|
2954
|
+
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
2955
|
+
var SidebarMenuSubButton = React21.forwardRef((_a, ref) => {
|
|
2956
|
+
var _b = _a, { asChild = false, size = "md", isActive, className } = _b, props = __objRest(_b, ["asChild", "size", "isActive", "className"]);
|
|
2957
|
+
const Comp = asChild ? Slot3 : "a";
|
|
2958
|
+
return /* @__PURE__ */ jsx40(
|
|
2959
|
+
Comp,
|
|
2960
|
+
__spreadValues({
|
|
2961
|
+
ref,
|
|
2962
|
+
"data-sidebar": "menu-sub-button",
|
|
2963
|
+
"data-size": size,
|
|
2964
|
+
"data-active": isActive,
|
|
2965
|
+
className: cn(
|
|
2966
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
|
2967
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
2968
|
+
size === "sm" && "text-xs",
|
|
2969
|
+
size === "md" && "text-sm",
|
|
2970
|
+
"group-data-[collapsible=icon]:hidden",
|
|
2971
|
+
className
|
|
2972
|
+
)
|
|
2973
|
+
}, props)
|
|
2974
|
+
);
|
|
2975
|
+
});
|
|
2976
|
+
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
2977
|
+
|
|
2978
|
+
// src/components/layout/Sidebar/components/app-sidebar.tsx
|
|
2979
|
+
import { GalleryVerticalEnd } from "lucide-react";
|
|
2980
|
+
|
|
2981
|
+
// src/components/layout/Sidebar/components/team-switcher.tsx
|
|
2982
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
2983
|
+
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2984
|
+
function TeamSwitcher({
|
|
2985
|
+
teams
|
|
2986
|
+
}) {
|
|
2987
|
+
const { isMobile } = useSidebar();
|
|
2988
|
+
return /* @__PURE__ */ jsx41(SidebarMenu, { children: /* @__PURE__ */ jsx41(SidebarMenuItem, { children: /* @__PURE__ */ jsx41(DropdownMenu, { children: /* @__PURE__ */ jsx41(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
2989
|
+
SidebarMenuButton,
|
|
2990
|
+
{
|
|
2991
|
+
size: "lg",
|
|
2992
|
+
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
2993
|
+
children: [
|
|
2994
|
+
/* @__PURE__ */ jsx41("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground" }),
|
|
2995
|
+
/* @__PURE__ */ jsxs22("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
2996
|
+
/* @__PURE__ */ jsx41("span", { className: "truncate font-semibold", children: teams == null ? void 0 : teams.name }),
|
|
2997
|
+
/* @__PURE__ */ jsx41("span", { className: "truncate text-xs", children: teams == null ? void 0 : teams.plan })
|
|
2998
|
+
] }),
|
|
2999
|
+
/* @__PURE__ */ jsx41(ChevronsUpDown, { className: "ml-auto" })
|
|
3000
|
+
]
|
|
3001
|
+
}
|
|
3002
|
+
) }) }) }) });
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
// src/components/layout/Sidebar/components/menus.tsx
|
|
3006
|
+
import { Fragment as Fragment3, jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3007
|
+
function Menus({
|
|
3008
|
+
items
|
|
3009
|
+
}) {
|
|
3010
|
+
return /* @__PURE__ */ jsx42(Fragment3, { children: items.map((item, index) => {
|
|
3011
|
+
var _a;
|
|
3012
|
+
return /* @__PURE__ */ jsxs23(SidebarGroup, { children: [
|
|
3013
|
+
/* @__PURE__ */ jsx42(SidebarGroupLabel, { children: item.title }),
|
|
3014
|
+
/* @__PURE__ */ jsx42(SidebarMenu, { children: (_a = item.items) == null ? void 0 : _a.map((subItem) => /* @__PURE__ */ jsx42(SidebarMenuItem, { children: /* @__PURE__ */ jsx42(
|
|
3015
|
+
SidebarMenuButton,
|
|
3016
|
+
{
|
|
3017
|
+
asChild: true,
|
|
3018
|
+
className: cn(
|
|
3019
|
+
(subItem == null ? void 0 : subItem.isActive) && "bg-sidebar-accent font-semibold"
|
|
3020
|
+
),
|
|
3021
|
+
children: /* @__PURE__ */ jsxs23("a", { href: subItem.url, children: [
|
|
3022
|
+
(subItem == null ? void 0 : subItem.icon) && subItem.icon(),
|
|
3023
|
+
/* @__PURE__ */ jsx42("span", { children: subItem.title })
|
|
3024
|
+
] })
|
|
3025
|
+
}
|
|
3026
|
+
) }, subItem.title)) })
|
|
3027
|
+
] }, index);
|
|
3028
|
+
}) });
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
// src/components/layout/Sidebar/components/app-sidebar.tsx
|
|
3032
|
+
import { jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3033
|
+
function AppSidebar(_a) {
|
|
3034
|
+
var _b = _a, {
|
|
3035
|
+
navbar = [],
|
|
3036
|
+
enterprise = {
|
|
3037
|
+
name: "Acme Inc",
|
|
3038
|
+
logo: () => /* @__PURE__ */ jsx43(GalleryVerticalEnd, {}),
|
|
3039
|
+
plan: "Enterprise"
|
|
3040
|
+
},
|
|
3041
|
+
footer
|
|
3042
|
+
} = _b, props = __objRest(_b, [
|
|
3043
|
+
"navbar",
|
|
3044
|
+
"enterprise",
|
|
3045
|
+
"footer"
|
|
3046
|
+
]);
|
|
3047
|
+
return /* @__PURE__ */ jsxs24(Sidebar, __spreadProps(__spreadValues({ collapsible: "icon" }, props), { children: [
|
|
3048
|
+
/* @__PURE__ */ jsx43(SidebarHeader, { children: /* @__PURE__ */ jsx43(TeamSwitcher, { teams: enterprise }) }),
|
|
3049
|
+
/* @__PURE__ */ jsx43(SidebarContent, { children: /* @__PURE__ */ jsx43(Menus, { items: navbar }) }),
|
|
3050
|
+
footer && /* @__PURE__ */ jsx43(SidebarFooter, { children: footer() }),
|
|
3051
|
+
/* @__PURE__ */ jsx43(SidebarRail, {})
|
|
3052
|
+
] }));
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
// src/components/ui/breadcrumb.tsx
|
|
3056
|
+
import * as React22 from "react";
|
|
3057
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
3058
|
+
import { ChevronRight as ChevronRight2, MoreHorizontal } from "lucide-react";
|
|
3059
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3060
|
+
var Breadcrumb = React22.forwardRef((_a, ref) => {
|
|
3061
|
+
var props = __objRest(_a, []);
|
|
3062
|
+
return /* @__PURE__ */ jsx44("nav", __spreadValues({ ref, "aria-label": "breadcrumb" }, props));
|
|
3063
|
+
});
|
|
3064
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
3065
|
+
var BreadcrumbList = React22.forwardRef((_a, ref) => {
|
|
3066
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3067
|
+
return /* @__PURE__ */ jsx44(
|
|
3068
|
+
"ol",
|
|
3069
|
+
__spreadValues({
|
|
3070
|
+
ref,
|
|
3071
|
+
className: cn(
|
|
3072
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
3073
|
+
className
|
|
3074
|
+
)
|
|
3075
|
+
}, props)
|
|
3076
|
+
);
|
|
3077
|
+
});
|
|
3078
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
3079
|
+
var BreadcrumbItem = React22.forwardRef((_a, ref) => {
|
|
3080
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3081
|
+
return /* @__PURE__ */ jsx44(
|
|
3082
|
+
"li",
|
|
3083
|
+
__spreadValues({
|
|
3084
|
+
ref,
|
|
3085
|
+
className: cn("inline-flex items-center gap-1.5", className)
|
|
3086
|
+
}, props)
|
|
3087
|
+
);
|
|
3088
|
+
});
|
|
3089
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
3090
|
+
var BreadcrumbLink = React22.forwardRef((_a, ref) => {
|
|
3091
|
+
var _b = _a, { asChild, className } = _b, props = __objRest(_b, ["asChild", "className"]);
|
|
3092
|
+
const Comp = asChild ? Slot4 : "a";
|
|
3093
|
+
return /* @__PURE__ */ jsx44(
|
|
3094
|
+
Comp,
|
|
3095
|
+
__spreadValues({
|
|
3096
|
+
ref,
|
|
3097
|
+
className: cn("transition-colors hover:text-foreground", className)
|
|
3098
|
+
}, props)
|
|
3099
|
+
);
|
|
3100
|
+
});
|
|
3101
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
3102
|
+
var BreadcrumbPage = React22.forwardRef((_a, ref) => {
|
|
3103
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3104
|
+
return /* @__PURE__ */ jsx44(
|
|
3105
|
+
"span",
|
|
3106
|
+
__spreadValues({
|
|
3107
|
+
ref,
|
|
3108
|
+
role: "link",
|
|
3109
|
+
"aria-disabled": "true",
|
|
3110
|
+
"aria-current": "page",
|
|
3111
|
+
className: cn("font-normal text-foreground", className)
|
|
3112
|
+
}, props)
|
|
3113
|
+
);
|
|
3114
|
+
});
|
|
3115
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
3116
|
+
var BreadcrumbSeparator = (_a) => {
|
|
3117
|
+
var _b = _a, {
|
|
3118
|
+
children,
|
|
3119
|
+
className
|
|
3120
|
+
} = _b, props = __objRest(_b, [
|
|
3121
|
+
"children",
|
|
3122
|
+
"className"
|
|
3123
|
+
]);
|
|
3124
|
+
return /* @__PURE__ */ jsx44(
|
|
3125
|
+
"li",
|
|
3126
|
+
__spreadProps(__spreadValues({
|
|
3127
|
+
role: "presentation",
|
|
3128
|
+
"aria-hidden": "true",
|
|
3129
|
+
className: cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)
|
|
3130
|
+
}, props), {
|
|
3131
|
+
children: children != null ? children : /* @__PURE__ */ jsx44(ChevronRight2, {})
|
|
3132
|
+
})
|
|
3133
|
+
);
|
|
3134
|
+
};
|
|
3135
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
3136
|
+
var BreadcrumbEllipsis = (_a) => {
|
|
3137
|
+
var _b = _a, {
|
|
3138
|
+
className
|
|
3139
|
+
} = _b, props = __objRest(_b, [
|
|
3140
|
+
"className"
|
|
3141
|
+
]);
|
|
3142
|
+
return /* @__PURE__ */ jsxs25(
|
|
3143
|
+
"span",
|
|
3144
|
+
__spreadProps(__spreadValues({
|
|
3145
|
+
role: "presentation",
|
|
3146
|
+
"aria-hidden": "true",
|
|
3147
|
+
className: cn("flex h-9 w-9 items-center justify-center", className)
|
|
3148
|
+
}, props), {
|
|
3149
|
+
children: [
|
|
3150
|
+
/* @__PURE__ */ jsx44(MoreHorizontal, { className: "h-4 w-4" }),
|
|
3151
|
+
/* @__PURE__ */ jsx44("span", { className: "sr-only", children: "More" })
|
|
3152
|
+
]
|
|
3153
|
+
})
|
|
3154
|
+
);
|
|
3155
|
+
};
|
|
3156
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
3157
|
+
|
|
3158
|
+
// src/components/layout/Sidebar/provider/index.tsx
|
|
3159
|
+
import { createContext as createContext3, useContext as useContext3, useState as useState7 } from "react";
|
|
3160
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3161
|
+
var SidebarContext2 = createContext3({});
|
|
3162
|
+
function SidebarProvider2({
|
|
3163
|
+
children,
|
|
3164
|
+
defaultPath = "/",
|
|
3165
|
+
defaultCollapsed = false
|
|
3166
|
+
}) {
|
|
3167
|
+
const [isCollapsed, setIsCollapsed] = useState7(defaultCollapsed);
|
|
3168
|
+
const [currentPath, setCurrentPath] = useState7(defaultPath);
|
|
3169
|
+
const toggleCollapse = () => setIsCollapsed((prev) => !prev);
|
|
3170
|
+
return /* @__PURE__ */ jsx45(
|
|
3171
|
+
SidebarContext2.Provider,
|
|
3172
|
+
{
|
|
3173
|
+
value: {
|
|
3174
|
+
currentPath,
|
|
3175
|
+
isCollapsed,
|
|
3176
|
+
toggleCollapse,
|
|
3177
|
+
setCurrentPath
|
|
3178
|
+
},
|
|
3179
|
+
children
|
|
3180
|
+
}
|
|
3181
|
+
);
|
|
3182
|
+
}
|
|
3183
|
+
function useSidebar2() {
|
|
3184
|
+
const context = useContext3(SidebarContext2);
|
|
3185
|
+
if (!context) {
|
|
3186
|
+
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
3187
|
+
}
|
|
3188
|
+
return context;
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
// src/components/layout/Sidebar/components/header-sidebar.tsx
|
|
3192
|
+
import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3193
|
+
var routeMap = {
|
|
3194
|
+
dashboard: "Dashboard",
|
|
3195
|
+
users: "Usu\xE1rios",
|
|
3196
|
+
documents: "Documentos",
|
|
3197
|
+
settings: "Configura\xE7\xF5es",
|
|
3198
|
+
create: "Criar",
|
|
3199
|
+
edit: "Editar",
|
|
3200
|
+
profile: "Perfil",
|
|
3201
|
+
analytics: "An\xE1lises",
|
|
3202
|
+
reports: "Relat\xF3rios"
|
|
3203
|
+
};
|
|
3204
|
+
var BreadcrumbElement = ({ isLast, path, label }) => {
|
|
3205
|
+
if (isLast) {
|
|
3206
|
+
return /* @__PURE__ */ jsx46(BreadcrumbItem, { children: /* @__PURE__ */ jsx46(BreadcrumbPage, { className: "capitalize", children: label }) });
|
|
3207
|
+
}
|
|
3208
|
+
return /* @__PURE__ */ jsxs26(BreadcrumbItem, { children: [
|
|
3209
|
+
/* @__PURE__ */ jsx46(BreadcrumbLink, { href: path, className: "capitalize", children: label }),
|
|
3210
|
+
/* @__PURE__ */ jsx46(BreadcrumbSeparator, {})
|
|
3211
|
+
] });
|
|
3212
|
+
};
|
|
3213
|
+
var HeaderSidebar = () => {
|
|
3214
|
+
const { currentPath } = useSidebar2();
|
|
3215
|
+
const breadcrumbItems = currentPath.split("/").filter(Boolean).map((segment, index, array) => {
|
|
3216
|
+
const path = `/${array.slice(0, index + 1).join("/")}`;
|
|
3217
|
+
const isLast = index === array.length - 1;
|
|
3218
|
+
const label = routeMap[segment] || segment;
|
|
3219
|
+
return {
|
|
3220
|
+
path,
|
|
3221
|
+
label,
|
|
3222
|
+
isLast
|
|
3223
|
+
};
|
|
3224
|
+
});
|
|
3225
|
+
return /* @__PURE__ */ jsx46("header", { className: "flex h-16 shrink-0 items-center border-b border-border bg-background px-4 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-4", children: [
|
|
3226
|
+
/* @__PURE__ */ jsx46(SidebarTrigger, { className: "-ml-2 h-9 w-9" }),
|
|
3227
|
+
/* @__PURE__ */ jsx46(Separator3, { orientation: "vertical", className: "h-6" }),
|
|
3228
|
+
/* @__PURE__ */ jsx46(Breadcrumb, { children: /* @__PURE__ */ jsxs26(BreadcrumbList, { children: [
|
|
3229
|
+
/* @__PURE__ */ jsxs26(BreadcrumbItem, { children: [
|
|
3230
|
+
/* @__PURE__ */ jsx46(BreadcrumbLink, { href: "/", className: "capitalize", children: "Home" }),
|
|
3231
|
+
/* @__PURE__ */ jsx46(BreadcrumbSeparator, {})
|
|
3232
|
+
] }),
|
|
3233
|
+
breadcrumbItems.map((item) => /* @__PURE__ */ jsx46(BreadcrumbElement, __spreadValues({}, item), item.path))
|
|
3234
|
+
] }) })
|
|
3235
|
+
] }) });
|
|
3236
|
+
};
|
|
3237
|
+
|
|
3238
|
+
// src/components/layout/Sidebar/components/footer-sidebar.tsx
|
|
3239
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3240
|
+
var FooterSidebar = () => {
|
|
3241
|
+
return /* @__PURE__ */ jsxs27("footer", { className: "h-[65px]", children: [
|
|
3242
|
+
/* @__PURE__ */ jsx47(Separator3, {}),
|
|
3243
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between h-16 bg-background px-5", children: [
|
|
3244
|
+
/* @__PURE__ */ jsxs27("span", { className: "text-sm text-muted-foreground", children: [
|
|
3245
|
+
"\xA9 ",
|
|
3246
|
+
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
3247
|
+
" Your Company"
|
|
3248
|
+
] }),
|
|
3249
|
+
/* @__PURE__ */ jsx47("span", { className: "text-sm text-muted-foreground", children: "Feito na terra do sol \u{1F31E}" })
|
|
3250
|
+
] })
|
|
3251
|
+
] });
|
|
3252
|
+
};
|
|
3253
|
+
|
|
3254
|
+
// src/components/layout/Sidebar/Sidebar.tsx
|
|
3255
|
+
import { jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3256
|
+
var Sidebar2 = (_a) => {
|
|
3257
|
+
var _b = _a, {
|
|
3258
|
+
children,
|
|
3259
|
+
contentClassName,
|
|
3260
|
+
showFooter = true,
|
|
3261
|
+
defaultPath,
|
|
3262
|
+
defaultCollapsed
|
|
3263
|
+
} = _b, rest = __objRest(_b, [
|
|
3264
|
+
"children",
|
|
3265
|
+
"contentClassName",
|
|
3266
|
+
"showFooter",
|
|
3267
|
+
"defaultPath",
|
|
3268
|
+
"defaultCollapsed"
|
|
3269
|
+
]);
|
|
3270
|
+
return /* @__PURE__ */ jsx48(
|
|
3271
|
+
SidebarProvider2,
|
|
3272
|
+
{
|
|
3273
|
+
defaultPath,
|
|
3274
|
+
defaultCollapsed,
|
|
3275
|
+
children: /* @__PURE__ */ jsxs28(SidebarProvider, { children: [
|
|
3276
|
+
/* @__PURE__ */ jsx48(AppSidebar, __spreadValues({}, rest)),
|
|
3277
|
+
/* @__PURE__ */ jsxs28(SidebarInset, { className: "overflow-auto bg-slate-50", children: [
|
|
3278
|
+
/* @__PURE__ */ jsx48(HeaderSidebar, {}),
|
|
3279
|
+
/* @__PURE__ */ jsx48(
|
|
3280
|
+
"main",
|
|
3281
|
+
{
|
|
3282
|
+
className: cn(
|
|
3283
|
+
"flex flex-1 flex-col gap-4 p-4 pt-0",
|
|
3284
|
+
contentClassName
|
|
3285
|
+
),
|
|
3286
|
+
children
|
|
3287
|
+
}
|
|
3288
|
+
),
|
|
3289
|
+
showFooter && /* @__PURE__ */ jsx48(FooterSidebar, {})
|
|
3290
|
+
] })
|
|
3291
|
+
] })
|
|
3292
|
+
}
|
|
3293
|
+
);
|
|
3294
|
+
};
|
|
3295
|
+
|
|
3296
|
+
// src/components/layout/Sidebar/components/nav-user.tsx
|
|
3297
|
+
import {
|
|
3298
|
+
BadgeCheck,
|
|
3299
|
+
Bell,
|
|
3300
|
+
ChevronsUpDown as ChevronsUpDown2,
|
|
3301
|
+
CreditCard,
|
|
3302
|
+
LogOut,
|
|
3303
|
+
Sparkles
|
|
3304
|
+
} from "lucide-react";
|
|
3305
|
+
import { useCallback as useCallback7 } from "react";
|
|
3306
|
+
import { Fragment as Fragment4, jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3307
|
+
function NavUser({
|
|
3308
|
+
user,
|
|
3309
|
+
logoutAction = () => {
|
|
3310
|
+
}
|
|
3311
|
+
}) {
|
|
3312
|
+
const { isMobile } = useSidebar();
|
|
3313
|
+
const renderUserInformation = useCallback7(() => {
|
|
3314
|
+
return /* @__PURE__ */ jsxs29(Fragment4, { children: [
|
|
3315
|
+
/* @__PURE__ */ jsxs29(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
3316
|
+
/* @__PURE__ */ jsx49(AvatarImage, { src: user == null ? void 0 : user.avatar, alt: user == null ? void 0 : user.name }),
|
|
3317
|
+
/* @__PURE__ */ jsx49(AvatarFallback, { className: "rounded-lg", children: "CN" })
|
|
3318
|
+
] }),
|
|
3319
|
+
/* @__PURE__ */ jsxs29("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
3320
|
+
/* @__PURE__ */ jsx49("span", { className: "truncate font-semibold", children: user == null ? void 0 : user.name }),
|
|
3321
|
+
/* @__PURE__ */ jsx49("span", { className: "truncate text-xs", children: user == null ? void 0 : user.email })
|
|
3322
|
+
] })
|
|
3323
|
+
] });
|
|
3324
|
+
}, [user]);
|
|
3325
|
+
return /* @__PURE__ */ jsx49(SidebarMenu, { children: /* @__PURE__ */ jsx49(SidebarMenuItem, { children: /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
|
|
3326
|
+
/* @__PURE__ */ jsx49(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs29(
|
|
3327
|
+
SidebarMenuButton,
|
|
3328
|
+
{
|
|
3329
|
+
size: "lg",
|
|
3330
|
+
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
3331
|
+
children: [
|
|
3332
|
+
renderUserInformation(),
|
|
3333
|
+
/* @__PURE__ */ jsx49(ChevronsUpDown2, { className: "ml-auto size-4" })
|
|
3334
|
+
]
|
|
3335
|
+
}
|
|
3336
|
+
) }),
|
|
3337
|
+
/* @__PURE__ */ jsxs29(
|
|
3338
|
+
DropdownMenuContent,
|
|
3339
|
+
{
|
|
3340
|
+
className: "w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",
|
|
3341
|
+
side: isMobile ? "bottom" : "right",
|
|
3342
|
+
align: "end",
|
|
3343
|
+
sideOffset: 4,
|
|
3344
|
+
children: [
|
|
3345
|
+
/* @__PURE__ */ jsx49(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsx49("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: renderUserInformation() }) }),
|
|
3346
|
+
/* @__PURE__ */ jsx49(DropdownMenuSeparator, {}),
|
|
3347
|
+
/* @__PURE__ */ jsx49(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs29(DropdownMenuItem, { children: [
|
|
3348
|
+
/* @__PURE__ */ jsx49(Sparkles, {}),
|
|
3349
|
+
"Upgrade to Pro"
|
|
3350
|
+
] }) }),
|
|
3351
|
+
/* @__PURE__ */ jsx49(DropdownMenuSeparator, {}),
|
|
3352
|
+
/* @__PURE__ */ jsxs29(DropdownMenuGroup, { children: [
|
|
3353
|
+
/* @__PURE__ */ jsxs29(DropdownMenuItem, { children: [
|
|
3354
|
+
/* @__PURE__ */ jsx49(BadgeCheck, {}),
|
|
3355
|
+
"Account"
|
|
3356
|
+
] }),
|
|
3357
|
+
/* @__PURE__ */ jsxs29(DropdownMenuItem, { children: [
|
|
3358
|
+
/* @__PURE__ */ jsx49(CreditCard, {}),
|
|
3359
|
+
"Billing"
|
|
3360
|
+
] }),
|
|
3361
|
+
/* @__PURE__ */ jsxs29(DropdownMenuItem, { children: [
|
|
3362
|
+
/* @__PURE__ */ jsx49(Bell, {}),
|
|
3363
|
+
"Notifications"
|
|
3364
|
+
] })
|
|
3365
|
+
] }),
|
|
3366
|
+
/* @__PURE__ */ jsx49(DropdownMenuSeparator, {}),
|
|
3367
|
+
/* @__PURE__ */ jsxs29(DropdownMenuItem, { onClick: logoutAction, children: [
|
|
3368
|
+
/* @__PURE__ */ jsx49(LogOut, {}),
|
|
3369
|
+
"Log out"
|
|
3370
|
+
] })
|
|
3371
|
+
]
|
|
3372
|
+
}
|
|
3373
|
+
)
|
|
3374
|
+
] }) }) });
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
// src/components/layout/PageLayout/index.tsx
|
|
3378
|
+
import { jsx as jsx50, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3379
|
+
var PageLayout = ({
|
|
3380
|
+
subtitle,
|
|
3381
|
+
title,
|
|
3382
|
+
children,
|
|
3383
|
+
header
|
|
3384
|
+
}) => {
|
|
3385
|
+
return /* @__PURE__ */ jsxs30("div", { className: "m-5 p-4 bg-white", children: [
|
|
3386
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex justify-between", children: [
|
|
3387
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
3388
|
+
title && /* @__PURE__ */ jsx50(Text, { variant: "title", children: title }),
|
|
3389
|
+
subtitle && /* @__PURE__ */ jsx50(Text, { variant: "muted", children: subtitle })
|
|
3390
|
+
] }),
|
|
3391
|
+
header
|
|
3392
|
+
] }),
|
|
3393
|
+
/* @__PURE__ */ jsx50("div", { className: "mt-5", children })
|
|
3394
|
+
] });
|
|
3395
|
+
};
|
|
3396
|
+
|
|
3397
|
+
// src/components/ui/tabs.tsx
|
|
3398
|
+
import * as React23 from "react";
|
|
3399
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3400
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
3401
|
+
var Tabs = TabsPrimitive.Root;
|
|
3402
|
+
var TabsList = React23.forwardRef((_a, ref) => {
|
|
3403
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3404
|
+
return /* @__PURE__ */ jsx51(
|
|
3405
|
+
TabsPrimitive.List,
|
|
3406
|
+
__spreadValues({
|
|
3407
|
+
ref,
|
|
3408
|
+
className: cn(
|
|
3409
|
+
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
3410
|
+
className
|
|
3411
|
+
)
|
|
3412
|
+
}, props)
|
|
3413
|
+
);
|
|
3414
|
+
});
|
|
3415
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
3416
|
+
var TabsTrigger = React23.forwardRef((_a, ref) => {
|
|
3417
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3418
|
+
return /* @__PURE__ */ jsx51(
|
|
3419
|
+
TabsPrimitive.Trigger,
|
|
3420
|
+
__spreadValues({
|
|
3421
|
+
ref,
|
|
3422
|
+
className: cn(
|
|
3423
|
+
"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",
|
|
3424
|
+
className
|
|
3425
|
+
)
|
|
3426
|
+
}, props)
|
|
3427
|
+
);
|
|
3428
|
+
});
|
|
3429
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
3430
|
+
var TabsContent = React23.forwardRef((_a, ref) => {
|
|
3431
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3432
|
+
return /* @__PURE__ */ jsx51(
|
|
3433
|
+
TabsPrimitive.Content,
|
|
3434
|
+
__spreadValues({
|
|
3435
|
+
ref,
|
|
3436
|
+
className: cn(
|
|
3437
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
3438
|
+
className
|
|
3439
|
+
)
|
|
3440
|
+
}, props)
|
|
3441
|
+
);
|
|
3442
|
+
});
|
|
3443
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
3444
|
+
|
|
3445
|
+
// src/components/layout/Tabs/Tabs.tsx
|
|
3446
|
+
import { jsx as jsx52, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3447
|
+
var Tabs2 = ({
|
|
3448
|
+
tabs,
|
|
3449
|
+
activeTabIndex = 0,
|
|
3450
|
+
onTabChange,
|
|
3451
|
+
className
|
|
3452
|
+
}) => {
|
|
3453
|
+
return /* @__PURE__ */ jsxs31(
|
|
3454
|
+
Tabs,
|
|
3455
|
+
{
|
|
3456
|
+
value: tabs[activeTabIndex].label,
|
|
3457
|
+
onValueChange: (value) => {
|
|
3458
|
+
const index = tabs.findIndex((tab) => tab.label === value);
|
|
3459
|
+
if (onTabChange) onTabChange(index);
|
|
3460
|
+
},
|
|
3461
|
+
className: cn("w-full", className),
|
|
3462
|
+
children: [
|
|
3463
|
+
/* @__PURE__ */ jsx52(TabsList, { children: tabs.map((tab, index) => /* @__PURE__ */ jsx52(TabsTrigger, { value: tab.label, children: tab.label }, index)) }),
|
|
3464
|
+
tabs.map((tab, index) => /* @__PURE__ */ jsx52(TabsContent, { value: tab.label, children: tab.content }, index))
|
|
3465
|
+
]
|
|
3466
|
+
}
|
|
3467
|
+
);
|
|
3468
|
+
};
|
|
3469
|
+
|
|
3470
|
+
// src/components/actions/Steps/Steps.tsx
|
|
3471
|
+
import { jsx as jsx53, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3472
|
+
var Steps = ({ data, onClick = () => {
|
|
3473
|
+
}, value }) => {
|
|
3474
|
+
const renderSteps = useCallback8(() => {
|
|
3475
|
+
return data.map(({ label, id }, index) => {
|
|
3476
|
+
const isLast = index === data.length - 1;
|
|
3477
|
+
const isActive = typeof value === "number" && id <= value;
|
|
3478
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn(!isLast && "w-full flex items-center"), children: [
|
|
3479
|
+
/* @__PURE__ */ jsx53("div", { children: /* @__PURE__ */ jsx53(
|
|
3480
|
+
Button2,
|
|
3481
|
+
{
|
|
3482
|
+
onClick: () => onClick && onClick(id),
|
|
3483
|
+
variant: isActive ? "default" : "outline",
|
|
3484
|
+
size: "icon",
|
|
3485
|
+
className: "rounded-full",
|
|
3486
|
+
children: isActive ? /* @__PURE__ */ jsx53(Icon2, { name: "MdCheck" }) : index + 1
|
|
3487
|
+
}
|
|
3488
|
+
) }),
|
|
3489
|
+
label && /* @__PURE__ */ jsx53("p", { className: "absolute", children: label }),
|
|
3490
|
+
!isLast && /* @__PURE__ */ jsx53(
|
|
3491
|
+
Separator3,
|
|
3492
|
+
{
|
|
3493
|
+
orientation: "horizontal",
|
|
3494
|
+
className: cn(isActive && "bg-primary h-[2px]")
|
|
3495
|
+
}
|
|
3496
|
+
)
|
|
3497
|
+
] }, index);
|
|
3498
|
+
});
|
|
3499
|
+
}, [data, onClick, value]);
|
|
3500
|
+
return /* @__PURE__ */ jsx53("div", { className: "flex w-full", children: renderSteps() });
|
|
3501
|
+
};
|
|
3502
|
+
|
|
3503
|
+
// src/components/ui/alert-dialog.tsx
|
|
3504
|
+
import * as React24 from "react";
|
|
3505
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3506
|
+
import { jsx as jsx54, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3507
|
+
var AlertDialog = AlertDialogPrimitive.Root;
|
|
3508
|
+
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
3509
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
3510
|
+
var AlertDialogOverlay = React24.forwardRef((_a, ref) => {
|
|
3511
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3512
|
+
return /* @__PURE__ */ jsx54(
|
|
3513
|
+
AlertDialogPrimitive.Overlay,
|
|
3514
|
+
__spreadProps(__spreadValues({
|
|
3515
|
+
className: cn(
|
|
3516
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
3517
|
+
className
|
|
3518
|
+
)
|
|
3519
|
+
}, props), {
|
|
3520
|
+
ref
|
|
3521
|
+
})
|
|
3522
|
+
);
|
|
3523
|
+
});
|
|
3524
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
3525
|
+
var AlertDialogContent = React24.forwardRef((_a, ref) => {
|
|
3526
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3527
|
+
return /* @__PURE__ */ jsxs33(AlertDialogPortal, { children: [
|
|
3528
|
+
/* @__PURE__ */ jsx54(AlertDialogOverlay, {}),
|
|
3529
|
+
/* @__PURE__ */ jsx54(
|
|
3530
|
+
AlertDialogPrimitive.Content,
|
|
3531
|
+
__spreadValues({
|
|
3532
|
+
ref,
|
|
3533
|
+
className: cn(
|
|
3534
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
3535
|
+
className
|
|
3536
|
+
)
|
|
3537
|
+
}, props)
|
|
3538
|
+
)
|
|
3539
|
+
] });
|
|
3540
|
+
});
|
|
3541
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
3542
|
+
var AlertDialogHeader = (_a) => {
|
|
3543
|
+
var _b = _a, {
|
|
3544
|
+
className
|
|
3545
|
+
} = _b, props = __objRest(_b, [
|
|
3546
|
+
"className"
|
|
3547
|
+
]);
|
|
3548
|
+
return /* @__PURE__ */ jsx54(
|
|
3549
|
+
"div",
|
|
3550
|
+
__spreadValues({
|
|
3551
|
+
className: cn(
|
|
3552
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
3553
|
+
className
|
|
3554
|
+
)
|
|
3555
|
+
}, props)
|
|
3556
|
+
);
|
|
3557
|
+
};
|
|
3558
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
3559
|
+
var AlertDialogFooter = (_a) => {
|
|
3560
|
+
var _b = _a, {
|
|
3561
|
+
className
|
|
3562
|
+
} = _b, props = __objRest(_b, [
|
|
3563
|
+
"className"
|
|
3564
|
+
]);
|
|
3565
|
+
return /* @__PURE__ */ jsx54(
|
|
3566
|
+
"div",
|
|
3567
|
+
__spreadValues({
|
|
3568
|
+
className: cn(
|
|
3569
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
3570
|
+
className
|
|
3571
|
+
)
|
|
3572
|
+
}, props)
|
|
3573
|
+
);
|
|
3574
|
+
};
|
|
3575
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
3576
|
+
var AlertDialogTitle = React24.forwardRef((_a, ref) => {
|
|
3577
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3578
|
+
return /* @__PURE__ */ jsx54(
|
|
3579
|
+
AlertDialogPrimitive.Title,
|
|
3580
|
+
__spreadValues({
|
|
3581
|
+
ref,
|
|
3582
|
+
className: cn("text-lg font-semibold", className)
|
|
3583
|
+
}, props)
|
|
3584
|
+
);
|
|
3585
|
+
});
|
|
3586
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
3587
|
+
var AlertDialogDescription = React24.forwardRef((_a, ref) => {
|
|
3588
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3589
|
+
return /* @__PURE__ */ jsx54(
|
|
3590
|
+
AlertDialogPrimitive.Description,
|
|
3591
|
+
__spreadValues({
|
|
3592
|
+
ref,
|
|
3593
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
3594
|
+
}, props)
|
|
3595
|
+
);
|
|
3596
|
+
});
|
|
3597
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
3598
|
+
var AlertDialogAction = React24.forwardRef((_a, ref) => {
|
|
3599
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3600
|
+
return /* @__PURE__ */ jsx54(
|
|
3601
|
+
AlertDialogPrimitive.Action,
|
|
3602
|
+
__spreadValues({
|
|
3603
|
+
ref,
|
|
3604
|
+
className: cn(buttonVariants(), className)
|
|
3605
|
+
}, props)
|
|
3606
|
+
);
|
|
3607
|
+
});
|
|
3608
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
3609
|
+
var AlertDialogCancel = React24.forwardRef((_a, ref) => {
|
|
3610
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3611
|
+
return /* @__PURE__ */ jsx54(
|
|
3612
|
+
AlertDialogPrimitive.Cancel,
|
|
3613
|
+
__spreadValues({
|
|
3614
|
+
ref,
|
|
3615
|
+
className: cn(
|
|
3616
|
+
buttonVariants({ variant: "outline" }),
|
|
3617
|
+
"mt-2 sm:mt-0",
|
|
3618
|
+
className
|
|
3619
|
+
)
|
|
3620
|
+
}, props)
|
|
3621
|
+
);
|
|
3622
|
+
});
|
|
3623
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
3624
|
+
|
|
3625
|
+
// src/components/actions/AlertDialog/AlertDialog.tsx
|
|
3626
|
+
import { jsx as jsx55, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3627
|
+
var AlertDialog2 = ({
|
|
3628
|
+
title,
|
|
3629
|
+
description,
|
|
3630
|
+
children,
|
|
3631
|
+
onConfirm,
|
|
3632
|
+
onCancel
|
|
3633
|
+
}) => {
|
|
3634
|
+
return /* @__PURE__ */ jsxs34(AlertDialog, { children: [
|
|
3635
|
+
/* @__PURE__ */ jsx55(AlertDialogTrigger, { asChild: true, children }),
|
|
3636
|
+
/* @__PURE__ */ jsxs34(AlertDialogContent, { children: [
|
|
3637
|
+
/* @__PURE__ */ jsxs34(AlertDialogHeader, { children: [
|
|
3638
|
+
/* @__PURE__ */ jsx55(AlertDialogTitle, { children: title }),
|
|
3639
|
+
description && /* @__PURE__ */ jsx55(AlertDialogDescription, { children: description })
|
|
3640
|
+
] }),
|
|
3641
|
+
/* @__PURE__ */ jsxs34(AlertDialogFooter, { children: [
|
|
3642
|
+
/* @__PURE__ */ jsx55(AlertDialogCancel, { onClick: onCancel, children: "Cancel" }),
|
|
3643
|
+
/* @__PURE__ */ jsx55(AlertDialogAction, { onClick: onConfirm, children: "Continue" })
|
|
3644
|
+
] })
|
|
3645
|
+
] })
|
|
3646
|
+
] });
|
|
3647
|
+
};
|
|
3648
|
+
|
|
3649
|
+
// src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx
|
|
3650
|
+
import { useCallback as useCallback9, useMemo as useMemo9, useState as useState8 } from "react";
|
|
3651
|
+
import { useFormContext as useFormContext5 } from "react-hook-form";
|
|
3652
|
+
import _ from "lodash";
|
|
3653
|
+
import { jsx as jsx56, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3654
|
+
var MultipleInputBase = ({
|
|
3655
|
+
children,
|
|
3656
|
+
data = [],
|
|
3657
|
+
name,
|
|
3658
|
+
onChangeData = () => {
|
|
3659
|
+
},
|
|
3660
|
+
error
|
|
3661
|
+
}) => {
|
|
3662
|
+
const form = useFormContext5();
|
|
3663
|
+
const withForm = !!form && !!name;
|
|
3664
|
+
const [inputValue, setInputValue] = useState8("");
|
|
3665
|
+
const inputData = useMemo9(() => {
|
|
3666
|
+
if (withForm) {
|
|
3667
|
+
return _.get(form.watch(), name) || [];
|
|
3668
|
+
}
|
|
3669
|
+
return data;
|
|
3670
|
+
}, [withForm, form, name, data]);
|
|
3671
|
+
const errorMessage = useMemo9(() => {
|
|
3672
|
+
var _a;
|
|
3673
|
+
if (withForm) {
|
|
3674
|
+
return (_a = _.get(form.formState.errors, name)) == null ? void 0 : _a.message;
|
|
3675
|
+
}
|
|
3676
|
+
return error;
|
|
3677
|
+
}, [error, form, name, withForm]);
|
|
3678
|
+
const updateData = useCallback9(() => {
|
|
3679
|
+
if (!inputValue.length) return;
|
|
3680
|
+
if (withForm) {
|
|
3681
|
+
form.setValue(name, [...inputData, inputValue]);
|
|
3682
|
+
} else {
|
|
3683
|
+
onChangeData == null ? void 0 : onChangeData(inputData.concat(inputValue));
|
|
3684
|
+
}
|
|
3685
|
+
setInputValue("");
|
|
3686
|
+
}, [inputData, inputValue, withForm, form, name, onChangeData]);
|
|
3687
|
+
const removeItem = useCallback9(
|
|
3688
|
+
(index) => {
|
|
3689
|
+
if (withForm) {
|
|
3690
|
+
form.setValue(
|
|
3691
|
+
name,
|
|
3692
|
+
inputData.filter((_2, i) => i !== index)
|
|
3693
|
+
);
|
|
3694
|
+
} else {
|
|
3695
|
+
onChangeData == null ? void 0 : onChangeData(inputData.filter((_2, i) => i !== index));
|
|
3696
|
+
}
|
|
3697
|
+
},
|
|
3698
|
+
[withForm, form, name, inputData, onChangeData]
|
|
3699
|
+
);
|
|
3700
|
+
const renderOptions = useCallback9(() => {
|
|
3701
|
+
return inputData == null ? void 0 : inputData.map((item, index) => {
|
|
3702
|
+
return /* @__PURE__ */ jsxs35("div", { className: "flex justify-between mt-2", children: [
|
|
3703
|
+
/* @__PURE__ */ jsx56("div", { children: item }),
|
|
3704
|
+
/* @__PURE__ */ jsx56(
|
|
3705
|
+
Button2,
|
|
3706
|
+
{
|
|
3707
|
+
onClick: () => removeItem(index),
|
|
3708
|
+
variant: "ghost",
|
|
3709
|
+
size: "icon",
|
|
3710
|
+
type: "button",
|
|
3711
|
+
children: /* @__PURE__ */ jsx56(Icon2, { name: "MdDelete", className: "fill-destructive" })
|
|
3712
|
+
}
|
|
3713
|
+
)
|
|
3714
|
+
] }, index);
|
|
3715
|
+
});
|
|
3716
|
+
}, [inputData, removeItem]);
|
|
3717
|
+
return /* @__PURE__ */ jsxs35("div", { children: [
|
|
3718
|
+
children({
|
|
3719
|
+
onChange: ({ target: { value } }) => {
|
|
3720
|
+
setInputValue(value);
|
|
3721
|
+
},
|
|
3722
|
+
addItem: updateData,
|
|
3723
|
+
value: inputValue,
|
|
3724
|
+
error: errorMessage
|
|
3725
|
+
}),
|
|
3726
|
+
renderOptions()
|
|
3727
|
+
] });
|
|
3728
|
+
};
|
|
3729
|
+
|
|
3730
|
+
// src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx
|
|
3731
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
3732
|
+
var MultipleMaskInput = (_a) => {
|
|
3733
|
+
var _b = _a, {
|
|
3734
|
+
data = []
|
|
3735
|
+
} = _b, props = __objRest(_b, [
|
|
3736
|
+
"data"
|
|
3737
|
+
]);
|
|
3738
|
+
return /* @__PURE__ */ jsx57(MultipleInputBase, __spreadProps(__spreadValues({ data }, props), { children: ({ onChange, addItem, value }) => {
|
|
3739
|
+
return /* @__PURE__ */ jsx57(
|
|
3740
|
+
MaskInput,
|
|
3741
|
+
__spreadProps(__spreadValues({}, props), {
|
|
3742
|
+
value,
|
|
3743
|
+
onChange,
|
|
3744
|
+
withoutForm: true,
|
|
3745
|
+
component: /* @__PURE__ */ jsx57(Button2, { type: "button", onClick: () => addItem(), children: /* @__PURE__ */ jsx57(Icon2, { name: "MdAdd" }) })
|
|
3746
|
+
})
|
|
3747
|
+
);
|
|
3748
|
+
} }));
|
|
3749
|
+
};
|
|
3750
|
+
|
|
3751
|
+
// src/components/dataInput/Select/SelectBase.tsx
|
|
3752
|
+
import { useCallback as useCallback10 } from "react";
|
|
3753
|
+
import { jsx as jsx58, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3754
|
+
var SelectBase = (_a) => {
|
|
3755
|
+
var _b = _a, {
|
|
3756
|
+
options,
|
|
3757
|
+
placeholder,
|
|
3758
|
+
onChange = () => {
|
|
3759
|
+
},
|
|
3760
|
+
onChangeCallback = () => {
|
|
3761
|
+
},
|
|
3762
|
+
value
|
|
3763
|
+
} = _b, rest = __objRest(_b, [
|
|
3764
|
+
"options",
|
|
3765
|
+
"placeholder",
|
|
3766
|
+
"onChange",
|
|
3767
|
+
"onChangeCallback",
|
|
3768
|
+
"value"
|
|
3769
|
+
]);
|
|
3770
|
+
const onSelect = useCallback10(
|
|
3771
|
+
(value2) => {
|
|
3772
|
+
onChange(value2);
|
|
3773
|
+
onChangeCallback(value2);
|
|
3774
|
+
},
|
|
3775
|
+
[onChange, onChangeCallback]
|
|
3776
|
+
);
|
|
3777
|
+
return /* @__PURE__ */ jsxs36(
|
|
3778
|
+
Select,
|
|
3779
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
3780
|
+
onValueChange: onSelect,
|
|
3781
|
+
defaultValue: value,
|
|
3782
|
+
value,
|
|
3783
|
+
children: [
|
|
3784
|
+
/* @__PURE__ */ jsx58(SelectTrigger, { children: /* @__PURE__ */ jsx58(SelectValue, { placeholder }) }),
|
|
3785
|
+
/* @__PURE__ */ jsx58(SelectContent, { children: options == null ? void 0 : options.map((option, index) => /* @__PURE__ */ jsx58(SelectItem, { value: String(option.value), children: option.label }, index)) })
|
|
3786
|
+
]
|
|
3787
|
+
})
|
|
3788
|
+
);
|
|
3789
|
+
};
|
|
3790
|
+
|
|
3791
|
+
// src/components/dataInput/Select/Select.tsx
|
|
3792
|
+
import { useFormContext as useFormContext6 } from "react-hook-form";
|
|
3793
|
+
import { jsx as jsx59, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3794
|
+
var Select2 = (_a) => {
|
|
3795
|
+
var _b = _a, {
|
|
3796
|
+
name,
|
|
3797
|
+
label,
|
|
3798
|
+
description,
|
|
3799
|
+
error,
|
|
3800
|
+
className,
|
|
3801
|
+
withoutForm,
|
|
3802
|
+
options,
|
|
3803
|
+
placeholder
|
|
3804
|
+
} = _b, props = __objRest(_b, [
|
|
3805
|
+
"name",
|
|
3806
|
+
"label",
|
|
3807
|
+
"description",
|
|
3808
|
+
"error",
|
|
3809
|
+
"className",
|
|
3810
|
+
"withoutForm",
|
|
3811
|
+
"options",
|
|
3812
|
+
"placeholder"
|
|
3813
|
+
]);
|
|
3814
|
+
const form = useFormContext6();
|
|
3815
|
+
const hasForm = !!form && !!name;
|
|
3816
|
+
if (!hasForm || withoutForm) {
|
|
3817
|
+
return /* @__PURE__ */ jsxs37("div", { className: cn("space-y-2", className), children: [
|
|
3818
|
+
label && /* @__PURE__ */ jsx59(Label3, { children: label }),
|
|
3819
|
+
/* @__PURE__ */ jsx59(SelectBase, __spreadValues({ options, placeholder }, props)),
|
|
3820
|
+
description && /* @__PURE__ */ jsx59("p", { className: "text-sm text-muted-foreground", children: description }),
|
|
3821
|
+
error && /* @__PURE__ */ jsx59(ErrorMessage, { children: error })
|
|
3822
|
+
] });
|
|
3823
|
+
}
|
|
3824
|
+
return /* @__PURE__ */ jsx59(
|
|
3825
|
+
FormField,
|
|
3826
|
+
{
|
|
3827
|
+
control: form.control,
|
|
3828
|
+
name,
|
|
3829
|
+
render: ({ field }) => /* @__PURE__ */ jsxs37(FormItem, { className, children: [
|
|
3830
|
+
label && /* @__PURE__ */ jsx59(FormLabel, { children: label }),
|
|
3831
|
+
/* @__PURE__ */ jsx59(FormControl, { children: /* @__PURE__ */ jsx59(
|
|
3832
|
+
SelectBase,
|
|
3833
|
+
__spreadValues(__spreadValues({
|
|
3834
|
+
options,
|
|
3835
|
+
placeholder
|
|
3836
|
+
}, props), field)
|
|
3837
|
+
) }),
|
|
3838
|
+
description && /* @__PURE__ */ jsx59(FormDescription, { children: description }),
|
|
3839
|
+
/* @__PURE__ */ jsx59(FormMessage, {})
|
|
3840
|
+
] })
|
|
3841
|
+
}
|
|
3842
|
+
);
|
|
3843
|
+
};
|
|
3844
|
+
|
|
3845
|
+
// src/components/dataDisplay/Label/Label.tsx
|
|
3846
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3847
|
+
var Label4 = (props) => {
|
|
3848
|
+
return /* @__PURE__ */ jsx60(Label3, __spreadValues({}, props));
|
|
3849
|
+
};
|
|
3850
|
+
|
|
3851
|
+
// src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx
|
|
3852
|
+
import * as React25 from "react";
|
|
3853
|
+
import { Search, X as X4 } from "lucide-react";
|
|
3854
|
+
import * as Popover from "@radix-ui/react-popover";
|
|
3855
|
+
import { jsx as jsx61, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3856
|
+
function MultiSelectBase({
|
|
3857
|
+
options = [],
|
|
3858
|
+
selected = [],
|
|
3859
|
+
onChange = () => {
|
|
3860
|
+
},
|
|
3861
|
+
placeholder = "Select frameworks...",
|
|
3862
|
+
className
|
|
3863
|
+
}) {
|
|
3864
|
+
const [open, setOpen] = React25.useState(false);
|
|
3865
|
+
const [inputValue, setInputValue] = React25.useState("");
|
|
3866
|
+
const inputRef = React25.useRef(null);
|
|
3867
|
+
const handleRemoveItem = (valueToRemove) => {
|
|
3868
|
+
onChange(selected.filter((value) => value !== valueToRemove));
|
|
3869
|
+
};
|
|
3870
|
+
const handleSelectItem = (value) => {
|
|
3871
|
+
if (selected.includes(value)) {
|
|
3872
|
+
onChange(selected.filter((v) => v !== value));
|
|
3873
|
+
} else {
|
|
3874
|
+
onChange([...selected, value]);
|
|
3875
|
+
}
|
|
3876
|
+
};
|
|
3877
|
+
const filteredOptions = options.filter(
|
|
3878
|
+
(option) => option.label.toLowerCase().includes(inputValue.toLowerCase())
|
|
3879
|
+
);
|
|
3880
|
+
return /* @__PURE__ */ jsxs38(Popover.Root, { open, onOpenChange: setOpen, children: [
|
|
3881
|
+
/* @__PURE__ */ jsx61(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs38(
|
|
3882
|
+
"div",
|
|
3883
|
+
{
|
|
3884
|
+
className: cn(
|
|
3885
|
+
"flex min-h-[40px] w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
3886
|
+
className
|
|
3887
|
+
),
|
|
3888
|
+
children: [
|
|
3889
|
+
selected.map((value) => {
|
|
3890
|
+
const option = options.find((o) => o.value === value);
|
|
3891
|
+
if (!option) return null;
|
|
3892
|
+
return /* @__PURE__ */ jsxs38(
|
|
3893
|
+
"div",
|
|
3894
|
+
{
|
|
3895
|
+
className: "flex items-center gap-1 rounded-md bg-secondary px-2 py-1 text-sm text-secondary-foreground",
|
|
3896
|
+
children: [
|
|
3897
|
+
option.label,
|
|
3898
|
+
/* @__PURE__ */ jsxs38(
|
|
3899
|
+
"button",
|
|
3900
|
+
{
|
|
3901
|
+
type: "button",
|
|
3902
|
+
onClick: (e) => {
|
|
3903
|
+
e.stopPropagation();
|
|
3904
|
+
handleRemoveItem(value);
|
|
3905
|
+
},
|
|
3906
|
+
className: "rounded-full hover:bg-secondary-foreground/20",
|
|
3907
|
+
children: [
|
|
3908
|
+
/* @__PURE__ */ jsx61(X4, { className: "h-3 w-3" }),
|
|
3909
|
+
/* @__PURE__ */ jsxs38("span", { className: "sr-only", children: [
|
|
3910
|
+
"Remove ",
|
|
3911
|
+
option.label
|
|
3912
|
+
] })
|
|
3913
|
+
]
|
|
3914
|
+
}
|
|
3915
|
+
)
|
|
3916
|
+
]
|
|
3917
|
+
},
|
|
3918
|
+
value
|
|
3919
|
+
);
|
|
3920
|
+
}),
|
|
3921
|
+
/* @__PURE__ */ jsx61("div", { className: "flex-1", children: selected.length === 0 && /* @__PURE__ */ jsx61("span", { className: "text-muted-foreground", children: placeholder }) })
|
|
3922
|
+
]
|
|
3923
|
+
}
|
|
3924
|
+
) }),
|
|
3925
|
+
/* @__PURE__ */ jsx61(Popover.Portal, { children: /* @__PURE__ */ jsxs38(
|
|
3926
|
+
Popover.Content,
|
|
3927
|
+
{
|
|
3928
|
+
className: "w-[--radix-popover-trigger-width] z-50 mt-1 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
|
|
3929
|
+
align: "start",
|
|
3930
|
+
sideOffset: 4,
|
|
3931
|
+
children: [
|
|
3932
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center border-b border-border px-3 py-2", children: [
|
|
3933
|
+
/* @__PURE__ */ jsx61(Search, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3934
|
+
/* @__PURE__ */ jsx61(
|
|
3935
|
+
"input",
|
|
3936
|
+
{
|
|
3937
|
+
ref: inputRef,
|
|
3938
|
+
value: inputValue,
|
|
3939
|
+
onChange: (e) => setInputValue(e.target.value),
|
|
3940
|
+
placeholder: "Search...",
|
|
3941
|
+
className: "flex-1 bg-transparent px-2 outline-none placeholder:text-muted-foreground"
|
|
3942
|
+
}
|
|
3943
|
+
)
|
|
3944
|
+
] }),
|
|
3945
|
+
/* @__PURE__ */ jsx61("div", { className: "max-h-[200px] overflow-auto", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx61("div", { className: "px-2 py-4 text-center text-sm text-muted-foreground", children: "No results found." }) : filteredOptions.map((option) => /* @__PURE__ */ jsxs38(
|
|
3946
|
+
"div",
|
|
3947
|
+
{
|
|
3948
|
+
onClick: () => handleSelectItem(option.value),
|
|
3949
|
+
className: cn(
|
|
3950
|
+
"flex cursor-pointer items-center gap-2 px-4 py-2 text-sm hover:bg-accent",
|
|
3951
|
+
selected.includes(option.value) && "bg-accent"
|
|
3952
|
+
),
|
|
3953
|
+
children: [
|
|
3954
|
+
/* @__PURE__ */ jsx61(
|
|
3955
|
+
"div",
|
|
3956
|
+
{
|
|
3957
|
+
className: cn(
|
|
3958
|
+
"flex h-4 w-4 items-center justify-center rounded border border-primary",
|
|
3959
|
+
selected.includes(option.value) && "bg-primary text-primary-foreground"
|
|
3960
|
+
),
|
|
3961
|
+
children: selected.includes(option.value) && /* @__PURE__ */ jsx61("span", { className: "text-[10px]", children: "\u2713" })
|
|
3962
|
+
}
|
|
3963
|
+
),
|
|
3964
|
+
option.label
|
|
3965
|
+
]
|
|
3966
|
+
},
|
|
3967
|
+
option.value
|
|
3968
|
+
)) })
|
|
3969
|
+
]
|
|
3970
|
+
}
|
|
3971
|
+
) })
|
|
3972
|
+
] });
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
// src/components/dataInput/Select/MultiSelect/index.tsx
|
|
3976
|
+
import { useFormContext as useFormContext7 } from "react-hook-form";
|
|
3977
|
+
import { jsx as jsx62, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3978
|
+
function MultiSelect(_a) {
|
|
3979
|
+
var _b = _a, {
|
|
3980
|
+
label,
|
|
3981
|
+
name,
|
|
3982
|
+
withoutForm,
|
|
3983
|
+
className,
|
|
3984
|
+
required,
|
|
3985
|
+
"data-testid": testId
|
|
3986
|
+
} = _b, props = __objRest(_b, [
|
|
3987
|
+
"label",
|
|
3988
|
+
"name",
|
|
3989
|
+
"withoutForm",
|
|
3990
|
+
"className",
|
|
3991
|
+
"required",
|
|
3992
|
+
"data-testid"
|
|
3993
|
+
]);
|
|
3994
|
+
const form = useFormContext7();
|
|
3995
|
+
const hasForm = !withoutForm && !!form && !!name;
|
|
3996
|
+
if (!hasForm)
|
|
3997
|
+
return /* @__PURE__ */ jsxs39("div", { className: "grid w-full items-center gap-3", children: [
|
|
3998
|
+
label && /* @__PURE__ */ jsx62(Label4, { htmlFor: name, children: label }),
|
|
3999
|
+
/* @__PURE__ */ jsx62(MultiSelectBase, __spreadValues({}, props))
|
|
4000
|
+
] });
|
|
4001
|
+
return /* @__PURE__ */ jsx62(
|
|
4002
|
+
FormField,
|
|
4003
|
+
{
|
|
4004
|
+
control: form.control,
|
|
4005
|
+
name,
|
|
4006
|
+
render: (_a2) => {
|
|
4007
|
+
var { field: _b2 } = _a2, _c = _b2, { value } = _c, rest = __objRest(_c, ["value"]);
|
|
4008
|
+
return /* @__PURE__ */ jsxs39(
|
|
4009
|
+
FormItem,
|
|
4010
|
+
{
|
|
4011
|
+
className,
|
|
4012
|
+
"data-testid": testId ? `form-item-${testId}` : void 0,
|
|
4013
|
+
children: [
|
|
4014
|
+
label && /* @__PURE__ */ jsx62(
|
|
4015
|
+
FormLabel,
|
|
4016
|
+
{
|
|
4017
|
+
htmlFor: name,
|
|
4018
|
+
"data-testid": testId ? `form-label-${testId}` : void 0,
|
|
4019
|
+
children: `${label}${required ? " *" : ""}`
|
|
4020
|
+
}
|
|
4021
|
+
),
|
|
4022
|
+
/* @__PURE__ */ jsx62(FormControl, { children: /* @__PURE__ */ jsx62("div", { className: "flex w-full items-center space-x-2", children: /* @__PURE__ */ jsx62(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, props), rest), { selected: value })) }) }),
|
|
4023
|
+
/* @__PURE__ */ jsx62(
|
|
4024
|
+
FormMessage,
|
|
4025
|
+
{
|
|
4026
|
+
role: "alert",
|
|
4027
|
+
"data-testid": testId ? `form-message-${testId}` : void 0
|
|
4028
|
+
}
|
|
4029
|
+
)
|
|
4030
|
+
]
|
|
4031
|
+
}
|
|
4032
|
+
);
|
|
4033
|
+
}
|
|
4034
|
+
}
|
|
4035
|
+
);
|
|
4036
|
+
}
|
|
4037
|
+
|
|
4038
|
+
// src/components/ui/switch.tsx
|
|
4039
|
+
import * as React26 from "react";
|
|
4040
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
4041
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
4042
|
+
var Switch = React26.forwardRef((_a, ref) => {
|
|
4043
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
4044
|
+
return /* @__PURE__ */ jsx63(
|
|
4045
|
+
SwitchPrimitives.Root,
|
|
4046
|
+
__spreadProps(__spreadValues({
|
|
4047
|
+
className: cn(
|
|
4048
|
+
"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",
|
|
4049
|
+
className
|
|
4050
|
+
)
|
|
4051
|
+
}, props), {
|
|
4052
|
+
ref,
|
|
4053
|
+
children: /* @__PURE__ */ jsx63(
|
|
4054
|
+
SwitchPrimitives.Thumb,
|
|
4055
|
+
{
|
|
4056
|
+
className: cn(
|
|
4057
|
+
"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"
|
|
4058
|
+
)
|
|
4059
|
+
}
|
|
4060
|
+
)
|
|
4061
|
+
})
|
|
4062
|
+
);
|
|
4063
|
+
});
|
|
4064
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
4065
|
+
|
|
4066
|
+
// src/components/dataInput/Switch/Switch.tsx
|
|
4067
|
+
import { useFormContext as useFormContext8 } from "react-hook-form";
|
|
4068
|
+
import { jsx as jsx64, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4069
|
+
function Switch2(_a) {
|
|
4070
|
+
var _b = _a, {
|
|
4071
|
+
label,
|
|
4072
|
+
withoutForm,
|
|
4073
|
+
className
|
|
4074
|
+
} = _b, props = __objRest(_b, [
|
|
4075
|
+
"label",
|
|
4076
|
+
"withoutForm",
|
|
4077
|
+
"className"
|
|
4078
|
+
]);
|
|
4079
|
+
var _a2;
|
|
4080
|
+
const form = useFormContext8();
|
|
4081
|
+
const hasForm = !!form && !withoutForm && !!props.name;
|
|
4082
|
+
if (!hasForm)
|
|
4083
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-2", children: [
|
|
4084
|
+
/* @__PURE__ */ jsx64(Switch, __spreadValues({}, props)),
|
|
4085
|
+
label && /* @__PURE__ */ jsx64(Label3, { htmlFor: props.id, children: label })
|
|
4086
|
+
] });
|
|
4087
|
+
return /* @__PURE__ */ jsx64(
|
|
4088
|
+
FormField,
|
|
4089
|
+
{
|
|
4090
|
+
control: form.control,
|
|
4091
|
+
name: (_a2 = props.name) != null ? _a2 : "",
|
|
4092
|
+
render: ({ field }) => /* @__PURE__ */ jsxs40(
|
|
4093
|
+
FormItem,
|
|
4094
|
+
{
|
|
4095
|
+
className: cn(className, "flex items-center space-x-2 space-y-0"),
|
|
4096
|
+
children: [
|
|
4097
|
+
/* @__PURE__ */ jsx64(FormControl, { children: /* @__PURE__ */ jsx64(Switch2, { checked: field.value, onCheckedChange: field.onChange }) }),
|
|
4098
|
+
/* @__PURE__ */ jsx64(FormLabel, { children: label })
|
|
4099
|
+
]
|
|
4100
|
+
}
|
|
4101
|
+
)
|
|
4102
|
+
}
|
|
4103
|
+
);
|
|
4104
|
+
}
|
|
4105
|
+
export {
|
|
4106
|
+
AlertDialog2 as AlertDialog,
|
|
4107
|
+
Avatar,
|
|
4108
|
+
AvatarFallback,
|
|
4109
|
+
AvatarImage,
|
|
4110
|
+
Badge,
|
|
4111
|
+
Breadcrumb,
|
|
4112
|
+
BreadcrumbEllipsis,
|
|
4113
|
+
BreadcrumbItem,
|
|
4114
|
+
BreadcrumbLink,
|
|
4115
|
+
BreadcrumbList,
|
|
4116
|
+
BreadcrumbPage,
|
|
4117
|
+
BreadcrumbSeparator,
|
|
4118
|
+
Button2 as Button,
|
|
4119
|
+
Checkbox2 as Checkbox,
|
|
4120
|
+
Collapsible,
|
|
4121
|
+
CollapsibleContent2 as CollapsibleContent,
|
|
4122
|
+
CollapsibleTrigger2 as CollapsibleTrigger,
|
|
4123
|
+
CustomDrawer,
|
|
4124
|
+
DataPairList,
|
|
4125
|
+
Dialog2 as Dialog,
|
|
4126
|
+
DialogWithForm,
|
|
4127
|
+
Drawer,
|
|
4128
|
+
DrawerClose,
|
|
4129
|
+
DrawerContent,
|
|
4130
|
+
DrawerDescription,
|
|
4131
|
+
DrawerFooter,
|
|
4132
|
+
DrawerHeader,
|
|
4133
|
+
DrawerOverlay,
|
|
4134
|
+
DrawerPortal,
|
|
4135
|
+
DrawerTitle,
|
|
4136
|
+
DrawerTrigger,
|
|
4137
|
+
DropdownMenu,
|
|
4138
|
+
DropdownMenuCheckboxItem,
|
|
4139
|
+
DropdownMenuContent,
|
|
4140
|
+
DropdownMenuGroup,
|
|
4141
|
+
DropdownMenuItem,
|
|
4142
|
+
DropdownMenuLabel,
|
|
4143
|
+
DropdownMenuPortal,
|
|
4144
|
+
DropdownMenuRadioGroup,
|
|
4145
|
+
DropdownMenuRadioItem,
|
|
4146
|
+
DropdownMenuSeparator,
|
|
4147
|
+
DropdownMenuShortcut,
|
|
4148
|
+
DropdownMenuSub,
|
|
4149
|
+
DropdownMenuSubContent,
|
|
4150
|
+
DropdownMenuSubTrigger,
|
|
4151
|
+
DropdownMenuTrigger,
|
|
4152
|
+
DynamicTable,
|
|
4153
|
+
Form,
|
|
4154
|
+
FormControl,
|
|
4155
|
+
FormDescription,
|
|
4156
|
+
FormField,
|
|
4157
|
+
FormItem,
|
|
4158
|
+
FormLabel,
|
|
4159
|
+
FormMessage,
|
|
4160
|
+
Icon2 as Icon,
|
|
4161
|
+
Input2 as Input,
|
|
4162
|
+
MaskInput,
|
|
4163
|
+
MultiSelect,
|
|
4164
|
+
MultipleInput,
|
|
4165
|
+
MultipleMaskInput,
|
|
4166
|
+
NavUser,
|
|
4167
|
+
NumberInput,
|
|
4168
|
+
PageLayout,
|
|
4169
|
+
Select2 as Select,
|
|
4170
|
+
Separator3 as Separator,
|
|
4171
|
+
Sheet2 as Sheet,
|
|
4172
|
+
Sidebar2 as Sidebar,
|
|
4173
|
+
Spinner,
|
|
4174
|
+
Steps,
|
|
4175
|
+
Switch2 as Switch,
|
|
4176
|
+
Tabs2 as Tabs,
|
|
4177
|
+
Text,
|
|
4178
|
+
Toaster,
|
|
4179
|
+
badgeVariants,
|
|
4180
|
+
reducer,
|
|
4181
|
+
toast,
|
|
4182
|
+
useFormContext2 as useFormContext,
|
|
4183
|
+
useFormField,
|
|
4184
|
+
useToast
|
|
4185
|
+
};
|
|
4186
|
+
//# sourceMappingURL=index.mjs.map
|