@wlloyalty/wll-react-sdk 1.11.0 → 1.11.1
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.
|
@@ -11,6 +11,13 @@ export type ChipProps = {
|
|
|
11
11
|
testID?: string;
|
|
12
12
|
style?: StyleProp<ViewStyle>;
|
|
13
13
|
labelStyle?: StyleProp<TextStyle>;
|
|
14
|
+
/**
|
|
15
|
+
* Maximum number of lines the label may wrap onto before truncating.
|
|
16
|
+
* Defaults to 2 so long, tenant-configured labels wrap onto a second row
|
|
17
|
+
* and stay inside the parent (e.g. a badge tile) instead of overflowing.
|
|
18
|
+
* Pass 1 to force a single line with tail truncation.
|
|
19
|
+
*/
|
|
20
|
+
numberOfLines?: number;
|
|
14
21
|
};
|
|
15
|
-
declare const Chip: ({ label, variant, role, ariaLive, accessibilityLabel, testID, style, labelStyle, }: ChipProps) => React.ReactElement;
|
|
22
|
+
declare const Chip: ({ label, variant, role, ariaLive, accessibilityLabel, testID, style, labelStyle, numberOfLines, }: ChipProps) => React.ReactElement;
|
|
16
23
|
export default Chip;
|
package/dist/web.js
CHANGED
|
@@ -24003,7 +24003,8 @@ var useChipStyles = function () {
|
|
|
24003
24003
|
paddingVertical: paddingVertical,
|
|
24004
24004
|
borderRadius: theme.sizes.borderRadiusRounded,
|
|
24005
24005
|
overflow: 'hidden',
|
|
24006
|
-
flexShrink: 1
|
|
24006
|
+
flexShrink: 1,
|
|
24007
|
+
maxWidth: '100%'
|
|
24007
24008
|
},
|
|
24008
24009
|
label: {
|
|
24009
24010
|
fontFamily: theme.fontFamily,
|
|
@@ -24049,7 +24050,9 @@ var Chip = function (_a) {
|
|
|
24049
24050
|
accessibilityLabel = _a.accessibilityLabel,
|
|
24050
24051
|
testID = _a.testID,
|
|
24051
24052
|
style = _a.style,
|
|
24052
|
-
labelStyle = _a.labelStyle
|
|
24053
|
+
labelStyle = _a.labelStyle,
|
|
24054
|
+
_e = _a.numberOfLines,
|
|
24055
|
+
numberOfLines = _e === void 0 ? 2 : _e;
|
|
24053
24056
|
var styles = useChipStyles();
|
|
24054
24057
|
var theme = useWllSdk().theme;
|
|
24055
24058
|
var variantStyles = React.useMemo(function () {
|
|
@@ -24086,9 +24089,9 @@ var Chip = function (_a) {
|
|
|
24086
24089
|
}
|
|
24087
24090
|
}, [theme, variant]);
|
|
24088
24091
|
var computedAccessibilityLabel = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : typeof label === 'string' ? label : undefined;
|
|
24089
|
-
var
|
|
24090
|
-
accessibilityLiveRegion =
|
|
24091
|
-
ariaLiveValue =
|
|
24092
|
+
var _f = mapLiveRegion(ariaLive),
|
|
24093
|
+
accessibilityLiveRegion = _f.native,
|
|
24094
|
+
ariaLiveValue = _f.web;
|
|
24092
24095
|
var isIndividuallyAccessible = computedAccessibilityLabel !== undefined;
|
|
24093
24096
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
24094
24097
|
style: [styles.container, variantStyles.container, style],
|
|
@@ -24100,7 +24103,7 @@ var Chip = function (_a) {
|
|
|
24100
24103
|
testID: testID
|
|
24101
24104
|
}, /*#__PURE__*/React.createElement(RNText, {
|
|
24102
24105
|
style: [styles.label, variantStyles.label, labelStyle],
|
|
24103
|
-
numberOfLines:
|
|
24106
|
+
numberOfLines: numberOfLines,
|
|
24104
24107
|
ellipsizeMode: "tail",
|
|
24105
24108
|
accessible: false,
|
|
24106
24109
|
importantForAccessibility: "no"
|