@usetrip/react-ui 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/AlertBox.cjs +1 -0
  2. package/dist/AlertBox.d.ts +15 -0
  3. package/dist/AlertBox.js +5 -0
  4. package/dist/Button.cjs +1 -0
  5. package/dist/Button.d.ts +22 -0
  6. package/dist/Button.js +6 -0
  7. package/dist/ButtonLink.cjs +1 -0
  8. package/dist/ButtonLink.d.ts +25 -0
  9. package/dist/ButtonLink.js +6 -0
  10. package/dist/CalendarInput.cjs +1 -0
  11. package/dist/CalendarInput.d.ts +19 -0
  12. package/dist/CalendarInput.js +5 -0
  13. package/dist/CustomEditor.cjs +1 -0
  14. package/dist/CustomEditor.d.ts +16 -0
  15. package/dist/CustomEditor.js +5 -0
  16. package/dist/InputCounter.cjs +1 -0
  17. package/dist/InputCounter.d.ts +18 -0
  18. package/dist/InputCounter.js +5 -0
  19. package/dist/RangeDatePicker.cjs +1 -0
  20. package/dist/RangeDatePicker.d.ts +17 -0
  21. package/dist/RangeDatePicker.js +5 -0
  22. package/dist/SearchInput.cjs +1 -0
  23. package/dist/SearchInput.d.ts +15 -0
  24. package/dist/SearchInput.js +5 -0
  25. package/dist/TextField.cjs +1 -0
  26. package/dist/TextField.d.ts +27 -0
  27. package/dist/TextField.js +5 -0
  28. package/dist/Typography.cjs +1 -0
  29. package/dist/Typography.d.ts +25 -0
  30. package/dist/Typography.js +5 -0
  31. package/dist/chunks/AlertBox-TM5iLIH2.js +26 -0
  32. package/dist/chunks/AlertBox-b6dgMZ5I.cjs +1 -0
  33. package/dist/chunks/Button-C2ZQLgBk.js +75 -0
  34. package/dist/chunks/Button-DjizmSRN.cjs +1 -0
  35. package/dist/chunks/ButtonLink-C1BjiV2m.cjs +1 -0
  36. package/dist/chunks/ButtonLink-CG6S2pym.js +105 -0
  37. package/dist/chunks/CalendarInput-CPV0f1Gl.cjs +1 -0
  38. package/dist/chunks/CalendarInput-CxvAV7hK.js +58 -0
  39. package/dist/chunks/CustomEditor-BW_Mgv0y.cjs +1 -0
  40. package/dist/chunks/CustomEditor-q2MqCUUF.js +28 -0
  41. package/dist/chunks/InputCounter-6ZYoaiaX.js +46 -0
  42. package/dist/chunks/InputCounter-srYivV6j.cjs +1 -0
  43. package/dist/chunks/RangeDatePicker-CoEU93mq.cjs +1 -0
  44. package/dist/chunks/RangeDatePicker-DwccOp_Y.js +458 -0
  45. package/dist/chunks/SearchInput-5J5H9Yfv.js +55 -0
  46. package/dist/chunks/SearchInput-Dp1Q72Co.cjs +1 -0
  47. package/dist/chunks/TextField-DX6eZufy.js +145 -0
  48. package/dist/chunks/TextField-Dr3vhUtA.cjs +1 -0
  49. package/dist/chunks/Typography-B892BQsd.js +166 -0
  50. package/dist/chunks/Typography-CTDehHO_.cjs +1 -0
  51. package/dist/chunks/utils-D1b-iVvd.cjs +1 -0
  52. package/dist/chunks/utils-D9fNSpDp.js +8 -0
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.js +22 -1110
  55. package/package.json +52 -1
