@coorpacademy/components 11.33.3-alpha.12 → 11.33.3
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/es/atom/button-link/index.d.ts +0 -1
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +7 -11
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +0 -10
- package/es/atom/button-link/types.d.ts +0 -2
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +1 -2
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/button-link-icon/style.css +2 -2
- package/es/atom/button-menu/index.d.ts +0 -15
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +5 -43
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/style.css +0 -13
- package/es/atom/button-menu/types.d.ts +0 -40
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/button-menu/types.js +1 -16
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/tag/style.css +6 -10
- package/es/molecule/bullet-point-menu-button/index.d.ts +0 -16
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +3 -5
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/style.css +7 -26
- package/es/molecule/bullet-point-menu-button/types.d.ts +0 -17
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/types.js +1 -2
- package/es/molecule/bullet-point-menu-button/types.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +0 -34
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +0 -33
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +0 -33
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/organism/list-items/index.d.ts +0 -34
- package/es/organism/setup-header/index.d.ts +0 -4
- package/es/organism/wizard-contents/index.d.ts +0 -35
- package/es/template/app-player/loading/index.d.ts +0 -34
- package/es/template/app-player/player/index.d.ts +0 -68
- package/es/template/app-player/player/slides/index.d.ts +0 -34
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +0 -34
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +0 -34
- package/es/template/app-review/index.d.ts +0 -34
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +0 -34
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +0 -34
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +0 -4
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +0 -4
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +0 -107
- package/es/template/back-office/dashboard-preview/index.d.ts +0 -4
- package/es/template/back-office/layout/index.d.ts +0 -4
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +0 -68
- package/es/template/common/search-page/index.d.ts +0 -34
- package/es/template/external-course/index.d.ts +0 -34
- package/es/variables/colors.css +0 -3
- package/lib/atom/button-link/index.d.ts +0 -1
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +7 -11
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +0 -10
- package/lib/atom/button-link/types.d.ts +0 -2
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +1 -2
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/button-link-icon/style.css +2 -2
- package/lib/atom/button-menu/index.d.ts +0 -15
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +5 -43
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/style.css +0 -13
- package/lib/atom/button-menu/types.d.ts +0 -40
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/button-menu/types.js +1 -16
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/tag/style.css +6 -10
- package/lib/molecule/bullet-point-menu-button/index.d.ts +0 -16
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +3 -5
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/style.css +7 -26
- package/lib/molecule/bullet-point-menu-button/types.d.ts +0 -17
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/types.js +1 -2
- package/lib/molecule/bullet-point-menu-button/types.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +0 -34
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +0 -33
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +0 -33
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/organism/list-items/index.d.ts +0 -34
- package/lib/organism/setup-header/index.d.ts +0 -4
- package/lib/organism/wizard-contents/index.d.ts +0 -35
- package/lib/template/app-player/loading/index.d.ts +0 -34
- package/lib/template/app-player/player/index.d.ts +0 -68
- package/lib/template/app-player/player/slides/index.d.ts +0 -34
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +0 -34
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +0 -34
- package/lib/template/app-review/index.d.ts +0 -34
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +0 -34
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +0 -34
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +0 -4
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +0 -4
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +0 -107
- package/lib/template/back-office/dashboard-preview/index.d.ts +0 -4
- package/lib/template/back-office/layout/index.d.ts +0 -4
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +0 -68
- package/lib/template/common/search-page/index.d.ts +0 -34
- package/lib/template/external-course/index.d.ts +0 -34
- package/lib/variables/colors.css +0 -3
- package/package.json +3 -3
- package/es/organism/custom-skill-header/index.d.ts +0 -5
- package/es/organism/custom-skill-header/index.d.ts.map +0 -1
- package/es/organism/custom-skill-header/index.js +0 -88
- package/es/organism/custom-skill-header/index.js.map +0 -1
- package/es/organism/custom-skill-header/style.css +0 -54
- package/es/organism/custom-skill-header/types.d.ts +0 -28
- package/es/organism/custom-skill-header/types.d.ts.map +0 -1
- package/es/organism/custom-skill-header/types.js +0 -2
- package/es/organism/custom-skill-header/types.js.map +0 -1
- package/lib/organism/custom-skill-header/index.d.ts +0 -5
- package/lib/organism/custom-skill-header/index.d.ts.map +0 -1
- package/lib/organism/custom-skill-header/index.js +0 -93
- package/lib/organism/custom-skill-header/index.js.map +0 -1
- package/lib/organism/custom-skill-header/style.css +0 -54
- package/lib/organism/custom-skill-header/types.d.ts +0 -28
- package/lib/organism/custom-skill-header/types.d.ts.map +0 -1
- package/lib/organism/custom-skill-header/types.js +0 -4
- package/lib/organism/custom-skill-header/types.js.map +0 -1
- package/locales/.mtslconfig.json +0 -1
|
@@ -138,7 +138,6 @@ declare namespace ExternalCourse {
|
|
|
138
138
|
disabled: PropTypes.Requireable<boolean>;
|
|
139
139
|
className: PropTypes.Requireable<string>;
|
|
140
140
|
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
141
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
142
141
|
}>>;
|
|
143
142
|
selectMultiple: PropTypes.Requireable<PropTypes.InferProps<{
|
|
144
143
|
title: PropTypes.Requireable<string>;
|
|
@@ -256,26 +255,10 @@ declare namespace ExternalCourse {
|
|
|
256
255
|
label: PropTypes.Validator<string>;
|
|
257
256
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
258
257
|
type: PropTypes.Requireable<string>;
|
|
259
|
-
linkType: PropTypes.Requireable<string>;
|
|
260
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
261
|
-
position: PropTypes.Validator<string>;
|
|
262
|
-
type: PropTypes.Requireable<string>;
|
|
263
|
-
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
264
|
-
name: PropTypes.Validator<string>;
|
|
265
|
-
size: PropTypes.Requireable<number>;
|
|
266
|
-
color: PropTypes.Requireable<string>;
|
|
267
|
-
}>>;
|
|
268
|
-
}>>;
|
|
269
|
-
customStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
270
|
-
color: PropTypes.Requireable<string>;
|
|
271
|
-
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
272
|
-
}>>;
|
|
273
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
274
258
|
}> | null | undefined)[]>;
|
|
275
259
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
276
260
|
menuButtonClassName: PropTypes.Requireable<string>;
|
|
277
261
|
isBulkMenu: PropTypes.Requireable<boolean>;
|
|
278
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
279
262
|
}> | null | undefined>>;
|
|
280
263
|
}> | null | undefined)[]>;
|
|
281
264
|
stickyFirstColumn: PropTypes.Requireable<boolean>;
|
|
@@ -308,7 +291,6 @@ declare namespace ExternalCourse {
|
|
|
308
291
|
disabled: PropTypes.Requireable<boolean>;
|
|
309
292
|
className: PropTypes.Requireable<string>;
|
|
310
293
|
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
311
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
312
294
|
}> | PropTypes.InferProps<{
|
|
313
295
|
componentType: PropTypes.Requireable<string>;
|
|
314
296
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -320,26 +302,10 @@ declare namespace ExternalCourse {
|
|
|
320
302
|
label: PropTypes.Validator<string>;
|
|
321
303
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
322
304
|
type: PropTypes.Requireable<string>;
|
|
323
|
-
linkType: PropTypes.Requireable<string>;
|
|
324
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
325
|
-
position: PropTypes.Validator<string>;
|
|
326
|
-
type: PropTypes.Requireable<string>;
|
|
327
|
-
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
328
|
-
name: PropTypes.Validator<string>;
|
|
329
|
-
size: PropTypes.Requireable<number>;
|
|
330
|
-
color: PropTypes.Requireable<string>;
|
|
331
|
-
}>>;
|
|
332
|
-
}>>;
|
|
333
|
-
customStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
334
|
-
color: PropTypes.Requireable<string>;
|
|
335
|
-
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
336
|
-
}>>;
|
|
337
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
338
305
|
}> | null | undefined)[]>;
|
|
339
306
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
340
307
|
menuButtonClassName: PropTypes.Requireable<string>;
|
|
341
308
|
isBulkMenu: PropTypes.Requireable<boolean>;
|
|
342
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
343
309
|
}> | null | undefined>>;
|
|
344
310
|
isNestedTable: PropTypes.Requireable<boolean>;
|
|
345
311
|
emptyStateFirstMessage: PropTypes.Requireable<string>;
|
package/es/variables/colors.css
CHANGED
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
@value cm_grey_900: #111117;
|
|
49
49
|
@value cm_positive_100: #35CC7F;
|
|
50
50
|
@value cm_positive_200: #05944F;
|
|
51
|
-
@value cm_positive_300: #04713D;
|
|
52
51
|
@value cm_negative_100: #ed3436;
|
|
53
52
|
@value cm_negative_200: #b81400;
|
|
54
53
|
@value cm_negative_50: #ffe5e6;
|
|
@@ -58,14 +57,12 @@
|
|
|
58
57
|
@value cm_green_secondary_200: #38CC6C;
|
|
59
58
|
@value cm_orange_200: #FF7043;
|
|
60
59
|
@value cm_orange_700: #FF4105;
|
|
61
|
-
@value cm_orange_800: #A32700;
|
|
62
60
|
@value cm_pink_50: #ffefeb;
|
|
63
61
|
@value cm_purple_200: #7340FF;
|
|
64
62
|
@value cm_yellow_scorm: #FFB800;
|
|
65
63
|
@value cm_yellow_secondary_200: #ffde03;
|
|
66
64
|
@value cm_yellow_100: #ffc043;
|
|
67
65
|
@value cm_yellow_200: #DB9200;
|
|
68
|
-
@value cm_yellow_300: #B87A00;
|
|
69
66
|
@value cm_yellow_400: #bd7e00;
|
|
70
67
|
@value cm_red_200: #FF4040;
|
|
71
68
|
@value cm_negative_red_200: #ED3436;
|
|
@@ -27,7 +27,6 @@ declare const ButtonLink: {
|
|
|
27
27
|
disabled: import("prop-types").Requireable<boolean>;
|
|
28
28
|
className: import("prop-types").Requireable<string>;
|
|
29
29
|
customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{}>>;
|
|
30
|
-
isCustomSkillMenu: import("prop-types").Requireable<boolean>;
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
32
|
export default ButtonLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAOA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAOA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAoD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
18
|
-
const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverColor
|
|
18
|
+
const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverColor) => {
|
|
19
19
|
const {
|
|
20
20
|
type,
|
|
21
21
|
faIcon,
|
|
@@ -25,14 +25,11 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
25
25
|
position: ''
|
|
26
26
|
};
|
|
27
27
|
const Icon = type && _buttonIcons.ICONS[type];
|
|
28
|
-
const labelClassName = (0, _classnames.default)(_style.default.label, {
|
|
29
|
-
[_style.default.customSkillLabel]: isCustomSkillMenu && faIcon
|
|
30
|
-
});
|
|
31
28
|
if (!Icon && !faIcon) {
|
|
32
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
30
|
className: _style.default.buttonContent
|
|
34
31
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
-
className:
|
|
32
|
+
className: _style.default.label
|
|
36
33
|
}, content));
|
|
37
34
|
}
|
|
38
35
|
const iconComponent = faIcon ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -52,7 +49,7 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
52
49
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
50
|
className: _style.default.buttonContent
|
|
54
51
|
}, position === 'left' ? iconComponent : null, content ? /*#__PURE__*/_react.default.createElement("span", {
|
|
55
|
-
className:
|
|
52
|
+
className: _style.default.label
|
|
56
53
|
}, content) : null, position === 'right' ? iconComponent : null);
|
|
57
54
|
};
|
|
58
55
|
const ButtonLink = props => {
|
|
@@ -75,10 +72,9 @@ const ButtonLink = props => {
|
|
|
75
72
|
onKeyDown = _noop2.default,
|
|
76
73
|
className,
|
|
77
74
|
customStyle,
|
|
78
|
-
useTitle = true
|
|
79
|
-
isCustomSkillMenu
|
|
75
|
+
useTitle = true
|
|
80
76
|
} = props;
|
|
81
|
-
const styleButton = (0, _classnames.default)(className, _style.default.button, !label && _style.default.iconButton, type === 'primary' && _style.default.primary, type === 'secondary' && _style.default.secondary, type === 'tertiary' && _style.default.tertiary, type === 'text' && _style.default.text, type === 'dangerous' && _style.default.dangerous, link && _style.default.link, disabled && _style.default.disabled
|
|
77
|
+
const styleButton = (0, _classnames.default)(className, _style.default.button, !label && _style.default.iconButton, type === 'primary' && _style.default.primary, type === 'secondary' && _style.default.secondary, type === 'tertiary' && _style.default.tertiary, type === 'text' && _style.default.text, type === 'dangerous' && _style.default.dangerous, link && _style.default.link, disabled && _style.default.disabled);
|
|
82
78
|
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
83
79
|
const handleOnClick = (0, _react.useCallback)(event => onClick(event), [onClick]);
|
|
84
80
|
const handleOnKeyDown = (0, _react.useCallback)(event => onKeyDown(event), [onKeyDown]);
|
|
@@ -123,7 +119,7 @@ const ButtonLink = props => {
|
|
|
123
119
|
hoverBackgroundColor: hoverBackgroundColor,
|
|
124
120
|
onMouseEnter: handleMouseOver,
|
|
125
121
|
onMouseLeave: handleMouseLeave
|
|
126
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor
|
|
122
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor), renderToolTip());
|
|
127
123
|
}
|
|
128
124
|
return /*#__PURE__*/_react.default.createElement("button", _extends({}, useTitle && {
|
|
129
125
|
title: ariaLabel || label
|
|
@@ -144,7 +140,7 @@ const ButtonLink = props => {
|
|
|
144
140
|
onMouseLeave: handleMouseLeave,
|
|
145
141
|
tabIndex: 0,
|
|
146
142
|
disabled: disabled
|
|
147
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor
|
|
143
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor), renderToolTip());
|
|
148
144
|
};
|
|
149
145
|
ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
|
|
150
146
|
var _default = exports.default = ButtonLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_link","_icon","_buttonIcons","_tooltip","_types","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","isCustomSkillMenu","type","faIcon","position","Icon","ICONS","labelClassName","classnames","style","label","customSkillLabel","createElement","className","buttonContent","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop2","onKeyDown","useTitle","styleButton","button","iconButton","primary","secondary","tertiary","text","dangerous","customSkillButton","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","useMemo","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","propTypes","process","env","NODE_ENV","_default","exports"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string,\n isCustomSkillMenu?: boolean\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n const labelClassName = classnames(style.label, {\n [style.customSkillLabel]: isCustomSkillMenu && faIcon\n });\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={labelClassName}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={labelClassName}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true,\n isCustomSkillMenu\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled,\n isCustomSkillMenu && style.customSkillButton\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n isCustomSkillMenu\n )}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\n : {})}\n // eslint-disable-next-line react/button-has-type\n type={usage}\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={_customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n isCustomSkillMenu\n )}\n {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAA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AAItB,KAAM;MAC/BV,UAAU,EAAEA,UAAW;MACvBD,oBAAoB,EAAEA,oBAAqB;MAC3CqE,YAAY,EAAEb,eAAgB;MAC9Bc,YAAY,EAAEb;IAAiB,IAE9B7D,gBAAgB,CACfC,IAAI,EACJC,OAAO,IAAIa,KAAK,EAChBZ,OAAO,EACPC,oBAAoB,EACpBC,UAAU,EACVC,iBACF,CAAC,EACA0D,aAAa,CAAC,CACX,CAAC;EAEX;EAEA,oBACErG,MAAA,CAAAiB,OAAA,CAAAqC,aAAA,WAAAvB,QAAA,KACOkD,QAAQ,IAAI;IACf4B,KAAK,EAAEnC,SAAS,IAAItB;EACtB,CAAC,EACIsB,SAAS,IAAI,CAACtB,KAAK,GACpB;IACE,UAAU,EAAE,aAAa;IACzB,UAAU,EAAEZ;EACd,CAAC,GACD,CAAC,CAAC;IACN;IACAI,IAAI,EAAE0B,KAAM;IACZ,cAAYI,SAAS,IAAItB,KAAM;IAC/B,aAAWoB,QAAS;IACpB,eAAaC,UAAW;IACxBtB,KAAK,EAAEwD,YAAa;IACpBpD,SAAS,EAAE2B,WAAY;IACvBJ,OAAO,EAAEe,aAAc;IACvBb,SAAS,EAAEgB,eAAgB;IAC3BgB,WAAW,EAAEf,eAAgB;IAC7Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZ1C,QAAQ,EAAEA;EAAS,IAElBlC,gBAAgB,CACfC,IAAI,EACJC,OAAO,IAAIa,KAAK,EAChBZ,OAAO,EACPC,oBAAoB,EACpBC,UAAU,EACVC,iBACF,CAAC,EACA0D,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAEDjC,UAAU,CAAC8C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAtG,OAAA,GAElBmD,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_link","_icon","_buttonIcons","_tooltip","_types","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","createElement","className","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop2","onKeyDown","useTitle","styleButton","classnames","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","useMemo","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","propTypes","process","env","NODE_ENV","_default","exports"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\n : {})}\n // eslint-disable-next-line react/button-has-type\n type={usage}\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={_customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,MA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a,KAAK,EAAEZ,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFuD,aAAa,CAAC,CACX,CAAC;EAEX;EAEA,oBACEjG,MAAA,CAAAiB,OAAA,CAAA+B,aAAA,WAAAjB,QAAA,KACO8C,QAAQ,IAAI;IACf4B,KAAK,EAAEnC,SAAS,IAAIlB;EACtB,CAAC,EACIkB,SAAS,IAAI,CAAClB,KAAK,GACpB;IACE,UAAU,EAAE,aAAa;IACzB,UAAU,EAAEZ;EACd,CAAC,GACD,CAAC,CAAC;IACN;IACAG,IAAI,EAAEuB,KAAM;IACZ,cAAYI,SAAS,IAAIlB,KAAM;IAC/B,aAAWgB,QAAS;IACpB,eAAaC,UAAW;IACxBnB,KAAK,EAAEqD,YAAa;IACpBtD,SAAS,EAAE6B,WAAY;IACvBJ,OAAO,EAAEe,aAAc;IACvBb,SAAS,EAAEgB,eAAgB;IAC3BgB,WAAW,EAAEf,eAAgB;IAC7Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZ1C,QAAQ,EAAEA;EAAS,IAElB9B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIa,KAAK,EAAEZ,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFuD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAEDjC,UAAU,CAAC8C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAlG,OAAA,GAElB+C,UAAU","ignoreList":[]}
|
|
@@ -26,7 +26,6 @@ declare const propTypes: {
|
|
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
27
27
|
className: PropTypes.Requireable<string>;
|
|
28
28
|
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
29
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
30
29
|
};
|
|
31
30
|
export declare type FaIcontype = {
|
|
32
31
|
name: string;
|
|
@@ -64,7 +63,6 @@ export declare type ButtonLinkProps = {
|
|
|
64
63
|
className?: string;
|
|
65
64
|
customStyle?: Record<string, unknown>;
|
|
66
65
|
useTitle?: boolean;
|
|
67
|
-
isCustomSkillMenu?: boolean;
|
|
68
66
|
};
|
|
69
67
|
export declare type Fixture = {
|
|
70
68
|
props: ButtonLinkProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;CAyBd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AACF,oBAAY,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;IACnE,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;KAClD,CAAC;IACF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -30,8 +30,7 @@ const propTypes = {
|
|
|
30
30
|
hoverColor: _propTypes.default.string,
|
|
31
31
|
disabled: _propTypes.default.bool,
|
|
32
32
|
className: _propTypes.default.string,
|
|
33
|
-
customStyle: _propTypes.default.shape({})
|
|
34
|
-
isCustomSkillMenu: _propTypes.default.bool
|
|
33
|
+
customStyle: _propTypes.default.shape({})
|
|
35
34
|
};
|
|
36
35
|
var _default = exports.default = propTypes;
|
|
37
36
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["_propTypes","_interopRequireDefault","require","_buttonIcons","e","__esModule","default","propTypes","type","PropTypes","oneOf","usage","label","string","content","node","tooltipText","tooltipPlacement","icon","shape","position","_keys2","ICONS","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","customStyle","
|
|
1
|
+
{"version":3,"file":"types.js","names":["_propTypes","_interopRequireDefault","require","_buttonIcons","e","__esModule","default","propTypes","type","PropTypes","oneOf","usage","label","string","content","node","tooltipText","tooltipPlacement","icon","shape","position","_keys2","ICONS","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","customStyle","_default","exports"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport type FaIcontype = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: Record<string, unknown>;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIcontype;\n};\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: React.ReactNode;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAA8C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C,MAAMG,SAAS,GAAG;EAChBC,IAAI,EAAEC,kBAAS,CAACC,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAChFC,KAAK,EAAEF,kBAAS,CAACC,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;EACrDE,KAAK,EAAEH,kBAAS,CAACI,MAAM;EACvBC,OAAO,EAAEL,kBAAS,CAACM,IAAI;EACvB,YAAY,EAAEN,kBAAS,CAACI,MAAM;EAC9BG,WAAW,EAAEP,kBAAS,CAACI,MAAM;EAC7BI,gBAAgB,EAAER,kBAAS,CAACC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EACrE,WAAW,EAAED,kBAAS,CAACI,MAAM;EAC7B,aAAa,EAAEJ,kBAAS,CAACI,MAAM;EAC/BK,IAAI,EAAET,kBAAS,CAACU,KAAK,CAAC;IACpBC,QAAQ,EAAEX,kBAAS,CAACC,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5CF,IAAI,EAAEC,kBAAS,CAACC,KAAK,CAAC,IAAAW,MAAA,CAAAf,OAAA,EAAKgB,kBAAK,CAAC;EACnC,CAAC,CAAC;EACFC,OAAO,EAAEd,kBAAS,CAACe,IAAI;EACvBC,IAAI,EAAEhB,kBAAS,CAACU,KAAK,CAAC;IACpBO,IAAI,EAAEjB,kBAAS,CAACI,MAAM;IACtBc,QAAQ,EAAElB,kBAAS,CAACmB,IAAI;IACxBC,MAAM,EAAEpB,kBAAS,CAACC,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFoB,oBAAoB,EAAErB,kBAAS,CAACI,MAAM;EACtCkB,UAAU,EAAEtB,kBAAS,CAACI,MAAM;EAC5BmB,QAAQ,EAAEvB,kBAAS,CAACmB,IAAI;EACxBK,SAAS,EAAExB,kBAAS,CAACI,MAAM;EAC3BqB,WAAW,EAAEzB,kBAAS,CAACU,KAAK,CAAC,CAAC,CAAC;AACjC,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAA9B,OAAA,GA2CaC,SAAS","ignoreList":[]}
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
composes: button;
|
|
47
47
|
width: 44px;
|
|
48
48
|
height: 44px;
|
|
49
|
-
border-radius:
|
|
49
|
+
border-radius: 7px;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.responsive {
|
|
53
53
|
composes: button;
|
|
54
54
|
width: 44px;
|
|
55
55
|
height: 44px;
|
|
56
|
-
border-radius:
|
|
56
|
+
border-radius: 7px;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.responsive .icon {
|
|
@@ -9,21 +9,6 @@ declare const ButtonMenu: {
|
|
|
9
9
|
label: import("prop-types").Validator<string>;
|
|
10
10
|
onClick: import("prop-types").Validator<(...args: any[]) => any>;
|
|
11
11
|
type: import("prop-types").Requireable<string>;
|
|
12
|
-
linkType: import("prop-types").Requireable<string>;
|
|
13
|
-
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
14
|
-
position: import("prop-types").Validator<string>;
|
|
15
|
-
type: import("prop-types").Requireable<string>;
|
|
16
|
-
faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
17
|
-
name: import("prop-types").Validator<string>;
|
|
18
|
-
size: import("prop-types").Requireable<number>;
|
|
19
|
-
color: import("prop-types").Requireable<string>;
|
|
20
|
-
}>>;
|
|
21
|
-
}>>;
|
|
22
|
-
customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
23
|
-
color: import("prop-types").Requireable<string>;
|
|
24
|
-
hoverBackgroundColor: import("prop-types").Requireable<string>;
|
|
25
|
-
}>>;
|
|
26
|
-
isCustomSkillMenu: import("prop-types").Requireable<boolean>;
|
|
27
12
|
}> | null | undefined)[]>;
|
|
28
13
|
'data-name': import("prop-types").Requireable<string>;
|
|
29
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AAiCjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;CAazC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -5,57 +5,23 @@ exports.default = void 0;
|
|
|
5
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
7
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
-
var _buttonLink = _interopRequireDefault(require("../button-link"));
|
|
9
8
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
10
9
|
var _types = _interopRequireWildcard(require("./types"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
13
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
-
const getIconProps = icon => {
|
|
16
|
-
if (!icon) return undefined;
|
|
17
|
-
return icon.faIcon ? {
|
|
18
|
-
faIcon: {
|
|
19
|
-
name: icon.faIcon.name,
|
|
20
|
-
size: icon.faIcon.size,
|
|
21
|
-
color: icon.faIcon.color
|
|
22
|
-
},
|
|
23
|
-
position: icon.position
|
|
24
|
-
} : {
|
|
25
|
-
type: icon.type,
|
|
26
|
-
position: icon.position
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
14
|
const Button = props => {
|
|
30
15
|
const {
|
|
31
16
|
'data-name': dataName,
|
|
32
17
|
disabled,
|
|
33
18
|
label,
|
|
34
19
|
onClick,
|
|
35
|
-
type = 'default'
|
|
36
|
-
linkType,
|
|
37
|
-
icon,
|
|
38
|
-
customStyle,
|
|
39
|
-
isCustomSkillMenu
|
|
20
|
+
type = 'default'
|
|
40
21
|
} = props;
|
|
41
|
-
const styleButton = (0, _classnames.default)(_style.default.button, type === 'default' && _style.default.default, type === 'defaultLeft' && _style.default.defaultLeft, type === 'dangerous' && _style.default.dangerous, type === 'dangerousLeft' && _style.default.dangerousLeft, disabled && _style.default.disabled
|
|
22
|
+
const styleButton = (0, _classnames.default)(_style.default.button, type === 'default' && _style.default.default, type === 'defaultLeft' && _style.default.defaultLeft, type === 'dangerous' && _style.default.dangerous, type === 'dangerousLeft' && _style.default.dangerousLeft, disabled && _style.default.disabled);
|
|
42
23
|
const handleOnClick = (0, _react.useCallback)(() => onClick(), [onClick]);
|
|
43
|
-
|
|
44
|
-
return icon ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
45
|
-
label: label,
|
|
46
|
-
type: linkType,
|
|
47
|
-
disabled: disabled,
|
|
48
|
-
onClick: handleOnClick,
|
|
49
|
-
"data-name": dataName,
|
|
50
|
-
className: styleButton,
|
|
51
|
-
customStyle: {
|
|
52
|
-
color: customStyle?.color
|
|
53
|
-
},
|
|
54
|
-
hoverBackgroundColor: customStyle?.hoverBackgroundColor,
|
|
55
|
-
hoverColor: customStyle?.color,
|
|
56
|
-
icon: iconProps,
|
|
57
|
-
isCustomSkillMenu: isCustomSkillMenu
|
|
58
|
-
}) : /*#__PURE__*/_react.default.createElement("button", {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
59
25
|
type: "button",
|
|
60
26
|
"aria-label": label,
|
|
61
27
|
title: label,
|
|
@@ -73,8 +39,7 @@ Button.propTypes = process.env.NODE_ENV !== "production" ? _types.buttonPropType
|
|
|
73
39
|
const ButtonMenu = props => {
|
|
74
40
|
const {
|
|
75
41
|
buttons,
|
|
76
|
-
'data-name': dataName
|
|
77
|
-
isCustomSkillMenu
|
|
42
|
+
'data-name': dataName
|
|
78
43
|
} = props;
|
|
79
44
|
const buildButton = (0, _react.useCallback)((button, index) => {
|
|
80
45
|
return /*#__PURE__*/_react.default.createElement(Button, _extends({}, button, {
|
|
@@ -87,10 +52,7 @@ const ButtonMenu = props => {
|
|
|
87
52
|
cap: false
|
|
88
53
|
})(buildButton, buttons), [buttons, buildButton]);
|
|
89
54
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
"data-name": dataName
|
|
91
|
-
className: (0, _classnames.default)({
|
|
92
|
-
[_style.default.buttonMenuContainer]: isCustomSkillMenu
|
|
93
|
-
})
|
|
55
|
+
"data-name": dataName
|
|
94
56
|
}, buttonList);
|
|
95
57
|
};
|
|
96
58
|
ButtonMenu.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_map","_interopRequireDefault","_classnames","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_map","_interopRequireDefault","_classnames","_style","_types","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","Button","props","dataName","disabled","label","onClick","type","styleButton","classnames","style","button","defaultLeft","dangerous","dangerousLeft","handleOnClick","useCallback","createElement","title","className","buttonContent","propTypes","process","env","NODE_ENV","buttonPropTypes","ButtonMenu","buttons","buildButton","index","key","buttonList","useMemo","map","convert","cap","_default","exports"],"sources":["../../../src/atom/button-menu/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport map from 'lodash/fp/map';\nimport classnames from 'classnames';\nimport style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\n\nconst Button = (props: ButtonProps) => {\n const {'data-name': dataName, disabled, label, onClick, type = 'default'} = props;\n const styleButton = classnames(\n style.button,\n type === 'default' && style.default,\n type === 'defaultLeft' && style.defaultLeft,\n type === 'dangerous' && style.dangerous,\n type === 'dangerousLeft' && style.dangerousLeft,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n data-name={dataName}\n className={styleButton}\n onClick={handleOnClick}\n disabled={disabled}\n >\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n </button>\n );\n};\n\nButton.propTypes = buttonPropTypes;\n\nconst ButtonMenu = (props: ButtonMenuProps) => {\n const {buttons, 'data-name': dataName} = props;\n const buildButton = useCallback((button: ButtonProps, index) => {\n return <Button {...button} key={button.label + index} />;\n }, []);\n\n const buttonList = useMemo(\n // @ts-expect-error (to avoid using map as any)\n () => map.convert({cap: false})(buildButton, buttons),\n [buttons, buildButton]\n );\n\n return <div data-name={dataName}>{buttonList}</div>;\n};\n\nButtonMenu.propTypes = propTypes;\n\nexport default ButtonMenu;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAN,uBAAA,CAAAC,OAAA;AAAiF,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EA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;EAC9C,MAAM0B,WAAW,GAAG,IAAAZ,kBAAW,EAAC,CAACL,MAAmB,EAAEkB,KAAK,KAAK;IAC9D,oBAAO9D,MAAA,CAAAU,OAAA,CAAAwC,aAAA,CAAChB,MAAM,EAAAN,QAAA,KAAKgB,MAAM;MAAEmB,GAAG,EAAEnB,MAAM,CAACN,KAAK,GAAGwB;IAAM,EAAE,CAAC;EAC1D,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,UAAU,GAAG,IAAAC,cAAO;EACxB;EACA,MAAMC,YAAG,CAACC,OAAO,CAAC;IAACC,GAAG,EAAE;EAAK,CAAC,CAAC,CAACP,WAAW,EAAED,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEC,WAAW,CACvB,CAAC;EAED,oBAAO7D,MAAA,CAAAU,OAAA,CAAAwC,aAAA;IAAK,aAAWd;EAAS,GAAE4B,UAAgB,CAAC;AACrD,CAAC;AAEDL,UAAU,CAACL,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAA5D,OAAA,GAElBiD,UAAU","ignoreList":[]}
|
|
@@ -59,16 +59,3 @@
|
|
|
59
59
|
composes: dangerous;
|
|
60
60
|
justify-content: flex-start;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
.customSkillButton {
|
|
64
|
-
background-color: transparent;
|
|
65
|
-
font-weight: 600;
|
|
66
|
-
width: 201px;
|
|
67
|
-
justify-content: flex-start;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.buttonMenuContainer {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
gap: 8px;
|
|
74
|
-
}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { ButtonLinkProps, IconType } from '../button-link/types';
|
|
3
2
|
export declare const buttonPropTypes: {
|
|
4
3
|
'data-name': PropTypes.Requireable<string>;
|
|
5
4
|
disabled: PropTypes.Requireable<boolean>;
|
|
6
5
|
label: PropTypes.Validator<string>;
|
|
7
6
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
7
|
type: PropTypes.Requireable<string>;
|
|
9
|
-
linkType: PropTypes.Requireable<string>;
|
|
10
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
11
|
-
position: PropTypes.Validator<string>;
|
|
12
|
-
type: PropTypes.Requireable<string>;
|
|
13
|
-
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
14
|
-
name: PropTypes.Validator<string>;
|
|
15
|
-
size: PropTypes.Requireable<number>;
|
|
16
|
-
color: PropTypes.Requireable<string>;
|
|
17
|
-
}>>;
|
|
18
|
-
}>>;
|
|
19
|
-
customStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
-
color: PropTypes.Requireable<string>;
|
|
21
|
-
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
22
|
-
}>>;
|
|
23
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
24
8
|
};
|
|
25
9
|
declare const propTypes: {
|
|
26
10
|
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
@@ -29,45 +13,21 @@ declare const propTypes: {
|
|
|
29
13
|
label: PropTypes.Validator<string>;
|
|
30
14
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
31
15
|
type: PropTypes.Requireable<string>;
|
|
32
|
-
linkType: PropTypes.Requireable<string>;
|
|
33
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
34
|
-
position: PropTypes.Validator<string>;
|
|
35
|
-
type: PropTypes.Requireable<string>;
|
|
36
|
-
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
-
name: PropTypes.Validator<string>;
|
|
38
|
-
size: PropTypes.Requireable<number>;
|
|
39
|
-
color: PropTypes.Requireable<string>;
|
|
40
|
-
}>>;
|
|
41
|
-
}>>;
|
|
42
|
-
customStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
43
|
-
color: PropTypes.Requireable<string>;
|
|
44
|
-
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
45
|
-
}>>;
|
|
46
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
47
16
|
}> | null | undefined)[]>;
|
|
48
17
|
'data-name': PropTypes.Requireable<string>;
|
|
49
18
|
};
|
|
50
19
|
export default propTypes;
|
|
51
|
-
declare type CustomStyleProps = {
|
|
52
|
-
color?: string;
|
|
53
|
-
hoverBackgroundColor?: string;
|
|
54
|
-
};
|
|
55
20
|
export declare type ButtonProps = {
|
|
56
21
|
'data-name'?: string;
|
|
57
22
|
disabled?: boolean;
|
|
58
23
|
label: string;
|
|
59
24
|
onClick: () => void;
|
|
60
25
|
type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';
|
|
61
|
-
linkType?: ButtonLinkProps['type'];
|
|
62
|
-
icon?: IconType;
|
|
63
|
-
customStyle?: CustomStyleProps;
|
|
64
|
-
isCustomSkillMenu?: boolean;
|
|
65
26
|
};
|
|
66
27
|
export declare type ButtonMenuProps = {
|
|
67
28
|
buttons: ButtonProps[];
|
|
68
29
|
'data-name'?: string;
|
|
69
30
|
'aria-label'?: string;
|
|
70
|
-
isCustomSkillMenu?: boolean;
|
|
71
31
|
};
|
|
72
32
|
export declare type ButtonMenuPropsFixture = {
|
|
73
33
|
props: ButtonMenuProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;CAGd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC;CAClE,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC"}
|
|
@@ -9,22 +9,7 @@ const buttonPropTypes = exports.buttonPropTypes = {
|
|
|
9
9
|
disabled: _propTypes.default.bool,
|
|
10
10
|
label: _propTypes.default.string.isRequired,
|
|
11
11
|
onClick: _propTypes.default.func.isRequired,
|
|
12
|
-
type: _propTypes.default.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft'])
|
|
13
|
-
linkType: _propTypes.default.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
|
|
14
|
-
icon: _propTypes.default.shape({
|
|
15
|
-
position: _propTypes.default.oneOf(['right', 'left']).isRequired,
|
|
16
|
-
type: _propTypes.default.string,
|
|
17
|
-
faIcon: _propTypes.default.shape({
|
|
18
|
-
name: _propTypes.default.string.isRequired,
|
|
19
|
-
size: _propTypes.default.number,
|
|
20
|
-
color: _propTypes.default.string
|
|
21
|
-
})
|
|
22
|
-
}),
|
|
23
|
-
customStyle: _propTypes.default.shape({
|
|
24
|
-
color: _propTypes.default.string,
|
|
25
|
-
hoverBackgroundColor: _propTypes.default.string
|
|
26
|
-
}),
|
|
27
|
-
isCustomSkillMenu: _propTypes.default.bool
|
|
12
|
+
type: _propTypes.default.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft'])
|
|
28
13
|
};
|
|
29
14
|
const propTypes = {
|
|
30
15
|
buttons: _propTypes.default.arrayOf(_propTypes.default.shape(buttonPropTypes)).isRequired,
|