@atlaskit/primitives 1.6.6 → 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.
Files changed (39) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/constellation/bleed/code.mdx +1 -1
  3. package/constellation/bleed/example.mdx +1 -1
  4. package/constellation/box/code.mdx +1 -1
  5. package/constellation/box/examples.mdx +1 -1
  6. package/constellation/box/usage.mdx +5 -5
  7. package/constellation/flex/code.mdx +1 -1
  8. package/constellation/flex/examples.mdx +1 -1
  9. package/constellation/grid/code.mdx +1 -1
  10. package/constellation/grid/examples.mdx +1 -1
  11. package/constellation/inline/code.mdx +1 -1
  12. package/constellation/inline/examples.mdx +4 -4
  13. package/constellation/inline/usage.mdx +11 -11
  14. package/constellation/overview/index.mdx +15 -17
  15. package/constellation/responsive/examples.mdx +1 -1
  16. package/constellation/responsive/usage.mdx +3 -3
  17. package/constellation/stack/code.mdx +1 -1
  18. package/constellation/stack/examples.mdx +3 -3
  19. package/constellation/stack/usage.mdx +13 -13
  20. package/constellation/text/code.mdx +19 -0
  21. package/constellation/text/examples.mdx +2 -0
  22. package/constellation/text/usage.mdx +2 -0
  23. package/constellation/xcss/examples.mdx +1 -1
  24. package/constellation/xcss/migration.mdx +1 -1
  25. package/constellation/xcss/usage.mdx +2 -4
  26. package/dist/cjs/responsive/media-helper.js +15 -1
  27. package/dist/cjs/xcss/style-maps.partial.js +4 -4
  28. package/dist/es2019/responsive/media-helper.js +15 -1
  29. package/dist/es2019/xcss/style-maps.partial.js +4 -4
  30. package/dist/esm/responsive/media-helper.js +15 -1
  31. package/dist/esm/xcss/style-maps.partial.js +4 -4
  32. package/dist/types/responsive/media-helper.d.ts +9 -28
  33. package/dist/types/xcss/style-maps.partial.d.ts +4 -4
  34. package/dist/types-ts4.5/responsive/media-helper.d.ts +9 -28
  35. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +4 -4
  36. package/extract-react-types/text-props.tsx +47 -0
  37. package/package.json +2 -2
  38. package/report.api.md +4 -10
  39. package/tmp/api-report-tmp.d.ts +4 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
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
+
9
+ ## 1.6.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [#41516](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41516) [`350e4081d89`](https://bitbucket.org/atlassian/atlassian-frontend/commits/350e4081d89) - [ux] Regenerates codegen artifacts as a result of changes to color palettes and token values
14
+ - Updated dependencies
15
+
3
16
  ## 1.6.6
4
17
 
5
18
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Bleed
3
- description: Bleed is a primitive layout component that controls negative whitespace.
3
+ description: A bleed controls negative whitespace in layouts.
4
4
  order: 1
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Bleed
3
- description: Bleed is a primitive layout component that controls negative whitespace.
3
+ description: A bleed controls negative whitespace in layouts.
4
4
  order: 0
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Box
3
- description: A box is a primitive component that acts as a generic container, and provides managed access to design tokens.
3
+ description: A box is a generic container that provides managed access to design tokens.
4
4
  order: 1
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Box
3
- description: A box is a primitive component that acts as a generic container, and provides managed access to design tokens.
3
+ description: A box is a generic container that provides managed access to design tokens.
4
4
  order: 0
5
5
  ---
6
6
 
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  title: Box
3
- description: A box is a primitive component that acts as a generic container, and provides managed access to design tokens.
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 `Box` to compose layouts and add styling to child elements through visual props, including spacing and color through design tokens.
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
- ## `Box` styling
10
+ ## Styling
11
11
 
