@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
@@ -9,40 +9,48 @@ import pressablePrimaryDont from './images/pressable-01b-dont.png';
9
9
 
10
10
  ## Usage
11
11
 
12
- Pressable is a button with consistent focus styles and analytics built in. Pressable works with design tokens to make it easy to compose Atlassian-styled clickable elements that aren't possible using existing [buttons](/components/button/examples), [menus](/components/menu/examples), or other existing design system components.
12
+ Pressable is a button with consistent focus styles and analytics built in. Pressable works with
13
+ design tokens to make it easy to compose Atlassian-styled clickable elements that aren't possible
14
+ using existing [buttons](/components/button/examples), [menus](/components/menu/examples), or other
15
+ existing design system components.
13
16
 
14
17
  ![Pressable anatomy](./images/pressable-anatomy.png)
15
18
 
16
- 1. **Pressable area:** For accessibility this should be a minimum of 24 by 24 pixels, unless exempt from [Target Size (Minimum) (Level AA)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html).
19
+ 1. **Pressable area:** For accessibility this should be a minimum of 24 by 24 pixels, unless exempt
20
+ from
21
+ [Target Size (Minimum) (Level AA)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html).
17
22
  2. **Focus ring**: This is included in pressable and appears on keyboard focus.
18
- 3. **Accessible label:** Pressable should always include a clear label for accessibility. Use this to communicate the action that occurs when the button is pressed.
23
+ 3. **Accessible label:** Pressable should always include a clear label for accessibility. Use this
24
+ to communicate the action that occurs when the button is pressed.
19
25
 
20
26
  ### Use pressable when there aren't existing components that work for your experience
21
27
 
22
- Only use pressable when existing components such as [the button component](/components/button/examples), menus, or other existing design system components can't be customized to fit your case. Using existing components with safe customizations will prevent inconsistency as Atlassian UI evolves.
28
+ Only use pressable when existing components such as
29
+ [the button component](/components/button/examples), menus, or other existing design system
30
+ components can't be customized to fit your case. Using existing components with safe customizations
31
+ will prevent inconsistency as Atlassian UI evolves.
23
32
 
24
33
  <DoDont
25
- type="do"
26
- image={{
27
- url: pressablePrimaryDo,
28
- alt: "A set of custom buttons built with pressable that aren't possible using existing design system components",
29
- }}
34
+ type="do"
35
+ image={{
36
+ url: pressablePrimaryDo,
37
+ alt: "A set of custom buttons built with pressable that aren't possible using existing design system components",
38
+ }}
30
39
  >
31
- Use pressable to create buttons when there isn't an existing design system
32
- component to achieve your use case.
40
+ Use pressable to create buttons when there isn't an existing design system component to achieve
41
+ your use case.
33
42
  </DoDont>
34
43
 
35
44
  <DoDont
36
- type="dont"
37
- image={{
38
- url: pressablePrimaryDont,
39
- alt: 'A custom button build with Pressable that looks similar to Button, an existing design system component',
40
- }}
45
+ type="dont"
46
+ image={{
47
+ url: pressablePrimaryDont,
48
+ alt: 'A custom button build with Pressable that looks similar to Button, an existing design system component',
49
+ }}
41
50
  >
42
- Don't use pressable in place of an element that already has a design system
43
- representation, such as{' '}
44
- <a href="/components/button/examples">the button component</a>. This can cause
45
- visual and behavioral inconsistencies in Atlassian products.
51
+ Don't use pressable in place of an element that already has a design system representation, such
52
+ as <a href="/components/button/examples">the button component</a>. This can cause visual and
53
+ behavioral inconsistencies in Atlassian products.
46
54
  </DoDont>
47
55
 
48
56
  ## Accessibility
@@ -55,35 +63,45 @@ Pressable should always announce what action will happen once pressed.
55
63
 
56
64
  #### When no visible label is present
57
65
 
58
- - Ensure an accessible label is still available by using [the visually hidden component](/components/visually-hidden/examples) which will render hidden text inside the button. This is preferable over the `aria-label` attribute because not all screen readers translate this between languages.
66
+ - Ensure an accessible label is still available by using
67
+ [the visually hidden component](/components/visually-hidden/examples) which will render hidden
68
+ text inside the button. This is preferable over the `aria-label` attribute because not all screen
69
+ readers translate this between languages.
59
70
  - Use [a tooltip](/components/tooltip/examples) to provide sighted users with the same information.
