-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(Portal): add accordion to side menu (#3794)
## Accordion * Can make a menu item into an accordion with the doc option `accordion: true` (default is `false`) * Accordions automatically open and close depending on which page you navigate to. * A "+/-" button indicates the accordions and allows for manual opening and closing. * Fallback auto-scroll _after_ expanding if the item is no longer in view. Because the default auto-scroll can't handle multiple accordions opening and closing at once. ## Menu ordering * Added ability to use negative `order` to add to the bottom (`-1` is the the first of them, followed by `-2` etc.). * docs without order will be placed in the middle. * fix: docs with `order` number now at the top instead of the bottom (except negative order) * fix: docs with same title and level no longer ignored * fix: docs with dot `.` in the file name no longer ignored ## New doc structure * "Releases and versions" can now be expanded to see each release page * "Pagination" and "Fragments" children now hidden behind accordion * "Form", "Wizard", "Iterate", "Value", and "Create your own component" can now be expanded to see sub-components * Changed "All feature fields" to accordion "More feature fields..." ## Other * "Getting started" table of contents filled out to include all headings * "Releases and versions" now uses `<ListSummaryFromEdges>` component * `<ListSummaryFromEdges>` * component now shows description in `returnListItems` mode * fix: `<ListSummaryFromEdges>` made an `<ul>`for each `<li>` in `returnListItems` mode. Now there is only one `<ul>` for the entire list. * Side menu is now a hierarchy of nested `<ul>` instead of one flat list. ## Not-implemented ideas for the future * Auto-scroll * instead of scrolling the item to the top it should be smart enough to include context. Scroll to the parent item, or until the item is centered if the list is too long. * Should animate the item when finished scrolling (a blink effect maybe?), so the user can easily see where they are * It should completely control scrolling by stopping all other scrolling at the start of expansion so we don't get the occasional double scroll. * The accordion button interferes with the sbanken styling, this should be improved * The "Usage" sub-menu should probably also implement some accordions * "Base fields" and "Feature fields" could also be accordions, then showing all the children would take less space. today we hide a few, and that's not optimal.
- Loading branch information
Showing
121 changed files
with
594 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...s/dnb-design-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: 'dnb-ui-lib' | ||
developers: 'Overview of all major dnb-ui-lib releases and changes, including migration guides.' | ||
order: 2 | ||
--- | ||
|
||
import ListUiLibVersions from './dnb-ui-lib/ListUiLibVersions' | ||
|
||
# dnb-ui-lib releases | ||
|
||
<ListUiLibVersions size="small" returnListItems /> |
39 changes: 39 additions & 0 deletions
39
...sign-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/ListUiLibVersions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useStaticQuery, graphql } from 'gatsby' | ||
import ListSummaryFromEdges from '../../../../../shared/parts/ListSummaryFromEdges' | ||
|
||
export default function ListUiLibVersions(props) { | ||
const { | ||
allMdx: { edges }, | ||
} = useStaticQuery(graphql` | ||
{ | ||
allMdx( | ||
filter: { | ||
frontmatter: { title: { ne: null }, draft: { ne: true } } | ||
internal: { | ||
contentFilePath: { | ||
glob: "**/uilib/about-the-lib/releases/dnb-ui-lib/**/*" | ||
} | ||
} | ||
} | ||
sort: [ | ||
{ frontmatter: { order: ASC } } | ||
{ frontmatter: { title: DESC } } | ||
] | ||
) { | ||
edges { | ||
node { | ||
fields { | ||
slug | ||
} | ||
frontmatter { | ||
title | ||
description | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`) | ||
|
||
return <ListSummaryFromEdges edges={edges} {...props} /> | ||
} |
3 changes: 3 additions & 0 deletions
3
...sign-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v4-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...n-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v4.10-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...n-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v4.18-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...sign-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v5-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...gn-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v5.8-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...sign-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v6-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...sign-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v7-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...gn-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v7.2-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...sign-system-portal/src/docs/uilib/about-the-lib/releases/dnb-ui-lib/v8-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ages/dnb-design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: '@dnb/eufemia' | ||
developers: 'Overview of all major Eufemia releases and changes, including migration guides.' | ||
order: 1 | ||
--- | ||
|
||
import ListEufemiaVersions from './eufemia/ListEufemiaVersions' | ||
|
||
# @dnb/eufemia releases | ||
|
||
<ListEufemiaVersions size="small" returnListItems /> |
39 changes: 39 additions & 0 deletions
39
...esign-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/ListEufemiaVersions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useStaticQuery, graphql } from 'gatsby' | ||
import ListSummaryFromEdges from '../../../../../shared/parts/ListSummaryFromEdges' | ||
|
||
export default function ListEufemiaVersions(props) { | ||
const { | ||
allMdx: { edges }, | ||
} = useStaticQuery(graphql` | ||
{ | ||
allMdx( | ||
filter: { | ||
frontmatter: { title: { ne: null }, draft: { ne: true } } | ||
internal: { | ||
contentFilePath: { | ||
glob: "**/uilib/about-the-lib/releases/eufemia/**/*" | ||
} | ||
} | ||
} | ||
sort: [ | ||
{ frontmatter: { order: ASC } } | ||
{ frontmatter: { title: DESC } } | ||
] | ||
) { | ||
edges { | ||
node { | ||
fields { | ||
slug | ||
} | ||
frontmatter { | ||
title | ||
description | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`) | ||
|
||
return <ListSummaryFromEdges edges={edges} {...props} /> | ||
} |
6 changes: 6 additions & 0 deletions
6
...design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v10-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
--- | ||
title: 'v10' | ||
order: -10 | ||
description: 'May, 31. 2023' | ||
--- | ||
|
||
import { Accordion } from '@dnb/eufemia/src' | ||
|
||
# v10 | ||
|
3 changes: 3 additions & 0 deletions
3
...design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v11-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
--- | ||
title: 'v11' | ||
description: 'TBA' | ||
order: -11 | ||
draft: true | ||
--- | ||
|
||
|
3 changes: 3 additions & 0 deletions
3
...design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v12-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
--- | ||
title: 'v12' | ||
description: 'TBA' | ||
order: -12 | ||
draft: true | ||
--- | ||
|
||
|
6 changes: 6 additions & 0 deletions
6
...-design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v9-info.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
--- | ||
title: 'v9' | ||
order: -9 | ||
description: 'March, 3. 2021' | ||
--- | ||
|
||
# v9 | ||
|
||
- [Migration](#migration) | ||
|
3 changes: 2 additions & 1 deletion
3
packages/dnb-design-system-portal/src/docs/uilib/components/fragments.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...es/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Appearance.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...ges/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/ButtonRow.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...es/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/FieldProps.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Handler.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...s/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/MainHeading.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Section.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...es/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/SubHeading.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
.../dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/SubmitButton.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...b-design-system-portal/src/docs/uilib/extensions/forms/Form/SubmitIndicator.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...es/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Visibility.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/getData.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/setData.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.