@autoguru/overdrive 4.11.2 → 4.11.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/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 +1 -31
- 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.d.ts +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 +1 -26
- package/dist/components/Columns/Column.css.js +0 -5
- package/dist/components/Columns/Column.d.ts +1 -1
- package/dist/components/Columns/Column.js +10 -14
- package/dist/components/Columns/Columns.css.js +0 -3
- package/dist/components/Columns/Columns.d.ts +1 -1
- 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 +1 -28
- 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 +1 -9
- 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 +1 -28
- 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 +1 -13
- 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 +1 -26
- 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 +1 -23
- 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 +1 -38
- 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/ThemeProvider/ThemeProvider.d.ts +5 -4
- package/dist/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- 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/index.d.ts +177 -177
- package/dist/themes/base/tokens.js +0 -3
- package/dist/themes/base/vars.css.js +0 -3
- package/dist/themes/flat_red/index.d.ts +177 -177
- 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/index.d.ts +177 -177
- package/dist/themes/neutral/tokens.js +0 -3
- package/dist/themes/neutral/vars.css.js +0 -3
- package/dist/themes/theme.css.d.ts +177 -177
- package/dist/themes/theme.css.d.ts.map +1 -1
- package/dist/themes/theme.css.js +0 -5
- package/dist/themes/tokens.d.ts +3 -1
- package/dist/themes/tokens.d.ts.map +1 -1
- 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.d.ts +2 -2
- package/dist/utils/responsiveStyle.d.ts.map +1 -1
- package/dist/utils/responsiveStyle.js +0 -6
- package/package.json +1 -1
- package/readme.md +1 -2
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
|
|
5
4
|
var _document;
|
|
6
|
-
|
|
7
5
|
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; }
|
|
8
|
-
|
|
9
6
|
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; }
|
|
10
|
-
|
|
11
7
|
import * as React from 'react';
|
|
12
8
|
import { Heading } from "../Heading/index.js";
|
|
13
9
|
import { Stack } from "../Stack/index.js";
|
|
@@ -36,12 +32,10 @@ export default {
|
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
34
|
};
|
|
39
|
-
|
|
40
35
|
const StandardTemplate = function () {
|
|
41
36
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
37
|
args[_key] = arguments[_key];
|
|
43
38
|
}
|
|
44
|
-
|
|
45
39
|
return _jsx(Portal, _objectSpread(_objectSpread({}, args), {}, {
|
|
46
40
|
children: _jsx(Text, {
|
|
47
41
|
colour: "primary",
|
|
@@ -49,12 +43,10 @@ const StandardTemplate = function () {
|
|
|
49
43
|
})
|
|
50
44
|
}));
|
|
51
45
|
};
|
|
52
|
-
|
|
53
46
|
const NestedTemplate = function () {
|
|
54
47
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
55
48
|
args[_key2] = arguments[_key2];
|
|
56
49
|
}
|
|
57
|
-
|
|
58
50
|
return _jsx(Portal, _objectSpread(_objectSpread({}, args), {}, {
|
|
59
51
|
children: _jsxs(Stack, {
|
|
60
52
|
space: "5",
|
|
@@ -71,7 +63,6 @@ const NestedTemplate = function () {
|
|
|
71
63
|
})
|
|
72
64
|
}));
|
|
73
65
|
};
|
|
74
|
-
|
|
75
66
|
const standardProps = {
|
|
76
67
|
container: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementsByTagName('body')[0]
|
|
77
68
|
};
|
|
@@ -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/Positioner/Positioner.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { style } from '@vanilla-extract/css';
|
|
8
6
|
export const root = style({
|
|
9
7
|
zIndex: 1050,
|
|
@@ -12,5 +10,4 @@ export const root = style({
|
|
|
12
10
|
transform: 'translateZ(0)',
|
|
13
11
|
willChange: 'transform'
|
|
14
12
|
}, "root");
|
|
15
|
-
|
|
16
13
|
__vanilla_filescope__.endFileScope();
|
|
@@ -4,11 +4,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
6
6
|
const _excluded = ["alignment", "isOpen", "triggerRef", "triggerOffset", "children"];
|
|
7
|
-
|
|
8
7
|
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; }
|
|
9
|
-
|
|
10
8
|
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; }
|
|
11
|
-
|
|
12
9
|
import { flip, offset, popperGenerator, preventOverflow } from '@popperjs/core';
|
|
13
10
|
import { defaultModifiers } from '@popperjs/core/lib/popper';
|
|
14
11
|
import * as React from 'react';
|
|
@@ -34,14 +31,13 @@ const createPopper = popperGenerator({
|
|
|
34
31
|
});
|
|
35
32
|
export const Positioner = _ref => {
|
|
36
33
|
let {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
alignment = EAlignment.BOTTOM_LEFT,
|
|
35
|
+
isOpen = false,
|
|
36
|
+
triggerRef,
|
|
37
|
+
triggerOffset = 12,
|
|
38
|
+
children
|
|
39
|
+
} = _ref,
|
|
40
|
+
boxProps = _objectWithoutProperties(_ref, _excluded);
|
|
45
41
|
if (!isBrowser) return null;
|
|
46
42
|
const placement = convertPlacement(alignment);
|
|
47
43
|
const referenceRef = useRef(null);
|
|
@@ -65,13 +61,11 @@ export const Positioner = _ref => {
|
|
|
65
61
|
});
|
|
66
62
|
setRef(popperInstanceRef, popper);
|
|
67
63
|
}, [isOpen, placement, triggerOffset]);
|
|
68
|
-
|
|
69
64
|
const handleClose = () => {
|
|
70
65
|
if (!popperInstanceRef.current) return;
|
|
71
66
|
popperInstanceRef.current.destroy();
|
|
72
67
|
setRef(popperInstanceRef, null);
|
|
73
68
|
};
|
|
74
|
-
|
|
75
69
|
useEffect(() => {
|
|
76
70
|
handleOpen();
|
|
77
71
|
}, [handleOpen]);
|
|
@@ -95,24 +89,18 @@ export const Positioner = _ref => {
|
|
|
95
89
|
}))
|
|
96
90
|
});
|
|
97
91
|
};
|
|
98
|
-
|
|
99
92
|
const convertPlacement = alignment => {
|
|
100
93
|
switch (alignment) {
|
|
101
94
|
case EAlignment.BOTTOM_LEFT:
|
|
102
95
|
return 'bottom-start';
|
|
103
|
-
|
|
104
96
|
case EAlignment.BOTTOM_RIGHT:
|
|
105
97
|
return 'bottom-end';
|
|
106
|
-
|
|
107
98
|
case EAlignment.TOP_LEFT:
|
|
108
99
|
return 'top-start';
|
|
109
|
-
|
|
110
100
|
case EAlignment.TOP_RIGHT:
|
|
111
101
|
return 'top-end';
|
|
112
|
-
|
|
113
102
|
default:
|
|
114
103
|
return alignment;
|
|
115
104
|
}
|
|
116
105
|
};
|
|
117
|
-
|
|
118
106
|
export default Positioner;
|
|
@@ -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 isChromatic from 'chromatic/isChromatic';
|
|
10
7
|
import * as React from 'react';
|
|
11
8
|
import { useRef } from 'react';
|
|
@@ -20,9 +17,7 @@ export default {
|
|
|
20
17
|
title: 'Utility/Positioner',
|
|
21
18
|
component: Positioner,
|
|
22
19
|
parameters: {
|
|
23
|
-
chromatic: {
|
|
24
|
-
delay: 3000
|
|
25
|
-
}
|
|
20
|
+
chromatic: {}
|
|
26
21
|
},
|
|
27
22
|
argTypes: {
|
|
28
23
|
alignment: {
|
|
@@ -41,7 +36,6 @@ export default {
|
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
38
|
};
|
|
44
|
-
|
|
45
39
|
const Template = args => {
|
|
46
40
|
const triggerRef = useRef(null);
|
|
47
41
|
return _jsxs("div", {
|
|
@@ -66,7 +60,6 @@ const Template = args => {
|
|
|
66
60
|
}))]
|
|
67
61
|
});
|
|
68
62
|
};
|
|
69
|
-
|
|
70
63
|
const WithScrollTemplate = args => {
|
|
71
64
|
const triggerRef = useRef(null);
|
|
72
65
|
return _jsx("div", {
|
|
@@ -107,7 +100,6 @@ const WithScrollTemplate = args => {
|
|
|
107
100
|
})
|
|
108
101
|
});
|
|
109
102
|
};
|
|
110
|
-
|
|
111
103
|
const standardProps = {
|
|
112
104
|
alignment: EAlignment.BOTTOM_LEFT,
|
|
113
105
|
isOpen: false,
|
|
@@ -115,18 +107,14 @@ const standardProps = {
|
|
|
115
107
|
};
|
|
116
108
|
export const closed = Template.bind(standardProps);
|
|
117
109
|
closed.args = standardProps;
|
|
118
|
-
|
|
119
110
|
const openProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
120
111
|
isOpen: true
|
|
121
112
|
});
|
|
122
|
-
|
|
123
113
|
export const open = Template.bind(openProps);
|
|
124
114
|
open.args = openProps;
|
|
125
|
-
|
|
126
115
|
const illustrateAScrollProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
127
116
|
isOpen: true
|
|
128
117
|
});
|
|
129
|
-
|
|
130
118
|
export const illustrateAScroll = WithScrollTemplate.bind(illustrateAScrollProps);
|
|
131
119
|
illustrateAScroll.args = openProps;
|
|
132
120
|
illustrateAScroll.parameters = {
|
|
@@ -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/ProgressBar/ProgressBar.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { style } from '@vanilla-extract/css';
|
|
8
6
|
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
7
|
export const container = style({
|
|
@@ -13,5 +11,4 @@ export const bar = style({
|
|
|
13
11
|
transition: "width 0.2s ".concat(vars.animation.easing.standard, " 0s"),
|
|
14
12
|
willChange: 'width'
|
|
15
13
|
}, "bar");
|
|
16
|
-
|
|
17
14
|
__vanilla_filescope__.endFileScope();
|
|
@@ -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 { Stack } from "../Stack/index.js";
|
|
11
8
|
import { ProgressBar } from "./index.js";
|
|
@@ -15,9 +12,7 @@ export default {
|
|
|
15
12
|
title: 'Components/Progress/ProgressBar',
|
|
16
13
|
component: ProgressBar
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
const Template = args => _jsx(ProgressBar, _objectSpread({}, args));
|
|
20
|
-
|
|
21
16
|
const AllColoursTemplate = args => _jsxs(Stack, {
|
|
22
17
|
space: "2",
|
|
23
18
|
children: [_jsx(ProgressBar, _objectSpread({
|
|
@@ -37,7 +32,6 @@ const AllColoursTemplate = args => _jsxs(Stack, {
|
|
|
37
32
|
colour: "yellow"
|
|
38
33
|
}, args))]
|
|
39
34
|
});
|
|
40
|
-
|
|
41
35
|
const standardProps = {};
|
|
42
36
|
export const standard = Template.bind(standardProps);
|
|
43
37
|
standard.args = standardProps;
|
|
@@ -1,14 +1,11 @@
|
|
|
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/ProgressBarGroup/ProgressBarGroup.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { style } from '@vanilla-extract/css';
|
|
8
6
|
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
7
|
export const root = style({
|
|
10
8
|
display: 'grid',
|
|
11
9
|
gridGap: "".concat(vars.space['1'], " ").concat(vars.space['5'])
|
|
12
10
|
}, "root");
|
|
13
|
-
|
|
14
11
|
__vanilla_filescope__.endFileScope();
|
|
@@ -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 { ProgressBarGroup } from "./index.js";
|
|
11
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -13,9 +10,7 @@ export default {
|
|
|
13
10
|
title: 'Components/Progress/ProgressBarGroup',
|
|
14
11
|
component: ProgressBarGroup
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
const Template = args => _jsx(ProgressBarGroup, _objectSpread({}, args));
|
|
18
|
-
|
|
19
14
|
const values = [48, 16, 24, 0, 3];
|
|
20
15
|
const standardProps = {
|
|
21
16
|
values,
|
|
@@ -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/ProgressSpinner/ProgressSpinner.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { keyframes, style, styleVariants } from '@vanilla-extract/css';
|
|
8
6
|
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
7
|
const spinAnim = keyframes({
|
|
@@ -87,5 +85,4 @@ export const size = {
|
|
|
87
85
|
}
|
|
88
86
|
}, "size_large")
|
|
89
87
|
};
|
|
90
|
-
|
|
91
88
|
__vanilla_filescope__.endFileScope();
|
|
@@ -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 { ProgressSpinner } from "./index.js";
|
|
11
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -33,9 +30,7 @@ export const Standard = () => _jsx(ProgressSpinner, {
|
|
|
33
30
|
colour: "primary",
|
|
34
31
|
size: "medium"
|
|
35
32
|
});
|
|
36
|
-
|
|
37
33
|
const Template = args => _jsx(ProgressSpinner, _objectSpread({}, args));
|
|
38
|
-
|
|
39
34
|
const standardProps = {};
|
|
40
35
|
export const standard = Template.bind(standardProps);
|
|
41
36
|
standard.args = standardProps;
|
|
@@ -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/Radio/Radio.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { styleVariants } from '@vanilla-extract/css';
|
|
8
6
|
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
7
|
export const circle = styleVariants({
|
|
@@ -29,5 +27,4 @@ export const circle = styleVariants({
|
|
|
29
27
|
borderColor: vars.typography.colour.primary
|
|
30
28
|
}
|
|
31
29
|
}, "circle");
|
|
32
|
-
|
|
33
30
|
__vanilla_filescope__.endFileScope();
|
|
@@ -22,13 +22,10 @@ export const Radio = forwardRef((_ref, ref) => {
|
|
|
22
22
|
} = useCheckableStyles();
|
|
23
23
|
const radioContext = useRadioContext();
|
|
24
24
|
const isChecked = value === radioContext.value;
|
|
25
|
-
|
|
26
25
|
const handleClick = () => {
|
|
27
26
|
var _radioContext$radioSe;
|
|
28
|
-
|
|
29
27
|
return (_radioContext$radioSe = radioContext.radioSelected) === null || _radioContext$radioSe === void 0 ? void 0 : _radioContext$radioSe.call(radioContext, value);
|
|
30
28
|
};
|
|
31
|
-
|
|
32
29
|
return _jsxs(CheckableBase, {
|
|
33
30
|
ref: ref,
|
|
34
31
|
inputType: "radio",
|
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
const _excluded = ["value", "children"],
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
_excluded2 = ["value"];
|
|
8
7
|
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; }
|
|
9
|
-
|
|
10
8
|
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; }
|
|
11
|
-
|
|
12
9
|
import * as React from 'react';
|
|
13
10
|
import { Badge } from "../Badge/index.js";
|
|
14
11
|
import { Heading } from "../Heading/index.js";
|
|
@@ -55,11 +52,10 @@ const argTypes = {
|
|
|
55
52
|
};
|
|
56
53
|
export const list = _ref => {
|
|
57
54
|
let {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
value,
|
|
56
|
+
children
|
|
57
|
+
} = _ref,
|
|
58
|
+
args = _objectWithoutProperties(_ref, _excluded);
|
|
63
59
|
return _jsx(RadioGroup, {
|
|
64
60
|
value: value,
|
|
65
61
|
name: "favourite fruit",
|
|
@@ -76,13 +72,11 @@ list.args = {
|
|
|
76
72
|
disabled: false
|
|
77
73
|
};
|
|
78
74
|
list.argTypes = argTypes;
|
|
79
|
-
|
|
80
75
|
const Template = _ref2 => {
|
|
81
76
|
let {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
value
|
|
78
|
+
} = _ref2,
|
|
79
|
+
args = _objectWithoutProperties(_ref2, _excluded2);
|
|
86
80
|
return _jsx(RadioGroup, {
|
|
87
81
|
value: value,
|
|
88
82
|
name: "favourite fruit",
|
|
@@ -91,7 +85,6 @@ const Template = _ref2 => {
|
|
|
91
85
|
}, args))
|
|
92
86
|
});
|
|
93
87
|
};
|
|
94
|
-
|
|
95
88
|
const uncheckedProps = {
|
|
96
89
|
disabled: false,
|
|
97
90
|
children: 'check me!',
|
|
@@ -124,7 +117,6 @@ const multipleLinesProps = {
|
|
|
124
117
|
children: 'There is a very good reason why this thing is a multi-line, sometimes we need to show people a lot of things. And thus this exists.',
|
|
125
118
|
value: 'berry'
|
|
126
119
|
};
|
|
127
|
-
|
|
128
120
|
const Item = _ref3 => {
|
|
129
121
|
let {
|
|
130
122
|
label,
|
|
@@ -143,7 +135,6 @@ const Item = _ref3 => {
|
|
|
143
135
|
})]
|
|
144
136
|
});
|
|
145
137
|
};
|
|
146
|
-
|
|
147
138
|
const withComponentProps = {
|
|
148
139
|
disabled: false,
|
|
149
140
|
children: _jsx(Item, {
|
|
@@ -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/Section/Section.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
|
import { mapTokenToProperty } from "../../utils/mapTokenToProperty.js";
|
|
@@ -11,5 +9,4 @@ export const root = style({
|
|
|
11
9
|
margin: '0 auto'
|
|
12
10
|
}, "root");
|
|
13
11
|
export const width = styleVariants(mapTokenToProperty(vars.contentWidth, 'maxWidth'), "width");
|
|
14
|
-
|
|
15
12
|
__vanilla_filescope__.endFileScope();
|
|
@@ -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 { Box } from "../Box/index.js";
|
|
11
8
|
import { boxArgTypes } from "../Box/argTypes.js";
|
|
@@ -19,7 +16,6 @@ export default {
|
|
|
19
16
|
paddingX: boxArgTypes.paddingX
|
|
20
17
|
}
|
|
21
18
|
};
|
|
22
|
-
|
|
23
19
|
const template = args => _jsxs(Section, _objectSpread(_objectSpread({}, args), {}, {
|
|
24
20
|
children: [_jsx(Box, _objectSpread(_objectSpread({}, boxPropsProps), {}, {
|
|
25
21
|
children: "Box 1"
|
|
@@ -27,7 +23,6 @@ const template = args => _jsxs(Section, _objectSpread(_objectSpread({}, args), {
|
|
|
27
23
|
children: "Box 2"
|
|
28
24
|
}))]
|
|
29
25
|
}));
|
|
30
|
-
|
|
31
26
|
const boxPropsProps = {
|
|
32
27
|
width: 'full',
|
|
33
28
|
borderColour: 'dark',
|
|
@@ -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/SelectInput/SelectInput.css.ts", "@autoguru/overdrive");
|
|
6
|
-
|
|
7
5
|
import { style } from '@vanilla-extract/css';
|
|
8
6
|
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
7
|
export const input = style({}, "input");
|
|
@@ -18,5 +16,4 @@ export const arrow = style({
|
|
|
18
16
|
top: '0',
|
|
19
17
|
right: '0'
|
|
20
18
|
}, "arrow");
|
|
21
|
-
|
|
22
19
|
__vanilla_filescope__.endFileScope();
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
const _excluded = ["field", "eventHandlers", "suffixed", "prefixed", "validation", "isLoading", "size", "fieldIcon"];
|
|
6
|
-
|
|
7
6
|
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; }
|
|
8
|
-
|
|
9
7
|
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; }
|
|
10
|
-
|
|
11
8
|
import { ChevronDownIcon } from '@autoguru/icons';
|
|
12
9
|
import * as React from 'react';
|
|
13
10
|
import { Box } from "../Box/index.js";
|
|
@@ -18,17 +15,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
18
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
16
|
export const SelectInput = withEnhancedInput(_ref => {
|
|
20
17
|
let {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
field,
|
|
19
|
+
eventHandlers,
|
|
20
|
+
suffixed,
|
|
21
|
+
prefixed,
|
|
22
|
+
validation,
|
|
23
|
+
isLoading,
|
|
24
|
+
size,
|
|
25
|
+
fieldIcon = ChevronDownIcon
|
|
26
|
+
} = _ref,
|
|
27
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
28
|
return _jsxs(Box, {
|
|
33
29
|
display: "flex",
|
|
34
30
|
flexWrap: "nowrap",
|
|
@@ -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, PlusIcon, StarIcon } from '@autoguru/icons';
|
|
10
7
|
import { action } from '@storybook/addon-actions';
|
|
11
8
|
import * as React from 'react';
|
|
@@ -21,9 +18,7 @@ export default {
|
|
|
21
18
|
title: 'Components/Inputs/Select',
|
|
22
19
|
component: SelectInput,
|
|
23
20
|
parameters: {
|
|
24
|
-
chromatic: {
|
|
25
|
-
delay: 3000
|
|
26
|
-
}
|
|
21
|
+
chromatic: {}
|
|
27
22
|
}
|
|
28
23
|
};
|
|
29
24
|
const defaultValue = valueOptions[4];
|
|
@@ -72,14 +67,12 @@ const argTypes = {
|
|
|
72
67
|
}
|
|
73
68
|
}
|
|
74
69
|
};
|
|
75
|
-
|
|
76
70
|
const Template = args => _jsxs(SelectInput, _objectSpread(_objectSpread({}, args), {}, {
|
|
77
71
|
children: [_jsx("option", {
|
|
78
72
|
disabled: true,
|
|
79
73
|
children: "Select an option"
|
|
80
74
|
}), selectOptions]
|
|
81
75
|
}));
|
|
82
|
-
|
|
83
76
|
const sharedProps = {
|
|
84
77
|
disabled: false,
|
|
85
78
|
name: 'text',
|
|
@@ -97,56 +90,46 @@ const sharedProps = {
|
|
|
97
90
|
onBlur: action('onBlur')
|
|
98
91
|
};
|
|
99
92
|
const standardProps = sharedProps;
|
|
100
|
-
|
|
101
93
|
const withAValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
102
94
|
value: defaultValue,
|
|
103
95
|
placeholder: defaultPlaceholder
|
|
104
96
|
});
|
|
105
|
-
|
|
106
97
|
const withHintTextProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
107
98
|
hintText: 'Hint Text',
|
|
108
99
|
placeholder: defaultPlaceholder
|
|
109
100
|
});
|
|
110
|
-
|
|
111
101
|
const withPrefixIconProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
112
102
|
prefixIcon: CarIcon
|
|
113
103
|
});
|
|
114
|
-
|
|
115
104
|
const disabledProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
116
105
|
value: defaultValue,
|
|
117
106
|
placeholder: defaultPlaceholder,
|
|
118
107
|
disabled: true
|
|
119
108
|
});
|
|
120
|
-
|
|
121
109
|
const validProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
122
110
|
value: defaultValue,
|
|
123
111
|
placeholder: defaultPlaceholder,
|
|
124
112
|
isTouched: true,
|
|
125
113
|
isValid: true
|
|
126
114
|
});
|
|
127
|
-
|
|
128
115
|
const invalidProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
129
116
|
placeholder: defaultPlaceholder,
|
|
130
117
|
isTouched: true,
|
|
131
118
|
isValid: false,
|
|
132
119
|
hintText: 'Vehicle make is mandatory'
|
|
133
120
|
});
|
|
134
|
-
|
|
135
121
|
const noNotchProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
136
122
|
placeholder: defaultPlaceholder,
|
|
137
123
|
notch: false
|
|
138
124
|
});
|
|
139
|
-
|
|
140
125
|
const noNotchWithValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
141
126
|
value: defaultValue,
|
|
142
127
|
placeholder: defaultPlaceholder,
|
|
143
128
|
notch: false
|
|
144
129
|
});
|
|
145
|
-
|
|
146
130
|
const loadingProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
147
131
|
isLoading: true
|
|
148
132
|
});
|
|
149
|
-
|
|
150
133
|
export const standard = Template.bind(standardProps);
|
|
151
134
|
standard.args = standardProps;
|
|
152
135
|
standard.argTypes = argTypes;
|
|
@@ -177,37 +160,29 @@ invalid.argTypes = argTypes;
|
|
|
177
160
|
export const loading = Template.bind(loadingProps);
|
|
178
161
|
loading.args = loadingProps;
|
|
179
162
|
loading.argTypes = argTypes;
|
|
180
|
-
|
|
181
163
|
const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
182
164
|
size: 'small'
|
|
183
165
|
});
|
|
184
|
-
|
|
185
166
|
export const small = Template.bind(smallProps);
|
|
186
167
|
small.args = smallProps;
|
|
187
168
|
small.argTypes = argTypes;
|
|
188
|
-
|
|
189
169
|
const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
|
|
190
170
|
size: 'small'
|
|
191
171
|
});
|
|
192
|
-
|
|
193
172
|
export const withValueSmall = Template.bind(withValueSmallProps);
|
|
194
173
|
withValueSmall.args = withValueSmallProps;
|
|
195
174
|
withValueSmall.argTypes = argTypes;
|
|
196
|
-
|
|
197
175
|
const withIconSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
|
|
198
176
|
prefixIcon: CarIcon,
|
|
199
177
|
size: 'small'
|
|
200
178
|
});
|
|
201
|
-
|
|
202
179
|
export const withIconSmall = Template.bind(withIconSmallProps);
|
|
203
180
|
withIconSmall.args = withIconSmallProps;
|
|
204
181
|
withIconSmall.argTypes = argTypes;
|
|
205
|
-
|
|
206
182
|
const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
|
|
207
183
|
isLoading: true,
|
|
208
184
|
size: 'small'
|
|
209
185
|
});
|
|
210
|
-
|
|
211
186
|
export const loadingSmall = Template.bind(loadingSmallProps);
|
|
212
187
|
loadingSmall.args = loadingSmallProps;
|
|
213
188
|
loadingSmall.argTypes = argTypes;
|