@autoguru/overdrive 4.44.4-next.0 → 4.44.4

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 (86) hide show
  1. package/dist/components/Actions/Actions.js +12 -15
  2. package/dist/components/Alert/Alert.js +8 -9
  3. package/dist/components/AutoSuggest/AutoSuggest.js +114 -126
  4. package/dist/components/Badge/Badge.js +8 -9
  5. package/dist/components/BulletList/Bullet.js +4 -5
  6. package/dist/components/BulletList/BulletList.js +4 -5
  7. package/dist/components/BulletText/BulletText.js +44 -47
  8. package/dist/components/Button/Button.js +23 -24
  9. package/dist/components/CheckBox/CheckBox.js +11 -12
  10. package/dist/components/DateTimePicker/CalendarGrid.js +7 -8
  11. package/dist/components/DateTimePicker/DateTimePicker.js +9 -10
  12. package/dist/components/DividerLine/DividerLine.js +16 -19
  13. package/dist/components/DropDown/DropDownOptionsList.js +15 -18
  14. package/dist/components/Flex/flex.js +35 -41
  15. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +12 -13
  16. package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.js +7 -8
  17. package/dist/components/Icon/Icon.js +6 -7
  18. package/dist/components/Image/ImageServerProvider.js +17 -21
  19. package/dist/components/Inline/Inline.js +13 -15
  20. package/dist/components/IntentStripe/IntentStripe.js +10 -13
  21. package/dist/components/LinearProgressIndicator/LinearProgressIndicator.js +3 -4
  22. package/dist/components/Meta/Meta.js +18 -21
  23. package/dist/components/Modal/Modal.js +13 -14
  24. package/dist/components/NumberBubble/NumberBubble.d.ts.map +1 -1
  25. package/dist/components/NumberBubble/NumberBubble.js +28 -29
  26. package/dist/components/NumberInput/useNumberInputBehaviours.js +8 -9
  27. package/dist/components/OptionGrid/OptionGrid.js +53 -57
  28. package/dist/components/OptionList/OptionListItem.js +4 -5
  29. package/dist/components/OrderedList/OrderedList.js +14 -18
  30. package/dist/components/OutsideClick/OutsideClick.js +4 -5
  31. package/dist/components/OverdriveProvider/FallbackProvider.js +3 -4
  32. package/dist/components/OverdriveProvider/OverdriveProvider.js +8 -9
  33. package/dist/components/Pagination/Bubble.js +8 -9
  34. package/dist/components/Pagination/Pagination.js +56 -63
  35. package/dist/components/Portal/Portal.js +5 -6
  36. package/dist/components/ProgressBar/ProgressBar.js +16 -19
  37. package/dist/components/ProgressBarGroup/ProgressBarGroup.js +7 -8
  38. package/dist/components/ProgressSpinner/ProgressSpinner.js +23 -26
  39. package/dist/components/Radio/Radio.js +6 -7
  40. package/dist/components/Radio/RadioGroup.js +7 -8
  41. package/dist/components/Section/Section.js +12 -15
  42. package/dist/components/SimplePagination/SimplePagination.js +5 -6
  43. package/dist/components/SliderProgress/ProgressStep.js +9 -10
  44. package/dist/components/SliderProgress/SliderProgress.js +25 -28
  45. package/dist/components/Stack/Stack.js +9 -10
  46. package/dist/components/StandardModal/StandardModal.js +11 -12
  47. package/dist/components/StarRating/StarRating.js +32 -36
  48. package/dist/components/Stepper/Stepper.js +45 -50
  49. package/dist/components/Table/Table.js +20 -23
  50. package/dist/components/Table/TableCell.js +8 -9
  51. package/dist/components/Table/TableHeadCell.js +10 -11
  52. package/dist/components/Table/TableRow.js +10 -13
  53. package/dist/components/Table/TableRowGroup.js +8 -11
  54. package/dist/components/Table/context.js +5 -6
  55. package/dist/components/Tabs/Tab.js +6 -7
  56. package/dist/components/Tabs/TabList.js +5 -6
  57. package/dist/components/Tabs/TabPane.js +4 -5
  58. package/dist/components/Tabs/TabPanes.js +18 -21
  59. package/dist/components/Tabs/Tabs.js +7 -8
  60. package/dist/components/TextContainer/TextContainer.js +21 -24
  61. package/dist/components/Toaster/Toast.js +65 -98
  62. package/dist/components/Tooltip/Tooltip.js +10 -11
  63. package/dist/components/Tooltip/useTooltip/useTooltip.js +11 -13
  64. package/dist/components/private/CheckableBase/CheckableBase.js +12 -13
  65. package/dist/components/private/InputBase/HintText.js +7 -8
  66. package/dist/components/private/InputBase/NotchedBase.js +17 -18
  67. package/dist/components/private/InputBase/withEnhancedInput.js +182 -187
  68. package/dist/hooks/useAnimationEvents/useAnimationEvents.js +5 -6
  69. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +9 -10
  70. package/dist/hooks/useMedia/useMedia.js +1 -2
  71. package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +8 -9
  72. package/dist/styles/sprinkles.css.js +9 -18
  73. package/dist/styles/typography.js +28 -31
  74. package/dist/themes/helpers.js +13 -15
  75. package/dist/themes/makeTheme.js +8 -15
  76. package/dist/utils/css.js +1 -2
  77. package/dist/utils/dataAttrs.js +1 -2
  78. package/dist/utils/index.js +3 -9
  79. package/dist/utils/mapTokenToProperty.js +5 -14
  80. package/dist/utils/number.js +1 -2
  81. package/dist/utils/responsiveProps.css.js +1 -2
  82. package/dist/utils/sprinkles.js +1 -2
  83. package/package.json +2 -2
  84. package/dist/components/NumberBubble/NumberBubble.css.d.ts +0 -2
  85. package/dist/components/NumberBubble/NumberBubble.css.d.ts.map +0 -1
  86. package/dist/components/NumberBubble/NumberBubble.css.js +0 -11
