@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.
Files changed (42) hide show
  1. package/dist/chunk-4K3LZS7M.js +448 -0
  2. package/dist/chunk-5SU7FXWH.cjs +448 -0
  3. package/dist/chunk-6PZF4PI7.js +100 -0
  4. package/dist/chunk-6VTBGBPP.cjs +100 -0
  5. package/dist/{chunk-KCUT47FY.cjs → chunk-BHAHJHAI.cjs} +5 -1
  6. package/dist/{chunk-UOJBK5Z4.js → chunk-L3AQNVRN.js} +1 -1
  7. package/dist/{chunk-BAACHVM4.cjs → chunk-M2VYRHVS.cjs} +2 -2
  8. package/dist/{chunk-E3756MJC.js → chunk-MBLPPOSO.js} +16 -15
  9. package/dist/{chunk-NLFE3CRM.cjs → chunk-ODH5WAVM.cjs} +24 -23
  10. package/dist/{chunk-PUER6Y4M.cjs → chunk-P5MKOLIW.cjs} +110 -409
  11. package/dist/chunk-VQPP6FCB.js +728 -0
  12. package/dist/{chunk-EHHSY2KB.js → chunk-XQE5PXOD.js} +5 -1
  13. package/dist/components/button/index.cjs +4 -3
  14. package/dist/components/button/index.d.cts +179 -178
  15. package/dist/components/button/index.d.ts +179 -178
  16. package/dist/components/button/index.js +3 -2
  17. package/dist/components/typography/index.cjs +12 -0
  18. package/dist/components/typography/index.d.cts +115 -0
  19. package/dist/components/typography/index.d.ts +115 -0
  20. package/dist/components/typography/index.js +12 -0
  21. package/dist/create-recipe-3_ElpCYt.d.cts +117 -0
  22. package/dist/create-recipe-DImq1AZA.d.ts +117 -0
  23. package/dist/index.cjs +17 -7
  24. package/dist/index.d.cts +4 -2
  25. package/dist/index.d.ts +4 -2
  26. package/dist/index.js +21 -11
  27. package/dist/pressable-feedback.type-UwqIG6ES.d.ts +195 -0
  28. package/dist/pressable-feedback.type-lgW5wQx5.d.cts +195 -0
  29. package/dist/system/index.cjs +5 -3
  30. package/dist/system/index.d.cts +10 -4
  31. package/dist/system/index.d.ts +10 -4
  32. package/dist/system/index.js +11 -9
  33. package/dist/theme/index.cjs +2 -2
  34. package/dist/theme/index.d.cts +2 -2
  35. package/dist/theme/index.d.ts +2 -2
  36. package/dist/theme/index.js +1 -1
  37. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  38. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  39. package/package.json +11 -1
  40. package/dist/chunk-64L44HEI.js +0 -1021
  41. package/dist/create-recipe-BcUu9b2I.d.cts +0 -280
  42. package/dist/create-recipe-DD9W6m9b.d.ts +0 -280
