@mirohq/design-system-calendar 0.1.7 → 0.1.9-use-press.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/dist/main.js +216 -219
- package/dist/main.js.map +1 -1
- package/dist/module.js +216 -219
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/package.json +5 -5
package/dist/main.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
var designSystemPrimitive = require('@mirohq/design-system-primitive');
|
|
6
7
|
var designSystemStitches = require('@mirohq/design-system-stitches');
|
|
7
8
|
var React = require('react');
|
|
@@ -53,14 +54,25 @@ const StyledDataSegment = designSystemStitches.styled(designSystemPrimitive.Prim
|
|
|
53
54
|
const FieldDateSegment = ({ segment, state }) => {
|
|
54
55
|
const ref = React.useRef(null);
|
|
55
56
|
const { segmentProps } = reactAria.useDateSegment(segment, state, ref);
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
58
|
+
StyledDataSegment,
|
|
59
|
+
{
|
|
60
|
+
...segmentProps,
|
|
61
|
+
ref,
|
|
62
|
+
"data-value": state.value !== null ? "" : void 0,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
"data-placeholder": !segment.isPlaceholder ? "" : void 0,
|
|
69
|
+
children: segment.placeholder
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
segment.isPlaceholder ? "" : segment.text
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
64
76
|
};
|
|
65
77
|
const TextField = React__default["default"].forwardRef((props, forwardRef) => {
|
|
66
78
|
const ref = React.useRef(null);
|
|
@@ -72,14 +84,7 @@ const TextField = React__default["default"].forwardRef((props, forwardRef) => {
|
|
|
72
84
|
createCalendar: date.createCalendar
|
|
73
85
|
});
|
|
74
86
|
const { fieldProps } = reactAria.useDateField(props, state, ref);
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
...fieldProps,
|
|
77
|
-
ref: forwardRef
|
|
78
|
-
}, state.segments.map((segment, i) => /* @__PURE__ */ React__default["default"].createElement(FieldDateSegment, {
|
|
79
|
-
key: i,
|
|
80
|
-
segment,
|
|
81
|
-
state
|
|
82
|
-
})));
|
|
87
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystemFlex.Flex, { ...fieldProps, ref: forwardRef, children: state.segments.map((segment, i) => /* @__PURE__ */ jsxRuntime.jsx(FieldDateSegment, { segment, state }, i)) });
|
|
83
88
|
});
|
|
84
89
|
|
|
85
90
|
const StyledButton = designSystemStitches.styled(designSystemPrimitive.Primitive.button, {
|
|
@@ -115,19 +120,20 @@ const Button = React__default["default"].forwardRef((props, forwardRef) => {
|
|
|
115
120
|
const { buttonProps } = reactAria.useButton(props, forwardRef);
|
|
116
121
|
const { focusProps } = reactAria.useFocusRing();
|
|
117
122
|
const { children } = props;
|
|
118
|
-
return /* @__PURE__ */
|
|
119
|
-
...reactAria.mergeProps(buttonProps, focusProps),
|
|
120
|
-
ref: forwardRef
|
|
121
|
-
}, children);
|
|
123
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledButton, { ...reactAria.mergeProps(buttonProps, focusProps), ref: forwardRef, children });
|
|
122
124
|
});
|
|
123
125
|
const FieldButton = React__default["default"].forwardRef((props, forwardRef) => {
|
|
124
126
|
const { buttonProps } = reactAria.useButton(props, forwardRef);
|
|
125
127
|
const { customButton = false, children } = props;
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
+
StyledFieldButton,
|
|
130
|
+
{
|
|
131
|
+
"data-custom": customButton ? "" : void 0,
|
|
132
|
+
...buttonProps,
|
|
133
|
+
ref: forwardRef,
|
|
134
|
+
children
|
|
135
|
+
}
|
|
136
|
+
);
|
|
131
137
|
});
|
|
132
138
|
|
|
133
139
|
const Popover = (props) => {
|
|
@@ -141,19 +147,14 @@ const Popover = (props) => {
|
|
|
141
147
|
},
|
|
142
148
|
state
|
|
143
149
|
);
|
|
144
|
-
return /* @__PURE__ */
|
|
145
|
-
...underlayProps
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
})
|
|
152
|
-
...dialogProps,
|
|
153
|
-
ref
|
|
154
|
-
}, children), /* @__PURE__ */ React__namespace.createElement(reactAria.DismissButton, {
|
|
155
|
-
onDismiss: state.close
|
|
156
|
-
})));
|
|
150
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactAria.Overlay, { children: [
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ...underlayProps }),
|
|
152
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { ...popoverProps, ref, children: [
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAria.DismissButton, { onDismiss: state.close }),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ...dialogProps, ref, children }),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAria.DismissButton, { onDismiss: state.close })
|
|
156
|
+
] })
|
|
157
|
+
] });
|
|
157
158
|
};
|
|
158
159
|
|
|
159
160
|
const StyledRangePicker = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
@@ -207,15 +208,17 @@ const StyledPredefinedRanges = designSystemStitches.styled(designSystemPrimitive
|
|
|
207
208
|
}
|
|
208
209
|
});
|
|
209
210
|
|
|
210
|
-
const PredefinedRanges = React__default["default"].forwardRef(({ range, onClick }, forwardRef) => /* @__PURE__ */
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
},
|
|
211
|
+
const PredefinedRanges = React__default["default"].forwardRef(({ range, onClick }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledPredefinedRanges, { ref: forwardRef, children: range == null ? void 0 : range.map((date, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
212
|
+
designSystemButton.Button,
|
|
213
|
+
{
|
|
214
|
+
variant: "ghost-prominent",
|
|
215
|
+
size: "medium",
|
|
216
|
+
type: "button",
|
|
217
|
+
onClick: () => onClick(date),
|
|
218
|
+
children: date.label
|
|
219
|
+
},
|
|
220
|
+
i
|
|
221
|
+
)) }));
|
|
219
222
|
|
|
220
223
|
const StyledBody = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
221
224
|
display: "inline-block",
|
|
@@ -272,15 +275,16 @@ const Header = ({
|
|
|
272
275
|
year: "numeric",
|
|
273
276
|
timeZone: state.timeZone
|
|
274
277
|
});
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
...prevButtonProps
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
278
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(StyledHeader, { children: [
|
|
279
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { ...prevButtonProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconChevronLeft, {}) }),
|
|
280
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledHeaderTitle, { children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: monthDateFormatter.format(
|
|
281
|
+
state.visibleRange.start.toDate(state.timeZone)
|
|
282
|
+
) }) }),
|
|
283
|
+
visibleMonths !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(StyledHeaderTitle, { children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: monthDateFormatter.format(
|
|
284
|
+
state.visibleRange.start.add({ months: 1 }).toDate(state.timeZone)
|
|
285
|
+
) }) }),
|
|
286
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { ...nextButtonProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconChevronRight, {}) })
|
|
287
|
+
] });
|
|
284
288
|
};
|
|
285
289
|
|
|
286
290
|
const StyledCellContent = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
@@ -363,23 +367,29 @@ const Cell = React__default["default"].forwardRef(
|
|
|
363
367
|
const isRoundedLeft = isSelected && (isSelectionStart || dayOfWeek === 0 || date$1.day === 1);
|
|
364
368
|
const isRoundedRight = isSelected && (isSelectionEnd || dayOfWeek === 6 || date$1.day === date$1.calendar.getDaysInMonth(date$1));
|
|
365
369
|
const { focusProps } = reactAria.useFocusRing();
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
370
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { ...cellProps, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
371
|
+
StyledCell,
|
|
372
|
+
{
|
|
373
|
+
...reactAria.mergeProps(buttonProps, focusProps),
|
|
374
|
+
ref: forwardRef,
|
|
375
|
+
"data-selected": isSelected ? "" : void 0,
|
|
376
|
+
"data-selection-start": isRoundedLeft ? "" : void 0,
|
|
377
|
+
"data-selection-end": isRoundedRight ? "" : void 0,
|
|
378
|
+
"data-disabled": isDisabled ? "" : void 0,
|
|
379
|
+
"data-hidden": isOutsideMonth ? "" : void 0,
|
|
380
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
381
|
+
StyledCellContent,
|
|
382
|
+
{
|
|
383
|
+
"data-selected-middle": isSelected && !(isSelectionStart || isSelectionEnd) ? "" : void 0,
|
|
384
|
+
"data-selection": isSelectionStart || isSelectionEnd ? "" : void 0,
|
|
385
|
+
"data-disabled": isDisabled ? "" : void 0,
|
|
386
|
+
"data-today": date.isToday(date$1, date.getLocalTimeZone()) ? "" : void 0,
|
|
387
|
+
"data-weekend": isWeekendDay ? "" : void 0,
|
|
388
|
+
children: formattedDate
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
}
|
|
392
|
+
) });
|
|
383
393
|
}
|
|
384
394
|
);
|
|
385
395
|
|
|
@@ -402,26 +412,20 @@ const Grid = React__default["default"].forwardRef(
|
|
|
402
412
|
state
|
|
403
413
|
);
|
|
404
414
|
const weeksInMonth = date.getWeeksInMonth(startDate, locale);
|
|
405
|
-
return /* @__PURE__ */
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
date,
|
|
420
|
-
currentMonth: startDate
|
|
421
|
-
}) : /* @__PURE__ */ React__default["default"].createElement("td", {
|
|
422
|
-
key: i
|
|
423
|
-
})
|
|
424
|
-
)))));
|
|
415
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(StyledGrid, { ref: forwardRef, ...gridProps, cellPadding: "0", children: [
|
|
416
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { ...headerProps, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: weekDays.map((day, i) => /* @__PURE__ */ jsxRuntime.jsx(StyledDays, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: day }) }, i)) }) }),
|
|
417
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from(Array(weeksInMonth).keys()).map((weekIndex) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: state.getDatesInWeek(weekIndex, startDate).map(
|
|
418
|
+
(date, i) => date !== null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
419
|
+
Cell,
|
|
420
|
+
{
|
|
421
|
+
state,
|
|
422
|
+
date,
|
|
423
|
+
currentMonth: startDate
|
|
424
|
+
},
|
|
425
|
+
i
|
|
426
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("td", {}, i)
|
|
427
|
+
) }, weekIndex)) })
|
|
428
|
+
] });
|
|
425
429
|
}
|
|
426
430
|
);
|
|
427
431
|
|
|
@@ -485,56 +489,56 @@ const RangePicker = React__default["default"].forwardRef((props, forwardRef) =>
|
|
|
485
489
|
state.close();
|
|
486
490
|
}
|
|
487
491
|
};
|
|
488
|
-
return /* @__PURE__ */
|
|
489
|
-
ref:
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
"
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}
|
|
492
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(StyledRangePicker, { ref: forwardRef, children: [
|
|
493
|
+
children === void 0 && /* @__PURE__ */ jsxRuntime.jsx(StyledRangePickerInput$1, { ...groupProps, ref, children: /* @__PURE__ */ jsxRuntime.jsxs(StyledRangePickerInputContent$1, { children: [
|
|
494
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextField, { ...startFieldProps }),
|
|
495
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\u2013" }),
|
|
496
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextField, { ...endFieldProps }),
|
|
497
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystemFlex.Flex, { css: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(FieldButton, { ...buttonProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCalendarBlank, {}) }) })
|
|
498
|
+
] }) }),
|
|
499
|
+
children !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { ...groupProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx(FieldButton, { ...buttonProps, customButton: true, children }) }),
|
|
500
|
+
state.isOpen && /* @__PURE__ */ jsxRuntime.jsx(Popover, { triggerRef: ref, state, placement: "bottom start", children: /* @__PURE__ */ jsxRuntime.jsx(StyledBody, { ref: forwardRef, children: /* @__PURE__ */ jsxRuntime.jsxs(StyledBodyContent, { children: [
|
|
501
|
+
predefinedRanges !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
502
|
+
PredefinedRanges,
|
|
503
|
+
{
|
|
504
|
+
range: predefinedRanges,
|
|
505
|
+
onClick: rangeClick
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystemFlex.Flex, { direction: "column", ...calendarProps, children: [
|
|
509
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
510
|
+
Header,
|
|
511
|
+
{
|
|
512
|
+
state: rangeState,
|
|
513
|
+
prevButtonProps,
|
|
514
|
+
nextButtonProps,
|
|
515
|
+
visibleMonths
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
/* @__PURE__ */ jsxRuntime.jsxs(StyledGridContent, { children: [
|
|
519
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentLeft, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { state: rangeState }) }),
|
|
520
|
+
visibleMonths !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentRight, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
521
|
+
Grid,
|
|
522
|
+
{
|
|
523
|
+
onChange: change,
|
|
524
|
+
state: rangeState,
|
|
525
|
+
offset: { months: 1 }
|
|
526
|
+
}
|
|
527
|
+
) })
|
|
528
|
+
] }),
|
|
529
|
+
onClear !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(StyledClearContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
530
|
+
designSystemButton.Button,
|
|
531
|
+
{
|
|
532
|
+
size: "medium",
|
|
533
|
+
type: "button",
|
|
534
|
+
onClick: clear,
|
|
535
|
+
disabled: rangeState.value === null,
|
|
536
|
+
children: clearButtonText
|
|
537
|
+
}
|
|
538
|
+
) })
|
|
539
|
+
] })
|
|
540
|
+
] }) }) })
|
|
541
|
+
] });
|
|
538
542
|
});
|
|
539
543
|
|
|
540
544
|
const StyledRangePickerInput = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
@@ -592,30 +596,33 @@ const DatePickerBody = React__default["default"].forwardRef((props, forwardRef)
|
|
|
592
596
|
},
|
|
593
597
|
[state]
|
|
594
598
|
);
|
|
595
|
-
return /* @__PURE__ */
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
599
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledBody, { ref: forwardRef, children: /* @__PURE__ */ jsxRuntime.jsxs(StyledBodyContent, { ...calendarProps, children: [
|
|
600
|
+
predefinedRanges !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(PredefinedRanges, { range: predefinedRanges, onClick: dateClick }),
|
|
601
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystemFlex.Flex, { direction: "column", children: [
|
|
602
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
603
|
+
Header,
|
|
604
|
+
{
|
|
605
|
+
state,
|
|
606
|
+
prevButtonProps,
|
|
607
|
+
nextButtonProps,
|
|
608
|
+
visibleMonths
|
|
609
|
+
}
|
|
610
|
+
),
|
|
611
|
+
/* @__PURE__ */ jsxRuntime.jsxs(StyledGridContent, { children: [
|
|
612
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentLeft, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { state }) }),
|
|
613
|
+
visibleMonths !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentRight, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { state, offset: { months: 1 } }) })
|
|
614
|
+
] }),
|
|
615
|
+
onClear !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(StyledClearContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
616
|
+
designSystemButton.Button,
|
|
617
|
+
{
|
|
618
|
+
size: "medium",
|
|
619
|
+
onClick: onClear,
|
|
620
|
+
disabled: state.value === null,
|
|
621
|
+
children: clearButtonText
|
|
622
|
+
}
|
|
623
|
+
) })
|
|
624
|
+
] })
|
|
625
|
+
] }) });
|
|
619
626
|
});
|
|
620
627
|
|
|
621
628
|
const DatePicker = React__default["default"].forwardRef((props, forwardRef) => {
|
|
@@ -644,61 +651,51 @@ const DatePicker = React__default["default"].forwardRef((props, forwardRef) => {
|
|
|
644
651
|
onClear();
|
|
645
652
|
}
|
|
646
653
|
};
|
|
647
|
-
return /* @__PURE__ */
|
|
648
|
-
ref:
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
defaultValue,
|
|
682
|
-
predefinedRanges,
|
|
683
|
-
visibleMonths,
|
|
684
|
-
onClear: onClear !== void 0 ? clearState : void 0,
|
|
685
|
-
minDate,
|
|
686
|
-
maxDate,
|
|
687
|
-
clearButtonText: onClear !== void 0 ? clearButtonText : void 0
|
|
688
|
-
}));
|
|
654
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: picker === "single" ? /* @__PURE__ */ jsxRuntime.jsxs(StyledDatePicker, { ref: forwardRef, children: [
|
|
655
|
+
children === void 0 && /* @__PURE__ */ jsxRuntime.jsx(StyledRangePickerInput, { ...groupProps, ref, children: /* @__PURE__ */ jsxRuntime.jsxs(StyledRangePickerInputContent, { children: [
|
|
656
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextField, { ...fieldProps }),
|
|
657
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystemFlex.Flex, { css: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(FieldButton, { ...buttonProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCalendarBlank, {}) }) })
|
|
658
|
+
] }) }),
|
|
659
|
+
children !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { ...groupProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx(FieldButton, { ...buttonProps, customButton: true, children }) }),
|
|
660
|
+
state.isOpen && /* @__PURE__ */ jsxRuntime.jsx(Popover, { triggerRef: ref, state, placement: "bottom start", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
661
|
+
DatePickerBody,
|
|
662
|
+
{
|
|
663
|
+
...calendarProps,
|
|
664
|
+
defaultValue,
|
|
665
|
+
predefinedRanges,
|
|
666
|
+
visibleMonths,
|
|
667
|
+
onClear: onClear !== void 0 ? clearState : void 0,
|
|
668
|
+
minDate,
|
|
669
|
+
maxDate,
|
|
670
|
+
clearButtonText: onClear !== void 0 ? clearButtonText : void 0,
|
|
671
|
+
ref: forwardRef
|
|
672
|
+
}
|
|
673
|
+
) })
|
|
674
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
675
|
+
DatePickerBody,
|
|
676
|
+
{
|
|
677
|
+
...calendarProps,
|
|
678
|
+
ref: forwardRef,
|
|
679
|
+
defaultValue,
|
|
680
|
+
predefinedRanges,
|
|
681
|
+
visibleMonths,
|
|
682
|
+
onClear: onClear !== void 0 ? clearState : void 0,
|
|
683
|
+
minDate,
|
|
684
|
+
maxDate,
|
|
685
|
+
clearButtonText: onClear !== void 0 ? clearButtonText : void 0
|
|
686
|
+
}
|
|
687
|
+
) });
|
|
689
688
|
});
|
|
690
689
|
|
|
691
690
|
const StyledCalendar = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {});
|
|
692
|
-
const Calendar = React__default["default"].forwardRef(({ picker, defaultValue, ...props }, forwardRef) => /* @__PURE__ */
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
picker
|
|
701
|
-
})));
|
|
691
|
+
const Calendar = React__default["default"].forwardRef(({ picker, defaultValue, ...props }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledCalendar, { ref: forwardRef, children: picker === "range" ? /* @__PURE__ */ jsxRuntime.jsx(RangePicker, { defaultValue, ...props }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
692
|
+
DatePicker,
|
|
693
|
+
{
|
|
694
|
+
defaultValue,
|
|
695
|
+
...props,
|
|
696
|
+
picker
|
|
697
|
+
}
|
|
698
|
+
) }));
|
|
702
699
|
|
|
703
700
|
exports.Calendar = Calendar;
|
|
704
701
|
//# sourceMappingURL=main.js.map
|