@patternfly/documentation-framework 6.0.0-alpha.59 → 6.0.0-alpha.60

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 6.0.0-alpha.60 (2024-07-16)
7
+
8
+ **Note:** Version bump only for package @patternfly/documentation-framework
9
+
10
+
11
+
12
+
13
+
6
14
  # 6.0.0-alpha.59 (2024-07-11)
7
15
 
8
16
 
@@ -1,51 +1,98 @@
1
- import React from "react";
2
- import { DataList, DataListItem, DataListItemRow, DataListItemCells, DataListCell, Split, SplitItem, TextContent, Text, TextVariants, Label } from "@patternfly/react-core";
1
+ import React from 'react';
2
+ import {
3
+ DataList,
4
+ DataListItem,
5
+ DataListItemRow,
6
+ DataListItemCells,
7
+ DataListCell,
8
+ Split,
9
+ SplitItem,
10
+ TextContent,
11
+ Text,
12
+ TextVariants,
13
+ Label,
14
+ } from '@patternfly/react-core';
3
15
  import { Link } from '../link/link';
4
16
  import { TextSummary } from './TextSummary';
5
17
 
6
- export const SectionDataListLayout = ({ galleryItems, layoutView, hasListText, hasListImages }) => {
18
+ export const SectionDataListLayout = ({
19
+ galleryItems,
20
+ layoutView,
21
+ hasListText,
22
+ hasListImages,
23
+ }) => {
7
24
  if (layoutView !== 'list') {
8
25
  return null;
9
26
  }
10
27
 
11
28
  return (
12
29
  <DataList onSelectDataListItem={() => {}}>
13
- {galleryItems.map(({ idx, slug, illustration, itemName, title, isBeta, isDeprecated, isDemo, id, galleryItemsData }) => (
14
- <Link to={slug} key={idx} className="ws-section-gallery-item">
15
- <DataListItem>
16
- <DataListItemRow>
17
- <DataListItemCells dataListCells={[
18
- hasListImages && illustration && (
19
- <DataListCell width={1} key="illustration">
20
- <div>
21
- <img src={illustration} alt={`${itemName} illustration`} />
22
- </div>
23
- </DataListCell>
24
- ),
25
- <DataListCell width={5} key="text-description">
26
- <Split className={ hasListText ? "pf-v6-u-mb-md" : null }>
27
- <SplitItem isFilled>
28
- <TextContent>
29
- <Text component={TextVariants.h2}>
30
- <span>
31
- {title}
32
- </span>
33
- </Text>
34
- </TextContent>
35
- </SplitItem>
36
- <SplitItem>
37
- {isBeta && (<Label color="blue" isCompact>Beta</Label>)}
38
- {!isBeta && isDeprecated && (<Label color="grey" isCompact>Deprecated</Label>)}
39
- {!isBeta && !isDeprecated && isDemo && (<Label color="purple" isCompact>Demo</Label>)}
40
- </SplitItem>
41
- </Split>
42
- { hasListText && <TextSummary id={id} itemsData={galleryItemsData} /> }
43
- </DataListCell>
44
- ]} />
45
- </DataListItemRow>
46
- </DataListItem>
47
- </Link>
48
- ))}
30
+ {galleryItems.map(
31
+ ({
32
+ idx,
33
+ slug,
34
+ illustration,
35
+ itemName,
36
+ title,
37
+ isBeta,
38
+ isDeprecated,
39
+ isDemo,
40
+ id,
41
+ galleryItemsData,
42
+ }) => (
43
+ <Link to={slug} key={idx} className="ws-section-gallery-item">
44
+ <DataListItem>
45
+ <DataListItemRow>
46
+ <DataListItemCells
47
+ dataListCells={[
48
+ hasListImages && illustration && (
49
+ <DataListCell width={1} key="illustration">
50
+ <div>
51
+ <img
52
+ src={illustration}
53
+ alt={`${itemName} illustration`}
54
+ />
55
+ </div>
56
+ </DataListCell>
57
+ ),
58
+ <DataListCell width={5} key="text-description">
59
+ <Split className={hasListText ? 'pf-v6-u-mb-md' : null}>
60
+ <SplitItem isFilled>
61
+ <TextContent>
62
+ <Text component={TextVariants.h2}>
63
+ <span>{title}</span>
64
+ </Text>
65
+ </TextContent>
66
+ </SplitItem>
67
+ <SplitItem>
68
+ {isBeta && (
69
+ <Label color="blue" isCompact>
70
+ Beta
71
+ </Label>
72
+ )}
73
+ {!isBeta && isDeprecated && (
74
+ <Label color="grey" isCompact>
75
+ Deprecated
76
+ </Label>
77
+ )}
78
+ {!isBeta && !isDeprecated && isDemo && (
79
+ <Label color="purple" isCompact>
80
+ Demo
81
+ </Label>
82
+ )}
83
+ </SplitItem>
84
+ </Split>
85
+ {hasListText && (
86
+ <TextSummary id={id} itemsData={galleryItemsData} />
87
+ )}
88
+ </DataListCell>,
89
+ ]}
90
+ />
91
+ </DataListItemRow>
92
+ </DataListItem>
93
+ </Link>
94
+ )
95
+ )}
49
96
  </DataList>
50
- )
97
+ );
51
98
  };