12
- Display behavior is set by using the available props or using `xcss`. Makers can make design decisions for `Box` by setting:
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 `Box`
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: Flex
3
- description: Flex is a primitive layout component that implements the CSS Flexbox API.
3
+ description: A flex implements the CSS flexbox API.
4
4
  order: 1
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Flex
3
- description: Flex is a primitive layout component that implements the CSS Flexbox API.
3
+ description: A flex implements the CSS flexbox API.
4
4
  order: 0
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Grid
3
- description: Grid is a primitive layout component that implements the CSS Grid API.
3
+ description: A grid uses the CSS grid API to create consistent layouts.
4
4
  order: 1
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Grid
3
- description: Grid is a primitive layout component that implements the CSS Grid API.
3
+ description: A grid uses the CSS grid API to create consistent layouts.
4
4
  order: 0
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Inline
3
- description: Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
3
+ description: An inline manages the horizontal layout of direct children using flexbox.
4
4
  order: 1
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Inline
3
- description: Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
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 efficiently lay-out a group of elements horizontally.
29
+ Inline should be used to layout a group of elements horizontally.
30
30
 
31
- Use the given props to configure display behaviour using designs tokens, as shown in the more complex examples below.
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 behaviour) or spread equally in the space available.
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: Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
3
+ description: An inline manages the horizontal layout of direct children using flexbox.
4
4
  order: 2
5
5
  ---
6
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.
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
- `Inline` also has a flex-direction: row; this is the default for flexbox, so it is not explicitly applied.
19
+ Inline also has a `flex-direction: row;`. This is the default for flexbox, so it is not explicitly applied.
20
20
 
21
- ## Use `Inline`
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 various Inline props can then be used to customize the spacing and styling on any child elements. These include:
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
- - [Learn more about the Primitives](/components/primitives/overview)
39
- - [Learn more about the Box primitive](/components/primitives/box/usage)
40
- - [Learn more about the Stack primitive](/components/primitives/stack/usage)
41
- - [Learn more about the Grid primitive](/components/primitives/grid/examples)
42
- - [Learn more about the Bleed primitive](/components/primitives/bleed/examples)
43
- - [Learn more about the Flex primitive](/components/primitives/flex/examples)
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 composable components that solve common layout problems.
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 simple building blocks to compose different parts of the user experience,
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 add a layer of ergonomics and accessibility to token application. Tokens are great at describing the what of a design decision;
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 Primitives
28
+ ## Available primitives
30
29
 
31
- Each primitive is designed to have a single responsibility, and it should be immediately clear where and when each primitive should be used.
32
- However, they are also flexible enough that they should be able to be used together to compose complex designs not otherwise implemented directly in the Design Systems.
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 Primitives
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
- - [Learn more about the Box primitive](/components/primitives/box/usage)
91
- - [Learn more about the Inline primitive](/components/primitives/inline/usage)
92
- - [Learn more about the Stack primitive](/components/primitives/stack/usage)
93
- - [Learn more about the Grid primitive](/components/primitives/grid/examples)
94
- - [Learn more about the Bleed primitive](/components/primitives/bleed/examples)
95
- - [Learn more about the Flex primitive](/components/primitives/flex/examples)
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 with
3
+ description: Responsive helpers and primitives to build responsive UIs.
4
4
  order: 1
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Responsive
3
- description: Responsive helpers and primitives to build responsive UIs with
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
- ### A basic example:
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
- ### `media.above` usage
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: Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
3
+ description: A stack manages the vertical layout of direct children using flexbox.
4
4
  order: 1
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Stack
3
- description: Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
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 behaviour using designs tokens, as shown in the more complex examples below.
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 behaviour) or spread equally in the space available.
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: Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
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 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.
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
- `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.
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` operates like a flexbox column, however adds the built in design token support and guidance.
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
- ## Use `Stack`
19
+ ## Usage
20
20
 
