@atlaskit/editor-shared-styles 2.2.5 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cjs/overflow-shadow/overflow-shadow.js +9 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/overflow-shadow/overflow-shadow.js +36 -17
- package/dist/es2019/version.json +1 -1
- package/dist/esm/overflow-shadow/overflow-shadow.js +8 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/overflow-shadow/overflow-shadow.d.ts +4 -2
- package/package.json +1 -1
- package/report.api.md +6 -2
- package/src/overflow-shadow/overflow-shadow.ts +51 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-shared-styles
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`4fbaeb2a1fd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4fbaeb2a1fd) - DSP-4118 Updated tokens used to render overflow shadows in code blocks.
|
|
8
|
+
|
|
9
|
+
New tokens will be visible only in applications configured to use the new Tokens API (currently in beta).
|
|
10
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
11
|
+
|
|
12
|
+
`overflowShadow` now optionally supports customizing the size of the "covers" that appear over shadows when at the edge of content, via `leftCoverWidth` and `rightCoverWidth`, and the shadow width via the `width` prop.
|
|
13
|
+
|
|
3
14
|
## 2.2.5
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -11,14 +11,21 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
15
|
+
|
|
14
16
|
var _tokens = require("@atlaskit/tokens");
|
|
15
17
|
|
|
16
18
|
var _templateObject;
|
|
17
19
|
|
|
18
20
|
var overflowShadow = function overflowShadow(_ref) {
|
|
19
21
|
var background = _ref.background,
|
|
20
|
-
width = _ref.width
|
|
21
|
-
|
|
22
|
+
_ref$width = _ref.width,
|
|
23
|
+
width = _ref$width === void 0 ? "".concat((0, _constants.gridSize)(), "px") : _ref$width,
|
|
24
|
+
leftCoverWidth = _ref.leftCoverWidth,
|
|
25
|
+
rightCoverWidth = _ref.rightCoverWidth;
|
|
26
|
+
var leftCoverWidthResolved = leftCoverWidth || width;
|
|
27
|
+
var rightCoverWidthResolved = rightCoverWidth || width;
|
|
28
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n/* shadow cover left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* overflow shadow right spread */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow right perimeter */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left spread */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left perimeter */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n )\n"])), background, leftCoverWidthResolved, leftCoverWidthResolved, (0, _tokens.token)('elevation.surface.raised', 'transparent'), leftCoverWidthResolved, leftCoverWidthResolved, background, rightCoverWidthResolved, rightCoverWidthResolved, (0, _tokens.token)('elevation.surface.raised', 'transparent'), rightCoverWidthResolved, rightCoverWidthResolved, (0, _tokens.token)('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)'), (0, _tokens.token)('utility.UNSAFE_util.transparent', 'rgba(99, 114, 130, 0)'), width, (0, _tokens.token)('elevation.shadow.overflow.perimeter', 'transparent'), (0, _tokens.token)('utility.UNSAFE_util.transparent', 'transparent'), width, (0, _tokens.token)('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)'), (0, _tokens.token)('utility.UNSAFE_util.transparent', 'rgba(99, 114, 130, 0)'), width, (0, _tokens.token)('elevation.shadow.overflow.perimeter', 'transparent'), (0, _tokens.token)('utility.UNSAFE_util.transparent', 'transparent'), width);
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
exports.overflowShadow = overflowShadow;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,44 +1,63 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
4
|
import { token } from '@atlaskit/tokens';
|
|
4
5
|
export const overflowShadow = ({
|
|
5
6
|
background,
|
|
6
|
-
width
|
|
7
|
-
|
|
7
|
+
width = `${gridSize()}px`,
|
|
8
|
+
leftCoverWidth,
|
|
9
|
+
rightCoverWidth
|
|
10
|
+
}) => {
|
|
11
|
+
const leftCoverWidthResolved = leftCoverWidth || width;
|
|
12
|
+
const rightCoverWidthResolved = rightCoverWidth || width;
|
|
13
|
+
return css`
|
|
8
14
|
/* shadow cover left */
|
|
9
15
|
linear-gradient(
|
|
10
16
|
to right,
|
|
11
|
-
${background} ${
|
|
12
|
-
transparent ${
|
|
17
|
+
${background} ${leftCoverWidthResolved},
|
|
18
|
+
transparent ${leftCoverWidthResolved}
|
|
13
19
|
),
|
|
14
20
|
/* shadow cover background left */
|
|
15
21
|
linear-gradient(
|
|
16
22
|
to right,
|
|
17
|
-
${token('elevation.surface.raised', 'transparent')} ${
|
|
18
|
-
transparent ${
|
|
23
|
+
${token('elevation.surface.raised', 'transparent')} ${leftCoverWidthResolved},
|
|
24
|
+
transparent ${leftCoverWidthResolved}
|
|
19
25
|
),
|
|
20
26
|
/* shadow cover right */
|
|
21
27
|
linear-gradient(
|
|
22
28
|
to left,
|
|
23
|
-
${background} ${
|
|
24
|
-
transparent ${
|
|
29
|
+
${background} ${rightCoverWidthResolved},
|
|
30
|
+
transparent ${rightCoverWidthResolved}
|
|
25
31
|
),
|
|
26
32
|
/* shadow cover background right */
|
|
27
33
|
linear-gradient(
|
|
28
34
|
to left,
|
|
29
|
-
${token('elevation.surface.raised', 'transparent')} ${
|
|
30
|
-
transparent ${
|
|
35
|
+
${token('elevation.surface.raised', 'transparent')} ${rightCoverWidthResolved},
|
|
36
|
+
transparent ${rightCoverWidthResolved}
|
|
31
37
|
),
|
|
32
|
-
/* overflow shadow right */
|
|
38
|
+
/* overflow shadow right spread */
|
|
33
39
|
linear-gradient(
|
|
34
40
|
to left,
|
|
35
|
-
rgba(9, 30, 66, 0.13) 0,
|
|
36
|
-
rgba(99, 114, 130, 0)
|
|
41
|
+
${token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)')} 0,
|
|
42
|
+
${token('utility.UNSAFE_util.transparent', 'rgba(99, 114, 130, 0)')} ${width}
|
|
37
43
|
),
|
|
38
|
-
/* overflow shadow
|
|
44
|
+
/* overflow shadow right perimeter */
|
|
45
|
+
linear-gradient(
|
|
46
|
+
to left,
|
|
47
|
+
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0,
|
|
48
|
+
${token('utility.UNSAFE_util.transparent', 'transparent')} ${width}
|
|
49
|
+
),
|
|
50
|
+
/* overflow shadow left spread */
|
|
51
|
+
linear-gradient(
|
|
52
|
+
to right,
|
|
53
|
+
${token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)')} 0,
|
|
54
|
+
${token('utility.UNSAFE_util.transparent', 'rgba(99, 114, 130, 0)')} ${width}
|
|
55
|
+
),
|
|
56
|
+
/* overflow shadow left perimeter */
|
|
39
57
|
linear-gradient(
|
|
40
58
|
to right,
|
|
41
|
-
|
|
42
|
-
|
|
59
|
+
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0,
|
|
60
|
+
${token('utility.UNSAFE_util.transparent', 'transparent')} ${width}
|
|
43
61
|
)
|
|
44
|
-
`;
|
|
62
|
+
`;
|
|
63
|
+
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -4,9 +4,15 @@ var _templateObject;
|
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
6
6
|
import { css } from '@emotion/react';
|
|
7
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
8
|
import { token } from '@atlaskit/tokens';
|
|
8
9
|
export var overflowShadow = function overflowShadow(_ref) {
|
|
9
10
|
var background = _ref.background,
|
|
10
|
-
width = _ref.width
|
|
11
|
-
|
|
11
|
+
_ref$width = _ref.width,
|
|
12
|
+
width = _ref$width === void 0 ? "".concat(gridSize(), "px") : _ref$width,
|
|
13
|
+
leftCoverWidth = _ref.leftCoverWidth,
|
|
14
|
+
rightCoverWidth = _ref.rightCoverWidth;
|
|
15
|
+
var leftCoverWidthResolved = leftCoverWidth || width;
|
|
16
|
+
var rightCoverWidthResolved = rightCoverWidth || width;
|
|
17
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* shadow cover left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* overflow shadow right spread */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow right perimeter */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left spread */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left perimeter */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n )\n"])), background, leftCoverWidthResolved, leftCoverWidthResolved, token('elevation.surface.raised', 'transparent'), leftCoverWidthResolved, leftCoverWidthResolved, background, rightCoverWidthResolved, rightCoverWidthResolved, token('elevation.surface.raised', 'transparent'), rightCoverWidthResolved, rightCoverWidthResolved, token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)'), token('utility.UNSAFE_util.transparent', 'rgba(99, 114, 130, 0)'), width, token('elevation.shadow.overflow.perimeter', 'transparent'), token('utility.UNSAFE_util.transparent', 'transparent'), width, token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)'), token('utility.UNSAFE_util.transparent', 'rgba(99, 114, 130, 0)'), width, token('elevation.shadow.overflow.perimeter', 'transparent'), token('utility.UNSAFE_util.transparent', 'transparent'), width);
|
|
12
18
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const overflowShadow: ({ background, width, }: {
|
|
1
|
+
export declare const overflowShadow: ({ background, width, leftCoverWidth, rightCoverWidth, }: {
|
|
2
2
|
background: string;
|
|
3
|
-
width
|
|
3
|
+
width?: string | undefined;
|
|
4
|
+
leftCoverWidth?: string | undefined;
|
|
5
|
+
rightCoverWidth?: string | undefined;
|
|
4
6
|
}) => import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- API Report Version: 2.
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/editor-shared-styles"
|
|
4
4
|
|
|
@@ -286,9 +286,13 @@ export const hideNativeBrowserTextSelectionStyles =
|
|
|
286
286
|
export const overflowShadow: ({
|
|
287
287
|
background,
|
|
288
288
|
width,
|
|
289
|
+
leftCoverWidth,
|
|
290
|
+
rightCoverWidth,
|
|
289
291
|
}: {
|
|
290
292
|
background: string;
|
|
291
|
-
width
|
|
293
|
+
width?: string | undefined;
|
|
294
|
+
leftCoverWidth?: string | undefined;
|
|
295
|
+
rightCoverWidth?: string | undefined;
|
|
292
296
|
}) => SerializedStyles;
|
|
293
297
|
|
|
294
298
|
// @public (undocumented)
|
|
@@ -1,49 +1,83 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
|
|
4
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
4
5
|
import { token } from '@atlaskit/tokens';
|
|
5
6
|
|
|
6
7
|
export const overflowShadow = ({
|
|
7
8
|
background,
|
|
8
|
-
width
|
|
9
|
+
width = `${gridSize()}px`,
|
|
10
|
+
leftCoverWidth,
|
|
11
|
+
rightCoverWidth,
|
|
9
12
|
}: {
|
|
10
13
|
background: string;
|
|
11
|
-
width
|
|
12
|
-
|
|
14
|
+
width?: string;
|
|
15
|
+
leftCoverWidth?: string;
|
|
16
|
+
rightCoverWidth?: string;
|
|
17
|
+
}) => {
|
|
18
|
+
const leftCoverWidthResolved = leftCoverWidth || width;
|
|
19
|
+
const rightCoverWidthResolved = rightCoverWidth || width;
|
|
20
|
+
|
|
21
|
+
return css`
|
|
13
22
|
/* shadow cover left */
|
|
14
23
|
linear-gradient(
|
|
15
24
|
to right,
|
|
16
|
-
${background} ${
|
|
17
|
-
transparent ${
|
|
25
|
+
${background} ${leftCoverWidthResolved},
|
|
26
|
+
transparent ${leftCoverWidthResolved}
|
|
18
27
|
),
|
|
19
28
|
/* shadow cover background left */
|
|
20
29
|
linear-gradient(
|
|
21
30
|
to right,
|
|
22
|
-
${token(
|
|
23
|
-
|
|
31
|
+
${token(
|
|
32
|
+
'elevation.surface.raised',
|
|
33
|
+
'transparent',
|
|
34
|
+
)} ${leftCoverWidthResolved},
|
|
35
|
+
transparent ${leftCoverWidthResolved}
|
|
24
36
|
),
|
|
25
37
|
/* shadow cover right */
|
|
26
38
|
linear-gradient(
|
|
27
39
|
to left,
|
|
28
|
-
${background} ${
|
|
29
|
-
transparent ${
|
|
40
|
+
${background} ${rightCoverWidthResolved},
|
|
41
|
+
transparent ${rightCoverWidthResolved}
|
|
30
42
|
),
|
|
31
43
|
/* shadow cover background right */
|
|
32
44
|
linear-gradient(
|
|
33
45
|
to left,
|
|
34
|
-
${token(
|
|
35
|
-
|
|
46
|
+
${token(
|
|
47
|
+
'elevation.surface.raised',
|
|
48
|
+
'transparent',
|
|
49
|
+
)} ${rightCoverWidthResolved},
|
|
50
|
+
transparent ${rightCoverWidthResolved}
|
|
51
|
+
),
|
|
52
|
+
/* overflow shadow right spread */
|
|
53
|
+
linear-gradient(
|
|
54
|
+
to left,
|
|
55
|
+
${token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)')} 0,
|
|
56
|
+
${token(
|
|
57
|
+
'utility.UNSAFE_util.transparent',
|
|
58
|
+
'rgba(99, 114, 130, 0)',
|
|
59
|
+
)} ${width}
|
|
36
60
|
),
|
|
37
|
-
/* overflow shadow right */
|
|
61
|
+
/* overflow shadow right perimeter */
|
|
38
62
|
linear-gradient(
|
|
39
63
|
to left,
|
|
40
|
-
|
|
41
|
-
|
|
64
|
+
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0,
|
|
65
|
+
${token('utility.UNSAFE_util.transparent', 'transparent')} ${width}
|
|
66
|
+
),
|
|
67
|
+
/* overflow shadow left spread */
|
|
68
|
+
linear-gradient(
|
|
69
|
+
to right,
|
|
70
|
+
${token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)')} 0,
|
|
71
|
+
${token(
|
|
72
|
+
'utility.UNSAFE_util.transparent',
|
|
73
|
+
'rgba(99, 114, 130, 0)',
|
|
74
|
+
)} ${width}
|
|
42
75
|
),
|
|
43
|
-
/* overflow shadow left */
|
|
76
|
+
/* overflow shadow left perimeter */
|
|
44
77
|
linear-gradient(
|
|
45
78
|
to right,
|
|
46
|
-
|
|
47
|
-
|
|
79
|
+
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0,
|
|
80
|
+
${token('utility.UNSAFE_util.transparent', 'transparent')} ${width}
|
|
48
81
|
)
|
|
49
82
|
`;
|
|
83
|
+
};
|