@mapples/ui 1.0.4 → 1.0.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/dist/components/form/FormView/FormView.d.ts +46 -0
- package/dist/components/form/FormView/FormView.d.ts.map +1 -0
- package/dist/components/form/FormView/FormView.js +38 -0
- package/dist/components/form/FormView/FormView.js.map +1 -0
- package/dist/components/form/FormView/index.d.ts +4 -0
- package/dist/components/form/FormView/index.d.ts.map +1 -0
- package/dist/components/form/FormView/index.js +4 -0
- package/dist/components/form/FormView/index.js.map +1 -0
- package/dist/components/form/FormView/schematics.d.ts +3 -0
- package/dist/components/form/FormView/schematics.d.ts.map +1 -0
- package/dist/components/form/FormView/schematics.js +6 -0
- package/dist/components/form/FormView/schematics.js.map +1 -0
- package/dist/components/form/SubmitButton/SubmitButton.d.ts +43 -0
- package/dist/components/form/SubmitButton/SubmitButton.d.ts.map +1 -0
- package/dist/components/form/SubmitButton/SubmitButton.js +35 -0
- package/dist/components/form/SubmitButton/SubmitButton.js.map +1 -0
- package/dist/components/form/SubmitButton/index.d.ts +5 -0
- package/dist/components/form/SubmitButton/index.d.ts.map +1 -0
- package/dist/components/form/SubmitButton/index.js +5 -0
- package/dist/components/form/SubmitButton/index.js.map +1 -0
- package/dist/components/form/SubmitButton/schematics.d.ts +11 -0
- package/dist/components/form/SubmitButton/schematics.d.ts.map +1 -0
- package/dist/components/form/SubmitButton/schematics.js +14 -0
- package/dist/components/form/SubmitButton/schematics.js.map +1 -0
- package/dist/components/form/TextField/TextField.d.ts +35 -0
- package/dist/components/form/TextField/TextField.d.ts.map +1 -0
- package/dist/components/form/TextField/TextField.js +36 -0
- package/dist/components/form/TextField/TextField.js.map +1 -0
- package/dist/components/form/TextField/index.d.ts +4 -0
- package/dist/components/form/TextField/index.d.ts.map +1 -0
- package/dist/components/form/TextField/index.js +4 -0
- package/dist/components/form/TextField/index.js.map +1 -0
- package/dist/components/form/TextField/schematics.d.ts +3 -0
- package/dist/components/form/TextField/schematics.d.ts.map +1 -0
- package/dist/components/form/TextField/schematics.js +6 -0
- package/dist/components/form/TextField/schematics.js.map +1 -0
- package/dist/components/form/index.d.ts +8 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +8 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/form/schematics.d.ts +3 -0
- package/dist/components/form/schematics.d.ts.map +1 -0
- package/dist/components/form/schematics.js +9 -0
- package/dist/components/form/schematics.js.map +1 -0
- package/dist/components/media/Image/Image.d.ts.map +1 -1
- package/dist/components/media/Image/Image.js +22 -3
- package/dist/components/media/Image/Image.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { WithStyledProps } from '@mapples/style';
|
|
3
|
+
import { ViewProps } from 'react-native';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Form View component.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export type FormViewProps = PropsWithChildren<WithStyledProps<ViewProps>> & {
|
|
10
|
+
initialValues?: any;
|
|
11
|
+
onSubmit?: (values: any) => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A customizable view component with built-in styling support.
|
|
15
|
+
*
|
|
16
|
+
* The View component extends React Native's View with additional styling
|
|
17
|
+
* capabilities through the @mapples/style system. It serves as a container
|
|
18
|
+
* for other UI elements and supports all standard view properties.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <FormView
|
|
23
|
+
* styled={{
|
|
24
|
+
* style: {
|
|
25
|
+
* backgroundColor: 'lightblue',
|
|
26
|
+
* padding: 16,
|
|
27
|
+
* borderRadius: 8
|
|
28
|
+
* }
|
|
29
|
+
* }}
|
|
30
|
+
* >
|
|
31
|
+
* <Text>Content inside the view</Text>
|
|
32
|
+
* </View>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
declare const FormView: import("react").ForwardRefExoticComponent<{
|
|
38
|
+
styled?: import("@mapples/style").StyledProps<Partial<ViewProps>> | undefined;
|
|
39
|
+
} & ViewProps & {
|
|
40
|
+
children?: import("react").ReactNode | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
initialValues?: any;
|
|
43
|
+
onSubmit?: (values: any) => void;
|
|
44
|
+
} & import("react").RefAttributes<unknown>>;
|
|
45
|
+
export default FormView;
|
|
46
|
+
//# sourceMappingURL=FormView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormView.d.ts","sourceRoot":"","sources":["../../../../src/components/form/FormView/FormView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,GAAG;IAC1E,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,QAAA,MAAM,QAAQ;;;;;oBA5BI,GAAG;eACR,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;2CA2CjC,CAAC;AAGF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { Form } from '@mapples/form';
|
|
3
|
+
import { StyledView } from '@mapples/style';
|
|
4
|
+
import { isObject } from 'lodash';
|
|
5
|
+
/**
|
|
6
|
+
* A customizable view component with built-in styling support.
|
|
7
|
+
*
|
|
8
|
+
* The View component extends React Native's View with additional styling
|
|
9
|
+
* capabilities through the @mapples/style system. It serves as a container
|
|
10
|
+
* for other UI elements and supports all standard view properties.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <FormView
|
|
15
|
+
* styled={{
|
|
16
|
+
* style: {
|
|
17
|
+
* backgroundColor: 'lightblue',
|
|
18
|
+
* padding: 16,
|
|
19
|
+
* borderRadius: 8
|
|
20
|
+
* }
|
|
21
|
+
* }}
|
|
22
|
+
* >
|
|
23
|
+
* <Text>Content inside the view</Text>
|
|
24
|
+
* </View>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
const FormView = forwardRef(({ styled, children, initialValues, onSubmit, ...props }, ref) => {
|
|
30
|
+
return (<Form initialValues={isObject(initialValues) ? initialValues : {}} onSubmit={onSubmit}>
|
|
31
|
+
<StyledView ref={ref} styled={{ ...styled }} {...props}>
|
|
32
|
+
{children}
|
|
33
|
+
</StyledView>
|
|
34
|
+
</Form>);
|
|
35
|
+
});
|
|
36
|
+
FormView.displayName = 'FormView';
|
|
37
|
+
export default FormView;
|
|
38
|
+
//# sourceMappingURL=FormView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormView.js","sourceRoot":"","sources":["../../../../src/components/form/FormView/FormView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAalC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,QAAQ,GAAG,UAAU,CACzB,CACE,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiB,EACtE,GAAG,EACH,EAAE;IACF,OAAO,CACL,CAAC,IAAI,CACH,aAAa,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAC5D,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAEnB;QAAA,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,CACrD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/FormView/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,cAAc,cAAc,CAAC;AAE7B,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/FormView/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,cAAc,cAAc,CAAC;AAE7B,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/form/FormView/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,eAAO,MAAM,iBAAiB,EAAE,mBAG/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/form/FormView/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAAwB;IACpD,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,QAAQ;CACpB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StyledProp, StyledProps } from '@mapples/style';
|
|
2
|
+
import { PressableProps, TextStyle, View } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the SubmitButton component.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface SubmitButtonProps extends PressableProps {
|
|
9
|
+
/** The text label to display on the button */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Styling configuration for the button and its typography */
|
|
12
|
+
styled?: StyledProps<PressableProps> & {
|
|
13
|
+
/** Typography-specific styling for the button label */
|
|
14
|
+
styleTypography?: StyledProp<TextStyle>;
|
|
15
|
+
};
|
|
16
|
+
/** Typography variant to apply to the button label */
|
|
17
|
+
typographyVariant?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A customizable button component with built-in styling support.
|
|
21
|
+
*
|
|
22
|
+
* The SubmitButton component extends React Native's Pressable with additional styling
|
|
23
|
+
* capabilities and typography support. It can display a text label and supports
|
|
24
|
+
* all standard pressable interactions.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <SubmitButton
|
|
29
|
+
* label="Click me"
|
|
30
|
+
* styled={{
|
|
31
|
+
* style: { backgroundColor: 'blue', padding: 16 },
|
|
32
|
+
* styleTypography: { color: 'white', fontSize: 16 }
|
|
33
|
+
* }}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
declare const SubmitButton: import("react").ForwardRefExoticComponent<SubmitButtonProps & {
|
|
40
|
+
children?: import("react").ReactNode | undefined;
|
|
41
|
+
} & import("react").RefAttributes<View>>;
|
|
42
|
+
export default SubmitButton;
|
|
43
|
+
//# sourceMappingURL=SubmitButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton.d.ts","sourceRoot":"","sources":["../../../../src/components/form/SubmitButton/SubmitButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,UAAU,EACV,WAAW,EAEZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,MAAM,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG;QACrC,uDAAuD;QACvD,eAAe,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;KACzC,CAAC;IACF,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,YAAY;;wCAuBjB,CAAC;AAGF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { useFormSubmit } from '@mapples/form';
|
|
3
|
+
import { StyledPressable, Typography, } from '@mapples/style';
|
|
4
|
+
/**
|
|
5
|
+
* A customizable button component with built-in styling support.
|
|
6
|
+
*
|
|
7
|
+
* The SubmitButton component extends React Native's Pressable with additional styling
|
|
8
|
+
* capabilities and typography support. It can display a text label and supports
|
|
9
|
+
* all standard pressable interactions.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <SubmitButton
|
|
14
|
+
* label="Click me"
|
|
15
|
+
* styled={{
|
|
16
|
+
* style: { backgroundColor: 'blue', padding: 16 },
|
|
17
|
+
* styleTypography: { color: 'white', fontSize: 16 }
|
|
18
|
+
* }}
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
const SubmitButton = forwardRef(({ label, styled = {}, typographyVariant, ...props }, ref) => {
|
|
25
|
+
const { styleTypography, ...styledPressableProps } = styled;
|
|
26
|
+
const { submitForm } = useFormSubmit();
|
|
27
|
+
return (<StyledPressable ref={ref} styled={styledPressableProps} {...props} onPress={submitForm}>
|
|
28
|
+
{label && (<Typography style={styled?.styleTypography} variant={typographyVariant}>
|
|
29
|
+
{label}
|
|
30
|
+
</Typography>)}
|
|
31
|
+
</StyledPressable>);
|
|
32
|
+
});
|
|
33
|
+
SubmitButton.displayName = 'SubmitButton';
|
|
34
|
+
export default SubmitButton;
|
|
35
|
+
//# sourceMappingURL=SubmitButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../../../src/components/form/SubmitButton/SubmitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EACL,eAAe,EAGf,UAAU,GACX,MAAM,gBAAgB,CAAC;AAoBxB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,YAAY,GAAG,UAAU,CAC7B,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,iBAAiB,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3D,MAAM,EAAE,eAAe,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,CAAC;IAC5D,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,CAAC;IAEvC,OAAO,CACL,CAAC,eAAe,CACd,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,MAAM,CAAC,CAAC,oBAAoB,CAAC,CAC7B,IAAI,KAAK,CAAC,CACV,OAAO,CAAC,CAAC,UAAU,CAAC,CAEpB;QAAA,CAAC,KAAK,IAAI,CACR,CAAC,UAAU,CACT,KAAK,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAC/B,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAE3B;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,UAAU,CAAC,CACd,CACH;MAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CACF,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/SubmitButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAE/B,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/SubmitButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAE/B,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RegisteredComponent } from '@mapples/types';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic configuration for the Button component.
|
|
4
|
+
*
|
|
5
|
+
* This configuration defines how the Button component appears in visual editors,
|
|
6
|
+
* including its properties, styling options, and default values.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare const SubmitButtonSchematic: RegisteredComponent;
|
|
11
|
+
//# sourceMappingURL=schematics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/form/SubmitButton/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAGnC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import SubmitButton from './SubmitButton';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic configuration for the Button component.
|
|
4
|
+
*
|
|
5
|
+
* This configuration defines how the Button component appears in visual editors,
|
|
6
|
+
* including its properties, styling options, and default values.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export const SubmitButtonSchematic = {
|
|
11
|
+
type: 'SubmitButton',
|
|
12
|
+
Component: SubmitButton,
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=schematics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/form/SubmitButton/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,YAAY;CACxB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TextInputProps, TextInput } from 'react-native';
|
|
2
|
+
export interface TextFieldProps extends Omit<TextInputProps, 'onChangeText'> {
|
|
3
|
+
fieldName?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A customizable text input component with built-in styling support.
|
|
7
|
+
*
|
|
8
|
+
* The TextField component extends React Native's TextInput with additional styling
|
|
9
|
+
* capabilities through the @mapples/style system. It supports all standard
|
|
10
|
+
* TextField properties and behaviors.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <TextField
|
|
15
|
+
* placeholder="Enter your text"
|
|
16
|
+
* value={text}
|
|
17
|
+
* onChangeText={setText}
|
|
18
|
+
* styled={{
|
|
19
|
+
* style: {
|
|
20
|
+
* borderWidth: 1,
|
|
21
|
+
* borderColor: 'gray',
|
|
22
|
+
* padding: 12,
|
|
23
|
+
* borderRadius: 8
|
|
24
|
+
* }
|
|
25
|
+
* }}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & {
|
|
32
|
+
children?: import("react").ReactNode | undefined;
|
|
33
|
+
} & import("react").RefAttributes<TextInput>>;
|
|
34
|
+
export default TextField;
|
|
35
|
+
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/components/form/TextField/TextField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,SAAS;;6CAiBd,CAAC;AAGF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { useFormField } from '@mapples/form';
|
|
3
|
+
import { StyledTextInput } from '@mapples/style';
|
|
4
|
+
/**
|
|
5
|
+
* A customizable text input component with built-in styling support.
|
|
6
|
+
*
|
|
7
|
+
* The TextField component extends React Native's TextInput with additional styling
|
|
8
|
+
* capabilities through the @mapples/style system. It supports all standard
|
|
9
|
+
* TextField properties and behaviors.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <TextField
|
|
14
|
+
* placeholder="Enter your text"
|
|
15
|
+
* value={text}
|
|
16
|
+
* onChangeText={setText}
|
|
17
|
+
* styled={{
|
|
18
|
+
* style: {
|
|
19
|
+
* borderWidth: 1,
|
|
20
|
+
* borderColor: 'gray',
|
|
21
|
+
* padding: 12,
|
|
22
|
+
* borderRadius: 8
|
|
23
|
+
* }
|
|
24
|
+
* }}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
const TextField = forwardRef(({ children, fieldName, ...props }, ref) => {
|
|
31
|
+
const { value, setValue } = useFormField(fieldName || 'unknown', '', true);
|
|
32
|
+
return (<StyledTextInput ref={ref} {...props} value={value || ''} onChangeText={setValue}/>);
|
|
33
|
+
});
|
|
34
|
+
TextField.displayName = 'TextField';
|
|
35
|
+
export default TextField;
|
|
36
|
+
//# sourceMappingURL=TextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../../src/components/form/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,SAAS,GAAG,UAAU,CAC1B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,YAAY,CACtC,SAAS,IAAI,SAAS,EACtB,EAAE,EACF,IAAI,CACL,CAAC;IAEF,OAAO,CACL,CAAC,eAAe,CACd,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CACnB,YAAY,CAAC,CAAC,QAAQ,CAAC,EACvB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,cAAc,cAAc,CAAC;AAE7B,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,cAAc,cAAc,CAAC;AAE7B,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/form/TextField/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,eAAO,MAAM,mBAAmB,EAAE,mBAGjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/form/TextField/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACtD,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,SAAS;CACrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as SubmitButton } from './SubmitButton';
|
|
2
|
+
export * from './SubmitButton';
|
|
3
|
+
export { default as TextField } from './TextField';
|
|
4
|
+
export * from './TextField';
|
|
5
|
+
export { default as FormView } from './FormView';
|
|
6
|
+
export * from './FormView';
|
|
7
|
+
export * from './schematics';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,YAAY,CAAC;AAE3B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as SubmitButton } from './SubmitButton';
|
|
2
|
+
export * from './SubmitButton';
|
|
3
|
+
export { default as TextField } from './TextField';
|
|
4
|
+
export * from './TextField';
|
|
5
|
+
export { default as FormView } from './FormView';
|
|
6
|
+
export * from './FormView';
|
|
7
|
+
export * from './schematics';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,YAAY,CAAC;AAE3B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../src/components/form/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAMtD,eAAO,MAAM,cAAc,EAAE,oBAI5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormViewSchematic } from './FormView';
|
|
2
|
+
import { SubmitButtonSchematic } from './SubmitButton';
|
|
3
|
+
import { TextFieldSchematics } from './TextField';
|
|
4
|
+
export const FormSchematics = {
|
|
5
|
+
[FormViewSchematic.type]: FormViewSchematic,
|
|
6
|
+
[TextFieldSchematics.type]: TextFieldSchematics,
|
|
7
|
+
[SubmitButtonSchematic.type]: SubmitButtonSchematic,
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=schematics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../src/components/form/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,iBAAiB;IAC3C,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,mBAAmB;IAC/C,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,qBAAqB;CACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/media/Image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAEL,UAAU,EACV,WAAW,
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/media/Image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAEL,UAAU,EACV,WAAW,EAIX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAsB,UAAU,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,iBAAiB,CACxC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,GAAG;IAChD,qEAAqE;IACrE,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG;QAChC,6BAA6B;QAC7B,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,gBAAgB,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;KAChD,CAAC;IACF,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,KAAK;IAxCP,qEAAqE;aAC5D,WAAW,CAAC,SAAS,CAAC,GAAG;QAChC,6BAA6B;QAC7B,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,gBAAgB,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;KAChD;IACD,4CAA4C;iBAC/B,MAAM;;;2CAyDtB,CAAC;AAkBF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import { styled, StyledView, } from '@mapples/style';
|
|
2
|
+
import { styled, StyledView, Styler, Typography, } from '@mapples/style';
|
|
3
3
|
import { Image as ExpoImage } from 'expo-image';
|
|
4
4
|
const StyledExpoImage = styled(ExpoImage);
|
|
5
5
|
/**
|
|
@@ -29,12 +29,31 @@ const StyledExpoImage = styled(ExpoImage);
|
|
|
29
29
|
*
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
|
-
const Image = forwardRef(({ styled, source, dataSource, ...props }, ref) => {
|
|
32
|
+
const Image = forwardRef(({ styled, source, dataSource, alt, ...props }, ref) => {
|
|
33
33
|
const { styleImage, styledImageProps, ...styledProps } = styled || {};
|
|
34
|
+
const image = dataSource || source;
|
|
34
35
|
return (<StyledView ref={ref} styled={styledProps}>
|
|
35
|
-
<StyledExpoImage source={
|
|
36
|
+
{!!image ? (<StyledExpoImage source={image} styled={{ style: styleImage, ...(styledImageProps || {}) }} {...props}/>) : (<StyledView styled={{ style: styler.imagePlaceholder }}>
|
|
37
|
+
<Typography style={styler.imagePlaceholderText}>
|
|
38
|
+
{alt || 'IMAGE'}
|
|
39
|
+
</Typography>
|
|
40
|
+
</StyledView>)}
|
|
36
41
|
</StyledView>);
|
|
37
42
|
});
|
|
38
43
|
Image.displayName = 'Image';
|
|
44
|
+
const styler = Styler.create({
|
|
45
|
+
imagePlaceholder: {
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '100%',
|
|
48
|
+
backgroundColor: '#eee',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
},
|
|
52
|
+
imagePlaceholderText: {
|
|
53
|
+
fontSize: 24,
|
|
54
|
+
fontWeight: 'bold',
|
|
55
|
+
color: '#fafafa',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
39
58
|
export default Image;
|
|
40
59
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../src/components/media/Image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,MAAM,EAGN,UAAU,GAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAgC,MAAM,YAAY,CAAC;AAqB9E,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,KAAK,GAAG,UAAU,CACtB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAc,EAAE,GAAG,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../src/components/media/Image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,MAAM,EAGN,UAAU,EACV,MAAM,EACN,UAAU,GAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAgC,MAAM,YAAY,CAAC;AAqB9E,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,KAAK,GAAG,UAAU,CACtB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,KAAK,EAAc,EAAE,GAAG,EAAE,EAAE;IACjE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,WAAW,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;IAEtE,MAAM,KAAK,GAAG,UAAU,IAAI,MAAM,CAAC;IAEnC,OAAO,CACL,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CACxC;QAAA,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CACT,CAAC,eAAe,CACd,MAAM,CAAC,CAAC,KAAK,CAAC,CACd,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,EAAE,CAAC,CAC3D,IAAI,KAAK,CAAC,EACV,CACH,CAAC,CAAC,CAAC,CACF,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CACrD;YAAA,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAC7C;cAAA,CAAC,GAAG,IAAI,OAAO,CACjB;YAAA,EAAE,UAAU,CACd;UAAA,EAAE,UAAU,CAAC,CACd,CACH;MAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,MAAM;QACvB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,oBAAoB,EAAE;QACpB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|