@mrshmllw/smores-react 2.4.4 → 2.6.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 (45) hide show
  1. package/README.md +4 -9
  2. package/dist/Accordion/Accordion.js +2 -8
  3. package/dist/Accordion/Accordion.js.map +1 -1
  4. package/dist/ConfirmationRadioButtons/Confirmation.d.ts +1 -0
  5. package/dist/ConfirmationRadioButtons/Confirmation.js +11 -6
  6. package/dist/ConfirmationRadioButtons/Confirmation.js.map +1 -1
  7. package/dist/ConfirmationRadioButtons/Confirmation.stories.d.ts +1 -0
  8. package/dist/ConfirmationRadioButtons/Confirmation.stories.js +8 -0
  9. package/dist/ConfirmationRadioButtons/Confirmation.stories.js.map +1 -1
  10. package/dist/ConfirmationRadioButtons/RadioButtonStyled.d.ts +2 -0
  11. package/dist/ConfirmationRadioButtons/RadioButtonStyled.js +2 -2
  12. package/dist/ConfirmationRadioButtons/RadioButtonStyled.js.map +1 -1
  13. package/dist/Datepicker/Datepicker.js +1 -1
  14. package/dist/Datepicker/Datepicker.js.map +1 -1
  15. package/dist/Field/Field.js +3 -18
  16. package/dist/Field/Field.js.map +1 -1
  17. package/dist/Fieldset/Fieldset.js +2 -7
  18. package/dist/Fieldset/Fieldset.js.map +1 -1
  19. package/dist/Icon/Icon.js +4 -4
  20. package/dist/Icon/Icon.js.map +1 -1
  21. package/dist/Link/Link.d.ts +3 -0
  22. package/dist/Link/Link.js +37 -27
  23. package/dist/Link/Link.js.map +1 -1
  24. package/dist/Link/Link.stories.js +1 -0
  25. package/dist/Link/Link.stories.js.map +1 -1
  26. package/dist/Modal/Modal.js +1 -1
  27. package/dist/Modal/Modal.js.map +1 -1
  28. package/dist/Text/Text.d.ts +6 -1
  29. package/dist/Text/Text.js +10 -31
  30. package/dist/Text/Text.js.map +1 -1
  31. package/dist/Text/Text.stories.d.ts +1 -0
  32. package/dist/Text/Text.stories.js +8 -6
  33. package/dist/Text/Text.stories.js.map +1 -1
  34. package/dist/Text/fontMapping.d.ts +2 -0
  35. package/dist/Text/fontMapping.js +81 -0
  36. package/dist/Text/fontMapping.js.map +1 -0
  37. package/dist/Text/index.d.ts +1 -1
  38. package/dist/Text/index.js +1 -1
  39. package/dist/Text/index.js.map +1 -1
  40. package/dist/fontStyle.js +7 -0
  41. package/dist/fontStyle.js.map +1 -1
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.js +1 -0
  44. package/dist/index.js.map +1 -1
  45. package/package.json +5 -4
package/dist/Text/Text.js CHANGED
@@ -14,15 +14,21 @@ import styled, { css } from 'styled-components';
14
14
  import { theme } from '../theme';
15
15
  import { linkStyleOverride } from '../Link/Link';
16
16
  import { Box } from '../Box';
17
+ import { fontStyleMapping } from './fontMapping';
17
18
  export const Text = forwardRef((_a, ref) => {
18
- var { children, typo, className = '', tag = 'p', align = 'left', color = 'secondary', cursor = 'inherit', title = '' } = _a, props = __rest(_a, ["children", "typo", "className", "tag", "align", "color", "cursor", "title"]);
19
- return (React.createElement(Container, Object.assign({ as: tag, className: className, typo: typo || 'base', align: align, color: color, cursor: cursor, title: title }, props, { ref: ref }), children));
19
+ var { children, typo = 'body-regular', className = '', tag = 'p', align = 'left', color = 'secondary', cursor = 'inherit', title = '' } = _a, props = __rest(_a, ["children", "typo", "className", "tag", "align", "color", "cursor", "title"]);
20
+ return (React.createElement(Container, Object.assign({ as: tag, className: className, typo: typo, align: align, color: color, cursor: cursor, title: title }, props, { ref: ref }), children));
20
21
  });
