ics-ui-kit 0.1.19 → 0.1.21
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/CalendarPreviousMonthButton-qT7qDPbO.js +133 -0
- package/dist/CalendarPreviousMonthButton-qT7qDPbO.js.map +1 -0
- package/dist/{DayPicker-4hE1QEvO.js → DayPicker-Cu2Kn-he.js} +68 -66
- package/dist/{DayPicker-4hE1QEvO.js.map → DayPicker-Cu2Kn-he.js.map} +1 -1
- package/dist/components/calendar/components/calendar-dropdown/CalendarDropdown.d.ts +24 -0
- package/dist/components/calendar/styles.d.ts +61 -0
- package/dist/components/calendar-scroll/CalendarScroll.d.ts +21 -0
- package/dist/components/calendar-scroll/CalendarScroll.stories.d.ts +16 -0
- package/dist/components/calendar-scroll/index.d.ts +3 -0
- package/dist/components/calendar-scroll.d.ts +2 -0
- package/dist/components/calendar-scroll.js +184 -0
- package/dist/components/calendar-scroll.js.map +1 -0
- package/dist/components/calendar.js +53 -148
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/resizable.js +26 -1530
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/sidebar.js +142 -141
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/textarea.js +30 -189
- package/dist/components/textarea.js.map +1 -1
- package/dist/ssr.test.d.ts +1 -0
- package/dist/styles-scoped.css +38 -18
- package/dist/styles.css +38 -18
- package/dist/useIsomorphicLayoutEffect-MNxJD61V.js +6 -0
- package/dist/useIsomorphicLayoutEffect-MNxJD61V.js.map +1 -0
- package/dist/vendors/react-day-picker.js +2 -2
- package/package.json +1 -1
- package/tailwind.preset.js +5 -5
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { ClassNames, CustomComponents, DropdownOption } from 'react-day-picker';
|
|
3
|
+
export type CalendarDropdownProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "children"> & {
|
|
4
|
+
options?: DropdownOption[];
|
|
5
|
+
/** Передаёт react-day-picker: переопределения классов потребителя */
|
|
6
|
+
classNames?: Partial<ClassNames>;
|
|
7
|
+
/** Передаёт react-day-picker: переопределения компонентов потребителя */
|
|
8
|
+
components?: Partial<CustomComponents>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Селект месяца/года в шапке календаря: прозрачный нативный select поверх подписи с шевроном.
|
|
12
|
+
*
|
|
13
|
+
* В отличие от штатного Dropdown из react-day-picker, подпись резервирует ширину самой длинной
|
|
14
|
+
* опции: все подписи лежат в одной grid-ячейке, видна только выбранная. Иначе при смене месяца
|
|
15
|
+
* («май» → «сентябрь») меняется ширина и шапка, выровненная по центру, дёргается.
|
|
16
|
+
*
|
|
17
|
+
* @param options - Опции селекта
|
|
18
|
+
* @param className - Дополнительные CSS классы для select
|
|
19
|
+
* @param props - Атрибуты нативного select
|
|
20
|
+
*/
|
|
21
|
+
export declare const CalendarDropdown: {
|
|
22
|
+
({ options, className, classNames, components, ...props }: CalendarDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { TVReturnType } from 'tailwind-variants';
|
|
2
|
+
import { ClassNameValue } from 'tailwind-merge';
|
|
3
|
+
/**
|
|
4
|
+
* Селект месяца/года в шапке календаря: прозрачный нативный select поверх подписи с шевроном.
|
|
5
|
+
* Общий для Calendar (через classNames react-day-picker) и CalendarScroll (своя разметка).
|
|
6
|
+
*/
|
|
7
|
+
export declare const calendarDropdownStyles: TVReturnType<{
|
|
8
|
+
[key: string]: {
|
|
9
|
+
[key: string]: ClassNameValue | {
|
|
10
|
+
label?: ClassNameValue;
|
|
11
|
+
select?: ClassNameValue;
|
|
12
|
+
sizer?: ClassNameValue;
|
|
13
|
+
sizerItem?: ClassNameValue;
|
|
14
|
+
sizerItemHidden?: ClassNameValue;
|
|
15
|
+
root?: ClassNameValue;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
[x: string]: {
|
|
20
|
+
[x: string]: ClassNameValue | {
|
|
21
|
+
label?: ClassNameValue;
|
|
22
|
+
select?: ClassNameValue;
|
|
23
|
+
sizer?: ClassNameValue;
|
|
24
|
+
sizerItem?: ClassNameValue;
|
|
25
|
+
sizerItemHidden?: ClassNameValue;
|
|
26
|
+
root?: ClassNameValue;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
} | {}, {
|
|
30
|
+
root: string[];
|
|
31
|
+
select: string;
|
|
32
|
+
label: string[];
|
|
33
|
+
sizer: string;
|
|
34
|
+
sizerItem: string;
|
|
35
|
+
sizerItemHidden: string;
|
|
36
|
+
}, undefined, {
|
|
37
|
+
[key: string]: {
|
|
38
|
+
[key: string]: ClassNameValue | {
|
|
39
|
+
label?: ClassNameValue;
|
|
40
|
+
select?: ClassNameValue;
|
|
41
|
+
sizer?: ClassNameValue;
|
|
42
|
+
sizerItem?: ClassNameValue;
|
|
43
|
+
sizerItemHidden?: ClassNameValue;
|
|
44
|
+
root?: ClassNameValue;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
} | {}, {
|
|
48
|
+
root: string[];
|
|
49
|
+
select: string;
|
|
50
|
+
label: string[];
|
|
51
|
+
sizer: string;
|
|
52
|
+
sizerItem: string;
|
|
53
|
+
sizerItemHidden: string;
|
|
54
|
+
}, TVReturnType<unknown, {
|
|
55
|
+
root: string[];
|
|
56
|
+
select: string;
|
|
57
|
+
label: string[];
|
|
58
|
+
sizer: string;
|
|
59
|
+
sizerItem: string;
|
|
60
|
+
sizerItemHidden: string;
|
|
61
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DayPickerProps } from 'react-day-picker';
|
|
2
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
3
|
+
/** Пропсы DayPicker, которыми управляет сам CalendarScroll */
|
|
4
|
+
type ManagedProps = "month" | "onMonthChange" | "numberOfMonths" | "captionLayout" | "fixedWeeks" | "hideNavigation" | "showOutsideDays" | "pagedNavigation" | "reverseMonths";
|
|
5
|
+
export type CalendarScrollProps = DistributiveOmit<DayPickerProps, ManagedProps>;
|
|
6
|
+
/**
|
|
7
|
+
* CalendarScroll — календарь с вертикальным скроллом месяцев (как в мобильных банках).
|
|
8
|
+
*
|
|
9
|
+
* Месяцы идут друг за другом, сверху общая шапка с селектами месяца и года для быстрого
|
|
10
|
+
* прыжка. Селекты синхронизированы со скроллом. В DOM лежит только окно из нескольких
|
|
11
|
+
* месяцев, поэтому диапазон может быть широким (по умолчанию ±100 лет). Виртуализацию лучше
|
|
12
|
+
* не отключать: без неё DayPicker пересчитывал бы дни всех месяцев диапазона на каждом рендере.
|
|
13
|
+
*
|
|
14
|
+
* Высота задаётся через `className` (по умолчанию 420px). Выбор дат — те же `mode`,
|
|
15
|
+
* `selected`, `onSelect`, что и у Calendar.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CalendarScroll: {
|
|
18
|
+
({ className, classNames, locale, weekStartsOn, startMonth, endMonth, defaultMonth, components, ...props }: CalendarScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CalendarScroll, CalendarScrollProps } from './CalendarScroll';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: {
|
|
5
|
+
({ className, classNames, locale, weekStartsOn, startMonth, endMonth, defaultMonth, components, ...props }: CalendarScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof CalendarScroll>;
|
|
15
|
+
export declare const Default: Story;
|
|
16
|
+
export declare const Range: Story;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { jsx as n, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { n as ue } from "../useIsomorphicLayoutEffect-MNxJD61V.js";
|
|
3
|
+
import { useRef as C, useState as L, useCallback as N, useEffect as Z, useMemo as i, Children as me, cloneElement as fe, isValidElement as he } from "react";
|
|
4
|
+
import { T as pe } from "../index-BVqs-uqP.js";
|
|
5
|
+
import { C as be, a as H, b as P, c as we, d as xe } from "../CalendarPreviousMonthButton-qT7qDPbO.js";
|
|
6
|
+
import { f as q, e as ye, a as Me, l as ve, b as ge, c as De, d as Ee, D as Ne, M as Se } from "../DayPicker-Cu2Kn-he.js";
|
|
7
|
+
import { s as Ce } from "../normalizeDates-9A3c9WYM.js";
|
|
8
|
+
const d = 280, V = 4, G = 1, Fe = 100, ke = 2100, _e = pe({
|
|
9
|
+
slots: {
|
|
10
|
+
root: [
|
|
11
|
+
"flex h-[420px] w-fit flex-col overflow-hidden rounded-md",
|
|
12
|
+
"border border-solid border-secondary-border bg-secondary-bg shadow-soft-sm"
|
|
13
|
+
],
|
|
14
|
+
header: "flex flex-col gap-2 border-b border-secondary-border p-3 pb-2",
|
|
15
|
+
nav: "flex h-9 items-center justify-between gap-1",
|
|
16
|
+
dropdowns: "flex items-center justify-center gap-1.5 text-sm font-medium capitalize",
|
|
17
|
+
weekdays: "flex",
|
|
18
|
+
weekday: "w-9 shrink-0 text-center text-xs font-medium text-muted-foreground opacity-70",
|
|
19
|
+
scroller: "relative flex-1 overflow-y-auto overscroll-contain px-3",
|
|
20
|
+
window: "absolute inset-x-3 top-0"
|
|
21
|
+
}
|
|
22
|
+
}), B = (o) => o.getFullYear() * 12 + o.getMonth(), h = (o) => new Date(Math.floor(o / 12), o % 12, 1), S = (o, s, a) => Math.min(Math.max(o, s), a), Te = ({ modifiers: o, ...s }) => {
|
|
23
|
+
const a = C(null), m = C(!0);
|
|
24
|
+
return Z(() => {
|
|
25
|
+
const F = m.current;
|
|
26
|
+
if (m.current = !1, !o.focused || F)
|
|
27
|
+
return;
|
|
28
|
+
const u = a.current?.querySelector("button"), M = u?.closest("[data-calendar-scroll-scroller]");
|
|
29
|
+
!u || !M || u === document.activeElement || M.contains(document.activeElement) && (u.focus({ preventScroll: !0 }), u.scrollIntoView({ block: "nearest" }));
|
|
30
|
+
}, [o.focused]), /* @__PURE__ */ n("span", { ref: a, className: "contents", children: /* @__PURE__ */ n(xe, { ...s, modifiers: { ...o, focused: !1 } }) });
|
|
31
|
+
}, Ae = ({ children: o, ...s }) => /* @__PURE__ */ n(Se, { ...s, children: me.toArray(o).map(
|
|
32
|
+
(a) => he(a) && a.props.calendarMonth ? fe(a, { key: a.props.calendarMonth.date.getTime() }) : a
|
|
33
|
+
) }), Le = ({
|
|
34
|
+
className: o,
|
|
35
|
+
classNames: s,
|
|
36
|
+
locale: a = ye,
|
|
37
|
+
weekStartsOn: m,
|
|
38
|
+
startMonth: F,
|
|
39
|
+
endMonth: u,
|
|
40
|
+
defaultMonth: M,
|
|
41
|
+
components: R,
|
|
42
|
+
...Y
|
|
43
|
+
}) => {
|
|
44
|
+
const c = _e(), p = C(null), v = C(0), r = B(F ?? new Date((/* @__PURE__ */ new Date()).getFullYear() - Fe, 0, 1)), b = B(u ?? new Date(ke, 11, 1)), l = Math.max(b - r + 1, 1), [J, Q] = L(V), k = Math.min(J, l), w = N(
|
|
45
|
+
(e) => S(e - G, 0, l - k),
|
|
46
|
+
[l, k]
|
|
47
|
+
), _ = S(B(M ?? /* @__PURE__ */ new Date()) - r, 0, l - 1), [x, z] = L(_), [T, W] = L(() => w(_));
|
|
48
|
+
ue(() => {
|
|
49
|
+
const e = p.current;
|
|
50
|
+
if (!e)
|
|
51
|
+
return;
|
|
52
|
+
const t = Math.ceil(e.clientHeight / d) + 1;
|
|
53
|
+
e.scrollTop = _ * d, Q(Math.max(V, t + G));
|
|
54
|
+
}, []), Z(() => () => cancelAnimationFrame(v.current), []);
|
|
55
|
+
const I = N(() => {
|
|
56
|
+
const e = p.current;
|
|
57
|
+
if (!e)
|
|
58
|
+
return;
|
|
59
|
+
const t = e.scrollTop;
|
|
60
|
+
z(S(Math.round(t / d), 0, l - 1)), W(w(Math.floor(t / d)));
|
|
61
|
+
}, [w, l]), X = N(() => {
|
|
62
|
+
v.current || (v.current = requestAnimationFrame(() => {
|
|
63
|
+
v.current = 0, I();
|
|
64
|
+
}));
|
|
65
|
+
}, [I]), A = N(
|
|
66
|
+
(e) => {
|
|
67
|
+
const t = p.current;
|
|
68
|
+
if (!t)
|
|
69
|
+
return;
|
|
70
|
+
const f = S(e - r, 0, l - 1);
|
|
71
|
+
t.scrollTop = f * d, z(f), W(w(f));
|
|
72
|
+
},
|
|
73
|
+
[w, r, l]
|
|
74
|
+
), j = (e) => {
|
|
75
|
+
const t = p.current;
|
|
76
|
+
t && A(r + Math.round(t.scrollTop / d) + e);
|
|
77
|
+
}, g = h(r + x), $ = h(r + x - 1), ee = h(r + x + 1), O = x === 0, K = x === l - 1, te = (e) => {
|
|
78
|
+
A(g.getFullYear() * 12 + Number(e.target.value));
|
|
79
|
+
}, oe = (e) => {
|
|
80
|
+
A(Number(e.target.value) * 12 + g.getMonth());
|
|
81
|
+
}, y = a, D = Y.labels, ne = i(
|
|
82
|
+
() => Array.from({ length: 12 }, (e, t) => ({
|
|
83
|
+
value: t,
|
|
84
|
+
label: q(new Date(2e3, t, 1), "LLLL", { locale: y }),
|
|
85
|
+
disabled: !1
|
|
86
|
+
})),
|
|
87
|
+
[y]
|
|
88
|
+
), re = i(() => {
|
|
89
|
+
const e = Ce(/* @__PURE__ */ new Date(), { locale: y, weekStartsOn: m });
|
|
90
|
+
return Array.from({ length: 7 }, (t, f) => q(Me(e, f), "EEEEEE", { locale: y }));
|
|
91
|
+
}, [y, m]), ae = i(() => {
|
|
92
|
+
const e = Math.floor(r / 12), t = Math.floor(b / 12);
|
|
93
|
+
return Array.from({ length: t - e + 1 }, (f, U) => ({
|
|
94
|
+
value: e + U,
|
|
95
|
+
label: String(e + U),
|
|
96
|
+
disabled: !1
|
|
97
|
+
}));
|
|
98
|
+
}, [r, b]), le = i(
|
|
99
|
+
() => ({
|
|
100
|
+
months: "flex flex-col",
|
|
101
|
+
month: "flex h-[280px] flex-col gap-1 pb-4",
|
|
102
|
+
month_caption: "flex items-center px-2 capitalize",
|
|
103
|
+
caption_label: "select-none text-sm font-medium",
|
|
104
|
+
month_grid: "w-full border-collapse",
|
|
105
|
+
weekdays: "hidden",
|
|
106
|
+
week: "mt-1 flex h-9",
|
|
107
|
+
day: "size-9 shrink-0 border-0 p-0",
|
|
108
|
+
hidden: "invisible",
|
|
109
|
+
...s
|
|
110
|
+
}),
|
|
111
|
+
[s]
|
|
112
|
+
), se = i(
|
|
113
|
+
() => ({ Months: Ae, DayButton: Te, ...R }),
|
|
114
|
+
[R]
|
|
115
|
+
), ce = i(() => h(r), [r]), ie = i(() => h(b), [b]), de = i(() => h(r + T), [r, T]);
|
|
116
|
+
return /* @__PURE__ */ E("div", { className: c.root({ className: o }), children: [
|
|
117
|
+
/* @__PURE__ */ E("div", { className: c.header(), children: [
|
|
118
|
+
/* @__PURE__ */ E("div", { className: c.nav(), children: [
|
|
119
|
+
/* @__PURE__ */ n(
|
|
120
|
+
be,
|
|
121
|
+
{
|
|
122
|
+
"aria-label": (D?.labelPrevious ?? ve)(O ? void 0 : $),
|
|
123
|
+
disabled: O,
|
|
124
|
+
onClick: () => j(-1),
|
|
125
|
+
children: /* @__PURE__ */ n(H, { orientation: "left" })
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ E("div", { className: c.dropdowns(), children: [
|
|
129
|
+
/* @__PURE__ */ n(
|
|
130
|
+
P,
|
|
131
|
+
{
|
|
132
|
+
"aria-label": (D?.labelMonthDropdown ?? ge)(),
|
|
133
|
+
options: ne,
|
|
134
|
+
value: g.getMonth(),
|
|
135
|
+
onChange: te
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ n(
|
|
139
|
+
P,
|
|
140
|
+
{
|
|
141
|
+
"aria-label": (D?.labelYearDropdown ?? De)(),
|
|
142
|
+
options: ae,
|
|
143
|
+
value: g.getFullYear(),
|
|
144
|
+
onChange: oe
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ n(
|
|
149
|
+
we,
|
|
150
|
+
{
|
|
151
|
+
"aria-label": (D?.labelNext ?? Ee)(K ? void 0 : ee),
|
|
152
|
+
disabled: K,
|
|
153
|
+
onClick: () => j(1),
|
|
154
|
+
children: /* @__PURE__ */ n(H, { orientation: "right" })
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
] }),
|
|
158
|
+
/* @__PURE__ */ n("div", { className: c.weekdays(), "aria-hidden": "true", children: re.map((e, t) => /* @__PURE__ */ n("span", { className: c.weekday(), children: e }, t)) })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ n("div", { ref: p, className: c.scroller(), "data-calendar-scroll-scroller": "", onScroll: X, children: /* @__PURE__ */ n("div", { style: { height: l * d }, children: /* @__PURE__ */ n("div", { className: c.window(), style: { top: T * d }, children: /* @__PURE__ */ n(
|
|
161
|
+
Ne,
|
|
162
|
+
{
|
|
163
|
+
...Y,
|
|
164
|
+
locale: a,
|
|
165
|
+
weekStartsOn: m,
|
|
166
|
+
startMonth: ce,
|
|
167
|
+
endMonth: ie,
|
|
168
|
+
month: de,
|
|
169
|
+
numberOfMonths: k,
|
|
170
|
+
captionLayout: "label",
|
|
171
|
+
fixedWeeks: !0,
|
|
172
|
+
hideNavigation: !0,
|
|
173
|
+
showOutsideDays: !1,
|
|
174
|
+
classNames: le,
|
|
175
|
+
components: se
|
|
176
|
+
}
|
|
177
|
+
) }) }) })
|
|
178
|
+
] });
|
|
179
|
+
};
|
|
180
|
+
Le.displayName = "CalendarScroll";
|
|
181
|
+
export {
|
|
182
|
+
Le as CalendarScroll
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=calendar-scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-scroll.js","sources":["../../src/components/calendar-scroll/CalendarScroll.tsx"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@siberiacancode/reactuse\";\nimport { addDays, format, Locale, startOfWeek } from \"date-fns\";\nimport {\n\tChangeEvent,\n\tChildren,\n\tcloneElement,\n\tisValidElement,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState\n} from \"react\";\nimport {\n\tDayPicker,\n\tDayPickerProps,\n\tDropdownOption,\n\tlabelMonthDropdown,\n\tlabelNext,\n\tlabelPrevious,\n\tlabelYearDropdown,\n\tMonthProps,\n\tMonths,\n\tMonthsProps\n} from \"react-day-picker\";\nimport { enUS } from \"react-day-picker/locale\";\nimport { tv } from \"tailwind-variants\";\nimport { CalendarChevron } from \"../calendar/components/calendar-chevron/CalendarChevron\";\nimport {\n\tCalendarDayButton,\n\tCalendarDayButtonProps\n} from \"../calendar/components/calendar-day-button/CalendarDayButton\";\nimport { CalendarNextMonthButton } from \"../calendar/components/calendar-next-month-button/CalendarNextMonthButton\";\nimport { CalendarPreviousMonthButton } from \"../calendar/components/calendar-previous-month-button/CalendarPreviousMonthButton\";\nimport { CalendarDropdown } from \"../calendar/components/calendar-dropdown/CalendarDropdown\";\n\n/**\n * Высота одного месяца в px. Фиксирована (6 недель всегда), поэтому позицию месяца\n * в скролле считаем арифметикой, без измерений DOM:\n * подпись 20 (text-sm) + gap 4 + 6 недель × (36 + 4) + нижний отступ 16 = 280.\n * Если меняете стили месяца ниже — меняйте и эту константу.\n */\nconst MONTH_HEIGHT = 280;\n/**\n * Сколько месяцев лежит в DOM до замера высоты скроллера. После монтирования окно\n * подгоняется под реальную высоту: видимые месяцы + 1 снизу + BUFFER_BEFORE сверху.\n * Каждый лишний месяц — ~42 дня, которые DayPicker пересчитывает на любом рендере.\n */\nconst DEFAULT_WINDOW_SIZE = 4;\n/** Сколько месяцев держим в DOM выше верхнего видимого */\nconst BUFFER_BEFORE = 1;\nconst DEFAULT_YEARS_BACK = 100;\nconst DEFAULT_END_YEAR = 2100;\n\nconst calendarScrollStyles = tv({\n\tslots: {\n\t\troot: [\n\t\t\t\"flex h-[420px] w-fit flex-col overflow-hidden rounded-md\",\n\t\t\t\"border border-solid border-secondary-border bg-secondary-bg shadow-soft-sm\"\n\t\t],\n\t\theader: \"flex flex-col gap-2 border-b border-secondary-border p-3 pb-2\",\n\t\tnav: \"flex h-9 items-center justify-between gap-1\",\n\t\tdropdowns: \"flex items-center justify-center gap-1.5 text-sm font-medium capitalize\",\n\t\tweekdays: \"flex\",\n\t\tweekday: \"w-9 shrink-0 text-center text-xs font-medium text-muted-foreground opacity-70\",\n\t\tscroller: \"relative flex-1 overflow-y-auto overscroll-contain px-3\",\n\t\twindow: \"absolute inset-x-3 top-0\"\n\t}\n});\n\nconst toKey = (date: Date) => date.getFullYear() * 12 + date.getMonth();\nconst fromKey = (key: number) => new Date(Math.floor(key / 12), key % 12, 1);\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\n/**\n * Кнопка дня для вертикального скролла.\n *\n * Штатный DayButton из react-day-picker зовёт `focus()` без `preventScroll`, когда день\n * получает флаг `focused`. В скролл-списке это ломает прокрутку: окно месяцев сдвигается,\n * ранее выбранный день снова попадает в DOM, фокус на него утягивает скролл назад.\n * Поэтому программный фокус делаем сами: только при клавиатурной навигации (фокус уже\n * внутри скроллера), с `preventScroll`, и скроллим к дню лишь если он вне видимой области.\n */\nconst CalendarScrollDayButton = ({ modifiers, ...props }: CalendarDayButtonProps) => {\n\tconst anchorRef = useRef<HTMLSpanElement>(null);\n\tconst isFirstRun = useRef(true);\n\n\tuseEffect(() => {\n\t\tconst isMount = isFirstRun.current;\n\t\tisFirstRun.current = false;\n\t\tif (!modifiers.focused || isMount) {\n\t\t\treturn;\n\t\t}\n\t\tconst button = anchorRef.current?.querySelector(\"button\");\n\t\tconst scroller = button?.closest(\"[data-calendar-scroll-scroller]\");\n\t\tif (!button || !scroller || button === document.activeElement) {\n\t\t\treturn;\n\t\t}\n\t\tif (scroller.contains(document.activeElement)) {\n\t\t\tbutton.focus({ preventScroll: true });\n\t\t\tbutton.scrollIntoView({ block: \"nearest\" });\n\t\t}\n\t}, [modifiers.focused]);\n\n\treturn (\n\t\t<span ref={anchorRef} className=\"contents\">\n\t\t\t<CalendarDayButton {...props} modifiers={{ ...modifiers, focused: false }} />\n\t\t</span>\n\t);\n};\n\n/**\n * Контейнер месяцев с ключами по самому месяцу.\n *\n * DayPicker ключует месяцы по позиции (`displayIndex`), а дни — по дате и месяцу показа.\n * При сдвиге окна на месяц каждая позиция получает другой месяц, и React пересоздаёт\n * все дни всех месяцев окна. Перекладываем ключ на `yyyy-MM`: месяцы, оставшиеся в окне,\n * сохраняют свои узлы, монтируется только вошедший месяц. Заодно не теряется фокус\n * на только что нажатом дне.\n */\nconst CalendarScrollMonths = ({ children, ...props }: MonthsProps) => (\n\t<Months {...props}>\n\t\t{Children.toArray(children).map((child) =>\n\t\t\tisValidElement<MonthProps>(child) && child.props.calendarMonth\n\t\t\t\t? cloneElement(child, { key: child.props.calendarMonth.date.getTime() })\n\t\t\t\t: child\n\t\t)}\n\t</Months>\n);\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\n/** Пропсы DayPicker, которыми управляет сам CalendarScroll */\ntype ManagedProps =\n\t| \"month\"\n\t| \"onMonthChange\"\n\t| \"numberOfMonths\"\n\t| \"captionLayout\"\n\t| \"fixedWeeks\"\n\t| \"hideNavigation\"\n\t| \"showOutsideDays\"\n\t| \"pagedNavigation\"\n\t| \"reverseMonths\";\n\nexport type CalendarScrollProps = DistributiveOmit<DayPickerProps, ManagedProps>;\n\n/**\n * CalendarScroll — календарь с вертикальным скроллом месяцев (как в мобильных банках).\n *\n * Месяцы идут друг за другом, сверху общая шапка с селектами месяца и года для быстрого\n * прыжка. Селекты синхронизированы со скроллом. В DOM лежит только окно из нескольких\n * месяцев, поэтому диапазон может быть широким (по умолчанию ±100 лет). Виртуализацию лучше\n * не отключать: без неё DayPicker пересчитывал бы дни всех месяцев диапазона на каждом рендере.\n *\n * Высота задаётся через `className` (по умолчанию 420px). Выбор дат — те же `mode`,\n * `selected`, `onSelect`, что и у Calendar.\n */\nexport const CalendarScroll = ({\n\tclassName,\n\tclassNames,\n\tlocale = enUS,\n\tweekStartsOn,\n\tstartMonth,\n\tendMonth,\n\tdefaultMonth,\n\tcomponents,\n\t...props\n}: CalendarScrollProps) => {\n\tconst styles = calendarScrollStyles();\n\tconst scrollerRef = useRef<HTMLDivElement>(null);\n\tconst frameRef = useRef(0);\n\n\tconst startKey = toKey(startMonth ?? new Date(new Date().getFullYear() - DEFAULT_YEARS_BACK, 0, 1));\n\tconst endKey = toKey(endMonth ?? new Date(DEFAULT_END_YEAR, 11, 1));\n\tconst total = Math.max(endKey - startKey + 1, 1);\n\tconst [windowSizeLimit, setWindowSizeLimit] = useState(DEFAULT_WINDOW_SIZE);\n\tconst windowSize = Math.min(windowSizeLimit, total);\n\n\tconst getWindowStart = useCallback(\n\t\t(index: number) => clamp(index - BUFFER_BEFORE, 0, total - windowSize),\n\t\t[total, windowSize]\n\t);\n\n\tconst initialIndex = clamp(toKey(defaultMonth ?? new Date()) - startKey, 0, total - 1);\n\tconst [currentIndex, setCurrentIndex] = useState(initialIndex);\n\tconst [windowStart, setWindowStart] = useState(() => getWindowStart(initialIndex));\n\n\t// Первичная позиция и размер окна — до отрисовки, чтобы не было прыжка и пустоты\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\treturn;\n\t\t}\n\t\tconst visibleMonths = Math.ceil(scroller.clientHeight / MONTH_HEIGHT) + 1;\n\t\tscroller.scrollTop = initialIndex * MONTH_HEIGHT;\n\t\tsetWindowSizeLimit(Math.max(DEFAULT_WINDOW_SIZE, visibleMonths + BUFFER_BEFORE));\n\t}, []);\n\n\tuseEffect(() => () => cancelAnimationFrame(frameRef.current), []);\n\n\tconst syncWithScroll = useCallback(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\treturn;\n\t\t}\n\t\tconst scrollTop = scroller.scrollTop;\n\t\tsetCurrentIndex(clamp(Math.round(scrollTop / MONTH_HEIGHT), 0, total - 1));\n\t\tsetWindowStart(getWindowStart(Math.floor(scrollTop / MONTH_HEIGHT)));\n\t}, [getWindowStart, total]);\n\n\tconst onScroll = useCallback(() => {\n\t\tif (frameRef.current) {\n\t\t\treturn;\n\t\t}\n\t\tframeRef.current = requestAnimationFrame(() => {\n\t\t\tframeRef.current = 0;\n\t\t\tsyncWithScroll();\n\t\t});\n\t}, [syncWithScroll]);\n\n\tconst jumpTo = useCallback(\n\t\t(key: number) => {\n\t\t\tconst scroller = scrollerRef.current;\n\t\t\tif (!scroller) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst index = clamp(key - startKey, 0, total - 1);\n\t\t\tscroller.scrollTop = index * MONTH_HEIGHT;\n\t\t\tsetCurrentIndex(index);\n\t\t\tsetWindowStart(getWindowStart(index));\n\t\t},\n\t\t[getWindowStart, startKey, total]\n\t);\n\n\t// Смещение считаем от scrollTop, а не от state: он обновляется синхронно,\n\t// поэтому быстрые клики подряд не теряются до перерендера\n\tconst jumpBy = (delta: number) => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (scroller) {\n\t\t\tjumpTo(startKey + Math.round(scroller.scrollTop / MONTH_HEIGHT) + delta);\n\t\t}\n\t};\n\n\tconst current = fromKey(startKey + currentIndex);\n\tconst previous = fromKey(startKey + currentIndex - 1);\n\tconst next = fromKey(startKey + currentIndex + 1);\n\tconst isFirst = currentIndex === 0;\n\tconst isLast = currentIndex === total - 1;\n\n\tconst onMonthSelect = (event: ChangeEvent<HTMLSelectElement>) => {\n\t\tjumpTo(current.getFullYear() * 12 + Number(event.target.value));\n\t};\n\n\tconst onYearSelect = (event: ChangeEvent<HTMLSelectElement>) => {\n\t\tjumpTo(Number(event.target.value) * 12 + current.getMonth());\n\t};\n\n\t// DayPicker типизирует locale как Partial, но на деле это полноценная date-fns Locale\n\tconst dateFnsLocale = locale as Locale;\n\t// Подписи для a11y берём из тех же labels, что и DayPicker, чтобы переопределялись одним пропсом\n\tconst labels = props.labels;\n\n\tconst monthOptions: DropdownOption[] = useMemo(\n\t\t() =>\n\t\t\tArray.from({ length: 12 }, (_, month) => ({\n\t\t\t\tvalue: month,\n\t\t\t\tlabel: format(new Date(2000, month, 1), \"LLLL\", { locale: dateFnsLocale }),\n\t\t\t\tdisabled: false\n\t\t\t})),\n\t\t[dateFnsLocale]\n\t);\n\n\tconst weekdayNames = useMemo(() => {\n\t\tconst first = startOfWeek(new Date(), { locale: dateFnsLocale, weekStartsOn });\n\t\treturn Array.from({ length: 7 }, (_, day) => format(addDays(first, day), \"EEEEEE\", { locale: dateFnsLocale }));\n\t}, [dateFnsLocale, weekStartsOn]);\n\n\tconst yearOptions: DropdownOption[] = useMemo(() => {\n\t\tconst first = Math.floor(startKey / 12);\n\t\tconst last = Math.floor(endKey / 12);\n\t\treturn Array.from({ length: last - first + 1 }, (_, i) => ({\n\t\t\tvalue: first + i,\n\t\t\tlabel: String(first + i),\n\t\t\tdisabled: false\n\t\t}));\n\t}, [startKey, endKey]);\n\n\tconst classNamesMemoized: DayPickerProps[\"classNames\"] = useMemo(\n\t\t() => ({\n\t\t\tmonths: \"flex flex-col\",\n\t\t\tmonth: \"flex h-[280px] flex-col gap-1 pb-4\",\n\t\t\tmonth_caption: \"flex items-center px-2 capitalize\",\n\t\t\tcaption_label: \"select-none text-sm font-medium\",\n\t\t\tmonth_grid: \"w-full border-collapse\",\n\t\t\tweekdays: \"hidden\",\n\t\t\tweek: \"mt-1 flex h-9\",\n\t\t\tday: \"size-9 shrink-0 border-0 p-0\",\n\t\t\thidden: \"invisible\",\n\t\t\t...classNames\n\t\t}),\n\t\t[classNames]\n\t);\n\n\tconst componentsMemoized: DayPickerProps[\"components\"] = useMemo(\n\t\t() => ({ Months: CalendarScrollMonths, DayButton: CalendarScrollDayButton, ...components }),\n\t\t[components]\n\t);\n\n\tconst firstMonth = useMemo(() => fromKey(startKey), [startKey]);\n\tconst lastMonth = useMemo(() => fromKey(endKey), [endKey]);\n\tconst windowMonth = useMemo(() => fromKey(startKey + windowStart), [startKey, windowStart]);\n\n\treturn (\n\t\t<div className={styles.root({ className })}>\n\t\t\t<div className={styles.header()}>\n\t\t\t\t<div className={styles.nav()}>\n\t\t\t\t\t<CalendarPreviousMonthButton\n\t\t\t\t\t\taria-label={(labels?.labelPrevious ?? labelPrevious)(isFirst ? undefined : previous)}\n\t\t\t\t\t\tdisabled={isFirst}\n\t\t\t\t\t\tonClick={() => jumpBy(-1)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CalendarChevron orientation=\"left\" />\n\t\t\t\t\t</CalendarPreviousMonthButton>\n\t\t\t\t\t<div className={styles.dropdowns()}>\n\t\t\t\t\t\t<CalendarDropdown\n\t\t\t\t\t\t\taria-label={(labels?.labelMonthDropdown ?? labelMonthDropdown)()}\n\t\t\t\t\t\t\toptions={monthOptions}\n\t\t\t\t\t\t\tvalue={current.getMonth()}\n\t\t\t\t\t\t\tonChange={onMonthSelect}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<CalendarDropdown\n\t\t\t\t\t\t\taria-label={(labels?.labelYearDropdown ?? labelYearDropdown)()}\n\t\t\t\t\t\t\toptions={yearOptions}\n\t\t\t\t\t\t\tvalue={current.getFullYear()}\n\t\t\t\t\t\t\tonChange={onYearSelect}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<CalendarNextMonthButton\n\t\t\t\t\t\taria-label={(labels?.labelNext ?? labelNext)(isLast ? undefined : next)}\n\t\t\t\t\t\tdisabled={isLast}\n\t\t\t\t\t\tonClick={() => jumpBy(1)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CalendarChevron orientation=\"right\" />\n\t\t\t\t\t</CalendarNextMonthButton>\n\t\t\t\t</div>\n\t\t\t\t<div className={styles.weekdays()} aria-hidden=\"true\">\n\t\t\t\t\t{weekdayNames.map((name, index) => (\n\t\t\t\t\t\t<span key={index} className={styles.weekday()}>\n\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div ref={scrollerRef} className={styles.scroller()} data-calendar-scroll-scroller=\"\" onScroll={onScroll}>\n\t\t\t\t<div style={{ height: total * MONTH_HEIGHT }}>\n\t\t\t\t\t<div className={styles.window()} style={{ top: windowStart * MONTH_HEIGHT }}>\n\t\t\t\t\t\t<DayPicker\n\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\t\tweekStartsOn={weekStartsOn}\n\t\t\t\t\t\t\tstartMonth={firstMonth}\n\t\t\t\t\t\t\tendMonth={lastMonth}\n\t\t\t\t\t\t\tmonth={windowMonth}\n\t\t\t\t\t\t\tnumberOfMonths={windowSize}\n\t\t\t\t\t\t\tcaptionLayout=\"label\"\n\t\t\t\t\t\t\tfixedWeeks\n\t\t\t\t\t\t\thideNavigation\n\t\t\t\t\t\t\tshowOutsideDays={false}\n\t\t\t\t\t\t\tclassNames={classNamesMemoized}\n\t\t\t\t\t\t\tcomponents={componentsMemoized}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nCalendarScroll.displayName = \"CalendarScroll\";\n"],"names":["MONTH_HEIGHT","DEFAULT_WINDOW_SIZE","BUFFER_BEFORE","DEFAULT_YEARS_BACK","DEFAULT_END_YEAR","calendarScrollStyles","tv","toKey","date","fromKey","key","clamp","value","min","max","CalendarScrollDayButton","modifiers","props","anchorRef","useRef","isFirstRun","useEffect","isMount","button","scroller","jsx","CalendarDayButton","CalendarScrollMonths","children","Months","Children","child","isValidElement","cloneElement","CalendarScroll","className","classNames","locale","enUS","weekStartsOn","startMonth","endMonth","defaultMonth","components","styles","scrollerRef","frameRef","startKey","endKey","total","windowSizeLimit","setWindowSizeLimit","useState","windowSize","getWindowStart","useCallback","index","initialIndex","currentIndex","setCurrentIndex","windowStart","setWindowStart","useIsomorphicLayoutEffect","visibleMonths","syncWithScroll","scrollTop","onScroll","jumpTo","jumpBy","delta","current","previous","next","isFirst","isLast","onMonthSelect","event","onYearSelect","dateFnsLocale","labels","monthOptions","useMemo","_","month","format","weekdayNames","first","startOfWeek","day","addDays","yearOptions","last","i","classNamesMemoized","componentsMemoized","firstMonth","lastMonth","windowMonth","jsxs","CalendarPreviousMonthButton","labelPrevious","CalendarChevron","CalendarDropdown","labelMonthDropdown","labelYearDropdown","CalendarNextMonthButton","labelNext","name","DayPicker"],"mappings":";;;;;;;AA0CA,MAAMA,IAAe,KAMfC,IAAsB,GAEtBC,IAAgB,GAChBC,KAAqB,KACrBC,KAAmB,MAEnBC,KAAuBC,GAAG;AAAA,EAC/B,OAAO;AAAA,IACN,MAAM;AAAA,MACL;AAAA,MACA;AAAA,IACD;AAAA,IACA,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,WAAW;AAAA,IACX,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,EAAA;AAEV,CAAC,GAEKC,IAAQ,CAACC,MAAeA,EAAK,gBAAgB,KAAKA,EAAK,SAAS,GAChEC,IAAU,CAACC,MAAgB,IAAI,KAAK,KAAK,MAAMA,IAAM,EAAE,GAAGA,IAAM,IAAI,CAAC,GACrEC,IAAQ,CAACC,GAAeC,GAAaC,MAAgB,KAAK,IAAI,KAAK,IAAIF,GAAOC,CAAG,GAAGC,CAAG,GAWvFC,KAA0B,CAAC,EAAE,WAAAC,GAAW,GAAGC,QAAoC;AAC9E,QAAAC,IAAYC,EAAwB,IAAI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,YACV,SAAS,MAAMN,EAAO,CAAC;AAAA,YAEvB,UAAA,gBAAA3C,EAAC4E,GAAgB,EAAA,aAAY,QAAQ,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACtC,GACD;AAAA,MACA,gBAAA5E,EAAC,SAAI,WAAWmB,EAAO,YAAY,eAAY,QAC7C,UAAAyC,GAAa,IAAI,CAACsB,GAAMnD,MACxB,gBAAA/B,EAAC,UAAiB,WAAWmB,EAAO,QAClC,GAAA,UAAA+D,KADSnD,CAEX,CACA,EACF,CAAA;AAAA,IAAA,GACD;AAAA,IACC,gBAAA/B,EAAA,OAAA,EAAI,KAAKoB,GAAa,WAAWD,EAAO,SAAS,GAAG,iCAA8B,IAAG,UAAAsB,GACrF,UAAA,gBAAAzC,EAAC,SAAI,OAAO,EAAE,QAAQwB,IAAQjD,EAAa,GAC1C,UAAC,gBAAAyB,EAAA,OAAA,EAAI,WAAWmB,EAAO,OAAO,GAAG,OAAO,EAAE,KAAKgB,IAAc5D,KAC5D,UAAA,gBAAAyB;AAAA,MAACmF;AAAA,MAAA;AAAA,QACC,GAAG3F;AAAA,QACJ,QAAAoB;AAAA,QACA,cAAAE;AAAA,QACA,YAAYwD;AAAA,QACZ,UAAUC;AAAA,QACV,OAAOC;AAAA,QACP,gBAAgB5C;AAAA,QAChB,eAAc;AAAA,QACd,YAAU;AAAA,QACV,gBAAc;AAAA,QACd,iBAAiB;AAAA,QACjB,YAAYwC;AAAA,QACZ,YAAYC;AAAA,MAAA;AAAA,IAAA,EAEd,CAAA,EACD,CAAA,EACD,CAAA;AAAA,EAAA,GACD;AAEF;AAEA5D,GAAe,cAAc;"}
|
|
@@ -1,96 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { T as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { C as k } from "../chevron-down-CAOItu8X.js";
|
|
8
|
-
import { i as _, R as B, q as D, w as M } from "../DayPicker-4hE1QEvO.js";
|
|
9
|
-
import { B as u } from "../Button-BZ3ON1Tj.js";
|
|
10
|
-
const s = n({
|
|
11
|
-
base: "size-4"
|
|
12
|
-
}), m = ({ className: e, orientation: t, ...o }) => t === "left" ? /* @__PURE__ */ a(w, { className: s({ className: e }), ...o }) : t === "right" ? /* @__PURE__ */ a(C, { className: s({ className: e }), ...o }) : t === "up" ? /* @__PURE__ */ a(N, { className: s({ className: e }), ...o }) : /* @__PURE__ */ a(k, { className: s({ className: e }), ...o });
|
|
13
|
-
m.displayName = "CalendarChevron";
|
|
14
|
-
const R = n({
|
|
15
|
-
base: [
|
|
16
|
-
"inline-flex items-center justify-center gap-2",
|
|
17
|
-
"aspect-square h-9 shrink-0 p-2.5",
|
|
18
|
-
"text-xs font-medium text-foreground transition-all",
|
|
19
|
-
"cursor-pointer select-none",
|
|
20
|
-
"disabled:pointer-events-none disabled:text-muted-foreground disabled:opacity-50",
|
|
21
|
-
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary",
|
|
22
|
-
"focus-visible:rounded-md"
|
|
23
|
-
],
|
|
24
|
-
variants: {
|
|
25
|
-
selected: {
|
|
26
|
-
true: "bg-primary text-primary-foreground"
|
|
27
|
-
},
|
|
28
|
-
range_middle: {
|
|
29
|
-
true: "bg-secondary-bg-hover text-card-foreground"
|
|
30
|
-
},
|
|
31
|
-
outside: {
|
|
32
|
-
true: "text-muted-foreground"
|
|
33
|
-
},
|
|
34
|
-
today: {
|
|
35
|
-
true: "relative after:absolute after:bottom-1 after:left-1/2 after:h-1 after:w-1 after:-translate-x-1/2 after:rounded-full after:bg-primary"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
compoundVariants: [
|
|
39
|
-
{
|
|
40
|
-
selected: !1,
|
|
41
|
-
className: "hover:bg-secondary-bg-hover"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
selected: !0,
|
|
45
|
-
range_start: !1,
|
|
46
|
-
range_end: !1,
|
|
47
|
-
range_middle: !1,
|
|
48
|
-
className: "rounded-md"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
selected: !0,
|
|
52
|
-
range_start: !0,
|
|
53
|
-
className: "rounded-l-md"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
selected: !0,
|
|
57
|
-
range_end: !0,
|
|
58
|
-
className: "rounded-r-md"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
today: !0,
|
|
62
|
-
selected: !0,
|
|
63
|
-
range_middle: !1,
|
|
64
|
-
className: "after:bg-primary-foreground"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
outside: !0,
|
|
68
|
-
selected: !1,
|
|
69
|
-
className: "hover:text-primary-fg"
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
}), c = ({ modifiers: e, className: t, ...o }) => /* @__PURE__ */ a(
|
|
73
|
-
_,
|
|
74
|
-
{
|
|
75
|
-
modifiers: e,
|
|
76
|
-
className: R({ ...e, className: t }),
|
|
77
|
-
...o,
|
|
78
|
-
disabled: e.disabled
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
c.displayName = "CalendarDayButton";
|
|
82
|
-
const f = ({ className: e, ...t }) => /* @__PURE__ */ a(u, { ...t, variant: "ghost", className: e });
|
|
83
|
-
f.displayName = "CalendarNextMonthButton";
|
|
84
|
-
const p = ({ className: e, ...t }) => /* @__PURE__ */ a(u, { ...t, variant: "ghost", className: e });
|
|
85
|
-
p.displayName = "CalendarPreviousMonthButton";
|
|
86
|
-
const j = n({
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as r } from "react";
|
|
3
|
+
import { T as a } from "../index-BVqs-uqP.js";
|
|
4
|
+
import { e as y, c as w, C as h, b as x, d as k, a as C } from "../CalendarPreviousMonthButton-qT7qDPbO.js";
|
|
5
|
+
import { R as g, y as D, D as v } from "../DayPicker-Cu2Kn-he.js";
|
|
6
|
+
const N = a({
|
|
87
7
|
base: [
|
|
88
8
|
"w-fit rounded-md border bg-background",
|
|
89
9
|
"border border-solid border-secondary-border bg-secondary-bg shadow-soft-sm"
|
|
90
10
|
]
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
const
|
|
11
|
+
}), c = ({ className: o, ...t }) => /* @__PURE__ */ s(g, { ...t, className: N({ className: o }) });
|
|
12
|
+
c.displayName = "CalendarRoot";
|
|
13
|
+
const M = a({
|
|
94
14
|
base: [
|
|
95
15
|
"inline-flex items-center justify-center gap-2",
|
|
96
16
|
"transition-all",
|
|
@@ -98,9 +18,9 @@ const S = n({
|
|
|
98
18
|
"w-9 shrink-0 rounded p-0",
|
|
99
19
|
"opacity-70"
|
|
100
20
|
]
|
|
101
|
-
}),
|
|
102
|
-
|
|
103
|
-
const
|
|
21
|
+
}), m = ({ className: o, ...t }) => /* @__PURE__ */ s(D, { className: M({ className: o }), ...t });
|
|
22
|
+
m.displayName = "CalendarWeekDay";
|
|
23
|
+
const _ = a({
|
|
104
24
|
base: [
|
|
105
25
|
"bg-background p-3 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent"
|
|
106
26
|
],
|
|
@@ -110,77 +30,62 @@ const z = n({
|
|
|
110
30
|
nav: "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
111
31
|
month_caption: "flex h-9 w-full items-center justify-center px-2 capitalize",
|
|
112
32
|
dropdowns: "flex h-9 w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
113
|
-
dropdown_root: [
|
|
114
|
-
"has-focus:border-ring has-focus:ring-ring/50 has-focus:ring-[3px]",
|
|
115
|
-
"shadow-xs relative rounded-md border border-input"
|
|
116
|
-
],
|
|
117
|
-
dropdown: "absolute inset-0 bg-background opacity-0",
|
|
118
33
|
table: "w-full border-collapse",
|
|
119
34
|
weekdays: "flex",
|
|
120
35
|
week: "mt-1 flex",
|
|
121
36
|
hidden: "invisible",
|
|
122
37
|
day: "border-0 p-0"
|
|
123
38
|
}
|
|
124
|
-
}),
|
|
125
|
-
base: "select-none font-medium"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
label: "text-sm",
|
|
129
|
-
dropdown: "flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground"
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
defaultVariants: {
|
|
133
|
-
layout: "label"
|
|
134
|
-
}
|
|
135
|
-
}), P = ({
|
|
136
|
-
className: e,
|
|
39
|
+
}), B = a({
|
|
40
|
+
base: "select-none text-sm font-medium"
|
|
41
|
+
}), R = ({
|
|
42
|
+
className: o,
|
|
137
43
|
classNames: t,
|
|
138
|
-
showOutsideDays:
|
|
44
|
+
showOutsideDays: i = !0,
|
|
139
45
|
captionLayout: d = "dropdown",
|
|
140
|
-
components:
|
|
141
|
-
...
|
|
46
|
+
components: l,
|
|
47
|
+
...p
|
|
142
48
|
}) => {
|
|
143
|
-
const
|
|
144
|
-
months:
|
|
145
|
-
month:
|
|
146
|
-
nav:
|
|
147
|
-
month_caption:
|
|
148
|
-
dropdowns:
|
|
149
|
-
dropdown_root:
|
|
150
|
-
dropdown:
|
|
151
|
-
caption_label:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
hidden: r.hidden(),
|
|
158
|
-
day: r.day(),
|
|
49
|
+
const e = _(), n = y(), u = r(() => new Date(2100, 11, 31), []), b = r(() => ({
|
|
50
|
+
months: e.months(),
|
|
51
|
+
month: e.month(),
|
|
52
|
+
nav: e.nav(),
|
|
53
|
+
month_caption: e.month_caption(),
|
|
54
|
+
dropdowns: e.dropdowns(),
|
|
55
|
+
dropdown_root: n.root(),
|
|
56
|
+
dropdown: n.select(),
|
|
57
|
+
caption_label: d === "label" ? B() : n.label(),
|
|
58
|
+
table: e.table(),
|
|
59
|
+
weekdays: e.weekdays(),
|
|
60
|
+
week: e.week(),
|
|
61
|
+
hidden: e.hidden(),
|
|
62
|
+
day: e.day(),
|
|
159
63
|
...t
|
|
160
|
-
}), [t]),
|
|
161
|
-
Root:
|
|
162
|
-
Chevron:
|
|
163
|
-
DayButton:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
64
|
+
}), [t]), f = r(() => ({
|
|
65
|
+
Root: c,
|
|
66
|
+
Chevron: C,
|
|
67
|
+
DayButton: k,
|
|
68
|
+
Dropdown: x,
|
|
69
|
+
Weekday: m,
|
|
70
|
+
PreviousMonthButton: h,
|
|
71
|
+
NextMonthButton: w,
|
|
72
|
+
...l
|
|
73
|
+
}), [l]);
|
|
74
|
+
return /* @__PURE__ */ s(
|
|
75
|
+
v,
|
|
171
76
|
{
|
|
172
|
-
endMonth:
|
|
173
|
-
showOutsideDays:
|
|
174
|
-
className:
|
|
77
|
+
endMonth: u,
|
|
78
|
+
showOutsideDays: i,
|
|
79
|
+
className: e.base({ className: o }),
|
|
175
80
|
captionLayout: d,
|
|
176
|
-
classNames:
|
|
177
|
-
components:
|
|
178
|
-
...
|
|
81
|
+
classNames: b,
|
|
82
|
+
components: f,
|
|
83
|
+
...p
|
|
179
84
|
}
|
|
180
85
|
);
|
|
181
86
|
};
|
|
182
|
-
|
|
87
|
+
R.displayName = "Calendar";
|
|
183
88
|
export {
|
|
184
|
-
|
|
89
|
+
R as Calendar
|
|
185
90
|
};
|
|
186
91
|
//# sourceMappingURL=calendar.js.map
|