@entur/button 3.3.12 → 3.3.13-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button.cjs.js +335 -0
- package/dist/button.cjs.js.map +1 -0
- package/dist/button.esm.js +311 -268
- package/dist/button.esm.js.map +1 -1
- package/dist/index.d.ts +383 -13
- package/dist/styles.css +527 -545
- package/package.json +31 -13
- package/dist/Button.d.ts +0 -42
- package/dist/ButtonGroup.d.ts +0 -14
- package/dist/FloatingButton.d.ts +0 -18
- package/dist/IconButton.d.ts +0 -32
- package/dist/NegativeButton.d.ts +0 -29
- package/dist/PrimaryButton.d.ts +0 -29
- package/dist/SecondaryButton.d.ts +0 -29
- package/dist/SecondarySquareButton.d.ts +0 -21
- package/dist/SquareButton.d.ts +0 -26
- package/dist/SuccessButton.d.ts +0 -29
- package/dist/SuccessSquareButton.d.ts +0 -21
- package/dist/TertiaryButton.d.ts +0 -30
- package/dist/TertiarySquareButton.d.ts +0 -23
- package/dist/button.cjs.development.js +0 -309
- package/dist/button.cjs.development.js.map +0 -1
- package/dist/button.cjs.production.min.js +0 -2
- package/dist/button.cjs.production.min.js.map +0 -1
- package/dist/index.js +0 -8
package/dist/button.esm.js
CHANGED
|
@@ -1,276 +1,319 @@
|
|
|
1
|
-
import { warnAboutMissingStyles } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { LoadingDots } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
9
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
10
|
-
var t = arguments[e];
|
|
11
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
12
|
-
}
|
|
13
|
-
return n;
|
|
14
|
-
}, _extends.apply(null, arguments);
|
|
1
|
+
import { warnAboutMissingStyles } from "@entur/utils";
|
|
2
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import React__default from "react";
|
|
5
|
+
import { LoadingDots } from "@entur/loader";
|
|
6
|
+
function getDefaultExportFromCjs(x) {
|
|
7
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
15
8
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
var classnames = { exports: {} };
|
|
10
|
+
/*!
|
|
11
|
+
Copyright (c) 2018 Jed Watson.
|
|
12
|
+
Licensed under the MIT License (MIT), see
|
|
13
|
+
http://jedwatson.github.io/classnames
|
|
14
|
+
*/
|
|
15
|
+
var hasRequiredClassnames;
|
|
16
|
+
function requireClassnames() {
|
|
17
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
18
|
+
hasRequiredClassnames = 1;
|
|
19
|
+
(function(module) {
|
|
20
|
+
(function() {
|
|
21
|
+
var hasOwn = {}.hasOwnProperty;
|
|
22
|
+
function classNames2() {
|
|
23
|
+
var classes = "";
|
|
24
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
25
|
+
var arg = arguments[i];
|
|
26
|
+
if (arg) {
|
|
27
|
+
classes = appendClass(classes, parseValue(arg));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return classes;
|
|
31
|
+
}
|
|
32
|
+
function parseValue(arg) {
|
|
33
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
34
|
+
return arg;
|
|
35
|
+
}
|
|
36
|
+
if (typeof arg !== "object") {
|
|
37
|
+
return "";
|
|
38
|
+
}
|
|
39
|
+
if (Array.isArray(arg)) {
|
|
40
|
+
return classNames2.apply(null, arg);
|
|
41
|
+
}
|
|
42
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
43
|
+
return arg.toString();
|
|
44
|
+
}
|
|
45
|
+
var classes = "";
|
|
46
|
+
for (var key in arg) {
|
|
47
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
48
|
+
classes = appendClass(classes, key);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return classes;
|
|
52
|
+
}
|
|
53
|
+
function appendClass(value, newClass) {
|
|
54
|
+
if (!newClass) {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
if (value) {
|
|
58
|
+
return value + " " + newClass;
|
|
59
|
+
}
|
|
60
|
+
return value + newClass;
|
|
61
|
+
}
|
|
62
|
+
if (module.exports) {
|
|
63
|
+
classNames2.default = classNames2;
|
|
64
|
+
module.exports = classNames2;
|
|
65
|
+
} else {
|
|
66
|
+
window.classNames = classNames2;
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
})(classnames);
|
|
70
|
+
return classnames.exports;
|
|
24
71
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
children
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
variant: "secondary"
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
})
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
var _excluded$3 = ["as", "className"];
|
|
130
|
-
var ButtonGroup = function ButtonGroup(_ref) {
|
|
131
|
-
var _ref$as = _ref.as,
|
|
132
|
-
Element = _ref$as === void 0 ? 'div' : _ref$as,
|
|
133
|
-
className = _ref.className,
|
|
134
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
135
|
-
return React__default.createElement(Element, _extends({
|
|
136
|
-
className: classNames('eds-button-group', className)
|
|
137
|
-
}, rest));
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
var _excluded$2 = ["className", "children", "size"];
|
|
141
|
-
var FloatingButton = function FloatingButton(_ref) {
|
|
142
|
-
var className = _ref.className,
|
|
143
|
-
children = _ref.children,
|
|
144
|
-
_ref$size = _ref.size,
|
|
145
|
-
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
146
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
147
|
-
return React__default.createElement("button", _extends({
|
|
148
|
-
className: classNames('eds-floating-button', {
|
|
149
|
-
'eds-floating-button--extended': React__default.Children.count(children) > 1
|
|
150
|
-
}, {
|
|
151
|
-
'eds-floating-button--small': size === 'small'
|
|
152
|
-
}, className),
|
|
153
|
-
type: "button"
|
|
154
|
-
}, rest), wrapStringsInSpans(children));
|
|
155
|
-
};
|
|
156
|
-
var wrapStringsInSpans = function wrapStringsInSpans(children) {
|
|
157
|
-
return React__default.Children.map(children, function (child) {
|
|
158
|
-
return typeof child === 'string' ? React__default.createElement("span", null, child) : child;
|
|
159
|
-
});
|
|
72
|
+
var classnamesExports = requireClassnames();
|
|
73
|
+
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
74
|
+
const defaultElement$9 = "button";
|
|
75
|
+
const Button = React.forwardRef(
|
|
76
|
+
({
|
|
77
|
+
as,
|
|
78
|
+
children,
|
|
79
|
+
variant = "primary",
|
|
80
|
+
size = "medium",
|
|
81
|
+
loading,
|
|
82
|
+
className,
|
|
83
|
+
disabled = false,
|
|
84
|
+
width = "auto",
|
|
85
|
+
"aria-label": ariaLabel,
|
|
86
|
+
...rest
|
|
87
|
+
}, ref) => {
|
|
88
|
+
const Element = as || defaultElement$9;
|
|
89
|
+
const childrenArray = React.Children.toArray(children);
|
|
90
|
+
const hasLeadingIcon = childrenArray.length > 1 && typeof childrenArray[0] !== "string";
|
|
91
|
+
const hasTrailingIcon = childrenArray.length > 1 && typeof childrenArray[childrenArray.length - 1] !== "string";
|
|
92
|
+
const ariaLabelWhenLoading = childrenArray.filter((child) => typeof child === "string").join(" ");
|
|
93
|
+
const ariaLabelValue = () => {
|
|
94
|
+
if (ariaLabel) return ariaLabel;
|
|
95
|
+
if (loading) return ariaLabelWhenLoading;
|
|
96
|
+
return void 0;
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
Element,
|
|
100
|
+
{
|
|
101
|
+
className: classNames(
|
|
102
|
+
"eds-button",
|
|
103
|
+
{
|
|
104
|
+
[`eds-button--variant-${variant}`]: variant,
|
|
105
|
+
[`eds-button--size-${size}`]: size,
|
|
106
|
+
"eds-button--width-fluid": width === "fluid",
|
|
107
|
+
"eds-button--loading": loading,
|
|
108
|
+
"eds-button--leading-icon": hasLeadingIcon,
|
|
109
|
+
"eds-button--trailing-icon": hasTrailingIcon
|
|
110
|
+
},
|
|
111
|
+
className
|
|
112
|
+
),
|
|
113
|
+
ref,
|
|
114
|
+
"aria-busy": loading,
|
|
115
|
+
disabled,
|
|
116
|
+
"aria-disabled": disabled,
|
|
117
|
+
"aria-label": ariaLabelValue(),
|
|
118
|
+
...rest,
|
|
119
|
+
children: loading ? /* @__PURE__ */ jsx(LoadingDots, { className: "eds-button__loading-dots" }) : children
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
const defaultElement$8 = "button";
|
|
125
|
+
const PrimaryButton = React__default.forwardRef(
|
|
126
|
+
(props, ref) => {
|
|
127
|
+
const Element = props.as || defaultElement$8;
|
|
128
|
+
return /* @__PURE__ */ jsx(Button, { as: Element, ...props, ref, variant: "primary" });
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
const defaultElement$7 = "button";
|
|
132
|
+
const SecondaryButton = React__default.forwardRef(
|
|
133
|
+
(props, ref) => {
|
|
134
|
+
const Element = props.as || defaultElement$7;
|
|
135
|
+
return /* @__PURE__ */ jsx(Button, { as: Element, ...props, ref, variant: "secondary" });
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
const defaultElement$6 = "button";
|
|
139
|
+
const SuccessButton = React__default.forwardRef(
|
|
140
|
+
(props, ref) => {
|
|
141
|
+
const Element = props.as || defaultElement$6;
|
|
142
|
+
return /* @__PURE__ */ jsx(Button, { as: Element, ...props, ref, variant: "success" });
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
const defaultElement$5 = "button";
|
|
146
|
+
const NegativeButton = React__default.forwardRef(
|
|
147
|
+
(props, ref) => {
|
|
148
|
+
const Element = props.as || defaultElement$5;
|
|
149
|
+
return /* @__PURE__ */ jsx(Button, { as: Element, ...props, ref, variant: "negative" });
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
const defaultElement$4 = "button";
|
|
153
|
+
const TertiaryButton = React__default.forwardRef(
|
|
154
|
+
(props, ref) => {
|
|
155
|
+
const Element = props.as || defaultElement$4;
|
|
156
|
+
return /* @__PURE__ */ jsx(
|
|
157
|
+
Button,
|
|
158
|
+
{
|
|
159
|
+
as: Element,
|
|
160
|
+
...props,
|
|
161
|
+
ref,
|
|
162
|
+
variant: "tertiary",
|
|
163
|
+
size: "small"
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
const ButtonGroup = ({
|
|
169
|
+
as: Element = "div",
|
|
170
|
+
className,
|
|
171
|
+
...rest
|
|
172
|
+
}) => {
|
|
173
|
+
return /* @__PURE__ */ jsx(Element, { className: classNames("eds-button-group", className), ...rest });
|
|
160
174
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}, className),
|
|
180
|
-
"aria-busy": loading,
|
|
181
|
-
disabled: disabled,
|
|
182
|
-
"aria-disabled": disabled,
|
|
183
|
-
ref: ref
|
|
184
|
-
}, rest), React.Children.map(children, function (child) {
|
|
185
|
-
if (typeof child === 'string') {
|
|
186
|
-
return React.createElement("span", {
|
|
187
|
-
className: "eds-square-button__label"
|
|
188
|
-
}, child);
|
|
175
|
+
const FloatingButton = ({
|
|
176
|
+
className,
|
|
177
|
+
children,
|
|
178
|
+
size = "medium",
|
|
179
|
+
...rest
|
|
180
|
+
}) => {
|
|
181
|
+
return /* @__PURE__ */ jsx(
|
|
182
|
+
"button",
|
|
183
|
+
{
|
|
184
|
+
className: classNames(
|
|
185
|
+
"eds-floating-button",
|
|
186
|
+
{ "eds-floating-button--extended": React__default.Children.count(children) > 1 },
|
|
187
|
+
{ "eds-floating-button--small": size === "small" },
|
|
188
|
+
className
|
|
189
|
+
),
|
|
190
|
+
type: "button",
|
|
191
|
+
...rest,
|
|
192
|
+
children: wrapStringsInSpans(children)
|
|
189
193
|
}
|
|
190
|
-
return React.createElement("span", {
|
|
191
|
-
className: "eds-square-button__button"
|
|
192
|
-
}, loading ? React.createElement(LoadingDots, {
|
|
193
|
-
className: "eds-square-button__loading-dots"
|
|
194
|
-
}) : child);
|
|
195
|
-
}));
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
var defaultElement$2 = 'button';
|
|
199
|
-
var SecondarySquareButton = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
200
|
-
var Element = props.as || defaultElement$2;
|
|
201
|
-
return (
|
|
202
|
-
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
203
|
-
React__default.createElement(SquareButton, _extends({
|
|
204
|
-
as: Element,
|
|
205
|
-
ref: ref
|
|
206
|
-
}, props, {
|
|
207
|
-
variant: "secondary"
|
|
208
|
-
}))
|
|
209
194
|
);
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
195
|
+
};
|
|
196
|
+
const wrapStringsInSpans = (children) => React__default.Children.map(
|
|
197
|
+
children,
|
|
198
|
+
(child) => typeof child === "string" ? /* @__PURE__ */ jsx("span", { children: child }) : child
|
|
199
|
+
);
|
|
200
|
+
const defaultElement$3 = "button";
|
|
201
|
+
const SquareButton = React.forwardRef(
|
|
202
|
+
({
|
|
203
|
+
as,
|
|
204
|
+
children,
|
|
205
|
+
className,
|
|
206
|
+
disabled = false,
|
|
207
|
+
loading = false,
|
|
208
|
+
variant = "secondary",
|
|
209
|
+
...rest
|
|
210
|
+
}, ref) => {
|
|
211
|
+
const Element = as || defaultElement$3;
|
|
212
|
+
return /* @__PURE__ */ jsx(
|
|
213
|
+
Element,
|
|
214
|
+
{
|
|
215
|
+
className: classNames(
|
|
216
|
+
"eds-square-button",
|
|
217
|
+
`eds-square-button--${variant}`,
|
|
218
|
+
{
|
|
219
|
+
"eds-square-button--loading": loading
|
|
220
|
+
},
|
|
221
|
+
className
|
|
222
|
+
),
|
|
223
|
+
"aria-busy": loading,
|
|
224
|
+
disabled,
|
|
225
|
+
"aria-disabled": disabled,
|
|
226
|
+
ref,
|
|
227
|
+
...rest,
|
|
228
|
+
children: React.Children.map(children, (child) => {
|
|
229
|
+
if (typeof child === "string") {
|
|
230
|
+
return /* @__PURE__ */ jsx("span", { className: "eds-square-button__label", children: child });
|
|
231
|
+
}
|
|
232
|
+
return /* @__PURE__ */ jsx("span", { className: "eds-square-button__button", children: loading ? /* @__PURE__ */ jsx(LoadingDots, { className: "eds-square-button__loading-dots" }) : child });
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
const defaultElement$2 = "button";
|
|
239
|
+
const SecondarySquareButton = React__default.forwardRef(
|
|
240
|
+
(props, ref) => {
|
|
241
|
+
const Element = props.as || defaultElement$2;
|
|
242
|
+
return (
|
|
243
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
244
|
+
/* @__PURE__ */ jsx(SquareButton, { as: Element, ref, ...props, variant: "secondary" })
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
const defaultElement$1 = "button";
|
|
249
|
+
const SuccessSquareButton = React__default.forwardRef(
|
|
250
|
+
(props, ref) => {
|
|
251
|
+
const Element = props.as || defaultElement$1;
|
|
252
|
+
return (
|
|
253
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
254
|
+
/* @__PURE__ */ jsx(SquareButton, { as: Element, ref, ...props, variant: "success" })
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
const TertiarySquareButton = React__default.forwardRef(
|
|
259
|
+
(props, ref) => /* @__PURE__ */ jsx(SquareButton, { ref, ...props, variant: "tertiary" })
|
|
260
|
+
);
|
|
261
|
+
const defaultElement = "button";
|
|
262
|
+
const IconButton = React__default.forwardRef(
|
|
263
|
+
({
|
|
264
|
+
children,
|
|
265
|
+
className,
|
|
266
|
+
disabled = false,
|
|
267
|
+
size = "medium",
|
|
268
|
+
as,
|
|
269
|
+
loading,
|
|
270
|
+
...rest
|
|
271
|
+
}, ref) => {
|
|
272
|
+
const Element = as || defaultElement;
|
|
273
|
+
const IconWithAriaHidden = React__default.Children.map(children, (child) => {
|
|
274
|
+
if (React__default.isValidElement(child)) {
|
|
275
|
+
return React__default.cloneElement(child, { "aria-hidden": true });
|
|
276
|
+
}
|
|
277
|
+
return child;
|
|
278
|
+
});
|
|
279
|
+
const iconButtonElement = /* @__PURE__ */ jsx(
|
|
280
|
+
Element,
|
|
281
|
+
{
|
|
282
|
+
className: classNames(
|
|
283
|
+
"eds-icon-button",
|
|
284
|
+
className,
|
|
285
|
+
{
|
|
286
|
+
"eds-icon-button--disabled": disabled
|
|
287
|
+
},
|
|
288
|
+
`eds-icon-button--size-${size}`
|
|
289
|
+
),
|
|
290
|
+
disabled,
|
|
291
|
+
"aria-disabled": disabled,
|
|
292
|
+
"aria-busy": loading,
|
|
293
|
+
ref,
|
|
294
|
+
...rest,
|
|
295
|
+
children: loading ? /* @__PURE__ */ jsx(LoadingDots, {}) : /* @__PURE__ */ jsx(Fragment, { children: IconWithAriaHidden })
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
if (disabled) {
|
|
299
|
+
return /* @__PURE__ */ jsx("div", { className: "eds-icon-button--disabled__wrapper", children: iconButtonElement });
|
|
253
300
|
}
|
|
254
|
-
return
|
|
255
|
-
});
|
|
256
|
-
var iconButtonElement = React__default.createElement(Element, _extends({
|
|
257
|
-
className: classNames('eds-icon-button', className, {
|
|
258
|
-
'eds-icon-button--disabled': disabled
|
|
259
|
-
}, "eds-icon-button--size-" + size),
|
|
260
|
-
disabled: disabled,
|
|
261
|
-
"aria-disabled": disabled,
|
|
262
|
-
"aria-busy": loading,
|
|
263
|
-
ref: ref
|
|
264
|
-
}, rest), loading ? React__default.createElement(LoadingDots, null) : React__default.createElement(React__default.Fragment, null, IconWithAriaHidden));
|
|
265
|
-
if (disabled) {
|
|
266
|
-
return React__default.createElement("div", {
|
|
267
|
-
className: "eds-icon-button--disabled__wrapper"
|
|
268
|
-
}, iconButtonElement);
|
|
301
|
+
return /* @__PURE__ */ jsx(Fragment, { children: iconButtonElement });
|
|
269
302
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
303
|
+
);
|
|
304
|
+
warnAboutMissingStyles("button");
|
|
305
|
+
export {
|
|
306
|
+
Button,
|
|
307
|
+
ButtonGroup,
|
|
308
|
+
FloatingButton,
|
|
309
|
+
IconButton,
|
|
310
|
+
NegativeButton,
|
|
311
|
+
PrimaryButton,
|
|
312
|
+
SecondaryButton,
|
|
313
|
+
SecondarySquareButton,
|
|
314
|
+
SuccessButton,
|
|
315
|
+
SuccessSquareButton,
|
|
316
|
+
TertiaryButton,
|
|
317
|
+
TertiarySquareButton
|
|
318
|
+
};
|
|
276
319
|
//# sourceMappingURL=button.esm.js.map
|