@telus-uds/components-base 1.24.2 → 2.0.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/CHANGELOG.md +29 -2
- package/component-docs.json +55 -1
- package/lib/Button/ButtonBase.js +2 -1
- package/lib/Carousel/Carousel.js +9 -1
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +11 -2
- package/lib/MultiSelectFilter/ModalOverlay.js +136 -0
- package/lib/MultiSelectFilter/MultiSelectFilter.js +64 -26
- package/lib/Typography/Typography.js +27 -2
- package/lib-module/Button/ButtonBase.js +2 -1
- package/lib-module/Carousel/Carousel.js +9 -1
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +10 -2
- package/lib-module/MultiSelectFilter/ModalOverlay.js +112 -0
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +65 -27
- package/lib-module/Typography/Typography.js +26 -2
- package/package.json +2 -2
- package/src/Button/ButtonBase.jsx +1 -1
- package/src/Carousel/Carousel.jsx +6 -1
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +7 -1
- package/src/MultiSelectFilter/ModalOverlay.jsx +86 -0
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +73 -49
- package/src/Typography/Typography.jsx +26 -2
|
@@ -60,6 +60,7 @@ const Typography = forwardRef(
|
|
|
60
60
|
const viewport = useViewport()
|
|
61
61
|
const themeTokens = useThemeTokens('Typography', tokens, variant, { viewport })
|
|
62
62
|
const { themeOptions } = useTheme()
|
|
63
|
+
|
|
63
64
|
const resolvedTextProps = {
|
|
64
65
|
...selectTextProps(rest),
|
|
65
66
|
style: selectTextStyles(
|
|
@@ -76,13 +77,36 @@ const Typography = forwardRef(
|
|
|
76
77
|
...selectContainerProps(rest)
|
|
77
78
|
}
|
|
78
79
|
|
|
80
|
+
const resetTagStyling = (child) => {
|
|
81
|
+
if (typeof child === 'object' && (child?.type === 'sub' || child?.type === 'sup')) {
|
|
82
|
+
const sanitizedChild = React.cloneElement(child, {
|
|
83
|
+
style: {
|
|
84
|
+
...child?.props?.style,
|
|
85
|
+
lineHeight: 0
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
return sanitizedChild
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return child
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const sanitizeChildren = () => {
|
|
96
|
+
if (Array.isArray(children)) {
|
|
97
|
+
return children.map(resetTagStyling)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return resetTagStyling(children)
|
|
101
|
+
}
|
|
102
|
+
|
|
79
103
|
return block ? (
|
|
80
104
|
<View ref={ref} {...containerProps}>
|
|
81
|
-
<Text {...resolvedTextProps}>{children}</Text>
|
|
105
|
+
<Text {...resolvedTextProps}>{sanitizeChildren(children)}</Text>
|
|
82
106
|
</View>
|
|
83
107
|
) : (
|
|
84
108
|
<Text ref={ref} {...containerProps} {...resolvedTextProps}>
|
|
85
|
-
{children}
|
|
109
|
+
{sanitizeChildren(children)}
|
|
86
110
|
</Text>
|
|
87
111
|
)
|
|
88
112
|
}
|