@telus-uds/components-base 3.16.0 → 3.17.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 +5 -8
- package/lib/cjs/PriceLockup/PriceLockup.js +3 -1
- package/lib/cjs/PriceLockup/utils/renderPrice.js +4 -2
- 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/PriceLockup/PriceLockup.jsx +6 -1
- package/src/PriceLockup/utils/renderPrice.jsx +26 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
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 04:42:14 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 3.
|
|
7
|
+
## 3.17.0
|
|
8
8
|
|
|
9
|
-
Fri, 12 Sep 2025
|
|
9
|
+
Fri, 12 Sep 2025 04:42:14 GMT
|
|
10
10
|
|
|
11
11
|
### Minor changes
|
|
12
12
|
|
|
13
|
-
- `
|
|
14
|
-
|
|
15
|
-
### Patches
|
|
16
|
-
|
|
17
|
-
- `Card`: Fix an a11y issue that makes a VoiceOver app announce "link" two times. (guillermo.peitzner@telus.com)
|
|
13
|
+
- `PriceLockup`: add price baseline variant (guillermo.peitzner@telus.com)
|
|
14
|
+
- Bump @telus-uds/system-theme-tokens to v4.14.0
|
|
18
15
|
|
|
19
16
|
## 3.13.0
|
|
20
17
|
|
|
@@ -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]
|
|
@@ -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.0",
|
|
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.0",
|
|
88
88
|
"types": "types/index.d.ts"
|
|
89
89
|
}
|
|
@@ -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' ? (
|