@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.40
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-2EGR4LWD.js +145 -0
- package/dist/chunk-2NRZKJG7.js +531 -0
- package/dist/chunk-2PMXMKS5.js +67 -0
- package/dist/chunk-2XPG2243.js +586 -0
- package/dist/chunk-36PRYGAM.js +13 -0
- package/dist/chunk-3E7CDKFO.cjs +696 -0
- package/dist/chunk-3GFRSZYR.js +54 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4CUZZWFW.js +92 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4KFKWBN5.cjs +89 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5R26NM4M.cjs +402 -0
- package/dist/chunk-5VKYNBNA.js +607 -0
- package/dist/chunk-64MXEVT3.js +66 -0
- package/dist/chunk-6DOLGZVV.cjs +147 -0
- package/dist/chunk-6L2TS2R3.cjs +92 -0
- package/dist/chunk-6UEZJRVI.js +669 -0
- package/dist/chunk-734MFAX4.js +27 -0
- package/dist/chunk-73RKQC5X.js +104 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7GHM4GKL.cjs +119 -0
- package/dist/chunk-7YF5NAHQ.cjs +74 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-ABAGZTXZ.cjs +736 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
- package/dist/chunk-AMCSSOJT.cjs +104 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BRRXFOBY.js +431 -0
- package/dist/chunk-C5YLPCFC.cjs +293 -0
- package/dist/chunk-DA3OKXHV.cjs +700 -0
- package/dist/chunk-DD4276RF.js +366 -0
- package/dist/chunk-DG2I4PJG.js +701 -0
- package/dist/chunk-DHGLGSH6.js +661 -0
- package/dist/chunk-DIBUQ46Y.js +346 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-EKS3W46M.cjs +66 -0
- package/dist/chunk-EZEYMLO3.js +402 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FHUYHV6J.js +89 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7P3ERYF.cjs +478 -0
- package/dist/chunk-GA6PBWNT.js +147 -0
- package/dist/chunk-GFUZ3MUT.cjs +455 -0
- package/dist/chunk-GGW43Q37.cjs +1 -0
- package/dist/chunk-GTR5X65M.cjs +27 -0
- package/dist/chunk-H4E4HDEP.cjs +13 -0
- package/dist/chunk-H7DS4IO7.js +198 -0
- package/dist/chunk-HDVVZG4S.cjs +198 -0
- package/dist/chunk-IKJVLJKT.js +151 -0
- package/dist/chunk-J3MB4PI5.cjs +531 -0
- package/dist/chunk-K72UDPVN.js +119 -0
- package/dist/chunk-KCMYU7WF.js +86 -0
- package/dist/chunk-LRN3RNDO.js +940 -0
- package/dist/chunk-LTX6TB5I.js +124 -0
- package/dist/chunk-LUPCPLND.cjs +145 -0
- package/dist/chunk-M63GFNKV.js +194 -0
- package/dist/chunk-N3KTZMPG.js +293 -0
- package/dist/chunk-NCTOTTVW.js +13 -0
- package/dist/chunk-NWGLP6JX.cjs +410 -0
- package/dist/chunk-R73XQK7X.cjs +314 -0
- package/dist/chunk-RU7JCMWC.cjs +881 -0
- package/dist/chunk-SNIHUKDA.cjs +184 -0
- package/dist/chunk-T5FV5F7A.cjs +607 -0
- package/dist/chunk-TDTUAIFF.cjs +153 -0
- package/dist/chunk-TJ74XVZN.cjs +431 -0
- package/dist/chunk-TK44VBIE.cjs +194 -0
- package/dist/chunk-UAWBAD4E.cjs +346 -0
- package/dist/chunk-UFTCTTKK.js +381 -0
- package/dist/chunk-WDDXU3OH.cjs +67 -0
- package/dist/chunk-WFEMJCXO.cjs +13 -0
- package/dist/chunk-WHJTBTYM.js +0 -0
- package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
- package/dist/chunk-XFPQFCEK.js +455 -0
- package/dist/chunk-XSQPVDFH.cjs +60 -0
- package/dist/chunk-XTC2SLFT.js +153 -0
- package/dist/chunk-XV735BSA.cjs +366 -0
- package/dist/chunk-XWNG2U4K.cjs +124 -0
- package/dist/chunk-YGYYJ3LQ.js +314 -0
- package/dist/chunk-YVHT2UVW.js +74 -0
- package/dist/chunk-ZFOOJK37.cjs +86 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/accordion/index.cjs +35 -0
- package/dist/components/accordion/index.d.cts +299 -0
- package/dist/components/accordion/index.d.ts +299 -0
- package/dist/components/accordion/index.js +35 -0
- package/dist/components/alert/index.cjs +20 -0
- package/dist/components/alert/index.d.cts +169 -0
- package/dist/components/alert/index.d.ts +169 -0
- package/dist/components/alert/index.js +20 -0
- package/dist/components/avatar/index.cjs +16 -0
- package/dist/components/avatar/index.d.cts +131 -0
- package/dist/components/avatar/index.d.ts +131 -0
- package/dist/components/avatar/index.js +16 -0
- package/dist/components/badge/index.cjs +15 -0
- package/dist/components/badge/index.d.cts +157 -0
- package/dist/components/badge/index.d.ts +157 -0
- package/dist/components/badge/index.js +15 -0
- package/dist/components/button/index.cjs +22 -0
- package/dist/components/button/index.d.cts +613 -0
- package/dist/components/button/index.d.ts +613 -0
- package/dist/components/button/index.js +22 -0
- package/dist/components/card/index.cjs +22 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +22 -0
- package/dist/components/checkbox/index.cjs +26 -0
- package/dist/components/checkbox/index.d.cts +1136 -0
- package/dist/components/checkbox/index.d.ts +1136 -0
- package/dist/components/checkbox/index.js +26 -0
- package/dist/components/chip/index.cjs +20 -0
- package/dist/components/chip/index.d.cts +608 -0
- package/dist/components/chip/index.d.ts +608 -0
- package/dist/components/chip/index.js +20 -0
- package/dist/components/divider/index.cjs +13 -0
- package/dist/components/divider/index.d.cts +117 -0
- package/dist/components/divider/index.d.ts +117 -0
- package/dist/components/divider/index.js +13 -0
- package/dist/components/field-group/index.cjs +27 -0
- package/dist/components/field-group/index.d.cts +270 -0
- package/dist/components/field-group/index.d.ts +270 -0
- package/dist/components/field-group/index.js +27 -0
- package/dist/components/input-otp/index.cjs +29 -0
- package/dist/components/input-otp/index.d.cts +325 -0
- package/dist/components/input-otp/index.d.ts +325 -0
- package/dist/components/input-otp/index.js +29 -0
- package/dist/components/menu/index.cjs +49 -0
- package/dist/components/menu/index.d.cts +351 -0
- package/dist/components/menu/index.d.ts +351 -0
- package/dist/components/menu/index.js +49 -0
- package/dist/components/popover/index.cjs +38 -0
- package/dist/components/popover/index.d.cts +254 -0
- package/dist/components/popover/index.d.ts +254 -0
- package/dist/components/popover/index.js +38 -0
- package/dist/components/radio/index.cjs +26 -0
- package/dist/components/radio/index.d.cts +1102 -0
- package/dist/components/radio/index.d.ts +1102 -0
- package/dist/components/radio/index.js +26 -0
- package/dist/components/select/index.cjs +50 -0
- package/dist/components/select/index.d.cts +498 -0
- package/dist/components/select/index.d.ts +498 -0
- package/dist/components/select/index.js +50 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +111 -0
- package/dist/components/skeleton/index.d.ts +111 -0
- package/dist/components/skeleton/index.js +11 -0
- package/dist/components/spinner/index.cjs +17 -0
- package/dist/components/spinner/index.d.cts +104 -0
- package/dist/components/spinner/index.d.ts +104 -0
- package/dist/components/spinner/index.js +17 -0
- package/dist/components/switch/index.cjs +27 -0
- package/dist/components/switch/index.d.cts +1154 -0
- package/dist/components/switch/index.d.ts +1154 -0
- package/dist/components/switch/index.js +27 -0
- package/dist/components/text-area/index.cjs +14 -0
- package/dist/components/text-area/index.d.cts +73 -0
- package/dist/components/text-area/index.d.ts +73 -0
- package/dist/components/text-area/index.js +14 -0
- package/dist/components/text-field/index.cjs +25 -0
- package/dist/components/text-field/index.d.cts +205 -0
- package/dist/components/text-field/index.d.ts +205 -0
- package/dist/components/text-field/index.js +25 -0
- package/dist/components/typography/index.cjs +15 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +15 -0
- package/dist/components/view/index.cjs +17 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +17 -0
- package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
- package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
- package/dist/icon.type-Kml72iSz.d.ts +73 -0
- package/dist/icon.type-d_i9ma-i.d.cts +73 -0
- package/dist/index.cjs +400 -4
- package/dist/index.d.cts +118 -4
- package/dist/index.d.ts +118 -4
- package/dist/index.js +423 -27
- package/dist/placement-DHa0Rrh1.d.cts +38 -0
- package/dist/placement-DHa0Rrh1.d.ts +38 -0
- package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
- package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
- package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
- package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
- package/dist/system/index.cjs +73 -4
- package/dist/system/index.d.cts +379 -193
- package/dist/system/index.d.ts +379 -193
- package/dist/system/index.js +87 -18
- package/dist/text-field.type-0l73acce.d.ts +167 -0
- package/dist/text-field.type-DBh06DU5.d.cts +167 -0
- package/dist/theme/index.cjs +5 -3
- package/dist/theme/index.d.cts +55 -24
- package/dist/theme/index.d.ts +55 -24
- package/dist/theme/index.js +4 -2
- package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
- package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
- package/package.json +254 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkGTR5X65Mcjs = require('./chunk-GTR5X65M.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkLUPCPLNDcjs = require('./chunk-LUPCPLND.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkWDDXU3OHcjs = require('./chunk-WDDXU3OH.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkEKS3W46Mcjs = require('./chunk-EKS3W46M.cjs');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunkWFEMJCXOcjs = require('./chunk-WFEMJCXO.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _chunk3E7CDKFOcjs = require('./chunk-3E7CDKFO.cjs');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
41
|
+
|
|
42
|
+
// src/components/popover/popover-close.tsx
|
|
43
|
+
var _react = require('react');
|
|
44
|
+
|
|
45
|
+
// src/components/popover/popover.context.ts
|
|
46
|
+
var [PopoverProvider, usePopover] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Popover");
|
|
47
|
+
|
|
48
|
+
// src/components/popover/popover-close.tsx
|
|
49
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
50
|
+
var PopoverClose = _react.forwardRef.call(void 0,
|
|
51
|
+
function PopoverClose2({
|
|
52
|
+
children,
|
|
53
|
+
asChild = false,
|
|
54
|
+
accessibilityRole = "button",
|
|
55
|
+
style,
|
|
56
|
+
onPress,
|
|
57
|
+
onPressIn,
|
|
58
|
+
onPressOut,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) {
|
|
61
|
+
const { close } = usePopover();
|
|
62
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
63
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
|
|
64
|
+
const handlePress = _react.useCallback.call(void 0,
|
|
65
|
+
(event) => {
|
|
66
|
+
_optionalChain([onPress, 'optionalCall', _ => _(event)]);
|
|
67
|
+
close();
|
|
68
|
+
},
|
|
69
|
+
[close, onPress]
|
|
70
|
+
);
|
|
71
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
72
|
+
_chunk3E7CDKFOcjs.PressableFeedback,
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
isPressed,
|
|
76
|
+
asChild,
|
|
77
|
+
accessibilityRole,
|
|
78
|
+
...rest,
|
|
79
|
+
style: [
|
|
80
|
+
styleProps,
|
|
81
|
+
typeof style === "function" ? style({ pressed: isPressed }) : style
|
|
82
|
+
],
|
|
83
|
+
onPress: handlePress,
|
|
84
|
+
onPressIn: press.onPressIn,
|
|
85
|
+
onPressOut: press.onPressOut,
|
|
86
|
+
children
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
PopoverClose.displayName = "XAUI.Popover.Close";
|
|
92
|
+
|
|
93
|
+
// src/components/popover/popover-content.tsx
|
|
94
|
+
|
|
95
|
+
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
96
|
+
|
|
97
|
+
// src/components/popover/popover.recipe.ts
|
|
98
|
+
var SLOTS = ["trigger", "overlay", "content", "title", "description"];
|
|
99
|
+
function popoverMeasure(fontSize) {
|
|
100
|
+
return fontSize * 13;
|
|
101
|
+
}
|
|
102
|
+
var popoverRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
|
|
103
|
+
slots: SLOTS,
|
|
104
|
+
base: (theme) => ({
|
|
105
|
+
overlay: { position: "absolute", top: 0, bottom: 0, start: 0, end: 0 },
|
|
106
|
+
content: {
|
|
107
|
+
position: "absolute",
|
|
108
|
+
backgroundColor: theme.colors.overlay,
|
|
109
|
+
// HeroUI's twelve by sixteen: a panel is read, not scanned, so it is wider-padded
|
|
110
|
+
// than it is tall-padded.
|
|
111
|
+
paddingVertical: theme.spacing(3),
|
|
112
|
+
paddingHorizontal: theme.spacing(4),
|
|
113
|
+
// Their `--radius-3xl` on a base of 8 is 24 points; our base is 12, so the same 24
|
|
114
|
+
// is `2xl`. Reading their key rather than their number puts a pill on it.
|
|
115
|
+
borderRadius: theme.radius["2xl"],
|
|
116
|
+
borderCurve: "continuous",
|
|
117
|
+
gap: theme.spacing(1.5),
|
|
118
|
+
...theme.shadows.overlay
|
|
119
|
+
},
|
|
120
|
+
title: {
|
|
121
|
+
fontFamily: theme.fontFamilies.body,
|
|
122
|
+
fontWeight: theme.fontWeights.medium,
|
|
123
|
+
fontSize: theme.fontSizes.lg,
|
|
124
|
+
lineHeight: theme.lineHeights.lg,
|
|
125
|
+
color: theme.colors.overlayForeground
|
|
126
|
+
},
|
|
127
|
+
description: {
|
|
128
|
+
fontFamily: theme.fontFamilies.body,
|
|
129
|
+
fontSize: theme.fontSizes.md,
|
|
130
|
+
lineHeight: theme.lineHeights.md,
|
|
131
|
+
color: theme.colors.muted
|
|
132
|
+
}
|
|
133
|
+
}),
|
|
134
|
+
variantTokens: { default: {} },
|
|
135
|
+
variants: { radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "content") },
|
|
136
|
+
states: {
|
|
137
|
+
disabled: (theme) => ({ trigger: { opacity: theme.opacity.disabled } })
|
|
138
|
+
},
|
|
139
|
+
defaultVariants: { variant: "default" }
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// src/components/popover/popover-content.tsx
|
|
143
|
+
|
|
144
|
+
var DEFAULT_OFFSET = 9;
|
|
145
|
+
var DEFAULT_INSETS = {
|
|
146
|
+
top: 12,
|
|
147
|
+
bottom: 12,
|
|
148
|
+
start: 12,
|
|
149
|
+
end: 12
|
|
150
|
+
};
|
|
151
|
+
var PopoverContent = _react.forwardRef.call(void 0,
|
|
152
|
+
function PopoverContent2({
|
|
153
|
+
children,
|
|
154
|
+
placement = "bottom",
|
|
155
|
+
align = "center",
|
|
156
|
+
width = "content-fit",
|
|
157
|
+
offset = DEFAULT_OFFSET,
|
|
158
|
+
alignOffset = 0,
|
|
159
|
+
avoidCollisions = true,
|
|
160
|
+
insets,
|
|
161
|
+
style,
|
|
162
|
+
onLayout,
|
|
163
|
+
...props
|
|
164
|
+
}, ref) {
|
|
165
|
+
const context = usePopover();
|
|
166
|
+
const { contentStyle, isOpen, anchor } = context;
|
|
167
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
168
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
169
|
+
const { position, onContentLayout, measuringStyle } = _chunkLUPCPLNDcjs.useAnchoredPosition.call(void 0, {
|
|
170
|
+
anchor,
|
|
171
|
+
isOpen,
|
|
172
|
+
placement,
|
|
173
|
+
align,
|
|
174
|
+
width,
|
|
175
|
+
offset,
|
|
176
|
+
alignOffset,
|
|
177
|
+
avoidCollisions,
|
|
178
|
+
insets: { ...DEFAULT_INSETS, ...insets },
|
|
179
|
+
maxWidth: popoverMeasure(theme.fontSizes.md),
|
|
180
|
+
onLayout
|
|
181
|
+
});
|
|
182
|
+
if (!isOpen || anchor === null) return null;
|
|
183
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PopoverProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
184
|
+
_reactnativereanimated2.default.View,
|
|
185
|
+
{
|
|
186
|
+
ref,
|
|
187
|
+
entering: position ? _chunkEKS3W46Mcjs.anchoredEntering.call(void 0, position.placement) : void 0,
|
|
188
|
+
exiting: position ? _chunkEKS3W46Mcjs.anchoredExiting.call(void 0, position.placement) : void 0,
|
|
189
|
+
onLayout: onContentLayout,
|
|
190
|
+
...rest,
|
|
191
|
+
style: [
|
|
192
|
+
contentStyle,
|
|
193
|
+
position === null ? measuringStyle : {
|
|
194
|
+
top: position.top,
|
|
195
|
+
start: position.start,
|
|
196
|
+
width: position.width,
|
|
197
|
+
maxHeight: position.maxHeight
|
|
198
|
+
},
|
|
199
|
+
styleProps,
|
|
200
|
+
style
|
|
201
|
+
],
|
|
202
|
+
children
|
|
203
|
+
},
|
|
204
|
+
_nullishCoalesce(_optionalChain([position, 'optionalAccess', _2 => _2.placement]), () => ( "measuring"))
|
|
205
|
+
) }) });
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
PopoverContent.displayName = "XAUI.Popover.Content";
|
|
209
|
+
|
|
210
|
+
// src/components/popover/popover-description.tsx
|
|
211
|
+
|
|
212
|
+
var _reactnative = require('react-native');
|
|
213
|
+
|
|
214
|
+
var PopoverDescription = _react.forwardRef.call(void 0,
|
|
215
|
+
function PopoverDescription2({ children, style, ...props }, ref) {
|
|
216
|
+
const { descriptionStyle } = usePopover();
|
|
217
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
218
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, ...rest, style: [descriptionStyle, styleProps, style], children });
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
PopoverDescription.displayName = "XAUI.Popover.Description";
|
|
222
|
+
|
|
223
|
+
// src/components/popover/popover-overlay.tsx
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
|
|
229
|
+
var PopoverOverlay = _react.forwardRef.call(void 0,
|
|
230
|
+
function PopoverOverlay2({ children, isDismissable = true, style, ...props }, ref) {
|
|
231
|
+
const context = usePopover();
|
|
232
|
+
const { overlayStyle, isOpen, close } = context;
|
|
233
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
234
|
+
if (!isOpen) return null;
|
|
235
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PopoverProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
236
|
+
AnimatedPressable,
|
|
237
|
+
{
|
|
238
|
+
ref,
|
|
239
|
+
entering: _chunkEKS3W46Mcjs.overlayEntering,
|
|
240
|
+
exiting: _chunkEKS3W46Mcjs.overlayExiting,
|
|
241
|
+
accessibilityRole: "none",
|
|
242
|
+
importantForAccessibility: "no",
|
|
243
|
+
onPress: isDismissable ? close : void 0,
|
|
244
|
+
...rest,
|
|
245
|
+
style: [overlayStyle, styleProps, style],
|
|
246
|
+
children
|
|
247
|
+
}
|
|
248
|
+
) }) });
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
PopoverOverlay.displayName = "XAUI.Popover.Overlay";
|
|
252
|
+
|
|
253
|
+
// src/components/popover/popover-title.tsx
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
var PopoverTitle = _react.forwardRef.call(void 0,
|
|
258
|
+
function PopoverTitle2({ children, accessibilityRole = "header", style, ...props }, ref) {
|
|
259
|
+
const { titleStyle } = usePopover();
|
|
260
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
261
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
262
|
+
_reactnative.Text,
|
|
263
|
+
{
|
|
264
|
+
ref,
|
|
265
|
+
accessibilityRole,
|
|
266
|
+
...rest,
|
|
267
|
+
style: [titleStyle, styleProps, style],
|
|
268
|
+
children
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
PopoverTitle.displayName = "XAUI.Popover.Title";
|
|
274
|
+
|
|
275
|
+
// src/components/popover/popover-trigger.tsx
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
var PopoverTrigger = _react.forwardRef.call(void 0,
|
|
279
|
+
function PopoverTrigger2({
|
|
280
|
+
children,
|
|
281
|
+
asChild = false,
|
|
282
|
+
accessibilityRole = "button",
|
|
283
|
+
accessibilityState,
|
|
284
|
+
style,
|
|
285
|
+
onLayout,
|
|
286
|
+
onPress,
|
|
287
|
+
onPressIn,
|
|
288
|
+
onPressOut,
|
|
289
|
+
...props
|
|
290
|
+
}, ref) {
|
|
291
|
+
const { triggerStyle, isOpen, isDisabled, toggle, setAnchor } = usePopover();
|
|
292
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
293
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
|
|
294
|
+
const anchor = _chunkGTR5X65Mcjs.useAnchorRef.call(void 0, { isOpen, onAnchor: setAnchor, onLayout });
|
|
295
|
+
const refs = _chunkWFEMJCXOcjs.useMergedRef.call(void 0, anchor.node, ref);
|
|
296
|
+
const handlePress = _react.useCallback.call(void 0,
|
|
297
|
+
(event) => {
|
|
298
|
+
_optionalChain([onPress, 'optionalCall', _3 => _3(event)]);
|
|
299
|
+
anchor.measure();
|
|
300
|
+
toggle();
|
|
301
|
+
},
|
|
302
|
+
[anchor, onPress, toggle]
|
|
303
|
+
);
|
|
304
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
305
|
+
_chunk3E7CDKFOcjs.PressableFeedback,
|
|
306
|
+
{
|
|
307
|
+
ref: refs,
|
|
308
|
+
isPressed,
|
|
309
|
+
isDisabled,
|
|
310
|
+
asChild,
|
|
311
|
+
accessibilityRole,
|
|
312
|
+
accessibilityState: {
|
|
313
|
+
disabled: isDisabled,
|
|
314
|
+
expanded: isOpen,
|
|
315
|
+
...accessibilityState
|
|
316
|
+
},
|
|
317
|
+
...rest,
|
|
318
|
+
onLayout: anchor.onLayout,
|
|
319
|
+
style: [
|
|
320
|
+
triggerStyle,
|
|
321
|
+
styleProps,
|
|
322
|
+
typeof style === "function" ? style({ pressed: isPressed }) : style
|
|
323
|
+
],
|
|
324
|
+
onPress: handlePress,
|
|
325
|
+
onPressIn: press.onPressIn,
|
|
326
|
+
onPressOut: press.onPressOut,
|
|
327
|
+
children
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
PopoverTrigger.displayName = "XAUI.Popover.Trigger";
|
|
333
|
+
|
|
334
|
+
// src/components/popover/popover.tsx
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
function Popover({
|
|
338
|
+
children,
|
|
339
|
+
radius,
|
|
340
|
+
isOpen: controlledOpen,
|
|
341
|
+
defaultOpen = false,
|
|
342
|
+
onOpenChange,
|
|
343
|
+
isDisabled = false
|
|
344
|
+
}) {
|
|
345
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
346
|
+
const [anchor, setAnchor] = _react.useState.call(void 0, null);
|
|
347
|
+
const [isOpen, setOpen] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
348
|
+
value: controlledOpen,
|
|
349
|
+
defaultValue: defaultOpen,
|
|
350
|
+
onChange: onOpenChange
|
|
351
|
+
});
|
|
352
|
+
const styles = popoverRecipe.resolve({
|
|
353
|
+
theme,
|
|
354
|
+
selection: { radius },
|
|
355
|
+
states: { disabled: isDisabled }
|
|
356
|
+
});
|
|
357
|
+
const open = _react.useCallback.call(void 0, () => setOpen(true), [setOpen]);
|
|
358
|
+
const close = _react.useCallback.call(void 0, () => setOpen(false), [setOpen]);
|
|
359
|
+
const toggle = _react.useCallback.call(void 0, () => setOpen((current) => !current), [setOpen]);
|
|
360
|
+
const context = _react.useMemo.call(void 0,
|
|
361
|
+
() => ({
|
|
362
|
+
triggerStyle: styles.trigger,
|
|
363
|
+
overlayStyle: styles.overlay,
|
|
364
|
+
contentStyle: styles.content,
|
|
365
|
+
titleStyle: styles.title,
|
|
366
|
+
descriptionStyle: styles.description,
|
|
367
|
+
isOpen,
|
|
368
|
+
isDisabled,
|
|
369
|
+
open,
|
|
370
|
+
close,
|
|
371
|
+
toggle,
|
|
372
|
+
anchor,
|
|
373
|
+
setAnchor
|
|
374
|
+
}),
|
|
375
|
+
[styles, isOpen, isDisabled, open, close, toggle, anchor]
|
|
376
|
+
);
|
|
377
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PopoverProvider, { value: context, children });
|
|
378
|
+
}
|
|
379
|
+
Popover.displayName = "XAUI.Popover.Root";
|
|
380
|
+
|
|
381
|
+
// src/components/popover/index.ts
|
|
382
|
+
var Popover2 = Object.assign(Popover, {
|
|
383
|
+
Trigger: PopoverTrigger,
|
|
384
|
+
Overlay: PopoverOverlay,
|
|
385
|
+
Content: PopoverContent,
|
|
386
|
+
Title: PopoverTitle,
|
|
387
|
+
Description: PopoverDescription,
|
|
388
|
+
Close: PopoverClose
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
exports.usePopover = usePopover; exports.PopoverClose = PopoverClose; exports.popoverRecipe = popoverRecipe; exports.PopoverContent = PopoverContent; exports.PopoverDescription = PopoverDescription; exports.PopoverOverlay = PopoverOverlay; exports.PopoverTitle = PopoverTitle; exports.PopoverTrigger = PopoverTrigger; exports.Popover = Popover; exports.Popover2 = Popover2;
|