@utilitywarehouse/hearth-react-native 0.9.0 → 0.11.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +16 -0
- package/build/components/Avatar/Avatar.d.ts +6 -0
- package/build/components/Avatar/Avatar.js +80 -0
- package/build/components/Avatar/Avatar.props.d.ts +28 -0
- package/build/components/Avatar/Avatar.props.js +1 -0
- package/build/components/Avatar/index.d.ts +2 -0
- package/build/components/Avatar/index.js +1 -0
- package/build/components/DateInput/DateInput.d.ts +6 -0
- package/build/components/DateInput/DateInput.js +19 -0
- package/build/components/DateInput/DateInput.props.d.ts +79 -0
- package/build/components/DateInput/DateInput.props.js +1 -0
- package/build/components/DateInput/DateInputSegment.d.ts +20 -0
- package/build/components/DateInput/DateInputSegment.js +31 -0
- package/build/components/DateInput/index.d.ts +2 -0
- package/build/components/DateInput/index.js +1 -0
- package/build/components/PillGroup/Pill.d.ts +16 -0
- package/build/components/PillGroup/Pill.js +94 -0
- package/build/components/PillGroup/Pill.props.d.ts +10 -0
- package/build/components/PillGroup/Pill.props.js +1 -0
- package/build/components/PillGroup/PillGroup.context.d.ts +6 -0
- package/build/components/PillGroup/PillGroup.context.js +5 -0
- package/build/components/PillGroup/PillGroup.d.ts +5 -0
- package/build/components/PillGroup/PillGroup.js +34 -0
- package/build/components/PillGroup/PillGroup.props.d.ts +15 -0
- package/build/components/PillGroup/PillGroup.props.js +1 -0
- package/build/components/PillGroup/index.d.ts +4 -0
- package/build/components/PillGroup/index.js +2 -0
- package/build/components/Select/Select.js +2 -1
- package/build/components/Toast/Toast.context.d.ts +9 -0
- package/build/components/Toast/Toast.context.js +90 -0
- package/build/components/Toast/Toast.props.d.ts +29 -0
- package/build/components/Toast/Toast.props.js +1 -0
- package/build/components/Toast/ToastItem.d.ts +10 -0
- package/build/components/Toast/ToastItem.js +129 -0
- package/build/components/Toast/index.d.ts +3 -0
- package/build/components/Toast/index.js +2 -0
- package/build/components/index.d.ts +4 -0
- package/build/components/index.js +4 -0
- package/build/tokens/components/dark/checkbox.d.ts +3 -0
- package/build/tokens/components/dark/checkbox.js +3 -0
- package/build/tokens/components/dark/input.d.ts +6 -0
- package/build/tokens/components/dark/input.js +6 -0
- package/build/tokens/components/dark/radio.d.ts +3 -0
- package/build/tokens/components/dark/radio.js +3 -0
- package/build/tokens/components/dark/table.d.ts +2 -0
- package/build/tokens/components/dark/table.js +2 -0
- package/build/tokens/components/dark/toast.d.ts +6 -2
- package/build/tokens/components/dark/toast.js +6 -2
- package/build/tokens/components/light/checkbox.d.ts +3 -0
- package/build/tokens/components/light/checkbox.js +3 -0
- package/build/tokens/components/light/input.d.ts +6 -0
- package/build/tokens/components/light/input.js +6 -0
- package/build/tokens/components/light/radio.d.ts +3 -0
- package/build/tokens/components/light/radio.js +3 -0
- package/build/tokens/components/light/table.d.ts +2 -0
- package/build/tokens/components/light/table.js +2 -0
- package/build/tokens/components/light/toast.d.ts +6 -2
- package/build/tokens/components/light/toast.js +6 -2
- package/build/utils/getInitials.d.ts +1 -0
- package/build/utils/getInitials.js +8 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/docs/assets/toast-ios.MP4 +0 -0
- package/docs/components/AllComponents.web.tsx +43 -0
- package/package.json +3 -3
- package/src/components/Avatar/Avatar.docs.mdx +105 -0
- package/src/components/Avatar/Avatar.props.ts +31 -0
- package/src/components/Avatar/Avatar.stories.tsx +77 -0
- package/src/components/Avatar/Avatar.tsx +136 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/DateInput/DateInput.docs.mdx +163 -0
- package/src/components/DateInput/DateInput.props.ts +80 -0
- package/src/components/DateInput/DateInput.stories.tsx +269 -0
- package/src/components/DateInput/DateInput.tsx +117 -0
- package/src/components/DateInput/DateInputSegment.tsx +83 -0
- package/src/components/DateInput/index.ts +2 -0
- package/src/components/PillGroup/Pill.props.ts +13 -0
- package/src/components/PillGroup/Pill.tsx +120 -0
- package/src/components/PillGroup/PillGroup.context.tsx +12 -0
- package/src/components/PillGroup/PillGroup.docs.mdx +96 -0
- package/src/components/PillGroup/PillGroup.props.ts +22 -0
- package/src/components/PillGroup/PillGroup.stories.tsx +159 -0
- package/src/components/PillGroup/PillGroup.tsx +66 -0
- package/src/components/PillGroup/index.ts +4 -0
- package/src/components/Select/Select.tsx +2 -0
- package/src/components/Toast/Toast.context.tsx +118 -0
- package/src/components/Toast/Toast.docs.mdx +164 -0
- package/src/components/Toast/Toast.props.ts +33 -0
- package/src/components/Toast/Toast.stories.tsx +356 -0
- package/src/components/Toast/ToastItem.tsx +200 -0
- package/src/components/Toast/index.ts +3 -0
- package/src/components/index.ts +4 -0
- package/src/tokens/components/dark/checkbox.ts +3 -0
- package/src/tokens/components/dark/input.ts +6 -0
- package/src/tokens/components/dark/radio.ts +3 -0
- package/src/tokens/components/dark/table.ts +2 -0
- package/src/tokens/components/dark/toast.ts +6 -2
- package/src/tokens/components/light/checkbox.ts +3 -0
- package/src/tokens/components/light/input.ts +6 -0
- package/src/tokens/components/light/radio.ts +3 -0
- package/src/tokens/components/light/table.ts +2 -0
- package/src/tokens/components/light/toast.ts +6 -2
- package/src/utils/getInitials.ts +7 -0
- package/src/utils/index.ts +1 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
5
|
+
import ToastItem from './ToastItem';
|
|
6
|
+
const ToastContext = createContext(undefined);
|
|
7
|
+
export const useToastContext = () => {
|
|
8
|
+
const ctx = useContext(ToastContext);
|
|
9
|
+
if (!ctx)
|
|
10
|
+
throw new Error('useToastContext must be used within ToastProvider');
|
|
11
|
+
return ctx;
|
|
12
|
+
};
|
|
13
|
+
export const ToastProvider = ({ children }) => {
|
|
14
|
+
const [toasts, setToasts] = useState([]);
|
|
15
|
+
const timers = useRef({});
|
|
16
|
+
const toastRefs = useRef({});
|
|
17
|
+
const removeToast = useCallback((id) => {
|
|
18
|
+
setToasts(s => s.filter(t => t.id !== id));
|
|
19
|
+
const timer = timers.current[id];
|
|
20
|
+
if (timer) {
|
|
21
|
+
clearTimeout(timer);
|
|
22
|
+
delete timers.current[id];
|
|
23
|
+
}
|
|
24
|
+
delete toastRefs.current[id];
|
|
25
|
+
}, []);
|
|
26
|
+
const addToast = useCallback((opts) => {
|
|
27
|
+
const id = opts.id ?? `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
28
|
+
const toast = {
|
|
29
|
+
id,
|
|
30
|
+
text: opts.text,
|
|
31
|
+
actionText: opts.actionText,
|
|
32
|
+
onPress: opts.onPress,
|
|
33
|
+
onDismiss: opts.onDismiss,
|
|
34
|
+
icon: opts.icon,
|
|
35
|
+
duration: opts.duration ?? 6000,
|
|
36
|
+
showDismissIcon: opts.showDismissIcon,
|
|
37
|
+
dismissOnPress: opts.dismissOnPress ?? true,
|
|
38
|
+
};
|
|
39
|
+
setToasts(s => [toast, ...s]);
|
|
40
|
+
// set auto-dismiss timer
|
|
41
|
+
if (toast.duration && toast.duration > 0) {
|
|
42
|
+
const t = setTimeout(() => {
|
|
43
|
+
// call dismiss animation if ref exists, otherwise remove immediately
|
|
44
|
+
const ref = toastRefs.current[id];
|
|
45
|
+
if (ref) {
|
|
46
|
+
ref.dismiss();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
removeToast(id);
|
|
50
|
+
}
|
|
51
|
+
}, toast.duration);
|
|
52
|
+
timers.current[id] = t;
|
|
53
|
+
}
|
|
54
|
+
return id;
|
|
55
|
+
}, [removeToast]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
return () => {
|
|
58
|
+
// cleanup timers on unmount
|
|
59
|
+
Object.values(timers.current).forEach(t => clearTimeout(t));
|
|
60
|
+
timers.current = {};
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
return (_jsxs(ToastContext.Provider, { value: { addToast, removeToast }, children: [children, _jsx(View, { pointerEvents: "box-none", style: styles.container, children: _jsx(View, { style: styles.stack, children: toasts.map(t => (_jsx(ToastItem, { ref: el => {
|
|
64
|
+
toastRefs.current[t.id] = el;
|
|
65
|
+
}, toast: t, onClose: removeToast }, t.id))) }) })] }));
|
|
66
|
+
};
|
|
67
|
+
export const useToast = () => {
|
|
68
|
+
const ctx = useContext(ToastContext);
|
|
69
|
+
if (!ctx)
|
|
70
|
+
throw new Error('useToast must be used within ToastProvider');
|
|
71
|
+
return ctx;
|
|
72
|
+
};
|
|
73
|
+
export default ToastContext;
|
|
74
|
+
const styles = StyleSheet.create(theme => ({
|
|
75
|
+
container: {
|
|
76
|
+
position: 'absolute',
|
|
77
|
+
left: 0,
|
|
78
|
+
right: 0,
|
|
79
|
+
bottom: 0,
|
|
80
|
+
alignItems: 'stretch',
|
|
81
|
+
paddingBottom: theme.space['200'],
|
|
82
|
+
pointerEvents: 'box-none',
|
|
83
|
+
},
|
|
84
|
+
stack: {
|
|
85
|
+
width: '100%',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
justifyContent: 'flex-end',
|
|
88
|
+
gap: theme.components.toast.stack.gap,
|
|
89
|
+
},
|
|
90
|
+
}));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ToastOptions {
|
|
3
|
+
id?: string;
|
|
4
|
+
text: string | ReactNode;
|
|
5
|
+
/** Optional action text to display as a link */
|
|
6
|
+
actionText?: string;
|
|
7
|
+
/** Optional callback when action link or toast is pressed */
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
/** Optional callback when toast is dismissed */
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
/** Optional icon component */
|
|
12
|
+
icon?: React.ComponentType;
|
|
13
|
+
/** Duration in milliseconds; default 6000 */
|
|
14
|
+
duration?: number;
|
|
15
|
+
/** Whether to show the dismiss icon button; default true */
|
|
16
|
+
showDismissIcon?: boolean;
|
|
17
|
+
/** Whether to dismiss the toast when pressed; default true */
|
|
18
|
+
dismissOnPress?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ToastInstance extends ToastOptions {
|
|
21
|
+
id: string;
|
|
22
|
+
/** resolved duration */
|
|
23
|
+
duration: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ToastContextValue {
|
|
26
|
+
addToast: (opts: ToastOptions) => string;
|
|
27
|
+
removeToast: (id: string) => void;
|
|
28
|
+
}
|
|
29
|
+
export default ToastOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToastInstance } from './Toast.props';
|
|
2
|
+
export interface ToastItemHandle {
|
|
3
|
+
dismiss: () => void;
|
|
4
|
+
}
|
|
5
|
+
interface Props {
|
|
6
|
+
toast: ToastInstance;
|
|
7
|
+
onClose: (id: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const ToastItem: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<ToastItemHandle>>;
|
|
10
|
+
export default ToastItem;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CloseSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
|
+
import { forwardRef, useEffect, useImperativeHandle } from 'react';
|
|
4
|
+
import { AccessibilityInfo, Platform, Pressable, View } from 'react-native';
|
|
5
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
6
|
+
import Animated, { useAnimatedStyle, useSharedValue, withSpring, withTiming, } from 'react-native-reanimated';
|
|
7
|
+
import { StyleSheet, withUnistyles } from 'react-native-unistyles';
|
|
8
|
+
import { scheduleOnRN } from 'react-native-worklets';
|
|
9
|
+
import { BodyText } from '../BodyText';
|
|
10
|
+
import { Icon } from '../Icon';
|
|
11
|
+
import { Link } from '../Link';
|
|
12
|
+
import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
13
|
+
const AnimatedView = Platform.OS === 'web' ? withUnistyles(Animated.View) : Animated.View;
|
|
14
|
+
const ToastItem = forwardRef(({ toast, onClose }, ref) => {
|
|
15
|
+
const translateY = useSharedValue(30);
|
|
16
|
+
const opacity = useSharedValue(0);
|
|
17
|
+
const gestureTranslateY = useSharedValue(0);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
translateY.value = withTiming(0, { duration: 300 });
|
|
20
|
+
opacity.value = withTiming(1, { duration: 300 });
|
|
21
|
+
// Announce toast content to screen readers
|
|
22
|
+
// Use a slight delay to ensure iOS VoiceOver picks it up
|
|
23
|
+
const timer = setTimeout(() => {
|
|
24
|
+
const message = typeof toast.text === 'string' ? toast.text : 'Toast notification';
|
|
25
|
+
const announcement = toast.actionText ? `${message}, ${toast.actionText}` : message;
|
|
26
|
+
AccessibilityInfo.announceForAccessibility(announcement);
|
|
27
|
+
}, 100);
|
|
28
|
+
return () => clearTimeout(timer);
|
|
29
|
+
}, [toast.text, toast.actionText]);
|
|
30
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
31
|
+
transform: [{ translateY: translateY.value + gestureTranslateY.value }],
|
|
32
|
+
opacity: opacity.value,
|
|
33
|
+
}));
|
|
34
|
+
const handleDismiss = (fromGesture = false) => {
|
|
35
|
+
'worklet';
|
|
36
|
+
// Call onDismiss callback if provided
|
|
37
|
+
if (toast.onDismiss) {
|
|
38
|
+
scheduleOnRN(toast.onDismiss);
|
|
39
|
+
}
|
|
40
|
+
// animate out then call onClose
|
|
41
|
+
if (!fromGesture) {
|
|
42
|
+
gestureTranslateY.value = 0;
|
|
43
|
+
}
|
|
44
|
+
// Continue from current position and animate further down
|
|
45
|
+
translateY.value = withTiming(100, { duration: 250 });
|
|
46
|
+
opacity.value = withTiming(0, { duration: 250 }, finished => {
|
|
47
|
+
if (finished)
|
|
48
|
+
scheduleOnRN(onClose, toast.id);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
useImperativeHandle(ref, () => ({
|
|
52
|
+
dismiss: handleDismiss,
|
|
53
|
+
}));
|
|
54
|
+
const panGesture = Gesture.Pan()
|
|
55
|
+
.onUpdate(event => {
|
|
56
|
+
// only allow downward drag
|
|
57
|
+
if (event.translationY > 0) {
|
|
58
|
+
gestureTranslateY.value = event.translationY;
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
.onEnd(event => {
|
|
62
|
+
if (event.translationY > 30 || event.velocityY > 800) {
|
|
63
|
+
handleDismiss(true);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// spring back to original position
|
|
67
|
+
gestureTranslateY.value = withSpring(0, {
|
|
68
|
+
damping: 20,
|
|
69
|
+
stiffness: 300,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const IconComp = toast.icon;
|
|
74
|
+
const showDismissIcon = toast.showDismissIcon !== false; // default true
|
|
75
|
+
const dismissOnPress = toast.dismissOnPress === true; // default false
|
|
76
|
+
const handlePress = () => {
|
|
77
|
+
if (toast.onPress) {
|
|
78
|
+
toast.onPress();
|
|
79
|
+
if (dismissOnPress) {
|
|
80
|
+
handleDismiss(false);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const toastContent = (_jsxs(View, { style: styles.inner, children: [_jsxs(View, { style: styles.content, children: [IconComp ? (_jsx(View, { style: styles.iconWrap, children: _jsx(Icon, { as: IconComp, style: styles.icon }) })) : null, _jsx(BodyText, { inverted: true, children: toast.text })] }), toast.actionText ? (_jsx(Link, { onPress: handlePress, showIcon: false, inverted: true, children: toast.actionText })) : null, showDismissIcon ? (_jsx(View, { style: styles.actions, children: _jsx(UnstyledIconButton, { icon: CloseSmallIcon, accessibilityLabel: "Dismiss", inverted: true, onPress: () => handleDismiss(false) }) })) : null] }));
|
|
85
|
+
return (_jsx(GestureDetector, { gesture: panGesture, children: _jsx(AnimatedView, { style: [styles.toast, animatedStyle], ...(Platform.OS === 'ios' && {
|
|
86
|
+
accessible: true,
|
|
87
|
+
accessibilityRole: 'alert',
|
|
88
|
+
accessibilityLiveRegion: 'polite',
|
|
89
|
+
}), importantForAccessibility: Platform.OS === 'android' ? 'no-hide-descendants' : undefined, children: toast.onPress ? (_jsx(Pressable, { onPress: handlePress, style: styles.pressable, children: toastContent })) : (toastContent) }) }));
|
|
90
|
+
});
|
|
91
|
+
ToastItem.displayName = 'ToastItem';
|
|
92
|
+
const styles = StyleSheet.create(theme => ({
|
|
93
|
+
toast: {
|
|
94
|
+
backgroundColor: theme.components.toast.backgroundColor,
|
|
95
|
+
borderRadius: theme.components.toast.borderRadius,
|
|
96
|
+
padding: theme.components.toast.padding,
|
|
97
|
+
width: '95%',
|
|
98
|
+
},
|
|
99
|
+
pressable: {
|
|
100
|
+
width: '100%',
|
|
101
|
+
},
|
|
102
|
+
inner: {
|
|
103
|
+
flexDirection: 'row',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
width: '100%',
|
|
106
|
+
gap: theme.components.toast.gap,
|
|
107
|
+
},
|
|
108
|
+
iconWrap: {
|
|
109
|
+
width: 24,
|
|
110
|
+
height: 24,
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
flexShrink: 0,
|
|
114
|
+
},
|
|
115
|
+
icon: {
|
|
116
|
+
color: theme.color.icon.inverted,
|
|
117
|
+
},
|
|
118
|
+
content: {
|
|
119
|
+
flex: 1,
|
|
120
|
+
gap: theme.components.toast.text.gap,
|
|
121
|
+
flexDirection: 'row',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
minWidth: 0,
|
|
124
|
+
},
|
|
125
|
+
actions: {
|
|
126
|
+
flexShrink: 0,
|
|
127
|
+
},
|
|
128
|
+
}));
|
|
129
|
+
export default ToastItem;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './Accordion';
|
|
2
2
|
export * from './Alert';
|
|
3
|
+
export * from './Avatar';
|
|
3
4
|
export * from './Badge';
|
|
4
5
|
export * from './Banner';
|
|
5
6
|
export * from './BodyText';
|
|
@@ -12,6 +13,7 @@ export * from './Center';
|
|
|
12
13
|
export * from './Checkbox';
|
|
13
14
|
export * from './Container';
|
|
14
15
|
export * from './CurrencyInput';
|
|
16
|
+
export * from './DateInput';
|
|
15
17
|
export * from './DatePicker';
|
|
16
18
|
export * from './DatePickerInput';
|
|
17
19
|
export * from './DescriptionList';
|
|
@@ -37,6 +39,7 @@ export * from './Link';
|
|
|
37
39
|
export * from './List';
|
|
38
40
|
export * from './Menu';
|
|
39
41
|
export * from './Modal';
|
|
42
|
+
export * from './PillGroup';
|
|
40
43
|
export * from './ProgressStepper';
|
|
41
44
|
export * from './Radio';
|
|
42
45
|
export * from './RadioCard';
|
|
@@ -48,6 +51,7 @@ export * from './Switch';
|
|
|
48
51
|
export * from './Tabs';
|
|
49
52
|
export * from './Textarea';
|
|
50
53
|
export * from './ThemedImage';
|
|
54
|
+
export * from './Toast';
|
|
51
55
|
export * from './ToggleButtonCard';
|
|
52
56
|
export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, View } from 'react-native';
|
|
53
57
|
export { Pressable } from 'react-native';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Custom
|
|
2
2
|
export * from './Accordion';
|
|
3
3
|
export * from './Alert';
|
|
4
|
+
export * from './Avatar';
|
|
4
5
|
export * from './Badge';
|
|
5
6
|
export * from './Banner';
|
|
6
7
|
export * from './BodyText';
|
|
@@ -13,6 +14,7 @@ export * from './Center';
|
|
|
13
14
|
export * from './Checkbox';
|
|
14
15
|
export * from './Container';
|
|
15
16
|
export * from './CurrencyInput';
|
|
17
|
+
export * from './DateInput';
|
|
16
18
|
export * from './DatePicker';
|
|
17
19
|
export * from './DatePickerInput';
|
|
18
20
|
export * from './DescriptionList';
|
|
@@ -38,6 +40,7 @@ export * from './Link';
|
|
|
38
40
|
export * from './List';
|
|
39
41
|
export * from './Menu';
|
|
40
42
|
export * from './Modal';
|
|
43
|
+
export * from './PillGroup';
|
|
41
44
|
export * from './ProgressStepper';
|
|
42
45
|
export * from './Radio';
|
|
43
46
|
export * from './RadioCard';
|
|
@@ -49,6 +52,7 @@ export * from './Switch';
|
|
|
49
52
|
export * from './Tabs';
|
|
50
53
|
export * from './Textarea';
|
|
51
54
|
export * from './ThemedImage';
|
|
55
|
+
export * from './Toast';
|
|
52
56
|
export * from './ToggleButtonCard';
|
|
53
57
|
export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, View } from 'react-native';
|
|
54
58
|
export { Pressable } from 'react-native';
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
readonly borderRadius: 16;
|
|
6
6
|
readonly cell: {
|
|
7
7
|
readonly borderWidth: 1;
|
|
8
|
+
readonly minHeight: 48;
|
|
8
9
|
readonly padding: 12;
|
|
9
10
|
};
|
|
10
11
|
readonly emphasis: {
|
|
@@ -13,6 +14,7 @@ declare const _default: {
|
|
|
13
14
|
readonly headerCell: {
|
|
14
15
|
readonly borderWidth: 2;
|
|
15
16
|
readonly gap: 8;
|
|
17
|
+
readonly height: 56;
|
|
16
18
|
readonly paddingHorizontal: 12;
|
|
17
19
|
readonly paddingVertical: 16;
|
|
18
20
|
};
|
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
borderRadius: 16,
|
|
6
6
|
cell: {
|
|
7
7
|
borderWidth: 1,
|
|
8
|
+
minHeight: 48,
|
|
8
9
|
padding: 12,
|
|
9
10
|
},
|
|
10
11
|
emphasis: {
|
|
@@ -13,6 +14,7 @@ export default {
|
|
|
13
14
|
headerCell: {
|
|
14
15
|
borderWidth: 2,
|
|
15
16
|
gap: 8,
|
|
17
|
+
height: 56,
|
|
16
18
|
paddingHorizontal: 12,
|
|
17
19
|
paddingVertical: 16,
|
|
18
20
|
},
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
declare const _default: {
|
|
5
5
|
readonly backgroundColor: "#3f3f3f";
|
|
6
6
|
readonly borderRadius: 8;
|
|
7
|
-
readonly
|
|
7
|
+
readonly bottomPosition: 32;
|
|
8
|
+
readonly gap: 16;
|
|
8
9
|
readonly padding: 14;
|
|
9
10
|
readonly stack: {
|
|
10
|
-
readonly
|
|
11
|
+
readonly gap: 12;
|
|
12
|
+
};
|
|
13
|
+
readonly text: {
|
|
14
|
+
readonly gap: 8;
|
|
11
15
|
};
|
|
12
16
|
};
|
|
13
17
|
export default _default;
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
readonly borderRadius: 16;
|
|
6
6
|
readonly cell: {
|
|
7
7
|
readonly borderWidth: 1;
|
|
8
|
+
readonly minHeight: 48;
|
|
8
9
|
readonly padding: 12;
|
|
9
10
|
};
|
|
10
11
|
readonly emphasis: {
|
|
@@ -13,6 +14,7 @@ declare const _default: {
|
|
|
13
14
|
readonly headerCell: {
|
|
14
15
|
readonly borderWidth: 2;
|
|
15
16
|
readonly gap: 8;
|
|
17
|
+
readonly height: 56;
|
|
16
18
|
readonly paddingHorizontal: 12;
|
|
17
19
|
readonly paddingVertical: 16;
|
|
18
20
|
};
|
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
borderRadius: 16,
|
|
6
6
|
cell: {
|
|
7
7
|
borderWidth: 1,
|
|
8
|
+
minHeight: 48,
|
|
8
9
|
padding: 12,
|
|
9
10
|
},
|
|
10
11
|
emphasis: {
|
|
@@ -13,6 +14,7 @@ export default {
|
|
|
13
14
|
headerCell: {
|
|
14
15
|
borderWidth: 2,
|
|
15
16
|
gap: 8,
|
|
17
|
+
height: 56,
|
|
16
18
|
paddingHorizontal: 12,
|
|
17
19
|
paddingVertical: 16,
|
|
18
20
|
},
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
declare const _default: {
|
|
5
5
|
readonly backgroundColor: "#101010";
|
|
6
6
|
readonly borderRadius: 8;
|
|
7
|
-
readonly
|
|
7
|
+
readonly bottomPosition: 32;
|
|
8
|
+
readonly gap: 16;
|
|
8
9
|
readonly padding: 14;
|
|
9
10
|
readonly stack: {
|
|
10
|
-
readonly
|
|
11
|
+
readonly gap: 12;
|
|
12
|
+
};
|
|
13
|
+
readonly text: {
|
|
14
|
+
readonly gap: 8;
|
|
11
15
|
};
|
|
12
16
|
};
|
|
13
17
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getInitials(name?: string): string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function getInitials(name) {
|
|
2
|
+
if (!name)
|
|
3
|
+
return undefined;
|
|
4
|
+
const regex = new RegExp(/(\p{L}{1})\p{L}+/gu);
|
|
5
|
+
const names = [...name.matchAll(regex)];
|
|
6
|
+
const initials = (names.shift()?.[1] || '') + (names.pop()?.[1] || '');
|
|
7
|
+
return initials.toUpperCase();
|
|
8
|
+
}
|
package/build/utils/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as formatThousands } from './formatThousands';
|
|
|
3
3
|
export { default as getFlattenedColorValue } from './getFlattenedColorValue';
|
|
4
4
|
export { default as getStyleValue } from './getStyleValue';
|
|
5
5
|
export { default as hexWithOpacity } from './hexWithOpacity';
|
|
6
|
+
export { getInitials } from './getInitials';
|
|
6
7
|
export { default as isEqual } from './isEqual';
|
|
7
8
|
export * from './styleUtils';
|
|
8
9
|
export * from './themeValueHelpers';
|
package/build/utils/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { default as formatThousands } from './formatThousands';
|
|
|
3
3
|
export { default as getFlattenedColorValue } from './getFlattenedColorValue';
|
|
4
4
|
export { default as getStyleValue } from './getStyleValue';
|
|
5
5
|
export { default as hexWithOpacity } from './hexWithOpacity';
|
|
6
|
+
export { getInitials } from './getInitials';
|
|
6
7
|
export { default as isEqual } from './isEqual';
|
|
7
8
|
export * from './styleUtils';
|
|
8
9
|
export * from './themeValueHelpers';
|
|
Binary file
|