@atlaskit/primitives 0.9.1 → 0.9.3

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 (58) hide show
  1. package/CHANGELOG.md +13 -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 +39 -45
  14. package/dist/cjs/xcss/xcss.js +20 -19
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/es2019/xcss/style-maps.partial.js +37 -42
  17. package/dist/es2019/xcss/xcss.js +21 -20
  18. package/dist/esm/version.json +1 -1
  19. package/dist/esm/xcss/style-maps.partial.js +37 -42
  20. package/dist/esm/xcss/xcss.js +21 -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 +106 -133
  29. package/dist/types/xcss/xcss.d.ts +11 -11
  30. package/dist/types-ts4.5/components/box.d.ts +18 -0
  31. package/dist/types-ts4.5/components/inline.d.ts +75 -0
  32. package/dist/types-ts4.5/components/internal/base-box.d.ts +84 -0
  33. package/dist/types-ts4.5/components/stack.d.ts +61 -0
  34. package/dist/types-ts4.5/components/types.d.ts +18 -0
  35. package/dist/types-ts4.5/constants.d.ts +12 -0
  36. package/dist/types-ts4.5/helpers/responsive/build-media-query-css.d.ts +57 -0
  37. package/dist/types-ts4.5/helpers/responsive/constants.d.ts +31 -0
  38. package/dist/types-ts4.5/helpers/responsive/index.d.ts +4 -0
  39. package/dist/types-ts4.5/helpers/responsive/media-helper.d.ts +45 -0
  40. package/dist/types-ts4.5/helpers/responsive/types.d.ts +47 -0
  41. package/dist/types-ts4.5/index.d.ts +4 -0
  42. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +474 -0
  43. package/dist/types-ts4.5/xcss/xcss.d.ts +57 -0
  44. package/extract-react-types/box-props.tsx +95 -0
  45. package/extract-react-types/inline-props.tsx +86 -1
  46. package/extract-react-types/stack-props.tsx +70 -1
  47. package/inline/package.json +2 -2
  48. package/package.json +19 -11
  49. package/report.api.md +116 -350
  50. package/responsive/package.json +2 -2
  51. package/scripts/codegen-file-templates/dimensions.tsx +17 -16
  52. package/scripts/codegen-styles.tsx +2 -2
  53. package/scripts/color-codegen-template.tsx +7 -0
  54. package/scripts/spacing-codegen-template.tsx +24 -91
  55. package/stack/package.json +2 -2
  56. package/tmp/api-report-tmp.d.ts +103 -99
  57. package/tsconfig.node.json +7 -0
  58. 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,111 +17,59 @@ 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
  */
119
67
  /**
120
68
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
121
- * @codegen <<SignedSource::4da498214befc7e312ff00d4f9f5379f>>
69
+ * @codegen <<SignedSource::aa1cfa3cd24f141a85ac1e0b70dbd8a8>>
122
70
  * @codegenId colors
123
71
  * @codegenCommand yarn codegen-styles
124
- * @codegenParams ["border", "background", "shadow", "text"]
72
+ * @codegenParams ["border", "background", "shadow", "text", "fill"]
125
73
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
126
74
  */
