carbon-react 107.2.1 → 109.0.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/esm/__internal__/input/input-presentation.style.d.ts +1 -1
- package/esm/__internal__/input/input.component.js +52 -2
- package/esm/__internal__/input-icon-toggle/index.d.ts +2 -1
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +20 -0
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.js +16 -17
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +12 -0
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +7 -17
- package/esm/__internal__/label/label.component.js +1 -1
- package/esm/__spec_helper__/index.js +1 -1
- package/esm/components/accordion/accordion.style.d.ts +2 -2
- package/esm/components/action-popover/action-popover-item/action-popover-item.component.js +1 -1
- package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +1 -1
- package/esm/components/action-popover/action-popover.style.d.ts +4 -4
- package/esm/components/badge/badge.style.d.ts +1 -2
- package/esm/components/button/button.component.d.ts +2 -1
- package/esm/components/button/button.component.js +3 -3
- package/esm/components/confirm/confirm.d.ts +1 -1
- package/esm/components/flat-table/flat-table.style.js +1 -1
- package/esm/components/help/help.d.ts +1 -1
- package/esm/components/icon/icon-config.d.ts +14 -11
- package/esm/components/icon/icon-config.js +1 -1
- package/esm/components/icon/icon-type.d.ts +1 -0
- package/esm/components/icon/icon-type.js +1 -0
- package/esm/components/icon/icon.component.d.ts +46 -0
- package/esm/components/icon/icon.component.js +212 -125
- package/esm/components/icon/icon.style.d.ts +37 -1
- package/esm/components/icon/icon.style.js +10 -35
- package/esm/components/icon/index.d.ts +3 -2
- package/esm/components/icon-button/icon-button.d.ts +1 -1
- package/esm/components/link/link.component.d.ts +2 -2
- package/esm/components/link/link.component.js +1 -1
- package/esm/components/menu/menu-item/menu-item.d.ts +1 -1
- package/esm/components/multi-action-button/multi-action-button.component.js +50 -1
- package/esm/components/popover-container/index.d.ts +2 -1
- package/esm/components/popover-container/popover-container.component.d.ts +56 -0
- package/esm/components/popover-container/popover-container.component.js +234 -106
- package/esm/components/popover-container/popover-container.style.d.ts +18 -0
- package/esm/hooks/__internal__/useModalManager/useModalManager.js +14 -11
- package/esm/style/utils/filter-styled-system-padding-props.d.ts +1 -1
- package/esm/style/utils/filter-styled-system-padding-props.js +4 -2
- package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
- package/lib/__internal__/input/input.component.js +52 -2
- package/lib/__internal__/input-icon-toggle/index.d.ts +2 -1
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +20 -0
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.js +16 -17
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +12 -0
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +7 -18
- package/lib/__internal__/label/label.component.js +1 -1
- package/lib/__spec_helper__/index.js +1 -1
- package/lib/components/accordion/accordion.style.d.ts +2 -2
- package/lib/components/action-popover/action-popover-item/action-popover-item.component.js +1 -1
- package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +1 -1
- package/lib/components/action-popover/action-popover.style.d.ts +4 -4
- package/lib/components/badge/badge.style.d.ts +1 -2
- package/lib/components/button/button.component.d.ts +2 -1
- package/lib/components/button/button.component.js +3 -3
- package/lib/components/confirm/confirm.d.ts +1 -1
- package/lib/components/flat-table/flat-table.style.js +1 -1
- package/lib/components/help/help.d.ts +1 -1
- package/lib/components/icon/icon-config.d.ts +14 -11
- package/lib/components/icon/icon-config.js +1 -1
- package/lib/components/icon/icon-type.d.ts +1 -0
- package/lib/components/icon/icon-type.js +5 -0
- package/lib/components/icon/icon.component.d.ts +46 -0
- package/lib/components/icon/icon.component.js +215 -130
- package/lib/components/icon/icon.style.d.ts +37 -1
- package/lib/components/icon/icon.style.js +10 -36
- package/lib/components/icon/index.d.ts +3 -2
- package/lib/components/icon-button/icon-button.d.ts +1 -1
- package/lib/components/link/link.component.d.ts +2 -2
- package/lib/components/link/link.component.js +1 -1
- package/lib/components/menu/menu-item/menu-item.d.ts +1 -1
- package/lib/components/multi-action-button/multi-action-button.component.js +50 -1
- package/lib/components/popover-container/index.d.ts +2 -1
- package/lib/components/popover-container/popover-container.component.d.ts +56 -0
- package/lib/components/popover-container/popover-container.component.js +234 -108
- package/lib/components/popover-container/popover-container.style.d.ts +18 -0
- package/lib/hooks/__internal__/useModalManager/useModalManager.js +14 -11
- package/lib/style/utils/filter-styled-system-padding-props.d.ts +1 -1
- package/lib/style/utils/filter-styled-system-padding-props.js +4 -2
- package/package.json +11 -10
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.d.ts +0 -24
- package/esm/components/icon/icon.d.ts +0 -252
- package/esm/components/popover-container/popover-container.d.ts +0 -35
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.d.ts +0 -24
- package/lib/components/icon/icon.d.ts +0 -252
- package/lib/components/popover-container/popover-container.d.ts +0 -35
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { StyledIconProps } from "./icon.style";
|
|
4
|
+
import { IconType } from "./icon-type";
|
|
5
|
+
import { TooltipPositions } from "../tooltip/tooltip.config";
|
|
6
|
+
export declare type LegacyIconTypes = "help" | "maintenance" | "new" | "success" | "messages";
|
|
7
|
+
export interface IconProps extends Omit<StyledIconProps, "type">, MarginProps {
|
|
8
|
+
/** Set whether icon should be recognised by assistive technologies */
|
|
9
|
+
"aria-hidden"?: boolean;
|
|
10
|
+
/** Aria label for accessibility purposes */
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
/** Id passed to the icon. */
|
|
13
|
+
id?: string;
|
|
14
|
+
/** The ARIA role to be applied to the Icon */
|
|
15
|
+
role?: string;
|
|
16
|
+
/** The message to be displayed within the tooltip */
|
|
17
|
+
tooltipMessage?: React.ReactNode;
|
|
18
|
+
/** The position to display the tooltip */
|
|
19
|
+
tooltipPosition?: TooltipPositions;
|
|
20
|
+
/** Control whether the tooltip is visible */
|
|
21
|
+
tooltipVisible?: boolean;
|
|
22
|
+
/** Override background color of the Tooltip, provide any color from palette or any valid css color value. */
|
|
23
|
+
tooltipBgColor?: string;
|
|
24
|
+
/** Override font color of the Tooltip, provide any color from palette or any valid css color value. */
|
|
25
|
+
tooltipFontColor?: string;
|
|
26
|
+
/** Overrides the default flip behaviour of the Tooltip */
|
|
27
|
+
tooltipFlipOverrides?: TooltipPositions[];
|
|
28
|
+
/** Id passed to the tooltip container, used for accessibility purposes */
|
|
29
|
+
tooltipId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Icon type
|
|
32
|
+
*
|
|
33
|
+
* The full list of types can be seen [here](https://carbon.sage.com/?path=/docs/icon--list-of-icons#list-of-icons).
|
|
34
|
+
*/
|
|
35
|
+
type: IconType | LegacyIconTypes;
|
|
36
|
+
/** @ignore @private */
|
|
37
|
+
focusable?: boolean;
|
|
38
|
+
/** @ignore @private */
|
|
39
|
+
isPartOfInput?: boolean;
|
|
40
|
+
/** @ignore @private */
|
|
41
|
+
inputSize?: "small" | "medium" | "large";
|
|
42
|
+
/** @ignore @private */
|
|
43
|
+
tabIndex?: number;
|
|
44
|
+
}
|
|
45
|
+
declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
46
|
+
export default Icon;
|
|
@@ -9,40 +9,41 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
15
|
-
|
|
16
|
-
var _icon = _interopRequireDefault(require("./icon.style"));
|
|
12
|
+
var _invariant = _interopRequireDefault(require("invariant"));
|
|
17
13
|
|
|
18
14
|
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
19
15
|
|
|
20
16
|
var _utils = require("../../style/utils");
|
|
21
17
|
|
|
22
|
-
var _iconConfig = require("./icon-config");
|
|
23
|
-
|
|
24
18
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
25
19
|
|
|
20
|
+
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
21
|
+
|
|
22
|
+
var _icon = _interopRequireDefault(require("./icon.style"));
|
|
23
|
+
|
|
24
|
+
var _iconConfig = require("./icon-config");
|
|
25
|
+
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
|
|
28
28
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
29
29
|
|
|
30
30
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
32
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
33
|
-
|
|
34
|
-
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
35
|
-
|
|
36
32
|
const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
37
33
|
"aria-hidden": ariaHidden,
|
|
34
|
+
ariaLabel,
|
|
38
35
|
bg,
|
|
39
36
|
bgShape,
|
|
40
|
-
bgSize,
|
|
37
|
+
bgSize = "small",
|
|
41
38
|
className,
|
|
42
39
|
color,
|
|
43
40
|
disabled,
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
focusable = true,
|
|
42
|
+
fontSize = "small",
|
|
43
|
+
id,
|
|
44
|
+
inputSize,
|
|
45
|
+
isPartOfInput,
|
|
46
|
+
tabIndex,
|
|
46
47
|
tooltipMessage,
|
|
47
48
|
tooltipPosition,
|
|
48
49
|
tooltipVisible,
|
|
@@ -50,15 +51,16 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
50
51
|
tooltipFontColor,
|
|
51
52
|
tooltipFlipOverrides,
|
|
52
53
|
tooltipId,
|
|
53
|
-
|
|
54
|
-
id,
|
|
55
|
-
isPartOfInput,
|
|
56
|
-
inputSize,
|
|
54
|
+
type,
|
|
57
55
|
role,
|
|
58
|
-
ariaLabel,
|
|
59
|
-
focusable = true,
|
|
60
56
|
...rest
|
|
61
57
|
}, ref) => {
|
|
58
|
+
const flipBehaviourCheck = Array.isArray(tooltipFlipOverrides) && tooltipFlipOverrides.every(override => _iconConfig.ICON_TOOLTIP_POSITIONS.includes(override));
|
|
59
|
+
|
|
60
|
+
if (tooltipFlipOverrides) {
|
|
61
|
+
(0, _invariant.default)(flipBehaviourCheck, `The tooltipFlipOverrides prop supplied to \`Icon\` must be an array containing some or all of ["top", "bottom", "left", "right"].`);
|
|
62
|
+
}
|
|
63
|
+
|
|
62
64
|
const isInteractive = !!tooltipMessage && !disabled;
|
|
63
65
|
const {
|
|
64
66
|
tooltipPosition: tooltipPositionFromContext,
|
|
@@ -94,33 +96,30 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
94
96
|
};
|
|
95
97
|
|
|
96
98
|
const isFocusable = focusableFromContext !== undefined ? focusableFromContext : focusable;
|
|
97
|
-
const hasTooltip = !disabled && !disabledFromContext && tooltipMessage && isFocusable;
|
|
98
|
-
const
|
|
99
|
+
const hasTooltip = !disabled && !disabledFromContext && !!tooltipMessage && isFocusable;
|
|
100
|
+
const styledIconProps = {
|
|
101
|
+
"aria-hidden": ariaHidden,
|
|
102
|
+
"aria-label": ariaLabel,
|
|
99
103
|
bg,
|
|
100
104
|
bgSize,
|
|
101
105
|
bgShape,
|
|
106
|
+
className: className || undefined,
|
|
102
107
|
color,
|
|
108
|
+
"data-element": iconType(),
|
|
103
109
|
disabled: disabledFromContext || disabled,
|
|
104
110
|
fontSize,
|
|
111
|
+
hasTooltip,
|
|
112
|
+
id,
|
|
105
113
|
isInteractive,
|
|
106
|
-
|
|
114
|
+
key: "icon",
|
|
115
|
+
ref,
|
|
116
|
+
role,
|
|
107
117
|
tabIndex: hasTooltip && tabIndex === undefined ? 0 : tabIndex,
|
|
118
|
+
type: iconType(),
|
|
119
|
+
...(0, _tags.default)("icon", rest),
|
|
108
120
|
...(0, _utils.filterStyledSystemMarginProps)(rest)
|
|
109
121
|
};
|
|
110
122
|
|
|
111
|
-
const icon = /*#__PURE__*/_react.default.createElement(_icon.default, _extends({
|
|
112
|
-
"aria-hidden": ariaHidden,
|
|
113
|
-
ref: ref,
|
|
114
|
-
key: "icon",
|
|
115
|
-
id: id,
|
|
116
|
-
className: className || null,
|
|
117
|
-
"data-element": iconType()
|
|
118
|
-
}, (0, _tags.default)("icon", rest), styleProps, {
|
|
119
|
-
hasTooltip: hasTooltip,
|
|
120
|
-
"aria-label": ariaLabel,
|
|
121
|
-
role: role
|
|
122
|
-
}));
|
|
123
|
-
|
|
124
123
|
if (tooltipMessage) {
|
|
125
124
|
const showTooltip = tooltipVisibleFromContext !== undefined ? tooltipVisibleFromContext : tooltipVisible;
|
|
126
125
|
const visible = disabled ? undefined : showTooltip;
|
|
@@ -136,105 +135,191 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
136
135
|
fontColor: tooltipFontColor,
|
|
137
136
|
flipOverrides: tooltipFlipOverrides,
|
|
138
137
|
target: target
|
|
139
|
-
},
|
|
138
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, styledIconProps));
|
|
140
139
|
}
|
|
141
140
|
|
|
142
|
-
return
|
|
141
|
+
return /*#__PURE__*/_react.default.createElement(_icon.default, styledIconProps);
|
|
143
142
|
});
|
|
144
143
|
|
|
145
|
-
Icon.propTypes = {
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* @private
|
|
149
|
-
* @ignore
|
|
150
|
-
* Add classes to this component
|
|
151
|
-
* */
|
|
152
|
-
className: _propTypes.default.string,
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Icon type.
|
|
156
|
-
*
|
|
157
|
-
* The full list of types can be seen [here](https://github.com/Sage/carbon/blob/master/src/components/icon/icon-config.js).
|
|
158
|
-
* */
|
|
159
|
-
type: _propTypes.default.string.isRequired,
|
|
160
|
-
|
|
161
|
-
/** Background size */
|
|
162
|
-
bgSize: _propTypes.default.oneOf(["extra-small", "small", "medium", "large", "extra-large"]),
|
|
163
|
-
|
|
164
|
-
/** Background shape */
|
|
165
|
-
bgShape: _propTypes.default.oneOf(["circle", "rounded-rect", "square"]),
|
|
166
|
-
|
|
167
|
-
/** Icon font size */
|
|
168
|
-
fontSize: _propTypes.default.oneOf(["small", "medium", "large", "extra-large"]),
|
|
169
|
-
|
|
170
|
-
/** Icon colour, provide design token, any color from palette or any valid css color value. */
|
|
171
|
-
color: _propTypes.default.string,
|
|
172
|
-
|
|
173
|
-
/** Background colour, provide design token, any color from palette, or any valid css color value. */
|
|
174
|
-
bg: _propTypes.default.string,
|
|
175
|
-
|
|
176
|
-
/** Sets the icon in the disabled state */
|
|
177
|
-
disabled: _propTypes.default.bool,
|
|
178
|
-
|
|
179
|
-
/** Aria label for accessibility purposes */
|
|
180
|
-
ariaLabel: _propTypes.default.string,
|
|
181
|
-
|
|
182
|
-
/** Set whether icon should be recognised by assistive technologies */
|
|
144
|
+
Icon.propTypes = {
|
|
183
145
|
"aria-hidden": _propTypes.default.bool,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
146
|
+
"ariaLabel": _propTypes.default.string,
|
|
147
|
+
"bg": _propTypes.default.string,
|
|
148
|
+
"bgShape": _propTypes.default.oneOf(["circle", "rounded-rect", "square"]),
|
|
149
|
+
"bgSize": _propTypes.default.oneOf(["extra-large", "extra-small", "large", "medium", "small"]),
|
|
150
|
+
"className": _propTypes.default.string,
|
|
151
|
+
"color": _propTypes.default.string,
|
|
152
|
+
"disabled": _propTypes.default.bool,
|
|
153
|
+
"focusable": _propTypes.default.bool,
|
|
154
|
+
"fontSize": _propTypes.default.oneOf(["extra-large", "large", "medium", "small"]),
|
|
155
|
+
"id": _propTypes.default.string,
|
|
156
|
+
"inputSize": _propTypes.default.oneOf(["large", "medium", "small"]),
|
|
157
|
+
"isPartOfInput": _propTypes.default.bool,
|
|
158
|
+
"m": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
159
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
160
|
+
"description": _propTypes.default.string,
|
|
161
|
+
"toString": _propTypes.default.func.isRequired,
|
|
162
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
163
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
164
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
165
|
+
"description": _propTypes.default.string,
|
|
166
|
+
"toString": _propTypes.default.func.isRequired,
|
|
167
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
168
|
+
}), _propTypes.default.string]),
|
|
169
|
+
"margin": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
170
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
171
|
+
"description": _propTypes.default.string,
|
|
172
|
+
"toString": _propTypes.default.func.isRequired,
|
|
173
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
174
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
175
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
176
|
+
"description": _propTypes.default.string,
|
|
177
|
+
"toString": _propTypes.default.func.isRequired,
|
|
178
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
179
|
+
}), _propTypes.default.string]),
|
|
180
|
+
"marginBottom": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
181
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
182
|
+
"description": _propTypes.default.string,
|
|
183
|
+
"toString": _propTypes.default.func.isRequired,
|
|
184
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
185
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
186
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
187
|
+
"description": _propTypes.default.string,
|
|
188
|
+
"toString": _propTypes.default.func.isRequired,
|
|
189
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
190
|
+
}), _propTypes.default.string]),
|
|
191
|
+
"marginLeft": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
192
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
193
|
+
"description": _propTypes.default.string,
|
|
194
|
+
"toString": _propTypes.default.func.isRequired,
|
|
195
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
196
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
197
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
198
|
+
"description": _propTypes.default.string,
|
|
199
|
+
"toString": _propTypes.default.func.isRequired,
|
|
200
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
201
|
+
}), _propTypes.default.string]),
|
|
202
|
+
"marginRight": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
203
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
204
|
+
"description": _propTypes.default.string,
|
|
205
|
+
"toString": _propTypes.default.func.isRequired,
|
|
206
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
207
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
208
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
209
|
+
"description": _propTypes.default.string,
|
|
210
|
+
"toString": _propTypes.default.func.isRequired,
|
|
211
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
212
|
+
}), _propTypes.default.string]),
|
|
213
|
+
"marginTop": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
214
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
215
|
+
"description": _propTypes.default.string,
|
|
216
|
+
"toString": _propTypes.default.func.isRequired,
|
|
217
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
218
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
219
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
220
|
+
"description": _propTypes.default.string,
|
|
221
|
+
"toString": _propTypes.default.func.isRequired,
|
|
222
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
223
|
+
}), _propTypes.default.string]),
|
|
224
|
+
"marginX": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
225
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
226
|
+
"description": _propTypes.default.string,
|
|
227
|
+
"toString": _propTypes.default.func.isRequired,
|
|
228
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
229
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
230
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
231
|
+
"description": _propTypes.default.string,
|
|
232
|
+
"toString": _propTypes.default.func.isRequired,
|
|
233
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
234
|
+
}), _propTypes.default.string]),
|
|
235
|
+
"marginY": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
236
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
237
|
+
"description": _propTypes.default.string,
|
|
238
|
+
"toString": _propTypes.default.func.isRequired,
|
|
239
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
240
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
241
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
242
|
+
"description": _propTypes.default.string,
|
|
243
|
+
"toString": _propTypes.default.func.isRequired,
|
|
244
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
245
|
+
}), _propTypes.default.string]),
|
|
246
|
+
"mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
247
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
248
|
+
"description": _propTypes.default.string,
|
|
249
|
+
"toString": _propTypes.default.func.isRequired,
|
|
250
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
251
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
252
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
253
|
+
"description": _propTypes.default.string,
|
|
254
|
+
"toString": _propTypes.default.func.isRequired,
|
|
255
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
256
|
+
}), _propTypes.default.string]),
|
|
257
|
+
"ml": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
258
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
259
|
+
"description": _propTypes.default.string,
|
|
260
|
+
"toString": _propTypes.default.func.isRequired,
|
|
261
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
262
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
263
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
264
|
+
"description": _propTypes.default.string,
|
|
265
|
+
"toString": _propTypes.default.func.isRequired,
|
|
266
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
267
|
+
}), _propTypes.default.string]),
|
|
268
|
+
"mr": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
269
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
270
|
+
"description": _propTypes.default.string,
|
|
271
|
+
"toString": _propTypes.default.func.isRequired,
|
|
272
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
273
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
274
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
275
|
+
"description": _propTypes.default.string,
|
|
276
|
+
"toString": _propTypes.default.func.isRequired,
|
|
277
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
278
|
+
}), _propTypes.default.string]),
|
|
279
|
+
"mt": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
280
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
281
|
+
"description": _propTypes.default.string,
|
|
282
|
+
"toString": _propTypes.default.func.isRequired,
|
|
283
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
284
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
285
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
286
|
+
"description": _propTypes.default.string,
|
|
287
|
+
"toString": _propTypes.default.func.isRequired,
|
|
288
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
289
|
+
}), _propTypes.default.string]),
|
|
290
|
+
"mx": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
291
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
292
|
+
"description": _propTypes.default.string,
|
|
293
|
+
"toString": _propTypes.default.func.isRequired,
|
|
294
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
295
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
296
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
297
|
+
"description": _propTypes.default.string,
|
|
298
|
+
"toString": _propTypes.default.func.isRequired,
|
|
299
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
300
|
+
}), _propTypes.default.string]),
|
|
301
|
+
"my": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
302
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
303
|
+
"description": _propTypes.default.string,
|
|
304
|
+
"toString": _propTypes.default.func.isRequired,
|
|
305
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
306
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
307
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
308
|
+
"description": _propTypes.default.string,
|
|
309
|
+
"toString": _propTypes.default.func.isRequired,
|
|
310
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
311
|
+
}), _propTypes.default.string]),
|
|
312
|
+
"role": _propTypes.default.string,
|
|
313
|
+
"tabIndex": _propTypes.default.number,
|
|
314
|
+
"tooltipBgColor": _propTypes.default.string,
|
|
315
|
+
"tooltipFlipOverrides": _propTypes.default.arrayOf(_propTypes.default.oneOf(["bottom", "left", "right", "top"])),
|
|
316
|
+
"tooltipFontColor": _propTypes.default.string,
|
|
317
|
+
"tooltipId": _propTypes.default.string,
|
|
318
|
+
"tooltipMessage": _propTypes.default.node,
|
|
319
|
+
"tooltipPosition": _propTypes.default.oneOf(["bottom", "left", "right", "top"]),
|
|
320
|
+
"tooltipVisible": _propTypes.default.bool,
|
|
321
|
+
"type": _propTypes.default.oneOf(["add", "admin", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "maintenance", "marker", "message", "messages", "minus_large", "minus", "mobile", "money_bag", "new", "none", "old_warning", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "success", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick", "true_tick", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]).isRequired
|
|
238
322
|
};
|
|
323
|
+
Icon.displayName = "Icon";
|
|
239
324
|
var _default = Icon;
|
|
240
325
|
exports.default = _default;
|
|
@@ -1,2 +1,38 @@
|
|
|
1
|
+
import { ThemeObject } from "../../style/themes/base";
|
|
2
|
+
import { IconType } from "./icon-type";
|
|
3
|
+
export declare type BackgroundShape = "circle" | "rounded-rect" | "square";
|
|
4
|
+
export declare type BgSize = "extra-small" | "small" | "medium" | "large" | "extra-large";
|
|
5
|
+
export declare type FontSize = "small" | "medium" | "large" | "extra-large";
|
|
6
|
+
export interface StyledIconProps {
|
|
7
|
+
/** Background colour, provide any color from palette or any valid css color value. */
|
|
8
|
+
bg?: string;
|
|
9
|
+
/** Background shape */
|
|
10
|
+
bgShape?: BackgroundShape;
|
|
11
|
+
/** Background size */
|
|
12
|
+
bgSize?: BgSize;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
* @ignore
|
|
16
|
+
* Add classes to this component
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Icon colour, provide any color from palette or any valid css color value. */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** Sets the icon in the disabled state */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Icon font size */
|
|
24
|
+
fontSize?: FontSize;
|
|
25
|
+
/**
|
|
26
|
+
* Icon type
|
|
27
|
+
*
|
|
28
|
+
* The full list of types can be seen [here](https://github.com/Sage/carbon/blob/master/src/components/icon/icon-config.js).
|
|
29
|
+
*/
|
|
30
|
+
type: IconType;
|
|
31
|
+
}
|
|
32
|
+
export interface StyledIconInternalProps {
|
|
33
|
+
isInteractive?: boolean;
|
|
34
|
+
hasTooltip?: boolean;
|
|
35
|
+
theme?: ThemeObject;
|
|
36
|
+
}
|
|
37
|
+
declare const StyledIcon: import("styled-components").StyledComponent<"span", any, StyledIconProps & StyledIconInternalProps, never>;
|
|
1
38
|
export default StyledIcon;
|
|
2
|
-
declare const StyledIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _polished = require("polished");
|
|
13
11
|
|
|
14
12
|
var _styledSystem = require("styled-system");
|
|
@@ -17,7 +15,7 @@ var _iconUnicodes = _interopRequireDefault(require("./icon-unicodes"));
|
|
|
17
15
|
|
|
18
16
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
19
17
|
|
|
20
|
-
var _iconConfig =
|
|
18
|
+
var _iconConfig = _interopRequireDefault(require("./icon-config"));
|
|
21
19
|
|
|
22
20
|
var _browserTypeCheck = _interopRequireWildcard(require("../../__internal__/utils/helpers/browser-type-check"));
|
|
23
21
|
|
|
@@ -32,29 +30,11 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
32
30
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
31
|
|
|
34
32
|
function adjustIconBgSize(fontSize, bgSize) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const replacements = {
|
|
38
|
-
medium: {
|
|
39
|
-
small: "medium"
|
|
40
|
-
},
|
|
41
|
-
large: {
|
|
42
|
-
small: "large",
|
|
43
|
-
medium: "large"
|
|
44
|
-
},
|
|
45
|
-
"extra-large": {
|
|
46
|
-
small: "extra-large",
|
|
47
|
-
medium: "extra-large",
|
|
48
|
-
large: "extra-large"
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const replacement = replacements === null || replacements === void 0 ? void 0 : (_replacements$fontSiz = replacements[fontSize]) === null || _replacements$fontSiz === void 0 ? void 0 : _replacements$fontSiz[bgSize];
|
|
52
|
-
|
|
53
|
-
if (replacement) {
|
|
54
|
-
return _iconConfig.default.backgroundSize[replacement];
|
|
33
|
+
if (fontSize && fontSize !== "small") {
|
|
34
|
+
return _iconConfig.default.backgroundSize[fontSize];
|
|
55
35
|
}
|
|
56
36
|
|
|
57
|
-
return _iconConfig.default.backgroundSize[bgSize];
|
|
37
|
+
return bgSize ? _iconConfig.default.backgroundSize[bgSize] : undefined;
|
|
58
38
|
}
|
|
59
39
|
|
|
60
40
|
const StyledIcon = _styledComponents.default.span`
|
|
@@ -121,7 +101,7 @@ const StyledIcon = _styledComponents.default.span`
|
|
|
121
101
|
justify-content: center;
|
|
122
102
|
height: ${adjustIconBgSize(fontSize, bgSize)};
|
|
123
103
|
width: ${adjustIconBgSize(fontSize, bgSize)};
|
|
124
|
-
border-radius: ${_iconConfig.default.backgroundShape[bgShape]};
|
|
104
|
+
${bgShape ? `border-radius: ${_iconConfig.default.backgroundShape[bgShape]}` : ""};
|
|
125
105
|
|
|
126
106
|
${isInteractive && (0, _styledComponents.css)`
|
|
127
107
|
&:hover {
|
|
@@ -136,12 +116,15 @@ const StyledIcon = _styledComponents.default.span`
|
|
|
136
116
|
|
|
137
117
|
font-family: CarbonIcons;
|
|
138
118
|
content: "${_iconUnicodes.default[type]}";
|
|
139
|
-
font-size: ${_iconConfig.default.iconSize[fontSize]};
|
|
140
119
|
font-style: normal;
|
|
141
120
|
font-weight: normal;
|
|
142
|
-
line-height: ${_iconConfig.default.iconSize[fontSize]};
|
|
143
121
|
vertical-align: middle;
|
|
144
122
|
|
|
123
|
+
${fontSize && (0, _styledComponents.css)`
|
|
124
|
+
font-size: ${_iconConfig.default.iconSize[fontSize]};
|
|
125
|
+
line-height: ${_iconConfig.default.iconSize[fontSize]};
|
|
126
|
+
`}
|
|
127
|
+
|
|
145
128
|
${type === "services" && (0, _browserTypeCheck.default)(window) && (0, _styledComponents.css)`
|
|
146
129
|
margin-top: ${fontSize === "small" ? "-7px" : "-8px"};
|
|
147
130
|
`}
|
|
@@ -163,15 +146,6 @@ const StyledIcon = _styledComponents.default.span`
|
|
|
163
146
|
`;
|
|
164
147
|
}}
|
|
165
148
|
`;
|
|
166
|
-
StyledIcon.propTypes = {
|
|
167
|
-
theme: _propTypes.default.object,
|
|
168
|
-
type: _propTypes.default.string,
|
|
169
|
-
isInteractive: _propTypes.default.bool,
|
|
170
|
-
disabled: _propTypes.default.bool,
|
|
171
|
-
bgSize: _propTypes.default.oneOf(["extra-small", "small", "medium", "large", "extra-large"]),
|
|
172
|
-
bgShape: _propTypes.default.oneOf(_iconConfig.ICON_SHAPES),
|
|
173
|
-
fontSize: _propTypes.default.oneOf(["small", "medium", "large", "extra-large"])
|
|
174
|
-
};
|
|
175
149
|
StyledIcon.defaultProps = {
|
|
176
150
|
theme: _base.default
|
|
177
151
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default } from "./icon";
|
|
2
|
-
export
|
|
1
|
+
export { default } from "./icon.component";
|
|
2
|
+
export type { IconProps } from "./icon.component";
|
|
3
|
+
export type { IconType } from "./icon-type";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
import { IconProps } from "../icon/icon";
|
|
3
|
+
import { IconProps } from "../icon/icon-type";
|
|
4
4
|
|
|
5
5
|
export interface IconButtonProps extends MarginProps {
|
|
6
6
|
/** Optional: alternative rendered content, displayed within <SelectList> of <Select> (eg: an icon, an image, etc) */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { IconType } from "components/icon/icon";
|
|
2
|
+
import { IconType } from "components/icon/icon-type";
|
|
3
3
|
export interface LinkProps extends React.AriaAttributes {
|
|
4
4
|
/** The disabled state of the link. */
|
|
5
5
|
disabled?: boolean;
|
|
@@ -34,5 +34,5 @@ export interface LinkProps extends React.AriaAttributes {
|
|
|
34
34
|
/** allows to set rel property in <a> tag */
|
|
35
35
|
rel?: string;
|
|
36
36
|
}
|
|
37
|
-
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<
|
|
37
|
+
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLButtonElement | HTMLLinkElement>>;
|
|
38
38
|
export default Link;
|