@atlaskit/ds-explorations 2.3.2 → 2.4.0

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 (60) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/box/package.json +15 -0
  3. package/dist/cjs/components/box.partial.js +620 -0
  4. package/dist/cjs/components/inline.partial.js +182 -0
  5. package/dist/cjs/components/stack.partial.js +148 -0
  6. package/dist/cjs/index.js +21 -0
  7. package/dist/es2019/components/box.partial.js +614 -0
  8. package/dist/es2019/components/inline.partial.js +177 -0
  9. package/dist/es2019/components/stack.partial.js +144 -0
  10. package/dist/es2019/index.js +3 -0
  11. package/dist/esm/components/box.partial.js +617 -0
  12. package/dist/esm/components/inline.partial.js +177 -0
  13. package/dist/esm/components/stack.partial.js +143 -0
  14. package/dist/esm/index.js +3 -0
  15. package/dist/types/components/box.partial.d.ts +357 -0
  16. package/dist/types/components/inline.partial.d.ts +108 -0
  17. package/dist/types/components/stack.partial.d.ts +92 -0
  18. package/dist/types/components/surface-provider.d.ts +2 -2
  19. package/dist/types/index.d.ts +6 -0
  20. package/dist/types-ts4.5/components/box.partial.d.ts +357 -0
  21. package/dist/types-ts4.5/components/inline.partial.d.ts +108 -0
  22. package/dist/types-ts4.5/components/stack.partial.d.ts +92 -0
  23. package/dist/types-ts4.5/components/surface-provider.d.ts +2 -2
  24. package/dist/types-ts4.5/index.d.ts +6 -0
  25. package/examples/00-basic.tsx +22 -0
  26. package/examples/01-box.tsx +171 -0
  27. package/examples/02-text-advanced.tsx +20 -11
  28. package/examples/02-text.tsx +10 -15
  29. package/examples/03-stack.tsx +99 -0
  30. package/examples/04-inline.tsx +99 -0
  31. package/examples/05-badge.tsx +5 -9
  32. package/examples/06-section-message.tsx +4 -2
  33. package/examples/07-comment.tsx +3 -1
  34. package/examples/08-lozenge.tsx +4 -8
  35. package/examples/99-interactions.tsx +33 -49
  36. package/inline/package.json +15 -0
  37. package/package.json +5 -3
  38. package/report.api.md +465 -0
  39. package/scripts/codegen-styles.tsx +89 -16
  40. package/src/components/__tests__/unit/box.test.tsx +55 -0
  41. package/src/components/__tests__/unit/inline.test.tsx +43 -0
  42. package/src/components/__tests__/unit/interaction-suface.test.tsx +2 -2
  43. package/src/components/__tests__/unit/stack.test.tsx +31 -0
  44. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +3 -0
  45. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +3 -0
  46. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +3 -0
  47. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +3 -0
  48. package/src/components/__tests__/visual-regression/inline-snapshot-test.tsx +28 -0
  49. package/src/components/__tests__/visual-regression/stack-snapshot-test.tsx +28 -0
  50. package/src/components/__tests__/vr-tests/__snapshots__/box--default.png +0 -0
  51. package/src/components/__tests__/vr-tests/box-snapshot-test.vr.tsx +6 -0
  52. package/src/components/box.partial.tsx +706 -0
  53. package/src/components/inline.partial.tsx +218 -0
  54. package/src/components/stack.partial.tsx +174 -0
  55. package/src/components/surface-provider.tsx +1 -1
  56. package/src/index.tsx +6 -0
  57. package/stack/package.json +15 -0
  58. package/tmp/api-report-tmp.d.ts +451 -0
  59. package/tsconfig.app.json +0 -3
  60. package/tsconfig.dev.json +6 -0
