@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.
Files changed (260) hide show
  1. package/dist/components/Actions/Actions.js +21 -4
  2. package/dist/components/Actions/index.js +3 -1
  3. package/dist/components/Alert/Alert.css.js +28 -20
  4. package/dist/components/Alert/Alert.js +84 -26
  5. package/dist/components/Alert/index.js +3 -1
  6. package/dist/components/Anchor/Anchor.css.js +11 -3
  7. package/dist/components/Anchor/Anchor.js +53 -28
  8. package/dist/components/Anchor/index.js +3 -1
  9. package/dist/components/AutoSuggest/AutoSuggest.css.js +84 -76
  10. package/dist/components/AutoSuggest/AutoSuggest.js +621 -302
  11. package/dist/components/AutoSuggest/index.js +3 -1
  12. package/dist/components/AutoSuggest/useLayoutSuggestionVisible.js +29 -31
  13. package/dist/components/Badge/Badge.css.js +79 -71
  14. package/dist/components/Badge/Badge.js +44 -27
  15. package/dist/components/Badge/index.js +3 -1
  16. package/dist/components/Box/Box.js +122 -53
  17. package/dist/components/Box/argTypes.js +72 -105
  18. package/dist/components/Box/index.js +4 -2
  19. package/dist/components/Box/useBoxStyles.css.d.ts +4 -4
  20. package/dist/components/Box/useBoxStyles.css.d.ts.map +1 -1
  21. package/dist/components/Box/useBoxStyles.css.js +114 -89
  22. package/dist/components/Box/useBoxStyles.d.ts +7 -7
  23. package/dist/components/Box/useBoxStyles.d.ts.map +1 -1
  24. package/dist/components/Box/useBoxStyles.js +75 -47
  25. package/dist/components/BulletList/Bullet.css.js +49 -41
  26. package/dist/components/BulletList/Bullet.js +38 -24
  27. package/dist/components/BulletList/BulletList.css.js +13 -5
  28. package/dist/components/BulletList/BulletList.js +23 -10
  29. package/dist/components/BulletList/context.js +3 -1
  30. package/dist/components/BulletList/index.js +4 -2
  31. package/dist/components/BulletText/BulletText.css.js +21 -13
  32. package/dist/components/BulletText/BulletText.js +57 -16
  33. package/dist/components/BulletText/index.js +3 -1
  34. package/dist/components/Button/Button.css.js +243 -235
  35. package/dist/components/Button/Button.js +154 -91
  36. package/dist/components/Button/index.js +3 -1
  37. package/dist/components/CheckBox/CheckBox.css.js +28 -20
  38. package/dist/components/CheckBox/CheckBox.js +54 -16
  39. package/dist/components/CheckBox/index.js +3 -1
  40. package/dist/components/ColourInput/ColourInput.css.js +31 -23
  41. package/dist/components/ColourInput/ColourInput.js +70 -20
  42. package/dist/components/ColourInput/index.js +3 -1
  43. package/dist/components/Columns/Column.css.js +36 -26
  44. package/dist/components/Columns/Column.js +51 -16
  45. package/dist/components/Columns/Columns.css.js +39 -31
  46. package/dist/components/Columns/Columns.js +55 -22
  47. package/dist/components/Columns/index.js +4 -2
  48. package/dist/components/DateInput/DateInput.js +34 -7
  49. package/dist/components/DateInput/index.js +3 -1
  50. package/dist/components/DatePicker/DatePicker.css.js +40 -32
  51. package/dist/components/DatePicker/DatePicker.js +64 -23
  52. package/dist/components/DatePicker/index.js +3 -1
  53. package/dist/components/DividerLine/DividerLine.css.js +45 -37
  54. package/dist/components/DividerLine/DividerLine.js +22 -6
  55. package/dist/components/DividerLine/index.js +3 -1
  56. package/dist/components/Flyout/Flyout.js +41 -5
  57. package/dist/components/Flyout/index.js +3 -1
  58. package/dist/components/Heading/Heading.js +41 -21
  59. package/dist/components/Heading/index.js +3 -1
  60. package/dist/components/Icon/Icon.css.js +13 -5
  61. package/dist/components/Icon/Icon.js +26 -9
  62. package/dist/components/Icon/index.js +3 -1
  63. package/dist/components/Image/Image.js +23 -5
  64. package/dist/components/Image/ImageServerProvider.d.ts +1 -1
  65. package/dist/components/Image/ImageServerProvider.d.ts.map +1 -1
  66. package/dist/components/Image/ImageServerProvider.js +55 -35
  67. package/dist/components/Image/ResponsiveImage.js +46 -21
  68. package/dist/components/Image/SimpleImage.js +30 -2
  69. package/dist/components/Image/index.js +4 -2
  70. package/dist/components/Image/types.js +3 -1
  71. package/dist/components/Inline/Inline.js +74 -30
  72. package/dist/components/Inline/index.js +3 -1
  73. package/dist/components/LinearProgressIndicator/LinearProgressIndicator.css.js +56 -48
  74. package/dist/components/LinearProgressIndicator/LinearProgressIndicator.js +31 -7
  75. package/dist/components/LinearProgressIndicator/index.js +3 -1
  76. package/dist/components/LoadingBox/LoadingBox.css.js +26 -18
  77. package/dist/components/LoadingBox/LoadingBox.js +40 -7
  78. package/dist/components/LoadingBox/index.js +3 -1
  79. package/dist/components/Meta/Meta.css.js +16 -8
  80. package/dist/components/Meta/Meta.js +30 -8
  81. package/dist/components/Meta/index.js +3 -1
  82. package/dist/components/MinimalModal/MinimalModal.css.js +15 -7
  83. package/dist/components/MinimalModal/MinimalModal.js +67 -29
  84. package/dist/components/MinimalModal/index.js +3 -1
  85. package/dist/components/Modal/Modal.css.js +38 -30
  86. package/dist/components/Modal/Modal.js +129 -73
  87. package/dist/components/Modal/index.js +3 -1
  88. package/dist/components/NumberBubble/NumberBubble.css.js +12 -4
  89. package/dist/components/NumberBubble/NumberBubble.js +51 -23
  90. package/dist/components/NumberBubble/index.js +3 -1
  91. package/dist/components/NumberInput/NumberInput.js +67 -29
  92. package/dist/components/NumberInput/index.js +3 -1
  93. package/dist/components/OrderedList/OrderedList.css.js +16 -8
  94. package/dist/components/OrderedList/OrderedList.js +60 -26
  95. package/dist/components/OrderedList/index.js +3 -1
  96. package/dist/components/OutsideClick/OutsideClick.js +40 -35
  97. package/dist/components/OutsideClick/index.js +3 -1
  98. package/dist/components/OverdriveProvider/OverdriveProvider.js +33 -19
  99. package/dist/components/OverdriveProvider/index.js +3 -1
  100. package/dist/components/Pagination/Bubble.js +41 -19
  101. package/dist/components/Pagination/Pagination.css.js +28 -20
  102. package/dist/components/Pagination/Pagination.js +166 -67
  103. package/dist/components/Pagination/index.js +3 -1
  104. package/dist/components/Portal/Portal.js +40 -24
  105. package/dist/components/Portal/index.js +3 -1
  106. package/dist/components/Positioner/Positioner.css.js +14 -6
  107. package/dist/components/Positioner/Positioner.js +109 -85
  108. package/dist/components/Positioner/alignment.js +13 -10
  109. package/dist/components/Positioner/index.js +4 -2
  110. package/dist/components/ProgressBar/ProgressBar.css.js +14 -6
  111. package/dist/components/ProgressBar/ProgressBar.js +30 -12
  112. package/dist/components/ProgressBar/index.js +3 -1
  113. package/dist/components/ProgressBarGroup/ProgressBarGroup.css.js +12 -4
  114. package/dist/components/ProgressBarGroup/ProgressBarGroup.js +42 -14
  115. package/dist/components/ProgressBarGroup/index.js +3 -1
  116. package/dist/components/ProgressSpinner/ProgressSpinner.css.js +81 -73
  117. package/dist/components/ProgressSpinner/ProgressSpinner.js +32 -14
  118. package/dist/components/ProgressSpinner/index.js +3 -1
  119. package/dist/components/Radio/Radio.css.js +31 -23
  120. package/dist/components/Radio/Radio.js +58 -19
  121. package/dist/components/Radio/RadioGroup.js +32 -7
  122. package/dist/components/Radio/index.js +4 -2
  123. package/dist/components/Section/Section.css.js +13 -5
  124. package/dist/components/Section/Section.js +19 -4
  125. package/dist/components/Section/index.js +3 -1
  126. package/dist/components/SelectInput/SelectInput.css.js +19 -11
  127. package/dist/components/SelectInput/SelectInput.js +60 -11
  128. package/dist/components/SelectInput/index.js +3 -1
  129. package/dist/components/SimplePagination/SimplePagination.js +57 -17
  130. package/dist/components/SimplePagination/index.js +3 -1
  131. package/dist/components/Stack/Divider.css.js +12 -4
  132. package/dist/components/Stack/Divider.js +13 -4
  133. package/dist/components/Stack/Stack.css.js +18 -10
  134. package/dist/components/Stack/Stack.js +47 -23
  135. package/dist/components/Stack/index.js +3 -1
  136. package/dist/components/StandardModal/StandardModal.css.js +69 -57
  137. package/dist/components/StandardModal/StandardModal.js +127 -52
  138. package/dist/components/StandardModal/index.js +3 -1
  139. package/dist/components/StarRating/StarRating.css.js +16 -8
  140. package/dist/components/StarRating/StarRating.js +90 -46
  141. package/dist/components/StarRating/index.js +3 -1
  142. package/dist/components/Stepper/Stepper.css.js +46 -36
  143. package/dist/components/Stepper/Stepper.js +159 -66
  144. package/dist/components/Stepper/index.js +3 -1
  145. package/dist/components/Switch/Switch.css.js +54 -46
  146. package/dist/components/Switch/Switch.js +54 -21
  147. package/dist/components/Switch/index.js +3 -1
  148. package/dist/components/Table/Table.css.js +14 -6
  149. package/dist/components/Table/Table.js +29 -6
  150. package/dist/components/Table/TableCell.css.js +28 -20
  151. package/dist/components/Table/TableCell.js +41 -11
  152. package/dist/components/Table/TableHeadCell.css.js +61 -50
  153. package/dist/components/Table/TableHeadCell.js +86 -40
  154. package/dist/components/Table/TableRow.js +18 -3
  155. package/dist/components/Table/TableRowGroup.js +16 -3
  156. package/dist/components/Table/context.js +21 -10
  157. package/dist/components/Table/index.js +7 -5
  158. package/dist/components/Tabs/Tab.css.js +43 -35
  159. package/dist/components/Tabs/Tab.js +79 -49
  160. package/dist/components/Tabs/TabList.css.js +30 -22
  161. package/dist/components/Tabs/TabList.js +122 -67
  162. package/dist/components/Tabs/TabPane.css.js +11 -3
  163. package/dist/components/Tabs/TabPane.js +32 -15
  164. package/dist/components/Tabs/TabPanes.css.js +16 -8
  165. package/dist/components/Tabs/TabPanes.js +23 -6
  166. package/dist/components/Tabs/Tabs.js +22 -10
  167. package/dist/components/Tabs/index.js +7 -5
  168. package/dist/components/Text/Text.js +37 -15
  169. package/dist/components/Text/index.js +4 -2
  170. package/dist/components/Text/useTextStyles.css.js +42 -20
  171. package/dist/components/Text/useTextStyles.js +20 -5
  172. package/dist/components/TextAreaInput/TextAreaInput.js +35 -7
  173. package/dist/components/TextAreaInput/index.js +3 -1
  174. package/dist/components/TextBubble/TextBubble.css.js +13 -5
  175. package/dist/components/TextBubble/TextBubble.js +66 -29
  176. package/dist/components/TextBubble/index.js +3 -1
  177. package/dist/components/TextContainer/TextContainer.js +44 -9
  178. package/dist/components/TextContainer/index.js +3 -1
  179. package/dist/components/TextInput/TextInput.js +36 -5
  180. package/dist/components/TextInput/index.js +3 -1
  181. package/dist/components/TextLink/TextLink.css.js +23 -15
  182. package/dist/components/TextLink/TextLink.js +63 -24
  183. package/dist/components/TextLink/index.js +3 -1
  184. package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.d.ts +3 -0
  185. package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.d.ts.map +1 -0
  186. package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.js +80 -0
  187. package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts +22 -0
  188. package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts.map +1 -0
  189. package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +39 -0
  190. package/dist/components/ThemeOverrideProvider/index.d.ts +3 -0
  191. package/dist/components/ThemeOverrideProvider/index.d.ts.map +1 -0
  192. package/dist/components/ThemeOverrideProvider/index.js +4 -0
  193. package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts +17 -0
  194. package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts.map +1 -0
  195. package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +97 -0
  196. package/dist/components/ThemeProvider/ThemeProvider.js +30 -11
  197. package/dist/components/ThemeProvider/index.js +3 -1
  198. package/dist/components/Toaster/Toast.css.js +18 -10
  199. package/dist/components/Toaster/Toast.js +222 -108
  200. package/dist/components/Toaster/index.js +3 -1
  201. package/dist/components/Tooltip/Tooltip.css.js +21 -9
  202. package/dist/components/Tooltip/Tooltip.js +72 -40
  203. package/dist/components/Tooltip/index.js +3 -1
  204. package/dist/components/VisuallyHidden/VisuallyHidden.css.js +13 -5
  205. package/dist/components/VisuallyHidden/VisuallyHidden.js +20 -4
  206. package/dist/components/VisuallyHidden/index.js +3 -1
  207. package/dist/components/index.d.ts +1 -0
  208. package/dist/components/index.d.ts.map +1 -1
  209. package/dist/components/index.js +59 -56
  210. package/dist/components/private/CheckableBase/CheckableBase.css.js +46 -38
  211. package/dist/components/private/CheckableBase/CheckableBase.js +91 -27
  212. package/dist/components/private/CheckableBase/index.js +3 -1
  213. package/dist/components/private/CheckableBase/useCheckableStyles.js +5 -3
  214. package/dist/components/private/InputBase/HintText.css.js +11 -3
  215. package/dist/components/private/InputBase/HintText.js +28 -14
  216. package/dist/components/private/InputBase/InputState.css.js +96 -80
  217. package/dist/components/private/InputBase/NotchedBase.css.js +157 -162
  218. package/dist/components/private/InputBase/NotchedBase.js +116 -76
  219. package/dist/components/private/InputBase/index.js +3 -1
  220. package/dist/components/private/InputBase/withEnhancedInput.css.js +117 -109
  221. package/dist/components/private/InputBase/withEnhancedInput.js +190 -92
  222. package/dist/hooks/useAttachedBoxes/index.js +3 -1
  223. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.css.js +26 -18
  224. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +71 -46
  225. package/dist/hooks/useMedia/index.js +3 -1
  226. package/dist/hooks/useMedia/useMedia.js +44 -34
  227. package/dist/hooks/useNegativeMargin/useNegativeMargin.js +4 -2
  228. package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.css.js +13 -5
  229. package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.js +6 -4
  230. package/dist/hooks/useNegativeMargin/useNegativeMarginTop.css.js +12 -4
  231. package/dist/hooks/useNegativeMargin/useNegativeMarginTop.js +6 -4
  232. package/dist/hooks/useResponsiveValue/index.js +3 -1
  233. package/dist/hooks/useResponsiveValue/useResponsiveValue.js +14 -14
  234. package/dist/hooks/useWindowScrollLock/index.js +15 -13
  235. package/dist/index.js +7 -5
  236. package/dist/reset/globalFonts.css.js +20 -12
  237. package/dist/reset/globalReset.css.js +21 -13
  238. package/dist/reset/reset.css.js +105 -109
  239. package/dist/themes/base/index.d.ts +1 -0
  240. package/dist/themes/base/index.d.ts.map +1 -1
  241. package/dist/themes/base/index.js +10 -6
  242. package/dist/themes/base/tokens.js +264 -257
  243. package/dist/themes/base/vars.css.js +10 -2
  244. package/dist/themes/flat_red/index.d.ts +1 -0
  245. package/dist/themes/flat_red/index.d.ts.map +1 -1
  246. package/dist/themes/flat_red/index.js +10 -6
  247. package/dist/themes/flat_red/tokens.js +104 -98
  248. package/dist/themes/flat_red/vars.css.js +10 -2
  249. package/dist/themes/helpers.js +60 -51
  250. package/dist/themes/index.js +4 -2
  251. package/dist/themes/makeTheme.js +27 -16
  252. package/dist/themes/theme.css.js +271 -259
  253. package/dist/themes/tokens.js +3 -1
  254. package/dist/utils/index.js +93 -77
  255. package/dist/utils/mapTokenToProperty.js +22 -10
  256. package/dist/utils/number.js +21 -24
  257. package/dist/utils/resolveResponsiveProps.js +29 -31
  258. package/dist/utils/responsiveProps.css.js +29 -17
  259. package/dist/utils/responsiveStyle.js +26 -16
  260. 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 '../../themes/theme.css';
