@autoguru/overdrive 4.49.0 → 4.51.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.
Files changed (63) hide show
  1. package/dist/components/Box/useBox/useBox.d.ts +1 -1
  2. package/dist/components/Calendar/Calendar.css.d.ts.map +1 -1
  3. package/dist/components/Calendar/Calendar.css.js +4 -4
  4. package/dist/components/Calendar/Calendar.d.ts +3 -10
  5. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  6. package/dist/components/Calendar/Calendar.js +4 -11
  7. package/dist/components/DatePicker/DatePicker.d.ts +10 -4
  8. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  9. package/dist/components/DatePicker/DatePicker.js +36 -63
  10. package/dist/components/DatePicker/hooks/useCalendarPopover.d.ts +38 -0
  11. package/dist/components/DatePicker/hooks/useCalendarPopover.d.ts.map +1 -0
  12. package/dist/components/DatePicker/hooks/useCalendarPopover.js +44 -0
  13. package/dist/components/DateTimeField/DateField/DateField.d.ts +40 -0
  14. package/dist/components/DateTimeField/DateField/DateField.d.ts.map +1 -0
  15. package/dist/components/DateTimeField/DateField/DateField.js +110 -0
  16. package/dist/components/DateTimeField/DateTimeField.css.d.ts +21 -0
  17. package/dist/components/DateTimeField/DateTimeField.css.d.ts.map +1 -0
  18. package/dist/components/DateTimeField/DateTimeField.css.js +127 -0
  19. package/dist/components/DateTimeField/DateTimeField.d.ts +116 -0
  20. package/dist/components/DateTimeField/DateTimeField.d.ts.map +1 -0
  21. package/dist/components/DateTimeField/DateTimeField.js +107 -0
  22. package/dist/components/DateTimeField/TimeField/TimeField.d.ts +26 -0
  23. package/dist/components/DateTimeField/TimeField/TimeField.d.ts.map +1 -0
  24. package/dist/components/DateTimeField/TimeField/TimeField.js +99 -0
  25. package/dist/components/DateTimeField/default.d.ts +2 -0
  26. package/dist/components/DateTimeField/default.d.ts.map +1 -0
  27. package/dist/components/DateTimeField/default.js +3 -0
  28. package/dist/components/DateTimeField/index.d.ts +5 -0
  29. package/dist/components/DateTimeField/index.d.ts.map +1 -0
  30. package/dist/components/DateTimeField/index.js +5 -0
  31. package/dist/components/DateTimeField/types.d.ts +34 -0
  32. package/dist/components/DateTimeField/types.d.ts.map +1 -0
  33. package/dist/components/DateTimeField/types.js +3 -0
  34. package/dist/components/DropDown/DropDown.d.ts +1 -0
  35. package/dist/components/DropDown/DropDown.d.ts.map +1 -1
  36. package/dist/components/DropDown/DropDown.js +23 -7
  37. package/dist/components/Popover/Popover.d.ts +2 -2
  38. package/dist/components/Popover/Popover.d.ts.map +1 -1
  39. package/dist/components/Popover/Popover.js +2 -2
  40. package/dist/components/Popover/PopoverTrigger.d.ts +9 -6
  41. package/dist/components/Popover/PopoverTrigger.d.ts.map +1 -1
  42. package/dist/components/Popover/PopoverTrigger.js +6 -3
  43. package/dist/components/index.d.ts +2 -0
  44. package/dist/components/index.d.ts.map +1 -1
  45. package/dist/components/index.js +2 -0
  46. package/dist/styles/selectors.d.ts +1 -0
  47. package/dist/styles/selectors.d.ts.map +1 -1
  48. package/dist/styles/selectors.js +1 -0
  49. package/dist/utils/dateFormat.d.ts +5 -4
  50. package/dist/utils/dateFormat.d.ts.map +1 -1
  51. package/dist/utils/dateFormat.js +9 -9
  52. package/dist/utils/responsiveStyle.d.ts +1 -1
  53. package/dist/utils/responsiveStyle.d.ts.map +1 -1
  54. package/package.json +42 -42
  55. package/dist/components/DateTimePicker/DateTimePicker.css.d.ts +0 -4
  56. package/dist/components/DateTimePicker/DateTimePicker.css.d.ts.map +0 -1
  57. package/dist/components/DateTimePicker/DateTimePicker.css.js +0 -30
  58. package/dist/components/DateTimePicker/DateTimePicker.d.ts +0 -68
  59. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +0 -1
  60. package/dist/components/DateTimePicker/DateTimePicker.js +0 -130
  61. package/dist/components/DateTimePicker/default.d.ts +0 -2
  62. package/dist/components/DateTimePicker/default.d.ts.map +0 -1
  63. package/dist/components/DateTimePicker/default.js +0 -3