@@ -0,0 +1,108 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ import type { BasePrimitiveProps } from './types';
4
+ /**
5
+ * @private
6
+ * @deprecated DSP-8009: This type is scheduled for deletion.
7
+ * Please use `Inline` from `@atlaskit/primitives` instead.
8
+ */
9
+ export interface InlineProps extends BasePrimitiveProps {
10
+ /**
11
+ * Used to align children along the cross axis.
12
+ */
13
+ alignItems?: FlexAlignItems;
14
+ /**
15
+ * Used to align children along the main axis.
16
+ */
17
+ justifyContent?: FlexJustifyContent;
18
+ /**
19
+ * Sets whether children are forced onto one line or can wrap onto multiple lines
20
+ */
21
+ flexWrap?: FlexWrap;
22
+ /**
23
+ * Token representing gap between children.
24
+ */
25
+ gap: ColumnGap;
26
+ /**
27
+ * Renders a divider between children.
28
+ * If a string is provided it will automatically be wrapped in a `<Text>` component.
29
+ */
30
+ divider?: ReactNode;
31
+ /**
32
+ * Elements to be rendered inside the Inline.
33
+ */
34
+ children: ReactNode;
35
+ }
36
+ type FlexAlignItems = keyof typeof flexAlignItemsMap;
37
+ declare const flexAlignItemsMap: {
38
+ center: import("@emotion/react").SerializedStyles;
39
+ baseline: import("@emotion/react").SerializedStyles;
40
+ flexStart: import("@emotion/react").SerializedStyles;
41
+ flexEnd: import("@emotion/react").SerializedStyles;
42
+ start: import("@emotion/react").SerializedStyles;
43
+ end: import("@emotion/react").SerializedStyles;
44
+ };
45
+ type FlexJustifyContent = keyof typeof flexJustifyContentMap;
46
+ declare const flexJustifyContentMap: {
47
+ center: import("@emotion/react").SerializedStyles;
48
+ flexStart: import("@emotion/react").SerializedStyles;
49
+ 'space-between': import("@emotion/react").SerializedStyles;
50
+ flexEnd: import("@emotion/react").SerializedStyles;
51
+ start: import("@emotion/react").SerializedStyles;
52
+ end: import("@emotion/react").SerializedStyles;
53
+ spaceBetween: import("@emotion/react").SerializedStyles;
54
+ };
55
+ type FlexWrap = keyof typeof flexWrapMap;
56
+ declare const flexWrapMap: {
57
+ wrap: import("@emotion/react").SerializedStyles;
58
+ };
59
+ /**
60
+ * __Inline__
61
+ *
62
+ * Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
63
+ * Renders a `div` by default.
64
+ *
65
+ * @private
66
+ * @deprecated DSP-8009: This primitive is scheduled for deletion.
67
+ * Please use `Inline` from `@atlaskit/primitives` instead.
68
+ *
69
+ * @example
70
+ * ```tsx
71
+ * const App = () => (
72
+ * <Inline gap="space.100">
73
+ * <Button />
74
+ * <Button />
75
+ * </Inline>
76
+ * )
77
+ * ```
78
+ */
79
+ declare const Inline: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<InlineProps & import("react").RefAttributes<HTMLDivElement>>>;
80
+ export default Inline;
81
+ /**
82
+ * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
83
+ * @codegen <<SignedSource::63747c8b92ba373ad2259fa1fff3f434>>
84
+ * @codegenId spacing
85
+ * @codegenCommand yarn codegen-styles
86
+ * @codegenParams ["columnGap"]
87
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::298080e8024fb3eb37589721413e0156>>
88
+ */
89
+ declare const columnGapMap: {
90
+ 'space.0': import("@emotion/react").SerializedStyles;
91
+ 'space.025': import("@emotion/react").SerializedStyles;
92
+ 'space.050': import("@emotion/react").SerializedStyles;
93
+ 'space.075': import("@emotion/react").SerializedStyles;
94
+ 'space.100': import("@emotion/react").SerializedStyles;
95
+ 'space.1000': import("@emotion/react").SerializedStyles;
96
+ 'space.150': import("@emotion/react").SerializedStyles;
97
+ 'space.200': import("@emotion/react").SerializedStyles;
98
+ 'space.250': import("@emotion/react").SerializedStyles;
99
+ 'space.300': import("@emotion/react").SerializedStyles;
100
+ 'space.400': import("@emotion/react").SerializedStyles;
101
+ 'space.500': import("@emotion/react").SerializedStyles;
102
+ 'space.600': import("@emotion/react").SerializedStyles;
103
+ 'space.800': import("@emotion/react").SerializedStyles;
104
+ };
105
+ export type ColumnGap = keyof typeof columnGapMap;
106
+ /**
107
+ * @codegenEnd
108
+ */
@@ -0,0 +1,92 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ import { BasePrimitiveProps } from './types';
4
+ /**
5
+ * @private
6
+ * @deprecated DSP-8009: This type is scheduled for deletion.
7
+ * Please use `Stack` from `@atlaskit/primitives` instead.
8
+ */
9
+ export interface StackProps extends BasePrimitiveProps {
10
+ /**
11
+ * Used to align children along the cross axis.
12
+ */
13
+ alignItems?: FlexAlignItems;
14
+ /**
15
+ * Used to align children along the main axis.
16
+ */
17
+ justifyContent?: FlexJustifyContent;
18
+ /**
19
+ * Sets whether children are forced onto one line or can wrap onto multiple lines
20
+ */
21
+ flexWrap?: FlexWrap;
22
+ /**
23
+ * Token representing gap between children.
24
+ */
25
+ gap: RowGap;
26
+ /**
27
+ * Elements to be rendered inside the Stack.
28
+ */
29
+ children: ReactNode;
30
+ }
31
+ type FlexAlignItems = keyof typeof flexAlignItemsMap;
32
+ declare const flexAlignItemsMap: {
33
+ center: import("@emotion/react").SerializedStyles;
34
+ baseline: import("@emotion/react").SerializedStyles;
35
+ flexStart: import("@emotion/react").SerializedStyles;
36
+ flexEnd: import("@emotion/react").SerializedStyles;
37
+ start: import("@emotion/react").SerializedStyles;
38
+ end: import("@emotion/react").SerializedStyles;
39
+ };
40
+ type FlexJustifyContent = keyof typeof flexJustifyContentMap;
41
+ declare const flexJustifyContentMap: {
42
+ center: import("@emotion/react").SerializedStyles;
43
+ flexStart: import("@emotion/react").SerializedStyles;
44
+ flexEnd: import("@emotion/react").SerializedStyles;
45
+ start: import("@emotion/react").SerializedStyles;
46
+ end: import("@emotion/react").SerializedStyles;
47
+ };
48
+ type FlexWrap = keyof typeof flexWrapMap;
49
+ declare const flexWrapMap: {
50
+ wrap: import("@emotion/react").SerializedStyles;
51
+ };
52
+ /**
53
+ * __Stack__
54
+ *
55
+ * Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
56
+ * Renders a `div` by default.
57
+ *
58
+ * @private
59
+ * @deprecated DSP-8009: This primitive is scheduled for deletion.
60
+ * Please use `Stack` from `@atlaskit/primitives` instead.
61
+ *
62
+ */
63
+ declare const Stack: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLDivElement>>>;
64
+ export default Stack;
65
+ /**
66
+ * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
67
+ * @codegen <<SignedSource::02ffa7c4ee52871441d288f44a054685>>
68
+ * @codegenId spacing
69
+ * @codegenCommand yarn codegen-styles
70
+ * @codegenParams ["rowGap"]
71
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::298080e8024fb3eb37589721413e0156>>
72
+ */
73
+ declare const rowGapMap: {
74
+ 'space.0': import("@emotion/react").SerializedStyles;
75
+ 'space.025': import("@emotion/react").SerializedStyles;
76
+ 'space.050': import("@emotion/react").SerializedStyles;
77
+ 'space.075': import("@emotion/react").SerializedStyles;
78
+ 'space.100': import("@emotion/react").SerializedStyles;
79
+ 'space.1000': import("@emotion/react").SerializedStyles;
80
+ 'space.150': import("@emotion/react").SerializedStyles;
81
+ 'space.200': import("@emotion/react").SerializedStyles;
82
+ 'space.250': import("@emotion/react").SerializedStyles;
83
+ 'space.300': import("@emotion/react").SerializedStyles;
84
+ 'space.400': import("@emotion/react").SerializedStyles;
85
+ 'space.500': import("@emotion/react").SerializedStyles;
86
+ 'space.600': import("@emotion/react").SerializedStyles;
87
+ 'space.800': import("@emotion/react").SerializedStyles;
88
+ };
89
+ export type RowGap = keyof typeof rowGapMap;
90
+ /**
91
+ * @codegenEnd
92
+ */
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * A surface context provides context information on the current background (if set).
6
6
  */
