@atlaskit/primitives 1.0.10 → 1.0.11

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,11 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 1.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`30fb9fe0ff4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/30fb9fe0ff4) - Mark Pressable exports as unsafe (for internal use only)
8
+
3
9
  ## 1.0.10
4
10
 
5
11
  ### Patch Changes
@@ -20,24 +20,20 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
20
20
 
21
21
  ## Basic
22
22
 
23
- The `Flex` component is designed as a very basic mapping to the CSS Flexbox API.
24
- It can be used as a less richly-configured `Inline` or `Stack`. Like `Stack` and `Inline`
25
- `Flex` exclusively supports token-backed `gap` properties to ensure layouts using `Flex` match
26
- the Atlassian Design System spacing scale.
23
+ The `Flex` component is a basic mapping to the CSS Flexbox API. It can be used as a less richly-configured `Inline` or `Stack`. Like Stack and Inline, `Flex` exclusively supports token-backed `gap` properties to ensure layouts using `Flex` match the Atlassian Design System spacing scale.
27
24
 
28
25
  <Example Component={FlexJustifyContent} packageName="@atlaskit/primitives/flex" />
29
26
 
30
27
  ## Align items and justify content
31
28
 
32
- `Flex` applies the `alignItems` and `justifyContent` properties to align content
33
- along its cross and main axes respectively.
29
+ `Flex` applies the `alignItems` and `justifyContent` properties to align content along its cross and main axes respectively.
34
30
 
35
31
  <Example Component={FlexAlignItems} packageName="@atlaskit/primitives/flex" />
36
32
 
37
33
  ## Wrap
38
34
 
39
- Flex-prefixed properties in CSS do not have this prefix in the component API.
40
- For example `flex-wrap` is instead applied as the `wrap` property.
35
+ Flex-prefixed properties in CSS do not have this prefix in the component API.
36
+ For example, `flex-wrap` is instead applied as the `wrap` property.
41
37
 
42
38
  <Example Component={FlexWrap} packageName="@atlaskit/primitives/flex" />
43
39
 
@@ -28,9 +28,8 @@ It can be used as an alternative to [Flex](/components/primitives/flex), [Inline
28
28
 
29
29
  ## Gap properties
30
30
 
31
- Gap properties - `rowGap`, `columnGap` and `gap` only allow token-backed values. This is to aid ergonomics
32
- and keep the whitespace of the grid harmonious with our spacing system.
33
31
 
32
+ Gap properties `rowGap`, `columnGap` and `gap` only allow token-backed values. This is to aid ergonomics and keep the whitespace of the grid harmonious with the spacing system.
34
33
  <Example Component={GridGap} packageName="@atlaskit/primitives/grid" />
35
34
 
36
35
  ## Template syntax
@@ -27,8 +27,9 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
27
27
 
28
28
  ## Basic
29
29
 
30
- Inline is an abstraction to efficiently lay-out a group of elements horizontally.
31
- Use the given props to configure display behaviour using scalable recommendations from the Atlassian Design System.
30
+ Inline should be used to efficiently lay-out a group of elements horizontally.
31
+
32
+ Use the given props to configure display behaviour using designs tokens, as shown in the more complex examples below.
32
33
 
33
34
  <Example Component={InlineBasic} packageName="@atlaskit/primitives/inline" />
34
35
 
@@ -38,16 +39,15 @@ Spacing between items can be controlled with the `space` prop:
38
39
 
39
40
  <Example Component={InlineSpaceBasic} packageName="@atlaskit/primitives/inline" />
40
41
 
41
- When content is set to wrap the `space` prop applies equal spacing between rows as well:
42
+ When content is set to wrap, the `space` prop applies equal spacing between rows.
42
43
 
43
- <Example Component={InlineSpaceWrap} packageName="@atlaskit/primitives/inline" />
44
+ For a different space value between rows use the `rowSpace` prop.
44
45
 
45
- For a different space value between rows use the `rowSpace` prop, as shown in the dynamic example above.
46
+ <Example Component={InlineSpaceWrap} packageName="@atlaskit/primitives/inline" />
46
47
 
47
48
  ## Alignment
48
49
 
49
- To control the alignment of items you can use the `alignBlock` and `alignInline` props which control
50
- alignment in the block and inline directions respectively.
50
+ To control the alignment of items you can use the `alignBlock` and `alignInline` props which control alignment in the vertical and horizontal axis respectively.
51
51
 
52
52
  ### Block alignment
53
53
 
@@ -59,7 +59,7 @@ alignment in the block and inline directions respectively.
59
59
 
60
60
  ## Spread
61
61
 
62
- Elements can be set to stay together next to each other (default behaviour) or spread equally in the space available.
62
+ Elements can be set to stay together, spaced at the given value (default behaviour) or spread equally in the space available.
63
63
 
64
64
  <Example Component={InlineSpread} packageName="@atlaskit/primitives/inline" />
65
65
 
@@ -71,15 +71,14 @@ When the number of items goes beyond the available space `shouldWrap` can be use
71
71
 
72
72
  ## Separator
73
73
 
74
- For logically related elements it's possible to specify a `separator` value.
74
+ For logically related elements it's possible to specify a `separator` character value.
75
75
 
76
76
  <Example Component={InlineSeparator} packageName="@atlaskit/primitives/inline" />
77
77
 
78
78
  ## Width control
79
79
 
80
- By default an `Inline` will have its width influenced by the context where it appears.
81
-
82
- To control that the `grow` prop can be used with the values:
80
+ By default an `Inline` will have its width influenced by the context where it appears.
81
+ To control the width, the `grow` prop can be used with the values:
83
82
 
84
83
  * `hug` (default) to use space only as required by its children, or
85
84
  * `fill` to take all space provided by the parent element.
@@ -92,6 +91,8 @@ It's possible to control the rendered HTML element with the `as` prop.
92
91
 
93
92
  <Example Component={InlineAs} packageName="@atlaskit/primitives/inline" />
94
93
 
95
- ## Practical Use Case
94
+ ## Practical use case
95
+
96
+ An example of how an `Inline` might be used in product, using Atlassian Design System components.
96
97
 
97
98
  <Example Component={InlinePracticalUseCase} packageName="@atlaskit/primitives/inline" />
@@ -15,7 +15,8 @@ In its simplest form, `Inline` operates like a flexbox row, however adds the bui
15
15
  ...
16
16
  </Inline>
17
17
  ```
