@admin-layout/gluestack-ui-mobile 11.0.4-alpha.0 → 12.0.16-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -4
- package/lib/__tests__/prolayout-layout-feature.test.js +1 -1
- package/lib/__tests__/prolayout-layout-feature.test.js.map +1 -1
- package/lib/components/AuthWrapper.js +5 -3
- package/lib/components/AuthWrapper.js.map +1 -1
- package/lib/components/ErrorBounday.js.map +1 -1
- package/lib/components/NavigationComponent.js.map +1 -1
- package/lib/components/UnAuthenticatedComponent.js.map +1 -1
- package/lib/components/WithConfiguration.js +4 -4
- package/lib/components/WithConfiguration.js.map +1 -1
- package/lib/components/WithPermission.js +1 -1
- package/lib/components/WithPermission.js.map +1 -1
- package/lib/components/WithPolicy.js +2 -2
- package/lib/components/WithPolicy.js.map +1 -1
- package/lib/components/ui/accordion/index.web.d.ts +209 -0
- package/lib/components/ui/accordion/index.web.js +156 -0
- package/lib/components/ui/accordion/index.web.js.map +1 -0
- package/lib/components/ui/actionsheet/index.web.d.ts +872 -0
- package/lib/components/ui/actionsheet/index.web.js +286 -0
- package/lib/components/ui/actionsheet/index.web.js.map +1 -0
- package/lib/components/ui/alert/index.web.d.ts +135 -0
- package/lib/components/ui/alert/index.web.js +38 -0
- package/lib/components/ui/alert/index.web.js.map +1 -0
- package/lib/components/ui/alert-dialog/index.web.d.ts +64 -0
- package/lib/components/ui/alert-dialog/index.web.js +139 -0
- package/lib/components/ui/alert-dialog/index.web.js.map +1 -0
- package/lib/components/ui/avatar/index.web.d.ts +21 -0
- package/lib/components/ui/avatar/index.web.js +92 -0
- package/lib/components/ui/avatar/index.web.js.map +1 -0
- package/lib/components/ui/badge/index.web.d.ts +382 -0
- package/lib/components/ui/badge/index.web.js +138 -0
- package/lib/components/ui/badge/index.web.js.map +1 -0
- package/lib/components/ui/button/index.web.d.ts +247 -0
- package/lib/components/ui/button/index.web.js +57 -0
- package/lib/components/ui/button/index.web.js.map +1 -0
- package/lib/components/ui/checkbox/index.web.d.ts +265 -0
- package/lib/components/ui/checkbox/index.web.js +77 -0
- package/lib/components/ui/checkbox/index.web.js.map +1 -0
- package/lib/components/ui/divider/index.web.d.ts +53 -0
- package/lib/components/ui/divider/index.web.js +21 -0
- package/lib/components/ui/divider/index.web.js.map +1 -0
- package/lib/components/ui/drawer/index.web.d.ts +174 -0
- package/lib/components/ui/drawer/index.web.js +65 -0
- package/lib/components/ui/drawer/index.web.js.map +1 -0
- package/lib/components/ui/fab/index.web.d.ts +520 -0
- package/lib/components/ui/fab/index.web.js +146 -0
- package/lib/components/ui/fab/index.web.js.map +1 -0
- package/lib/components/ui/flat-list/index.web.d.ts +21 -0
- package/lib/components/ui/flat-list/index.web.js +41 -0
- package/lib/components/ui/flat-list/index.web.js.map +1 -0
- package/lib/components/ui/form-control/index.web.d.ts +2071 -0
- package/lib/components/ui/form-control/index.web.js +290 -0
- package/lib/components/ui/form-control/index.web.js.map +1 -0
- package/lib/components/ui/image/index.web.d.ts +142 -0
- package/lib/components/ui/image/index.web.js +29 -0
- package/lib/components/ui/image/index.web.js.map +1 -0
- package/lib/components/ui/image-background/index.web.d.ts +8 -0
- package/lib/components/ui/image-background/index.web.js +23 -0
- package/lib/components/ui/image-background/index.web.js.map +1 -0
- package/lib/components/ui/input/index.web.d.ts +163 -0
- package/lib/components/ui/input/index.web.js +50 -0
- package/lib/components/ui/input/index.web.js.map +1 -0
- package/lib/components/ui/input-accessory-view/index.web.d.ts +9 -0
- package/lib/components/ui/input-accessory-view/index.web.js +16 -0
- package/lib/components/ui/input-accessory-view/index.web.js.map +1 -0
- package/lib/components/ui/keyboard-avoiding-view/index.web.d.ts +9 -0
- package/lib/components/ui/keyboard-avoiding-view/index.web.js +8 -0
- package/lib/components/ui/keyboard-avoiding-view/index.web.js.map +1 -0
- package/lib/components/ui/link/index.web.d.ts +365 -0
- package/lib/components/ui/link/index.web.js +70 -0
- package/lib/components/ui/link/index.web.js.map +1 -0
- package/lib/components/ui/menu/index.web.d.ts +142 -0
- package/lib/components/ui/menu/index.web.js +83 -0
- package/lib/components/ui/menu/index.web.js.map +1 -0
- package/lib/components/ui/modal/index.web.d.ts +111 -0
- package/lib/components/ui/modal/index.web.js +58 -0
- package/lib/components/ui/modal/index.web.js.map +1 -0
- package/lib/components/ui/popover/index.web.d.ts +309 -0
- package/lib/components/ui/popover/index.web.js +184 -0
- package/lib/components/ui/popover/index.web.js.map +1 -0
- package/lib/components/ui/portal/index.web.d.ts +9 -0
- package/lib/components/ui/portal/index.web.js +16 -0
- package/lib/components/ui/portal/index.web.js.map +1 -0
- package/lib/components/ui/pressable/index.web.d.ts +8 -0
- package/lib/components/ui/pressable/index.web.js +44 -0
- package/lib/components/ui/pressable/index.web.js.map +1 -0
- package/lib/components/ui/progress/index.web.d.ts +237 -0
- package/lib/components/ui/progress/index.web.js +73 -0
- package/lib/components/ui/progress/index.web.js.map +1 -0
- package/lib/components/ui/radio/index.web.d.ts +224 -0
- package/lib/components/ui/radio/index.web.js +69 -0
- package/lib/components/ui/radio/index.web.js.map +1 -0
- package/lib/components/ui/refresh-control/index.web.d.ts +14 -0
- package/lib/components/ui/refresh-control/index.web.js +69 -0
- package/lib/components/ui/refresh-control/index.web.js.map +1 -0
- package/lib/components/ui/safe-area-view/index.web.d.ts +6 -0
- package/lib/components/ui/safe-area-view/index.web.js +10 -0
- package/lib/components/ui/safe-area-view/index.web.js.map +1 -0
- package/lib/components/ui/scroll-view/index.web.d.ts +44 -0
- package/lib/components/ui/scroll-view/index.web.js +41 -0
- package/lib/components/ui/scroll-view/index.web.js.map +1 -0
- package/lib/components/ui/section-list/index.web.d.ts +26 -0
- package/lib/components/ui/section-list/index.web.js +35 -0
- package/lib/components/ui/section-list/index.web.js.map +1 -0
- package/lib/components/ui/select/index.web.d.ts +162 -0
- package/lib/components/ui/select/index.web.js +51 -0
- package/lib/components/ui/select/index.web.js.map +1 -0
- package/lib/components/ui/slider/index.web.d.ts +223 -0
- package/lib/components/ui/slider/index.web.js +189 -0
- package/lib/components/ui/slider/index.web.js.map +1 -0
- package/lib/components/ui/spinner/index.web.d.ts +176 -0
- package/lib/components/ui/spinner/index.web.js +55 -0
- package/lib/components/ui/spinner/index.web.js.map +1 -0
- package/lib/components/ui/status-bar/index.web.d.ts +14 -0
- package/lib/components/ui/status-bar/index.web.js +7 -0
- package/lib/components/ui/status-bar/index.web.js.map +1 -0
- package/lib/components/ui/switch/index.web.d.ts +71 -0
- package/lib/components/ui/switch/index.web.js +27 -0
- package/lib/components/ui/switch/index.web.js.map +1 -0
- package/lib/components/ui/tabs/index.web.d.ts +351 -0
- package/lib/components/ui/tabs/index.web.js +120 -0
- package/lib/components/ui/tabs/index.web.js.map +1 -0
- package/lib/components/ui/textarea/index.web.d.ts +162 -0
- package/lib/components/ui/textarea/index.web.js +50 -0
- package/lib/components/ui/textarea/index.web.js.map +1 -0
- package/lib/components/ui/toast/index.web.d.ts +225 -0
- package/lib/components/ui/toast/index.web.js +80 -0
- package/lib/components/ui/toast/index.web.js.map +1 -0
- package/lib/components/ui/tooltip/index.web.d.ts +86 -0
- package/lib/components/ui/tooltip/index.web.js +110 -0
- package/lib/components/ui/tooltip/index.web.js.map +1 -0
- package/lib/components/ui/view/index.web.d.ts +2 -0
- package/lib/components/ui/view/index.web.js +7 -0
- package/lib/components/ui/view/index.web.js.map +1 -0
- package/lib/components/ui/virtualized-list/index.web.d.ts +19 -0
- package/lib/components/ui/virtualized-list/index.web.js +30 -0
- package/lib/components/ui/virtualized-list/index.web.js.map +1 -0
- package/lib/components/usePermissionAutoFetch.d.ts +7 -19
- package/lib/components/with-interactions-lifecycle-managed.js.map +1 -1
- package/lib/components/with-interactions-managed.js +2 -3
- package/lib/components/with-interactions-managed.js.map +1 -1
- package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +47 -47
- package/lib/containers/layout/DrawerConfig.d.ts +31 -31
- package/lib/containers/layout/module.js +1 -1
- package/lib/containers/layout/module.js.map +1 -1
- package/lib/interfaces/settings.d.ts +1 -0
- package/lib/redux/settings.d.ts +4 -9
- package/lib/utils/routeConfigKeyReplace.test.js +1 -1
- package/lib/utils/routeConfigKeyReplace.test.js.map +1 -1
- package/package.json +7 -4
- package/src/__tests__/prolayout-layout-feature.test.tsx +2 -2
- package/src/components/AuthWrapper.tsx +6 -3
- package/src/components/ErrorBounday.tsx +18 -19
- package/src/components/NavigationComponent.tsx +1 -1
- package/src/components/UnAuthenticatedComponent.tsx +1 -3
- package/src/components/WithConfiguration.tsx +5 -8
- package/src/components/WithPermission.tsx +1 -1
- package/src/components/WithPolicy.tsx +4 -3
- package/src/components/ui/accordion/index.web.tsx +294 -0
- package/src/components/ui/actionsheet/index.web.tsx +555 -0
- package/src/components/ui/alert/index.web.tsx +71 -0
- package/src/components/ui/alert-dialog/index.web.tsx +241 -0
- package/src/components/ui/avatar/index.web.tsx +150 -0
- package/src/components/ui/badge/index.web.tsx +188 -0
- package/src/components/ui/button/index.web.tsx +86 -0
- package/src/components/ui/checkbox/index.web.tsx +151 -0
- package/src/components/ui/divider/index.web.tsx +37 -0
- package/src/components/ui/drawer/index.web.tsx +144 -0
- package/src/components/ui/fab/index.web.tsx +201 -0
- package/src/components/ui/flat-list/index.web.tsx +89 -0
- package/src/components/ui/form-control/index.web.tsx +451 -0
- package/src/components/ui/image/index.web.tsx +43 -0
- package/src/components/ui/image-background/index.web.tsx +43 -0
- package/src/components/ui/input/index.web.tsx +80 -0
- package/src/components/ui/input-accessory-view/index.web.tsx +31 -0
- package/src/components/ui/keyboard-avoiding-view/index.web.tsx +23 -0
- package/src/components/ui/link/index.web.tsx +103 -0
- package/src/components/ui/menu/index.web.tsx +159 -0
- package/src/components/ui/modal/index.web.tsx +135 -0
- package/src/components/ui/popover/index.web.tsx +326 -0
- package/src/components/ui/portal/index.web.tsx +34 -0
- package/src/components/ui/pressable/index.web.tsx +73 -0
- package/src/components/ui/progress/index.web.tsx +123 -0
- package/src/components/ui/radio/index.web.tsx +130 -0
- package/src/components/ui/refresh-control/index.web.tsx +104 -0
- package/src/components/ui/safe-area-view/index.web.tsx +24 -0
- package/src/components/ui/scroll-view/index.web.tsx +142 -0
- package/src/components/ui/section-list/index.web.tsx +93 -0
- package/src/components/ui/select/index.web.tsx +83 -0
- package/src/components/ui/slider/index.web.tsx +283 -0
- package/src/components/ui/spinner/index.web.tsx +81 -0
- package/src/components/ui/status-bar/index.web.tsx +20 -0
- package/src/components/ui/switch/index.web.tsx +44 -0
- package/src/components/ui/tabs/index.web.tsx +205 -0
- package/src/components/ui/textarea/index.web.tsx +86 -0
- package/src/components/ui/toast/index.web.tsx +132 -0
- package/src/components/ui/tooltip/index.web.tsx +155 -0
- package/src/components/ui/view/index.web.tsx +15 -0
- package/src/components/ui/virtualized-list/index.web.tsx +84 -0
- package/src/components/with-interactions-lifecycle-managed.tsx +0 -4
- package/src/components/with-interactions-managed.tsx +3 -4
- package/src/containers/layout/module.ts +1 -1
- package/src/interfaces/settings.ts +1 -0
- package/src/utils/routeConfigKeyReplace.test.ts +4 -4
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
3
|
+
declare const checkboxStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
4
|
+
size: {
|
|
5
|
+
sm: string;
|
|
6
|
+
md: string;
|
|
7
|
+
lg: string;
|
|
8
|
+
};
|
|
9
|
+
variant: {
|
|
10
|
+
outline: string;
|
|
11
|
+
solid: string;
|
|
12
|
+
};
|
|
13
|
+
status: {
|
|
14
|
+
error: string;
|
|
15
|
+
success: string;
|
|
16
|
+
warning: string;
|
|
17
|
+
};
|
|
18
|
+
} | ({
|
|
19
|
+
size: {
|
|
20
|
+
sm: string;
|
|
21
|
+
md: string;
|
|
22
|
+
lg: string;
|
|
23
|
+
};
|
|
24
|
+
variant: {
|
|
25
|
+
outline: string;
|
|
26
|
+
solid: string;
|
|
27
|
+
};
|
|
28
|
+
status: {
|
|
29
|
+
error: string;
|
|
30
|
+
success: string;
|
|
31
|
+
warning: string;
|
|
32
|
+
};
|
|
33
|
+
} & {
|
|
34
|
+
size: {
|
|
35
|
+
sm: import("tailwind-merge").ClassNameValue | {
|
|
36
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
37
|
+
};
|
|
38
|
+
md: import("tailwind-merge").ClassNameValue | {
|
|
39
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
40
|
+
};
|
|
41
|
+
lg: import("tailwind-merge").ClassNameValue | {
|
|
42
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
variant: {
|
|
46
|
+
outline: import("tailwind-merge").ClassNameValue | {
|
|
47
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
48
|
+
};
|
|
49
|
+
solid: import("tailwind-merge").ClassNameValue | {
|
|
50
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
status: {
|
|
54
|
+
error: import("tailwind-merge").ClassNameValue | {
|
|
55
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
56
|
+
};
|
|
57
|
+
success: import("tailwind-merge").ClassNameValue | {
|
|
58
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
59
|
+
};
|
|
60
|
+
warning: import("tailwind-merge").ClassNameValue | {
|
|
61
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}), undefined, "form-checkbox rounded transition duration-150 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
|
|
65
|
+
size: {
|
|
66
|
+
sm: string;
|
|
67
|
+
md: string;
|
|
68
|
+
lg: string;
|
|
69
|
+
};
|
|
70
|
+
variant: {
|
|
71
|
+
outline: string;
|
|
72
|
+
solid: string;
|
|
73
|
+
};
|
|
74
|
+
status: {
|
|
75
|
+
error: string;
|
|
76
|
+
success: string;
|
|
77
|
+
warning: string;
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
size: {
|
|
81
|
+
sm: string;
|
|
82
|
+
md: string;
|
|
83
|
+
lg: string;
|
|
84
|
+
};
|
|
85
|
+
variant: {
|
|
86
|
+
outline: string;
|
|
87
|
+
solid: string;
|
|
88
|
+
};
|
|
89
|
+
status: {
|
|
90
|
+
error: string;
|
|
91
|
+
success: string;
|
|
92
|
+
warning: string;
|
|
93
|
+
};
|
|
94
|
+
}>, {
|
|
95
|
+
size: {
|
|
96
|
+
sm: string;
|
|
97
|
+
md: string;
|
|
98
|
+
lg: string;
|
|
99
|
+
};
|
|
100
|
+
variant: {
|
|
101
|
+
outline: string;
|
|
102
|
+
solid: string;
|
|
103
|
+
};
|
|
104
|
+
status: {
|
|
105
|
+
error: string;
|
|
106
|
+
success: string;
|
|
107
|
+
warning: string;
|
|
108
|
+
};
|
|
109
|
+
}, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
110
|
+
size: {
|
|
111
|
+
sm: string;
|
|
112
|
+
md: string;
|
|
113
|
+
lg: string;
|
|
114
|
+
};
|
|
115
|
+
variant: {
|
|
116
|
+
outline: string;
|
|
117
|
+
solid: string;
|
|
118
|
+
};
|
|
119
|
+
status: {
|
|
120
|
+
error: string;
|
|
121
|
+
success: string;
|
|
122
|
+
warning: string;
|
|
123
|
+
};
|
|
124
|
+
}, undefined, "form-checkbox rounded transition duration-150 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
|
|
125
|
+
size: {
|
|
126
|
+
sm: string;
|
|
127
|
+
md: string;
|
|
128
|
+
lg: string;
|
|
129
|
+
};
|
|
130
|
+
variant: {
|
|
131
|
+
outline: string;
|
|
132
|
+
solid: string;
|
|
133
|
+
};
|
|
134
|
+
status: {
|
|
135
|
+
error: string;
|
|
136
|
+
success: string;
|
|
137
|
+
warning: string;
|
|
138
|
+
};
|
|
139
|
+
}, {
|
|
140
|
+
size: {
|
|
141
|
+
sm: string;
|
|
142
|
+
md: string;
|
|
143
|
+
lg: string;
|
|
144
|
+
};
|
|
145
|
+
variant: {
|
|
146
|
+
outline: string;
|
|
147
|
+
solid: string;
|
|
148
|
+
};
|
|
149
|
+
status: {
|
|
150
|
+
error: string;
|
|
151
|
+
success: string;
|
|
152
|
+
warning: string;
|
|
153
|
+
};
|
|
154
|
+
}>, unknown, unknown, undefined>>;
|
|
155
|
+
declare const labelStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
156
|
+
size: {
|
|
157
|
+
sm: string;
|
|
158
|
+
md: string;
|
|
159
|
+
lg: string;
|
|
160
|
+
};
|
|
161
|
+
disabled: {
|
|
162
|
+
true: string;
|
|
163
|
+
};
|
|
164
|
+
} | ({
|
|
165
|
+
size: {
|
|
166
|
+
sm: string;
|
|
167
|
+
md: string;
|
|
168
|
+
lg: string;
|
|
169
|
+
};
|
|
170
|
+
disabled: {
|
|
171
|
+
true: string;
|
|
172
|
+
};
|
|
173
|
+
} & {
|
|
174
|
+
size: {
|
|
175
|
+
sm: import("tailwind-merge").ClassNameValue | {
|
|
176
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
177
|
+
};
|
|
178
|
+
md: import("tailwind-merge").ClassNameValue | {
|
|
179
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
180
|
+
};
|
|
181
|
+
lg: import("tailwind-merge").ClassNameValue | {
|
|
182
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
disabled: {
|
|
186
|
+
true: import("tailwind-merge").ClassNameValue | {
|
|
187
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
}), undefined, "ml-2 select-none", import("tailwind-variants/dist/config").TVConfig<{
|
|
191
|
+
size: {
|
|
192
|
+
sm: string;
|
|
193
|
+
md: string;
|
|
194
|
+
lg: string;
|
|
195
|
+
};
|
|
196
|
+
disabled: {
|
|
197
|
+
true: string;
|
|
198
|
+
};
|
|
199
|
+
}, {
|
|
200
|
+
size: {
|
|
201
|
+
sm: string;
|
|
202
|
+
md: string;
|
|
203
|
+
lg: string;
|
|
204
|
+
};
|
|
205
|
+
disabled: {
|
|
206
|
+
true: string;
|
|
207
|
+
};
|
|
208
|
+
}>, {
|
|
209
|
+
size: {
|
|
210
|
+
sm: string;
|
|
211
|
+
md: string;
|
|
212
|
+
lg: string;
|
|
213
|
+
};
|
|
214
|
+
disabled: {
|
|
215
|
+
true: string;
|
|
216
|
+
};
|
|
217
|
+
}, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
218
|
+
size: {
|
|
219
|
+
sm: string;
|
|
220
|
+
md: string;
|
|
221
|
+
lg: string;
|
|
222
|
+
};
|
|
223
|
+
disabled: {
|
|
224
|
+
true: string;
|
|
225
|
+
};
|
|
226
|
+
}, undefined, "ml-2 select-none", import("tailwind-variants/dist/config").TVConfig<{
|
|
227
|
+
size: {
|
|
228
|
+
sm: string;
|
|
229
|
+
md: string;
|
|
230
|
+
lg: string;
|
|
231
|
+
};
|
|
232
|
+
disabled: {
|
|
233
|
+
true: string;
|
|
234
|
+
};
|
|
235
|
+
}, {
|
|
236
|
+
size: {
|
|
237
|
+
sm: string;
|
|
238
|
+
md: string;
|
|
239
|
+
lg: string;
|
|
240
|
+
};
|
|
241
|
+
disabled: {
|
|
242
|
+
true: string;
|
|
243
|
+
};
|
|
244
|
+
}>, unknown, unknown, undefined>>;
|
|
245
|
+
type CheckboxGroupContextType = {
|
|
246
|
+
values?: string[];
|
|
247
|
+
onChange?: (values: string[]) => void;
|
|
248
|
+
size?: VariantProps<typeof checkboxStyle>['size'];
|
|
249
|
+
status?: VariantProps<typeof checkboxStyle>['status'];
|
|
250
|
+
variant?: VariantProps<typeof checkboxStyle>['variant'];
|
|
251
|
+
};
|
|
252
|
+
export declare const CheckboxGroup: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & CheckboxGroupContextType, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
253
|
+
export declare const CheckboxLabel: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLLabelElement> & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
254
|
+
size?: VariantProps<typeof labelStyle>["size"];
|
|
255
|
+
disabled?: boolean;
|
|
256
|
+
}, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
257
|
+
export declare const CheckboxIcon: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
258
|
+
type ICheckboxProps = Omit<React.ComponentProps<'input'>, 'size'> & {
|
|
259
|
+
value: string;
|
|
260
|
+
size?: VariantProps<typeof checkboxStyle>['size'];
|
|
261
|
+
status?: VariantProps<typeof checkboxStyle>['status'];
|
|
262
|
+
variant?: VariantProps<typeof checkboxStyle>['variant'];
|
|
263
|
+
};
|
|
264
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<ICheckboxProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
265
|
+
export { Checkbox };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { forwardRef, createContext, useContext } from 'react';
|
|
3
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
4
|
+
const SCOPE = 'CHECKBOX';
|
|
5
|
+
const checkboxStyle = tva({
|
|
6
|
+
base: 'form-checkbox rounded transition duration-150 ease-in-out',
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: 'h-3 w-3',
|
|
10
|
+
md: 'h-4 w-4',
|
|
11
|
+
lg: 'h-5 w-5',
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
outline: 'border-2',
|
|
15
|
+
solid: 'bg-blue-600 border-transparent',
|
|
16
|
+
},
|
|
17
|
+
status: {
|
|
18
|
+
error: 'border-red-500 focus:border-red-500 focus:ring-red-500',
|
|
19
|
+
success: 'border-green-500 focus:border-green-500 focus:ring-green-500',
|
|
20
|
+
warning: 'border-yellow-500 focus:border-yellow-500 focus:ring-yellow-500',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
size: 'md',
|
|
25
|
+
variant: 'outline',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const labelStyle = tva({
|
|
29
|
+
base: 'ml-2 select-none',
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: 'text-sm',
|
|
33
|
+
md: 'text-base',
|
|
34
|
+
lg: 'text-lg',
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
true: 'opacity-50 cursor-not-allowed',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
size: 'md',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
const CheckboxGroupContext = createContext({});
|
|
45
|
+
export const CheckboxGroup = forwardRef(({ values, onChange, size, status, variant, ...props }, ref) => {
|
|
46
|
+
return (React.createElement(CheckboxGroupContext.Provider, { value: { values, onChange, size, status, variant } },
|
|
47
|
+
React.createElement("div", { ref: ref, role: "group", ...props })));
|
|
48
|
+
});
|
|
49
|
+
CheckboxGroup.displayName = 'CheckboxGroup';
|
|
50
|
+
export const CheckboxLabel = forwardRef(({ className, size, disabled, ...props }, ref) => {
|
|
51
|
+
return React.createElement("label", { ref: ref, className: labelStyle({ size, disabled, class: className }), ...props });
|
|
52
|
+
});
|
|
53
|
+
CheckboxLabel.displayName = 'CheckboxLabel';
|
|
54
|
+
export const CheckboxIcon = forwardRef(({ className, children, ...props }, ref) => {
|
|
55
|
+
return (React.createElement("div", { ref: ref, className: `flex items-center justify-center ${className || ''}`, ...props }, children));
|
|
56
|
+
});
|
|
57
|
+
CheckboxIcon.displayName = 'CheckboxIcon';
|
|
58
|
+
const Checkbox = forwardRef(({ className, value, size: itemSize, status: itemStatus, variant: itemVariant, onChange, checked: controlledChecked, ...props }, ref) => {
|
|
59
|
+
const group = useContext(CheckboxGroupContext);
|
|
60
|
+
const size = itemSize || group.size;
|
|
61
|
+
const status = itemStatus || group.status;
|
|
62
|
+
const variant = itemVariant || group.variant;
|
|
63
|
+
const isChecked = group.values ? group.values.includes(value) : controlledChecked;
|
|
64
|
+
const handleChange = (e) => {
|
|
65
|
+
if (onChange) {
|
|
66
|
+
onChange(e);
|
|
67
|
+
}
|
|
68
|
+
if (group.onChange && group.values) {
|
|
69
|
+
const newValues = e.target.checked ? [...group.values, value] : group.values.filter((v) => v !== value);
|
|
70
|
+
group.onChange(newValues);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
return (React.createElement("input", { ref: ref, type: "checkbox", value: value, checked: isChecked, onChange: handleChange, className: checkboxStyle({ size, status, variant, class: className }), ...props }));
|
|
74
|
+
});
|
|
75
|
+
Checkbox.displayName = 'Checkbox';
|
|
76
|
+
export { Checkbox };
|
|
77
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/checkbox/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAKzD,MAAM,KAAK,GAAG,UAAU,CAAC;AAEzB,MAAM,aAAa,GAAG,GAAG,CAAC;IACtB,IAAI,EAAE,2DAA2D;IACjE,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;SAChB;QACD,OAAO,EAAE;YACL,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,gCAAgC;SAC1C;QACD,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,MAAM,EAAE,CAAC;YACjC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;YACxG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC9B,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,+BACI,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,KACjE,KAAK,GACX,CACL,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
3
|
+
declare const Divider: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
4
|
+
orientation: {
|
|
5
|
+
vertical: string;
|
|
6
|
+
horizontal: string;
|
|
7
|
+
};
|
|
8
|
+
} | ({
|
|
9
|
+
orientation: {
|
|
10
|
+
vertical: string;
|
|
11
|
+
horizontal: string;
|
|
12
|
+
};
|
|
13
|
+
} & {
|
|
14
|
+
orientation: {
|
|
15
|
+
vertical: import("tailwind-merge").ClassNameValue | {
|
|
16
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
17
|
+
};
|
|
18
|
+
horizontal: import("tailwind-merge").ClassNameValue | {
|
|
19
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}), undefined, "bg-background-200", import("tailwind-variants/dist/config").TVConfig<{
|
|
23
|
+
orientation: {
|
|
24
|
+
vertical: string;
|
|
25
|
+
horizontal: string;
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
orientation: {
|
|
29
|
+
vertical: string;
|
|
30
|
+
horizontal: string;
|
|
31
|
+
};
|
|
32
|
+
}>, {
|
|
33
|
+
orientation: {
|
|
34
|
+
vertical: string;
|
|
35
|
+
horizontal: string;
|
|
36
|
+
};
|
|
37
|
+
}, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
38
|
+
orientation: {
|
|
39
|
+
vertical: string;
|
|
40
|
+
horizontal: string;
|
|
41
|
+
};
|
|
42
|
+
}, undefined, "bg-background-200", import("tailwind-variants/dist/config").TVConfig<{
|
|
43
|
+
orientation: {
|
|
44
|
+
vertical: string;
|
|
45
|
+
horizontal: string;
|
|
46
|
+
};
|
|
47
|
+
}, {
|
|
48
|
+
orientation: {
|
|
49
|
+
vertical: string;
|
|
50
|
+
horizontal: string;
|
|
51
|
+
};
|
|
52
|
+
}>, unknown, unknown, undefined>>> & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
export { Divider };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
4
|
+
const dividerStyle = tva({
|
|
5
|
+
base: 'bg-background-200',
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
vertical: 'w-px h-full',
|
|
9
|
+
horizontal: 'h-px w-full',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
const Divider = React.forwardRef(({ className, orientation = 'horizontal', ...props }, ref) => {
|
|
14
|
+
return (React.createElement("div", { ref: ref, ...props, "aria-orientation": orientation, role: "separator", className: dividerStyle({
|
|
15
|
+
orientation,
|
|
16
|
+
class: className,
|
|
17
|
+
}) }));
|
|
18
|
+
});
|
|
19
|
+
Divider.displayName = 'Divider';
|
|
20
|
+
export { Divider };
|
|
21
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/divider/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAGzD,MAAM,YAAY,GAAG,GAAG,CAAC;IACrB,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE;QACN,WAAW,EAAE;YACT,QAAQ,EAAE,aAAa;YACvB,UAAU,EAAE,aAAa;SAC5B;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzD,OAAO,CACH,6BACI,GAAG,EAAE,GAAG,KACJ,KAAK,sBACS,WAAW,EAC7B,IAAI,EAAC,WAAW,EAChB,SAAS,EAAE,YAAY,CAAC;YACpB,WAAW;YACX,KAAK,EAAE,SAAS;SACnB,CAAC,GACJ,CACL,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
3
|
+
declare const drawerStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
4
|
+
placement: {
|
|
5
|
+
left: string;
|
|
6
|
+
right: string;
|
|
7
|
+
top: string;
|
|
8
|
+
bottom: string;
|
|
9
|
+
};
|
|
10
|
+
size: {
|
|
11
|
+
xs: string;
|
|
12
|
+
sm: string;
|
|
13
|
+
md: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
xl: string;
|
|
16
|
+
full: string;
|
|
17
|
+
};
|
|
18
|
+
} | ({
|
|
19
|
+
placement: {
|
|
20
|
+
left: string;
|
|
21
|
+
right: string;
|
|
22
|
+
top: string;
|
|
23
|
+
bottom: string;
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
xs: string;
|
|
27
|
+
sm: string;
|
|
28
|
+
md: string;
|
|
29
|
+
lg: string;
|
|
30
|
+
xl: string;
|
|
31
|
+
full: string;
|
|
32
|
+
};
|
|
33
|
+
} & {
|
|
34
|
+
placement: {
|
|
35
|
+
left: import("tailwind-merge").ClassNameValue | {
|
|
36
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
37
|
+
};
|
|
38
|
+
right: import("tailwind-merge").ClassNameValue | {
|
|
39
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
40
|
+
};
|
|
41
|
+
top: import("tailwind-merge").ClassNameValue | {
|
|
42
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
43
|
+
};
|
|
44
|
+
bottom: import("tailwind-merge").ClassNameValue | {
|
|
45
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
size: {
|
|
49
|
+
xs: import("tailwind-merge").ClassNameValue | {
|
|
50
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
51
|
+
};
|
|
52
|
+
sm: import("tailwind-merge").ClassNameValue | {
|
|
53
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
54
|
+
};
|
|
55
|
+
md: import("tailwind-merge").ClassNameValue | {
|
|
56
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
57
|
+
};
|
|
58
|
+
lg: import("tailwind-merge").ClassNameValue | {
|
|
59
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
60
|
+
};
|
|
61
|
+
xl: import("tailwind-merge").ClassNameValue | {
|
|
62
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
63
|
+
};
|
|
64
|
+
full: import("tailwind-merge").ClassNameValue | {
|
|
65
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}), undefined, "fixed bg-white shadow-xl transition-transform duration-300 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
|
|
69
|
+
placement: {
|
|
70
|
+
left: string;
|
|
71
|
+
right: string;
|
|
72
|
+
top: string;
|
|
73
|
+
bottom: string;
|
|
74
|
+
};
|
|
75
|
+
size: {
|
|
76
|
+
xs: string;
|
|
77
|
+
sm: string;
|
|
78
|
+
md: string;
|
|
79
|
+
lg: string;
|
|
80
|
+
xl: string;
|
|
81
|
+
full: string;
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
placement: {
|
|
85
|
+
left: string;
|
|
86
|
+
right: string;
|
|
87
|
+
top: string;
|
|
88
|
+
bottom: string;
|
|
89
|
+
};
|
|
90
|
+
size: {
|
|
91
|
+
xs: string;
|
|
92
|
+
sm: string;
|
|
93
|
+
md: string;
|
|
94
|
+
lg: string;
|
|
95
|
+
xl: string;
|
|
96
|
+
full: string;
|
|
97
|
+
};
|
|
98
|
+
}>, {
|
|
99
|
+
placement: {
|
|
100
|
+
left: string;
|
|
101
|
+
right: string;
|
|
102
|
+
top: string;
|
|
103
|
+
bottom: string;
|
|
104
|
+
};
|
|
105
|
+
size: {
|
|
106
|
+
xs: string;
|
|
107
|
+
sm: string;
|
|
108
|
+
md: string;
|
|
109
|
+
lg: string;
|
|
110
|
+
xl: string;
|
|
111
|
+
full: string;
|
|
112
|
+
};
|
|
113
|
+
}, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
114
|
+
placement: {
|
|
115
|
+
left: string;
|
|
116
|
+
right: string;
|
|
117
|
+
top: string;
|
|
118
|
+
bottom: string;
|
|
119
|
+
};
|
|
120
|
+
size: {
|
|
121
|
+
xs: string;
|
|
122
|
+
sm: string;
|
|
123
|
+
md: string;
|
|
124
|
+
lg: string;
|
|
125
|
+
xl: string;
|
|
126
|
+
full: string;
|
|
127
|
+
};
|
|
128
|
+
}, undefined, "fixed bg-white shadow-xl transition-transform duration-300 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
|
|
129
|
+
placement: {
|
|
130
|
+
left: string;
|
|
131
|
+
right: string;
|
|
132
|
+
top: string;
|
|
133
|
+
bottom: string;
|
|
134
|
+
};
|
|
135
|
+
size: {
|
|
136
|
+
xs: string;
|
|
137
|
+
sm: string;
|
|
138
|
+
md: string;
|
|
139
|
+
lg: string;
|
|
140
|
+
xl: string;
|
|
141
|
+
full: string;
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
placement: {
|
|
145
|
+
left: string;
|
|
146
|
+
right: string;
|
|
147
|
+
top: string;
|
|
148
|
+
bottom: string;
|
|
149
|
+
};
|
|
150
|
+
size: {
|
|
151
|
+
xs: string;
|
|
152
|
+
sm: string;
|
|
153
|
+
md: string;
|
|
154
|
+
lg: string;
|
|
155
|
+
xl: string;
|
|
156
|
+
full: string;
|
|
157
|
+
};
|
|
158
|
+
}>, unknown, unknown, undefined>>;
|
|
159
|
+
export declare const DrawerContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
160
|
+
export declare const DrawerHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
161
|
+
export declare const DrawerBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
162
|
+
export declare const DrawerFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
163
|
+
export declare const DrawerCloseButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
164
|
+
type IDrawerProps = {
|
|
165
|
+
isOpen?: boolean;
|
|
166
|
+
onClose?: () => void;
|
|
167
|
+
children?: React.ReactNode;
|
|
168
|
+
className?: string;
|
|
169
|
+
placement?: VariantProps<typeof drawerStyle>['placement'];
|
|
170
|
+
size?: VariantProps<typeof drawerStyle>['size'];
|
|
171
|
+
closeOnOverlayClick?: boolean;
|
|
172
|
+
};
|
|
173
|
+
declare const Drawer: React.ForwardRefExoticComponent<IDrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
174
|
+
export { Drawer };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
3
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
const SCOPE = 'DRAWER';
|
|
6
|
+
const DrawerOverlay = ({ onPress, className }) => (React.createElement("div", { onClick: onPress, className: `fixed inset-0 bg-black bg-opacity-40 transition-opacity ${className || ''}`, "aria-hidden": "true" }));
|
|
7
|
+
const drawerStyle = tva({
|
|
8
|
+
base: 'fixed bg-white shadow-xl transition-transform duration-300 ease-in-out',
|
|
9
|
+
variants: {
|
|
10
|
+
placement: {
|
|
11
|
+
left: 'left-0 top-0 bottom-0 transform -translate-x-full',
|
|
12
|
+
right: 'right-0 top-0 bottom-0 transform translate-x-full',
|
|
13
|
+
top: 'top-0 left-0 right-0 transform -translate-y-full',
|
|
14
|
+
bottom: 'bottom-0 left-0 right-0 transform translate-y-full',
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
xs: 'w-[95%] max-w-xs',
|
|
18
|
+
sm: 'w-[95%] max-w-sm',
|
|
19
|
+
md: 'w-[95%] max-w-md',
|
|
20
|
+
lg: 'w-[95%] max-w-lg',
|
|
21
|
+
xl: 'w-[95%] max-w-xl',
|
|
22
|
+
full: 'w-full',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
placement: 'right',
|
|
27
|
+
size: 'md',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export const DrawerContent = forwardRef(({ className, ...props }, ref) => (React.createElement("div", { ref: ref, className: `h-full flex flex-col ${className || ''}`, ...props })));
|
|
31
|
+
DrawerContent.displayName = 'DrawerContent';
|
|
32
|
+
export const DrawerHeader = forwardRef(({ className, ...props }, ref) => (React.createElement("div", { ref: ref, className: `px-6 py-4 border-b border-gray-200 ${className || ''}`, ...props })));
|
|
33
|
+
DrawerHeader.displayName = 'DrawerHeader';
|
|
34
|
+
export const DrawerBody = forwardRef(({ className, ...props }, ref) => (React.createElement("div", { ref: ref, className: `flex-1 p-6 overflow-y-auto ${className || ''}`, ...props })));
|
|
35
|
+
DrawerBody.displayName = 'DrawerBody';
|
|
36
|
+
export const DrawerFooter = forwardRef(({ className, ...props }, ref) => (React.createElement("div", { ref: ref, className: `px-6 py-4 border-t border-gray-200 ${className || ''}`, ...props })));
|
|
37
|
+
DrawerFooter.displayName = 'DrawerFooter';
|
|
38
|
+
export const DrawerCloseButton = forwardRef(({ className, onClick, ...props }, ref) => (React.createElement("button", { ref: ref, className: `absolute right-4 top-4 text-gray-400 hover:text-gray-600 ${className || ''}`, onClick: onClick, "aria-label": "Close drawer", ...props }, "\u00D7")));
|
|
39
|
+
DrawerCloseButton.displayName = 'DrawerCloseButton';
|
|
40
|
+
const Drawer = forwardRef(({ isOpen, onClose, children, className, placement, size, closeOnOverlayClick = true, ...props }, ref) => {
|
|
41
|
+
const drawerRef = useRef(null);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const handleEscape = (event) => {
|
|
44
|
+
if (event.key === 'Escape' && onClose) {
|
|
45
|
+
onClose();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
if (isOpen) {
|
|
49
|
+
document.addEventListener('keydown', handleEscape);
|
|
50
|
+
document.body.style.overflow = 'hidden';
|
|
51
|
+
}
|
|
52
|
+
return () => {
|
|
53
|
+
document.removeEventListener('keydown', handleEscape);
|
|
54
|
+
document.body.style.overflow = '';
|
|
55
|
+
};
|
|
56
|
+
}, [isOpen, onClose]);
|
|
57
|
+
if (!isOpen)
|
|
58
|
+
return null;
|
|
59
|
+
return createPortal(React.createElement(React.Fragment, null,
|
|
60
|
+
React.createElement(DrawerOverlay, { onPress: closeOnOverlayClick ? onClose : undefined }),
|
|
61
|
+
React.createElement("div", { ref: ref, className: `${drawerStyle({ placement, size, class: className })} ${isOpen ? 'translate-x-0 translate-y-0' : ''}`, role: "dialog", "aria-modal": "true", ...props }, children)), document.body);
|
|
62
|
+
});
|
|
63
|
+
Drawer.displayName = 'Drawer';
|
|
64
|
+
export { Drawer };
|
|
65
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/drawer/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAIzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,KAAK,GAAG,QAAQ,CAAC;AAOvB,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAsB,EAAE,EAAE,CAAC,CAClE,6BACI,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE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