@atlaskit/object 0.2.2 → 0.2.4

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 +15 -0
  2. package/constellation/index/examples.mdx +41 -0
  3. package/constellation/index/images/do-donts/object-colors-do.png +0 -0
  4. package/constellation/index/images/do-donts/object-colors-dont.png +0 -0
  5. package/constellation/index/images/do-donts/object-larger-do.png +0 -0
  6. package/constellation/index/images/do-donts/object-larger-dont.png +0 -0
  7. package/constellation/index/images/object-size-dark.png +0 -0
  8. package/constellation/index/images/object-size-light.png +0 -0
  9. package/constellation/index/object-explorer.mdx +13 -0
  10. package/constellation/index/props.mdx +11 -0
  11. package/constellation/index/usage.mdx +102 -0
  12. package/constellation/object-tile/code.mdx +13 -0
  13. package/constellation/object-tile/examples.mdx +59 -0
  14. package/constellation/object-tile/images/do-donts/object-tile-colors-do.png +0 -0
  15. package/constellation/object-tile/images/do-donts/object-tile-colors-dont.png +0 -0
  16. package/constellation/object-tile/images/do-donts/object-tile-smaller-do.png +0 -0
  17. package/constellation/object-tile/images/do-donts/object-tile-smaller-dont.png +0 -0
  18. package/constellation/object-tile/images/object-tile-anatomy-dark.png +0 -0
  19. package/constellation/object-tile/images/object-tile-anatomy-light.png +0 -0
  20. package/constellation/object-tile/images/object-tile-size-dark.png +0 -0
  21. package/constellation/object-tile/images/object-tile-size-light.png +0 -0
  22. package/constellation/object-tile/object-tile-explorer.mdx +15 -0
  23. package/constellation/object-tile/usage.mdx +112 -0
  24. package/dist/cjs/components/object/components/{issue.js → work-item.js} +4 -4
  25. package/dist/cjs/components/object-tile/components/{issue.js → work-item.js} +4 -4
  26. package/dist/cjs/metadata.js +615 -0
  27. package/dist/cjs/types.js +1 -0
  28. package/dist/es2019/components/object/components/{issue.js → work-item.js} +3 -3
  29. package/dist/es2019/components/object-tile/components/{issue.js → work-item.js} +3 -3
  30. package/dist/es2019/metadata.js +422 -0
  31. package/dist/es2019/types.js +0 -0
  32. package/dist/esm/components/object/components/{issue.js → work-item.js} +3 -3
  33. package/dist/esm/components/object-tile/components/{issue.js → work-item.js} +3 -3
  34. package/dist/esm/metadata.js +514 -0
  35. package/dist/esm/types.js +0 -0
  36. package/dist/types/components/object/components/{issue.d.ts → work-item.d.ts} +2 -2
  37. package/dist/{types-ts4.5/components/object-tile/components/issue.d.ts → types/components/object-tile/components/work-item.d.ts} +2 -2
  38. package/dist/types/metadata.d.ts +22 -0
  39. package/dist/types/types.d.ts +2 -0
  40. package/dist/types-ts4.5/components/object/components/{issue.d.ts → work-item.d.ts} +2 -2
  41. package/dist/{types/components/object-tile/components/issue.d.ts → types-ts4.5/components/object-tile/components/work-item.d.ts} +2 -2
  42. package/dist/types-ts4.5/metadata.d.ts +22 -0
  43. package/dist/types-ts4.5/types.d.ts +2 -0
  44. package/metadata/package.json +17 -0
  45. package/package.json +8 -11
  46. package/tile/work-item/package.json +17 -0
  47. package/types/package.json +17 -0
  48. package/work-item/package.json +17 -0
  49. package/issue/package.json +0 -17
  50. package/tile/issue/package.json +0 -17
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/object
2
2
 
3
+ ## 0.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.2.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`e1c9823b0b420`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1c9823b0b420) - -
14
+ Added new metadata export
15
+ - Changed name of 'issue' object to 'work-item'
16
+ - Updated dependencies
17
+
3
18
  ## 0.2.2
