@zendeskgarden/react-typography 8.49.2 → 8.50.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 +152 -145
- package/dist/index.esm.js +153 -146
- package/dist/typings/elements/Blockquote.d.ts +2 -5
- package/dist/typings/elements/Code.d.ts +2 -7
- package/dist/typings/elements/CodeBlock.d.ts +2 -17
- package/dist/typings/elements/Ellipsis.d.ts +2 -7
- package/dist/typings/elements/LG.d.ts +3 -10
- package/dist/typings/elements/MD.d.ts +3 -10
- package/dist/typings/elements/Paragraph.d.ts +2 -5
- package/dist/typings/elements/SM.d.ts +3 -10
- package/dist/typings/elements/XL.d.ts +3 -8
- package/dist/typings/elements/XXL.d.ts +3 -8
- package/dist/typings/elements/XXXL.d.ts +3 -8
- package/dist/typings/elements/lists/OrderedList.d.ts +2 -7
- package/dist/typings/elements/lists/UnorderedList.d.ts +2 -7
- package/dist/typings/elements/span/Span.d.ts +2 -15
- package/dist/typings/index.d.ts +1 -14
- package/dist/typings/styled/StyledBlockquote.d.ts +2 -5
- package/dist/typings/styled/StyledCode.d.ts +3 -2
- package/dist/typings/styled/StyledCodeBlockLine.d.ts +3 -4
- package/dist/typings/styled/StyledFont.d.ts +7 -1
- package/dist/typings/styled/StyledList.d.ts +3 -2
- package/dist/typings/styled/StyledListItem.d.ts +2 -1
- package/dist/typings/styled/StyledParagraph.d.ts +2 -5
- package/dist/typings/types/index.d.ts +84 -0
- package/dist/typings/utils/useOrderedListContext.d.ts +2 -1
- package/dist/typings/utils/useUnorderedListContext.d.ts +2 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import React, { Children, forwardRef, useRef, useMemo, createContext, useContext } from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import styled, { css } from 'styled-components';
|
|
11
|
-
import {
|
|
11
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
12
12
|
import { math } from 'polished';
|
|
13
13
|
import Highlight, { Prism } from 'prism-react-renderer';
|
|
14
14
|
import { useScrollRegion } from '@zendeskgarden/container-scrollregion';
|
|
@@ -67,40 +67,61 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
67
67
|
return target;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})(["margin:0;border-", ":", " solid;border-color:", ";padding:0;padding-", ":", "px;direction:", ";p + &,& + &{margin-top:", ";}", ";"], function (props) {
|
|
78
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
79
|
-
}, function (props) {
|
|
80
|
-
return props.theme.shadowWidths.sm;
|
|
81
|
-
}, function (props) {
|
|
82
|
-
return getColor('neutralHue', 400, props.theme);
|
|
83
|
-
}, function (props) {
|
|
84
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
85
|
-
}, function (props) {
|
|
86
|
-
return props.theme.space.base * 4;
|
|
87
|
-
}, function (props) {
|
|
88
|
-
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
89
|
-
}, function (props) {
|
|
90
|
-
return props.theme.lineHeights[props.size];
|
|
91
|
-
}, function (props) {
|
|
92
|
-
return retrieveComponentStyles(COMPONENT_ID$9, props);
|
|
93
|
-
});
|
|
94
|
-
StyledBlockquote.defaultProps = {
|
|
95
|
-
theme: DEFAULT_THEME,
|
|
96
|
-
size: 'md'
|
|
97
|
-
};
|
|
70
|
+
function _toConsumableArray(arr) {
|
|
71
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function _arrayWithoutHoles(arr) {
|
|
75
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
76
|
+
}
|
|
98
77
|
|
|
99
|
-
|
|
78
|
+
function _iterableToArray(iter) {
|
|
79
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
83
|
+
if (!o) return;
|
|
84
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
85
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
86
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
87
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
88
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function _arrayLikeToArray(arr, len) {
|
|
92
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
93
|
+
|
|
94
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
95
|
+
|
|
96
|
+
return arr2;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function _nonIterableSpread() {
|
|
100
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
var HUE = ['grey', 'red', 'green', 'yellow'];
|
|
104
|
+
var SIZE = ['small', 'medium', 'large'];
|
|
105
|
+
var INHERIT_SIZE = ['inherit'].concat(SIZE);
|
|
106
|
+
var TYPE_ORDERED_LIST = ['decimal', 'decimal-leading-zero', 'lower-alpha', 'lower-roman', 'upper-alpha', 'upper-roman'];
|
|
107
|
+
var TYPE_UNORDERED_LIST = ['circle', 'disc', 'square'];
|
|
108
|
+
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'];
|
|
109
|
+
|
|
110
|
+
var COMPONENT_ID$9 = 'typography.font';
|
|
111
|
+
var TYPOGRAPHY_SIZE = [].concat(_toConsumableArray(SIZE), ['extralarge', '2xlarge', '3xlarge']);
|
|
112
|
+
['inherit'].concat(_toConsumableArray(TYPOGRAPHY_SIZE));
|
|
113
|
+
var THEME_SIZES = {
|
|
114
|
+
small: 'sm',
|
|
115
|
+
medium: 'md',
|
|
116
|
+
large: 'lg',
|
|
117
|
+
extralarge: 'xl',
|
|
118
|
+
'2xlarge': 'xxl',
|
|
119
|
+
'3xlarge': 'xxxl'
|
|
120
|
+
};
|
|
100
121
|
var fontStyles = function fontStyles(props) {
|
|
101
|
-
var monospace = props.isMonospace && ['
|
|
122
|
+
var monospace = props.isMonospace && ['inherit', 'small', 'medium', 'large'].indexOf(props.size) !== -1;
|
|
102
123
|
var fontFamily = monospace && props.theme.fonts.mono;
|
|
103
|
-
var direction =
|
|
124
|
+
var direction = props.theme.rtl ? 'rtl' : 'ltr';
|
|
104
125
|
var fontSize;
|
|
105
126
|
var fontWeight;
|
|
106
127
|
var lineHeight;
|
|
@@ -110,12 +131,14 @@ var fontStyles = function fontStyles(props) {
|
|
|
110
131
|
fontSize = 'calc(1em - 1px)';
|
|
111
132
|
lineHeight = 'normal';
|
|
112
133
|
} else {
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
var themeSize = THEME_SIZES[props.size];
|
|
135
|
+
fontSize = math("".concat(props.theme.fontSizes[themeSize], " - 1px"));
|
|
136
|
+
lineHeight = math("".concat(props.theme.lineHeights[themeSize], " - 1px"));
|
|
115
137
|
}
|
|
116
138
|
} else if (props.size !== 'inherit') {
|
|
117
|
-
|
|
118
|
-
|
|
139
|
+
var _themeSize = THEME_SIZES[props.size];
|
|
140
|
+
fontSize = props.theme.fontSizes[_themeSize];
|
|
141
|
+
lineHeight = props.theme.lineHeights[_themeSize];
|
|
119
142
|
}
|
|
120
143
|
if (props.isBold === true) {
|
|
121
144
|
fontWeight = props.theme.fontWeights.semibold;
|
|
@@ -129,21 +152,49 @@ var fontStyles = function fontStyles(props) {
|
|
|
129
152
|
return css(["line-height:", ";color:", ";font-family:", ";font-size:", ";font-weight:", ";direction:", ";"], lineHeight, color, fontFamily, fontSize, fontWeight, direction);
|
|
130
153
|
};
|
|
131
154
|
var StyledFont = styled.div.attrs({
|
|
132
|
-
'data-garden-id': COMPONENT_ID$
|
|
133
|
-
'data-garden-version': '8.
|
|
155
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
156
|
+
'data-garden-version': '8.50.0'
|
|
134
157
|
}).withConfig({
|
|
135
158
|
displayName: "StyledFont",
|
|
136
159
|
componentId: "sc-1iildbo-0"
|
|
137
160
|
})(["", ";", ";"], function (props) {
|
|
138
161
|
return fontStyles(props);
|
|
139
162
|
}, function (props) {
|
|
140
|
-
return retrieveComponentStyles(COMPONENT_ID$
|
|
163
|
+
return retrieveComponentStyles(COMPONENT_ID$9, props);
|
|
141
164
|
});
|
|
142
165
|
StyledFont.defaultProps = {
|
|
143
166
|
theme: DEFAULT_THEME,
|
|
144
167
|
size: 'inherit'
|
|
145
168
|
};
|
|
146
169
|
|
|
170
|
+
var COMPONENT_ID$8 = 'typography.blockquote';
|
|
171
|
+
var StyledBlockquote = styled.blockquote.attrs({
|
|
172
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
173
|
+
'data-garden-version': '8.50.0'
|
|
174
|
+
}).withConfig({
|
|
175
|
+
displayName: "StyledBlockquote",
|
|
176
|
+
componentId: "sc-1tt3ye0-0"
|
|
177
|
+
})(["margin:0;border-", ":", " solid;border-color:", ";padding:0;padding-", ":", "px;direction:", ";p + &,& + &{margin-top:", ";}", ";"], function (props) {
|
|
178
|
+
return props.theme.rtl ? 'right' : 'left';
|
|
179
|
+
}, function (props) {
|
|
180
|
+
return props.theme.shadowWidths.sm;
|
|
181
|
+
}, function (props) {
|
|
182
|
+
return getColor('neutralHue', 400, props.theme);
|
|
183
|
+
}, function (props) {
|
|
184
|
+
return props.theme.rtl ? 'right' : 'left';
|
|
185
|
+
}, function (props) {
|
|
186
|
+
return props.theme.space.base * 4;
|
|
187
|
+
}, function (props) {
|
|
188
|
+
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
189
|
+
}, function (props) {
|
|
190
|
+
return props.theme.lineHeights[THEME_SIZES[props.size]];
|
|
191
|
+
}, function (props) {
|
|
192
|
+
return retrieveComponentStyles(COMPONENT_ID$8, props);
|
|
193
|
+
});
|
|
194
|
+
StyledBlockquote.defaultProps = {
|
|
195
|
+
theme: DEFAULT_THEME
|
|
196
|
+
};
|
|
197
|
+
|
|
147
198
|
var COMPONENT_ID$7 = 'typography.code';
|
|
148
199
|
var colorStyles$3 = function colorStyles(props) {
|
|
149
200
|
var hue = props.hue || 'neutralHue';
|
|
@@ -154,7 +205,7 @@ var colorStyles$3 = function colorStyles(props) {
|
|
|
154
205
|
};
|
|
155
206
|
var StyledCode = styled(StyledFont).attrs({
|
|
156
207
|
'data-garden-id': COMPONENT_ID$7,
|
|
157
|
-
'data-garden-version': '8.
|
|
208
|
+
'data-garden-version': '8.50.0',
|
|
158
209
|
as: 'code'
|
|
159
210
|
}).withConfig({
|
|
160
211
|
displayName: "StyledCode",
|
|
@@ -181,7 +232,7 @@ var colorStyles$2 = function colorStyles(props) {
|
|
|
181
232
|
};
|
|
182
233
|
var StyledCodeBlock = styled.pre.attrs({
|
|
183
234
|
'data-garden-id': COMPONENT_ID$6,
|
|
184
|
-
'data-garden-version': '8.
|
|
235
|
+
'data-garden-version': '8.50.0'
|
|
185
236
|
}).withConfig({
|
|
186
237
|
displayName: "StyledCodeBlock",
|
|
187
238
|
componentId: "sc-5wky57-0"
|
|
@@ -199,7 +250,7 @@ StyledCodeBlock.defaultProps = {
|
|
|
199
250
|
var COMPONENT_ID$5 = 'typography.codeblock_container';
|
|
200
251
|
var StyledCodeBlockContainer = styled.div.attrs({
|
|
201
252
|
'data-garden-id': COMPONENT_ID$5,
|
|
202
|
-
'data-garden-version': '8.
|
|
253
|
+
'data-garden-version': '8.50.0'
|
|
203
254
|
}).withConfig({
|
|
204
255
|
displayName: "StyledCodeBlockContainer",
|
|
205
256
|
componentId: "sc-14zgbfw-0"
|
|
@@ -243,9 +294,9 @@ var lineNumberStyles = function lineNumberStyles(props) {
|
|
|
243
294
|
var padding;
|
|
244
295
|
if (props.language && props.language === 'diff') {
|
|
245
296
|
padding = 0;
|
|
246
|
-
} else if (props.size === '
|
|
297
|
+
} else if (props.size === 'small') {
|
|
247
298
|
padding = props.theme.space.base * 4;
|
|
248
|
-
} else if (props.size === '
|
|
299
|
+
} else if (props.size === 'large') {
|
|
249
300
|
padding = props.theme.space.base * 7;
|
|
250
301
|
} else {
|
|
251
302
|
padding = props.theme.space.base * 6;
|
|
@@ -254,14 +305,14 @@ var lineNumberStyles = function lineNumberStyles(props) {
|
|
|
254
305
|
};
|
|
255
306
|
var StyledCodeBlockLine = styled(StyledFont).attrs({
|
|
256
307
|
'data-garden-id': COMPONENT_ID$4,
|
|
257
|
-
'data-garden-version': '8.
|
|
308
|
+
'data-garden-version': '8.50.0',
|
|
258
309
|
as: 'code',
|
|
259
310
|
isMonospace: true
|
|
260
311
|
}).withConfig({
|
|
261
312
|
displayName: "StyledCodeBlockLine",
|
|
262
313
|
componentId: "sc-1goay17-0"
|
|
263
314
|
})(["display:table-row;height:", ";direction:ltr;", ";", ";&::after{display:inline-block;width:", "px;content:'';}", ";"], function (props) {
|
|
264
|
-
return props.theme.lineHeights[props.size];
|
|
315
|
+
return props.theme.lineHeights[THEME_SIZES[props.size]];
|
|
265
316
|
}, function (props) {
|
|
266
317
|
return colorStyles$1(props);
|
|
267
318
|
}, function (props) {
|
|
@@ -272,7 +323,6 @@ var StyledCodeBlockLine = styled(StyledFont).attrs({
|
|
|
272
323
|
return retrieveComponentStyles(COMPONENT_ID$4, props);
|
|
273
324
|
});
|
|
274
325
|
StyledCodeBlockLine.defaultProps = {
|
|
275
|
-
size: 'md',
|
|
276
326
|
theme: DEFAULT_THEME
|
|
277
327
|
};
|
|
278
328
|
|
|
@@ -300,7 +350,7 @@ var colorStyles = function colorStyles(props) {
|
|
|
300
350
|
};
|
|
301
351
|
var StyledCodeBlockToken = styled.span.attrs({
|
|
302
352
|
'data-garden-id': COMPONENT_ID$3,
|
|
303
|
-
'data-garden-version': '8.
|
|
353
|
+
'data-garden-version': '8.50.0'
|
|
304
354
|
}).withConfig({
|
|
305
355
|
displayName: "StyledCodeBlockToken",
|
|
306
356
|
componentId: "sc-1hkshdq-0"
|
|
@@ -318,12 +368,12 @@ StyledCodeBlockToken.defaultProps = {
|
|
|
318
368
|
var COMPONENT_ID$2 = 'typography.ellipsis';
|
|
319
369
|
var StyledEllipsis = styled.div.attrs({
|
|
320
370
|
'data-garden-id': COMPONENT_ID$2,
|
|
321
|
-
'data-garden-version': '8.
|
|
371
|
+
'data-garden-version': '8.50.0'
|
|
322
372
|
}).withConfig({
|
|
323
373
|
displayName: "StyledEllipsis",
|
|
324
374
|
componentId: "sc-1u4uqmy-0"
|
|
325
375
|
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:", ";", ";"], function (props) {
|
|
326
|
-
return
|
|
376
|
+
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
327
377
|
}, function (props) {
|
|
328
378
|
return retrieveComponentStyles(COMPONENT_ID$2, props);
|
|
329
379
|
});
|
|
@@ -331,7 +381,7 @@ StyledEllipsis.defaultProps = {
|
|
|
331
381
|
theme: DEFAULT_THEME
|
|
332
382
|
};
|
|
333
383
|
|
|
334
|
-
var _excluded$
|
|
384
|
+
var _excluded$c = ["children", "isStart"];
|
|
335
385
|
var COMPONENT_ID$1 = 'typography.icon';
|
|
336
386
|
var sizeStyles = function sizeStyles(props) {
|
|
337
387
|
var margin = props.isStart && "".concat(props.theme.space.base * 2, "px");
|
|
@@ -341,11 +391,11 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
341
391
|
var StyledIcon = styled(function (_ref) {
|
|
342
392
|
var children = _ref.children;
|
|
343
393
|
_ref.isStart;
|
|
344
|
-
var props = _objectWithoutProperties(_ref, _excluded$
|
|
394
|
+
var props = _objectWithoutProperties(_ref, _excluded$c);
|
|
345
395
|
return React.cloneElement(Children.only(children), props);
|
|
346
396
|
}).attrs({
|
|
347
397
|
'data-garden-id': COMPONENT_ID$1,
|
|
348
|
-
'data-garden-version': '8.
|
|
398
|
+
'data-garden-version': '8.50.0'
|
|
349
399
|
}).withConfig({
|
|
350
400
|
displayName: "StyledIcon",
|
|
351
401
|
componentId: "sc-10rfb5b-0"
|
|
@@ -359,13 +409,13 @@ StyledIcon.defaultProps = {
|
|
|
359
409
|
};
|
|
360
410
|
|
|
361
411
|
var listStyles = function listStyles(props) {
|
|
362
|
-
var rtl =
|
|
412
|
+
var rtl = props.theme.rtl;
|
|
363
413
|
return css(["direction:", ";margin:0;margin-", ":24px;padding:0;list-style-position:outside;list-style-type:", ";"], rtl ? 'rtl' : 'ltr', rtl ? 'right' : 'left', props.listType);
|
|
364
414
|
};
|
|
365
415
|
var ORDERED_ID$1 = 'typography.ordered_list';
|
|
366
416
|
var StyledOrderedList = styled.ol.attrs({
|
|
367
417
|
'data-garden-id': ORDERED_ID$1,
|
|
368
|
-
'data-garden-version': '8.
|
|
418
|
+
'data-garden-version': '8.50.0'
|
|
369
419
|
}).withConfig({
|
|
370
420
|
displayName: "StyledList__StyledOrderedList",
|
|
371
421
|
componentId: "sc-jdbsfi-0"
|
|
@@ -380,7 +430,7 @@ StyledOrderedList.defaultProps = {
|
|
|
380
430
|
var UNORDERED_ID$1 = 'typography.unordered_list';
|
|
381
431
|
var StyledUnorderedList = styled.ul.attrs({
|
|
382
432
|
'data-garden-id': UNORDERED_ID$1,
|
|
383
|
-
'data-garden-version': '8.
|
|
433
|
+
'data-garden-version': '8.50.0'
|
|
384
434
|
}).withConfig({
|
|
385
435
|
displayName: "StyledList__StyledUnorderedList",
|
|
386
436
|
componentId: "sc-jdbsfi-1"
|
|
@@ -404,17 +454,17 @@ var listItemStyles = function listItemStyles(props) {
|
|
|
404
454
|
var ORDERED_ID = 'typography.ordered_list_item';
|
|
405
455
|
var StyledOrderedListItem = styled(StyledFont).attrs({
|
|
406
456
|
'data-garden-id': ORDERED_ID,
|
|
407
|
-
'data-garden-version': '8.
|
|
457
|
+
'data-garden-version': '8.50.0',
|
|
408
458
|
as: 'li'
|
|
409
459
|
}).withConfig({
|
|
410
460
|
displayName: "StyledListItem__StyledOrderedListItem",
|
|
411
461
|
componentId: "sc-9rsipg-0"
|
|
412
462
|
})(["margin-", ":", ";padding-", ":", ";", ";", ";"], function (props) {
|
|
413
|
-
return
|
|
463
|
+
return props.theme.rtl ? 'right' : 'left';
|
|
414
464
|
}, function (props) {
|
|
415
465
|
return math("".concat(props.theme.space.base, " * -1px"));
|
|
416
466
|
}, function (props) {
|
|
417
|
-
return
|
|
467
|
+
return props.theme.rtl ? 'right' : 'left';
|
|
418
468
|
}, function (props) {
|
|
419
469
|
return math("".concat(props.theme.space.base, " * 1px"));
|
|
420
470
|
}, function (props) {
|
|
@@ -429,7 +479,7 @@ StyledOrderedListItem.defaultProps = {
|
|
|
429
479
|
var UNORDERED_ID = 'typography.unordered_list_item';
|
|
430
480
|
var StyledUnorderedListItem = styled(StyledFont).attrs({
|
|
431
481
|
'data-garden-id': UNORDERED_ID,
|
|
432
|
-
'data-garden-version': '8.
|
|
482
|
+
'data-garden-version': '8.50.0',
|
|
433
483
|
as: 'li'
|
|
434
484
|
}).withConfig({
|
|
435
485
|
displayName: "StyledListItem__StyledUnorderedListItem",
|
|
@@ -447,30 +497,29 @@ StyledUnorderedListItem.defaultProps = {
|
|
|
447
497
|
var COMPONENT_ID = 'typography.paragraph';
|
|
448
498
|
var StyledParagraph = styled.p.attrs({
|
|
449
499
|
'data-garden-id': COMPONENT_ID,
|
|
450
|
-
'data-garden-version': '8.
|
|
500
|
+
'data-garden-version': '8.50.0'
|
|
451
501
|
}).withConfig({
|
|
452
502
|
displayName: "StyledParagraph",
|
|
453
503
|
componentId: "sc-zkuftz-0"
|
|
454
504
|
})(["margin:0;padding:0;direction:", ";blockquote + &,& + &{margin-top:", ";}", ";"], function (props) {
|
|
455
505
|
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
456
506
|
}, function (props) {
|
|
457
|
-
return props.theme.lineHeights[props.size];
|
|
507
|
+
return props.theme.lineHeights[THEME_SIZES[props.size]];
|
|
458
508
|
}, function (props) {
|
|
459
509
|
return retrieveComponentStyles(COMPONENT_ID, props);
|
|
460
510
|
});
|
|
461
511
|
StyledParagraph.defaultProps = {
|
|
462
|
-
theme: DEFAULT_THEME
|
|
463
|
-
size: 'md'
|
|
512
|
+
theme: DEFAULT_THEME
|
|
464
513
|
};
|
|
465
514
|
|
|
466
|
-
var _excluded$
|
|
515
|
+
var _excluded$b = ["tag"];
|
|
467
516
|
var SM = forwardRef(function (_ref, ref) {
|
|
468
517
|
var tag = _ref.tag,
|
|
469
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
518
|
+
other = _objectWithoutProperties(_ref, _excluded$b);
|
|
470
519
|
return React.createElement(StyledFont, _extends({
|
|
471
520
|
as: tag,
|
|
472
521
|
ref: ref,
|
|
473
|
-
size: "
|
|
522
|
+
size: "small"
|
|
474
523
|
}, other));
|
|
475
524
|
});
|
|
476
525
|
SM.displayName = 'SM';
|
|
@@ -483,14 +532,14 @@ SM.defaultProps = {
|
|
|
483
532
|
tag: 'div'
|
|
484
533
|
};
|
|
485
534
|
|
|
486
|
-
var _excluded$
|
|
535
|
+
var _excluded$a = ["tag"];
|
|
487
536
|
var MD = forwardRef(function (_ref, ref) {
|
|
488
537
|
var tag = _ref.tag,
|
|
489
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
538
|
+
other = _objectWithoutProperties(_ref, _excluded$a);
|
|
490
539
|
return React.createElement(StyledFont, _extends({
|
|
491
540
|
as: tag,
|
|
492
541
|
ref: ref,
|
|
493
|
-
size: "
|
|
542
|
+
size: "medium"
|
|
494
543
|
}, other));
|
|
495
544
|
});
|
|
496
545
|
MD.displayName = 'MD';
|
|
@@ -503,14 +552,14 @@ MD.defaultProps = {
|
|
|
503
552
|
tag: 'div'
|
|
504
553
|
};
|
|
505
554
|
|
|
506
|
-
var _excluded$
|
|
555
|
+
var _excluded$9 = ["tag"];
|
|
507
556
|
var LG = forwardRef(function (_ref, ref) {
|
|
508
557
|
var tag = _ref.tag,
|
|
509
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
558
|
+
other = _objectWithoutProperties(_ref, _excluded$9);
|
|
510
559
|
return React.createElement(StyledFont, _extends({
|
|
511
560
|
as: tag,
|
|
512
561
|
ref: ref,
|
|
513
|
-
size: "
|
|
562
|
+
size: "large"
|
|
514
563
|
}, other));
|
|
515
564
|
});
|
|
516
565
|
LG.displayName = 'LG';
|
|
@@ -523,14 +572,14 @@ LG.defaultProps = {
|
|
|
523
572
|
tag: 'div'
|
|
524
573
|
};
|
|
525
574
|
|
|
526
|
-
var _excluded$
|
|
575
|
+
var _excluded$8 = ["tag"];
|
|
527
576
|
var XL = forwardRef(function (_ref, ref) {
|
|
528
577
|
var tag = _ref.tag,
|
|
529
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
578
|
+
other = _objectWithoutProperties(_ref, _excluded$8);
|
|
530
579
|
return React.createElement(StyledFont, _extends({
|
|
531
580
|
as: tag,
|
|
532
581
|
ref: ref,
|
|
533
|
-
size: "
|
|
582
|
+
size: "extralarge"
|
|
534
583
|
}, other));
|
|
535
584
|
});
|
|
536
585
|
XL.displayName = 'XL';
|
|
@@ -542,14 +591,14 @@ XL.defaultProps = {
|
|
|
542
591
|
tag: 'div'
|
|
543
592
|
};
|
|
544
593
|
|
|
545
|
-
var _excluded$
|
|
594
|
+
var _excluded$7 = ["tag"];
|
|
546
595
|
var XXL = forwardRef(function (_ref, ref) {
|
|
547
596
|
var tag = _ref.tag,
|
|
548
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
597
|
+
other = _objectWithoutProperties(_ref, _excluded$7);
|
|
549
598
|
return React.createElement(StyledFont, _extends({
|
|
550
599
|
as: tag,
|
|
551
600
|
ref: ref,
|
|
552
|
-
size: "
|
|
601
|
+
size: "2xlarge"
|
|
553
602
|
}, other));
|
|
554
603
|
});
|
|
555
604
|
XXL.displayName = 'XXL';
|
|
@@ -561,14 +610,14 @@ XXL.defaultProps = {
|
|
|
561
610
|
tag: 'div'
|
|
562
611
|
};
|
|
563
612
|
|
|
564
|
-
var _excluded$
|
|
613
|
+
var _excluded$6 = ["tag"];
|
|
565
614
|
var XXXL = forwardRef(function (_ref, ref) {
|
|
566
615
|
var tag = _ref.tag,
|
|
567
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
616
|
+
other = _objectWithoutProperties(_ref, _excluded$6);
|
|
568
617
|
return React.createElement(StyledFont, _extends({
|
|
569
618
|
as: tag,
|
|
570
619
|
ref: ref,
|
|
571
|
-
size: "
|
|
620
|
+
size: "3xlarge"
|
|
572
621
|
}, other));
|
|
573
622
|
});
|
|
574
623
|
XXXL.displayName = 'XXXL';
|
|
@@ -580,64 +629,39 @@ XXXL.defaultProps = {
|
|
|
580
629
|
tag: 'div'
|
|
581
630
|
};
|
|
582
631
|
|
|
583
|
-
var
|
|
584
|
-
var Blockquote = React.forwardRef(function (_ref, ref) {
|
|
585
|
-
var size = _ref.size,
|
|
586
|
-
other = _objectWithoutProperties(_ref, _excluded$7);
|
|
587
|
-
var _size;
|
|
588
|
-
if (size === 'small') {
|
|
589
|
-
_size = 'sm';
|
|
590
|
-
} else if (size === 'medium') {
|
|
591
|
-
_size = 'md';
|
|
592
|
-
} else {
|
|
593
|
-
_size = 'lg';
|
|
594
|
-
}
|
|
632
|
+
var Blockquote = React.forwardRef(function (props, ref) {
|
|
595
633
|
return React.createElement(StyledBlockquote, _extends({
|
|
596
|
-
ref: ref
|
|
597
|
-
|
|
598
|
-
}, other));
|
|
634
|
+
ref: ref
|
|
635
|
+
}, props));
|
|
599
636
|
});
|
|
600
637
|
Blockquote.displayName = 'Blockquote';
|
|
601
638
|
Blockquote.propTypes = {
|
|
602
|
-
size: PropTypes.oneOf(
|
|
639
|
+
size: PropTypes.oneOf(SIZE)
|
|
603
640
|
};
|
|
604
641
|
Blockquote.defaultProps = {
|
|
605
642
|
size: 'medium'
|
|
606
643
|
};
|
|
607
644
|
|
|
608
|
-
var _excluded$
|
|
645
|
+
var _excluded$5 = ["hue"];
|
|
609
646
|
var Code = forwardRef(function (_ref, ref) {
|
|
610
|
-
var
|
|
611
|
-
|
|
612
|
-
other = _objectWithoutProperties(_ref, _excluded$6);
|
|
613
|
-
var _size;
|
|
614
|
-
if (size === 'small') {
|
|
615
|
-
_size = 'sm';
|
|
616
|
-
} else if (size === 'medium') {
|
|
617
|
-
_size = 'md';
|
|
618
|
-
} else if (size === 'large') {
|
|
619
|
-
_size = 'lg';
|
|
620
|
-
} else {
|
|
621
|
-
_size = 'inherit';
|
|
622
|
-
}
|
|
647
|
+
var hue = _ref.hue,
|
|
648
|
+
other = _objectWithoutProperties(_ref, _excluded$5);
|
|
623
649
|
return React.createElement(StyledCode, _extends({
|
|
624
650
|
ref: ref,
|
|
625
|
-
size: _size,
|
|
626
651
|
hue: hue
|
|
627
652
|
}, other));
|
|
628
653
|
});
|
|
629
654
|
Code.displayName = 'Code';
|
|
630
655
|
Code.propTypes = {
|
|
631
|
-
hue: PropTypes.oneOf(
|
|
632
|
-
size: PropTypes.oneOf(
|
|
656
|
+
hue: PropTypes.oneOf(HUE),
|
|
657
|
+
size: PropTypes.oneOf(INHERIT_SIZE)
|
|
633
658
|
};
|
|
634
659
|
Code.defaultProps = {
|
|
635
660
|
hue: 'grey',
|
|
636
661
|
size: 'inherit'
|
|
637
662
|
};
|
|
638
663
|
|
|
639
|
-
var _excluded$
|
|
640
|
-
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'];
|
|
664
|
+
var _excluded$4 = ["children", "containerProps", "highlightLines", "isLight", "isNumbered", "language", "size"];
|
|
641
665
|
var CodeBlock = React.forwardRef(function (_ref, ref) {
|
|
642
666
|
var children = _ref.children,
|
|
643
667
|
containerProps = _ref.containerProps,
|
|
@@ -646,14 +670,9 @@ var CodeBlock = React.forwardRef(function (_ref, ref) {
|
|
|
646
670
|
isNumbered = _ref.isNumbered,
|
|
647
671
|
language = _ref.language,
|
|
648
672
|
size = _ref.size,
|
|
649
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
673
|
+
other = _objectWithoutProperties(_ref, _excluded$4);
|
|
650
674
|
var containerRef = useRef(null);
|
|
651
675
|
var code = Array.isArray(children) ? children[0] : children;
|
|
652
|
-
var SIZES = {
|
|
653
|
-
small: 'sm',
|
|
654
|
-
medium: 'md',
|
|
655
|
-
large: 'lg'
|
|
656
|
-
};
|
|
657
676
|
var dependency = useMemo(function () {
|
|
658
677
|
return [size, children];
|
|
659
678
|
}, [size, children]);
|
|
@@ -707,7 +726,7 @@ var CodeBlock = React.forwardRef(function (_ref, ref) {
|
|
|
707
726
|
isLight: isLight,
|
|
708
727
|
isNumbered: isNumbered,
|
|
709
728
|
diff: getDiff(line),
|
|
710
|
-
size: size
|
|
729
|
+
size: size
|
|
711
730
|
}), line.map(function (token, tokenKey) {
|
|
712
731
|
return React.createElement(StyledCodeBlockToken, _extends({}, getTokenProps({
|
|
713
732
|
token: token
|
|
@@ -725,12 +744,12 @@ CodeBlock.defaultProps = {
|
|
|
725
744
|
size: 'medium'
|
|
726
745
|
};
|
|
727
746
|
|
|
728
|
-
var _excluded$
|
|
747
|
+
var _excluded$3 = ["children", "title", "tag"];
|
|
729
748
|
var Ellipsis = forwardRef(function (_ref, ref) {
|
|
730
749
|
var children = _ref.children,
|
|
731
750
|
title = _ref.title,
|
|
732
751
|
tag = _ref.tag,
|
|
733
|
-
other = _objectWithoutProperties(_ref, _excluded$
|
|
752
|
+
other = _objectWithoutProperties(_ref, _excluded$3);
|
|
734
753
|
var textContent = undefined;
|
|
735
754
|
if (title !== undefined) {
|
|
736
755
|
textContent = title;
|
|
@@ -752,26 +771,14 @@ Ellipsis.defaultProps = {
|
|
|
752
771
|
tag: 'div'
|
|
753
772
|
};
|
|
754
773
|
|
|
755
|
-
var
|
|
756
|
-
var Paragraph = forwardRef(function (_ref, ref) {
|
|
757
|
-
var size = _ref.size,
|
|
758
|
-
other = _objectWithoutProperties(_ref, _excluded$3);
|
|
759
|
-
var _size;
|
|
760
|
-
if (size === 'small') {
|
|
761
|
-
_size = 'sm';
|
|
762
|
-
} else if (size === 'medium') {
|
|
763
|
-
_size = 'md';
|
|
764
|
-
} else {
|
|
765
|
-
_size = 'lg';
|
|
766
|
-
}
|
|
774
|
+
var Paragraph = forwardRef(function (props, ref) {
|
|
767
775
|
return React.createElement(StyledParagraph, _extends({
|
|
768
|
-
ref: ref
|
|
769
|
-
|
|
770
|
-
}, other));
|
|
776
|
+
ref: ref
|
|
777
|
+
}, props));
|
|
771
778
|
});
|
|
772
779
|
Paragraph.displayName = 'Paragraph';
|
|
773
780
|
Paragraph.propTypes = {
|
|
774
|
-
size: PropTypes.oneOf(
|
|
781
|
+
size: PropTypes.oneOf(SIZE)
|
|
775
782
|
};
|
|
776
783
|
Paragraph.defaultProps = {
|
|
777
784
|
size: 'medium'
|
|
@@ -816,8 +823,8 @@ var OrderedListComponent = React.forwardRef(function (_ref, ref) {
|
|
|
816
823
|
});
|
|
817
824
|
OrderedListComponent.displayName = 'OrderedList';
|
|
818
825
|
OrderedListComponent.propTypes = {
|
|
819
|
-
size: PropTypes.oneOf(
|
|
820
|
-
type: PropTypes.oneOf(
|
|
826
|
+
size: PropTypes.oneOf(SIZE),
|
|
827
|
+
type: PropTypes.oneOf(TYPE_ORDERED_LIST)
|
|
821
828
|
};
|
|
822
829
|
OrderedListComponent.defaultProps = {
|
|
823
830
|
size: 'medium',
|
|
@@ -865,8 +872,8 @@ var UnorderedListComponent = forwardRef(function (_ref, ref) {
|
|
|
865
872
|
});
|
|
866
873
|
UnorderedListComponent.displayName = 'UnorderedList';
|
|
867
874
|
UnorderedListComponent.propTypes = {
|
|
868
|
-
size: PropTypes.oneOf(
|
|
869
|
-
type: PropTypes.oneOf(
|
|
875
|
+
size: PropTypes.oneOf(SIZE),
|
|
876
|
+
type: PropTypes.oneOf(TYPE_UNORDERED_LIST)
|
|
870
877
|
};
|
|
871
878
|
UnorderedListComponent.defaultProps = {
|
|
872
879
|
size: 'medium',
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
8
|
-
|
|
9
|
-
/** Controls the spacing between sibling blockquotes */
|
|
10
|
-
size?: 'small' | 'medium' | 'large';
|
|
11
|
-
}
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { IBlockquoteProps } from '../types';
|
|
12
9
|
/**
|
|
13
10
|
* @extends BlockquoteHTMLAttributes<HTMLElement>
|
|
14
11
|
*/
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
8
|
-
|
|
9
|
-
/** Applies color to the background and the text */
|
|
10
|
-
hue?: 'grey' | 'red' | 'green' | 'yellow';
|
|
11
|
-
/** Adjusts the font size. By default font size is inherited from the surrounding text. */
|
|
12
|
-
size?: 'small' | 'medium' | 'large' | 'inherit';
|
|
13
|
-
}
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { ICodeProps } from '../types';
|
|
14
9
|
/**
|
|
15
10
|
* @extends HTMLAttributes<HTMLElement>
|
|
16
11
|
*/
|