fluent-styles 1.58.0 → 1.60.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/lib/commonjs/button/index.js +5 -10
- package/lib/commonjs/button/index.js.map +1 -1
- package/lib/commonjs/form/index.js +267 -0
- package/lib/commonjs/form/index.js.map +1 -1
- package/lib/commonjs/header/index.js +79 -66
- package/lib/commonjs/header/index.js.map +1 -1
- package/lib/commonjs/index.js +95 -71
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/input/index.js +2 -3
- package/lib/commonjs/input/index.js.map +1 -1
- package/lib/commonjs/shape/cycle.js +116 -0
- package/lib/commonjs/shape/cycle.js.map +1 -0
- package/lib/module/button/index.js +5 -10
- package/lib/module/button/index.js.map +1 -1
- package/lib/module/form/index.js +262 -0
- package/lib/module/form/index.js.map +1 -1
- package/lib/module/header/index.js +81 -68
- package/lib/module/header/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/input/index.js +1 -0
- package/lib/module/input/index.js.map +1 -1
- package/lib/module/shape/cycle.js +112 -0
- package/lib/module/shape/cycle.js.map +1 -0
- package/lib/typescript/button/index.d.ts.map +1 -1
- package/lib/typescript/form/index.d.ts +127 -0
- package/lib/typescript/form/index.d.ts.map +1 -1
- package/lib/typescript/header/index.d.ts +4 -9
- package/lib/typescript/header/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/input/index.d.ts +1 -1
- package/lib/typescript/input/index.d.ts.map +1 -1
- package/lib/typescript/shape/cycle.d.ts +65 -0
- package/lib/typescript/shape/cycle.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/button/index.tsx +1 -6
- package/src/form/index.tsx +331 -0
- package/src/header/index.tsx +87 -103
- package/src/index.ts +3 -1
- package/src/input/index.tsx +1 -0
- package/src/shape/cycle.tsx +134 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAIL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAc,eAAe,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAkB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAoB,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAoB,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAgB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI5D,KAAK,UAAU,GAAG,SAAS,CAAC;AAG5B,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAG,OAAO,CAAC;CACpB;AAGD,eAAO,MAAM,cAAc,wBAAgC,CAAC;AAI5D,MAAM,WAAW,eAAgB,SAAQ,SAAS,EAAE,SAAS;IAC3D,QAAQ,CAAC,EAAO,OAAO,CAAC;IACxB,OAAO,CAAC,EAAQ,OAAO,CAAC;IACxB,GAAG,CAAC,EAAY,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAK,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAO,UAAU,CAAC;CAC5B;AAED,MAAM,WAAW,YAAa,SAAQ,SAAS,EAAE,SAA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AK,CAAC,EAAE,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAE/C,CAAC;AAGF;;;;GAIG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAQ/C,CAAC;AAGF;;;;GAIG;AACH,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAQvC,CAAC;AAKF,UAAU,aAAc,SAAQ,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC;IAEvD,GAAG,EAAS,OAAO,GAAG,CAAC;IACvB,OAAO,EAAK,OAAO,OAAO,CAAC;IAC3B,OAAO,EAAK,OAAO,OAAO,CAAC;IAE3B,KAAK,EAAO,OAAO,KAAK,CAAC;IACzB,QAAQ,EAAI,OAAO,QAAQ,CAAC;IAC5B,MAAM,EAAM,OAAO,UAAU,CAAC;IAC9B,MAAM,EAAM,OAAO,MAAM,CAAC;IAC1B,KAAK,EAAO,OAAO,KAAK,CAAC;IACzB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,MAAM,EAAM,OAAO,MAAM,CAAC;CAC3B;AAED,QAAA,MAAM,UAAU,EAAE,aAsCjB,CAAC;AAcF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -23,21 +23,16 @@ export interface HeaderProps extends ViewProps, ViewStyle {
|
|
|
23
23
|
statusBarProps?: StatusBarProps;
|
|
24
24
|
skipStatusBarOnAndroid?: boolean;
|
|
25
25
|
skipStatusBarOnIOS?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface FullHeaderProps extends ViewProps, ViewStyle {
|
|
28
26
|
children?: React.ReactNode;
|
|
29
|
-
statusBarProps?: StatusBarProps;
|
|
30
|
-
skipStatusBarOnAndroid?: boolean;
|
|
31
|
-
skipStatusBarOnIOS?: boolean;
|
|
32
27
|
}
|
|
33
|
-
declare const
|
|
34
|
-
|
|
35
|
-
}
|
|
28
|
+
declare const Full: React.FC<{
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}>;
|
|
36
31
|
declare const HeaderComponent: React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<Omit<ViewProps & ViewStyle & React.RefAttributes<any>, "ref"> & {
|
|
37
32
|
ref?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
|
|
38
33
|
}>>;
|
|
39
34
|
interface HeaderComponent extends React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<View>> {
|
|
40
|
-
Full: typeof
|
|
35
|
+
Full: typeof Full;
|
|
41
36
|
}
|
|
42
37
|
declare const StyledHeader: HeaderComponent;
|
|
43
38
|
export { StyledHeader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAItB,OAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAc,UAAU,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAc,eAAe,EAAE,MAAM,SAAS,CAAC;AAQtD,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,SAAS;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAwBD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAElD,CAAC;AAMF,QAAA,MAAM,eAAe;;GA8GpB,CAAC;AAIF,UAAU,eACR,SAAQ,KAAK,CAAC,yBAAyB,CACrC,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CACxC;IACD,IAAI,EAAE,OAAO,IAAI,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,iBAAqC,CAAC;AAKxD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -17,7 +17,6 @@ export { StyledImage, StyledImageBackground, type StyledImageProps, type StyledI
|
|
|
17
17
|
export { StyledPressable, type StyledPressableProps } from './pressable';
|
|
18
18
|
export { StyledButton, type StyledButtonProps } from './button';
|
|
19
19
|
export { StyledDivider, type DividerProps } from './divider';
|
|
20
|
-
export * from './input';
|
|
21
20
|
export { StyledCheckBox, type StyledCheckBoxProps } from './checkBox';
|
|
22
21
|
export { StyledBadge, type StyledBadgeProps } from './badge';
|
|
23
22
|
export { BadgeWithIcon, type BadgeWithIconProps } from './badge';
|
|
@@ -56,4 +55,7 @@ export * from './searchBar';
|
|
|
56
55
|
export * from './dialog';
|
|
57
56
|
export * from './utiles/validators';
|
|
58
57
|
export * from './spinner';
|
|
58
|
+
export * from './input';
|
|
59
|
+
export * from './form';
|
|
60
|
+
export * from './shape/cycle';
|
|
59
61
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,gBAAgB,CAAA;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,KAAK,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAC7F,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAA;AACzD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,MAAM,EAA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AAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA"}
|
|
@@ -85,5 +85,5 @@ export interface StyledTextInputHandle extends StyledTextInputProps {
|
|
|
85
85
|
isFocused: () => boolean;
|
|
86
86
|
}
|
|
87
87
|
export declare const StyledTextInput: React.ForwardRefExoticComponent<StyledTextInputProps & React.RefAttributes<any>>;
|
|
88
|
-
export {};
|
|
88
|
+
export { StyledTextInput as StyledInput };
|
|
89
89
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAA;AACd,OAAO,EAML,cAAc,EAGf,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAGV,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAA;AAMrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,MAAM,MAAM,SAAS,GAAO,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAC9C,MAAM,MAAM,YAAY,GAAI,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAA;AAExE,MAAM,MAAM,UAAU,GAAG;IACvB,4CAA4C;IAC5C,IAAI,CAAC,EAAM,MAAM,CAAA;IACjB,kDAAkD;IAClD,IAAI,CAAC,EAAM,KAAK,CAAC,SAAS,CAAA;IAC1B,oEAAoE;IACpE,EAAE,CAAC,EAAQ,MAAM,CAAA;IACjB,2CAA2C;IAC3C,KAAK,CAAC,EAAK,MAAM,CAAA;IACjB,6CAA6C;IAC7C,OAAO,CAAC,EAAG,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,KAAK,kBAAkB,GAAI,cAAc,GAAG,S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AAM,IAAI,CAAA;IACtB,SAAS,EAAG,MAAM,OAAO,CAAA;CAC1B;AAuKD,eAAO,MAAM,eAAe,kFAyR3B,CAAA;AAGD,OAAO,EAAE,eAAe,IAAI,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Cycle component - Circular container with size variants
|
|
5
|
+
*
|
|
6
|
+
* A specialized layout component that creates circular containers
|
|
7
|
+
* with predefined size variants. Uses borderRadius: 50% to create perfect circles.
|
|
8
|
+
*
|
|
9
|
+
* Size variants (width & height):
|
|
10
|
+
* - sm: 32px (small circles, icons)
|
|
11
|
+
* - md: 48px (medium circles, avatars)
|
|
12
|
+
* - lg: 64px (large circles, featured items)
|
|
13
|
+
* - xl: 80px (extra large circles, hero sections)
|
|
14
|
+
*/
|
|
15
|
+
type SizeVariant = 'sm' | 'md' | 'lg' | 'xl';
|
|
16
|
+
type CycleVariants = {
|
|
17
|
+
size?: SizeVariant;
|
|
18
|
+
};
|
|
19
|
+
type CycleComponentProps = CycleVariants & ViewProps & ViewStyle;
|
|
20
|
+
/**
|
|
21
|
+
* Base Cycle component with size variants
|
|
22
|
+
* Circular container with centered content
|
|
23
|
+
* Default size: md (48px)
|
|
24
|
+
*/
|
|
25
|
+
declare const CycleBase: React.ForwardRefExoticComponent<CycleVariants & ViewProps & ViewStyle & React.RefAttributes<any>>;
|
|
26
|
+
interface StyledCycleProps extends CycleComponentProps {
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wrapper component for Cycle with size variants
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Small cycle with icon
|
|
34
|
+
* <StyledCycle size="sm">
|
|
35
|
+
* <Icon name="star" />
|
|
36
|
+
* </StyledCycle>
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Medium cycle (default) with avatar
|
|
40
|
+
* <StyledCycle>
|
|
41
|
+
* <Avatar uri={image} />
|
|
42
|
+
* </StyledCycle>
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Large cycle with custom styling
|
|
46
|
+
* <StyledCycle
|
|
47
|
+
* size="lg"
|
|
48
|
+
* backgroundColor={theme.colors.primary[500]}
|
|
49
|
+
* borderColor={theme.colors.primary[600]}
|
|
50
|
+
* >
|
|
51
|
+
* <Text fontSize={20} fontWeight="bold">C</Text>
|
|
52
|
+
* </StyledCycle>
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Extra large cycle with gradient background
|
|
56
|
+
* <StyledCycle size="xl">
|
|
57
|
+
* <LinearGradient colors={['#FF6B6B', '#FFD93D']}>
|
|
58
|
+
* <Text color="white">Logo</Text>
|
|
59
|
+
* </LinearGradient>
|
|
60
|
+
* </StyledCycle>
|
|
61
|
+
*/
|
|
62
|
+
declare const StyledCycle: React.ForwardRefExoticComponent<StyledCycleProps & React.RefAttributes<View>>;
|
|
63
|
+
export { StyledCycle, CycleBase };
|
|
64
|
+
export type { CycleVariants, CycleComponentProps, StyledCycleProps, SizeVariant };
|
|
65
|
+
//# sourceMappingURL=cycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cycle.d.ts","sourceRoot":"","sources":["../../../src/shape/cycle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB;;;;;;;;;;;GAWG;AAEH,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,KAAK,mBAAmB,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAyBjE;;;;GAIG;AACH,QAAA,MAAM,SAAS,mGAmBb,CAAC;AAEH,UAAU,gBAAiB,SAAQ,mBAAmB;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,QAAA,MAAM,WAAW,+EAYhB,CAAC;AAIF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAClC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/button/index.tsx
CHANGED
|
@@ -107,10 +107,9 @@ const ButtonBase = styled<ButtonProps>(TouchableOpacity, {
|
|
|
107
107
|
justifyContent: 'center',
|
|
108
108
|
flexDirection: 'row',
|
|
109
109
|
gap: 6,
|
|
110
|
-
borderRadius:
|
|
110
|
+
borderRadius: 32, // pill by default
|
|
111
111
|
paddingHorizontal: 20,
|
|
112
112
|
paddingVertical: 10,
|
|
113
|
-
flex: 1,
|
|
114
113
|
borderWidth: 0,
|
|
115
114
|
} as ViewStyle,
|
|
116
115
|
|
|
@@ -218,7 +217,6 @@ const ButtonBase = styled<ButtonProps>(TouchableOpacity, {
|
|
|
218
217
|
true: {
|
|
219
218
|
paddingHorizontal: 10,
|
|
220
219
|
paddingVertical: 4,
|
|
221
|
-
borderWidth: 0,
|
|
222
220
|
} as ViewStyle,
|
|
223
221
|
},
|
|
224
222
|
|
|
@@ -226,7 +224,6 @@ const ButtonBase = styled<ButtonProps>(TouchableOpacity, {
|
|
|
226
224
|
true: {
|
|
227
225
|
paddingHorizontal: 14,
|
|
228
226
|
paddingVertical: 6,
|
|
229
|
-
borderWidth: 0,
|
|
230
227
|
} as ViewStyle,
|
|
231
228
|
},
|
|
232
229
|
|
|
@@ -241,7 +238,6 @@ const ButtonBase = styled<ButtonProps>(TouchableOpacity, {
|
|
|
241
238
|
true: {
|
|
242
239
|
paddingHorizontal: 28,
|
|
243
240
|
paddingVertical: 14,
|
|
244
|
-
borderWidth: 0,
|
|
245
241
|
} as ViewStyle,
|
|
246
242
|
},
|
|
247
243
|
|
|
@@ -249,7 +245,6 @@ const ButtonBase = styled<ButtonProps>(TouchableOpacity, {
|
|
|
249
245
|
true: {
|
|
250
246
|
paddingHorizontal: 36,
|
|
251
247
|
paddingVertical: 18,
|
|
252
|
-
borderWidth: 0,
|
|
253
248
|
} as ViewStyle,
|
|
254
249
|
},
|
|
255
250
|
|
package/src/form/index.tsx
CHANGED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import React, { createContext, useContext, type ReactNode } from "react";
|
|
2
|
+
import {
|
|
3
|
+
KeyboardAvoidingView,
|
|
4
|
+
Platform,
|
|
5
|
+
ScrollView,
|
|
6
|
+
ViewProps,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import { Stack } from "../stack";
|
|
10
|
+
import { StyledText, StyledTextProps } from "../text";
|
|
11
|
+
import { StyledDivider } from "../divider";
|
|
12
|
+
import { StyledTextInput, StyledTextInputProps } from "../input";
|
|
13
|
+
import { StyledCheckBox, StyledCheckBoxProps } from "../checkBox";
|
|
14
|
+
import { Switch, SwitchProps } from "../switch";
|
|
15
|
+
import { StyledDropdown, StyledDropdownProps } from "../dropdown";
|
|
16
|
+
import { StyledRadioGroup, StyledRadioGroupProps } from "../radio";
|
|
17
|
+
import { StyledDatePicker, StyledDatePickerProps } from "../datePicker";
|
|
18
|
+
import { StyledSlider, StyledSliderProps } from "../slider";
|
|
19
|
+
import { theme } from "../utiles/theme";
|
|
20
|
+
|
|
21
|
+
// ─── CompatNode ───────────────────────────────────────────────────────────────
|
|
22
|
+
type CompatNode = ReactNode;
|
|
23
|
+
|
|
24
|
+
// ─── Form context ─────────────────────────────────────────────────────────────
|
|
25
|
+
interface FormContextValue {
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const FormContext = createContext<FormContextValue>({});
|
|
31
|
+
export const useFormContext = () => useContext(FormContext);
|
|
32
|
+
|
|
33
|
+
// ─── Types ────────────────────────────────────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
export interface StyledFormProps extends ViewProps, ViewStyle {
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
gap?: number;
|
|
39
|
+
avoidKeyboard?: boolean;
|
|
40
|
+
scrollable?: boolean;
|
|
41
|
+
scrollPadding?: number;
|
|
42
|
+
children?: CompatNode;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface FormRowProps extends ViewProps, ViewStyle {
|
|
46
|
+
gap?: number;
|
|
47
|
+
children?: CompatNode;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface FormSectionProps extends ViewProps, ViewStyle {
|
|
51
|
+
title?: string;
|
|
52
|
+
titleProps?: StyledTextProps;
|
|
53
|
+
subtitle?: string;
|
|
54
|
+
subtitleProps?: StyledTextProps;
|
|
55
|
+
showDivider?: boolean;
|
|
56
|
+
children?: CompatNode;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface FormActionsProps extends ViewProps, ViewStyle {
|
|
60
|
+
horizontal?: boolean;
|
|
61
|
+
gap?: number;
|
|
62
|
+
children?: CompatNode;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ─── Layout sub-components ────────────────────────────────────────────────────
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* StyledForm.Row
|
|
69
|
+
* Side-by-side inputs — e.g. First name / Last name.
|
|
70
|
+
*
|
|
71
|
+
* <StyledForm.Row>
|
|
72
|
+
* <StyledForm.Input label="First" flex={1} />
|
|
73
|
+
* <StyledForm.Input label="Last" flex={1} />
|
|
74
|
+
* </StyledForm.Row>
|
|
75
|
+
*/
|
|
76
|
+
const Row: React.FC<FormRowProps> = ({ gap = 12, children, ...rest }) => (
|
|
77
|
+
<Stack horizontal gap={gap} {...rest}>
|
|
78
|
+
{children}
|
|
79
|
+
</Stack>
|
|
80
|
+
);
|
|
81
|
+
Row.displayName = "StyledForm.Row";
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* StyledForm.Section
|
|
85
|
+
* Groups related inputs under a titled section.
|
|
86
|
+
*
|
|
87
|
+
* <StyledForm.Section title="Personal info" subtitle="Shown on your profile">
|
|
88
|
+
* <StyledForm.Input label="Name" />
|
|
89
|
+
* </StyledForm.Section>
|
|
90
|
+
*/
|
|
91
|
+
const Section: React.FC<FormSectionProps> = ({
|
|
92
|
+
title,
|
|
93
|
+
titleProps,
|
|
94
|
+
subtitle,
|
|
95
|
+
subtitleProps,
|
|
96
|
+
showDivider = true,
|
|
97
|
+
children,
|
|
98
|
+
...rest
|
|
99
|
+
}) => (
|
|
100
|
+
<Stack gap={14} {...rest}>
|
|
101
|
+
{(title || subtitle) && (
|
|
102
|
+
<Stack gap={2}>
|
|
103
|
+
{title && (
|
|
104
|
+
<StyledText
|
|
105
|
+
fontSize={15}
|
|
106
|
+
fontWeight="700"
|
|
107
|
+
color={theme.colors.gray[900]}
|
|
108
|
+
{...titleProps}
|
|
109
|
+
>
|
|
110
|
+
{title}
|
|
111
|
+
</StyledText>
|
|
112
|
+
)}
|
|
113
|
+
{subtitle && (
|
|
114
|
+
<StyledText fontSize={13} color={theme.colors.gray[400]} {...subtitleProps}>
|
|
115
|
+
{subtitle}
|
|
116
|
+
</StyledText>
|
|
117
|
+
)}
|
|
118
|
+
{showDivider && (
|
|
119
|
+
<StyledDivider borderBottomColor={theme.colors.gray[100]} marginTop={6} />
|
|
120
|
+
)}
|
|
121
|
+
</Stack>
|
|
122
|
+
)}
|
|
123
|
+
{children}
|
|
124
|
+
</Stack>
|
|
125
|
+
);
|
|
126
|
+
Section.displayName = "StyledForm.Section";
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* StyledForm.Actions
|
|
130
|
+
* Slot for submit / cancel buttons.
|
|
131
|
+
*
|
|
132
|
+
* <StyledForm.Actions>
|
|
133
|
+
* <StyledButton primary block>Submit</StyledButton>
|
|
134
|
+
* <StyledButton outline block>Cancel</StyledButton>
|
|
135
|
+
* </StyledForm.Actions>
|
|
136
|
+
*/
|
|
137
|
+
const Actions: React.FC<FormActionsProps> = ({
|
|
138
|
+
horizontal = false,
|
|
139
|
+
gap = 10,
|
|
140
|
+
children,
|
|
141
|
+
...rest
|
|
142
|
+
}) => (
|
|
143
|
+
<Stack horizontal={horizontal} gap={gap} {...rest}>
|
|
144
|
+
{children}
|
|
145
|
+
</Stack>
|
|
146
|
+
);
|
|
147
|
+
Actions.displayName = "StyledForm.Actions";
|
|
148
|
+
|
|
149
|
+
// ─── Input sub-components — thin aliases that read FormContext ────────────────
|
|
150
|
+
// Each one forwards all props of the underlying component unchanged.
|
|
151
|
+
// The only addition: they read disabled/loading from FormContext so form-level
|
|
152
|
+
// state propagates without prop drilling.
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* StyledForm.Input → StyledTextInput
|
|
156
|
+
*
|
|
157
|
+
* <StyledForm.Input label="Email" required variant="outline" />
|
|
158
|
+
*/
|
|
159
|
+
const Input: React.FC<StyledTextInputProps> = (props) => {
|
|
160
|
+
const ctx = useFormContext();
|
|
161
|
+
return (
|
|
162
|
+
<StyledTextInput
|
|
163
|
+
editable={ctx.disabled ? false : props.editable}
|
|
164
|
+
loading={props.loading ?? ctx.loading}
|
|
165
|
+
{...props}
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
Input.displayName = "StyledForm.Input";
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* StyledForm.Checkbox → StyledCheckBox
|
|
173
|
+
*
|
|
174
|
+
* <StyledForm.Checkbox label="I agree to the terms" checked={agreed} onCheck={setAgreed} />
|
|
175
|
+
*/
|
|
176
|
+
const Checkbox: React.FC<StyledCheckBoxProps> = (props) => {
|
|
177
|
+
const ctx = useFormContext();
|
|
178
|
+
return (
|
|
179
|
+
<StyledCheckBox
|
|
180
|
+
disabled={props.disabled ?? ctx.disabled}
|
|
181
|
+
{...props}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
Checkbox.displayName = "StyledForm.Checkbox";
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* StyledForm.Switch → Switch
|
|
189
|
+
*
|
|
190
|
+
* <StyledForm.Switch label="Email notifications" value={notifs} onChange={setNotifs} />
|
|
191
|
+
*/
|
|
192
|
+
const FormSwitch: React.FC<SwitchProps<any>> = (props) => {
|
|
193
|
+
const ctx = useFormContext();
|
|
194
|
+
return (
|
|
195
|
+
<Switch
|
|
196
|
+
disabled={props.disabled ?? ctx.disabled}
|
|
197
|
+
loading={props.loading ?? ctx.loading}
|
|
198
|
+
{...props}
|
|
199
|
+
/>
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
FormSwitch.displayName = "StyledForm.Switch";
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* StyledForm.Select → StyledDropdown
|
|
206
|
+
*
|
|
207
|
+
* <StyledForm.Select label="Country" options={countries} value={country} onChange={setCountry} />
|
|
208
|
+
*/
|
|
209
|
+
const Select: React.FC<StyledDropdownProps> = (props) => {
|
|
210
|
+
const ctx = useFormContext();
|
|
211
|
+
return (
|
|
212
|
+
<StyledDropdown
|
|
213
|
+
disabled={props.disabled ?? ctx.disabled}
|
|
214
|
+
{...props}
|
|
215
|
+
/>
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
Select.displayName = "StyledForm.Select";
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* StyledForm.Radio → StyledRadioGroup
|
|
222
|
+
*
|
|
223
|
+
* <StyledForm.Radio options={plans} value={plan} onChange={setPlan} />
|
|
224
|
+
*/
|
|
225
|
+
const Radio: React.FC<StyledRadioGroupProps<any>> = (props) => (
|
|
226
|
+
<StyledRadioGroup {...props} />
|
|
227
|
+
);
|
|
228
|
+
Radio.displayName = "StyledForm.Radio";
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* StyledForm.DatePicker → StyledDatePicker
|
|
232
|
+
*
|
|
233
|
+
* <StyledForm.DatePicker label="Date of birth" value={dob} onChange={setDob} variant="input" />
|
|
234
|
+
*/
|
|
235
|
+
const DatePicker: React.FC<StyledDatePickerProps> = (props) => {
|
|
236
|
+
const ctx = useFormContext();
|
|
237
|
+
return (
|
|
238
|
+
<StyledDatePicker
|
|
239
|
+
disabled={props.disabled ?? ctx.disabled}
|
|
240
|
+
{...props}
|
|
241
|
+
/>
|
|
242
|
+
);
|
|
243
|
+
};
|
|
244
|
+
DatePicker.displayName = "StyledForm.DatePicker";
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* StyledForm.Slider → StyledSlider
|
|
248
|
+
*
|
|
249
|
+
* <StyledForm.Slider label="Budget" value={budget} onValueChange={setBudget} min={0} max={1000} />
|
|
250
|
+
*/
|
|
251
|
+
const Slider: React.FC<StyledSliderProps> = (props) => {
|
|
252
|
+
const ctx = useFormContext();
|
|
253
|
+
return (
|
|
254
|
+
<StyledSlider
|
|
255
|
+
disabled={props.disabled ?? ctx.disabled}
|
|
256
|
+
{...props}
|
|
257
|
+
/>
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
Slider.displayName = "StyledForm.Slider";
|
|
261
|
+
|
|
262
|
+
// ─── StyledForm (root) ────────────────────────────────────────────────────────
|
|
263
|
+
|
|
264
|
+
interface FormComponent extends React.FC<StyledFormProps> {
|
|
265
|
+
// layout
|
|
266
|
+
Row: typeof Row;
|
|
267
|
+
Section: typeof Section;
|
|
268
|
+
Actions: typeof Actions;
|
|
269
|
+
// inputs
|
|
270
|
+
Input: typeof Input;
|
|
271
|
+
Checkbox: typeof Checkbox;
|
|
272
|
+
Switch: typeof FormSwitch;
|
|
273
|
+
Select: typeof Select;
|
|
274
|
+
Radio: typeof Radio;
|
|
275
|
+
DatePicker: typeof DatePicker;
|
|
276
|
+
Slider: typeof Slider;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const StyledForm: FormComponent = ({
|
|
280
|
+
disabled,
|
|
281
|
+
loading,
|
|
282
|
+
gap = 16,
|
|
283
|
+
avoidKeyboard = true,
|
|
284
|
+
scrollable = false,
|
|
285
|
+
scrollPadding = 40,
|
|
286
|
+
children,
|
|
287
|
+
...rest
|
|
288
|
+
}) => {
|
|
289
|
+
const fields = (
|
|
290
|
+
<Stack gap={gap} {...rest}>
|
|
291
|
+
{children}
|
|
292
|
+
</Stack>
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
const content = scrollable ? (
|
|
296
|
+
<ScrollView
|
|
297
|
+
keyboardShouldPersistTaps="handled"
|
|
298
|
+
showsVerticalScrollIndicator={false}
|
|
299
|
+
contentContainerStyle={{ flexGrow: 1, paddingBottom: scrollPadding }}
|
|
300
|
+
>
|
|
301
|
+
{fields}
|
|
302
|
+
</ScrollView>
|
|
303
|
+
) : fields;
|
|
304
|
+
|
|
305
|
+
return (
|
|
306
|
+
<FormContext.Provider value={{ disabled, loading }}>
|
|
307
|
+
{avoidKeyboard ? (
|
|
308
|
+
<KeyboardAvoidingView
|
|
309
|
+
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
310
|
+
style={{ flex: 1 }}
|
|
311
|
+
>
|
|
312
|
+
{content}
|
|
313
|
+
</KeyboardAvoidingView>
|
|
314
|
+
) : content}
|
|
315
|
+
</FormContext.Provider>
|
|
316
|
+
);
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
StyledForm.displayName = "StyledForm";
|
|
320
|
+
StyledForm.Row = Row;
|
|
321
|
+
StyledForm.Section = Section;
|
|
322
|
+
StyledForm.Actions = Actions;
|
|
323
|
+
StyledForm.Input = Input;
|
|
324
|
+
StyledForm.Checkbox = Checkbox;
|
|
325
|
+
StyledForm.Switch = FormSwitch;
|
|
326
|
+
StyledForm.Select = Select;
|
|
327
|
+
StyledForm.Radio = Radio;
|
|
328
|
+
StyledForm.DatePicker = DatePicker;
|
|
329
|
+
StyledForm.Slider = Slider;
|
|
330
|
+
|
|
331
|
+
export { StyledForm };
|