@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SerializedStyles } from '@emotion/react';
|
|
2
2
|
/**
|
|
3
3
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
4
|
-
* @codegen <<SignedSource::
|
|
4
|
+
* @codegen <<SignedSource::7d4a8604dc454e30c0fec5c1330ea7c5>>
|
|
5
5
|
* @codegenId dimensions
|
|
6
6
|
* @codegenCommand yarn codegen-styles
|
|
7
7
|
* @codegenParams ["dimensions"]
|
|
8
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
9
9
|
*/
|
|
10
10
|
export declare const dimensionMap: {
|
|
11
11
|
readonly '100%': "100%";
|
|
@@ -17,102 +17,50 @@ export declare const dimensionMap: {
|
|
|
17
17
|
readonly 'size.600': "96px";
|
|
18
18
|
readonly 'size.1000': "192px";
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
20
|
+
type Dimension = keyof typeof dimensionMap;
|
|
21
|
+
export type Width = Dimension;
|
|
22
|
+
export type Height = Dimension;
|
|
23
|
+
export type MinWidth = Dimension;
|
|
24
|
+
export type MaxWidth = Dimension;
|
|
25
|
+
export type MinHeight = Dimension;
|
|
26
|
+
export type MaxHeight = Dimension;
|
|
27
|
+
export type Top = Dimension;
|
|
28
|
+
export type Left = Dimension;
|
|
29
|
+
export type Bottom = Dimension;
|
|
30
|
+
export type Right = Dimension;
|
|
31
|
+
export type BlockSize = Dimension;
|
|
32
|
+
export type InlineSize = Dimension;
|
|
33
|
+
export type MaxBlockSize = Dimension;
|
|
34
|
+
export type MaxInlineSize = Dimension;
|
|
35
|
+
export type MinBlockSize = Dimension;
|
|
36
|
+
export type MinInlineSize = Dimension;
|
|
36
37
|
/**
|
|
37
38
|
* @codegenEnd
|
|
38
39
|
*/
|
|
39
40
|
/**
|
|
40
41
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
41
|
-
* @codegen <<SignedSource::
|
|
42
|
+
* @codegen <<SignedSource::9fbc4dfcd8f43f52bff6b3bb666397fe>>
|
|
42
43
|
* @codegenId spacing
|
|
43
44
|
* @codegenCommand yarn codegen-styles
|
|
44
|
-
* @codegenParams ["padding", "space", "inset"]
|
|
45
45
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
46
46
|
*/
|
|
47
|
-
export declare const paddingMap: {
|
|
48
|
-
readonly 'space.0': "var(--ds-space-0)";
|
|
49
|
-
readonly 'space.025': "var(--ds-space-025)";
|
|
50
|
-
readonly 'space.050': "var(--ds-space-050)";
|
|
51
|
-
readonly 'space.075': "var(--ds-space-075)";
|
|
52
|
-
readonly 'space.100': "var(--ds-space-100)";
|
|
53
|
-
readonly 'space.150': "var(--ds-space-150)";
|
|
54
|
-
readonly 'space.200': "var(--ds-space-200)";
|
|
55
|
-
readonly 'space.250': "var(--ds-space-250)";
|
|
56
|
-
readonly 'space.300': "var(--ds-space-300)";
|
|
57
|
-
readonly 'space.400': "var(--ds-space-400)";
|
|
58
|
-
readonly 'space.500': "var(--ds-space-500)";
|
|
59
|
-
readonly 'space.600': "var(--ds-space-600)";
|
|
60
|
-
readonly 'space.800': "var(--ds-space-800)";
|
|
61
|
-
readonly 'space.1000': "var(--ds-space-1000)";
|
|
62
|
-
};
|
|
63
|
-
export declare type Padding = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
64
|
-
export declare type PaddingBlock = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
65
|
-
export declare type PaddingBlockEnd = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
66
|
-
export declare type PaddingBlockStart = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
67
|
-
export declare type PaddingBottom = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
68
|
-
export declare type PaddingInline = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
69
|
-
export declare type PaddingInlineEnd = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
70
|
-
export declare type PaddingInlineStart = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
71
|
-
export declare type PaddingLeft = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
72
|
-
export declare type PaddingRight = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
73
|
-
export declare type PaddingTop = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
74
47
|
export declare const spaceMap: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
export declare type Gap = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
91
|
-
export declare type RowGap = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
92
|
-
export declare type ColumnGap = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
93
|
-
export declare const insetMap: {
|
|
94
|
-
readonly 'space.0': "var(--ds-space-0)";
|
|
95
|
-
readonly 'space.025': "var(--ds-space-025)";
|
|
96
|
-
readonly 'space.050': "var(--ds-space-050)";
|
|
97
|
-
readonly 'space.075': "var(--ds-space-075)";
|
|
98
|
-
readonly 'space.100': "var(--ds-space-100)";
|
|
99
|
-
readonly 'space.150': "var(--ds-space-150)";
|
|
100
|
-
readonly 'space.200': "var(--ds-space-200)";
|
|
101
|
-
readonly 'space.250': "var(--ds-space-250)";
|
|
102
|
-
readonly 'space.300': "var(--ds-space-300)";
|
|
103
|
-
readonly 'space.400': "var(--ds-space-400)";
|
|
104
|
-
readonly 'space.500': "var(--ds-space-500)";
|
|
105
|
-
readonly 'space.600': "var(--ds-space-600)";
|
|
106
|
-
readonly 'space.800': "var(--ds-space-800)";
|
|
107
|
-
readonly 'space.1000': "var(--ds-space-1000)";
|
|
48
|
+
'space.0': "var(--ds-space-0)";
|
|
49
|
+
'space.025': "var(--ds-space-025)";
|
|
50
|
+
'space.050': "var(--ds-space-050)";
|
|
51
|
+
'space.075': "var(--ds-space-075)";
|
|
52
|
+
'space.100': "var(--ds-space-100)";
|
|
53
|
+
'space.150': "var(--ds-space-150)";
|
|
54
|
+
'space.200': "var(--ds-space-200)";
|
|
55
|
+
'space.250': "var(--ds-space-250)";
|
|
56
|
+
'space.300': "var(--ds-space-300)";
|
|
57
|
+
'space.400': "var(--ds-space-400)";
|
|
58
|
+
'space.500': "var(--ds-space-500)";
|
|
59
|
+
'space.600': "var(--ds-space-600)";
|
|
60
|
+
'space.800': "var(--ds-space-800)";
|
|
61
|
+
'space.1000': "var(--ds-space-1000)";
|
|
108
62
|
};
|
|
109
|
-
export
|
|
110
|
-
export declare type InsetBlock = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
111
|
-
export declare type InsetBlockEnd = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
112
|
-
export declare type InsetBlockStart = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
113
|
-
export declare type InsetInline = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
114
|
-
export declare type InsetInlineEnd = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
115
|
-
export declare type InsetInlineStart = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
|
|
63
|
+
export type Space = keyof typeof spaceMap;
|
|
116
64
|
/**
|
|
117
65
|
* @codegenEnd
|
|
118
66
|
*/
|
|
@@ -148,7 +96,7 @@ export declare const borderColorMap: {
|
|
|
148
96
|
readonly information: "var(--ds-border-information)";
|
|
149
97
|
readonly bold: "var(--ds-border-bold)";
|
|
150
98
|
};
|
|
151
|
-
export
|
|
99
|
+
export type BorderColor = keyof typeof borderColorMap;
|
|
152
100
|
export declare const backgroundColorMap: {
|
|
153
101
|
readonly 'accent.red.subtlest': "var(--ds-background-accent-red-subtlest)";
|
|
154
102
|
readonly 'accent.red.subtler': "var(--ds-background-accent-red-subtler)";
|
|
@@ -255,7 +203,7 @@ export declare const backgroundColorMap: {
|
|
|
255
203
|
readonly 'elevation.surface.raised.pressed': "var(--ds-surface-raised-pressed)";
|
|
256
204
|
readonly 'elevation.surface.sunken': "var(--ds-surface-sunken)";
|
|
257
205
|
};
|
|
258
|
-
export
|
|
206
|
+
export type BackgroundColor = keyof typeof backgroundColorMap;
|
|
259
207
|
export declare const shadowMap: {
|
|
260
208
|
readonly overflow: "var(--ds-shadow-overflow)";
|
|
261
209
|
readonly 'overflow.perimeter': "var(--ds-shadow-overflow-perimeter)";
|
|
@@ -263,7 +211,7 @@ export declare const shadowMap: {
|
|
|
263
211
|
readonly overlay: "var(--ds-shadow-overlay)";
|
|
264
212
|
readonly raised: "var(--ds-shadow-raised)";
|
|
265
213
|
};
|
|
266
|
-
export
|
|
214
|
+
export type Shadow = keyof typeof shadowMap;
|
|
267
215
|
export declare const textColorMap: {
|
|
268
216
|
readonly 'color.text': "var(--ds-text)";
|
|
269
217
|
readonly 'accent.red': "var(--ds-text-accent-red)";
|
|
@@ -297,19 +245,19 @@ export declare const textColorMap: {
|
|
|
297
245
|
readonly subtlest: "var(--ds-text-subtlest)";
|
|
298
246
|
readonly subtle: "var(--ds-text-subtle)";
|
|
299
247
|
};
|
|
300
|
-
export
|
|
248
|
+
export type TextColor = keyof typeof textColorMap;
|
|
301
249
|
/**
|
|
302
250
|
* @codegenEnd
|
|
303
251
|
*/
|
|
304
252
|
/**
|
|
305
253
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
306
|
-
* @codegen <<SignedSource::
|
|
254
|
+
* @codegen <<SignedSource::64f7b08cdbce710fba3157594ea695a8>>
|
|
307
255
|
* @codegenId misc
|
|
308
256
|
* @codegenCommand yarn codegen-styles
|
|
309
257
|
* @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
310
258
|
* @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
|
|
311
259
|
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
312
|
-
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::
|
|
260
|
+
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
|
|
313
261
|
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
|
|
314
262
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
315
263
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
@@ -326,12 +274,12 @@ export declare const alignSelfMap: {
|
|
|
326
274
|
readonly end: "end";
|
|
327
275
|
readonly baseline: "baseline";
|
|
328
276
|
};
|
|
329
|
-
export
|
|
277
|
+
export type AlignSelf = keyof typeof alignSelfMap;
|
|
330
278
|
export declare const borderStyleMap: {
|
|
331
279
|
readonly none: "none";
|
|
332
280
|
readonly solid: "solid";
|
|
333
281
|
};
|
|
334
|
-
export
|
|
282
|
+
export type BorderStyle = keyof typeof borderStyleMap;
|
|
335
283
|
export declare const displayMap: {
|
|
336
284
|
readonly flex: "flex";
|
|
337
285
|
readonly block: "block";
|
|
@@ -339,26 +287,26 @@ export declare const displayMap: {
|
|
|
339
287
|
readonly inlineBlock: "inline-block";
|
|
340
288
|
readonly inlineFlex: "inline-flex";
|
|
341
289
|
};
|
|
342
|
-
export
|
|
290
|
+
export type Display = keyof typeof displayMap;
|
|
343
291
|
export declare const flexDirectionMap: {
|
|
344
292
|
readonly row: "row";
|
|
345
293
|
readonly column: "column";
|
|
346
294
|
};
|
|
347
|
-
export
|
|
295
|
+
export type FlexDirection = keyof typeof flexDirectionMap;
|
|
348
296
|
export declare const flexGrowMap: {
|
|
349
297
|
readonly '0': 0;
|
|
350
298
|
readonly '1': 1;
|
|
351
299
|
};
|
|
352
|
-
export
|
|
300
|
+
export type FlexGrow = keyof typeof flexGrowMap;
|
|
353
301
|
export declare const flexShrinkMap: {
|
|
354
302
|
readonly '0': 0;
|
|
355
303
|
readonly '1': 1;
|
|
356
304
|
};
|
|
357
|
-
export
|
|
305
|
+
export type FlexShrink = keyof typeof flexShrinkMap;
|
|
358
306
|
export declare const flexMap: {
|
|
359
307
|
readonly '1': 1;
|
|
360
308
|
};
|
|
361
|
-
export
|
|
309
|
+
export type Flex = keyof typeof flexMap;
|
|
362
310
|
export declare const layerMap: {
|
|
363
311
|
readonly card: 100;
|
|
364
312
|
readonly navigation: 200;
|
|
@@ -370,29 +318,29 @@ export declare const layerMap: {
|
|
|
370
318
|
readonly spotlight: 700;
|
|
371
319
|
readonly tooltip: 800;
|
|
372
320
|
};
|
|
373
|
-
export
|
|
321
|
+
export type Layer = keyof typeof layerMap;
|
|
374
322
|
export declare const overflowMap: {
|
|
375
323
|
readonly auto: "auto";
|
|
376
324
|
readonly hidden: "hidden";
|
|
377
325
|
};
|
|
378
|
-
export
|
|
326
|
+
export type Overflow = keyof typeof overflowMap;
|
|
379
327
|
export declare const overflowInlineMap: {
|
|
380
328
|
readonly auto: "auto";
|
|
381
329
|
readonly hidden: "hidden";
|
|
382
330
|
};
|
|
383
|
-
export
|
|
331
|
+
export type OverflowInline = keyof typeof overflowInlineMap;
|
|
384
332
|
export declare const overflowBlockMap: {
|
|
385
333
|
readonly auto: "auto";
|
|
386
334
|
readonly hidden: "hidden";
|
|
387
335
|
};
|
|
388
|
-
export
|
|
336
|
+
export type OverflowBlock = keyof typeof overflowBlockMap;
|
|
389
337
|
export declare const positionMap: {
|
|
390
338
|
readonly absolute: "absolute";
|
|
391
339
|
readonly fixed: "fixed";
|
|
392
340
|
readonly relative: "relative";
|
|
393
341
|
readonly static: "static";
|
|
394
342
|
};
|
|
395
|
-
export
|
|
343
|
+
export type Position = keyof typeof positionMap;
|
|
396
344
|
/**
|
|
397
345
|
* @codegenEnd
|
|
398
346
|
*/
|
|
@@ -409,7 +357,7 @@ export declare const borderWidthMap: {
|
|
|
409
357
|
readonly 'width.050': "var(--ds-width-050)";
|
|
410
358
|
readonly 'width.100': "var(--ds-width-100)";
|
|
411
359
|
};
|
|
412
|
-
export
|
|
360
|
+
export type BorderWidth = keyof typeof borderWidthMap;
|
|
413
361
|
export declare const borderRadiusMap: {
|
|
414
362
|
readonly 'radius.050': "var(--ds-radius-050)";
|
|
415
363
|
readonly 'radius.100': "var(--ds-radius-100)";
|
|
@@ -418,11 +366,11 @@ export declare const borderRadiusMap: {
|
|
|
418
366
|
readonly 'radius.400': "var(--ds-radius-400)";
|
|
419
367
|
readonly 'radius.round': "var(--ds-radius-round)";
|
|
420
368
|
};
|
|
421
|
-
export
|
|
369
|
+
export type BorderRadius = keyof typeof borderRadiusMap;
|
|
422
370
|
/**
|
|
423
371
|
* @codegenEnd
|
|
424
372
|
*/
|
|
425
|
-
export
|
|
373
|
+
export type TokenisedProps = {
|
|
426
374
|
alignSelf?: AlignSelf;
|
|
427
375
|
backgroundColor?: BackgroundColor;
|
|
428
376
|
blockSize?: BlockSize;
|
|
@@ -433,22 +381,22 @@ export declare type TokenisedProps = {
|
|
|
433
381
|
bottom?: Bottom;
|
|
434
382
|
boxShadow?: Shadow;
|
|
435
383
|
color?: TextColor;
|
|
436
|
-
columnGap?:
|
|
384
|
+
columnGap?: Space;
|
|
437
385
|
display?: Display;
|
|
438
386
|
flex?: Flex;
|
|
439
387
|
flexDirection?: FlexDirection;
|
|
440
388
|
flexGrow?: FlexGrow;
|
|
441
389
|
flexShrink?: FlexShrink;
|
|
442
|
-
gap?:
|
|
390
|
+
gap?: Space;
|
|
443
391
|
height?: Height;
|
|
444
392
|
inlineSize?: InlineSize;
|
|
445
|
-
inset?:
|
|
446
|
-
insetBlock?:
|
|
447
|
-
insetBlockEnd?:
|
|
448
|
-
insetBlockStart?:
|
|
449
|
-
insetInline?:
|
|
450
|
-
insetInlineEnd?:
|
|
451
|
-
insetInlineStart?:
|
|
393
|
+
inset?: Space;
|
|
394
|
+
insetBlock?: Space;
|
|
395
|
+
insetBlockEnd?: Space;
|
|
396
|
+
insetBlockStart?: Space;
|
|
397
|
+
insetInline?: Space;
|
|
398
|
+
insetInlineEnd?: Space;
|
|
399
|
+
insetInlineStart?: Space;
|
|
452
400
|
left?: Left;
|
|
453
401
|
maxBlockSize?: MaxBlockSize;
|
|
454
402
|
maxHeight?: MaxHeight;
|
|
@@ -459,31 +407,31 @@ export declare type TokenisedProps = {
|
|
|
459
407
|
minInlineSize?: MinInlineSize;
|
|
460
408
|
minWidth?: MinWidth;
|
|
461
409
|
outlineColor?: BorderColor;
|
|
462
|
-
outlineOffset?:
|
|
410
|
+
outlineOffset?: Space;
|
|
463
411
|
outlineWidth?: BorderWidth;
|
|
464
412
|
overflow?: Overflow;
|
|
465
413
|
overflowBlock?: OverflowBlock;
|
|
466
414
|
overflowInline?: OverflowInline;
|
|
467
|
-
padding?:
|
|
468
|
-
paddingBlock?:
|
|
469
|
-
paddingBlockEnd?:
|
|
470
|
-
paddingBlockStart?:
|
|
471
|
-
paddingInline?:
|
|
472
|
-
paddingInlineEnd?:
|
|
473
|
-
paddingInlineStart?:
|
|
415
|
+
padding?: Space;
|
|
416
|
+
paddingBlock?: Space;
|
|
417
|
+
paddingBlockEnd?: Space;
|
|
418
|
+
paddingBlockStart?: Space;
|
|
419
|
+
paddingInline?: Space;
|
|
420
|
+
paddingInlineEnd?: Space;
|
|
421
|
+
paddingInlineStart?: Space;
|
|
474
422
|
position?: Position;
|
|
475
423
|
right?: Right;
|
|
476
|
-
rowGap?:
|
|
424
|
+
rowGap?: Space;
|
|
477
425
|
top?: Top;
|
|
478
426
|
width?: Width;
|
|
479
427
|
zIndex?: Layer;
|
|
480
428
|
};
|
|
481
429
|
declare const spacingProperties: readonly ["padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "gap", "rowGap", "columnGap"];
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
430
|
+
type SpacingProperty = (typeof spacingProperties)[number];
|
|
431
|
+
type SpacingToken = keyof typeof spaceMap;
|
|
432
|
+
type BackgroundColorToken = keyof typeof backgroundColorMap;
|
|
433
|
+
type SpacingStyleMap = Record<SpacingProperty, Record<SpacingToken, SerializedStyles>>;
|
|
434
|
+
type BackgroundColorStyleMap = Record<BackgroundColorToken, SerializedStyles>;
|
|
487
435
|
export declare const paddingStylesMap: SpacingStyleMap;
|
|
488
436
|
export declare const spaceStylesMap: SpacingStyleMap;
|
|
489
437
|
export declare const backgroundColorStylesMap: BackgroundColorStyleMap;
|
|
@@ -9,22 +9,22 @@ declare const uniqueSymbol: unique symbol;
|
|
|
9
9
|
* @internal used in primitives
|
|
10
10
|
* @returns a collection of styles that can be applied to the respective primitive
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
type ParsedXcss = ReturnType<typeof cssEmotion> | ReturnType<typeof cssEmotion>[];
|
|
13
13
|
export declare const parseXcss: (args: XCSS | Array<XCSS | false | undefined>) => ParsedXcss;
|
|
14
|
-
|
|
14
|
+
type CSSPseudos = {
|
|
15
15
|
[Pseudo in CSS.Pseudos]?: SafeCSSObject;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
type SafeCSSObject = CSSPseudos & TokenisedProps & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
|
|
18
|
+
type ScopedSafeCSSObject<T extends keyof SafeCSSObject> = Pick<SafeCSSObject, T>;
|
|
19
19
|
declare const boxWrapper: (style: any) => {
|
|
20
20
|
readonly [uniqueSymbol]: BoxStyles;
|
|
21
21
|
};
|
|
22
22
|
declare const inlineWrapper: (style: any) => {
|
|
23
23
|
readonly [uniqueSymbol]: InlineStyles;
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
type XCSS = ReturnType<typeof boxWrapper> | ReturnType<typeof inlineWrapper>;
|
|
26
|
+
type AllowedBoxStyles = keyof SafeCSSObject;
|
|
27
|
+
type AllowedInlineStyles = 'backgroundColor' | 'padding';
|
|
28
28
|
/**
|
|
29
29
|
* ### xcss
|
|
30
30
|
*
|
|
@@ -41,17 +41,17 @@ export declare function xcss<Primitive extends typeof Box | typeof Inline = type
|
|
|
41
41
|
readonly [uniqueSymbol]: Primitive extends (<T extends import("react").ElementType<any> = "div">(props: import("../index").BoxProps<T>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null) & import("react").FC<import("../index").BoxProps<"div">> ? BoxStyles : Primitive extends import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<import("../index").InlineProps<import("react").ElementType<any>>, "as" | "children" | "testId" | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "space" | "rowSpace" | "separator"> & import("react").RefAttributes<any>>> ? InlineStyles : never;
|
|
42
42
|
};
|
|
43
43
|
declare const boxTag: unique symbol;
|
|
44
|
-
export
|
|
44
|
+
export type BoxStyles = SerializedStyles & {
|
|
45
45
|
[boxTag]: true;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type BoxXCSS = {
|
|
48
48
|
readonly [uniqueSymbol]: BoxStyles;
|
|
49
49
|
};
|
|
50
50
|
declare const inlineTag: unique symbol;
|
|
51
|
-
export
|
|
51
|
+
export type InlineStyles = SerializedStyles & {
|
|
52
52
|
[inlineTag]: true;
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type InlineXCSS = {
|
|
55
55
|
readonly [uniqueSymbol]: InlineStyles;
|
|
56
56
|
};
|
|
57
57
|
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// TODO: Switch from ERT to ts-morph when this is completed and has reasonable adoption: https://product-fabric.atlassian.net/browse/DSP-10364
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { As } from '../src/components/internal/base-box';
|
|
5
|
+
import {
|
|
6
|
+
BasePrimitiveProps,
|
|
7
|
+
PublicBoxPropsBase,
|
|
8
|
+
} from '../src/components/types';
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
11
|
+
namespace Token {
|
|
12
|
+
// BoxProps['backgroundColor'] uses keyof, which ERT does not understand
|
|
13
|
+
export type BackgroundColor = 'BackgroundColor';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type Space =
|
|
17
|
+
| 'space.0'
|
|
18
|
+
| 'space.025'
|
|
19
|
+
| 'space.050'
|
|
20
|
+
| 'space.075'
|
|
21
|
+
| 'space.100'
|
|
22
|
+
| 'space.150'
|
|
23
|
+
| 'space.200'
|
|
24
|
+
| 'space.250'
|
|
25
|
+
| 'space.300'
|
|
26
|
+
| 'space.400'
|
|
27
|
+
| 'space.500'
|
|
28
|
+
| 'space.600'
|
|
29
|
+
| 'space.800'
|
|
30
|
+
| 'space.1000';
|
|
31
|
+
|
|
32
|
+
export default function Box(
|
|
33
|
+
_: {
|
|
34
|
+
/**
|
|
35
|
+
* The DOM element to render as the Box. Defaults to `div`.
|
|
36
|
+
*/
|
|
37
|
+
as?: As;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Tokens representing CSS shorthand for `paddingBlock` and `paddingInline` together.
|
|
41
|
+
*/
|
|
42
|
+
padding?: Space;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Tokens representing CSS shorthand `paddingBlock`.
|
|
46
|
+
*/
|
|
47
|
+
paddingBlock?: Space;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Tokens representing CSS `paddingBlockStart`.
|
|
51
|
+
*/
|
|
52
|
+
paddingBlockStart?: Space;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Tokens representing CSS `paddingBlockEnd`.
|
|
56
|
+
*/
|
|
57
|
+
paddingBlockEnd?: Space;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Tokens representing CSS shorthand `paddingInline`.
|
|
61
|
+
*/
|
|
62
|
+
paddingInline?: Space;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Tokens representing CSS `paddingInlineStart`.
|
|
66
|
+
*/
|
|
67
|
+
paddingInlineStart?: Space;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Tokens representing CSS `paddingInlineEnd`.
|
|
71
|
+
*/
|
|
72
|
+
paddingInlineEnd?: Space;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A token alias for background color. See:<br>
|
|
76
|
+
* [https://atlassian.design/components/tokens/all-tokens#color-background](https://atlassian.design/components/tokens/all-tokens#color-background)
|
|
77
|
+
*/
|
|
78
|
+
backgroundColor?: Token.BackgroundColor;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Elements to be rendered inside the primitive.
|
|
82
|
+
*/
|
|
83
|
+
children?: ReactNode;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Apply a subset of permitted styles, powered by Atlassian Design System tokens.
|
|
87
|
+
*/
|
|
88
|
+
xcss?: PublicBoxPropsBase['xcss'];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Forwarded ref element.
|
|
92
|
+
*/
|
|
93
|
+
ref?: React.ComponentPropsWithRef<As>['ref'];
|
|
94
|
+
} & BasePrimitiveProps,
|
|
95
|
+
) {}
|
|
@@ -1,3 +1,88 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
AlignBlock,
|
|
5
|
+
AlignInline,
|
|
6
|
+
Grow,
|
|
7
|
+
Spread,
|
|
8
|
+
} from '../src/components/inline';
|
|
9
|
+
|
|
10
|
+
type Space =
|
|
11
|
+
| 'space.0'
|
|
12
|
+
| 'space.025'
|
|
13
|
+
| 'space.050'
|
|
14
|
+
| 'space.075'
|
|
15
|
+
| 'space.100'
|
|
16
|
+
| 'space.150'
|
|
17
|
+
| 'space.200'
|
|
18
|
+
| 'space.250'
|
|
19
|
+
| 'space.300'
|
|
20
|
+
| 'space.400'
|
|
21
|
+
| 'space.500'
|
|
22
|
+
| 'space.600'
|
|
23
|
+
| 'space.800'
|
|
24
|
+
| 'space.1000';
|
|
25
|
+
|
|
26
|
+
interface InlineProps<T extends ElementType = 'div'> {
|
|
27
|
+
/**
|
|
28
|
+
* The DOM element to render as the Inline. Defaults to `div`.
|
|
29
|
+
*/
|
|
30
|
+
as?: 'div' | 'span' | 'ul' | 'ol';
|
|
31
|
+
/**
|
|
32
|
+
* Used to align children along the main axis.
|
|
33
|
+
*/
|
|
34
|
+
alignBlock?: AlignBlock;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Used to align children along the cross axis.
|
|
38
|
+
*/
|
|
39
|
+
alignInline?: AlignInline;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Used to set whether children are forced onto one line or will wrap onto multiple lines.
|
|
43
|
+
*/
|
|
44
|
+
shouldWrap?: boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Used to distribute the children along the main axis.
|
|
48
|
+
*/
|
|
49
|
+
spread?: Spread;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Used to set whether the container should grow to fill the available space.
|
|
53
|
+
*/
|
|
54
|
+
grow?: Grow;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Represents the space between each child.
|
|
58
|
+
*/
|
|
59
|
+
space?: Space;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Represents the space between rows when content wraps.
|
|
63
|
+
* Used to override the `space` value in between rows.
|
|
64
|
+
*/
|
|
65
|
+
rowSpace?: Space;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Renders a separator string between each child.
|
|
69
|
+
*/
|
|
70
|
+
separator?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
74
|
+
*/
|
|
75
|
+
testId?: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Elements to be rendered inside the Inline.
|
|
79
|
+
*/
|
|
80
|
+
children: ReactNode;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Forwarded ref element
|
|
84
|
+
*/
|
|
85
|
+
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
86
|
+
}
|
|
2
87
|
|
|
3
88
|
export default function Inline(_: InlineProps) {}
|