@autoguru/overdrive 4.10.1 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Actions/Actions.js +21 -4
- package/dist/components/Actions/index.js +3 -1
- package/dist/components/Alert/Alert.css.js +28 -20
- package/dist/components/Alert/Alert.js +84 -26
- package/dist/components/Alert/index.js +3 -1
- package/dist/components/Anchor/Anchor.css.js +11 -3
- package/dist/components/Anchor/Anchor.js +53 -28
- package/dist/components/Anchor/index.js +3 -1
- package/dist/components/AutoSuggest/AutoSuggest.css.js +84 -76
- package/dist/components/AutoSuggest/AutoSuggest.js +621 -302
- package/dist/components/AutoSuggest/index.js +3 -1
- package/dist/components/AutoSuggest/useLayoutSuggestionVisible.js +29 -31
- package/dist/components/Badge/Badge.css.js +79 -71
- package/dist/components/Badge/Badge.js +44 -27
- package/dist/components/Badge/index.js +3 -1
- package/dist/components/Box/Box.js +122 -53
- package/dist/components/Box/argTypes.js +72 -105
- package/dist/components/Box/index.js +4 -2
- package/dist/components/Box/useBoxStyles.css.d.ts +4 -4
- package/dist/components/Box/useBoxStyles.css.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.css.js +114 -89
- package/dist/components/Box/useBoxStyles.d.ts +7 -7
- package/dist/components/Box/useBoxStyles.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.js +75 -47
- package/dist/components/BulletList/Bullet.css.js +49 -41
- package/dist/components/BulletList/Bullet.js +38 -24
- package/dist/components/BulletList/BulletList.css.js +13 -5
- package/dist/components/BulletList/BulletList.js +23 -10
- package/dist/components/BulletList/context.js +3 -1
- package/dist/components/BulletList/index.js +4 -2
- package/dist/components/BulletText/BulletText.css.js +21 -13
- package/dist/components/BulletText/BulletText.js +57 -16
- package/dist/components/BulletText/index.js +3 -1
- package/dist/components/Button/Button.css.js +243 -235
- package/dist/components/Button/Button.js +154 -91
- package/dist/components/Button/index.js +3 -1
- package/dist/components/CheckBox/CheckBox.css.js +28 -20
- package/dist/components/CheckBox/CheckBox.js +54 -16
- package/dist/components/CheckBox/index.js +3 -1
- package/dist/components/ColourInput/ColourInput.css.js +31 -23
- package/dist/components/ColourInput/ColourInput.js +70 -20
- package/dist/components/ColourInput/index.js +3 -1
- package/dist/components/Columns/Column.css.js +36 -26
- package/dist/components/Columns/Column.js +51 -16
- package/dist/components/Columns/Columns.css.js +39 -31
- package/dist/components/Columns/Columns.js +55 -22
- package/dist/components/Columns/index.js +4 -2
- package/dist/components/DateInput/DateInput.js +34 -7
- package/dist/components/DateInput/index.js +3 -1
- package/dist/components/DatePicker/DatePicker.css.js +40 -32
- package/dist/components/DatePicker/DatePicker.js +64 -23
- package/dist/components/DatePicker/index.js +3 -1
- package/dist/components/DividerLine/DividerLine.css.js +45 -37
- package/dist/components/DividerLine/DividerLine.js +22 -6
- package/dist/components/DividerLine/index.js +3 -1
- package/dist/components/Flyout/Flyout.js +41 -5
- package/dist/components/Flyout/index.js +3 -1
- package/dist/components/Heading/Heading.js +41 -21
- package/dist/components/Heading/index.js +3 -1
- package/dist/components/Icon/Icon.css.js +13 -5
- package/dist/components/Icon/Icon.js +26 -9
- package/dist/components/Icon/index.js +3 -1
- package/dist/components/Image/Image.js +23 -5
- package/dist/components/Image/ImageServerProvider.d.ts +1 -1
- package/dist/components/Image/ImageServerProvider.d.ts.map +1 -1
- package/dist/components/Image/ImageServerProvider.js +55 -35
- package/dist/components/Image/ResponsiveImage.js +46 -21
- package/dist/components/Image/SimpleImage.js +30 -2
- package/dist/components/Image/index.js +4 -2
- package/dist/components/Image/types.js +3 -1
- package/dist/components/Inline/Inline.js +74 -30
- package/dist/components/Inline/index.js +3 -1
- package/dist/components/LinearProgressIndicator/LinearProgressIndicator.css.js +56 -48
- package/dist/components/LinearProgressIndicator/LinearProgressIndicator.js +31 -7
- package/dist/components/LinearProgressIndicator/index.js +3 -1
- package/dist/components/LoadingBox/LoadingBox.css.js +26 -18
- package/dist/components/LoadingBox/LoadingBox.js +40 -7
- package/dist/components/LoadingBox/index.js +3 -1
- package/dist/components/Meta/Meta.css.js +16 -8
- package/dist/components/Meta/Meta.js +30 -8
- package/dist/components/Meta/index.js +3 -1
- package/dist/components/MinimalModal/MinimalModal.css.js +15 -7
- package/dist/components/MinimalModal/MinimalModal.js +67 -29
- package/dist/components/MinimalModal/index.js +3 -1
- package/dist/components/Modal/Modal.css.js +38 -30
- package/dist/components/Modal/Modal.js +129 -73
- package/dist/components/Modal/index.js +3 -1
- package/dist/components/NumberBubble/NumberBubble.css.js +12 -4
- package/dist/components/NumberBubble/NumberBubble.js +51 -23
- package/dist/components/NumberBubble/index.js +3 -1
- package/dist/components/NumberInput/NumberInput.js +67 -29
- package/dist/components/NumberInput/index.js +3 -1
- package/dist/components/OrderedList/OrderedList.css.js +16 -8
- package/dist/components/OrderedList/OrderedList.js +60 -26
- package/dist/components/OrderedList/index.js +3 -1
- package/dist/components/OutsideClick/OutsideClick.js +40 -35
- package/dist/components/OutsideClick/index.js +3 -1
- package/dist/components/OverdriveProvider/OverdriveProvider.js +33 -19
- package/dist/components/OverdriveProvider/index.js +3 -1
- package/dist/components/Pagination/Bubble.js +41 -19
- package/dist/components/Pagination/Pagination.css.js +28 -20
- package/dist/components/Pagination/Pagination.js +166 -67
- package/dist/components/Pagination/index.js +3 -1
- package/dist/components/Portal/Portal.js +40 -24
- package/dist/components/Portal/index.js +3 -1
- package/dist/components/Positioner/Positioner.css.js +14 -6
- package/dist/components/Positioner/Positioner.js +109 -85
- package/dist/components/Positioner/alignment.js +13 -10
- package/dist/components/Positioner/index.js +4 -2
- package/dist/components/ProgressBar/ProgressBar.css.js +14 -6
- package/dist/components/ProgressBar/ProgressBar.js +30 -12
- package/dist/components/ProgressBar/index.js +3 -1
- package/dist/components/ProgressBarGroup/ProgressBarGroup.css.js +12 -4
- package/dist/components/ProgressBarGroup/ProgressBarGroup.js +42 -14
- package/dist/components/ProgressBarGroup/index.js +3 -1
- package/dist/components/ProgressSpinner/ProgressSpinner.css.js +81 -73
- package/dist/components/ProgressSpinner/ProgressSpinner.js +32 -14
- package/dist/components/ProgressSpinner/index.js +3 -1
- package/dist/components/Radio/Radio.css.js +31 -23
- package/dist/components/Radio/Radio.js +58 -19
- package/dist/components/Radio/RadioGroup.js +32 -7
- package/dist/components/Radio/index.js +4 -2
- package/dist/components/Section/Section.css.js +13 -5
- package/dist/components/Section/Section.js +19 -4
- package/dist/components/Section/index.js +3 -1
- package/dist/components/SelectInput/SelectInput.css.js +19 -11
- package/dist/components/SelectInput/SelectInput.js +60 -11
- package/dist/components/SelectInput/index.js +3 -1
- package/dist/components/SimplePagination/SimplePagination.js +57 -17
- package/dist/components/SimplePagination/index.js +3 -1
- package/dist/components/Stack/Divider.css.js +12 -4
- package/dist/components/Stack/Divider.js +13 -4
- package/dist/components/Stack/Stack.css.js +18 -10
- package/dist/components/Stack/Stack.js +47 -23
- package/dist/components/Stack/index.js +3 -1
- package/dist/components/StandardModal/StandardModal.css.js +69 -57
- package/dist/components/StandardModal/StandardModal.js +127 -52
- package/dist/components/StandardModal/index.js +3 -1
- package/dist/components/StarRating/StarRating.css.js +16 -8
- package/dist/components/StarRating/StarRating.js +90 -46
- package/dist/components/StarRating/index.js +3 -1
- package/dist/components/Stepper/Stepper.css.js +46 -36
- package/dist/components/Stepper/Stepper.js +159 -66
- package/dist/components/Stepper/index.js +3 -1
- package/dist/components/Switch/Switch.css.js +54 -46
- package/dist/components/Switch/Switch.js +54 -21
- package/dist/components/Switch/index.js +3 -1
- package/dist/components/Table/Table.css.js +14 -6
- package/dist/components/Table/Table.js +29 -6
- package/dist/components/Table/TableCell.css.js +28 -20
- package/dist/components/Table/TableCell.js +41 -11
- package/dist/components/Table/TableHeadCell.css.js +61 -50
- package/dist/components/Table/TableHeadCell.js +86 -40
- package/dist/components/Table/TableRow.js +18 -3
- package/dist/components/Table/TableRowGroup.js +16 -3
- package/dist/components/Table/context.js +21 -10
- package/dist/components/Table/index.js +7 -5
- package/dist/components/Tabs/Tab.css.js +43 -35
- package/dist/components/Tabs/Tab.js +79 -49
- package/dist/components/Tabs/TabList.css.js +30 -22
- package/dist/components/Tabs/TabList.js +122 -67
- package/dist/components/Tabs/TabPane.css.js +11 -3
- package/dist/components/Tabs/TabPane.js +32 -15
- package/dist/components/Tabs/TabPanes.css.js +16 -8
- package/dist/components/Tabs/TabPanes.js +23 -6
- package/dist/components/Tabs/Tabs.js +22 -10
- package/dist/components/Tabs/index.js +7 -5
- package/dist/components/Text/Text.js +37 -15
- package/dist/components/Text/index.js +4 -2
- package/dist/components/Text/useTextStyles.css.js +42 -20
- package/dist/components/Text/useTextStyles.js +20 -5
- package/dist/components/TextAreaInput/TextAreaInput.js +35 -7
- package/dist/components/TextAreaInput/index.js +3 -1
- package/dist/components/TextBubble/TextBubble.css.js +13 -5
- package/dist/components/TextBubble/TextBubble.js +66 -29
- package/dist/components/TextBubble/index.js +3 -1
- package/dist/components/TextContainer/TextContainer.js +44 -9
- package/dist/components/TextContainer/index.js +3 -1
- package/dist/components/TextInput/TextInput.js +36 -5
- package/dist/components/TextInput/index.js +3 -1
- package/dist/components/TextLink/TextLink.css.js +23 -15
- package/dist/components/TextLink/TextLink.js +63 -24
- package/dist/components/TextLink/index.js +3 -1
- package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.d.ts +3 -0
- package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.d.ts.map +1 -0
- package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.js +80 -0
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts +22 -0
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts.map +1 -0
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +39 -0
- package/dist/components/ThemeOverrideProvider/index.d.ts +3 -0
- package/dist/components/ThemeOverrideProvider/index.d.ts.map +1 -0
- package/dist/components/ThemeOverrideProvider/index.js +4 -0
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts +17 -0
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts.map +1 -0
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +97 -0
- package/dist/components/ThemeProvider/ThemeProvider.js +30 -11
- package/dist/components/ThemeProvider/index.js +3 -1
- package/dist/components/Toaster/Toast.css.js +18 -10
- package/dist/components/Toaster/Toast.js +222 -108
- package/dist/components/Toaster/index.js +3 -1
- package/dist/components/Tooltip/Tooltip.css.js +21 -9
- package/dist/components/Tooltip/Tooltip.js +72 -40
- package/dist/components/Tooltip/index.js +3 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.css.js +13 -5
- package/dist/components/VisuallyHidden/VisuallyHidden.js +20 -4
- package/dist/components/VisuallyHidden/index.js +3 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +59 -56
- package/dist/components/private/CheckableBase/CheckableBase.css.js +46 -38
- package/dist/components/private/CheckableBase/CheckableBase.js +91 -27
- package/dist/components/private/CheckableBase/index.js +3 -1
- package/dist/components/private/CheckableBase/useCheckableStyles.js +5 -3
- package/dist/components/private/InputBase/HintText.css.js +11 -3
- package/dist/components/private/InputBase/HintText.js +28 -14
- package/dist/components/private/InputBase/InputState.css.js +96 -80
- package/dist/components/private/InputBase/NotchedBase.css.js +157 -162
- package/dist/components/private/InputBase/NotchedBase.js +116 -76
- package/dist/components/private/InputBase/index.js +3 -1
- package/dist/components/private/InputBase/withEnhancedInput.css.js +117 -109
- package/dist/components/private/InputBase/withEnhancedInput.js +190 -92
- package/dist/hooks/useAttachedBoxes/index.js +3 -1
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.css.js +26 -18
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +71 -46
- package/dist/hooks/useMedia/index.js +3 -1
- package/dist/hooks/useMedia/useMedia.js +44 -34
- package/dist/hooks/useNegativeMargin/useNegativeMargin.js +4 -2
- package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.css.js +13 -5
- package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.js +6 -4
- package/dist/hooks/useNegativeMargin/useNegativeMarginTop.css.js +12 -4
- package/dist/hooks/useNegativeMargin/useNegativeMarginTop.js +6 -4
- package/dist/hooks/useResponsiveValue/index.js +3 -1
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +14 -14
- package/dist/hooks/useWindowScrollLock/index.js +15 -13
- package/dist/index.js +7 -5
- package/dist/reset/globalFonts.css.js +20 -12
- package/dist/reset/globalReset.css.js +21 -13
- package/dist/reset/reset.css.js +105 -109
- package/dist/themes/base/index.d.ts +1 -0
- package/dist/themes/base/index.d.ts.map +1 -1
- package/dist/themes/base/index.js +10 -6
- package/dist/themes/base/tokens.js +264 -257
- package/dist/themes/base/vars.css.js +10 -2
- package/dist/themes/flat_red/index.d.ts +1 -0
- package/dist/themes/flat_red/index.d.ts.map +1 -1
- package/dist/themes/flat_red/index.js +10 -6
- package/dist/themes/flat_red/tokens.js +104 -98
- package/dist/themes/flat_red/vars.css.js +10 -2
- package/dist/themes/helpers.js +60 -51
- package/dist/themes/index.js +4 -2
- package/dist/themes/makeTheme.js +27 -16
- package/dist/themes/theme.css.js +271 -259
- package/dist/themes/tokens.js +3 -1
- package/dist/utils/index.js +93 -77
- package/dist/utils/mapTokenToProperty.js +22 -10
- package/dist/utils/number.js +21 -24
- package/dist/utils/resolveResponsiveProps.js +29 -31
- package/dist/utils/responsiveProps.css.js +29 -17
- package/dist/utils/responsiveStyle.js +26 -16
- package/package.json +4 -2
|
@@ -1,25 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/Radio/Radio.css.ts", "@autoguru/overdrive");
|
|
6
|
+
|
|
1
7
|
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { themeContractVars as vars } from
|
|
8
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
3
9
|
export const circle = styleVariants({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
10
|
+
default: {
|
|
11
|
+
transition: "border-color 0.2s ".concat(vars.animation.easing.decelerate, " 0s")
|
|
12
|
+
},
|
|
13
|
+
outer: {
|
|
14
|
+
top: vars.space['3'],
|
|
15
|
+
left: vars.space['3'],
|
|
16
|
+
width: vars.space['4'],
|
|
17
|
+
height: vars.space['4']
|
|
18
|
+
},
|
|
19
|
+
inner: {
|
|
20
|
+
top: "calc(".concat(vars.space['3'], " + (").concat(vars.space['4'], " - ").concat(vars.space['2'], ") * 0.5)"),
|
|
21
|
+
left: "calc(".concat(vars.space['3'], " + (").concat(vars.space['4'], " - ").concat(vars.space['2'], ") * 0.5)"),
|
|
22
|
+
width: vars.space['2'],
|
|
23
|
+
height: vars.space['2']
|
|
24
|
+
},
|
|
25
|
+
selectedInner: {
|
|
26
|
+
borderWidth: "calc(".concat(vars.space['2'], " / 2)")
|
|
27
|
+
},
|
|
28
|
+
selected: {
|
|
29
|
+
borderColor: vars.typography.colour.primary
|
|
30
|
+
}
|
|
31
|
+
}, "circle");
|
|
32
|
+
|
|
33
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,23 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import clsx from 'clsx';
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { forwardRef } from 'react';
|
|
4
|
-
import { Box } from
|
|
5
|
-
import { CheckableBase } from
|
|
6
|
-
import { useCheckableStyles } from
|
|
7
|
-
import * as styles from
|
|
8
|
-
import { useRadioContext } from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
import { Box } from "../Box/index.js";
|
|
7
|
+
import { CheckableBase } from "../private/CheckableBase/index.js";
|
|
8
|
+
import { useCheckableStyles } from "../private/CheckableBase/useCheckableStyles.js";
|
|
9
|
+
import * as styles from "./Radio.css.js";
|
|
10
|
+
import { useRadioContext } from "./RadioGroup.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export const Radio = forwardRef((_ref, ref) => {
|
|
14
|
+
let {
|
|
15
|
+
value,
|
|
16
|
+
className = '',
|
|
17
|
+
children,
|
|
18
|
+
disabled = false
|
|
19
|
+
} = _ref;
|
|
20
|
+
const {
|
|
21
|
+
checkableItem
|
|
22
|
+
} = useCheckableStyles();
|
|
23
|
+
const radioContext = useRadioContext();
|
|
24
|
+
const isChecked = value === radioContext.value;
|
|
25
|
+
|
|
26
|
+
const handleClick = () => {
|
|
27
|
+
var _radioContext$radioSe;
|
|
28
|
+
|
|
29
|
+
return (_radioContext$radioSe = radioContext.radioSelected) === null || _radioContext$radioSe === void 0 ? void 0 : _radioContext$radioSe.call(radioContext, value);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return _jsxs(CheckableBase, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
inputType: "radio",
|
|
35
|
+
className: className,
|
|
36
|
+
inputName: radioContext.inputName,
|
|
37
|
+
value: value,
|
|
38
|
+
label: children,
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
checked: isChecked,
|
|
41
|
+
handleClick: handleClick,
|
|
42
|
+
children: [_jsx(Box, {
|
|
43
|
+
borderRadius: "pill",
|
|
44
|
+
position: "absolute",
|
|
45
|
+
borderWidth: "2",
|
|
46
|
+
borderColour: "gray",
|
|
47
|
+
className: clsx(checkableItem, styles.circle.default, styles.circle.outer, {
|
|
48
|
+
[styles.circle.selected]: isChecked
|
|
49
|
+
})
|
|
50
|
+
}), _jsx(Box, {
|
|
51
|
+
borderRadius: "pill",
|
|
52
|
+
position: "absolute",
|
|
53
|
+
borderColour: "gray",
|
|
54
|
+
borderWidth: "none",
|
|
55
|
+
className: clsx(styles.circle.default, styles.circle.inner, {
|
|
56
|
+
[styles.circle.selected]: isChecked,
|
|
57
|
+
[styles.circle.selectedInner]: isChecked
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
22
61
|
});
|
|
23
|
-
export default Radio;
|
|
62
|
+
export default Radio;
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { createContext, forwardRef, useContext, useMemo
|
|
3
|
-
import { Box } from
|
|
4
|
+
import { createContext, forwardRef, useContext, useMemo } from 'react';
|
|
5
|
+
import { Box } from "../Box/index.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
7
|
export const RadioContext = createContext(null);
|
|
5
8
|
export const useRadioContext = () => useContext(RadioContext);
|
|
6
|
-
export const RadioGroup = forwardRef((
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
export const RadioGroup = forwardRef((_ref, ref) => {
|
|
10
|
+
let {
|
|
11
|
+
name,
|
|
12
|
+
value,
|
|
13
|
+
className = '',
|
|
14
|
+
onChange,
|
|
15
|
+
children
|
|
16
|
+
} = _ref;
|
|
17
|
+
const contextValue = useMemo(() => ({
|
|
18
|
+
value,
|
|
19
|
+
inputName: name,
|
|
20
|
+
radioSelected: onChange
|
|
21
|
+
}), [value, name, onChange]);
|
|
22
|
+
return _jsx(RadioContext.Provider, {
|
|
23
|
+
value: contextValue,
|
|
24
|
+
children: _jsx(Box, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
position: "relative",
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
width: "full",
|
|
30
|
+
padding: "none",
|
|
31
|
+
className: className,
|
|
32
|
+
children: children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
10
35
|
});
|
|
11
|
-
export default RadioGroup;
|
|
36
|
+
export default RadioGroup;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/Section/Section.css.ts", "@autoguru/overdrive");
|
|
6
|
+
|
|
1
7
|
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { themeContractVars as vars } from
|
|
3
|
-
import { mapTokenToProperty } from
|
|
8
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
|
+
import { mapTokenToProperty } from "../../utils/mapTokenToProperty.js";
|
|
4
10
|
export const root = style({
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
export const width = styleVariants(mapTokenToProperty(vars.contentWidth, 'maxWidth'));
|
|
11
|
+
margin: '0 auto'
|
|
12
|
+
}, "root");
|
|
13
|
+
export const width = styleVariants(mapTokenToProperty(vars.contentWidth, 'maxWidth'), "width");
|
|
14
|
+
|
|
15
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import clsx from 'clsx';
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { Box } from
|
|
4
|
-
import * as styles from
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
import { Box } from "../Box/index.js";
|
|
6
|
+
import * as styles from "./Section.css.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const Section = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
children,
|
|
11
|
+
width = 'medium',
|
|
12
|
+
paddingX
|
|
13
|
+
} = _ref;
|
|
14
|
+
return _jsx(Box, {
|
|
15
|
+
className: clsx(styles.root, styles.width[width]),
|
|
16
|
+
width: "full",
|
|
17
|
+
paddingX: paddingX,
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default Section;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/SelectInput/SelectInput.css.ts", "@autoguru/overdrive");
|
|
6
|
+
|
|
1
7
|
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { themeContractVars as vars } from
|
|
3
|
-
export const input = style({});
|
|
8
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
|
+
export const input = style({}, "input");
|
|
4
10
|
export const paddedInput = style({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
+
selectors: {
|
|
12
|
+
["".concat(input, "&")]: {
|
|
13
|
+
paddingRight: vars.space['8']
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}, "paddedInput");
|
|
11
17
|
export const arrow = style({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
18
|
+
top: '0',
|
|
19
|
+
right: '0'
|
|
20
|
+
}, "arrow");
|
|
21
|
+
|
|
22
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,14 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
const _excluded = ["field", "eventHandlers", "suffixed", "prefixed", "validation", "isLoading", "size", "fieldIcon"];
|
|
6
|
+
|
|
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; }
|
|
8
|
+
|
|
9
|
+
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
|
+
|
|
1
11
|
import { ChevronDownIcon } from '@autoguru/icons';
|
|
2
12
|
import * as React from 'react';
|
|
3
|
-
import { Box } from
|
|
4
|
-
import { Icon } from
|
|
5
|
-
import { withEnhancedInput } from
|
|
6
|
-
import * as styles from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
import { Box } from "../Box/index.js";
|
|
14
|
+
import { Icon } from "../Icon/index.js";
|
|
15
|
+
import { withEnhancedInput } from "../private/InputBase/index.js";
|
|
16
|
+
import * as styles from "./SelectInput.css.js";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
export const SelectInput = withEnhancedInput(_ref => {
|
|
20
|
+
let {
|
|
21
|
+
field,
|
|
22
|
+
eventHandlers,
|
|
23
|
+
suffixed,
|
|
24
|
+
prefixed,
|
|
25
|
+
validation,
|
|
26
|
+
isLoading,
|
|
27
|
+
size,
|
|
28
|
+
fieldIcon = ChevronDownIcon
|
|
29
|
+
} = _ref,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
return _jsxs(Box, {
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexWrap: "nowrap",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
position: "relative",
|
|
38
|
+
children: [_jsx(Box, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
39
|
+
is: "select",
|
|
40
|
+
flexGrow: 1
|
|
41
|
+
}, eventHandlers), field), rest), {}, {
|
|
42
|
+
className: [styles.input, styles.paddedInput, field.className],
|
|
43
|
+
autoComplete: "off"
|
|
44
|
+
})), isLoading ? null : _jsx(Box, {
|
|
45
|
+
className: styles.arrow,
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
height: "full",
|
|
49
|
+
marginRight: size === 'medium' ? '4' : '2',
|
|
50
|
+
flexShrink: 0,
|
|
51
|
+
pointerEvents: "none",
|
|
52
|
+
position: "absolute",
|
|
53
|
+
children: _jsx(Icon, {
|
|
54
|
+
size: "medium",
|
|
55
|
+
icon: fieldIcon
|
|
56
|
+
})
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}, {
|
|
60
|
+
primitiveType: 'select',
|
|
61
|
+
withSuffixIcon: false
|
|
13
62
|
});
|
|
14
|
-
export default SelectInput;
|
|
63
|
+
export default SelectInput;
|
|
@@ -1,22 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import { ChevronLeftIcon, ChevronRightIcon } from '@autoguru/icons';
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { noop } from
|
|
4
|
-
import { Button } from
|
|
5
|
-
import { Icon } from
|
|
6
|
-
import { Inline } from
|
|
7
|
-
|
|
5
|
+
import { noop } from "../../utils/index.js";
|
|
6
|
+
import { Button } from "../Button/index.js";
|
|
7
|
+
import { Icon } from "../Icon/index.js";
|
|
8
|
+
import { Inline } from "../Inline/index.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
export let EChangeDirection;
|
|
12
|
+
|
|
8
13
|
(function (EChangeDirection) {
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
EChangeDirection["Previous"] = "previous";
|
|
15
|
+
EChangeDirection["Next"] = "next";
|
|
11
16
|
})(EChangeDirection || (EChangeDirection = {}));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
|
|
18
|
+
export const SimplePagination = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
hasNext = false,
|
|
21
|
+
hasPrevious = false,
|
|
22
|
+
onChange = noop
|
|
23
|
+
} = _ref;
|
|
24
|
+
|
|
25
|
+
const handleClick = direction => () => {
|
|
26
|
+
onChange(direction);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return _jsxs(Inline, {
|
|
30
|
+
is: "nav",
|
|
31
|
+
space: "6",
|
|
32
|
+
"aria-label": "pagination",
|
|
33
|
+
alignX: "center",
|
|
34
|
+
alignY: "center",
|
|
35
|
+
children: [_jsx(Button, {
|
|
36
|
+
rounded: true,
|
|
37
|
+
withDoubleClicks: true,
|
|
38
|
+
disabled: !hasPrevious,
|
|
39
|
+
size: "small",
|
|
40
|
+
variant: "secondary",
|
|
41
|
+
"aria-label": "previous page",
|
|
42
|
+
onClick: handleClick(EChangeDirection.Previous),
|
|
43
|
+
children: _jsx(Icon, {
|
|
44
|
+
size: "medium",
|
|
45
|
+
icon: ChevronLeftIcon
|
|
46
|
+
})
|
|
47
|
+
}), _jsx(Button, {
|
|
48
|
+
rounded: true,
|
|
49
|
+
withDoubleClicks: true,
|
|
50
|
+
disabled: !hasNext,
|
|
51
|
+
size: "small",
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
"aria-label": "next page",
|
|
54
|
+
onClick: handleClick(EChangeDirection.Next),
|
|
55
|
+
children: _jsx(Icon, {
|
|
56
|
+
size: "medium",
|
|
57
|
+
icon: ChevronRightIcon
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
21
61
|
};
|
|
22
|
-
export default SimplePagination;
|
|
62
|
+
export default SimplePagination;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/Stack/Divider.css.ts", "@autoguru/overdrive");
|
|
6
|
+
|
|
1
7
|
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { themeContractVars as vars } from
|
|
8
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
3
9
|
export const line = style({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
10
|
+
height: '1px',
|
|
11
|
+
boxShadow: "inset 0 0 0 1px ".concat(vars.colours.background.light)
|
|
12
|
+
}, "line");
|
|
13
|
+
|
|
14
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { Box } from
|
|
3
|
-
import * as styles from
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { Box } from "../Box/index.js";
|
|
5
|
+
import * as styles from "./Divider.css.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const Divider = () => _jsx(Box, {
|
|
8
|
+
position: "relative",
|
|
9
|
+
children: _jsx(Box, {
|
|
10
|
+
position: "absolute",
|
|
11
|
+
className: styles.line,
|
|
12
|
+
width: "full"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/Stack/Stack.css.ts", "@autoguru/overdrive");
|
|
6
|
+
|
|
1
7
|
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { themeContractVars as vars } from
|
|
3
|
-
import { mapTokenToProperty } from
|
|
8
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
9
|
+
import { mapTokenToProperty } from "../../utils/mapTokenToProperty.js";
|
|
4
10
|
export const child = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
spaces: styleVariants(mapTokenToProperty(vars.space, value => ({
|
|
12
|
+
paddingBottom: value
|
|
13
|
+
})), "child_spaces"),
|
|
14
|
+
default: style({
|
|
15
|
+
':last-child': {
|
|
16
|
+
paddingBottom: 0
|
|
17
|
+
}
|
|
18
|
+
}, "child_default")
|
|
13
19
|
};
|
|
20
|
+
|
|
21
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,27 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { Children } from 'react';
|
|
3
5
|
import flattenChildren from 'react-keyed-flatten-children';
|
|
4
|
-
import { Box } from
|
|
5
|
-
import { Divider } from
|
|
6
|
-
import * as styles from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
];
|
|
11
|
-
export const Stack =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
import { Box } from "../Box/index.js";
|
|
7
|
+
import { Divider } from "./Divider.js";
|
|
8
|
+
import * as styles from "./Stack.css.js";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const supportedListTypes = ['ul', 'ol'];
|
|
13
|
+
export const Stack = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
space = '2',
|
|
16
|
+
children,
|
|
17
|
+
is = 'div',
|
|
18
|
+
alignItems,
|
|
19
|
+
width,
|
|
20
|
+
dividers = false,
|
|
21
|
+
className = ''
|
|
22
|
+
} = _ref;
|
|
23
|
+
const items = flattenChildren(children);
|
|
24
|
+
|
|
25
|
+
if (items.length < 2) {
|
|
26
|
+
return _jsx(_Fragment, {
|
|
27
|
+
children: items
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let listItem = 'div';
|
|
32
|
+
if (typeof is === 'string') listItem = supportedListTypes.includes(is) ? 'li' : 'div';
|
|
33
|
+
return _jsx(Box, {
|
|
34
|
+
is: is,
|
|
35
|
+
className: className,
|
|
36
|
+
width: width,
|
|
37
|
+
children: Children.map(items, (child, idx) => _jsxs(Box, {
|
|
38
|
+
is: listItem,
|
|
39
|
+
display: alignItems ? 'flex' : void 0,
|
|
40
|
+
flexDirection: "column",
|
|
41
|
+
alignItems: alignItems,
|
|
42
|
+
className: [styles.child.default, dividers ? undefined : styles.child.spaces[space]],
|
|
43
|
+
children: [dividers && idx > 0 ? _jsx(Box, {
|
|
44
|
+
paddingY: space,
|
|
45
|
+
width: "full",
|
|
46
|
+
children: _jsx(Divider, {})
|
|
47
|
+
}) : null, child]
|
|
48
|
+
}))
|
|
49
|
+
});
|
|
26
50
|
};
|
|
27
|
-
export default Stack;
|
|
51
|
+
export default Stack;
|