@telus-uds/components-base 1.75.0 → 1.77.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 +31 -2
- package/lib/Box/Box.js +112 -7
- package/lib/Box/backgroundImageStylesMap.js +101 -0
- package/lib/Carousel/CarouselThumbnail.js +10 -4
- package/lib/Carousel/CarouselThumbnailNavigation.js +3 -3
- package/lib/ExpandCollapse/Panel.js +21 -10
- package/lib/Footnote/Footnote.js +9 -13
- package/lib/Link/ChevronLink.js +2 -0
- package/lib/Link/InlinePressable.js +15 -2
- package/lib/Link/LinkBase.js +1 -0
- package/lib/OrderedList/OrderedList.js +21 -20
- package/lib/PriceLockup/PriceLockup.js +220 -0
- package/lib/PriceLockup/index.js +10 -0
- package/lib/PriceLockup/utils/renderFootnoteContent.js +93 -0
- package/lib/PriceLockup/utils/renderFootnoteLinks.js +36 -0
- package/lib/PriceLockup/utils/renderPrice.js +147 -0
- package/lib/PriceLockup/utils/renderTypography.js +31 -0
- package/lib/Skeleton/Skeleton.js +6 -3
- package/lib/index.js +8 -0
- package/lib-module/Box/Box.js +115 -9
- package/lib-module/Box/backgroundImageStylesMap.js +94 -0
- package/lib-module/Carousel/CarouselThumbnail.js +10 -4
- package/lib-module/Carousel/CarouselThumbnailNavigation.js +3 -3
- package/lib-module/ExpandCollapse/Panel.js +21 -10
- package/lib-module/Footnote/Footnote.js +9 -13
- package/lib-module/Link/ChevronLink.js +2 -0
- package/lib-module/Link/InlinePressable.js +16 -2
- package/lib-module/Link/LinkBase.js +1 -0
- package/lib-module/OrderedList/OrderedList.js +21 -20
- package/lib-module/PriceLockup/PriceLockup.js +214 -0
- package/lib-module/PriceLockup/index.js +2 -0
- package/lib-module/PriceLockup/utils/renderFootnoteContent.js +87 -0
- package/lib-module/PriceLockup/utils/renderFootnoteLinks.js +28 -0
- package/lib-module/PriceLockup/utils/renderPrice.js +141 -0
- package/lib-module/PriceLockup/utils/renderTypography.js +23 -0
- package/lib-module/Skeleton/Skeleton.js +6 -3
- package/lib-module/index.js +1 -0
- package/package.json +2 -2
- package/src/Box/Box.jsx +120 -9
- package/src/Box/backgroundImageStylesMap.js +21 -0
- package/src/Carousel/CarouselThumbnail.jsx +8 -6
- package/src/Carousel/CarouselThumbnailNavigation.jsx +3 -4
- package/src/ExpandCollapse/Panel.jsx +16 -10
- package/src/Footnote/Footnote.jsx +3 -6
- package/src/Link/ChevronLink.jsx +5 -1
- package/src/Link/InlinePressable.jsx +36 -15
- package/src/Link/LinkBase.jsx +1 -0
- package/src/OrderedList/OrderedList.jsx +17 -20
- package/src/PriceLockup/PriceLockup.jsx +218 -0
- package/src/PriceLockup/index.js +3 -0
- package/src/PriceLockup/utils/renderFootnoteContent.jsx +77 -0
- package/src/PriceLockup/utils/renderFootnoteLinks.jsx +38 -0
- package/src/PriceLockup/utils/renderPrice.jsx +201 -0
- package/src/PriceLockup/utils/renderTypography.jsx +13 -0
- package/src/Skeleton/Skeleton.jsx +8 -3
- package/src/index.js +1 -0
- package/types/Typography.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 14 Feb 2024 02:21:15 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.77.0
|
|
8
|
+
|
|
9
|
+
Wed, 14 Feb 2024 02:21:15 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- add background-image to box component (guillermo.peitzner@telus.com)
|
|
14
|
+
- skeleton border radius for line shape (tim.hysniu@telus.com)
|
|
15
|
+
- Bump @telus-uds/system-theme-tokens to v2.51.0
|
|
16
|
+
|
|
17
|
+
### Patches
|
|
18
|
+
|
|
19
|
+
- fix expand-collapse visual states for koodo theme (guillermo.peitzner@telus.com)
|
|
20
|
+
|
|
21
|
+
## 1.76.0
|
|
22
|
+
|
|
23
|
+
Wed, 07 Feb 2024 19:14:07 GMT
|
|
24
|
+
|
|
25
|
+
### Minor changes
|
|
26
|
+
|
|
27
|
+
- Changes to enable the key recogniztion in the press state (35577399+JoshHC@users.noreply.github.com)
|
|
28
|
+
- carouselThumbnail component modified to match design intention (35577399+JoshHC@users.noreply.github.com)
|
|
29
|
+
- refactor(PriceLockup): started the migration to component-base (chris.tafts@telus.com)
|
|
30
|
+
- refactor(PriceLuckup): started the migration to component-base (chris.tafts@telus.com)
|
|
31
|
+
|
|
32
|
+
### Patches
|
|
33
|
+
|
|
34
|
+
- fix ordered-list component single child render (guillermo.peitzner@telus.com)
|
|
35
|
+
|
|
7
36
|
## 1.75.0
|
|
8
37
|
|
|
9
|
-
Mon, 29 Jan 2024 18:
|
|
38
|
+
Mon, 29 Jan 2024 18:41:50 GMT
|
|
10
39
|
|
|
11
40
|
### Minor changes
|
|
12
41
|
|
package/lib/Box/Box.js
CHANGED
|
@@ -9,8 +9,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
10
10
|
var _ScrollView = _interopRequireDefault(require("react-native-web/dist/cjs/exports/ScrollView"));
|
|
11
11
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
12
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
13
|
+
var _ImageBackground = _interopRequireDefault(require("react-native-web/dist/cjs/exports/ImageBackground"));
|
|
14
|
+
var _Image = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Image"));
|
|
12
15
|
var _ThemeProvider = require("../ThemeProvider");
|
|
13
16
|
var _utils = require("../utils");
|
|
17
|
+
var _backgroundImageStylesMap = _interopRequireDefault(require("./backgroundImageStylesMap"));
|
|
14
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -65,6 +69,45 @@ const selectBoxStyles = (_ref, customGradient) => {
|
|
|
65
69
|
});
|
|
66
70
|
return styles;
|
|
67
71
|
};
|
|
72
|
+
const setBackgroundImage = _ref2 => {
|
|
73
|
+
let {
|
|
74
|
+
src,
|
|
75
|
+
alt,
|
|
76
|
+
backgroundImageResizeMode,
|
|
77
|
+
backgroundImagePosition,
|
|
78
|
+
backgroundImageAlign,
|
|
79
|
+
backgroundImageWidth,
|
|
80
|
+
backgroundImageHeight,
|
|
81
|
+
content
|
|
82
|
+
} = _ref2;
|
|
83
|
+
if (backgroundImageResizeMode === 'contain') {
|
|
84
|
+
const containedViewStyle = {
|
|
85
|
+
...staticStyles.containedView,
|
|
86
|
+
width: backgroundImageWidth,
|
|
87
|
+
height: backgroundImageHeight,
|
|
88
|
+
..._backgroundImageStylesMap.default[`${backgroundImagePosition}-${backgroundImageAlign}`]
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
91
|
+
style: staticStyles.containedContainer,
|
|
92
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
93
|
+
style: containedViewStyle,
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
|
|
95
|
+
source: src,
|
|
96
|
+
alt: alt,
|
|
97
|
+
style: staticStyles.containedImage,
|
|
98
|
+
accessibilityIgnoresInvertColors: true
|
|
99
|
+
})
|
|
100
|
+
}), content]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageBackground.default, {
|
|
104
|
+
source: src,
|
|
105
|
+
alt: alt,
|
|
106
|
+
style: staticStyles.backgroundImageContainer,
|
|
107
|
+
resizeMode: backgroundImageResizeMode,
|
|
108
|
+
children: content
|
|
109
|
+
});
|
|
110
|
+
};
|
|
68
111
|
|
|
69
112
|
/**
|
|
70
113
|
* A layout utility component. Use Box to create space (padding) around content.
|
|
@@ -131,7 +174,7 @@ const selectBoxStyles = (_ref, customGradient) => {
|
|
|
131
174
|
* text content is inside a scrollable box, as screens are not scrollable by default and even very
|
|
132
175
|
* short text will require scrolling on small devices at the highest accessibility text scaling settings.
|
|
133
176
|
*/
|
|
134
|
-
const Box = /*#__PURE__*/(0, _react.forwardRef)((
|
|
177
|
+
const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
135
178
|
let {
|
|
136
179
|
space,
|
|
137
180
|
horizontal = space,
|
|
@@ -150,8 +193,9 @@ const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
150
193
|
testID,
|
|
151
194
|
dataSet,
|
|
152
195
|
customGradient,
|
|
196
|
+
backgroundImage,
|
|
153
197
|
...rest
|
|
154
|
-
} =
|
|
198
|
+
} = _ref3;
|
|
155
199
|
const props = {
|
|
156
200
|
accessibilityRole,
|
|
157
201
|
...(0, _utils.getA11yPropsFromHtmlTag)(tag, accessibilityRole),
|
|
@@ -166,7 +210,41 @@ const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
166
210
|
paddingBottom: (0, _utils.useSpacingScale)(bottom),
|
|
167
211
|
...selectBoxStyles(themeTokens, customGradient)
|
|
168
212
|
};
|
|
169
|
-
|
|
213
|
+
let content = children;
|
|
214
|
+
if (typeof customGradient === 'function') content = customGradient(styles.colors, styles)(children);
|
|
215
|
+
const {
|
|
216
|
+
src = '',
|
|
217
|
+
alt = '',
|
|
218
|
+
resizeMode = '',
|
|
219
|
+
position = '',
|
|
220
|
+
align = ''
|
|
221
|
+
} = backgroundImage || {};
|
|
222
|
+
const backgroundImageResizeMode = (0, _utils.useResponsiveProp)(resizeMode, 'cover');
|
|
223
|
+
const backgroundImagePosition = (0, _utils.useResponsiveProp)(position, 'none');
|
|
224
|
+
const backgroundImageAlign = (0, _utils.useResponsiveProp)(align, 'stretch');
|
|
225
|
+
const [backgroundImageWidth, setBackgroundImageWidth] = (0, _react.useState)(0);
|
|
226
|
+
const [backgroundImageHeight, setBackgroundImageHeight] = (0, _react.useState)(0);
|
|
227
|
+
if (backgroundImage) content = setBackgroundImage({
|
|
228
|
+
src,
|
|
229
|
+
alt,
|
|
230
|
+
backgroundImageResizeMode,
|
|
231
|
+
backgroundImagePosition,
|
|
232
|
+
backgroundImageAlign,
|
|
233
|
+
backgroundImageWidth,
|
|
234
|
+
backgroundImageHeight,
|
|
235
|
+
content
|
|
236
|
+
});
|
|
237
|
+
(0, _react.useEffect)(() => {
|
|
238
|
+
if (backgroundImage && backgroundImageWidth === 0 && backgroundImageHeight === 0) {
|
|
239
|
+
_Image.default.getSize(src, (width, height) => {
|
|
240
|
+
// Only update the state if the size has changed
|
|
241
|
+
if (width !== backgroundImageWidth || height !== backgroundImageHeight) {
|
|
242
|
+
setBackgroundImageWidth(width);
|
|
243
|
+
setBackgroundImageHeight(height);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}, [backgroundImage, backgroundImageWidth, backgroundImageHeight, src]);
|
|
170
248
|
if (scroll) {
|
|
171
249
|
const scrollProps = typeof scroll === 'object' ? scroll : {};
|
|
172
250
|
scrollProps.contentContainerStyle = [styles, scrollProps.contentContainerStyle];
|
|
@@ -176,7 +254,7 @@ const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
176
254
|
testID: testID,
|
|
177
255
|
dataSet: dataSet,
|
|
178
256
|
ref: ref,
|
|
179
|
-
children:
|
|
257
|
+
children: content
|
|
180
258
|
});
|
|
181
259
|
}
|
|
182
260
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
@@ -185,7 +263,7 @@ const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
185
263
|
testID: testID,
|
|
186
264
|
dataSet: dataSet,
|
|
187
265
|
ref: ref,
|
|
188
|
-
children:
|
|
266
|
+
children: content
|
|
189
267
|
});
|
|
190
268
|
});
|
|
191
269
|
Box.displayName = 'Box';
|
|
@@ -273,7 +351,34 @@ Box.propTypes = {
|
|
|
273
351
|
/**
|
|
274
352
|
Use this prop if need to add a custom gradient for mobile
|
|
275
353
|
*/
|
|
276
|
-
customGradient: _propTypes.default.func
|
|
354
|
+
customGradient: _propTypes.default.func,
|
|
355
|
+
/**
|
|
356
|
+
* Use this prop to add a background image to the box.
|
|
357
|
+
*/
|
|
358
|
+
backgroundImage: _propTypes.default.shape({
|
|
359
|
+
src: _propTypes.default.string.isRequired,
|
|
360
|
+
alt: _propTypes.default.string,
|
|
361
|
+
resizeMode: _utils.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center'])),
|
|
362
|
+
position: _utils.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(['none', 'bottom', 'left', 'right', 'top'])),
|
|
363
|
+
align: _utils.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(['start', 'end', 'center', 'stretch']))
|
|
364
|
+
})
|
|
277
365
|
};
|
|
278
366
|
var _default = Box;
|
|
279
|
-
exports.default = _default;
|
|
367
|
+
exports.default = _default;
|
|
368
|
+
const staticStyles = _StyleSheet.default.create({
|
|
369
|
+
backgroundImageContainer: {
|
|
370
|
+
flex: 1
|
|
371
|
+
},
|
|
372
|
+
containedContainer: {
|
|
373
|
+
flex: 1,
|
|
374
|
+
overflow: 'hidden'
|
|
375
|
+
},
|
|
376
|
+
containedView: {
|
|
377
|
+
zIndex: -1,
|
|
378
|
+
position: 'absolute'
|
|
379
|
+
},
|
|
380
|
+
containedImage: {
|
|
381
|
+
width: '100%',
|
|
382
|
+
height: '100%'
|
|
383
|
+
}
|
|
384
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
'top-start': {
|
|
9
|
+
top: 0
|
|
10
|
+
},
|
|
11
|
+
'top-center': {
|
|
12
|
+
left: 0,
|
|
13
|
+
right: 0,
|
|
14
|
+
marginHorizontal: 'auto'
|
|
15
|
+
},
|
|
16
|
+
'top-end': {
|
|
17
|
+
top: 0,
|
|
18
|
+
right: 0
|
|
19
|
+
},
|
|
20
|
+
'right-start': {
|
|
21
|
+
top: 0,
|
|
22
|
+
right: 0
|
|
23
|
+
},
|
|
24
|
+
'left-start': {
|
|
25
|
+
top: 0
|
|
26
|
+
},
|
|
27
|
+
'left-center': {
|
|
28
|
+
top: 0,
|
|
29
|
+
bottom: 0,
|
|
30
|
+
marginVertical: 'auto'
|
|
31
|
+
},
|
|
32
|
+
'none-start': {
|
|
33
|
+
top: 0,
|
|
34
|
+
bottom: 0,
|
|
35
|
+
marginVertical: 'auto'
|
|
36
|
+
},
|
|
37
|
+
'none-center': {
|
|
38
|
+
top: 0,
|
|
39
|
+
bottom: 0,
|
|
40
|
+
left: 0,
|
|
41
|
+
right: 0,
|
|
42
|
+
margin: 'auto'
|
|
43
|
+
},
|
|
44
|
+
'right-center': {
|
|
45
|
+
top: 0,
|
|
46
|
+
bottom: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
marginVertical: 'auto'
|
|
49
|
+
},
|
|
50
|
+
'none-end': {
|
|
51
|
+
top: 0,
|
|
52
|
+
bottom: 0,
|
|
53
|
+
right: 0,
|
|
54
|
+
marginVertical: 'auto'
|
|
55
|
+
},
|
|
56
|
+
'bottom-start': {
|
|
57
|
+
bottom: 0,
|
|
58
|
+
left: 0
|
|
59
|
+
},
|
|
60
|
+
'left-end': {
|
|
61
|
+
bottom: 0,
|
|
62
|
+
left: 0
|
|
63
|
+
},
|
|
64
|
+
'bottom-center': {
|
|
65
|
+
left: 0,
|
|
66
|
+
right: 0,
|
|
67
|
+
bottom: 0,
|
|
68
|
+
marginHorizontal: 'auto'
|
|
69
|
+
},
|
|
70
|
+
'bottom-end': {
|
|
71
|
+
right: 0,
|
|
72
|
+
bottom: 0
|
|
73
|
+
},
|
|
74
|
+
'right-end': {
|
|
75
|
+
right: 0,
|
|
76
|
+
bottom: 0
|
|
77
|
+
},
|
|
78
|
+
'top-stretch': {
|
|
79
|
+
left: 0,
|
|
80
|
+
right: 0,
|
|
81
|
+
width: '100%'
|
|
82
|
+
},
|
|
83
|
+
'left-stretch': {
|
|
84
|
+
top: 0,
|
|
85
|
+
bottom: 0,
|
|
86
|
+
height: '100%'
|
|
87
|
+
},
|
|
88
|
+
'right-stretch': {
|
|
89
|
+
top: 0,
|
|
90
|
+
bottom: 0,
|
|
91
|
+
right: 0,
|
|
92
|
+
height: '100%'
|
|
93
|
+
},
|
|
94
|
+
'bottom-stretch': {
|
|
95
|
+
left: 0,
|
|
96
|
+
right: 0,
|
|
97
|
+
bottom: 0,
|
|
98
|
+
width: '100%'
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
exports.default = _default;
|
|
@@ -61,7 +61,8 @@ const CarouselThumbnail = _ref2 => {
|
|
|
61
61
|
padding,
|
|
62
62
|
selectedBorderColor,
|
|
63
63
|
selectedBorderWidth,
|
|
64
|
-
size
|
|
64
|
+
size,
|
|
65
|
+
margin
|
|
65
66
|
} = getThumbnailTokens({
|
|
66
67
|
viewport
|
|
67
68
|
});
|
|
@@ -73,7 +74,12 @@ const CarouselThumbnail = _ref2 => {
|
|
|
73
74
|
selected: {
|
|
74
75
|
borderColor: selectedBorderColor,
|
|
75
76
|
borderWidth: selectedBorderWidth,
|
|
76
|
-
padding: padding - selectedBorderWidth
|
|
77
|
+
padding: padding - selectedBorderWidth,
|
|
78
|
+
marginBottom: margin + selectedBorderWidth
|
|
79
|
+
},
|
|
80
|
+
nonSelected: {
|
|
81
|
+
padding: padding - borderWidth,
|
|
82
|
+
marginBottom: margin + selectedBorderWidth
|
|
77
83
|
}
|
|
78
84
|
};
|
|
79
85
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
@@ -90,9 +96,9 @@ const CarouselThumbnail = _ref2 => {
|
|
|
90
96
|
pressed,
|
|
91
97
|
focus: focused
|
|
92
98
|
}));
|
|
93
|
-
return [pressableStyles, index === activeIndex
|
|
99
|
+
return [pressableStyles, index === activeIndex ? [styles.selected, {
|
|
94
100
|
outline: 'none'
|
|
95
|
-
}];
|
|
101
|
+
}] : styles.nonSelected];
|
|
96
102
|
},
|
|
97
103
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
|
|
98
104
|
accessibilityIgnoresInvertColors: true,
|
|
@@ -33,8 +33,7 @@ const CarouselThumbnailNavigation = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
33
33
|
throw new Error('Thumbnail set provided does not match the number of slides in the carousel');
|
|
34
34
|
}
|
|
35
35
|
const {
|
|
36
|
-
containerPaddingTop: thumbnailContainerPaddingTop
|
|
37
|
-
margin: thumbnailMargin
|
|
36
|
+
containerPaddingTop: thumbnailContainerPaddingTop
|
|
38
37
|
} = (0, _ThemeProvider.useThemeTokens)('CarouselThumbnail');
|
|
39
38
|
const stackWrapTokens = {
|
|
40
39
|
justifyContent: 'flex-start'
|
|
@@ -42,13 +41,14 @@ const CarouselThumbnailNavigation = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
42
41
|
const containerStyles = {
|
|
43
42
|
justifyContent: 'center',
|
|
44
43
|
alignItems,
|
|
45
|
-
paddingTop: thumbnailContainerPaddingTop
|
|
44
|
+
paddingTop: thumbnailContainerPaddingTop
|
|
46
45
|
};
|
|
47
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
48
47
|
style: containerStyles,
|
|
49
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.StackWrap, {
|
|
50
49
|
direction: "row",
|
|
51
50
|
tokens: stackWrapTokens,
|
|
51
|
+
space: 2,
|
|
52
52
|
ref: ref,
|
|
53
53
|
children: thumbnails.map((_ref2, index) => {
|
|
54
54
|
let {
|
|
@@ -76,6 +76,14 @@ const selectContentPanelStyles = _ref3 => {
|
|
|
76
76
|
marginBottom
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
+
const selectControlPanelStyles = _ref4 => {
|
|
80
|
+
let {
|
|
81
|
+
contentPanelBackgroundColor
|
|
82
|
+
} = _ref4;
|
|
83
|
+
return {
|
|
84
|
+
backgroundColor: contentPanelBackgroundColor
|
|
85
|
+
};
|
|
86
|
+
};
|
|
79
87
|
|
|
80
88
|
/**
|
|
81
89
|
* An item in an `ExpandCollapse` which contains collapsible `children` and a `control` that opens
|
|
@@ -87,7 +95,7 @@ const selectContentPanelStyles = _ref3 => {
|
|
|
87
95
|
* The panel does not need to be a direct child of the `<ExpandCollapse>` (unless this is required
|
|
88
96
|
* by the chosen accessibility props for a particular accessibility tools).
|
|
89
97
|
*/
|
|
90
|
-
const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((
|
|
98
|
+
const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
91
99
|
let {
|
|
92
100
|
openIds = [],
|
|
93
101
|
panelId,
|
|
@@ -101,7 +109,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) =>
|
|
|
101
109
|
controlRef,
|
|
102
110
|
content,
|
|
103
111
|
...rest
|
|
104
|
-
} =
|
|
112
|
+
} = _ref5;
|
|
105
113
|
const [containerHeight, setContainerHeight] = (0, _react.useState)(null);
|
|
106
114
|
const isExpanded = openIds.includes(panelId);
|
|
107
115
|
const selectedProps = selectProps({
|
|
@@ -143,14 +151,17 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) =>
|
|
|
143
151
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
144
152
|
ref: ref,
|
|
145
153
|
style: themeTokens,
|
|
146
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
155
|
+
style: selectControlPanelStyles(themeTokens),
|
|
156
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Control.default, {
|
|
157
|
+
...selectedProps,
|
|
158
|
+
isExpanded: isExpanded,
|
|
159
|
+
tokens: controlTokens,
|
|
160
|
+
variant: variant,
|
|
161
|
+
onPress: handleControlPress,
|
|
162
|
+
ref: controlRef,
|
|
163
|
+
children: control
|
|
164
|
+
})
|
|
154
165
|
}), isExpanded && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
155
166
|
style: {
|
|
156
167
|
borderTopColor: themeTokens.expandDividerColor,
|
package/lib/Footnote/Footnote.js
CHANGED
|
@@ -173,19 +173,15 @@ const Footnote = _ref6 => {
|
|
|
173
173
|
children: content
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
return (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
})
|
|
186
|
-
}, number)]
|
|
187
|
-
})
|
|
188
|
-
);
|
|
176
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_OrderedList.default, {
|
|
177
|
+
start: number,
|
|
178
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OrderedList.default.Item, {
|
|
179
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
180
|
+
style: selectCustomContentFontStyle(themeTokens),
|
|
181
|
+
children: content
|
|
182
|
+
})
|
|
183
|
+
}, number)
|
|
184
|
+
});
|
|
189
185
|
}, [content, number, themeTokens]);
|
|
190
186
|
(0, _react.useEffect)(() => {
|
|
191
187
|
if (isOpen) {
|
package/lib/Link/ChevronLink.js
CHANGED
|
@@ -25,6 +25,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
25
|
tokens = {},
|
|
26
26
|
variant,
|
|
27
27
|
dataSet,
|
|
28
|
+
onPress,
|
|
28
29
|
...otherlinkProps
|
|
29
30
|
} = _ref;
|
|
30
31
|
const getChevronTokens = (0, _ThemeProvider.useThemeTokensCallback)('ChevronLink', tokens, variant);
|
|
@@ -53,6 +54,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
53
54
|
tokens: getTokens,
|
|
54
55
|
dataSet: dataSet,
|
|
55
56
|
ref: ref,
|
|
57
|
+
onPress: onPress,
|
|
56
58
|
children: children
|
|
57
59
|
});
|
|
58
60
|
});
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
|
|
9
9
|
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
10
|
+
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -24,17 +25,29 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
25
|
* @param {PressableProps} PressableProps
|
|
25
26
|
*/
|
|
26
27
|
// React Native exports prop Types but not propTypes, use JSDoc types here rather than duplicate RN
|
|
27
|
-
|
|
28
|
-
const InlinePressable = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
28
|
+
/* eslint-disable react/prop-types */const InlinePressable = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
29
29
|
let {
|
|
30
30
|
children,
|
|
31
31
|
inlineFlex = true,
|
|
32
32
|
style,
|
|
33
|
+
onPress,
|
|
33
34
|
...props
|
|
34
35
|
} = _ref;
|
|
36
|
+
const handlePress = (0, _react.useCallback)(() => {
|
|
37
|
+
if (onPress) {
|
|
38
|
+
onPress();
|
|
39
|
+
}
|
|
40
|
+
}, [onPress]);
|
|
41
|
+
const handleKeyPress = (0, _react.useCallback)(e => {
|
|
42
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
43
|
+
handlePress();
|
|
44
|
+
}
|
|
45
|
+
}, [handlePress]);
|
|
35
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
36
47
|
ref: ref,
|
|
37
48
|
style: pressState => [typeof style === 'function' ? style(pressState) : style, staticStyles[inlineFlex ? 'inlineFlex' : 'inline']],
|
|
49
|
+
onPress: handlePress,
|
|
50
|
+
onKeyDown: _Platform.default.OS === 'web' ? handleKeyPress : undefined,
|
|
38
51
|
...props,
|
|
39
52
|
children: pressState => typeof children === 'function' ? children(pressState) : children
|
|
40
53
|
});
|
package/lib/Link/LinkBase.js
CHANGED
|
@@ -187,6 +187,7 @@ const LinkBase = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
187
187
|
// assuming links without icons should be inline (even if they are long)
|
|
188
188
|
,
|
|
189
189
|
ref: ref,
|
|
190
|
+
keyboardShouldPersistTaps: "handled",
|
|
190
191
|
style: linkState => {
|
|
191
192
|
const themeTokens = resolveLinkTokens(linkState);
|
|
192
193
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens);
|
|
@@ -14,25 +14,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
16
|
const [selectProps, selectedSystemPropsTypes] = (0, _utils.selectSystemProps)([_utils.htmlAttrs, _utils.viewProps]);
|
|
17
|
-
const getChildrenWithParentVariants = (variant, children, start) => {
|
|
18
|
-
if (variant) return children.map((child, i) => {
|
|
19
|
-
var _child$props;
|
|
20
|
-
const existingChildVariants = ((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.variant) ?? {};
|
|
21
|
-
return {
|
|
22
|
-
...child,
|
|
23
|
-
props: {
|
|
24
|
-
...child.props,
|
|
25
|
-
index: start + i,
|
|
26
|
-
isLastChild: i === children.length - 1,
|
|
27
|
-
variant: {
|
|
28
|
-
...existingChildVariants,
|
|
29
|
-
...variant
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
return children;
|
|
35
|
-
};
|
|
36
17
|
const OrderedList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
37
18
|
let {
|
|
38
19
|
children,
|
|
@@ -40,7 +21,27 @@ const OrderedList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
40
21
|
variant,
|
|
41
22
|
...rest
|
|
42
23
|
} = _ref;
|
|
43
|
-
const childrenWithParentVariants = (0, _react.useMemo)(() =>
|
|
24
|
+
const childrenWithParentVariants = (0, _react.useMemo)(() => {
|
|
25
|
+
const addVariantToProps = (child, i, isLastChild) => {
|
|
26
|
+
var _child$props;
|
|
27
|
+
const existingChildVariants = ((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.variant) ?? {};
|
|
28
|
+
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
29
|
+
index: start + i,
|
|
30
|
+
isLastChild,
|
|
31
|
+
variant: {
|
|
32
|
+
...existingChildVariants,
|
|
33
|
+
...variant
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
if (variant) {
|
|
38
|
+
if (Array.isArray(children)) {
|
|
39
|
+
return children.map((child, i) => addVariantToProps(child, i, i === children.length - 1));
|
|
40
|
+
}
|
|
41
|
+
return [addVariantToProps(children, 0, true)];
|
|
42
|
+
}
|
|
43
|
+
return children;
|
|
44
|
+
}, [children, variant, start]);
|
|
44
45
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_OrderedListBase.default, {
|
|
45
46
|
ref: ref,
|
|
46
47
|
...selectProps(rest),
|