@telus-uds/components-base 3.16.0 → 3.17.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.
- package/CHANGELOG.md +4 -8
- package/lib/cjs/Card/PressableCardBase.js +5 -3
- package/lib/cjs/PriceLockup/PriceLockup.js +3 -1
- package/lib/cjs/PriceLockup/utils/renderPrice.js +4 -2
- package/lib/esm/Card/PressableCardBase.js +5 -3
- package/lib/esm/PriceLockup/PriceLockup.js +3 -1
- package/lib/esm/PriceLockup/utils/renderPrice.js +4 -2
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/Card/PressableCardBase.jsx +2 -3
- package/src/PriceLockup/PriceLockup.jsx +6 -1
- package/src/PriceLockup/utils/renderPrice.jsx +26 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri, 12 Sep 2025
|
|
3
|
+
This log was last generated on Fri, 12 Sep 2025 17:00:54 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 3.
|
|
7
|
+
## 3.17.1
|
|
8
8
|
|
|
9
|
-
Fri, 12 Sep 2025
|
|
10
|
-
|
|
11
|
-
### Minor changes
|
|
12
|
-
|
|
13
|
-
- `Carousel`: stories renamed and re-ordered in alphabetical order (35577399+JoshHC@users.noreply.github.com)
|
|
9
|
+
Fri, 12 Sep 2025 17:00:54 GMT
|
|
14
10
|
|
|
15
11
|
### Patches
|
|
16
12
|
|
|
17
|
-
- `Card`:
|
|
13
|
+
- `Card`: fix pressable-card text-decoration when href is present (guillermo.peitzner@telus.com)
|
|
18
14
|
|
|
19
15
|
## 3.13.0
|
|
20
16
|
|
|
@@ -133,7 +133,10 @@ const PressableCardBase = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
|
|
|
133
133
|
setFocused(false);
|
|
134
134
|
setPressed(false);
|
|
135
135
|
},
|
|
136
|
-
style:
|
|
136
|
+
style: {
|
|
137
|
+
...staticStyles.linkContainer,
|
|
138
|
+
textDecoration: 'none'
|
|
139
|
+
},
|
|
137
140
|
...(hrefAttrs || {}),
|
|
138
141
|
role: accessibilityRole,
|
|
139
142
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardBase.default, {
|
|
@@ -178,8 +181,7 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
178
181
|
},
|
|
179
182
|
linkContainer: {
|
|
180
183
|
flex: 1,
|
|
181
|
-
display: 'flex'
|
|
182
|
-
textDecoration: 'none'
|
|
184
|
+
display: 'flex'
|
|
183
185
|
}
|
|
184
186
|
});
|
|
185
187
|
PressableCardBase.displayName = 'PressableCardBase';
|
|
@@ -17,6 +17,7 @@ var _renderPrice = _interopRequireDefault(require("./utils/renderPrice"));
|
|
|
17
17
|
var _renderTypography = _interopRequireDefault(require("./utils/renderTypography"));
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
const PRICE_BASELINE_VARIANT = 'baseline';
|
|
20
21
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.htmlAttrs, _utils.viewProps]);
|
|
21
22
|
const selectTopTextTypographyTokens = _ref => {
|
|
22
23
|
let {
|
|
@@ -141,6 +142,7 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
|
141
142
|
const rateTypographyTokens = selectRateTypographyTokens(themeTokens);
|
|
142
143
|
const topTextTypographyTokens = selectTopTextTypographyTokens(themeTokens);
|
|
143
144
|
const bottomTextTypographyTokens = selectBottomTextTypographyTokens(themeTokens);
|
|
145
|
+
const isPriceBaseline = variant?.price === PRICE_BASELINE_VARIANT;
|
|
144
146
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
145
147
|
style: [staticStyles.priceLockupContainer, selectContainertokens(themeTokens)],
|
|
146
148
|
ref: ref,
|
|
@@ -148,7 +150,7 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
|
148
150
|
children: [topText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
149
151
|
style: staticStyles.topText,
|
|
150
152
|
children: (0, _renderTypography.default)(topText, topTextTypographyTokens)
|
|
151
|
-
}) : null, (0, _renderPrice.default)(price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens), bottomText ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
153
|
+
}) : null, (0, _renderPrice.default)(price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens, isPriceBaseline), bottomText ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
152
154
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
|
|
153
155
|
testID: "price-lockup-divider",
|
|
154
156
|
role: "separator",
|
|
@@ -45,7 +45,7 @@ const renderAmount = (amount, amountTypographyTokens, strikeThrough, a11yText, f
|
|
|
45
45
|
}
|
|
46
46
|
return amountText;
|
|
47
47
|
};
|
|
48
|
-
const renderPrice = (price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens) => {
|
|
48
|
+
const renderPrice = (price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens, isPriceBaseline) => {
|
|
49
49
|
const priceString = price;
|
|
50
50
|
const lastDotPosition = priceString.lastIndexOf('.');
|
|
51
51
|
const lastCommaPosition = priceString.lastIndexOf(',');
|
|
@@ -66,7 +66,9 @@ const renderPrice = (price, rateText, ratePosition, signDirection, currencySymbo
|
|
|
66
66
|
style: staticStyles.priceContainer,
|
|
67
67
|
children: [signDirection === 'left' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
68
68
|
children: renderCurrencySymbol(currencySymbol, currencySymbolTypographyTokens, ratePosition, fontColor)
|
|
69
|
-
}) : null,
|
|
69
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, {
|
|
70
|
+
children: [renderAmount(amount, amountTypographyTokens, strikeThrough, a11yText, fontColor, themeTokens), isPriceBaseline && cents && renderAmount(`${separator}${cents}`, centsTypographyTokens, strikeThrough, a11yText, fontColor, themeTokens)]
|
|
71
|
+
}), cents && !isPriceBaseline ? (0, _renderTypography.default)(`${separator}${cents}`, centsTypographyTokens, undefined, fontColor) : null, signDirection === 'right' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
70
72
|
style: staticStyles.currencySymbol,
|
|
71
73
|
children: renderCurrencySymbol(currencySymbol, currencySymbolTypographyTokens, ratePosition, fontColor)
|
|
72
74
|
}) : null]
|
|
@@ -125,7 +125,10 @@ const PressableCardBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
125
125
|
setFocused(false);
|
|
126
126
|
setPressed(false);
|
|
127
127
|
},
|
|
128
|
-
style:
|
|
128
|
+
style: {
|
|
129
|
+
...staticStyles.linkContainer,
|
|
130
|
+
textDecoration: 'none'
|
|
131
|
+
},
|
|
129
132
|
...(hrefAttrs || {}),
|
|
130
133
|
role: accessibilityRole,
|
|
131
134
|
children: /*#__PURE__*/_jsx(CardBase, {
|
|
@@ -170,8 +173,7 @@ const staticStyles = StyleSheet.create({
|
|
|
170
173
|
},
|
|
171
174
|
linkContainer: {
|
|
172
175
|
flex: 1,
|
|
173
|
-
display: 'flex'
|
|
174
|
-
textDecoration: 'none'
|
|
176
|
+
display: 'flex'
|
|
175
177
|
}
|
|
176
178
|
});
|
|
177
179
|
PressableCardBase.displayName = 'PressableCardBase';
|
|
@@ -10,6 +10,7 @@ import renderFootnoteContent from './utils/renderFootnoteContent';
|
|
|
10
10
|
import renderPrice from './utils/renderPrice';
|
|
11
11
|
import renderTypography from './utils/renderTypography';
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const PRICE_BASELINE_VARIANT = 'baseline';
|
|
13
14
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs, viewProps]);
|
|
14
15
|
const selectTopTextTypographyTokens = _ref => {
|
|
15
16
|
let {
|
|
@@ -134,6 +135,7 @@ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
|
134
135
|
const rateTypographyTokens = selectRateTypographyTokens(themeTokens);
|
|
135
136
|
const topTextTypographyTokens = selectTopTextTypographyTokens(themeTokens);
|
|
136
137
|
const bottomTextTypographyTokens = selectBottomTextTypographyTokens(themeTokens);
|
|
138
|
+
const isPriceBaseline = variant?.price === PRICE_BASELINE_VARIANT;
|
|
137
139
|
return /*#__PURE__*/_jsxs(View, {
|
|
138
140
|
style: [staticStyles.priceLockupContainer, selectContainertokens(themeTokens)],
|
|
139
141
|
ref: ref,
|
|
@@ -141,7 +143,7 @@ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
|
141
143
|
children: [topText ? /*#__PURE__*/_jsx(View, {
|
|
142
144
|
style: staticStyles.topText,
|
|
143
145
|
children: renderTypography(topText, topTextTypographyTokens)
|
|
144
|
-
}) : null, renderPrice(price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens), bottomText ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
146
|
+
}) : null, renderPrice(price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens, isPriceBaseline), bottomText ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
145
147
|
children: [/*#__PURE__*/_jsx(Divider, {
|
|
146
148
|
testID: "price-lockup-divider",
|
|
147
149
|
role: "separator",
|
|
@@ -38,7 +38,7 @@ const renderAmount = (amount, amountTypographyTokens, strikeThrough, a11yText, f
|
|
|
38
38
|
}
|
|
39
39
|
return amountText;
|
|
40
40
|
};
|
|
41
|
-
const renderPrice = (price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens) => {
|
|
41
|
+
const renderPrice = (price, rateText, ratePosition, signDirection, currencySymbol, currencySymbolTypographyTokens, amountTypographyTokens, centsTypographyTokens, rateTypographyTokens, fontColor, strikeThrough, a11yText, bottomText, bottomLinksMarginLeft, footnoteLinks, onClickFootnote, themeTokens, isPriceBaseline) => {
|
|
42
42
|
const priceString = price;
|
|
43
43
|
const lastDotPosition = priceString.lastIndexOf('.');
|
|
44
44
|
const lastCommaPosition = priceString.lastIndexOf(',');
|
|
@@ -59,7 +59,9 @@ const renderPrice = (price, rateText, ratePosition, signDirection, currencySymbo
|
|
|
59
59
|
style: staticStyles.priceContainer,
|
|
60
60
|
children: [signDirection === 'left' ? /*#__PURE__*/_jsx(Text, {
|
|
61
61
|
children: renderCurrencySymbol(currencySymbol, currencySymbolTypographyTokens, ratePosition, fontColor)
|
|
62
|
-
}) : null,
|
|
62
|
+
}) : null, /*#__PURE__*/_jsxs(Text, {
|
|
63
|
+
children: [renderAmount(amount, amountTypographyTokens, strikeThrough, a11yText, fontColor, themeTokens), isPriceBaseline && cents && renderAmount(`${separator}${cents}`, centsTypographyTokens, strikeThrough, a11yText, fontColor, themeTokens)]
|
|
64
|
+
}), cents && !isPriceBaseline ? renderTypography(`${separator}${cents}`, centsTypographyTokens, undefined, fontColor) : null, signDirection === 'right' ? /*#__PURE__*/_jsx(Text, {
|
|
63
65
|
style: staticStyles.currencySymbol,
|
|
64
66
|
children: renderCurrencySymbol(currencySymbol, currencySymbolTypographyTokens, ratePosition, fontColor)
|
|
65
67
|
}) : null]
|
package/lib/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@gorhom/portal": "^1.0.14",
|
|
13
13
|
"@react-native-picker/picker": "^2.9.0",
|
|
14
14
|
"@telus-uds/system-constants": "^3.0.0",
|
|
15
|
-
"@telus-uds/system-theme-tokens": "^4.
|
|
15
|
+
"@telus-uds/system-theme-tokens": "^4.14.0",
|
|
16
16
|
"airbnb-prop-types": "^2.16.0",
|
|
17
17
|
"css-mediaquery": "^0.1.2",
|
|
18
18
|
"expo-document-picker": "^13.0.1",
|
|
@@ -84,6 +84,6 @@
|
|
|
84
84
|
"standard-engine": {
|
|
85
85
|
"skip": true
|
|
86
86
|
},
|
|
87
|
-
"version": "3.
|
|
87
|
+
"version": "3.17.1",
|
|
88
88
|
"types": "types/index.d.ts"
|
|
89
89
|
}
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@gorhom/portal": "^1.0.14",
|
|
13
13
|
"@react-native-picker/picker": "^2.9.0",
|
|
14
14
|
"@telus-uds/system-constants": "^3.0.0",
|
|
15
|
-
"@telus-uds/system-theme-tokens": "^4.
|
|
15
|
+
"@telus-uds/system-theme-tokens": "^4.14.0",
|
|
16
16
|
"airbnb-prop-types": "^2.16.0",
|
|
17
17
|
"css-mediaquery": "^0.1.2",
|
|
18
18
|
"expo-document-picker": "^13.0.1",
|
|
@@ -84,6 +84,6 @@
|
|
|
84
84
|
"standard-engine": {
|
|
85
85
|
"skip": true
|
|
86
86
|
},
|
|
87
|
-
"version": "3.
|
|
87
|
+
"version": "3.17.1",
|
|
88
88
|
"types": "types/index.d.ts"
|
|
89
89
|
}
|
|
@@ -159,7 +159,7 @@ const PressableCardBase = React.forwardRef(
|
|
|
159
159
|
setFocused(false)
|
|
160
160
|
setPressed(false)
|
|
161
161
|
}}
|
|
162
|
-
style={staticStyles.linkContainer}
|
|
162
|
+
style={{ ...staticStyles.linkContainer, textDecoration: 'none' }}
|
|
163
163
|
{...(hrefAttrs || {})}
|
|
164
164
|
role={accessibilityRole}
|
|
165
165
|
>
|
|
@@ -204,8 +204,7 @@ const staticStyles = StyleSheet.create({
|
|
|
204
204
|
},
|
|
205
205
|
linkContainer: {
|
|
206
206
|
flex: 1,
|
|
207
|
-
display: 'flex'
|
|
208
|
-
textDecoration: 'none'
|
|
207
|
+
display: 'flex'
|
|
209
208
|
}
|
|
210
209
|
})
|
|
211
210
|
|
|
@@ -9,6 +9,8 @@ import renderFootnoteContent from './utils/renderFootnoteContent'
|
|
|
9
9
|
import renderPrice from './utils/renderPrice'
|
|
10
10
|
import renderTypography from './utils/renderTypography'
|
|
11
11
|
|
|
12
|
+
const PRICE_BASELINE_VARIANT = 'baseline'
|
|
13
|
+
|
|
12
14
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs, viewProps])
|
|
13
15
|
|
|
14
16
|
const selectTopTextTypographyTokens = ({ topTextFontSize, topTextLineHeight }) => ({
|
|
@@ -109,6 +111,8 @@ const PriceLockup = React.forwardRef(
|
|
|
109
111
|
const topTextTypographyTokens = selectTopTextTypographyTokens(themeTokens)
|
|
110
112
|
const bottomTextTypographyTokens = selectBottomTextTypographyTokens(themeTokens)
|
|
111
113
|
|
|
114
|
+
const isPriceBaseline = variant?.price === PRICE_BASELINE_VARIANT
|
|
115
|
+
|
|
112
116
|
return (
|
|
113
117
|
<View
|
|
114
118
|
style={[staticStyles.priceLockupContainer, selectContainertokens(themeTokens)]}
|
|
@@ -137,7 +141,8 @@ const PriceLockup = React.forwardRef(
|
|
|
137
141
|
bottomLinksMarginLeft,
|
|
138
142
|
footnoteLinks,
|
|
139
143
|
onClickFootnote,
|
|
140
|
-
themeTokens
|
|
144
|
+
themeTokens,
|
|
145
|
+
isPriceBaseline
|
|
141
146
|
)}
|
|
142
147
|
{bottomText ? (
|
|
143
148
|
<>
|
|
@@ -59,7 +59,8 @@ const renderPrice = (
|
|
|
59
59
|
bottomLinksMarginLeft,
|
|
60
60
|
footnoteLinks,
|
|
61
61
|
onClickFootnote,
|
|
62
|
-
themeTokens
|
|
62
|
+
themeTokens,
|
|
63
|
+
isPriceBaseline
|
|
63
64
|
) => {
|
|
64
65
|
const priceString = price
|
|
65
66
|
const lastDotPosition = priceString.lastIndexOf('.')
|
|
@@ -80,6 +81,7 @@ const renderPrice = (
|
|
|
80
81
|
: staticStyles.footnoteLinksWithoutBottomTextAndRateText
|
|
81
82
|
|
|
82
83
|
const MAX_FOOTNOTE_LINKS_ALLOWED = 3
|
|
84
|
+
|
|
83
85
|
return (
|
|
84
86
|
<>
|
|
85
87
|
<View
|
|
@@ -100,15 +102,29 @@ const renderPrice = (
|
|
|
100
102
|
)}
|
|
101
103
|
</Text>
|
|
102
104
|
) : null}
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
{
|
|
106
|
+
<Text>
|
|
107
|
+
{renderAmount(
|
|
108
|
+
amount,
|
|
109
|
+
amountTypographyTokens,
|
|
110
|
+
strikeThrough,
|
|
111
|
+
a11yText,
|
|
112
|
+
fontColor,
|
|
113
|
+
themeTokens
|
|
114
|
+
)}
|
|
115
|
+
{isPriceBaseline &&
|
|
116
|
+
cents &&
|
|
117
|
+
renderAmount(
|
|
118
|
+
`${separator}${cents}`,
|
|
119
|
+
centsTypographyTokens,
|
|
120
|
+
strikeThrough,
|
|
121
|
+
a11yText,
|
|
122
|
+
fontColor,
|
|
123
|
+
themeTokens
|
|
124
|
+
)}
|
|
125
|
+
</Text>
|
|
126
|
+
}
|
|
127
|
+
{cents && !isPriceBaseline
|
|
112
128
|
? renderTypography(`${separator}${cents}`, centsTypographyTokens, undefined, fontColor)
|
|
113
129
|
: null}
|
|
114
130
|
{signDirection === 'right' ? (
|