7
- export declare const SurfaceContext: import("react").Context<"color.background.accent.lime.subtlest" | "color.background.accent.lime.subtlest.hovered" | "color.background.accent.lime.subtlest.pressed" | "color.background.accent.lime.subtler" | "color.background.accent.lime.subtler.hovered" | "color.background.accent.lime.subtler.pressed" | "color.background.accent.lime.subtle" | "color.background.accent.lime.subtle.hovered" | "color.background.accent.lime.subtle.pressed" | "color.background.accent.lime.bolder" | "color.background.accent.lime.bolder.hovered" | "color.background.accent.lime.bolder.pressed" | "color.background.accent.red.subtlest" | "color.background.accent.red.subtlest.hovered" | "color.background.accent.red.subtlest.pressed" | "color.background.accent.red.subtler" | "color.background.accent.red.subtler.hovered" | "color.background.accent.red.subtler.pressed" | "color.background.accent.red.subtle" | "color.background.accent.red.subtle.hovered" | "color.background.accent.red.subtle.pressed" | "color.background.accent.red.bolder" | "color.background.accent.red.bolder.hovered" | "color.background.accent.red.bolder.pressed" | "color.background.accent.orange.subtlest" | "color.background.accent.orange.subtlest.hovered" | "color.background.accent.orange.subtlest.pressed" | "color.background.accent.orange.subtler" | "color.background.accent.orange.subtler.hovered" | "color.background.accent.orange.subtler.pressed" | "color.background.accent.orange.subtle" | "color.background.accent.orange.subtle.hovered" | "color.background.accent.orange.subtle.pressed" | "color.background.accent.orange.bolder" | "color.background.accent.orange.bolder.hovered" | "color.background.accent.orange.bolder.pressed" | "color.background.accent.yellow.subtlest" | "color.background.accent.yellow.subtlest.hovered" | "color.background.accent.yellow.subtlest.pressed" | "color.background.accent.yellow.subtler" | "color.background.accent.yellow.subtler.hovered" | "color.background.accent.yellow.subtler.pressed" | "color.background.accent.yellow.subtle" | "color.background.accent.yellow.subtle.hovered" | "color.background.accent.yellow.subtle.pressed" | "color.background.accent.yellow.bolder" | "color.background.accent.yellow.bolder.hovered" | "color.background.accent.yellow.bolder.pressed" | "color.background.accent.green.subtlest" | "color.background.accent.green.subtlest.hovered" | "color.background.accent.green.subtlest.pressed" | "color.background.accent.green.subtler" | "color.background.accent.green.subtler.hovered" | "color.background.accent.green.subtler.pressed" | "color.background.accent.green.subtle" | "color.background.accent.green.subtle.hovered" | "color.background.accent.green.subtle.pressed" | "color.background.accent.green.bolder" | "color.background.accent.green.bolder.hovered" | "color.background.accent.green.bolder.pressed" | "color.background.accent.teal.subtlest" | "color.background.accent.teal.subtlest.hovered" | "color.background.accent.teal.subtlest.pressed" | "color.background.accent.teal.subtler" | "color.background.accent.teal.subtler.hovered" | "color.background.accent.teal.subtler.pressed" | "color.background.accent.teal.subtle" | "color.background.accent.teal.subtle.hovered" | "color.background.accent.teal.subtle.pressed" | "color.background.accent.teal.bolder" | "color.background.accent.teal.bolder.hovered" | "color.background.accent.teal.bolder.pressed" | "color.background.accent.blue.subtlest" | "color.background.accent.blue.subtlest.hovered" | "color.background.accent.blue.subtlest.pressed" | "color.background.accent.blue.subtler" | "color.background.accent.blue.subtler.hovered" | "color.background.accent.blue.subtler.pressed" | "color.background.accent.blue.subtle" | "color.background.accent.blue.subtle.hovered" | "color.background.accent.blue.subtle.pressed" | "color.background.accent.blue.bolder" | "color.background.accent.blue.bolder.hovered" | "color.background.accent.blue.bolder.pressed" | "color.background.accent.purple.subtlest" | "color.background.accent.purple.subtlest.hovered" | "color.background.accent.purple.subtlest.pressed" | "color.background.accent.purple.subtler" | "color.background.accent.purple.subtler.hovered" | "color.background.accent.purple.subtler.pressed" | "color.background.accent.purple.subtle" | "color.background.accent.purple.subtle.hovered" | "color.background.accent.purple.subtle.pressed" | "color.background.accent.purple.bolder" | "color.background.accent.purple.bolder.hovered" | "color.background.accent.purple.bolder.pressed" | "color.background.accent.magenta.subtlest" | "color.background.accent.magenta.subtlest.hovered" | "color.background.accent.magenta.subtlest.pressed" | "color.background.accent.magenta.subtler" | "color.background.accent.magenta.subtler.hovered" | "color.background.accent.magenta.subtler.pressed" | "color.background.accent.magenta.subtle" | "color.background.accent.magenta.subtle.hovered" | "color.background.accent.magenta.subtle.pressed" | "color.background.accent.magenta.bolder" | "color.background.accent.magenta.bolder.hovered" | "color.background.accent.magenta.bolder.pressed" | "color.background.accent.gray.subtlest" | "color.background.accent.gray.subtlest.hovered" | "color.background.accent.gray.subtlest.pressed" | "color.background.accent.gray.subtler" | "color.background.accent.gray.subtler.hovered" | "color.background.accent.gray.subtler.pressed" | "color.background.accent.gray.subtle" | "color.background.accent.gray.subtle.hovered" | "color.background.accent.gray.subtle.pressed" | "color.background.accent.gray.bolder" | "color.background.accent.gray.bolder.hovered" | "color.background.accent.gray.bolder.pressed" | "color.background.disabled" | "color.background.input" | "color.background.input.hovered" | "color.background.input.pressed" | "color.background.inverse.subtle" | "color.background.inverse.subtle.hovered" | "color.background.inverse.subtle.pressed" | "color.background.neutral" | "color.background.neutral.hovered" | "color.background.neutral.pressed" | "color.background.neutral.subtle" | "color.background.neutral.subtle.hovered" | "color.background.neutral.subtle.pressed" | "color.background.neutral.bold" | "color.background.neutral.bold.hovered" | "color.background.neutral.bold.pressed" | "color.background.selected" | "color.background.selected.hovered" | "color.background.selected.pressed" | "color.background.selected.bold" | "color.background.selected.bold.hovered" | "color.background.selected.bold.pressed" | "color.background.brand.subtlest" | "color.background.brand.subtlest.hovered" | "color.background.brand.subtlest.pressed" | "color.background.brand.bold" | "color.background.brand.bold.hovered" | "color.background.brand.bold.pressed" | "color.background.brand.boldest" | "color.background.brand.boldest.hovered" | "color.background.brand.boldest.pressed" | "color.background.danger" | "color.background.danger.hovered" | "color.background.danger.pressed" | "color.background.danger.bold" | "color.background.danger.bold.hovered" | "color.background.danger.bold.pressed" | "color.background.warning" | "color.background.warning.hovered" | "color.background.warning.pressed" | "color.background.warning.bold" | "color.background.warning.bold.hovered" | "color.background.warning.bold.pressed" | "color.background.success" | "color.background.success.hovered" | "color.background.success.pressed" | "color.background.success.bold" | "color.background.success.bold.hovered" | "color.background.success.bold.pressed" | "color.background.discovery" | "color.background.discovery.hovered" | "color.background.discovery.pressed" | "color.background.discovery.bold" | "color.background.discovery.bold.hovered" | "color.background.discovery.bold.pressed" | "color.background.information" | "color.background.information.hovered" | "color.background.information.pressed" | "color.background.information.bold" | "color.background.information.bold.hovered" | "color.background.information.bold.pressed" | "color.blanket" | "color.blanket.selected" | "color.blanket.danger" | "elevation.surface" | "elevation.surface.hovered" | "elevation.surface.pressed" | "elevation.surface.overlay" | "elevation.surface.overlay.hovered" | "elevation.surface.overlay.pressed" | "elevation.surface.raised" | "elevation.surface.raised.hovered" | "elevation.surface.raised.pressed" | "elevation.surface.sunken" | "utility.elevation.surface.current">;
7
+ export declare const SurfaceContext: import("react").Context<"color.blanket" | "color.blanket.selected" | "color.blanket.danger" | "elevation.surface" | "elevation.surface.overlay" | "elevation.surface.raised" | "elevation.surface.sunken" | "disabled" | "input" | "inverse.subtle" | "neutral" | "neutral.subtle" | "neutral.bold" | "selected" | "selected.bold" | "brand.subtlest" | "brand.bold" | "brand.boldest" | "danger" | "danger.bold" | "warning" | "warning.bold" | "success" | "success.bold" | "discovery" | "discovery.bold" | "information" | "information.bold">;
8
8
  /**
9
9
  * __useSurface__
10
10
  *
@@ -12,4 +12,4 @@ export declare const SurfaceContext: import("react").Context<"color.background.a
12
12
  *
13
13
  * @see SurfaceContext
14
14
  */
