@atlaskit/inline-edit 12.1.6 → 12.1.9

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,25 @@
1
1
  # @atlaskit/inline-edit
2
2
 
3
+ ## 12.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.1.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f65c4ec35c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f65c4ec35c9) - Rewrite dynamic styles to be static to aid compiled migration.
14
+ - Updated dependencies
15
+
16
+ ## 12.1.7
17
+
18
+ ### Patch Changes
19
+
20
+ - [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Updates usage of deprecated token names so they're aligned with the latest naming conventions. No UI or visual changes
21
+ - Updated dependencies
22
+
3
23
  ## 12.1.6
4
24
 
5
25
  ### Patch Changes
@@ -11,8 +11,6 @@ exports.default = void 0;
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
15
 
18
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -35,8 +33,6 @@ var _useButtonFocusHook2 = _interopRequireDefault(require("./internal/hooks/use-
35
33
 
36
34
  var _readView = _interopRequireDefault(require("./internal/read-view"));
37
35
 
38
- var _templateObject, _templateObject2;
39
-
40
36
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
37
 
42
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -45,10 +41,17 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
45
41
 
46
42
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
47
43
 
44
+ var fieldStyles = (0, _core.css)({
45
+ maxWidth: '100%',
46
+ position: 'relative'
47
+ });
48
+ var buttonStyles = (0, _core.css)({
49
+ display: 'none'
50
+ });
48
51
  var analyticsAttributes = {
49
52
  componentName: 'inlineEdit',
50
53
  packageName: "@atlaskit/inline-edit",
51
- packageVersion: "12.1.6"
54
+ packageVersion: "12.1.9"
52
55
  };
53
56
 
54
57
  var noop = function noop() {};
@@ -220,7 +223,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
220
223
  var fieldProps = _ref2.fieldProps,
221
224
  error = _ref2.error;
222
225
  return (0, _core.jsx)("div", {
223
- css: (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n max-width: 100%;\n position: relative;\n "]))),
226
+ css: fieldStyles,
224
227
  onBlur: function onBlur() {
225
228
  onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
226
229
  },
@@ -239,7 +242,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
239
242
  }) :
240
243
  /** This is to allow Ctrl + Enter to submit without action buttons */
241
244
  (0, _core.jsx)("button", {
242
- css: (0, _core.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: none;\n "]))),
245
+ css: buttonStyles,
243
246
  type: "submit"
244
247
  }));
245
248
  }) :
@@ -23,9 +23,25 @@ var _colors = require("@atlaskit/theme/colors");
23
23
 
24
24
  var _inlineEdit = _interopRequireDefault(require("./inline-edit"));
25
25
 
26
- var _styles = require("./internal/styles");
26
+ var _constants = require("./internal/constants");
27
27
 
28
28
  var _excluded = ["errorMessage", "isInvalid"];
29
+ var errorIconContainerStyles = (0, _core.css)({
30
+ paddingRight: _constants.gridSize - 2,
31
+ lineHeight: '100%'
32
+ });
33
+ var readViewForTextFieldStyles = (0, _core.css)({
34
+ display: 'flex',
35
+ maxWidth: '100%',
36
+ minHeight: "".concat(_constants.gridSize * 2.5 / _constants.fontSize, "em"),
37
+ padding: "".concat(_constants.gridSize, "px ").concat(_constants.gridSize - 2, "px"),
38
+ fontSize: _constants.fontSize,
39
+ lineHeight: _constants.gridSize * 2.5 / _constants.fontSize,
40
+ wordBreak: 'break-word'
41
+ });
42
+ var compactStyles = (0, _core.css)({
43
+ padding: "".concat(_constants.gridSize / 2, "px ").concat(_constants.gridSize - 2, "px")
44
+ });
29
45
 
30
46
  var InlineEditableTextfield = function InlineEditableTextfield(props) {
31
47
  var _props$isCompact = props.isCompact,
@@ -47,10 +63,10 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
47
63
  placement: "right"
48
64
  }, (0, _core.jsx)(_textfield.default, (0, _extends2.default)({}, props, {
49
65
  elemAfterInput: isInvalid && (0, _core.jsx)("div", {
50
- css: _styles.errorIconContainerStyles
66
+ css: errorIconContainerStyles
51
67
  }, (0, _core.jsx)(_error.default, {
52
68
  label: "error",
53
- primaryColor: "var(--ds-iconBorder-danger, ".concat(_colors.R400, ")")
69
+ primaryColor: "var(--ds-icon-danger, ".concat(_colors.R400, ")")
54
70
  })),
55
71
  testId: testId,
56
72
  isCompact: isCompact,
@@ -59,7 +75,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
59
75
  },
60
76
  readView: function readView() {
61
77
  return (0, _core.jsx)("div", {
62
- css: _styles.readViewForTextFieldStyles,
78
+ css: [readViewForTextFieldStyles, isCompact && compactStyles],
63
79
  "data-compact": isCompact,
64
80
  "data-testid": testId && "read-view-".concat(testId)
65
81
  }, defaultValue || placeholder);
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
- var _react = require("react");
11
-
12
10
  var _core = require("@emotion/core");
13
11
 
14
12
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
@@ -17,22 +15,47 @@ var _check = _interopRequireDefault(require("@atlaskit/icon/glyph/check"));
17
15
 
18
16
  var _cross = _interopRequireDefault(require("@atlaskit/icon/glyph/cross"));
19
17
 
20
- var _styles = require("./styles");
18
+ var _colors = require("@atlaskit/theme/colors");
19
+
20
+ var _constants = require("./constants");
21
21
 
22
22
  /** @jsx jsx */
23
+ var buttonsContainerStyles = (0, _core.css)({
24
+ display: 'flex',
25
+ marginTop: _constants.gridSize - 2,
26
+ position: 'absolute',
27
+ top: '100%',
28
+ right: 0,
29
+ flexShrink: 0
30
+ });
31
+ var buttonWrapperElevationDarkStyles = (0, _core.css)({
32
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.DN50A, ", 0 0 1px ").concat(_colors.DN60A), ")")
33
+ });
34
+ var buttonWrapperElevationLightStyles = (0, _core.css)({
35
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")
36
+ });
37
+ var buttonWrapperBaseStyles = (0, _core.css)({
38
+ boxSizing: 'border-box',
39
+ width: _constants.gridSize * 4,
40
+ zIndex: 200,
41
+ backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
42
+ borderRadius: _constants.gridSize / 2 - 1,
43
+ fontSize: _constants.fontSize,
44
+ '&:last-child': {
45
+ marginLeft: _constants.gridSize / 2
46
+ }
47
+ });
48
+
23
49
  var Buttons = function Buttons(_ref) {
24
50
  var mode = _ref.mode,
25
51
  confirmButtonLabel = _ref.confirmButtonLabel,
26
52
  cancelButtonLabel = _ref.cancelButtonLabel,
27
53
  onMouseDown = _ref.onMouseDown,
28
54
  onCancelClick = _ref.onCancelClick;
29
- var buttonWrapperStyles = (0, _react.useMemo)(function () {
30
- return (0, _styles.getButtonWrapperStyles)(mode);
31
- }, [mode]);
32
55
  return (0, _core.jsx)("div", {
33
- css: _styles.buttonsContainerStyles
56
+ css: buttonsContainerStyles
34
57
  }, (0, _core.jsx)("div", {
35
- css: buttonWrapperStyles
58
+ css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
36
59
  }, (0, _core.jsx)(_standardButton.default, {
37
60
  "aria-label": confirmButtonLabel,
38
61
  type: "submit",
@@ -43,7 +66,7 @@ var Buttons = function Buttons(_ref) {
43
66
  shouldFitContainer: true,
44
67
  onMouseDown: onMouseDown
45
68
  })), (0, _core.jsx)("div", {
46
- css: buttonWrapperStyles
69
+ css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
47
70
  }, (0, _core.jsx)(_standardButton.default, {
48
71
  "aria-label": cancelButtonLabel,
49
72
  iconBefore: (0, _core.jsx)(_cross.default, {
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gridSize = exports.fontSize = exports.borderRadius = void 0;
7
+
8
+ var _constants = require("@atlaskit/theme/constants");
9
+
10
+ var gridSize = (0, _constants.gridSize)();
11
+ exports.gridSize = gridSize;
12
+ var fontSize = (0, _constants.fontSize)();
13
+ exports.fontSize = fontSize;
14
+ var borderRadius = (0, _constants.borderRadius)();
15
+ exports.borderRadius = borderRadius;
@@ -11,13 +11,46 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _core = require("@emotion/core");
13
13
 
14
- var _styles = require("./styles");
14
+ var _colors = require("@atlaskit/theme/colors");
15
+
16
+ var _constants = require("./constants");
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
19
 
18
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
21
 
20
22
  /** @jsx jsx */
23
+ var readViewContainerStyles = (0, _core.css)({
24
+ lineHeight: 1
25
+ });
26
+ var editButtonStyles = (0, _core.css)({
27
+ display: 'block',
28
+ margin: '0',
29
+ padding: '0',
30
+ appearance: 'none',
31
+ background: 'transparent',
32
+ border: 0,
33
+ lineHeight: 1,
34
+ outline: '0',
35
+ '&:focus + div': {
36
+ border: "2px solid ".concat("var(--ds-border-focused, ".concat(_colors.B100, ")"))
37
+ }
38
+ });
39
+ var readViewWrapperStyles = (0, _core.css)({
40
+ display: 'inline-block',
41
+ boxSizing: 'border-box',
42
+ width: 'auto',
43
+ maxWidth: '100%',
44
+ border: '2px solid transparent',
45
+ borderRadius: _constants.borderRadius,
46
+ transition: 'background 0.2s',
47
+ '&:hover': {
48
+ background: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")")
49
+ }
50
+ });
51
+ var readViewFitContainerWidthStyles = (0, _core.css)({
52
+ width: '100%'
53
+ });
21
54
  var DRAG_THRESHOLD = 5;
22
55
 
23
56
  var ReadView = function ReadView(_ref) {
@@ -48,15 +81,15 @@ var ReadView = function ReadView(_ref) {
48
81
 
49
82
 
50
83
  return (0, _core.jsx)("div", {
51
- css: _styles.readViewContainerStyles
84
+ css: readViewContainerStyles
52
85
  }, (0, _core.jsx)("button", {
53
- css: _styles.editButtonStyles,
86
+ css: editButtonStyles,
54
87
  "aria-label": editButtonLabel,
55
88
  type: "button",
56
89
  onClick: onEditRequested,
57
90
  ref: editButtonRef
58
91
  }), (0, _core.jsx)("div", {
59
- css: _styles.readViewWrapperStyles,
92
+ css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles],
60
93
  onClick: onReadViewClick,
61
94
  onMouseDown: function onMouseDown(e) {
62
95
  startX.current = e.clientX;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.1.6",
3
+ "version": "12.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -10,10 +10,17 @@ import GlobalTheme from '@atlaskit/theme/components';
10
10
  import Buttons from './internal/buttons';
11
11
  import useButtonFocusHook from './internal/hooks/use-button-focus-hook';
12
12
  import ReadView from './internal/read-view';
13
+ const fieldStyles = css({
14
+ maxWidth: '100%',
15
+ position: 'relative'
16
+ });
17
+ const buttonStyles = css({
18
+ display: 'none'
19
+ });
13
20
  const analyticsAttributes = {
14
21
  componentName: 'inlineEdit',
15
22
  packageName: "@atlaskit/inline-edit",
16
- packageVersion: "12.1.6"
23
+ packageVersion: "12.1.9"
17
24
  };
18
25
 
19
26
  const noop = () => {};
@@ -169,10 +176,7 @@ const InnerInlineEdit = props => {
169
176
  fieldProps,
170
177
  error
171
178
  }) => jsx("div", {
172
- css: css`
173
- max-width: 100%;
174
- position: relative;
175
- `,
179
+ css: fieldStyles,
176
180
  onBlur: () => {
177
181
  onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
178
182
  },
@@ -191,9 +195,7 @@ const InnerInlineEdit = props => {
191
195
  }) :
192
196
  /** This is to allow Ctrl + Enter to submit without action buttons */
193
197
  jsx("button", {
194
- css: css`
195
- display: none;
196
- `,
198
+ css: buttonStyles,
197
199
  type: "submit"
198
200
  }))) :
199
201
  /** Field is used here only for the label */
@@ -1,13 +1,29 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
- import { jsx } from '@emotion/core';
4
+ import { css, jsx } from '@emotion/core';
5
5
  import ErrorIcon from '@atlaskit/icon/glyph/error';
6
6
  import InlineDialog from '@atlaskit/inline-dialog';
7
7
  import Textfield from '@atlaskit/textfield';
8
8
  import { R400 } from '@atlaskit/theme/colors';
9
9
  import InlineEdit from './inline-edit';
10
- import { errorIconContainerStyles, readViewForTextFieldStyles } from './internal/styles';
10
+ import { fontSize, gridSize } from './internal/constants';
11
+ const errorIconContainerStyles = css({
12
+ paddingRight: gridSize - 2,
13
+ lineHeight: '100%'
14
+ });
15
+ const readViewForTextFieldStyles = css({
16
+ display: 'flex',
17
+ maxWidth: '100%',
18
+ minHeight: `${gridSize * 2.5 / fontSize}em`,
19
+ padding: `${gridSize}px ${gridSize - 2}px`,
20
+ fontSize: fontSize,
21
+ lineHeight: gridSize * 2.5 / fontSize,
22
+ wordBreak: 'break-word'
23
+ });
24
+ const compactStyles = css({
25
+ padding: `${gridSize / 2}px ${gridSize - 2}px`
26
+ });
11
27
 
12
28
  const InlineEditableTextfield = props => {
13
29
  const {
@@ -33,14 +49,14 @@ const InlineEditableTextfield = props => {
33
49
  css: errorIconContainerStyles
34
50
  }, jsx(ErrorIcon, {
35
51
  label: "error",
36
- primaryColor: `var(--ds-iconBorder-danger, ${R400})`
52
+ primaryColor: `var(--ds-icon-danger, ${R400})`
37
53
  })),
38
54
  testId: testId,
39
55
  isCompact: isCompact,
40
56
  autoFocus: true
41
57
  }))),
42
58
  readView: () => jsx("div", {
43
- css: readViewForTextFieldStyles,
59
+ css: [readViewForTextFieldStyles, isCompact && compactStyles],
44
60
  "data-compact": isCompact,
45
61
  "data-testid": testId && `read-view-${testId}`
46
62
  }, defaultValue || placeholder)
@@ -1,10 +1,35 @@
1
1
  /** @jsx jsx */
2
- import { useMemo } from 'react';
3
- import { jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/core';
4
3
  import Button from '@atlaskit/button/standard-button';
5
4
  import ConfirmIcon from '@atlaskit/icon/glyph/check';
6
5
  import CancelIcon from '@atlaskit/icon/glyph/cross';
7
- import { buttonsContainerStyles, getButtonWrapperStyles } from './styles';
6
+ import { DN50A, DN60A, N0, N50A, N60A } from '@atlaskit/theme/colors';
7
+ import { fontSize, gridSize } from './constants';
8
+ const buttonsContainerStyles = css({
9
+ display: 'flex',
10
+ marginTop: gridSize - 2,
11
+ position: 'absolute',
12
+ top: '100%',
13
+ right: 0,
14
+ flexShrink: 0
15
+ });
16
+ const buttonWrapperElevationDarkStyles = css({
17
+ boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${DN50A}, 0 0 1px ${DN60A}`})`
18
+ });
19
+ const buttonWrapperElevationLightStyles = css({
20
+ boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`
21
+ });
22
+ const buttonWrapperBaseStyles = css({
23
+ boxSizing: 'border-box',
24
+ width: gridSize * 4,
25
+ zIndex: 200,
26
+ backgroundColor: `var(--ds-surface-overlay, ${N0})`,
27
+ borderRadius: gridSize / 2 - 1,
28
+ fontSize: fontSize,
29
+ '&:last-child': {
30
+ marginLeft: gridSize / 2
31
+ }
32
+ });
8
33
 
9
34
  const Buttons = ({
10
35
  mode,
@@ -13,11 +38,10 @@ const Buttons = ({
13
38
  onMouseDown,
14
39
  onCancelClick
15
40
  }) => {
16
- const buttonWrapperStyles = useMemo(() => getButtonWrapperStyles(mode), [mode]);
17
41
  return jsx("div", {
18
42
  css: buttonsContainerStyles
19
43
  }, jsx("div", {
20
- css: buttonWrapperStyles
44
+ css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
21
45
  }, jsx(Button, {
22
46
  "aria-label": confirmButtonLabel,
23
47
  type: "submit",
@@ -28,7 +52,7 @@ const Buttons = ({
28
52
  shouldFitContainer: true,
29
53
  onMouseDown: onMouseDown
30
54
  })), jsx("div", {
31
- css: buttonWrapperStyles
55
+ css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
32
56
  }, jsx(Button, {
33
57
  "aria-label": cancelButtonLabel,
34
58
  iconBefore: jsx(CancelIcon, {
@@ -0,0 +1,4 @@
1
+ import { borderRadius as getBorderRadius, fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
2
+ export const gridSize = getGridSize();
3
+ export const fontSize = getFontSize();
4
+ export const borderRadius = getBorderRadius();
@@ -1,7 +1,39 @@
1
1
  /** @jsx jsx */
2
2
  import React, { useRef } from 'react';
3
- import { jsx } from '@emotion/core';
4
- import { editButtonStyles, readViewContainerStyles, readViewWrapperStyles } from './styles';
3
+ import { css, jsx } from '@emotion/core';
4
+ import { B100, N30 } from '@atlaskit/theme/colors';
5
+ import { borderRadius } from './constants';
6
+ const readViewContainerStyles = css({
7
+ lineHeight: 1
8
+ });
9
+ const editButtonStyles = css({
10
+ display: 'block',
11
+ margin: '0',
12
+ padding: '0',
13
+ appearance: 'none',
14
+ background: 'transparent',
15
+ border: 0,
16
+ lineHeight: 1,
17
+ outline: '0',
18
+ '&:focus + div': {
19
+ border: `2px solid ${`var(--ds-border-focused, ${B100})`}`
20
+ }
21
+ });
22
+ const readViewWrapperStyles = css({
23
+ display: 'inline-block',
24
+ boxSizing: 'border-box',
25
+ width: 'auto',
26
+ maxWidth: '100%',
27
+ border: '2px solid transparent',
28
+ borderRadius: borderRadius,
29
+ transition: 'background 0.2s',
30
+ '&:hover': {
31
+ background: `var(--ds-background-neutral-subtle-hovered, ${N30})`
32
+ }
33
+ });
34
+ const readViewFitContainerWidthStyles = css({
35
+ width: '100%'
36
+ });
5
37
  const DRAG_THRESHOLD = 5;
6
38
 
7
39
  const ReadView = ({
@@ -41,7 +73,7 @@ const ReadView = ({
41
73
  onClick: onEditRequested,
42
74
  ref: editButtonRef
43
75
  }), jsx("div", {
44
- css: readViewWrapperStyles,
76
+ css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles],
45
77
  onClick: onReadViewClick,
46
78
  onMouseDown: e => {
47
79
  startX.current = e.clientX;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.1.6",
3
+ "version": "12.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -1,10 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
4
 
6
- var _templateObject, _templateObject2;
7
-
8
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
6
 
10
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -19,10 +16,17 @@ import GlobalTheme from '@atlaskit/theme/components';
19
16
  import Buttons from './internal/buttons';
20
17
  import useButtonFocusHook from './internal/hooks/use-button-focus-hook';
21
18
  import ReadView from './internal/read-view';
19
+ var fieldStyles = css({
20
+ maxWidth: '100%',
21
+ position: 'relative'
22
+ });
23
+ var buttonStyles = css({
24
+ display: 'none'
25
+ });
22
26
  var analyticsAttributes = {
23
27
  componentName: 'inlineEdit',
24
28
  packageName: "@atlaskit/inline-edit",
25
- packageVersion: "12.1.6"
29
+ packageVersion: "12.1.9"
26
30
  };
27
31
 
28
32
  var noop = function noop() {};
@@ -194,7 +198,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
194
198
  var fieldProps = _ref2.fieldProps,
195
199
  error = _ref2.error;
196
200
  return jsx("div", {
197
- css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-width: 100%;\n position: relative;\n "]))),
201
+ css: fieldStyles,
198
202
  onBlur: function onBlur() {
199
203
  onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
200
204
  },
@@ -213,7 +217,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
213
217
  }) :
214
218
  /** This is to allow Ctrl + Enter to submit without action buttons */
215
219
  jsx("button", {
216
- css: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: none;\n "]))),
220
+ css: buttonStyles,
217
221
  type: "submit"
218
222
  }));
219
223
  }) :
@@ -3,13 +3,29 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["errorMessage", "isInvalid"];
4
4
 
5
5
  /** @jsx jsx */
6
- import { jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/core';
7
7
  import ErrorIcon from '@atlaskit/icon/glyph/error';
8
8
  import InlineDialog from '@atlaskit/inline-dialog';
9
9
  import Textfield from '@atlaskit/textfield';
10
10
  import { R400 } from '@atlaskit/theme/colors';
11
11
  import InlineEdit from './inline-edit';
12
- import { errorIconContainerStyles, readViewForTextFieldStyles } from './internal/styles';
12
+ import { fontSize, gridSize } from './internal/constants';
13
+ var errorIconContainerStyles = css({
14
+ paddingRight: gridSize - 2,
15
+ lineHeight: '100%'
16
+ });
17
+ var readViewForTextFieldStyles = css({
18
+ display: 'flex',
19
+ maxWidth: '100%',
20
+ minHeight: "".concat(gridSize * 2.5 / fontSize, "em"),
21
+ padding: "".concat(gridSize, "px ").concat(gridSize - 2, "px"),
22
+ fontSize: fontSize,
23
+ lineHeight: gridSize * 2.5 / fontSize,
24
+ wordBreak: 'break-word'
25
+ });
26
+ var compactStyles = css({
27
+ padding: "".concat(gridSize / 2, "px ").concat(gridSize - 2, "px")
28
+ });
13
29
 
14
30
  var InlineEditableTextfield = function InlineEditableTextfield(props) {
15
31
  var _props$isCompact = props.isCompact,
@@ -35,7 +51,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
35
51
  css: errorIconContainerStyles
36
52
  }, jsx(ErrorIcon, {
37
53
  label: "error",
38
- primaryColor: "var(--ds-iconBorder-danger, ".concat(R400, ")")
54
+ primaryColor: "var(--ds-icon-danger, ".concat(R400, ")")
39
55
  })),
40
56
  testId: testId,
41
57
  isCompact: isCompact,
@@ -44,7 +60,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
44
60
  },
45
61
  readView: function readView() {
46
62
  return jsx("div", {
47
- css: readViewForTextFieldStyles,
63
+ css: [readViewForTextFieldStyles, isCompact && compactStyles],
48
64
  "data-compact": isCompact,
49
65
  "data-testid": testId && "read-view-".concat(testId)
50
66
  }, defaultValue || placeholder);
@@ -1,10 +1,35 @@
1
1
  /** @jsx jsx */
2
- import { useMemo } from 'react';
3
- import { jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/core';
4
3
  import Button from '@atlaskit/button/standard-button';
5
4
  import ConfirmIcon from '@atlaskit/icon/glyph/check';
6
5
  import CancelIcon from '@atlaskit/icon/glyph/cross';
7
- import { buttonsContainerStyles, getButtonWrapperStyles } from './styles';
6
+ import { DN50A, DN60A, N0, N50A, N60A } from '@atlaskit/theme/colors';
7
+ import { fontSize, gridSize } from './constants';
8
+ var buttonsContainerStyles = css({
9
+ display: 'flex',
10
+ marginTop: gridSize - 2,
11
+ position: 'absolute',
12
+ top: '100%',
13
+ right: 0,
14
+ flexShrink: 0
15
+ });
16
+ var buttonWrapperElevationDarkStyles = css({
17
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(DN50A, ", 0 0 1px ").concat(DN60A), ")")
18
+ });
19
+ var buttonWrapperElevationLightStyles = css({
20
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")
21
+ });
22
+ var buttonWrapperBaseStyles = css({
23
+ boxSizing: 'border-box',
24
+ width: gridSize * 4,
25
+ zIndex: 200,
26
+ backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
27
+ borderRadius: gridSize / 2 - 1,
28
+ fontSize: fontSize,
29
+ '&:last-child': {
30
+ marginLeft: gridSize / 2
31
+ }
32
+ });
8
33
 
9
34
  var Buttons = function Buttons(_ref) {
10
35
  var mode = _ref.mode,
@@ -12,13 +37,10 @@ var Buttons = function Buttons(_ref) {
12
37
  cancelButtonLabel = _ref.cancelButtonLabel,
13
38
  onMouseDown = _ref.onMouseDown,
14
39
  onCancelClick = _ref.onCancelClick;
15
- var buttonWrapperStyles = useMemo(function () {
16
- return getButtonWrapperStyles(mode);
17
- }, [mode]);
18
40
  return jsx("div", {
19
41
  css: buttonsContainerStyles
20
42
  }, jsx("div", {
21
- css: buttonWrapperStyles
43
+ css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
22
44
  }, jsx(Button, {
23
45
  "aria-label": confirmButtonLabel,
24
46
  type: "submit",
@@ -29,7 +51,7 @@ var Buttons = function Buttons(_ref) {
29
51
  shouldFitContainer: true,
30
52
  onMouseDown: onMouseDown
31
53
  })), jsx("div", {
32
- css: buttonWrapperStyles
54
+ css: [buttonWrapperBaseStyles, mode === 'light' ? buttonWrapperElevationLightStyles : buttonWrapperElevationDarkStyles]
33
55
  }, jsx(Button, {
34
56
  "aria-label": cancelButtonLabel,
35
57
  iconBefore: jsx(CancelIcon, {
@@ -0,0 +1,4 @@
1
+ import { borderRadius as getBorderRadius, fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
2
+ export var gridSize = getGridSize();
3
+ export var fontSize = getFontSize();
4
+ export var borderRadius = getBorderRadius();
@@ -1,7 +1,39 @@
1
1
  /** @jsx jsx */
2
2
  import React, { useRef } from 'react';
3
- import { jsx } from '@emotion/core';
4
- import { editButtonStyles, readViewContainerStyles, readViewWrapperStyles } from './styles';
3
+ import { css, jsx } from '@emotion/core';
4
+ import { B100, N30 } from '@atlaskit/theme/colors';
5
+ import { borderRadius } from './constants';
6
+ var readViewContainerStyles = css({
7
+ lineHeight: 1
8
+ });
9
+ var editButtonStyles = css({
10
+ display: 'block',
11
+ margin: '0',
12
+ padding: '0',
13
+ appearance: 'none',
14
+ background: 'transparent',
15
+ border: 0,
16
+ lineHeight: 1,
17
+ outline: '0',
18
+ '&:focus + div': {
19
+ border: "2px solid ".concat("var(--ds-border-focused, ".concat(B100, ")"))
20
+ }
21
+ });
22
+ var readViewWrapperStyles = css({
23
+ display: 'inline-block',
24
+ boxSizing: 'border-box',
25
+ width: 'auto',
26
+ maxWidth: '100%',
27
+ border: '2px solid transparent',
28
+ borderRadius: borderRadius,
29
+ transition: 'background 0.2s',
30
+ '&:hover': {
31
+ background: "var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")")
32
+ }
33
+ });
34
+ var readViewFitContainerWidthStyles = css({
35
+ width: '100%'
36
+ });
5
37
  var DRAG_THRESHOLD = 5;
6
38
 
7
39
  var ReadView = function ReadView(_ref) {
@@ -40,7 +72,7 @@ var ReadView = function ReadView(_ref) {
40
72
  onClick: onEditRequested,
41
73
  ref: editButtonRef
42
74
  }), jsx("div", {
43
- css: readViewWrapperStyles,
75
+ css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles],
44
76
  onClick: onReadViewClick,
45
77
  onMouseDown: function onMouseDown(e) {
46
78
  startX.current = e.clientX;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.1.6",
3
+ "version": "12.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,4 @@
1
+ /** @jsx jsx */
1
2
  /// <reference types="react" />
2
3
  import { ThemeModes } from '@atlaskit/theme/types';
3
4
  interface ButtonsProp {
@@ -0,0 +1,3 @@
1
+ export declare const gridSize: number;
2
+ export declare const fontSize: number;
3
+ export declare const borderRadius: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.1.6",
3
+ "version": "12.1.9",
4
4
  "description": "An inline edit displays a custom input component that switches between reading and editing on the same page.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,14 +24,14 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@atlaskit/analytics-next": "^8.2.0",
27
- "@atlaskit/button": "^16.1.0",
27
+ "@atlaskit/button": "^16.2.0",
28
28
  "@atlaskit/codemod-utils": "^3.4.0",
29
- "@atlaskit/form": "^8.4.0",
29
+ "@atlaskit/form": "^8.5.0",
30
30
  "@atlaskit/icon": "^21.10.0",
31
- "@atlaskit/inline-dialog": "^13.2.0",
31
+ "@atlaskit/inline-dialog": "^13.3.0",
32
32
  "@atlaskit/textfield": "^5.1.0",
33
33
  "@atlaskit/theme": "^12.1.0",
34
- "@atlaskit/tokens": "^0.5.0",
34
+ "@atlaskit/tokens": "^0.7.0",
35
35
  "@babel/runtime": "^7.0.0",
36
36
  "@emotion/core": "^10.0.9"
37
37
  },
@@ -39,13 +39,14 @@
39
39
  "react": "^16.8.0"
40
40
  },
41
41
  "devDependencies": {
42
+ "@atlaskit/datetime-picker": "^11.1.1",
42
43
  "@atlaskit/docs": "*",
43
44
  "@atlaskit/section-message": "^6.1.0",
44
45
  "@atlaskit/select": "^15.0.0",
45
46
  "@atlaskit/ssr": "*",
46
47
  "@atlaskit/tag": "^11.2.0",
47
48
  "@atlaskit/tag-group": "^10.0.0",
48
- "@atlaskit/textarea": "^4.2.0",
49
+ "@atlaskit/textarea": "^4.3.0",
49
50
  "@atlaskit/visual-regression": "*",
50
51
  "@atlaskit/webdriver-runner": "*",
51
52
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -74,7 +75,8 @@
74
75
  "theming": "tokens",
75
76
  "deprecation": "no-deprecated-imports",
76
77
  "styling": [
77
- "emotion"
78
+ "emotion",
79
+ "static"
78
80
  ]
79
81
  }
80
82
  },
@@ -1,95 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.readViewWrapperStyles = exports.readViewForTextFieldStyles = exports.readViewContainerStyles = exports.getButtonWrapperStyles = exports.errorIconContainerStyles = exports.editButtonStyles = exports.buttonsContainerStyles = void 0;
7
-
8
- var _colors = require("@atlaskit/theme/colors");
9
-
10
- var _constants = require("@atlaskit/theme/constants");
11
-
12
- var spacingUnit = (0, _constants.gridSize)();
13
- var fontSizeUnit = (0, _constants.fontSize)();
14
- var elevations = {
15
- light: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"),
16
- dark: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(_colors.DN50A, ", 0 0 1px ").concat(_colors.DN60A), ")")
17
- };
18
- var buttonsContainerStyles = {
19
- display: 'flex',
20
- flexShrink: 0,
21
- marginTop: spacingUnit - 2,
22
- position: 'absolute',
23
- right: 0,
24
- top: '100%'
25
- };
26
- exports.buttonsContainerStyles = buttonsContainerStyles;
27
-
28
- var getButtonWrapperStyles = function getButtonWrapperStyles(mode) {
29
- return {
30
- boxShadow: elevations[mode],
31
- backgroundColor: "var(--ds-background-overlay, ".concat(_colors.N0, ")"),
32
- width: spacingUnit * 4,
33
- zIndex: 200,
34
- borderRadius: spacingUnit / 2 - 1,
35
- boxSizing: 'border-box',
36
- fontSize: fontSizeUnit,
37
- '&:last-child': {
38
- marginLeft: spacingUnit / 2
39
- }
40
- };
41
- };
42
-
43
- exports.getButtonWrapperStyles = getButtonWrapperStyles;
44
- var editButtonStyles = {
45
- appearance: 'none',
46
- background: 'transparent',
47
- border: 0,
48
- display: 'block',
49
- lineHeight: 1,
50
- margin: '0',
51
- padding: '0',
52
- outline: '0',
53
- '&:focus + div': {
54
- border: "2px solid ".concat("var(--ds-border-focus, ".concat(_colors.B100, ")"))
55
- }
56
- };
57
- exports.editButtonStyles = editButtonStyles;
58
- var errorIconContainerStyles = {
59
- lineHeight: '100%',
60
- paddingRight: spacingUnit - 2
61
- };
62
- exports.errorIconContainerStyles = errorIconContainerStyles;
63
- var readViewForTextFieldStyles = {
64
- display: 'flex',
65
- fontSize: (0, _constants.fontSize)(),
66
- lineHeight: spacingUnit * 2.5 / fontSizeUnit,
67
- maxWidth: '100%',
68
- minHeight: "".concat(spacingUnit * 2.5 / fontSizeUnit, "em"),
69
- padding: "".concat(spacingUnit, "px ").concat(spacingUnit - 2, "px"),
70
- '&[data-compact="true"]': {
71
- padding: "".concat(spacingUnit / 2, "px ").concat(spacingUnit - 2, "px")
72
- },
73
- wordBreak: 'break-word'
74
- };
75
- exports.readViewForTextFieldStyles = readViewForTextFieldStyles;
76
- var readViewContainerStyles = {
77
- lineHeight: 1
78
- };
79
- exports.readViewContainerStyles = readViewContainerStyles;
80
- var readViewWrapperStyles = {
81
- boxSizing: 'border-box',
82
- border: '2px solid transparent',
83
- borderRadius: (0, _constants.borderRadius)(),
84
- display: 'inline-block',
85
- maxWidth: '100%',
86
- transition: 'background 0.2s',
87
- width: 'auto',
88
- '&[data-read-view-fit-container-width="true"]': {
89
- width: '100%'
90
- },
91
- '&:hover': {
92
- background: "var(--ds-background-transparentNeutral-hover, ".concat(_colors.N30, ")")
93
- }
94
- };
95
- exports.readViewWrapperStyles = readViewWrapperStyles;
@@ -1,75 +0,0 @@
1
- import { B100, DN50A, DN60A, N0, N30, N50A, N60A } from '@atlaskit/theme/colors';
2
- import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
3
- const spacingUnit = gridSize();
4
- const fontSizeUnit = fontSize();
5
- const elevations = {
6
- light: `var(--ds-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`,
7
- dark: `var(--ds-overlay, ${`0 4px 8px -2px ${DN50A}, 0 0 1px ${DN60A}`})`
8
- };
9
- export const buttonsContainerStyles = {
10
- display: 'flex',
11
- flexShrink: 0,
12
- marginTop: spacingUnit - 2,
13
- position: 'absolute',
14
- right: 0,
15
- top: '100%'
16
- };
17
- export const getButtonWrapperStyles = mode => ({
18
- boxShadow: elevations[mode],
19
- backgroundColor: `var(--ds-background-overlay, ${N0})`,
20
- width: spacingUnit * 4,
21
- zIndex: 200,
22
- borderRadius: spacingUnit / 2 - 1,
23
- boxSizing: 'border-box',
24
- fontSize: fontSizeUnit,
25
- '&:last-child': {
26
- marginLeft: spacingUnit / 2
27
- }
28
- });
29
- export const editButtonStyles = {
30
- appearance: 'none',
31
- background: 'transparent',
32
- border: 0,
33
- display: 'block',
34
- lineHeight: 1,
35
- margin: '0',
36
- padding: '0',
37
- outline: '0',
38
- '&:focus + div': {
39
- border: `2px solid ${`var(--ds-border-focus, ${B100})`}`
40
- }
41
- };
42
- export const errorIconContainerStyles = {
43
- lineHeight: '100%',
44
- paddingRight: spacingUnit - 2
45
- };
46
- export const readViewForTextFieldStyles = {
47
- display: 'flex',
48
- fontSize: fontSize(),
49
- lineHeight: spacingUnit * 2.5 / fontSizeUnit,
50
- maxWidth: '100%',
51
- minHeight: `${spacingUnit * 2.5 / fontSizeUnit}em`,
52
- padding: `${spacingUnit}px ${spacingUnit - 2}px`,
53
- '&[data-compact="true"]': {
54
- padding: `${spacingUnit / 2}px ${spacingUnit - 2}px`
55
- },
56
- wordBreak: 'break-word'
57
- };
58
- export const readViewContainerStyles = {
59
- lineHeight: 1
60
- };
61
- export const readViewWrapperStyles = {
62
- boxSizing: 'border-box',
63
- border: '2px solid transparent',
64
- borderRadius: borderRadius(),
65
- display: 'inline-block',
66
- maxWidth: '100%',
67
- transition: 'background 0.2s',
68
- width: 'auto',
69
- '&[data-read-view-fit-container-width="true"]': {
70
- width: '100%'
71
- },
72
- '&:hover': {
73
- background: `var(--ds-background-transparentNeutral-hover, ${N30})`
74
- }
75
- };
@@ -1,77 +0,0 @@
1
- import { B100, DN50A, DN60A, N0, N30, N50A, N60A } from '@atlaskit/theme/colors';
2
- import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
3
- var spacingUnit = gridSize();
4
- var fontSizeUnit = fontSize();
5
- var elevations = {
6
- light: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"),
7
- dark: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(DN50A, ", 0 0 1px ").concat(DN60A), ")")
8
- };
9
- export var buttonsContainerStyles = {
10
- display: 'flex',
11
- flexShrink: 0,
12
- marginTop: spacingUnit - 2,
13
- position: 'absolute',
14
- right: 0,
15
- top: '100%'
16
- };
17
- export var getButtonWrapperStyles = function getButtonWrapperStyles(mode) {
18
- return {
19
- boxShadow: elevations[mode],
20
- backgroundColor: "var(--ds-background-overlay, ".concat(N0, ")"),
21
- width: spacingUnit * 4,
22
- zIndex: 200,
23
- borderRadius: spacingUnit / 2 - 1,
24
- boxSizing: 'border-box',
25
- fontSize: fontSizeUnit,
26
- '&:last-child': {
27
- marginLeft: spacingUnit / 2
28
- }
29
- };
30
- };
31
- export var editButtonStyles = {
32
- appearance: 'none',
33
- background: 'transparent',
34
- border: 0,
35
- display: 'block',
36
- lineHeight: 1,
37
- margin: '0',
38
- padding: '0',
39
- outline: '0',
40
- '&:focus + div': {
41
- border: "2px solid ".concat("var(--ds-border-focus, ".concat(B100, ")"))
42
- }
43
- };
44
- export var errorIconContainerStyles = {
45
- lineHeight: '100%',
46
- paddingRight: spacingUnit - 2
47
- };
48
- export var readViewForTextFieldStyles = {
49
- display: 'flex',
50
- fontSize: fontSize(),
51
- lineHeight: spacingUnit * 2.5 / fontSizeUnit,
52
- maxWidth: '100%',
53
- minHeight: "".concat(spacingUnit * 2.5 / fontSizeUnit, "em"),
54
- padding: "".concat(spacingUnit, "px ").concat(spacingUnit - 2, "px"),
55
- '&[data-compact="true"]': {
56
- padding: "".concat(spacingUnit / 2, "px ").concat(spacingUnit - 2, "px")
57
- },
58
- wordBreak: 'break-word'
59
- };
60
- export var readViewContainerStyles = {
61
- lineHeight: 1
62
- };
63
- export var readViewWrapperStyles = {
64
- boxSizing: 'border-box',
65
- border: '2px solid transparent',
66
- borderRadius: borderRadius(),
67
- display: 'inline-block',
68
- maxWidth: '100%',
69
- transition: 'background 0.2s',
70
- width: 'auto',
71
- '&[data-read-view-fit-container-width="true"]': {
72
- width: '100%'
73
- },
74
- '&:hover': {
75
- background: "var(--ds-background-transparentNeutral-hover, ".concat(N30, ")")
76
- }
77
- };
@@ -1,21 +0,0 @@
1
- import { CSSObject } from '@emotion/core';
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
- export declare const buttonsContainerStyles: CSSObject;
4
- export declare const getButtonWrapperStyles: (mode: ThemeModes) => CSSObject;
5
- export declare const editButtonStyles: {
6
- appearance: "none";
7
- background: string;
8
- border: number;
9
- display: string;
10
- lineHeight: number;
11
- margin: string;
12
- padding: string;
13
- outline: string;
14
- '&:focus + div': {
15
- border: string;
16
- };
17
- };
18
- export declare const errorIconContainerStyles: CSSObject;
19
- export declare const readViewForTextFieldStyles: CSSObject;
20
- export declare const readViewContainerStyles: CSSObject;
21
- export declare const readViewWrapperStyles: CSSObject;