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

chore: removes unneeded scope props in ComponentBox #3909

Merged
merged 1 commit into from
Sep 6, 2024
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 @@ -89,7 +89,7 @@ export const AriaLivePlayground = () => (
)

export const AriaLiveAdditions = () => (
<ComponentBox hideCode scope={{ FieldBlock }}>
<ComponentBox hideCode>
{() => {
const defaultData = {
enabled: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Path = () => {

export const IteratePath = () => {
return (
<ComponentBox scope={{ Value, DataContext }}>
<ComponentBox scope={{ DataContext }}>
<Form.Handler
data={{
list: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const AsyncSubmit = () => {

export const AsyncSubmitComplete = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Form.Handler
data={{ myField: 'Some value' }}
onSubmit={async (data) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const WithTable = () => {

export const ObjectItems = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Iterate.Array
value={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export { ViewAndEditContainer } from '../Array/Examples'

export const InitiallyOpen = () => {
return (
<ComponentBox scope={{ Iterate }}>
<ComponentBox>
{() => {
const MyEditItemForm = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@ import { Value } from '@dnb/eufemia/src/extensions/forms'

export const Empty = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.BankAccountNumber showEmpty />
</ComponentBox>
)
}

export const Placeholder = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.BankAccountNumber placeholder="The value was not filled in" />
</ComponentBox>
)
}

export const WithValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.BankAccountNumber value="20001234567" />
</ComponentBox>
)
}

export const Label = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.BankAccountNumber label="Label text" showEmpty />
</ComponentBox>
)
}

export const LabelAndValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.BankAccountNumber label="Label text" value="20001234567" />
</ComponentBox>
)
}

export const Inline = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<P>
This is before the component
<Value.BankAccountNumber value="20001234567" inline />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,55 @@ import { Value } from '@dnb/eufemia/src/extensions/forms'

export const Empty = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Boolean showEmpty />
</ComponentBox>
)
}

export const Placeholder = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Boolean placeholder="The value was not filled in" />
</ComponentBox>
)
}

export const ValueTrue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Boolean value={true} />
</ComponentBox>
)
}

export const ValueFalse = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Boolean value={false} />
</ComponentBox>
)
}

export const Label = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Boolean label="Label text" showEmpty />
</ComponentBox>
)
}

export const LabelAndValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Boolean label="Label text" value={false} />
</ComponentBox>
)
}

export const Inline = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<P>
<span style={{ color: 'red' }}>This is before the component</span>
<Value.Boolean value={true} inline />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@ import { Value } from '@dnb/eufemia/src/extensions/forms'

export const Empty = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Currency showEmpty />
</ComponentBox>
)
}

export const Placeholder = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Currency placeholder="The value was not filled in" />
</ComponentBox>
)
}

export const WithValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Currency value={150} suffix=" kr" />
</ComponentBox>
)
}

export const Label = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Currency label="Label text" showEmpty />
</ComponentBox>
)
}

export const LabelAndValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Currency label="Label text" value={60000000} />
</ComponentBox>
)
}

export const Inline = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<P>
This is before the component
<Value.Currency value={25000} inline />
Expand All @@ -56,7 +56,7 @@ export const Inline = () => {

export const InlineAndLabel = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<P>
This is before the component
<Value.Currency label="Label text" value={25000} inline />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,63 @@ import { Value } from '@dnb/eufemia/src/extensions/forms'

export const Empty = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Date showEmpty />
</ComponentBox>
)
}

export const Placeholder = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Date placeholder="The value was not filled in" />
</ComponentBox>
)
}

export const WithValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Date value="2023-01-16" />
</ComponentBox>
)
}

export const VariantShort = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Date value="2023-01-16" variant="short" />
</ComponentBox>
)
}

export const VariantNumeric = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Date value="2023-01-16" variant="numeric" />
</ComponentBox>
)
}

export const Label = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Date label="Label text" showEmpty />
</ComponentBox>
)
}

export const LabelAndValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Date label="Label text" value="2023-01-16" />
</ComponentBox>
)
}

export const Inline = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<P>
This is before the component
<Value.Date value="2023-01-16" inline />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ import { Value } from '@dnb/eufemia/src/extensions/forms'

export const Empty = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Email showEmpty />
</ComponentBox>
)
}

export const Placeholder = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Email placeholder="The value was not filled in" />
</ComponentBox>
)
}

export const WithValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Email value="firstname.lastname@domain.com" />
</ComponentBox>
)
}

export const Label = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Email label="Label text" showEmpty />
</ComponentBox>
)
}

export const LabelAndValue = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<Value.Email
label="Label text"
value="firstname.lastname@domain.com"
Expand All @@ -47,7 +47,7 @@ export const LabelAndValue = () => {

export const Inline = () => {
return (
<ComponentBox scope={{ Value }}>
<ComponentBox>
<P>
This is before the component
<Value.Email value="firstname.lastname@domain.com" inline />
Expand Down
Loading
Loading