@atlaskit/icon 26.0.0 → 26.1.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 (85) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/build/index.tsx +2 -0
  3. package/core/chevron-double-left.d.ts +13 -0
  4. package/core/chevron-double-left.js +27 -0
  5. package/core/chevron-double-right.d.ts +13 -0
  6. package/core/chevron-double-right.js +27 -0
  7. package/core/chevron-down.d.ts +13 -0
  8. package/core/chevron-down.js +27 -0
  9. package/core/chevron-left.d.ts +13 -0
  10. package/core/chevron-left.js +27 -0
  11. package/core/chevron-right.d.ts +13 -0
  12. package/core/chevron-right.js +27 -0
  13. package/core/chevron-up.d.ts +13 -0
  14. package/core/chevron-up.js +27 -0
  15. package/core/migration/chevron-down--chevron-down-circle.d.ts +15 -0
  16. package/core/migration/chevron-down--chevron-down-circle.js +30 -0
  17. package/core/migration/chevron-down--hipchat-chevron-down.d.ts +15 -0
  18. package/core/migration/chevron-down--hipchat-chevron-down.js +30 -0
  19. package/core/migration/chevron-down.d.ts +15 -0
  20. package/core/migration/chevron-down.js +30 -0
  21. package/core/migration/chevron-left--chevron-left-circle.d.ts +15 -0
  22. package/core/migration/chevron-left--chevron-left-circle.js +30 -0
  23. package/core/migration/chevron-left--chevron-left-large.d.ts +15 -0
  24. package/core/migration/chevron-left--chevron-left-large.js +30 -0
  25. package/core/migration/chevron-left.d.ts +15 -0
  26. package/core/migration/chevron-left.js +30 -0
  27. package/core/migration/chevron-right--chevron-right-circle.d.ts +15 -0
  28. package/core/migration/chevron-right--chevron-right-circle.js +30 -0
  29. package/core/migration/chevron-right--chevron-right-large.d.ts +15 -0
  30. package/core/migration/chevron-right--chevron-right-large.js +30 -0
  31. package/core/migration/chevron-right.d.ts +15 -0
  32. package/core/migration/chevron-right.js +30 -0
  33. package/core/migration/chevron-up--chevron-up-circle.d.ts +15 -0
  34. package/core/migration/chevron-up--chevron-up-circle.js +30 -0
  35. package/core/migration/chevron-up--hipchat-chevron-up.d.ts +15 -0
  36. package/core/migration/chevron-up--hipchat-chevron-up.js +30 -0
  37. package/core/migration/chevron-up.d.ts +15 -0
  38. package/core/migration/chevron-up.js +30 -0
  39. package/dist/cjs/components/icon-facade.js +9 -7
  40. package/dist/cjs/components/icon-new.js +41 -20
  41. package/dist/cjs/metadata-core.js +71 -1
  42. package/dist/cjs/metadata-utility.js +1 -1
  43. package/dist/cjs/migration-map.js +254 -182
  44. package/dist/cjs/recommended-small.js +7 -0
  45. package/dist/es2019/components/icon-facade.js +8 -6
  46. package/dist/es2019/components/icon-new.js +40 -20
  47. package/dist/es2019/metadata-core.js +71 -1
  48. package/dist/es2019/metadata-utility.js +1 -1
  49. package/dist/es2019/migration-map.js +254 -182
  50. package/dist/es2019/recommended-small.js +1 -0
  51. package/dist/esm/components/icon-facade.js +9 -7
  52. package/dist/esm/components/icon-new.js +41 -20
  53. package/dist/esm/metadata-core.js +71 -1
  54. package/dist/esm/metadata-utility.js +1 -1
  55. package/dist/esm/migration-map.js +254 -182
  56. package/dist/esm/recommended-small.js +1 -0
  57. package/dist/types/index.d.ts +1 -1
  58. package/dist/types/metadata-core.d.ts +5 -1
  59. package/dist/types/metadata-utility.d.ts +5 -1
  60. package/dist/types/recommended-small.d.ts +1 -0
  61. package/dist/types/types.d.ts +26 -8
  62. package/dist/types-ts4.5/index.d.ts +1 -1
  63. package/dist/types-ts4.5/metadata-core.d.ts +5 -1
  64. package/dist/types-ts4.5/metadata-utility.d.ts +5 -1
  65. package/dist/types-ts4.5/recommended-small.d.ts +1 -0
  66. package/dist/types-ts4.5/types.d.ts +26 -8
  67. package/glyph/chevron-down-circle.js +2 -3
  68. package/glyph/chevron-down.js +2 -3
  69. package/glyph/chevron-left-circle.js +2 -3
  70. package/glyph/chevron-left-large.js +2 -3
  71. package/glyph/chevron-left.js +2 -3
  72. package/glyph/chevron-right-circle.js +2 -3
  73. package/glyph/chevron-right-large.js +2 -3
  74. package/glyph/chevron-right.js +2 -3
  75. package/glyph/chevron-up-circle.js +2 -3
  76. package/glyph/chevron-up.js +2 -3
  77. package/glyph/hipchat/chevron-down.js +2 -3
  78. package/glyph/hipchat/chevron-up.js +2 -3
  79. package/package.json +8 -8
  80. package/svgs/core/chevron-double-left.svg +1 -0
  81. package/svgs/core/chevron-double-right.svg +1 -0
  82. package/svgs/core/chevron-down.svg +1 -0
  83. package/svgs/core/chevron-left.svg +1 -0
  84. package/svgs/core/chevron-right.svg +1 -0
  85. package/svgs/core/chevron-up.svg +1 -0
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.recommendedSmallIcons = void 0;
7
+ var recommendedSmallIcons = exports.recommendedSmallIcons = ['chevron-double-left', 'chevron-double-right', 'chevron-down', 'chevron-left', 'chevron-right', 'chevron-up'];
@@ -23,34 +23,36 @@ const sizeSpacingMap = {
23
23
  */
24
24
  export const IconFacade = /*#__PURE__*/memo(function IconFacade({
25
25
  dangerouslySetGlyph,
26
+ size,
26
27
  ...props
27
28
  }) {
28
- var _props$size;
29
29
  const NewIcon = props.newIcon;
30
30
 
31
31
  // By default, the icon size will be medium for core icons and small for utility icons
32
- const size = (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : 'medium';
32
+ const iconSize = size !== null && size !== void 0 ? size : 'medium';
33
33
  const useNewIcon = !props.isFacadeDisabled &&
34
34
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
35
35
  fg('platform-visual-refresh-icons-legacy-facade');
36
- if (useNewIcon && NewIcon && (size === 'small' || size === 'medium')) {
36
+ if (useNewIcon && NewIcon && (iconSize === 'small' || iconSize === 'medium')) {
37
37
  if (props.iconType === 'utility') {
38
38
  const Icon = NewIcon;
39
39
  return /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
40
- spacing: fg('platform-visual-refresh-icons-facade-button-fix') ? sizeSpacingMap['utility'][size] : 'none',
40
+ spacing: fg('platform-visual-refresh-icons-facade-button-fix') ? sizeSpacingMap['utility'][iconSize] : 'none',
41
41
  color: props.primaryColor || 'currentColor',
42
42
  type: props.iconType
43
43
  }));
44
44
  } else {
45
45
  const Icon = NewIcon;
46
46
  return /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
47
- spacing: sizeSpacingMap['core'][size],
47
+ size: iconSize,
48
+ spacing: sizeSpacingMap['core'][iconSize],
48
49
  color: props.primaryColor || 'currentColor',
49
50
  type: props.iconType
50
51
  }));
51
52
  }
