@zendeskgarden/react-typography 9.12.2 → 9.12.4
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 +7 -10
- package/dist/esm/elements/Code.js +10 -13
- package/dist/esm/elements/CodeBlock.js +43 -47
- package/dist/esm/elements/Ellipsis.js +6 -7
- package/dist/esm/elements/Kbd.js +8 -11
- package/dist/esm/elements/LG.js +12 -15
- package/dist/esm/elements/MD.js +12 -15
- package/dist/esm/elements/Paragraph.js +7 -10
- package/dist/esm/elements/SM.js +12 -15
- package/dist/esm/elements/XL.js +10 -13
- package/dist/esm/elements/XXL.js +10 -13
- package/dist/esm/elements/XXXL.js +11 -14
- package/dist/esm/elements/lists/OrderedList.js +6 -7
- package/dist/esm/elements/lists/OrderedListItem.js +2 -2
- package/dist/esm/elements/lists/UnorderedList.js +6 -7
- package/dist/esm/elements/span/Span.js +14 -17
- package/dist/esm/styled/StyledBlockquote.js +3 -3
- package/dist/esm/styled/StyledCode.js +8 -9
- package/dist/esm/styled/StyledCodeBlock.js +7 -8
- package/dist/esm/styled/StyledCodeBlockContainer.js +3 -3
- package/dist/esm/styled/StyledCodeBlockLine.js +14 -16
- package/dist/esm/styled/StyledCodeBlockToken.js +6 -7
- package/dist/esm/styled/StyledEllipsis.js +3 -3
- package/dist/esm/styled/StyledFont.js +10 -11
- package/dist/esm/styled/StyledIcon.js +5 -5
- package/dist/esm/styled/StyledKbd.js +7 -8
- package/dist/esm/styled/StyledList.js +6 -6
- package/dist/esm/styled/StyledListItem.js +2 -2
- package/dist/esm/styled/StyledParagraph.js +1 -1
- package/dist/index.cjs.js +217 -264
- package/package.json +3 -3
|
@@ -8,13 +8,12 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledFont, THEME_SIZES } from './StyledFont.js';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'typography.codeblock_code';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
11
|
+
const COMPONENT_ID$5 = 'typography.codeblock_code';
|
|
12
|
+
const colorStyles$1 = ({
|
|
13
|
+
theme,
|
|
14
|
+
$diff,
|
|
15
|
+
$isHighlighted
|
|
16
|
+
}) => {
|
|
18
17
|
let backgroundColor;
|
|
19
18
|
if ($diff) {
|
|
20
19
|
const hues = {
|
|
@@ -49,12 +48,11 @@ const colorStyles = _ref => {
|
|
|
49
48
|
}
|
|
50
49
|
return css(["background-color:", ";"], backgroundColor);
|
|
51
50
|
};
|
|
52
|
-
const lineNumberStyles =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} = _ref2;
|
|
51
|
+
const lineNumberStyles = ({
|
|
52
|
+
theme,
|
|
53
|
+
$language,
|
|
54
|
+
$size
|
|
55
|
+
}) => {
|
|
58
56
|
const color = getColor({
|
|
59
57
|
theme,
|
|
60
58
|
variable: 'foreground.subtle',
|
|
@@ -85,13 +83,13 @@ const lineNumberStyles = _ref2 => {
|
|
|
85
83
|
`;
|
|
86
84
|
};
|
|
87
85
|
const StyledCodeBlockLine = styled(StyledFont).attrs({
|
|
88
|
-
'data-garden-id': COMPONENT_ID,
|
|
89
|
-
'data-garden-version': '9.12.
|
|
86
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
87
|
+
'data-garden-version': '9.12.4',
|
|
90
88
|
as: 'code',
|
|
91
89
|
$isMonospace: true
|
|
92
90
|
}).withConfig({
|
|
93
91
|
displayName: "StyledCodeBlockLine",
|
|
94
92
|
componentId: "sc-1goay17-0"
|
|
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, componentStyles);
|
|
93
|
+
})(["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, componentStyles);
|
|
96
94
|
|
|
97
95
|
export { StyledCodeBlockLine };
|
|
@@ -8,11 +8,10 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledCodeBlock } from './StyledCodeBlock.js';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'typography.codeblock_token';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
11
|
+
const COMPONENT_ID$4 = 'typography.codeblock_token';
|
|
12
|
+
const colorStyles = ({
|
|
13
|
+
theme
|
|
14
|
+
}) => {
|
|
16
15
|
const colors = {
|
|
17
16
|
boolean: getColor({
|
|
18
17
|
theme,
|
|
@@ -170,8 +169,8 @@ const colorStyles = _ref => {
|
|
|
170
169
|
return 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);
|
|
171
170
|
};
|
|
172
171
|
const StyledCodeBlockToken = styled.span.attrs({
|
|
173
|
-
'data-garden-id': COMPONENT_ID,
|
|
174
|
-
'data-garden-version': '9.12.
|
|
172
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
173
|
+
'data-garden-version': '9.12.4'
|
|
175
174
|
}).withConfig({
|
|
176
175
|
displayName: "StyledCodeBlockToken",
|
|
177
176
|
componentId: "sc-1hkshdq-0"
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'typography.ellipsis';
|
|
10
|
+
const COMPONENT_ID$3 = 'typography.ellipsis';
|
|
11
11
|
const StyledEllipsis = styled.div.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.12.
|
|
12
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
13
|
+
'data-garden-version': '9.12.4'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledEllipsis",
|
|
16
16
|
componentId: "sc-1u4uqmy-0"
|
|
@@ -9,7 +9,7 @@ import { hideVisually, math } from 'polished';
|
|
|
9
9
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { SIZE } from '../types/index.js';
|
|
11
11
|
|
|
12
|
-
const COMPONENT_ID = 'typography.font';
|
|
12
|
+
const COMPONENT_ID$a = 'typography.font';
|
|
13
13
|
[...SIZE, 'extralarge', '2xlarge', '3xlarge'];
|
|
14
14
|
const THEME_SIZES = {
|
|
15
15
|
small: 'sm',
|
|
@@ -19,14 +19,13 @@ const THEME_SIZES = {
|
|
|
19
19
|
'2xlarge': 'xxl',
|
|
20
20
|
'3xlarge': 'xxxl'
|
|
21
21
|
};
|
|
22
|
-
const fontStyles =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
22
|
+
const fontStyles = ({
|
|
23
|
+
$hue,
|
|
24
|
+
$isBold,
|
|
25
|
+
$isMonospace,
|
|
26
|
+
$size,
|
|
27
|
+
theme
|
|
28
|
+
}) => {
|
|
30
29
|
const monospace = $isMonospace && ['inherit', 'small', 'medium', 'large'].indexOf($size) !== -1;
|
|
31
30
|
const fontFamily = monospace && theme.fonts.mono;
|
|
32
31
|
const direction = theme.rtl ? 'rtl' : 'ltr';
|
|
@@ -66,8 +65,8 @@ const fontStyles = _ref => {
|
|
|
66
65
|
return css(["transition:color 0.1s ease-in-out;line-height:", ";color:", ";font-family:", ";font-size:", ";font-weight:", ";direction:", ";"], lineHeight, color, fontFamily, fontSize, fontWeight, direction);
|
|
67
66
|
};
|
|
68
67
|
const StyledFont = styled.div.attrs(props => ({
|
|
69
|
-
'data-garden-id': COMPONENT_ID,
|
|
70
|
-
'data-garden-version': '9.12.
|
|
68
|
+
'data-garden-id': COMPONENT_ID$a,
|
|
69
|
+
'data-garden-version': '9.12.4',
|
|
71
70
|
$size: props.$size ?? 'inherit'
|
|
72
71
|
})).withConfig({
|
|
73
72
|
displayName: "StyledFont",
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { StyledBaseIcon, componentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'typography.icon';
|
|
11
|
-
const sizeStyles = props => {
|
|
10
|
+
const COMPONENT_ID$2 = 'typography.icon';
|
|
11
|
+
const sizeStyles$1 = props => {
|
|
12
12
|
const margin = props.$isStart && `${props.theme.space.base * 2}px`;
|
|
13
13
|
const size = props.theme.iconSizes.md;
|
|
14
14
|
return css(["margin-", ":", ";width:", ";height:", ";"], props.theme.rtl ? 'left' : 'right', margin, size, size);
|
|
15
15
|
};
|
|
16
16
|
const StyledIcon = styled(StyledBaseIcon).attrs({
|
|
17
|
-
'data-garden-id': COMPONENT_ID,
|
|
18
|
-
'data-garden-version': '9.12.
|
|
17
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
18
|
+
'data-garden-version': '9.12.4'
|
|
19
19
|
}).withConfig({
|
|
20
20
|
displayName: "StyledIcon",
|
|
21
21
|
componentId: "sc-10rfb5b-0"
|
|
22
|
-
})(["position:relative;top:-1px;vertical-align:middle;", ";", ";"], props => sizeStyles(props), componentStyles);
|
|
22
|
+
})(["position:relative;top:-1px;vertical-align:middle;", ";", ";"], props => sizeStyles$1(props), componentStyles);
|
|
23
23
|
|
|
24
24
|
export { StyledIcon };
|
|
@@ -9,12 +9,11 @@ import { stripUnit, math } from 'polished';
|
|
|
9
9
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { StyledCode } from './StyledCode.js';
|
|
11
11
|
|
|
12
|
-
const COMPONENT_ID = 'typography.kbd';
|
|
13
|
-
const sizeStyles =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
12
|
+
const COMPONENT_ID$1 = 'typography.kbd';
|
|
13
|
+
const sizeStyles = ({
|
|
14
|
+
theme,
|
|
15
|
+
$size
|
|
16
|
+
}) => {
|
|
18
17
|
let minWidth;
|
|
19
18
|
let paddingHorizontal;
|
|
20
19
|
let paddingVertical = '0';
|
|
@@ -41,8 +40,8 @@ const sizeStyles = _ref => {
|
|
|
41
40
|
return css(["&&{box-sizing:border-box;padding:", ";min-width:", ";}"], padding, minWidth);
|
|
42
41
|
};
|
|
43
42
|
const StyledKbd = styled(StyledCode).attrs({
|
|
44
|
-
'data-garden-id': COMPONENT_ID,
|
|
45
|
-
'data-garden-version': '9.12.
|
|
43
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
44
|
+
'data-garden-version': '9.12.4',
|
|
46
45
|
as: 'kbd'
|
|
47
46
|
}).withConfig({
|
|
48
47
|
displayName: "StyledKbd",
|
|
@@ -11,18 +11,18 @@ const listStyles = props => {
|
|
|
11
11
|
const rtl = props.theme.rtl;
|
|
12
12
|
return css(["direction:", ";margin:0;margin-", ":24px;padding:0;list-style-position:outside;list-style-type:", ";"], rtl ? 'rtl' : 'ltr', rtl ? 'right' : 'left', props.$listType);
|
|
13
13
|
};
|
|
14
|
-
const ORDERED_ID = 'typography.ordered_list';
|
|
14
|
+
const ORDERED_ID$1 = 'typography.ordered_list';
|
|
15
15
|
const StyledOrderedList = styled.ol.attrs({
|
|
16
|
-
'data-garden-id': ORDERED_ID,
|
|
17
|
-
'data-garden-version': '9.12.
|
|
16
|
+
'data-garden-id': ORDERED_ID$1,
|
|
17
|
+
'data-garden-version': '9.12.4'
|
|
18
18
|
}).withConfig({
|
|
19
19
|
displayName: "StyledList__StyledOrderedList",
|
|
20
20
|
componentId: "sc-jdbsfi-0"
|
|
21
21
|
})(["", ";", ";"], listStyles, componentStyles);
|
|
22
|
-
const UNORDERED_ID = 'typography.unordered_list';
|
|
22
|
+
const UNORDERED_ID$1 = 'typography.unordered_list';
|
|
23
23
|
const StyledUnorderedList = styled.ul.attrs({
|
|
24
|
-
'data-garden-id': UNORDERED_ID,
|
|
25
|
-
'data-garden-version': '9.12.
|
|
24
|
+
'data-garden-id': UNORDERED_ID$1,
|
|
25
|
+
'data-garden-version': '9.12.4'
|
|
26
26
|
}).withConfig({
|
|
27
27
|
displayName: "StyledList__StyledUnorderedList",
|
|
28
28
|
componentId: "sc-jdbsfi-1"
|
|
@@ -21,7 +21,7 @@ const listItemStyles = props => {
|
|
|
21
21
|
const ORDERED_ID = 'typography.ordered_list_item';
|
|
22
22
|
const StyledOrderedListItem = styled(StyledFont).attrs(props => ({
|
|
23
23
|
'data-garden-id': ORDERED_ID,
|
|
24
|
-
'data-garden-version': '9.12.
|
|
24
|
+
'data-garden-version': '9.12.4',
|
|
25
25
|
as: 'li',
|
|
26
26
|
$space: props.$space ?? 'medium'
|
|
27
27
|
})).withConfig({
|
|
@@ -31,7 +31,7 @@ const StyledOrderedListItem = styled(StyledFont).attrs(props => ({
|
|
|
31
31
|
const UNORDERED_ID = 'typography.unordered_list_item';
|
|
32
32
|
const StyledUnorderedListItem = styled(StyledFont).attrs(props => ({
|
|
33
33
|
'data-garden-id': UNORDERED_ID,
|
|
34
|
-
'data-garden-version': '9.12.
|
|
34
|
+
'data-garden-version': '9.12.4',
|
|
35
35
|
as: 'li',
|
|
36
36
|
$space: props.$space ?? 'medium'
|
|
37
37
|
})).withConfig({
|
|
@@ -11,7 +11,7 @@ import { THEME_SIZES } from './StyledFont.js';
|
|
|
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.12.
|
|
14
|
+
'data-garden-version': '9.12.4'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledParagraph",
|
|
17
17
|
componentId: "sc-zkuftz-0"
|