@solibo/solibo-ui 1.0.7 → 1.0.10
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/index.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index46.css +1 -1
- package/dist/assets/index51.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/components/card/index.cjs +1 -1
- package/dist/components/card/index.js +45 -45
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.cjs.map +1 -1
- package/dist/components/dialog/index.js +39 -37
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +70 -70
- package/dist/components/editor/index.cjs +25 -25
- package/dist/components/editor/index.cjs.map +1 -1
- package/dist/components/editor/index.js +1561 -1550
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +22 -22
- package/dist/components/iframe/index.cjs +1 -1
- package/dist/components/iframe/index.cjs.map +1 -1
- package/dist/components/iframe/index.js +46 -49
- package/dist/components/iframe/index.js.map +1 -1
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.js +18 -18
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.cjs.map +1 -1
- package/dist/components/popover/index.js +10 -10
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +29 -29
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sortable/index.cjs +1 -1
- package/dist/components/sortable/index.cjs.map +1 -1
- package/dist/components/sortable/index.js +141 -134
- package/dist/components/sortable/index.js.map +1 -1
- package/dist/{index-oL8GYbhj.cjs → index-BPIK2dxs.cjs} +2 -2
- package/dist/{index-oL8GYbhj.cjs.map → index-BPIK2dxs.cjs.map} +1 -1
- package/dist/{index-CMfR_USP.js → index-C_YiNpZP.js} +8 -8
- package/dist/{index-CMfR_USP.js.map → index-C_YiNpZP.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +37 -36
- package/dist/tokens.css +3 -1
- package/dist/tokens.json +46 -19
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as p, Fragment as pe, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { t as
|
|
3
|
-
import fe, { Children as me, isValidElement as
|
|
2
|
+
import { t as V } from "../../classix-DG18itHa.js";
|
|
3
|
+
import fe, { Children as me, isValidElement as w, useRef as I, useId as he, useState as Q, useEffect as z } from "react";
|
|
4
4
|
import { Button as M } from "../button/index.js";
|
|
5
|
-
import { i as
|
|
6
|
-
import { f as
|
|
7
|
-
import { List as
|
|
8
|
-
import { S as
|
|
9
|
-
import '../../assets/index39.css';function
|
|
10
|
-
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(
|
|
5
|
+
import { i as _e } from "../../icons-BFgf_lJN.js";
|
|
6
|
+
import { f as ye, I as be } from "../../index-BHgGZxsR.js";
|
|
7
|
+
import { List as ge } from "../list/index.js";
|
|
8
|
+
import { S as we, s as ve, r as ee } from "../../index-C_YiNpZP.js";
|
|
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(" ") : w(t) ? L(t.props.children) : "";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
12
|
+
function xe(t) {
|
|
13
|
+
return w(t) && t.type === "option";
|
|
14
|
+
}
|
|
15
|
+
function je(t) {
|
|
16
|
+
return w(t) && t.type === "optgroup";
|
|
14
17
|
}
|
|
15
18
|
function Se(t) {
|
|
16
|
-
return
|
|
19
|
+
return w(t) && t.type === fe.Fragment;
|
|
17
20
|
}
|
|
18
21
|
function Ne(t) {
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
function Ce(t) {
|
|
22
|
-
return v(t) && t.type === ve;
|
|
22
|
+
return w(t) && t.type === we;
|
|
23
23
|
}
|
|
24
24
|
function A(t, i, r = !1) {
|
|
25
25
|
const l = [];
|
|
26
26
|
return me.forEach(t, (n) => {
|
|
27
|
-
if (
|
|
27
|
+
if (Se(n))
|
|
28
28
|
l.push(...A(n.props.children, i, r));
|
|
29
|
-
else if (
|
|
30
|
-
const a =
|
|
29
|
+
else if (xe(n)) {
|
|
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,
|
|
33
33
|
groupLabel: i,
|
|
@@ -38,28 +38,28 @@ function A(t, i, r = !1) {
|
|
|
38
38
|
text: a,
|
|
39
39
|
value: f
|
|
40
40
|
});
|
|
41
|
-
} else
|
|
41
|
+
} else je(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
|
|
42
42
|
}), l;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ce(t) {
|
|
45
45
|
const i = t.trim();
|
|
46
46
|
if (!i) return null;
|
|
47
47
|
const l = [.../[*?]/.test(i) ? i : `*${i}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
|
|
48
48
|
return new RegExp(`^${l}$`, "i");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const r =
|
|
50
|
+
function Ee(t, i) {
|
|
51
|
+
const r = Ce(i), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
|
|
52
52
|
return r ? l.filter((n) => r.test([n.groupLabel, n.text, n.value].filter(Boolean).join(" "))) : l;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Ve(t, i) {
|
|
55
55
|
return t.find((r) => r.value === i) ?? t.find((r) => r.isPlaceholder) ?? t[0];
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Ie(t, i, r) {
|
|
58
58
|
var l, n;
|
|
59
59
|
return i != null ? String(i) : r != null ? String(r) : ((l = t.find((a) => a.selected)) == null ? void 0 : l.value) ?? ((n = t[0]) == null ? void 0 : n.value) ?? "";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
61
|
+
function Le(t) {
|
|
62
|
+
if (Ne(t)) {
|
|
63
63
|
const {
|
|
64
64
|
children: i,
|
|
65
65
|
placeholder: r,
|
|
@@ -78,14 +78,14 @@ function $e(t) {
|
|
|
78
78
|
props: t.props
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
combobox:
|
|
83
|
-
"combobox-input": "_combobox-
|
|
84
|
-
dropdown:
|
|
85
|
-
empty:
|
|
86
|
-
group:
|
|
87
|
-
placeholder:
|
|
88
|
-
filter:
|
|
81
|
+
const $e = "_combobox_18jwy_3", Be = "_dropdown_18jwy_27", ke = "_empty_18jwy_30", De = "_group_18jwy_31", Pe = "_placeholder_18jwy_32", Re = "_filter_18jwy_40", Fe = "_native_18jwy_52", We = "_option_18jwy_62", Qe = "_options_18jwy_84", ze = "_panel_18jwy_108", Me = "_selected_18jwy_132", Ae = "_text_18jwy_136", Ge = "_trigger_18jwy_145", Ke = "_minimal_18jwy_181", Oe = "_inline_18jwy_236", Te = "_label_18jwy_268", o = {
|
|
82
|
+
combobox: $e,
|
|
83
|
+
"combobox-input": "_combobox-input_18jwy_12",
|
|
84
|
+
dropdown: Be,
|
|
85
|
+
empty: ke,
|
|
86
|
+
group: De,
|
|
87
|
+
placeholder: Pe,
|
|
88
|
+
filter: Re,
|
|
89
89
|
native: Fe,
|
|
90
90
|
option: We,
|
|
91
91
|
options: Qe,
|
|
@@ -96,11 +96,11 @@ const Be = "_combobox_1x1gr_3", ke = "_dropdown_1x1gr_27", De = "_empty_1x1gr_30
|
|
|
96
96
|
minimal: Ke,
|
|
97
97
|
inline: Oe,
|
|
98
98
|
label: Te,
|
|
99
|
-
"inline-field": "_inline-
|
|
99
|
+
"inline-field": "_inline-field_18jwy_274"
|
|
100
100
|
};
|
|
101
101
|
function te(t, i) {
|
|
102
102
|
return {
|
|
103
|
-
"--icon-svg":
|
|
103
|
+
"--icon-svg": _e(t).replace("currentColor", i)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const tt = ({
|
|
@@ -111,32 +111,32 @@ const tt = ({
|
|
|
111
111
|
emptyLabel: n = "No matches found",
|
|
112
112
|
label: a,
|
|
113
113
|
renderOption: f,
|
|
114
|
-
searchPlaceholder:
|
|
114
|
+
searchPlaceholder: $ = "Filter",
|
|
115
115
|
selectedItems: ne,
|
|
116
|
-
variant:
|
|
116
|
+
variant: y = "default",
|
|
117
117
|
...re
|
|
118
118
|
}) => {
|
|
119
|
-
const
|
|
119
|
+
const B = Le(t), {
|
|
120
120
|
defaultValue: le,
|
|
121
|
-
onChange:
|
|
122
|
-
value:
|
|
121
|
+
onChange: k,
|
|
122
|
+
value: D,
|
|
123
123
|
...oe
|
|
124
|
-
} =
|
|
124
|
+
} = B.props, v = ve(oe), G = I(null), K = I(null), x = he(), O = I(null), m = I(null), b = A(B.children), g = D != null, P = Ie(b, D, le), [R, F] = Q(() => P), [c, d] = Q(!1), [j, S] = Q(""), N = g ? String(D) : R, T = {
|
|
125
125
|
default: ee("--colors-semantic-content-secondary"),
|
|
126
126
|
white: ee("--color-white", "white")
|
|
127
|
-
}, q =
|
|
127
|
+
}, q = y === "minimal" ? T.white : T.default, C = Ve(b, N), ie = te("chevron", q), se = te("search", q), H = Ee(b, j), h = j.trim(), E = !!(r && l && h && l.isValid(h)), ae = a && y === "inline" ? ye(a) : a, J = (e) => e ? (f == null ? void 0 : f({
|
|
128
128
|
groupLabel: e.groupLabel,
|
|
129
|
-
isSelected: e.value ===
|
|
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
134
|
z(() => {
|
|
135
|
-
!
|
|
136
|
-
}, [
|
|
135
|
+
!g && !b.some((e) => e.value === R) && F(P);
|
|
136
|
+
}, [P, R, g, b]), z(() => {
|
|
137
137
|
var e;
|
|
138
138
|
if (!c) {
|
|
139
|
-
|
|
139
|
+
S("");
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
(e = m.current) == null || e.focus();
|
|
@@ -144,65 +144,65 @@ const tt = ({
|
|
|
144
144
|
if (!c)
|
|
145
145
|
return;
|
|
146
146
|
const e = (u) => {
|
|
147
|
-
var
|
|
148
|
-
(
|
|
147
|
+
var _;
|
|
148
|
+
(_ = K.current) != null && _.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
|
-
|
|
155
|
+
g || F(e.target.value), k == null || k(e);
|
|
156
156
|
}, W = () => {
|
|
157
157
|
var e;
|
|
158
158
|
d(!1), r || (e = G.current) == null || e.focus();
|
|
159
159
|
}, U = () => {
|
|
160
160
|
var e;
|
|
161
|
-
|
|
161
|
+
S(""), d(!0), (e = m.current) == null || e.focus();
|
|
162
162
|
}, X = () => {
|
|
163
|
-
!l || !
|
|
163
|
+
!l || !E || (l.onCreate(h), U());
|
|
164
164
|
}, ue = (e) => {
|
|
165
165
|
var Z;
|
|
166
|
-
|
|
166
|
+
g || F(e);
|
|
167
167
|
const u = O.current;
|
|
168
168
|
if (!u) {
|
|
169
169
|
W();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
172
|
+
const _ = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
|
|
173
|
+
_ == null || _.call(u, e), u.dispatchEvent(new Event("change", {
|
|
174
174
|
bubbles: !0
|
|
175
175
|
})), r ? U() : W();
|
|
176
176
|
}, de = (e) => {
|
|
177
|
-
e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current &&
|
|
178
|
-
}, Y = /* @__PURE__ */ p("div", { className:
|
|
179
|
-
/* @__PURE__ */ s("select", { ...
|
|
177
|
+
e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current && E && (e.preventDefault(), X());
|
|
178
|
+
}, Y = /* @__PURE__ */ p("div", { className: V(o.dropdown, y === "inline" && o.inline, y === "minimal" && o.minimal, i), onKeyDown: de, ref: K, ...re, children: [
|
|
179
|
+
/* @__PURE__ */ s("select", { ...v, "aria-hidden": "true", className: o.native, onChange: ce, ref: O, 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:
|
|
188
|
-
] }) : /* @__PURE__ */ s(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${
|
|
185
|
+
/* @__PURE__ */ s("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": v["aria-label"] ?? a ?? $, className: o["combobox-input"], disabled: v.disabled, onChange: (e) => {
|
|
186
|
+
S(e.target.value), d(!0);
|
|
187
|
+
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder: $ || void 0, ref: m, role: "combobox", type: "text", value: j })
|
|
188
|
+
] }) : /* @__PURE__ */ s(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${x} ${x}-value` : void 0, className: V(o.trigger, (C == null ? void 0 : C.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: v.disabled, onClick: () => d((e) => !e), ref: G, style: ie, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, id: `${x}-value`, children: J(C) }) }),
|
|
189
189
|
c && /* @__PURE__ */ p("div", { className: o.panel, children: [
|
|
190
|
-
!r && /* @__PURE__ */ s(be, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) =>
|
|
191
|
-
/* @__PURE__ */ p(
|
|
190
|
+
!r && /* @__PURE__ */ s(be, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => S(e.target.value), placeholder: $, ref: m, style: se, type: "search", value: j }),
|
|
191
|
+
/* @__PURE__ */ p(ge, { "aria-label": "Dropdown", className: o.options, children: [
|
|
192
192
|
H.map((e) => {
|
|
193
|
-
const u = e.value ===
|
|
194
|
-
return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label": u ? `${e.text}, selected` : e.text, className:
|
|
193
|
+
const u = e.value === N;
|
|
194
|
+
return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "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
|
-
|
|
200
|
-
H.length === 0 && !
|
|
199
|
+
E && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(M, { "aria-label": L(l.render(h)) || h, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, children: l.render(h) }) }) }),
|
|
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:
|
|
205
|
-
/* @__PURE__ */ s("span", { id:
|
|
204
|
+
return a ? /* @__PURE__ */ p("div", { className: V(o.label, y === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
|
|
205
|
+
/* @__PURE__ */ s("span", { id: x, children: ae }),
|
|
206
206
|
Y
|
|
207
207
|
] }) : Y;
|
|
208
208
|
};
|