@atlaskit/primitives 0.13.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/constellation/xcss/examples.mdx +9 -2
  3. package/constellation/xcss/migration.mdx +14 -18
  4. package/constellation/xcss/usage.mdx +57 -19
  5. package/dist/cjs/index.js +14 -1
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/cjs/xcss/style-maps.partial.js +6 -78
  8. package/dist/cjs/xcss/xcss.js +11 -16
  9. package/dist/es2019/index.js +2 -1
  10. package/dist/es2019/version.json +1 -1
  11. package/dist/es2019/xcss/style-maps.partial.js +5 -66
  12. package/dist/es2019/xcss/xcss.js +12 -17
  13. package/dist/esm/index.js +2 -1
  14. package/dist/esm/version.json +1 -1
  15. package/dist/esm/xcss/style-maps.partial.js +5 -66
  16. package/dist/esm/xcss/xcss.js +12 -17
  17. package/dist/types/index.d.ts +1 -0
  18. package/dist/types/xcss/style-maps.partial.d.ts +22 -122
  19. package/dist/types/xcss/xcss.d.ts +1 -1
  20. package/dist/types-ts4.5/index.d.ts +1 -0
  21. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +22 -122
  22. package/dist/types-ts4.5/xcss/xcss.d.ts +1 -1
  23. package/package.json +2 -2
  24. package/report.api.md +91 -213
  25. package/scripts/codegen-file-templates/dimensions.tsx +1 -18
  26. package/scripts/codegen-styles.tsx +1 -1
  27. package/scripts/misc-codegen-template.tsx +1 -10
  28. package/tmp/api-report-tmp.d.ts +85 -214
  29. package/scripts/codegen-file-templates/align-self.tsx +0 -9
  30. package/scripts/codegen-file-templates/border-style.tsx +0 -6
  31. package/scripts/codegen-file-templates/display.tsx +0 -10
  32. package/scripts/codegen-file-templates/flex-direction.tsx +0 -6
  33. package/scripts/codegen-file-templates/flex-grow.tsx +0 -6
  34. package/scripts/codegen-file-templates/flex-shrink.tsx +0 -6
  35. package/scripts/codegen-file-templates/flex.tsx +0 -5
  36. package/scripts/codegen-file-templates/overflow.tsx +0 -20
  37. package/scripts/codegen-file-templates/position.tsx +0 -8
@@ -2,11 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { css } from '@emotion/react';
3
3
  /**
4
4
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
5
- * @codegen <<SignedSource::b6657585e3df6f8017d4c35bb9150e3f>>
5
+ * @codegen <<SignedSource::7af6097e56f7fb03635b6f8aaf121b02>>
6
6
  * @codegenId dimensions
7
7
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
8
8
  * @codegenParams ["dimensions"]
9
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
9
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
10
10
  */
