@autoguru/overdrive 4.3.6 → 4.4.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 (33) hide show
  1. package/dist/components/AutoSuggest/AutoSuggest.js +4 -4
  2. package/dist/components/AutoSuggest/stories.js +31 -1
  3. package/dist/components/Badge/Badge.d.ts.map +1 -1
  4. package/dist/components/Badge/Badge.js +1 -2
  5. package/dist/components/DateInput/DateInput.d.ts.map +1 -1
  6. package/dist/components/DateInput/DateInput.js +1 -1
  7. package/dist/components/DateInput/stories.js +36 -2
  8. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  9. package/dist/components/NumberInput/NumberInput.js +1 -1
  10. package/dist/components/NumberInput/stories.js +36 -2
  11. package/dist/components/SelectInput/SelectInput.d.ts.map +1 -1
  12. package/dist/components/SelectInput/SelectInput.js +2 -2
  13. package/dist/components/SelectInput/stories.js +35 -1
  14. package/dist/components/TextAreaInput/TextAreaInput.d.ts.map +1 -1
  15. package/dist/components/TextAreaInput/TextAreaInput.js +1 -1
  16. package/dist/components/TextAreaInput/stories.js +27 -2
  17. package/dist/components/TextInput/TextInput.d.ts.map +1 -1
  18. package/dist/components/TextInput/TextInput.js +1 -1
  19. package/dist/components/TextInput/stories.js +36 -2
  20. package/dist/components/private/InputBase/NotchedBase.css.d.ts +1 -1
  21. package/dist/components/private/InputBase/NotchedBase.css.d.ts.map +1 -1
  22. package/dist/components/private/InputBase/NotchedBase.css.js +34 -16
  23. package/dist/components/private/InputBase/NotchedBase.d.ts +2 -0
  24. package/dist/components/private/InputBase/NotchedBase.d.ts.map +1 -1
  25. package/dist/components/private/InputBase/NotchedBase.js +4 -4
  26. package/dist/components/private/InputBase/withEnhancedInput.css.d.ts +25 -5
  27. package/dist/components/private/InputBase/withEnhancedInput.css.d.ts.map +1 -1
  28. package/dist/components/private/InputBase/withEnhancedInput.css.js +86 -19
  29. package/dist/components/private/InputBase/withEnhancedInput.d.ts +4 -1
  30. package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
  31. package/dist/components/private/InputBase/withEnhancedInput.js +12 -9
  32. package/package.json +9 -9
  33. package/CHANGELOG.md +0 -1421
@@ -165,7 +165,7 @@ const AutoSuggestFullscreenInput = forwardRef(function AutoSuggestFullscreenInpu
165
165
  React.createElement(Button, { minimal: true, rounded: true, className: styles.fullScreenCloseBtn, size: "medium", onClick: closeModal },
166
166
  React.createElement(Icon, { icon: CloseIcon }))))) : null;
167
167
  });
