@telus-uds/components-base 1.11.0 → 1.13.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 +36 -2
- package/component-docs.json +796 -33
- package/lib/BaseProvider/index.js +7 -2
- package/lib/Button/ButtonBase.js +18 -14
- package/lib/Button/ButtonGroup.js +7 -0
- package/lib/Carousel/Carousel.js +83 -58
- package/lib/Carousel/CarouselContext.js +22 -8
- package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +73 -0
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +56 -0
- package/lib/Carousel/CarouselStepTracker/index.js +13 -0
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +70 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +95 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +148 -0
- package/lib/Carousel/CarouselTabs/index.js +13 -0
- package/lib/Carousel/CarouselThumbnail.js +99 -0
- package/lib/Carousel/CarouselThumbnailNavigation.js +87 -0
- package/lib/Carousel/dictionary.js +4 -2
- package/lib/Carousel/index.js +10 -1
- package/lib/Checkbox/Checkbox.js +7 -3
- package/lib/Checkbox/CheckboxGroup.js +8 -1
- package/lib/Feedback/Feedback.js +18 -10
- package/lib/Icon/IconText.js +5 -0
- package/lib/InputLabel/InputLabel.js +11 -5
- package/lib/Link/InlinePressable.js +1 -8
- package/lib/Link/LinkBase.js +12 -9
- package/lib/List/ListItem.js +7 -3
- package/lib/Notification/Notification.js +7 -2
- package/lib/Pagination/Pagination.js +7 -3
- package/lib/Radio/RadioGroup.js +8 -0
- package/lib/RadioCard/RadioCard.js +6 -1
- package/lib/RadioCard/RadioCardGroup.js +7 -0
- package/lib/Select/Select.js +7 -3
- package/lib/SkipLink/SkipLink.js +216 -0
- package/lib/SkipLink/index.js +13 -0
- package/lib/StepTracker/Step.js +8 -4
- package/lib/StepTracker/StepTracker.js +7 -3
- package/lib/Tabs/TabsItem.js +4 -0
- package/lib/TextInput/TextInputBase.js +7 -3
- package/lib/ThemeProvider/ThemeProvider.js +25 -3
- package/lib/ThemeProvider/utils/styles.js +8 -1
- package/lib/ThemeProvider/utils/theme-tokens.js +1 -1
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +7 -0
- package/lib/Typography/Typography.js +6 -2
- package/lib/index.js +9 -0
- package/lib/utils/index.js +9 -0
- package/lib-module/BaseProvider/index.js +7 -2
- package/lib-module/Button/ButtonBase.js +7 -3
- package/lib-module/Button/ButtonGroup.js +7 -0
- package/lib-module/Carousel/Carousel.js +80 -57
- package/lib-module/Carousel/CarouselContext.js +21 -8
- package/lib-module/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +51 -0
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +42 -0
- package/lib-module/Carousel/CarouselStepTracker/index.js +2 -0
- package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +50 -0
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +76 -0
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanelItem.js +126 -0
- package/lib-module/Carousel/CarouselTabs/index.js +2 -0
- package/lib-module/Carousel/CarouselThumbnail.js +85 -0
- package/lib-module/Carousel/CarouselThumbnailNavigation.js +66 -0
- package/lib-module/Carousel/dictionary.js +4 -2
- package/lib-module/Carousel/index.js +2 -1
- package/lib-module/Checkbox/Checkbox.js +8 -4
- package/lib-module/Checkbox/CheckboxGroup.js +8 -1
- package/lib-module/Feedback/Feedback.js +19 -11
- package/lib-module/Icon/IconText.js +5 -0
- package/lib-module/InputLabel/InputLabel.js +12 -6
- package/lib-module/Link/InlinePressable.js +1 -8
- package/lib-module/Link/LinkBase.js +13 -10
- package/lib-module/List/ListItem.js +8 -4
- package/lib-module/Notification/Notification.js +8 -3
- package/lib-module/Pagination/Pagination.js +8 -4
- package/lib-module/Radio/RadioGroup.js +8 -0
- package/lib-module/RadioCard/RadioCard.js +7 -2
- package/lib-module/RadioCard/RadioCardGroup.js +7 -0
- package/lib-module/Select/Select.js +8 -4
- package/lib-module/SkipLink/SkipLink.js +188 -0
- package/lib-module/SkipLink/index.js +2 -0
- package/lib-module/StepTracker/Step.js +9 -5
- package/lib-module/StepTracker/StepTracker.js +8 -4
- package/lib-module/Tabs/TabsItem.js +5 -1
- package/lib-module/TextInput/TextInputBase.js +8 -4
- package/lib-module/ThemeProvider/ThemeProvider.js +24 -3
- package/lib-module/ThemeProvider/utils/styles.js +8 -1
- package/lib-module/ThemeProvider/utils/theme-tokens.js +1 -1
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +7 -0
- package/lib-module/Typography/Typography.js +7 -3
- package/lib-module/index.js +1 -0
- package/lib-module/utils/index.js +1 -0
- package/package.json +46 -47
- package/src/BaseProvider/index.jsx +6 -3
- package/src/Button/ButtonBase.jsx +8 -3
- package/src/Button/ButtonGroup.jsx +6 -0
- package/src/Carousel/Carousel.jsx +91 -64
- package/src/Carousel/CarouselContext.jsx +29 -5
- package/src/Carousel/CarouselFirstFocus/CarouselFirstFocus.jsx +49 -0
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +36 -0
- package/src/Carousel/CarouselStepTracker/index.js +3 -0
- package/src/Carousel/CarouselTabs/CarouselTabs.jsx +37 -0
- package/src/Carousel/CarouselTabs/CarouselTabsPanel.jsx +69 -0
- package/src/Carousel/CarouselTabs/CarouselTabsPanelItem.jsx +119 -0
- package/src/Carousel/CarouselTabs/index.js +3 -0
- package/src/Carousel/CarouselThumbnail.jsx +77 -0
- package/src/Carousel/CarouselThumbnailNavigation.jsx +53 -0
- package/src/Carousel/dictionary.js +4 -2
- package/src/Carousel/index.js +1 -0
- package/src/Checkbox/Checkbox.jsx +14 -11
- package/src/Checkbox/CheckboxGroup.jsx +8 -1
- package/src/Feedback/Feedback.jsx +14 -7
- package/src/Icon/IconText.jsx +2 -0
- package/src/InputLabel/InputLabel.jsx +13 -12
- package/src/Link/InlinePressable.jsx +2 -8
- package/src/Link/LinkBase.jsx +17 -20
- package/src/List/ListItem.jsx +9 -4
- package/src/Notification/Notification.jsx +5 -3
- package/src/Pagination/Pagination.jsx +6 -4
- package/src/Radio/RadioGroup.jsx +7 -0
- package/src/RadioCard/RadioCard.jsx +3 -2
- package/src/RadioCard/RadioCardGroup.jsx +6 -0
- package/src/Select/Select.jsx +12 -3
- package/src/SkipLink/SkipLink.jsx +179 -0
- package/src/SkipLink/index.js +3 -0
- package/src/StepTracker/Step.jsx +12 -4
- package/src/StepTracker/StepTracker.jsx +11 -10
- package/src/Tabs/TabsItem.jsx +3 -2
- package/src/TextInput/TextInputBase.jsx +11 -3
- package/src/ThemeProvider/ThemeProvider.jsx +22 -3
- package/src/ThemeProvider/utils/styles.js +9 -1
- package/src/ThemeProvider/utils/theme-tokens.js +1 -1
- package/src/ToggleSwitch/ToggleSwitchGroup.jsx +6 -0
- package/src/Typography/Typography.jsx +11 -12
- package/src/index.js +1 -0
- package/src/utils/index.js +1 -0
|
@@ -15,13 +15,21 @@ export function applyTextStyles({
|
|
|
15
15
|
fontWeight = '400',
|
|
16
16
|
fontName,
|
|
17
17
|
fontStyle = 'normal',
|
|
18
|
+
themeOptions = {
|
|
19
|
+
// TODO: switch `forceAbsoluteFontSizing` to be false by default in the next major version
|
|
20
|
+
forceAbsoluteFontSizing: true
|
|
21
|
+
},
|
|
18
22
|
...rest
|
|
19
23
|
}) {
|
|
20
24
|
const styles = { ...rest }
|
|
25
|
+
const { forceAbsoluteFontSizing } = themeOptions
|
|
21
26
|
|
|
22
27
|
if (fontSize) {
|
|
23
28
|
// If relative font sizes are needed, catch and calculate them here
|
|
24
|
-
styles.fontSize =
|
|
29
|
+
styles.fontSize =
|
|
30
|
+
Platform.OS === 'web' && !forceAbsoluteFontSizing
|
|
31
|
+
? `${fontSize / fontBasePixels}rem`
|
|
32
|
+
: fontSize
|
|
25
33
|
}
|
|
26
34
|
if (typeof lineHeight === 'number') {
|
|
27
35
|
// React Native expects absolute line heights but multipliers are better as design tokens
|
|
@@ -157,7 +157,7 @@ export const validateThemeTokensVersion = (theme) => {
|
|
|
157
157
|
|
|
158
158
|
The UDS base components ${pkg.name} v${pkg.version} are only compatible with UDS themes that are built with @telus-uds/system-theme-tokens version that is semver compatible with ${expectedThemeTokensVersion}. The current theme was built with @telus-uds/system-theme-tokens v${actualThemeTokensVersion}.
|
|
159
159
|
|
|
160
|
-
If you see this error than most likely you have attempted to install ${pkg.name} and a UDS theme manually because you are building a multi-brand application. If you are building a single brand application, consider installing the brand specific design system package such as @telus-uds/ds-allium. For more information, see https://github.com/telus/universal-design-system/blob/main/
|
|
160
|
+
If you see this error than most likely you have attempted to install ${pkg.name} and a UDS theme manually because you are building a multi-brand application. If you are building a single brand application, consider installing the brand specific design system package such as @telus-uds/ds-allium. For more information, see https://github.com/telus/universal-design-system/blob/main/docs/docs/multi-brand-usage.md`
|
|
161
161
|
)
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -40,6 +40,7 @@ const ToggleSwitchGroup = forwardRef(
|
|
|
40
40
|
inactive = false,
|
|
41
41
|
feedback,
|
|
42
42
|
hint,
|
|
43
|
+
hintPosition = 'inline',
|
|
43
44
|
tooltip,
|
|
44
45
|
legend,
|
|
45
46
|
name: inputGroupName,
|
|
@@ -130,6 +131,7 @@ const ToggleSwitchGroup = forwardRef(
|
|
|
130
131
|
legend={legend}
|
|
131
132
|
tooltip={tooltip}
|
|
132
133
|
hint={hint}
|
|
134
|
+
hintPosition={hintPosition}
|
|
133
135
|
space={fieldSpace}
|
|
134
136
|
feedback={feedback}
|
|
135
137
|
inactive={inactive}
|
|
@@ -205,6 +207,10 @@ ToggleSwitchGroup.propTypes = {
|
|
|
205
207
|
* Optional additional text giving more detail to help a user make a choice.
|
|
206
208
|
*/
|
|
207
209
|
hint: PropTypes.string,
|
|
210
|
+
/**
|
|
211
|
+
* Position of the hint relative to label. Use `below` to display a larger hint below the label.
|
|
212
|
+
*/
|
|
213
|
+
hintPosition: PropTypes.oneOf(['inline', 'below']),
|
|
208
214
|
/**
|
|
209
215
|
* Optional tooltip text content to include alongside the legend and hint.
|
|
210
216
|
*/
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { Text, View } from 'react-native'
|
|
4
4
|
|
|
5
|
-
import { useThemeTokens } from '../ThemeProvider'
|
|
5
|
+
import { useTheme, useThemeTokens } from '../ThemeProvider'
|
|
6
6
|
import { useViewport } from '../ViewportProvider'
|
|
7
7
|
import { applyTextStyles } from '../ThemeProvider/utils'
|
|
8
8
|
import {
|
|
@@ -24,22 +24,17 @@ import {
|
|
|
24
24
|
const [selectContainerProps, selectedContainerPropTypes] = selectSystemProps([a11yProps, viewProps])
|
|
25
25
|
const [selectTextProps, selectedTextPropTypes] = selectSystemProps([textProps])
|
|
26
26
|
|
|
27
|
-
const selectTextStyles = (
|
|
28
|
-
fontWeight,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
lineHeight,
|
|
32
|
-
fontName,
|
|
33
|
-
textAlign,
|
|
34
|
-
textTransform,
|
|
35
|
-
letterSpacing
|
|
36
|
-
}) =>
|
|
27
|
+
const selectTextStyles = (
|
|
28
|
+
{ fontWeight, fontSize, color, lineHeight, fontName, textAlign, textTransform, letterSpacing },
|
|
29
|
+
themeOptions
|
|
30
|
+
) =>
|
|
37
31
|
applyTextStyles({
|
|
38
32
|
fontWeight,
|
|
39
33
|
fontSize,
|
|
40
34
|
color,
|
|
41
35
|
lineHeight,
|
|
42
36
|
fontName,
|
|
37
|
+
themeOptions,
|
|
43
38
|
textAlign,
|
|
44
39
|
textTransform,
|
|
45
40
|
letterSpacing
|
|
@@ -64,9 +59,13 @@ const Typography = forwardRef(
|
|
|
64
59
|
) => {
|
|
65
60
|
const viewport = useViewport()
|
|
66
61
|
const themeTokens = useThemeTokens('Typography', tokens, variant, { viewport })
|
|
62
|
+
const { themeOptions } = useTheme()
|
|
67
63
|
const resolvedTextProps = {
|
|
68
64
|
...selectTextProps(rest),
|
|
69
|
-
style: selectTextStyles(
|
|
65
|
+
style: selectTextStyles(
|
|
66
|
+
align ? { ...themeTokens, textAlign: align } : themeTokens,
|
|
67
|
+
themeOptions
|
|
68
|
+
),
|
|
70
69
|
dataSet,
|
|
71
70
|
maxFontSizeMultiplier: getMaxFontMultiplier(themeTokens)
|
|
72
71
|
}
|
package/src/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { default as Search } from './Search'
|
|
|
32
32
|
export { default as Select } from './Select'
|
|
33
33
|
export { default as SideNav } from './SideNav'
|
|
34
34
|
export { default as Skeleton } from './Skeleton'
|
|
35
|
+
export { default as SkipLink } from './SkipLink'
|
|
35
36
|
export { default as Spacer } from './Spacer'
|
|
36
37
|
export { default as StackView } from './StackView'
|
|
37
38
|
export * from './StackView'
|
package/src/utils/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { default as useCopy } from './useCopy'
|
|
|
10
10
|
export { default as useHash } from './useHash'
|
|
11
11
|
export { default as useSpacingScale } from './useSpacingScale'
|
|
12
12
|
export { default as useResponsiveProp } from './useResponsiveProp'
|
|
13
|
+
export { default as useScrollBlocking } from './useScrollBlocking'
|
|
13
14
|
export * from './useResponsiveProp'
|
|
14
15
|
export { default as useUniqueId } from './useUniqueId'
|
|
15
16
|
export { default as withLinkRouter } from './withLinkRouter'
|