@autoguru/overdrive 4.33.1 → 4.35.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 (218) hide show
  1. package/dist/components/Alert/Alert.js +1 -2
  2. package/dist/components/Anchor/Anchor.js +3 -4
  3. package/dist/components/AutoSuggest/AutoSuggest.css.js +3 -3
  4. package/dist/components/AutoSuggest/AutoSuggest.d.ts.map +1 -1
  5. package/dist/components/AutoSuggest/AutoSuggest.js +8 -9
  6. package/dist/components/Box/Box.js +2 -2
  7. package/dist/components/Box/argTypes.d.ts.map +1 -1
  8. package/dist/components/Box/argTypes.js +2 -2
  9. package/dist/components/Box/useBoxStyles.css.d.ts +1 -1
  10. package/dist/components/Box/useBoxStyles.css.d.ts.map +1 -1
  11. package/dist/components/Box/useBoxStyles.css.js +5 -11
  12. package/dist/components/BulletList/Bullet.css.js +3 -3
  13. package/dist/components/BulletList/Bullet.d.ts.map +1 -1
  14. package/dist/components/BulletList/Bullet.js +12 -4
  15. package/dist/components/BulletText/BulletText.js +1 -2
  16. package/dist/components/Button/Button.css.js +21 -21
  17. package/dist/components/Button/Button.js +3 -5
  18. package/dist/components/CheckBox/CheckBox.css.js +3 -3
  19. package/dist/components/CheckBox/CheckBox.js +1 -2
  20. package/dist/components/ColourInput/ColourInput.css.js +2 -2
  21. package/dist/components/ColourInput/ColourInput.js +3 -4
  22. package/dist/components/Columns/Column.css.js +1 -1
  23. package/dist/components/Columns/Column.js +2 -2
  24. package/dist/components/Columns/Columns.js +2 -2
  25. package/dist/components/DateInput/DateInput.js +2 -2
  26. package/dist/components/DatePicker/DatePicker.js +3 -4
  27. package/dist/components/DividerLine/DividerLine.d.ts +1 -1
  28. package/dist/components/DividerLine/DividerLine.d.ts.map +1 -1
  29. package/dist/components/DividerLine/DividerLine.js +1 -1
  30. package/dist/components/DropDown/DropDown.js +3 -5
  31. package/dist/components/DropDown/DropDownOption.css.js +2 -2
  32. package/dist/components/DropDown/DropDownOption.js +3 -4
  33. package/dist/components/EditableText/EditableText.css.js +1 -1
  34. package/dist/components/EditableText/EditableText.d.ts.map +1 -1
  35. package/dist/components/EditableText/EditableText.js +5 -6
  36. package/dist/components/FillHeightBox/FillHeightBox.js +2 -2
  37. package/dist/components/Flyout/Flyout.js +2 -2
  38. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.css.js +1 -1
  39. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts +1 -1
  40. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts.map +1 -1
  41. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +5 -7
  42. package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.d.ts.map +1 -1
  43. package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.js +5 -9
  44. package/dist/components/Image/Image.js +2 -2
  45. package/dist/components/Image/ImageServerProvider.js +9 -8
  46. package/dist/components/Image/ResponsiveImage.js +2 -2
  47. package/dist/components/Image/SimpleImage.js +2 -2
  48. package/dist/components/Inline/Inline.js +1 -3
  49. package/dist/components/LoadingBox/LoadingBox.js +3 -3
  50. package/dist/components/Meta/Meta.js +2 -3
  51. package/dist/components/MinimalModal/MinimalModal.js +2 -2
  52. package/dist/components/Modal/Modal.css.js +1 -1
  53. package/dist/components/Modal/Modal.d.ts.map +1 -1
  54. package/dist/components/Modal/Modal.js +16 -9
  55. package/dist/components/NumberBubble/NumberBubble.js +2 -2
  56. package/dist/components/NumberInput/NumberInput.js +3 -3
  57. package/dist/components/OrderedList/OrderedList.css.js +1 -1
  58. package/dist/components/OutsideClick/OutsideClick.js +1 -1
  59. package/dist/components/Pagination/Pagination.css.js +6 -6
  60. package/dist/components/Pagination/Pagination.js +1 -2
  61. package/dist/components/Positioner/Positioner.d.ts.map +1 -1
  62. package/dist/components/Positioner/Positioner.js +17 -7
  63. package/dist/components/Positioner/alignment.js +3 -3
  64. package/dist/components/ProgressBar/ProgressBar.css.js +1 -1
  65. package/dist/components/ProgressBar/ProgressBar.js +1 -1
  66. package/dist/components/ProgressBarGroup/ProgressBarGroup.css.js +1 -1
  67. package/dist/components/ProgressBarGroup/ProgressBarGroup.js +2 -3
  68. package/dist/components/Radio/Radio.css.js +4 -4
  69. package/dist/components/Radio/Radio.js +1 -2
  70. package/dist/components/ScrollPane/ScrollPane.css.js +3 -3
  71. package/dist/components/ScrollPane/ScrollPane.js +2 -2
  72. package/dist/components/SelectInput/SelectInput.css.js +3 -3
  73. package/dist/components/SelectInput/SelectInput.d.ts +1 -1
  74. package/dist/components/SelectInput/SelectInput.d.ts.map +1 -1
  75. package/dist/components/SelectInput/SelectInput.js +5 -5
  76. package/dist/components/SimplePagination/SimplePagination.js +4 -5
  77. package/dist/components/SliderProgress/ProgressStep.js +1 -2
  78. package/dist/components/SliderProgress/SliderProgress.css.js +1 -1
  79. package/dist/components/SliderProgress/SliderProgress.js +1 -1
  80. package/dist/components/Stack/Divider.css.js +1 -1
  81. package/dist/components/Stack/Stack.js +1 -3
  82. package/dist/components/StandardModal/StandardModal.css.js +8 -8
  83. package/dist/components/StandardModal/StandardModal.js +4 -5
  84. package/dist/components/StarRating/StarRating.js +7 -8
  85. package/dist/components/Stepper/Stepper.css.js +4 -4
  86. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  87. package/dist/components/Stepper/Stepper.js +19 -10
  88. package/dist/components/StickyBox/StickyBox.css.js +4 -4
  89. package/dist/components/StickyBox/StickyBox.js +3 -3
  90. package/dist/components/Switch/Switch.css.js +18 -18
  91. package/dist/components/Switch/Switch.js +4 -5
  92. package/dist/components/Table/TableCell.css.js +1 -1
  93. package/dist/components/Table/TableHeadCell.css.js +5 -5
  94. package/dist/components/Table/TableHeadCell.js +1 -2
  95. package/dist/components/Tabs/Tab.css.js +4 -4
  96. package/dist/components/Tabs/Tab.js +2 -3
  97. package/dist/components/Tabs/TabList.css.js +1 -1
  98. package/dist/components/Tabs/TabList.js +1 -2
  99. package/dist/components/Tabs/TabPane.js +1 -1
  100. package/dist/components/Text/useTextStyles.css.js +2 -2
  101. package/dist/components/TextAreaInput/TextAreaInput.js +2 -2
  102. package/dist/components/TextBubble/TextBubble.d.ts.map +1 -1
  103. package/dist/components/TextBubble/TextBubble.js +14 -6
  104. package/dist/components/TextContainer/TextContainer.js +1 -2
  105. package/dist/components/TextInput/TextInput.js +2 -2
  106. package/dist/components/TextLink/TextLink.css.js +4 -4
  107. package/dist/components/TextLink/TextLink.js +3 -4
  108. package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.js +1 -2
  109. package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +2 -2
  110. package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts.map +1 -1
  111. package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +5 -3
  112. package/dist/components/Toaster/Toast.css.js +1 -1
  113. package/dist/components/Toaster/Toast.d.ts.map +1 -1
  114. package/dist/components/Toaster/Toast.js +24 -20
  115. package/dist/components/Tooltip/Tooltip.css.js +2 -2
  116. package/dist/components/Tooltip/Tooltip.js +1 -3
  117. package/dist/components/private/CheckableBase/CheckableBase.css.js +8 -8
  118. package/dist/components/private/CheckableBase/CheckableBase.js +1 -2
  119. package/dist/components/private/InputBase/HintText.css.js +1 -1
  120. package/dist/components/private/InputBase/NotchedBase.css.js +20 -20
  121. package/dist/components/private/InputBase/NotchedBase.js +1 -2
  122. package/dist/components/private/InputBase/withEnhancedInput.css.js +16 -16
  123. package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
  124. package/dist/components/private/InputBase/withEnhancedInput.js +3 -4
  125. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.d.ts +1 -1
  126. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.d.ts.map +1 -1
  127. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +5 -5
  128. package/dist/hooks/useMedia/useMedia.js +4 -4
  129. package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.css.js +2 -2
  130. package/dist/hooks/useNegativeMargin/useNegativeMarginTop.css.js +1 -1
  131. package/dist/hooks/useNullCheck/useNullCheck.js +1 -1
  132. package/dist/hooks/useWindowHeightFill/useWindowHeightFill.d.ts.map +1 -1
  133. package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +4 -3
  134. package/dist/reset/globalFonts.css.js +3 -3
  135. package/dist/reset/reset.css.js +2 -2
  136. package/dist/themes/base/tokens.js +3 -3
  137. package/dist/themes/flat_red/tokens.js +2 -2
  138. package/dist/themes/helpers.d.ts.map +1 -1
  139. package/dist/themes/helpers.js +2 -2
  140. package/dist/themes/makeTheme.js +3 -3
  141. package/dist/themes/neutral/tokens.js +3 -3
  142. package/dist/themes/theme.css.js +2 -2
  143. package/dist/utils/css.js +1 -1
  144. package/dist/utils/index.d.ts +1 -1
  145. package/dist/utils/index.d.ts.map +1 -1
  146. package/dist/utils/index.js +6 -5
  147. package/dist/utils/mapTokenToProperty.js +2 -2
  148. package/dist/utils/number.js +1 -1
  149. package/dist/utils/responsiveProps.css.d.ts.map +1 -1
  150. package/dist/utils/responsiveProps.css.js +2 -2
  151. package/dist/utils/responsiveStyle.js +3 -3
  152. package/package.json +118 -26
  153. package/dist/components/Actions/stories.js +0 -53
  154. package/dist/components/Alert/stories.js +0 -106
  155. package/dist/components/Anchor/stories.js +0 -65
  156. package/dist/components/AutoSuggest/stories.js +0 -213
  157. package/dist/components/Badge/stories.js +0 -64
  158. package/dist/components/Box/stories.js +0 -43
  159. package/dist/components/BulletList/stories.js +0 -72
  160. package/dist/components/BulletText/stories.js +0 -88
  161. package/dist/components/Button/stories.js +0 -291
  162. package/dist/components/CheckBox/stories.js +0 -206
  163. package/dist/components/ColourInput/stories.js +0 -173
  164. package/dist/components/Columns/stories.js +0 -209
  165. package/dist/components/DateInput/stories.js +0 -181
  166. package/dist/components/DatePicker/stories.js +0 -89
  167. package/dist/components/DividerLine/stories.js +0 -117
  168. package/dist/components/DropDown/stories.js +0 -117
  169. package/dist/components/EditableText/stories.js +0 -84
  170. package/dist/components/FillHeightBox/stories.js +0 -47
  171. package/dist/components/Flyout/stories.js +0 -88
  172. package/dist/components/Heading/stories.js +0 -127
  173. package/dist/components/HorizontalAutoScroller/stories.js +0 -88
  174. package/dist/components/Icon/stories.js +0 -62
  175. package/dist/components/Image/stories.js +0 -183
  176. package/dist/components/Inline/stories.js +0 -122
  177. package/dist/components/IntentStripe/stories.js +0 -76
  178. package/dist/components/LinearProgressIndicator/stories.js +0 -26
  179. package/dist/components/LoadingBox/stories.js +0 -41
  180. package/dist/components/Meta/stories.js +0 -45
  181. package/dist/components/MinimalModal/stories.js +0 -83
  182. package/dist/components/Modal/stories.js +0 -52
  183. package/dist/components/NumberBubble/stories.js +0 -23
  184. package/dist/components/NumberInput/stories.js +0 -218
  185. package/dist/components/OrderedList/stories.js +0 -58
  186. package/dist/components/OutsideClick/stories.js +0 -39
  187. package/dist/components/Pagination/stories.js +0 -112
  188. package/dist/components/Portal/stories.js +0 -72
  189. package/dist/components/Positioner/stories.js +0 -124
  190. package/dist/components/ProgressBar/stories.js +0 -44
  191. package/dist/components/ProgressBarGroup/stories.js +0 -21
  192. package/dist/components/ProgressSpinner/stories.js +0 -36
  193. package/dist/components/Radio/stories.js +0 -215
  194. package/dist/components/ScrollPane/stories.js +0 -55
  195. package/dist/components/Section/stories.js +0 -43
  196. package/dist/components/SelectInput/stories.js +0 -188
  197. package/dist/components/SimplePagination/stories.js +0 -42
  198. package/dist/components/SliderProgress/stories.js +0 -44
  199. package/dist/components/Stack/stories.js +0 -75
  200. package/dist/components/StandardModal/stories.js +0 -62
  201. package/dist/components/StarRating/stories.js +0 -50
  202. package/dist/components/Stepper/stories.js +0 -61
  203. package/dist/components/StickyBox/stories.js +0 -70
  204. package/dist/components/Switch/stories.js +0 -42
  205. package/dist/components/Table/stories.js +0 -302
  206. package/dist/components/Tabs/stories.js +0 -253
  207. package/dist/components/Text/stories.js +0 -154
  208. package/dist/components/TextAreaInput/stories.js +0 -129
  209. package/dist/components/TextBubble/stories.js +0 -30
  210. package/dist/components/TextContainer/stories.js +0 -128
  211. package/dist/components/TextInput/stories.js +0 -260
  212. package/dist/components/TextLink/stories.js +0 -111
  213. package/dist/components/Toaster/stories.js +0 -59
  214. package/dist/components/Tooltip/stories.js +0 -90
  215. package/dist/components/VisuallyHidden/stories.js +0 -36
  216. package/dist/hooks/useAttachedBoxes/stories.js +0 -94
  217. package/dist/hooks/useMedia/stories.js +0 -46
  218. package/dist/hooks/useResponsiveValue/stories.js +0 -38
