@solibo/solibo-ui 1.1.3 → 1.1.5
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/index10.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index51.css +1 -1
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.cjs.map +1 -1
- package/dist/components/button/index.js +40 -32
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.cjs.map +1 -1
- package/dist/components/checkbox/index.js +12 -12
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.cjs.map +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/controls/index.cjs +1 -1
- package/dist/components/controls/index.cjs.map +1 -1
- package/dist/components/controls/index.js +2 -3
- package/dist/components/controls/index.js.map +1 -1
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.cjs.map +1 -1
- package/dist/components/dialog/index.js +13 -13
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +79 -79
- package/dist/components/editor/index.cjs +25 -25
- package/dist/components/editor/index.cjs.map +1 -1
- package/dist/components/editor/index.js +2999 -2995
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/file/index.cjs +1 -1
- package/dist/components/file/index.cjs.map +1 -1
- package/dist/components/file/index.js +6 -6
- package/dist/components/file/index.js.map +1 -1
- 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/list/index.cjs +1 -1
- package/dist/components/list/index.js +37 -37
- package/dist/components/loading/index.cjs +1 -1
- package/dist/components/loading/index.cjs.map +1 -1
- package/dist/components/loading/index.js +20 -20
- package/dist/components/loading/index.js.map +1 -1
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.cjs.map +1 -1
- package/dist/components/message/index.js +26 -25
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/messages/index.cjs +1 -1
- package/dist/components/messages/index.cjs.map +1 -1
- package/dist/components/messages/index.js +48 -47
- package/dist/components/messages/index.js.map +1 -1
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.js +1 -1
- package/dist/components/portal/index.cjs +1 -1
- package/dist/components/portal/index.js +10 -10
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.cjs.map +1 -1
- package/dist/components/toggle/index.js +6 -6
- package/dist/components/toggle/index.js.map +1 -1
- package/dist/components/toolbar/index.cjs +1 -1
- package/dist/components/toolbar/index.js +5 -5
- package/dist/{icons-DKV6nOkW.js → icons-BpYV3Qdj.js} +7 -1
- package/dist/{icons-DKV6nOkW.js.map → icons-BpYV3Qdj.js.map} +1 -1
- package/dist/{icons-DLOPU0OZ.cjs → icons-DTP9D75O.cjs} +2 -2
- package/dist/{icons-DLOPU0OZ.cjs.map → icons-DTP9D75O.cjs.map} +1 -1
- package/dist/{index-Ce06AE41.js → index-C9_dM53L.js} +2 -2
- package/dist/{index-Ce06AE41.js.map → index-C9_dM53L.js.map} +1 -1
- package/dist/{index-CProY0qU.cjs → index-CfdjkXVw.cjs} +2 -2
- package/dist/{index-CProY0qU.cjs.map → index-CfdjkXVw.cjs.map} +1 -1
- package/dist/{index-Bwq0cPOt.cjs → index-Dk9p49nt.cjs} +2 -2
- package/dist/{index-Bwq0cPOt.cjs.map → index-Dk9p49nt.cjs.map} +1 -1
- package/dist/{index-B-cKCIKU.js → index-ky7bIz5x.js} +2 -2
- package/dist/{index-B-cKCIKU.js.map → index-ky7bIz5x.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +29 -7
- package/dist/index.js +2 -2
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as p, Fragment as me, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { t as y } from "../../classix-DG18itHa.js";
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
import { i as
|
|
6
|
-
import { f as
|
|
3
|
+
import _e, { Children as he, isValidElement as x, useRef as V, useId as ge, useState as M, useEffect as W } from "react";
|
|
4
|
+
import { Button as G } from "../button/index.js";
|
|
5
|
+
import { i as be } from "../../icons-BpYV3Qdj.js";
|
|
6
|
+
import { f as ve, I as ye } from "../../index-C9_dM53L.js";
|
|
7
7
|
import { List as xe } from "../list/index.js";
|
|
8
|
-
import { S as we, s as
|
|
9
|
-
import '../../assets/index37.css';function
|
|
10
|
-
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(
|
|
8
|
+
import { S as we, s as je, r as ee } from "../../index-ky7bIz5x.js";
|
|
9
|
+
import '../../assets/index37.css';function I(t) {
|
|
10
|
+
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(I).join(" ") : x(t) ? I(t.props.children) : "";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function ze(t) {
|
|
13
13
|
return x(t) && t.type === "option";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Ne(t) {
|
|
16
16
|
return x(t) && t.type === "optgroup";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return x(t) && t.type ===
|
|
18
|
+
function Se(t) {
|
|
19
|
+
return x(t) && t.type === _e.Fragment;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ce(t) {
|
|
22
22
|
return x(t) && t.type === we;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Q(t, s, r = !1) {
|
|
25
25
|
const l = [];
|
|
26
|
-
return
|
|
27
|
-
if (
|
|
28
|
-
l.push(...
|
|
29
|
-
else if (
|
|
30
|
-
const a =
|
|
26
|
+
return he.forEach(t, (n) => {
|
|
27
|
+
if (Se(n))
|
|
28
|
+
l.push(...Q(n.props.children, s, r));
|
|
29
|
+
else if (ze(n)) {
|
|
30
|
+
const a = I(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: s,
|
|
@@ -38,28 +38,28 @@ function z(t, s, r = !1) {
|
|
|
38
38
|
text: a,
|
|
39
39
|
value: f
|
|
40
40
|
});
|
|
41
|
-
} else
|
|
41
|
+
} else Ne(n) && l.push(...Q(n.props.children, n.props.label, r || !!n.props.disabled));
|
|
42
42
|
}), l;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ee(t) {
|
|
45
45
|
const s = t.trim();
|
|
46
46
|
if (!s) return null;
|
|
47
47
|
const l = [.../[*?]/.test(s) ? s : `*${s}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
|
|
48
48
|
return new RegExp(`^${l}$`, "i");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const r =
|
|
50
|
+
function Ve(t, s) {
|
|
51
|
+
const r = Ee(s), 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 Ie(t, s) {
|
|
55
55
|
return t.find((r) => r.value === s) ?? t.find((r) => r.isPlaceholder) ?? t[0];
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Le(t, s, r) {
|
|
58
58
|
var l, n;
|
|
59
59
|
return s != null ? String(s) : 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 $e(t) {
|
|
62
|
+
if (Ce(t)) {
|
|
63
63
|
const {
|
|
64
64
|
children: s,
|
|
65
65
|
placeholder: r,
|
|
@@ -78,29 +78,29 @@ function De(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:
|
|
89
|
-
native:
|
|
90
|
-
option:
|
|
91
|
-
options:
|
|
92
|
-
panel:
|
|
81
|
+
const Be = "_combobox_149jz_3", De = "_dropdown_149jz_27", Pe = "_empty_149jz_32", ke = "_group_149jz_33", Re = "_placeholder_149jz_34", Fe = "_filter_149jz_42", Me = "_native_149jz_53", We = "_option_149jz_63", Ge = "_options_149jz_84", Qe = "_panel_149jz_108", Ae = "_selected_149jz_133", Ke = "_text_149jz_137", Oe = "_trigger_149jz_145", Te = "_minimal_149jz_182", qe = "_inline_149jz_241", He = "_label_149jz_273", o = {
|
|
82
|
+
combobox: Be,
|
|
83
|
+
"combobox-input": "_combobox-input_149jz_12",
|
|
84
|
+
dropdown: De,
|
|
85
|
+
empty: Pe,
|
|
86
|
+
group: ke,
|
|
87
|
+
placeholder: Re,
|
|
88
|
+
filter: Fe,
|
|
89
|
+
native: Me,
|
|
90
|
+
option: We,
|
|
91
|
+
options: Ge,
|
|
92
|
+
panel: Qe,
|
|
93
93
|
selected: Ae,
|
|
94
94
|
text: Ke,
|
|
95
95
|
trigger: Oe,
|
|
96
96
|
minimal: Te,
|
|
97
97
|
inline: qe,
|
|
98
98
|
label: He,
|
|
99
|
-
"inline-field": "_inline-
|
|
99
|
+
"inline-field": "_inline-field_149jz_279"
|
|
100
100
|
};
|
|
101
101
|
function te(t, s) {
|
|
102
102
|
return {
|
|
103
|
-
"--icon-svg":
|
|
103
|
+
"--icon-svg": be(t, s)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const rt = ({
|
|
@@ -111,101 +111,101 @@ const rt = ({
|
|
|
111
111
|
emptyLabel: n = "No matches found",
|
|
112
112
|
label: a,
|
|
113
113
|
renderOption: f,
|
|
114
|
-
searchPlaceholder:
|
|
114
|
+
searchPlaceholder: L = "Filter",
|
|
115
115
|
selectedItems: ne,
|
|
116
|
-
variant:
|
|
116
|
+
variant: g = "default",
|
|
117
117
|
...re
|
|
118
118
|
}) => {
|
|
119
|
-
const
|
|
119
|
+
const $ = $e(t), {
|
|
120
120
|
defaultValue: le,
|
|
121
|
-
onChange:
|
|
122
|
-
value:
|
|
121
|
+
onChange: B,
|
|
122
|
+
value: D,
|
|
123
123
|
...oe
|
|
124
|
-
} =
|
|
124
|
+
} = $.props, w = je(oe), {
|
|
125
125
|
className: se,
|
|
126
126
|
...ie
|
|
127
|
-
} = w, A =
|
|
127
|
+
} = w, A = V(null), K = V(null), j = ge(), O = V(null), m = V(null), b = Q($.children), v = D != null, P = Le(b, D, le), [k, R] = M(() => P), [c, d] = M(!1), [z, N] = M(""), S = v ? String(D) : k, T = {
|
|
128
128
|
default: ee("--colors-semantic-content-secondary"),
|
|
129
129
|
white: ee("--color-white", "white")
|
|
130
|
-
}, q =
|
|
130
|
+
}, q = g === "minimal" ? T.white : T.default, C = Ie(b, S), ae = te("CaretDown", q), ce = te("MagnifyingGlass", q), H = Ve(b, z), _ = z.trim(), E = !!(r && l && _ && l.isValid(_)), ue = a && g === "inline" ? ve(a) : a, J = (e) => e ? (f == null ? void 0 : f({
|
|
131
131
|
groupLabel: e.groupLabel,
|
|
132
|
-
isSelected: e.value ===
|
|
132
|
+
isSelected: e.value === S,
|
|
133
133
|
label: e.label,
|
|
134
134
|
text: e.text,
|
|
135
135
|
value: e.value
|
|
136
136
|
})) ?? e.label : "Select an option";
|
|
137
|
-
|
|
138
|
-
!
|
|
139
|
-
}, [
|
|
137
|
+
W(() => {
|
|
138
|
+
!v && !b.some((e) => e.value === k) && R(P);
|
|
139
|
+
}, [P, k, v, b]), W(() => {
|
|
140
140
|
var e;
|
|
141
141
|
if (!c) {
|
|
142
|
-
|
|
142
|
+
N("");
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
(e = m.current) == null || e.focus();
|
|
146
|
-
}, [c]),
|
|
146
|
+
}, [c]), W(() => {
|
|
147
147
|
if (!c)
|
|
148
148
|
return;
|
|
149
149
|
const e = (u) => {
|
|
150
|
-
var
|
|
151
|
-
(
|
|
150
|
+
var h;
|
|
151
|
+
(h = K.current) != null && h.contains(u.target) || d(!1);
|
|
152
152
|
};
|
|
153
153
|
return document.addEventListener("mousedown", e), () => {
|
|
154
154
|
document.removeEventListener("mousedown", e);
|
|
155
155
|
};
|
|
156
156
|
}, [c]);
|
|
157
157
|
const de = (e) => {
|
|
158
|
-
|
|
159
|
-
},
|
|
158
|
+
v || R(e.target.value), B == null || B(e);
|
|
159
|
+
}, F = () => {
|
|
160
160
|
var e;
|
|
161
161
|
d(!1), r || (e = A.current) == null || e.focus();
|
|
162
162
|
}, U = () => {
|
|
163
163
|
var e;
|
|
164
|
-
|
|
164
|
+
N(""), d(!0), (e = m.current) == null || e.focus();
|
|
165
165
|
}, X = () => {
|
|
166
|
-
!l || !
|
|
166
|
+
!l || !E || (l.onCreate(_), U());
|
|
167
167
|
}, pe = (e) => {
|
|
168
168
|
var Z;
|
|
169
|
-
|
|
169
|
+
v || R(e);
|
|
170
170
|
const u = O.current;
|
|
171
171
|
if (!u) {
|
|
172
|
-
|
|
172
|
+
F();
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
|
|
175
|
+
const h = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
|
|
176
|
+
h == null || h.call(u, e), u.dispatchEvent(new Event("change", {
|
|
177
177
|
bubbles: !0
|
|
178
|
-
})), r ? U() :
|
|
178
|
+
})), r ? U() : F();
|
|
179
179
|
}, fe = (e) => {
|
|
180
|
-
e.key === "Escape" &&
|
|
181
|
-
}, Y = /* @__PURE__ */ p("div", { className: y(o.dropdown,
|
|
182
|
-
/* @__PURE__ */ i("select", { ...ie, "aria-hidden": "true", className: y(o.native, se), onChange: de, ref: O, tabIndex: -1, value:
|
|
180
|
+
e.key === "Escape" && F(), e.key === "Enter" && e.target === m.current && E && (e.preventDefault(), X());
|
|
181
|
+
}, Y = /* @__PURE__ */ p("div", { className: y(o.dropdown, g === "inline" && o.inline, g === "minimal" && o.minimal, s), onKeyDown: fe, ref: K, ...re, children: [
|
|
182
|
+
/* @__PURE__ */ i("select", { ...ie, "aria-hidden": "true", className: y(o.native, se), onChange: de, ref: O, tabIndex: -1, value: S, children: $.children }),
|
|
183
183
|
r ? /* @__PURE__ */ p("div", { className: o.combobox, onClick: () => {
|
|
184
184
|
var e;
|
|
185
185
|
return (e = m.current) == null ? void 0 : e.focus();
|
|
186
186
|
}, children: [
|
|
187
187
|
ne,
|
|
188
|
-
/* @__PURE__ */ i("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": w["aria-label"] ?? a ??
|
|
189
|
-
|
|
190
|
-
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder:
|
|
191
|
-
] }) : /* @__PURE__ */ i(
|
|
188
|
+
/* @__PURE__ */ i("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": w["aria-label"] ?? a ?? L, className: o["combobox-input"], disabled: w.disabled, onChange: (e) => {
|
|
189
|
+
N(e.target.value), d(!0);
|
|
190
|
+
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder: L || void 0, ref: m, role: "combobox", type: "text", value: z })
|
|
191
|
+
] }) : /* @__PURE__ */ i(G, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${j} ${j}-value` : void 0, className: y(o.trigger, (C == null ? void 0 : C.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: w.disabled, onClick: () => d((e) => !e), ref: A, style: ae, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, id: `${j}-value`, children: J(C) }) }),
|
|
192
192
|
c && /* @__PURE__ */ p("div", { className: o.panel, children: [
|
|
193
|
-
!r && /* @__PURE__ */ i(ye, { "aria-label": "Filter", className: o.filter, icon: "MagnifyingGlass", onChange: (e) =>
|
|
193
|
+
!r && /* @__PURE__ */ i(ye, { "aria-label": "Filter", className: o.filter, icon: "MagnifyingGlass", onChange: (e) => N(e.target.value), placeholder: L, ref: m, style: ce, type: "search", value: z }),
|
|
194
194
|
/* @__PURE__ */ p(xe, { "aria-label": "Dropdown", className: o.options, children: [
|
|
195
195
|
H.map((e) => {
|
|
196
|
-
const u = e.value ===
|
|
197
|
-
return /* @__PURE__ */ i("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(
|
|
196
|
+
const u = e.value === S;
|
|
197
|
+
return /* @__PURE__ */ i("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(G, { "aria-label": u ? `${e.text}, selected` : e.text, className: y(o.option, u && o.selected), disabled: e.disabled, onClick: () => pe(e.value), variant: "tertiary", children: [
|
|
198
198
|
/* @__PURE__ */ i("span", { className: o.text, children: J(e) }),
|
|
199
199
|
e.groupLabel && /* @__PURE__ */ i("small", { className: o.group, children: e.groupLabel })
|
|
200
200
|
] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
|
|
201
201
|
}),
|
|
202
|
-
|
|
203
|
-
H.length === 0 && !
|
|
202
|
+
E && l && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(G, { "aria-label": I(l.render(_)) || _, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, children: l.render(_) }) }) }),
|
|
203
|
+
H.length === 0 && !E && /* @__PURE__ */ i("li", { className: o.empty, children: n })
|
|
204
204
|
] })
|
|
205
205
|
] })
|
|
206
206
|
] });
|
|
207
|
-
return a ? /* @__PURE__ */ p("div", { className: y(o.label,
|
|
208
|
-
/* @__PURE__ */ i("span", { id:
|
|
207
|
+
return a ? /* @__PURE__ */ p("div", { className: y(o.label, g === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
|
|
208
|
+
/* @__PURE__ */ i("span", { id: j, children: ue }),
|
|
209
209
|
Y
|
|
210
210
|
] }) : Y;
|
|
211
211
|
};
|