@autoguru/overdrive 4.11.2 → 4.11.3
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/stories.js +0 -5
- package/dist/components/Alert/Alert.css.d.ts +1 -2
- package/dist/components/Alert/Alert.css.d.ts.map +1 -1
- package/dist/components/Alert/Alert.css.js +8 -21
- package/dist/components/Alert/Alert.d.ts +2 -2
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +10 -4
- package/dist/components/Alert/stories.js +0 -10
- package/dist/components/Anchor/Anchor.css.js +0 -3
- package/dist/components/Anchor/Anchor.js +0 -2
- package/dist/components/Anchor/stories.js +0 -9
- package/dist/components/AutoSuggest/AutoSuggest.css.js +0 -3
- package/dist/components/AutoSuggest/AutoSuggest.js +56 -102
- package/dist/components/AutoSuggest/stories.js +0 -28
- package/dist/components/AutoSuggest/useLayoutSuggestionVisible.js +0 -2
- package/dist/components/Badge/Badge.css.js +0 -3
- package/dist/components/Badge/stories.js +0 -12
- package/dist/components/Box/Box.js +53 -57
- package/dist/components/Box/argTypes.d.ts.map +1 -1
- package/dist/components/Box/argTypes.js +0 -3
- package/dist/components/Box/stories.js +0 -5
- package/dist/components/Box/useBoxStyles.css.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.css.js +0 -8
- package/dist/components/Box/useBoxStyles.d.ts.map +1 -1
- package/dist/components/BulletList/Bullet.css.js +0 -3
- package/dist/components/BulletList/Bullet.js +0 -6
- package/dist/components/BulletList/BulletList.css.js +0 -3
- package/dist/components/BulletList/stories.js +0 -6
- package/dist/components/BulletText/BulletText.css.js +0 -3
- package/dist/components/BulletText/stories.js +0 -5
- package/dist/components/Button/Button.css.js +0 -3
- package/dist/components/Button/Button.js +0 -11
- package/dist/components/Button/stories.js +0 -6
- package/dist/components/CheckBox/CheckBox.css.js +0 -3
- package/dist/components/CheckBox/stories.js +3 -11
- package/dist/components/ColourInput/ColourInput.css.js +0 -3
- package/dist/components/ColourInput/ColourInput.js +9 -13
- package/dist/components/ColourInput/stories.js +0 -23
- package/dist/components/Columns/Column.css.js +0 -5
- package/dist/components/Columns/Column.js +10 -14
- package/dist/components/Columns/Columns.css.js +0 -3
- package/dist/components/Columns/Columns.js +11 -15
- package/dist/components/Columns/stories.js +0 -6
- package/dist/components/DateInput/DateInput.js +9 -13
- package/dist/components/DateInput/stories.js +0 -25
- package/dist/components/DatePicker/DatePicker.css.js +0 -3
- package/dist/components/DatePicker/DatePicker.js +8 -13
- package/dist/components/DatePicker/stories.js +0 -5
- package/dist/components/DividerLine/DividerLine.css.d.ts +0 -5
- package/dist/components/DividerLine/DividerLine.css.d.ts.map +1 -1
- package/dist/components/DividerLine/DividerLine.css.js +1 -31
- package/dist/components/DividerLine/DividerLine.d.ts +2 -1
- package/dist/components/DividerLine/DividerLine.d.ts.map +1 -1
- package/dist/components/DividerLine/DividerLine.js +2 -1
- package/dist/components/DividerLine/stories.js +0 -9
- package/dist/components/Flyout/Flyout.js +7 -11
- package/dist/components/Flyout/stories.js +0 -6
- package/dist/components/Heading/stories.js +0 -7
- package/dist/components/Icon/Icon.css.js +0 -3
- package/dist/components/Icon/stories.js +0 -11
- package/dist/components/Image/Image.js +3 -7
- package/dist/components/Image/ResponsiveImage.js +6 -10
- package/dist/components/Image/SimpleImage.js +7 -11
- package/dist/components/Image/stories.js +0 -13
- package/dist/components/Inline/Inline.js +0 -6
- package/dist/components/Inline/stories.js +0 -6
- package/dist/components/LinearProgressIndicator/LinearProgressIndicator.css.js +0 -3
- package/dist/components/LinearProgressIndicator/stories.js +0 -5
- package/dist/components/LoadingBox/LoadingBox.css.js +0 -3
- package/dist/components/LoadingBox/LoadingBox.js +8 -14
- package/dist/components/LoadingBox/stories.js +0 -5
- package/dist/components/Meta/Meta.css.js +0 -3
- package/dist/components/Meta/stories.js +0 -5
- package/dist/components/MinimalModal/MinimalModal.css.js +0 -3
- package/dist/components/MinimalModal/MinimalModal.js +0 -2
- package/dist/components/MinimalModal/stories.js +0 -11
- package/dist/components/Modal/Modal.css.d.ts.map +1 -1
- package/dist/components/Modal/Modal.css.js +0 -5
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +5 -18
- package/dist/components/Modal/stories.js +0 -5
- package/dist/components/NumberBubble/NumberBubble.css.js +0 -3
- package/dist/components/NumberBubble/NumberBubble.js +5 -9
- package/dist/components/NumberBubble/stories.js +0 -5
- package/dist/components/NumberInput/NumberInput.js +14 -20
- package/dist/components/NumberInput/stories.js +0 -25
- package/dist/components/OrderedList/OrderedList.css.js +0 -3
- package/dist/components/OrderedList/OrderedList.js +0 -4
- package/dist/components/OrderedList/stories.js +0 -5
- package/dist/components/OutsideClick/OutsideClick.js +0 -3
- package/dist/components/OutsideClick/stories.js +0 -6
- package/dist/components/OverdriveProvider/OverdriveProvider.js +0 -1
- package/dist/components/Pagination/Pagination.css.js +0 -3
- package/dist/components/Pagination/Pagination.js +0 -20
- package/dist/components/Pagination/stories.js +0 -25
- package/dist/components/Portal/Portal.js +0 -7
- package/dist/components/Portal/stories.js +0 -9
- package/dist/components/Positioner/Positioner.css.js +0 -3
- package/dist/components/Positioner/Positioner.js +7 -19
- package/dist/components/Positioner/alignment.js +0 -1
- package/dist/components/Positioner/stories.js +0 -10
- package/dist/components/ProgressBar/ProgressBar.css.js +0 -3
- package/dist/components/ProgressBar/stories.js +0 -6
- package/dist/components/ProgressBarGroup/ProgressBarGroup.css.js +0 -3
- package/dist/components/ProgressBarGroup/stories.js +0 -5
- package/dist/components/ProgressSpinner/ProgressSpinner.css.js +0 -3
- package/dist/components/ProgressSpinner/stories.js +0 -5
- package/dist/components/Radio/Radio.css.js +0 -3
- package/dist/components/Radio/Radio.js +0 -3
- package/dist/components/Radio/stories.js +8 -17
- package/dist/components/Section/Section.css.js +0 -3
- package/dist/components/Section/stories.js +0 -5
- package/dist/components/SelectInput/SelectInput.css.js +0 -3
- package/dist/components/SelectInput/SelectInput.js +10 -14
- package/dist/components/SelectInput/stories.js +0 -23
- package/dist/components/SimplePagination/SimplePagination.js +0 -4
- package/dist/components/SimplePagination/stories.js +0 -9
- package/dist/components/Stack/Divider.css.js +0 -3
- package/dist/components/Stack/Stack.css.js +0 -3
- package/dist/components/Stack/Stack.js +0 -2
- package/dist/components/Stack/stories.js +0 -11
- package/dist/components/StandardModal/StandardModal.css.js +0 -5
- package/dist/components/StandardModal/StandardModal.js +0 -4
- package/dist/components/StandardModal/stories.js +0 -5
- package/dist/components/StarRating/StarRating.css.js +0 -3
- package/dist/components/StarRating/StarRating.js +0 -12
- package/dist/components/StarRating/stories.js +0 -5
- package/dist/components/Stepper/Stepper.css.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.css.js +1 -5
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +4 -8
- package/dist/components/Stepper/stories.js +4 -12
- package/dist/components/Switch/Switch.css.js +0 -3
- package/dist/components/Switch/Switch.js +0 -1
- package/dist/components/Switch/stories.js +4 -16
- package/dist/components/Table/Table.css.js +0 -3
- package/dist/components/Table/TableCell.css.js +0 -3
- package/dist/components/Table/TableCell.js +0 -1
- package/dist/components/Table/TableHeadCell.css.js +0 -5
- package/dist/components/Table/TableHeadCell.js +0 -6
- package/dist/components/Table/stories.js +0 -7
- package/dist/components/Tabs/Tab.css.js +0 -3
- package/dist/components/Tabs/Tab.js +0 -3
- package/dist/components/Tabs/TabList.css.js +0 -3
- package/dist/components/Tabs/TabList.js +0 -7
- package/dist/components/Tabs/TabPane.css.js +0 -3
- package/dist/components/Tabs/TabPanes.css.js +0 -3
- package/dist/components/Tabs/stories.js +0 -7
- package/dist/components/Text/stories.js +0 -10
- package/dist/components/Text/useTextStyles.css.js +0 -5
- package/dist/components/TextAreaInput/TextAreaInput.js +9 -13
- package/dist/components/TextAreaInput/stories.js +0 -20
- package/dist/components/TextBubble/TextBubble.css.js +0 -3
- package/dist/components/TextBubble/TextBubble.js +5 -13
- package/dist/components/TextBubble/stories.js +0 -5
- package/dist/components/TextContainer/TextContainer.js +0 -2
- package/dist/components/TextContainer/stories.js +0 -5
- package/dist/components/TextInput/TextInput.js +9 -14
- package/dist/components/TextInput/stories.js +0 -35
- package/dist/components/TextLink/TextLink.css.js +0 -3
- package/dist/components/TextLink/TextLink.js +9 -18
- package/dist/components/TextLink/stories.js +0 -6
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +0 -3
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +7 -15
- package/dist/components/Toaster/Toast.css.js +0 -3
- package/dist/components/Toaster/Toast.js +0 -27
- package/dist/components/Tooltip/Tooltip.css.js +0 -5
- package/dist/components/Tooltip/Tooltip.js +0 -1
- package/dist/components/Tooltip/stories.js +0 -5
- package/dist/components/VisuallyHidden/VisuallyHidden.css.js +0 -3
- package/dist/components/VisuallyHidden/stories.js +0 -5
- package/dist/components/private/CheckableBase/CheckableBase.css.js +0 -3
- package/dist/components/private/CheckableBase/CheckableBase.js +0 -2
- package/dist/components/private/InputBase/HintText.css.js +0 -3
- package/dist/components/private/InputBase/InputState.css.js +0 -3
- package/dist/components/private/InputBase/NotchedBase.css.js +0 -6
- package/dist/components/private/InputBase/NotchedBase.js +0 -1
- package/dist/components/private/InputBase/withEnhancedInput.css.js +0 -3
- package/dist/components/private/InputBase/withEnhancedInput.js +28 -39
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.css.js +0 -3
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +4 -12
- package/dist/hooks/useMedia/stories.js +0 -1
- package/dist/hooks/useMedia/useMedia.js +0 -4
- package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.css.js +0 -3
- package/dist/hooks/useNegativeMargin/useNegativeMarginTop.css.js +0 -3
- package/dist/hooks/useResponsiveValue/stories.js +0 -1
- package/dist/reset/globalFonts.css.js +0 -3
- package/dist/reset/globalReset.css.js +0 -3
- package/dist/reset/reset.css.js +0 -5
- package/dist/themes/base/tokens.js +0 -3
- package/dist/themes/base/vars.css.js +0 -3
- package/dist/themes/flat_red/tokens.js +0 -3
- package/dist/themes/flat_red/vars.css.js +0 -3
- package/dist/themes/helpers.js +0 -2
- package/dist/themes/makeTheme.js +0 -3
- package/dist/themes/neutral/tokens.js +0 -3
- package/dist/themes/neutral/vars.css.js +0 -3
- package/dist/themes/theme.css.js +0 -5
- package/dist/utils/index.js +0 -13
- package/dist/utils/mapTokenToProperty.js +0 -3
- package/dist/utils/resolveResponsiveProps.js +0 -6
- package/dist/utils/responsiveProps.css.js +0 -5
- package/dist/utils/responsiveStyle.js +0 -6
- package/package.json +1 -1
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
|
|
9
6
|
import * as React from 'react';
|
|
10
7
|
import { Button } from "../Button/index.js";
|
|
11
8
|
import { Actions } from "./index.js";
|
|
@@ -22,7 +19,6 @@ export default {
|
|
|
22
19
|
children: story()
|
|
23
20
|
})]
|
|
24
21
|
};
|
|
25
|
-
|
|
26
22
|
const template = args => _jsxs(Actions, _objectSpread(_objectSpread({}, args), {}, {
|
|
27
23
|
children: [_jsx(Button, {
|
|
28
24
|
children: "Login"
|
|
@@ -45,7 +41,6 @@ const template = args => _jsxs(Actions, _objectSpread(_objectSpread({}, args), {
|
|
|
45
41
|
children: "Action 4"
|
|
46
42
|
})]
|
|
47
43
|
}));
|
|
48
|
-
|
|
49
44
|
const standardProps = {
|
|
50
45
|
noWrap: false
|
|
51
46
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const intent: Record<"primary" | "secondary" | "shine" | "neutral" | "danger" | "warning" | "success" | "information", string>;
|
|
1
|
+
export declare const intentBox: string;
|
|
3
2
|
export declare const contained: string;
|
|
4
3
|
//# sourceMappingURL=Alert.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Alert.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,QAMpB,CAAC;AAEH,eAAO,MAAM,SAAS,QAGpB,CAAC"}
|
|
@@ -1,31 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
-
|
|
5
4
|
__vanilla_filescope__.setFileScope("lib/components/Alert/Alert.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
|
-
import { style, styleVariants } from '@vanilla-extract/css';
|
|
5
|
+
import { style } from '@vanilla-extract/css';
|
|
8
6
|
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
height: '100%',
|
|
17
|
-
content: '""'
|
|
18
|
-
}
|
|
19
|
-
}, "root");
|
|
20
|
-
export const intent = styleVariants(mapTokenToProperty(vars.colours.intent, value => ({
|
|
21
|
-
color: value.background.standard,
|
|
22
|
-
':before': {
|
|
23
|
-
backgroundColor: value.background.standard
|
|
24
|
-
}
|
|
25
|
-
}), ['neutral', 'shine', 'primary', 'secondary']), "intent");
|
|
7
|
+
export const intentBox = style({
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
top: 0,
|
|
10
|
+
left: 0,
|
|
11
|
+
width: vars.space['1'],
|
|
12
|
+
height: '100%'
|
|
13
|
+
}, "intentBox");
|
|
26
14
|
export const contained = style({
|
|
27
15
|
minWidth: '280px',
|
|
28
16
|
maxWidth: '640px'
|
|
29
17
|
}, "contained");
|
|
30
|
-
|
|
31
18
|
__vanilla_filescope__.endFileScope();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { backgroundColours } from '../Box/useBoxStyles.css';
|
|
2
3
|
import { Button } from '../Button';
|
|
3
|
-
|
|
4
|
-
declare type Intent = keyof Omit<typeof styles.intent, 'neutral' | 'shine' | 'primary' | 'secondary'>;
|
|
4
|
+
declare type Intent = keyof Pick<typeof backgroundColours, 'danger' | 'information' | 'success' | 'warning'>;
|
|
5
5
|
export interface Props {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOnC,aAAK,MAAM,GAAG,MAAM,IAAI,CACvB,OAAO,iBAAiB,EACxB,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAChD,CAAC;AAEF,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;CAC1D;AASD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAwE1C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -29,8 +29,11 @@ export const Alert = _ref => {
|
|
|
29
29
|
const dismissBtnStyles = useTextStyles({
|
|
30
30
|
colour: 'muted'
|
|
31
31
|
});
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const intentColourStyles = useTextStyles({
|
|
33
|
+
colour: intent
|
|
34
|
+
});
|
|
35
|
+
return _jsxs(Box, {
|
|
36
|
+
className: clsx(className, intentColourStyles, {
|
|
34
37
|
[styles.contained]: !inline
|
|
35
38
|
}),
|
|
36
39
|
role: "alert",
|
|
@@ -42,7 +45,10 @@ export const Alert = _ref => {
|
|
|
42
45
|
borderRadius: "1",
|
|
43
46
|
boxShadow: inline ? 'none' : '4',
|
|
44
47
|
padding: "2",
|
|
45
|
-
children:
|
|
48
|
+
children: [_jsx(Box, {
|
|
49
|
+
className: styles.intentBox,
|
|
50
|
+
backgroundColour: intent
|
|
51
|
+
}), _jsxs(Columns, {
|
|
46
52
|
noWrap: true,
|
|
47
53
|
spaceX: "2",
|
|
48
54
|
children: [_jsx(Column, {
|
|
@@ -83,7 +89,7 @@ export const Alert = _ref => {
|
|
|
83
89
|
})
|
|
84
90
|
})
|
|
85
91
|
})]
|
|
86
|
-
})
|
|
92
|
+
})]
|
|
87
93
|
});
|
|
88
94
|
};
|
|
89
95
|
export default Alert;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
|
|
9
6
|
import { action } from '@storybook/addon-actions';
|
|
10
7
|
import * as React from 'react';
|
|
11
8
|
import { Text } from "../Text/index.js";
|
|
@@ -26,7 +23,6 @@ export default {
|
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
25
|
};
|
|
29
|
-
|
|
30
26
|
const template = args => _jsx("div", {
|
|
31
27
|
style: {
|
|
32
28
|
display: 'grid',
|
|
@@ -45,7 +41,6 @@ const template = args => _jsx("div", {
|
|
|
45
41
|
}))
|
|
46
42
|
})
|
|
47
43
|
});
|
|
48
|
-
|
|
49
44
|
const templateAllIntents = args => _jsxs("div", {
|
|
50
45
|
style: {
|
|
51
46
|
display: 'grid',
|
|
@@ -89,7 +84,6 @@ const templateAllIntents = args => _jsxs("div", {
|
|
|
89
84
|
}))
|
|
90
85
|
})]
|
|
91
86
|
});
|
|
92
|
-
|
|
93
87
|
const standardProps = {
|
|
94
88
|
dismissible: void 0,
|
|
95
89
|
intent: void 0,
|
|
@@ -100,17 +94,13 @@ export const Standard = template.bind(standardProps);
|
|
|
100
94
|
Standard.args = standardProps;
|
|
101
95
|
export const StandardAllIntents = templateAllIntents.bind(standardProps);
|
|
102
96
|
StandardAllIntents.args = standardProps;
|
|
103
|
-
|
|
104
97
|
const inlineProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
105
98
|
inline: true
|
|
106
99
|
});
|
|
107
|
-
|
|
108
100
|
export const InlineAllIntents = templateAllIntents.bind(inlineProps);
|
|
109
101
|
InlineAllIntents.args = inlineProps;
|
|
110
|
-
|
|
111
102
|
const noneDismissibleProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
112
103
|
dismissible: false
|
|
113
104
|
});
|
|
114
|
-
|
|
115
105
|
export const NoneDismissibleAllIntents = templateAllIntents.bind(noneDismissibleProps);
|
|
116
106
|
NoneDismissibleAllIntents.args = noneDismissibleProps;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
-
|
|
5
4
|
__vanilla_filescope__.setFileScope("lib/components/Anchor/Anchor.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { style } from '@vanilla-extract/css';
|
|
8
6
|
export const root = style({
|
|
9
7
|
textDecoration: 'none',
|
|
10
8
|
cursor: 'pointer'
|
|
11
9
|
}, "root");
|
|
12
|
-
|
|
13
10
|
__vanilla_filescope__.endFileScope();
|
|
@@ -36,7 +36,6 @@ export const Anchor = _ref => {
|
|
|
36
36
|
target,
|
|
37
37
|
title
|
|
38
38
|
};
|
|
39
|
-
|
|
40
39
|
const childs = _jsxs(Inline, {
|
|
41
40
|
space: "2",
|
|
42
41
|
children: [icon && _jsx(Icon, {
|
|
@@ -50,7 +49,6 @@ export const Anchor = _ref => {
|
|
|
50
49
|
children: children
|
|
51
50
|
})]
|
|
52
51
|
});
|
|
53
|
-
|
|
54
52
|
return isValidElement(Component) ? cloneElement(Component, props, childs) : createElement(Component, props, childs);
|
|
55
53
|
};
|
|
56
54
|
export default Anchor;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
|
|
9
6
|
import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, MagnifyIcon, PhoneIcon, PlusIcon, StarIcon } from '@autoguru/icons';
|
|
10
7
|
import * as React from 'react';
|
|
11
8
|
import { Button } from "../Button/index.js";
|
|
@@ -49,26 +46,20 @@ export default {
|
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
};
|
|
52
|
-
|
|
53
49
|
const Template = args => _jsx(Anchor, _objectSpread({}, args));
|
|
54
|
-
|
|
55
50
|
const standardProps = {
|
|
56
51
|
href: 'tel:07 5612 5347',
|
|
57
52
|
children: '07 5612 5347'
|
|
58
53
|
};
|
|
59
54
|
export const standard = Template.bind(standardProps);
|
|
60
55
|
standard.args = standardProps;
|
|
61
|
-
|
|
62
56
|
const withIconProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
63
57
|
icon: PhoneIcon
|
|
64
58
|
});
|
|
65
|
-
|
|
66
59
|
export const withIcon = Template.bind(withIconProps);
|
|
67
60
|
withIcon.args = withIconProps;
|
|
68
|
-
|
|
69
61
|
const withButtonProps = _objectSpread(_objectSpread({}, withIconProps), {}, {
|
|
70
62
|
is: Button
|
|
71
63
|
});
|
|
72
|
-
|
|
73
64
|
export const withButton = Template.bind(withButtonProps);
|
|
74
65
|
withButton.args = withButtonProps;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
-
|
|
5
4
|
__vanilla_filescope__.setFileScope("lib/components/AutoSuggest/AutoSuggest.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { style, styleVariants } from '@vanilla-extract/css';
|
|
8
6
|
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
7
|
export const fullScreenRoot = style({
|
|
@@ -92,5 +90,4 @@ export const suggestionHighlight = style({
|
|
|
92
90
|
color: vars.typography.colour.information,
|
|
93
91
|
backgroundColor: vars.colours.background.light
|
|
94
92
|
}, "suggestionHighlight");
|
|
95
|
-
|
|
96
93
|
__vanilla_filescope__.endFileScope();
|
|
@@ -3,15 +3,12 @@
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
5
|
const _excluded = ["autoFocus", "autoWidth", "inlineOptions", "fieldIcon", "suggestions", "value", "onChange", "onEnter", "itemRenderer", "onBlur", "onFocus", "onKeyDown", "onClick"],
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
_excluded2 = ["closeModal"],
|
|
7
|
+
_excluded3 = ["inlineOptions", "noScroll", "isFocused", "size", "fieldIcon", "isLoading", "autoFocus", "autoWidth", "suggestions", "value", "onChange", "itemRenderer", "onBlur", "onFocus", "onKeyDown", "onClick", "className"],
|
|
8
|
+
_excluded4 = ["field", "eventHandlers", "validation", "suffixed", "prefixed", "isLoading", "fieldIcon", "isFocused", "className", "size"],
|
|
9
|
+
_excluded5 = ["onReset"];
|
|
11
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
|
|
13
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
-
|
|
15
12
|
import { ChevronDownIcon, CloseIcon } from '@autoguru/icons';
|
|
16
13
|
import { wrapEvent } from '@autoguru/utilities';
|
|
17
14
|
import clsx from 'clsx';
|
|
@@ -33,7 +30,6 @@ import { useLayoutSuggestionVisible } from "./useLayoutSuggestionVisible.js";
|
|
|
33
30
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
31
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
32
|
var ActionTypes;
|
|
36
|
-
|
|
37
33
|
(function (ActionTypes) {
|
|
38
34
|
ActionTypes[ActionTypes["INPUT_CHANGE"] = 0] = "INPUT_CHANGE";
|
|
39
35
|
ActionTypes[ActionTypes["INPUT_ESCAPE"] = 1] = "INPUT_ESCAPE";
|
|
@@ -46,7 +42,6 @@ var ActionTypes;
|
|
|
46
42
|
ActionTypes[ActionTypes["SUGGESTION_MOUSE_ENTER"] = 8] = "SUGGESTION_MOUSE_ENTER";
|
|
47
43
|
ActionTypes[ActionTypes["SUGGESTION_MOUSE_CLICK"] = 9] = "SUGGESTION_MOUSE_CLICK";
|
|
48
44
|
})(ActionTypes || (ActionTypes = {}));
|
|
49
|
-
|
|
50
45
|
const inputReducerFactory = suggestions => (prevState, action) => {
|
|
51
46
|
switch (action.type) {
|
|
52
47
|
default:
|
|
@@ -58,7 +53,6 @@ const inputReducerFactory = suggestions => (prevState, action) => {
|
|
|
58
53
|
previewText: null
|
|
59
54
|
};
|
|
60
55
|
}
|
|
61
|
-
|
|
62
56
|
case ActionTypes.FLYOUT_CLOSE:
|
|
63
57
|
case ActionTypes.SUGGESTION_MOUSE_CLICK:
|
|
64
58
|
case ActionTypes.INPUT_ESCAPE:
|
|
@@ -70,14 +64,12 @@ const inputReducerFactory = suggestions => (prevState, action) => {
|
|
|
70
64
|
previewText: null
|
|
71
65
|
};
|
|
72
66
|
}
|
|
73
|
-
|
|
74
67
|
case ActionTypes.INPUT_FOCUS:
|
|
75
68
|
{
|
|
76
69
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
77
70
|
isFlyoutOpen: suggestions.length > -1
|
|
78
71
|
});
|
|
79
72
|
}
|
|
80
|
-
|
|
81
73
|
case ActionTypes.INPUT_ARROW_DOWN:
|
|
82
74
|
{
|
|
83
75
|
const nextIndex = getNextIndex(1, prevState.highlightIndex, suggestions);
|
|
@@ -87,11 +79,9 @@ const inputReducerFactory = suggestions => (prevState, action) => {
|
|
|
87
79
|
previewText: nextIndex > -1 ? suggestions[nextIndex].text : null
|
|
88
80
|
};
|
|
89
81
|
}
|
|
90
|
-
|
|
91
82
|
case ActionTypes.INPUT_ARROW_UP:
|
|
92
83
|
{
|
|
93
84
|
const firstIndex = getNextIndex(1, -1, suggestions);
|
|
94
|
-
|
|
95
85
|
if (prevState.highlightIndex === firstIndex) {
|
|
96
86
|
return {
|
|
97
87
|
isFlyoutOpen: true,
|
|
@@ -99,7 +89,6 @@ const inputReducerFactory = suggestions => (prevState, action) => {
|
|
|
99
89
|
previewText: null
|
|
100
90
|
};
|
|
101
91
|
}
|
|
102
|
-
|
|
103
92
|
const nextIndex = getNextIndex(-1, prevState.highlightIndex, suggestions);
|
|
104
93
|
return {
|
|
105
94
|
isFlyoutOpen: true,
|
|
@@ -107,14 +96,12 @@ const inputReducerFactory = suggestions => (prevState, action) => {
|
|
|
107
96
|
previewText: nextIndex > -1 ? suggestions[nextIndex].text : null
|
|
108
97
|
};
|
|
109
98
|
}
|
|
110
|
-
|
|
111
99
|
case ActionTypes.SUGGESTION_MOUSE_ENTER:
|
|
112
100
|
{
|
|
113
101
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
114
102
|
highlightIndex: action.index
|
|
115
103
|
});
|
|
116
104
|
}
|
|
117
|
-
|
|
118
105
|
case ActionTypes.INPUT_ENTER:
|
|
119
106
|
{
|
|
120
107
|
if (prevState.highlightIndex > -1) {
|
|
@@ -124,30 +111,27 @@ const inputReducerFactory = suggestions => (prevState, action) => {
|
|
|
124
111
|
isFlyoutOpen: false
|
|
125
112
|
};
|
|
126
113
|
}
|
|
127
|
-
|
|
128
114
|
return prevState;
|
|
129
115
|
}
|
|
130
116
|
}
|
|
131
117
|
};
|
|
132
|
-
|
|
133
118
|
export const AutoSuggest = forwardRef(function AutoSuggest(_ref, ref) {
|
|
134
119
|
let {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
120
|
+
autoFocus = false,
|
|
121
|
+
autoWidth = false,
|
|
122
|
+
inlineOptions = false,
|
|
123
|
+
fieldIcon,
|
|
124
|
+
suggestions,
|
|
125
|
+
value: incomingValue,
|
|
126
|
+
onChange: incomingOnChange,
|
|
127
|
+
onEnter,
|
|
128
|
+
itemRenderer = defaultItemRenderer,
|
|
129
|
+
onBlur: incomingOnBlur,
|
|
130
|
+
onFocus: incomingOnFocus,
|
|
131
|
+
onKeyDown,
|
|
132
|
+
onClick
|
|
133
|
+
} = _ref,
|
|
134
|
+
textInputProps = _objectWithoutProperties(_ref, _excluded);
|
|
151
135
|
const inputRef = useRef();
|
|
152
136
|
const valueRef = useRef(incomingValue);
|
|
153
137
|
useImperativeHandle(ref, () => inputRef.current);
|
|
@@ -158,12 +142,10 @@ export const AutoSuggest = forwardRef(function AutoSuggest(_ref, ref) {
|
|
|
158
142
|
setShowModal(false);
|
|
159
143
|
setIsFocused(false);
|
|
160
144
|
}, [setShowModal]);
|
|
161
|
-
|
|
162
145
|
if (incomingValue && incomingValue !== valueRef.current) {
|
|
163
146
|
valueRef.current = incomingValue;
|
|
164
147
|
if (incomingValue.payload) closeModal();
|
|
165
148
|
}
|
|
166
|
-
|
|
167
149
|
const props = _objectSpread({
|
|
168
150
|
suggestions,
|
|
169
151
|
value: valueRef.current,
|
|
@@ -172,13 +154,11 @@ export const AutoSuggest = forwardRef(function AutoSuggest(_ref, ref) {
|
|
|
172
154
|
setShowModal(false);
|
|
173
155
|
if (!isDesktop) setIsFocused(false);
|
|
174
156
|
}
|
|
175
|
-
|
|
176
157
|
if (typeof incomingOnChange === 'function') incomingOnChange(value);
|
|
177
158
|
},
|
|
178
159
|
onKeyUp: event => {
|
|
179
160
|
if (event.key === 'Enter' && typeof onEnter === 'function') {
|
|
180
161
|
var _inputRef$current;
|
|
181
|
-
|
|
182
162
|
setShowModal(false);
|
|
183
163
|
setIsFocused(false);
|
|
184
164
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
|
|
@@ -194,7 +174,6 @@ export const AutoSuggest = forwardRef(function AutoSuggest(_ref, ref) {
|
|
|
194
174
|
}, incomingOnFocus),
|
|
195
175
|
onBlur: wrapEvent(() => setIsFocused(false), incomingOnBlur)
|
|
196
176
|
}, textInputProps);
|
|
197
|
-
|
|
198
177
|
return !inlineOptions && !isDesktop && showModal ? _jsx(AutoSuggestFullscreenInput, _objectSpread(_objectSpread({}, props), {}, {
|
|
199
178
|
attach: "NONE",
|
|
200
179
|
borderMerged: "NONE",
|
|
@@ -215,10 +194,9 @@ export const AutoSuggest = forwardRef(function AutoSuggest(_ref, ref) {
|
|
|
215
194
|
});
|
|
216
195
|
const AutoSuggestFullscreenInput = forwardRef(function AutoSuggestFullscreenInput(_ref2, ref) {
|
|
217
196
|
let {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
197
|
+
closeModal
|
|
198
|
+
} = _ref2,
|
|
199
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
222
200
|
const [showPortal, setShowPortal] = useState(false);
|
|
223
201
|
useWindowScrollLock();
|
|
224
202
|
useEffect(() => {
|
|
@@ -251,28 +229,26 @@ const AutoSuggestFullscreenInput = forwardRef(function AutoSuggestFullscreenInpu
|
|
|
251
229
|
});
|
|
252
230
|
const AutoSuggestInput = forwardRef(function AutoSuggestInput(_ref3, ref) {
|
|
253
231
|
var _state$previewText;
|
|
254
|
-
|
|
255
232
|
let {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
233
|
+
inlineOptions = false,
|
|
234
|
+
noScroll = false,
|
|
235
|
+
isFocused = false,
|
|
236
|
+
size,
|
|
237
|
+
fieldIcon,
|
|
238
|
+
isLoading,
|
|
239
|
+
autoFocus,
|
|
240
|
+
autoWidth,
|
|
241
|
+
suggestions,
|
|
242
|
+
value,
|
|
243
|
+
onChange,
|
|
244
|
+
itemRenderer = defaultItemRenderer,
|
|
245
|
+
onBlur,
|
|
246
|
+
onFocus,
|
|
247
|
+
onKeyDown,
|
|
248
|
+
onClick,
|
|
249
|
+
className
|
|
250
|
+
} = _ref3,
|
|
251
|
+
textInputProps = _objectWithoutProperties(_ref3, _excluded3);
|
|
276
252
|
const triggerRef = useRef(null);
|
|
277
253
|
const highlightRef = useRef(null);
|
|
278
254
|
const suggestionListRef = useRef(null);
|
|
@@ -333,7 +309,6 @@ const AutoSuggestInput = forwardRef(function AutoSuggestInput(_ref3, ref) {
|
|
|
333
309
|
}), onFocus),
|
|
334
310
|
onBlur: wrapEvent(() => {
|
|
335
311
|
var _suggestions$state$hi;
|
|
336
|
-
|
|
337
312
|
if (state.highlightIndex > -1 && state.highlightIndex && state.previewText === ((_suggestions$state$hi = suggestions[state.highlightIndex]) === null || _suggestions$state$hi === void 0 ? void 0 : _suggestions$state$hi.text) && typeof onChange === 'function') onChange(suggestions[state.highlightIndex]);
|
|
338
313
|
dispatch({
|
|
339
314
|
type: ActionTypes.INPUT_BLUR
|
|
@@ -350,20 +325,17 @@ const AutoSuggestInput = forwardRef(function AutoSuggestInput(_ref3, ref) {
|
|
|
350
325
|
});
|
|
351
326
|
return;
|
|
352
327
|
}
|
|
353
|
-
|
|
354
328
|
case 'Enter':
|
|
355
329
|
{
|
|
356
330
|
if (state.highlightIndex > -1) {
|
|
357
331
|
event.preventDefault();
|
|
358
332
|
if (typeof onChange === 'function') onChange(suggestions[state.highlightIndex]);
|
|
359
333
|
}
|
|
360
|
-
|
|
361
334
|
dispatch({
|
|
362
335
|
type: ActionTypes.INPUT_ENTER
|
|
363
336
|
});
|
|
364
337
|
return;
|
|
365
338
|
}
|
|
366
|
-
|
|
367
339
|
case 'Escape':
|
|
368
340
|
{
|
|
369
341
|
dispatch({
|
|
@@ -406,7 +378,6 @@ const AutoSuggestInput = forwardRef(function AutoSuggestInput(_ref3, ref) {
|
|
|
406
378
|
})]
|
|
407
379
|
});
|
|
408
380
|
});
|
|
409
|
-
|
|
410
381
|
const SuggestionsList = _ref4 => {
|
|
411
382
|
let {
|
|
412
383
|
className = '',
|
|
@@ -468,35 +439,30 @@ const SuggestionsList = _ref4 => {
|
|
|
468
439
|
})]
|
|
469
440
|
});
|
|
470
441
|
};
|
|
471
|
-
|
|
472
442
|
const AutoSuggestInputPrimitive = withEnhancedInput(_ref5 => {
|
|
473
443
|
let {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
444
|
+
field,
|
|
445
|
+
eventHandlers,
|
|
446
|
+
validation,
|
|
447
|
+
suffixed,
|
|
448
|
+
prefixed,
|
|
449
|
+
isLoading,
|
|
450
|
+
fieldIcon = ChevronDownIcon,
|
|
451
|
+
isFocused,
|
|
452
|
+
className,
|
|
453
|
+
size
|
|
454
|
+
} = _ref5,
|
|
455
|
+
rest = _objectWithoutProperties(_ref5, _excluded4);
|
|
487
456
|
let focusTimeout;
|
|
488
457
|
const ref = useRef(null);
|
|
489
458
|
const focusHandler = useCallback(() => {
|
|
490
459
|
var _ref$current;
|
|
491
|
-
|
|
492
460
|
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
|
493
461
|
}, []);
|
|
494
|
-
|
|
495
462
|
const {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
463
|
+
onReset
|
|
464
|
+
} = eventHandlers,
|
|
465
|
+
inputEventHandlers = _objectWithoutProperties(eventHandlers, _excluded5);
|
|
500
466
|
const handleRef = useCallback(node => {
|
|
501
467
|
if (field.ref) setRef(field.ref, node);
|
|
502
468
|
setRef(ref, node);
|
|
@@ -505,7 +471,6 @@ const AutoSuggestInputPrimitive = withEnhancedInput(_ref5 => {
|
|
|
505
471
|
if (typeof onReset === 'function') onReset();
|
|
506
472
|
focusTimeout = setTimeout(() => {
|
|
507
473
|
var _ref$current2;
|
|
508
|
-
|
|
509
474
|
return (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
|
510
475
|
}, 100);
|
|
511
476
|
}, [onReset, focusTimeout]);
|
|
@@ -553,9 +518,7 @@ const AutoSuggestInputPrimitive = withEnhancedInput(_ref5 => {
|
|
|
553
518
|
withPrefixIcon: true,
|
|
554
519
|
withSuffixIcon: false
|
|
555
520
|
});
|
|
556
|
-
|
|
557
521
|
const getSuggestionId = (id, index) => "".concat(id, "-option-").concat(index);
|
|
558
|
-
|
|
559
522
|
const SuggestionListFlyout = _ref6 => {
|
|
560
523
|
let {
|
|
561
524
|
id,
|
|
@@ -587,7 +550,6 @@ const SuggestionListFlyout = _ref6 => {
|
|
|
587
550
|
})
|
|
588
551
|
});
|
|
589
552
|
};
|
|
590
|
-
|
|
591
553
|
const defaultItemRenderer = _ref7 => {
|
|
592
554
|
let {
|
|
593
555
|
value,
|
|
@@ -598,7 +560,6 @@ const defaultItemRenderer = _ref7 => {
|
|
|
598
560
|
text: value.text
|
|
599
561
|
});
|
|
600
562
|
};
|
|
601
|
-
|
|
602
563
|
const DefaultSuggestion = _ref8 => {
|
|
603
564
|
let {
|
|
604
565
|
text,
|
|
@@ -614,30 +575,23 @@ const DefaultSuggestion = _ref8 => {
|
|
|
614
575
|
})
|
|
615
576
|
});
|
|
616
577
|
};
|
|
617
|
-
|
|
618
578
|
const getNextIndex = (direction, currentIndex, suggestions) => {
|
|
619
579
|
if (!Array.isArray(suggestions) || suggestions.length === 0) return -1;
|
|
620
580
|
const maxIndex = suggestions.length - 1;
|
|
621
581
|
let itter = -1;
|
|
622
582
|
let returnIdx = -1;
|
|
623
583
|
let shouldSkip;
|
|
624
|
-
|
|
625
584
|
do {
|
|
626
585
|
var _suggestions$returnId, _suggestions$returnId2;
|
|
627
|
-
|
|
628
586
|
++itter;
|
|
629
587
|
const maybeNextIdx = Math.trunc((returnIdx === -1 ? currentIndex : returnIdx) + direction);
|
|
630
|
-
|
|
631
588
|
if (maybeNextIdx < 0) {
|
|
632
589
|
returnIdx = maybeNextIdx > maxIndex ? 0 : maxIndex;
|
|
633
590
|
} else {
|
|
634
591
|
returnIdx = maybeNextIdx > maxIndex ? 0 : maybeNextIdx;
|
|
635
592
|
}
|
|
636
|
-
|
|
637
593
|
shouldSkip = (_suggestions$returnId = (_suggestions$returnId2 = suggestions[returnIdx]) === null || _suggestions$returnId2 === void 0 ? void 0 : _suggestions$returnId2.skip) !== null && _suggestions$returnId !== void 0 ? _suggestions$returnId : false;
|
|
638
594
|
} while (shouldSkip && itter <= maxIndex);
|
|
639
|
-
|
|
640
595
|
return itter > maxIndex ? -1 : returnIdx;
|
|
641
596
|
};
|
|
642
|
-
|
|
643
597
|
export default AutoSuggest;
|