@epilot/zenith-react 0.1.0-next.0 → 0.1.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/README.md +95 -15
- package/dist/components/appearance-boundary/appearance-boundary.js +32 -34
- package/dist/components/appearance-boundary/appearance-boundary.js.map +1 -1
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +10 -10
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +28 -28
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +13 -13
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +13 -13
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code-block/code-block.js +6 -6
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-editor/code-editor.js +1 -1
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/code-editor/indent.js.map +1 -1
- package/dist/components/command/command.js +7 -13
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +120 -66
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +7 -7
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-order.js +277 -0
- package/dist/components/data-table/data-table-column-order.js.map +1 -0
- package/dist/components/data-table/data-table-content.js +72 -58
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-context.js +8 -4
- package/dist/components/data-table/data-table-context.js.map +1 -1
- package/dist/components/data-table/data-table-footer.js +31 -0
- package/dist/components/data-table/data-table-footer.js.map +1 -0
- package/dist/components/data-table/data-table-header-draggable.js +151 -0
- package/dist/components/data-table/data-table-header-draggable.js.map +1 -0
- package/dist/components/data-table/data-table-header.js +130 -57
- package/dist/components/data-table/data-table-header.js.map +1 -1
- package/dist/components/data-table/data-table-resize-handle.js +137 -0
- package/dist/components/data-table/data-table-resize-handle.js.map +1 -0
- package/dist/components/data-table/data-table.js +184 -156
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/data-table/hooks/use-data-table-virtualizer.js +9 -0
- package/dist/components/data-table/hooks/use-data-table-virtualizer.js.map +1 -0
- package/dist/components/date-range-picker/date-range-picker.js +197 -195
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +29 -29
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +55 -55
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/density-provider/density-provider.js.map +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +5 -5
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +36 -36
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +4 -4
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +40 -40
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/label/label.js +0 -28
- package/dist/components/label/label.js.map +1 -1
- package/dist/components/list/list.js +42 -52
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +27 -25
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +9 -9
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/radio/radio.js +14 -14
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +9 -9
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +1 -1
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +11 -11
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/slot/compose-as-child.js.map +1 -1
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/switch/switch.js +11 -11
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +1 -1
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +15 -15
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/text/text.js +10 -1
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/toast/toast.js +30 -32
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.js +20 -20
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/delivery/index.d.ts +10 -44
- package/dist/delivery/index.js +5 -9
- package/dist/index.d.ts +1994 -2272
- package/dist/index.js +133 -121
- package/dist/index.js.map +1 -1
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/lib/code-highlight.js.map +1 -1
- package/dist/lib/code-tokens.js.map +1 -1
- package/dist/lib/pagination.js.map +1 -1
- package/dist/packages/tokens/dist/delivery/index.js +18 -48
- package/dist/packages/tokens/dist/delivery/index.js.map +1 -1
- package/dist/packages/tokens/dist/generated/core.generated.js +18 -0
- package/dist/packages/tokens/dist/generated/core.generated.js.map +1 -0
- package/dist/packages/tokens/dist/generated/palette.generated.js +5 -5
- package/dist/packages/tokens/dist/generated/palette.generated.js.map +1 -1
- package/dist/packages/tokens/dist/install.js +9 -9
- package/dist/packages/tokens/dist/install.js.map +1 -1
- package/dist/styles/document-context.js.map +1 -1
- package/dist/styles/make-styles.js.map +1 -1
- package/dist/tokens/core.meta.generated.js +2 -2
- package/dist/tokens/core.meta.generated.js.map +1 -1
- package/dist/tokens/index.d.ts +1029 -1104
- package/dist/tokens/index.js +1031 -1106
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/palette.generated.js +2 -2
- package/dist/tokens/palette.generated.js.map +1 -1
- package/dist/tokens/use-palette-tokens.js.map +1 -1
- package/dist/tokens.json +605 -755
- package/dist/vendor/.bun/@dnd-kit_core@6.3.1_6f4b9a1cfb20c0ae/vendor/@dnd-kit/core/dist/core.esm.js +385 -340
- package/dist/vendor/.bun/@dnd-kit_core@6.3.1_6f4b9a1cfb20c0ae/vendor/@dnd-kit/core/dist/core.esm.js.map +1 -1
- package/dist/vendor/.bun/@dnd-kit_sortable@10.0.0_1d291640e1250bbe/vendor/@dnd-kit/sortable/dist/sortable.esm.js +344 -229
- package/dist/vendor/.bun/@dnd-kit_sortable@10.0.0_1d291640e1250bbe/vendor/@dnd-kit/sortable/dist/sortable.esm.js.map +1 -1
- package/dist/vendor/.bun/@dnd-kit_utilities@3.2.2_62547eec5a2188e3/vendor/@dnd-kit/utilities/dist/utilities.esm.js +1 -1
- package/dist/vendor/.bun/@tanstack_react-virtual@3.11.2_6f4b9a1cfb20c0ae/vendor/@tanstack/react-virtual/dist/esm/index.js +36 -0
- package/dist/vendor/.bun/@tanstack_react-virtual@3.11.2_6f4b9a1cfb20c0ae/vendor/@tanstack/react-virtual/dist/esm/index.js.map +1 -0
- package/dist/vendor/.bun/@tanstack_virtual-core@3.11.2/vendor/@tanstack/virtual-core/dist/esm/index.js +450 -0
- package/dist/vendor/.bun/@tanstack_virtual-core@3.11.2/vendor/@tanstack/virtual-core/dist/esm/index.js.map +1 -0
- package/dist/vendor/.bun/@tanstack_virtual-core@3.11.2/vendor/@tanstack/virtual-core/dist/esm/utils.js +50 -0
- package/dist/vendor/.bun/@tanstack_virtual-core@3.11.2/vendor/@tanstack/virtual-core/dist/esm/utils.js.map +1 -0
- package/package.json +5 -4
- package/scripts/migration-diagnostics-core.mjs +19 -90
- package/scripts/migration-diagnostics.mjs +1 -16
- package/scripts/migration-sweep.mjs +2 -12
- package/ADOPTING.md +0 -73
- package/dist/packages/tokens/dist/delivery/internal.js +0 -181
- package/dist/packages/tokens/dist/delivery/internal.js.map +0 -1
- package/dist/packages/tokens/dist/generated/core.meta.generated.js +0 -10
- package/dist/packages/tokens/dist/generated/core.meta.generated.js.map +0 -1
- package/dist/token-assets/core/5cd4072decf5df2a664f0b1d5f2ec250a3309101ded3056c1f87c8bbe3738d50.css +0 -22
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as k, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
3
|
import { createElement as ae } from "react";
|
|
4
|
-
import { SLOT_ATTR as
|
|
5
|
-
import { Field as
|
|
6
|
-
import { Button as
|
|
4
|
+
import { SLOT_ATTR as l, mergeClasses as B, shorthands as c } from "@epilot/zenith-runtime/v1";
|
|
5
|
+
import { Field as se, FieldLabel as ie, FieldInputGroup as de, FieldGroupAddon as oe, FieldError as pe } from "../field/field.js";
|
|
6
|
+
import { Button as ce } from "../button/button.js";
|
|
7
7
|
import { Pill as le } from "../pill/pill.js";
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { makeZenithStyles as
|
|
10
|
-
import { gray6 as
|
|
11
|
-
import { RangeCalendar as
|
|
12
|
-
import { formatDateTimeDisplay as
|
|
13
|
-
const
|
|
8
|
+
import { Popover as ge, PopoverTrigger as ue, PopoverContent as he } from "../popover/popover.js";
|
|
9
|
+
import { makeZenithStyles as me } from "../../styles/make-styles.js";
|
|
10
|
+
import { gray6 as fe, gray9 as Te, leadingSm as H, textSm as z, grayA8 as Ce, grayA12 as qe, spacingElement1 as ye, spacingGroup1 as Se, spacingElement2 as ke } from "../../tokens/index.js";
|
|
11
|
+
import { RangeCalendar as xe } from "./range-calendar.js";
|
|
12
|
+
import { formatDateTimeDisplay as i, parseDateTimeInput as b } from "../date-time-picker/date-time-picker-utils.js";
|
|
13
|
+
const we = (x) => /* @__PURE__ */ s(
|
|
14
14
|
"svg",
|
|
15
15
|
{
|
|
16
16
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -18,10 +18,10 @@ const xe = (k) => /* @__PURE__ */ s(
|
|
|
18
18
|
viewBox: "0 -960 960 960",
|
|
19
19
|
width: "18px",
|
|
20
20
|
fill: "currentColor",
|
|
21
|
-
...
|
|
21
|
+
...x,
|
|
22
22
|
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
23
|
}
|
|
24
|
-
),
|
|
24
|
+
), Re = "dd/MM/yyyy", _ = me({
|
|
25
25
|
root: {
|
|
26
26
|
width: "100%"
|
|
27
27
|
},
|
|
@@ -29,14 +29,9 @@ const xe = (k) => /* @__PURE__ */ s(
|
|
|
29
29
|
width: "100%"
|
|
30
30
|
},
|
|
31
31
|
/**
|
|
32
|
-
* Reproduces a v1 defect on purpose, the same way Label's line-height is reproduced: v1's
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* Standalone, both arms render 28x28 — see the `button/size-icon-sm` specimen.
|
|
36
|
-
*
|
|
37
|
-
* Rule 0 targets v1's OUTPUT, and here the output is what consumers lay out against: matching
|
|
38
|
-
* `icon-sm` instead makes every date field 4px taller. So the size is released back to the content
|
|
39
|
-
* and the icon left unconstrained, which is v1's mechanism and not just its numbers.
|
|
32
|
+
* Reproduces a v1 defect on purpose, the same way Label's line-height is reproduced: v1's `icon-
|
|
33
|
+
* sm` size classes do not reach this button, so v1 renders it content-sized at 18x18 around an
|
|
34
|
+
* unconstrained 18px icon rather than the 28x28-with-14px-icon that `icon-sm` specifies.
|
|
40
35
|
*/
|
|
41
36
|
addonButton: {
|
|
42
37
|
width: "auto",
|
|
@@ -51,7 +46,7 @@ const xe = (k) => /* @__PURE__ */ s(
|
|
|
51
46
|
triggerRoot: {
|
|
52
47
|
display: "flex",
|
|
53
48
|
alignItems: "center",
|
|
54
|
-
...
|
|
49
|
+
...c.gap(ke),
|
|
55
50
|
flexGrow: 1,
|
|
56
51
|
flexShrink: 1,
|
|
57
52
|
flexBasis: "0%",
|
|
@@ -61,101 +56,101 @@ const xe = (k) => /* @__PURE__ */ s(
|
|
|
61
56
|
input: {
|
|
62
57
|
width: "5.5rem",
|
|
63
58
|
outlineStyle: "none",
|
|
64
|
-
fontSize:
|
|
65
|
-
lineHeight:
|
|
66
|
-
color:
|
|
59
|
+
fontSize: z,
|
|
60
|
+
lineHeight: H,
|
|
61
|
+
color: qe,
|
|
67
62
|
backgroundColor: "transparent",
|
|
68
63
|
textAlign: "center",
|
|
69
|
-
...
|
|
70
|
-
...
|
|
64
|
+
...c.border("0"),
|
|
65
|
+
...c.padding("0"),
|
|
71
66
|
"::placeholder": {
|
|
72
|
-
color:
|
|
67
|
+
color: Ce
|
|
73
68
|
},
|
|
74
69
|
":disabled": {
|
|
75
70
|
cursor: "not-allowed"
|
|
76
71
|
}
|
|
77
72
|
},
|
|
78
73
|
separator: {
|
|
79
|
-
fontSize:
|
|
80
|
-
lineHeight:
|
|
74
|
+
fontSize: z,
|
|
75
|
+
lineHeight: H,
|
|
81
76
|
color: Te,
|
|
82
77
|
flexShrink: 0,
|
|
83
78
|
userSelect: "none",
|
|
84
|
-
...
|
|
79
|
+
...c.padding("0", "0.125rem")
|
|
85
80
|
// v1 px-0.5
|
|
86
81
|
},
|
|
87
82
|
popoverContent: {
|
|
88
|
-
...
|
|
83
|
+
...c.overflow("hidden")
|
|
89
84
|
},
|
|
90
85
|
content: {
|
|
91
86
|
display: "flex",
|
|
92
87
|
flexDirection: "row",
|
|
93
|
-
...
|
|
94
|
-
...
|
|
88
|
+
...c.gap(Se),
|
|
89
|
+
...c.padding("0.75rem")
|
|
95
90
|
// v1 p-3 (0.75rem)
|
|
96
91
|
},
|
|
97
92
|
presets: {
|
|
98
93
|
display: "flex",
|
|
99
94
|
flexDirection: "column",
|
|
100
|
-
...
|
|
95
|
+
...c.gap(ye),
|
|
101
96
|
width: "8rem",
|
|
102
97
|
// v1 w-32
|
|
103
98
|
borderLeftWidth: "1px",
|
|
104
99
|
borderLeftStyle: "solid",
|
|
105
|
-
borderLeftColor:
|
|
100
|
+
borderLeftColor: fe,
|
|
106
101
|
paddingLeft: "0.75rem"
|
|
107
102
|
// v1 pl-3 (0.75rem)
|
|
108
103
|
},
|
|
109
104
|
presetPill: {
|
|
110
105
|
alignSelf: "flex-start"
|
|
111
106
|
}
|
|
112
|
-
}), be =
|
|
107
|
+
}), be = a.forwardRef((x, t) => {
|
|
113
108
|
const {
|
|
114
109
|
startValue: o,
|
|
115
|
-
endValue:
|
|
116
|
-
startPlaceholder:
|
|
117
|
-
endPlaceholder:
|
|
118
|
-
disabled:
|
|
119
|
-
onStartChange:
|
|
120
|
-
onEndChange:
|
|
121
|
-
onStartBlur:
|
|
110
|
+
endValue: d,
|
|
111
|
+
startPlaceholder: w,
|
|
112
|
+
endPlaceholder: v,
|
|
113
|
+
disabled: C,
|
|
114
|
+
onStartChange: q,
|
|
115
|
+
onEndChange: E,
|
|
116
|
+
onStartBlur: I,
|
|
122
117
|
onEndBlur: n,
|
|
123
118
|
testId: e,
|
|
124
|
-
inputAriaLabel:
|
|
125
|
-
className:
|
|
126
|
-
"data-slot":
|
|
127
|
-
...
|
|
128
|
-
} =
|
|
129
|
-
return /* @__PURE__ */
|
|
119
|
+
inputAriaLabel: N,
|
|
120
|
+
className: P,
|
|
121
|
+
"data-slot": F,
|
|
122
|
+
...V
|
|
123
|
+
} = x, u = _();
|
|
124
|
+
return /* @__PURE__ */ k(
|
|
130
125
|
"div",
|
|
131
126
|
{
|
|
132
127
|
ref: t,
|
|
133
|
-
...
|
|
134
|
-
className:
|
|
128
|
+
...V,
|
|
129
|
+
className: B(u.triggerRoot, P),
|
|
135
130
|
"data-slot": "date-range-input",
|
|
136
|
-
[
|
|
131
|
+
[l]: "date-range-input",
|
|
137
132
|
children: [
|
|
138
133
|
/* @__PURE__ */ s(
|
|
139
134
|
"input",
|
|
140
135
|
{
|
|
141
|
-
"aria-label":
|
|
142
|
-
className:
|
|
136
|
+
"aria-label": N || "Start date",
|
|
137
|
+
className: u.input,
|
|
143
138
|
"data-slot": "date-range-start-input",
|
|
144
|
-
[
|
|
139
|
+
[l]: "date-range-start-input",
|
|
145
140
|
"data-testid": e ? `${e}-start` : void 0,
|
|
146
|
-
disabled:
|
|
147
|
-
onBlur:
|
|
148
|
-
onChange:
|
|
149
|
-
placeholder:
|
|
141
|
+
disabled: C,
|
|
142
|
+
onBlur: I,
|
|
143
|
+
onChange: q,
|
|
144
|
+
placeholder: w,
|
|
150
145
|
value: o
|
|
151
146
|
}
|
|
152
147
|
),
|
|
153
148
|
/* @__PURE__ */ s(
|
|
154
149
|
"span",
|
|
155
150
|
{
|
|
156
|
-
className:
|
|
151
|
+
className: u.separator,
|
|
157
152
|
"data-slot": "date-range-separator",
|
|
158
|
-
[
|
|
153
|
+
[l]: "date-range-separator",
|
|
159
154
|
children: "–"
|
|
160
155
|
}
|
|
161
156
|
),
|
|
@@ -163,163 +158,170 @@ const xe = (k) => /* @__PURE__ */ s(
|
|
|
163
158
|
"input",
|
|
164
159
|
{
|
|
165
160
|
"aria-label": "End date",
|
|
166
|
-
className:
|
|
161
|
+
className: u.input,
|
|
167
162
|
"data-slot": "date-range-end-input",
|
|
168
|
-
[
|
|
163
|
+
[l]: "date-range-end-input",
|
|
169
164
|
"data-testid": e ? `${e}-end` : void 0,
|
|
170
|
-
disabled:
|
|
165
|
+
disabled: C,
|
|
171
166
|
onBlur: n,
|
|
172
|
-
onChange:
|
|
173
|
-
placeholder:
|
|
174
|
-
value:
|
|
167
|
+
onChange: E,
|
|
168
|
+
placeholder: v,
|
|
169
|
+
value: d
|
|
175
170
|
}
|
|
176
171
|
)
|
|
177
172
|
]
|
|
178
173
|
}
|
|
179
174
|
);
|
|
180
|
-
}),
|
|
175
|
+
}), Oe = a.forwardRef(function({
|
|
181
176
|
value: t,
|
|
182
177
|
onChange: o,
|
|
183
|
-
onBlur:
|
|
184
|
-
disabled:
|
|
185
|
-
disablePast:
|
|
186
|
-
label:
|
|
187
|
-
error:
|
|
188
|
-
startPlaceholder:
|
|
189
|
-
endPlaceholder:
|
|
190
|
-
format: n =
|
|
178
|
+
onBlur: d,
|
|
179
|
+
disabled: w = !1,
|
|
180
|
+
disablePast: v = !1,
|
|
181
|
+
label: C,
|
|
182
|
+
error: q,
|
|
183
|
+
startPlaceholder: E = "dd/MM/yyyy",
|
|
184
|
+
endPlaceholder: I = "dd/MM/yyyy",
|
|
185
|
+
format: n = Re,
|
|
191
186
|
locale: e = "de",
|
|
192
|
-
className:
|
|
193
|
-
keyboardIcon:
|
|
194
|
-
inputAriaLabel:
|
|
195
|
-
openPickerAriaLabel:
|
|
196
|
-
previousMonthLabel:
|
|
197
|
-
nextMonthLabel:
|
|
198
|
-
testId:
|
|
199
|
-
currentTimeInTimezone:
|
|
200
|
-
showWeekNumbers:
|
|
201
|
-
presets:
|
|
202
|
-
},
|
|
203
|
-
const p =
|
|
204
|
-
() => t.start ?
|
|
205
|
-
), [
|
|
206
|
-
() => t.end ?
|
|
207
|
-
), [
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
187
|
+
className: N,
|
|
188
|
+
keyboardIcon: P,
|
|
189
|
+
inputAriaLabel: F,
|
|
190
|
+
openPickerAriaLabel: V = "Open date picker",
|
|
191
|
+
previousMonthLabel: u = "Previous month",
|
|
192
|
+
nextMonthLabel: j = "Next month",
|
|
193
|
+
testId: $,
|
|
194
|
+
currentTimeInTimezone: U,
|
|
195
|
+
showWeekNumbers: W = !1,
|
|
196
|
+
presets: Z
|
|
197
|
+
}, J) {
|
|
198
|
+
const p = _(), [M, A] = a.useState(!1), [D, h] = a.useState(
|
|
199
|
+
() => t.start ? i(t.start, n, e) : ""
|
|
200
|
+
), [L, m] = a.useState(
|
|
201
|
+
() => t.end ? i(t.end, n, e) : ""
|
|
202
|
+
), [R, y] = a.useState(t), f = a.useRef(t), T = a.useRef(
|
|
203
|
+
void 0
|
|
204
|
+
);
|
|
205
|
+
a.useEffect(
|
|
206
|
+
() => () => {
|
|
207
|
+
T.current !== void 0 && clearTimeout(T.current);
|
|
208
|
+
},
|
|
209
|
+
[]
|
|
210
|
+
), a.useEffect(() => {
|
|
211
|
+
h(
|
|
212
|
+
t.start ? i(t.start, n, e) : ""
|
|
211
213
|
), m(
|
|
212
|
-
t.end ?
|
|
213
|
-
),
|
|
214
|
-
}, [t, n, e]),
|
|
215
|
-
|
|
216
|
-
}, [
|
|
217
|
-
const
|
|
218
|
-
(
|
|
219
|
-
const g =
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
224
|
-
o(
|
|
214
|
+
t.end ? i(t.end, n, e) : ""
|
|
215
|
+
), y(t);
|
|
216
|
+
}, [t, n, e]), a.useEffect(() => {
|
|
217
|
+
M && (f.current = t, y(t));
|
|
218
|
+
}, [M, t]);
|
|
219
|
+
const K = a.useCallback(
|
|
220
|
+
(r) => {
|
|
221
|
+
const g = r.target.value;
|
|
222
|
+
h(g);
|
|
223
|
+
const S = b(g, n, e);
|
|
224
|
+
if (S) {
|
|
225
|
+
const O = { ...t, start: S };
|
|
226
|
+
o(O);
|
|
225
227
|
}
|
|
226
228
|
},
|
|
227
229
|
[o, t, n, e]
|
|
228
|
-
),
|
|
229
|
-
(
|
|
230
|
-
const g =
|
|
230
|
+
), Q = a.useCallback(
|
|
231
|
+
(r) => {
|
|
232
|
+
const g = r.target.value;
|
|
231
233
|
m(g);
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
const
|
|
235
|
-
o(
|
|
234
|
+
const S = b(g, n, e);
|
|
235
|
+
if (S) {
|
|
236
|
+
const O = { ...t, end: S };
|
|
237
|
+
o(O);
|
|
236
238
|
}
|
|
237
239
|
},
|
|
238
240
|
[o, t, n, e]
|
|
239
|
-
),
|
|
240
|
-
b(
|
|
241
|
-
t.start ?
|
|
242
|
-
),
|
|
243
|
-
}, [
|
|
244
|
-
b(
|
|
245
|
-
t.end ?
|
|
246
|
-
),
|
|
247
|
-
}, [
|
|
248
|
-
(
|
|
249
|
-
|
|
250
|
-
|
|
241
|
+
), X = a.useCallback(() => {
|
|
242
|
+
b(D, n, e) || h(
|
|
243
|
+
t.start ? i(t.start, n, e) : ""
|
|
244
|
+
), d == null || d();
|
|
245
|
+
}, [D, t.start, n, e, d]), Y = a.useCallback(() => {
|
|
246
|
+
b(L, n, e) || m(
|
|
247
|
+
t.end ? i(t.end, n, e) : ""
|
|
248
|
+
), d == null || d();
|
|
249
|
+
}, [L, t.end, n, e, d]), ee = a.useCallback(
|
|
250
|
+
(r) => {
|
|
251
|
+
y(r), h(
|
|
252
|
+
r.start ? i(r.start, n, e) : ""
|
|
251
253
|
), m(
|
|
252
|
-
|
|
254
|
+
r.end ? i(r.end, n, e) : ""
|
|
253
255
|
);
|
|
254
256
|
},
|
|
255
257
|
[n, e]
|
|
256
|
-
),
|
|
257
|
-
(
|
|
258
|
-
o(
|
|
259
|
-
|
|
258
|
+
), G = a.useCallback(
|
|
259
|
+
(r) => {
|
|
260
|
+
o(r), y(r), h(
|
|
261
|
+
r.start ? i(r.start, n, e) : ""
|
|
260
262
|
), m(
|
|
261
|
-
|
|
262
|
-
), setTimeout(() => {
|
|
263
|
-
|
|
263
|
+
r.end ? i(r.end, n, e) : ""
|
|
264
|
+
), T.current !== void 0 && clearTimeout(T.current), T.current = setTimeout(() => {
|
|
265
|
+
T.current = void 0, A(!1);
|
|
264
266
|
}, 150);
|
|
265
267
|
},
|
|
266
268
|
[o, n, e]
|
|
267
|
-
),
|
|
268
|
-
(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
), te = a.useCallback(
|
|
270
|
+
(r) => {
|
|
271
|
+
r || (!R.start || !R.end) && (y(f.current), h(
|
|
272
|
+
f.current.start ? i(
|
|
273
|
+
f.current.start,
|
|
272
274
|
n,
|
|
273
275
|
e
|
|
274
276
|
) : ""
|
|
275
277
|
), m(
|
|
276
|
-
|
|
277
|
-
|
|
278
|
+
f.current.end ? i(
|
|
279
|
+
f.current.end,
|
|
278
280
|
n,
|
|
279
281
|
e
|
|
280
282
|
) : ""
|
|
281
|
-
)),
|
|
283
|
+
)), A(r);
|
|
282
284
|
},
|
|
283
|
-
[
|
|
284
|
-
),
|
|
285
|
-
return /* @__PURE__ */
|
|
286
|
-
|
|
285
|
+
[R, n, e]
|
|
286
|
+
), ne = P || /* @__PURE__ */ s(we, {}), re = q ? "destructive" : "highlight";
|
|
287
|
+
return /* @__PURE__ */ k(
|
|
288
|
+
se,
|
|
287
289
|
{
|
|
288
|
-
className:
|
|
290
|
+
className: B(p.root, N),
|
|
289
291
|
"data-slot": "daterangepicker",
|
|
290
|
-
[
|
|
291
|
-
ref:
|
|
292
|
-
variant:
|
|
292
|
+
[l]: "daterangepicker",
|
|
293
|
+
ref: J,
|
|
294
|
+
variant: re,
|
|
293
295
|
children: [
|
|
294
|
-
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */ s(
|
|
296
|
+
C && /* @__PURE__ */ s(ie, { children: C }),
|
|
297
|
+
/* @__PURE__ */ k(ge, { modal: !0, onOpenChange: te, open: M, children: [
|
|
298
|
+
/* @__PURE__ */ k(de, { className: p.inputGroup, children: [
|
|
299
|
+
/* @__PURE__ */ s(ue, { asChild: !0, className: p.popoverTrigger, children: /* @__PURE__ */ s(
|
|
298
300
|
be,
|
|
299
301
|
{
|
|
300
|
-
disabled:
|
|
301
|
-
endPlaceholder:
|
|
302
|
-
endValue:
|
|
303
|
-
inputAriaLabel:
|
|
304
|
-
onEndBlur:
|
|
305
|
-
onEndChange:
|
|
306
|
-
onStartBlur:
|
|
307
|
-
onStartChange:
|
|
308
|
-
startPlaceholder:
|
|
309
|
-
startValue:
|
|
310
|
-
testId:
|
|
302
|
+
disabled: w,
|
|
303
|
+
endPlaceholder: I,
|
|
304
|
+
endValue: L,
|
|
305
|
+
inputAriaLabel: F,
|
|
306
|
+
onEndBlur: Y,
|
|
307
|
+
onEndChange: Q,
|
|
308
|
+
onStartBlur: X,
|
|
309
|
+
onStartChange: K,
|
|
310
|
+
startPlaceholder: E,
|
|
311
|
+
startValue: D,
|
|
312
|
+
testId: $
|
|
311
313
|
}
|
|
312
314
|
) }),
|
|
313
|
-
/* @__PURE__ */ s(
|
|
314
|
-
|
|
315
|
+
/* @__PURE__ */ s(oe, { align: "end", children: /* @__PURE__ */ s(
|
|
316
|
+
ce,
|
|
315
317
|
{
|
|
316
|
-
"aria-label":
|
|
317
|
-
disabled:
|
|
318
|
-
onClick: () =>
|
|
318
|
+
"aria-label": V,
|
|
319
|
+
disabled: w,
|
|
320
|
+
onClick: () => A(!0),
|
|
319
321
|
className: p.addonButton,
|
|
320
322
|
size: "icon-sm",
|
|
321
323
|
variant: "tertiary",
|
|
322
|
-
children:
|
|
324
|
+
children: ne
|
|
323
325
|
}
|
|
324
326
|
) })
|
|
325
327
|
] }),
|
|
@@ -331,47 +333,47 @@ const xe = (k) => /* @__PURE__ */ s(
|
|
|
331
333
|
flush: !0,
|
|
332
334
|
side: "bottom",
|
|
333
335
|
sideOffset: 4,
|
|
334
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ k(
|
|
335
337
|
"div",
|
|
336
338
|
{
|
|
337
339
|
className: p.content,
|
|
338
340
|
"data-slot": "daterangepicker-content",
|
|
339
|
-
[
|
|
341
|
+
[l]: "daterangepicker-content",
|
|
340
342
|
children: [
|
|
341
343
|
/* @__PURE__ */ s(
|
|
342
|
-
|
|
344
|
+
xe,
|
|
343
345
|
{
|
|
344
|
-
currentTimeInTimezone:
|
|
345
|
-
disablePast:
|
|
346
|
+
currentTimeInTimezone: U,
|
|
347
|
+
disablePast: v,
|
|
346
348
|
locale: e,
|
|
347
|
-
nextMonthLabel:
|
|
348
|
-
onChange:
|
|
349
|
-
onRangeComplete:
|
|
350
|
-
previousMonthLabel:
|
|
351
|
-
showWeekNumbers:
|
|
352
|
-
value:
|
|
349
|
+
nextMonthLabel: j,
|
|
350
|
+
onChange: ee,
|
|
351
|
+
onRangeComplete: G,
|
|
352
|
+
previousMonthLabel: u,
|
|
353
|
+
showWeekNumbers: W,
|
|
354
|
+
value: R
|
|
353
355
|
}
|
|
354
356
|
),
|
|
355
|
-
|
|
357
|
+
Z && Z.length > 0 && /* @__PURE__ */ s(
|
|
356
358
|
"aside",
|
|
357
359
|
{
|
|
358
360
|
className: p.presets,
|
|
359
361
|
"data-slot": "daterangepicker-presets",
|
|
360
|
-
[
|
|
361
|
-
children:
|
|
362
|
+
[l]: "daterangepicker-presets",
|
|
363
|
+
children: Z.map((r) => /* @__PURE__ */ ae(
|
|
362
364
|
le,
|
|
363
365
|
{
|
|
364
366
|
className: p.presetPill,
|
|
365
367
|
"data-slot": "daterangepicker-preset",
|
|
366
|
-
[
|
|
367
|
-
key:
|
|
368
|
+
[l]: "daterangepicker-preset",
|
|
369
|
+
key: r.label,
|
|
368
370
|
onClick: () => {
|
|
369
|
-
const g =
|
|
370
|
-
|
|
371
|
+
const g = r.getValue();
|
|
372
|
+
G(g);
|
|
371
373
|
},
|
|
372
374
|
variant: "surface"
|
|
373
375
|
},
|
|
374
|
-
|
|
376
|
+
r.label
|
|
375
377
|
))
|
|
376
378
|
}
|
|
377
379
|
)
|
|
@@ -381,13 +383,13 @@ const xe = (k) => /* @__PURE__ */ s(
|
|
|
381
383
|
}
|
|
382
384
|
)
|
|
383
385
|
] }),
|
|
384
|
-
|
|
386
|
+
q && /* @__PURE__ */ s(pe, { children: q })
|
|
385
387
|
]
|
|
386
388
|
}
|
|
387
389
|
);
|
|
388
390
|
});
|
|
389
391
|
export {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
+
Oe as DateRangePicker,
|
|
393
|
+
xe as RangeCalendar
|
|
392
394
|
};
|
|
393
395
|
//# sourceMappingURL=date-range-picker.js.map
|