@@ -1,117 +0,0 @@
1
- "use strict";
2
-
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
- import { DownloadIcon, SettingsIcon, SquareEditOutlineIcon, TrashCanOutlineIcon } from '@autoguru/icons';
7
- import { action } from '@storybook/addon-actions';
8
- import * as React from 'react';
9
- import { Fragment } from 'react';
10
- import { Box } from "../Box/index.js";
11
- import { DropDown, DropDownOption } from "./index.js";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { Fragment as _Fragment } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
- const onClick = action('onClick');
16
- export default {
17
- title: 'Components/DropDown',
18
- component: DropDown,
19
- decorators: [story => _jsx("div", {
20
- style: {
21
- display: 'grid',
22
- gridGap: '12px',
23
- gridAutoFlow: 'row dense'
24
- },
25
- children: story()
26
- })],
27
- argTypes: {
28
- size: {
29
- options: ['small', 'medium'],
30
- defaultValue: 'medium',
31
- control: {
32
- type: 'select'
33
- }
34
- },
35
- variant: {
36
- options: ['primary', 'secondary', 'danger', 'information', 'warning', 'danger'],
37
- defaultValue: 'primary',
38
- control: {
39
- type: 'select'
40
- }
41
- }
42
- }
43
- };
44
- const Template = args => _jsx(Box, {
45
- style: {
46
- height: '100vh',
47
- width: '100vw',
48
- maxHeight: '350px'
49
- },
50
- display: "flex",
51
- alignItems: "center",
52
- justifyContent: "center",
53
- children: _jsx(DropDown, _objectSpread({}, args))
54
- });
55
- const option1 = _jsx(DropDownOption, {
56
- label: "Download",
57
- icon: DownloadIcon
58
- });
59
- const option2 = _jsx(DropDownOption, {
60
- label: "Delete",
61
- icon: TrashCanOutlineIcon
62
- });
63
- const optionDisabled = _jsx(DropDownOption, {
64
- disabled: true,
65
- label: "Edit",
66
- icon: SquareEditOutlineIcon
67
- });
68
- const standardProps = {
69
- label: 'Attachment',
70
- children: _jsxs(_Fragment, {
71
- children: [option1, option1, optionDisabled]
72
- }),
73
- onClick
74
- };
75
- export const primary = Template.bind(standardProps);
76
- primary.args = standardProps;
77
- const withOpenMenuProps = _objectSpread(_objectSpread({}, standardProps), {}, {
78
- isOpen: true
79
- });
80
- export const withOpenMenu = Template.bind(withOpenMenuProps);
81
- withOpenMenu.args = withOpenMenuProps;
82
- const secondaryProps = _objectSpread(_objectSpread({}, standardProps), {}, {
83
- variant: 'secondary'
84
- });
85
- export const secondary = Template.bind(secondaryProps);
86
- secondary.args = secondaryProps;
87
- const minimalPrimaryProps = _objectSpread(_objectSpread({}, standardProps), {}, {
88
- variant: 'primary',
89
- minimal: true
90
- });
91
- export const minimalPrimary = Template.bind(minimalPrimaryProps);
92
- minimalPrimary.args = minimalPrimaryProps;
93
- const roundedSecondaryProps = _objectSpread(_objectSpread({}, standardProps), {}, {
94
- variant: 'secondary',
95
- rounded: true
96
- });
97
- export const roundedSecondary = Template.bind(roundedSecondaryProps);
98
- roundedSecondary.args = roundedSecondaryProps;
99
- const withCustomIconProps = _objectSpread(_objectSpread({}, standardProps), {}, {
100
- variant: 'secondary',
101
- icon: SettingsIcon,
102
- isOpen: true
103
- });
104
- export const withCustomIcon = Template.bind(withCustomIconProps);
105
- withCustomIcon.args = withCustomIconProps;
106
- const withManyOptionsProps = _objectSpread(_objectSpread({}, standardProps), {}, {
107
- isOpen: true,
108
- children: _jsx(_Fragment, {
109
- children: Array.from({
110
- length: 99
111
- }).map((_, index) => _jsx(Fragment, {
112
- children: index % 2 == 0 ? option1 : option2
113
- }, index))
114
- })
115
- });
116
- export const withManyOptions = Template.bind(withManyOptionsProps);
117
- withManyOptions.args = withManyOptionsProps;
@@ -1,84 +0,0 @@
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 = ["onChange", "value"];
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
- import isChromatic from 'chromatic';
9
- import * as React from 'react';
10
- import { useState } from 'react';
11
- import { EditableText } from "./index.js";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- export default {
14
- title: 'Components/Inputs/EditableText',
15
- component: EditableText,
16
- argTypes: {
17
- colour: {
18
- options: ['muted', 'primary', 'secondary'],
19
- defaultValue: 'primary',
20
- control: {
21
- type: 'select'
22
- }
23
- }
24
- }
25
- };
26
- const template = _ref => {
27
- let {
28
- onChange: incomingOnChange,
29
- value: incomingValue
30
- } = _ref,
31
- args = _objectWithoutProperties(_ref, _excluded);
32
- const [value, setValue] = useState(incomingValue);
33
- return _jsx(EditableText, _objectSpread({
34
- onChange: e => {
35
- setValue(e.currentTarget.value);
36
- typeof incomingOnChange === 'function' && incomingOnChange(e.currentTarget.value);
37
- },
38
- value: value
39
- }, args));
40
- };
41
- const textProps = {
42
- colour: 'muted',
43
- value: 'Hello World',
44
- type: 'text'
45
- };
46
- const numberProps = {
47
- colour: 'muted',
48
- value: '20',
49
- type: 'number'
50
- };
51
- const formatDate = function () {
52
- let date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
53
- const year = date.getFullYear();
54
- const month = (date.getMonth() + 1).toString().padStart(2, '0');
55
- const day = date.getDate().toString().padStart(2, '0');
56
- return "".concat(year, "-").concat(month, "-").concat(day);
57
- };
58
- const todayStr = formatDate(isChromatic() ? new Date(2019, 5, 1) : new Date());
59
- const dateProps = {
60
- colour: 'muted',
61
- value: todayStr,
62
- type: 'date'
63
- };
64
- const narrowCharactersProps = {
65
- colour: 'muted',
66
- value: 'Price is $111.01',
67
- type: 'text'
68
- };
69
- const customSizeProps = {
70
- colour: 'warning',
71
- value: '$999.99',
72
- type: 'text',
73
- size: '6'
74
- };
75
- export const text = template.bind(textProps);
76
- export const number = template.bind(numberProps);
77
- export const date = template.bind(dateProps);
78
- export const narrowCharacters = template.bind(narrowCharactersProps);
79
- export const customSize = template.bind(customSizeProps);
80
- text.args = textProps;
81
- number.args = numberProps;
82
- date.args = dateProps;
83
- narrowCharacters.args = narrowCharactersProps;
84
- customSize.args = customSizeProps;
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
- import * as React from 'react';
7
- import { Box } from "../Box/index.js";
8
- import { StickyBox } from "../StickyBox/index.js";
9
- import { Text } from "../Text/index.js";
10
- import { FillHeightBox } from "./FillHeightBox.js";
11
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- export default {
14
- title: 'Foundation/Layout/FillHeightBox',
15
- component: StickyBox
16
- };
17
- const Template = args => _jsx(FillHeightBox, _objectSpread(_objectSpread({
18
- rounded: true,
19
- includeMobile: true,
20
- bottomGap: "5",
21
- width: "full",
22
- backgroundColour: "white",
23
- borderColour: "gray",
24
- borderWidth: "1",
25
- boxShadow: "1",
26
- height: "full",
27
- borderRadius: "1"
28
- }, args), {}, {
29
- children: _jsx(Box, {
30
- padding: "5",
31
- width: "full",
32
- style: {
33
- minHeight: '300vh'
34
- },
35
- children: Array.from({
36
- length: 100
37
- }).map((_, i) => _jsxs(Text, {
38
- is: "p",
39
- children: ["I am page content ", i + 1]
40
- }, i))
41
- })
42
- }));
43
- const standardProps = {
44
- top: 'none'
45
- };
46
- export const standard = Template.bind(standardProps);
47
- standard.args = standardProps;
@@ -1,88 +0,0 @@
1
- "use strict";
2
-
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
5
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
- import * as React from 'react';
8
- import { useRef } from 'react';
9
- import { Box } from "../Box/index.js";
10
- import { Button } from "../Button/index.js";
11
- import { EAlignment } from "../Positioner/alignment.js";
12
- import { TextInput } from "../TextInput/index.js";
13
- import { Flyout } from "./index.js";
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
- export default {
17
- title: 'Components/Flyout',
18
- component: Flyout,
19
- argTypes: {
20
- alignment: {
21
- options: EAlignment,
22
- defaultValue: EAlignment.BOTTOM_LEFT,
23
- control: {
24
- type: 'select'
25
- }
26
- },
27
- triggerOffset: {
28
- control: {
29
- type: 'range',
30
- min: 0,
31
- max: 400
32
- }
33
- }
34
- },
35
- parameters: {
36
- chromatic: {}
37
- }
38
- };
39
- const sharedProps = {
40
- alignment: EAlignment.BOTTOM_LEFT,
41
- isOpen: false,
42
- triggerOffset: 12
43
- };
44
- const Template = _ref => {
45
- let args = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
46
- const triggerRef = useRef(null);
47
- return _jsxs(Box, {
48
- style: {
49
- height: '100vh',
50
- width: '100vw',
51
- maxHeight: '350px'
52
- },
53
- display: "flex",
54
- alignItems: "center",
55
- justifyContent: "center",
56
- children: [_jsx(Button, {
57
- ref: triggerRef,
58
- children: "some trigger"
59
- }), _jsx(Flyout, _objectSpread(_objectSpread({}, args), {}, {
60
- triggerRef: triggerRef,
61
- children: _jsxs("div", {
62
- style: {
63
- display: 'grid',
64
- gridTemplateRows: 'repeat(2, auto)',
65
- gridGap: '16px',
66
- padding: '16px'
67
- },
68
- children: [_jsx(TextInput, {
69
- name: "example",
70
- placeholder: "example"
71
- }), _jsx("div", {
72
- children: _jsx(Button, {
73
- size: "small",
74
- variant: "primary",
75
- children: "Save"
76
- })
77
- })]
78
- })
79
- }))]
80
- });
81
- };
82
- const openProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
83
- isOpen: true
84
- });
85
- export const Open = Template.bind(openProps);
86
- Open.args = openProps;
87
- export const Closed = Template.bind(sharedProps);
88
- Closed.args = sharedProps;
@@ -1,127 +0,0 @@
1
- "use strict";
2
-
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
- import * as React from 'react';
7
- import { Heading } from "./index.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- const noWrapOptions = [false, true];
10
- const wordBreakOptions = [false, true];
11
- const transformOptions = ['uppercase', 'capitalize', undefined];
12
- const weightOptions = ['normal', 'semiBold', 'bold'];
13
- const headingTypeOptions = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
14
- const sizeScale = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
15
- const alignOptions = ['left', 'center', 'right'];
16
- const colourOptions = ['dark', 'light', 'neutral', 'primary', 'secondary', 'white', 'information', 'link', 'success', 'danger', 'warning', 'shine'];
17
- export default {
18
- title: 'Foundation/Typography/Heading',
19
- argTypes: {
20
- noWrap: {
21
- options: noWrapOptions,
22
- defaultValue: false,
23
- control: {
24
- type: 'boolean'
25
- }
26
- },
27
- breakWord: {
28
- options: wordBreakOptions,
29
- defaultValue: false,
30
- control: {
31
- type: 'boolean'
32
- }
33
- },
34
- transform: {
35
- options: transformOptions,
36
- defaultValue: null,
37
- control: {
38
- type: 'select'
39
- }
40
- },
41
- weight: {
42
- options: weightOptions,
43
- defaultValue: null,
44
- control: {
45
- type: 'select'
46
- }
47
- },
48
- size: {
49
- options: sizeScale,
50
- defaultValue: void 0,
51
- control: {
52
- type: 'select'
53
- }
54
- },
55
- align: {
56
- options: alignOptions,
57
- defaultValue: 'left',
58
- control: {
59
- type: 'select'
60
- }
61
- },
62
- colour: {
63
- options: colourOptions,
64
- defaultValue: void 0,
65
- control: {
66
- type: 'select'
67
- }
68
- },
69
- is: {
70
- options: headingTypeOptions,
71
- defaultValue: 'h1',
72
- table: {
73
- type: {
74
- summary: 'heading'
75
- },
76
- defaultValue: 'h1'
77
- },
78
- description: 'HTML heading tag to be used',
79
- control: {
80
- type: 'select'
81
- }
82
- }
83
- }
84
- };
85
- const Template = args => _jsx("div", {
86
- style: {
87
- maxWidth: '350px',
88
- width: '100%'
89
- },
90
- children: _jsx(Heading, _objectSpread({}, args))
91
- });
92
- const AllTypesTemplate = args => _jsx("div", {
93
- style: {
94
- maxWidth: '350px',
95
- width: '100%'
96
- },
97
- children: headingTypeOptions.map(is => _jsx(Heading, _objectSpread(_objectSpread({}, args), {}, {
98
- is: is
99
- }), is))
100
- });
101
- const AllColoursTemplate = args => _jsx("div", {
102
- style: {
103
- maxWidth: '350px',
104
- width: '100%'
105
- },
106
- children: colourOptions.map((colour, index) => _jsx("div", {
107
- style: {
108
- marginBottom: 8
109
- },
110
- children: _jsx(Heading, _objectSpread(_objectSpread({}, args), {}, {
111
- colour: colour
112
- }), index)
113
- }, index))
114
- });
115
- const standardProps = {
116
- is: 'h1',
117
- children: 'I am a heading'
118
- };
119
- const allTypesProps = {
120
- children: 'I am a heading'
121
- };
122
- export const standard = Template.bind(standardProps);
123
- standard.args = standardProps;
124
- export const allTypes = AllTypesTemplate.bind(allTypesProps);
125
- allTypes.args = allTypesProps;
126
- export const allColours = AllColoursTemplate.bind(allTypesProps);
127
- allColours.args = allTypesProps;
@@ -1,88 +0,0 @@
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 = ["childrenNum"];
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
- import * as React from 'react';
9
- import { Box } from "../Box/index.js";
10
- import { boxArgTypes, scaleOptions } from "../Box/argTypes.js";
11
- import { HorizontalAutoScroller } from "./index.js";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- export default {
14
- title: 'Components/HorizontalAutoScroller',
15
- component: HorizontalAutoScroller,
16
- argTypes: {
17
- sliderProgressColour: boxArgTypes.backgroundColour,
18
- space: {
19
- options: scaleOptions,
20
- control: {
21
- type: 'select'
22
- }
23
- },
24
- paused: {
25
- control: {
26
- type: 'boolean'
27
- }
28
- },
29
- noControls: {
30
- control: {
31
- type: 'boolean'
32
- }
33
- }
34
- }
35
- };
36
- const template = _ref => {
37
- let {
38
- childrenNum
39
- } = _ref,
40
- args = _objectWithoutProperties(_ref, _excluded);
41
- return _jsx(HorizontalAutoScroller, _objectSpread(_objectSpread({}, args), {}, {
42
- children: Array.from({
43
- length: childrenNum
44
- }).map((_, index) => _jsx(Box, {
45
- backgroundColour: "gray200",
46
- padding: "3",
47
- display: "flex",
48
- width: "full",
49
- height: "full",
50
- alignItems: "center",
51
- justifyContent: "center",
52
- children: _jsx(Box, {
53
- style: {
54
- width: '100%',
55
- height: 20 + Math.ceil(Math.random() * 300)
56
- },
57
- backgroundColour: "gray900"
58
- })
59
- }, index))
60
- }));
61
- };
62
- const standardProps = {
63
- paused: false,
64
- activePage: 0,
65
- childrenNum: 9
66
- };
67
- export const standard = template.bind(standardProps);
68
- standard.args = standardProps;
69
- const widthStartPageProps = _objectSpread(_objectSpread({}, standardProps), {}, {
70
- activePage: 3
71
- });
72
- export const widthStartPage = template.bind(widthStartPageProps);
73
- widthStartPage.args = widthStartPageProps;
74
- const withCustomDurationProps = _objectSpread(_objectSpread({}, standardProps), {}, {
75
- durationSeconds: 1
76
- });
77
- export const withCustomDuration = template.bind(withCustomDurationProps);
78
- withCustomDuration.args = withCustomDurationProps;
79
- const withProgressColourProps = _objectSpread(_objectSpread({}, standardProps), {}, {
80
- sliderProgressColour: 'yellow500'
81
- });
82
- export const withProgressColour = template.bind(withProgressColourProps);
83
- withProgressColour.args = withProgressColourProps;
84
- const withManySlidesProps = _objectSpread(_objectSpread({}, standardProps), {}, {
85
- childrenNum: 50
86
- });
87
- export const withManySlides = template.bind(withManySlidesProps);
88
- withManySlides.args = withManySlidesProps;
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
- import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, MagnifyIcon, PlusIcon, StarIcon } from '@autoguru/icons';
7
- import * as React from 'react';
8
- import { Icon } from "./index.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- const iconOptions = {
11
- MagnifyIcon,
12
- CarIcon,
13
- CarMultipleIcon,
14
- CalendarIcon,
15
- AccountEditIcon,
16
- AlertCircleIcon,
17
- CurrencyUsdIcon,
18
- PlusIcon,
19
- StarIcon,
20
- CheckIcon,
21
- empty: null
22
- };
23
- export default {
24
- title: 'Foundation/Icon',
25
- component: Icon,
26
- decorators: [],
27
- argTypes: {
28
- icon: {
29
- options: iconOptions,
30
- control: {
31
- type: 'select'
32
- }
33
- },
34
- size: {
35
- options: ['small', 'medium', 'large'],
36
- control: {
37
- type: 'select'
38
- }
39
- }
40
- }
41
- };
42
- const template = args => _jsx(Icon, _objectSpread({}, args));
43
- const standardProps = {
44
- icon: CalendarIcon
45
- };
46
- export const standard = template.bind(standardProps);
47
- standard.args = standardProps;
48
- const responsiveProps = _objectSpread(_objectSpread({}, standardProps), {}, {
49
- size: ['small', 'medium', 'large']
50
- });
51
- export const responsive = template.bind(responsiveProps);
52
- responsive.args = responsiveProps;
53
- const mediumProps = _objectSpread(_objectSpread({}, standardProps), {}, {
54
- size: 'medium'
55
- });
56
- export const medium = template.bind(mediumProps);
57
- medium.args = mediumProps;
58
- const largeProps = _objectSpread(_objectSpread({}, standardProps), {}, {
59
- size: 'large'
60
- });
61
- export const large = template.bind(largeProps);
62
- large.args = largeProps;