@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,662 @@
|
|
|
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 _chunkWDDXU3OHcjs = require('./chunk-WDDXU3OH.cjs');
|
|
40
|
+
var _chunkEKS3W46Mcjs = require('./chunk-EKS3W46M.cjs');
|
|
41
|
+
var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
|
|
42
|
+
var _chunkHBYT7B47cjs = require('./chunk-HBYT7B47.cjs');
|
|
43
|
+
var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
|
|
44
|
+
var _chunkSL3V7R2Ycjs = require('./chunk-SL3V7R2Y.cjs');
|
|
45
|
+
var _chunkCDRGTUYFcjs = require('./chunk-CDRGTUYF.cjs');
|
|
46
|
+
var _chunkEJQCQPETcjs = require('./chunk-EJQCQPET.cjs');
|
|
47
|
+
var _chunkIIAQISBGcjs = require('./chunk-IIAQISBG.cjs');
|
|
48
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
49
|
+
|
|
50
|
+
// src/components/bottom-sheet/bottom-sheet-close.tsx
|
|
51
|
+
var _react = require('react');
|
|
52
|
+
|
|
53
|
+
// src/components/bottom-sheet/bottom-sheet.context.ts
|
|
54
|
+
var [BottomSheetProvider, useBottomSheet] = _chunkCDRGTUYFcjs.createSlotContext.call(void 0, "BottomSheet");
|
|
55
|
+
|
|
56
|
+
// src/components/bottom-sheet/bottom-sheet-close.tsx
|
|
57
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
58
|
+
var BottomSheetClose = _react.forwardRef.call(void 0, function BottomSheetClose2({
|
|
59
|
+
children,
|
|
60
|
+
asChild = false,
|
|
61
|
+
accessibilityRole = "button",
|
|
62
|
+
style,
|
|
63
|
+
onPress,
|
|
64
|
+
onPressIn,
|
|
65
|
+
onPressOut,
|
|
66
|
+
...props
|
|
67
|
+
}, ref) {
|
|
68
|
+
const {
|
|
69
|
+
close
|
|
70
|
+
} = useBottomSheet();
|
|
71
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
72
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, {
|
|
73
|
+
onPressIn,
|
|
74
|
+
onPressOut
|
|
75
|
+
});
|
|
76
|
+
const handlePress = _react.useCallback.call(void 0, event => {
|
|
77
|
+
_optionalChain([onPress, 'optionalCall', _ => _(event)]);
|
|
78
|
+
close();
|
|
79
|
+
}, [close, onPress]);
|
|
80
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkHBYT7B47cjs.PressableFeedback, {
|
|
81
|
+
ref,
|
|
82
|
+
isPressed,
|
|
83
|
+
asChild,
|
|
84
|
+
accessibilityRole,
|
|
85
|
+
...rest,
|
|
86
|
+
style: [styleProps, typeof style === "function" ? style({
|
|
87
|
+
pressed: isPressed
|
|
88
|
+
}) : style],
|
|
89
|
+
onPress: handlePress,
|
|
90
|
+
onPressIn: press.onPressIn,
|
|
91
|
+
onPressOut: press.onPressOut,
|
|
92
|
+
children
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
BottomSheetClose.displayName = "XAUI.BottomSheet.Close";
|
|
96
|
+
|
|
97
|
+
// src/components/bottom-sheet/bottom-sheet-content.tsx
|
|
98
|
+
|
|
99
|
+
var _reactnative = require('react-native');
|
|
100
|
+
var _reactnativegesturehandler = require('react-native-gesture-handler');
|
|
101
|
+
var _reactnativereanimated = require('react-native-reanimated');
|
|
102
|
+
var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
103
|
+
|
|
104
|
+
// src/components/bottom-sheet/bottom-sheet.animation.ts
|
|
105
|
+
var SHEET_SPRING = {
|
|
106
|
+
damping: 28,
|
|
107
|
+
stiffness: 260,
|
|
108
|
+
mass: 0.9
|
|
109
|
+
};
|
|
110
|
+
var DISMISS_VELOCITY = 900;
|
|
111
|
+
var THROW_PROJECTION = 0.15;
|
|
112
|
+
|
|
113
|
+
// src/components/bottom-sheet/bottom-sheet.utils.ts
|
|
114
|
+
function sheetOffset(state, geometry) {
|
|
115
|
+
const {
|
|
116
|
+
height,
|
|
117
|
+
collapsedHeight
|
|
118
|
+
} = geometry;
|
|
119
|
+
if (state === "closed") return height;
|
|
120
|
+
if (state === "expanded" || collapsedHeight === void 0) return 0;
|
|
121
|
+
return Math.max(height - collapsedHeight, 0);
|
|
122
|
+
}
|
|
123
|
+
function paddingUnderSeam(style) {
|
|
124
|
+
const value = _nullishCoalesce(_nullishCoalesce(style.paddingBottom, () => style.paddingVertical), () => style.padding);
|
|
125
|
+
return typeof value === "number" ? value : 0;
|
|
126
|
+
}
|
|
127
|
+
function collapsedExtent(summaryExtent, paddingBottom, collapsedHeight) {
|
|
128
|
+
if (summaryExtent === void 0) return collapsedHeight;
|
|
129
|
+
return summaryExtent + paddingBottom;
|
|
130
|
+
}
|
|
131
|
+
function nextSheetState(release, geometry) {
|
|
132
|
+
const {
|
|
133
|
+
from,
|
|
134
|
+
translationY,
|
|
135
|
+
velocityY,
|
|
136
|
+
projection
|
|
137
|
+
} = release;
|
|
138
|
+
const {
|
|
139
|
+
height,
|
|
140
|
+
collapsedHeight
|
|
141
|
+
} = geometry;
|
|
142
|
+
const farEnough = Math.abs(translationY) > height * release.dismissThreshold;
|
|
143
|
+
const fastEnough = Math.abs(velocityY) > release.dismissVelocity;
|
|
144
|
+
if (!farEnough && !fastEnough) return from;
|
|
145
|
+
if (translationY < 0) return "expanded";
|
|
146
|
+
if (collapsedHeight === void 0) return "closed";
|
|
147
|
+
if (from === "collapsed") return "closed";
|
|
148
|
+
const released = sheetOffset(from, geometry) + translationY;
|
|
149
|
+
const projected = released + velocityY * projection;
|
|
150
|
+
const collapsed = sheetOffset("collapsed", geometry);
|
|
151
|
+
return projected > collapsed + (height - collapsed) / 2 ? "closed" : "collapsed";
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/components/bottom-sheet/bottom-sheet-content.tsx
|
|
155
|
+
const _worklet_16151354902767_init_data = {
|
|
156
|
+
code: "function chunkX6GT4H4ICjs1(){const{offset}=this.__closure;return{transform:[{translateY:offset.get()}]};}",
|
|
157
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-X6GT4H4I.cjs",
|
|
158
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkX6GT4H4ICjs1\",\"offset\",\"__closure\",\"transform\",\"translateY\",\"get\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-X6GT4H4I.cjs\"],\"mappings\":\"AAuNqE,SAAAA,iBAAMA,CAAA,QAAAC,MAAA,OAAAC,SAAA,CAEvE,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,MAAM,CAACI,GAAG,CAAC,CAAE,CAAC,CAAE,CAAC,CACtD\",\"ignoreList\":[]}"
|
|
159
|
+
};
|
|
160
|
+
function BottomSheetContent({
|
|
161
|
+
children,
|
|
162
|
+
isSwipeable = true,
|
|
163
|
+
accessibilityViewIsModal = true,
|
|
164
|
+
style,
|
|
165
|
+
onLayout,
|
|
166
|
+
...props
|
|
167
|
+
}) {
|
|
168
|
+
const context = useBottomSheet();
|
|
169
|
+
const {
|
|
170
|
+
contentStyle,
|
|
171
|
+
isOpen,
|
|
172
|
+
dismissThreshold,
|
|
173
|
+
collapsedHeight,
|
|
174
|
+
isExpanded,
|
|
175
|
+
close,
|
|
176
|
+
expand,
|
|
177
|
+
collapse,
|
|
178
|
+
setPaddingBottom
|
|
179
|
+
} = context;
|
|
180
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
181
|
+
const [height, setHeight] = _react.useState.call(void 0, 0);
|
|
182
|
+
const offset = _reactnativereanimated.useSharedValue.call(void 0, OFFSCREEN);
|
|
183
|
+
const measure = _react.useCallback.call(void 0, event => {
|
|
184
|
+
_optionalChain([onLayout, 'optionalCall', _2 => _2(event)]);
|
|
185
|
+
setHeight(event.nativeEvent.layout.height);
|
|
186
|
+
}, [onLayout]);
|
|
187
|
+
const paddingBottom = _react.useMemo.call(void 0, () => paddingUnderSeam(_reactnative.StyleSheet.flatten([contentStyle, styleProps, style])), [contentStyle, style, styleProps]);
|
|
188
|
+
_react.useEffect.call(void 0, () => {
|
|
189
|
+
setPaddingBottom(paddingBottom);
|
|
190
|
+
}, [paddingBottom, setPaddingBottom]);
|
|
191
|
+
const geometry = _react.useMemo.call(void 0, () => ({
|
|
192
|
+
height,
|
|
193
|
+
collapsedHeight
|
|
194
|
+
}), [height, collapsedHeight]);
|
|
195
|
+
const resting = isOpen ? isExpanded ? "expanded" : "collapsed" : "closed";
|
|
196
|
+
_react.useEffect.call(void 0, () => {
|
|
197
|
+
if (height === 0) return;
|
|
198
|
+
offset.set(_reactnativereanimated.withSpring.call(void 0, sheetOffset(resting, geometry), SHEET_SPRING));
|
|
199
|
+
}, [geometry, height, offset, resting]);
|
|
200
|
+
const release = _react.useCallback.call(void 0, (translationY, velocityY) => {
|
|
201
|
+
const next = nextSheetState({
|
|
202
|
+
from: isExpanded ? "expanded" : "collapsed",
|
|
203
|
+
translationY,
|
|
204
|
+
velocityY,
|
|
205
|
+
projection: THROW_PROJECTION,
|
|
206
|
+
dismissThreshold,
|
|
207
|
+
dismissVelocity: DISMISS_VELOCITY
|
|
208
|
+
}, geometry);
|
|
209
|
+
if (next === resting) {
|
|
210
|
+
offset.set(_reactnativereanimated.withSpring.call(void 0, sheetOffset(resting, geometry), SHEET_SPRING));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (next === "closed") return close();
|
|
214
|
+
if (next === "collapsed") return collapse();
|
|
215
|
+
expand();
|
|
216
|
+
}, [close, collapse, dismissThreshold, expand, geometry, isExpanded, offset, resting]);
|
|
217
|
+
const restingOffset = sheetOffset(resting, geometry);
|
|
218
|
+
const pan = _reactnativegesturehandler.Gesture.Pan().enabled(isSwipeable).onUpdate(event => {
|
|
219
|
+
offset.set(Math.max(restingOffset + event.translationY, 0));
|
|
220
|
+
}).onEnd(event => {
|
|
221
|
+
_reactnativereanimated.runOnJS.call(void 0, release)(event.translationY, event.velocityY);
|
|
222
|
+
});
|
|
223
|
+
const slide = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkX6GT4H4ICjs1Factory({
|
|
224
|
+
_worklet_16151354902767_init_data,
|
|
225
|
+
offset
|
|
226
|
+
}) {
|
|
227
|
+
const _e = [new global.Error(), -2, -27];
|
|
228
|
+
const chunkX6GT4H4ICjs1 = function () {
|
|
229
|
+
return {
|
|
230
|
+
transform: [{
|
|
231
|
+
translateY: offset.get()
|
|
232
|
+
}]
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
chunkX6GT4H4ICjs1.__closure = {
|
|
236
|
+
offset
|
|
237
|
+
};
|
|
238
|
+
chunkX6GT4H4ICjs1.__workletHash = 16151354902767;
|
|
239
|
+
chunkX6GT4H4ICjs1.__pluginVersion = "0.7.4";
|
|
240
|
+
chunkX6GT4H4ICjs1.__initData = _worklet_16151354902767_init_data;
|
|
241
|
+
chunkX6GT4H4ICjs1.__stackDetails = _e;
|
|
242
|
+
return chunkX6GT4H4ICjs1;
|
|
243
|
+
}({
|
|
244
|
+
_worklet_16151354902767_init_data,
|
|
245
|
+
offset
|
|
246
|
+
}), [offset]);
|
|
247
|
+
if (!isOpen) return null;
|
|
248
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, {
|
|
249
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, BottomSheetProvider, {
|
|
250
|
+
value: context,
|
|
251
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativegesturehandler.GestureDetector, {
|
|
252
|
+
gesture: pan,
|
|
253
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
|
|
254
|
+
accessibilityViewIsModal,
|
|
255
|
+
onLayout: measure,
|
|
256
|
+
...rest,
|
|
257
|
+
style: [contentStyle, slide, styleProps, style],
|
|
258
|
+
children
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
var OFFSCREEN = 2e3;
|
|
265
|
+
BottomSheetContent.displayName = "XAUI.BottomSheet.Content";
|
|
266
|
+
|
|
267
|
+
// src/components/bottom-sheet/bottom-sheet-description.tsx
|
|
268
|
+
|
|
269
|
+
var BottomSheetDescription = _react.forwardRef.call(void 0, function BottomSheetDescription2({
|
|
270
|
+
children,
|
|
271
|
+
style,
|
|
272
|
+
...props
|
|
273
|
+
}, ref) {
|
|
274
|
+
const {
|
|
275
|
+
descriptionStyle
|
|
276
|
+
} = useBottomSheet();
|
|
277
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
278
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
|
|
279
|
+
ref,
|
|
280
|
+
...rest,
|
|
281
|
+
style: [descriptionStyle, styleProps, style],
|
|
282
|
+
children
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
BottomSheetDescription.displayName = "XAUI.BottomSheet.Description";
|
|
286
|
+
|
|
287
|
+
// src/components/bottom-sheet/bottom-sheet-handle.tsx
|
|
288
|
+
|
|
289
|
+
var BottomSheetHandle = _react.forwardRef.call(void 0, function BottomSheetHandle2({
|
|
290
|
+
accessibilityRole = "button",
|
|
291
|
+
style,
|
|
292
|
+
onPress,
|
|
293
|
+
onPressIn,
|
|
294
|
+
onPressOut,
|
|
295
|
+
...props
|
|
296
|
+
}, ref) {
|
|
297
|
+
const {
|
|
298
|
+
handleStyle,
|
|
299
|
+
isCollapsible,
|
|
300
|
+
isExpanded,
|
|
301
|
+
toggleExpanded
|
|
302
|
+
} = useBottomSheet();
|
|
303
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
304
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, {
|
|
305
|
+
onPressIn,
|
|
306
|
+
onPressOut
|
|
307
|
+
});
|
|
308
|
+
const handlePress = _react.useCallback.call(void 0, event => {
|
|
309
|
+
_optionalChain([onPress, 'optionalCall', _3 => _3(event)]);
|
|
310
|
+
toggleExpanded();
|
|
311
|
+
}, [onPress, toggleExpanded]);
|
|
312
|
+
if (!isCollapsible) {
|
|
313
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
|
|
314
|
+
ref,
|
|
315
|
+
accessibilityElementsHidden: true,
|
|
316
|
+
importantForAccessibility: "no-hide-descendants",
|
|
317
|
+
...rest,
|
|
318
|
+
style: [handleStyle, styleProps, typeof style === "function" ? style({
|
|
319
|
+
pressed: false
|
|
320
|
+
}) : style]
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
if (!rest.accessibilityLabel && !rest["aria-label"]) {
|
|
324
|
+
_chunkEJQCQPETcjs.warnDev.call(void 0, "BottomSheet.Handle: a collapsible sheet needs an `accessibilityLabel` on its handle \u2014 it is the control that reduces and restores the sheet, and a pill says nothing to someone who cannot see it.");
|
|
325
|
+
}
|
|
326
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkHBYT7B47cjs.PressableFeedback, {
|
|
327
|
+
ref,
|
|
328
|
+
isPressed,
|
|
329
|
+
accessibilityRole,
|
|
330
|
+
accessibilityState: {
|
|
331
|
+
expanded: isExpanded
|
|
332
|
+
},
|
|
333
|
+
...rest,
|
|
334
|
+
style: [handleStyle, styleProps, typeof style === "function" ? style({
|
|
335
|
+
pressed: isPressed
|
|
336
|
+
}) : style],
|
|
337
|
+
onPress: handlePress,
|
|
338
|
+
onPressIn: press.onPressIn,
|
|
339
|
+
onPressOut: press.onPressOut
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
BottomSheetHandle.displayName = "XAUI.BottomSheet.Handle";
|
|
343
|
+
|
|
344
|
+
// src/components/bottom-sheet/bottom-sheet-overlay.tsx
|
|
345
|
+
|
|
346
|
+
var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
|
|
347
|
+
var BottomSheetOverlay = _react.forwardRef.call(void 0, function BottomSheetOverlay2({
|
|
348
|
+
children,
|
|
349
|
+
isDismissable = true,
|
|
350
|
+
style,
|
|
351
|
+
...props
|
|
352
|
+
}, ref) {
|
|
353
|
+
const context = useBottomSheet();
|
|
354
|
+
const {
|
|
355
|
+
overlayStyle,
|
|
356
|
+
isOpen,
|
|
357
|
+
close
|
|
358
|
+
} = context;
|
|
359
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
360
|
+
if (!isOpen) return null;
|
|
361
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, {
|
|
362
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, BottomSheetProvider, {
|
|
363
|
+
value: context,
|
|
364
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, AnimatedPressable, {
|
|
365
|
+
ref,
|
|
366
|
+
entering: _chunkEKS3W46Mcjs.overlayEntering,
|
|
367
|
+
exiting: _chunkEKS3W46Mcjs.overlayExiting,
|
|
368
|
+
accessibilityRole: "none",
|
|
369
|
+
importantForAccessibility: "no",
|
|
370
|
+
onPress: isDismissable ? close : void 0,
|
|
371
|
+
...rest,
|
|
372
|
+
style: [overlayStyle, styleProps, style],
|
|
373
|
+
children
|
|
374
|
+
})
|
|
375
|
+
})
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
BottomSheetOverlay.displayName = "XAUI.BottomSheet.Overlay";
|
|
379
|
+
|
|
380
|
+
// src/components/bottom-sheet/bottom-sheet-summary.tsx
|
|
381
|
+
|
|
382
|
+
var BottomSheetSummary = _react.forwardRef.call(void 0, function BottomSheetSummary2({
|
|
383
|
+
children,
|
|
384
|
+
style,
|
|
385
|
+
onLayout,
|
|
386
|
+
...props
|
|
387
|
+
}, ref) {
|
|
388
|
+
const {
|
|
389
|
+
setSummaryExtent
|
|
390
|
+
} = useBottomSheet();
|
|
391
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
392
|
+
const measure = _react.useCallback.call(void 0, event => {
|
|
393
|
+
_optionalChain([onLayout, 'optionalCall', _4 => _4(event)]);
|
|
394
|
+
const {
|
|
395
|
+
y,
|
|
396
|
+
height
|
|
397
|
+
} = event.nativeEvent.layout;
|
|
398
|
+
setSummaryExtent(y + height);
|
|
399
|
+
}, [onLayout, setSummaryExtent]);
|
|
400
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
|
|
401
|
+
ref,
|
|
402
|
+
...rest,
|
|
403
|
+
onLayout: measure,
|
|
404
|
+
style: [styleProps, style],
|
|
405
|
+
children
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
BottomSheetSummary.displayName = "XAUI.BottomSheet.Summary";
|
|
409
|
+
|
|
410
|
+
// src/components/bottom-sheet/bottom-sheet-title.tsx
|
|
411
|
+
|
|
412
|
+
var BottomSheetTitle = _react.forwardRef.call(void 0, function BottomSheetTitle2({
|
|
413
|
+
children,
|
|
414
|
+
accessibilityRole = "header",
|
|
415
|
+
style,
|
|
416
|
+
...props
|
|
417
|
+
}, ref) {
|
|
418
|
+
const {
|
|
419
|
+
titleStyle
|
|
420
|
+
} = useBottomSheet();
|
|
421
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
422
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
|
|
423
|
+
ref,
|
|
424
|
+
accessibilityRole,
|
|
425
|
+
...rest,
|
|
426
|
+
style: [titleStyle, styleProps, style],
|
|
427
|
+
children
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
BottomSheetTitle.displayName = "XAUI.BottomSheet.Title";
|
|
431
|
+
|
|
432
|
+
// src/components/bottom-sheet/bottom-sheet-trigger.tsx
|
|
433
|
+
|
|
434
|
+
var BottomSheetTrigger = _react.forwardRef.call(void 0, function BottomSheetTrigger2({
|
|
435
|
+
children,
|
|
436
|
+
asChild = false,
|
|
437
|
+
accessibilityRole = "button",
|
|
438
|
+
accessibilityState,
|
|
439
|
+
style,
|
|
440
|
+
onPress,
|
|
441
|
+
onPressIn,
|
|
442
|
+
onPressOut,
|
|
443
|
+
...props
|
|
444
|
+
}, ref) {
|
|
445
|
+
const {
|
|
446
|
+
isOpen,
|
|
447
|
+
isDisabled,
|
|
448
|
+
toggle
|
|
449
|
+
} = useBottomSheet();
|
|
450
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
451
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, {
|
|
452
|
+
onPressIn,
|
|
453
|
+
onPressOut
|
|
454
|
+
});
|
|
455
|
+
const handlePress = _react.useCallback.call(void 0, event => {
|
|
456
|
+
_optionalChain([onPress, 'optionalCall', _5 => _5(event)]);
|
|
457
|
+
toggle();
|
|
458
|
+
}, [onPress, toggle]);
|
|
459
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkHBYT7B47cjs.PressableFeedback, {
|
|
460
|
+
ref,
|
|
461
|
+
isPressed,
|
|
462
|
+
isDisabled,
|
|
463
|
+
asChild,
|
|
464
|
+
accessibilityRole,
|
|
465
|
+
accessibilityState: {
|
|
466
|
+
disabled: isDisabled,
|
|
467
|
+
expanded: isOpen,
|
|
468
|
+
...accessibilityState
|
|
469
|
+
},
|
|
470
|
+
...rest,
|
|
471
|
+
style: [styleProps, typeof style === "function" ? style({
|
|
472
|
+
pressed: isPressed
|
|
473
|
+
}) : style],
|
|
474
|
+
onPress: handlePress,
|
|
475
|
+
onPressIn: press.onPressIn,
|
|
476
|
+
onPressOut: press.onPressOut,
|
|
477
|
+
children
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
BottomSheetTrigger.displayName = "XAUI.BottomSheet.Trigger";
|
|
481
|
+
|
|
482
|
+
// src/components/bottom-sheet/bottom-sheet.tsx
|
|
483
|
+
|
|
484
|
+
// src/components/bottom-sheet/bottom-sheet.recipe.ts
|
|
485
|
+
var SLOTS = ["overlay", "content", "handle", "title", "description"];
|
|
486
|
+
var HANDLE = {
|
|
487
|
+
width: 36,
|
|
488
|
+
height: 4
|
|
489
|
+
};
|
|
490
|
+
function topCorners(radius) {
|
|
491
|
+
return theme => ({
|
|
492
|
+
content: {
|
|
493
|
+
borderTopStartRadius: theme.radius[radius],
|
|
494
|
+
borderTopEndRadius: theme.radius[radius]
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
var RADII = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "field", "full"];
|
|
499
|
+
var bottomSheetRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
|
|
500
|
+
slots: SLOTS,
|
|
501
|
+
base: theme => ({
|
|
502
|
+
overlay: {
|
|
503
|
+
position: "absolute",
|
|
504
|
+
top: 0,
|
|
505
|
+
bottom: 0,
|
|
506
|
+
start: 0,
|
|
507
|
+
end: 0,
|
|
508
|
+
backgroundColor: theme.colors.backdrop
|
|
509
|
+
},
|
|
510
|
+
content: {
|
|
511
|
+
position: "absolute",
|
|
512
|
+
start: 0,
|
|
513
|
+
end: 0,
|
|
514
|
+
bottom: 0,
|
|
515
|
+
backgroundColor: theme.colors.overlay,
|
|
516
|
+
padding: theme.spacing(5),
|
|
517
|
+
gap: theme.spacing(2),
|
|
518
|
+
// HeroUI's `--radius-4xl` on a base of 8 is 32 points; the nearest on our base of 12
|
|
519
|
+
// is `3xl` at 36. A sheet's corner is the largest in the library because it is the
|
|
520
|
+
// only edge of it you can see.
|
|
521
|
+
borderTopStartRadius: theme.radius["3xl"],
|
|
522
|
+
borderTopEndRadius: theme.radius["3xl"],
|
|
523
|
+
borderCurve: "continuous",
|
|
524
|
+
...theme.shadows.overlay
|
|
525
|
+
},
|
|
526
|
+
/**
|
|
527
|
+
* The grab bar. It is the only thing telling a reader the sheet can be dragged — the
|
|
528
|
+
* gesture has no other affordance, and a sheet without one reads as a panel that
|
|
529
|
+
* happens to have arrived from below.
|
|
530
|
+
*/
|
|
531
|
+
handle: {
|
|
532
|
+
alignSelf: "center",
|
|
533
|
+
width: HANDLE.width,
|
|
534
|
+
height: HANDLE.height,
|
|
535
|
+
borderRadius: HANDLE.height / 2,
|
|
536
|
+
backgroundColor: theme.colors.separator
|
|
537
|
+
},
|
|
538
|
+
title: {
|
|
539
|
+
fontFamily: theme.fontFamilies.body,
|
|
540
|
+
fontWeight: theme.fontWeights.medium,
|
|
541
|
+
fontSize: theme.fontSizes.lg,
|
|
542
|
+
lineHeight: theme.lineHeights.lg,
|
|
543
|
+
color: theme.colors.overlayForeground
|
|
544
|
+
},
|
|
545
|
+
description: {
|
|
546
|
+
fontFamily: theme.fontFamilies.body,
|
|
547
|
+
fontSize: theme.fontSizes.md,
|
|
548
|
+
lineHeight: theme.lineHeights.md,
|
|
549
|
+
color: theme.colors.muted
|
|
550
|
+
}
|
|
551
|
+
}),
|
|
552
|
+
/** One variant: a sheet is the theme's floating surface, with no emphasis to report. */
|
|
553
|
+
variantTokens: {
|
|
554
|
+
default: {}
|
|
555
|
+
},
|
|
556
|
+
variants: {
|
|
557
|
+
radius: Object.fromEntries(RADII.map(r => [r, topCorners(r)]))
|
|
558
|
+
},
|
|
559
|
+
defaultVariants: {
|
|
560
|
+
variant: "default"
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
// src/components/bottom-sheet/bottom-sheet.tsx
|
|
565
|
+
|
|
566
|
+
function BottomSheet({
|
|
567
|
+
children,
|
|
568
|
+
radius,
|
|
569
|
+
isOpen: controlledOpen,
|
|
570
|
+
defaultOpen = false,
|
|
571
|
+
onOpenChange,
|
|
572
|
+
isDisabled = false,
|
|
573
|
+
dismissThreshold = 0.35,
|
|
574
|
+
collapsedHeight,
|
|
575
|
+
isExpanded: controlledExpanded,
|
|
576
|
+
defaultExpanded = true,
|
|
577
|
+
onExpandedChange
|
|
578
|
+
}) {
|
|
579
|
+
const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0);
|
|
580
|
+
const [isOpen, setOpen] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
581
|
+
value: controlledOpen,
|
|
582
|
+
defaultValue: defaultOpen,
|
|
583
|
+
onChange: onOpenChange
|
|
584
|
+
});
|
|
585
|
+
const [isExpanded, setExpanded] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
586
|
+
value: controlledExpanded,
|
|
587
|
+
defaultValue: defaultExpanded,
|
|
588
|
+
onChange: onExpandedChange
|
|
589
|
+
});
|
|
590
|
+
const [summaryExtent, setSummaryExtent] = _react.useState.call(void 0);
|
|
591
|
+
const [paddingBottom, setPaddingBottom] = _react.useState.call(void 0, 0);
|
|
592
|
+
const collapsed = collapsedExtent(summaryExtent, paddingBottom, collapsedHeight);
|
|
593
|
+
_react.useEffect.call(void 0, () => {
|
|
594
|
+
if (summaryExtent === void 0 || collapsedHeight === void 0) return;
|
|
595
|
+
_chunkEJQCQPETcjs.warnDev.call(void 0, "BottomSheet: `collapsedHeight` is ignored when a `BottomSheet.Summary` is present \u2014 the summary measures where to cut. Remove one of the two.");
|
|
596
|
+
}, [collapsedHeight, summaryExtent]);
|
|
597
|
+
const styles = bottomSheetRecipe.resolve({
|
|
598
|
+
theme,
|
|
599
|
+
selection: {
|
|
600
|
+
radius
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
const open = _react.useCallback.call(void 0, () => setOpen(true), [setOpen]);
|
|
604
|
+
const close = _react.useCallback.call(void 0, () => setOpen(false), [setOpen]);
|
|
605
|
+
const toggle = _react.useCallback.call(void 0, () => setOpen(current => !current), [setOpen]);
|
|
606
|
+
const expand = _react.useCallback.call(void 0, () => setExpanded(true), [setExpanded]);
|
|
607
|
+
const collapse = _react.useCallback.call(void 0, () => setExpanded(false), [setExpanded]);
|
|
608
|
+
const toggleExpanded = _react.useCallback.call(void 0, () => setExpanded(current => !current), [setExpanded]);
|
|
609
|
+
const context = _react.useMemo.call(void 0, () => ({
|
|
610
|
+
overlayStyle: styles.overlay,
|
|
611
|
+
contentStyle: styles.content,
|
|
612
|
+
handleStyle: styles.handle,
|
|
613
|
+
titleStyle: styles.title,
|
|
614
|
+
descriptionStyle: styles.description,
|
|
615
|
+
isOpen,
|
|
616
|
+
isDisabled,
|
|
617
|
+
dismissThreshold,
|
|
618
|
+
collapsedHeight: collapsed,
|
|
619
|
+
setSummaryExtent,
|
|
620
|
+
setPaddingBottom,
|
|
621
|
+
// A sheet with no reduced state has none to be out of, so it reports expanded
|
|
622
|
+
// whatever the disclosure holds — a slot must not draw a chevron for a state the
|
|
623
|
+
// sheet cannot reach.
|
|
624
|
+
isExpanded: collapsed === void 0 ? true : isExpanded,
|
|
625
|
+
isCollapsible: collapsed !== void 0,
|
|
626
|
+
open,
|
|
627
|
+
close,
|
|
628
|
+
toggle,
|
|
629
|
+
expand,
|
|
630
|
+
collapse,
|
|
631
|
+
toggleExpanded
|
|
632
|
+
}), [styles, isOpen, isDisabled, dismissThreshold, collapsed, isExpanded, open, close, toggle, expand, collapse, toggleExpanded]);
|
|
633
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, BottomSheetProvider, {
|
|
634
|
+
value: context,
|
|
635
|
+
children
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
BottomSheet.displayName = "XAUI.BottomSheet.Root";
|
|
639
|
+
|
|
640
|
+
// src/components/bottom-sheet/index.ts
|
|
641
|
+
var BottomSheet2 = Object.assign(BottomSheet, {
|
|
642
|
+
Trigger: BottomSheetTrigger,
|
|
643
|
+
Overlay: BottomSheetOverlay,
|
|
644
|
+
Content: BottomSheetContent,
|
|
645
|
+
Handle: BottomSheetHandle,
|
|
646
|
+
Summary: BottomSheetSummary,
|
|
647
|
+
Title: BottomSheetTitle,
|
|
648
|
+
Description: BottomSheetDescription,
|
|
649
|
+
Close: BottomSheetClose
|
|
650
|
+
});
|
|
651
|
+
exports.useBottomSheet = useBottomSheet;
|
|
652
|
+
exports.BottomSheetClose = BottomSheetClose;
|
|
653
|
+
exports.BottomSheetContent = BottomSheetContent;
|
|
654
|
+
exports.BottomSheetDescription = BottomSheetDescription;
|
|
655
|
+
exports.BottomSheetHandle = BottomSheetHandle;
|
|
656
|
+
exports.BottomSheetOverlay = BottomSheetOverlay;
|
|
657
|
+
exports.BottomSheetSummary = BottomSheetSummary;
|
|
658
|
+
exports.BottomSheetTitle = BottomSheetTitle;
|
|
659
|
+
exports.BottomSheetTrigger = BottomSheetTrigger;
|
|
660
|
+
exports.bottomSheetRecipe = bottomSheetRecipe;
|
|
661
|
+
exports.BottomSheet = BottomSheet;
|
|
662
|
+
exports.BottomSheet2 = BottomSheet2;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CloseButtonBase,
|
|
3
3
|
closeButtonGeometry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SIX5AVXG.js";
|
|
5
5
|
import {
|
|
6
6
|
useControllableState
|
|
7
7
|
} from "./chunk-F6W3JQ7K.js";
|
|
8
8
|
import {
|
|
9
9
|
PressableFeedback
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KQW25RCC.js";
|
|
11
11
|
import {
|
|
12
12
|
usePressState
|
|
13
13
|
} from "./chunk-423RQBOX.js";
|