@atlaskit/primitives 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +6 -2
- package/box/package.json +2 -2
- package/constellation/box/code.mdx +6 -2
- package/constellation/box/usage.mdx +30 -0
- package/constellation/inline/usage.mdx +36 -0
- package/constellation/overview/images/box-usage-example.png +0 -0
- package/constellation/overview/images/inline-usage-example.png +0 -0
- package/constellation/overview/images/stack-usage-example.png +0 -0
- package/constellation/overview/index.mdx +66 -0
- package/constellation/stack/usage.mdx +31 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/xcss/style-maps.partial.js +13 -43
- package/dist/cjs/xcss/xcss.js +19 -19
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/xcss/style-maps.partial.js +12 -40
- package/dist/es2019/xcss/xcss.js +20 -20
- package/dist/esm/version.json +1 -1
- package/dist/esm/xcss/style-maps.partial.js +12 -40
- package/dist/esm/xcss/xcss.js +20 -20
- package/dist/types/components/box.d.ts +2 -2
- package/dist/types/components/inline.d.ts +7 -7
- package/dist/types/components/internal/base-box.d.ts +15 -14
- package/dist/types/components/stack.d.ts +6 -6
- package/dist/types/components/types.d.ts +2 -2
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/helpers/responsive/types.d.ts +4 -4
- package/dist/types/xcss/style-maps.partial.d.ts +79 -131
- package/dist/types/xcss/xcss.d.ts +11 -11
- package/extract-react-types/box-props.tsx +95 -0
- package/extract-react-types/inline-props.tsx +86 -1
- package/extract-react-types/stack-props.tsx +70 -1
- package/inline/package.json +2 -2
- package/package.json +18 -10
- package/report.api.md +87 -350
- package/responsive/package.json +2 -2
- package/scripts/codegen-file-templates/dimensions.tsx +17 -16
- package/scripts/codegen-styles.tsx +2 -2
- package/scripts/spacing-codegen-template.tsx +24 -91
- package/stack/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +74 -99
- package/constellation/overview/examples.mdx +0 -7
|
@@ -2,11 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
/**
|
|
4
4
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
5
|
-
* @codegen <<SignedSource::
|
|
5
|
+
* @codegen <<SignedSource::7d4a8604dc454e30c0fec5c1330ea7c5>>
|
|
6
6
|
* @codegenId dimensions
|
|
7
7
|
* @codegenCommand yarn codegen-styles
|
|
8
8
|
* @codegenParams ["dimensions"]
|
|
9
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
9
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
10
10
|
*/
|
|
11
11
|
export var dimensionMap = {
|
|
12
12
|
'100%': '100%',
|
|
@@ -23,28 +23,11 @@ export var dimensionMap = {
|
|
|
23
23
|
*/
|
|
24
24
|
/**
|
|
25
25
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
26
|
-
* @codegen <<SignedSource::
|
|
26
|
+
* @codegen <<SignedSource::9fbc4dfcd8f43f52bff6b3bb666397fe>>
|
|
27
27
|
* @codegenId spacing
|
|
28
28
|
* @codegenCommand yarn codegen-styles
|
|
29
|
-
* @codegenParams ["padding", "space", "inset"]
|
|
30
29
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
31
30
|
*/
|
|
32
|
-
export var paddingMap = {
|
|
33
|
-
'space.0': "var(--ds-space-0, 0px)",
|
|
34
|
-
'space.025': "var(--ds-space-025, 2px)",
|
|
35
|
-
'space.050': "var(--ds-space-050, 4px)",
|
|
36
|
-
'space.075': "var(--ds-space-075, 6px)",
|
|
37
|
-
'space.100': "var(--ds-space-100, 8px)",
|
|
38
|
-
'space.150': "var(--ds-space-150, 12px)",
|
|
39
|
-
'space.200': "var(--ds-space-200, 16px)",
|
|
40
|
-
'space.250': "var(--ds-space-250, 20px)",
|
|
41
|
-
'space.300': "var(--ds-space-300, 24px)",
|
|
42
|
-
'space.400': "var(--ds-space-400, 32px)",
|
|
43
|
-
'space.500': "var(--ds-space-500, 40px)",
|
|
44
|
-
'space.600': "var(--ds-space-600, 48px)",
|
|
45
|
-
'space.800': "var(--ds-space-800, 64px)",
|
|
46
|
-
'space.1000': "var(--ds-space-1000, 80px)"
|
|
47
|
-
};
|
|
48
31
|
export var spaceMap = {
|
|
49
32
|
'space.0': "var(--ds-space-0, 0px)",
|
|
50
33
|
'space.025': "var(--ds-space-025, 2px)",
|
|
@@ -61,22 +44,6 @@ export var spaceMap = {
|
|
|
61
44
|
'space.800': "var(--ds-space-800, 64px)",
|
|
62
45
|
'space.1000': "var(--ds-space-1000, 80px)"
|
|
63
46
|
};
|
|
64
|
-
export var insetMap = {
|
|
65
|
-
'space.0': "var(--ds-space-0, 0px)",
|
|
66
|
-
'space.025': "var(--ds-space-025, 2px)",
|
|
67
|
-
'space.050': "var(--ds-space-050, 4px)",
|
|
68
|
-
'space.075': "var(--ds-space-075, 6px)",
|
|
69
|
-
'space.100': "var(--ds-space-100, 8px)",
|
|
70
|
-
'space.150': "var(--ds-space-150, 12px)",
|
|
71
|
-
'space.200': "var(--ds-space-200, 16px)",
|
|
72
|
-
'space.250': "var(--ds-space-250, 20px)",
|
|
73
|
-
'space.300': "var(--ds-space-300, 24px)",
|
|
74
|
-
'space.400': "var(--ds-space-400, 32px)",
|
|
75
|
-
'space.500': "var(--ds-space-500, 40px)",
|
|
76
|
-
'space.600': "var(--ds-space-600, 48px)",
|
|
77
|
-
'space.800': "var(--ds-space-800, 64px)",
|
|
78
|
-
'space.1000': "var(--ds-space-1000, 80px)"
|
|
79
|
-
};
|
|
80
47
|
/**
|
|
81
48
|
* @codegenEnd
|
|
82
49
|
*/
|
|
@@ -263,13 +230,13 @@ export var textColorMap = {
|
|
|
263
230
|
*/
|
|
264
231
|
/**
|
|
265
232
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
266
|
-
* @codegen <<SignedSource::
|
|
233
|
+
* @codegen <<SignedSource::64f7b08cdbce710fba3157594ea695a8>>
|
|
267
234
|
* @codegenId misc
|
|
268
235
|
* @codegenCommand yarn codegen-styles
|
|
269
236
|
* @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
270
237
|
* @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
|
|
271
238
|
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
272
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
239
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
273
240
|
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
|
|
274
241
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
275
242
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
@@ -370,7 +337,12 @@ export var borderRadiusMap = {
|
|
|
370
337
|
* @codegenEnd
|
|
371
338
|
*/
|
|
372
339
|
|
|
373
|
-
|
|
340
|
+
// Generate maps for Box props. backgroundColor, padding, etc
|
|
341
|
+
var spacingProperties = [
|
|
342
|
+
// Used by Box
|
|
343
|
+
'padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd',
|
|
344
|
+
// Used by Inline and Stack
|
|
345
|
+
'gap', 'rowGap', 'columnGap'];
|
|
374
346
|
var getSerializedStylesMap = function getSerializedStylesMap(cssProperty, tokenMap) {
|
|
375
347
|
return Object.keys(tokenMap).reduce(function (emotionSpacingMap, token) {
|
|
376
348
|
emotionSpacingMap[token] = css(_defineProperty({}, cssProperty, tokenMap[token]));
|
|
@@ -378,7 +350,7 @@ var getSerializedStylesMap = function getSerializedStylesMap(cssProperty, tokenM
|
|
|
378
350
|
}, {});
|
|
379
351
|
};
|
|
380
352
|
export var paddingStylesMap = spacingProperties.reduce(function (styleMap, spacingProperty) {
|
|
381
|
-
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty,
|
|
353
|
+
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty, spaceMap);
|
|
382
354
|
return styleMap;
|
|
383
355
|
}, {});
|
|
384
356
|
export var spaceStylesMap = spacingProperties.reduce(function (styleMap, spacingProperty) {
|
package/dist/esm/xcss/xcss.js
CHANGED
|
@@ -4,7 +4,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
4
4
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
5
5
|
import { css as cssEmotion } from '@emotion/react';
|
|
6
6
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
7
|
-
import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap,
|
|
7
|
+
import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
|
|
8
8
|
var tokensMap = {
|
|
9
9
|
alignSelf: alignSelfMap,
|
|
10
10
|
backgroundColor: backgroundColorMap,
|
|
@@ -25,13 +25,13 @@ var tokensMap = {
|
|
|
25
25
|
gap: spaceMap,
|
|
26
26
|
height: dimensionMap,
|
|
27
27
|
inlineSize: dimensionMap,
|
|
28
|
-
inset:
|
|
29
|
-
insetBlock:
|
|
30
|
-
insetBlockEnd:
|
|
31
|
-
insetBlockStart:
|
|
32
|
-
insetInline:
|
|
33
|
-
insetInlineEnd:
|
|
34
|
-
insetInlineStart:
|
|
28
|
+
inset: spaceMap,
|
|
29
|
+
insetBlock: spaceMap,
|
|
30
|
+
insetBlockEnd: spaceMap,
|
|
31
|
+
insetBlockStart: spaceMap,
|
|
32
|
+
insetInline: spaceMap,
|
|
33
|
+
insetInlineEnd: spaceMap,
|
|
34
|
+
insetInlineStart: spaceMap,
|
|
35
35
|
left: dimensionMap,
|
|
36
36
|
maxBlockSize: dimensionMap,
|
|
37
37
|
maxHeight: dimensionMap,
|
|
@@ -41,23 +41,23 @@ var tokensMap = {
|
|
|
41
41
|
minHeight: dimensionMap,
|
|
42
42
|
minInlineSize: dimensionMap,
|
|
43
43
|
minWidth: dimensionMap,
|
|
44
|
-
outlineOffset:
|
|
44
|
+
outlineOffset: spaceMap,
|
|
45
45
|
outlineWidth: borderWidthMap,
|
|
46
46
|
outlineColor: borderColorMap,
|
|
47
47
|
overflow: overflowMap,
|
|
48
48
|
overflowBlock: overflowBlockMap,
|
|
49
49
|
overflowInline: overflowInlineMap,
|
|
50
|
-
padding:
|
|
51
|
-
paddingBlock:
|
|
52
|
-
paddingBlockEnd:
|
|
53
|
-
paddingBlockStart:
|
|
54
|
-
paddingBottom:
|
|
55
|
-
paddingInline:
|
|
56
|
-
paddingInlineEnd:
|
|
57
|
-
paddingInlineStart:
|
|
58
|
-
paddingLeft:
|
|
59
|
-
paddingRight:
|
|
60
|
-
paddingTop:
|
|
50
|
+
padding: spaceMap,
|
|
51
|
+
paddingBlock: spaceMap,
|
|
52
|
+
paddingBlockEnd: spaceMap,
|
|
53
|
+
paddingBlockStart: spaceMap,
|
|
54
|
+
paddingBottom: spaceMap,
|
|
55
|
+
paddingInline: spaceMap,
|
|
56
|
+
paddingInlineEnd: spaceMap,
|
|
57
|
+
paddingInlineStart: spaceMap,
|
|
58
|
+
paddingLeft: spaceMap,
|
|
59
|
+
paddingRight: spaceMap,
|
|
60
|
+
paddingTop: spaceMap,
|
|
61
61
|
position: positionMap,
|
|
62
62
|
right: dimensionMap,
|
|
63
63
|
rowGap: spaceMap,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { ElementType, FC, ReactElement } from 'react';
|
|
3
3
|
import { BaseBoxProps } from './internal/base-box';
|
|
4
4
|
import type { PublicBoxPropsBase } from './types';
|
|
5
|
-
export
|
|
6
|
-
|
|
5
|
+
export type BoxProps<T extends ElementType = 'div'> = Omit<BaseBoxProps<T>, 'className'> & PublicBoxPropsBase;
|
|
6
|
+
type BoxComponent<T extends ElementType = 'div'> = (<T extends ElementType = 'div'>(props: BoxProps<T>) => ReactElement | null) & FC<BoxProps<T>>;
|
|
7
7
|
/**
|
|
8
8
|
* __Box__
|
|
9
9
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ElementType, ReactNode } from 'react';
|
|
3
|
-
import { type
|
|
3
|
+
import { type Space } from '../xcss/style-maps.partial';
|
|
4
4
|
export interface InlineProps<T extends ElementType = 'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* The DOM element to render as the Inline. Defaults to `div`.
|
|
@@ -29,12 +29,12 @@ export interface InlineProps<T extends ElementType = 'div'> {
|
|
|
29
29
|
/**
|
|
30
30
|
* Represents the space between each child.
|
|
31
31
|
*/
|
|
32
|
-
space?:
|
|
32
|
+
space?: Space;
|
|
33
33
|
/**
|
|
34
34
|
* Represents the space between rows when content wraps.
|
|
35
35
|
* Used to override the `space` value in between rows.
|
|
36
36
|
*/
|
|
37
|
-
rowSpace?:
|
|
37
|
+
rowSpace?: Space;
|
|
38
38
|
/**
|
|
39
39
|
* Renders a separator string between each child.
|
|
40
40
|
*/
|
|
@@ -52,10 +52,10 @@ export interface InlineProps<T extends ElementType = 'div'> {
|
|
|
52
52
|
*/
|
|
53
53
|
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
54
54
|
}
|
|
55
|
-
export
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
export
|
|
55
|
+
export type AlignInline = 'start' | 'center' | 'end';
|
|
56
|
+
export type AlignBlock = 'start' | 'center' | 'end' | 'baseline';
|
|
57
|
+
export type Spread = 'space-between';
|
|
58
|
+
export type Grow = 'hug' | 'fill';
|
|
59
59
|
/**
|
|
60
60
|
* __Inline__
|
|
61
61
|
*
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ComponentPropsWithoutRef,
|
|
3
|
-
import { BackgroundColor,
|
|
2
|
+
import { ComponentPropsWithoutRef, ElementType, FC, ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { BackgroundColor, type Space } from '../../xcss/style-maps.partial';
|
|
4
4
|
import type { BasePrimitiveProps } from '../types';
|
|
5
|
-
export
|
|
6
|
-
|
|
5
|
+
export type BaseBoxProps<T extends ElementType = 'div'> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className'> & BasePrimitiveProps & BaseBoxPropsFoundation<T>;
|
|
6
|
+
export type As = 'article' | 'aside' | 'dialog' | 'div' | 'footer' | 'header' | 'li' | 'main' | 'nav' | 'ol' | 'section' | 'span' | 'ul';
|
|
7
|
+
type BaseBoxPropsFoundation<T extends ElementType = 'div'> = {
|
|
7
8
|
/**
|
|
8
9
|
* The DOM element to render as the Box. Defaults to `div`.
|
|
9
10
|
*/
|
|
10
|
-
as?:
|
|
11
|
+
as?: As;
|
|
11
12
|
/**
|
|
12
13
|
* The HTML className attribute.
|
|
13
14
|
*
|
|
@@ -34,43 +35,43 @@ declare type BaseBoxPropsFoundation<T extends ElementType> = {
|
|
|
34
35
|
* @see paddingBlock
|
|
35
36
|
* @see paddingInline
|
|
36
37
|
*/
|
|
37
|
-
padding?:
|
|
38
|
+
padding?: Space;
|
|
38
39
|
/**
|
|
39
40
|
* Tokens representing CSS shorthand `paddingBlock`.
|
|
40
41
|
*
|
|
41
42
|
* @see paddingBlockStart
|
|
42
43
|
* @see paddingBlockEnd
|
|
43
44
|
*/
|
|
44
|
-
paddingBlock?:
|
|
45
|
+
paddingBlock?: Space;
|
|
45
46
|
/**
|
|
46
47
|
* Tokens representing CSS `paddingBlockStart`.
|
|
47
48
|
*/
|
|
48
|
-
paddingBlockStart?:
|
|
49
|
+
paddingBlockStart?: Space;
|
|
49
50
|
/**
|
|
50
51
|
* Tokens representing CSS `paddingBlockEnd`.
|
|
51
52
|
*/
|
|
52
|
-
paddingBlockEnd?:
|
|
53
|
+
paddingBlockEnd?: Space;
|
|
53
54
|
/**
|
|
54
55
|
* Tokens representing CSS shorthand `paddingInline`.
|
|
55
56
|
*
|
|
56
57
|
* @see paddingInlineStart
|
|
57
58
|
* @see paddingInlineEnd
|
|
58
59
|
*/
|
|
59
|
-
paddingInline?:
|
|
60
|
+
paddingInline?: Space;
|
|
60
61
|
/**
|
|
61
62
|
* Tokens representing CSS `paddingInlineStart`.
|
|
62
63
|
*/
|
|
63
|
-
paddingInlineStart?:
|
|
64
|
+
paddingInlineStart?: Space;
|
|
64
65
|
/**
|
|
65
66
|
* Tokens representing CSS `paddingInlineEnd`.
|
|
66
67
|
*/
|
|
67
|
-
paddingInlineEnd?:
|
|
68
|
+
paddingInlineEnd?: Space;
|
|
68
69
|
/**
|
|
69
70
|
* Forwarded ref element
|
|
70
71
|
*/
|
|
71
|
-
ref?: ComponentPropsWithRef<T>['ref'];
|
|
72
|
+
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
72
73
|
};
|
|
73
|
-
export
|
|
74
|
+
export type BaseBoxComponent<T extends ElementType = 'div'> = (<T extends ElementType = 'div'>(props: BaseBoxProps<T>) => ReactElement | null) & FC<BaseBoxProps<T>>;
|
|
74
75
|
/**
|
|
75
76
|
* __Box__
|
|
76
77
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ElementType, ReactNode } from 'react';
|
|
3
|
-
import { type
|
|
3
|
+
import { type Space } from '../xcss/style-maps.partial';
|
|
4
4
|
export interface StackProps<T extends ElementType = 'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* The DOM element to render as the Stack. Defaults to `div`.
|
|
@@ -25,7 +25,7 @@ export interface StackProps<T extends ElementType = 'div'> {
|
|
|
25
25
|
/**
|
|
26
26
|
* Represents the space between each child.
|
|
27
27
|
*/
|
|
28
|
-
space?:
|
|
28
|
+
space?: Space;
|
|
29
29
|
/**
|
|
30
30
|
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
31
31
|
*/
|
|
@@ -39,10 +39,10 @@ export interface StackProps<T extends ElementType = 'div'> {
|
|
|
39
39
|
*/
|
|
40
40
|
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
41
41
|
}
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
42
|
+
export type AlignInline = 'start' | 'center' | 'end';
|
|
43
|
+
export type AlignBlock = 'start' | 'center' | 'end';
|
|
44
|
+
export type Spread = 'space-between';
|
|
45
|
+
export type Grow = 'hug' | 'fill';
|
|
46
46
|
/**
|
|
47
47
|
* __Stack__
|
|
48
48
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import { type BoxXCSS } from '../xcss/xcss';
|
|
3
|
-
export
|
|
3
|
+
export type BasePrimitiveProps = {
|
|
4
4
|
/**
|
|
5
5
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
6
6
|
*/
|
|
@@ -10,7 +10,7 @@ export declare type BasePrimitiveProps = {
|
|
|
10
10
|
*/
|
|
11
11
|
style?: CSSProperties;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type PublicBoxPropsBase = {
|
|
14
14
|
/**
|
|
15
15
|
* Safe subset of styles that can be applied as a classname.
|
|
16
16
|
*/
|
|
@@ -3,11 +3,11 @@ import { token } from '@atlaskit/tokens';
|
|
|
3
3
|
/**
|
|
4
4
|
* The breakpoints we have for responsiveness.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type Breakpoint = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
7
7
|
/**
|
|
8
8
|
* An object type mapping a value to each breakpoint (optionally)
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type ResponsiveObject<T> = Partial<Record<Breakpoint, T>>;
|
|
11
11
|
/**
|
|
12
12
|
* A map of breakpoints to CSS, commonly used to build maps given a responsive object
|
|
13
13
|
* so we can statically compile CSS upfront, but dynamically apply it.
|
|
@@ -23,11 +23,11 @@ export declare type ResponsiveObject<T> = Partial<Record<Breakpoint, T>>;
|
|
|
23
23
|
* return <div css={setMarginBreakpoints.map(breakpoint => marginMediaQueries[breakpoint])} />
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type ResponsiveCSSObject = ResponsiveObject<SerializedStyles>;
|
|
27
27
|
/**
|
|
28
28
|
* Our internal breakpoint config used to build media queries and define attributes for certain components.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type BreakpointConfig = {
|
|
31
31
|
/**
|
|
32
32
|
* The gap between a `GridItem`.
|
|
33
33
|
*/
|