@mapples/ui 1.1.0 → 1.1.2
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 +0 -32
- package/dist/components/form/FormView/FormView.d.ts +16 -9
- package/dist/components/form/FormView/FormView.d.ts.map +1 -1
- package/dist/components/form/FormView/FormView.js +11 -8
- package/dist/components/form/FormView/FormView.js.map +1 -1
- package/dist/components/form/FormView/schematics.d.ts +8 -0
- package/dist/components/form/FormView/schematics.d.ts.map +1 -1
- package/dist/components/form/FormView/schematics.js +8 -0
- package/dist/components/form/FormView/schematics.js.map +1 -1
- package/dist/components/form/SubmitButton/schematics.d.ts +2 -2
- package/dist/components/form/SubmitButton/schematics.js +2 -2
- package/dist/components/form/TextField/TextField.d.ts +21 -17
- package/dist/components/form/TextField/TextField.d.ts.map +1 -1
- package/dist/components/form/TextField/TextField.js +13 -18
- package/dist/components/form/TextField/TextField.js.map +1 -1
- package/dist/components/form/TextField/schematics.d.ts +8 -0
- package/dist/components/form/TextField/schematics.d.ts.map +1 -1
- package/dist/components/form/TextField/schematics.js +8 -0
- package/dist/components/form/TextField/schematics.js.map +1 -1
- package/dist/components/form/schematics.d.ts +9 -0
- package/dist/components/form/schematics.d.ts.map +1 -1
- package/dist/components/form/schematics.js +9 -0
- package/dist/components/form/schematics.js.map +1 -1
- package/dist/components/inputs/IconButton/MockIcon.d.ts.map +1 -1
- package/dist/components/inputs/IconButton/MockIcon.js +8 -0
- package/dist/components/inputs/IconButton/MockIcon.js.map +1 -1
- package/dist/components/inputs/IconButton/schematics.d.ts +8 -0
- package/dist/components/inputs/IconButton/schematics.d.ts.map +1 -1
- package/dist/components/inputs/IconButton/schematics.js +8 -0
- package/dist/components/inputs/IconButton/schematics.js.map +1 -1
- package/dist/components/inputs/Pressable/Pressable.d.ts +26 -0
- package/dist/components/inputs/Pressable/Pressable.d.ts.map +1 -1
- package/dist/components/inputs/Pressable/Pressable.js +18 -0
- package/dist/components/inputs/Pressable/Pressable.js.map +1 -1
- package/dist/components/inputs/Pressable/schematics.d.ts +8 -0
- package/dist/components/inputs/Pressable/schematics.d.ts.map +1 -1
- package/dist/components/inputs/Pressable/schematics.js +8 -0
- package/dist/components/inputs/Pressable/schematics.js.map +1 -1
- package/dist/components/inputs/Select/Select.d.ts +30 -0
- package/dist/components/inputs/Select/Select.d.ts.map +1 -1
- package/dist/components/inputs/Select/Select.js +19 -0
- package/dist/components/inputs/Select/Select.js.map +1 -1
- package/dist/components/inputs/Select/SelectItem.d.ts +23 -0
- package/dist/components/inputs/Select/SelectItem.d.ts.map +1 -1
- package/dist/components/inputs/Select/SelectItem.js +16 -0
- package/dist/components/inputs/Select/SelectItem.js.map +1 -1
- package/dist/components/inputs/Select/schematics.d.ts +8 -0
- package/dist/components/inputs/Select/schematics.d.ts.map +1 -1
- package/dist/components/inputs/Select/schematics.js +8 -0
- package/dist/components/inputs/Select/schematics.js.map +1 -1
- package/dist/components/inputs/TextInput/schematics.d.ts +8 -0
- package/dist/components/inputs/TextInput/schematics.d.ts.map +1 -1
- package/dist/components/inputs/TextInput/schematics.js +8 -0
- package/dist/components/inputs/TextInput/schematics.js.map +1 -1
- package/dist/components/inputs/schematics.d.ts +9 -0
- package/dist/components/inputs/schematics.d.ts.map +1 -1
- package/dist/components/inputs/schematics.js +9 -0
- package/dist/components/inputs/schematics.js.map +1 -1
- package/dist/components/media/BarCode/BarCode.d.ts.map +1 -1
- package/dist/components/media/BarCode/BarCode.js +0 -8
- package/dist/components/media/BarCode/BarCode.js.map +1 -1
- package/dist/components/media/BarCode/schematics.d.ts +8 -0
- package/dist/components/media/BarCode/schematics.d.ts.map +1 -1
- package/dist/components/media/BarCode/schematics.js +8 -0
- package/dist/components/media/BarCode/schematics.js.map +1 -1
- package/dist/components/media/Icon/Icon.d.ts +34 -0
- package/dist/components/media/Icon/Icon.d.ts.map +1 -1
- package/dist/components/media/Icon/Icon.js +23 -0
- package/dist/components/media/Icon/Icon.js.map +1 -1
- package/dist/components/media/Icon/MockIcon.d.ts.map +1 -1
- package/dist/components/media/Icon/MockIcon.js +9 -0
- package/dist/components/media/Icon/MockIcon.js.map +1 -1
- package/dist/components/media/Icon/schematics.d.ts +8 -0
- package/dist/components/media/Icon/schematics.d.ts.map +1 -1
- package/dist/components/media/Icon/schematics.js +8 -0
- package/dist/components/media/Icon/schematics.js.map +1 -1
- package/dist/components/media/Image/Image.d.ts +2 -0
- package/dist/components/media/Image/Image.d.ts.map +1 -1
- package/dist/components/media/Image/Image.js.map +1 -1
- package/dist/components/media/Image/schematics.d.ts +8 -0
- package/dist/components/media/Image/schematics.d.ts.map +1 -1
- package/dist/components/media/Image/schematics.js +8 -0
- package/dist/components/media/Image/schematics.js.map +1 -1
- package/dist/components/media/QRCode/schematics.d.ts +8 -0
- package/dist/components/media/QRCode/schematics.d.ts.map +1 -1
- package/dist/components/media/QRCode/schematics.js +8 -0
- package/dist/components/media/QRCode/schematics.js.map +1 -1
- package/dist/components/media/Svg/Svg.d.ts.map +1 -1
- package/dist/components/media/Svg/Svg.js +1 -1
- package/dist/components/media/Svg/Svg.js.map +1 -1
- package/dist/components/media/Svg/schematics.d.ts +8 -0
- package/dist/components/media/Svg/schematics.d.ts.map +1 -1
- package/dist/components/media/Svg/schematics.js +8 -0
- package/dist/components/media/Svg/schematics.js.map +1 -1
- package/dist/components/media/Video/Video.d.ts +44 -0
- package/dist/components/media/Video/Video.d.ts.map +1 -1
- package/dist/components/media/Video/Video.js +25 -0
- package/dist/components/media/Video/Video.js.map +1 -1
- package/dist/components/media/Video/schematics.d.ts +8 -0
- package/dist/components/media/Video/schematics.d.ts.map +1 -1
- package/dist/components/media/Video/schematics.js +8 -0
- package/dist/components/media/Video/schematics.js.map +1 -1
- package/dist/components/media/schematics.d.ts +9 -0
- package/dist/components/media/schematics.d.ts.map +1 -1
- package/dist/components/media/schematics.js +9 -0
- package/dist/components/media/schematics.js.map +1 -1
- package/dist/components/typography/Text/Text.d.ts +14 -17
- package/dist/components/typography/Text/Text.d.ts.map +1 -1
- package/dist/components/typography/Text/Text.js +17 -18
- package/dist/components/typography/Text/Text.js.map +1 -1
- package/dist/components/typography/Text/schematics.d.ts +8 -0
- package/dist/components/typography/Text/schematics.d.ts.map +1 -1
- package/dist/components/typography/Text/schematics.js +8 -0
- package/dist/components/typography/Text/schematics.js.map +1 -1
- package/dist/components/typography/Typography/Typography.d.ts +27 -0
- package/dist/components/typography/Typography/Typography.d.ts.map +1 -1
- package/dist/components/typography/Typography/Typography.js +20 -0
- package/dist/components/typography/Typography/Typography.js.map +1 -1
- package/dist/components/typography/Typography/schematics.d.ts +8 -0
- package/dist/components/typography/Typography/schematics.d.ts.map +1 -1
- package/dist/components/typography/Typography/schematics.js +8 -0
- package/dist/components/typography/Typography/schematics.js.map +1 -1
- package/dist/components/typography/schematics.d.ts +9 -0
- package/dist/components/typography/schematics.d.ts.map +1 -1
- package/dist/components/typography/schematics.js +9 -0
- package/dist/components/typography/schematics.js.map +1 -1
- package/dist/components/views/FlatList/FlatList.d.ts +12 -0
- package/dist/components/views/FlatList/FlatList.d.ts.map +1 -1
- package/dist/components/views/FlatList/FlatList.js +24 -0
- package/dist/components/views/FlatList/FlatList.js.map +1 -1
- package/dist/components/views/FlatList/schematics.d.ts +20 -0
- package/dist/components/views/FlatList/schematics.d.ts.map +1 -1
- package/dist/components/views/FlatList/schematics.js +20 -0
- package/dist/components/views/FlatList/schematics.js.map +1 -1
- package/dist/components/views/GradientBackground/GradientBackground.d.ts +52 -0
- package/dist/components/views/GradientBackground/GradientBackground.d.ts.map +1 -0
- package/dist/components/views/GradientBackground/GradientBackground.js +41 -0
- package/dist/components/views/GradientBackground/GradientBackground.js.map +1 -0
- package/dist/components/views/GradientBackground/GradientLayer.d.ts +39 -0
- package/dist/components/views/GradientBackground/GradientLayer.d.ts.map +1 -0
- package/dist/components/views/GradientBackground/GradientLayer.js +51 -0
- package/dist/components/views/GradientBackground/GradientLayer.js.map +1 -0
- package/dist/components/views/GradientBackground/index.d.ts +7 -0
- package/dist/components/views/GradientBackground/index.d.ts.map +1 -0
- package/dist/components/views/GradientBackground/index.js +7 -0
- package/dist/components/views/GradientBackground/index.js.map +1 -0
- package/dist/components/views/GradientBackground/schematics.d.ts +13 -0
- package/dist/components/views/GradientBackground/schematics.d.ts.map +1 -0
- package/dist/components/views/GradientBackground/schematics.js +16 -0
- package/dist/components/views/GradientBackground/schematics.js.map +1 -0
- package/dist/components/views/ImageBackgroundView/ImageBackgroundView.d.ts +40 -0
- package/dist/components/views/ImageBackgroundView/ImageBackgroundView.d.ts.map +1 -1
- package/dist/components/views/ImageBackgroundView/ImageBackgroundView.js +24 -0
- package/dist/components/views/ImageBackgroundView/ImageBackgroundView.js.map +1 -1
- package/dist/components/views/ImageBackgroundView/schematics.d.ts +5 -0
- package/dist/components/views/ImageBackgroundView/schematics.d.ts.map +1 -1
- package/dist/components/views/ImageBackgroundView/schematics.js +5 -0
- package/dist/components/views/ImageBackgroundView/schematics.js.map +1 -1
- package/dist/components/views/SafeAreaView/SafeAreaView.d.ts +29 -0
- package/dist/components/views/SafeAreaView/SafeAreaView.d.ts.map +1 -1
- package/dist/components/views/SafeAreaView/SafeAreaView.js +24 -0
- package/dist/components/views/SafeAreaView/SafeAreaView.js.map +1 -1
- package/dist/components/views/SafeAreaView/schematics.d.ts +5 -0
- package/dist/components/views/SafeAreaView/schematics.d.ts.map +1 -1
- package/dist/components/views/SafeAreaView/schematics.js +5 -0
- package/dist/components/views/SafeAreaView/schematics.js.map +1 -1
- package/dist/components/views/ScrollView/schematics.d.ts +10 -0
- package/dist/components/views/ScrollView/schematics.d.ts.map +1 -1
- package/dist/components/views/ScrollView/schematics.js +10 -0
- package/dist/components/views/ScrollView/schematics.js.map +1 -1
- package/dist/components/views/View/View.d.ts +16 -1
- package/dist/components/views/View/View.d.ts.map +1 -1
- package/dist/components/views/View/View.js +5 -3
- package/dist/components/views/View/View.js.map +1 -1
- package/dist/components/views/View/schematics.d.ts +13 -0
- package/dist/components/views/View/schematics.d.ts.map +1 -1
- package/dist/components/views/View/schematics.js +13 -0
- package/dist/components/views/View/schematics.js.map +1 -1
- package/dist/components/views/index.d.ts +2 -0
- package/dist/components/views/index.d.ts.map +1 -1
- package/dist/components/views/index.js +2 -0
- package/dist/components/views/index.js.map +1 -1
- package/dist/components/views/schematics.d.ts +11 -0
- package/dist/components/views/schematics.d.ts.map +1 -1
- package/dist/components/views/schematics.js +11 -0
- package/dist/components/views/schematics.js.map +1 -1
- package/package.json +7 -1
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { forwardRef, Fragment } from 'react';
|
|
2
2
|
import StateProvider from '@mapples/state';
|
|
3
3
|
import { StyledFlatList, StyledView } from '@mapples/style';
|
|
4
|
+
/**
|
|
5
|
+
* A data-driven list component with built-in styling support.
|
|
6
|
+
*
|
|
7
|
+
* `FlatList` renders a scrollable list of items from the `data` prop, wrapping
|
|
8
|
+
* each item in a `StateProvider` so that child components can access item state
|
|
9
|
+
* directly. The outer container and the inner list accept independent `styled`
|
|
10
|
+
* entries, enabling separate layout and scroll-area styling.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <FlatList
|
|
15
|
+
* data={items}
|
|
16
|
+
* styled={{
|
|
17
|
+
* style: { flex: 1, backgroundColor: 'white' },
|
|
18
|
+
* styleList: { paddingHorizontal: 16 },
|
|
19
|
+
* contentContainerStyle: { paddingBottom: 32 },
|
|
20
|
+
* }}
|
|
21
|
+
* >
|
|
22
|
+
* <Text text="item name" />
|
|
23
|
+
* </FlatList>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
4
28
|
const FlatListComponent = forwardRef(({ styled, children, ...props }, ref) => {
|
|
5
29
|
const containerStyled = { style: styled?.style };
|
|
6
30
|
const listStyled = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatList.js","sourceRoot":"","sources":["../../../../src/components/views/FlatList/FlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAEhE,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"FlatList.js","sourceRoot":"","sources":["../../../../src/components/views/FlatList/FlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAEhE,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA2BxE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,iBAAiB,GAAG,UAAU,CAClC,CACE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB,EAChD,GAAgB,EAChB,EAAE;IACF,MAAM,eAAe,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAS,CAAC;IACxD,MAAM,UAAU,GAAG;QACjB,KAAK,EAAE,MAAM,EAAE,SAAS;QACxB,qBAAqB,EAAE,MAAM,EAAE,qBAAqB;QACpD,kBAAkB,EAAG,MAAc,EAAE,kBAAkB;KACjD,CAAC;IAET,MAAM,UAAU,GAAwB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QACnD,OAAO,CACL,CAAC,QAAQ,CACP;UAAA,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,aAAa,CACvD;QAAA,EAAE,QAAQ,CAAC,CACZ,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAC5C;QAAA,CAAC,cAAc,CACb,IAAK,KAAa,CAAC,CACnB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,MAAM,CAAC,CAAC,UAAU,CAAC,EAEvB;MAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AACF,iBAAiB,CAAC,WAAW,GAAG,UAAU,CAAC;AAE3C,MAAM,cAAc,GAAG,iBAEN,CAAC;AAElB,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { RegisteredComponent } from '@mapples/types';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic configuration for the FlatList component.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
2
7
|
export declare const FlatListSchematic: RegisteredComponent;
|
|
8
|
+
/**
|
|
9
|
+
* Schematic configuration for a two-column grid layout backed by FlatList.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
3
13
|
export declare const GridTwoColumnsSchematic: RegisteredComponent;
|
|
14
|
+
/**
|
|
15
|
+
* Schematic configuration for a three-column grid layout backed by FlatList.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
4
19
|
export declare const GridThreeColumnsSchematic: RegisteredComponent;
|
|
20
|
+
/**
|
|
21
|
+
* Schematic configuration for a four-column grid layout backed by FlatList.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
5
25
|
export declare const GridFourColumnsSchematic: RegisteredComponent;
|
|
6
26
|
//# sourceMappingURL=schematics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/views/FlatList/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,eAAO,MAAM,iBAAiB,EAAE,mBAG/B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,mBAGvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,mBAGtC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/views/FlatList/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,mBAG/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,mBAGvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,mBAGtC,CAAC"}
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
import FlatList from './FlatList';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic configuration for the FlatList component.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
2
7
|
export const FlatListSchematic = {
|
|
3
8
|
type: 'FlatList',
|
|
4
9
|
Component: FlatList,
|
|
5
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Schematic configuration for a two-column grid layout backed by FlatList.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
6
16
|
export const GridTwoColumnsSchematic = {
|
|
7
17
|
...FlatListSchematic,
|
|
8
18
|
type: 'GridTwoColumns',
|
|
9
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Schematic configuration for a three-column grid layout backed by FlatList.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
10
25
|
export const GridThreeColumnsSchematic = {
|
|
11
26
|
...FlatListSchematic,
|
|
12
27
|
type: 'GridThreeColumns',
|
|
13
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Schematic configuration for a four-column grid layout backed by FlatList.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
14
34
|
export const GridFourColumnsSchematic = {
|
|
15
35
|
...FlatListSchematic,
|
|
16
36
|
type: 'GridFourColumns',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/views/FlatList/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAAwB;IACpD,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,QAA0B;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAwB;IAC1D,GAAG,iBAAiB;IACpB,IAAI,EAAE,gBAAgB;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAwB;IAC5D,GAAG,iBAAiB;IACpB,IAAI,EAAE,kBAAkB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IAC3D,GAAG,iBAAiB;IACpB,IAAI,EAAE,iBAAiB;CACxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/views/FlatList/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAwB;IACpD,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,QAA0B;CACtC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAwB;IAC1D,GAAG,iBAAiB;IACpB,IAAI,EAAE,gBAAgB;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAwB;IAC5D,GAAG,iBAAiB;IACpB,IAAI,EAAE,kBAAkB;CACzB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IAC3D,GAAG,iBAAiB;IACpB,IAAI,EAAE,iBAAiB;CACxB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { WithStyledProps } from '@mapples/style';
|
|
3
|
+
import type { LinearGradient } from '@mapples/types';
|
|
4
|
+
import { ViewProps as RNViewProps } from 'react-native';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the GradientBackground component.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type GradientBackgroundProps = PropsWithChildren<WithStyledProps<RNViewProps> & {
|
|
11
|
+
/** The linear gradient painted behind the container's children. */
|
|
12
|
+
gradient?: LinearGradient;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* A container view with a linear-gradient background.
|
|
16
|
+
*
|
|
17
|
+
* Mirrors `ImageBackgroundView`: it `forwardRef`s to a native `View` (via
|
|
18
|
+
* `StyledView`) so the canvas can measure it (`measureInWindow`) and make it
|
|
19
|
+
* selectable, paints the gradient as a full-bleed layer beneath its children,
|
|
20
|
+
* and is sized by its own `styled.style`. Falls back to the solid
|
|
21
|
+
* `backgroundColor` when no gradient is present or unrenderable.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <GradientBackground
|
|
26
|
+
* gradient={{
|
|
27
|
+
* type: 'linear',
|
|
28
|
+
* stops: [
|
|
29
|
+
* { color: '#FF5C35', position: 0 },
|
|
30
|
+
* { color: '#FFC53D', position: 1 },
|
|
31
|
+
* ],
|
|
32
|
+
* start: { x: 0, y: 0 },
|
|
33
|
+
* end: { x: 1, y: 1 },
|
|
34
|
+
* }}
|
|
35
|
+
* styled={{ style: { width: 150, height: 150, overflow: 'hidden' } }}
|
|
36
|
+
* >
|
|
37
|
+
* <Text text="On gradient" />
|
|
38
|
+
* </GradientBackground>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
declare const GradientBackground: import("react").ForwardRefExoticComponent<{
|
|
44
|
+
styled?: import("@mapples/style").StyledProps<Partial<RNViewProps>> | undefined;
|
|
45
|
+
} & RNViewProps & {
|
|
46
|
+
/** The linear gradient painted behind the container's children. */
|
|
47
|
+
gradient?: LinearGradient;
|
|
48
|
+
} & {
|
|
49
|
+
children?: import("react").ReactNode | undefined;
|
|
50
|
+
} & import("react").RefAttributes<unknown>>;
|
|
51
|
+
export default GradientBackground;
|
|
52
|
+
//# sourceMappingURL=GradientBackground.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientBackground.d.ts","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/GradientBackground.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAIxD;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CACrD,eAAe,CAAC,WAAW,CAAC,GAAG;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,QAAA,MAAM,kBAAkB;;;IAlCpB,mEAAmE;eACxD,cAAc;;;2CA0C5B,CAAC;AAGF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { StyledView } from '@mapples/style';
|
|
3
|
+
import GradientLayer from './GradientLayer';
|
|
4
|
+
/**
|
|
5
|
+
* A container view with a linear-gradient background.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors `ImageBackgroundView`: it `forwardRef`s to a native `View` (via
|
|
8
|
+
* `StyledView`) so the canvas can measure it (`measureInWindow`) and make it
|
|
9
|
+
* selectable, paints the gradient as a full-bleed layer beneath its children,
|
|
10
|
+
* and is sized by its own `styled.style`. Falls back to the solid
|
|
11
|
+
* `backgroundColor` when no gradient is present or unrenderable.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <GradientBackground
|
|
16
|
+
* gradient={{
|
|
17
|
+
* type: 'linear',
|
|
18
|
+
* stops: [
|
|
19
|
+
* { color: '#FF5C35', position: 0 },
|
|
20
|
+
* { color: '#FFC53D', position: 1 },
|
|
21
|
+
* ],
|
|
22
|
+
* start: { x: 0, y: 0 },
|
|
23
|
+
* end: { x: 1, y: 1 },
|
|
24
|
+
* }}
|
|
25
|
+
* styled={{ style: { width: 150, height: 150, overflow: 'hidden' } }}
|
|
26
|
+
* >
|
|
27
|
+
* <Text text="On gradient" />
|
|
28
|
+
* </GradientBackground>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
const GradientBackground = forwardRef(({ styled, children, gradient, ...props }, ref) => {
|
|
34
|
+
return (<StyledView ref={ref} styled={{ ...styled }} {...props}>
|
|
35
|
+
<GradientLayer gradient={gradient}/>
|
|
36
|
+
{children}
|
|
37
|
+
</StyledView>);
|
|
38
|
+
});
|
|
39
|
+
GradientBackground.displayName = 'GradientBackground';
|
|
40
|
+
export default GradientBackground;
|
|
41
|
+
//# sourceMappingURL=GradientBackground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientBackground.js","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/GradientBackground.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAI7D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAc5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,kBAAkB,GAAG,UAAU,CACnC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA2B,EAAE,GAAG,EAAE,EAAE;IACzE,OAAO,CACL,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,CACrD;QAAA,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAClC;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AACF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { LinearGradient as LinearGradientData } from '@mapples/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link GradientLayer}.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface GradientLayerProps {
|
|
8
|
+
/** The gradient payload from a node's `props.gradient`. */
|
|
9
|
+
gradient?: LinearGradientData;
|
|
10
|
+
/**
|
|
11
|
+
* Corner radius to clip the gradient layer to, matching the host container's
|
|
12
|
+
* `borderRadius`. Optional — when omitted, the host must set
|
|
13
|
+
* `overflow: 'hidden'` for the gradient to respect rounded corners.
|
|
14
|
+
*/
|
|
15
|
+
borderRadius?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a linear gradient as an absolutely-positioned fill layer that a
|
|
19
|
+
* container paints behind its children. This is an **internal layer**, not a
|
|
20
|
+
* standalone canvas component — it has no ref and no intrinsic size. Containers
|
|
21
|
+
* (`View`, `GradientBackground`) mount it as their first child.
|
|
22
|
+
*
|
|
23
|
+
* React Native has no native gradient style, so a gradient travels as data on
|
|
24
|
+
* `props.gradient` (see `@mapples/types`' `LinearGradient`) and is painted here.
|
|
25
|
+
* The layer is `pointerEvents="none"` so it never intercepts touches.
|
|
26
|
+
*
|
|
27
|
+
* Degrades to `null` (the container keeps its solid `backgroundColor`) when:
|
|
28
|
+
* - no gradient is supplied,
|
|
29
|
+
* - `expo-linear-gradient` isn't installed,
|
|
30
|
+
* - the gradient has fewer than two stops (RN requires ≥2 colors).
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
declare const GradientLayer: {
|
|
35
|
+
({ gradient, borderRadius }: GradientLayerProps): import("react").JSX.Element | null;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
export default GradientLayer;
|
|
39
|
+
//# sourceMappingURL=GradientLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/GradientLayer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAgC3E;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,aAAa;iCAAgC,kBAAkB;;CA0BpE,CAAC;AAGF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* `expo-linear-gradient` is an **optional peer dependency** of `@mapples/ui`:
|
|
4
|
+
* apps that never render a gradient shouldn't have to install a native module.
|
|
5
|
+
* It's resolved lazily so the package builds and runs without it — when it's
|
|
6
|
+
* absent (or a node carries no gradient) this component renders nothing and the
|
|
7
|
+
* container falls back to its solid `backgroundColor`.
|
|
8
|
+
*/
|
|
9
|
+
let LinearGradient = null;
|
|
10
|
+
try {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
12
|
+
LinearGradient = require('expo-linear-gradient').LinearGradient;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
LinearGradient = null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a linear gradient as an absolutely-positioned fill layer that a
|
|
19
|
+
* container paints behind its children. This is an **internal layer**, not a
|
|
20
|
+
* standalone canvas component — it has no ref and no intrinsic size. Containers
|
|
21
|
+
* (`View`, `GradientBackground`) mount it as their first child.
|
|
22
|
+
*
|
|
23
|
+
* React Native has no native gradient style, so a gradient travels as data on
|
|
24
|
+
* `props.gradient` (see `@mapples/types`' `LinearGradient`) and is painted here.
|
|
25
|
+
* The layer is `pointerEvents="none"` so it never intercepts touches.
|
|
26
|
+
*
|
|
27
|
+
* Degrades to `null` (the container keeps its solid `backgroundColor`) when:
|
|
28
|
+
* - no gradient is supplied,
|
|
29
|
+
* - `expo-linear-gradient` isn't installed,
|
|
30
|
+
* - the gradient has fewer than two stops (RN requires ≥2 colors).
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
const GradientLayer = ({ gradient, borderRadius }) => {
|
|
35
|
+
if (!gradient || !LinearGradient || gradient.type !== 'linear') {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const colors = gradient.stops.map((stop) => stop.color);
|
|
39
|
+
if (colors.length < 2) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const locations = gradient.stops.map((stop) => stop.position);
|
|
43
|
+
const style = [
|
|
44
|
+
StyleSheet.absoluteFill,
|
|
45
|
+
borderRadius ? { borderRadius } : null,
|
|
46
|
+
];
|
|
47
|
+
return (<LinearGradient colors={colors} locations={locations} start={gradient.start} end={gradient.end} pointerEvents="none" style={style}/>);
|
|
48
|
+
};
|
|
49
|
+
GradientLayer.displayName = 'GradientLayer';
|
|
50
|
+
export default GradientLayer;
|
|
51
|
+
//# sourceMappingURL=GradientLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientLayer.js","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/GradientLayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,UAAU,EAAa,MAAM,cAAc,CAAC;AAgBhE;;;;;;GAMG;AACH,IAAI,cAAc,GAAuD,IAAI,CAAC;AAC9E,IAAI,CAAC;IACH,iEAAiE;IACjE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,cAAc,CAAC;AAClE,CAAC;AAAC,MAAM,CAAC;IACP,cAAc,GAAG,IAAI,CAAC;AACxB,CAAC;AAkBD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAsB,EAAE,EAAE;IACvE,IAAI,CAAC,QAAQ,IAAI,CAAC,cAAc,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE9D,MAAM,KAAK,GAAyB;QAClC,UAAU,CAAC,YAAY;QACvB,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI;KACvC,CAAC;IAEF,OAAO,CACL,CAAC,cAAc,CACb,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACtB,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAClB,aAAa,CAAC,MAAM,CACpB,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import GradientBackground from './GradientBackground';
|
|
2
|
+
export * from './GradientBackground';
|
|
3
|
+
export { default as GradientLayer } from './GradientLayer';
|
|
4
|
+
export * from './GradientLayer';
|
|
5
|
+
export * from './schematics';
|
|
6
|
+
export default GradientBackground;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAE7B,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import GradientBackground from './GradientBackground';
|
|
2
|
+
export * from './GradientBackground';
|
|
3
|
+
export { default as GradientLayer } from './GradientLayer';
|
|
4
|
+
export * from './GradientLayer';
|
|
5
|
+
export * from './schematics';
|
|
6
|
+
export default GradientBackground;
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAE7B,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RegisteredComponent } from '@mapples/types';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic configuration for the GradientBackground component.
|
|
4
|
+
*
|
|
5
|
+
* A gradient-filled container that `forwardRef`s to a native `View`, so the
|
|
6
|
+
* canvas can measure it (`measureInWindow`) and make it selectable. It has
|
|
7
|
+
* children, sizing, and the normal view styling, plus a linear gradient painted
|
|
8
|
+
* behind its children.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare const GradientBackgroundSchematic: RegisteredComponent;
|
|
13
|
+
//# sourceMappingURL=schematics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,EAAE,mBAGzC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import GradientBackground from './GradientBackground';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic configuration for the GradientBackground component.
|
|
4
|
+
*
|
|
5
|
+
* A gradient-filled container that `forwardRef`s to a native `View`, so the
|
|
6
|
+
* canvas can measure it (`measureInWindow`) and make it selectable. It has
|
|
7
|
+
* children, sizing, and the normal view styling, plus a linear gradient painted
|
|
8
|
+
* behind its children.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export const GradientBackgroundSchematic = {
|
|
13
|
+
type: 'GradientBackground',
|
|
14
|
+
Component: GradientBackground,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=schematics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/views/GradientBackground/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAwB;IAC9D,IAAI,EAAE,oBAAoB;IAC1B,SAAS,EAAE,kBAAkB;CAC9B,CAAC"}
|
|
@@ -2,18 +2,58 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { StyledProp, StyledProps, WithStyledProps } from '@mapples/style';
|
|
3
3
|
import { ImageProps as ExpoImageProps } from 'expo-image';
|
|
4
4
|
import { ImageStyle, ViewProps, ViewStyle } from 'react-native';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the ImageBackgroundView component.
|
|
7
|
+
*
|
|
8
|
+
* Combines Expo Image props with an extended `styled` object that controls the
|
|
9
|
+
* outer container, the background image, and the overlaid content view
|
|
10
|
+
* independently. Accepts an optional `dataSource` string that takes precedence
|
|
11
|
+
* over the standard `source` prop when provided.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
5
15
|
export type ImageProps = PropsWithChildren<Omit<WithStyledProps<ExpoImageProps>, 'styled'> & {
|
|
6
16
|
styled?: StyledProps<ViewProps> & {
|
|
17
|
+
/** Style applied to the absolutely-positioned background image */
|
|
7
18
|
styleImage?: StyledProp<ImageStyle>;
|
|
19
|
+
/** Style applied to the view rendered on top of the background image */
|
|
8
20
|
styleContent?: StyledProp<ViewStyle>;
|
|
9
21
|
};
|
|
22
|
+
/** URI string that overrides `source` when present */
|
|
10
23
|
dataSource?: string;
|
|
11
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* A container view with an absolutely-positioned background image.
|
|
27
|
+
*
|
|
28
|
+
* `ImageBackgroundView` renders a full-bleed background image (via Expo Image)
|
|
29
|
+
* beneath an overlay content view. Children are placed inside the content
|
|
30
|
+
* view and are rendered on top of the image. Pass `dataSource` (a URI string)
|
|
31
|
+
* to override the standard `source` prop at runtime.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <ImageBackgroundView
|
|
36
|
+
* dataSource="https://example.com/hero.jpg"
|
|
37
|
+
* alt="Hero background"
|
|
38
|
+
* styled={{
|
|
39
|
+
* style: { flex: 1 },
|
|
40
|
+
* styleContent: { padding: 24, justifyContent: 'flex-end' },
|
|
41
|
+
* }}
|
|
42
|
+
* >
|
|
43
|
+
* <Text text="Welcome" />
|
|
44
|
+
* </ImageBackgroundView>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
12
49
|
declare const ImageBackgroundView: import("react").ForwardRefExoticComponent<Omit<WithStyledProps<ExpoImageProps>, "styled"> & {
|
|
13
50
|
styled?: StyledProps<ViewProps> & {
|
|
51
|
+
/** Style applied to the absolutely-positioned background image */
|
|
14
52
|
styleImage?: StyledProp<ImageStyle>;
|
|
53
|
+
/** Style applied to the view rendered on top of the background image */
|
|
15
54
|
styleContent?: StyledProp<ViewStyle>;
|
|
16
55
|
};
|
|
56
|
+
/** URI string that overrides `source` when present */
|
|
17
57
|
dataSource?: string;
|
|
18
58
|
} & {
|
|
19
59
|
children?: import("react").ReactNode | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBackgroundView.d.ts","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/ImageBackgroundView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAEL,UAAU,EACV,WAAW,EAGX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAsB,UAAU,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,MAAM,UAAU,GAAG,iBAAiB,CACxC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,GAAG;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG;QAChC,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;KACtC,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAIF,QAAA,MAAM,mBAAmB;
|
|
1
|
+
{"version":3,"file":"ImageBackgroundView.d.ts","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/ImageBackgroundView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAEL,UAAU,EACV,WAAW,EAGX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAsB,UAAU,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,iBAAiB,CACxC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,GAAG;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG;QAChC,kEAAkE;QAClE,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,wEAAwE;QACxE,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;KACtC,CAAC;IACF,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,QAAA,MAAM,mBAAmB;aArCZ,WAAW,CAAC,SAAS,CAAC,GAAG;QAChC,kEAAkE;QAClE,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,wEAAwE;QACxE,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;KACtC;IACD,sDAAsD;iBACzC,MAAM;;;2CAgDtB,CAAC;AAcF,eAAe,mBAAmB,CAAC"}
|
|
@@ -2,6 +2,30 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import { styled, StyledView, Styler, } from '@mapples/style';
|
|
3
3
|
import { Image as ExpoImage } from 'expo-image';
|
|
4
4
|
const StyledExpoImage = styled(ExpoImage);
|
|
5
|
+
/**
|
|
6
|
+
* A container view with an absolutely-positioned background image.
|
|
7
|
+
*
|
|
8
|
+
* `ImageBackgroundView` renders a full-bleed background image (via Expo Image)
|
|
9
|
+
* beneath an overlay content view. Children are placed inside the content
|
|
10
|
+
* view and are rendered on top of the image. Pass `dataSource` (a URI string)
|
|
11
|
+
* to override the standard `source` prop at runtime.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <ImageBackgroundView
|
|
16
|
+
* dataSource="https://example.com/hero.jpg"
|
|
17
|
+
* alt="Hero background"
|
|
18
|
+
* styled={{
|
|
19
|
+
* style: { flex: 1 },
|
|
20
|
+
* styleContent: { padding: 24, justifyContent: 'flex-end' },
|
|
21
|
+
* }}
|
|
22
|
+
* >
|
|
23
|
+
* <Text text="Welcome" />
|
|
24
|
+
* </ImageBackgroundView>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
5
29
|
const ImageBackgroundView = forwardRef(({ styled, source, alt, children, dataSource, ...props }, ref) => {
|
|
6
30
|
const { styleImage, styleContent, ...styledProps } = styled || {};
|
|
7
31
|
return (<StyledView ref={ref} styled={styledProps} {...props}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBackgroundView.js","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/ImageBackgroundView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,MAAM,EAGN,UAAU,EACV,MAAM,GAEP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAgC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageBackgroundView.js","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/ImageBackgroundView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,MAAM,EAGN,UAAU,EACV,MAAM,GAEP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAgC,MAAM,YAAY,CAAC;AA0B9E,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,mBAAmB,GAAG,UAAU,CACpC,CACE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,EAAc,EACnE,GAAG,EACH,EAAE;IACF,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;IAElE,OAAO,CACL,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,CACnD;QAAA,CAAC,eAAe,CACd,MAAM,CAAC,CAAC,UAAU,IAAI,MAAM,CAAC,CAC7B,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,EAE7D;QAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,CACrE;MAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AACF,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAC;AACxD,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE;QACL,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACf;CACF,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,eAAO,MAAM,6BAA6B,EAAE,mBAG3C,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,mBAG3C,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import ImageBackgroundView from './ImageBackgroundView';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic configuration for the ImageBackgroundView component.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
2
7
|
export const ImageBackgroundViewSchematics = {
|
|
3
8
|
type: 'ImageBackgroundView',
|
|
4
9
|
Component: ImageBackgroundView,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IAChE,IAAI,EAAE,qBAAqB;IAC3B,SAAS,EAAE,mBAAmB;CAC/B,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/views/ImageBackgroundView/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IAChE,IAAI,EAAE,qBAAqB;IAC3B,SAAS,EAAE,mBAAmB;CAC/B,CAAC"}
|
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { WithStyledProps } from '@mapples/style';
|
|
3
3
|
import { SafeAreaViewProps as RNSafeAreaViewProps } from 'react-native-safe-area-context';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the SafeAreaView component.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
4
9
|
export type SafeAreaViewProps = PropsWithChildren<WithStyledProps<RNSafeAreaViewProps>>;
|
|
10
|
+
/**
|
|
11
|
+
* A customizable safe-area view component with built-in styling support.
|
|
12
|
+
*
|
|
13
|
+
* `SafeAreaView` wraps `react-native-safe-area-context`'s `SafeAreaView` and
|
|
14
|
+
* adds styling capabilities through the `@mapples/style` system. It ensures
|
|
15
|
+
* content is rendered within the device's safe-area insets (notch, home
|
|
16
|
+
* indicator, status bar, etc.).
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <SafeAreaView
|
|
21
|
+
* styled={{
|
|
22
|
+
* style: {
|
|
23
|
+
* flex: 1,
|
|
24
|
+
* backgroundColor: 'white',
|
|
25
|
+
* },
|
|
26
|
+
* }}
|
|
27
|
+
* >
|
|
28
|
+
* <Text text="Safe content" />
|
|
29
|
+
* </SafeAreaView>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
5
34
|
declare const SafeAreaView: import("react").ForwardRefExoticComponent<{
|
|
6
35
|
styled?: import("@mapples/style").StyledProps<Partial<import("react-native-safe-area-context").NativeSafeAreaViewProps>> | undefined;
|
|
7
36
|
} & import("react-native-safe-area-context").NativeSafeAreaViewProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeAreaView.d.ts","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/SafeAreaView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAsB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,iBAAiB,IAAI,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1F,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAC/C,eAAe,CAAC,mBAAmB,CAAC,CACrC,CAAC;AAEF,QAAA,MAAM,YAAY;;;;2CAQjB,CAAC;AAGF,eAAe,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"SafeAreaView.d.ts","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/SafeAreaView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAsB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,iBAAiB,IAAI,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1F;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAC/C,eAAe,CAAC,mBAAmB,CAAC,CACrC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,QAAA,MAAM,YAAY;;;;2CAQjB,CAAC;AAGF,eAAe,YAAY,CAAC"}
|
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import { StyledSafeAreaView } from '@mapples/style';
|
|
3
|
+
/**
|
|
4
|
+
* A customizable safe-area view component with built-in styling support.
|
|
5
|
+
*
|
|
6
|
+
* `SafeAreaView` wraps `react-native-safe-area-context`'s `SafeAreaView` and
|
|
7
|
+
* adds styling capabilities through the `@mapples/style` system. It ensures
|
|
8
|
+
* content is rendered within the device's safe-area insets (notch, home
|
|
9
|
+
* indicator, status bar, etc.).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <SafeAreaView
|
|
14
|
+
* styled={{
|
|
15
|
+
* style: {
|
|
16
|
+
* flex: 1,
|
|
17
|
+
* backgroundColor: 'white',
|
|
18
|
+
* },
|
|
19
|
+
* }}
|
|
20
|
+
* >
|
|
21
|
+
* <Text text="Safe content" />
|
|
22
|
+
* </SafeAreaView>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
3
27
|
const SafeAreaView = forwardRef(({ styled, children, ...props }, ref) => {
|
|
4
28
|
return (<StyledSafeAreaView ref={ref} styled={{ ...styled }} {...props}>
|
|
5
29
|
{children}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeAreaView.js","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/SafeAreaView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAmB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SafeAreaView.js","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/SafeAreaView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAmB,MAAM,gBAAgB,CAAC;AAYrE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,YAAY,GAAG,UAAU,CAC7B,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAqB,EAAE,GAAG,EAAE,EAAE;IACzD,OAAO,CACL,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,CAC7D;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,kBAAkB,CAAC,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,eAAO,MAAM,qBAAqB,EAAE,mBAGnC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAGnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,YAAY;CACxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../../../../src/components/views/SafeAreaView/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,YAAY;CACxB,CAAC"}
|