@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.
Files changed (86) hide show
  1. package/dist/assets/index10.css +1 -1
  2. package/dist/assets/index15.css +1 -1
  3. package/dist/assets/index29.css +1 -1
  4. package/dist/assets/index31.css +1 -1
  5. package/dist/assets/index37.css +1 -1
  6. package/dist/assets/index39.css +1 -1
  7. package/dist/assets/index47.css +1 -1
  8. package/dist/assets/index48.css +1 -1
  9. package/dist/assets/index51.css +1 -1
  10. package/dist/components/button/index.cjs +1 -1
  11. package/dist/components/button/index.cjs.map +1 -1
  12. package/dist/components/button/index.js +40 -32
  13. package/dist/components/button/index.js.map +1 -1
  14. package/dist/components/checkbox/index.cjs +1 -1
  15. package/dist/components/checkbox/index.cjs.map +1 -1
  16. package/dist/components/checkbox/index.js +12 -12
  17. package/dist/components/checkbox/index.js.map +1 -1
  18. package/dist/components/chip/index.cjs.map +1 -1
  19. package/dist/components/chip/index.js.map +1 -1
  20. package/dist/components/controls/index.cjs +1 -1
  21. package/dist/components/controls/index.cjs.map +1 -1
  22. package/dist/components/controls/index.js +2 -3
  23. package/dist/components/controls/index.js.map +1 -1
  24. package/dist/components/dialog/index.cjs +1 -1
  25. package/dist/components/dialog/index.cjs.map +1 -1
  26. package/dist/components/dialog/index.js +13 -13
  27. package/dist/components/dialog/index.js.map +1 -1
  28. package/dist/components/dropdown/index.cjs +1 -1
  29. package/dist/components/dropdown/index.js +79 -79
  30. package/dist/components/editor/index.cjs +25 -25
  31. package/dist/components/editor/index.cjs.map +1 -1
  32. package/dist/components/editor/index.js +2999 -2995
  33. package/dist/components/editor/index.js.map +1 -1
  34. package/dist/components/file/index.cjs +1 -1
  35. package/dist/components/file/index.cjs.map +1 -1
  36. package/dist/components/file/index.js +6 -6
  37. package/dist/components/file/index.js.map +1 -1
  38. package/dist/components/icon/index.cjs +1 -1
  39. package/dist/components/icon/index.js +1 -1
  40. package/dist/components/input/index.cjs +1 -1
  41. package/dist/components/input/index.js +2 -2
  42. package/dist/components/list/index.cjs +1 -1
  43. package/dist/components/list/index.js +37 -37
  44. package/dist/components/loading/index.cjs +1 -1
  45. package/dist/components/loading/index.cjs.map +1 -1
  46. package/dist/components/loading/index.js +20 -20
  47. package/dist/components/loading/index.js.map +1 -1
  48. package/dist/components/message/index.cjs +1 -1
  49. package/dist/components/message/index.cjs.map +1 -1
  50. package/dist/components/message/index.js +26 -25
  51. package/dist/components/message/index.js.map +1 -1
  52. package/dist/components/messages/index.cjs +1 -1
  53. package/dist/components/messages/index.cjs.map +1 -1
  54. package/dist/components/messages/index.js +48 -47
  55. package/dist/components/messages/index.js.map +1 -1
  56. package/dist/components/nav/index.cjs +1 -1
  57. package/dist/components/nav/index.js +1 -1
  58. package/dist/components/portal/index.cjs +1 -1
  59. package/dist/components/portal/index.js +10 -10
  60. package/dist/components/search/index.cjs +1 -1
  61. package/dist/components/search/index.js +1 -1
  62. package/dist/components/select/index.cjs +1 -1
  63. package/dist/components/select/index.js +2 -2
  64. package/dist/components/toggle/index.cjs +1 -1
  65. package/dist/components/toggle/index.cjs.map +1 -1
  66. package/dist/components/toggle/index.js +6 -6
  67. package/dist/components/toggle/index.js.map +1 -1
  68. package/dist/components/toolbar/index.cjs +1 -1
  69. package/dist/components/toolbar/index.js +5 -5
  70. package/dist/{icons-DKV6nOkW.js → icons-BpYV3Qdj.js} +7 -1
  71. package/dist/{icons-DKV6nOkW.js.map → icons-BpYV3Qdj.js.map} +1 -1
  72. package/dist/{icons-DLOPU0OZ.cjs → icons-DTP9D75O.cjs} +2 -2
  73. package/dist/{icons-DLOPU0OZ.cjs.map → icons-DTP9D75O.cjs.map} +1 -1
  74. package/dist/{index-Ce06AE41.js → index-C9_dM53L.js} +2 -2
  75. package/dist/{index-Ce06AE41.js.map → index-C9_dM53L.js.map} +1 -1
  76. package/dist/{index-CProY0qU.cjs → index-CfdjkXVw.cjs} +2 -2
  77. package/dist/{index-CProY0qU.cjs.map → index-CfdjkXVw.cjs.map} +1 -1
  78. package/dist/{index-Bwq0cPOt.cjs → index-Dk9p49nt.cjs} +2 -2
  79. package/dist/{index-Bwq0cPOt.cjs.map → index-Dk9p49nt.cjs.map} +1 -1
  80. package/dist/{index-B-cKCIKU.js → index-ky7bIz5x.js} +2 -2
  81. package/dist/{index-B-cKCIKU.js.map → index-ky7bIz5x.js.map} +1 -1
  82. package/dist/index.cjs +1 -1
  83. package/dist/index.d.ts +29 -7
  84. package/dist/index.js +2 -2
  85. package/dist/tokens.json +1 -1
  86. 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 ve, { Children as ge, isValidElement as x, useRef as L, useId as _e, useState as W, useEffect as G } from "react";
