@retray-dev/ui-kit 10.1.0 → 10.2.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 +136 -5
- package/README.md +4 -4
- package/dist/Accordion.js +1 -1
- package/dist/Accordion.mjs +2 -2
- package/dist/AlertBanner.js +1 -1
- package/dist/AlertBanner.mjs +2 -2
- package/dist/AppHeader.js +1 -1
- package/dist/AppHeader.mjs +3 -3
- package/dist/Badge.js +1 -1
- package/dist/Badge.mjs +2 -2
- package/dist/Button.js +1 -1
- package/dist/Button.mjs +2 -2
- package/dist/CategoryStrip.js +1 -1
- package/dist/CategoryStrip.mjs +2 -2
- package/dist/Chip.js +1 -1
- package/dist/Chip.mjs +2 -2
- package/dist/ConfirmDialog.js +1 -1
- package/dist/ConfirmDialog.mjs +3 -3
- package/dist/CurrencyInput.js +1 -1
- package/dist/CurrencyInput.mjs +3 -3
- package/dist/DetailRow.d.mts +1 -1
- package/dist/DetailRow.d.ts +1 -1
- package/dist/DetailRow.js +1 -1
- package/dist/DetailRow.mjs +2 -2
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.mjs +3 -3
- package/dist/ErrorBoundary.js +1 -1
- package/dist/ErrorBoundary.mjs +2 -2
- package/dist/IconButton.js +1 -1
- package/dist/IconButton.mjs +2 -2
- package/dist/IconPicker.d.mts +17 -0
- package/dist/IconPicker.d.ts +17 -0
- package/dist/IconPicker.js +997 -0
- package/dist/IconPicker.mjs +7 -0
- package/dist/ImageUpload.d.mts +3 -1
- package/dist/ImageUpload.d.ts +3 -1
- package/dist/ImageUpload.js +28 -10
- package/dist/ImageUpload.mjs +1 -1
- package/dist/ImageViewer.js +1 -1
- package/dist/ImageViewer.mjs +4 -4
- package/dist/Input.js +1 -1
- package/dist/Input.mjs +2 -2
- package/dist/LabelValue.js +1 -1
- package/dist/LabelValue.mjs +2 -2
- package/dist/ListItem.js +1 -1
- package/dist/ListItem.mjs +2 -2
- package/dist/MediaCard.js +1 -1
- package/dist/MediaCard.mjs +2 -2
- package/dist/MenuItem.js +1 -1
- package/dist/MenuItem.mjs +2 -2
- package/dist/NumberStepper.d.mts +19 -0
- package/dist/NumberStepper.d.ts +19 -0
- package/dist/NumberStepper.js +410 -0
- package/dist/NumberStepper.mjs +9 -0
- package/dist/PagerDots.js +1 -1
- package/dist/PagerDots.mjs +2 -2
- package/dist/PricingCard.js +1 -1
- package/dist/PricingCard.mjs +4 -4
- package/dist/SelectableGrid.js +1 -1
- package/dist/SelectableGrid.mjs +2 -2
- package/dist/SheetSelect.js +1 -1
- package/dist/SheetSelect.mjs +2 -2
- package/dist/TabBar.js +1 -1
- package/dist/TabBar.mjs +2 -2
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.mjs +2 -2
- package/dist/Toggle.js +1 -1
- package/dist/Toggle.mjs +2 -2
- package/dist/chunk-53Z3NYGE.mjs +742 -0
- package/dist/{chunk-VQ57HWPL.mjs → chunk-6L4G6PBT.mjs} +1 -1
- package/dist/{chunk-6OAZJ577.mjs → chunk-6SECQ2ZF.mjs} +2 -2
- package/dist/{chunk-KIHCWCWL.mjs → chunk-7LWRKMF5.mjs} +1 -1
- package/dist/{chunk-4I7D47FH.mjs → chunk-AJRVDP2H.mjs} +3 -3
- package/dist/{chunk-6MKGPAR2.mjs → chunk-BEMIQXXU.mjs} +1 -1
- package/dist/chunk-BUMAMSTZ.mjs +126 -0
- package/dist/{chunk-UREA2GYY.mjs → chunk-DYT7BG5I.mjs} +1 -1
- package/dist/{chunk-WOEYDUJZ.mjs → chunk-ELXBDILQ.mjs} +2 -2
- package/dist/{chunk-A4MDAP7G.mjs → chunk-FCSSQK3L.mjs} +1 -1
- package/dist/{chunk-2TFTAWVJ.mjs → chunk-HTHGSXFG.mjs} +1 -1
- package/dist/{chunk-VGTDN7SW.mjs → chunk-IX3NYLYQ.mjs} +1 -1
- package/dist/{chunk-T7XZ7H7Y.mjs → chunk-KA7LTET3.mjs} +17 -3
- package/dist/{chunk-URI2WBIV.mjs → chunk-KOO4WITD.mjs} +1 -1
- package/dist/{chunk-JUXSWN54.mjs → chunk-NMU5FMQJ.mjs} +1 -1
- package/dist/{chunk-LXJIIOYQ.mjs → chunk-RYZC432S.mjs} +1 -1
- package/dist/{chunk-JB67UOB5.mjs → chunk-S2R7UVOE.mjs} +1 -1
- package/dist/{chunk-ZUR7AU5R.mjs → chunk-SXLKNTA4.mjs} +1 -1
- package/dist/{chunk-3U4SSNWP.mjs → chunk-T2KCAHOS.mjs} +1 -1
- package/dist/{chunk-ZJKGQMYH.mjs → chunk-TB6SD2FT.mjs} +1 -1
- package/dist/{chunk-AZJF2BLK.mjs → chunk-TBNZHU6C.mjs} +1 -1
- package/dist/{chunk-Y4GL2MHX.mjs → chunk-TZDGAP5N.mjs} +28 -10
- package/dist/{chunk-CZCQZHG6.mjs → chunk-U2XJFYED.mjs} +1 -1
- package/dist/{chunk-TERDKCLE.mjs → chunk-VF2ATYN3.mjs} +1 -1
- package/dist/{chunk-OHBNABL5.mjs → chunk-VKID2D2I.mjs} +1 -1
- package/dist/{chunk-KZL5VTYK.mjs → chunk-WYEUNUTP.mjs} +1 -1
- package/dist/{chunk-DJ7RN37L.mjs → chunk-YJ7I257J.mjs} +1 -1
- package/dist/{chunk-NA7PARID.mjs → chunk-Z4VHZ7B5.mjs} +1 -1
- package/dist/{chunk-MLF3EZFW.mjs → chunk-Z6SFHN6T.mjs} +1 -1
- package/dist/{chunk-4K625MVM.mjs → chunk-ZZ2R6KZ3.mjs} +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +892 -12
- package/dist/index.mjs +33 -31
- package/package.json +1 -1
- package/src/components/DetailRow/DetailRow.tsx +1 -1
- package/src/components/IconPicker/IconPicker.tsx +383 -0
- package/src/components/IconPicker/index.ts +1 -0
- package/src/components/ImageUpload/ImageUpload.tsx +34 -12
- package/src/components/NumberStepper/NumberStepper.tsx +147 -0
- package/src/components/NumberStepper/index.ts +1 -0
- package/src/index.ts +3 -1
- package/src/utils/curatedIcons.ts +286 -0
- package/src/utils/icons.ts +20 -2
|
@@ -2,7 +2,7 @@ import { usePressScale } from './chunk-YNROWHQJ.mjs';
|
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { PRESS_SCALE, COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
4
4
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
5
|
-
import { renderIcon } from './chunk-
|
|
5
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
6
6
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
7
7
|
import { ms, s, vs } from './chunk-2CE3TQVY.mjs';
|
|
8
8
|
import React, { useCallback } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { renderIcon } from './chunk-
|
|
1
|
+
import { Button } from './chunk-HTHGSXFG.mjs';
|
|
2
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { s, vs, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
4
|
-
import { renderIcon } from './chunk-
|
|
4
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
5
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
6
|
import { vs, s, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Badge } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
1
|
+
import { Badge } from './chunk-VF2ATYN3.mjs';
|
|
2
|
+
import { Button } from './chunk-HTHGSXFG.mjs';
|
|
3
3
|
import { RADIUS, SHADOWS } from './chunk-QY3X2UYR.mjs';
|
|
4
|
-
import { renderIcon } from './chunk-
|
|
4
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
5
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
6
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
2
|
-
import { renderIcon } from './chunk-
|
|
2
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { s, vs, ms } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React from 'react';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
4
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
|
+
import { s, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
9
|
+
|
|
10
|
+
var sizeConfig = {
|
|
11
|
+
sm: { button: s(40), icon: 16, valueFontSize: ms(18), valueLineHeight: mvs(24), valueMinWidth: s(32) },
|
|
12
|
+
md: { button: s(44), icon: 18, valueFontSize: ms(22), valueLineHeight: mvs(28), valueMinWidth: s(36) },
|
|
13
|
+
lg: { button: s(52), icon: 22, valueFontSize: ms(26), valueLineHeight: mvs(32), valueMinWidth: s(40) }
|
|
14
|
+
};
|
|
15
|
+
function NumberStepperBase({
|
|
16
|
+
value,
|
|
17
|
+
onValueChange,
|
|
18
|
+
min = 1,
|
|
19
|
+
max = 99,
|
|
20
|
+
step = 1,
|
|
21
|
+
size = "md",
|
|
22
|
+
disabled = false,
|
|
23
|
+
style,
|
|
24
|
+
accessibilityLabel
|
|
25
|
+
}) {
|
|
26
|
+
const { colors } = useTheme();
|
|
27
|
+
const canDecrement = value > min && !disabled;
|
|
28
|
+
const canIncrement = value < max && !disabled;
|
|
29
|
+
const handleDecrement = () => {
|
|
30
|
+
if (!canDecrement) return;
|
|
31
|
+
impactLight();
|
|
32
|
+
onValueChange(Math.max(min, value - step));
|
|
33
|
+
};
|
|
34
|
+
const handleIncrement = () => {
|
|
35
|
+
if (!canIncrement) return;
|
|
36
|
+
impactLight();
|
|
37
|
+
onValueChange(Math.min(max, value + step));
|
|
38
|
+
};
|
|
39
|
+
const { button: buttonSize, icon: iconSize, valueFontSize, valueLineHeight, valueMinWidth } = sizeConfig[size];
|
|
40
|
+
const displayValue = String(value);
|
|
41
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.container, style] }, /* @__PURE__ */ React.createElement(
|
|
42
|
+
PressableButton,
|
|
43
|
+
{
|
|
44
|
+
style: [
|
|
45
|
+
styles.button,
|
|
46
|
+
{
|
|
47
|
+
width: buttonSize,
|
|
48
|
+
height: buttonSize,
|
|
49
|
+
backgroundColor: colors.surface,
|
|
50
|
+
borderColor: colors.border
|
|
51
|
+
},
|
|
52
|
+
!canDecrement && styles.buttonDisabled
|
|
53
|
+
],
|
|
54
|
+
enabled: canDecrement,
|
|
55
|
+
onPress: handleDecrement,
|
|
56
|
+
rippleColor: "transparent",
|
|
57
|
+
touchSoundDisabled: true,
|
|
58
|
+
accessibilityRole: "button",
|
|
59
|
+
accessibilityLabel: `Decrease, current value ${displayValue}`,
|
|
60
|
+
accessibilityState: { disabled: !canDecrement }
|
|
61
|
+
},
|
|
62
|
+
renderIcon("minus", iconSize, canDecrement ? colors.foreground : colors.foregroundMuted)
|
|
63
|
+
), /* @__PURE__ */ React.createElement(
|
|
64
|
+
Text,
|
|
65
|
+
{
|
|
66
|
+
style: [
|
|
67
|
+
styles.value,
|
|
68
|
+
{
|
|
69
|
+
color: colors.foreground,
|
|
70
|
+
fontSize: valueFontSize,
|
|
71
|
+
lineHeight: valueLineHeight,
|
|
72
|
+
minWidth: valueMinWidth
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
allowFontScaling: true,
|
|
76
|
+
accessibilityLabel: accessibilityLabel ?? `Quantity: ${displayValue}`,
|
|
77
|
+
accessibilityRole: "text"
|
|
78
|
+
},
|
|
79
|
+
displayValue
|
|
80
|
+
), /* @__PURE__ */ React.createElement(
|
|
81
|
+
PressableButton,
|
|
82
|
+
{
|
|
83
|
+
style: [
|
|
84
|
+
styles.button,
|
|
85
|
+
{
|
|
86
|
+
width: buttonSize,
|
|
87
|
+
height: buttonSize,
|
|
88
|
+
backgroundColor: colors.surface,
|
|
89
|
+
borderColor: colors.border
|
|
90
|
+
},
|
|
91
|
+
!canIncrement && styles.buttonDisabled
|
|
92
|
+
],
|
|
93
|
+
enabled: canIncrement,
|
|
94
|
+
onPress: handleIncrement,
|
|
95
|
+
rippleColor: "transparent",
|
|
96
|
+
touchSoundDisabled: true,
|
|
97
|
+
accessibilityRole: "button",
|
|
98
|
+
accessibilityLabel: `Increase, current value ${displayValue}`,
|
|
99
|
+
accessibilityState: { disabled: !canIncrement }
|
|
100
|
+
},
|
|
101
|
+
renderIcon("plus", iconSize, canIncrement ? colors.foreground : colors.foregroundMuted)
|
|
102
|
+
));
|
|
103
|
+
}
|
|
104
|
+
var NumberStepper = React.memo(NumberStepperBase);
|
|
105
|
+
var styles = StyleSheet.create({
|
|
106
|
+
container: {
|
|
107
|
+
flexDirection: "row",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
gap: s(12)
|
|
110
|
+
},
|
|
111
|
+
button: {
|
|
112
|
+
borderRadius: RADIUS.md,
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
justifyContent: "center",
|
|
115
|
+
borderWidth: 1.5
|
|
116
|
+
},
|
|
117
|
+
buttonDisabled: {
|
|
118
|
+
opacity: 0.35
|
|
119
|
+
},
|
|
120
|
+
value: {
|
|
121
|
+
fontFamily: "Sohne-Medium",
|
|
122
|
+
textAlign: "center"
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export { NumberStepper };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PressableChip } from './chunk-3DKJ2GIC.mjs';
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
4
|
-
import { renderIcon } from './chunk-
|
|
4
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
5
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
6
|
import { s, mvs, ms, vs } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PagerDots } from './chunk-
|
|
2
|
-
import { IconButton } from './chunk-
|
|
1
|
+
import { PagerDots } from './chunk-ZZ2R6KZ3.mjs';
|
|
2
|
+
import { IconButton } from './chunk-T2KCAHOS.mjs';
|
|
3
3
|
import { s, vs } from './chunk-2CE3TQVY.mjs';
|
|
4
4
|
import React, { useState, useCallback } from 'react';
|
|
5
5
|
import { StyleSheet, useWindowDimensions, Dimensions, Modal, View, ScrollView, Image } from 'react-native';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
2
|
import { impactMedium } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { TYPOGRAPHY, RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
4
|
-
import { renderIcon } from './chunk-
|
|
4
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
5
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
6
|
import { vs, s, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
@@ -2,7 +2,7 @@ import { useHover, usePressScale } from './chunk-YNROWHQJ.mjs';
|
|
|
2
2
|
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { SPRINGS, PRESS_SCALE } from './chunk-DVK4G2GT.mjs';
|
|
4
4
|
import { RADIUS, SHADOWS } from './chunk-QY3X2UYR.mjs';
|
|
5
|
-
import { renderIcon } from './chunk-
|
|
5
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
6
6
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
7
7
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
8
8
|
import React from 'react';
|
|
@@ -23,9 +23,9 @@ function configureIconFamilies(families) {
|
|
|
23
23
|
activeFamilies = order.length > 0 ? order : ALL_FAMILIES;
|
|
24
24
|
resolvedCache = null;
|
|
25
25
|
}
|
|
26
|
-
function buildCache() {
|
|
26
|
+
function buildCache(families) {
|
|
27
27
|
const cache = /* @__PURE__ */ new Map();
|
|
28
|
-
for (const family of activeFamilies) {
|
|
28
|
+
for (const family of families ?? activeFamilies) {
|
|
29
29
|
const glyphMap = family.getGlyphMap();
|
|
30
30
|
for (const iconName of Object.keys(glyphMap)) {
|
|
31
31
|
cache.set(iconName, family);
|
|
@@ -39,6 +39,20 @@ function resolveFamily(name) {
|
|
|
39
39
|
}
|
|
40
40
|
return resolvedCache.get(name) ?? null;
|
|
41
41
|
}
|
|
42
|
+
var cachedIconNames = null;
|
|
43
|
+
function getValidIconNames(families) {
|
|
44
|
+
if (families && families.length > 0) {
|
|
45
|
+
const tempFamilies = families.map((n) => ALL_FAMILIES.find((f) => f.name === n)).filter((f) => f !== void 0);
|
|
46
|
+
if (tempFamilies.length === 0) return [];
|
|
47
|
+
const cache = buildCache(tempFamilies);
|
|
48
|
+
return Array.from(cache.keys());
|
|
49
|
+
}
|
|
50
|
+
if (!cachedIconNames) {
|
|
51
|
+
const cache = buildCache();
|
|
52
|
+
cachedIconNames = Array.from(cache.keys());
|
|
53
|
+
}
|
|
54
|
+
return cachedIconNames;
|
|
55
|
+
}
|
|
42
56
|
function Icon({ name, size, color, family }) {
|
|
43
57
|
let resolved = null;
|
|
44
58
|
if (family) {
|
|
@@ -54,4 +68,4 @@ function renderIcon(name, size, color) {
|
|
|
54
68
|
return React.createElement(Icon, { name, size, color });
|
|
55
69
|
}
|
|
56
70
|
|
|
57
|
-
export { Icon, configureIconFamilies, renderIcon };
|
|
71
|
+
export { Icon, configureIconFamilies, getValidIconNames, renderIcon };
|
|
@@ -2,7 +2,7 @@ import { PressableChip } from './chunk-3DKJ2GIC.mjs';
|
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
4
4
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
5
|
-
import { renderIcon } from './chunk-
|
|
5
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
6
6
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
7
7
|
import { ms, mvs, s, vs } from './chunk-2CE3TQVY.mjs';
|
|
8
8
|
import React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
-
import { renderIcon } from './chunk-
|
|
3
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
4
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
5
|
import { ms, vs, s, mvs } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
2
|
-
import { renderIcon } from './chunk-
|
|
2
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { ms, s, vs } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React, { useState } from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
2
|
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
-
import { renderIcon } from './chunk-
|
|
3
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
4
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
5
|
import { s, ms } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PressableRow } from './chunk-3DKJ2GIC.mjs';
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
4
|
-
import { renderIcon } from './chunk-
|
|
4
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
5
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
6
|
import { vs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
@@ -13,6 +13,7 @@ function ImageUpload({
|
|
|
13
13
|
onChange,
|
|
14
14
|
loading = false,
|
|
15
15
|
placeholder = "Tap to add image",
|
|
16
|
+
showPlaceholderText = true,
|
|
16
17
|
width,
|
|
17
18
|
height = 200,
|
|
18
19
|
borderRadius = RADIUS.lg,
|
|
@@ -25,23 +26,31 @@ function ImageUpload({
|
|
|
25
26
|
const handlePress = async () => {
|
|
26
27
|
if (disabled || loading) return;
|
|
27
28
|
impactLight();
|
|
28
|
-
let
|
|
29
|
+
let picker;
|
|
29
30
|
try {
|
|
30
|
-
|
|
31
|
+
const mod = await import('expo-image-picker/build/ExponentImagePicker');
|
|
32
|
+
picker = mod.default;
|
|
31
33
|
} catch {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
try {
|
|
35
|
+
picker = await import('expo-image-picker');
|
|
36
|
+
} catch {
|
|
37
|
+
if (__DEV__) console.warn("[ImageUpload] expo-image-picker not installed.");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
34
40
|
}
|
|
35
41
|
if (Platform.OS !== "web") {
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
try {
|
|
43
|
+
const { status } = await picker.requestMediaLibraryPermissionsAsync();
|
|
44
|
+
if (status !== "granted") return;
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
38
47
|
}
|
|
39
|
-
const result = await
|
|
48
|
+
const result = await picker.launchImageLibraryAsync({
|
|
40
49
|
mediaTypes: ["images"],
|
|
41
50
|
allowsEditing: true,
|
|
42
51
|
quality: 0.8
|
|
43
52
|
});
|
|
44
|
-
if (!result.canceled && result.assets[0]) {
|
|
53
|
+
if (!result.canceled && result.assets?.[0]) {
|
|
45
54
|
onChange?.(result.assets[0].uri);
|
|
46
55
|
}
|
|
47
56
|
};
|
|
@@ -74,7 +83,15 @@ function ImageUpload({
|
|
|
74
83
|
style: [StyleSheet.absoluteFillObject, { borderRadius }],
|
|
75
84
|
resizeMode
|
|
76
85
|
}
|
|
77
|
-
) : /* @__PURE__ */ React.createElement(View, { style: styles.placeholder }, /* @__PURE__ */ React.createElement(Feather, { name: "image", size: ms(28), color: colors.foregroundMuted }), /* @__PURE__ */ React.createElement(
|
|
86
|
+
) : /* @__PURE__ */ React.createElement(View, { style: styles.placeholder }, /* @__PURE__ */ React.createElement(Feather, { name: "image", size: ms(28), color: colors.foregroundMuted }), showPlaceholderText ? /* @__PURE__ */ React.createElement(
|
|
87
|
+
Text,
|
|
88
|
+
{
|
|
89
|
+
style: [styles.placeholderText, { color: colors.foregroundMuted }],
|
|
90
|
+
numberOfLines: 1,
|
|
91
|
+
allowFontScaling: true
|
|
92
|
+
},
|
|
93
|
+
placeholder
|
|
94
|
+
) : null),
|
|
78
95
|
loading ? /* @__PURE__ */ React.createElement(View, { style: [styles.loadingOverlay, { backgroundColor: colors.overlay }] }, /* @__PURE__ */ React.createElement(Spinner, { size: "md" })) : null,
|
|
79
96
|
value && !loading ? /* @__PURE__ */ React.createElement(View, { style: styles.editBadge, pointerEvents: "none" }, /* @__PURE__ */ React.createElement(View, { style: [styles.editBadgeInner, { backgroundColor: colors.overlay }] }, /* @__PURE__ */ React.createElement(Feather, { name: "edit-2", size: ms(12), color: "#fff" }))) : null
|
|
80
97
|
);
|
|
@@ -88,7 +105,8 @@ var styles = StyleSheet.create({
|
|
|
88
105
|
},
|
|
89
106
|
placeholderText: {
|
|
90
107
|
fontFamily: "Sohne-Regular",
|
|
91
|
-
fontSize: ms(13)
|
|
108
|
+
fontSize: ms(13),
|
|
109
|
+
textAlign: "center"
|
|
92
110
|
},
|
|
93
111
|
loadingOverlay: {
|
|
94
112
|
...StyleSheet.absoluteFillObject,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TIMINGS, EASINGS } from './chunk-DVK4G2GT.mjs';
|
|
2
|
-
import { renderIcon } from './chunk-
|
|
2
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { vs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React, { useState, useEffect } from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PressableRow } from './chunk-3DKJ2GIC.mjs';
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
4
|
-
import { renderIcon } from './chunk-
|
|
4
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
5
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
6
|
import { ms, s, mvs, vs } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
1
|
+
import { Button } from './chunk-HTHGSXFG.mjs';
|
|
2
2
|
import { impactMedium, notificationSuccess, selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { vs, mvs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { EASINGS, TIMINGS } from './chunk-DVK4G2GT.mjs';
|
|
3
|
-
import { renderIcon } from './chunk-
|
|
3
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
4
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
5
|
import { ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React, { useState } from 'react';
|
|
@@ -2,7 +2,7 @@ import { usePressScale } from './chunk-YNROWHQJ.mjs';
|
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { PRESS_SCALE } from './chunk-DVK4G2GT.mjs';
|
|
4
4
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
5
|
-
import { renderIcon } from './chunk-
|
|
5
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
6
6
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
7
7
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
8
8
|
import React, { useState } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
-
import { renderIcon } from './chunk-
|
|
2
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { ms, s, vs, mvs } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { SPRINGS } from './chunk-DVK4G2GT.mjs';
|
|
3
|
-
import { renderIcon } from './chunk-
|
|
3
|
+
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
4
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
5
|
import { s } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React, { useEffect } from 'react';
|
package/dist/index.d.mts
CHANGED
|
@@ -51,6 +51,8 @@ export { TabBar, TabBarItem, TabBarProps } from './TabBar.mjs';
|
|
|
51
51
|
export { ImageViewer, ImageViewerProps } from './ImageViewer.mjs';
|
|
52
52
|
export { SheetSelect, SheetSelectOption, SheetSelectProps } from './SheetSelect.mjs';
|
|
53
53
|
export { ImageUpload, ImageUploadProps } from './ImageUpload.mjs';
|
|
54
|
+
export { IconPicker, IconPickerProps } from './IconPicker.mjs';
|
|
55
|
+
export { NumberStepper, NumberStepperProps, NumberStepperSize } from './NumberStepper.mjs';
|
|
54
56
|
export { BottomSheetModalProvider, BottomSheetTextInput as SheetTextInput } from '@gorhom/bottom-sheet';
|
|
55
57
|
export { toast } from 'sonner-native';
|
|
56
58
|
import 'react-native';
|
|
@@ -97,6 +99,7 @@ interface IconProps {
|
|
|
97
99
|
* @example configureIconFamilies(['Feather', 'MaterialIcons'])
|
|
98
100
|
*/
|
|
99
101
|
declare function configureIconFamilies(families: IconFamily[]): void;
|
|
102
|
+
declare function getValidIconNames(families?: IconFamily[]): string[];
|
|
100
103
|
declare function Icon({ name, size, color, family }: IconProps): React.ReactElement | null;
|
|
101
104
|
declare function renderIcon(name: string, size: number, color: string): React.ReactElement | null;
|
|
102
105
|
|
|
@@ -386,4 +389,4 @@ type RadiusKey = keyof Radius;
|
|
|
386
389
|
type Typography = typeof TYPOGRAPHY;
|
|
387
390
|
type TypographyKey = keyof Typography;
|
|
388
391
|
|
|
389
|
-
export { BREAKPOINTS, ColorScheme, ICON_SIZES, Icon, type IconFamily, type IconProps, type IconSize, type IconSizeKey, RADIUS, type Radius, type RadiusKey, ResolvedColors, SHADOWS, SPACING, type Spacing, type SpacingKey, TYPOGRAPHY, Theme, ThemeColors, ThemeProvider, type ThemeProviderProps, type Typography, type TypographyKey, type UseConfirmDialogOptions, type UseConfirmDialogResult, configureIconFamilies, defaultDark, defaultLight, deriveColors, getResponsiveFontSize, impactHeavy, impactLight, impactMedium, notificationError, notificationSuccess, notificationWarning, renderIcon, richHaptics, selectionAsync, useConfirmDialog, useTheme };
|
|
392
|
+
export { BREAKPOINTS, ColorScheme, ICON_SIZES, Icon, type IconFamily, type IconProps, type IconSize, type IconSizeKey, RADIUS, type Radius, type RadiusKey, ResolvedColors, SHADOWS, SPACING, type Spacing, type SpacingKey, TYPOGRAPHY, Theme, ThemeColors, ThemeProvider, type ThemeProviderProps, type Typography, type TypographyKey, type UseConfirmDialogOptions, type UseConfirmDialogResult, configureIconFamilies, defaultDark, defaultLight, deriveColors, getResponsiveFontSize, getValidIconNames, impactHeavy, impactLight, impactMedium, notificationError, notificationSuccess, notificationWarning, renderIcon, richHaptics, selectionAsync, useConfirmDialog, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export { TabBar, TabBarItem, TabBarProps } from './TabBar.js';
|
|
|
51
51
|
export { ImageViewer, ImageViewerProps } from './ImageViewer.js';
|
|
52
52
|
export { SheetSelect, SheetSelectOption, SheetSelectProps } from './SheetSelect.js';
|
|
53
53
|
export { ImageUpload, ImageUploadProps } from './ImageUpload.js';
|
|
54
|
+
export { IconPicker, IconPickerProps } from './IconPicker.js';
|
|
55
|
+
export { NumberStepper, NumberStepperProps, NumberStepperSize } from './NumberStepper.js';
|
|
54
56
|
export { BottomSheetModalProvider, BottomSheetTextInput as SheetTextInput } from '@gorhom/bottom-sheet';
|
|
55
57
|
export { toast } from 'sonner-native';
|
|
56
58
|
import 'react-native';
|
|
@@ -97,6 +99,7 @@ interface IconProps {
|
|
|
97
99
|
* @example configureIconFamilies(['Feather', 'MaterialIcons'])
|
|
98
100
|
*/
|
|
99
101
|
declare function configureIconFamilies(families: IconFamily[]): void;
|
|
102
|
+
declare function getValidIconNames(families?: IconFamily[]): string[];
|
|
100
103
|
declare function Icon({ name, size, color, family }: IconProps): React.ReactElement | null;
|
|
101
104
|
declare function renderIcon(name: string, size: number, color: string): React.ReactElement | null;
|
|
102
105
|
|
|
@@ -386,4 +389,4 @@ type RadiusKey = keyof Radius;
|
|
|
386
389
|
type Typography = typeof TYPOGRAPHY;
|
|
387
390
|
type TypographyKey = keyof Typography;
|
|
388
391
|
|
|
389
|
-
export { BREAKPOINTS, ColorScheme, ICON_SIZES, Icon, type IconFamily, type IconProps, type IconSize, type IconSizeKey, RADIUS, type Radius, type RadiusKey, ResolvedColors, SHADOWS, SPACING, type Spacing, type SpacingKey, TYPOGRAPHY, Theme, ThemeColors, ThemeProvider, type ThemeProviderProps, type Typography, type TypographyKey, type UseConfirmDialogOptions, type UseConfirmDialogResult, configureIconFamilies, defaultDark, defaultLight, deriveColors, getResponsiveFontSize, impactHeavy, impactLight, impactMedium, notificationError, notificationSuccess, notificationWarning, renderIcon, richHaptics, selectionAsync, useConfirmDialog, useTheme };
|
|
392
|
+
export { BREAKPOINTS, ColorScheme, ICON_SIZES, Icon, type IconFamily, type IconProps, type IconSize, type IconSizeKey, RADIUS, type Radius, type RadiusKey, ResolvedColors, SHADOWS, SPACING, type Spacing, type SpacingKey, TYPOGRAPHY, Theme, ThemeColors, ThemeProvider, type ThemeProviderProps, type Typography, type TypographyKey, type UseConfirmDialogOptions, type UseConfirmDialogResult, configureIconFamilies, defaultDark, defaultLight, deriveColors, getResponsiveFontSize, getValidIconNames, impactHeavy, impactLight, impactMedium, notificationError, notificationSuccess, notificationWarning, renderIcon, richHaptics, selectionAsync, useConfirmDialog, useTheme };
|