@pibit.ai/cure-design-system 0.5.6 → 0.5.8
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/applications/date-picker/calendar.d.ts +42 -0
- package/dist/applications/date-picker/calendar.d.ts.map +1 -0
- package/dist/applications/date-picker/calendar.js +310 -0
- package/dist/applications/date-picker/cell.d.ts +15 -0
- package/dist/applications/date-picker/cell.d.ts.map +1 -0
- package/dist/applications/date-picker/cell.js +90 -0
- package/dist/applications/date-picker/date-input.d.ts +7 -0
- package/dist/applications/date-picker/date-input.d.ts.map +1 -0
- package/dist/applications/date-picker/date-input.js +39 -0
- package/dist/applications/date-picker/date-picker.d.ts +47 -0
- package/dist/applications/date-picker/date-picker.d.ts.map +1 -0
- package/dist/applications/date-picker/date-picker.js +237 -0
- package/dist/applications/date-picker/date-range-picker.d.ts +44 -0
- package/dist/applications/date-picker/date-range-picker.d.ts.map +1 -0
- package/dist/applications/date-picker/date-range-picker.js +335 -0
- package/dist/applications/date-picker/date-range-presets.d.ts +50 -0
- package/dist/applications/date-picker/date-range-presets.d.ts.map +1 -0
- package/dist/applications/date-picker/date-range-presets.js +86 -0
- package/dist/applications/date-picker/date-time-calendar.d.ts +34 -0
- package/dist/applications/date-picker/date-time-calendar.d.ts.map +1 -0
- package/dist/applications/date-picker/date-time-calendar.js +140 -0
- package/dist/applications/date-picker/index.d.ts +12 -0
- package/dist/applications/date-picker/index.d.ts.map +1 -0
- package/dist/applications/date-picker/index.js +36 -0
- package/dist/applications/date-picker/range-calendar.d.ts +23 -0
- package/dist/applications/date-picker/range-calendar.d.ts.map +1 -0
- package/dist/applications/date-picker/range-calendar.js +210 -0
- package/dist/applications/date-picker/range-preset.d.ts +10 -0
- package/dist/applications/date-picker/range-preset.d.ts.map +1 -0
- package/dist/applications/date-picker/range-preset.js +27 -0
- package/dist/applications/date-picker/styles.d.ts +8 -0
- package/dist/applications/date-picker/styles.d.ts.map +1 -0
- package/dist/applications/date-picker/styles.js +14 -0
- package/dist/applications/date-picker/time-field.d.ts +7 -0
- package/dist/applications/date-picker/time-field.d.ts.map +1 -0
- package/dist/applications/date-picker/time-field.js +116 -0
- package/dist/applications/date-picker/time-list.d.ts +23 -0
- package/dist/applications/date-picker/time-list.d.ts.map +1 -0
- package/dist/applications/date-picker/time-list.js +89 -0
- package/dist/hooks/use-breakpoint.d.ts +10 -0
- package/dist/hooks/use-breakpoint.d.ts.map +1 -0
- package/dist/hooks/use-breakpoint.js +21 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +331 -304
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +6 -6
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +6 -6
- package/dist/primitives/select/ExpandableSearchInput.d.ts +1 -1
- package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
- package/dist/primitives/select/ExpandableSearchInput.js +23 -23
- package/dist/primitives/select/SearchInput.d.ts +15 -2
- package/dist/primitives/select/SearchInput.d.ts.map +1 -1
- package/dist/primitives/select/SearchInput.js +128 -114
- package/dist/primitives/select/index.d.ts +1 -0
- package/dist/primitives/select/index.d.ts.map +1 -1
- package/dist/primitives/select/multi-select.js +81 -82
- package/dist/primitives/select/select.d.ts +4 -0
- package/dist/primitives/select/select.d.ts.map +1 -1
- package/dist/primitives/select/select.js +40 -21
- package/dist/styles/components.css +1 -1
- package/package.json +8 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.js +0 -442
- package/dist/node_modules/@react-aria/i18n/dist/context.js +0 -10
- package/dist/node_modules/@react-aria/i18n/dist/useCollator.js +0 -11
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.js +0 -36
- package/dist/node_modules/@react-aria/i18n/dist/useFilter.js +0 -35
- package/dist/node_modules/@react-aria/i18n/dist/utils.js +0 -44
- package/dist/node_modules/@react-aria/interactions/dist/focusSafely.js +0 -18
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +0 -62
- package/dist/node_modules/@react-aria/interactions/dist/utils.js +0 -5
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.js +0 -49
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +0 -27
- package/dist/node_modules/@react-aria/utils/dist/ShadowTreeWalker.js +0 -130
- package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +0 -15
- package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +0 -45
- package/dist/node_modules/@react-aria/utils/dist/isElementVisible.js +0 -25
- package/dist/node_modules/@react-aria/utils/dist/isFocusable.js +0 -37
- package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +0 -7
- package/dist/node_modules/@react-aria/utils/dist/openLink.js +0 -28
- package/dist/node_modules/@react-aria/utils/dist/platform.js +0 -47
- package/dist/node_modules/@react-aria/utils/dist/runAfterTransition.js +0 -35
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +0 -6
- package/dist/node_modules/@react-stately/flags/dist/import.js +0 -7
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { today as u, getLocalTimeZone as m, endOfMonth as e, startOfMonth as a, endOfWeek as n, startOfWeek as o } from "@internationalized/date";
|
|
2
|
+
const D = {
|
|
3
|
+
today: "Today",
|
|
4
|
+
yesterday: "Yesterday",
|
|
5
|
+
thisWeek: "This week",
|
|
6
|
+
lastWeek: "Last week",
|
|
7
|
+
last30Days: "Last 30 days",
|
|
8
|
+
last90Days: "Last 90 days",
|
|
9
|
+
thisMonth: "This month",
|
|
10
|
+
lastMonth: "Last month",
|
|
11
|
+
thisYear: "This year",
|
|
12
|
+
lastYear: "Last year"
|
|
13
|
+
}, y = (t, s) => t.year === s.year && t.month === s.month && t.day === s.day, d = (t) => ({
|
|
14
|
+
year: t.year,
|
|
15
|
+
month: t.month,
|
|
16
|
+
day: t.day
|
|
17
|
+
}), h = (t = "en-US") => {
|
|
18
|
+
const s = u(m());
|
|
19
|
+
return {
|
|
20
|
+
today: { start: s, end: s, preset: "today" },
|
|
21
|
+
yesterday: {
|
|
22
|
+
start: s.subtract({ days: 1 }),
|
|
23
|
+
end: s.subtract({ days: 1 }),
|
|
24
|
+
preset: "yesterday"
|
|
25
|
+
},
|
|
26
|
+
thisWeek: {
|
|
27
|
+
start: o(s, t),
|
|
28
|
+
end: n(s, t),
|
|
29
|
+
preset: "thisWeek"
|
|
30
|
+
},
|
|
31
|
+
lastWeek: {
|
|
32
|
+
start: o(s, t).subtract({ weeks: 1 }),
|
|
33
|
+
end: n(s, t).subtract({ weeks: 1 }),
|
|
34
|
+
preset: "lastWeek"
|
|
35
|
+
},
|
|
36
|
+
last30Days: {
|
|
37
|
+
// 30 inclusive calendar days = today plus the prior 29 days
|
|
38
|
+
start: s.subtract({ days: 29 }),
|
|
39
|
+
end: s,
|
|
40
|
+
preset: "last30Days"
|
|
41
|
+
},
|
|
42
|
+
last90Days: {
|
|
43
|
+
start: s.subtract({ days: 89 }),
|
|
44
|
+
end: s,
|
|
45
|
+
preset: "last90Days"
|
|
46
|
+
},
|
|
47
|
+
thisMonth: {
|
|
48
|
+
start: a(s),
|
|
49
|
+
end: e(s),
|
|
50
|
+
preset: "thisMonth"
|
|
51
|
+
},
|
|
52
|
+
lastMonth: {
|
|
53
|
+
start: a(s).subtract({ months: 1 }),
|
|
54
|
+
end: e(s.subtract({ months: 1 })),
|
|
55
|
+
preset: "lastMonth"
|
|
56
|
+
},
|
|
57
|
+
thisYear: {
|
|
58
|
+
start: a(s.set({ month: 1 })),
|
|
59
|
+
end: e(s.set({ month: 12 })),
|
|
60
|
+
preset: "thisYear"
|
|
61
|
+
},
|
|
62
|
+
lastYear: {
|
|
63
|
+
start: a(s.set({ month: 1 }).subtract({ years: 1 })),
|
|
64
|
+
end: e(s.set({ month: 12 }).subtract({ years: 1 })),
|
|
65
|
+
preset: "lastYear"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, f = (t, s = "en-US") => h(s)[t], b = (t, s = "en-US") => t.preset ? f(t.preset, s) : t, M = (t, s = "en-US") => {
|
|
69
|
+
if (!(t != null && t.start) || !(t != null && t.end)) return null;
|
|
70
|
+
if (t.preset && t.preset in D) return t.preset;
|
|
71
|
+
const c = h(s), i = d(t.start), p = d(t.end);
|
|
72
|
+
for (const [l, r] of Object.entries(c))
|
|
73
|
+
if (y(i, r.start) && y(p, r.end))
|
|
74
|
+
return l;
|
|
75
|
+
return null;
|
|
76
|
+
}, W = (t) => ({
|
|
77
|
+
...t
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
D as PRESET_LABELS,
|
|
81
|
+
W as cloneDateRange,
|
|
82
|
+
M as detectDateRangePresetKey,
|
|
83
|
+
f as getDateRangeFromPresetKey,
|
|
84
|
+
h as getDateRangePresets,
|
|
85
|
+
b as resolveDateRangePreset
|
|
86
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CalendarProps as AriaCalendarProps, DateValue, TimeValue } from 'react-aria-components';
|
|
2
|
+
import { CalendarSize } from './calendar';
|
|
3
|
+
/** The granularities that carry a time of day. */
|
|
4
|
+
export type TimeGranularity = "hour" | "minute" | "second";
|
|
5
|
+
/** `date` with its time of day replaced by `time`, as a type that can hold a time. */
|
|
6
|
+
export declare const withTime: (date: DateValue, time: TimeValue) => DateValue;
|
|
7
|
+
export interface DateTimeCalendarProps extends Omit<AriaCalendarProps<DateValue>, "value" | "defaultValue" | "onChange"> {
|
|
8
|
+
/** The selected date and time. A value without a time of day is treated as midnight. */
|
|
9
|
+
value: DateValue | null;
|
|
10
|
+
/** Called with the new date and time. Always carries a time of day. */
|
|
11
|
+
onChange: (value: DateValue | null) => void;
|
|
12
|
+
/** The dates to mark with a dot. */
|
|
13
|
+
highlightedDates?: DateValue[];
|
|
14
|
+
/** Minutes between two options in the time list. Defaults to 30. */
|
|
15
|
+
timeStep?: number;
|
|
16
|
+
/** 12 or 24 hour clock. Defaults to the locale's. */
|
|
17
|
+
hourCycle?: 12 | 24;
|
|
18
|
+
/** The smallest unit the time input edits. Defaults to "minute". */
|
|
19
|
+
timeGranularity?: TimeGranularity;
|
|
20
|
+
/** The time a date gets when it is picked before any time is. Defaults to midnight. */
|
|
21
|
+
defaultTime?: TimeValue;
|
|
22
|
+
/** Visual size: "xs" (compact) or "sm" (default). */
|
|
23
|
+
size?: CalendarSize;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A calendar with a time of day: month and year dropdowns, a date and a time input,
|
|
27
|
+
* and the day grid next to a scrollable list of times.
|
|
28
|
+
*
|
|
29
|
+
* Controlled only. The date and the time are edited independently, and whichever is
|
|
30
|
+
* set first waits for the other rather than inventing it: a time picked with no date
|
|
31
|
+
* is held until a date is picked, then both are committed together.
|
|
32
|
+
*/
|
|
33
|
+
export declare const DateTimeCalendar: ({ value, onChange, highlightedDates, timeStep, hourCycle, timeGranularity, defaultTime, size, className, ...props }: DateTimeCalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=date-time-calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-time-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-time-calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,EACT,SAAS,EACV,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAIpB,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAK3D,sFAAsF;AACtF,eAAO,MAAM,QAAQ,GAAI,MAAM,SAAS,EAAE,MAAM,SAAS,KAAG,SAU3D,CAAC;AAmCF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,iBAAiB,CAAC,SAAS,CAAC,EAC5B,OAAO,GAAG,cAAc,GAAG,UAAU,CACtC;IACC,wFAAwF;IACxF,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,uEAAuE;IACvE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;IACpB,oEAAoE;IACpE,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,uFAAuF;IACvF,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,qDAAqD;IACrD,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,qHAW9B,qBAAqB,4CAsGvB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useMemo as k, useRef as S, useEffect as j, useContext as I } from "react";
|
|
3
|
+
import { Time as w, toCalendarDateTime as L } from "@internationalized/date";
|
|
4
|
+
import { CalendarCheck01 as M } from "@untitledui/icons";
|
|
5
|
+
import { CalendarContext as P, Calendar as q, TimeField as E, CalendarStateContext as G, DateField as H } from "react-aria-components";
|
|
6
|
+
import { cx as d } from "../../utils/cn.js";
|
|
7
|
+
import { CalendarMonthYearHeader as X, CalendarDayGrid as Y } from "./calendar.js";
|
|
8
|
+
import { DateInput as N } from "./date-input.js";
|
|
9
|
+
import { TimeList as z } from "./time-list.js";
|
|
10
|
+
const h = (e) => new w(e.hour, e.minute, e.second), T = (e, n) => {
|
|
11
|
+
const s = {
|
|
12
|
+
hour: n.hour,
|
|
13
|
+
minute: n.minute,
|
|
14
|
+
second: n.second,
|
|
15
|
+
millisecond: 0
|
|
16
|
+
};
|
|
17
|
+
return "hour" in e ? e.set(s) : L(e, h(n));
|
|
18
|
+
}, A = (e, n) => e === n || !!e && !!n && e.year === n.year && e.month === n.month && e.day === n.day && e.era === n.era, B = ({ size: e }) => {
|
|
19
|
+
const n = I(G);
|
|
20
|
+
return /* @__PURE__ */ m(
|
|
21
|
+
H,
|
|
22
|
+
{
|
|
23
|
+
"aria-label": "Date",
|
|
24
|
+
granularity: "day",
|
|
25
|
+
isDisabled: n == null ? void 0 : n.isDisabled,
|
|
26
|
+
isReadOnly: n == null ? void 0 : n.isReadOnly,
|
|
27
|
+
value: (n == null ? void 0 : n.value) ?? null,
|
|
28
|
+
onChange: (s) => n == null ? void 0 : n.setValue(s),
|
|
29
|
+
className: "relative min-w-0 flex-1",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ i(N, { className: "w-full pr-9", size: e === "xs" ? "sm" : "md" }),
|
|
32
|
+
/* @__PURE__ */ i(
|
|
33
|
+
M,
|
|
34
|
+
{
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
className: "pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 text-fg-quaternary"
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}, ee = ({
|
|
43
|
+
value: e,
|
|
44
|
+
onChange: n,
|
|
45
|
+
highlightedDates: s,
|
|
46
|
+
timeStep: R = 30,
|
|
47
|
+
hourCycle: p,
|
|
48
|
+
timeGranularity: b = "minute",
|
|
49
|
+
defaultTime: O,
|
|
50
|
+
size: o = "sm",
|
|
51
|
+
className: c,
|
|
52
|
+
...t
|
|
53
|
+
}) => {
|
|
54
|
+
const a = o === "xs", u = !!t.isDisabled || !!t.isReadOnly, [V, f] = y(
|
|
55
|
+
e ?? void 0
|
|
56
|
+
), [g, C] = y(null), l = k(
|
|
57
|
+
() => e && "hour" in e ? h(e) : g,
|
|
58
|
+
[g, e]
|
|
59
|
+
), x = S(e);
|
|
60
|
+
j(() => {
|
|
61
|
+
!A(x.current, e) && e && f(e), x.current = e;
|
|
62
|
+
}, [e]);
|
|
63
|
+
const F = (r) => {
|
|
64
|
+
if (!u) {
|
|
65
|
+
if (!r) {
|
|
66
|
+
C(l), n(null);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
f(r), n(T(r, l ?? O ?? new w()));
|
|
70
|
+
}
|
|
71
|
+
}, D = (r) => {
|
|
72
|
+
if (!(u || !r)) {
|
|
73
|
+
if (!e) {
|
|
74
|
+
C(h(r));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
n(T(e, r));
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ i(
|
|
81
|
+
P.Provider,
|
|
82
|
+
{
|
|
83
|
+
value: {
|
|
84
|
+
value: e,
|
|
85
|
+
onChange: F,
|
|
86
|
+
focusedValue: V,
|
|
87
|
+
onFocusChange: f
|
|
88
|
+
},
|
|
89
|
+
children: /* @__PURE__ */ m(
|
|
90
|
+
q,
|
|
91
|
+
{
|
|
92
|
+
...t,
|
|
93
|
+
className: (r) => d(
|
|
94
|
+
"flex w-max flex-col",
|
|
95
|
+
a ? "gap-2" : "gap-3",
|
|
96
|
+
typeof c == "function" ? c(r) : c
|
|
97
|
+
),
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ i(X, { size: o }),
|
|
100
|
+
/* @__PURE__ */ m("div", { className: d("flex", a ? "gap-2" : "gap-3"), children: [
|
|
101
|
+
/* @__PURE__ */ i(B, { size: o }),
|
|
102
|
+
/* @__PURE__ */ i(
|
|
103
|
+
E,
|
|
104
|
+
{
|
|
105
|
+
"aria-label": "Time",
|
|
106
|
+
value: l,
|
|
107
|
+
onChange: D,
|
|
108
|
+
hourCycle: p,
|
|
109
|
+
granularity: b,
|
|
110
|
+
isDisabled: t.isDisabled,
|
|
111
|
+
isReadOnly: t.isReadOnly,
|
|
112
|
+
className: a ? "w-24" : "w-30",
|
|
113
|
+
children: /* @__PURE__ */ i(N, { className: "w-full", size: a ? "sm" : "md" })
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ m("div", { className: d("flex", a ? "gap-2" : "gap-3"), children: [
|
|
118
|
+
/* @__PURE__ */ i(Y, { highlightedDates: s, size: o }),
|
|
119
|
+
/* @__PURE__ */ i("div", { className: d("relative shrink-0", a ? "w-24" : "w-30"), children: /* @__PURE__ */ i(
|
|
120
|
+
z,
|
|
121
|
+
{
|
|
122
|
+
value: l,
|
|
123
|
+
onChange: D,
|
|
124
|
+
step: R,
|
|
125
|
+
hourCycle: p,
|
|
126
|
+
isDisabled: u,
|
|
127
|
+
className: "absolute inset-0 pr-1"
|
|
128
|
+
}
|
|
129
|
+
) })
|
|
130
|
+
] })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
ee as DateTimeCalendar,
|
|
139
|
+
T as withTime
|
|
140
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { DatePicker, type DatePickerProps, type DatePickerSize, } from './date-picker';
|
|
2
|
+
export { DateRangePicker, type DateRangePickerProps, } from './date-range-picker';
|
|
3
|
+
export { DateTimeCalendar, withTime, type DateTimeCalendarProps, type TimeGranularity, } from './date-time-calendar';
|
|
4
|
+
export { Calendar, CalendarContextProvider, CalendarDayGrid, CalendarGridSelectContext, CalendarMonthYearHeader, ControlledCalendarContextProvider, type CalendarDayGridProps, type CalendarProps, type CalendarSize, type ControlledCalendarContextProviderProps, } from './calendar';
|
|
5
|
+
export { RangeCalendar, RangeCalendarContextProvider, type RangeCalendarProps, } from './range-calendar';
|
|
6
|
+
export { CalendarCell, type CalendarCellProps } from './cell';
|
|
7
|
+
export { DateInput, type DateInputProps } from './date-input';
|
|
8
|
+
export { RangePresetButton, type RangePresetButtonProps } from './range-preset';
|
|
9
|
+
export { TimeField, type TimeFieldProps } from './time-field';
|
|
10
|
+
export { TimeList, type TimeListProps } from './time-list';
|
|
11
|
+
export { PRESET_LABELS, cloneDateRange, detectDateRangePresetKey, getDateRangeFromPresetKey, getDateRangePresets, resolveDateRangePreset, type DateRangeLike, type DateRangePresetKey, type PresetDateRange, } from './date-range-presets';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,QAAQ,EACR,uBAAuB,EACvB,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sCAAsC,GAC5C,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DatePicker as t } from "./date-picker.js";
|
|
2
|
+
import { DateRangePicker as o } from "./date-range-picker.js";
|
|
3
|
+
import { DateTimeCalendar as d, withTime as l } from "./date-time-calendar.js";
|
|
4
|
+
import { Calendar as C, CalendarContextProvider as x, CalendarDayGrid as i, CalendarGridSelectContext as p, CalendarMonthYearHeader as f, ControlledCalendarContextProvider as g } from "./calendar.js";
|
|
5
|
+
import { RangeCalendar as D, RangeCalendarContextProvider as R } from "./range-calendar.js";
|
|
6
|
+
import { CalendarCell as c } from "./cell.js";
|
|
7
|
+
import { DateInput as v } from "./date-input.js";
|
|
8
|
+
import { RangePresetButton as E } from "./range-preset.js";
|
|
9
|
+
import { TimeField as S } from "./time-field.js";
|
|
10
|
+
import { TimeList as k } from "./time-list.js";
|
|
11
|
+
import { PRESET_LABELS as B, cloneDateRange as F, detectDateRangePresetKey as G, getDateRangeFromPresetKey as K, getDateRangePresets as w, resolveDateRangePreset as A } from "./date-range-presets.js";
|
|
12
|
+
export {
|
|
13
|
+
C as Calendar,
|
|
14
|
+
c as CalendarCell,
|
|
15
|
+
x as CalendarContextProvider,
|
|
16
|
+
i as CalendarDayGrid,
|
|
17
|
+
p as CalendarGridSelectContext,
|
|
18
|
+
f as CalendarMonthYearHeader,
|
|
19
|
+
g as ControlledCalendarContextProvider,
|
|
20
|
+
v as DateInput,
|
|
21
|
+
t as DatePicker,
|
|
22
|
+
o as DateRangePicker,
|
|
23
|
+
d as DateTimeCalendar,
|
|
24
|
+
B as PRESET_LABELS,
|
|
25
|
+
D as RangeCalendar,
|
|
26
|
+
R as RangeCalendarContextProvider,
|
|
27
|
+
E as RangePresetButton,
|
|
28
|
+
S as TimeField,
|
|
29
|
+
k as TimeList,
|
|
30
|
+
F as cloneDateRange,
|
|
31
|
+
G as detectDateRangePresetKey,
|
|
32
|
+
K as getDateRangeFromPresetKey,
|
|
33
|
+
w as getDateRangePresets,
|
|
34
|
+
A as resolveDateRangePreset,
|
|
35
|
+
l as withTime
|
|
36
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { RangeCalendarProps as AriaRangeCalendarProps, DateValue } from 'react-aria-components';
|
|
3
|
+
import { CalendarSize } from './calendar';
|
|
4
|
+
export declare const RangeCalendarContextProvider: ({ children, }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export interface RangeCalendarProps extends AriaRangeCalendarProps<DateValue> {
|
|
6
|
+
/** The dates to highlight. */
|
|
7
|
+
highlightedDates?: DateValue[];
|
|
8
|
+
/** The date presets to display. */
|
|
9
|
+
presets?: Record<string, {
|
|
10
|
+
label: string;
|
|
11
|
+
value: {
|
|
12
|
+
start: DateValue;
|
|
13
|
+
end: DateValue;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
containerClassName?: string;
|
|
17
|
+
/** Visual size: "xs" (compact) or "sm" (default). */
|
|
18
|
+
size?: CalendarSize;
|
|
19
|
+
/** Drops the horizontal padding on the calendars' outer edges, for containers that supply their own padding. */
|
|
20
|
+
flushEdges?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const RangeCalendar: ({ presets, containerClassName, size, flushEdges, ...props }: RangeCalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=range-calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/range-calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,KAAK,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,SAAS,EACV,MAAM,uBAAuB,CAAC;AAY/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,eAAO,MAAM,4BAA4B,GAAI,eAE1C,iBAAiB,4CAcnB,CAAC;AAgDF,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB,CAAC,SAAS,CAAC;IAC3E,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CACd,MAAM,EACN;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE;YAAE,KAAK,EAAE,SAAS,CAAC;YAAC,GAAG,EAAE,SAAS,CAAA;SAAE,CAAA;KAAE,CAC/D,CAAC;IACF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qDAAqD;IACrD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gHAAgH;IAChH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,GAAI,6DAM3B,kBAAkB,4CAiKpB,CAAC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as w, useState as p, useContext as v } from "react";
|
|
3
|
+
import { ChevronLeft as _, ChevronRight as f } from "@untitledui/icons";
|
|
4
|
+
import { useDateFormatter as D } from "react-aria";
|
|
5
|
+
import { useSlottedContext as k, RangeCalendarContext as z, RangeCalendar as S, CalendarGrid as h, CalendarGridHeader as u, CalendarHeaderCell as b, CalendarGridBody as g, RangeCalendarStateContext as R } from "react-aria-components";
|
|
6
|
+
import { useBreakpoint as B } from "../../hooks/use-breakpoint.js";
|
|
7
|
+
import { CalendarCell as C } from "./cell.js";
|
|
8
|
+
import { DateInput as y } from "./date-input.js";
|
|
9
|
+
import { cx as i } from "../../utils/cn.js";
|
|
10
|
+
import { Button as m } from "../../primitives/button/button.js";
|
|
11
|
+
const F = ({
|
|
12
|
+
children: l
|
|
13
|
+
}) => {
|
|
14
|
+
const [t, n] = p(null), [r, c] = p();
|
|
15
|
+
return /* @__PURE__ */ e(
|
|
16
|
+
z.Provider,
|
|
17
|
+
{
|
|
18
|
+
value: { value: t, onChange: n, focusedValue: r, onFocusChange: c },
|
|
19
|
+
children: l
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}, N = ({ part: l }) => {
|
|
23
|
+
const t = v(R);
|
|
24
|
+
if (!t)
|
|
25
|
+
throw new Error(
|
|
26
|
+
"<RangeCalendarTitle /> must be used within a <RangeCalendar /> component."
|
|
27
|
+
);
|
|
28
|
+
const n = D({
|
|
29
|
+
month: "long",
|
|
30
|
+
year: "numeric",
|
|
31
|
+
calendar: t.visibleRange.start.calendar.identifier,
|
|
32
|
+
timeZone: t.timeZone
|
|
33
|
+
});
|
|
34
|
+
return l === "start" ? n.format(t.visibleRange.start.toDate(t.timeZone)) : n.format(t.visibleRange.end.toDate(t.timeZone));
|
|
35
|
+
}, L = ({
|
|
36
|
+
value: l,
|
|
37
|
+
children: t,
|
|
38
|
+
...n
|
|
39
|
+
}) => {
|
|
40
|
+
const r = v(R);
|
|
41
|
+
return /* @__PURE__ */ e(
|
|
42
|
+
m,
|
|
43
|
+
{
|
|
44
|
+
...n,
|
|
45
|
+
slot: null,
|
|
46
|
+
size: "sm",
|
|
47
|
+
color: "link-color",
|
|
48
|
+
onClick: () => {
|
|
49
|
+
r == null || r.setValue(l), r == null || r.setFocusedDate(l.start);
|
|
50
|
+
},
|
|
51
|
+
children: t
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}, X = ({
|
|
55
|
+
presets: l,
|
|
56
|
+
containerClassName: t,
|
|
57
|
+
size: n = "sm",
|
|
58
|
+
flushEdges: r = !1,
|
|
59
|
+
...c
|
|
60
|
+
}) => {
|
|
61
|
+
const d = B("md"), j = k(z), a = n === "xs", x = a ? "min-h-[220px]" : "min-h-[310px]";
|
|
62
|
+
return /* @__PURE__ */ e(j ? w : F, { children: /* @__PURE__ */ o(
|
|
63
|
+
S,
|
|
64
|
+
{
|
|
65
|
+
className: i("flex items-start", t),
|
|
66
|
+
visibleDuration: {
|
|
67
|
+
months: d ? 2 : 1
|
|
68
|
+
},
|
|
69
|
+
...c,
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ o(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: i(
|
|
75
|
+
"flex flex-col py-1",
|
|
76
|
+
a ? "gap-2 px-4" : "gap-3 px-6",
|
|
77
|
+
r && (d ? "pl-0" : "px-0")
|
|
78
|
+
),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ o("header", { className: "relative flex items-center justify-between md:justify-start", children: [
|
|
81
|
+
/* @__PURE__ */ e(
|
|
82
|
+
m,
|
|
83
|
+
{
|
|
84
|
+
slot: "previous",
|
|
85
|
+
iconLeading: _,
|
|
86
|
+
size: "sm",
|
|
87
|
+
color: "tertiary",
|
|
88
|
+
className: a ? "size-6" : "size-8"
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ e(
|
|
92
|
+
"h2",
|
|
93
|
+
{
|
|
94
|
+
className: i(
|
|
95
|
+
"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 font-semibold text-fg-secondary",
|
|
96
|
+
a ? "text-xs" : "text-sm"
|
|
97
|
+
),
|
|
98
|
+
children: /* @__PURE__ */ e(N, { part: "start" })
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
m,
|
|
103
|
+
{
|
|
104
|
+
slot: "next",
|
|
105
|
+
iconLeading: f,
|
|
106
|
+
size: "sm",
|
|
107
|
+
color: "tertiary",
|
|
108
|
+
className: i(a ? "size-6" : "size-8", "md:hidden")
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] }),
|
|
112
|
+
!d && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 md:hidden", children: [
|
|
113
|
+
/* @__PURE__ */ e(
|
|
114
|
+
y,
|
|
115
|
+
{
|
|
116
|
+
slot: "start",
|
|
117
|
+
size: a ? "sm" : "md",
|
|
118
|
+
className: "flex-1"
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ e("div", { className: "text-md text-quaternary", children: "–" }),
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
y,
|
|
124
|
+
{
|
|
125
|
+
slot: "end",
|
|
126
|
+
size: a ? "sm" : "md",
|
|
127
|
+
className: "flex-1"
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }),
|
|
131
|
+
!d && l && /* @__PURE__ */ e("div", { className: "mt-1 flex justify-between gap-3 px-2 md:hidden", children: Object.values(l).map((s) => /* @__PURE__ */ e(L, { value: s.value, children: s.label }, s.label)) }),
|
|
132
|
+
/* @__PURE__ */ e("div", { className: x, children: /* @__PURE__ */ o(h, { weekdayStyle: "short", className: "w-max", children: [
|
|
133
|
+
/* @__PURE__ */ e(u, { children: (s) => /* @__PURE__ */ e(b, { className: "border-b-4 border-transparent p-0", children: /* @__PURE__ */ e(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
className: i(
|
|
137
|
+
"flex items-center justify-center font-medium text-secondary",
|
|
138
|
+
a ? "size-7 text-xs" : "size-10 text-sm"
|
|
139
|
+
),
|
|
140
|
+
children: s.slice(0, 2)
|
|
141
|
+
}
|
|
142
|
+
) }) }),
|
|
143
|
+
/* @__PURE__ */ e(g, { className: "[&_td]:p-0 [&_tr]:border-b-4 [&_tr]:border-transparent [&_tr:last-of-type]:border-none", children: (s) => /* @__PURE__ */ e(C, { date: s, size: n }) })
|
|
144
|
+
] }) })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
d && /* @__PURE__ */ o(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
className: i(
|
|
152
|
+
"flex flex-col border-l border-secondary py-1",
|
|
153
|
+
a ? "gap-2 px-4" : "gap-3 px-6",
|
|
154
|
+
r && "pr-0"
|
|
155
|
+
),
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ o("header", { className: "relative flex items-center justify-end", children: [
|
|
158
|
+
/* @__PURE__ */ e(
|
|
159
|
+
"h2",
|
|
160
|
+
{
|
|
161
|
+
className: i(
|
|
162
|
+
"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 font-semibold text-fg-secondary",
|
|
163
|
+
a ? "text-xs" : "text-sm"
|
|
164
|
+
),
|
|
165
|
+
children: /* @__PURE__ */ e(N, { part: "end" })
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ e(
|
|
169
|
+
m,
|
|
170
|
+
{
|
|
171
|
+
slot: "next",
|
|
172
|
+
iconLeading: f,
|
|
173
|
+
size: "sm",
|
|
174
|
+
color: "tertiary",
|
|
175
|
+
className: a ? "size-6" : "size-8"
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ e("div", { className: x, children: /* @__PURE__ */ o(
|
|
180
|
+
h,
|
|
181
|
+
{
|
|
182
|
+
weekdayStyle: "short",
|
|
183
|
+
offset: { months: 1 },
|
|
184
|
+
className: "w-max",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ e(u, { children: (s) => /* @__PURE__ */ e(b, { className: "border-b-4 border-transparent p-0", children: /* @__PURE__ */ e(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
className: i(
|
|
190
|
+
"flex items-center justify-center font-medium text-secondary",
|
|
191
|
+
a ? "size-7 text-xs" : "size-10 text-sm"
|
|
192
|
+
),
|
|
193
|
+
children: s.slice(0, 2)
|
|
194
|
+
}
|
|
195
|
+
) }) }),
|
|
196
|
+
/* @__PURE__ */ e(g, { className: "[&_td]:p-0 [&_tr]:border-b-4 [&_tr]:border-transparent [&_tr:last-of-type]:border-none", children: (s) => /* @__PURE__ */ e(C, { date: s, size: n }) })
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
) })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
) });
|
|
206
|
+
};
|
|
207
|
+
export {
|
|
208
|
+
X as RangeCalendar,
|
|
209
|
+
F as RangeCalendarContextProvider
|
|
210
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DateValue } from 'react-aria-components';
|
|
3
|
+
export interface RangePresetButtonProps extends HTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
value: {
|
|
5
|
+
start: DateValue;
|
|
6
|
+
end: DateValue;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const RangePresetButton: ({ value, className, children, ...props }: RangePresetButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=range-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-preset.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/range-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,uBAAuB,CAAC;AAG/B,MAAM,WAAW,sBAAuB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC/E,KAAK,EAAE;QAAE,KAAK,EAAE,SAAS,CAAC;QAAC,GAAG,EAAE,SAAS,CAAA;KAAE,CAAC;CAC7C;AAED,eAAO,MAAM,iBAAiB,GAAI,0CAK/B,sBAAsB,4CAqBxB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useSlottedContext as m, RangeCalendarContext as l } from "react-aria-components";
|
|
3
|
+
import { cx as v } from "../../utils/cn.js";
|
|
4
|
+
const h = ({
|
|
5
|
+
value: t,
|
|
6
|
+
className: a,
|
|
7
|
+
children: i,
|
|
8
|
+
...u
|
|
9
|
+
}) => {
|
|
10
|
+
var o, r, n, s;
|
|
11
|
+
const e = m(l), c = ((r = (o = e == null ? void 0 : e.value) == null ? void 0 : o.start) == null ? void 0 : r.compare(t.start)) === 0 && ((s = (n = e == null ? void 0 : e.value) == null ? void 0 : n.end) == null ? void 0 : s.compare(t.end)) === 0;
|
|
12
|
+
return /* @__PURE__ */ d(
|
|
13
|
+
"button",
|
|
14
|
+
{
|
|
15
|
+
...u,
|
|
16
|
+
className: v(
|
|
17
|
+
"cursor-pointer rounded-md px-3 py-2 text-left text-sm font-medium outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
18
|
+
c ? "bg-active text-secondary_hover hover:bg-secondary_hover" : "text-secondary hover:bg-primary_hover hover:text-secondary_hover",
|
|
19
|
+
a
|
|
20
|
+
),
|
|
21
|
+
children: i
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
h as RangePresetButton
|
|
27
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ListBoxItemRenderProps } from 'react-aria-components';
|
|
2
|
+
/**
|
|
3
|
+
* One option in a picker list: the month/year dropdowns and the time list.
|
|
4
|
+
* The selected look matches the active range preset, so every list in the
|
|
5
|
+
* picker reads as the same control.
|
|
6
|
+
*/
|
|
7
|
+
export declare const pickerOptionStyles: ({ isSelected, isFocusVisible, isDisabled, }: ListBoxItemRenderProps) => string;
|
|
8
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,6CAIhC,sBAAsB,WAQtB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cx as r } from "../../utils/cn.js";
|
|
2
|
+
const i = ({
|
|
3
|
+
isSelected: e,
|
|
4
|
+
isFocusVisible: o,
|
|
5
|
+
isDisabled: t
|
|
6
|
+
}) => r(
|
|
7
|
+
"cursor-pointer rounded-md px-2.5 py-2 text-sm whitespace-nowrap outline-hidden transition duration-100 ease-linear",
|
|
8
|
+
e ? "bg-active font-medium text-secondary_hover hover:bg-secondary_hover" : "text-secondary hover:bg-primary_hover hover:text-secondary_hover",
|
|
9
|
+
o && "outline-2 -outline-offset-2 outline-focus-ring",
|
|
10
|
+
t && "pointer-events-none text-disabled"
|
|
11
|
+
);
|
|
12
|
+
export {
|
|
13
|
+
i as pickerOptionStyles
|
|
14
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TimeFieldProps as AriaTimeFieldProps, TimeValue } from 'react-aria-components';
|
|
2
|
+
export interface TimeFieldProps extends AriaTimeFieldProps<TimeValue> {
|
|
3
|
+
className?: string;
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const TimeField: ({ className, value, onChange, compact, }: TimeFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=time-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-field.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/time-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,SAAS,EACV,MAAM,uBAAuB,CAAC;AAM/B,MAAM,WAAW,cAAe,SAAQ,kBAAkB,CAAC,SAAS,CAAC;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,GAAI,0CAKvB,cAAc,4CA0KhB,CAAC"}
|