@flipova/foundation 2.3.0 → 2.4.0-beta.1
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/README.md +157 -156
- package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +16 -7
- package/components/ui/accordion/AccordionAnimatedHeight.tsx +3 -15
- package/components/ui/accordion/AccordionAnimatedIcon.tsx +2 -9
- package/components/ui/accordion/AnimatedHeight.tsx +3 -15
- package/components/ui/accordion/AnimatedIcon.tsx +2 -9
- package/components/ui/accordion/MIGRATION_SUMMARY.md +22 -11
- package/components/ui/accordion/USAGE_EXAMPLE.tsx +10 -25
- package/components/ui/accordion/index.tsx +71 -139
- package/components/ui/actionsheet/index.tsx +63 -105
- package/components/ui/alert/index.tsx +20 -50
- package/components/ui/alert-dialog/index.tsx +23 -48
- package/components/ui/avatar/index.tsx +32 -68
- package/components/ui/badge/index.tsx +18 -49
- package/components/ui/bottomsheet/index.tsx +20 -52
- package/components/ui/box/index.tsx +4 -9
- package/components/ui/box/index.web.tsx +3 -9
- package/components/ui/button/index.tsx +73 -109
- package/components/ui/calendar/creator.tsx +69 -30
- package/components/ui/calendar/index.tsx +81 -159
- package/components/ui/calendar/styles.tsx +10 -10
- package/components/ui/card/index.tsx +8 -9
- package/components/ui/card/index.web.tsx +4 -10
- package/components/ui/center/index.tsx +6 -11
- package/components/ui/center/index.web.tsx +3 -9
- package/components/ui/checkbox/index.tsx +46 -107
- package/components/ui/date-time-picker/creator.tsx +14 -1
- package/components/ui/date-time-picker/index.tsx +107 -156
- package/components/ui/date-time-picker/index.web.tsx +11 -33
- package/components/ui/date-time-picker/styles.tsx +5 -5
- package/components/ui/divider/index.tsx +5 -6
- package/components/ui/drawer/index.tsx +108 -128
- package/components/ui/fab/index.tsx +25 -68
- package/components/ui/flat-list/index.tsx +11 -8
- package/components/ui/form-control/index.tsx +49 -90
- package/components/ui/gluestack-ui-provider/index.tsx +4 -18
- package/components/ui/gluestack-ui-provider/index.web.tsx +10 -11
- package/components/ui/gluestack-ui-provider/script.ts +1 -3
- package/components/ui/gluestack-ui-provider/theme-context.ts +2 -2
- package/components/ui/gluestack-ui-provider/useGluestackColors.ts +2 -6
- package/components/ui/grid/index.tsx +128 -165
- package/components/ui/grid/index.web.tsx +17 -19
- package/components/ui/grid/styles.tsx +1 -3
- package/components/ui/heading/index.tsx +146 -169
- package/components/ui/heading/index.web.tsx +7 -28
- package/components/ui/heading/styles.tsx +5 -5
- package/components/ui/hstack/index.tsx +16 -15
- package/components/ui/hstack/index.web.tsx +17 -17
- package/components/ui/hstack/styles.tsx +5 -5
- package/components/ui/icon/index.tsx +95 -486
- package/components/ui/icon/index.web.tsx +79 -439
- package/components/ui/image/index.tsx +13 -18
- package/components/ui/image-viewer/index.tsx +149 -221
- package/components/ui/image-viewer/index.web.tsx +88 -113
- package/components/ui/input/index.tsx +20 -33
- package/components/ui/link/index.tsx +16 -22
- package/components/ui/liquid-glass/index.tsx +19 -25
- package/components/ui/menu/index.tsx +44 -66
- package/components/ui/modal/index.tsx +70 -91
- package/components/ui/popover/index.tsx +102 -121
- package/components/ui/portal/index.tsx +5 -6
- package/components/ui/pressable/index.tsx +5 -9
- package/components/ui/progress/index.tsx +4 -11
- package/components/ui/radio/index.tsx +47 -83
- package/components/ui/select/index.tsx +38 -59
- package/components/ui/select/select-actionsheet.tsx +61 -108
- package/components/ui/skeleton/index.tsx +22 -43
- package/components/ui/skeleton/index.web.tsx +63 -75
- package/components/ui/slider/index.tsx +36 -56
- package/components/ui/spinner/index.tsx +1 -10
- package/components/ui/switch/index.tsx +6 -13
- package/components/ui/table/index.tsx +39 -102
- package/components/ui/table/index.web.tsx +41 -79
- package/components/ui/tabs/TabsAnimatedIndicator.tsx +10 -38
- package/components/ui/tabs/creator.tsx +32 -24
- package/components/ui/tabs/index.tsx +253 -309
- package/components/ui/text/index.tsx +23 -37
- package/components/ui/text/index.web.tsx +33 -35
- package/components/ui/text/styles.tsx +5 -5
- package/components/ui/textarea/index.tsx +24 -38
- package/components/ui/toast/index.tsx +47 -52
- package/components/ui/tooltip/index.tsx +12 -28
- package/components/ui/vstack/index.tsx +17 -17
- package/components/ui/vstack/index.web.tsx +17 -17
- package/components/ui/vstack/styles.tsx +5 -5
- package/design/tools/design.js +15 -12
- package/design/tools/npm.js +4 -3
- package/dist/{chunk-B277QSR5.mjs → chunk-2R66P5X5.mjs} +1816 -3124
- package/dist/chunk-2R66P5X5.mjs.map +1 -0
- package/dist/{chunk-GD37RFBR.js → chunk-LCTFQJZM.js} +1816 -3124
- package/dist/chunk-LCTFQJZM.js.map +1 -0
- package/dist/index.js +294 -294
- package/dist/index.mjs +1 -1
- package/dist/ui/index.js +294 -294
- package/dist/ui/index.mjs +1 -1
- package/package.json +12 -7
- package/dist/chunk-B277QSR5.mjs.map +0 -1
- package/dist/chunk-GD37RFBR.js.map +0 -1
|
@@ -9,36 +9,34 @@ type ISkeletonProps = React.ComponentPropsWithoutRef<'div'> &
|
|
|
9
9
|
isLoaded?: boolean;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const Skeleton = React.forwardRef<HTMLDivElement, ISkeletonProps>(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return children;
|
|
39
|
-
}
|
|
12
|
+
const Skeleton = React.forwardRef<HTMLDivElement, ISkeletonProps>(function Skeleton(
|
|
13
|
+
{
|
|
14
|
+
className,
|
|
15
|
+
variant = 'rounded',
|
|
16
|
+
children,
|
|
17
|
+
speed = 4,
|
|
18
|
+
startColor = 'bg-muted-foreground/20',
|
|
19
|
+
isLoaded = false,
|
|
20
|
+
...props
|
|
21
|
+
},
|
|
22
|
+
ref,
|
|
23
|
+
) {
|
|
24
|
+
if (!isLoaded) {
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={`animate-pulse ${startColor} ${skeletonStyle({
|
|
29
|
+
variant,
|
|
30
|
+
speed,
|
|
31
|
+
class: className,
|
|
32
|
+
})}`}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
37
|
+
return children;
|
|
40
38
|
}
|
|
41
|
-
);
|
|
39
|
+
});
|
|
42
40
|
|
|
43
41
|
type ISkeletonTextProps = React.ComponentPropsWithoutRef<'div'> &
|
|
44
42
|
VariantProps<typeof skeletonTextStyle> & {
|
|
@@ -47,55 +45,45 @@ type ISkeletonTextProps = React.ComponentPropsWithoutRef<'div'> &
|
|
|
47
45
|
startColor?: string;
|
|
48
46
|
};
|
|
49
47
|
|
|
50
|
-
const SkeletonText = React.forwardRef<HTMLDivElement, ISkeletonTextProps>(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
key={index}
|
|
75
|
-
className={`animate-pulse ${startColor} ${skeletonTextStyle({
|
|
76
|
-
class: className,
|
|
77
|
-
})}`}
|
|
78
|
-
{...props}
|
|
79
|
-
/>
|
|
80
|
-
))}
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
} else {
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={`animate-pulse ${startColor} ${skeletonTextStyle({
|
|
88
|
-
class: className,
|
|
89
|
-
})}`}
|
|
90
|
-
{...props}
|
|
91
|
-
/>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
48
|
+
const SkeletonText = React.forwardRef<HTMLDivElement, ISkeletonTextProps>(function SkeletonText(
|
|
49
|
+
{ className, _lines, isLoaded = false, startColor = 'bg-muted-foreground/20', gap = 2, children, ...props },
|
|
50
|
+
ref,
|
|
51
|
+
) {
|
|
52
|
+
if (!isLoaded) {
|
|
53
|
+
if (_lines) {
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
ref={ref}
|
|
57
|
+
className={`flex flex-col ${skeletonTextStyle({
|
|
58
|
+
gap,
|
|
59
|
+
})}`}
|
|
60
|
+
>
|
|
61
|
+
{Array.from({ length: _lines }).map((_, index) => (
|
|
62
|
+
<div
|
|
63
|
+
key={index}
|
|
64
|
+
className={`animate-pulse ${startColor} ${skeletonTextStyle({
|
|
65
|
+
class: className,
|
|
66
|
+
})}`}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
69
|
+
))}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
94
72
|
} else {
|
|
95
|
-
return
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
ref={ref}
|
|
76
|
+
className={`animate-pulse ${startColor} ${skeletonTextStyle({
|
|
77
|
+
class: className,
|
|
78
|
+
})}`}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
96
82
|
}
|
|
83
|
+
} else {
|
|
84
|
+
return children;
|
|
97
85
|
}
|
|
98
|
-
);
|
|
86
|
+
});
|
|
99
87
|
|
|
100
88
|
Skeleton.displayName = 'Skeleton';
|
|
101
89
|
SkeletonText.displayName = 'SkeletonText';
|
|
@@ -4,10 +4,7 @@ import { Pressable } from 'react-native';
|
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
7
|
-
import {
|
|
8
|
-
withStyleContext,
|
|
9
|
-
useStyleContext,
|
|
10
|
-
} from '@gluestack-ui/utils/nativewind-utils';
|
|
7
|
+
import { withStyleContext, useStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
11
8
|
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
12
9
|
import { cssInterop } from 'nativewind';
|
|
13
10
|
|
|
@@ -77,20 +74,11 @@ const sliderFilledTrackStyle = tva({
|
|
|
77
74
|
},
|
|
78
75
|
});
|
|
79
76
|
|
|
80
|
-
type ISliderProps = React.ComponentProps<typeof UISlider> &
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
ISliderProps
|
|
86
|
-
>(function Slider(
|
|
87
|
-
{
|
|
88
|
-
className,
|
|
89
|
-
orientation = 'horizontal',
|
|
90
|
-
isReversed = false,
|
|
91
|
-
...props
|
|
92
|
-
},
|
|
93
|
-
ref
|
|
77
|
+
type ISliderProps = React.ComponentProps<typeof UISlider> & VariantProps<typeof sliderStyle>;
|
|
78
|
+
|
|
79
|
+
const Slider = React.forwardRef<React.ComponentRef<typeof UISlider>, ISliderProps>(function Slider(
|
|
80
|
+
{ className, orientation = 'horizontal', isReversed = false, ...props },
|
|
81
|
+
ref,
|
|
94
82
|
) {
|
|
95
83
|
return (
|
|
96
84
|
<UISlider
|
|
@@ -108,13 +96,12 @@ const Slider = React.forwardRef<
|
|
|
108
96
|
);
|
|
109
97
|
});
|
|
110
98
|
|
|
111
|
-
type ISliderThumbProps = React.ComponentProps<typeof UISlider.Thumb> &
|
|
112
|
-
VariantProps<typeof sliderThumbStyle>;
|
|
99
|
+
type ISliderThumbProps = React.ComponentProps<typeof UISlider.Thumb> & VariantProps<typeof sliderThumbStyle>;
|
|
113
100
|
|
|
114
|
-
const SliderThumb = React.forwardRef<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
101
|
+
const SliderThumb = React.forwardRef<React.ComponentRef<typeof UISlider.Thumb>, ISliderThumbProps>(function SliderThumb(
|
|
102
|
+
{ className, ...props },
|
|
103
|
+
ref,
|
|
104
|
+
) {
|
|
118
105
|
return (
|
|
119
106
|
<UISlider.Thumb
|
|
120
107
|
ref={ref}
|
|
@@ -126,17 +113,13 @@ const SliderThumb = React.forwardRef<
|
|
|
126
113
|
);
|
|
127
114
|
});
|
|
128
115
|
|
|
129
|
-
type ISliderTrackProps = React.ComponentProps<typeof UISlider.Track> &
|
|
130
|
-
VariantProps<typeof sliderTrackStyle>;
|
|
116
|
+
type ISliderTrackProps = React.ComponentProps<typeof UISlider.Track> & VariantProps<typeof sliderTrackStyle>;
|
|
131
117
|
|
|
132
|
-
const SliderTrack = React.forwardRef<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const {
|
|
137
|
-
orientation: parentOrientation,
|
|
138
|
-
isReversed,
|
|
139
|
-
} = useStyleContext(SCOPE);
|
|
118
|
+
const SliderTrack = React.forwardRef<React.ComponentRef<typeof UISlider.Track>, ISliderTrackProps>(function SliderTrack(
|
|
119
|
+
{ className, ...props },
|
|
120
|
+
ref,
|
|
121
|
+
) {
|
|
122
|
+
const { orientation: parentOrientation, isReversed } = useStyleContext(SCOPE);
|
|
140
123
|
|
|
141
124
|
return (
|
|
142
125
|
<UISlider.Track
|
|
@@ -153,29 +136,26 @@ const SliderTrack = React.forwardRef<
|
|
|
153
136
|
);
|
|
154
137
|
});
|
|
155
138
|
|
|
156
|
-
type ISliderFilledTrackProps = React.ComponentProps<
|
|
157
|
-
typeof UISlider.FilledTrack
|
|
158
|
-
> &
|
|
139
|
+
type ISliderFilledTrackProps = React.ComponentProps<typeof UISlider.FilledTrack> &
|
|
159
140
|
VariantProps<typeof sliderFilledTrackStyle>;
|
|
160
141
|
|
|
161
|
-
const SliderFilledTrack = React.forwardRef<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
});
|
|
142
|
+
const SliderFilledTrack = React.forwardRef<React.ComponentRef<typeof UISlider.FilledTrack>, ISliderFilledTrackProps>(
|
|
143
|
+
function SliderFilledTrack({ className, ...props }, ref) {
|
|
144
|
+
const { orientation: parentOrientation } = useStyleContext(SCOPE);
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<UISlider.FilledTrack
|
|
148
|
+
ref={ref}
|
|
149
|
+
{...props}
|
|
150
|
+
className={sliderFilledTrackStyle({
|
|
151
|
+
parentVariants: {
|
|
152
|
+
orientation: parentOrientation,
|
|
153
|
+
},
|
|
154
|
+
class: className,
|
|
155
|
+
})}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
},
|
|
159
|
+
);
|
|
180
160
|
|
|
181
161
|
export { Slider, SliderThumb, SliderTrack, SliderFilledTrack };
|
|
@@ -13,16 +13,7 @@ const spinnerStyle = tva({});
|
|
|
13
13
|
const Spinner = React.forwardRef<
|
|
14
14
|
React.ComponentRef<typeof ActivityIndicator>,
|
|
15
15
|
React.ComponentProps<typeof ActivityIndicator>
|
|
16
|
-
>(function Spinner(
|
|
17
|
-
{
|
|
18
|
-
className,
|
|
19
|
-
color,
|
|
20
|
-
focusable = false,
|
|
21
|
-
'aria-label': ariaLabel = 'loading',
|
|
22
|
-
...props
|
|
23
|
-
},
|
|
24
|
-
ref
|
|
25
|
-
) {
|
|
16
|
+
>(function Spinner({ className, color, focusable = false, 'aria-label': ariaLabel = 'loading', ...props }, ref) {
|
|
26
17
|
return (
|
|
27
18
|
<ActivityIndicator
|
|
28
19
|
ref={ref}
|
|
@@ -22,19 +22,12 @@ const switchStyle = tva({
|
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
type ISwitchProps = React.ComponentProps<typeof UISwitch> &
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<UISwitch
|
|
33
|
-
ref={ref}
|
|
34
|
-
{...props}
|
|
35
|
-
className={switchStyle({ size, class: className })}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
25
|
+
type ISwitchProps = React.ComponentProps<typeof UISwitch> & VariantProps<typeof switchStyle>;
|
|
26
|
+
const Switch = React.forwardRef<React.ComponentRef<typeof UISwitch>, ISwitchProps>(function Switch(
|
|
27
|
+
{ className, size = 'md', ...props },
|
|
28
|
+
ref,
|
|
29
|
+
) {
|
|
30
|
+
return <UISwitch ref={ref} {...props} className={switchStyle({ size, class: className })} />;
|
|
38
31
|
});
|
|
39
32
|
|
|
40
33
|
Switch.displayName = 'Switch';
|
|
@@ -44,23 +44,14 @@ type ITableDataProps = React.ComponentProps<typeof View | typeof Text> & {
|
|
|
44
44
|
};
|
|
45
45
|
type ITableCaptionProps = React.ComponentProps<typeof ExpoTCaption>;
|
|
46
46
|
|
|
47
|
-
const Table = React.forwardRef<
|
|
48
|
-
|
|
49
|
-
ITableProps
|
|
50
|
-
>(({ className, ...props }, ref) => {
|
|
51
|
-
return (
|
|
52
|
-
<ExpoTable
|
|
53
|
-
ref={ref}
|
|
54
|
-
className={tableStyle({ class: className })}
|
|
55
|
-
{...props}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
47
|
+
const Table = React.forwardRef<React.ComponentRef<typeof ExpoTable>, ITableProps>(({ className, ...props }, ref) => {
|
|
48
|
+
return <ExpoTable ref={ref} className={tableStyle({ class: className })} {...props} />;
|
|
58
49
|
});
|
|
59
50
|
|
|
60
|
-
const TableHeader = React.forwardRef<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
const TableHeader = React.forwardRef<React.ComponentRef<typeof ExpoTHead>, ITableHeaderProps>(function TableHeader(
|
|
52
|
+
{ className, ...props },
|
|
53
|
+
ref,
|
|
54
|
+
) {
|
|
64
55
|
const contextValue = useMemo(() => {
|
|
65
56
|
return {
|
|
66
57
|
isHeaderRow: true,
|
|
@@ -68,32 +59,22 @@ const TableHeader = React.forwardRef<
|
|
|
68
59
|
}, []);
|
|
69
60
|
return (
|
|
70
61
|
<TableHeaderContext.Provider value={contextValue}>
|
|
71
|
-
<ExpoTHead
|
|
72
|
-
ref={ref}
|
|
73
|
-
className={tableHeaderStyle({ class: className })}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
62
|
+
<ExpoTHead ref={ref} className={tableHeaderStyle({ class: className })} {...props} />
|
|
76
63
|
</TableHeaderContext.Provider>
|
|
77
64
|
);
|
|
78
65
|
});
|
|
79
66
|
|
|
80
|
-
const TableBody = React.forwardRef<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<ExpoTBody
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={tableBodyStyle({ class: className })}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
67
|
+
const TableBody = React.forwardRef<React.ComponentRef<typeof ExpoTBody>, ITableBodyProps>(function TableBody(
|
|
68
|
+
{ className, ...props },
|
|
69
|
+
ref,
|
|
70
|
+
) {
|
|
71
|
+
return <ExpoTBody ref={ref} className={tableBodyStyle({ class: className })} {...props} />;
|
|
91
72
|
});
|
|
92
73
|
|
|
93
|
-
const TableFooter = React.forwardRef<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
74
|
+
const TableFooter = React.forwardRef<React.ComponentRef<typeof ExpoTFoot>, ITableFooterProps>(function TableFooter(
|
|
75
|
+
{ className, ...props },
|
|
76
|
+
ref,
|
|
77
|
+
) {
|
|
97
78
|
const contextValue = useMemo(() => {
|
|
98
79
|
return {
|
|
99
80
|
isFooterRow: true,
|
|
@@ -101,42 +82,26 @@ const TableFooter = React.forwardRef<
|
|
|
101
82
|
}, []);
|
|
102
83
|
return (
|
|
103
84
|
<TableFooterContext.Provider value={contextValue}>
|
|
104
|
-
<ExpoTFoot
|
|
105
|
-
ref={ref}
|
|
106
|
-
className={tableFooterStyle({ class: className })}
|
|
107
|
-
{...props}
|
|
108
|
-
/>
|
|
85
|
+
<ExpoTFoot ref={ref} className={tableFooterStyle({ class: className })} {...props} />
|
|
109
86
|
</TableFooterContext.Provider>
|
|
110
87
|
);
|
|
111
88
|
});
|
|
112
89
|
|
|
113
|
-
const TableHead = React.forwardRef<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
90
|
+
const TableHead = React.forwardRef<React.ComponentRef<typeof View | typeof Text>, ITableHeadProps>(function TableHead(
|
|
91
|
+
{ useRNView = false, className, ...props },
|
|
92
|
+
ref,
|
|
93
|
+
) {
|
|
117
94
|
if (useRNView) {
|
|
118
|
-
return (
|
|
119
|
-
<View
|
|
120
|
-
ref={ref}
|
|
121
|
-
className={tableHeadStyle({ class: className })}
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
95
|
+
return <View ref={ref} className={tableHeadStyle({ class: className })} {...props} />;
|
|
125
96
|
} else {
|
|
126
|
-
return (
|
|
127
|
-
<Text
|
|
128
|
-
ref={ref}
|
|
129
|
-
className={tableHeadStyle({ class: className })}
|
|
130
|
-
{...props}
|
|
131
|
-
/>
|
|
132
|
-
);
|
|
97
|
+
return <Text ref={ref} className={tableHeadStyle({ class: className })} {...props} />;
|
|
133
98
|
}
|
|
134
99
|
});
|
|
135
100
|
|
|
136
|
-
const TableRow = React.forwardRef<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
101
|
+
const TableRow = React.forwardRef<React.ComponentRef<typeof ExpoTR>, ITableRowProps>(function TableRow(
|
|
102
|
+
{ className, ...props },
|
|
103
|
+
ref,
|
|
104
|
+
) {
|
|
140
105
|
const { isHeaderRow } = useContext(TableHeaderContext);
|
|
141
106
|
const { isFooterRow } = useContext(TableFooterContext);
|
|
142
107
|
|
|
@@ -153,41 +118,22 @@ const TableRow = React.forwardRef<
|
|
|
153
118
|
);
|
|
154
119
|
});
|
|
155
120
|
|
|
156
|
-
const TableData = React.forwardRef<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
121
|
+
const TableData = React.forwardRef<React.ComponentRef<typeof View | typeof Text>, ITableDataProps>(function TableData(
|
|
122
|
+
{ useRNView = false, className, ...props },
|
|
123
|
+
ref,
|
|
124
|
+
) {
|
|
160
125
|
if (useRNView) {
|
|
161
|
-
return (
|
|
162
|
-
<View
|
|
163
|
-
ref={ref}
|
|
164
|
-
className={tableDataStyle({ class: className })}
|
|
165
|
-
{...props}
|
|
166
|
-
/>
|
|
167
|
-
);
|
|
126
|
+
return <View ref={ref} className={tableDataStyle({ class: className })} {...props} />;
|
|
168
127
|
} else {
|
|
169
|
-
return (
|
|
170
|
-
<Text
|
|
171
|
-
ref={ref}
|
|
172
|
-
className={tableDataStyle({ class: className })}
|
|
173
|
-
{...props}
|
|
174
|
-
/>
|
|
175
|
-
);
|
|
128
|
+
return <Text ref={ref} className={tableDataStyle({ class: className })} {...props} />;
|
|
176
129
|
}
|
|
177
130
|
});
|
|
178
131
|
|
|
179
|
-
const TableCaption = React.forwardRef<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<ExpoTCaption
|
|
185
|
-
ref={ref}
|
|
186
|
-
className={tableCaptionStyle({ class: className })}
|
|
187
|
-
{...props}
|
|
188
|
-
/>
|
|
189
|
-
);
|
|
190
|
-
});
|
|
132
|
+
const TableCaption = React.forwardRef<React.ComponentRef<typeof ExpoTCaption>, ITableCaptionProps>(
|
|
133
|
+
({ className, ...props }, ref) => {
|
|
134
|
+
return <ExpoTCaption ref={ref} className={tableCaptionStyle({ class: className })} {...props} />;
|
|
135
|
+
},
|
|
136
|
+
);
|
|
191
137
|
|
|
192
138
|
Table.displayName = 'Table';
|
|
193
139
|
TableHeader.displayName = 'TableHeader';
|
|
@@ -198,13 +144,4 @@ TableRow.displayName = 'TableRow';
|
|
|
198
144
|
TableData.displayName = 'TableData';
|
|
199
145
|
TableCaption.displayName = 'TableCaption';
|
|
200
146
|
|
|
201
|
-
export {
|
|
202
|
-
Table,
|
|
203
|
-
TableHeader,
|
|
204
|
-
TableBody,
|
|
205
|
-
TableFooter,
|
|
206
|
-
TableHead,
|
|
207
|
-
TableRow,
|
|
208
|
-
TableData,
|
|
209
|
-
TableCaption,
|
|
210
|
-
};
|
|
147
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableData, TableCaption };
|