52
53
  }
53
54
  return /*#__PURE__*/React.createElement(LegacyIcon, _extends({
54
- dangerouslySetGlyph: dangerouslySetGlyph
55
+ dangerouslySetGlyph: dangerouslySetGlyph,
56
+ size: size
55
57
  }, props));
56
58
  });
@@ -20,9 +20,14 @@ const scaleStyles = null;
20
20
  */
21
21
  const baseHcmStyles = null;
22
22
  const scaleSize = null;
23
- const coreSizes = {
23
+ const coreSizeMedium = {
24
24
  none: "_1bsbpxbi _4t3ipxbi",
25
- compact: "",
25
+ compact: "_1bsb1ejb _4t3i1ejb",
26
+ spacious: "_1bsb1ejb _4t3i1ejb"
27
+ };
28
+ const coreSizeSmall = {
29
+ none: "_1bsbutpp _4t3iutpp",
30
+ compact: "_1bsbpxbi _4t3ipxbi",
26
31
  spacious: "_1bsb1ejb _4t3i1ejb"
27
32
  };
28
33
  const utilSizes = {
@@ -36,13 +41,28 @@ const baseSizeMap = {
36
41
  };
37
42
  const paddingMap = {
38
43
  core: {
39
- none: 0,
40
- spacious: 4
44
+ medium: {
45
+ none: 0,
46
+ compact: 4,
47
+ spacious: 4
48
+ },
49
+ small: {
50
+ none: 0,
51
+ compact: 2.66,
52
+ spacious: 8
53
+ }
41
54
  },
42
55
  utility: {
43
- none: 0,
44
- compact: 2,
45
- spacious: 6
56
+ medium: {
57
+ none: 0,
58
+ compact: 2,
59
+ spacious: 6
60
+ },
61
+ small: {
62
+ none: 0,
63
+ compact: 2,
64
+ spacious: 6
65
+ }
46
66
  }
47
67
  };
48
68
 
@@ -55,7 +75,7 @@ const paddingMap = {
55
75
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-icons)
56
76
  */
57
77
  export const Icon = /*#__PURE__*/memo(function Icon(props) {
58
- var _props$type, _props$spacing3, _props$spacing4;
78
+ var _props$type;
59
79
  const {
60
80
  color = 'currentColor',
61
81
  testId,
@@ -69,7 +89,8 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
69
89
  dangerouslySetGlyph,
70
90
  // Used with iconTile to scale icon up and down
71
91
  shouldScale,
72
- LEGACY_margin
92
+ LEGACY_margin,
93
+ spacing = 'none'
73
94
  } = props;
74
95
  const dangerouslySetInnerHTML = dangerouslySetGlyph ? {
75
96
  __html: dangerouslySetGlyph
@@ -90,15 +111,14 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
90
111
  UNSAFE_margin: LEGACY_margin
91
112
  });
92
113
  }
93
- const baseSize = baseSizeMap[(_props$type = props.type) !== null && _props$type !== void 0 ? _props$type : 'core'];
94
- let viewBoxPadding;
95
- if (props.type === 'utility') {
96
- var _props$spacing;
97
- viewBoxPadding = paddingMap[props.type][(_props$spacing = props.spacing) !== null && _props$spacing !== void 0 ? _props$spacing : 'none'];
98
- } else {
99
- var _props$spacing2;
100
- viewBoxPadding = paddingMap['core'][(_props$spacing2 = props.spacing) !== null && _props$spacing2 !== void 0 ? _props$spacing2 : 'none'];
101
- }
114
+ const type = (_props$type = props.type) !== null && _props$type !== void 0 ? _props$type : 'core';
115
+ const size = 'size' in props && props.size !== undefined && (
116
+ // This prevents invalid sizes being passed in, which is required
117
+ // for handling unsupported legacy icon sizes which can
118
+ // cause errors.
119
+ props.size === 'small' || props.size === 'medium') ? props.size : 'medium';
120
+ const baseSize = baseSizeMap[type];
121
+ const viewBoxPadding = paddingMap[type][size][spacing];
102
122
  const viewBoxSize = baseSize + 2 * viewBoxPadding;
103
123
  return /*#__PURE__*/React.createElement("span", {
104
124
  "data-testid": testId,
@@ -108,7 +128,7 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
108
128
  style: {
109
129
  color
110
130
  },
111
- className: ax(["_1e0c1o8l _vchhusvi _1o9zidpf _vwz4kb7n _y4ti1igz _bozg1mb9", "_12va1onz _jcxd1r8n", shouldScale && "_1bsb1kw7 _4t3i1kw7", props.type === 'utility' && "_vwz4utpp"])
131
+ className: ax(["_1e0c1o8l _vchhusvi _1o9zidpf _vwz4kb7n _y4ti1igz _bozg1mb9", "_12va1onz _jcxd1r8n", shouldScale && "_1bsb1kw7 _4t3i1kw7", (type === 'utility' || size === 'small') && "_vwz4utpp"])
112
132
  }, /*#__PURE__*/React.createElement("svg", {
113
133
  fill: "none"
114
134
  // Adjusting the viewBox allows the icon padding to scale with the contents of the SVG, which
@@ -117,7 +137,7 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
117
137
  viewBox: `${0 - viewBoxPadding} ${0 - viewBoxPadding} ${viewBoxSize} ${viewBoxSize}`,
118
138
  role: "presentation",
119
139
  dangerouslySetInnerHTML: dangerouslySetInnerHTML,
120
- className: ax(["_1reo15vq _18m915vq _syaz1r31 _lcxvglyw _s7n4yfq0 _vc881r31", shouldScale ? "_1bsb1kw7 _4t3i1kw7" : props.type === 'utility' ? utilSizes[(_props$spacing3 = props.spacing) !== null && _props$spacing3 !== void 0 ? _props$spacing3 : 'none'] : coreSizes[(_props$spacing4 = props.spacing) !== null && _props$spacing4 !== void 0 ? _props$spacing4 : 'none']])
140
+ className: ax(["_1reo15vq _18m915vq _syaz1r31 _lcxvglyw _s7n4yfq0 _vc881r31", shouldScale ? "_1bsb1kw7 _4t3i1kw7" : type === 'utility' ? utilSizes[spacing] : size === 'small' ? coreSizeSmall[spacing] : coreSizeMedium[spacing]])
121
141
  }));
122
142
  });
