@entur/typography 1.10.0-beta.8 → 2.0.0-beta.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.
- package/README.md +37 -17
- package/dist/BaseHeading.d.ts +1 -1
- package/dist/Blockquote.d.ts +3 -4
- package/dist/CodeText.d.ts +1 -1
- package/dist/EmphasizedText.d.ts +1 -1
- package/dist/Heading1.d.ts +1 -1
- package/dist/Heading2.d.ts +1 -1
- package/dist/Heading3.d.ts +1 -1
- package/dist/Heading4.d.ts +1 -1
- package/dist/Heading5.d.ts +1 -1
- package/dist/Heading6.d.ts +1 -1
- package/dist/Label.d.ts +1 -1
- package/dist/LeadParagraph.d.ts +1 -1
- package/dist/Link.d.ts +1 -1
- package/dist/ListItem.d.ts +1 -1
- package/dist/NumberedList.d.ts +1 -1
- package/dist/Paragraph.d.ts +1 -1
- package/dist/PreformattedText.d.ts +1 -1
- package/dist/SmallText.d.ts +1 -1
- package/dist/StrongText.d.ts +1 -1
- package/dist/SubLabel.d.ts +1 -1
- package/dist/SubParagraph.d.ts +1 -1
- package/dist/UnorderedList.d.ts +1 -1
- package/dist/beta/cjs/components/Blockquote.cjs +29 -0
- package/dist/beta/cjs/components/Blockquote.cjs.map +1 -0
- package/dist/beta/cjs/components/Heading.cjs +37 -0
- package/dist/beta/cjs/components/Heading.cjs.map +1 -0
- package/dist/beta/cjs/components/Link.cjs +41 -0
- package/dist/beta/cjs/components/Link.cjs.map +1 -0
- package/dist/beta/cjs/components/ListItem.cjs +33 -0
- package/dist/beta/cjs/components/ListItem.cjs.map +1 -0
- package/dist/beta/cjs/components/NumberedList.cjs +32 -0
- package/dist/beta/cjs/components/NumberedList.cjs.map +1 -0
- package/dist/beta/cjs/components/Text.cjs +36 -0
- package/dist/beta/cjs/components/Text.cjs.map +1 -0
- package/dist/beta/cjs/components/UnorderedList.cjs +29 -0
- package/dist/beta/cjs/components/UnorderedList.cjs.map +1 -0
- package/dist/beta/cjs/index.cjs +18 -0
- package/dist/beta/cjs/index.cjs.map +1 -0
- package/dist/beta/cjs/utils/utils.cjs +77 -0
- package/dist/beta/cjs/utils/utils.cjs.map +1 -0
- package/dist/beta/esm/components/Blockquote.mjs +29 -0
- package/dist/beta/esm/components/Blockquote.mjs.map +1 -0
- package/dist/beta/esm/components/Heading.mjs +37 -0
- package/dist/beta/esm/components/Heading.mjs.map +1 -0
- package/dist/beta/esm/components/Link.mjs +41 -0
- package/dist/beta/esm/components/Link.mjs.map +1 -0
- package/dist/beta/esm/components/ListItem.mjs +33 -0
- package/dist/beta/esm/components/ListItem.mjs.map +1 -0
- package/dist/beta/esm/components/NumberedList.mjs +32 -0
- package/dist/beta/esm/components/NumberedList.mjs.map +1 -0
- package/dist/beta/esm/components/Text.mjs +36 -0
- package/dist/beta/esm/components/Text.mjs.map +1 -0
- package/dist/beta/esm/components/UnorderedList.mjs +29 -0
- package/dist/beta/esm/components/UnorderedList.mjs.map +1 -0
- package/dist/beta/esm/index.mjs +18 -0
- package/dist/beta/esm/index.mjs.map +1 -0
- package/dist/beta/esm/utils/utils.mjs +77 -0
- package/dist/beta/esm/utils/utils.mjs.map +1 -0
- package/dist/beta/styles/components/heading.css +458 -0
- package/dist/beta/styles/components/text.css +959 -0
- package/dist/beta/types/components/Blockquote.d.ts +12 -0
- package/dist/beta/{Heading.d.ts → types/components/Heading.d.ts} +2 -3
- package/dist/beta/types/components/Link.d.ts +22 -0
- package/dist/beta/types/components/ListItem.d.ts +22 -0
- package/dist/beta/types/components/NumberedList.d.ts +22 -0
- package/dist/beta/{Text.d.ts → types/components/Text.d.ts} +2 -3
- package/dist/beta/types/components/UnorderedList.d.ts +20 -0
- package/dist/beta/types/index.d.ts +8 -0
- package/dist/beta/types/utils/utils.d.ts +13 -0
- package/dist/index.d.ts +0 -5
- package/dist/styles.css +162 -820
- package/dist/typography.cjs.js +416 -0
- package/dist/typography.cjs.js.map +1 -0
- package/dist/typography.esm.js +392 -454
- package/dist/typography.esm.js.map +1 -1
- package/fonts/Entur-Nationale-Demibold.eot +0 -0
- package/fonts/Entur-Nationale-Demibold.woff +0 -0
- package/fonts/Entur-Nationale-Demibold.woff2 +0 -0
- package/fonts/Entur-Nationale-DemiboldItalic.eot +0 -0
- package/fonts/Entur-Nationale-DemiboldItalic.woff +0 -0
- package/fonts/Entur-Nationale-DemiboldItalic.woff2 +0 -0
- package/fonts/Entur-Nationale-Italic.eot +0 -0
- package/fonts/Entur-Nationale-Italic.woff +0 -0
- package/fonts/Entur-Nationale-Italic.woff2 +0 -0
- package/fonts/Entur-Nationale-Light.eot +0 -0
- package/fonts/Entur-Nationale-Light.woff +0 -0
- package/fonts/Entur-Nationale-Light.woff2 +0 -0
- package/fonts/Entur-Nationale-LightItalic.eot +0 -0
- package/fonts/Entur-Nationale-LightItalic.woff +0 -0
- package/fonts/Entur-Nationale-LightItalic.woff2 +0 -0
- package/fonts/Entur-Nationale-Medium.eot +0 -0
- package/fonts/Entur-Nationale-Medium.woff +0 -0
- package/fonts/Entur-Nationale-Medium.woff2 +0 -0
- package/fonts/Entur-Nationale-MediumItalic.eot +0 -0
- package/fonts/Entur-Nationale-MediumItalic.woff +0 -0
- package/fonts/Entur-Nationale-MediumItalic.woff2 +0 -0
- package/fonts/Entur-Nationale-Regular.eot +0 -0
- package/fonts/Entur-Nationale-Regular.woff +0 -0
- package/fonts/Entur-Nationale-Regular.woff2 +0 -0
- package/package.json +59 -19
- package/scripts/migrate-typography.js +415 -178
- package/dist/beta/BlockquoteBeta.d.ts +0 -12
- package/dist/beta/LinkBeta.d.ts +0 -16
- package/dist/beta/index.d.ts +0 -6
- package/dist/beta/utils.d.ts +0 -9
- package/dist/index.js +0 -8
- package/dist/typography.cjs.development.js +0 -508
- package/dist/typography.cjs.development.js.map +0 -1
- package/dist/typography.cjs.production.min.js +0 -2
- package/dist/typography.cjs.production.min.js.map +0 -1
- /package/dist/beta/{types.d.ts → types/types.d.ts} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type BlockquoteProps = {
|
|
3
|
+
/** Ekstra klassenavn */
|
|
4
|
+
className?: string;
|
|
5
|
+
} & React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
|
|
6
|
+
export declare const Blockquote: ({ className, ...rest }: BlockquoteProps) => React.JSX.Element;
|
|
7
|
+
type BlockquoteFooterProps = {
|
|
8
|
+
/** Ekstra klassenavn */
|
|
9
|
+
className?: string;
|
|
10
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
11
|
+
export declare const BlockquoteFooter: ({ className, ...rest }: BlockquoteFooterProps) => React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TypographyHeadingVariant, TypographySize, TypographySpacing } from '
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TypographyHeadingVariant, TypographySize, TypographySpacing } from '../types';
|
|
3
3
|
import { PolymorphicComponentProps } from '@entur/utils';
|
|
4
|
-
import './styles.scss';
|
|
5
4
|
type HeadingBaseProps = {
|
|
6
5
|
/** Visuell variant som bestemmer styling (anbefalt over size) */
|
|
7
6
|
variant?: TypographyHeadingVariant;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySpacing } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
6
|
+
*/
|
|
7
|
+
type LinkBaseProps = {
|
|
8
|
+
external?: boolean;
|
|
9
|
+
/** Ekstra klassenavn */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Innholdet */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Spacing around the component (same as Text and Heading components) */
|
|
14
|
+
spacing?: TypographySpacing;
|
|
15
|
+
ariaLabelExternalIcon?: string;
|
|
16
|
+
};
|
|
17
|
+
export type LinkProps<C extends React.ElementType> = PolymorphicComponentProps<C, LinkBaseProps>;
|
|
18
|
+
/**
|
|
19
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
20
|
+
*/
|
|
21
|
+
export declare const Link: <C extends React.ElementType = "a">({ external, ariaLabelExternalIcon, className, spacing, children, as, ...rest }: LinkProps<C>) => JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySpacing } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
6
|
+
*/
|
|
7
|
+
type ListItemBaseProps = {
|
|
8
|
+
/** Ekstra klassenavn */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Innholdet */
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/** Tittel */
|
|
13
|
+
title?: React.ReactNode;
|
|
14
|
+
/** Spacing around the component (same as Text and Heading components) */
|
|
15
|
+
spacing?: TypographySpacing;
|
|
16
|
+
};
|
|
17
|
+
export type ListItemProps<C extends React.ElementType> = PolymorphicComponentProps<C, ListItemBaseProps>;
|
|
18
|
+
/**
|
|
19
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
20
|
+
*/
|
|
21
|
+
export declare const ListItem: <C extends React.ElementType = "li">({ children, className, title, spacing, as, ...rest }: ListItemProps<C>) => JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySpacing } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
6
|
+
*/
|
|
7
|
+
type NumberedListBaseProps = {
|
|
8
|
+
/** Ekstra klassenavn */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Innholdet */
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/** List type (1, A, a, I, i) */
|
|
13
|
+
type?: '1' | 'A' | 'a' | 'I' | 'i';
|
|
14
|
+
/** Spacing around the component (same as Text and Heading components) */
|
|
15
|
+
spacing?: TypographySpacing;
|
|
16
|
+
};
|
|
17
|
+
export type NumberedListProps<C extends React.ElementType> = PolymorphicComponentProps<C, NumberedListBaseProps>;
|
|
18
|
+
/**
|
|
19
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
20
|
+
*/
|
|
21
|
+
export declare const NumberedList: <C extends React.ElementType = "ol">({ className, type, spacing, as, children, ...rest }: NumberedListProps<C>) => JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './styles.scss';
|
|
3
|
-
import { TypographySize, TypographyTextVariant, TypographyWeight, TypographySpacing } from './types';
|
|
1
|
+
import { default as React } from 'react';
|
|
4
2
|
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySize, TypographyTextVariant, TypographyWeight, TypographySpacing } from '../types';
|
|
5
4
|
type TextBaseProps = {
|
|
6
5
|
/** Visuell tekststørrelse (typografi-token) */
|
|
7
6
|
size?: TypographySize;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySpacing } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
6
|
+
*/
|
|
7
|
+
type UnorderedListBaseProps = {
|
|
8
|
+
/** Ekstra klassenavn */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Innholdet */
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/** Spacing around the component (same as Text and Heading components) */
|
|
13
|
+
spacing?: TypographySpacing;
|
|
14
|
+
};
|
|
15
|
+
export type UnorderedListProps<C extends React.ElementType> = PolymorphicComponentProps<C, UnorderedListBaseProps>;
|
|
16
|
+
/**
|
|
17
|
+
* @beta Experimental component - may have breaking changes in future releases
|
|
18
|
+
*/
|
|
19
|
+
export declare const UnorderedList: <C extends React.ElementType = "ul">({ className, spacing, as, children, ...rest }: UnorderedListProps<C>) => JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Heading } from './components/Heading';
|
|
2
|
+
export { Text } from './components/Text';
|
|
3
|
+
export { Link } from './components/Link';
|
|
4
|
+
export { Blockquote, BlockquoteFooter } from './components/Blockquote';
|
|
5
|
+
export { UnorderedList } from './components/UnorderedList';
|
|
6
|
+
export { NumberedList } from './components/NumberedList';
|
|
7
|
+
export { ListItem } from './components/ListItem';
|
|
8
|
+
export type { TypographyHeadingVariant, TypographyTextVariant, TypographySize, TypographyWeight, TypographySpacing, } from './types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TypographySpacing, TypographyHeadingVariant, TypographyTextVariant } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Get spacing classes for a component
|
|
4
|
+
*/
|
|
5
|
+
export declare function getSpacingClasses(spacing: TypographySpacing | undefined, baseClass: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Get heading variant based on semantic HTML element
|
|
8
|
+
*/
|
|
9
|
+
export declare function getHeadingVariantFromSemanticType(element: string | React.ElementType): TypographyHeadingVariant;
|
|
10
|
+
/**
|
|
11
|
+
* Get semantic HTML element from text variant
|
|
12
|
+
*/
|
|
13
|
+
export declare function getSemanticTypeFromTextVariant(variant: TypographyTextVariant | undefined): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import './index.scss';
|
|
2
1
|
export * from './Blockquote';
|
|
3
2
|
export * from './CodeText';
|
|
4
3
|
export * from './EmphasizedText';
|
|
@@ -20,7 +19,3 @@ export * from './StrongText';
|
|
|
20
19
|
export * from './SubLabel';
|
|
21
20
|
export * from './SubParagraph';
|
|
22
21
|
export * from './UnorderedList';
|
|
23
|
-
export * from './beta/Text';
|
|
24
|
-
export * from './beta/Heading';
|
|
25
|
-
export * from './beta/BlockquoteBeta';
|
|
26
|
-
export * from './beta/LinkBeta';
|