4
19
 
5
20
  ### Patch Changes
@@ -0,0 +1,41 @@
1
+ ---
2
+ order: 1
3
+ ---
4
+
5
+ import ObjectDefault from '../../examples/constellation/object-default.tsx';
6
+ import ObjectSizes from '../../examples/constellation/object-sizes.tsx';
7
+ import ObjectLabelling from '../../examples/constellation/object-labelling.tsx';
8
+
9
+ ## Default
10
+
11
+ The default object has a medium size (16px) and a default label based on the object type.
12
+
13
+ <Example
14
+ Component={ObjectDefault}
15
+ packageName="@atlaskit/object"
16
+ hiddenSections={['iconography']}
17
+ />
18
+
19
+ ## Size
20
+
21
+ Objects can be set to two different sizes using the `size` prop: `small` (12px) or `medium` (16px).
22
+ This defaults to `medium`.
23
+
24
+ If you need a larger size, use an [Object Tile](/components/object/object-tile/examples) instead –
25
+ which is available in 20px to 48px sizes.
26
+
27
+ <Example Component={ObjectSizes} packageName="@atlaskit/object" hiddenSections={['iconography']} />
28
+
29
+ ## Label
30
+
31
+ Use the `label` prop to provide accessible labelling for objects. Use descriptive labels for
32
+ meaningful objects, or empty strings for decorative objects.
33
+
34
+ If not provided, the label will default to a human-readable version of the object type (for example,
35
+ "Task" for a task object).
36
+
37
+ <Example
38
+ Component={ObjectLabelling}
39
+ packageName="@atlaskit/object"
40
+ hiddenSections={['iconography']}
41
+ />
@@ -0,0 +1,13 @@
1
+ ---
2
+ order: 0
3
+ ---
4
+
5
+ import { ObjectExplorer } from '@af/design-system-docs-ui';
6
+
7
+ ## Object explorer
8
+
9
+ Make a selection to view usage and import details.
10
+
11
+ For usage examples, see the [Object component documentation](/components/object/).
12
+
13
+ <ObjectExplorer />
@@ -0,0 +1,11 @@
1
+ ---
2
+ order: 2
3
+ props:
4
+ packageName: '@atlaskit/object/types'
5
+ exports:
6
+ - ObjectProps
7
+ ---
8
+
9
+ ## Props
10
+
11
+ <TSMorphProps packageName="@atlaskit/object/types" exportName="ObjectProps" />
@@ -0,0 +1,102 @@
1
+ ---
2
+ order: 3
3
+ ---
4
+
5
+ import SectionMessage from '@atlaskit/section-message';
6
+ import Image from '@atlaskit/image';
7
+
8
+ import objectSizeDark from './images/object-size-dark.png';
9
+ import objectSizeLight from './images/object-size-light.png';
10
+ import objectColorsDo from './images/do-donts/object-colors-do.png';
11
+ import objectColorsDont from './images/do-donts/object-colors-dont.png';
12
+ import objectLargerDo from './images/do-donts/object-larger-do.png';
13
+ import objectLargerDont from './images/do-donts/object-larger-dont.png';
14
+
15
+ ## Usage
16
+
17
+ <SectionMessage appearance="warning">
18
+ Objects are only offered in small (12px) and medium (16px). For larger representations, use{' '}
19
+ <a href="/components/object/object-tile/examples">Object tile</a>.
20
+ </SectionMessage>
21
+
22
+ An object is a representation of an Atlassian content type. They can be concepts such as a page in
23
+ Confluence, a work item in Jira or a pull request in Bitbucket.
24
+
25
+ Unlike the standard <a href="/components/icon/examples">Icon</a> component, an object is an icon
26
+ that has an assigned color to help people identify the content type faster. This reduces cognitive
27
+ load for people across apps and platforms.
28
+
29
+ ## Size
30
+
31
+ There are 2 size options for object, representing the width and height in pixels: 12px and 16px. For
32
+ larger sizes and increased legibility and visual prominence, use
33
+ [Object tile](/components/object/object-tile/examples).
34
+
35
+ <Image src={objectSizeLight} srcDark={objectSizeDark} alt="Object size" />
36
+
37
+ ## Best practices
38
+
39
+ ### Larger than 16px - use an Object tile
40
+
41
+ Do not scale objects. For use cases that require a larger object, use
42
+ [Object tile](/components/object/object-tile/examples).
43
+
44
+ <DoDont
45
+ type="do"
46
+ image={{
47
+ url: objectLargerDo,
48
+ alt: '',
49
+ }}
50
+ >
51
+ Use an object at either 12px or 16px.
52
+ </DoDont>
53
+ <DoDont
54
+ type="dont"
55
+ image={{
56
+ url: objectLargerDont,
57
+ alt: '',
58
+ }}
59
+ >
60
+ Scale objects beyond 16px.
61
+ </DoDont>
62
+
63
+ ### Don’t change object colors
64
+
65
+ Objects are assigned specific colors. For consistency across our apps, don’t change the color of the
66
+ object.
67
+
68
+ <DoDont
69
+ type="do"
70
+ image={{
71
+ url: objectColorsDo,
72
+ alt: '',
73
+ }}
74
+ >
75
+ Maintain the assigned color.
76
+ </DoDont>
77
+ <DoDont
78
+ type="dont"
79
+ image={{
80
+ url: objectColorsDont,
81
+ alt: '',
82
+ }}
83
+ >
84
+ Switch color tokens or use custom fills.
85
+ </DoDont>
86
+
87
+ ## Contributing and adding new objects
88
+
89
+ Atlassian teams may request a new object for their apps. Please follow the
90
+ [request process](https://go.atlassian.com/ads-request-object) (Atlassian employees only).
91
+
92
+ ## Accessibility
93
+
94
+ Use objects in combination with a title and meta-information, such as author, creation date, or
95
+ sub-heading.
96
+
97
+ ## Related
98
+
99
+ - For objects larger than 16px, use <a href="/components/object/object-tile/examples">Object
100
+ tile</a>
101
+ - <a href="/components/icon/examples">Icon</a>
102
+ - <a href="/components/icon/icon-tile/examples">Icon tile</a>
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Object tile
3
+ description: An object tile represents Atlassian-specific content in a tile.
4
+ order: 2
5
+ props:
6
+ packageName: '@atlaskit/object/types'
7
+ exports:
8
+ - ObjectTileProps
9
+ ---
10
+
11
+ ## Props
12
+
13
+ <TSMorphProps packageName="@atlaskit/object/types" exportName="ObjectTileProps" />
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: Object tile
3
+ description: An object tile represents Atlassian-specific content in a tile.
4
+ order: 1
5
+ ---
6
+
7
+ import ObjectTileDefault from '../../examples/constellation/object-tile-default.tsx';
8
+ import ObjectTileSizes from '../../examples/constellation/object-tile-sizes.tsx';
9
+ import ObjectTileLabelling from '../../examples/constellation/object-tile-labelling.tsx';
10
+ import ObjectTileBold from '../../examples/constellation/object-tile-bold.tsx';
11
+
12
+ ## Default
13
+
14
+ The default object tile has a medium size (32px) and a default label based on the object type.
15
+
16
+ <Example
17
+ Component={ObjectTileDefault}
18
+ packageName="@atlaskit/object"
19
+ hiddenSections={['iconography']}
20
+ />
21
+
22
+ ## Size
23
+
24
+ Object tiles can be set to five different sizes using the `size` prop, from `xsmall` (20px) to
25
+ `xlarge` (48px). This defaults to `medium` (32px).
26
+
27
+ If you need a smaller size, use a standard [Object](/components/object/examples) instead – which is
28
+ available in 12px or 16px sizes.
29
+
30
+ <Example
31
+ Component={ObjectTileSizes}
32
+ packageName="@atlaskit/object"
33
+ hiddenSections={['iconography']}
34
+ />
35
+
36
+ ## Label
37
+
38
+ Use the `label` prop to provide accessible labelling for object tiles. Use descriptive labels for
39
+ meaningful object tiles, or empty strings for decorative object tiles.
40
+
41
+ If not provided, the label will default to a human-readable version of the object type (for example,
42
+ "Task" for a task object tile).
43
+
44
+ <Example
45
+ Component={ObjectTileLabelling}
46
+ packageName="@atlaskit/object"
47
+ hiddenSections={['iconography']}
48
+ />
49
+
50
+ ## Bold
51
+
52
+ Object tiles can be displayed with a bold appearance using the `isBold` prop. This changes the icon
53
+ color and adds a bold background color. This is disabled by default.
54
+
55
+ <Example
56
+ Component={ObjectTileBold}
57
+ packageName="@atlaskit/object"
58
+ hiddenSections={['iconography']}
59
+ />
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: Object tile
3
+ description: An object tile represents Atlassian-specific content in a tile.
4
+ order: 0
5
+ ---
6
+
7
+ import { ObjectTileExplorer } from '@af/design-system-docs-ui';
8
+
9
+ ## Object Tile explorer
10
+
11
+ Make a selection to view usage and import details.
12
+
13
+ For usage examples, see the [Object Tile component documentation](/components/object/object-tile/).
14
+
15
+ <ObjectTileExplorer />
@@ -0,0 +1,112 @@
1
+ ---
2
+ title: Object tile
3
+ description: An object tile represents Atlassian-specific content in a tile.
4
+ order: 3
5
+ ---
6
+
7
+ import SectionMessage from '@atlaskit/section-message';
8
+ import Image from '@atlaskit/image';
9
+
10
+ import objectTileAnatomyDark from './images/object-tile-anatomy-dark.png';
11
+ import objectTileAnatomyLight from './images/object-tile-anatomy-light.png';
12
+ import objectTileSizeDark from './images/object-tile-size-dark.png';
13
+ import objectTileSizeLight from './images/object-tile-size-light.png';
14
+
15
+ import objectTileColorsDo from './images/do-donts/object-tile-colors-do.png';
16
+ import objectTileColorsDont from './images/do-donts/object-tile-colors-dont.png';
17
+ import objectTileSmallerDo from './images/do-donts/object-tile-smaller-do.png';
18
+ import objectTileSmallerDont from './images/do-donts/object-tile-smaller-dont.png';
19
+
20
+ ## Usage
21
+
22
+ Object tile represents objects in a tile shape with properties inherited from the tile component.
23
+ Use them to highlight [objects](/components/object/examples) in a layout, such as next to a group of
24
+ text. To represent standard icons in a tile, use
25
+
26
+ <a href="/components/icon/icon-tile/examples">Icon tile</a>.
27
+
28
+ ## Anatomy
29
+
30
+ <Image
31
+ src={objectTileAnatomyLight}
32
+ srcDark={objectTileAnatomyDark}
33
+ alt="The anatomy of an Object tile"
34
+ />
35
+
36
+ 1. **Icon object:** Foreground icon represents Atlassian-specific content.
37
+ 2. **Background:** The default appearance has a neutral background set to
38
+ <inlineCode>color.background.neutral</inlineCode>. Bold tiles have an assigned background token
39
+ that cannot be changed.
40
+
41
+ ## Size
42
+
43
+ There are currently 5 size options, representing the width and height in pixels: 20, 24, 32, 40, 48.
44
+ To keep things easy to see, objects smaller than 20px must be shown without a tile container using
45
+ the [object](/components/object/examples) component.
46
+
47
+ <Image
48
+ src={objectTileSizeLight}
49
+ srcDark={objectTileSizeDark}
50
+ alt="All available object tile options"
51
+ />
52
+
53
+ ## Best practices
54
+
55
+ ### Smaller than 20px - use an Object
56
+
57
+ For smaller representations such as in tables or smart links, use
58
+ [Object](/components/object/examples). Do not scale down object tile below 20px.
59
+
60
+ <DoDont
61
+ type="do"
62
+ image={{
63
+ url: objectTileSmallerDo,
64
+ alt: '',
65
+ }}
66
+ >
67
+ Use the prescribed size for object tiles.
68
+ </DoDont>
69
+ <DoDont
70
+ type="dont"
71
+ image={{
72
+ url: objectTileSmallerDont,
73
+ alt: '',
74
+ }}
75
+ >
76
+ Scale down object tile below 20px.
77
+ </DoDont>
78
+
79
+ ### Don’t change object tile colors
80
+
81
+ Object tiles are assigned specific colors. For consistency across our apps, don’t change their
82
+ color.
83
+
84
+ <DoDont
85
+ type="do"
86
+ image={{
87
+ url: objectTileColorsDo,
88
+ alt: '',
89
+ }}
90
+ >
91
+ Maintain the assigned color.
92
+ </DoDont>
93
+ <DoDont
94
+ type="dont"
95
+ image={{
96
+ url: objectTileColorsDont,
97
+ alt: '',
98
+ }}
99
+ >
100
+ Switch color tokens or use custom fills.
101
+ </DoDont>
102
+
103
+ ## Accessibility
104
+
105
+ Use object tiles in combination with a title and meta-information, such as author, creation date, or
106
+ sub-heading.
107
+
108
+ ## Related
109
+
110
+ - For object tiles smaller than 20px, use <a href="/components/object/examples">Object</a>
111
+ - <a href="/components/icon/icon-tile/examples">Icon tile</a>
112
+ - <a href="/components/icon/examples">Icon</a>
@@ -4,19 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = IssueObject;
7
+ exports.default = WorkItemObject;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _workItem = _interopRequireDefault(require("@atlaskit/icon/core/work-item"));
10
10
  var _objectBase = _interopRequireDefault(require("../object-base"));
11
11
  /**
12
12
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
13
- * @codegen <<SignedSource::9f066b78a852692916f23328f565a5fa>>
13
+ * @codegen <<SignedSource::9d7811e9ce600b90f94930755b99d471>>
14
14
  * @codegenCommand yarn build-glyphs
15
15
  */
16
16
 
17
- function IssueObject(_ref) {
17
+ function WorkItemObject(_ref) {
18
18
  var _ref$label = _ref.label,
19
- label = _ref$label === void 0 ? 'Issue' : _ref$label,
19
+ label = _ref$label === void 0 ? 'Work Item' : _ref$label,
20
20
  size = _ref.size,
21
21
  testId = _ref.testId;
22
22
  return /*#__PURE__*/_react.default.createElement(_objectBase.default, {
@@ -4,19 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = IssueObjectTile;
7
+ exports.default = WorkItemObjectTile;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _workItem = _interopRequireDefault(require("@atlaskit/icon/core/work-item"));
10
10
  var _objectTileBase = _interopRequireDefault(require("../object-tile-base"));
11
11
  /**
12
12
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
13
- * @codegen <<SignedSource::3364016e20db618c1b623e7c48e1d366>>
13
+ * @codegen <<SignedSource::30f3baace5bcd49b8a2c522228cf7a06>>
14
14
  * @codegenCommand yarn build-glyphs
15
15
  */
16
16
 
17
- function IssueObjectTile(_ref) {
17
+ function WorkItemObjectTile(_ref) {
18
18
  var _ref$label = _ref.label,
19
- label = _ref$label === void 0 ? 'Issue' : _ref$label,
19
+ label = _ref$label === void 0 ? 'Work Item' : _ref$label,
20
20
  size = _ref.size,
21
21
  testId = _ref.testId,
22
22
  isBold = _ref.isBold;