@@ -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;
@@ -0,0 +1,458 @@
1
+ import { jsx as a, jsxs as l } from "react/jsx-runtime";
2
+ import * as S from "react";
3
+ import { useState as N, useEffect as j } from "react";
4
+ import { ChevronLeftIcon as Y, ChevronRightIcon as A, ChevronDownIcon as F, XIcon as G, ChevronLeft as T, ChevronRight as B } from "lucide-react";
5
+ import { format as v } from "date-fns";
6
+ import { ptBR as p } from "date-fns/locale";
7
+ import { c as t } from "./utils-D9fNSpDp.js";
8
+ import { getDefaultClassNames as I, DayPicker as J } from "react-day-picker";
9
+ import { Slot as K } from "@radix-ui/react-slot";
10
+ import { cva as Q } from "class-variance-authority";
11
+ import * as _ from "@radix-ui/react-dialog";
12
+ import { B as y } from "./Button-C2ZQLgBk.js";
13
+ import { T as w } from "./Typography-B892BQsd.js";
14
+ const z = Q(
15
+ "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",
16
+ {
17
+ variants: {
18
+ variant: {
19
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
20
+ destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90",
21
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
22
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
23
+ ghost: "hover:bg-accent hover:text-accent-foreground",
24
+ link: "text-primary underline-offset-4 hover:underline"
25
+ },
26
+ size: {
27
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
28
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
29
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
30
+ icon: "size-9"
31
+ }
32
+ },
33
+ defaultVariants: {
34
+ variant: "default",
35
+ size: "default"
36
+ }
37
+ }
38
+ );
39
+ function U({
40
+ className: o,
41
+ variant: s,
42
+ size: d,
43
+ asChild: r = !1,
44
+ ...g
45
+ }) {
46
+ return /* @__PURE__ */ a(
47
+ r ? K : "button",
48
+ {
49
+ "data-slot": "button",
50
+ className: t(z({ variant: s, size: d, className: o })),
51
+ ...g
52
+ }
53
+ );
54
+ }
55
+ function $({
56
+ className: o,
57
+ classNames: s,
58
+ showOutsideDays: d = !0,
59
+ captionLayout: r = "label",
60
+ buttonVariant: g = "ghost",
61
+ formatters: x,
62
+ components: e,
63
+ ...b
64
+ }) {
65
+ const n = I();
66
+ return /* @__PURE__ */ a(
67
+ J,
68
+ {
69
+ showOutsideDays: d,
70
+ className: t(
71
+ "bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
72
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
73
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
74
+ o
75
+ ),
76
+ captionLayout: r,
77
+ formatters: {
78
+ formatMonthDropdown: (u) => u.toLocaleString("default", { month: "short" }),
79
+ ...x
80
+ },
81
+ classNames: {
82
+ root: t("w-fit", n.root),
83
+ months: t("flex gap-4 flex-col md:flex-row relative", n.months),
84
+ month: t("flex flex-col w-full gap-4", n.month),
85
+ nav: t(
86
+ "flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
87
+ n.nav
88
+ ),
89
+ button_previous: t(
90
+ z({ variant: g }),
91
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
92
+ n.button_previous
93
+ ),
94
+ button_next: t(
95
+ z({ variant: g }),
96
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
97
+ n.button_next
98
+ ),
99
+ month_caption: t(
100
+ "flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
101
+ n.month_caption
102
+ ),
103
+ dropdowns: t(
104
+ "w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
105
+ n.dropdowns
106
+ ),
107
+ dropdown_root: t(
108
+ "relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
109
+ n.dropdown_root
110
+ ),
111
+ dropdown: t("absolute inset-0 opacity-0", n.dropdown),
112
+ caption_label: t(
113
+ "select-none font-medium",
114
+ r === "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",
115
+ n.caption_label
116
+ ),
117
+ table: "w-full border-collapse",
118
+ weekdays: t("flex", n.weekdays),
119
+ weekday: t(
120
+ "text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
121
+ n.weekday
122
+ ),
123
+ week: t("flex w-full mt-2", n.week),
124
+ week_number_header: t("select-none w-(--cell-size)", n.week_number_header),
125
+ week_number: t(
126
+ "text-[0.8rem] select-none text-muted-foreground",
127
+ n.week_number
128
+ ),
129
+ day: t(
130
+ "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",
131
+ n.day
132
+ ),
133
+ range_start: t(
134
+ "rounded-l-md rounded-r-none bg-gray-800 text-white !border-none !outline-none !ring-0 !shadow-none",
135
+ n.range_start
136
+ ),
137
+ range_middle: t(
138
+ "rounded-none bg-gray-400 text-white !border-none !outline-none !ring-0 !shadow-none",
139
+ n.range_middle
140
+ ),
141
+ range_end: t(
142
+ "rounded-r-md rounded-l-none bg-gray-800 text-white !border-none !outline-none !ring-0 !shadow-none",
143
+ n.range_end
144
+ ),
145
+ today: t("bg-gray-600 text-white font-bold shadow-lg !rounded-md", n.today),
146
+ selected: t(
147
+ "!bg-transparent !text-black !font-bold !shadow-none !border-2 !border-gray-600 !rounded-md",
148
+ n.selected
149
+ ),
150
+ outside: t(
151
+ "text-muted-foreground aria-selected:text-muted-foreground",
152
+ n.outside
153
+ ),
154
+ disabled: t("text-muted-foreground opacity-50", n.disabled),
155
+ hidden: t("invisible", n.hidden),
156
+ ...s
157
+ },
158
+ components: {
159
+ Root: ({ className: u, rootRef: f, ...h }) => /* @__PURE__ */ a("div", { "data-slot": "calendar", ref: f, className: t(u), ...h }),
160
+ Chevron: ({ className: u, orientation: f, ...h }) => f === "left" ? /* @__PURE__ */ a(Y, { className: t("size-4", u), ...h }) : f === "right" ? /* @__PURE__ */ a(A, { className: t("size-4", u), ...h }) : /* @__PURE__ */ a(F, { className: t("size-4", u), ...h }),
161
+ DayButton: Z,
162
+ WeekNumber: ({ children: u, ...f }) => /* @__PURE__ */ a("td", { ...f, children: /* @__PURE__ */ a("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: u }) }),
163
+ ...e
164
+ },
165
+ ...b
166
+ }
167
+ );
168
+ }
169
+ function Z({
170
+ className: o,
171
+ day: s,
172
+ modifiers: d,
173
+ ...r
174
+ }) {
175
+ const g = I(), x = S.useRef(null);
176
+ return S.useEffect(() => {
177
+ var e;
178
+ d.focused && ((e = x.current) == null || e.focus());
179
+ }, [d.focused]), /* @__PURE__ */ a(
180
+ U,
181
+ {
182
+ ref: x,
183
+ variant: "ghost",
184
+ size: "icon",
185
+ "data-day": s.date.toLocaleDateString(),
186
+ "data-today": d.today,
187
+ "data-selected-single": d.selected && !d.range_start && !d.range_end && !d.range_middle,
188
+ "data-range-start": d.range_start,
189
+ "data-range-end": d.range_end,
190
+ "data-range-middle": d.range_middle,
191
+ className: t(
192
+ "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",
193
+ g.day,
194
+ o
195
+ ),
196
+ ...r
197
+ }
198
+ );
199
+ }
200
+ function R({ ...o }) {
201
+ return /* @__PURE__ */ a(_.Root, { "data-slot": "dialog", ...o });
202
+ }
203
+ function P({ ...o }) {
204
+ return /* @__PURE__ */ a(_.Portal, { "data-slot": "dialog-portal", ...o });
205
+ }
206
+ function L({
207
+ className: o,
208
+ ...s
209
+ }) {
210
+ return /* @__PURE__ */ a(
211
+ _.Overlay,
212
+ {
213
+ "data-slot": "dialog-overlay",
214
+ className: t(
215
+ "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",
216
+ o
217
+ ),
218
+ ...s
219
+ }
220
+ );
221
+ }
222
+ function ee({
223
+ className: o,
224
+ children: s,
225
+ showCloseButton: d = !1,
226
+ ...r
227
+ }) {
228
+ return /* @__PURE__ */ l(P, { "data-slot": "dialog-portal", children: [
229
+ /* @__PURE__ */ a(L, {}),
230
+ /* @__PURE__ */ l(
231
+ _.Content,
232
+ {
233
+ "data-slot": "dialog-content",
234
+ className: t(
235
+ "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",
236
+ o
237
+ ),
238
+ ...r,
239
+ children: [
240
+ s,
241
+ d && /* @__PURE__ */ l(
242
+ _.Close,
243
+ {
244
+ "data-slot": "dialog-close",
245
+ 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",
246
+ children: [
247
+ /* @__PURE__ */ a(G, {}),
248
+ /* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
249
+ ]
250
+ }
251
+ )
252
+ ]
253
+ }
254
+ )
255
+ ] });
256
+ }
257
+ function te({ className: o, ...s }) {
258
+ return /* @__PURE__ */ a(
259
+ "div",
260
+ {
261
+ "data-slot": "dialog-header",
262
+ className: t("flex flex-col gap-2 text-center sm:text-left p-4 pb-4", o),
263
+ ...s
264
+ }
265
+ );
266
+ }
267
+ function ae({
268
+ className: o,
269
+ ...s
270
+ }) {
271
+ return /* @__PURE__ */ a(
272
+ _.Title,
273
+ {
274
+ "data-slot": "dialog-title",
275
+ className: t("text-lg leading-none font-semibold", o),
276
+ ...s
277
+ }
278
+ );
279
+ }
280
+ function ge({
281
+ isOpen: o,
282
+ onClose: s,
283
+ onSelect: d,
284
+ initialRange: r,
285
+ focusedField: g,
286
+ minDate: x
287
+ }) {
288
+ const [e, b] = N(r), [n, u] = N((r == null ? void 0 : r.from) || /* @__PURE__ */ new Date()), [f, h] = N((r == null ? void 0 : r.from) || /* @__PURE__ */ new Date());
289
+ j(() => {
290
+ r && b(r);
291
+ }, [r]), j(() => {
292
+ if (!o) return;
293
+ const c = (g === "end" ? (r == null ? void 0 : r.to) || (r == null ? void 0 : r.from) : (r == null ? void 0 : r.from) || (r == null ? void 0 : r.to)) || /* @__PURE__ */ new Date();
294
+ u(c), h(c);
295
+ }, [o, r, g]);
296
+ const M = (m) => {
297
+ if (!m && (e != null && e.from) && (!e.to || e.from.getTime() === e.to.getTime())) {
298
+ b({ from: e.from, to: e.from });
299
+ return;
300
+ }
301
+ b(m);
302
+ }, O = () => {
303
+ d(e), s();
304
+ }, H = () => {
305
+ b(r), s();
306
+ }, q = () => b(void 0), D = (m) => {
307
+ h((c) => {
308
+ const i = new Date(c);
309
+ return i.setMonth(i.getMonth() + (m === "prev" ? -1 : 1)), i;
310
+ });
311
+ }, k = (m) => {
312
+ u((c) => {
313
+ const i = new Date(c);
314
+ return i.setMonth(i.getMonth() + (m === "prev" ? -1 : 1)), i;
315
+ });
316
+ }, E = () => e != null && e.from ? e.to ? `${v(e.from, "dd/MM/yyyy", { locale: p })} - ${v(e.to, "dd/MM/yyyy", { locale: p })}` : v(e.from, "dd/MM/yyyy", { locale: p }) : "Selecione as datas", V = () => {
317
+ if (!(e != null && e.from) && !(e != null && e.to)) return "Selecione a data de início";
318
+ if (e != null && e.from && !(e != null && e.to)) return "Selecione a data de fim";
319
+ if (e != null && e.from && (e != null && e.to)) {
320
+ const m = e.from instanceof Date ? e.from : new Date(e.from), c = e.to instanceof Date ? e.to : new Date(e.to), i = Math.ceil((c.getTime() - m.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
321
+ return `${i} dia${i > 1 ? "s" : ""} selecionado${i > 1 ? "s" : ""}`;
322
+ }
323
+ return "";
324
+ }, C = (m) => {
325
+ if (x) {
326
+ const c = new Date(x);
327
+ c.setHours(0, 0, 0, 0);
328
+ const i = new Date(m);
329
+ return i.setHours(0, 0, 0, 0), i < c;
330
+ }
331
+ return !1;
332
+ }, W = {
333
+ months: "flex w-full justify-center",
334
+ month: "w-full space-y-4",
335
+ month_caption: "hidden",
336
+ nav: "hidden",
337
+ table: "w-full border-collapse space-y-1",
338
+ head_row: "flex w-full",
339
+ head_cell: "text-muted-foreground rounded-md w-full font-normal text-[0.8rem] flex-1 text-center py-2",
340
+ row: "flex w-full mt-2",
341
+ cell: t("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 flex-1 !border-none !outline-none"),
342
+ day: t("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"),
343
+ day_range_start: "day-range-start rounded-l-md bg-gray-800 text-white !border-none !outline-none !ring-0",
344
+ day_range_end: "day-range-end rounded-r-md bg-gray-800 text-white !border-none !outline-none !ring-0",
345
+ day_selected: "!bg-gray-600 !text-white !font-bold !shadow-lg !rounded-md !border-none !outline-none !ring-0",
346
+ today: "bg-gray-600 text-white font-bold shadow-lg rounded-md",
347
+ day_outside: "text-muted-foreground opacity-50",
348
+ day_disabled: "text-muted-foreground opacity-50",
349
+ day_range_middle: "aria-selected:bg-gray-400 aria-selected:text-white rounded-none !border-none !outline-none !ring-0",
350
+ day_hidden: "invisible"
351
+ }, X = {
352
+ months: "flex gap-6 justify-center",
353
+ month: "flex flex-col gap-4",
354
+ month_caption: "sm:hidden",
355
+ nav: "hidden",
356
+ table: "w-full border-collapse space-y-1",
357
+ head_row: "flex",
358
+ head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem] text-center",
359
+ row: "flex w-full mt-2",
360
+ cell: t("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 !border-none !outline-none"),
361
+ day: t("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"),
362
+ day_range_start: "day-range-start rounded-l-md bg-gray-800 text-white !border-none !outline-none !ring-0",
363
+ day_range_end: "day-range-end rounded-r-md bg-gray-800 text-white !border-none !outline-none !ring-0",
364
+ day_selected: "!bg-gray-600 !text-white !font-bold !shadow-lg !rounded-md !border-none !outline-none !ring-0",
365
+ today: "bg-gray-600 text-white font-bold !rounded-md",
366
+ day_outside: "hidden",
367
+ day_disabled: "text-muted-foreground opacity-50",
368
+ day_range_middle: "aria-selected:bg-gray-400 aria-selected:text-white rounded-none !border-none !outline-none !ring-0",
369
+ day_hidden: "invisible"
370
+ };
371
+ return /* @__PURE__ */ a(R, { open: o, onOpenChange: s, children: /* @__PURE__ */ l(P, { children: [
372
+ /* @__PURE__ */ a(L, { className: "max-sm:!z-[9999]" }),
373
+ /* @__PURE__ */ l(ee, { 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: [
374
+ /* @__PURE__ */ l(te, { className: "p-4 sm:p-6 pb-4", children: [
375
+ /* @__PURE__ */ a(ae, { className: "text-lg text-left font-semibold", children: "Selecionar Período" }),
376
+ /* @__PURE__ */ a(w, { variant: "body2", className: "text-gray-600", children: V() })
377
+ ] }),
378
+ /* @__PURE__ */ l("div", { className: "px-4 sm:px-6", children: [
379
+ /* @__PURE__ */ l("div", { className: "block md:hidden", children: [
380
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between mb-4", children: [
381
+ /* @__PURE__ */ a(y, { variant: "outline", size: "sm", onClick: () => D("prev"), className: "p-2", children: /* @__PURE__ */ a(T, { className: "h-4 w-4" }) }),
382
+ /* @__PURE__ */ a(w, { variant: "h5", className: "font-medium", children: v(f, "MMMM yyyy", { locale: p }) }),
383
+ /* @__PURE__ */ a(y, { variant: "outline", size: "sm", onClick: () => D("next"), className: "p-2", children: /* @__PURE__ */ a(B, { className: "h-4 w-4" }) })
384
+ ] }),
385
+ /* @__PURE__ */ a(
386
+ $,
387
+ {
388
+ mode: "range",
389
+ defaultMonth: f,
390
+ month: f,
391
+ onMonthChange: h,
392
+ selected: e,
393
+ onSelect: M,
394
+ numberOfMonths: 1,
395
+ locale: p,
396
+ disabled: C,
397
+ className: "mx-auto",
398
+ classNames: W
399
+ }
400
+ )
401
+ ] }),
402
+ /* @__PURE__ */ l("div", { className: "hidden md:flex flex-col min-h-[320px]", children: [
403
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-center", children: [
404
+ /* @__PURE__ */ a(y, { variant: "outline", size: "sm", onClick: () => k("prev"), className: "p-2 mr-3", children: /* @__PURE__ */ a(T, { className: "h-4 w-4" }) }),
405
+ /* @__PURE__ */ l("div", { className: "flex gap-8", children: [
406
+ /* @__PURE__ */ a(w, { variant: "h5", className: "font-medium min-w-[120px] text-center", children: v(n, "MMMM yyyy", { locale: p }) }),
407
+ /* @__PURE__ */ a(w, { variant: "h5", className: "font-medium min-w-[120px] text-center", children: v(
408
+ new Date(n.getFullYear(), n.getMonth() + 1),
409
+ "MMMM yyyy",
410
+ { locale: p }
411
+ ) })
412
+ ] }),
413
+ /* @__PURE__ */ a(y, { variant: "outline", size: "sm", onClick: () => k("next"), className: "p-2 ml-3", children: /* @__PURE__ */ a(B, { className: "h-4 w-4" }) })
414
+ ] }),
415
+ /* @__PURE__ */ a(
416
+ $,
417
+ {
418
+ mode: "range",
419
+ defaultMonth: n,
420
+ month: n,
421
+ onMonthChange: u,
422
+ selected: e,
423
+ onSelect: M,
424
+ numberOfMonths: 2,
425
+ showOutsideDays: !1,
426
+ locale: p,
427
+ disabled: C,
428
+ className: "w-full justify-center",
429
+ classNames: X
430
+ }
431
+ )
432
+ ] }),
433
+ /* @__PURE__ */ a("div", { className: "mb-6 p-4 bg-gray-200 rounded-lg", children: /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
434
+ /* @__PURE__ */ l("div", { className: "flex-1", children: [
435
+ /* @__PURE__ */ a(w, { variant: "body2", className: "text-gray-600 mb-1", children: "Período selecionado:" }),
436
+ /* @__PURE__ */ a(w, { variant: "body1", className: "font-medium max-sm:text-sm", children: E() })
437
+ ] }),
438
+ (e == null ? void 0 : e.from) && /* @__PURE__ */ a(y, { variant: "secondary", size: "sm", onClick: q, className: "text-white bg-gray-400 hover:text-gray-700", children: "Limpar" })
439
+ ] }) })
440
+ ] }),
441
+ /* @__PURE__ */ l("div", { className: "flex justify-end gap-3 p-4 sm:p-6 pt-4 border-t", children: [
442
+ /* @__PURE__ */ a(y, { variant: "outline", onClick: H, children: "Cancelar" }),
443
+ /* @__PURE__ */ a(
444
+ y,
445
+ {
446
+ variant: "primary",
447
+ onClick: O,
448
+ disabled: !(e != null && e.from) || !(e != null && e.to),
449
+ children: "Confirmar"
450
+ }
451
+ )
452
+ ] })
453
+ ] })
454
+ ] }) });
455
+ }
456
+ export {
457
+ ge as R
458
+ };
@@ -0,0 +1,55 @@
1
+ import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
+ import { Search as m } from "lucide-react";
3
+ import { forwardRef as i } from "react";
4
+ import { c as s } from "./utils-D9fNSpDp.js";
5
+ const d = i(
6
+ ({ placeholder: n = "Digite...", variant: t = "default", size: r = "md", className: a, ...l }, c) => {
7
+ const o = () => {
8
+ switch (r) {
9
+ case "sm":
10
+ return "h-9 text-sm";
11
+ case "md":
12
+ return "h-12 text-base";
13
+ case "lg":
14
+ return "h-14 text-lg";
15
+ default:
16
+ return "h-12";
17
+ }
18
+ };
19
+ return /* @__PURE__ */ u("div", { className: s("relative flex", (() => {
20
+ switch (r) {
21
+ case "sm":
22
+ return "w-40";
23
+ case "md":
24
+ return "w-64";
25
+ case "lg":
26
+ return "w-80";
27
+ case "full":
28
+ return "w-full";
29
+ default:
30
+ return "w-64";
31
+ }
32
+ })(), a), children: [
33
+ /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ e(m, { className: "h-4 w-4 text-gray-400" }) }),
34
+ /* @__PURE__ */ e(
35
+ "input",
36
+ {
37
+ ref: c,
38
+ type: "text",
39
+ placeholder: n,
40
+ className: s(
41
+ "bg-gray-100 pl-10 pr-4 text-sm focus:outline-none focus:ring-2 focus:ring-[#3f52e3] transition-colors rounded-md w-full",
42
+ o(),
43
+ t === "default" && "rounded-sm",
44
+ t === "compact" && "rounded-md"
45
+ ),
46
+ ...l
47
+ }
48
+ )
49
+ ] });
50
+ }
51
+ );
52
+ d.displayName = "SearchInput";
53
+ export {
54
+ d as S
55
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("lucide-react"),m=require("react"),r=require("./utils-D1b-iVvd.cjs"),n=m.forwardRef(({placeholder:c="Digite...",variant:t="default",size:s="md",className:u,...a},l)=>{const i=()=>{switch(s){case"sm":return"h-9 text-sm";case"md":return"h-12 text-base";case"lg":return"h-14 text-lg";default:return"h-12"}},d=()=>{switch(s){case"sm":return"w-40";case"md":return"w-64";case"lg":return"w-80";case"full":return"w-full";default:return"w-64"}};return e.jsxs("div",{className:r.cn("relative flex",d(),u),children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(o.Search,{className:"h-4 w-4 text-gray-400"})}),e.jsx("input",{ref:l,type:"text",placeholder:c,className:r.cn("bg-gray-100 pl-10 pr-4 text-sm focus:outline-none focus:ring-2 focus:ring-[#3f52e3] transition-colors rounded-md w-full",i(),t==="default"&&"rounded-sm",t==="compact"&&"rounded-md"),...a})]})});n.displayName="SearchInput";exports.SearchInput=n;