18
- It also has a flex-direction: row; but that’s the default, so not explicitly applied.
18
+
19
+ `Inline` also has a flex-direction: row; this is the default for flexbox, so it is not explicitly applied.
19
20
 
20
21
  ## Use `Inline`
21
22
  The purpose of an Inline is primarily as a container element controlling how child components are displayed and positioned horizontally. Inline should be used any time you wish to layout elements or components horizontally.
@@ -31,9 +32,9 @@ The various Inline props can then be used to customize the spacing and styling o
31
32
  - `rowSpace`
32
33
  - `separator`
33
34
 
35
+ - [Learn more about the Primitives](/components/primitives/overview)
34
36
  - [Learn more about the Box primitive](/components/primitives/box/usage)
35
37
  - [Learn more about the Stack primitive](/components/primitives/stack/usage)
36
38
  - [Learn more about the Grid primitive](/components/primitives/grid/examples)
37
39
  - [Learn more about the Bleed primitive](/components/primitives/bleed/examples)
38
40
  - [Learn more about the Flex primitive](/components/primitives/flex/examples)
39
-
@@ -18,9 +18,9 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
18
18
 
19
19
  ### Show
20
20
 
21
- This allows you to Show the children using CSS `display: …` either above or below a breakpoint. By default, unless the breakpoint is met, contents are hidden.
21
+ Using `Show` allows you to show the children using CSS `display: …` when the viewport size is above a specified breakpoint. By default, unless the breakpoint is met, contents are hidden.
22
22
 
23
- Note that this does not skip rendering of your children; the contents are rendered into the DOM at all times, so there is typically little performance savings—primarily that this is not painted.
23
+ Children that are not shown are still rendered into the DOM, so there so there is typically little performance savings primarily that they are not painted.
24
24
 
25
25
  <Example Component={ShowExample} packageName="@atlaskit/primitives/responsive" />
26
26
 
@@ -17,9 +17,9 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
17
17
 
18
18
  ### Hide
19
19
 