@@ -1,1021 +0,0 @@
1
- import { contrastOn, deriveTint, isHex, stableHash, useXAUITheme } from "./chunk-XJARE6SC.js";
2
-
3
- // src/system/style-props/use-style-props.ts
4
- import { useMemo } from "react";
5
-
6
- // src/utils/style-props.ts
7
- var STYLE_PROP_KEYS = [
8
- // Flex and layout
9
- "alignContent", "alignItems", "alignSelf", "aspectRatio", "boxSizing", "columnGap", "direction", "display", "flex", "flexBasis", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "gap", "justifyContent", "overflow", "rowGap",
10
- // Position
11
- "bottom", "end", "inset", "insetBlock", "insetBlockEnd", "insetBlockStart", "insetInline", "insetInlineEnd", "insetInlineStart", "position", "start", "top", "zIndex",
12
- // Margin
13
- "margin", "marginBlock", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginEnd", "marginHorizontal", "marginInline", "marginInlineEnd", "marginInlineStart", "marginStart", "marginTop", "marginVertical",
14
- // Padding
15
- "padding", "paddingBlock", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingEnd", "paddingHorizontal", "paddingInline", "paddingInlineEnd", "paddingInlineStart", "paddingStart", "paddingTop", "paddingVertical",
16
- // Size
17
- "height", "maxHeight", "maxWidth", "minHeight", "minWidth", "width",
18
- // Border
19
- "borderBlockColor", "borderBlockEndColor", "borderBlockStartColor", "borderBottomColor", "borderBottomEndRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderCurve", "borderEndColor", "borderEndEndRadius", "borderEndStartRadius", "borderEndWidth", "borderRadius", "borderStartColor", "borderStartEndRadius", "borderStartStartRadius", "borderStartWidth", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth",
20
- // Fill, shadow, and the rest of a box's paint
21
- "backfaceVisibility", "backgroundColor", "boxShadow", "cursor", "elevation", "experimental_backgroundImage", "filter", "isolation", "mixBlendMode", "opacity", "outlineColor", "outlineOffset", "outlineStyle", "outlineWidth", "shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius",
22
- // Transform
23
- "rotation", "scaleX", "scaleY", "transform", "transformMatrix", "transformOrigin", "translateX", "translateY",
24
- // Text — a text slot only
25
- "color", "fontFamily", "fontSize", "fontStyle", "fontVariant", "fontWeight", "includeFontPadding", "letterSpacing", "lineHeight", "textAlign", "textAlignVertical", "textDecorationColor", "textDecorationLine", "textDecorationStyle", "textShadowColor", "textShadowOffset", "textShadowRadius", "textTransform", "userSelect", "verticalAlign", "writingDirection",
26
- // Image — an image slot only
27
- "objectFit", "overlayColor", "resizeMode", "tintColor"];
28
- var STYLE_PROP_KEY_SET = new Set(STYLE_PROP_KEYS);
29
- function splitStyleProps(props) {
30
- const styleProps = {};
31
- const rest = {};
32
- for (const [key, value] of Object.entries(props)) {
33
- if (STYLE_PROP_KEY_SET.has(key)) styleProps[key] = value;else rest[key] = value;
34
- }
35
- return [styleProps, rest];
36
- }
37
-
38
- // src/system/style-props/use-style-props.ts
39
- function useStyleProps(props) {
40
- const [styleProps, rest] = splitStyleProps(props);
41
- const key = stableHash(styleProps);
42
- return [useMemo(() => styleProps, [key]), rest];
43
- }
44
-
45
- // src/system/icon/icon-context.ts
46
- import { createContext, useContext } from "react";
47
- var IconContext = createContext({});
48
- IconContext.displayName = "XAUI.Icon.Context";
49
- function useIconContext() {
50
- return useContext(IconContext);
51
- }
52
-
53
- // src/system/icon/icon.tsx
54
- import { cloneElement, isValidElement } from "react";
55
- import { Image } from "react-native";
56
- import { jsx } from "react/jsx-runtime";
57
- function Icon({
58
- as: Component,
59
- children,
60
- source,
61
- size,
62
- color,
63
- style,
64
- ...props
65
- }) {
66
- const inherited = useIconContext();
67
- const theme = useXAUITheme();
68
- const [styleProps] = useStyleProps(props);
69
- const resolvedSize = size ?? inherited.size ?? theme.fontSizes.md;
70
- const resolvedColor = color ?? inherited.color ?? theme.colors.foreground;
71
- if (Component) {
72
- return /* @__PURE__ */jsx(Component, {
73
- size: resolvedSize,
74
- color: resolvedColor
75
- });
76
- }
77
- if (isValidElement(children)) {
78
- return cloneElement(children, {
79
- width: resolvedSize,
80
- height: resolvedSize,
81
- color: resolvedColor
82
- });
83
- }
84
- if (source) {
85
- return /* @__PURE__ */jsx(Image, {
86
- source,
87
- style: [{
88
- width: resolvedSize,
89
- height: resolvedSize,
90
- tintColor: resolvedColor
91
- }, styleProps, style]
92
- });
93
- }
94
- 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.");
95
- }
96
- Icon.displayName = "XAUI.Icon";
97
-
98
- // src/system/slot/children-to-string.ts
99
- import { isValidElement as isValidElement2 } from "react";
100
- function childrenToString(children) {
101
- const text = stringify(children);
102
- return text === null || text === "" ? null : text;
103
- }
104
- function stringify(node) {
105
- if (node === null || node === void 0 || typeof node === "boolean") return "";
106
- if (typeof node === "string") return node;
107
- if (typeof node === "number") return String(node);
108
- if (isValidElement2(node)) return null;
109
- if (Array.isArray(node)) {
110
- let text = "";
111
- for (const child of node) {
112
- const part = stringify(child);
113
- if (part === null) return null;
114
- text += part;
115
- }
116
- return text;
117
- }
118
- return null;
119
- }
120
-
121
- // src/system/slot/create-slot-context.ts
122
- import { createContext as createContext2, useContext as useContext2 } from "react";
123
- function createSlotContext(name) {
124
- const Context = createContext2(null);
125
- Context.displayName = `XAUI.${name}.Context`;
126
- function useSlotContext() {
127
- const value = useContext2(Context);
128
- if (value === null) {
129
- 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.`);
130
- Error.captureStackTrace?.(error, useSlotContext);
131
- throw error;
132
- }
133
- return value;
134
- }
135
- return [Context.Provider, useSlotContext];
136
- }
137
-
138
- // src/system/slot/merge-refs.ts
139
- function mergeRefs(...refs) {
140
- return value => {
141
- for (const ref of refs) {
142
- if (typeof ref === "function") ref(value);else if (ref) ref.current = value;
143
- }
144
- };
145
- }
146
-
147
- // src/system/slot/merge-props.ts
148
- var EVENT_HANDLER = /^on[A-Z]/;
149
- function mergeProps(ours, theirs) {
150
- const merged = {
151
- ...ours
152
- };
153
- for (const key of Object.keys(theirs)) {
154
- const ourValue = ours[key];
155
- const theirValue = theirs[key];
156
- if (EVENT_HANDLER.test(key)) {
157
- merged[key] = composeHandlers(ourValue, theirValue);
158
- } else if (key === "style") {
159
- merged[key] = mergeStyles(ourValue, theirValue);
160
- } else if (key === "ref") {
161
- merged[key] = mergeRefs(ourValue, theirValue);
162
- } else {
163
- merged[key] = theirValue;
164
- }
165
- }
166
- return merged;
167
- }
168
- function composeHandlers(ours, theirs) {
169
- if (typeof ours !== "function") return theirs;
170
- if (typeof theirs !== "function") return ours;
171
- return (...args) => {
172
- ;
173
- ours(...args);
174
- return theirs(...args);
175
- };
176
- }
177
- function mergeStyles(ours, theirs) {
178
- if (typeof ours === "function" || typeof theirs === "function") {
179
- return state => [resolveStyle(ours, state), resolveStyle(theirs, state)];
180
- }
181
- return [ours, theirs];
182
- }
183
- function resolveStyle(style, state) {
184
- return typeof style === "function" ? style(state) : style;
185
- }
186
-
187
- // src/system/slot/slot.tsx
188
- import { cloneElement as cloneElement2, forwardRef, isValidElement as isValidElement3 } from "react";
189
- var Slot = forwardRef(function Slot2({
190
- children,
191
- ...ours
192
- }, ref) {
193
- if (!isValidElement3(children)) {
194
- 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.");
195
- }
196
- const child = children;
197
- const merged = mergeProps(ours, child.props);
198
- merged.ref = mergeRefs(ref, refOf(child));
199
- return cloneElement2(child, merged);
200
- });
201
- Slot.displayName = "XAUI.Slot";
202
- function refOf(element) {
203
- const fromProps = element.props.ref;
204
- const fromElement = element.ref;
205
- return fromProps ?? fromElement;
206
- }
207
-
208
- // src/system/pressable-feedback/pressable-feedback-context.ts
209
- import { createContext as createContext3 } from "react";
210
- var [FeedbackProvider, useFeedback] = createSlotContext("PressableFeedback");
211
- var DisableAllContext = createContext3(false);
212
-
213
- // src/system/pressable-feedback/pressable-feedback.animation.ts
214
- var PRESS_SCALE = 0.985;
215
- var PRESS_DURATION = 300;
216
- var SCALE_REFERENCE_WIDTH = 300;
217
- const _worklet_7139534127642_init_data = {
218
- code: "function pressScaleFor_chunk64L44HEIJs1(width){const{SCALE_REFERENCE_WIDTH,PRESS_SCALE}=this.__closure;const coefficient=width>0?SCALE_REFERENCE_WIDTH/width:1;return 1-(1-PRESS_SCALE)*coefficient;}",
219
- location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js",
220
- sourceMap: "{\"version\":3,\"names\":[\"pressScaleFor_chunk64L44HEIJs1\",\"width\",\"SCALE_REFERENCE_WIDTH\",\"PRESS_SCALE\",\"__closure\",\"coefficient\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js\"],\"mappings\":\"AA2WA,SAAAA,8BAA8BA,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\":[]}"
221
- };
222
- const pressScaleFor = function pressScaleFor_chunk64L44HEIJs1Factory({
223
- _worklet_7139534127642_init_data,
224
- SCALE_REFERENCE_WIDTH,
225
- PRESS_SCALE
226
- }) {
227
- const _e = [new global.Error(), -3, -27];
228
- const pressScaleFor = function (width) {
229
- const coefficient = width > 0 ? SCALE_REFERENCE_WIDTH / width : 1;
230
- return 1 - (1 - PRESS_SCALE) * coefficient;
231
- };
232
- pressScaleFor.__closure = {
233
- SCALE_REFERENCE_WIDTH,
234
- PRESS_SCALE
235
- };
236
- pressScaleFor.__workletHash = 7139534127642;
237
- pressScaleFor.__pluginVersion = "0.7.4";
238
- pressScaleFor.__initData = _worklet_7139534127642_init_data;
239
- pressScaleFor.__stackDetails = _e;
240
- return pressScaleFor;
241
- }({
242
- _worklet_7139534127642_init_data,
243
- SCALE_REFERENCE_WIDTH,
244
- PRESS_SCALE
245
- });
246
- var HIGHLIGHT_OPACITY = 0.1;
247
- var HIGHLIGHT_DURATION = 200;
248
- var RIPPLE_OPACITY = 0.1;
249
- var RIPPLE_START_SCALE = 0.3;
250
- var RIPPLE_EXPAND_DURATION = 1e3;
251
- var RIPPLE_CONFIRM_DURATION = 225;
252
- var RIPPLE_FADE_IN = 75;
253
- var RIPPLE_FADE_OUT_DELAY = 225;
254
- var RIPPLE_FADE_OUT = 150;
255
- const _worklet_8530012985633_init_data = {
256
- code: "function rippleRadiusFor_chunk64L44HEIJs2(width,height){return Math.sqrt(width*width+height*height)/2+5;}",
257
- location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js",
258
- sourceMap: "{\"version\":3,\"names\":[\"rippleRadiusFor_chunk64L44HEIJs2\",\"width\",\"height\",\"Math\",\"sqrt\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js\"],\"mappings\":\"AAyXA,SAAAA,gCAAwCA,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\":[]}"
259
- };
260
- const rippleRadiusFor = function rippleRadiusFor_chunk64L44HEIJs2Factory({
261
- _worklet_8530012985633_init_data
262
- }) {
263
- const _e = [new global.Error(), 1, -27];
264
- const rippleRadiusFor = function (width, height) {
265
- return Math.sqrt(width * width + height * height) / 2 + 5;
266
- };
267
- rippleRadiusFor.__closure = {};
268
- rippleRadiusFor.__workletHash = 8530012985633;
269
- rippleRadiusFor.__pluginVersion = "0.7.4";
270
- rippleRadiusFor.__initData = _worklet_8530012985633_init_data;
271
- rippleRadiusFor.__stackDetails = _e;
272
- return rippleRadiusFor;
273
- }({
274
- _worklet_8530012985633_init_data
275
- });
276
- var ALL_OFF = {
277
- scale: false,
278
- highlight: false,
279
- ripple: false,
280
- none: true
281
- };
282
- var ALL_ON = {
283
- scale: true,
284
- highlight: true,
285
- ripple: true,
286
- none: false
287
- };
288
- function resolveAnimation(animation, inheritedDisableAll = false) {
289
- if (inheritedDisableAll) return {
290
- ...ALL_OFF,
291
- disableAll: true
292
- };
293
- if (animation === false || animation === "disabled") {
294
- return {
295
- ...ALL_OFF,
296
- disableAll: false
297
- };
298
- }
299
- if (animation === "disable-all") return {
300
- ...ALL_OFF,
301
- disableAll: true
302
- };
303
- if (animation === void 0 || animation === true) {
304
- return {
305
- ...ALL_ON,
306
- disableAll: false
307
- };
308
- }
309
- const scale = animation.scale ?? true;
310
- const highlight = animation.highlight ?? true;
311
- const ripple = animation.ripple ?? true;
312
- return {
313
- scale,
314
- highlight,
315
- ripple,
316
- none: !scale && !highlight && !ripple,
317
- disableAll: false
318
- };
319
- }
320
- function resolveSlotAnimation(override, enabledByRoot, defaultOpacity, defaultDuration = PRESS_DURATION) {
321
- const fallback = {
322
- enabled: enabledByRoot,
323
- duration: defaultDuration,
324
- opacity: defaultOpacity
325
- };
326
- if (override === void 0 || override === true) return fallback;
327
- if (override === false) return {
328
- ...fallback,
329
- enabled: false
330
- };
331
- return {
332
- enabled: enabledByRoot,
333
- duration: override.duration ?? defaultDuration,
334
- opacity: override.opacity ?? defaultOpacity
335
- };
336
- }
337
-
338
- // src/system/pressable-feedback/pressable-feedback.overlay.ts
339
- import { Children, Fragment, createElement, isValidElement as isValidElement4 } from "react";
340
- var FEEDBACK_OVERLAY = /* @__PURE__ */Symbol.for("xaui.PressableFeedback.overlay");
341
- function markOverlay(component) {
342
- return Object.assign(component, {
343
- [FEEDBACK_OVERLAY]: true
344
- });
345
- }
346
- function isBareOverlay(node) {
347
- if (!isValidElement4(node)) return false;
348
- const type = node.type;
349
- if (typeof type !== "function" && typeof type !== "object") return false;
350
- if (type === null) return false;
351
- if (type[FEEDBACK_OVERLAY] !== true) return false;
352
- return node.props.children === void 0;
353
- }
354
- function partitionOverlays(children) {
355
- const all = Children.toArray(children);
356
- const overlays = all.filter(isBareOverlay);
357
- if (overlays.length === 0) return {
358
- overlays: null,
359
- content: children
360
- };
361
- return {
362
- overlays,
363
- content: all.filter(node => !isBareOverlay(node))
364
- };
365
- }
366
- function feedbackChildren(children, asChild) {
367
- if (asChild) return children;
368
- const {
369
- overlays,
370
- content
371
- } = partitionOverlays(children);
372
- if (overlays === null) return content;
373
- return createElement(Fragment, null, overlays, content);
374
- }
375
-
376
- // src/system/pressable-feedback/pressable-feedback.tsx
377
- import { forwardRef as forwardRef2, useContext as useContext3, useEffect, useMemo as useMemo2, useRef } from "react";
378
- import { Pressable, StyleSheet } from "react-native";
379
- import Animated, { Easing, useAnimatedStyle, useDerivedValue, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
380
-
381
- // src/system/pressable-feedback/pressable-feedback.surface.ts
382
- function inkFor(background, colors) {
383
- if (typeof background !== "string" || !isHex(background)) return colors.foreground;
384
- return contrastOn(background, colors.snow, colors.eclipse);
385
- }
386
- var RADIUS_KEYS = ["borderRadius", "borderStartStartRadius", "borderStartEndRadius", "borderEndStartRadius", "borderEndEndRadius"];
387
- function radiusFrom(style) {
388
- if (!style) return {};
389
- const radius = {};
390
- for (const key of RADIUS_KEYS) {
391
- const value = style[key];
392
- if (value !== void 0) radius[key] = value;
393
- }
394
- return radius;
395
- }
396
-
397
- // src/system/pressable-feedback/pressable-feedback.tsx
398
- import { jsx as jsx2 } from "react/jsx-runtime";
399
- var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
400
- var AnimatedSlot = Animated.createAnimatedComponent(Slot);
401
- var PressableFeedback = forwardRef2(function PressableFeedback2({
402
- animation,
403
- style,
404
- ...props
405
- }, ref) {
406
- const inheritedDisableAll = useContext3(DisableAllContext);
407
- const resolved = resolveAnimation(animation, inheritedDisableAll);
408
- const [styleProps, rest] = useStyleProps(props);
409
- const Feedback = resolved.none ? StaticFeedback : AnimatedFeedback;
410
- const body = /* @__PURE__ */jsx2(Feedback, {
411
- ref,
412
- animation: resolved,
413
- style: [styleProps, style],
414
- ...rest
415
- });
416
- return resolved.disableAll ? /* @__PURE__ */jsx2(DisableAllContext.Provider, {
417
- value: true,
418
- children: body
419
- }) : body;
420
- });
421
- var StaticFeedback = forwardRef2(function StaticFeedback2({
422
- isPressed = false,
423
- isDisabled,
424
- asChild = false,
425
- animation,
426
- children,
427
- style,
428
- ...rest
429
- }, ref) {
430
- const surface = useSurface(style);
431
- const context = useMemo2(() => ({
432
- isPressed,
433
- animation,
434
- ...surface
435
- }), [isPressed, animation, surface]);
436
- const Root = asChild ? Slot : Pressable;
437
- return /* @__PURE__ */jsx2(FeedbackProvider, {
438
- value: context,
439
- children: /* @__PURE__ */jsx2(Root, {
440
- ref,
441
- style,
442
- disabled: isDisabled,
443
- ...rest,
444
- children: feedbackChildren(children, asChild)
445
- })
446
- });
447
- });
448
- const _worklet_17549026676436_init_data = {
449
- code: "function chunk64L44HEIJs3(){const{pressScaleFor,size}=this.__closure;return pressScaleFor(size.value.width);}",
450
- location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js",
451
- sourceMap: "{\"version\":3,\"names\":[\"chunk64L44HEIJs3\",\"pressScaleFor\",\"size\",\"__closure\",\"value\",\"width\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js\"],\"mappings\":\"AAuiBuC,SAAAA,iBAAA,QAAAC,aAAA,CAAAC,IAAA,OAAAC,SAAA,OAAM,CAAAF,aAAc,CAAAC,IAAK,CAAAE,KAAM,CAAAC,KAAK\",\"ignoreList\":[]}"
452
- };
453
- const _worklet_11319249043844_init_data = {
454
- code: "function chunk64L44HEIJs4(){const{animation,pressedScale,progress}=this.__closure;if(!animation.scale)return{};return{transform:[{scale:1-(1-pressedScale.value)*progress.value}]};}",
455
- location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js",
456
- sourceMap: "{\"version\":3,\"names\":[\"chunk64L44HEIJs4\",\"animation\",\"pressedScale\",\"progress\",\"__closure\",\"scale\",\"transform\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js\"],\"mappings\":\"AAwiByC,SAAAA,gBAAMA,CAAA,QAAAC,SAAA,CAAAC,YAAA,CAAAC,QAAA,OAAAC,SAAA,CAE3C,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\":[]}"
457
- };
458
- var AnimatedFeedback = forwardRef2(function AnimatedFeedback2({
459
- isPressed = false,
460
- isDisabled,
461
- asChild = false,
462
- animation,
463
- children,
464
- style,
465
- onLayout,
466
- onTouchStart,
467
- onTouchEnd,
468
- onTouchCancel,
469
- ...rest
470
- }, ref) {
471
- const progress = useSharedValue(0);
472
- const size = useSharedValue({
473
- width: 0,
474
- height: 0
475
- });
476
- const waves = [useWave(), useWave()];
477
- const nextWave = useRef(0);
478
- useEffect(() => {
479
- progress.value = withTiming(isPressed ? 1 : 0, {
480
- duration: PRESS_DURATION,
481
- easing: Easing.out(Easing.ease)
482
- });
483
- }, [isPressed, progress]);
484
- const pressedScale = useDerivedValue(function chunk64L44HEIJs3Factory({
485
- _worklet_17549026676436_init_data,
486
- pressScaleFor,
487
- size
488
- }) {
489
- const _e = [new global.Error(), -3, -27];
490
- const chunk64L44HEIJs3 = () => pressScaleFor(size.value.width);
491
- chunk64L44HEIJs3.__closure = {
492
- pressScaleFor,
493
- size
494
- };
495
- chunk64L44HEIJs3.__workletHash = 17549026676436;
496
- chunk64L44HEIJs3.__pluginVersion = "0.7.4";
497
- chunk64L44HEIJs3.__initData = _worklet_17549026676436_init_data;
498
- chunk64L44HEIJs3.__stackDetails = _e;
499
- return chunk64L44HEIJs3;
500
- }({
501
- _worklet_17549026676436_init_data,
502
- pressScaleFor,
503
- size
504
- }));
505
- const animatedStyle = useAnimatedStyle(function chunk64L44HEIJs4Factory({
506
- _worklet_11319249043844_init_data,
507
- animation,
508
- pressedScale,
509
- progress
510
- }) {
511
- const _e = [new global.Error(), -4, -27];
512
- const chunk64L44HEIJs4 = function () {
513
- if (!animation.scale) return {};
514
- return {
515
- transform: [{
516
- scale: 1 - (1 - pressedScale.value) * progress.value
517
- }]
518
- };
519
- };
520
- chunk64L44HEIJs4.__closure = {
521
- animation,
522
- pressedScale,
523
- progress
524
- };
525
- chunk64L44HEIJs4.__workletHash = 11319249043844;
526
- chunk64L44HEIJs4.__pluginVersion = "0.7.4";
527
- chunk64L44HEIJs4.__initData = _worklet_11319249043844_init_data;
528
- chunk64L44HEIJs4.__stackDetails = _e;
529
- return chunk64L44HEIJs4;
530
- }({
531
- _worklet_11319249043844_init_data,
532
- animation,
533
- pressedScale,
534
- progress
535
- }), [animation.scale, progress, pressedScale]);
536
- const surface = useSurface(style);
537
- const context = useMemo2(() => ({
538
- isPressed,
539
- animation,
540
- progress,
541
- size,
542
- waves,
543
- ...surface
544
- }), [isPressed, animation, progress, size, waves, surface]);
545
- const handleTouchStart = event => {
546
- const wave = waves[nextWave.current];
547
- nextWave.current = nextWave.current === 0 ? 1 : 0;
548
- const {
549
- locationX,
550
- locationY
551
- } = event.nativeEvent;
552
- wave.origin.value = {
553
- x: locationX,
554
- y: locationY
555
- };
556
- wave.expand.value = 0;
557
- wave.expand.value = withTiming(1, {
558
- duration: RIPPLE_EXPAND_DURATION,
559
- easing: Easing.ease
560
- });
561
- wave.alpha.value = withTiming(1, {
562
- duration: RIPPLE_FADE_IN
563
- });
564
- onTouchStart?.(event);
565
- };
566
- const releaseWave = () => {
567
- const wave = waves[nextWave.current === 0 ? 1 : 0];
568
- wave.expand.value = withTiming(1, {
569
- duration: RIPPLE_CONFIRM_DURATION,
570
- easing: Easing.ease
571
- });
572
- wave.alpha.value = withDelay(RIPPLE_FADE_OUT_DELAY, withTiming(0, {
573
- duration: RIPPLE_FADE_OUT
574
- }));
575
- };
576
- const handleTouchEnd = event => {
577
- releaseWave();
578
- onTouchEnd?.(event);
579
- };
580
- const handleTouchCancel = event => {
581
- releaseWave();
582
- onTouchCancel?.(event);
583
- };
584
- const handleLayout = event => {
585
- const {
586
- width,
587
- height
588
- } = event.nativeEvent.layout;
589
- size.value = {
590
- width,
591
- height
592
- };
593
- onLayout?.(event);
594
- };
595
- const Root = asChild ? AnimatedSlot : AnimatedPressable;
596
- return /* @__PURE__ */jsx2(FeedbackProvider, {
597
- value: context,
598
- children: /* @__PURE__ */jsx2(Root, {
599
- ref,
600
- style: [style, animatedStyle],
601
- disabled: isDisabled,
602
- onLayout: handleLayout,
603
- onTouchStart: handleTouchStart,
604
- onTouchEnd: handleTouchEnd,
605
- onTouchCancel: handleTouchCancel,
606
- ...rest,
607
- children: feedbackChildren(children, asChild)
608
- })
609
- });
610
- });
611
- PressableFeedback.displayName = "XAUI.PressableFeedback";
612
- function useWave() {
613
- return {
614
- expand: useSharedValue(0),
615
- alpha: useSharedValue(0),
616
- origin: useSharedValue({
617
- x: 0,
618
- y: 0
619
- })
620
- };
621
- }
622
- function useSurface(style) {
623
- const theme = useXAUITheme();
624
- return useMemo2(() => {
625
- const flat = StyleSheet.flatten(style);
626
- return {
627
- ink: inkFor(flat?.backgroundColor, theme.colors),
628
- corners: radiusFrom(flat)
629
- };
630
- }, [style, theme]);
631
- }
632
-
633
- // src/system/pressable-feedback/pressable-feedback-highlight.tsx
634
- import { useEffect as useEffect2 } from "react";
635
- import { StyleSheet as StyleSheet2, View as View2 } from "react-native";
636
- import Animated2, { useAnimatedStyle as useAnimatedStyle2, useSharedValue as useSharedValue2, withTiming as withTiming2 } from "react-native-reanimated";
637
- import { Fragment as Fragment2, jsx as jsx3, jsxs } from "react/jsx-runtime";
638
- function PressableFeedbackHighlight({
639
- style,
640
- animation: override,
641
- children,
642
- ...props
643
- }) {
644
- const {
645
- isPressed,
646
- animation,
647
- progress,
648
- ink,
649
- corners
650
- } = useFeedback();
651
- const [styleProps] = useStyleProps(props);
652
- const settings = resolveSlotAnimation(override, animation.highlight, HIGHLIGHT_OPACITY, HIGHLIGHT_DURATION);
653
- const base = [StyleSheet2.absoluteFillObject, {
654
- backgroundColor: ink,
655
- pointerEvents: "none"
656
- }, corners, styleProps, style];
657
- if (!progress || !settings.enabled) {
658
- return /* @__PURE__ */jsxs(Fragment2, {
659
- children: [/* @__PURE__ */jsx3(View2, {
660
- style: [base, {
661
- opacity: isPressed ? settings.opacity : 0
662
- }]
663
- }), children]
664
- });
665
- }
666
- return /* @__PURE__ */jsxs(Fragment2, {
667
- children: [/* @__PURE__ */jsx3(AnimatedHighlight, {
668
- base,
669
- duration: settings.duration,
670
- opacity: settings.opacity
671
- }), children]
672
- });
673
- }
674
- PressableFeedbackHighlight.displayName = "XAUI.PressableFeedback.Highlight";
675
- markOverlay(PressableFeedbackHighlight);
676
- const _worklet_1017691592244_init_data = {
677
- code: "function chunk64L44HEIJs5(){const{shown,opacity}=this.__closure;return{opacity:shown.value*opacity};}",
678
- location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js",
679
- sourceMap: "{\"version\":3,\"names\":[\"chunk64L44HEIJs5\",\"shown\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js\"],\"mappings\":\"AAsrB0C,SAAAA,gBAAMA,CAAA,QAAAC,KAAA,CAAAC,OAAA,OAAAC,SAAA,CAE5C,MAAO,CAAED,OAAO,CAAED,KAAK,CAACG,KAAK,CAAGF,OAAQ,CAAC,CAC3C\",\"ignoreList\":[]}"
680
- };
681
- function AnimatedHighlight({
682
- base,
683
- duration,
684
- opacity
685
- }) {
686
- const {
687
- isPressed
688
- } = useFeedback();
689
- const shown = useSharedValue2(0);
690
- useEffect2(() => {
691
- shown.value = withTiming2(isPressed ? 1 : 0, {
692
- duration
693
- });
694
- }, [isPressed, shown, duration]);
695
- const animatedStyle = useAnimatedStyle2(function chunk64L44HEIJs5Factory({
696
- _worklet_1017691592244_init_data,
697
- shown,
698
- opacity
699
- }) {
700
- const _e = [new global.Error(), -3, -27];
701
- const chunk64L44HEIJs5 = function () {
702
- return {
703
- opacity: shown.value * opacity
704
- };
705
- };
706
- chunk64L44HEIJs5.__closure = {
707
- shown,
708
- opacity
709
- };
710
- chunk64L44HEIJs5.__workletHash = 1017691592244;
711
- chunk64L44HEIJs5.__pluginVersion = "0.7.4";
712
- chunk64L44HEIJs5.__initData = _worklet_1017691592244_init_data;
713
- chunk64L44HEIJs5.__stackDetails = _e;
714
- return chunk64L44HEIJs5;
715
- }({
716
- _worklet_1017691592244_init_data,
717
- shown,
718
- opacity
719
- }), [shown, opacity]);
720
- return /* @__PURE__ */jsx3(Animated2.View, {
721
- style: [base, animatedStyle]
722
- });
723
- }
724
-
725
- // src/system/pressable-feedback/pressable-feedback-ripple.tsx
726
- import { useState } from "react";
727
- import { StyleSheet as StyleSheet3, View as View3 } from "react-native";
728
- import Animated3, { useAnimatedStyle as useAnimatedStyle3 } from "react-native-reanimated";
729
- import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
730
- function PressableFeedbackRipple({
731
- style,
732
- animation: override,
733
- children,
734
- ...props
735
- }) {
736
- const {
737
- animation,
738
- waves,
739
- ink,
740
- corners
741
- } = useFeedback();
742
- const [styleProps] = useStyleProps(props);
743
- const waveStyle = [styleProps, style];
744
- const settings = resolveSlotAnimation(override, animation.ripple, RIPPLE_OPACITY);
745
- const [size, setSize] = useState({
746
- width: 0,
747
- height: 0
748
- });
749
- const handleLayout = event => {
750
- const {
751
- width,
752
- height
753
- } = event.nativeEvent.layout;
754
- setSize(current => current.width === width && current.height === height ? current : {
755
- width,
756
- height
757
- });
758
- };
759
- if (!waves || !settings.enabled) return /* @__PURE__ */jsx4(Fragment3, {
760
- children
761
- });
762
- const radius = rippleRadiusFor(size.width, size.height);
763
- return /* @__PURE__ */jsxs2(Fragment3, {
764
- children: [/* @__PURE__ */jsx4(View3, {
765
- style: [StyleSheet3.absoluteFill, styles.clip, corners],
766
- onLayout: handleLayout,
767
- children: waves.map((wave, index) => /* @__PURE__ */jsx4(RippleWave, {
768
- wave,
769
- radius,
770
- center: {
771
- x: size.width / 2,
772
- y: size.height / 2
773
- },
774
- color: ink,
775
- opacity: settings.opacity,
776
- style: waveStyle
777
- }, index))
778
- }), children]
779
- });
780
- }
781
- PressableFeedbackRipple.displayName = "XAUI.PressableFeedback.Ripple";
782
- markOverlay(PressableFeedbackRipple);
783
- const _worklet_12261780159803_init_data = {
784
- code: "function chunk64L44HEIJs6(){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}]};}",
785
- location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-64L44HEI.js",
786
- sourceMap: "{\"version\":3,\"names\":[\"chunk64L44HEIJs6\",\"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-64L44HEI.js\"],\"mappings\":\"AAsvB0C,SAAAA,gBAAMA,CAAA,QAAAC,IAAA,CAAAC,kBAAA,CAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA,OAAAC,SAAA,CAE5C,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\":[]}"
787
- };
788
- function RippleWave({
789
- wave,
790
- radius,
791
- center,
792
- color,
793
- opacity,
794
- style
795
- }) {
796
- const animatedStyle = useAnimatedStyle3(function chunk64L44HEIJs6Factory({
797
- _worklet_12261780159803_init_data,
798
- wave,
799
- RIPPLE_START_SCALE,
800
- center,
801
- opacity,
802
- radius
803
- }) {
804
- const _e = [new global.Error(), -6, -27];
805
- const chunk64L44HEIJs6 = function () {
806
- const t = wave.expand.value;
807
- const from = wave.origin.value;
808
- const scale = RIPPLE_START_SCALE + (1 - RIPPLE_START_SCALE) * t;
809
- const x = from.x + (center.x - from.x) * t;
810
- const y = from.y + (center.y - from.y) * t;
811
- return {
812
- // Its own curve, not the expansion's: full ink in 75ms, held while the circle grows.
813
- opacity: wave.alpha.value * opacity,
814
- transform: [{
815
- translateX: x - radius
816
- }, {
817
- translateY: y - radius
818
- }, {
819
- scale
820
- }]
821
- };
822
- };
823
- chunk64L44HEIJs6.__closure = {
824
- wave,
825
- RIPPLE_START_SCALE,
826
- center,
827
- opacity,
828
- radius
829
- };
830
- chunk64L44HEIJs6.__workletHash = 12261780159803;
831
- chunk64L44HEIJs6.__pluginVersion = "0.7.4";
832
- chunk64L44HEIJs6.__initData = _worklet_12261780159803_init_data;
833
- chunk64L44HEIJs6.__stackDetails = _e;
834
- return chunk64L44HEIJs6;
835
- }({
836
- _worklet_12261780159803_init_data,
837
- wave,
838
- RIPPLE_START_SCALE,
839
- center,
840
- opacity,
841
- radius
842
- }), [wave, radius, center, opacity]);
843
- return /* @__PURE__ */jsx4(Animated3.View, {
844
- style: [styles.wave, {
845
- backgroundColor: color,
846
- width: radius * 2,
847
- height: radius * 2,
848
- borderRadius: radius
849
- }, style, animatedStyle]
850
- });
851
- }
852
- var styles = StyleSheet3.create({
853
- // `pointerEvents` in the style rather than as a prop: the prop form is deprecated, and it
854
- // is not decoration — a container that ate touches would claim every press meant for the
855
- // control it covers.
856
- clip: {
857
- overflow: "hidden",
858
- pointerEvents: "none"
859
- },
860
- wave: {
861
- position: "absolute",
862
- top: 0,
863
- start: 0
864
- }
865
- });
866
-
867
- // src/system/pressable-feedback/index.ts
868
- var PressableFeedback3 = Object.assign(PressableFeedback, {
869
- Highlight: PressableFeedbackHighlight,
870
- Ripple: PressableFeedbackRipple
871
- });
872
-
873
- // src/system/recipe/resolve-tint.ts
874
- var TINT_SLICE_BY_SUFFIX = [[/SoftForeground$/, "softForeground"], [/SoftPressed$/, "softPressed"], [/Soft$/, "soft"], [/Foreground$/, "foreground"], [/Pressed$/, "pressed"]];
875
- function tintSliceFor(token) {
876
- for (const [suffix, slice] of TINT_SLICE_BY_SUFFIX) {
877
- if (suffix.test(token)) return slice;
878
- }
879
- return "base";
880
- }
881
- function resolveTint(tokens, color, theme) {
882
- const tint = deriveTint(color, theme);
883
- const colors = {};
884
- for (const [role, token] of Object.entries(tokens ?? {})) {
885
- colors[role] = tint[tintSliceFor(token)];
886
- }
887
- return colors;
888
- }
889
-
890
- // src/system/recipe/style-cache.ts
891
- import { StyleSheet as StyleSheet4 } from "react-native";
892
-
893
- // src/system/recipe/variant-map.ts
894
- var STATE_ORDER = ["focused", "pressed", "disabled"];
895
- function resolveSelection(defaultVariants, selection) {
896
- const resolved = {
897
- ...defaultVariants
898
- };
899
- for (const [axis, value] of Object.entries(selection ?? {})) {
900
- if (value !== void 0) resolved[axis] = value;
901
- }
902
- return resolved;
903
- }
904
- function resolveVariantColors(tokens, theme) {
905
- const colors = {};
906
- for (const [role, token] of entriesOf(tokens)) {
907
- const value = theme.colors[token];
908
- if (value === void 0) {
909
- 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.`);
910
- }
911
- colors[role] = value;
912
- }
913
- return colors;
914
- }
915
- function activeStateFns(states, active) {
916
- const fns = [];
917
- for (const state of STATE_ORDER) {
918
- const fn = active[state] ? states?.[state] : void 0;
919
- if (fn) fns.push(fn);
920
- }
921
- return fns;
922
- }
923
- function collectStyleFns(config, selection, states) {
924
- const fns = [];
925
- if (config.base) fns.push(config.base);
926
- if (config.paint) fns.push(config.paint);
927
- for (const [axis, values] of Object.entries(config.variants ?? {})) {
928
- const value = selection[axis];
929
- const fn = value === void 0 ? void 0 : values[value];
930
- if (fn) fns.push(fn);
931
- }
932
- for (const compound of config.compoundVariants ?? []) {
933
- if (appliesTo(compound.when, selection)) fns.push(compound.style);
934
- }
935
- return [...fns, ...activeStateFns(config.states, states)];
936
- }
937
- function appliesTo(when, selection) {
938
- return Object.entries(when).every(([axis, value]) => selection[axis] === value);
939
- }
940
- function entriesOf(tokens) {
941
- return Object.entries(tokens ?? {});
942
- }
943
-
944
- // src/system/recipe/style-cache.ts
945
- function createStyleCache(slots) {
946
- const entries = /* @__PURE__ */new Map();
947
- return {
948
- read(key, build) {
949
- const hit = entries.get(key);
950
- if (hit) return hit;
951
- const built = build();
952
- const complete = {};
953
- for (const slot of slots) complete[slot] = built[slot] ?? {};
954
- const created = StyleSheet4.create(complete);
955
- entries.set(key, created);
956
- return created;
957
- },
958
- get size() {
959
- return entries.size;
960
- },
961
- clear() {
962
- entries.clear();
963
- }
964
- };
965
- }
966
- function cacheKey(theme, selection, states) {
967
- const axes = Object.keys(selection).sort().map(axis => `${axis}:${selection[axis] ?? "-"}`).join("|");
968
- const active = STATE_ORDER.filter(state => states[state]).join(",");
969
- return `${theme.id}|${theme.mode}|${axes}|${active}`;
970
- }
971
-
972
- // src/system/recipe/create-recipe.ts
973
- function createRecipe(config) {
974
- const cache = createStyleCache(config.slots);
975
- const tokensFor = variant => variant === void 0 ? void 0 : config.variantTokens?.[variant];
976
- return {
977
- slots: config.slots,
978
- resolve({
979
- theme,
980
- selection,
981
- states = {}
982
- }) {
983
- const resolved = resolveSelection(config.defaultVariants, selection);
984
- return cache.read(cacheKey(theme, resolved, states), () => {
985
- const colors = resolveVariantColors(tokensFor(resolved.variant), theme);
986
- return apply(collectStyleFns(config, resolved, states), theme, colors);
987
- });
988
- },
989
- tint({
990
- theme,
991
- color,
992
- selection,
993
- states = {}
994
- }) {
995
- if (!config.paint) return {};
996
- const resolved = resolveSelection(config.defaultVariants, selection);
997
- const tokens = tokensFor(resolved.variant);
998
- if (!tokens) return {};
999
- const colors = resolveTint(tokens, color, theme);
1000
- const fns = [config.paint, ...activeStateFns(config.states, states)];
1001
- return apply(fns, theme, colors);
1002
- }
1003
- };
1004
- }
1005
- function apply(fns, theme, colors) {
1006
- const merged = {};
1007
- for (const fn of fns) {
1008
- const produced = fn(theme, colors);
1009
- for (const slot of Object.keys(produced)) {
1010
- const style = produced[slot];
1011
- if (!style) continue;
1012
- const previous = merged[slot];
1013
- merged[slot] = previous ? {
1014
- ...previous,
1015
- ...style
1016
- } : style;
1017
- }
1018
- }
1019
- return merged;
1020
- }
1021
- export { useStyleProps, IconContext, useIconContext, Icon, childrenToString, createSlotContext, mergeRefs, mergeProps, Slot, useFeedback, PRESS_SCALE, PRESS_DURATION, SCALE_REFERENCE_WIDTH, pressScaleFor, HIGHLIGHT_OPACITY, HIGHLIGHT_DURATION, RIPPLE_OPACITY, RIPPLE_START_SCALE, RIPPLE_EXPAND_DURATION, RIPPLE_CONFIRM_DURATION, RIPPLE_FADE_IN, RIPPLE_FADE_OUT_DELAY, RIPPLE_FADE_OUT, rippleRadiusFor, resolveAnimation, resolveSlotAnimation, FEEDBACK_OVERLAY, markOverlay, PressableFeedback3 as PressableFeedback, createRecipe };