21
22
  Text.displayName = 'Text';
23
+ const isNewTypo = (value) => {
24
+ return Object.keys(fontStyleMapping).includes(value);
25
+ };
22
26
  const Container = styled(Box)(({ align, color, cursor, typo }) => css `
23
- /** PREDEFINED TYPOGRAPHY STYLES */
27
+ /** TYPOGRAPHY STYLES */
28
+
29
+ ${isNewTypo(typo) && fontStyleMapping[typo]}
24
30
 
25
- /* Header Large */
31
+ /** DEPRECATED TYPOGRAPHY STYLES */
26
32
  ${typo === 'header-large' &&
27
33
  css `
28
34
  font-size: 24px;
@@ -35,7 +41,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
35
41
  }
36
42
  `}
37
43
 
38
- /* Header medium */
39
44
  ${typo === 'header-medium' &&
40
45
  css `
41
46
  font-size: 21px;
@@ -48,7 +53,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
48
53
  }
49
54
  `}
50
55
 
51
- /* Header small */
52
56
  ${typo === 'header-small' &&
53
57
  css `
54
58
  font-size: 18px;
@@ -61,7 +65,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
61
65
  }
62
66
  `}
63
67
 
64
- /* Descriptor Heavy */
65
68
  ${typo === 'desc-heavy' &&
66
69
  css `
67
70
  font-size: 14px;
@@ -74,7 +77,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
74
77
  }
75
78
  `}
76
79
 
77
- /* Descriptor Medium */
78
80
  ${typo === 'desc-medium' &&
79
81
  css `
80
82
  font-size: 14px;
@@ -87,7 +89,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
87
89
  }
88
90
  `}
89
91
 
90
- /* Descriptor Light */
91
92
  ${typo === 'desc-light' &&
92
93
  css `
93
94
  font-size: 14px;
@@ -100,7 +101,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
100
101
  }
101
102
  `}
102
103
 
103
- /* Descriptor Small */
104
104
  ${typo === 'desc-small' &&
105
105
  css `
106
106
  font-size: 12px;
@@ -113,7 +113,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
113
113
  }
114
114
  `}
115
115
 
116
- /* Base */
117
116
  ${typo === 'base' &&
118
117
  css `
119
118
  font-size: 14px;
@@ -126,7 +125,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
126
125
  }
127
126
  `}
128
127
 
129
- /* Base Small */
130
128
  ${typo === 'base-small' &&
131
129
  css `
132
130
  font-size: 12px;
@@ -139,7 +137,6 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
139
137
  }
140
138
  `}
141
139
 
142
- /* Base Extra Small */
143
140
  ${typo === 'base-xsmall' &&
144
141
  css `
145
142
  font-size: 10px;
@@ -151,22 +148,7 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
151
148
  line-height: 19px;
152
149
  }
153
150
  `}
154
-
155
- /* Label */
156
- ${typo === 'label' &&
157
- css `
158
- font-size: 8px;
159
- line-height: 100%;
160
- font-weight: 700;
161
- text-transform: uppercase;
162
- letter-spacing: 0.75px;
163
-
164
- @media (min-width: 768px) {
165
- font-size: 10px;
166
- }
167
- `}
168
151
 
169
- /* Label Large */
170
152
  ${typo === 'label-large' &&
171
153
  css `
172
154
  font-size: 12px;
@@ -176,11 +158,8 @@ const Container = styled(Box)(({ align, color, cursor, typo }) => css `
176
158
  letter-spacing: 0.75px;
177
159
  `}
178
160
 
179
- margin: 0;
180
- padding: 0;
181
161
  text-align: ${align};
182
162
  cursor: ${cursor};
183
- letter-spacing: 0.15px;
184
163
  color: ${theme.colors[color]};
