@opengovsg/oui 0.0.0-snapshot-20250511111650 → 0.0.0-snapshot-20250619075023

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.
Files changed (47) hide show
  1. package/dist/cjs/button/button.cjs +3 -1
  2. package/dist/cjs/calendar/calendar.cjs +1 -1
  3. package/dist/cjs/date-field/date-field.cjs +81 -0
  4. package/dist/cjs/date-field/index.cjs +9 -0
  5. package/dist/cjs/date-picker/date-picker.cjs +85 -0
  6. package/dist/cjs/date-picker/index.cjs +8 -0
  7. package/dist/cjs/date-range-picker/date-range-picker.cjs +128 -0
  8. package/dist/cjs/date-range-picker/index.cjs +8 -0
  9. package/dist/cjs/index.cjs +33 -26
  10. package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.cjs +24 -0
  11. package/dist/cjs/range-calendar/range-calendar.cjs +2 -2
  12. package/dist/esm/button/button.js +3 -1
  13. package/dist/esm/calendar/calendar.js +2 -2
  14. package/dist/esm/date-field/date-field.js +78 -0
  15. package/dist/esm/date-field/index.js +2 -0
  16. package/dist/esm/date-picker/date-picker.js +83 -0
  17. package/dist/esm/date-picker/index.js +2 -0
  18. package/dist/esm/date-range-picker/date-range-picker.js +126 -0
  19. package/dist/esm/date-range-picker/index.js +2 -0
  20. package/dist/esm/index.js +11 -8
  21. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js +19 -0
  22. package/dist/esm/range-calendar/range-calendar.js +4 -4
  23. package/dist/types/button/button.d.ts.map +1 -1
  24. package/dist/types/calendar/calendar.d.ts +2 -3
  25. package/dist/types/calendar/calendar.d.ts.map +1 -1
  26. package/dist/types/calendar/types.d.ts +2 -13
  27. package/dist/types/calendar/types.d.ts.map +1 -1
  28. package/dist/types/date-field/date-field.d.ts +19 -0
  29. package/dist/types/date-field/date-field.d.ts.map +1 -0
  30. package/dist/types/date-field/index.d.ts +2 -0
  31. package/dist/types/date-field/index.d.ts.map +1 -0
  32. package/dist/types/date-picker/date-picker.d.ts +20 -0
  33. package/dist/types/date-picker/date-picker.d.ts.map +1 -0
  34. package/dist/types/date-picker/index.d.ts +2 -0
  35. package/dist/types/date-picker/index.d.ts.map +1 -0
  36. package/dist/types/date-range-picker/date-range-picker.d.ts +19 -0
  37. package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -0
  38. package/dist/types/date-range-picker/index.d.ts +2 -0
  39. package/dist/types/date-range-picker/index.d.ts.map +1 -0
  40. package/dist/types/index.d.mts +3 -0
  41. package/dist/types/index.d.ts +3 -0
  42. package/dist/types/index.d.ts.map +1 -1
  43. package/dist/types/menu/menu.d.ts +1 -1
  44. package/dist/types/menu/menu.d.ts.map +1 -1
  45. package/dist/types/range-calendar/range-calendar.d.ts +2 -13
  46. package/dist/types/range-calendar/range-calendar.d.ts.map +1 -1
  47. package/package.json +26 -26
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ "use client";
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { useMemo } from 'react';
5
+ import { DatePicker as DatePicker$1, Dialog } from 'react-aria-components';
6
+ import { datePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
7
+ import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
8
+ import { Popover } from '../popover/popover.js';
9
+ import { mapPropsVariants } from '../system/utils.js';
10
+ import { DateInput } from '../date-field/date-field.js';
11
+ import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
12
+ import { Calendar as Calendar$1 } from '../calendar/calendar.js';
13
+ import { Button } from '../button/button.js';
14
+
15
+ function DatePicker(originalProps) {
16
+ const [
17
+ {
18
+ label,
19
+ description,
20
+ errorMessage,
21
+ classNames,
22
+ className,
23
+ calendarProps,
24
+ popoverProps,
25
+ calendarButtonProps,
26
+ ...props
27
+ },
28
+ variantProps
29
+ ] = useMemo(
30
+ () => mapPropsVariants(originalProps, datePickerStyles.variantKeys),
31
+ [originalProps]
32
+ );
33
+ const styles = datePickerStyles(variantProps);
34
+ return /* @__PURE__ */ jsxs(
35
+ DatePicker$1,
36
+ {
37
+ ...props,
38
+ className: composeTailwindRenderProps(
39
+ className ?? classNames?.base,
40
+ styles.base()
41
+ ),
42
+ children: [
43
+ label && /* @__PURE__ */ jsx(Label, { size: variantProps.size, children: label }),
44
+ /* @__PURE__ */ jsxs(FieldGroup, { className: styles.group({ className: classNames?.group }), children: [
45
+ /* @__PURE__ */ jsx(
46
+ DateInput,
47
+ {
48
+ size: variantProps.size,
49
+ className: styles.input({ className: classNames?.input })
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsx(
53
+ Button,
54
+ {
55
+ isIconOnly: true,
56
+ isAttached: true,
57
+ variant: "clear",
58
+ color: "sub",
59
+ size: variantProps.size,
60
+ className: styles.calendarButton({
61
+ className: classNames?.calendarButton
62
+ }),
63
+ ...calendarButtonProps,
64
+ children: /* @__PURE__ */ jsx(Calendar, { "aria-hidden": true })
65
+ }
66
+ )
67
+ ] }),
68
+ /* @__PURE__ */ jsx(Popover, { placement: "bottom end", ...popoverProps, children: /* @__PURE__ */ jsx(Dialog, { className: styles.dialog({ className: classNames?.dialog }), children: /* @__PURE__ */ jsx(
69
+ Calendar$1,
70
+ {
71
+ size: variantProps.size === "xs" ? "sm" : variantProps.size,
72
+ classNames: classNames?.calendar,
73
+ ...calendarProps
74
+ }
75
+ ) }) }),
76
+ description && /* @__PURE__ */ jsx(Description, { size: variantProps.size, children: description }),
77
+ /* @__PURE__ */ jsx(FieldError, { size: variantProps.size, children: errorMessage })
78
+ ]
79
+ }
80
+ );
81
+ }
82
+
83
+ export { DatePicker };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ export { DatePicker } from './date-picker.js';
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ "use client";
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { useMemo } from 'react';
5
+ import { CalendarDate } from '@internationalized/date';
6
+ import { DateRangePicker as DateRangePicker$1, Dialog } from 'react-aria-components';
7
+ import { dateRangePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
8
+ import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
9
+ import { Popover } from '../popover/popover.js';
10
+ import { RangeCalendar } from '../range-calendar/range-calendar.js';
11
+ import { mapPropsVariants } from '../system/utils.js';
12
+ import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
13
+ import { DateInput } from '../date-field/date-field.js';
14
+ import { Button } from '../button/button.js';
15
+
16
+ function DateRangePicker(originalProps) {
17
+ const [
18
+ {
19
+ label,
20
+ description,
21
+ errorMessage,
22
+ classNames,
23
+ className,
24
+ calendarProps,
25
+ popoverProps,
26
+ calendarButtonProps,
27
+ minValue: minValueProp,
28
+ maxValue: maxValueProp,
29
+ ...props
30
+ },
31
+ variantProps
32
+ ] = useMemo(
33
+ () => mapPropsVariants(originalProps, dateRangePickerStyles.variantKeys),
34
+ [originalProps]
35
+ );
36
+ const styles = dateRangePickerStyles(variantProps);
37
+ const { minValue, maxValue } = useMemo(() => {
38
+ return {
39
+ minValue: minValueProp ?? new CalendarDate(1900, 0, 1),
40
+ // Default to 1 Jan 1900
41
+ maxValue: maxValueProp ?? new CalendarDate(2100, 12, 31)
42
+ // Default to 31 Dec 2100
43
+ };
44
+ }, [maxValueProp, minValueProp]);
45
+ return /* @__PURE__ */ jsxs(
46
+ DateRangePicker$1,
47
+ {
48
+ ...props,
49
+ minValue,
50
+ maxValue,
51
+ className: composeTailwindRenderProps(
52
+ className ?? classNames?.base,
53
+ styles.base()
54
+ ),
55
+ children: [
56
+ label && /* @__PURE__ */ jsx(Label, { children: label }),
57
+ /* @__PURE__ */ jsxs(FieldGroup, { className: styles.group({ className: classNames?.group }), children: [
58
+ /* @__PURE__ */ jsxs(
59
+ "div",
60
+ {
61
+ className: styles.dateWrapper({ className: classNames?.dateWrapper }),
62
+ children: [
63
+ /* @__PURE__ */ jsx(
64
+ DateInput,
65
+ {
66
+ slot: "start",
67
+ size: variantProps.size,
68
+ className: styles.startInput({ className: classNames?.startInput })
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx(
72
+ "span",
73
+ {
74
+ "aria-hidden": "true",
75
+ className: styles.connector({
76
+ className: classNames?.connector
77
+ }),
78
+ children: "\u2013"
79
+ }
80
+ ),
81
+ /* @__PURE__ */ jsx(
82
+ DateInput,
83
+ {
84
+ slot: "end",
85
+ size: variantProps.size,
86
+ className: styles.endInput({ className: classNames?.endInput })
87
+ }
88
+ )
89
+ ]
90
+ }
91
+ ),
92
+ /* @__PURE__ */ jsx(
93
+ Button,
94
+ {
95
+ isIconOnly: true,
96
+ isAttached: true,
97
+ variant: "clear",
98
+ color: "sub",
99
+ size: variantProps.size,
100
+ className: styles.calendarButton({
101
+ className: classNames?.calendarButton
102
+ }),
103
+ ...calendarButtonProps,
104
+ children: /* @__PURE__ */ jsx(Calendar, { "aria-hidden": true })
105
+ }
106
+ )
107
+ ] }),
108
+ description && /* @__PURE__ */ jsx(Description, { size: variantProps.size, children: description }),
109
+ /* @__PURE__ */ jsx(FieldError, { size: variantProps.size, children: errorMessage }),
110
+ /* @__PURE__ */ jsx(Popover, { placement: "bottom end", ...popoverProps, children: /* @__PURE__ */ jsx(Dialog, { className: styles.dialog({ className: classNames?.dialog }), children: /* @__PURE__ */ jsx(
111
+ RangeCalendar,
112
+ {
113
+ visibleDuration: { months: 2 },
114
+ size: variantProps.size === "xs" ? "sm" : variantProps.size,
115
+ classNames: classNames?.calendar,
116
+ minValue,
117
+ maxValue,
118
+ ...calendarProps
119
+ }
120
+ ) }) })
121
+ ]
122
+ }
123
+ );
124
+ }
125
+
126
+ export { DateRangePicker };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ export { DateRangePicker } from './date-range-picker.js';
package/dist/esm/index.js CHANGED
@@ -12,23 +12,26 @@ export { TextField } from './text-field/text-field.js';
12
12
  export { Description, FieldError, FieldGroup, Label } from './field/field.js';
13
13
  export { TextArea } from './text-area/text-area.js';
14
14
  export { TextAreaField } from './text-area-field/text-area-field.js';
15
- export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
16
- export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
17
- export { ComboBoxItem } from './combo-box/combo-box-item.js';
18
- export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
19
15
  export { TagField } from './tag-field/tag-field.js';
20
16
  export { TagFieldItem } from './tag-field/tag-field-item.js';
21
17
  export { Select } from './select/select.js';
22
18
  export { SelectItem } from './select/select-item.js';
23
19
  export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
24
- export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
25
- export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
26
- export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
27
- export { CalendarDate } from '@internationalized/date';
28
20
  export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
29
21
  export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
30
22
  export { Popover } from './popover/popover.js';
31
23
  export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
24
+ export { DatePicker } from './date-picker/date-picker.js';
25
+ export { DateRangePicker } from './date-range-picker/date-range-picker.js';
32
26
  export { Button } from './button/button.js';
27
+ export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
28
+ export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
29
+ export { ComboBoxItem } from './combo-box/combo-box-item.js';
30
+ export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
33
31
  export { Banner } from './banner/banner.js';
34
32
  export { Badge } from './badge/badge.js';
33
+ export { CalendarDate } from '@internationalized/date';
34
+ export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
35
+ export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
36
+ export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
37
+ export { DateField, DateInput } from './date-field/date-field.js';
@@ -0,0 +1,19 @@
1
+ import createLucideIcon from '../createLucideIcon.js';
2
+
3
+ /**
4
+ * @license lucide-react v0.475.0 - ISC
5
+ *
6
+ * This source code is licensed under the ISC license.
7
+ * See the LICENSE file in the root directory of this source tree.
8
+ */
9
+
10
+
11
+ const __iconNode = [
12
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
13
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
14
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
15
+ ["path", { d: "M3 10h18", key: "8toen8" }]
16
+ ];
17
+ const Calendar = createLucideIcon("Calendar", __iconNode);
18
+
19
+ export { __iconNode, Calendar as default };
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  "use client";
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
- import { forwardRef, useMemo, useContext } from 'react';
4
+ import { useMemo, useContext } from 'react';
5
5
  import { CalendarDate, today, getLocalTimeZone, getDayOfWeek } from '@internationalized/date';
6
6
  import { RangeCalendar as RangeCalendar$1, Provider, CalendarGrid, CalendarGridBody, Text, RangeCalendarStateContext, useLocale, CalendarCell } from 'react-aria-components';
7
7
  import { useDeepCompareMemo } from 'use-deep-compare';
8
8
  import { calendarStyles, composeRenderProps, cn, dataAttr } from '@opengovsg/oui-theme';
9
- import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
10
9
  import { AgnosticCalendarStateContext } from '../calendar/agnostic-calendar-state-context.js';
11
10
  import { CalendarBottomContent } from '../calendar/calendar-bottom-content.js';
12
11
  import { CalendarGridHeader } from '../calendar/calendar-grid-header.js';
13
12
  import { CalendarHeader } from '../calendar/calendar-header.js';
14
- import { mapPropsVariants } from '../system/utils.js';
13
+ import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
14
+ import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
15
15
 
16
- const RangeCalendar = forwardRef(function RangeCalendar2(originalProps, ref) {
16
+ const RangeCalendar = forwardRefGeneric(function RangeCalendar2(originalProps, ref) {
17
17
  const [props, variantProps] = mapPropsVariants(
18
18
  originalProps,
19
19
  calendarStyles.variantKeys
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAK3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAO9D,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,kBAAkB;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAElC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,2GAwElB,CAAA"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAK3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAO9D,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,kBAAkB;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAElC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,2GA0ElB,CAAA"}
@@ -1,7 +1,6 @@
1
- import type { ReactElement } from "react";
2
- import { CalendarDate } from "@internationalized/date";
1
+ import type { DateValue } from "react-aria-components";
3
2
  import type { CalendarProps } from "./types";
4
- export declare const Calendar: <T extends CalendarDate>(props: CalendarProps<T>) => ReactElement;
3
+ export declare const Calendar: <T extends DateValue>(props: CalendarProps<T> & import("react").RefAttributes<HTMLDivElement>) => React.ReactNode;
5
4
  export declare const CalendarStateWrapper: ({ children, }: {
6
5
  children: React.ReactNode;
7
6
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EAAE,YAAY,EAA2B,MAAM,yBAAyB,CAAA;AAe/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQ5C,eAAO,MAAM,QAAQ,EA8Hf,CAAC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,YAAY,CAAA;AAEvE,eAAO,MAAM,oBAAoB,kBAE9B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAQA,CAAA"}
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAiBtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQ5C,eAAO,MAAM,QAAQ,GACnB,CAAC,SAAS,SAAS,8EAqCJ,MAAO,SAuFtB,CAAA;AAEF,eAAO,MAAM,oBAAoB,kBAE9B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAQA,CAAA"}
@@ -1,8 +1,7 @@
1
- import type { CalendarDate } from "@internationalized/date";
2
1
  import type { ReactNode } from "react";
3
- import type { CalendarProps as AriaCalendarProps, CalendarGridProps } from "react-aria-components";
2
+ import type { CalendarProps as AriaCalendarProps, CalendarGridProps, DateValue } from "react-aria-components";
4
3
  import type { CalendarSlots, CalendarVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
5
- export interface CalendarProps<T extends CalendarDate> extends AriaCalendarProps<T>, CalendarVariantProps, Pick<CalendarGridProps, "weekdayStyle"> {
4
+ export interface CalendarProps<T extends DateValue> extends AriaCalendarProps<T>, CalendarVariantProps, Pick<CalendarGridProps, "weekdayStyle"> {
6
5
  errorMessage?: string;
7
6
  /**
8
7
  * List of classes to change the classNames of the element.
@@ -38,16 +37,6 @@ export interface CalendarProps<T extends CalendarDate> extends AriaCalendarProps
38
37
  * ```
39
38
  */
40
39
  classNames?: SlotsToClasses<CalendarSlots>;
41
- /**
42
- * The minimum allowed date that a user may select.
43
- * @defaultValue `new CalendarDate(1900, 0, 1)`
44
- */
45
- minValue?: T;
46
- /**
47
- * The maximum allowed date that a user may select.
48
- * @defaultValue `new CalendarDate(2100, 12, 31)`
49
- */
50
- maxValue?: T;
51
40
  /**
52
41
  * If provided, there will be a button below the calendar for users to jump to today's date.
53
42
  * @defaultValue `true`
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/calendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,YAAY,CACnD,SAAQ,iBAAiB,CAAC,CAAC,CAAC,EAC1B,oBAAoB,EACpB,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAE1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEZ;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/calendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,EACjB,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,SAAS,CAChD,SAAQ,iBAAiB,CAAC,CAAC,CAAC,EAC1B,oBAAoB,EACpB,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAE1C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B"}
@@ -0,0 +1,19 @@
1
+ import type { DateFieldProps as AriaDateFieldProps, DateInputProps as AriaDateInputProps, DateValue, ValidationResult } from "react-aria-components";
2
+ import type { DateInputSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
3
+ import { dateFieldStyles, dateInputStyles } from "@opengovsg/oui-theme";
4
+ interface DateFieldProps<T extends DateValue> extends AriaDateFieldProps<T>, VariantProps<typeof dateFieldStyles> {
5
+ label?: string;
6
+ description?: string;
7
+ errorMessage?: string | ((validation: ValidationResult) => string);
8
+ classNames?: SlotsToClasses<"base" | "label" | "input" | "description" | "error">;
9
+ }
10
+ export declare function DateField<T extends DateValue>(originalProps: DateFieldProps<T>): import("react/jsx-runtime").JSX.Element;
11
+ interface DateInputProps extends Omit<AriaDateInputProps, "children">, VariantProps<typeof dateInputStyles> {
12
+ label?: string;
13
+ description?: string;
14
+ errorMessage?: string | ((validation: ValidationResult) => string);
15
+ classNames?: SlotsToClasses<DateInputSlots>;
16
+ }
17
+ export declare function DateInput(originalProps: DateInputProps): import("react/jsx-runtime").JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=date-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-field.d.ts","sourceRoot":"","sources":["../../../src/date-field/date-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,cAAc,IAAI,kBAAkB,EACpC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAGL,eAAe,EACf,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAK7B,UAAU,cAAc,CAAC,CAAC,SAAS,SAAS,CAC1C,SAAQ,kBAAkB,CAAC,CAAC,CAAC,EAC3B,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,cAAc,CACzB,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CACrD,CAAA;CACF;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,EAC3C,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,2CA2CjC;AAED,UAAU,cACR,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAC1C,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;CAC5C;AAED,wBAAgB,SAAS,CAAC,aAAa,EAAE,cAAc,2CA8BtD"}
@@ -0,0 +1,2 @@
1
+ export * from "./date-field";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-field/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { DatePickerProps as AriaDatePickerProps, DateValue, ValidationResult } from "react-aria-components";
2
+ import type { CalendarSlots, DatePickerSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
3
+ import { datePickerStyles } from "@opengovsg/oui-theme";
4
+ import type { ButtonProps } from "../button";
5
+ import type { CalendarProps } from "../calendar";
6
+ import type { PopoverProps } from "../popover";
7
+ interface DatePickerProps<T extends DateValue> extends VariantProps<typeof datePickerStyles>, AriaDatePickerProps<T> {
8
+ label?: string;
9
+ description?: string;
10
+ errorMessage?: string | ((validation: ValidationResult) => string);
11
+ calendarProps?: CalendarProps<T>;
12
+ popoverProps?: PopoverProps;
13
+ calendarButtonProps?: ButtonProps;
14
+ classNames?: SlotsToClasses<DatePickerSlots> & {
15
+ calendar?: SlotsToClasses<CalendarSlots>;
16
+ };
17
+ }
18
+ export declare function DatePicker<T extends DateValue>(originalProps: DatePickerProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ export {};
20
+ //# sourceMappingURL=date-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/date-picker/date-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAQ9C,UAAU,eAAe,CAAC,CAAC,SAAS,SAAS,CAC3C,SAAQ,YAAY,CAAC,OAAO,gBAAgB,CAAC,EAC3C,mBAAmB,CAAC,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,mBAAmB,CAAC,EAAE,WAAW,CAAA;IACjC,UAAU,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,GAAG;QAC7C,QAAQ,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;KACzC,CAAA;CACF;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,EAC5C,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,2CAgElC"}
@@ -0,0 +1,2 @@
1
+ export * from "./date-picker";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { DateRangePickerProps as AriaDateRangePickerProps, DateValue, ValidationResult } from "react-aria-components";
2
+ import type { CalendarSlots, DateRangePickerSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
3
+ import { dateRangePickerStyles } from "@opengovsg/oui-theme";
4
+ import type { ButtonProps } from "../button";
5
+ import type { PopoverProps } from "../popover";
6
+ import type { RangeCalendarProps } from "../range-calendar";
7
+ export interface DateRangePickerProps<T extends DateValue> extends AriaDateRangePickerProps<T>, VariantProps<typeof dateRangePickerStyles> {
8
+ label?: string;
9
+ description?: string;
10
+ errorMessage?: string | ((validation: ValidationResult) => string);
11
+ calendarProps?: RangeCalendarProps<T>;
12
+ popoverProps?: PopoverProps;
13
+ calendarButtonProps?: ButtonProps;
14
+ classNames?: SlotsToClasses<DateRangePickerSlots> & {
15
+ calendar?: SlotsToClasses<CalendarSlots>;
16
+ };
17
+ }
18
+ export declare function DateRangePicker<T extends DateValue>(originalProps: DateRangePickerProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ //# sourceMappingURL=date-range-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/date-range-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAS9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAQ3D,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,SAAS,CACvD,SAAQ,wBAAwB,CAAC,CAAC,CAAC,EACjC,YAAY,CAAC,OAAO,qBAAqB,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,aAAa,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAA;IACrC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,mBAAmB,CAAC,EAAE,WAAW,CAAA;IACjC,UAAU,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,GAAG;QAClD,QAAQ,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;KACzC,CAAA;CACF;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EACjD,aAAa,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAgGvC"}
@@ -0,0 +1,2 @@
1
+ export * from "./date-range-picker";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -20,4 +20,7 @@ export * from "./range-calendar";
20
20
  export * from "./menu";
21
21
  export * from "./popover";
22
22
  export * from "./tabs";
23
+ export * from "./date-field";
24
+ export * from "./date-picker";
25
+ export * from "./date-range-picker";
23
26
  //# sourceMappingURL=index.d.ts.map
@@ -20,4 +20,7 @@ export * from "./range-calendar";
20
20
  export * from "./menu";
21
21
  export * from "./popover";
22
22
  export * from "./tabs";
23
+ export * from "./date-field";
24
+ export * from "./date-picker";
25
+ export * from "./date-range-picker";
23
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA"}
@@ -34,5 +34,5 @@ export interface MenuSectionProps<T> extends AriaMenuSectionProps<T>, MenuSectio
34
34
  }
35
35
  export declare const MenuSection: <T extends object>(props: MenuSectionProps<T> & import("react").RefAttributes<HTMLElement>) => React.ReactNode;
36
36
  export declare const MenuTrigger: typeof AriaMenuTrigger;
37
- export declare const SubmenuTrigger: (props: import("react-aria-components").SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
37
+ export declare const SubmenuTrigger: (props: import("react-aria-components").SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => import("react").ReactElement | null;
38
38
  //# sourceMappingURL=menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/menu/menu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,IAAI,aAAa,EAC1B,gBAAgB,IAAI,oBAAoB,EACxC,YAAY,EAEZ,cAAc,EACf,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAIL,WAAW,IAAI,eAAe,EAQ/B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAS7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,eAAO,MAAO,kBAAkB,gEAAE,qBAAqB,2CAMrD,CAAA;AACF,MAAM,WAAW,SAAS,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC,EAAE,gBAAgB;IACtE,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;CAC9C;AA4CD,eAAO,MAAM,IAAI,GA1CE,CAAC,SAAS,MAAM,0EAgBhC,MAAO,SA0BsC,CAAA;AAEhD,MAAM,WAAW,aACf,SAAQ,iBAAiB,EACvB,uBAAuB;IACzB,UAAU,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAA;IACjD,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAC9C,mBAAmB,CA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alendarProps as AriaRangeCalendarProps, CalendarGridProps, DateValue } from "react-aria-components";
2
2
  import { CalendarDate } from "@internationalized/date";
3
3
  import type { CalendarSlots, CalendarVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
4
- interface RangeCalendarProps<T extends CalendarDate> extends CalendarVariantProps, Pick<CalendarGridProps, "weekdayStyle">, AriaRangeCalendarProps<T> {
4
+ export interface RangeCalendarProps<T extends DateValue> extends CalendarVariantProps, Pick<CalendarGridProps, "weekdayStyle">, AriaRangeCalendarProps<T> {
5
5
  /**
6
6
  * List of classes to change the classNames of the element.
7
7
  * if `className` is passed, it will be added to the base slot.
@@ -36,16 +36,6 @@ interface RangeCalendarProps<T extends CalendarDate> extends CalendarVariantProp
36
36
  * ```
37
37
  */
38
38
  classNames?: SlotsToClasses<CalendarSlots>;
39
- /**
40
- * The minimum allowed date that a user may select.
41
- * @defaultValue `new CalendarDate(1900, 0, 1)`
42
- */
43
- minValue?: T;
44
- /**
45
- * The maximum allowed date that a user may select.
46
- * @defaultValue `new CalendarDate(2100, 12, 31)`
47
- */
48
- maxValue?: T;
49
39
  /**
50
40
  * If provided, there will be a button below the calendar for users to jump to today's date.
51
41
  * @defaultValue `true`
@@ -55,7 +45,7 @@ interface RangeCalendarProps<T extends CalendarDate> extends CalendarVariantProp
55
45
  bottomContent?: React.ReactNode;
56
46
  errorMessage?: string;
57
47
  }
58
- export declare const RangeCalendar: import("react").ForwardRefExoticComponent<RangeCalendarProps<CalendarDate> & import("react").RefAttributes<HTMLDivElement>>;
48
+ export declare const RangeCalendar: <T extends DateValue>(props: RangeCalendarProps<T> & import("react").RefAttributes<HTMLDivElement>) => React.ReactNode;
59
49
  export declare const RangeCalendarStateWrapper: ({ children, }: {
60
50
  children: React.ReactNode;
61
51
  }) => import("react/jsx-runtime").JSX.Element;
@@ -65,5 +55,4 @@ export declare const RangeCalendarCell: <T extends CalendarDate>({ date, isMulti
65
55
  dateToHighlight: DateValue | null;
66
56
  firstDayOfWeek?: RangeCalendarProps<T>["firstDayOfWeek"];
67
57
  }) => import("react/jsx-runtime").JSX.Element;
68
- export {};
69
58
  //# sourceMappingURL=range-calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"range-calendar.d.ts","sourceRoot":"","sources":["../../../src/range-calendar/range-calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,iBAAiB,EACjB,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,YAAY,EAIb,MAAM,yBAAyB,CAAA;AAahC,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAe7B,UAAU,kBAAkB,CAAC,CAAC,SAAS,YAAY,CACjD,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC,EACvC,sBAAsB,CAAC,CAAC,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAC1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEZ;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE/B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,aAAa,6HAiHxB,CAAA;AAEF,eAAO,MAAM,yBAAyB,kBAEnC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAQA,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,YAAY,gEAKrD;IACD,IAAI,EAAE,YAAY,CAAA;IAClB,gBAAgB,EAAE,OAAO,CAAA;IACzB,eAAe,EAAE,SAAS,GAAG,IAAI,CAAA;IACjC,cA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