asma-ui-core 3.126.1 → 3.126.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/dist/asma-ui-core.css +1 -1
- package/dist/components/feedback/dialog/StyledDialog.js +59 -59
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +38 -38
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +45 -45
- package/dist/components/inputs/button/StyledButton.js +22 -21
- package/dist/components/inputs/form-layout/StyledFieldPair.js +16 -16
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +81 -80
- package/dist/datetime/shared-components/button/StyledButton.js +10 -9
- package/dist/src/components/inputs/button/StyledButton.d.ts +3 -1
- package/dist/src/datetime/shared-components/button/StyledButton.d.ts +1 -1
- package/dist/src/table/shared-components/button/StyledButton.d.ts +1 -1
- package/dist/table/shared-components/button/StyledButton.js +10 -9
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { StyledTooltip as
|
|
2
|
-
import { LoadingIcon as
|
|
1
|
+
import { StyledTooltip as O } from "../../data-display/tooltip/StyledTooltip.js";
|
|
2
|
+
import { LoadingIcon as W } from "../../icons/loading-icon/LoadingIcon.js";
|
|
3
3
|
import e from "./StyledButton.module.js";
|
|
4
|
-
import { useReportDialogBusy as
|
|
4
|
+
import { useReportDialogBusy as _ } from "../../feedback/dialog/DialogBusyContext.js";
|
|
5
5
|
import y from "clsx";
|
|
6
6
|
import "react";
|
|
7
|
-
import { Fragment as
|
|
8
|
-
var
|
|
7
|
+
import { Fragment as F, jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
var T = {
|
|
9
9
|
en: "In progress",
|
|
10
10
|
no: "Pågår"
|
|
11
11
|
}, x = {
|
|
@@ -19,27 +19,28 @@ var F = {
|
|
|
19
19
|
medium: e.medium,
|
|
20
20
|
error: e.error,
|
|
21
21
|
common: e.common
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
const n = r === "large" || r === "medium",
|
|
22
|
+
}, P = ({ variant: h = "contained", className: v = "", size: r = "medium", children: i, refLink: w, startIcon: b, endIcon: B, dataTest: g, error: S, style: k, disabled: c, disabledReason: p, loading: t, holdsDialog: I = !0, loadingAnnouncement: j, locale: C = "en", onClick: D, type: N = "button", ...l }) => {
|
|
23
|
+
_(!!t && I);
|
|
24
|
+
const n = r === "large" || r === "medium", R = S ? "error" : "common", s = !!c && !!p, m = s || !!t, u = n ? 20 : 16, d = (a) => t && a ? /* @__PURE__ */ o("span", {
|
|
25
25
|
style: {
|
|
26
26
|
display: "inline-flex",
|
|
27
27
|
opacity: 0
|
|
28
28
|
},
|
|
29
29
|
children: a
|
|
30
|
-
}) : a,
|
|
30
|
+
}) : a, G = (a) => {
|
|
31
31
|
if (m) {
|
|
32
32
|
a.preventDefault();
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
D?.(a);
|
|
36
|
-
},
|
|
36
|
+
}, L = /* @__PURE__ */ f("button", {
|
|
37
37
|
...l,
|
|
38
|
+
type: N,
|
|
38
39
|
disabled: !!c && !m,
|
|
39
40
|
"aria-disabled": m ? !0 : l["aria-disabled"],
|
|
40
41
|
"aria-busy": t ? !0 : l["aria-busy"],
|
|
41
|
-
onClick:
|
|
42
|
-
className: y("asma-touch-ready", e["asma-ui-core-button"], x[h], x[
|
|
42
|
+
onClick: G,
|
|
43
|
+
className: y("asma-touch-ready", e["asma-ui-core-button"], x[h], x[R], x[r], "max-xs:h-auto max-xs:max-w-full max-xs:py-1 max-xs:[&>:not(div)]:shrink-0", r === "small" ? "max-xs:min-h-8" : "max-xs:min-h-10", v),
|
|
43
44
|
style: {
|
|
44
45
|
...i ? { flexShrink: 0 } : {},
|
|
45
46
|
...t ? { position: "relative" } : {},
|
|
@@ -48,7 +49,7 @@ var F = {
|
|
|
48
49
|
ref: w,
|
|
49
50
|
"data-testid": g,
|
|
50
51
|
children: [
|
|
51
|
-
|
|
52
|
+
d(b),
|
|
52
53
|
i && /* @__PURE__ */ o("div", {
|
|
53
54
|
className: y("max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]", "max-xs:text-center"),
|
|
54
55
|
style: {
|
|
@@ -65,7 +66,7 @@ var F = {
|
|
|
65
66
|
},
|
|
66
67
|
children: i
|
|
67
68
|
}),
|
|
68
|
-
|
|
69
|
+
d(B),
|
|
69
70
|
t && /* @__PURE__ */ o("span", {
|
|
70
71
|
"aria-hidden": "true",
|
|
71
72
|
style: {
|
|
@@ -75,26 +76,26 @@ var F = {
|
|
|
75
76
|
alignItems: "center",
|
|
76
77
|
justifyContent: "center"
|
|
77
78
|
},
|
|
78
|
-
children: /* @__PURE__ */ o(
|
|
79
|
-
width:
|
|
80
|
-
height:
|
|
79
|
+
children: /* @__PURE__ */ o(W, {
|
|
80
|
+
width: u,
|
|
81
|
+
height: u
|
|
81
82
|
})
|
|
82
83
|
})
|
|
83
84
|
]
|
|
84
85
|
});
|
|
85
|
-
return /* @__PURE__ */ f(
|
|
86
|
+
return /* @__PURE__ */ f(F, { children: [/* @__PURE__ */ o(O, {
|
|
86
87
|
arrow: !0,
|
|
87
88
|
title: p,
|
|
88
89
|
open: s ? void 0 : !1,
|
|
89
90
|
openOnTap: s,
|
|
90
91
|
persistentDescription: s,
|
|
91
|
-
children:
|
|
92
|
+
children: L
|
|
92
93
|
}), t !== void 0 && /* @__PURE__ */ o("span", {
|
|
93
94
|
role: "status",
|
|
94
95
|
className: "sr-only",
|
|
95
|
-
children: t ? j ??
|
|
96
|
+
children: t ? j ?? T[C] : ""
|
|
96
97
|
})] });
|
|
97
98
|
};
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
+
P as StyledButton
|
|
100
101
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as e } from "../../../helpers/cn.js";
|
|
2
2
|
import { fieldLabelAboveClass as s } from "../field-styles.js";
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
"data-testid":
|
|
7
|
-
className:
|
|
8
|
-
children:
|
|
9
|
-
}) : /* @__PURE__ */
|
|
10
|
-
"data-testid":
|
|
11
|
-
className:
|
|
12
|
-
children: [/* @__PURE__ */
|
|
13
|
-
className:
|
|
14
|
-
children: d
|
|
15
|
-
}), /* @__PURE__ */ l("div", {
|
|
16
|
-
className: e.row,
|
|
3
|
+
import l from "./StyledFieldPair.module.js";
|
|
4
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
5
|
+
var n = ({ children: a, legend: i, className: d, dataTest: m }) => i == null ? /* @__PURE__ */ r("div", {
|
|
6
|
+
"data-testid": m,
|
|
7
|
+
className: e(l.row, "max-xs:[&>*]:max-w-full", d),
|
|
8
|
+
children: a
|
|
9
|
+
}) : /* @__PURE__ */ t("fieldset", {
|
|
10
|
+
"data-testid": m,
|
|
11
|
+
className: e(l.fieldset, d),
|
|
12
|
+
children: [/* @__PURE__ */ r("legend", {
|
|
13
|
+
className: e(l.legend, s()),
|
|
17
14
|
children: i
|
|
15
|
+
}), /* @__PURE__ */ r("div", {
|
|
16
|
+
className: e(l.row, "max-xs:[&>*]:max-w-full"),
|
|
17
|
+
children: a
|
|
18
18
|
})]
|
|
19
19
|
});
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
n as StyledFieldPair
|
|
22
22
|
};
|
|
@@ -2,145 +2,145 @@ import { fieldLabelAboveClass as R, fieldWidthStyle as le } from "../../../../co
|
|
|
2
2
|
import { StyledInputField as oe } from "../../../../components/inputs/input-field/StyledInputField.js";
|
|
3
3
|
import { getValue as b } from "../helpers.js";
|
|
4
4
|
import { DatePickerButton as ie } from "./DatePickerButton.js";
|
|
5
|
-
import { getTitleLabelling as
|
|
6
|
-
import { DATE_INPUT_FONT_FAMILY as
|
|
5
|
+
import { getTitleLabelling as se } from "../../../helpers/getTitleLabelling.js";
|
|
6
|
+
import { DATE_INPUT_FONT_FAMILY as de } from "../../../../helpers/inputMask.js";
|
|
7
7
|
import { useDatePickerMask as ne } from "../hooks/useDatePickerMask.js";
|
|
8
|
-
import { defaultDatePickerValidationMessages as ce, useDatePickerValidation as
|
|
8
|
+
import { defaultDatePickerValidationMessages as ce, useDatePickerValidation as me } from "../hooks/useDatePickerValidation.js";
|
|
9
9
|
import { useEffect as A, useId as E, useRef as pe, useState as H } from "react";
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { isValid as
|
|
12
|
-
var
|
|
13
|
-
const { onClick: L, inputClassName: S, dateFormat:
|
|
10
|
+
import { jsx as r, jsxs as T } from "react/jsx-runtime";
|
|
11
|
+
import { isValid as ue, parse as fe } from "date-fns";
|
|
12
|
+
var Pe = (Y) => {
|
|
13
|
+
const { onClick: L, inputClassName: S, dateFormat: l, selected: e, error: _, helperText: j, errorText: q, onInputChange: C, hideCalendar: W, locale: o, disabledDays: d, label: h, title: x, inputAriaProps: z, readOnly: U, lockedReason: v, readOnlyReason: y, disallowPast: n, disallowFuture: c, validateOnCalendarClose: N, onValidatedOnce: w, hideDefaultHelperText: G, reserveHelperText: J, required: i, minDate: m, width: P = "s", ...p } = Y, a = !!U || !!v || !!y, k = !v && !!y, { validationError: K, handleValidation: u, errHelperText: Q, clearValidation: M } = me(ce), { maskRef: X } = ne(), I = E(), V = E(), [t, B] = H(e ? b(e, l) : ""), g = pe(!1), [F, Z] = H({
|
|
14
14
|
selected: e,
|
|
15
|
-
dateFormat:
|
|
15
|
+
dateFormat: l
|
|
16
16
|
});
|
|
17
|
-
(e !== F.selected ||
|
|
17
|
+
(e !== F.selected || l !== F.dateFormat) && (Z({
|
|
18
18
|
selected: e,
|
|
19
|
-
dateFormat:
|
|
20
|
-
}), B(e ? b(e,
|
|
21
|
-
const $ =
|
|
19
|
+
dateFormat: l
|
|
20
|
+
}), B(e ? b(e, l) : ""));
|
|
21
|
+
const $ = o?.code?.startsWith("nb") ? "DD/MM/ÅÅÅÅ" : "DD/MM/YYYY", ee = G ? void 0 : $, O = !!(K || _), s = O ? q ?? Q : j ?? ee;
|
|
22
22
|
A(() => {
|
|
23
23
|
if (!e) {
|
|
24
|
-
|
|
24
|
+
g.current || M(), g.current = !1;
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
value: b(e,
|
|
29
|
-
disabledDays:
|
|
30
|
-
localeCode:
|
|
27
|
+
u({
|
|
28
|
+
value: b(e, l),
|
|
29
|
+
disabledDays: d,
|
|
30
|
+
localeCode: o?.code,
|
|
31
31
|
disallowPast: n,
|
|
32
32
|
disallowFuture: c,
|
|
33
|
-
required:
|
|
34
|
-
minDate:
|
|
33
|
+
required: i,
|
|
34
|
+
minDate: m
|
|
35
35
|
});
|
|
36
36
|
}, [
|
|
37
37
|
e,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
l,
|
|
39
|
+
d,
|
|
40
|
+
o?.code,
|
|
41
41
|
n,
|
|
42
42
|
c,
|
|
43
|
-
|
|
44
|
-
u,
|
|
43
|
+
i,
|
|
45
44
|
m,
|
|
46
|
-
|
|
45
|
+
u,
|
|
46
|
+
M
|
|
47
47
|
]);
|
|
48
|
-
const
|
|
49
|
-
const f =
|
|
48
|
+
const ae = /\d/.test(t), te = (D) => {
|
|
49
|
+
const f = D.target.value;
|
|
50
50
|
B(f.replace(/\D/g, "").length ? f : "");
|
|
51
51
|
};
|
|
52
52
|
A(() => {
|
|
53
|
-
N && (
|
|
53
|
+
N && (u({
|
|
54
54
|
value: t,
|
|
55
|
-
disabledDays:
|
|
56
|
-
localeCode:
|
|
55
|
+
disabledDays: d,
|
|
56
|
+
localeCode: o?.code,
|
|
57
57
|
disallowPast: n,
|
|
58
58
|
disallowFuture: c,
|
|
59
|
-
required:
|
|
60
|
-
minDate:
|
|
61
|
-
}),
|
|
59
|
+
required: i,
|
|
60
|
+
minDate: m
|
|
61
|
+
}), w?.());
|
|
62
62
|
}, [
|
|
63
63
|
N,
|
|
64
64
|
t,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
d,
|
|
66
|
+
o?.code,
|
|
67
67
|
n,
|
|
68
68
|
c,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
i,
|
|
70
|
+
m,
|
|
71
|
+
w,
|
|
72
|
+
u
|
|
73
73
|
]);
|
|
74
74
|
const re = () => {
|
|
75
|
-
const
|
|
75
|
+
const D = u({
|
|
76
76
|
value: t,
|
|
77
|
-
disabledDays:
|
|
78
|
-
localeCode:
|
|
77
|
+
disabledDays: d,
|
|
78
|
+
localeCode: o?.code,
|
|
79
79
|
disallowPast: n,
|
|
80
80
|
disallowFuture: c,
|
|
81
|
-
required:
|
|
82
|
-
minDate:
|
|
81
|
+
required: i,
|
|
82
|
+
minDate: m
|
|
83
83
|
});
|
|
84
84
|
if (!t.replace(/\D/g, "").length) {
|
|
85
|
-
|
|
85
|
+
g.current = !!e, C?.(void 0);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
88
|
+
if (D) return;
|
|
89
89
|
const f = fe(t, "dd/MM/yyyy", /* @__PURE__ */ new Date());
|
|
90
|
-
C?.(
|
|
90
|
+
C?.(ue(f) ? f : void 0);
|
|
91
91
|
};
|
|
92
92
|
return /* @__PURE__ */ T("div", {
|
|
93
93
|
className: "cursor-default",
|
|
94
|
-
"data-field-width":
|
|
95
|
-
style: le(
|
|
94
|
+
"data-field-width": P,
|
|
95
|
+
style: le(P),
|
|
96
96
|
"data-helper-room-box": "",
|
|
97
97
|
children: [
|
|
98
|
-
|
|
98
|
+
x && /* @__PURE__ */ r("div", {
|
|
99
99
|
id: I,
|
|
100
100
|
className: R({
|
|
101
101
|
disabled: p.disabled,
|
|
102
|
-
flush:
|
|
102
|
+
flush: k
|
|
103
103
|
}),
|
|
104
|
-
children:
|
|
104
|
+
children: x
|
|
105
105
|
}),
|
|
106
|
-
h && /* @__PURE__ */
|
|
106
|
+
h && /* @__PURE__ */ r("div", {
|
|
107
107
|
className: R({
|
|
108
108
|
disabled: p.disabled,
|
|
109
|
-
flush:
|
|
109
|
+
flush: k
|
|
110
110
|
}),
|
|
111
111
|
children: /* @__PURE__ */ T("label", {
|
|
112
112
|
htmlFor: V,
|
|
113
|
-
children: [h,
|
|
113
|
+
children: [h, i && /* @__PURE__ */ r("span", {
|
|
114
114
|
"aria-hidden": "true",
|
|
115
115
|
children: " *"
|
|
116
116
|
})]
|
|
117
117
|
})
|
|
118
118
|
}),
|
|
119
119
|
/* @__PURE__ */ T("div", {
|
|
120
|
-
className: "flex items-start gap-1",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
122
|
-
className: "min-w-0 flex-1",
|
|
123
|
-
children: /* @__PURE__ */
|
|
120
|
+
className: "flex items-start gap-1 max-xs:flex-wrap max-xs:gap-y-1",
|
|
121
|
+
children: [/* @__PURE__ */ r("div", {
|
|
122
|
+
className: "min-w-0 flex-1 max-xs:min-w-min",
|
|
123
|
+
children: /* @__PURE__ */ r("div", {
|
|
124
124
|
className: "relative",
|
|
125
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ r(oe, {
|
|
126
126
|
...p,
|
|
127
127
|
id: V,
|
|
128
|
-
readOnly:
|
|
129
|
-
lockedReason:
|
|
130
|
-
readOnlyReason:
|
|
128
|
+
readOnly: a,
|
|
129
|
+
lockedReason: v,
|
|
130
|
+
readOnlyReason: y,
|
|
131
131
|
"data-testid": p.dataTest,
|
|
132
132
|
autoComplete: "off",
|
|
133
|
-
inputRef:
|
|
134
|
-
placeholder: !
|
|
133
|
+
inputRef: a ? void 0 : X,
|
|
134
|
+
placeholder: !a && !ae ? " / / " : void 0,
|
|
135
135
|
size: "small",
|
|
136
|
-
value:
|
|
136
|
+
value: a ? t.replaceAll("/", ".") : t,
|
|
137
137
|
className: S,
|
|
138
138
|
error: O,
|
|
139
|
-
onBlur:
|
|
140
|
-
helperText:
|
|
139
|
+
onBlur: a ? void 0 : re,
|
|
140
|
+
helperText: s == null || s === "" ? s : /* @__PURE__ */ r("span", {
|
|
141
141
|
className: "block truncate",
|
|
142
|
-
title: typeof
|
|
143
|
-
children:
|
|
142
|
+
title: typeof s == "string" ? s : void 0,
|
|
143
|
+
children: s
|
|
144
144
|
}),
|
|
145
145
|
reserveHelperText: J,
|
|
146
146
|
slotProps: {
|
|
@@ -150,31 +150,32 @@ var ke = (Y) => {
|
|
|
150
150
|
marginRight: 0
|
|
151
151
|
} },
|
|
152
152
|
htmlInput: {
|
|
153
|
-
"aria-required":
|
|
154
|
-
...
|
|
155
|
-
title:
|
|
153
|
+
"aria-required": i ? !0 : void 0,
|
|
154
|
+
...se({
|
|
155
|
+
title: x,
|
|
156
156
|
titleId: I,
|
|
157
157
|
label: h,
|
|
158
158
|
inputAriaProps: z
|
|
159
159
|
}),
|
|
160
|
-
...
|
|
160
|
+
...a ? {} : {
|
|
161
161
|
inputMode: "numeric",
|
|
162
|
-
style: { fontFamily:
|
|
162
|
+
style: { fontFamily: de }
|
|
163
163
|
}
|
|
164
|
-
}
|
|
164
|
+
},
|
|
165
|
+
input: a ? void 0 : { className: "max-xs:min-w-[calc(10ch+1rem)] max-xs:px-2" }
|
|
165
166
|
},
|
|
166
|
-
onChange:
|
|
167
|
+
onChange: te
|
|
167
168
|
})
|
|
168
169
|
})
|
|
169
|
-
}), !W && !
|
|
170
|
+
}), !W && !a && /* @__PURE__ */ r(ie, {
|
|
170
171
|
onClick: L,
|
|
171
172
|
disabled: !!p.disabled,
|
|
172
|
-
localeCode:
|
|
173
|
+
localeCode: o?.code
|
|
173
174
|
})]
|
|
174
175
|
})
|
|
175
176
|
]
|
|
176
177
|
});
|
|
177
178
|
};
|
|
178
179
|
export {
|
|
179
|
-
|
|
180
|
+
Pe as BaseDatePickerInput
|
|
180
181
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./StyledButton.module.js";
|
|
2
|
-
import
|
|
2
|
+
import f from "clsx";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as g, jsxs as y } from "react/jsx-runtime";
|
|
5
5
|
var r = {
|
|
6
6
|
contained: t.contained,
|
|
7
7
|
outlined: t.outlined,
|
|
@@ -13,16 +13,17 @@ var r = {
|
|
|
13
13
|
medium: t.medium,
|
|
14
14
|
error: t.error,
|
|
15
15
|
common: t.common
|
|
16
|
-
}, j = ({ variant:
|
|
17
|
-
const o = e === "large" || e === "medium",
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
...
|
|
20
|
-
|
|
16
|
+
}, j = ({ variant: a = "contained", className: m = "", size: e = "medium", children: n, refLink: i, startIcon: l, endIcon: d, dataTest: p, error: s, type: x = "button", ...c }) => {
|
|
17
|
+
const o = e === "large" || e === "medium", u = s ? "error" : "common";
|
|
18
|
+
return /* @__PURE__ */ y("button", {
|
|
19
|
+
...c,
|
|
20
|
+
type: x,
|
|
21
|
+
className: f(t["asma-core-ui-button"], r[a], r[u], r[e], m),
|
|
21
22
|
ref: i,
|
|
22
23
|
"data-test": p,
|
|
23
24
|
children: [
|
|
24
25
|
l,
|
|
25
|
-
|
|
26
|
+
n && /* @__PURE__ */ g("div", {
|
|
26
27
|
style: {
|
|
27
28
|
overflow: "hidden",
|
|
28
29
|
textOverflow: "ellipsis",
|
|
@@ -34,7 +35,7 @@ var r = {
|
|
|
34
35
|
paddingLeft: o ? "8px" : "4px",
|
|
35
36
|
paddingRight: o ? "8px" : "4px"
|
|
36
37
|
},
|
|
37
|
-
children:
|
|
38
|
+
children: n
|
|
38
39
|
}),
|
|
39
40
|
d
|
|
40
41
|
]
|
|
@@ -64,6 +64,8 @@ export type StyledButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
|
|
|
64
64
|
* native button pseudo-states + the `disabled` attribute, not a prop.
|
|
65
65
|
* @remarks for icon button add only startIcon prop
|
|
66
66
|
* @remarks for error button no textGray variant
|
|
67
|
+
* @remarks `type` defaults to `'button'`, not the native `'submit'`. Pass `type='submit'`
|
|
68
|
+
* explicitly for the button that submits a form.
|
|
67
69
|
*
|
|
68
70
|
* Custom props:
|
|
69
71
|
* @param variant - 'contained' | 'outlined' | 'text' | 'textGray'
|
|
@@ -74,5 +76,5 @@ export type StyledButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
|
|
|
74
76
|
* @param refLink - ref to component
|
|
75
77
|
* @param dataTest - data-test tag
|
|
76
78
|
*/
|
|
77
|
-
export declare const StyledButton: ({ variant, className, size, children, refLink, startIcon, endIcon, dataTest, error, style: styleProp, disabled, disabledReason, loading, holdsDialog, loadingAnnouncement, locale, onClick, ...otherProps }: StyledButtonProps) => JSX.Element;
|
|
79
|
+
export declare const StyledButton: ({ variant, className, size, children, refLink, startIcon, endIcon, dataTest, error, style: styleProp, disabled, disabledReason, loading, holdsDialog, loadingAnnouncement, locale, onClick, type, ...otherProps }: StyledButtonProps) => JSX.Element;
|
|
78
80
|
export {};
|
|
@@ -36,5 +36,5 @@ export type StyledButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
|
|
|
36
36
|
* @param refLink - ref to component
|
|
37
37
|
* @param dataTest - data-test tag
|
|
38
38
|
*/
|
|
39
|
-
export declare const StyledButton: ({ variant, className, size, children, refLink, startIcon, endIcon, dataTest, error, ...otherProps }: StyledButtonProps) => JSX.Element;
|
|
39
|
+
export declare const StyledButton: ({ variant, className, size, children, refLink, startIcon, endIcon, dataTest, error, type, ...otherProps }: StyledButtonProps) => JSX.Element;
|
|
40
40
|
export {};
|
|
@@ -36,5 +36,5 @@ export type StyledButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
|
|
|
36
36
|
* @param refLink - ref to component
|
|
37
37
|
* @param dataTest - data-test tag
|
|
38
38
|
*/
|
|
39
|
-
export declare const StyledButton: ({ variant, className, size, children, refLink, startIcon, endIcon, dataTest, error, ...otherProps }: StyledButtonProps) => JSX.Element;
|
|
39
|
+
export declare const StyledButton: ({ variant, className, size, children, refLink, startIcon, endIcon, dataTest, error, type, ...otherProps }: StyledButtonProps) => JSX.Element;
|
|
40
40
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./StyledButton.module.js";
|
|
2
|
-
import
|
|
2
|
+
import f from "clsx";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as g, jsxs as y } from "react/jsx-runtime";
|
|
5
5
|
var r = {
|
|
6
6
|
contained: t.contained,
|
|
7
7
|
outlined: t.outlined,
|
|
@@ -13,16 +13,17 @@ var r = {
|
|
|
13
13
|
medium: t.medium,
|
|
14
14
|
error: t.error,
|
|
15
15
|
common: t.common
|
|
16
|
-
}, j = ({ variant:
|
|
17
|
-
const o = e === "large" || e === "medium",
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
...
|
|
20
|
-
|
|
16
|
+
}, j = ({ variant: a = "contained", className: m = "", size: e = "medium", children: n, refLink: i, startIcon: l, endIcon: d, dataTest: p, error: s, type: x = "button", ...c }) => {
|
|
17
|
+
const o = e === "large" || e === "medium", u = s ? "error" : "common";
|
|
18
|
+
return /* @__PURE__ */ y("button", {
|
|
19
|
+
...c,
|
|
20
|
+
type: x,
|
|
21
|
+
className: f(t["asma-core-ui-button"], r[a], r[u], r[e], m),
|
|
21
22
|
ref: i,
|
|
22
23
|
"data-test": p,
|
|
23
24
|
children: [
|
|
24
25
|
l,
|
|
25
|
-
|
|
26
|
+
n && /* @__PURE__ */ g("div", {
|
|
26
27
|
style: {
|
|
27
28
|
overflow: "hidden",
|
|
28
29
|
textOverflow: "ellipsis",
|
|
@@ -34,7 +35,7 @@ var r = {
|
|
|
34
35
|
paddingLeft: o ? "8px" : "4px",
|
|
35
36
|
paddingRight: o ? "8px" : "4px"
|
|
36
37
|
},
|
|
37
|
-
children:
|
|
38
|
+
children: n
|
|
38
39
|
}),
|
|
39
40
|
d
|
|
40
41
|
]
|