@autoguru/overdrive 4.34.0 → 4.35.1

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 (240) 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/Heading/Heading.d.ts +2 -0
  39. package/dist/components/Heading/Heading.d.ts.map +1 -1
  40. package/dist/components/Heading/Heading.js +3 -1
  41. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.css.js +1 -1
  42. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts +1 -1
  43. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts.map +1 -1
  44. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +5 -7
  45. package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.d.ts.map +1 -1
  46. package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.js +5 -9
  47. package/dist/components/Image/Image.js +2 -2
  48. package/dist/components/Image/ImageServerProvider.js +9 -8
  49. package/dist/components/Image/ResponsiveImage.js +2 -2
  50. package/dist/components/Image/SimpleImage.js +2 -2
  51. package/dist/components/Inline/Inline.js +1 -3
  52. package/dist/components/LoadingBox/LoadingBox.js +3 -3
  53. package/dist/components/Meta/Meta.js +2 -3
  54. package/dist/components/MinimalModal/MinimalModal.js +2 -2
  55. package/dist/components/Modal/Modal.css.js +1 -1
  56. package/dist/components/Modal/Modal.d.ts.map +1 -1
  57. package/dist/components/Modal/Modal.js +16 -9
  58. package/dist/components/NumberBubble/NumberBubble.js +2 -2
  59. package/dist/components/NumberInput/NumberInput.js +3 -3
  60. package/dist/components/OrderedList/OrderedList.css.js +1 -1
  61. package/dist/components/OutsideClick/OutsideClick.js +1 -1
  62. package/dist/components/Pagination/Pagination.css.js +6 -6
  63. package/dist/components/Pagination/Pagination.js +1 -2
  64. package/dist/components/Positioner/Positioner.d.ts.map +1 -1
  65. package/dist/components/Positioner/Positioner.js +17 -7
  66. package/dist/components/Positioner/alignment.js +3 -3
  67. package/dist/components/ProgressBar/ProgressBar.css.js +1 -1
  68. package/dist/components/ProgressBar/ProgressBar.js +1 -1
  69. package/dist/components/ProgressBarGroup/ProgressBarGroup.css.js +1 -1
  70. package/dist/components/ProgressBarGroup/ProgressBarGroup.js +2 -3
  71. package/dist/components/Radio/Radio.css.js +4 -4
  72. package/dist/components/Radio/Radio.js +1 -2
  73. package/dist/components/ScrollPane/ScrollPane.css.js +3 -3
  74. package/dist/components/ScrollPane/ScrollPane.js +2 -2
  75. package/dist/components/SelectInput/SelectInput.css.js +3 -3
  76. package/dist/components/SelectInput/SelectInput.d.ts +1 -1
  77. package/dist/components/SelectInput/SelectInput.d.ts.map +1 -1
  78. package/dist/components/SelectInput/SelectInput.js +5 -5
  79. package/dist/components/SimplePagination/SimplePagination.js +4 -5
  80. package/dist/components/SliderProgress/ProgressStep.js +1 -2
  81. package/dist/components/SliderProgress/SliderProgress.css.js +1 -1
  82. package/dist/components/SliderProgress/SliderProgress.js +1 -1
  83. package/dist/components/Stack/Divider.css.js +1 -1
  84. package/dist/components/Stack/Stack.js +1 -3
  85. package/dist/components/StandardModal/StandardModal.css.js +8 -8
  86. package/dist/components/StandardModal/StandardModal.js +4 -5
  87. package/dist/components/StarRating/StarRating.js +7 -8
  88. package/dist/components/Stepper/Stepper.css.js +4 -4
  89. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  90. package/dist/components/Stepper/Stepper.js +19 -10
  91. package/dist/components/StickyBox/StickyBox.css.js +4 -4
  92. package/dist/components/StickyBox/StickyBox.js +3 -3
  93. package/dist/components/Switch/Switch.css.js +18 -18
  94. package/dist/components/Switch/Switch.js +4 -5
  95. package/dist/components/Table/TableCell.css.js +1 -1
  96. package/dist/components/Table/TableHeadCell.css.js +5 -5
  97. package/dist/components/Table/TableHeadCell.js +1 -2
  98. package/dist/components/Tabs/Tab.css.js +4 -4
  99. package/dist/components/Tabs/Tab.js +2 -3
  100. package/dist/components/Tabs/TabList.css.js +1 -1
  101. package/dist/components/Tabs/TabList.js +1 -2
  102. package/dist/components/Tabs/TabPane.js +1 -1
  103. package/dist/components/Text/Text.d.ts +2 -0
  104. package/dist/components/Text/Text.d.ts.map +1 -1
  105. package/dist/components/Text/Text.js +4 -0
  106. package/dist/components/Text/useTextStyles.css.d.ts +1 -1
  107. package/dist/components/Text/useTextStyles.css.d.ts.map +1 -1
  108. package/dist/components/Text/useTextStyles.css.js +2 -2
  109. package/dist/components/TextAreaInput/TextAreaInput.js +2 -2
  110. package/dist/components/TextBubble/TextBubble.d.ts.map +1 -1
  111. package/dist/components/TextBubble/TextBubble.js +14 -6
  112. package/dist/components/TextContainer/TextContainer.js +1 -2
  113. package/dist/components/TextInput/TextInput.js +2 -2
  114. package/dist/components/TextLink/TextLink.css.js +4 -4
  115. package/dist/components/TextLink/TextLink.js +3 -4
  116. package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.js +1 -2
  117. package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +2 -2
  118. package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts.map +1 -1
  119. package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +5 -3
  120. package/dist/components/Toaster/Toast.css.js +1 -1
  121. package/dist/components/Toaster/Toast.d.ts.map +1 -1
  122. package/dist/components/Toaster/Toast.js +24 -20
  123. package/dist/components/Tooltip/Tooltip.css.js +2 -2
  124. package/dist/components/Tooltip/Tooltip.js +1 -3
  125. package/dist/components/private/CheckableBase/CheckableBase.css.js +8 -8
  126. package/dist/components/private/CheckableBase/CheckableBase.js +1 -2
  127. package/dist/components/private/InputBase/HintText.css.js +1 -1
  128. package/dist/components/private/InputBase/NotchedBase.css.js +20 -20
  129. package/dist/components/private/InputBase/NotchedBase.js +1 -2
  130. package/dist/components/private/InputBase/withEnhancedInput.css.js +16 -16
  131. package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
  132. package/dist/components/private/InputBase/withEnhancedInput.js +3 -4
  133. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.d.ts +1 -1
  134. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.d.ts.map +1 -1
  135. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +5 -5
  136. package/dist/hooks/useMedia/useMedia.js +4 -4
  137. package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.css.js +2 -2
  138. package/dist/hooks/useNegativeMargin/useNegativeMarginTop.css.js +1 -1
  139. package/dist/hooks/useNullCheck/useNullCheck.js +1 -1
  140. package/dist/hooks/useWindowHeightFill/useWindowHeightFill.d.ts.map +1 -1
  141. package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +4 -3
  142. package/dist/reset/globalFonts.css.js +3 -3
  143. package/dist/reset/reset.css.js +2 -2
  144. package/dist/stories/helpers/index.d.ts +14 -0
  145. package/dist/stories/helpers/index.d.ts.map +1 -0
  146. package/dist/stories/helpers/styles.css.d.ts +28 -0
  147. package/dist/stories/helpers/styles.css.d.ts.map +1 -0
  148. package/dist/styles/sprinkles.css.d.ts +42 -0
  149. package/dist/styles/sprinkles.css.d.ts.map +1 -0
  150. package/dist/styles/sprinkles.css.js +81 -0
  151. package/dist/styles/stack.css.d.ts +19 -0
  152. package/dist/styles/stack.css.d.ts.map +1 -0
  153. package/dist/styles/stack.css.js +38 -0
  154. package/dist/themes/base/tokens.d.ts +2 -1
  155. package/dist/themes/base/tokens.d.ts.map +1 -1
  156. package/dist/themes/base/tokens.js +4 -4
  157. package/dist/themes/flat_red/tokens.js +2 -2
  158. package/dist/themes/helpers.d.ts.map +1 -1
  159. package/dist/themes/helpers.js +2 -2
  160. package/dist/themes/makeTheme.js +3 -3
  161. package/dist/themes/neutral/tokens.js +3 -3
  162. package/dist/themes/theme.css.js +2 -2
  163. package/dist/themes/tokens.d.ts +6 -6
  164. package/dist/themes/tokens.d.ts.map +1 -1
  165. package/dist/utils/css.js +1 -1
  166. package/dist/utils/index.d.ts +1 -1
  167. package/dist/utils/index.d.ts.map +1 -1
  168. package/dist/utils/index.js +6 -5
  169. package/dist/utils/mapTokenToProperty.js +2 -2
  170. package/dist/utils/number.js +1 -1
  171. package/dist/utils/responsiveProps.css.d.ts.map +1 -1
  172. package/dist/utils/responsiveProps.css.js +2 -2
  173. package/dist/utils/responsiveStyle.js +3 -3
  174. package/package.json +121 -27
  175. package/dist/components/Actions/stories.js +0 -53
  176. package/dist/components/Alert/stories.js +0 -106
  177. package/dist/components/Anchor/stories.js +0 -65
  178. package/dist/components/AutoSuggest/stories.js +0 -213
  179. package/dist/components/Badge/stories.js +0 -64
  180. package/dist/components/Box/stories.js +0 -43
  181. package/dist/components/BulletList/stories.js +0 -72
  182. package/dist/components/BulletText/stories.js +0 -88
  183. package/dist/components/Button/stories.js +0 -291
  184. package/dist/components/CheckBox/stories.js +0 -206
  185. package/dist/components/ColourInput/stories.js +0 -173
  186. package/dist/components/Columns/stories.js +0 -209
  187. package/dist/components/DateInput/stories.js +0 -181
  188. package/dist/components/DatePicker/stories.js +0 -89
  189. package/dist/components/DividerLine/stories.js +0 -117
  190. package/dist/components/DropDown/stories.js +0 -117
  191. package/dist/components/EditableText/stories.js +0 -84
  192. package/dist/components/FillHeightBox/stories.js +0 -47
  193. package/dist/components/Flyout/stories.js +0 -88
  194. package/dist/components/Heading/stories.js +0 -127
  195. package/dist/components/HorizontalAutoScroller/stories.js +0 -88
  196. package/dist/components/Icon/stories.js +0 -62
  197. package/dist/components/Image/stories.js +0 -183
  198. package/dist/components/Inline/stories.js +0 -122
  199. package/dist/components/IntentStripe/stories.js +0 -76
  200. package/dist/components/LinearProgressIndicator/stories.js +0 -26
  201. package/dist/components/LoadingBox/stories.js +0 -41
  202. package/dist/components/Meta/stories.js +0 -45
  203. package/dist/components/MinimalModal/stories.js +0 -83
  204. package/dist/components/Modal/stories.js +0 -52
  205. package/dist/components/NumberBubble/stories.js +0 -23
  206. package/dist/components/NumberInput/stories.js +0 -218
  207. package/dist/components/OrderedList/stories.js +0 -58
  208. package/dist/components/OutsideClick/stories.js +0 -39
  209. package/dist/components/Pagination/stories.js +0 -112
  210. package/dist/components/Portal/stories.js +0 -72
  211. package/dist/components/Positioner/stories.js +0 -124
  212. package/dist/components/ProgressBar/stories.js +0 -44
  213. package/dist/components/ProgressBarGroup/stories.js +0 -21
  214. package/dist/components/ProgressSpinner/stories.js +0 -36
  215. package/dist/components/Radio/stories.js +0 -215
  216. package/dist/components/ScrollPane/stories.js +0 -55
  217. package/dist/components/Section/stories.js +0 -43
  218. package/dist/components/SelectInput/stories.js +0 -188
  219. package/dist/components/SimplePagination/stories.js +0 -42
  220. package/dist/components/SliderProgress/stories.js +0 -44
  221. package/dist/components/Stack/stories.js +0 -75
  222. package/dist/components/StandardModal/stories.js +0 -62
  223. package/dist/components/StarRating/stories.js +0 -50
  224. package/dist/components/Stepper/stories.js +0 -61
  225. package/dist/components/StickyBox/stories.js +0 -70
  226. package/dist/components/Switch/stories.js +0 -42
  227. package/dist/components/Table/stories.js +0 -302
  228. package/dist/components/Tabs/stories.js +0 -253
  229. package/dist/components/Text/stories.js +0 -154
  230. package/dist/components/TextAreaInput/stories.js +0 -129
  231. package/dist/components/TextBubble/stories.js +0 -30
  232. package/dist/components/TextContainer/stories.js +0 -128
  233. package/dist/components/TextInput/stories.js +0 -260
  234. package/dist/components/TextLink/stories.js +0 -111
  235. package/dist/components/Toaster/stories.js +0 -59
  236. package/dist/components/Tooltip/stories.js +0 -90
  237. package/dist/components/VisuallyHidden/stories.js +0 -36
  238. package/dist/hooks/useAttachedBoxes/stories.js +0 -94
  239. package/dist/hooks/useMedia/stories.js +0 -46
  240. package/dist/hooks/useResponsiveValue/stories.js +0 -38
