@autoguru/overdrive 4.49.0 → 4.50.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/components/Calendar/Calendar.css.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.css.js +4 -4
- package/dist/components/Calendar/Calendar.d.ts +3 -10
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +4 -11
- package/dist/components/DatePicker/DatePicker.d.ts +10 -4
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +36 -63
- package/dist/components/DatePicker/hooks/useCalendarPopover.d.ts +38 -0
- package/dist/components/DatePicker/hooks/useCalendarPopover.d.ts.map +1 -0
- package/dist/components/DatePicker/hooks/useCalendarPopover.js +44 -0
- package/dist/components/DateTimeField/DateField/DateField.d.ts +40 -0
- package/dist/components/DateTimeField/DateField/DateField.d.ts.map +1 -0
- package/dist/components/DateTimeField/DateField/DateField.js +110 -0
- package/dist/components/DateTimeField/DateTimeField.css.d.ts +21 -0
- package/dist/components/DateTimeField/DateTimeField.css.d.ts.map +1 -0
- package/dist/components/DateTimeField/DateTimeField.css.js +127 -0
- package/dist/components/DateTimeField/DateTimeField.d.ts +116 -0
- package/dist/components/DateTimeField/DateTimeField.d.ts.map +1 -0
- package/dist/components/DateTimeField/DateTimeField.js +107 -0
- package/dist/components/DateTimeField/TimeField/TimeField.d.ts +26 -0
- package/dist/components/DateTimeField/TimeField/TimeField.d.ts.map +1 -0
- package/dist/components/DateTimeField/TimeField/TimeField.js +99 -0
- package/dist/components/DateTimeField/default.d.ts +2 -0
- package/dist/components/DateTimeField/default.d.ts.map +1 -0
- package/dist/components/DateTimeField/default.js +3 -0
- package/dist/components/DateTimeField/index.d.ts +5 -0
- package/dist/components/DateTimeField/index.d.ts.map +1 -0
- package/dist/components/DateTimeField/index.js +5 -0
- package/dist/components/DateTimeField/types.d.ts +34 -0
- package/dist/components/DateTimeField/types.d.ts.map +1 -0
- package/dist/components/DateTimeField/types.js +3 -0
- package/dist/components/Popover/Popover.d.ts +2 -2
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/Popover/PopoverTrigger.d.ts +9 -6
- package/dist/components/Popover/PopoverTrigger.d.ts.map +1 -1
- package/dist/components/Popover/PopoverTrigger.js +6 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/styles/selectors.d.ts +1 -0
- package/dist/styles/selectors.d.ts.map +1 -1
- package/dist/styles/selectors.js +1 -0
- package/dist/utils/dateFormat.d.ts +5 -4
- package/dist/utils/dateFormat.d.ts.map +1 -1
- package/dist/utils/dateFormat.js +9 -9
- package/package.json +10 -10
- package/dist/components/DateTimePicker/DateTimePicker.css.d.ts +0 -4
- package/dist/components/DateTimePicker/DateTimePicker.css.d.ts.map +0 -1
- package/dist/components/DateTimePicker/DateTimePicker.css.js +0 -30
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +0 -68
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +0 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +0 -130
- package/dist/components/DateTimePicker/default.d.ts +0 -2
- package/dist/components/DateTimePicker/default.d.ts.map +0 -1
- package/dist/components/DateTimePicker/default.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Calendar/Calendar.css.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB,QAM5B,CAAC;AAEH,eAAO,MAAM,aAAa,QAQxB,CAAC;AAIH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"Calendar.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Calendar/Calendar.css.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB,QAM5B,CAAC;AAEH,eAAO,MAAM,aAAa,QAQxB,CAAC;AAIH,eAAO,MAAM,SAAS,QAoCpB,CAAC;AAIH,eAAO,MAAM,WAAW,QAoCtB,CAAC;AAEH,eAAO,MAAM,OAAO,QAMlB,CAAC;AAEH,eAAO,MAAM,OAAO,QAElB,CAAC;AAGH,eAAO,MAAM,UAAU,QAGrB,CAAC"}
|
|
@@ -27,10 +27,11 @@ export const calendarStyle = style([sprinkles({
|
|
|
27
27
|
|
|
28
28
|
export const cellStyle = style([sprinkles({
|
|
29
29
|
alignItems: 'center',
|
|
30
|
+
borderRadius: 'md',
|
|
30
31
|
display: 'flex',
|
|
32
|
+
mx: 'auto',
|
|
31
33
|
justifyContent: 'center',
|
|
32
|
-
size: '7'
|
|
33
|
-
borderRadius: 'md'
|
|
34
|
+
size: '7'
|
|
34
35
|
}), {
|
|
35
36
|
'@layer': {
|
|
36
37
|
[cssLayerComponent]: {
|
|
@@ -101,8 +102,7 @@ export const thStyle = style({
|
|
|
101
102
|
}
|
|
102
103
|
}, "thStyle");
|
|
103
104
|
export const tdStyle = sprinkles({
|
|
104
|
-
padding: '1'
|
|
105
|
-
textAlign: 'center'
|
|
105
|
+
padding: '1'
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
// === Heading styles
|
|
@@ -5,7 +5,7 @@ declare const defaultEnglish: {
|
|
|
5
5
|
readonly nextLabel: "Next month";
|
|
6
6
|
readonly prevLabel: "Previous month";
|
|
7
7
|
};
|
|
8
|
-
type
|
|
8
|
+
export type CalendarTextContent = Record<keyof typeof defaultEnglish, string>;
|
|
9
9
|
export interface CalendarProps extends TestIdProp {
|
|
10
10
|
/**
|
|
11
11
|
* Calendar props passed through to the react-aria hook
|
|
@@ -27,7 +27,7 @@ export interface CalendarProps extends TestIdProp {
|
|
|
27
27
|
/**
|
|
28
28
|
* Language content override
|
|
29
29
|
*/
|
|
30
|
-
lang?:
|
|
30
|
+
lang?: Partial<CalendarTextContent>;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Calendar component for selecting a date using react-aria. Supports full localization and accessibility.
|
|
@@ -36,13 +36,6 @@ export interface CalendarProps extends TestIdProp {
|
|
|
36
36
|
* This component implements the react-aria `useCalendar` hook and supports controlled state
|
|
37
37
|
* ([docs](https://react-spectrum.adobe.com/react-aria/useCalendar.html))
|
|
38
38
|
*
|
|
39
|
-
* ## Features
|
|
40
|
-
* - Full keyboard navigation and screen reader support
|
|
41
|
-
* - Localization and internationalization
|
|
42
|
-
* - Configurable date restrictions (past dates, specific dates, date ranges)
|
|
43
|
-
* - Custom default values and date ranges
|
|
44
|
-
* - Flexible styling and theming
|
|
45
|
-
*
|
|
46
39
|
* ## Working with dates
|
|
47
40
|
* - Use `parseDate('YYYY-MM-DD')` from `@internationalized/date` to create
|
|
48
41
|
* DateValue objects.
|
|
@@ -50,7 +43,7 @@ export interface CalendarProps extends TestIdProp {
|
|
|
50
43
|
* date, and `date.add({ days: 7, months: 1 })` for date arithmetic.
|
|
51
44
|
*
|
|
52
45
|
* ## Date Restrictions
|
|
53
|
-
* You can restrict date selection using the `
|
|
46
|
+
* You can restrict date selection using the `calendarOptions` prop with react-aria calendar properties:
|
|
54
47
|
* - `minValue` / `maxValue`: Define selectable date range
|
|
55
48
|
* - `isDateUnavailable`: Function to disable specific dates
|
|
56
49
|
* - `allowPastDate` prop: Convenient way to allow/disallow past dates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../lib/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAS9C,QAAA,MAAM,cAAc;;;CAGV,CAAC;AAEX,
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../lib/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAS9C,QAAA,MAAM,cAAc;;;CAGV,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,OAAO,cAAc,EAAE,MAAM,CAAC,CAAC;AAE9E,MAAM,WAAW,aAAc,SAAQ,UAAU;IAChD;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACpE;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACpC;AAUD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ;kEAMlB,aAAa;;CAgEf,CAAC"}
|
|
@@ -35,13 +35,6 @@ function createCalendar(identifier) {
|
|
|
35
35
|
* This component implements the react-aria `useCalendar` hook and supports controlled state
|
|
36
36
|
* ([docs](https://react-spectrum.adobe.com/react-aria/useCalendar.html))
|
|
37
37
|
*
|
|
38
|
-
* ## Features
|
|
39
|
-
* - Full keyboard navigation and screen reader support
|
|
40
|
-
* - Localization and internationalization
|
|
41
|
-
* - Configurable date restrictions (past dates, specific dates, date ranges)
|
|
42
|
-
* - Custom default values and date ranges
|
|
43
|
-
* - Flexible styling and theming
|
|
44
|
-
*
|
|
45
38
|
* ## Working with dates
|
|
46
39
|
* - Use `parseDate('YYYY-MM-DD')` from `@internationalized/date` to create
|
|
47
40
|
* DateValue objects.
|
|
@@ -49,7 +42,7 @@ function createCalendar(identifier) {
|
|
|
49
42
|
* date, and `date.add({ days: 7, months: 1 })` for date arithmetic.
|
|
50
43
|
*
|
|
51
44
|
* ## Date Restrictions
|
|
52
|
-
* You can restrict date selection using the `
|
|
45
|
+
* You can restrict date selection using the `calendarOptions` prop with react-aria calendar properties:
|
|
53
46
|
* - `minValue` / `maxValue`: Define selectable date range
|
|
54
47
|
* - `isDateUnavailable`: Function to disable specific dates
|
|
55
48
|
* - `allowPastDate` prop: Convenient way to allow/disallow past dates
|
|
@@ -67,12 +60,12 @@ export const Calendar = ({
|
|
|
67
60
|
onChange,
|
|
68
61
|
testId
|
|
69
62
|
}) => {
|
|
70
|
-
var _lang$prevLabel, _lang$nextLabel;
|
|
71
63
|
const selectedDate = useRef(null);
|
|
72
64
|
const hasValue = !!(calendarOptions !== null && calendarOptions !== void 0 && calendarOptions.value) || !!(calendarOptions !== null && calendarOptions !== void 0 && calendarOptions.defaultValue);
|
|
73
65
|
const fallbackDefaultValue = hasValue ? {} : {
|
|
74
66
|
defaultValue: today(getLocalTimeZone())
|
|
75
67
|
};
|
|
68
|
+
const textValues = _objectSpread(_objectSpread({}, defaultEnglish), lang);
|
|
76
69
|
const calendarComponentProps = _objectSpread(_objectSpread({
|
|
77
70
|
firstDayOfWeek: FIRST_DAY_OF_WEEK,
|
|
78
71
|
minValue: allowPastDate ? undefined : today(getLocalTimeZone()),
|
|
@@ -105,7 +98,7 @@ export const Calendar = ({
|
|
|
105
98
|
children: [/*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, calendarProps), {}, {
|
|
106
99
|
className: calendarStyle,
|
|
107
100
|
children: [/*#__PURE__*/_jsx(CalendarButton, _objectSpread(_objectSpread({}, prevButtonProps), {}, {
|
|
108
|
-
"aria-label":
|
|
101
|
+
"aria-label": textValues.prevLabel,
|
|
109
102
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
110
103
|
icon: ChevronLeftIcon,
|
|
111
104
|
size: "medium"
|
|
@@ -114,7 +107,7 @@ export const Calendar = ({
|
|
|
114
107
|
className: titleStyle,
|
|
115
108
|
children: calendarTitle
|
|
116
109
|
}), /*#__PURE__*/_jsx(CalendarButton, _objectSpread(_objectSpread({}, nextButtonProps), {}, {
|
|
117
|
-
"aria-label":
|
|
110
|
+
"aria-label": textValues.nextLabel,
|
|
118
111
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
119
112
|
icon: ChevronRightIcon,
|
|
120
113
|
size: "medium"
|
|
@@ -98,7 +98,7 @@ export interface DatePickerProps extends TestIdProp {
|
|
|
98
98
|
* // Uncontrolled component with default value
|
|
99
99
|
* <DatePicker
|
|
100
100
|
* name="eventDate"
|
|
101
|
-
* defaultValue=
|
|
101
|
+
* defaultValue={today(getLocalTimeZone()} // or an ISO date string YYYY-MM-DD
|
|
102
102
|
* onChange={(isoDate) => console.log('Selected date:', isoDate)}
|
|
103
103
|
* />
|
|
104
104
|
*
|
|
@@ -108,10 +108,16 @@ export interface DatePickerProps extends TestIdProp {
|
|
|
108
108
|
* name="bookingDate"
|
|
109
109
|
* value={selectedDate}
|
|
110
110
|
* valueLabel="Select a date"
|
|
111
|
-
* onChange={(isoDate) =>
|
|
111
|
+
* onChange={(isoDate) => {
|
|
112
|
+
* setSelectedDate(isoDate);
|
|
113
|
+
* if (isToday(isoDate)) {
|
|
114
|
+
* setValueLabel('Today');
|
|
115
|
+
* } else {
|
|
116
|
+
* setValueLabel(displayFormattedDate(iseDate));
|
|
117
|
+
* }
|
|
118
|
+
* }}
|
|
112
119
|
* calendarOptions={{
|
|
113
120
|
* allowPastDate: false,
|
|
114
|
-
* weekdayFormat: 'short',
|
|
115
121
|
* }}
|
|
116
122
|
* />
|
|
117
123
|
*
|
|
@@ -121,7 +127,7 @@ export interface DatePickerProps extends TestIdProp {
|
|
|
121
127
|
* name="startDate"
|
|
122
128
|
* useNativePicker
|
|
123
129
|
* defaultValue="2025-03-12"
|
|
124
|
-
* onChange={(isoDate) => console.log('
|
|
130
|
+
* onChange={(isoDate) => console.log('Date input:', isoDate)}
|
|
125
131
|
* />
|
|
126
132
|
*/
|
|
127
133
|
export declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,KAAgD,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAU3D,KAAK,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9C,QAAA,MAAM,cAAc;;CAEV,CAAC;AAEX,KAAK,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5E,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAClD;;OAEG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC1C;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;CACvB;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,eAAO,MAAM,UAAU,0FA6ItB,CAAC"}
|
|
@@ -6,11 +6,11 @@ const _excluded = ["calendarOptions", "className", "defaultValue", "disabled", "
|
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import { CalendarIcon } from '@autoguru/icons';
|
|
9
|
-
import { getLocalTimeZone, parseDate, today } from '@internationalized/date';
|
|
10
9
|
import clsx from 'clsx';
|
|
11
|
-
import React, {
|
|
10
|
+
import React, { useMemo, forwardRef } from 'react';
|
|
12
11
|
import { elementStyles } from "../../styles/elementStyles.js";
|
|
13
12
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
13
|
+
import { formatDateValue, safeParseDateString } from "../../utils/dateFormat.js";
|
|
14
14
|
import { Calendar } from "../Calendar/index.js";
|
|
15
15
|
import { Icon } from "../Icon/Icon.js";
|
|
16
16
|
import { PopoverTrigger } from "../Popover/index.js";
|
|
@@ -18,6 +18,7 @@ import { ProgressSpinner } from "../ProgressSpinner/ProgressSpinner.js";
|
|
|
18
18
|
import { Text } from "../Text/Text.js";
|
|
19
19
|
import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
|
|
20
20
|
import * as styles from "./DatePicker.css.js";
|
|
21
|
+
import { useCalendarPopover } from "./hooks/useCalendarPopover.js";
|
|
21
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
23
|
const defaultEnglish = {
|
|
23
24
|
openCalendar: 'open calendar'
|
|
@@ -27,17 +28,6 @@ const textSizeMap = {
|
|
|
27
28
|
medium: '3',
|
|
28
29
|
large: '5'
|
|
29
30
|
};
|
|
30
|
-
const formatDateToString = date => {
|
|
31
|
-
if (!date) return '';
|
|
32
|
-
return date.toString(); // ISO format: YYYY-MM-DD to match native input
|
|
33
|
-
};
|
|
34
|
-
const parseDateString = dateString => {
|
|
35
|
-
try {
|
|
36
|
-
return parseDate(dateString);
|
|
37
|
-
} catch {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
31
|
|
|
42
32
|
/**
|
|
43
33
|
* The DatePicker has been updated to render the Calendar component with a Popover while
|
|
@@ -64,7 +54,7 @@ const parseDateString = dateString => {
|
|
|
64
54
|
* // Uncontrolled component with default value
|
|
65
55
|
* <DatePicker
|
|
66
56
|
* name="eventDate"
|
|
67
|
-
* defaultValue=
|
|
57
|
+
* defaultValue={today(getLocalTimeZone()} // or an ISO date string YYYY-MM-DD
|
|
68
58
|
* onChange={(isoDate) => console.log('Selected date:', isoDate)}
|
|
69
59
|
* />
|
|
70
60
|
*
|
|
@@ -74,10 +64,16 @@ const parseDateString = dateString => {
|
|
|
74
64
|
* name="bookingDate"
|
|
75
65
|
* value={selectedDate}
|
|
76
66
|
* valueLabel="Select a date"
|
|
77
|
-
* onChange={(isoDate) =>
|
|
67
|
+
* onChange={(isoDate) => {
|
|
68
|
+
* setSelectedDate(isoDate);
|
|
69
|
+
* if (isToday(isoDate)) {
|
|
70
|
+
* setValueLabel('Today');
|
|
71
|
+
* } else {
|
|
72
|
+
* setValueLabel(displayFormattedDate(iseDate));
|
|
73
|
+
* }
|
|
74
|
+
* }}
|
|
78
75
|
* calendarOptions={{
|
|
79
76
|
* allowPastDate: false,
|
|
80
|
-
* weekdayFormat: 'short',
|
|
81
77
|
* }}
|
|
82
78
|
* />
|
|
83
79
|
*
|
|
@@ -87,7 +83,7 @@ const parseDateString = dateString => {
|
|
|
87
83
|
* name="startDate"
|
|
88
84
|
* useNativePicker
|
|
89
85
|
* defaultValue="2025-03-12"
|
|
90
|
-
* onChange={(isoDate) => console.log('
|
|
86
|
+
* onChange={(isoDate) => console.log('Date input:', isoDate)}
|
|
91
87
|
* />
|
|
92
88
|
*/
|
|
93
89
|
export const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
@@ -111,31 +107,22 @@ export const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
111
107
|
valueLabel
|
|
112
108
|
} = _ref,
|
|
113
109
|
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
setSelectedDate(parsedDate);
|
|
110
|
+
const dateValue = value ? safeParseDateString(value) : undefined;
|
|
111
|
+
const dateDefaultValue = defaultValue ? safeParseDateString(defaultValue) : undefined;
|
|
112
|
+
const {
|
|
113
|
+
selectedDate,
|
|
114
|
+
handleCalendarChange,
|
|
115
|
+
setPopoverState
|
|
116
|
+
} = useCalendarPopover({
|
|
117
|
+
value: dateValue,
|
|
118
|
+
defaultValue: dateDefaultValue,
|
|
119
|
+
onChange: dateVal => {
|
|
120
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(formatDateValue(dateVal));
|
|
126
121
|
}
|
|
127
|
-
}
|
|
128
|
-
const
|
|
122
|
+
});
|
|
123
|
+
const handleNativeChange = event => {
|
|
129
124
|
const dateString = event.currentTarget.value;
|
|
130
|
-
|
|
131
|
-
const parsedDate = parseDateString(dateString);
|
|
132
|
-
setSelectedDate(parsedDate);
|
|
133
|
-
} else {
|
|
134
|
-
setSelectedDate(null);
|
|
135
|
-
}
|
|
136
|
-
if (typeof onChange === 'function') {
|
|
137
|
-
onChange(dateString);
|
|
138
|
-
}
|
|
125
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(dateString);
|
|
139
126
|
};
|
|
140
127
|
const indicator = isLoading ? /*#__PURE__*/_jsx(ProgressSpinner, {
|
|
141
128
|
size: size
|
|
@@ -147,30 +134,15 @@ export const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
147
134
|
size: textSizeMap[size],
|
|
148
135
|
children: valueLabel
|
|
149
136
|
}) : null;
|
|
150
|
-
const handleCalendarChange = useCallback(date => {
|
|
151
|
-
setSelectedDate(date);
|
|
152
|
-
if (typeof onChange === 'function') {
|
|
153
|
-
onChange(formatDateToString(date));
|
|
154
|
-
}
|
|
155
|
-
// Close the popover after date selection
|
|
156
|
-
if (popoverState) {
|
|
157
|
-
popoverState.close();
|
|
158
|
-
}
|
|
159
|
-
}, [onChange, popoverState]);
|
|
160
137
|
const calendarProps = useMemo(() => _objectSpread(_objectSpread({
|
|
161
|
-
calendarOptions: _objectSpread(_objectSpread(_objectSpread({},
|
|
162
|
-
|
|
163
|
-
} : {
|
|
164
|
-
defaultValue: selectedDate || today(getLocalTimeZone())
|
|
165
|
-
}), min && {
|
|
166
|
-
minValue: parseDateString(min)
|
|
138
|
+
calendarOptions: _objectSpread(_objectSpread(_objectSpread({}, min && {
|
|
139
|
+
minValue: safeParseDateString(min)
|
|
167
140
|
}), max && {
|
|
168
|
-
maxValue:
|
|
169
|
-
})
|
|
141
|
+
maxValue: safeParseDateString(max)
|
|
142
|
+
}), calendarOptions === null || calendarOptions === void 0 ? void 0 : calendarOptions.calendarOptions)
|
|
170
143
|
}, calendarOptions), {}, {
|
|
171
144
|
onChange: handleCalendarChange
|
|
172
|
-
}), [
|
|
173
|
-
const contentCalendar = useMemo(() => /*#__PURE__*/_jsx(Calendar, _objectSpread({}, calendarProps)), [calendarProps]);
|
|
145
|
+
}), [calendarOptions, handleCalendarChange, min, max]);
|
|
174
146
|
|
|
175
147
|
// Use native picker only if explicitly requested
|
|
176
148
|
if (useNativePicker) {
|
|
@@ -187,7 +159,8 @@ export const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
187
159
|
disabled: disabled,
|
|
188
160
|
min: min,
|
|
189
161
|
max: max,
|
|
190
|
-
|
|
162
|
+
value: formatDateValue(selectedDate),
|
|
163
|
+
onChange: handleNativeChange
|
|
191
164
|
})), /*#__PURE__*/_jsx("div", {
|
|
192
165
|
className: styles.inputOverlay,
|
|
193
166
|
children: /*#__PURE__*/_jsxs("div", {
|
|
@@ -202,7 +175,7 @@ export const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
202
175
|
return /*#__PURE__*/_jsxs("div", {
|
|
203
176
|
className: className,
|
|
204
177
|
children: [/*#__PURE__*/_jsxs(PopoverTrigger, {
|
|
205
|
-
content:
|
|
178
|
+
content: /*#__PURE__*/_jsx(Calendar, _objectSpread({}, calendarProps)),
|
|
206
179
|
placement: placement,
|
|
207
180
|
testId: testId,
|
|
208
181
|
isDisabled: disabled,
|
|
@@ -219,7 +192,7 @@ export const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
219
192
|
})]
|
|
220
193
|
}), /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({}, inputProps), {}, {
|
|
221
194
|
ref: ref,
|
|
222
|
-
value:
|
|
195
|
+
value: formatDateValue(selectedDate),
|
|
223
196
|
type: "hidden"
|
|
224
197
|
}))]
|
|
225
198
|
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type DateValue } from '@internationalized/date';
|
|
2
|
+
export interface UseCalendarPopoverProps {
|
|
3
|
+
/**
|
|
4
|
+
* Current value for controlled components
|
|
5
|
+
*/
|
|
6
|
+
value?: DateValue | null;
|
|
7
|
+
/**
|
|
8
|
+
* Default value for uncontrolled components
|
|
9
|
+
*/
|
|
10
|
+
defaultValue?: DateValue | null;
|
|
11
|
+
/**
|
|
12
|
+
* Change handler called when a date is selected
|
|
13
|
+
*/
|
|
14
|
+
onChange?: (date: DateValue) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface UseCalendarPopoverReturn {
|
|
17
|
+
/**
|
|
18
|
+
* Current selected date value
|
|
19
|
+
*/
|
|
20
|
+
selectedDate: DateValue | null;
|
|
21
|
+
/**
|
|
22
|
+
* Handler for calendar date selection
|
|
23
|
+
*/
|
|
24
|
+
handleCalendarChange: (date: DateValue) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Handler for setting popover state
|
|
27
|
+
*/
|
|
28
|
+
setPopoverState: (state: {
|
|
29
|
+
close: () => void;
|
|
30
|
+
} | null) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Custom hook for managing calendar popover state and date value logic.
|
|
34
|
+
* Handles both controlled and uncontrolled patterns, and manages popover closing
|
|
35
|
+
* after date selection.
|
|
36
|
+
*/
|
|
37
|
+
export declare const useCalendarPopover: ({ value, defaultValue, onChange, }: UseCalendarPopoverProps) => UseCalendarPopoverReturn;
|
|
38
|
+
//# sourceMappingURL=useCalendarPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCalendarPopover.d.ts","sourceRoot":"","sources":["../../../../lib/components/DatePicker/hooks/useCalendarPopover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B;;OAEG;IACH,oBAAoB,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/D;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,oCAIhC,uBAAuB,KAAG,wBAwC5B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook for managing calendar popover state and date value logic.
|
|
6
|
+
* Handles both controlled and uncontrolled patterns, and manages popover closing
|
|
7
|
+
* after date selection.
|
|
8
|
+
*/
|
|
9
|
+
export const useCalendarPopover = ({
|
|
10
|
+
value,
|
|
11
|
+
defaultValue,
|
|
12
|
+
onChange
|
|
13
|
+
}) => {
|
|
14
|
+
const isControlled = value !== undefined;
|
|
15
|
+
const [selectedDate, setSelectedDate] = useState(() => {
|
|
16
|
+
const initialValue = isControlled ? value : defaultValue;
|
|
17
|
+
return initialValue !== null && initialValue !== void 0 ? initialValue : null;
|
|
18
|
+
});
|
|
19
|
+
const [popoverState, setPopoverState] = useState(null);
|
|
20
|
+
const handleCalendarChange = useCallback(dateValue => {
|
|
21
|
+
// Update internal state for uncontrolled components
|
|
22
|
+
if (!isControlled) {
|
|
23
|
+
setSelectedDate(dateValue);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Call external change handler
|
|
27
|
+
if (typeof onChange === 'function') {
|
|
28
|
+
onChange(dateValue);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Close the popover after date selection
|
|
32
|
+
if (popoverState) {
|
|
33
|
+
popoverState.close();
|
|
34
|
+
}
|
|
35
|
+
}, [isControlled, onChange, popoverState]);
|
|
36
|
+
|
|
37
|
+
// For controlled components, sync with external value changes
|
|
38
|
+
const currentValue = isControlled ? value : selectedDate;
|
|
39
|
+
return {
|
|
40
|
+
selectedDate: currentValue,
|
|
41
|
+
handleCalendarChange,
|
|
42
|
+
setPopoverState
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type DateValue } from '@internationalized/date';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { TestIdProp } from '../../../types';
|
|
4
|
+
import { type CalendarProps, type CalendarTextContent } from '../../Calendar/Calendar';
|
|
5
|
+
import type { PopoverTextContent } from '../../Popover/Popover';
|
|
6
|
+
import type { CommonSelectorProps } from '../types';
|
|
7
|
+
export type DateFieldTextContent = Record<keyof typeof defaultEnglish, string> & CalendarTextContent & PopoverTextContent;
|
|
8
|
+
export interface DateFieldProps extends CommonSelectorProps<DateValue | null>, TestIdProp {
|
|
9
|
+
/**
|
|
10
|
+
* Calendar props passed through to the react-aria hook
|
|
11
|
+
*/
|
|
12
|
+
calendarOptions?: CalendarProps['calendarOptions'];
|
|
13
|
+
/**
|
|
14
|
+
* Allow date in the past
|
|
15
|
+
*/
|
|
16
|
+
allowPastDate?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Minimum selectable date (ISO YYYY-MM-DD)
|
|
19
|
+
*/
|
|
20
|
+
min?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Maximum selectable date (ISO YYYY-MM-DD)
|
|
23
|
+
*/
|
|
24
|
+
max?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Text values for localization
|
|
27
|
+
*/
|
|
28
|
+
lang?: Partial<DateFieldTextContent>;
|
|
29
|
+
}
|
|
30
|
+
declare const defaultEnglish: {
|
|
31
|
+
readonly dateLabel: "date";
|
|
32
|
+
readonly select: "select";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* DateField is a sub-component for selecting a date with a Calendar popup.
|
|
36
|
+
* Presently, this component is primarily used within the DateTimeInput.
|
|
37
|
+
*/
|
|
38
|
+
export declare const DateField: React.ForwardRefExoticComponent<DateFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=DateField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../../../lib/components/DateTimeField/DateField/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAOhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,OAAO,cAAc,EAAE,MAAM,CAAC,GAC7E,mBAAmB,GACnB,kBAAkB,CAAC;AAEpB,MAAM,WAAW,cAChB,SAAQ,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,EAC5C,UAAU;IACX;;OAEG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACnD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACrC;AAED,QAAA,MAAM,cAAc;;;CAGV,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,SAAS,yFAsGrB,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React, { forwardRef } from 'react';
|
|
7
|
+
import { dataAttrs } from "../../../utils/dataAttrs.js";
|
|
8
|
+
import { displayFormattedDate, formatDateValue, safeParseDateString } from "../../../utils/dateFormat.js";
|
|
9
|
+
import { Calendar } from "../../Calendar/Calendar.js";
|
|
10
|
+
import { useCalendarPopover } from "../../DatePicker/hooks/useCalendarPopover.js";
|
|
11
|
+
import { LoadingBox } from "../../LoadingBox/LoadingBox.js";
|
|
12
|
+
import { PopoverTrigger } from "../../Popover/PopoverTrigger.js";
|
|
13
|
+
import { dateFieldStyle, inputStyle, labelVariants } from "../DateTimeField.css.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const defaultEnglish = {
|
|
16
|
+
dateLabel: 'date',
|
|
17
|
+
select: 'select'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* DateField is a sub-component for selecting a date with a Calendar popup.
|
|
22
|
+
* Presently, this component is primarily used within the DateTimeInput.
|
|
23
|
+
*/
|
|
24
|
+
export const DateField = /*#__PURE__*/forwardRef(({
|
|
25
|
+
allowPastDate = false,
|
|
26
|
+
calendarOptions,
|
|
27
|
+
defaultValue,
|
|
28
|
+
disabled = false,
|
|
29
|
+
invalid = false,
|
|
30
|
+
lang = {},
|
|
31
|
+
loading = false,
|
|
32
|
+
max,
|
|
33
|
+
min,
|
|
34
|
+
name,
|
|
35
|
+
onChange,
|
|
36
|
+
testId,
|
|
37
|
+
value
|
|
38
|
+
}, ref) => {
|
|
39
|
+
const {
|
|
40
|
+
selectedDate,
|
|
41
|
+
handleCalendarChange,
|
|
42
|
+
setPopoverState
|
|
43
|
+
} = useCalendarPopover({
|
|
44
|
+
value,
|
|
45
|
+
defaultValue,
|
|
46
|
+
onChange
|
|
47
|
+
});
|
|
48
|
+
const isDisabled = disabled || loading;
|
|
49
|
+
const textValues = _objectSpread(_objectSpread({}, defaultEnglish), lang);
|
|
50
|
+
const langTextCalendar = {
|
|
51
|
+
nextLabel: textValues.nextLabel,
|
|
52
|
+
prevLabel: textValues.prevLabel
|
|
53
|
+
};
|
|
54
|
+
const langTextPopover = {
|
|
55
|
+
close: textValues.close
|
|
56
|
+
};
|
|
57
|
+
const calendarProps = _objectSpread({
|
|
58
|
+
defaultValue: selectedDate,
|
|
59
|
+
minValue: min ? safeParseDateString(min) : undefined,
|
|
60
|
+
maxValue: max ? safeParseDateString(max) : undefined
|
|
61
|
+
}, calendarOptions);
|
|
62
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, dataAttrs({
|
|
63
|
+
'od-component': 'date-field',
|
|
64
|
+
testId
|
|
65
|
+
})), {}, {
|
|
66
|
+
children: [/*#__PURE__*/_jsx(PopoverTrigger, {
|
|
67
|
+
content: /*#__PURE__*/_jsx(Calendar, {
|
|
68
|
+
allowPastDate: allowPastDate,
|
|
69
|
+
calendarOptions: calendarProps,
|
|
70
|
+
lang: langTextCalendar,
|
|
71
|
+
onChange: handleCalendarChange
|
|
72
|
+
}),
|
|
73
|
+
lang: langTextPopover,
|
|
74
|
+
offset: 1,
|
|
75
|
+
onStateReady: setPopoverState,
|
|
76
|
+
placement: "bottom left",
|
|
77
|
+
isDisabled: isDisabled,
|
|
78
|
+
children: /*#__PURE__*/_jsxs("button", _objectSpread(_objectSpread({
|
|
79
|
+
className: dateFieldStyle
|
|
80
|
+
}, dataAttrs({
|
|
81
|
+
disabled,
|
|
82
|
+
loading,
|
|
83
|
+
invalid
|
|
84
|
+
})), {}, {
|
|
85
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
86
|
+
className: labelVariants({
|
|
87
|
+
disabled,
|
|
88
|
+
invalid
|
|
89
|
+
}),
|
|
90
|
+
children: textValues.dateLabel
|
|
91
|
+
}), loading ? /*#__PURE__*/_jsx(LoadingBox, {
|
|
92
|
+
height: "6"
|
|
93
|
+
}) : /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
94
|
+
className: inputStyle
|
|
95
|
+
}, dataAttrs({
|
|
96
|
+
disabled
|
|
97
|
+
})), {}, {
|
|
98
|
+
children: selectedDate ? displayFormattedDate(selectedDate) : textValues.select
|
|
99
|
+
}))]
|
|
100
|
+
}))
|
|
101
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
102
|
+
name: name,
|
|
103
|
+
value: formatDateValue(selectedDate),
|
|
104
|
+
type: "hidden",
|
|
105
|
+
disabled: disabled,
|
|
106
|
+
ref: ref
|
|
107
|
+
})]
|
|
108
|
+
}));
|
|
109
|
+
});
|
|
110
|
+
DateField.displayName = 'DateField';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cssLayerComponent } from '../../styles/layers.css';
|
|
2
|
+
export declare const dateFieldStyle: string;
|
|
3
|
+
export declare const timeFieldStyle: string;
|
|
4
|
+
export declare const labelVariants: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
5
|
+
invalid: {
|
|
6
|
+
true: string;
|
|
7
|
+
};
|
|
8
|
+
disabled: {
|
|
9
|
+
true: {
|
|
10
|
+
'@layer': {
|
|
11
|
+
[cssLayerComponent]: {
|
|
12
|
+
color: `var(--${string})`;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
export declare const inputResetStyle: string;
|
|
19
|
+
export declare const valueStyle: string;
|
|
20
|
+
export declare const inputStyle: string;
|
|
21
|
+
//# sourceMappingURL=DateTimeField.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeField.css.d.ts","sourceRoot":"","sources":["../../../lib/components/DateTimeField/DateTimeField.css.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAgD5D,eAAO,MAAM,cAAc,QAazB,CAAC;AAEH,eAAO,MAAM,cAAc,QAczB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;gBAmBrB,CAAC,iBAAiB,CAAC;;kBAElB;;;;EAKJ,CAAC;AAEH,eAAO,MAAM,eAAe,QAc1B,CAAC;AACH,eAAO,MAAM,UAAU,QAAqD,CAAC;AAC7E,eAAO,MAAM,UAAU,QAgBrB,CAAC"}
|