@@ -1,39 +1,6 @@
1
- .ws-landing-page > * {
2
- max-width: 832px;
3
- }
4
-
5
- .ws-landing-page > .ws-section-gallery-full-width {
6
- max-width: initial;
7
- }
8
-
9
- .ws-section-gallery {
10
- /* top placement */
11
- margin-top: calc(var(--pf-v6-c-page__main-section--PaddingTop) * -1);
12
- }
13
-
14
- * + .ws-section-gallery {
15
- /* top placement */
16
- margin-top: unset;
17
- }
18
-
19
1
  /* Toolbar styles */
20
2
  .ws-section-gallery .pf-v6-c-toolbar {
21
- margin-left: calc(var(--pf-v6-c-page__main-section--PaddingLeft) * -1);
22
- border-bottom: var(--pf-v6-c-page__sidebar--m-light--BorderRightWidth) solid var(--pf-v6-c-page__sidebar--m-light--BorderRightColor);
23
- margin-bottom: var(--pf-t--global--spacer--md);
24
- width: calc(100% + var(--pf-v6-c-page__main-section--PaddingLeft) + var(--pf-v6-c-page__main-section--PaddingRight));
25
- /* avoid hoverable data list items overlapping toolbar */
26
- /* z-index: calc(var(--pf-v6-global--ZIndex--xs) + 2); */
27
- }
28
-
29
- /* Match toolbar left-padding to gallery left-padding */
30
- .ws-section-gallery .pf-v6-c-toolbar .pf-v6-c-toolbar__content {
31
- --pf-v6-c-toolbar__content--PaddingLeft: var(--pf-v6-c-page__main-section--PaddingLeft);
32
- }
33
-
34
- /* Avoid toolbar wrap on smaller screens */
35
- .ws-section-gallery .pf-v6-c-toolbar__content-section {
36
- flex-wrap: nowrap;
3
+ margin-block-end: var(--pf-t--global--spacer--md);
37
4
  }
38
5
 
39
6
  /* Avoid link styling on gallery/data list item names */
@@ -42,12 +9,7 @@
42
9
  color: inherit;
43
10
  }
44
11
 
45
- /* Ensure same height for all cards in a gallery row */
46
- .ws-section-gallery .pf-v6-c-card {
47
- height: 100%;
48
- }
49
-
50
12
  /* Limit width for data list view only */
51
13
  .ws-section-gallery .pf-v6-c-data-list {
52
- max-width: 956px;
14
+ max-width: var(--pf-t--global--breakpoint--lg);
53
15
  }
@@ -1,41 +1,91 @@
1
- import React from "react";
2
- import { Gallery, GalleryItem, Card, CardTitle, CardBody, CardFooter, Label } from "@patternfly/react-core";
3
- import { Link } from '../link/link';
4
- import { TextSummary } from "./TextSummary";
1
+ import React from 'react';
2
+ import {
3
+ Gallery,
4
+ GalleryItem,
5
+ Card,
6
+ CardHeader,
7
+ CardTitle,
8
+ CardBody,
9
+ CardFooter,
10
+ Label,
11
+ } from '@patternfly/react-core';
12
+ import { navigate } from '@reach/router';
13
+ import { TextSummary } from './TextSummary';
5
14
 
