@atlaskit/code 14.3.10 → 14.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/code
2
2
 
3
+ ## 14.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`bc989043572`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc989043572) - Internal changes to apply spacing tokens. This should be a no-op change.
8
+
9
+ ## 14.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`d6bf753bb43`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6bf753bb43) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 14.3.10
4
20
 
5
21
  ### Patch Changes
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Decorator = Decorator;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
10
  var _colors = require("@atlaskit/theme/colors");
11
11
 
12
12
  /** @jsx jsx */
13
- var decoration = (0, _core.css)({
13
+ var decoration = (0, _react.css)({
14
14
  // Required as otherwise the following bidi characters cause the span
15
15
  // to not receive hover events.
16
16
  //
@@ -19,7 +19,7 @@ var decoration = (0, _core.css)({
19
19
  position: 'relative',
20
20
  ':before': {
21
21
  display: 'inline-flex',
22
- padding: '0 4px',
22
+ padding: "var(--ds-scale-0, 0px)".concat(" ", "var(--ds-scale-050, 4px)"),
23
23
  alignItems: 'center',
24
24
  justifyContent: 'center',
25
25
  flexDirection: 'row',
@@ -47,9 +47,9 @@ function Decorator(_ref) {
47
47
  children = _ref.children,
48
48
  testId = _ref.testId;
49
49
  var bidiCharacterCode = getBidiCharacterCode(bidiCharacter);
50
- return (0, _core.jsx)("span", {
50
+ return (0, _react.jsx)("span", {
51
51
  "aria-label": bidiCharacterCode
52
- }, (0, _core.jsx)("span", {
52
+ }, (0, _react.jsx)("span", {
53
53
  css: decoration,
54
54
  "data-testid": testId,
55
55
  "data-bidi-character-code": bidiCharacterCode // This is set to true so that the content is not read out by
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
- var _core = require("@emotion/core");
10
+ var _react2 = require("@emotion/react");
11
11
 
12
12
  var _reactSyntaxHighlighter = require("react-syntax-highlighter");
13
13
 
@@ -59,7 +59,7 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
59
59
  return (0, _styles.getCodeBlockStyles)(theme);
60
60
  }, [theme]);
61
61
  var styles = (0, _react.useMemo)(function () {
62
- return getStyles(highlightedStartText, highlightedEndText, showLineNumbers);
62
+ return (0, _react2.css)(getStyles(highlightedStartText, highlightedEndText, showLineNumbers));
63
63
  }, [highlightedStartText, highlightedEndText, showLineNumbers, getStyles]);
64
64
 
65
65
  var _useHighlightLines = (0, _useHighlight.useHighlightLines)({
@@ -81,7 +81,7 @@ var CodeBlock = /*#__PURE__*/(0, _react.memo)(function CodeBlock(_ref) {
81
81
  codeBidiWarningLabel: codeBidiWarningLabel,
82
82
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
83
83
  }) : undefined;
84
- return (0, _core.jsx)(_reactSyntaxHighlighter.PrismAsync, {
84
+ return (0, _react2.jsx)(_reactSyntaxHighlighter.PrismAsync, {
85
85
  "data-testid": testId,
86
86
  "data-code-lang": language,
87
87
  "data-ds--code--code-block": "",
package/dist/cjs/code.js CHANGED
@@ -21,7 +21,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
21
21
 
22
22
  var _react = _interopRequireWildcard(require("react"));
23
23
 
24
- var _core = require("@emotion/core");
24
+ var _react2 = require("@emotion/react");
25
25
 
26
26
  var _components = require("@atlaskit/theme/components");
27
27
 
@@ -52,7 +52,7 @@ var Code = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
52
52
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
53
53
  var theme = (0, _components.useGlobalTheme)();
54
54
  var styles = (0, _react.useMemo)(function () {
55
- return (0, _styles.getCodeStyles)(theme);
55
+ return (0, _react2.css)((0, _styles.getCodeStyles)(theme));
56
56
  }, [theme]);
57
57
  var children = props.children,
58
58
  _props$codeBidiWarnin = props.codeBidiWarnings,
@@ -61,11 +61,11 @@ var Code = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
61
61
  _props$codeBidiWarnin2 = props.codeBidiWarningTooltipEnabled,
62
62
  codeBidiWarningTooltipEnabled = _props$codeBidiWarnin2 === void 0 ? true : _props$codeBidiWarnin2,
63
63
  otherProps = (0, _objectWithoutProperties2.default)(props, _excluded2);
64
- var decoratedChildren = codeBidiWarnings ? (0, _core.jsx)(RenderCodeChildrenWithBidiWarnings, {
64
+ var decoratedChildren = codeBidiWarnings ? (0, _react2.jsx)(RenderCodeChildrenWithBidiWarnings, {
65
65
  codeBidiWarningLabel: codeBidiWarningLabel,
66
66
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
67
67
  }, children) : children;
68
- return (0, _core.jsx)("code", (0, _extends2.default)({
68
+ return (0, _react2.jsx)("code", (0, _extends2.default)({
69
69
  ref: ref,
70
70
  "data-testid": testId,
71
71
  css: styles
@@ -82,7 +82,7 @@ function RenderCodeChildrenWithBidiWarnings(_ref2) {
82
82
  var decorated = (0, _bidiWarningDecorator.default)(childNode, function (_ref3) {
83
83
  var bidiCharacter = _ref3.bidiCharacter,
84
84
  index = _ref3.index;
85
- return (0, _core.jsx)(_bidiWarning.default, {
85
+ return (0, _react2.jsx)(_bidiWarning.default, {
86
86
  bidiCharacter: bidiCharacter,
87
87
  key: index,
88
88
  label: codeBidiWarningLabel,
@@ -95,7 +95,7 @@ function RenderCodeChildrenWithBidiWarnings(_ref2) {
95
95
  if (isReactElement(childNode) && childNode.props.children) {
96
96
  // eslint-disable-next-line @repo/internal/react/no-clone-element
97
97
  var newChildNode = /*#__PURE__*/_react.default.cloneElement(childNode, {
98
- children: (0, _core.jsx)(RenderCodeChildrenWithBidiWarnings, {
98
+ children: (0, _react2.jsx)(RenderCodeChildrenWithBidiWarnings, {
99
99
  codeBidiWarningLabel: codeBidiWarningLabel,
100
100
  codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
101
101
  }, childNode.props.children)
@@ -107,7 +107,7 @@ function RenderCodeChildrenWithBidiWarnings(_ref2) {
107
107
  return childNode;
108
108
  });
109
109
 
110
- return (0, _core.jsx)(_react.default.Fragment, null, replacedChildren);
110
+ return (0, _react2.jsx)(_react.default.Fragment, null, replacedChildren);
111
111
  }
112
112
 
113
113
  function isReactElement(child) {
@@ -315,17 +315,12 @@ var getCodeStyles = function getCodeStyles(globalTheme) {
315
315
  var baseStyles = getBaseCodeStyles(theme);
316
316
  return _objectSpread(_objectSpread({}, baseStyles), {}, {
317
317
  display: 'inline',
318
- // monospace font appears slightly larger than the serif font so
319
- // we use a relative size to better match when used inline
320
- fontSize: '0.875em',
321
- // NB vertical padding _will_ effect the boxes vertical alignment so it needs to be
322
- // minimised. 2px provides a minumum and allows the line height to do the heavy lifting
323
- // ; 0.5ch is to emulate the half space between the next word with varied font sizes.
324
318
  padding: '2px 0.5ch',
325
- whiteSpace: 'pre-wrap',
326
- overflowWrap: 'break-word',
319
+ boxDecorationBreak: 'clone',
320
+ fontSize: '0.875em',
327
321
  overflow: 'auto',
328
- boxDecorationBreak: 'clone'
322
+ overflowWrap: 'break-word',
323
+ whiteSpace: 'pre-wrap'
329
324
  });
330
325
  };
331
326
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.10",
3
+ "version": "14.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { Y75 } from '@atlaskit/theme/colors';
4
4
  const decoration = css({
5
5
  // Required as otherwise the following bidi characters cause the span
@@ -10,7 +10,7 @@ const decoration = css({
10
10
  position: 'relative',
11
11
  ':before': {
12
12
  display: 'inline-flex',
13
- padding: '0 4px',
13
+ padding: `${"var(--ds-scale-0, 0px)"} ${"var(--ds-scale-050, 4px)"}`,
14
14
  alignItems: 'center',
15
15
  justifyContent: 'center',
16
16
  flexDirection: 'row',
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { memo, useCallback, useMemo } from 'react';
3
- import { jsx } from '@emotion/core';
3
+ import { css, jsx } from '@emotion/react';
4
4
  import { PrismAsync as SyntaxHighlighter } from 'react-syntax-highlighter';
5
5
  import { useGlobalTheme } from '@atlaskit/theme/components';
6
6
  import { useHighlightLines } from './internal/hooks/use-highlight';
@@ -33,7 +33,7 @@ const CodeBlock = /*#__PURE__*/memo(function CodeBlock({
33
33
  const globalTheme = useGlobalTheme();
34
34
  const theme = useMemo(() => getCodeBlockTheme(globalTheme, numLines), [globalTheme, numLines]);
35
35
  const getStyles = useMemo(() => getCodeBlockStyles(theme), [theme]);
36
- const styles = useMemo(() => getStyles(highlightedStartText, highlightedEndText, showLineNumbers), [highlightedStartText, highlightedEndText, showLineNumbers, getStyles]);
36
+ const styles = useMemo(() => css(getStyles(highlightedStartText, highlightedEndText, showLineNumbers)), [highlightedStartText, highlightedEndText, showLineNumbers, getStyles]);
37
37
  const {
38
38
  getHighlightStyles,
39
39
  highlightedLines
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import React, { forwardRef, memo, useMemo } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { useGlobalTheme } from '@atlaskit/theme/components';
7
7
  import CodeBidiWarning from './bidi-warning';
8
8
  import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
@@ -22,7 +22,7 @@ const Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code({
22
22
  ...props
23
23
  }, ref) {
24
24
  const theme = useGlobalTheme();
25
- const styles = useMemo(() => getCodeStyles(theme), [theme]);
25
+ const styles = useMemo(() => css(getCodeStyles(theme)), [theme]);
26
26
  const {
27
27
  children,
28
28
  codeBidiWarnings = true,
@@ -281,17 +281,12 @@ export const getCodeStyles = globalTheme => {
281
281
  const baseStyles = getBaseCodeStyles(theme);
282
282
  return { ...baseStyles,
283
283
  display: 'inline',
284
- // monospace font appears slightly larger than the serif font so
285
- // we use a relative size to better match when used inline
286
- fontSize: '0.875em',
287
- // NB vertical padding _will_ effect the boxes vertical alignment so it needs to be
288
- // minimised. 2px provides a minumum and allows the line height to do the heavy lifting
289
- // ; 0.5ch is to emulate the half space between the next word with varied font sizes.
290
284
  padding: '2px 0.5ch',
291
- whiteSpace: 'pre-wrap',
292
- overflowWrap: 'break-word',
285
+ boxDecorationBreak: 'clone',
286
+ fontSize: '0.875em',
293
287
  overflow: 'auto',
294
- boxDecorationBreak: 'clone'
288
+ overflowWrap: 'break-word',
289
+ whiteSpace: 'pre-wrap'
295
290
  };
296
291
  };
297
292
  export const getCodeBlockTheme = (globalTheme, maxLines) => {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.10",
3
+ "version": "14.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { Y75 } from '@atlaskit/theme/colors';
4
4
  var decoration = css({
5
5
  // Required as otherwise the following bidi characters cause the span
@@ -10,7 +10,7 @@ var decoration = css({
10
10
  position: 'relative',
11
11
  ':before': {
12
12
  display: 'inline-flex',
13
- padding: '0 4px',
13
+ padding: "var(--ds-scale-0, 0px)".concat(" ", "var(--ds-scale-050, 4px)"),
14
14
  alignItems: 'center',
15
15
  justifyContent: 'center',
16
16
  flexDirection: 'row',
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { memo, useCallback, useMemo } from 'react';
3
- import { jsx } from '@emotion/core';
3
+ import { css, jsx } from '@emotion/react';
4
4
  import { PrismAsync as SyntaxHighlighter } from 'react-syntax-highlighter';
5
5
  import { useGlobalTheme } from '@atlaskit/theme/components';
6
6
  import { useHighlightLines } from './internal/hooks/use-highlight';
@@ -44,7 +44,7 @@ var CodeBlock = /*#__PURE__*/memo(function CodeBlock(_ref) {
44
44
  return getCodeBlockStyles(theme);
45
45
  }, [theme]);
46
46
  var styles = useMemo(function () {
47
- return getStyles(highlightedStartText, highlightedEndText, showLineNumbers);
47
+ return css(getStyles(highlightedStartText, highlightedEndText, showLineNumbers));
48
48
  }, [highlightedStartText, highlightedEndText, showLineNumbers, getStyles]);
49
49
 
50
50
  var _useHighlightLines = useHighlightLines({
package/dist/esm/code.js CHANGED
@@ -5,7 +5,7 @@ var _excluded = ["testId"],
5
5
 
6
6
  /** @jsx jsx */
7
7
  import React, { forwardRef, memo, useMemo } from 'react';
8
- import { jsx } from '@emotion/core';
8
+ import { css, jsx } from '@emotion/react';
9
9
  import { useGlobalTheme } from '@atlaskit/theme/components';
10
10
  import CodeBidiWarning from './bidi-warning';
11
11
  import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
@@ -26,7 +26,7 @@ var Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code(_ref, ref) {
26
26
 
27
27
  var theme = useGlobalTheme();
28
28
  var styles = useMemo(function () {
29
- return getCodeStyles(theme);
29
+ return css(getCodeStyles(theme));
30
30
  }, [theme]);
31
31
 
32
32
  var children = props.children,
@@ -295,17 +295,12 @@ export var getCodeStyles = function getCodeStyles(globalTheme) {
295
295
  var baseStyles = getBaseCodeStyles(theme);
296
296
  return _objectSpread(_objectSpread({}, baseStyles), {}, {
297
297
  display: 'inline',
298
- // monospace font appears slightly larger than the serif font so
299
- // we use a relative size to better match when used inline
300
- fontSize: '0.875em',
301
- // NB vertical padding _will_ effect the boxes vertical alignment so it needs to be
302
- // minimised. 2px provides a minumum and allows the line height to do the heavy lifting
303
- // ; 0.5ch is to emulate the half space between the next word with varied font sizes.
304
298
  padding: '2px 0.5ch',
305
- whiteSpace: 'pre-wrap',
306
- overflowWrap: 'break-word',
299
+ boxDecorationBreak: 'clone',
300
+ fontSize: '0.875em',
307
301
  overflow: 'auto',
308
- boxDecorationBreak: 'clone'
302
+ overflowWrap: 'break-word',
303
+ whiteSpace: 'pre-wrap'
309
304
  });
310
305
  };
311
306
  export var getCodeBlockTheme = function getCodeBlockTheme(globalTheme, maxLines) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.10",
3
+ "version": "14.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  export declare function Decorator({ bidiCharacter, children, testId, }: {
4
5
  bidiCharacter: string;
5
6
  children: ReactNode;
6
7
  testId?: string;
7
- }): JSX.Element;
8
+ }): jsx.JSX.Element;
@@ -11,6 +11,6 @@ import type { CodeProps } from './types';
11
11
  * - [Code](https://atlassian.design/components/code/code)
12
12
  * - [Usage](https://atlassian.design/components/code/usage)
13
13
  */
14
- declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CodeProps, "as" | "css" | "name" | "testId" | "codeBidiWarnings" | "codeBidiWarningLabel" | "codeBidiWarningTooltipEnabled" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLElement>>>;
14
+ declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CodeProps, "headers" | "method" | "as" | "name" | "testId" | "codeBidiWarnings" | "codeBidiWarningLabel" | "codeBidiWarningTooltipEnabled" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLElement>>>;
15
15
  export { getCodeStyles };
16
16
  export default Code;
@@ -1,11 +1,19 @@
1
- import type { CSSObject } from '@emotion/core';
1
+ import type { CSSObject } from '@emotion/react';
2
2
  import type { Theme } from '@atlaskit/theme/types';
3
3
  import type { CodeBlockTheme, CodeTheme } from './types';
4
4
  export declare const getLineNumWidth: (numLines: number) => string;
5
5
  /**
6
6
  * Styles applied at the root element level, common across code/codeblock
7
7
  */
8
- export declare const getBaseCodeStyles: (theme: CodeTheme) => CSSObject;
8
+ export declare const getBaseCodeStyles: (theme: CodeTheme) => {
9
+ fontSize: number;
10
+ fontFamily: string | undefined;
11
+ fontWeight: string;
12
+ backgroundColor: string;
13
+ color: string | undefined;
14
+ borderStyle: string;
15
+ borderRadius: string;
16
+ };
9
17
  /**
10
18
  * Takes an implemented CodeBlock theme, and returns styles required for
11
19
  * react-syntax-highlighter.
@@ -1,7 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  export declare function Decorator({ bidiCharacter, children, testId, }: {
4
5
  bidiCharacter: string;
5
6
  children: ReactNode;
6
7
  testId?: string;
7
- }): JSX.Element;
8
+ }): jsx.JSX.Element;
@@ -11,6 +11,6 @@ import type { CodeProps } from './types';
11
11
  * - [Code](https://atlassian.design/components/code/code)
12
12
  * - [Usage](https://atlassian.design/components/code/usage)
13
13
  */
14
- declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CodeProps, "as" | "css" | "name" | "testId" | "codeBidiWarnings" | "codeBidiWarningLabel" | "codeBidiWarningTooltipEnabled" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLElement>>>;
14
+ declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CodeProps, "headers" | "method" | "as" | "name" | "testId" | "codeBidiWarnings" | "codeBidiWarningLabel" | "codeBidiWarningTooltipEnabled" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLElement>>>;
15
15
  export { getCodeStyles };
16
16
  export default Code;
@@ -1,11 +1,19 @@
1
- import type { CSSObject } from '@emotion/core';
1
+ import type { CSSObject } from '@emotion/react';
2
2
  import type { Theme } from '@atlaskit/theme/types';
3
3
  import type { CodeBlockTheme, CodeTheme } from './types';
4
4
  export declare const getLineNumWidth: (numLines: number) => string;
5
5
  /**
6
6
  * Styles applied at the root element level, common across code/codeblock
7
7
  */
8
- export declare const getBaseCodeStyles: (theme: CodeTheme) => CSSObject;
8
+ export declare const getBaseCodeStyles: (theme: CodeTheme) => {
9
+ fontSize: number;
10
+ fontFamily: string | undefined;
11
+ fontWeight: string;
12
+ backgroundColor: string;
13
+ color: string | undefined;
14
+ borderStyle: string;
15
+ borderRadius: string;
16
+ };
9
17
  /**
10
18
  * Takes an implemented CodeBlock theme, and returns styles required for
11
19
  * react-syntax-highlighter.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.10",
3
+ "version": "14.4.1",
4
4
  "description": "Code highlights short strings of code snippets inline with body text.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -15,13 +15,15 @@
15
15
  "typesVersions": {
16
16
  ">=4.0 <4.5": {
17
17
  "*": [
18
- "dist/types-ts4.0/*"
18
+ "dist/types-ts4.0/*",
19
+ "dist/types-ts4.0/index.d.ts"
19
20
  ]
20
21
  }
21
22
  },
22
23
  "sideEffects": false,
23
24
  "atlaskit:src": "src/index.tsx",
24
25
  "atlassian": {
26
+ "disableProductCI": true,
25
27
  "team": "Design System Team",
26
28
  "releaseModel": "scheduled",
27
29
  "website": {
@@ -36,9 +38,9 @@
36
38
  "@atlaskit/codemod-utils": "^4.1.0",
37
39
  "@atlaskit/theme": "^12.2.0",
38
40
  "@atlaskit/tokens": "^0.10.0",
39
- "@atlaskit/tooltip": "^17.5.0",
41
+ "@atlaskit/tooltip": "^17.6.0",
40
42
  "@babel/runtime": "^7.0.0",
41
- "@emotion/core": "^10.0.9",
43
+ "@emotion/react": "^11.7.1",
42
44
  "memoize-one": "^6.0.0",
43
45
  "react-syntax-highlighter": "^15.4.3"
44
46
  },
@@ -49,7 +51,7 @@
49
51
  "@atlaskit/button": "^16.3.0",
50
52
  "@atlaskit/docs": "^9.0.0",
51
53
  "@atlaskit/ds-lib": "^2.1.0",
52
- "@atlaskit/section-message": "^6.2.0",
54
+ "@atlaskit/section-message": "^6.3.0",
53
55
  "@atlaskit/ssr": "*",
54
56
  "@atlaskit/visual-regression": "*",
55
57
  "@atlaskit/webdriver-runner": "*",
@@ -83,6 +85,7 @@
83
85
  },
84
86
  "@repo/internal": {
85
87
  "design-system": "v1",
88
+ "design-tokens": "spacing",
86
89
  "dom-events": "use-bind-event-listener",
87
90
  "ui-components": [
88
91
  "lite-mode"
package/report.api.md CHANGED
@@ -1,145 +1,75 @@
1
- ## API Report File for "@atlaskit/code"
1
+ ## API Report File for "@atlaskit/code".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  /// <reference types="react" />
7
9
 
8
- import type { CSSObject } from '@emotion/core';
10
+ import type { CSSObject } from '@emotion/react';
9
11
  import type { HTMLProps } from 'react';
10
12
  import { NamedExoticComponent } from 'react';
11
13
  import { default as React_2 } from 'react';
12
14
  import type { ReactNode } from 'react';
13
15
  import type { Theme } from '@atlaskit/theme/types';
14
16
 
17
+ /**
18
+ * __Code__
19
+ *
20
+ * Code highlights short strings of code snippets inline with body text.
21
+ *
22
+ * - [Examples](https://atlassian.design/components/code/examples)
23
+ * - [Code](https://atlassian.design/components/code/code)
24
+ * - [Usage](https://atlassian.design/components/code/usage)
25
+ */
15
26
  export declare const Code: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
16
27
  Pick<
17
28
  CodeProps,
18
29
  | 'as'
19
- | 'css'
20
30
  | 'name'
31
+ | 'testId'
32
+ | 'codeBidiWarnings'
33
+ | 'codeBidiWarningLabel'
34
+ | 'codeBidiWarningTooltipEnabled'
35
+ | 'list'
36
+ | 'step'
21
37
  | 'color'
22
38
  | 'content'
23
39
  | 'height'
24
40
  | 'width'
25
41
  | 'start'
26
- | 'children'
27
- | 'testId'
42
+ | 'hidden'
43
+ | 'size'
44
+ | 'style'
28
45
  | 'default'
46
+ | 'wrap'
47
+ | 'open'
48
+ | 'multiple'
49
+ | 'disabled'
50
+ | 'children'
29
51
  | 'cite'
30
52
  | 'data'
31
53
  | 'form'
32
54
  | 'label'
33
55
  | 'span'
34
- | 'style'
35
56
  | 'summary'
36
57
  | 'title'
37
58
  | 'pattern'
38
- | 'accept'
39
- | 'acceptCharset'
40
- | 'action'
41
- | 'allowFullScreen'
42
- | 'allowTransparency'
43
- | 'alt'
44
- | 'async'
45
- | 'autoComplete'
46
- | 'autoFocus'
47
- | 'autoPlay'
48
- | 'capture'
49
- | 'cellPadding'
50
- | 'cellSpacing'
51
- | 'charSet'
52
- | 'challenge'
53
- | 'checked'
54
- | 'classID'
55
- | 'cols'
56
- | 'colSpan'
57
- | 'controls'
58
- | 'coords'
59
- | 'crossOrigin'
60
- | 'dateTime'
61
- | 'defer'
62
- | 'disabled'
63
- | 'download'
64
- | 'encType'
65
- | 'formAction'
66
- | 'formEncType'
67
- | 'formMethod'
68
- | 'formNoValidate'
69
- | 'formTarget'
70
- | 'frameBorder'
71
- | 'headers'
72
- | 'high'
73
- | 'href'
74
- | 'hrefLang'
75
- | 'htmlFor'
76
- | 'httpEquiv'
77
- | 'integrity'
78
- | 'keyParams'
79
- | 'keyType'
80
- | 'kind'
81
- | 'list'
82
- | 'loop'
83
- | 'low'
84
- | 'manifest'
85
- | 'marginHeight'
86
- | 'marginWidth'
87
- | 'max'
88
- | 'maxLength'
89
- | 'media'
90
- | 'mediaGroup'
91
- | 'method'
92
- | 'min'
93
- | 'minLength'
94
- | 'multiple'
95
- | 'muted'
96
- | 'nonce'
97
- | 'noValidate'
98
- | 'open'
99
- | 'optimum'
100
- | 'placeholder'
101
- | 'playsInline'
102
- | 'poster'
103
- | 'preload'
104
- | 'readOnly'
105
- | 'rel'
106
- | 'required'
107
- | 'reversed'
108
- | 'rows'
109
- | 'rowSpan'
110
- | 'sandbox'
111
- | 'scope'
112
- | 'scoped'
113
- | 'scrolling'
114
- | 'seamless'
115
- | 'selected'
116
- | 'shape'
117
- | 'size'
118
- | 'sizes'
119
- | 'src'
120
- | 'srcDoc'
121
- | 'srcLang'
122
- | 'srcSet'
123
- | 'step'
124
- | 'target'
125
- | 'type'
126
- | 'useMap'
127
- | 'value'
128
- | 'wmode'
129
- | 'wrap'
59
+ | 'className'
60
+ | 'key'
130
61
  | 'defaultChecked'
131
62
  | 'defaultValue'
132
63
  | 'suppressContentEditableWarning'
133
64
  | 'suppressHydrationWarning'
134
65
  | 'accessKey'
135
- | 'className'
136
66
  | 'contentEditable'
137
67
  | 'contextMenu'
138
68
  | 'dir'
139
69
  | 'draggable'
140
- | 'hidden'
141
70
  | 'id'
142
71
  | 'lang'
72
+ | 'placeholder'
143
73
  | 'slot'
144
74
  | 'spellCheck'
145
75
  | 'tabIndex'
@@ -375,14 +305,103 @@ export declare const Code: React_2.MemoExoticComponent<React_2.ForwardRefExoticC
375
305
  | 'onAnimationIterationCapture'
376
306
  | 'onTransitionEnd'
377
307
  | 'onTransitionEndCapture'
378
- | 'key'
379
- | 'codeBidiWarnings'
380
- | 'codeBidiWarningLabel'
381
- | 'codeBidiWarningTooltipEnabled'
308
+ | 'accept'
309
+ | 'acceptCharset'
310
+ | 'action'
311
+ | 'allowFullScreen'
312
+ | 'allowTransparency'
313
+ | 'alt'
314
+ | 'async'
315
+ | 'autoComplete'
316
+ | 'autoFocus'
317
+ | 'autoPlay'
318
+ | 'capture'
319
+ | 'cellPadding'
320
+ | 'cellSpacing'
321
+ | 'charSet'
322
+ | 'challenge'
323
+ | 'checked'
324
+ | 'classID'
325
+ | 'cols'
326
+ | 'colSpan'
327
+ | 'controls'
328
+ | 'coords'
329
+ | 'crossOrigin'
330
+ | 'dateTime'
331
+ | 'defer'
332
+ | 'download'
333
+ | 'encType'
334
+ | 'formAction'
335
+ | 'formEncType'
336
+ | 'formMethod'
337
+ | 'formNoValidate'
338
+ | 'formTarget'
339
+ | 'frameBorder'
340
+ | 'headers'
341
+ | 'high'
342
+ | 'href'
343
+ | 'hrefLang'
344
+ | 'htmlFor'
345
+ | 'httpEquiv'
346
+ | 'integrity'
347
+ | 'keyParams'
348
+ | 'keyType'
349
+ | 'kind'
350
+ | 'loop'
351
+ | 'low'
352
+ | 'manifest'
353
+ | 'marginHeight'
354
+ | 'marginWidth'
355
+ | 'max'
356
+ | 'maxLength'
357
+ | 'media'
358
+ | 'mediaGroup'
359
+ | 'method'
360
+ | 'min'
361
+ | 'minLength'
362
+ | 'muted'
363
+ | 'nonce'
364
+ | 'noValidate'
365
+ | 'optimum'
366
+ | 'playsInline'
367
+ | 'poster'
368
+ | 'preload'
369
+ | 'readOnly'
370
+ | 'rel'
371
+ | 'required'
372
+ | 'reversed'
373
+ | 'rows'
374
+ | 'rowSpan'
375
+ | 'sandbox'
376
+ | 'scope'
377
+ | 'scoped'
378
+ | 'scrolling'
379
+ | 'seamless'
380
+ | 'selected'
381
+ | 'shape'
382
+ | 'sizes'
383
+ | 'src'
384
+ | 'srcDoc'
385
+ | 'srcLang'
386
+ | 'srcSet'
387
+ | 'target'
388
+ | 'type'
389
+ | 'useMap'
390
+ | 'value'
391
+ | 'wmode'
382
392
  > &
383
393
  React_2.RefAttributes<HTMLElement>
384
394
  >>;
385
395
 
396
+ /**
397
+ * __Code block__
398
+ *
399
+ * A code block highlights an entire block of code and keeps the formatting.
400
+ *
401
+ * - [Examples](https://atlassian.design/components/code/code-block/examples)
402
+ * - [Code](https://atlassian.design/components/code/code-block/code)
403
+ * - [Usage](https://atlassian.design/components/code/code-block/usage)
404
+ */
386
405
  export declare const CodeBlock: NamedExoticComponent<CodeBlockProps>;
387
406
 
388
407
  export declare interface CodeBlockProps {
@@ -404,13 +423,12 @@ export declare interface CodeBlockProps {
404
423
  */
405
424
  language?: SupportedLanguages;
406
425
  /**
407
- * Lines to highlight comma delimited.
408
- * Example uses:
409
-
410
- * - To highlight one line `highlight="3"`
411
- * - To highlight a group of lines `highlight="1-5"`
412
- * - To highlight multiple groups `highlight="1-5,7,10,15-20"`
413
- */
426
+ * Lines to highlight comma delimited.
427
+ * Example uses:
428
+ * - To highlight one line `highlight="3"`
429
+ * - To highlight a group of lines `highlight="1-5"`
430
+ * - To highlight multiple groups `highlight="1-5,7,10,15-20"`
431
+ */
414
432
  highlight?: string;
415
433
  /**
416
434
  * Screen reader text for the start of a highlighted line