@patternfly/quickstarts 1.2.2 → 1.4.1-rc.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/README.md CHANGED
@@ -27,9 +27,26 @@ import '@patternfly/react-core/dist/styles/base.css';
27
27
  import '@patternfly/quickstarts/dist/quickstarts.min.css';
28
28
  ```
29
29
 
30
+ ### Stylesheets if you use an older version of PatternFly
31
+ If you use an older version of @patternfly/react-core (older than "4.115.2"), and you can't upgrade yet, you can pull in the necessary PatternFly styles that @patternfly/quickstarts depends upon.
32
+
33
+ Ideally @patternfly/quickstarts will use the consumer provided PatternFly styles, only use these stylesheets if really needed.
34
+
35
+ `quickstarts-standalone.min.css` nests the css classes within a **.pfext-quick-start__base** parent, so that they have higher specificity. `patternfly-global.css` includes component styles that we cannot nest with more specificiy (for example Drawer since it can include consumer components that depend on an older PF version).
36
+
37
+ > Note: Only use these stylesheets if necessary!
38
+ ```js
39
+ // import base from PatternFly to get the font
40
+ import '@patternfly/react-core/dist/styles/base.css';
41
+ // some global styles and variables that quickstarts uses (Drawer, Popover, Modal, Backdrop, Bullseye)
42
+ import '@patternfly/quickstarts/dist/patternfly-global.css';
43
+ // PF and quickstarts styles nested within .pfext-quick-start__base
44
+ import '@patternfly/quickstarts/dist/quickstarts-standalone.min.css';
45
+ ```
46
+
30
47
  ## Usage example
31
48
 
32
- Note: You can also view this example on [codesandbox](https://codesandbox.io/s/patternflyquickstarts-1386f?file=/src/App.js)!
49
+ Note: You can also view this example on [codesandbox](https://codesandbox.io/s/patternfly-quickstarts-finished-cnv53)!
33
50
 
34
51
  ```js
35
52
  import "./styles.css";
@@ -93,7 +110,10 @@ const App = () => {
93
110
  allQuickStartStates,
94
111
  setActiveQuickStartID,
95
112
  setAllQuickStartStates,
113
+ // Set to true to opt-out of default hidden card footers
96
114
  showCardFooters: false,
115
+ // Set to true to opt-out of default drawer header colors of blue with white text
116
+ useLegacyHeaderColors: false,
97
117
  loading,
98
118
  useQueryParams: withQueryParams,
99
119
  };
@@ -140,6 +160,10 @@ const SomeNestedComponent = () => {
140
160
  export default App;
141
161
  ```
142
162
 
163
+ ## Design update, option to opt-out of new drawer header coloring
164
+
165
+ See above usage of `useLegacyHeaderColors` boolean to opt-out of update. Should only be used if new color scheme clashes with the usage context.
166
+
143
167
  ## Quick starts format
144
168
 
145
169
  Quick starts are parsed as markdown. To write your own quick start, if you use Typescript you can [check out the type definition here](https://github.com/patternfly/patternfly-quickstarts/blob/d52b194119f1ff16e69bf589d49a14931a19ac4b/packages/module/src/utils/quick-start-types.ts#L6).
@@ -204,4 +228,26 @@ You can have inline or block copyable text.
204
228
  ```{{copy}}
205
229
  ```
206
230
 
207
- ####
231
+ ## Localization
232
+ We use English as the default language. You can override the default by providing your own key/value pairs to the `QuickStartContainer` or `QuickStartContextProvider` resourceBundle prop.
233
+
234
+ Example:
235
+ ```js
236
+ // load my own resource Czech translations resource bundle using i18next
237
+ const resourceBundle = i18n.getResourceBundle('cs', 'quickstart');
238
+ const resources = {
239
+ ...resourceBundle,
240
+ Start: "Let's go!",
241
+ Continue: 'Resume',
242
+ Restart: 'Start over',
243
+ };
244
+ return (
245
+ <QuickStartContainer resourceBundle={resources}>
246
+ </QuickStartContainer>
247
+ )
248
+ ```
249
+
250
+ Use this [file](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/module/src/locales/en/quickstart.json) as a base for your translations.
251
+ Each language is different, especially when it comes to plurals. Try [this utility](https://jsfiddle.net/6bpxsgd4) sourced from [i18next](https://www.i18next.com/translation-function/plurals#how-to-find-the-correct-plural-suffix) to determine the suffixes for the right plural format.
252
+
253
+ ####
@@ -14,10 +14,12 @@ export interface QuickStartContainerProps extends React.HTMLProps<HTMLDivElement
14
14
  onCloseInProgress?: any;
15
15
  onCloseNotInProgress?: any;
16
16
  showCardFooters?: boolean;
17
+ useLegacyHeaderColors?: boolean;
17
18
  resourceBundle?: any;
18
19
  language?: string;
19
20
  loading?: boolean;
20
21
  useQueryParams?: boolean;
22
+ alwaysShowTaskReview?: boolean;
21
23
  /**
22
24
  * Additional markdown extensions and renderers to use
23
25
  * TODO: example usage - In the meantime you can take a look at:
@@ -9,6 +9,7 @@ declare type QuickStartPanelContentProps = {
9
9
  appendTo?: HTMLElement | (() => HTMLElement);
10
10
  isResizable?: boolean;
11
11
  showClose?: boolean;
12
+ headerVariant?: '' | 'blue-white';
12
13
  };
13
14
  declare const QuickStartPanelContent: React.FC<QuickStartPanelContentProps>;
14
15
  export default QuickStartPanelContent;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { QuickStartExternal } from '../utils/quick-start-types';
3
3
  declare type QuickStartTileFooterProps = {
4
4
  link: QuickStartExternal;
5
+ quickStartId?: string;
5
6
  };
6
7
  declare const QuickStartTileFooterExternal: React.FC<QuickStartTileFooterProps>;
7
8
  export default QuickStartTileFooterExternal;
@@ -6,6 +6,7 @@ declare type QuickStartTileHeaderProps = {
6
6
  duration: number;
7
7
  name: string;
8
8
  type?: QuickStartType;
9
+ quickStartId?: string;
9
10
  };
10
11
  declare const QuickStartTileHeader: React.FC<QuickStartTileHeaderProps>;
11
12
  export default QuickStartTileHeader;
@@ -4,7 +4,7 @@ declare type QuickStartConclusionProps = {
4
4
  tasks: QuickStartTask[];
5
5
  conclusion: string;
6
6
  allTaskStatuses: QuickStartTaskStatus[];
7
- nextQuickStart?: QuickStart;
7
+ nextQuickStarts?: QuickStart[];
8
8
  onQuickStartChange: (quickStartid: string) => void;
9
9
  onTaskSelect: (selectedTaskNumber: number) => void;
10
10
  };
@@ -1,9 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { QuickStartTask, QuickStartTaskStatus } from '../utils/quick-start-types';
3
+ import './QuickStartIntroduction.scss';
3
4
  declare type QuickStartIntroductionProps = {
4
5
  introduction: string;
5
6
  tasks: QuickStartTask[];
6
7
  allTaskStatuses: QuickStartTaskStatus[];
8
+ prerequisites?: string[];
7
9
  onTaskSelect: (selectedTaskNumber: number) => void;
8
10
  };
9
11
  declare const QuickStartIntroduction: React.FC<QuickStartIntroductionProps>;