@atlaskit/primitives 1.0.8 → 1.0.10

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.
@@ -1,18 +1,19 @@
1
1
  import type { CSSProperties } from 'react';
2
- import { type BoxXCSS } from '../xcss/xcss';
2
+ import type { XCSS } from '../xcss/xcss';
3
3
  export type BasePrimitiveProps = {
4
4
  /**
5
5
  * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
6
6
  */
7
7
  testId?: string;
8
8
  /**
9
- * Inline styles to be applied to the primitive.
9
+ * Inline styles to be applied to the primitive. Only apply as a last resort, or where
10
+ * styles cannot otherwise be calculated outside of the runtime of the component they're applied.
10
11
  */
11
12
  style?: CSSProperties;
12
13
  /**
13
14
  * Apply a subset of permitted styles, powered by Atlassian Design System tokens.
14
15
  */
15
- xcss?: BoxXCSS | BoxXCSS[];
16
+ xcss?: XCSS | Array<XCSS | false | undefined>;
16
17
  /**
17
18
  * Accessible role
18
19
  */
@@ -1,8 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { css as cssEmotion } from '@emotion/react';
3
2
  import type { CSSPropertiesWithMultiValues, SerializedStyles } from '@emotion/serialize';
4
3
  import type * as CSS from 'csstype';
5
- import { Box } from '../index';
6
4
  import type { MediaQuery } from '../responsive/types';
7
5
  import { TokenisedProps } from './style-maps.partial';
8
6
  declare const uniqueSymbol: unique symbol;
@@ -11,25 +9,20 @@ declare const uniqueSymbol: unique symbol;
11
9
  * @returns a collection of styles that can be applied to the respective primitive
12
10
  */
13
11
  type ParsedXcss = ReturnType<typeof cssEmotion> | ReturnType<typeof cssEmotion>[];
14
- export declare const parseXcss: (args: XCSS | XCSSArray) => ParsedXcss;
12
+ export declare const parseXcss: (args: XCSS | (XCSS | false | undefined)[]) => ParsedXcss;
13
+ type AllMedia = MediaQuery | '@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)' | '@media (prefers-color-scheme: dark)' | '@media (prefers-color-scheme: light)' | '@media (prefers-reduced-motion: reduce)';
15
14
  type CSSMediaQueries = {
16
- [MQ in MediaQuery]?: Omit<SafeCSSObject, MediaQuery>;
15
+ [MQ in AllMedia]?: Omit<SafeCSSObject, AllMedia>;
17
16
  };
18
17
  type CSSPseudos = {
19
- [Pseudo in CSS.Pseudos]?: Omit<SafeCSSObject, CSS.Pseudos | MediaQuery>;
18
+ [Pseudo in CSS.Pseudos]?: Omit<SafeCSSObject, CSS.Pseudos | AllMedia>;
20
19
  };
21
- type SafeCSSObject = CSSPseudos & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
22
- type ScopedSafeCSSObject<T extends keyof SafeCSSObject> = Pick<SafeCSSObject, T>;
23
- declare const boxWrapper: (style: any) => {
24
- readonly [uniqueSymbol]: BoxStyles;
20
+ type AtRulesWithoutMedia = Exclude<CSS.AtRules, '@media'>;
21
+ type CSSAtRules = {
22
+ [AtRule in AtRulesWithoutMedia as `${AtRule}${string}`]?: Omit<SafeCSSObject, AtRulesWithoutMedia>;
25
23
  };
26
- declare const spaceWrapper: (style: any) => {
27
- readonly [uniqueSymbol]: SpaceStyles;
28
- };
29
- type XCSS = ReturnType<typeof boxWrapper> | ReturnType<typeof spaceWrapper>;
30
- type XCSSArray = Array<XCSS | false | undefined>;
31
- type AllowedBoxStyles = keyof SafeCSSObject;
32
- 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';
24
+ type SafeCSSObject = CSSPseudos & CSSAtRules & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
25
+ export type XCSS = ReturnType<typeof xcss>;
33
26
  /**
34
27
  * ### xcss
35
28
  *
@@ -42,18 +35,7 @@ type Spacing = 'columnGap' | 'gap' | 'inset' | 'insetBlock' | 'insetBlockEnd' |
42
35
  * })
43
36
  * ```
44
37
  */
45
- export declare 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): {
46
- readonly [uniqueSymbol]: Primitive extends (<T extends import("react").ElementType<any>>(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 void ? SpaceStyles : never;
47
- };
48
- declare const boxTag: unique symbol;
49
- declare const spaceTag: unique symbol;
50
- export type BoxStyles = SerializedStyles & {
51
- [boxTag]: true;
52
- };
53
- export type SpaceStyles = SerializedStyles & {
54
- [spaceTag]: true;
38
+ export declare function xcss(style: SafeCSSObject): {
39
+ readonly [uniqueSymbol]: SerializedStyles;
55
40
  };
56
- export type BoxXCSS = {
57
- readonly [uniqueSymbol]: BoxStyles;
58
- } | false | undefined;
59
41
  export {};
@@ -133,5 +133,5 @@ declare const Flex: import("react").MemoExoticComponent<import("react").ForwardR
133
133
  * Forwarded ref element
134
134
  */
135
135
  ref?: any;
136
- } & BasePrimitiveProps, "gap" | "rowGap" | "columnGap" | "alignItems" | "direction" | "justifyContent" | "as" | "children" | "wrap" | keyof BasePrimitiveProps> & import("react").RefAttributes<any>>>;
136
+ } & BasePrimitiveProps, "gap" | "rowGap" | "columnGap" | "alignItems" | "direction" | "justifyContent" | "wrap" | "as" | "children" | keyof BasePrimitiveProps> & import("react").RefAttributes<any>>>;
137
137
  export default Flex;
@@ -113,5 +113,5 @@ declare const Inline: import("react").MemoExoticComponent<import("react").Forwar
113
113
  * Forwarded ref element
114
114
  */
115
115
  ref?: any;
116
- } & BasePrimitiveProps, "as" | "children" | "space" | "separator" | keyof BasePrimitiveProps | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "rowSpace"> & import("react").RefAttributes<any>>>;
116
+ } & BasePrimitiveProps, "space" | "separator" | "as" | "children" | keyof BasePrimitiveProps | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "rowSpace"> & import("react").RefAttributes<any>>>;
117
117
  export default Inline;
