@mirohq/design-system-calendar 1.0.0 → 1.2.0-new-focus-keyboard.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 CHANGED
@@ -20,6 +20,8 @@ var reactUseControllableState = require('@radix-ui/react-use-controllable-state'
20
20
  var reactStately = require('react-stately');
21
21
  var date = require('@internationalized/date');
22
22
  var designSystemFlex = require('@mirohq/design-system-flex');
23
+ var designSystemTypography = require('@mirohq/design-system-typography');
24
+ var designSystemIconButton = require('@mirohq/design-system-icon-button');
23
25
  var designSystemButton = require('@mirohq/design-system-button');
24
26
 
25
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -52,6 +54,12 @@ const StyledPlaceholder = designSystemStitches.styled(designSystemPrimitive.Prim
52
54
  const StyledValue$1 = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
53
55
  padding: "0 $50"
54
56
  });
57
+ const StyledIconContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
58
+ display: "flex",
59
+ justifyContent: "center",
60
+ padding: "6px",
61
+ color: "$text-neutrals-subtle"
62
+ });
55
63
  const StyledTrigger = designSystemStitches.styled(designSystemBaseButton.BaseButton, {
56
64
  display: "inline-flex",
57
65
  gap: "$50",
@@ -61,20 +69,20 @@ const StyledTrigger = designSystemStitches.styled(designSystemBaseButton.BaseBut
61
69
  padding: "0 $100",
62
70
  minWidth: "230px",
63
71
  ...designSystemBaseTextField.textFieldStyles.variants.idle,
64
- "& svg": {
65
- color: "$text-neutrals-subtle",
66
- square: "22px"
67
- },
68
72
  _hover: designSystemBaseTextField.textFieldStyles.variants.hovered,
73
+ ...designSystemStyles.focus.css({
74
+ boxShadow: "$focus-keyboard"
75
+ }),
76
+ '&:disabled, &[aria-disabled="true"]': {
77
+ ...designSystemBaseTextField.textFieldStyles.variants.disabled,
78
+ color: "$text-neutrals-disabled"
79
+ },
69
80
  variants: {
70
81
  v1: {
71
82
  true: {
72
- ...designSystemBaseTextField.textFieldStyles.v1.idle,
73
- ...designSystemStyles.focus.css(designSystemBaseTextField.textFieldStyles.v1.focused)
83
+ ...designSystemBaseTextField.textFieldStyles.v1.idle
74
84
  },
75
- false: {
76
- ...designSystemStyles.focus.css(designSystemBaseTextField.textFieldStyles.variants.focused)
77
- }
85
+ false: {}
78
86
  },
79
87
  withClearButton: {
80
88
  true: {
@@ -100,7 +108,10 @@ const StyledClearAction = designSystemStitches.styled(designSystemBaseButton.Bas
100
108
  right: "calc($100 + 1px)",
101
109
  // to compensate border width
102
110
  margin: "auto",
103
- ...designSystemBaseTextField.actionButtonStyles
111
+ ...designSystemBaseTextField.actionButtonStyles,
112
+ '&:disabled, &[aria-disabled="true"]': {
113
+ color: "$icon-neutrals-disabled"
114
+ }
104
115
  });
105
116
 
106
117
  const ClearAction = React__default["default"].forwardRef(({ "aria-label": ariaLabel, label, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsxs(designSystemTooltip.Tooltip, { children: [
@@ -204,7 +215,7 @@ const Trigger = React__default["default"].forwardRef(
204
215
  ...restProps
205
216
  }, forwardRef) => {
206
217
  const [v1] = designSystemExperiments.useNewDesignLanguage();
207
- const { value, setValue } = useCalendarContext();
218
+ const { value, setValue, disabled, ariaDisabled } = useCalendarContext();
208
219
  const { formElementId, ariaDescribedBy: formFieldContextDescribedBy } = designSystemBaseForm.useFormFieldContext();
209
220
  if (asChild) {
210
221
  return /* @__PURE__ */ jsxRuntime.jsx(RadixPopover.Trigger, { ref: forwardRef, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCustomTrigger, { asChild: true, ...restProps, children }) });
@@ -227,47 +238,40 @@ const Trigger = React__default["default"].forwardRef(
227
238
  ),
228
239
  v1,
229
240
  withClearButton: clearButtonVisible,
241
+ disabled,
242
+ "aria-disabled": ariaDisabled,
230
243
  ...restProps,
231
244
  children: [
232
245
  value != null ? /* @__PURE__ */ jsxRuntime.jsx(StyledValue$1, { children }) : /* @__PURE__ */ jsxRuntime.jsx(StyledPlaceholder, { children: placeholder }),
233
- !clearButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCalendarBlank, { weight: "thin" })
246
+ !clearButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(StyledIconContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCalendarBlank, { weight: "thin", size: "small" }) })
234
247
  ]
235
248
  }
236
249
  ) }),
237
- clearButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(ClearAction, { label: clearLabel, onPress: onClearHandler })
250
+ clearButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(
251
+ ClearAction,
252
+ {
253
+ label: clearLabel,
254
+ onPress: onClearHandler,
255
+ disabled: disabled != null ? disabled : designSystemUtils.booleanify(ariaDisabled)
256
+ }
257
+ )
238
258
  ] });
239
259
  }
