@atlaskit/primitives 1.2.1 → 1.2.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,17 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 1.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`dfd014c15b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dfd014c15b3) - [ux] Pressable primitive: Adds missing cursor style `not-allowed` for disabled buttons
8
+
9
+ ## 1.2.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`9a3fd8455fb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a3fd8455fb) - Stack `alignBlock` prop now accepts `'stretch'` which is also the default value for the `alignBlock` prop.
14
+
3
15
  ## 1.2.1
4
16
 
5
17
  ### Patch Changes
@@ -7,7 +7,6 @@ exports.default = void 0;
7
7
  var _react = require("react");
8
8
  var _react2 = require("@emotion/react");
9
9
  var _xcss = require("../xcss/xcss");
10
- /* eslint-disable @atlaskit/design-system/use-primitives */
11
10
  /**
12
11
  * @jsxRuntime classic
13
12
  * @jsx jsx
@@ -15,10 +15,6 @@ var _box = _interopRequireDefault(require("./box"));
15
15
  var _excluded = ["children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "isDisabled", "type", "testId", "xcss"];
16
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- var defaultStyles = (0, _xcss.xcss)({
19
- cursor: 'pointer'
20
- });
21
-
22
18
  // TODO: Duplicated FocusRing styles due to lack of `xcss` support
23
19
  // and to prevent additional dependency
24
20
  var baseFocusRingStyles = {
@@ -67,9 +63,12 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
67
63
  xcssStyles = _ref.xcss,
68
64
  htmlAttributes = (0, _objectWithoutProperties2.default)(_ref, _excluded);
69
65
  // Combine default styles with supplied styles. XCSS does not support deep nested arrays
70
- var styles = [defaultStyles, focusRingStyles];
66
+ var styles = [(0, _xcss.xcss)({
67
+ cursor: isDisabled ? 'not-allowed' : 'pointer'
68
+ }), focusRingStyles];
71
69
  styles = Array.isArray(xcssStyles) ? [].concat((0, _toConsumableArray2.default)(styles), (0, _toConsumableArray2.default)(xcssStyles)) : [].concat((0, _toConsumableArray2.default)(styles), [xcssStyles]);
72
70
  return /*#__PURE__*/_react.default.createElement(_box.default, (0, _extends2.default)({}, htmlAttributes, {
71
+ as: "button",
73
72
  ref: ref,
74
73
  testId: testId,
75
74
  type: type,
@@ -80,8 +79,7 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
80
79
  paddingBlockEnd: paddingBlockEnd,
81
80
  paddingInline: paddingInline,
82
81
  paddingInlineStart: paddingInlineStart,
83
- paddingInlineEnd: paddingInlineEnd,
84
- as: "button"
82
+ paddingInlineEnd: paddingInlineEnd
85
83
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
86
84
  ,
87
85
  xcss: styles,
@@ -40,7 +40,8 @@ var flexGrowMap = {
40
40
  var Stack = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
41
41
  var as = _ref.as,
42
42
  alignItems = _ref.alignInline,
43
- alignBlock = _ref.alignBlock,
43
+ _ref$alignBlock = _ref.alignBlock,
44
+ alignBlock = _ref$alignBlock === void 0 ? 'stretch' : _ref$alignBlock,
44
45
  spread = _ref.spread,
45
46
  grow = _ref.grow,
46
47
  space = _ref.space,
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _react = require("@emotion/react");
10
10
  var _constants = require("./constants");
11
11
  var _mediaHelper = require("./media-helper");
12
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  /**
15
15
  * Build a map of breakpoints to css with media queries and nested styles.
16
16
  *
@@ -60,11 +60,11 @@ 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::0de38f66a11617229ed4985ae2051e3e>>
63
+ * @codegen <<SignedSource::4a24a8ef38d5bf0a2803ceff3c393915>>
64
64
  * @codegenId colors
65
65
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
66
66
  * @codegenParams ["border", "background", "shadow", "text", "fill"]
67
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::d09e7cd13e24113267155813747b3bd4>>
67
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::65311fc2a6a35bb34b99c859362ac840>>
68
68
  */
69
69
  var borderColorMap = {
70
70
  'color.border': "var(--ds-border, #091e4221)",
@@ -1,4 +1,3 @@
1
- /* eslint-disable @atlaskit/design-system/use-primitives */
2
1
  /**
3
2
  * @jsxRuntime classic
4
3
  * @jsx jsx
@@ -2,10 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef } from 'react';
3
3
  import { xcss } from '../xcss/xcss';
4
4
  import Box from './box';
5
- const defaultStyles = xcss({
6
- cursor: 'pointer'
7
- });
8
-
9
5
  // TODO: Duplicated FocusRing styles due to lack of `xcss` support
10
6
  // and to prevent additional dependency
11
7
  const baseFocusRingStyles = {
@@ -54,9 +50,12 @@ const UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(({
54
50
  ...htmlAttributes
55
51
  }, ref) => {
56
52
  // Combine default styles with supplied styles. XCSS does not support deep nested arrays
57
- let styles = [defaultStyles, focusRingStyles];
53
+ let styles = [xcss({
54
+ cursor: isDisabled ? 'not-allowed' : 'pointer'
55
+ }), focusRingStyles];
58
56
  styles = Array.isArray(xcssStyles) ? [...styles, ...xcssStyles] : [...styles, xcssStyles];
59
57
  return /*#__PURE__*/React.createElement(Box, _extends({}, htmlAttributes, {
58
+ as: "button",
60
59
  ref: ref,
61
60
  testId: testId,
62
61
  type: type,
@@ -67,8 +66,7 @@ const UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(({
67
66
  paddingBlockEnd: paddingBlockEnd,
68
67
  paddingInline: paddingInline,
69
68
  paddingInlineStart: paddingInlineStart,
70
- paddingInlineEnd: paddingInlineEnd,
71
- as: "button"
69
+ paddingInlineEnd: paddingInlineEnd
72
70
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
73
71
  ,
74
72
  xcss: styles,
@@ -31,7 +31,7 @@ const flexGrowMap = {
31
31
  const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
32
32
  as,
33
33
  alignInline: alignItems,
34
- alignBlock,
34
+ alignBlock = 'stretch',
35
35
  spread,
36
36
  grow,
37
37
  space,
@@ -48,11 +48,11 @@ 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::0de38f66a11617229ed4985ae2051e3e>>
51
+ * @codegen <<SignedSource::4a24a8ef38d5bf0a2803ceff3c393915>>
52
52
  * @codegenId colors
53
53
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
54
54
  * @codegenParams ["border", "background", "shadow", "text", "fill"]
55
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::d09e7cd13e24113267155813747b3bd4>>
55
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::65311fc2a6a35bb34b99c859362ac840>>
56
56
  */
57
57
  export const borderColorMap = {
58
58
  'color.border': "var(--ds-border, #091e4221)",
@@ -1,4 +1,3 @@
1
- /* eslint-disable @atlaskit/design-system/use-primitives */
2
1
  /**
3
2
  * @jsxRuntime classic
4
3
  * @jsx jsx
@@ -5,10 +5,6 @@ var _excluded = ["children", "backgroundColor", "padding", "paddingBlock", "padd
5
5
  import React, { forwardRef } from 'react';
6
6
  import { xcss } from '../xcss/xcss';
7
7
  import Box from './box';
8
- var defaultStyles = xcss({
9
- cursor: 'pointer'
10
- });
11
-
12
8
  // TODO: Duplicated FocusRing styles due to lack of `xcss` support
13
9
  // and to prevent additional dependency
14
10
  var baseFocusRingStyles = {
@@ -57,9 +53,12 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(function (_ref, ref) {
57
53
  xcssStyles = _ref.xcss,
58
54
  htmlAttributes = _objectWithoutProperties(_ref, _excluded);
59
55
  // Combine default styles with supplied styles. XCSS does not support deep nested arrays
60
- var styles = [defaultStyles, focusRingStyles];
56
+ var styles = [xcss({
57
+ cursor: isDisabled ? 'not-allowed' : 'pointer'
58
+ }), focusRingStyles];
61
59
  styles = Array.isArray(xcssStyles) ? [].concat(_toConsumableArray(styles), _toConsumableArray(xcssStyles)) : [].concat(_toConsumableArray(styles), [xcssStyles]);
62
60
  return /*#__PURE__*/React.createElement(Box, _extends({}, htmlAttributes, {
61
+ as: "button",
63
62
  ref: ref,
64
63
  testId: testId,
65
64
  type: type,
@@ -70,8 +69,7 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(function (_ref, ref) {
70
69
  paddingBlockEnd: paddingBlockEnd,
71
70
  paddingInline: paddingInline,
72
71
  paddingInlineStart: paddingInlineStart,
73
- paddingInlineEnd: paddingInlineEnd,
74
- as: "button"
72
+ paddingInlineEnd: paddingInlineEnd
75
73
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
76
74
  ,
77
75
  xcss: styles,
@@ -32,7 +32,8 @@ var flexGrowMap = {
32
32
  var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
33
33
  var as = _ref.as,
34
34
  alignItems = _ref.alignInline,
35
- alignBlock = _ref.alignBlock,
35
+ _ref$alignBlock = _ref.alignBlock,
36
+ alignBlock = _ref$alignBlock === void 0 ? 'stretch' : _ref$alignBlock,
36
37
  spread = _ref.spread,
37
38
  grow = _ref.grow,
38
39
  space = _ref.space,
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { css } from '@emotion/react';
5
5
  import { UNSAFE_BREAKPOINTS_ORDERED_LIST } from './constants';
6
6
  import { media, UNSAFE_media } from './media-helper';
@@ -49,11 +49,11 @@ 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::0de38f66a11617229ed4985ae2051e3e>>
52
+ * @codegen <<SignedSource::4a24a8ef38d5bf0a2803ceff3c393915>>
53
53
  * @codegenId colors
54
54
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
55
55
  * @codegenParams ["border", "background", "shadow", "text", "fill"]
56
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::d09e7cd13e24113267155813747b3bd4>>
56
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::65311fc2a6a35bb34b99c859362ac840>>
57
57
  */
58
58
  export var borderColorMap = {
59
59
  'color.border': "var(--ds-border, #091e4221)",
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ElementType, ReactNode } from 'react';
3
3
  import { type Space } from '../xcss/style-maps.partial';
4
- import { BasePrimitiveProps } from './types';
4
+ import type { AlignBlock, AlignInline, BasePrimitiveProps, Grow, Spread } from './types';
5
5
  export type InlineProps<T extends ElementType = 'div'> = {
6
6
  /**
7
7
  * The DOM element to render as the Inline. Defaults to `div`.
@@ -49,10 +49,6 @@ export type InlineProps<T extends ElementType = 'div'> = {
49
49
  */
50
50
  ref?: React.ComponentPropsWithRef<T>['ref'];
51
51
  } & BasePrimitiveProps;
52
- export type AlignInline = 'start' | 'center' | 'end';
53
- export type AlignBlock = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
54
- export type Spread = 'space-between';
55
- export type Grow = 'hug' | 'fill';
56
52
  /**
57
53
  * __Inline__
58
54
  *
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ElementType, ReactNode } from 'react';
3
3
  import { type Space } from '../xcss/style-maps.partial';
4
- import type { BasePrimitiveProps } from './types';
4
+ import type { AlignBlock, AlignInline, BasePrimitiveProps, Grow, Spread } from './types';
5
5
  export type StackProps<T extends ElementType = 'div'> = {
6
6
  /**
7
7
  * The DOM element to render as the Stack. Defaults to `div`.
@@ -10,7 +10,7 @@ export type StackProps<T extends ElementType = 'div'> = {
10
10
  /**
11
11
  * Used to align children along the main axis.
12
12
  */
13
- alignBlock?: AlignBlock;
13
+ alignBlock?: Exclude<AlignBlock, 'baseline'>;
14
14
  /**
15
15
  * Used to align children along the cross axis.
16
16
  */
@@ -36,10 +36,6 @@ export type StackProps<T extends ElementType = 'div'> = {
36
36
  */
37
37
  ref?: React.ComponentPropsWithRef<T>['ref'];
38
38
  } & BasePrimitiveProps;
39
- export type AlignInline = 'start' | 'center' | 'end';
40
- export type AlignBlock = 'start' | 'center' | 'end';
41
- export type Spread = 'space-between';
42
- export type Grow = 'hug' | 'fill';
43
39
  /**
44
40
  * __Stack__
45
41
  *
@@ -62,7 +58,7 @@ declare const Stack: import("react").MemoExoticComponent<import("react").Forward
62
58
  /**
63
59
  * Used to align children along the main axis.
64
60
  */
65
- alignBlock?: AlignBlock | undefined;
61
+ alignBlock?: "stretch" | "center" | "end" | "start" | undefined;
66
62
  /**
67
63
  * Used to align children along the cross axis.
68
64
  */
@@ -19,3 +19,7 @@ export type BasePrimitiveProps = {
19
19
  */
20
20
  role?: string;
21
21
  };
22
+ export type AlignInline = 'start' | 'center' | 'end' | 'stretch';
23
+ export type AlignBlock = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
24
+ export type Spread = 'space-between';
25
+ export type Grow = 'hug' | 'fill';
@@ -50,11 +50,11 @@ export type Space = keyof typeof spaceMap;
50
50
  */
51
51
  /**
52
52
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
53
- * @codegen <<SignedSource::0de38f66a11617229ed4985ae2051e3e>>
53
+ * @codegen <<SignedSource::4a24a8ef38d5bf0a2803ceff3c393915>>
54
54
  * @codegenId colors
55
55
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
56
56
  * @codegenParams ["border", "background", "shadow", "text", "fill"]
57
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::d09e7cd13e24113267155813747b3bd4>>
57
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::65311fc2a6a35bb34b99c859362ac840>>
58
58
  */
59
59
  export declare const borderColorMap: {
60
60
  readonly 'color.border': "var(--ds-border)";
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ElementType, ReactNode } from 'react';
3
3
  import { type Space } from '../xcss/style-maps.partial';
4
- import { BasePrimitiveProps } from './types';
4
+ import type { AlignBlock, AlignInline, BasePrimitiveProps, Grow, Spread } from './types';
5
5
  export type InlineProps<T extends ElementType = 'div'> = {
6
6
  /**
7
7
  * The DOM element to render as the Inline. Defaults to `div`.
@@ -49,10 +49,6 @@ export type InlineProps<T extends ElementType = 'div'> = {
49
49
  */
50
50
  ref?: React.ComponentPropsWithRef<T>['ref'];
51
51
  } & BasePrimitiveProps;
52
- export type AlignInline = 'start' | 'center' | 'end';
53
- export type AlignBlock = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
54
- export type Spread = 'space-between';
55
- export type Grow = 'hug' | 'fill';
56
52
  /**
57
53
  * __Inline__
58
54
  *
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ElementType, ReactNode } from 'react';
3
3
  import { type Space } from '../xcss/style-maps.partial';
4
- import type { BasePrimitiveProps } from './types';
4
+ import type { AlignBlock, AlignInline, BasePrimitiveProps, Grow, Spread } from './types';
5
5
  export type StackProps<T extends ElementType = 'div'> = {
6
6
  /**
7
7
  * The DOM element to render as the Stack. Defaults to `div`.
@@ -10,7 +10,7 @@ export type StackProps<T extends ElementType = 'div'> = {
10
10
  /**
11
11
  * Used to align children along the main axis.
12
12
  */
13
- alignBlock?: AlignBlock;
13
+ alignBlock?: Exclude<AlignBlock, 'baseline'>;
14
14
  /**
15
15
  * Used to align children along the cross axis.
16
16
  */
@@ -36,10 +36,6 @@ export type StackProps<T extends ElementType = 'div'> = {
36
36
  */
37
37
  ref?: React.ComponentPropsWithRef<T>['ref'];
38
38
  } & BasePrimitiveProps;
39
- export type AlignInline = 'start' | 'center' | 'end';
40
- export type AlignBlock = 'start' | 'center' | 'end';
41
- export type Spread = 'space-between';
42
- export type Grow = 'hug' | 'fill';
43
39
  /**
44
40
  * __Stack__
45
41
  *
@@ -62,7 +58,7 @@ declare const Stack: import("react").MemoExoticComponent<import("react").Forward
62
58
  /**
63
59
  * Used to align children along the main axis.
64
60
  */
65
- alignBlock?: AlignBlock | undefined;
61
+ alignBlock?: "stretch" | "center" | "end" | "start" | undefined;
66
62
  /**
67
63
  * Used to align children along the cross axis.
68
64
  */
@@ -19,3 +19,7 @@ export type BasePrimitiveProps = {
19
19
  */
20
20
  role?: string;
21
21
  };
22
+ export type AlignInline = 'start' | 'center' | 'end' | 'stretch';
23
+ export type AlignBlock = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
24
+ export type Spread = 'space-between';
25
+ export type Grow = 'hug' | 'fill';
@@ -50,11 +50,11 @@ export type Space = keyof typeof spaceMap;
50
50
  */
51
51
  /**
52
52
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
53
- * @codegen <<SignedSource::0de38f66a11617229ed4985ae2051e3e>>
53
+ * @codegen <<SignedSource::4a24a8ef38d5bf0a2803ceff3c393915>>
54
54
  * @codegenId colors
55
55
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
56
56
  * @codegenParams ["border", "background", "shadow", "text", "fill"]
57
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::d09e7cd13e24113267155813747b3bd4>>
57
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::65311fc2a6a35bb34b99c859362ac840>>
58
58
  */
59
59
  export declare const borderColorMap: {
60
60
  readonly 'color.border': "var(--ds-border)";
@@ -5,7 +5,7 @@ import type {
5
5
  AlignInline,
6
6
  Grow,
7
7
  Spread,
8
- } from '../src/components/inline';
8
+ } from '../src/components/types';
9
9
 
10
10
  type Space =
11
11
  | 'space.0'
@@ -5,7 +5,7 @@ import type {
5
5
  AlignInline,
6
6
  Grow,
7
7
  Spread,
8
- } from '../src/components/stack';
8
+ } from '../src/components/types';
9
9
 
10
10
  type Space =
11
11
  | 'space.0'
@@ -31,7 +31,7 @@ interface StackProps<T extends ElementType = 'div'> {
31
31
  /**
32
32
  * Used to align children along the main axis.
33
33
  */
34
- alignBlock?: AlignBlock;
34
+ alignBlock?: Exclude<AlignBlock, 'baseline'>;
35
35
 
36
36
  /**
37
37
  * Used to align children along the cross axis.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -116,7 +116,7 @@
116
116
  "codegen-styles": "ts-node -r tsconfig-paths/register ./scripts/codegen-styles.tsx"
117
117
  },
118
118
  "dependencies": {
119
- "@atlaskit/tokens": "^1.14.0",
119
+ "@atlaskit/tokens": "^1.18.0",
120
120
  "@babel/runtime": "^7.0.0",
121
121
  "@emotion/react": "^11.7.1",
122
122
  "@emotion/serialize": "^1.1.0",
@@ -126,7 +126,6 @@
126
126
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
127
127
  },
128
128
  "devDependencies": {
129
- "@af/visual-regression": "*",
130
129
  "@atlaskit/ds-lib": "*",
131
130
  "@atlaskit/ssr": "*",
132
131
  "@atlaskit/visual-regression": "*",
package/report.api.md CHANGED
@@ -34,9 +34,6 @@ import { SerializedStyles as SerializedStyles_2 } from '@emotion/react';
34
34
  // @public (undocumented)
35
35
  type AlignBlock = 'baseline' | 'center' | 'end' | 'start' | 'stretch';
36
36
 
37
- // @public (undocumented)
38
- type AlignBlock_2 = 'center' | 'end' | 'start';
39
-
40
37
  // @public (undocumented)
41
38
  type AlignContent = keyof typeof alignContentMap;
42
39
 
@@ -52,10 +49,7 @@ const alignContentMap: {
52
49
  };
53
50
 
54
51
  // @public (undocumented)
55
- type AlignInline = 'center' | 'end' | 'start';
56
-
57
- // @public (undocumented)
58
- type AlignInline_2 = 'center' | 'end' | 'start';
52
+ type AlignInline = 'center' | 'end' | 'start' | 'stretch';
59
53
 
60
54
  // @public (undocumented)
61
55
  type AlignItems = keyof typeof alignItemsMap;
@@ -627,9 +621,6 @@ export type GridProps<T extends ElementType = 'div'> = {
627
621
  // @public (undocumented)
628
622
  type Grow = 'fill' | 'hug';
629
623
 
630
- // @public (undocumented)
631
- type Grow_2 = 'fill' | 'hug';
632
-
633
624
  // @public
634
625
  export const Inline: MemoExoticComponent<
635
626
  ForwardRefExoticComponent<
@@ -829,19 +820,16 @@ const spaceMap: {
829
820
  // @public (undocumented)
830
821
  type Spread = 'space-between';
831
822
 
832
- // @public (undocumented)
833
- type Spread_2 = 'space-between';
834
-
835
823
  // @public
836
824
  export const Stack: MemoExoticComponent<
837
825
  ForwardRefExoticComponent<
838
826
  Pick<
839
827
  {
840
828
  as?: 'div' | 'ol' | 'span' | 'ul' | undefined;
841
- alignBlock?: AlignBlock_2 | undefined;
842
- alignInline?: AlignInline_2 | undefined;
829
+ alignBlock?: 'center' | 'end' | 'start' | 'stretch' | undefined;
830
+ alignInline?: AlignInline | undefined;
843
831
  spread?: 'space-between' | undefined;
844
- grow?: Grow_2 | undefined;
832
+ grow?: Grow | undefined;
845
833
  space?:
846
834
  | 'space.0'
847
835
  | 'space.025'
@@ -877,10 +865,10 @@ export const Stack: MemoExoticComponent<
877
865
  // @public (undocumented)
878
866
  export type StackProps<T extends ElementType = 'div'> = {
879
867
  as?: 'div' | 'ol' | 'span' | 'ul';
880
- alignBlock?: AlignBlock_2;
881
- alignInline?: AlignInline_2;
882
- spread?: Spread_2;
883
- grow?: Grow_2;
868
+ alignBlock?: Exclude<AlignBlock, 'baseline'>;
869
+ alignInline?: AlignInline;
870
+ spread?: Spread;
871
+ grow?: Grow;
884
872
  space?: Space;
885
873
  children: ReactNode;
886
874
  ref?: React.ComponentPropsWithRef<T>['ref'];
@@ -23,9 +23,6 @@ import { SerializedStyles as SerializedStyles_2 } from '@emotion/react';
23
23
  // @public (undocumented)
24
24
  type AlignBlock = 'baseline' | 'center' | 'end' | 'start' | 'stretch';
25
25
 
26
- // @public (undocumented)
27
- type AlignBlock_2 = 'center' | 'end' | 'start';
28
-
29
26
  // @public (undocumented)
30
27
  type AlignContent = keyof typeof alignContentMap;
31
28
 
@@ -41,10 +38,7 @@ const alignContentMap: {
41
38
  };
42
39
 
43
40
  // @public (undocumented)
44
- type AlignInline = 'center' | 'end' | 'start';
45
-
46
- // @public (undocumented)
47
- type AlignInline_2 = 'center' | 'end' | 'start';
41
+ type AlignInline = 'center' | 'end' | 'start' | 'stretch';
48
42
 
49
43
  // @public (undocumented)
50
44
  type AlignItems = keyof typeof alignItemsMap;
@@ -426,9 +420,6 @@ export type GridProps<T extends ElementType = 'div'> = {
426
420
  // @public (undocumented)
427
421
  type Grow = 'fill' | 'hug';
428
422
 
429
- // @public (undocumented)
430
- type Grow_2 = 'fill' | 'hug';
431
-
432
423
  // @public
433
424
  export const Inline: MemoExoticComponent<ForwardRefExoticComponent<Pick<{
434
425
  as?: "div" | "li" | "ol" | "span" | "ul" | undefined;
@@ -571,16 +562,13 @@ const spaceMap: {
571
562
  // @public (undocumented)
572
563
  type Spread = 'space-between';
573
564
 
574
- // @public (undocumented)
575
- type Spread_2 = 'space-between';
576
-
577
565
  // @public
578
566
  export const Stack: MemoExoticComponent<ForwardRefExoticComponent<Pick<{
579
567
  as?: "div" | "ol" | "span" | "ul" | undefined;
580
- alignBlock?: AlignBlock_2 | undefined;
581
- alignInline?: AlignInline_2 | undefined;
568
+ alignBlock?: "center" | "end" | "start" | "stretch" | undefined;
569
+ alignInline?: AlignInline | undefined;
582
570
  spread?: "space-between" | undefined;
583
- grow?: Grow_2 | undefined;
571
+ grow?: Grow | undefined;
584
572
  space?: "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.1000" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | undefined;
585
573
  children: ReactNode;
586
574
  ref?: any;
@@ -589,10 +577,10 @@ ref?: any;
589
577
  // @public (undocumented)
590
578
  export type StackProps<T extends ElementType = 'div'> = {
591
579
  as?: 'div' | 'ol' | 'span' | 'ul';
592
- alignBlock?: AlignBlock_2;
593
- alignInline?: AlignInline_2;
594
- spread?: Spread_2;
595
- grow?: Grow_2;
580
+ alignBlock?: Exclude<AlignBlock, 'baseline'>;
581
+ alignInline?: AlignInline;
582
+ spread?: Spread;
583
+ grow?: Grow;
596
584
  space?: Space;
597
585
  children: ReactNode;
598
586
  ref?: React.ComponentPropsWithRef<T>['ref'];