185
164
  ${linkStyleOverride({ color: theme.colors[color] })}
186
165
  `);
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAM,UAAU,EAAkC,MAAM,OAAO,CAAA;AAC7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AA4B5B,MAAM,CAAC,MAAM,IAAI,GAAkB,UAAU,CAC3C,CACE,EAUC,EACD,GAAG,EACH,EAAE;QAZF,EACE,QAAQ,EACR,IAAI,EACJ,SAAS,GAAG,EAAE,EACd,GAAG,GAAG,GAAG,EACT,KAAK,GAAG,MAAM,EACd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
10
10
  export declare const WithTitle: any;
11
11
  export declare const Collection: any;
12
+ export declare const DeprecatedTypos: any;
@@ -2,11 +2,13 @@ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { Text } from './Text';
4
4
  import { Box } from '../Box';
5
+ import { fontStyleMapping } from './fontMapping';
5
6
  export default {
6
7
  title: 'Text',
7
8
  component: Text,
8
9
  };
9
- const typos = [
10
+ const typos = Object.keys(fontStyleMapping);
11
+ const deprecatedTypos = [
10
12
  'header-large',
11
13
  'header-medium',
12
14
  'header-small',
@@ -17,11 +19,9 @@ const typos = [
17
19
  'base',
18
20
  'base-small',
19
21
  'base-xsmall',
20
- 'label',
21
- 'label-large',
22
22
  ];
23
23
  const Template = (props) => (React.createElement(Text, Object.assign({}, props), "The quick brown fox jumps over the lazy dog"));
24
- const TypoCollection = ({ typos }) => {
24
+ const TypoCollection = ({ typos, }) => {
25
25
  return (React.createElement(Box, null,
26
26
  React.createElement(Grid, null,
27
27
  React.createElement(Text, { tag: "p", typo: "base" }, "Name"),
@@ -29,8 +29,8 @@ const TypoCollection = ({ typos }) => {
29
29
  React.createElement(Text, { tag: "p", typo: "base" }, "Paragraph")),
30
30
  typos.map((typo) => (React.createElement(Grid, { key: typo },
31
31
  React.createElement(Text, { tag: "p", typo: "base", color: "subtext" }, typo),
32
- React.createElement(Text, { tag: "p", typo: typo, color: "secondary" }, "Lorem ipsum dolor sit amet"),
33
- typo !== 'label' && typo !== 'label-large' && (React.createElement(Text, { tag: "p", typo: typo, color: "secondary" }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla eget scelerisque ante, iaculis sodales lorem.")))))));
32
+ React.createElement(Text, { tag: "p", typo: typo, color: "secondary" }, "They waited patiently for what seemed a very long time."),
33
+ !['hero-alternate', 'hero', 'label'].includes(typo) && (React.createElement(Text, { tag: "p", typo: typo, color: "secondary" }, "They waited patiently for what seemed a very long time. They waited patiently for what seemed a very long time.")))))));
34
34
  };
35
35
  const Grid = styled(Box) `
36
36
  display: grid;
@@ -39,6 +39,7 @@ const Grid = styled(Box) `
39
39
  gap: 10px;
40
40
  `;
41
41
  const TypographyTemplate = () => React.createElement(TypoCollection, { typos: typos });
42
+ const DeprecatedTemplate = () => React.createElement(TypoCollection, { typos: deprecatedTypos });
42
43
  export const Default = Template.bind({});
