@usetrip/react-ui 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +347 -0
- package/dist/AlertBox.cjs +1 -0
- package/dist/AlertBox.d.ts +15 -0
- package/dist/AlertBox.js +5 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.d.ts +22 -0
- package/dist/Button.js +6 -0
- package/dist/ButtonLink.cjs +1 -0
- package/dist/ButtonLink.d.ts +25 -0
- package/dist/ButtonLink.js +6 -0
- package/dist/CalendarInput.cjs +1 -0
- package/dist/CalendarInput.d.ts +19 -0
- package/dist/CalendarInput.js +5 -0
- package/dist/CustomEditor.cjs +1 -0
- package/dist/CustomEditor.d.ts +16 -0
- package/dist/CustomEditor.js +5 -0
- package/dist/InputCounter.cjs +1 -0
- package/dist/InputCounter.d.ts +18 -0
- package/dist/InputCounter.js +5 -0
- package/dist/RangeDatePicker.cjs +1 -0
- package/dist/RangeDatePicker.d.ts +17 -0
- package/dist/RangeDatePicker.js +5 -0
- package/dist/SearchInput.cjs +1 -0
- package/dist/SearchInput.d.ts +15 -0
- package/dist/SearchInput.js +5 -0
- package/dist/TextField.cjs +1 -0
- package/dist/TextField.d.ts +27 -0
- package/dist/TextField.js +5 -0
- package/dist/Typography.cjs +1 -0
- package/dist/Typography.d.ts +25 -0
- package/dist/Typography.js +5 -0
- package/dist/chunks/AlertBox-TM5iLIH2.js +26 -0
- package/dist/chunks/AlertBox-b6dgMZ5I.cjs +1 -0
- package/dist/chunks/Button-C2ZQLgBk.js +75 -0
- package/dist/chunks/Button-DjizmSRN.cjs +1 -0
- package/dist/chunks/ButtonLink-C1BjiV2m.cjs +1 -0
- package/dist/chunks/ButtonLink-CG6S2pym.js +105 -0
- package/dist/chunks/CalendarInput-CPV0f1Gl.cjs +1 -0
- package/dist/chunks/CalendarInput-CxvAV7hK.js +58 -0
- package/dist/chunks/CustomEditor-BW_Mgv0y.cjs +1 -0
- package/dist/chunks/CustomEditor-q2MqCUUF.js +28 -0
- package/dist/chunks/InputCounter-6ZYoaiaX.js +46 -0
- package/dist/chunks/InputCounter-srYivV6j.cjs +1 -0
- package/dist/chunks/RangeDatePicker-CoEU93mq.cjs +1 -0
- package/dist/chunks/RangeDatePicker-DwccOp_Y.js +458 -0
- package/dist/chunks/SearchInput-5J5H9Yfv.js +55 -0
- package/dist/chunks/SearchInput-Dp1Q72Co.cjs +1 -0
- package/dist/chunks/TextField-DX6eZufy.js +145 -0
- package/dist/chunks/TextField-Dr3vhUtA.cjs +1 -0
- package/dist/chunks/Typography-B892BQsd.js +166 -0
- package/dist/chunks/Typography-CTDehHO_.cjs +1 -0
- package/dist/chunks/utils-D1b-iVvd.cjs +1 -0
- package/dist/chunks/utils-D9fNSpDp.js +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +22 -1110
- package/package.json +52 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "./utils-D9fNSpDp.js";
|
|
3
|
+
import { T as d } from "./Typography-B892BQsd.js";
|
|
4
|
+
const i = {
|
|
5
|
+
default: { container: "bg-gray-50 border-gray-200", icon: "text-gray-500", text: "text-gray-700" },
|
|
6
|
+
info: { container: "bg-blue-50 border-blue-200", icon: "text-blue-500", text: "text-blue-700" },
|
|
7
|
+
warning: { container: "bg-yellow-50 border-yellow-200", icon: "text-yellow-500", text: "text-yellow-700" },
|
|
8
|
+
error: { container: "bg-red-50 border-red-200", icon: "text-red-500", text: "text-red-700" },
|
|
9
|
+
success: { container: "bg-green-50 border-green-200", icon: "text-green-500", text: "text-green-700" }
|
|
10
|
+
}, c = {
|
|
11
|
+
default: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }),
|
|
12
|
+
info: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }),
|
|
13
|
+
warning: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }),
|
|
14
|
+
error: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }),
|
|
15
|
+
success: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" })
|
|
16
|
+
};
|
|
17
|
+
function g({ message: a, type: t = "error", className: o }) {
|
|
18
|
+
const r = i[t];
|
|
19
|
+
return /* @__PURE__ */ n("div", { className: l("w-full p-3 border rounded-lg flex items-start gap-2", r.container, o), children: [
|
|
20
|
+
/* @__PURE__ */ e("svg", { className: l("w-5 h-5 shrink-0 mt-0.5", r.icon), fill: "currentColor", viewBox: "0 0 20 20", "aria-hidden": "true", children: c[t] }),
|
|
21
|
+
/* @__PURE__ */ e(d, { variant: "body2", className: l("flex-1", r.text), children: a })
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
g as A
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),r=require("./utils-D1b-iVvd.cjs"),o=require("./Typography-CTDehHO_.cjs"),d={default:{container:"bg-gray-50 border-gray-200",icon:"text-gray-500",text:"text-gray-700"},info:{container:"bg-blue-50 border-blue-200",icon:"text-blue-500",text:"text-blue-700"},warning:{container:"bg-yellow-50 border-yellow-200",icon:"text-yellow-500",text:"text-yellow-700"},error:{container:"bg-red-50 border-red-200",icon:"text-red-500",text:"text-red-700"},success:{container:"bg-green-50 border-green-200",icon:"text-green-500",text:"text-green-700"}},i={default:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"}),info:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"}),warning:e.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"}),error:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}),success:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})};function c({message:n,type:l="error",className:a}){const t=d[l];return e.jsxs("div",{className:r.cn("w-full p-3 border rounded-lg flex items-start gap-2",t.container,a),children:[e.jsx("svg",{className:r.cn("w-5 h-5 shrink-0 mt-0.5",t.icon),fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:i[l]}),e.jsx(o.Typography,{variant:"body2",className:r.cn("flex-1",t.text),children:n})]})}exports.AlertBox=c;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as p, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { Slot as v } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as x } from "class-variance-authority";
|
|
5
|
+
import { Loader2 as h } from "lucide-react";
|
|
6
|
+
import { c as y } from "./utils-D9fNSpDp.js";
|
|
7
|
+
const w = x(
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background cursor-pointer",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
14
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
15
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
link: "underline-offset-4 hover:underline text-primary"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
sm: "h-9 px-3 py-2 text-xs",
|
|
21
|
+
md: "h-10 py-2 px-4 text-sm",
|
|
22
|
+
lg: "h-12 px-6 py-3 text-base",
|
|
23
|
+
full: "h-12 w-full px-6 py-3 text-base",
|
|
24
|
+
icon: "h-10 w-10 p-0"
|
|
25
|
+
},
|
|
26
|
+
rounded: {
|
|
27
|
+
default: "rounded-md",
|
|
28
|
+
full: "rounded-full",
|
|
29
|
+
none: "rounded-none"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "primary",
|
|
34
|
+
size: "md",
|
|
35
|
+
rounded: "default"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
), j = g.forwardRef(
|
|
39
|
+
({
|
|
40
|
+
className: r,
|
|
41
|
+
variant: t,
|
|
42
|
+
size: o,
|
|
43
|
+
rounded: n,
|
|
44
|
+
asChild: s = !1,
|
|
45
|
+
isLoading: e = !1,
|
|
46
|
+
startIcon: a,
|
|
47
|
+
endIcon: i,
|
|
48
|
+
disabled: d,
|
|
49
|
+
children: u,
|
|
50
|
+
...c
|
|
51
|
+
}, l) => {
|
|
52
|
+
const f = s ? v : "button", m = d || e;
|
|
53
|
+
return /* @__PURE__ */ p(
|
|
54
|
+
f,
|
|
55
|
+
{
|
|
56
|
+
className: y(w({ variant: t, size: o, rounded: n, className: r })),
|
|
57
|
+
ref: l,
|
|
58
|
+
disabled: m,
|
|
59
|
+
"data-loading": e,
|
|
60
|
+
...c,
|
|
61
|
+
children: [
|
|
62
|
+
e && /* @__PURE__ */ b(h, { className: "h-4 w-4 animate-spin" }),
|
|
63
|
+
!e && a,
|
|
64
|
+
u,
|
|
65
|
+
!e && i
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
j.displayName = "Button";
|
|
72
|
+
export {
|
|
73
|
+
j as B,
|
|
74
|
+
w as b
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),v=require("react"),y=require("@radix-ui/react-slot"),x=require("class-variance-authority"),h=require("lucide-react"),j=require("./utils-D1b-iVvd.cjs");function w(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const q=w(v),a=x.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background cursor-pointer",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},size:{sm:"h-9 px-3 py-2 text-xs",md:"h-10 py-2 px-4 text-sm",lg:"h-12 px-6 py-3 text-base",full:"h-12 w-full px-6 py-3 text-base",icon:"h-10 w-10 p-0"},rounded:{default:"rounded-md",full:"rounded-full",none:"rounded-none"}},defaultVariants:{variant:"primary",size:"md",rounded:"default"}}),i=q.forwardRef(({className:e,variant:r,size:t,rounded:o,asChild:c=!1,isLoading:n=!1,startIcon:u,endIcon:d,disabled:l,children:f,...b},p)=>{const g=c?y.Slot:"button",m=l||n;return s.jsxs(g,{className:j.cn(a({variant:r,size:t,rounded:o,className:e})),ref:p,disabled:m,"data-loading":n,...b,children:[n&&s.jsx(h.Loader2,{className:"h-4 w-4 animate-spin"}),!n&&u,f,!n&&d]})});i.displayName="Button";exports.Button=i;exports.buttonVariants=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),b=require("react"),y=require("@radix-ui/react-slot"),j=require("class-variance-authority"),f=require("lucide-react"),g=require("react-router-dom"),m=require("./utils-D1b-iVvd.cjs");function k(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const w=k(b),a=j.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background cursor-pointer",{variants:{variant:{primary:"text-primary hover:text-primary/90 hover:underline underline-offset-4",secondary:"text-secondary hover:text-secondary/80 hover:underline underline-offset-4",destructive:"text-destructive hover:text-destructive/90 hover:underline underline-offset-4",outline:"border border-input text-foreground hover:text-accent-foreground hover:underline underline-offset-4",ghost:"hover:text-accent-foreground hover:underline underline-offset-4",link:"underline-offset-4 hover:underline text-primary"},size:{sm:"h-9 px-3 py-2 text-xs",md:"h-10 py-2 px-4 text-sm",lg:"h-12 px-6 py-3 text-base",full:"h-12 w-full px-6 py-3 text-base",icon:"h-10 w-10 p-0"},rounded:{default:"rounded-md",full:"rounded-full",none:"rounded-none"}},defaultVariants:{variant:"primary",size:"md",rounded:"default"}}),x=w.forwardRef(({className:t,variant:n,size:r,rounded:o,asChild:h=!1,isLoading:e=!1,startIcon:s,endIcon:u,to:p,external:v=!1,children:l,...c},d)=>h?i.jsxs(y.Slot,{className:m.cn(a({variant:n,size:r,rounded:o,className:t})),ref:d,"data-loading":e,...c,children:[e&&i.jsx(f.Loader2,{className:"h-4 w-4 animate-spin"}),!e&&s,l,!e&&u]}):v?i.jsxs("a",{href:p.toString(),className:m.cn(a({variant:n,size:r,rounded:o,className:t})),ref:d,"data-loading":e,target:"_blank",rel:"noopener noreferrer",...c,children:[e&&i.jsx(f.Loader2,{className:"h-4 w-4 animate-spin"}),!e&&s,l,!e&&u]}):i.jsxs(g.Link,{to:p,className:m.cn(a({variant:n,size:r,rounded:o,className:t})),ref:d,"data-loading":e,...c,children:[e&&i.jsx(f.Loader2,{className:"h-4 w-4 animate-spin"}),!e&&s,l,!e&&u]}));x.displayName="ButtonLink";exports.ButtonLink=x;exports.buttonLinkVariants=a;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs as u, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
|
+
import { Slot as b } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as w } from "class-variance-authority";
|
|
5
|
+
import { Loader2 as m } from "lucide-react";
|
|
6
|
+
import { Link as k } from "react-router-dom";
|
|
7
|
+
import { c as p } from "./utils-D9fNSpDp.js";
|
|
8
|
+
const c = w(
|
|
9
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background cursor-pointer",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
primary: "text-primary hover:text-primary/90 hover:underline underline-offset-4",
|
|
14
|
+
secondary: "text-secondary hover:text-secondary/80 hover:underline underline-offset-4",
|
|
15
|
+
destructive: "text-destructive hover:text-destructive/90 hover:underline underline-offset-4",
|
|
16
|
+
outline: "border border-input text-foreground hover:text-accent-foreground hover:underline underline-offset-4",
|
|
17
|
+
ghost: "hover:text-accent-foreground hover:underline underline-offset-4",
|
|
18
|
+
link: "underline-offset-4 hover:underline text-primary"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
sm: "h-9 px-3 py-2 text-xs",
|
|
22
|
+
md: "h-10 py-2 px-4 text-sm",
|
|
23
|
+
lg: "h-12 px-6 py-3 text-base",
|
|
24
|
+
full: "h-12 w-full px-6 py-3 text-base",
|
|
25
|
+
icon: "h-10 w-10 p-0"
|
|
26
|
+
},
|
|
27
|
+
rounded: {
|
|
28
|
+
default: "rounded-md",
|
|
29
|
+
full: "rounded-full",
|
|
30
|
+
none: "rounded-none"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "primary",
|
|
35
|
+
size: "md",
|
|
36
|
+
rounded: "default"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
), g = y.forwardRef(
|
|
40
|
+
({
|
|
41
|
+
className: r,
|
|
42
|
+
variant: t,
|
|
43
|
+
size: n,
|
|
44
|
+
rounded: o,
|
|
45
|
+
asChild: h = !1,
|
|
46
|
+
isLoading: e = !1,
|
|
47
|
+
startIcon: i,
|
|
48
|
+
endIcon: a,
|
|
49
|
+
to: x,
|
|
50
|
+
external: v = !1,
|
|
51
|
+
children: l,
|
|
52
|
+
...s
|
|
53
|
+
}, f) => h ? /* @__PURE__ */ u(
|
|
54
|
+
b,
|
|
55
|
+
{
|
|
56
|
+
className: p(c({ variant: t, size: n, rounded: o, className: r })),
|
|
57
|
+
ref: f,
|
|
58
|
+
"data-loading": e,
|
|
59
|
+
...s,
|
|
60
|
+
children: [
|
|
61
|
+
e && /* @__PURE__ */ d(m, { className: "h-4 w-4 animate-spin" }),
|
|
62
|
+
!e && i,
|
|
63
|
+
l,
|
|
64
|
+
!e && a
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
) : v ? /* @__PURE__ */ u(
|
|
68
|
+
"a",
|
|
69
|
+
{
|
|
70
|
+
href: x.toString(),
|
|
71
|
+
className: p(c({ variant: t, size: n, rounded: o, className: r })),
|
|
72
|
+
ref: f,
|
|
73
|
+
"data-loading": e,
|
|
74
|
+
target: "_blank",
|
|
75
|
+
rel: "noopener noreferrer",
|
|
76
|
+
...s,
|
|
77
|
+
children: [
|
|
78
|
+
e && /* @__PURE__ */ d(m, { className: "h-4 w-4 animate-spin" }),
|
|
79
|
+
!e && i,
|
|
80
|
+
l,
|
|
81
|
+
!e && a
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
) : /* @__PURE__ */ u(
|
|
85
|
+
k,
|
|
86
|
+
{
|
|
87
|
+
to: x,
|
|
88
|
+
className: p(c({ variant: t, size: n, rounded: o, className: r })),
|
|
89
|
+
ref: f,
|
|
90
|
+
"data-loading": e,
|
|
91
|
+
...s,
|
|
92
|
+
children: [
|
|
93
|
+
e && /* @__PURE__ */ d(m, { className: "h-4 w-4 animate-spin" }),
|
|
94
|
+
!e && i,
|
|
95
|
+
l,
|
|
96
|
+
!e && a
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
);
|
|
101
|
+
g.displayName = "ButtonLink";
|
|
102
|
+
export {
|
|
103
|
+
g as B,
|
|
104
|
+
c as b
|
|
105
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),x=require("lucide-react"),p=require("./Typography-CTDehHO_.cjs");function f({label:n,value:d,placeholder:i="Selecione uma data",onClick:t,onFocus:r,className:u="",state:a="default",hintText:l,compact:s=!1}){const c=()=>{t==null||t(),r==null||r()},o=()=>{switch(a){case"warning":return"border-yellow-500 focus:ring-yellow-500";case"error":return"border-red-500 focus:ring-red-500";default:return"border-gray-300 focus:ring-blue-500"}},y=()=>{switch(a){case"warning":return"text-yellow-500";case"error":return"text-red-500";default:return"text-neutral-500"}};return e.jsxs("div",{className:u,children:[e.jsx(p.Typography,{as:"label",variant:"body2",className:`${s?"mb-0.5":"mb-2"} block`,children:n}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:d,placeholder:i,readOnly:!0,className:`w-full border rounded-md ${s?"py-1":"py-2"} pl-10 pr-3 focus:outline-none focus:ring-2 cursor-pointer ${o()}`,onClick:c,onFocus:r}),e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(x.Calendar,{className:"h-4 w-4 text-gray-400"})})]}),e.jsx("div",{className:`${s?"h-3 mt-0":"h-5 mt-1"}`,children:l&&e.jsx("p",{className:`text-[12px] ${y()}`,children:l})})]})}exports.CalendarInput=f;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Calendar as p } from "lucide-react";
|
|
3
|
+
import { T as y } from "./Typography-B892BQsd.js";
|
|
4
|
+
function x({
|
|
5
|
+
label: d,
|
|
6
|
+
value: i,
|
|
7
|
+
placeholder: o = "Selecione uma data",
|
|
8
|
+
onClick: t,
|
|
9
|
+
onFocus: r,
|
|
10
|
+
className: u = "",
|
|
11
|
+
state: l = "default",
|
|
12
|
+
hintText: n,
|
|
13
|
+
compact: a = !1
|
|
14
|
+
}) {
|
|
15
|
+
const c = () => {
|
|
16
|
+
t == null || t(), r == null || r();
|
|
17
|
+
}, m = () => {
|
|
18
|
+
switch (l) {
|
|
19
|
+
case "warning":
|
|
20
|
+
return "border-yellow-500 focus:ring-yellow-500";
|
|
21
|
+
case "error":
|
|
22
|
+
return "border-red-500 focus:ring-red-500";
|
|
23
|
+
default:
|
|
24
|
+
return "border-gray-300 focus:ring-blue-500";
|
|
25
|
+
}
|
|
26
|
+
}, f = () => {
|
|
27
|
+
switch (l) {
|
|
28
|
+
case "warning":
|
|
29
|
+
return "text-yellow-500";
|
|
30
|
+
case "error":
|
|
31
|
+
return "text-red-500";
|
|
32
|
+
default:
|
|
33
|
+
return "text-neutral-500";
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ s("div", { className: u, children: [
|
|
37
|
+
/* @__PURE__ */ e(y, { as: "label", variant: "body2", className: `${a ? "mb-0.5" : "mb-2"} block`, children: d }),
|
|
38
|
+
/* @__PURE__ */ s("div", { className: "relative", children: [
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
"input",
|
|
41
|
+
{
|
|
42
|
+
type: "text",
|
|
43
|
+
value: i,
|
|
44
|
+
placeholder: o,
|
|
45
|
+
readOnly: !0,
|
|
46
|
+
className: `w-full border rounded-md ${a ? "py-1" : "py-2"} pl-10 pr-3 focus:outline-none focus:ring-2 cursor-pointer ${m()}`,
|
|
47
|
+
onClick: c,
|
|
48
|
+
onFocus: r
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ e(p, { className: "h-4 w-4 text-gray-400" }) })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ e("div", { className: `${a ? "h-3 mt-0" : "h-5 mt-1"}`, children: n && /* @__PURE__ */ e("p", { className: `text-[12px] ${f()}`, children: n }) })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
x as C
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),s=require("react-simple-wysiwyg");function u({value:l,onChange:i,placeholder:d,containerProps:e}){return t.jsx(s.EditorProvider,{children:t.jsx(s.Editor,{value:l,onChange:i,placeholder:d,containerProps:{...e,className:`custom-editor-container ${(e==null?void 0:e.className)??""}`,style:{...e==null?void 0:e.style,backgroundColor:"white"}},children:t.jsxs(s.Toolbar,{className:"custom-editor-toolbar",children:[t.jsx(s.BtnBold,{}),t.jsx(s.BtnItalic,{}),t.jsx(s.BtnUnderline,{}),t.jsx(s.BtnStrikeThrough,{}),t.jsx(s.BtnNumberedList,{}),t.jsx(s.BtnBulletList,{})]})})})}exports.CustomEditor=u;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { EditorProvider as u, Editor as r, Toolbar as s, BtnBold as B, BtnItalic as o, BtnUnderline as h, BtnStrikeThrough as b, BtnNumberedList as N, BtnBulletList as a } from "react-simple-wysiwyg";
|
|
3
|
+
function x({ value: d, onChange: e, placeholder: m, containerProps: l }) {
|
|
4
|
+
return /* @__PURE__ */ t(u, { children: /* @__PURE__ */ t(
|
|
5
|
+
r,
|
|
6
|
+
{
|
|
7
|
+
value: d,
|
|
8
|
+
onChange: e,
|
|
9
|
+
placeholder: m,
|
|
10
|
+
containerProps: {
|
|
11
|
+
...l,
|
|
12
|
+
className: `custom-editor-container ${(l == null ? void 0 : l.className) ?? ""}`,
|
|
13
|
+
style: { ...l == null ? void 0 : l.style, backgroundColor: "white" }
|
|
14
|
+
},
|
|
15
|
+
children: /* @__PURE__ */ i(s, { className: "custom-editor-toolbar", children: [
|
|
16
|
+
/* @__PURE__ */ t(B, {}),
|
|
17
|
+
/* @__PURE__ */ t(o, {}),
|
|
18
|
+
/* @__PURE__ */ t(h, {}),
|
|
19
|
+
/* @__PURE__ */ t(b, {}),
|
|
20
|
+
/* @__PURE__ */ t(N, {}),
|
|
21
|
+
/* @__PURE__ */ t(a, {})
|
|
22
|
+
] })
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
x as C
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Minus as m, Plus as b } from "lucide-react";
|
|
3
|
+
import { T as l } from "./Typography-B892BQsd.js";
|
|
4
|
+
function g({
|
|
5
|
+
label: a,
|
|
6
|
+
value: t,
|
|
7
|
+
onIncrement: o,
|
|
8
|
+
onDecrement: d,
|
|
9
|
+
minValue: c = 0,
|
|
10
|
+
className: y = "",
|
|
11
|
+
hintText: s,
|
|
12
|
+
compact: r = !1
|
|
13
|
+
}) {
|
|
14
|
+
const n = t <= c;
|
|
15
|
+
return /* @__PURE__ */ i("div", { className: y, children: [
|
|
16
|
+
/* @__PURE__ */ e(l, { as: "label", variant: "body2", className: `${r ? "mb-0.5" : "mb-2"} block`, children: a }),
|
|
17
|
+
/* @__PURE__ */ i("div", { className: "flex items-center border border-gray-300 rounded-md", children: [
|
|
18
|
+
/* @__PURE__ */ e(
|
|
19
|
+
"button",
|
|
20
|
+
{
|
|
21
|
+
type: "button",
|
|
22
|
+
onClick: d,
|
|
23
|
+
disabled: n,
|
|
24
|
+
className: `${r ? "px-2 py-1" : "px-4 py-2"} flex-1 flex justify-center items-center border-r border-gray-300 hover:bg-gray-100 active:bg-gray-200 transition-colors duration-150`,
|
|
25
|
+
"aria-label": `Decrease ${a}`,
|
|
26
|
+
children: /* @__PURE__ */ e(m, { className: `h-4 w-4 ${n ? "text-gray-300" : "text-gray-700"}` })
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ e("div", { className: `${r ? "px-2 py-1" : "px-4 py-2"} flex-1 text-center`, children: /* @__PURE__ */ e(l, { as: "span", variant: "body1", className: "font-medium", children: t }) }),
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
"button",
|
|
32
|
+
{
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: o,
|
|
35
|
+
className: `${r ? "px-2 py-1" : "px-4 py-2"} flex-1 flex justify-center items-center border-l border-gray-300 hover:bg-gray-100 active:bg-gray-200 transition-colors duration-150`,
|
|
36
|
+
"aria-label": `Increase ${a}`,
|
|
37
|
+
children: /* @__PURE__ */ e(b, { className: "h-4 w-4 text-gray-700" })
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ e("div", { className: `${r ? "h-3 mt-1" : "h-5 mt-1"}`, children: s && /* @__PURE__ */ e("p", { className: "text-[12px] text-neutral-500", children: s }) })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
g as I
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("./Typography-CTDehHO_.cjs");function y({label:s,value:t,onIncrement:c,onDecrement:o,minValue:d=0,className:x="",hintText:a,compact:r=!1}){const n=t<=d;return e.jsxs("div",{className:x,children:[e.jsx(l.Typography,{as:"label",variant:"body2",className:`${r?"mb-0.5":"mb-2"} block`,children:s}),e.jsxs("div",{className:"flex items-center border border-gray-300 rounded-md",children:[e.jsx("button",{type:"button",onClick:o,disabled:n,className:`${r?"px-2 py-1":"px-4 py-2"} flex-1 flex justify-center items-center border-r border-gray-300 hover:bg-gray-100 active:bg-gray-200 transition-colors duration-150`,"aria-label":`Decrease ${s}`,children:e.jsx(i.Minus,{className:`h-4 w-4 ${n?"text-gray-300":"text-gray-700"}`})}),e.jsx("div",{className:`${r?"px-2 py-1":"px-4 py-2"} flex-1 text-center`,children:e.jsx(l.Typography,{as:"span",variant:"body1",className:"font-medium",children:t})}),e.jsx("button",{type:"button",onClick:c,className:`${r?"px-2 py-1":"px-4 py-2"} flex-1 flex justify-center items-center border-l border-gray-300 hover:bg-gray-100 active:bg-gray-200 transition-colors duration-150`,"aria-label":`Increase ${s}`,children:e.jsx(i.Plus,{className:"h-4 w-4 text-gray-700"})})]}),e.jsx("div",{className:`${r?"h-3 mt-1":"h-5 mt-1"}`,children:a&&e.jsx("p",{className:"text-[12px] text-neutral-500",children:a})})]})}exports.InputCounter=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),j=require("react"),y=require("lucide-react"),v=require("date-fns"),x=require("date-fns/locale"),n=require("./utils-D1b-iVvd.cjs"),N=require("react-day-picker"),A=require("@radix-ui/react-slot"),F=require("class-variance-authority"),W=require("@radix-ui/react-dialog"),b=require("./Button-DjizmSRN.cjs"),w=require("./Typography-CTDehHO_.cjs");function q(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const d in o)if(d!=="default"){const a=Object.getOwnPropertyDescriptor(o,d);Object.defineProperty(s,d,a.get?a:{enumerable:!0,get:()=>o[d]})}}return s.default=o,Object.freeze(s)}const S=q(j),_=q(W),D=F.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function X({className:o,variant:s,size:d,asChild:a=!1,...f}){const g=a?A.Slot:"button";return t.jsx(g,{"data-slot":"button",className:n.cn(D({variant:s,size:d,className:o})),...f})}function B({className:o,classNames:s,showOutsideDays:d=!0,captionLayout:a="label",buttonVariant:f="ghost",formatters:g,components:e,...p}){const r=N.getDefaultClassNames();return t.jsx(N.DayPicker,{showOutsideDays:d,className:n.cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,o),captionLayout:a,formatters:{formatMonthDropdown:c=>c.toLocaleString("default",{month:"short"}),...g},classNames:{root:n.cn("w-fit",r.root),months:n.cn("flex gap-4 flex-col md:flex-row relative",r.months),month:n.cn("flex flex-col w-full gap-4",r.month),nav:n.cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",r.nav),button_previous:n.cn(D({variant:f}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",r.button_previous),button_next:n.cn(D({variant:f}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",r.button_next),month_caption:n.cn("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",r.month_caption),dropdowns:n.cn("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",r.dropdowns),dropdown_root:n.cn("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",r.dropdown_root),dropdown:n.cn("absolute inset-0 opacity-0",r.dropdown),caption_label:n.cn("select-none font-medium",a==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",r.caption_label),table:"w-full border-collapse",weekdays:n.cn("flex",r.weekdays),weekday:n.cn("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",r.weekday),week:n.cn("flex w-full mt-2",r.week),week_number_header:n.cn("select-none w-(--cell-size)",r.week_number_header),week_number:n.cn("text-[0.8rem] select-none text-muted-foreground",r.week_number),day:n.cn("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",r.day),range_start:n.cn("rounded-l-md rounded-r-none bg-gray-800 text-white !border-none !outline-none !ring-0 !shadow-none",r.range_start),range_middle:n.cn("rounded-none bg-gray-400 text-white !border-none !outline-none !ring-0 !shadow-none",r.range_middle),range_end:n.cn("rounded-r-md rounded-l-none bg-gray-800 text-white !border-none !outline-none !ring-0 !shadow-none",r.range_end),today:n.cn("bg-gray-600 text-white font-bold shadow-lg !rounded-md",r.today),selected:n.cn("!bg-transparent !text-black !font-bold !shadow-none !border-2 !border-gray-600 !rounded-md",r.selected),outside:n.cn("text-muted-foreground aria-selected:text-muted-foreground",r.outside),disabled:n.cn("text-muted-foreground opacity-50",r.disabled),hidden:n.cn("invisible",r.hidden),...s},components:{Root:({className:c,rootRef:m,...h})=>t.jsx("div",{"data-slot":"calendar",ref:m,className:n.cn(c),...h}),Chevron:({className:c,orientation:m,...h})=>m==="left"?t.jsx(y.ChevronLeftIcon,{className:n.cn("size-4",c),...h}):m==="right"?t.jsx(y.ChevronRightIcon,{className:n.cn("size-4",c),...h}):t.jsx(y.ChevronDownIcon,{className:n.cn("size-4",c),...h}),DayButton:Y,WeekNumber:({children:c,...m})=>t.jsx("td",{...m,children:t.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:c})}),...e},...p})}function Y({className:o,day:s,modifiers:d,...a}){const f=N.getDefaultClassNames(),g=S.useRef(null);return S.useEffect(()=>{var e;d.focused&&((e=g.current)==null||e.focus())},[d.focused]),t.jsx(X,{ref:g,variant:"ghost",size:"icon","data-day":s.date.toLocaleDateString(),"data-today":d.today,"data-selected-single":d.selected&&!d.range_start&&!d.range_end&&!d.range_middle,"data-range-start":d.range_start,"data-range-end":d.range_end,"data-range-middle":d.range_middle,className:n.cn("data-[range-middle=true]:bg-gray-400 data-[range-middle=true]:text-white data-[range-middle=true]:!border-none data-[range-middle=true]:!outline-none data-[range-middle=true]:!ring-0 data-[range-middle=true]:hover:!bg-gray-400 data-[range-middle=true]:hover:!text-white data-[range-start=true]:bg-gray-800 data-[range-start=true]:text-white data-[range-start=true]:!border-none data-[range-start=true]:!outline-none data-[range-start=true]:!ring-0 data-[range-start=true]:!rounded-l-md data-[range-start=true]:!rounded-r-none data-[range-start=true]:hover:!bg-gray-800 data-[range-start=true]:hover:!text-white data-[range-end=true]:bg-gray-800 data-[range-end=true]:text-white data-[range-end=true]:!border-none data-[range-end=true]:!outline-none data-[range-end=true]:!ring-0 data-[range-end=true]:!rounded-r-md data-[range-end=true]:!rounded-l-none data-[range-end=true]:hover:!bg-gray-800 data-[range-end=true]:hover:!text-white data-[range-start=false]:data-[range-end=false]:data-[range-middle=false]:hover:bg-accent data-[range-start=false]:data-[range-end=false]:data-[range-middle=false]:hover:text-accent-foreground data-[range-start=false]:data-[range-end=false]:data-[range-middle=false]:hover:!rounded-md focus:!bg-gray-600 focus:!text-white focus:!font-bold focus:!shadow-lg focus:!rounded-md focus:!outline-none focus:!ring-0 !border-none !outline-none !ring-0 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal data-[range-end=true]:hover:rounded-r-md data-[range-end=true]:hover:rounded-l-none data-[range-end=true]:focus:rounded-r-md data-[range-end=true]:focus:rounded-l-none data-[range-end=true]:focus:bg-gray-800 data-[range-end=true]:focus:text-white data-[range-middle=true]:rounded-none data-[range-middle=true]:hover:rounded-none data-[range-middle=true]:focus:rounded-none data-[range-middle=true]:focus:bg-gray-400 data-[range-middle=true]:focus:text-white data-[range-start=true]:hover:rounded-l-md data-[range-start=true]:hover:rounded-r-none data-[range-start=true]:focus:rounded-l-md data-[range-start=true]:focus:rounded-r-none data-[range-start=true]:focus:bg-gray-800 data-[range-start=true]:focus:text-white [&>span]:text-xs [&>span]:opacity-70 data-[today=true]:hover:bg-gray-700 data-[today=true]:hover:text-white data-[today=true]:hover:rounded-md",f.day,o),...a})}function G({...o}){return t.jsx(_.Root,{"data-slot":"dialog",...o})}function T({...o}){return t.jsx(_.Portal,{"data-slot":"dialog-portal",...o})}function P({className:o,...s}){return t.jsx(_.Overlay,{"data-slot":"dialog-overlay",className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[10000] bg-black/50",o),...s})}function J({className:o,children:s,showCloseButton:d=!1,...a}){return t.jsxs(T,{"data-slot":"dialog-portal",children:[t.jsx(P,{}),t.jsxs(_.Content,{"data-slot":"dialog-content",className:n.cn("bg-background 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 fixed top-[50%] left-[50%] z-[10001] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",o),...a,children:[s,d&&t.jsxs(_.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[t.jsx(y.XIcon,{}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function K({className:o,...s}){return t.jsx("div",{"data-slot":"dialog-header",className:n.cn("flex flex-col gap-2 text-center sm:text-left p-4 pb-4",o),...s})}function Q({className:o,...s}){return t.jsx(_.Title,{"data-slot":"dialog-title",className:n.cn("text-lg leading-none font-semibold",o),...s})}function U({isOpen:o,onClose:s,onSelect:d,initialRange:a,focusedField:f,minDate:g}){const[e,p]=j.useState(a),[r,c]=j.useState((a==null?void 0:a.from)||new Date),[m,h]=j.useState((a==null?void 0:a.from)||new Date);j.useEffect(()=>{a&&p(a)},[a]),j.useEffect(()=>{if(!o)return;const u=(f==="end"?(a==null?void 0:a.to)||(a==null?void 0:a.from):(a==null?void 0:a.from)||(a==null?void 0:a.to))||new Date;c(u),h(u)},[o,a,f]);const z=i=>{if(!i&&(e!=null&&e.from)&&(!e.to||e.from.getTime()===e.to.getTime())){p({from:e.from,to:e.from});return}p(i)},O=()=>{d(e),s()},$=()=>{p(a),s()},I=()=>p(void 0),M=i=>{h(u=>{const l=new Date(u);return l.setMonth(l.getMonth()+(i==="prev"?-1:1)),l})},k=i=>{c(u=>{const l=new Date(u);return l.setMonth(l.getMonth()+(i==="prev"?-1:1)),l})},L=()=>e!=null&&e.from?e.to?`${v.format(e.from,"dd/MM/yyyy",{locale:x.ptBR})} - ${v.format(e.to,"dd/MM/yyyy",{locale:x.ptBR})}`:v.format(e.from,"dd/MM/yyyy",{locale:x.ptBR}):"Selecione as datas",E=()=>{if(!(e!=null&&e.from)&&!(e!=null&&e.to))return"Selecione a data de início";if(e!=null&&e.from&&!(e!=null&&e.to))return"Selecione a data de fim";if(e!=null&&e.from&&(e!=null&&e.to)){const i=e.from instanceof Date?e.from:new Date(e.from),u=e.to instanceof Date?e.to:new Date(e.to),l=Math.ceil((u.getTime()-i.getTime())/(1e3*60*60*24))+1;return`${l} dia${l>1?"s":""} selecionado${l>1?"s":""}`}return""},C=i=>{if(g){const u=new Date(g);u.setHours(0,0,0,0);const l=new Date(i);return l.setHours(0,0,0,0),l<u}return!1},H={months:"flex w-full justify-center",month:"w-full space-y-4",month_caption:"hidden",nav:"hidden",table:"w-full border-collapse space-y-1",head_row:"flex w-full",head_cell:"text-muted-foreground rounded-md w-full font-normal text-[0.8rem] flex-1 text-center py-2",row:"flex w-full mt-2",cell:n.cn("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 flex-1 !border-none !outline-none"),day:n.cn("h-8 w-full p-0 font-normal aria-selected:opacity-100 hover:bg-accent hover:text-accent-foreground hover:!rounded-md focus:!rounded-md focus:outline-none focus:ring-0"),day_range_start:"day-range-start rounded-l-md bg-gray-800 text-white !border-none !outline-none !ring-0",day_range_end:"day-range-end rounded-r-md bg-gray-800 text-white !border-none !outline-none !ring-0",day_selected:"!bg-gray-600 !text-white !font-bold !shadow-lg !rounded-md !border-none !outline-none !ring-0",today:"bg-gray-600 text-white font-bold shadow-lg rounded-md",day_outside:"text-muted-foreground opacity-50",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-gray-400 aria-selected:text-white rounded-none !border-none !outline-none !ring-0",day_hidden:"invisible"},V={months:"flex gap-6 justify-center",month:"flex flex-col gap-4",month_caption:"sm:hidden",nav:"hidden",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem] text-center",row:"flex w-full mt-2",cell:n.cn("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 !border-none !outline-none"),day:n.cn("h-9 w-9 p-0 font-normal aria-selected:opacity-100 hover:bg-accent hover:text-accent-foreground hover:!rounded-md focus:!rounded-md focus:outline-none focus:ring-0"),day_range_start:"day-range-start rounded-l-md bg-gray-800 text-white !border-none !outline-none !ring-0",day_range_end:"day-range-end rounded-r-md bg-gray-800 text-white !border-none !outline-none !ring-0",day_selected:"!bg-gray-600 !text-white !font-bold !shadow-lg !rounded-md !border-none !outline-none !ring-0",today:"bg-gray-600 text-white font-bold !rounded-md",day_outside:"hidden",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-gray-400 aria-selected:text-white rounded-none !border-none !outline-none !ring-0",day_hidden:"invisible"};return t.jsx(G,{open:o,onOpenChange:s,children:t.jsxs(T,{children:[t.jsx(P,{className:"max-sm:!z-[9999]"}),t.jsxs(J,{className:"sm:max-w-[900px] max-w-[95vw] max-h-[95vh] overflow-y-auto p-0 [&>*]:max-sm:!z-[10000] max-sm:!z-[10000]",children:[t.jsxs(K,{className:"p-4 sm:p-6 pb-4",children:[t.jsx(Q,{className:"text-lg text-left font-semibold",children:"Selecionar Período"}),t.jsx(w.Typography,{variant:"body2",className:"text-gray-600",children:E()})]}),t.jsxs("div",{className:"px-4 sm:px-6",children:[t.jsxs("div",{className:"block md:hidden",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx(b.Button,{variant:"outline",size:"sm",onClick:()=>M("prev"),className:"p-2",children:t.jsx(y.ChevronLeft,{className:"h-4 w-4"})}),t.jsx(w.Typography,{variant:"h5",className:"font-medium",children:v.format(m,"MMMM yyyy",{locale:x.ptBR})}),t.jsx(b.Button,{variant:"outline",size:"sm",onClick:()=>M("next"),className:"p-2",children:t.jsx(y.ChevronRight,{className:"h-4 w-4"})})]}),t.jsx(B,{mode:"range",defaultMonth:m,month:m,onMonthChange:h,selected:e,onSelect:z,numberOfMonths:1,locale:x.ptBR,disabled:C,className:"mx-auto",classNames:H})]}),t.jsxs("div",{className:"hidden md:flex flex-col min-h-[320px]",children:[t.jsxs("div",{className:"flex items-center justify-center",children:[t.jsx(b.Button,{variant:"outline",size:"sm",onClick:()=>k("prev"),className:"p-2 mr-3",children:t.jsx(y.ChevronLeft,{className:"h-4 w-4"})}),t.jsxs("div",{className:"flex gap-8",children:[t.jsx(w.Typography,{variant:"h5",className:"font-medium min-w-[120px] text-center",children:v.format(r,"MMMM yyyy",{locale:x.ptBR})}),t.jsx(w.Typography,{variant:"h5",className:"font-medium min-w-[120px] text-center",children:v.format(new Date(r.getFullYear(),r.getMonth()+1),"MMMM yyyy",{locale:x.ptBR})})]}),t.jsx(b.Button,{variant:"outline",size:"sm",onClick:()=>k("next"),className:"p-2 ml-3",children:t.jsx(y.ChevronRight,{className:"h-4 w-4"})})]}),t.jsx(B,{mode:"range",defaultMonth:r,month:r,onMonthChange:c,selected:e,onSelect:z,numberOfMonths:2,showOutsideDays:!1,locale:x.ptBR,disabled:C,className:"w-full justify-center",classNames:V})]}),t.jsx("div",{className:"mb-6 p-4 bg-gray-200 rounded-lg",children:t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx(w.Typography,{variant:"body2",className:"text-gray-600 mb-1",children:"Período selecionado:"}),t.jsx(w.Typography,{variant:"body1",className:"font-medium max-sm:text-sm",children:L()})]}),(e==null?void 0:e.from)&&t.jsx(b.Button,{variant:"secondary",size:"sm",onClick:I,className:"text-white bg-gray-400 hover:text-gray-700",children:"Limpar"})]})})]}),t.jsxs("div",{className:"flex justify-end gap-3 p-4 sm:p-6 pt-4 border-t",children:[t.jsx(b.Button,{variant:"outline",onClick:$,children:"Cancelar"}),t.jsx(b.Button,{variant:"primary",onClick:O,disabled:!(e!=null&&e.from)||!(e!=null&&e.to),children:"Confirmar"})]})]})]})})}exports.RangeDatePicker=U;
|