@yahoo/uds-mobile 2.1.0 → 2.2.0

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 (148) hide show
  1. package/dist/bin/generateTheme.mjs +14 -0
  2. package/dist/components/{Avatar.d.mts → Avatar.d.ts} +2 -2
  3. package/dist/components/Avatar.d.ts.map +1 -0
  4. package/dist/components/{Avatar.mjs → Avatar.js} +4 -4
  5. package/dist/components/Avatar.js.map +1 -0
  6. package/dist/components/{Badge.d.mts → Badge.d.ts} +3 -3
  7. package/dist/components/Badge.d.ts.map +1 -0
  8. package/dist/components/{Badge.mjs → Badge.js} +4 -4
  9. package/dist/components/Badge.js.map +1 -0
  10. package/dist/components/BlurTarget.cjs +89 -0
  11. package/dist/components/BlurTarget.d.cts +52 -0
  12. package/dist/components/BlurTarget.d.cts.map +1 -0
  13. package/dist/components/BlurTarget.d.ts +52 -0
  14. package/dist/components/BlurTarget.d.ts.map +1 -0
  15. package/dist/components/BlurTarget.js +88 -0
  16. package/dist/components/BlurTarget.js.map +1 -0
  17. package/dist/components/Box.cjs +117 -20
  18. package/dist/components/Box.d.cts +11 -1
  19. package/dist/components/Box.d.cts.map +1 -1
  20. package/dist/components/{Box.d.mts → Box.d.ts} +14 -4
  21. package/dist/components/{Box.d.mts.map → Box.d.ts.map} +1 -1
  22. package/dist/components/Box.js +228 -0
  23. package/dist/components/Box.js.map +1 -0
  24. package/dist/components/{Button.d.mts → Button.d.ts} +4 -4
  25. package/dist/components/Button.d.ts.map +1 -0
  26. package/dist/components/{Button.mjs → Button.js} +6 -6
  27. package/dist/components/Button.js.map +1 -0
  28. package/dist/components/{Checkbox.d.mts → Checkbox.d.ts} +2 -2
  29. package/dist/components/Checkbox.d.ts.map +1 -0
  30. package/dist/components/{Checkbox.mjs → Checkbox.js} +7 -7
  31. package/dist/components/Checkbox.js.map +1 -0
  32. package/dist/components/{Chip.d.mts → Chip.d.ts} +3 -3
  33. package/dist/components/Chip.d.ts.map +1 -0
  34. package/dist/components/{Chip.mjs → Chip.js} +5 -5
  35. package/dist/components/Chip.js.map +1 -0
  36. package/dist/components/{HStack.d.mts → HStack.d.ts} +2 -2
  37. package/dist/components/HStack.d.ts.map +1 -0
  38. package/dist/components/{HStack.mjs → HStack.js} +2 -2
  39. package/dist/components/HStack.js.map +1 -0
  40. package/dist/components/{Icon.d.mts → Icon.d.ts} +2 -2
  41. package/dist/components/Icon.d.ts.map +1 -0
  42. package/dist/components/{Icon.mjs → Icon.js} +1 -1
  43. package/dist/components/Icon.js.map +1 -0
  44. package/dist/components/{IconButton.d.mts → IconButton.d.ts} +4 -4
  45. package/dist/components/IconButton.d.ts.map +1 -0
  46. package/dist/components/{IconButton.mjs → IconButton.js} +5 -5
  47. package/dist/components/IconButton.js.map +1 -0
  48. package/dist/components/{IconSlot.d.mts → IconSlot.d.ts} +2 -2
  49. package/dist/components/IconSlot.d.ts.map +1 -0
  50. package/dist/components/{IconSlot.mjs → IconSlot.js} +2 -2
  51. package/dist/components/IconSlot.js.map +1 -0
  52. package/dist/components/{Image.d.mts → Image.d.ts} +2 -2
  53. package/dist/components/Image.d.ts.map +1 -0
  54. package/dist/components/{Image.mjs → Image.js} +1 -1
  55. package/dist/components/Image.js.map +1 -0
  56. package/dist/components/{Input.d.mts → Input.d.ts} +4 -4
  57. package/dist/components/Input.d.ts.map +1 -0
  58. package/dist/components/{Input.mjs → Input.js} +5 -5
  59. package/dist/components/Input.js.map +1 -0
  60. package/dist/components/{Link.d.mts → Link.d.ts} +4 -4
  61. package/dist/components/Link.d.ts.map +1 -0
  62. package/dist/components/{Link.mjs → Link.js} +2 -2
  63. package/dist/components/Link.js.map +1 -0
  64. package/dist/components/{Pressable.d.mts → Pressable.d.ts} +2 -2
  65. package/dist/components/Pressable.d.ts.map +1 -0
  66. package/dist/components/{Pressable.mjs → Pressable.js} +1 -1
  67. package/dist/components/Pressable.js.map +1 -0
  68. package/dist/components/{Radio.d.mts → Radio.d.ts} +2 -2
  69. package/dist/components/Radio.d.ts.map +1 -0
  70. package/dist/components/{Radio.mjs → Radio.js} +6 -6
  71. package/dist/components/Radio.js.map +1 -0
  72. package/dist/components/{Screen.d.mts → Screen.d.ts} +2 -2
  73. package/dist/components/Screen.d.ts.map +1 -0
  74. package/dist/components/{Screen.mjs → Screen.js} +5 -5
  75. package/dist/components/Screen.js.map +1 -0
  76. package/dist/components/{Switch.d.mts → Switch.d.ts} +3 -3
  77. package/dist/components/Switch.d.ts.map +1 -0
  78. package/dist/components/{Switch.mjs → Switch.js} +6 -6
  79. package/dist/components/Switch.js.map +1 -0
  80. package/dist/components/{Text.d.mts → Text.d.ts} +1 -1
  81. package/dist/components/Text.d.ts.map +1 -0
  82. package/dist/components/{Text.mjs → Text.js} +1 -1
  83. package/dist/components/Text.js.map +1 -0
  84. package/dist/components/{VStack.d.mts → VStack.d.ts} +2 -2
  85. package/dist/components/VStack.d.ts.map +1 -0
  86. package/dist/components/{VStack.mjs → VStack.js} +2 -2
  87. package/dist/components/VStack.js.map +1 -0
  88. package/dist/motion-tokens/dist/{index.d.mts → index.d.ts} +2 -2
  89. package/dist/motion-tokens/dist/index.d.ts.map +1 -0
  90. package/dist/motion-tokens/dist/{index.mjs → index.js} +1 -1
  91. package/dist/motion-tokens/dist/index.js.map +1 -0
  92. package/dist/{motion.d.mts → motion.d.ts} +3 -3
  93. package/dist/motion.d.ts.map +1 -0
  94. package/dist/{motion.mjs → motion.js} +2 -2
  95. package/dist/motion.js.map +1 -0
  96. package/dist/types/dist/{index.d.mts → index.d.ts} +1 -1
  97. package/dist/types/dist/index.d.ts.map +1 -0
  98. package/dist/{types.d.mts → types.d.ts} +1 -1
  99. package/dist/types.d.ts.map +1 -0
  100. package/dist/{types.mjs → types.js} +0 -1
  101. package/fonts/index.cjs +205 -205
  102. package/fonts/index.mjs +205 -205
  103. package/generated/unistyles.d.ts +9 -0
  104. package/package.json +55 -41
  105. package/dist/components/Avatar.d.mts.map +0 -1
  106. package/dist/components/Avatar.mjs.map +0 -1
  107. package/dist/components/Badge.d.mts.map +0 -1
  108. package/dist/components/Badge.mjs.map +0 -1
  109. package/dist/components/Box.mjs +0 -131
  110. package/dist/components/Box.mjs.map +0 -1
  111. package/dist/components/Button.d.mts.map +0 -1
  112. package/dist/components/Button.mjs.map +0 -1
  113. package/dist/components/Checkbox.d.mts.map +0 -1
  114. package/dist/components/Checkbox.mjs.map +0 -1
  115. package/dist/components/Chip.d.mts.map +0 -1
  116. package/dist/components/Chip.mjs.map +0 -1
  117. package/dist/components/HStack.d.mts.map +0 -1
  118. package/dist/components/HStack.mjs.map +0 -1
  119. package/dist/components/Icon.d.mts.map +0 -1
  120. package/dist/components/Icon.mjs.map +0 -1
  121. package/dist/components/IconButton.d.mts.map +0 -1
  122. package/dist/components/IconButton.mjs.map +0 -1
  123. package/dist/components/IconSlot.d.mts.map +0 -1
  124. package/dist/components/IconSlot.mjs.map +0 -1
  125. package/dist/components/Image.d.mts.map +0 -1
  126. package/dist/components/Image.mjs.map +0 -1
  127. package/dist/components/Input.d.mts.map +0 -1
  128. package/dist/components/Input.mjs.map +0 -1
  129. package/dist/components/Link.d.mts.map +0 -1
  130. package/dist/components/Link.mjs.map +0 -1
  131. package/dist/components/Pressable.d.mts.map +0 -1
  132. package/dist/components/Pressable.mjs.map +0 -1
  133. package/dist/components/Radio.d.mts.map +0 -1
  134. package/dist/components/Radio.mjs.map +0 -1
  135. package/dist/components/Screen.d.mts.map +0 -1
  136. package/dist/components/Screen.mjs.map +0 -1
  137. package/dist/components/Switch.d.mts.map +0 -1
  138. package/dist/components/Switch.mjs.map +0 -1
  139. package/dist/components/Text.d.mts.map +0 -1
  140. package/dist/components/Text.mjs.map +0 -1
  141. package/dist/components/VStack.d.mts.map +0 -1
  142. package/dist/components/VStack.mjs.map +0 -1
  143. package/dist/motion-tokens/dist/index.d.mts.map +0 -1
  144. package/dist/motion-tokens/dist/index.mjs.map +0 -1
  145. package/dist/motion.d.mts.map +0 -1
  146. package/dist/motion.mjs.map +0 -1
  147. package/dist/types/dist/index.d.mts.map +0 -1
  148. package/dist/types.d.mts.map +0 -1
@@ -1,8 +1,8 @@
1
1
 
2
- import { ElevationLevel } from "../types/dist/index.mjs";
3
- import { SizeProps } from "../types.mjs";
2
+ import { ElevationLevel } from "../types/dist/index.js";
3
+ import { SizeProps } from "../types.js";
4
4
  import * as react from "react";
