@stenajs-webui/calendar 21.9.0 → 21.10.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.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DateRangeFocusedInput } from "../DateRangeCalendar";
3
2
  export declare const useDateRangeCalendarState: () => {
4
3
  startDate: Date | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DateRangeFocusedInput } from "../../../calendar-types/date-range-calendar/DateRangeCalendar";
3
2
  import { CalendarPanelType } from "../../../../features/calendar-with-month-year-pickers/CalendarPanelType";
4
3
  export type UseInputStatesResult = ReturnType<typeof useInputStates>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DateRangeFocusedInput } from "../../../calendar-types/date-range-calendar/DateRangeCalendar";
3
2
  import { DayData } from "../../../../util/calendar/CalendarDataFactory";
4
3
  import { DateRange } from "../../../../types/DateRange";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DateRangeFocusedInput } from "../../../calendar-types/date-range-calendar/DateRangeCalendar";
3
2
  import { CalendarPanelType } from "../../../../features/calendar-with-month-year-pickers/CalendarPanelType";
4
3
  export type UseInputStatesResult = ReturnType<typeof useInputStates>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { VisiblePanel } from "../types";
3
2
  export declare const useTravelDateInput: (value: string | undefined, onValueChange: ((value: string) => void) | undefined, localeCode: string, initialMonthInFocus: Date | undefined) => {
4
3
  isDateDisabled: (date: Date) => boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TravelDateRangeInputValue, VisiblePanel } from "../types";
