@proximus/lavender-list-native 1.2.8-beta.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/dist/List.d.ts +10 -0
- package/dist/List.d.ts.map +1 -0
- package/dist/List.js +17 -0
- package/dist/ListContext.d.ts +6 -0
- package/dist/ListContext.d.ts.map +1 -0
- package/dist/ListContext.js +5 -0
- package/dist/ListItem.d.ts +12 -0
- package/dist/ListItem.d.ts.map +1 -0
- package/dist/ListItem.js +29 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/package.json +17 -0
package/dist/List.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
type GapSize = 'Xs' | 'Default';
|
|
3
|
+
export interface IPxListProps {
|
|
4
|
+
gap?: GapSize;
|
|
5
|
+
inverted?: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function PxList({ gap, inverted, children }: IPxListProps): React.JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=List.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../src/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKzC,KAAK,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEhC,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,MAAM,CAAC,EAAE,GAAG,EAAE,QAAgB,EAAE,QAAQ,EAAE,EAAE,YAAY,qBASvE"}
|
package/dist/List.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { useTheme } from '@proximus/lavender-styling-native';
|
|
4
|
+
import ListContext from './ListContext';
|
|
5
|
+
export function PxList({ gap, inverted = false, children }) {
|
|
6
|
+
const { theme } = useTheme();
|
|
7
|
+
const styles = useStyles({ gap, theme });
|
|
8
|
+
return (React.createElement(ListContext.Provider, { value: { inverted } },
|
|
9
|
+
React.createElement(View, { style: styles.listContainer }, children)));
|
|
10
|
+
}
|
|
11
|
+
function useStyles({ gap, theme }) {
|
|
12
|
+
return StyleSheet.create({
|
|
13
|
+
listContainer: {
|
|
14
|
+
gap: theme.t(`Spacing${gap ?? 'Xs'}Mobile`).number,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListContext.d.ts","sourceRoot":"","sources":["../src/ListContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,WAAW;cAAmC,OAAO;EAEzD,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconColor } from '@proximus/lavender-icon-common';
|
|
3
|
+
import type { IconName } from '@proximus/lavender-icon/dist/iconNames.js';
|
|
4
|
+
export interface IPxListItemProps {
|
|
5
|
+
label: string;
|
|
6
|
+
iconName?: IconName;
|
|
7
|
+
iconColor?: IconColor;
|
|
8
|
+
iconAriaLabel?: string;
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function PxListItem({ label, iconName, iconColor, iconAriaLabel, testID, }: IPxListItemProps): React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../src/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAS1E,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EACb,MAAM,GACP,EAAE,gBAAgB,qBA8BlB"}
|
package/dist/ListItem.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Body } from '@proximus/lavender-texts-native';
|
|
4
|
+
import { PxIcon } from '@proximus/lavender-icon-native';
|
|
5
|
+
import { useTheme } from '@proximus/lavender-styling-native';
|
|
6
|
+
import { e2eID } from '@proximus/lavender-common-native';
|
|
7
|
+
import ListContext from './ListContext';
|
|
8
|
+
const DEFAULT_ICON_COLOR = 'Brand';
|
|
9
|
+
export function PxListItem({ label, iconName, iconColor, iconAriaLabel, testID, }) {
|
|
10
|
+
const { theme } = useTheme();
|
|
11
|
+
const styles = useStyles({ theme });
|
|
12
|
+
const { inverted } = React.useContext(ListContext);
|
|
13
|
+
return (React.createElement(View, { style: [styles.listItemContainer], ...(testID && e2eID(`${testID}`)) },
|
|
14
|
+
iconName && (React.createElement(View, { ...(testID && e2eID(`${testID}-icon`)) },
|
|
15
|
+
React.createElement(PxIcon, { name: iconName, color: iconColor ?? DEFAULT_ICON_COLOR, size: "M", inverted: inverted, accessibilityLabel: iconAriaLabel }))),
|
|
16
|
+
React.createElement(Body, { style: styles.label, inverted: inverted, ...(testID && e2eID(`${testID}-label`)) }, label)));
|
|
17
|
+
}
|
|
18
|
+
function useStyles({ theme }) {
|
|
19
|
+
return StyleSheet.create({
|
|
20
|
+
listItemContainer: {
|
|
21
|
+
flexDirection: 'row',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
gap: theme.t('SpacingXsMobile').number,
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
fontSize: theme.t('TextSizeLabelLMobile').number,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-list-native",
|
|
3
|
+
"version": "1.2.8-beta.2",
|
|
4
|
+
"description": "Lavender list component",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@proximus/lavender-buttonicon-native": "*",
|
|
9
|
+
"@proximus/lavender-common-native": "*",
|
|
10
|
+
"@proximus/lavender-icon-native": "*",
|
|
11
|
+
"@proximus/lavender-styling-native": "*",
|
|
12
|
+
"@proximus/lavender-texts-native": "*"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
}
|
|
17
|
+
}
|