@mlw-packages/react-components 1.3.10 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +10 -16
- package/dist/index.d.mts +16 -20
- package/dist/index.d.ts +16 -20
- package/dist/index.js +21 -19
- package/dist/index.mjs +21 -19
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -549,9 +549,6 @@ body {
|
|
|
549
549
|
.-mt-4 {
|
|
550
550
|
margin-top: -1rem;
|
|
551
551
|
}
|
|
552
|
-
.mb-1 {
|
|
553
|
-
margin-bottom: 0.25rem;
|
|
554
|
-
}
|
|
555
552
|
.mb-2 {
|
|
556
553
|
margin-bottom: 0.5rem;
|
|
557
554
|
}
|
|
@@ -585,6 +582,9 @@ body {
|
|
|
585
582
|
.mr-5 {
|
|
586
583
|
margin-right: 1.25rem;
|
|
587
584
|
}
|
|
585
|
+
.mt-0\.5 {
|
|
586
|
+
margin-top: 0.125rem;
|
|
587
|
+
}
|
|
588
588
|
.mt-1 {
|
|
589
589
|
margin-top: 0.25rem;
|
|
590
590
|
}
|
|
@@ -804,6 +804,9 @@ body {
|
|
|
804
804
|
.w-4 {
|
|
805
805
|
width: 1rem;
|
|
806
806
|
}
|
|
807
|
+
.w-40 {
|
|
808
|
+
width: 10rem;
|
|
809
|
+
}
|
|
807
810
|
.w-44 {
|
|
808
811
|
width: 11rem;
|
|
809
812
|
}
|
|
@@ -885,10 +888,6 @@ body {
|
|
|
885
888
|
.w-auto {
|
|
886
889
|
width: auto;
|
|
887
890
|
}
|
|
888
|
-
.w-fit {
|
|
889
|
-
width: -moz-fit-content;
|
|
890
|
-
width: fit-content;
|
|
891
|
-
}
|
|
892
891
|
.w-full {
|
|
893
892
|
width: 100%;
|
|
894
893
|
}
|
|
@@ -908,9 +907,6 @@ body {
|
|
|
908
907
|
.min-w-\[150px\] {
|
|
909
908
|
min-width: 150px;
|
|
910
909
|
}
|
|
911
|
-
.min-w-\[200px\] {
|
|
912
|
-
min-width: 200px;
|
|
913
|
-
}
|
|
914
910
|
.min-w-\[8rem\] {
|
|
915
911
|
min-width: 8rem;
|
|
916
912
|
}
|
|
@@ -1061,9 +1057,6 @@ body {
|
|
|
1061
1057
|
.flex-wrap {
|
|
1062
1058
|
flex-wrap: wrap;
|
|
1063
1059
|
}
|
|
1064
|
-
.place-items-end {
|
|
1065
|
-
place-items: end;
|
|
1066
|
-
}
|
|
1067
1060
|
.content-start {
|
|
1068
1061
|
align-content: flex-start;
|
|
1069
1062
|
}
|
|
@@ -1079,9 +1072,6 @@ body {
|
|
|
1079
1072
|
.justify-start {
|
|
1080
1073
|
justify-content: flex-start;
|
|
1081
1074
|
}
|
|
1082
|
-
.justify-end {
|
|
1083
|
-
justify-content: flex-end;
|
|
1084
|
-
}
|
|
1085
1075
|
.justify-center {
|
|
1086
1076
|
justify-content: center;
|
|
1087
1077
|
}
|
|
@@ -1406,6 +1396,10 @@ body {
|
|
|
1406
1396
|
.bg-primary\/20 {
|
|
1407
1397
|
background-color: hsl(var(--primary) / 0.2);
|
|
1408
1398
|
}
|
|
1399
|
+
.bg-red-500 {
|
|
1400
|
+
--tw-bg-opacity: 1;
|
|
1401
|
+
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
|
|
1402
|
+
}
|
|
1409
1403
|
.bg-secondary {
|
|
1410
1404
|
background-color: hsl(var(--secondary));
|
|
1411
1405
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ import * as React$1 from 'react';
|
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
5
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
6
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
6
7
|
import { VariantProps } from 'class-variance-authority';
|
|
7
8
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -45,12 +46,10 @@ declare const AvatarBase: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive
|
|
|
45
46
|
declare const AvatarImageBase: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
|
|
46
47
|
declare const AvatarFallbackBase: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
47
48
|
|
|
48
|
-
declare const buttonVariantsBase: (props?: (
|
|
49
|
-
variant
|
|
50
|
-
size
|
|
51
|
-
}
|
|
52
|
-
className?: string;
|
|
53
|
-
}) | undefined) => string;
|
|
49
|
+
declare const buttonVariantsBase: (props?: ({
|
|
50
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
51
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
52
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
54
53
|
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariantsBase> {
|
|
55
54
|
asChild?: boolean;
|
|
56
55
|
}
|
|
@@ -275,11 +274,9 @@ declare const SheetTriggerBase: React$1.ForwardRefExoticComponent<DialogPrimitiv
|
|
|
275
274
|
declare const SheetCloseBase: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
276
275
|
declare const SheetPortalBase: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
277
276
|
declare const SheetOverlayBase: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
278
|
-
declare const sheetVariants: (props?: (
|
|
279
|
-
side
|
|
280
|
-
}
|
|
281
|
-
className?: string;
|
|
282
|
-
}) | undefined) => string;
|
|
277
|
+
declare const sheetVariants: (props?: ({
|
|
278
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
279
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
283
280
|
interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
284
281
|
}
|
|
285
282
|
declare const SheetContentBase: React$1.ForwardRefExoticComponent<SheetContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -342,12 +339,10 @@ declare const SidebarMenuButtonBase: React$1.ForwardRefExoticComponent<Omit<Reac
|
|
|
342
339
|
asChild?: boolean;
|
|
343
340
|
isActive?: boolean;
|
|
344
341
|
tooltip?: string | React$1.ComponentProps<typeof TooltipContentBase>;
|
|
345
|
-
} &
|
|
346
|
-
variant
|
|
347
|
-
size
|
|
348
|
-
}> &
|
|
349
|
-
className?: string;
|
|
350
|
-
}, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
342
|
+
} & VariantProps<(props?: ({
|
|
343
|
+
variant?: "default" | "outline" | null | undefined;
|
|
344
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
345
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
351
346
|
declare const SidebarMenuActionBase: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLButtonElement> & React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
352
347
|
asChild?: boolean;
|
|
353
348
|
showOnHover?: boolean;
|
|
@@ -460,20 +455,21 @@ interface ComboboxProps<T extends string> {
|
|
|
460
455
|
items: ComboboxItem<T>[];
|
|
461
456
|
selected: ComboboxItem<T>["value"] | null;
|
|
462
457
|
onChange: (value: ComboboxItem<T>["value"] | null) => void;
|
|
458
|
+
className?: string;
|
|
463
459
|
placeholder?: string;
|
|
464
460
|
searchPlaceholder?: string;
|
|
465
461
|
label?: string;
|
|
466
462
|
labelClassname?: string;
|
|
467
463
|
}
|
|
468
|
-
declare function Combobox<T extends string>({ items, selected, onChange, placeholder, searchPlaceholder, label, labelClassname }: ComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
464
|
+
declare function Combobox<T extends string>({ items, selected, onChange, className, placeholder, searchPlaceholder, label, labelClassname }: ComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
469
465
|
|
|
470
466
|
interface MultiComboboxProps<T extends string> extends Omit<ComboboxProps<T>, "selected" | "onChange"> {
|
|
471
|
-
label?: string;
|
|
472
467
|
selected: T[];
|
|
473
468
|
onChange: (value: T[]) => void;
|
|
469
|
+
label?: string;
|
|
474
470
|
labelClassname?: string;
|
|
475
471
|
}
|
|
476
|
-
declare function MultiCombobox<T extends string>({ items, selected, onChange, placeholder, searchPlaceholder, label, labelClassname }: MultiComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
472
|
+
declare function MultiCombobox<T extends string>({ items, selected, onChange, className, placeholder, searchPlaceholder, label, labelClassname, }: MultiComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
477
473
|
|
|
478
474
|
interface SelectItem$1<T extends string> {
|
|
479
475
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as React$1 from 'react';
|
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
5
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
6
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
6
7
|
import { VariantProps } from 'class-variance-authority';
|
|
7
8
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -45,12 +46,10 @@ declare const AvatarBase: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive
|
|
|
45
46
|
declare const AvatarImageBase: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
|
|
46
47
|
declare const AvatarFallbackBase: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
47
48
|
|
|
48
|
-
declare const buttonVariantsBase: (props?: (
|
|
49
|
-
variant
|
|
50
|
-
size
|
|
51
|
-
}
|
|
52
|
-
className?: string;
|
|
53
|
-
}) | undefined) => string;
|
|
49
|
+
declare const buttonVariantsBase: (props?: ({
|
|
50
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
51
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
52
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
54
53
|
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariantsBase> {
|
|
55
54
|
asChild?: boolean;
|
|
56
55
|
}
|
|
@@ -275,11 +274,9 @@ declare const SheetTriggerBase: React$1.ForwardRefExoticComponent<DialogPrimitiv
|
|
|
275
274
|
declare const SheetCloseBase: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
276
275
|
declare const SheetPortalBase: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
277
276
|
declare const SheetOverlayBase: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
278
|
-
declare const sheetVariants: (props?: (
|
|
279
|
-
side
|
|
280
|
-
}
|
|
281
|
-
className?: string;
|
|
282
|
-
}) | undefined) => string;
|
|
277
|
+
declare const sheetVariants: (props?: ({
|
|
278
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
279
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
283
280
|
interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
284
281
|
}
|
|
285
282
|
declare const SheetContentBase: React$1.ForwardRefExoticComponent<SheetContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -342,12 +339,10 @@ declare const SidebarMenuButtonBase: React$1.ForwardRefExoticComponent<Omit<Reac
|
|
|
342
339
|
asChild?: boolean;
|
|
343
340
|
isActive?: boolean;
|
|
344
341
|
tooltip?: string | React$1.ComponentProps<typeof TooltipContentBase>;
|
|
345
|
-
} &
|
|
346
|
-
variant
|
|
347
|
-
size
|
|
348
|
-
}> &
|
|
349
|
-
className?: string;
|
|
350
|
-
}, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
342
|
+
} & VariantProps<(props?: ({
|
|
343
|
+
variant?: "default" | "outline" | null | undefined;
|
|
344
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
345
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
351
346
|
declare const SidebarMenuActionBase: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLButtonElement> & React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
352
347
|
asChild?: boolean;
|
|
353
348
|
showOnHover?: boolean;
|
|
@@ -460,20 +455,21 @@ interface ComboboxProps<T extends string> {
|
|
|
460
455
|
items: ComboboxItem<T>[];
|
|
461
456
|
selected: ComboboxItem<T>["value"] | null;
|
|
462
457
|
onChange: (value: ComboboxItem<T>["value"] | null) => void;
|
|
458
|
+
className?: string;
|
|
463
459
|
placeholder?: string;
|
|
464
460
|
searchPlaceholder?: string;
|
|
465
461
|
label?: string;
|
|
466
462
|
labelClassname?: string;
|
|
467
463
|
}
|
|
468
|
-
declare function Combobox<T extends string>({ items, selected, onChange, placeholder, searchPlaceholder, label, labelClassname }: ComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
464
|
+
declare function Combobox<T extends string>({ items, selected, onChange, className, placeholder, searchPlaceholder, label, labelClassname }: ComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
469
465
|
|
|
470
466
|
interface MultiComboboxProps<T extends string> extends Omit<ComboboxProps<T>, "selected" | "onChange"> {
|
|
471
|
-
label?: string;
|
|
472
467
|
selected: T[];
|
|
473
468
|
onChange: (value: T[]) => void;
|
|
469
|
+
label?: string;
|
|
474
470
|
labelClassname?: string;
|
|
475
471
|
}
|
|
476
|
-
declare function MultiCombobox<T extends string>({ items, selected, onChange, placeholder, searchPlaceholder, label, labelClassname }: MultiComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
472
|
+
declare function MultiCombobox<T extends string>({ items, selected, onChange, className, placeholder, searchPlaceholder, label, labelClassname, }: MultiComboboxProps<T>): react_jsx_runtime.JSX.Element;
|
|
477
473
|
|
|
478
474
|
interface SelectItem$1<T extends string> {
|
|
479
475
|
label: string;
|
package/dist/index.js
CHANGED
|
@@ -217,7 +217,7 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
|
|
|
217
217
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
218
218
|
disabled:pointer-events-none disabled:opacity-50
|
|
219
219
|
active:scale-[0.97]
|
|
220
|
-
[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
220
|
+
[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-transparent
|
|
221
221
|
`,
|
|
222
222
|
{
|
|
223
223
|
variants: {
|
|
@@ -230,9 +230,9 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
|
|
|
230
230
|
link: "text-primary underline-offset-4 hover:underline"
|
|
231
231
|
},
|
|
232
232
|
size: {
|
|
233
|
-
default: "
|
|
234
|
-
sm: "
|
|
235
|
-
lg: "
|
|
233
|
+
default: "px-4 py-1.5",
|
|
234
|
+
sm: "rounded-md px-3 text-xs",
|
|
235
|
+
lg: "rounded-md px-8",
|
|
236
236
|
icon: "h-9 w-9"
|
|
237
237
|
}
|
|
238
238
|
},
|
|
@@ -632,7 +632,7 @@ var InputBase = React6.forwardRef(
|
|
|
632
632
|
{
|
|
633
633
|
className: cn(
|
|
634
634
|
"flex items-center rounded-md transition focus-within:ring-1 focus-within:ring-ring focus-within:border-ring bg-white dark:bg-[hsl(231,15%,19%)] overflow-hidden",
|
|
635
|
-
type !== "
|
|
635
|
+
type !== "file" && "border"
|
|
636
636
|
),
|
|
637
637
|
children: [
|
|
638
638
|
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center justify-center px-2", children: leftIcon }),
|
|
@@ -641,7 +641,7 @@ var InputBase = React6.forwardRef(
|
|
|
641
641
|
{
|
|
642
642
|
type,
|
|
643
643
|
className: cn(
|
|
644
|
-
"w-full flex-1 text-sm
|
|
644
|
+
"w-full flex-1 text-sm py-1.5 px-3 focus:outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 bg-white dark:bg-[hsl(231,15%,19%)]",
|
|
645
645
|
className
|
|
646
646
|
),
|
|
647
647
|
ref,
|
|
@@ -1442,12 +1442,12 @@ function ComboboxBase({
|
|
|
1442
1442
|
role: "combobox",
|
|
1443
1443
|
"aria-expanded": open,
|
|
1444
1444
|
className: cn(
|
|
1445
|
-
"flex
|
|
1445
|
+
"flex items-start gap-2 justify-between h-full",
|
|
1446
1446
|
errorMessage && "border-red-500"
|
|
1447
1447
|
),
|
|
1448
1448
|
children: [
|
|
1449
|
-
|
|
1450
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react8.CaretDown, { size: 16, className: "mt-
|
|
1449
|
+
renderSelected,
|
|
1450
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react8.CaretDown, { size: 16, className: "mt-0.5" })
|
|
1451
1451
|
]
|
|
1452
1452
|
}
|
|
1453
1453
|
)
|
|
@@ -1498,16 +1498,16 @@ function Combobox({
|
|
|
1498
1498
|
items,
|
|
1499
1499
|
selected,
|
|
1500
1500
|
onChange,
|
|
1501
|
+
className,
|
|
1501
1502
|
placeholder,
|
|
1502
1503
|
searchPlaceholder,
|
|
1503
1504
|
label,
|
|
1504
1505
|
labelClassname
|
|
1505
1506
|
}) {
|
|
1506
1507
|
const selectedItem = items.find((item) => item.value === selected);
|
|
1507
|
-
const renderSelected = (0, import_react5.useMemo)(
|
|
1508
|
-
()
|
|
1509
|
-
|
|
1510
|
-
);
|
|
1508
|
+
const renderSelected = (0, import_react5.useMemo)(() => {
|
|
1509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: cn("truncate", !selectedItem && "text-gray-500"), children: selectedItem?.label ?? placeholder ?? "Selecione uma op\xE7\xE3o..." });
|
|
1510
|
+
}, [placeholder, selectedItem]);
|
|
1511
1511
|
const checkIsSelected = (0, import_react5.useCallback)(
|
|
1512
1512
|
(value) => selected == null ? false : selected == value,
|
|
1513
1513
|
[selected]
|
|
@@ -1518,7 +1518,7 @@ function Combobox({
|
|
|
1518
1518
|
},
|
|
1519
1519
|
[selected, onChange]
|
|
1520
1520
|
);
|
|
1521
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
|
|
1521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("flex flex-col gap-1 w-full min-w-[150px]", className), children: [
|
|
1522
1522
|
label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LabelBase_default, { className: labelClassname, children: label }),
|
|
1523
1523
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1524
1524
|
ComboboxBase,
|
|
@@ -1541,6 +1541,7 @@ function MultiCombobox({
|
|
|
1541
1541
|
items,
|
|
1542
1542
|
selected,
|
|
1543
1543
|
onChange,
|
|
1544
|
+
className,
|
|
1544
1545
|
placeholder,
|
|
1545
1546
|
searchPlaceholder,
|
|
1546
1547
|
label,
|
|
@@ -1563,8 +1564,9 @@ function MultiCombobox({
|
|
|
1563
1564
|
[selected, onChange]
|
|
1564
1565
|
);
|
|
1565
1566
|
const renderSelected = (0, import_react6.useMemo)(() => {
|
|
1566
|
-
if (selectedItems.length === 0)
|
|
1567
|
-
return placeholder ?? "Selecione uma op\xE7\xE3o...";
|
|
1567
|
+
if (selectedItems.length === 0) {
|
|
1568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-gray-500", children: placeholder ?? "Selecione uma op\xE7\xE3o..." });
|
|
1569
|
+
}
|
|
1568
1570
|
const items2 = selectedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1569
1571
|
"div",
|
|
1570
1572
|
{
|
|
@@ -1596,7 +1598,7 @@ function MultiCombobox({
|
|
|
1596
1598
|
));
|
|
1597
1599
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-wrap gap-2", children: items2 });
|
|
1598
1600
|
}, [handleSelection, placeholder, selectedItems]);
|
|
1599
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
|
|
1601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col gap-1 w-full min-w-[150px]", className), children: [
|
|
1600
1602
|
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(LabelBase_default, { className: labelClassname, children: label }),
|
|
1601
1603
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1602
1604
|
ComboboxBase,
|
|
@@ -3027,7 +3029,7 @@ SlideBase.displayName = "SlideBase";
|
|
|
3027
3029
|
var import_phosphor_react15 = require("phosphor-react");
|
|
3028
3030
|
var import_sonner = require("sonner");
|
|
3029
3031
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3030
|
-
var iconBaseClass = "w-
|
|
3032
|
+
var iconBaseClass = "w-5 h-auto";
|
|
3031
3033
|
var Toaster = ({ ...props }) => {
|
|
3032
3034
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3033
3035
|
import_sonner.Toaster,
|
|
@@ -3133,7 +3135,7 @@ var SwitchBase = React24.forwardRef(({ className, ...props }, ref) => {
|
|
|
3133
3135
|
...props,
|
|
3134
3136
|
ref,
|
|
3135
3137
|
className: cn(
|
|
3136
|
-
"peer relative inline-flex
|
|
3138
|
+
"peer relative inline-flex w-12 cursor-pointer items-center rounded-full border-2 border-transparent shadow-md transition-colors duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input data-[state=checked]:shadow-[0_0_15px_4px_var(--tw-shadow-color)] data-[state=checked]:shadow-primary/30",
|
|
3137
3139
|
className
|
|
3138
3140
|
),
|
|
3139
3141
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
package/dist/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ var buttonVariantsBase = cva(
|
|
|
24
24
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
25
25
|
disabled:pointer-events-none disabled:opacity-50
|
|
26
26
|
active:scale-[0.97]
|
|
27
|
-
[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
27
|
+
[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-transparent
|
|
28
28
|
`,
|
|
29
29
|
{
|
|
30
30
|
variants: {
|
|
@@ -37,9 +37,9 @@ var buttonVariantsBase = cva(
|
|
|
37
37
|
link: "text-primary underline-offset-4 hover:underline"
|
|
38
38
|
},
|
|
39
39
|
size: {
|
|
40
|
-
default: "
|
|
41
|
-
sm: "
|
|
42
|
-
lg: "
|
|
40
|
+
default: "px-4 py-1.5",
|
|
41
|
+
sm: "rounded-md px-3 text-xs",
|
|
42
|
+
lg: "rounded-md px-8",
|
|
43
43
|
icon: "h-9 w-9"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
@@ -439,7 +439,7 @@ var InputBase = React6.forwardRef(
|
|
|
439
439
|
{
|
|
440
440
|
className: cn(
|
|
441
441
|
"flex items-center rounded-md transition focus-within:ring-1 focus-within:ring-ring focus-within:border-ring bg-white dark:bg-[hsl(231,15%,19%)] overflow-hidden",
|
|
442
|
-
type !== "
|
|
442
|
+
type !== "file" && "border"
|
|
443
443
|
),
|
|
444
444
|
children: [
|
|
445
445
|
leftIcon && /* @__PURE__ */ jsx7("div", { className: "flex items-center justify-center px-2", children: leftIcon }),
|
|
@@ -448,7 +448,7 @@ var InputBase = React6.forwardRef(
|
|
|
448
448
|
{
|
|
449
449
|
type,
|
|
450
450
|
className: cn(
|
|
451
|
-
"w-full flex-1 text-sm
|
|
451
|
+
"w-full flex-1 text-sm py-1.5 px-3 focus:outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 bg-white dark:bg-[hsl(231,15%,19%)]",
|
|
452
452
|
className
|
|
453
453
|
),
|
|
454
454
|
ref,
|
|
@@ -1249,12 +1249,12 @@ function ComboboxBase({
|
|
|
1249
1249
|
role: "combobox",
|
|
1250
1250
|
"aria-expanded": open,
|
|
1251
1251
|
className: cn(
|
|
1252
|
-
"flex
|
|
1252
|
+
"flex items-start gap-2 justify-between h-full",
|
|
1253
1253
|
errorMessage && "border-red-500"
|
|
1254
1254
|
),
|
|
1255
1255
|
children: [
|
|
1256
|
-
|
|
1257
|
-
/* @__PURE__ */ jsx16(CaretDown, { size: 16, className: "mt-
|
|
1256
|
+
renderSelected,
|
|
1257
|
+
/* @__PURE__ */ jsx16(CaretDown, { size: 16, className: "mt-0.5" })
|
|
1258
1258
|
]
|
|
1259
1259
|
}
|
|
1260
1260
|
)
|
|
@@ -1305,16 +1305,16 @@ function Combobox({
|
|
|
1305
1305
|
items,
|
|
1306
1306
|
selected,
|
|
1307
1307
|
onChange,
|
|
1308
|
+
className,
|
|
1308
1309
|
placeholder,
|
|
1309
1310
|
searchPlaceholder,
|
|
1310
1311
|
label,
|
|
1311
1312
|
labelClassname
|
|
1312
1313
|
}) {
|
|
1313
1314
|
const selectedItem = items.find((item) => item.value === selected);
|
|
1314
|
-
const renderSelected = useMemo(
|
|
1315
|
-
()
|
|
1316
|
-
|
|
1317
|
-
);
|
|
1315
|
+
const renderSelected = useMemo(() => {
|
|
1316
|
+
return /* @__PURE__ */ jsx17("span", { className: cn("truncate", !selectedItem && "text-gray-500"), children: selectedItem?.label ?? placeholder ?? "Selecione uma op\xE7\xE3o..." });
|
|
1317
|
+
}, [placeholder, selectedItem]);
|
|
1318
1318
|
const checkIsSelected = useCallback(
|
|
1319
1319
|
(value) => selected == null ? false : selected == value,
|
|
1320
1320
|
[selected]
|
|
@@ -1325,7 +1325,7 @@ function Combobox({
|
|
|
1325
1325
|
},
|
|
1326
1326
|
[selected, onChange]
|
|
1327
1327
|
);
|
|
1328
|
-
return /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
|
|
1328
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("flex flex-col gap-1 w-full min-w-[150px]", className), children: [
|
|
1329
1329
|
label && /* @__PURE__ */ jsx17(LabelBase_default, { className: labelClassname, children: label }),
|
|
1330
1330
|
/* @__PURE__ */ jsx17(
|
|
1331
1331
|
ComboboxBase,
|
|
@@ -1348,6 +1348,7 @@ function MultiCombobox({
|
|
|
1348
1348
|
items,
|
|
1349
1349
|
selected,
|
|
1350
1350
|
onChange,
|
|
1351
|
+
className,
|
|
1351
1352
|
placeholder,
|
|
1352
1353
|
searchPlaceholder,
|
|
1353
1354
|
label,
|
|
@@ -1370,8 +1371,9 @@ function MultiCombobox({
|
|
|
1370
1371
|
[selected, onChange]
|
|
1371
1372
|
);
|
|
1372
1373
|
const renderSelected = useMemo2(() => {
|
|
1373
|
-
if (selectedItems.length === 0)
|
|
1374
|
-
return placeholder ?? "Selecione uma op\xE7\xE3o...";
|
|
1374
|
+
if (selectedItems.length === 0) {
|
|
1375
|
+
return /* @__PURE__ */ jsx18("span", { className: "text-gray-500", children: placeholder ?? "Selecione uma op\xE7\xE3o..." });
|
|
1376
|
+
}
|
|
1375
1377
|
const items2 = selectedItems.map((item) => /* @__PURE__ */ jsxs11(
|
|
1376
1378
|
"div",
|
|
1377
1379
|
{
|
|
@@ -1403,7 +1405,7 @@ function MultiCombobox({
|
|
|
1403
1405
|
));
|
|
1404
1406
|
return /* @__PURE__ */ jsx18("div", { className: "flex flex-wrap gap-2", children: items2 });
|
|
1405
1407
|
}, [handleSelection, placeholder, selectedItems]);
|
|
1406
|
-
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
|
|
1408
|
+
return /* @__PURE__ */ jsxs11("div", { className: cn("flex flex-col gap-1 w-full min-w-[150px]", className), children: [
|
|
1407
1409
|
label && /* @__PURE__ */ jsx18(LabelBase_default, { className: labelClassname, children: label }),
|
|
1408
1410
|
/* @__PURE__ */ jsx18(
|
|
1409
1411
|
ComboboxBase,
|
|
@@ -2838,7 +2840,7 @@ SlideBase.displayName = "SlideBase";
|
|
|
2838
2840
|
import { CheckCircle, XCircle, Info, Warning, Spinner } from "phosphor-react";
|
|
2839
2841
|
import { Toaster as Sonner, toast as sonnertoast } from "sonner";
|
|
2840
2842
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2841
|
-
var iconBaseClass = "w-
|
|
2843
|
+
var iconBaseClass = "w-5 h-auto";
|
|
2842
2844
|
var Toaster = ({ ...props }) => {
|
|
2843
2845
|
return /* @__PURE__ */ jsx33(
|
|
2844
2846
|
Sonner,
|
|
@@ -2944,7 +2946,7 @@ var SwitchBase = React24.forwardRef(({ className, ...props }, ref) => {
|
|
|
2944
2946
|
...props,
|
|
2945
2947
|
ref,
|
|
2946
2948
|
className: cn(
|
|
2947
|
-
"peer relative inline-flex
|
|
2949
|
+
"peer relative inline-flex w-12 cursor-pointer items-center rounded-full border-2 border-transparent shadow-md transition-colors duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input data-[state=checked]:shadow-[0_0_15px_4px_var(--tw-shadow-color)] data-[state=checked]:shadow-primary/30",
|
|
2948
2950
|
className
|
|
2949
2951
|
),
|
|
2950
2952
|
children: /* @__PURE__ */ jsx34(
|