@indico-data/design-system 2.21.0 → 2.21.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/lib/index.d.ts +1 -1
- package/lib/index.esm.js +6 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/src/components/button/Button.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/button/Button.tsx +6 -5
- package/src/components/popper/Popper.stories.tsx +9 -10
package/lib/index.js
CHANGED
|
@@ -3186,7 +3186,7 @@ var classnames = {exports: {}};
|
|
|
3186
3186
|
var classnamesExports = classnames.exports;
|
|
3187
3187
|
var y$1 = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
3188
3188
|
|
|
3189
|
-
const Button$2 = (props) => {
|
|
3189
|
+
const Button$2 = e.forwardRef((props, ref) => {
|
|
3190
3190
|
const { ariaLabel, children, isLoading, isDisabled, variant = 'solid', color = 'primary', iconPosition = 'left', iconName, onClick, type = 'button', size = 'md', onMouseEnter, onMouseExit, onKeyDown, className, href } = props, rest = __rest$1(props, ["ariaLabel", "children", "isLoading", "isDisabled", "variant", "color", "iconPosition", "iconName", "onClick", "type", "size", "onMouseEnter", "onMouseExit", "onKeyDown", "className", "href"]);
|
|
3191
3191
|
const buttonClasses = y$1('btn', {
|
|
3192
3192
|
[`btn--${color}`]: color,
|
|
@@ -3195,12 +3195,12 @@ const Button$2 = (props) => {
|
|
|
3195
3195
|
'btn--loading': isLoading,
|
|
3196
3196
|
}, className);
|
|
3197
3197
|
const handleOnClick = (event) => {
|
|
3198
|
-
if (!isLoading &&
|
|
3199
|
-
|
|
3198
|
+
if (!isLoading && onClick) {
|
|
3199
|
+
onClick(event);
|
|
3200
3200
|
}
|
|
3201
3201
|
};
|
|
3202
|
-
return (jsxRuntime.jsxs("button", Object.assign({ disabled: isLoading || isDisabled, className: buttonClasses, role: "button", onClick: handleOnClick, "aria-label": ariaLabel || 'button', "aria-disabled": isLoading || isDisabled, "aria-busy": isLoading, type: type, onMouseEnter: onMouseEnter, onMouseLeave: onMouseExit, onKeyDown: onKeyDown }, rest, { children: [isLoading && (jsxRuntime.jsx(Icon, { name: "fa-circle-notch", style: { animation: 'spin 1s linear infinite' }, className: "mr-2", ariaLabel: "Loading..." })), !children && iconName && jsxRuntime.jsx(Icon, { name: iconName, ariaLabel: `${iconName} Icon` }), children && iconPosition === 'left' && iconName && (jsxRuntime.jsx(Icon, { name: iconName, className: "mr-2", ariaLabel: `${iconName} Icon` })), children, children && iconPosition === 'right' && iconName && (jsxRuntime.jsx(Icon, { name: iconName, className: "ml-2", ariaLabel: `${iconName} Icon` }))] })));
|
|
3203
|
-
};
|
|
3202
|
+
return (jsxRuntime.jsxs("button", Object.assign({ ref: ref, disabled: isLoading || isDisabled, className: buttonClasses, role: "button", onClick: handleOnClick, "aria-label": ariaLabel || 'button', "aria-disabled": isLoading || isDisabled, "aria-busy": isLoading, type: type, onMouseEnter: onMouseEnter, onMouseLeave: onMouseExit, onKeyDown: onKeyDown }, rest, { children: [isLoading && (jsxRuntime.jsx(Icon, { name: "fa-circle-notch", style: { animation: 'spin 1s linear infinite' }, className: "mr-2", ariaLabel: "Loading..." })), !children && iconName && jsxRuntime.jsx(Icon, { name: iconName, ariaLabel: `${iconName} Icon` }), children && iconPosition === 'left' && iconName && (jsxRuntime.jsx(Icon, { name: iconName, className: "mr-2", ariaLabel: `${iconName} Icon` })), children, children && iconPosition === 'right' && iconName && (jsxRuntime.jsx(Icon, { name: iconName, className: "ml-2", ariaLabel: `${iconName} Icon` }))] })));
|
|
3203
|
+
});
|
|
3204
3204
|
|
|
3205
3205
|
function ownKeys$2(object, enumerableOnly) {
|
|
3206
3206
|
var keys = Object.keys(object);
|