@xaui/native 0.9.1-alpha.16 → 0.9.1-alpha.18
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-4K3LZS7M.js +448 -0
- package/dist/chunk-5SU7FXWH.cjs +448 -0
- package/dist/chunk-6PZF4PI7.js +100 -0
- package/dist/chunk-6VTBGBPP.cjs +100 -0
- package/dist/{chunk-KCUT47FY.cjs → chunk-BHAHJHAI.cjs} +5 -1
- package/dist/{chunk-UOJBK5Z4.js → chunk-L3AQNVRN.js} +1 -1
- package/dist/{chunk-BAACHVM4.cjs → chunk-M2VYRHVS.cjs} +2 -2
- package/dist/{chunk-E3756MJC.js → chunk-MBLPPOSO.js} +16 -15
- package/dist/{chunk-NLFE3CRM.cjs → chunk-ODH5WAVM.cjs} +24 -23
- package/dist/{chunk-PUER6Y4M.cjs → chunk-P5MKOLIW.cjs} +110 -409
- package/dist/chunk-VQPP6FCB.js +728 -0
- package/dist/{chunk-EHHSY2KB.js → chunk-XQE5PXOD.js} +5 -1
- package/dist/components/button/index.cjs +4 -3
- package/dist/components/button/index.d.cts +179 -178
- package/dist/components/button/index.d.ts +179 -178
- package/dist/components/button/index.js +3 -2
- package/dist/components/typography/index.cjs +12 -0
- package/dist/components/typography/index.d.cts +115 -0
- package/dist/components/typography/index.d.ts +115 -0
- package/dist/components/typography/index.js +12 -0
- package/dist/create-recipe-3_ElpCYt.d.cts +117 -0
- package/dist/create-recipe-DImq1AZA.d.ts +117 -0
- package/dist/index.cjs +17 -7
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +21 -11
- package/dist/pressable-feedback.type-UwqIG6ES.d.ts +195 -0
- package/dist/pressable-feedback.type-lgW5wQx5.d.cts +195 -0
- package/dist/system/index.cjs +5 -3
- package/dist/system/index.d.cts +10 -4
- package/dist/system/index.d.ts +10 -4
- package/dist/system/index.js +11 -9
- package/dist/theme/index.cjs +2 -2
- package/dist/theme/index.d.cts +2 -2
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.js +1 -1
- 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 +11 -1
- package/dist/chunk-64L44HEI.js +0 -1021
- package/dist/create-recipe-BcUu9b2I.d.cts +0 -280
- package/dist/create-recipe-DD9W6m9b.d.ts +0 -280
|
@@ -36,52 +36,11 @@ function _optionalChain(ops) {
|
|
|
36
36
|
}
|
|
37
37
|
return value;
|
|
38
38
|
}
|
|
39
|
+
var _chunk5SU7FXWHcjs = require('./chunk-5SU7FXWH.cjs');
|
|
39
40
|
var _chunk6N5JXRUZcjs = require('./chunk-6N5JXRUZ.cjs');
|
|
40
41
|
|
|
41
|
-
// src/system/style-props/use-style-props.ts
|
|
42
|
-
var _react = require('react');
|
|
43
|
-
|
|
44
|
-
// src/utils/style-props.ts
|
|
45
|
-
var STYLE_PROP_KEYS = [
|
|
46
|
-
// Flex and layout
|
|
47
|
-
"alignContent", "alignItems", "alignSelf", "aspectRatio", "boxSizing", "columnGap", "direction", "display", "flex", "flexBasis", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "gap", "justifyContent", "overflow", "rowGap",
|
|
48
|
-
// Position
|
|
49
|
-
"bottom", "end", "inset", "insetBlock", "insetBlockEnd", "insetBlockStart", "insetInline", "insetInlineEnd", "insetInlineStart", "position", "start", "top", "zIndex",
|
|
50
|
-
// Margin
|
|
51
|
-
"margin", "marginBlock", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginEnd", "marginHorizontal", "marginInline", "marginInlineEnd", "marginInlineStart", "marginStart", "marginTop", "marginVertical",
|
|
52
|
-
// Padding
|
|
53
|
-
"padding", "paddingBlock", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingEnd", "paddingHorizontal", "paddingInline", "paddingInlineEnd", "paddingInlineStart", "paddingStart", "paddingTop", "paddingVertical",
|
|
54
|
-
// Size
|
|
55
|
-
"height", "maxHeight", "maxWidth", "minHeight", "minWidth", "width",
|
|
56
|
-
// Border
|
|
57
|
-
"borderBlockColor", "borderBlockEndColor", "borderBlockStartColor", "borderBottomColor", "borderBottomEndRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderCurve", "borderEndColor", "borderEndEndRadius", "borderEndStartRadius", "borderEndWidth", "borderRadius", "borderStartColor", "borderStartEndRadius", "borderStartStartRadius", "borderStartWidth", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth",
|
|
58
|
-
// Fill, shadow, and the rest of a box's paint
|
|
59
|
-
"backfaceVisibility", "backgroundColor", "boxShadow", "cursor", "elevation", "experimental_backgroundImage", "filter", "isolation", "mixBlendMode", "opacity", "outlineColor", "outlineOffset", "outlineStyle", "outlineWidth", "shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius",
|
|
60
|
-
// Transform
|
|
61
|
-
"rotation", "scaleX", "scaleY", "transform", "transformMatrix", "transformOrigin", "translateX", "translateY",
|
|
62
|
-
// Text — a text slot only
|
|
63
|
-
"color", "fontFamily", "fontSize", "fontStyle", "fontVariant", "fontWeight", "includeFontPadding", "letterSpacing", "lineHeight", "textAlign", "textAlignVertical", "textDecorationColor", "textDecorationLine", "textDecorationStyle", "textShadowColor", "textShadowOffset", "textShadowRadius", "textTransform", "userSelect", "verticalAlign", "writingDirection",
|
|
64
|
-
// Image — an image slot only
|
|
65
|
-
"objectFit", "overlayColor", "resizeMode", "tintColor"];
|
|
66
|
-
var STYLE_PROP_KEY_SET = new Set(STYLE_PROP_KEYS);
|
|
67
|
-
function splitStyleProps(props) {
|
|
68
|
-
const styleProps = {};
|
|
69
|
-
const rest = {};
|
|
70
|
-
for (const [key, value] of Object.entries(props)) {
|
|
71
|
-
if (STYLE_PROP_KEY_SET.has(key)) styleProps[key] = value;else rest[key] = value;
|
|
72
|
-
}
|
|
73
|
-
return [styleProps, rest];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// src/system/style-props/use-style-props.ts
|
|
77
|
-
function useStyleProps(props) {
|
|
78
|
-
const [styleProps, rest] = splitStyleProps(props);
|
|
79
|
-
const key = _chunk6N5JXRUZcjs.stableHash.call(void 0, styleProps);
|
|
80
|
-
return [_react.useMemo.call(void 0, () => styleProps, [key]), rest];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
42
|
// src/system/icon/icon-context.ts
|
|
84
|
-
|
|
43
|
+
var _react = require('react');
|
|
85
44
|
var IconContext = _react.createContext.call(void 0, {});
|
|
86
45
|
IconContext.displayName = "XAUI.Icon.Context";
|
|
87
46
|
function useIconContext() {
|
|
@@ -92,173 +51,70 @@ function useIconContext() {
|
|
|
92
51
|
|
|
93
52
|
var _reactnative = require('react-native');
|
|
94
53
|
var _jsxruntime = require('react/jsx-runtime');
|
|
95
|
-
function Icon({
|
|
96
|
-
as: Component,
|
|
97
|
-
children,
|
|
98
|
-
source,
|
|
99
|
-
size,
|
|
100
|
-
color,
|
|
101
|
-
style,
|
|
102
|
-
...props
|
|
103
|
-
}) {
|
|
54
|
+
function Icon(props) {
|
|
104
55
|
const inherited = useIconContext();
|
|
105
56
|
const theme = _chunk6N5JXRUZcjs.useXAUITheme.call(void 0);
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
57
|
+
const size = _nullishCoalesce(_nullishCoalesce(props.size, () => inherited.size), () => theme.fontSizes.md);
|
|
58
|
+
const color = _nullishCoalesce(_nullishCoalesce(props.color, () => inherited.color), () => theme.colors.foreground);
|
|
59
|
+
if (props.as) {
|
|
60
|
+
const Component = props.as;
|
|
110
61
|
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, Component, {
|
|
111
|
-
size
|
|
112
|
-
color
|
|
62
|
+
size,
|
|
63
|
+
color
|
|
113
64
|
});
|
|
114
65
|
}
|
|
115
|
-
if (_react.isValidElement.call(void 0, children)) {
|
|
116
|
-
return _react.cloneElement.call(void 0, children, {
|
|
117
|
-
width:
|
|
118
|
-
height:
|
|
119
|
-
color
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
if (source) {
|
|
123
|
-
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Image, {
|
|
124
|
-
source,
|
|
125
|
-
style: [{
|
|
126
|
-
width: resolvedSize,
|
|
127
|
-
height: resolvedSize,
|
|
128
|
-
tintColor: resolvedColor
|
|
129
|
-
}, styleProps, style]
|
|
66
|
+
if (_react.isValidElement.call(void 0, props.children)) {
|
|
67
|
+
return _react.cloneElement.call(void 0, props.children, {
|
|
68
|
+
width: size,
|
|
69
|
+
height: size,
|
|
70
|
+
color
|
|
130
71
|
});
|
|
131
72
|
}
|
|
73
|
+
if (props.source) return /* @__PURE__ */_jsxruntime.jsx.call(void 0, IconImage, {
|
|
74
|
+
...props,
|
|
75
|
+
resolved: {
|
|
76
|
+
size,
|
|
77
|
+
color
|
|
78
|
+
}
|
|
79
|
+
});
|
|
132
80
|
throw new Error("XAUI: Icon needs one of `as` (an icon component), a raw SVG element as its child, or `source` (an image). It renders nothing on its own.");
|
|
133
81
|
}
|
|
134
82
|
Icon.displayName = "XAUI.Icon";
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
text += part;
|
|
153
|
-
}
|
|
154
|
-
return text;
|
|
155
|
-
}
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// src/system/slot/create-slot-context.ts
|
|
160
|
-
|
|
161
|
-
function createSlotContext(name) {
|
|
162
|
-
const Context = _react.createContext.call(void 0, null);
|
|
163
|
-
Context.displayName = `XAUI.${name}.Context`;
|
|
164
|
-
function useSlotContext() {
|
|
165
|
-
const value = _react.useContext.call(void 0, Context);
|
|
166
|
-
if (value === null) {
|
|
167
|
-
const error = new Error(`XAUI: use${name} must be called inside <${name}>. A slot reads the values its root resolved, so it can only be rendered as a child of one.`);
|
|
168
|
-
_optionalChain([Error, 'access', _ => _.captureStackTrace, 'optionalCall', _2 => _2(error, useSlotContext)]);
|
|
169
|
-
throw error;
|
|
170
|
-
}
|
|
171
|
-
return value;
|
|
172
|
-
}
|
|
173
|
-
return [Context.Provider, useSlotContext];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// src/system/slot/merge-refs.ts
|
|
177
|
-
function mergeRefs(...refs) {
|
|
178
|
-
return value => {
|
|
179
|
-
for (const ref of refs) {
|
|
180
|
-
if (typeof ref === "function") ref(value);else if (ref) ref.current = value;
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// src/system/slot/merge-props.ts
|
|
186
|
-
var EVENT_HANDLER = /^on[A-Z]/;
|
|
187
|
-
function mergeProps(ours, theirs) {
|
|
188
|
-
const merged = {
|
|
189
|
-
...ours
|
|
190
|
-
};
|
|
191
|
-
for (const key of Object.keys(theirs)) {
|
|
192
|
-
const ourValue = ours[key];
|
|
193
|
-
const theirValue = theirs[key];
|
|
194
|
-
if (EVENT_HANDLER.test(key)) {
|
|
195
|
-
merged[key] = composeHandlers(ourValue, theirValue);
|
|
196
|
-
} else if (key === "style") {
|
|
197
|
-
merged[key] = mergeStyles(ourValue, theirValue);
|
|
198
|
-
} else if (key === "ref") {
|
|
199
|
-
merged[key] = mergeRefs(ourValue, theirValue);
|
|
200
|
-
} else {
|
|
201
|
-
merged[key] = theirValue;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return merged;
|
|
205
|
-
}
|
|
206
|
-
function composeHandlers(ours, theirs) {
|
|
207
|
-
if (typeof ours !== "function") return theirs;
|
|
208
|
-
if (typeof theirs !== "function") return ours;
|
|
209
|
-
return (...args) => {
|
|
210
|
-
;
|
|
211
|
-
ours(...args);
|
|
212
|
-
return theirs(...args);
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function mergeStyles(ours, theirs) {
|
|
216
|
-
if (typeof ours === "function" || typeof theirs === "function") {
|
|
217
|
-
return state => [resolveStyle(ours, state), resolveStyle(theirs, state)];
|
|
218
|
-
}
|
|
219
|
-
return [ours, theirs];
|
|
220
|
-
}
|
|
221
|
-
function resolveStyle(style, state) {
|
|
222
|
-
return typeof style === "function" ? style(state) : style;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// src/system/slot/slot.tsx
|
|
226
|
-
|
|
227
|
-
var Slot = _react.forwardRef.call(void 0, function Slot2({
|
|
228
|
-
children,
|
|
229
|
-
...ours
|
|
230
|
-
}, ref) {
|
|
231
|
-
if (!_react.isValidElement.call(void 0, children)) {
|
|
232
|
-
throw new Error("XAUI: asChild expects exactly one React element as its child, and merges the component's props into it. Text, a fragment, several children or none give it nothing to merge into \u2014 drop `asChild` to render the component itself.");
|
|
233
|
-
}
|
|
234
|
-
const child = children;
|
|
235
|
-
const merged = mergeProps(ours, child.props);
|
|
236
|
-
merged.ref = mergeRefs(ref, refOf(child));
|
|
237
|
-
return _react.cloneElement.call(void 0, child, merged);
|
|
238
|
-
});
|
|
239
|
-
Slot.displayName = "XAUI.Slot";
|
|
240
|
-
function refOf(element) {
|
|
241
|
-
const fromProps = element.props.ref;
|
|
242
|
-
const fromElement = element.ref;
|
|
243
|
-
return _nullishCoalesce(fromProps, () => fromElement);
|
|
83
|
+
function IconImage({
|
|
84
|
+
source,
|
|
85
|
+
style,
|
|
86
|
+
resolved,
|
|
87
|
+
size: _size,
|
|
88
|
+
color: _color,
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
const [styleProps] = _chunk5SU7FXWHcjs.useStyleProps.call(void 0, props);
|
|
92
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Image, {
|
|
93
|
+
source,
|
|
94
|
+
style: [{
|
|
95
|
+
width: resolved.size,
|
|
96
|
+
height: resolved.size,
|
|
97
|
+
tintColor: resolved.color
|
|
98
|
+
}, styleProps, style]
|
|
99
|
+
});
|
|
244
100
|
}
|
|
245
101
|
|
|
246
102
|
// src/system/pressable-feedback/pressable-feedback-context.ts
|
|
247
103
|
|
|
248
|
-
var [FeedbackProvider, useFeedback] = createSlotContext("PressableFeedback");
|
|
104
|
+
var [FeedbackProvider, useFeedback] = _chunk5SU7FXWHcjs.createSlotContext.call(void 0, "PressableFeedback");
|
|
249
105
|
var DisableAllContext = _react.createContext.call(void 0, false);
|
|
250
106
|
|
|
251
107
|
// src/system/pressable-feedback/pressable-feedback.animation.ts
|
|
252
108
|
var PRESS_SCALE = 0.985;
|
|
253
109
|
var PRESS_DURATION = 300;
|
|
254
110
|
var SCALE_REFERENCE_WIDTH = 300;
|
|
255
|
-
const
|
|
256
|
-
code: "function
|
|
257
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
258
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
111
|
+
const _worklet_6765538674509_init_data = {
|
|
112
|
+
code: "function pressScaleFor_chunkP5MKOLIWCjs1(width){const{SCALE_REFERENCE_WIDTH,PRESS_SCALE}=this.__closure;const coefficient=width>0?SCALE_REFERENCE_WIDTH/width:1;return 1-(1-PRESS_SCALE)*coefficient;}",
|
|
113
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs",
|
|
114
|
+
sourceMap: "{\"version\":3,\"names\":[\"pressScaleFor_chunkP5MKOLIWCjs1\",\"width\",\"SCALE_REFERENCE_WIDTH\",\"PRESS_SCALE\",\"__closure\",\"coefficient\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs\"],\"mappings\":\"AA4EA,SAAAA,+BAA8BA,CAAAC,KAAA,QAAAC,qBAAA,CAAAC,WAAA,OAAAC,SAAA,CAE5B,KAAM,CAAAC,WAAW,CAAGJ,KAAK,CAAG,CAAC,CAAGC,qBAAqB,CAAGD,KAAK,CAAG,CAAC,CACjE,MAAO,EAAC,CAAG,CAAC,CAAC,CAAGE,WAAW,EAAIE,WAAW,CAC5C\",\"ignoreList\":[]}"
|
|
259
115
|
};
|
|
260
|
-
const pressScaleFor = function
|
|
261
|
-
|
|
116
|
+
const pressScaleFor = function pressScaleFor_chunkP5MKOLIWCjs1Factory({
|
|
117
|
+
_worklet_6765538674509_init_data,
|
|
262
118
|
SCALE_REFERENCE_WIDTH,
|
|
263
119
|
PRESS_SCALE
|
|
264
120
|
}) {
|
|
@@ -271,13 +127,13 @@ const pressScaleFor = function pressScaleFor_chunkPUER6Y4MCjs1Factory({
|
|
|
271
127
|
SCALE_REFERENCE_WIDTH,
|
|
272
128
|
PRESS_SCALE
|
|
273
129
|
};
|
|
274
|
-
pressScaleFor.__workletHash =
|
|
130
|
+
pressScaleFor.__workletHash = 6765538674509;
|
|
275
131
|
pressScaleFor.__pluginVersion = "0.7.4";
|
|
276
|
-
pressScaleFor.__initData =
|
|
132
|
+
pressScaleFor.__initData = _worklet_6765538674509_init_data;
|
|
277
133
|
pressScaleFor.__stackDetails = _e;
|
|
278
134
|
return pressScaleFor;
|
|
279
135
|
}({
|
|
280
|
-
|
|
136
|
+
_worklet_6765538674509_init_data,
|
|
281
137
|
SCALE_REFERENCE_WIDTH,
|
|
282
138
|
PRESS_SCALE
|
|
283
139
|
});
|
|
@@ -290,26 +146,26 @@ var RIPPLE_CONFIRM_DURATION = 225;
|
|
|
290
146
|
var RIPPLE_FADE_IN = 75;
|
|
291
147
|
var RIPPLE_FADE_OUT_DELAY = 225;
|
|
292
148
|
var RIPPLE_FADE_OUT = 150;
|
|
293
|
-
const
|
|
294
|
-
code: "function
|
|
295
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
296
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
149
|
+
const _worklet_16027664241398_init_data = {
|
|
150
|
+
code: "function rippleRadiusFor_chunkP5MKOLIWCjs2(width,height){return Math.sqrt(width*width+height*height)/2+5;}",
|
|
151
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs",
|
|
152
|
+
sourceMap: "{\"version\":3,\"names\":[\"rippleRadiusFor_chunkP5MKOLIWCjs2\",\"width\",\"height\",\"Math\",\"sqrt\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs\"],\"mappings\":\"AA0FA,SAAAA,iCAAwCA,CAAAC,KAAA,CAAAC,MAAA,EAEtC,MAAO,CAAAC,IAAI,CAACC,IAAI,CAACH,KAAK,CAAGA,KAAK,CAAGC,MAAM,CAAGA,MAAM,CAAC,CAAG,CAAC,CAAG,CAAC,CAC3D\",\"ignoreList\":[]}"
|
|
297
153
|
};
|
|
298
|
-
const rippleRadiusFor = function
|
|
299
|
-
|
|
154
|
+
const rippleRadiusFor = function rippleRadiusFor_chunkP5MKOLIWCjs2Factory({
|
|
155
|
+
_worklet_16027664241398_init_data
|
|
300
156
|
}) {
|
|
301
157
|
const _e = [new global.Error(), 1, -27];
|
|
302
158
|
const rippleRadiusFor = function (width, height) {
|
|
303
159
|
return Math.sqrt(width * width + height * height) / 2 + 5;
|
|
304
160
|
};
|
|
305
161
|
rippleRadiusFor.__closure = {};
|
|
306
|
-
rippleRadiusFor.__workletHash =
|
|
162
|
+
rippleRadiusFor.__workletHash = 16027664241398;
|
|
307
163
|
rippleRadiusFor.__pluginVersion = "0.7.4";
|
|
308
|
-
rippleRadiusFor.__initData =
|
|
164
|
+
rippleRadiusFor.__initData = _worklet_16027664241398_init_data;
|
|
309
165
|
rippleRadiusFor.__stackDetails = _e;
|
|
310
166
|
return rippleRadiusFor;
|
|
311
167
|
}({
|
|
312
|
-
|
|
168
|
+
_worklet_16027664241398_init_data
|
|
313
169
|
});
|
|
314
170
|
var ALL_OFF = {
|
|
315
171
|
scale: false,
|
|
@@ -435,7 +291,7 @@ function radiusFrom(style) {
|
|
|
435
291
|
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
436
292
|
|
|
437
293
|
var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
|
|
438
|
-
var AnimatedSlot = _reactnativereanimated2.default.createAnimatedComponent(Slot);
|
|
294
|
+
var AnimatedSlot = _reactnativereanimated2.default.createAnimatedComponent(_chunk5SU7FXWHcjs.Slot);
|
|
439
295
|
var PressableFeedback = _react.forwardRef.call(void 0, function PressableFeedback2({
|
|
440
296
|
animation,
|
|
441
297
|
style,
|
|
@@ -443,7 +299,7 @@ var PressableFeedback = _react.forwardRef.call(void 0, function PressableFeedbac
|
|
|
443
299
|
}, ref) {
|
|
444
300
|
const inheritedDisableAll = _react.useContext.call(void 0, DisableAllContext);
|
|
445
301
|
const resolved = resolveAnimation(animation, inheritedDisableAll);
|
|
446
|
-
const [styleProps, rest] = useStyleProps(props);
|
|
302
|
+
const [styleProps, rest] = _chunk5SU7FXWHcjs.useStyleProps.call(void 0, props);
|
|
447
303
|
const Feedback = resolved.none ? StaticFeedback : AnimatedFeedback;
|
|
448
304
|
const body = /* @__PURE__ */_jsxruntime.jsx.call(void 0, Feedback, {
|
|
449
305
|
ref,
|
|
@@ -471,7 +327,7 @@ var StaticFeedback = _react.forwardRef.call(void 0, function StaticFeedback2({
|
|
|
471
327
|
animation,
|
|
472
328
|
...surface
|
|
473
329
|
}), [isPressed, animation, surface]);
|
|
474
|
-
const Root = asChild ? Slot : _reactnative.Pressable;
|
|
330
|
+
const Root = asChild ? _chunk5SU7FXWHcjs.Slot : _reactnative.Pressable;
|
|
475
331
|
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, FeedbackProvider, {
|
|
476
332
|
value: context,
|
|
477
333
|
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, Root, {
|
|
@@ -483,10 +339,10 @@ var StaticFeedback = _react.forwardRef.call(void 0, function StaticFeedback2({
|
|
|
483
339
|
})
|
|
484
340
|
});
|
|
485
341
|
});
|
|
486
|
-
const
|
|
487
|
-
code: "function
|
|
488
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
489
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
342
|
+
const _worklet_3780393475220_init_data = {
|
|
343
|
+
code: "function chunkP5MKOLIWCjs3(){const{animation,pressedScale,progress}=this.__closure;if(!animation.scale)return{};return{transform:[{scale:1-(1-pressedScale.value)*progress.value}]};}",
|
|
344
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs",
|
|
345
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkP5MKOLIWCjs3\",\"animation\",\"pressedScale\",\"progress\",\"__closure\",\"scale\",\"transform\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs\"],\"mappings\":\"AAyQ6E,SAAAA,iBAAMA,CAAA,QAAAC,SAAA,CAAAC,YAAA,CAAAC,QAAA,OAAAC,SAAA,CAE/E,GAAI,CAACH,SAAS,CAACI,KAAK,CAAE,MAAO,CAAC,CAAC,CAC/B,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAED,KAAK,CAAE,CAAC,CAAG,CAAC,CAAC,CAAGH,YAAY,CAACK,KAAK,EAAIJ,QAAQ,CAACI,KAAM,CAAC,CAAE,CAAC,CAClF\",\"ignoreList\":[]}"
|
|
490
346
|
};
|
|
491
347
|
var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2({
|
|
492
348
|
isPressed = false,
|
|
@@ -515,14 +371,14 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
515
371
|
});
|
|
516
372
|
}, [isPressed, progress]);
|
|
517
373
|
const pressedScale = _reactnativereanimated.useDerivedValue.call(void 0, () => pressScaleFor(size.value.width));
|
|
518
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function
|
|
519
|
-
|
|
374
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkP5MKOLIWCjs3Factory({
|
|
375
|
+
_worklet_3780393475220_init_data,
|
|
520
376
|
animation,
|
|
521
377
|
pressedScale,
|
|
522
378
|
progress
|
|
523
379
|
}) {
|
|
524
380
|
const _e = [new global.Error(), -4, -27];
|
|
525
|
-
const
|
|
381
|
+
const chunkP5MKOLIWCjs3 = function () {
|
|
526
382
|
if (!animation.scale) return {};
|
|
527
383
|
return {
|
|
528
384
|
transform: [{
|
|
@@ -530,18 +386,18 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
530
386
|
}]
|
|
531
387
|
};
|
|
532
388
|
};
|
|
533
|
-
|
|
389
|
+
chunkP5MKOLIWCjs3.__closure = {
|
|
534
390
|
animation,
|
|
535
391
|
pressedScale,
|
|
536
392
|
progress
|
|
537
393
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
return
|
|
394
|
+
chunkP5MKOLIWCjs3.__workletHash = 3780393475220;
|
|
395
|
+
chunkP5MKOLIWCjs3.__pluginVersion = "0.7.4";
|
|
396
|
+
chunkP5MKOLIWCjs3.__initData = _worklet_3780393475220_init_data;
|
|
397
|
+
chunkP5MKOLIWCjs3.__stackDetails = _e;
|
|
398
|
+
return chunkP5MKOLIWCjs3;
|
|
543
399
|
}({
|
|
544
|
-
|
|
400
|
+
_worklet_3780393475220_init_data,
|
|
545
401
|
animation,
|
|
546
402
|
pressedScale,
|
|
547
403
|
progress
|
|
@@ -574,7 +430,7 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
574
430
|
wave.alpha.value = _reactnativereanimated.withTiming.call(void 0, 1, {
|
|
575
431
|
duration: RIPPLE_FADE_IN
|
|
576
432
|
});
|
|
577
|
-
_optionalChain([onTouchStart, 'optionalCall',
|
|
433
|
+
_optionalChain([onTouchStart, 'optionalCall', _ => _(event)]);
|
|
578
434
|
};
|
|
579
435
|
const releaseWave = () => {
|
|
580
436
|
const wave = waves[nextWave.current === 0 ? 1 : 0];
|
|
@@ -588,11 +444,11 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
588
444
|
};
|
|
589
445
|
const handleTouchEnd = event => {
|
|
590
446
|
releaseWave();
|
|
591
|
-
_optionalChain([onTouchEnd, 'optionalCall',
|
|
447
|
+
_optionalChain([onTouchEnd, 'optionalCall', _2 => _2(event)]);
|
|
592
448
|
};
|
|
593
449
|
const handleTouchCancel = event => {
|
|
594
450
|
releaseWave();
|
|
595
|
-
_optionalChain([onTouchCancel, 'optionalCall',
|
|
451
|
+
_optionalChain([onTouchCancel, 'optionalCall', _3 => _3(event)]);
|
|
596
452
|
};
|
|
597
453
|
const handleLayout = event => {
|
|
598
454
|
const {
|
|
@@ -603,7 +459,7 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
603
459
|
width,
|
|
604
460
|
height
|
|
605
461
|
};
|
|
606
|
-
_optionalChain([onLayout, 'optionalCall',
|
|
462
|
+
_optionalChain([onLayout, 'optionalCall', _4 => _4(event)]);
|
|
607
463
|
};
|
|
608
464
|
const Root = asChild ? AnimatedSlot : AnimatedPressable;
|
|
609
465
|
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, FeedbackProvider, {
|
|
@@ -637,7 +493,7 @@ function useSurface(style) {
|
|
|
637
493
|
return _react.useMemo.call(void 0, () => {
|
|
638
494
|
const flat = _reactnative.StyleSheet.flatten(style);
|
|
639
495
|
return {
|
|
640
|
-
ink: inkFor(_optionalChain([flat, 'optionalAccess',
|
|
496
|
+
ink: inkFor(_optionalChain([flat, 'optionalAccess', _5 => _5.backgroundColor]), theme.colors),
|
|
641
497
|
corners: radiusFrom(flat)
|
|
642
498
|
};
|
|
643
499
|
}, [style, theme]);
|
|
@@ -658,7 +514,7 @@ function PressableFeedbackHighlight({
|
|
|
658
514
|
ink,
|
|
659
515
|
corners
|
|
660
516
|
} = useFeedback();
|
|
661
|
-
const [styleProps] = useStyleProps(props);
|
|
517
|
+
const [styleProps] = _chunk5SU7FXWHcjs.useStyleProps.call(void 0, props);
|
|
662
518
|
const settings = resolveSlotAnimation(override, animation.highlight, HIGHLIGHT_OPACITY, HIGHLIGHT_DURATION);
|
|
663
519
|
const base = [_reactnative.StyleSheet.absoluteFillObject, {
|
|
664
520
|
backgroundColor: ink,
|
|
@@ -683,10 +539,10 @@ function PressableFeedbackHighlight({
|
|
|
683
539
|
}
|
|
684
540
|
PressableFeedbackHighlight.displayName = "XAUI.PressableFeedback.Highlight";
|
|
685
541
|
markOverlay(PressableFeedbackHighlight);
|
|
686
|
-
const
|
|
687
|
-
code: "function
|
|
688
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
689
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
542
|
+
const _worklet_4159583955298_init_data = {
|
|
543
|
+
code: "function chunkP5MKOLIWCjs4(){const{shown,opacity}=this.__closure;return{opacity:shown.value*opacity};}",
|
|
544
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs",
|
|
545
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkP5MKOLIWCjs4\",\"shown\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs\"],\"mappings\":\"AAuZ6E,SAAAA,iBAAMA,CAAA,QAAAC,KAAA,CAAAC,OAAA,OAAAC,SAAA,CAE/E,MAAO,CAAED,OAAO,CAAED,KAAK,CAACG,KAAK,CAAGF,OAAQ,CAAC,CAC3C\",\"ignoreList\":[]}"
|
|
690
546
|
};
|
|
691
547
|
function AnimatedHighlight({
|
|
692
548
|
base,
|
|
@@ -702,28 +558,28 @@ function AnimatedHighlight({
|
|
|
702
558
|
duration
|
|
703
559
|
});
|
|
704
560
|
}, [isPressed, shown, duration]);
|
|
705
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function
|
|
706
|
-
|
|
561
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkP5MKOLIWCjs4Factory({
|
|
562
|
+
_worklet_4159583955298_init_data,
|
|
707
563
|
shown,
|
|
708
564
|
opacity
|
|
709
565
|
}) {
|
|
710
566
|
const _e = [new global.Error(), -3, -27];
|
|
711
|
-
const
|
|
567
|
+
const chunkP5MKOLIWCjs4 = function () {
|
|
712
568
|
return {
|
|
713
569
|
opacity: shown.value * opacity
|
|
714
570
|
};
|
|
715
571
|
};
|
|
716
|
-
|
|
572
|
+
chunkP5MKOLIWCjs4.__closure = {
|
|
717
573
|
shown,
|
|
718
574
|
opacity
|
|
719
575
|
};
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
return
|
|
576
|
+
chunkP5MKOLIWCjs4.__workletHash = 4159583955298;
|
|
577
|
+
chunkP5MKOLIWCjs4.__pluginVersion = "0.7.4";
|
|
578
|
+
chunkP5MKOLIWCjs4.__initData = _worklet_4159583955298_init_data;
|
|
579
|
+
chunkP5MKOLIWCjs4.__stackDetails = _e;
|
|
580
|
+
return chunkP5MKOLIWCjs4;
|
|
725
581
|
}({
|
|
726
|
-
|
|
582
|
+
_worklet_4159583955298_init_data,
|
|
727
583
|
shown,
|
|
728
584
|
opacity
|
|
729
585
|
}), [shown, opacity]);
|
|
@@ -746,7 +602,7 @@ function PressableFeedbackRipple({
|
|
|
746
602
|
ink,
|
|
747
603
|
corners
|
|
748
604
|
} = useFeedback();
|
|
749
|
-
const [styleProps] = useStyleProps(props);
|
|
605
|
+
const [styleProps] = _chunk5SU7FXWHcjs.useStyleProps.call(void 0, props);
|
|
750
606
|
const waveStyle = [styleProps, style];
|
|
751
607
|
const settings = resolveSlotAnimation(override, animation.ripple, RIPPLE_OPACITY);
|
|
752
608
|
const [size, setSize] = _react.useState.call(void 0, {
|
|
@@ -787,10 +643,10 @@ function PressableFeedbackRipple({
|
|
|
787
643
|
}
|
|
788
644
|
PressableFeedbackRipple.displayName = "XAUI.PressableFeedback.Ripple";
|
|
789
645
|
markOverlay(PressableFeedbackRipple);
|
|
790
|
-
const
|
|
791
|
-
code: "function
|
|
792
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
793
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
646
|
+
const _worklet_17082358914191_init_data = {
|
|
647
|
+
code: "function chunkP5MKOLIWCjs5(){const{wave,RIPPLE_START_SCALE,center,opacity,radius}=this.__closure;const t=wave.expand.value;const from=wave.origin.value;const scale=RIPPLE_START_SCALE+(1-RIPPLE_START_SCALE)*t;const x=from.x+(center.x-from.x)*t;const y=from.y+(center.y-from.y)*t;return{opacity:wave.alpha.value*opacity,transform:[{translateX:x-radius},{translateY:y-radius},{scale:scale}]};}",
|
|
648
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs",
|
|
649
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkP5MKOLIWCjs5\",\"wave\",\"RIPPLE_START_SCALE\",\"center\",\"opacity\",\"radius\",\"__closure\",\"t\",\"expand\",\"value\",\"from\",\"origin\",\"scale\",\"x\",\"y\",\"alpha\",\"transform\",\"translateX\",\"translateY\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-P5MKOLIW.cjs\"],\"mappings\":\"AAud6E,SAAAA,iBAAMA,CAAA,QAAAC,IAAA,CAAAC,kBAAA,CAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA,OAAAC,SAAA,CAE/E,KAAM,CAAAC,CAAC,CAAGN,IAAI,CAACO,MAAM,CAACC,KAAK,CAC3B,KAAM,CAAAC,IAAI,CAAGT,IAAI,CAACU,MAAM,CAACF,KAAK,CAC9B,KAAM,CAAAG,KAAK,CAAGV,kBAAkB,CAAG,CAAC,CAAC,CAAGA,kBAAkB,EAAIK,CAAC,CAC/D,KAAM,CAAAM,CAAC,CAAGH,IAAI,CAACG,CAAC,CAAG,CAACV,MAAM,CAACU,CAAC,CAAGH,IAAI,CAACG,CAAC,EAAIN,CAAC,CAC1C,KAAM,CAAAO,CAAC,CAAGJ,IAAI,CAACI,CAAC,CAAG,CAACX,MAAM,CAACW,CAAC,CAAGJ,IAAI,CAACI,CAAC,EAAIP,CAAC,CAC1C,MAAO,CAELH,OAAO,CAAEH,IAAI,CAACc,KAAK,CAACN,KAAK,CAAGL,OAAO,CACnCY,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEJ,CAAC,CAAGR,MAAO,CAAC,CAAE,CAAEa,UAAU,CAAEJ,CAAC,CAAGT,MAAO,CAAC,CAAE,CAAEO,KAAA,CAAAA,KAAM,CAAC,CAC/E,CAAC,CACH\",\"ignoreList\":[]}"
|
|
794
650
|
};
|
|
795
651
|
function RippleWave({
|
|
796
652
|
wave,
|
|
@@ -800,8 +656,8 @@ function RippleWave({
|
|
|
800
656
|
opacity,
|
|
801
657
|
style
|
|
802
658
|
}) {
|
|
803
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function
|
|
804
|
-
|
|
659
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkP5MKOLIWCjs5Factory({
|
|
660
|
+
_worklet_17082358914191_init_data,
|
|
805
661
|
wave,
|
|
806
662
|
RIPPLE_START_SCALE,
|
|
807
663
|
center,
|
|
@@ -809,7 +665,7 @@ function RippleWave({
|
|
|
809
665
|
radius
|
|
810
666
|
}) {
|
|
811
667
|
const _e = [new global.Error(), -6, -27];
|
|
812
|
-
const
|
|
668
|
+
const chunkP5MKOLIWCjs5 = function () {
|
|
813
669
|
const t = wave.expand.value;
|
|
814
670
|
const from = wave.origin.value;
|
|
815
671
|
const scale = RIPPLE_START_SCALE + (1 - RIPPLE_START_SCALE) * t;
|
|
@@ -827,20 +683,20 @@ function RippleWave({
|
|
|
827
683
|
}]
|
|
828
684
|
};
|
|
829
685
|
};
|
|
830
|
-
|
|
686
|
+
chunkP5MKOLIWCjs5.__closure = {
|
|
831
687
|
wave,
|
|
832
688
|
RIPPLE_START_SCALE,
|
|
833
689
|
center,
|
|
834
690
|
opacity,
|
|
835
691
|
radius
|
|
836
692
|
};
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
return
|
|
693
|
+
chunkP5MKOLIWCjs5.__workletHash = 17082358914191;
|
|
694
|
+
chunkP5MKOLIWCjs5.__pluginVersion = "0.7.4";
|
|
695
|
+
chunkP5MKOLIWCjs5.__initData = _worklet_17082358914191_init_data;
|
|
696
|
+
chunkP5MKOLIWCjs5.__stackDetails = _e;
|
|
697
|
+
return chunkP5MKOLIWCjs5;
|
|
842
698
|
}({
|
|
843
|
-
|
|
699
|
+
_worklet_17082358914191_init_data,
|
|
844
700
|
wave,
|
|
845
701
|
RIPPLE_START_SCALE,
|
|
846
702
|
center,
|
|
@@ -876,163 +732,9 @@ var PressableFeedback3 = Object.assign(PressableFeedback, {
|
|
|
876
732
|
Highlight: PressableFeedbackHighlight,
|
|
877
733
|
Ripple: PressableFeedbackRipple
|
|
878
734
|
});
|
|
879
|
-
|
|
880
|
-
// src/system/recipe/resolve-tint.ts
|
|
881
|
-
var TINT_SLICE_BY_SUFFIX = [[/SoftForeground$/, "softForeground"], [/SoftPressed$/, "softPressed"], [/Soft$/, "soft"], [/Foreground$/, "foreground"], [/Pressed$/, "pressed"]];
|
|
882
|
-
function tintSliceFor(token) {
|
|
883
|
-
for (const [suffix, slice] of TINT_SLICE_BY_SUFFIX) {
|
|
884
|
-
if (suffix.test(token)) return slice;
|
|
885
|
-
}
|
|
886
|
-
return "base";
|
|
887
|
-
}
|
|
888
|
-
function resolveTint(tokens, color, theme) {
|
|
889
|
-
const tint = _chunk6N5JXRUZcjs.deriveTint.call(void 0, color, theme);
|
|
890
|
-
const colors = {};
|
|
891
|
-
for (const [role, token] of Object.entries(_nullishCoalesce(tokens, () => ({})))) {
|
|
892
|
-
colors[role] = tint[tintSliceFor(token)];
|
|
893
|
-
}
|
|
894
|
-
return colors;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
// src/system/recipe/style-cache.ts
|
|
898
|
-
|
|
899
|
-
// src/system/recipe/variant-map.ts
|
|
900
|
-
var STATE_ORDER = ["focused", "pressed", "disabled"];
|
|
901
|
-
function resolveSelection(defaultVariants, selection) {
|
|
902
|
-
const resolved = {
|
|
903
|
-
...defaultVariants
|
|
904
|
-
};
|
|
905
|
-
for (const [axis, value] of Object.entries(_nullishCoalesce(selection, () => ({})))) {
|
|
906
|
-
if (value !== void 0) resolved[axis] = value;
|
|
907
|
-
}
|
|
908
|
-
return resolved;
|
|
909
|
-
}
|
|
910
|
-
function resolveVariantColors(tokens, theme) {
|
|
911
|
-
const colors = {};
|
|
912
|
-
for (const [role, token] of entriesOf(tokens)) {
|
|
913
|
-
const value = theme.colors[token];
|
|
914
|
-
if (value === void 0) {
|
|
915
|
-
throw new Error(`XAUI: the recipe names "${token}" for its "${role}" role, but the theme has no such colour token. Check the spelling against XAUIColors.`);
|
|
916
|
-
}
|
|
917
|
-
colors[role] = value;
|
|
918
|
-
}
|
|
919
|
-
return colors;
|
|
920
|
-
}
|
|
921
|
-
function activeStateFns(states, active) {
|
|
922
|
-
const fns = [];
|
|
923
|
-
for (const state of STATE_ORDER) {
|
|
924
|
-
const fn = active[state] ? _optionalChain([states, 'optionalAccess', _8 => _8[state]]) : void 0;
|
|
925
|
-
if (fn) fns.push(fn);
|
|
926
|
-
}
|
|
927
|
-
return fns;
|
|
928
|
-
}
|
|
929
|
-
function collectStyleFns(config, selection, states) {
|
|
930
|
-
const fns = [];
|
|
931
|
-
if (config.base) fns.push(config.base);
|
|
932
|
-
if (config.paint) fns.push(config.paint);
|
|
933
|
-
for (const [axis, values] of Object.entries(_nullishCoalesce(config.variants, () => ({})))) {
|
|
934
|
-
const value = selection[axis];
|
|
935
|
-
const fn = value === void 0 ? void 0 : values[value];
|
|
936
|
-
if (fn) fns.push(fn);
|
|
937
|
-
}
|
|
938
|
-
for (const compound of _nullishCoalesce(config.compoundVariants, () => [])) {
|
|
939
|
-
if (appliesTo(compound.when, selection)) fns.push(compound.style);
|
|
940
|
-
}
|
|
941
|
-
return [...fns, ...activeStateFns(config.states, states)];
|
|
942
|
-
}
|
|
943
|
-
function appliesTo(when, selection) {
|
|
944
|
-
return Object.entries(when).every(([axis, value]) => selection[axis] === value);
|
|
945
|
-
}
|
|
946
|
-
function entriesOf(tokens) {
|
|
947
|
-
return Object.entries(_nullishCoalesce(tokens, () => ({})));
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
// src/system/recipe/style-cache.ts
|
|
951
|
-
function createStyleCache(slots) {
|
|
952
|
-
const entries = /* @__PURE__ */new Map();
|
|
953
|
-
return {
|
|
954
|
-
read(key, build) {
|
|
955
|
-
const hit = entries.get(key);
|
|
956
|
-
if (hit) return hit;
|
|
957
|
-
const built = build();
|
|
958
|
-
const complete = {};
|
|
959
|
-
for (const slot of slots) complete[slot] = _nullishCoalesce(built[slot], () => ({}));
|
|
960
|
-
const created = _reactnative.StyleSheet.create(complete);
|
|
961
|
-
entries.set(key, created);
|
|
962
|
-
return created;
|
|
963
|
-
},
|
|
964
|
-
get size() {
|
|
965
|
-
return entries.size;
|
|
966
|
-
},
|
|
967
|
-
clear() {
|
|
968
|
-
entries.clear();
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
|
-
}
|
|
972
|
-
function cacheKey(theme, selection, states) {
|
|
973
|
-
const axes = Object.keys(selection).sort().map(axis => `${axis}:${_nullishCoalesce(selection[axis], () => "-")}`).join("|");
|
|
974
|
-
const active = STATE_ORDER.filter(state => states[state]).join(",");
|
|
975
|
-
return `${theme.id}|${theme.mode}|${axes}|${active}`;
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
// src/system/recipe/create-recipe.ts
|
|
979
|
-
function createRecipe(config) {
|
|
980
|
-
const cache = createStyleCache(config.slots);
|
|
981
|
-
const tokensFor = variant => variant === void 0 ? void 0 : _optionalChain([config, 'access', _9 => _9.variantTokens, 'optionalAccess', _10 => _10[variant]]);
|
|
982
|
-
return {
|
|
983
|
-
slots: config.slots,
|
|
984
|
-
resolve({
|
|
985
|
-
theme,
|
|
986
|
-
selection,
|
|
987
|
-
states = {}
|
|
988
|
-
}) {
|
|
989
|
-
const resolved = resolveSelection(config.defaultVariants, selection);
|
|
990
|
-
return cache.read(cacheKey(theme, resolved, states), () => {
|
|
991
|
-
const colors = resolveVariantColors(tokensFor(resolved.variant), theme);
|
|
992
|
-
return apply(collectStyleFns(config, resolved, states), theme, colors);
|
|
993
|
-
});
|
|
994
|
-
},
|
|
995
|
-
tint({
|
|
996
|
-
theme,
|
|
997
|
-
color,
|
|
998
|
-
selection,
|
|
999
|
-
states = {}
|
|
1000
|
-
}) {
|
|
1001
|
-
if (!config.paint) return {};
|
|
1002
|
-
const resolved = resolveSelection(config.defaultVariants, selection);
|
|
1003
|
-
const tokens = tokensFor(resolved.variant);
|
|
1004
|
-
if (!tokens) return {};
|
|
1005
|
-
const colors = resolveTint(tokens, color, theme);
|
|
1006
|
-
const fns = [config.paint, ...activeStateFns(config.states, states)];
|
|
1007
|
-
return apply(fns, theme, colors);
|
|
1008
|
-
}
|
|
1009
|
-
};
|
|
1010
|
-
}
|
|
1011
|
-
function apply(fns, theme, colors) {
|
|
1012
|
-
const merged = {};
|
|
1013
|
-
for (const fn of fns) {
|
|
1014
|
-
const produced = fn(theme, colors);
|
|
1015
|
-
for (const slot of Object.keys(produced)) {
|
|
1016
|
-
const style = produced[slot];
|
|
1017
|
-
if (!style) continue;
|
|
1018
|
-
const previous = merged[slot];
|
|
1019
|
-
merged[slot] = previous ? {
|
|
1020
|
-
...previous,
|
|
1021
|
-
...style
|
|
1022
|
-
} : style;
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
return merged;
|
|
1026
|
-
}
|
|
1027
|
-
exports.useStyleProps = useStyleProps;
|
|
1028
735
|
exports.IconContext = IconContext;
|
|
1029
736
|
exports.useIconContext = useIconContext;
|
|
1030
737
|
exports.Icon = Icon;
|
|
1031
|
-
exports.childrenToString = childrenToString;
|
|
1032
|
-
exports.createSlotContext = createSlotContext;
|
|
1033
|
-
exports.mergeRefs = mergeRefs;
|
|
1034
|
-
exports.mergeProps = mergeProps;
|
|
1035
|
-
exports.Slot = Slot;
|
|
1036
738
|
exports.useFeedback = useFeedback;
|
|
1037
739
|
exports.PRESS_SCALE = PRESS_SCALE;
|
|
1038
740
|
exports.PRESS_DURATION = PRESS_DURATION;
|
|
@@ -1052,5 +754,4 @@ exports.resolveAnimation = resolveAnimation;
|
|
|
1052
754
|
exports.resolveSlotAnimation = resolveSlotAnimation;
|
|
1053
755
|
exports.FEEDBACK_OVERLAY = FEEDBACK_OVERLAY;
|
|
1054
756
|
exports.markOverlay = markOverlay;
|
|
1055
|
-
exports.PressableFeedback = PressableFeedback3;
|
|
1056
|
-
exports.createRecipe = createRecipe;
|
|
757
|
+
exports.PressableFeedback = PressableFeedback3;
|