15
- export declare const useSurface: () => "color.background.accent.lime.subtlest" | "color.background.accent.lime.subtlest.hovered" | "color.background.accent.lime.subtlest.pressed" | "color.background.accent.lime.subtler" | "color.background.accent.lime.subtler.hovered" | "color.background.accent.lime.subtler.pressed" | "color.background.accent.lime.subtle" | "color.background.accent.lime.subtle.hovered" | "color.background.accent.lime.subtle.pressed" | "color.background.accent.lime.bolder" | "color.background.accent.lime.bolder.hovered" | "color.background.accent.lime.bolder.pressed" | "color.background.accent.red.subtlest" | "color.background.accent.red.subtlest.hovered" | "color.background.accent.red.subtlest.pressed" | "color.background.accent.red.subtler" | "color.background.accent.red.subtler.hovered" | "color.background.accent.red.subtler.pressed" | "color.background.accent.red.subtle" | "color.background.accent.red.subtle.hovered" | "color.background.accent.red.subtle.pressed" | "color.background.accent.red.bolder" | "color.background.accent.red.bolder.hovered" | "color.background.accent.red.bolder.pressed" | "color.background.accent.orange.subtlest" | "color.background.accent.orange.subtlest.hovered" | "color.background.accent.orange.subtlest.pressed" | "color.background.accent.orange.subtler" | "color.background.accent.orange.subtler.hovered" | "color.background.accent.orange.subtler.pressed" | "color.background.accent.orange.subtle" | "color.background.accent.orange.subtle.hovered" | "color.background.accent.orange.subtle.pressed" | "color.background.accent.orange.bolder" | "color.background.accent.orange.bolder.hovered" | "color.background.accent.orange.bolder.pressed" | "color.background.accent.yellow.subtlest" | "color.background.accent.yellow.subtlest.hovered" | "color.background.accent.yellow.subtlest.pressed" | "color.background.accent.yellow.subtler" | "color.background.accent.yellow.subtler.hovered" | "color.background.accent.yellow.subtler.pressed" | "color.background.accent.yellow.subtle" | "color.background.accent.yellow.subtle.hovered" | "color.background.accent.yellow.subtle.pressed" | "color.background.accent.yellow.bolder" | "color.background.accent.yellow.bolder.hovered" | "color.background.accent.yellow.bolder.pressed" | "color.background.accent.green.subtlest" | "color.background.accent.green.subtlest.hovered" | "color.background.accent.green.subtlest.pressed" | "color.background.accent.green.subtler" | "color.background.accent.green.subtler.hovered" | "color.background.accent.green.subtler.pressed" | "color.background.accent.green.subtle" | "color.background.accent.green.subtle.hovered" | "color.background.accent.green.subtle.pressed" | "color.background.accent.green.bolder" | "color.background.accent.green.bolder.hovered" | "color.background.accent.green.bolder.pressed" | "color.background.accent.teal.subtlest" | "color.background.accent.teal.subtlest.hovered" | "color.background.accent.teal.subtlest.pressed" | "color.background.accent.teal.subtler" | "color.background.accent.teal.subtler.hovered" | "color.background.accent.teal.subtler.pressed" | "color.background.accent.teal.subtle" | "color.background.accent.teal.subtle.hovered" | "color.background.accent.teal.subtle.pressed" | "color.background.accent.teal.bolder" | "color.background.accent.teal.bolder.hovered" | "color.background.accent.teal.bolder.pressed" | "color.background.accent.blue.subtlest" | "color.background.accent.blue.subtlest.hovered" | "color.background.accent.blue.subtlest.pressed" | "color.background.accent.blue.subtler" | "color.background.accent.blue.subtler.hovered" | "color.background.accent.blue.subtler.pressed" | "color.background.accent.blue.subtle" | "color.background.accent.blue.subtle.hovered" | "color.background.accent.blue.subtle.pressed" | "color.background.accent.blue.bolder" | "color.background.accent.blue.bolder.hovered" | "color.background.accent.blue.bolder.pressed" | "color.background.accent.purple.subtlest" | "color.background.accent.purple.subtlest.hovered" | "color.background.accent.purple.subtlest.pressed" | "color.background.accent.purple.subtler" | "color.background.accent.purple.subtler.hovered" | "color.background.accent.purple.subtler.pressed" | "color.background.accent.purple.subtle" | "color.background.accent.purple.subtle.hovered" | "color.background.accent.purple.subtle.pressed" | "color.background.accent.purple.bolder" | "color.background.accent.purple.bolder.hovered" | "color.background.accent.purple.bolder.pressed" | "color.background.accent.magenta.subtlest" | "color.background.accent.magenta.subtlest.hovered" | "color.background.accent.magenta.subtlest.pressed" | "color.background.accent.magenta.subtler" | "color.background.accent.magenta.subtler.hovered" | "color.background.accent.magenta.subtler.pressed" | "color.background.accent.magenta.subtle" | "color.background.accent.magenta.subtle.hovered" | "color.background.accent.magenta.subtle.pressed" | "color.background.accent.magenta.bolder" | "color.background.accent.magenta.bolder.hovered" | "color.background.accent.magenta.bolder.pressed" | "color.background.accent.gray.subtlest" | "color.background.accent.gray.subtlest.hovered" | "color.background.accent.gray.subtlest.pressed" | "color.background.accent.gray.subtler" | "color.background.accent.gray.subtler.hovered" | "color.background.accent.gray.subtler.pressed" | "color.background.accent.gray.subtle" | "color.background.accent.gray.subtle.hovered" | "color.background.accent.gray.subtle.pressed" | "color.background.accent.gray.bolder" | "color.background.accent.gray.bolder.hovered" | "color.background.accent.gray.bolder.pressed" | "color.background.disabled" | "color.background.input" | "color.background.input.hovered" | "color.background.input.pressed" | "color.background.inverse.subtle" | "color.background.inverse.subtle.hovered" | "color.background.inverse.subtle.pressed" | "color.background.neutral" | "color.background.neutral.hovered" | "color.background.neutral.pressed" | "color.background.neutral.subtle" | "color.background.neutral.subtle.hovered" | "color.background.neutral.subtle.pressed" | "color.background.neutral.bold" | "color.background.neutral.bold.hovered" | "color.background.neutral.bold.pressed" | "color.background.selected" | "color.background.selected.hovered" | "color.background.selected.pressed" | "color.background.selected.bold" | "color.background.selected.bold.hovered" | "color.background.selected.bold.pressed" | "color.background.brand.subtlest" | "color.background.brand.subtlest.hovered" | "color.background.brand.subtlest.pressed" | "color.background.brand.bold" | "color.background.brand.bold.hovered" | "color.background.brand.bold.pressed" | "color.background.brand.boldest" | "color.background.brand.boldest.hovered" | "color.background.brand.boldest.pressed" | "color.background.danger" | "color.background.danger.hovered" | "color.background.danger.pressed" | "color.background.danger.bold" | "color.background.danger.bold.hovered" | "color.background.danger.bold.pressed" | "color.background.warning" | "color.background.warning.hovered" | "color.background.warning.pressed" | "color.background.warning.bold" | "color.background.warning.bold.hovered" | "color.background.warning.bold.pressed" | "color.background.success" | "color.background.success.hovered" | "color.background.success.pressed" | "color.background.success.bold" | "color.background.success.bold.hovered" | "color.background.success.bold.pressed" | "color.background.discovery" | "color.background.discovery.hovered" | "color.background.discovery.pressed" | "color.background.discovery.bold" | "color.background.discovery.bold.hovered" | "color.background.discovery.bold.pressed" | "color.background.information" | "color.background.information.hovered" | "color.background.information.pressed" | "color.background.information.bold" | "color.background.information.bold.hovered" | "color.background.information.bold.pressed" | "color.blanket" | "color.blanket.selected" | "color.blanket.danger" | "elevation.surface" | "elevation.surface.hovered" | "elevation.surface.pressed" | "elevation.surface.overlay" | "elevation.surface.overlay.hovered" | "elevation.surface.overlay.pressed" | "elevation.surface.raised" | "elevation.surface.raised.hovered" | "elevation.surface.raised.pressed" | "elevation.surface.sunken" | "utility.elevation.surface.current";
15
+ export declare const useSurface: () => "color.blanket" | "color.blanket.selected" | "color.blanket.danger" | "elevation.surface" | "elevation.surface.overlay" | "elevation.surface.raised" | "elevation.surface.sunken" | "disabled" | "input" | "inverse.subtle" | "neutral" | "neutral.subtle" | "neutral.bold" | "selected" | "selected.bold" | "brand.subtlest" | "brand.bold" | "brand.boldest" | "danger" | "danger.bold" | "warning" | "warning.bold" | "success" | "success.bold" | "discovery" | "discovery.bold" | "information" | "information.bold";
@@ -1,3 +1,9 @@
1
+ export { default as UNSAFE_Box } from './components/box.partial';
1
2
  export { default as UNSAFE_Text } from './components/text.partial';
