@dtdot/lego 2.0.0-19 → 2.0.0-20

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.
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  export type TextVariant = 'primary' | 'secondary';
3
3
  export interface TextProps {
4
- children: React.ReactNode;
5
- variant?: TextVariant;
4
+ 'children': React.ReactNode;
5
+ 'variant'?: TextVariant;
6
+ 'data-testid'?: string;
6
7
  }
7
- declare const Text: ({ children, variant }: TextProps) => JSX.Element;
8
+ declare const Text: ({ children, variant, "data-testid": dataTestId }: TextProps) => JSX.Element;
8
9
  export default Text;
@@ -14,13 +14,13 @@ const TextContainerSecondary = styled.span `
14
14
 
15
15
  color: ${(props) => props.theme.colours.secondaryFont};
16
16
  `;
17
- const Text = ({ children, variant = 'primary' }) => {
17
+ const Text = ({ children, variant = 'primary', 'data-testid': dataTestId }) => {
18
18
  switch (variant) {
19
19
  case 'secondary':
20
- return React.createElement(TextContainerSecondary, null, children);
20
+ return React.createElement(TextContainerSecondary, { "data-testid": dataTestId }, children);
21
21
  case 'primary':
22
22
  default:
23
- return React.createElement(TextContainer, null, children);
23
+ return React.createElement(TextContainer, { "data-testid": dataTestId }, children);
24
24
  }
25
25
  };
26
26
  export default Text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtdot/lego",
3
- "version": "2.0.0-19",
3
+ "version": "2.0.0-20",
4
4
  "description": "Some reusable components for building my applications",
5
5
  "main": "build/index.js",
6
6
  "scripts": {