@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.
- package/dist/components/Actions/Actions.js +12 -15
- package/dist/components/Alert/Alert.js +8 -9
- package/dist/components/AutoSuggest/AutoSuggest.js +114 -126
- package/dist/components/Badge/Badge.js +8 -9
- package/dist/components/BulletList/Bullet.js +4 -5
- package/dist/components/BulletList/BulletList.js +4 -5
- package/dist/components/BulletText/BulletText.js +44 -47
- package/dist/components/Button/Button.js +23 -24
- package/dist/components/CheckBox/CheckBox.js +11 -12
- package/dist/components/DateTimePicker/CalendarGrid.js +7 -8
- package/dist/components/DateTimePicker/DateTimePicker.js +9 -10
- package/dist/components/DividerLine/DividerLine.js +16 -19
- package/dist/components/DropDown/DropDownOptionsList.js +15 -18
- package/dist/components/Flex/flex.js +35 -41
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +12 -13
- package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.js +7 -8
- package/dist/components/Icon/Icon.js +6 -7
- package/dist/components/Image/ImageServerProvider.js +17 -21
- package/dist/components/Inline/Inline.js +13 -15
- package/dist/components/IntentStripe/IntentStripe.js +10 -13
- package/dist/components/LinearProgressIndicator/LinearProgressIndicator.js +3 -4
- package/dist/components/Meta/Meta.js +18 -21
- package/dist/components/Modal/Modal.js +13 -14
- package/dist/components/NumberBubble/NumberBubble.d.ts.map +1 -1
- package/dist/components/NumberBubble/NumberBubble.js +28 -29
- package/dist/components/NumberInput/useNumberInputBehaviours.js +8 -9
- package/dist/components/OptionGrid/OptionGrid.js +53 -57
- package/dist/components/OptionList/OptionListItem.js +4 -5
- package/dist/components/OrderedList/OrderedList.js +14 -18
- package/dist/components/OutsideClick/OutsideClick.js +4 -5
- package/dist/components/OverdriveProvider/FallbackProvider.js +3 -4
- package/dist/components/OverdriveProvider/OverdriveProvider.js +8 -9
- package/dist/components/Pagination/Bubble.js +8 -9
- package/dist/components/Pagination/Pagination.js +56 -63
- package/dist/components/Portal/Portal.js +5 -6
- package/dist/components/ProgressBar/ProgressBar.js +16 -19
- package/dist/components/ProgressBarGroup/ProgressBarGroup.js +7 -8
- package/dist/components/ProgressSpinner/ProgressSpinner.js +23 -26
- package/dist/components/Radio/Radio.js +6 -7
- package/dist/components/Radio/RadioGroup.js +7 -8
- package/dist/components/Section/Section.js +12 -15
- package/dist/components/SimplePagination/SimplePagination.js +5 -6
- package/dist/components/SliderProgress/ProgressStep.js +9 -10
- package/dist/components/SliderProgress/SliderProgress.js +25 -28
- package/dist/components/Stack/Stack.js +9 -10
- package/dist/components/StandardModal/StandardModal.js +11 -12
- package/dist/components/StarRating/StarRating.js +32 -36
- package/dist/components/Stepper/Stepper.js +45 -50
- package/dist/components/Table/Table.js +20 -23
- package/dist/components/Table/TableCell.js +8 -9
- package/dist/components/Table/TableHeadCell.js +10 -11
- package/dist/components/Table/TableRow.js +10 -13
- package/dist/components/Table/TableRowGroup.js +8 -11
- package/dist/components/Table/context.js +5 -6
- package/dist/components/Tabs/Tab.js +6 -7
- package/dist/components/Tabs/TabList.js +5 -6
- package/dist/components/Tabs/TabPane.js +4 -5
- package/dist/components/Tabs/TabPanes.js +18 -21
- package/dist/components/Tabs/Tabs.js +7 -8
- package/dist/components/TextContainer/TextContainer.js +21 -24
- package/dist/components/Toaster/Toast.js +65 -98
- package/dist/components/Tooltip/Tooltip.js +10 -11
- package/dist/components/Tooltip/useTooltip/useTooltip.js +11 -13
- package/dist/components/private/CheckableBase/CheckableBase.js +12 -13
- package/dist/components/private/InputBase/HintText.js +7 -8
- package/dist/components/private/InputBase/NotchedBase.js +17 -18
- package/dist/components/private/InputBase/withEnhancedInput.js +182 -187
- package/dist/hooks/useAnimationEvents/useAnimationEvents.js +5 -6
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +9 -10
- package/dist/hooks/useMedia/useMedia.js +1 -2
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +8 -9
- package/dist/styles/sprinkles.css.js +9 -18
- package/dist/styles/typography.js +28 -31
- package/dist/themes/helpers.js +13 -15
- package/dist/themes/makeTheme.js +8 -15
- package/dist/utils/css.js +1 -2
- package/dist/utils/dataAttrs.js +1 -2
- package/dist/utils/index.js +3 -9
- package/dist/utils/mapTokenToProperty.js +5 -14
- package/dist/utils/number.js +1 -2
- package/dist/utils/responsiveProps.css.js +1 -2
- package/dist/utils/sprinkles.js +1 -2
- package/package.json +2 -2
- package/dist/components/NumberBubble/NumberBubble.css.d.ts +0 -2
- package/dist/components/NumberBubble/NumberBubble.css.d.ts.map +0 -1
- 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(
|
|
38
|
-
|
|
39
|
-
|
|
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 =
|
|
53
|
-
|
|
54
|
-
|
|
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 =
|
|
95
|
-
|
|
96
|
-
|
|
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 =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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 =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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 =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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 =
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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 =
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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 =
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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 =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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 =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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((
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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, {
|