21
- 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
+ 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
- The various `Stack` props can then be used to customize the spacing and styling on any child elements. These include:
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
- - [Learn more about the Primitives](/components/primitives/overview)
34
- - [Learn more about the Box primitive](/components/primitives/box/usage)
35
- - [Learn more about the Inline primitive](/components/primitives/inline/usage)
36
- - [Learn more about the Grid primitive](/components/primitives/grid/examples)
37
- - [Learn more about the Bleed primitive](/components/primitives/bleed/examples)
38
- - [Learn more about the Flex primitive](/components/primitives/flex/examples)
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,4 +1,6 @@
1
1
  ---
2
+ title: Text
3
+ description: Text is a token-backed typography component to display body and UI text.
2
4
  order: 0
3
5
  ---
4
6
 
@@ -1,4 +1,6 @@
1
1
  ---
2
+ title: Text
3
+ description: Text is a token-backed typography component to display body and UI text.
2
4
  order: 2
3
5
  ---
4
6
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: xcss
2
+ title: XCSS
3
3
  description: xcss is a safer, tokens-first approach to CSS-in-JS.
4
4
  order: 1
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Migrating your app to xcss
2
+ title: Migrating your app to XCSS
3
3
  description: xcss is a safer, tokens-first approach to CSS-in-JS.
4
4
  order: 2
5
5
  ---
@@ -1,13 +1,11 @@
1
1
  ---
2
- title: xcss
3
- description: xcss is a safer, tokens-first approach to CSS-in-JS.
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
- ![xcss Logo](logo.png 'xcss Logo')
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: UNSAFE_media.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
  };