3
2
  export declare const useTravelDateRangeInput: (value: TravelDateRangeInputValue | undefined, onValueChange: ((value: TravelDateRangeInputValue) => void) | undefined, localeCode: string, initialMonthInFocus: Date | undefined) => {
4
3
  isDateDisabled: (date: Date) => boolean;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._calendar_1b766_1{--swui-calendar-day-width: 48px;--swui-calendar-day-height: 48px;--swui-calendar-day-border-radius: var(--swui-max-border-radius);--swui-calendar-week-number-bg-color: transparent;--swui-calendar-week-number-text-color: var(--lhds-color-ui-500);--swui-calendar-week-number-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-wrapper-selected-border: var(--modern-red);--swui-calendar-wrapper-selected-background: var(--modern-red);--swui-calendar-wrapper-range-border: var(--lhds-color-red-100);--swui-calendar-wrapper-range-background: var(--lhds-color-red-100);--swui-calendar-wrapper-today-border: var(--lhds-color-ui-200);--swui-calendar-wrapper-today-background: var(--lhds-color-ui-50);--swui-calendar-text-selected-color: #fff;--swui-calendar-text-disabled-color: var(--swui-text-disabled-color);--swui-calendar-text-in-other-month-color: var(--swui-text-disabled-color)}._calendar_1b766_1 table{border-spacing:0 4px}._calendar_1b766_1 tr td:last-child{border-top-right-radius:var(--swui-calendar-day-border-radius);border-bottom-right-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1._weekNumberVisible_1b766_41 tr td:nth-child(2),._calendar_1b766_1:not(._weekNumberVisible_1b766_41) tr td:first-child{border-top-left-radius:var(--swui-calendar-day-border-radius);border-bottom-left-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1 td{padding:0;width:var(--swui-calendar-day-width);height:var(--swui-calendar-day-height)}._timePicker_1w05d_1{overflow:hidden;width:180px}._timePickerColumn_1w05d_6{overflow-y:hidden;flex:1}._timePickerColumn_1w05d_6:hover{overflow-y:scroll}._travelDateCell_h6vcn_1{position:relative}._travelDateCell_h6vcn_1._small_h6vcn_4{width:40px;height:40px}._travelDateCell_h6vcn_1._medium_h6vcn_9{width:48px;height:48px}._travelDateCell_h6vcn_1._large_h6vcn_14{width:56px;height:28px}._travelDateCell_h6vcn_1{border-radius:var(--swui-max-border-radius)}._travelDateCell_h6vcn_1:focus{outline:none}._travelDateCell_h6vcn_1:focus-visible ._outline_h6vcn_26{outline:var(--swui-focus-outline);outline-width:var(--swui-focus-outline-width);background:transparent;position:absolute;border-radius:var(--swui-max-border-radius);top:0;bottom:0;left:0;right:0;z-index:10}._travelDateCell_h6vcn_1:focus-visible ._contentWrapper_h6vcn_39._contentWrapper_h6vcn_39._contentWrapper_h6vcn_39{border-color:transparent}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39{cursor:pointer;border-radius:var(--swui-max-border-radius);border-width:2px;border-style:solid;border-color:transparent;background:transparent;position:absolute;display:flex;align-items:center;justify-content:center;left:0;right:0;top:0;bottom:0}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._disabled_h6vcn_60{cursor:not-allowed}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isToday_h6vcn_63{border-color:var(--lhds-color-ui-400)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionStart_h6vcn_67,._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionEnd_h6vcn_68{border-color:var(--modern-red)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionStart_h6vcn_67{background:var(--modern-red)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionStart_h6vcn_67 span{color:#fff}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionEnd_h6vcn_68:not(._isSelectionStart_h6vcn_67){background:#fff}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._hover_h6vcn_83{border-color:var(--modern-red)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._hover_h6vcn_83._startSelected_h6vcn_86:not(._endSelected_h6vcn_86):not(._isSelectionStart_h6vcn_67){background:#fff}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._hover_h6vcn_83._startSelected_h6vcn_86:not(._endSelected_h6vcn_86):not(._isSelectionStart_h6vcn_67) span{color:var(--swui-text-primary-color)}._travelDateCellBackground_1k07m_1._small_1k07m_2{width:20px;height:40px}._travelDateCellBackground_1k07m_1._medium_1k07m_7{width:24px;height:48px}._travelDateCellBackground_1k07m_1._large_1k07m_12{width:28px;height:56px}._travelCalendar_18pjj_1{border-spacing:0 4px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._travelCalendar_18pjj_1 td{padding:0}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2:not(._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2._calendarVisible_1j7rp_6){opacity:0}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2:not(._travelDateInput_hmfbf_1 ._overlay_hmfbf_2._calendarVisible_hmfbf_6){opacity:0}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._calendar_1b766_1{--swui-calendar-day-width: 48px;--swui-calendar-day-height: 48px;--swui-calendar-day-border-radius: var(--swui-max-border-radius);--swui-calendar-week-number-bg-color: transparent;--swui-calendar-week-number-text-color: var(--lhds-color-ui-500);--swui-calendar-week-number-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-wrapper-selected-border: var(--modern-red);--swui-calendar-wrapper-selected-background: var(--modern-red);--swui-calendar-wrapper-range-border: var(--lhds-color-red-100);--swui-calendar-wrapper-range-background: var(--lhds-color-red-100);--swui-calendar-wrapper-today-border: var(--lhds-color-ui-200);--swui-calendar-wrapper-today-background: var(--lhds-color-ui-50);--swui-calendar-text-selected-color: #fff;--swui-calendar-text-disabled-color: var(--swui-text-disabled-color);--swui-calendar-text-in-other-month-color: var(--swui-text-disabled-color)}._calendar_1b766_1 table{border-spacing:0 4px}._calendar_1b766_1 tr td:last-child{border-top-right-radius:var(--swui-calendar-day-border-radius);border-bottom-right-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1._weekNumberVisible_1b766_41 tr td:nth-child(2),._calendar_1b766_1:not(._weekNumberVisible_1b766_41) tr td:first-child{border-top-left-radius:var(--swui-calendar-day-border-radius);border-bottom-left-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_1 td{padding:0;width:var(--swui-calendar-day-width);height:var(--swui-calendar-day-height)}._timePicker_1w05d_1{overflow:hidden;width:180px}._timePickerColumn_1w05d_6{overflow-y:hidden;flex:1}._timePickerColumn_1w05d_6:hover{overflow-y:scroll}._travelDateCell_h6vcn_1{position:relative}._travelDateCell_h6vcn_1._small_h6vcn_4{width:40px;height:40px}._travelDateCell_h6vcn_1._medium_h6vcn_9{width:48px;height:48px}._travelDateCell_h6vcn_1._large_h6vcn_14{width:56px;height:28px}._travelDateCell_h6vcn_1{border-radius:var(--swui-max-border-radius)}._travelDateCell_h6vcn_1:focus{outline:none}._travelDateCell_h6vcn_1:focus-visible ._outline_h6vcn_26{outline:var(--swui-focus-outline);outline-width:var(--swui-focus-outline-width);background:transparent;position:absolute;border-radius:var(--swui-max-border-radius);top:0;bottom:0;left:0;right:0;z-index:10}._travelDateCell_h6vcn_1:focus-visible ._contentWrapper_h6vcn_39._contentWrapper_h6vcn_39._contentWrapper_h6vcn_39{border-color:transparent}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39{cursor:pointer;border-radius:var(--swui-max-border-radius);border-width:2px;border-style:solid;border-color:transparent;background:transparent;position:absolute;display:flex;align-items:center;justify-content:center;left:0;right:0;top:0;bottom:0}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._disabled_h6vcn_60{cursor:not-allowed}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isToday_h6vcn_63{border-color:var(--lhds-color-ui-400)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionStart_h6vcn_67,._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionEnd_h6vcn_68{border-color:var(--modern-red)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionStart_h6vcn_67{background:var(--modern-red)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionStart_h6vcn_67 span{color:#fff}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._isSelectionEnd_h6vcn_68:not(._isSelectionStart_h6vcn_67){background:#fff}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._hover_h6vcn_83{border-color:var(--modern-red)}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._hover_h6vcn_83._startSelected_h6vcn_86:not(._endSelected_h6vcn_86):not(._isSelectionStart_h6vcn_67){background:#fff}._travelDateCell_h6vcn_1 ._contentWrapper_h6vcn_39._hover_h6vcn_83._startSelected_h6vcn_86:not(._endSelected_h6vcn_86):not(._isSelectionStart_h6vcn_67) span{color:var(--swui-text-primary-color)}._travelDateCellBackground_1k07m_1._small_1k07m_2{width:20px;height:40px}._travelDateCellBackground_1k07m_1._medium_1k07m_7{width:24px;height:48px}._travelDateCellBackground_1k07m_1._large_1k07m_12{width:28px;height:56px}._travelCalendar_18pjj_1{border-spacing:0 4px;width:-moz-fit-content;width:fit-content}._travelCalendar_18pjj_1 td{padding:0}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2:not(._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2._calendarVisible_1j7rp_6){opacity:0}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2:not(._travelDateInput_hmfbf_1 ._overlay_hmfbf_2._calendarVisible_hmfbf_6){opacity:0}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
2
  import { jsx as c, jsxs as _, Fragment as ue } from "react/jsx-runtime";
3
3
  import { Box as Y, Text as yt, Clickable as _e, Row as B, Spacing as nr, Column as Q, Heading as Yt, exhaustSwitchCase as fe, Space as St, Indent as Et, SeparatorLine as sr, parseIntElseUndefined as ke, useBoolean as ie, useDelayedFalse as Se, useOnClickOutside as Ne } from "@stenajs-webui/core";
4
4
  import { FlatButton as tt, stenaAngleDown as he, PrimaryButton as Tt, stenaAngleLeft as ir, stenaAngleRight as or, SecondaryButton as ft, stenaAngleLeftDouble as cr, stenaArrowLeft as Kt, stenaArrowRight as Pt, stenaAngleRightDouble as ar, TextInputButton as lr, stenaCalendar as At, Icon as Le, stenaArrowWideRight as dr, stenaClock as Ye, Label as ur, stenaAngleUp as fr, CardBody as Pe } from "@stenajs-webui/elements";
@@ -1362,13 +1362,14 @@ const $t = "bottom", En = (t, e, r) => {
1362
1362
  i(!1);
1363
1363
  }, [i]), m = w(
1364
1364
  (f) => {
1365
+ var g, p;
1365
1366
  o === "startDate" ? (e == null || e({
1366
1367
  startDate: f.date,
1367
1368
  endDate: t == null ? void 0 : t.endDate
1368
- }), t != null && t.endDate ? setTimeout(u, 150) : (a("endDate"), n.current && n.current.focus())) : o === "endDate" && (e == null || e({
1369
+ }), t != null && t.endDate ? setTimeout(u, 150) : (a("endDate"), (g = n.current) == null || g.focus())) : o === "endDate" && (e == null || e({
1369
1370
  startDate: t == null ? void 0 : t.startDate,
1370
1371
  endDate: f.date
1371
- }), t != null && t.startDate ? setTimeout(u, 150) : (a("startDate"), r.current && r.current.focus()));
1372
+ }), t != null && t.startDate ? setTimeout(u, 150) : (a("startDate"), (p = r.current) == null || p.focus()));
1372
1373
  },
1373
1374
  [o, e, a, u, t]
1374
1375
  ), h = E(
@@ -2673,8 +2674,7 @@ const ae = ({
2673
2674
  return [t];
2674
2675
  }
2675
2676
  }, ts = (t) => {
2676
- if (t.length === 0)
2677
- return [];
2677
+ if (t.length === 0) return [];
2678
2678
  const e = [];
2679
2679
  let r = t[0];
2680
2680
  for (let n = 1; n < t.length; n++)