@@ -1,260 +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, PlusIcon, StarIcon } from '@autoguru/icons';
7
- import { action } from '@storybook/addon-actions';
8
- import * as React from 'react';
9
- import { boxArgTypes } from "../Box/argTypes.js";
10
- import { TextInput } from "./index.js";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- export default {
13
- title: 'Components/Inputs/Text',
14
- component: TextInput,
15
- parameters: {
16
- chromatic: {}
17
- }
18
- };
19
- const defaultValue = 'Jane Doe';
20
- const defaultPlaceholder = 'What is your first name?';
21
- const iconOptions = {
22
- CalendarIcon,
23
- AccountEditIcon,
24
- AlertCircleIcon,
25
- CarMultipleIcon,
26
- CurrencyUsdIcon,
27
- PlusIcon,
28
- StarIcon,
29
- CheckIcon
30
- };
31
- const attachOptions = {
32
- NONE: 'NONE',
33
- TOP: 'TOP',
34
- RIGHT: 'RIGHT',
35
- LEFT: 'LEFT',
36
- BOTTOM: 'BOTTOM',
37
- ALL: 'ALL'
38
- };
39
- const argTypes = {
40
- attach: {
41
- defaultValue: 'NONE',
42
- description: 'Input attach',
43
- options: attachOptions,
44
- control: {
45
- type: 'select'
46
- }
47
- },
48
- prefixIcon: {
49
- defaultValue: null,
50
- description: 'Input prefix Icon',
51
- options: iconOptions,
52
- control: {
53
- type: 'select'
54
- }
55
- },
56
- suffixIcon: {
57
- defaultValue: null,
58
- description: 'Input suffix Icon',
59
- options: iconOptions,
60
- control: {
61
- type: 'select'
62
- }
63
- },
64
- backgroundColour: boxArgTypes['backgroundColour'],
65
- maxLength: {
66
- defaultValue: null,
67
- description: 'Set the max length of the input',
68
- control: {
69
- type: 'number'
70
- }
71
- }
72
- };
73
- const Template = args => _jsx(TextInput, _objectSpread({}, args));
74
- const sharedProps = {
75
- disabled: false,
76
- name: 'text',
77
- placeholder: defaultPlaceholder,
78
- isValid: false,
79
- isTouched: false,
80
- isLoading: false,
81
- isFocused: false,
82
- reserveHintSpace: false,
83
- hintText: '',
84
- notch: true,
85
- prefixIcon: void 0,
86
- onChange: action('onChange'),
87
- onFocus: action('onFocus'),
88
- onBlur: action('onBlur')
89
- };
90
- const standardProps = sharedProps;
91
- const withAValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
92
- value: defaultValue,
93
- placeholder: defaultPlaceholder
94
- });
95
- const withHintTextProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
96
- hintText: 'Hint Text',
97
- placeholder: defaultPlaceholder
98
- });
99
- const withPrefixIconProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
100
- prefixIcon: CalendarIcon
101
- });
102
- const attachedLeftProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
103
- attach: 'LEFT'
104
- });
105
- const attachedTopProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
106
- attach: 'TOP'
107
- });
108
- const attachedRightProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
109
- attach: 'RIGHT'
110
- });
111
- const attachedBottomProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
112
- attach: 'BOTTOM'
113
- });
114
- const attachedAllProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
115
- attach: 'ALL'
116
- });
117
- const mergedLeftProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
118
- borderMerged: 'LEFT'
119
- });
120
- const mergedTopProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
121
- borderMerged: 'TOP'
122
- });
123
- const mergedRightProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
124
- borderMerged: 'RIGHT'
125
- });
126
- const mergedBottomProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
127
- borderMerged: 'BOTTOM'
128
- });
129
- const mergedAllProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
130
- borderMerged: 'ALL'
131
- });
132
- const withSuffixIconProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
133
- suffixIcon: AccountEditIcon
134
- });
135
- const withBothIconsProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
136
- prefixIcon: CalendarIcon,
137
- suffixIcon: AccountEditIcon
138
- });
139
- const disabledProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
140
- value: defaultValue,
141
- placeholder: defaultPlaceholder,
142
- disabled: true
143
- });
144
- const validProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
145
- value: defaultValue,
146
- placeholder: defaultPlaceholder,
147
- isTouched: true,
148
- isValid: true
149
- });
150
- const invalidProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
151
- value: 'Bob the builder',
152
- placeholder: defaultPlaceholder,
153
- isTouched: true,
154
- isValid: false,
155
- hintText: 'Cannot be Bob the builder'
156
- });
157
- const noNotchProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
158
- placeholder: defaultPlaceholder,
159
- notch: false
160
- });
161
- const noNotchWithValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
162
- value: defaultValue,
163
- placeholder: defaultPlaceholder,
164
- notch: false
165
- });
166
- const loadingProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
167
- isLoading: true
168
- });
169
- export const standard = Template.bind(standardProps);
170
- standard.args = standardProps;
171
- standard.argTypes = argTypes;
172
- export const withAValue = Template.bind(withAValueProps);
173
- withAValue.args = withAValueProps;
174
- withAValue.argTypes = argTypes;
175
- export const withHintText = Template.bind(withHintTextProps);
176
- withHintText.args = withHintTextProps;
177
- withHintText.argTypes = argTypes;
178
- export const notchDisabled = Template.bind(noNotchProps);
179
- notchDisabled.args = noNotchProps;
180
- notchDisabled.argTypes = argTypes;
181
- export const notchDisabledWithValue = Template.bind(noNotchWithValueProps);
182
- notchDisabledWithValue.args = noNotchWithValueProps;
183
- notchDisabledWithValue.argTypes = argTypes;
184
- export const withPrefixIcon = Template.bind(withPrefixIconProps);
185
- withPrefixIcon.args = withPrefixIconProps;
186
- withPrefixIcon.argTypes = argTypes;
187
- export const withSuffixIcon = Template.bind(withSuffixIconProps);
188
- withSuffixIcon.args = withSuffixIconProps;
189
- withSuffixIcon.argTypes = argTypes;
190
- export const withBothIcons = Template.bind(withBothIconsProps);
191
- withBothIcons.args = withBothIconsProps;
192
- withBothIcons.argTypes = argTypes;
193
- export const attachedLeft = Template.bind(attachedLeftProps);
194
- attachedLeft.args = attachedLeftProps;
195
- attachedLeft.argTypes = argTypes;
196
- export const attachedTop = Template.bind(attachedTopProps);
197
- attachedTop.args = attachedTopProps;
198
- attachedTop.argTypes = argTypes;
199
- export const attachedRight = Template.bind(attachedRightProps);
200
- attachedRight.args = attachedRightProps;
201
- attachedRight.argTypes = argTypes;
202
- export const attachedBottom = Template.bind(attachedBottomProps);
203
- attachedBottom.args = attachedBottomProps;
204
- attachedBottom.argTypes = argTypes;
205
- export const attachedAll = Template.bind(attachedAllProps);
206
- attachedAll.args = attachedAllProps;
207
- attachedAll.argTypes = argTypes;
208
- export const mergedLeft = Template.bind(mergedLeftProps);
209
- mergedLeft.args = mergedLeftProps;
210
- mergedLeft.argTypes = argTypes;
211
- export const mergedTop = Template.bind(mergedTopProps);
212
- mergedTop.args = mergedTopProps;
213
- mergedTop.argTypes = argTypes;
214
- export const mergedRight = Template.bind(mergedRightProps);
215
- mergedRight.args = mergedRightProps;
216
- mergedRight.argTypes = argTypes;
217
- export const mergedBottom = Template.bind(mergedBottomProps);
218
- mergedBottom.args = mergedBottomProps;
219
- mergedBottom.argTypes = argTypes;
220
- export const mergedAll = Template.bind(mergedAllProps);
221
- mergedAll.args = mergedAllProps;
222
- mergedAll.argTypes = argTypes;
223
- export const disabled = Template.bind(disabledProps);
224
- disabled.args = disabledProps;
225
- disabled.argTypes = argTypes;
226
- export const valid = Template.bind(validProps);
227
- valid.args = validProps;
228
- valid.argTypes = argTypes;
229
- export const invalid = Template.bind(invalidProps);
230
- invalid.args = invalidProps;
231
- invalid.argTypes = argTypes;
232
- export const loading = Template.bind(loadingProps);
233
- loading.args = loadingProps;
234
- loading.argTypes = argTypes;
235
- const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
236
- size: 'small'
237
- });
238
- export const small = Template.bind(smallProps);
239
- small.args = smallProps;
240
- small.argTypes = argTypes;
241
- const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
242
- size: 'small'
243
- });
244
- export const withValueSmall = Template.bind(withValueSmallProps);
245
- withValueSmall.args = withValueSmallProps;
246
- withValueSmall.argTypes = argTypes;
247
- const withIconSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
248
- prefixIcon: CarIcon,
249
- size: 'small'
250
- });
251
- export const withIconSmall = Template.bind(withIconSmallProps);
252
- withIconSmall.args = withIconSmallProps;
253
- withIconSmall.argTypes = argTypes;
254
- const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
255
- isLoading: true,
256
- size: 'small'
257
- });
258
- export const loadingSmall = Template.bind(loadingSmallProps);
259
- loadingSmall.args = loadingSmallProps;
260
- loadingSmall.argTypes = argTypes;
@@ -1,111 +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 { ArrowRightIcon, ChevronRightIcon } from '@autoguru/icons';
7
- import * as React from 'react';
8
- import { Box } from "../Box/index.js";
9
- import { Text } from "../Text/index.js";
10
- import { TextLink } from "./index.js";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- import { jsxs as _jsxs } from "react/jsx-runtime";
13
- const sizeScale = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
14
- const alignOptions = ['left', 'center', 'right'];
15
- const fontWeightOptions = ['normal', 'semiBold', 'bold'];
16
- const iconOptions = {
17
- ArrowRightIcon,
18
- ChevronRightIcon
19
- };
20
- const noWrapOptions = [false, true];
21
- const transformOptions = ['uppercase', 'capitalize', undefined];
22
- export default {
23
- title: 'Foundation/Typography/TextLink',
24
- decorators: [story => _jsx("div", {
25
- style: {
26
- width: '100%',
27
- maxWidth: 300,
28
- display: 'grid',
29
- gridTemplateColumns: '1fr'
30
- },
31
- children: story()
32
- })],
33
- argTypes: {
34
- icon: {
35
- defaultValue: void 0,
36
- description: 'Input field Icon',
37
- options: iconOptions,
38
- control: {
39
- type: 'select'
40
- }
41
- },
42
- noWrap: {
43
- options: noWrapOptions,
44
- defaultValue: false,
45
- control: {
46
- type: 'boolean'
47
- }
48
- },
49
- transform: {
50
- options: transformOptions,
51
- defaultValue: null,
52
- control: {
53
- type: 'select'
54
- }
55
- },
56
- fontWeight: {
57
- options: fontWeightOptions,
58
- defaultValue: null,
59
- control: {
60
- type: 'select'
61
- }
62
- },
63
- size: {
64
- options: sizeScale,
65
- defaultValue: void 0,
66
- control: {
67
- type: 'select'
68
- }
69
- },
70
- align: {
71
- options: alignOptions,
72
- defaultValue: 'left',
73
- control: {
74
- type: 'select'
75
- }
76
- },
77
- is: {
78
- control: {
79
- disable: true
80
- }
81
- }
82
- }
83
- };
84
- const Template = args => _jsx(Box, {
85
- children: _jsx(TextLink, _objectSpread(_objectSpread({}, args), {}, {
86
- children: "Hello"
87
- }))
88
- });
89
- const InsideParagraphTemplate = args => _jsxs(Text, {
90
- is: "p",
91
- children: ["Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad,", ' ', _jsx(TextLink, _objectSpread(_objectSpread({}, args), {}, {
92
- children: "Hello"
93
- })), " autem consectetur consequuntur eius fugiat illo ipsum nobis numquam, officiis placeat quia, quidem reprehenderit rerum temporibus veniam vero."]
94
- });
95
- const standardProps = {
96
- muted: false,
97
- size: '4',
98
- align: 'left',
99
- fontWeight: 'semiBold'
100
- };
101
- export const standard = Template.bind(standardProps);
102
- standard.args = standardProps;
103
- export const insideParagraph = InsideParagraphTemplate.bind(standardProps);
104
- insideParagraph.args = standardProps;
105
- const withIconProps = _objectSpread(_objectSpread({}, standardProps), {}, {
106
- icon: ArrowRightIcon
107
- });
108
- export const withIcon = Template.bind(withIconProps);
109
- withIcon.args = withIconProps;
110
- export const withIconInsideParagraph = InsideParagraphTemplate.bind(withIconProps);
111
- withIconInsideParagraph.args = withIconProps;
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- import * as React from 'react';
4
- import { Actions } from "../Actions/index.js";
5
- import { Button } from "../Button/index.js";
6
- import { StandardModal } from "../StandardModal/index.js";
7
- import { Text } from "../Text/index.js";
8
- import { ToastProvider, useToast } from "./index.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
- export default {
12
- title: 'Utility/Toaster',
13
- decorators: [Story => _jsx(ToastProvider, {
14
- children: _jsx(Story, {})
15
- })]
16
- };
17
- export const Standard = () => {
18
- const toast = useToast();
19
- return _jsxs(Actions, {
20
- children: [_jsx(Button, {
21
- onClick: () => toast.success('Successful message!'),
22
- children: "Success"
23
- }), _jsx(Button, {
24
- onClick: () => toast.danger('Danger message!'),
25
- children: "Danger"
26
- }), _jsx(Button, {
27
- onClick: () => toast.information(_jsxs(Text, {
28
- children: ["Im some text, which is ", _jsx(Text, {
29
- strong: true,
30
- children: "bolded!"
31
- })]
32
- })),
33
- children: "Custom"
34
- })]
35
- });
36
- };
37
- export const InsideModal = () => {
38
- const toast = useToast();
39
- return _jsx(StandardModal, {
40
- isOpen: true,
41
- title: "Test inside modal",
42
- children: _jsx("div", {
43
- style: {
44
- padding: 20
45
- },
46
- children: _jsx(Button, {
47
- onClick: () => toast.success('Successful message!'),
48
- children: "Success"
49
- })
50
- })
51
- });
52
- };
53
- InsideModal.story = {
54
- parameters: {
55
- chromatic: {
56
- disable: true
57
- }
58
- }
59
- };
@@ -1,90 +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 { EAlignment } from "../Positioner/alignment.js";
8
- import { Tooltip } from "./index.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- const sizeScale = ['medium', 'large'];
11
- export default {
12
- title: 'Components/Tooltip',
13
- decorators: [Story => _jsx("div", {
14
- style: {
15
- marginLeft: 100,
16
- marginTop: 100
17
- },
18
- children: _jsx(Story, {})
19
- })],
20
- parameters: {
21
- chromatic: {
22
- disable: true
23
- }
24
- },
25
- argTypes: {
26
- alignment: {
27
- options: EAlignment,
28
- defaultValue: EAlignment.RIGHT,
29
- control: {
30
- type: 'select'
31
- }
32
- },
33
- size: {
34
- options: sizeScale,
35
- defaultValue: void 0,
36
- control: {
37
- type: 'select'
38
- }
39
- },
40
- label: {
41
- defaultValue: ''
42
- },
43
- closeAfter: {
44
- defaultValue: EAlignment.RIGHT,
45
- control: {
46
- type: 'number'
47
- }
48
- }
49
- }
50
- };
51
- const Template = args => _jsx(Tooltip, _objectSpread(_objectSpread({}, args), {}, {
52
- children: _jsx("div", {
53
- style: {
54
- display: 'inline'
55
- },
56
- children: "Im the tooltip trigger"
57
- })
58
- }));
59
- const standardProps = {
60
- label: 'Im the tooltip body',
61
- closeAfter: null
62
- };
63
- export const standard = Template.bind(standardProps);
64
- standard.args = standardProps;
65
- const withAtuCloseProps = {
66
- label: 'I will automatically close after 5 seconds',
67
- closeAfter: 5e3
68
- };
69
- export const withAutoClose = Template.bind(withAtuCloseProps);
70
- withAutoClose.args = withAtuCloseProps;
71
- const withLongTextProps = {
72
- label: 'Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.',
73
- alignment: EAlignment.BOTTOM
74
- };
75
- export const withLongText = Template.bind(withLongTextProps);
76
- withLongText.args = withLongTextProps;
77
- const withSmallTextSizeProps = {
78
- label: 'Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.',
79
- alignment: EAlignment.BOTTOM,
80
- size: 'large'
81
- };
82
- export const withLargeTextSize = Template.bind(withSmallTextSizeProps);
83
- withLargeTextSize.args = withSmallTextSizeProps;
84
- const withEmptyLabelProps = {
85
- label: '',
86
- alignment: EAlignment.BOTTOM,
87
- size: 'large'
88
- };
89
- export const withEmptyLabel = Template.bind(withEmptyLabelProps);
90
- withEmptyLabel.args = withEmptyLabelProps;
@@ -1,36 +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 { Text } from "../Text/index.js";
8
- import { VisuallyHidden } from "./index.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { Fragment as _Fragment } from "react/jsx-runtime";
11
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
- export default {
13
- title: 'Utility/VisuallyHidden',
14
- argTypes: {
15
- is: {
16
- options: ['button', 'a', 'div'],
17
- control: {
18
- type: 'select'
19
- }
20
- }
21
- }
22
- };
23
- const Template = args => _jsxs(_Fragment, {
24
- children: [_jsx(Text, {
25
- children: "Bellow text is invisible"
26
- }), _jsx(VisuallyHidden, _objectSpread(_objectSpread({}, args), {}, {
27
- children: _jsx(Text, {
28
- children: "I'm not visually present on the screens"
29
- })
30
- }))]
31
- });
32
- const standardProps = {
33
- is: 'div'
34
- };
35
- export const standard = Template.bind(standardProps);
36
- standard.args = standardProps;
@@ -1,94 +0,0 @@
1
- "use strict";
2
-
3
- import * as React from 'react';
4
- import { Box } from "../../components/index.js";
5
- import { Text } from "../../components/Text/Text.js";
6
- import { useAttachedBoxes } from "./index.js";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- export default {
9
- title: 'Foundation/Layout/Attached Boxes'
10
- };
11
- const columnCount = [2, 3, 4, 5];
12
- const gap = ['1', '2', '3', '4'];
13
- export const One = () => {
14
- const count = 1;
15
- const [attachedBoxes, wrapperCls, wrapperStyle] = useAttachedBoxes({
16
- count,
17
- columnCount,
18
- gap,
19
- backgroundColour: 'gray700'
20
- });
21
- return _jsx(Box, {
22
- className: wrapperCls,
23
- style: wrapperStyle,
24
- children: attachedBoxes.map((AttachedBox, index) => _jsx(AttachedBox, {
25
- children: _jsx(Text, {
26
- is: "p",
27
- colour: "white",
28
- align: "center",
29
- children: index + 1
30
- })
31
- }, index))
32
- });
33
- };
34
- export const Five = () => {
35
- const count = 5;
36
- const [attachedBoxes, wrapperCls, wrapperStyle] = useAttachedBoxes({
37
- count,
38
- columnCount,
39
- gap
40
- });
41
- return _jsx(Box, {
42
- className: wrapperCls,
43
- style: wrapperStyle,
44
- children: attachedBoxes.map((AttachedBox, index) => _jsx(AttachedBox, {
45
- children: _jsx(Text, {
46
- is: "p",
47
- colour: "white",
48
- align: "center",
49
- children: index + 1
50
- })
51
- }, index))
52
- });
53
- };
54
- export const Seven = () => {
55
- const count = 7;
56
- const [attachedBoxes, wrapperCls, wrapperStyle] = useAttachedBoxes({
57
- count,
58
- columnCount,
59
- gap,
60
- backgroundColour: 'gray700'
61
- });
62
- return _jsx(Box, {
63
- className: wrapperCls,
64
- style: wrapperStyle,
65
- children: attachedBoxes.map((AttachedBox, index) => _jsx(AttachedBox, {
66
- children: _jsx(Text, {
67
- is: "p",
68
- colour: "white",
69
- align: "center",
70
- children: index + 1
71
- })
72
- }, index))
73
- });
74
- };
75
- export const TwentyThree = () => {
76
- const count = 23;
77
- const [attachedBoxes, wrapperCls, wrapperStyle] = useAttachedBoxes({
78
- count,
79
- columnCount,
80
- gap
81
- });
82
- return _jsx(Box, {
83
- className: wrapperCls,
84
- style: wrapperStyle,
85
- children: attachedBoxes.map((AttachedBox, index) => _jsx(AttachedBox, {
86
- children: _jsx(Text, {
87
- is: "p",
88
- colour: "white",
89
- align: "center",
90
- children: index + 1
91
- })
92
- }, index))
93
- });
94
- };
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- import * as React from 'react';
4
- import { Stack } from "../../components/Stack/Stack.js";
5
- import { Text } from "../../components/Text/Text.js";
6
- import { breakpoints } from "../../themes/makeTheme.js";
7
- import { useMedia } from "./useMedia.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
10
- export default {
11
- title: 'Utility/Hooks/useMedia',
12
- parameters: {
13
- chromatic: {
14
- disable: true
15
- }
16
- }
17
- };
18
- export const Standard = () => {
19
- const Impl = () => {
20
- const [isMobile, isTable, isDesktop, isLargeDesktop] = useMedia(['mobile', 'tablet', 'desktop', 'largeDesktop']);
21
- return _jsxs(Stack, {
22
- children: [_jsxs(Text, {
23
- children: ["isMobile: ", _jsx(Text, {
24
- strong: true,
25
- children: isMobile ? 'true' : 'false'
26
- }), ' ', "- ", breakpoints.mobile]
27
- }), _jsxs(Text, {
28
- children: ["isTable: ", _jsx(Text, {
29
- strong: true,
30
- children: isTable ? 'true' : 'false'
31
- }), " -", ' ', breakpoints.tablet]
32
- }), _jsxs(Text, {
33
- children: ["isDesktop:", ' ', _jsx(Text, {
34
- strong: true,
35
- children: isDesktop ? 'true' : 'false'
36
- }), " -", ' ', breakpoints.desktop]
37
- }), _jsxs(Text, {
38
- children: ["isLargeDesktop:", ' ', _jsx(Text, {
39
- strong: true,
40
- children: isLargeDesktop ? 'true' : 'false'
41
- }), " -", ' ', breakpoints.largeDesktop]
42
- })]
43
- });
44
- };
45
- return _jsx(Impl, {});
46
- };