@xaui/native 0.9.1-alpha.93 → 0.9.1-alpha.94
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/{chunk-PAQZOD2L.js → chunk-2JFMCW5E.js} +1 -1
- package/dist/chunk-2TLPFGGR.cjs +251 -0
- package/dist/{chunk-TPYOQSKT.js → chunk-2UNLQRXY.js} +1 -1
- package/dist/{chunk-JKDWYNSG.js → chunk-2XEQDQAN.js} +109 -107
- package/dist/{chunk-RXEUKYM5.js → chunk-33BA4LVN.js} +1 -1
- package/dist/{chunk-ODQHAPQW.js → chunk-4AIIAF6U.js} +24 -22
- package/dist/{chunk-QCH7X7O2.cjs → chunk-4LRVB6WR.cjs} +14 -14
- package/dist/{chunk-QUSQEYLP.cjs → chunk-53E2E7GS.cjs} +26 -28
- package/dist/{chunk-2B6PUYTP.cjs → chunk-55KGHYYU.cjs} +4 -4
- package/dist/{chunk-B33OU34Z.cjs → chunk-5O7E73QP.cjs} +12 -12
- package/dist/{chunk-FVEMTBU4.js → chunk-5XTF2JDK.js} +2 -2
- package/dist/{chunk-V2CEKPJ6.js → chunk-6MVKLRLZ.js} +1 -1
- package/dist/{chunk-RSIWSVXI.js → chunk-6NAZ2IHL.js} +1 -1
- package/dist/{chunk-LPJ3UBSO.cjs → chunk-6NRWZR7T.cjs} +2 -2
- package/dist/{chunk-FXN32S75.cjs → chunk-6SRFQSPR.cjs} +3 -3
- package/dist/{chunk-7EVW6O2Q.js → chunk-6W45YHTF.js} +1 -1
- package/dist/{chunk-7NQL5DXY.js → chunk-6XY3XAEQ.js} +1 -1
- package/dist/{chunk-UEW3GAP5.cjs → chunk-6ZWQDTGQ.cjs} +5 -5
- package/dist/{chunk-VMPCXS4S.js → chunk-7OVYYZ7H.js} +22 -20
- package/dist/{chunk-CYOUOQXT.cjs → chunk-AHJLQJOE.cjs} +5 -5
- package/dist/{chunk-OPLPLFGK.cjs → chunk-AHKKEM3K.cjs} +66 -23
- package/dist/{chunk-WIX4SYZI.cjs → chunk-AIHKBSQ5.cjs} +2 -2
- package/dist/{chunk-WRZV6ORJ.js → chunk-AYOJXFHR.js} +1 -1
- package/dist/{chunk-OD6H7ANY.js → chunk-B5DBFS6M.js} +1 -1
- package/dist/{chunk-VQGNLX5C.js → chunk-BYDGJU5A.js} +1 -1
- package/dist/{chunk-NVODH2PR.js → chunk-CCTAJXZ3.js} +63 -61
- package/dist/{chunk-ORXVXYKC.cjs → chunk-CHGBWFDI.cjs} +63 -26
- package/dist/{chunk-WLJPO3AS.cjs → chunk-CZ2NUGUI.cjs} +357 -201
- package/dist/{chunk-PYQ2P3M5.cjs → chunk-CZEWWCWG.cjs} +58 -58
- package/dist/{chunk-PDSR42YC.cjs → chunk-D22K3NZU.cjs} +3 -3
- package/dist/{chunk-TRWZEOCO.js → chunk-DBP5CA5R.js} +2 -2
- package/dist/{chunk-QN2D5ZCS.cjs → chunk-DE4RSR7Q.cjs} +3 -3
- package/dist/{chunk-FOOXBVOQ.js → chunk-E5E2QA4K.js} +22 -20
- package/dist/{chunk-LECYGVIH.js → chunk-EQUD3NHO.js} +50 -48
- package/dist/chunk-ERIGD4SE.cjs +686 -0
- package/dist/{chunk-62AYYMZP.cjs → chunk-FDYPWVNP.cjs} +3 -3
- package/dist/chunk-GN7BWYXP.cjs +627 -0
- package/dist/chunk-GWTURY4S.cjs +999 -0
- package/dist/{chunk-OW4N2C3M.cjs → chunk-HBYT7B47.cjs} +88 -61
- package/dist/{chunk-XWIPLZTD.cjs → chunk-HOV25N3M.cjs} +2 -2
- package/dist/{chunk-5MMBEDZG.cjs → chunk-I3XIZWCV.cjs} +29 -29
- package/dist/{chunk-EDNCHCIN.cjs → chunk-IAJG7GYE.cjs} +2 -2
- package/dist/{chunk-P7OHZCU3.js → chunk-IAWLQN2W.js} +2 -2
- package/dist/{chunk-RCSEVEIR.js → chunk-ICVIWXK4.js} +1 -1
- package/dist/{chunk-RREJUSAS.cjs → chunk-IMIY34F4.cjs} +3 -3
- package/dist/{chunk-ZWS3FQ3J.js → chunk-IUDQG3JI.js} +57 -57
- package/dist/{chunk-O6B72H4B.js → chunk-K7VDLVLE.js} +6 -8
- package/dist/{chunk-P2CJNTAP.js → chunk-KFB24VYT.js} +22 -20
- package/dist/chunk-KHPODIQV.cjs +540 -0
- package/dist/{chunk-CBRW53GN.cjs → chunk-KMK6FUTK.cjs} +39 -23
- package/dist/{chunk-2AFA5HA2.js → chunk-KQW25RCC.js} +77 -75
- package/dist/{chunk-X4CZYJZ6.cjs → chunk-LCGJA37L.cjs} +12 -12
- package/dist/{chunk-SUJLTC2K.js → chunk-LPGY2IDX.js} +1 -1
- package/dist/{chunk-P5M5URAB.js → chunk-LSZW4G7B.js} +31 -31
- package/dist/{chunk-GYEQEF5H.js → chunk-LUPU7FJK.js} +1 -1
- package/dist/chunk-MNBEUNC5.cjs +792 -0
- package/dist/{chunk-AIND5F7P.js → chunk-MTQGFUW5.js} +29 -29
- package/dist/chunk-NGXLJ5ZF.cjs +395 -0
- package/dist/{chunk-DYQB54JA.cjs → chunk-NPAGA6SH.cjs} +2 -2
- package/dist/{chunk-QELEKXN3.cjs → chunk-OMI2FRCU.cjs} +5 -5
- package/dist/{chunk-EBCAPIBD.js → chunk-OX23MW5E.js} +70 -50
- package/dist/{chunk-MMFIMQMQ.js → chunk-OZLOYXLW.js} +2 -2
- package/dist/{chunk-JBZ7SBRV.cjs → chunk-Q3ZKZ2Y6.cjs} +3 -3
- package/dist/{chunk-TCWW7JI2.js → chunk-QT7KLGO3.js} +65 -63
- package/dist/{chunk-6RU6GUJP.js → chunk-QZF7RSVV.js} +1 -1
- package/dist/{chunk-UYQLW7OD.js → chunk-RAYO2TJL.js} +2 -2
- package/dist/{chunk-FRLWG5LM.js → chunk-RFT5MGJC.js} +25 -25
- package/dist/chunk-SIOSYITD.cjs +1039 -0
- package/dist/{chunk-USIWPESU.js → chunk-SIX5AVXG.js} +1 -1
- package/dist/{chunk-52XUGOLD.js → chunk-SX5U5UJQ.js} +3 -3
- package/dist/{chunk-GGP2ERSV.js → chunk-T5ES7FOL.js} +1 -1
- package/dist/{chunk-MSORLKO7.cjs → chunk-V3C3ATRO.cjs} +2 -2
- package/dist/{chunk-BI5ME4QP.cjs → chunk-VBS6VWW4.cjs} +5 -5
- package/dist/{chunk-2SHWOFQV.js → chunk-VQ4OTVET.js} +29 -29
- package/dist/{chunk-6GQ7UTJ7.cjs → chunk-VXAIFOXL.cjs} +2 -2
- package/dist/{chunk-BJVO7DWJ.js → chunk-W4F4NQXM.js} +1 -1
- package/dist/{chunk-ZE4IHUUO.cjs → chunk-WNEDQTH6.cjs} +2 -2
- package/dist/{chunk-CBXILKQZ.cjs → chunk-WPYJW3WM.cjs} +3 -3
- package/dist/{chunk-QHXTO525.js → chunk-WYJHDTU7.js} +1 -1
- package/dist/{chunk-PROLOLZ5.cjs → chunk-X22PLAP6.cjs} +2 -2
- package/dist/chunk-X6GT4H4I.cjs +662 -0
- package/dist/{chunk-RLC3EXMV.js → chunk-XM4IN4Q6.js} +2 -2
- package/dist/{chunk-ZKGVOXLQ.js → chunk-XOZMGNVS.js} +1 -1
- package/dist/chunk-XXXR2AD3.cjs +94 -0
- package/dist/{chunk-JC4YCKKL.js → chunk-YI5D4QZP.js} +22 -20
- package/dist/{chunk-AR7667VN.cjs → chunk-YJA7OQQZ.cjs} +4 -4
- package/dist/{chunk-PAQD6UUF.cjs → chunk-YJIVPYMG.cjs} +3 -3
- package/dist/{chunk-JJYHW4PV.js → chunk-YOPWQHNO.js} +1 -1
- package/dist/{chunk-LKRQUQZQ.cjs → chunk-YRANVNJG.cjs} +2 -2
- package/dist/chunk-ZDJQ643D.js +62 -0
- package/dist/components/accordion/index.cjs +3 -3
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/agenda-calendar/index.cjs +4 -4
- package/dist/components/agenda-calendar/index.js +3 -3
- package/dist/components/alert/index.cjs +4 -4
- package/dist/components/alert/index.js +3 -3
- package/dist/components/autocomplete/index.cjs +3 -3
- package/dist/components/autocomplete/index.js +2 -2
- package/dist/components/bottom-sheet/index.cjs +3 -3
- package/dist/components/bottom-sheet/index.js +2 -2
- package/dist/components/button/index.cjs +3 -3
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendar/index.cjs +3 -3
- package/dist/components/calendar/index.js +2 -2
- package/dist/components/card/index.cjs +3 -3
- package/dist/components/card/index.js +2 -2
- package/dist/components/carousel/index.cjs +3 -3
- package/dist/components/carousel/index.js +2 -2
- package/dist/components/checkbox/index.cjs +3 -3
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/chip/index.cjs +4 -4
- package/dist/components/chip/index.js +3 -3
- package/dist/components/close-button/index.cjs +4 -4
- package/dist/components/close-button/index.js +3 -3
- package/dist/components/color-picker/index.cjs +6 -6
- package/dist/components/color-picker/index.js +5 -5
- package/dist/components/combobox/index.cjs +4 -4
- package/dist/components/combobox/index.js +3 -3
- package/dist/components/date-picker/index.cjs +4 -4
- package/dist/components/date-picker/index.js +3 -3
- package/dist/components/date-range-picker/index.cjs +6 -6
- package/dist/components/date-range-picker/index.js +5 -5
- package/dist/components/date-time-picker/date-time-picker-indicator.d.cts +2 -2
- package/dist/components/date-time-picker/date-time-picker-indicator.d.ts +2 -2
- package/dist/components/date-time-picker/date-time-picker.type.d.cts +3 -2
- package/dist/components/date-time-picker/date-time-picker.type.d.ts +3 -2
- package/dist/components/date-time-picker/index.cjs +8 -9
- package/dist/components/date-time-picker/index.d.cts +1 -1
- package/dist/components/date-time-picker/index.d.ts +1 -1
- package/dist/components/date-time-picker/index.js +7 -8
- package/dist/components/dialog/index.cjs +4 -4
- package/dist/components/dialog/index.js +3 -3
- package/dist/components/dummy-field/index.cjs +3 -3
- package/dist/components/dummy-field/index.js +2 -2
- package/dist/components/fab/index.cjs +3 -3
- package/dist/components/fab/index.js +2 -2
- package/dist/components/flip-card/index.cjs +3 -3
- package/dist/components/flip-card/index.js +2 -2
- package/dist/components/index.d.cts +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/list-box/index.cjs +2 -2
- package/dist/components/list-box/index.js +1 -1
- package/dist/components/menu/index.cjs +3 -3
- package/dist/components/menu/index.js +2 -2
- package/dist/components/morph-button/index.cjs +3 -3
- package/dist/components/morph-button/index.js +2 -2
- package/dist/components/number-field/number-field-increment.d.cts +2 -2
- package/dist/components/number-field/number-field-increment.d.ts +2 -2
- package/dist/components/number-pad/index.cjs +3 -3
- package/dist/components/number-pad/index.js +2 -2
- package/dist/components/number-stepper/index.cjs +3 -3
- package/dist/components/number-stepper/index.js +2 -2
- package/dist/components/pager/index.cjs +2 -2
- package/dist/components/pager/index.js +1 -1
- package/dist/components/phone-number-field/index.cjs +14 -14
- package/dist/components/phone-number-field/index.js +3 -3
- package/dist/components/popover/index.cjs +3 -3
- package/dist/components/popover/index.js +2 -2
- package/dist/components/radio/index.cjs +3 -3
- package/dist/components/radio/index.js +2 -2
- package/dist/components/range-calendar/index.cjs +4 -4
- package/dist/components/range-calendar/index.js +3 -3
- package/dist/components/rating/index.cjs +3 -3
- package/dist/components/rating/index.js +2 -2
- package/dist/components/search-field/index.cjs +4 -4
- package/dist/components/search-field/index.js +3 -3
- package/dist/components/segment/index.cjs +4 -4
- package/dist/components/segment/index.js +2 -2
- package/dist/components/select/index.cjs +3 -3
- package/dist/components/select/index.js +2 -2
- package/dist/components/slider/index.cjs +2 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/snackbar/index.cjs +3 -3
- package/dist/components/snackbar/index.js +2 -2
- package/dist/components/switch/index.cjs +3 -3
- package/dist/components/switch/index.js +2 -2
- package/dist/components/table/index.cjs +4 -4
- package/dist/components/table/index.js +3 -3
- package/dist/components/tabs/index.cjs +4 -4
- package/dist/components/tabs/index.js +3 -3
- package/dist/components/tag-group/index.cjs +4 -4
- package/dist/components/tag-group/index.js +3 -3
- package/dist/components/time-picker/index.cjs +4 -5
- package/dist/components/time-picker/index.d.cts +1 -1
- package/dist/components/time-picker/index.d.ts +1 -1
- package/dist/components/time-picker/index.js +3 -4
- package/dist/components/time-picker/time-picker-display.d.cts +3 -3
- package/dist/components/time-picker/time-picker-display.d.ts +3 -3
- package/dist/components/time-picker/time-picker-indicator.d.cts +2 -2
- package/dist/components/time-picker/time-picker-indicator.d.ts +2 -2
- package/dist/components/time-picker/time-picker.d.cts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/time-picker/time-picker.type.d.cts +11 -1
- package/dist/components/time-picker/time-picker.type.d.ts +11 -1
- package/dist/components/toast/index.cjs +3 -3
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toggle-button/index.cjs +3 -3
- package/dist/components/toggle-button/index.js +2 -2
- package/dist/components/wheel-picker/index.cjs +2 -2
- package/dist/components/wheel-picker/index.js +1 -1
- package/dist/index.cjs +47 -60
- package/dist/index.js +50 -63
- package/dist/system/index.cjs +3 -3
- package/dist/system/index.js +2 -2
- package/dist/utils/time.d.cts +29 -0
- package/dist/utils/time.d.ts +29 -0
- package/package.json +1 -11
- package/dist/chunk-3MRCSXGT.js +0 -73
- package/dist/chunk-5E6SHYEQ.cjs +0 -631
- package/dist/chunk-6JAGPPZU.cjs +0 -788
- package/dist/chunk-CEPX7CKM.cjs +0 -365
- package/dist/chunk-CHFPFYNV.js +0 -60
- package/dist/chunk-ECR6GPJ6.js +0 -198
- package/dist/chunk-GBTNFQXN.cjs +0 -33
- package/dist/chunk-GZAGWNQM.cjs +0 -719
- package/dist/chunk-ILXKBDC6.cjs +0 -209
- package/dist/chunk-IPD3IUE2.cjs +0 -640
- package/dist/chunk-P2V6PIM7.cjs +0 -478
- package/dist/chunk-Q2BWXT55.cjs +0 -1011
- package/dist/chunk-UFKSUELU.cjs +0 -453
- package/dist/chunk-W4IPOWLY.cjs +0 -198
- package/dist/chunk-YSTLHVQV.cjs +0 -73
- package/dist/components/time-field/index.cjs +0 -27
- package/dist/components/time-field/index.d.cts +0 -52
- package/dist/components/time-field/index.d.ts +0 -52
- package/dist/components/time-field/index.js +0 -27
- package/dist/components/time-field/time-field-field.d.cts +0 -11
- package/dist/components/time-field/time-field-field.d.ts +0 -11
- package/dist/components/time-field/time-field-period.d.cts +0 -34
- package/dist/components/time-field/time-field-period.d.ts +0 -34
- package/dist/components/time-field/time-field.context.d.cts +0 -9
- package/dist/components/time-field/time-field.context.d.ts +0 -9
- package/dist/components/time-field/time-field.d.cts +0 -56
- package/dist/components/time-field/time-field.d.ts +0 -56
- package/dist/components/time-field/time-field.type.d.cts +0 -72
- package/dist/components/time-field/time-field.type.d.ts +0 -72
- package/dist/utils/time-mask.d.cts +0 -68
- package/dist/utils/time-mask.d.ts +0 -68
|
@@ -0,0 +1,792 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule ? obj : {
|
|
8
|
+
default: obj
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
12
|
+
if (lhs != null) {
|
|
13
|
+
return lhs;
|
|
14
|
+
} else {
|
|
15
|
+
return rhsFn();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function _optionalChain(ops) {
|
|
19
|
+
let lastAccessLHS = undefined;
|
|
20
|
+
let value = ops[0];
|
|
21
|
+
let i = 1;
|
|
22
|
+
while (i < ops.length) {
|
|
23
|
+
const op = ops[i];
|
|
24
|
+
const fn = ops[i + 1];
|
|
25
|
+
i += 2;
|
|
26
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
30
|
+
lastAccessLHS = value;
|
|
31
|
+
value = fn(value);
|
|
32
|
+
} else if (op === 'call' || op === 'optionalCall') {
|
|
33
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
34
|
+
lastAccessLHS = undefined;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
var _chunkFJGPDWMScjs = require('./chunk-FJGPDWMS.cjs');
|
|
40
|
+
var _chunkYVYYONTPcjs = require('./chunk-YVYYONTP.cjs');
|
|
41
|
+
var _chunkJ5COSALOcjs = require('./chunk-J5COSALO.cjs');
|
|
42
|
+
var _chunkWDDXU3OHcjs = require('./chunk-WDDXU3OH.cjs');
|
|
43
|
+
var _chunkEKS3W46Mcjs = require('./chunk-EKS3W46M.cjs');
|
|
44
|
+
var _chunkWFEMJCXOcjs = require('./chunk-WFEMJCXO.cjs');
|
|
45
|
+
var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
|
|
46
|
+
var _chunkHBYT7B47cjs = require('./chunk-HBYT7B47.cjs');
|
|
47
|
+
var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
|
|
48
|
+
var _chunkGSZDN6EZcjs = require('./chunk-GSZDN6EZ.cjs');
|
|
49
|
+
var _chunkFHNIGHN5cjs = require('./chunk-FHNIGHN5.cjs');
|
|
50
|
+
var _chunkSL3V7R2Ycjs = require('./chunk-SL3V7R2Y.cjs');
|
|
51
|
+
var _chunkCDRGTUYFcjs = require('./chunk-CDRGTUYF.cjs');
|
|
52
|
+
var _chunkIIAQISBGcjs = require('./chunk-IIAQISBG.cjs');
|
|
53
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
54
|
+
|
|
55
|
+
// src/components/autocomplete/autocomplete.tsx
|
|
56
|
+
var _react = require('react');
|
|
57
|
+
var _reactnative = require('react-native');
|
|
58
|
+
|
|
59
|
+
// src/components/autocomplete/autocomplete.context.ts
|
|
60
|
+
var [AutocompleteProvider, useAutocomplete] = _chunkCDRGTUYFcjs.createSlotContext.call(void 0, "Autocomplete");
|
|
61
|
+
var [AutocompleteItemProvider, useAutocompleteItem] = _chunkCDRGTUYFcjs.createSlotContext.call(void 0, "Autocomplete.Item");
|
|
62
|
+
|
|
63
|
+
// src/components/autocomplete/autocomplete.recipe.ts
|
|
64
|
+
var SLOTS = ["search", "empty"];
|
|
65
|
+
var VARIANT_TOKENS = {
|
|
66
|
+
// The search box is a field **inside** a panel rather than one on a page, so it takes
|
|
67
|
+
// the recessed neutral rather than `fieldBackground` — on a white panel the latter is
|
|
68
|
+
// the panel's own colour and the box would vanish into it. It is the same reasoning the
|
|
69
|
+
// `Checkbox`'s `secondary` gives for the same swap.
|
|
70
|
+
default: {
|
|
71
|
+
bg: "default",
|
|
72
|
+
fg: "fieldForeground"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var SIZES = {
|
|
76
|
+
sm: {
|
|
77
|
+
value: "md"
|
|
78
|
+
},
|
|
79
|
+
md: {
|
|
80
|
+
value: "md"
|
|
81
|
+
},
|
|
82
|
+
lg: {
|
|
83
|
+
value: "lg"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var BOX = {
|
|
87
|
+
height: 10,
|
|
88
|
+
paddingHorizontal: 3,
|
|
89
|
+
radius: "field",
|
|
90
|
+
marginBottom: 2
|
|
91
|
+
};
|
|
92
|
+
function sizeAxis(step) {
|
|
93
|
+
return theme => ({
|
|
94
|
+
search: {
|
|
95
|
+
fontSize: theme.fontSizes[step.value],
|
|
96
|
+
lineHeight: theme.lineHeights[step.value]
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
var autocompleteRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
|
|
101
|
+
slots: SLOTS,
|
|
102
|
+
base: theme => ({
|
|
103
|
+
search: {
|
|
104
|
+
height: theme.spacing(BOX.height),
|
|
105
|
+
paddingHorizontal: theme.spacing(BOX.paddingHorizontal),
|
|
106
|
+
marginBottom: theme.spacing(BOX.marginBottom),
|
|
107
|
+
borderRadius: theme.radius[BOX.radius],
|
|
108
|
+
borderCurve: "continuous",
|
|
109
|
+
fontFamily: theme.fontFamilies.body
|
|
110
|
+
},
|
|
111
|
+
empty: {
|
|
112
|
+
fontFamily: theme.fontFamilies.body,
|
|
113
|
+
fontSize: theme.fontSizes.sm,
|
|
114
|
+
lineHeight: theme.lineHeights.sm,
|
|
115
|
+
color: theme.colors.muted,
|
|
116
|
+
textAlign: "center",
|
|
117
|
+
paddingVertical: theme.spacing(4)
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
variantTokens: VARIANT_TOKENS,
|
|
121
|
+
paint: (_theme, colors) => ({
|
|
122
|
+
search: {
|
|
123
|
+
backgroundColor: colors.bg,
|
|
124
|
+
color: colors.fg
|
|
125
|
+
}
|
|
126
|
+
}),
|
|
127
|
+
variants: {
|
|
128
|
+
size: {
|
|
129
|
+
sm: sizeAxis(SIZES.sm),
|
|
130
|
+
md: sizeAxis(SIZES.md),
|
|
131
|
+
lg: sizeAxis(SIZES.lg)
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
defaultVariants: {
|
|
135
|
+
variant: "default",
|
|
136
|
+
size: "md"
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// src/components/autocomplete/autocomplete.tsx
|
|
141
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
142
|
+
function Autocomplete({
|
|
143
|
+
children,
|
|
144
|
+
variant,
|
|
145
|
+
size,
|
|
146
|
+
radius,
|
|
147
|
+
color,
|
|
148
|
+
value: controlledValue,
|
|
149
|
+
defaultValue,
|
|
150
|
+
onValueChange,
|
|
151
|
+
isOpen: controlledOpen,
|
|
152
|
+
defaultOpen = false,
|
|
153
|
+
onOpenChange,
|
|
154
|
+
query: controlledQuery,
|
|
155
|
+
defaultQuery = "",
|
|
156
|
+
onQueryChange,
|
|
157
|
+
isDisabled = false,
|
|
158
|
+
isInvalid = false
|
|
159
|
+
}) {
|
|
160
|
+
const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0);
|
|
161
|
+
const {
|
|
162
|
+
labelFor,
|
|
163
|
+
registerLabel
|
|
164
|
+
} = _chunkFJGPDWMScjs.useLabelRegistry.call(void 0);
|
|
165
|
+
const [anchor, setAnchor] = _react.useState.call(void 0, null);
|
|
166
|
+
const [value, setValue] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
167
|
+
value: controlledValue,
|
|
168
|
+
defaultValue,
|
|
169
|
+
onChange: onValueChange
|
|
170
|
+
});
|
|
171
|
+
const [isOpen, setOpen] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
172
|
+
value: controlledOpen,
|
|
173
|
+
defaultValue: defaultOpen,
|
|
174
|
+
onChange: onOpenChange
|
|
175
|
+
});
|
|
176
|
+
const [query, setQueryState] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
177
|
+
value: controlledQuery,
|
|
178
|
+
defaultValue: defaultQuery,
|
|
179
|
+
onChange: onQueryChange
|
|
180
|
+
});
|
|
181
|
+
const selection = {
|
|
182
|
+
variant,
|
|
183
|
+
size,
|
|
184
|
+
radius,
|
|
185
|
+
isOpen: isOpen ? "true" : void 0,
|
|
186
|
+
isInvalid: isInvalid ? "true" : void 0
|
|
187
|
+
};
|
|
188
|
+
const styles = _chunkJ5COSALOcjs.selectRecipe.resolve({
|
|
189
|
+
theme,
|
|
190
|
+
selection,
|
|
191
|
+
states: {
|
|
192
|
+
disabled: isDisabled
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
const pressed = _chunkJ5COSALOcjs.selectRecipe.resolve({
|
|
196
|
+
theme,
|
|
197
|
+
selection,
|
|
198
|
+
states: {
|
|
199
|
+
pressed: true
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
const tint = color ? _chunkJ5COSALOcjs.selectRecipe.tint({
|
|
203
|
+
theme,
|
|
204
|
+
color,
|
|
205
|
+
selection
|
|
206
|
+
}) : void 0;
|
|
207
|
+
const own = autocompleteRecipe.resolve({
|
|
208
|
+
theme,
|
|
209
|
+
selection: {
|
|
210
|
+
size
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
const ownTint = color ? autocompleteRecipe.tint({
|
|
214
|
+
theme,
|
|
215
|
+
color,
|
|
216
|
+
selection: {
|
|
217
|
+
size
|
|
218
|
+
}
|
|
219
|
+
}) : void 0;
|
|
220
|
+
const open = _react.useCallback.call(void 0, () => setOpen(true), [setOpen]);
|
|
221
|
+
const close = _react.useCallback.call(void 0, () => {
|
|
222
|
+
setOpen(false);
|
|
223
|
+
setQueryState("");
|
|
224
|
+
}, [setOpen, setQueryState]);
|
|
225
|
+
const toggle = _react.useCallback.call(void 0, () => isOpen ? close() : open(), [close, isOpen, open]);
|
|
226
|
+
const select = _react.useCallback.call(void 0, (next, label) => {
|
|
227
|
+
if (label !== void 0) registerLabel(next, label);
|
|
228
|
+
setValue(next);
|
|
229
|
+
close();
|
|
230
|
+
}, [close, registerLabel, setValue]);
|
|
231
|
+
const context = _react.useMemo.call(void 0, () => {
|
|
232
|
+
const indicator = _reactnative.StyleSheet.flatten([styles.indicator, _optionalChain([tint, 'optionalAccess', _ => _.indicator])]);
|
|
233
|
+
const tintedPlaceholder = tint ? _reactnative.StyleSheet.flatten([tint.value]).color : void 0;
|
|
234
|
+
return {
|
|
235
|
+
triggerStyle: tint ? [styles.trigger, tint.trigger] : styles.trigger,
|
|
236
|
+
triggerPressedStyle: pressed.trigger,
|
|
237
|
+
valueStyle: tint ? [styles.value, tint.value] : styles.value,
|
|
238
|
+
placeholderStyle: tint ? [styles.placeholder, {
|
|
239
|
+
color: tintedPlaceholder
|
|
240
|
+
}] : styles.placeholder,
|
|
241
|
+
indicatorStyle: styles.indicator,
|
|
242
|
+
overlayStyle: styles.overlay,
|
|
243
|
+
contentStyle: styles.content,
|
|
244
|
+
searchStyle: ownTint ? [own.search, ownTint.search] : own.search,
|
|
245
|
+
emptyStyle: own.empty,
|
|
246
|
+
itemStyle: styles.item,
|
|
247
|
+
itemPressedStyle: pressed.item,
|
|
248
|
+
itemLabelStyle: styles.itemLabel,
|
|
249
|
+
glyph: {
|
|
250
|
+
size: indicator.fontSize,
|
|
251
|
+
color: typeof indicator.color === "string" ? indicator.color : void 0
|
|
252
|
+
},
|
|
253
|
+
placeholderColor: _reactnative.StyleSheet.flatten([styles.placeholder]).color,
|
|
254
|
+
value,
|
|
255
|
+
query,
|
|
256
|
+
setQuery: setQueryState,
|
|
257
|
+
isOpen,
|
|
258
|
+
isDisabled,
|
|
259
|
+
isInvalid,
|
|
260
|
+
open,
|
|
261
|
+
close,
|
|
262
|
+
toggle,
|
|
263
|
+
select,
|
|
264
|
+
anchor,
|
|
265
|
+
setAnchor,
|
|
266
|
+
labelFor,
|
|
267
|
+
registerLabel
|
|
268
|
+
};
|
|
269
|
+
}, [styles, pressed, tint, own, ownTint, value, query, setQueryState, isOpen, isDisabled, isInvalid, open, close, toggle, select, anchor, labelFor, registerLabel]);
|
|
270
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, AutocompleteProvider, {
|
|
271
|
+
value: context,
|
|
272
|
+
children
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
Autocomplete.displayName = "XAUI.Autocomplete.Root";
|
|
276
|
+
|
|
277
|
+
// src/components/autocomplete/autocomplete-content.tsx
|
|
278
|
+
|
|
279
|
+
var _reactnativereanimated = require('react-native-reanimated');
|
|
280
|
+
var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
281
|
+
|
|
282
|
+
// src/utils/filter-items.ts
|
|
283
|
+
|
|
284
|
+
function fold(text) {
|
|
285
|
+
return text.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
286
|
+
}
|
|
287
|
+
function matchesQuery(label, query) {
|
|
288
|
+
const needle = fold(query.trim());
|
|
289
|
+
return needle === "" || fold(label).includes(needle);
|
|
290
|
+
}
|
|
291
|
+
function filterItems(children, query, isItem2) {
|
|
292
|
+
const kept = [];
|
|
293
|
+
let matched = 0;
|
|
294
|
+
_react.Children.forEach(children, child => {
|
|
295
|
+
if (!_react.isValidElement.call(void 0, child) || !isItem2(child.type)) {
|
|
296
|
+
kept.push(child);
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const label = _chunkFJGPDWMScjs.readItemLabel.call(void 0, child.props);
|
|
300
|
+
if (label !== void 0 && !matchesQuery(label, query)) return;
|
|
301
|
+
matched += 1;
|
|
302
|
+
kept.push(child);
|
|
303
|
+
});
|
|
304
|
+
return {
|
|
305
|
+
children: kept,
|
|
306
|
+
matched
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// src/components/autocomplete/autocomplete-empty.tsx
|
|
311
|
+
|
|
312
|
+
var AutocompleteEmpty = _react.forwardRef.call(void 0, function AutocompleteEmpty2({
|
|
313
|
+
children,
|
|
314
|
+
style,
|
|
315
|
+
...props
|
|
316
|
+
}, ref) {
|
|
317
|
+
const {
|
|
318
|
+
emptyStyle
|
|
319
|
+
} = useAutocomplete();
|
|
320
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
321
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
|
|
322
|
+
ref,
|
|
323
|
+
...rest,
|
|
324
|
+
style: [emptyStyle, styleProps, style],
|
|
325
|
+
children
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
AutocompleteEmpty.displayName = "XAUI.Autocomplete.Empty";
|
|
329
|
+
|
|
330
|
+
// src/components/autocomplete/autocomplete-item.tsx
|
|
331
|
+
|
|
332
|
+
// src/components/autocomplete/autocomplete-item-label.tsx
|
|
333
|
+
|
|
334
|
+
var AutocompleteItemLabel = _react.forwardRef.call(void 0, function AutocompleteItemLabel2({
|
|
335
|
+
children,
|
|
336
|
+
style,
|
|
337
|
+
...props
|
|
338
|
+
}, ref) {
|
|
339
|
+
const {
|
|
340
|
+
itemLabelStyle
|
|
341
|
+
} = useAutocomplete();
|
|
342
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
343
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
|
|
344
|
+
ref,
|
|
345
|
+
...rest,
|
|
346
|
+
style: [itemLabelStyle, styleProps, style],
|
|
347
|
+
children
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
AutocompleteItemLabel.displayName = "XAUI.Autocomplete.ItemLabel";
|
|
351
|
+
|
|
352
|
+
// src/components/autocomplete/autocomplete-item.tsx
|
|
353
|
+
|
|
354
|
+
var AutocompleteItem = _react.forwardRef.call(void 0, function AutocompleteItem2({
|
|
355
|
+
value,
|
|
356
|
+
label,
|
|
357
|
+
children,
|
|
358
|
+
isDisabled = false,
|
|
359
|
+
asChild = false,
|
|
360
|
+
accessibilityRole = "menuitem",
|
|
361
|
+
accessibilityState,
|
|
362
|
+
style,
|
|
363
|
+
onPress,
|
|
364
|
+
onPressIn,
|
|
365
|
+
onPressOut,
|
|
366
|
+
...props
|
|
367
|
+
}, ref) {
|
|
368
|
+
const {
|
|
369
|
+
itemStyle,
|
|
370
|
+
itemPressedStyle,
|
|
371
|
+
value: selected,
|
|
372
|
+
isDisabled: isRootDisabled,
|
|
373
|
+
select
|
|
374
|
+
} = useAutocomplete();
|
|
375
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
376
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, {
|
|
377
|
+
onPressIn,
|
|
378
|
+
onPressOut
|
|
379
|
+
});
|
|
380
|
+
const isSelected = selected === value;
|
|
381
|
+
const disabled = isRootDisabled || isDisabled;
|
|
382
|
+
const handlePress = _react.useCallback.call(void 0, event => {
|
|
383
|
+
_optionalChain([onPress, 'optionalCall', _2 => _2(event)]);
|
|
384
|
+
select(value, _nullishCoalesce(_nullishCoalesce(label, () => _chunkFHNIGHN5cjs.childrenToString.call(void 0, children)), () => void 0));
|
|
385
|
+
}, [children, label, onPress, select, value]);
|
|
386
|
+
const context = _react.useMemo.call(void 0, () => ({
|
|
387
|
+
isSelected,
|
|
388
|
+
isPressed,
|
|
389
|
+
isDisabled: disabled
|
|
390
|
+
}), [isSelected, isPressed, disabled]);
|
|
391
|
+
const text = _chunkFHNIGHN5cjs.childrenToString.call(void 0, children);
|
|
392
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, AutocompleteItemProvider, {
|
|
393
|
+
value: context,
|
|
394
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkHBYT7B47cjs.PressableFeedback, {
|
|
395
|
+
ref,
|
|
396
|
+
isPressed,
|
|
397
|
+
isDisabled: disabled,
|
|
398
|
+
asChild,
|
|
399
|
+
accessibilityRole,
|
|
400
|
+
accessibilityState: {
|
|
401
|
+
disabled,
|
|
402
|
+
selected: isSelected,
|
|
403
|
+
...accessibilityState
|
|
404
|
+
},
|
|
405
|
+
...rest,
|
|
406
|
+
style: [itemStyle, isPressed && itemPressedStyle, styleProps, typeof style === "function" ? style({
|
|
407
|
+
pressed: isPressed
|
|
408
|
+
}) : style],
|
|
409
|
+
onPress: handlePress,
|
|
410
|
+
onPressIn: press.onPressIn,
|
|
411
|
+
onPressOut: press.onPressOut,
|
|
412
|
+
children: text !== null ? /* @__PURE__ */_jsxruntime.jsx.call(void 0, AutocompleteItemLabel, {
|
|
413
|
+
children: text
|
|
414
|
+
}) : children
|
|
415
|
+
})
|
|
416
|
+
});
|
|
417
|
+
});
|
|
418
|
+
AutocompleteItem.displayName = "XAUI.Autocomplete.Item";
|
|
419
|
+
|
|
420
|
+
// src/components/autocomplete/autocomplete-search.tsx
|
|
421
|
+
|
|
422
|
+
var AutocompleteSearch = _react.forwardRef.call(void 0, function AutocompleteSearch2({
|
|
423
|
+
autoFocus = true,
|
|
424
|
+
style,
|
|
425
|
+
...props
|
|
426
|
+
}, ref) {
|
|
427
|
+
const {
|
|
428
|
+
searchStyle,
|
|
429
|
+
placeholderColor,
|
|
430
|
+
query,
|
|
431
|
+
setQuery,
|
|
432
|
+
isDisabled
|
|
433
|
+
} = useAutocomplete();
|
|
434
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
435
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.TextInput, {
|
|
436
|
+
ref,
|
|
437
|
+
value: query,
|
|
438
|
+
onChangeText: setQuery,
|
|
439
|
+
autoFocus,
|
|
440
|
+
editable: !isDisabled,
|
|
441
|
+
autoCorrect: false,
|
|
442
|
+
autoCapitalize: "none",
|
|
443
|
+
placeholderTextColor: placeholderColor,
|
|
444
|
+
accessibilityRole: "search",
|
|
445
|
+
...rest,
|
|
446
|
+
style: [searchStyle, styleProps, style]
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
AutocompleteSearch.displayName = "XAUI.Autocomplete.Search";
|
|
450
|
+
|
|
451
|
+
// src/components/autocomplete/autocomplete-content.tsx
|
|
452
|
+
|
|
453
|
+
var DEFAULT_OFFSET = 8;
|
|
454
|
+
var DEFAULT_INSETS = {
|
|
455
|
+
top: 12,
|
|
456
|
+
bottom: 12,
|
|
457
|
+
start: 12,
|
|
458
|
+
end: 12
|
|
459
|
+
};
|
|
460
|
+
var isItem = type => type === AutocompleteItem;
|
|
461
|
+
var isSearch = type => type === AutocompleteSearch;
|
|
462
|
+
var isEmpty = type => type === AutocompleteEmpty;
|
|
463
|
+
var AutocompleteContent = _react.forwardRef.call(void 0, function AutocompleteContent2({
|
|
464
|
+
children,
|
|
465
|
+
placement = "bottom",
|
|
466
|
+
align = "center",
|
|
467
|
+
width = "trigger",
|
|
468
|
+
offset = DEFAULT_OFFSET,
|
|
469
|
+
alignOffset = 0,
|
|
470
|
+
avoidCollisions = true,
|
|
471
|
+
insets,
|
|
472
|
+
style,
|
|
473
|
+
onLayout,
|
|
474
|
+
...props
|
|
475
|
+
}, ref) {
|
|
476
|
+
const context = useAutocomplete();
|
|
477
|
+
const {
|
|
478
|
+
contentStyle,
|
|
479
|
+
isOpen,
|
|
480
|
+
anchor,
|
|
481
|
+
query,
|
|
482
|
+
registerLabel
|
|
483
|
+
} = context;
|
|
484
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
485
|
+
const {
|
|
486
|
+
position,
|
|
487
|
+
onContentLayout,
|
|
488
|
+
measuringStyle
|
|
489
|
+
} = _chunkYVYYONTPcjs.useAnchoredPosition.call(void 0, {
|
|
490
|
+
anchor,
|
|
491
|
+
isOpen,
|
|
492
|
+
placement,
|
|
493
|
+
align,
|
|
494
|
+
width,
|
|
495
|
+
offset,
|
|
496
|
+
alignOffset,
|
|
497
|
+
avoidCollisions,
|
|
498
|
+
insets: {
|
|
499
|
+
...DEFAULT_INSETS,
|
|
500
|
+
...insets
|
|
501
|
+
},
|
|
502
|
+
onLayout
|
|
503
|
+
});
|
|
504
|
+
_react.useEffect.call(void 0, () => {
|
|
505
|
+
for (const [value, label] of _chunkFJGPDWMScjs.collectItemLabels.call(void 0, children, isItem)) {
|
|
506
|
+
registerLabel(value, label);
|
|
507
|
+
}
|
|
508
|
+
}, [children, registerLabel]);
|
|
509
|
+
const {
|
|
510
|
+
search,
|
|
511
|
+
empty,
|
|
512
|
+
rest: listed
|
|
513
|
+
} = _react.useMemo.call(void 0, () => partition(children), [children]);
|
|
514
|
+
const {
|
|
515
|
+
children: results,
|
|
516
|
+
matched
|
|
517
|
+
} = _react.useMemo.call(void 0, () => filterItems(listed, query, isItem), [listed, query]);
|
|
518
|
+
if (!isOpen || anchor === null) return null;
|
|
519
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, {
|
|
520
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, AutocompleteProvider, {
|
|
521
|
+
value: context,
|
|
522
|
+
children: /* @__PURE__ */_jsxruntime.jsxs.call(void 0, _reactnativereanimated2.default.View, {
|
|
523
|
+
ref,
|
|
524
|
+
entering: position ? _chunkEKS3W46Mcjs.anchoredEntering.call(void 0, position.placement) : void 0,
|
|
525
|
+
exiting: position ? _chunkEKS3W46Mcjs.anchoredExiting.call(void 0, position.placement) : void 0,
|
|
526
|
+
onLayout: onContentLayout,
|
|
527
|
+
...rest,
|
|
528
|
+
style: [contentStyle, position === null ? measuringStyle : {
|
|
529
|
+
top: position.top,
|
|
530
|
+
start: position.start,
|
|
531
|
+
width: position.width,
|
|
532
|
+
maxHeight: position.maxHeight
|
|
533
|
+
}, styleProps, style],
|
|
534
|
+
children: [search, /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.ScrollView, {
|
|
535
|
+
bounces: false,
|
|
536
|
+
keyboardShouldPersistTaps: "handled",
|
|
537
|
+
showsVerticalScrollIndicator: false,
|
|
538
|
+
children: matched === 0 && empty !== null ? empty : results
|
|
539
|
+
})]
|
|
540
|
+
}, _nullishCoalesce(_optionalChain([position, 'optionalAccess', _3 => _3.placement]), () => "measuring"))
|
|
541
|
+
})
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
AutocompleteContent.displayName = "XAUI.Autocomplete.Content";
|
|
545
|
+
function partition(children) {
|
|
546
|
+
let search = null;
|
|
547
|
+
let empty = null;
|
|
548
|
+
const rest = [];
|
|
549
|
+
_react.Children.forEach(children, child => {
|
|
550
|
+
if (_react.isValidElement.call(void 0, child) && isSearch(child.type)) {
|
|
551
|
+
search = child;
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
if (_react.isValidElement.call(void 0, child) && isEmpty(child.type)) {
|
|
555
|
+
empty = child;
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
rest.push(child);
|
|
559
|
+
});
|
|
560
|
+
return {
|
|
561
|
+
search,
|
|
562
|
+
empty,
|
|
563
|
+
rest
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// src/components/autocomplete/autocomplete-indicator.tsx
|
|
568
|
+
const _worklet_1062027869941_init_data = {
|
|
569
|
+
code: "function chunkMNBEUNC5Cjs1(){const{_reactnativereanimated,progress,_chunkEKS3W46Mcjs}=this.__closure;return{transform:[{rotate:_reactnativereanimated.interpolate.call(void 0,progress.get(),[0,1],[_chunkEKS3W46Mcjs.INDICATOR_ROTATION[0],_chunkEKS3W46Mcjs.INDICATOR_ROTATION[1]])+\"deg\"}]};}",
|
|
570
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-MNBEUNC5.cjs",
|
|
571
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkMNBEUNC5Cjs1\",\"_reactnativereanimated\",\"progress\",\"_chunkEKS3W46Mcjs\",\"__closure\",\"transform\",\"rotate\",\"interpolate\",\"call\",\"get\",\"INDICATOR_ROTATION\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-MNBEUNC5.cjs\"],\"mappings\":\"AA4hBwE,SAAAA,iBAAMA,CAAA,QAAAC,sBAAA,CAAAC,QAAA,CAAAC,iBAAA,OAAAC,SAAA,CAE1E,MAAO,CACLC,SAAS,CAAE,CACT,CACEC,MAAM,CAAKL,sBAAsB,CAACM,WAAW,CAACC,IAAI,CAAC,IAAK,EAAC,CAAEN,QAAQ,CAACO,GAAG,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAACN,iBAAiB,CAACO,kBAAkB,CAAC,CAAC,CAAC,CAAEP,iBAAiB,CAACO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,MACxK,CAAC,CAEL,CAAC,CACH\",\"ignoreList\":[]}"
|
|
572
|
+
};
|
|
573
|
+
function AutocompleteIndicator(props) {
|
|
574
|
+
const {
|
|
575
|
+
as = _chunkGSZDN6EZcjs.ChevronDownIcon
|
|
576
|
+
} = props;
|
|
577
|
+
const {
|
|
578
|
+
indicatorStyle,
|
|
579
|
+
isOpen
|
|
580
|
+
} = useAutocomplete();
|
|
581
|
+
const progress = _reactnativereanimated.useSharedValue.call(void 0, isOpen ? 1 : 0);
|
|
582
|
+
_react.useEffect.call(void 0, () => {
|
|
583
|
+
progress.set(_reactnativereanimated.withSpring.call(void 0, isOpen ? 1 : 0, _chunkEKS3W46Mcjs.INDICATOR_SPRING));
|
|
584
|
+
}, [isOpen, progress]);
|
|
585
|
+
const rotation = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkMNBEUNC5Cjs1Factory({
|
|
586
|
+
_worklet_1062027869941_init_data,
|
|
587
|
+
_reactnativereanimated,
|
|
588
|
+
progress,
|
|
589
|
+
_chunkEKS3W46Mcjs
|
|
590
|
+
}) {
|
|
591
|
+
const _e = [new global.Error(), -4, -27];
|
|
592
|
+
const chunkMNBEUNC5Cjs1 = function () {
|
|
593
|
+
return {
|
|
594
|
+
transform: [{
|
|
595
|
+
rotate: `${_reactnativereanimated.interpolate.call(void 0, progress.get(), [0, 1], [_chunkEKS3W46Mcjs.INDICATOR_ROTATION[0], _chunkEKS3W46Mcjs.INDICATOR_ROTATION[1]])}deg`
|
|
596
|
+
}]
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
chunkMNBEUNC5Cjs1.__closure = {
|
|
600
|
+
_reactnativereanimated,
|
|
601
|
+
progress,
|
|
602
|
+
_chunkEKS3W46Mcjs
|
|
603
|
+
};
|
|
604
|
+
chunkMNBEUNC5Cjs1.__workletHash = 1062027869941;
|
|
605
|
+
chunkMNBEUNC5Cjs1.__pluginVersion = "0.7.4";
|
|
606
|
+
chunkMNBEUNC5Cjs1.__initData = _worklet_1062027869941_init_data;
|
|
607
|
+
chunkMNBEUNC5Cjs1.__stackDetails = _e;
|
|
608
|
+
return chunkMNBEUNC5Cjs1;
|
|
609
|
+
}({
|
|
610
|
+
_worklet_1062027869941_init_data,
|
|
611
|
+
_reactnativereanimated,
|
|
612
|
+
progress,
|
|
613
|
+
_chunkEKS3W46Mcjs
|
|
614
|
+
}), [progress]);
|
|
615
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
|
|
616
|
+
style: [indicatorStyle, rotation],
|
|
617
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkGSZDN6EZcjs.Icon, {
|
|
618
|
+
as
|
|
619
|
+
})
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
AutocompleteIndicator.displayName = "XAUI.Autocomplete.Indicator";
|
|
623
|
+
|
|
624
|
+
// src/components/autocomplete/autocomplete-overlay.tsx
|
|
625
|
+
|
|
626
|
+
var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
|
|
627
|
+
var AutocompleteOverlay = _react.forwardRef.call(void 0, function AutocompleteOverlay2({
|
|
628
|
+
children,
|
|
629
|
+
style,
|
|
630
|
+
...props
|
|
631
|
+
}, ref) {
|
|
632
|
+
const context = useAutocomplete();
|
|
633
|
+
const {
|
|
634
|
+
overlayStyle,
|
|
635
|
+
isOpen,
|
|
636
|
+
close
|
|
637
|
+
} = context;
|
|
638
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
639
|
+
if (!isOpen) return null;
|
|
640
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, {
|
|
641
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, AutocompleteProvider, {
|
|
642
|
+
value: context,
|
|
643
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, AnimatedPressable, {
|
|
644
|
+
ref,
|
|
645
|
+
entering: _chunkEKS3W46Mcjs.overlayEntering,
|
|
646
|
+
exiting: _chunkEKS3W46Mcjs.overlayExiting,
|
|
647
|
+
accessibilityRole: "none",
|
|
648
|
+
importantForAccessibility: "no",
|
|
649
|
+
onPress: close,
|
|
650
|
+
...rest,
|
|
651
|
+
style: [overlayStyle, styleProps, style],
|
|
652
|
+
children
|
|
653
|
+
})
|
|
654
|
+
})
|
|
655
|
+
});
|
|
656
|
+
});
|
|
657
|
+
AutocompleteOverlay.displayName = "XAUI.Autocomplete.Overlay";
|
|
658
|
+
|
|
659
|
+
// src/components/autocomplete/autocomplete-trigger.tsx
|
|
660
|
+
|
|
661
|
+
var AutocompleteTrigger = _react.forwardRef.call(void 0, function AutocompleteTrigger2({
|
|
662
|
+
children,
|
|
663
|
+
asChild = false,
|
|
664
|
+
accessibilityRole = "combobox",
|
|
665
|
+
accessibilityState,
|
|
666
|
+
style,
|
|
667
|
+
onLayout,
|
|
668
|
+
onPressIn,
|
|
669
|
+
onPressOut,
|
|
670
|
+
onPress,
|
|
671
|
+
...props
|
|
672
|
+
}, ref) {
|
|
673
|
+
const {
|
|
674
|
+
triggerStyle,
|
|
675
|
+
triggerPressedStyle,
|
|
676
|
+
glyph,
|
|
677
|
+
isOpen,
|
|
678
|
+
isDisabled,
|
|
679
|
+
isInvalid,
|
|
680
|
+
toggle,
|
|
681
|
+
setAnchor
|
|
682
|
+
} = useAutocomplete();
|
|
683
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
684
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, {
|
|
685
|
+
onPressIn,
|
|
686
|
+
onPressOut
|
|
687
|
+
});
|
|
688
|
+
const node = _react.useRef.call(void 0, null);
|
|
689
|
+
const refs = _chunkWFEMJCXOcjs.useMergedRef.call(void 0, node, ref);
|
|
690
|
+
const measure = _react.useCallback.call(void 0, () => {
|
|
691
|
+
_optionalChain([node, 'access', _4 => _4.current, 'optionalAccess', _5 => _5.measureInWindow, 'call', _6 => _6((x, y, width, height) => {
|
|
692
|
+
setAnchor({
|
|
693
|
+
x,
|
|
694
|
+
y,
|
|
695
|
+
width,
|
|
696
|
+
height
|
|
697
|
+
});
|
|
698
|
+
})]);
|
|
699
|
+
}, [setAnchor]);
|
|
700
|
+
const handleLayout = _react.useCallback.call(void 0, event => {
|
|
701
|
+
_optionalChain([onLayout, 'optionalCall', _7 => _7(event)]);
|
|
702
|
+
measure();
|
|
703
|
+
}, [measure, onLayout]);
|
|
704
|
+
_react.useEffect.call(void 0, () => {
|
|
705
|
+
if (isOpen) measure();
|
|
706
|
+
}, [isOpen, measure]);
|
|
707
|
+
const handlePress = _react.useCallback.call(void 0, event => {
|
|
708
|
+
_optionalChain([onPress, 'optionalCall', _8 => _8(event)]);
|
|
709
|
+
measure();
|
|
710
|
+
toggle();
|
|
711
|
+
}, [measure, onPress, toggle]);
|
|
712
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkGSZDN6EZcjs.IconContext.Provider, {
|
|
713
|
+
value: glyph,
|
|
714
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkHBYT7B47cjs.PressableFeedback, {
|
|
715
|
+
ref: refs,
|
|
716
|
+
isPressed,
|
|
717
|
+
isDisabled,
|
|
718
|
+
asChild,
|
|
719
|
+
accessibilityRole,
|
|
720
|
+
accessibilityState: {
|
|
721
|
+
disabled: isDisabled,
|
|
722
|
+
expanded: isOpen,
|
|
723
|
+
...accessibilityState
|
|
724
|
+
},
|
|
725
|
+
"aria-invalid": isInvalid || void 0,
|
|
726
|
+
...rest,
|
|
727
|
+
onLayout: handleLayout,
|
|
728
|
+
style: [triggerStyle, isPressed && triggerPressedStyle, styleProps, typeof style === "function" ? style({
|
|
729
|
+
pressed: isPressed
|
|
730
|
+
}) : style],
|
|
731
|
+
onPress: handlePress,
|
|
732
|
+
onPressIn: press.onPressIn,
|
|
733
|
+
onPressOut: press.onPressOut,
|
|
734
|
+
children
|
|
735
|
+
})
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
AutocompleteTrigger.displayName = "XAUI.Autocomplete.Trigger";
|
|
739
|
+
|
|
740
|
+
// src/components/autocomplete/autocomplete-value.tsx
|
|
741
|
+
|
|
742
|
+
var AutocompleteValue = _react.forwardRef.call(void 0, function AutocompleteValue2({
|
|
743
|
+
children,
|
|
744
|
+
placeholder,
|
|
745
|
+
style,
|
|
746
|
+
...props
|
|
747
|
+
}, ref) {
|
|
748
|
+
const {
|
|
749
|
+
valueStyle,
|
|
750
|
+
placeholderStyle,
|
|
751
|
+
value,
|
|
752
|
+
labelFor
|
|
753
|
+
} = useAutocomplete();
|
|
754
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
755
|
+
const label = _nullishCoalesce(children, () => value === void 0 ? void 0 : labelFor(value));
|
|
756
|
+
const isEmpty2 = label === void 0 || label === null;
|
|
757
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
|
|
758
|
+
ref,
|
|
759
|
+
numberOfLines: 1,
|
|
760
|
+
...rest,
|
|
761
|
+
style: [isEmpty2 ? placeholderStyle : valueStyle, styleProps, style],
|
|
762
|
+
children: isEmpty2 ? placeholder : label
|
|
763
|
+
});
|
|
764
|
+
});
|
|
765
|
+
AutocompleteValue.displayName = "XAUI.Autocomplete.Value";
|
|
766
|
+
|
|
767
|
+
// src/components/autocomplete/index.ts
|
|
768
|
+
var Autocomplete2 = Object.assign(Autocomplete, {
|
|
769
|
+
Trigger: AutocompleteTrigger,
|
|
770
|
+
Value: AutocompleteValue,
|
|
771
|
+
Indicator: AutocompleteIndicator,
|
|
772
|
+
Overlay: AutocompleteOverlay,
|
|
773
|
+
Content: AutocompleteContent,
|
|
774
|
+
Search: AutocompleteSearch,
|
|
775
|
+
Item: AutocompleteItem,
|
|
776
|
+
ItemLabel: AutocompleteItemLabel,
|
|
777
|
+
Empty: AutocompleteEmpty
|
|
778
|
+
});
|
|
779
|
+
exports.useAutocomplete = useAutocomplete;
|
|
780
|
+
exports.useAutocompleteItem = useAutocompleteItem;
|
|
781
|
+
exports.autocompleteRecipe = autocompleteRecipe;
|
|
782
|
+
exports.Autocomplete = Autocomplete;
|
|
783
|
+
exports.AutocompleteEmpty = AutocompleteEmpty;
|
|
784
|
+
exports.AutocompleteItemLabel = AutocompleteItemLabel;
|
|
785
|
+
exports.AutocompleteItem = AutocompleteItem;
|
|
786
|
+
exports.AutocompleteSearch = AutocompleteSearch;
|
|
787
|
+
exports.AutocompleteContent = AutocompleteContent;
|
|
788
|
+
exports.AutocompleteIndicator = AutocompleteIndicator;
|
|
789
|
+
exports.AutocompleteOverlay = AutocompleteOverlay;
|
|
790
|
+
exports.AutocompleteTrigger = AutocompleteTrigger;
|
|
791
|
+
exports.AutocompleteValue = AutocompleteValue;
|
|
792
|
+
exports.Autocomplete2 = Autocomplete2;
|