8
+ import { themeContractVars as vars } from "../../themes/theme.css.js";
3
9
  export const circle = styleVariants({
4
- default: {
5
- transition: `border-color 0.2s ${vars.animation.easing.decelerate} 0s`,
6
- },
7
- outer: {
8
- top: vars.space['3'],
9
- left: vars.space['3'],
10
- width: vars.space['4'],
11
- height: vars.space['4'],
12
- },
13
- inner: {
14
- top: `calc(${vars.space['3']} + (${vars.space['4']} - ${vars.space['2']}) * 0.5)`,
15
- left: `calc(${vars.space['3']} + (${vars.space['4']} - ${vars.space['2']}) * 0.5)`,
16
- width: vars.space['2'],
17
- height: vars.space['2'],
18
- },
19
- selectedInner: {
20
- borderWidth: `calc(${vars.space['2']} / 2)`,
21
- },
22
- selected: {
23
- borderColor: vars.typography.colour.primary,
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 '../Box';
5
- import { CheckableBase } from '../private/CheckableBase';
6
- import { useCheckableStyles } from '../private/CheckableBase/useCheckableStyles';
7
- import * as styles from './Radio.css';
8
- import { useRadioContext } from './RadioGroup';
9
- export const Radio = forwardRef(({ value, className = '', children, disabled = false }, ref) => {
10
- const { checkableItem } = useCheckableStyles();
11
- const radioContext = useRadioContext();
12
- const isChecked = value === radioContext.value;
13
- const handleClick = () => radioContext.radioSelected?.(value);
14
- return (React.createElement(CheckableBase, { ref: ref, inputType: "radio", className: className, inputName: radioContext.inputName, value: value, label: children, disabled: disabled, checked: isChecked, handleClick: handleClick },
15
- React.createElement(Box, { borderRadius: "pill", position: "absolute", borderWidth: "2", borderColour: "gray", className: clsx(checkableItem, styles.circle.default, styles.circle.outer, {
16
- [styles.circle.selected]: isChecked,
17
- }) }),
18
- React.createElement(Box, { borderRadius: "pill", position: "absolute", borderColour: "gray", borderWidth: "none", className: clsx(styles.circle.default, styles.circle.inner, {
19
- [styles.circle.selected]: isChecked,
20
- [styles.circle.selectedInner]: isChecked,
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, } from 'react';
3
- import { Box } from '../Box';
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(({ name, value, className = '', onChange, children }, ref) => {
7
- const contextValue = useMemo(() => ({ value, inputName: name, radioSelected: onChange }), [value, name, onChange]);
8
- return (React.createElement(RadioContext.Provider, { value: contextValue },
9
- React.createElement(Box, { ref: ref, position: "relative", display: "flex", flexDirection: "column", width: "full", padding: "none", className: className }, children)));
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,2 +1,4 @@
1
- export { Radio } from './Radio';
2
- export { RadioGroup } from './RadioGroup';
1
+ "use strict";
2
+
3
+ export { Radio } from "./Radio.js";
4
+ export { RadioGroup } from "./RadioGroup.js";
@@ -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 '../../themes/theme.css';
3
- import { mapTokenToProperty } from '../../utils/mapTokenToProperty';
8
+ import { themeContractVars as vars } from "../../themes/theme.css.js";
9
+ import { mapTokenToProperty } from "../../utils/mapTokenToProperty.js";
4
10
  export const root = style({
5
- margin: '0 auto',
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 '../Box';
4
- import * as styles from './Section.css';
5
- export const Section = ({ children, width = 'medium', paddingX, }) => (React.createElement(Box, { className: clsx(styles.root, styles.width[width]), width: "full", paddingX: paddingX }, children));
6
- export default Section;
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 +1,3 @@
1
- export { Section } from './Section';
1
+ "use strict";
2
+
3
+ export { Section } from "./Section.js";
@@ -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 '../../themes/theme.css';
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
- selectors: {
6
- [`${input}&`]: {
7
- paddingRight: vars.space['8'],
8
- },
9
- },
10
- });
11
+ selectors: {
12
+ ["".concat(input, "&")]: {
13
+ paddingRight: vars.space['8']
14
+ }
15
+ }
16
+ }, "paddedInput");
11
17
  export const arrow = style({
12
- top: '0',
13
- right: '0',
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 '../Box';
4
- import { Icon } from '../Icon';
5
- import { withEnhancedInput } from '../private/InputBase';
6
- import * as styles from './SelectInput.css';
7
- export const SelectInput = withEnhancedInput(({ field, eventHandlers, suffixed, prefixed, validation, isLoading, size, fieldIcon = ChevronDownIcon, ...rest }) => (React.createElement(Box, { display: "flex", flexWrap: "nowrap", alignItems: "center", justifyContent: "center", position: "relative" },
8
- React.createElement(Box, { is: "select", flexGrow: 1, ...eventHandlers, ...field, ...rest, className: [styles.input, styles.paddedInput, field.className], autoComplete: "off" }),
9
- isLoading ? null : (React.createElement(Box, { className: styles.arrow, display: "flex", alignItems: "center", height: "full", marginRight: size === 'medium' ? '4' : '2', flexShrink: 0, pointerEvents: "none", position: "absolute" },
10
- React.createElement(Icon, { size: "medium", icon: fieldIcon }))))), {
11
- primitiveType: 'select',
12
- withSuffixIcon: false,
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 +1,3 @@
1
- export { SelectInput } from './SelectInput';
1
+ "use strict";
2
+
3
+ export { SelectInput } from "./SelectInput.js";
@@ -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 '../../utils';
4
- import { Button } from '../Button';
5
- import { Icon } from '../Icon';
6
- import { Inline } from '../Inline';
7
- export var EChangeDirection;
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
- EChangeDirection["Previous"] = "previous";
10
- EChangeDirection["Next"] = "next";
14
+ EChangeDirection["Previous"] = "previous";
15
+ EChangeDirection["Next"] = "next";
11
16
  })(EChangeDirection || (EChangeDirection = {}));
12
- export const SimplePagination = ({ hasNext = false, hasPrevious = false, onChange = noop, }) => {
13
- const handleClick = (direction) => () => {
14
- onChange(direction);
15
- };
16
- return (React.createElement(Inline, { is: "nav", space: "6", "aria-label": "pagination", alignX: "center", alignY: "center" },
17
- React.createElement(Button, { rounded: true, withDoubleClicks: true, disabled: !hasPrevious, size: "small", variant: "secondary", "aria-label": "previous page", onClick: handleClick(EChangeDirection.Previous) },
18
- React.createElement(Icon, { size: "medium", icon: ChevronLeftIcon })),
19
- React.createElement(Button, { rounded: true, withDoubleClicks: true, disabled: !hasNext, size: "small", variant: "secondary", "aria-label": "next page", onClick: handleClick(EChangeDirection.Next) },
20
- React.createElement(Icon, { size: "medium", icon: ChevronRightIcon }))));
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 +1,3 @@
1
- export { SimplePagination, EChangeDirection as EPageChangeDirection, } from './SimplePagination';
1
+ "use strict";
2
+
3
+ export { SimplePagination, EChangeDirection as EPageChangeDirection } from "./SimplePagination.js";
@@ -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 '../../themes/theme.css';
8
+ import { themeContractVars as vars } from "../../themes/theme.css.js";
3
9
  export const line = style({
4
- height: '1px',
5
- boxShadow: `inset 0 0 0 1px ${vars.colours.background.light}`,
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 '../Box';
3
- import * as styles from './Divider.css';
4
- export const Divider = () => (React.createElement(Box, { position: "relative" },
5
- React.createElement(Box, { position: "absolute", className: styles.line, width: "full" })));
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 '../../themes/theme.css';
3
- import { mapTokenToProperty } from '../../utils/mapTokenToProperty';
8
+ import { themeContractVars as vars } from "../../themes/theme.css.js";
9
+ import { mapTokenToProperty } from "../../utils/mapTokenToProperty.js";
4
10
  export const child = {
5
- spaces: styleVariants(mapTokenToProperty(vars.space, (value) => ({
6
- paddingBottom: value,
7
- }))),
8
- default: style({
9
- ':last-child': {
10
- paddingBottom: 0,
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 '../Box';
5
- import { Divider } from './Divider';
6
- import * as styles from './Stack.css';
7
- const supportedListTypes = [
8
- 'ul',
9
- 'ol',
10
- ];
11
- export const Stack = ({ space = '2', children, is = 'div', alignItems, width, dividers = false, className = '', }) => {
12
- const items = flattenChildren(children);
13
- if (items.length < 2) {
14
- return React.createElement(React.Fragment, null, items);
15
- }
16
- let listItem = 'div';
17
- if (typeof is === 'string')
18
- listItem = supportedListTypes.includes(is) ? 'li' : 'div';
19
- return (React.createElement(Box, { is: is, className: className, width: width }, Children.map(items, (child, idx) => (React.createElement(Box, { is: listItem, display: alignItems ? 'flex' : void 0, flexDirection: "column", alignItems: alignItems, className: [
20
- styles.child.default,
21
- dividers ? undefined : styles.child.spaces[space],
22
- ] },
23
- dividers && idx > 0 ? (React.createElement(Box, { paddingY: space, width: "full" },
24
- React.createElement(Divider, null))) : null,
25
- child)))));
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;
@@ -1 +1,3 @@
1
- export { Stack } from './Stack';
1
+ "use strict";
2
+
3
+ export { Stack } from "./Stack.js";