@atlaskit/primitives 1.0.4 → 1.0.6

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 (50) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/constellation/bleed/code.mdx +19 -0
  3. package/constellation/bleed/example.mdx +48 -0
  4. package/constellation/box/examples.mdx +6 -0
  5. package/constellation/flex/examples.mdx +7 -2
  6. package/constellation/grid/examples.mdx +3 -0
  7. package/constellation/inline/examples.mdx +6 -0
  8. package/constellation/overview/index.mdx +12 -15
  9. package/constellation/responsive/01-show/code.mdx +19 -0
  10. package/constellation/responsive/02-hide/code.mdx +19 -0
  11. package/constellation/stack/examples.mdx +5 -0
  12. package/dist/cjs/components/bleed.js +79 -0
  13. package/dist/cjs/components/flex.js +0 -1
  14. package/dist/cjs/components/grid.js +43 -2
  15. package/dist/cjs/components/inline.js +1 -2
  16. package/dist/cjs/index.js +7 -0
  17. package/dist/cjs/version.json +1 -1
  18. package/dist/es2019/components/bleed.js +72 -0
  19. package/dist/es2019/components/flex.js +0 -1
  20. package/dist/es2019/components/grid.js +43 -2
  21. package/dist/es2019/components/inline.js +1 -2
  22. package/dist/es2019/index.js +1 -0
  23. package/dist/es2019/responsive/build-media-query-css.js +1 -1
  24. package/dist/es2019/version.json +1 -1
  25. package/dist/esm/components/bleed.js +71 -0
  26. package/dist/esm/components/flex.js +0 -1
  27. package/dist/esm/components/grid.js +43 -2
  28. package/dist/esm/components/inline.js +1 -2
  29. package/dist/esm/index.js +1 -0
  30. package/dist/esm/version.json +1 -1
  31. package/dist/types/components/bleed.d.ts +36 -0
  32. package/dist/types/components/grid.d.ts +44 -3
  33. package/dist/types/components/inline.d.ts +1 -2
  34. package/dist/types/components/types.d.ts +4 -0
  35. package/dist/types/index.d.ts +16 -7
  36. package/dist/types/responsive/hide.d.ts +8 -10
  37. package/dist/types/responsive/show.d.ts +8 -10
  38. package/dist/types-ts4.5/components/bleed.d.ts +36 -0
  39. package/dist/types-ts4.5/components/grid.d.ts +44 -3
  40. package/dist/types-ts4.5/components/inline.d.ts +1 -2
  41. package/dist/types-ts4.5/components/types.d.ts +4 -0
  42. package/dist/types-ts4.5/index.d.ts +16 -7
  43. package/dist/types-ts4.5/responsive/hide.d.ts +8 -10
  44. package/dist/types-ts4.5/responsive/show.d.ts +8 -10
  45. package/extract-react-types/bleed-props.tsx +34 -0
  46. package/extract-react-types/hide-props.tsx +48 -0
  47. package/extract-react-types/show-props.tsx +48 -0
  48. package/package.json +11 -2
  49. package/report.api.md +72 -0
  50. package/tmp/api-report-tmp.d.ts +808 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 1.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`aa8ec75ace3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aa8ec75ace3) - Simplify types for `Show` and `Hide` components. There should be no difference in behavior.
8
+
9
+ ## 1.0.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`3fadbb8bf73`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fadbb8bf73) - Internal changes.
14
+
3
15
  ## 1.0.4
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,19 @@
1
+ ---
2
+ title: Bleed
3
+ description: Bleed is a primitive layout component that controls negative whitespace.
4
+ order: 1
5
+ ---
6
+
7
+ import { CodeDocsHeader } from '@af/design-system-docs-ui';
8
+
9
+ <CodeDocsHeader
10
+ name="@atlaskit/primitives"
11
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
12
+ directoryName="primitives"
13
+ />
14
+
15
+ import BleedProps from '!!extract-react-types-loader!../../extract-react-types/bleed-props'
16
+
17
+ ## Props
18
+
19
+ <PropsTable heading="" props={BleedProps} />
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: Bleed
3
+ description: Bleed is a primitive layout component that controls negative whitespace.
4
+ order: 0
5
+ ---
6
+
7
+ import BleedDefault from '../../examples/constellation/bleed/default';
8
+ import BleedBlock from '../../examples/constellation/bleed/block';
9
+ import BleedInline from '../../examples/constellation/bleed/inline';
10
+ import BleedAll from '../../examples/constellation/bleed/all';
11
+
12
+ import { CodeDocsHeader } from '@af/design-system-docs-ui';
13
+
14
+ <CodeDocsHeader
15
+ name="@atlaskit/primitives"
16
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
17
+ directoryName="primitives"
18
+ />
19
+
20
+ ## Using Bleed
21
+
22
+ Bleed is a component that allows its children to break the boundaries of its container. This is useful for content
23
+ that wants to negate the padding or whitespace applied by its parent in a controlled manner. For example in the below grid layout, the middle
24
+ item bleeds across the inline and block axes to overlap the gap set by the grid.
25
+
26
+ <Example Component={BleedAll} packageName="@atlaskit/primitives/bleed" />
27
+
28
+ ## Bleed and no bleed
29
+
30
+ Bleed might be utilised to create a stacking effect with a group of avatars. Here each avatar is laid out with the `Inline` parent
31
+ container. Without a bleed, each avatar would sit directly adjacent to its sibling. With `Bleed` we can negate the whitespace and force
32
+ each avatar to overlap its direct sibling and create our desired stack.
33
+
34
+ <Example Component={BleedDefault} packageName="@atlaskit/primitives/bleed" />
35
+
36
+ ## Block whitespace
37
+
38
+ Bleed can be controlled on the block axis (vertical) with the `block` property. The values of this property are tied to our spacing scale.
39
+ Note, in the context of a flex container bleed will collapse the whitespace around its child element.
40
+
41
+ <Example Component={BleedBlock} packageName="@atlaskit/primitives/bleed" />
42
+
43
+ ## Inline whitespace
44
+
45
+ Bleed can also be controlled on the inline axis (horizontal) with the `inline` property. The values of this property are tied to our spacing scale.
46
+ Note, in the context of a flex container bleed will collapse the whitespace around its child element.
47
+
48
+ <Example Component={BleedInline} packageName="@atlaskit/primitives/bleed" />
@@ -8,6 +8,8 @@ import BoxBasic from '../../examples/constellation/box/basic';
8
8
  import BoxPadding from '../../examples/constellation/box/padding';
9
9
  import BoxBackgroundColor from '../../examples/constellation/box/background-color';
10
10
  import BoxXcss from '../../examples/constellation/box/xcss';
11
+ import PracticalUseCase from '../../examples/constellation/box/practical-use-case';
12
+
11
13
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
12
14
 
13
15
  <CodeDocsHeader
@@ -43,3 +45,7 @@ Box also exposes an `xcss` prop. This prop can take `xcss` function calls that c
43
45
  <Example Component={BoxXcss} packageName="@atlaskit/primitives/box" />
44
46
 
45
47
  For more information on xCSS, see the dedicated [xCSS](/components/primitives/xcss) documentation.
48
+
49
+ ## Practical Use Case
50
+
51
+ <Example Component={PracticalUseCase} packageName="@atlaskit/primitives/box" />
@@ -21,11 +21,16 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
21
21
  ## Basic
22
22
 
23
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`.
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.
25
27
 