240
260
  );
241
261
 
242
262
  const StyledContent = designSystemStitches.styled(RadixPopover.Content, {
243
263
  zIndex: "$calendar",
244
- display: "inline-block",
245
- background: "$background-neutrals"
246
- });
247
- const StyledBodyContent = designSystemStitches.styled(designSystemFlex.Flex, {
248
- margin: "0 auto",
249
- boxShadow: "$100",
250
264
  background: "$background-neutrals",
251
- borderRadius: "$100"
252
- });
253
- const StyledGridContent = designSystemStitches.styled(designSystemFlex.Flex, {
254
- paddingBottom: "$200",
255
- "& [data-left-calendar]": {
256
- paddingLeft: "$200",
257
- paddingRight: "$100"
258
- },
259
- "& [data-right-calendar]": {
260
- paddingLeft: "$100",
261
- paddingRight: "$200"
262
- }
265
+ borderRadius: "$100",
266
+ boxShadow: "$100"
263
267
  });
264
- const StyledBodyContentLeft = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
265
- paddingLeft: "$200",
266
- paddingRight: "$100"
268
+ const StyledCalendarBody = designSystemStitches.styled(designSystemFlex.Flex, {
269
+ padding: "$200"
267
270
  });
271
+ const StyledGridContent = designSystemStitches.styled(designSystemFlex.Flex, {});
272
+ const StyledBodyContentLeft = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {});
268
273
  const StyledBodyContentRight = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
269
- paddingLeft: "$100",
270
- paddingRight: "$200"
274
+ paddingLeft: "$200"
271
275
  });
272
276
  const StyledClearContent = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
273
277
  display: "flex",
@@ -276,40 +280,33 @@ const StyledClearContent = designSystemStitches.styled(designSystemPrimitive.Pri
276
280
  borderTop: "1px solid $border-neutrals"
277
281
  });
278
282
 
