@atlaskit/primitives 6.5.0 → 7.0.1

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 (79) hide show
  1. package/.eslintrc.js +1 -1
  2. package/CHANGELOG.md +28 -1
  3. package/LICENSE.md +6 -8
  4. package/constellation/anchor/code.mdx +3 -3
  5. package/constellation/anchor/examples.mdx +34 -40
  6. package/constellation/anchor/usage.mdx +76 -35
  7. package/constellation/bleed/code.mdx +3 -3
  8. package/constellation/bleed/examples.mdx +17 -13
  9. package/constellation/box/code.mdx +3 -3
  10. package/constellation/box/examples.mdx +25 -19
  11. package/constellation/box/usage.mdx +15 -5
  12. package/constellation/flex/code.mdx +3 -3
  13. package/constellation/flex/examples.mdx +12 -11
  14. package/constellation/grid/code.mdx +3 -3
  15. package/constellation/grid/examples.mdx +15 -10
  16. package/constellation/inline/code.mdx +3 -3
  17. package/constellation/inline/examples.mdx +32 -38
  18. package/constellation/inline/usage.mdx +15 -6
  19. package/constellation/overview/index.mdx +29 -27
  20. package/constellation/pressable/code.mdx +5 -4
  21. package/constellation/pressable/examples.mdx +35 -52
  22. package/constellation/pressable/usage.mdx +50 -29
  23. package/constellation/responsive/01-show/code.mdx +3 -3
  24. package/constellation/responsive/01-show/examples.mdx +9 -13
  25. package/constellation/responsive/02-hide/code.mdx +3 -3
  26. package/constellation/responsive/02-hide/examples.mdx +9 -13
  27. package/constellation/responsive/03-breakpoints/examples.mdx +3 -3
  28. package/constellation/responsive/examples.mdx +10 -10
  29. package/constellation/responsive/usage.mdx +23 -15
  30. package/constellation/stack/code.mdx +3 -3
  31. package/constellation/stack/examples.mdx +26 -20
  32. package/constellation/stack/usage.mdx +13 -5
  33. package/constellation/text/code.mdx +3 -3
  34. package/constellation/text/examples.mdx +29 -15
  35. package/constellation/text/usage.mdx +6 -3
  36. package/constellation/xcss/examples.mdx +7 -5
  37. package/constellation/xcss/migration.mdx +32 -25
  38. package/constellation/xcss/usage.mdx +72 -60
  39. package/dist/cjs/components/anchor.js +1 -1
  40. package/dist/cjs/components/pressable.js +1 -1
  41. package/dist/cjs/xcss/style-maps.partial.js +13 -13
  42. package/dist/cjs/xcss/xcss.js +1 -1
  43. package/dist/es2019/components/anchor.js +1 -1
  44. package/dist/es2019/components/pressable.js +1 -1
  45. package/dist/es2019/xcss/style-maps.partial.js +13 -13
  46. package/dist/es2019/xcss/xcss.js +1 -1
  47. package/dist/esm/components/anchor.js +1 -1
  48. package/dist/esm/components/pressable.js +1 -1
  49. package/dist/esm/xcss/style-maps.partial.js +13 -13
  50. package/dist/esm/xcss/xcss.js +1 -1
  51. package/dist/types/responsive/index.d.ts +2 -2
  52. package/dist/types/xcss/style-maps.partial.d.ts +13 -13
  53. package/dist/types/xcss/xcss.d.ts +1 -1
  54. package/dist/types-ts4.5/responsive/index.d.ts +2 -2
  55. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +13 -13
  56. package/dist/types-ts4.5/xcss/xcss.d.ts +1 -1
  57. package/extract-react-types/anchor-props.tsx +108 -117
  58. package/extract-react-types/bleed-props.tsx +17 -22
  59. package/extract-react-types/box-props.tsx +67 -70
  60. package/extract-react-types/flex-props.tsx +61 -61
  61. package/extract-react-types/grid-props.tsx +92 -92
  62. package/extract-react-types/hide-props.tsx +35 -35
  63. package/extract-react-types/inline-props.tsx +68 -68
  64. package/extract-react-types/pressable-props.tsx +101 -107
  65. package/extract-react-types/show-props.tsx +35 -35
  66. package/extract-react-types/stack-props.tsx +55 -55
  67. package/package.json +2 -2
  68. package/report.api.md +940 -965
  69. package/scripts/border-codegen-template.tsx +40 -47
  70. package/scripts/codegen-file-templates/dimensions.tsx +8 -8
  71. package/scripts/codegen-file-templates/layer.tsx +9 -9
  72. package/scripts/codegen-styles.tsx +97 -103
  73. package/scripts/color-codegen-template.tsx +61 -73
  74. package/scripts/elevation-codegen-template.tsx +50 -62
  75. package/scripts/inverse-color-map-template.tsx +26 -31
  76. package/scripts/misc-codegen-template.tsx +4 -9
  77. package/scripts/spacing-codegen-template.tsx +25 -31
  78. package/scripts/typography-codegen-template.tsx +59 -65
  79. package/scripts/utils.tsx +36 -43