@@ -87,5 +87,5 @@ declare const Stack: import("react").MemoExoticComponent<import("react").Forward
87
87
  * Forwarded ref element
88
88
  */
89
89
  ref?: any;
90
- } & BasePrimitiveProps, "as" | "children" | "space" | keyof BasePrimitiveProps | "alignInline" | "alignBlock" | "spread" | "grow"> & import("react").RefAttributes<any>>>;
90
+ } & BasePrimitiveProps, "space" | "as" | "children" | keyof BasePrimitiveProps | "alignInline" | "alignBlock" | "spread" | "grow"> & import("react").RefAttributes<any>>>;
91
91
  export default Stack;
@@ -1,18 +1,19 @@
1
1
  import type { CSSProperties } from 'react';
2
- import { type BoxXCSS } from '../xcss/xcss';
2
+ import type { XCSS } from '../xcss/xcss';
3
3
  export type BasePrimitiveProps = {
4
4
  /**
5
5
  * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
6
6
  */
7
7
  testId?: string;
8
8
  /**
9
- * Inline styles to be applied to the primitive.
9
+ * Inline styles to be applied to the primitive. Only apply as a last resort, or where
10
+ * styles cannot otherwise be calculated outside of the runtime of the component they're applied.
10
11
  */
11
12
  style?: CSSProperties;
12
13
  /**
13
14
  * Apply a subset of permitted styles, powered by Atlassian Design System tokens.
14
15
  */
15
- xcss?: BoxXCSS | BoxXCSS[];
16
+ xcss?: XCSS | Array<XCSS | false | undefined>;
16
17
  /**
17
18
  * Accessible role
18
19
  */
@@ -1,8 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { css as cssEmotion } from '@emotion/react';
3
2
  import type { CSSPropertiesWithMultiValues, SerializedStyles } from '@emotion/serialize';
4
3
  import type * as CSS from 'csstype';
5
- import { Box } from '../index';
6
4
  import type { MediaQuery } from '../responsive/types';
7
5
  import { TokenisedProps } from './style-maps.partial';
8
6
  declare const uniqueSymbol: unique symbol;
@@ -11,25 +9,20 @@ declare const uniqueSymbol: unique symbol;
11
9
  * @returns a collection of styles that can be applied to the respective primitive
12
10
  */
13
11
  type ParsedXcss = ReturnType<typeof cssEmotion> | ReturnType<typeof cssEmotion>[];
14
- export declare const parseXcss: (args: XCSS | XCSSArray) => ParsedXcss;
12
+ export declare const parseXcss: (args: XCSS | (XCSS | false | undefined)[]) => ParsedXcss;
13
+ type AllMedia = MediaQuery | '@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)' | '@media (prefers-color-scheme: dark)' | '@media (prefers-color-scheme: light)' | '@media (prefers-reduced-motion: reduce)';
15
14
  type CSSMediaQueries = {
16
- [MQ in MediaQuery]?: Omit<SafeCSSObject, MediaQuery>;
15
+ [MQ in AllMedia]?: Omit<SafeCSSObject, AllMedia>;
17
16
  };
18
17
  type CSSPseudos = {
19
- [Pseudo in CSS.Pseudos]?: Omit<SafeCSSObject, CSS.Pseudos | MediaQuery>;
18
+ [Pseudo in CSS.Pseudos]?: Omit<SafeCSSObject, CSS.Pseudos | AllMedia>;
20
19
  };
21
- type SafeCSSObject = CSSPseudos & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
22
- type ScopedSafeCSSObject<T extends keyof SafeCSSObject> = Pick<SafeCSSObject, T>;
23
- declare const boxWrapper: (style: any) => {
24
- readonly [uniqueSymbol]: BoxStyles;
20
+ type AtRulesWithoutMedia = Exclude<CSS.AtRules, '@media'>;
21
+ type CSSAtRules = {
22
+ [AtRule in AtRulesWithoutMedia as `${AtRule}${string}`]?: Omit<SafeCSSObject, AtRulesWithoutMedia>;
25
23
  };
26
- declare const spaceWrapper: (style: any) => {
27
- readonly [uniqueSymbol]: SpaceStyles;
28
- };
29
- type XCSS = ReturnType<typeof boxWrapper> | ReturnType<typeof spaceWrapper>;
30
- type XCSSArray = Array<XCSS | false | undefined>;
31
- type AllowedBoxStyles = keyof SafeCSSObject;
32
- 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';
24
+ type SafeCSSObject = CSSPseudos & CSSAtRules & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
25
+ export type XCSS = ReturnType<typeof xcss>;
33
26
  /**
34
27
  * ### xcss
35
28
  *
@@ -42,18 +35,7 @@ type Spacing = 'columnGap' | 'gap' | 'inset' | 'insetBlock' | 'insetBlockEnd' |
42
35
  * })
43
36
  * ```
44
37
  */
45
- export declare 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): {
46
- readonly [uniqueSymbol]: Primitive extends (<T extends import("react").ElementType<any>>(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 void ? SpaceStyles : never;
47
- };
48
- declare const boxTag: unique symbol;
49
- declare const spaceTag: unique symbol;
50
- export type BoxStyles = SerializedStyles & {
51
- [boxTag]: true;
52
- };
53
- export type SpaceStyles = SerializedStyles & {
54
- [spaceTag]: true;
38
+ export declare function xcss(style: SafeCSSObject): {
39
+ readonly [uniqueSymbol]: SerializedStyles;
55
40
  };
56
- export type BoxXCSS = {
57
- readonly [uniqueSymbol]: BoxStyles;
58
- } | false | undefined;
59
41
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -22,7 +22,7 @@
22
22
  "category": "Primitives",
23
23
  "name": "Primitives",
24
24
  "status": {
25
- "type": "closed-beta"
25
+ "type": "beta"
26
26
  },
27
27
  "pages": [
28
28
  {
@@ -31,7 +31,7 @@
31
31
  "folder": "overview",
32
32
  "slug": "primitives/overview",
33
33
  "status": {
34
- "type": "closed-beta"
34
+ "type": "beta"
35
35
  }
36
36
  },
37
37
  {
@@ -40,7 +40,7 @@
40
40
  "slug": "primitives/box",
41
41
  "id": "@atlaskit/primitives/box",
42
42
  "status": {
43
- "type": "closed-beta"
43
+ "type": "beta"
44
44
  }
45
45
  },
46
46
  {
@@ -49,7 +49,7 @@
49
49
  "slug": "primitives/inline",
50
50
  "id": "@atlaskit/primitives/inline",
51
51
  "status": {
52
- "type": "closed-beta"
52
+ "type": "beta"
53
53
  }
54
54
  },
55
55
  {
@@ -58,7 +58,7 @@
58
58
  "slug": "primitives/stack",
59
59
  "id": "@atlaskit/primitives/stack",
60
60
  "status": {
61
- "type": "closed-beta"
61
+ "type": "beta"
62
62
  }
63
63
  },
64
64
  {
@@ -67,7 +67,7 @@
67
67
  "slug": "primitives/flex",
68
68
  "id": "@atlaskit/primitives/flex",
69
69
  "status": {
70
- "type": "closed-beta"
70
+ "type": "beta"
71
71
  }
72
72
  },
73
73
  {
@@ -76,7 +76,7 @@
76
76
  "slug": "primitives/grid",
77
77
  "id": "@atlaskit/primitives/grid",
78
78
  "status": {
79
- "type": "closed-beta"
79
+ "type": "beta"
80
80
  }
81
81
  },
82
82
  {
@@ -85,16 +85,16 @@
85
85
  "slug": "primitives/bleed",
86
86
  "id": "@atlaskit/primitives/bleed",
87
87
  "status": {
88
- "type": "closed-beta"
88
+ "type": "beta"
89
89
  }
90
90
  },
91
91
  {
92
- "title": "xCSS",
92
+ "title": "xcss",
93
93
  "folder": "xcss",
94
94
  "slug": "primitives/xcss",
95
95
  "id": "@atlaskit/primitives/xcss",
96
96
  "status": {
97
- "type": "closed-beta"
97
+ "type": "beta"
98
98
  }
99
99
  },
100
100
  {
@@ -103,7 +103,7 @@
103
103
  "slug": "primitives/responsive",
104
104
  "id": "@atlaskit/primitives/responsive",
105
105
  "status": {
106
- "type": "closed-beta"
106
+ "type": "beta"
107
107
  }
108
108
  }
109
109
  ]
@@ -114,7 +114,7 @@
114
114
  },
115
115
  "dependencies": {
116
116
  "@atlaskit/focus-ring": "^1.3.0",
117
- "@atlaskit/tokens": "^1.13.0",
117
+ "@atlaskit/tokens": "^1.14.0",
118
118
  "@babel/runtime": "^7.0.0",
119
119
  "@emotion/react": "^11.7.1",
120
120
  "@emotion/serialize": "^1.1.0",
@@ -181,4 +181,4 @@
181
181
  "./responsive": "./src/responsive/index.tsx"
182
182
  },
183
183
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
184
- }
184
+ }
package/report.api.md CHANGED
@@ -15,8 +15,6 @@
15
15
  <!--SECTION START: Main Entry Types-->
16
16
 
17
17
  ```ts
18
- /// <reference types="react" />
19
-
20
18
  import { ComponentPropsWithoutRef } from 'react';
21
19
  import { ComponentPropsWithRef } from 'react';
22
20
  import type * as CSS_2 from 'csstype';
@@ -26,7 +24,6 @@ import { ElementType } from 'react';
26
24
  import { FC } from 'react';
27
25
  import { ForwardRefExoticComponent } from 'react';
28
26
  import { jsx } from '@emotion/react';
29
- import { JSXElementConstructor } from 'react';
30
27
  import { MemoExoticComponent } from 'react';
31
28
  import { ReactElement } from 'react';
32
29
  import { ReactNode } from 'react';
@@ -84,7 +81,15 @@ const alignItemsMap_2: {
84
81
  };
85
82
 
86
83
  // @public (undocumented)
87
- type AllowedBoxStyles = keyof SafeCSSObject;
84
+ type AllMedia =
85
+ | '@media (prefers-color-scheme: dark)'
86
+ | '@media (prefers-color-scheme: light)'
87
+ | '@media (prefers-reduced-motion: reduce)'
88
+ | '@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)'
89
+ | MediaQuery;
90
+
91
+ // @public (undocumented)
92
+ type AtRulesWithoutMedia = Exclude<CSS_2.AtRules, '@media'>;
88
93
 
89
94
  // @public (undocumented)
90
95
  type AutoComplete<T extends string> = Omit<string, T> | T;
@@ -241,7 +246,7 @@ type BaseBoxPropsFoundation<T extends ElementType> = {
241
246
  type BasePrimitiveProps = {
242
247
  testId?: string;
243
248
  style?: CSSProperties;
244
- xcss?: BoxXCSS | BoxXCSS[];
249
+ xcss?: Array<XCSS | false | undefined> | XCSS;
245
250
  role?: string;
246
251
  };
247
252
 
@@ -337,22 +342,6 @@ export type BoxProps<T extends ElementType> = Omit<
337
342
  BasePrimitiveProps &
338
343
  BaseBoxPropsFoundation<T>;
339
344
 
340
- // @public (undocumented)
341
- type BoxStyles = SerializedStyles & {
342
- [boxTag]: true;
343
- };
344
-
345
- // @public (undocumented)
346
- const boxTag: unique symbol;
347
-
348
- // @public (undocumented)
349
- type BoxXCSS =
350
- | false
351
- | undefined
352
- | {
353
- readonly [uniqueSymbol]: BoxStyles;
354
- };
355
-
356
345
  // @public
357
346
  export type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
358
347
 
@@ -361,14 +350,22 @@ type ClassName = {
361
350
  className?: string;
362
351
  };
363
352
 
353
+ // @public (undocumented)
354
+ type CSSAtRules = {
355
+ [AtRule in AtRulesWithoutMedia as `${AtRule}${string}`]?: Omit<
356
+ SafeCSSObject,
357
+ AtRulesWithoutMedia
358
+ >;
359
+ };
360
+
364
361
  // @public (undocumented)
365
362
  type CSSMediaQueries = {
366
- [MQ in MediaQuery]?: Omit<SafeCSSObject, MediaQuery>;
363
+ [MQ in AllMedia]?: Omit<SafeCSSObject, AllMedia>;
367
364
  };
368
365
 
369
366
  // @public (undocumented)
370
367
  type CSSPseudos = {
371
- [Pseudo in CSS_2.Pseudos]?: Omit<SafeCSSObject, CSS_2.Pseudos | MediaQuery>;
368
+ [Pseudo in CSS_2.Pseudos]?: Omit<SafeCSSObject, AllMedia | CSS_2.Pseudos>;
372
369
  };
373
370
 
374
371
  // @public (undocumented)
@@ -815,16 +812,11 @@ export type PressableProps = Omit<
815
812
 
816
813
  // @public (undocumented)
817
814
  type SafeCSSObject = CSSPseudos &
815
+ CSSAtRules &
818
816
  TokenisedProps &
819
817
  CSSMediaQueries &
820
818
  Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
821
819
 
822
- // @public (undocumented)
823
- type ScopedSafeCSSObject<T extends keyof SafeCSSObject> = Pick<
824
- SafeCSSObject,
825
- T
826
- >;
827
-
828
820
  // @public (undocumented)
829
821
  export type Shadow = keyof typeof shadowMap;
830
822
 
@@ -866,46 +858,6 @@ const spaceMap: {
866
858
  'space.1000': 'var(--ds-space-1000)';
867
859
  };
868
860
 
869
- // @public (undocumented)
870
- type SpaceStyles = SerializedStyles & {
871
- [spaceTag]: true;
872
- };
873
-
874
- // @public (undocumented)
875
- const spaceTag: unique symbol;
876
-
877
- // @public (undocumented)
878
- type Spacing =
879
- | 'columnGap'
880
- | 'gap'
881
- | 'inset'
882
- | 'insetBlock'
883
- | 'insetBlockEnd'
884
- | 'insetBlockStart'
885
- | 'insetInline'
886
- | 'insetInlineEnd'
887
- | 'insetInlineStart'
888
- | 'margin'
889
- | 'marginBlock'
890
- | 'marginBlockEnd'
891
- | 'marginBlockStart'
892
- | 'marginInline'
893
- | 'marginInlineEnd'
894
- | 'marginInlineStart'
895
- | 'outlineOffset'
896
- | 'padding'
897
- | 'paddingBlock'
898
- | 'paddingBlockEnd'
899
- | 'paddingBlockStart'
900
- | 'paddingBottom'
901
- | 'paddingInline'
902
- | 'paddingInlineEnd'
903
- | 'paddingInlineStart'
904
- | 'paddingLeft'
905
- | 'paddingRight'
906
- | 'paddingTop'
907
- | 'rowGap';
908
-
909
861
  // @public (undocumented)
910
862
  type Spread = 'space-between';
911
863
 
@@ -1126,24 +1078,12 @@ export const UNSAFE_media: {
1126
1078
  // @public (undocumented)
1127
1079
  type Wrap = keyof typeof flexWrapMap;
1128
1080
 
1081
+ // @public (undocumented)
1082
+ type XCSS = ReturnType<typeof xcss>;
1083
+
1129
1084
  // @public
1130
- export function xcss<Primitive extends typeof Box | void = typeof Box>(
1131
- style: Primitive extends typeof Box
1132
- ?
1133
- | ScopedSafeCSSObject<AllowedBoxStyles>
1134
- | ScopedSafeCSSObject<AllowedBoxStyles>[]
1135
- : Primitive extends void
1136
- ? ScopedSafeCSSObject<Spacing> | ScopedSafeCSSObject<Spacing>[]
1137
- : never,
1138
- ): {
1139
- readonly [uniqueSymbol]: Primitive extends (<T extends ElementType<any>>(
1140
- props: BoxProps<T>,
1141
- ) => ReactElement<any, JSXElementConstructor<any> | string> | null) &
1142
- FC<BoxProps<'div'>>
1143
- ? BoxStyles
1144
- : Primitive extends void
1145
- ? SpaceStyles
1146
- : never;
1085
+ export function xcss(style: SafeCSSObject): {
1086
+ readonly [uniqueSymbol]: SerializedStyles;
1147
1087
  };
1148
1088
 
1149
1089
  // (No @packageDocumentation comment for this package)
@@ -4,8 +4,6 @@
4
4
 
5
5
  ```ts
6
6
 
7
- /// <reference types="react" />
8
-
9
7
  import { ComponentPropsWithoutRef } from 'react';
10
8
  import { ComponentPropsWithRef } from 'react';
11
9
  import type * as CSS_2 from 'csstype';
@@ -15,7 +13,6 @@ import { ElementType } from 'react';
15
13
  import { FC } from 'react';
16
14
  import { ForwardRefExoticComponent } from 'react';
17
15
  import { jsx } from '@emotion/react';
18
- import { JSXElementConstructor } from 'react';
19
16
  import { MemoExoticComponent } from 'react';
20
17
  import { ReactElement } from 'react';
21
18
  import { ReactNode } from 'react';
@@ -73,7 +70,10 @@ const alignItemsMap_2: {
73
70
  };
74
71
 
75
72
  // @public (undocumented)
76
- type AllowedBoxStyles = keyof SafeCSSObject;
73
+ type AllMedia = '@media (prefers-color-scheme: dark)' | '@media (prefers-color-scheme: light)' | '@media (prefers-reduced-motion: reduce)' | '@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)' | MediaQuery;
74
+
75
+ // @public (undocumented)
76
+ type AtRulesWithoutMedia = Exclude<CSS_2.AtRules, '@media'>;
77
77
 
78
78
  // @public (undocumented)
79
79
  type AutoComplete<T extends string> = Omit<string, T> | T;
@@ -224,7 +224,7 @@ type BaseBoxPropsFoundation<T extends ElementType> = {
224
224
  type BasePrimitiveProps = {
225
225
  testId?: string;
226
226
  style?: CSSProperties;
227
- xcss?: BoxXCSS | BoxXCSS[];
227
+ xcss?: Array<XCSS | false | undefined> | XCSS;
228
228
  role?: string;
229
229
  };
230
230
 
@@ -303,19 +303,6 @@ type BoxComponent<T extends ElementType = 'div'> = (<T extends ElementType>(prop
303
303
  // @public (undocumented)
304
304
  export type BoxProps<T extends ElementType> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className'> & BasePrimitiveProps & BaseBoxPropsFoundation<T>;
305
305
 
306
- // @public (undocumented)
307
- type BoxStyles = SerializedStyles & {
308
- [boxTag]: true;
309
- };
310
-
311
- // @public (undocumented)
312
- const boxTag: unique symbol;
313
-
314
- // @public (undocumented)
315
- type BoxXCSS = false | undefined | {
316
- readonly [uniqueSymbol]: BoxStyles;
317
- };
318
-
319
306
  // @public
320
307
  export type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
321
308
 
@@ -324,14 +311,19 @@ type ClassName = {
324
311
  className?: string;
325
312
  };
326
313
 
314
+ // @public (undocumented)
315
+ type CSSAtRules = {
316
+ [AtRule in AtRulesWithoutMedia as `${AtRule}${string}`]?: Omit<SafeCSSObject, AtRulesWithoutMedia>;
317
+ };
318
+
327
319
  // @public (undocumented)
328
320
  type CSSMediaQueries = {
329
- [MQ in MediaQuery]?: Omit<SafeCSSObject, MediaQuery>;
321
+ [MQ in AllMedia]?: Omit<SafeCSSObject, AllMedia>;
330
322
  };
331
323
 
332
324
  // @public (undocumented)
333
325
  type CSSPseudos = {
334
- [Pseudo in CSS_2.Pseudos]?: Omit<SafeCSSObject, CSS_2.Pseudos | MediaQuery>;
326
+ [Pseudo in CSS_2.Pseudos]?: Omit<SafeCSSObject, AllMedia | CSS_2.Pseudos>;
335
327
  };
336
328
 
337
329
  // @public (undocumented)
@@ -558,10 +550,7 @@ export type PressableProps = Omit<BaseBoxProps<'button'>, 'as' | 'children' | 'd
558
550
  };
559
551
 
560
552
  // @public (undocumented)
561
- type SafeCSSObject = CSSPseudos & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
562
-
563
- // @public (undocumented)
564
- type ScopedSafeCSSObject<T extends keyof SafeCSSObject> = Pick<SafeCSSObject, T>;
553
+ type SafeCSSObject = CSSPseudos & CSSAtRules & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
565
554
 
566
555
  // @public (undocumented)
567
556
  export type Shadow = keyof typeof shadowMap;
@@ -599,17 +588,6 @@ const spaceMap: {
599
588
  'space.1000': "var(--ds-space-1000)";
600
589
  };
601
590
 
602
- // @public (undocumented)
603
- type SpaceStyles = SerializedStyles & {
604
- [spaceTag]: true;
605
- };
606
-
607
- // @public (undocumented)
608
- const spaceTag: unique symbol;
609
-
610
- // @public (undocumented)
611
- 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';
612
-
613
591
  // @public (undocumented)
614
592
  type Spread = 'space-between';
615
593
 
@@ -800,9 +778,12 @@ export const UNSAFE_media: {
800
778
  // @public (undocumented)
801
779
  type Wrap = keyof typeof flexWrapMap;
802
780
 
781
+ // @public (undocumented)
782
+ type XCSS = ReturnType<typeof xcss>;
783
+
803
784
  // @public
804
- 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): {
805
- readonly [uniqueSymbol]: Primitive extends (<T extends ElementType<any>>(props: BoxProps<T>) => ReactElement<any, JSXElementConstructor<any>| string> | null) & FC<BoxProps<"div">> ? BoxStyles : Primitive extends void ? SpaceStyles : never;
785
+ export function xcss(style: SafeCSSObject): {
786
+ readonly [uniqueSymbol]: SerializedStyles;
806
787
  };
807
788
 
808
789
  // (No @packageDocumentation comment for this package)
@@ -1,9 +0,0 @@
1
- ---
2
- title: Accessibility
3
- description: Primitives accessibility.
4
- order: 0
5
- ---
6
-
7
- ## Default
8
-
9
- This is placeholder text.