Skip to content

Commit

Permalink
chore(Typography): move to own subfolder (#2186)
Browse files Browse the repository at this point in the history
* convert link to ts

* move typography elements to subfolder

* add typography to prepareTemplates ignore list

* convert H element to tsx

* refactor headings to tsx

* convert paragraph elements to tsx

* move typography styling to subfolder

* delete ui-elements file

* import react in typography element files so tests wont fail

* move typography tests to subfolder

* update typography snapshots

* update typography tests

* update P element tests

* move stories to own subfolder

* refactor P to not overwrite modifier prop

* update P snapshot

* move modifier filter to reduce function
  • Loading branch information
joakbjerk authored Apr 12, 2023
1 parent c14237d commit 24448cc
Show file tree
Hide file tree
Showing 75 changed files with 1,144 additions and 524 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export const processElements = async () => {
'stories',
'label',
'lists',
'typography',
],
processToNamesListByUsingFolders: false,
}
Expand Down
4 changes: 1 addition & 3 deletions packages/dnb-eufemia/scripts/prebuild/tasks/styleFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ const runStyleFactory = async () => {
'../../../src/style/dnb-ui-elements.scss'
),
customContent: `
@import './core/utilities.scss';
@import './elements/ui-elements.scss';
`,
@import './core/utilities.scss';`,
scssTemplateToFill: `@import '../elements/{name}/style/dnb-{name}.scss';`,
processToNamesList: [
path.resolve(__dirname, '../../../src/elements/*'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1114,15 +1114,11 @@ exports[`GlobalError snapshot have to match component snapshot 1`] = `
>
<H1
bottom="large"
level={null}
size="xx-large"
top="4"
>
<H
as="h1"
bottom="large"
className={null}
level={null}
size="xx-large"
top="4"
>
Expand All @@ -1149,14 +1145,7 @@ exports[`GlobalError snapshot have to match component snapshot 1`] = `
</H>
</H1>
<P
bold={null}
bottom="large"
className={null}
element="p"
medium={null}
modifier={null}
size={null}
small={null}
>
<ForwardRef
as="p"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@ exports[`Skeleton component have to match snapshot 1`] = `
<Provider
skeleton={null}
>
<P
bold={null}
className={null}
element="p"
medium={null}
modifier={null}
size={null}
small={null}
>
<P>
<ForwardRef
as="p"
className="dnb-p"
Expand Down
26 changes: 0 additions & 26 deletions packages/dnb-eufemia/src/elements/H.d.ts

This file was deleted.

65 changes: 0 additions & 65 deletions packages/dnb-eufemia/src/elements/H.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/dnb-eufemia/src/elements/H.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file is created manually
* You can change the content
*
*/

import H from './typography/H'
export * from './typography/H'
export default H
6 changes: 0 additions & 6 deletions packages/dnb-eufemia/src/elements/H1.d.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/dnb-eufemia/src/elements/H1.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/dnb-eufemia/src/elements/H1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file is created manually
* You can change the content
*
*/

import H1 from './typography/H1'
export * from './typography/H1'
export default H1
6 changes: 0 additions & 6 deletions packages/dnb-eufemia/src/elements/H2.d.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/dnb-eufemia/src/elements/H2.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/dnb-eufemia/src/elements/H2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file is created manually
* You can change the content
*
*/

import H2 from './typography/H2'
export * from './typography/H2'
export default H2
6 changes: 0 additions & 6 deletions packages/dnb-eufemia/src/elements/H3.d.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/dnb-eufemia/src/elements/H3.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/dnb-eufemia/src/elements/H3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file is created manually
* You can change the content
*
*/

import H3 from './typography/H3'
export * from './typography/H3'
export default H3
6 changes: 0 additions & 6 deletions packages/dnb-eufemia/src/elements/H4.d.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/dnb-eufemia/src/elements/H4.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/dnb-eufemia/src/elements/H4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file is created manually
* You can change the content
*
*/

import H4 from './typography/H4'
export * from './typography/H4'
export default H4
6 changes: 0 additions & 6 deletions packages/dnb-eufemia/src/elements/H5.d.ts

This file was deleted.

Loading

0 comments on commit 24448cc

Please sign in to comment.