@flipova/foundation 1.14.0 → 2.0.5
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/CHANGELOG.md +181 -0
- package/README.md +53 -178
- package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +162 -0
- package/components/ui/accordion/AccordionAnimatedHeight.tsx +56 -0
- package/components/ui/accordion/AccordionAnimatedIcon.tsx +41 -0
- package/components/ui/accordion/AnimatedHeight.tsx +56 -0
- package/components/ui/accordion/AnimatedIcon.tsx +41 -0
- package/components/ui/accordion/MIGRATION_SUMMARY.md +250 -0
- package/components/ui/accordion/USAGE_EXAMPLE.tsx +179 -0
- package/components/ui/accordion/animation-config.ts +32 -0
- package/components/ui/accordion/index.tsx +253 -0
- package/components/ui/actionsheet/index.tsx +511 -0
- package/components/ui/alert/index.tsx +158 -0
- package/components/ui/alert-dialog/index.tsx +254 -0
- package/components/ui/avatar/index.tsx +139 -0
- package/components/ui/badge/index.tsx +163 -0
- package/components/ui/bottomsheet/index.tsx +477 -0
- package/components/ui/box/index.tsx +19 -0
- package/components/ui/box/index.web.tsx +19 -0
- package/components/ui/box/styles.tsx +10 -0
- package/components/ui/button/index.tsx +264 -0
- package/components/ui/calendar/creator.tsx +366 -0
- package/components/ui/calendar/index.tsx +462 -0
- package/components/ui/calendar/styles.tsx +140 -0
- package/components/ui/card/index.tsx +23 -0
- package/components/ui/card/index.web.tsx +26 -0
- package/components/ui/card/styles.tsx +16 -0
- package/components/ui/center/index.tsx +22 -0
- package/components/ui/center/index.web.tsx +20 -0
- package/components/ui/center/styles.tsx +8 -0
- package/components/ui/checkbox/index.tsx +184 -0
- package/components/ui/date-time-picker/creator.tsx +109 -0
- package/components/ui/date-time-picker/index.tsx +585 -0
- package/components/ui/date-time-picker/index.web.tsx +217 -0
- package/components/ui/date-time-picker/styles.tsx +56 -0
- package/components/ui/divider/index.tsx +40 -0
- package/components/ui/drawer/index.tsx +362 -0
- package/components/ui/fab/index.tsx +215 -0
- package/components/ui/flat-list/index.tsx +21 -0
- package/components/ui/form-control/index.tsx +352 -0
- package/components/ui/gluestack-ui-provider/config.ts +72 -0
- package/components/ui/gluestack-ui-provider/index.tsx +47 -0
- package/components/ui/gluestack-ui-provider/index.web.tsx +96 -0
- package/components/ui/gluestack-ui-provider/script.ts +19 -0
- package/components/ui/gluestack-ui-provider/tokens.d.ts +17 -0
- package/components/ui/gluestack-ui-provider/tokens.js +188 -0
- package/components/ui/gluestack-ui-provider/useGluestackColors.ts +82 -0
- package/components/ui/grid/index.tsx +283 -0
- package/components/ui/grid/index.web.tsx +66 -0
- package/components/ui/grid/styles.tsx +15 -0
- package/components/ui/heading/index.tsx +220 -0
- package/components/ui/heading/index.web.tsx +202 -0
- package/components/ui/heading/styles.tsx +43 -0
- package/components/ui/hstack/index.tsx +27 -0
- package/components/ui/hstack/index.web.tsx +26 -0
- package/components/ui/hstack/styles.tsx +25 -0
- package/components/ui/icon/index.tsx +1588 -0
- package/components/ui/icon/index.web.tsx +1573 -0
- package/components/ui/image/index.tsx +48 -0
- package/components/ui/image-background/index.tsx +25 -0
- package/components/ui/image-viewer/index.tsx +743 -0
- package/components/ui/image-viewer/index.web.tsx +302 -0
- package/components/ui/index.ts +58 -0
- package/components/ui/input/index.tsx +125 -0
- package/components/ui/input-accessory-view/index.tsx +2 -0
- package/components/ui/keyboard-avoiding-view/index.tsx +2 -0
- package/components/ui/link/index.tsx +102 -0
- package/components/ui/liquid-glass/index.tsx +74 -0
- package/components/ui/menu/index.tsx +186 -0
- package/components/ui/modal/index.tsx +237 -0
- package/components/ui/popover/index.tsx +272 -0
- package/components/ui/portal/index.tsx +17 -0
- package/components/ui/pressable/index.tsx +39 -0
- package/components/ui/progress/index.tsx +83 -0
- package/components/ui/radio/index.tsx +217 -0
- package/components/ui/refresh-control/index.tsx +2 -0
- package/components/ui/safe-area-view/index.tsx +2 -0
- package/components/ui/scroll-view/index.tsx +2 -0
- package/components/ui/section-list/index.tsx +2 -0
- package/components/ui/select/index.tsx +277 -0
- package/components/ui/select/select-actionsheet.tsx +562 -0
- package/components/ui/skeleton/index.tsx +105 -0
- package/components/ui/skeleton/index.web.tsx +103 -0
- package/components/ui/skeleton/styles.tsx +35 -0
- package/components/ui/slider/index.tsx +181 -0
- package/components/ui/spinner/index.tsx +40 -0
- package/components/ui/status-bar/index.tsx +2 -0
- package/components/ui/switch/index.tsx +41 -0
- package/components/ui/table/index.tsx +210 -0
- package/components/ui/table/index.web.tsx +157 -0
- package/components/ui/table/styles.tsx +44 -0
- package/components/ui/tabs/TabsAnimatedIndicator.tsx +160 -0
- package/components/ui/tabs/animation-config.ts +3 -0
- package/components/ui/tabs/creator.tsx +206 -0
- package/components/ui/tabs/index.tsx +484 -0
- package/components/ui/text/index.tsx +48 -0
- package/components/ui/text/index.web.tsx +45 -0
- package/components/ui/text/styles.tsx +47 -0
- package/components/ui/textarea/index.tsx +94 -0
- package/components/ui/toast/index.tsx +252 -0
- package/components/ui/tooltip/index.tsx +131 -0
- package/components/ui/view/index.tsx +2 -0
- package/components/ui/virtualized-list/index.tsx +2 -0
- package/components/ui/vstack/index.tsx +28 -0
- package/components/ui/vstack/index.web.tsx +27 -0
- package/components/ui/vstack/styles.tsx +25 -0
- package/design/canonical.index.txt +53 -0
- package/design/documentation.xml +519 -0
- package/design/manifest.xml +90 -0
- package/design/schema.xsd +639 -0
- package/design/themes.xml +204 -0
- package/design/tokens.xml +510 -0
- package/design/tools/design.js +165 -0
- package/design/tools/npm.js +65 -0
- package/design/tools/requirements.txt +35 -0
- package/design/tools/sources/.checker/__init__.py +81 -0
- package/design/tools/sources/.checker/checks.py +198 -0
- package/design/tools/sources/.checker/cli.py +154 -0
- package/design/tools/sources/.checker/io.py +242 -0
- package/design/tools/sources/.checker/model.py +144 -0
- package/design/tools/sources/.checker/registry.py +115 -0
- package/design/tools/sources/.checker/report.py +21 -0
- package/design/tools/sources/.docgen/__init__.py +45 -0
- package/design/tools/sources/.docgen/cli.py +101 -0
- package/design/tools/sources/.docgen/model.py +147 -0
- package/design/tools/sources/.docgen/reference.py +97 -0
- package/design/tools/sources/.docgen/site.py +145 -0
- package/design/tools/sources/.docgen/xsddoc.py +329 -0
- package/design/tools/sources/.generate/__init__.py +35 -0
- package/design/tools/sources/.generate/cli.py +76 -0
- package/design/tools/sources/.generate/common.py +33 -0
- package/design/tools/sources/.generate/config.py +119 -0
- package/design/tools/sources/.generate/model.py +51 -0
- package/design/tools/sources/.generate/tokens.py +141 -0
- package/design/tools/sources/.linter/__init__.py +9 -0
- package/design/tools/sources/.linter/cli.py +44 -0
- package/design/tools/sources/.linter/discovery.py +30 -0
- package/design/tools/sources/.linter/errors.py +45 -0
- package/design/tools/sources/.linter/linter.py +68 -0
- package/design/tools/sources/.xmleditor/__init__.py +74 -0
- package/design/tools/sources/.xmleditor/blocks.py +185 -0
- package/design/tools/sources/.xmleditor/cli.py +141 -0
- package/design/tools/sources/.xmleditor/editor.py +906 -0
- package/design/tools/sources/.xmleditor/model.py +708 -0
- package/design/tools/sources/.xmleditor/widgets.py +1832 -0
- package/design/tools/sources/.xmleditor/xsdmodel.py +753 -0
- package/design/tools/sources/checker.py +55 -0
- package/design/tools/sources/docgen.py +66 -0
- package/design/tools/sources/generate.py +48 -0
- package/design/tools/sources/linter.py +54 -0
- package/design/tools/sources/ruff.toml +12 -0
- package/design/tools/sources/xmleditor.py +62 -0
- package/design/tools/unix/_venv_python.sh +16 -0
- package/design/tools/unix/check.sh +13 -0
- package/design/tools/unix/doc.sh +14 -0
- package/design/tools/unix/gen.sh +14 -0
- package/design/tools/unix/lint.sh +10 -0
- package/design/tools/unix/run.sh +20 -0
- package/design/tools/unix/verify.sh +12 -0
- package/design/tools/unix/xmledit.sh +12 -0
- package/design/tools/windows/check.cmd +12 -0
- package/design/tools/windows/doc.cmd +12 -0
- package/design/tools/windows/gen.cmd +11 -0
- package/design/tools/windows/lint.cmd +9 -0
- package/design/tools/windows/run.cmd +26 -0
- package/design/tools/windows/verify.cmd +10 -0
- package/design/tools/windows/xmledit.cmd +10 -0
- package/dist/chunk-LV4UIEQN.js +9730 -0
- package/dist/chunk-LV4UIEQN.js.map +1 -0
- package/dist/chunk-WNVU3BM2.mjs +9401 -0
- package/dist/chunk-WNVU3BM2.mjs.map +1 -0
- package/dist/index.d.mts +40 -10
- package/dist/index.d.ts +40 -10
- package/dist/index.js +726 -414
- package/dist/index.mjs +1 -5
- package/dist/ui/index.d.mts +6931 -3070
- package/dist/ui/index.d.ts +6931 -3070
- package/dist/ui/index.js +779 -352
- package/dist/ui/index.mjs +1 -2
- package/package.json +66 -149
- package/dist/chunk-2XORADW6.js +0 -24552
- package/dist/chunk-2XORADW6.js.map +0 -1
- package/dist/chunk-52BHHF5M.js +0 -46
- package/dist/chunk-52BHHF5M.js.map +0 -1
- package/dist/chunk-5647JY7Z.mjs +0 -100
- package/dist/chunk-5647JY7Z.mjs.map +0 -1
- package/dist/chunk-5N5HC4ZA.mjs +0 -3
- package/dist/chunk-5N5HC4ZA.mjs.map +0 -1
- package/dist/chunk-7QFZMGL6.js +0 -8583
- package/dist/chunk-7QFZMGL6.js.map +0 -1
- package/dist/chunk-ASZEP37D.js +0 -423
- package/dist/chunk-ASZEP37D.js.map +0 -1
- package/dist/chunk-BH5SU2JQ.mjs +0 -8282
- package/dist/chunk-BH5SU2JQ.mjs.map +0 -1
- package/dist/chunk-BO65GO53.mjs +0 -422
- package/dist/chunk-BO65GO53.mjs.map +0 -1
- package/dist/chunk-BSVXX52E.mjs +0 -413
- package/dist/chunk-BSVXX52E.mjs.map +0 -1
- package/dist/chunk-DNV5UBNF.mjs +0 -3
- package/dist/chunk-DNV5UBNF.mjs.map +0 -1
- package/dist/chunk-EDTAMUO2.js +0 -8310
- package/dist/chunk-EDTAMUO2.js.map +0 -1
- package/dist/chunk-IJTI6EX4.js +0 -4
- package/dist/chunk-IJTI6EX4.js.map +0 -1
- package/dist/chunk-M3YLASM2.js +0 -428
- package/dist/chunk-M3YLASM2.js.map +0 -1
- package/dist/chunk-OXKOGLXE.js +0 -4
- package/dist/chunk-OXKOGLXE.js.map +0 -1
- package/dist/chunk-RQXQK3ZO.mjs +0 -8486
- package/dist/chunk-RQXQK3ZO.mjs.map +0 -1
- package/dist/chunk-SR25V4EA.mjs +0 -40
- package/dist/chunk-SR25V4EA.mjs.map +0 -1
- package/dist/chunk-UB34WFEQ.js +0 -106
- package/dist/chunk-UB34WFEQ.js.map +0 -1
- package/dist/chunk-ZBRWXKDF.mjs +0 -24431
- package/dist/chunk-ZBRWXKDF.mjs.map +0 -1
- package/dist/cli/ds.d.mts +0 -1
- package/dist/cli/ds.d.ts +0 -1
- package/dist/cli/ds.js +0 -602
- package/dist/cli/ds.js.map +0 -1
- package/dist/cli/ds.mjs +0 -579
- package/dist/cli/ds.mjs.map +0 -1
- package/dist/cli/flipova.d.mts +0 -1
- package/dist/cli/flipova.d.ts +0 -1
- package/dist/cli/flipova.js +0 -161
- package/dist/cli/flipova.js.map +0 -1
- package/dist/cli/flipova.mjs +0 -154
- package/dist/cli/flipova.mjs.map +0 -1
- package/dist/config/index.d.mts +0 -123
- package/dist/config/index.d.ts +0 -123
- package/dist/config/index.js +0 -28
- package/dist/config/index.js.map +0 -1
- package/dist/config/index.mjs +0 -3
- package/dist/config/index.mjs.map +0 -1
- package/dist/createTheme-DQeX3s0I.d.mts +0 -78
- package/dist/createTheme-Y4jfz4-u.d.ts +0 -78
- package/dist/index-CuaJA3gM.d.mts +0 -78
- package/dist/index-CuaJA3gM.d.ts +0 -78
- package/dist/registry/index.d.mts +0 -10160
- package/dist/registry/index.d.ts +0 -10160
- package/dist/registry/index.js +0 -392
- package/dist/registry/index.js.map +0 -1
- package/dist/registry/index.mjs +0 -3
- package/dist/registry/index.mjs.map +0 -1
- package/dist/theme/index.d.mts +0 -35
- package/dist/theme/index.d.ts +0 -35
- package/dist/theme/index.js +0 -28
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs +0 -3
- package/dist/theme/index.mjs.map +0 -1
- package/dist/tokens/index.d.mts +0 -423
- package/dist/tokens/index.d.ts +0 -423
- package/dist/tokens/index.js +0 -44
- package/dist/tokens/index.js.map +0 -1
- package/dist/tokens/index.mjs +0 -3
- package/dist/tokens/index.mjs.map +0 -1
- package/dist/types/index.d.mts +0 -202
- package/dist/types/index.d.ts +0 -202
- package/dist/types/index.js +0 -4
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -3
- package/dist/types/index.mjs.map +0 -1
- package/dist/web/index.d.mts +0 -316
- package/dist/web/index.d.ts +0 -316
- package/dist/web/index.js +0 -1500
- package/dist/web/index.js.map +0 -1
- package/dist/web/index.mjs +0 -1396
- package/dist/web/index.mjs.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createFab } from '@gluestack-ui/core/fab/creator';
|
|
4
|
+
import { Pressable, Text } from 'react-native';
|
|
5
|
+
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
6
|
+
import {
|
|
7
|
+
withStyleContext,
|
|
8
|
+
useStyleContext,
|
|
9
|
+
} from '@gluestack-ui/utils/nativewind-utils';
|
|
10
|
+
import { cssInterop } from 'nativewind';
|
|
11
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
12
|
+
import { UIIcon } from '@gluestack-ui/core/icon/creator';
|
|
13
|
+
|
|
14
|
+
const SCOPE = 'FAB';
|
|
15
|
+
const Root = withStyleContext(Pressable, SCOPE);
|
|
16
|
+
const UIFab = createFab({
|
|
17
|
+
Root: Root,
|
|
18
|
+
Label: Text,
|
|
19
|
+
Icon: UIIcon,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
cssInterop(UIIcon, {
|
|
23
|
+
className: {
|
|
24
|
+
target: 'style',
|
|
25
|
+
nativeStyleToProp: {
|
|
26
|
+
height: true,
|
|
27
|
+
width: true,
|
|
28
|
+
fill: true,
|
|
29
|
+
color: 'classNameColor',
|
|
30
|
+
stroke: true,
|
|
31
|
+
} as any,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const fabStyle = tva({
|
|
36
|
+
base: 'group/fab bg-primary rounded-full z-20 p-4 flex-row items-center justify-center absolute hover:bg-primary/90 active:bg-primary/80 disabled:opacity-40 disabled:pointer-events-all disabled:cursor-not-allowed data-[focus=true]:web:outline-none data-[focus-visible=true]:web:ring-2 data-[focus-visible=true]:web:ring-indicator-info shadow-hard-2',
|
|
37
|
+
variants: {
|
|
38
|
+
size: {
|
|
39
|
+
sm: 'px-3.5 py-1.5',
|
|
40
|
+
md: 'px-4 py-2',
|
|
41
|
+
lg: 'px-5 py-3',
|
|
42
|
+
},
|
|
43
|
+
placement: {
|
|
44
|
+
'top right': 'top-4 right-4',
|
|
45
|
+
'top left': 'top-4 left-4',
|
|
46
|
+
'bottom right': 'bottom-4 right-4',
|
|
47
|
+
'bottom left': 'bottom-4 left-4',
|
|
48
|
+
'top center': 'top-4 self-center',
|
|
49
|
+
'bottom center': 'bottom-4 self-center',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const fabLabelStyle = tva({
|
|
55
|
+
base: 'text-primary-foreground/90 font-normal font-body tracking-md text-left mx-2',
|
|
56
|
+
variants: {
|
|
57
|
+
isTruncated: {
|
|
58
|
+
true: '',
|
|
59
|
+
},
|
|
60
|
+
bold: {
|
|
61
|
+
true: 'font-bold',
|
|
62
|
+
},
|
|
63
|
+
underline: {
|
|
64
|
+
true: 'underline',
|
|
65
|
+
},
|
|
66
|
+
strikeThrough: {
|
|
67
|
+
true: 'line-through',
|
|
68
|
+
},
|
|
69
|
+
size: {
|
|
70
|
+
|
|
71
|
+
'sm': 'text-sm',
|
|
72
|
+
'md': 'text-base',
|
|
73
|
+
'lg': 'text-lg',
|
|
74
|
+
|
|
75
|
+
},
|
|
76
|
+
sub: {
|
|
77
|
+
true: 'text-xs',
|
|
78
|
+
},
|
|
79
|
+
italic: {
|
|
80
|
+
true: 'italic',
|
|
81
|
+
},
|
|
82
|
+
highlight: {
|
|
83
|
+
true: 'bg-yellow-500',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
parentVariants: {
|
|
87
|
+
size: {
|
|
88
|
+
sm: 'text-sm',
|
|
89
|
+
md: 'text-base',
|
|
90
|
+
lg: 'text-lg',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const fabIconStyle = tva({
|
|
96
|
+
base: 'text-primary-foreground/90 fill-none',
|
|
97
|
+
variants: {
|
|
98
|
+
size: {
|
|
99
|
+
'sm': 'h-3.5 w-3.5',
|
|
100
|
+
'md': 'h-4 w-4',
|
|
101
|
+
'lg': 'h-5 w-5',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
type IFabProps = Omit<React.ComponentPropsWithoutRef<typeof UIFab>, 'context'> &
|
|
107
|
+
VariantProps<typeof fabStyle>;
|
|
108
|
+
|
|
109
|
+
const Fab = React.forwardRef<React.ComponentRef<typeof UIFab>, IFabProps>(
|
|
110
|
+
function Fab(
|
|
111
|
+
{ size = 'md', placement = 'bottom right', className, ...props },
|
|
112
|
+
ref
|
|
113
|
+
) {
|
|
114
|
+
return (
|
|
115
|
+
<UIFab
|
|
116
|
+
ref={ref}
|
|
117
|
+
{...props}
|
|
118
|
+
className={fabStyle({ size, placement, class: className })}
|
|
119
|
+
context={{ size }}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
type IFabLabelProps = React.ComponentPropsWithoutRef<typeof UIFab.Label> &
|
|
126
|
+
VariantProps<typeof fabLabelStyle>;
|
|
127
|
+
|
|
128
|
+
const FabLabel = React.forwardRef<
|
|
129
|
+
React.ComponentRef<typeof UIFab.Label>,
|
|
130
|
+
IFabLabelProps
|
|
131
|
+
>(function FabLabel(
|
|
132
|
+
{
|
|
133
|
+
size,
|
|
134
|
+
isTruncated = false,
|
|
135
|
+
bold = false,
|
|
136
|
+
underline = false,
|
|
137
|
+
strikeThrough = false,
|
|
138
|
+
className,
|
|
139
|
+
...props
|
|
140
|
+
},
|
|
141
|
+
ref
|
|
142
|
+
) {
|
|
143
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
144
|
+
return (
|
|
145
|
+
<UIFab.Label
|
|
146
|
+
ref={ref}
|
|
147
|
+
{...props}
|
|
148
|
+
className={fabLabelStyle({
|
|
149
|
+
parentVariants: {
|
|
150
|
+
size: parentSize,
|
|
151
|
+
},
|
|
152
|
+
size,
|
|
153
|
+
isTruncated,
|
|
154
|
+
bold,
|
|
155
|
+
underline,
|
|
156
|
+
strikeThrough,
|
|
157
|
+
class: className,
|
|
158
|
+
})}
|
|
159
|
+
/>
|
|
160
|
+
);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
type IFabIconProps = React.ComponentPropsWithoutRef<typeof UIFab.Icon> &
|
|
164
|
+
VariantProps<typeof fabIconStyle> & {
|
|
165
|
+
height?: number;
|
|
166
|
+
width?: number;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const FabIcon = React.forwardRef<
|
|
170
|
+
React.ComponentRef<typeof UIFab.Icon>,
|
|
171
|
+
IFabIconProps
|
|
172
|
+
>(function FabIcon({ size, className, ...props }, ref) {
|
|
173
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
174
|
+
|
|
175
|
+
if (typeof size === 'number') {
|
|
176
|
+
return (
|
|
177
|
+
<UIFab.Icon
|
|
178
|
+
ref={ref}
|
|
179
|
+
{...props}
|
|
180
|
+
className={fabIconStyle({ class: className })}
|
|
181
|
+
size={size}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
184
|
+
} else if (
|
|
185
|
+
(props.height !== undefined || props.width !== undefined) &&
|
|
186
|
+
size === undefined
|
|
187
|
+
) {
|
|
188
|
+
return (
|
|
189
|
+
<UIFab.Icon
|
|
190
|
+
ref={ref}
|
|
191
|
+
{...props}
|
|
192
|
+
className={fabIconStyle({ class: className })}
|
|
193
|
+
/>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
return (
|
|
197
|
+
<UIFab.Icon
|
|
198
|
+
ref={ref}
|
|
199
|
+
{...props}
|
|
200
|
+
className={fabIconStyle({
|
|
201
|
+
parentVariants: {
|
|
202
|
+
size: parentSize,
|
|
203
|
+
},
|
|
204
|
+
size,
|
|
205
|
+
class: className,
|
|
206
|
+
})}
|
|
207
|
+
/>
|
|
208
|
+
);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
Fab.displayName = 'Fab';
|
|
212
|
+
FabLabel.displayName = 'FabLabel';
|
|
213
|
+
FabIcon.displayName = 'FabIcon';
|
|
214
|
+
|
|
215
|
+
export { Fab, FabLabel, FabIcon };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FlatList as RNFlatList, Platform, FlatListProps } from 'react-native';
|
|
4
|
+
|
|
5
|
+
// Performance-optimized FlatList with Android defaults
|
|
6
|
+
export function FlatList<ItemT = any>(props: FlatListProps<ItemT>) {
|
|
7
|
+
// Apply Android-specific performance defaults if not explicitly overridden
|
|
8
|
+
const optimizedProps = Platform.OS === 'android' ? {
|
|
9
|
+
removeClippedSubviews: true,
|
|
10
|
+
maxToRenderPerBatch: 5,
|
|
11
|
+
updateCellsBatchingPeriod: 100,
|
|
12
|
+
initialNumToRender: 5,
|
|
13
|
+
windowSize: 5,
|
|
14
|
+
...props,
|
|
15
|
+
} : props;
|
|
16
|
+
|
|
17
|
+
return <RNFlatList {...optimizedProps} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Also export the original for advanced use cases
|
|
21
|
+
export { FlatList as RNFlatList } from 'react-native';
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { createFormControl } from '@gluestack-ui/core/form-control/creator';
|
|
5
|
+
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
6
|
+
import { withStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
7
|
+
import { cssInterop } from 'nativewind';
|
|
8
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
9
|
+
import { UIIcon } from '@gluestack-ui/core/icon/creator';
|
|
10
|
+
|
|
11
|
+
const SCOPE = 'FORM_CONTROL';
|
|
12
|
+
|
|
13
|
+
const formControlStyle = tva({
|
|
14
|
+
base: 'flex flex-col',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const formControlErrorIconStyle = tva({
|
|
18
|
+
base: 'text-destructive fill-none h-[18px] w-[18px]',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const formControlErrorStyle = tva({
|
|
22
|
+
base: 'flex flex-row justify-start items-center mt-1 gap-1',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const formControlErrorTextStyle = tva({
|
|
26
|
+
base: 'text-destructive text-xs font-body',
|
|
27
|
+
variants: {
|
|
28
|
+
isTruncated: {
|
|
29
|
+
true: 'web:truncate',
|
|
30
|
+
},
|
|
31
|
+
bold: {
|
|
32
|
+
true: 'font-bold',
|
|
33
|
+
},
|
|
34
|
+
underline: {
|
|
35
|
+
true: 'underline',
|
|
36
|
+
},
|
|
37
|
+
strikeThrough: {
|
|
38
|
+
true: 'line-through',
|
|
39
|
+
},
|
|
40
|
+
sub: {
|
|
41
|
+
true: 'text-xs',
|
|
42
|
+
},
|
|
43
|
+
italic: {
|
|
44
|
+
true: 'italic',
|
|
45
|
+
},
|
|
46
|
+
highlight: {
|
|
47
|
+
true: 'bg-yellow-500',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const formControlHelperStyle = tva({
|
|
53
|
+
base: 'flex flex-row justify-start items-center mt-1 font-body',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const formControlHelperTextStyle = tva({
|
|
57
|
+
base: 'text-foreground/70 font-body text-sm',
|
|
58
|
+
variants: {
|
|
59
|
+
isTruncated: {
|
|
60
|
+
true: 'web:truncate',
|
|
61
|
+
},
|
|
62
|
+
bold: {
|
|
63
|
+
true: 'font-bold',
|
|
64
|
+
},
|
|
65
|
+
underline: {
|
|
66
|
+
true: 'underline',
|
|
67
|
+
},
|
|
68
|
+
strikeThrough: {
|
|
69
|
+
true: 'line-through',
|
|
70
|
+
},
|
|
71
|
+
sub: {
|
|
72
|
+
true: 'text-xs',
|
|
73
|
+
},
|
|
74
|
+
italic: {
|
|
75
|
+
true: 'italic',
|
|
76
|
+
},
|
|
77
|
+
highlight: {
|
|
78
|
+
true: 'bg-yellow-500',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const formControlLabelStyle = tva({
|
|
84
|
+
base: 'flex flex-row justify-start items-center mb-1',
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const formControlLabelTextStyle = tva({
|
|
88
|
+
base: 'font-medium text-foreground text-base font-body',
|
|
89
|
+
variants: {
|
|
90
|
+
isTruncated: {
|
|
91
|
+
true: 'web:truncate',
|
|
92
|
+
},
|
|
93
|
+
bold: {
|
|
94
|
+
true: 'font-bold',
|
|
95
|
+
},
|
|
96
|
+
underline: {
|
|
97
|
+
true: 'underline',
|
|
98
|
+
},
|
|
99
|
+
strikeThrough: {
|
|
100
|
+
true: 'line-through',
|
|
101
|
+
},
|
|
102
|
+
sub: {
|
|
103
|
+
true: 'text-xs',
|
|
104
|
+
},
|
|
105
|
+
italic: {
|
|
106
|
+
true: 'italic',
|
|
107
|
+
},
|
|
108
|
+
highlight: {
|
|
109
|
+
true: 'bg-yellow-500',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const formControlLabelAstrickStyle = tva({
|
|
115
|
+
base: 'font-medium text-typography text-base',
|
|
116
|
+
variants: {
|
|
117
|
+
isTruncated: {
|
|
118
|
+
true: 'web:truncate',
|
|
119
|
+
},
|
|
120
|
+
bold: {
|
|
121
|
+
true: 'font-bold',
|
|
122
|
+
},
|
|
123
|
+
underline: {
|
|
124
|
+
true: 'underline',
|
|
125
|
+
},
|
|
126
|
+
strikeThrough: {
|
|
127
|
+
true: 'line-through',
|
|
128
|
+
},
|
|
129
|
+
sub: {
|
|
130
|
+
true: 'text-xs',
|
|
131
|
+
},
|
|
132
|
+
italic: {
|
|
133
|
+
true: 'italic',
|
|
134
|
+
},
|
|
135
|
+
highlight: {
|
|
136
|
+
true: 'bg-yellow-500',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
type IFormControlLabelAstrickProps = React.ComponentPropsWithoutRef<
|
|
142
|
+
typeof Text
|
|
143
|
+
> &
|
|
144
|
+
VariantProps<typeof formControlLabelAstrickStyle>;
|
|
145
|
+
|
|
146
|
+
const FormControlLabelAstrick = React.forwardRef<
|
|
147
|
+
React.ComponentRef<typeof Text>,
|
|
148
|
+
IFormControlLabelAstrickProps
|
|
149
|
+
>(function FormControlLabelAstrick({ className, ...props }, ref) {
|
|
150
|
+
return (
|
|
151
|
+
<Text
|
|
152
|
+
ref={ref}
|
|
153
|
+
className={formControlLabelAstrickStyle({
|
|
154
|
+
class: className,
|
|
155
|
+
})}
|
|
156
|
+
{...props}
|
|
157
|
+
/>
|
|
158
|
+
);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export const UIFormControl = createFormControl({
|
|
162
|
+
Root: withStyleContext(View, SCOPE),
|
|
163
|
+
Error: View,
|
|
164
|
+
ErrorText: Text,
|
|
165
|
+
ErrorIcon: UIIcon,
|
|
166
|
+
Label: View,
|
|
167
|
+
LabelText: Text,
|
|
168
|
+
LabelAstrick: FormControlLabelAstrick,
|
|
169
|
+
Helper: View,
|
|
170
|
+
HelperText: Text,
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
cssInterop(UIIcon, {
|
|
174
|
+
className: {
|
|
175
|
+
target: 'style',
|
|
176
|
+
nativeStyleToProp: {
|
|
177
|
+
height: true,
|
|
178
|
+
width: true,
|
|
179
|
+
fill: true,
|
|
180
|
+
color: true,
|
|
181
|
+
stroke: true,
|
|
182
|
+
} as any,
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
type IFormControlProps = React.ComponentProps<typeof UIFormControl> &
|
|
187
|
+
VariantProps<typeof formControlStyle>;
|
|
188
|
+
|
|
189
|
+
const FormControl = React.forwardRef<
|
|
190
|
+
React.ComponentRef<typeof UIFormControl>,
|
|
191
|
+
IFormControlProps
|
|
192
|
+
>(function FormControl({ className, ...props }, ref) {
|
|
193
|
+
return (
|
|
194
|
+
<UIFormControl
|
|
195
|
+
ref={ref}
|
|
196
|
+
className={formControlStyle({ class: className })}
|
|
197
|
+
{...props}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
type IFormControlErrorProps = React.ComponentProps<typeof UIFormControl.Error> &
|
|
203
|
+
VariantProps<typeof formControlErrorStyle>;
|
|
204
|
+
|
|
205
|
+
const FormControlError = React.forwardRef<
|
|
206
|
+
React.ComponentRef<typeof UIFormControl.Error>,
|
|
207
|
+
IFormControlErrorProps
|
|
208
|
+
>(function FormControlError({ className, ...props }, ref) {
|
|
209
|
+
return (
|
|
210
|
+
<UIFormControl.Error
|
|
211
|
+
ref={ref}
|
|
212
|
+
className={formControlErrorStyle({ class: className })}
|
|
213
|
+
{...props}
|
|
214
|
+
/>
|
|
215
|
+
);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
type IFormControlErrorTextProps = React.ComponentProps<
|
|
219
|
+
typeof UIFormControl.Error.Text
|
|
220
|
+
> &
|
|
221
|
+
VariantProps<typeof formControlErrorTextStyle>;
|
|
222
|
+
|
|
223
|
+
const FormControlErrorText = React.forwardRef<
|
|
224
|
+
React.ComponentRef<typeof UIFormControl.Error.Text>,
|
|
225
|
+
IFormControlErrorTextProps
|
|
226
|
+
>(function FormControlErrorText({ className, ...props }, ref) {
|
|
227
|
+
return (
|
|
228
|
+
<UIFormControl.Error.Text
|
|
229
|
+
className={formControlErrorTextStyle({
|
|
230
|
+
class: className,
|
|
231
|
+
})}
|
|
232
|
+
ref={ref}
|
|
233
|
+
{...props}
|
|
234
|
+
/>
|
|
235
|
+
);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
type IFormControlErrorIconProps = React.ComponentProps<
|
|
239
|
+
typeof UIFormControl.Error.Icon
|
|
240
|
+
> &
|
|
241
|
+
VariantProps<typeof formControlErrorIconStyle>;
|
|
242
|
+
|
|
243
|
+
const FormControlErrorIcon = React.forwardRef<
|
|
244
|
+
React.ComponentRef<typeof UIFormControl.Error.Icon>,
|
|
245
|
+
IFormControlErrorIconProps
|
|
246
|
+
>(function FormControlErrorIcon({ className, ...props }, ref) {
|
|
247
|
+
return (
|
|
248
|
+
<UIFormControl.Error.Icon
|
|
249
|
+
ref={ref}
|
|
250
|
+
{...props}
|
|
251
|
+
className={formControlErrorIconStyle({ class: className })}
|
|
252
|
+
/>
|
|
253
|
+
);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
type IFormControlLabelProps = React.ComponentProps<typeof UIFormControl.Label> &
|
|
257
|
+
VariantProps<typeof formControlLabelStyle>;
|
|
258
|
+
|
|
259
|
+
const FormControlLabel = React.forwardRef<
|
|
260
|
+
React.ComponentRef<typeof UIFormControl.Label>,
|
|
261
|
+
IFormControlLabelProps
|
|
262
|
+
>(function FormControlLabel({ className, ...props }, ref) {
|
|
263
|
+
return (
|
|
264
|
+
<UIFormControl.Label
|
|
265
|
+
ref={ref}
|
|
266
|
+
className={formControlLabelStyle({ class: className })}
|
|
267
|
+
{...props}
|
|
268
|
+
/>
|
|
269
|
+
);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
type IFormControlLabelTextProps = React.ComponentProps<
|
|
273
|
+
typeof UIFormControl.Label.Text
|
|
274
|
+
> &
|
|
275
|
+
VariantProps<typeof formControlLabelTextStyle>;
|
|
276
|
+
|
|
277
|
+
const FormControlLabelText = React.forwardRef<
|
|
278
|
+
React.ComponentRef<typeof UIFormControl.Label.Text>,
|
|
279
|
+
IFormControlLabelTextProps
|
|
280
|
+
>(function FormControlLabelText({ className, ...props }, ref) {
|
|
281
|
+
return (
|
|
282
|
+
<UIFormControl.Label.Text
|
|
283
|
+
className={formControlLabelTextStyle({
|
|
284
|
+
class: className,
|
|
285
|
+
})}
|
|
286
|
+
ref={ref}
|
|
287
|
+
{...props}
|
|
288
|
+
/>
|
|
289
|
+
);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
type IFormControlHelperProps = React.ComponentProps<
|
|
293
|
+
typeof UIFormControl.Helper
|
|
294
|
+
> &
|
|
295
|
+
VariantProps<typeof formControlHelperStyle>;
|
|
296
|
+
|
|
297
|
+
const FormControlHelper = React.forwardRef<
|
|
298
|
+
React.ComponentRef<typeof UIFormControl.Helper>,
|
|
299
|
+
IFormControlHelperProps
|
|
300
|
+
>(function FormControlHelper({ className, ...props }, ref) {
|
|
301
|
+
return (
|
|
302
|
+
<UIFormControl.Helper
|
|
303
|
+
ref={ref}
|
|
304
|
+
className={formControlHelperStyle({
|
|
305
|
+
class: className,
|
|
306
|
+
})}
|
|
307
|
+
{...props}
|
|
308
|
+
/>
|
|
309
|
+
);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
type IFormControlHelperTextProps = React.ComponentProps<
|
|
313
|
+
typeof UIFormControl.Helper.Text
|
|
314
|
+
> &
|
|
315
|
+
VariantProps<typeof formControlHelperTextStyle>;
|
|
316
|
+
|
|
317
|
+
const FormControlHelperText = React.forwardRef<
|
|
318
|
+
React.ComponentRef<typeof UIFormControl.Helper.Text>,
|
|
319
|
+
IFormControlHelperTextProps
|
|
320
|
+
>(function FormControlHelperText({ className, ...props }, ref) {
|
|
321
|
+
return (
|
|
322
|
+
<UIFormControl.Helper.Text
|
|
323
|
+
className={formControlHelperTextStyle({
|
|
324
|
+
class: className,
|
|
325
|
+
})}
|
|
326
|
+
ref={ref}
|
|
327
|
+
{...props}
|
|
328
|
+
/>
|
|
329
|
+
);
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
FormControl.displayName = 'FormControl';
|
|
333
|
+
FormControlError.displayName = 'FormControlError';
|
|
334
|
+
FormControlErrorText.displayName = 'FormControlErrorText';
|
|
335
|
+
FormControlErrorIcon.displayName = 'FormControlErrorIcon';
|
|
336
|
+
FormControlLabel.displayName = 'FormControlLabel';
|
|
337
|
+
FormControlLabelText.displayName = 'FormControlLabelText';
|
|
338
|
+
FormControlLabelAstrick.displayName = 'FormControlLabelAstrick';
|
|
339
|
+
FormControlHelper.displayName = 'FormControlHelper';
|
|
340
|
+
FormControlHelperText.displayName = 'FormControlHelperText';
|
|
341
|
+
|
|
342
|
+
export {
|
|
343
|
+
FormControl,
|
|
344
|
+
FormControlError,
|
|
345
|
+
FormControlErrorText,
|
|
346
|
+
FormControlErrorIcon,
|
|
347
|
+
FormControlLabel,
|
|
348
|
+
FormControlLabelText,
|
|
349
|
+
FormControlLabelAstrick,
|
|
350
|
+
FormControlHelper,
|
|
351
|
+
FormControlHelperText,
|
|
352
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Generated by design/tools/sources/generate.py -- do not edit by hand.
|
|
2
|
+
// Source of truth: design/tokens.xml + design/themes.xml
|
|
3
|
+
// Regenerate with: npm run design:gen
|
|
4
|
+
import { vars } from 'nativewind';
|
|
5
|
+
|
|
6
|
+
// Raw color values (space-separated RGB) - edit design/themes.xml and regenerate
|
|
7
|
+
export const colors = {
|
|
8
|
+
light: {
|
|
9
|
+
'--background': '250 250 250',
|
|
10
|
+
'--foreground': '24 24 27',
|
|
11
|
+
'--card': '255 255 255',
|
|
12
|
+
'--card-foreground': '24 24 27',
|
|
13
|
+
'--popover': '255 255 255',
|
|
14
|
+
'--popover-foreground': '24 24 27',
|
|
15
|
+
'--primary': '37 99 235',
|
|
16
|
+
'--primary-foreground': '255 255 255',
|
|
17
|
+
'--secondary': '71 85 105',
|
|
18
|
+
'--secondary-foreground': '255 255 255',
|
|
19
|
+
'--muted': '244 244 245',
|
|
20
|
+
'--muted-foreground': '82 82 91',
|
|
21
|
+
'--accent': '239 246 255',
|
|
22
|
+
'--accent-foreground': '30 58 138',
|
|
23
|
+
'--destructive': '220 38 38',
|
|
24
|
+
'--destructive-foreground': '255 255 255',
|
|
25
|
+
'--border': '228 228 231',
|
|
26
|
+
'--input': '228 228 231',
|
|
27
|
+
'--ring': '59 130 246',
|
|
28
|
+
'--success': '22 163 74',
|
|
29
|
+
'--success-foreground': '255 255 255',
|
|
30
|
+
'--warning': '217 119 6',
|
|
31
|
+
'--warning-foreground': '255 255 255',
|
|
32
|
+
'--error': '220 38 38',
|
|
33
|
+
'--error-foreground': '255 255 255',
|
|
34
|
+
'--info': '2 132 199',
|
|
35
|
+
'--info-foreground': '255 255 255',
|
|
36
|
+
},
|
|
37
|
+
dark: {
|
|
38
|
+
'--background': '24 24 27',
|
|
39
|
+
'--foreground': '244 244 245',
|
|
40
|
+
'--card': '39 39 42',
|
|
41
|
+
'--card-foreground': '244 244 245',
|
|
42
|
+
'--popover': '39 39 42',
|
|
43
|
+
'--popover-foreground': '244 244 245',
|
|
44
|
+
'--primary': '59 130 246',
|
|
45
|
+
'--primary-foreground': '255 255 255',
|
|
46
|
+
'--secondary': '100 116 139',
|
|
47
|
+
'--secondary-foreground': '255 255 255',
|
|
48
|
+
'--muted': '39 39 42',
|
|
49
|
+
'--muted-foreground': '161 161 170',
|
|
50
|
+
'--accent': '30 58 138',
|
|
51
|
+
'--accent-foreground': '219 234 254',
|
|
52
|
+
'--destructive': '239 68 68',
|
|
53
|
+
'--destructive-foreground': '255 255 255',
|
|
54
|
+
'--border': '63 63 70',
|
|
55
|
+
'--input': '63 63 70',
|
|
56
|
+
'--ring': '96 165 250',
|
|
57
|
+
'--success': '34 197 94',
|
|
58
|
+
'--success-foreground': '24 24 27',
|
|
59
|
+
'--warning': '245 158 11',
|
|
60
|
+
'--warning-foreground': '24 24 27',
|
|
61
|
+
'--error': '239 68 68',
|
|
62
|
+
'--error-foreground': '255 255 255',
|
|
63
|
+
'--info': '14 165 233',
|
|
64
|
+
'--info-foreground': '255 255 255',
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Config for nativewind vars() - used by the provider
|
|
69
|
+
export const config = {
|
|
70
|
+
light: vars(colors.light),
|
|
71
|
+
dark: vars(colors.dark),
|
|
72
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { config } from './config';
|
|
3
|
+
import { View, ViewProps } from 'react-native';
|
|
4
|
+
import { OverlayProvider } from '@gluestack-ui/core/overlay/creator';
|
|
5
|
+
import { ToastProvider } from '@gluestack-ui/core/toast/creator';
|
|
6
|
+
import { useColorScheme } from 'nativewind';
|
|
7
|
+
import {
|
|
8
|
+
useGluestackColors as useGluestackColorsHook,
|
|
9
|
+
useCalendarTheme as useCalendarThemeHook,
|
|
10
|
+
} from './useGluestackColors';
|
|
11
|
+
|
|
12
|
+
export type ModeType = 'light' | 'dark' | 'system';
|
|
13
|
+
|
|
14
|
+
// Re-export color hooks
|
|
15
|
+
export const useGluestackColors = useGluestackColorsHook;
|
|
16
|
+
export const useCalendarTheme = useCalendarThemeHook;
|
|
17
|
+
export type { GluestackColors } from './useGluestackColors';
|
|
18
|
+
|
|
19
|
+
export function GluestackUIProvider({
|
|
20
|
+
mode = 'light',
|
|
21
|
+
...props
|
|
22
|
+
}: {
|
|
23
|
+
mode?: ModeType;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
style?: ViewProps['style'];
|
|
26
|
+
}) {
|
|
27
|
+
const { colorScheme, setColorScheme } = useColorScheme();
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setColorScheme(mode);
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
}, [mode]);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<View
|
|
36
|
+
style={[
|
|
37
|
+
config[colorScheme!],
|
|
38
|
+
{ flex: 1, height: '100%', width: '100%' },
|
|
39
|
+
props.style,
|
|
40
|
+
]}
|
|
41
|
+
>
|
|
42
|
+
<OverlayProvider>
|
|
43
|
+
<ToastProvider>{props.children}</ToastProvider>
|
|
44
|
+
</OverlayProvider>
|
|
45
|
+
</View>
|
|
46
|
+
);
|
|
47
|
+
}
|