@atlaskit/primitives 0.9.1 → 0.9.3
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 +13 -0
- package/README.md +6 -2
- package/box/package.json +2 -2
- package/constellation/box/code.mdx +6 -2
- package/constellation/box/usage.mdx +30 -0
- package/constellation/inline/usage.mdx +36 -0
- package/constellation/overview/images/box-usage-example.png +0 -0
- package/constellation/overview/images/inline-usage-example.png +0 -0
- package/constellation/overview/images/stack-usage-example.png +0 -0
- package/constellation/overview/index.mdx +66 -0
- package/constellation/stack/usage.mdx +31 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/xcss/style-maps.partial.js +39 -45
- package/dist/cjs/xcss/xcss.js +20 -19
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/xcss/style-maps.partial.js +37 -42
- package/dist/es2019/xcss/xcss.js +21 -20
- package/dist/esm/version.json +1 -1
- package/dist/esm/xcss/style-maps.partial.js +37 -42
- package/dist/esm/xcss/xcss.js +21 -20
- package/dist/types/components/box.d.ts +2 -2
- package/dist/types/components/inline.d.ts +7 -7
- package/dist/types/components/internal/base-box.d.ts +15 -14
- package/dist/types/components/stack.d.ts +6 -6
- package/dist/types/components/types.d.ts +2 -2
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/helpers/responsive/types.d.ts +4 -4
- package/dist/types/xcss/style-maps.partial.d.ts +106 -133
- package/dist/types/xcss/xcss.d.ts +11 -11
- package/dist/types-ts4.5/components/box.d.ts +18 -0
- package/dist/types-ts4.5/components/inline.d.ts +75 -0
- package/dist/types-ts4.5/components/internal/base-box.d.ts +84 -0
- package/dist/types-ts4.5/components/stack.d.ts +61 -0
- package/dist/types-ts4.5/components/types.d.ts +18 -0
- package/dist/types-ts4.5/constants.d.ts +12 -0
- package/dist/types-ts4.5/helpers/responsive/build-media-query-css.d.ts +57 -0
- package/dist/types-ts4.5/helpers/responsive/constants.d.ts +31 -0
- package/dist/types-ts4.5/helpers/responsive/index.d.ts +4 -0
- package/dist/types-ts4.5/helpers/responsive/media-helper.d.ts +45 -0
- package/dist/types-ts4.5/helpers/responsive/types.d.ts +47 -0
- package/dist/types-ts4.5/index.d.ts +4 -0
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +474 -0
- package/dist/types-ts4.5/xcss/xcss.d.ts +57 -0
- package/extract-react-types/box-props.tsx +95 -0
- package/extract-react-types/inline-props.tsx +86 -1
- package/extract-react-types/stack-props.tsx +70 -1
- package/inline/package.json +2 -2
- package/package.json +19 -11
- package/report.api.md +116 -350
- package/responsive/package.json +2 -2
- package/scripts/codegen-file-templates/dimensions.tsx +17 -16
- package/scripts/codegen-styles.tsx +2 -2
- package/scripts/color-codegen-template.tsx +7 -0
- package/scripts/spacing-codegen-template.tsx +24 -91
- package/stack/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +103 -99
- package/tsconfig.node.json +7 -0
- package/constellation/overview/examples.mdx +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 0.9.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
8
|
+
- [`e06d56c5a3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e06d56c5a3d) - Adds type hinting for `fill` CSS property.
|
|
9
|
+
|
|
10
|
+
## 0.9.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
15
|
+
|
|
3
16
|
## 0.9.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ Primitives are token-backed low-level building blocks.
|
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Detailed docs and example usage can be found at:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- [Overview](https://staging.atlassian.design/components/primitives/overview)
|
|
10
|
+
- [Box](https://staging.atlassian.design/components/primitives/box)
|
|
11
|
+
- [Inline](https://staging.atlassian.design/components/primitives/inline)
|
|
12
|
+
- [Stack](https://staging.atlassian.design/components/primitives/stack)
|
|
13
|
+
- [xCSS](https://staging.atlassian.design/components/primitives/xcss)
|
package/box/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Box
|
|
3
|
-
description:
|
|
3
|
+
description: Box is a primitive component that leverages the foundations of the Atlassian Design System.
|
|
4
4
|
order: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import BoxProps from '!!extract-react-types-loader!../../extract-react-types/box-props'
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
<PropsTable heading="" props={BoxProps} />
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Box
|
|
3
|
+
description: A box is a primitive component that acts as a generic container, and provides managed access to design tokens.
|
|
4
|
+
order: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use box to compose layouts with the valid spacing and background colors. A `Box` is a generic container with convenient and managed access to design tokens, and built-in guidance for the best practices of the Atlassian Design System.
|
|
8
|
+
|
|
9
|
+
A `Box` is primarily a containment element, with visual props that affect the whitespace available to child elements.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Use `Box`
|
|
13
|
+
Display behavior is set by using the available props or using `xcss`. Makers can make design decisions for `Box` by setting:
|
|
14
|
+
|
|
15
|
+
- `padding`
|
|
16
|
+
- `paddingInline`
|
|
17
|
+
- `paddingInlineStart`
|
|
18
|
+
- `paddingInlineEnd`
|
|
19
|
+
- `paddingBlock`
|
|
20
|
+
- `paddingBlockStart`
|
|
21
|
+
- `paddingBlockEnd`
|
|
22
|
+
- `backgroundColor`
|
|
23
|
+
|
|
24
|
+
To identify usages of `Box` in a given design, look for where a UI element (could be as small as the parent of a button or as a big as the wrapper of an entire section) will receive some visual styles applied to a container.
|
|
25
|
+
|
|
26
|
+
`Box`, being generic in nature, can be "over-used", so it’s important to consider situations where more specific and expressive primitives could be used, for example: `Inline` and `Stack` to manage horizontal and vertical layouts, respectively.
|
|
27
|
+
|
|
28
|
+
Related
|
|
29
|
+
- [Learn more about the Inline primitive](/components/primitives/inline/usage)
|
|
30
|
+
- [Learn more about the Stack primitive](/components/primitives/stack/usage)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Inline
|
|
3
|
+
description: An Inline is a primitive component that is responsible for the horizontal layout of its child elements.
|
|
4
|
+
order: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Primitive components are designed to act as building blocks for composing a user experience. An Inline primitive should be used when you want to layout UI elements horizontally, and make use of the built-in design guidance from the Atlassian Design System.
|
|
8
|
+
|
|
9
|
+
Inline primitives work as you might expect, aligning content horizontally across a page or layout, as a container that decides the horizontal layout of its children. Inline components also decide the specifics of how the children are displayed, for example, where they are aligned or how much space is between child elements. Inline should be used purely for visual alignment, and should have no opinions about the functionality of its children.
|
|
10
|
+
|
|
11
|
+
In its simplest form, `Inline` operates like a flexbox row, however adds the built in design token support and guidance.
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<Inline space="space.100" alignInline="center" alignBlock="start">
|
|
15
|
+
...
|
|
16
|
+
</Inline>
|
|
17
|
+
```
|
|
18
|
+
It also has a flex-direction: row; but that’s the default, so not explicitly applied.
|
|
19
|
+
|
|
20
|
+
## Use `Inline`
|
|
21
|
+
The purpose of an Inline is primarily as a container element controlling how child components are displayed and positioned horizontally. Inline should be used any time you wish to layout elements or components horizontally.
|
|
22
|
+
|
|
23
|
+
The various Inline props can then be used to customize the spacing and styling on any child elements. These include:
|
|
24
|
+
|
|
25
|
+
- `alignBlock`
|
|
26
|
+
- `alignInline`
|
|
27
|
+
- `shouldWrap`
|
|
28
|
+
- `spread`
|
|
29
|
+
- `grow`
|
|
30
|
+
- `space`
|
|
31
|
+
- `rowSpace`
|
|
32
|
+
- `separator`
|
|
33
|
+
|
|
34
|
+
## Related
|
|
35
|
+
- [Learn more about the Box primitive](/components/primitives/box/usage)
|
|
36
|
+
- [Learn more about the Stack primitive](/components/primitives/stack/usage)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Primitives
|
|
3
|
+
description: Primitives are composable components that solve common layout problems.
|
|
4
|
+
|
|
5
|
+
order: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import SectionMessage from '@atlaskit/section-message';
|
|
9
|
+
import Image from '@atlaskit/image';
|
|
10
|
+
|
|
11
|
+
import boxUsageExample from './images/box-usage-example.png';
|
|
12
|
+
import inlineUsageExample from './images/inline-usage-example.png';
|
|
13
|
+
import stackUsageExample from './images/stack-usage-example.png';
|
|
14
|
+
|
|
15
|
+
<SectionMessage title="This is a preview of our new primitive components." appearance="warning">
|
|
16
|
+
Expect frequent changes as we iterate over the coming months. For early access and release updates for Atlassian employees, see details.
|
|
17
|
+
</SectionMessage>
|
|
18
|
+
|
|
19
|
+
Primitive components are a new type of component for layouts and placement of elements. They act as building blocks to compose different parts of the user experience, from the smallest design decisions (for example, the spacing around an icon) to larger layout decisions (for example, how a page is structured).
|
|
20
|
+
|
|
21
|
+
Primitives are designed to work hand in hand with design tokens, to provide opinionated solutions for common low-level design decisions that engineers often have to make. They are designed to reduce cognitive overhead for engineers by providing guardrails around what is recommended within our design system.
|
|
22
|
+
|
|
23
|
+
A primitive component is a pre-built solution in that they will only accept values that are valid in the Atlassian Design System, and help to implement common layout patterns. This reduces the need to look up documentation and write custom CSS.
|
|
24
|
+
|
|
25
|
+
## Available Primitives
|
|
26
|
+
|
|
27
|
+
Each primitive is designed to have a single responsibility, and it should be immediately clear where each primitive should be used. However, they are also flexible enough that they should be able to be used to compose complex designs not otherwise covered in the Design Systems.
|
|
28
|
+
|
|
29
|
+
Currently, three primitive components are available for use in Closed Beta they are Box, Inline and Stack. These were chosen because a large amount of layout problems can be reduced to laying out content:
|
|
30
|
+
- in a container (see [box](/components/primitives/box))
|
|
31
|
+
- horizontally (see [inline](/components/primitives/inline))
|
|
32
|
+
- vertically (see [stack](/components/primitives/stack))
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
To install primitive components, add @atlaskit/primitives as a dependency on your project:
|
|
37
|
+
```bash
|
|
38
|
+
$ yarn add @atlaskit/primitives
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Using Primitives
|
|
42
|
+
|
|
43
|
+
Use primitives for general layout styles for components. Primitives are not currently available in Figma, so the first step in implementing primitive components is identifying where they might fit in a given design. This involves breaking down a design into its core layout components to as granular level as is useful.
|
|
44
|
+
|
|
45
|
+
<SectionMessage appearance="warning">
|
|
46
|
+
Primitives could be skipped where absolute DOM control is required or very specific styling values are needed, however, this approach is more likely to produce visual elements that fail to adhere to the guidelines of the Atlassian Design System.
|
|
47
|
+
</SectionMessage>
|
|
48
|
+
|
|
49
|
+
You might like to think first about breaking down a page into Box containers, identifying larger pieces of a design that function in a similar manner or fulfill a singular purpose in a layout and grouping them together under a Box.
|
|
50
|
+
|
|
51
|
+
<Image src={boxUsageExample} />
|
|
52
|
+
|
|
53
|
+
The behavior within and around these boxes can then be broken down into their horizontal Inline and vertical Stack components.
|
|
54
|
+
|
|
55
|
+
<SectionMessage>
|
|
56
|
+
The ESLint rule use-primitives offers suggestions for possible primitives in a layout.
|
|
57
|
+
</SectionMessage>
|
|
58
|
+
|
|
59
|
+
<Image src={inlineUsageExample} />
|
|
60
|
+
<Image src={stackUsageExample} />
|
|
61
|
+
|
|
62
|
+
## Related
|
|
63
|
+
|
|
64
|
+
- [Learn more about the Box primitive](/components/primitives/box/usage)
|
|
65
|
+
- [Learn more about the Inline primitive](/components/primitives/inline/usage)
|
|
66
|
+
- [Learn more about the Stack primitive](/components/primitives/stack/usage)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Stack
|
|
3
|
+
description: A Stack is a primitive component that is responsible for the vertical layout of its child elements.
|
|
4
|
+
order: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Primitive components are designed to act as building blocks for composing a user experience. A `Stack` primitive should be used when you want to layout UI elements vertically, and make use of the built-in design guidance from the Atlassian Design System.
|
|
8
|
+
|
|
9
|
+
`Stack` primitives work by aligning content vertically on a page or layout, as a container that decides the vertical layout of its children. `Stack` components also decide the specifics of how the children are displayed, for example, where they are aligned or how much space is between child elements. `Stack` should be used purely for visual alignment, and should have no opinions about the functionality of its children.
|
|
10
|
+
|
|
11
|
+
In its simplest form, `Stack` operates like a flexbox column, however adds the built in design token support and guidance.
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<Stack space="space.100" alignInline="center" alignBlock="start">
|
|
15
|
+
...
|
|
16
|
+
</Stack>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Use `Stack`
|
|
20
|
+
The purpose of a `Stack` is primarily as a container element controlling how content is displayed and aligned vertically. `Stack` should be used any time you wish to layout elements or components vertically.
|
|
21
|
+
|
|
22
|
+
The various `Stack` props can then be used to customize the spacing and styling on any child elements. These include:
|
|
23
|
+
- `alignBlock`
|
|
24
|
+
- `alignInline`
|
|
25
|
+
- `spread`
|
|
26
|
+
- `grow`
|
|
27
|
+
- `space`
|
|
28
|
+
|
|
29
|
+
## Related
|
|
30
|
+
- [Learn more about the Box primitive](/primitives/box/usage)
|
|
31
|
+
- [Learn more about the Stack primitive](/primitives/box/usage)
|
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.positionMap = exports.paddingStylesMap = exports.
|
|
7
|
+
exports.textColorMap = exports.spaceStylesMap = exports.spaceMap = exports.shadowMap = exports.positionMap = exports.paddingStylesMap = exports.overflowMap = exports.overflowInlineMap = exports.overflowBlockMap = exports.layerMap = exports.flexShrinkMap = exports.flexMap = exports.flexGrowMap = exports.flexDirectionMap = exports.fillMap = exports.displayMap = exports.dimensionMap = exports.borderWidthMap = exports.borderStyleMap = exports.borderRadiusMap = exports.borderColorMap = exports.backgroundColorStylesMap = exports.backgroundColorMap = exports.alignSelfMap = 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::7d4a8604dc454e30c0fec5c1330ea7c5>>
|
|
13
13
|
* @codegenId dimensions
|
|
14
14
|
* @codegenCommand yarn codegen-styles
|
|
15
15
|
* @codegenParams ["dimensions"]
|
|
16
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
16
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
17
17
|
*/
|
|
18
18
|
var dimensionMap = {
|
|
19
19
|
'100%': '100%',
|
|
@@ -32,29 +32,11 @@ exports.dimensionMap = dimensionMap;
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
35
|
-
* @codegen <<SignedSource::
|
|
35
|
+
* @codegen <<SignedSource::9fbc4dfcd8f43f52bff6b3bb666397fe>>
|
|
36
36
|
* @codegenId spacing
|
|
37
37
|
* @codegenCommand yarn codegen-styles
|
|
38
|
-
* @codegenParams ["padding", "space", "inset"]
|
|
39
38
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
40
39
|
*/
|
|
41
|
-
var paddingMap = {
|
|
42
|
-
'space.0': "var(--ds-space-0, 0px)",
|
|
43
|
-
'space.025': "var(--ds-space-025, 2px)",
|
|
44
|
-
'space.050': "var(--ds-space-050, 4px)",
|
|
45
|
-
'space.075': "var(--ds-space-075, 6px)",
|
|
46
|
-
'space.100': "var(--ds-space-100, 8px)",
|
|
47
|
-
'space.150': "var(--ds-space-150, 12px)",
|
|
48
|
-
'space.200': "var(--ds-space-200, 16px)",
|
|
49
|
-
'space.250': "var(--ds-space-250, 20px)",
|
|
50
|
-
'space.300': "var(--ds-space-300, 24px)",
|
|
51
|
-
'space.400': "var(--ds-space-400, 32px)",
|
|
52
|
-
'space.500': "var(--ds-space-500, 40px)",
|
|
53
|
-
'space.600': "var(--ds-space-600, 48px)",
|
|
54
|
-
'space.800': "var(--ds-space-800, 64px)",
|
|
55
|
-
'space.1000': "var(--ds-space-1000, 80px)"
|
|
56
|
-
};
|
|
57
|
-
exports.paddingMap = paddingMap;
|
|
58
40
|
var spaceMap = {
|
|
59
41
|
'space.0': "var(--ds-space-0, 0px)",
|
|
60
42
|
'space.025': "var(--ds-space-025, 2px)",
|
|
@@ -72,33 +54,16 @@ var spaceMap = {
|
|
|
72
54
|
'space.1000': "var(--ds-space-1000, 80px)"
|
|
73
55
|
};
|
|
74
56
|
exports.spaceMap = spaceMap;
|
|
75
|
-
var insetMap = {
|
|
76
|
-
'space.0': "var(--ds-space-0, 0px)",
|
|
77
|
-
'space.025': "var(--ds-space-025, 2px)",
|
|
78
|
-
'space.050': "var(--ds-space-050, 4px)",
|
|
79
|
-
'space.075': "var(--ds-space-075, 6px)",
|
|
80
|
-
'space.100': "var(--ds-space-100, 8px)",
|
|
81
|
-
'space.150': "var(--ds-space-150, 12px)",
|
|
82
|
-
'space.200': "var(--ds-space-200, 16px)",
|
|
83
|
-
'space.250': "var(--ds-space-250, 20px)",
|
|
84
|
-
'space.300': "var(--ds-space-300, 24px)",
|
|
85
|
-
'space.400': "var(--ds-space-400, 32px)",
|
|
86
|
-
'space.500': "var(--ds-space-500, 40px)",
|
|
87
|
-
'space.600': "var(--ds-space-600, 48px)",
|
|
88
|
-
'space.800': "var(--ds-space-800, 64px)",
|
|
89
|
-
'space.1000': "var(--ds-space-1000, 80px)"
|
|
90
|
-
};
|
|
91
|
-
exports.insetMap = insetMap;
|
|
92
57
|
/**
|
|
93
58
|
* @codegenEnd
|
|
94
59
|
*/
|
|
95
60
|
|
|
96
61
|
/**
|
|
97
62
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
98
|
-
* @codegen <<SignedSource::
|
|
63
|
+
* @codegen <<SignedSource::aa1cfa3cd24f141a85ac1e0b70dbd8a8>>
|
|
99
64
|
* @codegenId colors
|
|
100
65
|
* @codegenCommand yarn codegen-styles
|
|
101
|
-
* @codegenParams ["border", "background", "shadow", "text"]
|
|
66
|
+
* @codegenParams ["border", "background", "shadow", "text", "fill"]
|
|
102
67
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
103
68
|
*/
|
|
104
69
|
var borderColorMap = {
|
|
@@ -275,19 +240,43 @@ var textColorMap = {
|
|
|
275
240
|
subtle: "var(--ds-text-subtle, #42526E)"
|
|
276
241
|
};
|
|
277
242
|
exports.textColorMap = textColorMap;
|
|
243
|
+
var fillMap = {
|
|
244
|
+
'color.icon': "var(--ds-icon, #505F79)",
|
|
245
|
+
'accent.red': "var(--ds-icon-accent-red, #FF5630)",
|
|
246
|
+
'accent.orange': "var(--ds-icon-accent-orange, #D94008)",
|
|
247
|
+
'accent.yellow': "var(--ds-icon-accent-yellow, #FFAB00)",
|
|
248
|
+
'accent.green': "var(--ds-icon-accent-green, #36B37E)",
|
|
249
|
+
'accent.teal': "var(--ds-icon-accent-teal, #00B8D9)",
|
|
250
|
+
'accent.blue': "var(--ds-icon-accent-blue, #0065FF)",
|
|
251
|
+
'accent.purple': "var(--ds-icon-accent-purple, #6554C0)",
|
|
252
|
+
'accent.magenta': "var(--ds-icon-accent-magenta, #CD519D)",
|
|
253
|
+
'accent.gray': "var(--ds-icon-accent-gray, #5E6C84)",
|
|
254
|
+
disabled: "var(--ds-icon-disabled, #8993A4)",
|
|
255
|
+
inverse: "var(--ds-icon-inverse, #FFFFFF)",
|
|
256
|
+
selected: "var(--ds-icon-selected, #0052CC)",
|
|
257
|
+
brand: "var(--ds-icon-brand, #0065FF)",
|
|
258
|
+
danger: "var(--ds-icon-danger, #DE350B)",
|
|
259
|
+
warning: "var(--ds-icon-warning, #FFC400)",
|
|
260
|
+
'warning.inverse': "var(--ds-icon-warning-inverse, #253858)",
|
|
261
|
+
success: "var(--ds-icon-success, #00875A)",
|
|
262
|
+
discovery: "var(--ds-icon-discovery, #8777D9)",
|
|
263
|
+
information: "var(--ds-icon-information, #0747A6)",
|
|
264
|
+
subtle: "var(--ds-icon-subtle, #6B778C)"
|
|
265
|
+
};
|
|
266
|
+
exports.fillMap = fillMap;
|
|
278
267
|
/**
|
|
279
268
|
* @codegenEnd
|
|
280
269
|
*/
|
|
281
270
|
|
|
282
271
|
/**
|
|
283
272
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
284
|
-
* @codegen <<SignedSource::
|
|
273
|
+
* @codegen <<SignedSource::64f7b08cdbce710fba3157594ea695a8>>
|
|
285
274
|
* @codegenId misc
|
|
286
275
|
* @codegenCommand yarn codegen-styles
|
|
287
276
|
* @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
288
277
|
* @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
|
|
289
278
|
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
290
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
279
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
291
280
|
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
|
|
292
281
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
293
282
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
@@ -402,7 +391,12 @@ var borderRadiusMap = {
|
|
|
402
391
|
* @codegenEnd
|
|
403
392
|
*/
|
|
404
393
|
exports.borderRadiusMap = borderRadiusMap;
|
|
405
|
-
|
|
394
|
+
// Generate maps for Box props. backgroundColor, padding, etc
|
|
395
|
+
var spacingProperties = [
|
|
396
|
+
// Used by Box
|
|
397
|
+
'padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd',
|
|
398
|
+
// Used by Inline and Stack
|
|
399
|
+
'gap', 'rowGap', 'columnGap'];
|
|
406
400
|
var getSerializedStylesMap = function getSerializedStylesMap(cssProperty, tokenMap) {
|
|
407
401
|
return Object.keys(tokenMap).reduce(function (emotionSpacingMap, token) {
|
|
408
402
|
emotionSpacingMap[token] = (0, _react.css)((0, _defineProperty2.default)({}, cssProperty, tokenMap[token]));
|
|
@@ -410,7 +404,7 @@ var getSerializedStylesMap = function getSerializedStylesMap(cssProperty, tokenM
|
|
|
410
404
|
}, {});
|
|
411
405
|
};
|
|
412
406
|
var paddingStylesMap = spacingProperties.reduce(function (styleMap, spacingProperty) {
|
|
413
|
-
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty,
|
|
407
|
+
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty, spaceMap);
|
|
414
408
|
return styleMap;
|
|
415
409
|
}, {});
|
|
416
410
|
exports.paddingStylesMap = paddingStylesMap;
|
package/dist/cjs/xcss/xcss.js
CHANGED
|
@@ -27,6 +27,7 @@ var tokensMap = {
|
|
|
27
27
|
color: _styleMaps.textColorMap,
|
|
28
28
|
columnGap: _styleMaps.spaceMap,
|
|
29
29
|
display: _styleMaps.displayMap,
|
|
30
|
+
fill: _styleMaps.fillMap,
|
|
30
31
|
flex: _styleMaps.flexMap,
|
|
31
32
|
flexDirection: _styleMaps.flexDirectionMap,
|
|
32
33
|
flexGrow: _styleMaps.flexGrowMap,
|
|
@@ -34,13 +35,13 @@ var tokensMap = {
|
|
|
34
35
|
gap: _styleMaps.spaceMap,
|
|
35
36
|
height: _styleMaps.dimensionMap,
|
|
36
37
|
inlineSize: _styleMaps.dimensionMap,
|
|
37
|
-
inset: _styleMaps.
|
|
38
|
-
insetBlock: _styleMaps.
|
|
39
|
-
insetBlockEnd: _styleMaps.
|
|
40
|
-
insetBlockStart: _styleMaps.
|
|
41
|
-
insetInline: _styleMaps.
|
|
42
|
-
insetInlineEnd: _styleMaps.
|
|
43
|
-
insetInlineStart: _styleMaps.
|
|
38
|
+
inset: _styleMaps.spaceMap,
|
|
39
|
+
insetBlock: _styleMaps.spaceMap,
|
|
40
|
+
insetBlockEnd: _styleMaps.spaceMap,
|
|
41
|
+
insetBlockStart: _styleMaps.spaceMap,
|
|
42
|
+
insetInline: _styleMaps.spaceMap,
|
|
43
|
+
insetInlineEnd: _styleMaps.spaceMap,
|
|
44
|
+
insetInlineStart: _styleMaps.spaceMap,
|
|
44
45
|
left: _styleMaps.dimensionMap,
|
|
45
46
|
maxBlockSize: _styleMaps.dimensionMap,
|
|
46
47
|
maxHeight: _styleMaps.dimensionMap,
|
|
@@ -50,23 +51,23 @@ var tokensMap = {
|
|
|
50
51
|
minHeight: _styleMaps.dimensionMap,
|
|
51
52
|
minInlineSize: _styleMaps.dimensionMap,
|
|
52
53
|
minWidth: _styleMaps.dimensionMap,
|
|
53
|
-
outlineOffset: _styleMaps.
|
|
54
|
+
outlineOffset: _styleMaps.spaceMap,
|
|
54
55
|
outlineWidth: _styleMaps.borderWidthMap,
|
|
55
56
|
outlineColor: _styleMaps.borderColorMap,
|
|
56
57
|
overflow: _styleMaps.overflowMap,
|
|
57
58
|
overflowBlock: _styleMaps.overflowBlockMap,
|
|
58
59
|
overflowInline: _styleMaps.overflowInlineMap,
|
|
59
|
-
padding: _styleMaps.
|
|
60
|
-
paddingBlock: _styleMaps.
|
|
61
|
-
paddingBlockEnd: _styleMaps.
|
|
62
|
-
paddingBlockStart: _styleMaps.
|
|
63
|
-
paddingBottom: _styleMaps.
|
|
64
|
-
paddingInline: _styleMaps.
|
|
65
|
-
paddingInlineEnd: _styleMaps.
|
|
66
|
-
paddingInlineStart: _styleMaps.
|
|
67
|
-
paddingLeft: _styleMaps.
|
|
68
|
-
paddingRight: _styleMaps.
|
|
69
|
-
paddingTop: _styleMaps.
|
|
60
|
+
padding: _styleMaps.spaceMap,
|
|
61
|
+
paddingBlock: _styleMaps.spaceMap,
|
|
62
|
+
paddingBlockEnd: _styleMaps.spaceMap,
|
|
63
|
+
paddingBlockStart: _styleMaps.spaceMap,
|
|
64
|
+
paddingBottom: _styleMaps.spaceMap,
|
|
65
|
+
paddingInline: _styleMaps.spaceMap,
|
|
66
|
+
paddingInlineEnd: _styleMaps.spaceMap,
|
|
67
|
+
paddingInlineStart: _styleMaps.spaceMap,
|
|
68
|
+
paddingLeft: _styleMaps.spaceMap,
|
|
69
|
+
paddingRight: _styleMaps.spaceMap,
|
|
70
|
+
paddingTop: _styleMaps.spaceMap,
|
|
70
71
|
position: _styleMaps.positionMap,
|
|
71
72
|
right: _styleMaps.dimensionMap,
|
|
72
73
|
rowGap: _styleMaps.spaceMap,
|
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::7d4a8604dc454e30c0fec5c1330ea7c5>>
|
|
5
5
|
* @codegenId dimensions
|
|
6
6
|
* @codegenCommand yarn codegen-styles
|
|
7
7
|
* @codegenParams ["dimensions"]
|
|
8
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
9
9
|
*/
|
|
10
10
|
export const dimensionMap = {
|
|
11
11
|
'100%': '100%',
|
|
@@ -22,28 +22,11 @@ export const dimensionMap = {
|
|
|
22
22
|
*/
|
|
23
23
|
/**
|
|
24
24
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
25
|
-
* @codegen <<SignedSource::
|
|
25
|
+
* @codegen <<SignedSource::9fbc4dfcd8f43f52bff6b3bb666397fe>>
|
|
26
26
|
* @codegenId spacing
|
|
27
27
|
* @codegenCommand yarn codegen-styles
|
|
28
|
-
* @codegenParams ["padding", "space", "inset"]
|
|
29
28
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
30
29
|
*/
|
|
31
|
-
export const paddingMap = {
|
|
32
|
-
'space.0': "var(--ds-space-0, 0px)",
|
|
33
|
-
'space.025': "var(--ds-space-025, 2px)",
|
|
34
|
-
'space.050': "var(--ds-space-050, 4px)",
|
|
35
|
-
'space.075': "var(--ds-space-075, 6px)",
|
|
36
|
-
'space.100': "var(--ds-space-100, 8px)",
|
|
37
|
-
'space.150': "var(--ds-space-150, 12px)",
|
|
38
|
-
'space.200': "var(--ds-space-200, 16px)",
|
|
39
|
-
'space.250': "var(--ds-space-250, 20px)",
|
|
40
|
-
'space.300': "var(--ds-space-300, 24px)",
|
|
41
|
-
'space.400': "var(--ds-space-400, 32px)",
|
|
42
|
-
'space.500': "var(--ds-space-500, 40px)",
|
|
43
|
-
'space.600': "var(--ds-space-600, 48px)",
|
|
44
|
-
'space.800': "var(--ds-space-800, 64px)",
|
|
45
|
-
'space.1000': "var(--ds-space-1000, 80px)"
|
|
46
|
-
};
|
|
47
30
|
export const spaceMap = {
|
|
48
31
|
'space.0': "var(--ds-space-0, 0px)",
|
|
49
32
|
'space.025': "var(--ds-space-025, 2px)",
|
|
@@ -60,31 +43,15 @@ export const spaceMap = {
|
|
|
60
43
|
'space.800': "var(--ds-space-800, 64px)",
|
|
61
44
|
'space.1000': "var(--ds-space-1000, 80px)"
|
|
62
45
|
};
|
|
63
|
-
export const insetMap = {
|
|
64
|
-
'space.0': "var(--ds-space-0, 0px)",
|
|
65
|
-
'space.025': "var(--ds-space-025, 2px)",
|
|
66
|
-
'space.050': "var(--ds-space-050, 4px)",
|
|
67
|
-
'space.075': "var(--ds-space-075, 6px)",
|
|
68
|
-
'space.100': "var(--ds-space-100, 8px)",
|
|
69
|
-
'space.150': "var(--ds-space-150, 12px)",
|
|
70
|
-
'space.200': "var(--ds-space-200, 16px)",
|
|
71
|
-
'space.250': "var(--ds-space-250, 20px)",
|
|
72
|
-
'space.300': "var(--ds-space-300, 24px)",
|
|
73
|
-
'space.400': "var(--ds-space-400, 32px)",
|
|
74
|
-
'space.500': "var(--ds-space-500, 40px)",
|
|
75
|
-
'space.600': "var(--ds-space-600, 48px)",
|
|
76
|
-
'space.800': "var(--ds-space-800, 64px)",
|
|
77
|
-
'space.1000': "var(--ds-space-1000, 80px)"
|
|
78
|
-
};
|
|
79
46
|
/**
|
|
80
47
|
* @codegenEnd
|
|
81
48
|
*/
|
|
82
49
|
/**
|
|
83
50
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
84
|
-
* @codegen <<SignedSource::
|
|
51
|
+
* @codegen <<SignedSource::aa1cfa3cd24f141a85ac1e0b70dbd8a8>>
|
|
85
52
|
* @codegenId colors
|
|
86
53
|
* @codegenCommand yarn codegen-styles
|
|
87
|
-
* @codegenParams ["border", "background", "shadow", "text"]
|
|
54
|
+
* @codegenParams ["border", "background", "shadow", "text", "fill"]
|
|
88
55
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
89
56
|
*/
|
|
90
57
|
export const borderColorMap = {
|
|
@@ -257,18 +224,41 @@ export const textColorMap = {
|
|
|
257
224
|
subtlest: "var(--ds-text-subtlest, #7A869A)",
|
|
258
225
|
subtle: "var(--ds-text-subtle, #42526E)"
|
|
259
226
|
};
|
|
227
|
+
export const fillMap = {
|
|
228
|
+
'color.icon': "var(--ds-icon, #505F79)",
|
|
229
|
+
'accent.red': "var(--ds-icon-accent-red, #FF5630)",
|
|
230
|
+
'accent.orange': "var(--ds-icon-accent-orange, #D94008)",
|
|
231
|
+
'accent.yellow': "var(--ds-icon-accent-yellow, #FFAB00)",
|
|
232
|
+
'accent.green': "var(--ds-icon-accent-green, #36B37E)",
|
|
233
|
+
'accent.teal': "var(--ds-icon-accent-teal, #00B8D9)",
|
|
234
|
+
'accent.blue': "var(--ds-icon-accent-blue, #0065FF)",
|
|
235
|
+
'accent.purple': "var(--ds-icon-accent-purple, #6554C0)",
|
|
236
|
+
'accent.magenta': "var(--ds-icon-accent-magenta, #CD519D)",
|
|
237
|
+
'accent.gray': "var(--ds-icon-accent-gray, #5E6C84)",
|
|
238
|
+
disabled: "var(--ds-icon-disabled, #8993A4)",
|
|
239
|
+
inverse: "var(--ds-icon-inverse, #FFFFFF)",
|
|
240
|
+
selected: "var(--ds-icon-selected, #0052CC)",
|
|
241
|
+
brand: "var(--ds-icon-brand, #0065FF)",
|
|
242
|
+
danger: "var(--ds-icon-danger, #DE350B)",
|
|
243
|
+
warning: "var(--ds-icon-warning, #FFC400)",
|
|
244
|
+
'warning.inverse': "var(--ds-icon-warning-inverse, #253858)",
|
|
245
|
+
success: "var(--ds-icon-success, #00875A)",
|
|
246
|
+
discovery: "var(--ds-icon-discovery, #8777D9)",
|
|
247
|
+
information: "var(--ds-icon-information, #0747A6)",
|
|
248
|
+
subtle: "var(--ds-icon-subtle, #6B778C)"
|
|
249
|
+
};
|
|
260
250
|
/**
|
|
261
251
|
* @codegenEnd
|
|
262
252
|
*/
|
|
263
253
|
/**
|
|
264
254
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
265
|
-
* @codegen <<SignedSource::
|
|
255
|
+
* @codegen <<SignedSource::64f7b08cdbce710fba3157594ea695a8>>
|
|
266
256
|
* @codegenId misc
|
|
267
257
|
* @codegenCommand yarn codegen-styles
|
|
268
258
|
* @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
269
259
|
* @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
|
|
270
260
|
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
271
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
261
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
272
262
|
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
|
|
273
263
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
274
264
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
@@ -369,7 +359,12 @@ export const borderRadiusMap = {
|
|
|
369
359
|
* @codegenEnd
|
|
370
360
|
*/
|
|
371
361
|
|
|
372
|
-
|
|
362
|
+
// Generate maps for Box props. backgroundColor, padding, etc
|
|
363
|
+
const spacingProperties = [
|
|
364
|
+
// Used by Box
|
|
365
|
+
'padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd',
|
|
366
|
+
// Used by Inline and Stack
|
|
367
|
+
'gap', 'rowGap', 'columnGap'];
|
|
373
368
|
const getSerializedStylesMap = (cssProperty, tokenMap) => {
|
|
374
369
|
return Object.keys(tokenMap).reduce((emotionSpacingMap, token) => {
|
|
375
370
|
emotionSpacingMap[token] = css({
|
|
@@ -379,7 +374,7 @@ const getSerializedStylesMap = (cssProperty, tokenMap) => {
|
|
|
379
374
|
}, {});
|
|
380
375
|
};
|
|
381
376
|
export const paddingStylesMap = spacingProperties.reduce((styleMap, spacingProperty) => {
|
|
382
|
-
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty,
|
|
377
|
+
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty, spaceMap);
|
|
383
378
|
return styleMap;
|
|
384
379
|
}, {});
|
|
385
380
|
export const spaceStylesMap = spacingProperties.reduce((styleMap, spacingProperty) => {
|