@@ -70,10 +70,10 @@ var negativeSpaceMap = exports.negativeSpaceMap = {
70
70
 
71
71
  /**
72
72
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
73
- * @codegen <<SignedSource::310a54617a9f912145976996fcef66a5>>
73
+ * @codegen <<SignedSource::fcf1cfc01cda3c278e69b0b564c7746d>>
74
74
  * @codegenId inverse-colors
75
75
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
76
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
76
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
77
77
  */
78
78
  var inverseColorMap = exports.inverseColorMap = {
79
79
  'color.background.neutral.bold': 'color.text.inverse',
@@ -111,11 +111,11 @@ var inverseColorMap = exports.inverseColorMap = {
111
111
 
112
112
  /**
113
113
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
114
- * @codegen <<SignedSource::b93d845e13422e2b25a860f34dc6882b>>
114
+ * @codegen <<SignedSource::4f49a5a763f3c327f1d7ce5f2d030194>>
115
115
  * @codegenId colors
116
116
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
117
117
  * @codegenParams ["border", "background", "shadow", "text", "fill", "surface"]
118
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
118
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
119
119
  */
120
120
  var borderColorMap = exports.borderColorMap = {
121
121
  'color.border': "var(--ds-border, #091e4221)",
@@ -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: UNSAFE_media.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
  };
@@ -61,10 +61,10 @@ export const negativeSpaceMap = {
61
61
  */
62
62
  /**
63
63
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
64
- * @codegen <<SignedSource::310a54617a9f912145976996fcef66a5>>
64
+ * @codegen <<SignedSource::fcf1cfc01cda3c278e69b0b564c7746d>>
65
65
  * @codegenId inverse-colors
66
66
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
67
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
67
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
68
68
  */
69
69
  export const inverseColorMap = {
70
70
  'color.background.neutral.bold': 'color.text.inverse',
@@ -102,11 +102,11 @@ export const inverseColorMap = {
102
102
 
103
103
  /**
104
104
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
105
- * @codegen <<SignedSource::b93d845e13422e2b25a860f34dc6882b>>
105
+ * @codegen <<SignedSource::4f49a5a763f3c327f1d7ce5f2d030194>>
106
106
  * @codegenId colors
107
107
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
108
108
  * @codegenParams ["border", "background", "shadow", "text", "fill", "surface"]
109
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
109
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
110
110
  */
111
111
  export const borderColorMap = {
112
112
  'color.border': "var(--ds-border, #091e4221)",
@@ -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: UNSAFE_media.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
  };
@@ -62,10 +62,10 @@ export var negativeSpaceMap = {
62
62
  */
63
63
  /**
64
64
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
65
- * @codegen <<SignedSource::310a54617a9f912145976996fcef66a5>>
65
+ * @codegen <<SignedSource::fcf1cfc01cda3c278e69b0b564c7746d>>
66
66
  * @codegenId inverse-colors
67
67
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
68
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
68
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
69
69
  */
70
70
  export var inverseColorMap = {
71
71
  'color.background.neutral.bold': 'color.text.inverse',
@@ -103,11 +103,11 @@ export var inverseColorMap = {
103
103
 
104
104
  /**
105
105
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
106
- * @codegen <<SignedSource::b93d845e13422e2b25a860f34dc6882b>>
106
+ * @codegen <<SignedSource::4f49a5a763f3c327f1d7ce5f2d030194>>
107
107
  * @codegenId colors
108
108
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
109
109
  * @codegenParams ["border", "background", "shadow", "text", "fill", "surface"]
110
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
110
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
111
111
  */
112
112
  export var borderColorMap = {
113
113
  'color.border': "var(--ds-border, #091e4221)",
@@ -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
- readonly above: {
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 {};
@@ -62,10 +62,10 @@ export type NegativeSpace = keyof typeof negativeSpaceMap;
62
62
  */
63
63
  /**
64
64
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
65
- * @codegen <<SignedSource::310a54617a9f912145976996fcef66a5>>
65
+ * @codegen <<SignedSource::fcf1cfc01cda3c278e69b0b564c7746d>>
66
66
  * @codegenId inverse-colors
67
67
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
68
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
68
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
69
69
  */
70
70
  export declare const inverseColorMap: {
71
71
  readonly 'color.background.neutral.bold': "color.text.inverse";
@@ -101,11 +101,11 @@ export declare const inverseColorMap: {
101
101
  */
102
102
  /**
103
103
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
104
- * @codegen <<SignedSource::b93d845e13422e2b25a860f34dc6882b>>
104
+ * @codegen <<SignedSource::4f49a5a763f3c327f1d7ce5f2d030194>>
105
105
  * @codegenId colors
106
106
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
107
107
  * @codegenParams ["border", "background", "shadow", "text", "fill", "surface"]
108
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
108
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
109
109
  */
110
110
  export declare const borderColorMap: {
111
111
  readonly 'color.border': "var(--ds-border)";
@@ -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
- readonly above: {
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 {};
@@ -62,10 +62,10 @@ export type NegativeSpace = keyof typeof negativeSpaceMap;
62
62
  */
63
63
  /**
64
64
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
65
- * @codegen <<SignedSource::310a54617a9f912145976996fcef66a5>>
65
+ * @codegen <<SignedSource::fcf1cfc01cda3c278e69b0b564c7746d>>
66
66
  * @codegenId inverse-colors
67
67
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
68
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
68
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
69
69
  */
70
70
  export declare const inverseColorMap: {
71
71
  readonly 'color.background.neutral.bold': "color.text.inverse";
@@ -101,11 +101,11 @@ export declare const inverseColorMap: {
101
101
  */
102
102
  /**
103
103
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
104
- * @codegen <<SignedSource::b93d845e13422e2b25a860f34dc6882b>>
104
+ * @codegen <<SignedSource::4f49a5a763f3c327f1d7ce5f2d030194>>
105
105
  * @codegenId colors
106
106
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
107
107
  * @codegenParams ["border", "background", "shadow", "text", "fill", "surface"]
108
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::5188ac15a9f4d65b80cf12e4eecac815>>
108
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f1021f8d47ab63374e371ce18db72a1c>>
109
109
  */
110
110
  export declare const borderColorMap: {
111
111
  readonly 'color.border': "var(--ds-border)";
@@ -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.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.26.0",
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
 
@@ -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