@admin-layout/gluestack-ui-mobile 10.0.9-alpha.9 → 10.1.1-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 +1 -9
- 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/containers/layout/DrawerBottomNavigationConfig.d.ts +47 -47
- package/lib/containers/layout/DrawerConfig.d.ts +31 -31
- package/lib/redux/settings.d.ts +3 -9
- package/package.json +9 -5
- 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
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createPopover } from '@gluestack-ui/popover';
|
|
4
|
+
import { Motion, createMotionAnimatedComponent, AnimatePresence } from '@legendapp/motion';
|
|
5
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
6
|
+
import { withStyleContext, useStyleContext } from '@gluestack-ui/nativewind-utils/withStyleContext';
|
|
7
|
+
import { cssInterop } from 'nativewind';
|
|
8
|
+
// Create web-specific components
|
|
9
|
+
const Div = React.forwardRef((props, ref) => React.createElement("div", { ref: ref, ...props }));
|
|
10
|
+
Div.displayName = 'Div';
|
|
11
|
+
const Button = React.forwardRef((props, ref) => (React.createElement("button", { type: "button", ref: ref, ...props })));
|
|
12
|
+
Button.displayName = 'Button';
|
|
13
|
+
const AnimatedDiv = createMotionAnimatedComponent(Div);
|
|
14
|
+
const MotionDiv = Motion.View;
|
|
15
|
+
const SCOPE = 'POPOVER';
|
|
16
|
+
const UIPopover = createPopover({
|
|
17
|
+
Root: withStyleContext(Div, SCOPE),
|
|
18
|
+
Arrow: MotionDiv,
|
|
19
|
+
Backdrop: AnimatedDiv,
|
|
20
|
+
Body: Div,
|
|
21
|
+
CloseButton: Button,
|
|
22
|
+
Content: MotionDiv,
|
|
23
|
+
Footer: Div,
|
|
24
|
+
Header: Div,
|
|
25
|
+
AnimatePresence: AnimatePresence,
|
|
26
|
+
});
|
|
27
|
+
cssInterop(MotionDiv, { className: 'style' });
|
|
28
|
+
cssInterop(AnimatedDiv, { className: 'style' });
|
|
29
|
+
const SIZES = {
|
|
30
|
+
xs: 'xs',
|
|
31
|
+
sm: 'sm',
|
|
32
|
+
md: 'md',
|
|
33
|
+
lg: 'lg',
|
|
34
|
+
full: 'full',
|
|
35
|
+
};
|
|
36
|
+
const popoverStyle = tva({
|
|
37
|
+
base: 'group/popover w-full h-full justify-center items-center pointer-events-none',
|
|
38
|
+
variants: {
|
|
39
|
+
size: {
|
|
40
|
+
[SIZES.xs]: '',
|
|
41
|
+
[SIZES.sm]: '',
|
|
42
|
+
[SIZES.md]: '',
|
|
43
|
+
[SIZES.lg]: '',
|
|
44
|
+
[SIZES.full]: '',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const popoverArrowStyle = tva({
|
|
49
|
+
base: 'bg-background-0 z-[1] border absolute overflow-hidden h-3.5 w-3.5 border-outline-100',
|
|
50
|
+
variants: {
|
|
51
|
+
placement: {
|
|
52
|
+
'top left': 'data-[flip=false]:border-t-0 data-[flip=false]:border-l-0 data-[flip=true]:border-b-0 data-[flip=true]:border-r-0',
|
|
53
|
+
top: 'data-[flip=false]:border-t-0 data-[flip=false]:border-l-0 data-[flip=true]:border-b-0 data-[flip=true]:border-r-0',
|
|
54
|
+
'top right': 'data-[flip=false]:border-t-0 data-[flip=false]:border-l-0 data-[flip=true]:border-b-0 data-[flip=true]:border-r-0',
|
|
55
|
+
bottom: '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 left': 'data-[flip=false]:border-b-0 data-[flip=false]:border-r-0 data-[flip=true]:border-t-0 data-[flip=true]:border-l-0',
|
|
57
|
+
'bottom right': '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: 'data-[flip=false]:border-l-0 data-[flip=false]:border-b-0 data-[flip=true]:border-r-0 data-[flip=true]:border-t-0',
|
|
59
|
+
'left top': '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 bottom': 'data-[flip=false]:border-l-0 data-[flip=false]:border-b-0 data-[flip=true]:border-r-0 data-[flip=true]:border-t-0',
|
|
61
|
+
right: 'data-[flip=false]:border-r-0 data-[flip=false]:border-t-0 data-[flip=true]:border-l-0 data-[flip=true]:border-b-0',
|
|
62
|
+
'right top': 'data-[flip=false]:border-r-0 data-[flip=false]:border-t-0 data-[flip=true]:border-l-0 data-[flip=true]:border-b-0',
|
|
63
|
+
'right bottom': 'data-[flip=false]:border-r-0 data-[flip=false]:border-t-0 data-[flip=true]:border-l-0 data-[flip=true]:border-b-0',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
const popoverBackdropStyle = tva({
|
|
68
|
+
base: 'absolute left-0 top-0 right-0 bottom-0 cursor-default',
|
|
69
|
+
});
|
|
70
|
+
const popoverCloseButtonStyle = tva({
|
|
71
|
+
base: 'group/popover-close-button z-[1] rounded-sm data-[focus-visible=true]:bg-background-100 outline-0 cursor-pointer',
|
|
72
|
+
});
|
|
73
|
+
const popoverContentStyle = tva({
|
|
74
|
+
base: 'bg-background-0 rounded-lg overflow-hidden border border-outline-100 w-full',
|
|
75
|
+
parentVariants: {
|
|
76
|
+
size: {
|
|
77
|
+
[SIZES.xs]: 'max-w-[360px] p-3.5',
|
|
78
|
+
[SIZES.sm]: 'max-w-[420px] p-4',
|
|
79
|
+
[SIZES.md]: 'max-w-[510px] p-[18px]',
|
|
80
|
+
[SIZES.lg]: 'max-w-[640px] p-5',
|
|
81
|
+
[SIZES.full]: 'p-6',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
const popoverHeaderStyle = tva({
|
|
86
|
+
base: 'flex-row justify-between items-center',
|
|
87
|
+
});
|
|
88
|
+
const popoverBodyStyle = tva({
|
|
89
|
+
base: '',
|
|
90
|
+
});
|
|
91
|
+
const popoverFooterStyle = tva({
|
|
92
|
+
base: 'flex-row justify-between items-center',
|
|
93
|
+
});
|
|
94
|
+
const Popover = React.forwardRef(({ className, size = 'md', placement = 'bottom', ...props }, ref) => {
|
|
95
|
+
return (React.createElement(UIPopover, { ref: ref, placement: placement, ...props, className: popoverStyle({ size: size, class: className }), context: { size, placement } }));
|
|
96
|
+
});
|
|
97
|
+
const PopoverContent = React.forwardRef(({ className, size, ...props }, ref) => {
|
|
98
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
99
|
+
return (React.createElement(UIPopover.Content, { ref: ref, transition: {
|
|
100
|
+
type: 'spring',
|
|
101
|
+
damping: 18,
|
|
102
|
+
stiffness: 250,
|
|
103
|
+
mass: 0.9,
|
|
104
|
+
opacity: {
|
|
105
|
+
type: 'timing',
|
|
106
|
+
duration: 50,
|
|
107
|
+
delay: 50,
|
|
108
|
+
},
|
|
109
|
+
}, ...props, className: popoverContentStyle({
|
|
110
|
+
parentVariants: {
|
|
111
|
+
size: parentSize,
|
|
112
|
+
},
|
|
113
|
+
size: size,
|
|
114
|
+
class: className,
|
|
115
|
+
}) }));
|
|
116
|
+
});
|
|
117
|
+
const PopoverArrow = React.forwardRef(({ className, ...props }, ref) => {
|
|
118
|
+
const { placement } = useStyleContext(SCOPE);
|
|
119
|
+
return (React.createElement(UIPopover.Arrow, { ref: ref, transition: {
|
|
120
|
+
type: 'spring',
|
|
121
|
+
damping: 18,
|
|
122
|
+
stiffness: 250,
|
|
123
|
+
mass: 0.9,
|
|
124
|
+
opacity: {
|
|
125
|
+
type: 'timing',
|
|
126
|
+
duration: 50,
|
|
127
|
+
delay: 50,
|
|
128
|
+
},
|
|
129
|
+
}, ...props, className: popoverArrowStyle({
|
|
130
|
+
class: className,
|
|
131
|
+
placement,
|
|
132
|
+
}) }));
|
|
133
|
+
});
|
|
134
|
+
const PopoverBackdrop = React.forwardRef(({ className, ...props }, ref) => {
|
|
135
|
+
return (React.createElement(UIPopover.Backdrop, { ref: ref, ...props, initial: {
|
|
136
|
+
opacity: 0,
|
|
137
|
+
}, animate: {
|
|
138
|
+
opacity: 0.1,
|
|
139
|
+
}, exit: {
|
|
140
|
+
opacity: 0,
|
|
141
|
+
}, transition: {
|
|
142
|
+
type: 'spring',
|
|
143
|
+
damping: 18,
|
|
144
|
+
stiffness: 450,
|
|
145
|
+
mass: 0.9,
|
|
146
|
+
opacity: {
|
|
147
|
+
type: 'timing',
|
|
148
|
+
duration: 50,
|
|
149
|
+
delay: 50,
|
|
150
|
+
},
|
|
151
|
+
}, className: popoverBackdropStyle({
|
|
152
|
+
class: className,
|
|
153
|
+
}) }));
|
|
154
|
+
});
|
|
155
|
+
const PopoverBody = React.forwardRef(({ className, ...props }, ref) => {
|
|
156
|
+
return (React.createElement(UIPopover.Body, { ref: ref, ...props, className: popoverBodyStyle({
|
|
157
|
+
class: className,
|
|
158
|
+
}) }));
|
|
159
|
+
});
|
|
160
|
+
const PopoverCloseButton = React.forwardRef(({ className, ...props }, ref) => {
|
|
161
|
+
return (React.createElement(UIPopover.CloseButton, { ref: ref, ...props, className: popoverCloseButtonStyle({
|
|
162
|
+
class: className,
|
|
163
|
+
}) }));
|
|
164
|
+
});
|
|
165
|
+
const PopoverFooter = React.forwardRef(({ className, ...props }, ref) => {
|
|
166
|
+
return (React.createElement(UIPopover.Footer, { ref: ref, ...props, className: popoverFooterStyle({
|
|
167
|
+
class: className,
|
|
168
|
+
}) }));
|
|
169
|
+
});
|
|
170
|
+
const PopoverHeader = React.forwardRef(({ className, ...props }, ref) => {
|
|
171
|
+
return (React.createElement(UIPopover.Header, { ref: ref, ...props, className: popoverHeaderStyle({
|
|
172
|
+
class: className,
|
|
173
|
+
}) }));
|
|
174
|
+
});
|
|
175
|
+
Popover.displayName = 'Popover';
|
|
176
|
+
PopoverArrow.displayName = 'PopoverArrow';
|
|
177
|
+
PopoverBackdrop.displayName = 'PopoverBackdrop';
|
|
178
|
+
PopoverContent.displayName = 'PopoverContent';
|
|
179
|
+
PopoverHeader.displayName = 'PopoverHeader';
|
|
180
|
+
PopoverFooter.displayName = 'PopoverFooter';
|
|
181
|
+
PopoverBody.displayName = 'PopoverBody';
|
|
182
|
+
PopoverCloseButton.displayName = 'PopoverCloseButton';
|
|
183
|
+
export { Popover, PopoverBackdrop, PopoverArrow, PopoverCloseButton, PopoverFooter, PopoverHeader, PopoverBody, PopoverContent, };
|
|
184
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/popover/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AACzD,OAAO,EAAE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AK,CAAC,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC7B,OAAO,CACH,oBAAC,SAAS,CAAC,MAAM,IACb,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,SAAS,EAAE,kBAAkB,CAAC;YAC1B,KAAK,EAAE,SAAS;SACnB,CAAC,GACJ,CACL,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAChC,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC1C,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAChD,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC9C,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAC5C,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAC5C,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AACxC,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,OAAO,EACH,OAAO,EACP,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,GACjB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PortalProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
containerRef?: React.RefObject<HTMLElement>;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
export declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
export const Portal = React.forwardRef(({ children, containerRef, className, style, ...props }, ref) => {
|
|
5
|
+
const [mounted, setMounted] = React.useState(false);
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
setMounted(true);
|
|
8
|
+
return () => setMounted(false);
|
|
9
|
+
}, []);
|
|
10
|
+
if (!mounted)
|
|
11
|
+
return null;
|
|
12
|
+
const container = containerRef?.current ?? document.body;
|
|
13
|
+
return createPortal(React.createElement("div", { ref: ref, className: className, style: style, ...props }, children), container);
|
|
14
|
+
});
|
|
15
|
+
Portal.displayName = 'Portal';
|
|
16
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/portal/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AASzC,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC5D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,MAAM,SAAS,GAAG,YAAY,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC;IAEzD,OAAO,YAAY,CACf,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IACvD,QAAQ,CACP,EACN,SAAS,CACZ,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Pressable: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "disabled"> & {
|
|
3
|
+
onPress?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
4
|
+
onPressIn?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
+
onPressOut?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { forwardRef, useState } from 'react';
|
|
3
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
const pressableStyle = tva({
|
|
6
|
+
base: 'cursor-pointer select-none outline-none',
|
|
7
|
+
variants: {
|
|
8
|
+
disabled: {
|
|
9
|
+
true: 'opacity-40 cursor-not-allowed',
|
|
10
|
+
},
|
|
11
|
+
pressed: {
|
|
12
|
+
true: 'opacity-70',
|
|
13
|
+
},
|
|
14
|
+
hovered: {
|
|
15
|
+
true: 'hover:opacity-80',
|
|
16
|
+
},
|
|
17
|
+
focused: {
|
|
18
|
+
true: 'focus:ring-2 focus:ring-offset-2 focus:ring-blue-500',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
export const Pressable = forwardRef(({ onPress, onPressIn, onPressOut, disabled, className, children, ...props }, ref) => {
|
|
23
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
24
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
25
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
26
|
+
return (React.createElement("button", { ref: ref, className: pressableStyle({
|
|
27
|
+
disabled,
|
|
28
|
+
pressed: isPressed,
|
|
29
|
+
hovered: isHovered,
|
|
30
|
+
focused: isFocused,
|
|
31
|
+
class: clsx(className),
|
|
32
|
+
}), disabled: disabled, onClick: onPress, onMouseDown: (e) => {
|
|
33
|
+
setIsPressed(true);
|
|
34
|
+
onPressIn?.(e);
|
|
35
|
+
}, onMouseUp: (e) => {
|
|
36
|
+
setIsPressed(false);
|
|
37
|
+
onPressOut?.(e);
|
|
38
|
+
}, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => {
|
|
39
|
+
setIsHovered(false);
|
|
40
|
+
setIsPressed(false);
|
|
41
|
+
}, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props }, children));
|
|
42
|
+
});
|
|
43
|
+
Pressable.displayName = 'Pressable';
|
|
44
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/pressable/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,cAAc,GAAG,GAAG,CAAC;IACvB,IAAI,EAAE,yCAAyC;IAC/C,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,IAAI,EAAE,+BAA+B;SACxC;QACD,OAAO,EAAE;YACL,IAAI,EAAE,YAAY;SACrB;QACD,OAAO,EAAE;YACL,IAAI,EAAE,kBAAkB;SAC3B;QACD,OAAO,EAAE;YACL,IAAI,EAAE,sDAAsD;SAC/D;KACJ;CACJ,CAAC,CAAC;AAUH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAC/B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,E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|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
3
|
+
declare const progressStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
4
|
+
size: {
|
|
5
|
+
xs: string;
|
|
6
|
+
sm: string;
|
|
7
|
+
md: string;
|
|
8
|
+
lg: string;
|
|
9
|
+
};
|
|
10
|
+
variant: {
|
|
11
|
+
determinate: string;
|
|
12
|
+
indeterminate: string;
|
|
13
|
+
};
|
|
14
|
+
} | ({
|
|
15
|
+
size: {
|
|
16
|
+
xs: string;
|
|
17
|
+
sm: string;
|
|
18
|
+
md: string;
|
|
19
|
+
lg: string;
|
|
20
|
+
};
|
|
21
|
+
variant: {
|
|
22
|
+
determinate: string;
|
|
23
|
+
indeterminate: string;
|
|
24
|
+
};
|
|
25
|
+
} & {
|
|
26
|
+
size: {
|
|
27
|
+
xs: import("tailwind-merge").ClassNameValue | {
|
|
28
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
29
|
+
};
|
|
30
|
+
sm: import("tailwind-merge").ClassNameValue | {
|
|
31
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
32
|
+
};
|
|
33
|
+
md: import("tailwind-merge").ClassNameValue | {
|
|
34
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
35
|
+
};
|
|
36
|
+
lg: import("tailwind-merge").ClassNameValue | {
|
|
37
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
variant: {
|
|
41
|
+
determinate: import("tailwind-merge").ClassNameValue | {
|
|
42
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
43
|
+
};
|
|
44
|
+
indeterminate: import("tailwind-merge").ClassNameValue | {
|
|
45
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}), undefined, "w-full overflow-hidden bg-gray-200 rounded-full", import("tailwind-variants/dist/config").TVConfig<{
|
|
49
|
+
size: {
|
|
50
|
+
xs: string;
|
|
51
|
+
sm: string;
|
|
52
|
+
md: string;
|
|
53
|
+
lg: string;
|
|
54
|
+
};
|
|
55
|
+
variant: {
|
|
56
|
+
determinate: string;
|
|
57
|
+
indeterminate: string;
|
|
58
|
+
};
|
|
59
|
+
}, {
|
|
60
|
+
size: {
|
|
61
|
+
xs: string;
|
|
62
|
+
sm: string;
|
|
63
|
+
md: string;
|
|
64
|
+
lg: string;
|
|
65
|
+
};
|
|
66
|
+
variant: {
|
|
67
|
+
determinate: string;
|
|
68
|
+
indeterminate: string;
|
|
69
|
+
};
|
|
70
|
+
}>, {
|
|
71
|
+
size: {
|
|
72
|
+
xs: string;
|
|
73
|
+
sm: string;
|
|
74
|
+
md: string;
|
|
75
|
+
lg: string;
|
|
76
|
+
};
|
|
77
|
+
variant: {
|
|
78
|
+
determinate: string;
|
|
79
|
+
indeterminate: string;
|
|
80
|
+
};
|
|
81
|
+
}, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
82
|
+
size: {
|
|
83
|
+
xs: string;
|
|
84
|
+
sm: string;
|
|
85
|
+
md: string;
|
|
86
|
+
lg: string;
|
|
87
|
+
};
|
|
88
|
+
variant: {
|
|
89
|
+
determinate: string;
|
|
90
|
+
indeterminate: string;
|
|
91
|
+
};
|
|
92
|
+
}, undefined, "w-full overflow-hidden bg-gray-200 rounded-full", import("tailwind-variants/dist/config").TVConfig<{
|
|
93
|
+
size: {
|
|
94
|
+
xs: string;
|
|
95
|
+
sm: string;
|
|
96
|
+
md: string;
|
|
97
|
+
lg: string;
|
|
98
|
+
};
|
|
99
|
+
variant: {
|
|
100
|
+
determinate: string;
|
|
101
|
+
indeterminate: string;
|
|
102
|
+
};
|
|
103
|
+
}, {
|
|
104
|
+
size: {
|
|
105
|
+
xs: string;
|
|
106
|
+
sm: string;
|
|
107
|
+
md: string;
|
|
108
|
+
lg: string;
|
|
109
|
+
};
|
|
110
|
+
variant: {
|
|
111
|
+
determinate: string;
|
|
112
|
+
indeterminate: string;
|
|
113
|
+
};
|
|
114
|
+
}>, unknown, unknown, undefined>>;
|
|
115
|
+
declare const fillerStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
116
|
+
variant: {
|
|
117
|
+
determinate: string;
|
|
118
|
+
indeterminate: string;
|
|
119
|
+
};
|
|
120
|
+
colorScheme: {
|
|
121
|
+
primary: string;
|
|
122
|
+
success: string;
|
|
123
|
+
warning: string;
|
|
124
|
+
error: string;
|
|
125
|
+
};
|
|
126
|
+
} | ({
|
|
127
|
+
variant: {
|
|
128
|
+
determinate: string;
|
|
129
|
+
indeterminate: string;
|
|
130
|
+
};
|
|
131
|
+
colorScheme: {
|
|
132
|
+
primary: string;
|
|
133
|
+
success: string;
|
|
134
|
+
warning: string;
|
|
135
|
+
error: string;
|
|
136
|
+
};
|
|
137
|
+
} & {
|
|
138
|
+
variant: {
|
|
139
|
+
determinate: import("tailwind-merge").ClassNameValue | {
|
|
140
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
141
|
+
};
|
|
142
|
+
indeterminate: import("tailwind-merge").ClassNameValue | {
|
|
143
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
colorScheme: {
|
|
147
|
+
primary: import("tailwind-merge").ClassNameValue | {
|
|
148
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
149
|
+
};
|
|
150
|
+
success: import("tailwind-merge").ClassNameValue | {
|
|
151
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
152
|
+
};
|
|
153
|
+
warning: import("tailwind-merge").ClassNameValue | {
|
|
154
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
155
|
+
};
|
|
156
|
+
error: import("tailwind-merge").ClassNameValue | {
|
|
157
|
+
base?: import("tailwind-merge").ClassNameValue;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
}), undefined, "h-full rounded-full transition-all duration-300 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
|
|
161
|
+
variant: {
|
|
162
|
+
determinate: string;
|
|
163
|
+
indeterminate: string;
|
|
164
|
+
};
|
|
165
|
+
colorScheme: {
|
|
166
|
+
primary: string;
|
|
167
|
+
success: string;
|
|
168
|
+
warning: string;
|
|
169
|
+
error: string;
|
|
170
|
+
};
|
|
171
|
+
}, {
|
|
172
|
+
variant: {
|
|
173
|
+
determinate: string;
|
|
174
|
+
indeterminate: string;
|
|
175
|
+
};
|
|
176
|
+
colorScheme: {
|
|
177
|
+
primary: string;
|
|
178
|
+
success: string;
|
|
179
|
+
warning: string;
|
|
180
|
+
error: string;
|
|
181
|
+
};
|
|
182
|
+
}>, {
|
|
183
|
+
variant: {
|
|
184
|
+
determinate: string;
|
|
185
|
+
indeterminate: string;
|
|
186
|
+
};
|
|
187
|
+
colorScheme: {
|
|
188
|
+
primary: string;
|
|
189
|
+
success: string;
|
|
190
|
+
warning: string;
|
|
191
|
+
error: string;
|
|
192
|
+
};
|
|
193
|
+
}, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
|
|
194
|
+
variant: {
|
|
195
|
+
determinate: string;
|
|
196
|
+
indeterminate: string;
|
|
197
|
+
};
|
|
198
|
+
colorScheme: {
|
|
199
|
+
primary: string;
|
|
200
|
+
success: string;
|
|
201
|
+
warning: string;
|
|
202
|
+
error: string;
|
|
203
|
+
};
|
|
204
|
+
}, undefined, "h-full rounded-full transition-all duration-300 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
|
|
205
|
+
variant: {
|
|
206
|
+
determinate: string;
|
|
207
|
+
indeterminate: string;
|
|
208
|
+
};
|
|
209
|
+
colorScheme: {
|
|
210
|
+
primary: string;
|
|
211
|
+
success: string;
|
|
212
|
+
warning: string;
|
|
213
|
+
error: string;
|
|
214
|
+
};
|
|
215
|
+
}, {
|
|
216
|
+
variant: {
|
|
217
|
+
determinate: string;
|
|
218
|
+
indeterminate: string;
|
|
219
|
+
};
|
|
220
|
+
colorScheme: {
|
|
221
|
+
primary: string;
|
|
222
|
+
success: string;
|
|
223
|
+
warning: string;
|
|
224
|
+
error: string;
|
|
225
|
+
};
|
|
226
|
+
}>, unknown, unknown, undefined>>;
|
|
227
|
+
type IProgressProps = React.ComponentProps<'div'> & {
|
|
228
|
+
value?: number;
|
|
229
|
+
min?: number;
|
|
230
|
+
max?: number;
|
|
231
|
+
size?: VariantProps<typeof progressStyle>['size'];
|
|
232
|
+
variant?: VariantProps<typeof progressStyle>['variant'];
|
|
233
|
+
colorScheme?: VariantProps<typeof fillerStyle>['colorScheme'];
|
|
234
|
+
isIndeterminate?: boolean;
|
|
235
|
+
};
|
|
236
|
+
declare const Progress: React.ForwardRefExoticComponent<Omit<IProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
237
|
+
export { Progress };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
4
|
+
const SCOPE = 'PROGRESS';
|
|
5
|
+
const progressStyle = tva({
|
|
6
|
+
base: 'w-full overflow-hidden bg-gray-200 rounded-full',
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
xs: 'h-1',
|
|
10
|
+
sm: 'h-2',
|
|
11
|
+
md: 'h-3',
|
|
12
|
+
lg: 'h-4',
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
determinate: '',
|
|
16
|
+
indeterminate: 'relative',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
size: 'md',
|
|
21
|
+
variant: 'determinate',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
const fillerStyle = tva({
|
|
25
|
+
base: 'h-full rounded-full transition-all duration-300 ease-in-out',
|
|
26
|
+
variants: {
|
|
27
|
+
variant: {
|
|
28
|
+
determinate: '',
|
|
29
|
+
indeterminate: 'absolute animate-progress-indeterminate',
|
|
30
|
+
},
|
|
31
|
+
colorScheme: {
|
|
32
|
+
primary: 'bg-blue-600',
|
|
33
|
+
success: 'bg-green-600',
|
|
34
|
+
warning: 'bg-yellow-600',
|
|
35
|
+
error: 'bg-red-600',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
variant: 'determinate',
|
|
40
|
+
colorScheme: 'primary',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
const Progress = forwardRef(({ className, value = 0, min = 0, max = 100, size, variant: variantProp, colorScheme, isIndeterminate, ...props }, ref) => {
|
|
44
|
+
const variant = isIndeterminate ? 'indeterminate' : variantProp || 'determinate';
|
|
45
|
+
const percentage = Math.min(100, Math.max(0, ((value - min) / (max - min)) * 100));
|
|
46
|
+
return (React.createElement("div", { ref: ref, role: "progressbar", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": isIndeterminate ? undefined : value, className: progressStyle({ size, variant, class: className }), ...props },
|
|
47
|
+
React.createElement("div", { className: fillerStyle({ variant, colorScheme }), style: {
|
|
48
|
+
width: variant === 'determinate' ? `${percentage}%` : '40%',
|
|
49
|
+
} })));
|
|
50
|
+
});
|
|
51
|
+
Progress.displayName = 'Progress';
|
|
52
|
+
export { Progress };
|
|
53
|
+
// Add keyframes for indeterminate animation to your global CSS:
|
|
54
|
+
const styles = `
|
|
55
|
+
@keyframes progress-indeterminate {
|
|
56
|
+
0% {
|
|
57
|
+
left: -40%;
|
|
58
|
+
}
|
|
59
|
+
100% {
|
|
60
|
+
left: 100%;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.animate-progress-indeterminate {
|
|
65
|
+
animation: progress-indeterminate 1.5s infinite ease-in-out;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
if (typeof document !== 'undefined') {
|
|
69
|
+
const styleSheet = document.createElement('style');
|
|
70
|
+
styleSheet.textContent = styles;
|
|
71
|
+
document.head.appendChild(styleSheet);
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/progress/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAKzD,MAAM,KAAK,GAAG,UAAU,CAAC;AAEzB,MAAM,aAAa,GAAG,GAAG,CAAC;IACtB,IAAI,EAAE,iDAAiD;IACvD,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,EAAE,EAAE,KAAK;YACT,EAAE,EAAE,KAAK;YACT,EAAE,EAAE,KAAK;YACT,EAAE,EAAE,KAAK;SACZ;QACD,OAAO,EAAE;YACL,WAAW,EAAE,EAAE;YACf,aAAa,EAAE,UAAU;SAC5B;KACJ;IACD,eAAe,EAAE;QACb,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,aAAa;KACzB;CACJ,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,GAAG,CAAC;IACpB,IAAI,EAAE,6DAA6D;IACnE,QAAQ,EAAE;QACN,OAAO,EAAE;YACL,WAAW,EAAE,EAAE;YACf,aAAa,EAAE,yCAAyC;SAC3D;QACD,WAAW,EAAE;YACT,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,cAAc;YACvB,OAAO,EAAE,eAAe;YACxB,KAAK,EAAE,YAAY;SACtB;KACJ;IACD,eAAe,EAAE;QACb,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,SAAS;KACzB;CACJ,CAAC,CAAC;AAYH,MAAM,QAAQ,GAAG,UAAU,CACvB,CACI,EACI,SAAS,EACT,KAAK,GAAG,CAAC,EACT,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,GAAG,EACT,IAAI,EACJ,OAAO,EAAE,WAAW,EACpB,WAAW,EACX,eAAe,E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