@zendeskgarden/react-typography 8.57.1 → 8.59.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/dist/index.cjs.js +265 -420
- package/dist/index.esm.js +265 -420
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -17,99 +17,27 @@ function _extends() {
|
|
|
17
17
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
18
18
|
for (var i = 1; i < arguments.length; i++) {
|
|
19
19
|
var source = arguments[i];
|
|
20
|
-
|
|
21
20
|
for (var key in source) {
|
|
22
21
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
22
|
target[key] = source[key];
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
return target;
|
|
29
27
|
};
|
|
30
28
|
return _extends.apply(this, arguments);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
40
|
-
key = sourceKeys[i];
|
|
41
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
42
|
-
target[key] = source[key];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return target;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _objectWithoutProperties(source, excluded) {
|
|
49
|
-
if (source == null) return {};
|
|
50
|
-
|
|
51
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
52
|
-
|
|
53
|
-
var key, i;
|
|
54
|
-
|
|
55
|
-
if (Object.getOwnPropertySymbols) {
|
|
56
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
57
|
-
|
|
58
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
59
|
-
key = sourceSymbolKeys[i];
|
|
60
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
-
target[key] = source[key];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return target;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _toConsumableArray(arr) {
|
|
70
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _arrayWithoutHoles(arr) {
|
|
74
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _iterableToArray(iter) {
|
|
78
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
82
|
-
if (!o) return;
|
|
83
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
84
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
85
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
86
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
87
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function _arrayLikeToArray(arr, len) {
|
|
91
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
92
|
-
|
|
93
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
31
|
+
const HUE = ['grey', 'red', 'green', 'yellow'];
|
|
32
|
+
const SIZE = ['small', 'medium', 'large'];
|
|
33
|
+
const INHERIT_SIZE = ['inherit', ...SIZE];
|
|
34
|
+
const TYPE_ORDERED_LIST = ['decimal', 'decimal-leading-zero', 'lower-alpha', 'lower-roman', 'upper-alpha', 'upper-roman'];
|
|
35
|
+
const TYPE_UNORDERED_LIST = ['circle', 'disc', 'square'];
|
|
36
|
+
const LANGUAGES = ['markup', 'bash', 'clike', 'c', 'cpp', 'css', 'javascript', 'jsx', 'coffeescript', 'actionscript', 'css-extr', 'diff', 'git', 'go', 'graphql', 'handlebars', 'json', 'less', 'makefile', 'markdown', 'objectivec', 'ocaml', 'python', 'reason', 'sass', 'scss', 'sql', 'stylus', 'tsx', 'typescript', 'wasm', 'yaml'];
|
|
94
37
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
function _nonIterableSpread() {
|
|
99
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
var HUE = ['grey', 'red', 'green', 'yellow'];
|
|
103
|
-
var SIZE = ['small', 'medium', 'large'];
|
|
104
|
-
var INHERIT_SIZE = ['inherit'].concat(SIZE);
|
|
105
|
-
var TYPE_ORDERED_LIST = ['decimal', 'decimal-leading-zero', 'lower-alpha', 'lower-roman', 'upper-alpha', 'upper-roman'];
|
|
106
|
-
var TYPE_UNORDERED_LIST = ['circle', 'disc', 'square'];
|
|
107
|
-
var LANGUAGES = ['markup', 'bash', 'clike', 'c', 'cpp', 'css', 'javascript', 'jsx', 'coffeescript', 'actionscript', 'css-extr', 'diff', 'git', 'go', 'graphql', 'handlebars', 'json', 'less', 'makefile', 'markdown', 'objectivec', 'ocaml', 'python', 'reason', 'sass', 'scss', 'sql', 'stylus', 'tsx', 'typescript', 'wasm', 'yaml'];
|
|
108
|
-
|
|
109
|
-
var COMPONENT_ID$9 = 'typography.font';
|
|
110
|
-
var TYPOGRAPHY_SIZE = [].concat(_toConsumableArray(SIZE), ['extralarge', '2xlarge', '3xlarge']);
|
|
111
|
-
['inherit'].concat(_toConsumableArray(TYPOGRAPHY_SIZE));
|
|
112
|
-
var THEME_SIZES = {
|
|
38
|
+
const COMPONENT_ID$9 = 'typography.font';
|
|
39
|
+
[...SIZE, 'extralarge', '2xlarge', '3xlarge'];
|
|
40
|
+
const THEME_SIZES = {
|
|
113
41
|
small: 'sm',
|
|
114
42
|
medium: 'md',
|
|
115
43
|
large: 'lg',
|
|
@@ -117,27 +45,27 @@ var THEME_SIZES = {
|
|
|
117
45
|
'2xlarge': 'xxl',
|
|
118
46
|
'3xlarge': 'xxxl'
|
|
119
47
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
48
|
+
const fontStyles = props => {
|
|
49
|
+
const monospace = props.isMonospace && ['inherit', 'small', 'medium', 'large'].indexOf(props.size) !== -1;
|
|
50
|
+
const fontFamily = monospace && props.theme.fonts.mono;
|
|
51
|
+
const direction = props.theme.rtl ? 'rtl' : 'ltr';
|
|
52
|
+
let fontSize;
|
|
53
|
+
let fontWeight;
|
|
54
|
+
let lineHeight;
|
|
55
|
+
let color;
|
|
128
56
|
if (monospace) {
|
|
129
57
|
if (props.size === 'inherit') {
|
|
130
58
|
fontSize = 'calc(1em - 1px)';
|
|
131
59
|
lineHeight = 'normal';
|
|
132
60
|
} else {
|
|
133
|
-
|
|
134
|
-
fontSize = math(
|
|
135
|
-
lineHeight = math(
|
|
61
|
+
const themeSize = THEME_SIZES[props.size];
|
|
62
|
+
fontSize = math(`${props.theme.fontSizes[themeSize]} - 1px`);
|
|
63
|
+
lineHeight = math(`${props.theme.lineHeights[themeSize]} - 1px`);
|
|
136
64
|
}
|
|
137
65
|
} else if (props.size !== 'inherit') {
|
|
138
|
-
|
|
139
|
-
fontSize = props.theme.fontSizes[
|
|
140
|
-
lineHeight = props.theme.lineHeights[
|
|
66
|
+
const themeSize = THEME_SIZES[props.size];
|
|
67
|
+
fontSize = props.theme.fontSizes[themeSize];
|
|
68
|
+
lineHeight = props.theme.lineHeights[themeSize];
|
|
141
69
|
}
|
|
142
70
|
if (props.isBold === true) {
|
|
143
71
|
fontWeight = props.theme.fontWeights.semibold;
|
|
@@ -145,77 +73,51 @@ var fontStyles = function fontStyles(props) {
|
|
|
145
73
|
fontWeight = props.theme.fontWeights.regular;
|
|
146
74
|
}
|
|
147
75
|
if (props.hue) {
|
|
148
|
-
|
|
76
|
+
const shade = props.hue === 'yellow' ? 700 : 600;
|
|
149
77
|
color = getColor(props.hue, shade, props.theme);
|
|
150
78
|
}
|
|
151
79
|
return css(["line-height:", ";color:", ";font-family:", ";font-size:", ";font-weight:", ";direction:", ";"], lineHeight, color, fontFamily, fontSize, fontWeight, direction);
|
|
152
80
|
};
|
|
153
|
-
|
|
81
|
+
const StyledFont = styled.div.attrs({
|
|
154
82
|
'data-garden-id': COMPONENT_ID$9,
|
|
155
|
-
'data-garden-version': '8.
|
|
83
|
+
'data-garden-version': '8.59.0'
|
|
156
84
|
}).withConfig({
|
|
157
85
|
displayName: "StyledFont",
|
|
158
86
|
componentId: "sc-1iildbo-0"
|
|
159
|
-
})(["", ";", ";"],
|
|
160
|
-
return fontStyles(props);
|
|
161
|
-
}, function (props) {
|
|
162
|
-
return retrieveComponentStyles(COMPONENT_ID$9, props);
|
|
163
|
-
});
|
|
87
|
+
})(["", ";", ";"], props => fontStyles(props), props => retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
164
88
|
StyledFont.defaultProps = {
|
|
165
89
|
theme: DEFAULT_THEME,
|
|
166
90
|
size: 'inherit'
|
|
167
91
|
};
|
|
168
92
|
|
|
169
|
-
|
|
170
|
-
|
|
93
|
+
const COMPONENT_ID$8 = 'typography.blockquote';
|
|
94
|
+
const StyledBlockquote = styled.blockquote.attrs({
|
|
171
95
|
'data-garden-id': COMPONENT_ID$8,
|
|
172
|
-
'data-garden-version': '8.
|
|
96
|
+
'data-garden-version': '8.59.0'
|
|
173
97
|
}).withConfig({
|
|
174
98
|
displayName: "StyledBlockquote",
|
|
175
99
|
componentId: "sc-1tt3ye0-0"
|
|
176
|
-
})(["margin:0;border-", ":", " solid;border-color:", ";padding:0;padding-", ":", "px;direction:", ";p + &,& + &{margin-top:", ";}", ";"],
|
|
177
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
178
|
-
}, function (props) {
|
|
179
|
-
return props.theme.shadowWidths.sm;
|
|
180
|
-
}, function (props) {
|
|
181
|
-
return getColor('neutralHue', 400, props.theme);
|
|
182
|
-
}, function (props) {
|
|
183
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
184
|
-
}, function (props) {
|
|
185
|
-
return props.theme.space.base * 4;
|
|
186
|
-
}, function (props) {
|
|
187
|
-
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
188
|
-
}, function (props) {
|
|
189
|
-
return props.theme.lineHeights[THEME_SIZES[props.size]];
|
|
190
|
-
}, function (props) {
|
|
191
|
-
return retrieveComponentStyles(COMPONENT_ID$8, props);
|
|
192
|
-
});
|
|
100
|
+
})(["margin:0;border-", ":", " solid;border-color:", ";padding:0;padding-", ":", "px;direction:", ";p + &,& + &{margin-top:", ";}", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.shadowWidths.sm, props => getColor('neutralHue', 400, props.theme), props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 4, props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.lineHeights[THEME_SIZES[props.size]], props => retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
193
101
|
StyledBlockquote.defaultProps = {
|
|
194
102
|
theme: DEFAULT_THEME
|
|
195
103
|
};
|
|
196
104
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
105
|
+
const COMPONENT_ID$7 = 'typography.code';
|
|
106
|
+
const colorStyles$3 = props => {
|
|
107
|
+
const hue = props.hue || 'neutralHue';
|
|
108
|
+
const backgroundColor = getColor(hue, 200, props.theme);
|
|
109
|
+
const shade = hue === 'yellow' ? 800 : 700;
|
|
110
|
+
const foregroundColor = getColor(hue, shade, props.theme);
|
|
203
111
|
return css(["background-color:", ";color:", ";a &{color:inherit;}"], backgroundColor, foregroundColor);
|
|
204
112
|
};
|
|
205
|
-
|
|
113
|
+
const StyledCode = styled(StyledFont).attrs({
|
|
206
114
|
'data-garden-id': COMPONENT_ID$7,
|
|
207
|
-
'data-garden-version': '8.
|
|
115
|
+
'data-garden-version': '8.59.0',
|
|
208
116
|
as: 'code'
|
|
209
117
|
}).withConfig({
|
|
210
118
|
displayName: "StyledCode",
|
|
211
119
|
componentId: "sc-l8yvmf-0"
|
|
212
|
-
})(["border-radius:", ";padding:1.5px;", ";", ";"],
|
|
213
|
-
return props.theme.borderRadii.sm;
|
|
214
|
-
}, function (props) {
|
|
215
|
-
return colorStyles$3(props);
|
|
216
|
-
}, function (props) {
|
|
217
|
-
return retrieveComponentStyles(COMPONENT_ID$7, props);
|
|
218
|
-
});
|
|
120
|
+
})(["border-radius:", ";padding:1.5px;", ";", ";"], props => props.theme.borderRadii.sm, props => colorStyles$3(props), props => retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
219
121
|
StyledCode.defaultProps = {
|
|
220
122
|
theme: DEFAULT_THEME,
|
|
221
123
|
isMonospace: true,
|
|
@@ -223,50 +125,40 @@ StyledCode.defaultProps = {
|
|
|
223
125
|
size: 'inherit'
|
|
224
126
|
};
|
|
225
127
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
128
|
+
const COMPONENT_ID$6 = 'typography.codeblock';
|
|
129
|
+
const colorStyles$2 = props => {
|
|
130
|
+
const backgroundColor = getColor('neutralHue', props.isLight ? 100 : 1000, props.theme);
|
|
131
|
+
const foregroundColor = props.isLight ? props.theme.colors.foreground : getColor('neutralHue', 300, props.theme);
|
|
230
132
|
return css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
231
133
|
};
|
|
232
|
-
|
|
134
|
+
const StyledCodeBlock = styled.pre.attrs({
|
|
233
135
|
'data-garden-id': COMPONENT_ID$6,
|
|
234
|
-
'data-garden-version': '8.
|
|
136
|
+
'data-garden-version': '8.59.0'
|
|
235
137
|
}).withConfig({
|
|
236
138
|
displayName: "StyledCodeBlock",
|
|
237
139
|
componentId: "sc-5wky57-0"
|
|
238
|
-
})(["display:table;margin:0;padding:", "px;box-sizing:border-box;width:100%;direction:ltr;white-space:pre;counter-reset:linenumber;", ";", ";"],
|
|
239
|
-
return props.theme.space.base * 3;
|
|
240
|
-
}, function (props) {
|
|
241
|
-
return colorStyles$2(props);
|
|
242
|
-
}, function (props) {
|
|
243
|
-
return retrieveComponentStyles(COMPONENT_ID$6, props);
|
|
244
|
-
});
|
|
140
|
+
})(["display:table;margin:0;padding:", "px;box-sizing:border-box;width:100%;direction:ltr;white-space:pre;counter-reset:linenumber;", ";", ";"], props => props.theme.space.base * 3, props => colorStyles$2(props), props => retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
245
141
|
StyledCodeBlock.defaultProps = {
|
|
246
142
|
theme: DEFAULT_THEME
|
|
247
143
|
};
|
|
248
144
|
|
|
249
|
-
|
|
250
|
-
|
|
145
|
+
const COMPONENT_ID$5 = 'typography.codeblock_container';
|
|
146
|
+
const StyledCodeBlockContainer = styled.div.attrs({
|
|
251
147
|
'data-garden-id': COMPONENT_ID$5,
|
|
252
|
-
'data-garden-version': '8.
|
|
148
|
+
'data-garden-version': '8.59.0'
|
|
253
149
|
}).withConfig({
|
|
254
150
|
displayName: "StyledCodeBlockContainer",
|
|
255
151
|
componentId: "sc-14zgbfw-0"
|
|
256
|
-
})(["overflow:auto;&:focus{outline:none;}&[data-garden-focus-visible]{box-shadow:", ";}", ";"],
|
|
257
|
-
return props.theme.shadows.md(getColor('primaryHue', 600, props.theme, 0.35));
|
|
258
|
-
}, function (props) {
|
|
259
|
-
return retrieveComponentStyles(COMPONENT_ID$5, props);
|
|
260
|
-
});
|
|
152
|
+
})(["overflow:auto;&:focus{outline:none;}&[data-garden-focus-visible]{box-shadow:", ";}", ";"], props => props.theme.shadows.md(getColor('primaryHue', 600, props.theme, 0.35)), props => retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
261
153
|
StyledCodeBlockContainer.defaultProps = {
|
|
262
154
|
theme: DEFAULT_THEME
|
|
263
155
|
};
|
|
264
156
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
157
|
+
const COMPONENT_ID$4 = 'typography.codeblock_code';
|
|
158
|
+
const colorStyles$1 = props => {
|
|
159
|
+
let backgroundColor;
|
|
268
160
|
if (props.diff) {
|
|
269
|
-
|
|
161
|
+
let hue;
|
|
270
162
|
switch (props.diff) {
|
|
271
163
|
case 'hunk':
|
|
272
164
|
hue = 'royal';
|
|
@@ -283,14 +175,14 @@ var colorStyles$1 = function colorStyles(props) {
|
|
|
283
175
|
}
|
|
284
176
|
backgroundColor = getColor(hue, 400, props.theme, 0.2);
|
|
285
177
|
} else if (props.isHighlighted) {
|
|
286
|
-
|
|
287
|
-
backgroundColor = getColor(
|
|
178
|
+
const hue = props.isLight ? props.theme.palette.black : props.theme.palette.white;
|
|
179
|
+
backgroundColor = getColor(hue, 600, props.theme, 0.1);
|
|
288
180
|
}
|
|
289
181
|
return css(["background-color:", ";"], backgroundColor);
|
|
290
182
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
183
|
+
const lineNumberStyles = props => {
|
|
184
|
+
const color = getColor('neutralHue', props.isLight ? 600 : 500, props.theme);
|
|
185
|
+
let padding;
|
|
294
186
|
if (props.language && props.language === 'diff') {
|
|
295
187
|
padding = 0;
|
|
296
188
|
} else if (props.size === 'small') {
|
|
@@ -300,35 +192,35 @@ var lineNumberStyles = function lineNumberStyles(props) {
|
|
|
300
192
|
} else {
|
|
301
193
|
padding = props.theme.space.base * 6;
|
|
302
194
|
}
|
|
303
|
-
return
|
|
195
|
+
return `
|
|
196
|
+
&::before {
|
|
197
|
+
display: table-cell;
|
|
198
|
+
padding-right: ${padding}px;
|
|
199
|
+
width: 1px;
|
|
200
|
+
text-align: right;
|
|
201
|
+
color: ${color};
|
|
202
|
+
content: counter(linenumber);
|
|
203
|
+
counter-increment: linenumber;
|
|
204
|
+
}
|
|
205
|
+
`;
|
|
304
206
|
};
|
|
305
|
-
|
|
207
|
+
const StyledCodeBlockLine = styled(StyledFont).attrs({
|
|
306
208
|
'data-garden-id': COMPONENT_ID$4,
|
|
307
|
-
'data-garden-version': '8.
|
|
209
|
+
'data-garden-version': '8.59.0',
|
|
308
210
|
as: 'code',
|
|
309
211
|
isMonospace: true
|
|
310
212
|
}).withConfig({
|
|
311
213
|
displayName: "StyledCodeBlockLine",
|
|
312
214
|
componentId: "sc-1goay17-0"
|
|
313
|
-
})(["display:table-row;height:", ";direction:ltr;", ";", ";&::after{display:inline-block;width:", "px;content:'';}", ";"],
|
|
314
|
-
return props.theme.lineHeights[THEME_SIZES[props.size]];
|
|
315
|
-
}, function (props) {
|
|
316
|
-
return colorStyles$1(props);
|
|
317
|
-
}, function (props) {
|
|
318
|
-
return props.isNumbered && lineNumberStyles(props);
|
|
319
|
-
}, function (props) {
|
|
320
|
-
return props.theme.space.base * 3;
|
|
321
|
-
}, function (props) {
|
|
322
|
-
return retrieveComponentStyles(COMPONENT_ID$4, props);
|
|
323
|
-
});
|
|
215
|
+
})(["display:table-row;height:", ";direction:ltr;", ";", ";&::after{display:inline-block;width:", "px;content:'';}", ";"], props => props.theme.lineHeights[THEME_SIZES[props.size]], props => colorStyles$1(props), props => props.isNumbered && lineNumberStyles(props), props => props.theme.space.base * 3, props => retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
324
216
|
StyledCodeBlockLine.defaultProps = {
|
|
325
217
|
theme: DEFAULT_THEME
|
|
326
218
|
};
|
|
327
219
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
220
|
+
const COMPONENT_ID$3 = 'typography.codeblock_token';
|
|
221
|
+
const colorStyles = props => {
|
|
222
|
+
const palette = props.theme.palette;
|
|
223
|
+
const colors = {
|
|
332
224
|
boolean: props.isLight ? palette.royal[600] : palette.azure[400],
|
|
333
225
|
builtin: palette.teal[400],
|
|
334
226
|
comment: props.isLight ? palette.lime[600] : palette.mint[400],
|
|
@@ -347,174 +239,132 @@ var colorStyles = function colorStyles(props) {
|
|
|
347
239
|
};
|
|
348
240
|
return css(["&.builtin,&.class-name,&.tag:not(.punctuation):not(.attr-name):not(.attr-value):not(.script){color:", ";}&.doctype,&.prolog,&.tag.punctuation:not(.attr-value):not(.script):not(.spread){color:", ";}&.attribute.value,&.attr-value,&.atrule,&.cdata,&.string,&.url.content{color:", ";}&.constant,&.interpolation-punctuation{color:", ";}&.attr-name,&.attr-value.spread,&.environment,&.interpolation,&.parameter,&.property,&.property-access,&.variable{color:", ";}&.parameter.punctuation,&.attr-name + .attr-value.punctuation{color:inherit;}&.regex{color:", ";}&.boolean,&.bold:not(.diff),&.entity,&.important,&.tag:not(.punctuation):not(.attr-name):not(.attr-value):not(.script):not(.class-name){color:", ";}&.number,&.unit{color:", ";}&.assign-left,&.function,&.selector:not(.attribute){color:", ";}&.atrule.rule,&.keyword{color:", ";}&.blockquote,&.comment,&.shebang{color:", ";}", ".language-css &&.plain{color:", ";}", ".language-diff &&.coord{color:", ";}", ".language-diff &&.deleted{color:", ";}", ".language-diff &&.diff{color:", ";}", ".language-diff &&.inserted{color:", ";}"], colors.builtin, colors.punctuation, colors.value, colors.constant, colors.name, colors.regex, colors.boolean, colors.number, colors.function, colors.keyword, colors.comment, StyledCodeBlock, colors.value, StyledCodeBlock, colors.coord, StyledCodeBlock, colors.deleted, StyledCodeBlock, colors.diff, StyledCodeBlock, colors.inserted);
|
|
349
241
|
};
|
|
350
|
-
|
|
242
|
+
const StyledCodeBlockToken = styled.span.attrs({
|
|
351
243
|
'data-garden-id': COMPONENT_ID$3,
|
|
352
|
-
'data-garden-version': '8.
|
|
244
|
+
'data-garden-version': '8.59.0'
|
|
353
245
|
}).withConfig({
|
|
354
246
|
displayName: "StyledCodeBlockToken",
|
|
355
247
|
componentId: "sc-1hkshdq-0"
|
|
356
|
-
})(["display:inline-block;&.bold:not(.diff){font-weight:", ";}&.coord{padding-left:0.75em;}&.italic{font-style:italic;}&.prefix{width:2em;text-align:center;}", ";", ";"],
|
|
357
|
-
return props.theme.fontWeights.semibold;
|
|
358
|
-
}, function (props) {
|
|
359
|
-
return colorStyles(props);
|
|
360
|
-
}, function (props) {
|
|
361
|
-
return retrieveComponentStyles(COMPONENT_ID$3, props);
|
|
362
|
-
});
|
|
248
|
+
})(["display:inline-block;&.bold:not(.diff){font-weight:", ";}&.coord{padding-left:0.75em;}&.italic{font-style:italic;}&.prefix{width:2em;text-align:center;}", ";", ";"], props => props.theme.fontWeights.semibold, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
363
249
|
StyledCodeBlockToken.defaultProps = {
|
|
364
250
|
theme: DEFAULT_THEME
|
|
365
251
|
};
|
|
366
252
|
|
|
367
|
-
|
|
368
|
-
|
|
253
|
+
const COMPONENT_ID$2 = 'typography.ellipsis';
|
|
254
|
+
const StyledEllipsis = styled.div.attrs({
|
|
369
255
|
'data-garden-id': COMPONENT_ID$2,
|
|
370
|
-
'data-garden-version': '8.
|
|
256
|
+
'data-garden-version': '8.59.0'
|
|
371
257
|
}).withConfig({
|
|
372
258
|
displayName: "StyledEllipsis",
|
|
373
259
|
componentId: "sc-1u4uqmy-0"
|
|
374
|
-
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:", ";", ";"],
|
|
375
|
-
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
376
|
-
}, function (props) {
|
|
377
|
-
return retrieveComponentStyles(COMPONENT_ID$2, props);
|
|
378
|
-
});
|
|
260
|
+
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
379
261
|
StyledEllipsis.defaultProps = {
|
|
380
262
|
theme: DEFAULT_THEME
|
|
381
263
|
};
|
|
382
264
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
var size = props.theme.iconSizes.md;
|
|
265
|
+
const COMPONENT_ID$1 = 'typography.icon';
|
|
266
|
+
const sizeStyles = props => {
|
|
267
|
+
const margin = props.isStart && `${props.theme.space.base * 2}px`;
|
|
268
|
+
const size = props.theme.iconSizes.md;
|
|
388
269
|
return css(["margin-", ":", ";width:", ";height:", ";"], props.theme.rtl ? 'left' : 'right', margin, size, size);
|
|
389
270
|
};
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
271
|
+
const StyledIcon = styled(_ref => {
|
|
272
|
+
let {
|
|
273
|
+
children,
|
|
274
|
+
isStart,
|
|
275
|
+
...props
|
|
276
|
+
} = _ref;
|
|
394
277
|
return React.cloneElement(Children.only(children), props);
|
|
395
278
|
}).attrs({
|
|
396
279
|
'data-garden-id': COMPONENT_ID$1,
|
|
397
|
-
'data-garden-version': '8.
|
|
280
|
+
'data-garden-version': '8.59.0'
|
|
398
281
|
}).withConfig({
|
|
399
282
|
displayName: "StyledIcon",
|
|
400
283
|
componentId: "sc-10rfb5b-0"
|
|
401
|
-
})(["position:relative;top:-1px;vertical-align:middle;", ";", ";"],
|
|
402
|
-
return sizeStyles(props);
|
|
403
|
-
}, function (props) {
|
|
404
|
-
return retrieveComponentStyles(COMPONENT_ID$1, props);
|
|
405
|
-
});
|
|
284
|
+
})(["position:relative;top:-1px;vertical-align:middle;", ";", ";"], props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
406
285
|
StyledIcon.defaultProps = {
|
|
407
286
|
theme: DEFAULT_THEME
|
|
408
287
|
};
|
|
409
288
|
|
|
410
|
-
|
|
411
|
-
|
|
289
|
+
const listStyles = props => {
|
|
290
|
+
const rtl = props.theme.rtl;
|
|
412
291
|
return css(["direction:", ";margin:0;margin-", ":24px;padding:0;list-style-position:outside;list-style-type:", ";"], rtl ? 'rtl' : 'ltr', rtl ? 'right' : 'left', props.listType);
|
|
413
292
|
};
|
|
414
|
-
|
|
415
|
-
|
|
293
|
+
const ORDERED_ID$1 = 'typography.ordered_list';
|
|
294
|
+
const StyledOrderedList = styled.ol.attrs({
|
|
416
295
|
'data-garden-id': ORDERED_ID$1,
|
|
417
|
-
'data-garden-version': '8.
|
|
296
|
+
'data-garden-version': '8.59.0'
|
|
418
297
|
}).withConfig({
|
|
419
298
|
displayName: "StyledList__StyledOrderedList",
|
|
420
299
|
componentId: "sc-jdbsfi-0"
|
|
421
|
-
})(["", ";", ";"],
|
|
422
|
-
return listStyles(props);
|
|
423
|
-
}, function (props) {
|
|
424
|
-
return retrieveComponentStyles(ORDERED_ID$1, props);
|
|
425
|
-
});
|
|
300
|
+
})(["", ";", ";"], props => listStyles(props), props => retrieveComponentStyles(ORDERED_ID$1, props));
|
|
426
301
|
StyledOrderedList.defaultProps = {
|
|
427
302
|
theme: DEFAULT_THEME
|
|
428
303
|
};
|
|
429
|
-
|
|
430
|
-
|
|
304
|
+
const UNORDERED_ID$1 = 'typography.unordered_list';
|
|
305
|
+
const StyledUnorderedList = styled.ul.attrs({
|
|
431
306
|
'data-garden-id': UNORDERED_ID$1,
|
|
432
|
-
'data-garden-version': '8.
|
|
307
|
+
'data-garden-version': '8.59.0'
|
|
433
308
|
}).withConfig({
|
|
434
309
|
displayName: "StyledList__StyledUnorderedList",
|
|
435
310
|
componentId: "sc-jdbsfi-1"
|
|
436
|
-
})(["", ";", ";"],
|
|
437
|
-
return listStyles(props);
|
|
438
|
-
}, function (props) {
|
|
439
|
-
return retrieveComponentStyles(UNORDERED_ID$1, props);
|
|
440
|
-
});
|
|
311
|
+
})(["", ";", ";"], props => listStyles(props), props => retrieveComponentStyles(UNORDERED_ID$1, props));
|
|
441
312
|
StyledUnorderedList.defaultProps = {
|
|
442
313
|
theme: DEFAULT_THEME
|
|
443
314
|
};
|
|
444
315
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
316
|
+
const listItemPaddingStyles = props => {
|
|
317
|
+
const base = props.theme.space.base;
|
|
318
|
+
const paddingTop = props.space === 'large' ? `${base * 2}px` : `${base}px`;
|
|
448
319
|
return css(["padding-top:", ";", " > &:first-child,", " > &:first-child{padding-top:0;}", " ", " > &:first-child,", " ", " > &:first-child,", " ", " > &:first-child,", " ", " > &:first-child{padding-top:", ";}"], paddingTop, StyledOrderedList, StyledUnorderedList, StyledOrderedList, StyledOrderedList, StyledOrderedList, StyledUnorderedList, StyledUnorderedList, StyledUnorderedList, StyledUnorderedList, StyledUnorderedList, paddingTop);
|
|
449
320
|
};
|
|
450
|
-
|
|
321
|
+
const listItemStyles = props => {
|
|
451
322
|
return css(["line-height:", ";", ";"], getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props.space !== 'small' && listItemPaddingStyles(props));
|
|
452
323
|
};
|
|
453
|
-
|
|
454
|
-
|
|
324
|
+
const ORDERED_ID = 'typography.ordered_list_item';
|
|
325
|
+
const StyledOrderedListItem = styled(StyledFont).attrs({
|
|
455
326
|
'data-garden-id': ORDERED_ID,
|
|
456
|
-
'data-garden-version': '8.
|
|
327
|
+
'data-garden-version': '8.59.0',
|
|
457
328
|
as: 'li'
|
|
458
329
|
}).withConfig({
|
|
459
330
|
displayName: "StyledListItem__StyledOrderedListItem",
|
|
460
331
|
componentId: "sc-9rsipg-0"
|
|
461
|
-
})(["margin-", ":", ";padding-", ":", ";", ";", ";"],
|
|
462
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
463
|
-
}, function (props) {
|
|
464
|
-
return math("".concat(props.theme.space.base, " * -1px"));
|
|
465
|
-
}, function (props) {
|
|
466
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
467
|
-
}, function (props) {
|
|
468
|
-
return math("".concat(props.theme.space.base, " * 1px"));
|
|
469
|
-
}, function (props) {
|
|
470
|
-
return listItemStyles(props);
|
|
471
|
-
}, function (props) {
|
|
472
|
-
return retrieveComponentStyles(ORDERED_ID, props);
|
|
473
|
-
});
|
|
332
|
+
})(["margin-", ":", ";padding-", ":", ";", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * -1px`), props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 1px`), props => listItemStyles(props), props => retrieveComponentStyles(ORDERED_ID, props));
|
|
474
333
|
StyledOrderedListItem.defaultProps = {
|
|
475
334
|
space: 'medium',
|
|
476
335
|
theme: DEFAULT_THEME
|
|
477
336
|
};
|
|
478
|
-
|
|
479
|
-
|
|
337
|
+
const UNORDERED_ID = 'typography.unordered_list_item';
|
|
338
|
+
const StyledUnorderedListItem = styled(StyledFont).attrs({
|
|
480
339
|
'data-garden-id': UNORDERED_ID,
|
|
481
|
-
'data-garden-version': '8.
|
|
340
|
+
'data-garden-version': '8.59.0',
|
|
482
341
|
as: 'li'
|
|
483
342
|
}).withConfig({
|
|
484
343
|
displayName: "StyledListItem__StyledUnorderedListItem",
|
|
485
344
|
componentId: "sc-9rsipg-1"
|
|
486
|
-
})(["", ";", ";"],
|
|
487
|
-
return listItemStyles(props);
|
|
488
|
-
}, function (props) {
|
|
489
|
-
return retrieveComponentStyles(UNORDERED_ID, props);
|
|
490
|
-
});
|
|
345
|
+
})(["", ";", ";"], props => listItemStyles(props), props => retrieveComponentStyles(UNORDERED_ID, props));
|
|
491
346
|
StyledUnorderedListItem.defaultProps = {
|
|
492
347
|
space: 'medium',
|
|
493
348
|
theme: DEFAULT_THEME
|
|
494
349
|
};
|
|
495
350
|
|
|
496
|
-
|
|
497
|
-
|
|
351
|
+
const COMPONENT_ID = 'typography.paragraph';
|
|
352
|
+
const StyledParagraph = styled.p.attrs({
|
|
498
353
|
'data-garden-id': COMPONENT_ID,
|
|
499
|
-
'data-garden-version': '8.
|
|
354
|
+
'data-garden-version': '8.59.0'
|
|
500
355
|
}).withConfig({
|
|
501
356
|
displayName: "StyledParagraph",
|
|
502
357
|
componentId: "sc-zkuftz-0"
|
|
503
|
-
})(["margin:0;padding:0;direction:", ";blockquote + &,& + &{margin-top:", ";}", ";"],
|
|
504
|
-
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
505
|
-
}, function (props) {
|
|
506
|
-
return props.theme.lineHeights[THEME_SIZES[props.size]];
|
|
507
|
-
}, function (props) {
|
|
508
|
-
return retrieveComponentStyles(COMPONENT_ID, props);
|
|
509
|
-
});
|
|
358
|
+
})(["margin:0;padding:0;direction:", ";blockquote + &,& + &{margin-top:", ";}", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.lineHeights[THEME_SIZES[props.size]], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
510
359
|
StyledParagraph.defaultProps = {
|
|
511
360
|
theme: DEFAULT_THEME
|
|
512
361
|
};
|
|
513
362
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
363
|
+
const SM = forwardRef((_ref, ref) => {
|
|
364
|
+
let {
|
|
365
|
+
tag,
|
|
366
|
+
...other
|
|
367
|
+
} = _ref;
|
|
518
368
|
return React.createElement(StyledFont, _extends({
|
|
519
369
|
as: tag,
|
|
520
370
|
ref: ref,
|
|
@@ -531,10 +381,11 @@ SM.defaultProps = {
|
|
|
531
381
|
tag: 'div'
|
|
532
382
|
};
|
|
533
383
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
384
|
+
const MD = forwardRef((_ref, ref) => {
|
|
385
|
+
let {
|
|
386
|
+
tag,
|
|
387
|
+
...other
|
|
388
|
+
} = _ref;
|
|
538
389
|
return React.createElement(StyledFont, _extends({
|
|
539
390
|
as: tag,
|
|
540
391
|
ref: ref,
|
|
@@ -551,10 +402,11 @@ MD.defaultProps = {
|
|
|
551
402
|
tag: 'div'
|
|
552
403
|
};
|
|
553
404
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
405
|
+
const LG = forwardRef((_ref, ref) => {
|
|
406
|
+
let {
|
|
407
|
+
tag,
|
|
408
|
+
...other
|
|
409
|
+
} = _ref;
|
|
558
410
|
return React.createElement(StyledFont, _extends({
|
|
559
411
|
as: tag,
|
|
560
412
|
ref: ref,
|
|
@@ -571,10 +423,11 @@ LG.defaultProps = {
|
|
|
571
423
|
tag: 'div'
|
|
572
424
|
};
|
|
573
425
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
426
|
+
const XL = forwardRef((_ref, ref) => {
|
|
427
|
+
let {
|
|
428
|
+
tag,
|
|
429
|
+
...other
|
|
430
|
+
} = _ref;
|
|
578
431
|
return React.createElement(StyledFont, _extends({
|
|
579
432
|
as: tag,
|
|
580
433
|
ref: ref,
|
|
@@ -590,10 +443,11 @@ XL.defaultProps = {
|
|
|
590
443
|
tag: 'div'
|
|
591
444
|
};
|
|
592
445
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
446
|
+
const XXL = forwardRef((_ref, ref) => {
|
|
447
|
+
let {
|
|
448
|
+
tag,
|
|
449
|
+
...other
|
|
450
|
+
} = _ref;
|
|
597
451
|
return React.createElement(StyledFont, _extends({
|
|
598
452
|
as: tag,
|
|
599
453
|
ref: ref,
|
|
@@ -609,10 +463,11 @@ XXL.defaultProps = {
|
|
|
609
463
|
tag: 'div'
|
|
610
464
|
};
|
|
611
465
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
466
|
+
const XXXL = forwardRef((_ref, ref) => {
|
|
467
|
+
let {
|
|
468
|
+
tag,
|
|
469
|
+
...other
|
|
470
|
+
} = _ref;
|
|
616
471
|
return React.createElement(StyledFont, _extends({
|
|
617
472
|
as: tag,
|
|
618
473
|
ref: ref,
|
|
@@ -628,11 +483,9 @@ XXXL.defaultProps = {
|
|
|
628
483
|
tag: 'div'
|
|
629
484
|
};
|
|
630
485
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}, props));
|
|
635
|
-
});
|
|
486
|
+
const Blockquote = React.forwardRef((props, ref) => React.createElement(StyledBlockquote, _extends({
|
|
487
|
+
ref: ref
|
|
488
|
+
}, props)));
|
|
636
489
|
Blockquote.displayName = 'Blockquote';
|
|
637
490
|
Blockquote.propTypes = {
|
|
638
491
|
size: PropTypes.oneOf(SIZE)
|
|
@@ -641,10 +494,11 @@ Blockquote.defaultProps = {
|
|
|
641
494
|
size: 'medium'
|
|
642
495
|
};
|
|
643
496
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
497
|
+
const Code = forwardRef((_ref, ref) => {
|
|
498
|
+
let {
|
|
499
|
+
hue,
|
|
500
|
+
...other
|
|
501
|
+
} = _ref;
|
|
648
502
|
return React.createElement(StyledCode, _extends({
|
|
649
503
|
ref: ref,
|
|
650
504
|
hue: hue
|
|
@@ -660,31 +514,28 @@ Code.defaultProps = {
|
|
|
660
514
|
size: 'inherit'
|
|
661
515
|
};
|
|
662
516
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
dependency: dependency
|
|
517
|
+
const CodeBlock = React.forwardRef((_ref, ref) => {
|
|
518
|
+
let {
|
|
519
|
+
children,
|
|
520
|
+
containerProps,
|
|
521
|
+
highlightLines,
|
|
522
|
+
isLight,
|
|
523
|
+
isNumbered,
|
|
524
|
+
language,
|
|
525
|
+
size,
|
|
526
|
+
...other
|
|
527
|
+
} = _ref;
|
|
528
|
+
const containerRef = useRef(null);
|
|
529
|
+
const code = Array.isArray(children) ? children[0] : children;
|
|
530
|
+
const dependency = useMemo(() => [size, children], [size, children]);
|
|
531
|
+
const containerTabIndex = useScrollRegion({
|
|
532
|
+
containerRef,
|
|
533
|
+
dependency
|
|
681
534
|
});
|
|
682
|
-
|
|
683
|
-
|
|
535
|
+
const getDiff = line => {
|
|
536
|
+
let retVal;
|
|
684
537
|
if (language === 'diff') {
|
|
685
|
-
|
|
686
|
-
return !(value.empty || value.content === '');
|
|
687
|
-
});
|
|
538
|
+
const token = line.find(value => !(value.empty || value.content === ''));
|
|
688
539
|
if (token) {
|
|
689
540
|
if (token.types.includes('deleted')) {
|
|
690
541
|
retVal = 'delete';
|
|
@@ -706,35 +557,33 @@ var CodeBlock = React.forwardRef(function (_ref, ref) {
|
|
|
706
557
|
Prism: Prism,
|
|
707
558
|
code: code ? code.trim() : '',
|
|
708
559
|
language: LANGUAGES.includes(language) ? language : 'tsx'
|
|
709
|
-
},
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
560
|
+
}, _ref2 => {
|
|
561
|
+
let {
|
|
562
|
+
className,
|
|
563
|
+
tokens,
|
|
564
|
+
getLineProps,
|
|
565
|
+
getTokenProps
|
|
566
|
+
} = _ref2;
|
|
714
567
|
return React.createElement(StyledCodeBlock, _extends({
|
|
715
568
|
className: className,
|
|
716
569
|
ref: ref,
|
|
717
570
|
isLight: isLight
|
|
718
|
-
}, other), tokens.map(
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
isLight: isLight
|
|
735
|
-
}), token.empty ? '\n' : token.content);
|
|
736
|
-
}));
|
|
737
|
-
}));
|
|
571
|
+
}, other), tokens.map((line, index) => React.createElement(StyledCodeBlockLine, _extends({}, getLineProps({
|
|
572
|
+
line
|
|
573
|
+
}), {
|
|
574
|
+
key: index,
|
|
575
|
+
language: language,
|
|
576
|
+
isHighlighted: highlightLines && highlightLines.includes(index + 1),
|
|
577
|
+
isLight: isLight,
|
|
578
|
+
isNumbered: isNumbered,
|
|
579
|
+
diff: getDiff(line),
|
|
580
|
+
size: size
|
|
581
|
+
}), line.map((token, tokenKey) => React.createElement(StyledCodeBlockToken, _extends({}, getTokenProps({
|
|
582
|
+
token
|
|
583
|
+
}), {
|
|
584
|
+
key: tokenKey,
|
|
585
|
+
isLight: isLight
|
|
586
|
+
}), token.empty ? '\n' : token.content)))));
|
|
738
587
|
}));
|
|
739
588
|
});
|
|
740
589
|
CodeBlock.displayName = 'CodeBlock';
|
|
@@ -743,13 +592,14 @@ CodeBlock.defaultProps = {
|
|
|
743
592
|
size: 'medium'
|
|
744
593
|
};
|
|
745
594
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
595
|
+
const Ellipsis = forwardRef((_ref, ref) => {
|
|
596
|
+
let {
|
|
597
|
+
children,
|
|
598
|
+
title,
|
|
599
|
+
tag,
|
|
600
|
+
...other
|
|
601
|
+
} = _ref;
|
|
602
|
+
let textContent = undefined;
|
|
753
603
|
if (title !== undefined) {
|
|
754
604
|
textContent = title;
|
|
755
605
|
} else if (typeof children === 'string') {
|
|
@@ -770,11 +620,9 @@ Ellipsis.defaultProps = {
|
|
|
770
620
|
tag: 'div'
|
|
771
621
|
};
|
|
772
622
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
}, props));
|
|
777
|
-
});
|
|
623
|
+
const Paragraph = forwardRef((props, ref) => React.createElement(StyledParagraph, _extends({
|
|
624
|
+
ref: ref
|
|
625
|
+
}, props)));
|
|
778
626
|
Paragraph.displayName = 'Paragraph';
|
|
779
627
|
Paragraph.propTypes = {
|
|
780
628
|
size: PropTypes.oneOf(SIZE)
|
|
@@ -783,36 +631,36 @@ Paragraph.defaultProps = {
|
|
|
783
631
|
size: 'medium'
|
|
784
632
|
};
|
|
785
633
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
634
|
+
const OrderedListContext = createContext(undefined);
|
|
635
|
+
const useOrderedListContext = () => {
|
|
636
|
+
const listContext = useContext(OrderedListContext);
|
|
789
637
|
if (!listContext) {
|
|
790
638
|
throw new Error('This component must be rendered within an `OrderedList` component.');
|
|
791
639
|
}
|
|
792
640
|
return listContext;
|
|
793
641
|
};
|
|
794
642
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
643
|
+
const OrderedListItem = forwardRef((props, ref) => {
|
|
644
|
+
const {
|
|
645
|
+
size
|
|
646
|
+
} = useOrderedListContext();
|
|
798
647
|
return React.createElement(StyledOrderedListItem, _extends({
|
|
799
648
|
ref: ref,
|
|
800
649
|
space: size
|
|
801
650
|
}, props));
|
|
802
651
|
});
|
|
803
652
|
OrderedListItem.displayName = 'OrderedList.Item';
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
}, [size]);
|
|
653
|
+
const Item$1 = OrderedListItem;
|
|
654
|
+
|
|
655
|
+
const OrderedListComponent = React.forwardRef((_ref, ref) => {
|
|
656
|
+
let {
|
|
657
|
+
size,
|
|
658
|
+
type,
|
|
659
|
+
...other
|
|
660
|
+
} = _ref;
|
|
661
|
+
const value = useMemo(() => ({
|
|
662
|
+
size: size
|
|
663
|
+
}), [size]);
|
|
816
664
|
return React.createElement(OrderedListContext.Provider, {
|
|
817
665
|
value: value
|
|
818
666
|
}, React.createElement(StyledOrderedList, _extends({
|
|
@@ -829,39 +677,39 @@ OrderedListComponent.defaultProps = {
|
|
|
829
677
|
size: 'medium',
|
|
830
678
|
type: 'decimal'
|
|
831
679
|
};
|
|
832
|
-
|
|
680
|
+
const OrderedList = OrderedListComponent;
|
|
833
681
|
OrderedList.Item = Item$1;
|
|
834
682
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
683
|
+
const UnorderedListContext = createContext(undefined);
|
|
684
|
+
const useUnorderedListContext = () => {
|
|
685
|
+
const listContext = useContext(UnorderedListContext);
|
|
838
686
|
if (!listContext) {
|
|
839
687
|
throw new Error('This component must be rendered within an `UnorderedList` component.');
|
|
840
688
|
}
|
|
841
689
|
return listContext;
|
|
842
690
|
};
|
|
843
691
|
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
692
|
+
const UnorderedListItem = forwardRef((props, ref) => {
|
|
693
|
+
const {
|
|
694
|
+
size
|
|
695
|
+
} = useUnorderedListContext();
|
|
847
696
|
return React.createElement(StyledUnorderedListItem, _extends({
|
|
848
697
|
ref: ref,
|
|
849
698
|
space: size
|
|
850
699
|
}, props));
|
|
851
700
|
});
|
|
852
701
|
UnorderedListItem.displayName = 'UnorderedList.Item';
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
}, [size]);
|
|
702
|
+
const Item = UnorderedListItem;
|
|
703
|
+
|
|
704
|
+
const UnorderedListComponent = forwardRef((_ref, ref) => {
|
|
705
|
+
let {
|
|
706
|
+
size,
|
|
707
|
+
type,
|
|
708
|
+
...other
|
|
709
|
+
} = _ref;
|
|
710
|
+
const value = useMemo(() => ({
|
|
711
|
+
size: size
|
|
712
|
+
}), [size]);
|
|
865
713
|
return React.createElement(UnorderedListContext.Provider, {
|
|
866
714
|
value: value
|
|
867
715
|
}, React.createElement(StyledUnorderedList, _extends({
|
|
@@ -878,27 +726,24 @@ UnorderedListComponent.defaultProps = {
|
|
|
878
726
|
size: 'medium',
|
|
879
727
|
type: 'disc'
|
|
880
728
|
};
|
|
881
|
-
|
|
729
|
+
const UnorderedList = UnorderedListComponent;
|
|
882
730
|
UnorderedList.Item = Item;
|
|
883
731
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
}, props));
|
|
888
|
-
};
|
|
732
|
+
const StartIconComponent = props => React.createElement(StyledIcon, _extends({
|
|
733
|
+
isStart: true
|
|
734
|
+
}, props));
|
|
889
735
|
StartIconComponent.displayName = 'Span.StartIcon';
|
|
890
|
-
|
|
736
|
+
const StartIcon = StartIconComponent;
|
|
891
737
|
|
|
892
|
-
|
|
893
|
-
return React.createElement(StyledIcon, props);
|
|
894
|
-
};
|
|
738
|
+
const IconComponent = props => React.createElement(StyledIcon, props);
|
|
895
739
|
IconComponent.displayName = 'Span.Icon';
|
|
896
|
-
|
|
740
|
+
const Icon = IconComponent;
|
|
897
741
|
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
742
|
+
const SpanComponent = forwardRef((_ref, ref) => {
|
|
743
|
+
let {
|
|
744
|
+
tag,
|
|
745
|
+
...other
|
|
746
|
+
} = _ref;
|
|
902
747
|
return React.createElement(StyledFont, _extends({
|
|
903
748
|
as: tag,
|
|
904
749
|
ref: ref,
|
|
@@ -915,7 +760,7 @@ SpanComponent.propTypes = {
|
|
|
915
760
|
SpanComponent.defaultProps = {
|
|
916
761
|
tag: 'span'
|
|
917
762
|
};
|
|
918
|
-
|
|
763
|
+
const Span = SpanComponent;
|
|
919
764
|
Span.Icon = Icon;
|
|
920
765
|
Span.StartIcon = StartIcon;
|
|
921
766
|
|