@zendeskgarden/react-typography 9.0.0-next.7 → 9.0.0-next.8
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/esm/elements/Blockquote.js +34 -0
- package/dist/esm/elements/Code.js +43 -0
- package/dist/esm/elements/CodeBlock.js +102 -0
- package/dist/esm/elements/Ellipsis.js +50 -0
- package/dist/esm/elements/LG.js +43 -0
- package/dist/esm/elements/MD.js +43 -0
- package/dist/esm/elements/Paragraph.js +34 -0
- package/dist/esm/elements/SM.js +43 -0
- package/dist/esm/elements/XL.js +42 -0
- package/dist/esm/elements/XXL.js +42 -0
- package/dist/esm/elements/XXXL.js +42 -0
- package/dist/esm/elements/lists/OrderedList.js +53 -0
- package/dist/esm/elements/lists/OrderedListItem.js +34 -0
- package/dist/esm/elements/lists/UnorderedList.js +53 -0
- package/dist/esm/elements/lists/UnorderedListItem.js +34 -0
- package/dist/esm/elements/span/Icon.js +25 -0
- package/dist/esm/elements/span/Span.js +49 -0
- package/dist/esm/elements/span/StartIcon.js +27 -0
- package/dist/esm/index.js +20 -0
- package/dist/esm/styled/StyledBlockquote.js +23 -0
- package/dist/esm/styled/StyledCode.js +34 -0
- package/dist/esm/styled/StyledCodeBlock.js +27 -0
- package/dist/esm/styled/StyledCodeBlockContainer.js +24 -0
- package/dist/esm/styled/StyledCodeBlockLine.js +74 -0
- package/dist/esm/styled/StyledCodeBlockToken.js +44 -0
- package/dist/esm/styled/StyledEllipsis.js +22 -0
- package/dist/esm/styled/StyledFont.js +67 -0
- package/dist/esm/styled/StyledIcon.js +35 -0
- package/dist/esm/styled/StyledList.js +37 -0
- package/dist/esm/styled/StyledListItem.js +48 -0
- package/dist/esm/styled/StyledParagraph.js +23 -0
- package/dist/esm/types/index.js +14 -0
- package/dist/esm/utils/useOrderedListContext.js +18 -0
- package/dist/esm/utils/useUnorderedListContext.js +18 -0
- package/dist/index.cjs.js +39 -55
- package/package.json +5 -5
- package/dist/index.esm.js +0 -769
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { SIZE } from '../types/index.js';
|
|
10
|
+
import { StyledBlockquote } from '../styled/StyledBlockquote.js';
|
|
11
|
+
import '../styled/StyledCode.js';
|
|
12
|
+
import '../styled/StyledCodeBlock.js';
|
|
13
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
14
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
15
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
16
|
+
import '../styled/StyledEllipsis.js';
|
|
17
|
+
import '../styled/StyledFont.js';
|
|
18
|
+
import '../styled/StyledIcon.js';
|
|
19
|
+
import '../styled/StyledList.js';
|
|
20
|
+
import '../styled/StyledListItem.js';
|
|
21
|
+
import '../styled/StyledParagraph.js';
|
|
22
|
+
|
|
23
|
+
const Blockquote = forwardRef((props, ref) => React.createElement(StyledBlockquote, Object.assign({
|
|
24
|
+
ref: ref
|
|
25
|
+
}, props)));
|
|
26
|
+
Blockquote.displayName = 'Blockquote';
|
|
27
|
+
Blockquote.propTypes = {
|
|
28
|
+
size: PropTypes.oneOf(SIZE)
|
|
29
|
+
};
|
|
30
|
+
Blockquote.defaultProps = {
|
|
31
|
+
size: 'medium'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { Blockquote };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { HUE, INHERIT_SIZE } from '../types/index.js';
|
|
10
|
+
import '../styled/StyledBlockquote.js';
|
|
11
|
+
import { StyledCode } from '../styled/StyledCode.js';
|
|
12
|
+
import '../styled/StyledCodeBlock.js';
|
|
13
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
14
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
15
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
16
|
+
import '../styled/StyledEllipsis.js';
|
|
17
|
+
import '../styled/StyledFont.js';
|
|
18
|
+
import '../styled/StyledIcon.js';
|
|
19
|
+
import '../styled/StyledList.js';
|
|
20
|
+
import '../styled/StyledListItem.js';
|
|
21
|
+
import '../styled/StyledParagraph.js';
|
|
22
|
+
|
|
23
|
+
const Code = forwardRef((_ref, ref) => {
|
|
24
|
+
let {
|
|
25
|
+
hue,
|
|
26
|
+
...other
|
|
27
|
+
} = _ref;
|
|
28
|
+
return React.createElement(StyledCode, Object.assign({
|
|
29
|
+
ref: ref,
|
|
30
|
+
hue: hue
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
Code.displayName = 'Code';
|
|
34
|
+
Code.propTypes = {
|
|
35
|
+
hue: PropTypes.oneOf(HUE),
|
|
36
|
+
size: PropTypes.oneOf(INHERIT_SIZE)
|
|
37
|
+
};
|
|
38
|
+
Code.defaultProps = {
|
|
39
|
+
hue: 'grey',
|
|
40
|
+
size: 'inherit'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { Code };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { useRef, useMemo } from 'react';
|
|
8
|
+
import Highlight, { Prism } from 'prism-react-renderer';
|
|
9
|
+
import { useScrollRegion } from '@zendeskgarden/container-scrollregion';
|
|
10
|
+
import { LANGUAGES } from '../types/index.js';
|
|
11
|
+
import '../styled/StyledBlockquote.js';
|
|
12
|
+
import '../styled/StyledCode.js';
|
|
13
|
+
import { StyledCodeBlock } from '../styled/StyledCodeBlock.js';
|
|
14
|
+
import { StyledCodeBlockContainer } from '../styled/StyledCodeBlockContainer.js';
|
|
15
|
+
import { StyledCodeBlockLine } from '../styled/StyledCodeBlockLine.js';
|
|
16
|
+
import { StyledCodeBlockToken } from '../styled/StyledCodeBlockToken.js';
|
|
17
|
+
import '../styled/StyledEllipsis.js';
|
|
18
|
+
import '../styled/StyledFont.js';
|
|
19
|
+
import '../styled/StyledIcon.js';
|
|
20
|
+
import '../styled/StyledList.js';
|
|
21
|
+
import '../styled/StyledListItem.js';
|
|
22
|
+
import '../styled/StyledParagraph.js';
|
|
23
|
+
|
|
24
|
+
const CodeBlock = React.forwardRef((_ref, ref) => {
|
|
25
|
+
let {
|
|
26
|
+
children,
|
|
27
|
+
containerProps,
|
|
28
|
+
highlightLines,
|
|
29
|
+
isLight,
|
|
30
|
+
isNumbered,
|
|
31
|
+
language,
|
|
32
|
+
size,
|
|
33
|
+
...other
|
|
34
|
+
} = _ref;
|
|
35
|
+
const containerRef = useRef(null);
|
|
36
|
+
const code = Array.isArray(children) ? children[0] : children;
|
|
37
|
+
const dependency = useMemo(() => [size, children], [size, children]);
|
|
38
|
+
const containerTabIndex = useScrollRegion({
|
|
39
|
+
containerRef,
|
|
40
|
+
dependency
|
|
41
|
+
});
|
|
42
|
+
const getDiff = line => {
|
|
43
|
+
let retVal;
|
|
44
|
+
if (language === 'diff') {
|
|
45
|
+
const token = line.find(value => !(value.empty || value.content === ''));
|
|
46
|
+
if (token) {
|
|
47
|
+
if (token.types.includes('deleted')) {
|
|
48
|
+
retVal = 'delete';
|
|
49
|
+
} else if (token.types.includes('inserted')) {
|
|
50
|
+
retVal = 'add';
|
|
51
|
+
} else if (token.types.includes('coord')) {
|
|
52
|
+
retVal = 'hunk';
|
|
53
|
+
} else if (token.types.includes('diff')) {
|
|
54
|
+
retVal = 'change';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return retVal;
|
|
59
|
+
};
|
|
60
|
+
return React.createElement(StyledCodeBlockContainer, Object.assign({}, containerProps, {
|
|
61
|
+
ref: containerRef,
|
|
62
|
+
tabIndex: containerTabIndex
|
|
63
|
+
}), React.createElement(Highlight, {
|
|
64
|
+
Prism: Prism,
|
|
65
|
+
code: code ? code.trim() : '',
|
|
66
|
+
language: LANGUAGES.includes(language) ? language : 'tsx'
|
|
67
|
+
}, _ref2 => {
|
|
68
|
+
let {
|
|
69
|
+
className,
|
|
70
|
+
tokens,
|
|
71
|
+
getLineProps,
|
|
72
|
+
getTokenProps
|
|
73
|
+
} = _ref2;
|
|
74
|
+
return React.createElement(StyledCodeBlock, Object.assign({
|
|
75
|
+
className: className,
|
|
76
|
+
ref: ref,
|
|
77
|
+
isLight: isLight
|
|
78
|
+
}, other), tokens.map((line, index) => React.createElement(StyledCodeBlockLine, Object.assign({}, getLineProps({
|
|
79
|
+
line
|
|
80
|
+
}), {
|
|
81
|
+
key: index,
|
|
82
|
+
language: language,
|
|
83
|
+
isHighlighted: highlightLines && highlightLines.includes(index + 1),
|
|
84
|
+
isLight: isLight,
|
|
85
|
+
isNumbered: isNumbered,
|
|
86
|
+
diff: getDiff(line),
|
|
87
|
+
size: size
|
|
88
|
+
}), line.map((token, tokenKey) => React.createElement(StyledCodeBlockToken, Object.assign({}, getTokenProps({
|
|
89
|
+
token
|
|
90
|
+
}), {
|
|
91
|
+
key: tokenKey,
|
|
92
|
+
isLight: isLight
|
|
93
|
+
}), token.empty ? '\n' : token.content)))));
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
CodeBlock.displayName = 'CodeBlock';
|
|
97
|
+
CodeBlock.defaultProps = {
|
|
98
|
+
language: 'tsx',
|
|
99
|
+
size: 'medium'
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export { CodeBlock };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import '../styled/StyledBlockquote.js';
|
|
10
|
+
import '../styled/StyledCode.js';
|
|
11
|
+
import '../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import { StyledEllipsis } from '../styled/StyledEllipsis.js';
|
|
16
|
+
import '../styled/StyledFont.js';
|
|
17
|
+
import '../styled/StyledIcon.js';
|
|
18
|
+
import '../styled/StyledList.js';
|
|
19
|
+
import '../styled/StyledListItem.js';
|
|
20
|
+
import '../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const Ellipsis = forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
children,
|
|
25
|
+
title,
|
|
26
|
+
tag,
|
|
27
|
+
...other
|
|
28
|
+
} = _ref;
|
|
29
|
+
let textContent = undefined;
|
|
30
|
+
if (title !== undefined) {
|
|
31
|
+
textContent = title;
|
|
32
|
+
} else if (typeof children === 'string') {
|
|
33
|
+
textContent = children;
|
|
34
|
+
}
|
|
35
|
+
return React.createElement(StyledEllipsis, Object.assign({
|
|
36
|
+
as: tag,
|
|
37
|
+
ref: ref,
|
|
38
|
+
title: textContent
|
|
39
|
+
}, other), children);
|
|
40
|
+
});
|
|
41
|
+
Ellipsis.displayName = 'Ellipsis';
|
|
42
|
+
Ellipsis.propTypes = {
|
|
43
|
+
title: PropTypes.string,
|
|
44
|
+
tag: PropTypes.any
|
|
45
|
+
};
|
|
46
|
+
Ellipsis.defaultProps = {
|
|
47
|
+
tag: 'div'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { Ellipsis };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import '../styled/StyledBlockquote.js';
|
|
10
|
+
import '../styled/StyledCode.js';
|
|
11
|
+
import '../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import '../styled/StyledEllipsis.js';
|
|
16
|
+
import { StyledFont } from '../styled/StyledFont.js';
|
|
17
|
+
import '../styled/StyledIcon.js';
|
|
18
|
+
import '../styled/StyledList.js';
|
|
19
|
+
import '../styled/StyledListItem.js';
|
|
20
|
+
import '../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const LG = forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
tag,
|
|
25
|
+
...other
|
|
26
|
+
} = _ref;
|
|
27
|
+
return React.createElement(StyledFont, Object.assign({
|
|
28
|
+
as: tag,
|
|
29
|
+
ref: ref,
|
|
30
|
+
size: "large"
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
LG.displayName = 'LG';
|
|
34
|
+
LG.propTypes = {
|
|
35
|
+
tag: PropTypes.any,
|
|
36
|
+
isBold: PropTypes.bool,
|
|
37
|
+
isMonospace: PropTypes.bool
|
|
38
|
+
};
|
|
39
|
+
LG.defaultProps = {
|
|
40
|
+
tag: 'div'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { LG };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import '../styled/StyledBlockquote.js';
|
|
10
|
+
import '../styled/StyledCode.js';
|
|
11
|
+
import '../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import '../styled/StyledEllipsis.js';
|
|
16
|
+
import { StyledFont } from '../styled/StyledFont.js';
|
|
17
|
+
import '../styled/StyledIcon.js';
|
|
18
|
+
import '../styled/StyledList.js';
|
|
19
|
+
import '../styled/StyledListItem.js';
|
|
20
|
+
import '../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const MD = forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
tag,
|
|
25
|
+
...other
|
|
26
|
+
} = _ref;
|
|
27
|
+
return React.createElement(StyledFont, Object.assign({
|
|
28
|
+
as: tag,
|
|
29
|
+
ref: ref,
|
|
30
|
+
size: "medium"
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
MD.displayName = 'MD';
|
|
34
|
+
MD.propTypes = {
|
|
35
|
+
tag: PropTypes.any,
|
|
36
|
+
isBold: PropTypes.bool,
|
|
37
|
+
isMonospace: PropTypes.bool
|
|
38
|
+
};
|
|
39
|
+
MD.defaultProps = {
|
|
40
|
+
tag: 'div'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { MD };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { SIZE } from '../types/index.js';
|
|
10
|
+
import '../styled/StyledBlockquote.js';
|
|
11
|
+
import '../styled/StyledCode.js';
|
|
12
|
+
import '../styled/StyledCodeBlock.js';
|
|
13
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
14
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
15
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
16
|
+
import '../styled/StyledEllipsis.js';
|
|
17
|
+
import '../styled/StyledFont.js';
|
|
18
|
+
import '../styled/StyledIcon.js';
|
|
19
|
+
import '../styled/StyledList.js';
|
|
20
|
+
import '../styled/StyledListItem.js';
|
|
21
|
+
import { StyledParagraph } from '../styled/StyledParagraph.js';
|
|
22
|
+
|
|
23
|
+
const Paragraph = forwardRef((props, ref) => React.createElement(StyledParagraph, Object.assign({
|
|
24
|
+
ref: ref
|
|
25
|
+
}, props)));
|
|
26
|
+
Paragraph.displayName = 'Paragraph';
|
|
27
|
+
Paragraph.propTypes = {
|
|
28
|
+
size: PropTypes.oneOf(SIZE)
|
|
29
|
+
};
|
|
30
|
+
Paragraph.defaultProps = {
|
|
31
|
+
size: 'medium'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { Paragraph };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import '../styled/StyledBlockquote.js';
|
|
10
|
+
import '../styled/StyledCode.js';
|
|
11
|
+
import '../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import '../styled/StyledEllipsis.js';
|
|
16
|
+
import { StyledFont } from '../styled/StyledFont.js';
|
|
17
|
+
import '../styled/StyledIcon.js';
|
|
18
|
+
import '../styled/StyledList.js';
|
|
19
|
+
import '../styled/StyledListItem.js';
|
|
20
|
+
import '../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const SM = forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
tag,
|
|
25
|
+
...other
|
|
26
|
+
} = _ref;
|
|
27
|
+
return React.createElement(StyledFont, Object.assign({
|
|
28
|
+
as: tag,
|
|
29
|
+
ref: ref,
|
|
30
|
+
size: "small"
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
SM.displayName = 'SM';
|
|
34
|
+
SM.propTypes = {
|
|
35
|
+
tag: PropTypes.any,
|
|
36
|
+
isBold: PropTypes.bool,
|
|
37
|
+
isMonospace: PropTypes.bool
|
|
38
|
+
};
|
|
39
|
+
SM.defaultProps = {
|
|
40
|
+
tag: 'div'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { SM };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import '../styled/StyledBlockquote.js';
|
|
10
|
+
import '../styled/StyledCode.js';
|
|
11
|
+
import '../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import '../styled/StyledEllipsis.js';
|
|
16
|
+
import { StyledFont } from '../styled/StyledFont.js';
|
|
17
|
+
import '../styled/StyledIcon.js';
|
|
18
|
+
import '../styled/StyledList.js';
|
|
19
|
+
import '../styled/StyledListItem.js';
|
|
20
|
+
import '../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const XL = forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
tag,
|
|
25
|
+
...other
|
|
26
|
+
} = _ref;
|
|
27
|
+
return React.createElement(StyledFont, Object.assign({
|
|
28
|
+
as: tag,
|
|
29
|
+
ref: ref,
|
|
30
|
+
size: "extralarge"
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
XL.displayName = 'XL';
|
|
34
|
+
XL.propTypes = {
|
|
35
|
+
tag: PropTypes.any,
|
|
36
|
+
isBold: PropTypes.bool
|
|
37
|
+
};
|
|
38
|
+
XL.defaultProps = {
|
|
39
|
+
tag: 'div'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { XL };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import '../styled/StyledBlockquote.js';
|
|
10
|
+
import '../styled/StyledCode.js';
|
|
11
|
+
import '../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import '../styled/StyledEllipsis.js';
|
|
16
|
+
import { StyledFont } from '../styled/StyledFont.js';
|
|
17
|
+
import '../styled/StyledIcon.js';
|
|
18
|
+
import '../styled/StyledList.js';
|
|
19
|
+
import '../styled/StyledListItem.js';
|
|
20
|
+
import '../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const XXL = forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
tag,
|
|
25
|
+
...other
|
|
26
|
+
} = _ref;
|
|
27
|
+
return React.createElement(StyledFont, Object.assign({
|
|
28
|
+
as: tag,
|
|
29
|
+
ref: ref,
|
|
30
|
+
size: "2xlarge"
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
XXL.displayName = 'XXL';
|
|
34
|
+
XXL.propTypes = {
|
|
35
|
+
tag: PropTypes.any,
|
|
36
|
+
isBold: PropTypes.bool
|
|
37
|
+
};
|
|
38
|
+
XXL.defaultProps = {
|
|
39
|
+
tag: 'div'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { XXL };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import '../styled/StyledBlockquote.js';
|
|
10
|
+
import '../styled/StyledCode.js';
|
|
11
|
+
import '../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import '../styled/StyledEllipsis.js';
|
|
16
|
+
import { StyledFont } from '../styled/StyledFont.js';
|
|
17
|
+
import '../styled/StyledIcon.js';
|
|
18
|
+
import '../styled/StyledList.js';
|
|
19
|
+
import '../styled/StyledListItem.js';
|
|
20
|
+
import '../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const XXXL = forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
tag,
|
|
25
|
+
...other
|
|
26
|
+
} = _ref;
|
|
27
|
+
return React.createElement(StyledFont, Object.assign({
|
|
28
|
+
as: tag,
|
|
29
|
+
ref: ref,
|
|
30
|
+
size: "3xlarge"
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
XXXL.displayName = 'XXXL';
|
|
34
|
+
XXXL.propTypes = {
|
|
35
|
+
tag: PropTypes.any,
|
|
36
|
+
isBold: PropTypes.bool
|
|
37
|
+
};
|
|
38
|
+
XXXL.defaultProps = {
|
|
39
|
+
tag: 'div'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { XXXL };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { Item } from './OrderedListItem.js';
|
|
10
|
+
import { SIZE, TYPE_ORDERED_LIST } from '../../types/index.js';
|
|
11
|
+
import { OrderedListContext } from '../../utils/useOrderedListContext.js';
|
|
12
|
+
import '../../styled/StyledBlockquote.js';
|
|
13
|
+
import '../../styled/StyledCode.js';
|
|
14
|
+
import '../../styled/StyledCodeBlock.js';
|
|
15
|
+
import '../../styled/StyledCodeBlockContainer.js';
|
|
16
|
+
import '../../styled/StyledCodeBlockLine.js';
|
|
17
|
+
import '../../styled/StyledCodeBlockToken.js';
|
|
18
|
+
import '../../styled/StyledEllipsis.js';
|
|
19
|
+
import '../../styled/StyledFont.js';
|
|
20
|
+
import '../../styled/StyledIcon.js';
|
|
21
|
+
import { StyledOrderedList } from '../../styled/StyledList.js';
|
|
22
|
+
import '../../styled/StyledListItem.js';
|
|
23
|
+
import '../../styled/StyledParagraph.js';
|
|
24
|
+
|
|
25
|
+
const OrderedListComponent = React.forwardRef((_ref, ref) => {
|
|
26
|
+
let {
|
|
27
|
+
size,
|
|
28
|
+
type,
|
|
29
|
+
...other
|
|
30
|
+
} = _ref;
|
|
31
|
+
const value = useMemo(() => ({
|
|
32
|
+
size: size
|
|
33
|
+
}), [size]);
|
|
34
|
+
return React.createElement(OrderedListContext.Provider, {
|
|
35
|
+
value: value
|
|
36
|
+
}, React.createElement(StyledOrderedList, Object.assign({
|
|
37
|
+
ref: ref,
|
|
38
|
+
listType: type
|
|
39
|
+
}, other)));
|
|
40
|
+
});
|
|
41
|
+
OrderedListComponent.displayName = 'OrderedList';
|
|
42
|
+
OrderedListComponent.propTypes = {
|
|
43
|
+
size: PropTypes.oneOf(SIZE),
|
|
44
|
+
type: PropTypes.oneOf(TYPE_ORDERED_LIST)
|
|
45
|
+
};
|
|
46
|
+
OrderedListComponent.defaultProps = {
|
|
47
|
+
size: 'medium',
|
|
48
|
+
type: 'decimal'
|
|
49
|
+
};
|
|
50
|
+
const OrderedList = OrderedListComponent;
|
|
51
|
+
OrderedList.Item = Item;
|
|
52
|
+
|
|
53
|
+
export { OrderedList };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import useOrderedListContext from '../../utils/useOrderedListContext.js';
|
|
9
|
+
import '../../styled/StyledBlockquote.js';
|
|
10
|
+
import '../../styled/StyledCode.js';
|
|
11
|
+
import '../../styled/StyledCodeBlock.js';
|
|
12
|
+
import '../../styled/StyledCodeBlockContainer.js';
|
|
13
|
+
import '../../styled/StyledCodeBlockLine.js';
|
|
14
|
+
import '../../styled/StyledCodeBlockToken.js';
|
|
15
|
+
import '../../styled/StyledEllipsis.js';
|
|
16
|
+
import '../../styled/StyledFont.js';
|
|
17
|
+
import '../../styled/StyledIcon.js';
|
|
18
|
+
import '../../styled/StyledList.js';
|
|
19
|
+
import { StyledOrderedListItem } from '../../styled/StyledListItem.js';
|
|
20
|
+
import '../../styled/StyledParagraph.js';
|
|
21
|
+
|
|
22
|
+
const OrderedListItem = forwardRef((props, ref) => {
|
|
23
|
+
const {
|
|
24
|
+
size
|
|
25
|
+
} = useOrderedListContext();
|
|
26
|
+
return React.createElement(StyledOrderedListItem, Object.assign({
|
|
27
|
+
ref: ref,
|
|
28
|
+
space: size
|
|
29
|
+
}, props));
|
|
30
|
+
});
|
|
31
|
+
OrderedListItem.displayName = 'OrderedList.Item';
|
|
32
|
+
const Item = OrderedListItem;
|
|
33
|
+
|
|
34
|
+
export { Item };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { Item } from './UnorderedListItem.js';
|
|
10
|
+
import { SIZE, TYPE_UNORDERED_LIST } from '../../types/index.js';
|
|
11
|
+
import { UnorderedListContext } from '../../utils/useUnorderedListContext.js';
|
|
12
|
+
import '../../styled/StyledBlockquote.js';
|
|
13
|
+
import '../../styled/StyledCode.js';
|
|
14
|
+
import '../../styled/StyledCodeBlock.js';
|
|
15
|
+
import '../../styled/StyledCodeBlockContainer.js';
|
|
16
|
+
import '../../styled/StyledCodeBlockLine.js';
|
|
17
|
+
import '../../styled/StyledCodeBlockToken.js';
|
|
18
|
+
import '../../styled/StyledEllipsis.js';
|
|
19
|
+
import '../../styled/StyledFont.js';
|
|
20
|
+
import '../../styled/StyledIcon.js';
|
|
21
|
+
import { StyledUnorderedList } from '../../styled/StyledList.js';
|
|
22
|
+
import '../../styled/StyledListItem.js';
|
|
23
|
+
import '../../styled/StyledParagraph.js';
|
|
24
|
+
|
|
25
|
+
const UnorderedListComponent = forwardRef((_ref, ref) => {
|
|
26
|
+
let {
|
|
27
|
+
size,
|
|
28
|
+
type,
|
|
29
|
+
...other
|
|
30
|
+
} = _ref;
|
|
31
|
+
const value = useMemo(() => ({
|
|
32
|
+
size: size
|
|
33
|
+
}), [size]);
|
|
34
|
+
return React.createElement(UnorderedListContext.Provider, {
|
|
35
|
+
value: value
|
|
36
|
+
}, React.createElement(StyledUnorderedList, Object.assign({
|
|
37
|
+
ref: ref,
|
|
38
|
+
listType: type
|
|
39
|
+
}, other)));
|
|
40
|
+
});
|
|
41
|
+
UnorderedListComponent.displayName = 'UnorderedList';
|
|
42
|
+
UnorderedListComponent.propTypes = {
|
|
43
|
+
size: PropTypes.oneOf(SIZE),
|
|
44
|
+
type: PropTypes.oneOf(TYPE_UNORDERED_LIST)
|
|
45
|
+
};
|
|
46
|
+
UnorderedListComponent.defaultProps = {
|
|
47
|
+
size: 'medium',
|
|
48
|
+
type: 'disc'
|
|
49
|
+
};
|
|
50
|
+
const UnorderedList = UnorderedListComponent;
|
|
51
|
+
UnorderedList.Item = Item;
|
|
52
|
+
|
|
53
|
+
export { UnorderedList };
|