3
+ export { default as UNSAFE_Inline } from './components/inline.partial';
4
+ export { default as UNSAFE_Stack } from './components/stack.partial';
2
5
  export { default as UNSAFE_InteractionSurface } from './components/interaction-surface.partial';
6
+ export type { BoxProps as UNSAFE_BoxProps } from './components/box.partial';
3
7
  export type { TextProps as UNSAFE_TextProps } from './components/text.partial';
8
+ export type { InlineProps as UNSAFE_InlineProps } from './components/inline.partial';
9
+ export type { StackProps as UNSAFE_StackProps } from './components/stack.partial';
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+
3
+ import Box from '../src/components/box.partial';
4
+ import Text from '../src/components/text.partial';
5
+
6
+ export default () => {
7
+ return (
8
+ <Box>
9
+ <Box
10
+ paddingBlock="space.400"
11
+ paddingInline="space.400"
12
+ alignItems="center"
13
+ backgroundColor="brand.bold"
14
+ UNSAFE_style={{ aspectRatio: '1/1' }}
15
+ >
16
+ <Text fontWeight="medium" color="inverse">
17
+ A basic box
18
+ </Text>
19
+ </Box>
20
+ </Box>
21
+ );
22
+ };
@@ -0,0 +1,171 @@
1
+ import React from 'react';
2
+
3
+ import Heading from '@atlaskit/heading';
4
+ import Inline from '@atlaskit/primitives/inline';
5
+ import Stack from '@atlaskit/primitives/stack';
6
+
7
+ import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '../src';
8
+ import { spacingScale } from '../src/internal/spacing-scale';
9
+
10
+ /**
11
+ * Box permutations
12
+ */
13
+ export default () => {
14
+ return (
15
+ <Stack space="space.400" alignInline="start">
16
+ <Stack space="space.200" testId="box-with-background-and-paddingBlock">
17
+ <Heading level="h600">paddingBlock</Heading>
18
+ <Inline space="space.200" alignBlock="center">
19
+ {spacingScale.map((space) => (
20
+ <Box
21
+ key={space}
22
+ backgroundColor="discovery.bold"
23
+ paddingBlock={space}
24
+ >
25
+ <Box backgroundColor="elevation.surface" justifyContent="center">
26
+ <Text>{space}</Text>
27
+ </Box>
28
+ </Box>
29
+ ))}
30
+ </Inline>
31
+ </Stack>
32
+
33
+ <Stack space="space.200" testId="box-with-background-and-paddingInline">
34
+ <Heading level="h600">paddingInline</Heading>
35
+ <Stack space="space.200" alignInline="center">
36
+ {spacingScale.map((space) => (
37
+ <Box
38
+ key={space}
39
+ backgroundColor="discovery.bold"
40
+ paddingInline={space}
41
+ >
42
+ <Box backgroundColor="elevation.surface" justifyContent="center">
43
+ <Text>{space}</Text>
44
+ </Box>
45
+ </Box>
46
+ ))}
47
+ </Stack>
48
+ </Stack>
49
+
50
+ <Stack space="space.200" testId="box-with-background-and-padding">
51
+ <Heading level="h600">padding</Heading>
52
+ <Inline space="space.200" alignBlock="center">
53
+ {spacingScale.map((space) => (
54
+ <Box key={space} backgroundColor="discovery.bold" padding={space}>
55
+ <Box backgroundColor="elevation.surface" justifyContent="center">
56
+ <Text>{space}</Text>
57
+ </Box>
58
+ </Box>
59
+ ))}
60
+ </Inline>
61
+ </Stack>
62
+
63
+ <Stack space="space.200" testId="box-with-backgroundColor">
64
+ <Heading level="h600">backgroundColor</Heading>
65
+ <Inline space="space.200" alignBlock="center">
66
+ {(
67
+ [
68
+ 'discovery.bold',
69
+ 'success.bold',
70
+ 'warning.bold',
71
+ 'danger.bold',
72
+ 'information.bold',
73
+ 'brand.bold',
74
+ ] as const
75
+ ).map((bgColor) => (
76
+ <Box key={bgColor} backgroundColor={bgColor} padding="space.400">
77
+ <Box justifyContent="center">
78
+ <Text>{bgColor}</Text>
79
+ </Box>
80
+ </Box>
81
+ ))}
82
+ </Inline>
83
+ </Stack>
84
+
85
+ <Stack space="space.200" testId="box-with-borderColor">
86
+ <Heading level="h600">borderColor</Heading>
87
+ <Inline space="space.200" alignBlock="center">
88
+ {(
89
+ [
90
+ 'discovery',
91
+ 'success',
92
+ 'warning',
93
+ 'danger',
94
+ 'information',
95
+ 'brand',
96
+ ] as const
97
+ ).map((borderColor) => (
98
+ <Box
99
+ key={borderColor}
100
+ backgroundColor="neutral"
101
+ borderColor={borderColor}
102
+ borderStyle="solid"
103
+ borderWidth="2px"
104
+ padding="space.400"
105
+ >
106
+ <Box justifyContent="center">
107
+ <Text color="color.text">{borderColor}</Text>
108
+ </Box>
109
+ </Box>
110
+ ))}
111
+ </Inline>
112
+ </Stack>
113
+
114
+ <Stack space="space.200" testId="box-with-shadow">
115
+ <Heading level="h600">shadow</Heading>
116
+ <Inline space="space.200" alignBlock="center">
117
+ {(['raised', 'overflow', 'overlay'] as const).map((shadow) => (
118
+ <Box
119
+ key={shadow}
120
+ backgroundColor="elevation.surface"
121
+ shadow={shadow}
122
+ padding="space.400"
123
+ >
124
+ <Box justifyContent="center">
125
+ <Text color="color.text">{shadow}</Text>
126
+ </Box>
127
+ </Box>
128
+ ))}
129
+ </Inline>
130
+ </Stack>
131
+
132
+ <Stack space="space.200" testId="box-with-layer">
133
+ <Heading level="h600">layer</Heading>
134
+ <Box alignItems="center" UNSAFE_style={{ width: 800, height: 650 }}>
135
+ {(
136
+ [
137
+ 'card',
138
+ 'navigation',
139
+ 'dialog',
140
+ 'layer',
141
+ 'blanket',
142
+ 'modal',
143
+ 'flag',
144
+ 'spotlight',
145
+ 'tooltip',
146
+ ] as const
147
+ ).map((layer, index) => (
148
+ <Box
149
+ key={layer}
150
+ backgroundColor="elevation.surface"
151
+ layer={layer}
152
+ shadow="overlay"
153
+ padding="space.400"
154
+ position="absolute"
155
+ UNSAFE_style={{
156
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
157
+ top: index * 64,
158
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
159
+ left: index * 64,
160
+ }}
161
+ >
162
+ <Box justifyContent="center">
163
+ <Text color="color.text">{layer}</Text>
164
+ </Box>
165
+ </Box>
166
+ ))}
167
+ </Box>
168
+ </Stack>
169
+ </Stack>
170
+ );
171
+ };
@@ -1,28 +1,37 @@
1
1
  import React from 'react';
