@retray-dev/ui-kit 7.0.1 → 9.1.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/COMPONENTS.md +567 -14
- package/EXAMPLES.md +21 -14
- package/README.md +14 -8
- package/dist/Accordion.js +57 -5
- package/dist/Accordion.mjs +4 -3
- package/dist/AlertBanner.js +4 -1
- package/dist/AlertBanner.mjs +3 -2
- package/dist/AppHeader.d.mts +40 -0
- package/dist/AppHeader.d.ts +40 -0
- package/dist/AppHeader.js +515 -0
- package/dist/AppHeader.mjs +10 -0
- package/dist/Avatar.js +39 -29
- package/dist/Avatar.mjs +2 -1
- package/dist/Badge.js +11 -1
- package/dist/Badge.mjs +2 -1
- package/dist/Button.d.mts +8 -3
- package/dist/Button.d.ts +8 -3
- package/dist/Button.js +126 -108
- package/dist/Button.mjs +6 -5
- package/dist/ButtonGroup.mjs +1 -0
- package/dist/Card.js +90 -70
- package/dist/Card.mjs +5 -4
- package/dist/CategoryStrip.js +79 -22
- package/dist/CategoryStrip.mjs +6 -6
- package/dist/Checkbox.js +118 -86
- package/dist/Checkbox.mjs +5 -5
- package/dist/Chip.js +113 -80
- package/dist/Chip.mjs +5 -5
- package/dist/ConfirmDialog.js +140 -110
- package/dist/ConfirmDialog.mjs +7 -6
- package/dist/CurrencyDisplay.mjs +1 -0
- package/dist/CurrencyInput.d.mts +1 -1
- package/dist/CurrencyInput.d.ts +1 -1
- package/dist/CurrencyInput.js +9 -5
- package/dist/CurrencyInput.mjs +5 -4
- package/dist/DetailRow.mjs +1 -0
- package/dist/EmptyState.js +131 -111
- package/dist/EmptyState.mjs +7 -6
- package/dist/ErrorBoundary.d.mts +42 -0
- package/dist/ErrorBoundary.d.ts +42 -0
- package/dist/ErrorBoundary.js +351 -0
- package/dist/ErrorBoundary.mjs +7 -0
- package/dist/Form.mjs +1 -0
- package/dist/HolographicCard.d.mts +55 -0
- package/dist/HolographicCard.d.ts +55 -0
- package/dist/HolographicCard.js +316 -0
- package/dist/HolographicCard.mjs +191 -0
- package/dist/IconButton.d.mts +8 -3
- package/dist/IconButton.d.ts +8 -3
- package/dist/IconButton.js +115 -98
- package/dist/IconButton.mjs +5 -4
- package/dist/ImageViewer.d.mts +23 -0
- package/dist/ImageViewer.d.ts +23 -0
- package/dist/ImageViewer.js +582 -0
- package/dist/ImageViewer.mjs +8 -0
- package/dist/Input.mjs +4 -3
- package/dist/LabelValue.mjs +1 -0
- package/dist/ListGroup.mjs +1 -0
- package/dist/ListItem.js +131 -117
- package/dist/ListItem.mjs +6 -5
- package/dist/MediaCard.js +54 -6
- package/dist/MediaCard.mjs +6 -5
- package/dist/MenuGroup.mjs +1 -0
- package/dist/MenuItem.js +91 -79
- package/dist/MenuItem.mjs +6 -5
- package/dist/MonthPicker.d.mts +10 -2
- package/dist/MonthPicker.d.ts +10 -2
- package/dist/MonthPicker.js +80 -17
- package/dist/MonthPicker.mjs +3 -2
- package/dist/PagerDots.d.mts +35 -0
- package/dist/PagerDots.d.ts +35 -0
- package/dist/PagerDots.js +392 -0
- package/dist/PagerDots.mjs +7 -0
- package/dist/Pressable.d.mts +5 -5
- package/dist/Pressable.d.ts +5 -5
- package/dist/Pressable.js +97 -86
- package/dist/Pressable.mjs +5 -4
- package/dist/PricingCard.d.mts +50 -0
- package/dist/PricingCard.d.ts +50 -0
- package/dist/PricingCard.js +636 -0
- package/dist/PricingCard.mjs +11 -0
- package/dist/Progress.mjs +3 -2
- package/dist/RadioGroup.js +81 -30
- package/dist/RadioGroup.mjs +5 -5
- package/dist/RetrayProvider.d.mts +2 -0
- package/dist/RetrayProvider.d.ts +2 -0
- package/dist/RetrayProvider.js +214 -0
- package/dist/RetrayProvider.mjs +5 -0
- package/dist/Select.js +51 -4
- package/dist/Select.mjs +5 -4
- package/dist/SelectableGrid.d.mts +44 -0
- package/dist/SelectableGrid.d.ts +44 -0
- package/dist/SelectableGrid.js +448 -0
- package/dist/SelectableGrid.mjs +9 -0
- package/dist/Separator.mjs +1 -0
- package/dist/Sheet.d.mts +13 -1
- package/dist/Sheet.d.ts +13 -1
- package/dist/Sheet.js +115 -5
- package/dist/Sheet.mjs +4 -2
- package/dist/Skeleton.d.mts +50 -0
- package/dist/Skeleton.d.ts +50 -0
- package/dist/Skeleton.js +61 -0
- package/dist/Skeleton.mjs +4 -2
- package/dist/Slider.js +51 -4
- package/dist/Slider.mjs +3 -2
- package/dist/Spinner.js +28 -7
- package/dist/Spinner.mjs +2 -1
- package/dist/Switch.js +98 -48
- package/dist/Switch.mjs +4 -3
- package/dist/TabBar.d.mts +42 -0
- package/dist/TabBar.d.ts +42 -0
- package/dist/TabBar.js +361 -0
- package/dist/TabBar.mjs +6 -0
- package/dist/Tabs.js +92 -62
- package/dist/Tabs.mjs +5 -4
- package/dist/Text.js +16 -0
- package/dist/Text.mjs +2 -1
- package/dist/Textarea.mjs +4 -3
- package/dist/Toast.d.mts +7 -7
- package/dist/Toast.d.ts +7 -7
- package/dist/Toast.mjs +1 -0
- package/dist/Toggle.d.mts +6 -3
- package/dist/Toggle.d.ts +6 -3
- package/dist/Toggle.js +135 -120
- package/dist/Toggle.mjs +5 -5
- package/dist/VirtualList.mjs +1 -0
- package/dist/{chunk-7H2OR44A.mjs → chunk-26BCI223.mjs} +1 -1
- package/dist/{chunk-CRYBX2CM.mjs → chunk-2TFTAWVJ.mjs} +44 -59
- package/dist/chunk-3DKJ2GIC.mjs +30 -0
- package/dist/{chunk-KWCPOM6W.mjs → chunk-3U4SSNWP.mjs} +32 -48
- package/dist/chunk-4I7D47FH.mjs +139 -0
- package/dist/chunk-4K625MVM.mjs +142 -0
- package/dist/{chunk-MN7OG7IY.mjs → chunk-6OAZJ577.mjs} +6 -4
- package/dist/{chunk-L7E7TVEZ.mjs → chunk-756RAKE4.mjs} +2 -2
- package/dist/{chunk-HSPSMN6U.mjs → chunk-7QHVVCB3.mjs} +2 -2
- package/dist/{chunk-URLL5JBR.mjs → chunk-A3A6KNQN.mjs} +3 -3
- package/dist/chunk-AJ7ZDNBT.mjs +120 -0
- package/dist/{chunk-FTLJOUOQ.mjs → chunk-AV4EMIRH.mjs} +25 -28
- package/dist/chunk-AZJF2BLK.mjs +115 -0
- package/dist/chunk-BNP626TY.mjs +159 -0
- package/dist/{chunk-5IKW3VNC.mjs → chunk-DVK4G2GT.mjs} +17 -1
- package/dist/{chunk-6LQYY7HC.mjs → chunk-EH745HE5.mjs} +2 -2
- package/dist/chunk-EJ7ZPXOH.mjs +163 -0
- package/dist/{chunk-RKLHUDZS.mjs → chunk-GD6KXMG5.mjs} +29 -15
- package/dist/{chunk-RR2VQLKE.mjs → chunk-GQYFLP3D.mjs} +14 -17
- package/dist/{chunk-Y6MXOREN.mjs → chunk-ID72TK46.mjs} +8 -17
- package/dist/{chunk-NQGVLMWG.mjs → chunk-JMOZEC77.mjs} +1 -1
- package/dist/{chunk-GCWOGZYL.mjs → chunk-JT7HKXRB.mjs} +39 -29
- package/dist/{chunk-LWG526VX.mjs → chunk-KIHCWCWL.mjs} +47 -62
- package/dist/chunk-LXJIIOYQ.mjs +104 -0
- package/dist/{chunk-SBZYEV4S.mjs → chunk-M6ZXVBTK.mjs} +5 -2
- package/dist/{chunk-XDMN67KV.mjs → chunk-MAC465BB.mjs} +10 -8
- package/dist/chunk-MBMXYJJV.mjs +36 -0
- package/dist/chunk-MLF3EZFW.mjs +119 -0
- package/dist/chunk-NA7PARID.mjs +147 -0
- package/dist/{chunk-QXGYKWI7.mjs → chunk-O3HA6TYM.mjs} +9 -4
- package/dist/{chunk-63357L2X.mjs → chunk-OB4JUQ3O.mjs} +1 -1
- package/dist/{chunk-AU2VDY4P.mjs → chunk-PFZTM6D5.mjs} +52 -4
- package/dist/chunk-QKH5ZOD5.mjs +97 -0
- package/dist/{chunk-KZJRQOIU.mjs → chunk-TERDKCLE.mjs} +11 -1
- package/dist/{chunk-U4N7WF4Z.mjs → chunk-UREA2GYY.mjs} +28 -23
- package/dist/{chunk-TAJ2PQ2O.mjs → chunk-VGTDN7SW.mjs} +7 -6
- package/dist/{chunk-URDE3EUU.mjs → chunk-VQ57HWPL.mjs} +27 -15
- package/dist/chunk-WBOOUHSS.mjs +62 -0
- package/dist/{chunk-GNGLDL6Z.mjs → chunk-WJLKJMKR.mjs} +18 -0
- package/dist/{chunk-YZJAFS4P.mjs → chunk-X4G6APW6.mjs} +22 -19
- package/dist/chunk-Y6FXYEAI.mjs +8 -0
- package/dist/chunk-YFZ3ELX5.mjs +16 -0
- package/dist/{chunk-QCNARS3X.mjs → chunk-YNROWHQJ.mjs} +1 -1
- package/dist/chunk-Z4BVUWW6.mjs +196 -0
- package/dist/{chunk-GPOUINK5.mjs → chunk-ZJKGQMYH.mjs} +10 -27
- package/dist/index-wt-orHUi.d.mts +85 -0
- package/dist/index-wt-orHUi.d.ts +85 -0
- package/dist/index.d.mts +59 -51
- package/dist/index.d.ts +59 -51
- package/dist/index.js +1940 -744
- package/dist/index.mjs +49 -39
- package/package.json +35 -5
- package/src/components/Accordion/Accordion.tsx +12 -1
- package/src/components/AlertBanner/AlertBanner.tsx +5 -0
- package/src/components/AppHeader/AppHeader.tsx +172 -0
- package/src/components/AppHeader/index.ts +1 -0
- package/src/components/Avatar/Avatar.tsx +10 -2
- package/src/components/Badge/Badge.tsx +8 -1
- package/src/components/Button/Button.tsx +20 -27
- package/src/components/Card/Card.tsx +12 -23
- package/src/components/CategoryStrip/CategoryStrip.tsx +17 -21
- package/src/components/Checkbox/Checkbox.tsx +26 -40
- package/src/components/Chip/Chip.tsx +24 -33
- package/src/components/CurrencyInput/CurrencyInput.tsx +10 -8
- package/src/components/EmptyState/EmptyState.tsx +2 -1
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +153 -0
- package/src/components/ErrorBoundary/index.ts +1 -0
- package/src/components/HolographicCard/HolographicCard.tsx +315 -0
- package/src/components/HolographicCard/index.ts +1 -0
- package/src/components/IconButton/IconButton.tsx +19 -27
- package/src/components/ImageViewer/ImageViewer.tsx +290 -0
- package/src/components/ImageViewer/index.ts +1 -0
- package/src/components/ListItem/ListItem.tsx +70 -67
- package/src/components/MediaCard/MediaCard.tsx +8 -2
- package/src/components/MenuItem/MenuItem.tsx +10 -25
- package/src/components/MonthPicker/MonthPicker.tsx +39 -13
- package/src/components/MonthPicker/index.ts +1 -1
- package/src/components/PagerDots/PagerDots.tsx +200 -0
- package/src/components/PagerDots/index.ts +1 -0
- package/src/components/Pressable/Pressable.tsx +19 -35
- package/src/components/PricingCard/PricingCard.tsx +220 -0
- package/src/components/PricingCard/index.ts +1 -0
- package/src/components/RadioGroup/RadioGroup.tsx +14 -27
- package/src/components/RetrayProvider/RetrayProvider.tsx +59 -0
- package/src/components/RetrayProvider/index.ts +1 -0
- package/src/components/SelectableGrid/SelectableGrid.tsx +205 -0
- package/src/components/SelectableGrid/index.ts +1 -0
- package/src/components/Sheet/Sheet.tsx +65 -1
- package/src/components/Skeleton/Skeleton.tsx +142 -1
- package/src/components/Spinner/Spinner.tsx +17 -2
- package/src/components/Switch/Switch.tsx +30 -58
- package/src/components/TabBar/TabBar.tsx +169 -0
- package/src/components/TabBar/index.ts +1 -0
- package/src/components/Tabs/Tabs.tsx +23 -26
- package/src/components/Text/Text.tsx +2 -0
- package/src/components/Toggle/Toggle.tsx +35 -51
- package/src/fonts.ts +4 -1
- package/src/index.ts +23 -2
- package/src/utils/animations.ts +29 -1
- package/src/utils/fontGuard.ts +34 -0
- package/src/utils/haptics.ts +211 -9
- package/src/utils/pressable.ts +66 -0
- package/dist/chunk-76PFOSM2.mjs +0 -41
- package/dist/chunk-DITNP6PL.mjs +0 -106
- package/dist/chunk-JBLL7U3U.mjs +0 -64
- package/dist/chunk-LG4DO3DK.mjs +0 -174
- package/dist/chunk-RMMK64W5.mjs +0 -54
- package/dist/chunk-RTC3CFXF.mjs +0 -29
package/dist/MenuItem.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var React3 = require('react');
|
|
4
4
|
var reactNative = require('react-native');
|
|
5
|
-
var Animated = require('react-native-reanimated');
|
|
6
5
|
var vectorIcons = require('@expo/vector-icons');
|
|
7
6
|
var reactNativeSizeMatters = require('react-native-size-matters');
|
|
8
7
|
var AntDesign = require('@expo/vector-icons/AntDesign');
|
|
@@ -11,11 +10,12 @@ var Feather = require('@expo/vector-icons/Feather');
|
|
|
11
10
|
var FontAwesome5 = require('@expo/vector-icons/FontAwesome5');
|
|
12
11
|
var MaterialIcons = require('@expo/vector-icons/MaterialIcons');
|
|
13
12
|
var Ionicons = require('@expo/vector-icons/Ionicons');
|
|
13
|
+
var pressto = require('pressto');
|
|
14
|
+
var reactNativeReanimated = require('react-native-reanimated');
|
|
14
15
|
|
|
15
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
|
|
17
18
|
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
18
|
-
var Animated__default = /*#__PURE__*/_interopDefault(Animated);
|
|
19
19
|
var AntDesign__default = /*#__PURE__*/_interopDefault(AntDesign);
|
|
20
20
|
var Entypo__default = /*#__PURE__*/_interopDefault(Entypo);
|
|
21
21
|
var Feather__default = /*#__PURE__*/_interopDefault(Feather);
|
|
@@ -23,18 +23,65 @@ var FontAwesome5__default = /*#__PURE__*/_interopDefault(FontAwesome5);
|
|
|
23
23
|
var MaterialIcons__default = /*#__PURE__*/_interopDefault(MaterialIcons);
|
|
24
24
|
var Ionicons__default = /*#__PURE__*/_interopDefault(Ionicons);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
27
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
28
|
+
}) : x)(function(x) {
|
|
29
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
30
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
31
|
+
});
|
|
27
32
|
var _haptics = null;
|
|
33
|
+
var _hapticsLoaded = false;
|
|
28
34
|
async function getHaptics() {
|
|
29
35
|
if (reactNative.Platform.OS === "web") return null;
|
|
30
|
-
if (!
|
|
31
|
-
|
|
36
|
+
if (!_hapticsLoaded) {
|
|
37
|
+
_hapticsLoaded = true;
|
|
38
|
+
try {
|
|
39
|
+
_haptics = await import('expo-haptics');
|
|
40
|
+
} catch {
|
|
41
|
+
_haptics = null;
|
|
42
|
+
}
|
|
32
43
|
}
|
|
33
44
|
return _haptics;
|
|
34
45
|
}
|
|
46
|
+
var _pulsar = null;
|
|
47
|
+
var _pulsarChecked = false;
|
|
48
|
+
var _pulsarAvailable = false;
|
|
49
|
+
function isPulsarNativeRegistered() {
|
|
50
|
+
try {
|
|
51
|
+
const g = globalThis;
|
|
52
|
+
if (typeof g.__turboModuleProxy === "function") {
|
|
53
|
+
return g.__turboModuleProxy("RNPulsar") != null;
|
|
54
|
+
}
|
|
55
|
+
return reactNative.NativeModules?.RNPulsar != null;
|
|
56
|
+
} catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function getPulsar() {
|
|
61
|
+
if (reactNative.Platform.OS === "web") return null;
|
|
62
|
+
if (!_pulsarChecked) {
|
|
63
|
+
_pulsarChecked = true;
|
|
64
|
+
try {
|
|
65
|
+
if (isPulsarNativeRegistered()) {
|
|
66
|
+
_pulsar = __require("react-native-pulsar");
|
|
67
|
+
_pulsarAvailable = true;
|
|
68
|
+
}
|
|
69
|
+
} catch {
|
|
70
|
+
_pulsar = null;
|
|
71
|
+
_pulsarAvailable = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return _pulsarAvailable ? _pulsar : null;
|
|
75
|
+
}
|
|
35
76
|
function selectionAsync() {
|
|
36
77
|
if (reactNative.Platform.OS === "web") return;
|
|
37
|
-
getHaptics().then((h) =>
|
|
78
|
+
getHaptics().then((h) => {
|
|
79
|
+
if (h) {
|
|
80
|
+
h.selectionAsync();
|
|
81
|
+
} else {
|
|
82
|
+
getPulsar()?.Presets.System.selection();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
38
85
|
}
|
|
39
86
|
|
|
40
87
|
// src/theme/colorUtils.ts
|
|
@@ -204,65 +251,45 @@ function renderIcon(name, size, color) {
|
|
|
204
251
|
// src/tokens.ts
|
|
205
252
|
var RADIUS = {
|
|
206
253
|
md: 14};
|
|
207
|
-
var SPRINGS = {
|
|
208
|
-
/** Tight, premium press feel — Buttons, Toggle, Tabs triggers. */
|
|
209
|
-
pressIn: { stiffness: 600, damping: 35, mass: 0.8 },
|
|
210
|
-
pressOut: { stiffness: 280, damping: 22, mass: 0.8 },
|
|
211
|
-
/** Slightly softer for larger surfaces — Card, ListItem, MenuItem. */
|
|
212
|
-
surfacePressIn: { stiffness: 380, damping: 30, mass: 0.95 },
|
|
213
|
-
surfacePressOut: { stiffness: 220, damping: 20, mass: 0.95 }};
|
|
214
254
|
({
|
|
215
255
|
/** Material-style ease-out — natural deceleration for state changes. */
|
|
216
|
-
standard:
|
|
256
|
+
standard: reactNativeReanimated.Easing.bezier(0.2, 0, 0, 1),
|
|
217
257
|
/** Strong ease-out for expanding surfaces (Accordion open). */
|
|
218
|
-
expand:
|
|
258
|
+
expand: reactNativeReanimated.Easing.bezier(0.23, 1, 0.32, 1),
|
|
219
259
|
/** Quick ease-in for collapsing. */
|
|
220
|
-
collapse:
|
|
260
|
+
collapse: reactNativeReanimated.Easing.in(reactNativeReanimated.Easing.ease)
|
|
221
261
|
});
|
|
222
262
|
var PRESS_SCALE = {
|
|
223
263
|
button: 0.95,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const hoverActive = reactNative.Platform.OS === "web" && hovered && hoverScale !== 1 && !disabled;
|
|
254
|
-
const animatedStyle = Animated.useAnimatedStyle(() => ({
|
|
255
|
-
transform: [
|
|
256
|
-
{ scale: scale2.value * (hoverActive ? hoverScale : 1) }
|
|
257
|
-
]
|
|
258
|
-
}));
|
|
259
|
-
return {
|
|
260
|
-
animatedStyle,
|
|
261
|
-
onPressIn,
|
|
262
|
-
onPressOut,
|
|
263
|
-
hoverHandlers
|
|
264
|
-
};
|
|
265
|
-
}
|
|
264
|
+
card: 0.98,
|
|
265
|
+
row: 0.97,
|
|
266
|
+
chip: 0.94
|
|
267
|
+
};
|
|
268
|
+
pressto.createAnimatedPressable((progress) => {
|
|
269
|
+
"worklet";
|
|
270
|
+
const scale2 = 1 - (1 - PRESS_SCALE.button) * progress;
|
|
271
|
+
return { transform: [{ scale: scale2 }] };
|
|
272
|
+
});
|
|
273
|
+
pressto.createAnimatedPressable((progress) => {
|
|
274
|
+
"worklet";
|
|
275
|
+
const scale2 = 1 - (1 - PRESS_SCALE.card) * progress;
|
|
276
|
+
return { transform: [{ scale: scale2 }] };
|
|
277
|
+
});
|
|
278
|
+
var PressableRow = pressto.createAnimatedPressable((progress) => {
|
|
279
|
+
"worklet";
|
|
280
|
+
const scale2 = 1 - (1 - PRESS_SCALE.row) * progress;
|
|
281
|
+
return { transform: [{ scale: scale2 }] };
|
|
282
|
+
});
|
|
283
|
+
pressto.createAnimatedPressable((progress) => {
|
|
284
|
+
"worklet";
|
|
285
|
+
const scale2 = 1 - (1 - PRESS_SCALE.chip) * progress;
|
|
286
|
+
return { transform: [{ scale: scale2 }] };
|
|
287
|
+
});
|
|
288
|
+
pressto.createAnimatedPressable((progress) => {
|
|
289
|
+
"worklet";
|
|
290
|
+
const scale2 = 1 - (1 - PRESS_SCALE.button) * progress;
|
|
291
|
+
return { transform: [{ scale: scale2 }] };
|
|
292
|
+
});
|
|
266
293
|
|
|
267
294
|
// src/components/MenuItem/MenuItem.tsx
|
|
268
295
|
function MenuItemBase({
|
|
@@ -282,12 +309,6 @@ function MenuItemBase({
|
|
|
282
309
|
accessibilityLabel
|
|
283
310
|
}) {
|
|
284
311
|
const { colors } = useTheme();
|
|
285
|
-
const { animatedStyle, onPressIn, onPressOut, hoverHandlers } = usePressScale({
|
|
286
|
-
pressScale: PRESS_SCALE.row,
|
|
287
|
-
pressInSpring: SPRINGS.surfacePressIn,
|
|
288
|
-
pressOutSpring: SPRINGS.surfacePressOut,
|
|
289
|
-
disabled
|
|
290
|
-
});
|
|
291
312
|
const handlePress = () => {
|
|
292
313
|
selectionAsync();
|
|
293
314
|
onPress();
|
|
@@ -305,16 +326,15 @@ function MenuItemBase({
|
|
|
305
326
|
elevation: 2
|
|
306
327
|
} : {};
|
|
307
328
|
const a11yLabel = accessibilityLabel ?? (subtitle ? `${label}. ${subtitle}` : label);
|
|
308
|
-
return /* @__PURE__ */ React3__default.default.createElement(
|
|
309
|
-
|
|
329
|
+
return /* @__PURE__ */ React3__default.default.createElement(reactNative.View, { style: disabled && styles.disabled }, /* @__PURE__ */ React3__default.default.createElement(
|
|
330
|
+
PressableRow,
|
|
310
331
|
{
|
|
311
332
|
style: [styles.container, cardStyle, style],
|
|
312
333
|
onPress: handlePress,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
disabled,
|
|
316
|
-
activeOpacity: 1,
|
|
334
|
+
enabled: !disabled,
|
|
335
|
+
rippleColor: "transparent",
|
|
317
336
|
touchSoundDisabled: true,
|
|
337
|
+
activateOnHover: true,
|
|
318
338
|
accessibilityRole: "button",
|
|
319
339
|
accessibilityLabel: a11yLabel,
|
|
320
340
|
accessibilityState: { disabled }
|
|
@@ -347,15 +367,7 @@ function MenuItemBase({
|
|
|
347
367
|
},
|
|
348
368
|
rightRender
|
|
349
369
|
) : showChevron ? /* @__PURE__ */ React3__default.default.createElement(vectorIcons.Entypo, { name: "chevron-right", size: 18, color: colors.foregroundMuted }) : null
|
|
350
|
-
), showSeparator ? /* @__PURE__ */ React3__default.default.createElement(
|
|
351
|
-
reactNative.View,
|
|
352
|
-
{
|
|
353
|
-
style: [
|
|
354
|
-
styles.separator,
|
|
355
|
-
{ backgroundColor: colors.separator }
|
|
356
|
-
]
|
|
357
|
-
}
|
|
358
|
-
) : null);
|
|
370
|
+
), showSeparator ? /* @__PURE__ */ React3__default.default.createElement(reactNative.View, { style: [styles.separator, { backgroundColor: colors.separator }] }) : null);
|
|
359
371
|
}
|
|
360
372
|
var MenuItem = React3__default.default.memo(MenuItemBase);
|
|
361
373
|
var styles = reactNative.StyleSheet.create({
|
package/dist/MenuItem.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { MenuItem } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-5IKW3VNC.mjs';
|
|
1
|
+
export { MenuItem } from './chunk-ZJKGQMYH.mjs';
|
|
2
|
+
import './chunk-3DKJ2GIC.mjs';
|
|
3
|
+
import './chunk-EJ7ZPXOH.mjs';
|
|
4
|
+
import './chunk-DVK4G2GT.mjs';
|
|
6
5
|
import './chunk-QY3X2UYR.mjs';
|
|
6
|
+
import './chunk-T7XZ7H7Y.mjs';
|
|
7
7
|
import './chunk-SOYNZDVY.mjs';
|
|
8
8
|
import './chunk-2CE3TQVY.mjs';
|
|
9
|
+
import './chunk-Y6FXYEAI.mjs';
|
package/dist/MonthPicker.d.mts
CHANGED
|
@@ -6,15 +6,23 @@ interface MonthPickerValue {
|
|
|
6
6
|
month: number;
|
|
7
7
|
year: number;
|
|
8
8
|
}
|
|
9
|
+
/** Convert a JS `Date` to a `MonthPickerValue` (uses local time). */
|
|
10
|
+
declare function dateToMonthPickerValue(date: Date): MonthPickerValue;
|
|
11
|
+
/** Convert a `MonthPickerValue` to a `Date` at the first day of that month (local time). */
|
|
12
|
+
declare function monthPickerValueToDate(value: MonthPickerValue): Date;
|
|
9
13
|
interface MonthPickerProps {
|
|
10
14
|
value: MonthPickerValue;
|
|
11
15
|
onChange: (value: MonthPickerValue) => void;
|
|
16
|
+
/** Earliest selectable month (inclusive). Prev arrow disables at this bound. */
|
|
17
|
+
minValue?: MonthPickerValue;
|
|
18
|
+
/** Latest selectable month (inclusive). Next arrow disables at this bound — e.g. cap at the current month. */
|
|
19
|
+
maxValue?: MonthPickerValue;
|
|
12
20
|
/** BCP 47 locale tag. Built-in: 'en' | 'es' | 'pt' | 'fr'. For other locales supply formatLabel. */
|
|
13
21
|
locale?: string;
|
|
14
22
|
/** Custom label formatter. Takes precedence over locale. */
|
|
15
23
|
formatLabel?: (value: MonthPickerValue) => string;
|
|
16
24
|
style?: ViewStyle;
|
|
17
25
|
}
|
|
18
|
-
declare function MonthPicker({ value, onChange, locale, formatLabel, style }: MonthPickerProps): React.JSX.Element;
|
|
26
|
+
declare function MonthPicker({ value, onChange, minValue, maxValue, locale, formatLabel, style }: MonthPickerProps): React.JSX.Element;
|
|
19
27
|
|
|
20
|
-
export { MonthPicker, type MonthPickerProps, type MonthPickerValue };
|
|
28
|
+
export { MonthPicker, type MonthPickerProps, type MonthPickerValue, dateToMonthPickerValue, monthPickerValueToDate };
|
package/dist/MonthPicker.d.ts
CHANGED
|
@@ -6,15 +6,23 @@ interface MonthPickerValue {
|
|
|
6
6
|
month: number;
|
|
7
7
|
year: number;
|
|
8
8
|
}
|
|
9
|
+
/** Convert a JS `Date` to a `MonthPickerValue` (uses local time). */
|
|
10
|
+
declare function dateToMonthPickerValue(date: Date): MonthPickerValue;
|
|
11
|
+
/** Convert a `MonthPickerValue` to a `Date` at the first day of that month (local time). */
|
|
12
|
+
declare function monthPickerValueToDate(value: MonthPickerValue): Date;
|
|
9
13
|
interface MonthPickerProps {
|
|
10
14
|
value: MonthPickerValue;
|
|
11
15
|
onChange: (value: MonthPickerValue) => void;
|
|
16
|
+
/** Earliest selectable month (inclusive). Prev arrow disables at this bound. */
|
|
17
|
+
minValue?: MonthPickerValue;
|
|
18
|
+
/** Latest selectable month (inclusive). Next arrow disables at this bound — e.g. cap at the current month. */
|
|
19
|
+
maxValue?: MonthPickerValue;
|
|
12
20
|
/** BCP 47 locale tag. Built-in: 'en' | 'es' | 'pt' | 'fr'. For other locales supply formatLabel. */
|
|
13
21
|
locale?: string;
|
|
14
22
|
/** Custom label formatter. Takes precedence over locale. */
|
|
15
23
|
formatLabel?: (value: MonthPickerValue) => string;
|
|
16
24
|
style?: ViewStyle;
|
|
17
25
|
}
|
|
18
|
-
declare function MonthPicker({ value, onChange, locale, formatLabel, style }: MonthPickerProps): React.JSX.Element;
|
|
26
|
+
declare function MonthPicker({ value, onChange, minValue, maxValue, locale, formatLabel, style }: MonthPickerProps): React.JSX.Element;
|
|
19
27
|
|
|
20
|
-
export { MonthPicker, type MonthPickerProps, type MonthPickerValue };
|
|
28
|
+
export { MonthPicker, type MonthPickerProps, type MonthPickerValue, dateToMonthPickerValue, monthPickerValueToDate };
|
package/dist/MonthPicker.js
CHANGED
|
@@ -9,18 +9,65 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
9
9
|
|
|
10
10
|
var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
13
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
14
|
+
}) : x)(function(x) {
|
|
15
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
16
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
+
});
|
|
13
18
|
var _haptics = null;
|
|
19
|
+
var _hapticsLoaded = false;
|
|
14
20
|
async function getHaptics() {
|
|
15
21
|
if (reactNative.Platform.OS === "web") return null;
|
|
16
|
-
if (!
|
|
17
|
-
|
|
22
|
+
if (!_hapticsLoaded) {
|
|
23
|
+
_hapticsLoaded = true;
|
|
24
|
+
try {
|
|
25
|
+
_haptics = await import('expo-haptics');
|
|
26
|
+
} catch {
|
|
27
|
+
_haptics = null;
|
|
28
|
+
}
|
|
18
29
|
}
|
|
19
30
|
return _haptics;
|
|
20
31
|
}
|
|
32
|
+
var _pulsar = null;
|
|
33
|
+
var _pulsarChecked = false;
|
|
34
|
+
var _pulsarAvailable = false;
|
|
35
|
+
function isPulsarNativeRegistered() {
|
|
36
|
+
try {
|
|
37
|
+
const g = globalThis;
|
|
38
|
+
if (typeof g.__turboModuleProxy === "function") {
|
|
39
|
+
return g.__turboModuleProxy("RNPulsar") != null;
|
|
40
|
+
}
|
|
41
|
+
return reactNative.NativeModules?.RNPulsar != null;
|
|
42
|
+
} catch {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function getPulsar() {
|
|
47
|
+
if (reactNative.Platform.OS === "web") return null;
|
|
48
|
+
if (!_pulsarChecked) {
|
|
49
|
+
_pulsarChecked = true;
|
|
50
|
+
try {
|
|
51
|
+
if (isPulsarNativeRegistered()) {
|
|
52
|
+
_pulsar = __require("react-native-pulsar");
|
|
53
|
+
_pulsarAvailable = true;
|
|
54
|
+
}
|
|
55
|
+
} catch {
|
|
56
|
+
_pulsar = null;
|
|
57
|
+
_pulsarAvailable = false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return _pulsarAvailable ? _pulsar : null;
|
|
61
|
+
}
|
|
21
62
|
function selectionAsync() {
|
|
22
63
|
if (reactNative.Platform.OS === "web") return;
|
|
23
|
-
getHaptics().then((h) =>
|
|
64
|
+
getHaptics().then((h) => {
|
|
65
|
+
if (h) {
|
|
66
|
+
h.selectionAsync();
|
|
67
|
+
} else {
|
|
68
|
+
getPulsar()?.Presets.System.selection();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
24
71
|
}
|
|
25
72
|
|
|
26
73
|
// src/theme/colorUtils.ts
|
|
@@ -153,38 +200,47 @@ var MONTH_NAMES = {
|
|
|
153
200
|
pt: ["janeiro", "fevereiro", "mar\xE7o", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"],
|
|
154
201
|
fr: ["janvier", "f\xE9vrier", "mars", "avril", "mai", "juin", "juillet", "ao\xFBt", "septembre", "octobre", "novembre", "d\xE9cembre"]
|
|
155
202
|
};
|
|
156
|
-
function
|
|
203
|
+
function dateToMonthPickerValue(date) {
|
|
204
|
+
return { month: date.getMonth() + 1, year: date.getFullYear() };
|
|
205
|
+
}
|
|
206
|
+
function monthPickerValueToDate(value) {
|
|
207
|
+
return new Date(value.year, value.month - 1, 1);
|
|
208
|
+
}
|
|
209
|
+
var toIndex = (v) => v.year * 12 + (v.month - 1);
|
|
210
|
+
var fromIndex = (i) => ({ year: Math.floor(i / 12), month: i % 12 + 1 });
|
|
211
|
+
function MonthPicker({ value, onChange, minValue, maxValue, locale = "en", formatLabel, style }) {
|
|
157
212
|
const { colors } = useTheme();
|
|
213
|
+
const index = toIndex(value);
|
|
214
|
+
const minIndex = minValue ? toIndex(minValue) : -Infinity;
|
|
215
|
+
const maxIndex = maxValue ? toIndex(maxValue) : Infinity;
|
|
216
|
+
const prevDisabled = index - 1 < minIndex;
|
|
217
|
+
const nextDisabled = index + 1 > maxIndex;
|
|
158
218
|
const getLabel = () => {
|
|
159
219
|
if (formatLabel) return formatLabel(value);
|
|
160
220
|
const names = MONTH_NAMES[locale] ?? MONTH_NAMES.en;
|
|
161
221
|
return `${names[value.month - 1]} ${value.year}`;
|
|
162
222
|
};
|
|
163
223
|
const handlePrev = () => {
|
|
224
|
+
if (prevDisabled) return;
|
|
164
225
|
selectionAsync();
|
|
165
|
-
|
|
166
|
-
onChange({ month: 12, year: value.year - 1 });
|
|
167
|
-
} else {
|
|
168
|
-
onChange({ month: value.month - 1, year: value.year });
|
|
169
|
-
}
|
|
226
|
+
onChange(fromIndex(index - 1));
|
|
170
227
|
};
|
|
171
228
|
const handleNext = () => {
|
|
229
|
+
if (nextDisabled) return;
|
|
172
230
|
selectionAsync();
|
|
173
|
-
|
|
174
|
-
onChange({ month: 1, year: value.year + 1 });
|
|
175
|
-
} else {
|
|
176
|
-
onChange({ month: value.month + 1, year: value.year });
|
|
177
|
-
}
|
|
231
|
+
onChange(fromIndex(index + 1));
|
|
178
232
|
};
|
|
179
233
|
return /* @__PURE__ */ React2__default.default.createElement(reactNative.View, { style: [styles.container, style], accessibilityRole: "adjustable", accessibilityLabel: getLabel() }, /* @__PURE__ */ React2__default.default.createElement(
|
|
180
234
|
reactNative.TouchableOpacity,
|
|
181
235
|
{
|
|
182
|
-
style: styles.arrow,
|
|
236
|
+
style: [styles.arrow, prevDisabled && styles.arrowDisabled],
|
|
183
237
|
onPress: handlePrev,
|
|
238
|
+
disabled: prevDisabled,
|
|
184
239
|
activeOpacity: 0.6,
|
|
185
240
|
touchSoundDisabled: true,
|
|
186
241
|
accessibilityRole: "button",
|
|
187
242
|
accessibilityLabel: "Previous month",
|
|
243
|
+
accessibilityState: { disabled: prevDisabled },
|
|
188
244
|
hitSlop: { top: 8, bottom: 8, left: 8, right: 8 }
|
|
189
245
|
},
|
|
190
246
|
/* @__PURE__ */ React2__default.default.createElement(vectorIcons.Entypo, { name: "chevron-left", size: 22, color: colors.foreground })
|
|
@@ -199,12 +255,14 @@ function MonthPicker({ value, onChange, locale = "en", formatLabel, style }) {
|
|
|
199
255
|
), /* @__PURE__ */ React2__default.default.createElement(
|
|
200
256
|
reactNative.TouchableOpacity,
|
|
201
257
|
{
|
|
202
|
-
style: styles.arrow,
|
|
258
|
+
style: [styles.arrow, nextDisabled && styles.arrowDisabled],
|
|
203
259
|
onPress: handleNext,
|
|
260
|
+
disabled: nextDisabled,
|
|
204
261
|
activeOpacity: 0.6,
|
|
205
262
|
touchSoundDisabled: true,
|
|
206
263
|
accessibilityRole: "button",
|
|
207
264
|
accessibilityLabel: "Next month",
|
|
265
|
+
accessibilityState: { disabled: nextDisabled },
|
|
208
266
|
hitSlop: { top: 8, bottom: 8, left: 8, right: 8 }
|
|
209
267
|
},
|
|
210
268
|
/* @__PURE__ */ React2__default.default.createElement(vectorIcons.Entypo, { name: "chevron-right", size: 22, color: colors.foreground })
|
|
@@ -222,6 +280,9 @@ var styles = reactNative.StyleSheet.create({
|
|
|
222
280
|
alignItems: "center",
|
|
223
281
|
justifyContent: "center"
|
|
224
282
|
},
|
|
283
|
+
arrowDisabled: {
|
|
284
|
+
opacity: 0.3
|
|
285
|
+
},
|
|
225
286
|
label: {
|
|
226
287
|
fontFamily: "Sohne-Medium",
|
|
227
288
|
fontSize: ms(17),
|
|
@@ -232,3 +293,5 @@ var styles = reactNative.StyleSheet.create({
|
|
|
232
293
|
});
|
|
233
294
|
|
|
234
295
|
exports.MonthPicker = MonthPicker;
|
|
296
|
+
exports.dateToMonthPickerValue = dateToMonthPickerValue;
|
|
297
|
+
exports.monthPickerValueToDate = monthPickerValueToDate;
|
package/dist/MonthPicker.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { MonthPicker } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { MonthPicker, dateToMonthPickerValue, monthPickerValueToDate } from './chunk-GD6KXMG5.mjs';
|
|
2
|
+
import './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import './chunk-2CE3TQVY.mjs';
|
|
5
|
+
import './chunk-Y6FXYEAI.mjs';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface PagerDotsProps {
|
|
5
|
+
/** Total number of pages. */
|
|
6
|
+
count: number;
|
|
7
|
+
/** Index of the active page (0-based). */
|
|
8
|
+
activeIndex: number;
|
|
9
|
+
/** Called when a dot is tapped — omit to make dots non-interactive. */
|
|
10
|
+
onDotPress?: (index: number) => void;
|
|
11
|
+
/** Show previous/next buttons. If function provided, called on button press. If `true`, uses `onDotPress(activeIndex ± 1)`. */
|
|
12
|
+
showControls?: boolean | {
|
|
13
|
+
onPrevious?: () => void;
|
|
14
|
+
onNext?: () => void;
|
|
15
|
+
};
|
|
16
|
+
/** Diameter of an inactive dot (dp). Defaults to 8. */
|
|
17
|
+
dotSize?: number;
|
|
18
|
+
/** Gap between dots (dp). Defaults to 8. */
|
|
19
|
+
spacing?: number;
|
|
20
|
+
/** Active dot color. Defaults to theme `primary`. */
|
|
21
|
+
activeColor?: string;
|
|
22
|
+
/** Inactive dot color. Defaults to theme `border`. */
|
|
23
|
+
inactiveColor?: string;
|
|
24
|
+
style?: ViewStyle;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Animated page indicator for carousels / document pagers. The active dot
|
|
28
|
+
* stretches into a pill and color-crossfades — all on the UI thread.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <PagerDots count={pages.length} activeIndex={page} onDotPress={setPage} />
|
|
32
|
+
*/
|
|
33
|
+
declare function PagerDots({ count, activeIndex, onDotPress, showControls, dotSize, spacing, activeColor, inactiveColor, style, }: PagerDotsProps): React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { PagerDots, type PagerDotsProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface PagerDotsProps {
|
|
5
|
+
/** Total number of pages. */
|
|
6
|
+
count: number;
|
|
7
|
+
/** Index of the active page (0-based). */
|
|
8
|
+
activeIndex: number;
|
|
9
|
+
/** Called when a dot is tapped — omit to make dots non-interactive. */
|
|
10
|
+
onDotPress?: (index: number) => void;
|
|
11
|
+
/** Show previous/next buttons. If function provided, called on button press. If `true`, uses `onDotPress(activeIndex ± 1)`. */
|
|
12
|
+
showControls?: boolean | {
|
|
13
|
+
onPrevious?: () => void;
|
|
14
|
+
onNext?: () => void;
|
|
15
|
+
};
|
|
16
|
+
/** Diameter of an inactive dot (dp). Defaults to 8. */
|
|
17
|
+
dotSize?: number;
|
|
18
|
+
/** Gap between dots (dp). Defaults to 8. */
|
|
19
|
+
spacing?: number;
|
|
20
|
+
/** Active dot color. Defaults to theme `primary`. */
|
|
21
|
+
activeColor?: string;
|
|
22
|
+
/** Inactive dot color. Defaults to theme `border`. */
|
|
23
|
+
inactiveColor?: string;
|
|
24
|
+
style?: ViewStyle;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Animated page indicator for carousels / document pagers. The active dot
|
|
28
|
+
* stretches into a pill and color-crossfades — all on the UI thread.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <PagerDots count={pages.length} activeIndex={page} onDotPress={setPage} />
|
|
32
|
+
*/
|
|
33
|
+
declare function PagerDots({ count, activeIndex, onDotPress, showControls, dotSize, spacing, activeColor, inactiveColor, style, }: PagerDotsProps): React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { PagerDots, type PagerDotsProps };
|