@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.
Files changed (73) hide show
  1. package/CHANGELOG.md +12 -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/code.mdx +1 -1
  7. package/constellation/inline/usage.mdx +36 -0
  8. package/constellation/overview/images/box-usage-example.png +0 -0
  9. package/constellation/overview/images/inline-usage-example.png +0 -0
  10. package/constellation/overview/images/stack-usage-example.png +0 -0
  11. package/constellation/overview/index.mdx +66 -0
  12. package/constellation/stack/code.mdx +1 -1
  13. package/constellation/stack/usage.mdx +31 -0
  14. package/constellation/xcss/examples.mdx +21 -0
  15. package/constellation/xcss/logo.png +0 -0
  16. package/constellation/xcss/migration.mdx +142 -0
  17. package/constellation/xcss/usage.mdx +115 -0
  18. package/dist/cjs/components/box.js +1 -1
  19. package/dist/cjs/components/inline.js +1 -1
  20. package/dist/cjs/components/internal/base-box.js +1 -1
  21. package/dist/cjs/components/stack.js +1 -1
  22. package/dist/cjs/index.js +1 -1
  23. package/dist/cjs/version.json +1 -1
  24. package/dist/cjs/{internal → xcss}/style-maps.partial.js +13 -43
  25. package/dist/cjs/{internal → xcss}/xcss.js +38 -26
  26. package/dist/es2019/components/box.js +1 -1
  27. package/dist/es2019/components/inline.js +1 -1
  28. package/dist/es2019/components/internal/base-box.js +1 -1
  29. package/dist/es2019/components/stack.js +1 -1
  30. package/dist/es2019/index.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/es2019/{internal → xcss}/style-maps.partial.js +12 -40
  33. package/dist/es2019/{internal → xcss}/xcss.js +38 -25
  34. package/dist/esm/components/box.js +1 -1
  35. package/dist/esm/components/inline.js +1 -1
  36. package/dist/esm/components/internal/base-box.js +1 -1
  37. package/dist/esm/components/stack.js +1 -1
  38. package/dist/esm/index.js +1 -1
  39. package/dist/esm/version.json +1 -1
  40. package/dist/esm/{internal → xcss}/style-maps.partial.js +12 -40
  41. package/dist/esm/{internal → xcss}/xcss.js +39 -27
  42. package/dist/types/components/box.d.ts +2 -2
  43. package/dist/types/components/inline.d.ts +7 -7
  44. package/dist/types/components/internal/base-box.d.ts +15 -14
  45. package/dist/types/components/stack.d.ts +6 -6
  46. package/dist/types/components/types.d.ts +3 -3
  47. package/dist/types/constants.d.ts +1 -1
  48. package/dist/types/helpers/responsive/types.d.ts +4 -4
  49. package/dist/types/index.d.ts +1 -1
  50. package/dist/types/{internal → xcss}/style-maps.partial.d.ts +81 -130
  51. package/dist/types/xcss/xcss.d.ts +57 -0
  52. package/extract-react-types/box-props.tsx +95 -0
  53. package/extract-react-types/inline-props.tsx +86 -1
  54. package/extract-react-types/stack-props.tsx +70 -1
  55. package/inline/package.json +2 -2
  56. package/package.json +25 -8
  57. package/report.api.md +94 -354
  58. package/responsive/package.json +2 -2
  59. package/scripts/codegen-file-templates/dimensions.tsx +17 -16
  60. package/scripts/codegen-styles.tsx +2 -2
  61. package/scripts/spacing-codegen-template.tsx +24 -91
  62. package/stack/package.json +2 -2
  63. package/tmp/api-report-tmp.d.ts +649 -0
  64. package/constellation/overview/examples.mdx +0 -7
  65. package/dist/cjs/components/internal/extract-react-types/inline-props.js +0 -7
  66. package/dist/cjs/components/internal/extract-react-types/stack-props.js +0 -7
  67. package/dist/es2019/components/internal/extract-react-types/inline-props.js +0 -1
  68. package/dist/es2019/components/internal/extract-react-types/stack-props.js +0 -1
  69. package/dist/esm/components/internal/extract-react-types/inline-props.js +0 -1
  70. package/dist/esm/components/internal/extract-react-types/stack-props.js +0 -1
  71. package/dist/types/components/internal/extract-react-types/inline-props.d.ts +0 -2
  72. package/dist/types/components/internal/extract-react-types/stack-props.d.ts +0 -2
  73. package/dist/types/internal/xcss.d.ts +0 -50
@@ -1,2 +0,0 @@
1
- import type { InlineProps } from '../../inline';
2
- export default function Inline(_: InlineProps): void;
@@ -1,2 +0,0 @@
1
- import type { StackProps } from '../../stack';
2
- export default function Inline(_: StackProps): void;
@@ -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 {};