6
- export const SectionGalleryLayout = ({ galleryItems, layoutView, hasGridText, hasGridImages }) => {
15
+ export const SectionGalleryLayout = ({
16
+ galleryItems,
17
+ layoutView,
18
+ hasGridText,
19
+ hasGridImages,
20
+ }) => {
7
21
  if (layoutView !== 'grid') {
8
22
  return null;
9
23
  }
10
24
 
11
25
  return (
12
26
  <Gallery hasGutter>
13
- {galleryItems.map(({idx, slug, id, itemName, illustration, isBeta, isDeprecated, isDemo, title, galleryItemsData}) => (
14
- <GalleryItem span={4} key={idx}>
15
- <Link to={slug} className="ws-section-gallery-item">
16
- <Card
17
- id={id}
18
- key={idx}
19
- isSelectableRaised
20
- >
21
- <CardTitle>{title}</CardTitle>
27
+ {galleryItems.map(
28
+ ({
29
+ idx,
30
+ slug,
31
+ id,
32
+ itemName,
33
+ illustration,
34
+ isBeta,
35
+ isDeprecated,
36
+ isDemo,
37
+ title,
38
+ galleryItemsData,
39
+ }) => (
40
+ <GalleryItem span={4} key={idx}>
41
+ <Card id={id} key={idx} isClickable>
42
+ <CardHeader
43
+ selectableActions={{
44
+ onClickAction: (e) => {
45
+ e.preventDefault();
46
+ document.getElementById('ws-page-main').scrollIntoView();
47
+ navigate(slug);
48
+ },
49
+ selectableActionId: `${id}-input`,
50
+ selectableActionAriaLabelledby: id,
51
+ name: `clickable-card-${idx}`,
52
+ }}
53
+ >
54
+ <CardTitle>{title}</CardTitle>
55
+ </CardHeader>
22
56
  {(hasGridImages || hasGridText) && (
23
57
  <CardBody>
24
- { hasGridImages && illustration && <img src={illustration} alt={`${itemName} illustration`} /> }
25
- { hasGridText && <TextSummary id={id} itemsData={galleryItemsData} /> }
58
+ {hasGridImages && illustration && (
59
+ <img src={illustration} alt={`${itemName} illustration`} />
60
+ )}
61
+ {hasGridText && (
62
+ <TextSummary id={id} itemsData={galleryItemsData} />
63
+ )}
26
64
  </CardBody>
27
65
  )}
28
66
  {(isBeta || isDeprecated || isDemo) && (
29
67
  <CardFooter>
30
- {isBeta && (<Label color="blue" isCompact>Beta</Label>)}
31
- {!isBeta && isDeprecated && (<Label color="grey" isCompact>Deprecated</Label>)}
32
- {!isBeta && !isDeprecated && isDemo && (<Label color="purple" isCompact>Demo</Label>)}
68
+ {isBeta && (
69
+ <Label color="blue" isCompact>
70
+ Beta
71
+ </Label>
72
+ )}
73
+ {!isBeta && isDeprecated && (
74
+ <Label color="grey" isCompact>
75
+ Deprecated
76
+ </Label>
77
+ )}
78
+ {!isBeta && !isDeprecated && isDemo && (
79
+ <Label color="purple" isCompact>
80
+ Demo
81
+ </Label>
82
+ )}
33
83
  </CardFooter>
34
84
  )}
35
85
  </Card>
36
- </Link>
37
- </GalleryItem>
38
- ))}
86
+ </GalleryItem>
87
+ )
88
+ )}
39
89
  </Gallery>
40
- )
90
+ );
41
91
  };
@@ -1,7 +1,18 @@
1
- import React from "react";
2
- import { Button, SearchInput, Toolbar, ToolbarContent, ToolbarGroup, ToolbarItem, Text, TextVariants, ToggleGroup, ToggleGroupItem } from '@patternfly/react-core';
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ SearchInput,
5
+ Toolbar,
6
+ ToolbarContent,
7
+ ToolbarGroup,
8
+ ToolbarItem,
9
+ Text,
10
+ TextVariants,
11
+ ToggleGroup,
12
+ ToggleGroupItem,
13
+ } from '@patternfly/react-core';
3
14
  import ListIcon from '@patternfly/react-icons/dist/esm/icons/list-icon';
4
- import ThIcon from'@patternfly/react-icons/dist/esm/icons/th-icon';
15
+ import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
5
16
 
