@gryt/ui-native 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +147 -105
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.js +7 -4
- package/dist/motion/motion.d.ts +1 -0
- package/dist/motion/motion.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAYtB,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG/E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAgBrD,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,eAAe,+BAKxD;AAED,iBAAS,OAAO,CAAC,EACf,QAAQ,EACR,KAAK,EACN,EAAE;IACD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,+BAWA;AAED,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAErD;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAgBD,iBAAS,KAAK,CAAC,EACb,QAAQ,EACR,IAAa,EACb,IAAU,EACV,WAAkB,EAClB,KAAK,EACN,EAAE,gBAAgB,+BA0UlB;AAED,iBAAS,KAAK,CAAC,EACb,QAAQ,EACR,KAAK,EACN,EAAE;IACD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,+BAWA;AAED,eAAO,MAAM,MAAM;;;;;;CAA0C,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useEffect,
|
|
3
|
-
import { Dimensions,
|
|
2
|
+
import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { Dimensions, Modal, Pressable } from "react-native";
|
|
4
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
4
5
|
import Animated, { runOnJS, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
5
6
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
7
|
import { useReducedMotion } from "../../hooks/useReducedMotion.js";
|
|
@@ -79,7 +80,11 @@ function Popup({ children, side = "left", size = 0.8, dismissible = true, style
|
|
|
79
80
|
const panelExtent = extent + bleed;
|
|
80
81
|
// Measured against the bleed panel, so the panel's *visible* edge lands
|
|
81
82
|
// exactly off-screen rather than the overhang doing it.
|
|
82
|
-
const hidden = side === "right"
|
|
83
|
+
const hidden = side === "right"
|
|
84
|
+
? panelExtent
|
|
85
|
+
: side === "left"
|
|
86
|
+
? -panelExtent
|
|
87
|
+
: panelExtent;
|
|
83
88
|
/**
|
|
84
89
|
* 700ms on the *tight* curve, and this changed on both platforms at once.
|
|
85
90
|
*
|
|
@@ -150,17 +155,27 @@ function Popup({ children, side = "left", size = 0.8, dismissible = true, style
|
|
|
150
155
|
};
|
|
151
156
|
});
|
|
152
157
|
/**
|
|
153
|
-
* The scrim fades with the panel, and thins as it is dragged away.
|
|
158
|
+
* The scrim fades with the panel, and thins further as it is dragged away.
|
|
154
159
|
*
|
|
155
|
-
*
|
|
156
|
-
* so a drawer animating out sat under a full-strength scrim for the whole
|
|
157
|
-
* 700ms and then the scrim blinked off. The web has animated this from the
|
|
158
|
-
* start — `transition-opacity` on the same duration and curve — and it also
|
|
159
|
-
* tracks the swipe, with a comment saying not to "leave a full-strength
|
|
160
|
-
* scrim over a half-gone sheet".
|
|
160
|
+
* Two separate rules, both the web's:
|
|
161
161
|
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
162
|
+
* ```
|
|
163
|
+
* "[opacity:calc(1-var(--drawer-swipe-progress,0))]",
|
|
164
|
+
* "transition-opacity duration-(--gryt-dur-spring-soft) ease-spring-tight",
|
|
165
|
+
* "data-starting-style:opacity-0 data-ending-style:opacity-0",
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* The first is the drag term. The other two are the fade: the backdrop
|
|
169
|
+
* starts and ends at zero, over the same duration and easing as the panel's
|
|
170
|
+
* slide. `progress` already runs on `travel`, which is `easeSpringTight` at
|
|
171
|
+
* `springSoft` — so multiplying by it is the same curve, not a new one.
|
|
172
|
+
*
|
|
173
|
+
* GRYT-408 took the fade out, on the grounds that "the web's Popup declares
|
|
174
|
+
* `transition-transform` and nothing else". That is true, and it is about
|
|
175
|
+
* `Drawer.Popup` — the panel, which still only translates. The backdrop is a
|
|
176
|
+
* different element and says the opposite. Without the fade the scrim was at
|
|
177
|
+
* full strength before the panel was on screen and stayed there while it slid
|
|
178
|
+
* away, then blinked off with the Modal.
|
|
164
179
|
*/
|
|
165
180
|
const scrimStyle = useAnimatedStyle(() => {
|
|
166
181
|
const dragged = extent > 0 ? Math.min(1, Math.abs(drag.value) / extent) : 0;
|
|
@@ -171,114 +186,141 @@ function Popup({ children, side = "left", size = 0.8, dismissible = true, style
|
|
|
171
186
|
* and this did not have at all (GRYT-395). A drawer you cannot push back is
|
|
172
187
|
* the thing a drawer is for.
|
|
173
188
|
*
|
|
174
|
-
* `
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
189
|
+
* `react-native-gesture-handler` rather than `PanResponder`. That was the
|
|
190
|
+
* other way round because gesture callbacks from this package's prebuilt
|
|
191
|
+
* output were measured doing nothing (GRYT-393) — the babel plugin was not
|
|
192
|
+
* reaching `node_modules`, so nothing became a worklet. Measured again on
|
|
193
|
+
* 2026-08-21 with a probe built inside this package: both worklet and
|
|
194
|
+
* `runOnJS` callbacks report correctly. Whatever it was, it is fixed, and
|
|
195
|
+
* `PanResponder` was only ever the fallback.
|
|
196
|
+
*
|
|
197
|
+
* The reason to move is what the axis constraints below buy. `PanResponder`
|
|
198
|
+
* cannot negotiate with a native scroll recogniser, so the old version kept
|
|
199
|
+
* the drag with `onPanResponderTerminationRequest: () => false` — which
|
|
200
|
+
* works by never handing the gesture back, and stops a `ScrollView` inside
|
|
201
|
+
* the drawer scrolling at all. Here the pan simply fails on a cross-axis
|
|
202
|
+
* drag and the scrollable gets it, which is the same rule the web relies on
|
|
203
|
+
* the browser for.
|
|
204
|
+
*
|
|
205
|
+
* The callbacks stay worklets. Running them on the JS thread would be
|
|
206
|
+
* simpler and would give up the whole point: the panel tracks the finger on
|
|
207
|
+
* the UI thread, with nothing to be blocked by a busy bridge.
|
|
178
208
|
*/
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
gesture
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
},
|
|
199
|
-
// Once it is ours it stays ours, for the same reason the Slider needs
|
|
200
|
-
// this: the default is to grant, and a ScrollView inside the drawer
|
|
201
|
-
// would take the drag back mid-swipe.
|
|
202
|
-
onPanResponderTerminationRequest: () => false,
|
|
203
|
-
onPanResponderMove: (_e, g) => {
|
|
204
|
-
const { vertical: v, side: sd } = gesture.current;
|
|
205
|
-
const raw = v ? g.dy : g.dx;
|
|
209
|
+
const pan = useMemo(() => {
|
|
210
|
+
const closingSign = side === "left" ? -1 : 1;
|
|
211
|
+
const gesture = Gesture.Pan().enabled(dismissible);
|
|
212
|
+
/* Claim only a drag heading the way the panel closes, and only once it is
|
|
213
|
+
* clearly a drag rather than a slow press — 8pt, the same threshold the
|
|
214
|
+
* old responder used. `failOffset` on the other axis is the half that
|
|
215
|
+
* `PanResponder` had no answer for: a finger moving across the panel is
|
|
216
|
+
* somebody scrolling its contents, and this hands that over rather than
|
|
217
|
+
* swallowing it. */
|
|
218
|
+
if (vertical) {
|
|
219
|
+
gesture.activeOffsetY(8).failOffsetX([-12, 12]);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
gesture.activeOffsetX(closingSign * 8).failOffsetY([-12, 12]);
|
|
223
|
+
}
|
|
224
|
+
return gesture
|
|
225
|
+
.onUpdate((event) => {
|
|
226
|
+
"worklet";
|
|
227
|
+
const raw = vertical ? event.translationY : event.translationX;
|
|
206
228
|
// Clamped to the closing direction. Dragging a left drawer rightwards
|
|
207
229
|
// should do nothing, not tear it off its edge.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
230
|
+
drag.value = closingSign < 0 ? Math.min(0, raw) : Math.max(0, raw);
|
|
231
|
+
})
|
|
232
|
+
.onEnd((event) => {
|
|
233
|
+
"worklet";
|
|
234
|
+
const moved = Math.abs(vertical ? event.translationY : event.translationX);
|
|
235
|
+
const speed = Math.abs(vertical ? event.velocityY : event.velocityX);
|
|
236
|
+
/* Half the panel, or a flick. The velocity term is what makes a short
|
|
237
|
+
* sharp swipe work — without it you have to drag the whole way, which
|
|
238
|
+
* is the difference between a drawer and a slow puzzle.
|
|
239
|
+
*
|
|
240
|
+
* Gesture-handler reports velocity in points per second where
|
|
241
|
+
* `PanResponder` reported points per millisecond, so the old `0.5`
|
|
242
|
+
* became 500. Same gesture, different unit — worth stating, because
|
|
243
|
+
* carrying the number across unchanged would have made a flick need to
|
|
244
|
+
* be a thousand times faster and looked like the velocity term simply
|
|
245
|
+
* not working.
|
|
246
|
+
*/
|
|
247
|
+
if (moved > extent / 2 || speed > 500) {
|
|
248
|
+
// Left where it is: the close animation runs from here, and snapping
|
|
249
|
+
// it back first would show the panel returning before it left.
|
|
250
|
+
runOnJS(setOpen)(false);
|
|
224
251
|
return;
|
|
225
252
|
}
|
|
226
|
-
// eslint-disable-next-line react-hooks/immutability
|
|
227
253
|
drag.value = travelTo(0, { duration: durations.springSoft });
|
|
228
|
-
}
|
|
229
|
-
|
|
254
|
+
})
|
|
255
|
+
.onFinalize((_event, success) => {
|
|
256
|
+
"worklet";
|
|
257
|
+
// A gesture cancelled by the system — an incoming call, a parent
|
|
258
|
+
// taking over — leaves the panel wherever the finger was.
|
|
259
|
+
if (!success)
|
|
260
|
+
drag.value = travelTo(0, { duration: durations.springSoft });
|
|
261
|
+
});
|
|
262
|
+
}, [dismissible, drag, extent, setOpen, side, vertical]);
|
|
263
|
+
/**
|
|
264
|
+
* Any leftover drag goes back as the panel opens, and is cleared once it is
|
|
265
|
+
* gone.
|
|
266
|
+
*
|
|
267
|
+
* Two moments, deliberately. Clearing on `open` going false was wrong: that
|
|
268
|
+
* happens the instant a swipe dismisses, so the panel jumped back to fully
|
|
269
|
+
* open and then slid out — exactly what the release handler above says must
|
|
270
|
+
* not happen (GRYT-429). `mounted` is the moment the panel is actually off
|
|
271
|
+
* screen, where a hard reset costs nothing to look at.
|
|
272
|
+
*/
|
|
273
|
+
useEffect(() => {
|
|
274
|
+
if (open) {
|
|
230
275
|
// eslint-disable-next-line react-hooks/immutability
|
|
231
276
|
drag.value = travelTo(0, { duration: durations.springSoft });
|
|
232
277
|
}
|
|
233
|
-
})
|
|
234
|
-
/* eslint-enable react-hooks/refs */
|
|
235
|
-
// Cleared once the panel is closed, so the next open does not start from
|
|
236
|
-
// wherever the last swipe left it.
|
|
278
|
+
}, [open, drag]);
|
|
237
279
|
useEffect(() => {
|
|
238
|
-
if (!
|
|
280
|
+
if (!mounted) {
|
|
239
281
|
// eslint-disable-next-line react-hooks/immutability
|
|
240
282
|
drag.value = 0;
|
|
241
283
|
}
|
|
242
|
-
}, [
|
|
243
|
-
return (_jsx(Modal, { visible: mounted, transparent: true, animationType: "none", onRequestClose: dismissible ? () => setOpen(false) : undefined, children: _jsx(AnimatedPressable, { onPress: dismissible ? () => setOpen(false) : undefined, style: [{ flex: 1, backgroundColor: "rgba(0,0,0,0.6)" }, scrimStyle], children: _jsx(Animated.View, { accessibilityViewIsModal: true,
|
|
244
|
-
{
|
|
245
|
-
position: "absolute",
|
|
246
|
-
// The overhang hangs *off* the edge the panel comes from, which
|
|
247
|
-
// is the only direction that helps. It used to be added to the
|
|
248
|
-
// width instead, so the panel grew inwards — 64pt more of the
|
|
249
|
-
// screen covered, and the seam it was meant to hide still there,
|
|
250
|
-
// because the gap opens on the entering edge and that is the edge
|
|
251
|
-
// the extra material was not on.
|
|
252
|
-
top: side === "bottom" ? undefined : 0,
|
|
253
|
-
bottom: vertical ? -bleed : 0,
|
|
254
|
-
left: side === "right" ? undefined : side === "left" ? -bleed : 0,
|
|
255
|
-
right: side === "left" ? undefined : side === "right" ? -bleed : 0,
|
|
256
|
-
width: vertical ? "100%" : panelExtent,
|
|
257
|
-
height: vertical ? panelExtent : "100%",
|
|
258
|
-
// Puts the content back where it would have been without the
|
|
259
|
-
// overhang, so `size` still means what it says.
|
|
260
|
-
paddingLeft: side === "left" ? bleed : 0,
|
|
261
|
-
paddingRight: side === "right" ? bleed : 0,
|
|
262
|
-
paddingBottom: vertical ? bleed : 0,
|
|
263
|
-
backgroundColor: theme.color.surface,
|
|
264
|
-
borderColor: theme.color.border,
|
|
265
|
-
borderRightWidth: side === "left" ? 1 : 0,
|
|
266
|
-
borderLeftWidth: side === "right" ? 1 : 0,
|
|
267
|
-
borderTopWidth: vertical ? 1 : 0,
|
|
268
|
-
borderTopLeftRadius: vertical ? theme.radius.lg : 0,
|
|
269
|
-
borderTopRightRadius: vertical ? theme.radius.lg : 0
|
|
270
|
-
},
|
|
271
|
-
panelStyle
|
|
272
|
-
], children: _jsx(Pressable, { onPress: () => { }, style: [
|
|
284
|
+
}, [mounted, drag]);
|
|
285
|
+
return (_jsx(Modal, { visible: mounted, transparent: true, animationType: "none", onRequestClose: dismissible ? () => setOpen(false) : undefined, children: _jsx(AnimatedPressable, { onPress: dismissible ? () => setOpen(false) : undefined, style: [{ flex: 1, backgroundColor: "rgba(0,0,0,0.6)" }, scrimStyle], children: _jsx(GestureDetector, { gesture: pan, children: _jsx(Animated.View, { accessibilityViewIsModal: true, style: [
|
|
273
286
|
{
|
|
274
|
-
|
|
275
|
-
//
|
|
276
|
-
//
|
|
277
|
-
|
|
278
|
-
|
|
287
|
+
position: "absolute",
|
|
288
|
+
// The overhang hangs *off* the edge the panel comes from, which
|
|
289
|
+
// is the only direction that helps. It used to be added to the
|
|
290
|
+
// width instead, so the panel grew inwards — 64pt more of the
|
|
291
|
+
// screen covered, and the seam it was meant to hide still there,
|
|
292
|
+
// because the gap opens on the entering edge and that is the edge
|
|
293
|
+
// the extra material was not on.
|
|
294
|
+
top: side === "bottom" ? undefined : 0,
|
|
295
|
+
bottom: vertical ? -bleed : 0,
|
|
296
|
+
left: side === "right" ? undefined : side === "left" ? -bleed : 0,
|
|
297
|
+
right: side === "left" ? undefined : side === "right" ? -bleed : 0,
|
|
298
|
+
width: vertical ? "100%" : panelExtent,
|
|
299
|
+
height: vertical ? panelExtent : "100%",
|
|
300
|
+
// Puts the content back where it would have been without the
|
|
301
|
+
// overhang, so `size` still means what it says.
|
|
302
|
+
paddingLeft: side === "left" ? bleed : 0,
|
|
303
|
+
paddingRight: side === "right" ? bleed : 0,
|
|
304
|
+
paddingBottom: vertical ? bleed : 0,
|
|
305
|
+
backgroundColor: theme.color.surface,
|
|
306
|
+
borderColor: theme.color.border,
|
|
307
|
+
borderRightWidth: side === "left" ? 1 : 0,
|
|
308
|
+
borderLeftWidth: side === "right" ? 1 : 0,
|
|
309
|
+
borderTopWidth: vertical ? 1 : 0,
|
|
310
|
+
borderTopLeftRadius: vertical ? theme.radius.lg : 0,
|
|
311
|
+
borderTopRightRadius: vertical ? theme.radius.lg : 0
|
|
279
312
|
},
|
|
280
|
-
|
|
281
|
-
], children:
|
|
313
|
+
panelStyle
|
|
314
|
+
], children: _jsx(Pressable, { onPress: () => { }, style: [
|
|
315
|
+
{
|
|
316
|
+
flex: 1,
|
|
317
|
+
// Before the caller's style, so a drawer that wants to run
|
|
318
|
+
// under the island — a full-bleed image, say — still can.
|
|
319
|
+
paddingTop: vertical ? 0 : insets.top,
|
|
320
|
+
paddingBottom: insets.bottom
|
|
321
|
+
},
|
|
322
|
+
style
|
|
323
|
+
], children: children }) }) }) }) }));
|
|
282
324
|
}
|
|
283
325
|
function Close({ children, style }) {
|
|
284
326
|
const { setOpen } = useDrawer("Close");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAyB,KAAK,SAAS,EAAE,KAAK,SAA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AS,CAAC,CAAC;CAC9B;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,+BAiBlD;AAED,eAAO,MAAM,KAAK;;;;;CAA0D,CAAC"}
|
|
@@ -141,12 +141,15 @@ function Content({ children, style }) {
|
|
|
141
141
|
* engine would be approximating an exact curve with the thing it was chosen
|
|
142
142
|
* over.
|
|
143
143
|
*
|
|
144
|
-
* `
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* `springSlow` — 900ms — rather than the 700 a Drawer uses, because a sheet
|
|
145
|
+
* travels further than a drawer does. A drawer crosses its own width, which
|
|
146
|
+
* is most of the screen only on a phone; a sheet at 82% comes up from off the
|
|
147
|
+
* bottom edge and covers nearly all of it. The same duration over a longer
|
|
148
|
+
* distance is a faster animation, and at 700 this arrived quickly enough to
|
|
149
|
+
* read as a snap rather than a slide.
|
|
147
150
|
*/
|
|
148
151
|
const animationConfigs = useBottomSheetTimingConfigs({
|
|
149
|
-
duration: durations.
|
|
152
|
+
duration: durations.springSlow,
|
|
150
153
|
easing: easeSpring,
|
|
151
154
|
});
|
|
152
155
|
const renderBackdrop = useCallback((props) => (_jsx(BottomSheetBackdrop, { ...props, appearsOnIndex: 0, disappearsOnIndex: -1,
|
package/dist/motion/motion.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/motion/motion.ts"],"names":[],"mappings":"AAYA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEpF;;;;;;;GAOG;AACH,KAAK,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;AAEvC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/motion/motion.ts"],"names":[],"mappings":"AAYA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEpF;;;;;;;GAOG;AACH,KAAK,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;AAEvC,eAAO,MAAM,SAAS;;;;;;CAAgB,CAAC;AAEvC,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,OAAO,UAO/E;AAED,sFAAsF;AACtF,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,OAAO,UAO9E;AAED,gEAAgE;AAChE,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,OAAO,UAO5E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gryt/ui-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Gryt's design system on React Native. Same tokens as @gryt/ui, a different renderer.",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-native-safe-area-context": ">=5.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@gryt/theme": "^0.
|
|
42
|
+
"@gryt/theme": "^0.5.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@gorhom/bottom-sheet": "^5.2.14",
|