@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.
Files changed (42) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +6 -2
  3. package/box/package.json +2 -2
  4. package/constellation/box/code.mdx +6 -2
  5. package/constellation/box/usage.mdx +30 -0
  6. package/constellation/inline/usage.mdx +36 -0
  7. package/constellation/overview/images/box-usage-example.png +0 -0
  8. package/constellation/overview/images/inline-usage-example.png +0 -0
  9. package/constellation/overview/images/stack-usage-example.png +0 -0
  10. package/constellation/overview/index.mdx +66 -0
  11. package/constellation/stack/usage.mdx +31 -0
  12. package/dist/cjs/version.json +1 -1
  13. package/dist/cjs/xcss/style-maps.partial.js +13 -43
  14. package/dist/cjs/xcss/xcss.js +19 -19
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/es2019/xcss/style-maps.partial.js +12 -40
  17. package/dist/es2019/xcss/xcss.js +20 -20
  18. package/dist/esm/version.json +1 -1
  19. package/dist/esm/xcss/style-maps.partial.js +12 -40
  20. package/dist/esm/xcss/xcss.js +20 -20
  21. package/dist/types/components/box.d.ts +2 -2
  22. package/dist/types/components/inline.d.ts +7 -7
  23. package/dist/types/components/internal/base-box.d.ts +15 -14
  24. package/dist/types/components/stack.d.ts +6 -6
  25. package/dist/types/components/types.d.ts +2 -2
  26. package/dist/types/constants.d.ts +1 -1
  27. package/dist/types/helpers/responsive/types.d.ts +4 -4
  28. package/dist/types/xcss/style-maps.partial.d.ts +79 -131
  29. package/dist/types/xcss/xcss.d.ts +11 -11
  30. package/extract-react-types/box-props.tsx +95 -0
  31. package/extract-react-types/inline-props.tsx +86 -1
  32. package/extract-react-types/stack-props.tsx +70 -1
  33. package/inline/package.json +2 -2
  34. package/package.json +18 -10
  35. package/report.api.md +87 -350
  36. package/responsive/package.json +2 -2
  37. package/scripts/codegen-file-templates/dimensions.tsx +17 -16
  38. package/scripts/codegen-styles.tsx +2 -2
  39. package/scripts/spacing-codegen-template.tsx +24 -91
  40. package/stack/package.json +2 -2
  41. package/tmp/api-report-tmp.d.ts +74 -99
  42. 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::fc517b480964965a9d7e6e5c8d921c19>>
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::9e8ad113b10e9429c514c69bd362f479>>
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
- export declare type Width = keyof typeof dimensionMap;
21
- export declare type Height = keyof typeof dimensionMap;
22
- export declare type MinWidth = keyof typeof dimensionMap;
23
- export declare type MaxWidth = keyof typeof dimensionMap;
24
- export declare type MinHeight = keyof typeof dimensionMap;
25
- export declare type MaxHeight = keyof typeof dimensionMap;
26
- export declare type Top = keyof typeof dimensionMap;
27
- export declare type Left = keyof typeof dimensionMap;
28
- export declare type Bottom = keyof typeof dimensionMap;
29
- export declare type Right = keyof typeof dimensionMap;
30
- export declare type BlockSize = keyof typeof dimensionMap;
31
- export declare type InlineSize = keyof typeof dimensionMap;
32
- export declare type MaxBlockSize = keyof typeof dimensionMap;
33
- export declare type MaxInlineSize = keyof typeof dimensionMap;
34
- export declare type MinBlockSize = keyof typeof dimensionMap;
35
- export declare type MinInlineSize = keyof typeof dimensionMap;
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::8ce817b8abf862e7945a9c9792a1255e>>
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
- readonly 'space.0': "var(--ds-space-0)";
76
- readonly 'space.025': "var(--ds-space-025)";
77
- readonly 'space.050': "var(--ds-space-050)";
78
- readonly 'space.075': "var(--ds-space-075)";
79
- readonly 'space.100': "var(--ds-space-100)";
80
- readonly 'space.150': "var(--ds-space-150)";
81
- readonly 'space.200': "var(--ds-space-200)";
82
- readonly 'space.250': "var(--ds-space-250)";
83
- readonly 'space.300': "var(--ds-space-300)";
84
- readonly 'space.400': "var(--ds-space-400)";
85
- readonly 'space.500': "var(--ds-space-500)";
86
- readonly 'space.600': "var(--ds-space-600)";
87
- readonly 'space.800': "var(--ds-space-800)";
88
- readonly 'space.1000': "var(--ds-space-1000)";
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 declare type Inset = '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';
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 declare type BorderColor = keyof typeof borderColorMap;
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 declare type BackgroundColor = keyof typeof backgroundColorMap;
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 declare type Shadow = keyof typeof shadowMap;
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 declare type TextColor = keyof typeof textColorMap;
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::8838ca696c1fa533db0eb127be15d81e>>
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::9e8ad113b10e9429c514c69bd362f479>>
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 declare type AlignSelf = keyof typeof alignSelfMap;
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 declare type BorderStyle = keyof typeof borderStyleMap;
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 declare type Display = keyof typeof displayMap;
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 declare type FlexDirection = keyof typeof flexDirectionMap;
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 declare type FlexGrow = keyof typeof flexGrowMap;
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 declare type FlexShrink = keyof typeof flexShrinkMap;
305
+ export type FlexShrink = keyof typeof flexShrinkMap;
358
306
  export declare const flexMap: {
359
307
  readonly '1': 1;
360
308
  };
