@epilot/zenith-react 0.2.0-next.0 → 0.2.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/accordion.js +57 -48
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +120 -92
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar-group.js +38 -35
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/avatar.js +78 -71
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +60 -55
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +99 -54
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +87 -77
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +36 -32
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +105 -98
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js +62 -52
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +22 -19
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code-block/code-block.js +135 -123
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-editor/code-editor.js +276 -260
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js +62 -56
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
- package/dist/components/command/command.js +116 -105
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +38 -34
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +30 -26
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-order.js +79 -73
- package/dist/components/data-table/data-table-column-order.js.map +1 -1
- package/dist/components/data-table/data-table-column-visibility.js +25 -22
- package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
- package/dist/components/data-table/data-table-content.js +47 -44
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-error.js +36 -32
- package/dist/components/data-table/data-table-error.js.map +1 -1
- package/dist/components/data-table/data-table-footer.js +10 -8
- package/dist/components/data-table/data-table-footer.js.map +1 -1
- package/dist/components/data-table/data-table-header-draggable.js +40 -36
- package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
- package/dist/components/data-table/data-table-header.js +113 -99
- package/dist/components/data-table/data-table-header.js.map +1 -1
- package/dist/components/data-table/data-table-loading.js +21 -18
- package/dist/components/data-table/data-table-loading.js.map +1 -1
- package/dist/components/data-table/data-table-resize-handle.js +13 -11
- package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
- package/dist/components/data-table/data-table-row.js +71 -59
- package/dist/components/data-table/data-table-row.js.map +1 -1
- package/dist/components/data-table/data-table-toolbar.js +9 -7
- package/dist/components/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data-table/data-table.js +48 -46
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +173 -164
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/range-calendar.js +36 -34
- package/dist/components/date-range-picker/range-calendar.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +290 -272
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +22 -20
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +126 -120
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker.js +42 -40
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +95 -87
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/dialog/dialog.js +115 -95
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +144 -109
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +141 -112
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +196 -176
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +137 -126
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/list/list.js +237 -219
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +129 -116
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +55 -51
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +53 -36
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +38 -34
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +38 -35
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +166 -151
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +93 -85
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +149 -128
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js +19 -16
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +34 -30
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/spinner/spinner.js +22 -17
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/surface/surface.js +25 -22
- package/dist/components/surface/surface.js.map +1 -1
- package/dist/components/switch/switch.js +66 -57
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +139 -129
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +104 -90
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.js +206 -128
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/toast/toast.js +112 -100
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.js +32 -30
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +59 -46
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/lib/clear-button.js +18 -17
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/styles/host-reset.js +47 -0
- package/dist/styles/host-reset.js.map +1 -0
- package/dist/styles/overlay-layer.js +5 -0
- package/dist/styles/overlay-layer.js.map +1 -0
- package/dist/tokens.json +1 -1
- package/package.json +8 -6
- package/scripts/migration-diagnostics.mjs +42 -7
- package/scripts/migration-sweep.mjs +9 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as I, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { createElement as
|
|
4
|
-
import { SLOT_ATTR as c, mergeClasses as
|
|
5
|
-
import { Field as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Pill as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { makeZenithStyles as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
3
|
+
import { createElement as oe } from "react";
|
|
4
|
+
import { SLOT_ATTR as c, mergeClasses as J, shorthands as p } from "@epilot/zenith-runtime/v1";
|
|
5
|
+
import { Field as le, FieldLabel as pe, FieldInputGroup as ce, FieldGroupAddon as ue, FieldError as ge } from "../field/field.js";
|
|
6
|
+
import { Button as he } from "../button/button.js";
|
|
7
|
+
import { Pill as me } from "../pill/pill.js";
|
|
8
|
+
import { Popover as fe, PopoverTrigger as Te, PopoverContent as ye } from "../popover/popover.js";
|
|
9
|
+
import { makeZenithStyles as Ce } from "../../styles/make-styles.js";
|
|
10
|
+
import { boxModel as g, nativeControl as qe } from "../../styles/host-reset.js";
|
|
11
|
+
import { gray6 as be, gray9 as Se, leadingSm as U, textSm as W, grayA8 as ke, grayA12 as Ie, spacingElement1 as xe, spacingGroup1 as ve, spacingElement2 as we } from "../../tokens/index.js";
|
|
12
|
+
import { RangeCalendar as Re } from "./range-calendar.js";
|
|
13
|
+
import { formatDateTimeDisplay as d, parseDateTimeInput as N } from "../date-time-picker/date-time-picker-utils.js";
|
|
14
|
+
const Ee = (x) => /* @__PURE__ */ s(
|
|
14
15
|
"svg",
|
|
15
16
|
{
|
|
16
17
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -18,14 +19,16 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
18
19
|
viewBox: "0 -960 960 960",
|
|
19
20
|
width: "18px",
|
|
20
21
|
fill: "currentColor",
|
|
21
|
-
...
|
|
22
|
+
...x,
|
|
22
23
|
children: /* @__PURE__ */ s("path", { d: "M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Zm280 240q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z" })
|
|
23
24
|
}
|
|
24
|
-
),
|
|
25
|
+
), Ne = "dd/MM/yyyy", K = Ce({
|
|
25
26
|
root: {
|
|
27
|
+
...g,
|
|
26
28
|
width: "100%"
|
|
27
29
|
},
|
|
28
30
|
inputGroup: {
|
|
31
|
+
...g,
|
|
29
32
|
width: "100%"
|
|
30
33
|
},
|
|
31
34
|
/**
|
|
@@ -34,6 +37,7 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
34
37
|
* unconstrained 18px icon rather than the 28x28-with-14px-icon that `icon-sm` specifies.
|
|
35
38
|
*/
|
|
36
39
|
addonButton: {
|
|
40
|
+
...g,
|
|
37
41
|
width: "auto",
|
|
38
42
|
height: "auto",
|
|
39
43
|
"& svg": { width: "auto", height: "auto" }
|
|
@@ -44,9 +48,10 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
44
48
|
flexBasis: "0%"
|
|
45
49
|
},
|
|
46
50
|
triggerRoot: {
|
|
51
|
+
...g,
|
|
47
52
|
display: "flex",
|
|
48
53
|
alignItems: "center",
|
|
49
|
-
...p.gap(
|
|
54
|
+
...p.gap(we),
|
|
50
55
|
flexGrow: 1,
|
|
51
56
|
flexShrink: 1,
|
|
52
57
|
flexBasis: "0%",
|
|
@@ -54,26 +59,28 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
54
59
|
cursor: "pointer"
|
|
55
60
|
},
|
|
56
61
|
input: {
|
|
62
|
+
...qe,
|
|
57
63
|
width: "5.5rem",
|
|
58
64
|
outlineStyle: "none",
|
|
59
|
-
fontSize:
|
|
60
|
-
lineHeight:
|
|
61
|
-
color:
|
|
65
|
+
fontSize: W,
|
|
66
|
+
lineHeight: U,
|
|
67
|
+
color: Ie,
|
|
62
68
|
backgroundColor: "transparent",
|
|
63
69
|
textAlign: "center",
|
|
64
70
|
...p.border("0"),
|
|
65
71
|
...p.padding("0"),
|
|
66
72
|
"::placeholder": {
|
|
67
|
-
color:
|
|
73
|
+
color: ke
|
|
68
74
|
},
|
|
69
75
|
":disabled": {
|
|
70
76
|
cursor: "not-allowed"
|
|
71
77
|
}
|
|
72
78
|
},
|
|
73
79
|
separator: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
...g,
|
|
81
|
+
fontSize: W,
|
|
82
|
+
lineHeight: U,
|
|
83
|
+
color: Se,
|
|
77
84
|
flexShrink: 0,
|
|
78
85
|
userSelect: "none",
|
|
79
86
|
...p.padding("0", "0.125rem")
|
|
@@ -83,77 +90,79 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
83
90
|
...p.overflow("hidden")
|
|
84
91
|
},
|
|
85
92
|
content: {
|
|
93
|
+
...g,
|
|
86
94
|
display: "flex",
|
|
87
95
|
flexDirection: "row",
|
|
88
|
-
...p.gap(
|
|
96
|
+
...p.gap(ve),
|
|
89
97
|
...p.padding("0.75rem")
|
|
90
98
|
// v1 p-3 (0.75rem)
|
|
91
99
|
},
|
|
92
100
|
presets: {
|
|
101
|
+
...g,
|
|
93
102
|
display: "flex",
|
|
94
103
|
flexDirection: "column",
|
|
95
|
-
...p.gap(
|
|
104
|
+
...p.gap(xe),
|
|
96
105
|
width: "8rem",
|
|
97
106
|
// v1 w-32
|
|
98
107
|
borderLeftWidth: "1px",
|
|
99
108
|
borderLeftStyle: "solid",
|
|
100
|
-
borderLeftColor:
|
|
109
|
+
borderLeftColor: be,
|
|
101
110
|
paddingLeft: "0.75rem"
|
|
102
111
|
// v1 pl-3 (0.75rem)
|
|
103
112
|
},
|
|
104
113
|
presetPill: {
|
|
105
114
|
alignSelf: "flex-start"
|
|
106
115
|
}
|
|
107
|
-
}),
|
|
116
|
+
}), Pe = a.forwardRef((x, t) => {
|
|
108
117
|
const {
|
|
109
118
|
startValue: o,
|
|
110
119
|
endValue: i,
|
|
111
|
-
startPlaceholder:
|
|
112
|
-
endPlaceholder:
|
|
113
|
-
disabled:
|
|
114
|
-
onStartChange:
|
|
115
|
-
onEndChange:
|
|
116
|
-
onStartBlur:
|
|
120
|
+
startPlaceholder: v,
|
|
121
|
+
endPlaceholder: P,
|
|
122
|
+
disabled: h,
|
|
123
|
+
onStartChange: b,
|
|
124
|
+
onEndChange: V,
|
|
125
|
+
onStartBlur: Z,
|
|
117
126
|
onEndBlur: n,
|
|
118
127
|
testId: e,
|
|
119
|
-
inputAriaLabel:
|
|
128
|
+
inputAriaLabel: M,
|
|
120
129
|
startId: w,
|
|
121
|
-
endId:
|
|
122
|
-
labelId:
|
|
123
|
-
className:
|
|
124
|
-
"data-slot":
|
|
125
|
-
...
|
|
126
|
-
} =
|
|
127
|
-
return /* @__PURE__ */
|
|
130
|
+
endId: R,
|
|
131
|
+
labelId: m,
|
|
132
|
+
className: A,
|
|
133
|
+
"data-slot": z,
|
|
134
|
+
...D
|
|
135
|
+
} = x, f = K();
|
|
136
|
+
return /* @__PURE__ */ I(
|
|
128
137
|
"div",
|
|
129
138
|
{
|
|
130
139
|
ref: t,
|
|
131
|
-
...
|
|
132
|
-
className:
|
|
140
|
+
...D,
|
|
141
|
+
className: J(f.triggerRoot, A),
|
|
133
142
|
"data-slot": "date-range-input",
|
|
134
143
|
[c]: "date-range-input",
|
|
135
144
|
children: [
|
|
136
145
|
/* @__PURE__ */ s(
|
|
137
146
|
"input",
|
|
138
147
|
{
|
|
139
|
-
"aria-label":
|
|
148
|
+
"aria-label": M || "Start date",
|
|
140
149
|
id: w,
|
|
141
|
-
"aria-labelledby":
|
|
142
|
-
className:
|
|
150
|
+
"aria-labelledby": m ? `${m} ${w}` : void 0,
|
|
151
|
+
className: f.input,
|
|
143
152
|
"data-slot": "date-range-start-input",
|
|
144
153
|
[c]: "date-range-start-input",
|
|
145
154
|
"data-testid": e ? `${e}-start` : void 0,
|
|
146
|
-
disabled:
|
|
147
|
-
onBlur:
|
|
148
|
-
onChange:
|
|
149
|
-
placeholder:
|
|
155
|
+
disabled: h,
|
|
156
|
+
onBlur: Z,
|
|
157
|
+
onChange: b,
|
|
158
|
+
placeholder: v,
|
|
150
159
|
value: o
|
|
151
160
|
}
|
|
152
161
|
),
|
|
153
162
|
/* @__PURE__ */ s(
|
|
154
163
|
"span",
|
|
155
164
|
{
|
|
156
|
-
className:
|
|
165
|
+
className: f.separator,
|
|
157
166
|
"data-slot": "date-range-separator",
|
|
158
167
|
[c]: "date-range-separator",
|
|
159
168
|
children: "–"
|
|
@@ -163,187 +172,187 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
163
172
|
"input",
|
|
164
173
|
{
|
|
165
174
|
"aria-label": "End date",
|
|
166
|
-
id:
|
|
167
|
-
"aria-labelledby":
|
|
168
|
-
className:
|
|
175
|
+
id: R,
|
|
176
|
+
"aria-labelledby": m ? `${m} ${R}` : void 0,
|
|
177
|
+
className: f.input,
|
|
169
178
|
"data-slot": "date-range-end-input",
|
|
170
179
|
[c]: "date-range-end-input",
|
|
171
180
|
"data-testid": e ? `${e}-end` : void 0,
|
|
172
|
-
disabled:
|
|
181
|
+
disabled: h,
|
|
173
182
|
onBlur: n,
|
|
174
|
-
onChange:
|
|
175
|
-
placeholder:
|
|
183
|
+
onChange: V,
|
|
184
|
+
placeholder: P,
|
|
176
185
|
value: i
|
|
177
186
|
}
|
|
178
187
|
)
|
|
179
188
|
]
|
|
180
189
|
}
|
|
181
190
|
);
|
|
182
|
-
}),
|
|
191
|
+
}), Be = a.forwardRef(function({
|
|
183
192
|
value: t,
|
|
184
193
|
onChange: o,
|
|
185
194
|
onBlur: i,
|
|
186
|
-
disabled:
|
|
187
|
-
disablePast:
|
|
188
|
-
label:
|
|
189
|
-
error:
|
|
190
|
-
startPlaceholder:
|
|
191
|
-
endPlaceholder:
|
|
192
|
-
format: n =
|
|
195
|
+
disabled: v = !1,
|
|
196
|
+
disablePast: P = !1,
|
|
197
|
+
label: h,
|
|
198
|
+
error: b,
|
|
199
|
+
startPlaceholder: V = "dd/MM/yyyy",
|
|
200
|
+
endPlaceholder: Z = "dd/MM/yyyy",
|
|
201
|
+
format: n = Ne,
|
|
193
202
|
locale: e = "de",
|
|
194
|
-
className:
|
|
203
|
+
className: M,
|
|
195
204
|
keyboardIcon: w,
|
|
196
|
-
inputAriaLabel:
|
|
197
|
-
openPickerAriaLabel:
|
|
198
|
-
previousMonthLabel:
|
|
199
|
-
nextMonthLabel:
|
|
200
|
-
testId:
|
|
201
|
-
currentTimeInTimezone:
|
|
202
|
-
showWeekNumbers:
|
|
203
|
-
presets:
|
|
204
|
-
},
|
|
205
|
-
const l =
|
|
205
|
+
inputAriaLabel: R,
|
|
206
|
+
openPickerAriaLabel: m = "Open date picker",
|
|
207
|
+
previousMonthLabel: A = "Previous month",
|
|
208
|
+
nextMonthLabel: z = "Next month",
|
|
209
|
+
testId: D,
|
|
210
|
+
currentTimeInTimezone: f,
|
|
211
|
+
showWeekNumbers: Q = !1,
|
|
212
|
+
presets: F
|
|
213
|
+
}, X) {
|
|
214
|
+
const l = K(), [L, O] = a.useState(!1), [G, T] = a.useState(
|
|
206
215
|
() => t.start ? d(t.start, n, e) : ""
|
|
207
|
-
), [
|
|
216
|
+
), [$, y] = a.useState(
|
|
208
217
|
() => t.end ? d(t.end, n, e) : ""
|
|
209
|
-
), [
|
|
218
|
+
), [E, S] = a.useState(t), C = a.useRef(t), q = a.useRef(
|
|
210
219
|
void 0
|
|
211
220
|
);
|
|
212
221
|
a.useEffect(
|
|
213
222
|
() => () => {
|
|
214
|
-
|
|
223
|
+
q.current !== void 0 && clearTimeout(q.current);
|
|
215
224
|
},
|
|
216
225
|
[]
|
|
217
226
|
), a.useEffect(() => {
|
|
218
|
-
|
|
227
|
+
T(
|
|
219
228
|
t.start ? d(t.start, n, e) : ""
|
|
220
|
-
),
|
|
229
|
+
), y(
|
|
221
230
|
t.end ? d(t.end, n, e) : ""
|
|
222
231
|
), S(t);
|
|
223
232
|
}, [t, n, e]), a.useEffect(() => {
|
|
224
|
-
|
|
225
|
-
}, [
|
|
226
|
-
const
|
|
233
|
+
L && (C.current = t, S(t));
|
|
234
|
+
}, [L, t]);
|
|
235
|
+
const Y = a.useCallback(
|
|
227
236
|
(r) => {
|
|
228
237
|
const u = r.target.value;
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
const
|
|
233
|
-
o(
|
|
238
|
+
T(u);
|
|
239
|
+
const k = N(u, n, e);
|
|
240
|
+
if (k) {
|
|
241
|
+
const H = { ...t, start: k };
|
|
242
|
+
o(H);
|
|
234
243
|
}
|
|
235
244
|
},
|
|
236
245
|
[o, t, n, e]
|
|
237
|
-
),
|
|
246
|
+
), ee = a.useCallback(
|
|
238
247
|
(r) => {
|
|
239
248
|
const u = r.target.value;
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
o(
|
|
249
|
+
y(u);
|
|
250
|
+
const k = N(u, n, e);
|
|
251
|
+
if (k) {
|
|
252
|
+
const H = { ...t, end: k };
|
|
253
|
+
o(H);
|
|
245
254
|
}
|
|
246
255
|
},
|
|
247
256
|
[o, t, n, e]
|
|
248
|
-
),
|
|
249
|
-
|
|
257
|
+
), te = a.useCallback(() => {
|
|
258
|
+
N(G, n, e) || T(
|
|
250
259
|
t.start ? d(t.start, n, e) : ""
|
|
251
260
|
), i == null || i();
|
|
252
|
-
}, [
|
|
253
|
-
|
|
261
|
+
}, [G, t.start, n, e, i]), ne = a.useCallback(() => {
|
|
262
|
+
N($, n, e) || y(
|
|
254
263
|
t.end ? d(t.end, n, e) : ""
|
|
255
264
|
), i == null || i();
|
|
256
|
-
}, [
|
|
265
|
+
}, [$, t.end, n, e, i]), re = a.useCallback(
|
|
257
266
|
(r) => {
|
|
258
|
-
S(r),
|
|
267
|
+
S(r), T(
|
|
259
268
|
r.start ? d(r.start, n, e) : ""
|
|
260
|
-
),
|
|
269
|
+
), y(
|
|
261
270
|
r.end ? d(r.end, n, e) : ""
|
|
262
271
|
);
|
|
263
272
|
},
|
|
264
273
|
[n, e]
|
|
265
|
-
),
|
|
274
|
+
), B = a.useCallback(
|
|
266
275
|
(r) => {
|
|
267
|
-
o(r), S(r),
|
|
276
|
+
o(r), S(r), T(
|
|
268
277
|
r.start ? d(r.start, n, e) : ""
|
|
269
|
-
),
|
|
278
|
+
), y(
|
|
270
279
|
r.end ? d(r.end, n, e) : ""
|
|
271
|
-
),
|
|
272
|
-
|
|
280
|
+
), q.current !== void 0 && clearTimeout(q.current), q.current = setTimeout(() => {
|
|
281
|
+
q.current = void 0, O(!1);
|
|
273
282
|
}, 150);
|
|
274
283
|
},
|
|
275
284
|
[o, n, e]
|
|
276
|
-
),
|
|
285
|
+
), ae = a.useCallback(
|
|
277
286
|
(r) => {
|
|
278
|
-
r || (!
|
|
279
|
-
|
|
280
|
-
|
|
287
|
+
r || (!E.start || !E.end) && (S(C.current), T(
|
|
288
|
+
C.current.start ? d(
|
|
289
|
+
C.current.start,
|
|
281
290
|
n,
|
|
282
291
|
e
|
|
283
292
|
) : ""
|
|
284
|
-
),
|
|
285
|
-
|
|
286
|
-
|
|
293
|
+
), y(
|
|
294
|
+
C.current.end ? d(
|
|
295
|
+
C.current.end,
|
|
287
296
|
n,
|
|
288
297
|
e
|
|
289
298
|
) : ""
|
|
290
|
-
)),
|
|
299
|
+
)), O(r);
|
|
291
300
|
},
|
|
292
|
-
[
|
|
293
|
-
),
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
|
|
301
|
+
[E, n, e]
|
|
302
|
+
), se = w || /* @__PURE__ */ s(Ee, {}), de = b ? "destructive" : "highlight", _ = a.useId(), j = a.useId(), ie = a.useId();
|
|
303
|
+
return /* @__PURE__ */ I(
|
|
304
|
+
le,
|
|
296
305
|
{
|
|
297
|
-
className:
|
|
306
|
+
className: J(l.root, M),
|
|
298
307
|
"data-slot": "daterangepicker",
|
|
299
308
|
[c]: "daterangepicker",
|
|
300
|
-
ref:
|
|
301
|
-
variant:
|
|
309
|
+
ref: X,
|
|
310
|
+
variant: de,
|
|
302
311
|
children: [
|
|
303
|
-
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */ s(
|
|
307
|
-
|
|
312
|
+
h && /* @__PURE__ */ s(pe, { id: _, htmlFor: j, children: h }),
|
|
313
|
+
/* @__PURE__ */ I(fe, { modal: !0, onOpenChange: ae, open: L, children: [
|
|
314
|
+
/* @__PURE__ */ I(ce, { className: l.inputGroup, children: [
|
|
315
|
+
/* @__PURE__ */ s(Te, { asChild: !0, className: l.popoverTrigger, children: /* @__PURE__ */ s(
|
|
316
|
+
Pe,
|
|
308
317
|
{
|
|
309
|
-
disabled:
|
|
310
|
-
endPlaceholder:
|
|
311
|
-
endValue:
|
|
312
|
-
inputAriaLabel:
|
|
313
|
-
startId:
|
|
314
|
-
endId:
|
|
315
|
-
labelId:
|
|
316
|
-
onEndBlur:
|
|
317
|
-
onEndChange:
|
|
318
|
-
onStartBlur:
|
|
319
|
-
onStartChange:
|
|
320
|
-
startPlaceholder:
|
|
321
|
-
startValue:
|
|
322
|
-
testId:
|
|
318
|
+
disabled: v,
|
|
319
|
+
endPlaceholder: Z,
|
|
320
|
+
endValue: $,
|
|
321
|
+
inputAriaLabel: R,
|
|
322
|
+
startId: j,
|
|
323
|
+
endId: ie,
|
|
324
|
+
labelId: h ? _ : void 0,
|
|
325
|
+
onEndBlur: ne,
|
|
326
|
+
onEndChange: ee,
|
|
327
|
+
onStartBlur: te,
|
|
328
|
+
onStartChange: Y,
|
|
329
|
+
startPlaceholder: V,
|
|
330
|
+
startValue: G,
|
|
331
|
+
testId: D
|
|
323
332
|
}
|
|
324
333
|
) }),
|
|
325
|
-
/* @__PURE__ */ s(
|
|
326
|
-
|
|
334
|
+
/* @__PURE__ */ s(ue, { align: "end", children: /* @__PURE__ */ s(
|
|
335
|
+
he,
|
|
327
336
|
{
|
|
328
|
-
"aria-label":
|
|
329
|
-
disabled:
|
|
330
|
-
onClick: () =>
|
|
337
|
+
"aria-label": m,
|
|
338
|
+
disabled: v,
|
|
339
|
+
onClick: () => O(!0),
|
|
331
340
|
className: l.addonButton,
|
|
332
341
|
size: "icon-sm",
|
|
333
342
|
variant: "tertiary",
|
|
334
|
-
children:
|
|
343
|
+
children: se
|
|
335
344
|
}
|
|
336
345
|
) })
|
|
337
346
|
] }),
|
|
338
347
|
/* @__PURE__ */ s(
|
|
339
|
-
|
|
348
|
+
ye,
|
|
340
349
|
{
|
|
341
350
|
align: "start",
|
|
342
351
|
className: l.popoverContent,
|
|
343
352
|
flush: !0,
|
|
344
353
|
side: "bottom",
|
|
345
354
|
sideOffset: 4,
|
|
346
|
-
children: /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ I(
|
|
347
356
|
"div",
|
|
348
357
|
{
|
|
349
358
|
className: l.content,
|
|
@@ -351,27 +360,27 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
351
360
|
[c]: "daterangepicker-content",
|
|
352
361
|
children: [
|
|
353
362
|
/* @__PURE__ */ s(
|
|
354
|
-
|
|
363
|
+
Re,
|
|
355
364
|
{
|
|
356
|
-
currentTimeInTimezone:
|
|
357
|
-
disablePast:
|
|
365
|
+
currentTimeInTimezone: f,
|
|
366
|
+
disablePast: P,
|
|
358
367
|
locale: e,
|
|
359
|
-
nextMonthLabel:
|
|
360
|
-
onChange:
|
|
361
|
-
onRangeComplete:
|
|
362
|
-
previousMonthLabel:
|
|
363
|
-
showWeekNumbers:
|
|
364
|
-
value:
|
|
368
|
+
nextMonthLabel: z,
|
|
369
|
+
onChange: re,
|
|
370
|
+
onRangeComplete: B,
|
|
371
|
+
previousMonthLabel: A,
|
|
372
|
+
showWeekNumbers: Q,
|
|
373
|
+
value: E
|
|
365
374
|
}
|
|
366
375
|
),
|
|
367
|
-
|
|
376
|
+
F && F.length > 0 && /* @__PURE__ */ s(
|
|
368
377
|
"aside",
|
|
369
378
|
{
|
|
370
379
|
className: l.presets,
|
|
371
380
|
"data-slot": "daterangepicker-presets",
|
|
372
381
|
[c]: "daterangepicker-presets",
|
|
373
|
-
children:
|
|
374
|
-
|
|
382
|
+
children: F.map((r) => /* @__PURE__ */ oe(
|
|
383
|
+
me,
|
|
375
384
|
{
|
|
376
385
|
className: l.presetPill,
|
|
377
386
|
"data-slot": "daterangepicker-preset",
|
|
@@ -379,7 +388,7 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
379
388
|
key: r.label,
|
|
380
389
|
onClick: () => {
|
|
381
390
|
const u = r.getValue();
|
|
382
|
-
|
|
391
|
+
B(u);
|
|
383
392
|
},
|
|
384
393
|
variant: "surface"
|
|
385
394
|
},
|
|
@@ -393,13 +402,13 @@ const ve = (I) => /* @__PURE__ */ s(
|
|
|
393
402
|
}
|
|
394
403
|
)
|
|
395
404
|
] }),
|
|
396
|
-
|
|
405
|
+
b && /* @__PURE__ */ s(ge, { children: b })
|
|
397
406
|
]
|
|
398
407
|
}
|
|
399
408
|
);
|
|
400
409
|
});
|
|
401
410
|
export {
|
|
402
|
-
|
|
403
|
-
|
|
411
|
+
Be as DateRangePicker,
|
|
412
|
+
Re as RangeCalendar
|
|
404
413
|
};
|
|
405
414
|
//# sourceMappingURL=date-range-picker.js.map
|