@solibo/solibo-ui 1.0.11 → 1.0.13
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.cjs.map +1 -1
- package/dist/components/chip/index.js +21 -14
- 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 +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 +70 -58
- 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 +79 -80
- 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-Bq3diTRm.js} +11 -2
- package/dist/icons-Bq3diTRm.js.map +1 -0
- package/dist/icons-ovA21Oao.cjs +2 -0
- package/dist/icons-ovA21Oao.cjs.map +1 -0
- package/dist/index-BcY9DZZ8.cjs +2 -0
- package/dist/{index-CEzqxRIu.cjs.map → index-BcY9DZZ8.cjs.map} +1 -1
- package/dist/{index-BPIK2dxs.cjs → index-CjI8oRpS.cjs} +2 -2
- package/dist/{index-BPIK2dxs.cjs.map → index-CjI8oRpS.cjs.map} +1 -1
- package/dist/index-ClZkChEh.js +73 -0
- package/dist/{index-BHgGZxsR.js.map → index-ClZkChEh.js.map} +1 -1
- package/dist/{index-C_YiNpZP.js → index-DwzLUapm.js} +2 -2
- package/dist/{index-C_YiNpZP.js.map → index-DwzLUapm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +46 -16
- 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,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),E=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),ce=require("../../icons-ovA21Oao.cjs"),X=require("../../index-BcY9DZZ8.cjs"),ue=require("../list/index.cjs"),N=require("../../index-CjI8oRpS.cjs");function V(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(V).join(" "):a.isValidElement(t)?V(t.props.children):""}function de(t){return a.isValidElement(t)&&t.type==="option"}function pe(t){return a.isValidElement(t)&&t.type==="optgroup"}function fe(t){return a.isValidElement(t)&&t.type===a.Fragment}function me(t){return a.isValidElement(t)&&t.type===N.Select}function W(t,i,r=!1){const l=[];return a.Children.forEach(t,n=>{if(fe(n))l.push(...W(n.props.children,i,r));else if(de(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;l.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else pe(n)&&l.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),l}function be(t){const i=t.trim();if(!i)return null;const l=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${l}$`,"i")}function _e(t,i){const r=be(i),l=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?l.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):l}function he(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function ye(t,i,r){var l,n;return i!=null?String(i):r!=null?String(r):((l=t.find(c=>c.selected))==null?void 0:l.value)??((n=t[0])==null?void 0:n.value)??""}function xe(t){if(me(t)){const{children:i,placeholder:r,...l}=t.props;return{children:s.jsxs(s.Fragment,{children:[r&&s.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:l}}return{children:t.props.children,props:t.props}}const ge="_combobox_1bqyf_3",ve="_dropdown_1bqyf_27",je="_empty_1bqyf_30",qe="_group_1bqyf_31",we="_placeholder_1bqyf_32",Se="_filter_1bqyf_40",Ce="_native_1bqyf_52",Ee="_option_1bqyf_62",Ne="_options_1bqyf_84",Ve="_panel_1bqyf_108",Le="_selected_1bqyf_132",Re="_text_1bqyf_136",$e="_trigger_1bqyf_144",Be="_minimal_1bqyf_180",Ie="_inline_1bqyf_235",De="_label_1bqyf_267",o={combobox:ge,"combobox-input":"_combobox-input_1bqyf_12",dropdown:ve,empty:je,group:qe,placeholder:we,filter:Se,native:Ce,option:Ee,options:Ne,panel:Ve,selected:Le,text:Re,trigger:$e,minimal:Be,inline:Ie,label:De,"inline-field":"_inline-field_1bqyf_273"};function Y(t,i){return{"--icon-svg":ce.iconSVG(t).replace("currentColor",i)}}const Pe=({children:t,className:i,combobox:r=!1,createOption:l,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:h="default",...ee})=>{const R=xe(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,g=N.sanitizeSelectProps(ne),M=a.useRef(null),Q=a.useRef(null),v=a.useId(),z=a.useRef(null),m=a.useRef(null),y=W(R.children),x=B!=null,I=ye(y,B,te),[D,P]=a.useState(()=>I),[u,p]=a.useState(!1),[j,q]=a.useState(""),w=x?String(B):D,O={default:N.resolveColor("--colors-semantic-content-secondary"),white:N.resolveColor("--color-white","white")},T=h==="minimal"?O.white:O.default,S=he(y,w),re=Y("chevron",T),le=Y("search",T),A=_e(y,j),b=j.trim(),C=!!(r&&l&&b&&l.isValid(b)),se=c&&h==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===w,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!x&&!y.some(e=>e.value===D)&&P(I)},[I,D,x,y]),a.useEffect(()=>{var e;if(!u){q("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var _;(_=Q.current)!=null&&_.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const oe=e=>{x||P(e.target.value),$==null||$(e)},k=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;q(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!l||!C||(l.onCreate(b),K())},ie=e=>{var U;x||P(e);const d=z.current;if(!d){k();return}const _=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;_==null||_.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():k()},ae=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=s.jsxs("div",{className:E.t(o.dropdown,h==="inline"&&o.inline,h==="minimal"&&o.minimal,i),onKeyDown:ae,ref:Q,...ee,children:[s.jsx("select",{...g,"aria-hidden":"true",className:o.native,onChange:oe,ref:z,tabIndex:-1,value:w,children:R.children}),r?s.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,s.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":g["aria-label"]??c??L,className:o["combobox-input"],disabled:g.disabled,onChange:e=>{q(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:j})]}):s.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${v} ${v}-value`:void 0,className:E.t(o.trigger,(S==null?void 0:S.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:g.disabled,onClick:()=>p(e=>!e),ref:M,style:re,variant:"tertiary",children:s.jsx("span",{className:o.text,id:`${v}-value`,children:G(S)})}),u&&s.jsxs("div",{className:o.panel,children:[!r&&s.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>q(e.target.value),placeholder:L,ref:m,style:le,type:"search",value:j}),s.jsxs(ue.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===w;return s.jsx("li",{"data-component":"dropdown",children:s.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:E.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ie(e.value),variant:"tertiary",children:[s.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&s.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&l&&s.jsx("li",{children:s.jsx(F.Button,{"aria-label":V(l.render(b))||b,className:o.option,onClick:H,variant:"tertiary",children:s.jsx("span",{className:o.text,children:l.render(b)})})}),A.length===0&&!C&&s.jsx("li",{className:o.empty,children:n})]})]})]});return c?s.jsxs("div",{className:E.t(o.label,h==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[s.jsx("span",{id:v,children:se}),J]}):J};exports.Dropdown=Pe;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -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-Bq3diTRm.js";
|
|
6
|
+
import { f as _e, I as ye } from "../../index-ClZkChEh.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-DwzLUapm.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
|
};
|