20
- This allows you to Hide the children using CSS `display: none` either above or below a breakpoint. By default, unless the breakpoint is met, contents are hidden.
20
+ Using Hide allows you to Hide the children using CSS `display: none` when the viewport size is above a specified breakpoint. By default, unless the breakpoint is met, contents are hidden.
21
21
 
22
- When hidden, this does not skip rendering of your children; the contents are rendered into the DOM at all times so there is typically little performance savings—primarily that this is not painted.
22
+ Children that are hidden are still rendered into the DOM, so there so there is typically little performance savings primarily that they are not painted.
23
23
 
24
24
  <Example Component={HideExample} packageName="@atlaskit/primitives/responsive" />
25
25
 
@@ -6,12 +6,13 @@ order: 2
6
6
 
7
7
  ## Media query helpers
8
8
 
9
- We expose two media query helper objects which map to our [breakpoints](/components/grid/usage#breakpoints) as media queries for use in css-in-js:
10
- - `media.above[breakpoint]` to target all viewports **above** (larger than) the min-width of a given breakpoint
9
+ The media query helper object `media.above[breakpoint]` maps to our [breakpoints](/components/grid/usage#breakpoints) as a media query for use in css-in-js. `media.above[breakpoint]` targets all viewports **above** (larger than) the min-width of a given breakpoint
10
+
11
+ These responsive helpers are designed be used in conjunction with [xcss](/components/primitives/xcss). It is recommended that both are used when available as this uses our media queries to allow for safe, responsive styling.
11
12
 
12
13
  ### A basic example:
13
14
 
14
- Compose your default styles alongside media overrides in [xcss](/components/primitives/xcss) or `css`
15
+ Compose your default styles alongside media overrides in [xcss](/components/primitives/xcss) or `css`.
15
16
 
16
17
  ```tsx
17
18
  const customStyles = xcss({
@@ -28,7 +29,7 @@ export const Component = ({ children }: { children: ReactNode }) => (
28
29
 
29
30
  ### `media.above` usage
30
31
 
31
- Please note that `media.above.xxs` will **always** match; it is explicitly `'@media all'`. This is only included for easy programatic usage, but it has a negative performance impact.
32
+ It is important to note that the `media.above.xxs` will **always** match, it is explicitly `'@media all'`. This is only included for easy programatic usage, but it has a negative performance impact.
32
33
 
33
34
  ```tsx
34
35
  const customStyles = css({
@@ -47,7 +48,3 @@ This is intentionally excluded at the moment as we're shipping our opinion that
47
48
  We understand this will not scale and we're open to change, but we'd like to change this with feedback.
48
49
 
49
50
  If we do add it back, we'd suggest codebases prefer a single approach (eg. `above` or `below`) and use that consistently. Mixing them results in confusion (though they can be safely used together and can result in better CSS performance when done correctly).
50
-
51
- ### Some notes and suggestions
52
-
53
- - Please combine this with our [xcss](/components/primitives/xcss) when available as this uses our media queries to allow for safe, responsive styling.
@@ -23,21 +23,20 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
23
23
 
24
24
  ## Basic
25
25
 
26
- Stack is an abstraction to lay-out a group of elements vertically.
27
- Use the given props to configure display behaviour using scalable recommendations from the Atlassian Design System.
26
+ Stack should be used to efficiently lay-out a group of elements vertically.
27
+ Use the given props to configure display behaviour using designs tokens, as shown in the more complex examples below.
28
28
 
29
29
  <Example Component={StackBasic} packageName="@atlaskit/primitives/stack" />
30
30
 
31
31
  ## Space
32
32
 
33
- Spacing between items can be controlled with the `space` prop:
33
+ Spacing between items can be controlled with the `space` prop.
34
34
 
35
35
  <Example Component={StackSpaceBasic} packageName="@atlaskit/primitives/stack" />
36
36
 
37
37
  ## Alignment
38
38
 
39
- To control the alignment of items you can use the `alignBlock` and `alignInline` props which control
40
- alignment in the block and inline directions respectively.
39
+ To control the alignment of items you can use the `alignBlock` and `alignInline` props which control alignment in the vertical and horizontal axis respectively.
41
40
 
42
41
  ### Block alignment
43
42
 
@@ -49,13 +48,13 @@ alignment in the block and inline directions respectively.
49
48
 
50
49
  ## Spread
51
50
 
52
- Elements can be set to stay together next to each other (default behaviour) or spread equally in the space available.
51
+ Elements can be set to stay together, spaced at the given value (default behaviour) or spread equally in the space available.
53
52
 
54
53
  <Example Component={StackSpread} packageName="@atlaskit/primitives/stack" />
55
54
 
56
55
  ## Width control
57
56
 
58
- By default a `Stack` will have its width influenced by the context where it appears.
57
+ By default a `Stack` will have its width influenced by the context where it appears. To control the width the `grow` prop can be used with the values:
59
58
 
60
59
  To control that the `grow` prop can be used with the values:
61
60
 
@@ -70,6 +69,6 @@ It's possible to control the rendered HTML element with the `as` prop.
70
69
 
71
70
  <Example Component={StackAs} packageName="@atlaskit/primitives/stack" />
72
71
 
73
- ## Practical Use Case
72
+ ## Practical use case
74
73
 
75
74
  <Example Component={PracticalUseCase} packageName="@atlaskit/primitives/stack" />
@@ -27,7 +27,7 @@ The various `Stack` props can then be used to customize the spacing and styling
27
27
  - `space`
28
28
 
29
29
  ## Related
30
-
30
+ - [Learn more about the Primitives](/components/primitives/overview)
31
31
  - [Learn more about the Box primitive](/components/primitives/box/usage)
32
32
  - [Learn more about the Inline primitive](/components/primitives/inline/usage)
33
33
  - [Learn more about the Grid primitive](/components/primitives/grid/examples)
@@ -18,7 +18,7 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
18
18
 
19
19
  ## Basic
20
20
 
21
- `xcss` can pull together different types of interactions and UI in a safer more composable way.
21
+ `xcss` can pull together different types of interactions and UI in a safer, more composable way.
22
22
 
23
23
  <Example Component={xcssBasic} packageName="@atlaskit/primitives/xcss" />
24
24
 
@@ -31,6 +31,6 @@ To enable interactivity, use familiar selectors like `:hover` and `:focus-visibl
31
31
 
32
32
  ## Responsiveness
33
33
 
34
- xcss also accepts a subset of media queries at predefined breakpoints:
34
+ xCSS also accepts a subset of media queries at [predefined breakpoints](/components/primitives/responsive/breakpoints/examples).
35
35
 
36
36
  <Example Component={xcssResponsive} packageName="@atlaskit/primitives/xcss" />
Binary file
@@ -105,7 +105,7 @@ const someStyles = xcss({
105
105
  #### Moving from the `styled` API
106
106
 
107
107
  If currently using the `styled` API there are a few steps to migrate.
108
- The safest approach is to a step change to use object styles, migrate to tokens (optionally) and then migrate to `xcss`.
108
+ The safest approach is to use object styles, migrate to tokens (optionally) and then migrate to `xcss`.
109
109
 
110
110
  ```tsx
111
111
  const MyComponent = styled.div`
@@ -51,7 +51,7 @@ const MyBox = () => {
51
51
  ```
52
52
  The `xcss` prop and the `xcss` function are direct complements and are designed to be used together.
53
53
 
54
- Note: styles generated from `xcss` cannot be applied directly to the `className` property or `css` as they are with other CSS-in-JS libraries.
54
+ It is important to note that styles generated from `xcss` cannot be applied directly to the `className` property or `css` as they are with other CSS-in-JS libraries.
55
55
 
56
56
  ### Type safety
57
57
 
@@ -78,13 +78,6 @@ const someStyles = xcss({
78
78
  Selectors cannot be nested or target elements beyond the element on which styles are applied.
79
79
  This restriction is intended to encourage better component encapsulation, reduce side-effects and make the codebase more resilient to change.
80
80
 
81
-
82
- `xcss` is meant to be flexible enough for you to implement any design but it does
83
- restrict the application of styles in one key way. Selectors cannot be
84
- nested or target elements beyond the element on which styles are applied.
85
- This restriction is intended to encourage better component encapsulation, reduce side-effects and make
86
- your codebase more resilient to change.
87
-
88
81
  ```tsx
89
82
  import { xcss } from '@atlaskit/primitives';
90
83
 
@@ -18,7 +18,9 @@ var defaultStyles = (0, _react2.css)({
18
18
  });
19
19
 
20
20
  /**
21
- * __Pressable__
21
+ * __UNSAFE_PRESSABLE__
22
+ *
23
+ * @internal Still under development. Do not use.
22
24
  *
23
25
  * A Pressable is a primitive component that renders a `<button>`.
24
26
  *
@@ -26,7 +28,7 @@ var defaultStyles = (0, _react2.css)({
26
28
  * - [Code](https://atlassian.design/components/primitives/pressable/code)
27
29
  * - [Usage](https://atlassian.design/components/primitives/pressable/usage)
28
30
  */
29
- var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
31
+ var UNSAFE_PRESSABLE = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
30
32
  var children = _ref.children,
31
33
  backgroundColor = _ref.backgroundColor,
32
34
  padding = _ref.padding,
@@ -58,5 +60,5 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
58
60
  disabled: isDisabled
59
61
  }), children));
60
62
  });
61
- var _default = Pressable;
63
+ var _default = UNSAFE_PRESSABLE;
62
64
  exports.default = _default;
package/dist/cjs/index.js CHANGED
@@ -34,12 +34,6 @@ Object.defineProperty(exports, "Inline", {
34
34
  return _inline.default;
35
35
  }
36
36
  });
37
- Object.defineProperty(exports, "Pressable", {
38
- enumerable: true,
39
- get: function get() {
40
- return _pressable.default;
41
- }
42
- });
43
37
  Object.defineProperty(exports, "Stack", {
44
38
  enumerable: true,
45
39
  get: function get() {
@@ -71,7 +65,6 @@ Object.defineProperty(exports, "xcss", {
71
65
  }
72
66
  });
73
67
  var _box = _interopRequireDefault(require("./components/box"));
74
- var _pressable = _interopRequireDefault(require("./components/pressable"));
75
68
  var _inline = _interopRequireDefault(require("./components/inline"));
76
69
  var _xcss = require("./xcss/xcss");
77
70
  var _stack = _interopRequireDefault(require("./components/stack"));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "sideEffects": false
5
5
  }
@@ -9,7 +9,9 @@ const defaultStyles = css({
9
9
  });
10
10
 
11
11
  /**
12
- * __Pressable__
12
+ * __UNSAFE_PRESSABLE__
13
+ *
14
+ * @internal Still under development. Do not use.
13
15
  *
14
16
  * A Pressable is a primitive component that renders a `<button>`.
15
17
  *
@@ -17,7 +19,7 @@ const defaultStyles = css({
17
19
  * - [Code](https://atlassian.design/components/primitives/pressable/code)
18
20
  * - [Usage](https://atlassian.design/components/primitives/pressable/usage)
19
21
  */
20
- const Pressable = /*#__PURE__*/forwardRef(({
22
+ const UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(({
21
23
  children,
22
24
  backgroundColor,
23
25
  padding,
@@ -49,4 +51,4 @@ const Pressable = /*#__PURE__*/forwardRef(({
49
51
  disabled: isDisabled
50
52
  }), children));
51
53
  });
52
- export default Pressable;
54
+ export default UNSAFE_PRESSABLE;
@@ -1,5 +1,4 @@
1
1
  export { default as Box } from './components/box';
2
- export { default as Pressable } from './components/pressable';
3
2
  export { default as Inline } from './components/inline';
4
3
  export { xcss } from './xcss/xcss';
5
4
  export { default as Stack } from './components/stack';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,9 @@ var defaultStyles = css({
11
11
  });
12
12
 
13
13
  /**
14
- * __Pressable__
14
+ * __UNSAFE_PRESSABLE__
15
+ *
16
+ * @internal Still under development. Do not use.
15
17
  *
16
18
  * A Pressable is a primitive component that renders a `<button>`.
17
19
  *
@@ -19,7 +21,7 @@ var defaultStyles = css({
19
21
  * - [Code](https://atlassian.design/components/primitives/pressable/code)
20
22
  * - [Usage](https://atlassian.design/components/primitives/pressable/usage)
21
23
  */
22
- var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
24
+ var UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(function (_ref, ref) {
23
25
  var children = _ref.children,
24
26
  backgroundColor = _ref.backgroundColor,
25
27
  padding = _ref.padding,
@@ -51,4 +53,4 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
51
53
  disabled: isDisabled
52
54
  }), children));
53
55
  });
54
- export default Pressable;
56
+ export default UNSAFE_PRESSABLE;
package/dist/esm/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  export { default as Box } from './components/box';
2
- export { default as Pressable } from './components/pressable';
3
2
  export { default as Inline } from './components/inline';
4
3
  export { xcss } from './xcss/xcss';
5
4
  export { default as Stack } from './components/stack';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,9 @@ export type PressableProps = Omit<BaseBoxProps<'button'>, 'disabled' | 'as' | 'c
11
11
  };
12
12
  type PressableComponent = (props: PressableProps, displayName: string) => ReactElement | null;
13
13
  /**
14
- * __Pressable__
14
+ * __UNSAFE_PRESSABLE__
15
+ *
16
+ * @internal Still under development. Do not use.
15
17
  *
16
18
  * A Pressable is a primitive component that renders a `<button>`.
17
19
  *
@@ -19,5 +21,5 @@ type PressableComponent = (props: PressableProps, displayName: string) => ReactE
19
21
  * - [Code](https://atlassian.design/components/primitives/pressable/code)
20
22
  * - [Usage](https://atlassian.design/components/primitives/pressable/usage)
21
23
  */
22
- declare const Pressable: PressableComponent;
23
- export default Pressable;
24
+ declare const UNSAFE_PRESSABLE: PressableComponent;
25
+ export default UNSAFE_PRESSABLE;
@@ -1,8 +1,6 @@
1
1
  export type { Dimension, BackgroundColor, Space, BorderColor, BorderRadius, BorderWidth, Layer, Shadow, } from './xcss/style-maps.partial';
2
2
  export { default as Box } from './components/box';
3
3
  export type { BoxProps } from './components/box';
4
- export { default as Pressable } from './components/pressable';
5
- export type { PressableProps } from './components/pressable';
6
4
  export { default as Inline } from './components/inline';
7
5
  export type { InlineProps } from './components/inline';
8
6
  export { xcss } from './xcss/xcss';
@@ -11,7 +11,9 @@ export type PressableProps = Omit<BaseBoxProps<'button'>, 'disabled' | 'as' | 'c
11
11
  };
12
12
  type PressableComponent = (props: PressableProps, displayName: string) => ReactElement | null;
13
13
  /**
14
- * __Pressable__
14
+ * __UNSAFE_PRESSABLE__
15
+ *
16
+ * @internal Still under development. Do not use.
15
17
  *
16
18
  * A Pressable is a primitive component that renders a `<button>`.
17
19
  *
@@ -19,5 +21,5 @@ type PressableComponent = (props: PressableProps, displayName: string) => ReactE
19
21
  * - [Code](https://atlassian.design/components/primitives/pressable/code)
20
22
  * - [Usage](https://atlassian.design/components/primitives/pressable/usage)
21
23
  */
22
- declare const Pressable: PressableComponent;
23
- export default Pressable;
24
+ declare const UNSAFE_PRESSABLE: PressableComponent;
25
+ export default UNSAFE_PRESSABLE;
@@ -1,8 +1,6 @@
1
1
  export type { Dimension, BackgroundColor, Space, BorderColor, BorderRadius, BorderWidth, Layer, Shadow, } from './xcss/style-maps.partial';
2
2
  export { default as Box } from './components/box';
3
3
  export type { BoxProps } from './components/box';
4
- export { default as Pressable } from './components/pressable';
5
- export type { PressableProps } from './components/pressable';
6
4
  export { default as Inline } from './components/inline';
7
5
  export type { InlineProps } from './components/inline';
8
6
  export { xcss } from './xcss/xcss';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -178,6 +178,7 @@
178
178
  "./box": "./src/components/box.tsx",
179
179
  "./stack": "./src/components/stack.tsx",
180
180
  "./inline": "./src/components/inline.tsx",
181
+ "./pressable": "./src/components/pressable.tsx",
181
182
  "./responsive": "./src/responsive/index.tsx"
182
183
  },
183
184
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/primitives/pressable",
3
+ "main": "../dist/cjs/components/pressable.js",
4
+ "module": "../dist/esm/components/pressable.js",
5
+ "module:es2019": "../dist/es2019/components/pressable.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/components/pressable.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <4.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/components/pressable.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
package/report.api.md CHANGED
@@ -218,15 +218,6 @@ const backgroundColorMap: {
218
218
  readonly 'elevation.surface.sunken': 'var(--ds-surface-sunken)';
219
219
  };
220
220
 
221
- // @public (undocumented)
222
- type BaseBoxProps<T extends ElementType> = Omit<
223
- ComponentPropsWithoutRef<T>,
224
- 'as' | 'className'
225
- > &
226
- BasePrimitiveProps &
227
- BaseBoxPropsFoundation<T> &
228
- ClassName;
229
-
230
221
  // @public (undocumented)
231
222
  type BaseBoxPropsFoundation<T extends ElementType> = {
232
223
  as?: T;
@@ -345,11 +336,6 @@ export type BoxProps<T extends ElementType> = Omit<
345
336
  // @public
346
337
  export type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
347
338
 
348
- // @public (undocumented)
349
- type ClassName = {
350
- className?: string;
351
- };
352
-
353
339
  // @public (undocumented)
354
340
  type CSSAtRules = {
355
341
  [AtRule in AtRulesWithoutMedia as `${AtRule}${string}`]?: Omit<
@@ -792,24 +778,6 @@ export const media: {
792
778
  // @public
793
779
  type MediaQuery = (typeof media.above)[Breakpoint];
794
780
 
795
- // @public
796
- export const Pressable: PressableComponent;
797
-
798
- // @public (undocumented)
799
- type PressableComponent = (
800
- props: PressableProps,
801
- displayName: string,
802
- ) => ReactElement | null;
803
-
804
- // @public (undocumented)
805
- export type PressableProps = Omit<
806
- BaseBoxProps<'button'>,
807
- 'as' | 'children' | 'disabled' | 'role' | 'style'
808
- > & {
809
- children: ReactNode;
810
- isDisabled?: boolean;
811
- };
812
-
813
781
  // @public (undocumented)
814
782
  type SafeCSSObject = CSSPseudos &
815
783
  CSSAtRules &
@@ -202,9 +202,6 @@ const backgroundColorMap: {
202
202
  readonly 'elevation.surface.sunken': "var(--ds-surface-sunken)";
203
203
  };
204
204
 
205
- // @public (undocumented)
206
- type BaseBoxProps<T extends ElementType> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className'> & BasePrimitiveProps & BaseBoxPropsFoundation<T> & ClassName;
207
-
208
205
  // @public (undocumented)
209
206
  type BaseBoxPropsFoundation<T extends ElementType> = {
210
207
  as?: T;
@@ -306,11 +303,6 @@ export type BoxProps<T extends ElementType> = Omit<ComponentPropsWithoutRef<T>,
306
303
  // @public
307
304
  export type Breakpoint = 'lg' | 'md' | 'sm' | 'xl' | 'xs' | 'xxs';
308
305
 
309
- // @public (undocumented)
310
- type ClassName = {
311
- className?: string;
312
- };
313
-
314
306
  // @public (undocumented)
315
307
  type CSSAtRules = {
316
308
  [AtRule in AtRulesWithoutMedia as `${AtRule}${string}`]?: Omit<SafeCSSObject, AtRulesWithoutMedia>;
@@ -537,18 +529,6 @@ export const media: {
537
529
  // @public
538
530
  type MediaQuery = (typeof media.above)[Breakpoint];
539
531
 
540
- // @public
541
- export const Pressable: PressableComponent;
542
-
543
- // @public (undocumented)
544
- type PressableComponent = (props: PressableProps, displayName: string) => ReactElement | null;
545
-
546
- // @public (undocumented)
547
- export type PressableProps = Omit<BaseBoxProps<'button'>, 'as' | 'children' | 'disabled' | 'role' | 'style'> & {
548
- children: ReactNode;
549
- isDisabled?: boolean;
550
- };
551
-
552
532
  // @public (undocumented)
553
533
  type SafeCSSObject = CSSPseudos & CSSAtRules & TokenisedProps & CSSMediaQueries & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
554
534