fluent-styles 1.62.3 → 1.62.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/badge/index.js +13 -8
- package/lib/commonjs/badge/index.js.map +1 -1
- package/lib/commonjs/button/index.js +4 -3
- package/lib/commonjs/button/index.js.map +1 -1
- package/lib/commonjs/card/index.js +23 -15
- package/lib/commonjs/card/index.js.map +1 -1
- package/lib/commonjs/checkBox/index.js +5 -3
- package/lib/commonjs/checkBox/index.js.map +1 -1
- package/lib/commonjs/dropdown/index.js +10 -6
- package/lib/commonjs/dropdown/index.js.map +1 -1
- package/lib/commonjs/header/index.js +59 -55
- package/lib/commonjs/header/index.js.map +1 -1
- package/lib/commonjs/image/index.js +5 -3
- package/lib/commonjs/image/index.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/input/index.js +5 -3
- package/lib/commonjs/input/index.js.map +1 -1
- package/lib/commonjs/page/index.js +20 -4
- package/lib/commonjs/page/index.js.map +1 -1
- package/lib/commonjs/safeAreaView/index.js +4 -0
- package/lib/commonjs/safeAreaView/index.js.map +1 -1
- package/lib/commonjs/seperator/index.js +5 -3
- package/lib/commonjs/seperator/index.js.map +1 -1
- package/lib/commonjs/shape/cycle.js +5 -3
- package/lib/commonjs/shape/cycle.js.map +1 -1
- package/lib/commonjs/shape/index.js +6 -3
- package/lib/commonjs/shape/index.js.map +1 -1
- package/lib/commonjs/slider/index.js +72 -22
- package/lib/commonjs/slider/index.js.map +1 -1
- package/lib/commonjs/spinner/index.js +17 -11
- package/lib/commonjs/spinner/index.js.map +1 -1
- package/lib/commonjs/utiles/styled.js +14 -32
- package/lib/commonjs/utiles/styled.js.map +1 -1
- package/lib/module/badge/index.js +10 -8
- package/lib/module/badge/index.js.map +1 -1
- package/lib/module/button/index.js +4 -3
- package/lib/module/button/index.js.map +1 -1
- package/lib/module/card/index.js +20 -15
- package/lib/module/card/index.js.map +1 -1
- package/lib/module/checkBox/index.js +5 -4
- package/lib/module/checkBox/index.js.map +1 -1
- package/lib/module/dropdown/index.js +9 -7
- package/lib/module/dropdown/index.js.map +1 -1
- package/lib/module/header/index.js +52 -48
- package/lib/module/header/index.js.map +1 -1
- package/lib/module/image/index.js +4 -3
- package/lib/module/image/index.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/input/index.js +5 -4
- package/lib/module/input/index.js.map +1 -1
- package/lib/module/page/index.js +21 -4
- package/lib/module/page/index.js.map +1 -1
- package/lib/module/safeAreaView/index.js +4 -0
- package/lib/module/safeAreaView/index.js.map +1 -1
- package/lib/module/seperator/index.js +4 -3
- package/lib/module/seperator/index.js.map +1 -1
- package/lib/module/shape/cycle.js +4 -3
- package/lib/module/shape/cycle.js.map +1 -1
- package/lib/module/shape/index.js +6 -3
- package/lib/module/shape/index.js.map +1 -1
- package/lib/module/slider/index.js +72 -22
- package/lib/module/slider/index.js.map +1 -1
- package/lib/module/spinner/index.js +13 -10
- package/lib/module/spinner/index.js.map +1 -1
- package/lib/module/utiles/styled.js +13 -31
- package/lib/module/utiles/styled.js.map +1 -1
- package/lib/typescript/badge/index.d.ts +13 -6
- package/lib/typescript/badge/index.d.ts.map +1 -1
- package/lib/typescript/button/index.d.ts +12 -8
- package/lib/typescript/button/index.d.ts.map +1 -1
- package/lib/typescript/card/index.d.ts +37 -10
- package/lib/typescript/card/index.d.ts.map +1 -1
- package/lib/typescript/checkBox/index.d.ts +12 -1
- package/lib/typescript/checkBox/index.d.ts.map +1 -1
- package/lib/typescript/dialog/index.d.ts +6 -3
- package/lib/typescript/dialog/index.d.ts.map +1 -1
- package/lib/typescript/divider/index.d.ts +6 -3
- package/lib/typescript/divider/index.d.ts.map +1 -1
- package/lib/typescript/dropdown/index.d.ts +12 -2
- package/lib/typescript/dropdown/index.d.ts.map +1 -1
- package/lib/typescript/header/index.d.ts +6 -8
- package/lib/typescript/header/index.d.ts.map +1 -1
- package/lib/typescript/image/index.d.ts +9 -4
- package/lib/typescript/image/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/input/index.d.ts +12 -1
- package/lib/typescript/input/index.d.ts.map +1 -1
- package/lib/typescript/page/index.d.ts +17 -7
- package/lib/typescript/page/index.d.ts.map +1 -1
- package/lib/typescript/pressable/index.d.ts +6 -3
- package/lib/typescript/pressable/index.d.ts.map +1 -1
- package/lib/typescript/safeAreaProvider/index.d.ts +6 -3
- package/lib/typescript/safeAreaProvider/index.d.ts.map +1 -1
- package/lib/typescript/safeAreaView/index.d.ts +6 -3
- package/lib/typescript/safeAreaView/index.d.ts.map +1 -1
- package/lib/typescript/scrollView/index.d.ts +6 -3
- package/lib/typescript/scrollView/index.d.ts.map +1 -1
- package/lib/typescript/seperator/index.d.ts +7 -2
- package/lib/typescript/seperator/index.d.ts.map +1 -1
- package/lib/typescript/shape/cycle.d.ts +12 -4
- package/lib/typescript/shape/cycle.d.ts.map +1 -1
- package/lib/typescript/shape/index.d.ts +7 -4
- package/lib/typescript/shape/index.d.ts.map +1 -1
- package/lib/typescript/slider/index.d.ts +27 -5
- package/lib/typescript/slider/index.d.ts.map +1 -1
- package/lib/typescript/spacer/index.d.ts +6 -3
- package/lib/typescript/spacer/index.d.ts.map +1 -1
- package/lib/typescript/spinner/index.d.ts +18 -3
- package/lib/typescript/spinner/index.d.ts.map +1 -1
- package/lib/typescript/stack/index.d.ts +18 -9
- package/lib/typescript/stack/index.d.ts.map +1 -1
- package/lib/typescript/text/index.d.ts +6 -3
- package/lib/typescript/text/index.d.ts.map +1 -1
- package/lib/typescript/utiles/styled.d.ts +7 -4
- package/lib/typescript/utiles/styled.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/badge/index.tsx +7 -17
- package/src/button/index.tsx +7 -12
- package/src/card/index.tsx +21 -23
- package/src/checkBox/index.tsx +16 -21
- package/src/dropdown/index.tsx +59 -67
- package/src/header/index.tsx +119 -112
- package/src/image/index.tsx +2 -2
- package/src/index.ts +1 -1
- package/src/input/index.tsx +56 -59
- package/src/page/index.tsx +21 -3
- package/src/safeAreaView/index.tsx +6 -2
- package/src/seperator/index.tsx +4 -10
- package/src/shape/cycle.tsx +10 -12
- package/src/shape/index.tsx +7 -3
- package/src/slider/index.tsx +82 -46
- package/src/spinner/index.tsx +49 -55
- package/src/utiles/styled.tsx +14 -27
package/src/header/index.tsx
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
import { styled } from "../utiles/styled";
|
|
9
9
|
import { getStatusBarHeight } from "../utiles/statusBar";
|
|
10
10
|
import { Stack } from "../stack";
|
|
11
|
-
import StatusBar, { StatusBarProps } from "./statusBar";
|
|
12
11
|
import { StyleShape, ShapeProps } from "../shape";
|
|
13
12
|
import { StyledText, StyledTextProps } from "../text";
|
|
14
13
|
import { ChevronLeft } from "../icons";
|
|
@@ -35,8 +34,6 @@ export interface HeaderProps extends ViewProps, ViewStyle {
|
|
|
35
34
|
backArrowProps?: BackArrowProps;
|
|
36
35
|
shapeProps?: ShapeProps;
|
|
37
36
|
onBackPress?: () => void;
|
|
38
|
-
showStatusBar?: boolean;
|
|
39
|
-
statusBarProps?: StatusBarProps;
|
|
40
37
|
skipStatusBarOnAndroid?: boolean;
|
|
41
38
|
skipStatusBarOnIOS?: boolean;
|
|
42
39
|
children?: React.ReactNode;
|
|
@@ -44,7 +41,7 @@ export interface HeaderProps extends ViewProps, ViewStyle {
|
|
|
44
41
|
|
|
45
42
|
// ─── Container ────────────────────────────────────────────────────────────────
|
|
46
43
|
|
|
47
|
-
const StyledHeaderContainer = styled<
|
|
44
|
+
const StyledHeaderContainer = styled<HeaderProps>(View, {
|
|
48
45
|
base: {
|
|
49
46
|
position: "relative",
|
|
50
47
|
flexDirection: "row",
|
|
@@ -72,128 +69,138 @@ Full.displayName = "StyledHeader.Full";
|
|
|
72
69
|
|
|
73
70
|
// ─── StyledHeader ─────────────────────────────────────────────────────────────
|
|
74
71
|
|
|
75
|
-
const HeaderComponent =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{titleAlignment === "left" && title && (
|
|
72
|
+
const HeaderComponent = ({
|
|
73
|
+
showBackArrow,
|
|
74
|
+
backArrowProps,
|
|
75
|
+
onBackPress,
|
|
76
|
+
title,
|
|
77
|
+
titleAlignment = "left",
|
|
78
|
+
titleProps,
|
|
79
|
+
leftIcon,
|
|
80
|
+
rightIcon,
|
|
81
|
+
shapeProps,
|
|
82
|
+
skipStatusBarOnAndroid = true,
|
|
83
|
+
skipStatusBarOnIOS = true,
|
|
84
|
+
children,
|
|
85
|
+
// Pull ref directly from props
|
|
86
|
+
ref,
|
|
87
|
+
...rest
|
|
88
|
+
}: HeaderProps & { ref?: React.Ref<View> }) => {
|
|
89
|
+
|
|
90
|
+
// ── Left slot ─────────────────────────────────────────────────────────
|
|
91
|
+
const renderBackIcon = () => (
|
|
92
|
+
<>
|
|
93
|
+
{showBackArrow && (
|
|
94
|
+
<StyledPressable onPress={onBackPress ?? backArrowProps?.onPress} flexDirection="row" alignItems="center" justifyContent="flex-start">
|
|
95
|
+
<StyleShape
|
|
96
|
+
cycle
|
|
97
|
+
|
|
98
|
+
{...shapeProps}
|
|
99
|
+
>
|
|
100
|
+
<ChevronLeft
|
|
101
|
+
size={backArrowProps?.size ?? 24}
|
|
102
|
+
color={backArrowProps?.color ?? theme.colors.gray[700]}
|
|
103
|
+
strokeWidth={backArrowProps?.strokeWidth}
|
|
104
|
+
/>
|
|
105
|
+
</StyleShape>
|
|
106
|
+
</StyledPressable>
|
|
107
|
+
|
|
108
|
+
)}
|
|
109
|
+
</>
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
// ── Left slot ─────────────────────────────────────────────────────────
|
|
113
|
+
const renderLeft = () => (
|
|
114
|
+
<>
|
|
115
|
+
{titleAlignment === "left" && title && (
|
|
116
|
+
<Stack flex={1} horizontal alignItems="center" justifyContent="flex-start">
|
|
117
|
+
{leftIcon}
|
|
122
118
|
<StyledText
|
|
123
119
|
marginLeft={showBackArrow || leftIcon ? 8 : 0}
|
|
124
120
|
{...titleProps}
|
|
125
121
|
>
|
|
126
122
|
{title}
|
|
127
123
|
</StyledText>
|
|
128
|
-
)}
|
|
129
|
-
</Stack>
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
// ── Center slot ───────────────────────────────────────────────────────
|
|
133
|
-
const renderCenter = () => {
|
|
134
|
-
if (titleAlignment !== "center" || !title) return null;
|
|
135
|
-
return (
|
|
136
|
-
<Stack flex={2} alignItems="center" justifyContent="center">
|
|
137
|
-
<StyledText numberOfLines={1} {...titleProps}>
|
|
138
|
-
{title}
|
|
139
|
-
</StyledText>
|
|
140
124
|
</Stack>
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// ── Right slot ────────────────────────────────────────────────────────
|
|
145
|
-
const renderRight = () => (
|
|
146
|
-
<Stack flex={1} horizontal alignItems="center" justifyContent="flex-end">
|
|
147
|
-
{titleAlignment === "right" && title && (
|
|
148
|
-
<StyledText marginRight={rightIcon ? 8 : 0} {...titleProps}>
|
|
149
|
-
{title}
|
|
150
|
-
</StyledText>
|
|
151
|
-
)}
|
|
152
|
-
{rightIcon}
|
|
153
|
-
</Stack>
|
|
154
|
-
);
|
|
125
|
+
)}
|
|
126
|
+
</>
|
|
155
127
|
|
|
156
|
-
|
|
157
|
-
// them directly inside the container — skip the built-in layout slots.
|
|
158
|
-
const renderContent = () => {
|
|
159
|
-
if (children) return <>{children}</>;
|
|
160
|
-
return (
|
|
161
|
-
<>
|
|
162
|
-
{renderLeft()}
|
|
163
|
-
{renderCenter()}
|
|
164
|
-
{renderRight()}
|
|
165
|
-
</>
|
|
166
|
-
);
|
|
167
|
-
};
|
|
128
|
+
);
|
|
168
129
|
|
|
130
|
+
// ── Center slot ───────────────────────────────────────────────────────
|
|
131
|
+
const renderCenter = () => {
|
|
169
132
|
return (
|
|
170
|
-
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
</Stack>
|
|
133
|
+
<>
|
|
134
|
+
{
|
|
135
|
+
titleAlignment === "center" && title && (
|
|
136
|
+
<Stack flex={1} horizontal alignItems="center" justifyContent="center">
|
|
137
|
+
<StyledText numberOfLines={1} {...titleProps}>
|
|
138
|
+
{title}
|
|
139
|
+
</StyledText>
|
|
140
|
+
</Stack>
|
|
141
|
+
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
</>
|
|
183
145
|
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// ── Right slot ────────────────────────────────────────────────────────
|
|
149
|
+
const renderRight = () => (
|
|
150
|
+
<>
|
|
151
|
+
{titleAlignment === "right" && title && (
|
|
152
|
+
<StyledText marginRight={rightIcon ? 8 : 0} {...titleProps}>
|
|
153
|
+
{title}
|
|
154
|
+
</StyledText>
|
|
155
|
+
)}
|
|
156
|
+
{
|
|
157
|
+
rightIcon && (
|
|
158
|
+
<> {rightIcon}</>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
</>
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
// ── When children is present (e.g. StyledHeader.Full usage), render
|
|
166
|
+
// them directly inside the container — skip the built-in layout slots.
|
|
167
|
+
const renderContent = () => {
|
|
168
|
+
if (children) return <>{children}</>;
|
|
169
|
+
return (
|
|
170
|
+
<>
|
|
171
|
+
{renderBackIcon()}
|
|
172
|
+
{renderLeft()}
|
|
173
|
+
{renderCenter()}
|
|
174
|
+
{renderRight()}
|
|
175
|
+
</>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<StyledHeaderContainer
|
|
181
|
+
ref={ref}
|
|
182
|
+
marginTop={getStatusBarHeight({
|
|
183
|
+
skipAndroid: skipStatusBarOnAndroid,
|
|
184
|
+
skipIos: skipStatusBarOnIOS,
|
|
185
|
+
})}
|
|
186
|
+
{...rest}
|
|
187
|
+
>
|
|
188
|
+
{renderContent()}
|
|
189
|
+
</StyledHeaderContainer>
|
|
190
|
+
);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
// ─── Composition (React 19 Style) ─────────────────────────────────────────────
|
|
195
|
+
|
|
196
|
+
// Define the static property on the function type
|
|
197
|
+
interface StyledHeaderType {
|
|
198
|
+
(props: HeaderProps & { ref?: React.Ref<View> }): React.ReactElement | null;
|
|
193
199
|
Full: typeof Full;
|
|
200
|
+
displayName?: string;
|
|
194
201
|
}
|
|
195
202
|
|
|
196
|
-
const StyledHeader = HeaderComponent as
|
|
203
|
+
const StyledHeader = HeaderComponent as StyledHeaderType;
|
|
197
204
|
|
|
198
205
|
StyledHeader.Full = Full;
|
|
199
206
|
StyledHeader.displayName = "StyledHeader";
|
package/src/image/index.tsx
CHANGED
|
@@ -33,13 +33,13 @@ interface _StyledImageProps extends Omit<StyledImageProps, 'height' | 'width'> {
|
|
|
33
33
|
width?: DimensionValue;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const StyledImage =
|
|
36
|
+
const StyledImage = ({ height = 100, width = 100, ref, ...props }: _StyledImageProps & { ref?: React.Ref<React.ComponentRef<typeof Image>> }) => {
|
|
37
37
|
const { cycle, size, ...rest } = props;
|
|
38
38
|
const sizeStyle: ImageStyle = cycle
|
|
39
39
|
? { height: Number(size) as DimensionValue, width: Number(size) as DimensionValue, borderRadius: 9999 }
|
|
40
40
|
: { height: height as DimensionValue, width: width as DimensionValue };
|
|
41
41
|
return <Image {...rest} style={[props.style, sizeStyle]} ref={ref} />;
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
|
|
44
44
|
export { StyledImage, StyledImageBackground };
|
|
45
45
|
export type { StyledImageProps, StyledImageBackgroundProps };
|
package/src/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { StyledText, type StyledTextProps } from './text'
|
|
|
6
6
|
export { StyledSafeAreaProvider, type StyledSafeAreaProviderProps } from './safeAreaProvider'
|
|
7
7
|
export { StyledSafeAreaView, type StyledSafeAreaViewProps } from './safeAreaView'
|
|
8
8
|
export { StyledScrollView, type StyledScrollViewProps } from './scrollView'
|
|
9
|
-
export { StyleShape, type ShapeProps } from './shape'
|
|
9
|
+
export { StyledShape, StyleShape, type ShapeProps } from './shape'
|
|
10
10
|
export { StyledPage, type StyledPageProps } from './page'
|
|
11
11
|
export { StyledHeader, type HeaderProps } from './header'
|
|
12
12
|
export { StyledSpacer, type SpacerProps } from './spacer'
|
package/src/input/index.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, {
|
|
2
|
-
forwardRef,
|
|
3
2
|
useCallback,
|
|
4
3
|
useImperativeHandle,
|
|
5
4
|
useRef,
|
|
@@ -337,63 +336,62 @@ const ad = StyleSheet.create({
|
|
|
337
336
|
|
|
338
337
|
// ─── StyledTextInput ──────────────────────────────────────────────────────────
|
|
339
338
|
|
|
340
|
-
export const StyledTextInput =
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
onBlur: onBlurProp,
|
|
393
|
-
...rest
|
|
394
|
-
},
|
|
339
|
+
export const StyledTextInput = (
|
|
340
|
+
{
|
|
341
|
+
// Label / meta
|
|
342
|
+
label,
|
|
343
|
+
labelProps,
|
|
344
|
+
required = false,
|
|
345
|
+
helperText,
|
|
346
|
+
helperProps,
|
|
347
|
+
errorMessage,
|
|
348
|
+
errorProps,
|
|
349
|
+
error = false,
|
|
350
|
+
|
|
351
|
+
// Counter
|
|
352
|
+
showCounter = false,
|
|
353
|
+
|
|
354
|
+
// Icons
|
|
355
|
+
leftIcon,
|
|
356
|
+
rightIcon,
|
|
357
|
+
leftAddon,
|
|
358
|
+
rightAddon,
|
|
359
|
+
|
|
360
|
+
// Clear + loading
|
|
361
|
+
clearable = false,
|
|
362
|
+
loading = false,
|
|
363
|
+
|
|
364
|
+
// Appearance
|
|
365
|
+
variant = 'outline',
|
|
366
|
+
size = 'md',
|
|
367
|
+
borderColor: borderColorProp,
|
|
368
|
+
focusColor = theme.colors.indigo?.[500] ?? '#6366f1',
|
|
369
|
+
floatLabel = false,
|
|
370
|
+
|
|
371
|
+
// Styles
|
|
372
|
+
containerStyle,
|
|
373
|
+
inputWrapStyle,
|
|
374
|
+
inputStyle,
|
|
375
|
+
|
|
376
|
+
// Pass-through style props
|
|
377
|
+
fontSize: fontSizeProp,
|
|
378
|
+
fontWeight: fontWeightProp,
|
|
379
|
+
|
|
380
|
+
// TextInput props
|
|
381
|
+
value,
|
|
382
|
+
defaultValue,
|
|
383
|
+
onChangeText,
|
|
384
|
+
placeholder,
|
|
385
|
+
editable = true,
|
|
386
|
+
multiline = false,
|
|
387
|
+
numberOfLines,
|
|
388
|
+
maxLength,
|
|
389
|
+
onFocus: onFocusProp,
|
|
390
|
+
onBlur: onBlurProp,
|
|
395
391
|
ref,
|
|
396
|
-
|
|
392
|
+
...rest
|
|
393
|
+
}: StyledTextInputProps & { ref?: React.Ref<React.ComponentRef<typeof TextInputBase>> },
|
|
394
|
+
) => {
|
|
397
395
|
const [focused, setFocused] = useState(false)
|
|
398
396
|
const [localValue, setLocalValue] = useState(defaultValue ?? '')
|
|
399
397
|
const inputRef = useRef<TextInput>(null)
|
|
@@ -617,8 +615,7 @@ export const StyledTextInput = forwardRef<React.ComponentRef<typeof TextInputBas
|
|
|
617
615
|
|
|
618
616
|
</View>
|
|
619
617
|
)
|
|
620
|
-
|
|
621
|
-
)
|
|
618
|
+
};
|
|
622
619
|
|
|
623
620
|
StyledTextInput.displayName = 'StyledTextInput'
|
|
624
621
|
export { StyledTextInput as StyledInput }
|
package/src/page/index.tsx
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyledSafeAreaView, StyledSafeAreaViewProps } from '../safeAreaView';
|
|
3
|
+
import { StatusBar, StatusBarProps } from 'react-native';
|
|
4
|
+
import { StyledHeader } from '../header';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
interface StyledPageProps extends StyledSafeAreaViewProps {
|
|
7
|
+
statusBarProps?: StatusBarProps;
|
|
8
|
+
showStatusBar?: boolean;
|
|
9
|
+
statusBarStyle?: StatusBarProps['barStyle'];
|
|
10
|
+
statusBarBackgroundColor?: StatusBarProps['backgroundColor'];
|
|
11
|
+
hideStatusBarOnAndroid?: boolean;
|
|
12
|
+
hideStatusBarOnIOS?: boolean;
|
|
13
|
+
translucentStatusBar?: boolean;
|
|
6
14
|
}
|
|
7
15
|
|
|
8
|
-
|
|
16
|
+
interface StyledPageType {
|
|
17
|
+
(props: React.PropsWithChildren<StyledPageProps>): React.ReactNode;
|
|
18
|
+
Header: typeof StyledHeader;
|
|
19
|
+
displayName?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Page = ({ children, statusBarProps, showStatusBar = true, statusBarStyle, statusBarBackgroundColor, hideStatusBarOnAndroid, hideStatusBarOnIOS, translucentStatusBar, ...props }: React.PropsWithChildren<StyledPageProps>) => {
|
|
9
23
|
return (
|
|
10
24
|
<StyledSafeAreaView {...props}>
|
|
25
|
+
{showStatusBar && <StatusBar hidden={hideStatusBarOnAndroid || hideStatusBarOnIOS} barStyle={statusBarStyle} backgroundColor={statusBarBackgroundColor} translucent={translucentStatusBar} {...statusBarProps} />}
|
|
11
26
|
{children}
|
|
12
27
|
</StyledSafeAreaView>
|
|
13
28
|
)
|
|
14
29
|
}
|
|
15
30
|
|
|
31
|
+
const StyledPage = Page as StyledPageType;
|
|
32
|
+
|
|
33
|
+
StyledPage.Header = StyledHeader;
|
|
16
34
|
StyledPage.displayName = 'StyledPage';
|
|
17
35
|
|
|
18
36
|
export { StyledPage };
|
|
@@ -4,13 +4,17 @@ import {
|
|
|
4
4
|
} from 'react-native-safe-area-context';
|
|
5
5
|
import { styled } from '../utiles/styled';
|
|
6
6
|
import { ViewStyleProps, ViewStyle } from '../utiles/viewStyleProps';
|
|
7
|
+
import { viewStyleStringVariants } from '../utiles/viewStyleVariants';
|
|
7
8
|
|
|
8
9
|
type StyledSafeAreaViewProps = SafeAreaViewProps & ViewStyleProps;
|
|
9
10
|
|
|
10
11
|
const StyledSafeAreaView = styled<StyledSafeAreaViewProps>(SafeAreaView, {
|
|
11
12
|
base: {
|
|
12
|
-
|
|
13
|
-
} as ViewStyle
|
|
13
|
+
flex: 1,
|
|
14
|
+
} as ViewStyle,
|
|
15
|
+
variants: {
|
|
16
|
+
...viewStyleStringVariants,
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
|
|
16
20
|
export { StyledSafeAreaView };
|
package/src/seperator/index.tsx
CHANGED
|
@@ -10,14 +10,9 @@ interface SeperatorProps extends StackProps {
|
|
|
10
10
|
rightLabelProps?: React.ComponentProps<typeof StyledText>;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const StyledSeperator =
|
|
14
|
-
React.ComponentRef<typeof Stack
|
|
15
|
-
|
|
16
|
-
>(
|
|
17
|
-
(
|
|
18
|
-
{ leftLabel, leftLabelProps, rightLabel, rightLabelProps, ...rest },
|
|
19
|
-
ref,
|
|
20
|
-
) => {
|
|
13
|
+
const StyledSeperator = (
|
|
14
|
+
{ leftLabel, leftLabelProps, rightLabel, rightLabelProps, ref, ...rest }: SeperatorProps & { ref?: React.Ref<React.ComponentRef<typeof Stack>> },
|
|
15
|
+
) => {
|
|
21
16
|
return (
|
|
22
17
|
<Stack
|
|
23
18
|
horizontal
|
|
@@ -50,8 +45,7 @@ const StyledSeperator = React.forwardRef<
|
|
|
50
45
|
}
|
|
51
46
|
</Stack>
|
|
52
47
|
);
|
|
53
|
-
|
|
54
|
-
);
|
|
48
|
+
};
|
|
55
49
|
|
|
56
50
|
StyledSeperator.displayName = "StyledSeperator";
|
|
57
51
|
|
package/src/shape/cycle.tsx
CHANGED
|
@@ -114,18 +114,16 @@ interface StyledCycleProps extends CycleComponentProps {
|
|
|
114
114
|
* </LinearGradient>
|
|
115
115
|
* </StyledCycle>
|
|
116
116
|
*/
|
|
117
|
-
const StyledCycle =
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
</CycleBase>
|
|
128
|
-
)
|
|
117
|
+
const StyledCycle = (
|
|
118
|
+
{
|
|
119
|
+
children,
|
|
120
|
+
ref,
|
|
121
|
+
...rest
|
|
122
|
+
}: StyledCycleProps & { ref?: React.Ref<View> }
|
|
123
|
+
) => (
|
|
124
|
+
<CycleBase ref={ref} {...rest}>
|
|
125
|
+
{children}
|
|
126
|
+
</CycleBase>
|
|
129
127
|
);
|
|
130
128
|
|
|
131
129
|
StyledCycle.displayName = 'StyledCycle';
|
package/src/shape/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { View, ViewProps, ViewStyle } from 'react-native';
|
|
3
3
|
import { styled } from '../utiles/styled';
|
|
4
|
+
import { viewStyleStringVariants, viewStyleVariants } from '../utiles/viewStyleVariants';
|
|
4
5
|
|
|
5
6
|
type ShapeVariants = {
|
|
6
7
|
cycle?: boolean | [boolean, ViewStyle];
|
|
@@ -9,7 +10,7 @@ type ShapeVariants = {
|
|
|
9
10
|
|
|
10
11
|
type ShapeProps = ShapeVariants & ViewProps & ViewStyle;
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
+
const StyledShape = styled<ShapeProps>(View, {
|
|
13
14
|
base: {
|
|
14
15
|
position: 'relative',
|
|
15
16
|
} as ViewStyle,
|
|
@@ -31,8 +32,11 @@ const StyleShape = styled<ShapeProps>(View, {
|
|
|
31
32
|
}
|
|
32
33
|
return { height: Number(selected), width: Number(selected) };
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
+
...viewStyleVariants,
|
|
36
|
+
...viewStyleStringVariants,
|
|
37
|
+
} as any,
|
|
35
38
|
});
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
|
|
41
|
+
export { StyledShape, StyledShape as StyleShape };
|
|
38
42
|
export type { ShapeProps };
|