@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,44 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { Children, cloneElement, useCallback, useEffect, useRef, useState
|
|
3
|
-
import { Box } from
|
|
4
|
-
import { Positioner } from
|
|
5
|
-
import { EAlignment } from
|
|
6
|
-
import { Text } from
|
|
7
|
-
import * as styles from
|
|
4
|
+
import { Children, cloneElement, useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { Box } from "../Box/index.js";
|
|
6
|
+
import { Positioner } from "../Positioner/index.js";
|
|
7
|
+
import { EAlignment } from "../Positioner/alignment.js";
|
|
8
|
+
import { Text } from "../Text/index.js";
|
|
9
|
+
import * as styles from "./Tooltip.css.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
13
|
const sizeMap = {
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
medium: '2',
|
|
15
|
+
large: '3'
|
|
11
16
|
};
|
|
12
|
-
export const Tooltip =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
17
|
+
export const Tooltip = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
alignment = EAlignment.RIGHT,
|
|
20
|
+
label,
|
|
21
|
+
children,
|
|
22
|
+
size = 'medium',
|
|
23
|
+
closeAfter = null
|
|
24
|
+
} = _ref;
|
|
25
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
26
|
+
const childRef = useRef(null);
|
|
27
|
+
const triggerRef = useRef(null);
|
|
28
|
+
const leaveTimer = useRef();
|
|
29
|
+
const enterHandler = useCallback(() => {
|
|
30
|
+
if (leaveTimer.current) {
|
|
31
|
+
clearTimeout(leaveTimer.current);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
setIsOpen(true);
|
|
35
|
+
}, [setIsOpen]);
|
|
36
|
+
const leaveHandler = useCallback(() => {
|
|
37
|
+
leaveTimer.current = setTimeout(() => {
|
|
38
|
+
setIsOpen(false);
|
|
39
|
+
}, 1e3 / 2);
|
|
40
|
+
}, [setIsOpen]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
let timeout;
|
|
43
|
+
if (isOpen && typeof closeAfter === 'number') timeout = setTimeout(() => setIsOpen(false), closeAfter);
|
|
44
|
+
return () => timeout ? clearTimeout(timeout) : void 0;
|
|
45
|
+
}, [closeAfter, isOpen]);
|
|
46
|
+
return _jsxs(_Fragment, {
|
|
47
|
+
children: [cloneElement(Children.only(children), {
|
|
48
|
+
ref: triggerRef,
|
|
49
|
+
onMouseEnter: enterHandler,
|
|
50
|
+
onMouseLeave: leaveHandler
|
|
51
|
+
}), _jsx(Positioner, {
|
|
52
|
+
triggerRef: triggerRef,
|
|
53
|
+
alignment: alignment,
|
|
54
|
+
isOpen: isOpen,
|
|
55
|
+
children: _jsx(Box, {
|
|
56
|
+
ref: childRef,
|
|
57
|
+
className: styles.root,
|
|
58
|
+
width: "full",
|
|
59
|
+
pointerEvents: "none",
|
|
60
|
+
userSelect: "none",
|
|
61
|
+
overflow: "hidden",
|
|
62
|
+
borderRadius: "1",
|
|
63
|
+
boxShadow: "4",
|
|
64
|
+
backgroundColour: "gray900",
|
|
65
|
+
paddingY: "2",
|
|
66
|
+
paddingX: "3",
|
|
67
|
+
children: _jsx(Text, {
|
|
68
|
+
size: sizeMap[size],
|
|
69
|
+
colour: "white",
|
|
70
|
+
children: label
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
43
75
|
};
|
|
44
|
-
export default Tooltip;
|
|
76
|
+
export default Tooltip;
|
|
@@ -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/VisuallyHidden/VisuallyHidden.css.ts", "@autoguru/overdrive");
|
|
6
|
+
|
|
1
7
|
import { style } from '@vanilla-extract/css';
|
|
2
8
|
export const root = style({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
9
|
+
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
10
|
+
height: 1,
|
|
11
|
+
whiteSpace: 'nowrap',
|
|
12
|
+
width: 1
|
|
13
|
+
}, "root");
|
|
14
|
+
|
|
15
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { Box } from
|
|
3
|
-
import * as styles from
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
import { Box } from "../Box/index.js";
|
|
5
|
+
import * as styles from "./VisuallyHidden.css.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const VisuallyHidden = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
is
|
|
11
|
+
} = _ref;
|
|
12
|
+
return _jsx(Box, {
|
|
13
|
+
is: is,
|
|
14
|
+
position: "absolute",
|
|
15
|
+
overflow: "hidden",
|
|
16
|
+
userSelect: "none",
|
|
17
|
+
className: styles.root,
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default VisuallyHidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACt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Ac,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,56 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
41
|
-
export * from
|
|
42
|
-
export * from
|
|
43
|
-
export * from
|
|
44
|
-
export * from
|
|
45
|
-
export * from
|
|
46
|
-
export * from
|
|
47
|
-
export * from
|
|
48
|
-
export * from
|
|
49
|
-
export * from
|
|
50
|
-
export * from
|
|
51
|
-
export * from
|
|
52
|
-
export * from
|
|
53
|
-
export * from
|
|
54
|
-
export * from
|
|
55
|
-
export * from
|
|
56
|
-
export * from
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export * from "./OverdriveProvider/index.js";
|
|
4
|
+
export * from "./ThemeProvider/index.js";
|
|
5
|
+
export * from "./Actions/index.js";
|
|
6
|
+
export * from "./Alert/index.js";
|
|
7
|
+
export * from "./Anchor/index.js";
|
|
8
|
+
export * from "./AutoSuggest/index.js";
|
|
9
|
+
export * from "./Badge/index.js";
|
|
10
|
+
export * from "./Box/index.js";
|
|
11
|
+
export * from "./BulletList/index.js";
|
|
12
|
+
export * from "./BulletText/index.js";
|
|
13
|
+
export * from "./Button/index.js";
|
|
14
|
+
export * from "./CheckBox/index.js";
|
|
15
|
+
export * from "./Columns/index.js";
|
|
16
|
+
export * from "./DateInput/index.js";
|
|
17
|
+
export * from "./Flyout/index.js";
|
|
18
|
+
export * from "./Heading/index.js";
|
|
19
|
+
export * from "./Icon/index.js";
|
|
20
|
+
export * from "./Inline/index.js";
|
|
21
|
+
export * from "./LinearProgressIndicator/index.js";
|
|
22
|
+
export * from "./LoadingBox/index.js";
|
|
23
|
+
export * from "./Meta/index.js";
|
|
24
|
+
export * from "./Modal/index.js";
|
|
25
|
+
export * from "./NumberInput/index.js";
|
|
26
|
+
export * from "./OrderedList/index.js";
|
|
27
|
+
export * from "./OutsideClick/index.js";
|
|
28
|
+
export * from "./Pagination/index.js";
|
|
29
|
+
export * from "./Portal/index.js";
|
|
30
|
+
export * from "./Positioner/index.js";
|
|
31
|
+
export * from "./ProgressBar/index.js";
|
|
32
|
+
export * from "./ProgressBarGroup/index.js";
|
|
33
|
+
export * from "./ProgressSpinner/index.js";
|
|
34
|
+
export * from "./Radio/index.js";
|
|
35
|
+
export * from "./Section/index.js";
|
|
36
|
+
export * from "./SelectInput/index.js";
|
|
37
|
+
export * from "./SimplePagination/index.js";
|
|
38
|
+
export * from "./Stack/index.js";
|
|
39
|
+
export * from "./StandardModal/index.js";
|
|
40
|
+
export * from "./StarRating/index.js";
|
|
41
|
+
export * from "./Stepper/index.js";
|
|
42
|
+
export * from "./Switch/index.js";
|
|
43
|
+
export * from "./Table/index.js";
|
|
44
|
+
export * from "./Tabs/index.js";
|
|
45
|
+
export * from "./Text/index.js";
|
|
46
|
+
export * from "./TextAreaInput/index.js";
|
|
47
|
+
export * from "./TextContainer/index.js";
|
|
48
|
+
export * from "./TextInput/index.js";
|
|
49
|
+
export * from "./TextLink/index.js";
|
|
50
|
+
export * from "./Toaster/index.js";
|
|
51
|
+
export * from "./Tooltip/index.js";
|
|
52
|
+
export * from "./VisuallyHidden/index.js";
|
|
53
|
+
export * from "./MinimalModal/index.js";
|
|
54
|
+
export * from "./Image/index.js";
|
|
55
|
+
export * from "./NumberBubble/index.js";
|
|
56
|
+
export * from "./TextBubble/index.js";
|
|
57
|
+
export * from "./ColourInput/index.js";
|
|
58
|
+
export * from "./DividerLine/index.js";
|
|
59
|
+
export * from "./ThemeOverrideProvider/index.js";
|
|
@@ -1,46 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/private/CheckableBase/CheckableBase.css.ts", "@autoguru/overdrive");
|
|
6
|
+
|
|
1
7
|
import { style, 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 root = style({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
transition: "background-color 0.2s ".concat(vars.animation.easing.decelerate, " 0s"),
|
|
12
|
+
':hover': {
|
|
13
|
+
backgroundColor: vars.colours.background.body
|
|
14
|
+
}
|
|
15
|
+
}, "root");
|
|
10
16
|
export const label = styleVariants({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
17
|
+
disabled: {
|
|
18
|
+
color: vars.typography.colour.dark
|
|
19
|
+
}
|
|
20
|
+
}, "label");
|
|
15
21
|
export const nativeInput = styleVariants({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
22
|
+
default: {
|
|
23
|
+
zIndex: 2,
|
|
24
|
+
top: 0,
|
|
25
|
+
left: 0,
|
|
26
|
+
cursor: 'inherit',
|
|
27
|
+
opacity: 0
|
|
28
|
+
},
|
|
29
|
+
checked: {
|
|
30
|
+
outline: 'none'
|
|
31
|
+
}
|
|
32
|
+
}, "nativeInput");
|
|
27
33
|
export const checkable = style({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
34
|
+
width: "calc(".concat(vars.space['4'], " + (").concat(vars.space[3], " * 2))"),
|
|
35
|
+
height: "calc(".concat(vars.space['4'], " + (").concat(vars.space[3], " * 2))"),
|
|
36
|
+
marginTop: "calc(-1*".concat(vars.space['3'], ")"),
|
|
37
|
+
marginBottom: "calc(-1*".concat(vars.space['3'], ")")
|
|
38
|
+
}, "checkable");
|
|
33
39
|
export const checkableItem = style({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
[`${nativeInput.default}:focus:not(:checked) ~${checkable} >&`]: {
|
|
39
|
-
borderColor: vars.colours.intent.primary.background.strong,
|
|
40
|
-
},
|
|
40
|
+
selectors: {
|
|
41
|
+
["".concat(nativeInput.default, ":focus:checked ~").concat(checkable, " &")]: {
|
|
42
|
+
boxShadow: "0 0 0 2px ".concat(vars.colours.intent.primary.background.strong)
|
|
41
43
|
},
|
|
42
|
-
|
|
44
|
+
["".concat(nativeInput.default, ":focus:not(:checked) ~").concat(checkable, " >&")]: {
|
|
45
|
+
borderColor: vars.colours.intent.primary.background.strong
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, "checkableItem");
|
|
43
49
|
export const disabled = style({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
50
|
+
opacity: 0.6,
|
|
51
|
+
pointerEvents: 'none'
|
|
52
|
+
}, "disabled");
|
|
53
|
+
|
|
54
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,31 +1,95 @@
|
|
|
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, useBoxStyles } from
|
|
5
|
-
import { Text, useTextStyles } from
|
|
6
|
-
import * as styles from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
import { Box, useBoxStyles } from "../../Box/index.js";
|
|
7
|
+
import { Text, useTextStyles } from "../../Text/index.js";
|
|
8
|
+
import * as styles from "./CheckableBase.css.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
export const CheckableBase = forwardRef((_ref, ref) => {
|
|
12
|
+
let {
|
|
13
|
+
className = '',
|
|
14
|
+
label = '',
|
|
15
|
+
checked = false,
|
|
16
|
+
disabled = false,
|
|
17
|
+
inputType,
|
|
18
|
+
inputName,
|
|
19
|
+
value,
|
|
20
|
+
children,
|
|
21
|
+
handleClick,
|
|
22
|
+
handleChange
|
|
23
|
+
} = _ref;
|
|
24
|
+
|
|
25
|
+
const onChange = e => {
|
|
26
|
+
if (typeof handleChange === 'function') {
|
|
27
|
+
handleChange(e.currentTarget.checked);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const nakedLabel = ['string', 'number'].includes(typeof label);
|
|
32
|
+
return _jsxs(Box, {
|
|
33
|
+
display: "flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
flexDirection: "row",
|
|
36
|
+
justifyContent: "flexStart",
|
|
37
|
+
paddingY: "3",
|
|
38
|
+
paddingRight: label ? '3' : 'none',
|
|
39
|
+
paddingLeft: "none",
|
|
40
|
+
position: "relative",
|
|
41
|
+
className: [styles.root, useBoxStyles({
|
|
42
|
+
is: 'button'
|
|
43
|
+
}), className, {
|
|
44
|
+
[styles.disabled]: disabled
|
|
45
|
+
}],
|
|
46
|
+
children: [_jsx(Box, {
|
|
47
|
+
ref: ref,
|
|
48
|
+
is: "input",
|
|
49
|
+
position: "absolute",
|
|
50
|
+
width: "full",
|
|
51
|
+
height: "full",
|
|
52
|
+
margin: "none",
|
|
53
|
+
padding: "none",
|
|
54
|
+
name: inputName,
|
|
55
|
+
value: value,
|
|
56
|
+
checked: checked,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
tabIndex: disabled ? -1 : void 0,
|
|
59
|
+
type: inputType,
|
|
60
|
+
pointerEvents: disabled ? 'none' : void 0,
|
|
61
|
+
className: clsx(useBoxStyles({
|
|
62
|
+
is: 'button'
|
|
63
|
+
}), styles.nativeInput.default, {
|
|
64
|
+
[styles.nativeInput.checked]: checked
|
|
65
|
+
}),
|
|
66
|
+
onClick: handleClick,
|
|
67
|
+
onChange: onChange
|
|
68
|
+
}), _jsx(Box, {
|
|
69
|
+
display: "flex",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
position: "relative",
|
|
73
|
+
className: [styles.checkable, useBoxStyles({
|
|
74
|
+
is: 'button'
|
|
75
|
+
})],
|
|
76
|
+
children: children
|
|
77
|
+
}), label ? _jsx(Box, {
|
|
78
|
+
is: "label",
|
|
79
|
+
width: "full",
|
|
80
|
+
pointerEvents: disabled ? 'none' : void 0,
|
|
81
|
+
className: clsx(useBoxStyles({
|
|
82
|
+
is: 'button'
|
|
83
|
+
}), useTextStyles({
|
|
84
|
+
size: '4'
|
|
85
|
+
}), {
|
|
86
|
+
[styles.label.disabled]: disabled
|
|
87
|
+
}),
|
|
88
|
+
children: nakedLabel ? _jsx(Text, {
|
|
89
|
+
is: "span",
|
|
90
|
+
children: label
|
|
91
|
+
}) : label
|
|
92
|
+
}) : null]
|
|
93
|
+
});
|
|
30
94
|
});
|
|
31
|
-
export default CheckableBase;
|
|
95
|
+
export default CheckableBase;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/private/InputBase/HintText.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 hintText = style({
|
|
4
|
-
|
|
5
|
-
});
|
|
10
|
+
transition: "color 0.2s ".concat(vars.animation.easing.decelerate, " 0s")
|
|
11
|
+
}, "hintText");
|
|
12
|
+
|
|
13
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import clsx from 'clsx';
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { useBoxStyles } from
|
|
4
|
-
import { Text } from
|
|
5
|
-
import * as styles from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
import { useBoxStyles } from "../../Box/index.js";
|
|
6
|
+
import { Text } from "../../Text/index.js";
|
|
7
|
+
import * as styles from "./HintText.css.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export const HintText = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
reserveHintSpace,
|
|
12
|
+
disabled,
|
|
13
|
+
hintText,
|
|
14
|
+
className = ''
|
|
15
|
+
} = _ref;
|
|
16
|
+
const boxStyles = useBoxStyles({
|
|
17
|
+
is: 'p',
|
|
18
|
+
marginTop: '2',
|
|
19
|
+
marginLeft: '4'
|
|
20
|
+
});
|
|
21
|
+
if (!hintText && !reserveHintSpace) return null;
|
|
22
|
+
const showHintText = !disabled && hintText;
|
|
23
|
+
return _jsx(Text, {
|
|
24
|
+
is: "p",
|
|
25
|
+
size: "2",
|
|
26
|
+
colour: "unset",
|
|
27
|
+
className: clsx(boxStyles, styles.hintText, className),
|
|
28
|
+
children: showHintText ? hintText : '\u00A0'
|
|
29
|
+
});
|
|
30
|
+
};
|