279
- const StyledHeaderTitle = designSystemStitches.styled(designSystemFlex.Flex, {
280
- justifyContent: "center",
281
- flex: "3",
282
- color: "$text-neutrals"
283
+ const StyledHeaderTitle = designSystemStitches.styled(designSystemTypography.Heading, {
284
+ margin: 0,
285
+ flex: "2",
286
+ textAlign: "center"
283
287
  });
284
- const StyledHeader = designSystemStitches.styled(designSystemFlex.Flex, {
285
- padding: "0 $200",
286
- color: "$text-neutrals"
288
+ const StyledHeaderPlaceholder = designSystemStitches.styled("div", {
289
+ height: "$8",
290
+ // to compensate icon buttons' width and space between 2 calendars
291
+ width: "calc($8 * 2 + $space$200)"
287
292
  });
288
-
289
- const StyledHeaderButton = designSystemStitches.styled(designSystemPrimitive.Primitive.button, {
290
- padding: "0",
291
- backgroundColor: "$transparent",
292
- border: "none",
293
- cursor: "pointer",
293
+ const StyledHeader = designSystemStitches.styled(designSystemFlex.Flex, {
294
294
  color: "$text-neutrals",
295
- "&[disabled]": {
296
- cursor: "not-allowed"
297
- }
295
+ height: "$8",
296
+ alignItems: "center",
297
+ justifyContent: "space-between"
298
298
  });
299
299
 
300
- const HeaderButton = React__default["default"].forwardRef((props, forwardRef) => {
301
- const { buttonProps } = reactAria.useButton(props, forwardRef);
302
- const { focusProps } = reactAria.useFocusRing();
303
- const { children } = props;
304
- return /* @__PURE__ */ jsxRuntime.jsx(
305
- StyledHeaderButton,
306
- {
307
- ...reactAria.mergeProps(buttonProps, focusProps),
308
- ref: forwardRef,
309
- children
310
- }
311
- );
312
- });
300
+ const HeaderButton = React__default["default"].forwardRef(({ isDisabled, children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(
301
+ designSystemIconButton.IconButton,
302
+ {
303
+ ...restProps,
304
+ size: "medium",
305
+ disabled: isDisabled,
306
+ ref: forwardRef,
307
+ children
308
+ }
309
+ ));
313
310
 
314
311
  const Header = ({
315
312
  state,
@@ -324,77 +321,93 @@ const Header = ({
324
321
  });
325
322
  return /* @__PURE__ */ jsxRuntime.jsxs(StyledHeader, { children: [
326
323
  /* @__PURE__ */ jsxRuntime.jsx(HeaderButton, { ...prevButtonProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconChevronLeft, {}) }),
327
- /* @__PURE__ */ jsxRuntime.jsx(StyledHeaderTitle, { children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: monthDateFormatter.format(
324
+ /* @__PURE__ */ jsxRuntime.jsx(StyledHeaderTitle, { level: 2, styledAs: "h3", children: monthDateFormatter.format(
328
325
  state.visibleRange.start.toDate(state.timeZone)
329
- ) }) }),
330
- visibleMonths === 2 && /* @__PURE__ */ jsxRuntime.jsx(StyledHeaderTitle, { children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: monthDateFormatter.format(
331
- state.visibleRange.start.add({ months: 1 }).toDate(state.timeZone)
332
- ) }) }),
326
+ ) }),
327
+ visibleMonths === 2 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
328
+ /* @__PURE__ */ jsxRuntime.jsx(StyledHeaderPlaceholder, {}),
329
+ /* @__PURE__ */ jsxRuntime.jsx(StyledHeaderTitle, { level: 2, styledAs: "h3", children: monthDateFormatter.format(
330
+ state.visibleRange.start.add({ months: 1 }).toDate(state.timeZone)
331
+ ) })
332
+ ] }),
333
333
  /* @__PURE__ */ jsxRuntime.jsx(HeaderButton, { ...nextButtonProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconChevronRight, {}) })
334
334
  ] });
335
335
  };
336
336
 
337
+ const StyledCell = designSystemStitches.styled(designSystemPrimitive.Primitive.td, {
338
+ square: "$10",
339
+ marginTop: "$50",
340
+ position: "relative"
341
+ });
337
342
  const StyledCellContent = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
338
- square: "28px",
343
+ cursor: "pointer",
344
+ square: "$10",
339
345
  display: "flex",
340
346
  alignItems: "center",
341
347
  justifyContent: "center",
