@clasing/ui 0.1.123 → 0.1.124

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 (137) hide show
  1. package/dist/badge-BnerQ2lF.js +85 -0
  2. package/dist/badge-Czof3oqL.cjs +1 -0
  3. package/dist/button-Cegl49Yi.cjs +1 -0
  4. package/dist/button-DddHyyHa.js +504 -0
  5. package/dist/calendar-BAQkzm4v.js +117 -0
  6. package/dist/calendar-DL8gqdRp.cjs +1 -0
  7. package/dist/card-BCgtou88.cjs +1 -0
  8. package/dist/card-BfBXE5Kq.js +90 -0
  9. package/dist/chip-A32aAc-8.cjs +1 -0
  10. package/dist/chip-ZZHZ8i1Q.js +127 -0
  11. package/dist/command-BGCSJ9vX.js +506 -0
  12. package/dist/command-D9M8dk1M.cjs +1 -0
  13. package/dist/components/accordion.cjs.js +1 -0
  14. package/dist/components/accordion.es.js +70 -0
  15. package/dist/components/alert-dialog.cjs.js +1 -0
  16. package/dist/components/alert-dialog.es.js +146 -0
  17. package/dist/components/alert.cjs.js +1 -0
  18. package/dist/components/alert.es.js +97 -0
  19. package/dist/components/avatar.cjs.js +1 -0
  20. package/dist/components/avatar.es.js +53 -0
  21. package/dist/components/badge.cjs.js +1 -0
  22. package/dist/components/badge.es.js +4 -0
  23. package/dist/components/blocks/date-picker.cjs.js +1 -0
  24. package/dist/components/blocks/date-picker.es.js +181 -0
  25. package/dist/components/blocks/date-range-picker.cjs.js +1 -0
  26. package/dist/components/blocks/date-range-picker.es.js +238 -0
  27. package/dist/components/blocks/interactive-card.cjs.js +1 -0
  28. package/dist/components/blocks/interactive-card.es.js +138 -0
  29. package/dist/components/blocks/selectable-chips.cjs.js +1 -0
  30. package/dist/components/blocks/selectable-chips.es.js +57 -0
  31. package/dist/components/breadcrumb.cjs.js +1 -0
  32. package/dist/components/breadcrumb.es.js +106 -0
  33. package/dist/components/button.cjs.js +1 -0
  34. package/dist/components/button.es.js +7 -0
  35. package/dist/components/calendar.cjs.js +1 -0
  36. package/dist/components/calendar.es.js +4 -0
  37. package/dist/components/card.cjs.js +1 -0
  38. package/dist/components/card.es.js +10 -0
  39. package/dist/components/chart.cjs.js +7 -0
  40. package/dist/components/chart.es.js +213 -0
  41. package/dist/components/checkbox.cjs.js +1 -0
  42. package/dist/components/checkbox.es.js +31 -0
  43. package/dist/components/chip.cjs.js +1 -0
  44. package/dist/components/chip.es.js +5 -0
  45. package/dist/components/collapsible.cjs.js +1 -0
  46. package/dist/components/collapsible.es.js +34 -0
  47. package/dist/components/command.cjs.js +1 -0
  48. package/dist/components/command.es.js +12 -0
  49. package/dist/components/context-menu.cjs.js +1 -0
  50. package/dist/components/context-menu.es.js +229 -0
  51. package/dist/components/dialog.cjs.js +1 -0
  52. package/dist/components/dialog.es.js +13 -0
  53. package/dist/components/divider.cjs.js +1 -0
  54. package/dist/components/divider.es.js +21 -0
  55. package/dist/components/drawer.cjs.js +3 -0
  56. package/dist/components/drawer.es.js +1161 -0
  57. package/dist/components/dropdown-menu.cjs.js +1 -0
  58. package/dist/components/dropdown-menu.es.js +237 -0
  59. package/dist/components/hover-card.cjs.js +1 -0
  60. package/dist/components/hover-card.es.js +38 -0
  61. package/dist/components/icon-component.cjs.js +1 -0
  62. package/dist/components/icon-component.es.js +4 -0
  63. package/dist/components/input-otp.cjs.js +20 -0
  64. package/dist/components/input-otp.es.js +253 -0
  65. package/dist/components/input.cjs.js +1 -0
  66. package/dist/components/input.es.js +4 -0
  67. package/dist/components/label.cjs.js +1 -0
  68. package/dist/components/label.es.js +4 -0
  69. package/dist/components/menubar.cjs.js +1 -0
  70. package/dist/components/menubar.es.js +257 -0
  71. package/dist/components/multi-select.cjs.js +1 -0
  72. package/dist/components/multi-select.es.js +233 -0
  73. package/dist/components/navigation-menu.cjs.js +1 -0
  74. package/dist/components/navigation-menu.es.js +171 -0
  75. package/dist/components/phone-input.cjs.js +1 -0
  76. package/dist/components/phone-input.es.js +253 -0
  77. package/dist/components/popover.cjs.js +1 -0
  78. package/dist/components/popover.es.js +7 -0
  79. package/dist/components/progress.cjs.js +1 -0
  80. package/dist/components/progress.es.js +31 -0
  81. package/dist/components/resizable.cjs.js +1 -0
  82. package/dist/components/resizable.es.js +1551 -0
  83. package/dist/components/scroll-area.cjs.js +1 -0
  84. package/dist/components/scroll-area.es.js +5 -0
  85. package/dist/components/select.cjs.js +1 -0
  86. package/dist/components/select.es.js +179 -0
  87. package/dist/components/sheet.cjs.js +1 -0
  88. package/dist/components/sheet.es.js +126 -0
  89. package/dist/components/skeleton.cjs.js +1 -0
  90. package/dist/components/skeleton.es.js +15 -0
  91. package/dist/components/slider.cjs.js +1 -0
  92. package/dist/components/slider.es.js +63 -0
  93. package/dist/components/sonner.cjs.js +1 -0
  94. package/dist/components/sonner.es.js +68 -0
  95. package/dist/components/switch.cjs.js +1 -0
  96. package/dist/components/switch.es.js +82 -0
  97. package/dist/components/table.cjs.js +1 -0
  98. package/dist/components/table.es.js +114 -0
  99. package/dist/components/toggle-group.cjs.js +1 -0
  100. package/dist/components/toggle-group.es.js +62 -0
  101. package/dist/components/toggle.cjs.js +1 -0
  102. package/dist/components/toggle.es.js +5 -0
  103. package/dist/components/tooltip.cjs.js +1 -0
  104. package/dist/components/tooltip.es.js +7 -0
  105. package/dist/dialog-BKm2PZl2.cjs +1 -0
  106. package/dist/dialog-DZpF7OXg.js +136 -0
  107. package/dist/hooks/useOutsideClick.cjs.js +1 -0
  108. package/dist/hooks/useOutsideClick.es.js +14 -0
  109. package/dist/icon-component-BZ-4FDV6.js +49 -0
  110. package/dist/icon-component-LY_vGYHZ.cjs +1 -0
  111. package/dist/index-BqtVL8d-.js +34 -0
  112. package/dist/index-C8P6Mn4U.cjs +1 -0
  113. package/dist/index-CRiPKpXj.js +2743 -0
  114. package/dist/index-DoxiiusW.cjs +1 -0
  115. package/dist/input-DFPJ_mtM.cjs +1 -0
  116. package/dist/input-DwPDvbRE.js +174 -0
  117. package/dist/jsx-runtime-C5mzlN2N.js +284 -0
  118. package/dist/jsx-runtime-DUiatUiq.cjs +22 -0
  119. package/dist/label-BpDUqtrC.js +22 -0
  120. package/dist/label-CbzkBbPT.cjs +1 -0
  121. package/dist/popover-B8wp2cHF.cjs +1 -0
  122. package/dist/popover-BoDRCUh2.js +44 -0
  123. package/dist/scroll-area-CNsThIs_.js +60 -0
  124. package/dist/scroll-area-Dr-7opp_.cjs +1 -0
  125. package/dist/style-BNIXVvBA.js +1172 -0
  126. package/dist/style-CA5976Oh.cjs +1 -0
  127. package/dist/toggle-Dgd7L2Mq.cjs +1 -0
  128. package/dist/toggle-DjbiWYXD.js +44 -0
  129. package/dist/tooltip-Btr9ROSo.js +55 -0
  130. package/dist/tooltip-W9iE1O--.cjs +1 -0
  131. package/dist/ui.css +427 -16
  132. package/dist/utils/types.cjs.js +1 -0
  133. package/dist/utils/types.es.js +1 -0
  134. package/package.json +299 -37
  135. package/dist/index.d.ts +0 -566
  136. package/dist/index.es.js +0 -7538
  137. package/dist/index.umd.js +0 -22
