@zendeskgarden/react-typography 9.0.0-next.24 → 9.0.0-next.26
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/CodeBlock.js +5 -23
- package/dist/esm/styled/StyledBlockquote.js +2 -5
- package/dist/esm/styled/StyledCode.js +1 -1
- package/dist/esm/styled/StyledCodeBlock.js +3 -6
- package/dist/esm/styled/StyledCodeBlockContainer.js +2 -5
- package/dist/esm/styled/StyledCodeBlockLine.js +2 -5
- package/dist/esm/styled/StyledCodeBlockToken.js +2 -5
- package/dist/esm/styled/StyledEllipsis.js +2 -5
- package/dist/esm/styled/StyledFont.js +1 -1
- package/dist/esm/styled/StyledIcon.js +2 -5
- package/dist/esm/styled/StyledList.js +3 -9
- package/dist/esm/styled/StyledListItem.js +2 -2
- package/dist/esm/styled/StyledParagraph.js +2 -5
- package/dist/index.cjs.js +20 -67
- package/package.json +4 -5
|
@@ -4,10 +4,10 @@
|
|
|
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, { useRef, useMemo
|
|
8
|
-
import { Prism
|
|
7
|
+
import React, { useRef, useMemo } from 'react';
|
|
8
|
+
import Highlight, { Prism } from 'prism-react-renderer';
|
|
9
9
|
import { useScrollRegion } from '@zendeskgarden/container-scrollregion';
|
|
10
|
-
import {
|
|
10
|
+
import { ThemeProvider } from '@zendeskgarden/react-theming';
|
|
11
11
|
import { LANGUAGES } from '../types/index.js';
|
|
12
12
|
import '../styled/StyledBlockquote.js';
|
|
13
13
|
import '../styled/StyledCode.js';
|
|
@@ -40,25 +40,6 @@ const CodeBlock = React.forwardRef((_ref, ref) => {
|
|
|
40
40
|
containerRef,
|
|
41
41
|
dependency
|
|
42
42
|
});
|
|
43
|
-
const [isPrismImported, setIsPrismImported] = useState(false);
|
|
44
|
-
const win = useWindow();
|
|
45
|
-
const importPrism = useCallback(async () => {
|
|
46
|
-
if (win && !isPrismImported) {
|
|
47
|
-
win.Prism = Prism;
|
|
48
|
-
try {
|
|
49
|
-
await import('prismjs/components/prism-bash');
|
|
50
|
-
await import('prismjs/components/prism-diff');
|
|
51
|
-
await import('prismjs/components/prism-json');
|
|
52
|
-
} catch (error) {
|
|
53
|
-
console.error(error);
|
|
54
|
-
} finally {
|
|
55
|
-
setIsPrismImported(true);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}, [win, isPrismImported]);
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
importPrism();
|
|
61
|
-
}, [importPrism]);
|
|
62
43
|
const getDiff = line => {
|
|
63
44
|
let retVal;
|
|
64
45
|
if (language === 'diff') {
|
|
@@ -77,10 +58,11 @@ const CodeBlock = React.forwardRef((_ref, ref) => {
|
|
|
77
58
|
}
|
|
78
59
|
return retVal;
|
|
79
60
|
};
|
|
80
|
-
return
|
|
61
|
+
return React.createElement(StyledCodeBlockContainer, Object.assign({}, containerProps, {
|
|
81
62
|
ref: containerRef,
|
|
82
63
|
tabIndex: containerTabIndex
|
|
83
64
|
}), React.createElement(Highlight, {
|
|
65
|
+
Prism: Prism,
|
|
84
66
|
code: code ? code.trim() : '',
|
|
85
67
|
language: LANGUAGES.includes(language) ? language : 'tsx'
|
|
86
68
|
}, _ref2 => {
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { getColor, retrieveComponentStyles
|
|
8
|
+
import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { THEME_SIZES } from './StyledFont.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'typography.blockquote';
|
|
12
12
|
const StyledBlockquote = styled.blockquote.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.26'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledBlockquote",
|
|
17
17
|
componentId: "sc-1tt3ye0-0"
|
|
@@ -19,8 +19,5 @@ const StyledBlockquote = styled.blockquote.attrs({
|
|
|
19
19
|
theme: props.theme,
|
|
20
20
|
variable: 'border.default'
|
|
21
21
|
}), props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 4, props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.lineHeights[THEME_SIZES[props.size]], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
|
-
StyledBlockquote.defaultProps = {
|
|
23
|
-
theme: DEFAULT_THEME
|
|
24
|
-
};
|
|
25
22
|
|
|
26
23
|
export { StyledBlockquote };
|
|
@@ -50,7 +50,7 @@ const colorStyles = _ref => {
|
|
|
50
50
|
};
|
|
51
51
|
const StyledCode = styled(StyledFont).attrs({
|
|
52
52
|
'data-garden-id': COMPONENT_ID,
|
|
53
|
-
'data-garden-version': '9.0.0-next.
|
|
53
|
+
'data-garden-version': '9.0.0-next.26',
|
|
54
54
|
as: 'code',
|
|
55
55
|
isMonospace: true
|
|
56
56
|
}).withConfig({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'typography.codeblock';
|
|
11
11
|
const colorStyles = _ref => {
|
|
@@ -14,7 +14,7 @@ const colorStyles = _ref => {
|
|
|
14
14
|
} = _ref;
|
|
15
15
|
const backgroundColor = getColor({
|
|
16
16
|
theme,
|
|
17
|
-
variable:
|
|
17
|
+
variable: 'background.recessed'
|
|
18
18
|
});
|
|
19
19
|
const foregroundColor = getColor({
|
|
20
20
|
theme,
|
|
@@ -24,13 +24,10 @@ const colorStyles = _ref => {
|
|
|
24
24
|
};
|
|
25
25
|
const StyledCodeBlock = styled.pre.attrs({
|
|
26
26
|
'data-garden-id': COMPONENT_ID,
|
|
27
|
-
'data-garden-version': '9.0.0-next.
|
|
27
|
+
'data-garden-version': '9.0.0-next.26'
|
|
28
28
|
}).withConfig({
|
|
29
29
|
displayName: "StyledCodeBlock",
|
|
30
30
|
componentId: "sc-5wky57-0"
|
|
31
31
|
})(["display:table;margin:0;padding:", "px;box-sizing:border-box;width:100%;direction:ltr;white-space:pre;counter-reset:linenumber;", ";", ";"], props => props.theme.space.base * 3, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
32
|
-
StyledCodeBlock.defaultProps = {
|
|
33
|
-
theme: DEFAULT_THEME
|
|
34
|
-
};
|
|
35
32
|
|
|
36
33
|
export { StyledCodeBlock };
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { focusStyles, retrieveComponentStyles
|
|
8
|
+
import { focusStyles, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'typography.codeblock_container';
|
|
11
11
|
const StyledCodeBlockContainer = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.26'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledCodeBlockContainer",
|
|
16
16
|
componentId: "sc-14zgbfw-0"
|
|
17
17
|
})(["transition:box-shadow 0.1s ease-in-out;overflow:auto;", " ", ";"], props => focusStyles({
|
|
18
18
|
theme: props.theme
|
|
19
19
|
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
-
StyledCodeBlockContainer.defaultProps = {
|
|
21
|
-
theme: DEFAULT_THEME
|
|
22
|
-
};
|
|
23
20
|
|
|
24
21
|
export { StyledCodeBlockContainer };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledFont, THEME_SIZES } from './StyledFont.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'typography.codeblock_code';
|
|
@@ -86,15 +86,12 @@ const lineNumberStyles = _ref2 => {
|
|
|
86
86
|
};
|
|
87
87
|
const StyledCodeBlockLine = styled(StyledFont).attrs({
|
|
88
88
|
'data-garden-id': COMPONENT_ID,
|
|
89
|
-
'data-garden-version': '9.0.0-next.
|
|
89
|
+
'data-garden-version': '9.0.0-next.26',
|
|
90
90
|
as: 'code',
|
|
91
91
|
isMonospace: true
|
|
92
92
|
}).withConfig({
|
|
93
93
|
displayName: "StyledCodeBlockLine",
|
|
94
94
|
componentId: "sc-1goay17-0"
|
|
95
95
|
})(["display:table-row;height:", ";direction:ltr;", ";", ";&::after{display:inline-block;width:", "px;content:'';}", ";"], props => props.theme.lineHeights[THEME_SIZES[props.size]], colorStyles, props => props.isNumbered && lineNumberStyles(props), props => props.theme.space.base * 3, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
96
|
-
StyledCodeBlockLine.defaultProps = {
|
|
97
|
-
theme: DEFAULT_THEME
|
|
98
|
-
};
|
|
99
96
|
|
|
100
97
|
export { StyledCodeBlockLine };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledCodeBlock } from './StyledCodeBlock.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'typography.codeblock_token';
|
|
@@ -171,13 +171,10 @@ const colorStyles = _ref => {
|
|
|
171
171
|
};
|
|
172
172
|
const StyledCodeBlockToken = styled.span.attrs({
|
|
173
173
|
'data-garden-id': COMPONENT_ID,
|
|
174
|
-
'data-garden-version': '9.0.0-next.
|
|
174
|
+
'data-garden-version': '9.0.0-next.26'
|
|
175
175
|
}).withConfig({
|
|
176
176
|
displayName: "StyledCodeBlockToken",
|
|
177
177
|
componentId: "sc-1hkshdq-0"
|
|
178
178
|
})(["display:inline-block;&.bold:not(.diff){font-weight:", ";}&.coord{padding-left:0.75em;}&.italic{font-style:italic;}&.prefix{width:2em;text-align:center;}", ";", ";"], props => props.theme.fontWeights.semibold, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
179
|
-
StyledCodeBlockToken.defaultProps = {
|
|
180
|
-
theme: DEFAULT_THEME
|
|
181
|
-
};
|
|
182
179
|
|
|
183
180
|
export { StyledCodeBlockToken };
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'typography.ellipsis';
|
|
11
11
|
const StyledEllipsis = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.26'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledEllipsis",
|
|
16
16
|
componentId: "sc-1u4uqmy-0"
|
|
17
17
|
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledEllipsis.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledEllipsis };
|
|
@@ -67,7 +67,7 @@ const fontStyles = _ref => {
|
|
|
67
67
|
};
|
|
68
68
|
const StyledFont = styled.div.attrs({
|
|
69
69
|
'data-garden-id': COMPONENT_ID,
|
|
70
|
-
'data-garden-version': '9.0.0-next.
|
|
70
|
+
'data-garden-version': '9.0.0-next.26'
|
|
71
71
|
}).withConfig({
|
|
72
72
|
displayName: "StyledFont",
|
|
73
73
|
componentId: "sc-1iildbo-0"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { StyledBaseIcon, retrieveComponentStyles
|
|
8
|
+
import { StyledBaseIcon, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'typography.icon';
|
|
11
11
|
const sizeStyles = props => {
|
|
@@ -15,13 +15,10 @@ const sizeStyles = props => {
|
|
|
15
15
|
};
|
|
16
16
|
const StyledIcon = styled(StyledBaseIcon).attrs({
|
|
17
17
|
'data-garden-id': COMPONENT_ID,
|
|
18
|
-
'data-garden-version': '9.0.0-next.
|
|
18
|
+
'data-garden-version': '9.0.0-next.26'
|
|
19
19
|
}).withConfig({
|
|
20
20
|
displayName: "StyledIcon",
|
|
21
21
|
componentId: "sc-10rfb5b-0"
|
|
22
22
|
})(["position:relative;top:-1px;vertical-align:middle;", ";", ";"], props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
23
|
-
StyledIcon.defaultProps = {
|
|
24
|
-
theme: DEFAULT_THEME
|
|
25
|
-
};
|
|
26
23
|
|
|
27
24
|
export { StyledIcon };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const listStyles = props => {
|
|
11
11
|
const rtl = props.theme.rtl;
|
|
@@ -14,24 +14,18 @@ const listStyles = props => {
|
|
|
14
14
|
const ORDERED_ID = 'typography.ordered_list';
|
|
15
15
|
const StyledOrderedList = styled.ol.attrs({
|
|
16
16
|
'data-garden-id': ORDERED_ID,
|
|
17
|
-
'data-garden-version': '9.0.0-next.
|
|
17
|
+
'data-garden-version': '9.0.0-next.26'
|
|
18
18
|
}).withConfig({
|
|
19
19
|
displayName: "StyledList__StyledOrderedList",
|
|
20
20
|
componentId: "sc-jdbsfi-0"
|
|
21
21
|
})(["", ";", ";"], props => listStyles(props), props => retrieveComponentStyles(ORDERED_ID, props));
|
|
22
|
-
StyledOrderedList.defaultProps = {
|
|
23
|
-
theme: DEFAULT_THEME
|
|
24
|
-
};
|
|
25
22
|
const UNORDERED_ID = 'typography.unordered_list';
|
|
26
23
|
const StyledUnorderedList = styled.ul.attrs({
|
|
27
24
|
'data-garden-id': UNORDERED_ID,
|
|
28
|
-
'data-garden-version': '9.0.0-next.
|
|
25
|
+
'data-garden-version': '9.0.0-next.26'
|
|
29
26
|
}).withConfig({
|
|
30
27
|
displayName: "StyledList__StyledUnorderedList",
|
|
31
28
|
componentId: "sc-jdbsfi-1"
|
|
32
29
|
})(["", ";", ";"], props => listStyles(props), props => retrieveComponentStyles(UNORDERED_ID, props));
|
|
33
|
-
StyledUnorderedList.defaultProps = {
|
|
34
|
-
theme: DEFAULT_THEME
|
|
35
|
-
};
|
|
36
30
|
|
|
37
31
|
export { StyledOrderedList, StyledUnorderedList };
|
|
@@ -21,7 +21,7 @@ const listItemStyles = props => {
|
|
|
21
21
|
const ORDERED_ID = 'typography.ordered_list_item';
|
|
22
22
|
const StyledOrderedListItem = styled(StyledFont).attrs({
|
|
23
23
|
'data-garden-id': ORDERED_ID,
|
|
24
|
-
'data-garden-version': '9.0.0-next.
|
|
24
|
+
'data-garden-version': '9.0.0-next.26',
|
|
25
25
|
as: 'li'
|
|
26
26
|
}).withConfig({
|
|
27
27
|
displayName: "StyledListItem__StyledOrderedListItem",
|
|
@@ -34,7 +34,7 @@ StyledOrderedListItem.defaultProps = {
|
|
|
34
34
|
const UNORDERED_ID = 'typography.unordered_list_item';
|
|
35
35
|
const StyledUnorderedListItem = styled(StyledFont).attrs({
|
|
36
36
|
'data-garden-id': UNORDERED_ID,
|
|
37
|
-
'data-garden-version': '9.0.0-next.
|
|
37
|
+
'data-garden-version': '9.0.0-next.26',
|
|
38
38
|
as: 'li'
|
|
39
39
|
}).withConfig({
|
|
40
40
|
displayName: "StyledListItem__StyledUnorderedListItem",
|
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { THEME_SIZES } from './StyledFont.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'typography.paragraph';
|
|
12
12
|
const StyledParagraph = styled.p.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.26'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledParagraph",
|
|
17
17
|
componentId: "sc-zkuftz-0"
|
|
18
18
|
})(["margin:0;padding:0;direction:", ";& + &,blockquote + &{margin-top:", ";}", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.lineHeights[THEME_SIZES[props.size]], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
-
StyledParagraph.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
22
19
|
|
|
23
20
|
export { StyledParagraph };
|
package/dist/index.cjs.js
CHANGED
|
@@ -11,7 +11,7 @@ var PropTypes = require('prop-types');
|
|
|
11
11
|
var styled = require('styled-components');
|
|
12
12
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
13
13
|
var polished = require('polished');
|
|
14
|
-
var
|
|
14
|
+
var Highlight = require('prism-react-renderer');
|
|
15
15
|
var containerScrollregion = require('@zendeskgarden/container-scrollregion');
|
|
16
16
|
|
|
17
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -19,6 +19,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
19
19
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
20
20
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
21
21
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
22
|
+
var Highlight__default = /*#__PURE__*/_interopDefault(Highlight);
|
|
22
23
|
|
|
23
24
|
const HUE = ['grey', 'red', 'green', 'yellow'];
|
|
24
25
|
const SIZE = ['small', 'medium', 'large'];
|
|
@@ -85,7 +86,7 @@ const fontStyles = _ref => {
|
|
|
85
86
|
};
|
|
86
87
|
const StyledFont = styled__default.default.div.attrs({
|
|
87
88
|
'data-garden-id': COMPONENT_ID$9,
|
|
88
|
-
'data-garden-version': '9.0.0-next.
|
|
89
|
+
'data-garden-version': '9.0.0-next.26'
|
|
89
90
|
}).withConfig({
|
|
90
91
|
displayName: "StyledFont",
|
|
91
92
|
componentId: "sc-1iildbo-0"
|
|
@@ -98,7 +99,7 @@ StyledFont.defaultProps = {
|
|
|
98
99
|
const COMPONENT_ID$8 = 'typography.blockquote';
|
|
99
100
|
const StyledBlockquote = styled__default.default.blockquote.attrs({
|
|
100
101
|
'data-garden-id': COMPONENT_ID$8,
|
|
101
|
-
'data-garden-version': '9.0.0-next.
|
|
102
|
+
'data-garden-version': '9.0.0-next.26'
|
|
102
103
|
}).withConfig({
|
|
103
104
|
displayName: "StyledBlockquote",
|
|
104
105
|
componentId: "sc-1tt3ye0-0"
|
|
@@ -106,9 +107,6 @@ const StyledBlockquote = styled__default.default.blockquote.attrs({
|
|
|
106
107
|
theme: props.theme,
|
|
107
108
|
variable: 'border.default'
|
|
108
109
|
}), props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 4, props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.lineHeights[THEME_SIZES[props.size]], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
109
|
-
StyledBlockquote.defaultProps = {
|
|
110
|
-
theme: reactTheming.DEFAULT_THEME
|
|
111
|
-
};
|
|
112
110
|
|
|
113
111
|
const COMPONENT_ID$7 = 'typography.code';
|
|
114
112
|
const colorStyles$3 = _ref => {
|
|
@@ -152,7 +150,7 @@ const colorStyles$3 = _ref => {
|
|
|
152
150
|
};
|
|
153
151
|
const StyledCode = styled__default.default(StyledFont).attrs({
|
|
154
152
|
'data-garden-id': COMPONENT_ID$7,
|
|
155
|
-
'data-garden-version': '9.0.0-next.
|
|
153
|
+
'data-garden-version': '9.0.0-next.26',
|
|
156
154
|
as: 'code',
|
|
157
155
|
isMonospace: true
|
|
158
156
|
}).withConfig({
|
|
@@ -172,7 +170,7 @@ const colorStyles$2 = _ref => {
|
|
|
172
170
|
} = _ref;
|
|
173
171
|
const backgroundColor = reactTheming.getColor({
|
|
174
172
|
theme,
|
|
175
|
-
variable:
|
|
173
|
+
variable: 'background.recessed'
|
|
176
174
|
});
|
|
177
175
|
const foregroundColor = reactTheming.getColor({
|
|
178
176
|
theme,
|
|
@@ -182,28 +180,22 @@ const colorStyles$2 = _ref => {
|
|
|
182
180
|
};
|
|
183
181
|
const StyledCodeBlock = styled__default.default.pre.attrs({
|
|
184
182
|
'data-garden-id': COMPONENT_ID$6,
|
|
185
|
-
'data-garden-version': '9.0.0-next.
|
|
183
|
+
'data-garden-version': '9.0.0-next.26'
|
|
186
184
|
}).withConfig({
|
|
187
185
|
displayName: "StyledCodeBlock",
|
|
188
186
|
componentId: "sc-5wky57-0"
|
|
189
187
|
})(["display:table;margin:0;padding:", "px;box-sizing:border-box;width:100%;direction:ltr;white-space:pre;counter-reset:linenumber;", ";", ";"], props => props.theme.space.base * 3, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
190
|
-
StyledCodeBlock.defaultProps = {
|
|
191
|
-
theme: reactTheming.DEFAULT_THEME
|
|
192
|
-
};
|
|
193
188
|
|
|
194
189
|
const COMPONENT_ID$5 = 'typography.codeblock_container';
|
|
195
190
|
const StyledCodeBlockContainer = styled__default.default.div.attrs({
|
|
196
191
|
'data-garden-id': COMPONENT_ID$5,
|
|
197
|
-
'data-garden-version': '9.0.0-next.
|
|
192
|
+
'data-garden-version': '9.0.0-next.26'
|
|
198
193
|
}).withConfig({
|
|
199
194
|
displayName: "StyledCodeBlockContainer",
|
|
200
195
|
componentId: "sc-14zgbfw-0"
|
|
201
196
|
})(["transition:box-shadow 0.1s ease-in-out;overflow:auto;", " ", ";"], props => reactTheming.focusStyles({
|
|
202
197
|
theme: props.theme
|
|
203
198
|
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
204
|
-
StyledCodeBlockContainer.defaultProps = {
|
|
205
|
-
theme: reactTheming.DEFAULT_THEME
|
|
206
|
-
};
|
|
207
199
|
|
|
208
200
|
const COMPONENT_ID$4 = 'typography.codeblock_code';
|
|
209
201
|
const colorStyles$1 = _ref => {
|
|
@@ -283,16 +275,13 @@ const lineNumberStyles = _ref2 => {
|
|
|
283
275
|
};
|
|
284
276
|
const StyledCodeBlockLine = styled__default.default(StyledFont).attrs({
|
|
285
277
|
'data-garden-id': COMPONENT_ID$4,
|
|
286
|
-
'data-garden-version': '9.0.0-next.
|
|
278
|
+
'data-garden-version': '9.0.0-next.26',
|
|
287
279
|
as: 'code',
|
|
288
280
|
isMonospace: true
|
|
289
281
|
}).withConfig({
|
|
290
282
|
displayName: "StyledCodeBlockLine",
|
|
291
283
|
componentId: "sc-1goay17-0"
|
|
292
284
|
})(["display:table-row;height:", ";direction:ltr;", ";", ";&::after{display:inline-block;width:", "px;content:'';}", ";"], props => props.theme.lineHeights[THEME_SIZES[props.size]], colorStyles$1, props => props.isNumbered && lineNumberStyles(props), props => props.theme.space.base * 3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
293
|
-
StyledCodeBlockLine.defaultProps = {
|
|
294
|
-
theme: reactTheming.DEFAULT_THEME
|
|
295
|
-
};
|
|
296
285
|
|
|
297
286
|
const COMPONENT_ID$3 = 'typography.codeblock_token';
|
|
298
287
|
const colorStyles = _ref => {
|
|
@@ -457,26 +446,20 @@ const colorStyles = _ref => {
|
|
|
457
446
|
};
|
|
458
447
|
const StyledCodeBlockToken = styled__default.default.span.attrs({
|
|
459
448
|
'data-garden-id': COMPONENT_ID$3,
|
|
460
|
-
'data-garden-version': '9.0.0-next.
|
|
449
|
+
'data-garden-version': '9.0.0-next.26'
|
|
461
450
|
}).withConfig({
|
|
462
451
|
displayName: "StyledCodeBlockToken",
|
|
463
452
|
componentId: "sc-1hkshdq-0"
|
|
464
453
|
})(["display:inline-block;&.bold:not(.diff){font-weight:", ";}&.coord{padding-left:0.75em;}&.italic{font-style:italic;}&.prefix{width:2em;text-align:center;}", ";", ";"], props => props.theme.fontWeights.semibold, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
465
|
-
StyledCodeBlockToken.defaultProps = {
|
|
466
|
-
theme: reactTheming.DEFAULT_THEME
|
|
467
|
-
};
|
|
468
454
|
|
|
469
455
|
const COMPONENT_ID$2 = 'typography.ellipsis';
|
|
470
456
|
const StyledEllipsis = styled__default.default.div.attrs({
|
|
471
457
|
'data-garden-id': COMPONENT_ID$2,
|
|
472
|
-
'data-garden-version': '9.0.0-next.
|
|
458
|
+
'data-garden-version': '9.0.0-next.26'
|
|
473
459
|
}).withConfig({
|
|
474
460
|
displayName: "StyledEllipsis",
|
|
475
461
|
componentId: "sc-1u4uqmy-0"
|
|
476
462
|
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
477
|
-
StyledEllipsis.defaultProps = {
|
|
478
|
-
theme: reactTheming.DEFAULT_THEME
|
|
479
|
-
};
|
|
480
463
|
|
|
481
464
|
const COMPONENT_ID$1 = 'typography.icon';
|
|
482
465
|
const sizeStyles = props => {
|
|
@@ -486,14 +469,11 @@ const sizeStyles = props => {
|
|
|
486
469
|
};
|
|
487
470
|
const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
|
|
488
471
|
'data-garden-id': COMPONENT_ID$1,
|
|
489
|
-
'data-garden-version': '9.0.0-next.
|
|
472
|
+
'data-garden-version': '9.0.0-next.26'
|
|
490
473
|
}).withConfig({
|
|
491
474
|
displayName: "StyledIcon",
|
|
492
475
|
componentId: "sc-10rfb5b-0"
|
|
493
476
|
})(["position:relative;top:-1px;vertical-align:middle;", ";", ";"], props => sizeStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
494
|
-
StyledIcon.defaultProps = {
|
|
495
|
-
theme: reactTheming.DEFAULT_THEME
|
|
496
|
-
};
|
|
497
477
|
|
|
498
478
|
const listStyles = props => {
|
|
499
479
|
const rtl = props.theme.rtl;
|
|
@@ -502,25 +482,19 @@ const listStyles = props => {
|
|
|
502
482
|
const ORDERED_ID$1 = 'typography.ordered_list';
|
|
503
483
|
const StyledOrderedList = styled__default.default.ol.attrs({
|
|
504
484
|
'data-garden-id': ORDERED_ID$1,
|
|
505
|
-
'data-garden-version': '9.0.0-next.
|
|
485
|
+
'data-garden-version': '9.0.0-next.26'
|
|
506
486
|
}).withConfig({
|
|
507
487
|
displayName: "StyledList__StyledOrderedList",
|
|
508
488
|
componentId: "sc-jdbsfi-0"
|
|
509
489
|
})(["", ";", ";"], props => listStyles(props), props => reactTheming.retrieveComponentStyles(ORDERED_ID$1, props));
|
|
510
|
-
StyledOrderedList.defaultProps = {
|
|
511
|
-
theme: reactTheming.DEFAULT_THEME
|
|
512
|
-
};
|
|
513
490
|
const UNORDERED_ID$1 = 'typography.unordered_list';
|
|
514
491
|
const StyledUnorderedList = styled__default.default.ul.attrs({
|
|
515
492
|
'data-garden-id': UNORDERED_ID$1,
|
|
516
|
-
'data-garden-version': '9.0.0-next.
|
|
493
|
+
'data-garden-version': '9.0.0-next.26'
|
|
517
494
|
}).withConfig({
|
|
518
495
|
displayName: "StyledList__StyledUnorderedList",
|
|
519
496
|
componentId: "sc-jdbsfi-1"
|
|
520
497
|
})(["", ";", ";"], props => listStyles(props), props => reactTheming.retrieveComponentStyles(UNORDERED_ID$1, props));
|
|
521
|
-
StyledUnorderedList.defaultProps = {
|
|
522
|
-
theme: reactTheming.DEFAULT_THEME
|
|
523
|
-
};
|
|
524
498
|
|
|
525
499
|
const listItemPaddingStyles = props => {
|
|
526
500
|
const base = props.theme.space.base;
|
|
@@ -533,7 +507,7 @@ const listItemStyles = props => {
|
|
|
533
507
|
const ORDERED_ID = 'typography.ordered_list_item';
|
|
534
508
|
const StyledOrderedListItem = styled__default.default(StyledFont).attrs({
|
|
535
509
|
'data-garden-id': ORDERED_ID,
|
|
536
|
-
'data-garden-version': '9.0.0-next.
|
|
510
|
+
'data-garden-version': '9.0.0-next.26',
|
|
537
511
|
as: 'li'
|
|
538
512
|
}).withConfig({
|
|
539
513
|
displayName: "StyledListItem__StyledOrderedListItem",
|
|
@@ -546,7 +520,7 @@ StyledOrderedListItem.defaultProps = {
|
|
|
546
520
|
const UNORDERED_ID = 'typography.unordered_list_item';
|
|
547
521
|
const StyledUnorderedListItem = styled__default.default(StyledFont).attrs({
|
|
548
522
|
'data-garden-id': UNORDERED_ID,
|
|
549
|
-
'data-garden-version': '9.0.0-next.
|
|
523
|
+
'data-garden-version': '9.0.0-next.26',
|
|
550
524
|
as: 'li'
|
|
551
525
|
}).withConfig({
|
|
552
526
|
displayName: "StyledListItem__StyledUnorderedListItem",
|
|
@@ -560,14 +534,11 @@ StyledUnorderedListItem.defaultProps = {
|
|
|
560
534
|
const COMPONENT_ID = 'typography.paragraph';
|
|
561
535
|
const StyledParagraph = styled__default.default.p.attrs({
|
|
562
536
|
'data-garden-id': COMPONENT_ID,
|
|
563
|
-
'data-garden-version': '9.0.0-next.
|
|
537
|
+
'data-garden-version': '9.0.0-next.26'
|
|
564
538
|
}).withConfig({
|
|
565
539
|
displayName: "StyledParagraph",
|
|
566
540
|
componentId: "sc-zkuftz-0"
|
|
567
541
|
})(["margin:0;padding:0;direction:", ";& + &,blockquote + &{margin-top:", ";}", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.lineHeights[THEME_SIZES[props.size]], props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
568
|
-
StyledParagraph.defaultProps = {
|
|
569
|
-
theme: reactTheming.DEFAULT_THEME
|
|
570
|
-
};
|
|
571
542
|
|
|
572
543
|
const SM = React.forwardRef((_ref, ref) => {
|
|
573
544
|
let {
|
|
@@ -741,25 +712,6 @@ const CodeBlock = React__default.default.forwardRef((_ref, ref) => {
|
|
|
741
712
|
containerRef,
|
|
742
713
|
dependency
|
|
743
714
|
});
|
|
744
|
-
const [isPrismImported, setIsPrismImported] = React.useState(false);
|
|
745
|
-
const win = reactTheming.useWindow();
|
|
746
|
-
const importPrism = React.useCallback(async () => {
|
|
747
|
-
if (win && !isPrismImported) {
|
|
748
|
-
win.Prism = prismReactRenderer.Prism;
|
|
749
|
-
try {
|
|
750
|
-
await import('prismjs/components/prism-bash');
|
|
751
|
-
await import('prismjs/components/prism-diff');
|
|
752
|
-
await import('prismjs/components/prism-json');
|
|
753
|
-
} catch (error) {
|
|
754
|
-
console.error(error);
|
|
755
|
-
} finally {
|
|
756
|
-
setIsPrismImported(true);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}, [win, isPrismImported]);
|
|
760
|
-
React.useEffect(() => {
|
|
761
|
-
importPrism();
|
|
762
|
-
}, [importPrism]);
|
|
763
715
|
const getDiff = line => {
|
|
764
716
|
let retVal;
|
|
765
717
|
if (language === 'diff') {
|
|
@@ -778,10 +730,11 @@ const CodeBlock = React__default.default.forwardRef((_ref, ref) => {
|
|
|
778
730
|
}
|
|
779
731
|
return retVal;
|
|
780
732
|
};
|
|
781
|
-
return
|
|
733
|
+
return React__default.default.createElement(StyledCodeBlockContainer, Object.assign({}, containerProps, {
|
|
782
734
|
ref: containerRef,
|
|
783
735
|
tabIndex: containerTabIndex
|
|
784
|
-
}), React__default.default.createElement(
|
|
736
|
+
}), React__default.default.createElement(Highlight__default.default, {
|
|
737
|
+
Prism: Highlight.Prism,
|
|
785
738
|
code: code ? code.trim() : '',
|
|
786
739
|
language: LANGUAGES.includes(language) ? language : 'tsx'
|
|
787
740
|
}, _ref2 => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-typography",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.26",
|
|
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>",
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@zendeskgarden/container-scrollregion": "^1.0.9",
|
|
25
25
|
"polished": "^4.3.1",
|
|
26
|
-
"prism-react-renderer": "^
|
|
27
|
-
"prismjs": "^1.29.0",
|
|
26
|
+
"prism-react-renderer": "^1.3.5",
|
|
28
27
|
"prop-types": "^15.5.7"
|
|
29
28
|
},
|
|
30
29
|
"peerDependencies": {
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
"styled-components": "^5.3.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
36
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.26"
|
|
38
37
|
},
|
|
39
38
|
"keywords": [
|
|
40
39
|
"components",
|
|
@@ -46,5 +45,5 @@
|
|
|
46
45
|
"access": "public"
|
|
47
46
|
},
|
|
48
47
|
"zendeskgarden:src": "src/index.ts",
|
|
49
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "049dd7bd143029147de333f78bd879dc7d7251f2"
|
|
50
49
|
}
|