@atlaskit/primitives 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +6 -2
- package/box/package.json +2 -2
- package/constellation/box/code.mdx +6 -2
- package/constellation/box/usage.mdx +30 -0
- package/constellation/inline/code.mdx +1 -1
- package/constellation/inline/usage.mdx +36 -0
- package/constellation/overview/images/box-usage-example.png +0 -0
- package/constellation/overview/images/inline-usage-example.png +0 -0
- package/constellation/overview/images/stack-usage-example.png +0 -0
- package/constellation/overview/index.mdx +66 -0
- package/constellation/stack/code.mdx +1 -1
- package/constellation/stack/usage.mdx +31 -0
- package/constellation/xcss/examples.mdx +21 -0
- package/constellation/xcss/logo.png +0 -0
- package/constellation/xcss/migration.mdx +142 -0
- package/constellation/xcss/usage.mdx +115 -0
- package/dist/cjs/components/box.js +1 -1
- package/dist/cjs/components/inline.js +1 -1
- package/dist/cjs/components/internal/base-box.js +1 -1
- package/dist/cjs/components/stack.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/{internal → xcss}/style-maps.partial.js +13 -43
- package/dist/cjs/{internal → xcss}/xcss.js +38 -26
- package/dist/es2019/components/box.js +1 -1
- package/dist/es2019/components/inline.js +1 -1
- package/dist/es2019/components/internal/base-box.js +1 -1
- package/dist/es2019/components/stack.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/{internal → xcss}/style-maps.partial.js +12 -40
- package/dist/es2019/{internal → xcss}/xcss.js +38 -25
- package/dist/esm/components/box.js +1 -1
- package/dist/esm/components/inline.js +1 -1
- package/dist/esm/components/internal/base-box.js +1 -1
- package/dist/esm/components/stack.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/{internal → xcss}/style-maps.partial.js +12 -40
- package/dist/esm/{internal → xcss}/xcss.js +39 -27
- package/dist/types/components/box.d.ts +2 -2
- package/dist/types/components/inline.d.ts +7 -7
- package/dist/types/components/internal/base-box.d.ts +15 -14
- package/dist/types/components/stack.d.ts +6 -6
- package/dist/types/components/types.d.ts +3 -3
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/helpers/responsive/types.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/{internal → xcss}/style-maps.partial.d.ts +81 -130
- package/dist/types/xcss/xcss.d.ts +57 -0
- package/extract-react-types/box-props.tsx +95 -0
- package/extract-react-types/inline-props.tsx +86 -1
- package/extract-react-types/stack-props.tsx +70 -1
- package/inline/package.json +2 -2
- package/package.json +25 -8
- package/report.api.md +94 -354
- package/responsive/package.json +2 -2
- package/scripts/codegen-file-templates/dimensions.tsx +17 -16
- package/scripts/codegen-styles.tsx +2 -2
- package/scripts/spacing-codegen-template.tsx +24 -91
- package/stack/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +649 -0
- package/constellation/overview/examples.mdx +0 -7
- package/dist/cjs/components/internal/extract-react-types/inline-props.js +0 -7
- package/dist/cjs/components/internal/extract-react-types/stack-props.js +0 -7
- package/dist/es2019/components/internal/extract-react-types/inline-props.js +0 -1
- package/dist/es2019/components/internal/extract-react-types/stack-props.js +0 -1
- package/dist/esm/components/internal/extract-react-types/inline-props.js +0 -1
- package/dist/esm/components/internal/extract-react-types/stack-props.js +0 -1
- package/dist/types/components/internal/extract-react-types/inline-props.d.ts +0 -2
- package/dist/types/components/internal/extract-react-types/stack-props.d.ts +0 -2
- package/dist/types/internal/xcss.d.ts +0 -50
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { css as cssEmotion } from '@emotion/react';
|
|
3
|
-
import { CSSPropertiesWithMultiValues, SerializedStyles } from '@emotion/serialize';
|
|
4
|
-
import type * as CSS from 'csstype';
|
|
5
|
-
import { Box, Inline } from '../index';
|
|
6
|
-
import { TokenisedProps } from './style-maps.partial';
|
|
7
|
-
declare const uniqueSymbol: unique symbol;
|
|
8
|
-
/**
|
|
9
|
-
* @internal used in primitives
|
|
10
|
-
* @returns a collection of styles that can be applied to the respective primitive
|
|
11
|
-
*/
|
|
12
|
-
declare type ParsedXcss = ReturnType<typeof cssEmotion> | ReturnType<typeof cssEmotion>[];
|
|
13
|
-
export declare const parseXcss: (args: XCSS | Array<XCSS | false | undefined>) => ParsedXcss;
|
|
14
|
-
declare type CSSPseudos = {
|
|
15
|
-
[Pseudo in CSS.Pseudos]?: SafeCSSObject;
|
|
16
|
-
};
|
|
17
|
-
declare type SafeCSSObject = CSSPseudos & TokenisedProps & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
|
|
18
|
-
declare type ScopedSafeCSSObject<T extends keyof SafeCSSObject> = Pick<SafeCSSObject, T>;
|
|
19
|
-
declare const boxWrapper: (style: any) => {
|
|
20
|
-
readonly symbol: typeof uniqueSymbol;
|
|
21
|
-
readonly styles: BoxStyles;
|
|
22
|
-
};
|
|
23
|
-
declare const inlineWrapper: (style: any) => {
|
|
24
|
-
readonly symbol: typeof uniqueSymbol;
|
|
25
|
-
readonly styles: InlineStyles;
|
|
26
|
-
};
|
|
27
|
-
declare type XCSS = ReturnType<typeof boxWrapper> | ReturnType<typeof inlineWrapper>;
|
|
28
|
-
declare type AllowedBoxStyles = keyof SafeCSSObject;
|
|
29
|
-
declare type AllowedInlineStyles = 'backgroundColor' | 'padding';
|
|
30
|
-
export declare function xcss<Primitive extends typeof Box | typeof Inline = typeof Box>(style: Primitive extends typeof Box ? ScopedSafeCSSObject<AllowedBoxStyles> | ScopedSafeCSSObject<AllowedBoxStyles>[] : Primitive extends typeof Inline ? ScopedSafeCSSObject<AllowedInlineStyles> | ScopedSafeCSSObject<AllowedInlineStyles>[] : never): {
|
|
31
|
-
readonly symbol: typeof uniqueSymbol;
|
|
32
|
-
readonly styles: 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;
|
|
33
|
-
};
|
|
34
|
-
declare const boxTag: unique symbol;
|
|
35
|
-
export declare type BoxStyles = SerializedStyles & {
|
|
36
|
-
[boxTag]: true;
|
|
37
|
-
};
|
|
38
|
-
export declare type BoxXCSS = {
|
|
39
|
-
readonly symbol: typeof uniqueSymbol;
|
|
40
|
-
readonly styles: BoxStyles;
|
|
41
|
-
};
|
|
42
|
-
declare const inlineTag: unique symbol;
|
|
43
|
-
export declare type InlineStyles = SerializedStyles & {
|
|
44
|
-
[inlineTag]: true;
|
|
45
|
-
};
|
|
46
|
-
export declare type InlineXCSS = {
|
|
47
|
-
readonly symbol: typeof uniqueSymbol;
|
|
48
|
-
readonly styles: InlineStyles;
|
|
49
|
-
};
|
|
50
|
-
export {};
|