6
17
  export const SectionGalleryToolbar = ({
7
18
  galleryItems,
@@ -9,29 +20,53 @@ export const SectionGalleryToolbar = ({
9
20
  setSearchTerm,
10
21
  layoutView,
11
22
  setLayoutView,
12
- placeholderText ="Search by name",
13
- countText=" items"
23
+ placeholderText = 'Search by name',
24
+ countText = ' items',
14
25
  }) => (
15
26
  <Toolbar isSticky>
16
27
  <ToolbarContent>
17
- <ToolbarItem variant="search-filter" widths={{default: '100%', md: '320px'}}>
18
- <SearchInput onClear={false} value={searchTerm} placeholder={placeholderText} onChange={(_evt, val) => setSearchTerm(val)} />
28
+ <ToolbarItem>
29
+ <SearchInput
30
+ onClear={false}
31
+ value={searchTerm}
32
+ placeholder={placeholderText}
33
+ onChange={(_evt, val) => setSearchTerm(val)}
34
+ />
19
35
  </ToolbarItem>
20
36
  {searchTerm && (
21
37
  <ToolbarItem>
22
- <Button variant="link" onClick={() => setSearchTerm('')}>Reset</Button>
38
+ <Button variant="link" onClick={() => setSearchTerm('')}>
39
+ Reset
40
+ </Button>
23
41
  </ToolbarItem>
24
42
  )}
25
43
  <ToolbarGroup variant="icon-button-group">
26
44
  <ToolbarItem>
27
45
  <ToggleGroup>
28
- <ToggleGroupItem icon={<ThIcon />} aria-label="grid icon button" isSelected={layoutView === 'grid'} onChange={() => setLayoutView('grid')}></ToggleGroupItem>
29
- <ToggleGroupItem icon={<ListIcon />} aria-label="list icon button" isSelected={layoutView === 'list'} onChange={() => setLayoutView('list')}></ToggleGroupItem>
46
+ <ToggleGroupItem
47
+ icon={<ThIcon />}
48
+ aria-label="grid icon button"
49
+ isSelected={layoutView === 'grid'}
50
+ onChange={() => setLayoutView('grid')}
51
+ ></ToggleGroupItem>
52
+ <ToggleGroupItem
53
+ icon={<ListIcon />}
54
+ aria-label="list icon button"
55
+ isSelected={layoutView === 'list'}
56
+ onChange={() => setLayoutView('list')}
57
+ ></ToggleGroupItem>
30
58
  </ToggleGroup>
31
59
  </ToolbarItem>
32
60
  </ToolbarGroup>
33
- <ToolbarItem variant="pagination" spacer={{default: 'spacerMd', md: 'spacerNone'}} style={{'--pf-v6-c-toolbar__item--MinWidth': "max-content"}}>
34
- <Text component={TextVariants.small}>{ galleryItems.length }{ countText }</Text>
61
+ <ToolbarItem
62
+ variant="pagination"
63
+ spacer={{ default: 'spacerMd', md: 'spacerNone' }}
64
+ style={{ '--pf-v6-c-toolbar__item--MinWidth': 'max-content' }}
65
+ >
66
+ <Text component={TextVariants.small}>
67
+ {galleryItems.length}
68
+ {countText}
69
+ </Text>
35
70
  </ToolbarItem>
36
71
  </ToolbarContent>
37
72
  </Toolbar>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@patternfly/documentation-framework",
3
3
  "description": "A framework to build documentation for PatternFly.",
4
- "version": "6.0.0-alpha.59",
4
+ "version": "6.0.0-alpha.60",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -13,7 +13,7 @@
13
13
  "@babel/preset-env": "^7.24.3",
14
14
  "@babel/preset-react": "^7.24.1",
15
15
  "@mdx-js/util": "1.6.16",
16
- "@patternfly/ast-helpers": "^1.4.0-alpha.48",
16
+ "@patternfly/ast-helpers": "^1.4.0-alpha.49",
17
17
  "@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
18
18
  "autoprefixer": "9.8.6",
19
19
  "babel-loader": "^9.1.3",
@@ -80,5 +80,5 @@
80
80
  "react": "^17.0.0 || ^18.0.0",
81
81
  "react-dom": "^17.0.0 || ^18.0.0"
82
82
  },
83
- "gitHead": "96fb4d85450d4108a9197a11d7c15717a2c05a1b"
83
+ "gitHead": "44dade794af1d51291b5d901b6e1ee0887dd11ea"
84
84
  }
@@ -13,7 +13,6 @@ import {
13
13
  GridItem,
14
14
  PageSection,
15
15
  TextInput,
16
- Title
17
16
  } from '@patternfly/react-core';
18
17
  import { attachDocSearch } from '../../layouts/sideNavLayout/sideNavLayout';
19
18
  import PathMissingIcon from './404.svg';
@@ -23,31 +22,16 @@ import ComponentsIcon from './components.svg';
23
22
  import ChartIcon from './chart.svg';
24
23
  import './404.css';
25
24
 
26
- const Card404 = ({
27
- img,
28
- alt,
29
- title,
30
- body,
31
- link: {
32
- text,
33
- to
34
- }
35
- }) => (
25
+ const Card404 = ({ img, alt, title, body, link: { text, to } }) => (
36
26
  <GridItem xl={3} md={6} xs={12}>
37
27
  <Card style={{ height: '340px' }}>
38
28
  <CardHeader className="ws-404-card-header">
39
29
  <img src={img} alt={alt} width="64px" />
40
30
  </CardHeader>
41
- <CardTitle>
42
- {title}
43
- </CardTitle>
44
- <CardBody>
45
- {body}
46
- </CardBody>
31
+ <CardTitle>{title}</CardTitle>
32
+ <CardBody>{body}</CardBody>
47
33
  <CardFooter>
48
- <Link to={to}>
49
- {text}
50
- </Link>
34
+ <Link to={to}>{text}</Link>
51
35
  </CardFooter>
52
36
  </Card>
53
37
  </GridItem>
@@ -64,18 +48,24 @@ const Page404 = () => {
64
48
  attachDocSearch(algolia, '#ws-404-search', 1000);
65
49
  }
66
50
  });
67
-
51
+
68
52
  return (
69
53
  <PageSection>
70
- <EmptyState headingLevel="h1" titleText="404: That page no longer exists" variant="xl" icon={() => <img src={PathMissingIcon} alt="" width="128px" />}>
71
- <p
72
- // style={{ marginTop: 'var(--pf-v6-global--spacer--sm)' }}
73
- >
74
- Another page might have the information you need, so try searching PatternFly.
75
- </p>
54
+ <EmptyState
55
+ headingLevel="h1"
56
+ titleText="404: That page no longer exists"
57
+ variant="xl"
58
+ icon={() => <img src={PathMissingIcon} alt="" width="128px" />}
59
+ >
60
+ Another page might have the information you need, so try searching
61
+ PatternFly.
76
62
  <EmptyStateBody>
77
63
  <div id="ws-404-search-wrapper">
78
- <TextInput id="ws-404-search" type="text" placeholder="Search PatternFly" />
64
+ <TextInput
65
+ id="ws-404-search"
66
+ type="text"
67
+ placeholder="Search PatternFly"
68
+ />
79
69
  </div>
80
70
  </EmptyStateBody>
81
71
  </EmptyState>
@@ -87,7 +77,7 @@ const Page404 = () => {
87
77
  body="Learn about designing and developing with PatternFly."
88
78
  link={{
89
79
  text: 'View getting started resources',
90
- to: '/get-started/about-patternfly'
80
+ to: '/get-started/about-patternfly',
91
81
  }}
92
82
  />
93
83
  <Card404
@@ -97,7 +87,7 @@ const Page404 = () => {
97
87
  body="Check out PatternFly's design approach to icons, colors, and more."
98
88
  link={{
99
89
  text: 'View guidelines',
100
- to: '/design-foundations/colors'
90
+ to: '/design-foundations/colors',
101
91
  }}
102
92
  />
103
93
  <Card404
@@ -107,7 +97,7 @@ const Page404 = () => {
107
97
  body="Start creating your applications with components -- the building blocks of user interfaces."
108
98
  link={{
109
99
  text: 'View components',
110
- to: '/components/about-modal'
100
+ to: '/components/about-modal',
111
101
  }}
112
102
  />
113
103
  <Card404
@@ -117,7 +107,7 @@ const Page404 = () => {
117
107
  body="Visualize your facts and figures by designing the right charts for your data."
118
108
  link={{
119
109
  text: 'View charts',
120
- to: '/charts/about'
110
+ to: '/charts/about',
121
111
  }}
122
112
  />
123
113
  </Grid>
@@ -128,6 +118,6 @@ const Page404 = () => {
128
118
  </div>
129
119
  </PageSection>
130
120
  );
131
- }
121
+ };
132
122
 
133
123
  export default Page404;