342
348
  borderRadius: "$50",
343
349
  color: "$text-neutrals",
344
- "&[data-today]": {
345
- color: "$text-primary"
346
- },
347
- "&[data-weekend]": {
348
- color: "$text-neutrals-subtle"
349
- },
350
- "&[data-selected-middle]": {
351
- color: "$text-neutrals"
352
- },
353
- "&[data-selection]": {
354
- borderRadius: "$50",
355
- background: "$background-primary-prominent-selected",
356
- color: "$text-primary-inverted",
357
- fontWeight: "600"
358
- },
359
- "&[data-disabled]": {
350
+ ...designSystemStyles.focus.css({
351
+ top: "0",
352
+ left: "0",
353
+ position: "absolute",
354
+ zIndex: "1",
355
+ boxShadow: "$focus-keyboard",
356
+ outline: "1px solid transparent"
357
+ }),
358
+ '&[aria-disabled="true"]': {
360
359
  textDecoration: "line-through",
361
- color: "$text-neutrals-disabled"
362
- }
363
- });
364
- const StyledCell = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
365
- square: "36px",
366
- cursor: "pointer",
367
- display: "flex",
368
- alignItems: "center",
369
- justifyContent: "center",
370
- "&:hover": {
371
- background: "$background-primary-subtle-hover",
372
- ["& ".concat(StyledCellContent)]: {
373
- background: "$background-primary-prominent-hover",
374
- color: "$text-primary-inverted"
375
- }
376
- },
377
- "&[data-selected]": {
378
- background: "$background-primary-subtle-hover"
379
- },
380
- "&[data-selection-start]": {
381
- borderBottomLeftRadius: "$lg",
382
- borderTopLeftRadius: "$lg"
360
+ color: "$text-neutrals-disabled",
361
+ cursor: "default"
383
362
  },
