@atlaskit/primitives 0.8.8 → 0.8.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 +6 -0
- package/constellation/box/examples.mdx +33 -2
- package/dist/cjs/internal/xcss.js +3 -6
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/internal/xcss.js +3 -6
- package/dist/es2019/version.json +1 -1
- package/dist/esm/internal/xcss.js +3 -6
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/style-maps.partial.d.ts +1 -1
- package/package.json +13 -1
- package/report.api.md +1 -1
- package/tmp/api-report-tmp.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 0.8.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`da1727baf77`](https://bitbucket.org/atlassian/atlassian-frontend/commits/da1727baf77) - Allow non tokenised values to be passed through for tokenisable properties like `padding`. Adds type hinting for zIndex CSS property.
|
|
8
|
+
|
|
3
9
|
## 0.8.8
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Box
|
|
3
|
-
description: Box primitive
|
|
3
|
+
description: Box is a primitive component that leverages the foundations of the Atlassian Design System.
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import BoxBasic from '../../examples/constellation/box/basic';
|
|
8
|
+
import BoxPadding from '../../examples/constellation/box/padding';
|
|
9
|
+
import BoxBackgroundColor from '../../examples/constellation/box/background-color';
|
|
10
|
+
import BoxXcss from '../../examples/constellation/box/xcss';
|
|
11
|
+
|
|
12
|
+
## Basic
|
|
13
|
+
|
|
14
|
+
Box is a general-purpose container with controlled use of design tokens. Use the given props to configure display behaviour using scalable recommendations from the Atlassian Design System.
|
|
15
|
+
|
|
16
|
+
<Example Component={BoxBasic} packageName="@atlaskit/primitives/box" />
|
|
17
|
+
|
|
18
|
+
## Padding
|
|
19
|
+
|
|
20
|
+
Padding props can be used to access spacing design token and control internal layout. The following example demonstrates how each prop works individually:
|
|
21
|
+
|
|
22
|
+
<Example Component={BoxPadding} packageName="@atlaskit/primitives/box" />
|
|
23
|
+
|
|
24
|
+
*Note*: The nomenclature used by these props follows [logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties). It might be less intuitive at first but they are adequate to properly support different [writing modes](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) in our products.
|
|
25
|
+
|
|
26
|
+
## Background color
|
|
27
|
+
|
|
28
|
+
`Box` accepts a wide variety of background colors, referenced as semantic design tokens.
|
|
29
|
+
|
|
30
|
+
<Example Component={BoxBackgroundColor} packageName="@atlaskit/primitives/box" />
|
|
31
|
+
|
|
32
|
+
## xCSS
|
|
33
|
+
|
|
34
|
+
Box also exposes an `xcss` prop. This prop can take `xcss` function calls that contain a subset of permitted styles. When used with `Box`, xCSS takes most CSS properties, and when a token exists, the rule accepts that token as a value.
|
|
35
|
+
|
|
36
|
+
<Example Component={BoxXcss} packageName="@atlaskit/primitives/box" />
|
|
37
|
+
|
|
38
|
+
For more information on xCSS, see the dedicated [xCSS](/components/primitives/xcss) documentation.
|
|
@@ -40,7 +40,6 @@ var tokensMap = {
|
|
|
40
40
|
insetInline: _styleMaps.insetMap,
|
|
41
41
|
insetInlineEnd: _styleMaps.insetMap,
|
|
42
42
|
insetInlineStart: _styleMaps.insetMap,
|
|
43
|
-
layer: _styleMaps.layerMap,
|
|
44
43
|
left: _styleMaps.dimensionMap,
|
|
45
44
|
maxBlockSize: _styleMaps.dimensionMap,
|
|
46
45
|
maxHeight: _styleMaps.dimensionMap,
|
|
@@ -68,7 +67,8 @@ var tokensMap = {
|
|
|
68
67
|
right: _styleMaps.dimensionMap,
|
|
69
68
|
rowGap: _styleMaps.spaceMap,
|
|
70
69
|
top: _styleMaps.dimensionMap,
|
|
71
|
-
width: _styleMaps.dimensionMap
|
|
70
|
+
width: _styleMaps.dimensionMap,
|
|
71
|
+
zIndex: _styleMaps.layerMap
|
|
72
72
|
};
|
|
73
73
|
var uniqueSymbol = Symbol('Internal symbol to verify xcss function is called safely');
|
|
74
74
|
var isSafeEnvToThrow = function isSafeEnvToThrow() {
|
|
@@ -117,11 +117,8 @@ var transformStyles = function transformStyles(styleObj) {
|
|
|
117
117
|
if (!tokenValue) {
|
|
118
118
|
var message = "Invalid token alias: ".concat(value);
|
|
119
119
|
(0, _warnOnce.default)(message);
|
|
120
|
-
if (isSafeEnvToThrow()) {
|
|
121
|
-
throw new Error(message);
|
|
122
|
-
}
|
|
123
120
|
}
|
|
124
|
-
styleObj[key] = tokenValue;
|
|
121
|
+
styleObj[key] = tokenValue !== null && tokenValue !== void 0 ? tokenValue : value;
|
|
125
122
|
});
|
|
126
123
|
return styleObj;
|
|
127
124
|
};
|
package/dist/cjs/version.json
CHANGED
|
@@ -29,7 +29,6 @@ const tokensMap = {
|
|
|
29
29
|
insetInline: insetMap,
|
|
30
30
|
insetInlineEnd: insetMap,
|
|
31
31
|
insetInlineStart: insetMap,
|
|
32
|
-
layer: layerMap,
|
|
33
32
|
left: dimensionMap,
|
|
34
33
|
maxBlockSize: dimensionMap,
|
|
35
34
|
maxHeight: dimensionMap,
|
|
@@ -57,7 +56,8 @@ const tokensMap = {
|
|
|
57
56
|
right: dimensionMap,
|
|
58
57
|
rowGap: spaceMap,
|
|
59
58
|
top: dimensionMap,
|
|
60
|
-
width: dimensionMap
|
|
59
|
+
width: dimensionMap,
|
|
60
|
+
zIndex: layerMap
|
|
61
61
|
};
|
|
62
62
|
const uniqueSymbol = Symbol('Internal symbol to verify xcss function is called safely');
|
|
63
63
|
const isSafeEnvToThrow = () => typeof process === 'object' && typeof process.env === 'object' && process.env.NODE_ENV !== 'production';
|
|
@@ -101,11 +101,8 @@ const transformStyles = styleObj => {
|
|
|
101
101
|
if (!tokenValue) {
|
|
102
102
|
const message = `Invalid token alias: ${value}`;
|
|
103
103
|
warnOnce(message);
|
|
104
|
-
if (isSafeEnvToThrow()) {
|
|
105
|
-
throw new Error(message);
|
|
106
|
-
}
|
|
107
104
|
}
|
|
108
|
-
styleObj[key] = tokenValue;
|
|
105
|
+
styleObj[key] = tokenValue !== null && tokenValue !== void 0 ? tokenValue : value;
|
|
109
106
|
});
|
|
110
107
|
return styleObj;
|
|
111
108
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -31,7 +31,6 @@ var tokensMap = {
|
|
|
31
31
|
insetInline: insetMap,
|
|
32
32
|
insetInlineEnd: insetMap,
|
|
33
33
|
insetInlineStart: insetMap,
|
|
34
|
-
layer: layerMap,
|
|
35
34
|
left: dimensionMap,
|
|
36
35
|
maxBlockSize: dimensionMap,
|
|
37
36
|
maxHeight: dimensionMap,
|
|
@@ -59,7 +58,8 @@ var tokensMap = {
|
|
|
59
58
|
right: dimensionMap,
|
|
60
59
|
rowGap: spaceMap,
|
|
61
60
|
top: dimensionMap,
|
|
62
|
-
width: dimensionMap
|
|
61
|
+
width: dimensionMap,
|
|
62
|
+
zIndex: layerMap
|
|
63
63
|
};
|
|
64
64
|
var uniqueSymbol = Symbol('Internal symbol to verify xcss function is called safely');
|
|
65
65
|
var isSafeEnvToThrow = function isSafeEnvToThrow() {
|
|
@@ -108,11 +108,8 @@ var transformStyles = function transformStyles(styleObj) {
|
|
|
108
108
|
if (!tokenValue) {
|
|
109
109
|
var message = "Invalid token alias: ".concat(value);
|
|
110
110
|
warnOnce(message);
|
|
111
|
-
if (isSafeEnvToThrow()) {
|
|
112
|
-
throw new Error(message);
|
|
113
|
-
}
|
|
114
111
|
}
|
|
115
|
-
styleObj[key] = tokenValue;
|
|
112
|
+
styleObj[key] = tokenValue !== null && tokenValue !== void 0 ? tokenValue : value;
|
|
116
113
|
});
|
|
117
114
|
return styleObj;
|
|
118
115
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -449,7 +449,6 @@ export declare type TokenisedProps = {
|
|
|
449
449
|
insetInline?: InsetInline;
|
|
450
450
|
insetInlineEnd?: InsetInlineEnd;
|
|
451
451
|
insetInlineStart?: InsetInlineStart;
|
|
452
|
-
layer?: Layer;
|
|
453
452
|
left?: Left;
|
|
454
453
|
maxBlockSize?: MaxBlockSize;
|
|
455
454
|
maxHeight?: MaxHeight;
|
|
@@ -474,6 +473,7 @@ export declare type TokenisedProps = {
|
|
|
474
473
|
rowGap?: RowGap;
|
|
475
474
|
top?: Top;
|
|
476
475
|
width?: Width;
|
|
476
|
+
zIndex?: Layer;
|
|
477
477
|
};
|
|
478
478
|
declare const spacingProperties: readonly ["padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "gap", "rowGap", "columnGap"];
|
|
479
479
|
declare type SpacingProperty = typeof spacingProperties[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,6 +29,15 @@
|
|
|
29
29
|
"type": "alpha"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
"title": "Box",
|
|
34
|
+
"folder": "box",
|
|
35
|
+
"slug": "primitives/box",
|
|
36
|
+
"id": "@atlaskit/primitives/box",
|
|
37
|
+
"status": {
|
|
38
|
+
"type": "alpha"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
32
41
|
{
|
|
33
42
|
"title": "Inline",
|
|
34
43
|
"folder": "inline",
|
|
@@ -87,8 +96,10 @@
|
|
|
87
96
|
"@atlaskit/heading": "*",
|
|
88
97
|
"@atlaskit/icon": "*",
|
|
89
98
|
"@atlaskit/icon-object": "*",
|
|
99
|
+
"@atlaskit/logo": "*",
|
|
90
100
|
"@atlaskit/lozenge": "*",
|
|
91
101
|
"@atlaskit/radio": "^5.4.9",
|
|
102
|
+
"@atlaskit/range": "^7.0.4",
|
|
92
103
|
"@atlaskit/ssr": "*",
|
|
93
104
|
"@atlaskit/tag": "*",
|
|
94
105
|
"@atlaskit/theme": "*",
|
|
@@ -96,6 +107,7 @@
|
|
|
96
107
|
"@atlaskit/webdriver-runner": "*",
|
|
97
108
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
98
109
|
"@atlassian/codegen": "^0.0.1",
|
|
110
|
+
"@atlassian/gemini-visual-regression": "^0.0.5",
|
|
99
111
|
"@testing-library/react": "^12.1.5",
|
|
100
112
|
"csstype": "^3.1.0",
|
|
101
113
|
"prettier": "^2.7.0",
|
package/report.api.md
CHANGED
|
@@ -940,7 +940,6 @@ type TokenisedProps = {
|
|
|
940
940
|
insetInline?: InsetInline;
|
|
941
941
|
insetInlineEnd?: InsetInlineEnd;
|
|
942
942
|
insetInlineStart?: InsetInlineStart;
|
|
943
|
-
layer?: Layer;
|
|
944
943
|
left?: Left;
|
|
945
944
|
maxBlockSize?: MaxBlockSize;
|
|
946
945
|
maxHeight?: MaxHeight;
|
|
@@ -965,6 +964,7 @@ type TokenisedProps = {
|
|
|
965
964
|
rowGap?: RowGap;
|
|
966
965
|
top?: Top;
|
|
967
966
|
width?: Width;
|
|
967
|
+
zIndex?: Layer;
|
|
968
968
|
};
|
|
969
969
|
|
|
970
970
|
// @public (undocumented)
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -626,7 +626,6 @@ type TokenisedProps = {
|
|
|
626
626
|
insetInline?: InsetInline;
|
|
627
627
|
insetInlineEnd?: InsetInlineEnd;
|
|
628
628
|
insetInlineStart?: InsetInlineStart;
|
|
629
|
-
layer?: Layer;
|
|
630
629
|
left?: Left;
|
|
631
630
|
maxBlockSize?: MaxBlockSize;
|
|
632
631
|
maxHeight?: MaxHeight;
|
|
@@ -651,6 +650,7 @@ type TokenisedProps = {
|
|
|
651
650
|
rowGap?: RowGap;
|
|
652
651
|
top?: Top;
|
|
653
652
|
width?: Width;
|
|
653
|
+
zIndex?: Layer;
|
|
654
654
|
};
|
|
655
655
|
|
|
656
656
|
// @public (undocumented)
|