@zendeskgarden/react-typography 8.62.1 → 8.63.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 +89 -91
- package/dist/index.esm.js +14 -14
- package/dist/typings/styled/StyledFont.d.ts +3 -3
- package/dist/typings/types/index.d.ts +7 -7
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
var PropTypes = require('prop-types');
|
|
14
12
|
var styled = require('styled-components');
|
|
@@ -17,12 +15,12 @@ var polished = require('polished');
|
|
|
17
15
|
var Highlight = require('prism-react-renderer');
|
|
18
16
|
var containerScrollregion = require('@zendeskgarden/container-scrollregion');
|
|
19
17
|
|
|
20
|
-
function
|
|
18
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
19
|
|
|
22
|
-
var React__default = /*#__PURE__*/
|
|
23
|
-
var PropTypes__default = /*#__PURE__*/
|
|
24
|
-
var styled__default = /*#__PURE__*/
|
|
25
|
-
var Highlight__default = /*#__PURE__*/
|
|
20
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
21
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
22
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
23
|
+
var Highlight__default = /*#__PURE__*/_interopDefault(Highlight);
|
|
26
24
|
|
|
27
25
|
function _extends() {
|
|
28
26
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -89,9 +87,9 @@ const fontStyles = props => {
|
|
|
89
87
|
}
|
|
90
88
|
return styled.css(["line-height:", ";color:", ";font-family:", ";font-size:", ";font-weight:", ";direction:", ";"], lineHeight, color, fontFamily, fontSize, fontWeight, direction);
|
|
91
89
|
};
|
|
92
|
-
const StyledFont = styled__default
|
|
90
|
+
const StyledFont = styled__default.default.div.attrs({
|
|
93
91
|
'data-garden-id': COMPONENT_ID$9,
|
|
94
|
-
'data-garden-version': '8.
|
|
92
|
+
'data-garden-version': '8.63.0'
|
|
95
93
|
}).withConfig({
|
|
96
94
|
displayName: "StyledFont",
|
|
97
95
|
componentId: "sc-1iildbo-0"
|
|
@@ -102,9 +100,9 @@ StyledFont.defaultProps = {
|
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
const COMPONENT_ID$8 = 'typography.blockquote';
|
|
105
|
-
const StyledBlockquote = styled__default
|
|
103
|
+
const StyledBlockquote = styled__default.default.blockquote.attrs({
|
|
106
104
|
'data-garden-id': COMPONENT_ID$8,
|
|
107
|
-
'data-garden-version': '8.
|
|
105
|
+
'data-garden-version': '8.63.0'
|
|
108
106
|
}).withConfig({
|
|
109
107
|
displayName: "StyledBlockquote",
|
|
110
108
|
componentId: "sc-1tt3ye0-0"
|
|
@@ -121,9 +119,9 @@ const colorStyles$3 = props => {
|
|
|
121
119
|
const foregroundColor = reactTheming.getColor(hue, shade, props.theme);
|
|
122
120
|
return styled.css(["background-color:", ";color:", ";a &{color:inherit;}"], backgroundColor, foregroundColor);
|
|
123
121
|
};
|
|
124
|
-
const StyledCode = styled__default
|
|
122
|
+
const StyledCode = styled__default.default(StyledFont).attrs({
|
|
125
123
|
'data-garden-id': COMPONENT_ID$7,
|
|
126
|
-
'data-garden-version': '8.
|
|
124
|
+
'data-garden-version': '8.63.0',
|
|
127
125
|
as: 'code'
|
|
128
126
|
}).withConfig({
|
|
129
127
|
displayName: "StyledCode",
|
|
@@ -142,9 +140,9 @@ const colorStyles$2 = props => {
|
|
|
142
140
|
const foregroundColor = props.isLight ? props.theme.colors.foreground : reactTheming.getColor('neutralHue', 300, props.theme);
|
|
143
141
|
return styled.css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
144
142
|
};
|
|
145
|
-
const StyledCodeBlock = styled__default
|
|
143
|
+
const StyledCodeBlock = styled__default.default.pre.attrs({
|
|
146
144
|
'data-garden-id': COMPONENT_ID$6,
|
|
147
|
-
'data-garden-version': '8.
|
|
145
|
+
'data-garden-version': '8.63.0'
|
|
148
146
|
}).withConfig({
|
|
149
147
|
displayName: "StyledCodeBlock",
|
|
150
148
|
componentId: "sc-5wky57-0"
|
|
@@ -154,9 +152,9 @@ StyledCodeBlock.defaultProps = {
|
|
|
154
152
|
};
|
|
155
153
|
|
|
156
154
|
const COMPONENT_ID$5 = 'typography.codeblock_container';
|
|
157
|
-
const StyledCodeBlockContainer = styled__default
|
|
155
|
+
const StyledCodeBlockContainer = styled__default.default.div.attrs({
|
|
158
156
|
'data-garden-id': COMPONENT_ID$5,
|
|
159
|
-
'data-garden-version': '8.
|
|
157
|
+
'data-garden-version': '8.63.0'
|
|
160
158
|
}).withConfig({
|
|
161
159
|
displayName: "StyledCodeBlockContainer",
|
|
162
160
|
componentId: "sc-14zgbfw-0"
|
|
@@ -215,9 +213,9 @@ const lineNumberStyles = props => {
|
|
|
215
213
|
}
|
|
216
214
|
`;
|
|
217
215
|
};
|
|
218
|
-
const StyledCodeBlockLine = styled__default
|
|
216
|
+
const StyledCodeBlockLine = styled__default.default(StyledFont).attrs({
|
|
219
217
|
'data-garden-id': COMPONENT_ID$4,
|
|
220
|
-
'data-garden-version': '8.
|
|
218
|
+
'data-garden-version': '8.63.0',
|
|
221
219
|
as: 'code',
|
|
222
220
|
isMonospace: true
|
|
223
221
|
}).withConfig({
|
|
@@ -250,9 +248,9 @@ const colorStyles = props => {
|
|
|
250
248
|
};
|
|
251
249
|
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);
|
|
252
250
|
};
|
|
253
|
-
const StyledCodeBlockToken = styled__default
|
|
251
|
+
const StyledCodeBlockToken = styled__default.default.span.attrs({
|
|
254
252
|
'data-garden-id': COMPONENT_ID$3,
|
|
255
|
-
'data-garden-version': '8.
|
|
253
|
+
'data-garden-version': '8.63.0'
|
|
256
254
|
}).withConfig({
|
|
257
255
|
displayName: "StyledCodeBlockToken",
|
|
258
256
|
componentId: "sc-1hkshdq-0"
|
|
@@ -262,9 +260,9 @@ StyledCodeBlockToken.defaultProps = {
|
|
|
262
260
|
};
|
|
263
261
|
|
|
264
262
|
const COMPONENT_ID$2 = 'typography.ellipsis';
|
|
265
|
-
const StyledEllipsis = styled__default
|
|
263
|
+
const StyledEllipsis = styled__default.default.div.attrs({
|
|
266
264
|
'data-garden-id': COMPONENT_ID$2,
|
|
267
|
-
'data-garden-version': '8.
|
|
265
|
+
'data-garden-version': '8.63.0'
|
|
268
266
|
}).withConfig({
|
|
269
267
|
displayName: "StyledEllipsis",
|
|
270
268
|
componentId: "sc-1u4uqmy-0"
|
|
@@ -279,16 +277,16 @@ const sizeStyles = props => {
|
|
|
279
277
|
const size = props.theme.iconSizes.md;
|
|
280
278
|
return styled.css(["margin-", ":", ";width:", ";height:", ";"], props.theme.rtl ? 'left' : 'right', margin, size, size);
|
|
281
279
|
};
|
|
282
|
-
const StyledIcon = styled__default
|
|
280
|
+
const StyledIcon = styled__default.default(_ref => {
|
|
283
281
|
let {
|
|
284
282
|
children,
|
|
285
283
|
isStart,
|
|
286
284
|
...props
|
|
287
285
|
} = _ref;
|
|
288
|
-
return React__default
|
|
286
|
+
return React__default.default.cloneElement(React.Children.only(children), props);
|
|
289
287
|
}).attrs({
|
|
290
288
|
'data-garden-id': COMPONENT_ID$1,
|
|
291
|
-
'data-garden-version': '8.
|
|
289
|
+
'data-garden-version': '8.63.0'
|
|
292
290
|
}).withConfig({
|
|
293
291
|
displayName: "StyledIcon",
|
|
294
292
|
componentId: "sc-10rfb5b-0"
|
|
@@ -302,9 +300,9 @@ const listStyles = props => {
|
|
|
302
300
|
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);
|
|
303
301
|
};
|
|
304
302
|
const ORDERED_ID$1 = 'typography.ordered_list';
|
|
305
|
-
const StyledOrderedList = styled__default
|
|
303
|
+
const StyledOrderedList = styled__default.default.ol.attrs({
|
|
306
304
|
'data-garden-id': ORDERED_ID$1,
|
|
307
|
-
'data-garden-version': '8.
|
|
305
|
+
'data-garden-version': '8.63.0'
|
|
308
306
|
}).withConfig({
|
|
309
307
|
displayName: "StyledList__StyledOrderedList",
|
|
310
308
|
componentId: "sc-jdbsfi-0"
|
|
@@ -313,9 +311,9 @@ StyledOrderedList.defaultProps = {
|
|
|
313
311
|
theme: reactTheming.DEFAULT_THEME
|
|
314
312
|
};
|
|
315
313
|
const UNORDERED_ID$1 = 'typography.unordered_list';
|
|
316
|
-
const StyledUnorderedList = styled__default
|
|
314
|
+
const StyledUnorderedList = styled__default.default.ul.attrs({
|
|
317
315
|
'data-garden-id': UNORDERED_ID$1,
|
|
318
|
-
'data-garden-version': '8.
|
|
316
|
+
'data-garden-version': '8.63.0'
|
|
319
317
|
}).withConfig({
|
|
320
318
|
displayName: "StyledList__StyledUnorderedList",
|
|
321
319
|
componentId: "sc-jdbsfi-1"
|
|
@@ -333,9 +331,9 @@ const listItemStyles = props => {
|
|
|
333
331
|
return styled.css(["line-height:", ";", ";"], reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props.space !== 'small' && listItemPaddingStyles(props));
|
|
334
332
|
};
|
|
335
333
|
const ORDERED_ID = 'typography.ordered_list_item';
|
|
336
|
-
const StyledOrderedListItem = styled__default
|
|
334
|
+
const StyledOrderedListItem = styled__default.default(StyledFont).attrs({
|
|
337
335
|
'data-garden-id': ORDERED_ID,
|
|
338
|
-
'data-garden-version': '8.
|
|
336
|
+
'data-garden-version': '8.63.0',
|
|
339
337
|
as: 'li'
|
|
340
338
|
}).withConfig({
|
|
341
339
|
displayName: "StyledListItem__StyledOrderedListItem",
|
|
@@ -346,9 +344,9 @@ StyledOrderedListItem.defaultProps = {
|
|
|
346
344
|
theme: reactTheming.DEFAULT_THEME
|
|
347
345
|
};
|
|
348
346
|
const UNORDERED_ID = 'typography.unordered_list_item';
|
|
349
|
-
const StyledUnorderedListItem = styled__default
|
|
347
|
+
const StyledUnorderedListItem = styled__default.default(StyledFont).attrs({
|
|
350
348
|
'data-garden-id': UNORDERED_ID,
|
|
351
|
-
'data-garden-version': '8.
|
|
349
|
+
'data-garden-version': '8.63.0',
|
|
352
350
|
as: 'li'
|
|
353
351
|
}).withConfig({
|
|
354
352
|
displayName: "StyledListItem__StyledUnorderedListItem",
|
|
@@ -360,9 +358,9 @@ StyledUnorderedListItem.defaultProps = {
|
|
|
360
358
|
};
|
|
361
359
|
|
|
362
360
|
const COMPONENT_ID = 'typography.paragraph';
|
|
363
|
-
const StyledParagraph = styled__default
|
|
361
|
+
const StyledParagraph = styled__default.default.p.attrs({
|
|
364
362
|
'data-garden-id': COMPONENT_ID,
|
|
365
|
-
'data-garden-version': '8.
|
|
363
|
+
'data-garden-version': '8.63.0'
|
|
366
364
|
}).withConfig({
|
|
367
365
|
displayName: "StyledParagraph",
|
|
368
366
|
componentId: "sc-zkuftz-0"
|
|
@@ -376,7 +374,7 @@ const SM = React.forwardRef((_ref, ref) => {
|
|
|
376
374
|
tag,
|
|
377
375
|
...other
|
|
378
376
|
} = _ref;
|
|
379
|
-
return React__default
|
|
377
|
+
return React__default.default.createElement(StyledFont, _extends({
|
|
380
378
|
as: tag,
|
|
381
379
|
ref: ref,
|
|
382
380
|
size: "small"
|
|
@@ -384,9 +382,9 @@ const SM = React.forwardRef((_ref, ref) => {
|
|
|
384
382
|
});
|
|
385
383
|
SM.displayName = 'SM';
|
|
386
384
|
SM.propTypes = {
|
|
387
|
-
tag: PropTypes__default
|
|
388
|
-
isBold: PropTypes__default
|
|
389
|
-
isMonospace: PropTypes__default
|
|
385
|
+
tag: PropTypes__default.default.any,
|
|
386
|
+
isBold: PropTypes__default.default.bool,
|
|
387
|
+
isMonospace: PropTypes__default.default.bool
|
|
390
388
|
};
|
|
391
389
|
SM.defaultProps = {
|
|
392
390
|
tag: 'div'
|
|
@@ -397,7 +395,7 @@ const MD = React.forwardRef((_ref, ref) => {
|
|
|
397
395
|
tag,
|
|
398
396
|
...other
|
|
399
397
|
} = _ref;
|
|
400
|
-
return React__default
|
|
398
|
+
return React__default.default.createElement(StyledFont, _extends({
|
|
401
399
|
as: tag,
|
|
402
400
|
ref: ref,
|
|
403
401
|
size: "medium"
|
|
@@ -405,9 +403,9 @@ const MD = React.forwardRef((_ref, ref) => {
|
|
|
405
403
|
});
|
|
406
404
|
MD.displayName = 'MD';
|
|
407
405
|
MD.propTypes = {
|
|
408
|
-
tag: PropTypes__default
|
|
409
|
-
isBold: PropTypes__default
|
|
410
|
-
isMonospace: PropTypes__default
|
|
406
|
+
tag: PropTypes__default.default.any,
|
|
407
|
+
isBold: PropTypes__default.default.bool,
|
|
408
|
+
isMonospace: PropTypes__default.default.bool
|
|
411
409
|
};
|
|
412
410
|
MD.defaultProps = {
|
|
413
411
|
tag: 'div'
|
|
@@ -418,7 +416,7 @@ const LG = React.forwardRef((_ref, ref) => {
|
|
|
418
416
|
tag,
|
|
419
417
|
...other
|
|
420
418
|
} = _ref;
|
|
421
|
-
return React__default
|
|
419
|
+
return React__default.default.createElement(StyledFont, _extends({
|
|
422
420
|
as: tag,
|
|
423
421
|
ref: ref,
|
|
424
422
|
size: "large"
|
|
@@ -426,9 +424,9 @@ const LG = React.forwardRef((_ref, ref) => {
|
|
|
426
424
|
});
|
|
427
425
|
LG.displayName = 'LG';
|
|
428
426
|
LG.propTypes = {
|
|
429
|
-
tag: PropTypes__default
|
|
430
|
-
isBold: PropTypes__default
|
|
431
|
-
isMonospace: PropTypes__default
|
|
427
|
+
tag: PropTypes__default.default.any,
|
|
428
|
+
isBold: PropTypes__default.default.bool,
|
|
429
|
+
isMonospace: PropTypes__default.default.bool
|
|
432
430
|
};
|
|
433
431
|
LG.defaultProps = {
|
|
434
432
|
tag: 'div'
|
|
@@ -439,7 +437,7 @@ const XL = React.forwardRef((_ref, ref) => {
|
|
|
439
437
|
tag,
|
|
440
438
|
...other
|
|
441
439
|
} = _ref;
|
|
442
|
-
return React__default
|
|
440
|
+
return React__default.default.createElement(StyledFont, _extends({
|
|
443
441
|
as: tag,
|
|
444
442
|
ref: ref,
|
|
445
443
|
size: "extralarge"
|
|
@@ -447,8 +445,8 @@ const XL = React.forwardRef((_ref, ref) => {
|
|
|
447
445
|
});
|
|
448
446
|
XL.displayName = 'XL';
|
|
449
447
|
XL.propTypes = {
|
|
450
|
-
tag: PropTypes__default
|
|
451
|
-
isBold: PropTypes__default
|
|
448
|
+
tag: PropTypes__default.default.any,
|
|
449
|
+
isBold: PropTypes__default.default.bool
|
|
452
450
|
};
|
|
453
451
|
XL.defaultProps = {
|
|
454
452
|
tag: 'div'
|
|
@@ -459,7 +457,7 @@ const XXL = React.forwardRef((_ref, ref) => {
|
|
|
459
457
|
tag,
|
|
460
458
|
...other
|
|
461
459
|
} = _ref;
|
|
462
|
-
return React__default
|
|
460
|
+
return React__default.default.createElement(StyledFont, _extends({
|
|
463
461
|
as: tag,
|
|
464
462
|
ref: ref,
|
|
465
463
|
size: "2xlarge"
|
|
@@ -467,8 +465,8 @@ const XXL = React.forwardRef((_ref, ref) => {
|
|
|
467
465
|
});
|
|
468
466
|
XXL.displayName = 'XXL';
|
|
469
467
|
XXL.propTypes = {
|
|
470
|
-
tag: PropTypes__default
|
|
471
|
-
isBold: PropTypes__default
|
|
468
|
+
tag: PropTypes__default.default.any,
|
|
469
|
+
isBold: PropTypes__default.default.bool
|
|
472
470
|
};
|
|
473
471
|
XXL.defaultProps = {
|
|
474
472
|
tag: 'div'
|
|
@@ -479,7 +477,7 @@ const XXXL = React.forwardRef((_ref, ref) => {
|
|
|
479
477
|
tag,
|
|
480
478
|
...other
|
|
481
479
|
} = _ref;
|
|
482
|
-
return React__default
|
|
480
|
+
return React__default.default.createElement(StyledFont, _extends({
|
|
483
481
|
as: tag,
|
|
484
482
|
ref: ref,
|
|
485
483
|
size: "3xlarge"
|
|
@@ -487,19 +485,19 @@ const XXXL = React.forwardRef((_ref, ref) => {
|
|
|
487
485
|
});
|
|
488
486
|
XXXL.displayName = 'XXXL';
|
|
489
487
|
XXXL.propTypes = {
|
|
490
|
-
tag: PropTypes__default
|
|
491
|
-
isBold: PropTypes__default
|
|
488
|
+
tag: PropTypes__default.default.any,
|
|
489
|
+
isBold: PropTypes__default.default.bool
|
|
492
490
|
};
|
|
493
491
|
XXXL.defaultProps = {
|
|
494
492
|
tag: 'div'
|
|
495
493
|
};
|
|
496
494
|
|
|
497
|
-
const Blockquote = React__default
|
|
495
|
+
const Blockquote = React__default.default.forwardRef((props, ref) => React__default.default.createElement(StyledBlockquote, _extends({
|
|
498
496
|
ref: ref
|
|
499
497
|
}, props)));
|
|
500
498
|
Blockquote.displayName = 'Blockquote';
|
|
501
499
|
Blockquote.propTypes = {
|
|
502
|
-
size: PropTypes__default
|
|
500
|
+
size: PropTypes__default.default.oneOf(SIZE)
|
|
503
501
|
};
|
|
504
502
|
Blockquote.defaultProps = {
|
|
505
503
|
size: 'medium'
|
|
@@ -510,22 +508,22 @@ const Code = React.forwardRef((_ref, ref) => {
|
|
|
510
508
|
hue,
|
|
511
509
|
...other
|
|
512
510
|
} = _ref;
|
|
513
|
-
return React__default
|
|
511
|
+
return React__default.default.createElement(StyledCode, _extends({
|
|
514
512
|
ref: ref,
|
|
515
513
|
hue: hue
|
|
516
514
|
}, other));
|
|
517
515
|
});
|
|
518
516
|
Code.displayName = 'Code';
|
|
519
517
|
Code.propTypes = {
|
|
520
|
-
hue: PropTypes__default
|
|
521
|
-
size: PropTypes__default
|
|
518
|
+
hue: PropTypes__default.default.oneOf(HUE),
|
|
519
|
+
size: PropTypes__default.default.oneOf(INHERIT_SIZE)
|
|
522
520
|
};
|
|
523
521
|
Code.defaultProps = {
|
|
524
522
|
hue: 'grey',
|
|
525
523
|
size: 'inherit'
|
|
526
524
|
};
|
|
527
525
|
|
|
528
|
-
const CodeBlock = React__default
|
|
526
|
+
const CodeBlock = React__default.default.forwardRef((_ref, ref) => {
|
|
529
527
|
let {
|
|
530
528
|
children,
|
|
531
529
|
containerProps,
|
|
@@ -561,10 +559,10 @@ const CodeBlock = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
561
559
|
}
|
|
562
560
|
return retVal;
|
|
563
561
|
};
|
|
564
|
-
return React__default
|
|
562
|
+
return React__default.default.createElement(StyledCodeBlockContainer, _extends({}, containerProps, {
|
|
565
563
|
ref: containerRef,
|
|
566
564
|
tabIndex: containerTabIndex
|
|
567
|
-
}), React__default
|
|
565
|
+
}), React__default.default.createElement(Highlight__default.default, {
|
|
568
566
|
Prism: Highlight.Prism,
|
|
569
567
|
code: code ? code.trim() : '',
|
|
570
568
|
language: LANGUAGES.includes(language) ? language : 'tsx'
|
|
@@ -575,11 +573,11 @@ const CodeBlock = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
575
573
|
getLineProps,
|
|
576
574
|
getTokenProps
|
|
577
575
|
} = _ref2;
|
|
578
|
-
return React__default
|
|
576
|
+
return React__default.default.createElement(StyledCodeBlock, _extends({
|
|
579
577
|
className: className,
|
|
580
578
|
ref: ref,
|
|
581
579
|
isLight: isLight
|
|
582
|
-
}, other), tokens.map((line, index) => React__default
|
|
580
|
+
}, other), tokens.map((line, index) => React__default.default.createElement(StyledCodeBlockLine, _extends({}, getLineProps({
|
|
583
581
|
line
|
|
584
582
|
}), {
|
|
585
583
|
key: index,
|
|
@@ -589,7 +587,7 @@ const CodeBlock = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
589
587
|
isNumbered: isNumbered,
|
|
590
588
|
diff: getDiff(line),
|
|
591
589
|
size: size
|
|
592
|
-
}), line.map((token, tokenKey) => React__default
|
|
590
|
+
}), line.map((token, tokenKey) => React__default.default.createElement(StyledCodeBlockToken, _extends({}, getTokenProps({
|
|
593
591
|
token
|
|
594
592
|
}), {
|
|
595
593
|
key: tokenKey,
|
|
@@ -616,7 +614,7 @@ const Ellipsis = React.forwardRef((_ref, ref) => {
|
|
|
616
614
|
} else if (typeof children === 'string') {
|
|
617
615
|
textContent = children;
|
|
618
616
|
}
|
|
619
|
-
return React__default
|
|
617
|
+
return React__default.default.createElement(StyledEllipsis, _extends({
|
|
620
618
|
as: tag,
|
|
621
619
|
ref: ref,
|
|
622
620
|
title: textContent
|
|
@@ -624,19 +622,19 @@ const Ellipsis = React.forwardRef((_ref, ref) => {
|
|
|
624
622
|
});
|
|
625
623
|
Ellipsis.displayName = 'Ellipsis';
|
|
626
624
|
Ellipsis.propTypes = {
|
|
627
|
-
title: PropTypes__default
|
|
628
|
-
tag: PropTypes__default
|
|
625
|
+
title: PropTypes__default.default.string,
|
|
626
|
+
tag: PropTypes__default.default.any
|
|
629
627
|
};
|
|
630
628
|
Ellipsis.defaultProps = {
|
|
631
629
|
tag: 'div'
|
|
632
630
|
};
|
|
633
631
|
|
|
634
|
-
const Paragraph = React.forwardRef((props, ref) => React__default
|
|
632
|
+
const Paragraph = React.forwardRef((props, ref) => React__default.default.createElement(StyledParagraph, _extends({
|
|
635
633
|
ref: ref
|
|
636
634
|
}, props)));
|
|
637
635
|
Paragraph.displayName = 'Paragraph';
|
|
638
636
|
Paragraph.propTypes = {
|
|
639
|
-
size: PropTypes__default
|
|
637
|
+
size: PropTypes__default.default.oneOf(SIZE)
|
|
640
638
|
};
|
|
641
639
|
Paragraph.defaultProps = {
|
|
642
640
|
size: 'medium'
|
|
@@ -655,7 +653,7 @@ const OrderedListItem = React.forwardRef((props, ref) => {
|
|
|
655
653
|
const {
|
|
656
654
|
size
|
|
657
655
|
} = useOrderedListContext();
|
|
658
|
-
return React__default
|
|
656
|
+
return React__default.default.createElement(StyledOrderedListItem, _extends({
|
|
659
657
|
ref: ref,
|
|
660
658
|
space: size
|
|
661
659
|
}, props));
|
|
@@ -663,7 +661,7 @@ const OrderedListItem = React.forwardRef((props, ref) => {
|
|
|
663
661
|
OrderedListItem.displayName = 'OrderedList.Item';
|
|
664
662
|
const Item$1 = OrderedListItem;
|
|
665
663
|
|
|
666
|
-
const OrderedListComponent = React__default
|
|
664
|
+
const OrderedListComponent = React__default.default.forwardRef((_ref, ref) => {
|
|
667
665
|
let {
|
|
668
666
|
size,
|
|
669
667
|
type,
|
|
@@ -672,17 +670,17 @@ const OrderedListComponent = React__default["default"].forwardRef((_ref, ref) =>
|
|
|
672
670
|
const value = React.useMemo(() => ({
|
|
673
671
|
size: size
|
|
674
672
|
}), [size]);
|
|
675
|
-
return React__default
|
|
673
|
+
return React__default.default.createElement(OrderedListContext.Provider, {
|
|
676
674
|
value: value
|
|
677
|
-
}, React__default
|
|
675
|
+
}, React__default.default.createElement(StyledOrderedList, _extends({
|
|
678
676
|
ref: ref,
|
|
679
677
|
listType: type
|
|
680
678
|
}, other)));
|
|
681
679
|
});
|
|
682
680
|
OrderedListComponent.displayName = 'OrderedList';
|
|
683
681
|
OrderedListComponent.propTypes = {
|
|
684
|
-
size: PropTypes__default
|
|
685
|
-
type: PropTypes__default
|
|
682
|
+
size: PropTypes__default.default.oneOf(SIZE),
|
|
683
|
+
type: PropTypes__default.default.oneOf(TYPE_ORDERED_LIST)
|
|
686
684
|
};
|
|
687
685
|
OrderedListComponent.defaultProps = {
|
|
688
686
|
size: 'medium',
|
|
@@ -704,7 +702,7 @@ const UnorderedListItem = React.forwardRef((props, ref) => {
|
|
|
704
702
|
const {
|
|
705
703
|
size
|
|
706
704
|
} = useUnorderedListContext();
|
|
707
|
-
return React__default
|
|
705
|
+
return React__default.default.createElement(StyledUnorderedListItem, _extends({
|
|
708
706
|
ref: ref,
|
|
709
707
|
space: size
|
|
710
708
|
}, props));
|
|
@@ -721,17 +719,17 @@ const UnorderedListComponent = React.forwardRef((_ref, ref) => {
|
|
|
721
719
|
const value = React.useMemo(() => ({
|
|
722
720
|
size: size
|
|
723
721
|
}), [size]);
|
|
724
|
-
return React__default
|
|
722
|
+
return React__default.default.createElement(UnorderedListContext.Provider, {
|
|
725
723
|
value: value
|
|
726
|
-
}, React__default
|
|
724
|
+
}, React__default.default.createElement(StyledUnorderedList, _extends({
|
|
727
725
|
ref: ref,
|
|
728
726
|
listType: type
|
|
729
727
|
}, other)));
|
|
730
728
|
});
|
|
731
729
|
UnorderedListComponent.displayName = 'UnorderedList';
|
|
732
730
|
UnorderedListComponent.propTypes = {
|
|
733
|
-
size: PropTypes__default
|
|
734
|
-
type: PropTypes__default
|
|
731
|
+
size: PropTypes__default.default.oneOf(SIZE),
|
|
732
|
+
type: PropTypes__default.default.oneOf(TYPE_UNORDERED_LIST)
|
|
735
733
|
};
|
|
736
734
|
UnorderedListComponent.defaultProps = {
|
|
737
735
|
size: 'medium',
|
|
@@ -740,13 +738,13 @@ UnorderedListComponent.defaultProps = {
|
|
|
740
738
|
const UnorderedList = UnorderedListComponent;
|
|
741
739
|
UnorderedList.Item = Item;
|
|
742
740
|
|
|
743
|
-
const StartIconComponent = props => React__default
|
|
741
|
+
const StartIconComponent = props => React__default.default.createElement(StyledIcon, _extends({
|
|
744
742
|
isStart: true
|
|
745
743
|
}, props));
|
|
746
744
|
StartIconComponent.displayName = 'Span.StartIcon';
|
|
747
745
|
const StartIcon = StartIconComponent;
|
|
748
746
|
|
|
749
|
-
const IconComponent = props => React__default
|
|
747
|
+
const IconComponent = props => React__default.default.createElement(StyledIcon, props);
|
|
750
748
|
IconComponent.displayName = 'Span.Icon';
|
|
751
749
|
const Icon = IconComponent;
|
|
752
750
|
|
|
@@ -755,7 +753,7 @@ const SpanComponent = React.forwardRef((_ref, ref) => {
|
|
|
755
753
|
tag,
|
|
756
754
|
...other
|
|
757
755
|
} = _ref;
|
|
758
|
-
return React__default
|
|
756
|
+
return React__default.default.createElement(StyledFont, _extends({
|
|
759
757
|
as: tag,
|
|
760
758
|
ref: ref,
|
|
761
759
|
size: "inherit"
|
|
@@ -763,10 +761,10 @@ const SpanComponent = React.forwardRef((_ref, ref) => {
|
|
|
763
761
|
});
|
|
764
762
|
SpanComponent.displayName = 'Span';
|
|
765
763
|
SpanComponent.propTypes = {
|
|
766
|
-
tag: PropTypes__default
|
|
767
|
-
isBold: PropTypes__default
|
|
768
|
-
isMonospace: PropTypes__default
|
|
769
|
-
hue: PropTypes__default
|
|
764
|
+
tag: PropTypes__default.default.any,
|
|
765
|
+
isBold: PropTypes__default.default.bool,
|
|
766
|
+
isMonospace: PropTypes__default.default.bool,
|
|
767
|
+
hue: PropTypes__default.default.string
|
|
770
768
|
};
|
|
771
769
|
SpanComponent.defaultProps = {
|
|
772
770
|
tag: 'span'
|
package/dist/index.esm.js
CHANGED
|
@@ -80,7 +80,7 @@ const fontStyles = props => {
|
|
|
80
80
|
};
|
|
81
81
|
const StyledFont = styled.div.attrs({
|
|
82
82
|
'data-garden-id': COMPONENT_ID$9,
|
|
83
|
-
'data-garden-version': '8.
|
|
83
|
+
'data-garden-version': '8.63.0'
|
|
84
84
|
}).withConfig({
|
|
85
85
|
displayName: "StyledFont",
|
|
86
86
|
componentId: "sc-1iildbo-0"
|
|
@@ -93,7 +93,7 @@ StyledFont.defaultProps = {
|
|
|
93
93
|
const COMPONENT_ID$8 = 'typography.blockquote';
|
|
94
94
|
const StyledBlockquote = styled.blockquote.attrs({
|
|
95
95
|
'data-garden-id': COMPONENT_ID$8,
|
|
96
|
-
'data-garden-version': '8.
|
|
96
|
+
'data-garden-version': '8.63.0'
|
|
97
97
|
}).withConfig({
|
|
98
98
|
displayName: "StyledBlockquote",
|
|
99
99
|
componentId: "sc-1tt3ye0-0"
|
|
@@ -112,7 +112,7 @@ const colorStyles$3 = props => {
|
|
|
112
112
|
};
|
|
113
113
|
const StyledCode = styled(StyledFont).attrs({
|
|
114
114
|
'data-garden-id': COMPONENT_ID$7,
|
|
115
|
-
'data-garden-version': '8.
|
|
115
|
+
'data-garden-version': '8.63.0',
|
|
116
116
|
as: 'code'
|
|
117
117
|
}).withConfig({
|
|
118
118
|
displayName: "StyledCode",
|
|
@@ -133,7 +133,7 @@ const colorStyles$2 = props => {
|
|
|
133
133
|
};
|
|
134
134
|
const StyledCodeBlock = styled.pre.attrs({
|
|
135
135
|
'data-garden-id': COMPONENT_ID$6,
|
|
136
|
-
'data-garden-version': '8.
|
|
136
|
+
'data-garden-version': '8.63.0'
|
|
137
137
|
}).withConfig({
|
|
138
138
|
displayName: "StyledCodeBlock",
|
|
139
139
|
componentId: "sc-5wky57-0"
|
|
@@ -145,7 +145,7 @@ StyledCodeBlock.defaultProps = {
|
|
|
145
145
|
const COMPONENT_ID$5 = 'typography.codeblock_container';
|
|
146
146
|
const StyledCodeBlockContainer = styled.div.attrs({
|
|
147
147
|
'data-garden-id': COMPONENT_ID$5,
|
|
148
|
-
'data-garden-version': '8.
|
|
148
|
+
'data-garden-version': '8.63.0'
|
|
149
149
|
}).withConfig({
|
|
150
150
|
displayName: "StyledCodeBlockContainer",
|
|
151
151
|
componentId: "sc-14zgbfw-0"
|
|
@@ -206,7 +206,7 @@ const lineNumberStyles = props => {
|
|
|
206
206
|
};
|
|
207
207
|
const StyledCodeBlockLine = styled(StyledFont).attrs({
|
|
208
208
|
'data-garden-id': COMPONENT_ID$4,
|
|
209
|
-
'data-garden-version': '8.
|
|
209
|
+
'data-garden-version': '8.63.0',
|
|
210
210
|
as: 'code',
|
|
211
211
|
isMonospace: true
|
|
212
212
|
}).withConfig({
|
|
@@ -241,7 +241,7 @@ const colorStyles = props => {
|
|
|
241
241
|
};
|
|
242
242
|
const StyledCodeBlockToken = styled.span.attrs({
|
|
243
243
|
'data-garden-id': COMPONENT_ID$3,
|
|
244
|
-
'data-garden-version': '8.
|
|
244
|
+
'data-garden-version': '8.63.0'
|
|
245
245
|
}).withConfig({
|
|
246
246
|
displayName: "StyledCodeBlockToken",
|
|
247
247
|
componentId: "sc-1hkshdq-0"
|
|
@@ -253,7 +253,7 @@ StyledCodeBlockToken.defaultProps = {
|
|
|
253
253
|
const COMPONENT_ID$2 = 'typography.ellipsis';
|
|
254
254
|
const StyledEllipsis = styled.div.attrs({
|
|
255
255
|
'data-garden-id': COMPONENT_ID$2,
|
|
256
|
-
'data-garden-version': '8.
|
|
256
|
+
'data-garden-version': '8.63.0'
|
|
257
257
|
}).withConfig({
|
|
258
258
|
displayName: "StyledEllipsis",
|
|
259
259
|
componentId: "sc-1u4uqmy-0"
|
|
@@ -277,7 +277,7 @@ const StyledIcon = styled(_ref => {
|
|
|
277
277
|
return React.cloneElement(Children.only(children), props);
|
|
278
278
|
}).attrs({
|
|
279
279
|
'data-garden-id': COMPONENT_ID$1,
|
|
280
|
-
'data-garden-version': '8.
|
|
280
|
+
'data-garden-version': '8.63.0'
|
|
281
281
|
}).withConfig({
|
|
282
282
|
displayName: "StyledIcon",
|
|
283
283
|
componentId: "sc-10rfb5b-0"
|
|
@@ -293,7 +293,7 @@ const listStyles = props => {
|
|
|
293
293
|
const ORDERED_ID$1 = 'typography.ordered_list';
|
|
294
294
|
const StyledOrderedList = styled.ol.attrs({
|
|
295
295
|
'data-garden-id': ORDERED_ID$1,
|
|
296
|
-
'data-garden-version': '8.
|
|
296
|
+
'data-garden-version': '8.63.0'
|
|
297
297
|
}).withConfig({
|
|
298
298
|
displayName: "StyledList__StyledOrderedList",
|
|
299
299
|
componentId: "sc-jdbsfi-0"
|
|
@@ -304,7 +304,7 @@ StyledOrderedList.defaultProps = {
|
|
|
304
304
|
const UNORDERED_ID$1 = 'typography.unordered_list';
|
|
305
305
|
const StyledUnorderedList = styled.ul.attrs({
|
|
306
306
|
'data-garden-id': UNORDERED_ID$1,
|
|
307
|
-
'data-garden-version': '8.
|
|
307
|
+
'data-garden-version': '8.63.0'
|
|
308
308
|
}).withConfig({
|
|
309
309
|
displayName: "StyledList__StyledUnorderedList",
|
|
310
310
|
componentId: "sc-jdbsfi-1"
|
|
@@ -324,7 +324,7 @@ const listItemStyles = props => {
|
|
|
324
324
|
const ORDERED_ID = 'typography.ordered_list_item';
|
|
325
325
|
const StyledOrderedListItem = styled(StyledFont).attrs({
|
|
326
326
|
'data-garden-id': ORDERED_ID,
|
|
327
|
-
'data-garden-version': '8.
|
|
327
|
+
'data-garden-version': '8.63.0',
|
|
328
328
|
as: 'li'
|
|
329
329
|
}).withConfig({
|
|
330
330
|
displayName: "StyledListItem__StyledOrderedListItem",
|
|
@@ -337,7 +337,7 @@ StyledOrderedListItem.defaultProps = {
|
|
|
337
337
|
const UNORDERED_ID = 'typography.unordered_list_item';
|
|
338
338
|
const StyledUnorderedListItem = styled(StyledFont).attrs({
|
|
339
339
|
'data-garden-id': UNORDERED_ID,
|
|
340
|
-
'data-garden-version': '8.
|
|
340
|
+
'data-garden-version': '8.63.0',
|
|
341
341
|
as: 'li'
|
|
342
342
|
}).withConfig({
|
|
343
343
|
displayName: "StyledListItem__StyledUnorderedListItem",
|
|
@@ -351,7 +351,7 @@ StyledUnorderedListItem.defaultProps = {
|
|
|
351
351
|
const COMPONENT_ID = 'typography.paragraph';
|
|
352
352
|
const StyledParagraph = styled.p.attrs({
|
|
353
353
|
'data-garden-id': COMPONENT_ID,
|
|
354
|
-
'data-garden-version': '8.
|
|
354
|
+
'data-garden-version': '8.63.0'
|
|
355
355
|
}).withConfig({
|
|
356
356
|
displayName: "StyledParagraph",
|
|
357
357
|
componentId: "sc-zkuftz-0"
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
8
|
declare const TYPOGRAPHY_SIZE: readonly ["small", "medium", "large", "extralarge", "2xlarge", "3xlarge"];
|
|
9
9
|
declare const FONT_SIZE: readonly ["inherit", "small", "medium", "large", "extralarge", "2xlarge", "3xlarge"];
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type TypographySize = (typeof TYPOGRAPHY_SIZE)[number];
|
|
11
|
+
type ThemeSize = keyof DefaultTheme['lineHeights'];
|
|
12
12
|
export declare const THEME_SIZES: Record<TypographySize, ThemeSize>;
|
|
13
13
|
export interface IStyledFontProps {
|
|
14
14
|
isBold?: boolean;
|
|
15
15
|
isMonospace?: boolean;
|
|
16
|
-
size?: typeof FONT_SIZE[number];
|
|
16
|
+
size?: (typeof FONT_SIZE)[number];
|
|
17
17
|
hue?: string;
|
|
18
18
|
}
|
|
19
19
|
export declare const StyledFont: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
@@ -11,8 +11,8 @@ export declare const INHERIT_SIZE: readonly ["inherit", "small", "medium", "larg
|
|
|
11
11
|
export declare const TYPE_ORDERED_LIST: readonly ["decimal", "decimal-leading-zero", "lower-alpha", "lower-roman", "upper-alpha", "upper-roman"];
|
|
12
12
|
export declare const TYPE_UNORDERED_LIST: readonly ["circle", "disc", "square"];
|
|
13
13
|
export declare const LANGUAGES: readonly ["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"];
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type Diff = 'hunk' | 'add' | 'delete' | 'change';
|
|
15
|
+
export type Size = (typeof SIZE)[number];
|
|
16
16
|
export interface ITypescaleProps extends HTMLAttributes<HTMLDivElement> {
|
|
17
17
|
/** Updates the element's HTML tag */
|
|
18
18
|
tag?: any;
|
|
@@ -29,13 +29,13 @@ export interface IBlockquoteProps extends BlockquoteHTMLAttributes<HTMLElement>
|
|
|
29
29
|
}
|
|
30
30
|
export interface ICodeProps extends HTMLAttributes<HTMLElement> {
|
|
31
31
|
/** Applies color to the background and the text */
|
|
32
|
-
hue?: typeof HUE[number];
|
|
32
|
+
hue?: (typeof HUE)[number];
|
|
33
33
|
/** Adjusts the font size. By default font size is inherited from the surrounding text. */
|
|
34
|
-
size?: typeof INHERIT_SIZE[number];
|
|
34
|
+
size?: (typeof INHERIT_SIZE)[number];
|
|
35
35
|
}
|
|
36
36
|
export interface ICodeBlockProps extends HTMLAttributes<HTMLPreElement> {
|
|
37
37
|
/** Selects the language used by the [Prism](https://prismjs.com/) tokenizer */
|
|
38
|
-
language?: typeof LANGUAGES[number];
|
|
38
|
+
language?: (typeof LANGUAGES)[number];
|
|
39
39
|
/** Specifies the font size */
|
|
40
40
|
size?: Size;
|
|
41
41
|
/** Applies light mode styling */
|
|
@@ -61,13 +61,13 @@ export interface IOrderedListProps extends Omit<OlHTMLAttributes<HTMLOListElemen
|
|
|
61
61
|
/** Adjusts the vertical spacing between list items */
|
|
62
62
|
size?: Size;
|
|
63
63
|
/** Sets the marker style */
|
|
64
|
-
type?: typeof TYPE_ORDERED_LIST[number];
|
|
64
|
+
type?: (typeof TYPE_ORDERED_LIST)[number];
|
|
65
65
|
}
|
|
66
66
|
export interface IUnorderedListProps extends HTMLAttributes<HTMLUListElement> {
|
|
67
67
|
/** Adjusts the vertical spacing between list items */
|
|
68
68
|
size?: Size;
|
|
69
69
|
/** Sets the marker style */
|
|
70
|
-
type?: typeof TYPE_UNORDERED_LIST[number];
|
|
70
|
+
type?: (typeof TYPE_UNORDERED_LIST)[number];
|
|
71
71
|
}
|
|
72
72
|
export interface ISpanProps extends HTMLAttributes<HTMLSpanElement> {
|
|
73
73
|
/** Updates the element's HTML tag */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-typography",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.63.0",
|
|
4
4
|
"description": "Components relating to typography in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@zendeskgarden/react-theming": "^8.
|
|
36
|
+
"@zendeskgarden/react-theming": "^8.63.0"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"components",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"zendeskgarden:src": "src/index.ts",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "4b8715305a769881b143c7195c5b31e687422926"
|
|
49
49
|
}
|