168
- const AutoSuggestInput = forwardRef(function AutoSuggestInput({ inlineOptions = false, noScroll = false, isFocused = false, fieldIcon, isLoading, autoFocus, autoWidth, suggestions, value, onChange, itemRenderer = defaultItemRenderer, onBlur, onFocus, onKeyDown, onClick, className, ...textInputProps }, ref) {
168
+ const AutoSuggestInput = forwardRef(function AutoSuggestInput({ inlineOptions = false, noScroll = false, isFocused = false, size, fieldIcon, isLoading, autoFocus, autoWidth, suggestions, value, onChange, itemRenderer = defaultItemRenderer, onBlur, onFocus, onKeyDown, onClick, className, ...textInputProps }, ref) {
169
169
  const triggerRef = useRef(null);
170
170
  const highlightRef = useRef(null);
171
171
  const suggestionListRef = useRef(null);
@@ -180,7 +180,7 @@ const AutoSuggestInput = forwardRef(function AutoSuggestInput({ inlineOptions =
180
180
  useLayoutSuggestionVisible(state.highlightIndex, highlightRef, suggestionListRef);
181
181
  return (React.createElement(Box, { role: "combobox", "aria-label": textInputProps.placeholder, "aria-expanded": shouldOpenFlyout, "aria-owns": suggestionListId, "aria-haspopup": "listbox", width: "full" },
182
182
  React.createElement(Box, { backgroundColour: "white", borderRadius: "1", className: styles.input },
183
- React.createElement(AutoSuggestInputPrimitive, { className: className, isFocused: isFocused, isLoading: isLoading, autoFocus: autoFocus, fieldIcon: fieldIcon, wrapperRef: triggerRef, ...textInputProps, ref: ref, "aria-autocomplete": "list", "aria-controls": suggestionListId, "aria-activedescendant": state.highlightIndex > -1
183
+ React.createElement(AutoSuggestInputPrimitive, { className: className, size: size, isFocused: isFocused, isLoading: isLoading, autoFocus: autoFocus, fieldIcon: fieldIcon, wrapperRef: triggerRef, ...textInputProps, ref: ref, "aria-autocomplete": "list", "aria-controls": suggestionListId, "aria-activedescendant": state.highlightIndex > -1
184
184
  ? getSuggestionId(suggestionListId, state.highlightIndex)
185
185
  : undefined, value: state.previewText ?? value?.text, onReset: () => {
186
186
  dispatch({ type: ActionTypes.INPUT_CHANGE });
@@ -264,7 +264,7 @@ const SuggestionsList = ({ className = '', suggestionListId, placeholder, highli
264
264
  })));
265
265
  }),
266
266
  React.createElement("div", { className: styles.spacer })));
267
- const AutoSuggestInputPrimitive = withEnhancedInput(({ field, eventHandlers, validation, suffixed, prefixed, isLoading, fieldIcon = ChevronDownIcon, isFocused, className, ...rest }) => {
267
+ const AutoSuggestInputPrimitive = withEnhancedInput(({ field, eventHandlers, validation, suffixed, prefixed, isLoading, fieldIcon = ChevronDownIcon, isFocused, className, size, ...rest }) => {
268
268
  let focusTimeout;
269
269
  const ref = useRef(null);
270
270
  const focusHandler = useCallback(() => {
@@ -282,7 +282,7 @@ const AutoSuggestInputPrimitive = withEnhancedInput(({ field, eventHandlers, val
282
282
  focusTimeout = setTimeout(() => ref.current?.focus(), 100);
283
283
  }, [onReset, focusTimeout]);
284
284
  const suffix = useMemo(() => isLoading ? null : field.value && isFocused ? (React.createElement(Box, { is: "button", paddingY: "3", paddingRight: "4", flexShrink: 0, onMouseDown: onRequestReset },
285
- React.createElement(Icon, { size: "medium", icon: CloseIcon }))) : fieldIcon ? (React.createElement(Box, { flexShrink: 0, paddingY: "3", paddingRight: "4", onClick: focusHandler },
285
+ React.createElement(Icon, { size: "medium", icon: CloseIcon }))) : fieldIcon ? (React.createElement(Box, { flexShrink: 0, paddingY: size === 'medium' ? '3' : '2', paddingRight: size === 'medium' ? '3' : '2', onClick: focusHandler },
286
286
  React.createElement(Icon, { size: "medium", icon: fieldIcon }))) : null, [field.value, isLoading, fieldIcon, isFocused, onRequestReset]);
287
287
  useEffect(() => () => (focusTimeout ? clearTimeout(focusTimeout) : void 0), []);
288
288
  return (React.createElement(Box, { display: "flex", flexWrap: "nowrap", alignItems: "center", justifyContent: "center", className: className },
@@ -166,4 +166,34 @@ const invalidProps = _objectSpread(_objectSpread({}, withHintTextProps), {}, {
166
166
  });
167
167
 
168
168
  export const invalid = Template.bind(invalidProps);
169
- invalid.args = invalidProps;
169
+ invalid.args = invalidProps;
170
+
171
+ const withIconSmallProps = _objectSpread(_objectSpread({}, withValueProps), {}, {
172
+ prefixIcon: CarIcon,
173
+ size: 'small'
174
+ });
175
+
176
+ const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
177
+ size: 'small'
178
+ });
179
+
180
+ export const small = Template.bind(smallProps);
181
+ small.args = smallProps;
182
+
183
+ const withValueSmallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
184
+ value: mockSuggestions[3],
185
+ size: 'small'
186
+ });
187
+
188
+ export const withValueSmall = Template.bind(withValueSmallProps);
189
+ withValueSmall.args = withValueSmallProps;
190
+ export const withIconSmall = Template.bind(withIconSmallProps);
191
+ withIconSmall.args = withIconSmallProps;
192
+
193
+ const loadingSmallProps = _objectSpread(_objectSpread({}, withValueSmallProps), {}, {
194
+ isLoading: true,
195
+ size: 'small'
196
+ });
197
+
198
+ export const loadingSmall = Template.bind(loadingSmallProps);
199
+ loadingSmall.args = loadingSmallProps;
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../lib/components/Badge/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,KAAK;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,SAAS,CAAC;CACrC;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAmD1C,CAAC"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../lib/components/Badge/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,KAAK;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,SAAS,CAAC;CACrC;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAkD1C,CAAC"}
@@ -12,9 +12,8 @@ export const Badge = ({ label, colour = 'neutral', look = 'standard', size = 'st
12
12
  });
13
13
  const inverted = look === 'inverted';
14
14
  invariant(['string', 'number'].includes(typeof label), "Badge `label` can only contain string's or number's");
15
- return (React.createElement(Box, { display: "flex" },
15
+ return (React.createElement(Box, { className: className, display: "flex" },
16
16
  React.createElement(Box, { className: [
17
- className,
18
17
  styles.labelSize[size],
19
18
  inverted
20
19
  ? styles.colours.inverted[colour].background
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../lib/components/DateInput/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,SAAS,6VA+BrB,CAAC"}
1
+ {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../lib/components/DateInput/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,SAAS,6VAgCrB,CAAC"}
@@ -2,7 +2,7 @@ import { warning } from '@autoguru/utilities';
2
2
  import * as React from 'react';
3
3
  import { Box } from '../Box';
4
4
  import { withEnhancedInput } from '../private/InputBase';
5
- export const DateInput = withEnhancedInput(({ field, eventHandlers, validation, isLoading, suffixed, prefixed, ...rest }) => {
5
+ export const DateInput = withEnhancedInput(({ field, eventHandlers, validation, isLoading, suffixed, prefixed, size, ...rest }) => {
6
6
  warning(field.value !== '', 'Date Input does not support empty values.');
7
7
  return (React.createElement(Box, { is: "input", ...eventHandlers, ...field, ...rest, autoComplete: "off", type: "date" }));
8
8
  }, {
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
 
7
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
8
 
9
- import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarMultipleIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
9
+ import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
10
10
  import { action } from '@storybook/addon-actions';
11
11
  import isChromatic from 'chromatic/isChromatic';
12
12
  import * as React from 'react';
@@ -155,4 +155,38 @@ invalid.args = invalidProps;
155
155
  invalid.argTypes = argTypes;
156
156
  export const loading = Template.bind(loadingProps);
157
157
  loading.args = loadingProps;
158
- loading.argTypes = argTypes;
158
+ loading.argTypes = argTypes;
159
+
160
+ const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
161
+ size: 'small'
162
+ });
163
+
164
+ export const small = Template.bind(smallProps);
165
+ small.args = smallProps;
166
+ small.argTypes = argTypes;
167
+
168
+ const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
169
+ size: 'small'
170
+ });
171
+
172
+ export const withValueSmall = Template.bind(withValueSmallProps);
173
+ withValueSmall.args = withValueSmallProps;
174
+ withValueSmall.argTypes = argTypes;
175
+
176
+ const withIconSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
177
+ prefixIcon: CarIcon,
178
+ size: 'small'
179
+ });
180
+
181
+ export const withIconSmall = Template.bind(withIconSmallProps);
182
+ withIconSmall.args = withIconSmallProps;
183
+ withIconSmall.argTypes = argTypes;
184
+
185
+ const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
186
+ isLoading: true,
187
+ size: 'small'
188
+ });
189
+
190
+ export const loadingSmall = Template.bind(loadingSmallProps);
191
+ loadingSmall.args = loadingSmallProps;
192
+ loadingSmall.argTypes = argTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,UAAU,KACT,SAAQ,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC;IAC/D,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,oTA6EvB,CAAC"}
1
+ {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,UAAU,KACT,SAAQ,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC;IAC/D,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,oTA8EvB,CAAC"}
@@ -4,7 +4,7 @@ import { Box } from '../Box';
4
4
  import { withEnhancedInput } from '../private/InputBase';
5
5
  const isEdge = typeof navigator !== 'undefined' && /edge/i.test(navigator.userAgent);
6
6
  const type = isEdge ? 'text' : 'number';
7
- export const NumberInput = withEnhancedInput(({ field: { ref, ...incomingFieldProps }, eventHandlers, validation, isLoading, suffixed, prefixed, preventMouseWheel = false, ...rest }) => {
7
+ export const NumberInput = withEnhancedInput(({ field: { ref, ...incomingFieldProps }, eventHandlers, validation, isLoading, suffixed, prefixed, preventMouseWheel = false, size, ...rest }) => {
8
8
  const inputRef = useRef(ref?.current);
9
9
  const preventWheel = useCallback((e) => {
10
10
  e.preventDefault();
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
 
7
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
8
 
9
- import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
9
+ import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
10
10
  import { action } from '@storybook/addon-actions';
11
11
  import isChromatic from 'chromatic/isChromatic';
12
12
  import * as React from 'react';
@@ -167,4 +167,38 @@ invalid.args = invalidProps;
167
167
  invalid.argTypes = argTypes;
168
168
  export const loading = Template.bind(loadingProps);
169
169
  loading.args = loadingProps;
170
- loading.argTypes = argTypes;
170
+ loading.argTypes = argTypes;
171
+
172
+ const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
173
+ size: 'small'
174
+ });
175
+
176
+ export const small = Template.bind(smallProps);
177
+ small.args = smallProps;
178
+ small.argTypes = argTypes;
179
+
180
+ const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
181
+ size: 'small'
182
+ });
183
+
184
+ export const withValueSmall = Template.bind(withValueSmallProps);
185
+ withValueSmall.args = withValueSmallProps;
186
+ withValueSmall.argTypes = argTypes;
187
+
188
+ const withIconSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
189
+ prefixIcon: CarIcon,
190
+ size: 'small'
191
+ });
192
+
193
+ export const withIconSmall = Template.bind(withIconSmallProps);
194
+ withIconSmall.args = withIconSmallProps;
195
+ withIconSmall.argTypes = argTypes;
196
+
197
+ const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
198
+ isLoading: true,
199
+ size: 'small'
200
+ });
201
+
202
+ export const loadingSmall = Template.bind(loadingSmallProps);
203
+ loadingSmall.args = loadingSmallProps;
204
+ loadingSmall.argTypes = argTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../lib/components/SelectInput/SelectInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlC,eAAO,MAAM,WAAW;eAEX,SAAS,EAAE;gRAgDvB,CAAC"}
1
+ {"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../lib/components/SelectInput/SelectInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlC,eAAO,MAAM,WAAW;eAEX,SAAS,EAAE;gRAiDvB,CAAC"}
@@ -4,9 +4,9 @@ import { Box } from '../Box';
4
4
  import { Icon } from '../Icon';
5
5
  import { withEnhancedInput } from '../private/InputBase';
6
6
  import * as styles from './SelectInput.css';
7
- export const SelectInput = withEnhancedInput(({ field, eventHandlers, suffixed, prefixed, validation, isLoading, fieldIcon = ChevronDownIcon, ...rest }) => (React.createElement(Box, { display: "flex", flexWrap: "nowrap", alignItems: "center", justifyContent: "center", position: "relative" },
7
+ export const SelectInput = withEnhancedInput(({ field, eventHandlers, suffixed, prefixed, validation, isLoading, size, fieldIcon = ChevronDownIcon, ...rest }) => (React.createElement(Box, { display: "flex", flexWrap: "nowrap", alignItems: "center", justifyContent: "center", position: "relative" },
8
8
  React.createElement(Box, { is: "select", flexGrow: 1, ...eventHandlers, ...field, ...rest, className: [styles.input, styles.paddedInput, field.className], autoComplete: "off" }),
9
- isLoading ? null : (React.createElement(Box, { className: styles.arrow, display: "flex", alignItems: "center", height: "full", marginRight: "4", flexShrink: 0, pointerEvents: "none", position: "absolute" },
9
+ isLoading ? null : (React.createElement(Box, { className: styles.arrow, display: "flex", alignItems: "center", height: "full", marginRight: size === 'medium' ? '4' : '2', flexShrink: 0, pointerEvents: "none", position: "absolute" },
10
10
  React.createElement(Icon, { size: "medium", icon: fieldIcon }))))), {
11
11
  primitiveType: 'select',
12
12
  withSuffixIcon: false,
@@ -160,4 +160,38 @@ invalid.args = invalidProps;
160
160
  invalid.argTypes = argTypes;
161
161
  export const loading = Template.bind(loadingProps);
162
162
  loading.args = loadingProps;
163
- loading.argTypes = argTypes;
163
+ loading.argTypes = argTypes;
164
+
165
+ const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
166
+ size: 'small'
167
+ });
168
+
169
+ export const small = Template.bind(smallProps);
170
+ small.args = smallProps;
171
+ small.argTypes = argTypes;
172
+
173
+ const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
174
+ size: 'small'
175
+ });
176
+
177
+ export const withValueSmall = Template.bind(withValueSmallProps);
178
+ withValueSmall.args = withValueSmallProps;
179
+ withValueSmall.argTypes = argTypes;
180
+
181
+ const withIconSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
182
+ prefixIcon: CarIcon,
183
+ size: 'small'
184
+ });
185
+
186
+ export const withIconSmall = Template.bind(withIconSmallProps);
187
+ withIconSmall.args = withIconSmallProps;
188
+ withIconSmall.argTypes = argTypes;
189
+
190
+ const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
191
+ isLoading: true,
192
+ size: 'small'
193
+ });
194
+
195
+ export const loadingSmall = Template.bind(loadingSmallProps);
196
+ loadingSmall.args = loadingSmallProps;
197
+ loadingSmall.argTypes = argTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"TextAreaInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextAreaInput/TextAreaInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,aAAa,kTAuBzB,CAAC"}
1
+ {"version":3,"file":"TextAreaInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextAreaInput/TextAreaInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,aAAa,kTAwBzB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Box } from '../Box';
3
3
  import { withEnhancedInput } from '../private/InputBase';
4
- export const TextAreaInput = withEnhancedInput(({ field, eventHandlers, validation, isLoading, suffixed, prefixed, ...rest }) => (React.createElement(Box, { is: "textarea", ...eventHandlers, ...field, ...rest, autoComplete: "off" })), {
4
+ export const TextAreaInput = withEnhancedInput(({ field, eventHandlers, validation, isLoading, suffixed, prefixed, size, ...rest }) => (React.createElement(Box, { is: "textarea", ...eventHandlers, ...field, ...rest, autoComplete: "off" })), {
5
5
  primitiveType: 'textarea',
6
6
  withSuffixIcon: false,
7
7
  withPrefixIcon: false,
@@ -19,7 +19,7 @@ export default {
19
19
  }
20
20
  }
21
21
  };
22
- const defaultValue = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vitae pulvinar odio. Duis laoreet lacus vel consequat congue. Ut euismod enim non eros lacinia mollis. Vestibulum libero quam, aliquet non justo laoreet, egestas molestie ante. Quisque urna leo, consectetur id dui aliquet, placerat iaculis augue. Pellentesque sed vestibulum augue, quis porta lectus.';
22
+ 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';
23
23
  const defaultPlaceholder = 'Tell us about your car.';
24
24
  const argTypes = {};
25
25
 
@@ -115,4 +115,29 @@ invalid.args = invalidProps;
115
115
  invalid.argTypes = argTypes;
116
116
  export const loading = Template.bind(loadingProps);
117
117
  loading.args = loadingProps;
118
- loading.argTypes = argTypes;
118
+ loading.argTypes = argTypes;
119
+
120
+ const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
121
+ size: 'small'
122
+ });
123
+
124
+ export const small = Template.bind(smallProps);
125
+ small.args = smallProps;
126
+ small.argTypes = argTypes;
127
+
128
+ const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
129
+ size: 'small'
130
+ });
131
+
132
+ export const withValueSmall = Template.bind(withValueSmallProps);
133
+ withValueSmall.args = withValueSmallProps;
134
+ withValueSmall.argTypes = argTypes;
135
+
136
+ const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
137
+ isLoading: true,
138
+ size: 'small'
139
+ });
140
+
141
+ export const loadingSmall = Template.bind(loadingSmallProps);
142
+ loadingSmall.args = loadingSmallProps;
143
+ loadingSmall.argTypes = argTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,SAAS,sVAwBrB,CAAC"}
1
+ {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,SAAS,sVAyBrB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Box } from '../Box';
3
3
  import { withEnhancedInput } from '../private/InputBase';
4
- export const TextInput = withEnhancedInput(({ field, eventHandlers, validation, suffixed, prefixed, isLoading, ...rest }) => (React.createElement(Box, { is: "input", ...eventHandlers, ...field, ...rest, autoComplete: "off", type: rest.type ?? 'text' })), {
4
+ export const TextInput = withEnhancedInput(({ field, eventHandlers, validation, suffixed, prefixed, isLoading, size, ...rest }) => (React.createElement(Box, { is: "input", ...eventHandlers, ...field, ...rest, autoComplete: "off", type: rest.type ?? 'text' })), {
5
5
  primitiveType: 'text',
6
6
  });
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
 
7
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
8
 
9
- import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
9
+ import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
10
10
  import { action } from '@storybook/addon-actions';
11
11
  import * as React from 'react';
12
12
  import { TextInput } from "./index.js";
@@ -165,4 +165,38 @@ invalid.args = invalidProps;
165
165
  invalid.argTypes = argTypes;
166
166
  export const loading = Template.bind(loadingProps);
167
167
  loading.args = loadingProps;
168
- loading.argTypes = argTypes;
168
+ loading.argTypes = argTypes;
169
+
170
+ const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
171
+ size: 'small'
172
+ });
173
+
174
+ export const small = Template.bind(smallProps);
175
+ small.args = smallProps;
176
+ small.argTypes = argTypes;
177
+
178
+ const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
179
+ size: 'small'
180
+ });
181
+
182
+ export const withValueSmall = Template.bind(withValueSmallProps);
183
+ withValueSmall.args = withValueSmallProps;
184
+ withValueSmall.argTypes = argTypes;
185
+
186
+ const withIconSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
187
+ prefixIcon: CarIcon,
188
+ size: 'small'
189
+ });
190
+
191
+ export const withIconSmall = Template.bind(withIconSmallProps);
192
+ withIconSmall.args = withIconSmallProps;
193
+ withIconSmall.argTypes = argTypes;
194
+
195
+ const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
196
+ isLoading: true,
197
+ size: 'small'
198
+ });
199
+
200
+ export const loadingSmall = Template.bind(loadingSmallProps);
201
+ loadingSmall.args = loadingSmallProps;
202
+ loadingSmall.argTypes = argTypes;
@@ -10,5 +10,5 @@ export declare const borders: {
10
10
  trailing: string[];
11
11
  };
12
12
  export declare const placeholder: Record<"default" | "mutedLabelStyles", string>;
13
- export declare const placeholderPlacement: Record<"default" | "defaultPrefixed" | "shifted", string>;
13
+ export declare const placeholderPlacement: any;
14
14
  //# sourceMappingURL=NotchedBase.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotchedBase.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/NotchedBase.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QAEf,CAAC;AAcH,eAAO,MAAM,OAAO;;;;;;;;;CA6CnB,CAAC;AAEF,eAAO,MAAM,WAAW,gDAWtB,CAAC;AAkBH,eAAO,MAAM,oBAAoB,2DAoB/B,CAAC"}
1
+ {"version":3,"file":"NotchedBase.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/NotchedBase.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QAEf,CAAC;AAcH,eAAO,MAAM,OAAO;;;;;;;;;CA6CnB,CAAC;AAEF,eAAO,MAAM,WAAW,gDAWtB,CAAC;AA2BH,eAAO,MAAM,oBAAoB,KAiDhC,CAAC"}
@@ -72,23 +72,41 @@ export const placeholder = styleVariants({
72
72
  },
73
73
  });
74
74
  const active_scaling_factor = 0.7777;
75
- const calcPlaceholderTranslate = (notched, prefixed) => {
75
+ const calcPlaceholderTranslate = (notched, prefixed, size) => {
76
76
  if (notched) {
77
77
  return `calc(${vars.space['2']} + ${vars.space['2']}), calc(-0.5 * ${active_scaling_factor} * ${vars.typography.size['4'].fontSize})`;
78
78
  }
79
- return `${prefixed
80
- ? `calc(${vars.space['7']} + ${vars.space['3']})`
81
- : vars.typography.size['4'].fontSize}, calc((${vars.space['8']} - ${vars.typography.size['4'].fontSize}) / 2)`;
79
+ return size === 'medium'
80
+ ? `${prefixed
81
+ ? `calc(${vars.space['7']} + ${vars.space['3']})`
82
+ : vars.typography.size['4'].fontSize}, calc((${vars.space['8']} - ${vars.typography.size['4'].fontSize}) / 2)`
83
+ : `${prefixed
84
+ ? `calc(${vars.space['2']} + ${vars.space['5']} + ${vars.space['2']})`
85
+ : vars.space['2']}, calc(${vars.space['2']} + 2px)`;
86
+ };
87
+ export const placeholderPlacement = {
88
+ small: styleVariants({
89
+ default: {
90
+ transform: `translate(${calcPlaceholderTranslate(false, false, 'small')}) scale(1)`,
91
+ },
92
+ defaultPrefixed: {
93
+ transform: `translate(${calcPlaceholderTranslate(false, true, 'small')}) scale(1)`,
94
+ },
95
+ shifted: {
96
+ zIndex: 2,
97
+ transform: `translate(${calcPlaceholderTranslate(true, false, 'small')}) scale(${active_scaling_factor})`,
98
+ },
99
+ }),
100
+ medium: styleVariants({
101
+ default: {
102
+ transform: `translate(${calcPlaceholderTranslate(false, false, 'medium')}) scale(1)`,
103
+ },
104
+ defaultPrefixed: {
105
+ transform: `translate(${calcPlaceholderTranslate(false, true, 'medium')}) scale(1)`,
106
+ },
107
+ shifted: {
108
+ zIndex: 2,
109
+ transform: `translate(${calcPlaceholderTranslate(true, false, 'medium')}) scale(${active_scaling_factor})`,
110
+ },
111
+ }),
82
112
  };
83
- export const placeholderPlacement = styleVariants({
84
- default: {
85
- transform: `translate(${calcPlaceholderTranslate(false, false)}) scale(1)`,
86
- },
87
- defaultPrefixed: {
88
- transform: `translate(${calcPlaceholderTranslate(false, true)}) scale(1)`,
89
- },
90
- shifted: {
91
- zIndex: 2,
92
- transform: `translate(${calcPlaceholderTranslate(true, false)}) scale(${active_scaling_factor})`,
93
- },
94
- });
@@ -1,4 +1,5 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
+ import * as styles from './NotchedBase.css';
2
3
  export interface Props {
3
4
  id: string;
4
5
  placeholder: string;
@@ -8,6 +9,7 @@ export interface Props {
8
9
  borderColourClassName: string;
9
10
  placeholderColourClassName: string;
10
11
  notch?: boolean;
12
+ size: keyof typeof styles.placeholderPlacement;
11
13
  className?: string;
12
14
  children?: ReactNode;
13
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NotchedBase.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/NotchedBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EACN,iBAAiB,EACjB,SAAS,EAIT,MAAM,OAAO,CAAC;AAWf,MAAM,WAAW,KAAK;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,0BAA0B,EAAE,MAAM,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,KAAK,CAsGhD,CAAC"}
1
+ {"version":3,"file":"NotchedBase.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/NotchedBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EACN,iBAAiB,EACjB,SAAS,EAIT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAM5C,MAAM,WAAW,KAAK;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,0BAA0B,EAAE,MAAM,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,OAAO,MAAM,CAAC,oBAAoB,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,KAAK,CAuGhD,CAAC"}
@@ -7,7 +7,7 @@ import * as styles from './NotchedBase.css';
7
7
  const ACTIVE_SCALING_FACTOR = 0.7777;
8
8
  const ACTIVE_PADDING_ADDED = 16;
9
9
  const ROUGH_WIDTH_PER_CHARACTER = 10.2;
10
- export const NotchedBase = ({ id, placeholder, isEmpty, disabled, prefixed, children, notch = true, borderColourClassName, placeholderColourClassName, className = '', }) => {
10
+ export const NotchedBase = ({ id, placeholder, isEmpty, disabled, prefixed, size, children, notch = true, borderColourClassName, placeholderColourClassName, className = '', }) => {
11
11
  const labelStyles = useTextStyles({
12
12
  noWrap: true,
13
13
  size: '4',
@@ -29,10 +29,10 @@ export const NotchedBase = ({ id, placeholder, isEmpty, disabled, prefixed, chil
29
29
  React.createElement("div", { className: clsx(styles.borders.middle, borderColourClassName), style: { width: isEmpty ? 0 : notchedWidth } },
30
30
  React.createElement(Box, { ref: labelRef, is: "label", pointerEvents: "none", htmlFor: id, position: "absolute", display: "inline", margin: "none", padding: "none", className: clsx(styles.placeholder.default, placeholderColourClassName, labelStyles, {
31
31
  [styles.placeholder.mutedLabelStyles]: isEmpty || disabled,
32
- [styles.placeholderPlacement.default]: isEmpty && !prefixed,
33
- [styles.placeholderPlacement
32
+ [styles.placeholderPlacement[size].default]: isEmpty && !prefixed,
33
+ [styles.placeholderPlacement[size]
34
34
  .defaultPrefixed]: isEmpty && prefixed,
35
- [styles.placeholderPlacement
35
+ [styles.placeholderPlacement[size]
36
36
  .shifted]: !isEmpty,
37
37
  }) }, placeholder)),
38
38
  React.createElement("div", { className: clsx(styles.borders.trailing, borderColourClassName) })))));
@@ -1,9 +1,29 @@
1
- export declare const icon: {
2
- prefix: string[];
3
- suffix: string[];
4
- };
5
1
  export declare const input: {
6
- itself: Record<"prefixed" | "root" | "suffixed", string>;
2
+ itself: Record<"root", string>;
7
3
  };
8
4
  export declare const types: Record<"textarea", string>;
5
+ export declare const inputWrapperSize: {
6
+ small: {
7
+ root: Record<"textarea", string>;
8
+ };
9
+ medium: {
10
+ root: Record<"textarea", string>;
11
+ };
12
+ };
13
+ export declare const inputItselfSize: {
14
+ small: {
15
+ root: Record<"textarea" | "any", string>;
16
+ prefixed: Record<"textarea" | "any", string>;
17
+ suffixed: Record<"textarea" | "any", string>;
18
+ };
19
+ medium: {
20
+ root: Record<"textarea" | "any", string>;
21
+ prefixed: Record<"any", string>;
22
+ suffixed: Record<"any", string>;
23
+ };
24
+ };
25
+ export declare const iconRoot: string;
26
+ export declare const prefixIcon: string;
27
+ export declare const suffixIcon: string;
28
+ export declare const iconSize: Record<"small" | "medium", string>;
9
29
  //# sourceMappingURL=withEnhancedInput.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withEnhancedInput.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.css.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,IAAI;;;CAGhB,CAAC;AAEF,eAAO,MAAM,KAAK;;CA+BjB,CAAC;AAIF,eAAO,MAAM,KAAK,4BAOhB,CAAC"}
1
+ {"version":3,"file":"withEnhancedInput.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;CAsBjB,CAAC;AAIF,eAAO,MAAM,KAAK,4BAOhB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;CAe5B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;CAiD3B,CAAC;AAEF,eAAO,MAAM,QAAQ,QAKnB,CAAC;AAEH,eAAO,MAAM,UAAU,QAErB,CAAC;AACH,eAAO,MAAM,UAAU,QAErB,CAAC;AACH,eAAO,MAAM,QAAQ,oCAOnB,CAAC"}