@entur/typography 1.10.0-beta.1 → 1.10.0-beta.11
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 +12 -11
- package/dist/beta/ListItemBeta.d.ts +16 -0
- package/dist/beta/NumberedListBeta.d.ts +16 -0
- package/dist/beta/UnorderedListBeta.d.ts +14 -0
- package/dist/beta/index.d.ts +3 -0
- package/dist/beta/utils.d.ts +2 -1
- package/dist/index.d.ts +3 -0
- package/dist/styles.css +78 -0
- package/dist/typography.cjs.development.js +125 -54
- package/dist/typography.cjs.development.js.map +1 -1
- package/dist/typography.cjs.production.min.js +1 -1
- package/dist/typography.cjs.production.min.js.map +1 -1
- package/dist/typography.esm.js +123 -55
- package/dist/typography.esm.js.map +1 -1
- package/package.json +6 -2
- package/scripts/migrate-typography.js +593 -155
package/README.md
CHANGED
|
@@ -63,18 +63,20 @@ function MyComponent() {
|
|
|
63
63
|
### Quick Migration
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
# Option 1:
|
|
66
|
+
# Option 1: Using npx (recommended)
|
|
67
67
|
npx @entur/typography@latest migrate
|
|
68
68
|
|
|
69
|
-
# Option 2:
|
|
70
|
-
npx @entur/typography@latest migrate
|
|
69
|
+
# Option 2: With specific options
|
|
70
|
+
npx @entur/typography@latest migrate --dry-run
|
|
71
71
|
|
|
72
|
-
# Option 3: Direct execution (if you have the package locally)
|
|
73
|
-
node node_modules/@entur/typography/scripts/migrate-typography.js
|
|
74
72
|
|
|
75
|
-
#
|
|
76
|
-
|
|
77
|
-
npx @entur/typography@latest migrate
|
|
73
|
+
# Option 3: From installed package
|
|
74
|
+
npm install @entur/typography@latest
|
|
75
|
+
npx @entur/typography@latest migrate
|
|
76
|
+
|
|
77
|
+
# Option 4: Add to your package.json scripts
|
|
78
|
+
# "scripts": { "migrate-typography": "npx @entur/typography@latest migrate" }
|
|
79
|
+
# Then run: npm run migrate-typography -- --dry-run
|
|
78
80
|
```
|
|
79
81
|
|
|
80
82
|
**Note**: The migration script requires `glob` to be available. If you encounter an error, install it:
|
|
@@ -85,10 +87,9 @@ npm install glob
|
|
|
85
87
|
yarn add glob
|
|
86
88
|
```
|
|
87
89
|
|
|
88
|
-
### Migration
|
|
90
|
+
### Migration Mode
|
|
89
91
|
|
|
90
|
-
- **🚀 Complete Migration
|
|
91
|
-
- **📝 Import-Only Migration**: Updates only import paths (safer for gradual migration)
|
|
92
|
+
- **🚀 Complete Migration**: Updates imports + component usage
|
|
92
93
|
|
|
93
94
|
### Update Styles
|
|
94
95
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySpacing } from './types';
|
|
4
|
+
type ListItemBaseProps = {
|
|
5
|
+
/** Ekstra klassenavn */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Innholdet */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Tittel */
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/** Spacing around the component (same as Text and Heading components) */
|
|
12
|
+
spacing?: TypographySpacing;
|
|
13
|
+
};
|
|
14
|
+
export type ListItemBetaProps<C extends React.ElementType> = PolymorphicComponentProps<C, ListItemBaseProps>;
|
|
15
|
+
export declare const ListItemBeta: <C extends React.ElementType = "li">({ children, className, title, spacing, as, ...rest }: ListItemBetaProps<C>) => JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySpacing } from './types';
|
|
4
|
+
type NumberedListBaseProps = {
|
|
5
|
+
/** Ekstra klassenavn */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Innholdet */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** List type (1, A, a, I, i) */
|
|
10
|
+
type?: '1' | 'A' | 'a' | 'I' | 'i';
|
|
11
|
+
/** Spacing around the component (same as Text and Heading components) */
|
|
12
|
+
spacing?: TypographySpacing;
|
|
13
|
+
};
|
|
14
|
+
export type NumberedListBetaProps<C extends React.ElementType> = PolymorphicComponentProps<C, NumberedListBaseProps>;
|
|
15
|
+
export declare const NumberedListBeta: <C extends React.ElementType = "ol">({ className, type, spacing, as, children, ...rest }: NumberedListBetaProps<C>) => JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
+
import { TypographySpacing } from './types';
|
|
4
|
+
type UnorderedListBaseProps = {
|
|
5
|
+
/** Ekstra klassenavn */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Innholdet */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Spacing around the component (same as Text and Heading components) */
|
|
10
|
+
spacing?: TypographySpacing;
|
|
11
|
+
};
|
|
12
|
+
export type UnorderedListBetaProps<C extends React.ElementType> = PolymorphicComponentProps<C, UnorderedListBaseProps>;
|
|
13
|
+
export declare const UnorderedListBeta: <C extends React.ElementType = "ul">({ className, spacing, as, children, ...rest }: UnorderedListBetaProps<C>) => JSX.Element;
|
|
14
|
+
export {};
|
package/dist/beta/index.d.ts
CHANGED
|
@@ -2,5 +2,8 @@ export { Heading } from './Heading';
|
|
|
2
2
|
export { Text } from './Text';
|
|
3
3
|
export { LinkBeta } from './LinkBeta';
|
|
4
4
|
export { BlockquoteBeta, BlockquoteFooterBeta } from './BlockquoteBeta';
|
|
5
|
+
export { UnorderedListBeta } from './UnorderedListBeta';
|
|
6
|
+
export { NumberedListBeta } from './NumberedListBeta';
|
|
7
|
+
export { ListItemBeta } from './ListItemBeta';
|
|
5
8
|
export { getHeadingVariantFromSemanticType, getSpacingClasses } from './utils';
|
|
6
9
|
export type { TypographyHeadingVariant, TypographyTextVariant, TypographySize, TypographyWeight, TypographySpacing, } from './types';
|
package/dist/beta/utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TypographySpacing } from './types';
|
|
1
|
+
import { TypographySpacing, TypographyTextVariant } from './types';
|
|
2
2
|
export declare function getHeadingVariantFromSemanticType(semanticType: string | React.ElementType): "title-1" | "title-2" | "subtitle-1" | "subtitle-2" | "paragraph";
|
|
3
|
+
export declare function getSemanticTypeFromTextVariant(variant?: TypographyTextVariant): React.ElementType;
|
|
3
4
|
/**
|
|
4
5
|
* Generates spacing class names for typography components
|
|
5
6
|
* @param spacing - The spacing value from TypographySpacing
|
package/dist/index.d.ts
CHANGED
|
@@ -24,3 +24,6 @@ export * from './beta/Text';
|
|
|
24
24
|
export * from './beta/Heading';
|
|
25
25
|
export * from './beta/BlockquoteBeta';
|
|
26
26
|
export * from './beta/LinkBeta';
|
|
27
|
+
export * from './beta/UnorderedListBeta';
|
|
28
|
+
export * from './beta/NumberedListBeta';
|
|
29
|
+
export * from './beta/ListItemBeta';
|
package/dist/styles.css
CHANGED
|
@@ -655,6 +655,12 @@
|
|
|
655
655
|
white-space: pre-wrap;
|
|
656
656
|
word-break: keep-all;
|
|
657
657
|
}
|
|
658
|
+
.eds-text--code-text {
|
|
659
|
+
display: inline-block;
|
|
660
|
+
word-wrap: break-word;
|
|
661
|
+
word-wrap: anywhere;
|
|
662
|
+
padding: 0 0.25rem;
|
|
663
|
+
}
|
|
658
664
|
.eds-text--weight-400, .eds-text--weight-regular {
|
|
659
665
|
font-weight: 400;
|
|
660
666
|
}
|
|
@@ -811,6 +817,78 @@ p .eds-text--link--ext-icon {
|
|
|
811
817
|
margin-top: 1.5rem;
|
|
812
818
|
text-transform: uppercase;
|
|
813
819
|
}
|
|
820
|
+
.eds-text--unordered-list {
|
|
821
|
+
list-style: none;
|
|
822
|
+
margin: 1rem 0;
|
|
823
|
+
padding: 0;
|
|
824
|
+
}
|
|
825
|
+
.eds-text--unordered-list .eds-text--list-item::before {
|
|
826
|
+
content: "";
|
|
827
|
+
background: var(--components-typography-list-standard-border);
|
|
828
|
+
display: block;
|
|
829
|
+
height: 0.125rem;
|
|
830
|
+
left: -1.75rem;
|
|
831
|
+
top: 0.75rem;
|
|
832
|
+
position: relative;
|
|
833
|
+
width: 0.75rem;
|
|
834
|
+
}
|
|
835
|
+
.eds-text--numbered-list {
|
|
836
|
+
counter-reset: eds-numbered-list-counter;
|
|
837
|
+
list-style: none;
|
|
838
|
+
margin: 1rem 0;
|
|
839
|
+
padding: 0;
|
|
840
|
+
}
|
|
841
|
+
.eds-text--numbered-list--type-a > .eds-text--list-item::before {
|
|
842
|
+
content: counter(eds-numbered-list-counter, lower-alpha);
|
|
843
|
+
}
|
|
844
|
+
.eds-text--numbered-list--type-A > .eds-text--list-item::before {
|
|
845
|
+
content: counter(eds-numbered-list-counter, upper-alpha);
|
|
846
|
+
}
|
|
847
|
+
.eds-text--numbered-list--type-1 > .eds-text--list-item::before {
|
|
848
|
+
content: counter(eds-numbered-list-counter, decimal);
|
|
849
|
+
}
|
|
850
|
+
.eds-text--numbered-list--type-i > .eds-text--list-item::before {
|
|
851
|
+
content: counter(eds-numbered-list-counter, lower-roman);
|
|
852
|
+
}
|
|
853
|
+
.eds-text--numbered-list--type-I > .eds-text--list-item::before {
|
|
854
|
+
content: counter(eds-numbered-list-counter, upper-roman);
|
|
855
|
+
}
|
|
856
|
+
.eds-text--list-item {
|
|
857
|
+
padding-left: 0.5rem;
|
|
858
|
+
margin-top: 1.5rem;
|
|
859
|
+
position: relative;
|
|
860
|
+
font-size: 1rem;
|
|
861
|
+
font-size: var(--font-size-body-m);
|
|
862
|
+
line-height: 1.5rem;
|
|
863
|
+
line-height: var(--font-line-height-body-m);
|
|
864
|
+
}
|
|
865
|
+
.eds-text--list-item:first-of-type {
|
|
866
|
+
margin-top: 0;
|
|
867
|
+
}
|
|
868
|
+
.eds-text--numbered-list > .eds-text--list-item {
|
|
869
|
+
counter-increment: eds-numbered-list-counter;
|
|
870
|
+
}
|
|
871
|
+
.eds-text--numbered-list > .eds-text--list-item::before {
|
|
872
|
+
color: var(--primary-text-color);
|
|
873
|
+
position: absolute;
|
|
874
|
+
font-weight: 600;
|
|
875
|
+
font-weight: var(--font-weight-heading);
|
|
876
|
+
left: -2.5rem;
|
|
877
|
+
border: 0.125rem solid var(--components-typography-list-standard-border);
|
|
878
|
+
border-radius: 50%;
|
|
879
|
+
height: 2rem;
|
|
880
|
+
width: 2rem;
|
|
881
|
+
display: flex;
|
|
882
|
+
align-items: center;
|
|
883
|
+
justify-content: center;
|
|
884
|
+
top: -0.25rem;
|
|
885
|
+
}
|
|
886
|
+
.eds-text--list-item__title {
|
|
887
|
+
display: block;
|
|
888
|
+
font-weight: 600;
|
|
889
|
+
font-weight: var(--font-weight-heading);
|
|
890
|
+
margin-bottom: 0.5rem;
|
|
891
|
+
}
|
|
814
892
|
@import '~modern-normalize/modern-normalize.css';
|
|
815
893
|
/* DO NOT CHANGE!*/
|
|
816
894
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|