@atlaskit/icon 26.0.0 → 26.1.0

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