docthub-core-components 3.2.1 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/overrides/ui/autocomplete-checkbox.js +362 -356
- package/dist/components/overrides/ui/login-dialog/login-dialog.js +344 -0
- package/dist/components/overrides/ui/login-dialog/presets.js +38 -0
- package/dist/components/overrides/ui/login-dialog/types.js +7 -0
- package/dist/components/overrides/ui/pickers/date-range-picker-field.js +40 -39
- package/dist/index.esm.js +3061 -3071
- package/dist/index.js +149 -136
- package/dist/src/components/overrides/ui/autocomplete-checkbox.d.ts +12 -1
- package/dist/src/components/overrides/ui/login-dialog/index.d.ts +3 -0
- package/dist/src/components/overrides/ui/login-dialog/login-dialog.d.ts +2 -0
- package/dist/src/components/overrides/ui/login-dialog/presets.d.ts +15 -0
- package/dist/src/components/overrides/ui/login-dialog/types.d.ts +44 -0
- package/dist/src/components/overrides/ui/pickers/date-range-picker-field.d.ts +5 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l, jsxs as D, Fragment as ae } from "react/jsx-runtime";
|
|
3
|
+
import { c as G } from "react-compiler-runtime";
|
|
4
|
+
import { X as ue, ArrowRight as pe } from "lucide-react";
|
|
5
|
+
import * as me from "react";
|
|
6
|
+
import { DoctButton as E } from "../../../ui/button.js";
|
|
7
|
+
import { DialogHeader as ge, DialogTitle as he, DialogContent as xe, Dialog as ve } from "../../../ui/dialog.js";
|
|
8
|
+
import { DrawerHeader as be, DrawerTitle as Ne, DrawerContent as Le, Drawer as ye } from "../../../ui/drawer.js";
|
|
9
|
+
import { DoctTypography as U } from "../../../ui/typography.js";
|
|
10
|
+
import { useIsMobile as Ce } from "../../../../hooks/use-mobile.js";
|
|
11
|
+
import { cn as de } from "../../../../lib/utils.js";
|
|
12
|
+
import { LOGIN_DIALOG_DEFAULT_COPY as we, LOGIN_DIALOG_CONTINUE_PHONE_EMAIL_LABEL as Ie, LOGIN_DIALOG_RETURNING_HINT as _e, LOGIN_DIALOG_ASSETS as re, LOGIN_DIALOG_RETURNING_PRIMARY_LABEL as Ae, LOGIN_DIALOG_CONTINUE_ANOTHER_WAY_LABEL as De } from "./presets.js";
|
|
13
|
+
import { LOGIN_DRAWER_BACKDROP_CLASS as se, LOGIN_DIALOG_IMAGE_HEIGHT as Ge, LOGIN_DIALOG_IMAGE_WIDTH as Oe } from "./types.js";
|
|
14
|
+
const Se = "[&>div:first-child]:pointer-events-none [&>div:first-child]:sr-only [&>div:first-child]:m-0 [&>div:first-child]:h-0 [&>div:first-child]:w-0 [&>div:first-child]:overflow-hidden", Ee = "linear-gradient(180deg, #ffffff 0%, #ebf8fa 100%)";
|
|
15
|
+
function ke(m, e) {
|
|
16
|
+
return e ?? _e[m];
|
|
17
|
+
}
|
|
18
|
+
function Pe(m) {
|
|
19
|
+
const e = G(3), {
|
|
20
|
+
onClose: i
|
|
21
|
+
} = m;
|
|
22
|
+
let o;
|
|
23
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(ue, { className: "size-6", "aria-hidden": !0 }), e[0] = o) : o = e[0];
|
|
24
|
+
let t;
|
|
25
|
+
return e[1] !== i ? (t = /* @__PURE__ */ l(E, { type: "button", variant: "ghost", onClick: i, className: "flex size-[44px] shrink-0 items-center justify-center rounded-full p-0 text-black/70", "aria-label": "Close login", icon: o }), e[1] = i, e[2] = t) : t = e[2], t;
|
|
26
|
+
}
|
|
27
|
+
function Te(m) {
|
|
28
|
+
const e = G(7), {
|
|
29
|
+
title: i,
|
|
30
|
+
onClose: o
|
|
31
|
+
} = m;
|
|
32
|
+
let t;
|
|
33
|
+
e[0] !== i ? (t = /* @__PURE__ */ l(U, { as: "p", variant: "textLabel1", weight: "semiBold", className: "min-w-0 flex-1 !text-black/80", children: i }), e[0] = i, e[1] = t) : t = e[1];
|
|
34
|
+
let r;
|
|
35
|
+
e[2] !== o ? (r = /* @__PURE__ */ l(Pe, { onClose: o }), e[2] = o, e[3] = r) : r = e[3];
|
|
36
|
+
let n;
|
|
37
|
+
return e[4] !== t || e[5] !== r ? (n = /* @__PURE__ */ D("div", { className: "flex w-full shrink-0 items-center justify-between overflow-hidden pl-4", children: [
|
|
38
|
+
t,
|
|
39
|
+
r
|
|
40
|
+
] }), e[4] = t, e[5] = r, e[6] = n) : n = e[6], n;
|
|
41
|
+
}
|
|
42
|
+
function We(m) {
|
|
43
|
+
const e = G(6), {
|
|
44
|
+
image: i,
|
|
45
|
+
imageSrc: o,
|
|
46
|
+
imageAlt: t
|
|
47
|
+
} = m, r = o ?? re.illustration;
|
|
48
|
+
let n;
|
|
49
|
+
e[0] !== i || e[1] !== t || e[2] !== r ? (n = i ?? /* @__PURE__ */ l("img", { src: r, alt: t ?? "Docthub", width: Oe, height: Ge, className: "h-auto w-full max-w-[288px] object-contain" }), e[0] = i, e[1] = t, e[2] = r, e[3] = n) : n = e[3];
|
|
50
|
+
let s;
|
|
51
|
+
return e[4] !== n ? (s = /* @__PURE__ */ l("div", { className: "flex w-full flex-col items-center px-4", children: n }), e[4] = n, e[5] = s) : s = e[5], s;
|
|
52
|
+
}
|
|
53
|
+
function fe(m) {
|
|
54
|
+
const e = G(3), {
|
|
55
|
+
termsNode: i,
|
|
56
|
+
privacyNode: o
|
|
57
|
+
} = m;
|
|
58
|
+
let t;
|
|
59
|
+
return e[0] !== o || e[1] !== i ? (t = /* @__PURE__ */ D(U, { as: "p", variant: "body5", weight: "regular", className: "w-full max-w-[288px] !text-center !text-[#6C6E6F]", children: [
|
|
60
|
+
"by continuing you agree to Docthub's ",
|
|
61
|
+
i,
|
|
62
|
+
" and ",
|
|
63
|
+
o,
|
|
64
|
+
"."
|
|
65
|
+
] }), e[0] = o, e[1] = i, e[2] = t) : t = e[2], t;
|
|
66
|
+
}
|
|
67
|
+
function te(m) {
|
|
68
|
+
const e = G(2), {
|
|
69
|
+
provider: i,
|
|
70
|
+
googleIconSrc: o,
|
|
71
|
+
appleIconSrc: t
|
|
72
|
+
} = m, r = i === "google" ? o ?? re.googleIcon : t ?? re.appleIcon;
|
|
73
|
+
let n;
|
|
74
|
+
return e[0] !== r ? (n = /* @__PURE__ */ l("img", { src: r, alt: "", className: "size-[24px] shrink-0 object-contain", "aria-hidden": !0 }), e[0] = r, e[1] = n) : n = e[1], n;
|
|
75
|
+
}
|
|
76
|
+
function Be(m) {
|
|
77
|
+
const e = G(11), {
|
|
78
|
+
description: i,
|
|
79
|
+
continueButtonLabel: o,
|
|
80
|
+
onContinueWithPhoneEmail: t
|
|
81
|
+
} = m;
|
|
82
|
+
let r;
|
|
83
|
+
e[0] !== i ? (r = /* @__PURE__ */ l("div", { className: "flex shrink-0 flex-col items-center gap-5 px-4 py-5", children: /* @__PURE__ */ l(U, { as: "p", variant: "textLabel2", weight: "medium", className: "w-full !text-center !text-black/80", children: i }) }), e[0] = i, e[1] = r) : r = e[1];
|
|
84
|
+
let n;
|
|
85
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ l(pe, { className: "size-6 shrink-0", "aria-hidden": !0 }), e[2] = n) : n = e[2];
|
|
86
|
+
let s;
|
|
87
|
+
e[3] !== t ? (s = () => t == null ? void 0 : t(), e[3] = t, e[4] = s) : s = e[4];
|
|
88
|
+
let c;
|
|
89
|
+
e[5] !== o || e[6] !== s ? (c = /* @__PURE__ */ l("div", { className: "flex shrink-0 flex-col items-stretch gap-3 border-t border-black/10 bg-[#fafafa] p-4", children: /* @__PURE__ */ l(E, { type: "button", className: "flex w-full flex-1 h-[44px] items-center justify-center gap-2 rounded-xl bg-[#002830] px-5 py-2.5 text-base font-semibold leading-[22px] text-white", icon: n, iconPosition: "right", onClick: s, children: o }) }), e[5] = o, e[6] = s, e[7] = c) : c = e[7];
|
|
90
|
+
let a;
|
|
91
|
+
return e[8] !== r || e[9] !== c ? (a = /* @__PURE__ */ D(ae, { children: [
|
|
92
|
+
r,
|
|
93
|
+
c
|
|
94
|
+
] }), e[8] = r, e[9] = c, e[10] = a) : a = e[10], a;
|
|
95
|
+
}
|
|
96
|
+
function Re(m) {
|
|
97
|
+
const e = G(16), {
|
|
98
|
+
description: i,
|
|
99
|
+
googleIconSrc: o,
|
|
100
|
+
appleIconSrc: t,
|
|
101
|
+
onContinueWithMobile: r,
|
|
102
|
+
onContinueWithEmail: n,
|
|
103
|
+
onContinueWithGoogle: s,
|
|
104
|
+
onContinueWithApple: c,
|
|
105
|
+
termsNode: a,
|
|
106
|
+
privacyNode: u
|
|
107
|
+
} = m;
|
|
108
|
+
let g;
|
|
109
|
+
e[0] !== i ? (g = /* @__PURE__ */ l(U, { as: "p", variant: "textLabel4", weight: "medium", className: "w-full max-w-[288px] !text-center !text-[#6C6E6F]", children: i }), e[0] = i, e[1] = g) : g = e[1];
|
|
110
|
+
let d;
|
|
111
|
+
e[2] !== t || e[3] !== o || e[4] !== c || e[5] !== n || e[6] !== s || e[7] !== r ? (d = r || n || s || c ? /* @__PURE__ */ D("div", { className: "flex w-full flex-col gap-2", children: [
|
|
112
|
+
r ? /* @__PURE__ */ l(E, { type: "button", size: "large", variant: "outline", onClick: r, children: "Continue with Mobile" }) : null,
|
|
113
|
+
n ? /* @__PURE__ */ l(E, { type: "button", size: "large", variant: "outline", onClick: n, children: "Continue with Email" }) : null,
|
|
114
|
+
s ? /* @__PURE__ */ l(E, { type: "button", size: "large", variant: "outline", icon: /* @__PURE__ */ l(te, { provider: "google", googleIconSrc: o, appleIconSrc: t }), iconPosition: "left", onClick: s, children: "Continue with Google" }) : null,
|
|
115
|
+
c ? /* @__PURE__ */ l(E, { type: "button", size: "large", variant: "outline", icon: /* @__PURE__ */ l(te, { provider: "apple", googleIconSrc: o, appleIconSrc: t }), iconPosition: "left", onClick: c, children: "Continue with Apple" }) : null
|
|
116
|
+
] }) : null, e[2] = t, e[3] = o, e[4] = c, e[5] = n, e[6] = s, e[7] = r, e[8] = d) : d = e[8];
|
|
117
|
+
let f;
|
|
118
|
+
e[9] !== u || e[10] !== a ? (f = /* @__PURE__ */ l(fe, { termsNode: a, privacyNode: u }), e[9] = u, e[10] = a, e[11] = f) : f = e[11];
|
|
119
|
+
let p;
|
|
120
|
+
return e[12] !== g || e[13] !== d || e[14] !== f ? (p = /* @__PURE__ */ D("div", { className: "flex flex-col items-center gap-4 px-4 pb-6 pt-4", children: [
|
|
121
|
+
g,
|
|
122
|
+
d,
|
|
123
|
+
f
|
|
124
|
+
] }), e[12] = g, e[13] = d, e[14] = f, e[15] = p) : p = e[15], p;
|
|
125
|
+
}
|
|
126
|
+
function Me(m) {
|
|
127
|
+
const e = G(29), {
|
|
128
|
+
description: i,
|
|
129
|
+
lastLoginProvider: o,
|
|
130
|
+
googleIconSrc: t,
|
|
131
|
+
appleIconSrc: r,
|
|
132
|
+
onContinueWithGoogle: n,
|
|
133
|
+
onContinueWithApple: s,
|
|
134
|
+
onContinueWithMobile: c,
|
|
135
|
+
onContinueWithEmail: a,
|
|
136
|
+
onContinueAnotherWay: u,
|
|
137
|
+
termsNode: g,
|
|
138
|
+
privacyNode: d
|
|
139
|
+
} = m, f = Ae[o], p = o === "google", N = o === "apple";
|
|
140
|
+
let w;
|
|
141
|
+
e[0] !== o || e[1] !== s || e[2] !== a || e[3] !== n || e[4] !== c ? (w = () => {
|
|
142
|
+
o === "google" ? n == null || n() : o === "apple" ? s == null || s() : o === "mobile" ? c == null || c() : a == null || a();
|
|
143
|
+
}, e[0] = o, e[1] = s, e[2] = a, e[3] = n, e[4] = c, e[5] = w) : w = e[5];
|
|
144
|
+
const y = w;
|
|
145
|
+
let h;
|
|
146
|
+
e[6] !== i ? (h = /* @__PURE__ */ l(U, { as: "p", variant: "textLabel4", weight: "medium", className: "w-full max-w-[288px] !text-center !text-black/68", children: i }), e[6] = i, e[7] = h) : h = e[7];
|
|
147
|
+
let x;
|
|
148
|
+
e[8] !== r || e[9] !== t || e[10] !== N || e[11] !== p ? (x = p ? /* @__PURE__ */ l(te, { provider: "google", googleIconSrc: t, appleIconSrc: r }) : N ? /* @__PURE__ */ l(te, { provider: "apple", googleIconSrc: t, appleIconSrc: r }) : void 0, e[8] = r, e[9] = t, e[10] = N, e[11] = p, e[12] = x) : x = e[12];
|
|
149
|
+
let v;
|
|
150
|
+
e[13] !== y || e[14] !== f || e[15] !== x ? (v = /* @__PURE__ */ l(E, { type: "button", size: "large", variant: "primary", icon: x, iconPosition: "left", onClick: y, children: f }), e[13] = y, e[14] = f, e[15] = x, e[16] = v) : v = e[16];
|
|
151
|
+
let L;
|
|
152
|
+
e[17] !== u ? (L = /* @__PURE__ */ l(E, { type: "button", variant: "outline", size: "large", onClick: () => u == null ? void 0 : u(), children: De }), e[17] = u, e[18] = L) : L = e[18];
|
|
153
|
+
let b;
|
|
154
|
+
e[19] !== v || e[20] !== L ? (b = /* @__PURE__ */ D("div", { className: "flex w-full flex-col gap-2", children: [
|
|
155
|
+
v,
|
|
156
|
+
L
|
|
157
|
+
] }), e[19] = v, e[20] = L, e[21] = b) : b = e[21];
|
|
158
|
+
let C;
|
|
159
|
+
e[22] !== d || e[23] !== g ? (C = /* @__PURE__ */ l(fe, { termsNode: g, privacyNode: d }), e[22] = d, e[23] = g, e[24] = C) : C = e[24];
|
|
160
|
+
let A;
|
|
161
|
+
return e[25] !== h || e[26] !== b || e[27] !== C ? (A = /* @__PURE__ */ D("div", { className: "flex flex-col items-center gap-4 px-4 pb-6 pt-4", children: [
|
|
162
|
+
h,
|
|
163
|
+
b,
|
|
164
|
+
C
|
|
165
|
+
] }), e[25] = h, e[26] = b, e[27] = C, e[28] = A) : A = e[28], A;
|
|
166
|
+
}
|
|
167
|
+
function He(m) {
|
|
168
|
+
const e = G(38), {
|
|
169
|
+
variant: i,
|
|
170
|
+
lastLoginProvider: o,
|
|
171
|
+
description: t,
|
|
172
|
+
continueButtonLabel: r,
|
|
173
|
+
image: n,
|
|
174
|
+
imageSrc: s,
|
|
175
|
+
imageAlt: c,
|
|
176
|
+
googleIconSrc: a,
|
|
177
|
+
appleIconSrc: u,
|
|
178
|
+
onContinueWithPhoneEmail: g,
|
|
179
|
+
onContinueWithMobile: d,
|
|
180
|
+
onContinueWithEmail: f,
|
|
181
|
+
onContinueWithGoogle: p,
|
|
182
|
+
onContinueWithApple: N,
|
|
183
|
+
onContinueAnotherWay: w,
|
|
184
|
+
termsNode: y,
|
|
185
|
+
privacyNode: h
|
|
186
|
+
} = m;
|
|
187
|
+
let x;
|
|
188
|
+
e[0] !== n || e[1] !== c || e[2] !== s ? (x = /* @__PURE__ */ l(We, { image: n, imageSrc: s, imageAlt: c }), e[0] = n, e[1] = c, e[2] = s, e[3] = x) : x = e[3];
|
|
189
|
+
let v;
|
|
190
|
+
e[4] !== r || e[5] !== t || e[6] !== g || e[7] !== i ? (v = i === "guest" && /* @__PURE__ */ l(Be, { description: t, continueButtonLabel: r, onContinueWithPhoneEmail: g }), e[4] = r, e[5] = t, e[6] = g, e[7] = i, e[8] = v) : v = e[8];
|
|
191
|
+
let L;
|
|
192
|
+
e[9] !== u || e[10] !== t || e[11] !== a || e[12] !== N || e[13] !== f || e[14] !== p || e[15] !== d || e[16] !== h || e[17] !== y || e[18] !== i ? (L = i === "signup" && /* @__PURE__ */ l(Re, { description: t, googleIconSrc: a, appleIconSrc: u, onContinueWithMobile: d, onContinueWithEmail: f, onContinueWithGoogle: p, onContinueWithApple: N, termsNode: y, privacyNode: h }), e[9] = u, e[10] = t, e[11] = a, e[12] = N, e[13] = f, e[14] = p, e[15] = d, e[16] = h, e[17] = y, e[18] = i, e[19] = L) : L = e[19];
|
|
193
|
+
let b;
|
|
194
|
+
e[20] !== u || e[21] !== t || e[22] !== a || e[23] !== o || e[24] !== w || e[25] !== N || e[26] !== f || e[27] !== p || e[28] !== d || e[29] !== h || e[30] !== y || e[31] !== i ? (b = i === "returning" && /* @__PURE__ */ l(Me, { description: t, lastLoginProvider: o, googleIconSrc: a, appleIconSrc: u, onContinueWithGoogle: p, onContinueWithApple: N, onContinueWithMobile: d, onContinueWithEmail: f, onContinueAnotherWay: w, termsNode: y, privacyNode: h }), e[20] = u, e[21] = t, e[22] = a, e[23] = o, e[24] = w, e[25] = N, e[26] = f, e[27] = p, e[28] = d, e[29] = h, e[30] = y, e[31] = i, e[32] = b) : b = e[32];
|
|
195
|
+
let C;
|
|
196
|
+
return e[33] !== x || e[34] !== v || e[35] !== L || e[36] !== b ? (C = /* @__PURE__ */ D(ae, { children: [
|
|
197
|
+
x,
|
|
198
|
+
v,
|
|
199
|
+
L,
|
|
200
|
+
b
|
|
201
|
+
] }), e[33] = x, e[34] = v, e[35] = L, e[36] = b, e[37] = C) : C = e[37], C;
|
|
202
|
+
}
|
|
203
|
+
function ce(m) {
|
|
204
|
+
const e = G(29), {
|
|
205
|
+
title: i,
|
|
206
|
+
variant: o,
|
|
207
|
+
lastLoginProvider: t,
|
|
208
|
+
description: r,
|
|
209
|
+
continueButtonLabel: n,
|
|
210
|
+
image: s,
|
|
211
|
+
imageSrc: c,
|
|
212
|
+
imageAlt: a,
|
|
213
|
+
googleIconSrc: u,
|
|
214
|
+
appleIconSrc: g,
|
|
215
|
+
onClose: d,
|
|
216
|
+
onContinueWithPhoneEmail: f,
|
|
217
|
+
onContinueWithMobile: p,
|
|
218
|
+
onContinueWithEmail: N,
|
|
219
|
+
onContinueWithGoogle: w,
|
|
220
|
+
onContinueWithApple: y,
|
|
221
|
+
onContinueAnotherWay: h,
|
|
222
|
+
termsNode: x,
|
|
223
|
+
privacyNode: v,
|
|
224
|
+
className: L,
|
|
225
|
+
surface: b
|
|
226
|
+
} = m, C = b === "drawer" ? "rounded-t-2xl" : "rounded-2xl shadow-sm";
|
|
227
|
+
let A;
|
|
228
|
+
e[0] !== L || e[1] !== C ? (A = de("flex w-full max-w-[320px] flex-col overflow-hidden border border-black/10 bg-white", C, L), e[0] = L, e[1] = C, e[2] = A) : A = e[2];
|
|
229
|
+
const k = A;
|
|
230
|
+
let _;
|
|
231
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
|
|
232
|
+
background: Ee
|
|
233
|
+
}, e[3] = _) : _ = e[3];
|
|
234
|
+
let I;
|
|
235
|
+
e[4] !== d || e[5] !== i ? (I = /* @__PURE__ */ l(Te, { title: i, onClose: d }), e[4] = d, e[5] = i, e[6] = I) : I = e[6];
|
|
236
|
+
let O;
|
|
237
|
+
e[7] !== g || e[8] !== n || e[9] !== r || e[10] !== u || e[11] !== s || e[12] !== a || e[13] !== c || e[14] !== t || e[15] !== h || e[16] !== y || e[17] !== N || e[18] !== w || e[19] !== p || e[20] !== f || e[21] !== v || e[22] !== x || e[23] !== o ? (O = /* @__PURE__ */ l(He, { variant: o, lastLoginProvider: t, description: r, continueButtonLabel: n, image: s, imageSrc: c, imageAlt: a, googleIconSrc: u, appleIconSrc: g, onContinueWithPhoneEmail: f, onContinueWithMobile: p, onContinueWithEmail: N, onContinueWithGoogle: w, onContinueWithApple: y, onContinueAnotherWay: h, termsNode: x, privacyNode: v }), e[7] = g, e[8] = n, e[9] = r, e[10] = u, e[11] = s, e[12] = a, e[13] = c, e[14] = t, e[15] = h, e[16] = y, e[17] = N, e[18] = w, e[19] = p, e[20] = f, e[21] = v, e[22] = x, e[23] = o, e[24] = O) : O = e[24];
|
|
238
|
+
let P;
|
|
239
|
+
return e[25] !== k || e[26] !== I || e[27] !== O ? (P = /* @__PURE__ */ D("div", { className: k, style: _, children: [
|
|
240
|
+
I,
|
|
241
|
+
O
|
|
242
|
+
] }), e[25] = k, e[26] = I, e[27] = O, e[28] = P) : P = e[28], P;
|
|
243
|
+
}
|
|
244
|
+
function Ze(m) {
|
|
245
|
+
const e = G(61), {
|
|
246
|
+
open: i,
|
|
247
|
+
onOpenChange: o,
|
|
248
|
+
variant: t,
|
|
249
|
+
lastLoginProvider: r,
|
|
250
|
+
onContinueWithPhoneEmail: n,
|
|
251
|
+
onContinueWithMobile: s,
|
|
252
|
+
onContinueWithEmail: c,
|
|
253
|
+
onContinueWithGoogle: a,
|
|
254
|
+
onContinueWithApple: u,
|
|
255
|
+
onContinueAnotherWay: g,
|
|
256
|
+
onTermsClick: d,
|
|
257
|
+
onPrivacyClick: f,
|
|
258
|
+
termsHref: p,
|
|
259
|
+
privacyHref: N,
|
|
260
|
+
imageSrc: w,
|
|
261
|
+
imageAlt: y,
|
|
262
|
+
googleIconSrc: h,
|
|
263
|
+
appleIconSrc: x,
|
|
264
|
+
image: v,
|
|
265
|
+
title: L,
|
|
266
|
+
description: b,
|
|
267
|
+
continueButtonLabel: C,
|
|
268
|
+
isMobileOverride: A,
|
|
269
|
+
className: k
|
|
270
|
+
} = m, _ = t === void 0 ? "guest" : t, I = r === void 0 ? "google" : r, O = C === void 0 ? Ie : C, P = Ce(), $ = A ?? P, j = we[_], S = L ?? j.title;
|
|
271
|
+
let F;
|
|
272
|
+
e[0] !== j || e[1] !== b || e[2] !== I || e[3] !== _ ? (F = _ === "returning" ? ke(I, b) : b ?? j.description, e[0] = j, e[1] = b, e[2] = I, e[3] = _, e[4] = F) : F = e[4];
|
|
273
|
+
const ie = F;
|
|
274
|
+
let Y;
|
|
275
|
+
e[5] !== o ? (Y = () => o(!1), e[5] = o, e[6] = Y) : Y = e[6];
|
|
276
|
+
const oe = Y;
|
|
277
|
+
let K;
|
|
278
|
+
e[7] !== d || e[8] !== p ? (K = p ? /* @__PURE__ */ l("a", { href: p, className: "underline decoration-solid decoration-[0.3px] underline-offset-[2px]", children: "Terms of Use" }) : d ? /* @__PURE__ */ l("button", { type: "button", className: "underline decoration-solid decoration-[0.3px] underline-offset-[2px]", onClick: d, children: "Terms of Use" }) : /* @__PURE__ */ l("span", { className: "underline decoration-solid decoration-[0.3px] underline-offset-[2px]", children: "Terms of Use" }), e[7] = d, e[8] = p, e[9] = K) : K = e[9];
|
|
279
|
+
const le = K;
|
|
280
|
+
let X;
|
|
281
|
+
e[10] !== f || e[11] !== N ? (X = N ? /* @__PURE__ */ l("a", { href: N, className: "underline decoration-solid decoration-[0.3px] underline-offset-[2px]", children: "Privacy Policy" }) : f ? /* @__PURE__ */ l("button", { type: "button", className: "underline decoration-solid decoration-[0.3px] underline-offset-[2px]", onClick: f, children: "Privacy Policy" }) : /* @__PURE__ */ l("span", { className: "underline decoration-solid decoration-[0.3px] underline-offset-[2px]", children: "Privacy Policy" }), e[10] = f, e[11] = N, e[12] = X) : X = e[12];
|
|
282
|
+
const ne = X;
|
|
283
|
+
let q, J;
|
|
284
|
+
e[13] !== $ || e[14] !== i ? (q = () => {
|
|
285
|
+
if ($)
|
|
286
|
+
return i ? document.body.classList.add(se) : document.body.classList.remove(se), ze;
|
|
287
|
+
}, J = [$, i], e[13] = $, e[14] = i, e[15] = q, e[16] = J) : (q = e[15], J = e[16]), me.useEffect(q, J);
|
|
288
|
+
let Q;
|
|
289
|
+
e[17] !== x || e[18] !== k || e[19] !== O || e[20] !== h || e[21] !== oe || e[22] !== v || e[23] !== y || e[24] !== w || e[25] !== I || e[26] !== g || e[27] !== u || e[28] !== c || e[29] !== a || e[30] !== s || e[31] !== n || e[32] !== ne || e[33] !== ie || e[34] !== S || e[35] !== le || e[36] !== _ ? (Q = {
|
|
290
|
+
title: S,
|
|
291
|
+
variant: _,
|
|
292
|
+
lastLoginProvider: I,
|
|
293
|
+
description: ie,
|
|
294
|
+
continueButtonLabel: O,
|
|
295
|
+
image: v,
|
|
296
|
+
imageSrc: w,
|
|
297
|
+
imageAlt: y,
|
|
298
|
+
googleIconSrc: h,
|
|
299
|
+
appleIconSrc: x,
|
|
300
|
+
onClose: oe,
|
|
301
|
+
onContinueWithPhoneEmail: n,
|
|
302
|
+
onContinueWithMobile: s,
|
|
303
|
+
onContinueWithEmail: c,
|
|
304
|
+
onContinueWithGoogle: a,
|
|
305
|
+
onContinueWithApple: u,
|
|
306
|
+
onContinueAnotherWay: g,
|
|
307
|
+
termsNode: le,
|
|
308
|
+
privacyNode: ne,
|
|
309
|
+
className: k
|
|
310
|
+
}, e[17] = x, e[18] = k, e[19] = O, e[20] = h, e[21] = oe, e[22] = v, e[23] = y, e[24] = w, e[25] = I, e[26] = g, e[27] = u, e[28] = c, e[29] = a, e[30] = s, e[31] = n, e[32] = ne, e[33] = ie, e[34] = S, e[35] = le, e[36] = _, e[37] = Q) : Q = e[37];
|
|
311
|
+
const T = Q;
|
|
312
|
+
if ($) {
|
|
313
|
+
let Z;
|
|
314
|
+
e[38] === Symbol.for("react.memo_cache_sentinel") ? (Z = de(Se, "flex max-h-[90vh] flex-col overflow-hidden rounded-t-[20px] border-0 p-0"), e[38] = Z) : Z = e[38];
|
|
315
|
+
let M;
|
|
316
|
+
e[39] !== S ? (M = /* @__PURE__ */ l(be, { className: "sr-only", children: /* @__PURE__ */ l(Ne, { children: S }) }), e[39] = S, e[40] = M) : M = e[40];
|
|
317
|
+
let H;
|
|
318
|
+
e[41] !== T ? (H = /* @__PURE__ */ l(ce, { ...T, surface: "drawer" }), e[41] = T, e[42] = H) : H = e[42];
|
|
319
|
+
let z;
|
|
320
|
+
e[43] !== M || e[44] !== H ? (z = /* @__PURE__ */ D(Le, { "aria-describedby": void 0, className: Z, "data-login-drawer-content": !0, children: [
|
|
321
|
+
M,
|
|
322
|
+
H
|
|
323
|
+
] }), e[43] = M, e[44] = H, e[45] = z) : z = e[45];
|
|
324
|
+
let ee;
|
|
325
|
+
return e[46] !== o || e[47] !== i || e[48] !== z ? (ee = /* @__PURE__ */ l(ye, { open: i, onOpenChange: o, children: z }), e[46] = o, e[47] = i, e[48] = z, e[49] = ee) : ee = e[49], ee;
|
|
326
|
+
}
|
|
327
|
+
let W;
|
|
328
|
+
e[50] !== S ? (W = /* @__PURE__ */ l(ge, { className: "sr-only", children: /* @__PURE__ */ l(he, { children: S }) }), e[50] = S, e[51] = W) : W = e[51];
|
|
329
|
+
let B;
|
|
330
|
+
e[52] !== T ? (B = /* @__PURE__ */ l(ce, { ...T, surface: "dialog" }), e[52] = T, e[53] = B) : B = e[53];
|
|
331
|
+
let R;
|
|
332
|
+
e[54] !== W || e[55] !== B ? (R = /* @__PURE__ */ D(xe, { "aria-describedby": void 0, className: "max-w-[320px] overflow-visible rounded-2xl border-0 bg-transparent p-0 shadow-none", closeOnOutsideClick: !0, showCloseButton: !1, size: "sm", children: [
|
|
333
|
+
W,
|
|
334
|
+
B
|
|
335
|
+
] }), e[54] = W, e[55] = B, e[56] = R) : R = e[56];
|
|
336
|
+
let V;
|
|
337
|
+
return e[57] !== o || e[58] !== i || e[59] !== R ? (V = /* @__PURE__ */ l(ve, { open: i, onOpenChange: o, modal: !0, children: R }), e[57] = o, e[58] = i, e[59] = R, e[60] = V) : V = e[60], V;
|
|
338
|
+
}
|
|
339
|
+
function ze() {
|
|
340
|
+
return document.body.classList.remove(se);
|
|
341
|
+
}
|
|
342
|
+
export {
|
|
343
|
+
Ze as DoctLoginDialog
|
|
344
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const o = {
|
|
3
|
+
illustration: "/login/login-image.png",
|
|
4
|
+
googleIcon: "/login/google-icon.svg",
|
|
5
|
+
appleIcon: "/login/apple-icon.svg"
|
|
6
|
+
}, n = {
|
|
7
|
+
guest: {
|
|
8
|
+
title: "Login to Continue",
|
|
9
|
+
description: "You can log in using your phone, email or Google account."
|
|
10
|
+
},
|
|
11
|
+
signup: {
|
|
12
|
+
title: "Login to Continue",
|
|
13
|
+
description: "If you already have an account we'll log you in, or continue to signup."
|
|
14
|
+
},
|
|
15
|
+
returning: {
|
|
16
|
+
title: "Login to Continue",
|
|
17
|
+
/** Overridden by `LOGIN_DIALOG_RETURNING_HINT` when `description` is omitted. */
|
|
18
|
+
description: ""
|
|
19
|
+
}
|
|
20
|
+
}, i = {
|
|
21
|
+
google: "Last time you used Google to log in.",
|
|
22
|
+
apple: "Last time you used Apple to log in.",
|
|
23
|
+
mobile: "Last time you used your mobile number to log in.",
|
|
24
|
+
email: "Last time you used your email to log in."
|
|
25
|
+
}, e = {
|
|
26
|
+
google: "Continue with Google",
|
|
27
|
+
apple: "Continue with Apple",
|
|
28
|
+
mobile: "Continue with Mobile",
|
|
29
|
+
email: "Continue with Email"
|
|
30
|
+
}, t = "Continue with Phone/Email", l = "Continue Another Way";
|
|
31
|
+
export {
|
|
32
|
+
o as LOGIN_DIALOG_ASSETS,
|
|
33
|
+
l as LOGIN_DIALOG_CONTINUE_ANOTHER_WAY_LABEL,
|
|
34
|
+
t as LOGIN_DIALOG_CONTINUE_PHONE_EMAIL_LABEL,
|
|
35
|
+
n as LOGIN_DIALOG_DEFAULT_COPY,
|
|
36
|
+
i as LOGIN_DIALOG_RETURNING_HINT,
|
|
37
|
+
e as LOGIN_DIALOG_RETURNING_PRIMARY_LABEL
|
|
38
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as a, jsxs as F } from "react/jsx-runtime";
|
|
3
3
|
import { c as Le } from "react-compiler-runtime";
|
|
4
4
|
import K from "dayjs";
|
|
5
5
|
import $e from "dayjs/plugin/customParseFormat";
|
|
@@ -23,29 +23,29 @@ const Qe = i.memo(function(B) {
|
|
|
23
23
|
} = B, V = r === void 0 ? "en" : r, c = s === void 0 ? 2 : s;
|
|
24
24
|
let u;
|
|
25
25
|
e[0] !== m || e[1] !== l ? (u = () => {
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const d = new Date(m);
|
|
27
|
+
d.setMonth(d.getMonth() - 1), l(d);
|
|
28
28
|
}, e[0] = m, e[1] = l, e[2] = u) : u = e[2];
|
|
29
29
|
const h = u;
|
|
30
30
|
let k;
|
|
31
31
|
e[3] !== m || e[4] !== l ? (k = () => {
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const d = new Date(m);
|
|
33
|
+
d.setMonth(d.getMonth() + 1), l(d);
|
|
34
34
|
}, e[3] = m, e[4] = l, e[5] = k) : k = e[5];
|
|
35
35
|
const M = k;
|
|
36
36
|
let O;
|
|
37
37
|
if (e[6] !== V || e[7] !== m || e[8] !== c) {
|
|
38
|
-
let
|
|
39
|
-
e[10] !== V || e[11] !== m ? (
|
|
38
|
+
let d;
|
|
39
|
+
e[10] !== V || e[11] !== m ? (d = (se, W) => K(m).add(W, "month").locale(V).format("MMMM YYYY"), e[10] = V, e[11] = m, e[12] = d) : d = e[12], O = Array.from({
|
|
40
40
|
length: c
|
|
41
|
-
},
|
|
41
|
+
}, d), e[6] = V, e[7] = m, e[8] = c, e[9] = O;
|
|
42
42
|
} else
|
|
43
43
|
O = e[9];
|
|
44
44
|
const v = O;
|
|
45
45
|
let L;
|
|
46
|
-
e[13] === Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */
|
|
46
|
+
e[13] === Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ a(ze, { className: "h-4 w-4" }), e[13] = L) : L = e[13];
|
|
47
47
|
let b;
|
|
48
|
-
e[14] !== h ? (b = /* @__PURE__ */
|
|
48
|
+
e[14] !== h ? (b = /* @__PURE__ */ a("button", { type: "button", onClick: h, className: "flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background p-0 text-foreground hover:bg-accent", "aria-label": "Previous month", children: L }), e[14] = h, e[15] = b) : b = e[15];
|
|
49
49
|
const T = `repeat(${c}, minmax(0, 1fr))`;
|
|
50
50
|
let P;
|
|
51
51
|
e[16] !== T ? (P = {
|
|
@@ -54,11 +54,11 @@ const Qe = i.memo(function(B) {
|
|
|
54
54
|
let p;
|
|
55
55
|
e[18] !== v ? (p = v.map(Ze), e[18] = v, e[19] = p) : p = e[19];
|
|
56
56
|
let x;
|
|
57
|
-
e[20] !== p || e[21] !== P ? (x = /* @__PURE__ */
|
|
57
|
+
e[20] !== p || e[21] !== P ? (x = /* @__PURE__ */ a("div", { className: "grid flex-1 gap-2 px-2 text-center text-sm font-semibold text-foreground", style: P, children: p }), e[20] = p, e[21] = P, e[22] = x) : x = e[22];
|
|
58
58
|
let D;
|
|
59
|
-
e[23] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */
|
|
59
|
+
e[23] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ a(Ae, { className: "h-4 w-4" }), e[23] = D) : D = e[23];
|
|
60
60
|
let R;
|
|
61
|
-
e[24] !== M ? (R = /* @__PURE__ */
|
|
61
|
+
e[24] !== M ? (R = /* @__PURE__ */ a("button", { type: "button", onClick: M, className: "flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background p-0 text-foreground hover:bg-accent", "aria-label": "Next month", children: D }), e[24] = M, e[25] = R) : R = e[25];
|
|
62
62
|
let $;
|
|
63
63
|
return e[26] !== x || e[27] !== R || e[28] !== b ? ($ = /* @__PURE__ */ F("div", { className: "flex items-center border-b border-border bg-muted px-2 py-1.5", children: [
|
|
64
64
|
b,
|
|
@@ -90,7 +90,7 @@ const Qe = i.memo(function(B) {
|
|
|
90
90
|
open: D,
|
|
91
91
|
onOpenChange: R,
|
|
92
92
|
dayPickerProps: $,
|
|
93
|
-
manual:
|
|
93
|
+
manual: d = !1,
|
|
94
94
|
// Default to false: calendar-only selection unless enabled
|
|
95
95
|
popoverAlign: se = "end",
|
|
96
96
|
iconPosition: W = "right",
|
|
@@ -106,16 +106,16 @@ const Qe = i.memo(function(B) {
|
|
|
106
106
|
...ye
|
|
107
107
|
}) => {
|
|
108
108
|
const {
|
|
109
|
-
disabled:
|
|
109
|
+
disabled: de,
|
|
110
110
|
fromDate: Ce,
|
|
111
111
|
toDate: Se,
|
|
112
112
|
startMonth: he,
|
|
113
113
|
endMonth: ve,
|
|
114
114
|
showOutsideDays: xe,
|
|
115
115
|
...C
|
|
116
|
-
} = $ ?? {}, ge = T ?? xe,
|
|
116
|
+
} = $ ?? {}, ge = T ?? xe, ae = L ?? v, [we, ke] = i.useState(!1), q = D !== void 0 ? D : we, j = R || ke, [S, y] = i.useState(""), [E, g] = i.useState(l), [ne, le] = i.useState(p ?? (l == null ? void 0 : l.from) ?? /* @__PURE__ */ new Date()), ce = i.useMemo(() => p ?? ne, [p, ne]), G = i.useCallback((t) => {
|
|
117
117
|
x ? x(t) : le(t);
|
|
118
|
-
}, [x]), Me = i.useMemo(() => B || (
|
|
118
|
+
}, [x]), Me = i.useMemo(() => B || (d ? `${v.toLowerCase()} - ${v.toLowerCase()}` : "Click to select date range"), [B, v, d]), H = i.useCallback((t) => K(t).locale(M).format(ae), [ae, M]), w = i.useCallback((t) => t != null && t.from ? t.from && t.to ? `${H(t.from)} - ${H(t.to)}` : H(t.from) : "", [H]), J = i.useCallback((t) => {
|
|
119
119
|
const o = t.trim();
|
|
120
120
|
if (!o) return null;
|
|
121
121
|
const f = K(o, v, !0).locale(M);
|
|
@@ -175,7 +175,8 @@ const Qe = i.memo(function(B) {
|
|
|
175
175
|
// react-day-picker v9 selection state keys
|
|
176
176
|
selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
177
177
|
day_today: "bg-accent text-accent-foreground",
|
|
178
|
-
|
|
178
|
+
// react-day-picker v9 uses modifier key `outside` (not `day_outside`); `.day-outside` kept for `[&:has(...day-outside)]` cell selectors.
|
|
179
|
+
outside: "day-outside text-muted-foreground/60 [&_button:not(:disabled)]:text-muted-foreground/60 hover:[&_button:not(:disabled)]:text-muted-foreground",
|
|
179
180
|
disabled: "text-muted-foreground opacity-40 grayscale pointer-events-none cursor-not-allowed",
|
|
180
181
|
day_disabled: "text-muted-foreground opacity-40 grayscale pointer-events-none cursor-not-allowed",
|
|
181
182
|
day_range_middle: (
|
|
@@ -186,12 +187,12 @@ const Qe = i.memo(function(B) {
|
|
|
186
187
|
// react-day-picker v9 selection state keys
|
|
187
188
|
range_middle: "!bg-muted !text-foreground rounded-none [&>button]:!rounded-none",
|
|
188
189
|
day_hidden: "invisible"
|
|
189
|
-
}), []), _e = i.useMemo(() => He(Je(c, u),
|
|
190
|
+
}), []), _e = i.useMemo(() => He(Je(c, u), de), [c, u, de]), Pe = c ? me(c) : he, Re = u ? me(u) : ve;
|
|
190
191
|
i.useEffect(() => {
|
|
191
192
|
y(w(l)), g(l), l != null && l.from && !p && le(l.from);
|
|
192
193
|
}, [l, w, p]);
|
|
193
194
|
const Ve = i.useCallback((t) => {
|
|
194
|
-
if (!
|
|
195
|
+
if (!d) return;
|
|
195
196
|
let o = t.target.value;
|
|
196
197
|
if (y(o), !o.trim()) {
|
|
197
198
|
g(void 0), r == null || r(void 0), s == null || s(void 0);
|
|
@@ -201,7 +202,7 @@ const Qe = i.memo(function(B) {
|
|
|
201
202
|
f !== o && (y(f), o = f);
|
|
202
203
|
const n = Q(o);
|
|
203
204
|
n && U(n, c, u) && (g(n), r == null || r(n), s == null || s(n));
|
|
204
|
-
}, [
|
|
205
|
+
}, [d, r, s, ue, Q, c, u]), ee = i.useCallback(() => {
|
|
205
206
|
const t = S.trim();
|
|
206
207
|
if (!t) {
|
|
207
208
|
g(void 0), r == null || r(void 0), s == null || s(void 0);
|
|
@@ -217,12 +218,12 @@ const Qe = i.memo(function(B) {
|
|
|
217
218
|
const o = t.getRange();
|
|
218
219
|
U(o, c, u) && (y(w(o)), g(o), o.from && G(o.from), r == null || r(o), s == null || s(o));
|
|
219
220
|
}, [w, G, c, u, s, r]), Ee = !!(P && E && !h && !k), N = !!(h || k), Ye = i.useCallback((t) => {
|
|
220
|
-
if (!
|
|
221
|
+
if (!d) {
|
|
221
222
|
!N && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), j(!q));
|
|
222
223
|
return;
|
|
223
224
|
}
|
|
224
225
|
t.key === "Enter" && (t.preventDefault(), ee());
|
|
225
|
-
}, [
|
|
226
|
+
}, [d, ee, j, q, N]), Oe = i.useMemo(() => {
|
|
226
227
|
var t, o;
|
|
227
228
|
if (z) {
|
|
228
229
|
if (i.isValidElement(z)) {
|
|
@@ -237,51 +238,51 @@ const Qe = i.memo(function(B) {
|
|
|
237
238
|
}
|
|
238
239
|
});
|
|
239
240
|
}
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ a("span", { className: _("h-5 w-5 inline-flex items-center justify-center", X), style: I ? {
|
|
241
242
|
color: I
|
|
242
243
|
} : void 0, children: z });
|
|
243
244
|
}
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ a(Be, { strokeWidth: 1, className: _("h-5 w-5", X, h && "opacity-50"), style: I ? {
|
|
245
246
|
color: I
|
|
246
247
|
} : void 0 });
|
|
247
248
|
}, [z, X, I, h]);
|
|
248
249
|
return /* @__PURE__ */ F("div", { className: _("space-y-1", V), ...ye, children: [
|
|
249
250
|
Y && /* @__PURE__ */ F(Xe, { className: "text-sm font-medium text-foreground", children: [
|
|
250
251
|
Y,
|
|
251
|
-
m && /* @__PURE__ */
|
|
252
|
+
m && /* @__PURE__ */ a("span", { className: "text-red-500 ml-1", children: "*" })
|
|
252
253
|
] }),
|
|
253
254
|
/* @__PURE__ */ F(qe, { open: q, onOpenChange: (t) => {
|
|
254
255
|
N && t || j(t);
|
|
255
256
|
}, children: [
|
|
256
|
-
ie ? /* @__PURE__ */
|
|
257
|
-
|
|
257
|
+
ie ? /* @__PURE__ */ a(fe, { asChild: !0, children: ie }) : /* @__PURE__ */ F("div", { className: _("w-80 relative", O), onMouseDownCapture: () => {
|
|
258
|
+
d && be && !h && !k && j(!0);
|
|
258
259
|
}, children: [
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
(!
|
|
261
|
-
}, placeholder: Me, disabled: h, readOnly: k || !
|
|
262
|
-
Ee && /* @__PURE__ */
|
|
263
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ a(We, { type: "text", value: S, onChange: Ve, onBlur: ee, onKeyDown: Ye, onClick: () => {
|
|
261
|
+
(!d && !N || d && pe && !N) && j(!0);
|
|
262
|
+
}, placeholder: Me, disabled: h, readOnly: k || !d, className: _("w-full pr-12", W === "left" && "pl-12", b && "border border-destructive focus-visible:ring-destructive", !d && !N && "cursor-pointer") }),
|
|
263
|
+
Ee && /* @__PURE__ */ a("button", { type: "button", onClick: Ie, className: "absolute right-10 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring", "aria-label": "Clear date range", children: /* @__PURE__ */ a(Te, { className: "h-4 w-4 text-muted-foreground" }) }),
|
|
264
|
+
/* @__PURE__ */ a(fe, { asChild: !0, children: /* @__PURE__ */ a("button", { type: "button", className: _("absolute top-1/2 -translate-y-1/2 border-0 bg-transparent outline-none", W === "left" ? "left-3" : "right-1", N ? "cursor-default text-muted-foreground" : "cursor-pointer text-black hover:text-black"), style: {
|
|
264
265
|
height: "1.75rem",
|
|
265
266
|
width: "1.75rem"
|
|
266
267
|
}, onClick: N ? void 0 : () => {
|
|
267
268
|
j(!q);
|
|
268
269
|
}, disabled: N, "aria-label": "Open calendar", children: Oe }) })
|
|
269
270
|
] }),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
Z && Z.length > 0 && /* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ a(Ge, { className: "w-auto p-0 mt-2", align: se, children: /* @__PURE__ */ F("div", { className: "rounded-md border border-border bg-popover text-popover-foreground shadow-md", children: [
|
|
272
|
+
Z && Z.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 p-3 border-b bg-muted/40", children: Z.map((t) => /* @__PURE__ */ a("button", { type: "button", className: "rounded-md border bg-background px-2.5 py-1.5 text-xs font-medium hover:bg-accent hover:text-accent-foreground", onClick: () => je(t), children: t.label }, t.label)) }),
|
|
273
|
+
/* @__PURE__ */ a(Qe, { month: ce, onMonthChange: G, locale: M, numberOfMonths: oe }),
|
|
274
|
+
/* @__PURE__ */ a("div", { className: "p-3", children: /* @__PURE__ */ a(Ke, { ...C, mode: "range", selected: E, onSelect: De, month: ce, onMonthChange: G, startMonth: Pe, endMonth: Re, disabled: _e, numberOfMonths: oe, showOutsideDays: ge, className: _("p-0", C.className), classNames: {
|
|
274
275
|
...Ne,
|
|
275
276
|
...C.classNames
|
|
276
277
|
} }) })
|
|
277
278
|
] }) })
|
|
278
279
|
] }),
|
|
279
|
-
(e || b) && /* @__PURE__ */
|
|
280
|
+
(e || b) && /* @__PURE__ */ a("p", { className: _("text-xs", b ? "text-destructive" : "text-muted-foreground"), children: b || e })
|
|
280
281
|
] });
|
|
281
282
|
});
|
|
282
283
|
Ue.displayName = "DateRangePickerField";
|
|
283
284
|
function Ze(Y) {
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ a("span", { className: "truncate", children: Y }, Y);
|
|
285
286
|
}
|
|
286
287
|
export {
|
|
287
288
|
Ue as DateRangePickerField
|