@atlaskit/primitives 1.6.7 → 1.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/constellation/bleed/code.mdx +1 -1
- package/constellation/bleed/example.mdx +1 -1
- package/constellation/box/code.mdx +1 -1
- package/constellation/box/examples.mdx +1 -1
- package/constellation/box/usage.mdx +5 -5
- package/constellation/flex/code.mdx +1 -1
- package/constellation/flex/examples.mdx +1 -1
- package/constellation/grid/code.mdx +1 -1
- package/constellation/grid/examples.mdx +1 -1
- package/constellation/inline/code.mdx +1 -1
- package/constellation/inline/examples.mdx +4 -4
- package/constellation/inline/usage.mdx +11 -11
- package/constellation/overview/index.mdx +15 -17
- package/constellation/responsive/examples.mdx +1 -1
- package/constellation/responsive/usage.mdx +3 -3
- package/constellation/stack/code.mdx +1 -1
- package/constellation/stack/examples.mdx +3 -3
- package/constellation/stack/usage.mdx +13 -13
- package/constellation/text/code.mdx +19 -0
- package/constellation/text/examples.mdx +2 -0
- package/constellation/text/usage.mdx +2 -0
- package/constellation/xcss/examples.mdx +1 -1
- package/constellation/xcss/migration.mdx +1 -1
- package/constellation/xcss/usage.mdx +2 -4
- package/dist/cjs/responsive/media-helper.js +15 -1
- package/dist/es2019/responsive/media-helper.js +15 -1
- package/dist/esm/responsive/media-helper.js +15 -1
- package/dist/types/responsive/media-helper.d.ts +9 -28
- package/dist/types-ts4.5/responsive/media-helper.d.ts +9 -28
- package/extract-react-types/text-props.tsx +47 -0
- package/package.json +2 -2
- package/report.api.md +4 -10
- package/tmp/api-report-tmp.d.ts +4 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 1.6.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42012](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42012) [`0a52fc9129e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0a52fc9129e) - Internal change to the `media` export to ensure compatibility with [Compiled](https://github.com/atlassian-labs/compiled). No change to public API.
|
|
8
|
+
|
|
3
9
|
## 1.6.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Box
|
|
3
|
-
description: A box is a
|
|
3
|
+
description: A box is a generic container that provides managed access to design tokens.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
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
|
-
Use a
|
|
8
|
+
Use a box to compose layouts and add styling to child elements through visual props, including spacing and color through design tokens.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Styling
|
|
11
11
|
|
|
12
|
-
Display behavior is set by using the available props or using `xcss`. Makers can make design decisions for
|
|
12
|
+
Display behavior is set by using the available props or using `xcss`. Makers can make design decisions for box by setting:
|
|
13
13
|
|
|
14
14
|
- `padding`
|
|
15
15
|
- `paddingInline`
|
|
@@ -20,7 +20,7 @@ Display behavior is set by using the available props or using `xcss`. Makers can
|
|
|
20
20
|
- `paddingBlockEnd`
|
|
21
21
|
- `backgroundColor`
|
|
22
22
|
|
|
23
|
-
## Using
|
|
23
|
+
## Using box
|
|
24
24
|
|
|
25
25
|
To identify usages of `Box` in a given design, look for where a UI element will receive some visual styles applied to a container. `Box` can be used on a range of sizes of elements, from buttons to section wrappers.
|
|
26
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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Inline
|
|
3
|
-
description:
|
|
3
|
+
description: An inline manages the horizontal layout of direct children using flexbox.
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -26,9 +26,9 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
|
26
26
|
|
|
27
27
|
## Basic
|
|
28
28
|
|
|
29
|
-
Inline should be used to
|
|
29
|
+
Inline should be used to layout a group of elements horizontally.
|
|
30
30
|
|
|
31
|
-
Use the given props to configure display
|
|
31
|
+
Use the given props to configure display behavior using design tokens, as shown in the more complex examples below.
|
|
32
32
|
|
|
33
33
|
<Example Component={InlineBasic} packageName="@atlaskit/primitives/inline" />
|
|
34
34
|
|
|
@@ -70,7 +70,7 @@ To control the alignment of items you can use the `alignBlock` and `alignInline`
|
|
|
70
70
|
|
|
71
71
|
## Spread
|
|
72
72
|
|
|
73
|
-
Elements can be set to stay together, spaced at the given value (default
|
|
73
|
+
Elements can be set to stay together, spaced at the given value (default behavior) or spread equally in the space available.
|
|
74
74
|
|
|
75
75
|
<Example Component={InlineSpread} packageName="@atlaskit/primitives/inline" />
|
|
76
76
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Inline
|
|
3
|
-
description:
|
|
3
|
+
description: An inline manages the horizontal layout of direct children using flexbox.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Primitive components
|
|
7
|
+
Primitive components act as building blocks for composing a user experience. Use the inline primitive to lay out UI elements horizontally using built-in design guidance from the Atlassian Design System.
|
|
8
8
|
|
|
9
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
10
|
|
|
@@ -16,13 +16,13 @@ In its simplest form, `Inline` operates like a flexbox row, however adds the bui
|
|
|
16
16
|
</Inline>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Inline also has a `flex-direction: row;`. This is the default for flexbox, so it is not explicitly applied.
|
|
20
20
|
|
|
21
|
-
## Use
|
|
21
|
+
## Use inline
|
|
22
22
|
|
|
23
23
|
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.
|
|
24
24
|
|
|
25
|
-
The
|
|
25
|
+
The inline props can then be used to customize the spacing and styling on any child elements. These include:
|
|
26
26
|
|
|
27
27
|
- `alignBlock`
|
|
28
28
|
- `alignInline`
|
|
@@ -35,9 +35,9 @@ The various Inline props can then be used to customize the spacing and styling o
|
|
|
35
35
|
|
|
36
36
|
## Related
|
|
37
37
|
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
38
|
+
- [Primitives](/components/primitives/overview)
|
|
39
|
+
- [Box](/components/primitives/box/usage)
|
|
40
|
+
- [Stack](/components/primitives/stack/usage)
|
|
41
|
+
- [Grid](/components/primitives/grid/examples)
|
|
42
|
+
- [Bleed](/components/primitives/bleed/examples)
|
|
43
|
+
- [Flex](/components/primitives/flex/examples)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Primitives
|
|
3
|
-
description: Primitives are
|
|
3
|
+
description: Primitives are components that create layouts, add styling, make up other components.
|
|
4
4
|
order: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -19,19 +19,16 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
|
19
19
|
directoryName="primitives"
|
|
20
20
|
/>
|
|
21
21
|
|
|
22
|
-
Primitives are a new type of component for layouts and the placement of elements.
|
|
23
|
-
They act as
|
|
22
|
+
Primitives are a new type of component for layouts, styling, and the placement of elements.
|
|
23
|
+
They act as building blocks to compose different parts of the user experience,
|
|
24
24
|
from the smallest design decisions (for example, the spacing around an icon) to larger layout decisions (for example, how a page is structured).
|
|
25
25
|
|
|
26
|
-
Primitives are powered by design tokens and
|
|
27
|
-
primitives make it easier to reason about the when and how. This reduces cognitive overhead, improves productivity and prevents accidents or mistakes.
|
|
26
|
+
Primitives are powered by design tokens and make it easier to apply design decisions. This reduces cognitive overhead, improves productivity and prevents accidents or mistakes.
|
|
28
27
|
|
|
29
|
-
## Available
|
|
28
|
+
## Available primitives
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Currently, three core primitive components are available - Box, Inline and Stack. A large amount of layout problems can be reduced to laying out content:
|
|
30
|
+
Primitives are used together to compose complex designs not otherwise implemented directly in the Design System.
|
|
31
|
+
Currently, three layout primitive components are available:
|
|
35
32
|
|
|
36
33
|
- in a container (see [box](/components/primitives/box))
|
|
37
34
|
- horizontally (see [inline](/components/primitives/inline))
|
|
@@ -51,7 +48,7 @@ To install primitive components, add @atlaskit/primitives as a dependency on you
|
|
|
51
48
|
$ yarn add @atlaskit/primitives
|
|
52
49
|
```
|
|
53
50
|
|
|
54
|
-
## Using
|
|
51
|
+
## Using primitives
|
|
55
52
|
|
|
56
53
|
Use primitives for composing layouts.
|
|
57
54
|
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.
|
|
@@ -87,9 +84,10 @@ The behavior within and around these boxes can then be broken down into their ho
|
|
|
87
84
|
|
|
88
85
|
## Related
|
|
89
86
|
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
92
|
-
- [
|
|
93
|
-
- [
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
87
|
+
- [Box](/components/primitives/box/usage)
|
|
88
|
+
- [Inline](/components/primitives/inline/usage)
|
|
89
|
+
- [Stack](/components/primitives/stack/usage)
|
|
90
|
+
- [Grid](/components/primitives/grid/examples)
|
|
91
|
+
- [Bleed](/components/primitives/bleed/examples)
|
|
92
|
+
- [Flex](/components/primitives/flex/examples)
|
|
93
|
+
- [xcss](/components/primitives/xcss/usage)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Responsive
|
|
3
|
-
description: Responsive helpers and primitives to build responsive UIs
|
|
3
|
+
description: Responsive helpers and primitives to build responsive UIs.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ The media query helper object `media.above[breakpoint]` maps to our [breakpoints
|
|
|
10
10
|
|
|
11
11
|
These responsive helpers are designed be used in conjunction with [xcss](/components/primitives/xcss). It is recommended that both are used when available as this uses our media queries to allow for safe, responsive styling.
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Basic example
|
|
14
14
|
|
|
15
15
|
Compose your default styles alongside media overrides in [xcss](/components/primitives/xcss) or `css`.
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ export const Component = ({ children }: { children: ReactNode }) => (
|
|
|
27
27
|
);
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### Using media.above
|
|
31
31
|
|
|
32
32
|
It is important to note that the `media.above.xxs` will **always** match, it is explicitly `'@media all'`. This is only included for easy programatic usage, but it has a negative performance impact.
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Stack
|
|
3
|
-
description:
|
|
3
|
+
description: A stack manages the vertical layout of direct children using flexbox.
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
|
24
24
|
## Basic
|
|
25
25
|
|
|
26
26
|
Stack should be used to efficiently lay-out a group of elements vertically.
|
|
27
|
-
Use the given props to configure display
|
|
27
|
+
Use the given props to configure display behavior using designs tokens, as shown in the more complex examples below.
|
|
28
28
|
|
|
29
29
|
<Example Component={StackBasic} packageName="@atlaskit/primitives/stack" />
|
|
30
30
|
|
|
@@ -51,7 +51,7 @@ To control the alignment of items you can use the `alignBlock` and `alignInline`
|
|
|
51
51
|
|
|
52
52
|
## Spread
|
|
53
53
|
|
|
54
|
-
Elements can be set to stay together, spaced at the given value (default
|
|
54
|
+
Elements can be set to stay together, spaced at the given value (default behavior) or spread equally in the space available.
|
|
55
55
|
|
|
56
56
|
<Example Component={StackSpread} packageName="@atlaskit/primitives/stack" />
|
|
57
57
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Stack
|
|
3
|
-
description:
|
|
3
|
+
description: A stack manages the vertical layout of direct children using flexbox.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Primitive components are
|
|
7
|
+
Primitive components are building blocks for composing a user experience. A `Stack` primitive lays out UI elements vertically, and makes use of the built-in design guidance from the Atlassian Design System.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Stacks 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 is purely for visual alignment, and should have no opinions about the functionality of its children.
|
|
10
10
|
|
|
11
|
-
In its simplest form, `Stack`
|
|
11
|
+
In its simplest form, `Stack` works like a flexbox column, with built-in design token support and guidance.
|
|
12
12
|
|
|
13
13
|
```jsx
|
|
14
14
|
<Stack space="space.100" alignInline="center" alignBlock="start">
|
|
@@ -16,11 +16,11 @@ In its simplest form, `Stack` operates like a flexbox column, however adds the b
|
|
|
16
16
|
</Stack>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Usage
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
A `Stack` is primarily a container element controlling how content is displayed and aligned vertically. Use stack any time you wish to lay out elements or components vertically.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
These props customize the spacing and styling of any child elements:
|
|
24
24
|
|
|
25
25
|
- `alignBlock`
|
|
26
26
|
- `alignInline`
|
|
@@ -30,9 +30,9 @@ The various `Stack` props can then be used to customize the spacing and styling
|
|
|
30
30
|
|
|
31
31
|
## Related
|
|
32
32
|
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
33
|
+
- [Primitives](/components/primitives/overview)
|
|
34
|
+
- [Box](/components/primitives/box/usage)
|
|
35
|
+
- [Inline](/components/primitives/inline/usage)
|
|
36
|
+
- [Grid](/components/primitives/grid/examples)
|
|
37
|
+
- [Bleed](/components/primitives/bleed/examples)
|
|
38
|
+
- [Flex](/components/primitives/flex/examples)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Text
|
|
3
|
+
description: Text is a token-backed typography component to display body and UI text.
|
|
4
|
+
order: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
8
|
+
|
|
9
|
+
<CodeDocsHeader
|
|
10
|
+
name="@atlaskit/primitives"
|
|
11
|
+
repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
|
|
12
|
+
directoryName="primitives"
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
import ERTText from '!!extract-react-types-loader!../../extract-react-types/text-props';
|
|
16
|
+
|
|
17
|
+
## Props
|
|
18
|
+
|
|
19
|
+
<PropsTable heading="" props={ERTText} />
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description:
|
|
2
|
+
title: XCSS
|
|
3
|
+
description: XCSS is a safer, tokens-first approach to CSS-in-JS.
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
import { MediaQueriesTable } from '@af/design-system-docs-ui';
|
|
8
8
|
|
|
9
|
-

|
|
10
|
-
|
|
11
9
|
`xcss` is an Atlassian Design System styling API that natively integrates with Atlassian's [design tokens](/tokens) and [primitives](/components/primitives).
|
|
12
10
|
|
|
13
11
|
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.
|
|
@@ -78,11 +78,25 @@ var UNSAFE_media = exports.UNSAFE_media = {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* We needed to simplify the `media` export below to rely on less AST traversal so that Compiled could understand it.
|
|
83
|
+
* This type provides the same guarantees as `const media = { above: UNSAFE_media.above }` would but allows it to be a simple
|
|
84
|
+
* object that Compiled parses easily.
|
|
85
|
+
* See https://product-fabric.atlassian.net/browse/DSP-13626 for more detail.
|
|
86
|
+
*/
|
|
87
|
+
|
|
81
88
|
/**
|
|
82
89
|
* This is an object of usable media query helpers using our internal breakpoints configuration.
|
|
83
90
|
*
|
|
84
91
|
* We strictly only export `media.above` at this stage as we want makers to build mobile-first.
|
|
85
92
|
*/
|
|
86
93
|
var media = exports.media = {
|
|
87
|
-
above:
|
|
94
|
+
above: {
|
|
95
|
+
xxs: '@media all',
|
|
96
|
+
xs: '@media (min-width: 30rem)',
|
|
97
|
+
sm: '@media (min-width: 48rem)',
|
|
98
|
+
md: '@media (min-width: 64rem)',
|
|
99
|
+
lg: '@media (min-width: 90rem)',
|
|
100
|
+
xl: '@media (min-width: 110rem)'
|
|
101
|
+
}
|
|
88
102
|
};
|
|
@@ -73,11 +73,25 @@ export const UNSAFE_media = {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* We needed to simplify the `media` export below to rely on less AST traversal so that Compiled could understand it.
|
|
78
|
+
* This type provides the same guarantees as `const media = { above: UNSAFE_media.above }` would but allows it to be a simple
|
|
79
|
+
* object that Compiled parses easily.
|
|
80
|
+
* See https://product-fabric.atlassian.net/browse/DSP-13626 for more detail.
|
|
81
|
+
*/
|
|
82
|
+
|
|
76
83
|
/**
|
|
77
84
|
* This is an object of usable media query helpers using our internal breakpoints configuration.
|
|
78
85
|
*
|
|
79
86
|
* We strictly only export `media.above` at this stage as we want makers to build mobile-first.
|
|
80
87
|
*/
|
|
81
88
|
export const media = {
|
|
82
|
-
above:
|
|
89
|
+
above: {
|
|
90
|
+
xxs: '@media all',
|
|
91
|
+
xs: '@media (min-width: 30rem)',
|
|
92
|
+
sm: '@media (min-width: 48rem)',
|
|
93
|
+
md: '@media (min-width: 64rem)',
|
|
94
|
+
lg: '@media (min-width: 90rem)',
|
|
95
|
+
xl: '@media (min-width: 110rem)'
|
|
96
|
+
}
|
|
83
97
|
};
|
|
@@ -73,11 +73,25 @@ export var UNSAFE_media = {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* We needed to simplify the `media` export below to rely on less AST traversal so that Compiled could understand it.
|
|
78
|
+
* This type provides the same guarantees as `const media = { above: UNSAFE_media.above }` would but allows it to be a simple
|
|
79
|
+
* object that Compiled parses easily.
|
|
80
|
+
* See https://product-fabric.atlassian.net/browse/DSP-13626 for more detail.
|
|
81
|
+
*/
|
|
82
|
+
|
|
76
83
|
/**
|
|
77
84
|
* This is an object of usable media query helpers using our internal breakpoints configuration.
|
|
78
85
|
*
|
|
79
86
|
* We strictly only export `media.above` at this stage as we want makers to build mobile-first.
|
|
80
87
|
*/
|
|
81
88
|
export var media = {
|
|
82
|
-
above:
|
|
89
|
+
above: {
|
|
90
|
+
xxs: '@media all',
|
|
91
|
+
xs: '@media (min-width: 30rem)',
|
|
92
|
+
sm: '@media (min-width: 48rem)',
|
|
93
|
+
md: '@media (min-width: 64rem)',
|
|
94
|
+
lg: '@media (min-width: 90rem)',
|
|
95
|
+
xl: '@media (min-width: 110rem)'
|
|
96
|
+
}
|
|
83
97
|
};
|
|
@@ -70,36 +70,17 @@ export declare const UNSAFE_media: {
|
|
|
70
70
|
readonly xl: "@media (min-width: 110rem)";
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* We needed to simplify the `media` export below to rely on less AST traversal so that Compiled could understand it.
|
|
75
|
+
* This type provides the same guarantees as `const media = { above: UNSAFE_media.above }` would but allows it to be a simple
|
|
76
|
+
* object that Compiled parses easily.
|
|
77
|
+
* See https://product-fabric.atlassian.net/browse/DSP-13626 for more detail.
|
|
78
|
+
*/
|
|
79
|
+
type SafeMedia = Pick<typeof UNSAFE_media, 'above'>;
|
|
73
80
|
/**
|
|
74
81
|
* This is an object of usable media query helpers using our internal breakpoints configuration.
|
|
75
82
|
*
|
|
76
83
|
* We strictly only export `media.above` at this stage as we want makers to build mobile-first.
|
|
77
84
|
*/
|
|
78
|
-
export declare const media:
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* `above.xxs` is redundant and no media query should be used, but it's included for programatic purposes…
|
|
82
|
-
*/
|
|
83
|
-
readonly xxs: "@media all";
|
|
84
|
-
/**
|
|
85
|
-
* Used for mobile viewports.
|
|
86
|
-
*/
|
|
87
|
-
readonly xs: "@media (min-width: 30rem)";
|
|
88
|
-
/**
|
|
89
|
-
* Used for tablet viewports.
|
|
90
|
-
*/
|
|
91
|
-
readonly sm: "@media (min-width: 48rem)";
|
|
92
|
-
/**
|
|
93
|
-
* Used for laptop viewports.
|
|
94
|
-
*/
|
|
95
|
-
readonly md: "@media (min-width: 64rem)";
|
|
96
|
-
/**
|
|
97
|
-
* Used for desktop viewports.
|
|
98
|
-
*/
|
|
99
|
-
readonly lg: "@media (min-width: 90rem)";
|
|
100
|
-
/**
|
|
101
|
-
* Used for wide screen desktop viewports.
|
|
102
|
-
*/
|
|
103
|
-
readonly xl: "@media (min-width: 110rem)";
|
|
104
|
-
};
|
|
105
|
-
};
|
|
85
|
+
export declare const media: SafeMedia;
|
|
86
|
+
export {};
|
|
@@ -70,36 +70,17 @@ export declare const UNSAFE_media: {
|
|
|
70
70
|
readonly xl: "@media (min-width: 110rem)";
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* We needed to simplify the `media` export below to rely on less AST traversal so that Compiled could understand it.
|
|
75
|
+
* This type provides the same guarantees as `const media = { above: UNSAFE_media.above }` would but allows it to be a simple
|
|
76
|
+
* object that Compiled parses easily.
|
|
77
|
+
* See https://product-fabric.atlassian.net/browse/DSP-13626 for more detail.
|
|
78
|
+
*/
|
|
79
|
+
type SafeMedia = Pick<typeof UNSAFE_media, 'above'>;
|
|
73
80
|
/**
|
|
74
81
|
* This is an object of usable media query helpers using our internal breakpoints configuration.
|
|
75
82
|
*
|
|
76
83
|
* We strictly only export `media.above` at this stage as we want makers to build mobile-first.
|
|
77
84
|
*/
|
|
78
|
-
export declare const media:
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* `above.xxs` is redundant and no media query should be used, but it's included for programatic purposes…
|
|
82
|
-
*/
|
|
83
|
-
readonly xxs: "@media all";
|
|
84
|
-
/**
|
|
85
|
-
* Used for mobile viewports.
|
|
86
|
-
*/
|
|
87
|
-
readonly xs: "@media (min-width: 30rem)";
|
|
88
|
-
/**
|
|
89
|
-
* Used for tablet viewports.
|
|
90
|
-
*/
|
|
91
|
-
readonly sm: "@media (min-width: 48rem)";
|
|
92
|
-
/**
|
|
93
|
-
* Used for laptop viewports.
|
|
94
|
-
*/
|
|
95
|
-
readonly md: "@media (min-width: 64rem)";
|
|
96
|
-
/**
|
|
97
|
-
* Used for desktop viewports.
|
|
98
|
-
*/
|
|
99
|
-
readonly lg: "@media (min-width: 90rem)";
|
|
100
|
-
/**
|
|
101
|
-
* Used for wide screen desktop viewports.
|
|
102
|
-
*/
|
|
103
|
-
readonly xl: "@media (min-width: 110rem)";
|
|
104
|
-
};
|
|
105
|
-
};
|
|
85
|
+
export declare const media: SafeMedia;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// TODO: This is all hacky, replace with ts-morph solution
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
5
|
+
namespace Token {
|
|
6
|
+
// BoxProps['backgroundColor'] uses keyof, which ERT does not understand
|
|
7
|
+
export type TextColor = 'TextColor';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type TextAlign = 'center' | 'end' | 'start';
|
|
11
|
+
type TextVariant = 'body' | 'body.large' | 'body.small' | 'ui' | 'ui.small';
|
|
12
|
+
|
|
13
|
+
interface TextProps {
|
|
14
|
+
/**
|
|
15
|
+
* HTML tag to be rendered. Defaults to `span`.
|
|
16
|
+
*/
|
|
17
|
+
as?: 'span' | 'p' | 'strong' | 'em';
|
|
18
|
+
/**
|
|
19
|
+
* Elements rendered within the Text element
|
|
20
|
+
*/
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Text variant
|
|
24
|
+
*/
|
|
25
|
+
variant?: TextVariant;
|
|
26
|
+
/**
|
|
27
|
+
* Token representing text color with a built-in fallback value.
|
|
28
|
+
* Will apply inverse text color automatically if placed within a Box with backgroundColor.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
color?: Token.TextColor;
|
|
32
|
+
/**
|
|
33
|
+
* The HTML id attribute https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
34
|
+
*/
|
|
35
|
+
id?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Truncates text with an ellipsis when text overflows its parent container
|
|
38
|
+
* (i.e. `width` has been set on parent that is shorter than text length).
|
|
39
|
+
*/
|
|
40
|
+
shouldTruncate?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Text align https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
|
|
43
|
+
*/
|
|
44
|
+
textAlign?: TextAlign;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default function Text(_: TextProps) {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.8",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"codegen-styles": "ts-node -r tsconfig-paths/register ./scripts/codegen-styles.tsx"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
|
-
"@atlaskit/tokens": "^1.
|
|
128
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
129
129
|
"@babel/runtime": "^7.0.0",
|
|
130
130
|
"@emotion/react": "^11.7.1",
|
|
131
131
|
"@emotion/serialize": "^1.1.0",
|
package/report.api.md
CHANGED
|
@@ -845,16 +845,7 @@ const layerMap: {
|
|
|
845
845
|
type MarginSpace = 'auto' | NegativeSpace | Space;
|
|
846
846
|
|
|
847
847
|
// @public
|
|
848
|
-
export const media:
|
|
849
|
-
readonly above: {
|
|
850
|
-
readonly xxs: '@media all';
|
|
851
|
-
readonly xs: '@media (min-width: 30rem)';
|
|
852
|
-
readonly sm: '@media (min-width: 48rem)';
|
|
853
|
-
readonly md: '@media (min-width: 64rem)';
|
|
854
|
-
readonly lg: '@media (min-width: 90rem)';
|
|
855
|
-
readonly xl: '@media (min-width: 110rem)';
|
|
856
|
-
};
|
|
857
|
-
};
|
|
848
|
+
export const media: SafeMedia;
|
|
858
849
|
|
|
859
850
|
// @public
|
|
860
851
|
type MediaQuery = (typeof media.above)[Breakpoint];
|
|
@@ -882,6 +873,9 @@ type SafeCSSObject = CSSPseudos &
|
|
|
882
873
|
CSSMediaQueries &
|
|
883
874
|
Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
|
|
884
875
|
|
|
876
|
+
// @public
|
|
877
|
+
type SafeMedia = Pick<typeof UNSAFE_media, 'above'>;
|
|
878
|
+
|
|
885
879
|
// @public (undocumented)
|
|
886
880
|
export type Shadow = keyof typeof shadowMap;
|
|
887
881
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -597,16 +597,7 @@ const layerMap: {
|
|
|
597
597
|
type MarginSpace = 'auto' | NegativeSpace | Space;
|
|
598
598
|
|
|
599
599
|
// @public
|
|
600
|
-
export const media:
|
|
601
|
-
readonly above: {
|
|
602
|
-
readonly xxs: "@media all";
|
|
603
|
-
readonly xs: "@media (min-width: 30rem)";
|
|
604
|
-
readonly sm: "@media (min-width: 48rem)";
|
|
605
|
-
readonly md: "@media (min-width: 64rem)";
|
|
606
|
-
readonly lg: "@media (min-width: 90rem)";
|
|
607
|
-
readonly xl: "@media (min-width: 110rem)";
|
|
608
|
-
};
|
|
609
|
-
};
|
|
600
|
+
export const media: SafeMedia;
|
|
610
601
|
|
|
611
602
|
// @public
|
|
612
603
|
type MediaQuery = (typeof media.above)[Breakpoint];
|
|
@@ -630,6 +621,9 @@ const negativeSpaceMap: {
|
|
|
630
621
|
// @public (undocumented)
|
|
631
622
|
type SafeCSSObject = CSSPseudos & CSSAtRules & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
|
|
632
623
|
|
|
624
|
+
// @public
|
|
625
|
+
type SafeMedia = Pick<typeof UNSAFE_media, 'above'>;
|
|
626
|
+
|
|
633
627
|
// @public (undocumented)
|
|
634
628
|
export type Shadow = keyof typeof shadowMap;
|
|
635
629
|
|