@zendeskgarden/react-typography 9.10.1 → 9.11.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.
Files changed (40) hide show
  1. package/dist/esm/elements/Blockquote.js +1 -0
  2. package/dist/esm/elements/Code.js +1 -0
  3. package/dist/esm/elements/CodeBlock.js +1 -0
  4. package/dist/esm/elements/Ellipsis.js +1 -0
  5. package/dist/esm/elements/Kbd.js +40 -0
  6. package/dist/esm/elements/LG.js +1 -0
  7. package/dist/esm/elements/MD.js +1 -0
  8. package/dist/esm/elements/Paragraph.js +1 -0
  9. package/dist/esm/elements/SM.js +1 -0
  10. package/dist/esm/elements/XL.js +1 -0
  11. package/dist/esm/elements/XXL.js +1 -0
  12. package/dist/esm/elements/XXXL.js +1 -0
  13. package/dist/esm/elements/lists/OrderedList.js +1 -0
  14. package/dist/esm/elements/lists/OrderedListItem.js +1 -0
  15. package/dist/esm/elements/lists/UnorderedList.js +1 -0
  16. package/dist/esm/elements/lists/UnorderedListItem.js +1 -0
  17. package/dist/esm/elements/span/Icon.js +1 -0
  18. package/dist/esm/elements/span/Span.js +1 -0
  19. package/dist/esm/elements/span/StartIcon.js +1 -0
  20. package/dist/esm/index.js +1 -0
  21. package/dist/esm/styled/StyledBlockquote.js +1 -1
  22. package/dist/esm/styled/StyledCode.js +1 -1
  23. package/dist/esm/styled/StyledCodeBlock.js +1 -1
  24. package/dist/esm/styled/StyledCodeBlockContainer.js +1 -1
  25. package/dist/esm/styled/StyledCodeBlockLine.js +1 -1
  26. package/dist/esm/styled/StyledCodeBlockToken.js +1 -1
  27. package/dist/esm/styled/StyledEllipsis.js +1 -1
  28. package/dist/esm/styled/StyledFont.js +1 -1
  29. package/dist/esm/styled/StyledIcon.js +1 -1
  30. package/dist/esm/styled/StyledKbd.js +47 -0
  31. package/dist/esm/styled/StyledList.js +2 -2
  32. package/dist/esm/styled/StyledListItem.js +2 -2
  33. package/dist/esm/styled/StyledParagraph.js +1 -1
  34. package/dist/index.cjs.js +86 -34
  35. package/dist/typings/elements/Kbd.d.ts +12 -0
  36. package/dist/typings/index.d.ts +2 -1
  37. package/dist/typings/styled/StyledKbd.d.ts +17 -0
  38. package/dist/typings/styled/index.d.ts +1 -0
  39. package/dist/typings/types/index.d.ts +4 -0
  40. package/package.json +3 -3
@@ -16,6 +16,7 @@ import '../styled/StyledCodeBlockToken.js';
16
16
  import '../styled/StyledEllipsis.js';
17
17
  import '../styled/StyledFont.js';
18
18
  import '../styled/StyledIcon.js';
19
+ import '../styled/StyledKbd.js';
19
20
  import '../styled/StyledList.js';
20
21
  import '../styled/StyledListItem.js';
21
22
  import '../styled/StyledParagraph.js';
@@ -16,6 +16,7 @@ import '../styled/StyledCodeBlockToken.js';
16
16
  import '../styled/StyledEllipsis.js';
17
17
  import '../styled/StyledFont.js';
18
18
  import '../styled/StyledIcon.js';
19
+ import '../styled/StyledKbd.js';
19
20
  import '../styled/StyledList.js';
20
21
  import '../styled/StyledListItem.js';
21
22
  import '../styled/StyledParagraph.js';
@@ -18,6 +18,7 @@ import { StyledCodeBlockToken } from '../styled/StyledCodeBlockToken.js';
18
18
  import '../styled/StyledEllipsis.js';
19
19
  import '../styled/StyledFont.js';
20
20
  import '../styled/StyledIcon.js';
21
+ import '../styled/StyledKbd.js';
21
22
  import '../styled/StyledList.js';
22
23
  import '../styled/StyledListItem.js';
23
24
  import '../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../styled/StyledCodeBlockToken.js';
15
15
  import { StyledEllipsis } from '../styled/StyledEllipsis.js';
16
16
  import '../styled/StyledFont.js';
17
17
  import '../styled/StyledIcon.js';
18
+ import '../styled/StyledKbd.js';
18
19
  import '../styled/StyledList.js';
19
20
  import '../styled/StyledListItem.js';
20
21
  import '../styled/StyledParagraph.js';
