panelui-native 0.5.3 → 0.7.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.
- package/README.md +9 -5
- package/lib/module/components/accordion/index.js +7 -5
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/alert/index.js +3 -6
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js +67 -3
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/button/index.js +36 -1
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +4 -5
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/inline-select/index.js +171 -46
- package/lib/module/components/inline-select/index.js.map +1 -1
- package/lib/module/components/input/index.js +28 -5
- package/lib/module/components/input/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +0 -1
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js +359 -0
- package/lib/module/components/item/index.js.map +1 -0
- package/lib/module/components/label/index.js +5 -3
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/message/index.js +318 -0
- package/lib/module/components/message/index.js.map +1 -0
- package/lib/module/components/scroll-fade/index.js +204 -0
- package/lib/module/components/scroll-fade/index.js.map +1 -0
- package/lib/module/components/select/index.js +35 -6
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/shimmer/index.js +167 -0
- package/lib/module/components/shimmer/index.js.map +1 -0
- package/lib/module/components/surface/index.js +65 -0
- package/lib/module/components/surface/index.js.map +1 -0
- package/lib/module/components/switch/index.js +20 -1
- package/lib/module/components/switch/index.js.map +1 -1
- package/lib/module/components/toast/index.js +7 -8
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/typography/index.js +3 -3
- package/lib/module/hooks/index.js +10 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/use-breakpoint.js +39 -0
- package/lib/module/hooks/use-breakpoint.js.map +1 -0
- package/lib/module/hooks/use-copy-to-clipboard.js +60 -0
- package/lib/module/hooks/use-copy-to-clipboard.js.map +1 -0
- package/lib/module/hooks/use-debounced-value.js +24 -0
- package/lib/module/hooks/use-debounced-value.js.map +1 -0
- package/lib/module/hooks/use-disclosure.js +43 -0
- package/lib/module/hooks/use-disclosure.js.map +1 -0
- package/lib/module/hooks/use-keyboard-avoidance.js +120 -0
- package/lib/module/hooks/use-keyboard-avoidance.js.map +1 -0
- package/lib/module/hooks/use-keyboard.js +36 -0
- package/lib/module/hooks/use-keyboard.js.map +1 -0
- package/lib/module/hooks/use-previous.js +25 -0
- package/lib/module/hooks/use-previous.js.map +1 -0
- package/lib/module/icons/index.js +4 -4
- package/lib/module/index.js +12 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/index.js +53 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/primitives/keyboard-avoider.js +40 -0
- package/lib/module/primitives/keyboard-avoider.js.map +1 -0
- package/lib/module/providers/panel-ui-provider.js +24 -4
- package/lib/module/providers/panel-ui-provider.js.map +1 -1
- package/lib/module/theme/use-theme.js +1 -1
- package/lib/typescript/src/components/accordion/index.d.ts +7 -5
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts +3 -6
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +21 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +11 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts +4 -5
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/inline-select/index.d.ts +29 -6
- package/lib/typescript/src/components/inline-select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input/index.d.ts +13 -0
- package/lib/typescript/src/components/input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts +0 -1
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts +286 -0
- package/lib/typescript/src/components/item/index.d.ts.map +1 -0
- package/lib/typescript/src/components/label/index.d.ts +5 -3
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message/index.d.ts +170 -0
- package/lib/typescript/src/components/message/index.d.ts.map +1 -0
- package/lib/typescript/src/components/scroll-fade/index.d.ts +47 -0
- package/lib/typescript/src/components/scroll-fade/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts +16 -1
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/shimmer/index.d.ts +60 -0
- package/lib/typescript/src/components/shimmer/index.d.ts.map +1 -0
- package/lib/typescript/src/components/surface/index.d.ts +30 -0
- package/lib/typescript/src/components/surface/index.d.ts.map +1 -0
- package/lib/typescript/src/components/switch/index.d.ts +10 -0
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts +4 -4
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +8 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-breakpoint.d.ts +32 -0
- package/lib/typescript/src/hooks/use-breakpoint.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-copy-to-clipboard.d.ts +28 -0
- package/lib/typescript/src/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-debounced-value.d.ts +13 -0
- package/lib/typescript/src/hooks/use-debounced-value.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-disclosure.d.ts +32 -0
- package/lib/typescript/src/hooks/use-disclosure.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts +20 -0
- package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-keyboard.d.ts +20 -0
- package/lib/typescript/src/hooks/use-keyboard.d.ts.map +1 -0
- package/lib/typescript/src/hooks/use-previous.d.ts +15 -0
- package/lib/typescript/src/hooks/use-previous.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +4 -4
- package/lib/typescript/src/index.d.ts +8 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +35 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts +22 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -0
- package/lib/typescript/src/providers/panel-ui-provider.d.ts +1 -1
- package/lib/typescript/src/providers/panel-ui-provider.d.ts.map +1 -1
- package/lib/typescript/src/theme/use-theme.d.ts +1 -1
- package/package.json +19 -3
- package/src/components/accordion/index.tsx +7 -5
- package/src/components/alert/index.tsx +3 -6
- package/src/components/bottom-sheet/index.tsx +82 -2
- package/src/components/button/index.tsx +52 -0
- package/src/components/empty-state/index.tsx +4 -5
- package/src/components/inline-select/index.tsx +191 -44
- package/src/components/input/index.tsx +39 -3
- package/src/components/input-group/index.tsx +0 -1
- package/src/components/item/index.tsx +387 -0
- package/src/components/label/index.tsx +5 -3
- package/src/components/message/index.tsx +312 -0
- package/src/components/scroll-fade/index.tsx +280 -0
- package/src/components/select/index.tsx +54 -9
- package/src/components/shimmer/index.tsx +228 -0
- package/src/components/surface/index.tsx +64 -0
- package/src/components/switch/index.tsx +27 -1
- package/src/components/toast/index.tsx +7 -8
- package/src/components/typography/index.tsx +3 -3
- package/src/hooks/index.ts +24 -0
- package/src/hooks/use-breakpoint.ts +52 -0
- package/src/hooks/use-copy-to-clipboard.ts +79 -0
- package/src/hooks/use-debounced-value.ts +23 -0
- package/src/hooks/use-disclosure.ts +57 -0
- package/src/hooks/use-keyboard-avoidance.ts +140 -0
- package/src/hooks/use-keyboard.ts +43 -0
- package/src/hooks/use-previous.ts +24 -0
- package/src/icons/index.tsx +4 -4
- package/src/index.ts +41 -0
- package/src/native/index.ts +79 -0
- package/src/primitives/keyboard-avoider.tsx +49 -0
- package/src/providers/panel-ui-provider.tsx +30 -9
- package/src/theme/use-theme.ts +1 -1
- package/theme.css +23 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Open/closed state for an overlay.
|
|
6
|
+
*
|
|
7
|
+
* The same controlled-or-uncontrolled pattern Dialog, BottomSheet and Select
|
|
8
|
+
* implement internally, lifted out for when you need to drive one from
|
|
9
|
+
* elsewhere — closing a sheet after a request settles, say.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const sheet = useDisclosure();
|
|
13
|
+
* <Button onPress={sheet.open}>Share</Button>
|
|
14
|
+
* <BottomSheet {...sheet.props}>…</BottomSheet>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export function useDisclosure({
|
|
18
|
+
defaultOpen = false,
|
|
19
|
+
open: controlledOpen,
|
|
20
|
+
onOpenChange
|
|
21
|
+
} = {}) {
|
|
22
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
23
|
+
const isControlled = controlledOpen !== undefined;
|
|
24
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
25
|
+
const setOpen = useCallback(next => {
|
|
26
|
+
if (!isControlled) setUncontrolledOpen(next);
|
|
27
|
+
onOpenChange?.(next);
|
|
28
|
+
}, [isControlled, onOpenChange]);
|
|
29
|
+
const open = useCallback(() => setOpen(true), [setOpen]);
|
|
30
|
+
const close = useCallback(() => setOpen(false), [setOpen]);
|
|
31
|
+
const toggle = useCallback(() => setOpen(!isOpen), [setOpen, isOpen]);
|
|
32
|
+
return useMemo(() => ({
|
|
33
|
+
isOpen,
|
|
34
|
+
open,
|
|
35
|
+
close,
|
|
36
|
+
toggle,
|
|
37
|
+
props: {
|
|
38
|
+
open: isOpen,
|
|
39
|
+
onOpenChange: setOpen
|
|
40
|
+
}
|
|
41
|
+
}), [isOpen, open, close, toggle, setOpen]);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=use-disclosure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useState","useDisclosure","defaultOpen","open","controlledOpen","onOpenChange","uncontrolledOpen","setUncontrolledOpen","isControlled","undefined","isOpen","setOpen","next","close","toggle","props"],"sourceRoot":"../../../src","sources":["hooks/use-disclosure.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAkBtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAC;EAC5BC,WAAW,GAAG,KAAK;EACnBC,IAAI,EAAEC,cAAc;EACpBC;AACoB,CAAC,GAAG,CAAC,CAAC,EAAuB;EACjD,MAAM,CAACC,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGP,QAAQ,CAACE,WAAW,CAAC;EACrE,MAAMM,YAAY,GAAGJ,cAAc,KAAKK,SAAS;EACjD,MAAMC,MAAM,GAAGF,YAAY,GAAGJ,cAAc,GAAGE,gBAAgB;EAE/D,MAAMK,OAAO,GAAGb,WAAW,CACxBc,IAAa,IAAK;IACjB,IAAI,CAACJ,YAAY,EAAED,mBAAmB,CAACK,IAAI,CAAC;IAC5CP,YAAY,GAAGO,IAAI,CAAC;EACtB,CAAC,EACD,CAACJ,YAAY,EAAEH,YAAY,CAC7B,CAAC;EAED,MAAMF,IAAI,GAAGL,WAAW,CAAC,MAAMa,OAAO,CAAC,IAAI,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EACxD,MAAME,KAAK,GAAGf,WAAW,CAAC,MAAMa,OAAO,CAAC,KAAK,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAC1D,MAAMG,MAAM,GAAGhB,WAAW,CAAC,MAAMa,OAAO,CAAC,CAACD,MAAM,CAAC,EAAE,CAACC,OAAO,EAAED,MAAM,CAAC,CAAC;EAErE,OAAOX,OAAO,CACZ,OAAO;IAAEW,MAAM;IAAEP,IAAI;IAAEU,KAAK;IAAEC,MAAM;IAAEC,KAAK,EAAE;MAAEZ,IAAI,EAAEO,MAAM;MAAEL,YAAY,EAAEM;IAAQ;EAAE,CAAC,CAAC,EACvF,CAACD,MAAM,EAAEP,IAAI,EAAEU,KAAK,EAAEC,MAAM,EAAEH,OAAO,CACvC,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useKeyboardAvoidance — lift an element just clear of the software keyboard.
|
|
5
|
+
*
|
|
6
|
+
* `KeyboardAvoidingView` shifts or pads an entire subtree by the full keyboard
|
|
7
|
+
* height regardless of where the element actually sits, which over-scrolls
|
|
8
|
+
* short forms and does nothing useful for an element already above the fold.
|
|
9
|
+
* This measures the element and moves it by exactly the overlap — and not at
|
|
10
|
+
* all when there is none.
|
|
11
|
+
*
|
|
12
|
+
* ## Install the keyboard controller
|
|
13
|
+
*
|
|
14
|
+
* ```sh
|
|
15
|
+
* npx expo install react-native-keyboard-controller
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* It is an optional peer, but on Android it is close to required. Reanimated's
|
|
19
|
+
* own `useAnimatedKeyboard` — the fallback used when the controller is absent —
|
|
20
|
+
* is deprecated in Reanimated 4, and merely *calling* it switches Android out
|
|
21
|
+
* of `adjustResize` into manual inset handling for the whole app. That is a
|
|
22
|
+
* global side effect from a local hook, and it is why keyboard avoidance built
|
|
23
|
+
* on it tends to work on iOS and break on Android.
|
|
24
|
+
*
|
|
25
|
+
* With the controller installed, wrap your app in its `KeyboardProvider` —
|
|
26
|
+
* `PanelUIProvider` does this for you when the package is present.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* const { ref, onLayout, animatedStyle } = useKeyboardAvoidance();
|
|
30
|
+
*
|
|
31
|
+
* <Animated.View ref={ref} onLayout={onLayout} style={animatedStyle}>
|
|
32
|
+
* <TextInput />
|
|
33
|
+
* </Animated.View>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
import { useCallback } from 'react';
|
|
37
|
+
import { useWindowDimensions } from 'react-native';
|
|
38
|
+
import { useAnimatedKeyboard, useAnimatedRef, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
|
|
39
|
+
/**
|
|
40
|
+
* Resolved once, at module load, so the hook below always calls the same
|
|
41
|
+
* underlying hook — swapping between them per render would break the rules of
|
|
42
|
+
* hooks.
|
|
43
|
+
*/
|
|
44
|
+
const useKeyboardHeight = (() => {
|
|
45
|
+
try {
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
47
|
+
const controller = require('react-native-keyboard-controller');
|
|
48
|
+
if (typeof controller?.useReanimatedKeyboardAnimation === 'function') {
|
|
49
|
+
return () => {
|
|
50
|
+
// The controller reports height as a negative offset, matching the
|
|
51
|
+
// translation you would apply. Normalise it to a positive height so
|
|
52
|
+
// the arithmetic below reads the same either way.
|
|
53
|
+
const {
|
|
54
|
+
height
|
|
55
|
+
} = controller.useReanimatedKeyboardAnimation();
|
|
56
|
+
return height;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
// Not installed — fall through.
|
|
61
|
+
}
|
|
62
|
+
return () => useAnimatedKeyboard().height;
|
|
63
|
+
})();
|
|
64
|
+
|
|
65
|
+
/** True when the keyboard controller is driving this, rather than the fallback. */
|
|
66
|
+
export function hasKeyboardController() {
|
|
67
|
+
try {
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
69
|
+
return typeof require('react-native-keyboard-controller')?.useReanimatedKeyboardAnimation === 'function';
|
|
70
|
+
} catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export function useKeyboardAvoidance({
|
|
75
|
+
enabled = true,
|
|
76
|
+
offset = 16
|
|
77
|
+
} = {}) {
|
|
78
|
+
const ref = useAnimatedRef();
|
|
79
|
+
const rawHeight = useKeyboardHeight();
|
|
80
|
+
const {
|
|
81
|
+
height: screenHeight
|
|
82
|
+
} = useWindowDimensions();
|
|
83
|
+
|
|
84
|
+
/** Window-space bottom edge of the element with no translation applied. */
|
|
85
|
+
const restingBottom = useSharedValue(0);
|
|
86
|
+
const measure = useCallback(() => {
|
|
87
|
+
ref.current?.measureInWindow((_x, y, _width, height) => {
|
|
88
|
+
if (height > 0) restingBottom.value = y + height;
|
|
89
|
+
});
|
|
90
|
+
}, [ref, restingBottom]);
|
|
91
|
+
const onLayout = useCallback(_event => {
|
|
92
|
+
// measureInWindow is only meaningful once the view is attached and
|
|
93
|
+
// positioned, which is a frame later than onLayout on both platforms.
|
|
94
|
+
requestAnimationFrame(measure);
|
|
95
|
+
}, [measure]);
|
|
96
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
97
|
+
// Both sources are normalised to a positive height here.
|
|
98
|
+
const keyboardHeight = Math.abs(rawHeight.value);
|
|
99
|
+
if (!enabled || keyboardHeight === 0 || restingBottom.value === 0) {
|
|
100
|
+
return {
|
|
101
|
+
transform: [{
|
|
102
|
+
translateY: 0
|
|
103
|
+
}]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const keyboardTop = screenHeight - keyboardHeight;
|
|
107
|
+
const overlap = restingBottom.value + offset - keyboardTop;
|
|
108
|
+
return {
|
|
109
|
+
transform: [{
|
|
110
|
+
translateY: overlap > 0 ? -overlap : 0
|
|
111
|
+
}]
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
return {
|
|
115
|
+
ref,
|
|
116
|
+
onLayout,
|
|
117
|
+
animatedStyle
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=use-keyboard-avoidance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useWindowDimensions","useAnimatedKeyboard","useAnimatedRef","useAnimatedStyle","useSharedValue","useKeyboardHeight","controller","require","useReanimatedKeyboardAnimation","height","hasKeyboardController","useKeyboardAvoidance","enabled","offset","ref","rawHeight","screenHeight","restingBottom","measure","current","measureInWindow","_x","y","_width","value","onLayout","_event","requestAnimationFrame","animatedStyle","keyboardHeight","Math","abs","transform","translateY","keyboardTop","overlap"],"sourceRoot":"../../../src","sources":["hooks/use-keyboard-avoidance.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,mBAAmB,QAA2C,cAAc;AACrF,SACEC,mBAAmB,EACnBC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QAGT,yBAAyB;AAoBhC;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAqC,GAAG,CAAC,MAAM;EACnD,IAAI;IACF;IACA,MAAMC,UAAU,GAAGC,OAAO,CAAC,kCAAkC,CAAC;IAC9D,IAAI,OAAOD,UAAU,EAAEE,8BAA8B,KAAK,UAAU,EAAE;MACpE,OAAO,MAAM;QACX;QACA;QACA;QACA,MAAM;UAAEC;QAAO,CAAC,GAAGH,UAAU,CAACE,8BAA8B,CAAC,CAAC;QAC9D,OAAOC,MAAM;MACf,CAAC;IACH;EACF,CAAC,CAAC,MAAM;IACN;EAAA;EAGF,OAAO,MAAMR,mBAAmB,CAAC,CAAC,CAACQ,MAAM;AAC3C,CAAC,EAAE,CAAC;;AAEJ;AACA,OAAO,SAASC,qBAAqBA,CAAA,EAAY;EAC/C,IAAI;IACF;IACA,OAAO,OAAOH,OAAO,CAAC,kCAAkC,CAAC,EACrDC,8BAA8B,KAAK,UAAU;EACnD,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF;AAEA,OAAO,SAASG,oBAAoBA,CAAC;EACnCC,OAAO,GAAG,IAAI;EACdC,MAAM,GAAG;AACkB,CAAC,GAAG,CAAC,CAAC,EAA8B;EAC/D,MAAMC,GAAG,GAAGZ,cAAc,CAAO,CAAC;EAClC,MAAMa,SAAS,GAAGV,iBAAiB,CAAC,CAAC;EACrC,MAAM;IAAEI,MAAM,EAAEO;EAAa,CAAC,GAAGhB,mBAAmB,CAAC,CAAC;;EAEtD;EACA,MAAMiB,aAAa,GAAGb,cAAc,CAAC,CAAC,CAAC;EAEvC,MAAMc,OAAO,GAAGnB,WAAW,CAAC,MAAM;IAChCe,GAAG,CAACK,OAAO,EAAEC,eAAe,CAAC,CAACC,EAAE,EAAEC,CAAC,EAAEC,MAAM,EAAEd,MAAM,KAAK;MACtD,IAAIA,MAAM,GAAG,CAAC,EAAEQ,aAAa,CAACO,KAAK,GAAGF,CAAC,GAAGb,MAAM;IAClD,CAAC,CAAC;EACJ,CAAC,EAAE,CAACK,GAAG,EAAEG,aAAa,CAAC,CAAC;EAExB,MAAMQ,QAAQ,GAAG1B,WAAW,CACzB2B,MAAyB,IAAK;IAC7B;IACA;IACAC,qBAAqB,CAACT,OAAO,CAAC;EAChC,CAAC,EACD,CAACA,OAAO,CACV,CAAC;EAED,MAAMU,aAAa,GAAGzB,gBAAgB,CAAC,MAAM;IAC3C;IACA,MAAM0B,cAAc,GAAGC,IAAI,CAACC,GAAG,CAAChB,SAAS,CAACS,KAAK,CAAC;IAEhD,IAAI,CAACZ,OAAO,IAAIiB,cAAc,KAAK,CAAC,IAAIZ,aAAa,CAACO,KAAK,KAAK,CAAC,EAAE;MACjE,OAAO;QAAEQ,SAAS,EAAE,CAAC;UAAEC,UAAU,EAAE;QAAE,CAAC;MAAE,CAAC;IAC3C;IAEA,MAAMC,WAAW,GAAGlB,YAAY,GAAGa,cAAc;IACjD,MAAMM,OAAO,GAAGlB,aAAa,CAACO,KAAK,GAAGX,MAAM,GAAGqB,WAAW;IAE1D,OAAO;MAAEF,SAAS,EAAE,CAAC;QAAEC,UAAU,EAAEE,OAAO,GAAG,CAAC,GAAG,CAACA,OAAO,GAAG;MAAE,CAAC;IAAE,CAAC;EACpE,CAAC,CAAC;EAEF,OAAO;IAAErB,GAAG;IAAEW,QAAQ;IAAEG;EAAc,CAAC;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { Keyboard, Platform } from 'react-native';
|
|
5
|
+
/**
|
|
6
|
+
* Keyboard height and visibility, on the JS thread.
|
|
7
|
+
*
|
|
8
|
+
* Use this when the value drives rendering — showing a hint, swapping a
|
|
9
|
+
* layout. For *animating* against the keyboard, use Reanimated's
|
|
10
|
+
* `useAnimatedKeyboard` instead: it runs on the UI thread and tracks the
|
|
11
|
+
* keyboard frame-for-frame, where this fires once per show/hide.
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { isVisible } = useKeyboard();
|
|
15
|
+
* {isVisible ? null : <Footer />}
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function useKeyboard() {
|
|
19
|
+
const [height, setHeight] = useState(0);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
// iOS reports the frame before it animates; Android only on completion.
|
|
22
|
+
const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
|
|
23
|
+
const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
|
|
24
|
+
const show = Keyboard.addListener(showEvent, event => setHeight(event.endCoordinates.height));
|
|
25
|
+
const hide = Keyboard.addListener(hideEvent, () => setHeight(0));
|
|
26
|
+
return () => {
|
|
27
|
+
show.remove();
|
|
28
|
+
hide.remove();
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
return {
|
|
32
|
+
height,
|
|
33
|
+
isVisible: height > 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=use-keyboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useState","Keyboard","Platform","useKeyboard","height","setHeight","showEvent","OS","hideEvent","show","addListener","event","endCoordinates","hide","remove","isVisible"],"sourceRoot":"../../../src","sources":["hooks/use-keyboard.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAQjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAAsB;EAC/C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGL,QAAQ,CAAC,CAAC,CAAC;EAEvCD,SAAS,CAAC,MAAM;IACd;IACA,MAAMO,SAAS,GAAGJ,QAAQ,CAACK,EAAE,KAAK,KAAK,GAAG,kBAAkB,GAAG,iBAAiB;IAChF,MAAMC,SAAS,GAAGN,QAAQ,CAACK,EAAE,KAAK,KAAK,GAAG,kBAAkB,GAAG,iBAAiB;IAEhF,MAAME,IAAI,GAAGR,QAAQ,CAACS,WAAW,CAACJ,SAAS,EAAGK,KAAK,IACjDN,SAAS,CAACM,KAAK,CAACC,cAAc,CAACR,MAAM,CACvC,CAAC;IACD,MAAMS,IAAI,GAAGZ,QAAQ,CAACS,WAAW,CAACF,SAAS,EAAE,MAAMH,SAAS,CAAC,CAAC,CAAC,CAAC;IAEhE,OAAO,MAAM;MACXI,IAAI,CAACK,MAAM,CAAC,CAAC;MACbD,IAAI,CAACC,MAAM,CAAC,CAAC;IACf,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEV,MAAM;IAAEW,SAAS,EAAEX,MAAM,GAAG;EAAE,CAAC;AAC1C","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The value from the previous render, or `undefined` on the first.
|
|
7
|
+
*
|
|
8
|
+
* Useful for reacting to a transition rather than a state — firing only when
|
|
9
|
+
* something *became* true.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const wasOpen = usePrevious(isOpen);
|
|
13
|
+
* useEffect(() => {
|
|
14
|
+
* if (isOpen && !wasOpen) track('sheet_opened');
|
|
15
|
+
* }, [isOpen, wasOpen]);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function usePrevious(value) {
|
|
19
|
+
const ref = useRef(undefined);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
ref.current = value;
|
|
22
|
+
}, [value]);
|
|
23
|
+
return ref.current;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=use-previous.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","usePrevious","value","ref","undefined","current"],"sourceRoot":"../../../src","sources":["hooks/use-previous.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAIC,KAAQ,EAAiB;EACtD,MAAMC,GAAG,GAAGH,MAAM,CAAgBI,SAAS,CAAC;EAE5CL,SAAS,CAAC,MAAM;IACdI,GAAG,CAACE,OAAO,GAAGH,KAAK;EACrB,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEX,OAAOC,GAAG,CAACE,OAAO;AACpB","ignoreList":[]}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Icon set.
|
|
5
5
|
*
|
|
6
6
|
* Two families live here:
|
|
7
|
-
* - Stroked 24×24 icons
|
|
8
|
-
*
|
|
9
|
-
* - Filled 16×16 status icons for Alert and Toast indicators
|
|
10
|
-
*
|
|
7
|
+
* - Stroked 24×24 icons on Lucide geometry, for chrome such as chevrons and
|
|
8
|
+
* the close button.
|
|
9
|
+
* - Filled 16×16 status icons for Alert and Toast indicators, which read
|
|
10
|
+
* better small than a stroked equivalent would.
|
|
11
11
|
*
|
|
12
12
|
* Every icon resolves its colour in the same order: an explicit `color` prop,
|
|
13
13
|
* then the colour inherited from an enclosing `IconColorProvider`, then its
|
package/lib/module/index.js
CHANGED
|
@@ -9,8 +9,12 @@ export { useTheme, useThemeMode, PANEL_THEMES, PANEL_THEME_NAMES, PANEL_EXTRA_TH
|
|
|
9
9
|
// Primitives
|
|
10
10
|
export { Portal, PortalHost, PortalProvider } from "./primitives/portal.js";
|
|
11
11
|
export { Text } from "./primitives/text.js";
|
|
12
|
+
export { KeyboardAvoider } from "./primitives/keyboard-avoider.js";
|
|
12
13
|
export { AnimatedPressable } from "./primitives/animated-pressable.js";
|
|
13
14
|
|
|
15
|
+
// Native UI bridge
|
|
16
|
+
export { hasNativeUI } from "./native/index.js";
|
|
17
|
+
|
|
14
18
|
// Components
|
|
15
19
|
export { Accordion } from "./components/accordion/index.js";
|
|
16
20
|
export { Alert } from "./components/alert/index.js";
|
|
@@ -28,12 +32,17 @@ export { Checkbox } from "./components/checkbox/index.js";
|
|
|
28
32
|
export { EmptyState } from "./components/empty-state/index.js";
|
|
29
33
|
export { Input } from "./components/input/index.js";
|
|
30
34
|
export { InputGroup } from "./components/input-group/index.js";
|
|
35
|
+
export { Item } from "./components/item/index.js";
|
|
31
36
|
export { Label } from "./components/label/index.js";
|
|
37
|
+
export { Message } from "./components/message/index.js";
|
|
32
38
|
export { Progress } from "./components/progress/index.js";
|
|
33
39
|
export { RadioGroup } from "./components/radio-group/index.js";
|
|
40
|
+
export { ScrollFade } from "./components/scroll-fade/index.js";
|
|
41
|
+
export { Shimmer } from "./components/shimmer/index.js";
|
|
34
42
|
export { Skeleton } from "./components/skeleton/index.js";
|
|
35
43
|
export { Spinner } from "./components/spinner/index.js";
|
|
36
44
|
export { Steps } from "./components/steps/index.js";
|
|
45
|
+
export { Surface } from "./components/surface/index.js";
|
|
37
46
|
export { Switch } from "./components/switch/index.js";
|
|
38
47
|
export { Timeline } from "./components/timeline/index.js";
|
|
39
48
|
export { Toast, ToastViewport, toast, useToast } from "./components/toast/index.js";
|
|
@@ -42,6 +51,9 @@ export { Typography } from "./components/typography/index.js";
|
|
|
42
51
|
// Icons
|
|
43
52
|
export { AlertTriangleIcon, AppleIcon, ArrowUpRightIcon, BellIcon, CardIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, FacebookIcon, GoogleIcon, IconColorProvider, InfoIcon, MoonIcon, PackageIcon, PlusSquareIcon, ReceiptIcon, SearchIcon, SendIcon, ShareNodesIcon, ShieldAlertIcon, ShieldCheckIcon, SunIcon, XIcon, useIconColor } from "./icons/index.js";
|
|
44
53
|
|
|
54
|
+
// Hooks
|
|
55
|
+
export * from "./hooks/index.js";
|
|
56
|
+
|
|
45
57
|
// Utils
|
|
46
58
|
export { cn } from "./utils/cn.js";
|
|
47
59
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PanelUIProvider","useTheme","useThemeMode","PANEL_THEMES","PANEL_THEME_NAMES","PANEL_EXTRA_THEMES","Portal","PortalHost","PortalProvider","Text","AnimatedPressable","Accordion","Alert","Avatar","Badge","BottomSheet","Button","Dialog","Frame","InlineSelect","Select","Tabs","Card","Checkbox","EmptyState","Input","InputGroup","Label","Progress","RadioGroup","Skeleton","Spinner","Steps","Switch","Timeline","Toast","ToastViewport","toast","useToast","Typography","AlertTriangleIcon","AppleIcon","ArrowUpRightIcon","BellIcon","CardIcon","CheckCircleIcon","CheckIcon","ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","FacebookIcon","GoogleIcon","IconColorProvider","InfoIcon","MoonIcon","PackageIcon","PlusSquareIcon","ReceiptIcon","SearchIcon","SendIcon","ShareNodesIcon","ShieldAlertIcon","ShieldCheckIcon","SunIcon","XIcon","useIconColor","cn"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAmC,kCAA+B;;AAE1F;AACA,SACEC,QAAQ,EACRC,YAAY,EACZC,YAAY,EACZC,iBAAiB,EACjBC,kBAAkB,QAKb,sBAAmB;;AAE1B;AACA,SAASC,MAAM,EAAEC,UAAU,EAAEC,cAAc,QAAQ,wBAAqB;AACxE,SAASC,IAAI,QAAwB,sBAAmB;AACxD,SACEC,iBAAiB,QAEZ,oCAAiC;;AAExC;AACA,SACEC,SAAS,QAQJ,iCAAwB;AAC/B,SACEC,KAAK,QAGA,6BAAoB;AAC3B,SACEC,MAAM,QAGD,8BAAqB;AAC5B,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,WAAW,QAGN,oCAA2B;AAClC,SAASC,MAAM,QAA0B,8BAAqB;AAC9D,SACEC,MAAM,QAGD,8BAAqB;AAC5B,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,YAAY,QAGP,qCAA4B;AACnC,SAASC,MAAM,QAAgD,8BAAqB;AACpF,SACEC,IAAI,QAKC,4BAAmB;AAC1B,SAASC,IAAI,QAAwB,4BAAmB;AACxD,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SACEC,UAAU,QAGL,mCAA0B;AACjC,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,UAAU,QAIL,mCAA0B;AACjC,SAASC,KAAK,QAA8C,6BAAoB;AAChF,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SACEC,UAAU,QAGL,mCAA0B;AACjC,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SAASC,OAAO,QAA2B,+BAAsB;AACjE,SACEC,KAAK,QAQA,6BAAoB;AAC3B,SAASC,MAAM,QAA0B,8BAAqB;AAC9D,SACEC,QAAQ,QAOH,gCAAuB;AAC9B,SACEC,KAAK,EACLC,aAAa,EACbC,KAAK,EACLC,QAAQ,QASH,6BAAoB;AAC3B,SACEC,UAAU,QAML,kCAAyB;;AAEhC;AACA,SACEC,iBAAiB,EACjBC,SAAS,EACTC,gBAAgB,EAChBC,QAAQ,EACRC,QAAQ,EACRC,eAAe,EACfC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,EACVC,iBAAiB,EACjBC,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,QAAQ,EACRC,cAAc,EACdC,eAAe,EACfC,eAAe,EACfC,OAAO,EACPC,KAAK,EACLC,YAAY,QAEP,kBAAS;;AAEhB;AACA,SAASC,EAAE,QAAQ,eAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["PanelUIProvider","useTheme","useThemeMode","PANEL_THEMES","PANEL_THEME_NAMES","PANEL_EXTRA_THEMES","Portal","PortalHost","PortalProvider","Text","KeyboardAvoider","AnimatedPressable","hasNativeUI","Accordion","Alert","Avatar","Badge","BottomSheet","Button","Dialog","Frame","InlineSelect","Select","Tabs","Card","Checkbox","EmptyState","Input","InputGroup","Item","Label","Message","Progress","RadioGroup","ScrollFade","Shimmer","Skeleton","Spinner","Steps","Surface","Switch","Timeline","Toast","ToastViewport","toast","useToast","Typography","AlertTriangleIcon","AppleIcon","ArrowUpRightIcon","BellIcon","CardIcon","CheckCircleIcon","CheckIcon","ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","FacebookIcon","GoogleIcon","IconColorProvider","InfoIcon","MoonIcon","PackageIcon","PlusSquareIcon","ReceiptIcon","SearchIcon","SendIcon","ShareNodesIcon","ShieldAlertIcon","ShieldCheckIcon","SunIcon","XIcon","useIconColor","cn"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAmC,kCAA+B;;AAE1F;AACA,SACEC,QAAQ,EACRC,YAAY,EACZC,YAAY,EACZC,iBAAiB,EACjBC,kBAAkB,QAKb,sBAAmB;;AAE1B;AACA,SAASC,MAAM,EAAEC,UAAU,EAAEC,cAAc,QAAQ,wBAAqB;AACxE,SAASC,IAAI,QAAwB,sBAAmB;AACxD,SACEC,eAAe,QAEV,kCAA+B;AACtC,SACEC,iBAAiB,QAEZ,oCAAiC;;AAExC;AACA,SAASC,WAAW,QAAQ,mBAAU;;AAEtC;AACA,SACEC,SAAS,QAQJ,iCAAwB;AAC/B,SACEC,KAAK,QAGA,6BAAoB;AAC3B,SACEC,MAAM,QAGD,8BAAqB;AAC5B,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,WAAW,QAGN,oCAA2B;AAClC,SAASC,MAAM,QAA0B,8BAAqB;AAC9D,SACEC,MAAM,QAGD,8BAAqB;AAC5B,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,YAAY,QAGP,qCAA4B;AACnC,SAASC,MAAM,QAAgD,8BAAqB;AACpF,SACEC,IAAI,QAKC,4BAAmB;AAC1B,SAASC,IAAI,QAAwB,4BAAmB;AACxD,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SACEC,UAAU,QAGL,mCAA0B;AACjC,SAASC,KAAK,QAAyB,6BAAoB;AAC3D,SACEC,UAAU,QAIL,mCAA0B;AACjC,SACEC,IAAI,QAWC,4BAAmB;AAC1B,SAASC,KAAK,QAA8C,6BAAoB;AAChF,SACEC,OAAO,QAUF,+BAAsB;AAC7B,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SACEC,UAAU,QAGL,mCAA0B;AACjC,SACEC,UAAU,QAEL,mCAA0B;AACjC,SAASC,OAAO,QAA2B,+BAAsB;AACjE,SAASC,QAAQ,QAA4B,gCAAuB;AACpE,SAASC,OAAO,QAA2B,+BAAsB;AACjE,SACEC,KAAK,QAQA,6BAAoB;AAC3B,SAASC,OAAO,QAA2B,+BAAsB;AACjE,SAASC,MAAM,QAA0B,8BAAqB;AAC9D,SACEC,QAAQ,QAOH,gCAAuB;AAC9B,SACEC,KAAK,EACLC,aAAa,EACbC,KAAK,EACLC,QAAQ,QASH,6BAAoB;AAC3B,SACEC,UAAU,QAML,kCAAyB;;AAEhC;AACA,SACEC,iBAAiB,EACjBC,SAAS,EACTC,gBAAgB,EAChBC,QAAQ,EACRC,QAAQ,EACRC,eAAe,EACfC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,EACVC,iBAAiB,EACjBC,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,QAAQ,EACRC,cAAc,EACdC,eAAe,EACfC,eAAe,EACfC,OAAO,EACPC,KAAK,EACLC,YAAY,QAEP,kBAAS;;AAEhB;AACA,cAAc,kBAAS;;AAEvB;AACA,SAASC,EAAE,QAAQ,eAAY","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Optional bridge to the platform's own UI toolkit.
|
|
5
|
+
*
|
|
6
|
+
* A handful of controls are better served by the real thing than by a faithful
|
|
7
|
+
* re-implementation: a switch, a picker, a sheet and a button are muscle
|
|
8
|
+
* memory, and users notice when the animation curve or the haptic is a
|
|
9
|
+
* near-miss. Passing `native` to those components hands rendering to SwiftUI
|
|
10
|
+
* on iOS and Jetpack Compose on Android.
|
|
11
|
+
*
|
|
12
|
+
* It is optional on purpose. The package is resolved lazily and every caller
|
|
13
|
+
* falls back to the styled implementation when it is missing, so nobody who
|
|
14
|
+
* never writes `native` has to install anything.
|
|
15
|
+
*
|
|
16
|
+
* ```sh
|
|
17
|
+
* npx expo install @expo/ui
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* **Theme tokens do not apply in native mode.** The platform draws the control
|
|
21
|
+
* with its own colours, metrics and typography — that is the entire point, and
|
|
22
|
+
* it means `className` and the variant props are ignored on those components.
|
|
23
|
+
*/
|
|
24
|
+
import { Platform } from 'react-native';
|
|
25
|
+
let resolved = false;
|
|
26
|
+
let module = null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The native UI module, or null when it is not installed or the platform has
|
|
30
|
+
* no toolkit behind it. Resolved once and cached — a failed require is not
|
|
31
|
+
* retried on every render.
|
|
32
|
+
*/
|
|
33
|
+
export function getNativeUI() {
|
|
34
|
+
if (resolved) return module;
|
|
35
|
+
resolved = true;
|
|
36
|
+
|
|
37
|
+
// Web has no SwiftUI and no Compose; @expo/ui renders plain views there,
|
|
38
|
+
// which loses the styling without gaining anything.
|
|
39
|
+
if (Platform.OS === 'web') return null;
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
42
|
+
module = require('@expo/ui');
|
|
43
|
+
} catch {
|
|
44
|
+
module = null;
|
|
45
|
+
}
|
|
46
|
+
return module;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Whether `native` will actually render a platform control. */
|
|
50
|
+
export function hasNativeUI() {
|
|
51
|
+
return getNativeUI() !== null;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","resolved","module","getNativeUI","OS","require","hasNativeUI"],"sourceRoot":"../../../src","sources":["native/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AA4BvC,IAAIC,QAAQ,GAAG,KAAK;AACpB,IAAIC,MAA6B,GAAG,IAAI;;AAExC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAA0B;EACnD,IAAIF,QAAQ,EAAE,OAAOC,MAAM;EAC3BD,QAAQ,GAAG,IAAI;;EAEf;EACA;EACA,IAAID,QAAQ,CAACI,EAAE,KAAK,KAAK,EAAE,OAAO,IAAI;EAEtC,IAAI;IACF;IACAF,MAAM,GAAGG,OAAO,CAAC,UAAU,CAAmB;EAChD,CAAC,CAAC,MAAM;IACNH,MAAM,GAAG,IAAI;EACf;EAEA,OAAOA,MAAM;AACf;;AAEA;AACA,OAAO,SAASI,WAAWA,CAAA,EAAY;EACrC,OAAOH,WAAW,CAAC,CAAC,KAAK,IAAI;AAC/B","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* KeyboardAvoider — a view that lifts itself just clear of the keyboard.
|
|
5
|
+
*
|
|
6
|
+
* A thin wrapper over `useKeyboardAvoidance` for the common case of "keep this
|
|
7
|
+
* box visible", so a form does not have to wire the ref, layout handler and
|
|
8
|
+
* animated style by hand.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import Animated from 'react-native-reanimated';
|
|
12
|
+
import { useKeyboardAvoidance } from "../hooks/use-keyboard-avoidance.js";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export function KeyboardAvoider({
|
|
15
|
+
className,
|
|
16
|
+
enabled = true,
|
|
17
|
+
offset = 16,
|
|
18
|
+
children,
|
|
19
|
+
style,
|
|
20
|
+
onLayout,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
const avoidance = useKeyboardAvoidance({
|
|
24
|
+
enabled,
|
|
25
|
+
offset
|
|
26
|
+
});
|
|
27
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
28
|
+
...props,
|
|
29
|
+
ref: avoidance.ref,
|
|
30
|
+
onLayout: event => {
|
|
31
|
+
avoidance.onLayout(event);
|
|
32
|
+
onLayout?.(event);
|
|
33
|
+
},
|
|
34
|
+
className: className,
|
|
35
|
+
style: [style, avoidance.animatedStyle],
|
|
36
|
+
children: children
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
KeyboardAvoider.displayName = 'KeyboardAvoider';
|
|
40
|
+
//# sourceMappingURL=keyboard-avoider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Animated","useKeyboardAvoidance","jsx","_jsx","KeyboardAvoider","className","enabled","offset","children","style","onLayout","props","avoidance","View","ref","event","animatedStyle","displayName"],"sourceRoot":"../../../src","sources":["primitives/keyboard-avoider.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,oBAAoB,QAAQ,oCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWvE,OAAO,SAASC,eAAeA,CAAC;EAC9BC,SAAS;EACTC,OAAO,GAAG,IAAI;EACdC,MAAM,GAAG,EAAE;EACXC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACiB,CAAC,EAAE;EACvB,MAAMC,SAAS,GAAGX,oBAAoB,CAAC;IAAEK,OAAO;IAAEC;EAAO,CAAC,CAAC;EAE3D,oBACEJ,IAAA,CAACH,QAAQ,CAACa,IAAI;IAAA,GACRF,KAAK;IACTG,GAAG,EAAEF,SAAS,CAACE,GAAI;IACnBJ,QAAQ,EAAGK,KAAK,IAAK;MACnBH,SAAS,CAACF,QAAQ,CAACK,KAAK,CAAC;MACzBL,QAAQ,GAAGK,KAAK,CAAC;IACnB,CAAE;IACFV,SAAS,EAAEA,SAAU;IACrBI,KAAK,EAAE,CAACA,KAAK,EAAEG,SAAS,CAACI,aAAa,CAAE;IAAAR,QAAA,EAEvCA;EAAQ,CACI,CAAC;AAEpB;AAEAJ,eAAe,CAACa,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { Fragment } from 'react';
|
|
3
4
|
import { StyleSheet, View } from 'react-native';
|
|
4
5
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
5
6
|
import { PortalHost, PortalProvider } from "../primitives/portal.js";
|
|
6
7
|
import { ToastViewport } from "../components/toast/index.js";
|
|
7
8
|
import { cn } from "../utils/cn.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `react-native-keyboard-controller` needs its provider at the root, and
|
|
12
|
+
* forgetting it is a silent failure — the hooks return zeroes and keyboard
|
|
13
|
+
* avoidance simply does nothing. Mount it here when the package is installed
|
|
14
|
+
* so `avoidKeyboard` works without any extra setup, and fall back to a
|
|
15
|
+
* pass-through when it is not.
|
|
16
|
+
*/
|
|
8
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const KeyboardProvider = (() => {
|
|
19
|
+
try {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
21
|
+
const controller = require('react-native-keyboard-controller');
|
|
22
|
+
return controller?.KeyboardProvider ?? Fragment;
|
|
23
|
+
} catch {
|
|
24
|
+
return Fragment;
|
|
25
|
+
}
|
|
26
|
+
})();
|
|
9
27
|
/**
|
|
10
28
|
* Root provider for PanelUI. Owns three things:
|
|
11
29
|
* the gesture handler root, the themed page background, and the portal host
|
|
@@ -25,10 +43,12 @@ export function PanelUIProvider({
|
|
|
25
43
|
}) {
|
|
26
44
|
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
27
45
|
style: styles.root,
|
|
28
|
-
children: /*#__PURE__*/_jsx(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
children:
|
|
46
|
+
children: /*#__PURE__*/_jsx(KeyboardProvider, {
|
|
47
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
48
|
+
className: cn('flex-1', background && 'bg-background', className),
|
|
49
|
+
children: /*#__PURE__*/_jsxs(PortalProvider, {
|
|
50
|
+
children: [children, /*#__PURE__*/_jsx(ToastViewport, {}), /*#__PURE__*/_jsx(PortalHost, {})]
|
|
51
|
+
})
|
|
32
52
|
})
|
|
33
53
|
})
|
|
34
54
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","View","GestureHandlerRootView","PortalHost","PortalProvider","ToastViewport","cn","jsx","_jsx","jsxs","_jsxs","PanelUIProvider","children","className","background","style","styles","root","create","flex"],"sourceRoot":"../../../src","sources":["providers/panel-ui-provider.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["Fragment","StyleSheet","View","GestureHandlerRootView","PortalHost","PortalProvider","ToastViewport","cn","jsx","_jsx","jsxs","_jsxs","KeyboardProvider","controller","require","PanelUIProvider","children","className","background","style","styles","root","create","flex"],"sourceRoot":"../../../src","sources":["providers/panel-ui-provider.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAA4C,OAAO;AACpE,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,UAAU,EAAEC,cAAc,QAAQ,yBAAsB;AACjE,SAASC,aAAa,QAAQ,8BAAqB;AACnD,SAASC,EAAE,QAAQ,gBAAa;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOA,MAAMC,gBAAyD,GAAG,CAAC,MAAM;EACvE,IAAI;IACF;IACA,MAAMC,UAAU,GAAGC,OAAO,CAAC,kCAAkC,CAAC;IAC9D,OAAOD,UAAU,EAAED,gBAAgB,IAAIZ,QAAQ;EACjD,CAAC,CAAC,MAAM;IACN,OAAOA,QAAQ;EACjB;AACF,CAAC,EAAE,CAAC;AAgBJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASe,eAAeA,CAAC;EAC9BC,QAAQ;EACRC,SAAS;EACTC,UAAU,GAAG;AACO,CAAC,EAAE;EACvB,oBACET,IAAA,CAACN,sBAAsB;IAACgB,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAL,QAAA,eAGzCP,IAAA,CAACG,gBAAgB;MAAAI,QAAA,eACfP,IAAA,CAACP,IAAI;QAACe,SAAS,EAAEV,EAAE,CAAC,QAAQ,EAAEW,UAAU,IAAI,eAAe,EAAED,SAAS,CAAE;QAAAD,QAAA,eACtEL,KAAA,CAACN,cAAc;UAAAW,QAAA,GACZA,QAAQ,eAETP,IAAA,CAACH,aAAa,IAAE,CAAC,eACjBG,IAAA,CAACL,UAAU,IAAE,CAAC;QAAA,CACA;MAAC,CACb;IAAC,CACS;EAAC,CACG,CAAC;AAE7B;AAEA,MAAMgB,MAAM,GAAGnB,UAAU,CAACqB,MAAM,CAAC;EAC/BD,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ import { Uniwind, useUniwind } from 'uniwind';
|
|
|
11
11
|
/**
|
|
12
12
|
* The theme families PanelUI ships. Each sets its own palette *and* its own
|
|
13
13
|
* radius scale, so switching family changes the shape of the UI as well as
|
|
14
|
-
* its colour — Panel is the
|
|
14
|
+
* its colour — Panel is the default, Moon is sharp and monochrome,
|
|
15
15
|
* Grass is soft and green.
|
|
16
16
|
*
|
|
17
17
|
* Everything beyond `panel` must be registered in your metro config, or
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Accordion — collapsible sections.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Split into Item / Trigger / Indicator / Content so a section header can hold
|
|
5
|
+
* anything — a badge, a price, a second line — instead of only a string. The
|
|
6
|
+
* chevron rotates rather than swapping glyphs, and the panel expands through a
|
|
7
|
+
* layout transition, both on the UI thread.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* `selectionMode` decides whether opening one section closes the others, which
|
|
10
|
+
* also changes the shape of `value`: a string when single, an array when
|
|
11
|
+
* multiple.
|
|
10
12
|
*/
|
|
11
13
|
import { type ReactNode } from 'react';
|
|
12
14
|
import { View, type Text as RNText, type ViewProps } from 'react-native';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/accordion/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/accordion/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,IAAI,EAAE,KAAK,IAAI,IAAI,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AASpF,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,0BAAuB,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,CAAC;AA0E3D,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,2DAA2D;IAC3D,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA0ED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA6BD,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA8BD,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA4BD,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAmCD,eAAO,MAAM,SAAS;;;;;;CAMpB,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Alert — a status message with an optional leading status icon.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The `variant` prop name is kept from PanelUI v0.2 rather than renamed to
|
|
9
|
-
* HeroUI's `status`, so existing code keeps working.
|
|
4
|
+
* The indicator derives its icon and colour from the variant, so a success
|
|
5
|
+
* alert cannot end up with a warning icon. Pass `icon` on the root to override
|
|
6
|
+
* it everywhere, or give `Alert.Indicator` children to override one.
|
|
10
7
|
*/
|
|
11
8
|
import { type ReactNode } from 'react';
|
|
12
9
|
import { View, type Text as RNText, type ViewProps } from 'react-native';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/alert/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/alert/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,0BAAuB,CAAC;AAG7D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAmCjB,CAAC;AAuBH,MAAM,WAAW,UAAW,SAAQ,SAAS,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA6BD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,SAAS,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAqDD,eAAO,MAAM,KAAK;IAChB,oEAAoE;;IAEpE,mDAAmD;;oBA9BW,MAAM;;;;CAkCpE,CAAC"}
|
|
@@ -5,8 +5,28 @@ export interface BottomSheetProps {
|
|
|
5
5
|
open?: boolean;
|
|
6
6
|
onOpenChange?: (open: boolean) => void;
|
|
7
7
|
defaultOpen?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Present the platform's own sheet instead of this one, so it gets the
|
|
10
|
+
* system's detents, scroll interaction and dismiss gesture. Requires the
|
|
11
|
+
* optional `@expo/ui` package; without it this prop does nothing.
|
|
12
|
+
*
|
|
13
|
+
* **Theme tokens do not apply to the sheet chrome** — the platform draws the
|
|
14
|
+
* container, so `BottomSheet.Content`'s `className` and its drag handle are
|
|
15
|
+
* ignored. The content inside is still yours.
|
|
16
|
+
*/
|
|
17
|
+
native?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Heights the native sheet can rest at. Omit to size to the content.
|
|
20
|
+
* `{ fraction }` and `{ height }` are iOS-only; Android snaps them to the
|
|
21
|
+
* nearest of `half` / `full`.
|
|
22
|
+
*/
|
|
23
|
+
snapPoints?: ('half' | 'full' | {
|
|
24
|
+
fraction: number;
|
|
25
|
+
} | {
|
|
26
|
+
height: number;
|
|
27
|
+
})[];
|
|
8
28
|
}
|
|
9
|
-
declare function BottomSheetRoot({ children, open, onOpenChange, defaultOpen, }: BottomSheetProps): import("react").JSX.Element;
|
|
29
|
+
declare function BottomSheetRoot({ children, open, onOpenChange, defaultOpen, native, snapPoints, }: BottomSheetProps): import("react").JSX.Element;
|
|
10
30
|
interface BottomSheetTriggerProps {
|
|
11
31
|
children: ReactElement<{
|
|
12
32
|
onPress?: (...args: unknown[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAqCpF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CAC9E;AAWD,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAmB,EACnB,MAAM,EACN,UAAU,GACX,EAAE,gBAAgB,+BA+BlB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,YAAY,CAAC;QAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,iBAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,uBAAuB;cAH5B,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI;wDAahE;AAED,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,WAAkB,EAClB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,sCAqHzB;AAED,eAAO,MAAM,WAAW;;;CAGtB,CAAC"}
|
|
@@ -210,6 +210,17 @@ export interface ButtonProps extends Omit<AnimatedPressableProps, 'children' | '
|
|
|
210
210
|
endContent?: ReactNode;
|
|
211
211
|
/** Extra classes for the label when children is a string. */
|
|
212
212
|
labelClassName?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Render the platform's own button instead of this one. Requires the
|
|
215
|
+
* optional `@expo/ui` package; without it this prop does nothing.
|
|
216
|
+
*
|
|
217
|
+
* **Theme tokens do not apply** — the platform draws the button, so
|
|
218
|
+
* `className`, `size`, `fullWidth`, `startContent`, `endContent` and
|
|
219
|
+
* `loading` are all ignored. `variant` maps onto the nearest platform
|
|
220
|
+
* style: `primary`/`destructive` → filled, `outline` → outlined, everything
|
|
221
|
+
* else → text.
|
|
222
|
+
*/
|
|
223
|
+
native?: boolean;
|
|
213
224
|
}
|
|
214
225
|
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<View>>;
|
|
215
226
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAM7C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;QAiCd,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA7E,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA7E,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwBjF,CAAC;AAEH,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAsB9D,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,UAAU,CAAC,EAC3D,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iFAAiF;IACjF,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,wCAAwC;IACxC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAeD,eAAO,MAAM,MAAM,8FA4FlB,CAAC"}
|