@dotss/ui 1.2.1 → 1.2.2
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/Select/Select.cjs +10 -10
- package/Select/Select.es.js +124 -121
- package/package.json +1 -1
package/Select/Select.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@emotion/react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@emotion/react/jsx-runtime"),r=require("react"),P=require("../Backdrop/Backdrop.cjs"),T=require("../Box/Box.cjs"),K=require("../Flexbox/Flexbox.cjs"),U=require("../Icon/Icon.cjs"),X=require("@emotion/styled"),E=require("../utils/getSibling/getSibling.cjs"),G=e=>e&&e.__esModule?e:{default:e},S=G(X),J=S.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
color: inherit;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
${({theme:{palette:{grey:e,background:
|
|
15
|
+
${({theme:{palette:{grey:e,background:i}},variant:h})=>{let s={};switch(h){case"outlined":s={border:`1px solid ${e[50]}`,"&[disabled]":{backgroundColor:e[10],border:`1px solid ${e[30]}`,color:e[30],cursor:"not-allowed"}};break;case"filled":s={border:"1px solid transparent",backgroundColor:i.primary,"&[disabled]":{backgroundColor:e[10],color:e[30],cursor:"not-allowed"}};break}return s}}
|
|
16
16
|
|
|
17
|
-
${({theme:{palette:{brand:e}},isFocused:
|
|
17
|
+
${({theme:{palette:{brand:e}},isFocused:i})=>i?{border:`1px solid ${e.primary.line}`}:{}}
|
|
18
18
|
|
|
19
|
-
${({size:e})=>{let
|
|
20
|
-
`,N=
|
|
19
|
+
${({size:e})=>{let i={};switch(e){case"large":i={height:"48px"};break;case"xLarge":i={height:"56px"};break}return i}}
|
|
20
|
+
`,N=S.default.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
width: calc(100% - 24px - 8px);
|
|
23
23
|
gap: ${({theme:e})=>`${e.spacing.content(2)}px`};
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
color: inherit;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
${({theme:{typography:e,palette:{grey:
|
|
29
|
-
`,Q=
|
|
28
|
+
${({theme:{typography:e,palette:{grey:i}},value:h})=>{const s={fontSize:e.b2R.size,fontWeight:e.b2R.size,lineHeight:e.b2R.lineHeight,letterSpacing:e.b2R.letterSpacing,"&[disabled]":{color:i[30]}};return h?{...s,color:i[100]}:{...s,color:i[50]}}}
|
|
29
|
+
`,Q=S.default.div`
|
|
30
30
|
overflow: hidden;
|
|
31
31
|
text-overflow: ellipsis;
|
|
32
32
|
white-space: nowrap;
|
|
33
|
-
`,Y=
|
|
33
|
+
`,Y=S.default.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
align-items: center;
|
|
36
36
|
justify-content: center;
|
|
37
37
|
transform: ${({isFocused:e})=>e?"rotate(180deg)":"rotate(0deg)"};
|
|
38
38
|
transition: transform 200ms linear;
|
|
39
|
-
`,Z=
|
|
39
|
+
`,Z=S.default.ul`
|
|
40
40
|
position: fixed;
|
|
41
41
|
max-height: 476px;
|
|
42
42
|
overflow-y: auto;
|
|
@@ -50,4 +50,4 @@
|
|
|
50
50
|
box-shadow: ${({theme:{elevation:e}})=>e[4]};
|
|
51
51
|
transition: opacity 200ms linear;
|
|
52
52
|
opacity: ${({isFocused:e})=>e?1:0};
|
|
53
|
-
`,ee=
|
|
53
|
+
`,ee=r.forwardRef(function({value:i,onChange:h,open:s,onOpen:C,onClose:k,variant:O="outlined",size:q="large",startAdornment:j,placeholder:W="TEXT",disabled:d=!1,fullWidth:D,children:w,inlineCSS:z,...$},V){const _=r.useId(),g=r.useRef(null),m=r.useRef(null),b=r.useRef(""),[u,f]=r.useState(s||!1),[p,c]=r.useState(""),[v,y]=r.useState({top:0,bottom:0,left:0,width:0}),x=($==null?void 0:$.id)||_,H=()=>{d||(s===void 0?f(t=>!t):s===!1&&C&&typeof C=="function"&&C())},I=t=>()=>{d||(h(t.toString()),R())},R=()=>{d||(s===void 0?(f(!1),c("")):s===!0&&k&&typeof k=="function"&&k())},B=t=>{if(!d){if(t.preventDefault(),t.code==="Escape"&&f(!1),t.code==="Space"||t.code==="Enter")if(b.current?c(b.current):p||c(`${x}-0`),u){if(p){const n=document.querySelector(`#${CSS.escape(p)}`);n&&n.hasAttribute("value")&&(b.current=n==null?void 0:n.id,I(n.value)())}f(!1)}else f(!0);if(t.code==="ArrowDown"||t.code==="ArrowUp"){if(u||f(!0),b.current?c(b.current):c(`${x}-0`),!m.current||!p)return;const n=m.current.querySelector(`#${CSS.escape(p)}`);if(!n)return;if(t.code==="ArrowDown"){const o=E.default(n,"next",{skipDisabled:!0});if(o&&o.id)c(o.id),o.scrollIntoView({block:"end"});else{const l=m.current.firstElementChild;l&&(c(l.id),l.scrollIntoView({block:"start"}))}}if(t.code==="ArrowUp"){const o=E.default(n,"prev",{skipDisabled:!0});if(o&&o.id)c(o.id),o.scrollIntoView({block:"end"});else{const l=m.current.lastElementChild;l&&(c(l.id),l.scrollIntoView({block:"end"}))}}}if(t.code==="Home"&&c(`${x}-0`),t.code==="End"){const n=r.Children.count(w);c(`${x}-${n-1}`)}}},L=t=>{const n=r.Children.map(t,o=>r.isValidElement(o)&&o&&o.props.value===i?o.props.children:null);return n&&n.length?n[0]:""};return r.useEffect(()=>{const t=()=>{if(g.current){const n=g.current.getBoundingClientRect(),o=r.Children.count(w),l=40,A=24,F=l*o>476?476:l*o,M=g.current.getBoundingClientRect().bottom+F+A>window.innerHeight;y(M?{bottom:24,left:n.left,width:g.current.offsetWidth}:{top:n.top+n.height,left:n.left,width:g.current.offsetWidth})}};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[w]),r.useEffect(()=>{s!==void 0&&f(s)},[s]),a.jsxs(T.default,{ref:V,inlineCSS:{position:"relative"},children:[a.jsxs(J,{role:"combobox",ref:g,tabIndex:0,variant:O,size:q,disabled:d,fullWidth:D,isFocused:u,onClick:H,onKeyDown:B,"aria-controls":x,"aria-expanded":u,"aria-haspopup":"listbox","aria-activedescendant":p,"aria-disabled":d,...$,css:z,children:[a.jsxs(N,{value:i==="0"||!!i,disabled:d,children:[j&&a.jsx(K.default,{justifyContent:"center",alignItems:"center",children:j}),a.jsx(Q,{children:L(w)||W})]}),a.jsx(Y,{isFocused:u,children:a.jsx(U.default,{name:"ChevronDownLine",size:"small",color:d?"grey.30":"grey.100"})})]}),a.jsx(P.default,{open:u,onClose:R,inlineCSS:{backgroundColor:"transparent"},children:a.jsx(Z,{id:x,role:"listbox",ref:m,tabIndex:-1,isFocused:u,style:{top:v.top,bottom:v.bottom,left:v.left,width:v.width},children:r.Children.map(w,(t,n)=>{if(!r.isValidElement(t)||!t.props.value)return null;const o=`${x}-${n}`,l=i===t.props.value;return l&&(b.current=o),r.cloneElement(t,{id:o,selected:l,focused:o===p,onClick:I(t.props.value),...t.props})})})})]})});exports.default=ee;
|
package/Select/Select.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as I, jsx as
|
|
2
|
-
import { forwardRef as J, useId as N, useRef as y, useState as
|
|
1
|
+
import { jsxs as I, jsx as g } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as J, useId as N, useRef as y, useState as R, useEffect as z, Children as v, isValidElement as D, cloneElement as Q } from "react";
|
|
3
3
|
import Y from "../Backdrop/Backdrop.es.js";
|
|
4
4
|
import Z from "../Box/Box.es.js";
|
|
5
5
|
import _ from "../Flexbox/Flexbox.es.js";
|
|
6
6
|
import ee from "../Icon/Icon.es.js";
|
|
7
|
-
import
|
|
7
|
+
import w from "@emotion/styled";
|
|
8
8
|
import H from "../utils/getSibling/getSibling.es.js";
|
|
9
|
-
const te =
|
|
9
|
+
const te = w.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
justify-content: space-between;
|
|
12
12
|
align-items: center;
|
|
@@ -22,64 +22,64 @@ const te = h.div`
|
|
|
22
22
|
|
|
23
23
|
${({
|
|
24
24
|
theme: {
|
|
25
|
-
palette: { grey: e, background:
|
|
25
|
+
palette: { grey: e, background: r }
|
|
26
26
|
},
|
|
27
|
-
variant:
|
|
27
|
+
variant: b
|
|
28
28
|
}) => {
|
|
29
|
-
let
|
|
30
|
-
switch (
|
|
29
|
+
let i = {};
|
|
30
|
+
switch (b) {
|
|
31
31
|
case "outlined":
|
|
32
|
-
|
|
32
|
+
i = {
|
|
33
33
|
border: `1px solid ${e[50]}`,
|
|
34
34
|
"&[disabled]": {
|
|
35
35
|
backgroundColor: e[10],
|
|
36
36
|
border: `1px solid ${e[30]}`,
|
|
37
37
|
color: e[30],
|
|
38
|
-
|
|
38
|
+
cursor: "not-allowed"
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
break;
|
|
42
42
|
case "filled":
|
|
43
|
-
|
|
43
|
+
i = {
|
|
44
44
|
border: "1px solid transparent",
|
|
45
|
-
backgroundColor:
|
|
45
|
+
backgroundColor: r.primary,
|
|
46
46
|
"&[disabled]": {
|
|
47
47
|
backgroundColor: e[10],
|
|
48
48
|
color: e[30],
|
|
49
|
-
|
|
49
|
+
cursor: "not-allowed"
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return i;
|
|
55
55
|
}}
|
|
56
56
|
|
|
57
57
|
${({
|
|
58
58
|
theme: {
|
|
59
59
|
palette: { brand: e }
|
|
60
60
|
},
|
|
61
|
-
isFocused:
|
|
62
|
-
}) =>
|
|
61
|
+
isFocused: r
|
|
62
|
+
}) => r ? {
|
|
63
63
|
border: `1px solid ${e.primary.line}`
|
|
64
64
|
} : {}}
|
|
65
65
|
|
|
66
66
|
${({ size: e }) => {
|
|
67
|
-
let
|
|
67
|
+
let r = {};
|
|
68
68
|
switch (e) {
|
|
69
69
|
case "large":
|
|
70
|
-
|
|
70
|
+
r = {
|
|
71
71
|
height: "48px"
|
|
72
72
|
};
|
|
73
73
|
break;
|
|
74
74
|
case "xLarge":
|
|
75
|
-
|
|
75
|
+
r = {
|
|
76
76
|
height: "56px"
|
|
77
77
|
};
|
|
78
78
|
break;
|
|
79
79
|
}
|
|
80
|
-
return
|
|
80
|
+
return r;
|
|
81
81
|
}}
|
|
82
|
-
`,
|
|
82
|
+
`, oe = w.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
width: calc(100% - 24px - 8px);
|
|
85
85
|
gap: ${({ theme: e }) => `${e.spacing.content(2)}px`};
|
|
@@ -90,38 +90,38 @@ const te = h.div`
|
|
|
90
90
|
${({
|
|
91
91
|
theme: {
|
|
92
92
|
typography: e,
|
|
93
|
-
palette: { grey:
|
|
93
|
+
palette: { grey: r }
|
|
94
94
|
},
|
|
95
|
-
value:
|
|
95
|
+
value: b
|
|
96
96
|
}) => {
|
|
97
|
-
const
|
|
97
|
+
const i = {
|
|
98
98
|
fontSize: e.b2R.size,
|
|
99
99
|
fontWeight: e.b2R.size,
|
|
100
100
|
lineHeight: e.b2R.lineHeight,
|
|
101
101
|
letterSpacing: e.b2R.letterSpacing,
|
|
102
102
|
"&[disabled]": {
|
|
103
|
-
color:
|
|
103
|
+
color: r[30]
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
return
|
|
107
|
-
...
|
|
108
|
-
color:
|
|
106
|
+
return b ? {
|
|
107
|
+
...i,
|
|
108
|
+
color: r[100]
|
|
109
109
|
} : {
|
|
110
|
-
...
|
|
111
|
-
color:
|
|
110
|
+
...i,
|
|
111
|
+
color: r[50]
|
|
112
112
|
};
|
|
113
113
|
}}
|
|
114
|
-
`,
|
|
114
|
+
`, ne = w.div`
|
|
115
115
|
overflow: hidden;
|
|
116
116
|
text-overflow: ellipsis;
|
|
117
117
|
white-space: nowrap;
|
|
118
|
-
`,
|
|
118
|
+
`, re = w.div`
|
|
119
119
|
display: flex;
|
|
120
120
|
align-items: center;
|
|
121
121
|
justify-content: center;
|
|
122
122
|
transform: ${({ isFocused: e }) => e ? "rotate(180deg)" : "rotate(0deg)"};
|
|
123
123
|
transition: transform 200ms linear;
|
|
124
|
-
`,
|
|
124
|
+
`, ie = w.ul`
|
|
125
125
|
position: fixed;
|
|
126
126
|
max-height: 476px;
|
|
127
127
|
overflow-y: auto;
|
|
@@ -135,150 +135,153 @@ const te = h.div`
|
|
|
135
135
|
box-shadow: ${({ theme: { elevation: e } }) => e[4]};
|
|
136
136
|
transition: opacity 200ms linear;
|
|
137
137
|
opacity: ${({ isFocused: e }) => e ? 1 : 0};
|
|
138
|
-
`,
|
|
139
|
-
value:
|
|
140
|
-
onChange:
|
|
141
|
-
open:
|
|
142
|
-
onOpen:
|
|
143
|
-
onClose:
|
|
138
|
+
`, me = J(function({
|
|
139
|
+
value: r,
|
|
140
|
+
onChange: b,
|
|
141
|
+
open: i,
|
|
142
|
+
onOpen: C,
|
|
143
|
+
onClose: k,
|
|
144
144
|
variant: V = "outlined",
|
|
145
145
|
size: B = "large",
|
|
146
|
-
startAdornment:
|
|
146
|
+
startAdornment: E,
|
|
147
147
|
placeholder: L = "TEXT",
|
|
148
|
-
disabled:
|
|
148
|
+
disabled: c = !1,
|
|
149
149
|
fullWidth: A,
|
|
150
|
-
children:
|
|
150
|
+
children: x,
|
|
151
151
|
inlineCSS: F,
|
|
152
|
-
|
|
152
|
+
...$
|
|
153
153
|
}, q) {
|
|
154
|
-
const K = N(),
|
|
155
|
-
|
|
154
|
+
const K = N(), u = y(null), h = y(null), m = y(""), [a, d] = R(i || !1), [f, s] = R(""), [S, O] = R({ top: 0, bottom: 0, left: 0, width: 0 }), p = ($ == null ? void 0 : $.id) || K, P = () => {
|
|
155
|
+
c || (i === void 0 ? d((t) => !t) : i === !1 && C && typeof C == "function" && C());
|
|
156
156
|
}, W = (t) => () => {
|
|
157
|
-
|
|
157
|
+
c || (b(t.toString()), j());
|
|
158
158
|
}, j = () => {
|
|
159
|
-
|
|
159
|
+
c || (i === void 0 ? (d(!1), s("")) : i === !0 && k && typeof k == "function" && k());
|
|
160
160
|
}, T = (t) => {
|
|
161
|
-
if (
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
if (!c) {
|
|
162
|
+
if (t.preventDefault(), t.code === "Escape" && d(!1), t.code === "Space" || t.code === "Enter")
|
|
163
|
+
if (m.current ? s(m.current) : f || s(`${p}-0`), a) {
|
|
164
|
+
if (f) {
|
|
165
|
+
const o = document.querySelector(
|
|
166
|
+
`#${CSS.escape(f)}`
|
|
167
|
+
);
|
|
168
|
+
o && o.hasAttribute("value") && (m.current = o == null ? void 0 : o.id, W(o.value)());
|
|
169
|
+
}
|
|
170
|
+
d(!1);
|
|
171
|
+
} else
|
|
172
|
+
d(!0);
|
|
173
|
+
if (t.code === "ArrowDown" || t.code === "ArrowUp") {
|
|
174
|
+
if (a || d(!0), m.current ? s(m.current) : s(`${p}-0`), !h.current || !f) return;
|
|
175
|
+
const o = h.current.querySelector(
|
|
176
|
+
`#${CSS.escape(f)}`
|
|
177
|
+
);
|
|
178
|
+
if (!o) return;
|
|
179
|
+
if (t.code === "ArrowDown") {
|
|
180
|
+
const n = H(o, "next", { skipDisabled: !0 });
|
|
181
|
+
if (n && n.id)
|
|
182
|
+
s(n.id), n.scrollIntoView({ block: "end" });
|
|
183
|
+
else {
|
|
184
|
+
const l = h.current.firstElementChild;
|
|
185
|
+
l && (s(l.id), l.scrollIntoView({ block: "start" }));
|
|
186
|
+
}
|
|
168
187
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (!n) return;
|
|
178
|
-
if (t.code === "ArrowDown") {
|
|
179
|
-
const o = H(n, "next", { skipDisabled: !0 });
|
|
180
|
-
if (o && o.id)
|
|
181
|
-
l(o.id), o.scrollIntoView({ block: "end" });
|
|
182
|
-
else {
|
|
183
|
-
const s = x.current.firstElementChild;
|
|
184
|
-
s && (l(s.id), s.scrollIntoView({ block: "start" }));
|
|
188
|
+
if (t.code === "ArrowUp") {
|
|
189
|
+
const n = H(o, "prev", { skipDisabled: !0 });
|
|
190
|
+
if (n && n.id)
|
|
191
|
+
s(n.id), n.scrollIntoView({ block: "end" });
|
|
192
|
+
else {
|
|
193
|
+
const l = h.current.lastElementChild;
|
|
194
|
+
l && (s(l.id), l.scrollIntoView({ block: "end" }));
|
|
195
|
+
}
|
|
185
196
|
}
|
|
186
197
|
}
|
|
187
|
-
if (t.code === "
|
|
188
|
-
const o =
|
|
189
|
-
|
|
190
|
-
l(o.id), o.scrollIntoView({ block: "end" });
|
|
191
|
-
else {
|
|
192
|
-
const s = x.current.lastElementChild;
|
|
193
|
-
s && (l(s.id), s.scrollIntoView({ block: "end" }));
|
|
194
|
-
}
|
|
198
|
+
if (t.code === "Home" && s(`${p}-0`), t.code === "End") {
|
|
199
|
+
const o = v.count(x);
|
|
200
|
+
s(`${p}-${o - 1}`);
|
|
195
201
|
}
|
|
196
202
|
}
|
|
197
|
-
if (t.code === "Home" && l(`${p}-0`), t.code === "End") {
|
|
198
|
-
const n = v.count(g);
|
|
199
|
-
l(`${p}-${n - 1}`);
|
|
200
|
-
}
|
|
201
203
|
}, U = (t) => {
|
|
202
|
-
const
|
|
203
|
-
return
|
|
204
|
+
const o = v.map(t, (n) => D(n) && n && n.props.value === r ? n.props.children : null);
|
|
205
|
+
return o && o.length ? o[0] : "";
|
|
204
206
|
};
|
|
205
207
|
return z(() => {
|
|
206
208
|
const t = () => {
|
|
207
|
-
if (
|
|
208
|
-
const
|
|
209
|
+
if (u.current) {
|
|
210
|
+
const o = u.current.getBoundingClientRect(), n = v.count(x), l = 40, M = 24, X = l * n > 476 ? 476 : l * n, G = u.current.getBoundingClientRect().bottom + X + M > window.innerHeight;
|
|
209
211
|
O(G ? {
|
|
210
212
|
bottom: 24,
|
|
211
|
-
left:
|
|
212
|
-
width:
|
|
213
|
+
left: o.left,
|
|
214
|
+
width: u.current.offsetWidth
|
|
213
215
|
} : {
|
|
214
|
-
top:
|
|
215
|
-
left:
|
|
216
|
-
width:
|
|
216
|
+
top: o.top + o.height,
|
|
217
|
+
left: o.left,
|
|
218
|
+
width: u.current.offsetWidth
|
|
217
219
|
});
|
|
218
220
|
}
|
|
219
221
|
};
|
|
220
222
|
return t(), window.addEventListener("resize", t), () => {
|
|
221
223
|
window.removeEventListener("resize", t);
|
|
222
224
|
};
|
|
223
|
-
}, [
|
|
224
|
-
|
|
225
|
-
}, [
|
|
225
|
+
}, [x]), z(() => {
|
|
226
|
+
i !== void 0 && d(i);
|
|
227
|
+
}, [i]), /* @__PURE__ */ I(Z, { ref: q, inlineCSS: { position: "relative" }, children: [
|
|
226
228
|
/* @__PURE__ */ I(
|
|
227
229
|
te,
|
|
228
230
|
{
|
|
229
231
|
role: "combobox",
|
|
230
|
-
ref:
|
|
232
|
+
ref: u,
|
|
231
233
|
tabIndex: 0,
|
|
232
234
|
variant: V,
|
|
233
235
|
size: B,
|
|
234
|
-
disabled:
|
|
236
|
+
disabled: c,
|
|
235
237
|
fullWidth: A,
|
|
236
|
-
isFocused:
|
|
238
|
+
isFocused: a,
|
|
237
239
|
onClick: P,
|
|
238
240
|
onKeyDown: T,
|
|
239
241
|
"aria-controls": p,
|
|
240
|
-
"aria-expanded":
|
|
242
|
+
"aria-expanded": a,
|
|
241
243
|
"aria-haspopup": "listbox",
|
|
242
|
-
"aria-activedescendant":
|
|
243
|
-
|
|
244
|
+
"aria-activedescendant": f,
|
|
245
|
+
"aria-disabled": c,
|
|
246
|
+
...$,
|
|
244
247
|
css: F,
|
|
245
248
|
children: [
|
|
246
|
-
/* @__PURE__ */ I(
|
|
247
|
-
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ I(oe, { value: r === "0" || !!r, disabled: c, children: [
|
|
250
|
+
E && /* @__PURE__ */ g(_, { justifyContent: "center", alignItems: "center", children: E }),
|
|
251
|
+
/* @__PURE__ */ g(ne, { children: U(x) || L })
|
|
249
252
|
] }),
|
|
250
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ g(re, { isFocused: a, children: /* @__PURE__ */ g(ee, { name: "ChevronDownLine", size: "small", color: c ? "grey.30" : "grey.100" }) })
|
|
251
254
|
]
|
|
252
255
|
}
|
|
253
256
|
),
|
|
254
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ g(
|
|
255
258
|
Y,
|
|
256
259
|
{
|
|
257
|
-
open:
|
|
260
|
+
open: a,
|
|
258
261
|
onClose: j,
|
|
259
262
|
inlineCSS: { backgroundColor: "transparent" },
|
|
260
|
-
children: /* @__PURE__ */
|
|
261
|
-
|
|
263
|
+
children: /* @__PURE__ */ g(
|
|
264
|
+
ie,
|
|
262
265
|
{
|
|
263
266
|
id: p,
|
|
264
267
|
role: "listbox",
|
|
265
|
-
ref:
|
|
268
|
+
ref: h,
|
|
266
269
|
tabIndex: -1,
|
|
267
|
-
isFocused:
|
|
270
|
+
isFocused: a,
|
|
268
271
|
style: {
|
|
269
|
-
top:
|
|
270
|
-
bottom:
|
|
271
|
-
left:
|
|
272
|
-
width:
|
|
272
|
+
top: S.top,
|
|
273
|
+
bottom: S.bottom,
|
|
274
|
+
left: S.left,
|
|
275
|
+
width: S.width
|
|
273
276
|
},
|
|
274
|
-
children: v.map(
|
|
277
|
+
children: v.map(x, (t, o) => {
|
|
275
278
|
if (!D(t) || !t.props.value)
|
|
276
279
|
return null;
|
|
277
|
-
const
|
|
278
|
-
return
|
|
279
|
-
id:
|
|
280
|
-
selected:
|
|
281
|
-
focused:
|
|
280
|
+
const n = `${p}-${o}`, l = r === t.props.value;
|
|
281
|
+
return l && (m.current = n), Q(t, {
|
|
282
|
+
id: n,
|
|
283
|
+
selected: l,
|
|
284
|
+
focused: n === f,
|
|
282
285
|
onClick: W(t.props.value),
|
|
283
286
|
...t.props
|
|
284
287
|
});
|
|
@@ -290,5 +293,5 @@ const te = h.div`
|
|
|
290
293
|
] });
|
|
291
294
|
});
|
|
292
295
|
export {
|
|
293
|
-
|
|
296
|
+
me as default
|
|
294
297
|
};
|