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