@atlaskit/object 0.2.2 → 0.2.3

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 +9 -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 +14 -0
  10. package/constellation/index/props.mdx +11 -0
  11. package/constellation/index/usage.mdx +92 -0
  12. package/constellation/object-tile/code.mdx +13 -0
  13. package/constellation/object-tile/examples.mdx +54 -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 +16 -0
  23. package/constellation/object-tile/usage.mdx +94 -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 +7 -10
  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,14 @@
1
1
  # @atlaskit/object
2
2
 
3
+ ## 0.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e1c9823b0b420`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1c9823b0b420) - -
8
+ Added new metadata export
9
+ - Changed name of 'issue' object to 'work-item'
10
+ - Updated dependencies
11
+
3
12
  ## 0.2.2
4
13
 
5
14
  ### 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). This defaults to `medium`.
22
+
23
+ If you need a larger size, use an [Object Tile](/components/object/object-tile/examples) instead – which is available in 20px to 48px sizes.
24
+
25
+ <Example
26
+ Component={ObjectSizes}
27
+ packageName="@atlaskit/object"
28
+ hiddenSections={['iconography']}
29
+ />
30
+
31
+ ## Label
32
+
33
+ Use the `label` prop to provide accessible labelling for objects. Use descriptive labels for meaningful objects, or empty strings for decorative objects.
34
+
35
+ If not provided, the label will default to a human-readable version of the object type (for example, "Task" for a task object).
36
+
37
+ <Example
38
+ Component={ObjectLabelling}
39
+ packageName="@atlaskit/object"
40
+ hiddenSections={['iconography']}
41
+ />
@@ -0,0 +1,14 @@
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 />
14
+
@@ -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,92 @@
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
+
16
+ ## Usage
17
+
18
+ <SectionMessage appearance="warning">
19
+ Objects are only offered in small (12px) and medium (16px). For larger representations, use <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 Confluence, a work item in Jira or a pull request in Bitbucket.
23
+
24
+ Unlike the standard <a href="/components/icon/examples">Icon</a> component, an object is an icon that has an assigned color to help people identify the content type faster. This reduces cognitive load for people across apps and platforms.
25
+
26
+ ## Size
27
+
28
+ There are 2 size options for object, representing the width and height in pixels: 12px and 16px. For larger sizes and increased legibility and visual prominence, use <a href="/components/object/object-tile/examples">Object tile</a>.
29
+
30
+ <Image src={objectSizeLight} srcDark={objectSizeDark} alt="Object size" />
31
+
32
+ ## Best practices
33
+
34
+ ### Larger than 16px - use an Object tile
35
+
36
+ Do not scale objects. For use cases that require a larger object, use <a href="/components/object/object-tile/examples">Object tile</a>.
37
+
38
+ <DoDont
39
+ type="do"
40
+ image={{
41
+ url: objectLargerDo,
42
+ alt: '',
43
+ }}
44
+ >
45
+ Use an object at either 12px or 16px.
46
+ </DoDont>
47
+ <DoDont
48
+ type="dont"
49
+ image={{
50
+ url: objectLargerDont,
51
+ alt: '',
52
+ }}
53
+ >
54
+ Scale objects beyond 16px.
55
+ </DoDont>
56
+
57
+ ### Don’t change object colors
58
+
59
+ Objects are assigned specific colors. For consistency across our apps, don’t change the color of the object.
60
+
61
+ <DoDont
62
+ type="do"
63
+ image={{
64
+ url: objectColorsDo,
65
+ alt: '',
66
+ }}
67
+ >
68
+ Maintain the assigned color.
69
+ </DoDont>
70
+ <DoDont
71
+ type="dont"
72
+ image={{
73
+ url: objectColorsDont,
74
+ alt: '',
75
+ }}
76
+ >
77
+ Switch color tokens or use custom fills.
78
+ </DoDont>
79
+
80
+ ## Contributing and adding new objects
81
+
82
+ Atlassian teams may request a new object for their apps. Please follow the <a href="https://go.atlassian.com/ads-request-object">request process</a> (Atlassian employees only).
83
+
84
+ ## Accessibility
85
+
86
+ Use objects in combination with a title and meta-information, such as author, creation date, or sub-heading.
87
+
88
+ ## Related
89
+
90
+ - For objects larger than 16px, use <a href="/components/object/object-tile/examples">Object tile</a>
91
+ - <a href="/components/icon/examples">Icon</a>
92
+ - <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,54 @@
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 `xlarge` (48px). This defaults to `medium` (32px).
25
+
26
+ If you need a smaller size, use a standard [Object](/components/object/examples) instead – which is available in 12px or 16px sizes.
27
+
28
+ <Example
29
+ Component={ObjectTileSizes}
30
+ packageName="@atlaskit/object"
31
+ hiddenSections={['iconography']}
32
+ />
33
+
34
+ ## Label
35
+
36
+ Use the `label` prop to provide accessible labelling for object tiles. Use descriptive labels for meaningful object tiles, or empty strings for decorative object tiles.
37
+
38
+ If not provided, the label will default to a human-readable version of the object type (for example, "Task" for a task object tile).
39
+
40
+ <Example
41
+ Component={ObjectTileLabelling}
42
+ packageName="@atlaskit/object"
43
+ hiddenSections={['iconography']}
44
+ />
45
+
46
+ ## Bold
47
+
48
+ Object tiles can be displayed with a bold appearance using the `isBold` prop. This changes the icon color and adds a bold background color. This is disabled by default.
49
+
50
+ <Example
51
+ Component={ObjectTileBold}
52
+ packageName="@atlaskit/object"
53
+ hiddenSections={['iconography']}
54
+ />
@@ -0,0 +1,16 @@
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 />
16
+
@@ -0,0 +1,94 @@
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
+
21
+ ## Usage
22
+
23
+ Object tile represents objects in a tile shape with properties inherited from the tile component. Use them to highlight <a href="/components/object/examples">objects</a> in a layout, such as next to a group of text. To represent standard icons in a tile, use <a href="/components/icon/icon-tile/examples">Icon tile</a>.
24
+
25
+ ## Anatomy
26
+
27
+ <Image src={objectTileAnatomyLight} srcDark={objectTileAnatomyDark} alt="The anatomy of an Object tile" />
28
+
29
+ 1. **Icon object:** Foreground icon represents Atlassian-specific content.
30
+ 2. **Background:** The default appearance has a neutral background set to <inlineCode>color.background.neutral</inlineCode>. Bold tiles have an assigned background token that cannot be changed.
31
+
32
+ ## Size
33
+
34
+ There are currently 5 size options, representing the width and height in pixels: 20, 24, 32, 40, 48. To keep things easy to see, objects smaller than 20px must be shown without a tile container using the <a href="/components/object/examples">object</a> component.
35
+
36
+ <Image src={objectTileSizeLight} srcDark={objectTileSizeDark} alt="All available object tile options" />
37
+
38
+ ## Best practices
39
+
40
+ ### Smaller than 20px - use an Object
41
+
42
+ For smaller representations such as in tables or smart links, use <a href="/components/object/examples">Object</a>. Do not scale down object tile below 20px.
43
+
44
+ <DoDont
45
+ type="do"
46
+ image={{
47
+ url: objectTileSmallerDo,
48
+ alt: '',
49
+ }}
50
+ >
51
+ Use the prescribed size for object tiles.
52
+ </DoDont>
53
+ <DoDont
54
+ type="dont"
55
+ image={{
56
+ url: objectTileSmallerDont,
57
+ alt: '',
58
+ }}
59
+ >
60
+ Scale down object tile below 20px.
61
+ </DoDont>
62
+
63
+ ### Don’t change object tile colors
64
+
65
+ Object tiles are assigned specific colors. For consistency across our apps, don’t change their color.
66
+
67
+ <DoDont
68
+ type="do"
69
+ image={{
70
+ url: objectTileColorsDo,
71
+ alt: '',
72
+ }}
73
+ >
74
+ Maintain the assigned color.
75
+ </DoDont>
76
+ <DoDont
77
+ type="dont"
78
+ image={{
79
+ url: objectTileColorsDont,
80
+ alt: '',
81
+ }}
82
+ >
83
+ Switch color tokens or use custom fills.
84
+ </DoDont>
85
+
86
+ ## Accessibility
87
+
88
+ Use object tiles in combination with a title and meta-information, such as author, creation date, or sub-heading.
89
+
90
+ ## Related
91
+
92
+ - For object tiles smaller than 20px, use <a href="/components/object/examples">Object</a>
93
+ - <a href="/components/icon/icon-tile/examples">Icon tile</a>
94
+ - <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;