@kanso-labs/react-native-kanso-ui 0.9.0 → 0.10.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 (196) hide show
  1. package/README.md +4 -3
  2. package/dist/autocomplete/index.js +15 -1
  3. package/dist/autocomplete/index.js.map +1 -1
  4. package/dist/button/group.d.ts +5 -0
  5. package/dist/button/group.js +115 -0
  6. package/dist/button/group.js.map +1 -0
  7. package/dist/button/index.d.ts +4 -1
  8. package/dist/button/index.js +44 -22
  9. package/dist/button/index.js.map +1 -1
  10. package/dist/button/slots.js +2 -1
  11. package/dist/button/slots.js.map +1 -1
  12. package/dist/calendar/index.js +351 -182
  13. package/dist/calendar/index.js.map +1 -1
  14. package/dist/calendar/styles.js +33 -2
  15. package/dist/calendar/styles.js.map +1 -1
  16. package/dist/carousel/arrangement.d.ts +5 -0
  17. package/dist/carousel/arrangement.js +123 -0
  18. package/dist/carousel/arrangement.js.map +1 -0
  19. package/dist/chequer/index.js +95 -0
  20. package/dist/chequer/index.js.map +1 -0
  21. package/dist/collection/index.d.ts +157 -0
  22. package/dist/collection/index.js +1331 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/color-thumb/index.js +56 -0
  25. package/dist/color-thumb/index.js.map +1 -0
  26. package/dist/components/button/index.d.ts +4 -2
  27. package/dist/components/button/index.js +227 -188
  28. package/dist/components/button/index.js.map +1 -1
  29. package/dist/components/button-group/index.d.ts +87 -0
  30. package/dist/components/button-group/index.js +275 -0
  31. package/dist/components/button-group/index.js.map +1 -0
  32. package/dist/components/calendar/index.d.ts +11 -3
  33. package/dist/components/calendar/index.js +60 -45
  34. package/dist/components/calendar/index.js.map +1 -1
  35. package/dist/components/carousel/index.d.ts +72 -0
  36. package/dist/components/carousel/index.js +496 -0
  37. package/dist/components/carousel/index.js.map +1 -0
  38. package/dist/components/checkbox-group/index.d.ts +3 -4
  39. package/dist/components/checkbox-group/index.js +1 -1
  40. package/dist/components/checkbox-group/index.js.map +1 -1
  41. package/dist/components/color-area/index.d.ts +85 -0
  42. package/dist/components/color-area/index.js +630 -0
  43. package/dist/components/color-area/index.js.map +1 -0
  44. package/dist/components/color-field/index.d.ts +144 -0
  45. package/dist/components/color-field/index.js +516 -0
  46. package/dist/components/color-field/index.js.map +1 -0
  47. package/dist/components/color-picker/index.d.ts +74 -0
  48. package/dist/components/color-picker/index.js +317 -0
  49. package/dist/components/color-picker/index.js.map +1 -0
  50. package/dist/components/color-slider/index.d.ts +82 -0
  51. package/dist/components/color-slider/index.js +456 -0
  52. package/dist/components/color-slider/index.js.map +1 -0
  53. package/dist/components/color-swatch/index.d.ts +46 -0
  54. package/dist/components/color-swatch/index.js +127 -0
  55. package/dist/components/color-swatch/index.js.map +1 -0
  56. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  57. package/dist/components/color-swatch-picker/index.js +287 -0
  58. package/dist/components/color-swatch-picker/index.js.map +1 -0
  59. package/dist/components/color-wheel/index.d.ts +71 -0
  60. package/dist/components/color-wheel/index.js +407 -0
  61. package/dist/components/color-wheel/index.js.map +1 -0
  62. package/dist/components/combo-box/index.d.ts +193 -0
  63. package/dist/components/combo-box/index.js +616 -0
  64. package/dist/components/combo-box/index.js.map +1 -0
  65. package/dist/components/date-field/index.d.ts +120 -0
  66. package/dist/components/date-field/index.js +111 -0
  67. package/dist/components/date-field/index.js.map +1 -0
  68. package/dist/components/date-picker/index.d.ts +130 -0
  69. package/dist/components/date-picker/index.js +310 -0
  70. package/dist/components/date-picker/index.js.map +1 -0
  71. package/dist/components/date-range-picker/index.d.ts +139 -0
  72. package/dist/components/date-range-picker/index.js +421 -0
  73. package/dist/components/date-range-picker/index.js.map +1 -0
  74. package/dist/components/disclosure/index.d.ts +94 -0
  75. package/dist/components/disclosure/index.js +365 -0
  76. package/dist/components/disclosure/index.js.map +1 -0
  77. package/dist/components/disclosure-group/index.d.ts +61 -0
  78. package/dist/components/disclosure-group/index.js +100 -0
  79. package/dist/components/disclosure-group/index.js.map +1 -0
  80. package/dist/components/drop-zone/index.d.ts +113 -0
  81. package/dist/components/drop-zone/index.js +304 -0
  82. package/dist/components/drop-zone/index.js.map +1 -0
  83. package/dist/components/fab/index.d.ts +1 -1
  84. package/dist/components/fab/index.js +91 -76
  85. package/dist/components/fab/index.js.map +1 -1
  86. package/dist/components/form/index.d.ts +3 -2
  87. package/dist/components/form/index.js.map +1 -1
  88. package/dist/components/icon-button/index.d.ts +4 -2
  89. package/dist/components/icon-button/index.js +204 -171
  90. package/dist/components/icon-button/index.js.map +1 -1
  91. package/dist/components/list/index.d.ts +15 -158
  92. package/dist/components/list/index.js +21 -1047
  93. package/dist/components/list/index.js.map +1 -1
  94. package/dist/components/list-box/index.d.ts +73 -0
  95. package/dist/components/list-box/index.js +82 -0
  96. package/dist/components/list-box/index.js.map +1 -0
  97. package/dist/components/loading-indicator/index.d.ts +32 -0
  98. package/dist/components/loading-indicator/index.js +174 -0
  99. package/dist/components/loading-indicator/index.js.map +1 -0
  100. package/dist/components/navigation-tree/index.d.ts +117 -0
  101. package/dist/components/navigation-tree/index.js +135 -0
  102. package/dist/components/navigation-tree/index.js.map +1 -0
  103. package/dist/components/number-field/index.js +132 -143
  104. package/dist/components/number-field/index.js.map +1 -1
  105. package/dist/components/range-calendar/index.d.ts +69 -0
  106. package/dist/components/range-calendar/index.js +144 -0
  107. package/dist/components/range-calendar/index.js.map +1 -0
  108. package/dist/components/search-view/index.d.ts +78 -0
  109. package/dist/components/search-view/index.js +570 -0
  110. package/dist/components/search-view/index.js.map +1 -0
  111. package/dist/components/select/index.d.ts +152 -0
  112. package/dist/components/select/index.js +419 -0
  113. package/dist/components/select/index.js.map +1 -0
  114. package/dist/components/slider/index.d.ts +111 -0
  115. package/dist/components/slider/index.js +673 -0
  116. package/dist/components/slider/index.js.map +1 -0
  117. package/dist/components/split-button/index.d.ts +77 -0
  118. package/dist/components/split-button/index.js +354 -0
  119. package/dist/components/split-button/index.js.map +1 -0
  120. package/dist/components/tabs/index.d.ts +196 -0
  121. package/dist/components/tabs/index.js +1137 -0
  122. package/dist/components/tabs/index.js.map +1 -0
  123. package/dist/components/time-field/index.d.ts +43 -0
  124. package/dist/components/time-field/index.js +107 -0
  125. package/dist/components/time-field/index.js.map +1 -0
  126. package/dist/components/time-picker/index.d.ts +65 -0
  127. package/dist/components/time-picker/index.js +1168 -0
  128. package/dist/components/time-picker/index.js.map +1 -0
  129. package/dist/components/tooltip/index.d.ts +101 -0
  130. package/dist/components/tooltip/index.js +223 -0
  131. package/dist/components/tooltip/index.js.map +1 -0
  132. package/dist/components/tree/index.d.ts +112 -0
  133. package/dist/components/tree/index.js +157 -0
  134. package/dist/components/tree/index.js.map +1 -0
  135. package/dist/disclosure/chevron.js +75 -0
  136. package/dist/disclosure/chevron.js.map +1 -0
  137. package/dist/disclosure/index.js +7 -0
  138. package/dist/disclosure/index.js.map +1 -0
  139. package/dist/drop/index.d.ts +54 -0
  140. package/dist/drop/index.js +161 -0
  141. package/dist/drop/index.js.map +1 -0
  142. package/dist/field/chevron.js +74 -0
  143. package/dist/field/chevron.js.map +1 -0
  144. package/dist/field/index.d.ts +2 -1
  145. package/dist/field/index.js +310 -154
  146. package/dist/field/index.js.map +1 -1
  147. package/dist/field/styles.js +9 -0
  148. package/dist/field/styles.js.map +1 -1
  149. package/dist/files/index.d.ts +18 -0
  150. package/dist/files/index.js +107 -0
  151. package/dist/files/index.js.map +1 -0
  152. package/dist/form/index.d.ts +5 -2
  153. package/dist/form/index.js +64 -85
  154. package/dist/form/index.js.map +1 -1
  155. package/dist/glyphs/index.js +92 -1
  156. package/dist/glyphs/index.js.map +1 -1
  157. package/dist/i18n/index.js +20 -1
  158. package/dist/i18n/index.js.map +1 -1
  159. package/dist/i18n/messages.js +1394 -34
  160. package/dist/i18n/messages.js.map +1 -1
  161. package/dist/index.d.ts +35 -3
  162. package/dist/index.js +34 -3
  163. package/dist/indicator/paths.js +23 -1
  164. package/dist/indicator/paths.js.map +1 -1
  165. package/dist/modal/index.js +92 -77
  166. package/dist/modal/index.js.map +1 -1
  167. package/dist/number/keyboard.js +16 -0
  168. package/dist/number/keyboard.js.map +1 -0
  169. package/dist/overlay/anchored.js +68 -38
  170. package/dist/overlay/anchored.js.map +1 -1
  171. package/dist/overlay/keyboard.js +57 -0
  172. package/dist/overlay/keyboard.js.map +1 -0
  173. package/dist/overlay/panel.js +173 -19
  174. package/dist/overlay/panel.js.map +1 -1
  175. package/dist/overlay/placement.js +13 -1
  176. package/dist/overlay/placement.js.map +1 -1
  177. package/dist/picker/index.js +322 -0
  178. package/dist/picker/index.js.map +1 -0
  179. package/dist/press/index.d.ts +2 -0
  180. package/dist/press/index.js +102 -100
  181. package/dist/press/index.js.map +1 -1
  182. package/dist/row/index.js +77 -69
  183. package/dist/row/index.js.map +1 -1
  184. package/dist/row/styles.js +13 -2
  185. package/dist/row/styles.js.map +1 -1
  186. package/dist/segments/field.js +277 -0
  187. package/dist/segments/field.js.map +1 -0
  188. package/dist/segments/index.js +574 -0
  189. package/dist/segments/index.js.map +1 -0
  190. package/dist/segments/styles.js +24 -0
  191. package/dist/segments/styles.js.map +1 -0
  192. package/dist/slider/index.js +145 -0
  193. package/dist/slider/index.js.map +1 -0
  194. package/dist/swatch/index.js +56 -0
  195. package/dist/swatch/index.js.map +1 -0
  196. package/package.json +11 -2
