@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.41
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-G3CCT4EY.js +518 -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-VLKBESEV.cjs +407 -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/tabs/index.cjs +33 -0
- package/dist/components/tabs/index.d.cts +261 -0
- package/dist/components/tabs/index.d.ts +261 -0
- package/dist/components/tabs/index.js +33 -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 +423 -5
- package/dist/index.d.cts +119 -4
- package/dist/index.d.ts +119 -4
- package/dist/index.js +445 -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 +264 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -0,0 +1,407 @@
|
|
|
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 _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk3E7CDKFOcjs = require('./chunk-3E7CDKFO.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
24
|
+
|
|
25
|
+
// src/components/tabs/tabs-content.tsx
|
|
26
|
+
var _react = require('react');
|
|
27
|
+
var _reactnative = require('react-native');
|
|
28
|
+
|
|
29
|
+
// src/components/tabs/tabs.context.ts
|
|
30
|
+
var [TabsProvider, useTabs] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Tabs");
|
|
31
|
+
var [TabsTriggerProvider, useTabsTrigger] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Tabs.Trigger");
|
|
32
|
+
|
|
33
|
+
// src/components/tabs/tabs-content.tsx
|
|
34
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
35
|
+
var TabsContent = _react.forwardRef.call(void 0, function TabsContent2({ value, children, accessibilityRole = "tab", style, ...props }, ref) {
|
|
36
|
+
const { value: selected } = useTabs();
|
|
37
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
38
|
+
if (selected !== value) return null;
|
|
39
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
40
|
+
_reactnative.View,
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
accessibilityRole,
|
|
44
|
+
...rest,
|
|
45
|
+
style: [styleProps, style],
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
TabsContent.displayName = "XAUI.Tabs.Content";
|
|
51
|
+
|
|
52
|
+
// src/components/tabs/tabs-indicator.tsx
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
59
|
+
|
|
60
|
+
// src/components/tabs/tabs.animation.ts
|
|
61
|
+
var INDICATOR_SPRING = { damping: 20, stiffness: 220, mass: 0.6 };
|
|
62
|
+
|
|
63
|
+
// src/components/tabs/tabs-indicator.tsx
|
|
64
|
+
|
|
65
|
+
function TabsIndicator({ style, ...props }) {
|
|
66
|
+
const { indicatorStyle, value, rects } = useTabs();
|
|
67
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
68
|
+
const rect = value === void 0 ? void 0 : rects[value];
|
|
69
|
+
const x = _reactnativereanimated.useSharedValue.call(void 0, _nullishCoalesce(_optionalChain([rect, 'optionalAccess', _ => _.x]), () => ( 0)));
|
|
70
|
+
const width = _reactnativereanimated.useSharedValue.call(void 0, _nullishCoalesce(_optionalChain([rect, 'optionalAccess', _2 => _2.width]), () => ( 0)));
|
|
71
|
+
const hasArrived = _reactnativereanimated.useSharedValue.call(void 0, rect !== void 0);
|
|
72
|
+
_react.useEffect.call(void 0, () => {
|
|
73
|
+
if (rect === void 0) return;
|
|
74
|
+
if (hasArrived.get()) {
|
|
75
|
+
x.set(_reactnativereanimated.withSpring.call(void 0, rect.x, INDICATOR_SPRING));
|
|
76
|
+
width.set(_reactnativereanimated.withSpring.call(void 0, rect.width, INDICATOR_SPRING));
|
|
77
|
+
} else {
|
|
78
|
+
x.set(rect.x);
|
|
79
|
+
width.set(rect.width);
|
|
80
|
+
hasArrived.set(true);
|
|
81
|
+
}
|
|
82
|
+
}, [rect, hasArrived, width, x]);
|
|
83
|
+
const travel = _reactnativereanimated.useAnimatedStyle.call(void 0, () => ({
|
|
84
|
+
transform: [{ translateX: x.get() }],
|
|
85
|
+
width: width.get(),
|
|
86
|
+
opacity: hasArrived.get() ? 1 : 0
|
|
87
|
+
}));
|
|
88
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { ...rest, style: [indicatorStyle, travel, styleProps, style] });
|
|
89
|
+
}
|
|
90
|
+
TabsIndicator.displayName = "XAUI.Tabs.Indicator";
|
|
91
|
+
|
|
92
|
+
// src/components/tabs/tabs-label.tsx
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
var TabsLabel = _react.forwardRef.call(void 0, function TabsLabel2({ children, numberOfLines = 1, style, ...props }, ref) {
|
|
97
|
+
const { labelStyle, labelSelectedStyle } = useTabs();
|
|
98
|
+
const { isSelected } = useTabsTrigger();
|
|
99
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
100
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
101
|
+
_reactnative.Text,
|
|
102
|
+
{
|
|
103
|
+
ref,
|
|
104
|
+
numberOfLines,
|
|
105
|
+
...rest,
|
|
106
|
+
style: [labelStyle, isSelected && labelSelectedStyle, styleProps, style],
|
|
107
|
+
children
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
TabsLabel.displayName = "XAUI.Tabs.Label";
|
|
112
|
+
|
|
113
|
+
// src/components/tabs/tabs-list.tsx
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
var TabsList = _react.forwardRef.call(void 0, function TabsList2({ children, accessibilityRole = "tablist", style, ...props }, ref) {
|
|
118
|
+
const { listStyle } = useTabs();
|
|
119
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
120
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
121
|
+
_reactnative.View,
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
accessibilityRole,
|
|
125
|
+
...rest,
|
|
126
|
+
style: [listStyle, styleProps, style],
|
|
127
|
+
children
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
TabsList.displayName = "XAUI.Tabs.List";
|
|
132
|
+
|
|
133
|
+
// src/components/tabs/tabs-trigger.tsx
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
var TabsTrigger = _react.forwardRef.call(void 0, function TabsTrigger2({
|
|
137
|
+
value,
|
|
138
|
+
children,
|
|
139
|
+
isDisabled = false,
|
|
140
|
+
asChild = false,
|
|
141
|
+
accessibilityRole = "tab",
|
|
142
|
+
accessibilityState,
|
|
143
|
+
style,
|
|
144
|
+
onLayout,
|
|
145
|
+
onPress,
|
|
146
|
+
onPressIn,
|
|
147
|
+
onPressOut,
|
|
148
|
+
...props
|
|
149
|
+
}, ref) {
|
|
150
|
+
const {
|
|
151
|
+
triggerStyle,
|
|
152
|
+
value: selected,
|
|
153
|
+
isDisabled: isRootDisabled,
|
|
154
|
+
select,
|
|
155
|
+
setRect
|
|
156
|
+
} = useTabs();
|
|
157
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
158
|
+
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
|
|
159
|
+
const isSelected = selected === value;
|
|
160
|
+
const disabled = isRootDisabled || isDisabled;
|
|
161
|
+
const measure = _react.useCallback.call(void 0,
|
|
162
|
+
(event) => {
|
|
163
|
+
_optionalChain([onLayout, 'optionalCall', _3 => _3(event)]);
|
|
164
|
+
const { x, width } = event.nativeEvent.layout;
|
|
165
|
+
setRect(value, { x, width });
|
|
166
|
+
},
|
|
167
|
+
[onLayout, setRect, value]
|
|
168
|
+
);
|
|
169
|
+
const handlePress = _react.useCallback.call(void 0,
|
|
170
|
+
(event) => {
|
|
171
|
+
_optionalChain([onPress, 'optionalCall', _4 => _4(event)]);
|
|
172
|
+
select(value);
|
|
173
|
+
},
|
|
174
|
+
[onPress, select, value]
|
|
175
|
+
);
|
|
176
|
+
const context = _react.useMemo.call(void 0,
|
|
177
|
+
() => ({ isSelected, isPressed, isDisabled: disabled }),
|
|
178
|
+
[isSelected, isPressed, disabled]
|
|
179
|
+
);
|
|
180
|
+
const text = typeof children === "function" ? null : _chunk7GHM4GKLcjs.childrenToString.call(void 0, children);
|
|
181
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TabsTriggerProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
182
|
+
_chunk3E7CDKFOcjs.PressableFeedback,
|
|
183
|
+
{
|
|
184
|
+
ref,
|
|
185
|
+
isPressed,
|
|
186
|
+
isDisabled: disabled,
|
|
187
|
+
asChild,
|
|
188
|
+
accessibilityRole,
|
|
189
|
+
accessibilityState: {
|
|
190
|
+
disabled,
|
|
191
|
+
selected: isSelected,
|
|
192
|
+
...accessibilityState
|
|
193
|
+
},
|
|
194
|
+
...rest,
|
|
195
|
+
onLayout: measure,
|
|
196
|
+
style: [
|
|
197
|
+
triggerStyle,
|
|
198
|
+
styleProps,
|
|
199
|
+
typeof style === "function" ? style({ pressed: isPressed }) : style
|
|
200
|
+
],
|
|
201
|
+
onPress: handlePress,
|
|
202
|
+
onPressIn: press.onPressIn,
|
|
203
|
+
onPressOut: press.onPressOut,
|
|
204
|
+
children: typeof children === "function" ? children(context) : text !== null ? (
|
|
205
|
+
// R3 — a stringifiable tab becomes its label, which is what makes the common
|
|
206
|
+
// case `<Tabs.Trigger value="all">Tout</Tabs.Trigger>`.
|
|
207
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TabsLabel, { children: text })
|
|
208
|
+
) : children
|
|
209
|
+
}
|
|
210
|
+
) });
|
|
211
|
+
});
|
|
212
|
+
TabsTrigger.displayName = "XAUI.Tabs.Trigger";
|
|
213
|
+
|
|
214
|
+
// src/components/tabs/tabs.tsx
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
// src/components/tabs/tabs.recipe.ts
|
|
219
|
+
var SLOTS = ["root", "list", "trigger", "label", "indicator", "content"];
|
|
220
|
+
var VARIANT_TOKENS = {
|
|
221
|
+
primary: { bg: "default", bgSelected: "segment", fgSelected: "segmentForeground" },
|
|
222
|
+
secondary: { bgSelected: "accent", fgSelected: "foreground" },
|
|
223
|
+
// The accent rather than the foreground: with nothing else moving, the colour is the
|
|
224
|
+
// whole signal, and a chosen tab in plain ink reads as one that is merely darker.
|
|
225
|
+
light: { fgSelected: "accent" }
|
|
226
|
+
};
|
|
227
|
+
var SIZES = {
|
|
228
|
+
sm: { paddingHorizontal: 2.5, paddingVertical: 1, gap: 1, label: "sm" },
|
|
229
|
+
md: { paddingHorizontal: 3, paddingVertical: 1.5, gap: 1.5, label: "md" },
|
|
230
|
+
lg: { paddingHorizontal: 4, paddingVertical: 2, gap: 2, label: "lg" }
|
|
231
|
+
};
|
|
232
|
+
var TRACK_INSET = 3;
|
|
233
|
+
function sizeAxis(step) {
|
|
234
|
+
const { paddingHorizontal, paddingVertical, gap, label } = step;
|
|
235
|
+
return (theme) => ({
|
|
236
|
+
trigger: {
|
|
237
|
+
paddingHorizontal: theme.spacing(paddingHorizontal),
|
|
238
|
+
paddingVertical: theme.spacing(paddingVertical),
|
|
239
|
+
gap: theme.spacing(gap)
|
|
240
|
+
},
|
|
241
|
+
label: {
|
|
242
|
+
fontSize: theme.fontSizes[label],
|
|
243
|
+
lineHeight: theme.lineHeights[label]
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
var tabsRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
|
|
248
|
+
slots: SLOTS,
|
|
249
|
+
base: (theme) => ({
|
|
250
|
+
root: { flexDirection: "column", gap: theme.spacing(2) },
|
|
251
|
+
list: {
|
|
252
|
+
// Hugs its tabs rather than filling the row. A tab bar as wide as the screen with
|
|
253
|
+
// three tabs in it is a segmented control pretending to be a navigation bar.
|
|
254
|
+
alignSelf: "flex-start",
|
|
255
|
+
flexDirection: "row",
|
|
256
|
+
alignItems: "center",
|
|
257
|
+
borderCurve: "continuous"
|
|
258
|
+
},
|
|
259
|
+
trigger: {
|
|
260
|
+
flexDirection: "row",
|
|
261
|
+
alignItems: "center",
|
|
262
|
+
justifyContent: "center"
|
|
263
|
+
},
|
|
264
|
+
label: {
|
|
265
|
+
fontFamily: theme.fontFamilies.body,
|
|
266
|
+
fontWeight: theme.fontWeights.medium,
|
|
267
|
+
color: theme.colors.muted
|
|
268
|
+
},
|
|
269
|
+
// Behind the triggers, not over them: it is the surface the chosen tab sits on.
|
|
270
|
+
indicator: { position: "absolute", zIndex: 0, borderCurve: "continuous" }
|
|
271
|
+
}),
|
|
272
|
+
variantTokens: VARIANT_TOKENS,
|
|
273
|
+
paint: (_theme, colors) => ({
|
|
274
|
+
list: { backgroundColor: colors.bg },
|
|
275
|
+
indicator: { backgroundColor: colors.bgSelected },
|
|
276
|
+
// Read by the root and handed to the chosen trigger's label alone, which is why it is
|
|
277
|
+
// on a slot the recipe otherwise leaves to `muted`.
|
|
278
|
+
content: { color: colors.fgSelected }
|
|
279
|
+
}),
|
|
280
|
+
variants: {
|
|
281
|
+
size: {
|
|
282
|
+
sm: sizeAxis(SIZES.sm),
|
|
283
|
+
md: sizeAxis(SIZES.md),
|
|
284
|
+
lg: sizeAxis(SIZES.lg)
|
|
285
|
+
},
|
|
286
|
+
radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "list", "indicator")
|
|
287
|
+
},
|
|
288
|
+
/**
|
|
289
|
+
* Where the shapes differ, and `light` is absent on purpose: the base gives the list no
|
|
290
|
+
* padding, no corner and no edge, so a shape that adds none of them is the base itself.
|
|
291
|
+
* `primary` is a pill inside a filled track, so the track is padded and both corners are
|
|
292
|
+
* round; `secondary` is a rule along a bottom edge, so the track carries a hairline and
|
|
293
|
+
* the indicator is that rule.
|
|
294
|
+
*/
|
|
295
|
+
compoundVariants: [
|
|
296
|
+
{
|
|
297
|
+
when: { variant: "primary" },
|
|
298
|
+
style: (theme) => ({
|
|
299
|
+
list: { padding: TRACK_INSET, borderRadius: theme.radius["3xl"] },
|
|
300
|
+
indicator: {
|
|
301
|
+
top: TRACK_INSET,
|
|
302
|
+
bottom: TRACK_INSET,
|
|
303
|
+
borderRadius: theme.radius["3xl"],
|
|
304
|
+
...theme.shadows.surface
|
|
305
|
+
}
|
|
306
|
+
})
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
when: { variant: "secondary" },
|
|
310
|
+
style: (theme) => ({
|
|
311
|
+
list: {
|
|
312
|
+
borderBottomWidth: theme.borderWidth.default,
|
|
313
|
+
borderColor: theme.colors.border
|
|
314
|
+
},
|
|
315
|
+
// Two points rather than a hairline: a rule that says which tab is chosen has to
|
|
316
|
+
// outweigh the one it sits on.
|
|
317
|
+
indicator: { bottom: 0, height: 2, borderRadius: 0 }
|
|
318
|
+
})
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
states: {
|
|
322
|
+
disabled: (theme) => ({ list: { opacity: theme.opacity.disabled } })
|
|
323
|
+
},
|
|
324
|
+
defaultVariants: { variant: "primary", size: "md" }
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
// src/components/tabs/tabs.tsx
|
|
328
|
+
|
|
329
|
+
var TabsRoot = _react.forwardRef.call(void 0, function Tabs({
|
|
330
|
+
children,
|
|
331
|
+
variant,
|
|
332
|
+
size,
|
|
333
|
+
radius,
|
|
334
|
+
color,
|
|
335
|
+
value: controlledValue,
|
|
336
|
+
defaultValue,
|
|
337
|
+
onValueChange,
|
|
338
|
+
isDisabled = false,
|
|
339
|
+
style,
|
|
340
|
+
...props
|
|
341
|
+
}, ref) {
|
|
342
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
343
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
344
|
+
const [rects, setRects] = _react.useState.call(void 0, {});
|
|
345
|
+
const [value, setValue] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
346
|
+
value: controlledValue,
|
|
347
|
+
defaultValue,
|
|
348
|
+
onChange: onValueChange
|
|
349
|
+
});
|
|
350
|
+
const selection = { variant, size, radius };
|
|
351
|
+
const styles = tabsRecipe.resolve({
|
|
352
|
+
theme,
|
|
353
|
+
selection,
|
|
354
|
+
states: { disabled: isDisabled }
|
|
355
|
+
});
|
|
356
|
+
const tint = color ? tabsRecipe.tint({ theme, color, selection }) : void 0;
|
|
357
|
+
const select = _react.useCallback.call(void 0, (next) => setValue(next), [setValue]);
|
|
358
|
+
const setRect = _react.useCallback.call(void 0, (tab, rect) => {
|
|
359
|
+
setRects((current) => {
|
|
360
|
+
const previous = current[tab];
|
|
361
|
+
if (previous && previous.x === rect.x && previous.width === rect.width)
|
|
362
|
+
return current;
|
|
363
|
+
return { ...current, [tab]: rect };
|
|
364
|
+
});
|
|
365
|
+
}, []);
|
|
366
|
+
const context = _react.useMemo.call(void 0, () => {
|
|
367
|
+
const selected = _reactnative.StyleSheet.flatten([styles.content, _optionalChain([tint, 'optionalAccess', _5 => _5.content])]);
|
|
368
|
+
return {
|
|
369
|
+
listStyle: tint ? [styles.list, tint.list] : styles.list,
|
|
370
|
+
triggerStyle: styles.trigger,
|
|
371
|
+
labelStyle: styles.label,
|
|
372
|
+
labelSelectedStyle: { color: selected.color },
|
|
373
|
+
indicatorStyle: tint ? [styles.indicator, tint.indicator] : styles.indicator,
|
|
374
|
+
contentStyle: void 0,
|
|
375
|
+
variant: _nullishCoalesce(variant, () => ( "primary")),
|
|
376
|
+
value,
|
|
377
|
+
isDisabled,
|
|
378
|
+
select,
|
|
379
|
+
rects,
|
|
380
|
+
setRect
|
|
381
|
+
};
|
|
382
|
+
}, [styles, tint, variant, value, isDisabled, select, rects, setRect]);
|
|
383
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TabsProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: [styles.root, styleProps, style], children }) });
|
|
384
|
+
});
|
|
385
|
+
TabsRoot.displayName = "XAUI.Tabs.Root";
|
|
386
|
+
|
|
387
|
+
// src/components/tabs/index.ts
|
|
388
|
+
var Tabs2 = Object.assign(TabsRoot, {
|
|
389
|
+
List: TabsList,
|
|
390
|
+
Trigger: TabsTrigger,
|
|
391
|
+
Label: TabsLabel,
|
|
392
|
+
Indicator: TabsIndicator,
|
|
393
|
+
Content: TabsContent
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
exports.useTabs = useTabs; exports.useTabsTrigger = useTabsTrigger; exports.TabsContent = TabsContent; exports.TabsIndicator = TabsIndicator; exports.TabsLabel = TabsLabel; exports.TabsList = TabsList; exports.TabsTrigger = TabsTrigger; exports.tabsRecipe = tabsRecipe; exports.TabsRoot = TabsRoot; exports.Tabs = Tabs2;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
4
|
+
|
|
5
|
+
// src/system/portal/portal-context.ts
|
|
6
|
+
var _react = require('react');
|
|
7
|
+
var PortalContext = _react.createContext.call(void 0, null);
|
|
8
|
+
|
|
9
|
+
// src/system/portal/portal.tsx
|
|
10
|
+
|
|
11
|
+
function Portal({ children }) {
|
|
12
|
+
const context = _react.useContext.call(void 0, PortalContext);
|
|
13
|
+
const key = _react.useId.call(void 0, );
|
|
14
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
15
|
+
_optionalChain([context, 'optionalAccess', _ => _.addPortal, 'call', _2 => _2(key, children)]);
|
|
16
|
+
}, [children, context, key]);
|
|
17
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
18
|
+
return () => _optionalChain([context, 'optionalAccess', _3 => _3.removePortal, 'call', _4 => _4(key)]);
|
|
19
|
+
}, [context, key]);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
Portal.displayName = "XAUI.Portal";
|
|
23
|
+
|
|
24
|
+
// src/system/portal/portal-host.tsx
|
|
25
|
+
|
|
26
|
+
var _reactnative = require('react-native');
|
|
27
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
28
|
+
var styles = _reactnative.StyleSheet.create({
|
|
29
|
+
container: { flex: 1 }
|
|
30
|
+
});
|
|
31
|
+
function PortalHost({ children, ...props }) {
|
|
32
|
+
const [styleProps] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
33
|
+
const [portals, setPortals] = _react.useState.call(void 0, /* @__PURE__ */ new Map());
|
|
34
|
+
const [origin, setOrigin] = _react.useState.call(void 0, { x: 0, y: 0 });
|
|
35
|
+
const node = _react.useRef.call(void 0, null);
|
|
36
|
+
const measure = _react.useCallback.call(void 0, (_event) => {
|
|
37
|
+
_optionalChain([node, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.measureInWindow, 'call', _7 => _7((x, y) => {
|
|
38
|
+
setOrigin((current) => current.x === x && current.y === y ? current : { x, y });
|
|
39
|
+
})]);
|
|
40
|
+
}, []);
|
|
41
|
+
const addPortal = _react.useCallback.call(void 0, (key, element) => {
|
|
42
|
+
setPortals((current) => new Map(current).set(key, element));
|
|
43
|
+
}, []);
|
|
44
|
+
const removePortal = _react.useCallback.call(void 0, (key) => {
|
|
45
|
+
setPortals((current) => {
|
|
46
|
+
if (!current.has(key)) return current;
|
|
47
|
+
const next = new Map(current);
|
|
48
|
+
next.delete(key);
|
|
49
|
+
return next;
|
|
50
|
+
});
|
|
51
|
+
}, []);
|
|
52
|
+
const methods = _react.useMemo.call(void 0,
|
|
53
|
+
() => ({ addPortal, removePortal, origin }),
|
|
54
|
+
[addPortal, removePortal, origin]
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PortalContext.Provider, { value: methods, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { ref: node, onLayout: measure, style: [styles.container, styleProps], children: [
|
|
57
|
+
children,
|
|
58
|
+
Array.from(portals, ([key, element]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: element }, key))
|
|
59
|
+
] }) });
|
|
60
|
+
}
|
|
61
|
+
PortalHost.displayName = "XAUI.PortalHost";
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
exports.PortalContext = PortalContext; exports.Portal = Portal; exports.PortalHost = PortalHost;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkH4E4HDEPcjs = require('./chunk-H4E4HDEP.cjs');
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-merged-ref.ts
|
|
6
|
+
var _react = require('react');
|
|
7
|
+
function useMergedRef(...refs) {
|
|
8
|
+
return _react.useMemo.call(void 0, () => _chunkH4E4HDEPcjs.mergeRefs.call(void 0, ...refs), refs);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.useMergedRef = useMergedRef;
|
|
File without changes
|