@telus-uds/components-base 1.49.0 → 1.51.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 +27 -2
- package/component-docs.json +110 -14
- package/lib/Link/LinkBase.js +1 -1
- package/lib/MultiSelectFilter/ModalOverlay.js +24 -8
- package/lib/MultiSelectFilter/MultiSelectFilter.js +154 -21
- package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +62 -41
- package/lib/StepTracker/Step.js +35 -14
- package/lib/StepTracker/StepTracker.js +5 -2
- package/lib/StepTracker/dictionary.js +24 -4
- package/lib/TextInput/TextInput.js +17 -15
- package/lib/ThemeProvider/ThemeProvider.js +7 -1
- package/lib-module/Link/LinkBase.js +1 -1
- package/lib-module/MultiSelectFilter/ModalOverlay.js +25 -9
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +154 -23
- package/lib-module/QuickLinksFeature/QuickLinksFeatureItem.js +64 -43
- package/lib-module/StepTracker/Step.js +35 -14
- package/lib-module/StepTracker/StepTracker.js +5 -2
- package/lib-module/StepTracker/dictionary.js +24 -4
- package/lib-module/TextInput/TextInput.js +19 -15
- package/lib-module/ThemeProvider/ThemeProvider.js +8 -2
- package/package.json +2 -2
- package/src/Card/CardBase.jsx +0 -1
- package/src/Link/LinkBase.jsx +3 -1
- package/src/MultiSelectFilter/ModalOverlay.jsx +30 -6
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +142 -20
- package/src/QuickLinksFeature/QuickLinksFeatureItem.jsx +42 -35
- package/src/StepTracker/Step.jsx +34 -10
- package/src/StepTracker/StepTracker.jsx +11 -2
- package/src/StepTracker/dictionary.js +24 -4
- package/src/TextInput/TextInput.jsx +8 -5
- package/src/ThemeProvider/ThemeProvider.jsx +9 -2
- package/src/Typography/Typography.jsx +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext, useState } from 'react'
|
|
1
|
+
import React, { createContext, useEffect, useState } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { validateThemeTokensVersion } from './utils'
|
|
4
4
|
import responsiveProps from '../utils/props/responsiveProps'
|
|
@@ -22,6 +22,12 @@ const defaultThemeOptions = {
|
|
|
22
22
|
const ThemeProvider = ({ children, defaultTheme, themeOptions = {} }) => {
|
|
23
23
|
const [theme, setTheme] = useState(defaultTheme)
|
|
24
24
|
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (theme.metadata.name !== defaultTheme.metadata.name) {
|
|
27
|
+
setTheme(defaultTheme)
|
|
28
|
+
}
|
|
29
|
+
}, [theme.metadata.name, defaultTheme])
|
|
30
|
+
|
|
25
31
|
const appliedThemeOptions = { ...defaultThemeOptions, ...themeOptions }
|
|
26
32
|
|
|
27
33
|
// Validate the theme tokens version on every render.
|
|
@@ -42,7 +48,8 @@ ThemeProvider.propTypes = {
|
|
|
42
48
|
children: PropTypes.node.isRequired,
|
|
43
49
|
defaultTheme: PropTypes.shape({
|
|
44
50
|
metadata: PropTypes.shape({
|
|
45
|
-
themeTokensVersion: PropTypes.string.isRequired
|
|
51
|
+
themeTokensVersion: PropTypes.string.isRequired,
|
|
52
|
+
name: PropTypes.string.isRequired
|
|
46
53
|
}).isRequired
|
|
47
54
|
}).isRequired,
|
|
48
55
|
/**
|
|
@@ -105,6 +105,7 @@ const Typography = forwardRef(
|
|
|
105
105
|
const textStyles = resolvedTextProps.style
|
|
106
106
|
? { ...resolvedTextProps.style, textDecorationLine }
|
|
107
107
|
: { textDecorationLine }
|
|
108
|
+
|
|
108
109
|
return block ? (
|
|
109
110
|
<View ref={ref} {...containerProps}>
|
|
110
111
|
<Text {...resolvedTextProps} style={textStyles}>
|