@greatapps/common 1.1.0 → 1.1.2
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/components/handlers/SearchParamsHandler.mjs +2 -1
- package/dist/components/handlers/SearchParamsHandler.mjs.map +1 -1
- package/dist/components/layouts/MainLayout.mjs +14 -14
- package/dist/components/layouts/MainLayout.mjs.map +1 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs +22 -19
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs +44 -25
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NavBarItem.mjs +23 -0
- package/dist/components/layouts/NavBarItem.mjs.map +1 -0
- package/dist/components/layouts/NotificationItem.mjs +8 -1
- package/dist/components/layouts/NotificationItem.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +141 -0
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -0
- package/dist/components/layouts/SideBarNavigation.mjs +5 -5
- package/dist/components/layouts/SideBarNavigation.mjs.map +1 -1
- package/dist/components/ui/buttons/Button.mjs +2 -2
- package/dist/components/ui/buttons/Button.mjs.map +1 -1
- package/dist/components/ui/buttons/CancelButton.mjs +2 -2
- package/dist/components/ui/buttons/CancelButton.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +15 -11
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/Accordion.mjs +18 -15
- package/dist/components/ui/data-display/Accordion.mjs.map +1 -1
- package/dist/components/ui/data-display/Badge.mjs +2 -2
- package/dist/components/ui/data-display/Badge.mjs.map +1 -1
- package/dist/components/ui/data-display/Card.mjs +8 -8
- package/dist/components/ui/data-display/Card.mjs.map +1 -1
- package/dist/components/ui/data-display/Pagination.mjs +20 -18
- package/dist/components/ui/data-display/Pagination.mjs.map +1 -1
- package/dist/components/ui/data-display/ScrollArea.mjs +26 -24
- package/dist/components/ui/data-display/ScrollArea.mjs.map +1 -1
- package/dist/components/ui/data-display/Separator.mjs +2 -2
- package/dist/components/ui/data-display/Separator.mjs.map +1 -1
- package/dist/components/ui/data-display/Table.mjs +19 -19
- package/dist/components/ui/data-display/Table.mjs.map +1 -1
- package/dist/components/ui/data-display/Tabs.mjs +5 -5
- package/dist/components/ui/data-display/Tabs.mjs.map +1 -1
- package/dist/components/ui/data-display/UserAvatar.mjs +49 -0
- package/dist/components/ui/data-display/UserAvatar.mjs.map +1 -0
- package/dist/components/ui/feedback/CircularProgress.mjs +40 -30
- package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +20 -19
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/Progress.mjs +15 -15
- package/dist/components/ui/feedback/Progress.mjs.map +1 -1
- package/dist/components/ui/feedback/Toast.mjs +14 -10
- package/dist/components/ui/feedback/Toast.mjs.map +1 -1
- package/dist/components/ui/form/Calendar.mjs +8 -7
- package/dist/components/ui/form/Calendar.mjs.map +1 -1
- package/dist/components/ui/form/Checkbox.mjs +12 -12
- package/dist/components/ui/form/Checkbox.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs +37 -33
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +38 -32
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/Input.mjs +2 -2
- package/dist/components/ui/form/Input.mjs.map +1 -1
- package/dist/components/ui/form/InputOtp.mjs +11 -8
- package/dist/components/ui/form/InputOtp.mjs.map +1 -1
- package/dist/components/ui/form/RadioGroup.mjs +6 -5
- package/dist/components/ui/form/RadioGroup.mjs.map +1 -1
- package/dist/components/ui/form/Select.mjs +51 -45
- package/dist/components/ui/form/Select.mjs.map +1 -1
- package/dist/components/ui/form/Switch.mjs +13 -13
- package/dist/components/ui/form/Switch.mjs.map +1 -1
- package/dist/components/ui/form/Textarea.mjs +2 -2
- package/dist/components/ui/form/Textarea.mjs.map +1 -1
- package/dist/components/ui/overlay/Command.mjs +39 -31
- package/dist/components/ui/overlay/Command.mjs.map +1 -1
- package/dist/components/ui/overlay/Dialog.mjs +37 -30
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Popover.mjs +6 -6
- package/dist/components/ui/overlay/Popover.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +40 -33
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/Tooltip.mjs +12 -10
- package/dist/components/ui/overlay/Tooltip.mjs.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/dist/providers/auth.provider.mjs +2 -1
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/providers/query.provider.mjs +5 -1
- package/dist/providers/query.provider.mjs.map +1 -1
- package/dist/providers/whitelabel.provider.mjs +5 -4
- package/dist/providers/whitelabel.provider.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/layouts/NavBarItem.tsx +29 -0
- package/src/components/layouts/ProfilePopover.tsx +171 -0
- package/src/components/ui/data-display/UserAvatar.tsx +67 -0
- package/src/index.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4.5 shrink-0 rounded-[4px] border-[1.6px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 hover:border-gray-950 cursor-pointer\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3 text-current\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4.5 shrink-0 rounded-[4px] border-[1.6px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 hover:border-gray-950 cursor-pointer\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3 text-current\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":";AAwBQ;AArBR,YAAY,uBAAuB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,8BAAC,aAAU,WAAU,uBAAsB;AAAA;AAAA,MAC7C;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useState, forwardRef, useEffect } from "react";
|
|
3
4
|
import { format } from "date-fns";
|
|
4
5
|
import { Calendar } from "./Calendar";
|
|
@@ -31,44 +32,47 @@ const DatePicker = forwardRef(
|
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
const displayText = date ? format(date, "dd/MM/yyyy") : placeholder;
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ref,
|
|
38
|
-
disabled,
|
|
39
|
-
className: cn(
|
|
40
|
-
"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start",
|
|
41
|
-
"border-gray-200 hover:border-gray-400 focus-within:border-gray-950",
|
|
42
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
43
|
-
className
|
|
44
|
-
)
|
|
45
|
-
},
|
|
46
|
-
/* @__PURE__ */ React.createElement(
|
|
47
|
-
"span",
|
|
35
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
36
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
37
|
+
"button",
|
|
48
38
|
{
|
|
39
|
+
ref,
|
|
40
|
+
disabled,
|
|
49
41
|
className: cn(
|
|
50
|
-
"
|
|
51
|
-
|
|
42
|
+
"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start",
|
|
43
|
+
"border-gray-200 hover:border-gray-400 focus-within:border-gray-950",
|
|
44
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
children: /* @__PURE__ */ jsx(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
className: cn(
|
|
51
|
+
"paragraph-small-medium",
|
|
52
|
+
date ? "text-gray-950" : "text-gray-500"
|
|
53
|
+
),
|
|
54
|
+
children: displayText
|
|
55
|
+
}
|
|
52
56
|
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
PopoverContent,
|
|
58
|
-
{
|
|
59
|
-
className: "w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200",
|
|
60
|
-
align: "start",
|
|
61
|
-
sideOffset: 8
|
|
62
|
-
},
|
|
63
|
-
/* @__PURE__ */ React.createElement("div", { className: "p-3" }, /* @__PURE__ */ React.createElement(
|
|
64
|
-
Calendar,
|
|
57
|
+
}
|
|
58
|
+
) }),
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
PopoverContent,
|
|
65
61
|
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
className: "w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200",
|
|
63
|
+
align: "start",
|
|
64
|
+
sideOffset: 8,
|
|
65
|
+
children: /* @__PURE__ */ jsx("div", { className: "p-3", children: /* @__PURE__ */ jsx(
|
|
66
|
+
Calendar,
|
|
67
|
+
{
|
|
68
|
+
mode: "single",
|
|
69
|
+
selected: date,
|
|
70
|
+
onSelect: handleDateSelect
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
69
73
|
}
|
|
70
|
-
)
|
|
71
|
-
)
|
|
74
|
+
)
|
|
75
|
+
] });
|
|
72
76
|
}
|
|
73
77
|
);
|
|
74
78
|
DatePicker.displayName = "DatePicker";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/DatePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, forwardRef, useEffect } from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar } from \"./Calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlay/Popover\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\n// Converte string ISO (yyyy-MM-dd) para Date no fuso horário local\n// Evita bug de timezone onde new Date(\"2025-08-02\") interpreta como UTC\nconst isoParaDataLocal = (iso: string): Date => {\n const [ano, mes, dia] = iso.split(\"-\").map(Number);\n return new Date(ano, mes - 1, dia);\n};\n\ninterface DatePickerProps {\n value?: string;\n onChange?: (date: string | undefined) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n}\n\nexport const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n { value, onChange, placeholder = \"Selecione a data\", className, disabled },\n ref,\n ) => {\n const [open, setOpen] = useState(false);\n const [date, setDate] = useState<Date | undefined>(() => {\n return value ? isoParaDataLocal(value) : undefined;\n });\n\n // Sincroniza estado interno quando value mudar externamente\n useEffect(() => {\n if (value) {\n setDate(isoParaDataLocal(value));\n } else {\n setDate(undefined);\n }\n }, [value]);\n\n const handleDateSelect = (selectedDate: Date | undefined) => {\n setDate(selectedDate);\n\n if (selectedDate) {\n onChange?.(format(selectedDate, \"yyyy-MM-dd\"));\n setOpen(false); // Fecha o popover após seleção\n } else {\n onChange?.(undefined);\n }\n };\n\n const displayText = date ? format(date, \"dd/MM/yyyy\") : placeholder;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start\",\n \"border-gray-200 hover:border-gray-400 focus-within:border-gray-950\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className,\n )}\n >\n <span\n className={cn(\n \"paragraph-small-medium\",\n date ? \"text-gray-950\" : \"text-gray-500\",\n )}\n >\n {displayText}\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200\"\n align=\"start\"\n sideOffset={8}\n >\n <div className=\"p-3\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={handleDateSelect}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/DatePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, forwardRef, useEffect } from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar } from \"./Calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlay/Popover\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\n// Converte string ISO (yyyy-MM-dd) para Date no fuso horário local\n// Evita bug de timezone onde new Date(\"2025-08-02\") interpreta como UTC\nconst isoParaDataLocal = (iso: string): Date => {\n const [ano, mes, dia] = iso.split(\"-\").map(Number);\n return new Date(ano, mes - 1, dia);\n};\n\ninterface DatePickerProps {\n value?: string;\n onChange?: (date: string | undefined) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n}\n\nexport const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n { value, onChange, placeholder = \"Selecione a data\", className, disabled },\n ref,\n ) => {\n const [open, setOpen] = useState(false);\n const [date, setDate] = useState<Date | undefined>(() => {\n return value ? isoParaDataLocal(value) : undefined;\n });\n\n // Sincroniza estado interno quando value mudar externamente\n useEffect(() => {\n if (value) {\n setDate(isoParaDataLocal(value));\n } else {\n setDate(undefined);\n }\n }, [value]);\n\n const handleDateSelect = (selectedDate: Date | undefined) => {\n setDate(selectedDate);\n\n if (selectedDate) {\n onChange?.(format(selectedDate, \"yyyy-MM-dd\"));\n setOpen(false); // Fecha o popover após seleção\n } else {\n onChange?.(undefined);\n }\n };\n\n const displayText = date ? format(date, \"dd/MM/yyyy\") : placeholder;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start\",\n \"border-gray-200 hover:border-gray-400 focus-within:border-gray-950\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className,\n )}\n >\n <span\n className={cn(\n \"paragraph-small-medium\",\n date ? \"text-gray-950\" : \"text-gray-500\",\n )}\n >\n {displayText}\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200\"\n align=\"start\"\n sideOffset={8}\n >\n <div className=\"p-3\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={handleDateSelect}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";AAwDM,SAYM,KAZN;AAtDN,SAAS,UAAU,YAAY,iBAAiB;AAChD,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AAInB,MAAM,mBAAmB,CAAC,QAAsB;AAC9C,QAAM,CAAC,KAAK,KAAK,GAAG,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,SAAO,IAAI,KAAK,KAAK,MAAM,GAAG,GAAG;AACnC;AAUO,MAAM,aAAa;AAAA,EACxB,CACE,EAAE,OAAO,UAAU,cAAc,oBAAoB,WAAW,SAAS,GACzE,QACG;AACH,UAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,UAAM,CAAC,MAAM,OAAO,IAAI,SAA2B,MAAM;AACvD,aAAO,QAAQ,iBAAiB,KAAK,IAAI;AAAA,IAC3C,CAAC;AAGD,cAAU,MAAM;AACd,UAAI,OAAO;AACT,gBAAQ,iBAAiB,KAAK,CAAC;AAAA,MACjC,OAAO;AACL,gBAAQ,MAAS;AAAA,MACnB;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,UAAM,mBAAmB,CAAC,iBAAmC;AAC3D,cAAQ,YAAY;AAEpB,UAAI,cAAc;AAChB,mBAAW,OAAO,cAAc,YAAY,CAAC;AAC7C,gBAAQ,KAAK;AAAA,MACf,OAAO;AACL,mBAAW,MAAS;AAAA,MACtB;AAAA,IACF;AAEA,UAAM,cAAc,OAAO,OAAO,MAAM,YAAY,IAAI;AAExD,WACE,qBAAC,WAAQ,MAAY,cAAc,SACjC;AAAA,0BAAC,kBAAe,SAAO,MACrB;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,OAAO,kBAAkB;AAAA,cAC3B;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA,MACF,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAM;AAAA,UACN,YAAY;AAAA,UAEZ,8BAAC,SAAI,WAAU,OACb;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA;AAAA,UACZ,GACF;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useState, forwardRef, useEffect } from "react";
|
|
3
4
|
import { format } from "date-fns";
|
|
4
5
|
import { Calendar as CalendarIcon } from "lucide-react";
|
|
@@ -43,40 +44,45 @@ const DateRangePicker = forwardRef(
|
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
const displayText = range?.from && range?.to ? `${format(range.from, "dd/MM/yyyy")} - ${format(range.to, "dd/MM/yyyy")}` : placeholder;
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
ref,
|
|
50
|
-
disabled,
|
|
51
|
-
className: cn(
|
|
52
|
-
"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start",
|
|
53
|
-
"border-gray-200 hover:border-gray-400 focus-within:border-gray-950",
|
|
54
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
55
|
-
className
|
|
56
|
-
)
|
|
57
|
-
},
|
|
58
|
-
/* @__PURE__ */ React.createElement(CalendarIcon, { size: 20, className: "text-gray-400" }),
|
|
59
|
-
/* @__PURE__ */ React.createElement("span", { className: cn(
|
|
60
|
-
"paragraph-small-medium",
|
|
61
|
-
range?.from && range?.to ? "text-gray-950" : "text-gray-500"
|
|
62
|
-
) }, displayText)
|
|
63
|
-
)), /* @__PURE__ */ React.createElement(
|
|
64
|
-
PopoverContent,
|
|
65
|
-
{
|
|
66
|
-
className: "w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200",
|
|
67
|
-
align: "start",
|
|
68
|
-
sideOffset: 8
|
|
69
|
-
},
|
|
70
|
-
/* @__PURE__ */ React.createElement("div", { className: "p-3" }, /* @__PURE__ */ React.createElement(
|
|
71
|
-
Calendar,
|
|
47
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
49
|
+
"button",
|
|
72
50
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
51
|
+
ref,
|
|
52
|
+
disabled,
|
|
53
|
+
className: cn(
|
|
54
|
+
"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start",
|
|
55
|
+
"border-gray-200 hover:border-gray-400 focus-within:border-gray-950",
|
|
56
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
57
|
+
className
|
|
58
|
+
),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsx(CalendarIcon, { size: 20, className: "text-gray-400" }),
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
62
|
+
"paragraph-small-medium",
|
|
63
|
+
range?.from && range?.to ? "text-gray-950" : "text-gray-500"
|
|
64
|
+
), children: displayText })
|
|
65
|
+
]
|
|
77
66
|
}
|
|
78
|
-
))
|
|
79
|
-
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
PopoverContent,
|
|
70
|
+
{
|
|
71
|
+
className: "w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200",
|
|
72
|
+
align: "start",
|
|
73
|
+
sideOffset: 8,
|
|
74
|
+
children: /* @__PURE__ */ jsx("div", { className: "p-3", children: /* @__PURE__ */ jsx(
|
|
75
|
+
Calendar,
|
|
76
|
+
{
|
|
77
|
+
mode: "range",
|
|
78
|
+
selected: range,
|
|
79
|
+
onSelect: handleRangeSelect,
|
|
80
|
+
numberOfMonths: 1
|
|
81
|
+
}
|
|
82
|
+
) })
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
80
86
|
}
|
|
81
87
|
);
|
|
82
88
|
DateRangePicker.displayName = "DateRangePicker";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/DateRangePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, forwardRef, useEffect } from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { DateRange } from \"react-day-picker\";\nimport { Calendar } from \"./Calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlay/Popover\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\n// Converte string ISO (yyyy-MM-dd) para Date no fuso horário local\n// Evita bug de timezone onde new Date(\"2025-08-02\") interpreta como UTC\nconst isoParaDataLocal = (iso: string): Date => {\n const [ano, mes, dia] = iso.split(\"-\").map(Number);\n return new Date(ano, mes - 1, dia);\n};\n\ninterface DateRangePickerProps {\n value?: { from: string; to: string };\n onChange?: (range: { from: string; to: string } | undefined) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n}\n\nexport const DateRangePicker = forwardRef<HTMLButtonElement, DateRangePickerProps>(\n ({ value, onChange, placeholder = \"Selecione o período\", className, disabled }, ref) => {\n const [open, setOpen] = useState(false);\n const [range, setRange] = useState<DateRange | undefined>(() => {\n if (value?.from && value?.to) {\n return {\n from: isoParaDataLocal(value.from),\n to: isoParaDataLocal(value.to)\n };\n }\n return undefined;\n });\n\n useEffect(() => {\n if (value?.from && value?.to) {\n setRange({\n from: isoParaDataLocal(value.from),\n to: isoParaDataLocal(value.to)\n });\n } else {\n setRange(undefined);\n }\n }, [value]);\n\n const handleRangeSelect = (newRange: DateRange | undefined) => {\n setRange(newRange);\n\n if (newRange?.from && newRange?.to) {\n onChange?.({\n from: format(newRange.from, \"yyyy-MM-dd\"),\n to: format(newRange.to, \"yyyy-MM-dd\")\n });\n } else {\n onChange?.(undefined);\n }\n };\n\n const displayText = range?.from && range?.to\n ? `${format(range.from, \"dd/MM/yyyy\")} - ${format(range.to, \"dd/MM/yyyy\")}`\n : placeholder;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start\",\n \"border-gray-200 hover:border-gray-400 focus-within:border-gray-950\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className\n )}\n >\n <CalendarIcon size={20} className=\"text-gray-400\" />\n <span className={cn(\n \"paragraph-small-medium\",\n range?.from && range?.to ? \"text-gray-950\" : \"text-gray-500\"\n )}>\n {displayText}\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200\"\n align=\"start\"\n sideOffset={8}\n >\n <div className=\"p-3\">\n <Calendar\n mode=\"range\"\n selected={range}\n onSelect={handleRangeSelect}\n numberOfMonths={1}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/DateRangePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, forwardRef, useEffect } from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { DateRange } from \"react-day-picker\";\nimport { Calendar } from \"./Calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlay/Popover\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\n// Converte string ISO (yyyy-MM-dd) para Date no fuso horário local\n// Evita bug de timezone onde new Date(\"2025-08-02\") interpreta como UTC\nconst isoParaDataLocal = (iso: string): Date => {\n const [ano, mes, dia] = iso.split(\"-\").map(Number);\n return new Date(ano, mes - 1, dia);\n};\n\ninterface DateRangePickerProps {\n value?: { from: string; to: string };\n onChange?: (range: { from: string; to: string } | undefined) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n}\n\nexport const DateRangePicker = forwardRef<HTMLButtonElement, DateRangePickerProps>(\n ({ value, onChange, placeholder = \"Selecione o período\", className, disabled }, ref) => {\n const [open, setOpen] = useState(false);\n const [range, setRange] = useState<DateRange | undefined>(() => {\n if (value?.from && value?.to) {\n return {\n from: isoParaDataLocal(value.from),\n to: isoParaDataLocal(value.to)\n };\n }\n return undefined;\n });\n\n useEffect(() => {\n if (value?.from && value?.to) {\n setRange({\n from: isoParaDataLocal(value.from),\n to: isoParaDataLocal(value.to)\n });\n } else {\n setRange(undefined);\n }\n }, [value]);\n\n const handleRangeSelect = (newRange: DateRange | undefined) => {\n setRange(newRange);\n\n if (newRange?.from && newRange?.to) {\n onChange?.({\n from: format(newRange.from, \"yyyy-MM-dd\"),\n to: format(newRange.to, \"yyyy-MM-dd\")\n });\n } else {\n onChange?.(undefined);\n }\n };\n\n const displayText = range?.from && range?.to\n ? `${format(range.from, \"dd/MM/yyyy\")} - ${format(range.to, \"dd/MM/yyyy\")}`\n : placeholder;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start\",\n \"border-gray-200 hover:border-gray-400 focus-within:border-gray-950\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className\n )}\n >\n <CalendarIcon size={20} className=\"text-gray-400\" />\n <span className={cn(\n \"paragraph-small-medium\",\n range?.from && range?.to ? \"text-gray-950\" : \"text-gray-500\"\n )}>\n {displayText}\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200\"\n align=\"start\"\n sideOffset={8}\n >\n <div className=\"p-3\">\n <Calendar\n mode=\"range\"\n selected={range}\n onSelect={handleRangeSelect}\n numberOfMonths={1}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"mappings":";AAqEU,SAUE,KAVF;AAnEV,SAAS,UAAU,YAAY,iBAAiB;AAChD,SAAS,cAAc;AACvB,SAAS,YAAY,oBAAoB;AAEzC,SAAS,gBAAgB;AACzB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AAInB,MAAM,mBAAmB,CAAC,QAAsB;AAC9C,QAAM,CAAC,KAAK,KAAK,GAAG,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,SAAO,IAAI,KAAK,KAAK,MAAM,GAAG,GAAG;AACnC;AAUO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,EAAE,OAAO,UAAU,cAAc,0BAAuB,WAAW,SAAS,GAAG,QAAQ;AACtF,UAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,UAAM,CAAC,OAAO,QAAQ,IAAI,SAAgC,MAAM;AAC9D,UAAI,OAAO,QAAQ,OAAO,IAAI;AAC5B,eAAO;AAAA,UACL,MAAM,iBAAiB,MAAM,IAAI;AAAA,UACjC,IAAI,iBAAiB,MAAM,EAAE;AAAA,QAC/B;AAAA,MACF;AACA,aAAO;AAAA,IACT,CAAC;AAED,cAAU,MAAM;AACd,UAAI,OAAO,QAAQ,OAAO,IAAI;AAC5B,iBAAS;AAAA,UACP,MAAM,iBAAiB,MAAM,IAAI;AAAA,UACjC,IAAI,iBAAiB,MAAM,EAAE;AAAA,QAC/B,CAAC;AAAA,MACH,OAAO;AACL,iBAAS,MAAS;AAAA,MACpB;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,UAAM,oBAAoB,CAAC,aAAoC;AAC7D,eAAS,QAAQ;AAEjB,UAAI,UAAU,QAAQ,UAAU,IAAI;AAClC,mBAAW;AAAA,UACT,MAAM,OAAO,SAAS,MAAM,YAAY;AAAA,UACxC,IAAI,OAAO,SAAS,IAAI,YAAY;AAAA,QACtC,CAAC;AAAA,MACH,OAAO;AACL,mBAAW,MAAS;AAAA,MACtB;AAAA,IACF;AAEA,UAAM,cAAc,OAAO,QAAQ,OAAO,KACtC,GAAG,OAAO,MAAM,MAAM,YAAY,CAAC,MAAM,OAAO,MAAM,IAAI,YAAY,CAAC,KACvE;AAEJ,WACE,qBAAC,WAAQ,MAAY,cAAc,SACjC;AAAA,0BAAC,kBAAe,SAAO,MACrB;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,gCAAC,gBAAa,MAAM,IAAI,WAAU,iBAAgB;AAAA,YAClD,oBAAC,UAAK,WAAW;AAAA,cACf;AAAA,cACA,OAAO,QAAQ,OAAO,KAAK,kBAAkB;AAAA,YAC/C,GACG,uBACH;AAAA;AAAA;AAAA,MACF,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAM;AAAA,UACN,YAAY;AAAA,UAEZ,8BAAC,SAAI,WAAU,OACb;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA,cACV,gBAAgB;AAAA;AAAA,UAClB,GACF;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,gBAAgB,cAAc;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../../infra/utils/clsx";
|
|
3
3
|
function Input({ className, type, ...props }) {
|
|
4
|
-
return /* @__PURE__ */
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
5
|
"input",
|
|
6
6
|
{
|
|
7
7
|
type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Input.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"outline-none\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/Input.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"outline-none\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n"],"mappings":"AAKI;AAJJ,SAAS,UAAU;AAEnB,SAAS,MAAM,EAAE,WAAW,MAAM,GAAG,MAAM,GAAkC;AAC3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
4
5
|
import { MinusIcon } from "lucide-react";
|
|
@@ -8,7 +9,7 @@ function InputOTP({
|
|
|
8
9
|
containerClassName,
|
|
9
10
|
...props
|
|
10
11
|
}) {
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
12
13
|
OTPInput,
|
|
13
14
|
{
|
|
14
15
|
"data-slot": "input-otp",
|
|
@@ -22,7 +23,7 @@ function InputOTP({
|
|
|
22
23
|
);
|
|
23
24
|
}
|
|
24
25
|
function InputOTPGroup({ className, ...props }) {
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
26
27
|
"div",
|
|
27
28
|
{
|
|
28
29
|
"data-slot": "input-otp-group",
|
|
@@ -38,7 +39,7 @@ function InputOTPSlot({
|
|
|
38
39
|
}) {
|
|
39
40
|
const inputOTPContext = React.useContext(OTPInputContext);
|
|
40
41
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
42
43
|
"div",
|
|
43
44
|
{
|
|
44
45
|
"data-slot": "input-otp-slot",
|
|
@@ -49,14 +50,16 @@ function InputOTPSlot({
|
|
|
49
50
|
"data-[active=true]:z-10",
|
|
50
51
|
className
|
|
51
52
|
),
|
|
52
|
-
...props
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
char,
|
|
56
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
56
59
|
);
|
|
57
60
|
}
|
|
58
61
|
function InputOTPSeparator({ ...props }) {
|
|
59
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx(MinusIcon, {}) });
|
|
60
63
|
}
|
|
61
64
|
export {
|
|
62
65
|
InputOTP,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/InputOtp.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { MinusIcon } from \"lucide-react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction InputOTP({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string\n}) {\n return (\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n index: number\n}) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"relative flex h-9 w-9 items-center justify-center border text-sm transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md\",\n \"border-gray-200 hover:border-gray-400 data-[active=true]:border-gray-950\",\n \"data-[active=true]:z-10\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n )\n}\n\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n )\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/InputOtp.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { MinusIcon } from \"lucide-react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction InputOTP({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string\n}) {\n return (\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n index: number\n}) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"relative flex h-9 w-9 items-center justify-center border text-sm transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md\",\n \"border-gray-200 hover:border-gray-400 data-[active=true]:border-gray-950\",\n \"data-[active=true]:z-10\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n )\n}\n\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n )\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }\n"],"mappings":";AAeI,cAiCA,YAjCA;AAbJ,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,oBAAoB;AAAA,QAClB;AAAA,QACA;AAAA,MACF;AAAA,MACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,MACrD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,qBAAqB,SAAS;AAAA,MAC3C,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,kBAAkB,MAAM,WAAW,eAAe;AACxD,QAAM,EAAE,MAAM,cAAc,SAAS,IAAI,iBAAiB,MAAM,KAAK,KAAK,CAAC;AAE3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,eAAa;AAAA,MACb,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,gBACC,oBAAC,SAAI,WAAU,yEACb,8BAAC,SAAI,WAAU,4DAA2D,GAC5E;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAAgC;AACpE,SACE,oBAAC,SAAI,aAAU,uBAAsB,MAAK,aAAa,GAAG,OACxD,8BAAC,aAAU,GACb;AAEJ;","names":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
5
|
import { Circle } from "lucide-react";
|
|
5
6
|
import { cn } from "../../../infra/utils/clsx";
|
|
6
7
|
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
8
9
|
RadioGroupPrimitive.Root,
|
|
9
10
|
{
|
|
10
11
|
className: cn("grid gap-2", className),
|
|
@@ -15,7 +16,7 @@ const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
15
16
|
});
|
|
16
17
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
17
18
|
const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
19
20
|
RadioGroupPrimitive.Item,
|
|
20
21
|
{
|
|
21
22
|
ref,
|
|
@@ -23,9 +24,9 @@ const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
23
24
|
"aspect-square h-4 w-4 rounded-full border border-gray-300 text-gray-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
24
25
|
className
|
|
25
26
|
),
|
|
26
|
-
...props
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
...props,
|
|
28
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
29
|
+
}
|
|
29
30
|
);
|
|
30
31
|
});
|
|
31
32
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/RadioGroup.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\"\nimport { Circle } from \"lucide-react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root\n className={cn(\"grid gap-2\", className)}\n {...props}\n ref={ref}\n />\n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-gray-300 text-gray-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/RadioGroup.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\"\nimport { Circle } from \"lucide-react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root\n className={cn(\"grid gap-2\", className)}\n {...props}\n ref={ref}\n />\n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-gray-300 text-gray-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":";AAYI;AAVJ,YAAY,WAAW;AACvB,YAAY,yBAAyB;AACrC,SAAS,cAAc;AACvB,SAAS,UAAU;AAEnB,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC,WAAW,GAAG,cAAc,SAAS;AAAA,MACpC,GAAG;AAAA,MACJ;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,WAAW,cAAc,oBAAoB,KAAK;AAElD,MAAM,iBAAiB,MAAM,WAG3B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,oBAAoB,WAApB,EAA8B,WAAU,oCACvC,8BAAC,UAAO,WAAU,yCAAwC,GAC5D;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,eAAe,cAAc,oBAAoB,KAAK;","names":[]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
4
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
5
|
import { cn } from "../../../infra/utils/clsx";
|
|
6
6
|
function Select({
|
|
7
7
|
...props
|
|
8
8
|
}) {
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
10
10
|
}
|
|
11
11
|
function SelectGroup({
|
|
12
12
|
...props
|
|
13
13
|
}) {
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
15
15
|
}
|
|
16
16
|
function SelectValue({
|
|
17
17
|
...props
|
|
18
18
|
}) {
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
20
20
|
}
|
|
21
21
|
function SelectTrigger({
|
|
22
22
|
className,
|
|
@@ -24,7 +24,7 @@ function SelectTrigger({
|
|
|
24
24
|
children,
|
|
25
25
|
...props
|
|
26
26
|
}) {
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
28
28
|
SelectPrimitive.Trigger,
|
|
29
29
|
{
|
|
30
30
|
"data-slot": "select-trigger",
|
|
@@ -33,15 +33,17 @@ function SelectTrigger({
|
|
|
33
33
|
"group/data-select border-input data-placeholder:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer",
|
|
34
34
|
className
|
|
35
35
|
),
|
|
36
|
-
...props
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
...props,
|
|
37
|
+
children: [
|
|
38
|
+
children,
|
|
39
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
40
|
+
ChevronDownIcon,
|
|
41
|
+
{
|
|
42
|
+
className: "\n size-4 opacity-50 transition-all duration-200\n group-data-[state=open]/data-select:rotate-180\n group-data-[state=open]/data-select:opacity-100\n group-data-[state=open]/data-select:text-gray-950!\n "
|
|
43
|
+
}
|
|
44
|
+
) })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
function SelectContent({
|
|
@@ -51,7 +53,7 @@ function SelectContent({
|
|
|
51
53
|
align = "center",
|
|
52
54
|
...props
|
|
53
55
|
}) {
|
|
54
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
55
57
|
SelectPrimitive.Content,
|
|
56
58
|
{
|
|
57
59
|
"data-slot": "select-content",
|
|
@@ -62,27 +64,29 @@ function SelectContent({
|
|
|
62
64
|
),
|
|
63
65
|
position,
|
|
64
66
|
align,
|
|
65
|
-
...props
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
...props,
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
SelectPrimitive.Viewport,
|
|
72
|
+
{
|
|
73
|
+
className: cn(
|
|
74
|
+
"p-1",
|
|
75
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"
|
|
76
|
+
),
|
|
77
|
+
children
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
) });
|
|
80
84
|
}
|
|
81
85
|
function SelectLabel({
|
|
82
86
|
className,
|
|
83
87
|
...props
|
|
84
88
|
}) {
|
|
85
|
-
return /* @__PURE__ */
|
|
89
|
+
return /* @__PURE__ */ jsx(
|
|
86
90
|
SelectPrimitive.Label,
|
|
87
91
|
{
|
|
88
92
|
"data-slot": "select-label",
|
|
@@ -96,7 +100,7 @@ function SelectItem({
|
|
|
96
100
|
children,
|
|
97
101
|
...props
|
|
98
102
|
}) {
|
|
99
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ jsxs(
|
|
100
104
|
SelectPrimitive.Item,
|
|
101
105
|
{
|
|
102
106
|
"data-slot": "select-item",
|
|
@@ -104,17 +108,19 @@ function SelectItem({
|
|
|
104
108
|
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 cursor-pointer",
|
|
105
109
|
className
|
|
106
110
|
),
|
|
107
|
-
...props
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
...props,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
114
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { className: "cursor-pointer", children })
|
|
115
|
+
]
|
|
116
|
+
}
|
|
111
117
|
);
|
|
112
118
|
}
|
|
113
119
|
function SelectSeparator({
|
|
114
120
|
className,
|
|
115
121
|
...props
|
|
116
122
|
}) {
|
|
117
|
-
return /* @__PURE__ */
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
118
124
|
SelectPrimitive.Separator,
|
|
119
125
|
{
|
|
120
126
|
"data-slot": "select-separator",
|
|
@@ -127,7 +133,7 @@ function SelectScrollUpButton({
|
|
|
127
133
|
className,
|
|
128
134
|
...props
|
|
129
135
|
}) {
|
|
130
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ jsx(
|
|
131
137
|
SelectPrimitive.ScrollUpButton,
|
|
132
138
|
{
|
|
133
139
|
"data-slot": "select-scroll-up-button",
|
|
@@ -135,16 +141,16 @@ function SelectScrollUpButton({
|
|
|
135
141
|
"flex cursor-default items-center justify-center py-1",
|
|
136
142
|
className
|
|
137
143
|
),
|
|
138
|
-
...props
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
...props,
|
|
145
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
146
|
+
}
|
|
141
147
|
);
|
|
142
148
|
}
|
|
143
149
|
function SelectScrollDownButton({
|
|
144
150
|
className,
|
|
145
151
|
...props
|
|
146
152
|
}) {
|
|
147
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ jsx(
|
|
148
154
|
SelectPrimitive.ScrollDownButton,
|
|
149
155
|
{
|
|
150
156
|
"data-slot": "select-scroll-down-button",
|
|
@@ -152,9 +158,9 @@ function SelectScrollDownButton({
|
|
|
152
158
|
"flex cursor-default items-center justify-center py-1",
|
|
153
159
|
className
|
|
154
160
|
),
|
|
155
|
-
...props
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
...props,
|
|
162
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
163
|
+
}
|
|
158
164
|
);
|
|
159
165
|
}
|
|
160
166
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Select.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"group/data-select border-input data-placeholder:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer\",\n className\n )}\n {...props}\n >\n {children}\n\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon\n className=\"\n size-4 opacity-50 transition-all duration-200\n group-data-[state=open]/data-select:rotate-180\n group-data-[state=open]/data-select:opacity-100\n group-data-[state=open]/data-select:text-gray-950!\n \"\n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n align = \"center\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground 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 relative z-[1001] max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 cursor-pointer\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"cursor-pointer\">{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/Select.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"group/data-select border-input data-placeholder:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer\",\n className\n )}\n {...props}\n >\n {children}\n\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon\n className=\"\n size-4 opacity-50 transition-all duration-200\n group-data-[state=open]/data-select:rotate-180\n group-data-[state=open]/data-select:opacity-100\n group-data-[state=open]/data-select:text-gray-950!\n \"\n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n align = \"center\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground 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 relative z-[1001] max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 cursor-pointer\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"cursor-pointer\">{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";AAUS,cAwBL,YAxBK;AAPT,YAAY,qBAAqB;AACjC,SAAS,WAAW,iBAAiB,qBAAqB;AAC1D,SAAS,UAAU;AAEnB,SAAS,OAAO;AAAA,EACd,GAAG;AACL,GAAsD;AACpD,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAG,OAAO;AAC7D;AAEA,SAAS,YAAY;AAAA,EACnB,GAAG;AACL,GAAuD;AACrD,SAAO,oBAAC,gBAAgB,OAAhB,EAAsB,aAAU,gBAAgB,GAAG,OAAO;AACpE;AAEA,SAAS,YAAY;AAAA,EACnB,GAAG;AACL,GAAuD;AACrD,SAAO,oBAAC,gBAAgB,OAAhB,EAAsB,aAAU,gBAAgB,GAAG,OAAO;AACpE;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,GAEG;AACD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,aAAW;AAAA,MACX,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QAED,oBAAC,gBAAgB,MAAhB,EAAqB,SAAO,MAC3B;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA;AAAA,QAMZ,GACF;AAAA;AAAA;AAAA,EACF;AAGJ;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,GAAG;AACL,GAAyD;AACvD,SACE,oBAAC,gBAAgB,QAAhB,EACC;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA,aAAa,YACb;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,wBAAqB;AAAA,QACtB;AAAA,UAAC,gBAAgB;AAAA,UAAhB;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA,aAAa,YACb;AAAA,YACF;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QACA,oBAAC,0BAAuB;AAAA;AAAA;AAAA,EAC1B,GACF;AAEJ;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,6CAA6C,SAAS;AAAA,MACnE,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsD;AACpD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,UAAK,WAAU,8DACd,8BAAC,gBAAgB,eAAhB,EACC,8BAAC,aAAU,WAAU,UAAS,GAChC,GACF;AAAA,QACA,oBAAC,gBAAgB,UAAhB,EAAyB,WAAU,kBAAkB,UAAS;AAAA;AAAA;AAAA,EACjE;AAEJ;AAEA,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA,GAAG;AACL,GAA2D;AACzD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iDAAiD,SAAS;AAAA,MACvE,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA,GAAG;AACL,GAAgE;AAC9D,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,iBAAc,WAAU,UAAS;AAAA;AAAA,EACpC;AAEJ;AAEA,SAAS,uBAAuB;AAAA,EAC9B;AAAA,EACA,GAAG;AACL,GAAkE;AAChE,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,mBAAgB,WAAU,UAAS;AAAA;AAAA,EACtC;AAEJ;","names":[]}
|