4
- import { Button as Q } from "../button/index.js";
5
- import { i as he } from "../../icons-DKV6nOkW.js";
6
- import { f as be, I as ye } from "../../index-Ce06AE41.js";
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 Ne, r as ee } from "../../index-B-cKCIKU.js";
9
- import '../../assets/index37.css';function $(t) {
10
- return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map($).join(" ") : x(t) ? $(t.props.children) : "";
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 Se(t) {
12
+ function ze(t) {
13
13
  return x(t) && t.type === "option";
14
14
  }
15
- function Ce(t) {
15
+ function Ne(t) {
16
16
  return x(t) && t.type === "optgroup";
17
17
  }
18
- function Ee(t) {
19
- return x(t) && t.type === ve.Fragment;
18
+ function Se(t) {
19
+ return x(t) && t.type === _e.Fragment;
20
20
  }
21
- function Ve(t) {
21
+ function Ce(t) {
22
22
  return x(t) && t.type === we;
23
23
  }
24
- function z(t, s, r = !1) {
24
+ function Q(t, s, r = !1) {
25
25
  const l = [];
26
- return ge.forEach(t, (n) => {
27
- if (Ee(n))
28
- l.push(...z(n.props.children, s, r));
29
- else if (Se(n)) {
30
- const a = $(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : 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 Ce(n) && l.push(...z(n.props.children, n.props.label, r || !!n.props.disabled));
41
+ } else Ne(n) && l.push(...Q(n.props.children, n.props.label, r || !!n.props.disabled));
42
42
  }), l;
43
43
  }
44
- function Ie(t) {
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 Le(t, s) {
51
- const r = Ie(s), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
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 $e(t, s) {
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 Be(t, s, r) {
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 De(t) {
62
- if (Ve(t)) {
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 Pe = "_combobox_vg3rv_3", ke = "_dropdown_vg3rv_27", Re = "_empty_vg3rv_32", je = "_group_vg3rv_33", Fe = "_placeholder_vg3rv_34", Me = "_filter_vg3rv_42", We = "_native_vg3rv_53", Ge = "_option_vg3rv_63", Qe = "_options_vg3rv_85", ze = "_panel_vg3rv_109", Ae = "_selected_vg3rv_134", Ke = "_text_vg3rv_138", Oe = "_trigger_vg3rv_146", Te = "_minimal_vg3rv_183", qe = "_inline_vg3rv_238", He = "_label_vg3rv_270", o = {
82
- combobox: Pe,
83
- "combobox-input": "_combobox-input_vg3rv_12",
84
- dropdown: ke,
85
- empty: Re,
86
- group: je,
87
- placeholder: Fe,
88
- filter: Me,
89
- native: We,
90
- option: Ge,
91
- options: Qe,
92
- panel: ze,
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-field_vg3rv_276"
99
+ "inline-field": "_inline-field_149jz_279"
100
100
  };
101
101
  function te(t, s) {
102
102
  return {
103
- "--icon-svg": he(t, s)
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: B = "Filter",
114
+ searchPlaceholder: L = "Filter",
115
115
  selectedItems: ne,
116
- variant: _ = "default",
116
+ variant: g = "default",
117
117
  ...re
118
118
  }) => {
119
- const D = De(t), {
119
+ const $ = $e(t), {
120
120
  defaultValue: le,
121
- onChange: P,
122
- value: k,
121
+ onChange: B,
122
+ value: D,
123
123
  ...oe
124
- } = D.props, w = Ne(oe), {
124
+ } = $.props, w = je(oe), {
125
125
  className: se,
126
126
  ...ie
127
- } = w, A = L(null), K = L(null), N = _e(), O = L(null), m = L(null), h = z(D.children), b = k != null, R = Be(h, k, le), [j, F] = W(() => R), [c, d] = W(!1), [S, C] = W(""), E = b ? String(k) : j, T = {
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 = _ === "minimal" ? T.white : T.default, V = $e(h, E), ae = te("CaretDown", q), ce = te("MagnifyingGlass", q), H = Le(h, S), v = S.trim(), I = !!(r && l && v && l.isValid(v)), ue = a && _ === "inline" ? be(a) : a, J = (e) => e ? (f == null ? void 0 : f({
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 === E,
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
- G(() => {
138
- !b && !h.some((e) => e.value === j) && F(R);
139
- }, [R, j, b, h]), G(() => {
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
- C("");
142
+ N("");
143
143
  return;
144
144
  }
145
145
  (e = m.current) == null || e.focus();
146
- }, [c]), G(() => {
146
+ }, [c]), W(() => {
147
147
  if (!c)
148
148
  return;
149
149
  const e = (u) => {
150
- var g;
151
- (g = K.current) != null && g.contains(u.target) || d(!1);
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
- b || F(e.target.value), P == null || P(e);
159
- }, M = () => {
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
- C(""), d(!0), (e = m.current) == null || e.focus();
164
+ N(""), d(!0), (e = m.current) == null || e.focus();
165
165
  }, X = () => {
166
- !l || !I || (l.onCreate(v), U());
166
+ !l || !E || (l.onCreate(_), U());
167
167
  }, pe = (e) => {
168
168
  var Z;
169
- b || F(e);
169
+ v || R(e);
170
170
  const u = O.current;
171
171
  if (!u) {
172
- M();
172
+ F();
173
173
  return;
174
174
  }
175
- const g = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
176
- g == null || g.call(u, e), u.dispatchEvent(new Event("change", {
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() : M();
178
+ })), r ? U() : F();
179
179
  }, fe = (e) => {
180
- e.key === "Escape" && M(), e.key === "Enter" && e.target === m.current && I && (e.preventDefault(), X());
181
- }, Y = /* @__PURE__ */ p("div", { className: y(o.dropdown, _ === "inline" && o.inline, _ === "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: E, children: D.children }),
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 ?? B, className: o["combobox-input"], disabled: w.disabled, onChange: (e) => {
189
- C(e.target.value), d(!0);
190
- }, onClick: () => d(!0), onFocus: () => d(!0), placeholder: B || void 0, ref: m, role: "combobox", type: "text", value: S })
191
- ] }) : /* @__PURE__ */ i(Q, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${N} ${N}-value` : void 0, className: y(o.trigger, (V == null ? void 0 : V.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: `${N}-value`, children: J(V) }) }),
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) => C(e.target.value), placeholder: B, ref: m, style: ce, type: "search", value: S }),
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 === E;
197
- return /* @__PURE__ */ i("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(Q, { "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: [
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
- I && l && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(Q, { "aria-label": $(l.render(v)) || v, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, children: l.render(v) }) }) }),
203
- H.length === 0 && !I && /* @__PURE__ */ i("li", { className: o.empty, children: n })
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, _ === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
208
- /* @__PURE__ */ i("span", { id: N, children: ue }),
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
  };