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: Updates #1911

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions apps/docs/app/component/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import { toast } from 'sonner'

import * as ICONS from '@sebgroup/green-react/src/lib/icon/icons'

// Dynamic component props
type DynamicComponentProps = {
hero?: boolean // Define the hero prop
}

export default function ComponentLayout({
children,
params,
Expand Down Expand Up @@ -95,7 +100,7 @@ export default function ComponentLayout({
]

const getDynamicComponent = (c: string) =>
dynamic(
dynamic<DynamicComponentProps>(
() =>
import(`../../../design/example/${c}`).catch(() => {
const ExampleComponent = () => <div>Example</div>
Expand Down Expand Up @@ -274,7 +279,7 @@ export default function ComponentLayout({
justify-content="center"
height="360px"
>
<Preview />
<Preview hero={true} />
</GdsFlex>
</GdsCard>
</GdsFlex>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/component/radiobutton/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The benefit of using radio buttons over select is that users may easily scan the
- **Contained:** used only in combination with other contained form components.
- **Contained extended:** The contained version but including Label support text.

<Grid columns={3} gap="s">
<Grid columns="3" gap="s">
<Figma node="3024-9506" caption="Default" />
<Figma node="3024-9508" caption="Contained" />
<Figma node="3024-9510" caption="Contained extended" />
Expand Down
20 changes: 15 additions & 5 deletions apps/docs/design/example/input.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
'use client'

import { GdsInput } from '$/import/components'
import { GdsFlex, GdsInput } from '$/import/components'
import { IconCreditCard } from '$/import/icons'

const Input = () => (
<GdsInput label="Input" value=" " clearable>
<IconCreditCard slot="lead" />
</GdsInput>
const Input = ({ hero }: { hero?: boolean }) => (
<>
{hero ? (
<GdsFlex>
<GdsInput label="Input" value=" " clearable>
<IconCreditCard slot="lead" />
</GdsInput>
</GdsFlex>
) : (
<GdsInput label="Input" value=" " clearable>
<IconCreditCard slot="lead" />
</GdsInput>
)}
</>
)

export default Input
Loading