@solibo/solibo-ui 1.0.11 → 1.0.12
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/assets/index12.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/components/badge/index.cjs +1 -1
- package/dist/components/badge/index.js +37 -37
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.cjs.map +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.cjs +1 -1
- package/dist/components/chip/index.js +7 -7
- package/dist/components/controls/index.cjs +1 -1
- package/dist/components/controls/index.cjs.map +1 -1
- package/dist/components/controls/index.js +20 -20
- package/dist/components/controls/index.js.map +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +65 -65
- package/dist/components/editor/index.cjs +16 -16
- package/dist/components/editor/index.js +4 -4
- package/dist/components/header/index.cjs +1 -1
- package/dist/components/header/index.js +9 -9
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/menu/index.cjs +1 -1
- package/dist/components/menu/index.cjs.map +1 -1
- package/dist/components/menu/index.js +67 -59
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.js +21 -21
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.js +19 -19
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.cjs.map +1 -1
- package/dist/components/popover/index.js +78 -79
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.cjs.map +1 -1
- package/dist/components/search/index.js +75 -45
- package/dist/components/search/index.js.map +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/toasts/index.cjs +1 -1
- package/dist/components/toasts/index.js +4 -4
- package/dist/{icons-BFgf_lJN.js → icons-BIi_mYLy.js} +4 -1
- package/dist/icons-BIi_mYLy.js.map +1 -0
- package/dist/icons-CR-eUx2p.cjs +2 -0
- package/dist/icons-CR-eUx2p.cjs.map +1 -0
- package/dist/index-CWD8Jp0A.cjs +2 -0
- package/dist/{index-CEzqxRIu.cjs.map → index-CWD8Jp0A.cjs.map} +1 -1
- package/dist/{index-C_YiNpZP.js → index-Clex8VE6.js} +2 -2
- package/dist/{index-C_YiNpZP.js.map → index-Clex8VE6.js.map} +1 -1
- package/dist/{index-BPIK2dxs.cjs → index-DVXi-Ryi.cjs} +2 -2
- package/dist/{index-BPIK2dxs.cjs.map → index-DVXi-Ryi.cjs.map} +1 -1
- package/dist/index-yIe5PqD1.js +73 -0
- package/dist/{index-BHgGZxsR.js.map → index-yIe5PqD1.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +35 -12
- package/dist/index.js +2 -2
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
- package/dist/icons-BFgf_lJN.js.map +0 -1
- package/dist/icons-Dx0NQYLH.cjs +0 -2
- package/dist/icons-Dx0NQYLH.cjs.map +0 -1
- package/dist/index-BHgGZxsR.js +0 -73
- package/dist/index-CEzqxRIu.cjs +0 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsxs as p, Fragment as pe, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { t as V } from "../../classix-DG18itHa.js";
|
|
3
|
-
import fe, { Children as me, isValidElement as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { i as
|
|
6
|
-
import { f as
|
|
3
|
+
import fe, { Children as me, isValidElement as v, useRef as I, useId as be, useState as W, useEffect as Q } from "react";
|
|
4
|
+
import { Button as z } from "../button/index.js";
|
|
5
|
+
import { i as he } from "../../icons-BIi_mYLy.js";
|
|
6
|
+
import { f as _e, I as ye } from "../../index-yIe5PqD1.js";
|
|
7
7
|
import { List as ge } from "../list/index.js";
|
|
8
|
-
import { S as
|
|
8
|
+
import { S as ve, s as xe, r as ee } from "../../index-Clex8VE6.js";
|
|
9
9
|
import '../../assets/index39.css';function L(t) {
|
|
10
|
-
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(L).join(" ") :
|
|
10
|
+
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(L).join(" ") : v(t) ? L(t.props.children) : "";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
function je(t) {
|
|
16
|
-
return w(t) && t.type === "optgroup";
|
|
12
|
+
function we(t) {
|
|
13
|
+
return v(t) && t.type === "option";
|
|
17
14
|
}
|
|
18
15
|
function Se(t) {
|
|
19
|
-
return
|
|
16
|
+
return v(t) && t.type === "optgroup";
|
|
17
|
+
}
|
|
18
|
+
function qe(t) {
|
|
19
|
+
return v(t) && t.type === fe.Fragment;
|
|
20
20
|
}
|
|
21
21
|
function Ne(t) {
|
|
22
|
-
return
|
|
22
|
+
return v(t) && t.type === ve;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function M(t, i, r = !1) {
|
|
25
25
|
const l = [];
|
|
26
26
|
return me.forEach(t, (n) => {
|
|
27
|
-
if (
|
|
28
|
-
l.push(...
|
|
29
|
-
else if (
|
|
27
|
+
if (qe(n))
|
|
28
|
+
l.push(...M(n.props.children, i, r));
|
|
29
|
+
else if (we(n)) {
|
|
30
30
|
const a = L(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : a;
|
|
31
31
|
l.push({
|
|
32
32
|
disabled: r || !!n.props.disabled,
|
|
@@ -38,7 +38,7 @@ function A(t, i, r = !1) {
|
|
|
38
38
|
text: a,
|
|
39
39
|
value: f
|
|
40
40
|
});
|
|
41
|
-
} else
|
|
41
|
+
} else Se(n) && l.push(...M(n.props.children, n.props.label, r || !!n.props.disabled));
|
|
42
42
|
}), l;
|
|
43
43
|
}
|
|
44
44
|
function Ce(t) {
|
|
@@ -78,29 +78,29 @@ function Le(t) {
|
|
|
78
78
|
props: t.props
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
const $e = "
|
|
81
|
+
const $e = "_combobox_1bqyf_3", Be = "_dropdown_1bqyf_27", ke = "_empty_1bqyf_30", De = "_group_1bqyf_31", Pe = "_placeholder_1bqyf_32", Re = "_filter_1bqyf_40", je = "_native_1bqyf_52", Fe = "_option_1bqyf_62", We = "_options_1bqyf_84", Qe = "_panel_1bqyf_108", ze = "_selected_1bqyf_132", Me = "_text_1bqyf_136", Ae = "_trigger_1bqyf_144", Ge = "_minimal_1bqyf_180", Ke = "_inline_1bqyf_235", Oe = "_label_1bqyf_267", o = {
|
|
82
82
|
combobox: $e,
|
|
83
|
-
"combobox-input": "_combobox-
|
|
83
|
+
"combobox-input": "_combobox-input_1bqyf_12",
|
|
84
84
|
dropdown: Be,
|
|
85
85
|
empty: ke,
|
|
86
86
|
group: De,
|
|
87
87
|
placeholder: Pe,
|
|
88
88
|
filter: Re,
|
|
89
|
-
native:
|
|
90
|
-
option:
|
|
91
|
-
options:
|
|
92
|
-
panel:
|
|
93
|
-
selected:
|
|
94
|
-
text:
|
|
95
|
-
trigger:
|
|
96
|
-
minimal:
|
|
97
|
-
inline:
|
|
98
|
-
label:
|
|
99
|
-
"inline-field": "_inline-
|
|
89
|
+
native: je,
|
|
90
|
+
option: Fe,
|
|
91
|
+
options: We,
|
|
92
|
+
panel: Qe,
|
|
93
|
+
selected: ze,
|
|
94
|
+
text: Me,
|
|
95
|
+
trigger: Ae,
|
|
96
|
+
minimal: Ge,
|
|
97
|
+
inline: Ke,
|
|
98
|
+
label: Oe,
|
|
99
|
+
"inline-field": "_inline-field_1bqyf_273"
|
|
100
100
|
};
|
|
101
101
|
function te(t, i) {
|
|
102
102
|
return {
|
|
103
|
-
"--icon-svg":
|
|
103
|
+
"--icon-svg": he(t).replace("currentColor", i)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const tt = ({
|
|
@@ -113,7 +113,7 @@ const tt = ({
|
|
|
113
113
|
renderOption: f,
|
|
114
114
|
searchPlaceholder: $ = "Filter",
|
|
115
115
|
selectedItems: ne,
|
|
116
|
-
variant:
|
|
116
|
+
variant: _ = "default",
|
|
117
117
|
...re
|
|
118
118
|
}) => {
|
|
119
119
|
const B = Le(t), {
|
|
@@ -121,88 +121,88 @@ const tt = ({
|
|
|
121
121
|
onChange: k,
|
|
122
122
|
value: D,
|
|
123
123
|
...oe
|
|
124
|
-
} = B.props,
|
|
124
|
+
} = B.props, x = xe(oe), A = I(null), G = I(null), w = be(), K = I(null), m = I(null), y = M(B.children), g = D != null, P = Ie(y, D, le), [R, j] = W(() => P), [c, d] = W(!1), [S, q] = W(""), N = g ? String(D) : R, O = {
|
|
125
125
|
default: ee("--colors-semantic-content-secondary"),
|
|
126
126
|
white: ee("--color-white", "white")
|
|
127
|
-
},
|
|
127
|
+
}, T = _ === "minimal" ? O.white : O.default, C = Ve(y, N), ie = te("chevron", T), se = te("search", T), H = Ee(y, S), b = S.trim(), E = !!(r && l && b && l.isValid(b)), ae = a && _ === "inline" ? _e(a) : a, J = (e) => e ? (f == null ? void 0 : f({
|
|
128
128
|
groupLabel: e.groupLabel,
|
|
129
129
|
isSelected: e.value === N,
|
|
130
130
|
label: e.label,
|
|
131
131
|
text: e.text,
|
|
132
132
|
value: e.value
|
|
133
133
|
})) ?? e.label : "Select an option";
|
|
134
|
-
|
|
135
|
-
!g && !
|
|
136
|
-
}, [P, R, g,
|
|
134
|
+
Q(() => {
|
|
135
|
+
!g && !y.some((e) => e.value === R) && j(P);
|
|
136
|
+
}, [P, R, g, y]), Q(() => {
|
|
137
137
|
var e;
|
|
138
138
|
if (!c) {
|
|
139
|
-
|
|
139
|
+
q("");
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
(e = m.current) == null || e.focus();
|
|
143
|
-
}, [c]),
|
|
143
|
+
}, [c]), Q(() => {
|
|
144
144
|
if (!c)
|
|
145
145
|
return;
|
|
146
146
|
const e = (u) => {
|
|
147
|
-
var
|
|
148
|
-
(
|
|
147
|
+
var h;
|
|
148
|
+
(h = G.current) != null && h.contains(u.target) || d(!1);
|
|
149
149
|
};
|
|
150
150
|
return document.addEventListener("mousedown", e), () => {
|
|
151
151
|
document.removeEventListener("mousedown", e);
|
|
152
152
|
};
|
|
153
153
|
}, [c]);
|
|
154
154
|
const ce = (e) => {
|
|
155
|
-
g ||
|
|
156
|
-
},
|
|
155
|
+
g || j(e.target.value), k == null || k(e);
|
|
156
|
+
}, F = () => {
|
|
157
157
|
var e;
|
|
158
|
-
d(!1), r || (e =
|
|
158
|
+
d(!1), r || (e = A.current) == null || e.focus();
|
|
159
159
|
}, U = () => {
|
|
160
160
|
var e;
|
|
161
|
-
|
|
161
|
+
q(""), d(!0), (e = m.current) == null || e.focus();
|
|
162
162
|
}, X = () => {
|
|
163
|
-
!l || !E || (l.onCreate(
|
|
163
|
+
!l || !E || (l.onCreate(b), U());
|
|
164
164
|
}, ue = (e) => {
|
|
165
165
|
var Z;
|
|
166
|
-
g ||
|
|
167
|
-
const u =
|
|
166
|
+
g || j(e);
|
|
167
|
+
const u = K.current;
|
|
168
168
|
if (!u) {
|
|
169
|
-
|
|
169
|
+
F();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
172
|
+
const h = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
|
|
173
|
+
h == null || h.call(u, e), u.dispatchEvent(new Event("change", {
|
|
174
174
|
bubbles: !0
|
|
175
|
-
})), r ? U() :
|
|
175
|
+
})), r ? U() : F();
|
|
176
176
|
}, de = (e) => {
|
|
177
|
-
e.key === "Escape" &&
|
|
178
|
-
}, Y = /* @__PURE__ */ p("div", { className: V(o.dropdown,
|
|
179
|
-
/* @__PURE__ */ s("select", { ...
|
|
177
|
+
e.key === "Escape" && F(), e.key === "Enter" && e.target === m.current && E && (e.preventDefault(), X());
|
|
178
|
+
}, Y = /* @__PURE__ */ p("div", { className: V(o.dropdown, _ === "inline" && o.inline, _ === "minimal" && o.minimal, i), onKeyDown: de, ref: G, ...re, children: [
|
|
179
|
+
/* @__PURE__ */ s("select", { ...x, "aria-hidden": "true", className: o.native, onChange: ce, ref: K, tabIndex: -1, value: N, children: B.children }),
|
|
180
180
|
r ? /* @__PURE__ */ p("div", { className: o.combobox, onClick: () => {
|
|
181
181
|
var e;
|
|
182
182
|
return (e = m.current) == null ? void 0 : e.focus();
|
|
183
183
|
}, children: [
|
|
184
184
|
ne,
|
|
185
|
-
/* @__PURE__ */ s("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label":
|
|
186
|
-
|
|
187
|
-
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder: $ || void 0, ref: m, role: "combobox", type: "text", value:
|
|
188
|
-
] }) : /* @__PURE__ */ s(
|
|
185
|
+
/* @__PURE__ */ s("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": x["aria-label"] ?? a ?? $, className: o["combobox-input"], disabled: x.disabled, onChange: (e) => {
|
|
186
|
+
q(e.target.value), d(!0);
|
|
187
|
+
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder: $ || void 0, ref: m, role: "combobox", type: "text", value: S })
|
|
188
|
+
] }) : /* @__PURE__ */ s(z, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${w} ${w}-value` : void 0, className: V(o.trigger, (C == null ? void 0 : C.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: x.disabled, onClick: () => d((e) => !e), ref: A, style: ie, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, id: `${w}-value`, children: J(C) }) }),
|
|
189
189
|
c && /* @__PURE__ */ p("div", { className: o.panel, children: [
|
|
190
|
-
!r && /* @__PURE__ */ s(
|
|
190
|
+
!r && /* @__PURE__ */ s(ye, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => q(e.target.value), placeholder: $, ref: m, style: se, type: "search", value: S }),
|
|
191
191
|
/* @__PURE__ */ p(ge, { "aria-label": "Dropdown", className: o.options, children: [
|
|
192
192
|
H.map((e) => {
|
|
193
193
|
const u = e.value === N;
|
|
194
|
-
return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(
|
|
194
|
+
return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(z, { "aria-label": u ? `${e.text}, selected` : e.text, className: V(o.option, u && o.selected), disabled: e.disabled, onClick: () => ue(e.value), variant: "tertiary", children: [
|
|
195
195
|
/* @__PURE__ */ s("span", { className: o.text, children: J(e) }),
|
|
196
196
|
e.groupLabel && /* @__PURE__ */ s("small", { className: o.group, children: e.groupLabel })
|
|
197
197
|
] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
|
|
198
198
|
}),
|
|
199
|
-
E && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
199
|
+
E && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(z, { "aria-label": L(l.render(b)) || b, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, children: l.render(b) }) }) }),
|
|
200
200
|
H.length === 0 && !E && /* @__PURE__ */ s("li", { className: o.empty, children: n })
|
|
201
201
|
] })
|
|
202
202
|
] })
|
|
203
203
|
] });
|
|
204
|
-
return a ? /* @__PURE__ */ p("div", { className: V(o.label,
|
|
205
|
-
/* @__PURE__ */ s("span", { id:
|
|
204
|
+
return a ? /* @__PURE__ */ p("div", { className: V(o.label, _ === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
|
|
205
|
+
/* @__PURE__ */ s("span", { id: w, children: ae }),
|
|
206
206
|
Y
|
|
207
207
|
] }) : Y;
|
|
208
208
|
};
|