123
143
  export default Icon;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * To change the format of this file, modify `createIconDocsNew` in icon-build-process/src/create-icon-docs.tsx.
5
5
  *
6
- * @codegen <<SignedSource::74e48f82d18722adc91c77fffafd647c>>
6
+ * @codegen <<SignedSource::60ca5eb1312bd9cabe699f3be0937d0f>>
7
7
  * @codegenCommand yarn build:icon-glyphs
8
8
  */
9
9
 
@@ -720,6 +720,76 @@ const metadata = {
720
720
  team: 'Design System Team',
721
721
  status: 'published'
722
722
  },
723
+ 'chevron-double-left': {
724
+ keywords: ['chevron-double-left', 'chevrondoubleleft', 'icon', 'core', 'double chevron', 'left', 'previous year'],
725
+ componentName: 'ChevronDoubleLeftIcon',
726
+ package: '@atlaskit/icon/core/chevron-double-left',
727
+ shouldRecommendSmallIcon: true,
728
+ type: 'core',
729
+ categorization: 'multi-purpose',
730
+ team: 'Design System Team',
731
+ status: 'ready-to-publish',
732
+ slackChannel: '#icon-contributions'
733
+ },
734
+ 'chevron-double-right': {
735
+ keywords: ['chevron-double-right', 'chevrondoubleright', 'icon', 'core', 'double chevron', 'right', 'next year'],
736
+ componentName: 'ChevronDoubleRightIcon',
737
+ package: '@atlaskit/icon/core/chevron-double-right',
738
+ shouldRecommendSmallIcon: true,
739
+ type: 'core',
740
+ categorization: 'multi-purpose',
741
+ team: 'Design System Team',
742
+ status: 'ready-to-publish',
743
+ slackChannel: '#icon-contributions'
744
+ },
745
+ 'chevron-down': {
746
+ keywords: ['chevron-down', 'chevrondown', 'expand', 'collapse', 'icon', 'core', 'chevron down', 'open dropdown menu', 'expanded tree item', 'collapse tree item'],
747
+ componentName: 'ChevronDownIcon',
748
+ package: '@atlaskit/icon/core/chevron-down',
749
+ oldName: ['chevron-down', 'chevron-down-circle', 'hipchat/chevron-down'],
750
+ shouldRecommendSmallIcon: true,
751
+ type: 'core',
752
+ categorization: 'multi-purpose',
753
+ team: 'Design System Team',
754
+ status: 'ready-to-publish',
755
+ slackChannel: '#icon-contributions'
756
+ },
757
+ 'chevron-left': {
758
+ keywords: ['chevron-left', 'chevronleft', 'back', 'previous', 'icon', 'core', 'chevron left', 'back'],
759
+ componentName: 'ChevronLeftIcon',
760
+ package: '@atlaskit/icon/core/chevron-left',
761
+ oldName: ['chevron-left-circle', 'chevron-left', 'chevron-left-large'],
762
+ shouldRecommendSmallIcon: true,
763
+ type: 'core',
764
+ categorization: 'multi-purpose',
765
+ team: 'Design System Team',
766
+ status: 'ready-to-publish',
767
+ slackChannel: '#icon-contributions'
768
+ },
769
+ 'chevron-right': {
770
+ keywords: ['chevron-right', 'chevronright', 'forward', 'next', 'icon', 'core', 'chevron right', 'collapsed', 'expand tree item'],
771
+ componentName: 'ChevronRightIcon',
772
+ package: '@atlaskit/icon/core/chevron-right',
773
+ oldName: ['chevron-right-circle', 'chevron-right', 'chevron-right-large'],
774
+ shouldRecommendSmallIcon: true,
775
+ type: 'core',
776
+ categorization: 'multi-purpose',
777
+ team: 'Design System Team',
778
+ status: 'ready-to-publish',
779
+ slackChannel: '#icon-contributions'
780
+ },
781
+ 'chevron-up': {
782
+ keywords: ['chevron-up', 'chevronup', 'expand', 'collapse', 'icon', 'core', 'chevron up', 'close dropdown menu', 'collapse'],
783
+ componentName: 'ChevronUpIcon',
784
+ package: '@atlaskit/icon/core/chevron-up',
785
+ oldName: ['chevron-up-circle', 'hipchat/chevron-up', 'chevron-up'],
786
+ shouldRecommendSmallIcon: true,
787
+ type: 'core',
788
+ categorization: 'multi-purpose',
789
+ team: 'Design System Team',
790
+ status: 'ready-to-publish',
791
+ slackChannel: '#icon-contributions'
792
+ },
723
793
  'child-issues': {
724
794
  keywords: ['child-issues', 'childissues', 'icon', 'core'],
725
795
  componentName: 'ChildIssuesIcon',
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * To change the format of this file, modify `createIconDocsNew` in icon-build-process/src/create-icon-docs.tsx.
5
5
  *
6
- * @codegen <<SignedSource::0a9bbc9e058d3b90ee6b8b82cf2f9830>>
6
+ * @codegen <<SignedSource::d968f0d4e1bd5bc5e728353f8fdcc101>>
7
7
  * @codegenCommand yarn build:icon-glyphs
8
8
  */
9
9