asma-ui-core 3.126.2 → 3.127.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/components/inputs/button/StyledButton.js +22 -21
- package/dist/components/inputs/select-autocomplete/SelectAutocompletePicker.js +111 -102
- 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,103 +1,112 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as re } from "../../../helpers/cn.js";
|
|
2
2
|
import { StyledCheckbox as Ne } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
3
|
-
import { StyledButton as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import { StyledButton as F } from "../button/StyledButton.js";
|
|
4
|
+
import { StyledEmptyPage as De } from "../../feedback/empty-page/StyledEmptyPage.js";
|
|
5
|
+
import { StyledSearchField as Se } from "../search-field/StyledSearchField.js";
|
|
6
|
+
import { useAnnouncer as $e } from "../full-screen-picker/PickerLiveRegion.js";
|
|
7
|
+
import { nextActiveIndex as Ie } from "./listboxCursor.js";
|
|
8
|
+
import { FullScreenPicker as _e } from "../full-screen-picker/FullScreenPicker.js";
|
|
9
|
+
import { useEffect as q, useMemo as Me, useRef as ee, useState as C } from "react";
|
|
10
|
+
import { jsx as t, jsxs as N } from "react/jsx-runtime";
|
|
11
|
+
var Re = 500, Le = "px-3 py-2 text-sm text-delta-600", le = "[&>div]:px-0";
|
|
12
|
+
function Ge({ open: l, dataTest: o, listboxId: u, title: D, name: g, text: a, options: f, multiple: d, value: m, clearable: B, isEqual: v, isOptionDisabled: H, getLabel: K, getOptionKey: j, filterOptions: S, renderOptionRow: te, optionRowClassName: U, loading: x, loadingText: ne, noOptionsText: oe, allowSelectAll: ae, selectAllLabel: se, onSelect: ce, onClear: ie, onApply: de, onCancel: ue }) {
|
|
13
|
+
const [c, $] = C(""), [n, h] = C(null), [i, W] = C([]), [fe, me] = C(!1), [he, pe] = C(!1), [we, I, ke] = $e();
|
|
14
|
+
l !== he && (pe(l), l && ($(""), h(null), W(Array.isArray(m) ? [...m] : []), me(!d && B && m !== null && !Array.isArray(m)), ke()));
|
|
15
|
+
const _ = ee([]), z = d ? null : m, Q = (e) => d ? i.some((r) => v(e, r)) : z !== null && v(e, z), s = Me(() => {
|
|
15
16
|
const e = [...f];
|
|
16
|
-
if (
|
|
17
|
-
const r =
|
|
18
|
-
return r ? e.filter((k) =>
|
|
17
|
+
if (S) return S(e, { inputValue: c });
|
|
18
|
+
const r = c.trim().toLowerCase();
|
|
19
|
+
return r ? e.filter((k) => K(k).toLowerCase().includes(r)) : e;
|
|
19
20
|
}, [
|
|
20
21
|
f,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
]), M = !!(
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
const e = window.setTimeout(() => I(
|
|
22
|
+
c,
|
|
23
|
+
S
|
|
24
|
+
]), M = !!(ae && d), p = M ? [-1, ...s.map((e, r) => r)] : s.map((e, r) => r), w = s.findIndex(Q), { noMatches: Y, matchCount: G } = a;
|
|
25
|
+
q(() => {
|
|
26
|
+
if (c === "") return;
|
|
27
|
+
const e = window.setTimeout(() => I(s.length === 0 ? Y : G(s.length)), Re);
|
|
27
28
|
return () => window.clearTimeout(e);
|
|
28
29
|
}, [
|
|
29
30
|
I,
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
s.length,
|
|
32
|
+
c,
|
|
32
33
|
Y,
|
|
33
34
|
G
|
|
34
35
|
]);
|
|
35
36
|
const R = ee(!1);
|
|
36
|
-
|
|
37
|
+
q(() => {
|
|
37
38
|
if (!l) {
|
|
38
39
|
R.current = !1;
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
|
-
R.current ||
|
|
42
|
-
}, [l,
|
|
42
|
+
R.current || x || (R.current = !0, w >= 0 && _.current[w]?.scrollIntoView({ block: "center" }));
|
|
43
|
+
}, [l, x]);
|
|
43
44
|
const L = (e) => {
|
|
44
45
|
h(e), e !== null && e >= 0 && _.current[e]?.scrollIntoView({ block: "nearest" });
|
|
45
|
-
},
|
|
46
|
+
}, P = (e, r = a.selectedCount(e.length)) => {
|
|
46
47
|
W(e), I(r);
|
|
47
48
|
}, ye = (e) => {
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
|
|
49
|
+
P(i.some((r) => v(e, r)) ? i.filter((r) => !v(e, r)) : [...i, e]);
|
|
50
|
+
}, b = f.length > 0 && i.length === f.length, J = () => P(b ? [] : [...f]), O = (e, r, k = !0) => {
|
|
51
|
+
H(r) || (d ? ye(r) : ce(e, r, k));
|
|
52
|
+
}, V = (e, r) => {
|
|
53
|
+
n === -1 ? J() : n !== null && s[n] !== void 0 && O(e, s[n], r);
|
|
53
54
|
}, X = (e) => {
|
|
54
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), L(
|
|
55
|
-
},
|
|
55
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), L(Ie(p, n, w, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), L(p[e.key === "Home" ? 0 : p.length - 1] ?? null)) : e.key === "Enter" ? (e.preventDefault(), V(e, !0)) : e.key === " " && c === "" && n !== null && (e.preventDefault(), V(e, !1));
|
|
56
|
+
}, Ce = (e) => {
|
|
56
57
|
if (e.key !== " ") {
|
|
57
58
|
X(e);
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
|
-
e.preventDefault(),
|
|
61
|
-
},
|
|
62
|
-
|
|
61
|
+
e.preventDefault(), V(e, !1);
|
|
62
|
+
}, ge = () => {
|
|
63
|
+
n === null && L(w >= 0 ? w : p[0] ?? null);
|
|
63
64
|
}, Z = (e) => `${o}-option-${e}`;
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const k =
|
|
68
|
-
return
|
|
69
|
-
key:
|
|
70
|
-
ref: (
|
|
71
|
-
_.current[r] =
|
|
65
|
+
let A;
|
|
66
|
+
n === -1 && M ? A = `${o}-select-all` : n !== null && s[n] !== void 0 && (A = Z(n));
|
|
67
|
+
const ve = (e, r) => {
|
|
68
|
+
const k = H(e), T = Q(e);
|
|
69
|
+
return te({
|
|
70
|
+
key: j ? String(j(e)) : `${K(e)}-${r}`,
|
|
71
|
+
ref: (y) => {
|
|
72
|
+
_.current[r] = y;
|
|
72
73
|
},
|
|
73
74
|
role: "option",
|
|
74
75
|
id: Z(r),
|
|
75
|
-
"aria-selected":
|
|
76
|
+
"aria-selected": T,
|
|
76
77
|
"aria-disabled": k || void 0,
|
|
77
|
-
"data-active":
|
|
78
|
+
"data-active": n === r ? "" : void 0,
|
|
78
79
|
className: U,
|
|
79
|
-
onMouseDown: (
|
|
80
|
-
onClick: (
|
|
80
|
+
onMouseDown: (y) => y.preventDefault(),
|
|
81
|
+
onClick: (y) => O(y, e),
|
|
81
82
|
onMouseMove: () => h(null)
|
|
82
83
|
}, e, {
|
|
83
|
-
selected:
|
|
84
|
+
selected: T,
|
|
84
85
|
index: r,
|
|
85
|
-
inputValue:
|
|
86
|
+
inputValue: c,
|
|
86
87
|
inPicker: !0
|
|
87
88
|
});
|
|
88
|
-
}, xe =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
}, xe = (() => {
|
|
90
|
+
if (!l) return null;
|
|
91
|
+
if (x) return /* @__PURE__ */ t("li", {
|
|
92
|
+
role: "presentation",
|
|
93
|
+
className: Le,
|
|
94
|
+
children: ne
|
|
95
|
+
});
|
|
96
|
+
if (s.length === 0) {
|
|
97
|
+
const e = c === "" ? oe : a.noMatches;
|
|
98
|
+
return /* @__PURE__ */ t("li", {
|
|
99
|
+
role: "presentation",
|
|
100
|
+
"data-testid": `${o}-picker-empty`,
|
|
101
|
+
className: "flex grow",
|
|
102
|
+
children: typeof e == "string" ? /* @__PURE__ */ t(De, { emptyText: e }) : e
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return s.map(ve);
|
|
106
|
+
})(), be = l && !x && s.length === 0, Ae = /* @__PURE__ */ t(Se, {
|
|
98
107
|
dataTest: `${o}-picker-search`,
|
|
99
108
|
label: a.search,
|
|
100
|
-
value:
|
|
109
|
+
value: c,
|
|
101
110
|
fullWidth: !0,
|
|
102
111
|
onChange: (e) => {
|
|
103
112
|
$(e.target.value), h(null);
|
|
@@ -111,67 +120,67 @@ function ze({ open: l, dataTest: o, listboxId: u, title: N, name: v, text: a, op
|
|
|
111
120
|
role: "combobox",
|
|
112
121
|
"aria-controls": u,
|
|
113
122
|
"aria-expanded": !0,
|
|
114
|
-
"aria-activedescendant":
|
|
123
|
+
"aria-activedescendant": A,
|
|
115
124
|
"aria-autocomplete": "list"
|
|
116
125
|
} }
|
|
117
126
|
});
|
|
118
|
-
let
|
|
119
|
-
return d ?
|
|
127
|
+
let E;
|
|
128
|
+
return d ? E = /* @__PURE__ */ t(Pe, {
|
|
120
129
|
dataTest: o,
|
|
121
130
|
count: a.selectedCount(i.length),
|
|
122
|
-
clearAllLabel:
|
|
131
|
+
clearAllLabel: B ? a.clearAll : void 0,
|
|
123
132
|
clearAllShown: i.length > 0,
|
|
124
133
|
doneLabel: a.done,
|
|
125
|
-
onClearAll: () =>
|
|
126
|
-
onDone: (e) =>
|
|
127
|
-
}) :
|
|
134
|
+
onClearAll: () => P([], a.clearedAll),
|
|
135
|
+
onDone: (e) => de(e, i)
|
|
136
|
+
}) : fe && (E = /* @__PURE__ */ t(Ve, {
|
|
128
137
|
dataTest: o,
|
|
129
138
|
label: a.clearOne,
|
|
130
|
-
onClear:
|
|
131
|
-
})), /* @__PURE__ */
|
|
139
|
+
onClear: ie
|
|
140
|
+
})), /* @__PURE__ */ t(_e, {
|
|
132
141
|
open: l,
|
|
133
|
-
onClose:
|
|
142
|
+
onClose: ue,
|
|
134
143
|
dataTest: `${o}-picker`,
|
|
135
|
-
title:
|
|
136
|
-
fallbackName:
|
|
144
|
+
title: D,
|
|
145
|
+
fallbackName: g,
|
|
137
146
|
closeLabel: a.close,
|
|
138
147
|
search: Ae,
|
|
139
|
-
headerRow:
|
|
140
|
-
announcement:
|
|
141
|
-
children: /* @__PURE__ */
|
|
148
|
+
headerRow: E,
|
|
149
|
+
announcement: we,
|
|
150
|
+
children: /* @__PURE__ */ N("ul", {
|
|
142
151
|
id: u,
|
|
143
152
|
role: "listbox",
|
|
144
|
-
"aria-label":
|
|
153
|
+
"aria-label": g,
|
|
145
154
|
"aria-multiselectable": d || void 0,
|
|
146
155
|
tabIndex: 0,
|
|
147
|
-
"aria-activedescendant":
|
|
148
|
-
onKeyDown:
|
|
149
|
-
onFocus:
|
|
150
|
-
className:
|
|
151
|
-
children: [M && /* @__PURE__ */
|
|
156
|
+
"aria-activedescendant": A,
|
|
157
|
+
onKeyDown: Ce,
|
|
158
|
+
onFocus: ge,
|
|
159
|
+
className: re("m-0 list-none p-0 [&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", be && "flex grow flex-col", p.length > 0 && "outline-none", "[&>li[role=option]]:pr-4 [&>li[role=option]]:text-delta-700", d ? "[&>li[aria-selected=true]:not(:hover)]:bg-white" : "[&>li[aria-selected=true]:not([aria-disabled=true])]:bg-gama-25 [&>li[role=option]]:gap-x-1 [&>li[role=option]]:pl-2"),
|
|
160
|
+
children: [M && /* @__PURE__ */ N("li", {
|
|
152
161
|
id: `${o}-select-all`,
|
|
153
162
|
role: "option",
|
|
154
|
-
"aria-selected":
|
|
155
|
-
"data-active":
|
|
163
|
+
"aria-selected": b,
|
|
164
|
+
"data-active": n === -1 ? "" : void 0,
|
|
156
165
|
tabIndex: -1,
|
|
157
166
|
onMouseDown: (e) => e.preventDefault(),
|
|
158
167
|
onClick: J,
|
|
159
168
|
className: U,
|
|
160
169
|
children: [
|
|
161
|
-
|
|
170
|
+
n === -1 && /* @__PURE__ */ t("span", {
|
|
162
171
|
"aria-hidden": "true",
|
|
163
172
|
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
164
173
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ t(Ne, {
|
|
166
175
|
dataTest: `${o}-picker-select-all`,
|
|
167
|
-
checked:
|
|
168
|
-
indeterminate: i.length > 0 && !
|
|
176
|
+
checked: b,
|
|
177
|
+
indeterminate: i.length > 0 && !b,
|
|
169
178
|
size: "medium",
|
|
170
179
|
checkboxClassName: "!h-4 !w-4",
|
|
171
180
|
hideWrapper: !0,
|
|
172
181
|
decorative: !0
|
|
173
182
|
}),
|
|
174
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ t("span", {
|
|
175
184
|
className: "min-w-0 flex-1 break-words",
|
|
176
185
|
children: se
|
|
177
186
|
})
|
|
@@ -180,40 +189,40 @@ function ze({ open: l, dataTest: o, listboxId: u, title: N, name: v, text: a, op
|
|
|
180
189
|
})
|
|
181
190
|
});
|
|
182
191
|
}
|
|
183
|
-
var
|
|
192
|
+
var Pe = ({ dataTest: l, count: o, clearAllLabel: u, clearAllShown: D, doneLabel: g, onClearAll: a, onDone: f }) => /* @__PURE__ */ N("div", {
|
|
184
193
|
className: "flex flex-wrap items-center gap-x-6 gap-y-2 px-4 py-2",
|
|
185
194
|
"data-testid": `${l}-picker-selection-row`,
|
|
186
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ N("div", {
|
|
187
196
|
className: "flex min-w-min flex-[1_1_0%] flex-wrap items-center gap-x-1",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ t("span", {
|
|
189
198
|
className: "text-base text-delta-600",
|
|
190
199
|
"data-testid": `${l}-picker-count`,
|
|
191
200
|
children: o
|
|
192
|
-
}), u !== void 0 && /* @__PURE__ */
|
|
201
|
+
}), u !== void 0 && /* @__PURE__ */ t(F, {
|
|
193
202
|
dataTest: `${l}-picker-clear-all`,
|
|
194
203
|
variant: "text",
|
|
195
|
-
className: le
|
|
204
|
+
className: re(le, !D && "invisible"),
|
|
196
205
|
onClick: a,
|
|
197
206
|
children: u
|
|
198
207
|
})]
|
|
199
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ t(F, {
|
|
200
209
|
dataTest: `${l}-picker-done`,
|
|
201
210
|
variant: "contained",
|
|
202
211
|
className: "ml-auto shrink-0 whitespace-nowrap",
|
|
203
212
|
onClick: f,
|
|
204
|
-
children:
|
|
213
|
+
children: g
|
|
205
214
|
})]
|
|
206
|
-
}),
|
|
215
|
+
}), Ve = ({ dataTest: l, label: o, onClear: u }) => /* @__PURE__ */ t("div", {
|
|
207
216
|
className: "flex px-4 py-2",
|
|
208
217
|
"data-testid": `${l}-picker-clear-row`,
|
|
209
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ t(F, {
|
|
210
219
|
dataTest: `${l}-picker-clear`,
|
|
211
220
|
variant: "text",
|
|
212
|
-
className:
|
|
221
|
+
className: le,
|
|
213
222
|
onClick: u,
|
|
214
223
|
children: o
|
|
215
224
|
})
|
|
216
225
|
});
|
|
217
226
|
export {
|
|
218
|
-
|
|
227
|
+
Ge as SelectAutocompletePicker
|
|
219
228
|
};
|
|
@@ -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
|
]
|