@patternfly/patternfly-doc-core 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.astro/collections/examples.schema.json +56 -0
- package/.astro/collections/textContent.schema.json +16 -0
- package/.astro/content-modules.mjs +4 -1
- package/.astro/content.d.ts +20 -1
- package/astro.config.mjs +2 -2
- package/declarations.d.ts +2 -0
- package/dist/client/_astro/Button.IBWho7ny.js +9 -0
- package/dist/client/_astro/CSSTable.DHtMmTtQ.js +1185 -0
- package/dist/client/_astro/LiveExample.B7IM_dLQ.css +1 -0
- package/dist/client/_astro/LiveExample.CwKQ5TSc.js +33 -0
- package/dist/client/_astro/Navigation.BSSYIa2f.js +1 -0
- package/dist/client/_astro/PageContext.ipir86Hm.js +1 -0
- package/dist/client/_astro/PageSidebarBody.tzSXGYXP.js +1 -0
- package/dist/client/_astro/PageToggle.C6_rp-Bm.js +1 -0
- package/dist/client/_astro/PageToggleButton.CagcouJB.js +1 -0
- package/dist/client/_astro/SearchInput.BjY-zTwj.js +1 -0
- package/dist/client/_astro/Toolbar.D4TQG77s.js +1 -0
- package/dist/client/_astro/ToolbarContent.DzYW_pmy.js +1 -0
- package/dist/client/_astro/_page_.BWicMEzd.css +1 -0
- package/dist/client/_astro/_page_.Chv_bGyU.css +1 -0
- package/dist/client/_astro/_page_.CtheD08_.css +1 -0
- package/dist/client/_astro/_page_.DxJDkZPc.css +1 -0
- package/dist/client/_astro/client.zs76E0tG.js +1 -0
- package/dist/client/_astro/divider.DTvtnAAt.js +1 -0
- package/dist/client/_astro/help-icon.CDKTE3GW.js +8 -0
- package/dist/client/_astro/index.BQFV5hT1.js +24 -0
- package/dist/client/_astro/index.eCxJ45ll.js +9 -0
- package/dist/client/_astro/page.BTC3Kf3x.js +1 -0
- package/dist/client/components/accordion/index.html +110 -0
- package/dist/client/design-foundations/typography/index.html +35 -8
- package/dist/client/design-foundations/usage-and-behavior/index.html +35 -8
- package/dist/client/get-started/contribute/index.html +35 -8
- package/dist/client/index.html +4 -3
- package/dist/server/_@astrojs-ssr-adapter.mjs +1 -1
- package/dist/server/chunks/Button_DVSwQ8oX.mjs +639 -0
- package/dist/server/chunks/CSSTable_CG80uW98.mjs +740 -0
- package/dist/server/chunks/CSSTable_Dj2CroFz.mjs +4 -0
- package/dist/server/chunks/{PropsTables_MQNZVYdD.mjs → PropsTables_DUo7F9VR.mjs} +169 -246
- package/dist/server/chunks/Stack_Xm3fJVbK.mjs +22 -0
- package/dist/server/chunks/{_@astrojs-ssr-adapter_8jk9s5dg.mjs → _@astrojs-ssr-adapter_CbICuCdt.mjs} +2 -2
- package/dist/server/chunks/{_astro_assets_CmxVRFAY.mjs → _astro_assets_DaYumpRZ.mjs} +2 -2
- package/dist/server/chunks/_astro_data-layer-content_1EAcQtZj.mjs +1 -0
- package/dist/server/chunks/{angle-down-icon_BNJvzYv-.mjs → angle-down-icon_DtGGiMR5.mjs} +150 -832
- package/dist/server/chunks/astro/{server_zRMEhmuT.mjs → server_Cl9jPh4p.mjs} +179 -89
- package/dist/server/chunks/{astro-designed-error-pages_DRBnGamN.mjs → astro-designed-error-pages_BFveJFnQ.mjs} +1 -1
- package/dist/server/chunks/content-modules_BzUEG69n.mjs +1 -0
- package/dist/server/chunks/{sharp_BAxaBZQw.mjs → sharp_CbOL3WDk.mjs} +2 -2
- package/dist/server/entry.mjs +4 -3
- package/dist/server/{manifest_7YAgSoyv.mjs → manifest_Dpwo8Jjv.mjs} +3 -3
- package/dist/server/pages/_image.astro.mjs +1 -1
- package/dist/server/renderers.mjs +63 -14
- package/jest.config.ts +1 -1
- package/package.json +5 -2
- package/src/components/AutoLinkHeader.tsx +56 -0
- package/src/components/CSSSearch.tsx +33 -0
- package/src/components/CSSTable.astro +33 -0
- package/src/components/CSSTable.tsx +268 -0
- package/src/components/Content.tsx +61 -0
- package/src/components/ExampleToolbar.tsx +296 -0
- package/src/components/LiveExample.astro +7 -0
- package/src/components/LiveExample.tsx +42 -0
- package/src/content.config.ts +10 -3
- package/src/content.ts +2 -1
- package/src/layouts/Main.astro +12 -8
- package/src/pages/[section]/[...page].astro +16 -6
- package/src/pages/[section]/[page]/[...tab].astro +107 -40
- package/src/pages/index.astro +0 -1
- package/src/styles/global.scss +47 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/slugger.ts +14 -0
- package/textContent/contribute.md +19 -13
- package/textContent/examples/Accordion/Accordion.mdx +45 -0
- package/textContent/examples/Accordion/AccordionBordered.tsx +141 -0
- package/textContent/examples/Accordion/AccordionDefinitionList.tsx +102 -0
- package/textContent/examples/Accordion/AccordionFixedWithMultipleExpandBehavior.tsx +128 -0
- package/textContent/examples/Accordion/AccordionSingleExpandBehavior.tsx +118 -0
- package/textContent/examples/Accordion/AccordionToggleIconAtStart.tsx +118 -0
- package/dist/client/_astro/Button.C3_jB5tC.js +0 -9
- package/dist/client/_astro/Navigation.CULUlMEB.js +0 -1
- package/dist/client/_astro/PageContext.C7BqCh9N.js +0 -1
- package/dist/client/_astro/PageToggle.DDEjruql.js +0 -1
- package/dist/client/_astro/Toolbar.TAdHxLSQ.js +0 -1
- package/dist/client/_astro/_page_.CXyz_BEo.css +0 -1
- package/dist/client/_astro/_page_.DVvr_Mfl.css +0 -1
- package/dist/client/_astro/_page_.SnUmZn2y.css +0 -1
- package/dist/client/_astro/client.CeeiqVaE.js +0 -1
- package/dist/client/_astro/divider.BSD-oFoh.js +0 -1
- package/dist/client/_astro/index.CTH3fVMn.js +0 -32
- package/dist/client/_astro/page.B65lVdBS.js +0 -1
- /package/dist/server/chunks/{_astro_data-layer-content_DDGBHvtb.mjs → Accordion_CGgMUho2.mjs} +0 -0
- /package/dist/server/chunks/{content-modules_Dz-S_Wwv.mjs → Accordion_DlM2LvlF.mjs} +0 -0
package/src/styles/global.scss
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
.circle {
|
|
2
|
+
height: 1em;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
aspect-ratio: 1 / 1;
|
|
5
|
+
border-radius: 50%;
|
|
6
|
+
border: var(--pf-t--global--border--width--regular) solid
|
|
7
|
+
var(--pf-t--global--background--color--inverse--default);
|
|
8
|
+
box-shadow: var(--pf-t--global--box-shadow--sm);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.rotate-90-deg {
|
|
12
|
+
transform: rotate(90deg);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ws-heading {
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ws-heading-anchor {
|
|
20
|
+
color: var(--pf-t--global--icon--color--regular);
|
|
21
|
+
transform: translate(calc(-100% - var(--pf-t--global--spacer--xs)), -50%);
|
|
22
|
+
opacity: 0;
|
|
23
|
+
position: absolute;
|
|
24
|
+
left: 0;
|
|
25
|
+
top: 50%;
|
|
26
|
+
--pf-v6-c-content--a--Color: var(--pf-t--global--icon--color--regular);
|
|
27
|
+
--pf-v6-c-button--m-plain--PaddingInlineEnd: 0;
|
|
28
|
+
--pf-v6-c-button--m-plain--PaddingInlineStart: 0;
|
|
29
|
+
--pf-v6-c-button--MinWidth: unset;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ws-heading-anchor.pf-v6-c-button:hover,
|
|
33
|
+
.ws-heading-anchor.pf-v6-c-button:focus {
|
|
34
|
+
--pf-v6-c-button--hover--Color: var(--pf-t--global--icon--color--regular);
|
|
35
|
+
--pf-v6-c-button--BackgroundColor: transparent;
|
|
36
|
+
--pf-v6-c-content--a--hover--Color: var(--pf-t--global--icon--color--regular);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ws-heading-anchor-icon {
|
|
40
|
+
height: 0.75rem;
|
|
41
|
+
width: 0.75rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ws-heading:hover .ws-heading-anchor,
|
|
45
|
+
.ws-heading-anchor:focus {
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
// Should produce valid URLs and valid CSS ids
|
|
4
|
+
export const slugger = (children: React.ReactNode) => {
|
|
5
|
+
const value = React.Children.toArray(children)
|
|
6
|
+
.filter((child) => typeof child === 'string' || typeof child === 'number')
|
|
7
|
+
.join('')
|
|
8
|
+
return value
|
|
9
|
+
.toLowerCase()
|
|
10
|
+
.trim()
|
|
11
|
+
.replace(/index$/, '')
|
|
12
|
+
.replace(/\s/g, '-')
|
|
13
|
+
.replace(/[^A-Za-z0-9.\-~]/g, '')
|
|
14
|
+
}
|
|
@@ -3,12 +3,14 @@ id: Contribute
|
|
|
3
3
|
title: Contribute to PatternFly
|
|
4
4
|
section: get-started
|
|
5
5
|
propComponents: ['Button', 'BadgeCountObject']
|
|
6
|
+
cssPrefix: pf-v6-c-about-modal-box
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
## Community contributions
|
|
9
|
+
## Community contributions
|
|
9
10
|
|
|
10
|
-
Thank you for your interest in contributing to PatternFly! We depend on community contributions to help our design system grow and evolve. We encourage everyone, regardless of background, to get involved. Common contributions include (but aren't limited to):
|
|
11
|
-
|
|
11
|
+
Thank you for your interest in contributing to PatternFly! We depend on community contributions to help our design system grow and evolve. We encourage everyone, regardless of background, to get involved. Common contributions include (but aren't limited to):
|
|
12
|
+
|
|
13
|
+
- New feature ideas.
|
|
12
14
|
- Bug reports.
|
|
13
15
|
- Documentation updates.
|
|
14
16
|
|
|
@@ -20,29 +22,32 @@ If you have any ideas that don't fit into the projects outlined in this guide, p
|
|
|
20
22
|
|
|
21
23
|
If you have skills in visual and interaction design, you can contribute to PatternFly's design by taking an existing issue or proposing a new feature, enhancement, or icon. If you are interested in any of these projects, [reach out on the patternfly-design Slack channel.](http://join.slack.com/t/patternfly/shared_invite/zt-1npmqswgk-bF2R1E2rglV8jz5DNTezMQ)
|
|
22
24
|
|
|
23
|
-
### Existing design issues
|
|
25
|
+
### Existing design issues
|
|
24
26
|
|
|
25
27
|
The PatternFly design team is composed of visual and interaction designers who define the look and feel of the PatternFly library. The team follows an agile framework, planning their work in sprints, with a backlog that is tracked and managed via [this GitHub project board.](https://github.com/orgs/patternfly/projects/7/views/30) This board contains a list issues that are currently unassigned and waiting in the queue. If you see something here that you'd like to work on, leave a comment on the issue and a member of our team will reach out with next steps.
|
|
26
28
|
|
|
27
29
|
### New feature or enhancement
|
|
30
|
+
|
|
28
31
|
If you have an idea for a new design pattern, a new component type, or an existing feature improvement, we'd love to hear it. [Start by opening an issue in the patternfly-design repository.](https://github.com/patternfly/patternfly-design/issues) From there, a member of our team will reach out and work with you to plan and design a solution.
|
|
29
32
|
|
|
30
33
|
### New icons
|
|
34
|
+
|
|
31
35
|
We encourage designers to work with [the existing PatternFly icon set](/design-foundations/icons), which covers most common use cases. If your use case isn't covered, you can propose a new icon.
|
|
32
36
|
|
|
33
37
|
To contribute a new icon, [start by opening an issue in the patternfly-design repository](https://github.com/patternfly/patternfly-design/issues) that describes your idea and why it's needed. A member of our team will reach out to you to discuss next steps.
|
|
34
38
|
|
|
35
39
|
## Code
|
|
36
40
|
|
|
37
|
-
The primary PatternFly libraries include HTML/CSS (commonly called "core") and React. If you're looking to contribute to PatternFly's codebase, these libraries are a good place to start. You can help out by taking existing issues, or creating issues for bugs and other changes.
|
|
41
|
+
The primary PatternFly libraries include HTML/CSS (commonly called "core") and React. If you're looking to contribute to PatternFly's codebase, these libraries are a good place to start. You can help out by taking existing issues, or creating issues for bugs and other changes.
|
|
38
42
|
|
|
39
43
|
If you have any questions about these projects, you can reach out to us on our [patternfly-core](https://patternfly.slack.com/archives/C9Q224EFL) and [patternfly-react](https://patternfly.slack.com/archives/C4FM977N0) Slack channels.
|
|
40
44
|
|
|
41
|
-
### Existing development issues
|
|
45
|
+
### Existing development issues
|
|
42
46
|
|
|
43
|
-
To find work that has been approved, but not started, you can view open issues in our [patternfly](https://github.com/patternfly/patternfly/issues) (HTML/CSS) and [patternfly-react](https://github.com/patternfly/patternfly-react/issues) (React) repositories. If you find an issue that you'd like to work on, leave a comment and someone from our team will reach out to you with next steps.
|
|
47
|
+
To find work that has been approved, but not started, you can view open issues in our [patternfly](https://github.com/patternfly/patternfly/issues) (HTML/CSS) and [patternfly-react](https://github.com/patternfly/patternfly-react/issues) (React) repositories. If you find an issue that you'd like to work on, leave a comment and someone from our team will reach out to you with next steps.
|
|
44
48
|
|
|
45
49
|
Be sure to view our detailed contribution instructions for both of these repositories:
|
|
50
|
+
|
|
46
51
|
- [Core contribution guidelines](https://github.com/patternfly/patternfly#guidelines-for-css-development)
|
|
47
52
|
- [React contribution guidelines](https://github.com/patternfly/patternfly-react/blob/main/CONTRIBUTING.md#contribution-process)
|
|
48
53
|
|
|
@@ -50,13 +55,13 @@ Be sure to view our detailed contribution instructions for both of these reposit
|
|
|
50
55
|
|
|
51
56
|
If you believe that you've come across a PatternFly bug, alert our team, so that we can resolve the issue. To report a bug, follow these steps:
|
|
52
57
|
|
|
53
|
-
1. View the documentation for the feature, to confirm that the behavior is not functioning as intended.
|
|
58
|
+
1. View the documentation for the feature, to confirm that the behavior is not functioning as intended.
|
|
54
59
|
1. Search open issues in the [patternfly](https://github.com/patternfly/patternfly/issues) and [patternfly-react](https://github.com/patternfly/patternfly-react/issues) repositories to see if a related issue already exists.
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
- If the bug is present in only the React implementation of PatternFly, [create a bug issue in patternfly-react.](https://github.com/patternfly/patternfly-react/issues)
|
|
61
|
+
- If the bug can be seen on both the React and HTML/CSS side, [create a bug issue in patternfly](https://github.com/patternfly/patternfly/issues).
|
|
57
62
|
1. Be sure to mention which project the bug was noticed in and if there is a deadline that the fix is needed for.
|
|
58
63
|
|
|
59
|
-
## Documentation
|
|
64
|
+
## Documentation
|
|
60
65
|
|
|
61
66
|
Across our website, you can find PatternFly documentation that explains concepts, provides guidance, and outlines important resources for PatternFly users. Our documentation can always be improved, and we love to hear input from the people who use it.
|
|
62
67
|
|
|
@@ -64,9 +69,10 @@ If you'd like to contribute to documentation, you can refer to our [detailed con
|
|
|
64
69
|
|
|
65
70
|
### Existing documentation issues
|
|
66
71
|
|
|
67
|
-
Our website documentation is contained in the [patternfly-org repository](https://github.com/patternfly/patternfly-org). If you find an issue that you'd like to work on, leave a comment and someone from our team will reach out to you with next steps.
|
|
72
|
+
Our website documentation is contained in the [patternfly-org repository](https://github.com/patternfly/patternfly-org). If you find an issue that you'd like to work on, leave a comment and someone from our team will reach out to you with next steps.
|
|
68
73
|
|
|
69
74
|
### Design guidelines
|
|
75
|
+
|
|
70
76
|
Our design guidelines are found across our component, layout, chart, and pattern web pages. These guides clarify usage details to help designers follow best practices to create strong UI solutions.
|
|
71
77
|
|
|
72
|
-
If you'd like to contribute to our design guidelines, you can open an issue in [patternfly-org](https://github.com/patternfly/patternfly-org) to propose a new page or updates to an existing page. From there, our team will work with you to author and publish your new content.
|
|
78
|
+
If you'd like to contribute to our design guidelines, you can open an issue in [patternfly-org](https://github.com/patternfly/patternfly-org) to propose a new page or updates to an existing page. From there, our team will work with you to author and publish your new content.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Accordion
|
|
3
|
+
section: components
|
|
4
|
+
cssPrefix: pf-v6-c-accordion
|
|
5
|
+
propComponents:
|
|
6
|
+
[
|
|
7
|
+
'Accordion',
|
|
8
|
+
'AccordionItem',
|
|
9
|
+
'AccordionContent',
|
|
10
|
+
'AccordionToggle',
|
|
11
|
+
AccordionExpandableContentBody,
|
|
12
|
+
]
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
### Definition list
|
|
18
|
+
|
|
19
|
+
import AccordionDefinitionList from './AccordionDefinitionList.tsx?raw'
|
|
20
|
+
|
|
21
|
+
<LiveExample src={AccordionDefinitionList} />
|
|
22
|
+
|
|
23
|
+
### Single expand behavior
|
|
24
|
+
|
|
25
|
+
import AccordionSingleExpandBehavior from './AccordionSingleExpandBehavior.tsx?raw'
|
|
26
|
+
|
|
27
|
+
<LiveExample src={AccordionSingleExpandBehavior} />
|
|
28
|
+
|
|
29
|
+
### Fixed with multiple expand behavior
|
|
30
|
+
|
|
31
|
+
import AccordionFixedWithMultipleExpandBehavior from './AccordionFixedWithMultipleExpandBehavior.tsx?raw'
|
|
32
|
+
|
|
33
|
+
<LiveExample src={AccordionFixedWithMultipleExpandBehavior} />
|
|
34
|
+
|
|
35
|
+
### Bordered
|
|
36
|
+
|
|
37
|
+
import AccordionBordered from './AccordionBordered.tsx?raw'
|
|
38
|
+
|
|
39
|
+
<LiveExample src={AccordionBordered} />
|
|
40
|
+
|
|
41
|
+
### Toggle icon at start
|
|
42
|
+
|
|
43
|
+
import AccordionToggleIconAtStart from './AccordionToggleIconAtStart.tsx?raw'
|
|
44
|
+
|
|
45
|
+
<LiveExample src={AccordionToggleIconAtStart} />
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
Accordion,
|
|
4
|
+
AccordionItem,
|
|
5
|
+
AccordionContent,
|
|
6
|
+
AccordionToggle,
|
|
7
|
+
AccordionExpandableContentBody,
|
|
8
|
+
Button,
|
|
9
|
+
Checkbox,
|
|
10
|
+
} from '@patternfly/react-core'
|
|
11
|
+
import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon'
|
|
12
|
+
|
|
13
|
+
export const AccordionBordered: React.FunctionComponent = () => {
|
|
14
|
+
const [expanded, setExpanded] = useState('bordered-toggle4')
|
|
15
|
+
const [isDisplayLarge, setIsDisplayLarge] = useState(false)
|
|
16
|
+
|
|
17
|
+
const displaySize = isDisplayLarge ? 'lg' : 'default'
|
|
18
|
+
const onToggle = (id: string) => {
|
|
19
|
+
if (id === expanded) {
|
|
20
|
+
setExpanded('')
|
|
21
|
+
} else {
|
|
22
|
+
setExpanded(id)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<Accordion isBordered displaySize={displaySize}>
|
|
29
|
+
<AccordionItem isExpanded={expanded === 'bordered-toggle1'}>
|
|
30
|
+
<AccordionToggle
|
|
31
|
+
onClick={() => {
|
|
32
|
+
onToggle('bordered-toggle1')
|
|
33
|
+
}}
|
|
34
|
+
id="bordered-toggle1"
|
|
35
|
+
>
|
|
36
|
+
Item one
|
|
37
|
+
</AccordionToggle>
|
|
38
|
+
<AccordionContent id="bordered-expand1">
|
|
39
|
+
<p>
|
|
40
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
|
|
41
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
42
|
+
</p>
|
|
43
|
+
</AccordionContent>
|
|
44
|
+
</AccordionItem>
|
|
45
|
+
|
|
46
|
+
<AccordionItem isExpanded={expanded === 'bordered-toggle2'}>
|
|
47
|
+
<AccordionToggle
|
|
48
|
+
onClick={() => {
|
|
49
|
+
onToggle('bordered-toggle2')
|
|
50
|
+
}}
|
|
51
|
+
id="bordered-toggle2"
|
|
52
|
+
>
|
|
53
|
+
Item two
|
|
54
|
+
</AccordionToggle>
|
|
55
|
+
<AccordionContent id="bordered-expand2">
|
|
56
|
+
<p>
|
|
57
|
+
Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent
|
|
58
|
+
nec dictum lorem. Aliquam id diam ultrices, faucibus erat id,
|
|
59
|
+
maximus nunc.
|
|
60
|
+
</p>
|
|
61
|
+
</AccordionContent>
|
|
62
|
+
</AccordionItem>
|
|
63
|
+
|
|
64
|
+
<AccordionItem isExpanded={expanded === 'bordered-toggle3'}>
|
|
65
|
+
<AccordionToggle
|
|
66
|
+
onClick={() => {
|
|
67
|
+
onToggle('bordered-toggle3')
|
|
68
|
+
}}
|
|
69
|
+
id="bordered-toggle3"
|
|
70
|
+
>
|
|
71
|
+
Item three
|
|
72
|
+
</AccordionToggle>
|
|
73
|
+
<AccordionContent id="bordered-expand3">
|
|
74
|
+
<p>
|
|
75
|
+
Morbi vitae urna quis nunc convallis hendrerit. Aliquam congue
|
|
76
|
+
orci quis ultricies tempus.
|
|
77
|
+
</p>
|
|
78
|
+
</AccordionContent>
|
|
79
|
+
</AccordionItem>
|
|
80
|
+
|
|
81
|
+
<AccordionItem isExpanded={expanded === 'bordered-toggle4'}>
|
|
82
|
+
<AccordionToggle
|
|
83
|
+
onClick={() => {
|
|
84
|
+
onToggle('bordered-toggle4')
|
|
85
|
+
}}
|
|
86
|
+
id="bordered-toggle4"
|
|
87
|
+
>
|
|
88
|
+
Item four
|
|
89
|
+
</AccordionToggle>
|
|
90
|
+
<AccordionContent id="bordered-expand4" isCustomContent>
|
|
91
|
+
<AccordionExpandableContentBody>
|
|
92
|
+
Donec vel posuere orci. Phasellus quis tortor a ex hendrerit
|
|
93
|
+
efficitur. Aliquam lacinia ligula pharetra, sagittis ex ut,
|
|
94
|
+
pellentesque diam. Vestibulum ante ipsum primis in faucibus orci
|
|
95
|
+
luctus et ultrices posuere cubilia Curae; Vestibulum ultricies
|
|
96
|
+
nulla nibh. Etiam vel dui fermentum ligula ullamcorper eleifend
|
|
97
|
+
non quis tortor. Morbi tempus ornare tempus. Orci varius natoque
|
|
98
|
+
penatibus et magnis dis parturient montes, nascetur ridiculus mus.
|
|
99
|
+
Mauris et velit neque. Donec ultricies condimentum mauris,
|
|
100
|
+
pellentesque imperdiet libero convallis convallis. Aliquam erat
|
|
101
|
+
volutpat. Donec rutrum semper tempus. Proin dictum imperdiet nibh,
|
|
102
|
+
quis dapibus nulla. Integer sed tincidunt lectus, sit amet auctor
|
|
103
|
+
eros.
|
|
104
|
+
</AccordionExpandableContentBody>
|
|
105
|
+
<AccordionExpandableContentBody>
|
|
106
|
+
<Button variant="link" size="lg" isInline>
|
|
107
|
+
Call to action <ArrowRightIcon />
|
|
108
|
+
</Button>
|
|
109
|
+
</AccordionExpandableContentBody>
|
|
110
|
+
</AccordionContent>
|
|
111
|
+
</AccordionItem>
|
|
112
|
+
<AccordionItem isExpanded={expanded === 'bordered-toggle5'}>
|
|
113
|
+
<AccordionToggle
|
|
114
|
+
onClick={() => {
|
|
115
|
+
onToggle('bordered-toggle5')
|
|
116
|
+
}}
|
|
117
|
+
id="bordered-toggle5"
|
|
118
|
+
>
|
|
119
|
+
Item five
|
|
120
|
+
</AccordionToggle>
|
|
121
|
+
<AccordionContent id="bordered-expand5">
|
|
122
|
+
<p>
|
|
123
|
+
Vivamus finibus dictum ex id ultrices. Mauris dictum neque a
|
|
124
|
+
iaculis blandit.
|
|
125
|
+
</p>
|
|
126
|
+
</AccordionContent>
|
|
127
|
+
</AccordionItem>
|
|
128
|
+
</Accordion>
|
|
129
|
+
<div style={{ marginTop: '30px' }}>
|
|
130
|
+
<Checkbox
|
|
131
|
+
label="Display size large"
|
|
132
|
+
isChecked={isDisplayLarge}
|
|
133
|
+
onChange={(_event, checked) => setIsDisplayLarge(checked)}
|
|
134
|
+
aria-label="show display large variation checkbox"
|
|
135
|
+
id="toggle-display-lg"
|
|
136
|
+
name="toggle-display-lg"
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
</>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Accordion, AccordionItem, AccordionContent, AccordionToggle } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AccordionDefinitionList: React.FunctionComponent = () => {
|
|
5
|
+
const [expanded, setExpanded] = useState('def-list-toggle2');
|
|
6
|
+
|
|
7
|
+
const onToggle = (id: string) => {
|
|
8
|
+
if (id === expanded) {
|
|
9
|
+
setExpanded('');
|
|
10
|
+
} else {
|
|
11
|
+
setExpanded(id);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Accordion asDefinitionList>
|
|
17
|
+
<AccordionItem isExpanded={expanded === 'def-list-toggle1'}>
|
|
18
|
+
<AccordionToggle
|
|
19
|
+
onClick={() => {
|
|
20
|
+
onToggle('def-list-toggle1');
|
|
21
|
+
}}
|
|
22
|
+
id="def-list-toggle1"
|
|
23
|
+
>
|
|
24
|
+
Item one
|
|
25
|
+
</AccordionToggle>
|
|
26
|
+
<AccordionContent id="def-list-expand1">
|
|
27
|
+
<p>
|
|
28
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
|
29
|
+
dolore magna aliqua.
|
|
30
|
+
</p>
|
|
31
|
+
</AccordionContent>
|
|
32
|
+
</AccordionItem>
|
|
33
|
+
|
|
34
|
+
<AccordionItem isExpanded={expanded === 'def-list-toggle2'}>
|
|
35
|
+
<AccordionToggle
|
|
36
|
+
onClick={() => {
|
|
37
|
+
onToggle('def-list-toggle2');
|
|
38
|
+
}}
|
|
39
|
+
id="def-list-toggle2"
|
|
40
|
+
>
|
|
41
|
+
Item two
|
|
42
|
+
</AccordionToggle>
|
|
43
|
+
<AccordionContent id="def-list-expand2">
|
|
44
|
+
<p>
|
|
45
|
+
Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent nec dictum lorem. Aliquam id diam
|
|
46
|
+
ultrices, faucibus erat id, maximus nunc.
|
|
47
|
+
</p>
|
|
48
|
+
</AccordionContent>
|
|
49
|
+
</AccordionItem>
|
|
50
|
+
|
|
51
|
+
<AccordionItem isExpanded={expanded === 'def-list-toggle3'}>
|
|
52
|
+
<AccordionToggle
|
|
53
|
+
onClick={() => {
|
|
54
|
+
onToggle('def-list-toggle3');
|
|
55
|
+
}}
|
|
56
|
+
id="def-list-toggle3"
|
|
57
|
+
>
|
|
58
|
+
Item three
|
|
59
|
+
</AccordionToggle>
|
|
60
|
+
<AccordionContent id="def-list-expand3">
|
|
61
|
+
<p>Morbi vitae urna quis nunc convallis hendrerit. Aliquam congue orci quis ultricies tempus.</p>
|
|
62
|
+
</AccordionContent>
|
|
63
|
+
</AccordionItem>
|
|
64
|
+
|
|
65
|
+
<AccordionItem isExpanded={expanded === 'def-list-toggle4'}>
|
|
66
|
+
<AccordionToggle
|
|
67
|
+
onClick={() => {
|
|
68
|
+
onToggle('def-list-toggle4');
|
|
69
|
+
}}
|
|
70
|
+
id="def-list-toggle4"
|
|
71
|
+
>
|
|
72
|
+
Item four
|
|
73
|
+
</AccordionToggle>
|
|
74
|
+
<AccordionContent id="def-list-expand4">
|
|
75
|
+
<p>
|
|
76
|
+
Donec vel posuere orci. Phasellus quis tortor a ex hendrerit efficitur. Aliquam lacinia ligula pharetra,
|
|
77
|
+
sagittis ex ut, pellentesque diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere
|
|
78
|
+
cubilia Curae; Vestibulum ultricies nulla nibh. Etiam vel dui fermentum ligula ullamcorper eleifend non quis
|
|
79
|
+
tortor. Morbi tempus ornare tempus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur
|
|
80
|
+
ridiculus mus. Mauris et velit neque. Donec ultricies condimentum mauris, pellentesque imperdiet libero
|
|
81
|
+
convallis convallis. Aliquam erat volutpat. Donec rutrum semper tempus. Proin dictum imperdiet nibh, quis
|
|
82
|
+
dapibus nulla. Integer sed tincidunt lectus, sit amet auctor eros.
|
|
83
|
+
</p>
|
|
84
|
+
</AccordionContent>
|
|
85
|
+
</AccordionItem>
|
|
86
|
+
|
|
87
|
+
<AccordionItem isExpanded={expanded === 'def-list-toggle5'}>
|
|
88
|
+
<AccordionToggle
|
|
89
|
+
onClick={() => {
|
|
90
|
+
onToggle('def-list-toggle5');
|
|
91
|
+
}}
|
|
92
|
+
id="def-list-toggle5"
|
|
93
|
+
>
|
|
94
|
+
Item five
|
|
95
|
+
</AccordionToggle>
|
|
96
|
+
<AccordionContent id="def-list-expand5">
|
|
97
|
+
<p>Vivamus finibus dictum ex id ultrices. Mauris dictum neque a iaculis blandit.</p>
|
|
98
|
+
</AccordionContent>
|
|
99
|
+
</AccordionItem>
|
|
100
|
+
</Accordion>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
Accordion,
|
|
4
|
+
AccordionItem,
|
|
5
|
+
AccordionContent,
|
|
6
|
+
AccordionToggle,
|
|
7
|
+
} from '@patternfly/react-core'
|
|
8
|
+
|
|
9
|
+
export const AccordionFixedWithMultipleExpandBehavior: React.FunctionComponent =
|
|
10
|
+
() => {
|
|
11
|
+
const [expanded, setExpanded] = useState(['ex2-toggle4'])
|
|
12
|
+
|
|
13
|
+
const toggle = (id: string) => {
|
|
14
|
+
const index = expanded.indexOf(id)
|
|
15
|
+
const newExpanded: string[] =
|
|
16
|
+
index >= 0
|
|
17
|
+
? [
|
|
18
|
+
...expanded.slice(0, index),
|
|
19
|
+
...expanded.slice(index + 1, expanded.length),
|
|
20
|
+
]
|
|
21
|
+
: [...expanded, id]
|
|
22
|
+
setExpanded(newExpanded)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Accordion asDefinitionList={false}>
|
|
27
|
+
<AccordionItem isExpanded={expanded.includes('ex2-toggle1')}>
|
|
28
|
+
<AccordionToggle
|
|
29
|
+
onClick={() => toggle('ex2-toggle1')}
|
|
30
|
+
id="ex2-toggle1"
|
|
31
|
+
>
|
|
32
|
+
Item one
|
|
33
|
+
</AccordionToggle>
|
|
34
|
+
<AccordionContent id="ex2-expand1" isFixed>
|
|
35
|
+
<p>
|
|
36
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
|
|
37
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
38
|
+
</p>
|
|
39
|
+
</AccordionContent>
|
|
40
|
+
</AccordionItem>
|
|
41
|
+
<AccordionItem isExpanded={expanded.includes('ex2-toggle2')}>
|
|
42
|
+
<AccordionToggle
|
|
43
|
+
onClick={() => toggle('ex2-toggle2')}
|
|
44
|
+
id="ex2-toggle2"
|
|
45
|
+
>
|
|
46
|
+
Item two
|
|
47
|
+
</AccordionToggle>
|
|
48
|
+
<AccordionContent id="ex2-expand2" isFixed>
|
|
49
|
+
<p>
|
|
50
|
+
Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent
|
|
51
|
+
nec dictum lorem. Aliquam id diam ultrices, faucibus erat id,
|
|
52
|
+
maximus nunc.
|
|
53
|
+
</p>
|
|
54
|
+
</AccordionContent>
|
|
55
|
+
</AccordionItem>
|
|
56
|
+
<AccordionItem isExpanded={expanded.includes('ex2-toggle3')}>
|
|
57
|
+
<AccordionToggle
|
|
58
|
+
onClick={() => toggle('ex2-toggle3')}
|
|
59
|
+
id="ex2-toggle3"
|
|
60
|
+
>
|
|
61
|
+
Item three
|
|
62
|
+
</AccordionToggle>
|
|
63
|
+
<AccordionContent id="ex2-expand3" isFixed>
|
|
64
|
+
<p>
|
|
65
|
+
Morbi vitae urna quis nunc convallis hendrerit. Aliquam congue
|
|
66
|
+
orci quis ultricies tempus.
|
|
67
|
+
</p>
|
|
68
|
+
</AccordionContent>
|
|
69
|
+
</AccordionItem>
|
|
70
|
+
<AccordionItem isExpanded={expanded.includes('ex2-toggle4')}>
|
|
71
|
+
<AccordionToggle
|
|
72
|
+
onClick={() => toggle('ex2-toggle4')}
|
|
73
|
+
id="ex2-toggle4"
|
|
74
|
+
>
|
|
75
|
+
Item four
|
|
76
|
+
</AccordionToggle>
|
|
77
|
+
<AccordionContent
|
|
78
|
+
aria-labelledby="ex2-toggle4"
|
|
79
|
+
id="ex2-expand4"
|
|
80
|
+
isFixed
|
|
81
|
+
>
|
|
82
|
+
<p>
|
|
83
|
+
Donec vel posuere orci. Phasellus quis tortor a ex hendrerit
|
|
84
|
+
efficitur. Aliquam lacinia ligula pharetra, sagittis ex ut,
|
|
85
|
+
pellentesque diam. Vestibulum ante ipsum primis in faucibus orci
|
|
86
|
+
luctus et ultrices posuere cubilia Curae; Vestibulum ultricies
|
|
87
|
+
nulla nibh. Etiam vel dui fermentum ligula ullamcorper eleifend
|
|
88
|
+
non quis tortor. Morbi tempus ornare tempus. Orci varius natoque
|
|
89
|
+
penatibus et magnis dis parturient montes, nascetur ridiculus mus.
|
|
90
|
+
Mauris et velit neque. Donec ultricies condimentum mauris,
|
|
91
|
+
pellentesque imperdiet libero convallis convallis. Aliquam erat
|
|
92
|
+
volutpat. Donec rutrum semper tempus. Proin dictum imperdiet nibh,
|
|
93
|
+
quis dapibus nulla. Integer sed tincidunt lectus, sit amet auctor
|
|
94
|
+
eros.
|
|
95
|
+
</p>
|
|
96
|
+
<p>
|
|
97
|
+
Donec vel posuere orci. Phasellus quis tortor a ex hendrerit
|
|
98
|
+
efficitur. Aliquam lacinia ligula pharetra, sagittis ex ut,
|
|
99
|
+
pellentesque diam. Vestibulum ante ipsum primis in faucibus orci
|
|
100
|
+
luctus et ultrices posuere cubilia Curae; Vestibulum ultricies
|
|
101
|
+
nulla nibh. Etiam vel dui fermentum ligula ullamcorper eleifend
|
|
102
|
+
non quis tortor. Morbi tempus ornare tempus. Orci varius natoque
|
|
103
|
+
penatibus et magnis dis parturient montes, nascetur ridiculus mus.
|
|
104
|
+
Mauris et velit neque. Donec ultricies condimentum mauris,
|
|
105
|
+
pellentesque imperdiet libero convallis convallis. Aliquam erat
|
|
106
|
+
volutpat. Donec rutrum semper tempus. Proin dictum imperdiet nibh,
|
|
107
|
+
quis dapibus nulla. Integer sed tincidunt lectus, sit amet auctor
|
|
108
|
+
eros.
|
|
109
|
+
</p>
|
|
110
|
+
</AccordionContent>
|
|
111
|
+
</AccordionItem>
|
|
112
|
+
<AccordionItem isExpanded={expanded.includes('ex2-toggle5')}>
|
|
113
|
+
<AccordionToggle
|
|
114
|
+
onClick={() => toggle('ex2-toggle5')}
|
|
115
|
+
id="ex2-toggle5"
|
|
116
|
+
>
|
|
117
|
+
Item five
|
|
118
|
+
</AccordionToggle>
|
|
119
|
+
<AccordionContent id="ex2-expand5" isFixed>
|
|
120
|
+
<p>
|
|
121
|
+
Vivamus finibus dictum ex id ultrices. Mauris dictum neque a
|
|
122
|
+
iaculis blandit.
|
|
123
|
+
</p>
|
|
124
|
+
</AccordionContent>
|
|
125
|
+
</AccordionItem>
|
|
126
|
+
</Accordion>
|
|
127
|
+
)
|
|
128
|
+
}
|