@atlaskit/primitives 0.13.0 → 0.14.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 +12 -0
- package/constellation/xcss/examples.mdx +9 -2
- package/constellation/xcss/migration.mdx +14 -18
- package/constellation/xcss/usage.mdx +57 -19
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/xcss/style-maps.partial.js +6 -78
- package/dist/cjs/xcss/xcss.js +11 -16
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/xcss/style-maps.partial.js +5 -66
- package/dist/es2019/xcss/xcss.js +12 -17
- package/dist/esm/index.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/xcss/style-maps.partial.js +5 -66
- package/dist/esm/xcss/xcss.js +12 -17
- package/dist/types/index.d.ts +1 -0
- package/dist/types/xcss/style-maps.partial.d.ts +22 -122
- package/dist/types/xcss/xcss.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +22 -122
- package/dist/types-ts4.5/xcss/xcss.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +91 -213
- package/scripts/codegen-file-templates/dimensions.tsx +1 -18
- package/scripts/codegen-styles.tsx +1 -1
- package/scripts/misc-codegen-template.tsx +1 -10
- package/tmp/api-report-tmp.d.ts +85 -214
- package/scripts/codegen-file-templates/align-self.tsx +0 -9
- package/scripts/codegen-file-templates/border-style.tsx +0 -6
- package/scripts/codegen-file-templates/display.tsx +0 -10
- package/scripts/codegen-file-templates/flex-direction.tsx +0 -6
- package/scripts/codegen-file-templates/flex-grow.tsx +0 -6
- package/scripts/codegen-file-templates/flex-shrink.tsx +0 -6
- package/scripts/codegen-file-templates/flex.tsx +0 -5
- package/scripts/codegen-file-templates/overflow.tsx +0 -20
- package/scripts/codegen-file-templates/position.tsx +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 0.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d79b6172a93`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d79b6172a93) - Add documentation for responsive xcss.
|
|
8
|
+
|
|
9
|
+
## 0.14.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`5af07899f5b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5af07899f5b) - Loosens types to better reflect `xcss` API.
|
|
14
|
+
|
|
3
15
|
## 0.13.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -6,16 +6,23 @@ order: 1
|
|
|
6
6
|
|
|
7
7
|
import xcssBasic from '../../examples/constellation/xcss/basic';
|
|
8
8
|
import xcssInteractive from '../../examples/constellation/xcss/interactivity';
|
|
9
|
+
import xcssResponsive from '../../examples/constellation/xcss/responsiveness';
|
|
9
10
|
|
|
10
11
|
## Basic
|
|
11
12
|
|
|
12
|
-
`xcss` can
|
|
13
|
+
`xcss` can pull together different types of interactions and UI in a safer more composable way.
|
|
13
14
|
|
|
14
15
|
<Example Component={xcssBasic} packageName="@atlaskit/primitives/xcss" />
|
|
15
16
|
|
|
16
17
|
## Interactivity
|
|
17
18
|
|
|
18
|
-
To enable interactivity
|
|
19
|
+
To enable interactivity, use familiar selectors like `:hover` and `:focus-visible`.
|
|
19
20
|
|
|
20
21
|
<Example Component={xcssInteractive} packageName="@atlaskit/primitives/xcss" />
|
|
21
22
|
|
|
23
|
+
|
|
24
|
+
## Responsiveness
|
|
25
|
+
|
|
26
|
+
xCSS also accepts a subset of media queries at predefined breakpoints:
|
|
27
|
+
|
|
28
|
+
<Example Component={xcssResponsive} packageName="@atlaskit/primitives/xcss" />
|
|
@@ -8,8 +8,8 @@ order: 2
|
|
|
8
8
|
|
|
9
9
|
### Changes for developers
|
|
10
10
|
|
|
11
|
-
There are two key changes to be mindful of when migrating to
|
|
12
|
-
The first is
|
|
11
|
+
There are two key changes to be mindful of when migrating to `xcss`.
|
|
12
|
+
The first is updating callsites to remove any nested styles and
|
|
13
13
|
tokenised values.
|
|
14
14
|
|
|
15
15
|
```diff
|
|
@@ -26,9 +26,9 @@ tokenised values.
|
|
|
26
26
|
});
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
The second is that for the `xcss` function to be applied correctly it must be applied on a
|
|
30
|
-
component with an `xcss` JSXAttribute.
|
|
31
|
-
JSXAttributes
|
|
29
|
+
The second change is that for the `xcss` function to be applied correctly it must be applied on a
|
|
30
|
+
component with an `xcss` JSXAttribute. This won't work with the `css` or `className`
|
|
31
|
+
JSXAttributes, be aware if you're not seeing your styles appear.
|
|
32
32
|
|
|
33
33
|
```diff
|
|
34
34
|
- <div css={someStyles} />
|
|
@@ -38,8 +38,7 @@ JSXAttributes - so be aware if you're not seeing your styles appear.
|
|
|
38
38
|
|
|
39
39
|
#### Changing the way you express styles
|
|
40
40
|
|
|
41
|
-
Why are nested selectors a problem? A key philosophy of `xcss` is encouraging more deterministic style application.
|
|
42
|
-
encourage component encapsulation. Consider the below example:
|
|
41
|
+
Why are nested selectors a problem? A key philosophy of `xcss` is encouraging more deterministic style application. Restricting nested styles eliminates side-effects and encourages component encapsulation. Consider the below example:
|
|
43
42
|
|
|
44
43
|
```tsx
|
|
45
44
|
const myComponentStyles = css({
|
|
@@ -55,12 +54,12 @@ const MyComponent = () => (
|
|
|
55
54
|
);
|
|
56
55
|
```
|
|
57
56
|
|
|
58
|
-
Here the component is applying styles that are
|
|
57
|
+
Here the component is applying styles that are implicitly meant for the text wrapped in the `p` below.
|
|
59
58
|
In this simple example, it may seem okay, desirable even, but cases like these often occur across module or component boundaries.
|
|
60
59
|
|
|
61
60
|
This makes the visibility of these dependencies harder to capture or reason about.
|
|
62
|
-
Styles that are inherited or indirectly apply make a UI
|
|
63
|
-
Instead, if the same styles are applied directly
|
|
61
|
+
Styles that are inherited or indirectly apply make a UI vulnerable to change and harder to maintain.
|
|
62
|
+
Instead, if the same styles are applied directly to the affected element this can minimize and in some cases completely eliminate this problem.
|
|
64
63
|
|
|
65
64
|
```diff
|
|
66
65
|
const myTextStyles = xcss({
|
|
@@ -77,17 +76,15 @@ const MyComponent = () => (
|
|
|
77
76
|
);
|
|
78
77
|
```
|
|
79
78
|
|
|
80
|
-
There
|
|
81
|
-
a last resort.
|
|
79
|
+
There will likely be cases where nesting is the only option. While not desirable, nesting can be used minimally, and when the potential impact is considered.
|
|
82
80
|
|
|
83
81
|
### FAQ
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
Migration to `xcss` is simple for the majority of cases. Here are some common strategies for migrations.
|
|
86
84
|
|
|
87
85
|
#### Non-tokenised values
|
|
88
86
|
|
|
89
|
-
|
|
90
|
-
migrate to `xcss` or you can make the jump directly.
|
|
87
|
+
Before migrating to tokens, there are two options. Migrate to tokens first and then on a second pass migrate to `xcss` or make the jump directly to use both tokens and `xcss`.
|
|
91
88
|
|
|
92
89
|
```tsx
|
|
93
90
|
const someStyles = css({
|
|
@@ -107,9 +104,8 @@ const someStyles = xcss({
|
|
|
107
104
|
|
|
108
105
|
#### Moving from the `styled` API
|
|
109
106
|
|
|
110
|
-
If
|
|
111
|
-
The safest approach is to a step change to use object styles, migrate to tokens (optionally)
|
|
112
|
-
and then migrate to `xcss`.
|
|
107
|
+
If currently using the `styled` API there are a few steps to migrate.
|
|
108
|
+
The safest approach is to a step change to use object styles, migrate to tokens (optionally) and then migrate to `xcss`.
|
|
113
109
|
|
|
114
110
|
```tsx
|
|
115
111
|
const MyComponent = styled.div`
|
|
@@ -3,26 +3,24 @@ title: xCSS
|
|
|
3
3
|
description: xCSS is a safer, tokens-first approach to CSS-in-JS.
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
|
+
import { MediaQueriesTable } from '@af/design-system-docs-ui';
|
|
6
7
|
|
|
7
8
|

|
|
8
9
|
|
|
9
|
-
`xcss` is an Atlassian Design System styling API
|
|
10
|
-
Atlassian's [design tokens](/tokens) and [primitives](/components/primitives) in a safer, more resilient and evolvable way.
|
|
10
|
+
`xcss` is an Atlassian Design System styling API that natively integrates with Atlassian's [design tokens](/tokens) and [primitives](/components/primitives).
|
|
11
11
|
|
|
12
|
-
The `xcss` utility behaves similarly to the `css` utility in libraries
|
|
13
|
-
like `styled-components`, `@compiled` or `@emotion` - so if you've used those libraries before
|
|
14
|
-
it will feel very familiar, with a few additional features and some constraints.
|
|
12
|
+
The `xcss` utility behaves similarly to the `css` utility in libraries like `styled-components`, `@compiled` or `@emotion`. If you've used these libraries, `xcss` will feel familiar, with a few additional features and constraints.
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
Familiar features:
|
|
17
15
|
|
|
18
|
-
* `xcss`
|
|
19
|
-
* `xcss`
|
|
16
|
+
* `xcss` generates a `className` that is applied to the components
|
|
17
|
+
* `xcss` provides key-value pairs of CSS properties in an object format
|
|
20
18
|
* `xcss` supports style precedence and conditional styles
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
Key differences:
|
|
23
21
|
|
|
24
|
-
* `xcss` has type-safety that
|
|
25
|
-
* `xcss` restricts nested selectors completely from usage
|
|
22
|
+
* `xcss` has type-safety that ensures token name usage for all CSS properties represented by design tokens.
|
|
23
|
+
* `xcss` restricts nested selectors completely from usage
|
|
26
24
|
|
|
27
25
|
## Usage
|
|
28
26
|
|
|
@@ -51,17 +49,14 @@ const MyBox = () => {
|
|
|
51
49
|
return <Box xcss={someStyles} />
|
|
52
50
|
}
|
|
53
51
|
```
|
|
52
|
+
The `xcss` prop and the `xcss` function are direct complements and are designed to be used together.
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
to be used together. Note: styles generated from `xcss` cannot be applied directly
|
|
57
|
-
to the `className` property or `css` as they are with other CSS-in-JS libraries.
|
|
54
|
+
Note: styles generated from `xcss` cannot be applied directly to the `className` property or `css` as they are with other CSS-in-JS libraries.
|
|
58
55
|
|
|
59
56
|
### Type safety
|
|
60
57
|
|
|
61
|
-
`xcss` uses strongly-typed values generated from design token
|
|
62
|
-
|
|
63
|
-
This is intended to be more ergonomic and intuitive but also prevent the misapplication of tokens
|
|
64
|
-
to the wrong properties.
|
|
58
|
+
`xcss` uses strongly-typed values generated from design token definitions, making it simpler to apply the right token to the right CSS property.
|
|
59
|
+
This is intended to be more ergonomic and intuitive, but also prevent the misapplication of tokens to the wrong properties.
|
|
65
60
|
|
|
66
61
|
Any [valid token name](/components/tokens/all-tokens) is available to be applied against its
|
|
67
62
|
matching CSS property. For example, the token name `space.200`
|
|
@@ -79,6 +74,10 @@ const someStyles = xcss({
|
|
|
79
74
|
```
|
|
80
75
|
|
|
81
76
|
### Restricted nesting
|
|
77
|
+
`xcss` is flexible enough to implement any design, but it does restrict the application of styles in one key way.
|
|
78
|
+
Selectors cannot be nested or target elements beyond the element on which styles are applied.
|
|
79
|
+
This restriction is intended to encourage better component encapsulation, reduce side-effects and make the codebase more resilient to change.
|
|
80
|
+
|
|
82
81
|
|
|
83
82
|
`xcss` is meant to be flexible enough for you to implement any design but it does
|
|
84
83
|
restrict the application of styles in one key way. Selectors cannot be
|
|
@@ -106,7 +105,46 @@ const someStyles = xcss({
|
|
|
106
105
|
```
|
|
107
106
|
|
|
108
107
|
These unsafe selectors will throw a type error if applied.
|
|
109
|
-
For richer examples of how to use `xcss` please see
|
|
108
|
+
For richer examples of how to use `xcss` please see the [primitives `xcss` documentation](/components/primitives/xcss/examples).
|
|
109
|
+
|
|
110
|
+
### Media Queries
|
|
111
|
+
xCSS can create responsive layouts at predefined breakpoints that are consistent with the Atlassian Design System. To enable responsive behavior, xCSS exposes the following pre-defined breakpoints:
|
|
112
|
+
<MediaQueriesTable />
|
|
113
|
+
|
|
114
|
+
Media queries can be applied through keys that can be imported from `@atlaskit/primitives/responsive`.
|
|
115
|
+
For in depth examples on how to enable responsive behavior, please see our [primitive responsiveness documentation](/components/primitives/xcss/examples#responsiveness).
|
|
116
|
+
|
|
117
|
+
The objects defined at each breakpoint behave in much the same way as a normal xCSS object, and can apply responsiveness to any CSS.
|
|
118
|
+
The only limitation is that a media query can't contain another media query. This is to prevent arbitrary nesting.
|
|
119
|
+
Additionally, pseudo-selectors can't contain media queries. To use media queries and pseudos, the media query must contain the pseudo.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
import { xcss } from '@atlaskit/primitives';
|
|
123
|
+
import { media } from '@atlaskit/primitives/responsive';
|
|
124
|
+
|
|
125
|
+
const someStyles = xcss({
|
|
126
|
+
// This is okay, since media queries can contain pseudos
|
|
127
|
+
[media.above.md]: {
|
|
128
|
+
':hover': {
|
|
129
|
+
backgroundColor: 'color.background.primary.hovered'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
// This is not okay, since pseudos can't contain media queries
|
|
134
|
+
':hover': {
|
|
135
|
+
[media.above.md]: {
|
|
136
|
+
backgroundColor: 'color.background.primary.hovered'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
// This is not okay, since media queries can't contain media queries
|
|
141
|
+
[media.above.md]: {
|
|
142
|
+
[media.above.xs]: {
|
|
143
|
+
backgroundColor: 'color.background.primary.hovered'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
```
|
|
110
148
|
|
|
111
149
|
## Get help
|
|
112
150
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -22,6 +22,18 @@ Object.defineProperty(exports, "Stack", {
|
|
|
22
22
|
return _stack.default;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "UNSAFE_BREAKPOINTS_CONFIG", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _responsive.UNSAFE_BREAKPOINTS_CONFIG;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "UNSAFE_media", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _responsive.UNSAFE_media;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
25
37
|
Object.defineProperty(exports, "xcss", {
|
|
26
38
|
enumerable: true,
|
|
27
39
|
get: function get() {
|
|
@@ -31,4 +43,5 @@ Object.defineProperty(exports, "xcss", {
|
|
|
31
43
|
var _box = _interopRequireDefault(require("./components/box"));
|
|
32
44
|
var _inline = _interopRequireDefault(require("./components/inline"));
|
|
33
45
|
var _xcss = require("./xcss/xcss");
|
|
34
|
-
var _stack = _interopRequireDefault(require("./components/stack"));
|
|
46
|
+
var _stack = _interopRequireDefault(require("./components/stack"));
|
|
47
|
+
var _responsive = require("./helpers/responsive");
|
package/dist/cjs/version.json
CHANGED
|
@@ -4,16 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.textColorMap = exports.spaceStylesMap = exports.spaceMap = exports.shadowMap = exports.
|
|
7
|
+
exports.textColorMap = exports.spaceStylesMap = exports.spaceMap = exports.shadowMap = exports.paddingStylesMap = exports.layerMap = exports.fillMap = exports.dimensionMap = exports.borderWidthMap = exports.borderRadiusMap = exports.borderColorMap = exports.backgroundColorStylesMap = exports.backgroundColorMap = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
/**
|
|
11
11
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
12
|
-
* @codegen <<SignedSource::
|
|
12
|
+
* @codegen <<SignedSource::7af6097e56f7fb03635b6f8aaf121b02>>
|
|
13
13
|
* @codegenId dimensions
|
|
14
14
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
15
15
|
* @codegenParams ["dimensions"]
|
|
16
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
16
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
|
|
17
17
|
*/
|
|
18
18
|
var dimensionMap = {
|
|
19
19
|
'100%': '100%',
|
|
@@ -278,63 +278,13 @@ exports.fillMap = fillMap;
|
|
|
278
278
|
|
|
279
279
|
/**
|
|
280
280
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
281
|
-
* @codegen <<SignedSource::
|
|
281
|
+
* @codegen <<SignedSource::01a4b055c311d198921d4e000a2d7a54>>
|
|
282
282
|
* @codegenId misc
|
|
283
283
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
284
|
-
* @codegenParams ["
|
|
285
|
-
* @codegenDependency ../../scripts/codegen-file-templates/
|
|
286
|
-
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
287
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
|
|
288
|
-
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::486569d9e228265c1688d0a7122bdedc>>
|
|
289
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
290
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
291
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::77effeb1e5c39997e34b21b000a91faf>>
|
|
292
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex.tsx <<SignedSource::ffa0189d14f1f00a16ec1e9f43a17ce9>>
|
|
284
|
+
* @codegenParams ["layer"]
|
|
285
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
|
|
293
286
|
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::79d24a1e558f12d671c06a7609f90dc1>>
|
|
294
|
-
* @codegenDependency ../../scripts/codegen-file-templates/overflow.tsx <<SignedSource::ccb841f2f51525aed895c06e00f15089>>
|
|
295
|
-
* @codegenDependency ../../scripts/codegen-file-templates/position.tsx <<SignedSource::8709494ef16c48046c1784a9aaec6d80>>
|
|
296
287
|
*/
|
|
297
|
-
var alignSelfMap = {
|
|
298
|
-
center: 'center',
|
|
299
|
-
start: 'start',
|
|
300
|
-
stretch: 'stretch',
|
|
301
|
-
end: 'end',
|
|
302
|
-
baseline: 'baseline'
|
|
303
|
-
};
|
|
304
|
-
exports.alignSelfMap = alignSelfMap;
|
|
305
|
-
var borderStyleMap = {
|
|
306
|
-
none: 'none',
|
|
307
|
-
solid: 'solid'
|
|
308
|
-
};
|
|
309
|
-
exports.borderStyleMap = borderStyleMap;
|
|
310
|
-
var displayMap = {
|
|
311
|
-
flex: 'flex',
|
|
312
|
-
block: 'block',
|
|
313
|
-
inline: 'inline',
|
|
314
|
-
inlineBlock: 'inline-block',
|
|
315
|
-
inlineFlex: 'inline-flex',
|
|
316
|
-
grid: 'grid'
|
|
317
|
-
};
|
|
318
|
-
exports.displayMap = displayMap;
|
|
319
|
-
var flexDirectionMap = {
|
|
320
|
-
row: 'row',
|
|
321
|
-
column: 'column'
|
|
322
|
-
};
|
|
323
|
-
exports.flexDirectionMap = flexDirectionMap;
|
|
324
|
-
var flexGrowMap = {
|
|
325
|
-
'0': 0,
|
|
326
|
-
'1': 1
|
|
327
|
-
};
|
|
328
|
-
exports.flexGrowMap = flexGrowMap;
|
|
329
|
-
var flexShrinkMap = {
|
|
330
|
-
'0': '0',
|
|
331
|
-
'1': 1
|
|
332
|
-
};
|
|
333
|
-
exports.flexShrinkMap = flexShrinkMap;
|
|
334
|
-
var flexMap = {
|
|
335
|
-
'1': 1
|
|
336
|
-
};
|
|
337
|
-
exports.flexMap = flexMap;
|
|
338
288
|
var layerMap = {
|
|
339
289
|
card: 100,
|
|
340
290
|
navigation: 200,
|
|
@@ -347,28 +297,6 @@ var layerMap = {
|
|
|
347
297
|
tooltip: 800
|
|
348
298
|
};
|
|
349
299
|
exports.layerMap = layerMap;
|
|
350
|
-
var overflowMap = {
|
|
351
|
-
auto: 'auto',
|
|
352
|
-
hidden: 'hidden'
|
|
353
|
-
};
|
|
354
|
-
exports.overflowMap = overflowMap;
|
|
355
|
-
var overflowInlineMap = {
|
|
356
|
-
auto: 'auto',
|
|
357
|
-
hidden: 'hidden'
|
|
358
|
-
};
|
|
359
|
-
exports.overflowInlineMap = overflowInlineMap;
|
|
360
|
-
var overflowBlockMap = {
|
|
361
|
-
auto: 'auto',
|
|
362
|
-
hidden: 'hidden'
|
|
363
|
-
};
|
|
364
|
-
exports.overflowBlockMap = overflowBlockMap;
|
|
365
|
-
var positionMap = {
|
|
366
|
-
absolute: 'absolute',
|
|
367
|
-
fixed: 'fixed',
|
|
368
|
-
relative: 'relative',
|
|
369
|
-
static: 'static'
|
|
370
|
-
};
|
|
371
|
-
exports.positionMap = positionMap;
|
|
372
300
|
/**
|
|
373
301
|
* @codegenEnd
|
|
374
302
|
*/
|
package/dist/cjs/xcss/xcss.js
CHANGED
|
@@ -16,23 +16,15 @@ var _styleMaps = require("./style-maps.partial");
|
|
|
16
16
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
17
17
|
|
|
18
18
|
var tokensMap = {
|
|
19
|
-
alignSelf: _styleMaps.alignSelfMap,
|
|
20
19
|
backgroundColor: _styleMaps.backgroundColorMap,
|
|
21
20
|
blockSize: _styleMaps.dimensionMap,
|
|
22
21
|
borderColor: _styleMaps.borderColorMap,
|
|
23
22
|
borderRadius: _styleMaps.borderRadiusMap,
|
|
24
|
-
borderStyle: _styleMaps.borderStyleMap,
|
|
25
23
|
borderWidth: _styleMaps.borderWidthMap,
|
|
26
|
-
bottom: _styleMaps.
|
|
24
|
+
bottom: _styleMaps.spaceMap,
|
|
27
25
|
boxShadow: _styleMaps.shadowMap,
|
|
28
26
|
color: _styleMaps.textColorMap,
|
|
29
27
|
columnGap: _styleMaps.spaceMap,
|
|
30
|
-
display: _styleMaps.displayMap,
|
|
31
|
-
fill: _styleMaps.fillMap,
|
|
32
|
-
flex: _styleMaps.flexMap,
|
|
33
|
-
flexDirection: _styleMaps.flexDirectionMap,
|
|
34
|
-
flexGrow: _styleMaps.flexGrowMap,
|
|
35
|
-
flexShrink: _styleMaps.flexShrinkMap,
|
|
36
28
|
gap: _styleMaps.spaceMap,
|
|
37
29
|
height: _styleMaps.dimensionMap,
|
|
38
30
|
inlineSize: _styleMaps.dimensionMap,
|
|
@@ -43,7 +35,14 @@ var tokensMap = {
|
|
|
43
35
|
insetInline: _styleMaps.spaceMap,
|
|
44
36
|
insetInlineEnd: _styleMaps.spaceMap,
|
|
45
37
|
insetInlineStart: _styleMaps.spaceMap,
|
|
46
|
-
|
|
38
|
+
margin: _styleMaps.spaceMap,
|
|
39
|
+
marginBlock: _styleMaps.spaceMap,
|
|
40
|
+
marginBlockEnd: _styleMaps.spaceMap,
|
|
41
|
+
marginBlockStart: _styleMaps.spaceMap,
|
|
42
|
+
marginInline: _styleMaps.spaceMap,
|
|
43
|
+
marginInlineEnd: _styleMaps.spaceMap,
|
|
44
|
+
marginInlineStart: _styleMaps.spaceMap,
|
|
45
|
+
left: _styleMaps.spaceMap,
|
|
47
46
|
maxBlockSize: _styleMaps.dimensionMap,
|
|
48
47
|
maxHeight: _styleMaps.dimensionMap,
|
|
49
48
|
maxInlineSize: _styleMaps.dimensionMap,
|
|
@@ -55,9 +54,6 @@ var tokensMap = {
|
|
|
55
54
|
outlineOffset: _styleMaps.spaceMap,
|
|
56
55
|
outlineWidth: _styleMaps.borderWidthMap,
|
|
57
56
|
outlineColor: _styleMaps.borderColorMap,
|
|
58
|
-
overflow: _styleMaps.overflowMap,
|
|
59
|
-
overflowBlock: _styleMaps.overflowBlockMap,
|
|
60
|
-
overflowInline: _styleMaps.overflowInlineMap,
|
|
61
57
|
padding: _styleMaps.spaceMap,
|
|
62
58
|
paddingBlock: _styleMaps.spaceMap,
|
|
63
59
|
paddingBlockEnd: _styleMaps.spaceMap,
|
|
@@ -69,10 +65,9 @@ var tokensMap = {
|
|
|
69
65
|
paddingLeft: _styleMaps.spaceMap,
|
|
70
66
|
paddingRight: _styleMaps.spaceMap,
|
|
71
67
|
paddingTop: _styleMaps.spaceMap,
|
|
72
|
-
|
|
73
|
-
right: _styleMaps.dimensionMap,
|
|
68
|
+
right: _styleMaps.spaceMap,
|
|
74
69
|
rowGap: _styleMaps.spaceMap,
|
|
75
|
-
top: _styleMaps.
|
|
70
|
+
top: _styleMaps.spaceMap,
|
|
76
71
|
width: _styleMaps.dimensionMap,
|
|
77
72
|
zIndex: _styleMaps.layerMap
|
|
78
73
|
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Box } from './components/box';
|
|
2
2
|
export { default as Inline } from './components/inline';
|
|
3
3
|
export { xcss } from './xcss/xcss';
|
|
4
|
-
export { default as Stack } from './components/stack';
|
|
4
|
+
export { default as Stack } from './components/stack';
|
|
5
|
+
export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './helpers/responsive';
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
/**
|
|
3
3
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
4
|
-
* @codegen <<SignedSource::
|
|
4
|
+
* @codegen <<SignedSource::7af6097e56f7fb03635b6f8aaf121b02>>
|
|
5
5
|
* @codegenId dimensions
|
|
6
6
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
7
7
|
* @codegenParams ["dimensions"]
|
|
8
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
|
|
9
9
|
*/
|
|
10
10
|
export const dimensionMap = {
|
|
11
11
|
'100%': '100%',
|
|
@@ -260,56 +260,13 @@ export const fillMap = {
|
|
|
260
260
|
*/
|
|
261
261
|
/**
|
|
262
262
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
263
|
-
* @codegen <<SignedSource::
|
|
263
|
+
* @codegen <<SignedSource::01a4b055c311d198921d4e000a2d7a54>>
|
|
264
264
|
* @codegenId misc
|
|
265
265
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
266
|
-
* @codegenParams ["
|
|
267
|
-
* @codegenDependency ../../scripts/codegen-file-templates/
|
|
268
|
-
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
269
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
|
|
270
|
-
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::486569d9e228265c1688d0a7122bdedc>>
|
|
271
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
272
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
273
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::77effeb1e5c39997e34b21b000a91faf>>
|
|
274
|
-
* @codegenDependency ../../scripts/codegen-file-templates/flex.tsx <<SignedSource::ffa0189d14f1f00a16ec1e9f43a17ce9>>
|
|
266
|
+
* @codegenParams ["layer"]
|
|
267
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
|
|
275
268
|
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::79d24a1e558f12d671c06a7609f90dc1>>
|
|
276
|
-
* @codegenDependency ../../scripts/codegen-file-templates/overflow.tsx <<SignedSource::ccb841f2f51525aed895c06e00f15089>>
|
|
277
|
-
* @codegenDependency ../../scripts/codegen-file-templates/position.tsx <<SignedSource::8709494ef16c48046c1784a9aaec6d80>>
|
|
278
269
|
*/
|
|
279
|
-
export const alignSelfMap = {
|
|
280
|
-
center: 'center',
|
|
281
|
-
start: 'start',
|
|
282
|
-
stretch: 'stretch',
|
|
283
|
-
end: 'end',
|
|
284
|
-
baseline: 'baseline'
|
|
285
|
-
};
|
|
286
|
-
export const borderStyleMap = {
|
|
287
|
-
none: 'none',
|
|
288
|
-
solid: 'solid'
|
|
289
|
-
};
|
|
290
|
-
export const displayMap = {
|
|
291
|
-
flex: 'flex',
|
|
292
|
-
block: 'block',
|
|
293
|
-
inline: 'inline',
|
|
294
|
-
inlineBlock: 'inline-block',
|
|
295
|
-
inlineFlex: 'inline-flex',
|
|
296
|
-
grid: 'grid'
|
|
297
|
-
};
|
|
298
|
-
export const flexDirectionMap = {
|
|
299
|
-
row: 'row',
|
|
300
|
-
column: 'column'
|
|
301
|
-
};
|
|
302
|
-
export const flexGrowMap = {
|
|
303
|
-
'0': 0,
|
|
304
|
-
'1': 1
|
|
305
|
-
};
|
|
306
|
-
export const flexShrinkMap = {
|
|
307
|
-
'0': '0',
|
|
308
|
-
'1': 1
|
|
309
|
-
};
|
|
310
|
-
export const flexMap = {
|
|
311
|
-
'1': 1
|
|
312
|
-
};
|
|
313
270
|
export const layerMap = {
|
|
314
271
|
card: 100,
|
|
315
272
|
navigation: 200,
|
|
@@ -321,24 +278,6 @@ export const layerMap = {
|
|
|
321
278
|
spotlight: 700,
|
|
322
279
|
tooltip: 800
|
|
323
280
|
};
|
|
324
|
-
export const overflowMap = {
|
|
325
|
-
auto: 'auto',
|
|
326
|
-
hidden: 'hidden'
|
|
327
|
-
};
|
|
328
|
-
export const overflowInlineMap = {
|
|
329
|
-
auto: 'auto',
|
|
330
|
-
hidden: 'hidden'
|
|
331
|
-
};
|
|
332
|
-
export const overflowBlockMap = {
|
|
333
|
-
auto: 'auto',
|
|
334
|
-
hidden: 'hidden'
|
|
335
|
-
};
|
|
336
|
-
export const positionMap = {
|
|
337
|
-
absolute: 'absolute',
|
|
338
|
-
fixed: 'fixed',
|
|
339
|
-
relative: 'relative',
|
|
340
|
-
static: 'static'
|
|
341
|
-
};
|
|
342
281
|
/**
|
|
343
282
|
* @codegenEnd
|
|
344
283
|
*/
|
package/dist/es2019/xcss/xcss.js
CHANGED
|
@@ -2,25 +2,17 @@
|
|
|
2
2
|
import { css as cssEmotion } from '@emotion/react';
|
|
3
3
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
4
4
|
import { media } from '../helpers/responsive';
|
|
5
|
-
import {
|
|
5
|
+
import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, layerMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
|
|
6
6
|
const tokensMap = {
|
|
7
|
-
alignSelf: alignSelfMap,
|
|
8
7
|
backgroundColor: backgroundColorMap,
|
|
9
8
|
blockSize: dimensionMap,
|
|
10
9
|
borderColor: borderColorMap,
|
|
11
10
|
borderRadius: borderRadiusMap,
|
|
12
|
-
borderStyle: borderStyleMap,
|
|
13
11
|
borderWidth: borderWidthMap,
|
|
14
|
-
bottom:
|
|
12
|
+
bottom: spaceMap,
|
|
15
13
|
boxShadow: shadowMap,
|
|
16
14
|
color: textColorMap,
|
|
17
15
|
columnGap: spaceMap,
|
|
18
|
-
display: displayMap,
|
|
19
|
-
fill: fillMap,
|
|
20
|
-
flex: flexMap,
|
|
21
|
-
flexDirection: flexDirectionMap,
|
|
22
|
-
flexGrow: flexGrowMap,
|
|
23
|
-
flexShrink: flexShrinkMap,
|
|
24
16
|
gap: spaceMap,
|
|
25
17
|
height: dimensionMap,
|
|
26
18
|
inlineSize: dimensionMap,
|
|
@@ -31,7 +23,14 @@ const tokensMap = {
|
|
|
31
23
|
insetInline: spaceMap,
|
|
32
24
|
insetInlineEnd: spaceMap,
|
|
33
25
|
insetInlineStart: spaceMap,
|
|
34
|
-
|
|
26
|
+
margin: spaceMap,
|
|
27
|
+
marginBlock: spaceMap,
|
|
28
|
+
marginBlockEnd: spaceMap,
|
|
29
|
+
marginBlockStart: spaceMap,
|
|
30
|
+
marginInline: spaceMap,
|
|
31
|
+
marginInlineEnd: spaceMap,
|
|
32
|
+
marginInlineStart: spaceMap,
|
|
33
|
+
left: spaceMap,
|
|
35
34
|
maxBlockSize: dimensionMap,
|
|
36
35
|
maxHeight: dimensionMap,
|
|
37
36
|
maxInlineSize: dimensionMap,
|
|
@@ -43,9 +42,6 @@ const tokensMap = {
|
|
|
43
42
|
outlineOffset: spaceMap,
|
|
44
43
|
outlineWidth: borderWidthMap,
|
|
45
44
|
outlineColor: borderColorMap,
|
|
46
|
-
overflow: overflowMap,
|
|
47
|
-
overflowBlock: overflowBlockMap,
|
|
48
|
-
overflowInline: overflowInlineMap,
|
|
49
45
|
padding: spaceMap,
|
|
50
46
|
paddingBlock: spaceMap,
|
|
51
47
|
paddingBlockEnd: spaceMap,
|
|
@@ -57,10 +53,9 @@ const tokensMap = {
|
|
|
57
53
|
paddingLeft: spaceMap,
|
|
58
54
|
paddingRight: spaceMap,
|
|
59
55
|
paddingTop: spaceMap,
|
|
60
|
-
|
|
61
|
-
right: dimensionMap,
|
|
56
|
+
right: spaceMap,
|
|
62
57
|
rowGap: spaceMap,
|
|
63
|
-
top:
|
|
58
|
+
top: spaceMap,
|
|
64
59
|
width: dimensionMap,
|
|
65
60
|
zIndex: layerMap
|
|
66
61
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Box } from './components/box';
|
|
2
2
|
export { default as Inline } from './components/inline';
|
|
3
3
|
export { xcss } from './xcss/xcss';
|
|
4
|
-
export { default as Stack } from './components/stack';
|
|
4
|
+
export { default as Stack } from './components/stack';
|
|
5
|
+
export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './helpers/responsive';
|
package/dist/esm/version.json
CHANGED