@entur/typography 3.1.0 → 3.2.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/dist/beta/cjs/components/ListItem.cjs +6 -1
- package/dist/beta/cjs/components/ListItem.cjs.map +1 -1
- package/dist/beta/cjs/components/NumberedList.cjs +2 -0
- package/dist/beta/cjs/components/NumberedList.cjs.map +1 -1
- package/dist/beta/cjs/components/UnorderedList.cjs +14 -2
- package/dist/beta/cjs/components/UnorderedList.cjs.map +1 -1
- package/dist/beta/esm/components/ListItem.mjs +6 -1
- package/dist/beta/esm/components/ListItem.mjs.map +1 -1
- package/dist/beta/esm/components/NumberedList.mjs +2 -0
- package/dist/beta/esm/components/NumberedList.mjs.map +1 -1
- package/dist/beta/esm/components/UnorderedList.mjs +14 -2
- package/dist/beta/esm/components/UnorderedList.mjs.map +1 -1
- package/dist/beta/types/components/ListItem.d.ts +2 -0
- package/dist/beta/types/components/NumberedList.d.ts +2 -0
- package/dist/beta/types/components/UnorderedList.d.ts +2 -0
- package/package.json +5 -5
|
@@ -10,6 +10,7 @@ const ListItem = React.forwardRef(
|
|
|
10
10
|
({
|
|
11
11
|
title,
|
|
12
12
|
className,
|
|
13
|
+
tone,
|
|
13
14
|
spacing,
|
|
14
15
|
style,
|
|
15
16
|
children,
|
|
@@ -21,7 +22,11 @@ const ListItem = React.forwardRef(
|
|
|
21
22
|
ItemElement,
|
|
22
23
|
{
|
|
23
24
|
ref,
|
|
24
|
-
className: classNames(
|
|
25
|
+
className: classNames(
|
|
26
|
+
"eds-text--list-item",
|
|
27
|
+
tone && `eds-text--tone-${tone}`,
|
|
28
|
+
className
|
|
29
|
+
),
|
|
25
30
|
style: utils.getSpacingStyle(spacing, style),
|
|
26
31
|
...rest,
|
|
27
32
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.cjs","sources":["../../../../src/beta/components/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type ListItemOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Innholdet */\n children?: React.ReactNode;\n /** Tittel */\n title?: React.ReactNode;\n};\n\nexport type ListItemProps<C extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<C, ListItemOwnProps>;\n\nexport type ListItemComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: ListItemProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'li';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const ListItem = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n title,\n className,\n spacing,\n style,\n children,\n as,\n ...rest\n }: ListItemProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ItemElement: React.ElementType = as || defaultElement;\n\n return (\n <ItemElement\n ref={ref}\n className={classNames('eds-text--list-item'
|
|
1
|
+
{"version":3,"file":"ListItem.cjs","sources":["../../../../src/beta/components/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type ListItemOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Dempet punkt, for eksempel et steg som er fullført. Velger riktig farge i kontrast- og mørk modus. */\n tone?: 'subdued';\n /** Innholdet */\n children?: React.ReactNode;\n /** Tittel */\n title?: React.ReactNode;\n};\n\nexport type ListItemProps<C extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<C, ListItemOwnProps>;\n\nexport type ListItemComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: ListItemProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'li';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const ListItem = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n title,\n className,\n tone,\n spacing,\n style,\n children,\n as,\n ...rest\n }: ListItemProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ItemElement: React.ElementType = as || defaultElement;\n\n return (\n <ItemElement\n ref={ref}\n className={classNames(\n 'eds-text--list-item',\n tone && `eds-text--tone-${tone}`,\n className,\n )}\n style={getSpacingStyle(spacing, style)}\n {...rest}\n >\n {title && <span className=\"eds-text--list-item__title\">{title}</span>}\n {children}\n </ItemElement>\n );\n },\n) as ListItemComponent;\nListItem.displayName = 'ListItem';\n"],"names":["jsxs","getSpacingStyle","jsx"],"mappings":";;;;;;;AA+BA,MAAM,iBAAiB;AAKhB,MAAM,WAAW,MAAM;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,cAAiC,MAAM;AAE7C,WACEA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,QAAQ,kBAAkB,IAAI;AAAA,UAC9B;AAAA,QAAA;AAAA,QAEF,OAAOC,MAAAA,gBAAgB,SAAS,KAAK;AAAA,QACpC,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,SAASC,2BAAAA,IAAC,QAAA,EAAK,WAAU,8BAA8B,UAAA,OAAM;AAAA,UAC7D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,SAAS,cAAc;;"}
|
|
@@ -11,6 +11,7 @@ const NumberedList = React.forwardRef(
|
|
|
11
11
|
type = "1",
|
|
12
12
|
variant = "default",
|
|
13
13
|
className,
|
|
14
|
+
tone,
|
|
14
15
|
spacing,
|
|
15
16
|
style,
|
|
16
17
|
children,
|
|
@@ -26,6 +27,7 @@ const NumberedList = React.forwardRef(
|
|
|
26
27
|
"eds-text--numbered-list",
|
|
27
28
|
`eds-text--numbered-list--type-${type}`,
|
|
28
29
|
{ "eds-text--steps": variant === "steps" },
|
|
30
|
+
tone && `eds-text--tone-${tone}`,
|
|
29
31
|
className
|
|
30
32
|
),
|
|
31
33
|
type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberedList.cjs","sources":["../../../../src/beta/components/NumberedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type NumberedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Innholdet */\n children?: React.ReactNode;\n /** List type (1, A, a, I, i) */\n type?: '1' | 'A' | 'a' | 'I' | 'i';\n /** `steps` viser numrene i merker, for steg-for-steg-instruksjoner\n * @default 'default'\n */\n variant?: 'default' | 'steps';\n};\n\nexport type NumberedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, NumberedListOwnProps>;\n\nexport type NumberedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: NumberedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ol';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const NumberedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n type = '1',\n variant = 'default',\n className,\n spacing,\n style,\n children,\n as,\n ...rest\n }: NumberedListProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ListElement: React.ElementType = as || defaultElement;\n\n return (\n <ListElement\n ref={ref}\n className={classNames(\n 'eds-text--numbered-list',\n `eds-text--numbered-list--type-${type}`,\n { 'eds-text--steps': variant === 'steps' },\n className,\n )}\n type={type}\n // Safari drops list semantics when the list has no markers\n role={variant === 'steps' ? 'list' : undefined}\n style={getSpacingStyle(spacing, style)}\n {...rest}\n >\n {children}\n </ListElement>\n );\n },\n) as NumberedListComponent;\nNumberedList.displayName = 'NumberedList';\n"],"names":["jsx","getSpacingStyle"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"NumberedList.cjs","sources":["../../../../src/beta/components/NumberedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type NumberedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Dempet liste for sekundær informasjon, som hjelpetekst. Velger riktig farge i kontrast- og mørk modus. */\n tone?: 'subdued';\n /** Innholdet */\n children?: React.ReactNode;\n /** List type (1, A, a, I, i) */\n type?: '1' | 'A' | 'a' | 'I' | 'i';\n /** `steps` viser numrene i merker, for steg-for-steg-instruksjoner\n * @default 'default'\n */\n variant?: 'default' | 'steps';\n};\n\nexport type NumberedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, NumberedListOwnProps>;\n\nexport type NumberedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: NumberedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ol';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const NumberedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n type = '1',\n variant = 'default',\n className,\n tone,\n spacing,\n style,\n children,\n as,\n ...rest\n }: NumberedListProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ListElement: React.ElementType = as || defaultElement;\n\n return (\n <ListElement\n ref={ref}\n className={classNames(\n 'eds-text--numbered-list',\n `eds-text--numbered-list--type-${type}`,\n { 'eds-text--steps': variant === 'steps' },\n tone && `eds-text--tone-${tone}`,\n className,\n )}\n type={type}\n // Safari drops list semantics when the list has no markers\n role={variant === 'steps' ? 'list' : undefined}\n style={getSpacingStyle(spacing, style)}\n {...rest}\n >\n {children}\n </ListElement>\n );\n },\n) as NumberedListComponent;\nNumberedList.displayName = 'NumberedList';\n"],"names":["jsx","getSpacingStyle"],"mappings":";;;;;;;AAoCA,MAAM,iBAAiB;AAKhB,MAAM,eAAe,MAAM;AAAA,EAChC,CACE;AAAA,IACE,OAAO;AAAA,IACP,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,cAAiC,MAAM;AAE7C,WACEA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,iCAAiC,IAAI;AAAA,UACrC,EAAE,mBAAmB,YAAY,QAAA;AAAA,UACjC,QAAQ,kBAAkB,IAAI;AAAA,UAC9B;AAAA,QAAA;AAAA,QAEF;AAAA,QAEA,MAAM,YAAY,UAAU,SAAS;AAAA,QACrC,OAAOC,MAAAA,gBAAgB,SAAS,KAAK;AAAA,QACpC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,aAAa,cAAc;;"}
|
|
@@ -7,13 +7,25 @@ const utils = require("../utils/utils.cjs");
|
|
|
7
7
|
;/* empty css */
|
|
8
8
|
const defaultElement = "ul";
|
|
9
9
|
const UnorderedList = React.forwardRef(
|
|
10
|
-
({
|
|
10
|
+
({
|
|
11
|
+
className,
|
|
12
|
+
tone,
|
|
13
|
+
spacing,
|
|
14
|
+
style,
|
|
15
|
+
children,
|
|
16
|
+
as,
|
|
17
|
+
...rest
|
|
18
|
+
}, ref) => {
|
|
11
19
|
const ListElement = as || defaultElement;
|
|
12
20
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
21
|
ListElement,
|
|
14
22
|
{
|
|
15
23
|
ref,
|
|
16
|
-
className: classNames(
|
|
24
|
+
className: classNames(
|
|
25
|
+
"eds-text--unordered-list",
|
|
26
|
+
tone && `eds-text--tone-${tone}`,
|
|
27
|
+
className
|
|
28
|
+
),
|
|
17
29
|
style: utils.getSpacingStyle(spacing, style),
|
|
18
30
|
role: "list",
|
|
19
31
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnorderedList.cjs","sources":["../../../../src/beta/components/UnorderedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type UnorderedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Innholdet */\n children?: React.ReactNode;\n};\n\nexport type UnorderedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, UnorderedListOwnProps>;\n\nexport type UnorderedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: UnorderedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ul';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const UnorderedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {
|
|
1
|
+
{"version":3,"file":"UnorderedList.cjs","sources":["../../../../src/beta/components/UnorderedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type UnorderedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Dempet liste for sekundær informasjon, som hjelpetekst. Velger riktig farge i kontrast- og mørk modus. */\n tone?: 'subdued';\n /** Innholdet */\n children?: React.ReactNode;\n};\n\nexport type UnorderedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, UnorderedListOwnProps>;\n\nexport type UnorderedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: UnorderedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ul';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const UnorderedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n className,\n tone,\n spacing,\n style,\n children,\n as,\n ...rest\n }: UnorderedListProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ListElement: React.ElementType = as || defaultElement;\n\n return (\n <ListElement\n ref={ref}\n className={classNames(\n 'eds-text--unordered-list',\n tone && `eds-text--tone-${tone}`,\n className,\n )}\n style={getSpacingStyle(spacing, style)}\n // Safari drops list semantics when the list has no markers\n role=\"list\"\n {...rest}\n >\n {children}\n </ListElement>\n );\n },\n) as UnorderedListComponent;\nUnorderedList.displayName = 'UnorderedList';\n"],"names":["jsx","getSpacingStyle"],"mappings":";;;;;;;AA8BA,MAAM,iBAAiB;AAKhB,MAAM,gBAAgB,MAAM;AAAA,EACjC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,cAAiC,MAAM;AAE7C,WACEA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,QAAQ,kBAAkB,IAAI;AAAA,UAC9B;AAAA,QAAA;AAAA,QAEF,OAAOC,MAAAA,gBAAgB,SAAS,KAAK;AAAA,QAErC,MAAK;AAAA,QACJ,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,cAAc,cAAc;;"}
|
|
@@ -8,6 +8,7 @@ const ListItem = React.forwardRef(
|
|
|
8
8
|
({
|
|
9
9
|
title,
|
|
10
10
|
className,
|
|
11
|
+
tone,
|
|
11
12
|
spacing,
|
|
12
13
|
style,
|
|
13
14
|
children,
|
|
@@ -19,7 +20,11 @@ const ListItem = React.forwardRef(
|
|
|
19
20
|
ItemElement,
|
|
20
21
|
{
|
|
21
22
|
ref,
|
|
22
|
-
className: classNames(
|
|
23
|
+
className: classNames(
|
|
24
|
+
"eds-text--list-item",
|
|
25
|
+
tone && `eds-text--tone-${tone}`,
|
|
26
|
+
className
|
|
27
|
+
),
|
|
23
28
|
style: getSpacingStyle(spacing, style),
|
|
24
29
|
...rest,
|
|
25
30
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.mjs","sources":["../../../../src/beta/components/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type ListItemOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Innholdet */\n children?: React.ReactNode;\n /** Tittel */\n title?: React.ReactNode;\n};\n\nexport type ListItemProps<C extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<C, ListItemOwnProps>;\n\nexport type ListItemComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: ListItemProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'li';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const ListItem = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n title,\n className,\n spacing,\n style,\n children,\n as,\n ...rest\n }: ListItemProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ItemElement: React.ElementType = as || defaultElement;\n\n return (\n <ItemElement\n ref={ref}\n className={classNames('eds-text--list-item'
|
|
1
|
+
{"version":3,"file":"ListItem.mjs","sources":["../../../../src/beta/components/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type ListItemOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Dempet punkt, for eksempel et steg som er fullført. Velger riktig farge i kontrast- og mørk modus. */\n tone?: 'subdued';\n /** Innholdet */\n children?: React.ReactNode;\n /** Tittel */\n title?: React.ReactNode;\n};\n\nexport type ListItemProps<C extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<C, ListItemOwnProps>;\n\nexport type ListItemComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: ListItemProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'li';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const ListItem = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n title,\n className,\n tone,\n spacing,\n style,\n children,\n as,\n ...rest\n }: ListItemProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ItemElement: React.ElementType = as || defaultElement;\n\n return (\n <ItemElement\n ref={ref}\n className={classNames(\n 'eds-text--list-item',\n tone && `eds-text--tone-${tone}`,\n className,\n )}\n style={getSpacingStyle(spacing, style)}\n {...rest}\n >\n {title && <span className=\"eds-text--list-item__title\">{title}</span>}\n {children}\n </ItemElement>\n );\n },\n) as ListItemComponent;\nListItem.displayName = 'ListItem';\n"],"names":[],"mappings":";;;;;AA+BA,MAAM,iBAAiB;AAKhB,MAAM,WAAW,MAAM;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,cAAiC,MAAM;AAE7C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,QAAQ,kBAAkB,IAAI;AAAA,UAC9B;AAAA,QAAA;AAAA,QAEF,OAAO,gBAAgB,SAAS,KAAK;AAAA,QACpC,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,SAAS,oBAAC,QAAA,EAAK,WAAU,8BAA8B,UAAA,OAAM;AAAA,UAC7D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,SAAS,cAAc;"}
|
|
@@ -9,6 +9,7 @@ const NumberedList = React.forwardRef(
|
|
|
9
9
|
type = "1",
|
|
10
10
|
variant = "default",
|
|
11
11
|
className,
|
|
12
|
+
tone,
|
|
12
13
|
spacing,
|
|
13
14
|
style,
|
|
14
15
|
children,
|
|
@@ -24,6 +25,7 @@ const NumberedList = React.forwardRef(
|
|
|
24
25
|
"eds-text--numbered-list",
|
|
25
26
|
`eds-text--numbered-list--type-${type}`,
|
|
26
27
|
{ "eds-text--steps": variant === "steps" },
|
|
28
|
+
tone && `eds-text--tone-${tone}`,
|
|
27
29
|
className
|
|
28
30
|
),
|
|
29
31
|
type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberedList.mjs","sources":["../../../../src/beta/components/NumberedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type NumberedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Innholdet */\n children?: React.ReactNode;\n /** List type (1, A, a, I, i) */\n type?: '1' | 'A' | 'a' | 'I' | 'i';\n /** `steps` viser numrene i merker, for steg-for-steg-instruksjoner\n * @default 'default'\n */\n variant?: 'default' | 'steps';\n};\n\nexport type NumberedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, NumberedListOwnProps>;\n\nexport type NumberedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: NumberedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ol';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const NumberedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n type = '1',\n variant = 'default',\n className,\n spacing,\n style,\n children,\n as,\n ...rest\n }: NumberedListProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ListElement: React.ElementType = as || defaultElement;\n\n return (\n <ListElement\n ref={ref}\n className={classNames(\n 'eds-text--numbered-list',\n `eds-text--numbered-list--type-${type}`,\n { 'eds-text--steps': variant === 'steps' },\n className,\n )}\n type={type}\n // Safari drops list semantics when the list has no markers\n role={variant === 'steps' ? 'list' : undefined}\n style={getSpacingStyle(spacing, style)}\n {...rest}\n >\n {children}\n </ListElement>\n );\n },\n) as NumberedListComponent;\nNumberedList.displayName = 'NumberedList';\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"NumberedList.mjs","sources":["../../../../src/beta/components/NumberedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type NumberedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Dempet liste for sekundær informasjon, som hjelpetekst. Velger riktig farge i kontrast- og mørk modus. */\n tone?: 'subdued';\n /** Innholdet */\n children?: React.ReactNode;\n /** List type (1, A, a, I, i) */\n type?: '1' | 'A' | 'a' | 'I' | 'i';\n /** `steps` viser numrene i merker, for steg-for-steg-instruksjoner\n * @default 'default'\n */\n variant?: 'default' | 'steps';\n};\n\nexport type NumberedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, NumberedListOwnProps>;\n\nexport type NumberedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: NumberedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ol';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const NumberedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n type = '1',\n variant = 'default',\n className,\n tone,\n spacing,\n style,\n children,\n as,\n ...rest\n }: NumberedListProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ListElement: React.ElementType = as || defaultElement;\n\n return (\n <ListElement\n ref={ref}\n className={classNames(\n 'eds-text--numbered-list',\n `eds-text--numbered-list--type-${type}`,\n { 'eds-text--steps': variant === 'steps' },\n tone && `eds-text--tone-${tone}`,\n className,\n )}\n type={type}\n // Safari drops list semantics when the list has no markers\n role={variant === 'steps' ? 'list' : undefined}\n style={getSpacingStyle(spacing, style)}\n {...rest}\n >\n {children}\n </ListElement>\n );\n },\n) as NumberedListComponent;\nNumberedList.displayName = 'NumberedList';\n"],"names":[],"mappings":";;;;;AAoCA,MAAM,iBAAiB;AAKhB,MAAM,eAAe,MAAM;AAAA,EAChC,CACE;AAAA,IACE,OAAO;AAAA,IACP,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,cAAiC,MAAM;AAE7C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,iCAAiC,IAAI;AAAA,UACrC,EAAE,mBAAmB,YAAY,QAAA;AAAA,UACjC,QAAQ,kBAAkB,IAAI;AAAA,UAC9B;AAAA,QAAA;AAAA,QAEF;AAAA,QAEA,MAAM,YAAY,UAAU,SAAS;AAAA,QACrC,OAAO,gBAAgB,SAAS,KAAK;AAAA,QACpC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,aAAa,cAAc;"}
|
|
@@ -5,13 +5,25 @@ import { getSpacingStyle } from "../utils/utils.mjs";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
const defaultElement = "ul";
|
|
7
7
|
const UnorderedList = React.forwardRef(
|
|
8
|
-
({
|
|
8
|
+
({
|
|
9
|
+
className,
|
|
10
|
+
tone,
|
|
11
|
+
spacing,
|
|
12
|
+
style,
|
|
13
|
+
children,
|
|
14
|
+
as,
|
|
15
|
+
...rest
|
|
16
|
+
}, ref) => {
|
|
9
17
|
const ListElement = as || defaultElement;
|
|
10
18
|
return /* @__PURE__ */ jsx(
|
|
11
19
|
ListElement,
|
|
12
20
|
{
|
|
13
21
|
ref,
|
|
14
|
-
className: classNames(
|
|
22
|
+
className: classNames(
|
|
23
|
+
"eds-text--unordered-list",
|
|
24
|
+
tone && `eds-text--tone-${tone}`,
|
|
25
|
+
className
|
|
26
|
+
),
|
|
15
27
|
style: getSpacingStyle(spacing, style),
|
|
16
28
|
role: "list",
|
|
17
29
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnorderedList.mjs","sources":["../../../../src/beta/components/UnorderedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type UnorderedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Innholdet */\n children?: React.ReactNode;\n};\n\nexport type UnorderedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, UnorderedListOwnProps>;\n\nexport type UnorderedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: UnorderedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ul';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const UnorderedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {
|
|
1
|
+
{"version":3,"file":"UnorderedList.mjs","sources":["../../../../src/beta/components/UnorderedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacingProps } from '../types';\nimport { getSpacingStyle } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport type UnorderedListOwnProps = TypographySpacingProps & {\n /** Ekstra klassenavn */\n className?: string;\n /** Dempet liste for sekundær informasjon, som hjelpetekst. Velger riktig farge i kontrast- og mørk modus. */\n tone?: 'subdued';\n /** Innholdet */\n children?: React.ReactNode;\n};\n\nexport type UnorderedListProps<\n C extends React.ElementType = typeof defaultElement,\n> = PolymorphicComponentProps<C, UnorderedListOwnProps>;\n\nexport type UnorderedListComponent = (<\n C extends React.ElementType = typeof defaultElement,\n>(\n props: UnorderedListProps<C> & { ref?: React.Ref<Element> },\n) => React.ReactElement | null) & { displayName?: string };\n\nconst defaultElement = 'ul';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const UnorderedList = React.forwardRef(\n <C extends React.ElementType = typeof defaultElement>(\n {\n className,\n tone,\n spacing,\n style,\n children,\n as,\n ...rest\n }: UnorderedListProps<C>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const ListElement: React.ElementType = as || defaultElement;\n\n return (\n <ListElement\n ref={ref}\n className={classNames(\n 'eds-text--unordered-list',\n tone && `eds-text--tone-${tone}`,\n className,\n )}\n style={getSpacingStyle(spacing, style)}\n // Safari drops list semantics when the list has no markers\n role=\"list\"\n {...rest}\n >\n {children}\n </ListElement>\n );\n },\n) as UnorderedListComponent;\nUnorderedList.displayName = 'UnorderedList';\n"],"names":[],"mappings":";;;;;AA8BA,MAAM,iBAAiB;AAKhB,MAAM,gBAAgB,MAAM;AAAA,EACjC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,cAAiC,MAAM;AAE7C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,QAAQ,kBAAkB,IAAI;AAAA,UAC9B;AAAA,QAAA;AAAA,QAEF,OAAO,gBAAgB,SAAS,KAAK;AAAA,QAErC,MAAK;AAAA,QACJ,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,cAAc,cAAc;"}
|
|
@@ -7,6 +7,8 @@ import { TypographySpacingProps } from '../types';
|
|
|
7
7
|
export type ListItemOwnProps = TypographySpacingProps & {
|
|
8
8
|
/** Ekstra klassenavn */
|
|
9
9
|
className?: string;
|
|
10
|
+
/** Dempet punkt, for eksempel et steg som er fullført. Velger riktig farge i kontrast- og mørk modus. */
|
|
11
|
+
tone?: 'subdued';
|
|
10
12
|
/** Innholdet */
|
|
11
13
|
children?: React.ReactNode;
|
|
12
14
|
/** Tittel */
|
|
@@ -7,6 +7,8 @@ import { TypographySpacingProps } from '../types';
|
|
|
7
7
|
export type NumberedListOwnProps = TypographySpacingProps & {
|
|
8
8
|
/** Ekstra klassenavn */
|
|
9
9
|
className?: string;
|
|
10
|
+
/** Dempet liste for sekundær informasjon, som hjelpetekst. Velger riktig farge i kontrast- og mørk modus. */
|
|
11
|
+
tone?: 'subdued';
|
|
10
12
|
/** Innholdet */
|
|
11
13
|
children?: React.ReactNode;
|
|
12
14
|
/** List type (1, A, a, I, i) */
|
|
@@ -7,6 +7,8 @@ import { TypographySpacingProps } from '../types';
|
|
|
7
7
|
export type UnorderedListOwnProps = TypographySpacingProps & {
|
|
8
8
|
/** Ekstra klassenavn */
|
|
9
9
|
className?: string;
|
|
10
|
+
/** Dempet liste for sekundær informasjon, som hjelpetekst. Velger riktig farge i kontrast- og mørk modus. */
|
|
11
|
+
tone?: 'subdued';
|
|
10
12
|
/** Innholdet */
|
|
11
13
|
children?: React.ReactNode;
|
|
12
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/typography",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"license": "SEE LICENSE IN README.md",
|
|
5
5
|
"main": "./dist/typography.cjs",
|
|
6
6
|
"module": "./dist/typography.mjs",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"react-dom": ">=18.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@entur/icons": "^10.1.
|
|
61
|
-
"@entur/tokens": "^4.3.
|
|
62
|
-
"@entur/utils": "^0.15.
|
|
60
|
+
"@entur/icons": "^10.1.1",
|
|
61
|
+
"@entur/tokens": "^4.3.1",
|
|
62
|
+
"@entur/utils": "^0.15.4",
|
|
63
63
|
"classnames": "^2.5.1",
|
|
64
64
|
"modern-normalize": "^3.0.1"
|
|
65
65
|
},
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"vite": "^7.3.2",
|
|
76
76
|
"vite-plugin-dts": "^4.5.4"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "7e7707d92a67c091c7097ff839ade0aa496a8f0c"
|
|
79
79
|
}
|