From 68591ea9669e4a9a5929a1f65dfc0beb67c1cf5a Mon Sep 17 00:00:00 2001 From: -l Date: Wed, 6 Nov 2024 12:48:50 +0100 Subject: [PATCH 1/2] chore: adds link to properties tab when linked to from properties docs --- .../src/docs/uilib/layout/flex/stack/properties.mdx | 12 ++++++------ packages/dnb-eufemia/src/components/card/CardDocs.ts | 4 ++-- .../Form/Section/EditContainer/EditContainerDocs.ts | 2 +- .../Form/Section/ViewContainer/ViewContainerDocs.ts | 2 +- .../src/extensions/forms/Iterate/Array/ArrayDocs.ts | 2 +- .../forms/Iterate/EditContainer/EditContainerDocs.ts | 2 +- .../forms/Iterate/ViewContainer/ViewContainerDocs.ts | 2 +- .../src/extensions/forms/Wizard/Step/StepDocs.ts | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx b/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx index 7032c52fbbe..80b1a9f7410 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx +++ b/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx @@ -4,9 +4,9 @@ showTabs: true ## Properties -| Property | Type | Description | -| ---------------------------------------------- | -------- | --------------------------------------------------------------------- | -| `direction` | `string` | _(optional)_ Defaults to `vertical`. | -| `align` | `string` | _(optional)_ Defaults to `stretch`. | -| [Flex.Container](/uilib/layout/flex/container) | Various | _(optional)_ Flex.Container properties. | -| [Space](/uilib/layout/space/properties) | Various | _(optional)_ Spacing properties like `top` or `bottom` are supported. | +| Property | Type | Description | +| --------------------------------------------------------- | -------- | --------------------------------------------------------------------- | +| `direction` | `string` | _(optional)_ Defaults to `vertical`. | +| `align` | `string` | _(optional)_ Defaults to `stretch`. | +| [Flex.Container](/uilib/layout/flex/container/properties) | Various | _(optional)_ Flex.Container properties. | +| [Space](/uilib/layout/space/properties) | Various | _(optional)_ Spacing properties like `top` or `bottom` are supported. | diff --git a/packages/dnb-eufemia/src/components/card/CardDocs.ts b/packages/dnb-eufemia/src/components/card/CardDocs.ts index 34f68863a65..32e85eba4dd 100644 --- a/packages/dnb-eufemia/src/components/card/CardDocs.ts +++ b/packages/dnb-eufemia/src/components/card/CardDocs.ts @@ -41,12 +41,12 @@ export const CardProperties: PropertiesTableProps = { type: 'React.Node', status: 'required', }, - '[Flex.Container](/uilib/layout/flex/container)': { + '[Flex.Container](/uilib/layout/flex/container/properties)': { doc: 'Flex.Container properties.', type: 'Various', status: 'optional', }, - '[Flex.Item](/uilib/layout/flex/item)': { + '[Flex.Item](/uilib/layout/flex/item/properties)': { doc: 'Flex.Item properties.', type: 'Various', status: 'optional', diff --git a/packages/dnb-eufemia/src/extensions/forms/Form/Section/EditContainer/EditContainerDocs.ts b/packages/dnb-eufemia/src/extensions/forms/Form/Section/EditContainer/EditContainerDocs.ts index 34124d78e21..bb5c00b69d6 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Form/Section/EditContainer/EditContainerDocs.ts +++ b/packages/dnb-eufemia/src/extensions/forms/Form/Section/EditContainer/EditContainerDocs.ts @@ -12,7 +12,7 @@ export const EditContainerProperties: PropertiesTableProps = { status: 'optional', }, - '[FlexVertical](/uilib/layout/flex/container/)': { + '[FlexVertical](/uilib/layout/flex/container/properties)': { doc: 'All Flex.Vertical properties.', type: 'Various', status: 'optional', diff --git a/packages/dnb-eufemia/src/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.ts b/packages/dnb-eufemia/src/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.ts index 101f1881824..94d7f6b53ba 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.ts +++ b/packages/dnb-eufemia/src/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.ts @@ -11,7 +11,7 @@ export const ViewContainerProperties: PropertiesTableProps = { type: 'string', status: 'optional', }, - '[FlexVertical](/uilib/layout/flex/container/)': { + '[FlexVertical](/uilib/layout/flex/container/properties)': { doc: 'All Flex.Vertical properties.', type: 'Various', status: 'optional', diff --git a/packages/dnb-eufemia/src/extensions/forms/Iterate/Array/ArrayDocs.ts b/packages/dnb-eufemia/src/extensions/forms/Iterate/Array/ArrayDocs.ts index ac228f8aac2..e5912f3d3f7 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Iterate/Array/ArrayDocs.ts +++ b/packages/dnb-eufemia/src/extensions/forms/Iterate/Array/ArrayDocs.ts @@ -65,7 +65,7 @@ export const ArrayProperties: PropertiesTableProps = { type: ['React.ReactNode', 'function'], status: 'optional', }, - '[Flex.Stack](/uilib/layout/flex/stack/)': { + '[Flex.Stack](/uilib/layout/flex/stack/properties)': { doc: 'All Flex.Stack properties.', type: 'Various', status: 'optional', diff --git a/packages/dnb-eufemia/src/extensions/forms/Iterate/EditContainer/EditContainerDocs.ts b/packages/dnb-eufemia/src/extensions/forms/Iterate/EditContainer/EditContainerDocs.ts index 167d73bb836..5e7981dc3f1 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Iterate/EditContainer/EditContainerDocs.ts +++ b/packages/dnb-eufemia/src/extensions/forms/Iterate/EditContainer/EditContainerDocs.ts @@ -31,7 +31,7 @@ export const EditContainerProperties: PropertiesTableProps = { type: 'boolean', status: 'optional', }, - '[FlexVertical](/uilib/layout/flex/container/)': { + '[FlexVertical](/uilib/layout/flex/container/properties)': { doc: 'All Flex.Vertical properties.', type: 'Various', status: 'optional', diff --git a/packages/dnb-eufemia/src/extensions/forms/Iterate/ViewContainer/ViewContainerDocs.ts b/packages/dnb-eufemia/src/extensions/forms/Iterate/ViewContainer/ViewContainerDocs.ts index 5c2a7fb2dd0..dc92473f35b 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Iterate/ViewContainer/ViewContainerDocs.ts +++ b/packages/dnb-eufemia/src/extensions/forms/Iterate/ViewContainer/ViewContainerDocs.ts @@ -21,7 +21,7 @@ export const ViewContainerProperties: PropertiesTableProps = { type: 'string', status: 'optional', }, - '[FlexVertical](/uilib/layout/flex/container/)': { + '[FlexVertical](/uilib/layout/flex/container/properties)': { doc: 'All Flex.Vertical properties.', type: 'Various', status: 'optional', diff --git a/packages/dnb-eufemia/src/extensions/forms/Wizard/Step/StepDocs.ts b/packages/dnb-eufemia/src/extensions/forms/Wizard/Step/StepDocs.ts index 91108ecbf28..6973c68c76e 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Wizard/Step/StepDocs.ts +++ b/packages/dnb-eufemia/src/extensions/forms/Wizard/Step/StepDocs.ts @@ -26,7 +26,7 @@ export const StepProperties: PropertiesTableProps = { type: 'React.Node', status: 'required', }, - '[Flex.Container](/uilib/layout/flex/container)': { + '[Flex.Container](/uilib/layout/flex/container/properties)': { doc: 'Flex.Container properties.', type: 'Various', status: 'optional', From 331c2b1baadaf02b253d41f08dbd4afa9db82492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B8egh?= Date: Wed, 6 Nov 2024 13:55:34 +0100 Subject: [PATCH 2/2] Create `StackDocs` file --- .../uilib/layout/flex/stack/properties.mdx | 10 ++++---- .../src/components/flex/StackDocs.tsx | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 packages/dnb-eufemia/src/components/flex/StackDocs.tsx diff --git a/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx b/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx index 80b1a9f7410..31b4f75bf6a 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx +++ b/packages/dnb-design-system-portal/src/docs/uilib/layout/flex/stack/properties.mdx @@ -2,11 +2,9 @@ showTabs: true --- +import PropertiesTable from 'dnb-design-system-portal/src/shared/parts/PropertiesTable' +import { FlexStackProperties } from '@dnb/eufemia/src/components/flex/StackDocs' + ## Properties -| Property | Type | Description | -| --------------------------------------------------------- | -------- | --------------------------------------------------------------------- | -| `direction` | `string` | _(optional)_ Defaults to `vertical`. | -| `align` | `string` | _(optional)_ Defaults to `stretch`. | -| [Flex.Container](/uilib/layout/flex/container/properties) | Various | _(optional)_ Flex.Container properties. | -| [Space](/uilib/layout/space/properties) | Various | _(optional)_ Spacing properties like `top` or `bottom` are supported. | + diff --git a/packages/dnb-eufemia/src/components/flex/StackDocs.tsx b/packages/dnb-eufemia/src/components/flex/StackDocs.tsx new file mode 100644 index 00000000000..5660db14748 --- /dev/null +++ b/packages/dnb-eufemia/src/components/flex/StackDocs.tsx @@ -0,0 +1,24 @@ +import { PropertiesTableProps } from '../../shared/types' + +export const FlexStackProperties: PropertiesTableProps = { + direction: { + doc: 'Defaults to `vertical`.', + type: 'string', + status: 'optional', + }, + align: { + doc: 'Defaults to `stretch`.', + type: 'string', + status: 'optional', + }, + '[Flex.Container](/uilib/layout/flex/container/properties)': { + doc: 'Flex.Container properties.', + type: 'Various', + status: 'optional', + }, + '[Space](/uilib/layout/space/properties)': { + doc: 'Spacing properties like `top` or `bottom` are supported.', + type: ['string', 'object'], + status: 'optional', + }, +}