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