5
- import { Ref } from "react";
5
+ import { Ref, RefObject } from "react";
6
6
  import { View, ViewProps } from "react-native";
7
7
  import { StyleProps } from "../../generated/styles";
8
8
 
@@ -59,6 +59,16 @@ interface BoxProps extends ViewProps, SizeProps {
59
59
  insetShadow?: StyleProps['insetShadow'];
60
60
  dangerouslySetBackgroundColor?: string;
61
61
  dangerouslySetBorderColor?: string;
62
+ /**
63
+ * Manual blur intensity (0-100). When set, renders as a BlurView.
64
+ * Requires `blurTarget` pointing to a BlurTarget ref wrapping the content to blur.
65
+ */
66
+ blur?: number;
67
+ /**
68
+ * Reference to a BlurTarget component wrapping the content to blur.
69
+ * Required when using `blur` prop or elevation with blur configured.
70
+ */
71
+ blurTarget?: RefObject<View | null>;
62
72
  }
63
73
  /**
64
74
  * **📦 A layout component that can be used to compose other components**
@@ -91,4 +101,4 @@ interface BoxProps extends ViewProps, SizeProps {
91
101
  declare const Box: react.NamedExoticComponent<BoxProps>;
92
102
  //#endregion
93
103
  export { Box, type BoxProps };
94
- //# sourceMappingURL=Box.d.mts.map
104
+ //# sourceMappingURL=Box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.mts","names":[],"sources":["../../src/components/Box.tsx"],"mappings":";;;;;;;;;UAWU,QAAA,SAAiB,SAAA,EAAW,SAAA;EACpC,GAAA,GAAM,GAAA,CAAI,IAAA;EACV,SAAA,GAAY,cAAA;EACZ,eAAA,GAAkB,UAAA;EAClB,YAAA,GAAe,UAAA;EACf,oBAAA,GAAuB,UAAA;EACvB,kBAAA,GAAqB,UAAA;EACrB,uBAAA,GAA0B,UAAA;EAC1B,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;EACA,yBAAA;EAJS;;;;EAST,IAAA;EA5DyB;;;;EAiEzB,UAAA,GAAa,SAAA,CAAU,IAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BnB,GAAA,EAAG,KAAA,CAAA,oBAAA,CAAA,QAAA"}
@@ -0,0 +1,228 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ import { memo, useEffect, useMemo, useRef, useState } from "react";
3
+ import { Platform, View } from "react-native";
4
+ import { styles } from "../../generated/styles";
5
+ import { StyleSheet as StyleSheet$1, useUnistyles } from "react-native-unistyles";
6
+ import { jsx } from "react/jsx-runtime";
7
+
8
+ //#region src/components/Box.tsx
9
+ let BlurView = null;
10
+ let blurLoadState = "pending";
11
+ const blurLoadListeners = [];
12
+ import("expo-blur").then((mod) => {
13
+ BlurView = mod.BlurView;
14
+ blurLoadState = "loaded";
15
+ blurLoadListeners.forEach((cb) => cb());
16
+ }).catch(() => {
17
+ blurLoadState = "failed";
18
+ blurLoadListeners.forEach((cb) => cb());
19
+ });
20
+ /** Hook to get BlurView component, re-renders when loaded */
21
+ function useBlurView() {
22
+ const [, forceUpdate] = useState(0);
23
+ useEffect(() => {
24
+ if (blurLoadState === "pending") {
25
+ const listener = () => forceUpdate((n) => n + 1);
26
+ blurLoadListeners.push(listener);
27
+ return () => {
28
+ const idx = blurLoadListeners.indexOf(listener);
29
+ if (idx >= 0) blurLoadListeners.splice(idx, 1);
30
+ };
31
+ }
32
+ }, []);
33
+ return {
34
+ BlurView,
35
+ isLoaded: blurLoadState !== "pending",
36
+ isFailed: blurLoadState === "failed"
37
+ };
38
+ }
39
+ /**
40
+ * **📦 A layout component that can be used to compose other components**
41
+ *
42
+ * @description
43
+ * The most simple component we ship - a View. But with all the power of the UDS design system.
44
+ * By default, `Box` is a flexbox container. When working with vertical or horizontal layouts,
45
+ * consider using VStack or HStack respectively.
46
+ *
47
+ * @category Layout
48
+ * @platform mobile
49
+ *
50
+ * @example
51
+ * ```tsx
52
+ * import { Box } from '@yahoo/uds-mobile';
53
+ *
54
+ * <Box backgroundColor="primary" spacing="6">
55
+ * Any kind of content can go here!
56
+ * </Box>
57
+ * ```
58
+ *
59
+ * @usage
60
+ * - Use as a container to apply padding, shapes, or other styling
61
+ * - Use for creating card components
62
+ * - Use HStack/VStack for directional layouts
63
+ *
64
+ * @see {@link HStack} for horizontal layouts
65
+ * @see {@link VStack} for vertical layouts
66
+ */
67
+ const Box = memo(function Box({ elevation, backgroundColor, dangerouslySetBackgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, dangerouslySetBorderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, display = "flex", overflow, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, width, height, minWidth, maxWidth, minHeight, maxHeight, dropShadow, insetShadow, blur, blurTarget, style, ref, ...props }) {
68
+ const { theme, rt } = useUnistyles();
69
+ const { BlurView: BlurViewComponent, isLoaded: blurIsLoaded, isFailed: blurFailed } = useBlurView();
70
+ const elevationAlias = elevation !== void 0 ? `elevation-${elevation}` : void 0;
71
+ const blurExplicitlySet = blur !== void 0;
72
+ const blurIntensity = useMemo(() => {
73
+ if (blur !== void 0) return blur;
74
+ if (elevation === void 0 || !theme.blur) return 0;
75
+ const blurKey = `elevation-${elevation}`;
76
+ return theme.blur[blurKey] ?? 0;
77
+ }, [
78
+ blur,
79
+ elevation,
80
+ theme
81
+ ]);
82
+ const hasWarnedRef = useRef("none");
83
+ useEffect(() => {
84
+ if (!__DEV__ || blurIntensity === 0 || !blurIsLoaded) return;
85
+ if (blurFailed && hasWarnedRef.current !== "no-expo-blur") {
86
+ hasWarnedRef.current = "no-expo-blur";
87
+ console.warn("[UDS Mobile] Box: Blur effect requested but expo-blur is not installed. ");
88
+ return;
89
+ }
90
+ if (!blurTarget && hasWarnedRef.current !== "no-blur-target") {
91
+ hasWarnedRef.current = "no-blur-target";
92
+ console.warn("[UDS Mobile] Box: Blur effect requires a blurTarget ref. Wrap the content to blur in <BlurTarget ref={ref}> and pass the ref to blurTarget prop. See BACKGROUND_BLUR.md for details.");
93
+ }
94
+ }, [
95
+ blurIntensity,
96
+ blurTarget,
97
+ blurIsLoaded,
98
+ blurFailed
99
+ ]);
100
+ const variants = {
101
+ backgroundColor: backgroundColor ?? elevationAlias,
102
+ borderRadius,
103
+ borderTopStartRadius,
104
+ borderTopEndRadius,
105
+ borderBottomStartRadius,
106
+ borderBottomEndRadius,
107
+ borderColor: borderColor ?? elevationAlias,
108
+ borderStartColor,
109
+ borderEndColor,
110
+ borderTopColor,
111
+ borderBottomColor,
112
+ borderWidth: borderWidth ?? elevationAlias,
113
+ borderVerticalWidth,
114
+ borderHorizontalWidth,
115
+ borderStartWidth,
116
+ borderEndWidth,
117
+ borderTopWidth,
118
+ borderBottomWidth,
119
+ alignContent,
120
+ alignItems,
121
+ alignSelf,
122
+ flex,
123
+ flexDirection,
124
+ flexGrow,
125
+ flexShrink,
126
+ flexWrap,
127
+ justifyContent,
128
+ display,
129
+ overflow,
130
+ spacing,
131
+ spacingHorizontal,
132
+ spacingVertical,
133
+ spacingBottom,
134
+ spacingEnd,
135
+ spacingStart,
136
+ spacingTop,
137
+ offset,
138
+ offsetVertical,
139
+ offsetHorizontal,
140
+ offsetBottom,
141
+ offsetEnd,
142
+ offsetStart,
143
+ offsetTop,
144
+ columnGap,
145
+ rowGap
146
+ };
147
+ styles.useVariants(variants);
148
+ const effectiveDropShadow = dropShadow ?? elevationAlias;
149
+ const shadowStyle = effectiveDropShadow || insetShadow ? shadowSheet.shadow(effectiveDropShadow, insetShadow) : void 0;
150
+ const boxStyles = useMemo(() => [
151
+ dangerouslySetBackgroundColor ? { backgroundColor: dangerouslySetBackgroundColor } : void 0,
152
+ dangerouslySetBorderColor ? { borderColor: dangerouslySetBorderColor } : void 0,
153
+ width ? { width } : void 0,
154
+ height ? { height } : void 0,
155
+ minWidth ? { minWidth } : void 0,
156
+ maxWidth ? { maxWidth } : void 0,
157
+ minHeight ? { minHeight } : void 0,
158
+ maxHeight ? { maxHeight } : void 0,
159
+ shadowStyle,
160
+ styles.foundation,
161
+ style
162
+ ], [
163
+ dangerouslySetBackgroundColor,
164
+ dangerouslySetBorderColor,
165
+ width,
166
+ height,
167
+ minWidth,
168
+ maxWidth,
169
+ minHeight,
170
+ maxHeight,
171
+ shadowStyle,
172
+ styles.foundation,
173
+ style
174
+ ]);
175
+ if (BlurViewComponent && (blurIntensity > 0 || blurExplicitlySet)) {
176
+ const isAndroid = Platform.OS === "android";
177
+ const blurTint = rt.themeName === "dark" ? "dark" : "light";
178
+ const blurStyles = isAndroid ? boxStyles : [
179
+ dangerouslySetBorderColor ? { borderColor: dangerouslySetBorderColor } : void 0,
180
+ width ? { width } : void 0,
181
+ height ? { height } : void 0,
182
+ minWidth ? { minWidth } : void 0,
183
+ maxWidth ? { maxWidth } : void 0,
184
+ minHeight ? { minHeight } : void 0,
185
+ maxHeight ? { maxHeight } : void 0,
186
+ shadowStyle,
187
+ {
188
+ ...styles.foundation,
189
+ backgroundColor: void 0
190
+ },
191
+ style ? Array.isArray(style) ? style.map((s) => s && typeof s === "object" ? {
192
+ ...s,
193
+ backgroundColor: void 0
194
+ } : s) : typeof style === "object" ? {
195
+ ...style,
196
+ backgroundColor: void 0
197
+ } : style : void 0
198
+ ];
199
+ return /* @__PURE__ */ jsx(BlurViewComponent, {
200
+ ref,
201
+ intensity: isAndroid ? Math.min(blurIntensity * .4, 40) : blurIntensity,
202
+ tint: blurTint,
203
+ blurTarget: isAndroid ? blurTarget : void 0,
204
+ blurMethod: isAndroid ? "dimezisBlurView" : void 0,
205
+ style: blurStyles,
206
+ ...props,
207
+ children: props.children
208
+ });
209
+ }
210
+ return /* @__PURE__ */ jsx(View, {
211
+ ref,
212
+ style: boxStyles,
213
+ ...props
214
+ });
215
+ });
216
+ Box.displayName = "Box";
217
+ /**
218
+ * Dynamic shadow stylesheet that merges drop and inset shadows into a single
219
+ * boxShadow CSS string. Theme-reactive so shadows update on color mode change.
220
+ */
221
+ const shadowSheet = StyleSheet$1.create((theme) => ({ shadow: (drop, inset) => {
222
+ const parts = [drop ? theme.boxShadow.drop[drop] : "", inset ? theme.boxShadow.inset[inset] : ""].filter(Boolean);
223
+ return parts.length > 0 ? { boxShadow: parts.join(", ") } : {};
224
+ } }));
225
+
226
+ //#endregion
227
+ export { Box };
228
+ //# sourceMappingURL=Box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Box.js","names":["StyleSheet"],"sources":["../../src/components/Box.tsx"],"sourcesContent":["import type { ElevationLevel } from '@yahoo/uds-types';\nimport type { ComponentType, Ref, RefObject } from 'react';\nimport { memo, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ViewProps } from 'react-native';\nimport { Platform, View } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- blur intensity is not a style property, requires direct theme access\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport type { StyleProps } from '../../generated/styles';\nimport { styles } from '../../generated/styles';\nimport type { SizeProps } from '../types';\n\n// Optional expo-blur dependency - loaded via dynamic import for Metro compatibility\n// Metro can statically analyze import() and will include expo-blur in the bundle if installed\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet BlurView: ComponentType<any> | null = null;\nlet blurLoadState: 'pending' | 'loaded' | 'failed' = 'pending';\nconst blurLoadListeners: (() => void)[] = [];\n\n// Start loading expo-blur immediately (Metro will bundle it if installed)\nimport('expo-blur')\n .then((mod) => {\n BlurView = mod.BlurView;\n blurLoadState = 'loaded';\n blurLoadListeners.forEach((cb) => cb());\n })\n .catch(() => {\n blurLoadState = 'failed';\n blurLoadListeners.forEach((cb) => cb());\n });\n\n/** Hook to get BlurView component, re-renders when loaded */\nfunction useBlurView() {\n const [, forceUpdate] = useState(0);\n\n useEffect(() => {\n if (blurLoadState === 'pending') {\n const listener = () => forceUpdate((n) => n + 1);\n blurLoadListeners.push(listener);\n return () => {\n const idx = blurLoadListeners.indexOf(listener);\n if (idx >= 0) {\n blurLoadListeners.splice(idx, 1);\n }\n };\n }\n }, []);\n\n return { BlurView, isLoaded: blurLoadState !== 'pending', isFailed: blurLoadState === 'failed' };\n}\n\ninterface BoxProps extends ViewProps, SizeProps {\n ref?: Ref<View>;\n elevation?: ElevationLevel;\n backgroundColor?: StyleProps['backgroundColor'];\n borderRadius?: StyleProps['borderRadius'];\n borderTopStartRadius?: StyleProps['borderTopStartRadius'];\n borderTopEndRadius?: StyleProps['borderTopEndRadius'];\n borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];\n borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];\n borderColor?: StyleProps['borderColor'];\n borderStartColor?: StyleProps['borderStartColor'];\n borderEndColor?: StyleProps['borderEndColor'];\n borderTopColor?: StyleProps['borderTopColor'];\n borderBottomColor?: StyleProps['borderBottomColor'];\n borderWidth?: StyleProps['borderWidth'];\n borderVerticalWidth?: StyleProps['borderVerticalWidth'];\n borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];\n borderStartWidth?: StyleProps['borderStartWidth'];\n borderEndWidth?: StyleProps['borderEndWidth'];\n borderTopWidth?: StyleProps['borderTopWidth'];\n borderBottomWidth?: StyleProps['borderBottomWidth'];\n alignContent?: StyleProps['alignContent'];\n alignItems?: StyleProps['alignItems'];\n alignSelf?: StyleProps['alignSelf'];\n flex?: StyleProps['flex'];\n flexDirection?: StyleProps['flexDirection'];\n flexGrow?: StyleProps['flexGrow'];\n flexShrink?: StyleProps['flexShrink'];\n flexWrap?: StyleProps['flexWrap'];\n justifyContent?: StyleProps['justifyContent'];\n // flexBasis?: StyleProps['flexBasis'];\n display?: StyleProps['display'];\n overflow?: StyleProps['overflow'];\n // overflowX?: StyleProps['overflowX'];\n // overflowY?: StyleProps['overflowY'];\n // position?: StyleProps['position'];\n spacing?: StyleProps['spacing'];\n spacingHorizontal?: StyleProps['spacingHorizontal'];\n spacingVertical?: StyleProps['spacingVertical'];\n spacingBottom?: StyleProps['spacingBottom'];\n spacingEnd?: StyleProps['spacingEnd'];\n spacingStart?: StyleProps['spacingStart'];\n spacingTop?: StyleProps['spacingTop'];\n offset?: StyleProps['offset'];\n offsetVertical?: StyleProps['offsetVertical'];\n offsetHorizontal?: StyleProps['offsetHorizontal'];\n offsetBottom?: StyleProps['offsetBottom'];\n offsetEnd?: StyleProps['offsetEnd'];\n offsetStart?: StyleProps['offsetStart'];\n offsetTop?: StyleProps['offsetTop'];\n columnGap?: StyleProps['columnGap'];\n rowGap?: StyleProps['rowGap'];\n dropShadow?: StyleProps['dropShadow'];\n insetShadow?: StyleProps['insetShadow'];\n dangerouslySetBackgroundColor?: string;\n dangerouslySetBorderColor?: string;\n /**\n * Manual blur intensity (0-100). When set, renders as a BlurView.\n * Requires `blurTarget` pointing to a BlurTarget ref wrapping the content to blur.\n */\n blur?: number;\n /**\n * Reference to a BlurTarget component wrapping the content to blur.\n * Required when using `blur` prop or elevation with blur configured.\n */\n blurTarget?: RefObject<View | null>;\n}\n\n/**\n * **📦 A layout component that can be used to compose other components**\n *\n * @description\n * The most simple component we ship - a View. But with all the power of the UDS design system.\n * By default, `Box` is a flexbox container. When working with vertical or horizontal layouts,\n * consider using VStack or HStack respectively.\n *\n * @category Layout\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Box } from '@yahoo/uds-mobile';\n *\n * <Box backgroundColor=\"primary\" spacing=\"6\">\n * Any kind of content can go here!\n * </Box>\n * ```\n *\n * @usage\n * - Use as a container to apply padding, shapes, or other styling\n * - Use for creating card components\n * - Use HStack/VStack for directional layouts\n *\n * @see {@link HStack} for horizontal layouts\n * @see {@link VStack} for vertical layouts\n */\nconst Box = memo(function Box({\n // elevation\n elevation,\n // background\n backgroundColor,\n dangerouslySetBackgroundColor,\n // border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n borderColor,\n dangerouslySetBorderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // flex\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n flexWrap,\n justifyContent,\n // flexBasis,\n // layout\n display = 'flex',\n overflow,\n // overflowX,\n // overflowY,\n // position,\n // spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n columnGap,\n rowGap,\n // size\n width,\n height,\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n // shadow\n dropShadow,\n insetShadow,\n // blur\n blur,\n blurTarget,\n // // nested border radius\n // nestedBorderRadius,\n // nestedBorderRadiusSize = nestedBorderRadius ? borderRadius : undefined,\n // nestedBorderRadiusSpacing = nestedBorderRadius ? spacing : undefined,\n // nestedBorderRadiusWidth = nestedBorderRadius ? borderWidth : undefined,\n // style - extracted to merge with variants\n style,\n ref,\n // rest\n ...props\n}: BoxProps) {\n const { theme, rt } = useUnistyles();\n const {\n BlurView: BlurViewComponent,\n isLoaded: blurIsLoaded,\n isFailed: blurFailed,\n } = useBlurView();\n const elevationAlias = elevation !== undefined ? (`elevation-${elevation}` as const) : undefined;\n\n // Track if blur prop was explicitly set (even to 0) vs derived from elevation\n const blurExplicitlySet = blur !== undefined;\n\n // Get blur intensity from manual blur prop or elevation config\n const blurIntensity = useMemo(() => {\n // Manual blur prop takes precedence (including 0)\n if (blur !== undefined) {\n return blur;\n }\n // Fall back to elevation-based blur\n if (elevation === undefined || !theme.blur) {\n return 0;\n }\n const blurKey = `elevation-${elevation}` as keyof typeof theme.blur;\n return theme.blur[blurKey] ?? 0;\n }, [blur, elevation, theme]);\n\n // Warn in development about blur issues (once per mount)\n const hasWarnedRef = useRef<'none' | 'no-expo-blur' | 'no-blur-target'>('none');\n useEffect(() => {\n if (!__DEV__ || blurIntensity === 0 || !blurIsLoaded) {\n return;\n }\n\n // Warn if expo-blur is not installed\n if (blurFailed && hasWarnedRef.current !== 'no-expo-blur') {\n hasWarnedRef.current = 'no-expo-blur';\n console.warn('[UDS Mobile] Box: Blur effect requested but expo-blur is not installed. ');\n return;\n }\n\n // Warn if blur is used without blurTarget\n if (!blurTarget && hasWarnedRef.current !== 'no-blur-target') {\n hasWarnedRef.current = 'no-blur-target';\n console.warn(\n '[UDS Mobile] Box: Blur effect requires a blurTarget ref. ' +\n 'Wrap the content to blur in <BlurTarget ref={ref}> and pass the ref to blurTarget prop. ' +\n 'See BACKGROUND_BLUR.md for details.',\n );\n }\n }, [blurIntensity, blurTarget, blurIsLoaded, blurFailed]);\n\n const variants = {\n // background\n backgroundColor: backgroundColor ?? elevationAlias,\n // border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n // nestedBorderRadius,\n // nestedBorderRadiusSize,\n // nestedBorderRadiusSpacing,\n // nestedBorderRadiusWidth,\n borderColor: borderColor ?? elevationAlias,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth: borderWidth ?? elevationAlias,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // flex\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n flexWrap,\n justifyContent,\n // flexBasis,\n // layout\n display,\n overflow,\n // overflowX,\n // overflowY,\n // position,\n // spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n columnGap,\n rowGap,\n // rest\n };\n\n styles.useVariants(variants);\n\n const effectiveDropShadow = dropShadow ?? elevationAlias;\n const shadowStyle =\n effectiveDropShadow || insetShadow\n ? shadowSheet.shadow(effectiveDropShadow, insetShadow)\n : undefined;\n\n // styles.foundation must be in deps - it returns a new reference when variants change\n const boxStyles = useMemo(\n () => [\n dangerouslySetBackgroundColor\n ? { backgroundColor: dangerouslySetBackgroundColor }\n : undefined,\n dangerouslySetBorderColor ? { borderColor: dangerouslySetBorderColor } : undefined,\n width ? { width } : undefined,\n height ? { height } : undefined,\n minWidth ? { minWidth } : undefined,\n maxWidth ? { maxWidth } : undefined,\n minHeight ? { minHeight } : undefined,\n maxHeight ? { maxHeight } : undefined,\n shadowStyle,\n styles.foundation,\n style,\n ],\n [\n dangerouslySetBackgroundColor,\n dangerouslySetBorderColor,\n width,\n height,\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n shadowStyle,\n styles.foundation,\n style,\n ],\n );\n\n // Merge variant styles with user-provided style prop\n // User styles come last so they can override variant styles if needed\n\n // If blur is configured (manual or via elevation), render BlurView instead of View\n // Note: On Android, blur requires BlurTarget setup by the developer\n // See BACKGROUND_BLUR.md for Android-specific instructions\n // When blur prop is explicitly set (even to 0), use BlurView so blur=0 is transparent, not solid\n const shouldUseBlurView = BlurViewComponent && (blurIntensity > 0 || blurExplicitlySet);\n if (shouldUseBlurView) {\n const isAndroid = Platform.OS === 'android';\n // Match blur tint to the app's theme (from unistyles runtime)\n const blurTint = rt.themeName === 'dark' ? 'dark' : 'light';\n\n // On iOS, BlurView provides its own frosted background via the tint prop.\n // We must NOT apply an opaque backgroundColor or it will cover the blur effect.\n // On Android, the blur is applied to the blurTarget, so backgroundColor is fine.\n const blurStyles = isAndroid\n ? boxStyles\n : [\n // Exclude backgroundColor for iOS - the blur tint provides the visual background\n dangerouslySetBorderColor ? { borderColor: dangerouslySetBorderColor } : undefined,\n width ? { width } : undefined,\n height ? { height } : undefined,\n minWidth ? { minWidth } : undefined,\n maxWidth ? { maxWidth } : undefined,\n minHeight ? { minHeight } : undefined,\n maxHeight ? { maxHeight } : undefined,\n shadowStyle,\n // Filter out backgroundColor from foundation styles\n {\n ...styles.foundation,\n backgroundColor: undefined,\n },\n // Also filter backgroundColor from user style if provided (handles both object and array styles)\n style\n ? Array.isArray(style)\n ? style.map((s) =>\n s && typeof s === 'object' ? { ...s, backgroundColor: undefined } : s,\n )\n : typeof style === 'object'\n ? { ...style, backgroundColor: undefined }\n : style\n : undefined,\n ];\n\n // Scale Android intensity to keep tint overlay subtle (Android overlays become\n // too opaque at high intensities). 0.4 scale maps intensity=100 to effective ~40.\n const effectiveIntensity = isAndroid ? Math.min(blurIntensity * 0.4, 40) : blurIntensity;\n\n return (\n <BlurViewComponent\n ref={ref}\n intensity={effectiveIntensity}\n tint={blurTint}\n blurTarget={isAndroid ? blurTarget : undefined}\n blurMethod={isAndroid ? 'dimezisBlurView' : undefined}\n style={blurStyles}\n {...props}\n >\n {props.children}\n </BlurViewComponent>\n );\n }\n\n // Fallback to regular View (blur not available or not requested)\n\n return <View ref={ref} style={boxStyles} {...props} />;\n});\n\nBox.displayName = 'Box';\n\n/**\n * Dynamic shadow stylesheet that merges drop and inset shadows into a single\n * boxShadow CSS string. Theme-reactive so shadows update on color mode change.\n */\nconst shadowSheet = StyleSheet.create((theme) => ({\n shadow: (drop?: string, inset?: string) => {\n const parts = [\n drop ? theme.boxShadow.drop[drop as keyof typeof theme.boxShadow.drop] : '',\n inset ? theme.boxShadow.inset[inset as keyof typeof theme.boxShadow.inset] : '',\n ].filter(Boolean);\n return parts.length > 0 ? { boxShadow: parts.join(', ') } : {};\n },\n}));\n\nexport { Box, type BoxProps };\n"],"mappings":";;;;;;;;AAeA,IAAI,WAAsC;AAC1C,IA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ariantFlat, IconVariant } from "../types/dist/index.mjs";
3
- import { IconSlotType } from "./IconSlot.mjs";
4
- import { PressableProps as PressableProps$1 } from "./Pressable.mjs";
2
+ import { ButtonSize, ButtonVariantFlat, IconVariant } from "../types/dist/index.js";
3
+ import { IconSlotType } from "./IconSlot.js";
4
+ import { PressableProps as PressableProps$1 } from "./Pressable.js";
5
5
  import * as react from "react";
