@autoguru/overdrive 4.3.5 → 4.4.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 (66) hide show
  1. package/dist/components/Alert/Alert.d.ts +1 -1
  2. package/dist/components/Alert/Alert.d.ts.map +1 -1
  3. package/dist/components/Anchor/Anchor.d.ts +1 -1
  4. package/dist/components/Anchor/Anchor.d.ts.map +1 -1
  5. package/dist/components/AutoSuggest/AutoSuggest.js +4 -4
  6. package/dist/components/AutoSuggest/stories.js +31 -1
  7. package/dist/components/Badge/Badge.d.ts.map +1 -1
  8. package/dist/components/Badge/Badge.js +1 -2
  9. package/dist/components/BulletList/Bullet.d.ts +1 -1
  10. package/dist/components/BulletList/Bullet.d.ts.map +1 -1
  11. package/dist/components/BulletList/BulletList.d.ts +1 -1
  12. package/dist/components/BulletList/BulletList.d.ts.map +1 -1
  13. package/dist/components/BulletText/BulletText.d.ts +1 -1
  14. package/dist/components/BulletText/BulletText.d.ts.map +1 -1
  15. package/dist/components/Columns/Columns.d.ts +1 -1
  16. package/dist/components/Columns/Columns.d.ts.map +1 -1
  17. package/dist/components/DateInput/DateInput.d.ts.map +1 -1
  18. package/dist/components/DateInput/DateInput.js +1 -1
  19. package/dist/components/DateInput/stories.js +36 -2
  20. package/dist/components/Heading/Heading.d.ts +1 -1
  21. package/dist/components/Heading/Heading.d.ts.map +1 -1
  22. package/dist/components/Inline/Inline.d.ts +1 -1
  23. package/dist/components/Inline/Inline.d.ts.map +1 -1
  24. package/dist/components/Inline/Inline.js +2 -2
  25. package/dist/components/Inline/stories.js +12 -1
  26. package/dist/components/MinimalModal/MinimalModal.d.ts +1 -1
  27. package/dist/components/MinimalModal/MinimalModal.d.ts.map +1 -1
  28. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  29. package/dist/components/NumberInput/NumberInput.js +1 -1
  30. package/dist/components/NumberInput/stories.js +36 -2
  31. package/dist/components/Pagination/Bubble.d.ts +1 -1
  32. package/dist/components/Pagination/Bubble.d.ts.map +1 -1
  33. package/dist/components/Radio/RadioGroup.d.ts +1 -1
  34. package/dist/components/Radio/RadioGroup.d.ts.map +1 -1
  35. package/dist/components/SelectInput/SelectInput.d.ts +1 -1
  36. package/dist/components/SelectInput/SelectInput.d.ts.map +1 -1
  37. package/dist/components/SelectInput/SelectInput.js +2 -2
  38. package/dist/components/SelectInput/stories.js +35 -1
  39. package/dist/components/Tabs/Tab.d.ts +1 -1
  40. package/dist/components/Tabs/Tab.d.ts.map +1 -1
  41. package/dist/components/Text/Text.d.ts +1 -1
  42. package/dist/components/Text/Text.d.ts.map +1 -1
  43. package/dist/components/TextAreaInput/TextAreaInput.d.ts.map +1 -1
  44. package/dist/components/TextAreaInput/TextAreaInput.js +1 -1
  45. package/dist/components/TextAreaInput/stories.js +27 -2
  46. package/dist/components/TextInput/TextInput.d.ts.map +1 -1
  47. package/dist/components/TextInput/TextInput.js +1 -1
  48. package/dist/components/TextInput/stories.js +36 -2
  49. package/dist/components/TextLink/TextLink.d.ts +1 -1
  50. package/dist/components/TextLink/TextLink.d.ts.map +1 -1
  51. package/dist/components/private/CheckableBase/CheckableBase.d.ts +1 -1
  52. package/dist/components/private/CheckableBase/CheckableBase.d.ts.map +1 -1
  53. package/dist/components/private/InputBase/NotchedBase.css.d.ts +1 -1
  54. package/dist/components/private/InputBase/NotchedBase.css.d.ts.map +1 -1
  55. package/dist/components/private/InputBase/NotchedBase.css.js +34 -16
  56. package/dist/components/private/InputBase/NotchedBase.d.ts +2 -0
  57. package/dist/components/private/InputBase/NotchedBase.d.ts.map +1 -1
  58. package/dist/components/private/InputBase/NotchedBase.js +4 -4
  59. package/dist/components/private/InputBase/withEnhancedInput.css.d.ts +25 -5
  60. package/dist/components/private/InputBase/withEnhancedInput.css.d.ts.map +1 -1
  61. package/dist/components/private/InputBase/withEnhancedInput.css.js +87 -19
  62. package/dist/components/private/InputBase/withEnhancedInput.d.ts +4 -1
  63. package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
  64. package/dist/components/private/InputBase/withEnhancedInput.js +12 -9
  65. package/package.json +9 -9
  66. package/CHANGELOG.md +0 -1415