60
71
 
61
72
  ### Focus ring behavior
62
73
 
63
- Pressable creates buttons that are available in focus order, and provides a visual ring to clarify what is in focus. Adding additional focus styles is unnecessary.
74
+ Pressable creates buttons that are available in focus order, and provides a visual ring to clarify
75
+ what is in focus. Adding additional focus styles is unnecessary.
64
76
 
65
77
  ### Avoid disabling buttons
66
78
 
67
- Disabled buttons can cause accessibility problems. Avoid disabling buttons and [follow our disabled and tooltip button guidance](/components/button/usage#avoid-disabling-buttons).
79
+ Disabled buttons can cause accessibility problems. Avoid disabling buttons and
80
+ [follow our disabled and tooltip button guidance](/components/button/usage#avoid-disabling-buttons).
68
81
 
69
82
  ## Best practices
70
83
 
71
84
  ### Make it clear what can be pressed
72
85
 
73
- Custom buttons should be obviously interactable. Make sure they are clearly identifiable through styles, surrounding context, labels, or other cues.
86
+ Custom buttons should be obviously interactable. Make sure they are clearly identifiable through
87
+ styles, surrounding context, labels, or other cues.
74
88
 
75
89
  ### Don't use pressable for navigation
76
90
 
77
- Pressable is meant for on-page actions such as opening modals, or submitting forms. If you're making something that navigates to a new page, use a component that renders a semantically correct HTML `<a>` element such as:
91
+ Pressable is meant for on-page actions such as opening modals, or submitting forms. If you're making
92
+ something that navigates to a new page, use a component that renders a semantically correct HTML
93
+ `<a>` element such as:
78
94
 
79
95
  - The [link](/components/primitives/link/examples) component (coming soon) for standard text links.
80
- - The [anchor](/components/primitives/anchor/examples) primitive (coming soon) to create custom links.
96
+ - The [anchor](/components/primitives/anchor/examples) primitive (coming soon) to create custom
97
+ links.
81
98
 
82
99
  ## Content guidelines
83
100
 
84
101
  ### Use sentence case capitalization
85
102
 
86
- Use sentence case capitalization, only capitalizing the first letter of the label and any proper nouns. Other forms of capitalization should be only applied through styling with `text-transform`.
103
+ Use sentence case capitalization, only capitalizing the first letter of the label and any proper
104
+ nouns. Other forms of capitalization should be only applied through styling with `text-transform`.
87
105
 
88
106
  ### Make it clear what pressing the button does
89
107
 
@@ -93,10 +111,13 @@ For example, _Change issue color to yellow_ instead of _yellow_.
93
111
 
94
112
  ### Follow other label and UI content guidance
95
113
 
96
- Follow label and content guidelines for [buttons](/components/button/usage#content-guidelines). Review our [general UI text guidance](/foundations/accessibility/#meaningful-text) for specific question.
114
+ Follow label and content guidelines for [buttons](/components/button/usage#content-guidelines).
115
+ Review our [general UI text guidance](/foundations/accessibility/#meaningful-text) for specific
116
+ question.
97
117
 
98
118
  ## Related
99
119
 
100
120
  - [Counterpart anchor primitive for links](/components/primitives/button/usage)
101
- - Prefer to use existing components such as [buttons](/components/button/examples) or [menus](/components/menu/examples) for most actions in Atlassian products
121
+ - Prefer to use existing components such as [buttons](/components/button/examples) or
122
+ [menus](/components/menu/examples) for most actions in Atlassian products
102
123
  - Pressable is built on the same API as [box](/components/primitives/box/usage)
@@ -7,9 +7,9 @@ order: 2
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 ShowProps from '!!extract-react-types-loader!../../../extract-react-types/show-props';
@@ -10,27 +10,23 @@ import ShowHideExample from '../../../examples/constellation/responsive/show-hid
10
10
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
11
11
 
12
12
  <CodeDocsHeader
13
- name="@atlaskit/primitives"
14
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
15
- directoryName="primitives"
13
+ name="@atlaskit/primitives"
14
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
15
+ directoryName="primitives"
16
16
  />
17
17
 
18
18
  ### Show
19
19
 
20
- 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.
20
+ Using `Show` allows you to show the children using CSS `display: …` when the viewport size is above
21
+ a specified breakpoint. By default, unless the breakpoint is met, contents are hidden.
21
22
 
22
- 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.
23
+ Children that are not shown are still rendered into the DOM, so there so there is typically little
24
+ performance savings — primarily that they are not painted.
23
25
 
24
- <Example
25
- Component={ShowExample}
26
- packageName="@atlaskit/primitives/responsive"
27
- />
26
+ <Example Component={ShowExample} packageName="@atlaskit/primitives/responsive" />
28
27
 
29
28
  ### Mixing Show and Hide
30
29
 
31
30
  Prefer using consistent `above` or `below` for readability and consistency.
32
31
 
33
- <Example
34
- Component={ShowHideExample}
35
- packageName="@atlaskit/primitives/responsive"
36
- />
32
+ <Example Component={ShowHideExample} packageName="@atlaskit/primitives/responsive" />
@@ -7,9 +7,9 @@ order: 2
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 HideProps from '!!extract-react-types-loader!../../../extract-react-types/hide-props';
@@ -10,27 +10,23 @@ import ShowHideExample from '../../../examples/constellation/responsive/show-hid
10
10
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
11
11
 
12
12
  <CodeDocsHeader
13
- name="@atlaskit/primitives"
14
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
15
- directoryName="primitives"
13
+ name="@atlaskit/primitives"
14
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
15
+ directoryName="primitives"
16
16
  />
17
17
 
18
18
  ### Hide
19
19
 
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.
20
+ Using Hide allows you to Hide the children using CSS `display: none` when the viewport size is above
21
+ a specified breakpoint. By default, unless the breakpoint is met, contents are hidden.
21
22
 
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
+ Children that are hidden are still rendered into the DOM, so there so there is typically little
24
+ performance savings — primarily that they are not painted.
23
25
 
24
- <Example
25
- Component={HideExample}
26
- packageName="@atlaskit/primitives/responsive"
27
- />
26
+ <Example Component={HideExample} packageName="@atlaskit/primitives/responsive" />
28
27
 
29
28
  ### Mixing Show and Hide
30
29
 
31
30
  Prefer using consistent `above` or `below` for readability and consistency.
32
31
 
33
- <Example
34
- Component={ShowHideExample}
35
- packageName="@atlaskit/primitives/responsive"
36
- />
32
+ <Example Component={ShowHideExample} packageName="@atlaskit/primitives/responsive" />
@@ -9,9 +9,9 @@ import { MediaQueriesTable } from '@af/design-system-docs-ui';
9
9
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
10
10
 
11
11
  <CodeDocsHeader
12
- name="@atlaskit/primitives"
13
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
14
- directoryName="primitives"
12
+ name="@atlaskit/primitives"
13
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
14
+ directoryName="primitives"
15
15
  />
16
16
 
17
17
  ### Media Queries
@@ -13,23 +13,22 @@ import ShowHideExample from '../../examples/constellation/responsive/show-hide';
13
13
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
14
14
 
15
15
  <CodeDocsHeader
16
- name="@atlaskit/primitives"
17
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
18
- directoryName="primitives"
16
+ name="@atlaskit/primitives"
17
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
18
+ directoryName="primitives"
19
19
  />
20
20
 
21
21
  ## Responsive `css` or `xcss`
22
22
 
23
- Utilize our media queries exposed in `css`, `styled`, or `xcss` as computed keys to build responsive UIs. Learn more about these media query exports in [usage](/components/primitives/responsive/usage).
23
+ Utilize our media queries exposed in `css`, `styled`, or `xcss` as computed keys to build responsive
24
+ UIs. Learn more about these media query exports in [usage](/components/primitives/responsive/usage).
24
25
 
25
26
  ### Using with `xcss`
26
27
 
27
- Please use `xcss` whenever possible to ensure consistency and safety with style overrides. Read more at [xcss](/components/primitives/xcss)
28
+ Please use `xcss` whenever possible to ensure consistency and safety with style overrides. Read more
29
+ at [xcss](/components/primitives/xcss)
28
30
 
29
- <Example
30
- Component={XCSSExample}
31
- packageName="@atlaskit/primitives/responsive"
32
- />
31
+ <Example Component={XCSSExample} packageName="@atlaskit/primitives/responsive" />
33
32
 
34
33
  ### Using with `css`
35
34
 
@@ -37,7 +36,8 @@ Please use `xcss` whenever possible to ensure consistency and safety with style
37
36
 
38
37
  ## Responsive primitives
39
38
 
40
- Consider these shortcuts to writing your own custom media queries. Composing with our primitives will be far quicker and consistent to implement, but may result in excess DOM nodes.
39
+ Consider these shortcuts to writing your own custom media queries. Composing with our primitives
40
+ will be far quicker and consistent to implement, but may result in excess DOM nodes.
41
41
 
42
42
  - [Show](/components/primitives/responsive/show)
43
43
  - [Hide](/components/primitives/responsive/hide)
@@ -6,26 +6,32 @@ order: 2
6
6
 
7
7
  ## Media query helpers
8
8
 
9
- The media query helper object `media.above[breakpoint]` maps to our [breakpoints](/components/primitives/responsive/breakpoints/examples) 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
9
+ The media query helper object `media.above[breakpoint]` maps to our
10
+ [breakpoints](/components/primitives/responsive/breakpoints/examples) as a media query for use in
11
+ CSS-in-JS. `media.above[breakpoint]` targets all viewports **above** (larger than) the min-width of
12
+ a given breakpoint
10
13
 
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.
14
+ These responsive helpers are designed be used in conjunction with
15
+ [xcss](/components/primitives/xcss). It is recommended that both are used when available as this
16
+ uses our media queries to allow for safe, responsive styling.
12
17
 
13
18
  ### Basic example
14
19
 
15
- Compose your default styles alongside media overrides in [xcss](/components/primitives/xcss) or `css`.
20
+ Compose your default styles alongside media overrides in [xcss](/components/primitives/xcss) or
21
+ `css`.
16
22
 
17
23
  #### xcss
18
24
 
19
25
  ```tsx
20
26
  const customStyles = xcss({
21
- display: 'none', // hide by default
22
- padding: 'space.100',
23
- [media.above.md]: { display: 'revert' }, // show above md
24
- [media.above.lg]: { padding: 'space.150' }, // increase padding above md
27
+ display: 'none', // hide by default
28
+ padding: 'space.100',
29
+ [media.above.md]: { display: 'revert' }, // show above md
30
+ [media.above.lg]: { padding: 'space.150' }, // increase padding above md
25
31
  });
26
32
 
27
33
  export const Component = ({ children }: { children: ReactNode }) => (
28
- <Box xcss={customStyles}>{children}</Box>
34
+ <Box xcss={customStyles}>{children}</Box>
29
35
  );
30
36
  ```
31
37
 
@@ -33,15 +39,17 @@ export const Component = ({ children }: { children: ReactNode }) => (
33
39
 
34
40
  ```tsx
35
41
  const customStyles = css({
36
- marginBlock: token('space.0'),
37
- [media.above.xs]: { marginBlock: token('space.025') },
38
- [media.above.sm]: { marginBlock: token('space.050') },
39
- [media.above.md]: { marginBlock: token('space.075') },
40
- [media.above.lg]: { marginBlock: token('space.100') },
41
- [media.above.xl]: { marginBlock: token('space.150') },
42
+ marginBlock: token('space.0'),
43
+ [media.above.xs]: { marginBlock: token('space.025') },
44
+ [media.above.sm]: { marginBlock: token('space.050') },
45
+ [media.above.md]: { marginBlock: token('space.075') },
46
+ [media.above.lg]: { marginBlock: token('space.100') },
47
+ [media.above.xl]: { marginBlock: token('space.150') },
42
48
  });
43
49
  ```
44
50
 
45
51
  ### Using media.above
46
52
 
47
- It is important to note that the `media.above.xxs` will **always** match, it is explicitly `'@media all'`. This is only included for easy programmatic usage, but it has a negative performance impact.
53
+ It is important to note that the `media.above.xxs` will **always** match, it is explicitly
54
+ `'@media all'`. This is only included for easy programmatic usage, but it has a negative performance
55
+ impact.
@@ -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
@@ -16,16 +16,17 @@ import StackAs from '../../examples/constellation/stack/as';
16
16
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
17
17
 
18
18
  <CodeDocsHeader
19
- name="@atlaskit/primitives"
20
- repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
21
- directoryName="primitives"
19
+ name="@atlaskit/primitives"
20
+ repository="https://bitbucket.org/atlassian/atlassian-frontend-mirror"
21
+ directoryName="primitives"
22
22
  />
23
23
 
24
24
  ## Basic
25
25
 
26
26
  Use a stack component to efficiently lay-out a group of elements vertically.
27
27
 
28
- Use the given props to configure display behavior using designs tokens, as shown in the more complex examples below.
28
+ Use the given props to configure display behavior using designs tokens, as shown in the more complex
29
+ examples below.
29
30
 
30
31
  <Example Component={StackBasic} packageName="@atlaskit/primitives/stack" />
31
32
 
@@ -37,17 +38,25 @@ Control spacing between items with the `space` prop.
37
38
 
38
39
  ## Reverse content
39
40
 
40
- `flex-direction: `column-reverse` is a pattern that has [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction#accessibility_concerns) so stack doesn't support it.
41
+ `flex-direction: `column-reverse` is a pattern that has
42
+ [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction#accessibility_concerns)
43
+ so stack doesn't support it.
41
44
 
42
- If reversing content is required, we generally recommend to use JavaScript to reverse the JSX content thereby preserving the tabbing order.
45
+ If reversing content is required, we generally recommend to use JavaScript to reverse the JSX
46
+ content thereby preserving the tabbing order.
43
47
 
44
- In situations where tabbing order changes based on different breakpoints, then we have [show](/components/primitives/responsive/show/examples) and [hide](/components/primitives/responsive/hide/examples) components that enable switching between different orderings of content.
48
+ In situations where tabbing order changes based on different breakpoints, then we have
49
+ [show](/components/primitives/responsive/show/examples) and
50
+ [hide](/components/primitives/responsive/hide/examples) components that enable switching between
51
+ different orderings of content.
45
52
 
46
- For non-tabbable content that needs to be reversed, `flex-direction: column-reverse` is supported in XCSS. However, please be aware that we may lint against this in the future.
53
+ For non-tabbable content that needs to be reversed, `flex-direction: column-reverse` is supported in
54
+ XCSS. However, please be aware that we may lint against this in the future.
47
55
 
48
56
  ## Alignment
49
57
 
50
- Control the alignment of items using the `alignBlock` and `alignInline` props which control alignment in the vertical and horizontal axis respectively.
58
+ Control the alignment of items using the `alignBlock` and `alignInline` props which control
59
+ alignment in the vertical and horizontal axis respectively.
51
60
 
52
61
  ### Block alignment
53
62
 
@@ -55,20 +64,19 @@ Control the alignment of items using the `alignBlock` and `alignInline` props wh
55
64
 
56
65
  ### Inline alignment
57
66
 
58
- <Example
59
- Component={StackAlignInline}
60
- packageName="@atlaskit/primitives/stack"
61
- />
67
+ <Example Component={StackAlignInline} packageName="@atlaskit/primitives/stack" />
62
68
 
63
69
  ## Spread
64
70
 
65
- Use the `spread` prop to set elements to stay together, spaced at the given value (default behavior) or spread equally in the space available.
71
+ Use the `spread` prop to set elements to stay together, spaced at the given value (default behavior)
72
+ or spread equally in the space available.
66
73
 
67
74
  <Example Component={StackSpread} packageName="@atlaskit/primitives/stack" />
68
75
 
69
76
  ## Width control
70
77
 
71
- By default a `Stack` will have its width influenced by the context where it appears. To control the width use the `grow` prop with the values:
78
+ By default a `Stack` will have its width influenced by the context where it appears. To control the
79
+ width use the `grow` prop with the values:
72
80
 
73
81
  - `hug` (default) to use space only as required by its children, or
74
82
  - `fill` to take all space provided by the parent element.
@@ -83,9 +91,7 @@ It's possible to control the rendered HTML element with the `as` prop.
83
91
 
84
92
  ## Practical use case
85
93
 
86
- An example of how a stack component might be used in product, using Atlassian Design System components.
94
+ An example of how a stack component might be used in product, using Atlassian Design System
95
+ components.
87
96
 
88
- <Example
89
- Component={StackPracticalUseCase}
90
- packageName="@atlaskit/primitives/stack"
91
- />
97
+ <Example Component={StackPracticalUseCase} packageName="@atlaskit/primitives/stack" />
@@ -4,21 +4,29 @@ description: A stack manages the vertical layout of direct children using flexbo
4
4
  order: 2
5
5
  ---
6
6
 
7
- Use the stack component in conjunction with other layout components such as [box](/components/primitives/box/usage) and [inline](/components/primitives/inline/usage) to easily create customized layouts, with built-in guidance from the Atlassian Design System.
7
+ Use the stack component in conjunction with other layout components such as
8
+ [box](/components/primitives/box/usage) and [inline](/components/primitives/inline/usage) to easily
9
+ create customized layouts, with built-in guidance from the Atlassian Design System.
8
10
 
9
- A stack component aligns content vertically on a page or layout, acting as a container that decides the vertical layout of its children. Stack components also decide the specifics of how the children are displayed, for example, where they are aligned or how much space is between child elements. Stack is purely for visual alignment, and should have no opinions about the functionality of its children.
11
+ A stack component aligns content vertically on a page or layout, acting as a container that decides
12
+ the vertical layout of its children. Stack components also decide the specifics of how the children
13
+ are displayed, for example, where they are aligned or how much space is between child elements.
14
+ Stack is purely for visual alignment, and should have no opinions about the functionality of its
15
+ children.
10
16
 
11
- In its simplest form, `Stack` works like a flexbox column, with built-in design token support and guidance.
17
+ In its simplest form, `Stack` works like a flexbox column, with built-in design token support and
18
+ guidance.
12
19
 
13
20
  ```jsx
14
21
  <Stack space="space.100" alignInline="center" alignBlock="start">
15
- ...
22
+ ...
16
23
  </Stack>
17
24
  ```
18
25
 
19
26
  ## Using stack
20
27
 
21
- A stack is primarily a container element controlling how content is displayed and aligned vertically. Use stack any time you wish to lay out elements or components vertically.
28
+ A stack is primarily a container element controlling how content is displayed and aligned
29
+ vertically. Use stack any time you wish to lay out elements or components vertically.
22
30
 
23
31
  These props customize the spacing and styling of any child elements:
24
32
 
@@ -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
@@ -15,34 +15,44 @@ import TextTruncation from '../../examples/constellation/text/text-truncation';
15
15
 
16
16
  ## Basic
17
17
 
18
- Use a Text component for main content. Text typically appears after headings or subheadings as detailed descriptions and messages, but also as standalone text in components.
18
+ Use a Text component for main content. Text typically appears after headings or subheadings as
19
+ detailed descriptions and messages, but also as standalone text in components.
19
20
 
20
21
  The `size` prop expresses the visual appearance of the text element:
21
- - `'large'` is for long-form content. Use this size for a comfortable reading experience such as in blogs.
22
- - `'medium'` is the default size in components or where space is limited, for detailed or descriptive content such as primary descriptions in flags.
23
- - `'small'` should be used sparingly and is for secondary level content such as fine print or semantic messaging.
22
+
23
+ - `'large'` is for long-form content. Use this size for a comfortable reading experience such as in
24
+ blogs.
25
+ - `'medium'` is the default size in components or where space is limited, for detailed or
26
+ descriptive content such as primary descriptions in flags.
27
+ - `'small'` should be used sparingly and is for secondary level content such as fine print or
28
+ semantic messaging.
24
29
 
25
30
  <Example Component={TextBasic} packageName="@atlaskit/primitives" />
26
31
 
27
32
  ## Color
28
33
 
29
- Text uses the `color.text` token which automatically switches colors to be legible across both light and dark modes.
34
+ Text uses the `color.text` token which automatically switches colors to be legible across both light
35
+ and dark modes.
30
36
 
31
- Text will automatically apply the correct inverse color token if placed within a [box component](/components/primitives/box) with a bold background color.
37
+ Text will automatically apply the correct inverse color token if placed within a
38
+ [box component](/components/primitives/box) with a bold background color.
32
39
 
33
40
  <Example Component={TextColorInverse} packageName="@atlaskit/primitives" />
34
41
 
35
- The `color` prop can be used with any text color token. If Text is nested inside another Text component, color will automatically inherit from its parent.
42
+ The `color` prop can be used with any text color token. If Text is nested inside another Text
43
+ component, color will automatically inherit from its parent.
36
44
 
37
45
  <Example Component={TextColorInherit} packageName="@atlaskit/primitives" />
38
46
 
39
47
  ## Font weight
40
48
 
41
- Font weight defaults to regular (400) and can be set using the `weight` prop.
42
- More information about the available weights can be found on the [typography foundations page](/foundations/typography-beta/#body-font-weight).
49
+ Font weight defaults to regular (400) and can be set using the `weight` prop. More information about
50
+ the available weights can be found on the
51
+ [typography foundations page](/foundations/typography-beta/#body-font-weight).
43
52
 
44
- Note: Text supports the semibold weight, however due to differences between font stacks across different operating systems, semibold text may render as bold.
45
- We recommend using regular, medium, and bold for the best results.
53
+ Note: Text supports the semibold weight, however due to differences between font stacks across
54
+ different operating systems, semibold text may render as bold. We recommend using regular, medium,
55
+ and bold for the best results.
46
56
 
47
57
  <Example Component={TextWeight} packageName="@atlaskit/primitives" />
48
58
 
@@ -54,15 +64,18 @@ Text can be aligned using the `align` prop.
54
64
 
55
65
  ## Rendered HTML element
56
66
 
57
- Text renders a HTML `<span>` element by default. Use the `as` prop to change the rendered HTML element.
67
+ Text renders a HTML `<span>` element by default. Use the `as` prop to change the rendered HTML
68
+ element.
58
69
 
59
70
  <Example Component={TextAsElement} packageName="@atlaskit/primitives" />
60
71
 
61
72
  ## Arrangement with other text styles
62
73
 
63
- Text does not apply any vertical margin or spacing. To control space between text and other content, use a [stack component](/components/primitives/stack).
74
+ Text does not apply any vertical margin or spacing. To control space between text and other content,
75
+ use a [stack component](/components/primitives/stack).
64
76
 
65
- The available values for paragraph spacing are outlined in the [Typography foundations](/foundations/typography-beta/#body) page.
77
+ The available values for paragraph spacing are outlined in the
78
+ [Typography foundations](/foundations/typography-beta/#body) page.
66
79
 
67
80
  <Example Component={TextSpacing} packageName="@atlaskit/primitives" />
68
81
 
@@ -70,6 +83,7 @@ The available values for paragraph spacing are outlined in the [Typography found
70
83
 
71
84
  Truncation in product experiences [should be avoided](/content/language-and-grammar/#truncation).
72
85
 
73
- However if truncation cannot be avoided, for example when displaying user-generated content, use the `maxLines` prop to indicate how text should be truncated.
86
+ However if truncation cannot be avoided, for example when displaying user-generated content, use the
87
+ `maxLines` prop to indicate how text should be truncated.
74
88
 
75
89
  <Example Component={TextTruncation} packageName="@atlaskit/primitives" />
@@ -6,11 +6,14 @@ order: 2
6
6
 
7
7
  ## Usage
8
8
 
9
- Use the text component for all non-heading text, including main content, detailed descriptions, and text in components.
9
+ Use the text component for all non-heading text, including main content, detailed descriptions, and
10
+ text in components.
10
11
 
11
- For each size, a specific line height is automatically set ensuring text is compliant with accessibility standards.
12
+ For each size, a specific line height is automatically set ensuring text is compliant with
13
+ accessibility standards.
12
14
 
13
- Read more usage guidance for body text in our [Typography foundations](/foundations/typography-beta#body).
15
+ Read more usage guidance for body text in our
16
+ [Typography foundations](/foundations/typography-beta#body).
14
17
 
15
18
  ## Accessibility
16
19