@@ -0,0 +1,40 @@
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 '../styled/StyledFont.js';
17
+ import '../styled/StyledIcon.js';
18
+ import { StyledKbd } from '../styled/StyledKbd.js';
19
+ import '../styled/StyledList.js';
20
+ import '../styled/StyledListItem.js';
21
+ import '../styled/StyledParagraph.js';
22
+ import { INHERIT_SIZE } from '../types/index.js';
23
+
24
+ const Kbd = forwardRef((_ref, ref) => {
25
+ let {
26
+ size = 'inherit',
27
+ ...other
28
+ } = _ref;
29
+ return React.createElement(StyledKbd, Object.assign({
30
+ $size: size
31
+ }, other, {
32
+ ref: ref
33
+ }));
34
+ });
35
+ Kbd.displayName = 'Kbd';
36
+ Kbd.propTypes = {
37
+ size: PropTypes.oneOf(INHERIT_SIZE)
38
+ };
39
+
40
+ export { Kbd };
@@ -15,6 +15,7 @@ import '../styled/StyledCodeBlockToken.js';
15
15
  import '../styled/StyledEllipsis.js';
16
16
  import { StyledFont } from '../styled/StyledFont.js';
17
17
  import '../styled/StyledIcon.js';
18
+ import '../styled/StyledKbd.js';
18
19
  import '../styled/StyledList.js';
19
20
  import '../styled/StyledListItem.js';
20
21
  import '../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../styled/StyledCodeBlockToken.js';
15
15
  import '../styled/StyledEllipsis.js';
16
16
  import { StyledFont } from '../styled/StyledFont.js';
17
17
  import '../styled/StyledIcon.js';
18
+ import '../styled/StyledKbd.js';
18
19
  import '../styled/StyledList.js';
19
20
  import '../styled/StyledListItem.js';
20
21
  import '../styled/StyledParagraph.js';
@@ -16,6 +16,7 @@ import '../styled/StyledCodeBlockToken.js';
16
16
  import '../styled/StyledEllipsis.js';
17
17
  import '../styled/StyledFont.js';
18
18
  import '../styled/StyledIcon.js';
19
+ import '../styled/StyledKbd.js';
19
20
  import '../styled/StyledList.js';
20
21
  import '../styled/StyledListItem.js';
21
22
  import { StyledParagraph } from '../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../styled/StyledCodeBlockToken.js';
15
15
  import '../styled/StyledEllipsis.js';
16
16
  import { StyledFont } from '../styled/StyledFont.js';
17
17
  import '../styled/StyledIcon.js';
18
+ import '../styled/StyledKbd.js';
18
19
  import '../styled/StyledList.js';
19
20
  import '../styled/StyledListItem.js';
20
21
  import '../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../styled/StyledCodeBlockToken.js';
15
15
  import '../styled/StyledEllipsis.js';
16
16
  import { StyledFont } from '../styled/StyledFont.js';
17
17
  import '../styled/StyledIcon.js';
18
+ import '../styled/StyledKbd.js';
18
19
  import '../styled/StyledList.js';
19
20
  import '../styled/StyledListItem.js';
20
21
  import '../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../styled/StyledCodeBlockToken.js';
15
15
  import '../styled/StyledEllipsis.js';
16
16
  import { StyledFont } from '../styled/StyledFont.js';
17
17
  import '../styled/StyledIcon.js';
18
+ import '../styled/StyledKbd.js';
18
19
  import '../styled/StyledList.js';
19
20
  import '../styled/StyledListItem.js';
20
21
  import '../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../styled/StyledCodeBlockToken.js';
15
15
  import '../styled/StyledEllipsis.js';
16
16
  import { StyledFont } from '../styled/StyledFont.js';
17
17
  import '../styled/StyledIcon.js';
18
+ import '../styled/StyledKbd.js';
18
19
  import '../styled/StyledList.js';
19
20
  import '../styled/StyledListItem.js';
20
21
  import '../styled/StyledParagraph.js';
@@ -18,6 +18,7 @@ import '../../styled/StyledCodeBlockToken.js';
18
18
  import '../../styled/StyledEllipsis.js';
19
19
  import '../../styled/StyledFont.js';
20
20
  import '../../styled/StyledIcon.js';
21
+ import '../../styled/StyledKbd.js';
21
22
  import { StyledOrderedList } from '../../styled/StyledList.js';
22
23
  import '../../styled/StyledListItem.js';
23
24
  import '../../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../../styled/StyledCodeBlockToken.js';
15
15
  import '../../styled/StyledEllipsis.js';
16
16
  import '../../styled/StyledFont.js';
17
17
  import '../../styled/StyledIcon.js';
18
+ import '../../styled/StyledKbd.js';
18
19
  import '../../styled/StyledList.js';