26
28
  <Example Component={FlexJustifyContent} packageName="@atlaskit/primitives/flex" />
27
29
 
28
- ## Align items
30
+ ## Align items and justify content
31
+
32
+ `Flex` applies the `alignItems` and `justifyContent` properties to align content
33
+ along its cross and main axes respectively.
29
34
 
30
35
  <Example Component={FlexAlignItems} packageName="@atlaskit/primitives/flex" />
31
36
 
@@ -44,3 +44,6 @@ Grid-prefixed properties in CSS do not have this prefix in the component API. `g
44
44
 
45
45
  <Example Component={GridAutoFlow} packageName="@atlaskit/primitives/grid" />
46
46
 
47
+ You may also be looking for:
48
+ * [responsive layout grid](/components/grid)
49
+ * [legacy page grid](/components/page/grid)
@@ -14,6 +14,7 @@ import InlineWrap from '../../examples/constellation/inline/wrap';
14
14
  import InlineSeparator from '../../examples/constellation/inline/separator';
15
15
  import InlineGrow from '../../examples/constellation/inline/grow';
16
16
  import InlineAs from '../../examples/constellation/inline/as';
17
+ import InlinePracticalUseCase from '../../examples/constellation/inline/practical-use-case';
17
18
 
18
19
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
19
20
 
@@ -23,6 +24,7 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
23
24
  directoryName="primitives"
24
25
  />
25
26
 
27
+
26
28
  ## Basic
27
29
 
28
30
  Inline is an abstraction to efficiently lay-out a group of elements horizontally.
@@ -89,3 +91,7 @@ To control that the `grow` prop can be used with the values:
89
91
  It's possible to control the rendered HTML element with the `as` prop.
90
92
 
91
93
  <Example Component={InlineAs} packageName="@atlaskit/primitives/inline" />
94
+
95
+ ## Practical Use Case
96
+
97
+ <Example Component={InlinePracticalUseCase} packageName="@atlaskit/primitives/inline" />
@@ -19,19 +19,18 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
19
19
  directoryName="primitives"
20
20
  />
21
21
 
22
- Primitive components are a new type of component for layouts and placement of elements.
23
- They act as building blocks to compose different parts of the user experience,
22
+ Primitives are a new type of component for layouts and the placement of elements.
23
+ They act as simple building blocks to compose different parts of the user experience,
24
24
  from the smallest design decisions (for example, the spacing around an icon) to larger layout decisions (for example, how a page is structured).
25
25
 
26
- Primitives are designed to work hand in hand with design tokens,
27
- to provide opinionated solutions for common low-level design decisions that engineers often have to make.
28
- They are designed to reduce cognitive overhead for engineers by providing guardrails around what is recommended within our design system.
29
-
30
- A primitive component is a pre-built solution in that they will only accept values that are valid in the Atlassian Design System, and help to implement common layout patterns. This reduces the need to look up documentation and write custom CSS.
26
+ Primitives are a combination of design tokens that go a step further.
27
+ These are component-like abstractions powered by design tokens that add a layer of ergonomics and accessibility. Tokens are great at describing the what of a design decision;
28
+ primitives make it easier to reason about the when and how. This reduces cognitive overhead and prevents accidents or mistakes.
31
29
 
32
30
  ## Available Primitives
33
31
 
34
- Each primitive is designed to have a single responsibility, and it should be immediately clear where each primitive should be used. However, they are also flexible enough that they should be able to be used to compose complex designs not otherwise covered in the Design Systems.
32
+ Each primitive is designed to have a single responsibility, and it should be immediately clear where and when each primitive should be used.
33
+ However, they are also flexible enough that they should be able to be used together to compose complex designs not otherwise implemented directly in the Design Systems.
35
34
 
36
35
  Currently, three core primitive components are available - Box, Inline and Stack. A large amount of layout problems can be reduced to laying out content:
37
36
  - in a container (see [box](/components/primitives/box))
@@ -41,7 +40,7 @@ Currently, three core primitive components are available - Box, Inline and Stack
41
40
  Additional layouts not well-expressed by these core primitives can also be composed using:
42
41
  - CSS Flexbox (see [flex](/components/primitives/flex))
43
42
  - CSS Grid (see [grid](/components/primitives/grid))
44
- - Divider (see [divider](/components/primitives/divider))
43
+ - Bleed (see [bleed](/components/primitives/bleed))
45
44
 
46
45
  ## Installation
47
46
 
@@ -52,15 +51,13 @@ $ yarn add @atlaskit/primitives
52
51
 
53
52
  ## Using Primitives
54
53
 
55
- Use primitives for general layout styles for components.
54
+ Use primitives for composing layouts.
56
55
  Primitives are not currently available in Figma, so the first step in implementing primitive components is identifying where they might fit in a given design.
57
56
  This involves breaking down a design into its core layout components to as granular level as is useful.
58
57
 
59
- <SectionMessage appearance="warning">
60
- Primitives should be avoided where absolute DOM control is required or very specific styling values are needed, however, this approach is more likely to produce visual elements that fail to adhere to the guidelines of the Atlassian Design System.
61
- </SectionMessage>
62
-
63
- You might like to think first about breaking down a page into `Box` containers, identifying larger pieces of a design that function in a similar manner or fulfill a singular purpose in a layout and grouping them together under a Box.
58
+ You might like to think first about breaking down a page into `Box` containers,
59
+ identifying larger pieces of a design that function in a similar manner or fulfill a singular purpose
60
+ in a layout and grouping them together under a Box.
64
61
 
65
62
  <Image src={boxUsageExample} />
66
63
 
@@ -0,0 +1,19 @@
1
+ ---
2
+ title: Show
3
+ description: Show is a responsive primitive that displays children at specified breakpoints
4
+ order: 2
5
+ ---
6
+
7
+ import { CodeDocsHeader } from '@af/design-system-docs-ui';
8
+
9
+ <CodeDocsHeader
10
+ name="@atlaskit/primitives"
11
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
12
+ directoryName="primitives"
13
+ />
14
+
15
+ import ShowProps from '!!extract-react-types-loader!../../../extract-react-types/show-props'
16
+
17
+ ## Props
18
+
19
+ <PropsTable heading="" props={ShowProps} />
@@ -0,0 +1,19 @@
1
+ ---
2
+ title: Hide
3
+ description: Hide is a responsive primitive that hides children at specified breakpoints
4
+ order: 2
5
+ ---
6
+
7
+ import { CodeDocsHeader } from '@af/design-system-docs-ui';
8
+
9
+ <CodeDocsHeader
10
+ name="@atlaskit/primitives"
11
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
12
+ directoryName="primitives"
13
+ />
14
+
15
+ import HideProps from '!!extract-react-types-loader!../../../extract-react-types/hide-props'
16
+
17
+ ## Props
18
+
19
+ <PropsTable heading="" props={HideProps} />
@@ -5,6 +5,7 @@ order: 0
5
5
  ---
6
6
 
7
7
  import StackBasic from '../../examples/constellation/stack/basic';
8
+ import PracticalUseCase from '../../examples/constellation/stack/practical-use-case';
8
9
  import StackSpaceBasic from '../../examples/constellation/stack/space-basic';
9
10
  import StackAlignBlock from '../../examples/constellation/stack/align-block';
10
11
  import StackAlignInline from '../../examples/constellation/stack/align-inline';
@@ -68,3 +69,7 @@ To control that the `grow` prop can be used with the values:
68
69
  It's possible to control the rendered HTML element with the `as` prop.
69
70
 
70
71
  <Example Component={StackAs} packageName="@atlaskit/primitives/stack" />
72
+
73
+ ## Practical Use Case
74
+
75
+ <Example Component={PracticalUseCase} packageName="@atlaskit/primitives/stack" />
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _react2 = require("@emotion/react");
9
+ var _xcss = require("../xcss/xcss");
10
+ /* eslint-disable @atlaskit/design-system/use-primitives */
11
+ /**
12
+ * @jsxRuntime classic
13
+ * @jsx jsx
14
+ */
15
+
16
+ var baseStyles = (0, _react2.css)({
17
+ boxSizing: 'border-box'
18
+ });
19
+ var blockBleedMap = {
20
+ 'space.025': (0, _react2.css)({
21
+ marginBlock: "calc(-1 * ".concat("var(--ds-space-050, 2px)", ")")
22
+ }),
23
+ 'space.050': (0, _react2.css)({
24
+ marginBlock: "calc(-1 * ".concat("var(--ds-space-050, 4px)", ")")
25
+ }),
26
+ 'space.100': (0, _react2.css)({
27
+ marginBlock: "calc(-1 * ".concat("var(--ds-space-100, 8px)", ")")
28
+ }),
29
+ 'space.200': (0, _react2.css)({
30
+ marginBlock: "calc(-1 * ".concat("var(--ds-space-200, 16px)", ")")
31
+ }),
32
+ 'space.150': (0, _react2.css)({
33
+ marginBlock: "calc(-1 * ".concat("var(--ds-space-150, 12px)", ")")
34
+ })
35
+ };
36
+ var inlineBleedMap = {
37
+ 'space.025': (0, _react2.css)({
38
+ marginInline: "calc(-1 * ".concat("var(--ds-space-025, 2px)", ")")
39
+ }),
40
+ 'space.050': (0, _react2.css)({
41
+ marginInline: "calc(-1 * ".concat("var(--ds-space-050, 4px)", ")")
42
+ }),
43
+ 'space.100': (0, _react2.css)({
44
+ marginInline: "calc(-1 * ".concat("var(--ds-space-100, 8px)", ")")
45
+ }),
46
+ 'space.200': (0, _react2.css)({
47
+ marginInline: "calc(-1 * ".concat("var(--ds-space-200, 16px)", ")")
48
+ }),
49
+ 'space.150': (0, _react2.css)({
50
+ marginInline: "calc(-1 * ".concat("var(--ds-space-150, 12px)", ")")
51
+ })
52
+ };
53
+
54
+ /**
55
+ * __Bleed__
56
+ *
57
+ * `Bleed` is a primitive layout component that controls negative whitespace.
58
+ *
59
+ * - [Examples](https://atlassian.design/components/primitives/bleed/examples)
60
+ * - [Code](https://atlassian.design/components/primitives/bleed/code)
61
+ */
62
+ var Bleed = /*#__PURE__*/(0, _react.memo)(function (_ref) {
63
+ var children = _ref.children,
64
+ testId = _ref.testId,
65
+ inline = _ref.inline,
66
+ block = _ref.block,
67
+ all = _ref.all,
68
+ xcss = _ref.xcss;
69
+ var xcssStyles = xcss && (0, _xcss.parseXcss)(xcss);
70
+ return (0, _react2.jsx)("div", {
71
+ css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all],
72
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
73
+ xcssStyles],
74
+ "data-testid": testId
75
+ }, children);
76
+ });
77
+ Bleed.displayName = 'Bleed';
78
+ var _default = Bleed;
79
+ exports.default = _default;
@@ -8,7 +8,6 @@ var _react = require("react");
8
8
  var _react2 = require("@emotion/react");
9
9
  var _styleMaps = require("../xcss/style-maps.partial");
10
10
  var _xcss = require("../xcss/xcss");
11
- /* eslint-disable @repo/internal/styles/no-exported-styles */
12
11
  /** @jsx jsx */
13
12
 
14
13
  var justifyContentMap = {
@@ -8,7 +8,6 @@ var _react = require("react");
8
8
  var _react2 = require("@emotion/react");
9
9
  var _styleMaps = require("../xcss/style-maps.partial");
10
10
  var _xcss = require("../xcss/xcss");
11
- /* eslint-disable @repo/internal/styles/no-exported-styles */
12
11
  /** @jsx jsx */
13
12
 
14
13
  var justifyContentMap = {
@@ -34,6 +33,43 @@ var justifyContentMap = {
34
33
  justifyContent: 'stretch'
35
34
  })
36
35
  };
36
+ var justifyItemsMap = {
37
+ start: (0, _react2.css)({
38
+ justifyItems: 'start'
39
+ }),
40
+ center: (0, _react2.css)({
41
+ justifyItems: 'center'
42
+ }),
43
+ end: (0, _react2.css)({
44
+ justifyItems: 'end'
45
+ }),
46
+ stretch: (0, _react2.css)({
47
+ justifyItems: 'stretch'
48
+ })
49
+ };
50
+ var alignContentMap = {
51
+ start: (0, _react2.css)({
52
+ alignContent: 'start'
53
+ }),
54
+ center: (0, _react2.css)({
55
+ alignContent: 'center'
56
+ }),
57
+ end: (0, _react2.css)({
58
+ alignContent: 'end'
59
+ }),
60
+ 'space-between': (0, _react2.css)({
61
+ alignContent: 'space-between'
62
+ }),
63
+ 'space-around': (0, _react2.css)({
64
+ alignContent: 'space-around'
65
+ }),
66
+ 'space-evenly': (0, _react2.css)({
67
+ alignContent: 'space-evenly'
68
+ }),
69
+ stretch: (0, _react2.css)({
70
+ alignContent: 'stretch'
71
+ })
72
+ };
37
73
  var alignItemsMap = {
38
74
  start: (0, _react2.css)({
39
75
  alignItems: 'start'
@@ -93,11 +129,14 @@ var gridAutoFlowMap = {
93
129
  var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
94
130
  var as = _ref.as,
95
131
  alignItems = _ref.alignItems,
132
+ alignContent = _ref.alignContent,
96
133
  justifyContent = _ref.justifyContent,
97
134
  gap = _ref.gap,
98
135
  columnGap = _ref.columnGap,
99
136
  rowGap = _ref.rowGap,
100
137
  children = _ref.children,
138
+ id = _ref.id,
139
+ role = _ref.role,
101
140
  testId = _ref.testId,
102
141
  autoFlow = _ref.autoFlow,
103
142
  gridTemplateAreas = _ref.templateAreas,
@@ -114,8 +153,10 @@ var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
114
153
  gridTemplateRows: gridTemplateRows
115
154
  }) : undefined;
116
155
  return (0, _react2.jsx)(Component, {
156
+ id: id,
157
+ role: role,
117
158
  style: style,
118
- css: [baseStyles, gap && _styleMaps.spaceStylesMap.gap[gap], columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap], rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
159
+ css: [baseStyles, gap && _styleMaps.spaceStylesMap.gap[gap], columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap], rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
119
160
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
120
161
  xcssClassName && xcssClassName],
121
162
  "data-testid": testId,
@@ -39,8 +39,7 @@ var Separator = function Separator(_ref) {
39
39
  /**
40
40
  * __Inline__
41
41
  *
42
- * Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
43
- *
42
+ * Inline is a primitive component based on CSS Flexbox that manages the horizontal layout of direct children.
44
43
  *
45
44
  * @example
46
45
  * ```tsx
