@retray-dev/ui-kit 10.1.0 → 12.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 +419 -38
- package/README.md +14 -5
- package/dist/Accordion.js +1 -1
- package/dist/Accordion.mjs +3 -3
- package/dist/AlertBanner.js +1 -1
- package/dist/AlertBanner.mjs +3 -3
- package/dist/AppHeader.js +1 -1
- package/dist/AppHeader.mjs +4 -4
- package/dist/Avatar.mjs +2 -2
- package/dist/Badge.js +1 -1
- package/dist/Badge.mjs +3 -3
- package/dist/Button.js +1 -1
- package/dist/Button.mjs +3 -3
- package/dist/Card.mjs +2 -2
- package/dist/CategoryStrip.js +1 -1
- package/dist/CategoryStrip.mjs +3 -3
- package/dist/Checkbox.mjs +2 -2
- package/dist/Chip.js +1 -1
- package/dist/Chip.mjs +3 -3
- package/dist/ConfirmDialog.d.mts +1 -6
- package/dist/ConfirmDialog.d.ts +1 -6
- package/dist/ConfirmDialog.js +30 -24
- package/dist/ConfirmDialog.mjs +4 -4
- package/dist/CurrencyDisplay.mjs +2 -2
- package/dist/CurrencyInput.d.mts +3 -8
- package/dist/CurrencyInput.d.ts +3 -8
- package/dist/CurrencyInput.js +4 -2
- package/dist/CurrencyInput.mjs +4 -4
- package/dist/DetailRow.d.mts +1 -1
- package/dist/DetailRow.d.ts +1 -1
- package/dist/DetailRow.js +1 -1
- package/dist/DetailRow.mjs +3 -3
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.mjs +4 -4
- package/dist/ErrorBoundary.js +1 -1
- package/dist/ErrorBoundary.mjs +3 -3
- package/dist/Form.mjs +2 -2
- package/dist/IconButton.js +1 -1
- package/dist/IconButton.mjs +3 -3
- package/dist/IconPicker.d.mts +17 -0
- package/dist/IconPicker.d.ts +17 -0
- package/dist/IconPicker.js +1424 -0
- package/dist/IconPicker.mjs +8 -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 +3 -3
- package/dist/ImageViewer.js +1 -1
- package/dist/ImageViewer.mjs +5 -5
- package/dist/Input.js +1 -1
- package/dist/Input.mjs +3 -3
- package/dist/LabelValue.js +1 -1
- package/dist/LabelValue.mjs +3 -3
- package/dist/ListGroup.mjs +2 -2
- package/dist/ListItem.d.mts +7 -7
- package/dist/ListItem.d.ts +7 -7
- package/dist/ListItem.js +13 -8
- package/dist/ListItem.mjs +3 -3
- package/dist/MediaCard.js +1 -1
- package/dist/MediaCard.mjs +3 -3
- package/dist/MenuGroup.mjs +2 -2
- package/dist/MenuItem.js +1 -1
- package/dist/MenuItem.mjs +3 -3
- package/dist/MonthPicker.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 +3 -3
- package/dist/Pressable.d.mts +15 -7
- package/dist/Pressable.d.ts +15 -7
- package/dist/Pressable.js +7 -3
- package/dist/Pressable.mjs +1 -1
- package/dist/PricingCard.js +1 -1
- package/dist/PricingCard.mjs +5 -5
- package/dist/Progress.mjs +2 -2
- package/dist/RadioGroup.mjs +2 -2
- package/dist/RetrayProvider.mjs +3 -3
- package/dist/Select.mjs +2 -2
- package/dist/SelectableGrid.js +1 -1
- package/dist/SelectableGrid.mjs +3 -3
- package/dist/Separator.mjs +2 -2
- package/dist/Sheet.d.mts +4 -46
- package/dist/Sheet.d.ts +4 -46
- package/dist/Sheet.js +46 -114
- package/dist/Sheet.mjs +2 -3
- package/dist/SheetSelect.js +1 -1
- package/dist/SheetSelect.mjs +3 -3
- package/dist/Skeleton.mjs +2 -2
- package/dist/Slider.mjs +2 -2
- package/dist/Spinner.mjs +2 -2
- package/dist/Stats.d.mts +30 -0
- package/dist/Stats.d.ts +30 -0
- package/dist/Stats.js +429 -0
- package/dist/Stats.mjs +9 -0
- package/dist/Switch.mjs +2 -2
- package/dist/TabBar.js +1 -1
- package/dist/TabBar.mjs +3 -3
- package/dist/Tabs.mjs +2 -2
- package/dist/Text.d.mts +3 -1
- package/dist/Text.d.ts +3 -1
- package/dist/Text.js +3 -3
- package/dist/Text.mjs +2 -2
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.mjs +3 -3
- package/dist/Toast.mjs +2 -2
- package/dist/Toggle.js +1 -1
- package/dist/Toggle.mjs +3 -3
- package/dist/{chunk-DJ7RN37L.mjs → chunk-265G6A46.mjs} +2 -2
- package/dist/{chunk-WOEYDUJZ.mjs → chunk-2A2LEFZG.mjs} +2 -2
- package/dist/{chunk-ID72TK46.mjs → chunk-2CBQKU7H.mjs} +1 -1
- package/dist/{chunk-OB4JUQ3O.mjs → chunk-2I2AYECM.mjs} +1 -1
- package/dist/{chunk-WJLKJMKR.mjs → chunk-357YO24D.mjs} +4 -4
- package/dist/{chunk-GQYFLP3D.mjs → chunk-3GEYJ7I5.mjs} +1 -1
- package/dist/{chunk-AV4EMIRH.mjs → chunk-3N2M3WZL.mjs} +1 -1
- package/dist/{chunk-TERDKCLE.mjs → chunk-3UYAZ7I4.mjs} +2 -2
- package/dist/{chunk-JMOZEC77.mjs → chunk-4WFMPFZB.mjs} +1 -1
- package/dist/chunk-5OLNXP3S.mjs +144 -0
- package/dist/{chunk-6OAZJ577.mjs → chunk-7HSILTC4.mjs} +3 -3
- package/dist/{chunk-IRRY3CRZ.mjs → chunk-AKM4EPOT.mjs} +1 -1
- package/dist/{chunk-VGTDN7SW.mjs → chunk-AQEVCEXV.mjs} +2 -2
- package/dist/{chunk-WBOOUHSS.mjs → chunk-BCWEHE34.mjs} +1 -1
- package/dist/{chunk-AJ7ZDNBT.mjs → chunk-BOVUP27T.mjs} +1 -1
- package/dist/{chunk-BRKYVJVV.mjs → chunk-BQZE3HAW.mjs} +1 -1
- package/dist/{chunk-MLF3EZFW.mjs → chunk-D3Y2T42P.mjs} +2 -2
- package/dist/{chunk-3U4SSNWP.mjs → chunk-DF6DU42P.mjs} +2 -2
- package/dist/{chunk-ZJKGQMYH.mjs → chunk-DI7CBDL6.mjs} +2 -2
- package/dist/{chunk-2TFTAWVJ.mjs → chunk-DOGIPOF5.mjs} +2 -2
- package/dist/{chunk-MBMXYJJV.mjs → chunk-E7NEHHXV.mjs} +7 -3
- package/dist/{chunk-MX6HRKMI.mjs → chunk-EFLFRAHD.mjs} +1 -1
- package/dist/{chunk-SOYNZDVY.mjs → chunk-EMUWGDWC.mjs} +6 -1
- package/dist/{chunk-4I7D47FH.mjs → chunk-F4V6XLP4.mjs} +4 -4
- package/dist/{chunk-UREA2GYY.mjs → chunk-FA2KMTH5.mjs} +2 -2
- package/dist/{chunk-Y2NS74WS.mjs → chunk-FFTYLPSB.mjs} +46 -98
- package/dist/{chunk-OHBNABL5.mjs → chunk-FUVYSVGR.mjs} +14 -9
- package/dist/{chunk-KIHCWCWL.mjs → chunk-FVTVCJAH.mjs} +2 -2
- package/dist/{chunk-Y4GL2MHX.mjs → chunk-GK4VRMNE.mjs} +30 -12
- package/dist/{chunk-6Q64UFIA.mjs → chunk-HJ46DTJE.mjs} +1 -1
- package/dist/{chunk-WF2XDFRK.mjs → chunk-HLMPMUK2.mjs} +1 -1
- package/dist/{chunk-GD6KXMG5.mjs → chunk-I4V5XZPS.mjs} +1 -1
- package/dist/{chunk-AZJF2BLK.mjs → chunk-ISY26JQJ.mjs} +2 -2
- package/dist/{chunk-X4G6APW6.mjs → chunk-J6Q2YJEV.mjs} +1 -1
- package/dist/{chunk-KZL5VTYK.mjs → chunk-JCZQOY4O.mjs} +31 -24
- package/dist/{chunk-CZCQZHG6.mjs → chunk-JNVAIDLK.mjs} +2 -2
- package/dist/{chunk-SOA2Z4RB.mjs → chunk-JULSIZDM.mjs} +1 -1
- package/dist/{chunk-T7XZ7H7Y.mjs → chunk-KA7LTET3.mjs} +17 -3
- package/dist/chunk-KHYX4IOM.mjs +1114 -0
- package/dist/{chunk-LXJIIOYQ.mjs → chunk-LRM4AVYY.mjs} +2 -2
- package/dist/{chunk-VQ57HWPL.mjs → chunk-MYZ2EDYU.mjs} +2 -2
- package/dist/chunk-N4ZPVCJH.mjs +126 -0
- package/dist/{chunk-NA7PARID.mjs → chunk-NXI4YDZ2.mjs} +2 -2
- package/dist/{chunk-4K625MVM.mjs → chunk-OULVKTWL.mjs} +2 -2
- package/dist/{chunk-A4MDAP7G.mjs → chunk-P64WHW4A.mjs} +2 -2
- package/dist/{chunk-URI2WBIV.mjs → chunk-P73V2EKS.mjs} +2 -2
- package/dist/{chunk-ZUR7AU5R.mjs → chunk-PGERH3P7.mjs} +2 -2
- package/dist/{chunk-2UYENBLV.mjs → chunk-QSFV2P7O.mjs} +1 -1
- package/dist/{chunk-JT7HKXRB.mjs → chunk-S3KJCPEJ.mjs} +1 -1
- package/dist/{chunk-6MKGPAR2.mjs → chunk-V6NFJXKO.mjs} +2 -2
- package/dist/{chunk-A3A6KNQN.mjs → chunk-WOEWGSTU.mjs} +1 -1
- package/dist/{chunk-JUXSWN54.mjs → chunk-X26S5EVZ.mjs} +4 -2
- package/dist/{chunk-YFZ3ELX5.mjs → chunk-XBAGGKLW.mjs} +2 -2
- package/dist/{chunk-JB67UOB5.mjs → chunk-ZHMSAYLT.mjs} +2 -2
- package/dist/fonts.d.mts +1 -7
- package/dist/fonts.d.ts +1 -7
- package/dist/fonts.js +0 -2
- package/dist/fonts.mjs +1 -2
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1831 -475
- package/dist/index.mjs +54 -51
- package/package.json +3 -3
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +39 -30
- package/src/components/CurrencyInput/CurrencyInput.tsx +4 -7
- package/src/components/DetailRow/DetailRow.tsx +1 -1
- package/src/components/IconPicker/IconPicker.tsx +395 -0
- package/src/components/IconPicker/index.ts +1 -0
- package/src/components/ImageUpload/ImageUpload.tsx +34 -12
- package/src/components/ListItem/ListItem.tsx +43 -28
- package/src/components/NumberStepper/NumberStepper.tsx +147 -0
- package/src/components/NumberStepper/index.ts +1 -0
- package/src/components/Pressable/Pressable.tsx +20 -8
- package/src/components/Sheet/Sheet.tsx +64 -172
- package/src/components/Stats/Stats.tsx +226 -0
- package/src/components/Stats/index.ts +2 -0
- package/src/components/Text/Text.tsx +4 -2
- package/src/fonts.ts +0 -7
- package/src/index.ts +7 -1
- package/src/theme/colorUtils.ts +9 -0
- package/src/utils/curatedIcons.ts +849 -0
- package/src/utils/fontGuard.ts +2 -1
- package/src/utils/icons.ts +20 -2
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react'
|
|
2
|
+
import { View, Text, StyleSheet, ViewStyle, LayoutChangeEvent } from 'react-native'
|
|
3
|
+
import { impactLight } from '../../utils/haptics'
|
|
4
|
+
import { useTheme } from '../../theme'
|
|
5
|
+
import { s, vs, ms, mvs } from '../../utils/scaling'
|
|
6
|
+
import { RADIUS } from '../../tokens'
|
|
7
|
+
import { renderIcon } from '../../utils/icons'
|
|
8
|
+
import { PressableCard } from '../../utils/pressable'
|
|
9
|
+
|
|
10
|
+
export type StatsVariant = 'elevated' | 'outlined' | 'filled'
|
|
11
|
+
|
|
12
|
+
export interface StatsProps {
|
|
13
|
+
value: string
|
|
14
|
+
label: string
|
|
15
|
+
description?: string
|
|
16
|
+
icon?: React.ReactNode
|
|
17
|
+
iconName?: string
|
|
18
|
+
iconColor?: string
|
|
19
|
+
variant?: StatsVariant
|
|
20
|
+
onPress?: () => void
|
|
21
|
+
style?: ViewStyle
|
|
22
|
+
accessibilityLabel?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface StatsGroupProps {
|
|
26
|
+
children: React.ReactNode
|
|
27
|
+
gap?: number
|
|
28
|
+
style?: ViewStyle
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const COMPACT_THRESHOLD = s(150)
|
|
32
|
+
|
|
33
|
+
function StatsComponent({
|
|
34
|
+
value,
|
|
35
|
+
label,
|
|
36
|
+
description,
|
|
37
|
+
icon,
|
|
38
|
+
iconName,
|
|
39
|
+
iconColor,
|
|
40
|
+
variant = 'elevated',
|
|
41
|
+
onPress,
|
|
42
|
+
style,
|
|
43
|
+
accessibilityLabel,
|
|
44
|
+
}: StatsProps) {
|
|
45
|
+
const { colors } = useTheme()
|
|
46
|
+
const [containerWidth, setContainerWidth] = useState(0)
|
|
47
|
+
|
|
48
|
+
const handleLayout = useCallback((e: LayoutChangeEvent) => {
|
|
49
|
+
const w = e.nativeEvent.layout.width
|
|
50
|
+
if (w > 0 && w !== containerWidth) {
|
|
51
|
+
setContainerWidth(w)
|
|
52
|
+
}
|
|
53
|
+
}, [containerWidth])
|
|
54
|
+
|
|
55
|
+
const handlePress = () => {
|
|
56
|
+
if (!onPress) return
|
|
57
|
+
impactLight()
|
|
58
|
+
onPress()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const isCompact = containerWidth > 0 && containerWidth < COMPACT_THRESHOLD && !!(icon ?? iconName)
|
|
62
|
+
|
|
63
|
+
const variantStyle: ViewStyle = {
|
|
64
|
+
elevated: {
|
|
65
|
+
backgroundColor: colors.card,
|
|
66
|
+
borderWidth: 0,
|
|
67
|
+
shadowColor: '#000',
|
|
68
|
+
shadowOffset: { width: 0, height: 4 },
|
|
69
|
+
shadowOpacity: 0.09,
|
|
70
|
+
shadowRadius: 14,
|
|
71
|
+
elevation: 4,
|
|
72
|
+
},
|
|
73
|
+
outlined: {
|
|
74
|
+
backgroundColor: colors.card,
|
|
75
|
+
borderColor: colors.border,
|
|
76
|
+
shadowOpacity: 0,
|
|
77
|
+
elevation: 0,
|
|
78
|
+
},
|
|
79
|
+
filled: {
|
|
80
|
+
backgroundColor: colors.surfaceStrong,
|
|
81
|
+
borderColor: colors.border,
|
|
82
|
+
shadowOpacity: 0,
|
|
83
|
+
elevation: 0,
|
|
84
|
+
},
|
|
85
|
+
}[variant]
|
|
86
|
+
|
|
87
|
+
const iconColorResolved = iconColor ?? colors.primary
|
|
88
|
+
|
|
89
|
+
const resolvedIcon = iconName ? renderIcon(iconName, ms(22), iconColorResolved) : icon
|
|
90
|
+
|
|
91
|
+
const iconElement = resolvedIcon ? (
|
|
92
|
+
<View style={styles.iconWrapper}>{resolvedIcon}</View>
|
|
93
|
+
) : null
|
|
94
|
+
|
|
95
|
+
const valueElement = (
|
|
96
|
+
<Text style={[styles.value, { color: colors.foreground }]} allowFontScaling={true}>
|
|
97
|
+
{value}
|
|
98
|
+
</Text>
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
const cardContent = (
|
|
102
|
+
<View style={[styles.card, variantStyle, style]} onLayout={handleLayout}>
|
|
103
|
+
{isCompact ? (
|
|
104
|
+
<>
|
|
105
|
+
{iconElement}
|
|
106
|
+
<View style={styles.compactValue}>{valueElement}</View>
|
|
107
|
+
<Text style={[styles.label, { color: colors.foregroundSubtle }]} allowFontScaling={true}>
|
|
108
|
+
{label}
|
|
109
|
+
</Text>
|
|
110
|
+
{description ? (
|
|
111
|
+
<Text style={[styles.description, { color: colors.foregroundMuted }]} allowFontScaling={true}>
|
|
112
|
+
{description}
|
|
113
|
+
</Text>
|
|
114
|
+
) : null}
|
|
115
|
+
</>
|
|
116
|
+
) : (
|
|
117
|
+
<>
|
|
118
|
+
<View style={styles.valueRow}>
|
|
119
|
+
{iconElement}
|
|
120
|
+
{valueElement}
|
|
121
|
+
</View>
|
|
122
|
+
<Text style={[styles.label, { color: colors.foregroundSubtle }]} allowFontScaling={true}>
|
|
123
|
+
{label}
|
|
124
|
+
</Text>
|
|
125
|
+
{description ? (
|
|
126
|
+
<Text style={[styles.description, { color: colors.foregroundMuted }]} allowFontScaling={true}>
|
|
127
|
+
{description}
|
|
128
|
+
</Text>
|
|
129
|
+
) : null}
|
|
130
|
+
</>
|
|
131
|
+
)}
|
|
132
|
+
</View>
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
if (onPress) {
|
|
136
|
+
return (
|
|
137
|
+
<PressableCard
|
|
138
|
+
onPress={handlePress}
|
|
139
|
+
rippleColor="transparent"
|
|
140
|
+
touchSoundDisabled
|
|
141
|
+
activateOnHover
|
|
142
|
+
accessibilityRole="button"
|
|
143
|
+
accessibilityLabel={accessibilityLabel}
|
|
144
|
+
>
|
|
145
|
+
{cardContent}
|
|
146
|
+
</PressableCard>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return cardContent
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function StatsGroup({ children, gap = s(12), style }: StatsGroupProps) {
|
|
154
|
+
return (
|
|
155
|
+
<View style={[styles.group, { gap }, style]}>
|
|
156
|
+
{React.Children.map(children, (child) => {
|
|
157
|
+
if (!React.isValidElement(child)) return child
|
|
158
|
+
const childStyle = (child.props as { style?: ViewStyle }).style
|
|
159
|
+
const mergedStyle = childStyle
|
|
160
|
+
? [childStyle, { alignSelf: 'stretch' as const }]
|
|
161
|
+
: [{ alignSelf: 'stretch' as const }]
|
|
162
|
+
return (
|
|
163
|
+
<View style={styles.groupItem}>
|
|
164
|
+
{React.cloneElement(
|
|
165
|
+
child as React.ReactElement<{ style?: ViewStyle }>,
|
|
166
|
+
{ style: mergedStyle as unknown as ViewStyle },
|
|
167
|
+
)}
|
|
168
|
+
</View>
|
|
169
|
+
)
|
|
170
|
+
})}
|
|
171
|
+
</View>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const Stats = Object.assign(React.memo(StatsComponent), { Group: StatsGroup })
|
|
176
|
+
|
|
177
|
+
const styles = StyleSheet.create({
|
|
178
|
+
card: {
|
|
179
|
+
borderRadius: RADIUS.md,
|
|
180
|
+
borderWidth: 1,
|
|
181
|
+
padding: s(16),
|
|
182
|
+
alignSelf: 'flex-start',
|
|
183
|
+
alignItems: 'center',
|
|
184
|
+
justifyContent: 'center',
|
|
185
|
+
},
|
|
186
|
+
valueRow: {
|
|
187
|
+
flexDirection: 'row',
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
justifyContent: 'center',
|
|
190
|
+
gap: s(8),
|
|
191
|
+
},
|
|
192
|
+
iconWrapper: {
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
justifyContent: 'center',
|
|
195
|
+
},
|
|
196
|
+
compactValue: {
|
|
197
|
+
marginTop: vs(8),
|
|
198
|
+
},
|
|
199
|
+
value: {
|
|
200
|
+
fontFamily: 'Sohne-Bold',
|
|
201
|
+
fontSize: ms(28),
|
|
202
|
+
lineHeight: mvs(32),
|
|
203
|
+
textAlign: 'center',
|
|
204
|
+
},
|
|
205
|
+
label: {
|
|
206
|
+
fontFamily: 'Sohne-Regular',
|
|
207
|
+
fontSize: ms(13),
|
|
208
|
+
lineHeight: mvs(18),
|
|
209
|
+
marginTop: vs(8),
|
|
210
|
+
textAlign: 'center',
|
|
211
|
+
},
|
|
212
|
+
description: {
|
|
213
|
+
fontFamily: 'Sohne-Regular',
|
|
214
|
+
fontSize: ms(12),
|
|
215
|
+
lineHeight: mvs(16),
|
|
216
|
+
marginTop: vs(4),
|
|
217
|
+
textAlign: 'center',
|
|
218
|
+
},
|
|
219
|
+
group: {
|
|
220
|
+
flexDirection: 'row',
|
|
221
|
+
width: '100%',
|
|
222
|
+
},
|
|
223
|
+
groupItem: {
|
|
224
|
+
flex: 1,
|
|
225
|
+
},
|
|
226
|
+
})
|
|
@@ -26,6 +26,8 @@ export type TextVariant =
|
|
|
26
26
|
export interface TextProps extends RNTextProps {
|
|
27
27
|
variant?: TextVariant
|
|
28
28
|
color?: string
|
|
29
|
+
/** Force uppercase text transformation. Useful for labels, headers, and buttons. */
|
|
30
|
+
uppercase?: boolean
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
// Apply scaling to font/line-height values while preserving all other token props
|
|
@@ -68,7 +70,7 @@ const defaultColorVariant: Partial<Record<TextVariant, 'foreground' | 'foregroun
|
|
|
68
70
|
'button-sm': 'foreground',
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
function TextBase({ variant = 'body-md', color, style, children, ...props }: TextProps) {
|
|
73
|
+
function TextBase({ variant = 'body-md', color, style, uppercase, children, ...props }: TextProps) {
|
|
72
74
|
warnIfFontsMissing()
|
|
73
75
|
const { colors } = useTheme()
|
|
74
76
|
|
|
@@ -77,7 +79,7 @@ function TextBase({ variant = 'body-md', color, style, children, ...props }: Tex
|
|
|
77
79
|
|
|
78
80
|
return (
|
|
79
81
|
<RNText
|
|
80
|
-
style={[variantStyles[variant], { color: resolvedColor }, style]}
|
|
82
|
+
style={[variantStyles[variant], { color: resolvedColor }, uppercase && { textTransform: 'uppercase' }, style]}
|
|
81
83
|
allowFontScaling={true}
|
|
82
84
|
{...props}
|
|
83
85
|
>
|
package/src/fonts.ts
CHANGED
|
@@ -63,10 +63,3 @@ export const SohneFontNames = [
|
|
|
63
63
|
|
|
64
64
|
/** Type for any valid Sohne font family name */
|
|
65
65
|
export type SohneFontName = (typeof SohneFontNames)[number]
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated SohneFonts export removed in v10.0.0.
|
|
69
|
-
* Metro cannot resolve require() calls from node_modules reliably.
|
|
70
|
-
* Copy the static SohneFonts boilerplate from CONSUMER.md into your App.tsx instead.
|
|
71
|
-
*/
|
|
72
|
-
export const SohneFonts = undefined
|
package/src/index.ts
CHANGED
|
@@ -55,12 +55,18 @@ export * from './components/TabBar'
|
|
|
55
55
|
export * from './components/ImageViewer'
|
|
56
56
|
export * from './components/SheetSelect'
|
|
57
57
|
export * from './components/ImageUpload'
|
|
58
|
+
export * from './components/IconPicker'
|
|
59
|
+
export * from './components/NumberStepper'
|
|
60
|
+
export * from './components/Stats'
|
|
58
61
|
// HolographicCard is intentionally NOT re-exported here — it depends on the
|
|
59
62
|
// optional peer @shopify/react-native-skia, so it must stay out of the main
|
|
60
63
|
// barrel's module graph. Deep-import it: '@retray-dev/ui-kit/HolographicCard'.
|
|
61
64
|
|
|
62
65
|
// Icon utility
|
|
63
|
-
export { Icon, renderIcon, configureIconFamilies } from './utils/icons'
|
|
66
|
+
export { Icon, renderIcon, configureIconFamilies, getValidIconNames } from './utils/icons'
|
|
67
|
+
|
|
68
|
+
// Color utilities
|
|
69
|
+
export { withAlpha } from './theme/colorUtils'
|
|
64
70
|
|
|
65
71
|
// Typography utilities
|
|
66
72
|
export { getResponsiveFontSize } from './utils/typography'
|
package/src/theme/colorUtils.ts
CHANGED
|
@@ -78,3 +78,12 @@ export function isDark(hex: string): boolean {
|
|
|
78
78
|
const L = 0.2126 * toLinear(rgb.r) + 0.7152 * toLinear(rgb.g) + 0.0722 * toLinear(rgb.b)
|
|
79
79
|
return L < 0.5
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
// Convert a hex color to rgba with the given alpha.
|
|
83
|
+
// Returns an rgba() string suitable for use with semi-transparent backgrounds,
|
|
84
|
+
// borders, and overlays.
|
|
85
|
+
export function withAlpha(hex: string, alpha: number): string {
|
|
86
|
+
const rgb = hexToRgb(hex)
|
|
87
|
+
if (!rgb) return hex
|
|
88
|
+
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`
|
|
89
|
+
}
|