@overdoser/react-toolkit 0.20.0 → 0.22.0
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/AGENTS.md +2 -1
- package/CHANGELOG.md +41 -0
- package/components/Accordion/Accordion.js +160 -177
- package/components/Accordion/Accordion.module.scss.js +19 -35
- package/components/ActionButton/ActionButton.js +155 -209
- package/components/ActionButton/ActionButton.module.scss.js +24 -46
- package/components/ActionButton/CopyButton.js +52 -64
- package/components/Alert/Alert.js +93 -96
- package/components/Alert/Alert.module.scss.js +17 -32
- package/components/Avatar/Avatar.js +44 -55
- package/components/Avatar/Avatar.module.scss.js +22 -42
- package/components/Badge/Badge.js +15 -37
- package/components/Badge/Badge.module.scss.js +16 -30
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Breadcrumbs/Breadcrumbs.js +52 -48
- package/components/Breadcrumbs/Breadcrumbs.module.scss.js +9 -16
- package/components/Button/Button.js +35 -57
- package/components/Button/Button.module.scss.js +24 -46
- package/components/Card/Card.js +94 -131
- package/components/Card/Card.module.scss.js +34 -59
- package/components/Chart/AreaChart.d.ts +1 -1
- package/components/Chart/AreaChart.js +248 -249
- package/components/Chart/Axis.d.ts +2 -2
- package/components/Chart/Axis.js +34 -43
- package/components/Chart/BarChart.d.ts +1 -1
- package/components/Chart/BarChart.js +307 -348
- package/components/Chart/Chart.module.scss.js +31 -60
- package/components/Chart/ChartContainer.js +33 -41
- package/components/Chart/ChartLegend.d.ts +1 -1
- package/components/Chart/ChartLegend.js +31 -30
- package/components/Chart/ChartTooltip.d.ts +1 -1
- package/components/Chart/ChartTooltip.js +45 -40
- package/components/Chart/LineChart.d.ts +1 -1
- package/components/Chart/LineChart.js +220 -232
- package/components/Chart/PieChart.d.ts +1 -1
- package/components/Chart/PieChart.js +224 -240
- package/components/Chart/RadarChart.d.ts +1 -1
- package/components/Chart/RadarChart.js +166 -215
- package/components/Chart/Sparkline.js +73 -68
- package/components/Chart/TradingChart.d.ts +1 -1
- package/components/Chart/TradingChart.js +804 -701
- package/components/Chart/scales.js +28 -35
- package/components/Chart/trading/indicators.js +61 -62
- package/components/Chart/trading/period.js +46 -68
- package/components/Chart/useChartDimensions.js +30 -22
- package/components/Chip/Chip.js +98 -141
- package/components/Chip/Chip.module.scss.js +31 -58
- package/components/CodeBlock/CodeBlock.js +111 -119
- package/components/CodeBlock/CodeBlock.module.scss.js +22 -42
- package/components/CommandPalette/CommandPalette.js +387 -392
- package/components/CommandPalette/CommandPalette.module.scss.js +27 -48
- package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/components/ConfirmDialog/ConfirmDialog.js +184 -199
- package/components/ConfirmDialog/ConfirmDialog.module.scss.js +11 -20
- package/components/Divider/Divider.js +25 -36
- package/components/Divider/Divider.module.scss.js +16 -30
- package/components/Draggable/Draggable.d.ts +1 -1
- package/components/Draggable/Draggable.js +157 -164
- package/components/Draggable/Draggable.module.scss.js +9 -16
- package/components/Drawer/Drawer.js +104 -126
- package/components/Drawer/Drawer.module.scss.js +65 -118
- package/components/Dropdown/Dropdown.js +175 -234
- package/components/Dropdown/Dropdown.module.scss.js +28 -52
- package/components/Dropdown/DropdownItem.js +55 -58
- package/components/Dropdown/DropdownLabel.js +14 -11
- package/components/Dropdown/DropdownSeparator.js +13 -11
- package/components/Dropdown/dropdownContext.js +4 -5
- package/components/Dropdown/useContextMenu.js +27 -17
- package/components/Dropzone/Dropzone.js +99 -105
- package/components/Dropzone/Dropzone.module.scss.js +11 -20
- package/components/EmptyState/EmptyState.js +57 -54
- package/components/EmptyState/EmptyState.module.scss.js +13 -24
- package/components/Form/Form.d.ts +1 -1
- package/components/Form/Form.js +31 -34
- package/components/Form/Form.module.scss.js +15 -28
- package/components/Form/FormField.d.ts +1 -1
- package/components/Form/FormField.js +71 -75
- package/components/Form/FormRow.d.ts +1 -1
- package/components/Form/FormRow.js +11 -8
- package/components/Form/formFieldDefaults.js +4 -5
- package/components/ImageViewer/ImageViewer.js +312 -201
- package/components/ImageViewer/ImageViewer.module.scss.js +25 -46
- package/components/ImageViewer/useZoomPan.js +206 -137
- package/components/Kbd/Kbd.js +24 -21
- package/components/Kbd/Kbd.module.scss.js +9 -16
- package/components/KeyValueList/KeyValueList.js +119 -123
- package/components/KeyValueList/KeyValueList.module.scss.js +22 -42
- package/components/Link/Link.js +45 -59
- package/components/Link/Link.module.scss.js +9 -15
- package/components/List/List.js +22 -46
- package/components/List/List.module.scss.js +11 -20
- package/components/Loader/Loader.js +152 -182
- package/components/Loader/Loader.module.scss.js +39 -69
- package/components/Modal/Modal.js +93 -105
- package/components/Modal/Modal.module.scss.js +17 -32
- package/components/PageHeader/PageHeader.js +79 -73
- package/components/PageHeader/PageHeader.module.scss.js +22 -42
- package/components/Pagination/Pagination.js +62 -83
- package/components/Pagination/Pagination.module.scss.js +12 -22
- package/components/Pagination/paginationRange.js +15 -22
- package/components/Popover/Popover.js +110 -134
- package/components/Popover/Popover.module.scss.js +11 -20
- package/components/ProgressBar/ProgressBar.d.ts +15 -1
- package/components/ProgressBar/ProgressBar.js +56 -89
- package/components/ProgressBar/ProgressBar.module.scss.js +28 -50
- package/components/RelativeTime/RelativeTime.js +36 -43
- package/components/RelativeTime/RelativeTime.module.scss.js +3 -7
- package/components/SegmentedControl/SegmentedControl.js +93 -129
- package/components/SegmentedControl/SegmentedControl.module.scss.js +20 -38
- package/components/Skeleton/Skeleton.js +36 -50
- package/components/Skeleton/Skeleton.module.scss.js +14 -24
- package/components/Spinner/Spinner.js +25 -25
- package/components/Spinner/Spinner.module.scss.js +11 -19
- package/components/SplitButton/SplitButton.js +149 -196
- package/components/SplitButton/SplitButton.module.scss.js +30 -56
- package/components/SplitPane/SplitPane.js +134 -170
- package/components/SplitPane/SplitPane.module.scss.js +13 -24
- package/components/StatCard/StatCard.js +132 -125
- package/components/StatCard/StatCard.module.scss.js +41 -71
- package/components/StatusDot/StatusDot.js +28 -39
- package/components/StatusDot/StatusDot.module.scss.js +17 -31
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +381 -451
- package/components/Table/Table.module.scss.js +41 -80
- package/components/Table/useTableSort.js +51 -42
- package/components/Tabs/Tabs.js +109 -161
- package/components/Tabs/Tabs.module.scss.js +27 -52
- package/components/ThemeToggle/ThemeToggle.js +122 -98
- package/components/ThemeToggle/ThemeToggle.module.scss.js +12 -22
- package/components/Timeline/GanttTimeline.js +357 -318
- package/components/Timeline/GanttTimeline.module.scss.js +28 -54
- package/components/Timeline/HistoryTimeline.js +486 -450
- package/components/Timeline/HistoryTimeline.module.scss.js +30 -58
- package/components/Timeline/Timeline.module.scss.js +75 -140
- package/components/Timeline/TimelineShared.d.ts +7 -7
- package/components/Timeline/TimelineShared.js +288 -279
- package/components/Timeline/TraceEventDetails.d.ts +3 -3
- package/components/Timeline/TraceEventDetails.js +244 -177
- package/components/Timeline/TraceTimeline.js +823 -783
- package/components/Timeline/TraceTimeline.module.scss.js +97 -188
- package/components/Timeline/historyLayout.js +336 -263
- package/components/Timeline/timelineCore.js +208 -183
- package/components/Timeline/traceEvent.js +59 -61
- package/components/Timeline/traceLayout.js +101 -90
- package/components/Timeline/useTimeline.js +76 -79
- package/components/Timer/Timer.js +190 -156
- package/components/Timer/Timer.module.scss.js +28 -54
- package/components/Toast/Toast.d.ts +1 -1
- package/components/Toast/Toast.js +128 -128
- package/components/Toast/Toast.module.scss.js +36 -61
- package/components/Toast/toastStore.js +58 -62
- package/components/ToggleIconButton/ToggleIconButton.js +36 -58
- package/components/ToggleIconButton/ToggleIconButton.module.scss.js +14 -26
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Tooltip/Tooltip.js +76 -85
- package/components/Tooltip/Tooltip.module.scss.js +16 -29
- package/components/Typography/Typography.js +10 -35
- package/components/Typography/Typography.module.scss.js +29 -52
- package/components/inputs/Checkbox/Checkbox.js +27 -51
- package/components/inputs/Checkbox/Checkbox.module.scss.js +9 -16
- package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
- package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +16 -30
- package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
- package/components/inputs/DatePicker/CalendarPanel.js +263 -286
- package/components/inputs/DatePicker/CalendarPanel.module.scss.js +22 -40
- package/components/inputs/DatePicker/DatePicker.js +115 -142
- package/components/inputs/DatePicker/DatePicker.module.scss.js +13 -24
- package/components/inputs/DatePicker/dateUtils.js +32 -41
- package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
- package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +19 -36
- package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
- package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
- package/components/inputs/DateTimePicker/TimeField.js +131 -132
- package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
- package/components/inputs/Input/Input.js +98 -109
- package/components/inputs/Input/Input.module.scss.js +14 -26
- package/components/inputs/NumberInput/NumberInput.js +112 -132
- package/components/inputs/NumberInput/NumberInput.module.scss.js +13 -24
- package/components/inputs/Radio/Radio.js +50 -73
- package/components/inputs/Radio/Radio.module.scss.js +8 -14
- package/components/inputs/SearchInput/SearchInput.js +98 -115
- package/components/inputs/SearchInput/SearchInput.module.scss.js +7 -12
- package/components/inputs/Select/Select.d.ts +55 -3
- package/components/inputs/Select/Select.js +696 -682
- package/components/inputs/Select/Select.module.scss.js +49 -72
- package/components/inputs/Slider/Slider.js +97 -128
- package/components/inputs/Slider/Slider.module.scss.js +8 -14
- package/components/inputs/Switch/Switch.js +11 -8
- package/components/inputs/Textarea/Textarea.js +42 -58
- package/components/inputs/Textarea/Textarea.module.scss.js +13 -24
- package/hooks/useClickOutside.js +17 -14
- package/hooks/useDebouncedValue.js +13 -14
- package/hooks/useElementSize.js +27 -22
- package/hooks/useEscapeLayer.js +28 -29
- package/hooks/useFocusTrap.js +27 -38
- package/hooks/useKeyboard.js +76 -64
- package/hooks/useMediaQuery.js +10 -15
- package/hooks/useNow.js +28 -33
- package/hooks/usePersistedState.js +98 -94
- package/hooks/usePortalPosition.d.ts +2 -1
- package/hooks/usePortalPosition.js +28 -19
- package/hooks/useResizable.js +106 -104
- package/hooks/useTheme.js +28 -23
- package/index.css +2 -1
- package/index.js +96 -214
- package/index.layered.css +2 -3
- package/llms.txt +28 -4
- package/manifest.json +41 -4
- package/package.json +1 -1
- package/utils/formatBytes.js +29 -13
- package/utils/themeScript.js +6 -8
- package/utils/timeAgo.js +59 -32
|
@@ -1,41 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
d as day,
|
|
23
|
-
s as dayOutside,
|
|
24
|
-
r as daySelected,
|
|
25
|
-
a as dayToday,
|
|
26
|
-
w as default,
|
|
27
|
-
n as grid,
|
|
28
|
-
t as header,
|
|
29
|
-
S as months,
|
|
30
|
-
e as nav,
|
|
31
|
-
l as navHidden,
|
|
32
|
-
u as option,
|
|
33
|
-
v as optionSelected,
|
|
34
|
-
p as options,
|
|
35
|
-
k as srOnly,
|
|
36
|
-
y as title,
|
|
37
|
-
i as titleButton,
|
|
38
|
-
c as weekday,
|
|
39
|
-
o as weekdays,
|
|
40
|
-
h as years
|
|
1
|
+
// src/components/inputs/DatePicker/CalendarPanel.module.scss
|
|
2
|
+
var e = "crk-header-T9XMb", t = "crk-monthLabel-8mRvZ", n = "crk-nav-iAxYo", r = "crk-weekdays-TV4PD", i = "crk-grid--96pQ", a = "crk-weekday--syM1", o = "crk-day-m-HUr", s = "crk-dayOutside-x2kQk", c = "crk-dayToday-qIjS-", l = "crk-daySelected-iA4S4", u = "crk-title-68NVZ", d = "crk-titleButton-9V2YZ", f = "crk-srOnly-4nytm", p = "crk-navHidden-QhiL0", m = "crk-options-b8L5n", h = "crk-months-b-CoG", g = "crk-years-QGvpU", _ = "crk-option-kbY30", v = "crk-optionSelected-as-xo", y = {
|
|
3
|
+
header: e,
|
|
4
|
+
monthLabel: t,
|
|
5
|
+
nav: n,
|
|
6
|
+
weekdays: r,
|
|
7
|
+
grid: i,
|
|
8
|
+
weekday: a,
|
|
9
|
+
day: o,
|
|
10
|
+
dayOutside: s,
|
|
11
|
+
dayToday: c,
|
|
12
|
+
daySelected: l,
|
|
13
|
+
title: u,
|
|
14
|
+
titleButton: d,
|
|
15
|
+
srOnly: f,
|
|
16
|
+
navHidden: p,
|
|
17
|
+
options: m,
|
|
18
|
+
months: h,
|
|
19
|
+
years: g,
|
|
20
|
+
option: _,
|
|
21
|
+
optionSelected: v
|
|
41
22
|
};
|
|
23
|
+
export { o as day, s as dayOutside, l as daySelected, c as dayToday, y as default, i as grid, e as header, t as monthLabel, h as months, n as nav, p as navHidden, _ as option, v as optionSelected, m as options, f as srOnly, u as title, d as titleButton, a as weekday, r as weekdays, g as years };
|
|
@@ -1,142 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ n(
|
|
119
|
-
"button",
|
|
120
|
-
{
|
|
121
|
-
type: "button",
|
|
122
|
-
tabIndex: -1,
|
|
123
|
-
className: D(t.icon, a?.icon),
|
|
124
|
-
onClick: x,
|
|
125
|
-
disabled: r,
|
|
126
|
-
"aria-label": "Open calendar",
|
|
127
|
-
children: /* @__PURE__ */ F("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: [
|
|
128
|
-
/* @__PURE__ */ n("rect", { x: "3", y: "4", width: "14", height: "13", rx: "2" }),
|
|
129
|
-
/* @__PURE__ */ n("path", { d: "M3 8h14M7 2v3M13 2v3", strokeLinecap: "round" })
|
|
130
|
-
] })
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
i && (c ? typeof document < "u" && te(R, document.body) : R)
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
ae.displayName = "DatePicker";
|
|
140
|
-
export {
|
|
141
|
-
ae as DatePicker
|
|
142
|
-
};
|
|
1
|
+
import { forwardRef as e, useCallback as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import { createPortal as a } from "react-dom";
|
|
3
|
+
import o from "clsx";
|
|
4
|
+
import { useClickOutside as s } from "../../../hooks/useClickOutside.js";
|
|
5
|
+
import { usePortalPosition as c } from "../../../hooks/usePortalPosition.js";
|
|
6
|
+
import l from "./DatePicker.module.scss.js";
|
|
7
|
+
import { CalendarPanel as u } from "./CalendarPanel.js";
|
|
8
|
+
import { startOfDay as d, startOfMonth as f } from "./dateUtils.js";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
// src/components/inputs/DatePicker/DatePicker.tsx
|
|
11
|
+
var h = e(({ value: e, defaultValue: h, onChange: g, min: _, max: v, disabledDate: y, weekStartsOn: b = 0, locale: x, format: S, placeholder: C = "Select date", inputSize: ee = "md", error: w = !1, disabled: T = !1, portal: E = !0, classes: D, className: O, style: k, "aria-label": A }, j) => {
|
|
12
|
+
let M = e !== void 0, [N, P] = i(h ?? null), F = M ? e ?? null : N, [I, L] = i(!1), [R, z] = i(() => f(F ?? /* @__PURE__ */ new Date())), [B, V] = i(() => d(F ?? /* @__PURE__ */ new Date())), H = r(null), U = r(null), W = c(H, I && E), G = n(() => d(/* @__PURE__ */ new Date()), []), K = n(() => S ?? ((e) => new Intl.DateTimeFormat(x, {
|
|
13
|
+
year: "numeric",
|
|
14
|
+
month: "short",
|
|
15
|
+
day: "numeric"
|
|
16
|
+
}).format(e)), [S, x]), q = n(() => _ ? d(_) : void 0, [_]), J = n(() => v ? d(v) : void 0, [v]), Y = t((e) => q && e < q || J && e > J ? !0 : y?.(e) ?? !1, [
|
|
17
|
+
q,
|
|
18
|
+
J,
|
|
19
|
+
y
|
|
20
|
+
]), X = t((e) => {
|
|
21
|
+
M || P(e), g?.(e);
|
|
22
|
+
}, [M, g]), Z = t(() => {
|
|
23
|
+
if (T) return;
|
|
24
|
+
let e = d(F ?? /* @__PURE__ */ new Date());
|
|
25
|
+
z(f(e)), V(e), L(!0);
|
|
26
|
+
}, [T, F]), Q = t((e = !0) => {
|
|
27
|
+
L(!1), e && H.current?.querySelector("input")?.focus();
|
|
28
|
+
}, []), te = t((e) => {
|
|
29
|
+
X(e), Q();
|
|
30
|
+
}, [X, Q]);
|
|
31
|
+
s(U, () => L(!1), I);
|
|
32
|
+
let ne = (e) => {
|
|
33
|
+
e.key === "ArrowDown" || e.key === "Enter" ? (e.preventDefault(), Z()) : e.key === "Escape" && I && (e.preventDefault(), L(!1));
|
|
34
|
+
}, $ = /* @__PURE__ */ p("div", {
|
|
35
|
+
ref: U,
|
|
36
|
+
onKeyDown: (e) => {
|
|
37
|
+
e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), Q());
|
|
38
|
+
},
|
|
39
|
+
className: o(l.popover, E && l.portalled, D?.popover),
|
|
40
|
+
style: E ? {
|
|
41
|
+
position: "fixed",
|
|
42
|
+
top: W.top + 4,
|
|
43
|
+
left: W.left
|
|
44
|
+
} : void 0,
|
|
45
|
+
role: "dialog",
|
|
46
|
+
"aria-modal": "false",
|
|
47
|
+
"aria-label": "Choose date",
|
|
48
|
+
children: /* @__PURE__ */ p(u, {
|
|
49
|
+
viewDate: R,
|
|
50
|
+
focusedDate: B,
|
|
51
|
+
selected: F,
|
|
52
|
+
today: G,
|
|
53
|
+
minDay: q,
|
|
54
|
+
maxDay: J,
|
|
55
|
+
locale: x,
|
|
56
|
+
weekStartsOn: b,
|
|
57
|
+
isDisabledDay: Y,
|
|
58
|
+
onSelect: te,
|
|
59
|
+
onViewDateChange: z,
|
|
60
|
+
onFocusedDateChange: V,
|
|
61
|
+
onEscape: Q,
|
|
62
|
+
classes: D
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
return /* @__PURE__ */ m("div", {
|
|
66
|
+
ref: H,
|
|
67
|
+
className: o(l.root, l[ee], w && l.error, T && l.disabled, D?.root, O),
|
|
68
|
+
style: k,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ p("input", {
|
|
71
|
+
ref: j,
|
|
72
|
+
type: "text",
|
|
73
|
+
readOnly: !0,
|
|
74
|
+
className: o(l.input, D?.input),
|
|
75
|
+
value: F ? K(F) : "",
|
|
76
|
+
placeholder: C,
|
|
77
|
+
disabled: T,
|
|
78
|
+
"aria-label": A,
|
|
79
|
+
"aria-haspopup": "dialog",
|
|
80
|
+
"aria-expanded": I,
|
|
81
|
+
"aria-invalid": w || void 0,
|
|
82
|
+
onClick: Z,
|
|
83
|
+
onKeyDown: ne
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ p("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
tabIndex: -1,
|
|
88
|
+
className: o(l.icon, D?.icon),
|
|
89
|
+
onClick: Z,
|
|
90
|
+
disabled: T,
|
|
91
|
+
"aria-label": "Open calendar",
|
|
92
|
+
children: /* @__PURE__ */ m("svg", {
|
|
93
|
+
viewBox: "0 0 20 20",
|
|
94
|
+
fill: "none",
|
|
95
|
+
stroke: "currentColor",
|
|
96
|
+
strokeWidth: "1.5",
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
children: [/* @__PURE__ */ p("rect", {
|
|
99
|
+
x: "3",
|
|
100
|
+
y: "4",
|
|
101
|
+
width: "14",
|
|
102
|
+
height: "13",
|
|
103
|
+
rx: "2"
|
|
104
|
+
}), /* @__PURE__ */ p("path", {
|
|
105
|
+
d: "M3 8h14M7 2v3M13 2v3",
|
|
106
|
+
strokeLinecap: "round"
|
|
107
|
+
})]
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
I && (E ? typeof document < "u" && a($, document.body) : $)
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
h.displayName = "DatePicker";
|
|
115
|
+
export { h as DatePicker };
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
i as default,
|
|
15
|
-
l as disabled,
|
|
16
|
-
n as error,
|
|
17
|
-
e as icon,
|
|
18
|
-
c as input,
|
|
19
|
-
s as lg,
|
|
20
|
-
t as md,
|
|
21
|
-
d as popover,
|
|
22
|
-
p as portalled,
|
|
23
|
-
o as root,
|
|
24
|
-
r as sm
|
|
1
|
+
// src/components/inputs/DatePicker/DatePicker.module.scss
|
|
2
|
+
var e = "crk-root-ZBCoP", t = "crk-sm-7EeFF", n = "crk-input-62G21", r = "crk-md-OVdqx", i = "crk-lg-a9KsJ", a = "crk-icon-jS307", o = "crk-error-c4lUO", s = "crk-disabled-3PiA5", c = "crk-popover-x1-UT", l = "crk-portalled-iPe0Y", u = {
|
|
3
|
+
root: e,
|
|
4
|
+
sm: t,
|
|
5
|
+
input: n,
|
|
6
|
+
md: r,
|
|
7
|
+
lg: i,
|
|
8
|
+
icon: a,
|
|
9
|
+
error: o,
|
|
10
|
+
disabled: s,
|
|
11
|
+
popover: c,
|
|
12
|
+
portalled: l
|
|
25
13
|
};
|
|
14
|
+
export { u as default, s as disabled, o as error, a as icon, n as input, i as lg, r as md, c as popover, l as portalled, e as root, t as sm };
|
|
@@ -1,41 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
D as addMonths,
|
|
34
|
-
h as buildCalendarDays,
|
|
35
|
-
s as isSameDay,
|
|
36
|
-
i as isSameMonth,
|
|
37
|
-
f as startOfDay,
|
|
38
|
-
l as startOfMonth,
|
|
39
|
-
c as toISODate,
|
|
40
|
-
M as weekdayLabels
|
|
41
|
-
};
|
|
1
|
+
// src/components/inputs/DatePicker/dateUtils.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
4
|
+
}
|
|
5
|
+
function t(e, t) {
|
|
6
|
+
return !e || !t ? !1 : e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
7
|
+
}
|
|
8
|
+
function n(e, t) {
|
|
9
|
+
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
|
|
10
|
+
}
|
|
11
|
+
function r(e, t) {
|
|
12
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
13
|
+
}
|
|
14
|
+
function i(e, t) {
|
|
15
|
+
return new Date(e.getFullYear(), e.getMonth() + t, 1);
|
|
16
|
+
}
|
|
17
|
+
function a(e) {
|
|
18
|
+
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
19
|
+
}
|
|
20
|
+
function o(e) {
|
|
21
|
+
let t = (e) => String(e).padStart(2, "0");
|
|
22
|
+
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
|
|
23
|
+
}
|
|
24
|
+
function s(e, t) {
|
|
25
|
+
let n = a(e), i = r(n, -((n.getDay() - t + 7) % 7));
|
|
26
|
+
return Array.from({ length: 42 }, (e, t) => r(i, t));
|
|
27
|
+
}
|
|
28
|
+
function c(e, t) {
|
|
29
|
+
let n = new Intl.DateTimeFormat(e, { weekday: "short" }), i = new Date(2023, 0, 1);
|
|
30
|
+
return Array.from({ length: 7 }, (e, a) => n.format(r(i, (t + a) % 7)));
|
|
31
|
+
}
|
|
32
|
+
export { r as addDays, i as addMonths, s as buildCalendarDays, t as isSameDay, n as isSameMonth, e as startOfDay, a as startOfMonth, o as toISODate, c as weekdayLabels };
|