11
11
  export var dimensionMap = {
12
12
  '100%': '100%',
@@ -261,56 +261,13 @@ export var fillMap = {
261
261
  */
262
262
  /**
263
263
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
264
- * @codegen <<SignedSource::7787d50b7bc64a9350e4cf35ae608a79>>
264
+ * @codegen <<SignedSource::01a4b055c311d198921d4e000a2d7a54>>
265
265
  * @codegenId misc
266
266
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
267
- * @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
268
- * @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
269
- * @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
270
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
271
- * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::486569d9e228265c1688d0a7122bdedc>>
272
- * @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
273
- * @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
274
- * @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::77effeb1e5c39997e34b21b000a91faf>>
275
- * @codegenDependency ../../scripts/codegen-file-templates/flex.tsx <<SignedSource::ffa0189d14f1f00a16ec1e9f43a17ce9>>
267
+ * @codegenParams ["layer"]
268
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
276
269
  * @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::79d24a1e558f12d671c06a7609f90dc1>>
277
- * @codegenDependency ../../scripts/codegen-file-templates/overflow.tsx <<SignedSource::ccb841f2f51525aed895c06e00f15089>>
278
- * @codegenDependency ../../scripts/codegen-file-templates/position.tsx <<SignedSource::8709494ef16c48046c1784a9aaec6d80>>
279
270
  */
280
- export var alignSelfMap = {
281
- center: 'center',
282
- start: 'start',
283
- stretch: 'stretch',
284
- end: 'end',
285
- baseline: 'baseline'
286
- };
287
- export var borderStyleMap = {
288
- none: 'none',
289
- solid: 'solid'
290
- };
291
- export var displayMap = {
292
- flex: 'flex',
293
- block: 'block',
294
- inline: 'inline',
295
- inlineBlock: 'inline-block',
296
- inlineFlex: 'inline-flex',
297
- grid: 'grid'
298
- };
299
- export var flexDirectionMap = {
300
- row: 'row',
301
- column: 'column'
302
- };
303
- export var flexGrowMap = {
304
- '0': 0,
305
- '1': 1
306
- };
307
- export var flexShrinkMap = {
308
- '0': '0',
309
- '1': 1
310
- };
311
- export var flexMap = {
312
- '1': 1
313
- };
314
271
  export var layerMap = {
315
272
  card: 100,
316
273
  navigation: 200,
@@ -322,24 +279,6 @@ export var layerMap = {
322
279
  spotlight: 700,
323
280
  tooltip: 800
324
281
  };
325
- export var overflowMap = {
326
- auto: 'auto',
327
- hidden: 'hidden'
328
- };
329
- export var overflowInlineMap = {
330
- auto: 'auto',
331
- hidden: 'hidden'
332
- };
333
- export var overflowBlockMap = {
334
- auto: 'auto',
335
- hidden: 'hidden'
336
- };
337
- export var positionMap = {
338
- absolute: 'absolute',
339
- fixed: 'fixed',
340
- relative: 'relative',
341
- static: 'static'
342
- };
343
282
  /**
344
283
  * @codegenEnd
345
284
  */
@@ -5,25 +5,17 @@ import _typeof from "@babel/runtime/helpers/typeof";
5
5
  import { css as cssEmotion } from '@emotion/react';
6
6
  import warnOnce from '@atlaskit/ds-lib/warn-once';
7
7
  import { media } from '../helpers/responsive';
8
- import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, fillMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
8
+ import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, layerMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
9
9
  var tokensMap = {
10
- alignSelf: alignSelfMap,
11
10
  backgroundColor: backgroundColorMap,
12
11
  blockSize: dimensionMap,
13
12
  borderColor: borderColorMap,
14
13
  borderRadius: borderRadiusMap,
15
- borderStyle: borderStyleMap,
16
14
  borderWidth: borderWidthMap,
17
- bottom: dimensionMap,
15
+ bottom: spaceMap,
18
16
  boxShadow: shadowMap,
19
17
  color: textColorMap,
20
18
  columnGap: spaceMap,
21
- display: displayMap,
22
- fill: fillMap,
23
- flex: flexMap,
24
- flexDirection: flexDirectionMap,
25
- flexGrow: flexGrowMap,
26
- flexShrink: flexShrinkMap,
27
19
  gap: spaceMap,
28
20
  height: dimensionMap,
29
21
  inlineSize: dimensionMap,
@@ -34,7 +26,14 @@ var tokensMap = {
34
26
  insetInline: spaceMap,
35
27
  insetInlineEnd: spaceMap,
36
28
  insetInlineStart: spaceMap,
37
- left: dimensionMap,
29
+ margin: spaceMap,
30
+ marginBlock: spaceMap,
31
+ marginBlockEnd: spaceMap,
32
+ marginBlockStart: spaceMap,
33
+ marginInline: spaceMap,
34
+ marginInlineEnd: spaceMap,
35
+ marginInlineStart: spaceMap,
36
+ left: spaceMap,
38
37
  maxBlockSize: dimensionMap,
39
38
  maxHeight: dimensionMap,
40
39
  maxInlineSize: dimensionMap,
@@ -46,9 +45,6 @@ var tokensMap = {
46
45
  outlineOffset: spaceMap,
47
46
  outlineWidth: borderWidthMap,
48
47
  outlineColor: borderColorMap,
49
- overflow: overflowMap,
50
- overflowBlock: overflowBlockMap,
51
- overflowInline: overflowInlineMap,
52
48
  padding: spaceMap,
53
49
  paddingBlock: spaceMap,
54
50
  paddingBlockEnd: spaceMap,
@@ -60,10 +56,9 @@ var tokensMap = {
60
56
  paddingLeft: spaceMap,
61
57
  paddingRight: spaceMap,
62
58
  paddingTop: spaceMap,
63
- position: positionMap,
64
- right: dimensionMap,
59
+ right: spaceMap,
65
60
  rowGap: spaceMap,
66
- top: dimensionMap,
61
+ top: spaceMap,
67
62
  width: dimensionMap,
68
63
  zIndex: layerMap
69
64
  };
@@ -2,3 +2,4 @@ export { default as Box, type BoxProps } from './components/box';
2
2
  export { default as Inline, type InlineProps } from './components/inline';
3
3
  export { xcss } from './xcss/xcss';
4
4
  export { default as Stack, type StackProps } from './components/stack';
5
+ export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG, type Breakpoint, } from './helpers/responsive';
@@ -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::b6657585e3df6f8017d4c35bb9150e3f>>
4
+ * @codegen <<SignedSource::7af6097e56f7fb03635b6f8aaf121b02>>
5
5
  * @codegenId dimensions
6
6
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
7
7
  * @codegenParams ["dimensions"]
8
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
8
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
9
9
  */
10
10
  export declare const dimensionMap: {
11
11
  readonly '100%': "100%";
@@ -17,23 +17,7 @@ export declare const dimensionMap: {
17
17
  readonly 'size.600': "6rem";
18
18
  readonly 'size.1000': "12rem";
19
19
  };
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;
20
+ export type Dimension = keyof typeof dimensionMap;
37
21
  /**
38
22
  * @codegenEnd
39
23
  */
@@ -283,63 +267,13 @@ export type Fill = keyof typeof fillMap;
283
267
  */
284
268
  /**
285
269
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
286
- * @codegen <<SignedSource::7787d50b7bc64a9350e4cf35ae608a79>>
270
+ * @codegen <<SignedSource::01a4b055c311d198921d4e000a2d7a54>>
287
271
  * @codegenId misc
288
272
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
289
- * @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
290
- * @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
291
- * @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
292
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
293
- * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::486569d9e228265c1688d0a7122bdedc>>
294
- * @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
295
- * @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
296
- * @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::77effeb1e5c39997e34b21b000a91faf>>
297
- * @codegenDependency ../../scripts/codegen-file-templates/flex.tsx <<SignedSource::ffa0189d14f1f00a16ec1e9f43a17ce9>>
273
+ * @codegenParams ["layer"]
274
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
298
275
  * @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::79d24a1e558f12d671c06a7609f90dc1>>
299
- * @codegenDependency ../../scripts/codegen-file-templates/overflow.tsx <<SignedSource::ccb841f2f51525aed895c06e00f15089>>
300
- * @codegenDependency ../../scripts/codegen-file-templates/position.tsx <<SignedSource::8709494ef16c48046c1784a9aaec6d80>>
301
276
  */
302
- export declare const alignSelfMap: {
303
- readonly center: "center";
304
- readonly start: "start";
305
- readonly stretch: "stretch";
306
- readonly end: "end";
307
- readonly baseline: "baseline";
308
- };
309
- export type AlignSelf = keyof typeof alignSelfMap;
310
- export declare const borderStyleMap: {
311
- readonly none: "none";
312
- readonly solid: "solid";
313
- };
314
- export type BorderStyle = keyof typeof borderStyleMap;
315
- export declare const displayMap: {
316
- readonly flex: "flex";
317
- readonly block: "block";
318
- readonly inline: "inline";
319
- readonly inlineBlock: "inline-block";
320
- readonly inlineFlex: "inline-flex";
321
- readonly grid: "grid";
322
- };
323
- export type Display = keyof typeof displayMap;
324
- export declare const flexDirectionMap: {
325
- readonly row: "row";
326
- readonly column: "column";
327
- };
328
- export type FlexDirection = keyof typeof flexDirectionMap;
329
- export declare const flexGrowMap: {
330
- readonly '0': 0;
331
- readonly '1': 1;
332
- };
333
- export type FlexGrow = keyof typeof flexGrowMap;
334
- export declare const flexShrinkMap: {
335
- readonly '0': "0";
336
- readonly '1': 1;
337
- };
338
- export type FlexShrink = keyof typeof flexShrinkMap;
339
- export declare const flexMap: {
340
- readonly '1': 1;
341
- };
342
- export type Flex = keyof typeof flexMap;
343
277
  export declare const layerMap: {
344
278
  readonly card: 100;
345
279
  readonly navigation: 200;
@@ -352,28 +286,6 @@ export declare const layerMap: {
352
286
  readonly tooltip: 800;
353
287
  };
354
288
  export type Layer = keyof typeof layerMap;
355
- export declare const overflowMap: {
356
- readonly auto: "auto";
357
- readonly hidden: "hidden";
358
- };
359
- export type Overflow = keyof typeof overflowMap;
360
- export declare const overflowInlineMap: {
361
- readonly auto: "auto";
362
- readonly hidden: "hidden";
363
- };
364
- export type OverflowInline = keyof typeof overflowInlineMap;
365
- export declare const overflowBlockMap: {
366
- readonly auto: "auto";
367
- readonly hidden: "hidden";
368
- };
369
- export type OverflowBlock = keyof typeof overflowBlockMap;
370
- export declare const positionMap: {
371
- readonly absolute: "absolute";
372
- readonly fixed: "fixed";
373
- readonly relative: "relative";
374
- readonly static: "static";
375
- };
376
- export type Position = keyof typeof positionMap;
377
289
  /**
378
290
  * @codegenEnd
379
291
  */
@@ -407,26 +319,18 @@ export type BorderRadius = keyof typeof borderRadiusMap;
407
319
  */
408
320
  type AutoComplete<T extends string> = T | Omit<string, T>;
409
321
  export type TokenisedProps = {
410
- alignSelf?: AlignSelf;
411
322
  backgroundColor?: BackgroundColor;
412
- blockSize?: BlockSize;
323
+ blockSize?: AutoComplete<Dimension>;
413
324
  borderColor?: BorderColor;
414
325
  borderRadius?: BorderRadius;
415
- borderStyle?: BorderStyle;
416
326
  borderWidth?: BorderWidth;
417
- bottom?: Bottom;
327
+ bottom?: AutoComplete<Space>;
418
328
  boxShadow?: Shadow;
419
329
  color?: TextColor;
420
330
  columnGap?: Space;
421
- display?: Display;
422
- fill?: Fill;
423
- flex?: Flex;
424
- flexDirection?: FlexDirection;
425
- flexGrow?: FlexGrow;
426
- flexShrink?: FlexShrink;
427
331
  gap?: Space;
428
- height?: AutoComplete<Height>;
429
- inlineSize?: InlineSize;
332
+ height?: AutoComplete<Dimension>;
333
+ inlineSize?: AutoComplete<Dimension>;
430
334
  inset?: Space;
431
335
  insetBlock?: Space;
432
336
  insetBlockEnd?: Space;
@@ -434,21 +338,18 @@ export type TokenisedProps = {
434
338
  insetInline?: Space;
435
339
  insetInlineEnd?: Space;
436
340
  insetInlineStart?: Space;
437
- left?: Left;
438
- maxBlockSize?: AutoComplete<MaxBlockSize>;
439
- maxHeight?: AutoComplete<MaxHeight>;
440
- maxInlineSize?: AutoComplete<MaxInlineSize>;
441
- maxWidth?: AutoComplete<MaxWidth>;
442
- minBlockSize?: AutoComplete<MinBlockSize>;
443
- minHeight?: AutoComplete<MinHeight>;
444
- minInlineSize?: AutoComplete<MinInlineSize>;
445
- minWidth?: AutoComplete<MinWidth>;
341
+ left?: AutoComplete<Space>;
342
+ maxBlockSize?: AutoComplete<Dimension>;
343
+ maxHeight?: AutoComplete<Dimension>;
344
+ maxInlineSize?: AutoComplete<Dimension>;
345
+ maxWidth?: AutoComplete<Dimension>;
346
+ minBlockSize?: AutoComplete<Dimension>;
347
+ minHeight?: AutoComplete<Dimension>;
348
+ minInlineSize?: AutoComplete<Dimension>;
349
+ minWidth?: AutoComplete<Dimension>;
446
350
  outlineColor?: BorderColor;
447
351
  outlineOffset?: Space;
448
352
  outlineWidth?: BorderWidth;
449
- overflow?: Overflow;
450
- overflowBlock?: OverflowBlock;
451
- overflowInline?: OverflowInline;
452
353
  padding?: Space;
453
354
  paddingBlock?: Space;
454
355
  paddingBlockEnd?: Space;
@@ -456,11 +357,10 @@ export type TokenisedProps = {
456
357
  paddingInline?: Space;
457
358
  paddingInlineEnd?: Space;
458
359
  paddingInlineStart?: Space;
459
- position?: Position;
460
- right?: Right;
360
+ right?: AutoComplete<Space>;
461
361
  rowGap?: Space;
462
- top?: Top;
463
- width?: AutoComplete<Width>;
362
+ top?: AutoComplete<Space>;
363
+ width?: AutoComplete<Dimension>;
464
364
  zIndex?: Layer;
465
365
  };
466
366
  declare const spacingProperties: readonly ["padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "gap", "rowGap", "columnGap"];
@@ -28,7 +28,7 @@ declare const inlineWrapper: (style: any) => {
28
28
  };
29
29
  type XCSS = ReturnType<typeof boxWrapper> | ReturnType<typeof inlineWrapper>;
30
30
  type AllowedBoxStyles = keyof SafeCSSObject;
31
- type Spacing = 'columnGap' | 'gap' | 'inset' | 'insetBlock' | 'insetBlockEnd' | 'insetBlockStart' | 'insetInline' | 'insetInlineEnd' | 'insetInlineStart' | 'outlineOffset' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingBottom' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'rowGap';
31
+ type Spacing = 'columnGap' | 'gap' | 'inset' | 'insetBlock' | 'insetBlockEnd' | 'insetBlockStart' | 'insetInline' | 'insetInlineEnd' | 'insetInlineStart' | 'margin' | 'marginBlock' | 'marginBlockEnd' | 'marginBlockStart' | 'marginInline' | 'marginInlineEnd' | 'marginInlineStart' | 'outlineOffset' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingBottom' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'rowGap';
32
32
  /**
33
33
  * ### xcss
34
34
  *
@@ -2,3 +2,4 @@ export { default as Box, type BoxProps } from './components/box';
2
2
  export { default as Inline, type InlineProps } from './components/inline';
3
3
  export { xcss } from './xcss/xcss';
4
4
  export { default as Stack, type StackProps } from './components/stack';
5
+ export { UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG, type Breakpoint, } from './helpers/responsive';
@@ -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::b6657585e3df6f8017d4c35bb9150e3f>>
4
+ * @codegen <<SignedSource::7af6097e56f7fb03635b6f8aaf121b02>>
5
5
  * @codegenId dimensions
6
6
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
7
7
  * @codegenParams ["dimensions"]
8
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
8
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
9
9
  */
10
10
  export declare const dimensionMap: {
11
11
  readonly '100%': "100%";
@@ -17,23 +17,7 @@ export declare const dimensionMap: {
17
17
  readonly 'size.600': "6rem";
18
18
  readonly 'size.1000': "12rem";
19
19
  };
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;
20
+ export type Dimension = keyof typeof dimensionMap;
37
21
  /**
38
22
  * @codegenEnd
39
23
  */
@@ -283,63 +267,13 @@ export type Fill = keyof typeof fillMap;
283
267
  */
284
268
  /**
285
269
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
286
- * @codegen <<SignedSource::7787d50b7bc64a9350e4cf35ae608a79>>
270
+ * @codegen <<SignedSource::01a4b055c311d198921d4e000a2d7a54>>
287
271
  * @codegenId misc
288
272
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
289
- * @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
290
- * @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
291
- * @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
292
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::01143ff41135244db1d8ec2efe4339d6>>
293
- * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::486569d9e228265c1688d0a7122bdedc>>
294
- * @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
295
- * @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
296
- * @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::77effeb1e5c39997e34b21b000a91faf>>
297
- * @codegenDependency ../../scripts/codegen-file-templates/flex.tsx <<SignedSource::ffa0189d14f1f00a16ec1e9f43a17ce9>>
273
+ * @codegenParams ["layer"]
274
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
298
275
  * @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::79d24a1e558f12d671c06a7609f90dc1>>
299
- * @codegenDependency ../../scripts/codegen-file-templates/overflow.tsx <<SignedSource::ccb841f2f51525aed895c06e00f15089>>
300
- * @codegenDependency ../../scripts/codegen-file-templates/position.tsx <<SignedSource::8709494ef16c48046c1784a9aaec6d80>>
301
276
  */
302
- export declare const alignSelfMap: {
303
- readonly center: "center";
304
- readonly start: "start";
305
- readonly stretch: "stretch";
306
- readonly end: "end";
307
- readonly baseline: "baseline";
308
- };
309
- export type AlignSelf = keyof typeof alignSelfMap;
310
- export declare const borderStyleMap: {
311
- readonly none: "none";
312
- readonly solid: "solid";
313
- };
314
- export type BorderStyle = keyof typeof borderStyleMap;
315
- export declare const displayMap: {
316
- readonly flex: "flex";
317
- readonly block: "block";
318
- readonly inline: "inline";
319
- readonly inlineBlock: "inline-block";
320
- readonly inlineFlex: "inline-flex";
321
- readonly grid: "grid";
322
- };
323
- export type Display = keyof typeof displayMap;
324
- export declare const flexDirectionMap: {
325
- readonly row: "row";
326
- readonly column: "column";
327
- };
328
- export type FlexDirection = keyof typeof flexDirectionMap;
329
- export declare const flexGrowMap: {
330
- readonly '0': 0;
331
- readonly '1': 1;
332
- };
333
- export type FlexGrow = keyof typeof flexGrowMap;
334
- export declare const flexShrinkMap: {
335
- readonly '0': "0";
336
- readonly '1': 1;
337
- };
338
- export type FlexShrink = keyof typeof flexShrinkMap;
339
- export declare const flexMap: {
340
- readonly '1': 1;
341
- };
342
- export type Flex = keyof typeof flexMap;
343
277
  export declare const layerMap: {
344
278
  readonly card: 100;
345
279
  readonly navigation: 200;
@@ -352,28 +286,6 @@ export declare const layerMap: {
352
286
  readonly tooltip: 800;
353
287
  };
354
288
  export type Layer = keyof typeof layerMap;
355
- export declare const overflowMap: {
356
- readonly auto: "auto";
357
- readonly hidden: "hidden";
358
- };
359
- export type Overflow = keyof typeof overflowMap;
360
- export declare const overflowInlineMap: {
361
- readonly auto: "auto";
362
- readonly hidden: "hidden";
363
- };
364
- export type OverflowInline = keyof typeof overflowInlineMap;
365
- export declare const overflowBlockMap: {
366
- readonly auto: "auto";
367
- readonly hidden: "hidden";
368
- };
369
- export type OverflowBlock = keyof typeof overflowBlockMap;
370
- export declare const positionMap: {
371
- readonly absolute: "absolute";
372
- readonly fixed: "fixed";
373
- readonly relative: "relative";
374
- readonly static: "static";
375
- };
376
- export type Position = keyof typeof positionMap;
377
289
  /**
378
290
  * @codegenEnd
379
291
  */
@@ -407,26 +319,18 @@ export type BorderRadius = keyof typeof borderRadiusMap;
407
319
  */
408
320
  type AutoComplete<T extends string> = T | Omit<string, T>;
409
321
  export type TokenisedProps = {
410
- alignSelf?: AlignSelf;
411
322
  backgroundColor?: BackgroundColor;
412
- blockSize?: BlockSize;
323
+ blockSize?: AutoComplete<Dimension>;
413
324
  borderColor?: BorderColor;
414
325
  borderRadius?: BorderRadius;
415
- borderStyle?: BorderStyle;
416
326
  borderWidth?: BorderWidth;
417
- bottom?: Bottom;
327
+ bottom?: AutoComplete<Space>;
418
328
  boxShadow?: Shadow;
419
329
  color?: TextColor;
420
330
  columnGap?: Space;
421
- display?: Display;
422
- fill?: Fill;
423
- flex?: Flex;
424
- flexDirection?: FlexDirection;
425
- flexGrow?: FlexGrow;
426
- flexShrink?: FlexShrink;
427
331
  gap?: Space;
428
- height?: AutoComplete<Height>;
429
- inlineSize?: InlineSize;
332
+ height?: AutoComplete<Dimension>;
333
+ inlineSize?: AutoComplete<Dimension>;
430
334
  inset?: Space;
431
335
  insetBlock?: Space;
432
336
  insetBlockEnd?: Space;
@@ -434,21 +338,18 @@ export type TokenisedProps = {
434
338
  insetInline?: Space;
435
339
  insetInlineEnd?: Space;
436
340
  insetInlineStart?: Space;
437
- left?: Left;
438
- maxBlockSize?: AutoComplete<MaxBlockSize>;
439
- maxHeight?: AutoComplete<MaxHeight>;
440
- maxInlineSize?: AutoComplete<MaxInlineSize>;
441
- maxWidth?: AutoComplete<MaxWidth>;
442
- minBlockSize?: AutoComplete<MinBlockSize>;
443
- minHeight?: AutoComplete<MinHeight>;
444
- minInlineSize?: AutoComplete<MinInlineSize>;
445
- minWidth?: AutoComplete<MinWidth>;
341
+ left?: AutoComplete<Space>;
342
+ maxBlockSize?: AutoComplete<Dimension>;
343
+ maxHeight?: AutoComplete<Dimension>;
344
+ maxInlineSize?: AutoComplete<Dimension>;
345
+ maxWidth?: AutoComplete<Dimension>;
346
+ minBlockSize?: AutoComplete<Dimension>;
347
+ minHeight?: AutoComplete<Dimension>;
348
+ minInlineSize?: AutoComplete<Dimension>;
349
+ minWidth?: AutoComplete<Dimension>;
446
350
  outlineColor?: BorderColor;
447
351
  outlineOffset?: Space;
448
352
  outlineWidth?: BorderWidth;
449
- overflow?: Overflow;
450
- overflowBlock?: OverflowBlock;
451
- overflowInline?: OverflowInline;
452
353
  padding?: Space;
453
354
  paddingBlock?: Space;
454
355
  paddingBlockEnd?: Space;
@@ -456,11 +357,10 @@ export type TokenisedProps = {
456
357
  paddingInline?: Space;
457
358
  paddingInlineEnd?: Space;
458
359
  paddingInlineStart?: Space;
459
- position?: Position;
460
- right?: Right;
360
+ right?: AutoComplete<Space>;
461
361
  rowGap?: Space;
462
- top?: Top;
463
- width?: AutoComplete<Width>;
362
+ top?: AutoComplete<Space>;
363
+ width?: AutoComplete<Dimension>;
464
364
  zIndex?: Layer;
465
365
  };
466
366
  declare const spacingProperties: readonly [
@@ -28,7 +28,7 @@ declare const inlineWrapper: (style: any) => {
28
28
  };
29
29
  type XCSS = ReturnType<typeof boxWrapper> | ReturnType<typeof inlineWrapper>;
30
30
  type AllowedBoxStyles = keyof SafeCSSObject;
31
- type Spacing = 'columnGap' | 'gap' | 'inset' | 'insetBlock' | 'insetBlockEnd' | 'insetBlockStart' | 'insetInline' | 'insetInlineEnd' | 'insetInlineStart' | 'outlineOffset' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingBottom' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'rowGap';
31
+ type Spacing = 'columnGap' | 'gap' | 'inset' | 'insetBlock' | 'insetBlockEnd' | 'insetBlockStart' | 'insetInline' | 'insetInlineEnd' | 'insetInlineStart' | 'margin' | 'marginBlock' | 'marginBlockEnd' | 'marginBlockStart' | 'marginInline' | 'marginInlineEnd' | 'marginInlineStart' | 'outlineOffset' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingBottom' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'rowGap';
32
32
  /**
33
33
  * ### xcss
34
34
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.13.0",
3
+ "version": "0.14.1",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -132,7 +132,7 @@
132
132
  "@atlaskit/visual-regression": "*",
133
133
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
134
134
  "@atlassian/codegen": "^0.1.0",
135
- "@atlassian/gemini-visual-regression": "^0.0.31",
135
+ "@atlassian/gemini-visual-regression": "^0.0.34",
136
136
  "@testing-library/react": "^12.1.5",
137
137
  "@testing-library/react-hooks": "^8.0.1",
138
138
  "csstype": "^3.1.0",