@guardian/stand 0.0.67 → 0.0.68

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.
@@ -2,17 +2,19 @@ import { DefaultProps } from "../../util/types.cjs";
2
2
  import { SemanticTypography } from "../../styleD/build/typescript/semantic/typography.cjs";
3
3
  import { TypographyTheme } from "./styles.cjs";
4
4
  import { TextProps } from "react-aria-components";
5
+ import { JSX } from "react";
5
6
  //#region src/components/Typography/types.d.ts
6
7
  type TypographyVariant = keyof SemanticTypography;
8
+ type TypographyElement = keyof JSX.IntrinsicElements | (string & {});
7
9
  interface TypographyProps extends DefaultProps<TypographyTheme, TextProps['className']>, Omit<TextProps, 'elementType' | 'className'> {
8
10
  /**
9
11
  * HTML element to render with font applied to
10
12
  */
11
- element?: 'div' | 'span' | 'p' | 'b' | 'i' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
13
+ element?: TypographyElement;
12
14
  /**
13
15
  * Font variant to apply as a CSS style to the element
14
16
  */
15
17
  variant?: TypographyVariant;
16
18
  }
17
19
  //#endregion
18
- export { TypographyProps, TypographyVariant };
20
+ export { TypographyElement, TypographyProps, TypographyVariant };
@@ -1,18 +1,20 @@
1
1
  import { DefaultProps } from "../../util/types.js";
2
2
  import { SemanticTypography } from "../../styleD/build/typescript/semantic/typography.js";
3
3
  import { TypographyTheme } from "./styles.js";
4
+ import { JSX } from "react";
4
5
  import { TextProps } from "react-aria-components";
5
6
  //#region src/components/Typography/types.d.ts
6
7
  type TypographyVariant = keyof SemanticTypography;
8
+ type TypographyElement = keyof JSX.IntrinsicElements | (string & {});
7
9
  interface TypographyProps extends DefaultProps<TypographyTheme, TextProps['className']>, Omit<TextProps, 'elementType' | 'className'> {
8
10
  /**
9
11
  * HTML element to render with font applied to
10
12
  */
11
- element?: 'div' | 'span' | 'p' | 'b' | 'i' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
13
+ element?: TypographyElement;
12
14
  /**
13
15
  * Font variant to apply as a CSS style to the element
14
16
  */
15
17
  variant?: TypographyVariant;
16
18
  }
17
19
  //#endregion
18
- export { TypographyProps, TypographyVariant };
20
+ export { TypographyElement, TypographyProps, TypographyVariant };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/stand",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "repository": {
5
5
  "url": "https://github.com/guardian/stand"
6
6
  },