package/.eslintrc.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- ignorePatterns: ['./scripts/codegen-file-templates/*'],
2
+ ignorePatterns: ['./scripts/codegen-file-templates/*'],
3
3
  };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 7.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#110191](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110191)
8
+ [`c3dc02298f8aa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c3dc02298f8aa) -
9
+ [ux] Change heading xsmall lineheight from 16 to 20 for minor third theme.
10
+ - Updated dependencies
11
+
12
+ ## 7.0.0
13
+
14
+ ### Major Changes
15
+
16
+ - [#108387](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108387)
17
+ [`0f3b7b4c63c6d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0f3b7b4c63c6d) -
18
+ `xcss`: Restrict valid chained pseudo-selectors a limited subset:
19
+
20
+ - `:visited:active`
21
+ - `:active:visited`
22
+ - `:hover::before`
23
+ - `:hover::after`
24
+ - `:focus-visible::before`
25
+ - `:focus-visible::after`
26
+
27
+ Previously, any combination of two pseudo-selectors was allowed. This decision was made to improve
28
+ performance for TypeScript compilation and IDE type hinting.
29
+
3
30
  ## 6.5.0
4
31
 
5
32
  ### Minor Changes
@@ -80,7 +107,7 @@
80
107
 
81
108
  - [#93706](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93706)
82
109
  [`2e4fdfa436da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2e4fdfa436da) -
83
- Add support for React 18.
110
+ Add support for React 18 in non-strict mode.
84
111
 
85
112
  ## 5.6.1
86
113
 
package/LICENSE.md CHANGED
@@ -1,13 +1,11 @@
1
1
  Copyright 2022 Atlassian Pty Ltd
2
2
 
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
4
+ compliance with the License. You may obtain a copy of the License at
6
5
 
7
6
  http://www.apache.org/licenses/LICENSE-2.0
8
7
 
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
8
+ Unless required by applicable law or agreed to in writing, software distributed under the License is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10
+ implied. See the License for the specific language governing permissions and limitations under the
11
+ License.
@@ -7,9 +7,9 @@ order: 1
7
7
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
8
8
 
9
9
  <CodeDocsHeader
10
- name="@atlaskit/primitives"
11
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
12
- directoryName="primitives"
10
+ name="@atlaskit/primitives"
11
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
12
+ directoryName="primitives"
13
13
  />
14
14
 
15
15
  import ERTAnchor from '!!extract-react-types-loader!../../extract-react-types/anchor-props';
@@ -17,26 +17,31 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
17
17
  import SectionMessage from '@atlaskit/section-message';
18
18
 
19
19
  <CodeDocsHeader
20
- name="@atlaskit/primitives"
21
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
22
- directoryName="primitives"
20
+ name="@atlaskit/primitives"
21
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
22
+ directoryName="primitives"
23
23
  />
24
24
 
25
- Anchor is a primitive used for building custom links with Atlassian Design System styling, routing support, and built-in event tracking. Ultimately it renders an anchor `<a>` element.
25
+ Anchor is a primitive for building custom links with Atlassian Design System styling, routing
26
+ support, and built-in event tracking. It renders an anchor `<a>` element.
26
27
 
27
- Only use anchor when existing components such as [link](/components/link/examples) or [link button](/components/button/link-button/examples) are unsuitable and unable to be customized to fit your needs.
28
+ Only use anchor when existing components such as [link](/components/link/examples) or
29
+ [link button](/components/button/link-button/examples) can't be customized to fit your needs.
28
30
 
29
31
  ## Default
30
32
 
31
- Anchor is unstyled besides a default underline. If you are using the [CSS reset](/components/css-reset/examples), it will also inherit some global styles.
33
+ Anchor is unstyled besides a default underline and consistent Atlassian Design System `:focus`
34
+ styles.
35
+
36
+ If you are using the [CSS reset](/components/css-reset/examples), anchor will also inherit some
37
+ global styles.
32
38
 
33
39
  <Example Component={AnchorDefault} packageName="@atlaskit/primitives/anchor" />
34
40
 
35
41
  ## Basic styling with XCSS
36
42
 
37
- Anchor can be styled using XCSS. It includes consistent Atlassian Design System `:focus` styles, so it's unnecessary to add your own.
38
-
39
- For more information on XCSS, see the [XCSS documentation](/components/primitives/xcss).
43
+ Anchor can be styled further using the design system styling API,
44
+ [XCSS](/components/primitives/xcss).
40
45
 
41
46
  <Example Component={AnchorBasic} packageName="@atlaskit/primitives/anchor" />
42
47
 
@@ -48,20 +53,24 @@ Use a combination of XCSS and other primitives for more complex designs.
48
53
 
49
54
  ## HTML attributes
50
55
 
51
- Anchor passes through all valid HTML attributes to the underlying `<a>` element.
56
+ Anchor can pass all valid
57
+ [anchor HTML attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes),
58
+ such as `rel` or `download`, to the underlying `<a>` element.
52
59
 
53
- <Example
54
- Component={AnchorHtmlAttributes}
55
- packageName="@atlaskit/primitives/anchor"
56
- />
60
+ <Example Component={AnchorHtmlAttributes} packageName="@atlaskit/primitives/anchor" />
57
61
 
58
62
  ## Router links
59
63
 
60
- Routing libraries often supply their own link components enhanced with routing support. This can be configured in the [AppProvider context](/components/app-provider/examples#router-links), and anchor will automatically use it.
64
+ Routing libraries often supply link components enhanced with routing support. You can configure this
65
+ in the [AppProvider context](/components/app-provider/examples#router-links), and anchor will
66
+ automatically use it.
61
67
 
62
- This example shows a configuration for [React Resource Router](https://github.com/atlassian-labs/react-resource-router), however any routing library can be used.
68
+ This example shows a configuration for
69
+ [React Resource Router](https://github.com/atlassian-labs/react-resource-router), however any
70
+ routing library can be used.
63
71
 
64
- Using this method, anchor accepts `href` as a string for standard usage. For advanced usage, an object can be passed.
72
+ Using this method, anchor accepts `href` as a string for standard usage. For advanced usage, an
73
+ object can be passed.
65
74
 
66
75
  Anchor will only render a router link if:
67
76
 
@@ -70,34 +79,19 @@ Anchor will only render a router link if:
70
79
  - it's not a non-HTTP-based link (e.g. emails, phone numbers, hash links etc.).
71
80
 
72
81
  <Example
73
- Component={AnchorRouterLinkConfiguration}
74
- packageName="@atlaskit/primitives/anchor"
75
- appearance="source-only"
82
+ Component={AnchorRouterLinkConfiguration}
83
+ packageName="@atlaskit/primitives/anchor"
84
+ appearance="source-only"
76
85
  />
77
86
 
78
- <Snippet
79
- name="primitives-event-tracking-header"
80
- variables={{ componentName: 'anchor' }}
81
- />
87
+ <Snippet name="primitives-event-tracking-header" variables={{ componentName: 'anchor' }} />
82
88
 
83
- <Example
84
- Component={AnchorAnalytics}
85
- packageName="@atlaskit/primitives/anchor"
86
- />
89
+ <Example Component={AnchorAnalytics} packageName="@atlaskit/primitives/anchor" />
87
90
 
88
91
  <Snippet name="primitives-event-tracking-gasv3" />
89
92
 
90
- <Example
91
- Component={AnchorAnalyticsGASv3}
92
- packageName="@atlaskit/primitives/anchor"
93
- />
93
+ <Example Component={AnchorAnalyticsGASv3} packageName="@atlaskit/primitives/anchor" />
94
94
 
95
- <Snippet
96
- name="primitives-event-tracking-ufo"
97
- variables={{ componentName: 'anchor' }}
98
- />
95
+ <Snippet name="primitives-event-tracking-ufo" variables={{ componentName: 'anchor' }} />
99
96
 
100
- <Example
101
- Component={AnchorPressTracing}
102
- packageName="@atlaskit/primitives/anchor"
103
- />
97
+ <Example Component={AnchorPressTracing} packageName="@atlaskit/primitives/anchor" />
@@ -6,44 +6,77 @@ order: 2
6
6
 
7
7
  ## Usage
8
8
 
9
- Anchors help users navigate to another page or sections of a page. They can also download files or provide contact information such as phone numbers or email addresses.
9
+ Use an anchor to make elements that work like hyperlinks. Anchors can navigate to any linkable
10
+ location such as a web page, a location on a page, a file download, or a `mailto` email address.
10
11
 
11
- Anchor has consistent focus styles and analytics built in. It works with design tokens to make it easy to compose Atlassian-styled links that aren't possible using the [link component](/components/link/examples), [link buttons](/components/button/link-button/examples), or other existing design system components.
12
+ Anchor is based on the HTML `<a>` tag, but with Atlassian focus styles and analytics events built
13
+ in. You can customize the anchor's appearance further using our styling APIs.
12
14
 
13
- ## Use anchor when there aren't existing components that work for your experience
15
+ For example, an anchor could be used to make
16
+ [a link card](/components/primitives/anchor/examples#advanced-styling) with a larger clickable area
17
+ than a typical [link](/components/link/examples).
14
18
 
15
- Existing components such as the [link component](/components/link/examples) (for text-based links) should be used whenever possible for links to maintain visual consistency. Only use anchor when building custom links beyond the capabilities of the the link component.
19
+ ### Use links, link buttons, or other existing components where possible
16
20
 
17
- Do not use anchor to perform actions rather than navigation. Use the equivalent [pressable primitive](/components/primitives/pressable/examples) to build a custom button instead.
21
+ Anchor is meant for custom elements and styles that aren't possible using other components. For
22
+ standard links or buttons that navigate users to a new location, use
23
+ [link](/components/link/examples) or [link button](/components/button/link-button/examples).
18
24
 
19
- ## Accessibility
25
+ Using [existing components](/components) wherever possible makes Atlassian's UI more visually
26
+ consistent, and these components are faster to use for most basic use cases.
20
27
 
21
- ### Underline links unless other context already indicates it is a link
28
+ ## Accessibility
22
29
 
23
- Anchor has an underline by default but it can be disabled in some circumstances. Underlines help differentiate links from regular text and addresses a WCAG-A recommendation. Using color alone isn't accessible, especially if links are surrounded by other text.
30
+ ### Show what's clickable using underlines or other affordances
24
31
 
25
- Only remove underlines if the context surrounding the link makes it clear that it is interactive, such as in navigation. Anhor may also be used to create linkable areas such as a card, in which case the underline may be omitted.
32
+ Anchors have an underline by default. This helps differentiate links from regular text, which is an
33
+ accessibility requirement. Using color alone to differentiate links isn't accessible, especially if
34
+ links are surrounded by other text.
26
35
 
27
- Also, don't underline text that isn't a link. This makes the text look clickable because it looks a link.
36
+ Only remove underlines if the context surrounding the link makes it clear that it's interactive,
37
+ such as in navigation or a card layout.
28
38
 
29
- For more information see ['Understanding Use of Color (Level A)'](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html) and ['Failure of Success Criterion 1.4.1 due to creating links that are not visually evident without color vision'](https://www.w3.org/WAI/WCAG22/Techniques/failures/F73).
39
+ Also, don't underline text that isn't a link. This makes the text look clickable because it looks a
40
+ link.
30
41
 
31
42
  <!-- TODO: Add do/dont images once designed (if necessary?) -->
32
43
 
33
44
  <DoDont type="do">
34
- Use underlined links in body copy. Only omit an underline if the context makes
35
- it clear the link is selectable.
45
+ Use underlined links in body copy. Only omit an underline if the context makes it clear the link
46
+ is selectable.
36
47
  </DoDont>
37
48
 
38
49
  <DoDont type="dont">Use underlined links in navigation.</DoDont>
39
50
 
51
+ For more information see
52
+ ['Understanding Use of Color (Level A)'](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html)
53
+ and
54
+ ['Failure of Success Criterion 1.4.1 due to creating links that are not visually evident without color vision'](https://www.w3.org/WAI/WCAG22/Techniques/failures/F73).
55
+
56
+ ### Use anchor for links and navigation, not on-page actions
57
+
58
+ Anchors are for navigation and URL changes, while buttons are for on-page actions such as form
59
+ submissions or opening modals. These elements are treated differently by assistive technologies, so
60
+ avoid using one in place of the other.
61
+
62
+ Don't use anchor to make custom actions rather than navigation elements. To build a custom action or
63
+ button, use the [pressable primitive](/components/primitives/pressable/examples) instead.
64
+
65
+ More on
66
+ [when to use links vs buttons](/components/button/usage#use-buttons-for-actions-and-links-for-navigation).
67
+
40
68
  ### Use descriptive link text that clarifies the purpose of the link
41
69
 
42
- Don't link vague words or phrases like “here” or “learn more.” Make sure the linked text clearly describes the purpose of the link.
70
+ Don't link vague words or phrases like “here” or “learn more.” Make sure the linked text clearly
71
+ describes the purpose of the link for assistive technologies.
43
72
 
73
+ See [link content guidelines](/components/primitives/anchor/usage#content-guidelines) for details
74
+ and examples.
75
+
76
+ <!-- TODO: Crosslink updated link content guidance. Should be info in language and grammar and link component. (snippet time?) -->
44
77
  <!-- TODO: Add some Do/Don't images as examples -->
45
78
 
46
- <DoDont type="do">Clearly describe the purpose of the link.</DoDont>
79
+ <DoDont type="do">Link text that describes the purpose of the link.</DoDont>
47
80
 
48
81
  <DoDont type="dont">Link vague words or phrases.</DoDont>
49
82
 
@@ -56,45 +89,51 @@ It might make sense for a link to open in a new window if:
56
89
  - There's a risk of someone losing their current place or task
57
90
  - The link takes the person out of the current product or to an external website
58
91
 
59
- For more information see ['G200: Opening new windows and tabs from a link only when necessary'](https://www.w3.org/TR/WCAG20-TECHS/G200.html).
92
+ For more information see
93
+ ['G200: Opening new windows and tabs from a link only when necessary'](https://www.w3.org/TR/WCAG20-TECHS/G200.html).
60
94
 
61
95
  ### Keep links large enough to interact with
62
96
 
63
- Make link text size at least 12px. Smaller text is harder to read and interact with. If anchor is not used for text-based links, ensure the clickable area is at least 24 by 24 pixels for accessibility unless exempt from [Target Size (Minimum) (Level AA)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html).
64
-
65
- ## Best practices
66
-
67
- ### Don't confuse links and buttons
68
-
69
- Anchors are for navigation and URL changes, while buttons are for on-page actions such as form submissions or opening modals. These elements are treated differently by assistive technologies, so avoid using one in place of the other.
70
-
71
- More details on [when to use links and buttons](/components/button/usage#use-buttons-for-actions-and-links-for-navigation).
97
+ Make link text size at least 12px. Smaller text is harder to read and interact with. If anchor is
98
+ not used for text-based links, ensure the clickable area is at least 24 by 24 pixels for
99
+ accessibility unless exempt from
100
+ [Target Size (Minimum) (Level AA)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html).
72
101
 
73
102
  ## Content guidelines
74
103
 
75
104
  ### Use clear and unique link text
76
105
 
77
- Try not to repeat the same link text over and over on a page. Make sure link text is clear about where the link will go.
106
+ Try not to repeat the same link text over and over on a page. Make sure link text is clear about
107
+ where the link will go.
78
108
 
79
109
  ### Specify download links, including file type and size
80
110
 
81
- Always specify if a link triggers a download, and make the linked text clear about what exactly will be downloaded. Include file type and size as well.
111
+ Always specify if a link triggers a download, and make the linked text clear about what exactly will
112
+ be downloaded. Include file type and size as well.
113
+
114
+ <!-- TODO: add example of this -->
82
115
 
83
116
  ### Don't include unnecessary links
84
117
 
85
118
  Using too many links can overwhelm other, more important information on a page.
86
119
 
87
- Anchors take people to a new page or location. Be mindful of whether or not the linked resource is helpful or distracting to the current task.
120
+ Anchors take people to a new page or location. Be mindful of whether or not the linked resource is
121
+ helpful or distracting to the current task.
88
122
 
89
123
  ### Links in sentences or body copy
90
124
 
91
- Only link the words that are necessary to clarify where the link goes. Don't link the entire sentence. (Linking smaller phrases can be better for internationalization when sentence structures change across languages.)
125
+ Only link the words that are necessary to clarify where the link goes. Don't link the entire
126
+ sentence. (Linking smaller phrases can be better for internationalization when sentence structures
127
+ change across languages.)
92
128
 
93
- Only include the verb in the linked text if it better describes the purpose the link or differentiates it from other links and actions on the page.
129
+ Only include the verb in the linked text if it better describes the purpose the link or
130
+ differentiates it from other links and actions on the page.
94
131
 
95
132
  For example:
96
133
 
97
- > Update [Jira settings](/components/button/usage#use-buttons-for-actions-and-links-for-navigation) to turn off notifications. To upgrade, [sign up for Jira](/components/button/usage#use-buttons-for-actions-and-links-for-navigation).
134
+ > Update [Jira settings](/components/button/usage#use-buttons-for-actions-and-links-for-navigation)
135
+ > to turn off notifications. To upgrade,
136
+ > [sign up for Jira](/components/button/usage#use-buttons-for-actions-and-links-for-navigation).
98
137
 
99
138
  If only Jira was linked, it wouldn't be clear that this was a sign up page.
100
139
 
@@ -102,10 +141,12 @@ If only Jira was linked, it wouldn't be clear that this was a sign up page.
102
141
 
103
142
  For standalone links, link the whole phrase. Don't add punctuation.
104
143
 
105
- These type of links typically follow general button or other label content rules (sentence case capitalization, no punctuation, etc.)
144
+ These type of links typically follow general button or other label content rules (sentence case
145
+ capitalization, no punctuation, etc.)
106
146
 
107
147
  ## Related
108
148
 
109
- - [Counterpart pressable primitive for buttons](/components/primitives/button/usage)
110
- - Prefer to use existing components such as the [link component](/components/link/examples) or [link buttons](/components/button/link-button/examples)
111
- - Anchor is built on the same API as [box](/components/primitives/box/usage)
149
+ - Use existing components such as [link](/components/link/examples) or
150
+ [link button](/components/button/link-button/examples) wherever possible.
151
+ - Use [pressable primitive for custom buttons](/components/primitives/button/usage).
152
+ - Anchor is built on the same API as [box](/components/primitives/box/usage).
@@ -11,9 +11,9 @@ props:
11
11
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
12
12
 
13
13
  <CodeDocsHeader
14
- name="@atlaskit/primitives"
15
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
16
- directoryName="primitives"
14
+ name="@atlaskit/primitives"
15
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
16
+ directoryName="primitives"
17
17
  />
18
18
 
19
19
  ## Props
@@ -12,37 +12,41 @@ import BleedAll from '../../examples/constellation/bleed/all';
12
12
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
13
13
 
14
14
  <CodeDocsHeader
15
- name="@atlaskit/primitives"
16
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
17
- directoryName="primitives"
15
+ name="@atlaskit/primitives"
16
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
17
+ directoryName="primitives"
18
18
  />
19
19
 
20
20
  ## Using Bleed
21
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.
22
+ Bleed is a component that allows its children to break the boundaries of its container. This is
23
+ useful for content that wants to negate the padding or whitespace applied by its parent in a
24
+ controlled manner. For example in the below grid layout, the middle item bleeds across the inline
25
+ and block axes to overlap the gap set by the grid.
25
26
 
26
27
  <Example Component={BleedAll} packageName="@atlaskit/primitives/bleed" />
27
28
 
28
29
  ## Bleed and no bleed
29
30
 
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.
31
+ Bleed might be utilised to create a stacking effect with a group of avatars. Here each avatar is
32
+ laid out with the `Inline` parent container. Without a bleed, each avatar would sit directly
33
+ adjacent to its sibling. With `Bleed` we can negate the whitespace and force each avatar to overlap
34
+ its direct sibling and create our desired stack.
33
35
 
34
36
  <Example Component={BleedDefault} packageName="@atlaskit/primitives/bleed" />
35
37
 
36
38
  ## Block whitespace
37
39
 
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
+ Bleed can be controlled on the block axis (vertical) with the `block` property. The values of this
41
+ property are tied to our spacing scale. Note, in the context of a flex container bleed will collapse
42
+ the whitespace around its child element.
40
43
 
41
44
  <Example Component={BleedBlock} packageName="@atlaskit/primitives/bleed" />
42
45
 
43
46
  ## Inline whitespace
44
47
 
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.
48
+ Bleed can also be controlled on the inline axis (horizontal) with the `inline` property. The values
49
+ of this property are tied to our spacing scale. Note, in the context of a flex container bleed will
50
+ collapse the whitespace around its child element.
47
51
 
48
52
  <Example Component={BleedInline} packageName="@atlaskit/primitives/bleed" />
@@ -11,9 +11,9 @@ props:
11
11
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
12
12
 
13
13
  <CodeDocsHeader
14
- name="@atlaskit/primitives"
15
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
16
- directoryName="primitives"
14
+ name="@atlaskit/primitives"
15
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
16
+ directoryName="primitives"
17
17
  />
18
18
 
19
19
  ## Props
@@ -14,38 +14,44 @@ import BoxPracticalUseCase from '../../examples/constellation/box/practical-use-
14
14
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
15
15
 
16
16
  <CodeDocsHeader
17
- name="@atlaskit/primitives"
18
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
19
- directoryName="primitives"
17
+ name="@atlaskit/primitives"
18
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
19
+ directoryName="primitives"
20
20
  />
21
21
 
22
22
  ## Basic
23
23
 
24
- Box is a general-purpose container that allows for controlled use of design tokens. Use the given props to configure display behavior and styling that aligns with the Atlassian Design System.
25
- Use [XCSS](/components/primitives/xcss/usage) to style primitive components safely with tokens.
24
+ Box is a general-purpose container that allows for controlled use of design tokens. Use the given
25
+ props to configure display behavior and styling that aligns with the Atlassian Design System. Use
26
+ [XCSS](/components/primitives/xcss/usage) to style primitive components safely with tokens.
26
27
 
27
28
  <Example Component={BoxBasic} packageName="@atlaskit/primitives/box" />
28
29
 
29
30
  ## Padding
30
31
 
31
- Use padding props to access spacing design tokens and control internal layout. The following example demonstrates how each prop works with space tokens.
32
+ Use padding props to access spacing design tokens and control internal layout. The following example
33
+ demonstrates how each prop works with space tokens.
32
34
 
33
35
  <Example Component={BoxPadding} packageName="@atlaskit/primitives/box" />
34
36
 
35
- The nomenclature used by these props follows [logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties). This naming is used to support different [writing modes](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) in Atlassian products.
37
+ The nomenclature used by these props follows
38
+ [logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties). This
39
+ naming is used to support different
40
+ [writing modes](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) in Atlassian
41
+ products.
36
42
 
37
43
  ## Background color
38
44
 
39
- Box accepts a wide variety of background colors, referenced as semantic design tokens. For the full list of color tokens, visit the [token list](/components/tokens/all-tokens).
45
+ Box accepts a wide variety of background colors, referenced as semantic design tokens. For the full
46
+ list of color tokens, visit the [token list](/components/tokens/all-tokens).
40
47
 
41
- <Example
42
- Component={BoxBackgroundColor}
43
- packageName="@atlaskit/primitives/box"
44
- />
48
+ <Example Component={BoxBackgroundColor} packageName="@atlaskit/primitives/box" />
45
49
 
46
50
  ## XCSS
47
51
 
48
- Box exposes an `xcss` prop. This prop accepts `xcss` function calls that contain a subset of permitted styles. When used with `Box`, `xcss` accepts most CSS properties, and when a token exists, the rule accepts that token as a value.
52
+ Box exposes an `xcss` prop. This prop accepts `xcss` function calls that contain a subset of
53
+ permitted styles. When used with `Box`, `xcss` accepts most CSS properties, and when a token exists,
54
+ the rule accepts that token as a value.
49
55
 
50
56
  For more information on XCSS, see the dedicated [XCSS documentation](/components/primitives/xcss).
51
57
 
@@ -53,7 +59,8 @@ For more information on XCSS, see the dedicated [XCSS documentation](/components
53
59
 
54
60
  ## Conditional styles
55
61
 
56
- To achieve conditional styles, we suggest composing conditional styles via the `props.xcss` API rather than applying conditional behaviour to individual props.
62
+ To achieve conditional styles, we suggest composing conditional styles via the `props.xcss` API
63
+ rather than applying conditional behaviour to individual props.
57
64
 
58
65
  <Example Component={BoxConditional} packageName="@atlaskit/primitives/box" />
59
66
 
@@ -61,9 +68,8 @@ To achieve conditional styles, we suggest composing conditional styles via the `
61
68
 
62
69
  Box is designed to be composed with inline, stack, and other components to create layouts.
63
70
 
64
- Atlassian uses dozens of distinct card-like components across products. Therefore, rather than providing a strict component, the Atlassian Design System empowers and supports you to build your own card components in ways that are consistent and will scale over time.
71
+ Atlassian uses dozens of distinct card-like components across products. Therefore, rather than
72
+ providing a strict component, the Atlassian Design System empowers and supports you to build your
73
+ own card components in ways that are consistent and will scale over time.
65
74
 
66
- <Example
67
- Component={BoxPracticalUseCase}
68
- packageName="@atlaskit/primitives/box"
69
- />
75
+ <Example Component={BoxPracticalUseCase} packageName="@atlaskit/primitives/box" />
@@ -4,19 +4,29 @@ description: A box is a generic container that provides managed access to design
4
4
  order: 2
5
5
  ---
6
6
 
7
- A box is a generic container that provides convenient and managed access to design tokens, and built-in guidance for the best practices of the Atlassian Design System. Use box in conjunction with other layout components such as [inline](/components/primitives/inline/usage) and [stack](/components/primitives/stack/usage) to easily create customized layouts.
7
+ A box is a generic container that provides convenient and managed access to design tokens, and
8
+ built-in guidance for the best practices of the Atlassian Design System. Use box in conjunction with
9
+ other layout components such as [inline](/components/primitives/inline/usage) and
10
+ [stack](/components/primitives/stack/usage) to easily create customized layouts.
8
11
 
9
- Use a box to compose layouts and add styling to child elements through visual props, including spacing and color through design tokens.
12
+ Use a box to compose layouts and add styling to child elements through visual props, including
13
+ spacing and color through design tokens.
10
14
 
11
15
  ## Using box
12
16
 
13
- To identify usages of box in a given design, look for where a UI element will receive some visual styles applied to a container. Box can be used on a range of sizes of elements, from buttons to section wrappers.
17
+ To identify usages of box in a given design, look for where a UI element will receive some visual
18
+ styles applied to a container. Box can be used on a range of sizes of elements, from buttons to
19
+ section wrappers.
14
20
 
15
- Box, being generic in nature, can be "over-used", so it’s important to consider situations where more specific and expressive primitives could be used. For example, use [inline](/components/primitives/inline/usage) and [stack](/components/primitives/stack/usage) to manage horizontal and vertical layouts, respectively.
21
+ Box, being generic in nature, can be "over-used", so it’s important to consider situations where
22
+ more specific and expressive primitives could be used. For example, use
23
+ [inline](/components/primitives/inline/usage) and [stack](/components/primitives/stack/usage) to
24
+ manage horizontal and vertical layouts, respectively.
16
25
 
17
26
  ## Styling
18
27
 
19
- Display behavior is set by using the available props or using [XCSS](/components/primitives/xcss/usage). Makers can make design decisions for box by setting:
28
+ Display behavior is set by using the available props or using
29
+ [XCSS](/components/primitives/xcss/usage). Makers can make design decisions for box by setting:
20
30
 
21
31
  - `padding`
22
32
  - `paddingInline`
@@ -11,9 +11,9 @@ props:
11
11
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
12
12
 
13
13
  <CodeDocsHeader
14
- name="@atlaskit/primitives"
15
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
16
- directoryName="primitives"
14
+ name="@atlaskit/primitives"
15
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
16
+ directoryName="primitives"
17
17
  />
18
18
 
19
19
  ## Props