@@ -34,12 +34,9 @@ const reducer = (state, action) => {
34
34
  case ActionTypes.REMOVE:
35
35
  {
36
36
  return _objectSpread(_objectSpread({}, state), {}, {
37
- toasts: state.toasts.filter(_ref => {
38
- let {
39
- id
40
- } = _ref;
41
- return id !== action.id;
42
- })
37
+ toasts: state.toasts.filter(({
38
+ id
39
+ }) => id !== action.id)
43
40
  });
44
41
  }
45
42
  default:
@@ -49,10 +46,9 @@ const reducer = (state, action) => {
49
46
  }
50
47
  };
51
48
  const ToastControllerContext = /*#__PURE__*/createContext(null);
52
- const InternalToastProvider = _ref2 => {
53
- let {
54
- children
55
- } = _ref2;
49
+ const InternalToastProvider = ({
50
+ children
51
+ }) => {
56
52
  const [{
57
53
  toasts
58
54
  }, dispatch] = useReducer(reducer, {
@@ -91,10 +87,9 @@ const InternalToastProvider = _ref2 => {
91
87
  })]
92
88
  });
93
89
  };
94
- export const ToastProvider = _ref3 => {
95
- let {
96
- children
97
- } = _ref3;
90
+ export const ToastProvider = ({
91
+ children
92
+ }) => {
98
93
  const currentContext = useContext(ToastControllerContext);
99
94
  if (currentContext !== null) {
100
95
  return /*#__PURE__*/_jsx(_Fragment, {
@@ -109,98 +104,70 @@ export const useToast = () => {
109
104
  const addToast = useContext(ToastControllerContext);
110
105
  !(addToast !== null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'No `ToastProvider` setup') : invariant(false) : void 0;
111
106
  return useMemo(() => {
112
- const fn = function (message) {
113
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
114
- return void addToast({
115
- message,
116
- duration,
117
- intent: 'information'
118
- });
119
- };
107
+ const fn = (message, duration = DEFAULT_DURATION) => void addToast({
108
+ message,
109
+ duration,
110
+ intent: 'information'
111
+ });
120
112
 
121
113
  // @ts-ignore
122
- fn.primary = function (message) {
123
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
124
- return void addToast({
125
- message,
126
- duration,
127
- // @ts-ignore
128
- intent: 'primary'
129
- });
130
- };
114
+ fn.primary = (message, duration = DEFAULT_DURATION) => void addToast({
115
+ message,
116
+ duration,
117
+ // @ts-ignore
118
+ intent: 'primary'
119
+ });
131
120
  // @ts-ignore
132
- fn.secondary = function (message) {
133
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
134
- return void addToast({
135
- message,
136
- duration,
137
- // @ts-ignore
138
- intent: 'secondary'
139
- });
140
- };
121
+ fn.secondary = (message, duration = DEFAULT_DURATION) => void addToast({
122
+ message,
123
+ duration,
124
+ // @ts-ignore
125
+ intent: 'secondary'
126
+ });
141
127
  // @ts-ignore
142
- fn.shine = function (message) {
143
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
144
- return void addToast({
145
- message,
146
- duration,
147
- // @ts-ignore
148
- intent: 'shine'
149
- });
150
- };
151
- fn.success = function (message) {
152
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
153
- return void addToast({
154
- message,
155
- duration,
156
- intent: 'success'
157
- });
158
- };
128
+ fn.shine = (message, duration = DEFAULT_DURATION) => void addToast({
129
+ message,
130
+ duration,
131
+ // @ts-ignore
132
+ intent: 'shine'
133
+ });
134
+ fn.success = (message, duration = DEFAULT_DURATION) => void addToast({
135
+ message,
136
+ duration,
137
+ intent: 'success'
138
+ });
159
139
  // @ts-ignore
160
- fn.neutral = function (message) {
161
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
162
- return void addToast({
163
- message,
164
- duration,
165
- // @ts-ignore
166
- intent: 'neutral'
167
- });
168
- };
169
- fn.danger = function (message) {
170
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
171
- return void addToast({
172
- message,
173
- duration,
174
- intent: 'danger'
175
- });
176
- };
177
- fn.information = function (message) {
178
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
179
- return void addToast({
180
- message,
181
- duration,
182
- intent: 'information'
183
- });
184
- };
185
- fn.warning = function (message) {
186
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DURATION;
187
- return void addToast({
188
- message,
189
- duration,
190
- intent: 'warning'
191
- });
192
- };
140
+ fn.neutral = (message, duration = DEFAULT_DURATION) => void addToast({
141
+ message,
142
+ duration,
143
+ // @ts-ignore
144
+ intent: 'neutral'
145
+ });
146
+ fn.danger = (message, duration = DEFAULT_DURATION) => void addToast({
147
+ message,
148
+ duration,
149
+ intent: 'danger'
150
+ });
151
+ fn.information = (message, duration = DEFAULT_DURATION) => void addToast({
152
+ message,
153
+ duration,
154
+ intent: 'information'
155
+ });
156
+ fn.warning = (message, duration = DEFAULT_DURATION) => void addToast({
157
+ message,
158
+ duration,
159
+ intent: 'warning'
160
+ });
193
161
  return fn;
194
162
  }, [addToast]);
195
163
  };
196
- const Toast = _ref4 => {
197
- let {
198
- remove,
199
- duration,
200
- message,
201
- id,
202
- intent
203
- } = _ref4;
164
+ const Toast = ({
165
+ remove,
166
+ duration,
167
+ message,
168
+ id,
169
+ intent
170
+ }) => {
204
171
  const dismiss = useCallback(() => {
205
172
  remove(id);
206
173
  }, [id, remove]);
@@ -20,17 +20,16 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
20
20
  * - In uncontrolled mode, it opens on hover/focus and can auto-close after a specified delay.
21
21
  * - In controlled mode, its visibility is managed externally via the `isOpen` prop.
22
22
  */
23
- export const Tooltip = _ref => {
24
- let {
25
- alignment = EAlignment.RIGHT,
26
- isOpen,
27
- label,
28
- children,
29
- size = 'medium',
30
- closeAfter = null,
31
- testId,
32
- wrapper
33
- } = _ref;
23
+ export const Tooltip = ({
24
+ alignment = EAlignment.RIGHT,
25
+ isOpen,
26
+ label,
27
+ children,
28
+ size = 'medium',
29
+ closeAfter = null,
30
+ testId,
31
+ wrapper
32
+ }) => {
34
33
  const {
35
34
  PositionedTooltip,
36
35
  triggerRef,
@@ -14,12 +14,11 @@ const sizeMap = {
14
14
  /**
15
15
  * Hook for managing tooltip state and interactions
16
16
  */
17
- export const useTooltip = _ref => {
18
- let {
19
- isOpen: controlledIsOpen,
20
- closeAfter = null,
21
- onOpenChange
22
- } = _ref;
17
+ export const useTooltip = ({
18
+ isOpen: controlledIsOpen,
19
+ closeAfter = null,
20
+ onOpenChange
21
+ }) => {
23
22
  const tooltipId = useId();
24
23
  const [internalIsOpen, setInternalIsOpen] = useState(false);
25
24
  const triggerRef = useRef(null);
@@ -82,13 +81,12 @@ export const useTooltip = _ref => {
82
81
  onBlur: blurHandler,
83
82
  'aria-describedby': isOpen ? tooltipId : undefined
84
83
  };
85
- const PositionedTooltip = useCallback(_ref2 => {
86
- let {
87
- alignment = EAlignment.RIGHT,
88
- className,
89
- label,
90
- size = 'medium'
91
- } = _ref2;
84
+ const PositionedTooltip = useCallback(({
85
+ alignment = EAlignment.RIGHT,
86
+ className,
87
+ label,
88
+ size = 'medium'
89
+ }) => {
92
90
  const textSize = sizeMap[size];
93
91
  return /*#__PURE__*/_jsx(Positioner, {
94
92
  triggerRef: triggerRef,
@@ -7,19 +7,18 @@ import { Box } from "../../Box/Box.js";
7
7
  import { Text } from "../../Text/Text.js";
8
8
  import * as styles from "./CheckableBase.css.js";
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- export const CheckableBase = /*#__PURE__*/forwardRef((_ref, ref) => {
11
- let {
12
- className = '',
13
- label = '',
14
- checked = false,
15
- disabled = false,
16
- inputType,
17
- inputName,
18
- value,
19
- children,
20
- handleClick,
21
- handleChange
22
- } = _ref;
10
+ export const CheckableBase = /*#__PURE__*/forwardRef(({
11
+ className = '',
12
+ label = '',
13
+ checked = false,
14
+ disabled = false,
15
+ inputType,
16
+ inputName,
17
+ value,
18
+ children,
19
+ handleClick,
20
+ handleChange
21
+ }, ref) => {
23
22
  const onChange = e => {
24
23
  if (typeof handleChange === 'function') {
25
24
  handleChange(e.currentTarget.checked);
@@ -6,14 +6,13 @@ import { elementStyles } from "../../../styles/index.js";
6
6
  import { Text } from "../../Text/Text.js";
7
7
  import * as styles from "./HintText.css.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
- export const HintText = _ref => {
10
- let {
11
- reserveHintSpace,
12
- disabled,
13
- hintText,
14
- size = 'medium',
15
- className = ''
16
- } = _ref;
9
+ export const HintText = ({
10
+ reserveHintSpace,
11
+ disabled,
12
+ hintText,
13
+ size = 'medium',
14
+ className = ''
15
+ }) => {
17
16
  if (!hintText && !reserveHintSpace) return null;
18
17
  const showHintText = !disabled && hintText;
19
18
  return /*#__PURE__*/_jsx(Text, {
@@ -5,24 +5,23 @@ import React, { useRef } from 'react';
5
5
  import { Box } from "../../Box/index.js";
6
6
  import * as styles from "./NotchedBase.css.js";
7
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- export const NotchedBase = _ref => {
9
- let {
10
- id,
11
- placeholder,
12
- isEmpty,
13
- disabled,
14
- prefixed,
15
- size,
16
- children,
17
- notch = true,
18
- borderColourClassName,
19
- placeholderColourClassName,
20
- className = '',
21
- attach = 'NONE',
22
- borderMerged = 'NONE',
23
- isFocused = false,
24
- isHovered = false
25
- } = _ref;
8
+ export const NotchedBase = ({
9
+ id,
10
+ placeholder,
11
+ isEmpty,
12
+ disabled,
13
+ prefixed,
14
+ size,
15
+ children,
16
+ notch = true,
17
+ borderColourClassName,
18
+ placeholderColourClassName,
19
+ className = '',
20
+ attach = 'NONE',
21
+ borderMerged = 'NONE',
22
+ isFocused = false,
23
+ isHovered = false
24
+ }) => {
26
25
  const labelRef = useRef(null);
27
26
  const shouldMerge = !isFocused && !isHovered;
28
27
  return /*#__PURE__*/_jsxs(Box, {