19
20
  import { StyledOrderedListItem } from '../../styled/StyledListItem.js';
20
21
  import '../../styled/StyledParagraph.js';
@@ -18,6 +18,7 @@ import '../../styled/StyledCodeBlockToken.js';
18
18
  import '../../styled/StyledEllipsis.js';
19
19
  import '../../styled/StyledFont.js';
20
20
  import '../../styled/StyledIcon.js';
21
+ import '../../styled/StyledKbd.js';
21
22
  import { StyledUnorderedList } from '../../styled/StyledList.js';
22
23
  import '../../styled/StyledListItem.js';
23
24
  import '../../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../../styled/StyledCodeBlockToken.js';
15
15
  import '../../styled/StyledEllipsis.js';
16
16
  import '../../styled/StyledFont.js';
17
17
  import '../../styled/StyledIcon.js';
18
+ import '../../styled/StyledKbd.js';
18
19
  import '../../styled/StyledList.js';
19
20
  import { StyledUnorderedListItem } from '../../styled/StyledListItem.js';
20
21
  import '../../styled/StyledParagraph.js';
@@ -14,6 +14,7 @@ import '../../styled/StyledCodeBlockToken.js';
14
14
  import '../../styled/StyledEllipsis.js';
15
15
  import '../../styled/StyledFont.js';
16
16
  import { StyledIcon } from '../../styled/StyledIcon.js';
17
+ import '../../styled/StyledKbd.js';
17
18
  import '../../styled/StyledList.js';
18
19
  import '../../styled/StyledListItem.js';
19
20
  import '../../styled/StyledParagraph.js';
@@ -15,6 +15,7 @@ import '../../styled/StyledCodeBlockToken.js';
15
15
  import '../../styled/StyledEllipsis.js';
16
16
  import { StyledFont } from '../../styled/StyledFont.js';
17
17
  import '../../styled/StyledIcon.js';
18
+ import '../../styled/StyledKbd.js';
18
19
  import '../../styled/StyledList.js';
19
20
  import '../../styled/StyledListItem.js';
20
21
  import '../../styled/StyledParagraph.js';
@@ -14,6 +14,7 @@ import '../../styled/StyledCodeBlockToken.js';
14
14
  import '../../styled/StyledEllipsis.js';
15
15
  import '../../styled/StyledFont.js';
16
16
  import { StyledIcon } from '../../styled/StyledIcon.js';
17
+ import '../../styled/StyledKbd.js';
17
18
  import '../../styled/StyledList.js';
18
19
  import '../../styled/StyledListItem.js';
19
20
  import '../../styled/StyledParagraph.js';
package/dist/esm/index.js CHANGED
@@ -14,6 +14,7 @@ export { Blockquote } from './elements/Blockquote.js';
14
14
  export { Code } from './elements/Code.js';
15
15
  export { CodeBlock } from './elements/CodeBlock.js';
16
16
  export { Ellipsis } from './elements/Ellipsis.js';
17
+ export { Kbd } from './elements/Kbd.js';
17
18
  export { Paragraph } from './elements/Paragraph.js';
18
19
  export { OrderedList } from './elements/lists/OrderedList.js';
19
20
  export { UnorderedList } from './elements/lists/UnorderedList.js';