package/dist/cjs/index.js CHANGED
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "Bleed", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _bleed.default;
11
+ }
12
+ });
7
13
  Object.defineProperty(exports, "Box", {
8
14
  enumerable: true,
9
15
  get: function get() {
@@ -71,4 +77,5 @@ var _xcss = require("./xcss/xcss");
71
77
  var _stack = _interopRequireDefault(require("./components/stack"));
72
78
  var _flex = _interopRequireDefault(require("./components/flex"));
73
79
  var _grid = _interopRequireDefault(require("./components/grid"));
80
+ var _bleed = _interopRequireDefault(require("./components/bleed"));
74
81
  var _responsive = require("./responsive");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,72 @@
1
+ /* eslint-disable @atlaskit/design-system/use-primitives */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+ import { memo } from 'react';
7
+ import { css, jsx } from '@emotion/react';
8
+ import { parseXcss } from '../xcss/xcss';
9
+ const baseStyles = css({
10
+ boxSizing: 'border-box'
11
+ });
12
+ const blockBleedMap = {
13
+ 'space.025': css({
14
+ marginBlock: `calc(-1 * ${"var(--ds-space-050, 2px)"})`
15
+ }),
16
+ 'space.050': css({
17
+ marginBlock: `calc(-1 * ${"var(--ds-space-050, 4px)"})`
18
+ }),
19
+ 'space.100': css({
20
+ marginBlock: `calc(-1 * ${"var(--ds-space-100, 8px)"})`
21
+ }),
22
+ 'space.200': css({
23
+ marginBlock: `calc(-1 * ${"var(--ds-space-200, 16px)"})`
24
+ }),
25
+ 'space.150': css({
26
+ marginBlock: `calc(-1 * ${"var(--ds-space-150, 12px)"})`
27
+ })
28
+ };
29
+ const inlineBleedMap = {
30
+ 'space.025': css({
31
+ marginInline: `calc(-1 * ${"var(--ds-space-025, 2px)"})`
32
+ }),
33
+ 'space.050': css({
34
+ marginInline: `calc(-1 * ${"var(--ds-space-050, 4px)"})`
35
+ }),
36
+ 'space.100': css({
37
+ marginInline: `calc(-1 * ${"var(--ds-space-100, 8px)"})`
38
+ }),
39
+ 'space.200': css({
40
+ marginInline: `calc(-1 * ${"var(--ds-space-200, 16px)"})`
41
+ }),
42
+ 'space.150': css({
43
+ marginInline: `calc(-1 * ${"var(--ds-space-150, 12px)"})`
44
+ })
45
+ };
46
+
47
+ /**
48
+ * __Bleed__
49
+ *
50
+ * `Bleed` is a primitive layout component that controls negative whitespace.
51
+ *
52
+ * - [Examples](https://atlassian.design/components/primitives/bleed/examples)
53
+ * - [Code](https://atlassian.design/components/primitives/bleed/code)
54
+ */
55
+ const Bleed = /*#__PURE__*/memo(({
56
+ children,
57
+ testId,
58
+ inline,
59
+ block,
60
+ all,
61
+ xcss
62
+ }) => {
63
+ const xcssStyles = xcss && parseXcss(xcss);
64
+ return jsx("div", {
65
+ css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all],
66
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
67
+ xcssStyles],
68
+ "data-testid": testId
69
+ }, children);
70
+ });
71
+ Bleed.displayName = 'Bleed';
72
+ export default Bleed;
@@ -1,4 +1,3 @@
1
- /* eslint-disable @repo/internal/styles/no-exported-styles */
2
1
  /** @jsx jsx */
3
2
  import { forwardRef, memo } from 'react';
4
3
  import { css, jsx } from '@emotion/react';
@@ -1,4 +1,3 @@
1
- /* eslint-disable @repo/internal/styles/no-exported-styles */
2
1
  /** @jsx jsx */
3
2
  import { forwardRef, memo } from 'react';
4
3
  import { css, jsx } from '@emotion/react';
@@ -27,6 +26,43 @@ const justifyContentMap = {
27
26
  justifyContent: 'stretch'
28
27
  })