127
75
  export declare const borderColorMap: {
@@ -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,43 @@ 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;
249
+ export declare const fillMap: {
250
+ readonly 'color.icon': "var(--ds-icon)";
251
+ readonly 'accent.red': "var(--ds-icon-accent-red)";
252
+ readonly 'accent.orange': "var(--ds-icon-accent-orange)";
253
+ readonly 'accent.yellow': "var(--ds-icon-accent-yellow)";
254
+ readonly 'accent.green': "var(--ds-icon-accent-green)";
255
+ readonly 'accent.teal': "var(--ds-icon-accent-teal)";
256
+ readonly 'accent.blue': "var(--ds-icon-accent-blue)";
257
+ readonly 'accent.purple': "var(--ds-icon-accent-purple)";
258
+ readonly 'accent.magenta': "var(--ds-icon-accent-magenta)";
259
+ readonly 'accent.gray': "var(--ds-icon-accent-gray)";
260
+ readonly disabled: "var(--ds-icon-disabled)";
261
+ readonly inverse: "var(--ds-icon-inverse)";
262
+ readonly selected: "var(--ds-icon-selected)";
263
+ readonly brand: "var(--ds-icon-brand)";
264
+ readonly danger: "var(--ds-icon-danger)";
265
+ readonly warning: "var(--ds-icon-warning)";
266
+ readonly 'warning.inverse': "var(--ds-icon-warning-inverse)";
267
+ readonly success: "var(--ds-icon-success)";
268
+ readonly discovery: "var(--ds-icon-discovery)";
269
+ readonly information: "var(--ds-icon-information)";
270
+ readonly subtle: "var(--ds-icon-subtle)";
271
+ };
272
+ export type Fill = keyof typeof fillMap;
301
273
  /**
302
274
  * @codegenEnd
303
275
  */
304
276
  /**
305
277
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
306
- * @codegen <<SignedSource::8838ca696c1fa533db0eb127be15d81e>>
278
+ * @codegen <<SignedSource::64f7b08cdbce710fba3157594ea695a8>>
307
279
  * @codegenId misc
308
280
  * @codegenCommand yarn codegen-styles
309
281
  * @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
310
282
  * @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
311
283
  * @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
312
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::9e8ad113b10e9429c514c69bd362f479>>
284
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::dbad5eb9ef292d4ec59f90459a81e1d6>>
313
285
  * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
314
286
  * @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
315
287
  * @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
@@ -326,12 +298,12 @@ export declare const alignSelfMap: {
326
298
  readonly end: "end";
327
299
  readonly baseline: "baseline";
328
300
  };
329
- export declare type AlignSelf = keyof typeof alignSelfMap;
301
+ export type AlignSelf = keyof typeof alignSelfMap;
330
302
  export declare const borderStyleMap: {
331
303
  readonly none: "none";
332
304
  readonly solid: "solid";
333
305
  };
334
- export declare type BorderStyle = keyof typeof borderStyleMap;
306
+ export type BorderStyle = keyof typeof borderStyleMap;
335
307
  export declare const displayMap: {
336
308
  readonly flex: "flex";
337
309
  readonly block: "block";
@@ -339,26 +311,26 @@ export declare const displayMap: {
339
311
  readonly inlineBlock: "inline-block";
340
312
  readonly inlineFlex: "inline-flex";
341
313
  };
342
- export declare type Display = keyof typeof displayMap;
314
+ export type Display = keyof typeof displayMap;
343
315
  export declare const flexDirectionMap: {
344
316
  readonly row: "row";
345
317
  readonly column: "column";
346
318
  };
347
- export declare type FlexDirection = keyof typeof flexDirectionMap;
319
+ export type FlexDirection = keyof typeof flexDirectionMap;
348
320
  export declare const flexGrowMap: {
349
321
  readonly '0': 0;
350
322
  readonly '1': 1;
351
323
  };
352
- export declare type FlexGrow = keyof typeof flexGrowMap;
324
+ export type FlexGrow = keyof typeof flexGrowMap;
353
325
  export declare const flexShrinkMap: {
354
326
  readonly '0': 0;
355
327
  readonly '1': 1;
356
328
  };
357
- export declare type FlexShrink = keyof typeof flexShrinkMap;
329
+ export type FlexShrink = keyof typeof flexShrinkMap;
358
330
  export declare const flexMap: {
359
331
  readonly '1': 1;
360
332
  };
361
- export declare type Flex = keyof typeof flexMap;
333
+ export type Flex = keyof typeof flexMap;
362
334
  export declare const layerMap: {
363
335
  readonly card: 100;
364
336
  readonly navigation: 200;
@@ -370,29 +342,29 @@ export declare const layerMap: {
370
342
  readonly spotlight: 700;
371
343
  readonly tooltip: 800;
372
344
  };
373
- export declare type Layer = keyof typeof layerMap;
345
+ export type Layer = keyof typeof layerMap;
374
346
  export declare const overflowMap: {
375
347
  readonly auto: "auto";
376
348
  readonly hidden: "hidden";
377
349
  };
378
- export declare type Overflow = keyof typeof overflowMap;
350
+ export type Overflow = keyof typeof overflowMap;
379
351
  export declare const overflowInlineMap: {
380
352
  readonly auto: "auto";
381
353
  readonly hidden: "hidden";
382
354
  };
383
- export declare type OverflowInline = keyof typeof overflowInlineMap;
355
+ export type OverflowInline = keyof typeof overflowInlineMap;
384
356
  export declare const overflowBlockMap: {
385
357
  readonly auto: "auto";
386
358
  readonly hidden: "hidden";
387
359
  };
388
- export declare type OverflowBlock = keyof typeof overflowBlockMap;
360
+ export type OverflowBlock = keyof typeof overflowBlockMap;
389
361
  export declare const positionMap: {
390
362
  readonly absolute: "absolute";
391
363
  readonly fixed: "fixed";
392
364
  readonly relative: "relative";
393
365
  readonly static: "static";
394
366
  };
395
- export declare type Position = keyof typeof positionMap;
367
+ export type Position = keyof typeof positionMap;
396
368
  /**
397
369
  * @codegenEnd
398
370
  */
@@ -409,7 +381,7 @@ export declare const borderWidthMap: {
409
381
  readonly 'width.050': "var(--ds-width-050)";
410
382
  readonly 'width.100': "var(--ds-width-100)";
411
383
  };
412
- export declare type BorderWidth = keyof typeof borderWidthMap;
384
+ export type BorderWidth = keyof typeof borderWidthMap;
413
385
  export declare const borderRadiusMap: {
414
386
  readonly 'radius.050': "var(--ds-radius-050)";
415
387
  readonly 'radius.100': "var(--ds-radius-100)";
@@ -418,11 +390,11 @@ export declare const borderRadiusMap: {
418
390
  readonly 'radius.400': "var(--ds-radius-400)";
419
391
  readonly 'radius.round': "var(--ds-radius-round)";
420
392
  };
421
- export declare type BorderRadius = keyof typeof borderRadiusMap;
393
+ export type BorderRadius = keyof typeof borderRadiusMap;
422
394
  /**
423
395
  * @codegenEnd
424
396
  */
425
- export declare type TokenisedProps = {
397
+ export type TokenisedProps = {
426
398
  alignSelf?: AlignSelf;
427
399
  backgroundColor?: BackgroundColor;
428
400
  blockSize?: BlockSize;
@@ -433,22 +405,23 @@ export declare type TokenisedProps = {
433
405
  bottom?: Bottom;
434
406
  boxShadow?: Shadow;
435
407
  color?: TextColor;
436
- columnGap?: ColumnGap;
408
+ columnGap?: Space;
437
409
  display?: Display;
410
+ fill?: Fill;
438
411
  flex?: Flex;
439
412
  flexDirection?: FlexDirection;
440
413
  flexGrow?: FlexGrow;
441
414
  flexShrink?: FlexShrink;
442
- gap?: Gap;
415
+ gap?: Space;
443
416
  height?: Height;
444
417
  inlineSize?: InlineSize;
445
- inset?: Inset;
446
- insetBlock?: InsetBlock;
447
- insetBlockEnd?: InsetBlockEnd;
448
- insetBlockStart?: InsetBlockStart;
449
- insetInline?: InsetInline;
450
- insetInlineEnd?: InsetInlineEnd;
451
- insetInlineStart?: InsetInlineStart;
418
+ inset?: Space;
419
+ insetBlock?: Space;
420
+ insetBlockEnd?: Space;
421
+ insetBlockStart?: Space;
422
+ insetInline?: Space;
423
+ insetInlineEnd?: Space;
424
+ insetInlineStart?: Space;
452
425
  left?: Left;
453
426
  maxBlockSize?: MaxBlockSize;
454
427
  maxHeight?: MaxHeight;
@@ -459,31 +432,31 @@ export declare type TokenisedProps = {
459
432
  minInlineSize?: MinInlineSize;
460
433
  minWidth?: MinWidth;
461
434
  outlineColor?: BorderColor;
462
- outlineOffset?: Padding;
435
+ outlineOffset?: Space;
463
436
  outlineWidth?: BorderWidth;
464
437
  overflow?: Overflow;
465
438
  overflowBlock?: OverflowBlock;
466
439
  overflowInline?: OverflowInline;
467
- padding?: Padding;
468
- paddingBlock?: PaddingBlock;
469
- paddingBlockEnd?: PaddingBlockEnd;
470
- paddingBlockStart?: PaddingBlockStart;
471
- paddingInline?: PaddingInline;
472
- paddingInlineEnd?: PaddingInlineEnd;
473
- paddingInlineStart?: PaddingInlineStart;
440
+ padding?: Space;
441
+ paddingBlock?: Space;
442
+ paddingBlockEnd?: Space;
443
+ paddingBlockStart?: Space;
444
+ paddingInline?: Space;
445
+ paddingInlineEnd?: Space;
446
+ paddingInlineStart?: Space;
474
447
  position?: Position;
475
448
  right?: Right;
476
- rowGap?: RowGap;
449
+ rowGap?: Space;
477
450
  top?: Top;
478
451
  width?: Width;
479
452
  zIndex?: Layer;
480
453
  };
481
454
  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>;
455
+ type SpacingProperty = (typeof spacingProperties)[number];
456
+ type SpacingToken = keyof typeof spaceMap;
457
+ type BackgroundColorToken = keyof typeof backgroundColorMap;
458
+ type SpacingStyleMap = Record<SpacingProperty, Record<SpacingToken, SerializedStyles>>;
459
+ type BackgroundColorStyleMap = Record<BackgroundColorToken, SerializedStyles>;
487
460
  export declare const paddingStylesMap: SpacingStyleMap;
488
461
  export declare const spaceStylesMap: SpacingStyleMap;
489
462
  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,18 @@
1
+ /** @jsx jsx */
2
+ import { ElementType, FC, ReactElement } from 'react';
3
+ import { BaseBoxProps } from './internal/base-box';
4
+ import type { PublicBoxPropsBase } from './types';
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
+ /**
8
+ * __Box__
9
+ *
10
+ * A Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
11
+ * Renders a `div` by default.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/primitives/box/examples)
14
+ * - [Code](https://atlassian.design/components/primitives/box/code)
15
+ * - [Usage](https://atlassian.design/components/primitives/box/usage)
16
+ */
17
+ declare const Box: BoxComponent;
18
+ export default Box;
@@ -0,0 +1,75 @@
1
+ /** @jsx jsx */
2
+ import { ElementType, ReactNode } from 'react';
3
+ import { type Space } from '../xcss/style-maps.partial';
4
+ export interface InlineProps<T extends ElementType = 'div'> {
5
+ /**
6
+ * The DOM element to render as the Inline. Defaults to `div`.
7
+ */
8
+ as?: 'div' | 'span' | 'ul' | 'ol';
9
+ /**
10
+ * Used to align children along the main axis.
11
+ */
12
+ alignBlock?: AlignBlock;
13
+ /**
14
+ * Used to align children along the cross axis.
15
+ */
16
+ alignInline?: AlignInline;
17
+ /**
18
+ * Used to set whether children are forced onto one line or will wrap onto multiple lines.
19
+ */
20
+ shouldWrap?: boolean;
21
+ /**
22
+ * Used to distribute the children along the main axis.
23
+ */
24
+ spread?: Spread;
25
+ /**
26
+ * Used to set whether the container should grow to fill the available space.
27
+ */
28
+ grow?: Grow;
29
+ /**
30
+ * Represents the space between each child.
31
+ */
32
+ space?: Space;
33
+ /**
34
+ * Represents the space between rows when content wraps.
35
+ * Used to override the `space` value in between rows.
36
+ */
37
+ rowSpace?: Space;
38
+ /**
39
+ * Renders a separator string between each child.
40
+ */
41
+ separator?: string;
42
+ /**
43
+ * A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
44
+ */
45
+ testId?: string;
46
+ /**
47
+ * Elements to be rendered inside the Inline.
48
+ */
49
+ children: ReactNode;
50
+ /**
51
+ * Forwarded ref element
52
+ */
53
+ ref?: React.ComponentPropsWithRef<T>['ref'];
54
+ }
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
+ /**
60
+ * __Inline__
61
+ *
62
+ * Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
63
+ *
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <Inline>
68
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
69
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
70
+ * </Inline>
71
+ * ```
72
+ *
73
+ */
74
+ declare const Inline: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<InlineProps<ElementType<any>>, "as" | "children" | "testId" | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "space" | "rowSpace" | "separator"> & import("react").RefAttributes<any>>>;
75
+ export default Inline;
@@ -0,0 +1,84 @@
1
+ /** @jsx jsx */
2
+ import { ComponentPropsWithoutRef, ElementType, FC, ReactElement, ReactNode } from 'react';
3
+ import { BackgroundColor, type Space } from '../../xcss/style-maps.partial';
4
+ import type { BasePrimitiveProps } from '../types';
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'> = {
8
+ /**
9
+ * The DOM element to render as the Box. Defaults to `div`.
10
+ */
11
+ as?: As;
12
+ /**
13
+ * The HTML className attribute.
14
+ *
15
+ * Before using this prop please ensure:
16
+ * - The styles cannot otherwise be achieved through `Box` directly.
17
+ * - The use case needs custom styles that cannot be designed or implemented differently
18
+ *
19
+ * Ensure you're using the `@atlaskit/eslint-plugin-design-system` with this prop to prevent unbounded usage.
20
+ *
21
+ * @see `@atlaskit/eslint-plugin-design-system`
22
+ */
23
+ className?: string;
24
+ /**
25
+ * Elements to be rendered inside the Box.
26
+ */
27
+ children?: ReactNode;
28
+ /**
29
+ * Token representing background color with a built-in fallback value.
30
+ */
31
+ backgroundColor?: BackgroundColor;
32
+ /**
33
+ * Tokens representing CSS shorthand for `paddingBlock` and `paddingInline` together.
34
+ *
35
+ * @see paddingBlock
36
+ * @see paddingInline
37
+ */
38
+ padding?: Space;
39
+ /**
40
+ * Tokens representing CSS shorthand `paddingBlock`.
41
+ *
42
+ * @see paddingBlockStart
43
+ * @see paddingBlockEnd
44
+ */
45
+ paddingBlock?: Space;
46
+ /**
47
+ * Tokens representing CSS `paddingBlockStart`.
48
+ */
49
+ paddingBlockStart?: Space;
50
+ /**
51
+ * Tokens representing CSS `paddingBlockEnd`.
52
+ */
53
+ paddingBlockEnd?: Space;
54
+ /**
55
+ * Tokens representing CSS shorthand `paddingInline`.
56
+ *
57
+ * @see paddingInlineStart
58
+ * @see paddingInlineEnd
59
+ */
60
+ paddingInline?: Space;
61
+ /**
62
+ * Tokens representing CSS `paddingInlineStart`.
63
+ */
64
+ paddingInlineStart?: Space;
65
+ /**
66
+ * Tokens representing CSS `paddingInlineEnd`.
67
+ */
68
+ paddingInlineEnd?: Space;
69
+ /**
70
+ * Forwarded ref element
71
+ */
72
+ ref?: React.ComponentPropsWithRef<T>['ref'];
73
+ };
74
+ export type BaseBoxComponent<T extends ElementType = 'div'> = (<T extends ElementType = 'div'>(props: BaseBoxProps<T>) => ReactElement | null) & FC<BaseBoxProps<T>>;
75
+ /**
76
+ * __Box__
77
+ *
78
+ * Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
79
+ * Renders a `div` by default.
80
+ *
81
+ * @internal
82
+ */
83
+ export declare const BaseBox: BaseBoxComponent;
84
+ export default BaseBox;