@oxyhq/bloom 0.1.31 → 0.1.33
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/lib/commonjs/admonition/index.js +7 -0
- package/lib/commonjs/admonition/index.js.map +1 -1
- package/lib/commonjs/avatar/Avatar.js +2 -18
- package/lib/commonjs/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/bottom-sheet/index.js +16 -6
- package/lib/commonjs/bottom-sheet/index.js.map +1 -1
- package/lib/commonjs/button/Button.js +6 -18
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/chip/Chip.js +6 -16
- package/lib/commonjs/chip/Chip.js.map +1 -1
- package/lib/commonjs/collapsible/Collapsible.js +28 -20
- package/lib/commonjs/collapsible/Collapsible.js.map +1 -1
- package/lib/commonjs/fill/index.js +7 -5
- package/lib/commonjs/fill/index.js.map +1 -1
- package/lib/commonjs/grid/index.js +9 -6
- package/lib/commonjs/grid/index.js.map +1 -1
- package/lib/commonjs/grouped-buttons/GroupedButtons.js +76 -48
- package/lib/commonjs/grouped-buttons/GroupedButtons.js.map +1 -1
- package/lib/commonjs/hooks/index.js +13 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useInteractionState.js +42 -0
- package/lib/commonjs/hooks/useInteractionState.js.map +1 -1
- package/lib/commonjs/hooks/usePressAnimation.js +44 -0
- package/lib/commonjs/hooks/usePressAnimation.js.map +1 -0
- package/lib/commonjs/icon-circle/index.js +7 -5
- package/lib/commonjs/icon-circle/index.js.map +1 -1
- package/lib/commonjs/icons/{EnveopeOpen.js → EnvelopeOpen.js} +1 -1
- package/lib/commonjs/icons/EnvelopeOpen.js.map +1 -0
- package/lib/commonjs/icons/TEMPLATE.js +3 -2
- package/lib/commonjs/icons/TEMPLATE.js.map +1 -1
- package/lib/commonjs/icons/VerifiedCheck.js +3 -2
- package/lib/commonjs/icons/VerifiedCheck.js.map +1 -1
- package/lib/commonjs/icons/VerifierCheck.js +3 -2
- package/lib/commonjs/icons/VerifierCheck.js.map +1 -1
- package/lib/commonjs/icons/index.js +4 -4
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/loading/Loading.js +2 -17
- package/lib/commonjs/loading/Loading.js.map +1 -1
- package/lib/commonjs/loading/SpinnerIcon.js +3 -34
- package/lib/commonjs/loading/SpinnerIcon.js.map +1 -1
- package/lib/commonjs/prompt-input/Actions.js +1 -0
- package/lib/commonjs/prompt-input/Actions.js.map +1 -1
- package/lib/commonjs/prompt-input/Attachments.js +1 -0
- package/lib/commonjs/prompt-input/Attachments.js.map +1 -1
- package/lib/commonjs/prompt-input/PromptInput.js +1 -0
- package/lib/commonjs/prompt-input/PromptInput.js.map +1 -1
- package/lib/commonjs/prompt-input/SubmitButton.js +1 -0
- package/lib/commonjs/prompt-input/SubmitButton.js.map +1 -1
- package/lib/commonjs/prompt-input/Textarea.js +1 -0
- package/lib/commonjs/prompt-input/Textarea.js.map +1 -1
- package/lib/commonjs/prompt-input/Textarea.web.js +1 -0
- package/lib/commonjs/prompt-input/Textarea.web.js.map +1 -1
- package/lib/commonjs/search-input/index.js +1 -0
- package/lib/commonjs/search-input/index.js.map +1 -1
- package/lib/commonjs/settings-list/SettingsList.js +10 -11
- package/lib/commonjs/settings-list/SettingsList.js.map +1 -1
- package/lib/commonjs/skeleton/index.js +5 -0
- package/lib/commonjs/skeleton/index.js.map +1 -1
- package/lib/commonjs/switch/Switch.js +43 -28
- package/lib/commonjs/switch/Switch.js.map +1 -1
- package/lib/commonjs/tabs/Tabs.js +6 -15
- package/lib/commonjs/tabs/Tabs.js.map +1 -1
- package/lib/commonjs/theme/BloomThemeProvider.js +5 -4
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/color-presets.js +11 -11
- package/lib/commonjs/theme/color-presets.js.map +1 -1
- package/lib/commonjs/typography/index.js +14 -5
- package/lib/commonjs/typography/index.js.map +1 -1
- package/lib/commonjs/utils/lazy-require.js +37 -0
- package/lib/commonjs/utils/lazy-require.js.map +1 -0
- package/lib/module/admonition/index.js +7 -0
- package/lib/module/admonition/index.js.map +1 -1
- package/lib/module/avatar/Avatar.js +2 -18
- package/lib/module/avatar/Avatar.js.map +1 -1
- package/lib/module/bottom-sheet/index.js +16 -6
- package/lib/module/bottom-sheet/index.js.map +1 -1
- package/lib/module/button/Button.js +7 -19
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/chip/Chip.js +7 -17
- package/lib/module/chip/Chip.js.map +1 -1
- package/lib/module/collapsible/Collapsible.js +30 -22
- package/lib/module/collapsible/Collapsible.js.map +1 -1
- package/lib/module/fill/index.js +5 -3
- package/lib/module/fill/index.js.map +1 -1
- package/lib/module/grid/index.js +9 -5
- package/lib/module/grid/index.js.map +1 -1
- package/lib/module/grouped-buttons/GroupedButtons.js +77 -48
- package/lib/module/grouped-buttons/GroupedButtons.js.map +1 -1
- package/lib/module/hooks/index.js +2 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useInteractionState.js +41 -0
- package/lib/module/hooks/useInteractionState.js.map +1 -1
- package/lib/module/hooks/usePressAnimation.js +41 -0
- package/lib/module/hooks/usePressAnimation.js.map +1 -0
- package/lib/module/icon-circle/index.js +5 -3
- package/lib/module/icon-circle/index.js.map +1 -1
- package/lib/module/icons/{EnveopeOpen.js → EnvelopeOpen.js} +1 -1
- package/lib/module/icons/EnvelopeOpen.js.map +1 -0
- package/lib/module/icons/TEMPLATE.js +3 -2
- package/lib/module/icons/TEMPLATE.js.map +1 -1
- package/lib/module/icons/VerifiedCheck.js +3 -2
- package/lib/module/icons/VerifiedCheck.js.map +1 -1
- package/lib/module/icons/VerifierCheck.js +3 -2
- package/lib/module/icons/VerifierCheck.js.map +1 -1
- package/lib/module/icons/index.js +1 -1
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/loading/Loading.js +2 -17
- package/lib/module/loading/Loading.js.map +1 -1
- package/lib/module/loading/SpinnerIcon.js +3 -34
- package/lib/module/loading/SpinnerIcon.js.map +1 -1
- package/lib/module/prompt-input/Actions.js +1 -0
- package/lib/module/prompt-input/Actions.js.map +1 -1
- package/lib/module/prompt-input/Attachments.js +1 -0
- package/lib/module/prompt-input/Attachments.js.map +1 -1
- package/lib/module/prompt-input/PromptInput.js +1 -0
- package/lib/module/prompt-input/PromptInput.js.map +1 -1
- package/lib/module/prompt-input/SubmitButton.js +1 -0
- package/lib/module/prompt-input/SubmitButton.js.map +1 -1
- package/lib/module/prompt-input/Textarea.js +1 -0
- package/lib/module/prompt-input/Textarea.js.map +1 -1
- package/lib/module/prompt-input/Textarea.web.js +1 -0
- package/lib/module/prompt-input/Textarea.web.js.map +1 -1
- package/lib/module/search-input/index.js +1 -0
- package/lib/module/search-input/index.js.map +1 -1
- package/lib/module/settings-list/SettingsList.js +10 -11
- package/lib/module/settings-list/SettingsList.js.map +1 -1
- package/lib/module/skeleton/index.js +5 -0
- package/lib/module/skeleton/index.js.map +1 -1
- package/lib/module/switch/Switch.js +45 -30
- package/lib/module/switch/Switch.js.map +1 -1
- package/lib/module/tabs/Tabs.js +8 -17
- package/lib/module/tabs/Tabs.js.map +1 -1
- package/lib/module/theme/BloomThemeProvider.js +5 -4
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/theme/color-presets.js +11 -11
- package/lib/module/theme/color-presets.js.map +1 -1
- package/lib/module/typography/index.js +12 -3
- package/lib/module/typography/index.js.map +1 -1
- package/lib/module/utils/lazy-require.js +33 -0
- package/lib/module/utils/lazy-require.js.map +1 -0
- package/lib/typescript/commonjs/admonition/index.d.ts +21 -0
- package/lib/typescript/commonjs/admonition/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/commonjs/collapsible/Collapsible.d.ts.map +1 -1
- package/lib/typescript/commonjs/fill/index.d.ts +2 -2
- package/lib/typescript/commonjs/fill/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/grid/index.d.ts +4 -4
- package/lib/typescript/commonjs/grid/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/grouped-buttons/GroupedButtons.d.ts +9 -5
- package/lib/typescript/commonjs/grouped-buttons/GroupedButtons.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/index.d.ts +2 -1
- package/lib/typescript/commonjs/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/useInteractionState.d.ts +23 -0
- package/lib/typescript/commonjs/hooks/useInteractionState.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts +16 -0
- package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts.map +1 -0
- package/lib/typescript/commonjs/icon-circle/index.d.ts +4 -4
- package/lib/typescript/commonjs/icon-circle/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/{EnveopeOpen.d.ts → EnvelopeOpen.d.ts} +1 -1
- package/lib/typescript/commonjs/icons/EnvelopeOpen.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/TEMPLATE.d.ts +2 -1
- package/lib/typescript/commonjs/icons/TEMPLATE.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/VerifiedCheck.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/VerifierCheck.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/loading/Loading.d.ts.map +1 -1
- package/lib/typescript/commonjs/loading/SpinnerIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/prompt-input/Actions.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Actions.d.ts.map +1 -1
- package/lib/typescript/commonjs/prompt-input/Attachments.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Attachments.d.ts.map +1 -1
- package/lib/typescript/commonjs/prompt-input/PromptInput.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/PromptInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/prompt-input/SubmitButton.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/SubmitButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/prompt-input/Textarea.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Textarea.d.ts.map +1 -1
- package/lib/typescript/commonjs/prompt-input/Textarea.web.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Textarea.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/settings-list/SettingsList.d.ts.map +1 -1
- package/lib/typescript/commonjs/skeleton/index.d.ts +15 -0
- package/lib/typescript/commonjs/skeleton/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/switch/Switch.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/typography/index.d.ts +11 -10
- package/lib/typescript/commonjs/typography/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/lazy-require.d.ts +15 -0
- package/lib/typescript/commonjs/utils/lazy-require.d.ts.map +1 -0
- package/lib/typescript/module/admonition/index.d.ts +21 -0
- package/lib/typescript/module/admonition/index.d.ts.map +1 -1
- package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/module/collapsible/Collapsible.d.ts.map +1 -1
- package/lib/typescript/module/fill/index.d.ts +2 -2
- package/lib/typescript/module/fill/index.d.ts.map +1 -1
- package/lib/typescript/module/grid/index.d.ts +4 -4
- package/lib/typescript/module/grid/index.d.ts.map +1 -1
- package/lib/typescript/module/grouped-buttons/GroupedButtons.d.ts +9 -5
- package/lib/typescript/module/grouped-buttons/GroupedButtons.d.ts.map +1 -1
- package/lib/typescript/module/hooks/index.d.ts +2 -1
- package/lib/typescript/module/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/hooks/useInteractionState.d.ts +23 -0
- package/lib/typescript/module/hooks/useInteractionState.d.ts.map +1 -1
- package/lib/typescript/module/hooks/usePressAnimation.d.ts +16 -0
- package/lib/typescript/module/hooks/usePressAnimation.d.ts.map +1 -0
- package/lib/typescript/module/icon-circle/index.d.ts +4 -4
- package/lib/typescript/module/icon-circle/index.d.ts.map +1 -1
- package/lib/typescript/module/icons/{EnveopeOpen.d.ts → EnvelopeOpen.d.ts} +1 -1
- package/lib/typescript/module/icons/EnvelopeOpen.d.ts.map +1 -0
- package/lib/typescript/module/icons/TEMPLATE.d.ts +2 -1
- package/lib/typescript/module/icons/TEMPLATE.d.ts.map +1 -1
- package/lib/typescript/module/icons/VerifiedCheck.d.ts.map +1 -1
- package/lib/typescript/module/icons/VerifierCheck.d.ts.map +1 -1
- package/lib/typescript/module/icons/index.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/loading/Loading.d.ts.map +1 -1
- package/lib/typescript/module/loading/SpinnerIcon.d.ts.map +1 -1
- package/lib/typescript/module/prompt-input/Actions.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Actions.d.ts.map +1 -1
- package/lib/typescript/module/prompt-input/Attachments.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Attachments.d.ts.map +1 -1
- package/lib/typescript/module/prompt-input/PromptInput.d.ts +3 -0
- package/lib/typescript/module/prompt-input/PromptInput.d.ts.map +1 -1
- package/lib/typescript/module/prompt-input/SubmitButton.d.ts +3 -0
- package/lib/typescript/module/prompt-input/SubmitButton.d.ts.map +1 -1
- package/lib/typescript/module/prompt-input/Textarea.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Textarea.d.ts.map +1 -1
- package/lib/typescript/module/prompt-input/Textarea.web.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Textarea.web.d.ts.map +1 -1
- package/lib/typescript/module/settings-list/SettingsList.d.ts.map +1 -1
- package/lib/typescript/module/skeleton/index.d.ts +15 -0
- package/lib/typescript/module/skeleton/index.d.ts.map +1 -1
- package/lib/typescript/module/switch/Switch.d.ts.map +1 -1
- package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/module/typography/index.d.ts +11 -10
- package/lib/typescript/module/typography/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/lazy-require.d.ts +15 -0
- package/lib/typescript/module/utils/lazy-require.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/BloomThemeProvider.test.tsx +3 -3
- package/src/admonition/index.tsx +7 -0
- package/src/avatar/Avatar.tsx +2 -19
- package/src/bottom-sheet/index.tsx +18 -6
- package/src/button/Button.tsx +6 -22
- package/src/chip/Chip.tsx +3 -19
- package/src/collapsible/Collapsible.tsx +34 -25
- package/src/fill/index.tsx +6 -3
- package/src/grid/index.tsx +11 -5
- package/src/grouped-buttons/GroupedButtons.tsx +79 -60
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useInteractionState.ts +21 -0
- package/src/hooks/usePressAnimation.ts +37 -0
- package/src/icon-circle/index.tsx +6 -3
- package/src/icons/TEMPLATE.tsx +2 -2
- package/src/icons/VerifiedCheck.tsx +3 -2
- package/src/icons/VerifierCheck.tsx +3 -2
- package/src/icons/index.ts +1 -1
- package/src/loading/Loading.tsx +2 -18
- package/src/loading/SpinnerIcon.tsx +4 -36
- package/src/prompt-input/Actions.tsx +1 -0
- package/src/prompt-input/Attachments.tsx +1 -0
- package/src/prompt-input/PromptInput.tsx +1 -0
- package/src/prompt-input/SubmitButton.tsx +1 -0
- package/src/prompt-input/Textarea.tsx +1 -0
- package/src/prompt-input/Textarea.web.tsx +1 -0
- package/src/search-input/index.tsx +1 -0
- package/src/settings-list/SettingsList.tsx +12 -8
- package/src/skeleton/index.tsx +5 -0
- package/src/switch/Switch.tsx +45 -23
- package/src/tabs/Tabs.tsx +3 -21
- package/src/theme/BloomThemeProvider.tsx +6 -4
- package/src/theme/color-presets.ts +11 -11
- package/src/typography/index.tsx +14 -4
- package/src/utils/lazy-require.ts +31 -0
- package/lib/commonjs/icons/EnveopeOpen.js.map +0 -1
- package/lib/module/icons/EnveopeOpen.js.map +0 -1
- package/lib/typescript/commonjs/icons/EnveopeOpen.d.ts.map +0 -1
- package/lib/typescript/module/icons/EnveopeOpen.d.ts.map +0 -1
- /package/src/icons/{EnveopeOpen.tsx → EnvelopeOpen.tsx} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { animation } from '../styles/tokens';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Hook that provides press-scale animation feedback.
|
|
8
|
+
*
|
|
9
|
+
* Returns an `Animated.Value` for the scale transform and press-in/press-out
|
|
10
|
+
* handlers that spring the value between 1 and the target scale.
|
|
11
|
+
*
|
|
12
|
+
* @param pressScale - Scale value when pressed (e.g. 0.97). Pass `undefined` to disable.
|
|
13
|
+
*/
|
|
14
|
+
export function usePressAnimation(pressScale: number | undefined = 0.97) {
|
|
15
|
+
const scaleAnim = useRef(new Animated.Value(1)).current;
|
|
16
|
+
const enabled = pressScale !== undefined;
|
|
17
|
+
|
|
18
|
+
const onPressIn = useCallback(() => {
|
|
19
|
+
if (!enabled) return;
|
|
20
|
+
Animated.spring(scaleAnim, {
|
|
21
|
+
toValue: pressScale!,
|
|
22
|
+
useNativeDriver: true,
|
|
23
|
+
...animation.spring.snappy,
|
|
24
|
+
}).start();
|
|
25
|
+
}, [scaleAnim, enabled, pressScale]);
|
|
26
|
+
|
|
27
|
+
const onPressOut = useCallback(() => {
|
|
28
|
+
if (!enabled) return;
|
|
29
|
+
Animated.spring(scaleAnim, {
|
|
30
|
+
toValue: 1,
|
|
31
|
+
useNativeDriver: true,
|
|
32
|
+
...animation.spring.gentle,
|
|
33
|
+
}).start();
|
|
34
|
+
}, [scaleAnim, enabled]);
|
|
35
|
+
|
|
36
|
+
return { scaleAnim, onPressIn, onPressOut, enabled } as const;
|
|
37
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
2
|
import { View, type ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { type Props as IconProps } from '../icons/common';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const IconCircleComponent = function IconCircle({
|
|
8
8
|
icon: Icon,
|
|
9
9
|
size = 'xl',
|
|
10
10
|
style,
|
|
@@ -33,4 +33,7 @@ export function IconCircle({
|
|
|
33
33
|
<Icon size={size} style={[{ color: colors.primary }, iconStyle]} />
|
|
34
34
|
</View>
|
|
35
35
|
);
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const IconCircle = memo(IconCircleComponent);
|
|
39
|
+
IconCircle.displayName = 'IconCircle';
|
package/src/icons/TEMPLATE.tsx
CHANGED
|
@@ -46,7 +46,7 @@ export function createSinglePathSVG({
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export function createMultiPathSVG({ paths }: { paths: string[] }) {
|
|
49
|
+
export function createMultiPathSVG({ paths, viewBox }: { paths: string[]; viewBox?: string }) {
|
|
50
50
|
return forwardRef<Svg, Props>(function IconImpl(props, ref) {
|
|
51
51
|
const { fill, size, style, gradient, ...rest } = useCommonSVGProps(props);
|
|
52
52
|
|
|
@@ -55,7 +55,7 @@ export function createMultiPathSVG({ paths }: { paths: string[] }) {
|
|
|
55
55
|
fill="none"
|
|
56
56
|
{...rest}
|
|
57
57
|
ref={ref}
|
|
58
|
-
viewBox=
|
|
58
|
+
viewBox={viewBox || '0 0 24 24'}
|
|
59
59
|
width={size}
|
|
60
60
|
height={size}
|
|
61
61
|
style={[style]}>
|
|
@@ -4,8 +4,8 @@ import Svg, {Circle, Path} from 'react-native-svg'
|
|
|
4
4
|
import {type Props, useCommonSVGProps} from './common'
|
|
5
5
|
|
|
6
6
|
export const VerifiedCheck = forwardRef<Svg, Props>(
|
|
7
|
-
function
|
|
8
|
-
const {fill, size, style, ...rest} = useCommonSVGProps(props)
|
|
7
|
+
function VerifiedCheckImpl(props, ref) {
|
|
8
|
+
const {fill, size, style, gradient, ...rest} = useCommonSVGProps(props)
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<Svg
|
|
@@ -16,6 +16,7 @@ export const VerifiedCheck = forwardRef<Svg, Props>(
|
|
|
16
16
|
width={size}
|
|
17
17
|
height={size}
|
|
18
18
|
style={[style]}>
|
|
19
|
+
{gradient}
|
|
19
20
|
<Circle cx="12" cy="12" r="11.5" fill={fill} />
|
|
20
21
|
<Path
|
|
21
22
|
fill="#fff"
|
|
@@ -4,8 +4,8 @@ import Svg, {Path} from 'react-native-svg'
|
|
|
4
4
|
import {type Props, useCommonSVGProps} from './common'
|
|
5
5
|
|
|
6
6
|
export const VerifierCheck = forwardRef<Svg, Props>(
|
|
7
|
-
function
|
|
8
|
-
const {fill, size, style, ...rest} = useCommonSVGProps(props)
|
|
7
|
+
function VerifierCheckImpl(props, ref) {
|
|
8
|
+
const {fill, size, style, gradient, ...rest} = useCommonSVGProps(props)
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<Svg
|
|
@@ -16,6 +16,7 @@ export const VerifierCheck = forwardRef<Svg, Props>(
|
|
|
16
16
|
width={size}
|
|
17
17
|
height={size}
|
|
18
18
|
style={[style]}>
|
|
19
|
+
{gradient}
|
|
19
20
|
<Path
|
|
20
21
|
fill={fill}
|
|
21
22
|
fillRule="evenodd"
|
package/src/icons/index.ts
CHANGED
|
@@ -58,7 +58,7 @@ export * from './Download';
|
|
|
58
58
|
export * from './EditBig';
|
|
59
59
|
export * from './Emoji';
|
|
60
60
|
export * from './Envelope';
|
|
61
|
-
export * from './
|
|
61
|
+
export * from './EnvelopeOpen';
|
|
62
62
|
export * from './Explosion';
|
|
63
63
|
export * from './Eye';
|
|
64
64
|
export * from './EyeSlash';
|
package/src/loading/Loading.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { View, Text, StyleSheet, type DimensionValue } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { animation } from '../styles/tokens';
|
|
6
|
+
import { lazyRequire } from '../utils/lazy-require';
|
|
6
7
|
import { SpinnerIcon } from './SpinnerIcon';
|
|
7
8
|
import type {
|
|
8
9
|
LoadingProps,
|
|
@@ -20,24 +21,7 @@ const SIZE_CONFIG = {
|
|
|
20
21
|
|
|
21
22
|
// Lazy-loaded reanimated for the top variant
|
|
22
23
|
type ReanimatedType = typeof import('react-native-reanimated');
|
|
23
|
-
|
|
24
|
-
let reanimatedResolved = false;
|
|
25
|
-
|
|
26
|
-
function getReanimated(): ReanimatedType | null {
|
|
27
|
-
if (!reanimatedResolved) {
|
|
28
|
-
reanimatedResolved = true;
|
|
29
|
-
try {
|
|
30
|
-
// Guard for ESM environments (Vite/browser) where require is not defined.
|
|
31
|
-
if (typeof require !== 'undefined') {
|
|
32
|
-
const moduleName = 'react-native-reanimated';
|
|
33
|
-
reanimatedModule = require(moduleName);
|
|
34
|
-
}
|
|
35
|
-
} catch {
|
|
36
|
-
reanimatedModule = null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return reanimatedModule;
|
|
40
|
-
}
|
|
24
|
+
const getReanimated = lazyRequire<ReanimatedType>('react-native-reanimated');
|
|
41
25
|
|
|
42
26
|
const SpinnerLoading: React.FC<SpinnerLoadingProps> = ({
|
|
43
27
|
size = 'medium',
|
|
@@ -1,47 +1,15 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { ActivityIndicator, type ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { lazyRequire } from '../utils/lazy-require';
|
|
5
|
+
|
|
4
6
|
// Lazy-loaded dependencies for the SVG spinner.
|
|
5
7
|
// Falls back to ActivityIndicator if react-native-svg or react-native-reanimated are not installed.
|
|
6
8
|
type SvgModuleType = typeof import('react-native-svg');
|
|
7
9
|
type ReanimatedType = typeof import('react-native-reanimated');
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let reanimatedModule: ReanimatedType | null = null;
|
|
12
|
-
let reanimatedResolved = false;
|
|
13
|
-
|
|
14
|
-
function getSvgModule(): SvgModuleType | null {
|
|
15
|
-
if (!svgModuleResolved) {
|
|
16
|
-
svgModuleResolved = true;
|
|
17
|
-
try {
|
|
18
|
-
// Guard for ESM environments (Vite/browser) where require is not defined.
|
|
19
|
-
if (typeof require !== 'undefined') {
|
|
20
|
-
const moduleName = 'react-native-svg';
|
|
21
|
-
svgModule = require(moduleName);
|
|
22
|
-
}
|
|
23
|
-
} catch {
|
|
24
|
-
svgModule = null;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return svgModule;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function getReanimated(): ReanimatedType | null {
|
|
31
|
-
if (!reanimatedResolved) {
|
|
32
|
-
reanimatedResolved = true;
|
|
33
|
-
try {
|
|
34
|
-
// Guard for ESM environments (Vite/browser) where require is not defined.
|
|
35
|
-
if (typeof require !== 'undefined') {
|
|
36
|
-
const moduleName = 'react-native-reanimated';
|
|
37
|
-
reanimatedModule = require(moduleName);
|
|
38
|
-
}
|
|
39
|
-
} catch {
|
|
40
|
-
reanimatedModule = null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return reanimatedModule;
|
|
44
|
-
}
|
|
11
|
+
const getSvgModule = lazyRequire<SvgModuleType>('react-native-svg');
|
|
12
|
+
const getReanimated = lazyRequire<ReanimatedType>('react-native-reanimated');
|
|
45
13
|
|
|
46
14
|
interface SpinnerIconProps {
|
|
47
15
|
size?: number;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { View, Text, Pressable, StyleSheet } from 'react-native';
|
|
3
|
-
import Svg, { Path } from 'react-native-svg';
|
|
4
3
|
|
|
5
4
|
import { useTheme } from '../theme/use-theme';
|
|
6
5
|
import type {
|
|
@@ -9,14 +8,19 @@ import type {
|
|
|
9
8
|
SettingsListDividerProps,
|
|
10
9
|
} from './types';
|
|
11
10
|
|
|
12
|
-
// ── Chevron icon (
|
|
11
|
+
// ── Chevron icon (unicode-based, no SVG dependency) ─────────────
|
|
13
12
|
const Chevron = memo(({ size = 16, color }: { size?: number; color: string }) => (
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
<Text
|
|
14
|
+
style={{
|
|
15
|
+
fontSize: size,
|
|
16
|
+
color,
|
|
17
|
+
lineHeight: size,
|
|
18
|
+
textAlign: 'center',
|
|
19
|
+
width: size,
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{'\u203A'}
|
|
23
|
+
</Text>
|
|
20
24
|
));
|
|
21
25
|
Chevron.displayName = 'Chevron';
|
|
22
26
|
|
package/src/skeleton/index.tsx
CHANGED
|
@@ -65,6 +65,7 @@ export function Text({
|
|
|
65
65
|
</View>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
+
Text.displayName = 'Skeleton.Text';
|
|
68
69
|
|
|
69
70
|
export function Circle({
|
|
70
71
|
children,
|
|
@@ -96,6 +97,7 @@ export function Circle({
|
|
|
96
97
|
</Animated.View>
|
|
97
98
|
);
|
|
98
99
|
}
|
|
100
|
+
Circle.displayName = 'Skeleton.Circle';
|
|
99
101
|
|
|
100
102
|
export function Pill({
|
|
101
103
|
size,
|
|
@@ -124,6 +126,7 @@ export function Pill({
|
|
|
124
126
|
/>
|
|
125
127
|
);
|
|
126
128
|
}
|
|
129
|
+
Pill.displayName = 'Skeleton.Pill';
|
|
127
130
|
|
|
128
131
|
export function Col({
|
|
129
132
|
children,
|
|
@@ -134,6 +137,7 @@ export function Col({
|
|
|
134
137
|
}) {
|
|
135
138
|
return <View style={[styles.col, style]}>{children}</View>;
|
|
136
139
|
}
|
|
140
|
+
Col.displayName = 'Skeleton.Col';
|
|
137
141
|
|
|
138
142
|
export function Row({
|
|
139
143
|
children,
|
|
@@ -144,6 +148,7 @@ export function Row({
|
|
|
144
148
|
}) {
|
|
145
149
|
return <View style={[styles.row, style]}>{children}</View>;
|
|
146
150
|
}
|
|
151
|
+
Row.displayName = 'Skeleton.Row';
|
|
147
152
|
|
|
148
153
|
const styles = StyleSheet.create({
|
|
149
154
|
textOuter: {
|
package/src/switch/Switch.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { memo,
|
|
2
|
-
import { Pressable, Animated } from 'react-native';
|
|
1
|
+
import React, { memo, useCallback, useRef } from 'react';
|
|
2
|
+
import { Pressable, Animated, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { animation } from '../styles/tokens';
|
|
@@ -16,30 +16,39 @@ const SwitchComponent = React.forwardRef<React.ElementRef<typeof Pressable>, Swi
|
|
|
16
16
|
const anim = useRef(new Animated.Value(value ? 1 : 0)).current;
|
|
17
17
|
const pressAnim = useRef(new Animated.Value(0)).current;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// Track last value to detect external changes and animate accordingly.
|
|
20
|
+
// This avoids useEffect while still handling controlled value changes.
|
|
21
|
+
const prevValueRef = useRef(value);
|
|
22
|
+
if (prevValueRef.current !== value) {
|
|
23
|
+
prevValueRef.current = value;
|
|
20
24
|
Animated.spring(anim, {
|
|
21
25
|
toValue: value ? 1 : 0,
|
|
22
26
|
useNativeDriver: false,
|
|
23
27
|
...animation.spring.gentle,
|
|
24
28
|
}).start();
|
|
25
|
-
}
|
|
29
|
+
}
|
|
26
30
|
|
|
27
|
-
const
|
|
31
|
+
const handlePress = useCallback(() => {
|
|
32
|
+
if (disabled) return;
|
|
33
|
+
onValueChange(!value);
|
|
34
|
+
}, [disabled, value, onValueChange]);
|
|
35
|
+
|
|
36
|
+
const onPressIn = useCallback(() => {
|
|
28
37
|
if (disabled) return;
|
|
29
38
|
Animated.spring(pressAnim, {
|
|
30
39
|
toValue: 1,
|
|
31
40
|
useNativeDriver: false,
|
|
32
41
|
...animation.spring.snappy,
|
|
33
42
|
}).start();
|
|
34
|
-
};
|
|
43
|
+
}, [disabled, pressAnim]);
|
|
35
44
|
|
|
36
|
-
const onPressOut = () => {
|
|
45
|
+
const onPressOut = useCallback(() => {
|
|
37
46
|
Animated.spring(pressAnim, {
|
|
38
47
|
toValue: 0,
|
|
39
48
|
useNativeDriver: false,
|
|
40
49
|
...animation.spring.gentle,
|
|
41
50
|
}).start();
|
|
42
|
-
};
|
|
51
|
+
}, [pressAnim]);
|
|
43
52
|
|
|
44
53
|
const track = TRACK[size];
|
|
45
54
|
const thumb = THUMB[size];
|
|
@@ -73,11 +82,11 @@ const SwitchComponent = React.forwardRef<React.ElementRef<typeof Pressable>, Swi
|
|
|
73
82
|
role="switch"
|
|
74
83
|
aria-checked={value}
|
|
75
84
|
accessibilityState={{ checked: value, disabled }}
|
|
76
|
-
onPress={
|
|
85
|
+
onPress={handlePress}
|
|
77
86
|
onPressIn={onPressIn}
|
|
78
87
|
onPressOut={onPressOut}
|
|
79
|
-
style={[
|
|
80
|
-
hitSlop={
|
|
88
|
+
style={[disabled && styles.disabled, style]}
|
|
89
|
+
hitSlop={HIT_SLOP}
|
|
81
90
|
testID={testID}
|
|
82
91
|
>
|
|
83
92
|
<Animated.View
|
|
@@ -91,18 +100,15 @@ const SwitchComponent = React.forwardRef<React.ElementRef<typeof Pressable>, Swi
|
|
|
91
100
|
}}
|
|
92
101
|
>
|
|
93
102
|
<Animated.View
|
|
94
|
-
style={
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
shadowRadius: 3,
|
|
104
|
-
elevation: 3,
|
|
105
|
-
}}
|
|
103
|
+
style={[
|
|
104
|
+
styles.thumb,
|
|
105
|
+
{
|
|
106
|
+
width: thumb,
|
|
107
|
+
height: thumbHeight,
|
|
108
|
+
borderRadius: thumbRadius,
|
|
109
|
+
transform: [{ translateX: thumbX }],
|
|
110
|
+
},
|
|
111
|
+
]}
|
|
106
112
|
/>
|
|
107
113
|
</Animated.View>
|
|
108
114
|
</Pressable>
|
|
@@ -113,3 +119,19 @@ const SwitchComponent = React.forwardRef<React.ElementRef<typeof Pressable>, Swi
|
|
|
113
119
|
SwitchComponent.displayName = 'Switch';
|
|
114
120
|
|
|
115
121
|
export const Switch = memo(SwitchComponent);
|
|
122
|
+
|
|
123
|
+
const HIT_SLOP = { top: 8, bottom: 8, left: 8, right: 8 } as const;
|
|
124
|
+
|
|
125
|
+
const styles = StyleSheet.create({
|
|
126
|
+
disabled: {
|
|
127
|
+
opacity: 0.4,
|
|
128
|
+
},
|
|
129
|
+
thumb: {
|
|
130
|
+
backgroundColor: '#fff',
|
|
131
|
+
shadowColor: '#000',
|
|
132
|
+
shadowOffset: { width: 0, height: 2 },
|
|
133
|
+
shadowOpacity: 0.15,
|
|
134
|
+
shadowRadius: 3,
|
|
135
|
+
elevation: 3,
|
|
136
|
+
},
|
|
137
|
+
});
|
package/src/tabs/Tabs.tsx
CHANGED
|
@@ -3,9 +3,7 @@ import React, {
|
|
|
3
3
|
memo,
|
|
4
4
|
useCallback,
|
|
5
5
|
useContext,
|
|
6
|
-
useEffect,
|
|
7
6
|
useMemo,
|
|
8
|
-
useRef,
|
|
9
7
|
} from 'react';
|
|
10
8
|
import {
|
|
11
9
|
View,
|
|
@@ -15,11 +13,11 @@ import {
|
|
|
15
13
|
ScrollView,
|
|
16
14
|
type ViewStyle,
|
|
17
15
|
type TextStyle,
|
|
18
|
-
type LayoutChangeEvent,
|
|
19
16
|
} from 'react-native';
|
|
20
17
|
|
|
21
18
|
import { useTheme } from '../theme/use-theme';
|
|
22
|
-
import {
|
|
19
|
+
import { usePressAnimation } from '../hooks/usePressAnimation';
|
|
20
|
+
import { borderRadius, space } from '../styles/tokens';
|
|
23
21
|
import type { TabsProps, TabProps, TabPanelProps, TabsVariant } from './types';
|
|
24
22
|
|
|
25
23
|
interface TabsContextValue {
|
|
@@ -101,7 +99,7 @@ const TabComponent: React.FC<TabProps> = ({
|
|
|
101
99
|
const theme = useTheme();
|
|
102
100
|
const { value: selectedValue, onValueChange, variant } = useContext(TabsContext);
|
|
103
101
|
const isSelected = value === selectedValue;
|
|
104
|
-
const scaleAnim =
|
|
102
|
+
const { scaleAnim, onPressIn, onPressOut } = usePressAnimation(0.97);
|
|
105
103
|
|
|
106
104
|
const handlePress = useCallback(() => {
|
|
107
105
|
if (!disabled) {
|
|
@@ -109,22 +107,6 @@ const TabComponent: React.FC<TabProps> = ({
|
|
|
109
107
|
}
|
|
110
108
|
}, [value, disabled, onValueChange]);
|
|
111
109
|
|
|
112
|
-
const onPressIn = useCallback(() => {
|
|
113
|
-
Animated.spring(scaleAnim, {
|
|
114
|
-
toValue: 0.97,
|
|
115
|
-
useNativeDriver: true,
|
|
116
|
-
...animation.spring.snappy,
|
|
117
|
-
}).start();
|
|
118
|
-
}, [scaleAnim]);
|
|
119
|
-
|
|
120
|
-
const onPressOut = useCallback(() => {
|
|
121
|
-
Animated.spring(scaleAnim, {
|
|
122
|
-
toValue: 1,
|
|
123
|
-
useNativeDriver: true,
|
|
124
|
-
...animation.spring.gentle,
|
|
125
|
-
}).start();
|
|
126
|
-
}, [scaleAnim]);
|
|
127
|
-
|
|
128
110
|
const tabStyle = useMemo((): ViewStyle => {
|
|
129
111
|
const base: ViewStyle = {
|
|
130
112
|
flexDirection: 'row',
|
|
@@ -46,6 +46,8 @@ export function buildTheme(appColor: AppColorName, resolved: 'light' | 'dark', i
|
|
|
46
46
|
const background = hslVarToCSS(vars['--background'] ?? '0 0% 0%');
|
|
47
47
|
const mutedForeground = hslVarToCSS(vars['--muted-foreground'] ?? '0 0% 50%');
|
|
48
48
|
|
|
49
|
+
const primaryColor = hslVarToCSS(vars['--primary'] ?? '0 0% 50%');
|
|
50
|
+
|
|
49
51
|
themeColors = {
|
|
50
52
|
background,
|
|
51
53
|
backgroundSecondary: surface,
|
|
@@ -58,15 +60,15 @@ export function buildTheme(appColor: AppColorName, resolved: 'light' | 'dark', i
|
|
|
58
60
|
border: hslVarToCSS(vars['--border'] ?? '0 0% 20%'),
|
|
59
61
|
borderLight: hslVarToCSS(vars['--input'] ?? '0 0% 20%'),
|
|
60
62
|
|
|
61
|
-
primary:
|
|
63
|
+
primary: primaryColor,
|
|
62
64
|
primaryLight: surface,
|
|
63
65
|
primaryDark: background,
|
|
64
66
|
|
|
65
|
-
secondary:
|
|
67
|
+
secondary: primaryColor,
|
|
66
68
|
|
|
67
|
-
tint:
|
|
69
|
+
tint: primaryColor,
|
|
68
70
|
icon: mutedForeground,
|
|
69
|
-
iconActive:
|
|
71
|
+
iconActive: primaryColor,
|
|
70
72
|
|
|
71
73
|
success: '#10B981',
|
|
72
74
|
error: '#EF4444',
|
|
@@ -599,23 +599,23 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
599
599
|
light: {
|
|
600
600
|
'--background': '0 0% 99%',
|
|
601
601
|
'--foreground': '0 0% 12%',
|
|
602
|
-
'--surface': '92
|
|
602
|
+
'--surface': '92 12% 95%',
|
|
603
603
|
'--surface-foreground': '0 0% 12%',
|
|
604
604
|
'--popover': '0 0% 100%',
|
|
605
605
|
'--popover-foreground': '0 0% 12%',
|
|
606
|
-
'--primary': '92
|
|
607
|
-
'--primary-foreground': '0 0%
|
|
608
|
-
'--secondary': '92
|
|
606
|
+
'--primary': '92 90% 25%',
|
|
607
|
+
'--primary-foreground': '0 0% 100%',
|
|
608
|
+
'--secondary': '92 10% 92%',
|
|
609
609
|
'--secondary-foreground': '0 0% 12%',
|
|
610
|
-
'--muted': '92 8%
|
|
611
|
-
'--muted-foreground': '
|
|
612
|
-
'--accent': '92
|
|
610
|
+
'--muted': '92 8% 93%',
|
|
611
|
+
'--muted-foreground': '0 0% 40%',
|
|
612
|
+
'--accent': '92 10% 92%',
|
|
613
613
|
'--accent-foreground': '0 0% 12%',
|
|
614
614
|
'--destructive': '0 84% 60%',
|
|
615
|
-
'--border': '92 8%
|
|
616
|
-
'--input': '92 8%
|
|
617
|
-
'--ring': '92
|
|
618
|
-
'--sidebar': '92
|
|
615
|
+
'--border': '92 8% 85%',
|
|
616
|
+
'--input': '92 8% 85%',
|
|
617
|
+
'--ring': '92 90% 25%',
|
|
618
|
+
'--sidebar': '92 12% 95%',
|
|
619
619
|
},
|
|
620
620
|
dark: {
|
|
621
621
|
'--background': '69 54% 8%',
|
package/src/typography/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Text as RNText,
|
|
4
4
|
type TextProps as RNTextProps,
|
|
@@ -14,7 +14,7 @@ export type TextProps = RNTextProps;
|
|
|
14
14
|
/**
|
|
15
15
|
* Base text component with theme-aware default color.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
const TextComponent = function Text({ children, style, ...rest }: TextProps) {
|
|
18
18
|
const { colors } = useTheme();
|
|
19
19
|
|
|
20
20
|
return (
|
|
@@ -24,11 +24,14 @@ export function Text({ children, style, ...rest }: TextProps) {
|
|
|
24
24
|
{children}
|
|
25
25
|
</RNText>
|
|
26
26
|
);
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Text = memo(TextComponent);
|
|
30
|
+
Text.displayName = 'Text';
|
|
28
31
|
|
|
29
32
|
export { Text as Span };
|
|
30
33
|
|
|
31
|
-
function createHeadingElement({ level }: { level: number }) {
|
|
34
|
+
function createHeadingElement({ level }: { level: number }): React.FC<TextProps> {
|
|
32
35
|
return function HeadingElement({ style, ...rest }: TextProps) {
|
|
33
36
|
const extraProps: Record<string, unknown> =
|
|
34
37
|
Platform.OS === 'web'
|
|
@@ -39,11 +42,17 @@ function createHeadingElement({ level }: { level: number }) {
|
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
export const H1 = createHeadingElement({ level: 1 });
|
|
45
|
+
H1.displayName = 'H1';
|
|
42
46
|
export const H2 = createHeadingElement({ level: 2 });
|
|
47
|
+
H2.displayName = 'H2';
|
|
43
48
|
export const H3 = createHeadingElement({ level: 3 });
|
|
49
|
+
H3.displayName = 'H3';
|
|
44
50
|
export const H4 = createHeadingElement({ level: 4 });
|
|
51
|
+
H4.displayName = 'H4';
|
|
45
52
|
export const H5 = createHeadingElement({ level: 5 });
|
|
53
|
+
H5.displayName = 'H5';
|
|
46
54
|
export const H6 = createHeadingElement({ level: 6 });
|
|
55
|
+
H6.displayName = 'H6';
|
|
47
56
|
|
|
48
57
|
export function P({ style, ...rest }: TextProps) {
|
|
49
58
|
const extraProps: Record<string, unknown> =
|
|
@@ -56,3 +65,4 @@ export function P({ style, ...rest }: TextProps) {
|
|
|
56
65
|
/>
|
|
57
66
|
);
|
|
58
67
|
}
|
|
68
|
+
P.displayName = 'P';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a lazy-loaded module getter that caches the result.
|
|
3
|
+
*
|
|
4
|
+
* Safely handles environments where `require` is not defined (e.g. Vite/browser ESM)
|
|
5
|
+
* and returns `null` when the module is not installed. The result is cached after the
|
|
6
|
+
* first call so subsequent calls are zero-cost.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const getSvg = lazyRequire<typeof import('react-native-svg')>('react-native-svg');
|
|
11
|
+
* const svg = getSvg(); // SvgModuleType | null
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export function lazyRequire<T>(moduleName: string): () => T | null {
|
|
15
|
+
let module: T | null = null;
|
|
16
|
+
let resolved = false;
|
|
17
|
+
|
|
18
|
+
return (): T | null => {
|
|
19
|
+
if (!resolved) {
|
|
20
|
+
resolved = true;
|
|
21
|
+
try {
|
|
22
|
+
if (typeof require !== 'undefined') {
|
|
23
|
+
module = require(moduleName);
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
module = null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return module;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_TEMPLATE","require","Envelope_Open_Stroke2_Corner0_Rounded","exports","createSinglePathSVG","path"],"sourceRoot":"../../../src","sources":["icons/EnveopeOpen.tsx"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEO,MAAMC,qCAAqC,GAAAC,OAAA,CAAAD,qCAAA,GAAG,IAAAE,6BAAmB,EAAC;EACvEC,IAAI,EAAE;AACR,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createSinglePathSVG","Envelope_Open_Stroke2_Corner0_Rounded","path"],"sourceRoot":"../../../src","sources":["icons/EnveopeOpen.tsx"],"mappings":";;AAAA,SAAQA,mBAAmB,QAAO,eAAY;AAE9C,OAAO,MAAMC,qCAAqC,GAAGD,mBAAmB,CAAC;EACvEE,IAAI,EAAE;AACR,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnveopeOpen.d.ts","sourceRoot":"","sources":["../../../../src/icons/EnveopeOpen.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,qCAAqC;;;;;oIAEhD,CAAA"}
|