@kanso-labs/react-native-kanso-ui 0.3.0 → 0.4.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.
@@ -0,0 +1,284 @@
1
+ import { useTheme } from "../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../theme/styles.js";
3
+ import { ButtonSlotContext } from "../button/slots.js";
4
+ import { AnimatedPressable } from "../button/index.js";
5
+ import { withOpacity } from "../theme/color.js";
6
+ import { OverlayHost } from "../overlay/host.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { AccessibilityInfo, I18nManager, Modal, Platform, StyleSheet } from "react-native";
9
+ import { useEffect, useRef, useState } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { useOverlayTriggerState } from "react-stately/useOverlayTriggerState";
12
+ //#region src/modal/index.tsx
13
+ const NO_INSETS = {
14
+ bottom: 0,
15
+ left: 0,
16
+ right: 0,
17
+ top: 0
18
+ };
19
+ const ORIENTATIONS = [
20
+ "portrait",
21
+ "portrait-upside-down",
22
+ "landscape",
23
+ "landscape-left",
24
+ "landscape-right"
25
+ ];
26
+ const SCRIM_OPACITY = .32;
27
+ const stylesOf = themedStyles(({ colors }) => StyleSheet.create({ scrim: {
28
+ backgroundColor: withOpacity(colors.scrim, SCRIM_OPACITY),
29
+ bottom: 0,
30
+ left: 0,
31
+ position: "absolute",
32
+ right: 0,
33
+ top: 0
34
+ } }));
35
+ function focusOf(title) {
36
+ return () => {
37
+ if (title !== null && Platform.OS !== "web") AccessibilityInfo.sendAccessibilityEvent(title, "focus");
38
+ };
39
+ }
40
+ function ignore() {}
41
+ function insetsOf(insets) {
42
+ const rtl = I18nManager.isRTL;
43
+ return {
44
+ paddingBottom: insets.bottom,
45
+ paddingEnd: rtl ? insets.left : insets.right,
46
+ paddingStart: rtl ? insets.right : insets.left,
47
+ paddingTop: insets.top
48
+ };
49
+ }
50
+ /**
51
+ * The window a modal surface is drawn in: the `Modal`, the overlays it hosts,
52
+ * and the scrim, with the surface itself as its children.
53
+ */
54
+ function ModalWindow(t0) {
55
+ const $ = c(20);
56
+ const { children, isKeyboardDismissDisabled, labelledBy, onClose, onScrimPress, scrim, title } = t0;
57
+ const styles = stylesOf(useTheme());
58
+ const T0 = Modal;
59
+ const t1 = "none";
60
+ const t2 = Platform.OS === "web" ? labelledBy : void 0;
61
+ const t3 = true;
62
+ const t4 = isKeyboardDismissDisabled ? ignore : onClose;
63
+ let t5;
64
+ if ($[0] !== title) {
65
+ t5 = focusOf(title);
66
+ $[0] = title;
67
+ $[1] = t5;
68
+ } else t5 = $[1];
69
+ const t6 = true;
70
+ const t7 = ORIENTATIONS;
71
+ const t8 = true;
72
+ const t9 = true;
73
+ const T1 = ButtonSlotContext;
74
+ const t10 = null;
75
+ const T2 = OverlayHost;
76
+ const T3 = AnimatedPressable;
77
+ const t11 = false;
78
+ const t12 = true;
79
+ const t13 = false;
80
+ const t14 = composeStyles(styles.scrim, scrim);
81
+ let t15;
82
+ if ($[2] !== T3 || $[3] !== onScrimPress || $[4] !== t14) {
83
+ t15 = /* @__PURE__ */ jsx(T3, {
84
+ accessible: t11,
85
+ "aria-hidden": t12,
86
+ focusable: t13,
87
+ onPress: onScrimPress,
88
+ style: t14,
89
+ tabIndex: -1
90
+ });
91
+ $[2] = T3;
92
+ $[3] = onScrimPress;
93
+ $[4] = t14;
94
+ $[5] = t15;
95
+ } else t15 = $[5];
96
+ let t16;
97
+ if ($[6] !== T2 || $[7] !== children || $[8] !== t15) {
98
+ t16 = /* @__PURE__ */ jsxs(T2, { children: [t15, children] });
99
+ $[6] = T2;
100
+ $[7] = children;
101
+ $[8] = t15;
102
+ $[9] = t16;
103
+ } else t16 = $[9];
104
+ let t17;
105
+ if ($[10] !== T1 || $[11] !== t16) {
106
+ t17 = /* @__PURE__ */ jsx(T1, {
107
+ value: t10,
108
+ children: t16
109
+ });
110
+ $[10] = T1;
111
+ $[11] = t16;
112
+ $[12] = t17;
113
+ } else t17 = $[12];
114
+ let t18;
115
+ if ($[13] !== T0 || $[14] !== t17 || $[15] !== t2 || $[16] !== t4 || $[17] !== t5 || $[18] !== t7) {
116
+ t18 = /* @__PURE__ */ jsx(T0, {
117
+ animationType: t1,
118
+ "aria-labelledby": t2,
119
+ navigationBarTranslucent: t3,
120
+ onRequestClose: t4,
121
+ onShow: t5,
122
+ statusBarTranslucent: t6,
123
+ supportedOrientations: t7,
124
+ transparent: t8,
125
+ visible: t9,
126
+ children: t17
127
+ });
128
+ $[13] = T0;
129
+ $[14] = t17;
130
+ $[15] = t2;
131
+ $[16] = t4;
132
+ $[17] = t5;
133
+ $[18] = t7;
134
+ $[19] = t18;
135
+ } else t18 = $[19];
136
+ return t18;
137
+ }
138
+ function panelRoleOf(role, labelledBy) {
139
+ if (Platform.OS === "web") return {};
140
+ return {
141
+ "aria-labelledby": labelledBy,
142
+ "aria-modal": true,
143
+ role
144
+ };
145
+ }
146
+ function refsOf(own, other) {
147
+ return (node) => {
148
+ own(node);
149
+ if (typeof other === "function") other(node);
150
+ else if (other !== null && other !== void 0) other.current = node;
151
+ };
152
+ }
153
+ function registerOf(setParts) {
154
+ return (part) => {
155
+ setParts((parts) => ({
156
+ ...parts,
157
+ [part]: parts[part] + 1
158
+ }));
159
+ return () => {
160
+ setParts((parts) => ({
161
+ ...parts,
162
+ [part]: parts[part] - 1
163
+ }));
164
+ };
165
+ };
166
+ }
167
+ /**
168
+ * The open state a surface's content part reads: its trigger's, inside one,
169
+ * and its own otherwise. `present` stays true from the moment it opens until
170
+ * the call site's exit has run and set it false, and the close slot and the
171
+ * scrim close it through `close`.
172
+ */
173
+ function useModalState(outer, props) {
174
+ const $ = c(9);
175
+ const own = useOverlayTriggerState(props);
176
+ const state = outer?.state ?? own;
177
+ const [present, setPresent] = useState(state.isOpen);
178
+ let t0;
179
+ if ($[0] !== state) {
180
+ t0 = () => {
181
+ state.close();
182
+ };
183
+ $[0] = state;
184
+ $[1] = t0;
185
+ } else t0 = $[1];
186
+ const close = t0;
187
+ let t1;
188
+ if ($[2] !== close) {
189
+ t1 = { close };
190
+ $[2] = close;
191
+ $[3] = t1;
192
+ } else t1 = $[3];
193
+ const slots = t1;
194
+ if (state.isOpen && !present) setPresent(true);
195
+ useReturnFocus(present, outer);
196
+ let t2;
197
+ if ($[4] !== close || $[5] !== present || $[6] !== slots || $[7] !== state) {
198
+ t2 = {
199
+ close,
200
+ present,
201
+ setPresent,
202
+ slots,
203
+ state
204
+ };
205
+ $[4] = close;
206
+ $[5] = present;
207
+ $[6] = slots;
208
+ $[7] = state;
209
+ $[8] = t2;
210
+ } else t2 = $[8];
211
+ return t2;
212
+ }
213
+ /**
214
+ * The open state a surface's trigger part holds, and the default slot a
215
+ * button inside it fills: it records itself as the button focus returns to,
216
+ * and opens the surface. React Native types the target as a bare view tag
217
+ * too, which focus cannot be sent to, so such a press records nothing.
218
+ */
219
+ function useModalTrigger(props) {
220
+ const $ = c(8);
221
+ const state = useOverlayTriggerState(props);
222
+ const [trigger, setTrigger] = useState(null);
223
+ let t0;
224
+ if ($[0] !== state || $[1] !== trigger) {
225
+ t0 = {
226
+ state,
227
+ trigger
228
+ };
229
+ $[0] = state;
230
+ $[1] = trigger;
231
+ $[2] = t0;
232
+ } else t0 = $[2];
233
+ const context = t0;
234
+ let t1;
235
+ if ($[3] !== state) {
236
+ t1 = { default: (event) => {
237
+ const target = event.currentTarget;
238
+ setTrigger(typeof target === "number" ? null : target);
239
+ state.open();
240
+ } };
241
+ $[3] = state;
242
+ $[4] = t1;
243
+ } else t1 = $[4];
244
+ const slots = t1;
245
+ let t2;
246
+ if ($[5] !== context || $[6] !== slots) {
247
+ t2 = {
248
+ context,
249
+ slots
250
+ };
251
+ $[5] = context;
252
+ $[6] = slots;
253
+ $[7] = t2;
254
+ } else t2 = $[7];
255
+ return t2;
256
+ }
257
+ function useReturnFocus(present, outer) {
258
+ const $ = c(6);
259
+ const shown = useRef(present);
260
+ let t0;
261
+ if ($[0] !== outer?.trigger || $[1] !== present) {
262
+ t0 = () => {
263
+ const trigger = outer?.trigger ?? null;
264
+ const gone = shown.current && !present;
265
+ shown.current = present;
266
+ if (gone && trigger !== null && Platform.OS !== "web") AccessibilityInfo.sendAccessibilityEvent(trigger, "focus");
267
+ };
268
+ $[0] = outer?.trigger;
269
+ $[1] = present;
270
+ $[2] = t0;
271
+ } else t0 = $[2];
272
+ let t1;
273
+ if ($[3] !== outer || $[4] !== present) {
274
+ t1 = [outer, present];
275
+ $[3] = outer;
276
+ $[4] = present;
277
+ $[5] = t1;
278
+ } else t1 = $[5];
279
+ useEffect(t0, t1);
280
+ }
281
+ //#endregion
282
+ export { ModalWindow, NO_INSETS, insetsOf, panelRoleOf, refsOf, registerOf, useModalState, useModalTrigger };
283
+
284
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactNode","Ref","GestureResponderEvent","HostInstance","ModalProps","ViewProps","ViewStyle","AnimatedStyle","EdgeInsets","OverlayTriggerState","useCallback","useEffect","useMemo","useRef","useState","AccessibilityInfo","I18nManager","Modal","Platform","StyleSheet","useOverlayTriggerState","ButtonSlots","ResolvedTheme","AnimatedPressable","ButtonSlotContext","OverlayHost","withOpacity","useTheme","composeStyles","themedStyles","NO_INSETS","bottom","left","right","top","ORIENTATIONS","SCRIM_OPACITY","stylesOf","colors","create","scrim","backgroundColor","position","ModalOpenProps","defaultOpen","isOpen","onOpenChange","ModalTrigger","state","trigger","ModalWindowProps","children","isKeyboardDismissDisabled","labelledBy","onClose","onScrimPress","title","focusOf","OS","sendAccessibilityEvent","ignore","insetsOf","insets","rtl","isRTL","paddingBottom","paddingEnd","paddingStart","paddingTop","ModalWindow","t0","$","_c","styles","T0","t1","t2","undefined","t3","t4","t5","t6","t8","t9","T1","t10","T2","T3","t11","t12","t13","t14","t15","t16","t17","t18","t7","panelRoleOf","role","Pick","refsOf","own","node","T","other","current","registerOf","setParts","update","parts","Readonly","Record","Part","part","useModalState","outer","props","present","setPresent","close","slots","useReturnFocus","useModalTrigger","setTrigger","context","default","event","target","currentTarget","open","shown","gone","_c"],"sources":["../../src/modal/index.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react'\nimport type {\n GestureResponderEvent,\n HostInstance,\n ModalProps,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { EdgeInsets } from 'react-native-safe-area-context'\nimport type { OverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport {\n AccessibilityInfo,\n I18nManager,\n Modal,\n Platform,\n StyleSheet,\n} from 'react-native'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { ButtonSlots } from '../button/slots'\nimport type { ResolvedTheme } from '../theme/scope'\n\nimport { AnimatedPressable } from '../button'\nimport { ButtonSlotContext } from '../button/slots'\nimport { OverlayHost } from '../overlay'\nimport { withOpacity } from '../theme/color'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles, themedStyles } from '../theme/styles'\n\n// The window a modal surface is drawn in, and what a dialog and a sheet share\n// around it: the trigger that opens it, the open state, the scrim, and where\n// focus goes as it shows and once it has gone. Internal: nothing here is\n// exported from the package.\n//\n// **It is a React Native `Modal`**, which keeps React context, so the surface\n// keeps the `ThemeScope` around it, and which is a window of its own on iOS\n// and Android, above the screen and its overlays. The window therefore hosts\n// overlays of its own, so a snackbar or a popover raised from inside it draws\n// above it rather than under it.\n\n// Outside a SafeAreaProvider the insets are unknown, and the window's own edge\n// is the best bound there is.\nconst NO_INSETS: EdgeInsets = { bottom: 0, left: 0, right: 0, top: 0 }\n\n// iOS presents a `Modal` in portrait alone unless told otherwise, which would\n// turn an app held sideways round as the surface opened.\nconst ORIENTATIONS: ModalProps['supportedOrientations'] = [\n 'portrait',\n 'portrait-upside-down',\n 'landscape',\n 'landscape-left',\n 'landscape-right',\n]\n\n// The scrim is the scrim role at 32%, the opacity Material Design gives a\n// modal's scrim and web mixes in.\nconst SCRIM_OPACITY = 0.32\n\nconst stylesOf = themedStyles(({ colors }: ResolvedTheme) =>\n StyleSheet.create({\n scrim: {\n backgroundColor: withOpacity(colors.scrim, SCRIM_OPACITY),\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n }),\n)\n\n/** Whether a modal surface is open, and who holds that state. */\ntype ModalOpenProps = {\n readonly defaultOpen?: boolean\n readonly isOpen?: boolean\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\n/**\n * What a surface's trigger part hands its content: the open state, and the\n * button that last opened it, for focus to return to.\n */\ntype ModalTrigger = {\n readonly state: OverlayTriggerState\n readonly trigger: HostInstance | null\n}\n\ntype ModalWindowProps = {\n readonly children?: ReactNode\n /** Whether Android's back gesture and Escape on web leave it open. */\n readonly isKeyboardDismissDisabled: boolean\n /** The headline's id, which names the window on web. */\n readonly labelledBy: string | undefined\n /** What the back gesture and Escape call. */\n readonly onClose: () => void\n /** What a press on the scrim calls, or nothing where it closes nothing. */\n readonly onScrimPress: (() => void) | undefined\n /** The scrim's motion. */\n readonly scrim: AnimatedStyle<ViewStyle>\n /** The headline, which a screen reader is sent to once the window shows. */\n readonly title: HostInstance | null\n}\n\n// Sends the screen reader to the headline once the window has shown. React\n// Native Web's `Modal` moves focus into itself.\nfunction focusOf(title: HostInstance | null) {\n return () => {\n if (title !== null && Platform.OS !== 'web') {\n AccessibilityInfo.sendAccessibilityEvent(title, 'focus')\n }\n }\n}\n\n// What the back gesture does on a surface it may not close: nothing, rather\n// than leaving the handler out, which Android warns about.\nfunction ignore() {}\n\n// The safe area as padding. The insets are physical edges, and React Native\n// swaps a left and a right style under a right-to-left layout, so they are\n// handed over as the start and end they are in the direction the layout runs.\nfunction insetsOf(insets: EdgeInsets): ViewStyle {\n const rtl = I18nManager.isRTL\n\n return {\n paddingBottom: insets.bottom,\n paddingEnd: rtl ? insets.left : insets.right,\n paddingStart: rtl ? insets.right : insets.left,\n paddingTop: insets.top,\n }\n}\n\n/**\n * The window a modal surface is drawn in: the `Modal`, the overlays it hosts,\n * and the scrim, with the surface itself as its children.\n */\nfunction ModalWindow({\n children,\n isKeyboardDismissDisabled,\n labelledBy,\n onClose,\n onScrimPress,\n scrim,\n title,\n}: ModalWindowProps) {\n const styles = stylesOf(useTheme())\n\n return (\n <Modal\n animationType=\"none\"\n aria-labelledby={Platform.OS === 'web' ? labelledBy : undefined}\n navigationBarTranslucent\n onRequestClose={isKeyboardDismissDisabled ? ignore : onClose}\n onShow={focusOf(title)}\n statusBarTranslucent\n supportedOrientations={ORIENTATIONS}\n transparent\n visible\n >\n {/* Nothing in the window takes the trigger's slot, the overlays it\n hosts included, so a button in a snackbar raised from the surface\n opens nothing; only the surface's buttons take the close slot. */}\n <ButtonSlotContext value={null}>\n <OverlayHost>\n {/* A screen reader and a keyboard skip the scrim: the first closes\n the surface with the back or escape gesture, the second with\n Escape. React Native Web's Pressable is a tab stop unless told\n otherwise, whatever `focusable` says. */}\n <AnimatedPressable\n accessible={false}\n aria-hidden\n focusable={false}\n onPress={onScrimPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(styles.scrim, scrim)}\n tabIndex={-1}\n />\n {children}\n </OverlayHost>\n </ButtonSlotContext>\n </Modal>\n )\n}\n\n// The surface's role and name on iOS and Android. On web React Native Web's\n// `Modal` is the dialog element, so the surface takes neither there.\nfunction panelRoleOf(\n role: 'alertdialog' | 'dialog',\n labelledBy: string | undefined,\n): Pick<ViewProps, 'aria-labelledby' | 'aria-modal' | 'role'> {\n if (Platform.OS === 'web') {\n return {}\n }\n\n return { 'aria-labelledby': labelledBy, 'aria-modal': true, role }\n}\n\n// Every ref a node is handed to, the part's own and the call site's.\nfunction refsOf<T>(own: (node: null | T) => void, other: Ref<T> | undefined) {\n return (node: null | T) => {\n own(node)\n if (typeof other === 'function') {\n other(node)\n } else if (other !== null && other !== undefined) {\n other.current = node\n }\n }\n}\n\n// Counts each part as it mounts and unmounts, so the parts around it know\n// which of them are there.\nfunction registerOf<Part extends string>(\n setParts: (\n update: (\n parts: Readonly<Record<Part, number>>,\n ) => Readonly<Record<Part, number>>,\n ) => void,\n) {\n return (part: Part) => {\n setParts((parts) => ({ ...parts, [part]: parts[part] + 1 }))\n\n return () => {\n setParts((parts) => ({ ...parts, [part]: parts[part] - 1 }))\n }\n }\n}\n\n/**\n * The open state a surface's content part reads: its trigger's, inside one,\n * and its own otherwise. `present` stays true from the moment it opens until\n * the call site's exit has run and set it false, and the close slot and the\n * scrim close it through `close`.\n */\nfunction useModalState(outer: ModalTrigger | null, props: ModalOpenProps) {\n const own = useOverlayTriggerState(props)\n const state = outer?.state ?? own\n const [present, setPresent] = useState(state.isOpen)\n const close = useCallback(() => {\n state.close()\n }, [state])\n const slots = useMemo<ButtonSlots>(() => ({ close }), [close])\n\n // Mounted the moment it opens, and kept until its exit has run.\n if (state.isOpen && !present) {\n setPresent(true)\n }\n\n useReturnFocus(present, outer)\n\n return { close, present, setPresent, slots, state }\n}\n\n/**\n * The open state a surface's trigger part holds, and the default slot a\n * button inside it fills: it records itself as the button focus returns to,\n * and opens the surface. React Native types the target as a bare view tag\n * too, which focus cannot be sent to, so such a press records nothing.\n */\nfunction useModalTrigger(props: ModalOpenProps) {\n const state = useOverlayTriggerState(props)\n const [trigger, setTrigger] = useState<HostInstance | null>(null)\n const context = useMemo<ModalTrigger>(\n () => ({ state, trigger }),\n [state, trigger],\n )\n const slots = useMemo<ButtonSlots>(\n () => ({\n default: (event: GestureResponderEvent) => {\n const target = event.currentTarget\n\n setTrigger(typeof target === 'number' ? null : target)\n state.open()\n },\n }),\n [state],\n )\n\n return { context, slots }\n}\n\n// Sends the screen reader back to the button that opened the surface once it\n// has gone. React Native Web's `Modal` restores focus itself.\nfunction useReturnFocus(present: boolean, outer: ModalTrigger | null) {\n const shown = useRef(present)\n\n useEffect(() => {\n const trigger = outer?.trigger ?? null\n const gone = shown.current && !present\n\n shown.current = present\n if (gone && trigger !== null && Platform.OS !== 'web') {\n AccessibilityInfo.sendAccessibilityEvent(trigger, 'focus')\n }\n }, [outer, present])\n}\n\nexport {\n insetsOf,\n ModalWindow,\n NO_INSETS,\n panelRoleOf,\n refsOf,\n registerOf,\n useModalState,\n useModalTrigger,\n}\nexport type { ModalOpenProps, ModalTrigger }\n"],"mappings":";;;;;;;;;;;;AA6CA,MAAM8B,YAAwB;CAAEC,QAAQ;CAAGC,MAAM;CAAGC,OAAO;CAAGC,KAAK;AAAE;AAIrE,MAAMC,eAAoD;CACxD;CACA;CACA;CACA;CACA;AAAiB;AAKnB,MAAMC,gBAAgB;AAEtB,MAAMC,WAAWR,cAAc,EAAES,aAC/BnB,WAAWoB,OAAO,EAChBC,OAAO;CACLC,iBAAiBf,YAAYY,OAAOE,OAAOJ,aAAa;CACxDL,QAAQ;CACRC,MAAM;CACNU,UAAU;CACVT,OAAO;CACPC,KAAK;AACP,EACF,CAAC,CACH;AAoCA,SAASuB,QAAQD,OAA4B;CAC3C,aAAa;EACX,IAAIA,UAAU,QAAQtC,SAASwC,OAAO,OACpC3C,kBAAkB4C,uBAAuBH,OAAO,OAAO;CAE3D;AACF;AAIA,SAASI,SAAS,CAAC;AAKnB,SAASC,SAASC,QAA+B;CAC/C,MAAMC,MAAM/C,YAAYgD;CAExB,OAAO;EACLC,eAAeH,OAAO/B;EACtBmC,YAAYH,MAAMD,OAAO9B,OAAO8B,OAAO7B;EACvCkC,cAAcJ,MAAMD,OAAO7B,QAAQ6B,OAAO9B;EAC1CoC,YAAYN,OAAO5B;CACrB;AACF;;;;;AAMA,SAAAmC,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAqB,MAAA,EAAArB,UAAAC,2BAAAC,YAAAC,SAAAC,cAAAf,OAAAgB,UAAAc;CASnB,MAAAG,SAAepC,SAASV,SAAS,CAAC;CAG/B,MAAA+C,KAAAzD;CACe,MAAA0D,KAAA;CACG,MAAAC,KAAA1D,SAAQwC,OAAQ,QAAhBL,aAAAwB,KAAAA;CACjB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AAA4C;EAAA5C,EAAA,KAAA8C;EAAA9C,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CARnB5D,UAAU2D,IAQPK,EAAgB;AAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanso-labs/react-native-kanso-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Kanso UI's Material Design components for React Native, themed through the same --kui-* design tokens as the web library",
5
5
  "keywords": [
6
6
  "react-native",
@@ -61,8 +61,8 @@
61
61
  "@commitlint/config-conventional": "21.2.3",
62
62
  "@eslint/js": "10.0.1",
63
63
  "@jest/globals": "29.7.0",
64
- "@kanso-labs/kanso-ui": "0.43.3",
65
- "@kanso-labs/unplugin-style-dictionary": "0.10.30",
64
+ "@kanso-labs/kanso-ui": "0.43.4",
65
+ "@kanso-labs/unplugin-style-dictionary": "0.10.32",
66
66
  "@react-native/babel-preset": "0.88.0",
67
67
  "@react-native/jest-preset": "0.88.0",
68
68
  "@rolldown/plugin-babel": "0.2.4",
@@ -74,9 +74,9 @@
74
74
  "@testing-library/react-native": "14.1.0",
75
75
  "@types/node": "26.6.5",
76
76
  "@types/react": "19.3.0",
77
- "@vitest/browser-playwright": "5.0.4",
77
+ "@vitest/browser-playwright": "5.0.5",
78
78
  "babel-plugin-react-compiler": "1.0.0",
79
- "eslint": "10.12.0",
79
+ "eslint": "10.13.0",
80
80
  "eslint-plugin-oxlint": "1.88.0",
81
81
  "eslint-plugin-perfectionist": "5.12.1",
82
82
  "eslint-plugin-react-hooks": "7.1.1",
@@ -92,21 +92,21 @@
92
92
  "publint": "0.3.25",
93
93
  "react": "19.3.1",
94
94
  "react-dom": "19.3.1",
95
- "react-native": "0.87.1",
96
- "react-native-gesture-handler": "2.33.0",
95
+ "react-native": "0.88.0",
96
+ "react-native-gesture-handler": "3.4.0",
97
97
  "react-native-reanimated": "4.7.1",
98
98
  "react-native-safe-area-context": "5.10.1",
99
- "react-native-svg": "15.15.5",
99
+ "react-native-svg": "15.16.0",
100
100
  "react-native-web": "0.21.4",
101
101
  "react-native-worklets": "0.13.0",
102
102
  "storybook": "10.6.2",
103
- "style-dictionary": "5.6.1",
103
+ "style-dictionary": "5.7.0",
104
104
  "test-renderer": "1.3.1",
105
105
  "tsdown": "0.23.1",
106
106
  "typescript": "6.0.3",
107
107
  "typescript-eslint": "8.71.2",
108
108
  "vite": "8.3.4",
109
- "vitest": "5.0.4"
109
+ "vitest": "5.0.5"
110
110
  },
111
111
  "peerDependencies": {
112
112
  "expo-clipboard": ">=57.0.0",