29
28
  };
29
+ const justifyItemsMap = {
30
+ start: css({
31
+ justifyItems: 'start'
32
+ }),
33
+ center: css({
34
+ justifyItems: 'center'
35
+ }),
36
+ end: css({
37
+ justifyItems: 'end'
38
+ }),
39
+ stretch: css({
40
+ justifyItems: 'stretch'
41
+ })
42
+ };
43
+ const alignContentMap = {
44
+ start: css({
45
+ alignContent: 'start'
46
+ }),
47
+ center: css({
48
+ alignContent: 'center'
49
+ }),
50
+ end: css({
51
+ alignContent: 'end'
52
+ }),
53
+ 'space-between': css({
54
+ alignContent: 'space-between'
55
+ }),
56
+ 'space-around': css({
57
+ alignContent: 'space-around'
58
+ }),
59
+ 'space-evenly': css({
60
+ alignContent: 'space-evenly'
61
+ }),
62
+ stretch: css({
63
+ alignContent: 'stretch'
64
+ })
65
+ };
30
66
  const alignItemsMap = {
31
67
  start: css({
32
68
  alignItems: 'start'
@@ -86,11 +122,14 @@ const gridAutoFlowMap = {
86
122
  const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
87
123
  as,
88
124
  alignItems,
125
+ alignContent,
89
126
  justifyContent,
90
127
  gap,
91
128
  columnGap,
92
129
  rowGap,
93
130
  children,
131
+ id,
132
+ role,
94
133
  testId,
95
134
  autoFlow,
96
135
  templateAreas: gridTemplateAreas,
@@ -106,8 +145,10 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
106
145
  gridTemplateRows
107
146
  }) : undefined;
108
147
  return jsx(Component, {
148
+ id: id,
149
+ role: role,
109
150
  style: style,
110
- css: [baseStyles, gap && spaceStylesMap.gap[gap], columnGap && spaceStylesMap.columnGap[columnGap], rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
151
+ css: [baseStyles, gap && spaceStylesMap.gap[gap], columnGap && spaceStylesMap.columnGap[columnGap], rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
111
152
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
112
153
  xcssClassName && xcssClassName],
113
154
  "data-testid": testId,
@@ -29,8 +29,7 @@ const Separator = ({
29
29
  /**
30
30
  * __Inline__
31
31
  *
32
- * Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
33
- *
32
+ * Inline is a primitive component based on CSS Flexbox that manages the horizontal layout of direct children.
34
33
  *
35
34
  * @example
36
35
  * ```tsx
@@ -5,4 +5,5 @@ export { xcss } from './xcss/xcss';
5
5
  export { default as Stack } from './components/stack';
6
6
  export { default as Flex } from './components/flex';
7
7
  export { default as Grid } from './components/grid';
8
+ export { default as Bleed } from './components/bleed';
8
9
  export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
@@ -67,7 +67,7 @@ export const UNSAFE_buildBelowMediaQueryCSS = input => {
67
67
  return {
68
68
  ...acc,
69
69
  [breakpoint]: css({
70
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
70
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
71
71
  [UNSAFE_media.below[breakpoint]]: typeof input === 'function' ? input(breakpoint) : input
72
72
  })
73
73
  };