43
44
  Default.args = {
44
45
  tag: 'p',
@@ -55,4 +56,5 @@ WithTitle.args = {
55
56
  title: 'a11y title tooltip',
56
57
  };
57
58
  export const Collection = TypographyTemplate.bind({});
59
+ export const DeprecatedTypos = DeprecatedTemplate.bind({});
58
60
  //# sourceMappingURL=Text.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.stories.js","sourceRoot":"","sources":["../../src/Text/Text.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,eAAe;IACb,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,IAAI;CAChB,CAAA;AAED,MAAM,KAAK,GAAG;IACZ,cAAc;IACd,eAAe;IACf,cAAc;IACd,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,aAAa;IACb,OAAO;IACP,aAAa;CACL,CAAA;AAEV,MAAM,QAAQ,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,CACrC,oBAAC,IAAI,oBAAK,KAAK,iDAAoD,CACpE,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAiC,EAAE,EAAE;IAClE,OAAO,CACL,oBAAC,GAAG;QACF,oBAAC,IAAI;YACH,oBAAC,IAAI,IAAC,GAAG,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,WAElB;YACP,oBAAC,IAAI,IAAC,GAAG,EAAC,GAAG,EAAC,IAAI,EA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CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAErD,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { Typo } from './Text';
2
+ export declare const fontStyleMapping: Record<Typo, string>;
@@ -0,0 +1,81 @@
1
+ import { theme } from '../theme';
2
+ export const fontStyleMapping = {
3
+ 'hero-alternate': `
4
+ font-size: 40px;
5
+ font-family: 'ClearfaceITC';
6
+ font-weight: ${theme.font.weight.bold};
7
+ line-height: 44px;
8
+
9
+ @media (min-width: 768px) {
10
+ font-size: 56px;
11
+ line-height: 64px;
12
+ }
13
+ `,
14
+ hero: `
15
+ font-size: 32px;
16
+ font-weight: ${theme.font.weight.medium};
17
+ line-height: 40px;
18
+
19
+ @media (min-width: 768px) {
20
+ font-size: 40px;
21
+ line-height: 44px;
22
+ }
23
+ `,
24
+ 'heading-large': `
25
+ font-size: 28px;
26
+ font-weight: ${theme.font.weight.medium};
27
+ line-height: 32px;
28
+
29
+ @media (min-width: 768px) {
30
+ font-size: 32px;
31
+ line-height: 40px;
32
+ }
33
+ `,
34
+ 'heading-medium': `
35
+ font-size: 24px;
36
+ font-weight: ${theme.font.weight.medium};
37
+ line-height: 32px;
38
+ `,
39
+ 'heading-small': `
40
+ font-size: 20px;
41
+ font-weight: ${theme.font.weight.medium};
42
+ line-height: 28px;
43
+ `,
44
+ 'headline-regular': `
45
+ font-size: 16px;
46
+ font-weight: ${theme.font.weight.medium};
47
+ line-height: 20px;
48
+ `,
49
+ 'headline-small': `
50
+ font-size: 14px;
51
+ font-weight: ${theme.font.weight.medium};
52
+ line-height: 20px;
53
+ `,
54
+ 'body-standfirst': `
55
+ font-size: 18px;
56
+ font-weight: ${theme.font.weight.normal};
57
+ line-height: 24px;
58
+ `,
59
+ 'body-regular': `
60
+ font-size: 16px;
61
+ font-weight: ${theme.font.weight.normal};
62
+ line-height: 20px;
63
+ `,
64
+ 'body-small': `
65
+ font-size: 14px;
66
+ font-weight: ${theme.font.weight.normal};
67
+ line-height: 20px;
68
+ `,
69
+ caption: `
70
+ font-size: 12px;
71
+ font-weight: ${theme.font.weight.normal};
72
+ line-height: 16px;
73
+ `,
74
+ label: `
75
+ font-size: 10px;
76
+ line-height: 12px;
77
+ font-weight: ${theme.font.weight.medium};
78
+ text-transform: uppercase;
79
+ `,
80
+ };
81
+ //# sourceMappingURL=fontMapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fontMapping.js","sourceRoot":"","sources":["../../src/Text/fontMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGhC,MAAM,CAAC,MAAM,gBAAgB,GAAyB;IACpD,gBAAgB,EAAE;;;mBAGD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;;;;;GAOtC;IACD,IAAI,EAAE;;mBAEW,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;;;;;;GAOxC;IACD,eAAe,EAAE;;mBAEA,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;;;;;;GAOxC;IACD,gBAAgB,EAAE;;mBAED,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,eAAe,EAAE;;mBAEA,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,kBAAkB,EAAE;;mBAEH,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,gBAAgB,EAAE;;mBAED,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,iBAAiB,EAAE;;mBAEF,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,cAAc,EAAE;;mBAEC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,YAAY,EAAE;;mBAEG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,OAAO,EAAE;;mBAEQ,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;IACD,KAAK,EAAE;;;mBAGU,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;GAExC;CACF,CAAA"}
@@ -1 +1 @@
1
- export { Text } from './Text';
1
+ export * from './Text';
@@ -1,2 +1,2 @@
1
- export { Text } from './Text';
1
+ export * from './Text';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Text/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
package/dist/fontStyle.js CHANGED
@@ -24,5 +24,12 @@ export const FontStyle = createGlobalStyle `
24
24
  font-style: normal;
25
25
  font-display: swap;
26
26
  }
27
+
28
+ @font-face {
29
+ font-family: 'ClearfaceITC';
30
+ src: url('https://uploads-ssl.webflow.com/5baa461315ee32413d16236d/60acf786bae02f4552bcb0d1_ITC%20-%20ClearfaceITCPro-Heavy.woff2') format('woff2');
31
+ font-weight: ${theme.font.weight.bold};
32
+ font-style: normal;
33
+ }
27
34
  `;
28
35
  //# sourceMappingURL=fontStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fontStyle.js","sourceRoot":"","sources":["../src/fontStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,CAAC,MAAM,SAAS,GAAG,iBAAiB,CAAA;;;;mBAIvB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;;;;;;;mBAQxB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;;;;;;;mBAQxB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;;CAIxC,CAAA"}
1
+ {"version":3,"file":"fontStyle.js","sourceRoot":"","sources":["../src/fontStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,CAAC,MAAM,SAAS,GAAG,iBAAiB,CAAA;;;;mBAIvB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;;;;;;;mBAQxB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;;;;;;;mBAQxB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;;;;;;mBAQtB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;CAGxC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -31,4 +31,5 @@ export * from './TextInput';
31
31
  export * from './theme';
32
32
  export * from './Toggle';
33
33
  export * from './Fieldset';
34
+ export * from './fontStyle';
34
35
  export { MarginProps, PaddingProps } from './utils/space';
package/dist/index.js CHANGED
@@ -31,4 +31,5 @@ export * from './TextInput';
31
31
  export * from './theme';
32
32
  export * from './Toggle';
33
33
  export * from './Fieldset';
34
+ export * from './fontStyle';
34
35
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,QAAQ,CAAA;AACtB,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CA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c,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrshmllw/smores-react",
3
- "version": "2.4.4",
3
+ "version": "2.6.0",
4
4
  "main": "./dist/index.js",
5
5
  "description": "Collection of React components used by Marshmallow Technology",
6
6
  "keywords": [
@@ -25,7 +25,8 @@
25
25
  "test": "jest --silent",
26
26
  "snyk-protect": "snyk-protect",
27
27
  "prepare": "npm run snyk-protect && husky install",
28
- "pre-commit-lint": "npm run check-types && lint-staged"
28
+ "pre-commit-lint": "npm run check-types && lint-staged",
29
+ "fix-package-lock-conflicts": "echo \"Make sure conflicts in package.json are resolved before running this script\" && npm i --package-lock-only"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@babel/core": "^7.13.15",
@@ -47,8 +48,8 @@
47
48
  "@types/styled-components": "^5.1.3",
48
49
  "@types/testing-library__jest-dom": "^5.14.3",
49
50
  "@types/testing-library__react": "^10.2.0",
50
- "@typescript-eslint/eslint-plugin": "^5.28.0",
51
- "@typescript-eslint/parser": "^5.28.0",
51
+ "@typescript-eslint/eslint-plugin": "^5.31.0",
52
+ "@typescript-eslint/parser": "^5.31.0",
52
53
  "babel-eslint": "^10.1.0",
53
54
  "babel-jest": "^28.0.3",
54
55
  "babel-loader": "^8.1.0",