@xsolla/xui-dropdown 0.64.0-pr56.1768440195

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/web/index.js ADDED
@@ -0,0 +1,606 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.tsx
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Dropdown: () => Dropdown,
34
+ DropdownItem: () => DropdownItem
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+
38
+ // src/Dropdown.tsx
39
+ var import_react4 = require("react");
40
+
41
+ // ../primitives-web/src/Box.tsx
42
+ var import_react = __toESM(require("react"));
43
+ var import_styled_components = __toESM(require("styled-components"));
44
+ var import_jsx_runtime = require("react/jsx-runtime");
45
+ var StyledBox = import_styled_components.default.div`
46
+ display: flex;
47
+ box-sizing: border-box;
48
+ background-color: ${(props) => props.backgroundColor || "transparent"};
49
+ border-color: ${(props) => props.borderColor || "transparent"};
50
+ border-width: ${(props) => typeof props.borderWidth === "number" ? `${props.borderWidth}px` : props.borderWidth || 0};
51
+
52
+ ${(props) => props.borderBottomWidth !== void 0 && `
53
+ border-bottom-width: ${typeof props.borderBottomWidth === "number" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};
54
+ border-bottom-color: ${props.borderBottomColor || props.borderColor || "transparent"};
55
+ border-bottom-style: solid;
56
+ `}
57
+ ${(props) => props.borderTopWidth !== void 0 && `
58
+ border-top-width: ${typeof props.borderTopWidth === "number" ? `${props.borderTopWidth}px` : props.borderTopWidth};
59
+ border-top-color: ${props.borderTopColor || props.borderColor || "transparent"};
60
+ border-top-style: solid;
61
+ `}
62
+ ${(props) => props.borderLeftWidth !== void 0 && `
63
+ border-left-width: ${typeof props.borderLeftWidth === "number" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};
64
+ border-left-color: ${props.borderLeftColor || props.borderColor || "transparent"};
65
+ border-left-style: solid;
66
+ `}
67
+ ${(props) => props.borderRightWidth !== void 0 && `
68
+ border-right-width: ${typeof props.borderRightWidth === "number" ? `${props.borderRightWidth}px` : props.borderRightWidth};
69
+ border-right-color: ${props.borderRightColor || props.borderColor || "transparent"};
70
+ border-right-style: solid;
71
+ `}
72
+
73
+ border-style: ${(props) => props.borderStyle || (props.borderWidth || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth ? "solid" : "none")};
74
+ border-radius: ${(props) => typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius || 0};
75
+ height: ${(props) => typeof props.height === "number" ? `${props.height}px` : props.height || "auto"};
76
+ width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
77
+ min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
78
+ min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
79
+
80
+ padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
81
+ ${(props) => props.paddingHorizontal && `
82
+ padding-left: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
83
+ padding-right: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
84
+ `}
85
+ ${(props) => props.paddingVertical && `
86
+ padding-top: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
87
+ padding-bottom: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
88
+ `}
89
+ ${(props) => props.paddingTop !== void 0 && `padding-top: ${typeof props.paddingTop === "number" ? `${props.paddingTop}px` : props.paddingTop};`}
90
+ ${(props) => props.paddingBottom !== void 0 && `padding-bottom: ${typeof props.paddingBottom === "number" ? `${props.paddingBottom}px` : props.paddingBottom};`}
91
+ ${(props) => props.paddingLeft !== void 0 && `padding-left: ${typeof props.paddingLeft === "number" ? `${props.paddingLeft}px` : props.paddingLeft};`}
92
+ ${(props) => props.paddingRight !== void 0 && `padding-right: ${typeof props.paddingRight === "number" ? `${props.paddingRight}px` : props.paddingRight};`}
93
+
94
+ margin: ${(props) => typeof props.margin === "number" ? `${props.margin}px` : props.margin || 0};
95
+ ${(props) => props.marginTop !== void 0 && `margin-top: ${typeof props.marginTop === "number" ? `${props.marginTop}px` : props.marginTop};`}
96
+ ${(props) => props.marginBottom !== void 0 && `margin-bottom: ${typeof props.marginBottom === "number" ? `${props.marginBottom}px` : props.marginBottom};`}
97
+ ${(props) => props.marginLeft !== void 0 && `margin-left: ${typeof props.marginLeft === "number" ? `${props.marginLeft}px` : props.marginLeft};`}
98
+ ${(props) => props.marginRight !== void 0 && `margin-right: ${typeof props.marginRight === "number" ? `${props.marginRight}px` : props.marginRight};`}
99
+
100
+ flex-direction: ${(props) => props.flexDirection || "column"};
101
+ flex-wrap: ${(props) => props.flexWrap || "nowrap"};
102
+ align-items: ${(props) => props.alignItems || "stretch"};
103
+ justify-content: ${(props) => props.justifyContent || "flex-start"};
104
+ cursor: ${(props) => props.cursor ? props.cursor : props.onClick || props.onPress ? "pointer" : "inherit"};
105
+ position: ${(props) => props.position || "static"};
106
+ top: ${(props) => typeof props.top === "number" ? `${props.top}px` : props.top};
107
+ bottom: ${(props) => typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom};
108
+ left: ${(props) => typeof props.left === "number" ? `${props.left}px` : props.left};
109
+ right: ${(props) => typeof props.right === "number" ? `${props.right}px` : props.right};
110
+ flex: ${(props) => props.flex};
111
+ flex-shrink: ${(props) => props.flexShrink ?? 1};
112
+ gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
113
+ align-self: ${(props) => props.alignSelf || "auto"};
114
+ overflow: ${(props) => props.overflow || "visible"};
115
+ overflow-x: ${(props) => props.overflowX || "visible"};
116
+ overflow-y: ${(props) => props.overflowY || "visible"};
117
+ z-index: ${(props) => props.zIndex};
118
+ opacity: ${(props) => props.disabled ? 0.5 : 1};
119
+ pointer-events: ${(props) => props.disabled ? "none" : "auto"};
120
+
121
+ &:hover {
122
+ ${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
123
+ ${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
124
+ }
125
+
126
+ &:active {
127
+ ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
128
+ }
129
+ `;
130
+ var Box = import_react.default.forwardRef(
131
+ ({
132
+ children,
133
+ onPress,
134
+ onKeyDown,
135
+ onKeyUp,
136
+ role,
137
+ "aria-label": ariaLabel,
138
+ "aria-labelledby": ariaLabelledBy,
139
+ "aria-current": ariaCurrent,
140
+ "aria-disabled": ariaDisabled,
141
+ "aria-live": ariaLive,
142
+ "aria-busy": ariaBusy,
143
+ "aria-describedby": ariaDescribedBy,
144
+ "aria-expanded": ariaExpanded,
145
+ "aria-haspopup": ariaHasPopup,
146
+ "aria-pressed": ariaPressed,
147
+ "aria-controls": ariaControls,
148
+ tabIndex,
149
+ as,
150
+ src,
151
+ alt,
152
+ type,
153
+ disabled,
154
+ id,
155
+ ...props
156
+ }, ref) => {
157
+ if (as === "img" && src) {
158
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
159
+ "img",
160
+ {
161
+ src,
162
+ alt: alt || "",
163
+ style: {
164
+ display: "block",
165
+ objectFit: "cover",
166
+ width: typeof props.width === "number" ? `${props.width}px` : props.width,
167
+ height: typeof props.height === "number" ? `${props.height}px` : props.height,
168
+ borderRadius: typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius,
169
+ position: props.position,
170
+ top: typeof props.top === "number" ? `${props.top}px` : props.top,
171
+ left: typeof props.left === "number" ? `${props.left}px` : props.left,
172
+ right: typeof props.right === "number" ? `${props.right}px` : props.right,
173
+ bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom
174
+ }
175
+ }
176
+ );
177
+ }
178
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
179
+ StyledBox,
180
+ {
181
+ ref,
182
+ as,
183
+ id,
184
+ type: as === "button" ? type || "button" : void 0,
185
+ disabled: as === "button" ? disabled : void 0,
186
+ onClick: onPress,
187
+ onKeyDown,
188
+ onKeyUp,
189
+ role,
190
+ "aria-label": ariaLabel,
191
+ "aria-labelledby": ariaLabelledBy,
192
+ "aria-current": ariaCurrent,
193
+ "aria-disabled": ariaDisabled,
194
+ "aria-busy": ariaBusy,
195
+ "aria-describedby": ariaDescribedBy,
196
+ "aria-expanded": ariaExpanded,
197
+ "aria-haspopup": ariaHasPopup,
198
+ "aria-pressed": ariaPressed,
199
+ "aria-controls": ariaControls,
200
+ "aria-live": ariaLive,
201
+ tabIndex: tabIndex !== void 0 ? tabIndex : void 0,
202
+ ...props,
203
+ children
204
+ }
205
+ );
206
+ }
207
+ );
208
+ Box.displayName = "Box";
209
+
210
+ // ../primitives-web/src/Text.tsx
211
+ var import_styled_components2 = __toESM(require("styled-components"));
212
+ var import_jsx_runtime2 = require("react/jsx-runtime");
213
+ var StyledText = import_styled_components2.default.span`
214
+ color: ${(props) => props.color || "inherit"};
215
+ font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
216
+ font-weight: ${(props) => props.fontWeight || "normal"};
217
+ font-family: ${(props) => props.fontFamily || '"Pilat Wide Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important'};
218
+ line-height: ${(props) => typeof props.lineHeight === "number" ? `${props.lineHeight}px` : props.lineHeight || "inherit"};
219
+ white-space: ${(props) => props.whiteSpace || "normal"};
220
+ text-align: ${(props) => props.textAlign || "inherit"};
221
+ text-decoration: ${(props) => props.textDecoration || "none"};
222
+ `;
223
+ var Text = ({
224
+ style,
225
+ className,
226
+ id,
227
+ role,
228
+ ...props
229
+ }) => {
230
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
231
+ StyledText,
232
+ {
233
+ ...props,
234
+ style,
235
+ className,
236
+ id,
237
+ role
238
+ }
239
+ );
240
+ };
241
+
242
+ // ../primitives-web/src/Spinner.tsx
243
+ var import_styled_components3 = __toESM(require("styled-components"));
244
+ var import_jsx_runtime3 = require("react/jsx-runtime");
245
+ var rotate = import_styled_components3.keyframes`
246
+ from {
247
+ transform: rotate(0deg);
248
+ }
249
+ to {
250
+ transform: rotate(360deg);
251
+ }
252
+ `;
253
+ var StyledSpinner = import_styled_components3.default.div`
254
+ width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
255
+ height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
256
+ border: ${(props) => props.strokeWidth || 2}px solid
257
+ ${(props) => props.color || "currentColor"};
258
+ border-bottom-color: transparent;
259
+ border-radius: 50%;
260
+ display: inline-block;
261
+ box-sizing: border-box;
262
+ animation: ${rotate} 1s linear infinite;
263
+ `;
264
+ var Spinner = ({
265
+ role = "status",
266
+ "aria-label": ariaLabel,
267
+ "aria-live": ariaLive = "polite",
268
+ "aria-describedby": ariaDescribedBy,
269
+ testID,
270
+ ...props
271
+ }) => {
272
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
273
+ StyledSpinner,
274
+ {
275
+ role,
276
+ "aria-label": ariaLabel,
277
+ "aria-live": ariaLive,
278
+ "aria-describedby": ariaDescribedBy,
279
+ "data-testid": testID,
280
+ ...props
281
+ }
282
+ );
283
+ };
284
+ Spinner.displayName = "Spinner";
285
+
286
+ // ../primitives-web/src/Icon.tsx
287
+ var import_styled_components4 = __toESM(require("styled-components"));
288
+ var import_jsx_runtime4 = require("react/jsx-runtime");
289
+ var StyledIcon = import_styled_components4.default.div`
290
+ display: flex;
291
+ align-items: center;
292
+ justify-content: center;
293
+ width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
294
+ height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
295
+ color: ${(props) => props.color || "currentColor"};
296
+
297
+ svg {
298
+ width: 100%;
299
+ height: 100%;
300
+ fill: none;
301
+ stroke: currentColor;
302
+ }
303
+ `;
304
+
305
+ // ../primitives-web/src/Divider.tsx
306
+ var import_styled_components5 = __toESM(require("styled-components"));
307
+ var import_jsx_runtime5 = require("react/jsx-runtime");
308
+ var StyledDivider = import_styled_components5.default.div`
309
+ background-color: ${(props) => props.dashStroke ? "transparent" : props.color || "rgba(255, 255, 255, 0.15)"};
310
+ width: ${(props) => props.vertical ? typeof props.width === "number" ? `${props.width}px` : props.width || "1px" : "100%"};
311
+ height: ${(props) => props.vertical ? "100%" : typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
312
+
313
+ ${(props) => props.dashStroke && `
314
+ border-style: dashed;
315
+ border-color: ${props.color || "rgba(255, 255, 255, 0.15)"};
316
+ border-width: 0;
317
+ ${props.vertical ? `
318
+ border-left-width: ${typeof props.width === "number" ? `${props.width}px` : props.width || "1px"};
319
+ height: 100%;
320
+ ` : `
321
+ border-top-width: ${typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
322
+ width: 100%;
323
+ `}
324
+ `}
325
+ `;
326
+
327
+ // ../primitives-web/src/Input.tsx
328
+ var import_react2 = require("react");
329
+ var import_styled_components6 = __toESM(require("styled-components"));
330
+ var import_jsx_runtime6 = require("react/jsx-runtime");
331
+ var StyledInput = import_styled_components6.default.input`
332
+ background: transparent;
333
+ border: none;
334
+ outline: none;
335
+ width: 100%;
336
+ height: 100%;
337
+ padding: 0;
338
+ margin: 0;
339
+ color: ${(props) => props.color || "inherit"};
340
+ font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
341
+ font-family: inherit;
342
+ text-align: inherit;
343
+
344
+ &::placeholder {
345
+ color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
346
+ }
347
+
348
+ &:disabled {
349
+ cursor: not-allowed;
350
+ }
351
+ `;
352
+ var InputPrimitive = (0, import_react2.forwardRef)(
353
+ ({
354
+ value,
355
+ placeholder,
356
+ onChange,
357
+ onChangeText,
358
+ onFocus,
359
+ onBlur,
360
+ onKeyDown,
361
+ disabled,
362
+ secureTextEntry,
363
+ style,
364
+ color,
365
+ fontSize,
366
+ placeholderTextColor,
367
+ maxLength,
368
+ name,
369
+ type,
370
+ inputMode,
371
+ autoComplete,
372
+ id,
373
+ "aria-invalid": ariaInvalid,
374
+ "aria-describedby": ariaDescribedBy,
375
+ "aria-labelledby": ariaLabelledBy,
376
+ "aria-label": ariaLabel,
377
+ "aria-disabled": ariaDisabled,
378
+ "data-testid": dataTestId,
379
+ ...rest
380
+ }, ref) => {
381
+ const handleChange = (e) => {
382
+ if (onChange) {
383
+ onChange(e);
384
+ }
385
+ if (onChangeText) {
386
+ onChangeText(e.target.value);
387
+ }
388
+ };
389
+ const inputValue = value !== void 0 ? value : "";
390
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
391
+ StyledInput,
392
+ {
393
+ ref,
394
+ id,
395
+ value: inputValue,
396
+ name,
397
+ placeholder,
398
+ onChange: handleChange,
399
+ onFocus,
400
+ onBlur,
401
+ onKeyDown,
402
+ disabled,
403
+ type: secureTextEntry ? "password" : type || "text",
404
+ inputMode,
405
+ autoComplete,
406
+ style,
407
+ color,
408
+ fontSize,
409
+ placeholderTextColor,
410
+ maxLength,
411
+ "aria-invalid": ariaInvalid,
412
+ "aria-describedby": ariaDescribedBy,
413
+ "aria-labelledby": ariaLabelledBy,
414
+ "aria-label": ariaLabel,
415
+ "aria-disabled": ariaDisabled,
416
+ "data-testid": dataTestId,
417
+ ...rest
418
+ }
419
+ );
420
+ }
421
+ );
422
+ InputPrimitive.displayName = "InputPrimitive";
423
+
424
+ // ../primitives-web/src/TextArea.tsx
425
+ var import_react3 = require("react");
426
+ var import_styled_components7 = __toESM(require("styled-components"));
427
+ var import_jsx_runtime7 = require("react/jsx-runtime");
428
+ var StyledTextArea = import_styled_components7.default.textarea`
429
+ background: transparent;
430
+ border: none;
431
+ outline: none;
432
+ width: 100%;
433
+ height: 100%;
434
+ padding: 0;
435
+ margin: 0;
436
+ color: ${(props) => props.color || "inherit"};
437
+ font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
438
+ font-family: inherit;
439
+ text-align: inherit;
440
+ resize: none;
441
+
442
+ &::placeholder {
443
+ color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
444
+ }
445
+
446
+ &:disabled {
447
+ cursor: not-allowed;
448
+ }
449
+ `;
450
+ var TextAreaPrimitive = (0, import_react3.forwardRef)(
451
+ ({
452
+ value,
453
+ placeholder,
454
+ onChangeText,
455
+ onFocus,
456
+ onBlur,
457
+ onKeyDown,
458
+ disabled,
459
+ style,
460
+ color,
461
+ fontSize,
462
+ placeholderTextColor,
463
+ maxLength,
464
+ rows
465
+ }, ref) => {
466
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
467
+ StyledTextArea,
468
+ {
469
+ ref,
470
+ value,
471
+ placeholder,
472
+ onChange: (e) => onChangeText?.(e.target.value),
473
+ onFocus,
474
+ onBlur,
475
+ onKeyDown,
476
+ disabled,
477
+ style,
478
+ color,
479
+ fontSize,
480
+ placeholderTextColor,
481
+ maxLength,
482
+ rows
483
+ }
484
+ );
485
+ }
486
+ );
487
+ TextAreaPrimitive.displayName = "TextAreaPrimitive";
488
+
489
+ // src/Dropdown.tsx
490
+ var import_xui_core = require("@xsolla/xui-core");
491
+ var import_jsx_runtime8 = require("react/jsx-runtime");
492
+ var Dropdown = ({
493
+ trigger,
494
+ children,
495
+ isOpen: propIsOpen,
496
+ onOpenChange,
497
+ width = "auto"
498
+ }) => {
499
+ const [internalIsOpen, setInternalIsOpen] = (0, import_react4.useState)(false);
500
+ const isOpen = propIsOpen !== void 0 ? propIsOpen : internalIsOpen;
501
+ const containerRef = (0, import_react4.useRef)(null);
502
+ const { theme } = (0, import_xui_core.useDesignSystem)();
503
+ const toggleOpen = () => {
504
+ const nextOpen = !isOpen;
505
+ if (propIsOpen === void 0) {
506
+ setInternalIsOpen(nextOpen);
507
+ }
508
+ if (onOpenChange) onOpenChange(nextOpen);
509
+ };
510
+ (0, import_react4.useEffect)(() => {
511
+ const handleClickOutside = (event) => {
512
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
513
+ if (propIsOpen === void 0) {
514
+ setInternalIsOpen(false);
515
+ }
516
+ if (onOpenChange) onOpenChange(false);
517
+ }
518
+ };
519
+ if (isOpen) {
520
+ document.addEventListener("mousedown", handleClickOutside);
521
+ }
522
+ return () => {
523
+ document.removeEventListener("mousedown", handleClickOutside);
524
+ };
525
+ }, [isOpen, propIsOpen, onOpenChange]);
526
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
527
+ "div",
528
+ {
529
+ ref: containerRef,
530
+ style: {
531
+ position: "relative",
532
+ width: width === "auto" ? "fit-content" : width,
533
+ alignSelf: "flex-start",
534
+ height: "fit-content"
535
+ },
536
+ children: [
537
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { onClick: toggleOpen, style: { cursor: "pointer" }, children: trigger }),
538
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
539
+ Box,
540
+ {
541
+ position: "absolute",
542
+ top: "100%",
543
+ left: 0,
544
+ marginTop: 4,
545
+ backgroundColor: theme.colors.background.secondary,
546
+ borderColor: theme.colors.border.secondary,
547
+ borderWidth: 1,
548
+ borderRadius: theme.radius.button,
549
+ paddingVertical: 4,
550
+ style: {
551
+ zIndex: 1e3,
552
+ boxShadow: "0 4px 12px rgba(0,0,0,0.1)",
553
+ minWidth: "100%"
554
+ },
555
+ children
556
+ }
557
+ )
558
+ ]
559
+ }
560
+ );
561
+ };
562
+ var DropdownItem = ({
563
+ children,
564
+ onPress,
565
+ active,
566
+ disabled,
567
+ icon
568
+ }) => {
569
+ const { theme } = (0, import_xui_core.useDesignSystem)();
570
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
571
+ Box,
572
+ {
573
+ onPress: !disabled ? onPress : void 0,
574
+ paddingHorizontal: 16,
575
+ paddingVertical: 8,
576
+ flexDirection: "row",
577
+ alignItems: "center",
578
+ backgroundColor: active ? theme.colors.control.input.bgHover : "transparent",
579
+ hoverStyle: !disabled ? {
580
+ backgroundColor: theme.colors.control.input.bgHover
581
+ } : void 0,
582
+ style: {
583
+ opacity: disabled ? 0.5 : 1,
584
+ cursor: disabled ? "not-allowed" : "pointer"
585
+ },
586
+ children: [
587
+ icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box, { marginRight: 12, alignItems: "center", justifyContent: "center", children: icon }),
588
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
589
+ Text,
590
+ {
591
+ color: active ? theme.colors.content.primary : theme.colors.content.secondary,
592
+ fontSize: 14,
593
+ fontWeight: active ? "600" : "400",
594
+ children
595
+ }
596
+ )
597
+ ]
598
+ }
599
+ );
600
+ };
601
+ // Annotate the CommonJS export names for ESM import in node:
602
+ 0 && (module.exports = {
603
+ Dropdown,
604
+ DropdownItem
605
+ });
606
+ //# sourceMappingURL=index.js.map