@@ -0,0 +1,146 @@
1
+ import { j as e } from "../jsx-runtime-C5mzlN2N.js";
2
+ import * as o from "@radix-ui/react-alert-dialog";
3
+ import { c as r } from "../button-DddHyyHa.js";
4
+ import { c as l } from "../index-CRiPKpXj.js";
5
+ function g({
6
+ ...t
7
+ }) {
8
+ return /* @__PURE__ */ e.jsx(o.Root, { "data-slot": "alert-dialog", ...t });
9
+ }
10
+ function u({
11
+ ...t
12
+ }) {
13
+ return /* @__PURE__ */ e.jsx(o.Trigger, { "data-slot": "alert-dialog-trigger", ...t });
14
+ }
15
+ function n({
16
+ ...t
17
+ }) {
18
+ return /* @__PURE__ */ e.jsx(o.Portal, { "data-slot": "alert-dialog-portal", ...t });
19
+ }
20
+ function s({
21
+ className: t,
22
+ ...a
23
+ }) {
24
+ return /* @__PURE__ */ e.jsx(
25
+ o.Overlay,
26
+ {
27
+ "data-slot": "alert-dialog-overlay",
28
+ className: l(
29
+ "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-50 bg-black/50",
30
+ t
31
+ ),
32
+ ...a
33
+ }
34
+ );
35
+ }
36
+ function m({
37
+ className: t,
38
+ ...a
39
+ }) {
40
+ return /* @__PURE__ */ e.jsxs(n, { children: [
41
+ /* @__PURE__ */ e.jsx(s, {}),
42
+ /* @__PURE__ */ e.jsx(
43
+ o.Content,
44
+ {
45
+ "data-slot": "alert-dialog-content",
46
+ className: l(
47
+ "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-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
48
+ t
49
+ ),
50
+ ...a
51
+ }
52
+ )
53
+ ] });
54
+ }
55
+ function f({
56
+ className: t,
57
+ ...a
58
+ }) {
59
+ return /* @__PURE__ */ e.jsx(
60
+ "div",
61
+ {
62
+ "data-slot": "alert-dialog-header",
63
+ className: l("flex flex-col gap-2 text-center sm:text-left", t),
64
+ ...a
65
+ }
66
+ );
67
+ }
68
+ function x({
69
+ className: t,
70
+ ...a
71
+ }) {
72
+ return /* @__PURE__ */ e.jsx(
73
+ "div",
74
+ {
75
+ "data-slot": "alert-dialog-footer",
76
+ className: l(
77
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
78
+ t
79
+ ),
80
+ ...a
81
+ }
82
+ );
83
+ }
84
+ function p({
85
+ className: t,
86
+ ...a
87
+ }) {
88
+ return /* @__PURE__ */ e.jsx(
89
+ o.Title,
90
+ {
91
+ "data-slot": "alert-dialog-title",
92
+ className: l("text-lg font-semibold", t),
93
+ ...a
94
+ }
95
+ );
96
+ }
97
+ function j({
98
+ className: t,
99
+ ...a
100
+ }) {
101
+ return /* @__PURE__ */ e.jsx(
102
+ o.Description,
103
+ {
104
+ "data-slot": "alert-dialog-description",
105
+ className: l("text-muted-foreground text-sm", t),
106
+ ...a
107
+ }
108
+ );
109
+ }
110
+ function A({
111
+ className: t,
112
+ ...a
113
+ }) {
114
+ return /* @__PURE__ */ e.jsx(
115
+ o.Action,
116
+ {
117
+ className: l(r(), t),
118
+ ...a
119
+ }
120
+ );
121
+ }
122
+ function D({
123
+ className: t,
124
+ ...a
125
+ }) {
126
+ return /* @__PURE__ */ e.jsx(
127
+ o.Cancel,
128
+ {
129
+ className: l(r({ variant: "outline" }), t),
130
+ ...a
131
+ }
132
+ );
133
+ }
134
+ export {
135
+ g as AlertDialog,
136
+ A as AlertDialogAction,
137
+ D as AlertDialogCancel,
138
+ m as AlertDialogContent,
139
+ j as AlertDialogDescription,
140
+ x as AlertDialogFooter,
141
+ f as AlertDialogHeader,
142
+ s as AlertDialogOverlay,
143
+ n as AlertDialogPortal,
144
+ p as AlertDialogTitle,
145
+ u as AlertDialogTrigger
146
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../jsx-runtime-DUiatUiq.cjs"),s=require("../index-DoxiiusW.cjs"),d=require("../index-C8P6Mn4U.cjs"),g=require("../icon-component-LY_vGYHZ.cjs"),m=d.cva("relative grid w-full grid-cols-[0_1fr] items-start gap-y-2 rounded-2xl px-6 py-6 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*5)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-5 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{info:"bg-blue-050 text-content-text-default",success:"bg-success-light text-content-text-default",warning:"bg-warning-light text-content-text-default",error:"bg-error-light text-content-text-default",neutral:"bg-neutral-000 text-content-text-default"}},defaultVariants:{variant:"neutral"}}),p={info:"IconInfoCircleFilled",success:"IconCircleCheckFilled",warning:"IconAlertTriangleFilled",error:"IconAlertCircleFilled",neutral:"IconHelpCircleFilled"},f={info:"text-blue-800",success:"text-success-main",warning:"text-warning-main",error:"text-error-main",neutral:"text-black"};function j({className:r,title:e,content:l,variant:n="neutral",showIcon:c,iconName:o,children:x,...u}){return t.jsxRuntimeExports.jsxs("div",{"data-slot":"alert",role:"alert",className:s.cn(m({variant:n}),r),...u,children:[c&&n&&t.jsxRuntimeExports.jsx(g.IconComponent,{className:s.cn("max-w-5 min-w-5",f[n]),iconName:o??p[n],size:20}),e&&t.jsxRuntimeExports.jsx(i,{children:t.jsxRuntimeExports.jsx("p",{className:"text-label-lg font-semibold",children:e})}),l&&t.jsxRuntimeExports.jsx(a,{children:t.jsxRuntimeExports.jsx("p",{className:"text-paragraph-sm",children:l})}),x]})}function i({className:r,...e}){return t.jsxRuntimeExports.jsx("div",{"data-slot":"alert-title",className:s.cn("text-label-lg col-start-2 font-semibold",r),...e})}function a({className:r,...e}){return t.jsxRuntimeExports.jsx("div",{"data-slot":"alert-description",className:s.cn("text-paragraph-sm col-start-2 grid justify-items-start gap-1",r),...e})}exports.Alert=j;exports.AlertDescription=a;exports.AlertTitle=i;
@@ -0,0 +1,97 @@
1
+ import { j as t } from "../jsx-runtime-C5mzlN2N.js";
2
+ import { c as l } from "../index-CRiPKpXj.js";
3
+ import { c as x } from "../index-BqtVL8d-.js";
4
+ import { I as d } from "../icon-component-BZ-4FDV6.js";
5
+ const g = x(
6
+ "relative grid w-full grid-cols-[0_1fr] items-start gap-y-2 rounded-2xl px-6 py-6 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*5)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-5 [&>svg]:translate-y-0.5 [&>svg]:text-current",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ info: "bg-blue-050 text-content-text-default",
11
+ success: "bg-success-light text-content-text-default",
12
+ warning: "bg-warning-light text-content-text-default",
13
+ error: "bg-error-light text-content-text-default",
14
+ neutral: "bg-neutral-000 text-content-text-default"
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ variant: "neutral"
19
+ }
20
+ }
21
+ ), u = {
22
+ info: "IconInfoCircleFilled",
23
+ success: "IconCircleCheckFilled",
24
+ warning: "IconAlertTriangleFilled",
25
+ error: "IconAlertCircleFilled",
26
+ neutral: "IconHelpCircleFilled"
27
+ }, m = {
28
+ info: "text-blue-800",
29
+ success: "text-success-main",
30
+ warning: "text-warning-main",
31
+ error: "text-error-main",
32
+ neutral: "text-black"
33
+ };
34
+ function w({
35
+ className: r,
36
+ title: e,
37
+ content: s,
38
+ variant: a = "neutral",
39
+ showIcon: n,
40
+ iconName: i,
41
+ children: c,
42
+ ...o
43
+ }) {
44
+ return /* @__PURE__ */ t.jsxs(
45
+ "div",
46
+ {
47
+ "data-slot": "alert",
48
+ role: "alert",
49
+ className: l(g({ variant: a }), r),
50
+ ...o,
51
+ children: [
52
+ n && a && /* @__PURE__ */ t.jsx(
53
+ d,
54
+ {
55
+ className: l("max-w-5 min-w-5", m[a]),
56
+ iconName: i ?? u[a],
57
+ size: 20
58
+ }
59
+ ),
60
+ e && /* @__PURE__ */ t.jsx(p, { children: /* @__PURE__ */ t.jsx("p", { className: "text-label-lg font-semibold", children: e }) }),
61
+ s && /* @__PURE__ */ t.jsx(f, { children: /* @__PURE__ */ t.jsx("p", { className: "text-paragraph-sm", children: s }) }),
62
+ c
63
+ ]
64
+ }
65
+ );
66
+ }
67
+ function p({ className: r, ...e }) {
68
+ return /* @__PURE__ */ t.jsx(
69
+ "div",
70
+ {
71
+ "data-slot": "alert-title",
72
+ className: l("text-label-lg col-start-2 font-semibold", r),
73
+ ...e
74
+ }
75
+ );
76
+ }
77
+ function f({
78
+ className: r,
79
+ ...e
80
+ }) {
81
+ return /* @__PURE__ */ t.jsx(
82
+ "div",
83
+ {
84
+ "data-slot": "alert-description",
85
+ className: l(
86
+ "text-paragraph-sm col-start-2 grid justify-items-start gap-1",
87
+ r
88
+ ),
89
+ ...e
90
+ }
91
+ );
92
+ }
93
+ export {
94
+ w as Alert,
95
+ f as AlertDescription,
96
+ p as AlertTitle
97
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../jsx-runtime-DUiatUiq.cjs"),i=require("@radix-ui/react-avatar"),n=require("../index-DoxiiusW.cjs");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const s=o(i);function u({className:e,...t}){return r.jsxRuntimeExports.jsx(s.Root,{"data-slot":"avatar",className:n.cn("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function c({className:e,...t}){return r.jsxRuntimeExports.jsx(s.Image,{"data-slot":"avatar-image",className:n.cn("aspect-square size-full",e),...t})}function f({className:e,...t}){return r.jsxRuntimeExports.jsx(s.Fallback,{"data-slot":"avatar-fallback",className:n.cn("bg-muted text-paragraph-sm flex size-full items-center justify-center rounded-full",e),...t})}exports.Avatar=u;exports.AvatarFallback=f;exports.AvatarImage=c;
@@ -0,0 +1,53 @@
1
+ import { j as e } from "../jsx-runtime-C5mzlN2N.js";
2
+ import * as r from "@radix-ui/react-avatar";
3
+ import { c as s } from "../index-CRiPKpXj.js";
4
+ function i({
5
+ className: a,
6
+ ...t
7
+ }) {
8
+ return /* @__PURE__ */ e.jsx(
9
+ r.Root,
10
+ {
11
+ "data-slot": "avatar",
12
+ className: s(
13
+ "relative flex size-8 shrink-0 overflow-hidden rounded-full",
14
+ a
15
+ ),
16
+ ...t
17
+ }
18
+ );
19
+ }
20
+ function m({
21
+ className: a,
22
+ ...t
23
+ }) {
24
+ return /* @__PURE__ */ e.jsx(
25
+ r.Image,
26
+ {
27
+ "data-slot": "avatar-image",
28
+ className: s("aspect-square size-full", a),
29
+ ...t
30
+ }
31
+ );
32
+ }
33
+ function n({
34
+ className: a,
35
+ ...t
36
+ }) {
37
+ return /* @__PURE__ */ e.jsx(
38
+ r.Fallback,
39
+ {
40
+ "data-slot": "avatar-fallback",
41
+ className: s(
42
+ "bg-muted text-paragraph-sm flex size-full items-center justify-center rounded-full",
43
+ a
44
+ ),
45
+ ...t
46
+ }
47
+ );
48
+ }
49
+ export {
50
+ i as Avatar,
51
+ n as AvatarFallback,
52
+ m as AvatarImage
53
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../badge-Czof3oqL.cjs");exports.Badge=e.Badge;
@@ -0,0 +1,4 @@
1
+ import { B as o } from "../badge-BnerQ2lF.js";
2
+ export {
3
+ o as Badge
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),T=require("../../calendar-DL8gqdRp.cjs"),j=require("../../icon-component-LY_vGYHZ.cjs"),F=require("../../label-CbzkBbPT.cjs"),x=require("../../popover-B8wp2cHF.cjs"),a=require("../../index-DoxiiusW.cjs"),L=require("../../index-C8P6Mn4U.cjs"),l=require("date-fns"),m=require("react"),i=require("../../style-CA5976Oh.cjs"),U=L.cva("border-neutral-050 focus-visible:ring-ring-default lg:hover:bg-neutral-000 flex w-full items-center gap-2 border-[0.5px] bg-white text-base whitespace-pre-wrap focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden disabled:border-neutral-100 disabled:bg-neutral-100 disabled:text-neutral-700 lg:disabled:hover:bg-neutral-100",{variants:{size:{sm:"text-label-md h-8 rounded-sm px-2 py-1",md:"text-label-lg h-12 rounded-md px-3 py-1",lg:"text-label-xl h-16 rounded-lg px-4 py-2"},rounded:{default:"",full:"rounded-full"},state:{default:"",selected:"bg-blue-050 focus:blue-800 border-blue-800 font-semibold text-blue-800 active:border-blue-800 lg:hover:bg-blue-100",error:"border-error-main"}},defaultVariants:{size:"md",rounded:"default",state:"default"}}),O=m.forwardRef(({className:y,placeholder:v,side:R="bottom",align:E="center",size:N="md",rounded:D="default",label:p,helperText:f,disabledDates:q,enabledDates:w,calendarDropdowns:C=!0,hideNavigation:S=!1,showOutsideDays:P=!0,locale:s="enGB",error:o,touched:b,value:r,minDate:M,onChange:g,maxDate:k,disabled:d=!1,...u},z)=>{const[n,c]=m.useState(),I=t=>{c(t),g&&g({target:{name:u.name,value:t?l.format(t,"yyyy-MM-dd"):""}})};m.useEffect(()=>{if(r){const t=new Date(r);isNaN(t.getTime())||c(t)}else c(void 0)},[r]);const B=s==="enGB"?i.enGB:s==="enUS"?i.enUS:s==="fr"?i.fr:i.es;return e.jsxRuntimeExports.jsxs("div",{ref:z,className:a.cn("flex flex-col gap-3",y),...u,children:[p&&e.jsxRuntimeExports.jsx(F.Label,{htmlFor:u.id,className:a.cn({"text-neutral-700":d}),children:p}),e.jsxRuntimeExports.jsxs(x.Popover,{children:[e.jsxRuntimeExports.jsx(x.PopoverTrigger,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:a.cn(U({size:N,rounded:D,state:n&&!o?"selected":o&&b?"error":"default"}),{"text-neutral-800":!n}),disabled:d,children:[e.jsxRuntimeExports.jsx(j.IconComponent,{iconName:"IconCalendar",size:20,className:"pointer-events-none"}),n?l.format(n,"PPP",{locale:B}):v||"Select a date",e.jsxRuntimeExports.jsx("input",{hidden:!0,onChange:()=>null,value:n?l.format(n,"yyyy-MM-dd"):r||""}),e.jsxRuntimeExports.jsx(j.IconComponent,{iconName:"IconChevronDown",size:16,className:"pointer-events-none ml-auto"})]})}),e.jsxRuntimeExports.jsx(x.PopoverContent,{className:"w-auto overflow-hidden p-0",side:R,align:E,children:e.jsxRuntimeExports.jsx(T.Calendar,{locale:s,disabledDates:q,enabledDates:w,hideNavigation:S,dropdownsSelectors:C,showOutsideDays:P,value:n?l.format(n,"yyyy-MM-dd"):r,maxDate:k,minDate:M,onChange:t=>{const G=t?new Date(t):void 0;I(G)}})})]}),o&&b?e.jsxRuntimeExports.jsx("span",{className:"text-error-main text-label-md -mt-1",children:o}):f?e.jsxRuntimeExports.jsx("span",{className:a.clsx("text-muted-foreground text-label-md -mt-1",{"text-neutral-700":d}),children:f}):null]})}),h=O;h.displayName="Datepicker";exports.Datepicker=h;
@@ -0,0 +1,181 @@
1
+ import { j as e } from "../../jsx-runtime-C5mzlN2N.js";
2
+ import { C as G } from "../../calendar-BAQkzm4v.js";
3
+ import { I as x } from "../../icon-component-BZ-4FDV6.js";
4
+ import { L } from "../../label-BpDUqtrC.js";
5
+ import { P as E, c as R, b as T } from "../../popover-BoDRCUh2.js";
6
+ import { c as m, a as U } from "../../index-CRiPKpXj.js";
7
+ import { c as F } from "../../index-BqtVL8d-.js";
8
+ import { format as o } from "date-fns";
9
+ import { forwardRef as V, useState as q, useEffect as A } from "react";
10
+ import { e as H, a as J, f as K, b as O } from "../../style-BNIXVvBA.js";
11
+ const Q = F(
12
+ "border-neutral-050 focus-visible:ring-ring-default lg:hover:bg-neutral-000 flex w-full items-center gap-2 border-[0.5px] bg-white text-base whitespace-pre-wrap focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden disabled:border-neutral-100 disabled:bg-neutral-100 disabled:text-neutral-700 lg:disabled:hover:bg-neutral-100",
13
+ {
14
+ variants: {
15
+ size: {
16
+ sm: "text-label-md h-8 rounded-sm px-2 py-1",
17
+ md: "text-label-lg h-12 rounded-md px-3 py-1",
18
+ lg: "text-label-xl h-16 rounded-lg px-4 py-2"
19
+ },
20
+ rounded: {
21
+ default: "",
22
+ full: "rounded-full"
23
+ },
24
+ state: {
25
+ default: "",
26
+ selected: "bg-blue-050 focus:blue-800 border-blue-800 font-semibold text-blue-800 active:border-blue-800 lg:hover:bg-blue-100",
27
+ error: "border-error-main"
28
+ }
29
+ },
30
+ defaultVariants: {
31
+ size: "md",
32
+ rounded: "default",
33
+ state: "default"
34
+ }
35
+ }
36
+ ), W = V(
37
+ ({
38
+ className: b,
39
+ placeholder: g,
40
+ side: h = "bottom",
41
+ align: v = "center",
42
+ size: y = "md",
43
+ rounded: j = "default",
44
+ label: c,
45
+ helperText: u,
46
+ disabledDates: N,
47
+ enabledDates: w,
48
+ calendarDropdowns: D = !0,
49
+ hideNavigation: C = !1,
50
+ showOutsideDays: P = !0,
51
+ locale: s = "enGB",
52
+ error: n,
53
+ touched: f,
54
+ value: r,
55
+ minDate: S,
56
+ onChange: p,
57
+ maxDate: M,
58
+ disabled: l = !1,
59
+ ...d
60
+ }, k) => {
61
+ const [a, i] = q(), z = (t) => {
62
+ i(t), p && p({
63
+ target: {
64
+ name: d.name,
65
+ value: t ? o(t, "yyyy-MM-dd") : ""
66
+ }
67
+ });
68
+ };
69
+ A(() => {
70
+ if (r) {
71
+ const t = new Date(r);
72
+ isNaN(t.getTime()) || i(t);
73
+ } else
74
+ i(void 0);
75
+ }, [r]);
76
+ const I = s === "enGB" ? H : s === "enUS" ? J : s === "fr" ? K : O;
77
+ return /* @__PURE__ */ e.jsxs(
78
+ "div",
79
+ {
80
+ ref: k,
81
+ className: m("flex flex-col gap-3", b),
82
+ ...d,
83
+ children: [
84
+ c && /* @__PURE__ */ e.jsx(
85
+ L,
86
+ {
87
+ htmlFor: d.id,
88
+ className: m({ "text-neutral-700": l }),
89
+ children: c
90
+ }
91
+ ),
92
+ /* @__PURE__ */ e.jsxs(E, { children: [
93
+ /* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsxs(
94
+ "button",
95
+ {
96
+ type: "button",
97
+ className: m(
98
+ Q({
99
+ size: y,
100
+ rounded: j,
101
+ state: a && !n ? "selected" : n && f ? "error" : "default"
102
+ }),
103
+ {
104
+ "text-neutral-800": !a
105
+ }
106
+ ),
107
+ disabled: l,
108
+ children: [
109
+ /* @__PURE__ */ e.jsx(
110
+ x,
111
+ {
112
+ iconName: "IconCalendar",
113
+ size: 20,
114
+ className: "pointer-events-none"
115
+ }
116
+ ),
117
+ a ? o(a, "PPP", { locale: I }) : g || "Select a date",
118
+ /* @__PURE__ */ e.jsx(
119
+ "input",
120
+ {
121
+ hidden: !0,
122
+ onChange: () => null,
123
+ value: a ? o(a, "yyyy-MM-dd") : r || ""
124
+ }
125
+ ),
126
+ /* @__PURE__ */ e.jsx(
127
+ x,
128
+ {
129
+ iconName: "IconChevronDown",
130
+ size: 16,
131
+ className: "pointer-events-none ml-auto"
132
+ }
133
+ )
134
+ ]
135
+ }
136
+ ) }),
137
+ /* @__PURE__ */ e.jsx(
138
+ T,
139
+ {
140
+ className: "w-auto overflow-hidden p-0",
141
+ side: h,
142
+ align: v,
143
+ children: /* @__PURE__ */ e.jsx(
144
+ G,
145
+ {
146
+ locale: s,
147
+ disabledDates: N,
148
+ enabledDates: w,
149
+ hideNavigation: C,
150
+ dropdownsSelectors: D,
151
+ showOutsideDays: P,
152
+ value: a ? o(a, "yyyy-MM-dd") : r,
153
+ maxDate: M,
154
+ minDate: S,
155
+ onChange: (t) => {
156
+ const B = t ? new Date(t) : void 0;
157
+ z(B);
158
+ }
159
+ }
160
+ )
161
+ }
162
+ )
163
+ ] }),
164
+ n && f ? /* @__PURE__ */ e.jsx("span", { className: "text-error-main text-label-md -mt-1", children: n }) : u ? /* @__PURE__ */ e.jsx(
165
+ "span",
166
+ {
167
+ className: U("text-muted-foreground text-label-md -mt-1", {
168
+ "text-neutral-700": l
169
+ }),
170
+ children: u
171
+ }
172
+ ) : null
173
+ ]
174
+ }
175
+ );
176
+ }
177
+ ), X = W;
178
+ X.displayName = "Datepicker";
179
+ export {
180
+ X as Datepicker
181
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),$=require("../../label-CbzkBbPT.cjs"),b=require("../../index-DoxiiusW.cjs"),I=require("../../index-C8P6Mn4U.cjs"),a=require("date-fns"),w=require("react"),T=require("react-day-picker"),f=require("../../style-CA5976Oh.cjs"),P=require("../../icon-component-LY_vGYHZ.cjs"),j=require("../../popover-B8wp2cHF.cjs"),L=I.cva("border-neutral-050 focus-visible:ring-ring-default lg:hover:bg-neutral-000 flex w-full items-center gap-2 border-[0.5px] bg-white text-base whitespace-pre-wrap focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden disabled:border-neutral-100 disabled:bg-neutral-100 disabled:text-neutral-700 lg:disabled:hover:bg-neutral-100",{variants:{size:{sm:"text-label-md h-8 rounded-sm px-2 py-1",md:"text-label-lg h-12 rounded-md px-3 py-1",lg:"text-label-xl h-16 rounded-lg px-4 py-2"},rounded:{default:"",full:"rounded-full"},state:{default:"",selected:"bg-blue-050 focus:blue-800 border-blue-800 font-semibold text-blue-800 active:border-blue-800 lg:hover:bg-blue-100",error:"border-error-main"}},defaultVariants:{size:"md",rounded:"default",state:"default"}}),B=({onChange:d,value:o,options:x})=>e.jsxRuntimeExports.jsx("select",{className:"text-md focus-visible:ring-ring-default h-fit w-fit! cursor-pointer appearance-none rounded-md border-none pr-9 pl-1 font-semibold transition-colors focus:border-0 focus:border-transparent focus:ring-0 focus:ring-transparent focus:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden",onChange:d,value:o,children:x?.map((n,m)=>{const g=n.value===o;return e.jsxRuntimeExports.jsx("option",{value:n.value,disabled:n.disabled,className:b.cn("disabled:hidden",{"bg-blue-050 font-semibold text-blue-800":g}),children:n.label},m)})}),G=({orientation:d="down",size:o=16})=>e.jsxRuntimeExports.jsx(P.IconComponent,{iconName:d==="left"?"IconChevronLeft":"IconChevronRight",stroke:"1.5",size:o}),F=w.forwardRef(({className:d,locale:o="enGB",placeholder:x,label:n,size:m="md",rounded:g="default",disabledDates:N,helperText:C,side:q="bottom",align:M="center",error:c,touched:p,startDate:i,endDate:l,calendarDropdowns:S=!0,onChange:R,minDate:k,maxDate:_,disabled:h=!1,...u},z)=>{const[t,v]=w.useState({from:i?new Date(i):void 0,to:l?new Date(l):void 0}),D=r=>{if(v(r),R){const s={from:r.from?a.format(r.from,"yyyy-MM-dd"):"",to:r.to?a.format(r.to,"yyyy-MM-dd"):""};R({target:{name:u.name,value:s}})}};w.useEffect(()=>{if(i){const r=new Date(i);isNaN(r.getTime())||v(s=>({...s,from:r}))}if(l){const r=new Date(l);isNaN(r.getTime())||v(s=>({...s,to:r}))}},[i,l]);const y=o==="enGB"?f.enGB:o==="enUS"?f.enUS:o==="fr"?f.fr:f.es;return e.jsxRuntimeExports.jsxs("div",{ref:z,className:b.cn("flex flex-col gap-3",d),...u,children:[n&&e.jsxRuntimeExports.jsx($.Label,{htmlFor:u.id,className:b.cn({"text-neutral-700":h}),children:n}),e.jsxRuntimeExports.jsxs(j.Popover,{children:[e.jsxRuntimeExports.jsx(j.PopoverTrigger,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:b.cn(L({size:m,rounded:g,state:t.from&&t.to||p&&!c?"selected":c&&p?"error":"default"}),{"text-neutral-800":!t.from&&!t.to}),disabled:h,children:[e.jsxRuntimeExports.jsx(P.IconComponent,{iconName:"IconCalendar",size:20,className:"pointer-events-none"}),t.from&&t.to?`${a.format(t.from,"PPP",{locale:y})} - ${a.format(t.to,"PPP",{locale:y})}`:x||"Select a date range",e.jsxRuntimeExports.jsx("input",{hidden:!0,onChange:()=>null,value:t.from&&t.to?`${a.format(t.from,"yyyy-MM-dd")} to ${a.format(t.to,"yyyy-MM-dd")}`:`${i||""} to ${l||""}`})]})}),e.jsxRuntimeExports.jsx(j.PopoverContent,{side:q,align:M,children:e.jsxRuntimeExports.jsx(T.DayPicker,{mode:"range",captionLayout:S?"dropdown":"label",selected:t,onSelect:D,locale:y,startMonth:k||new Date(1900,0,1),endMonth:_||new Date(2100,11,31),showOutsideDays:!0,disabled:N,className:"p-2",required:!0,classNames:{root:"w-fit text-sm text-center",weekday:"text-muted-foreground font-regular",month_grid:"border-separate",month_caption:"h-9 relative flex items-center w-full",dropdowns:"absolute w-fit items-center justify-center z-10 left-1/2 flex -translate-x-1/2 top-1/2 -translate-y-1/2",button_next:"rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",button_previous:"rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",nav:"w-full h-9 top-0 left-0 absolute flex justify-between items-center gap-2",selected:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",today:"bg-blue-050 border-[0.5px] text-blue-800 lg:hover:bg-blue-100",outside:"bg-white text-neutral-200 border-[0.5px] border-neutral-000",day_button:"text-sm h-9 w-9 whitespace-nowrap border-none focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] rounded-2xl",caption_label:"text-neutral-1000 text-base font-semibold leading-none self-center w-full",disabled:"bg-white text-neutral-200 border-[0.5px] border-neutral-000 lg:hover:bg-white!",day:"h-9 w-9 aspect-square text-sm rounded-2xl border-[0.5px] border-neutral-050 lg:hover:bg-blue-050 transition-colors p-0 whitespace-nowrap",range_end:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",range_start:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",range_middle:"bg-blue-050! border-[0.5px] border-blue-800! text-blue-800! lg:hover:bg-blue-100 transition-colors font-semibold"},components:{Dropdown:B,Chevron:({orientation:r,size:s})=>e.jsxRuntimeExports.jsx(G,{orientation:r,size:s})}})})]}),c&&p?e.jsxRuntimeExports.jsx("span",{"aria-describedby":u.id,"aria-invalid":"true",className:"text-error-main text-label-md -mt-1",children:c}):e.jsxRuntimeExports.jsx("span",{className:b.clsx("text-muted-foreground -mt-1",{"text-neutral-700":h}),"aria-describedby":u.id,children:C})]})}),E=F;E.displayName="DateRangePicker";exports.DateRangePicker=E;