361
- export declare type Flex = keyof typeof flexMap;
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 declare type Layer = keyof typeof layerMap;
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 declare type Overflow = keyof typeof overflowMap;
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 declare type OverflowInline = keyof typeof overflowInlineMap;
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 declare type OverflowBlock = keyof typeof overflowBlockMap;
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 declare type Position = keyof typeof positionMap;
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 declare type BorderWidth = keyof typeof borderWidthMap;
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 declare type BorderRadius = keyof typeof borderRadiusMap;
369
+ export type BorderRadius = keyof typeof borderRadiusMap;
422
370
  /**
423
371
  * @codegenEnd
424
372
  */
425
- export declare type TokenisedProps = {
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?: 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?: Gap;
390
+ gap?: Space;
443
391
  height?: Height;
444
392
  inlineSize?: InlineSize;
445
- inset?: Inset;
446
- insetBlock?: InsetBlock;
447
- insetBlockEnd?: InsetBlockEnd;
448
- insetBlockStart?: InsetBlockStart;
449
- insetInline?: InsetInline;
450
- insetInlineEnd?: InsetInlineEnd;
451
- insetInlineStart?: 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?: Padding;
410
+ outlineOffset?: Space;
463
411
  outlineWidth?: BorderWidth;
464
412
  overflow?: Overflow;
465
413
  overflowBlock?: OverflowBlock;
466
414
  overflowInline?: OverflowInline;
467
- padding?: Padding;
468
- paddingBlock?: PaddingBlock;
469
- paddingBlockEnd?: PaddingBlockEnd;
470
- paddingBlockStart?: PaddingBlockStart;
471
- paddingInline?: PaddingInline;
472
- paddingInlineEnd?: PaddingInlineEnd;
473
- paddingInlineStart?: 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?: 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
- declare type SpacingProperty = (typeof spacingProperties)[number];
483
- declare type SpacingToken = keyof typeof paddingMap;
484
- declare type BackgroundColorToken = keyof typeof backgroundColorMap;
485
- declare type SpacingStyleMap = Record<SpacingProperty, Record<SpacingToken, SerializedStyles>>;
486
- declare type BackgroundColorStyleMap = Record<BackgroundColorToken, SerializedStyles>;
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
- declare type ParsedXcss = ReturnType<typeof cssEmotion> | ReturnType<typeof cssEmotion>[];
12
+ type ParsedXcss = ReturnType<typeof cssEmotion> | ReturnType<typeof cssEmotion>[];
13
13
  export declare const parseXcss: (args: XCSS | Array<XCSS | false | undefined>) => ParsedXcss;
14
- declare type CSSPseudos = {
14
+ type CSSPseudos = {
15
15
  [Pseudo in CSS.Pseudos]?: SafeCSSObject;
16
16
  };
17
- declare type SafeCSSObject = CSSPseudos & TokenisedProps & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
18
- declare type ScopedSafeCSSObject<T extends keyof SafeCSSObject> = Pick<SafeCSSObject, T>;
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
- declare type XCSS = ReturnType<typeof boxWrapper> | ReturnType<typeof inlineWrapper>;
26
- declare type AllowedBoxStyles = keyof SafeCSSObject;
27
- declare type AllowedInlineStyles = 'backgroundColor' | 'padding';
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 declare type BoxStyles = SerializedStyles & {
44
+ export type BoxStyles = SerializedStyles & {
45
45
  [boxTag]: true;
46
46
  };
47
- export declare type BoxXCSS = {
47
+ export type BoxXCSS = {
48
48
  readonly [uniqueSymbol]: BoxStyles;
49
49
  };
50
50
  declare const inlineTag: unique symbol;
51
- export declare type InlineStyles = SerializedStyles & {
51
+ export type InlineStyles = SerializedStyles & {
52
52
  [inlineTag]: true;
53
53
  };
54
- export declare type InlineXCSS = {
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 type { InlineProps } from '../src/components/inline';
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) {}