@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.
- package/CHANGELOG.md +14 -0
- package/core/chevron-double-left.d.ts +13 -0
- package/core/chevron-double-left.js +27 -0
- package/core/chevron-double-right.d.ts +13 -0
- package/core/chevron-double-right.js +27 -0
- package/core/chevron-down.d.ts +13 -0
- package/core/chevron-down.js +27 -0
- package/core/chevron-left.d.ts +13 -0
- package/core/chevron-left.js +27 -0
- package/core/chevron-right.d.ts +13 -0
- package/core/chevron-right.js +27 -0
- package/core/chevron-up.d.ts +13 -0
- package/core/chevron-up.js +27 -0
- package/core/migration/chevron-down--chevron-down-circle.d.ts +15 -0
- package/core/migration/chevron-down--chevron-down-circle.js +30 -0
- package/core/migration/chevron-down--hipchat-chevron-down.d.ts +15 -0
- package/core/migration/chevron-down--hipchat-chevron-down.js +30 -0
- package/core/migration/chevron-down.d.ts +15 -0
- package/core/migration/chevron-down.js +30 -0
- package/core/migration/chevron-left--chevron-left-circle.d.ts +15 -0
- package/core/migration/chevron-left--chevron-left-circle.js +30 -0
- package/core/migration/chevron-left--chevron-left-large.d.ts +15 -0
- package/core/migration/chevron-left--chevron-left-large.js +30 -0
- package/core/migration/chevron-left.d.ts +15 -0
- package/core/migration/chevron-left.js +30 -0
- package/core/migration/chevron-right--chevron-right-circle.d.ts +15 -0
- package/core/migration/chevron-right--chevron-right-circle.js +30 -0
- package/core/migration/chevron-right--chevron-right-large.d.ts +15 -0
- package/core/migration/chevron-right--chevron-right-large.js +30 -0
- package/core/migration/chevron-right.d.ts +15 -0
- package/core/migration/chevron-right.js +30 -0
- package/core/migration/chevron-up--chevron-up-circle.d.ts +15 -0
- package/core/migration/chevron-up--chevron-up-circle.js +30 -0
- package/core/migration/chevron-up--hipchat-chevron-up.d.ts +15 -0
- package/core/migration/chevron-up--hipchat-chevron-up.js +30 -0
- package/core/migration/chevron-up.d.ts +15 -0
- package/core/migration/chevron-up.js +30 -0
- package/dist/cjs/components/icon-facade.js +9 -7
- package/dist/cjs/components/icon-new.js +41 -20
- package/dist/cjs/metadata-core.js +65 -1
- package/dist/cjs/migration-map.js +254 -182
- package/dist/es2019/components/icon-facade.js +8 -6
- package/dist/es2019/components/icon-new.js +40 -20
- package/dist/es2019/metadata-core.js +65 -1
- package/dist/es2019/migration-map.js +254 -182
- package/dist/esm/components/icon-facade.js +9 -7
- package/dist/esm/components/icon-new.js +41 -20
- package/dist/esm/metadata-core.js +65 -1
- package/dist/esm/migration-map.js +254 -182
- package/dist/types/index.d.ts +1 -1
- package/dist/types/metadata-core.d.ts +1 -1
- package/dist/types/types.d.ts +25 -8
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/metadata-core.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +25 -8
- package/glyph/chevron-down-circle.js +2 -3
- package/glyph/chevron-down.js +2 -3
- package/glyph/chevron-left-circle.js +2 -3
- package/glyph/chevron-left-large.js +2 -3
- package/glyph/chevron-left.js +2 -3
- package/glyph/chevron-right-circle.js +2 -3
- package/glyph/chevron-right-large.js +2 -3
- package/glyph/chevron-right.js +2 -3
- package/glyph/chevron-up-circle.js +2 -3
- package/glyph/chevron-up.js +2 -3
- package/glyph/hipchat/chevron-down.js +2 -3
- package/glyph/hipchat/chevron-up.js +2 -3
- package/package.json +6 -6
- package/svgs/core/chevron-double-left.svg +1 -0
- package/svgs/core/chevron-double-right.svg +1 -0
- package/svgs/core/chevron-down.svg +1 -0
- package/svgs/core/chevron-left.svg +1 -0
- package/svgs/core/chevron-right.svg +1 -0
- 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
|
|
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 && (
|
|
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'][
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
40
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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",
|
|
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" :
|
|
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::
|
|
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',
|