@@ -11,7 +11,7 @@ import { THEME_SIZES } from './StyledFont.js';
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.10.1'
14
+ 'data-garden-version': '9.11.0'
15
15
  }).withConfig({
16
16
  displayName: "StyledBlockquote",
17
17
  componentId: "sc-1tt3ye0-0"
@@ -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.10.1',
53
+ 'data-garden-version': '9.11.0',
54
54
  as: 'code',
55
55
  $isMonospace: true
56
56
  }).withConfig({
@@ -24,7 +24,7 @@ const colorStyles = _ref => {
24
24
  };
25
25
  const StyledCodeBlock = styled.pre.attrs({
26
26
  'data-garden-id': COMPONENT_ID,
27
- 'data-garden-version': '9.10.1'
27
+ 'data-garden-version': '9.11.0'
28
28
  }).withConfig({
29
29
  displayName: "StyledCodeBlock",
30
30
  componentId: "sc-5wky57-0"
@@ -10,7 +10,7 @@ import { focusStyles, componentStyles } from '@zendeskgarden/react-theming';
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.10.1'
13
+ 'data-garden-version': '9.11.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledCodeBlockContainer",
16
16
  componentId: "sc-14zgbfw-0"
@@ -86,7 +86,7 @@ const lineNumberStyles = _ref2 => {
86
86
  };
87
87
  const StyledCodeBlockLine = styled(StyledFont).attrs({
88
88
  'data-garden-id': COMPONENT_ID,
89
- 'data-garden-version': '9.10.1',
89
+ 'data-garden-version': '9.11.0',
90
90
  as: 'code',
91
91
  $isMonospace: true
92
92
  }).withConfig({
@@ -171,7 +171,7 @@ const colorStyles = _ref => {
171
171
  };
172
172
  const StyledCodeBlockToken = styled.span.attrs({
173
173
  'data-garden-id': COMPONENT_ID,
174
- 'data-garden-version': '9.10.1'
174
+ 'data-garden-version': '9.11.0'
175
175
  }).withConfig({
176
176
  displayName: "StyledCodeBlockToken",
177
177
  componentId: "sc-1hkshdq-0"
@@ -10,7 +10,7 @@ import { componentStyles } from '@zendeskgarden/react-theming';
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.10.1'
13
+ 'data-garden-version': '9.11.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledEllipsis",
16
16
  componentId: "sc-1u4uqmy-0"
@@ -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.10.1'
70
+ 'data-garden-version': '9.11.0'
71
71
  }).withConfig({
72
72
  displayName: "StyledFont",
73
73
  componentId: "sc-1iildbo-0"
@@ -15,7 +15,7 @@ const sizeStyles = props => {
15
15
  };
16
16
  const StyledIcon = styled(StyledBaseIcon).attrs({
17
17
  'data-garden-id': COMPONENT_ID,
18
- 'data-garden-version': '9.10.1'
18
+ 'data-garden-version': '9.11.0'
19
19
  }).withConfig({
20
20
  displayName: "StyledIcon",
21
21
  componentId: "sc-10rfb5b-0"
@@ -0,0 +1,47 @@
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 styled, { css } from 'styled-components';
8
+ import { stripUnit, math } from 'polished';
9
+ import { componentStyles } from '@zendeskgarden/react-theming';
10
+ import { StyledCode } from './StyledCode.js';
11
+
12
+ const COMPONENT_ID = 'typography.kbd';
13
+ const sizeStyles = _ref => {
14
+ let {
15
+ theme,
16
+ $size
17
+ } = _ref;
18
+ let paddingHorizontal;
19
+ let paddingVertical = '0';
20
+ switch ($size) {
21
+ case 'small':
22
+ paddingHorizontal = `${theme.space.base}px`;
23
+ break;
24
+ case 'medium':
25
+ paddingHorizontal = `${theme.space.base * 1.5}px`;
26
+ break;
27
+ case 'large':
28
+ paddingHorizontal = `${theme.space.base * 1.75}px`;
29
+ break;
30
+ default:
31
+ paddingHorizontal = `${stripUnit(math(`${theme.space.base * 1.5} / (${theme.fontSizes.md} - 1px)`))}em`;
32
+ paddingVertical = '1.5px';
33
+ break;
34
+ }
35
+ const padding = `${paddingVertical} ${paddingHorizontal}`;
36
+ return css(["&&{padding:", ";}"], padding);
37
+ };
38
+ const StyledKbd = styled(StyledCode).attrs({
39
+ 'data-garden-id': COMPONENT_ID,
40
+ 'data-garden-version': '9.11.0',
41
+ as: 'kbd'
42
+ }).withConfig({
43
+ displayName: "StyledKbd",
44
+ componentId: "sc-1gzk2wp-0"
45
+ })(["display:inline-block;direction:ltr;", ";", ";"], sizeStyles, componentStyles);
46
+
47
+ export { StyledKbd };
@@ -14,7 +14,7 @@ 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.10.1'
17
+ 'data-garden-version': '9.11.0'
18
18
  }).withConfig({
19
19
  displayName: "StyledList__StyledOrderedList",
20
20
  componentId: "sc-jdbsfi-0"
@@ -22,7 +22,7 @@ const StyledOrderedList = styled.ol.attrs({
22
22
  const UNORDERED_ID = 'typography.unordered_list';
23
23
  const StyledUnorderedList = styled.ul.attrs({
24
24
  'data-garden-id': UNORDERED_ID,
25
- 'data-garden-version': '9.10.1'
25
+ 'data-garden-version': '9.11.0'
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({
23
23
  'data-garden-id': ORDERED_ID,
24
- 'data-garden-version': '9.10.1',
24
+ 'data-garden-version': '9.11.0',
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.10.1',
37
+ 'data-garden-version': '9.11.0',
38
38
  as: 'li'
39
39
  }).withConfig({
40
40
  displayName: "StyledListItem__StyledUnorderedListItem",
@@ -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.10.1'
14
+ 'data-garden-version': '9.11.0'
15
15
  }).withConfig({
16
16
  displayName: "StyledParagraph",
17
17
  componentId: "sc-zkuftz-0"
package/dist/index.cjs.js CHANGED
@@ -28,7 +28,7 @@ const TYPE_ORDERED_LIST = ['decimal', 'decimal-leading-zero', 'lower-alpha', 'lo
28
28
  const TYPE_UNORDERED_LIST = ['circle', 'disc', 'square'];
29
29
  const LANGUAGES = ['bash', 'css', 'diff', 'graphql', 'javascript', 'json', 'jsx', 'markdown', 'markup', 'python', 'typescript', 'tsx', 'yaml'];
30
30
 
31
- const COMPONENT_ID$9 = 'typography.font';
31
+ const COMPONENT_ID$a = 'typography.font';
32
32
  [...SIZE, 'extralarge', '2xlarge', '3xlarge'];
33
33
  const THEME_SIZES = {
34
34
  small: 'sm',
@@ -85,8 +85,8 @@ const fontStyles = _ref => {
85
85
  return styled.css(["transition:color 0.1s ease-in-out;line-height:", ";color:", ";font-family:", ";font-size:", ";font-weight:", ";direction:", ";"], lineHeight, color, fontFamily, fontSize, fontWeight, direction);
86
86
  };
87
87
  const StyledFont = styled__default.default.div.attrs({
88
- 'data-garden-id': COMPONENT_ID$9,
89
- 'data-garden-version': '9.10.1'
88
+ 'data-garden-id': COMPONENT_ID$a,
89
+ 'data-garden-version': '9.11.0'
90
90
  }).withConfig({
91
91
  displayName: "StyledFont",
92
92
  componentId: "sc-1iildbo-0"
@@ -95,10 +95,10 @@ StyledFont.defaultProps = {
95
95
  $size: 'inherit'
96
96
  };
97
97
 
98
- const COMPONENT_ID$8 = 'typography.blockquote';
98
+ const COMPONENT_ID$9 = 'typography.blockquote';
99
99
  const StyledBlockquote = styled__default.default.blockquote.attrs({
100
- 'data-garden-id': COMPONENT_ID$8,
101
- 'data-garden-version': '9.10.1'
100
+ 'data-garden-id': COMPONENT_ID$9,
101
+ 'data-garden-version': '9.11.0'
102
102
  }).withConfig({
103
103
  displayName: "StyledBlockquote",
104
104
  componentId: "sc-1tt3ye0-0"
@@ -107,7 +107,7 @@ const StyledBlockquote = styled__default.default.blockquote.attrs({
107
107
  variable: 'border.default'
108
108
  }), 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]], reactTheming.componentStyles);
109
109
 
110
- const COMPONENT_ID$7 = 'typography.code';
110
+ const COMPONENT_ID$8 = 'typography.code';
111
111
  const colorStyles$3 = _ref => {
112
112
  let {
113
113
  $hue,
@@ -148,8 +148,8 @@ const colorStyles$3 = _ref => {
148
148
  return styled.css(["background-color:", ";color:", ";a &{color:inherit;}"], backgroundColor, foregroundColor);
149
149
  };
150
150
  const StyledCode = styled__default.default(StyledFont).attrs({
151
- 'data-garden-id': COMPONENT_ID$7,
152
- 'data-garden-version': '9.10.1',
151
+ 'data-garden-id': COMPONENT_ID$8,
152
+ 'data-garden-version': '9.11.0',
153
153
  as: 'code',
154
154
  $isMonospace: true
155
155
  }).withConfig({
@@ -162,7 +162,7 @@ StyledCode.defaultProps = {
162
162
  $size: 'inherit'
163
163
  };
164
164
 
165
- const COMPONENT_ID$6 = 'typography.codeblock';
165
+ const COMPONENT_ID$7 = 'typography.codeblock';
166
166
  const colorStyles$2 = _ref => {
167
167
  let {
168
168
  theme
@@ -178,17 +178,17 @@ const colorStyles$2 = _ref => {
178
178
  return styled.css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
179
179
  };
180
180
  const StyledCodeBlock = styled__default.default.pre.attrs({
181
- 'data-garden-id': COMPONENT_ID$6,
182
- 'data-garden-version': '9.10.1'
181
+ 'data-garden-id': COMPONENT_ID$7,
182
+ 'data-garden-version': '9.11.0'
183
183
  }).withConfig({
184
184
  displayName: "StyledCodeBlock",
185
185
  componentId: "sc-5wky57-0"
186
186
  })(["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, reactTheming.componentStyles);
187
187
 
188
- const COMPONENT_ID$5 = 'typography.codeblock_container';
188
+ const COMPONENT_ID$6 = 'typography.codeblock_container';
189
189
  const StyledCodeBlockContainer = styled__default.default.div.attrs({
190
- 'data-garden-id': COMPONENT_ID$5,
191
- 'data-garden-version': '9.10.1'
190
+ 'data-garden-id': COMPONENT_ID$6,
191
+ 'data-garden-version': '9.11.0'
192
192
  }).withConfig({
193
193
  displayName: "StyledCodeBlockContainer",
194
194
  componentId: "sc-14zgbfw-0"
@@ -196,7 +196,7 @@ const StyledCodeBlockContainer = styled__default.default.div.attrs({
196
196
  theme: props.theme
197
197
  }), reactTheming.componentStyles);
198
198
 
199
- const COMPONENT_ID$4 = 'typography.codeblock_code';
199
+ const COMPONENT_ID$5 = 'typography.codeblock_code';
200
200
  const colorStyles$1 = _ref => {
201
201
  let {
202
202
  theme,
@@ -273,8 +273,8 @@ const lineNumberStyles = _ref2 => {
273
273
  `;
274
274
  };
275
275
  const StyledCodeBlockLine = styled__default.default(StyledFont).attrs({
276
- 'data-garden-id': COMPONENT_ID$4,
277
- 'data-garden-version': '9.10.1',
276
+ 'data-garden-id': COMPONENT_ID$5,
277
+ 'data-garden-version': '9.11.0',
278
278
  as: 'code',
279
279
  $isMonospace: true
280
280
  }).withConfig({
@@ -282,7 +282,7 @@ const StyledCodeBlockLine = styled__default.default(StyledFont).attrs({
282
282
  componentId: "sc-1goay17-0"
283
283
  })(["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, reactTheming.componentStyles);
284
284
 
285
- const COMPONENT_ID$3 = 'typography.codeblock_token';
285
+ const COMPONENT_ID$4 = 'typography.codeblock_token';
286
286
  const colorStyles = _ref => {
287
287
  let {
288
288
  theme
@@ -444,35 +444,70 @@ const colorStyles = _ref => {
444
444
  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);
445
445
  };
446
446
  const StyledCodeBlockToken = styled__default.default.span.attrs({
447
- 'data-garden-id': COMPONENT_ID$3,
448
- 'data-garden-version': '9.10.1'
447
+ 'data-garden-id': COMPONENT_ID$4,
448
+ 'data-garden-version': '9.11.0'
449
449
  }).withConfig({
450
450
  displayName: "StyledCodeBlockToken",
451
451
  componentId: "sc-1hkshdq-0"
452
452
  })(["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, reactTheming.componentStyles);
453
453
 
454
- const COMPONENT_ID$2 = 'typography.ellipsis';
454
+ const COMPONENT_ID$3 = 'typography.ellipsis';
455
455
  const StyledEllipsis = styled__default.default.div.attrs({
456
- 'data-garden-id': COMPONENT_ID$2,
457
- 'data-garden-version': '9.10.1'
456
+ 'data-garden-id': COMPONENT_ID$3,
457
+ 'data-garden-version': '9.11.0'
458
458
  }).withConfig({
459
459
  displayName: "StyledEllipsis",
460
460
  componentId: "sc-1u4uqmy-0"
461
461
  })(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', reactTheming.componentStyles);
462
462
 
463
- const COMPONENT_ID$1 = 'typography.icon';
464
- const sizeStyles = props => {
463
+ const COMPONENT_ID$2 = 'typography.icon';
464
+ const sizeStyles$1 = props => {
465
465
  const margin = props.$isStart && `${props.theme.space.base * 2}px`;
466
466
  const size = props.theme.iconSizes.md;
467
467
  return styled.css(["margin-", ":", ";width:", ";height:", ";"], props.theme.rtl ? 'left' : 'right', margin, size, size);
468
468
  };
469
469
  const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
470
- 'data-garden-id': COMPONENT_ID$1,
471
- 'data-garden-version': '9.10.1'
470
+ 'data-garden-id': COMPONENT_ID$2,
471
+ 'data-garden-version': '9.11.0'
472
472
  }).withConfig({
473
473
  displayName: "StyledIcon",
474
474
  componentId: "sc-10rfb5b-0"
475
- })(["position:relative;top:-1px;vertical-align:middle;", ";", ";"], props => sizeStyles(props), reactTheming.componentStyles);
475
+ })(["position:relative;top:-1px;vertical-align:middle;", ";", ";"], props => sizeStyles$1(props), reactTheming.componentStyles);
476
+
477
+ const COMPONENT_ID$1 = 'typography.kbd';
478
+ const sizeStyles = _ref => {
479
+ let {
480
+ theme,
481
+ $size
482
+ } = _ref;
483
+ let paddingHorizontal;
484
+ let paddingVertical = '0';
485
+ switch ($size) {
486
+ case 'small':
487
+ paddingHorizontal = `${theme.space.base}px`;
488
+ break;
489
+ case 'medium':
490
+ paddingHorizontal = `${theme.space.base * 1.5}px`;
491
+ break;
492
+ case 'large':
493
+ paddingHorizontal = `${theme.space.base * 1.75}px`;
494
+ break;
495
+ default:
496
+ paddingHorizontal = `${polished.stripUnit(polished.math(`${theme.space.base * 1.5} / (${theme.fontSizes.md} - 1px)`))}em`;
497
+ paddingVertical = '1.5px';
498
+ break;
499
+ }
500
+ const padding = `${paddingVertical} ${paddingHorizontal}`;
501
+ return styled.css(["&&{padding:", ";}"], padding);
502
+ };
503
+ const StyledKbd = styled__default.default(StyledCode).attrs({
504
+ 'data-garden-id': COMPONENT_ID$1,
505
+ 'data-garden-version': '9.11.0',
506
+ as: 'kbd'
507
+ }).withConfig({
508
+ displayName: "StyledKbd",
509
+ componentId: "sc-1gzk2wp-0"
510
+ })(["display:inline-block;direction:ltr;", ";", ";"], sizeStyles, reactTheming.componentStyles);
476
511
 
477
512
  const listStyles = props => {
478
513
  const rtl = props.theme.rtl;
@@ -481,7 +516,7 @@ const listStyles = props => {
481
516
  const ORDERED_ID$1 = 'typography.ordered_list';
482
517
  const StyledOrderedList = styled__default.default.ol.attrs({
483
518
  'data-garden-id': ORDERED_ID$1,
484
- 'data-garden-version': '9.10.1'
519
+ 'data-garden-version': '9.11.0'
485
520
  }).withConfig({
486
521
  displayName: "StyledList__StyledOrderedList",
487
522
  componentId: "sc-jdbsfi-0"
@@ -489,7 +524,7 @@ const StyledOrderedList = styled__default.default.ol.attrs({
489
524
  const UNORDERED_ID$1 = 'typography.unordered_list';
490
525
  const StyledUnorderedList = styled__default.default.ul.attrs({
491
526
  'data-garden-id': UNORDERED_ID$1,
492
- 'data-garden-version': '9.10.1'
527
+ 'data-garden-version': '9.11.0'
493
528
  }).withConfig({
494
529
  displayName: "StyledList__StyledUnorderedList",
495
530
  componentId: "sc-jdbsfi-1"
@@ -506,7 +541,7 @@ const listItemStyles = props => {
506
541
  const ORDERED_ID = 'typography.ordered_list_item';
507
542
  const StyledOrderedListItem = styled__default.default(StyledFont).attrs({
508
543
  'data-garden-id': ORDERED_ID,
509
- 'data-garden-version': '9.10.1',
544
+ 'data-garden-version': '9.11.0',
510
545
  as: 'li'
511
546
  }).withConfig({
512
547
  displayName: "StyledListItem__StyledOrderedListItem",
@@ -519,7 +554,7 @@ StyledOrderedListItem.defaultProps = {
519
554
  const UNORDERED_ID = 'typography.unordered_list_item';
520
555
  const StyledUnorderedListItem = styled__default.default(StyledFont).attrs({
521
556
  'data-garden-id': UNORDERED_ID,
522
- 'data-garden-version': '9.10.1',
557
+ 'data-garden-version': '9.11.0',
523
558
  as: 'li'
524
559
  }).withConfig({
525
560
  displayName: "StyledListItem__StyledUnorderedListItem",
@@ -533,7 +568,7 @@ StyledUnorderedListItem.defaultProps = {
533
568
  const COMPONENT_ID = 'typography.paragraph';
534
569
  const StyledParagraph = styled__default.default.p.attrs({
535
570
  'data-garden-id': COMPONENT_ID,
536
- 'data-garden-version': '9.10.1'
571
+ 'data-garden-version': '9.11.0'
537
572
  }).withConfig({
538
573
  displayName: "StyledParagraph",
539
574
  componentId: "sc-zkuftz-0"
@@ -824,6 +859,22 @@ Ellipsis.defaultProps = {
824
859
  tag: 'div'
825
860
  };
826
861
 
862
+ const Kbd = React.forwardRef((_ref, ref) => {
863
+ let {
864
+ size = 'inherit',
865
+ ...other
866
+ } = _ref;
867
+ return React__default.default.createElement(StyledKbd, Object.assign({
868
+ $size: size
869
+ }, other, {
870
+ ref: ref
871
+ }));
872
+ });
873
+ Kbd.displayName = 'Kbd';
874
+ Kbd.propTypes = {
875
+ size: PropTypes__default.default.oneOf(INHERIT_SIZE)
876
+ };
877
+
827
878
  const Paragraph = React.forwardRef((props, ref) => React__default.default.createElement(StyledParagraph, Object.assign({
828
879
  ref: ref
829
880
  }, props)));
@@ -978,6 +1029,7 @@ exports.Blockquote = Blockquote;
978
1029
  exports.Code = Code;
979
1030
  exports.CodeBlock = CodeBlock;
980
1031
  exports.Ellipsis = Ellipsis;
1032
+ exports.Kbd = Kbd;
981
1033
  exports.LG = LG;
982
1034
  exports.MD = MD;
983
1035
  exports.OrderedList = OrderedList;
@@ -0,0 +1,12 @@
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 from 'react';
8
+ import { IKbdProps } from '../types';
9
+ /**
10
+ * @extends HTMLAttributes<HTMLElement>
11
+ */
12
+ export declare const Kbd: React.ForwardRefExoticComponent<IKbdProps & React.RefAttributes<HTMLElement>>;
@@ -14,8 +14,9 @@ export { Blockquote } from './elements/Blockquote';
14
14
  export { Code } from './elements/Code';
15
15
  export { CodeBlock } from './elements/CodeBlock';
16
16
  export { Ellipsis } from './elements/Ellipsis';
17
+ export { Kbd } from './elements/Kbd';
17
18
  export { Paragraph } from './elements/Paragraph';
18
19
  export { OrderedList } from './elements/lists/OrderedList';
19
20
  export { UnorderedList } from './elements/lists/UnorderedList';
20
21
  export { Span } from './elements/span/Span';
21
- export type { ITypescaleMonospaceProps as ISMProps, ITypescaleMonospaceProps as IMDProps, ITypescaleMonospaceProps as ILGProps, ITypescaleProps as IXLProps, ITypescaleProps as IXXLProps, ITypescaleProps as IXXXLProps, IBlockquoteProps, ICodeProps, ICodeBlockProps, IEllipsisProps, IParagraphProps, IOrderedListProps, IUnorderedListProps, ISpanProps } from './types';
22
+ export type { ITypescaleMonospaceProps as ISMProps, ITypescaleMonospaceProps as IMDProps, ITypescaleMonospaceProps as ILGProps, ITypescaleProps as IXLProps, ITypescaleProps as IXXLProps, ITypescaleProps as IXXXLProps, IBlockquoteProps, ICodeProps, ICodeBlockProps, IEllipsisProps, IKbdProps, IParagraphProps, IOrderedListProps, IUnorderedListProps, ISpanProps } from './types';
@@ -0,0 +1,17 @@
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 { DefaultTheme, ThemeProps } from 'styled-components';
8
+ import { IKbdProps } from '../types';
9
+ interface IStyledKbdProps extends ThemeProps<DefaultTheme> {
10
+ $size?: IKbdProps['size'];
11
+ }
12
+ export declare const StyledKbd: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
13
+ ref?: ((instance: HTMLElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLElement> | null | undefined;
14
+ }, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
15
+ ref?: ((instance: HTMLElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLElement> | null | undefined;
16
+ }>, never>, IStyledKbdProps>> & string;
17
+ export {};
@@ -13,6 +13,7 @@ export * from './StyledCodeBlockToken';
13
13
  export * from './StyledEllipsis';
14
14
  export * from './StyledFont';
15
15
  export * from './StyledIcon';
16
+ export * from './StyledKbd';
16
17
  export * from './StyledList';
17
18
  export * from './StyledListItem';
18
19
  export * from './StyledParagraph';
@@ -53,6 +53,10 @@ export interface IEllipsisProps extends HTMLAttributes<HTMLDivElement> {
53
53
  /** Updates the element's HTML tag */
54
54
  tag?: any;
55
55
  }
56
+ export interface IKbdProps extends HTMLAttributes<HTMLElement> {
57
+ /** Adjusts the font size. By default font size is inherited from the surrounding text. */
58
+ size?: (typeof INHERIT_SIZE)[number];
59
+ }
56
60
  export interface IParagraphProps extends HTMLAttributes<HTMLParagraphElement> {
57
61
  /** Controls the spacing between sibling paragraphs */
58
62
  size?: Size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-typography",
3
- "version": "9.10.1",
3
+ "version": "9.11.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": "^5.3.1 || ^6.0.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@zendeskgarden/react-theming": "^9.10.1"
36
+ "@zendeskgarden/react-theming": "^9.11.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": "13d8cdfc477e51f8d4829a2e8463e0c84672a339"
48
+ "gitHead": "1bde0483c654e7fc3482c7b95741147a01073ef9"
49
49
  }