@patternfly/design-tokens 1.15.1 → 1.16.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/build/css/tokens-dark.scss +3 -3
- package/build/css/tokens-default.scss +4 -5
- package/build/css/{tokens-redhat-dark.scss → tokens-felt-dark.scss} +1 -1
- package/build/css/{tokens-redhat-glass-dark.scss → tokens-felt-glass-dark.scss} +4 -3
- package/build/css/{tokens-redhat-glass.scss → tokens-felt-glass.scss} +4 -2
- package/build/css/{tokens-redhat-highcontrast-dark.scss → tokens-felt-highcontrast-dark.scss} +5 -3
- package/build/css/tokens-felt-highcontrast.scss +121 -0
- package/build/css/{tokens-redhat.scss → tokens-felt.scss} +1 -1
- package/build/css/tokens-glass-dark.scss +2 -2
- package/build/css/tokens-glass.scss +1 -1
- package/build/css/tokens-palette.scss +1 -1
- package/build/css/tokens-redhat-highcontrast.scss +641 -10
- package/build.js +42 -42
- package/{config.redhat-dark.json → config.felt-dark.json} +2 -2
- package/{config.redhat-glass-dark.json → config.felt-glass-dark.json} +2 -2
- package/{config.redhat-glass.json → config.felt-glass.json} +2 -2
- package/{config.redhat-highcontrast-dark.json → config.felt-highcontrast-dark.json} +2 -2
- package/{config.redhat.json → config.felt.json} +2 -2
- package/{config.layers.redhat-dark.json → config.layers.felt-dark.json} +2 -2
- package/{config.layers.redhat-glass-dark.json → config.layers.felt-glass-dark.json} +2 -2
- package/{config.layers.redhat-glass.json → config.layers.felt-glass.json} +2 -2
- package/{config.layers.redhat-highcontrast-dark.json → config.layers.felt-highcontrast-dark.json} +2 -2
- package/package.json +1 -1
- package/patternfly-docs/content/token-layers-felt-dark.json +48543 -0
- package/patternfly-docs/content/token-layers-felt-glass-dark.json +37670 -0
- package/patternfly-docs/content/token-layers-felt-glass.json +52576 -0
- package/patternfly-docs/content/token-layers-felt-highcontrast-dark.json +38323 -0
- package/patternfly-docs/content/token-layers-glass-dark.json +4214 -4247
- package/patternfly-docs/content/token-layers-glass.json +4997 -5049
- package/patternfly-docs/content/token-layers-highcontrast-dark.json +2978 -3005
- package/patternfly-docs/content/token-layers-highcontrast.json +4177 -4229
- package/patternfly-docs/content/token-layers-redhat-dark.json +147 -170
- package/patternfly-docs/content/token-layers-redhat-glass-dark.json +165 -194
- package/patternfly-docs/content/token-layers-redhat-glass.json +298 -346
- package/patternfly-docs/content/token-layers-redhat-highcontrast-dark.json +46 -69
- package/patternfly-docs/content/token-layers-redhat-highcontrast.json +4911 -4641
- package/patternfly-docs/content/token-layers-redhat.json +6147 -5881
- package/patternfly-docs/content/tokensTable.css +178 -0
- package/patternfly-docs/content/tokensTable.js +1078 -180
- package/patternfly-docs/content/tokensToolbar.js +240 -11
- package/patternfly-docs/generated/foundations-and-styles/design-tokens/all-design-tokens/design-tokens.js +37 -3
- package/patternfly-docs/generated/index.js +1 -0
- package/plugins/export-patternfly-tokens/dist/ui.html +344 -334
- package/plugins/export-patternfly-tokens/src/ui.tsx +44 -34
- package/tokens/default/dark/base.dark.json +42 -42
- package/tokens/default/dark/charts.dark.json +32 -32
- package/tokens/default/dark/charts.highcontrast.dark.json +765 -0
- package/tokens/default/dark/palette.color.json +4 -4
- package/tokens/default/dark/semantic.dark.json +115 -115
- package/tokens/default/glass/base.dimension.json +24 -24
- package/tokens/default/glass/palette.color.json +4 -4
- package/tokens/default/glass/semantic.dimension.glass.json +137 -141
- package/tokens/default/glass/semantic.glass.json +114 -114
- package/tokens/default/glass-dark/base.dark.json +42 -42
- package/tokens/default/glass-dark/palette.color.json +4 -4
- package/tokens/default/glass-dark/semantic.glass.dark.json +115 -115
- package/tokens/default/highcontrast/base.dimension.json +24 -24
- package/tokens/default/highcontrast/palette.color.json +4 -4
- package/tokens/default/highcontrast/semantic.dimension.highcontrast.json +136 -140
- package/tokens/default/highcontrast/semantic.highcontrast.json +114 -114
- package/tokens/default/highcontrast-dark/base.dark.json +42 -42
- package/tokens/default/highcontrast-dark/palette.color.json +4 -4
- package/tokens/default/highcontrast-dark/semantic.highcontrast.dark.json +115 -115
- package/tokens/default/light/base.dimension.json +24 -24
- package/tokens/default/light/charts.highcontrast.json +765 -0
- package/tokens/default/light/charts.json +32 -32
- package/tokens/default/light/palette.color.json +4 -4
- package/tokens/default/light/semantic.dimension.json +137 -141
- package/tokens/default/light/semantic.json +114 -114
- package/tokens/default/light/semantic.motion.json +17 -17
- package/tokens/{redhat/dark/redhat.color.dark.json → felt/dark/felt.color.dark.json} +19 -19
- package/tokens/{redhat/light/redhat.color.json → felt/glass/felt.color.glass.json} +10 -10
- package/tokens/{redhat/highcontrast/redhat.dimension.highcontrast.json → felt/glass/felt.dimension.glass.json} +6 -6
- package/tokens/{redhat/glass-dark/redhat.color.glass.dark.json → felt/glass-dark/felt.color.glass.dark.json} +22 -17
- package/tokens/{redhat/highcontrast/redhat.color.highcontrast.json → felt/highcontrast/felt.color.highcontrast.json} +10 -10
- package/tokens/{redhat/light/redhat.dimension.json → felt/highcontrast/felt.dimension.highcontrast.json} +6 -6
- package/tokens/{redhat/highcontrast-dark/redhat.color.highcontrast.dark.json → felt/highcontrast-dark/felt.color.highcontrast.dark.json} +10 -10
- package/tokens/{redhat/glass/redhat.color.glass.json → felt/light/felt.color.json} +10 -10
- package/tokens/felt/light/felt.dimension.json +23 -0
- package/tokens/redhat/glass/redhat.dimension.glass.json +0 -2
- /package/{config.redhat-highcontrast.json → config.felt-highcontrast.json} +0 -0
- /package/{config.layers.redhat-highcontrast.json → config.layers.felt-highcontrast.json} +0 -0
- /package/{config.layers.redhat.json → config.layers.felt.json} +0 -0
|
@@ -1,17 +1,148 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
+
Button,
|
|
4
|
+
Divider,
|
|
3
5
|
MenuToggle,
|
|
4
6
|
SearchInput,
|
|
5
7
|
Select,
|
|
8
|
+
SelectGroup,
|
|
6
9
|
SelectList,
|
|
7
10
|
SelectOption,
|
|
8
11
|
Toolbar,
|
|
9
12
|
ToolbarItem,
|
|
10
13
|
ToolbarContent,
|
|
14
|
+
Tooltip,
|
|
11
15
|
capitalize
|
|
12
16
|
} from '@patternfly/react-core';
|
|
13
17
|
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
14
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Theme configuration constants
|
|
21
|
+
* Structure: [theme family, light/dark mode, contrast variant]
|
|
22
|
+
*/
|
|
23
|
+
const THEME_LABEL_PARTS = {
|
|
24
|
+
default: ['Default theme', 'Light', 'Default contrast'],
|
|
25
|
+
dark: ['Default theme', 'Dark', 'Default contrast'],
|
|
26
|
+
glass: ['Default theme', 'Light', 'Glass'],
|
|
27
|
+
'glass-dark': ['Default theme', 'Dark', 'Glass'],
|
|
28
|
+
highcontrast: ['Default theme', 'Light', 'High contrast'],
|
|
29
|
+
'highcontrast-dark': ['Default theme', 'Dark', 'High contrast'],
|
|
30
|
+
redhat: ['Unified theme', 'Light', 'Default contrast'],
|
|
31
|
+
'redhat-dark': ['Unified theme', 'Dark', 'Default contrast'],
|
|
32
|
+
'redhat-glass': ['Unified theme', 'Light', 'Glass'],
|
|
33
|
+
'redhat-glass-dark': ['Unified theme', 'Dark', 'Glass'],
|
|
34
|
+
'redhat-highcontrast': ['Unified theme', 'Light', 'High contrast'],
|
|
35
|
+
'redhat-highcontrast-dark': ['Unified theme', 'Dark', 'High contrast']
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** Full segment → acronym mapping */
|
|
39
|
+
const THEME_SEGMENT_ABBREV = {
|
|
40
|
+
'Default theme': 'DT',
|
|
41
|
+
'Unified theme': 'UT',
|
|
42
|
+
Light: 'Lt',
|
|
43
|
+
Dark: 'Dk',
|
|
44
|
+
'Default contrast': 'DC',
|
|
45
|
+
'High contrast': 'HC',
|
|
46
|
+
Glass: 'Gl'
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Pre-compute static values to avoid recalculating on every render
|
|
50
|
+
const THEME_LABEL_ROWS = Object.values(THEME_LABEL_PARTS);
|
|
51
|
+
const THEME_LABEL_COL_WIDTHS = (() => {
|
|
52
|
+
const rows = THEME_LABEL_ROWS;
|
|
53
|
+
return [
|
|
54
|
+
Math.max(...rows.map((r) => r[0].length)),
|
|
55
|
+
Math.max(...rows.map((r) => r[1].length)),
|
|
56
|
+
Math.max(...rows.map((r) => r[2].length))
|
|
57
|
+
];
|
|
58
|
+
})();
|
|
59
|
+
|
|
60
|
+
const toAbbrevParts = (fullParts) => fullParts.map((p) => THEME_SEGMENT_ABBREV[p] || p);
|
|
61
|
+
|
|
62
|
+
const THEME_ACRONYM_PARTS = Object.fromEntries(
|
|
63
|
+
Object.entries(THEME_LABEL_PARTS).map(([key, parts]) => [key, toAbbrevParts(parts)])
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const THEME_ACRONYM_ROWS = Object.values(THEME_ACRONYM_PARTS);
|
|
67
|
+
const THEME_ACRONYM_COL_WIDTHS = (() => {
|
|
68
|
+
const rows = THEME_ACRONYM_ROWS;
|
|
69
|
+
return [
|
|
70
|
+
Math.max(...rows.map((r) => r[0].length)),
|
|
71
|
+
Math.max(...rows.map((r) => r[1].length)),
|
|
72
|
+
Math.max(...rows.map((r) => r[2].length))
|
|
73
|
+
];
|
|
74
|
+
})();
|
|
75
|
+
|
|
76
|
+
const padThemeCol = (s, w) => s.padEnd(w, ' ');
|
|
77
|
+
|
|
78
|
+
const formatAlignedThemeParts = (parts) => {
|
|
79
|
+
const [w0, w1, w2] = THEME_LABEL_COL_WIDTHS;
|
|
80
|
+
return `${padThemeCol(parts[0], w0)} | ${padThemeCol(parts[1], w1)} | ${padThemeCol(parts[2], w2)}`;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const getThemeDisplayName = (themeName) => {
|
|
84
|
+
if (themeName === 'all') {
|
|
85
|
+
return 'All themes';
|
|
86
|
+
}
|
|
87
|
+
const parts = THEME_LABEL_PARTS[themeName];
|
|
88
|
+
if (parts) {
|
|
89
|
+
return formatAlignedThemeParts(parts);
|
|
90
|
+
}
|
|
91
|
+
return themeName.split('-').map((part) => capitalize(part)).join(' ');
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const ThemeLabelAbbrevContext = React.createContext(false);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Abbreviated theme row with single tooltip showing full theme name.
|
|
98
|
+
* Improves accessibility by avoiding multiple tab stops.
|
|
99
|
+
*/
|
|
100
|
+
const ThemeAbbrevSegments = ({ themeName }) => {
|
|
101
|
+
const abbrParts = THEME_ACRONYM_PARTS[themeName];
|
|
102
|
+
const fullParts = THEME_LABEL_PARTS[themeName];
|
|
103
|
+
const [w0, w1, w2] = THEME_ACRONYM_COL_WIDTHS;
|
|
104
|
+
const paddedCols = [
|
|
105
|
+
padThemeCol(abbrParts[0], w0),
|
|
106
|
+
padThemeCol(abbrParts[1], w1),
|
|
107
|
+
padThemeCol(abbrParts[2], w2)
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
const fullLabel = formatAlignedThemeParts(fullParts);
|
|
111
|
+
const abbreviatedText = `${paddedCols[0]} | ${paddedCols[1]} | ${paddedCols[2]}`;
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Tooltip content={fullLabel} position="top">
|
|
115
|
+
<Button variant="plain" className="ws-theme-display-label ws-theme-abbr-trigger" tabIndex={-1}>
|
|
116
|
+
{abbreviatedText}
|
|
117
|
+
</Button>
|
|
118
|
+
</Tooltip>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** Renders theme text; known themes use monospace + padded spaces so `|` columns line up */
|
|
123
|
+
export const ThemeDisplayLabel = ({ themeName, fullLabel = false }) => {
|
|
124
|
+
const contextAbbrev = React.useContext(ThemeLabelAbbrevContext);
|
|
125
|
+
const abbreviated = fullLabel ? false : contextAbbrev;
|
|
126
|
+
const parts = THEME_LABEL_PARTS[themeName];
|
|
127
|
+
|
|
128
|
+
if (themeName === 'all') {
|
|
129
|
+
return <span>All themes</span>;
|
|
130
|
+
}
|
|
131
|
+
if (parts) {
|
|
132
|
+
if (abbreviated) {
|
|
133
|
+
return <ThemeAbbrevSegments themeName={themeName} />;
|
|
134
|
+
}
|
|
135
|
+
return <span className="ws-theme-display-label">{formatAlignedThemeParts(parts)}</span>;
|
|
136
|
+
}
|
|
137
|
+
return <span>{themeName.split('-').map((p) => capitalize(p)).join(' ')}</span>;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
// Category configuration constants
|
|
142
|
+
const TOKEN_CATEGORY_GROUP_PRIMARY = new Set(['chart', 'semantic']);
|
|
143
|
+
// Only palette tokens are truly theme-invariant (base tokens CAN vary, e.g., high contrast)
|
|
144
|
+
const THEME_INVARIANT_CATEGORIES = new Set(['palette']);
|
|
145
|
+
|
|
15
146
|
const TokensToolbarSelect = ({ selectedCategory, setSelectedCategory, categories }) => {
|
|
16
147
|
const [isSelectOpen, setIsSelectOpen] = React.useState(false);
|
|
17
148
|
const handleSelect = (_e, category) => {
|
|
@@ -21,6 +152,10 @@ const TokensToolbarSelect = ({ selectedCategory, setSelectedCategory, categories
|
|
|
21
152
|
setIsSelectOpen(!isSelectOpen);
|
|
22
153
|
};
|
|
23
154
|
|
|
155
|
+
const primaryCategories = categories.filter((c) => TOKEN_CATEGORY_GROUP_PRIMARY.has(c));
|
|
156
|
+
const secondaryCategories = categories.filter((c) => !TOKEN_CATEGORY_GROUP_PRIMARY.has(c));
|
|
157
|
+
const showGroupDivider = primaryCategories.length > 0 && secondaryCategories.length > 0;
|
|
158
|
+
|
|
24
159
|
const SelectToggle = (toggleRef) => (
|
|
25
160
|
<MenuToggle
|
|
26
161
|
icon={<FilterIcon />}
|
|
@@ -32,6 +167,13 @@ const TokensToolbarSelect = ({ selectedCategory, setSelectedCategory, categories
|
|
|
32
167
|
</MenuToggle>
|
|
33
168
|
);
|
|
34
169
|
|
|
170
|
+
const renderCategoryOptions = (list) =>
|
|
171
|
+
list.map((category, idx) => (
|
|
172
|
+
<SelectOption key={category} value={category} isSelected={selectedCategory === category}>
|
|
173
|
+
{capitalize(category)} tokens
|
|
174
|
+
</SelectOption>
|
|
175
|
+
));
|
|
176
|
+
|
|
35
177
|
return (
|
|
36
178
|
<Select
|
|
37
179
|
aria-label="Select Input"
|
|
@@ -41,32 +183,107 @@ const TokensToolbarSelect = ({ selectedCategory, setSelectedCategory, categories
|
|
|
41
183
|
onOpenChange={(isOpen) => setIsSelectOpen(isOpen)}
|
|
42
184
|
onSelect={handleSelect}
|
|
43
185
|
>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
186
|
+
{primaryCategories.length > 0 && (
|
|
187
|
+
<SelectGroup>
|
|
188
|
+
<SelectList>{renderCategoryOptions(primaryCategories)}</SelectList>
|
|
189
|
+
</SelectGroup>
|
|
190
|
+
)}
|
|
191
|
+
{showGroupDivider && <Divider />}
|
|
192
|
+
{secondaryCategories.length > 0 && (
|
|
193
|
+
<SelectGroup>
|
|
194
|
+
<SelectList>{renderCategoryOptions(secondaryCategories)}</SelectList>
|
|
195
|
+
</SelectGroup>
|
|
196
|
+
)}
|
|
51
197
|
</Select>
|
|
52
198
|
);
|
|
53
199
|
};
|
|
54
200
|
|
|
55
|
-
|
|
201
|
+
const TokensThemeSelect = ({ selectedTheme, setSelectedTheme, themeOptions, selectedCategory }) => {
|
|
202
|
+
const [isSelectOpen, setIsSelectOpen] = React.useState(false);
|
|
203
|
+
const handleSelect = (_e, themeName) => {
|
|
204
|
+
if (!(selectedTheme === themeName)) {
|
|
205
|
+
setSelectedTheme(themeName);
|
|
206
|
+
}
|
|
207
|
+
setIsSelectOpen(!isSelectOpen);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// Theme selector is disabled for categories that don't have theme variants
|
|
211
|
+
const isDisabled = THEME_INVARIANT_CATEGORIES.has(selectedCategory);
|
|
212
|
+
|
|
213
|
+
const ariaSelectedTheme = getThemeDisplayName(selectedTheme)
|
|
214
|
+
.replace(/\|/g, ' ')
|
|
215
|
+
.replace(/\s+/g, ' ')
|
|
216
|
+
.trim();
|
|
217
|
+
|
|
218
|
+
const SelectToggle = (toggleRef) => (
|
|
219
|
+
<MenuToggle
|
|
220
|
+
aria-label={`${ariaSelectedTheme}, Filter by theme`}
|
|
221
|
+
ref={toggleRef}
|
|
222
|
+
onClick={() => !isDisabled && setIsSelectOpen(!isSelectOpen)}
|
|
223
|
+
isExpanded={isSelectOpen}
|
|
224
|
+
isDisabled={isDisabled}
|
|
225
|
+
>
|
|
226
|
+
<ThemeDisplayLabel themeName={selectedTheme} fullLabel />
|
|
227
|
+
</MenuToggle>
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
const themesAfterAll = themeOptions.slice(1);
|
|
231
|
+
const defaultThemeOptions = themesAfterAll.filter((name) => !name.startsWith('redhat'));
|
|
232
|
+
const unifiedThemeOptions = themesAfterAll.filter((name) => name.startsWith('redhat'));
|
|
233
|
+
const showUnifiedDivider = defaultThemeOptions.length > 0 && unifiedThemeOptions.length > 0;
|
|
234
|
+
|
|
235
|
+
const renderThemeOption = (themeName) => (
|
|
236
|
+
<SelectOption key={themeName} value={themeName} isSelected={selectedTheme === themeName}>
|
|
237
|
+
<ThemeDisplayLabel themeName={themeName} fullLabel />
|
|
238
|
+
</SelectOption>
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<Select
|
|
243
|
+
aria-label="Select theme"
|
|
244
|
+
toggle={SelectToggle}
|
|
245
|
+
isOpen={isSelectOpen}
|
|
246
|
+
onOpenChange={(isOpen) => setIsSelectOpen(isOpen)}
|
|
247
|
+
onSelect={handleSelect}
|
|
248
|
+
isDisabled={isDisabled}
|
|
249
|
+
>
|
|
250
|
+
<SelectGroup label={null}>
|
|
251
|
+
<SelectList>{renderThemeOption('all')}</SelectList>
|
|
252
|
+
</SelectGroup>
|
|
253
|
+
<Divider />
|
|
254
|
+
{defaultThemeOptions.length > 0 && (
|
|
255
|
+
<SelectGroup label={null}>
|
|
256
|
+
<SelectList>{defaultThemeOptions.map(renderThemeOption)}</SelectList>
|
|
257
|
+
</SelectGroup>
|
|
258
|
+
)}
|
|
259
|
+
{showUnifiedDivider && <Divider />}
|
|
260
|
+
{unifiedThemeOptions.length > 0 && (
|
|
261
|
+
<SelectGroup label={null}>
|
|
262
|
+
<SelectList>{unifiedThemeOptions.map(renderThemeOption)}</SelectList>
|
|
263
|
+
</SelectGroup>
|
|
264
|
+
)}
|
|
265
|
+
</Select>
|
|
266
|
+
);
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
const TokensToolbarComponent = ({
|
|
56
270
|
selectedCategory,
|
|
57
271
|
setSelectedCategory,
|
|
272
|
+
selectedTheme,
|
|
273
|
+
setSelectedTheme,
|
|
58
274
|
searchValue,
|
|
59
275
|
setSearchValue,
|
|
60
276
|
resultsCount,
|
|
61
|
-
categories
|
|
277
|
+
categories,
|
|
278
|
+
themeOptions
|
|
62
279
|
}) => {
|
|
63
280
|
return (
|
|
64
281
|
<Toolbar>
|
|
65
282
|
<ToolbarContent>
|
|
66
283
|
<ToolbarItem variant="search-filter">
|
|
67
284
|
<SearchInput
|
|
68
|
-
aria-label="Search
|
|
69
|
-
placeholder="Search
|
|
285
|
+
aria-label="Search for a token"
|
|
286
|
+
placeholder="Search for a token"
|
|
70
287
|
value={searchValue}
|
|
71
288
|
onChange={(_event, value) => setSearchValue(value)}
|
|
72
289
|
onClear={() => setSearchValue('')}
|
|
@@ -74,6 +291,15 @@ export const TokensToolbar = ({
|
|
|
74
291
|
/>
|
|
75
292
|
</ToolbarItem>
|
|
76
293
|
|
|
294
|
+
<ToolbarItem>
|
|
295
|
+
<TokensThemeSelect
|
|
296
|
+
selectedTheme={selectedTheme}
|
|
297
|
+
setSelectedTheme={setSelectedTheme}
|
|
298
|
+
themeOptions={themeOptions}
|
|
299
|
+
selectedCategory={selectedCategory}
|
|
300
|
+
/>
|
|
301
|
+
</ToolbarItem>
|
|
302
|
+
|
|
77
303
|
<ToolbarItem>
|
|
78
304
|
<TokensToolbarSelect
|
|
79
305
|
selectedCategory={selectedCategory}
|
|
@@ -85,3 +311,6 @@ export const TokensToolbar = ({
|
|
|
85
311
|
</Toolbar>
|
|
86
312
|
);
|
|
87
313
|
};
|
|
314
|
+
|
|
315
|
+
// Memoize the toolbar to prevent unnecessary re-renders that cause SearchInput to lose focus
|
|
316
|
+
export const TokensToolbar = React.memo(TokensToolbarComponent);
|
|
@@ -2,6 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
|
|
3
3
|
import * as defaultTokens from '../../../../content/./token-layers-default.json';
|
|
4
4
|
import * as darkTokens from '../../../../content/./token-layers-dark.json';
|
|
5
|
+
import * as glassTokens from '../../../../content/./token-layers-glass.json';
|
|
6
|
+
import * as glassDarkTokens from '../../../../content/./token-layers-glass-dark.json';
|
|
7
|
+
import * as highcontrastTokens from '../../../../content/./token-layers-highcontrast.json';
|
|
8
|
+
import * as highcontrastDarkTokens from '../../../../content/./token-layers-highcontrast-dark.json';
|
|
9
|
+
import * as redhatTokens from '../../../../content/./token-layers-redhat.json';
|
|
10
|
+
import * as redhatDarkTokens from '../../../../content/./token-layers-redhat-dark.json';
|
|
11
|
+
import * as redhatGlassTokens from '../../../../content/./token-layers-redhat-glass.json';
|
|
12
|
+
import * as redhatGlassDarkTokens from '../../../../content/./token-layers-redhat-glass-dark.json';
|
|
13
|
+
import * as redhatHighcontrastTokens from '../../../../content/./token-layers-redhat-highcontrast.json';
|
|
14
|
+
import * as redhatHighcontrastDarkTokens from '../../../../content/./token-layers-redhat-highcontrast-dark.json';
|
|
5
15
|
import { TokensTable } from '../../../../content/./tokensTable.js';
|
|
6
16
|
const pageData = {
|
|
7
17
|
"id": "All design tokens",
|
|
@@ -16,21 +26,45 @@ const pageData = {
|
|
|
16
26
|
"tabName": null,
|
|
17
27
|
"slug": "/foundations-and-styles/design-tokens/all-design-tokens/design-tokens",
|
|
18
28
|
"sourceLink": "https://github.com/patternfly/patternfly-org/blob/main/packages/module/patternfly-docs/content/all-patternfly-tokens.md",
|
|
19
|
-
"relPath": "packages/module/patternfly-docs/content/all-patternfly-tokens.md"
|
|
29
|
+
"relPath": "packages/module/patternfly-docs/content/all-patternfly-tokens.md",
|
|
30
|
+
"sortValue": 5
|
|
20
31
|
};
|
|
21
32
|
pageData.liveContext = {
|
|
22
33
|
defaultTokens,
|
|
23
34
|
darkTokens,
|
|
35
|
+
glassTokens,
|
|
36
|
+
glassDarkTokens,
|
|
37
|
+
highcontrastTokens,
|
|
38
|
+
highcontrastDarkTokens,
|
|
39
|
+
redhatTokens,
|
|
40
|
+
redhatDarkTokens,
|
|
41
|
+
redhatGlassTokens,
|
|
42
|
+
redhatGlassDarkTokens,
|
|
43
|
+
redhatHighcontrastTokens,
|
|
44
|
+
redhatHighcontrastDarkTokens,
|
|
24
45
|
TokensTable
|
|
25
46
|
};
|
|
26
|
-
pageData.relativeImports = "import * as defaultTokens from 'content/./token-layers-default.json';,import * as darkTokens from 'content/./token-layers-dark.json';,import { TokensTable } from 'content/./tokensTable.js';"
|
|
47
|
+
pageData.relativeImports = "import * as defaultTokens from 'content/./token-layers-default.json';,import * as darkTokens from 'content/./token-layers-dark.json';,import * as glassTokens from 'content/./token-layers-glass.json';,import * as glassDarkTokens from 'content/./token-layers-glass-dark.json';,import * as highcontrastTokens from 'content/./token-layers-highcontrast.json';,import * as highcontrastDarkTokens from 'content/./token-layers-highcontrast-dark.json';,import * as redhatTokens from 'content/./token-layers-redhat.json';,import * as redhatDarkTokens from 'content/./token-layers-redhat-dark.json';,import * as redhatGlassTokens from 'content/./token-layers-redhat-glass.json';,import * as redhatGlassDarkTokens from 'content/./token-layers-redhat-glass-dark.json';,import * as redhatHighcontrastTokens from 'content/./token-layers-redhat-highcontrast.json';,import * as redhatHighcontrastDarkTokens from 'content/./token-layers-redhat-highcontrast-dark.json';,import { TokensTable } from 'content/./tokensTable.js';"
|
|
27
48
|
pageData.examples = {
|
|
28
49
|
|
|
29
50
|
};
|
|
30
51
|
|
|
31
52
|
const Component = () => (
|
|
32
53
|
<React.Fragment>
|
|
33
|
-
<TokensTable tokenJson={{
|
|
54
|
+
<TokensTable tokenJson={{
|
|
55
|
+
default: defaultTokens,
|
|
56
|
+
dark: darkTokens,
|
|
57
|
+
glass: glassTokens,
|
|
58
|
+
'glass-dark': glassDarkTokens,
|
|
59
|
+
highcontrast: highcontrastTokens,
|
|
60
|
+
'highcontrast-dark': highcontrastDarkTokens,
|
|
61
|
+
redhat: redhatTokens,
|
|
62
|
+
'redhat-dark': redhatDarkTokens,
|
|
63
|
+
'redhat-glass': redhatGlassTokens,
|
|
64
|
+
'redhat-glass-dark': redhatGlassDarkTokens,
|
|
65
|
+
'redhat-highcontrast': redhatHighcontrastTokens,
|
|
66
|
+
'redhat-highcontrast-dark': redhatHighcontrastDarkTokens
|
|
67
|
+
}}/>
|
|
34
68
|
</React.Fragment>
|
|
35
69
|
);
|
|
36
70
|
Component.displayName = 'FoundationsAndStylesDesignTokensAllDesignTokensDesignTokensDocs';
|
|
@@ -7,6 +7,7 @@ module.exports = {
|
|
|
7
7
|
subsection: "design-tokens",
|
|
8
8
|
source: "design-tokens",
|
|
9
9
|
tabName: null,
|
|
10
|
+
sortValue: 5,
|
|
10
11
|
Component: () => import(/* webpackChunkName: "foundations-and-styles/design-tokens/all-design-tokens/design-tokens/index" */ './foundations-and-styles/design-tokens/all-design-tokens/design-tokens')
|
|
11
12
|
}
|
|
12
13
|
};
|