@atlaskit/primitives 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/constellation/grid/code.mdx +7 -0
- package/constellation/grid/examples.mdx +38 -0
- package/dist/cjs/components/flex.js +7 -3
- package/dist/cjs/components/grid.js +127 -0
- package/dist/cjs/components/inline.js +16 -48
- package/dist/cjs/components/stack.js +19 -39
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/xcss/xcss.js +1 -1
- package/dist/es2019/components/flex.js +6 -3
- package/dist/es2019/components/grid.js +118 -0
- package/dist/es2019/components/inline.js +15 -49
- package/dist/es2019/components/stack.js +18 -40
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/responsive/build-media-query-css.js +0 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/xcss/xcss.js +1 -1
- package/dist/esm/components/flex.js +7 -3
- package/dist/esm/components/grid.js +119 -0
- package/dist/esm/components/inline.js +16 -49
- package/dist/esm/components/stack.js +19 -40
- package/dist/esm/index.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/xcss/xcss.js +1 -1
- package/dist/types/components/flex.d.ts +17 -8
- package/dist/types/components/grid.d.ts +154 -0
- package/dist/types/components/inline.d.ts +50 -12
- package/dist/types/components/stack.d.ts +38 -8
- package/dist/types/index.d.ts +2 -1
- package/dist/types/xcss/xcss.d.ts +11 -14
- package/dist/types-ts4.5/components/flex.d.ts +17 -8
- package/dist/types-ts4.5/components/grid.d.ts +154 -0
- package/dist/types-ts4.5/components/inline.d.ts +50 -12
- package/dist/types-ts4.5/components/stack.d.ts +38 -8
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/xcss/xcss.d.ts +11 -14
- package/package.json +21 -14
- package/report.api.md +270 -59
- package/tmp/api-report-tmp.d.ts +122 -37
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -36,12 +36,24 @@ type AlignInline_2 = 'center' | 'end' | 'start';
|
|
|
36
36
|
// @public (undocumented)
|
|
37
37
|
type AlignItems = keyof typeof alignItemsMap;
|
|
38
38
|
|
|
39
|
+
// @public (undocumented)
|
|
40
|
+
type AlignItems_2 = keyof typeof alignItemsMap_2;
|
|
41
|
+
|
|
39
42
|
// @public (undocumented)
|
|
40
43
|
const alignItemsMap: {
|
|
41
44
|
readonly start: SerializedStyles_2;
|
|
42
45
|
readonly center: SerializedStyles_2;
|
|
43
46
|
readonly baseline: SerializedStyles_2;
|
|
44
47
|
readonly end: SerializedStyles_2;
|
|
48
|
+
readonly stretch: SerializedStyles_2;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// @public (undocumented)
|
|
52
|
+
const alignItemsMap_2: {
|
|
53
|
+
readonly start: SerializedStyles_2;
|
|
54
|
+
readonly center: SerializedStyles_2;
|
|
55
|
+
readonly baseline: SerializedStyles_2;
|
|
56
|
+
readonly end: SerializedStyles_2;
|
|
45
57
|
};
|
|
46
58
|
|
|
47
59
|
// @public (undocumented)
|
|
@@ -53,6 +65,9 @@ type As = 'article' | 'aside' | 'button' | 'dialog' | 'div' | 'footer' | 'header
|
|
|
53
65
|
// @public (undocumented)
|
|
54
66
|
type AutoComplete<T extends string> = Omit<string, T> | T;
|
|
55
67
|
|
|
68
|
+
// @public (undocumented)
|
|
69
|
+
type AutoFlow = keyof typeof gridAutoFlowMap;
|
|
70
|
+
|
|
56
71
|
// @public (undocumented)
|
|
57
72
|
export type BackgroundColor = keyof typeof backgroundColorMap;
|
|
58
73
|
|
|
@@ -267,7 +282,7 @@ type BoxStyles = SerializedStyles & {
|
|
|
267
282
|
const boxTag: unique symbol;
|
|
268
283
|
|
|
269
284
|
// @public (undocumented)
|
|
270
|
-
type BoxXCSS = false | {
|
|
285
|
+
type BoxXCSS = false | undefined | {
|
|
271
286
|
readonly [uniqueSymbol]: BoxStyles;
|
|
272
287
|
};
|
|
273
288
|
|
|
@@ -304,16 +319,17 @@ type Direction = keyof typeof flexDirectionMap;
|
|
|
304
319
|
|
|
305
320
|
// @public
|
|
306
321
|
export const Flex: MemoExoticComponent<ForwardRefExoticComponent<Pick<{
|
|
307
|
-
as?: "div" | "ol" | "span" | "ul" | undefined;
|
|
322
|
+
as?: "div" | "li" | "ol" | "span" | "ul" | undefined;
|
|
308
323
|
justifyContent?: "center" | "end" | "space-around" | "space-between" | "space-evenly" | "start" | "stretch" | undefined;
|
|
309
|
-
alignItems?: "baseline" | "center" | "end" | "start" | undefined;
|
|
324
|
+
alignItems?: "baseline" | "center" | "end" | "start" | "stretch" | undefined;
|
|
325
|
+
columnGap?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
310
326
|
gap?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
311
327
|
rowGap?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
312
328
|
direction?: "column" | "row" | undefined;
|
|
313
329
|
wrap?: "nowrap" | "wrap" | undefined;
|
|
314
330
|
children: ReactNode;
|
|
315
331
|
ref?: any;
|
|
316
|
-
} & BasePrimitiveProps, "alignItems" | "as" | "children" | "direction" | "gap" | "justifyContent" | "rowGap" | "wrap" | keyof BasePrimitiveProps> & RefAttributes<any>>>;
|
|
332
|
+
} & BasePrimitiveProps, "alignItems" | "as" | "children" | "columnGap" | "direction" | "gap" | "justifyContent" | "rowGap" | "wrap" | keyof BasePrimitiveProps> & RefAttributes<any>>>;
|
|
317
333
|
|
|
318
334
|
// @public (undocumented)
|
|
319
335
|
const flexDirectionMap: {
|
|
@@ -323,9 +339,10 @@ const flexDirectionMap: {
|
|
|
323
339
|
|
|
324
340
|
// @public (undocumented)
|
|
325
341
|
export type FlexProps<T extends ElementType = 'div'> = {
|
|
326
|
-
as?: 'div' | 'ol' | 'span' | 'ul';
|
|
342
|
+
as?: 'div' | 'li' | 'ol' | 'span' | 'ul';
|
|
327
343
|
justifyContent?: JustifyContent;
|
|
328
344
|
alignItems?: AlignItems;
|
|
345
|
+
columnGap?: Space;
|
|
329
346
|
gap?: Space;
|
|
330
347
|
rowGap?: Space;
|
|
331
348
|
direction?: Direction;
|
|
@@ -340,6 +357,47 @@ const flexWrapMap: {
|
|
|
340
357
|
readonly nowrap: SerializedStyles_2;
|
|
341
358
|
};
|
|
342
359
|
|
|
360
|
+
// @public
|
|
361
|
+
export const Grid: MemoExoticComponent<ForwardRefExoticComponent<Pick<{
|
|
362
|
+
as?: "div" | "ol" | "span" | "ul" | undefined;
|
|
363
|
+
justifyContent?: "center" | "end" | "space-around" | "space-between" | "space-evenly" | "start" | "stretch" | undefined;
|
|
364
|
+
alignItems?: "baseline" | "center" | "end" | "start" | undefined;
|
|
365
|
+
columnGap?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
366
|
+
gap?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
367
|
+
rowGap?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
368
|
+
autoFlow?: "column dense" | "column" | "dense" | "row dense" | "row" | undefined;
|
|
369
|
+
templateRows?: string | undefined;
|
|
370
|
+
templateColumns?: string | undefined;
|
|
371
|
+
templateAreas?: string[] | undefined;
|
|
372
|
+
children: ReactNode;
|
|
373
|
+
ref?: any;
|
|
374
|
+
} & BasePrimitiveProps, "alignItems" | "as" | "autoFlow" | "children" | "columnGap" | "gap" | "justifyContent" | "rowGap" | "templateAreas" | "templateColumns" | "templateRows" | keyof BasePrimitiveProps> & RefAttributes<any>>>;
|
|
375
|
+
|
|
376
|
+
// @public (undocumented)
|
|
377
|
+
const gridAutoFlowMap: {
|
|
378
|
+
readonly row: SerializedStyles_2;
|
|
379
|
+
readonly column: SerializedStyles_2;
|
|
380
|
+
readonly dense: SerializedStyles_2;
|
|
381
|
+
readonly 'row dense': SerializedStyles_2;
|
|
382
|
+
readonly 'column dense': SerializedStyles_2;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// @public (undocumented)
|
|
386
|
+
export type GridProps<T extends ElementType = 'div'> = {
|
|
387
|
+
as?: 'div' | 'ol' | 'span' | 'ul';
|
|
388
|
+
justifyContent?: JustifyContent_2;
|
|
389
|
+
alignItems?: AlignItems_2;
|
|
390
|
+
columnGap?: Space;
|
|
391
|
+
gap?: Space;
|
|
392
|
+
rowGap?: Space;
|
|
393
|
+
autoFlow?: AutoFlow;
|
|
394
|
+
templateRows?: string;
|
|
395
|
+
templateColumns?: string;
|
|
396
|
+
templateAreas?: string[];
|
|
397
|
+
children: ReactNode;
|
|
398
|
+
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
399
|
+
} & BasePrimitiveProps;
|
|
400
|
+
|
|
343
401
|
// @public (undocumented)
|
|
344
402
|
type Grow = 'fill' | 'hug';
|
|
345
403
|
|
|
@@ -347,43 +405,54 @@ type Grow = 'fill' | 'hug';
|
|
|
347
405
|
type Grow_2 = 'fill' | 'hug';
|
|
348
406
|
|
|
349
407
|
// @public
|
|
350
|
-
export const Inline: MemoExoticComponent<ForwardRefExoticComponent<Pick<
|
|
408
|
+
export const Inline: MemoExoticComponent<ForwardRefExoticComponent<Pick<{
|
|
409
|
+
as?: "div" | "li" | "ol" | "span" | "ul" | undefined;
|
|
410
|
+
alignBlock?: AlignBlock | undefined;
|
|
411
|
+
alignInline?: AlignInline | undefined;
|
|
412
|
+
shouldWrap?: boolean | undefined;
|
|
413
|
+
spread?: "space-between" | undefined;
|
|
414
|
+
grow?: Grow | undefined;
|
|
415
|
+
space?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
416
|
+
rowSpace?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
417
|
+
separator?: string | undefined;
|
|
418
|
+
children: ReactNode;
|
|
419
|
+
ref?: any;
|
|
420
|
+
} & BasePrimitiveProps, "alignBlock" | "alignInline" | "as" | "children" | "grow" | "rowSpace" | "separator" | "shouldWrap" | "space" | "spread" | keyof BasePrimitiveProps> & RefAttributes<any>>>;
|
|
351
421
|
|
|
352
422
|
// @public (undocumented)
|
|
353
|
-
export
|
|
423
|
+
export type InlineProps<T extends ElementType = 'div'> = {
|
|
424
|
+
as?: 'div' | 'li' | 'ol' | 'span' | 'ul';
|
|
354
425
|
alignBlock?: AlignBlock;
|
|
355
426
|
alignInline?: AlignInline;
|
|
356
|
-
|
|
357
|
-
|
|
427
|
+
shouldWrap?: boolean;
|
|
428
|
+
spread?: Spread;
|
|
358
429
|
grow?: Grow;
|
|
359
|
-
|
|
430
|
+
space?: Space;
|
|
360
431
|
rowSpace?: Space;
|
|
361
432
|
separator?: string;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
testId?: string;
|
|
366
|
-
xcss?: Array<InlineXCSS | false | undefined> | InlineXCSS;
|
|
367
|
-
}
|
|
433
|
+
children: ReactNode;
|
|
434
|
+
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
435
|
+
} & BasePrimitiveProps;
|
|
368
436
|
|
|
369
437
|
// @public (undocumented)
|
|
370
|
-
type
|
|
371
|
-
[inlineTag]: true;
|
|
372
|
-
};
|
|
438
|
+
type JustifyContent = keyof typeof justifyContentMap;
|
|
373
439
|
|
|
374
440
|
// @public (undocumented)
|
|
375
|
-
|
|
441
|
+
type JustifyContent_2 = keyof typeof justifyContentMap_2;
|
|
376
442
|
|
|
377
443
|
// @public (undocumented)
|
|
378
|
-
|
|
379
|
-
readonly
|
|
444
|
+
const justifyContentMap: {
|
|
445
|
+
readonly start: SerializedStyles_2;
|
|
446
|
+
readonly center: SerializedStyles_2;
|
|
447
|
+
readonly end: SerializedStyles_2;
|
|
448
|
+
readonly 'space-between': SerializedStyles_2;
|
|
449
|
+
readonly 'space-around': SerializedStyles_2;
|
|
450
|
+
readonly 'space-evenly': SerializedStyles_2;
|
|
451
|
+
readonly stretch: SerializedStyles_2;
|
|
380
452
|
};
|
|
381
453
|
|
|
382
454
|
// @public (undocumented)
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
// @public (undocumented)
|
|
386
|
-
const justifyContentMap: {
|
|
455
|
+
const justifyContentMap_2: {
|
|
387
456
|
readonly start: SerializedStyles_2;
|
|
388
457
|
readonly center: SerializedStyles_2;
|
|
389
458
|
readonly end: SerializedStyles_2;
|
|
@@ -410,7 +479,7 @@ const layerMap: {
|
|
|
410
479
|
};
|
|
411
480
|
|
|
412
481
|
// @public
|
|
413
|
-
const media: {
|
|
482
|
+
export const media: {
|
|
414
483
|
readonly above: {
|
|
415
484
|
readonly xxs: "@media all";
|
|
416
485
|
readonly xs: "@media (min-width: 30rem)";
|
|
@@ -475,6 +544,14 @@ const spaceMap: {
|
|
|
475
544
|
'space.1000': "var(--ds-space-1000)";
|
|
476
545
|
};
|
|
477
546
|
|
|
547
|
+
// @public (undocumented)
|
|
548
|
+
type SpaceStyles = SerializedStyles & {
|
|
549
|
+
[spaceTag]: true;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
// @public (undocumented)
|
|
553
|
+
const spaceTag: unique symbol;
|
|
554
|
+
|
|
478
555
|
// @public (undocumented)
|
|
479
556
|
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';
|
|
480
557
|
|
|
@@ -485,20 +562,28 @@ type Spread = 'space-between';
|
|
|
485
562
|
type Spread_2 = 'space-between';
|
|
486
563
|
|
|
487
564
|
// @public
|
|
488
|
-
export const Stack: MemoExoticComponent<ForwardRefExoticComponent<Pick<
|
|
565
|
+
export const Stack: MemoExoticComponent<ForwardRefExoticComponent<Pick<{
|
|
566
|
+
as?: "div" | "ol" | "span" | "ul" | undefined;
|
|
567
|
+
alignBlock?: AlignBlock_2 | undefined;
|
|
568
|
+
alignInline?: AlignInline_2 | undefined;
|
|
569
|
+
spread?: "space-between" | undefined;
|
|
570
|
+
grow?: Grow_2 | undefined;
|
|
571
|
+
space?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
|
|
572
|
+
children: ReactNode;
|
|
573
|
+
ref?: any;
|
|
574
|
+
} & BasePrimitiveProps, "alignBlock" | "alignInline" | "as" | "children" | "grow" | "space" | "spread" | keyof BasePrimitiveProps> & RefAttributes<any>>>;
|
|
489
575
|
|
|
490
576
|
// @public (undocumented)
|
|
491
|
-
export
|
|
577
|
+
export type StackProps<T extends ElementType = 'div'> = {
|
|
578
|
+
as?: 'div' | 'ol' | 'span' | 'ul';
|
|
492
579
|
alignBlock?: AlignBlock_2;
|
|
493
580
|
alignInline?: AlignInline_2;
|
|
494
|
-
|
|
495
|
-
children: ReactNode;
|
|
581
|
+
spread?: Spread_2;
|
|
496
582
|
grow?: Grow_2;
|
|
497
|
-
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
498
583
|
space?: Space;
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}
|
|
584
|
+
children: ReactNode;
|
|
585
|
+
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
586
|
+
} & BasePrimitiveProps;
|
|
502
587
|
|
|
503
588
|
// @public (undocumented)
|
|
504
589
|
type TextColor = keyof typeof textColorMap;
|
|
@@ -661,8 +746,8 @@ export const UNSAFE_media: {
|
|
|
661
746
|
type Wrap = keyof typeof flexWrapMap;
|
|
662
747
|
|
|
663
748
|
// @public
|
|
664
|
-
export function xcss<Primitive extends typeof Box |
|
|
665
|
-
readonly [uniqueSymbol]: Primitive extends (<T extends ElementType<any> = "div">(props: BoxProps<T>) => ReactElement<any, JSXElementConstructor<any>| string> | null) & FC<BoxProps<"div">> ? BoxStyles : Primitive extends
|
|
749
|
+
export function xcss<Primitive extends typeof Box | void = typeof Box>(style: Primitive extends typeof Box ? ScopedSafeCSSObject<AllowedBoxStyles> | ScopedSafeCSSObject<AllowedBoxStyles>[] : Primitive extends void ? ScopedSafeCSSObject<Spacing> | ScopedSafeCSSObject<Spacing>[] : never): {
|
|
750
|
+
readonly [uniqueSymbol]: Primitive extends (<T extends ElementType<any> = "div">(props: BoxProps<T>) => ReactElement<any, JSXElementConstructor<any>| string> | null) & FC<BoxProps<"div">> ? BoxStyles : Primitive extends void ? SpaceStyles : never;
|
|
666
751
|
};
|
|
667
752
|
|
|
668
753
|
// (No @packageDocumentation comment for this package)
|