@@ -53,6 +53,7 @@ export const Popover = _ref2 => {
53
53
  const popoverRef = useRef(null);
54
54
  const [isTablet] = useMedia(['tablet']);
55
55
  const isFullScreen = !isTablet;
56
+ const textValues = _objectSpread(_objectSpread({}, defaultEnglish), lang);
56
57
 
57
58
  // Handle Esc manually since we have two different modes (popover vs fullscreen dialog)
58
59
  // and react-aria would need a slightly different ModalTrigger pattern
@@ -78,7 +79,6 @@ export const Popover = _ref2 => {
78
79
 
79
80
  // Fullscreen mode: render Dialog directly without popover positioning
80
81
  if (isFullScreen) {
81
- var _lang$close;
82
82
  return /*#__PURE__*/_jsx(Overlay, {
83
83
  children: /*#__PURE__*/_jsx(Dialog, {
84
84
  children: /*#__PURE__*/_jsx("div", {
@@ -99,7 +99,7 @@ export const Popover = _ref2 => {
99
99
  minimal: true,
100
100
  rounded: true,
101
101
  onClick: state.close,
102
- "aria-label": (_lang$close = lang === null || lang === void 0 ? void 0 : lang.close) !== null && _lang$close !== void 0 ? _lang$close : defaultEnglish.close,
102
+ "aria-label": textValues.close,
103
103
  children: /*#__PURE__*/_jsx(Icon, {
104
104
  icon: CloseIcon
105
105
  })
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type AriaPopoverProps } from 'react-aria';
3
3
  import type { TestIdProp } from '../../types';
4
- import { type Language } from './Popover';
4
+ import { type PopoverTextContent } from './Popover';
5
+ export type OnStateReadyValue = {
6
+ close: () => void;
7
+ isOpen: boolean;
8
+ };
5
9
  /**
6
10
  * Props for the PopoverTrigger component.
7
11
  */
@@ -22,13 +26,12 @@ export interface PopoverTriggerProps extends Pick<AriaPopoverProps, 'offset' | '
22
26
  /**
23
27
  * Language content override
24
28
  */
25
- lang?: Language;
29
+ lang?: Partial<PopoverTextContent>;
26
30
  /**
27
31
  * Callback that receives the overlay trigger state for external control
28
32
  */
29
- onStateReady?: (state: {
30
- close: () => void;
31
- }) => void;
33
+ onStateReady?: (state: OnStateReadyValue) => void;
34
+ ref?: React.RefObject<HTMLButtonElement | null>;
32
35
  }
33
36
  /**
34
37
  * A popover component that displays content in an overlay positioned relative to a trigger element.
@@ -45,7 +48,7 @@ export interface PopoverTriggerProps extends Pick<AriaPopoverProps, 'offset' | '
45
48
  * ```
46
49
  */
47
50
  export declare const PopoverTrigger: {
48
- ({ content, children, isDisabled, offset, placement, shouldCloseOnInteractOutside, shouldFlip, testId, lang, onStateReady, }: PopoverTriggerProps): React.JSX.Element;
51
+ ({ content, children, isDisabled, offset, placement, shouldCloseOnInteractOutside, shouldFlip, testId, lang, ref, onStateReady, }: PopoverTriggerProps): React.JSX.Element;
49
52
  displayName: string;
50
53
  };
51
54
  //# sourceMappingURL=PopoverTrigger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverTrigger.d.ts","sourceRoot":"","sources":["../../../lib/components/Popover/PopoverTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAAE,KAAK,QAAQ,EAAW,MAAM,WAAW,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,mBAChB,SAAQ,IAAI,CACV,gBAAgB,EACd,QAAQ,GACR,WAAW,GACX,8BAA8B,GAC9B,YAAY,CACd,EACD,UAAU;IACX;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,IAAI,CAAC;CACtD;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;kIAWxB,mBAAmB;;CAwErB,CAAC"}
1
+ {"version":3,"file":"PopoverTrigger.d.ts","sourceRoot":"","sources":["../../../lib/components/Popover/PopoverTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAAW,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG7D,MAAM,MAAM,iBAAiB,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,mBAChB,SAAQ,IAAI,CACV,gBAAgB,EACd,QAAQ,GACR,WAAW,GACX,8BAA8B,GAC9B,YAAY,CACd,EACD,UAAU;IACX;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACnC;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;uIAYxB,mBAAmB;;CAyErB,CAAC"}
@@ -39,19 +39,22 @@ export const PopoverTrigger = ({
39
39
  shouldFlip,
40
40
  testId,
41
41
  lang,
42
+ ref,
42
43
  onStateReady
43
44
  }) => {
44
45
  const state = useOverlayTriggerState({});
45
- const triggerRef = useRef(null);
46
+ const internalRef = useRef(null);
47
+ const triggerRef = ref !== null && ref !== void 0 ? ref : internalRef;
46
48
 
47
49
  // Provide state access to parent component
48
50
  React.useEffect(() => {
49
51
  if (onStateReady) {
50
52
  onStateReady({
51
- close: state.close
53
+ close: state.close,
54
+ isOpen: state.isOpen
52
55
  });
53
56
  }
54
- }, [onStateReady, state.close]);
57
+ }, [onStateReady, state.close, state.isOpen]);
55
58
  const {
56
59
  triggerProps,
57
60
  overlayProps
@@ -7,11 +7,13 @@ export * from './Box';
7
7
  export * from './BulletList';
8
8
  export * from './BulletText';
9
9
  export * from './Button';
10
+ export * from './Calendar';
10
11
  export * from './CheckBox';
11
12
  export * from './ColourInput';
12
13
  export * from './Columns';
13
14
  export * from './DateInput';
14
15
  export * from './DatePicker';
16
+ export * from './DateTimeField';
15
17
  export * from './DividerLine';
16
18
  export * from './DropDown';
17
19
  export * from './EditableText';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAA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,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
@@ -9,11 +9,13 @@ export * from "./Box/index.js";
9
9
  export * from "./BulletList/index.js";
10
10
  export * from "./BulletText/index.js";
11
11
  export * from "./Button/index.js";
12
+ export * from "./Calendar/index.js";
12
13
  export * from "./CheckBox/index.js";
13
14
  export * from "./ColourInput/index.js";
14
15
  export * from "./Columns/index.js";
15
16
  export * from "./DateInput/index.js";
16
17
  export * from "./DatePicker/index.js";
18
+ export * from "./DateTimeField/index.js";
17
19
  export * from "./DividerLine/index.js";
18
20
  export * from "./DropDown/index.js";
19
21
  export * from "./EditableText/index.js";
@@ -4,6 +4,7 @@ export declare const selectors: {
4
4
  readonly disabled: "&:disabled, &[data-disabled], &[aria-disabled=\"true\"]";
5
5
  readonly focus: "&:focus, &[data-focus], &[data-focused]";
6
6
  readonly focusVisible: "&:focus-visible, &[data-focus-visible]";
7
+ readonly invalid: "&:invalid, &[data-invalid]";
7
8
  readonly selected: "&[data-selected], &[aria-selected=\"true\"]";
8
9
  readonly unavailable: "&[data-unavailable]";
9
10
  readonly hover: string;
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../lib/styles/selectors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;CAoBZ,CAAC"}
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../lib/styles/selectors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAqBZ,CAAC"}
@@ -10,6 +10,7 @@ export const selectors = {
10
10
  disabled: '&:disabled, &[data-disabled], &[aria-disabled="true"]',
11
11
  focus: '&:focus, &[data-focus], &[data-focused]',
12
12
  focusVisible: '&:focus-visible, &[data-focus-visible]',
13
+ invalid: '&:invalid, &[data-invalid]',
13
14
  selected: '&[data-selected], &[aria-selected="true"]',
14
15
  unavailable: '&[data-unavailable]',
15
16
  get hover() {
@@ -12,9 +12,9 @@ export declare function isToday(date: DateValue | string | null | undefined): bo
12
12
  */
13
13
  export declare function safeParseDateString(dateString: string): DateValue | null;
14
14
  /**
15
- * Formats a DateValue to its string representation
15
+ * Formats a DateValue to its ISO string representation (YYYY-MM-DD)
16
16
  * @param date - DateValue or null
17
- * @returns String representation of the date or empty string for null
17
+ * @returns ISO date string (e.g., "2025-09-21") or empty string
18
18
  */
19
19
  export declare function formatDateValue(date: DateValue | null): string;
20
20
  /**
@@ -27,9 +27,10 @@ export declare function formatDateValue(date: DateValue | null): string;
27
27
  *
28
28
  * @example
29
29
  * ```ts
30
- * displayFormattedDate('2025-05-01') // "May 01, 2025"
31
- * displayFormattedDate('2024-01-15', 'full') // "Monday, January 15, 2024"
30
+ * displayFormattedDate('2025-09-21') // (locale default) "21/09/2025"
32
31
  * displayFormattedDate('2025-09-21', 'short') // "21/9/25"
32
+ * displayFormattedDate('2025-09-21', 'medium') // "Sep 21, 2025"
33
+ * displayFormattedDate('2024-01-15', 'full') // "Monday, January 15, 2024"
33
34
  * ```
34
35
  */
35
36
  export declare function displayFormattedDate(date: DateValue | string | null | undefined, format?: Intl.DateTimeFormatOptions['dateStyle'], locales?: Intl.LocalesArgument): string;
@@ -1 +1 @@
1
- {"version":3,"file":"dateFormat.d.ts","sourceRoot":"","sources":["../../lib/utils/dateFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,WAUlE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOxE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,CAE9D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAC3C,MAAM,GAAE,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAY,EAC1D,OAAO,GAAE,IAAI,CAAC,eAAyB,GACrC,MAAM,CAmBR"}
1
+ {"version":3,"file":"dateFormat.d.ts","sourceRoot":"","sources":["../../lib/utils/dateFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,WAUlE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOxE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,CAE9D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAC3C,MAAM,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,EAChD,OAAO,GAAE,IAAI,CAAC,eAAyB,GACrC,MAAM,CAmBR"}
@@ -34,9 +34,9 @@ export function safeParseDateString(dateString) {
34
34
  }
35
35
 
36
36
  /**
37
- * Formats a DateValue to its string representation
37
+ * Formats a DateValue to its ISO string representation (YYYY-MM-DD)
38
38
  * @param date - DateValue or null
39
- * @returns String representation of the date or empty string for null
39
+ * @returns ISO date string (e.g., "2025-09-21") or empty string
40
40
  */
41
41
  export function formatDateValue(date) {
42
42
  var _date$toString;
@@ -53,12 +53,13 @@ export function formatDateValue(date) {
53
53
  *
54
54
  * @example
55
55
  * ```ts
56
- * displayFormattedDate('2025-05-01') // "May 01, 2025"
57
- * displayFormattedDate('2024-01-15', 'full') // "Monday, January 15, 2024"
56
+ * displayFormattedDate('2025-09-21') // (locale default) "21/09/2025"
58
57
  * displayFormattedDate('2025-09-21', 'short') // "21/9/25"
58
+ * displayFormattedDate('2025-09-21', 'medium') // "Sep 21, 2025"
59
+ * displayFormattedDate('2024-01-15', 'full') // "Monday, January 15, 2024"
59
60
  * ```
60
61
  */
61
- export function displayFormattedDate(date, format = 'medium', locales = 'en-AU') {
62
+ export function displayFormattedDate(date, format, locales = 'en-AU') {
62
63
  if (!date) return '';
63
64
  let dateValue;
64
65
 
@@ -72,10 +73,9 @@ export function displayFormattedDate(date, format = 'medium', locales = 'en-AU')
72
73
  } else {
73
74
  dateValue = date;
74
75
  }
75
-
76
- // Format the date using Intl.DateTimeFormat
77
- const formatter = new Intl.DateTimeFormat(locales, {
76
+ const formatOptions = {
78
77
  dateStyle: format
79
- });
78
+ };
79
+ const formatter = new Intl.DateTimeFormat(locales, formatOptions);
80
80
  return formatter.format(dateValue.toDate(getLocalTimeZone()));
81
81
  }
@@ -1,4 +1,4 @@
1
- import type { CSSProperties, StyleRule } from '@vanilla-extract/css/dist/vanilla-extract-css.cjs';
1
+ import type { CSSProperties, StyleRule } from '@vanilla-extract/css';
2
2
  import { breakpoints } from '../themes/makeTheme';
3
3
  export declare const responsiveStyle: (breakpointsEntries: Partial<Record<keyof typeof breakpoints, StyleRule>>) => CSSProperties;
4
4
  //# sourceMappingURL=responsiveStyle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"responsiveStyle.d.ts","sourceRoot":"","sources":["../../lib/utils/responsiveStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,SAAS,EACT,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,eAAO,MAAM,eAAe,GAC3B,oBAAoB,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,EAAE,SAAS,CAAC,CAAC,KACtE,aAiBF,CAAC"}
1
+ {"version":3,"file":"responsiveStyle.d.ts","sourceRoot":"","sources":["../../lib/utils/responsiveStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,eAAO,MAAM,eAAe,GAC3B,oBAAoB,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,EAAE,SAAS,CAAC,CAAC,KACtE,aAiBF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.49.0",
3
+ "version": "4.51.0",
4
4
  "description": "Overdrive is a product component library, and design system for AutoGuru.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -57,14 +57,14 @@
57
57
  },
58
58
  "browserslist": "extends browserslist-config-autoguru",
59
59
  "devDependencies": {
60
- "@antebudimir/eslint-plugin-vanilla-extract": "^1.11.0",
60
+ "@antebudimir/eslint-plugin-vanilla-extract": "^1.12.0",
61
61
  "@autoguru/babel-preset": "3.2.0",
62
62
  "@autoguru/eslint-plugin": "2.0.0",
63
- "@autoguru/icons": "1.8.12",
63
+ "@autoguru/icons": "1.8.16",
64
64
  "@autoguru/tsconfig": "1.3.1",
65
65
  "@autoguru/utilities": "^1.3.3",
66
66
  "@babel/cli": "7.28.3",
67
- "@babel/core": "7.28.4",
67
+ "@babel/core": "7.28.5",
68
68
  "@babel/plugin-proposal-class-properties": "7.18.6",
69
69
  "@babel/plugin-proposal-export-default-from": "7.27.1",
70
70
  "@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
@@ -72,35 +72,35 @@
72
72
  "@babel/plugin-proposal-optional-chaining": "7.21.0",
73
73
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
74
74
  "@babel/plugin-transform-classes": "7.28.4",
75
- "@babel/plugin-transform-runtime": "7.28.3",
75
+ "@babel/plugin-transform-runtime": "7.28.5",
76
76
  "@babel/plugin-transform-spread": "7.27.1",
77
77
  "@babel/plugin-transform-strict-mode": "7.27.1",
78
- "@babel/preset-env": "7.28.3",
79
- "@babel/preset-react": "7.27.1",
80
- "@babel/preset-typescript": "7.27.1",
78
+ "@babel/preset-env": "7.28.5",
79
+ "@babel/preset-react": "7.28.5",
80
+ "@babel/preset-typescript": "7.28.5",
81
81
  "@babel/runtime-corejs3": "7.28.4",
82
82
  "@changesets/cli": "2.29.7",
83
83
  "@chromatic-com/storybook": "4.1.1",
84
- "@internationalized/date": "3.9.0",
84
+ "@internationalized/date": "3.10.0",
85
85
  "@octokit/rest": "22.0.0",
86
86
  "@popperjs/core": "2.11.8",
87
- "@react-stately/toggle": "3.9.1",
88
- "@storybook/addon-a11y": "9.1.8",
89
- "@storybook/addon-docs": "9.1.8",
90
- "@storybook/addon-links": "9.1.8",
91
- "@storybook/addon-onboarding": "9.1.8",
92
- "@storybook/addon-vitest": "9.1.8",
93
- "@storybook/react-vite": "9.1.8",
87
+ "@react-stately/toggle": "3.9.2",
88
+ "@storybook/addon-a11y": "9.1.13",
89
+ "@storybook/addon-docs": "9.1.13",
90
+ "@storybook/addon-links": "9.1.13",
91
+ "@storybook/addon-onboarding": "9.1.13",
92
+ "@storybook/addon-vitest": "9.1.13",
93
+ "@storybook/react-vite": "9.1.13",
94
94
  "@testing-library/dom": "^10.4.1",
95
- "@testing-library/jest-dom": "6.8.0",
95
+ "@testing-library/jest-dom": "6.9.1",
96
96
  "@testing-library/react": "16.3.0",
97
97
  "@testing-library/react-hooks": "8.0.1",
98
98
  "@testing-library/user-event": "14.6.1",
99
- "@types/node": "24.6.0",
100
- "@types/react": "19.1.15",
101
- "@types/react-dom": "19.1.9",
99
+ "@types/node": "24.9.1",
100
+ "@types/react": "19.2.2",
101
+ "@types/react-dom": "19.2.2",
102
102
  "@types/webpack-env": "1.18.8",
103
- "@typescript-eslint/utils": "8.44.1",
103
+ "@typescript-eslint/utils": "8.46.2",
104
104
  "@vanilla-extract/babel-plugin": "1.2.0",
105
105
  "@vanilla-extract/css": "1.17.4",
106
106
  "@vanilla-extract/dynamic": "2.1.5",
@@ -110,51 +110,51 @@
110
110
  "@vanilla-extract/webpack-plugin": "2.3.22",
111
111
  "@vitest/browser": "3.2.4",
112
112
  "@vitest/coverage-v8": "3.2.4",
113
- "@vitest/eslint-plugin": "1.3.13",
113
+ "@vitest/eslint-plugin": "1.3.23",
114
114
  "babel-plugin-add-import-extension": "1.6.0",
115
115
  "babel-plugin-dev-expression": "0.2.3",
116
116
  "babel-plugin-macros": "3.1.0",
117
117
  "browserslist-config-autoguru": "2.5.2",
118
- "chromatic": "13.3.0",
118
+ "chromatic": "13.3.1",
119
119
  "clsx": "2.1.1",
120
120
  "colord": "2.9.3",
121
121
  "concurrently": "9.2.1",
122
- "core-js": "3.45.1",
122
+ "core-js": "3.46.0",
123
123
  "csstype": "3.1.3",
124
124
  "deepmerge": "4.3.1",
125
- "es-toolkit": "1.39.10",
126
- "eslint": "9.34.0",
127
- "eslint-plugin-storybook": "9.1.8",
125
+ "es-toolkit": "1.40.0",
126
+ "eslint": "9.38.0",
127
+ "eslint-plugin-storybook": "9.1.13",
128
128
  "husky": "9.1.7",
129
129
  "intersection-observer": "0.12.2",
130
- "jsdom": "26.1.0",
131
- "lint-staged": "16.2.3",
132
- "magic-string": "0.30.19",
130
+ "jsdom": "27.0.1",
131
+ "lint-staged": "16.2.6",
132
+ "magic-string": "0.30.21",
133
133
  "mini-css-extract-plugin": "2.9.4",
134
134
  "mockdate": "3.0.5",
135
- "playwright": "1.55.1",
135
+ "playwright": "1.56.1",
136
136
  "plop": "4.0.4",
137
137
  "postcss": "8.5.6",
138
138
  "prettier": "3.6.2",
139
139
  "prop-types": "15.8.1",
140
140
  "rand-seed": "3.0.0",
141
- "react": "19.1.1",
142
- "react-aria": "3.43.2",
143
- "react-aria-components": "1.12.2",
144
- "react-dom": "19.1.1",
141
+ "react": "19.2.0",
142
+ "react-aria": "3.44.0",
143
+ "react-aria-components": "1.13.0",
144
+ "react-dom": "19.2.0",
145
145
  "react-focus-lock": "2.13.6",
146
146
  "react-intersection-observer": "9.16.0",
147
147
  "react-keyed-flatten-children": "5.0.1",
148
- "react-stately": "3.41.0",
148
+ "react-stately": "3.42.0",
149
149
  "react-swipeable": "7.0.2",
150
- "rollup-plugin-visualizer": "6.0.3",
151
- "storybook": "9.1.8",
152
- "storybook-addon-tag-badges": "2.0.2",
153
- "typescript": "5.9.2",
150
+ "rollup-plugin-visualizer": "6.0.5",
151
+ "storybook": "9.1.13",
152
+ "storybook-addon-tag-badges": "2.0.3",
153
+ "typescript": "5.9.3",
154
154
  "url-loader": "4.1.1",
155
- "vite": "7.1.7",
155
+ "vite": "7.1.12",
156
156
  "vitest": "3.2.4",
157
- "webpack": "5.102.0"
157
+ "webpack": "5.102.1"
158
158
  },
159
159
  "peerDependencies": {
160
160
  "@autoguru/icons": ">=1.8.8",
@@ -1,4 +0,0 @@
1
- export declare const queryContainer: string;
2
- export declare const queryContainerStyle: string;
3
- export declare const layoutStyle: string;
4
- //# sourceMappingURL=DateTimePicker.css.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateTimePicker.css.d.ts","sourceRoot":"","sources":["../../../lib/components/DateTimePicker/DateTimePicker.css.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,QAAoB,CAAC;AAChD,eAAO,MAAM,mBAAmB,QAO9B,CAAC;AAEH,eAAO,MAAM,WAAW,QAWtB,CAAC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
4
- __vanilla_filescope__.setFileScope("lib/components/DateTimePicker/DateTimePicker.css.ts", "@autoguru/overdrive");
5
- import { createContainer, style } from '@vanilla-extract/css';
6
- import { cssLayerComponent } from "../../styles/layers.css.js";
7
- import { breakpoints } from "../../themes/makeTheme.js";
8
- import { overdriveTokens as tokens } from "../../themes/theme.css.js"; // === Container styles
9
- export const queryContainer = createContainer("queryContainer");
10
- export const queryContainerStyle = style({
11
- '@layer': {
12
- [cssLayerComponent]: {
13
- containerName: queryContainer,
14
- containerType: 'inline-size'
15
- }
16
- }
17
- }, "queryContainerStyle");
18
- export const layoutStyle = style({
19
- '@layer': {
20
- [cssLayerComponent]: {
21
- '@container': {
22
- [`${queryContainer} (min-width: ${breakpoints.tablet})`]: {
23
- display: 'flex',
24
- gap: tokens.space[7]
25
- }
26
- }
27
- }
28
- }
29
- }, "layoutStyle");
30
- __vanilla_filescope__.endFileScope();
@@ -1,68 +0,0 @@
1
- import React from 'react';
2
- import { type AriaCalendarProps, type DateValue } from 'react-aria';
3
- import type { TestIdProp } from '../../types';
4
- import { type OptionGridProps, type OptionItem } from '../OptionGrid/OptionGrid';
5
- declare const defaultEnglish: {
6
- readonly dateLabel: "Date";
7
- readonly timeLabel: "Time";
8
- readonly nextLabel: "Next month";
9
- readonly prevLabel: "Previous month";
10
- };
11
- type LangContent = keyof typeof defaultEnglish;
12
- export type DateAndOption = {
13
- date: DateValue;
14
- timeOption: string;
15
- };
16
- export interface DateTimePickerProps<D extends DateValue> extends TestIdProp {
17
- /**
18
- * A title for the date/time selection
19
- */
20
- title?: string;
21
- /**
22
- * Calendar props passed through to the react-aria hook
23
- * ([docs](https://react-spectrum.adobe.com/react-aria/useCalendar.html))
24
- *
25
- * *Defaults*
26
- * - `defaultValue`: Today's date
27
- * - `firstDayOfWeek`: Monday
28
- */
29
- calendarOptions?: Exclude<AriaCalendarProps<D>, 'onChange'>;
30
- /**
31
- * `OptionGrid` props used to generate the time picker items. Ensure to include a descriptive `label` value (for
32
- * assistive technology). Currently time options are not tied to the day selection.
33
- */
34
- timeOptions: OptionGridProps<OptionItem>;
35
- /**
36
- * Allow date in the past
37
- */
38
- allowPastDate?: boolean;
39
- /**
40
- * Custom event handler return value when a date and time are both selected, return a value
41
- * `{ date: DateValue, timeOption: string }` where `DateValue` comes from react-aria
42
- *
43
- * @returns `{ date: DateValue, timeOption: string }`
44
- */
45
- onChange?: (value: DateAndOption) => void;
46
- /**
47
- * Language content override
48
- */
49
- lang?: Partial<Record<LangContent, string>>;
50
- }
51
- /**
52
- * DateTimePicker component for selecting a date and time. The primary use case is for selecting a date and time for
53
- * the vehicle to be left at the place of service, not scheduling the time of the service itself. Some suppliers
54
- * may need the option to book a specficic time based on their availability which could require enahcement.
55
- *
56
- * For all date/time handling `@internationalized/date` is expected by react-aria. Presently only the Gregorian
57
- * calendar is imported for use in order to minimise bundle size. It is recommended to use the the DateTimePicker
58
- * uncontrolled.
59
- *
60
- * This component implements the react-aria `useCalendar` hook and supports controlled state as well
61
- * ([docs](https://react-spectrum.adobe.com/react-aria/useCalendar.html))
62
- */
63
- export declare const DateTimePicker: {
64
- <D extends DateValue>({ allowPastDate, calendarOptions, lang, onChange, timeOptions, title, testId, }: DateTimePickerProps<D>): React.JSX.Element;
65
- displayName: string;
66
- };
67
- export {};
68
- //# sourceMappingURL=DateTimePicker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DateTimePicker/DateTimePicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAAS,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAI3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,MAAM,0BAA0B,CAAC;AAIlC,QAAA,MAAM,cAAc;;;;;CAKV,CAAC;AAEX,KAAK,WAAW,GAAG,MAAM,OAAO,cAAc,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,UAAU;IAC3E;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5D;;;OAGG;IACH,WAAW,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACzC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;CAC5C;AAQD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc;KAAI,CAAC,SAAS,SAAS,mFAQ/C,mBAAmB,CAAC,CAAC,CAAC;;CA+ExB,CAAC"}