@@ -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;
@@ -4,7 +4,7 @@ import { Text } from '../Text';
4
4
  declare type TextProps = Omit<ComponentProps<typeof Text>, 'is' | 'colour'>;
5
5
  declare type AnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'style' | 'is' | keyof TextProps>;
6
6
  export interface Props extends TextProps, AnchorProps {
7
- children: ReactNode;
7
+ children?: ReactNode;
8
8
  className?: string;
9
9
  is?: ElementType | ReactElement;
10
10
  muted?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"TextLink.d.ts","sourceRoot":"","sources":["../../../lib/components/TextLink/TextLink.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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AS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,QAAQ,iFAyDpB,CAAC"}
@@ -8,7 +8,7 @@ export interface Props {
8
8
  inputName: string;
9
9
  inputType: string;
10
10
  value: string;
11
- children: ReactNode;
11
+ children?: ReactNode;
12
12
  handleClick(event: any): void;
13
13
  handleChange?(checked: boolean): void;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CheckableBase.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/CheckableBase/CheckableBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA2B,SAAS,EAAE,MAAM,OAAO,CAAC;AAO3D,MAAM,WAAW,KAAK;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IAEpB,WAAW,CAAC,KAAK,KAAA,GAAG,IAAI,CAAC;IAEzB,YAAY,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,aAAa,gFA6FzB,CAAC"}
1
+ {"version":3,"file":"CheckableBase.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/CheckableBase/CheckableBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA2B,SAAS,EAAE,MAAM,OAAO,CAAC;AAO3D,MAAM,WAAW,KAAK;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,WAAW,CAAC,KAAK,KAAA,GAAG,IAAI,CAAC;IAEzB,YAAY,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,aAAa,gFA6FzB,CAAC"}
@@ -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;;;;;;;;;;;CAkD3B,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"}
@@ -1,15 +1,5 @@
1
1
  import { style, styleVariants } from '@vanilla-extract/css';
2
2
  import { vars } from '../../../themes/base/vars.css';
3
- const iconRoot = style({
4
- top: '50%',
5
- transform: 'translate3d(0, -50%, 0)',
6
- transition: `color 0.2s ${vars.animation.easing.decelerate} 0s`,
7
- margin: `0 calc(${vars.space['3']} - 1px)`,
8
- });
9
- export const icon = {
10
- prefix: [iconRoot, style({ left: 0 })],
11
- suffix: [iconRoot, style({ right: 0 })],
12
- };
13
3
  export const input = {
14
4
  itself: styleVariants({
15
5
  root: {
@@ -18,9 +8,6 @@ export const input = {
18
8
  background: 'transparent',
19
9
  outline: 'none',
20
10
  fontSize: vars.typography.size['4'].fontSize,
21
- lineHeight: vars.typography.size['4'].lineHeight,
22
- height: vars.space['8'],
23
- padding: `calc(((${vars.space['8']} - ${vars.typography.size['4'].fontSize}) / 2) - 3px) calc(${vars.space['4']} - 1px)`,
24
11
  selectors: {
25
12
  '&[disabled]': {
26
13
  color: vars.typography.colour.muted,
@@ -34,12 +21,6 @@ export const input = {
34
21
  },
35
22
  },
36
23
  },
37
- prefixed: {
38
- paddingLeft: `calc((${vars.space['3']} - 1px) + (${vars.space['4']} - 1px) + ${vars.space[4]})`,
39
- },
40
- suffixed: {
41
- paddingRight: `calc((${vars.space['3']} - 1px) + (${vars.space['4']} - 1px) + ${vars.space[4]})`,
42
- },
43
24
  }),
44
25
  };
45
26
  const textAreaHeight = '107px';
@@ -51,3 +32,90 @@ export const types = styleVariants({
51
32
  resize: 'vertical',
52
33
  },
53
34
  });
35
+ export const inputWrapperSize = {
36
+ small: {
37
+ root: styleVariants({
38
+ textarea: {
39
+ paddingTop: `${vars.space['2']}`,
40
+ },
41
+ }),
42
+ },
43
+ medium: {
44
+ root: styleVariants({
45
+ textarea: {
46
+ paddingTop: `${vars.space['2']}`,
47
+ },
48
+ }),
49
+ },
50
+ };
51
+ export const inputItselfSize = {
52
+ small: {
53
+ root: styleVariants({
54
+ any: {
55
+ lineHeight: vars.typography.size['4'].lineHeight,
56
+ padding: `${vars.space['2']}`,
57
+ },
58
+ textarea: {
59
+ padding: `0 ${vars.space['2']} ${vars.space['2']}`,
60
+ },
61
+ }),
62
+ prefixed: styleVariants({
63
+ any: {
64
+ paddingLeft: `calc(${vars.space['2']} + ${vars.space['5']} + ${vars.space['2']})`,
65
+ },
66
+ textarea: {
67
+ paddingLeft: `calc(${vars.space['2']} + ${vars.space['5']} + ${vars.space['2']})`,
68
+ },
69
+ }),
70
+ suffixed: styleVariants({
71
+ any: {
72
+ paddingRight: `calc(${vars.space['2']} + ${vars.space['5']} + ${vars.space['2']})`,
73
+ },
74
+ textarea: {
75
+ paddingRight: `calc(${vars.space['2']} + ${vars.space['5']} + ${vars.space['2']})`,
76
+ },
77
+ }),
78
+ },
79
+ medium: {
80
+ root: styleVariants({
81
+ any: {
82
+ lineHeight: vars.typography.size['4'].lineHeight,
83
+ height: vars.space['8'],
84
+ padding: `calc(((${vars.space['8']} - ${vars.typography.size['4'].fontSize}) / 2) - 3px) calc(${vars.space['4']} - 1px)`,
85
+ },
86
+ textarea: {
87
+ padding: `${vars.space['1']} calc(${vars.space['4']} - 1px) calc(((${vars.space['8']} - ${vars.typography.size['4'].fontSize}) / 2) - 3px)`,
88
+ },
89
+ }),
90
+ prefixed: styleVariants({
91
+ any: {
92
+ paddingLeft: `calc((${vars.space['3']} - 1px) + (${vars.space['4']} - 1px) + ${vars.space[4]})`,
93
+ },
94
+ }),
95
+ suffixed: styleVariants({
96
+ any: {
97
+ paddingRight: `calc((${vars.space['3']} - 1px) + (${vars.space['4']} - 1px) + ${vars.space[4]})`,
98
+ },
99
+ }),
100
+ },
101
+ };
102
+ export const iconRoot = style({
103
+ zIndex: 1,
104
+ top: '50%',
105
+ transform: 'translate3d(0, -50%, 0)',
106
+ transition: `color 0.2s ${vars.animation.easing.decelerate} 0s`,
107
+ });
108
+ export const prefixIcon = style({
109
+ left: 0,
110
+ });
111
+ export const suffixIcon = style({
112
+ right: 0,
113
+ });
114
+ export const iconSize = styleVariants({
115
+ small: {
116
+ margin: `0 ${vars.space['2']}`,
117
+ },
118
+ medium: {
119
+ margin: `0 calc(${vars.space['3']} - 1px)`,
120
+ },
121
+ });
@@ -1,6 +1,7 @@
1
1
  import { IconType } from '@autoguru/icons';
2
2
  import * as React from 'react';
3
3
  import { AriaAttributes, ChangeEventHandler, ComponentType, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, MutableRefObject, ReactNode, Ref } from 'react';
4
+ import * as styles from './withEnhancedInput.css';
4
5
  export interface EventHandlers<PrimitiveElementType> {
5
6
  onChange?: ChangeEventHandler<PrimitiveElementType>;
6
7
  onBlur?: FocusEventHandler<PrimitiveElementType>;
@@ -22,6 +23,7 @@ export interface EnhanceInputPrimitiveProps extends AriaAttributes {
22
23
  disabled?: boolean;
23
24
  notch?: boolean;
24
25
  reserveHintSpace?: boolean;
26
+ size?: keyof typeof styles.inputItselfSize;
25
27
  fieldIcon?: IconType;
26
28
  prefixIcon?: IconType;
27
29
  suffixIcon?: IconType;
@@ -35,9 +37,10 @@ export interface ValidationProps {
35
37
  }
36
38
  export declare type EnhanceInputProps<IncomingProps, PrimitiveElementType> = IncomingProps & EnhanceInputPrimitiveProps & EventHandlers<PrimitiveElementType> & ValidationProps;
37
39
  export declare type WrappedComponentProps<IncomingProps, PrimitiveElementType> = {
40
+ size: keyof typeof styles.inputItselfSize;
38
41
  validation: ValidationProps;
39
42
  eventHandlers: EventHandlers<PrimitiveElementType>;
40
- field: Omit<EnhanceInputPrimitiveProps, 'placeholder' | 'hintText' | 'fieldIcon'> & {
43
+ field: Omit<EnhanceInputPrimitiveProps, 'placeholder' | 'hintText' | 'fieldIcon' | 'size'> & {
41
44
  ref: MutableRefObject<PrimitiveElementType>;
42
45
  };
43
46
  fieldIcon?: EnhanceInputPrimitiveProps['fieldIcon'];
@@ -1 +1 @@
1
- {"version":3,"file":"withEnhancedInput.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,GAAG,EAGH,MAAM,OAAO,CAAC;AAaf,MAAM,WAAW,aAAa,CAAC,oBAAoB;IAClD,QAAQ,CAAC,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAEvD,OAAO,CAAC,IAAI,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,0BAA2B,SAAQ,cAAc;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ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CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;CAClE;AAED,eAAO,MAAM,iBAAiB,wPAW1B,oBAAoB,+JAyNtB,CAAC"}
1
+ {"version":3,"file":"withEnhancedInput.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,GAAG,EAGH,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAGlD,MAAM,WAAW,aAAa,CAAC,oBAAoB;IAClD,QAAQ,CAAC,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAEvD,OAAO,CAAC,IAAI,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,0BAA2B,SAAQ,cAAc;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,E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CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACnB,GAAG,aAAa,CAAC;AAElB,UAAU,oBAAoB;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;CAClE;AAED,eAAO,MAAM,iBAAiB,wPAW1B,oBAAoB,+JAoPtB,CAAC"}
@@ -10,7 +10,7 @@ import { HintText } from './HintText';
10
10
  import * as inputStateStyles from './InputState.css';
11
11
  import { NotchedBase } from './NotchedBase';
12
12
  import * as styles from './withEnhancedInput.css';
13
- export const withEnhancedInput = (WrappingComponent, { primitiveType = 'text', withPrefixIcon = true, withSuffixIcon = true, } = { primitiveType: 'text' }) => forwardRef(({ placeholder, name, id = name, hintText, disabled = false, className, isTouched, isValid, isLoading = false, notch = true, reserveHintSpace = false, value: incomingValue = '', onChange: incomingOnChange, onReset, onMouseLeave, onMouseEnter, onBlur, onFocus, onKeyDown, prefixIcon, suffixIcon, wrapperRef, autoFocus, ...rest }, ref) => {
13
+ export const withEnhancedInput = (WrappingComponent, { primitiveType = 'text', withPrefixIcon = true, withSuffixIcon = true, } = { primitiveType: 'text' }) => forwardRef(({ placeholder, name, id = name, hintText, disabled = false, className, isTouched, isValid, isLoading = false, notch = true, reserveHintSpace = false, size = 'medium', value: incomingValue = '', onChange: incomingOnChange, onReset, onMouseLeave, onMouseEnter, onBlur, onFocus, onKeyDown, prefixIcon, suffixIcon, wrapperRef, autoFocus, ...rest }, ref) => {
14
14
  invariant(!(prefixIcon && !withPrefixIcon), 'prefix icon is not supported for this component');
15
15
  invariant(!(suffixIcon && !withSuffixIcon), 'suffix icon is not supported for this component');
16
16
  const [value, onChange] = useInputControlledState(incomingValue, incomingOnChange);
@@ -29,15 +29,18 @@ export const withEnhancedInput = (WrappingComponent, { primitiveType = 'text', w
29
29
  width: 'full',
30
30
  position: 'relative',
31
31
  display: 'flex',
32
- }), styles.types[primitiveType], styles.input.itself.root, {
33
- [styles.input.itself.prefixed]: Boolean(prefixIcon),
34
- [styles.input.itself.suffixed]: Boolean(suffixIcon || isLoading),
32
+ }), styles.input.itself.root, styles.types[primitiveType], styles.inputItselfSize[size].root.any, styles.inputItselfSize[size].root[primitiveType], {
33
+ [styles.inputItselfSize[size].prefixed.any]: Boolean(prefixIcon),
34
+ [styles.inputItselfSize[size].prefixed[primitiveType]]: Boolean(prefixIcon),
35
+ [styles.inputItselfSize[size].suffixed.any]: Boolean(suffixIcon || isLoading),
36
+ [styles.inputItselfSize[size].suffixed[primitiveType]]: Boolean(suffixIcon || isLoading),
35
37
  });
36
38
  const wrappingComponent = {
37
39
  validation: {
38
40
  isTouched,
39
41
  isValid,
40
42
  },
43
+ size,
41
44
  eventHandlers: {
42
45
  onChange: wrapEvent((event) => {
43
46
  if (disabled) {
@@ -80,13 +83,13 @@ export const withEnhancedInput = (WrappingComponent, { primitiveType = 'text', w
80
83
  position: 'absolute',
81
84
  });
82
85
  return (React.createElement(Box, { width: "full", className: className, onMouseEnter: onMouseOver, onMouseLeave: onMouseOut },
83
- React.createElement(NotchedBase, { id: id, prefixed: Boolean(prefixIcon), isEmpty: isEmpty, disabled: disabled, notch: notch, placeholder: placeholder, placeholderColourClassName: clsx({
86
+ React.createElement(NotchedBase, { id: id, prefixed: Boolean(prefixIcon), isEmpty: isEmpty, size: size, disabled: disabled, notch: notch, placeholder: placeholder, placeholderColourClassName: clsx({
84
87
  [derivedColours.colour]: !isEmpty,
85
88
  }), borderColourClassName: derivedColours.borderColour },
86
- React.createElement(Box, { ref: wrapperRef, width: "full", height: "full" },
87
- prefixIcon ? (React.createElement(Icon, { icon: prefixIcon, size: "medium", className: clsx(iconStyles, styles.icon.prefix, derivedColours.colour) })) : null,
88
- isLoading ? (React.createElement(ProgressSpinner, { className: clsx(iconStyles, styles.icon.suffix, derivedColours.colour) })) : null,
89
- suffixIcon && !isLoading ? (React.createElement(Icon, { icon: suffixIcon, size: "medium", className: clsx(iconStyles, styles.icon.suffix, derivedColours.colour) })) : null,
89
+ React.createElement(Box, { ref: wrapperRef, className: styles.inputWrapperSize[size].root[primitiveType], width: "full", height: "full" },
90
+ prefixIcon ? (React.createElement(Icon, { icon: prefixIcon, size: "medium", className: clsx(iconStyles, styles.iconRoot, styles.prefixIcon, styles.iconSize[size], derivedColours.colour) })) : null,
91
+ isLoading ? (React.createElement(ProgressSpinner, { className: clsx(iconStyles, styles.iconRoot, styles.suffixIcon, styles.iconSize[size], derivedColours.colour) })) : null,
92
+ suffixIcon && !isLoading ? (React.createElement(Icon, { icon: suffixIcon, size: "medium", className: clsx(iconStyles, styles.iconRoot, styles.suffixIcon, styles.iconSize[size], derivedColours.colour) })) : null,
90
93
  React.createElement(WrappingComponent, { ...wrappingComponent }))),
91
94
  hintText || reserveHintSpace ? (React.createElement(HintText, { className: derivedColours.colour, hintText: hintText, disabled: disabled, reserveHintSpace: reserveHintSpace })) : null));
92
95
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.3.5",
3
+ "version": "4.4.1",
4
4
  "description": "Overdrive is a product component library, and design system for AutoGuru.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -40,18 +40,18 @@
40
40
  "@autoguru/icons": "1.7.17",
41
41
  "@autoguru/tsconfig": "1.0.79",
42
42
  "@autoguru/utilities": "1.1.0",
43
- "@popperjs/core": "^2.10.2",
43
+ "@popperjs/core": "2.11.2",
44
44
  "@types/react": "^18.0.9",
45
45
  "@types/react-dom": "^18.0.4",
46
- "clsx": "^1.1.1",
47
- "colord": "^2.0.1",
48
- "csstype": "^3.0.7",
49
- "eslint-plugin-jest": "^24.4.0",
46
+ "clsx": "1.1.1",
47
+ "colord": "2.9.2",
48
+ "csstype": "3.0.10",
49
+ "eslint-plugin-jest": "26.2.2",
50
50
  "react": "^18.1.0",
51
51
  "react-dom": "^18.1.0",
52
- "react-focus-lock": "^2.5.0",
53
- "react-keyed-flatten-children": "^1.3.0",
54
- "webpack": "^5.58.1"
52
+ "react-focus-lock": "2.8.1",
53
+ "react-keyed-flatten-children": "1.3.0",
54
+ "webpack": "5.69.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@autoguru/icons": "^1.7.4",