Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(Space): refactor jsx properties to tsx #2216

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import PropTypes from 'prop-types'
import ComponentBox from '../../../../shared/tags/ComponentBox'
import styled from '@emotion/styled'
import { Space, Input, FormRow, Button, P, Code } from '@dnb/eufemia/src'
import { Provider } from '@dnb/eufemia/src/shared'

export const SpaceExamplesMethod1 = () => (
<TestStyles>
Expand Down Expand Up @@ -483,3 +484,12 @@ export const SpaceExamplesFourDirections = () => (
<Button space="large x-small medium" />
</ComponentBox>
)

export const SpaceExampleProvider = () => (
<ComponentBox scope={{ Provider }} hidePreview>
<Provider space={{ no_collapse: true }}>
<Space>I do not collapse</Space>
<Space>I do not collapse</Space>
</Provider>
</ComponentBox>
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
showTabs: true
---

import { SpaceExampleProvider } from 'Docs/uilib/components/space/Examples'

## Global Properties

These properties are available in many other components and elements.
Expand Down Expand Up @@ -31,13 +33,4 @@ Use either `0` or `false` (as a number/boolean os string) to set a `margin` of 0

Also, Provider is supporting the `collapse` property.

```jsx
import Provider from '@dnb/eufemia/shared/Provider'

render(
<Provider space={{ no_collapse: true }}>
<Space>I do not collapse</Space>
<Space>I do not collapse</Space>
</Provider>
)
```
<SpaceExampleProvider />