2
2
 
3
- import { Box, Inline, xcss } from '@atlaskit/primitives';
3
+ import Inline from '@atlaskit/primitives/inline';
4
4
 
5
+ import Box from '../src/components/box.partial';
5
6
  import Text from '../src/components/text.partial';
6
7
 
7
- const boxStyles = xcss({
8
- display: 'flex',
9
- paddingBlock: 'space.400',
10
- paddingInline: 'space.400',
11
- alignItems: 'center',
12
- });
13
-
14
8
  export default () => {
15
9
  return (
16
10
  <Inline space="space.100">
17
- <Box xcss={boxStyles} backgroundColor="color.background.information">
11
+ <Box
12
+ paddingBlock="space.400"
13
+ paddingInline="space.400"
14
+ alignItems="center"
15
+ backgroundColor="information"
16
+ >
18
17
  <Text>
19
18
  <Text>Text that deletes its redundant wrapping</Text>
20
19
  </Text>
21
20
  </Box>
22
- <Box xcss={boxStyles} backgroundColor="color.background.information">
21
+ <Box
22
+ paddingBlock="space.400"
23
+ paddingInline="space.400"
24
+ alignItems="center"
25
+ backgroundColor="information"
26
+ >
23
27
  <Text fontWeight="semibold">Text on information</Text>
24
28
  </Box>
25
- <Box xcss={boxStyles} backgroundColor="color.background.brand.bold">
29
+ <Box
30
+ paddingBlock="space.400"
31
+ paddingInline="space.400"
32
+ alignItems="center"
33
+ backgroundColor="brand.bold"
34
+ >
26
35
  <Text fontWeight="semibold">Text on brand bold</Text>
27
36
  </Box>
28
37
  </Inline>
@@ -1,15 +1,10 @@
1
1
  import React from 'react';
2
2
 
3
3
  import Heading from '@atlaskit/heading';
4
- import { Box, Inline, Stack, xcss } from '@atlaskit/primitives';
4
+ import Inline from '@atlaskit/primitives/inline';
5
+ import Stack from '@atlaskit/primitives/stack';
5
6
 
6
- import { UNSAFE_Text as Text } from '../src';
7
-
8
- const fixedWidthStyles = xcss({ display: 'flex', width: '200px' });
9
-
10
- const lineHeightContainerStyles = xcss({
11
- display: 'inline-flex',
12
- });
7
+ import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '../src';
13
8
 
14
9
  export default () => {
15
10
  return (
@@ -18,7 +13,7 @@ export default () => {
18
13
  Text examples
19
14
  </Heading>
20
15
  <Stack space="space.200">
21
- <Box>
16
+ <Box display="block">
22
17
  <Heading level="h300">Font size</Heading>
23
18
  <Inline space="space.200" testId="font-sizes">
24
19
  {(
@@ -39,7 +34,7 @@ export default () => {
39
34
  ))}
40
35
  </Inline>
41
36
  </Box>
42
- <Box>
37
+ <Box display="block">
43
38
  <Heading level="h300" as="h4">
44
39
  Font weight
45
40
  </Heading>
@@ -53,7 +48,7 @@ export default () => {
53
48
  )}
54
49
  </Inline>
55
50
  </Box>
56
- <Box>
51
+ <Box display="block">
57
52
  <Heading level="h300" as="h4">
58
53
  Line height
59
54
  </Heading>
@@ -70,15 +65,15 @@ export default () => {
70
65
  ).map((lineHeight) => (
71
66
  <Box
72
67
  key={lineHeight}
73
- xcss={lineHeightContainerStyles}
74
- backgroundColor="color.background.neutral"
68
+ display="inlineFlex"
69
+ backgroundColor="neutral"
75
70
  >
76
71
  <Text lineHeight={lineHeight}>lineHeight {lineHeight}</Text>
77
72
  </Box>
78
73
  ))}
79
74
  </Inline>
80
75
  </Box>
81
- <Box>
76
+ <Box display="block">
82
77
  <Heading level="h300" as="h4">
83
78
  Testing
84
79
  </Heading>
@@ -97,7 +92,7 @@ export default () => {
97
92
  >
98
93
  Text with various props
99
94
  </Text>
100
- <Box xcss={fixedWidthStyles}>
95
+ <Box UNSAFE_style={{ width: '200px' }}>
101
96
  <Text shouldTruncate>Long truncated text that is cut off.</Text>
102
97
  </Box>
103
98
  </Stack>