@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,253 +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 { AlertIcon, OttoIcon } from '@autoguru/icons';
7
- import { action } from '@storybook/addon-actions';
8
- import isChromatic from 'chromatic/isChromatic';
9
- import * as React from 'react';
10
- import { useEffect, useState } from 'react';
11
- import { Box } from "../Box/index.js";
12
- import { Icon } from "../Icon/index.js";
13
- import { Inline } from "../Inline/index.js";
14
- import { EAlignment } from "../Positioner/alignment.js";
15
- import { Stack } from "../Stack/index.js";
16
- import { StarRating } from "../StarRating/index.js";
17
- import { Tooltip } from "../Tooltip/index.js";
18
- import { Tab, TabList, TabPane, TabPanes, Tabs } from "./index.js";
19
- import { jsx as _jsx } from "react/jsx-runtime";
20
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
- import { Fragment as _Fragment } from "react/jsx-runtime";
22
- const TestChild = _ref => {
23
- let {
24
- label
25
- } = _ref;
26
- const [thing, sething] = useState(isChromatic() ? 0.5 : Math.random() * 5);
27
- useEffect(() => {
28
- const t = setInterval(() => {
29
- sething(isChromatic() ? 0.5 : Math.random() * 5);
30
- }, 1e3);
31
- return () => {
32
- clearInterval(t);
33
- };
34
- }, []);
35
- return _jsx(StarRating, {
36
- rating: thing,
37
- label: label
38
- });
39
- };
40
- export default {
41
- title: 'Components/Tabs',
42
- decorators: [story => _jsx("div", {
43
- style: {
44
- maxWidth: '500px',
45
- width: '100%'
46
- },
47
- children: story()
48
- })],
49
- argTypes: {
50
- children: {
51
- control: {
52
- disable: true
53
- }
54
- }
55
- }
56
- };
57
- const Template = args => _jsx(Tabs, _objectSpread({}, args));
58
- const standardProps = {
59
- active: 0,
60
- onChange: action('onChange'),
61
- children: _jsxs(_Fragment, {
62
- children: [_jsxs(TabList, {
63
- children: [_jsx(Tab, {
64
- children: "Tab 1"
65
- }), _jsx(Tab, {
66
- children: "Tab 2"
67
- })]
68
- }), _jsxs(TabPanes, {
69
- children: [_jsx(TabPane, {
70
- children: "Content A"
71
- }), _jsx(TabPane, {
72
- children: _jsxs(Stack, {
73
- children: [_jsx(TestChild, {
74
- label: "5"
75
- }), _jsx(TestChild, {
76
- label: "4"
77
- }), _jsx(TestChild, {
78
- label: "3"
79
- }), _jsx(TestChild, {
80
- label: "2"
81
- }), _jsx(TestChild, {
82
- label: "1"
83
- })]
84
- })
85
- })]
86
- })]
87
- })
88
- };
89
- export const standard = Template.bind(standardProps);
90
- standard.args = standardProps;
91
- const withIndicationProps = {
92
- active: 0,
93
- onChange: action('onChange'),
94
- children: _jsxs(_Fragment, {
95
- children: [_jsxs(TabList, {
96
- children: [_jsx(Tab, {
97
- indication: 2,
98
- children: "Tab 1"
99
- }), _jsx(Tab, {
100
- indication: 0,
101
- children: "Tab 2"
102
- })]
103
- }), _jsxs(TabPanes, {
104
- children: [_jsx(TabPane, {
105
- children: "Content A"
106
- }), _jsx(TabPane, {
107
- children: "Content B"
108
- })]
109
- })]
110
- })
111
- };
112
- export const withIndication = Template.bind(withIndicationProps);
113
- withIndication.args = withIndicationProps;
114
- const withComplexTabProps = {
115
- active: 0,
116
- onChange: action('onChange'),
117
- children: _jsxs(_Fragment, {
118
- children: [_jsxs(TabList, {
119
- children: [_jsx(Tab, {
120
- indication: 2,
121
- children: _jsxs(Inline, {
122
- alignY: "center",
123
- children: ["Tab 1", _jsx(Tooltip, {
124
- alignment: EAlignment.BOTTOM,
125
- label: "This tab is a winner",
126
- children: _jsx(Box, {
127
- children: _jsx(Icon, {
128
- icon: OttoIcon
129
- })
130
- })
131
- })]
132
- })
133
- }), _jsx(Tab, {
134
- children: _jsxs(Inline, {
135
- alignY: "center",
136
- children: ["Tab 2", _jsx(Tooltip, {
137
- alignment: EAlignment.BOTTOM,
138
- label: "This tab is less awesome",
139
- children: _jsx(Box, {
140
- children: _jsx(Icon, {
141
- icon: AlertIcon
142
- })
143
- })
144
- })]
145
- })
146
- })]
147
- }), _jsxs(TabPanes, {
148
- children: [_jsx(TabPane, {
149
- children: "Content A"
150
- }), _jsx(TabPane, {
151
- children: "Content B"
152
- })]
153
- })]
154
- })
155
- };
156
- export const withComplexTab = Template.bind(withComplexTabProps);
157
- withComplexTab.args = withComplexTabProps;
158
- const tabsWithoutPanesProps = {
159
- active: 0,
160
- onChange: action('onChange'),
161
- children: _jsxs(TabList, {
162
- children: [_jsx(Tab, {
163
- id: "tab-1",
164
- is: _jsx("a", {
165
- href: "/#tab-1"
166
- }),
167
- children: "Tab 1"
168
- }), _jsx(Tab, {
169
- id: "tab-2",
170
- is: _jsx("a", {
171
- href: "/#tab-2"
172
- }),
173
- children: "Tab 2"
174
- })]
175
- })
176
- };
177
- export const tabsWithoutPanes = Template.bind(tabsWithoutPanesProps);
178
- tabsWithoutPanes.args = tabsWithoutPanesProps;
179
- const withStretchProps = {
180
- active: 0,
181
- onChange: action('onChange'),
182
- children: _jsxs(_Fragment, {
183
- children: [_jsxs(TabList, {
184
- stretch: true,
185
- children: [_jsx(Tab, {
186
- children: "Tab 1"
187
- }), _jsx(Tab, {
188
- children: "Tab 2"
189
- })]
190
- }), _jsxs(TabPanes, {
191
- children: [_jsx(TabPane, {
192
- children: "Content A"
193
- }), _jsx(TabPane, {
194
- children: _jsxs(Stack, {
195
- children: [_jsx(TestChild, {
196
- label: "5"
197
- }), _jsx(TestChild, {
198
- label: "4"
199
- }), _jsx(TestChild, {
200
- label: "3"
201
- }), _jsx(TestChild, {
202
- label: "2"
203
- }), _jsx(TestChild, {
204
- label: "1"
205
- })]
206
- })
207
- })]
208
- })]
209
- })
210
- };
211
- export const withStretch = Template.bind(withStretchProps);
212
- withStretch.args = withStretchProps;
213
- const scrollableProps = {
214
- active: 0,
215
- onChange: action('onChange'),
216
- children: _jsxs(TabList, {
217
- scrollable: true,
218
- children: [_jsx(Tab, {
219
- children: "Hello"
220
- }), _jsx(Tab, {
221
- indication: 5,
222
- children: "Why isnt"
223
- }), _jsx(Tab, {
224
- children: "This a terribly"
225
- }), _jsx(Tab, {
226
- children: "Long"
227
- }), _jsx(Tab, {
228
- children: "Tab list"
229
- }), _jsx(Tab, {
230
- children: "Hello"
231
- }), _jsx(Tab, {
232
- children: "Why isnt"
233
- }), _jsx(Tab, {
234
- children: "This a terribly"
235
- }), _jsx(Tab, {
236
- children: "Long"
237
- }), _jsx(Tab, {
238
- children: "Tab list"
239
- }), _jsx(Tab, {
240
- children: "Hello"
241
- }), _jsx(Tab, {
242
- children: "Why isnt"
243
- }), _jsx(Tab, {
244
- children: "This a terribly"
245
- }), _jsx(Tab, {
246
- children: "Long"
247
- }), _jsx(Tab, {
248
- children: "Tab list"
249
- })]
250
- })
251
- };
252
- export const scrollable = Template.bind(scrollableProps);
253
- scrollable.args = scrollableProps;
@@ -1,154 +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 "./index.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- const textTypeOptions = ['span', 'p'];
10
- const noWrapOptions = [false, true];
11
- const wordBreakOptions = [false, true];
12
- const transformOptions = ['uppercase', 'capitalize', undefined];
13
- const weightOptions = ['normal', 'semiBold', 'bold'];
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/Text',
19
- decorators: []
20
- };
21
- const Template = args => _jsx("div", {
22
- style: {
23
- maxWidth: '350px',
24
- width: '100%'
25
- },
26
- children: _jsx(Text, _objectSpread({}, args))
27
- });
28
- const AllTypesTemplate = args => _jsx("div", {
29
- style: {
30
- maxWidth: '350px',
31
- width: '100%'
32
- },
33
- children: textTypeOptions.map(is => _jsx(Text, _objectSpread(_objectSpread({}, args), {}, {
34
- is: is
35
- }), is))
36
- });
37
- const AllSizesTemplate = args => _jsx("div", {
38
- style: {
39
- maxWidth: '350px',
40
- width: '100%'
41
- },
42
- children: sizeScale.map(size => _jsx(Text, _objectSpread(_objectSpread({}, args), {}, {
43
- size: size
44
- }), size))
45
- });
46
- const AllColoursTemplate = args => _jsx("div", {
47
- style: {
48
- maxWidth: '350px',
49
- width: '100%'
50
- },
51
- children: colourOptions.map((colour, index) => _jsx("div", {
52
- style: {
53
- marginBottom: 8
54
- },
55
- children: _jsx(Text, _objectSpread(_objectSpread({}, args), {}, {
56
- colour: colour
57
- }), index)
58
- }, index))
59
- });
60
- const sharedArgTypes = {
61
- noWrap: {
62
- options: noWrapOptions,
63
- defaultValue: false,
64
- control: {
65
- type: 'boolean'
66
- }
67
- },
68
- breakWord: {
69
- options: wordBreakOptions,
70
- defaultValue: false,
71
- control: {
72
- type: 'boolean'
73
- }
74
- },
75
- transform: {
76
- options: transformOptions,
77
- defaultValue: null,
78
- control: {
79
- type: 'select'
80
- }
81
- },
82
- fontWeight: {
83
- options: weightOptions,
84
- defaultValue: null,
85
- control: {
86
- type: 'select'
87
- }
88
- },
89
- size: {
90
- options: sizeScale,
91
- defaultValue: void 0,
92
- control: {
93
- type: 'select'
94
- }
95
- },
96
- align: {
97
- options: alignOptions,
98
- defaultValue: 'left',
99
- control: {
100
- type: 'select'
101
- }
102
- }
103
- };
104
- const colourArgTypes = {
105
- colour: {
106
- options: colourOptions,
107
- defaultValue: void 0,
108
- control: {
109
- type: 'select'
110
- }
111
- }
112
- };
113
- const argTypes = _objectSpread(_objectSpread(_objectSpread({}, sharedArgTypes), colourArgTypes), {}, {
114
- is: {
115
- options: textTypeOptions,
116
- defaultValue: 'span',
117
- table: {
118
- type: {
119
- summary: 'text'
120
- },
121
- defaultValue: 'span'
122
- },
123
- description: 'HTML text tag to be used',
124
- control: {
125
- type: 'select'
126
- }
127
- }
128
- });
129
- const standardProps = {
130
- is: 'span',
131
- children: 'Help people better care for their cars'
132
- };
133
- const allTypesProps = {
134
- children: 'To avoid you coming to a halt in the middle of the road, because of a banging, crash of pistons and valves fighting with each other, let investigate what the timing belt is, what it does, and why it costs so much to replace or repair.'
135
- };
136
- export const standard = Template.bind(standardProps);
137
- standard.args = standardProps;
138
- standard.argTypes = argTypes;
139
- export const allTypes = AllTypesTemplate.bind(allTypesProps);
140
- allTypes.args = allTypesProps;
141
- allTypes.argTypes = _objectSpread(_objectSpread({}, sharedArgTypes), colourArgTypes);
142
- export const allSizes = AllSizesTemplate.bind(allTypesProps);
143
- allSizes.args = allTypesProps;
144
- allSizes.argTypes = argTypes;
145
- export const allColours = AllColoursTemplate.bind(allTypesProps);
146
- allColours.args = allTypesProps;
147
- allColours.argTypes = argTypes;
148
- const withLongUnspacedTextProps = {
149
- breakWord: true,
150
- children: 'Toavoidyoucomingtoahaltinthemiddleoftheroad,becauseofabanging,crashofpistonsandvalvesfightingwitheachother,letinvestigatewhatthetiming belt is, what it does, and why it costs so much to replace or repair.'
151
- };
152
- export const withLongUnspacedText = Template.bind(withLongUnspacedTextProps);
153
- withLongUnspacedText.args = withLongUnspacedTextProps;
154
- withLongUnspacedText.argTypes = argTypes;
@@ -1,129 +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 { action } from '@storybook/addon-actions';
7
- import * as React from 'react';
8
- import { TextAreaInput } from "./index.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- export default {
11
- title: 'Components/Inputs/Textarea',
12
- component: TextAreaInput,
13
- parameters: {
14
- chromatic: {}
15
- }
16
- };
17
- const defaultValue = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.\nPhasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut';
18
- const defaultPlaceholder = 'Tell us about your car.';
19
- const argTypes = {
20
- maxLength: {
21
- defaultValue: null,
22
- description: 'Set the max length of the input',
23
- control: {
24
- type: 'number'
25
- }
26
- }
27
- };
28
- const Template = args => _jsx(TextAreaInput, _objectSpread({}, args));
29
- const sharedProps = {
30
- disabled: false,
31
- name: 'text',
32
- placeholder: defaultPlaceholder,
33
- isValid: false,
34
- isTouched: false,
35
- isLoading: false,
36
- isFocused: false,
37
- reserveHintSpace: false,
38
- hintText: '',
39
- notch: true,
40
- prefixIcon: void 0,
41
- onChange: action('onChange'),
42
- onFocus: action('onFocus'),
43
- onBlur: action('onBlur')
44
- };
45
- const standardProps = sharedProps;
46
- const withAValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
47
- value: defaultValue,
48
- placeholder: defaultPlaceholder
49
- });
50
- const withHintTextProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
51
- hintText: 'Hint Text',
52
- placeholder: defaultPlaceholder
53
- });
54
- const disabledProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
55
- value: defaultValue,
56
- placeholder: defaultPlaceholder,
57
- disabled: true
58
- });
59
- const validProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
60
- value: defaultValue,
61
- placeholder: defaultPlaceholder,
62
- isTouched: true,
63
- isValid: true
64
- });
65
- const invalidProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
66
- value: 'Bob the builder',
67
- placeholder: defaultPlaceholder,
68
- isTouched: true,
69
- isValid: false,
70
- hintText: 'Cannot be Bob the builder'
71
- });
72
- const noNotchProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
73
- placeholder: defaultPlaceholder,
74
- notch: false
75
- });
76
- const noNotchWithValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
77
- value: defaultValue,
78
- placeholder: defaultPlaceholder,
79
- notch: false
80
- });
81
- const loadingProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
82
- isLoading: true
83
- });
84
- export const standard = Template.bind(standardProps);
85
- standard.args = standardProps;
86
- standard.argTypes = argTypes;
87
- export const withAValue = Template.bind(withAValueProps);
88
- withAValue.args = withAValueProps;
89
- withAValue.argTypes = argTypes;
90
- export const withHintText = Template.bind(withHintTextProps);
91
- withHintText.args = withHintTextProps;
92
- withHintText.argTypes = argTypes;
93
- export const notchDisabled = Template.bind(noNotchProps);
94
- notchDisabled.args = noNotchProps;
95
- notchDisabled.argTypes = argTypes;
96
- export const notchDisabledWithValue = Template.bind(noNotchWithValueProps);
97
- notchDisabledWithValue.args = noNotchWithValueProps;
98
- notchDisabledWithValue.argTypes = argTypes;
99
- export const disabled = Template.bind(disabledProps);
100
- disabled.args = disabledProps;
101
- disabled.argTypes = argTypes;
102
- export const valid = Template.bind(validProps);
103
- valid.args = validProps;
104
- valid.argTypes = argTypes;
105
- export const invalid = Template.bind(invalidProps);
106
- invalid.args = invalidProps;
107
- invalid.argTypes = argTypes;
108
- export const loading = Template.bind(loadingProps);
109
- loading.args = loadingProps;
110
- loading.argTypes = argTypes;
111
- const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
112
- size: 'small'
113
- });
114
- export const small = Template.bind(smallProps);
115
- small.args = smallProps;
116
- small.argTypes = argTypes;
117
- const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
118
- size: 'small'
119
- });
120
- export const withValueSmall = Template.bind(withValueSmallProps);
121
- withValueSmall.args = withValueSmallProps;
122
- withValueSmall.argTypes = argTypes;
123
- const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
124
- isLoading: true,
125
- size: 'small'
126
- });
127
- export const loadingSmall = Template.bind(loadingSmallProps);
128
- loadingSmall.args = loadingSmallProps;
129
- loadingSmall.argTypes = argTypes;
@@ -1,30 +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 { TextBubble } from "./index.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- export default {
10
- title: 'Foundation/Typography/TextBubble',
11
- component: TextBubble
12
- };
13
- const template = args => _jsx(TextBubble, _objectSpread({}, args));
14
- const standardProps = {
15
- label: 'OK'
16
- };
17
- export const standard = template.bind(standardProps);
18
- standard.args = standardProps;
19
- const longLabelProps = {
20
- label: 'Error',
21
- textColour: 'danger',
22
- backgroundColour: 'gray900'
23
- };
24
- export const longLabel = template.bind(longLabelProps);
25
- longLabel.args = longLabelProps;
26
- const veryLongLabelProps = {
27
- label: 'Too Long'
28
- };
29
- export const veryLongLabel = template.bind(veryLongLabelProps);
30
- veryLongLabel.args = veryLongLabelProps;
@@ -1,128 +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 { Button } from "../Button/index.js";
8
- import { Heading } from "../Heading/index.js";
9
- import { Text } from "../Text/index.js";
10
- import { TextContainer } from "./index.js";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- export default {
13
- title: 'Components/TextContainer',
14
- component: TextContainer,
15
- decorators: [story => _jsx("div", {
16
- style: {
17
- maxWidth: 512
18
- },
19
- children: story()
20
- })],
21
- argTypes: {
22
- children: {
23
- control: {
24
- disable: true
25
- }
26
- },
27
- action: {
28
- control: {
29
- disable: true
30
- }
31
- },
32
- heading: {
33
- control: {
34
- disable: true
35
- }
36
- }
37
- }
38
- };
39
- const Template = args => _jsx(TextContainer, _objectSpread({}, args));
40
- const standardProps = {
41
- heading: _jsx(Heading, {
42
- children: "Choose a credit pack"
43
- }),
44
- children: _jsx(Text, {
45
- colour: "muted",
46
- is: "p",
47
- children: "To get started, choose a credit pack that will used for Auto Top-Up."
48
- })
49
- };
50
- export const standard = Template.bind(standardProps);
51
- standard.args = standardProps;
52
- const withALotOfBodyProps = {
53
- heading: _jsx(Heading, {
54
- children: "Reviews"
55
- }),
56
- children: _jsx(Text, {
57
- colour: "muted",
58
- is: "p",
59
- children: "To avoid you coming to a halt in the middle of the road, because of a banging, crash of pistons and valves fighting with each other, let's investigate what the timing belt is, what it does, and why it costs so much to replace or repair."
60
- })
61
- };
62
- export const withALotOfBody = Template.bind(withALotOfBodyProps);
63
- withALotOfBody.args = withALotOfBodyProps;
64
- const withInteractionProps = {
65
- heading: _jsx(Heading, {
66
- children: "Reviews"
67
- }),
68
- children: _jsx(Text, {
69
- colour: "muted",
70
- is: "p",
71
- children: "To avoid you coming to a halt in the middle of the road, because of a banging, crash of pistons and valves fighting with each other, let's investigate what the timing belt is, what it does, and why it costs so much to replace or repair."
72
- }),
73
- action: _jsx(Button, {
74
- variant: "secondary",
75
- size: "small",
76
- children: "Edit"
77
- })
78
- };
79
- export const withInteraction = Template.bind(withInteractionProps);
80
- withInteraction.args = withInteractionProps;
81
- const withInteractionOnlyProps = {
82
- heading: void 0,
83
- children: _jsx(Text, {
84
- colour: "muted",
85
- is: "p",
86
- children: "To avoid you coming to a halt in the middle of the road, because of a banging, crash of pistons and valves fighting with each other, let's investigate what the timing belt is, what it does, and why it costs so much to replace or repair."
87
- }),
88
- action: _jsx(Button, {
89
- variant: "secondary",
90
- size: "small",
91
- children: "Edit"
92
- })
93
- };
94
- export const withInteractionOnly = Template.bind(withInteractionOnlyProps);
95
- withInteractionOnly.args = withInteractionOnlyProps;
96
- const withLongTitleProps = {
97
- heading: _jsx(Heading, {
98
- children: "Setup your personal settings"
99
- }),
100
- children: _jsx(Text, {
101
- colour: "muted",
102
- is: "p",
103
- children: "To avoid you coming to a halt in the middle of the road, because of a banging, crash of pistons and valves fighting with each other, let's investigate what the timing belt is, what it does, and why it costs so much to replace or repair."
104
- }),
105
- action: _jsx(Button, {
106
- variant: "secondary",
107
- size: "small",
108
- children: "Edit"
109
- })
110
- };
111
- export const withLongTitle = Template.bind(withLongTitleProps);
112
- withLongTitle.args = withLongTitleProps;
113
- const withNoBodyTextProps = {
114
- children: _jsx(Heading, {
115
- children: "Choose a credit pack"
116
- })
117
- };
118
- export const withNoBodyText = Template.bind(withNoBodyTextProps);
119
- withNoBodyText.args = withNoBodyTextProps;
120
- const withNoTitleTextProps = {
121
- children: _jsx(Text, {
122
- colour: "muted",
123
- is: "p",
124
- children: "To get started, choose a credit pack that will used for Auto Top-Up."
125
- })
126
- };
127
- export const withNoTitleText = Template.bind(withNoTitleTextProps);
128
- withNoTitleText.args = withNoTitleTextProps;