@patternfly/design-tokens 1.12.0 → 1.13.1
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-charts-dark.scss +1 -1
- package/build/css/tokens-charts.scss +1 -1
- package/build/css/tokens-dark.scss +17 -14
- package/build/css/tokens-default.scss +44 -16
- package/build/css/tokens-palette.scss +1 -1
- package/build.js +57 -3
- package/cli.js +1 -1
- package/config.layers.dark.json +20 -0
- package/config.layers.json +19 -0
- package/package.json +8 -9
- package/patternfly-docs/content/all-patternfly-tokens.md +3 -2
- package/patternfly-docs/content/token-layers-dark.json +61612 -0
- package/patternfly-docs/content/token-layers-default.json +57379 -0
- package/patternfly-docs/content/tokensTable.css +15 -0
- package/patternfly-docs/content/tokensTable.js +216 -113
- package/patternfly-docs/content/tokensToolbar.js +77 -0
- package/patternfly-docs/generated/tokens/all-patternfly-tokens/tokens.js +7 -2
- package/tokens/dark/base.dark.json +46 -42
- package/tokens/dark/semantic.dark.json +19 -9
- package/tokens/default/base.dimension.json +39 -17
- package/tokens/default/base.json +4 -0
- package/tokens/default/semantic.dimension.json +205 -91
- package/tokens/default/semantic.json +10 -0
- package/build-js-for-docs.js +0 -41
- package/patternfly-docs/scssAsJson.json +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.ws-token-swatch {
|
|
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 var(--pf-t--global--background--color--inverse--default);
|
|
7
|
+
box-shadow: var(--pf-t--global--box-shadow--sm);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (min-width: 1200px) {
|
|
11
|
+
.tokens-table-outer-wrapper {
|
|
12
|
+
width: calc(92vw - var(--pf-v6-c-page__sidebar--Width));
|
|
13
|
+
max-width: calc(92vw - var(--pf-v6-c-page__sidebar--Width));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {
|
|
3
|
-
SearchInput,
|
|
4
|
-
Toolbar,
|
|
5
|
-
ToolbarItem,
|
|
6
|
-
ToolbarContent,
|
|
7
|
-
} from "@patternfly/react-core";
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Flex, FlexItem, Grid, GridItem, Title, capitalize } from '@patternfly/react-core';
|
|
8
3
|
import {
|
|
9
4
|
Table,
|
|
10
5
|
Thead,
|
|
@@ -14,130 +9,238 @@ import {
|
|
|
14
9
|
Td,
|
|
15
10
|
ExpandableRowContent,
|
|
16
11
|
OuterScrollContainer,
|
|
17
|
-
InnerScrollContainer
|
|
18
|
-
} from
|
|
12
|
+
InnerScrollContainer
|
|
13
|
+
} from '@patternfly/react-table';
|
|
14
|
+
import { TokensToolbar } from './tokensToolbar';
|
|
15
|
+
import './tokensTable.css';
|
|
19
16
|
|
|
20
17
|
// eslint-disable-next-line camelcase
|
|
21
|
-
import global_spacer_md from
|
|
22
|
-
import LevelUpAltIcon from
|
|
23
|
-
|
|
24
|
-
import * as scssAsJson from "../scssAsJson";
|
|
18
|
+
import global_spacer_md from '@patternfly/react-tokens/dist/esm/global_spacer_md';
|
|
19
|
+
import LevelUpAltIcon from '@patternfly/react-icons/dist/esm/icons/level-up-alt-icon';
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const isTokenExpanded = (tokenName) => expandedTokens.includes(tokenName);
|
|
36
|
-
|
|
37
|
-
const showTokenChain = (tokenName) => {
|
|
38
|
-
let tokenChain = [];
|
|
39
|
-
let tokenValue = scssAsJson[tokenName];
|
|
21
|
+
// Used to combine data grouped by theme under each token name
|
|
22
|
+
const deepMerge = (target, source) => {
|
|
23
|
+
for (const key in source) {
|
|
24
|
+
if (source[key] instanceof Object && key in target) {
|
|
25
|
+
Object.assign(source[key], deepMerge(target[key], source[key]));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return Object.assign(target || {}, source);
|
|
29
|
+
};
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
const getTokenChain = (themeTokenData) => {
|
|
32
|
+
let tokenChain = [];
|
|
33
|
+
let referenceToken = themeTokenData?.references?.[0];
|
|
34
|
+
while (referenceToken && referenceToken !== undefined) {
|
|
35
|
+
tokenChain = [...tokenChain, referenceToken.name];
|
|
36
|
+
if (referenceToken?.references?.[0]) {
|
|
37
|
+
referenceToken = referenceToken?.references?.[0];
|
|
38
|
+
} else {
|
|
39
|
+
tokenChain.push(referenceToken.value);
|
|
40
|
+
break;
|
|
44
41
|
}
|
|
42
|
+
}
|
|
43
|
+
return tokenChain;
|
|
44
|
+
};
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const showTokenChain = (themeTokenData) => {
|
|
47
|
+
const tokenChain = getTokenChain(themeTokenData);
|
|
48
|
+
return (
|
|
49
|
+
<div>
|
|
50
|
+
{tokenChain.map((nextValue, index) => (
|
|
48
51
|
<div
|
|
49
|
-
|
|
52
|
+
key={`${index}`}
|
|
50
53
|
style={{
|
|
51
|
-
padding: `4px 0 4px calc(${global_spacer_md.value} * ${
|
|
52
|
-
}}
|
|
54
|
+
padding: `4px 0 4px calc(${global_spacer_md.value} * ${index})`
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
53
57
|
<LevelUpAltIcon style={{ transform: 'rotate(90deg)' }} />
|
|
54
|
-
<span style={{
|
|
55
|
-
{tokenName}
|
|
56
|
-
</span>
|
|
58
|
+
<span style={{ paddingInlineStart: global_spacer_md.value }}>{nextValue}</span>
|
|
57
59
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const isSearchMatch = (searchValue, tokenName, tokenData) => {
|
|
66
|
+
// match all tokens if no search term
|
|
67
|
+
if (searchValue === '') {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
// match search term to token name, value, and description
|
|
71
|
+
searchValue = searchValue.toLowerCase();
|
|
72
|
+
return (
|
|
73
|
+
tokenName.toLowerCase().includes(searchValue) ||
|
|
74
|
+
Object.entries(tokenData).some(
|
|
75
|
+
([_themeName, themeData]) =>
|
|
76
|
+
themeData?.value?.toString().toLowerCase().includes(searchValue) ||
|
|
77
|
+
themeData?.description?.toLowerCase().includes(searchValue)
|
|
72
78
|
)
|
|
73
|
-
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const TokensTable = ({ tokenJson, formatThemeText = capitalize }) => {
|
|
83
|
+
// parse tokens from json, convert from modules, merge into single allTokens obj
|
|
84
|
+
const themesArr = Object.keys(tokenJson);
|
|
85
|
+
const themesObj = themesArr.reduce((acc, cur) => {
|
|
86
|
+
acc[cur] = JSON.parse(JSON.stringify(tokenJson[cur]));
|
|
87
|
+
return acc;
|
|
88
|
+
}, {});
|
|
89
|
+
const allTokens = deepMerge(...Object.values(themesObj));
|
|
90
|
+
// remove default property which is duplicate of other fields
|
|
91
|
+
delete allTokens.default;
|
|
92
|
+
|
|
93
|
+
// state variables
|
|
94
|
+
const [searchValue, setSearchValue] = React.useState('');
|
|
95
|
+
const [expandedTokens, setExpandedTokens] = React.useState([]);
|
|
96
|
+
const [selectedCategories, setSelectedCategories] = React.useState([]);
|
|
97
|
+
|
|
98
|
+
// helper funcs
|
|
99
|
+
const isTokenExpanded = (tokenName) => expandedTokens.includes(tokenName);
|
|
100
|
+
const isSelectedCategory = (categoryName) =>
|
|
101
|
+
selectedCategories.length === 0 || selectedCategories.includes(categoryName);
|
|
102
|
+
const setExpanded = (tokenName, isExpanding = true) =>
|
|
103
|
+
setExpandedTokens((prevExpanded) => {
|
|
104
|
+
const otherExpandedTokens = prevExpanded.filter((n) => n !== tokenName);
|
|
105
|
+
return isExpanding ? [...otherExpandedTokens, tokenName] : otherExpandedTokens;
|
|
106
|
+
});
|
|
74
107
|
|
|
75
108
|
return (
|
|
76
109
|
<React.Fragment>
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
onChange={(_event, value) => setSearchValue(value)}
|
|
85
|
-
onClear={() => setSearchValue("")}
|
|
86
|
-
/>
|
|
87
|
-
</ToolbarItem>
|
|
88
|
-
</ToolbarContent>
|
|
89
|
-
</Toolbar>
|
|
90
|
-
<OuterScrollContainer>
|
|
110
|
+
<TokensToolbar
|
|
111
|
+
searchValue={searchValue}
|
|
112
|
+
setSearchValue={setSearchValue}
|
|
113
|
+
selectedCategories={selectedCategories}
|
|
114
|
+
setSelectedCategories={setSelectedCategories}
|
|
115
|
+
/>
|
|
116
|
+
<OuterScrollContainer className="tokens-table-outer-wrapper">
|
|
91
117
|
<InnerScrollContainer>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return undefined
|
|
118
|
+
{
|
|
119
|
+
// Create new Table for each tokens layer [base, chart, palette, semantic]
|
|
120
|
+
Object.entries(allTokens).map(([layerName, layerDataObj], _rowIndex) => {
|
|
121
|
+
// save if semantic layer - used for custom styling due to description field
|
|
122
|
+
const isSemanticLayer = layerName === 'semantic';
|
|
123
|
+
|
|
124
|
+
// Create array of all tokens/nested tokens in layer, filtered by selectedCategories
|
|
125
|
+
let layerTokens = [];
|
|
126
|
+
if (!['base', 'semantic'].includes(layerName) && isSelectedCategory(layerName)) {
|
|
127
|
+
layerTokens = Object.entries(layerDataObj);
|
|
103
128
|
} else {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<Td
|
|
109
|
-
expand={
|
|
110
|
-
!isResolved
|
|
111
|
-
? {
|
|
112
|
-
rowIndex,
|
|
113
|
-
isExpanded: isTokenExpanded(tokenName),
|
|
114
|
-
onToggle: () =>
|
|
115
|
-
setExpanded(tokenName, !isTokenExpanded(tokenName)),
|
|
116
|
-
expandId: `${tokenName}-expandable-toggle`,
|
|
117
|
-
}
|
|
118
|
-
: undefined
|
|
119
|
-
}
|
|
120
|
-
/>
|
|
121
|
-
<Td>{tokenName}</Td>
|
|
122
|
-
<Td>{scssAsJson[scssAsJson[tokenName]] === undefined && scssAsJson[tokenName]}</Td>
|
|
123
|
-
</Tr>
|
|
124
|
-
{!isResolved && (
|
|
125
|
-
<Tr isExpanded={isTokenExpanded(tokenName)}>
|
|
126
|
-
<Td />
|
|
127
|
-
<Td noPadding dataLabel="Details" colSpan={2}>
|
|
128
|
-
<ExpandableRowContent>
|
|
129
|
-
{showTokenChain(scssAsJson[tokenName])}
|
|
130
|
-
</ExpandableRowContent>
|
|
131
|
-
</Td>
|
|
132
|
-
</Tr>
|
|
133
|
-
)}
|
|
134
|
-
</Tbody>
|
|
135
|
-
)
|
|
129
|
+
// base/semantic combine subcategory tokens into flattened arr
|
|
130
|
+
for (var subLayer in layerDataObj) {
|
|
131
|
+
isSelectedCategory(subLayer) && layerTokens.push(...Object.entries(layerDataObj[subLayer]));
|
|
132
|
+
}
|
|
136
133
|
}
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
// finally filter all tokens based on search term
|
|
135
|
+
const filteredTokens = layerTokens.filter(([tokenName, tokenData]) =>
|
|
136
|
+
isSearchMatch(searchValue, tokenName, tokenData)
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
<Title headingLevel="h2" id={`${layerName}-table`} className="pf-v6-u-mt-xl">
|
|
142
|
+
{formatThemeText(layerName)} tokens
|
|
143
|
+
</Title>
|
|
144
|
+
<Table variant="compact" style={{ marginBlockEnd: `var(--pf-t--global--spacer--xl)` }}>
|
|
145
|
+
<Thead>
|
|
146
|
+
<Tr>
|
|
147
|
+
{/* Only semantic tokens have description, adjust columns accordingly */}
|
|
148
|
+
<Th width={5}></Th>
|
|
149
|
+
<Th width={isSemanticLayer ? 60 : 80}>Name</Th>
|
|
150
|
+
<Th width={isSemanticLayer ? 10 : 15}>Value</Th>
|
|
151
|
+
{isSemanticLayer && <Th width={25}>Description</Th>}
|
|
152
|
+
</Tr>
|
|
153
|
+
</Thead>
|
|
154
|
+
|
|
155
|
+
{/* Loop through row for each token in current layer */}
|
|
156
|
+
{filteredTokens.map(([tokenName, tokenData], rowIndex) => {
|
|
157
|
+
const tokenThemesArr = Object.entries(tokenData);
|
|
158
|
+
const hasReferences = tokenThemesArr.some(([_themeName, themeToken]) =>
|
|
159
|
+
themeToken.hasOwnProperty('references')
|
|
160
|
+
);
|
|
161
|
+
const tokenDescription = tokenThemesArr[0][1].description;
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<Tbody key={`row-${tokenName}`} isExpanded={isTokenExpanded(tokenName)}>
|
|
165
|
+
<Tr>
|
|
166
|
+
{/* Expandable row icon */}
|
|
167
|
+
<Td
|
|
168
|
+
expand={
|
|
169
|
+
hasReferences
|
|
170
|
+
? {
|
|
171
|
+
rowIndex,
|
|
172
|
+
isExpanded: isTokenExpanded(tokenName),
|
|
173
|
+
onToggle: () => setExpanded(tokenName, !isTokenExpanded(tokenName)),
|
|
174
|
+
expandId: `${tokenName}-expandable-toggle`
|
|
175
|
+
}
|
|
176
|
+
: undefined
|
|
177
|
+
}
|
|
178
|
+
/>
|
|
179
|
+
<Td>
|
|
180
|
+
<code>{tokenName}</code>
|
|
181
|
+
</Td>
|
|
182
|
+
{/* Token values for each theme */}
|
|
183
|
+
<Td>
|
|
184
|
+
{tokenThemesArr.map(([themeName, themeToken]) => {
|
|
185
|
+
const isColor = /^(#|rgb)/.test(themeToken.value);
|
|
186
|
+
return (
|
|
187
|
+
<Flex
|
|
188
|
+
justifyContent={{ default: 'justify-content-space-between' }}
|
|
189
|
+
flexWrap={{ default: 'nowrap' }}
|
|
190
|
+
key={`${themeName}-${tokenName}`}
|
|
191
|
+
>
|
|
192
|
+
<FlexItem>{formatThemeText(themeName)}:</FlexItem>
|
|
193
|
+
{isColor ? (
|
|
194
|
+
<FlexItem
|
|
195
|
+
key={`${themeName}_${tokenName}_swatch`}
|
|
196
|
+
className="pf-v6-l-flex pf-m-column pf-m-align-self-center"
|
|
197
|
+
>
|
|
198
|
+
<span
|
|
199
|
+
className="ws-token-swatch"
|
|
200
|
+
style={{ backgroundColor: themeToken.value }}
|
|
201
|
+
/>
|
|
202
|
+
</FlexItem>
|
|
203
|
+
) : (
|
|
204
|
+
<div className="pf-v6-l-flex pf-m-column pf-m-align-self-center">
|
|
205
|
+
{themeToken.value}
|
|
206
|
+
</div>
|
|
207
|
+
)}
|
|
208
|
+
</Flex>
|
|
209
|
+
);
|
|
210
|
+
})}
|
|
211
|
+
</Td>
|
|
212
|
+
{/* Description - only for semantic tokens */}
|
|
213
|
+
{isSemanticLayer && <Td>{tokenDescription}</Td>}
|
|
214
|
+
</Tr>
|
|
215
|
+
|
|
216
|
+
{/* Expandable token chain */}
|
|
217
|
+
{hasReferences && isTokenExpanded(tokenName) && (
|
|
218
|
+
<Tr isExpanded>
|
|
219
|
+
<Td />
|
|
220
|
+
<Td colSpan={3}>
|
|
221
|
+
<ExpandableRowContent>
|
|
222
|
+
<Grid hasGutter>
|
|
223
|
+
{tokenThemesArr.map(([themeName, themeToken]) => (
|
|
224
|
+
<>
|
|
225
|
+
<GridItem span={2}>{formatThemeText(themeName)}:</GridItem>
|
|
226
|
+
<GridItem span={10}>{showTokenChain(themeToken)}</GridItem>
|
|
227
|
+
</>
|
|
228
|
+
))}
|
|
229
|
+
</Grid>
|
|
230
|
+
</ExpandableRowContent>
|
|
231
|
+
</Td>
|
|
232
|
+
</Tr>
|
|
233
|
+
)}
|
|
234
|
+
</Tbody>
|
|
235
|
+
);
|
|
236
|
+
})}
|
|
237
|
+
</Table>
|
|
238
|
+
</>
|
|
239
|
+
);
|
|
240
|
+
})
|
|
241
|
+
}
|
|
139
242
|
</InnerScrollContainer>
|
|
140
243
|
</OuterScrollContainer>
|
|
141
244
|
</React.Fragment>
|
|
142
|
-
)
|
|
245
|
+
);
|
|
143
246
|
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
MenuToggle,
|
|
4
|
+
SearchInput,
|
|
5
|
+
Select,
|
|
6
|
+
SelectList,
|
|
7
|
+
SelectOption,
|
|
8
|
+
Toolbar,
|
|
9
|
+
ToolbarItem,
|
|
10
|
+
ToolbarContent
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
13
|
+
|
|
14
|
+
export const TokensToolbar = ({ selectedCategories, setSelectedCategories, searchValue, setSearchValue }) => {
|
|
15
|
+
const [isSelectOpen, setIsSelectOpen] = React.useState(false);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Toolbar id="filter-toolbar">
|
|
19
|
+
<ToolbarContent>
|
|
20
|
+
<ToolbarItem variant="search-filter">
|
|
21
|
+
<SearchInput
|
|
22
|
+
aria-label="Search all tokens"
|
|
23
|
+
placeholder="Search all tokens"
|
|
24
|
+
value={searchValue}
|
|
25
|
+
onChange={(_event, value) => setSearchValue(value)}
|
|
26
|
+
onClear={() => setSearchValue('')}
|
|
27
|
+
/>
|
|
28
|
+
</ToolbarItem>
|
|
29
|
+
<ToolbarItem>
|
|
30
|
+
<Select
|
|
31
|
+
id="select-tokens-category"
|
|
32
|
+
aria-label="Select Input"
|
|
33
|
+
role="menu"
|
|
34
|
+
toggle={(toggleRef) => (
|
|
35
|
+
<MenuToggle
|
|
36
|
+
icon={<FilterIcon />}
|
|
37
|
+
ref={toggleRef}
|
|
38
|
+
onClick={() => setIsSelectOpen(!isSelectOpen)}
|
|
39
|
+
isExpanded={isSelectOpen}
|
|
40
|
+
>
|
|
41
|
+
Category
|
|
42
|
+
</MenuToggle>
|
|
43
|
+
)}
|
|
44
|
+
isOpen={isSelectOpen}
|
|
45
|
+
onOpenChange={(isOpen) => setIsSelectOpen(isOpen)}
|
|
46
|
+
onSelect={(_e, category) => {
|
|
47
|
+
if (selectedCategories.includes(category)) {
|
|
48
|
+
setSelectedCategories(selectedCategories.filter((cat) => cat !== category));
|
|
49
|
+
} else {
|
|
50
|
+
setSelectedCategories([...selectedCategories, category]);
|
|
51
|
+
}
|
|
52
|
+
setIsSelectOpen(!isSelectOpen);
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<SelectList>
|
|
56
|
+
<SelectOption hasCheckbox key={0} value="colors" isSelected={selectedCategories.includes('colors')}>
|
|
57
|
+
Colors
|
|
58
|
+
</SelectOption>
|
|
59
|
+
<SelectOption hasCheckbox key={1} value="dimension" isSelected={selectedCategories.includes('dimension')}>
|
|
60
|
+
Dimension
|
|
61
|
+
</SelectOption>
|
|
62
|
+
<SelectOption hasCheckbox key={2} value="motion" isSelected={selectedCategories.includes('motion')}>
|
|
63
|
+
Motion
|
|
64
|
+
</SelectOption>
|
|
65
|
+
<SelectOption hasCheckbox key={3} value="palette" isSelected={selectedCategories.includes('palette')}>
|
|
66
|
+
Palette
|
|
67
|
+
</SelectOption>
|
|
68
|
+
<SelectOption hasCheckbox key={4} value="chart" isSelected={selectedCategories.includes('chart')}>
|
|
69
|
+
Chart
|
|
70
|
+
</SelectOption>
|
|
71
|
+
</SelectList>
|
|
72
|
+
</Select>
|
|
73
|
+
</ToolbarItem>
|
|
74
|
+
</ToolbarContent>
|
|
75
|
+
</Toolbar>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
|
|
3
|
+
import * as defaultTokens from '../../../content/./token-layers-default.json';
|
|
4
|
+
import * as darkTokens from '../../../content/./token-layers-dark.json';
|
|
3
5
|
import { TokensTable } from '../../../content/./tokensTable.js';
|
|
4
6
|
const pageData = {
|
|
5
7
|
"id": "All PatternFly tokens",
|
|
6
8
|
"section": "tokens",
|
|
7
9
|
"subsection": "",
|
|
8
10
|
"deprecated": false,
|
|
11
|
+
"template": false,
|
|
9
12
|
"beta": false,
|
|
10
13
|
"demo": false,
|
|
11
14
|
"newImplementationLink": false,
|
|
@@ -16,16 +19,18 @@ const pageData = {
|
|
|
16
19
|
"relPath": "packages/module/patternfly-docs/content/all-patternfly-tokens.md"
|
|
17
20
|
};
|
|
18
21
|
pageData.liveContext = {
|
|
22
|
+
defaultTokens,
|
|
23
|
+
darkTokens,
|
|
19
24
|
TokensTable
|
|
20
25
|
};
|
|
21
|
-
pageData.relativeImports = "import { TokensTable } from 'content/./tokensTable.js';"
|
|
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';"
|
|
22
27
|
pageData.examples = {
|
|
23
28
|
|
|
24
29
|
};
|
|
25
30
|
|
|
26
31
|
const Component = () => (
|
|
27
32
|
<React.Fragment>
|
|
28
|
-
<TokensTable/>
|
|
33
|
+
<TokensTable tokenJson={{default: defaultTokens, dark: darkTokens}}/>
|
|
29
34
|
</React.Fragment>
|
|
30
35
|
);
|
|
31
36
|
Component.displayName = 'TokensAllPatternflyTokensTokensDocs';
|
|
@@ -79,44 +79,6 @@
|
|
|
79
79
|
"value": "{color.yellow.20}"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
-
"severity": {
|
|
83
|
-
"undefined": {
|
|
84
|
-
"100": {
|
|
85
|
-
"type": "color",
|
|
86
|
-
"value": "{color.gray.40}"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"none": {
|
|
90
|
-
"100": {
|
|
91
|
-
"type": "color",
|
|
92
|
-
"value": "{color.blue.30}"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"minor": {
|
|
96
|
-
"100": {
|
|
97
|
-
"type": "color",
|
|
98
|
-
"value": "{color.gray.30}"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"moderate": {
|
|
102
|
-
"100": {
|
|
103
|
-
"type": "color",
|
|
104
|
-
"value": "{color.yellow.30}"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"important": {
|
|
108
|
-
"100": {
|
|
109
|
-
"type": "color",
|
|
110
|
-
"value": "{color.orange.40}"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"critical": {
|
|
114
|
-
"100": {
|
|
115
|
-
"type": "color",
|
|
116
|
-
"value": "{color.red-orange.50}"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
82
|
"status": {
|
|
121
83
|
"success": {
|
|
122
84
|
"100": {
|
|
@@ -177,6 +139,44 @@
|
|
|
177
139
|
}
|
|
178
140
|
}
|
|
179
141
|
},
|
|
142
|
+
"severity": {
|
|
143
|
+
"undefined": {
|
|
144
|
+
"100": {
|
|
145
|
+
"type": "color",
|
|
146
|
+
"value": "{color.gray.40}"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"none": {
|
|
150
|
+
"100": {
|
|
151
|
+
"type": "color",
|
|
152
|
+
"value": "{color.blue.30}"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"minor": {
|
|
156
|
+
"100": {
|
|
157
|
+
"type": "color",
|
|
158
|
+
"value": "{color.gray.30}"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"moderate": {
|
|
162
|
+
"100": {
|
|
163
|
+
"type": "color",
|
|
164
|
+
"value": "{color.yellow.30}"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"important": {
|
|
168
|
+
"100": {
|
|
169
|
+
"type": "color",
|
|
170
|
+
"value": "{color.orange.40}"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"critical": {
|
|
174
|
+
"100": {
|
|
175
|
+
"type": "color",
|
|
176
|
+
"value": "{color.red-orange.50}"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
180
|
"nonstatus": {
|
|
181
181
|
"red": {
|
|
182
182
|
"100": {
|
|
@@ -293,21 +293,25 @@
|
|
|
293
293
|
"gray": {
|
|
294
294
|
"100": {
|
|
295
295
|
"type": "color",
|
|
296
|
-
"value": "{color.gray.
|
|
296
|
+
"value": "{color.gray.60}"
|
|
297
297
|
},
|
|
298
298
|
"200": {
|
|
299
299
|
"type": "color",
|
|
300
|
-
"value": "{color.gray.
|
|
300
|
+
"value": "{color.gray.50}"
|
|
301
301
|
},
|
|
302
302
|
"300": {
|
|
303
303
|
"type": "color",
|
|
304
|
-
"value": "{color.gray.
|
|
304
|
+
"value": "{color.gray.40}"
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
},
|
|
309
309
|
"border": {
|
|
310
310
|
"color": {
|
|
311
|
+
"50": {
|
|
312
|
+
"type": "color",
|
|
313
|
+
"value": "{color.gray.60}"
|
|
314
|
+
},
|
|
311
315
|
"100": {
|
|
312
316
|
"type": "color",
|
|
313
317
|
"value": "{color.gray.50}"
|
|
@@ -322,7 +326,7 @@
|
|
|
322
326
|
"color": {
|
|
323
327
|
"100": {
|
|
324
328
|
"type": "color",
|
|
325
|
-
"value": "{color.
|
|
329
|
+
"value": "{color.white}"
|
|
326
330
|
},
|
|
327
331
|
"200": {
|
|
328
332
|
"type": "color",
|