diff --git a/packages/dnb-design-system-portal/src/docs/uilib/components/space/Examples.js b/packages/dnb-design-system-portal/src/docs/uilib/components/space/Examples.tsx similarity index 61% rename from packages/dnb-design-system-portal/src/docs/uilib/components/space/Examples.js rename to packages/dnb-design-system-portal/src/docs/uilib/components/space/Examples.tsx index ee340f3d8fd..2a0d4f50caf 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/components/space/Examples.js +++ b/packages/dnb-design-system-portal/src/docs/uilib/components/space/Examples.tsx @@ -6,9 +6,8 @@ import React from 'react' import PropTypes from 'prop-types' import ComponentBox from '../../../../shared/tags/ComponentBox' -// import { Space } from '@dnb/eufemia/src/components' import styled from '@emotion/styled' -import { Space } from '@dnb/eufemia/src/components' +import { Space, Input, FormRow, Button, P, Code } from '@dnb/eufemia/src' export const SpaceExamplesMethod1 = () => ( @@ -16,15 +15,11 @@ export const SpaceExamplesMethod1 = () => ( data-visual-test="spacing-method-space" scope={{ RedBox }} > - { - /* jsx */ ` - - - - - -` - } + + + + + ) @@ -32,16 +27,12 @@ export const SpaceExamplesMethod1 = () => ( export const SpaceExamplesMethod2 = () => ( - { - /* jsx */ ` - - - - - - -` - } + + + + + + ) @@ -49,14 +40,10 @@ export const SpaceExamplesMethod2 = () => ( export const SpaceExamplesMethod3 = () => ( - { - /* jsx */ ` - - - - -` - } + + + + ) @@ -65,20 +52,22 @@ export const SpaceExampleMarginCollapse = () => ( { - /* jsx */ ` - - - - <>I have bottom="small" - - - - - <>I have top="large" - - - -` + + + + <> + I have bottom="small" + + + + + + <> + I have top="large" + + + + } @@ -87,18 +76,20 @@ export const SpaceExampleMarginCollapse = () => ( export const SpaceExampleMargins = () => ( - { - /* jsx */ ` - -
- - I have four 2.5rem margins! - - And this are my CSS classes: dnb-space dnb-space__top--large dnb-space__top--x-small dnb-space__right--large dnb-space__right--x-small dnb-space__bottom--large dnb-space__bottom--x-small dnb-space__left--large dnb-space__left--x-small -
-
-` - } + +
+ + I have four 2.5rem margins! + + And this are my CSS classes:{' '} + + dnb-space dnb-space__top--large dnb-space__top--x-small + dnb-space__right--large dnb-space__right--x-small + dnb-space__bottom--large dnb-space__bottom--x-small + dnb-space__left--large dnb-space__left--x-small + +
+
) @@ -109,33 +100,38 @@ export const SpaceVisualTestPatterns = () => ( data-visual-test="spacing-patterns" scope={{ MagicBox, CustomStyle }} hideCode - useRender > - { - /* jsx */ ` -const TestCase = (props) => { - return {listOfBoxes.map((v) => ( - - - - ))} -} -const listOfBoxes = [] -for (let i = 0, c = 0, l = 20; i <= l; i++) { - listOfBoxes.push(String(c)) - c += 0.5 -} -render( -
-

With dnb-core-style

- - -

Without

- -
-) -` - } + {() => { + const TestCase = (props) => { + return ( + + {listOfBoxes.map((v) => ( + + + + ))} + + ) + } + const listOfBoxes = [] + for (let i = 0, c = 0, l = 20; i <= l; i++) { + listOfBoxes.push(String(c)) + c += 0.5 + } + return ( +
+

+ With dnb-core-style +

+ + +

+ Without +

+ +
+ ) + }} ) @@ -144,49 +140,75 @@ render( * This test case exists because of the reset.css margin=0 for buttons */ export const SpaceVisualTestElements = () => - !(typeof window !== 'undefined' && window.IS_TEST) ? null : ( + !globalThis.IS_TEST ? null : ( - { - /* jsx */ ` -const listOfBoxes = [] -for (let i = 0, c = 0, l = 10; i <= l; i++) { - listOfBoxes.push(String(c)) - c += 1 -} -const TestCase = (props) => { - return - {listOfBoxes.map((v) => ( -