@clasing/ui 2.9.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/calendar.js +42 -38
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { j as n, c as e } from "../index-C_XDkVGm.js";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { getDefaultClassNames as
|
|
4
|
-
import { b as
|
|
3
|
+
import { getDefaultClassNames as m, DayPicker as x } from "react-day-picker";
|
|
4
|
+
import { b as f, B as h } from "../button-DSpGxL2e.js";
|
|
5
5
|
import { CaretLeftIcon as w, CaretRightIcon as _, CaretDownIcon as y } from "@phosphor-icons/react";
|
|
6
6
|
function C({
|
|
7
7
|
className: c,
|
|
8
8
|
classNames: g,
|
|
9
|
-
showOutsideDays:
|
|
9
|
+
showOutsideDays: r = !0,
|
|
10
10
|
captionLayout: s = "label",
|
|
11
11
|
buttonVariant: l = "ghost",
|
|
12
12
|
formatters: u,
|
|
13
|
-
components:
|
|
14
|
-
...
|
|
13
|
+
components: b,
|
|
14
|
+
...p
|
|
15
15
|
}) {
|
|
16
|
-
const t =
|
|
16
|
+
const t = m();
|
|
17
17
|
return /* @__PURE__ */ n.jsx(
|
|
18
18
|
x,
|
|
19
19
|
{
|
|
20
|
-
showOutsideDays:
|
|
20
|
+
showOutsideDays: r,
|
|
21
21
|
className: e(
|
|
22
22
|
`
|
|
23
23
|
group/calendar bg-background p-3 [--cell-size:--spacing(8)]
|
|
@@ -30,7 +30,7 @@ function C({
|
|
|
30
30
|
),
|
|
31
31
|
captionLayout: s,
|
|
32
32
|
formatters: {
|
|
33
|
-
formatMonthDropdown: (
|
|
33
|
+
formatMonthDropdown: (a) => a.toLocaleString("default", { month: "short" }),
|
|
34
34
|
...u
|
|
35
35
|
},
|
|
36
36
|
classNames: {
|
|
@@ -51,7 +51,7 @@ function C({
|
|
|
51
51
|
t.nav
|
|
52
52
|
),
|
|
53
53
|
button_previous: e(
|
|
54
|
-
|
|
54
|
+
f({ size: "sm", variant: l }),
|
|
55
55
|
`
|
|
56
56
|
size-(--cell-size) p-0 select-none
|
|
57
57
|
aria-disabled:opacity-50
|
|
@@ -59,7 +59,7 @@ function C({
|
|
|
59
59
|
t.button_previous
|
|
60
60
|
),
|
|
61
61
|
button_next: e(
|
|
62
|
-
|
|
62
|
+
f({ size: "sm", variant: l }),
|
|
63
63
|
`
|
|
64
64
|
size-(--cell-size) p-0 select-none
|
|
65
65
|
aria-disabled:opacity-50
|
|
@@ -155,7 +155,7 @@ function C({
|
|
|
155
155
|
},
|
|
156
156
|
components: {
|
|
157
157
|
Root: ({
|
|
158
|
-
className:
|
|
158
|
+
className: a,
|
|
159
159
|
rootRef: d,
|
|
160
160
|
...o
|
|
161
161
|
}) => /* @__PURE__ */ n.jsx(
|
|
@@ -163,73 +163,77 @@ function C({
|
|
|
163
163
|
{
|
|
164
164
|
"data-slot": "calendar",
|
|
165
165
|
ref: d,
|
|
166
|
-
className: e(
|
|
166
|
+
className: e(a),
|
|
167
167
|
...o
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
|
-
Chevron: ({ className:
|
|
170
|
+
Chevron: ({ className: a, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n.jsx(w, { className: e(a), ...o }) : d === "right" ? /* @__PURE__ */ n.jsx(_, { className: e(a), ...o }) : /* @__PURE__ */ n.jsx(y, { ...o }),
|
|
171
171
|
DayButton: v,
|
|
172
|
-
WeekNumber: ({ children:
|
|
172
|
+
WeekNumber: ({ children: a, ...d }) => /* @__PURE__ */ n.jsx("td", { ...d, children: /* @__PURE__ */ n.jsx(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
175
|
className: `\r
|
|
176
176
|
flex size-(--cell-size) items-center justify-center\r
|
|
177
177
|
text-center\r
|
|
178
178
|
`,
|
|
179
|
-
children:
|
|
179
|
+
children: a
|
|
180
180
|
}
|
|
181
181
|
) }),
|
|
182
|
-
...
|
|
182
|
+
...b
|
|
183
183
|
},
|
|
184
|
-
...
|
|
184
|
+
...p
|
|
185
185
|
}
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
188
|
function v({
|
|
189
189
|
className: c,
|
|
190
190
|
day: g,
|
|
191
|
-
modifiers:
|
|
191
|
+
modifiers: r,
|
|
192
192
|
...s
|
|
193
193
|
}) {
|
|
194
|
-
const l =
|
|
194
|
+
const l = m(), u = i.useRef(null);
|
|
195
195
|
return i.useEffect(() => {
|
|
196
|
-
|
|
197
|
-
}, [
|
|
196
|
+
r.focused && u.current?.focus();
|
|
197
|
+
}, [r.focused]), /* @__PURE__ */ n.jsx(
|
|
198
198
|
h,
|
|
199
199
|
{
|
|
200
200
|
ref: u,
|
|
201
201
|
variant: "ghost",
|
|
202
202
|
size: "xs",
|
|
203
203
|
"data-day": g.date.toLocaleDateString(),
|
|
204
|
-
"data-selected-single":
|
|
205
|
-
"data-range-start":
|
|
206
|
-
"data-range-end":
|
|
207
|
-
"data-range-middle":
|
|
204
|
+
"data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
|
|
205
|
+
"data-range-start": r.range_start,
|
|
206
|
+
"data-range-end": r.range_end,
|
|
207
|
+
"data-range-middle": r.range_middle,
|
|
208
208
|
className: e(
|
|
209
209
|
`
|
|
210
210
|
flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1
|
|
211
|
-
|
|
211
|
+
p-1 leading-none font-regular
|
|
212
212
|
group-data-[focused=true]/day:relative
|
|
213
213
|
group-data-[focused=true]/day:z-10
|
|
214
214
|
group-data-[focused=true]/day:border-ring
|
|
215
215
|
group-data-[focused=true]/day:ring-[3px]
|
|
216
216
|
group-data-[focused=true]/day:ring-ring/50
|
|
217
|
-
|
|
218
|
-
data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-blue-500
|
|
217
|
+
before:rounded-md before:bg-transparent
|
|
219
218
|
data-[range-end=true]:text-white
|
|
220
|
-
data-[range-end=true]:
|
|
221
|
-
data-[range-
|
|
222
|
-
data-[range-
|
|
219
|
+
data-[range-end=true]:before:rounded-md
|
|
220
|
+
data-[range-end=true]:before:rounded-l-none
|
|
221
|
+
data-[range-end=true]:before:rounded-r-md
|
|
222
|
+
data-[range-end=true]:before:bg-blue-500
|
|
223
|
+
data-[range-end=true]:hover:before:bg-blue-500/80
|
|
223
224
|
data-[range-middle=true]:text-blue-800
|
|
224
|
-
data-[range-
|
|
225
|
-
data-[range-
|
|
226
|
-
data-[range-start=true]:
|
|
227
|
-
data-[range-start=true]:
|
|
228
|
-
data-[range-start=true]:
|
|
229
|
-
data-[
|
|
225
|
+
data-[range-middle=true]:before:rounded-none
|
|
226
|
+
data-[range-middle=true]:before:bg-blue-500/10
|
|
227
|
+
data-[range-start=true]:text-white
|
|
228
|
+
data-[range-start=true]:before:rounded-md
|
|
229
|
+
data-[range-start=true]:before:rounded-l-md
|
|
230
|
+
data-[range-start=true]:before:rounded-r-none
|
|
231
|
+
data-[range-start=true]:before:bg-blue-500
|
|
232
|
+
data-[range-start=true]:hover:before:bg-blue-500/80
|
|
230
233
|
data-[selected-single=true]:text-white
|
|
231
|
-
data-[selected-single=true]:
|
|
234
|
+
data-[selected-single=true]:before:bg-blue-500
|
|
232
235
|
data-[selected-single=true]:hover:text-white
|
|
236
|
+
data-[selected-single=true]:hover:before:bg-blue-500/80
|
|
233
237
|
dark:hover:text-accent-foreground
|
|
234
238
|
dark:data-[range-middle=true]:text-blue-050
|
|
235
239
|
[&>span]:paragraph-xs [&>span]:opacity-70
|