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

|
|
8
9
|
|
|
9
|
-
`xcss` is an Atlassian Design System styling API
|
|
10
|
-
Atlassian's [design tokens](/tokens) and [primitives](/components/primitives) in a safer, more resilient and evolvable way.
|
|
10
|
+
`xcss` is an Atlassian Design System styling API that natively integrates with Atlassian's [design tokens](/tokens) and [primitives](/components/primitives).
|
|
11
11
|
|
|
12
|
-
The `xcss` utility behaves similarly to the `css` utility in libraries
|
|
13
|
-
like `styled-components`, `@compiled` or `@emotion` - so if you've used those libraries before
|
|
14
|
-
it will feel very familiar, with a few additional features and some constraints.
|
|
12
|
+
The `xcss` utility behaves similarly to the `css` utility in libraries like `styled-components`, `@compiled` or `@emotion`. If you've used these libraries, `xcss` will feel familiar, with a few additional features and constraints.
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
Familiar features:
|
|
17
15
|
|
|
18
|
-
* `xcss`
|
|
19
|
-
* `xcss`
|
|
16
|
+
* `xcss` generates a `className` that is applied to the components
|
|
17
|
+
* `xcss` provides key-value pairs of CSS properties in an object format
|
|
20
18
|
* `xcss` supports style precedence and conditional styles
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
Key differences:
|
|
23
21
|
|
|
24
|
-
* `xcss` has type-safety that
|
|
25
|
-
* `xcss` restricts nested selectors completely from usage
|
|
22
|
+
* `xcss` has type-safety that ensures token name usage for all CSS properties represented by design tokens.
|
|
23
|
+
* `xcss` restricts nested selectors completely from usage
|
|
26
24
|
|
|
27
25
|
## Usage
|
|
28
26
|
|
|
@@ -51,17 +49,14 @@ const MyBox = () => {
|
|
|
51
49
|
return <Box xcss={someStyles} />
|
|
52
50
|
}
|
|
53
51
|
```
|
|
52
|
+
The `xcss` prop and the `xcss` function are direct complements and are designed to be used together.
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
to be used together. Note: styles generated from `xcss` cannot be applied directly
|
|
57
|
-
to the `className` property or `css` as they are with other CSS-in-JS libraries.
|
|
54
|
+
Note: styles generated from `xcss` cannot be applied directly to the `className` property or `css` as they are with other CSS-in-JS libraries.
|
|
58
55
|
|
|
59
56
|
### Type safety
|
|
60
57
|
|
|
61
|
-
`xcss` uses strongly-typed values generated from design token
|
|
62
|
-
|
|
63
|
-
This is intended to be more ergonomic and intuitive but also prevent the misapplication of tokens
|
|
64
|
-
to the wrong properties.
|
|
58
|
+
`xcss` uses strongly-typed values generated from design token definitions, making it simpler to apply the right token to the right CSS property.
|
|
59
|
+
This is intended to be more ergonomic and intuitive, but also prevent the misapplication of tokens to the wrong properties.
|
|
65
60
|
|
|
66
61
|
Any [valid token name](/components/tokens/all-tokens) is available to be applied against its
|
|
67
62
|
matching CSS property. For example, the token name `space.200`
|
|
@@ -79,6 +74,10 @@ const someStyles = xcss({
|
|
|
79
74
|
```
|
|
80
75
|
|
|
81
76
|
### Restricted nesting
|
|
77
|
+
`xcss` is flexible enough to implement any design, but it does restrict the application of styles in one key way.
|
|
78
|
+
Selectors cannot be nested or target elements beyond the element on which styles are applied.
|
|
79
|
+
This restriction is intended to encourage better component encapsulation, reduce side-effects and make the codebase more resilient to change.
|
|
80
|
+
|
|
82
81
|
|
|
83
82
|
`xcss` is meant to be flexible enough for you to implement any design but it does
|
|
84
83
|
restrict the application of styles in one key way. Selectors cannot be
|
|
@@ -106,7 +105,46 @@ const someStyles = xcss({
|
|
|
106
105
|
```
|
|
107
106
|
|
|
108
107
|
These unsafe selectors will throw a type error if applied.
|
|
109
|
-
For richer examples of how to use `xcss` please see
|
|
108
|
+
For richer examples of how to use `xcss` please see the [primitives `xcss` documentation](/components/primitives/xcss/examples).
|
|
109
|
+
|
|
110
|
+
### Media Queries
|
|
111
|
+
xCSS can create responsive layouts at predefined breakpoints that are consistent with the Atlassian Design System. To enable responsive behavior, xCSS exposes the following pre-defined breakpoints:
|
|
112
|
+
<MediaQueriesTable />
|
|
113
|
+
|
|
114
|
+
Media queries can be applied through keys that can be imported from `@atlaskit/primitives/responsive`.
|
|
115
|
+
For in depth examples on how to enable responsive behavior, please see our [primitive responsiveness documentation](/components/primitives/xcss/examples#responsiveness).
|
|
116
|
+
|
|
117
|
+
The objects defined at each breakpoint behave in much the same way as a normal xCSS object, and can apply responsiveness to any CSS.
|
|
118
|
+
The only limitation is that a media query can't contain another media query. This is to prevent arbitrary nesting.
|
|
119
|
+
Additionally, pseudo-selectors can't contain media queries. To use media queries and pseudos, the media query must contain the pseudo.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
import { xcss } from '@atlaskit/primitives';
|
|
123
|
+
import { media } from '@atlaskit/primitives/responsive';
|
|
124
|
+
|
|
125
|
+
const someStyles = xcss({
|
|
126
|
+
// This is okay, since media queries can contain pseudos
|
|
127
|
+
[media.above.md]: {
|
|
128
|
+
':hover': {
|
|
129
|
+
backgroundColor: 'color.background.primary.hovered'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
// This is not okay, since pseudos can't contain media queries
|
|
134
|
+
':hover': {
|
|
135
|
+
[media.above.md]: {
|
|
136
|
+
backgroundColor: 'color.background.primary.hovered'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
// This is not okay, since media queries can't contain media queries
|
|
141
|
+
[media.above.md]: {
|
|
142
|
+
[media.above.xs]: {
|
|
143
|
+
backgroundColor: 'color.background.primary.hovered'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
```
|
|
110
148
|
|
|
111
149
|
## Get help
|
|
112
150
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -22,6 +22,18 @@ Object.defineProperty(exports, "Stack", {
|
|
|
22
22
|
return _stack.default;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "UNSAFE_BREAKPOINTS_CONFIG", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _responsive.UNSAFE_BREAKPOINTS_CONFIG;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "UNSAFE_media", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _responsive.UNSAFE_media;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
25
37
|
Object.defineProperty(exports, "xcss", {
|
|
26
38
|
enumerable: true,
|
|
27
39
|
get: function get() {
|
|
@@ -31,4 +43,5 @@ Object.defineProperty(exports, "xcss", {
|
|
|
31
43
|
var _box = _interopRequireDefault(require("./components/box"));
|
|
32
44
|
var _inline = _interopRequireDefault(require("./components/inline"));
|
|
33
45
|
var _xcss = require("./xcss/xcss");
|
|
34
|
-
var _stack = _interopRequireDefault(require("./components/stack"));
|
|
46
|
+
var _stack = _interopRequireDefault(require("./components/stack"));
|
|
47
|
+
var _responsive = require("./helpers/responsive");
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Box } from './components/box';
|
|
2
2
|
export { default as Inline } from './components/inline';
|
|
3
3
|
export { xcss } from './xcss/xcss';
|
|
4
|
-
export { default as Stack } from './components/stack';
|
|
4
|
+
export { default as Stack } from './components/stack';
|
|
5
|
+
export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './helpers/responsive';
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Box } from './components/box';
|
|
2
2
|
export { default as Inline } from './components/inline';
|
|
3
3
|
export { xcss } from './xcss/xcss';
|
|
4
|
-
export { default as Stack } from './components/stack';
|
|
4
|
+
export { default as Stack } from './components/stack';
|
|
5
|
+
export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './helpers/responsive';
|
package/dist/esm/version.json
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { default as Box, type BoxProps } from './components/box';
|
|
|
2
2
|
export { default as Inline, type InlineProps } from './components/inline';
|
|
3
3
|
export { xcss } from './xcss/xcss';
|
|
4
4
|
export { default as Stack, type StackProps } from './components/stack';
|
|
5
|
+
export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG, type Breakpoint, } from './helpers/responsive';
|
|
@@ -2,3 +2,4 @@ export { default as Box, type BoxProps } from './components/box';
|
|
|
2
2
|
export { default as Inline, type InlineProps } from './components/inline';
|
|
3
3
|
export { xcss } from './xcss/xcss';
|
|
4
4
|
export { default as Stack, type StackProps } from './components/stack';
|
|
5
|
+
export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG, type Breakpoint, } from './helpers/responsive';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"@atlaskit/visual-regression": "*",
|
|
133
133
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
134
134
|
"@atlassian/codegen": "^0.1.0",
|
|
135
|
-
"@atlassian/gemini-visual-regression": "^0.0.
|
|
135
|
+
"@atlassian/gemini-visual-regression": "^0.0.34",
|
|
136
136
|
"@testing-library/react": "^12.1.5",
|
|
137
137
|
"@testing-library/react-hooks": "^8.0.1",
|
|
138
138
|
"csstype": "^3.1.0",
|
package/report.api.md
CHANGED
|
@@ -297,7 +297,7 @@ type BoxXCSS = {
|
|
|
297
297
|
};
|
|
298
298
|
|
|
299
299
|
// @public
|
|
300
|
-
type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
|
|
300
|
+
export type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
|
|
301
301
|
|
|
302
302
|
// @public (undocumented)
|
|
303
303
|
type CSSMediaQueries = {
|
|
@@ -622,6 +622,73 @@ type TokenisedProps = {
|
|
|
622
622
|
// @public (undocumented)
|
|
623
623
|
const uniqueSymbol: unique symbol;
|
|
624
624
|
|
|
625
|
+
// @public
|
|
626
|
+
export const UNSAFE_BREAKPOINTS_CONFIG: {
|
|
627
|
+
readonly xxs: {
|
|
628
|
+
readonly gridItemGutter: 'var(--ds-space-200)';
|
|
629
|
+
readonly gridMargin: 'var(--ds-space-200)';
|
|
630
|
+
readonly min: '0rem';
|
|
631
|
+
readonly max: '29.99rem';
|
|
632
|
+
};
|
|
633
|
+
readonly xs: {
|
|
634
|
+
readonly gridItemGutter: 'var(--ds-space-200)';
|
|
635
|
+
readonly gridMargin: 'var(--ds-space-200)';
|
|
636
|
+
readonly min: '30rem';
|
|
637
|
+
readonly max: '47.99rem';
|
|
638
|
+
};
|
|
639
|
+
readonly sm: {
|
|
640
|
+
readonly gridItemGutter: 'var(--ds-space-200)';
|
|
641
|
+
readonly gridMargin: 'var(--ds-space-300)';
|
|
642
|
+
readonly min: '48rem';
|
|
643
|
+
readonly max: '63.99rem';
|
|
644
|
+
};
|
|
645
|
+
readonly md: {
|
|
646
|
+
readonly gridItemGutter: 'var(--ds-space-300)';
|
|
647
|
+
readonly gridMargin: 'var(--ds-space-400)';
|
|
648
|
+
readonly min: '64rem';
|
|
649
|
+
readonly max: '89.99rem';
|
|
650
|
+
};
|
|
651
|
+
readonly lg: {
|
|
652
|
+
readonly gridItemGutter: 'var(--ds-space-400)';
|
|
653
|
+
readonly gridMargin: 'var(--ds-space-400)';
|
|
654
|
+
readonly min: '90rem';
|
|
655
|
+
readonly max: '109.99rem';
|
|
656
|
+
};
|
|
657
|
+
readonly xl: {
|
|
658
|
+
readonly gridItemGutter: 'var(--ds-space-400)';
|
|
659
|
+
readonly gridMargin: 'var(--ds-space-500)';
|
|
660
|
+
readonly min: '110rem';
|
|
661
|
+
readonly max: null;
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
// @internal
|
|
666
|
+
export const UNSAFE_media: {
|
|
667
|
+
above: {
|
|
668
|
+
readonly xxs: '@media all';
|
|
669
|
+
readonly xs: '@media (min-width: 30rem)';
|
|
670
|
+
readonly sm: '@media (min-width: 48rem)';
|
|
671
|
+
readonly md: '@media (min-width: 64rem)';
|
|
672
|
+
readonly lg: '@media (min-width: 90rem)';
|
|
673
|
+
readonly xl: '@media (min-width: 110rem)';
|
|
674
|
+
};
|
|
675
|
+
below: {
|
|
676
|
+
readonly xs: '@media not all and (min-width: 30rem)';
|
|
677
|
+
readonly sm: '@media not all and (min-width: 48rem)';
|
|
678
|
+
readonly md: '@media not all and (min-width: 64rem)';
|
|
679
|
+
readonly lg: '@media not all and (min-width: 90rem)';
|
|
680
|
+
readonly xl: '@media not all and (min-width: 110rem)';
|
|
681
|
+
};
|
|
682
|
+
only: {
|
|
683
|
+
readonly xxs: '@media (min-width: 0rem) and (max-width: 29.99rem)';
|
|
684
|
+
readonly xs: '@media (min-width: 30rem) and (max-width: 47.99rem)';
|
|
685
|
+
readonly sm: '@media (min-width: 48rem) and (max-width: 63.99rem)';
|
|
686
|
+
readonly md: '@media (min-width: 64rem) and (max-width: 89.99rem)';
|
|
687
|
+
readonly lg: '@media (min-width: 90rem) and (max-width: 109.99rem)';
|
|
688
|
+
readonly xl: '@media (min-width: 110rem)';
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
|
|
625
692
|
// @public
|
|
626
693
|
export function xcss<Primitive extends typeof Box | typeof Inline = typeof Box>(
|
|
627
694
|
style: Primitive extends typeof Box
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -259,7 +259,7 @@ type BoxXCSS = {
|
|
|
259
259
|
};
|
|
260
260
|
|
|
261
261
|
// @public
|
|
262
|
-
type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
|
|
262
|
+
export type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
|
|
263
263
|
|
|
264
264
|
// @public (undocumented)
|
|
265
265
|
type CSSMediaQueries = {
|
|
@@ -515,6 +515,73 @@ type TokenisedProps = {
|
|
|
515
515
|
// @public (undocumented)
|
|
516
516
|
const uniqueSymbol: unique symbol;
|
|
517
517
|
|
|
518
|
+
// @public
|
|
519
|
+
export const UNSAFE_BREAKPOINTS_CONFIG: {
|
|
520
|
+
readonly xxs: {
|
|
521
|
+
readonly gridItemGutter: "var(--ds-space-200)";
|
|
522
|
+
readonly gridMargin: "var(--ds-space-200)";
|
|
523
|
+
readonly min: "0rem";
|
|
524
|
+
readonly max: "29.99rem";
|
|
525
|
+
};
|
|
526
|
+
readonly xs: {
|
|
527
|
+
readonly gridItemGutter: "var(--ds-space-200)";
|
|
528
|
+
readonly gridMargin: "var(--ds-space-200)";
|
|
529
|
+
readonly min: "30rem";
|
|
530
|
+
readonly max: "47.99rem";
|
|
531
|
+
};
|
|
532
|
+
readonly sm: {
|
|
533
|
+
readonly gridItemGutter: "var(--ds-space-200)";
|
|
534
|
+
readonly gridMargin: "var(--ds-space-300)";
|
|
535
|
+
readonly min: "48rem";
|
|
536
|
+
readonly max: "63.99rem";
|
|
537
|
+
};
|
|
538
|
+
readonly md: {
|
|
539
|
+
readonly gridItemGutter: "var(--ds-space-300)";
|
|
540
|
+
readonly gridMargin: "var(--ds-space-400)";
|
|
541
|
+
readonly min: "64rem";
|
|
542
|
+
readonly max: "89.99rem";
|
|
543
|
+
};
|
|
544
|
+
readonly lg: {
|
|
545
|
+
readonly gridItemGutter: "var(--ds-space-400)";
|
|
546
|
+
readonly gridMargin: "var(--ds-space-400)";
|
|
547
|
+
readonly min: "90rem";
|
|
548
|
+
readonly max: "109.99rem";
|
|
549
|
+
};
|
|
550
|
+
readonly xl: {
|
|
551
|
+
readonly gridItemGutter: "var(--ds-space-400)";
|
|
552
|
+
readonly gridMargin: "var(--ds-space-500)";
|
|
553
|
+
readonly min: "110rem";
|
|
554
|
+
readonly max: null;
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
// @internal
|
|
559
|
+
export const UNSAFE_media: {
|
|
560
|
+
above: {
|
|
561
|
+
readonly xxs: "@media all";
|
|
562
|
+
readonly xs: "@media (min-width: 30rem)";
|
|
563
|
+
readonly sm: "@media (min-width: 48rem)";
|
|
564
|
+
readonly md: "@media (min-width: 64rem)";
|
|
565
|
+
readonly lg: "@media (min-width: 90rem)";
|
|
566
|
+
readonly xl: "@media (min-width: 110rem)";
|
|
567
|
+
};
|
|
568
|
+
below: {
|
|
569
|
+
readonly xs: "@media not all and (min-width: 30rem)";
|
|
570
|
+
readonly sm: "@media not all and (min-width: 48rem)";
|
|
571
|
+
readonly md: "@media not all and (min-width: 64rem)";
|
|
572
|
+
readonly lg: "@media not all and (min-width: 90rem)";
|
|
573
|
+
readonly xl: "@media not all and (min-width: 110rem)";
|
|
574
|
+
};
|
|
575
|
+
only: {
|
|
576
|
+
readonly xxs: "@media (min-width: 0rem) and (max-width: 29.99rem)";
|
|
577
|
+
readonly xs: "@media (min-width: 30rem) and (max-width: 47.99rem)";
|
|
578
|
+
readonly sm: "@media (min-width: 48rem) and (max-width: 63.99rem)";
|
|
579
|
+
readonly md: "@media (min-width: 64rem) and (max-width: 89.99rem)";
|
|
580
|
+
readonly lg: "@media (min-width: 90rem) and (max-width: 109.99rem)";
|
|
581
|
+
readonly xl: "@media (min-width: 110rem)";
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
|
|
518
585
|
// @public
|
|
519
586
|
export function xcss<Primitive extends typeof Box | typeof Inline = typeof Box>(style: Primitive extends typeof Box ? ScopedSafeCSSObject<AllowedBoxStyles> | ScopedSafeCSSObject<AllowedBoxStyles>[] : Primitive extends typeof Inline ? ScopedSafeCSSObject<Spacing> | ScopedSafeCSSObject<Spacing>[] : never): {
|
|
520
587
|
readonly [uniqueSymbol]: Primitive extends (<T extends ElementType<any> = "div">(props: BoxProps<T>) => ReactElement<any, JSXElementConstructor<any>| string> | null) & FC<BoxProps<"div">> ? BoxStyles : Primitive extends MemoExoticComponent<ForwardRefExoticComponent<Pick<InlineProps<ElementType<any>>, "alignBlock" | "alignInline" | "as" | "children" | "grow" | "rowSpace" | "separator" | "shouldWrap" | "space" | "spread" | "testId" | "xcss"> & RefAttributes<any>>> ? InlineStyles : never;
|