@@ -0,0 +1,496 @@
1
+ import { useTheme } from "../../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../../theme/styles.js";
3
+ import { slideLabelFor } from "../../i18n/index.js";
4
+ import { useLocaleOf, useMessages } from "../../i18n/provider.js";
5
+ import { ChevronEndGlyph } from "../../glyphs/index.js";
6
+ import { IconButton } from "../icon-button/index.js";
7
+ import { arrange, placements } from "../../carousel/arrangement.js";
8
+ import { c } from "react/compiler-runtime";
9
+ import { I18nManager, Platform, StyleSheet, View, useWindowDimensions } from "react-native";
10
+ import Animated, { Extrapolation, interpolate, useAnimatedReaction, useAnimatedScrollHandler, useAnimatedStyle, useReducedMotion, useSharedValue } from "react-native-reanimated";
11
+ import { Children, createContext, isValidElement, use, useRef, useState } from "react";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ import { scheduleOnRN } from "react-native-worklets";
14
+ //#region src/components/carousel/index.tsx
15
+ const DEFAULT_ITEM_SIZE = 240;
16
+ const SLACK = .5;
17
+ const SlotContext = createContext(null);
18
+ const styles = StyleSheet.create({
19
+ contentMasked: { overflow: "hidden" },
20
+ held: { flexGrow: 1 },
21
+ previousGlyph: { transform: [{ scaleX: -1 }] },
22
+ previousGlyphRightToLeft: { transform: [{ scaleX: 1 }] },
23
+ root: { minWidth: 0 },
24
+ slot: {
25
+ alignItems: "center",
26
+ flexShrink: 0
27
+ }
28
+ });
29
+ const stylesOf = themedStyles(({ radii, spacing }) => StyleSheet.create({
30
+ controls: {
31
+ columnGap: spacing.sm,
32
+ flexDirection: "row",
33
+ justifyContent: "flex-end",
34
+ paddingHorizontal: spacing.lg
35
+ },
36
+ item: {
37
+ alignItems: "center",
38
+ borderRadius: radii.xl,
39
+ flexGrow: 1,
40
+ overflow: "hidden"
41
+ },
42
+ root: { rowGap: spacing.sm },
43
+ row: {
44
+ columnGap: 8,
45
+ flexDirection: "row",
46
+ paddingHorizontal: spacing.lg,
47
+ paddingVertical: spacing.sm
48
+ }
49
+ }));
50
+ function along(direction, { end, masked, scrolled, step }) {
51
+ const offset = masked ? (Math.round(scrolled / step) + direction) * step : scrolled + direction * step;
52
+ return Math.min(Math.max(offset, 0), end);
53
+ }
54
+ /**
55
+ * A row of items that scrolls on and off the screen, in the carousel page's
56
+ * multi-browse, hero or uncontained layout. Name it with `label`, and give it
57
+ * a `Carousel.Item` for each item.
58
+ *
59
+ * ```tsx
60
+ * <Carousel label="Label">
61
+ * <Carousel.Item><Image alt="First item" source={first} /></Carousel.Item>
62
+ * <Carousel.Item><Image alt="Second item" source={second} /></Carousel.Item>
63
+ * </Carousel>
64
+ * ```
65
+ *
66
+ * `style`, `ref` and `testID` land on the carousel as a whole, which is the
67
+ * view a layout positions, and a `style` there applies over its own.
68
+ */
69
+ function Carousel(t0) {
70
+ const $ = c(55);
71
+ let children;
72
+ let label;
73
+ let nextLabel;
74
+ let previousLabel;
75
+ let props;
76
+ let style;
77
+ let t1;
78
+ let t2;
79
+ if ($[0] !== t0) {
80
+ ({children, itemSize: t1, label, layout: t2, nextLabel, previousLabel, style, ...props} = t0);
81
+ $[0] = t0;
82
+ $[1] = children;
83
+ $[2] = label;
84
+ $[3] = nextLabel;
85
+ $[4] = previousLabel;
86
+ $[5] = props;
87
+ $[6] = style;
88
+ $[7] = t1;
89
+ $[8] = t2;
90
+ } else {
91
+ children = $[1];
92
+ label = $[2];
93
+ nextLabel = $[3];
94
+ previousLabel = $[4];
95
+ props = $[5];
96
+ style = $[6];
97
+ t1 = $[7];
98
+ t2 = $[8];
99
+ }
100
+ const itemSize = t1 === void 0 ? DEFAULT_ITEM_SIZE : t1;
101
+ const layout = t2 === void 0 ? "multi-browse" : t2;
102
+ const theme = useTheme();
103
+ const own = stylesOf(theme);
104
+ const messages = useMessages();
105
+ const reduceMotion = useReducedMotion();
106
+ const dimensions = useWindowDimensions();
107
+ const scroller = useRef(null);
108
+ const scrolled = useSharedValue(0);
109
+ const [measured, setMeasured] = useState();
110
+ const width = measured ?? dimensions.width;
111
+ const padding = theme.spacing.lg;
112
+ const rtl = I18nManager.isRTL;
113
+ const items = Children.toArray(children).filter(isValidElement);
114
+ const count = items.length;
115
+ const room = Math.max(width - 2 * padding, 0);
116
+ const arrangement = arrange(layout, room, itemSize, count);
117
+ const masked = layout !== "uncontained";
118
+ const step = arrangement.large + 8;
119
+ const end = masked ? arrangement.steps * step : Math.max(count * step - 8 + 2 * padding - width, 0);
120
+ const paths = masked ? pathsOf(Array.from({ length: arrangement.steps + 1 }, (_, rest) => placements(layout, arrangement, room, padding, count, rest)), count) : [];
121
+ let t3;
122
+ if ($[9] !== end) {
123
+ t3 = () => edgeOf(0, end);
124
+ $[9] = end;
125
+ $[10] = t3;
126
+ } else t3 = $[10];
127
+ const [edge, setEdge] = useState(t3);
128
+ const onScroll = useAnimatedScrollHandler({ onScroll: (event) => {
129
+ "worklet";
130
+ scrolled.set(fromStart(event.contentOffset.x, end, rtl));
131
+ } });
132
+ useAnimatedReaction(() => {
133
+ "worklet";
134
+ return edgeOf(scrolled.get(), end);
135
+ }, (now, before) => {
136
+ "worklet";
137
+ if (now !== before) scheduleOnRN(setEdge, now);
138
+ });
139
+ let t4;
140
+ if ($[11] !== end || $[12] !== masked || $[13] !== reduceMotion || $[14] !== rtl || $[15] !== scrolled || $[16] !== step) {
141
+ t4 = (direction) => {
142
+ const geometry = {
143
+ end,
144
+ masked,
145
+ scrolled: scrolled.get(),
146
+ step
147
+ };
148
+ scroller.current?.scrollTo({
149
+ animated: !reduceMotion,
150
+ x: fromStart(along(direction, geometry), end, rtl)
151
+ });
152
+ };
153
+ $[11] = end;
154
+ $[12] = masked;
155
+ $[13] = reduceMotion;
156
+ $[14] = rtl;
157
+ $[15] = scrolled;
158
+ $[16] = step;
159
+ $[17] = t4;
160
+ } else t4 = $[17];
161
+ const move = t4;
162
+ let t5;
163
+ if ($[18] !== move) {
164
+ t5 = () => {
165
+ move(-1);
166
+ };
167
+ $[18] = move;
168
+ $[19] = t5;
169
+ } else t5 = $[19];
170
+ const previous = t5;
171
+ let t6;
172
+ if ($[20] !== move) {
173
+ t6 = () => {
174
+ move(1);
175
+ };
176
+ $[20] = move;
177
+ $[21] = t6;
178
+ } else t6 = $[21];
179
+ const next = t6;
180
+ const slots = items.map((__0, index) => ({
181
+ count,
182
+ index,
183
+ large: arrangement.large,
184
+ layout,
185
+ path: paths[index],
186
+ rtl,
187
+ scrolled,
188
+ step
189
+ }));
190
+ const T0 = View;
191
+ const t7 = "region";
192
+ let t8;
193
+ if ($[22] !== messages.carousel) {
194
+ t8 = describedAs(messages.carousel);
195
+ $[22] = messages.carousel;
196
+ $[23] = t8;
197
+ } else t8 = $[23];
198
+ const t9 = composeStyles(styles.root, own.root, style);
199
+ const t10 = Animated;
200
+ const t11 = composeStyles(own.row, masked && styles.contentMasked, masked && { width: width + end });
201
+ const t12 = "fast";
202
+ const t13 = end > 0;
203
+ const t14 = true;
204
+ let t15;
205
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
206
+ t15 = widthTo(setMeasured);
207
+ $[24] = t15;
208
+ } else t15 = $[24];
209
+ const t16 = 16;
210
+ const t17 = false;
211
+ const t18 = offsetsOf(masked, arrangement.steps, step, count, end);
212
+ const t19 = items.map((item, index_0) => /* @__PURE__ */ jsx(SlotContext, {
213
+ value: slots[index_0] ?? null,
214
+ children: item
215
+ }, item.key ?? index_0));
216
+ let t20;
217
+ if ($[25] !== onScroll || $[26] !== t10.ScrollView || $[27] !== t11 || $[28] !== t13 || $[29] !== t15 || $[30] !== t18 || $[31] !== t19) {
218
+ t20 = /* @__PURE__ */ jsx(t10.ScrollView, {
219
+ contentContainerStyle: t11,
220
+ decelerationRate: t12,
221
+ focusable: t13,
222
+ horizontal: t14,
223
+ onLayout: t15,
224
+ onScroll,
225
+ ref: scroller,
226
+ scrollEventThrottle: t16,
227
+ showsHorizontalScrollIndicator: t17,
228
+ snapToOffsets: t18,
229
+ children: t19
230
+ });
231
+ $[25] = onScroll;
232
+ $[26] = t10.ScrollView;
233
+ $[27] = t11;
234
+ $[28] = t13;
235
+ $[29] = t15;
236
+ $[30] = t18;
237
+ $[31] = t19;
238
+ $[32] = t20;
239
+ } else t20 = $[32];
240
+ const t21 = previousLabel ?? messages.previousSlide;
241
+ const t22 = edge === "start" || edge === "both";
242
+ let t23;
243
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
244
+ t23 = /* @__PURE__ */ jsx(ChevronEndGlyph, { style: rtl ? styles.previousGlyphRightToLeft : styles.previousGlyph });
245
+ $[33] = t23;
246
+ } else t23 = $[33];
247
+ let t24;
248
+ if ($[34] !== previous || $[35] !== t21 || $[36] !== t22) {
249
+ t24 = /* @__PURE__ */ jsx(IconButton, {
250
+ "aria-label": t21,
251
+ isDisabled: t22,
252
+ onPress: previous,
253
+ children: t23
254
+ });
255
+ $[34] = previous;
256
+ $[35] = t21;
257
+ $[36] = t22;
258
+ $[37] = t24;
259
+ } else t24 = $[37];
260
+ const t25 = nextLabel ?? messages.nextSlide;
261
+ const t26 = edge === "end" || edge === "both";
262
+ let t27;
263
+ if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
264
+ t27 = /* @__PURE__ */ jsx(ChevronEndGlyph, {});
265
+ $[38] = t27;
266
+ } else t27 = $[38];
267
+ let t28;
268
+ if ($[39] !== next || $[40] !== t25 || $[41] !== t26) {
269
+ t28 = /* @__PURE__ */ jsx(IconButton, {
270
+ "aria-label": t25,
271
+ isDisabled: t26,
272
+ onPress: next,
273
+ children: t27
274
+ });
275
+ $[39] = next;
276
+ $[40] = t25;
277
+ $[41] = t26;
278
+ $[42] = t28;
279
+ } else t28 = $[42];
280
+ let t29;
281
+ if ($[43] !== own.controls || $[44] !== t24 || $[45] !== t28) {
282
+ t29 = /* @__PURE__ */ jsxs(View, {
283
+ style: own.controls,
284
+ children: [t24, t28]
285
+ });
286
+ $[43] = own.controls;
287
+ $[44] = t24;
288
+ $[45] = t28;
289
+ $[46] = t29;
290
+ } else t29 = $[46];
291
+ let t30;
292
+ if ($[47] !== T0 || $[48] !== label || $[49] !== props || $[50] !== t20 || $[51] !== t29 || $[52] !== t8 || $[53] !== t9) {
293
+ t30 = /* @__PURE__ */ jsxs(T0, {
294
+ "aria-label": label,
295
+ role: t7,
296
+ ...t8,
297
+ ...props,
298
+ style: t9,
299
+ children: [t20, t29]
300
+ });
301
+ $[47] = T0;
302
+ $[48] = label;
303
+ $[49] = props;
304
+ $[50] = t20;
305
+ $[51] = t29;
306
+ $[52] = t8;
307
+ $[53] = t9;
308
+ $[54] = t30;
309
+ } else t30 = $[54];
310
+ return t30;
311
+ }
312
+ /**
313
+ * One item. It is named by which of how many it is — "2 of 6" — unless it is
314
+ * given an `aria-label` of its own.
315
+ *
316
+ * `style`, `ref` and `testID` land on the item, the view with the corner that
317
+ * cuts what it holds to the width it is drawn at.
318
+ */
319
+ function CarouselItem(t0) {
320
+ const $ = c(28);
321
+ let children;
322
+ let props;
323
+ let style;
324
+ if ($[0] !== t0) {
325
+ ({children, style, ...props} = t0);
326
+ $[0] = t0;
327
+ $[1] = children;
328
+ $[2] = props;
329
+ $[3] = style;
330
+ } else {
331
+ children = $[1];
332
+ props = $[2];
333
+ style = $[3];
334
+ }
335
+ const theme = useTheme();
336
+ const own = stylesOf(theme);
337
+ const locale = useLocaleOf(void 0);
338
+ const messages = useMessages();
339
+ const slot = use(SlotContext);
340
+ const count = slot?.count ?? 1;
341
+ const index = slot?.index ?? 0;
342
+ const drawn = useDrawn(slot);
343
+ const T0 = View;
344
+ let t1;
345
+ if ($[4] !== slot) {
346
+ t1 = composeStyles(styles.slot, slotWidthOf(slot));
347
+ $[4] = slot;
348
+ $[5] = t1;
349
+ } else t1 = $[5];
350
+ const t2 = Animated;
351
+ const t3 = index + 1;
352
+ let t4;
353
+ if ($[6] !== count || $[7] !== locale || $[8] !== t3) {
354
+ t4 = slideLabelFor(t3, count, locale);
355
+ $[6] = count;
356
+ $[7] = locale;
357
+ $[8] = t3;
358
+ $[9] = t4;
359
+ } else t4 = $[9];
360
+ const t5 = "group";
361
+ let t6;
362
+ if ($[10] !== messages.slide) {
363
+ t6 = describedAs(messages.slide);
364
+ $[10] = messages.slide;
365
+ $[11] = t6;
366
+ } else t6 = $[11];
367
+ const t7 = composeStyles(own.item, drawn, style);
368
+ let t8;
369
+ if ($[12] !== slot) {
370
+ t8 = composeStyles(styles.held, slotWidthOf(slot));
371
+ $[12] = slot;
372
+ $[13] = t8;
373
+ } else t8 = $[13];
374
+ let t9;
375
+ if ($[14] !== children || $[15] !== t8) {
376
+ t9 = /* @__PURE__ */ jsx(View, {
377
+ style: t8,
378
+ children
379
+ });
380
+ $[14] = children;
381
+ $[15] = t8;
382
+ $[16] = t9;
383
+ } else t9 = $[16];
384
+ let t10;
385
+ if ($[17] !== props || $[18] !== t2.View || $[19] !== t4 || $[20] !== t6 || $[21] !== t7 || $[22] !== t9) {
386
+ t10 = /* @__PURE__ */ jsx(t2.View, {
387
+ "aria-label": t4,
388
+ role: t5,
389
+ ...t6,
390
+ ...props,
391
+ style: t7,
392
+ children: t9
393
+ });
394
+ $[17] = props;
395
+ $[18] = t2.View;
396
+ $[19] = t4;
397
+ $[20] = t6;
398
+ $[21] = t7;
399
+ $[22] = t9;
400
+ $[23] = t10;
401
+ } else t10 = $[23];
402
+ let t11;
403
+ if ($[24] !== T0 || $[25] !== t1 || $[26] !== t10) {
404
+ t11 = /* @__PURE__ */ jsx(T0, {
405
+ style: t1,
406
+ children: t10
407
+ });
408
+ $[24] = T0;
409
+ $[25] = t1;
410
+ $[26] = t10;
411
+ $[27] = t11;
412
+ } else t11 = $[27];
413
+ return t11;
414
+ }
415
+ function describedAs(word) {
416
+ return Platform.OS === "web" ? { "aria-roledescription": word } : void 0;
417
+ }
418
+ function edgeOf(scrolled, end) {
419
+ "worklet";
420
+ const atStart = scrolled <= SLACK;
421
+ const atEnd = scrolled >= end - SLACK;
422
+ if (atStart && atEnd) return "both";
423
+ if (atStart) return "start";
424
+ return atEnd ? "end" : "none";
425
+ }
426
+ /**
427
+ * A right-to-left scroll view's offset counted from its other edge: from the
428
+ * start of the text where it is from the left, and from the left where it is
429
+ * from the start, so the one function reads an offset and writes one. `end`
430
+ * is how much longer the content is than the view.
431
+ *
432
+ * iOS and Android agree on what a right-to-left scroll view reports, though
433
+ * they get there differently. iOS turns the whole scroll view over, so its
434
+ * own offset counts from the start, and React Native counts it from the left
435
+ * again before handing it to `onScroll`, and back before `scrollTo`
436
+ * (`_scrollViewMetrics` and `scrollToOffset` in
437
+ * RCTScrollViewComponentView.mm). Android's is the view's own `scrollX`,
438
+ * which is from the left and starts at the far end, so the start shows first
439
+ * (ReactHorizontalScrollView.kt). So on both an event's offset and the one
440
+ * `scrollTo` takes are from the left, while `snapToOffsets` is read from the
441
+ * start on both: Android turns its offsets round where it flings, and iOS
442
+ * compares them with its own turned-over offset. React Native Web reports no
443
+ * right-to-left layout through I18nManager, so there nothing is turned.
444
+ */
445
+ function fromStart(offset, end, rtl) {
446
+ "worklet";
447
+ return rtl ? end - offset : offset;
448
+ }
449
+ function offsetsOf(masked, steps, step, count, end) {
450
+ if (end <= 0) return;
451
+ if (masked) return Array.from({ length: steps + 1 }, (_, rest) => rest * step);
452
+ const starts = Array.from({ length: count }, (_, index) => Math.min(index * step, end));
453
+ return [...new Set(starts)];
454
+ }
455
+ function pathsOf(rests, count) {
456
+ const at = rests.length > 1 ? rests : [...rests, ...rests];
457
+ return Array.from({ length: count }, (_, index) => ({
458
+ rests: at.map((_placed, rest) => rest),
459
+ starts: at.map((placed) => placed[index]?.left ?? 0),
460
+ widths: at.map((placed) => placed[index]?.width ?? 0)
461
+ }));
462
+ }
463
+ function slotWidthOf(slot) {
464
+ return slot === null ? void 0 : { width: slot.large };
465
+ }
466
+ function useDrawn(slot) {
467
+ const path = slot?.path;
468
+ const scrolled = slot?.scrolled;
469
+ const index = slot?.index ?? 0;
470
+ const large = slot?.large ?? 0;
471
+ const step = slot?.step ?? 0;
472
+ const rtl = slot?.rtl ?? false;
473
+ return useAnimatedStyle(() => {
474
+ "worklet";
475
+ if (path === void 0 || scrolled === void 0) return {};
476
+ const offset = scrolled.get();
477
+ const position = offset / step;
478
+ const start = interpolate(position, path.rests, path.starts, Extrapolation.CLAMP);
479
+ const width = interpolate(position, path.rests, path.widths, Extrapolation.CLAMP);
480
+ const shift = offset + start + width / 2 - index * step - large / 2;
481
+ return {
482
+ transform: [{ translateX: rtl ? -shift : shift }],
483
+ width
484
+ };
485
+ });
486
+ }
487
+ function widthTo(onMeasure) {
488
+ return (event) => {
489
+ onMeasure(event.nativeEvent.layout.width);
490
+ };
491
+ }
492
+ Carousel.Item = CarouselItem;
493
+ //#endregion
494
+ export { Carousel, CarouselItem };
495
+
496
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","LayoutChangeEvent","ScrollView","ViewProps","ViewStyle","AnimatedStyle","SharedValue","Children","createContext","isValidElement","use","useCallback","useRef","useState","I18nManager","Platform","StyleSheet","useWindowDimensions","View","Animated","Extrapolation","interpolate","useAnimatedReaction","useAnimatedScrollHandler","useAnimatedStyle","useReducedMotion","useSharedValue","scheduleOnRN","CarouselLayout","Placement","arrange","GAP","placements","ChevronEndGlyph","slideLabelFor","useLocaleOf","useMessages","useTheme","composeStyles","themedStyles","IconButton","DEFAULT_ITEM_SIZE","SLACK","CarouselItemProps","Omit","children","ref","CarouselProps","itemSize","label","layout","nextLabel","previousLabel","Edge","Geometry","end","masked","scrolled","step","Path","rests","starts","widths","Slot","count","index","large","path","rtl","SlotContext","styles","create","contentMasked","overflow","held","flexGrow","previousGlyph","transform","scaleX","previousGlyphRightToLeft","root","minWidth","slot","alignItems","flexShrink","stylesOf","radii","spacing","controls","columnGap","sm","flexDirection","justifyContent","paddingHorizontal","lg","item","borderRadius","xl","rowGap","row","paddingVertical","along","direction","offset","Math","round","min","max","Carousel","t0","$","_c","props","style","t1","t2","undefined","theme","own","messages","reduceMotion","dimensions","scroller","measured","setMeasured","width","padding","isRTL","items","toArray","filter","length","room","arrangement","steps","paths","pathsOf","Array","from","_","rest","t3","edgeOf","edge","setEdge","onScroll","event","set","fromStart","contentOffset","x","get","now","before","t4","geometry","current","scrollTo","animated","move","t5","previous","t6","next","slots","map","__0","T0","t7","t8","carousel","describedAs","t9","t10","t11","t12","t13","t14","t15","Symbol","for","widthTo","t16","t17","t18","offsetsOf","t19","index_0","key","t20","t21","previousSlide","t22","t23","t24","t25","nextSlide","t26","t27","t28","t29","t30","CarouselItem","locale","drawn","useDrawn","slotWidthOf","slide","word","OS","atStart","atEnd","Set","at","_placed","placed","left","position","start","CLAMP","shift","translateX","onMeasure","nativeEvent","Item","_c"],"sources":["../../../src/components/carousel/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n LayoutChangeEvent,\n ScrollView,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\n\nimport {\n Children,\n createContext,\n isValidElement,\n use,\n useCallback,\n useRef,\n useState,\n} from 'react'\nimport {\n I18nManager,\n Platform,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated, {\n Extrapolation,\n interpolate,\n useAnimatedReaction,\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n} from 'react-native-reanimated'\nimport { scheduleOnRN } from 'react-native-worklets'\n\nimport type { CarouselLayout, Placement } from '../../carousel/arrangement'\n\nimport { arrange, GAP, placements } from '../../carousel/arrangement'\nimport { ChevronEndGlyph } from '../../glyphs'\nimport { slideLabelFor } from '../../i18n'\nimport { useLocaleOf, useMessages } from '../../i18n/provider'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { IconButton } from '../icon-button'\n\n// The carousel page's carousel, as kanso-ui's Carousel draws it: a row of\n// items that scrolls on and off the screen, in three of the page's layouts.\n// Each has the page's 16dp of padding at its ends and 8dp at its top and\n// bottom, 8dp between items and a 28dp corner on every item.\n//\n// - **Multi-browse**, the default, shows as many large items as fit at\n// `itemSize`, then a medium one and a small one, and fills its width\n// exactly; the large width gives way where the preferred one does not fit.\n// - **Hero** shows one large item and one small.\n// - **Uncontained** shows every item at `itemSize`, scrolling past the edge.\n//\n// **Items change size as they move**, as the page draws them. The first two\n// layouts come to rest one item apart, and between two rests every item's\n// place and width are interpolated, so an item shrinks as it leaves and\n// grows as it arrives; the last rests turn the arrangement round a slot at a\n// time, so every item is drawn large at one of them. The arithmetic is\n// `src/carousel/arrangement.ts`, web's own.\n//\n// **The scrolling is the platform's.** A horizontal scroll view holds the\n// items in a row, each in a slot as wide as a large item, and is as long as\n// the run of rests, so it comes to rest at them through `snapToOffsets`. A\n// scroll handler keeps how far it has scrolled on the UI thread, and each\n// item is drawn from that there too: moved along by as much as the view has\n// scrolled, which holds it against what shows, and then to where the\n// arrangement places it, and cut to the width it is drawn at by a view with\n// the page's corner, centred on what it holds, which is laid out at the large\n// width. What it holds is cut at both sides rather than squeezed, as the\n// page's masked items are, and as web's are by `clip-path`. Uncontained has\n// no rests and no masks, so its items scroll in the row themselves, snapping\n// to their own starts.\n//\n// **It is the ARIA carousel pattern** that web follows: a region named by\n// `label`, each item a group named by which of how many it is, and a previous\n// and a next button under it, at the end, which move to the neighbouring rest\n// and are disabled at either limit. Under React Native Web the region and its\n// items take web's role descriptions, carousel and slide; neither platform\n// has a role description to give them. On iOS and Android a screen reader\n// moves through the items itself, and nothing here scrolls when one is\n// reached, which web does on focus. Under reduced motion the buttons jump\n// rather than scroll.\n//\n// The gap between items is the arrangement's 8dp, `GAP`, rather than the\n// theme's `spacing.sm`, since every rest and every place is worked out from\n// it, and a scheme moving the one without the other would draw the items\n// over each other. The padding at the ends is the theme's `spacing.lg`, which\n// the arithmetic is handed.\n//\n// The page's large width is \"dynamic, or user-set\", and neither MDC-Android\n// nor Compose has a default for it; `itemSize`'s 240 is web's own.\n// Uncontained keeps the padding at its end as well as its start, where the\n// page gives it a leading padding alone, so its last item does not end flush\n// against the edge.\n//\n// React Native Web has no `snapToOffsets`, so in the web Storybook the\n// carousel rests wherever a drag leaves it; the buttons still move it from\n// rest to rest.\n\nconst DEFAULT_ITEM_SIZE = 240\n\n// How near a limit counts as at it, in dp, since a scroll can come to rest a\n// fraction of a pixel short.\nconst SLACK = 0.5\n\ntype CarouselItemProps = Omit<ViewProps, 'children'> & {\n /** What the item shows: usually an image, which the item masks. */\n readonly children?: ReactNode\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\ntype CarouselProps = Omit<ViewProps, 'children'> & {\n /** The items: `Carousel.Item` for each. */\n readonly children?: ReactNode\n /**\n * The large item's preferred width, in dp. Multi-browse lays out as many\n * as fit and narrows them where they do not; uncontained draws every item\n * at it; hero takes its large item's width from the carousel's.\n * @default 240\n */\n readonly itemSize?: number\n /**\n * What the carousel shows, for a screen reader. Required rather than\n * optional: a carousel is a region, and a region with no name is one a\n * screen reader cannot introduce.\n */\n readonly label: string\n /**\n * Which of the page's layouts the carousel draws.\n * @default 'multi-browse'\n */\n readonly layout?: CarouselLayout\n /**\n * What the next button is called. Left out, the library names it in the\n * reader's locale — \"Next slide\" in English.\n */\n readonly nextLabel?: string\n /**\n * What the previous button is called. Left out, the library names it in\n * the reader's locale — \"Previous slide\" in English.\n */\n readonly previousLabel?: string\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\n/** Which limits the carousel is at, as one value a reaction can compare. */\ntype Edge = 'both' | 'end' | 'none' | 'start'\n\n/** What the controls scroll by, as numbers read off one render. */\ntype Geometry = {\n /** The offset of the last rest, or for uncontained how far it scrolls. */\n readonly end: number\n readonly masked: boolean\n readonly scrolled: number\n /** The distance between two rests, or for uncontained between two items. */\n readonly step: number\n}\n\n/** Where a layout that masks draws an item at each of its rests. */\ntype Path = {\n /** The rests, counted from 0, which the two below are drawn at. */\n readonly rests: readonly number[]\n /** Where the item starts at each rest, along the content box. */\n readonly starts: readonly number[]\n readonly widths: readonly number[]\n}\n\ntype Slot = {\n readonly count: number\n readonly index: number\n /** The width the item is laid out at. */\n readonly large: number\n readonly layout: CarouselLayout\n /** Where it is drawn, for a layout that masks. */\n readonly path: Path | undefined\n readonly rtl: boolean\n /** How far the carousel has scrolled along the text, on the UI thread. */\n readonly scrolled: SharedValue<number>\n /** The distance between two rests. */\n readonly step: number\n}\n\nconst SlotContext = createContext<null | Slot>(null)\n\nconst styles = StyleSheet.create({\n // A layout that masks holds its row to the run of rests, and clips what it\n // places past either end rather than letting it lengthen the scroll view.\n contentMasked: {\n overflow: 'hidden',\n },\n // What an item holds, laid out at the large width and centred on the mask,\n // so the mask cuts it at both sides.\n held: {\n flexGrow: 1,\n },\n // Previous points at the start, and next at the end; the end chevron turns\n // over with the text itself, so previous turns it back.\n previousGlyph: {\n transform: [{ scaleX: -1 }],\n },\n previousGlyphRightToLeft: {\n transform: [{ scaleX: 1 }],\n },\n root: {\n minWidth: 0,\n },\n // The room a large item is laid out in. The mask inside it is centred,\n // and the row stretches every slot to the tallest item.\n slot: {\n alignItems: 'center',\n flexShrink: 0,\n },\n})\n\nconst stylesOf = themedStyles(({ radii, spacing }) =>\n StyleSheet.create({\n controls: {\n columnGap: spacing.sm,\n flexDirection: 'row',\n justifyContent: 'flex-end',\n paddingHorizontal: spacing.lg,\n },\n // The mask, which is the item: the page's corner, cutting what it holds\n // to the width it is drawn at.\n item: {\n alignItems: 'center',\n borderRadius: radii.xl,\n flexGrow: 1,\n overflow: 'hidden',\n },\n root: {\n rowGap: spacing.sm,\n },\n row: {\n columnGap: GAP,\n flexDirection: 'row',\n paddingHorizontal: spacing.lg,\n paddingVertical: spacing.sm,\n },\n }),\n)\n\n// Where a press of previous or next scrolls to from `scrolled`: the rest\n// either side of the nearest one, or for uncontained an item's width along,\n// kept between the two ends.\nfunction along(\n direction: -1 | 1,\n { end, masked, scrolled, step }: Geometry,\n): number {\n const offset = masked\n ? (Math.round(scrolled / step) + direction) * step\n : scrolled + direction * step\n return Math.min(Math.max(offset, 0), end)\n}\n\n/**\n * A row of items that scrolls on and off the screen, in the carousel page's\n * multi-browse, hero or uncontained layout. Name it with `label`, and give it\n * a `Carousel.Item` for each item.\n *\n * ```tsx\n * <Carousel label=\"Label\">\n * <Carousel.Item><Image alt=\"First item\" source={first} /></Carousel.Item>\n * <Carousel.Item><Image alt=\"Second item\" source={second} /></Carousel.Item>\n * </Carousel>\n * ```\n *\n * `style`, `ref` and `testID` land on the carousel as a whole, which is the\n * view a layout positions, and a `style` there applies over its own.\n */\nfunction Carousel({\n children,\n itemSize = DEFAULT_ITEM_SIZE,\n label,\n layout = 'multi-browse',\n nextLabel,\n previousLabel,\n style,\n ...props\n}: CarouselProps) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const messages = useMessages()\n const reduceMotion = useReducedMotion()\n const dimensions = useWindowDimensions()\n const scroller = useRef<ComponentRef<typeof ScrollView>>(null)\n const scrolled = useSharedValue(0)\n // The scroll view's width, which the layout reports once it has drawn;\n // before that the first render guesses the window's.\n const [measured, setMeasured] = useState<number>()\n const width = measured ?? dimensions.width\n const padding = theme.spacing.lg\n const rtl = I18nManager.isRTL\n\n const items = Children.toArray(children).filter(isValidElement)\n const count = items.length\n const room = Math.max(width - 2 * padding, 0)\n const arrangement = arrange(layout, room, itemSize, count)\n const masked = layout !== 'uncontained'\n const step = arrangement.large + GAP\n // The last rest, or how far the uncontained row runs past the scroll view.\n const end = masked\n ? arrangement.steps * step\n : Math.max(count * step - GAP + 2 * padding - width, 0)\n const paths = masked\n ? pathsOf(\n Array.from({ length: arrangement.steps + 1 }, (_, rest) =>\n placements(layout, arrangement, room, padding, count, rest),\n ),\n count,\n )\n : []\n\n const [edge, setEdge] = useState<Edge>(() => edgeOf(0, end))\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: (event) => {\n 'worklet'\n scrolled.set(fromStart(event.contentOffset.x, end, rtl))\n },\n })\n\n // Which limits the carousel is at, on the JavaScript thread, for the two\n // buttons; told only when it changes, rather than on every frame.\n useAnimatedReaction(\n () => {\n 'worklet'\n return edgeOf(scrolled.get(), end)\n },\n (now, before) => {\n 'worklet'\n if (now !== before) {\n scheduleOnRN(setEdge, now)\n }\n },\n )\n\n const move = useCallback(\n (direction: -1 | 1) => {\n const geometry = { end, masked, scrolled: scrolled.get(), step }\n scroller.current?.scrollTo({\n animated: !reduceMotion,\n x: fromStart(along(direction, geometry), end, rtl),\n })\n },\n [end, masked, reduceMotion, rtl, scrolled, step],\n )\n const previous = useCallback(() => {\n move(-1)\n }, [move])\n const next = useCallback(() => {\n move(1)\n }, [move])\n\n const slots = items.map((_, index): Slot => ({\n count,\n index,\n large: arrangement.large,\n layout,\n path: paths[index],\n rtl,\n scrolled,\n step,\n }))\n\n return (\n <View\n aria-label={label}\n role=\"region\"\n {...describedAs(messages.carousel)}\n {...props}\n style={composeStyles<ViewStyle>(styles.root, own.root, style)}\n >\n <Animated.ScrollView\n contentContainerStyle={composeStyles<ViewStyle>(\n own.row,\n masked && styles.contentMasked,\n masked && { width: width + end },\n )}\n decelerationRate=\"fast\"\n // A keyboard stop while there is anywhere to scroll, so the arrow\n // keys move it whatever its items hold, which axe's\n // scrollable-region-focusable asks of it under React Native Web.\n focusable={end > 0}\n horizontal\n onLayout={widthTo(setMeasured)}\n onScroll={onScroll}\n ref={scroller}\n scrollEventThrottle={16}\n showsHorizontalScrollIndicator={false}\n snapToOffsets={offsetsOf(masked, arrangement.steps, step, count, end)}\n >\n {items.map((item, index) => (\n <SlotContext key={item.key ?? index} value={slots[index] ?? null}>\n {item}\n </SlotContext>\n ))}\n </Animated.ScrollView>\n <View style={own.controls}>\n <IconButton\n aria-label={previousLabel ?? messages.previousSlide}\n isDisabled={edge === 'start' || edge === 'both'}\n onPress={previous}\n >\n <ChevronEndGlyph\n style={rtl ? styles.previousGlyphRightToLeft : styles.previousGlyph}\n />\n </IconButton>\n <IconButton\n aria-label={nextLabel ?? messages.nextSlide}\n isDisabled={edge === 'end' || edge === 'both'}\n onPress={next}\n >\n <ChevronEndGlyph />\n </IconButton>\n </View>\n </View>\n )\n}\n\n/**\n * One item. It is named by which of how many it is — \"2 of 6\" — unless it is\n * given an `aria-label` of its own.\n *\n * `style`, `ref` and `testID` land on the item, the view with the corner that\n * cuts what it holds to the width it is drawn at.\n */\nfunction CarouselItem({ children, style, ...props }: CarouselItemProps) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const locale = useLocaleOf(undefined)\n const messages = useMessages()\n const slot = use(SlotContext)\n const count = slot?.count ?? 1\n const index = slot?.index ?? 0\n const drawn = useDrawn(slot)\n\n return (\n <View style={composeStyles<ViewStyle>(styles.slot, slotWidthOf(slot))}>\n <Animated.View\n aria-label={slideLabelFor(index + 1, count, locale)}\n role=\"group\"\n {...describedAs(messages.slide)}\n {...props}\n style={composeStyles<AnimatedStyle<ViewStyle>>(own.item, drawn, style)}\n >\n <View style={composeStyles<ViewStyle>(styles.held, slotWidthOf(slot))}>\n {children}\n </View>\n </Animated.View>\n </View>\n )\n}\n\n// What the region and its items are described as, under React Native Web,\n// where the DOM takes a role description; React Native has none to give.\nfunction describedAs(word: string) {\n return Platform.OS === 'web' ? { 'aria-roledescription': word } : undefined\n}\n\nfunction edgeOf(scrolled: number, end: number): Edge {\n 'worklet'\n const atStart = scrolled <= SLACK\n const atEnd = scrolled >= end - SLACK\n if (atStart && atEnd) {\n return 'both'\n }\n if (atStart) {\n return 'start'\n }\n return atEnd ? 'end' : 'none'\n}\n\n/**\n * A right-to-left scroll view's offset counted from its other edge: from the\n * start of the text where it is from the left, and from the left where it is\n * from the start, so the one function reads an offset and writes one. `end`\n * is how much longer the content is than the view.\n *\n * iOS and Android agree on what a right-to-left scroll view reports, though\n * they get there differently. iOS turns the whole scroll view over, so its\n * own offset counts from the start, and React Native counts it from the left\n * again before handing it to `onScroll`, and back before `scrollTo`\n * (`_scrollViewMetrics` and `scrollToOffset` in\n * RCTScrollViewComponentView.mm). Android's is the view's own `scrollX`,\n * which is from the left and starts at the far end, so the start shows first\n * (ReactHorizontalScrollView.kt). So on both an event's offset and the one\n * `scrollTo` takes are from the left, while `snapToOffsets` is read from the\n * start on both: Android turns its offsets round where it flings, and iOS\n * compares them with its own turned-over offset. React Native Web reports no\n * right-to-left layout through I18nManager, so there nothing is turned.\n */\nfunction fromStart(offset: number, end: number, rtl: boolean): number {\n 'worklet'\n return rtl ? end - offset : offset\n}\n\n// Where the scroll view comes to rest: at every rest of a layout that masks,\n// or at each uncontained item's start, as far as the row goes.\nfunction offsetsOf(\n masked: boolean,\n steps: number,\n step: number,\n count: number,\n end: number,\n): number[] | undefined {\n if (end <= 0) {\n return undefined\n }\n if (masked) {\n return Array.from({ length: steps + 1 }, (_, rest) => rest * step)\n }\n const starts = Array.from({ length: count }, (_, index) =>\n Math.min(index * step, end),\n )\n return [...new Set(starts)]\n}\n\n// Each item's place and width at every rest, which the UI thread\n// interpolates between as the carousel moves. A carousel with one rest is\n// given it twice, since an interpolation needs two.\nfunction pathsOf(rests: readonly Placement[][], count: number): Path[] {\n const at = rests.length > 1 ? rests : [...rests, ...rests]\n return Array.from({ length: count }, (_, index) => ({\n rests: at.map((_placed, rest) => rest),\n starts: at.map((placed) => placed[index]?.left ?? 0),\n widths: at.map((placed) => placed[index]?.width ?? 0),\n }))\n}\n\nfunction slotWidthOf(slot: null | Slot): undefined | ViewStyle {\n return slot === null ? undefined : { width: slot.large }\n}\n\n// Where a layout that masks draws an item as the carousel scrolls: moved\n// along by as much as it has scrolled, which holds it against what shows,\n// then from its slot to where the arrangement places it, at the width it is\n// drawn at. Physical, since a transform is: a right-to-left row is laid out\n// from the right, so there the item moves the other way.\nfunction useDrawn(slot: null | Slot) {\n const path = slot?.path\n const scrolled = slot?.scrolled\n const index = slot?.index ?? 0\n const large = slot?.large ?? 0\n const step = slot?.step ?? 0\n const rtl = slot?.rtl ?? false\n\n return useAnimatedStyle(() => {\n 'worklet'\n if (path === undefined || scrolled === undefined) {\n return {}\n }\n const offset = scrolled.get()\n const position = offset / step\n const start = interpolate(\n position,\n path.rests,\n path.starts,\n Extrapolation.CLAMP,\n )\n const width = interpolate(\n position,\n path.rests,\n path.widths,\n Extrapolation.CLAMP,\n )\n const shift = offset + start + width / 2 - index * step - large / 2\n return { transform: [{ translateX: rtl ? -shift : shift }], width }\n })\n}\n\n// A layout handler handing the width it reports to `onMeasure`. Built by a\n// call rather than written inline, which is what react-perf's\n// jsx-no-new-function-as-prop is after; the React Compiler memoises it.\nfunction widthTo(onMeasure: (width: number) => void) {\n return (event: LayoutChangeEvent) => {\n onMeasure(event.nativeEvent.layout.width)\n }\n}\n\nCarousel.Item = CarouselItem\n\nexport { Carousel, CarouselItem }\nexport type { CarouselItemProps, CarouselLayout, CarouselProps }\n"],"mapp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AQ8F,IAAK;EAC5B,MAAAkE,WAAiBlH,SAAS7C;EAC1B,MAAAgK,QAAcrM,YACZoM,UACAtJ,KAAIP,OACJO,KAAIN,QACJzC,cAAauM,KACf;EACA,MAAA9F,QAAcxG,YACZoM,UACAtJ,KAAIP,OACJO,KAAIL,QACJ1C,cAAauM,KACf;EACA,MAAAC,QAAcrH,SAASmH,QAAQ7F,QAAQ,IAAI5D,QAAQP,OAAOQ,QAAQ;EAAC,OAC5D;GAAAW,WAAa,CAAC,EAAAgJ,YAAczJ,MAAA,CAAOwJ,QAAPA,MAAqB,CAAC;GAAC/F;EAAQ;CAAC,CACpE;AAAC;AAMJ,SAASwD,QAAQyC,WAAoC;CACnD,QAAQ5E,UAA6B;EACnC4E,UAAU5E,MAAM6E,YAAY7K,OAAO2E,KAAK;CAC1C;AACF;AAEAjB,SAASoH,OAAOtB"}
@@ -45,10 +45,9 @@ type CheckboxGroupProps = Omit<ViewProps, 'children' | 'style'> & {
45
45
  */
46
46
  readonly label: string;
47
47
  /**
48
- * The name the form around the group knows it by, which its
49
- * `validationErrors` are keyed on. A form hands `onSubmit` one string per
50
- * name, so a group's selection is not among those values: read it through
51
- * `onChange`, or hold it with `value`.
48
+ * The name the form around the group knows it by: its `onSubmit` is handed
49
+ * the ticked entries' values as a list under it, an empty one while none
50
+ * is ticked, and its `validationErrors` are keyed on it.
52
51
  */
53
52
  readonly name?: string;
54
53
  /** Called with the newly selected entries whenever a press changes them. */
@@ -146,7 +146,7 @@ function CheckboxGroup(t0) {
146
146
  isReadOnly,
147
147
  isRequired,
148
148
  name,
149
- submitted: void 0,
149
+ submitted: state.value,
150
150
  validate,
151
151
  value: state.value
152
152
  };