@atlaskit/primitives 7.0.0 → 7.0.2
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/.eslintrc.js +1 -1
- package/CHANGELOG.md +19 -1
- package/LICENSE.md +6 -8
- package/constellation/anchor/code.mdx +3 -3
- package/constellation/anchor/examples.mdx +33 -39
- package/constellation/anchor/usage.mdx +60 -30
- package/constellation/bleed/code.mdx +3 -3
- package/constellation/bleed/examples.mdx +17 -13
- package/constellation/box/code.mdx +3 -3
- package/constellation/box/examples.mdx +25 -19
- package/constellation/box/usage.mdx +15 -5
- package/constellation/flex/code.mdx +3 -3
- package/constellation/flex/examples.mdx +12 -11
- package/constellation/grid/code.mdx +3 -3
- package/constellation/grid/examples.mdx +15 -10
- package/constellation/inline/code.mdx +3 -3
- package/constellation/inline/examples.mdx +32 -38
- package/constellation/inline/usage.mdx +15 -6
- package/constellation/overview/index.mdx +29 -27
- package/constellation/pressable/code.mdx +5 -4
- package/constellation/pressable/examples.mdx +41 -55
- package/constellation/pressable/usage.mdx +59 -36
- package/constellation/responsive/01-show/code.mdx +3 -3
- package/constellation/responsive/01-show/examples.mdx +9 -13
- package/constellation/responsive/02-hide/code.mdx +3 -3
- package/constellation/responsive/02-hide/examples.mdx +9 -13
- package/constellation/responsive/03-breakpoints/examples.mdx +3 -3
- package/constellation/responsive/examples.mdx +10 -10
- package/constellation/responsive/usage.mdx +23 -15
- package/constellation/stack/code.mdx +3 -3
- package/constellation/stack/examples.mdx +26 -20
- package/constellation/stack/usage.mdx +13 -5
- package/constellation/text/code.mdx +3 -3
- package/constellation/text/examples.mdx +29 -15
- package/constellation/text/usage.mdx +6 -3
- package/constellation/xcss/examples.mdx +7 -5
- package/constellation/xcss/migration.mdx +32 -25
- package/constellation/xcss/usage.mdx +72 -60
- package/dist/cjs/components/anchor.js +4 -4
- package/dist/cjs/components/pressable.js +1 -1
- package/dist/cjs/xcss/style-maps.partial.js +13 -13
- package/dist/es2019/components/anchor.js +4 -4
- package/dist/es2019/components/pressable.js +1 -1
- package/dist/es2019/xcss/style-maps.partial.js +13 -13
- package/dist/esm/components/anchor.js +4 -4
- package/dist/esm/components/pressable.js +1 -1
- package/dist/esm/xcss/style-maps.partial.js +13 -13
- package/dist/types/components/anchor.d.ts +4 -4
- package/dist/types/responsive/index.d.ts +2 -2
- package/dist/types/xcss/style-maps.partial.d.ts +13 -13
- package/dist/types-ts4.5/components/anchor.d.ts +4 -4
- package/dist/types-ts4.5/responsive/index.d.ts +2 -2
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +13 -13
- package/extract-react-types/anchor-props.tsx +108 -116
- package/extract-react-types/bleed-props.tsx +17 -22
- package/extract-react-types/box-props.tsx +67 -70
- package/extract-react-types/flex-props.tsx +61 -61
- package/extract-react-types/grid-props.tsx +92 -92
- package/extract-react-types/hide-props.tsx +35 -35
- package/extract-react-types/inline-props.tsx +68 -68
- package/extract-react-types/pressable-props.tsx +101 -107
- package/extract-react-types/show-props.tsx +35 -35
- package/extract-react-types/stack-props.tsx +55 -55
- package/package.json +2 -2
- package/report.api.md +940 -965
- package/scripts/border-codegen-template.tsx +40 -47
- package/scripts/codegen-file-templates/dimensions.tsx +8 -8
- package/scripts/codegen-file-templates/layer.tsx +9 -9
- package/scripts/codegen-styles.tsx +97 -103
- package/scripts/color-codegen-template.tsx +61 -73
- package/scripts/elevation-codegen-template.tsx +50 -62
- package/scripts/inverse-color-map-template.tsx +26 -31
- package/scripts/misc-codegen-template.tsx +4 -9
- package/scripts/spacing-codegen-template.tsx +25 -31
- package/scripts/typography-codegen-template.tsx +59 -65
- package/scripts/utils.tsx +36 -43
|
@@ -6,11 +6,14 @@ order: 2
|
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
Use the text component for all non-heading text, including main content, detailed descriptions, and
|
|
9
|
+
Use the text component for all non-heading text, including main content, detailed descriptions, and
|
|
10
|
+
text in components.
|
|
10
11
|
|
|
11
|
-
For each size, a specific line height is automatically set ensuring text is compliant with
|
|
12
|
+
For each size, a specific line height is automatically set ensuring text is compliant with
|
|
13
|
+
accessibility standards.
|
|
12
14
|
|
|
13
|
-
Read more usage guidance for body text in our
|
|
15
|
+
Read more usage guidance for body text in our
|
|
16
|
+
[Typography foundations](/foundations/typography-beta#body).
|
|
14
17
|
|
|
15
18
|
## Accessibility
|
|
16
19
|
|
|
@@ -12,9 +12,9 @@ import xcssConditional from '../../examples/constellation/xcss/conditional-style
|
|
|
12
12
|
import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
13
13
|
|
|
14
14
|
<CodeDocsHeader
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
name="@atlaskit/primitives"
|
|
16
|
+
repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
|
|
17
|
+
directoryName="primitives"
|
|
18
18
|
/>
|
|
19
19
|
|
|
20
20
|
## Basic
|
|
@@ -31,12 +31,14 @@ To enable interactivity, use familiar selectors like `:hover` and `:focus-visibl
|
|
|
31
31
|
|
|
32
32
|
## Responsiveness
|
|
33
33
|
|
|
34
|
-
XCSS also accepts a subset of media queries at
|
|
34
|
+
XCSS also accepts a subset of media queries at
|
|
35
|
+
[predefined breakpoints](/components/primitives/responsive/breakpoints/examples).
|
|
35
36
|
|
|
36
37
|
<Example Component={xcssResponsive} packageName="@atlaskit/primitives/xcss" />
|
|
37
38
|
|
|
38
39
|
## Conditional styles
|
|
39
40
|
|
|
40
|
-
For conditional styles, try composing styles together via the array with ternary or boolean
|
|
41
|
+
For conditional styles, try composing styles together via the array with ternary or boolean
|
|
42
|
+
operators.
|
|
41
43
|
|
|
42
44
|
<Example Component={xcssConditional} packageName="@atlaskit/primitives/xcss" />
|
|
@@ -8,9 +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 XCSS.
|
|
12
|
-
|
|
13
|
-
tokenized values.
|
|
11
|
+
There are two key changes to be mindful of when migrating to XCSS. The first is updating callsites
|
|
12
|
+
to remove any nested styles and tokenized values.
|
|
14
13
|
|
|
15
14
|
```diff
|
|
16
15
|
- import { css } from '@emotion/react';
|
|
@@ -26,8 +25,9 @@ tokenized values.
|
|
|
26
25
|
});
|
|
27
26
|
```
|
|
28
27
|
|
|
29
|
-
The second change is that for the `xcss` function to be applied correctly it must be applied on a
|
|
30
|
-
|
|
28
|
+
The second change is that for the `xcss` function to be applied correctly it must be applied on a
|
|
29
|
+
component with an `xcss` JSXAttribute. This won't work with the `css` or `className` JSXAttributes,
|
|
30
|
+
be aware if you're not seeing your styles appear.
|
|
31
31
|
|
|
32
32
|
```diff
|
|
33
33
|
- <div css={someStyles} />
|
|
@@ -36,28 +36,32 @@ JSXAttributes, be aware if you're not seeing your styles appear.
|
|
|
36
36
|
|
|
37
37
|
### Changing the way you express styles
|
|
38
38
|
|
|
39
|
-
Why are nested selectors a problem? A key philosophy of XCSS is encouraging more deterministic style
|
|
39
|
+
Why are nested selectors a problem? A key philosophy of XCSS is encouraging more deterministic style
|
|
40
|
+
application. Restricting nested styles eliminates side-effects and encourages component
|
|
41
|
+
encapsulation. Consider the below example:
|
|
40
42
|
|
|
41
43
|
```tsx
|
|
42
44
|
const myComponentStyles = css({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
'> *': {
|
|
46
|
+
color: 'color.text.danger',
|
|
47
|
+
},
|
|
46
48
|
});
|
|
47
49
|
|
|
48
50
|
const MyComponent = () => (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
<div css={myComponentStyles}>
|
|
52
|
+
<p>Text here</p>
|
|
53
|
+
</div>
|
|
52
54
|
);
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
Here the component is applying styles that are implicitly meant for the text wrapped in the `p`
|
|
56
|
-
In this simple example, it may seem okay, desirable even, but cases like these often occur
|
|
57
|
+
Here the component is applying styles that are implicitly meant for the text wrapped in the `p`
|
|
58
|
+
below. In this simple example, it may seem okay, desirable even, but cases like these often occur
|
|
59
|
+
across module or component boundaries.
|
|
57
60
|
|
|
58
|
-
This makes the visibility of these dependencies harder to capture or reason about.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
This makes the visibility of these dependencies harder to capture or reason about. Styles that are
|
|
62
|
+
inherited or indirectly apply make a UI vulnerable to change and harder to maintain. Instead, if the
|
|
63
|
+
same styles are applied directly to the affected element this can minimize and in some cases
|
|
64
|
+
completely eliminate this problem.
|
|
61
65
|
|
|
62
66
|
```diff
|
|
63
67
|
const myTextStyles = xcss({
|
|
@@ -74,36 +78,39 @@ const MyComponent = () => (
|
|
|
74
78
|
);
|
|
75
79
|
```
|
|
76
80
|
|
|
77
|
-
There will likely be cases where nesting is the only option. While not desirable, nesting can be
|
|
81
|
+
There will likely be cases where nesting is the only option. While not desirable, nesting can be
|
|
82
|
+
used minimally, and when the potential impact is considered.
|
|
78
83
|
|
|
79
84
|
## FAQ
|
|
80
85
|
|
|
81
|
-
Migration to XCSS is simple for the majority of cases. Here are some common strategies for
|
|
86
|
+
Migration to XCSS is simple for the majority of cases. Here are some common strategies for
|
|
87
|
+
migrations.
|
|
82
88
|
|
|
83
89
|
### Non-tokenized values
|
|
84
90
|
|
|
85
|
-
Before migrating to tokens, there are two options. Migrate to tokens first and then on a second pass
|
|
91
|
+
Before migrating to tokens, there are two options. Migrate to tokens first and then on a second pass
|
|
92
|
+
migrate to XCSS or make the jump directly to use both tokens and XCSS.
|
|
86
93
|
|
|
87
94
|
```tsx
|
|
88
95
|
const someStyles = css({
|
|
89
|
-
|
|
96
|
+
color: 'red',
|
|
90
97
|
});
|
|
91
98
|
|
|
92
99
|
// ->>> Optional middle step
|
|
93
100
|
const someStyles = css({
|
|
94
|
-
|
|
101
|
+
color: token('color.text.danger'),
|
|
95
102
|
});
|
|
96
103
|
|
|
97
104
|
// ->>> The final state
|
|
98
105
|
const someStyles = xcss({
|
|
99
|
-
|
|
106
|
+
color: 'color.text.danger',
|
|
100
107
|
});
|
|
101
108
|
```
|
|
102
109
|
|
|
103
110
|
### Moving from the `styled` API
|
|
104
111
|
|
|
105
|
-
If currently using the `styled` API there are a few steps to migrate.
|
|
106
|
-
|
|
112
|
+
If currently using the `styled` API there are a few steps to migrate. The safest approach is to use
|
|
113
|
+
object styles, migrate to tokens (optionally) and then migrate to XCSS.
|
|
107
114
|
|
|
108
115
|
```tsx
|
|
109
116
|
const MyComponent = styled.div`
|
|
@@ -6,15 +6,20 @@ order: 0
|
|
|
6
6
|
|
|
7
7
|
import { MediaQueriesTable } from '@af/design-system-docs-ui';
|
|
8
8
|
|
|
9
|
-
XCSS is an Atlassian Design System styling API that natively integrates with Atlassian's
|
|
9
|
+
XCSS is an Atlassian Design System styling API that natively integrates with Atlassian's
|
|
10
|
+
[design tokens](/tokens) and [primitives](/components/primitives/overview).
|
|
10
11
|
|
|
11
|
-
To ensure future compliance with XCSS as it evolves over time, we highly recommend you enable our
|
|
12
|
+
To ensure future compliance with XCSS as it evolves over time, we highly recommend you enable our
|
|
13
|
+
ESLint plugins and adhere to the
|
|
14
|
+
[UI Styling Standard](/components/eslint-plugin-ui-styling-standard) guidelines by writing local,
|
|
15
|
+
type-safe, static styles.
|
|
12
16
|
|
|
13
17
|
- [@atlaskit/eslint-plugin-design-system](/components/eslint-plugin-design-system)
|
|
14
18
|
- [@atlaskit/eslint-plugin-ui-styling-standard](/components/eslint-plugin-ui-styling-standard)
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
The XCSS utility behaves similarly to the `css` utility in libraries like `styled-components`,
|
|
21
|
+
`@compiled` or `@emotion`, and is built off of `@emotion/react` today. If you've used these
|
|
22
|
+
libraries, XCSS will feel familiar, with a few additional features and constraints.
|
|
18
23
|
|
|
19
24
|
Familiar features:
|
|
20
25
|
|
|
@@ -24,7 +29,8 @@ Familiar features:
|
|
|
24
29
|
|
|
25
30
|
Key differences:
|
|
26
31
|
|
|
27
|
-
- XCSS has type-safety that ensures token name usage for all CSS properties represented by design
|
|
32
|
+
- XCSS has type-safety that ensures token name usage for all CSS properties represented by design
|
|
33
|
+
tokens
|
|
28
34
|
- XCSS restricts nested selectors completely from usage
|
|
29
35
|
|
|
30
36
|
## Usage
|
|
@@ -36,7 +42,7 @@ import { xcss } from '@atlaskit/primitives';
|
|
|
36
42
|
|
|
37
43
|
// Creates a basic style
|
|
38
44
|
const someStyles = xcss({
|
|
39
|
-
|
|
45
|
+
display: 'block',
|
|
40
46
|
});
|
|
41
47
|
```
|
|
42
48
|
|
|
@@ -47,105 +53,111 @@ import { Box, xcss } from '@atlaskit/primitives';
|
|
|
47
53
|
|
|
48
54
|
// Creates a basic style
|
|
49
55
|
const someStyles = xcss({
|
|
50
|
-
|
|
56
|
+
display: 'block',
|
|
51
57
|
});
|
|
52
58
|
|
|
53
59
|
const MyBox = () => {
|
|
54
|
-
|
|
60
|
+
return <Box xcss={someStyles} />;
|
|
55
61
|
};
|
|
56
62
|
```
|
|
57
63
|
|
|
58
64
|
The `xcss` prop and the `xcss` function are direct complements and are designed to be used together.
|
|
59
65
|
|
|
60
|
-
It is important to note that styles generated from `xcss` cannot be applied directly to the
|
|
66
|
+
It is important to note that styles generated from `xcss` cannot be applied directly to the
|
|
67
|
+
`className` property or `css` as they are with other CSS-in-JS libraries.
|
|
61
68
|
|
|
62
69
|
### Type safety
|
|
63
70
|
|
|
64
|
-
XCSS uses strongly-typed values generated from design token definitions, making it simpler to apply
|
|
65
|
-
This is intended to be more ergonomic and intuitive, but
|
|
71
|
+
XCSS uses strongly-typed values generated from design token definitions, making it simpler to apply
|
|
72
|
+
the right token to the right CSS property. This is intended to be more ergonomic and intuitive, but
|
|
73
|
+
also prevent the misapplication of tokens to the wrong properties.
|
|
66
74
|
|
|
67
75
|
Any [valid token name](/components/tokens/all-tokens) is available to be applied against its
|
|
68
|
-
matching CSS property. For example, the token name `space.200`
|
|
69
|
-
|
|
70
|
-
as a color, or a font.
|
|
76
|
+
matching CSS property. For example, the token name `space.200` is a valid value below for `padding`
|
|
77
|
+
but will not appear as a color, or a font.
|
|
71
78
|
|
|
72
79
|
```tsx
|
|
73
80
|
import { xcss } from '@atlaskit/primitives';
|
|
74
81
|
|
|
75
82
|
const someStyles = xcss({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
padding: 'space.200', // <--- works
|
|
84
|
+
color: 'space.200', // <--- invalid and will error
|
|
85
|
+
borderRadius: 'border.radius.100', // <--- also valid
|
|
79
86
|
});
|
|
80
87
|
```
|
|
81
88
|
|
|
82
89
|
### Restricted nesting
|
|
83
90
|
|
|
84
|
-
XCSS is flexible enough to implement any design, but it does restrict the application of styles in
|
|
85
|
-
Selectors cannot be nested or target elements beyond the element on which styles are
|
|
86
|
-
This restriction is intended to encourage better component encapsulation, reduce
|
|
91
|
+
XCSS is flexible enough to implement any design, but it does restrict the application of styles in
|
|
92
|
+
one key way. Selectors cannot be nested or target elements beyond the element on which styles are
|
|
93
|
+
applied. This restriction is intended to encourage better component encapsulation, reduce
|
|
94
|
+
side-effects and make the codebase more resilient to change.
|
|
87
95
|
|
|
88
96
|
```tsx
|
|
89
97
|
import { xcss } from '@atlaskit/primitives';
|
|
90
98
|
|
|
91
99
|
const someStyles = xcss({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
':hover': {
|
|
101
|
+
transform: 'scale(1)', // this is okay
|
|
102
|
+
},
|
|
103
|
+
// This is not okay as this selector affects any nested div in
|
|
104
|
+
// the component tree.
|
|
105
|
+
'div:hover': {
|
|
106
|
+
transform: 'scale(1)',
|
|
107
|
+
},
|
|
108
|
+
// Neither is this
|
|
109
|
+
'> * > div:hover': {
|
|
110
|
+
transform: 'scale(1)',
|
|
111
|
+
},
|
|
104
112
|
});
|
|
105
113
|
```
|
|
106
114
|
|
|
107
|
-
These unsafe selectors will throw a type error if applied.
|
|
108
|
-
|
|
115
|
+
These unsafe selectors will throw a type error if applied. Find richer examples of how to use XCSS
|
|
116
|
+
in the [XCSS examples](/components/primitives/xcss/examples).
|
|
109
117
|
|
|
110
118
|
### Media Queries
|
|
111
119
|
|
|
112
|
-
XCSS can create responsive layouts at predefined breakpoints that are consistent with the Atlassian
|
|
120
|
+
XCSS can create responsive layouts at predefined breakpoints that are consistent with the Atlassian
|
|
121
|
+
Design System. To enable responsive behavior, XCSS exposes the following pre-defined breakpoints:
|
|
113
122
|
|
|
114
123
|
<MediaQueriesTable />
|
|
115
124
|
|
|
116
|
-
Media queries can be applied through keys imported from `@atlaskit/primitives/responsive`.
|
|
117
|
-
|
|
125
|
+
Media queries can be applied through keys imported from `@atlaskit/primitives/responsive`. Find more
|
|
126
|
+
in depth examples on how to enable responsive behavior in the
|
|
127
|
+
[responsive documentation](/components/primitives/xcss/examples#responsiveness).
|
|
118
128
|
|
|
119
|
-
The objects defined at each breakpoint behave in much the same way as a normal XCSS object, and can
|
|
120
|
-
The only limitation is that a media query can't contain another
|
|
129
|
+
The objects defined at each breakpoint behave in much the same way as a normal XCSS object, and can
|
|
130
|
+
apply responsiveness to any CSS. The only limitation is that a media query can't contain another
|
|
131
|
+
media query. This is to prevent arbitrary nesting.
|
|
121
132
|
|
|
122
|
-
Additionally, pseudo-selectors can't contain media queries. To use media queries and pseudos, the
|
|
133
|
+
Additionally, pseudo-selectors can't contain media queries. To use media queries and pseudos, the
|
|
134
|
+
media query must contain the pseudo.
|
|
123
135
|
|
|
124
136
|
```tsx
|
|
125
137
|
import { xcss } from '@atlaskit/primitives';
|
|
126
138
|
import { media } from '@atlaskit/primitives/responsive';
|
|
127
139
|
|
|
128
140
|
const someStyles = xcss({
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
// This is okay, since media queries can contain pseudos
|
|
142
|
+
[media.above.md]: {
|
|
143
|
+
':hover': {
|
|
144
|
+
backgroundColor: 'color.background.primary.hovered',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
// This is not okay, we don't allow pseudos to contain media queries
|
|
149
|
+
':hover': {
|
|
150
|
+
[media.above.md]: {
|
|
151
|
+
backgroundColor: 'color.background.primary.hovered',
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
// This is not okay, since media queries can't contain media queries
|
|
156
|
+
[media.above.md]: {
|
|
157
|
+
[media.above.xs]: {
|
|
158
|
+
backgroundColor: 'color.background.primary.hovered',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
149
161
|
});
|
|
150
162
|
```
|
|
151
163
|
|
|
@@ -46,7 +46,7 @@ var focusRingStyles = (0, _xcss.xcss)({
|
|
|
46
46
|
});
|
|
47
47
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
48
48
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
49
|
-
var
|
|
49
|
+
var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
50
50
|
var href = _ref.href,
|
|
51
51
|
children = _ref.children,
|
|
52
52
|
backgroundColor = _ref.backgroundColor,
|
|
@@ -76,7 +76,7 @@ var Anchor = function Anchor(_ref, ref) {
|
|
|
76
76
|
action: 'clicked',
|
|
77
77
|
componentName: componentName || 'Anchor',
|
|
78
78
|
packageName: "@atlaskit/primitives",
|
|
79
|
-
packageVersion: "7.0.
|
|
79
|
+
packageVersion: "7.0.2",
|
|
80
80
|
analyticsData: analyticsContext,
|
|
81
81
|
actionSubject: 'link'
|
|
82
82
|
});
|
|
@@ -138,5 +138,5 @@ var Anchor = function Anchor(_ref, ref) {
|
|
|
138
138
|
* - [Code](https://atlassian.design/components/primitives/anchor/code)
|
|
139
139
|
* - [Usage](https://atlassian.design/components/primitives/anchor/usage)
|
|
140
140
|
*/
|
|
141
|
-
var
|
|
142
|
-
var _default = exports.default =
|
|
141
|
+
var Anchor = /*#__PURE__*/(0, _react.forwardRef)(AnchorNoRef);
|
|
142
|
+
var _default = exports.default = Anchor;
|
|
@@ -78,7 +78,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
78
78
|
action: 'clicked',
|
|
79
79
|
componentName: componentName || 'Pressable',
|
|
80
80
|
packageName: "@atlaskit/primitives",
|
|
81
|
-
packageVersion: "7.0.
|
|
81
|
+
packageVersion: "7.0.2",
|
|
82
82
|
analyticsData: analyticsContext,
|
|
83
83
|
actionSubject: 'button'
|
|
84
84
|
});
|
|
@@ -12,11 +12,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
13
|
/**
|
|
14
14
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
15
|
-
* @codegen <<SignedSource::
|
|
15
|
+
* @codegen <<SignedSource::c98c944b8a999cfc194a2cfe851d2433>>
|
|
16
16
|
* @codegenId dimensions
|
|
17
17
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
18
18
|
* @codegenParams ["dimensions"]
|
|
19
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
19
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
20
20
|
*/
|
|
21
21
|
var dimensionMap = exports.dimensionMap = {
|
|
22
22
|
'100%': '100%',
|
|
@@ -34,7 +34,7 @@ var dimensionMap = exports.dimensionMap = {
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
37
|
-
* @codegen <<SignedSource::
|
|
37
|
+
* @codegen <<SignedSource::0d3c08d703b8431712d7e238a3f7229b>>
|
|
38
38
|
* @codegenId spacing
|
|
39
39
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
40
40
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::55622b91aca9b3afac4bce440f222b71>>
|
|
@@ -73,7 +73,7 @@ var allSpaceMap = exports.allSpaceMap = _objectSpread(_objectSpread({}, positive
|
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
76
|
-
* @codegen <<SignedSource::
|
|
76
|
+
* @codegen <<SignedSource::dd33c75b34fe7374656f10b21ba9b161>>
|
|
77
77
|
* @codegenId inverse-colors
|
|
78
78
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
79
79
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f27d1519d51cc4a85383a00907847774>>
|
|
@@ -114,7 +114,7 @@ var inverseColorMap = exports.inverseColorMap = {
|
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
117
|
-
* @codegen <<SignedSource::
|
|
117
|
+
* @codegen <<SignedSource::fde38a9999e3a081afa4a517da815ede>>
|
|
118
118
|
* @codegenId elevation
|
|
119
119
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
120
120
|
* @codegenParams ["opacity", "shadow", "surface"]
|
|
@@ -149,7 +149,7 @@ var surfaceColorMap = exports.surfaceColorMap = {
|
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
152
|
-
* @codegen <<SignedSource::
|
|
152
|
+
* @codegen <<SignedSource::485e5a3659092381fa81ce940d43a939>>
|
|
153
153
|
* @codegenId colors
|
|
154
154
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
155
155
|
* @codegenParams ["border", "background", "text", "fill"]
|
|
@@ -446,12 +446,12 @@ var fillMap = exports.fillMap = {
|
|
|
446
446
|
|
|
447
447
|
/**
|
|
448
448
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
449
|
-
* @codegen <<SignedSource::
|
|
449
|
+
* @codegen <<SignedSource::28920e82ff201211ac94808a1fd821d4>>
|
|
450
450
|
* @codegenId misc
|
|
451
451
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
452
452
|
* @codegenParams ["layer"]
|
|
453
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
454
|
-
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::
|
|
453
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
454
|
+
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::6f10945ad9139d0119003738c65ae40a>>
|
|
455
455
|
*/
|
|
456
456
|
var layerMap = exports.layerMap = {
|
|
457
457
|
card: 100,
|
|
@@ -470,7 +470,7 @@ var layerMap = exports.layerMap = {
|
|
|
470
470
|
|
|
471
471
|
/**
|
|
472
472
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
473
|
-
* @codegen <<SignedSource::
|
|
473
|
+
* @codegen <<SignedSource::957baf1fa3fc3fe5eb06b497a7ba6599>>
|
|
474
474
|
* @codegenId border
|
|
475
475
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
476
476
|
* @codegenParams ["width", "radius"]
|
|
@@ -497,12 +497,12 @@ var borderRadiusMap = exports.borderRadiusMap = {
|
|
|
497
497
|
|
|
498
498
|
/**
|
|
499
499
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
500
|
-
* @codegen <<SignedSource::
|
|
500
|
+
* @codegen <<SignedSource::cd260411f17d54ff1ac7e627ef070ef4>>
|
|
501
501
|
* @codegenId typography
|
|
502
502
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
503
503
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
504
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
505
|
-
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::
|
|
504
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
505
|
+
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::6f10945ad9139d0119003738c65ae40a>>
|
|
506
506
|
*/
|
|
507
507
|
var fontSizeMap = exports.fontSizeMap = {
|
|
508
508
|
medium: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
@@ -32,7 +32,7 @@ const focusRingStyles = xcss({
|
|
|
32
32
|
});
|
|
33
33
|
const IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
34
34
|
const IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
35
|
-
const
|
|
35
|
+
const AnchorNoRef = ({
|
|
36
36
|
href,
|
|
37
37
|
children,
|
|
38
38
|
backgroundColor,
|
|
@@ -62,7 +62,7 @@ const Anchor = ({
|
|
|
62
62
|
action: 'clicked',
|
|
63
63
|
componentName: componentName || 'Anchor',
|
|
64
64
|
packageName: "@atlaskit/primitives",
|
|
65
|
-
packageVersion: "7.0.
|
|
65
|
+
packageVersion: "7.0.2",
|
|
66
66
|
analyticsData: analyticsContext,
|
|
67
67
|
actionSubject: 'link'
|
|
68
68
|
});
|
|
@@ -124,5 +124,5 @@ const Anchor = ({
|
|
|
124
124
|
* - [Code](https://atlassian.design/components/primitives/anchor/code)
|
|
125
125
|
* - [Usage](https://atlassian.design/components/primitives/anchor/usage)
|
|
126
126
|
*/
|
|
127
|
-
const
|
|
128
|
-
export default
|
|
127
|
+
const Anchor = /*#__PURE__*/forwardRef(AnchorNoRef);
|
|
128
|
+
export default Anchor;
|
|
@@ -64,7 +64,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
64
64
|
action: 'clicked',
|
|
65
65
|
componentName: componentName || 'Pressable',
|
|
66
66
|
packageName: "@atlaskit/primitives",
|
|
67
|
-
packageVersion: "7.0.
|
|
67
|
+
packageVersion: "7.0.2",
|
|
68
68
|
analyticsData: analyticsContext,
|
|
69
69
|
actionSubject: 'button'
|
|
70
70
|
});
|
|
@@ -3,11 +3,11 @@ import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::c98c944b8a999cfc194a2cfe851d2433>>
|
|
7
7
|
* @codegenId dimensions
|
|
8
8
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
9
9
|
* @codegenParams ["dimensions"]
|
|
10
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
10
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
11
11
|
*/
|
|
12
12
|
export const dimensionMap = {
|
|
13
13
|
'100%': '100%',
|
|
@@ -25,7 +25,7 @@ export const dimensionMap = {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
28
|
-
* @codegen <<SignedSource::
|
|
28
|
+
* @codegen <<SignedSource::0d3c08d703b8431712d7e238a3f7229b>>
|
|
29
29
|
* @codegenId spacing
|
|
30
30
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
31
31
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::55622b91aca9b3afac4bce440f222b71>>
|
|
@@ -67,7 +67,7 @@ export const allSpaceMap = {
|
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
70
|
-
* @codegen <<SignedSource::
|
|
70
|
+
* @codegen <<SignedSource::dd33c75b34fe7374656f10b21ba9b161>>
|
|
71
71
|
* @codegenId inverse-colors
|
|
72
72
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
73
73
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f27d1519d51cc4a85383a00907847774>>
|
|
@@ -108,7 +108,7 @@ export const inverseColorMap = {
|
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
111
|
-
* @codegen <<SignedSource::
|
|
111
|
+
* @codegen <<SignedSource::fde38a9999e3a081afa4a517da815ede>>
|
|
112
112
|
* @codegenId elevation
|
|
113
113
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
114
114
|
* @codegenParams ["opacity", "shadow", "surface"]
|
|
@@ -143,7 +143,7 @@ export const surfaceColorMap = {
|
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
146
|
-
* @codegen <<SignedSource::
|
|
146
|
+
* @codegen <<SignedSource::485e5a3659092381fa81ce940d43a939>>
|
|
147
147
|
* @codegenId colors
|
|
148
148
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
149
149
|
* @codegenParams ["border", "background", "text", "fill"]
|
|
@@ -440,12 +440,12 @@ export const fillMap = {
|
|
|
440
440
|
|
|
441
441
|
/**
|
|
442
442
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
443
|
-
* @codegen <<SignedSource::
|
|
443
|
+
* @codegen <<SignedSource::28920e82ff201211ac94808a1fd821d4>>
|
|
444
444
|
* @codegenId misc
|
|
445
445
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
446
446
|
* @codegenParams ["layer"]
|
|
447
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
448
|
-
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::
|
|
447
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
448
|
+
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::6f10945ad9139d0119003738c65ae40a>>
|
|
449
449
|
*/
|
|
450
450
|
export const layerMap = {
|
|
451
451
|
card: 100,
|
|
@@ -464,7 +464,7 @@ export const layerMap = {
|
|
|
464
464
|
|
|
465
465
|
/**
|
|
466
466
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
467
|
-
* @codegen <<SignedSource::
|
|
467
|
+
* @codegen <<SignedSource::957baf1fa3fc3fe5eb06b497a7ba6599>>
|
|
468
468
|
* @codegenId border
|
|
469
469
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
470
470
|
* @codegenParams ["width", "radius"]
|
|
@@ -491,12 +491,12 @@ export const borderRadiusMap = {
|
|
|
491
491
|
|
|
492
492
|
/**
|
|
493
493
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
494
|
-
* @codegen <<SignedSource::
|
|
494
|
+
* @codegen <<SignedSource::cd260411f17d54ff1ac7e627ef070ef4>>
|
|
495
495
|
* @codegenId typography
|
|
496
496
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
497
497
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
498
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
499
|
-
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::
|
|
498
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
499
|
+
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::6f10945ad9139d0119003738c65ae40a>>
|
|
500
500
|
*/
|
|
501
501
|
export const fontSizeMap = {
|
|
502
502
|
medium: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|