384
- "&[data-selection-end]": {
385
- borderBottomRightRadius: "$lg",
386
- borderTopRightRadius: "$lg"
387
- },
388
- "&[data-hidden]": {
389
- display: "none"
363
+ '&:not([aria-disabled="true"])': {
364
+ _hover: {
365
+ backgroundColor: "$background-neutrals-subtle-hover",
366
+ color: "$text-neutrals"
367
+ }
390
368
  },
391
- "&[data-disabled]": {
392
- cursor: "not-allowed",
393
- "&:hover": {
394
- backgroundColor: "$transparent",
395
- ["& ".concat(StyledCellContent)]: {
396
- backgroundColor: "$transparent",
397
- color: "$text-neutrals-disabled"
369
+ variants: {
370
+ today: {
371
+ true: {
372
+ backgroundColor: "$background-neutrals-subtle-hover",
373
+ color: "$text-neutrals"
374
+ }
375
+ },
376
+ selected: {
377
+ true: {
378
+ backgroundColor: "$background-primary-prominent-selected",
379
+ color: "$text-neutrals-inverted",
380
+ '&:not([aria-disabled="true"])': {
381
+ _hover: {
382
+ backgroundColor: "$background-primary-prominent-hover",
383
+ color: "$text-neutrals-inverted"
384
+ }
385
+ }
386
+ }
387
+ },
388
+ range: {
389
+ middle: {
390
+ backgroundColor: "$background-primary-subtle-selected",
391
+ color: "$text-neutrals",
392
+ borderRadius: 0,
393
+ '&:not([aria-disabled="true"])': {
394
+ _hover: {
395
+ backgroundColor: "$background-primary-subtle-hover"
396
+ }
397
+ }
398
+ },
399
+ start: {
400
+ borderTopRightRadius: 0,
401
+ borderBottomRightRadius: 0
402
+ },
403
+ end: {
404
+ borderTopLeftRadius: 0,
405
+ borderBottomLeftRadius: 0
406
+ }
407
+ },
408
+ hidden: {
409
+ true: {
410
+ display: "none"
398
411
  }
399
412
  }
400
413
  }
@@ -403,37 +416,27 @@ const StyledCell = designSystemStitches.styled(designSystemPrimitive.Primitive.d
403
416
  const Cell = (props) => {
404
417
  const { state, date: date$1, currentMonth } = props;
405
418
  const ref = React.useRef(null);
406
- const { cellProps, buttonProps, isSelected, isDisabled, formattedDate } = reactAria.useCalendarCell({ date: date$1 }, state, ref);
419
+ const { cellProps, buttonProps, isSelected, formattedDate } = reactAria.useCalendarCell(
420
+ { date: date$1 },
421
+ state,
422
+ ref
423
+ );
407
424
  const isOutsideMonth = !date.isSameMonth(currentMonth, date$1);
408
425
  const isSelectionStart = state.highlightedRange !== void 0 && state.highlightedRange !== null ? date.isSameDay(date$1, state.highlightedRange.start) : isSelected;
409
426
  const isSelectionEnd = state.highlightedRange !== void 0 && state.highlightedRange !== null ? date.isSameDay(date$1, state.highlightedRange.end) : isSelected;
410
- const { locale } = reactAria.useLocale();
411
- const dayOfWeek = date.getDayOfWeek(date$1, locale);
412
- const isWeekendDay = date.isWeekend(date$1, locale);
413
- const isRoundedLeft = isSelected && (isSelectionStart || dayOfWeek === 0 || date$1.day === 1);
414
- const isRoundedRight = isSelected && (isSelectionEnd || dayOfWeek === 6 || date$1.day === date$1.calendar.getDaysInMonth(date$1));
415
427
  const { focusProps } = reactAria.useFocusRing();
416
- return /* @__PURE__ */ jsxRuntime.jsx("td", { ...cellProps, children: /* @__PURE__ */ jsxRuntime.jsx(
417
- StyledCell,
428
+ const isRange = isSelected && (!isSelectionStart || !isSelectionEnd);
429
+ const rangeVariant = isRange ? isSelectionStart ? "start" : isSelectionEnd ? "end" : "middle" : void 0;
430
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledCell, { ...cellProps, children: /* @__PURE__ */ jsxRuntime.jsx(
431
+ StyledCellContent,
418
432
  {
419
433
  ...reactAria.mergeProps(buttonProps, focusProps),
420
434
  ref,
421
- "data-selected": isSelected ? "" : void 0,
422
- "data-selection-start": isRoundedLeft ? "" : void 0,
423
- "data-selection-end": isRoundedRight ? "" : void 0,
424
- "data-disabled": isDisabled ? "" : void 0,
425
- "data-hidden": isOutsideMonth ? "" : void 0,
426
- children: /* @__PURE__ */ jsxRuntime.jsx(
427
- StyledCellContent,
428
- {
429
- "data-selected-middle": isSelected && !(isSelectionStart || isSelectionEnd) ? "" : void 0,
430
- "data-selection": isSelectionStart || isSelectionEnd ? "" : void 0,
431
- "data-disabled": isDisabled ? "" : void 0,
432
- "data-today": date.isToday(date$1, date.getLocalTimeZone()) ? "" : void 0,
433
- "data-weekend": isWeekendDay ? "" : void 0,
434
- children: formattedDate
435
- }
436
- )
435
+ selected: isSelected && (isSelectionStart || isSelectionEnd),
436
+ today: date.isToday(date$1, date.getLocalTimeZone()),
437
+ range: rangeVariant,
438
+ hidden: isOutsideMonth,
439
+ children: formattedDate
437
440
  }
438
441
  ) });
439
442
  };
@@ -443,8 +446,10 @@ const StyledGrid = designSystemStitches.styled(designSystemPrimitive.Primitive.t
443
446
  borderSpacing: " 0 $50"
444
447
  });
445
448
  const StyledDays = designSystemStitches.styled(designSystemPrimitive.Primitive.th, {
446
- square: "36px",
447
- color: "$text-neutrals"
449
+ height: "$10",
450
+ color: "$text-neutrals-subtle",
451
+ fontWeight: "$regular",
452
+ paddingTop: "$50"
448
453
  });
449
454
 
450
455
  const Grid = React__default["default"].forwardRef(
@@ -476,27 +481,34 @@ const Grid = React__default["default"].forwardRef(
476
481
 
477
482
  const CONTENT_OFFSET = parseInt(designSystemStitches.theme.space[50]);
478
483
  const SharedContent = React__default["default"].forwardRef(
479
- ({ calendarProps, prevButtonProps, nextButtonProps, children, state }, forwardRef) => {
484
+ ({ calendarProps, prevButtonProps, nextButtonProps, state }, forwardRef) => {
480
485
  const { visibleDuration } = useCalendarContext();
481
- return /* @__PURE__ */ jsxRuntime.jsx(StyledBodyContent, { ...calendarProps, ref: forwardRef, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystemFlex.Flex, { direction: "column", children: [
482
- /* @__PURE__ */ jsxRuntime.jsx(
483
- Header,
484
- {
485
- state,
486
- prevButtonProps,
487
- nextButtonProps,
488
- visibleMonths: visibleDuration.months
489
- }
490
- ),
491
- /* @__PURE__ */ jsxRuntime.jsxs(StyledGridContent, { children: [
492
- /* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentLeft, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { state }) }),
493
- visibleDuration.months === 2 && /* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentRight, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { state, offset: { months: 1 } }) })
494
- ] }),
495
- children != null && /* @__PURE__ */ jsxRuntime.jsx(StyledClearContent, { children })
496
- ] }) });
486
+ return /* @__PURE__ */ jsxRuntime.jsxs(
487
+ StyledCalendarBody,
488
+ {
489
+ direction: "column",
490
+ ...calendarProps,
491
+ ref: forwardRef,
492
+ children: [
493
+ /* @__PURE__ */ jsxRuntime.jsx(
494
+ Header,
495
+ {
496
+ state,
497
+ prevButtonProps,
498
+ nextButtonProps,
499
+ visibleMonths: visibleDuration.months
500
+ }
501
+ ),
502
+ /* @__PURE__ */ jsxRuntime.jsxs(StyledGridContent, { children: [
503
+ /* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentLeft, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { state }) }),
504
+ visibleDuration.months === 2 && /* @__PURE__ */ jsxRuntime.jsx(StyledBodyContentRight, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { state, offset: { months: 1 } }) })
505
+ ] })
506
+ ]
507
+ }
508
+ );
497
509
  }
498
510
  );
499
- const DatePickerContent = ({ children }) => {
511
+ const DatePickerContent = () => {
500
512
  const { locale } = reactAria.useLocale();
501
513
  const {
502
514
  calendarValue,
@@ -525,12 +537,11 @@ const DatePickerContent = ({ children }) => {
525
537
  calendarProps,
526
538
  prevButtonProps,
527
539
  nextButtonProps,
528
- state,
529
- children
540
+ state
530
541
  }
531
542
  );
532
543
  };
533
- const RangePickerContent = ({ children }) => {
544
+ const RangePickerContent = () => {
534
545
  const { locale } = reactAria.useLocale();
535
546
  const {
536
547
  calendarValue,
@@ -562,8 +573,7 @@ const RangePickerContent = ({ children }) => {
562
573
  calendarProps,
563
574
  prevButtonProps,
564
575
  nextButtonProps,
565
- state,
566
- children
576
+ state
567
577
  }
568
578
  );
569
579
  };
@@ -597,7 +607,10 @@ const Content = React__default["default"].forwardRef(
597
607
  avoidCollisions,
598
608
  sticky,
599
609
  hideWhenDetached,
600
- children: picker === "single" ? /* @__PURE__ */ jsxRuntime.jsx(DatePickerContent, { children }) : /* @__PURE__ */ jsxRuntime.jsx(RangePickerContent, { children })
610
+ children: /* @__PURE__ */ jsxRuntime.jsxs(designSystemFlex.Flex, { direction: "column", children: [
611
+ picker === "single" ? /* @__PURE__ */ jsxRuntime.jsx(DatePickerContent, {}) : /* @__PURE__ */ jsxRuntime.jsx(RangePickerContent, {}),
612
+ children != null && /* @__PURE__ */ jsxRuntime.jsx(StyledClearContent, { children })
613
+ ] })
601
614
  }
602
615
  );
603
616
  }
@@ -610,11 +623,10 @@ const DEFAULT_FORMAT = {
610
623
  month: "short",
611
624
  year: "numeric"
612
625
  };
613
- const DEFAULT_TIMEZONE = "UTC";
614
- function formatDate(date, formatter) {
615
- return formatter.format(date.toDate(DEFAULT_TIMEZONE));
626
+ function formatDate(date, formatter, timeZone) {
627
+ return formatter.format(date.toDate(timeZone));
616
628
  }
617
- function formatValue(value, formatter) {
629
+ function formatValue(value, formatter, timeZone) {
618
630
  if (value == null) {
619
631
  return void 0;
620
632
  }
@@ -622,21 +634,23 @@ function formatValue(value, formatter) {
622
634
  if (value.start == null || value.end == null) {
623
635
  return void 0;
624
636
  }
625
- return "".concat(formatDate(value.start, formatter), " - ").concat(formatDate(
637
+ return "".concat(formatDate(value.start, formatter, timeZone), " - ").concat(formatDate(
626
638
  value.end,
627
- formatter
639
+ formatter,
640
+ timeZone
628
641
  ));
629
642
  }
630
- return formatDate(value, formatter);
643
+ return formatDate(value, formatter, timeZone);
631
644
  }
632
645
  const Value = React__default["default"].forwardRef(({ format = DEFAULT_FORMAT, ...restProps }, forwardRef) => {
633
646
  const { value } = useCalendarContext();
647
+ const timeZone = React.useMemo(date.getLocalTimeZone, [format]);
634
648
  const formatWithTimeZone = React.useMemo(
635
- () => ({ ...format, DEFAULT_TIMEZONE }),
636
- [format]
649
+ () => ({ ...format, timeZone }),
650
+ [format, timeZone]
637
651
  );
638
652
  const dateFormatter = reactAria.useDateFormatter(formatWithTimeZone);
639
- const valueToDisplay = formatValue(value, dateFormatter);
653
+ const valueToDisplay = formatValue(value, dateFormatter, timeZone);
640
654
  return /* @__PURE__ */ jsxRuntime.jsx(StyledValue, { ref: forwardRef, ...restProps, children: valueToDisplay });
641
655
  });
642
656
 
@@ -713,6 +727,8 @@ const Calendar = React__default["default"].forwardRef(
713
727
  visibleMonths,
714
728
  minDate,
715
729
  maxDate,
730
+ disabled,
731
+ "aria-disabled": ariaDisabled,
716
732
  children,
717
733
  ...props
718
734
  }, forwardRef) => {
@@ -727,7 +743,9 @@ const Calendar = React__default["default"].forwardRef(
727
743
  defaultOpen,
728
744
  open,
729
745
  onClose,
730
- onOpen
746
+ onOpen,
747
+ disabled,
748
+ ariaDisabled
731
749
  };
732
750
  return /* @__PURE__ */ jsxRuntime.jsx(reactAria.I18nProvider, { locale, children: /* @__PURE__ */ jsxRuntime.jsx(CalendarProvider, { ...providerProps, children: /* @__PURE__ */ jsxRuntime.jsx(Root, { ...props, ref: forwardRef, children }) }) });
733
751
  }