6
6
  import { Ref } from "react";
7
7
  import { View } from "react-native";
@@ -67,4 +67,4 @@ interface ButtonProps extends Omit<PressableProps$1, 'children' | 'disabled'> {
67
67
  declare const Button: react.NamedExoticComponent<ButtonProps>;
68
68
  //#endregion
69
69
  export { Button, type ButtonProps };
70
- //# sourceMappingURL=Button.d.mts.map
70
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","names":[],"sources":["../../src/components/Button.tsx"],"mappings":";;;;;;;;;UA8GU,WAAA,SAAoB,IAAA,CAAK,gBAAA;;EAEjC,OAAA,GAAU,iBAAA;EAFF;EAIR,IAAA,GAAO,UAAA;;EAEP,WAAA,GAAc,WAAA;EAJJ;EAMV,SAAA,GAAY,YAAA;EAFE;EAId,OAAA,GAAU,YAAA;EAAA;EAEV,OAAA;EAWU;EATV,QAAA;EAd4B;EAgB5B,QAAA,GAAW,KAAA,CAAM,SAAA;EAhBe;;;;EAqBhC,cAAA;EAjBA;EAmBA,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;;;;;;;;;;;;;;;;;AAAI;;;;;;;;;;;;;;;;cAuCV,MAAA,EAAM,KAAA,CAAA,oBAAA,CAAA,WAAA"}
@@ -1,9 +1,9 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
- import { SCALE_EFFECTS } from "../motion-tokens/dist/index.mjs";
3
- import { BUTTON_SPRING_CONFIG } from "../motion.mjs";
4
- import { IconSlot } from "./IconSlot.mjs";
5
- import { Text as Text$1 } from "./Text.mjs";
6
- import { AnimatedPressable } from "./Pressable.mjs";
2
+ import { SCALE_EFFECTS } from "../motion-tokens/dist/index.js";
3
+ import { BUTTON_SPRING_CONFIG } from "../motion.js";
4
+ import { IconSlot } from "./IconSlot.js";
5
+ import { Text as Text$1 } from "./Text.js";
6
+ import { AnimatedPressable } from "./Pressable.js";
7
7
  import { isValidElement, memo, useCallback, useMemo, useState } from "react";
8
8
  import { ActivityIndicator } from "react-native";
9
9
  import { buttonStyles } from "../../generated/styles";
@@ -196,4 +196,4 @@ Button.displayName = "Button";
196
196
 
197
197
  //#endregion
198
198
  export { Button };
199
- //# sourceMappingURL=Button.mjs.map
199
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","names":["Text"],"sources":["../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonSize, ButtonVariantFlat, IconSize, IconVariant } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { isValidElement, memo, useCallback, useMemo, useState } from 'react';\nimport type { View } from 'react-native';\nimport { ActivityIndicator } from 'react-native';\nimport Animated, {\n Easing,\n interpolate,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withSpring,\n withTiming,\n} from 'react-native-reanimated';\nimport { useAnimatedTheme } from 'react-native-unistyles/reanimated';\n\nimport { buttonStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport type { PressableProps } from './Pressable';\nimport { AnimatedPressable } from './Pressable';\nimport { Text } from './Text';\n\n/* -------------------------------------------------------------------------- */\n/* Animation Helpers */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Interpolates a boxShadow string by scaling the alpha of all colors.\n * This allows smooth fade-in/out of shadows.\n */\nfunction interpolateShadowAlpha(shadow: string | undefined, alpha: number): string {\n 'worklet';\n if (!shadow) {\n return '';\n }\n if (alpha >= 1) {\n return shadow;\n }\n if (alpha <= 0) {\n return '';\n }\n\n return shadow.replace(/rgba\\(([^,]+),\\s*([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/g, (_, r, g, b, a) => {\n const newAlpha = parseFloat(a) * alpha;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha.toFixed(3)})`;\n });\n}\n\n/* -------------------------------------------------------------------------- */\n/* Animated Icon Slot */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Animated wrapper for icon/loading content.\n * Matches web Button icon animation: scale 0.7→1, opacity 0→1, width 0→auto\n * Uses staggered animation: opacity waits until halfway through width animation.\n */\nfunction AnimatedIconSlot({\n children,\n visible,\n iconSize,\n gap,\n}: {\n children: React.ReactNode;\n visible: boolean;\n iconSize: number;\n gap: number;\n}) {\n // Use useDerivedValue instead of useEffect + useSharedValue\n // This is the idiomatic Reanimated pattern for deriving animated values from React state\n const progress = useDerivedValue(\n () => withSpring(visible ? 1 : 0, BUTTON_SPRING_CONFIG),\n [visible],\n );\n\n const animatedStyle = useAnimatedStyle(() => {\n // Total width includes icon + gap when visible\n const totalWidth = iconSize + gap;\n const width = interpolate(progress.value, [0, 1], [0, totalWidth]);\n\n // Staggered animation: opacity starts at 50% of width animation\n // On enter: width expands first, then icon fades in\n // On exit: icon fades out first, then width collapses\n const opacity = interpolate(progress.value, [0.5, 1], [0, 1], 'clamp');\n const scale = interpolate(progress.value, [0.5, 1], [0.7, 1], 'clamp');\n\n return {\n width,\n opacity,\n transform: [{ scale }],\n overflow: 'hidden' as const,\n };\n });\n\n return <Animated.View style={animatedStyle}>{children}</Animated.View>;\n}\n\n// function LoadingIcon({ size, variant }: { size: ButtonSize, variant: ButtonVariantFlat }) {\n// const { theme } = useUnistyles();\n// const themeKey = `buttonVariant${variantToCapitalMap[variant]}IconRest` as const;\n// const iconSize = theme.components.buttonSizeLgIconRest.fontSize;\n// return <ActivityIndicator size={iconSize} color={theme.colors.text.primary} />;\n// }\n\n/* -------------------------------------------------------------------------- */\n/* Button Props */\n/* -------------------------------------------------------------------------- */\n\ninterface ButtonProps extends Omit<PressableProps, 'children' | 'disabled'> {\n /** The visual style variant of the button @default 'primary' */\n variant?: ButtonVariantFlat;\n /** The size of the button @default 'md' */\n size?: ButtonSize;\n /** The icon style variant @default 'outline' */\n iconVariant?: IconVariant;\n /** Icon displayed before the button label */\n startIcon?: IconSlotType;\n /** Icon displayed after the button label */\n endIcon?: IconSlotType;\n /** Shows a loading spinner and disables the button */\n loading?: boolean;\n /** Whether the button is disabled */\n disabled?: boolean;\n /** Button label content */\n children?: React.ReactNode;\n /**\n * Disable motion effects (scale on press, icon animations)\n * @default false\n */\n disableEffects?: boolean;\n /** Ref to the underlying View */\n ref?: Ref<View>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Button Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **🖲️ A button element that can be used to trigger an action**\n *\n * @description\n * A button is a fundamental component used to trigger an action or event.\n * Buttons are interactive elements that users can click, tap, or otherwise\n * engage with to submit forms, open dialogues, or perform any other interaction.\n *\n * Features animated scale effect on press and smooth icon transitions matching\n * the web UDS Button behavior.\n *\n * @category Interactive\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Button } from '@yahoo/uds-mobile';\n *\n * <Button onPress={() => console.log('pressed')}>Save</Button>\n * <Button variant=\"secondary\">Cancel</Button>\n * <Button startIcon=\"Add\" variant=\"brand\">Add Item</Button>\n * <Button loading>Saving...</Button>\n * ```\n *\n * @accessibility\n * - Sets `accessibilityRole=\"button\"` automatically\n * - Announces loading state to screen readers\n * - Use `accessibilityLabel` for icon-only buttons\n *\n * @see {@link IconButton} for icon-only buttons\n * @see {@link Link} for navigation actions\n */\nconst Button = memo(function Button({\n variant = 'primary',\n size = 'md',\n iconVariant = 'outline',\n startIcon,\n endIcon,\n loading,\n disabled,\n width: _width,\n children,\n style,\n accessibilityLabel,\n accessibilityHint,\n disableEffects = false,\n onPressIn,\n onPressOut,\n ref,\n ...props\n}: ButtonProps) {\n const shouldAnimate = !disableEffects;\n\n /* --------------------------------- State ---------------------------------- */\n const [pressed, setPressed] = useState(false);\n\n buttonStyles.useVariants({ size, variant, disabled, pressed });\n\n // Get gap and icon size from current variant styles\n const buttonGap = buttonStyles.root.gap;\n const iconSize = buttonStyles.icon.fontSize;\n\n // Get animated theme for boxShadow (useAnimatedVariantColor doesn't support non-color props)\n const animatedTheme = useAnimatedTheme();\n\n /* ------------------------------- Animation -------------------------------- */\n const scale = useSharedValue<number>(SCALE_EFFECTS.none);\n\n const handlePressIn = useCallback(\n (event: Parameters<NonNullable<PressableProps['onPressIn']>>[0]) => {\n setPressed(true);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.down, BUTTON_SPRING_CONFIG);\n }\n onPressIn?.(event);\n },\n [shouldAnimate, scale, onPressIn],\n );\n\n const handlePressOut = useCallback(\n (event: Parameters<NonNullable<PressableProps['onPressOut']>>[0]) => {\n setPressed(false);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG);\n }\n onPressOut?.(event);\n },\n [shouldAnimate, scale, onPressOut],\n );\n\n /* -------------------------------- Content --------------------------------- */\n const childrenNode =\n children &&\n (isValidElement(children) ? (\n children\n ) : (\n <Text numberOfLines={1} textAlign=\"center\" style={buttonStyles.text}>\n {children}\n </Text>\n ));\n\n const a11yState = useMemo(() => ({ disabled, busy: loading }), [disabled, loading]);\n\n /* --------------------------------- Styles --------------------------------- */\n // Animate pressed state for shadow (0 = rest, 1 = pressed)\n const pressProgress = useDerivedValue(\n () => withTiming(pressed ? 1 : 0, { duration: 220, easing: Easing.bezier(0, 0, 0.2, 1) }),\n [pressed],\n );\n\n // Animate using Unistyles' variant color system + boxShadow from theme\n const animatedStyles = useAnimatedStyle(() => {\n // Get boxShadow from theme using flattened path (no camelCase conversion needed!)\n const components = animatedTheme.value.components;\n const buttonVariantPath = `button/variant/${variant}/root/pressed` as const;\n const shadowPressed = components[buttonVariantPath]?.boxShadow;\n\n return {\n transform: [{ scale: scale.value }],\n // Only animate shadow if the theme defines one for this variant\n ...(shadowPressed && {\n boxShadow: interpolateShadowAlpha(shadowPressed, pressProgress.value),\n }),\n };\n });\n\n // Determine what should be visible in start slot\n const showLoading = !!loading;\n const showStartIcon = !!startIcon && !loading;\n const showEndIcon = !!endIcon && !loading;\n\n const iconSizeToken = (buttonStyles.icon.iconSizeToken as IconSize) ?? 'sm';\n\n // Start slot: either loading spinner or start icon\n const startContent = (\n <AnimatedIconSlot visible={showLoading || showStartIcon} iconSize={iconSize} gap={buttonGap}>\n {showLoading ? (\n <ActivityIndicator size={buttonStyles.icon.fontSize} color={buttonStyles.icon.color} />\n ) : (\n <IconSlot\n icon={startIcon}\n size={iconSizeToken}\n variant={iconVariant}\n style={buttonStyles.icon}\n />\n )}\n </AnimatedIconSlot>\n );\n\n // End slot: only end icon (no loading here)\n const endContent = (\n <AnimatedIconSlot visible={showEndIcon} iconSize={iconSize} gap={buttonGap}>\n <IconSlot\n icon={endIcon}\n size={iconSizeToken}\n variant={iconVariant}\n style={buttonStyles.icon}\n />\n </AnimatedIconSlot>\n );\n\n const rootStyles = useMemo(\n () => [\n buttonStyles.root,\n animatedStyles,\n typeof style === 'function' ? style({ pressed }) : style,\n ],\n [buttonStyles.root, animatedStyles, style, pressed],\n );\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <AnimatedPressable\n ref={ref}\n disabled={disabled}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n overflow=\"hidden\"\n accessibilityLabel={loading ? `${accessibilityLabel ?? ''}, loading` : accessibilityLabel}\n accessibilityHint={accessibilityHint}\n accessibilityRole=\"button\"\n accessibilityState={a11yState}\n alignContent=\"center\"\n style={rootStyles}\n {...props}\n >\n {startContent}\n {childrenNode}\n {endContent}\n </AnimatedPressable>\n );\n});\n\nButton.displayName = 'Button';\n\nexport { Button, type ButtonProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,SAAS,uBAAuB,QAA4B,OAA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vF,oBAAC;GACC,MAAM;GACN,MAAM;GACN,SAAS;GACT,OAAO,aAAa;IACpB;GAEa;CAIrB,MAAM,aACJ,oBAAC;EAAiB,SAAS;EAAuB;EAAU,KAAK;YAC/D,oBAAC;GACC,MAAM;GACN,MAAM;GACN,SAAS;GACT,OAAO,aAAa;IACpB;GACe;CAGrB,MAAM,aAAa,cACX;EACJ,aAAa;EACb;EACA,OAAO,UAAU,aAAa,MAAM,EAAE,SAAS,CAAC,GAAG;EACpD,EACD;EAAC,aAAa;EAAM;EAAgB;EAAO;EAAQ,CACpD;AAGD,QACE,qBAAC;EACM;EACK;EACV,WAAW;EACX,YAAY;EACZ,eAAc;EACd,YAAW;EACX,gBAAe;EACf,UAAS;EACT,oBAAoB,UAAU,GAAG,sBAAsB,GAAG,aAAa;EACpD;EACnB,mBAAkB;EAClB,oBAAoB;EACpB,cAAa;EACb,OAAO;EACP,GAAI;;GAEH;GACA;GACA;;GACiB;EAEtB;AAEF,OAAO,cAAc"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { UniversalCheckboxProps } from "../types/dist/index.mjs";
2
+ import { UniversalCheckboxProps } from "../types/dist/index.js";
3
3
  import * as react from "react";
4
4
  import { Ref } from "react";
5
5
  import { View, ViewProps } from "react-native";
@@ -54,4 +54,4 @@ interface CheckboxProps extends Omit<ViewProps, 'style'>, UniversalCheckboxProps
54
54
  declare const Checkbox: react.NamedExoticComponent<CheckboxProps>;
55
55
  //#endregion
56
56
  export { Checkbox, type CheckboxProps };
57
- //# sourceMappingURL=Checkbox.d.mts.map
57
+ //# sourceMappingURL=Checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.d.ts","names":[],"sources":["../../src/components/Checkbox.tsx"],"mappings":";;;;;;;UAyBU,aAAA,SAAsB,IAAA,CAAK,SAAA,YAAqB,sBAAA;;EAExD,GAAA,GAAM,GAAA,CAAI,IAAA;EAFF;EAIR,cAAA;;EAEA,QAAA;EAJU;EAMV,QAAA;EAR8B;EAU9B,QAAA,IAAY,OAAA;AAAA;;;;;;;;;;;;;;;AAAgB;;;;;;;;;;;;;;;;;;;;cAqDxB,QAAA,EAAQ,KAAA,CAAA,oBAAA,CAAA,aAAA"}
@@ -1,10 +1,10 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
- import { SCALE_EFFECTS } from "../motion-tokens/dist/index.mjs";
3
- import { BUTTON_SPRING_CONFIG } from "../motion.mjs";
4
- import { Icon } from "./Icon.mjs";
5
- import { Text } from "./Text.mjs";
6
- import { HStack } from "./HStack.mjs";
7
- import { Pressable } from "./Pressable.mjs";
2
+ import { SCALE_EFFECTS } from "../motion-tokens/dist/index.js";
3
+ import { BUTTON_SPRING_CONFIG } from "../motion.js";
4
+ import { Icon } from "./Icon.js";
5
+ import { Text } from "./Text.js";
6
+ import { HStack } from "./HStack.js";
7
+ import { Pressable } from "./Pressable.js";
8
8
  import { isValidElement, memo, useCallback, useId, useMemo, useState } from "react";
9
9
  import { checkboxStyles } from "../../generated/styles";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -161,4 +161,4 @@ Checkbox.displayName = "Checkbox";
161
161
 
162
162
  //#endregion
163
163
  export { Checkbox };
164
- //# sourceMappingURL=Checkbox.mjs.map
164
+ //# sourceMappingURL=Checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.js","names":[],"sources":["../../src/components/Checkbox.tsx"],"sourcesContent":["import type { CheckboxValue, CheckboxVariant, UniversalCheckboxProps } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { isValidElement, memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { View, ViewProps } from 'react-native';\nimport Animated, {\n interpolate,\n useAnimatedStyle,\n useDerivedValue,\n withSpring,\n} from 'react-native-reanimated';\n\nimport { checkboxStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport { HStack } from './HStack';\nimport { Icon } from './Icon';\nimport { Pressable } from './Pressable';\nimport { Text } from './Text';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** Derived from CheckboxValue - maps boolean to 'checked'/'unchecked' string literals */\ntype CheckboxValueState = Exclude<CheckboxValue, boolean> | 'checked' | 'unchecked';\n\ninterface CheckboxProps extends Omit<ViewProps, 'style'>, UniversalCheckboxProps {\n /** Ref to the underlying View */\n ref?: Ref<View>;\n /** Default checked state for uncontrolled mode */\n defaultChecked?: boolean;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Whether the checkbox is required */\n required?: boolean;\n /** Callback fired when the checked state changes */\n onChange?: (checked: boolean) => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Variant Mapping */\n/* -------------------------------------------------------------------------- */\n\n/** All style variants available in the generated styles (includes error variants) */\ntype CheckboxStyleVariant = 'primary' | 'secondary' | 'alert' | 'alert-secondary';\n\nconst VARIANT_ERROR_MAP: Record<CheckboxVariant, CheckboxStyleVariant> = {\n primary: 'alert',\n secondary: 'alert-secondary',\n};\n\n/* -------------------------------------------------------------------------- */\n/* Checkbox Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **⚙️ A checkbox component**\n *\n * @description\n * A checkbox component allows users to select one or multiple options from a set.\n * It represents a binary state, typically as checked or unchecked, and optionally\n * includes a third \"indeterminate\" state to indicate partial selection.\n *\n * @category Form\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Checkbox } from '@yahoo/uds-mobile';\n *\n * <Checkbox label=\"Agree to terms\" />\n * <Checkbox label=\"Subscribe\" checked={true} onChange={setChecked} />\n * <Checkbox label=\"Partial\" checked=\"indeterminate\" />\n * ```\n *\n * @usage\n * - Forms: For selecting options\n * - Settings: For toggling preferences\n * - Filters: For multi-select filtering\n *\n * @accessibility\n * - Sets `accessibilityRole=\"checkbox\"` automatically\n * - Announces checked/unchecked/mixed state\n * - Label is used as accessibility label\n * - Supports `reduceMotion` for users who prefer reduced motion\n *\n * @see {@link Radio} for single-select options\n * @see {@link Switch} for binary toggles\n */\nconst Checkbox = memo(function Checkbox({\n // Checkbox props\n label,\n labelPosition = 'start',\n variant: variantProp = 'primary',\n size = 'md',\n checked: checkedProp,\n hasError,\n reduceMotion,\n // Native props\n defaultChecked,\n disabled,\n required,\n onChange,\n ref,\n ...viewProps\n}: CheckboxProps) {\n const generatedId = useId();\n const uid = `uds-checkbox-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const isControlled = checkedProp !== undefined;\n const [internalChecked, setInternalChecked] = useState<CheckboxValue>(\n isControlled ? checkedProp : (defaultChecked ?? false),\n );\n const [pressed, setPressed] = useState(false);\n\n // Use controlled value if provided, otherwise use internal state\n const checked = isControlled ? checkedProp : internalChecked;\n\n /* ------------------------------ Derived Values ---------------------------- */\n const valueState: CheckboxValueState = useMemo(() => {\n if (checked === 'indeterminate') {\n return 'indeterminate';\n }\n return checked ? 'checked' : 'unchecked';\n }, [checked]);\n\n const iconName = valueState === 'indeterminate' ? 'Minus' : 'Check';\n const showIcon = valueState !== 'unchecked';\n\n /* -------------------------------- Animation ------------------------------- */\n const shouldAnimate = !reduceMotion;\n\n // Scale animation for press feedback (disabled when reduceMotion is true)\n const scaleProgress = useDerivedValue(\n () =>\n shouldAnimate\n ? withSpring(pressed ? SCALE_EFFECTS.down : SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG)\n : SCALE_EFFECTS.none, // No scale effect when reduceMotion is true\n [pressed, shouldAnimate],\n );\n\n // Icon visibility animation\n // When reduceMotion is true, still show/hide the icon but without animation\n const iconProgress = useDerivedValue(\n () => (shouldAnimate ? withSpring(showIcon ? 1 : 0, BUTTON_SPRING_CONFIG) : showIcon ? 1 : 0),\n [showIcon, shouldAnimate],\n );\n\n const checkboxAnimatedStyle = useAnimatedStyle(() => ({\n transform: [{ scale: scaleProgress.value }],\n }));\n\n const iconAnimatedStyle = useAnimatedStyle(() => ({\n opacity: interpolate(iconProgress.value, [0, 1], [0, 1]),\n transform: [{ scale: interpolate(iconProgress.value, [0, 1], [0.5, 1]) }],\n }));\n\n /* -------------------------------- Handlers -------------------------------- */\n const handlePress = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const newChecked = checked === 'indeterminate' ? true : !checked;\n\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n\n onChange?.(newChecked);\n }, [disabled, checked, isControlled, onChange]);\n\n const handlePressIn = useCallback(() => {\n setPressed(true);\n }, []);\n\n const handlePressOut = useCallback(() => {\n setPressed(false);\n }, []);\n\n /* --------------------------------- Styles --------------------------------- */\n // Compute the style variant (primary/secondary maps to alert variants when hasError)\n const styleVariant: CheckboxStyleVariant = hasError\n ? VARIANT_ERROR_MAP[variantProp]\n : variantProp;\n\n checkboxStyles.useVariants({\n size,\n variant: styleVariant, // primary, secondary, alert, alert-secondary\n value: valueState, // checked, unchecked, indeterminate\n disabled,\n pressed,\n });\n\n const rootStyle = useMemo(\n () => [checkboxStyles.root, { opacity: disabled ? 0.5 : 1 }],\n [checkboxStyles.root, disabled],\n );\n\n const checkboxBoxStyle = useMemo(\n () => [\n checkboxStyles.checkbox,\n { alignItems: 'center' as const, justifyContent: 'center' as const, borderRadius: 4 },\n checkboxAnimatedStyle,\n ],\n [checkboxStyles.checkbox, checkboxAnimatedStyle],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n\n const content =\n typeof label === 'function' ? label() : isValidElement(label) ? label : String(label);\n\n const textContent =\n typeof content === 'string' ? <Text style={checkboxStyles.text}>{content}</Text> : content;\n\n if (required) {\n return (\n <HStack columnGap=\"1\" alignItems=\"flex-start\">\n {textContent}\n <Text style={checkboxStyles.text}>*</Text>\n </HStack>\n );\n }\n\n return textContent;\n }, [label, required, checkboxStyles.text]);\n\n const a11yState = useMemo(\n () => ({\n disabled,\n checked:\n valueState === 'checked'\n ? true\n : valueState === 'indeterminate'\n ? ('mixed' as const)\n : false,\n }),\n [disabled, valueState],\n );\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <Pressable\n ref={ref}\n nativeID={uid}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n disabled={disabled}\n flexDirection={labelPosition === 'start' ? 'row' : 'row-reverse'}\n alignItems=\"center\"\n alignSelf=\"flex-start\"\n accessibilityRole=\"checkbox\"\n accessibilityState={a11yState}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n {...viewProps}\n style={rootStyle}\n >\n <Animated.View style={checkboxBoxStyle}>\n <Animated.View style={iconAnimatedStyle}>\n <Icon name={iconName} size=\"sm\" style={checkboxStyles.checkboxIcon} />\n </Animated.View>\n </Animated.View>\n\n {labelContent}\n </Pressable>\n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox, type CheckboxProps };\n"],"mappings":";;;;;;;;;;;;;AA6CA,MAAM,oBAAmE;CACvE,SAAS;CACT,WAAW;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCD,MAAM,WAAW,KAAK,SAAS,SAAS,EAEtC,OACA,gBAAgB,SAChB,SAAS,cAAc,WACvB,OAAO,MACP,SAAS,aACT,UACA,cAEA,gBACA,UACA,UACA,UACA,KACA,GAAG,aACa;CAEhB,MAAM,MAAM,gBADQ,OAAO;CAI3B,MAAM,eAAe,gBAAgB;CACrC,MAAM,CAAC,iBAAiB,sBAAsB,SAC5C,eAAe,cAAe,kBAAkB,MACjD;CACD,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAG7C,MAAM,UAAU,eAAe,cAAc;CAG7C,MAAM,aAAiC,cAAc;AACnD,MAAI,YAAY,gBACd,QAAO;AAET,SAAO,UAAU,YAAY;IAC5B,CAAC,QAAQ,CAAC;CAEb,MAAM,WAAW,eAAe,kBAAkB,UAAU;CAC5D,MAAM,WAAW,eAAe;CAGhC,MAAM,gBAAgB,CAAC;CAGvB,MAAM,gBAAgB,sBAElB,gBACI,WAAW,UAAU,cAAc,OAAO,cAAc,MAAM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,OAAO,UAAU,aAAa,OAAO,GAAG,eAAe,MAAM,GAAG,QAAQ,OAAO,MAAM;EAEvF,MAAM,cACJ,OAAO,YAAY,WAAW,oBAAC;GAAK,OAAO,eAAe;aAAO;IAAe,GAAG;AAErF,MAAI,SACF,QACE,qBAAC;GAAO,WAAU;GAAI,YAAW;cAC9B,aACD,oBAAC;IAAK,OAAO,eAAe;cAAM;KAAQ;IACnC;AAIb,SAAO;IACN;EAAC;EAAO;EAAU,eAAe;EAAK,CAAC;CAE1C,MAAM,YAAY,eACT;EACL;EACA,SACE,eAAe,YACX,OACA,eAAe,kBACZ,UACD;EACT,GACD,CAAC,UAAU,WAAW,CACvB;AAGD,QACE,qBAAC;EACM;EACL,UAAU;EACV,SAAS;EACT,WAAW;EACX,YAAY;EACF;EACV,eAAe,kBAAkB,UAAU,QAAQ;EACnD,YAAW;EACX,WAAU;EACV,mBAAkB;EAClB,oBAAoB;EACpB,oBAAoB,OAAO,UAAU,WAAW,QAAQ;EACxD,GAAI;EACJ,OAAO;aAEP,oBAAC,SAAS;GAAK,OAAO;aACpB,oBAAC,SAAS;IAAK,OAAO;cACpB,oBAAC;KAAK,MAAM;KAAU,MAAK;KAAK,OAAO,eAAe;MAAgB;KACxD;IACF,EAEf;GACS;EAEd;AAEF,SAAS,cAAc"}
@@ -1,6 +1,6 @@
1
1
 
2
- import { ChipSize, ChipVariant } from "../types/dist/index.mjs";
3
- import { IconSlotType } from "./IconSlot.mjs";
2
+ import { ChipSize, ChipVariant } from "../types/dist/index.js";
3
+ import { IconSlotType } from "./IconSlot.js";
4
4
  import * as react from "react";
5
5
  import { Ref } from "react";
6
6
  import { View, ViewProps } from "react-native";
@@ -79,4 +79,4 @@ interface ChipProps extends Omit<ViewProps, 'children'> {
79
79
  declare const Chip: react.NamedExoticComponent<ChipProps>;
80
80
  //#endregion
81
81
  export { Chip, type ChipProps };
82
- //# sourceMappingURL=Chip.d.mts.map
82
+ //# sourceMappingURL=Chip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chip.d.ts","names":[],"sources":["../../src/components/Chip.tsx"],"mappings":";;;;;;;;UAYU,SAAA,SAAkB,IAAA,CAAK,SAAA;;EAE/B,GAAA,GAAM,GAAA,CAAI,IAAA;EAFF;EAIR,OAAA,GAAU,WAAA;;EAEV,IAAA,GAAO,QAAA;EAJG;EAMV,QAAA;EAJU;EAMV,QAAA;EAEY;EAAZ,SAAA,GAAY,YAAA;EAgBD;EAdX,OAAA,GAAU,YAAA;EAdoB;EAgB9B,QAAA;EAhB0B;EAkB1B,OAAA;EAhBA;EAkBA,SAAA;EAlBU;EAoBV,QAAA,IAAY,OAAA;EAlBF;EAoBV,SAAA;EAlBO;EAoBP,sBAAA;EAhBA;EAkBA,QAAA,GAAW,KAAA,CAAM,SAAA;AAAA;;;;;;;;;;;;;;;AAAS;;;;;;;;;;;;;;;;;;;;;;;;;;cA2CtB,IAAA,EAAI,KAAA,CAAA,oBAAA,CAAA,SAAA"}
@@ -1,8 +1,8 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
- import { IconSlot } from "./IconSlot.mjs";
3
- import { Text } from "./Text.mjs";
4
- import { HStack } from "./HStack.mjs";
5
- import { Pressable } from "./Pressable.mjs";
2
+ import { IconSlot } from "./IconSlot.js";
3
+ import { Text } from "./Text.js";
4
+ import { HStack } from "./HStack.js";
5
+ import { Pressable } from "./Pressable.js";
6
6
  import { memo, useCallback, useMemo } from "react";
7
7
  import { chipStyles } from "../../generated/styles";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -137,4 +137,4 @@ Chip.displayName = "Chip";
137
137
 
138
138
  //#endregion
139
139
  export { Chip };
140
- //# sourceMappingURL=Chip.mjs.map
140
+ //# sourceMappingURL=Chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chip.js","names":[],"sources":["../../src/components/Chip.tsx"],"sourcesContent":["import type { ChipSize, ChipVariant } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useMemo } from 'react';\nimport type { View, ViewProps } from 'react-native';\n\nimport { chipStyles } from '../../generated/styles';\nimport { HStack } from './HStack';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport { Pressable } from './Pressable';\nimport { Text } from './Text';\n\ninterface ChipProps extends Omit<ViewProps, 'children'> {\n /** Ref to the underlying View */\n ref?: Ref<View>;\n /** The visual style variant @default 'primary' */\n variant?: ChipVariant;\n /** The size of the chip @default 'md' */\n size?: ChipSize;\n /** Minimum width of the chip in pixels */\n minWidth?: number;\n /** Maximum width of the chip in pixels @default 200 */\n maxWidth?: number;\n /** Icon displayed at the start of the chip */\n startIcon?: IconSlotType;\n /** Icon displayed at the end of the chip */\n endIcon?: IconSlotType;\n /** Whether the chip is disabled */\n disabled?: boolean;\n /** Called when the chip is pressed. Makes the chip interactive. */\n onPress?: () => void;\n /** Whether the chip is toggled/selected. */\n isToggled?: boolean;\n /** Called when the chip toggle state changes. */\n onToggle?: (toggled: boolean) => void;\n /** Called when the dismiss button is pressed. Shows a dismiss icon. */\n onDismiss?: () => void;\n /** Accessibility label for the dismiss button. */\n dismissButtonAriaLabel?: string;\n /** Chip label content */\n children?: React.ReactNode;\n}\n\n/**\n * **A chip component for selections, filters, or actions**\n *\n * @description\n * Chips help people make selections, filter content, or trigger actions.\n * They can be toggleable, dismissible, or simple pressable elements.\n *\n * @category Interactive\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Chip } from '@yahoo/uds-mobile';\n *\n * // Basic chip\n * <Chip>Label</Chip>\n *\n * // Toggle chip\n * <Chip isToggled={selected} onToggle={setSelected}>Filter</Chip>\n *\n * // Dismissible chip\n * <Chip onDismiss={() => removeChip()}>Tag</Chip>\n *\n * // With icons\n * <Chip startIcon=\"Star\" variant=\"brand\">Favorite</Chip>\n * ```\n *\n * @usage\n * - Filters: For multi-select filtering options\n * - Tags: For displaying and removing tags\n * - Actions: For quick contextual actions\n *\n * @accessibility\n * - Toggle chips use `accessibilityRole=\"checkbox\"` with checked state\n * - Action chips use `accessibilityRole=\"button\"`\n * - Dismiss button has customizable `dismissButtonAriaLabel`\n *\n * @see {@link Badge} for non-interactive status indicators\n * @see {@link Button} for primary actions\n */\nconst Chip = memo(function Chip({\n variant = 'primary',\n size = 'md',\n minWidth,\n maxWidth = 200,\n startIcon,\n endIcon,\n disabled = false,\n isToggled = false,\n onPress,\n onToggle,\n onDismiss,\n dismissButtonAriaLabel = 'Dismiss',\n children,\n style,\n ref,\n ...rest\n}: ChipProps) {\n const isInteractive = Boolean(onPress || onToggle);\n const isDismissible = Boolean(onDismiss);\n const isDisabled = disabled;\n // Determine which variant type to use for styling\n const toggleState = isToggled ? 'on' : 'off';\n\n // Apply layer-based styles\n // Note: Chip doesn't have disabled variants in theme - handled via opacity\n // Note: pressed state is applied dynamically via Pressable's style callback\n chipStyles.useVariants({\n size,\n link: variant,\n dismissible: variant,\n toggle: toggleState,\n });\n\n const handlePress = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (onToggle) {\n onToggle(!isToggled);\n } else if (onPress) {\n onPress();\n }\n }, [isDisabled, onToggle, isToggled, onPress]);\n\n const handleDismiss = useCallback(() => {\n if (isDisabled) {\n return;\n }\n onDismiss?.();\n }, [isDisabled, onDismiss]);\n\n const content = (\n <>\n {startIcon && <IconSlot icon={startIcon} variant=\"fill\" style={chipStyles.icon} />}\n <Text numberOfLines={1} textAlign=\"center\" flexShrink=\"1\" style={chipStyles.text}>\n {children}\n </Text>\n {isDismissible ? (\n <Pressable\n onPress={isDisabled ? undefined : handleDismiss}\n disabled={isDisabled}\n accessibilityLabel={dismissButtonAriaLabel}\n accessibilityRole=\"button\"\n >\n <IconSlot icon={endIcon ?? 'Cross'} variant=\"fill\" style={chipStyles.icon} />\n </Pressable>\n ) : (\n endIcon && <IconSlot icon={endIcon} variant=\"fill\" style={chipStyles.icon} />\n )}\n </>\n );\n\n const a11yState = {\n disabled: isDisabled,\n checked: onToggle ? isToggled : undefined,\n };\n\n const rootStyles = useMemo(() => [chipStyles.root, style], [chipStyles.root, style]);\n const sharedProps = {\n ref,\n style: rootStyles,\n flexDirection: 'row',\n alignItems: 'center',\n overflow: 'hidden',\n alignSelf: 'flex-start',\n maxWidth,\n minWidth,\n disabled: isDisabled,\n opacity: isDisabled ? 0.5 : undefined,\n accessibilityState: a11yState,\n ...rest,\n } as const;\n\n // Interactive chip (toggle or button)\n if (isInteractive) {\n return (\n <Pressable\n onPress={handlePress}\n accessibilityRole={onToggle ? 'checkbox' : 'button'}\n {...sharedProps}\n >\n {content}\n </Pressable>\n );\n }\n\n // Non-interactive chip (display only or dismissible)\n return (\n <HStack accessibilityRole={isDismissible ? 'button' : undefined} {...sharedProps} {...rest}>\n {content}\n </HStack>\n );\n});\n\nChip.displayName = 'Chip';\n\nexport { Chip, type ChipProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,MAAM,OAAO,KAAK,SAAS,KAAK,EAC9B,UAAU,WACV,OAAO,MACP,UACA,WAAW,KACX,WACA,SACA,WAAW,OACX,YAAY,OACZ,SACA,UACA,WACA,yBAAyB,WACzB,UACA,OACA,KACA,GAAG,QACS;CACZ,MAAM,gBAAgB,QAAQ,WAAW,SAAS;CAClD,MAAM,gBAAgB,QAAQ,UAAU;CACxC,MAAM,aAAa;CAEnB,MAAM,cAAc,YAAY,OAAO;AAKvC,YAAW,YAAY;EACrB;EACA,MAAM;EACN,aAAa;EACb,QAAQ;EACT,CAAC;CAEF,MAAM,cAAc,kBAAkB;AACpC,MAAI,WACF;AAGF,MAAI,SACF,UAAS,CAAC,UAAU;WACX,QACT,UAAS;IAEV;EAAC;EAAY;EAAU;EAAW;EAAQ,CAAC;CAE9C,MAAM,gBAAgB,kBAAkB;AACtC,MAAI,WACF;AAEF,eAAa;IACZ,CAAC,YAAY,UAAU,CAAC;CAE3B,MAAM,UACJ;EACG,aAAa,oBAAC;GAAS,MAAM;GAAW,SAAQ;GAAO,OAAO,WAAW;IAAQ;EAClF,oBAAC;GAAK,eAAe;GAAG,WAAU;GAAS,YAAW;GAAI,OAAO,WAAW;GACzE;IACI;EACN,gBACC,oBAAC;GACC,SAAS,aAAa,SAAY;GAClC,UAAU;GACV,oBAAoB;GACpB,mBAAkB;aAElB,oBAAC;IAAS,MAAM,WAAW;IAAS,SAAQ;IAAO,OAAO,WAAW;KAAQ;IACnE,GAEZ,WAAW,oBAAC;GAAS,MAAM;GAAS,SAAQ;GAAO,OAAO,WAAW;IAAQ;KAE9E;CAGL,MAAM,YAAY;EAChB,UAAU;EACV,SAAS,WAAW,YAAY;EACjC;CAGD,MAAM,cAAc;EAClB;EACA,OAHiB,cAAc,CAAC,WAAW,MAAM,MAAM,EAAE,CAAC,WAAW,MAAM,MAAM,CAAC;EAIlF,eAAe;EACf,YAAY;EACZ,UAAU;EACV,WAAW;EACX;EACA;EACA,UAAU;EACV,SAAS,aAAa,KAAM;EAC5B,oBAAoB;EACpB,GAAG;EACJ;AAGD,KAAI,cACF,QACE,oBAAC;EACC,SAAS;EACT,mBAAmB,WAAW,aAAa;EAC3C,GAAI;YAEH;GACS;AAKhB,QACE,oBAAC;EAAO,mBAAmB,gBAAgB,WAAW;EAAW,GAAI;EAAa,GAAI;YACnF;GACM;EAEX;AAEF,KAAK,cAAc"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { BoxProps } from "./Box.mjs";
2
+ import { BoxProps } from "./Box.js";
3
3
  import * as react from "react";
4
4
  import { Ref } from "react";
5
5
  import { View } from "react-native";
@@ -42,4 +42,4 @@ interface HStackProps extends Omit<BoxProps, 'ref'> {
42
42
  declare const HStack: react.NamedExoticComponent<HStackProps>;
43
43
  //#endregion
44
44
  export { HStack, type HStackProps };
45
- //# sourceMappingURL=HStack.d.mts.map
45
+ //# sourceMappingURL=HStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HStack.d.ts","names":[],"sources":["../../src/components/HStack.tsx"],"mappings":";;;;;;;;UAQU,WAAA,SAAoB,IAAA,CAAK,QAAA;;EAEjC,GAAA,GAAM,UAAA;EAFE;EAIR,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;;;;;;;;;;;;;;;;;AAAI;;;;;;;;;;;cA8BV,MAAA,EAAM,KAAA,CAAA,oBAAA,CAAA,WAAA"}
@@ -1,5 +1,5 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
- import { Box } from "./Box.mjs";
2
+ import { Box } from "./Box.js";
3
3
  import { memo } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
 
@@ -45,4 +45,4 @@ HStack.displayName = "HStack";
45
45
 
46
46
  //#endregion
47
47
  export { HStack };
48
- //# sourceMappingURL=HStack.mjs.map
48
+ //# sourceMappingURL=HStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HStack.js","names":[],"sources":["../../src/components/HStack.tsx"],"sourcesContent":["import type { Ref } from 'react';\nimport { memo } from 'react';\nimport type { View } from 'react-native';\n\nimport type { StyleProps } from '../../generated/styles';\nimport type { BoxProps } from './Box';\nimport { Box } from './Box';\n\ninterface HStackProps extends Omit<BoxProps, 'ref'> {\n /** Gap between child elements */\n gap?: StyleProps['columnGap'];\n /** Ref to the underlying View */\n ref?: Ref<View>;\n}\n\n/**\n * **📦 A horizontal stack layout component**\n *\n * @description\n * A convenience component for creating horizontal layouts. It's a Box with\n * `flexDirection=\"row\"` preset.\n *\n * @category Layout\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { HStack } from '@yahoo/uds-mobile';\n *\n * <HStack gap=\"4\" alignItems=\"center\">\n * <Text>Item 1</Text>\n * <Text>Item 2</Text>\n * </HStack>\n * ```\n *\n * @usage\n * - Use for horizontal arrangements of elements\n * - Use gap prop for consistent spacing between children\n *\n * @see {@link VStack} for vertical layouts\n * @see {@link Box} for custom flex layouts\n */\nconst HStack = memo(function HStack({ gap, children, ref, ...props }: HStackProps) {\n return (\n <Box ref={ref} flexDirection=\"row\" rowGap={gap} columnGap={gap} {...props}>\n {children}\n </Box>\n );\n});\n\nHStack.displayName = 'HStack';\n\nexport { HStack, type HStackProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,SAAS,KAAK,SAAS,OAAO,EAAE,KAAK,UAAU,KAAK,GAAG,SAAsB;AACjF,QACE,oBAAC;EAAS;EAAK,eAAc;EAAM,QAAQ;EAAK,WAAW;EAAK,GAAI;EACjE;GACG;EAER;AAEF,OAAO,cAAc"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { IconSize, IconVariant } from "../types/dist/index.mjs";
2
+ import { IconSize, IconVariant } from "../types/dist/index.js";
3
3
  import * as react from "react";
4
4
  import { Ref } from "react";
5
5
  import { StyleProp, Text, TextProps, TextStyle } from "react-native";
@@ -97,4 +97,4 @@ declare const iconNames: readonly ["A11Y", "Accessible", "AccountRecover", "Acco
97
97
  declare const multicolorIconNames: readonly ["Cloud", "CloudDay", "CloudNight", "Cold", "Dreary", "Dusk", "Eclipse", "FirstQuarter", "Fog", "FogDay", "FogNight", "FullMoon", "HalfSun", "HazeDay", "HazeNight", "HeavyRain", "HeavyRainDay", "HeavyRainLightning", "HeavyRainLightningDay", "HeavyRainLightningNight", "HeavyRainNight", "Hot", "Hurricane", "Ice", "IntermittentCloudsNight", "IntermittentCloudsSunny", "Lightning", "LightningDay", "LightningNight", "MostlyNightFlurries", "Night", "PartlyCloudyNight", "PartlyFlurries", "PartlyNightFlurries", "PartlySunny", "Rain", "RainDay", "RainNight", "Sleet", "Snow", "SnowDay", "Snowflake", "SprinkleDay", "SprinkleNight", "Sun", "Sunrise", "Sunset", "ThirdQuarter", "Tornado", "WaningCrescent", "WaningGibbous", "WaxingCrescent", "WaxingGibbous", "Wind", "WindCloud", "WindCloudDay", "WindCloudNight"];
98
98
  //#endregion
99
99
  export { Icon, type IconName, type IconProps, iconNames, multicolorIconNames };
100
- //# sourceMappingURL=Icon.d.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AOjB,KAAA,GAAQ,SAAA,CAAU,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiNd,IAAA,EAAI,KAAA,CAAA,oBAAA,CAAA,SAAA;AAAA,cAaG,SAAA;AAAA,cACA,mBAAA"}
@@ -158,4 +158,4 @@ const multicolorIconNames = svgGlyphNames;
158
158
 
159
159
  //#endregion
160
160
  export { Icon, iconNames, multicolorIconNames };
161
- //# sourceMappingURL=Icon.mjs.map
161
+ //# sourceMappingURL=Icon.js.map