@flipova/foundation 1.14.0 → 2.0.4
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 +175 -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,186 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createMenu } from '@gluestack-ui/core/menu/creator';
|
|
3
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
4
|
+
|
|
5
|
+
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
6
|
+
import { cssInterop } from 'nativewind';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { Pressable, ScrollView, Text, View } from 'react-native';
|
|
9
|
+
import Animated, { FadeOut, ZoomIn } from 'react-native-reanimated';
|
|
10
|
+
|
|
11
|
+
const AnimatedView = Animated.createAnimatedComponent(ScrollView);
|
|
12
|
+
|
|
13
|
+
const menuStyle = tva({
|
|
14
|
+
base: 'rounded-md bg-popover text-popover-foreground border border-border p-1 shadow-hard-5 max-h-[300px] overflow-y-auto',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const menuItemStyle = tva({
|
|
18
|
+
base: 'min-w-[200px] p-3 flex-row items-center rounded data-[hover=true]:bg-accent data-[hover=true]:text-accent-foreground data-[active=true]:bg-accent data-[active=true]:text-accent-foreground data-[focus=true]:bg-accent data-[focus=true]:text-accent-foreground data-[focus=true]:web:outline-none data-[focus=true]:web:outline-0 data-[disabled=true]:opacity-40 data-[disabled=true]:web:cursor-not-allowed data-[focus-visible=true]:web:outline-2 data-[focus-visible=true]:web:outline-ring data-[focus-visible=true]:web:outline data-[focus-visible=true]:web:cursor-pointer data-[disabled=true]:data-[focus=true]:bg-transparent',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const menuBackdropStyle = tva({
|
|
22
|
+
base: 'absolute top-0 bottom-0 left-0 right-0 web:cursor-default',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const menuSeparatorStyle = tva({
|
|
26
|
+
base: 'bg-border h-px w-full',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const menuItemLabelStyle = tva({
|
|
30
|
+
base: 'text-popover-foreground font-normal font-body',
|
|
31
|
+
|
|
32
|
+
variants: {
|
|
33
|
+
isTruncated: {
|
|
34
|
+
true: 'web:truncate',
|
|
35
|
+
},
|
|
36
|
+
bold: {
|
|
37
|
+
true: 'font-bold',
|
|
38
|
+
},
|
|
39
|
+
underline: {
|
|
40
|
+
true: 'underline',
|
|
41
|
+
},
|
|
42
|
+
strikeThrough: {
|
|
43
|
+
true: 'line-through',
|
|
44
|
+
},
|
|
45
|
+
sub: {
|
|
46
|
+
true: 'text-xs',
|
|
47
|
+
},
|
|
48
|
+
italic: {
|
|
49
|
+
true: 'italic',
|
|
50
|
+
},
|
|
51
|
+
highlight: {
|
|
52
|
+
true: 'bg-yellow-500',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const BackdropPressable = React.forwardRef<
|
|
58
|
+
React.ComponentRef<typeof Pressable>,
|
|
59
|
+
React.ComponentPropsWithoutRef<typeof Pressable> &
|
|
60
|
+
VariantProps<typeof menuBackdropStyle>
|
|
61
|
+
>(function BackdropPressable({ className, ...props }, ref) {
|
|
62
|
+
return (
|
|
63
|
+
<Pressable
|
|
64
|
+
ref={ref}
|
|
65
|
+
className={menuBackdropStyle({
|
|
66
|
+
class: className,
|
|
67
|
+
})}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
type IMenuItemProps = VariantProps<typeof menuItemStyle> & {
|
|
74
|
+
className?: string;
|
|
75
|
+
} & React.ComponentPropsWithoutRef<typeof Pressable>;
|
|
76
|
+
|
|
77
|
+
const Item = React.forwardRef<
|
|
78
|
+
React.ComponentRef<typeof Pressable>,
|
|
79
|
+
IMenuItemProps
|
|
80
|
+
>(function Item({ className, ...props }, ref) {
|
|
81
|
+
return (
|
|
82
|
+
<Pressable
|
|
83
|
+
ref={ref}
|
|
84
|
+
className={menuItemStyle({
|
|
85
|
+
class: className,
|
|
86
|
+
})}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const Separator = React.forwardRef<
|
|
93
|
+
React.ComponentRef<typeof View>,
|
|
94
|
+
React.ComponentPropsWithoutRef<typeof View> &
|
|
95
|
+
VariantProps<typeof menuSeparatorStyle>
|
|
96
|
+
>(function Separator({ className, ...props }, ref) {
|
|
97
|
+
return (
|
|
98
|
+
<View
|
|
99
|
+
ref={ref}
|
|
100
|
+
className={menuSeparatorStyle({ class: className })}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
cssInterop(AnimatedView, { className: 'style' });
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
export const UIMenu = createMenu({
|
|
111
|
+
Root: AnimatedView,
|
|
112
|
+
Item: Item,
|
|
113
|
+
Label: Text,
|
|
114
|
+
Backdrop: BackdropPressable,
|
|
115
|
+
Separator: Separator,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
type IMenuProps = React.ComponentProps<typeof UIMenu> &
|
|
120
|
+
VariantProps<typeof menuStyle> & { className?: string };
|
|
121
|
+
type IMenuItemLabelProps = React.ComponentProps<typeof UIMenu.ItemLabel> &
|
|
122
|
+
VariantProps<typeof menuItemLabelStyle> & { className?: string };
|
|
123
|
+
|
|
124
|
+
const Menu = React.forwardRef<React.ComponentRef<typeof UIMenu>, IMenuProps>(
|
|
125
|
+
function Menu({ className, ...props }, ref) {
|
|
126
|
+
return (
|
|
127
|
+
<UIMenu
|
|
128
|
+
entering={ZoomIn.duration(150).withInitialValues({
|
|
129
|
+
transform: [{ scale: 0.9 }],
|
|
130
|
+
opacity: 0,
|
|
131
|
+
})}
|
|
132
|
+
exiting={FadeOut.duration(150)}
|
|
133
|
+
ref={ref}
|
|
134
|
+
className={menuStyle({
|
|
135
|
+
class: className,
|
|
136
|
+
})}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const MenuItem = UIMenu.Item;
|
|
144
|
+
|
|
145
|
+
const MenuItemLabel = React.forwardRef<
|
|
146
|
+
React.ComponentRef<typeof UIMenu.ItemLabel>,
|
|
147
|
+
IMenuItemLabelProps
|
|
148
|
+
>(function MenuItemLabel(
|
|
149
|
+
{
|
|
150
|
+
className,
|
|
151
|
+
isTruncated,
|
|
152
|
+
bold,
|
|
153
|
+
underline,
|
|
154
|
+
strikeThrough,
|
|
155
|
+
sub,
|
|
156
|
+
italic,
|
|
157
|
+
highlight,
|
|
158
|
+
...props
|
|
159
|
+
},
|
|
160
|
+
ref
|
|
161
|
+
) {
|
|
162
|
+
return (
|
|
163
|
+
<UIMenu.ItemLabel
|
|
164
|
+
ref={ref}
|
|
165
|
+
className={menuItemLabelStyle({
|
|
166
|
+
isTruncated: isTruncated as boolean,
|
|
167
|
+
bold: bold as boolean,
|
|
168
|
+
underline: underline as boolean,
|
|
169
|
+
strikeThrough: strikeThrough as boolean,
|
|
170
|
+
sub: sub as boolean,
|
|
171
|
+
italic: italic as boolean,
|
|
172
|
+
highlight: highlight as boolean,
|
|
173
|
+
class: className,
|
|
174
|
+
})}
|
|
175
|
+
{...props}
|
|
176
|
+
/>
|
|
177
|
+
);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const MenuSeparator = UIMenu.Separator;
|
|
181
|
+
|
|
182
|
+
Menu.displayName = 'Menu';
|
|
183
|
+
MenuItem.displayName = 'MenuItem';
|
|
184
|
+
MenuItemLabel.displayName = 'MenuItemLabel';
|
|
185
|
+
MenuSeparator.displayName = 'MenuSeparator';
|
|
186
|
+
export { Menu, MenuItem, MenuItemLabel, MenuSeparator };
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createModal } from '@gluestack-ui/core/modal/creator';
|
|
4
|
+
import { Pressable, View, ScrollView } from 'react-native';
|
|
5
|
+
import Animated, {
|
|
6
|
+
FadeIn,
|
|
7
|
+
FadeOut,
|
|
8
|
+
ZoomIn,
|
|
9
|
+
ZoomOut,
|
|
10
|
+
Easing,
|
|
11
|
+
} from 'react-native-reanimated';
|
|
12
|
+
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
13
|
+
import {
|
|
14
|
+
withStyleContext,
|
|
15
|
+
useStyleContext,
|
|
16
|
+
} from '@gluestack-ui/utils/nativewind-utils';
|
|
17
|
+
import { cssInterop } from 'nativewind';
|
|
18
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
19
|
+
|
|
20
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
21
|
+
const AnimatedView = Animated.createAnimatedComponent(View);
|
|
22
|
+
const SCOPE = 'MODAL';
|
|
23
|
+
|
|
24
|
+
const UIModal = createModal({
|
|
25
|
+
Root: withStyleContext(View as any, SCOPE),
|
|
26
|
+
Backdrop: AnimatedPressable,
|
|
27
|
+
Content: AnimatedView,
|
|
28
|
+
Body: ScrollView,
|
|
29
|
+
CloseButton: Pressable,
|
|
30
|
+
Footer: View,
|
|
31
|
+
Header: View,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
cssInterop(AnimatedPressable, { className: 'style' });
|
|
35
|
+
cssInterop(AnimatedView, { className: 'style' });
|
|
36
|
+
|
|
37
|
+
const modalStyle = tva({
|
|
38
|
+
base: 'group/modal w-full h-full justify-center items-center web:pointer-events-none',
|
|
39
|
+
variants: {
|
|
40
|
+
size: {
|
|
41
|
+
xs: '',
|
|
42
|
+
sm: '',
|
|
43
|
+
md: '',
|
|
44
|
+
lg: '',
|
|
45
|
+
full: '',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const modalBackdropStyle = tva({
|
|
51
|
+
base: 'absolute left-0 top-0 right-0 bottom-0 bg-black/50 web:cursor-default',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const modalContentStyle = tva({
|
|
55
|
+
base: 'bg-background rounded-md overflow-hidden border border-border/80 shadow-hard-2 p-6',
|
|
56
|
+
parentVariants: {
|
|
57
|
+
size: {
|
|
58
|
+
xs: 'w-[60%] max-w-[360px]',
|
|
59
|
+
sm: 'w-[70%] max-w-[420px]',
|
|
60
|
+
md: 'w-[80%] max-w-[510px]',
|
|
61
|
+
lg: 'w-[90%] max-w-[640px]',
|
|
62
|
+
full: 'w-full',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const modalBodyStyle = tva({
|
|
68
|
+
base: 'mt-2 mb-6',
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const modalCloseButtonStyle = tva({
|
|
72
|
+
base: 'group/modal-close-button z-10 rounded data-[focus-visible=true]:web:bg-background/90 web:outline-0 cursor-pointer',
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const modalHeaderStyle = tva({
|
|
76
|
+
base: 'justify-between items-center flex-row',
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const modalFooterStyle = tva({
|
|
80
|
+
base: 'flex-row justify-end items-center gap-2',
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
type IModalProps = React.ComponentProps<typeof UIModal> &
|
|
84
|
+
VariantProps<typeof modalStyle> & { className?: string };
|
|
85
|
+
|
|
86
|
+
type IModalBackdropProps = React.ComponentProps<typeof UIModal.Backdrop> &
|
|
87
|
+
VariantProps<typeof modalBackdropStyle> & { className?: string };
|
|
88
|
+
|
|
89
|
+
type IModalContentProps = React.ComponentProps<typeof UIModal.Content> &
|
|
90
|
+
VariantProps<typeof modalContentStyle> & { className?: string };
|
|
91
|
+
|
|
92
|
+
type IModalHeaderProps = React.ComponentProps<typeof UIModal.Header> &
|
|
93
|
+
VariantProps<typeof modalHeaderStyle> & { className?: string };
|
|
94
|
+
|
|
95
|
+
type IModalBodyProps = React.ComponentProps<typeof UIModal.Body> &
|
|
96
|
+
VariantProps<typeof modalBodyStyle> & { className?: string };
|
|
97
|
+
|
|
98
|
+
type IModalFooterProps = React.ComponentProps<typeof UIModal.Footer> &
|
|
99
|
+
VariantProps<typeof modalFooterStyle> & { className?: string };
|
|
100
|
+
|
|
101
|
+
type IModalCloseButtonProps = React.ComponentProps<typeof UIModal.CloseButton> &
|
|
102
|
+
VariantProps<typeof modalCloseButtonStyle> & { className?: string };
|
|
103
|
+
|
|
104
|
+
const Modal = React.forwardRef<React.ComponentRef<typeof UIModal>, IModalProps>(
|
|
105
|
+
({ className, size = 'md', ...props }, ref) => (
|
|
106
|
+
<UIModal
|
|
107
|
+
ref={ref}
|
|
108
|
+
{...props}
|
|
109
|
+
pointerEvents="box-none"
|
|
110
|
+
className={modalStyle({ size, class: className })}
|
|
111
|
+
context={{ size }}
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const ModalBackdrop = React.forwardRef<
|
|
117
|
+
React.ComponentRef<typeof UIModal.Backdrop>,
|
|
118
|
+
IModalBackdropProps
|
|
119
|
+
>(function ModalBackdrop({ className, ...props }, ref) {
|
|
120
|
+
return (
|
|
121
|
+
<UIModal.Backdrop
|
|
122
|
+
ref={ref}
|
|
123
|
+
entering={FadeIn.duration(200).easing(Easing.linear)}
|
|
124
|
+
exiting={FadeOut.duration(200).easing(Easing.linear)}
|
|
125
|
+
{...props}
|
|
126
|
+
className={modalBackdropStyle({
|
|
127
|
+
class: className,
|
|
128
|
+
})}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const ModalContent = React.forwardRef<
|
|
134
|
+
React.ComponentRef<typeof UIModal.Content>,
|
|
135
|
+
IModalContentProps
|
|
136
|
+
>(function ModalContent({ className, size, ...props }, ref) {
|
|
137
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<UIModal.Content
|
|
141
|
+
ref={ref}
|
|
142
|
+
entering={ZoomIn.duration(200).withInitialValues({
|
|
143
|
+
transform: [{ scale: 0.9 }],
|
|
144
|
+
opacity: 0,
|
|
145
|
+
})}
|
|
146
|
+
exiting={FadeOut.duration(200)}
|
|
147
|
+
{...props}
|
|
148
|
+
className={modalContentStyle({
|
|
149
|
+
parentVariants: {
|
|
150
|
+
size: parentSize,
|
|
151
|
+
},
|
|
152
|
+
size,
|
|
153
|
+
class: className,
|
|
154
|
+
})}
|
|
155
|
+
pointerEvents="auto"
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const ModalHeader = React.forwardRef<
|
|
161
|
+
React.ComponentRef<typeof UIModal.Header>,
|
|
162
|
+
IModalHeaderProps
|
|
163
|
+
>(function ModalHeader({ className, ...props }, ref) {
|
|
164
|
+
return (
|
|
165
|
+
<UIModal.Header
|
|
166
|
+
ref={ref}
|
|
167
|
+
{...props}
|
|
168
|
+
className={modalHeaderStyle({
|
|
169
|
+
class: className,
|
|
170
|
+
})}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
const ModalBody = React.forwardRef<
|
|
176
|
+
React.ComponentRef<typeof UIModal.Body>,
|
|
177
|
+
IModalBodyProps
|
|
178
|
+
>(function ModalBody({ className, ...props }, ref) {
|
|
179
|
+
return (
|
|
180
|
+
<UIModal.Body
|
|
181
|
+
scrollEnabled={false}
|
|
182
|
+
ref={ref}
|
|
183
|
+
{...props}
|
|
184
|
+
className={modalBodyStyle({
|
|
185
|
+
class: className,
|
|
186
|
+
})}
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const ModalFooter = React.forwardRef<
|
|
192
|
+
React.ComponentRef<typeof UIModal.Footer>,
|
|
193
|
+
IModalFooterProps
|
|
194
|
+
>(function ModalFooter({ className, ...props }, ref) {
|
|
195
|
+
return (
|
|
196
|
+
<UIModal.Footer
|
|
197
|
+
ref={ref}
|
|
198
|
+
{...props}
|
|
199
|
+
className={modalFooterStyle({
|
|
200
|
+
class: className,
|
|
201
|
+
})}
|
|
202
|
+
/>
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const ModalCloseButton = React.forwardRef<
|
|
207
|
+
React.ComponentRef<typeof UIModal.CloseButton>,
|
|
208
|
+
IModalCloseButtonProps
|
|
209
|
+
>(function ModalCloseButton({ className, ...props }, ref) {
|
|
210
|
+
return (
|
|
211
|
+
<UIModal.CloseButton
|
|
212
|
+
ref={ref}
|
|
213
|
+
{...props}
|
|
214
|
+
className={modalCloseButtonStyle({
|
|
215
|
+
class: className,
|
|
216
|
+
})}
|
|
217
|
+
/>
|
|
218
|
+
);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
Modal.displayName = 'Modal';
|
|
222
|
+
ModalBackdrop.displayName = 'ModalBackdrop';
|
|
223
|
+
ModalContent.displayName = 'ModalContent';
|
|
224
|
+
ModalHeader.displayName = 'ModalHeader';
|
|
225
|
+
ModalBody.displayName = 'ModalBody';
|
|
226
|
+
ModalFooter.displayName = 'ModalFooter';
|
|
227
|
+
ModalCloseButton.displayName = 'ModalCloseButton';
|
|
228
|
+
|
|
229
|
+
export {
|
|
230
|
+
Modal,
|
|
231
|
+
ModalBackdrop,
|
|
232
|
+
ModalContent,
|
|
233
|
+
ModalCloseButton,
|
|
234
|
+
ModalHeader,
|
|
235
|
+
ModalBody,
|
|
236
|
+
ModalFooter,
|
|
237
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createPopover } from '@gluestack-ui/core/popover/creator';
|
|
3
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
4
|
+
import {
|
|
5
|
+
tva,
|
|
6
|
+
useStyleContext,
|
|
7
|
+
withStyleContext,
|
|
8
|
+
} from '@gluestack-ui/utils/nativewind-utils';
|
|
9
|
+
import { cssInterop } from 'nativewind';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { Pressable, ScrollView, View } from 'react-native';
|
|
12
|
+
import Animated, {
|
|
13
|
+
FadeIn,
|
|
14
|
+
FadeOut,
|
|
15
|
+
ZoomIn,
|
|
16
|
+
ZoomOut,
|
|
17
|
+
} from 'react-native-reanimated';
|
|
18
|
+
|
|
19
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
20
|
+
const AnimatedView = Animated.createAnimatedComponent(View);
|
|
21
|
+
|
|
22
|
+
const SCOPE = 'POPOVER';
|
|
23
|
+
|
|
24
|
+
const UIPopover = createPopover({
|
|
25
|
+
Root: withStyleContext(AnimatedView, SCOPE),
|
|
26
|
+
Arrow: View,
|
|
27
|
+
Backdrop: AnimatedPressable,
|
|
28
|
+
Body: ScrollView,
|
|
29
|
+
CloseButton: Pressable,
|
|
30
|
+
Content: View,
|
|
31
|
+
Footer: View,
|
|
32
|
+
Header: View,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
cssInterop(AnimatedView, { className: 'style' });
|
|
36
|
+
cssInterop(AnimatedPressable, { className: 'style' });
|
|
37
|
+
|
|
38
|
+
const popoverStyle = tva({
|
|
39
|
+
base: 'group/popover w-full h-full justify-center items-center web:pointer-events-none',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const popoverArrowStyle = tva({
|
|
43
|
+
base: 'bg-popover z-[1] border absolute overflow-hidden h-3.5 w-3.5 border-border dark:border-border/90',
|
|
44
|
+
variants: {
|
|
45
|
+
placement: {
|
|
46
|
+
'top left':
|
|
47
|
+
'data-[flip=false]:border-t-0 data-[flip=false]:border-l-0 data-[flip=true]:border-b-0 data-[flip=true]:border-r-0',
|
|
48
|
+
'top':
|
|
49
|
+
'data-[flip=false]:border-t-0 data-[flip=false]:border-l-0 data-[flip=true]:border-b-0 data-[flip=true]:border-r-0',
|
|
50
|
+
'top right':
|
|
51
|
+
'data-[flip=false]:border-t-0 data-[flip=false]:border-l-0 data-[flip=true]:border-b-0 data-[flip=true]:border-r-0',
|
|
52
|
+
'bottom':
|
|
53
|
+
'data-[flip=false]:border-b-0 data-[flip=false]:border-r-0 data-[flip=true]:border-t-0 data-[flip=true]:border-l-0',
|
|
54
|
+
'bottom left':
|
|
55
|
+
'data-[flip=false]:border-b-0 data-[flip=false]:border-r-0 data-[flip=true]:border-t-0 data-[flip=true]:border-l-0',
|
|
56
|
+
'bottom right':
|
|
57
|
+
'data-[flip=false]:border-b-0 data-[flip=false]:border-r-0 data-[flip=true]:border-t-0 data-[flip=true]:border-l-0',
|
|
58
|
+
'left':
|
|
59
|
+
'data-[flip=false]:border-l-0 data-[flip=false]:border-b-0 data-[flip=true]:border-r-0 data-[flip=true]:border-t-0',
|
|
60
|
+
'left top':
|
|
61
|
+
'data-[flip=false]:border-l-0 data-[flip=false]:border-b-0 data-[flip=true]:border-r-0 data-[flip=true]:border-t-0',
|
|
62
|
+
'left bottom':
|
|
63
|
+
'data-[flip=false]:border-l-0 data-[flip=false]:border-b-0 data-[flip=true]:border-r-0 data-[flip=true]:border-t-0',
|
|
64
|
+
'right':
|
|
65
|
+
'data-[flip=false]:border-r-0 data-[flip=false]:border-t-0 data-[flip=true]:border-l-0 data-[flip=true]:border-b-0',
|
|
66
|
+
'right top':
|
|
67
|
+
'data-[flip=false]:border-r-0 data-[flip=false]:border-t-0 data-[flip=true]:border-l-0 data-[flip=true]:border-b-0',
|
|
68
|
+
'right bottom':
|
|
69
|
+
'data-[flip=false]:border-r-0 data-[flip=false]:border-t-0 data-[flip=true]:border-l-0 data-[flip=true]:border-b-0',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const popoverBackdropStyle = tva({
|
|
75
|
+
base: 'absolute left-0 top-0 right-0 bottom-0 web:cursor-default',
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const popoverCloseButtonStyle = tva({
|
|
79
|
+
base: 'group/popover-close-button z-[1] rounded-sm p-2 data-[focus-visible=true]:bg-accent web:outline-0 web:cursor-pointer data-[hover=true]:bg-accent/50',
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const popoverContentStyle = tva({
|
|
83
|
+
base: 'bg-popover text-popover-foreground rounded-lg overflow-hidden border border-border dark:border-border/10 shadow-md p-4 w-full max-w-xs web:pointer-events-auto',
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const popoverHeaderStyle = tva({
|
|
87
|
+
base: 'flex-row justify-between items-center',
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const popoverBodyStyle = tva({
|
|
91
|
+
base: '',
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const popoverFooterStyle = tva({
|
|
95
|
+
base: 'flex-row justify-between items-center',
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
type IPopoverProps = React.ComponentProps<typeof UIPopover> &
|
|
99
|
+
VariantProps<typeof popoverStyle> & { className?: string };
|
|
100
|
+
|
|
101
|
+
type IPopoverArrowProps = React.ComponentProps<typeof UIPopover.Arrow> &
|
|
102
|
+
VariantProps<typeof popoverArrowStyle> & { className?: string };
|
|
103
|
+
|
|
104
|
+
type IPopoverContentProps = React.ComponentProps<typeof UIPopover.Content> &
|
|
105
|
+
VariantProps<typeof popoverContentStyle> & { className?: string };
|
|
106
|
+
|
|
107
|
+
type IPopoverHeaderProps = React.ComponentProps<typeof UIPopover.Header> &
|
|
108
|
+
VariantProps<typeof popoverHeaderStyle> & { className?: string };
|
|
109
|
+
|
|
110
|
+
type IPopoverFooterProps = React.ComponentProps<typeof UIPopover.Footer> &
|
|
111
|
+
VariantProps<typeof popoverFooterStyle> & { className?: string };
|
|
112
|
+
|
|
113
|
+
type IPopoverBodyProps = React.ComponentProps<typeof UIPopover.Body> &
|
|
114
|
+
VariantProps<typeof popoverBodyStyle> & { className?: string };
|
|
115
|
+
|
|
116
|
+
type IPopoverBackdropProps = React.ComponentProps<typeof UIPopover.Backdrop> &
|
|
117
|
+
VariantProps<typeof popoverBackdropStyle> & { className?: string };
|
|
118
|
+
|
|
119
|
+
type IPopoverCloseButtonProps = React.ComponentProps<
|
|
120
|
+
typeof UIPopover.CloseButton
|
|
121
|
+
> &
|
|
122
|
+
VariantProps<typeof popoverCloseButtonStyle> & { className?: string };
|
|
123
|
+
|
|
124
|
+
const Popover = React.forwardRef<
|
|
125
|
+
React.ComponentRef<typeof UIPopover>,
|
|
126
|
+
IPopoverProps
|
|
127
|
+
>(function Popover({ className, placement = 'bottom', ...props }, ref) {
|
|
128
|
+
return (
|
|
129
|
+
<UIPopover
|
|
130
|
+
ref={ref}
|
|
131
|
+
placement={placement}
|
|
132
|
+
{...props}
|
|
133
|
+
entering={FadeIn.duration(200).withInitialValues({
|
|
134
|
+
opacity: 0,
|
|
135
|
+
})}
|
|
136
|
+
exiting={FadeOut.duration(150)}
|
|
137
|
+
className={popoverStyle({ class: className })}
|
|
138
|
+
context={{ placement }}
|
|
139
|
+
pointerEvents="box-none"
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const PopoverContent = React.forwardRef<
|
|
145
|
+
React.ComponentRef<typeof UIPopover.Content>,
|
|
146
|
+
IPopoverContentProps
|
|
147
|
+
>(function PopoverContent({ className, ...props }, ref) {
|
|
148
|
+
return (
|
|
149
|
+
<UIPopover.Content
|
|
150
|
+
ref={ref}
|
|
151
|
+
{...props}
|
|
152
|
+
className={popoverContentStyle({
|
|
153
|
+
class: className,
|
|
154
|
+
})}
|
|
155
|
+
pointerEvents="auto"
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const PopoverArrow = React.forwardRef<
|
|
161
|
+
React.ComponentRef<typeof UIPopover.Arrow>,
|
|
162
|
+
IPopoverArrowProps
|
|
163
|
+
>(function PopoverArrow({ className, ...props }, ref) {
|
|
164
|
+
const { placement } = useStyleContext(SCOPE);
|
|
165
|
+
return (
|
|
166
|
+
<UIPopover.Arrow
|
|
167
|
+
ref={ref}
|
|
168
|
+
{...props}
|
|
169
|
+
className={popoverArrowStyle({
|
|
170
|
+
class: className,
|
|
171
|
+
placement,
|
|
172
|
+
})}
|
|
173
|
+
/>
|
|
174
|
+
);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
const PopoverBackdrop = React.forwardRef<
|
|
178
|
+
React.ComponentRef<typeof UIPopover.Backdrop>,
|
|
179
|
+
IPopoverBackdropProps
|
|
180
|
+
>(function PopoverBackdrop({ className, ...props }, ref) {
|
|
181
|
+
return (
|
|
182
|
+
<UIPopover.Backdrop
|
|
183
|
+
ref={ref}
|
|
184
|
+
entering={FadeIn.duration(100).delay(50)}
|
|
185
|
+
exiting={FadeOut.duration(100)}
|
|
186
|
+
{...props}
|
|
187
|
+
className={popoverBackdropStyle({
|
|
188
|
+
class: className,
|
|
189
|
+
})}
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const PopoverBody = React.forwardRef<
|
|
195
|
+
React.ComponentRef<typeof UIPopover.Body>,
|
|
196
|
+
IPopoverBodyProps
|
|
197
|
+
>(function PopoverBody({ className, ...props }, ref) {
|
|
198
|
+
return (
|
|
199
|
+
<UIPopover.Body
|
|
200
|
+
ref={ref}
|
|
201
|
+
{...props}
|
|
202
|
+
className={popoverBodyStyle({
|
|
203
|
+
class: className,
|
|
204
|
+
})}
|
|
205
|
+
/>
|
|
206
|
+
);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
const PopoverCloseButton = React.forwardRef<
|
|
210
|
+
React.ComponentRef<typeof UIPopover.CloseButton>,
|
|
211
|
+
IPopoverCloseButtonProps
|
|
212
|
+
>(function PopoverCloseButton({ className, ...props }, ref) {
|
|
213
|
+
return (
|
|
214
|
+
<UIPopover.CloseButton
|
|
215
|
+
ref={ref}
|
|
216
|
+
{...props}
|
|
217
|
+
className={popoverCloseButtonStyle({
|
|
218
|
+
class: className,
|
|
219
|
+
})}
|
|
220
|
+
/>
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
const PopoverFooter = React.forwardRef<
|
|
225
|
+
React.ComponentRef<typeof UIPopover.Footer>,
|
|
226
|
+
IPopoverFooterProps
|
|
227
|
+
>(function PopoverFooter({ className, ...props }, ref) {
|
|
228
|
+
return (
|
|
229
|
+
<UIPopover.Footer
|
|
230
|
+
ref={ref}
|
|
231
|
+
{...props}
|
|
232
|
+
className={popoverFooterStyle({
|
|
233
|
+
class: className,
|
|
234
|
+
})}
|
|
235
|
+
/>
|
|
236
|
+
);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const PopoverHeader = React.forwardRef<
|
|
240
|
+
React.ComponentRef<typeof UIPopover.Header>,
|
|
241
|
+
IPopoverHeaderProps
|
|
242
|
+
>(function PopoverHeader({ className, ...props }, ref) {
|
|
243
|
+
return (
|
|
244
|
+
<UIPopover.Header
|
|
245
|
+
ref={ref}
|
|
246
|
+
{...props}
|
|
247
|
+
className={popoverHeaderStyle({
|
|
248
|
+
class: className,
|
|
249
|
+
})}
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
Popover.displayName = 'Popover';
|
|
255
|
+
PopoverArrow.displayName = 'PopoverArrow';
|
|
256
|
+
PopoverBackdrop.displayName = 'PopoverBackdrop';
|
|
257
|
+
PopoverContent.displayName = 'PopoverContent';
|
|
258
|
+
PopoverHeader.displayName = 'PopoverHeader';
|
|
259
|
+
PopoverFooter.displayName = 'PopoverFooter';
|
|
260
|
+
PopoverBody.displayName = 'PopoverBody';
|
|
261
|
+
PopoverCloseButton.displayName = 'PopoverCloseButton';
|
|
262
|
+
|
|
263
|
+
export {
|
|
264
|
+
Popover,
|
|
265
|
+
PopoverArrow,
|
|
266
|
+
PopoverBackdrop,
|
|
267
|
+
PopoverBody,
|
|
268
|
+
PopoverCloseButton,
|
|
269
|
+
PopoverContent,
|
|
270
|
+
PopoverFooter,
|
|
271
|
+
PopoverHeader,
|
|
272
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Overlay } from '@gluestack-ui/core/overlay/creator';
|
|
4
|
+
import { cssInterop } from 'nativewind';
|
|
5
|
+
|
|
6
|
+
cssInterop(Overlay, { className: 'style' });
|
|
7
|
+
|
|
8
|
+
const Portal = React.forwardRef<
|
|
9
|
+
React.ComponentRef<typeof Overlay>,
|
|
10
|
+
React.ComponentProps<typeof Overlay>
|
|
11
|
+
>(function Portal({ ...props }, ref) {
|
|
12
|
+
return <Overlay {...props} ref={ref} />;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
Portal.displayName = 'Portal';
|
|
16
|
+
|
|
17
|
+
export { Portal };
|