@atlaskit/primitives 0.9.2 → 0.9.3

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 0.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+ - [`e06d56c5a3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e06d56c5a3d) - Adds type hinting for `fill` CSS property.
9
+
3
10
  ## 0.9.2
4
11
 
5
12
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.textColorMap = exports.spaceStylesMap = exports.spaceMap = exports.shadowMap = exports.positionMap = exports.paddingStylesMap = exports.overflowMap = exports.overflowInlineMap = exports.overflowBlockMap = exports.layerMap = exports.flexShrinkMap = exports.flexMap = exports.flexGrowMap = exports.flexDirectionMap = exports.displayMap = exports.dimensionMap = exports.borderWidthMap = exports.borderStyleMap = exports.borderRadiusMap = exports.borderColorMap = exports.backgroundColorStylesMap = exports.backgroundColorMap = exports.alignSelfMap = void 0;
7
+ exports.textColorMap = exports.spaceStylesMap = exports.spaceMap = exports.shadowMap = exports.positionMap = exports.paddingStylesMap = exports.overflowMap = exports.overflowInlineMap = exports.overflowBlockMap = exports.layerMap = exports.flexShrinkMap = exports.flexMap = exports.flexGrowMap = exports.flexDirectionMap = exports.fillMap = exports.displayMap = exports.dimensionMap = exports.borderWidthMap = exports.borderStyleMap = exports.borderRadiusMap = exports.borderColorMap = exports.backgroundColorStylesMap = exports.backgroundColorMap = exports.alignSelfMap = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
10
  /**
@@ -60,10 +60,10 @@ exports.spaceMap = spaceMap;
60
60
 
61
61
  /**
62
62
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
63
- * @codegen <<SignedSource::4da498214befc7e312ff00d4f9f5379f>>
63
+ * @codegen <<SignedSource::aa1cfa3cd24f141a85ac1e0b70dbd8a8>>
64
64
  * @codegenId colors
65
65
  * @codegenCommand yarn codegen-styles
66
- * @codegenParams ["border", "background", "shadow", "text"]
66
+ * @codegenParams ["border", "background", "shadow", "text", "fill"]
67
67
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
68
68
  */
69
69
  var borderColorMap = {
@@ -240,6 +240,30 @@ var textColorMap = {
240
240
  subtle: "var(--ds-text-subtle, #42526E)"
241
241
  };
242
242
  exports.textColorMap = textColorMap;
243
+ var fillMap = {
244
+ 'color.icon': "var(--ds-icon, #505F79)",
245
+ 'accent.red': "var(--ds-icon-accent-red, #FF5630)",
246
+ 'accent.orange': "var(--ds-icon-accent-orange, #D94008)",
247
+ 'accent.yellow': "var(--ds-icon-accent-yellow, #FFAB00)",
248
+ 'accent.green': "var(--ds-icon-accent-green, #36B37E)",
249
+ 'accent.teal': "var(--ds-icon-accent-teal, #00B8D9)",
250
+ 'accent.blue': "var(--ds-icon-accent-blue, #0065FF)",
251
+ 'accent.purple': "var(--ds-icon-accent-purple, #6554C0)",
252
+ 'accent.magenta': "var(--ds-icon-accent-magenta, #CD519D)",
253
+ 'accent.gray': "var(--ds-icon-accent-gray, #5E6C84)",
254
+ disabled: "var(--ds-icon-disabled, #8993A4)",
255
+ inverse: "var(--ds-icon-inverse, #FFFFFF)",
256
+ selected: "var(--ds-icon-selected, #0052CC)",
257
+ brand: "var(--ds-icon-brand, #0065FF)",
258
+ danger: "var(--ds-icon-danger, #DE350B)",
259
+ warning: "var(--ds-icon-warning, #FFC400)",
260
+ 'warning.inverse': "var(--ds-icon-warning-inverse, #253858)",
261
+ success: "var(--ds-icon-success, #00875A)",
262
+ discovery: "var(--ds-icon-discovery, #8777D9)",
263
+ information: "var(--ds-icon-information, #0747A6)",
264
+ subtle: "var(--ds-icon-subtle, #6B778C)"
265
+ };
266
+ exports.fillMap = fillMap;
243
267
  /**
244
268
  * @codegenEnd
245
269
  */
@@ -27,6 +27,7 @@ var tokensMap = {
27
27
  color: _styleMaps.textColorMap,
28
28
  columnGap: _styleMaps.spaceMap,
29
29
  display: _styleMaps.displayMap,
30
+ fill: _styleMaps.fillMap,
30
31
  flex: _styleMaps.flexMap,
31
32
  flexDirection: _styleMaps.flexDirectionMap,
32
33
  flexGrow: _styleMaps.flexGrowMap,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "sideEffects": false
5
5
  }
@@ -48,10 +48,10 @@ export const spaceMap = {
48
48
  */
49
49
  /**
50
50
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
51
- * @codegen <<SignedSource::4da498214befc7e312ff00d4f9f5379f>>
51
+ * @codegen <<SignedSource::aa1cfa3cd24f141a85ac1e0b70dbd8a8>>
52
52
  * @codegenId colors
53
53
  * @codegenCommand yarn codegen-styles
54
- * @codegenParams ["border", "background", "shadow", "text"]
54
+ * @codegenParams ["border", "background", "shadow", "text", "fill"]
55
55
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
56
56
  */
57
57
  export const borderColorMap = {
@@ -224,6 +224,29 @@ export const textColorMap = {
224
224
  subtlest: "var(--ds-text-subtlest, #7A869A)",
225
225
  subtle: "var(--ds-text-subtle, #42526E)"
226
226
  };
227
+ export const fillMap = {
228
+ 'color.icon': "var(--ds-icon, #505F79)",
229
+ 'accent.red': "var(--ds-icon-accent-red, #FF5630)",
230
+ 'accent.orange': "var(--ds-icon-accent-orange, #D94008)",
231
+ 'accent.yellow': "var(--ds-icon-accent-yellow, #FFAB00)",
232
+ 'accent.green': "var(--ds-icon-accent-green, #36B37E)",
233
+ 'accent.teal': "var(--ds-icon-accent-teal, #00B8D9)",
234
+ 'accent.blue': "var(--ds-icon-accent-blue, #0065FF)",
235
+ 'accent.purple': "var(--ds-icon-accent-purple, #6554C0)",
236
+ 'accent.magenta': "var(--ds-icon-accent-magenta, #CD519D)",
237
+ 'accent.gray': "var(--ds-icon-accent-gray, #5E6C84)",
238
+ disabled: "var(--ds-icon-disabled, #8993A4)",
239
+ inverse: "var(--ds-icon-inverse, #FFFFFF)",
240
+ selected: "var(--ds-icon-selected, #0052CC)",
241
+ brand: "var(--ds-icon-brand, #0065FF)",
242
+ danger: "var(--ds-icon-danger, #DE350B)",
243
+ warning: "var(--ds-icon-warning, #FFC400)",
244
+ 'warning.inverse': "var(--ds-icon-warning-inverse, #253858)",
245
+ success: "var(--ds-icon-success, #00875A)",
246
+ discovery: "var(--ds-icon-discovery, #8777D9)",
247
+ information: "var(--ds-icon-information, #0747A6)",
248
+ subtle: "var(--ds-icon-subtle, #6B778C)"
249
+ };
227
250
  /**
228
251
  * @codegenEnd
229
252
  */
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
2
  import { css as cssEmotion } from '@emotion/react';
3
3
  import warnOnce from '@atlaskit/ds-lib/warn-once';
4
- import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
4
+ import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, fillMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
5
5
  const tokensMap = {
6
6
  alignSelf: alignSelfMap,
7
7
  backgroundColor: backgroundColorMap,
@@ -15,6 +15,7 @@ const tokensMap = {
15
15
  color: textColorMap,
16
16
  columnGap: spaceMap,
17
17
  display: displayMap,
18
+ fill: fillMap,
18
19
  flex: flexMap,
19
20
  flexDirection: flexDirectionMap,
20
21
  flexGrow: flexGrowMap,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "sideEffects": false
5
5
  }
@@ -49,10 +49,10 @@ export var spaceMap = {
49
49
  */
50
50
  /**
51
51
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
52
- * @codegen <<SignedSource::4da498214befc7e312ff00d4f9f5379f>>
52
+ * @codegen <<SignedSource::aa1cfa3cd24f141a85ac1e0b70dbd8a8>>
53
53
  * @codegenId colors
54
54
  * @codegenCommand yarn codegen-styles
55
- * @codegenParams ["border", "background", "shadow", "text"]
55
+ * @codegenParams ["border", "background", "shadow", "text", "fill"]
56
56
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
57
57
  */
58
58
  export var borderColorMap = {
@@ -225,6 +225,29 @@ export var textColorMap = {
225
225
  subtlest: "var(--ds-text-subtlest, #7A869A)",
226
226
  subtle: "var(--ds-text-subtle, #42526E)"
227
227
  };
228
+ export var fillMap = {
229
+ 'color.icon': "var(--ds-icon, #505F79)",
230
+ 'accent.red': "var(--ds-icon-accent-red, #FF5630)",
231
+ 'accent.orange': "var(--ds-icon-accent-orange, #D94008)",
232
+ 'accent.yellow': "var(--ds-icon-accent-yellow, #FFAB00)",
233
+ 'accent.green': "var(--ds-icon-accent-green, #36B37E)",
234
+ 'accent.teal': "var(--ds-icon-accent-teal, #00B8D9)",
235
+ 'accent.blue': "var(--ds-icon-accent-blue, #0065FF)",
236
+ 'accent.purple': "var(--ds-icon-accent-purple, #6554C0)",
237
+ 'accent.magenta': "var(--ds-icon-accent-magenta, #CD519D)",
238
+ 'accent.gray': "var(--ds-icon-accent-gray, #5E6C84)",
239
+ disabled: "var(--ds-icon-disabled, #8993A4)",
240
+ inverse: "var(--ds-icon-inverse, #FFFFFF)",
241
+ selected: "var(--ds-icon-selected, #0052CC)",
242
+ brand: "var(--ds-icon-brand, #0065FF)",
243
+ danger: "var(--ds-icon-danger, #DE350B)",
244
+ warning: "var(--ds-icon-warning, #FFC400)",
245
+ 'warning.inverse': "var(--ds-icon-warning-inverse, #253858)",
246
+ success: "var(--ds-icon-success, #00875A)",
247
+ discovery: "var(--ds-icon-discovery, #8777D9)",
248
+ information: "var(--ds-icon-information, #0747A6)",
249
+ subtle: "var(--ds-icon-subtle, #6B778C)"
250
+ };
228
251
  /**
229
252
  * @codegenEnd
230
253
  */
@@ -4,7 +4,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
4
4
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
5
5
  import { css as cssEmotion } from '@emotion/react';
6
6
  import warnOnce from '@atlaskit/ds-lib/warn-once';
7
- import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
7
+ import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, fillMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
8
8
  var tokensMap = {
9
9
  alignSelf: alignSelfMap,
10
10
  backgroundColor: backgroundColorMap,
@@ -18,6 +18,7 @@ var tokensMap = {
18
18
  color: textColorMap,
19
19
  columnGap: spaceMap,
20
20
  display: displayMap,
21
+ fill: fillMap,
21
22
  flex: flexMap,
22
23
  flexDirection: flexDirectionMap,
23
24
  flexGrow: flexGrowMap,
@@ -66,10 +66,10 @@ export type Space = keyof typeof spaceMap;
66
66
  */
67
67
  /**
68
68
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
69
- * @codegen <<SignedSource::4da498214befc7e312ff00d4f9f5379f>>
69
+ * @codegen <<SignedSource::aa1cfa3cd24f141a85ac1e0b70dbd8a8>>
70
70
  * @codegenId colors
71
71
  * @codegenCommand yarn codegen-styles
72
- * @codegenParams ["border", "background", "shadow", "text"]
72
+ * @codegenParams ["border", "background", "shadow", "text", "fill"]
73
73
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
74
74
  */
75
75
  export declare const borderColorMap: {
@@ -246,6 +246,30 @@ export declare const textColorMap: {
246
246
  readonly subtle: "var(--ds-text-subtle)";
247
247
  };
248
248
  export type TextColor = keyof typeof textColorMap;
249
+ export declare const fillMap: {
250
+ readonly 'color.icon': "var(--ds-icon)";
251
+ readonly 'accent.red': "var(--ds-icon-accent-red)";
252
+ readonly 'accent.orange': "var(--ds-icon-accent-orange)";
253
+ readonly 'accent.yellow': "var(--ds-icon-accent-yellow)";
254
+ readonly 'accent.green': "var(--ds-icon-accent-green)";
255
+ readonly 'accent.teal': "var(--ds-icon-accent-teal)";
256
+ readonly 'accent.blue': "var(--ds-icon-accent-blue)";
257
+ readonly 'accent.purple': "var(--ds-icon-accent-purple)";
258
+ readonly 'accent.magenta': "var(--ds-icon-accent-magenta)";
259
+ readonly 'accent.gray': "var(--ds-icon-accent-gray)";
260
+ readonly disabled: "var(--ds-icon-disabled)";
261
+ readonly inverse: "var(--ds-icon-inverse)";
262
+ readonly selected: "var(--ds-icon-selected)";
263
+ readonly brand: "var(--ds-icon-brand)";
264
+ readonly danger: "var(--ds-icon-danger)";
265
+ readonly warning: "var(--ds-icon-warning)";
266
+ readonly 'warning.inverse': "var(--ds-icon-warning-inverse)";
267
+ readonly success: "var(--ds-icon-success)";
268
+ readonly discovery: "var(--ds-icon-discovery)";
269
+ readonly information: "var(--ds-icon-information)";
270
+ readonly subtle: "var(--ds-icon-subtle)";
271
+ };
272
+ export type Fill = keyof typeof fillMap;
249
273
  /**
250
274
  * @codegenEnd
251
275
  */
@@ -383,6 +407,7 @@ export type TokenisedProps = {
383
407
  color?: TextColor;
384
408
  columnGap?: Space;
385
409
  display?: Display;
410
+ fill?: Fill;
386
411
  flex?: Flex;
387
412
  flexDirection?: FlexDirection;
388
413
  flexGrow?: FlexGrow;
@@ -0,0 +1,18 @@
1
+ /** @jsx jsx */
2
+ import { ElementType, FC, ReactElement } from 'react';
3
+ import { BaseBoxProps } from './internal/base-box';
4
+ import type { PublicBoxPropsBase } from './types';
5
+ export type BoxProps<T extends ElementType = 'div'> = Omit<BaseBoxProps<T>, 'className'> & PublicBoxPropsBase;
6
+ type BoxComponent<T extends ElementType = 'div'> = (<T extends ElementType = 'div'>(props: BoxProps<T>) => ReactElement | null) & FC<BoxProps<T>>;
7
+ /**
8
+ * __Box__
9
+ *
10
+ * A Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
11
+ * Renders a `div` by default.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/primitives/box/examples)
14
+ * - [Code](https://atlassian.design/components/primitives/box/code)
15
+ * - [Usage](https://atlassian.design/components/primitives/box/usage)
16
+ */
17
+ declare const Box: BoxComponent;
18
+ export default Box;
@@ -0,0 +1,75 @@
1
+ /** @jsx jsx */
2
+ import { ElementType, ReactNode } from 'react';
3
+ import { type Space } from '../xcss/style-maps.partial';
4
+ export interface InlineProps<T extends ElementType = 'div'> {
5
+ /**
6
+ * The DOM element to render as the Inline. Defaults to `div`.
7
+ */
8
+ as?: 'div' | 'span' | 'ul' | 'ol';
9
+ /**
10
+ * Used to align children along the main axis.
11
+ */
12
+ alignBlock?: AlignBlock;
13
+ /**
14
+ * Used to align children along the cross axis.
15
+ */
16
+ alignInline?: AlignInline;
17
+ /**
18
+ * Used to set whether children are forced onto one line or will wrap onto multiple lines.
19
+ */
20
+ shouldWrap?: boolean;
21
+ /**
22
+ * Used to distribute the children along the main axis.
23
+ */
24
+ spread?: Spread;
25
+ /**
26
+ * Used to set whether the container should grow to fill the available space.
27
+ */
28
+ grow?: Grow;
29
+ /**
30
+ * Represents the space between each child.
31
+ */
32
+ space?: Space;
33
+ /**
34
+ * Represents the space between rows when content wraps.
35
+ * Used to override the `space` value in between rows.
36
+ */
37
+ rowSpace?: Space;
38
+ /**
39
+ * Renders a separator string between each child.
40
+ */
41
+ separator?: string;
42
+ /**
43
+ * A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
44
+ */
45
+ testId?: string;
46
+ /**
47
+ * Elements to be rendered inside the Inline.
48
+ */
49
+ children: ReactNode;
50
+ /**
51
+ * Forwarded ref element
52
+ */
53
+ ref?: React.ComponentPropsWithRef<T>['ref'];
54
+ }
55
+ export type AlignInline = 'start' | 'center' | 'end';
56
+ export type AlignBlock = 'start' | 'center' | 'end' | 'baseline';
57
+ export type Spread = 'space-between';
58
+ export type Grow = 'hug' | 'fill';
59
+ /**
60
+ * __Inline__
61
+ *
62
+ * Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
63
+ *
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <Inline>
68
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
69
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
70
+ * </Inline>
71
+ * ```
72
+ *
73
+ */
74
+ declare const Inline: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<InlineProps<ElementType<any>>, "as" | "children" | "testId" | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "space" | "rowSpace" | "separator"> & import("react").RefAttributes<any>>>;
75
+ export default Inline;
@@ -0,0 +1,84 @@
1
+ /** @jsx jsx */
2
+ import { ComponentPropsWithoutRef, ElementType, FC, ReactElement, ReactNode } from 'react';
3
+ import { BackgroundColor, type Space } from '../../xcss/style-maps.partial';
4
+ import type { BasePrimitiveProps } from '../types';
5
+ export type BaseBoxProps<T extends ElementType = 'div'> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className'> & BasePrimitiveProps & BaseBoxPropsFoundation<T>;
6
+ export type As = 'article' | 'aside' | 'dialog' | 'div' | 'footer' | 'header' | 'li' | 'main' | 'nav' | 'ol' | 'section' | 'span' | 'ul';
7
+ type BaseBoxPropsFoundation<T extends ElementType = 'div'> = {
8
+ /**
9
+ * The DOM element to render as the Box. Defaults to `div`.
10
+ */
11
+ as?: As;
12
+ /**
13
+ * The HTML className attribute.
14
+ *
15
+ * Before using this prop please ensure:
16
+ * - The styles cannot otherwise be achieved through `Box` directly.
17
+ * - The use case needs custom styles that cannot be designed or implemented differently
18
+ *
19
+ * Ensure you're using the `@atlaskit/eslint-plugin-design-system` with this prop to prevent unbounded usage.
20
+ *
21
+ * @see `@atlaskit/eslint-plugin-design-system`
22
+ */
23
+ className?: string;
24
+ /**
25
+ * Elements to be rendered inside the Box.
26
+ */
27
+ children?: ReactNode;
28
+ /**
29
+ * Token representing background color with a built-in fallback value.
30
+ */
31
+ backgroundColor?: BackgroundColor;
32
+ /**
33
+ * Tokens representing CSS shorthand for `paddingBlock` and `paddingInline` together.
34
+ *
35
+ * @see paddingBlock
36
+ * @see paddingInline
37
+ */
38
+ padding?: Space;
39
+ /**
40
+ * Tokens representing CSS shorthand `paddingBlock`.
41
+ *
42
+ * @see paddingBlockStart
43
+ * @see paddingBlockEnd
44
+ */
45
+ paddingBlock?: Space;
46
+ /**
47
+ * Tokens representing CSS `paddingBlockStart`.
48
+ */
49
+ paddingBlockStart?: Space;
50
+ /**
51
+ * Tokens representing CSS `paddingBlockEnd`.
52
+ */
53
+ paddingBlockEnd?: Space;
54
+ /**
55
+ * Tokens representing CSS shorthand `paddingInline`.
56
+ *
57
+ * @see paddingInlineStart
58
+ * @see paddingInlineEnd
59
+ */
60
+ paddingInline?: Space;
61
+ /**
62
+ * Tokens representing CSS `paddingInlineStart`.
63
+ */
64
+ paddingInlineStart?: Space;
65
+ /**
66
+ * Tokens representing CSS `paddingInlineEnd`.
67
+ */
68
+ paddingInlineEnd?: Space;
69
+ /**
70
+ * Forwarded ref element
71
+ */
72
+ ref?: React.ComponentPropsWithRef<T>['ref'];
73
+ };
74
+ export type BaseBoxComponent<T extends ElementType = 'div'> = (<T extends ElementType = 'div'>(props: BaseBoxProps<T>) => ReactElement | null) & FC<BaseBoxProps<T>>;
75
+ /**
76
+ * __Box__
77
+ *
78
+ * Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
79
+ * Renders a `div` by default.
80
+ *
81
+ * @internal
82
+ */
83
+ export declare const BaseBox: BaseBoxComponent;
84
+ export default BaseBox;
@@ -0,0 +1,61 @@
1
+ /** @jsx jsx */
2
+ import { ElementType, ReactNode } from 'react';
3
+ import { type Space } from '../xcss/style-maps.partial';
4
+ export interface StackProps<T extends ElementType = 'div'> {
5
+ /**
6
+ * The DOM element to render as the Stack. Defaults to `div`.
7
+ */
8
+ as?: 'div' | 'span' | 'ul' | 'ol';
9
+ /**
10
+ * Used to align children along the main axis.
11
+ */
12
+ alignBlock?: AlignBlock;
13
+ /**
14
+ * Used to align children along the cross axis.
15
+ */
16
+ alignInline?: AlignInline;
17
+ /**
18
+ * Used to distribute the children along the main axis.
19
+ */
20
+ spread?: Spread;
21
+ /**
22
+ * Used to set whether the container should grow to fill the available space.
23
+ */
24
+ grow?: Grow;
25
+ /**
26
+ * Represents the space between each child.
27
+ */
28
+ space?: Space;
29
+ /**
30
+ * A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
31
+ */
32
+ testId?: string;
33
+ /**
34
+ * Elements to be rendered inside the Stack.
35
+ */
36
+ children: ReactNode;
37
+ /**
38
+ * Forwarded ref element
39
+ */
40
+ ref?: React.ComponentPropsWithRef<T>['ref'];
41
+ }
42
+ export type AlignInline = 'start' | 'center' | 'end';
43
+ export type AlignBlock = 'start' | 'center' | 'end';
44
+ export type Spread = 'space-between';
45
+ export type Grow = 'hug' | 'fill';
46
+ /**
47
+ * __Stack__
48
+ *
49
+ * Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <Stack>
54
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
55
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
56
+ * </Stack>
57
+ * ```
58
+ *
59
+ */
60
+ declare const Stack: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<StackProps<ElementType<any>>, "as" | "children" | "testId" | "alignInline" | "alignBlock" | "spread" | "grow" | "space"> & import("react").RefAttributes<any>>>;
61
+ export default Stack;
@@ -0,0 +1,18 @@
1
+ import type { CSSProperties } from 'react';
2
+ import { type BoxXCSS } from '../xcss/xcss';
3
+ export type BasePrimitiveProps = {
4
+ /**
5
+ * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
6
+ */
7
+ testId?: string;
8
+ /**
9
+ * Inline styles to be applied to the primitive.
10
+ */
11
+ style?: CSSProperties;
12
+ };
13
+ export type PublicBoxPropsBase = {
14
+ /**
15
+ * Safe subset of styles that can be applied as a classname.
16
+ */
17
+ xcss?: BoxXCSS | Array<BoxXCSS | false | undefined>;
18
+ };
@@ -0,0 +1,12 @@
1
+ export declare const LAYERS: {
2
+ readonly card: 100;
3
+ readonly navigation: 200;
4
+ readonly dialog: 300;
5
+ readonly layer: 400;
6
+ readonly blanket: 500;
7
+ readonly modal: 510;
8
+ readonly flag: 600;
9
+ readonly spotlight: 700;
10
+ readonly tooltip: 800;
11
+ };
12
+ export type Layer = keyof typeof LAYERS;
@@ -0,0 +1,57 @@
1
+ import { CSSObject } from '@emotion/react';
2
+ import { SMALLEST_BREAKPOINT } from './constants';
3
+ import type { Breakpoint } from './types';
4
+ /**
5
+ * Build a map of breakpoints to css with media queries and nested styles.
6
+ *
7
+ * @experimental Unsafe for usage as the API is not finalized.
8
+ *
9
+ * @example
10
+ * A map to build optional `display:none` for consumption on a div.
11
+ * ```ts
12
+ * const hideMediaQueries = buildAboveMediaQueryCSS({ display: 'none' });
13
+ *
14
+ * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
15
+ * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
16
+ * }
17
+ * ```
18
+ *
19
+ * This roughly builds a map that will look roughly like this (if done manually):
20
+ * ```ts
21
+ * {
22
+ * xxs: css({ '@media (min-width: 0px)': { display: 'none' } }),
23
+ * xs: css({ '@media (min-width: …px)': { display: 'none' } }),
24
+ * sm: css({ '@media (min-width: …px)': { display: 'none' } }),
25
+ * }
26
+ * ```
27
+ */
28
+ export declare const UNSAFE_buildAboveMediaQueryCSS: (input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, import("@emotion/react").SerializedStyles>>>;
29
+ /**
30
+ * Build a map of breakpoints to css with media queries and nested styles.
31
+ *
32
+ * WARNING: The smallest breakpoint is not a valid key as a media query below 0px is misleading.
33
+ * This is separated from `buildAboveMediaQueryCSS` for that specific reason, you cannot have type safety with this variance.
34
+ *
35
+ * @experimental Unsafe for usage as the API is not finalized.
36
+ *
37
+ * @example
38
+ * A map to build optional `display:none` for consumption on a div.
39
+ * ```ts
40
+ * const hideMediaQueries = buildBelowMediaQueryCSS({ display: 'none' });
41
+ *
42
+ * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
43
+ * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
44
+ * }
45
+ * ```
46
+ *
47
+ * This roughly builds a map that will look roughly like this (if done manually):
48
+ * ```ts
49
+ * {
50
+ * xs: css({ '@media (max-width: …px)': { display: 'none' } }),
51
+ * sm: css({ '@media (max-width: …px)': { display: 'none' } }),
52
+ * }
53
+ * ```
54
+ *
55
+ * @experimental Unsafe for usage as the API is not finalized.
56
+ */
57
+ export declare const UNSAFE_buildBelowMediaQueryCSS: (input: CSSObject | ((breakpoint: Exclude<Breakpoint, typeof SMALLEST_BREAKPOINT>) => CSSObject)) => Required<Omit<Partial<Record<Breakpoint, import("@emotion/react").SerializedStyles>>, "xxs">>;
@@ -0,0 +1,31 @@
1
+ import type { Breakpoint, BreakpointConfig } from './types';
2
+ /**
3
+ * Our internal configuration for breakpoints configuration.
4
+ *
5
+ * @experimental Unsafe for consumption outside of the design system itself.
6
+ */
7
+ export declare const UNSAFE_BREAKPOINTS_CONFIG: Record<Breakpoint, BreakpointConfig>;
8
+ /**
9
+ * The list of breakpoints in order from smallest to largest. You may need to clone and reverse this list if you want the opposite.
10
+ *
11
+ * This is intentional for cascading with `min-width` or `media.above`. Media queries go from lowest width to highest.
12
+ *
13
+ * @experimental Unsafe for consumption outside of the design system itself.
14
+ */
15
+ export declare const UNSAFE_BREAKPOINTS_ORDERED_LIST: [
16
+ "xxs",
17
+ "xs",
18
+ "sm",
19
+ "md",
20
+ "lg",
21
+ "xl",
22
+ "xxl"
23
+ ];
24
+ /**
25
+ * This is our smallest breakpoint with a few nuances to it:
26
+ * 1. It is the default value for shorthands, eg. `<GridItem span={6} />` maps to `{ [SMALLEST_BREAKPOINT]: props.span }`
27
+ * 2. It's omitted in `media.below` as there's nothing below `0px`.
28
+ *
29
+ * @experimental There's a chance this will change in _value_, but should only be used in a way that it will not matter if this value changes.
30
+ */
31
+ export declare const SMALLEST_BREAKPOINT: "xxs";
@@ -0,0 +1,4 @@
1
+ export { UNSAFE_media } from './media-helper';
2
+ export { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS, } from './build-media-query-css';
3
+ export { UNSAFE_BREAKPOINTS_ORDERED_LIST, UNSAFE_BREAKPOINTS_CONFIG, } from './constants';
4
+ export type { Breakpoint, ResponsiveObject, ResponsiveCSSObject, } from './types';