@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.
- package/CHANGELOG.md +22 -0
- package/build/index.tsx +2 -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 +71 -1
- package/dist/cjs/metadata-utility.js +1 -1
- package/dist/cjs/migration-map.js +254 -182
- package/dist/cjs/recommended-small.js +7 -0
- package/dist/es2019/components/icon-facade.js +8 -6
- package/dist/es2019/components/icon-new.js +40 -20
- package/dist/es2019/metadata-core.js +71 -1
- package/dist/es2019/metadata-utility.js +1 -1
- package/dist/es2019/migration-map.js +254 -182
- package/dist/es2019/recommended-small.js +1 -0
- package/dist/esm/components/icon-facade.js +9 -7
- package/dist/esm/components/icon-new.js +41 -20
- package/dist/esm/metadata-core.js +71 -1
- package/dist/esm/metadata-utility.js +1 -1
- package/dist/esm/migration-map.js +254 -182
- package/dist/esm/recommended-small.js +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/metadata-core.d.ts +5 -1
- package/dist/types/metadata-utility.d.ts +5 -1
- package/dist/types/recommended-small.d.ts +1 -0
- package/dist/types/types.d.ts +26 -8
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/metadata-core.d.ts +5 -1
- package/dist/types-ts4.5/metadata-utility.d.ts +5 -1
- package/dist/types-ts4.5/recommended-small.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +26 -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 +8 -8
- 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
|
@@ -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
|
|
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 && (
|
|
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'][
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 @@ 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
|
|
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
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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",
|
|
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" :
|
|
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::
|
|
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::
|
|
6
|
+
* @codegen <<SignedSource::d968f0d4e1bd5bc5e728353f8fdcc101>>
|
|
7
7
|
* @codegenCommand yarn build:icon-glyphs
|
|
8
8
|
*/
|
|
9
9
|
|