@telus-uds/components-base 1.54.0 → 1.55.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 +14 -2
- package/component-docs.json +135 -54
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +6 -2
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +9 -8
- package/lib/Carousel/CarouselThumbnail.js +53 -26
- package/lib/Carousel/CarouselThumbnailNavigation.js +15 -6
- package/lib/IconButton/IconButton.js +41 -7
- package/lib/ThemeProvider/utils/styles.js +18 -2
- package/lib/TooltipButton/TooltipButton.js +4 -2
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +6 -2
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +9 -8
- package/lib-module/Carousel/CarouselThumbnail.js +51 -27
- package/lib-module/Carousel/CarouselThumbnailNavigation.js +13 -6
- package/lib-module/IconButton/IconButton.js +41 -7
- package/lib-module/ThemeProvider/utils/styles.js +19 -2
- package/lib-module/TooltipButton/TooltipButton.js +4 -2
- package/package.json +3 -3
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +10 -2
- package/src/Carousel/CarouselTabs/CarouselTabsPanel.jsx +5 -5
- package/src/Carousel/CarouselThumbnail.jsx +31 -25
- package/src/Carousel/CarouselThumbnailNavigation.jsx +8 -3
- package/src/IconButton/IconButton.jsx +50 -6
- package/src/ThemeProvider/utils/styles.js +29 -2
- package/src/TooltipButton/TooltipButton.jsx +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri,
|
|
3
|
+
This log was last generated on Fri, 14 Jul 2023 19:38:21 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.55.0
|
|
8
|
+
|
|
9
|
+
Fri, 14 Jul 2023 19:38:21 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Refactored IconButton to accomodate QuantitySelector standardization (wlsdud194@hotmail.com)
|
|
14
|
+
- Fixed test data and introduced background color token to base component. (akshay.pandey1@telus.com)
|
|
15
|
+
- Added use of CarouselThumbnail (kyle.king2@telus.com)
|
|
16
|
+
- Bump @telus-uds/system-constants to v1.3.0
|
|
17
|
+
- Bump @telus-uds/system-theme-tokens to v2.38.0
|
|
18
|
+
|
|
7
19
|
## 1.54.0
|
|
8
20
|
|
|
9
|
-
Fri, 07 Jul 2023 19:
|
|
21
|
+
Fri, 07 Jul 2023 19:26:41 GMT
|
|
10
22
|
|
|
11
23
|
### Minor changes
|
|
12
24
|
|
package/component-docs.json
CHANGED
|
@@ -172,17 +172,40 @@
|
|
|
172
172
|
"itemPadding": "size"
|
|
173
173
|
},
|
|
174
174
|
"QuantitySelector": {
|
|
175
|
-
"leftIcon": "icon",
|
|
176
|
-
"rightIcon": "icon",
|
|
177
|
-
"iconSize": "size",
|
|
178
|
-
"borderColor": "color",
|
|
179
175
|
"inputBorderColor": "color",
|
|
180
176
|
"inputBackgroundColor": "color",
|
|
181
|
-
"inputBorderWidth": "
|
|
177
|
+
"inputBorderWidth": "border",
|
|
182
178
|
"padding": "size",
|
|
183
|
-
"
|
|
179
|
+
"paddingLeft": "size",
|
|
180
|
+
"paddingRight": "size",
|
|
181
|
+
"paddingTop": "size",
|
|
182
|
+
"paddingBottom": "size",
|
|
184
183
|
"textColor": "color",
|
|
185
|
-
"
|
|
184
|
+
"inputWidth": "size",
|
|
185
|
+
"lineHeight": "lineHeight",
|
|
186
|
+
"fontSize": "fontSize"
|
|
187
|
+
},
|
|
188
|
+
"QuantitySelectorSideButton": {
|
|
189
|
+
"borderRadius": "radius",
|
|
190
|
+
"borderTopLeftRadius": "radius",
|
|
191
|
+
"borderTopRightRadius": "radius",
|
|
192
|
+
"borderBottomLeftRadius": "radius",
|
|
193
|
+
"borderBottomRightRadius": "radius",
|
|
194
|
+
"borderColor": "color",
|
|
195
|
+
"borderWidth": "border",
|
|
196
|
+
"borderLeftWidth": "border",
|
|
197
|
+
"borderRightWidth": "border",
|
|
198
|
+
"borderTopWidth": "border",
|
|
199
|
+
"borderBottomWidth": "border",
|
|
200
|
+
"padding": "size",
|
|
201
|
+
"paddingLeft": "size",
|
|
202
|
+
"paddingRight": "size",
|
|
203
|
+
"paddingTop": "size",
|
|
204
|
+
"paddingBottom": "size",
|
|
205
|
+
"iconColor": "color",
|
|
206
|
+
"iconSize": "size",
|
|
207
|
+
"icon": "icon",
|
|
208
|
+
"backgroundColor": "color"
|
|
186
209
|
},
|
|
187
210
|
"Footnote": {
|
|
188
211
|
"footnoteBackground": "color",
|
|
@@ -270,6 +293,7 @@
|
|
|
270
293
|
},
|
|
271
294
|
"Badge": {
|
|
272
295
|
"fontWeight": "fontWeight",
|
|
296
|
+
"fontSize": "fontSize",
|
|
273
297
|
"fontName": "fontName",
|
|
274
298
|
"backgroundColor": "color",
|
|
275
299
|
"borderColor": "color",
|
|
@@ -465,15 +489,19 @@
|
|
|
465
489
|
"showPanelTabs": "show",
|
|
466
490
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
467
491
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
468
|
-
"
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
"
|
|
472
|
-
"
|
|
473
|
-
"
|
|
474
|
-
"
|
|
475
|
-
"
|
|
476
|
-
"
|
|
492
|
+
"stepTrackerCurrentBackgroundColor": "color"
|
|
493
|
+
},
|
|
494
|
+
"CarouselThumbnail": {
|
|
495
|
+
"alignItems": "flexAlign",
|
|
496
|
+
"borderColor": "color",
|
|
497
|
+
"borderRadius": "radius",
|
|
498
|
+
"borderWidth": "border",
|
|
499
|
+
"containerPaddingTop": "size",
|
|
500
|
+
"margin": "size",
|
|
501
|
+
"padding": "size",
|
|
502
|
+
"selectedBorderColor": "color",
|
|
503
|
+
"selectedBorderWidth": "border",
|
|
504
|
+
"size": "size"
|
|
477
505
|
},
|
|
478
506
|
"CarouselTabsPanelItem": {
|
|
479
507
|
"paddingLeft": "size",
|
|
@@ -739,6 +767,14 @@
|
|
|
739
767
|
"icon": "icon",
|
|
740
768
|
"backgroundColor": "color",
|
|
741
769
|
"borderRadius": "radius",
|
|
770
|
+
"borderTopLeftRadius": "radius",
|
|
771
|
+
"borderTopRightRadius": "radius",
|
|
772
|
+
"borderBottomLeftRadius": "radius",
|
|
773
|
+
"borderBottomRightRadius": "radius",
|
|
774
|
+
"borderTopWidth": "border",
|
|
775
|
+
"borderBottomWidth": "border",
|
|
776
|
+
"borderLeftWidth": "border",
|
|
777
|
+
"borderRightWidth": "border",
|
|
742
778
|
"borderColor": "color",
|
|
743
779
|
"borderWidth": "border",
|
|
744
780
|
"outerBorderWidth": "border",
|
|
@@ -1525,7 +1561,24 @@
|
|
|
1525
1561
|
"figcaptionGap": "size",
|
|
1526
1562
|
"textColor": "color",
|
|
1527
1563
|
"imageSize": "size",
|
|
1528
|
-
"icon": "icon"
|
|
1564
|
+
"icon": "icon",
|
|
1565
|
+
"iconFr": "icon",
|
|
1566
|
+
"testimonialFontSizeLarge": "fontSize",
|
|
1567
|
+
"testimonialLineHeightLarge": "lineHeight",
|
|
1568
|
+
"testimonialFontNameLarge": "fontName",
|
|
1569
|
+
"testimonialFontWeightLarge": "fontWeight",
|
|
1570
|
+
"testimonialFontSizeHeading": "fontSize",
|
|
1571
|
+
"testimonialLineHeightHeading": "lineHeight",
|
|
1572
|
+
"testimonialFontNameHeading": "fontName",
|
|
1573
|
+
"testimonialFontWeightHeading": "fontWeight",
|
|
1574
|
+
"authorFontSize": "fontSize",
|
|
1575
|
+
"authorLineHeight": "lineHeight",
|
|
1576
|
+
"authorFontName": "fontName",
|
|
1577
|
+
"authorFontWeight": "fontWeight",
|
|
1578
|
+
"additionalFontSize": "fontSize",
|
|
1579
|
+
"additionalLineHeight": "lineHeight",
|
|
1580
|
+
"additionalFontName": "fontName",
|
|
1581
|
+
"additionalFontWeight": "fontWeight"
|
|
1529
1582
|
},
|
|
1530
1583
|
"TermsAndConditions": {
|
|
1531
1584
|
"contentPaddingBottom": "size",
|
|
@@ -1721,6 +1774,7 @@
|
|
|
1721
1774
|
},
|
|
1722
1775
|
"TooltipButton": {
|
|
1723
1776
|
"outerBorderColor": "color",
|
|
1777
|
+
"backgroundColor": "color",
|
|
1724
1778
|
"outerBorderWidth": "border",
|
|
1725
1779
|
"outerBorderGap": "size",
|
|
1726
1780
|
"borderRadius": "radius",
|
|
@@ -2023,6 +2077,38 @@
|
|
|
2023
2077
|
"type": "state"
|
|
2024
2078
|
}
|
|
2025
2079
|
},
|
|
2080
|
+
"CarouselThumbnail": {
|
|
2081
|
+
"focus": {
|
|
2082
|
+
"description": "Currently only web has good support for this. Applies when an interactive component's focus handler is triggered, such as keyboard tabbing or selection.",
|
|
2083
|
+
"values": [
|
|
2084
|
+
true,
|
|
2085
|
+
false
|
|
2086
|
+
],
|
|
2087
|
+
"type": "state",
|
|
2088
|
+
"platforms": [
|
|
2089
|
+
"rn"
|
|
2090
|
+
]
|
|
2091
|
+
},
|
|
2092
|
+
"hover": {
|
|
2093
|
+
"description": "Currently web only. Applies when an interactive component's hover handler is triggered, such as on mouseover.",
|
|
2094
|
+
"values": [
|
|
2095
|
+
true,
|
|
2096
|
+
false
|
|
2097
|
+
],
|
|
2098
|
+
"type": "state",
|
|
2099
|
+
"platforms": [
|
|
2100
|
+
"rn"
|
|
2101
|
+
]
|
|
2102
|
+
},
|
|
2103
|
+
"pressed": {
|
|
2104
|
+
"description": "Applies while an interactive component is being physically pressed. Most visible on touchscreen taps; in React Native Web, this is visible on web mouse clicks only if the pressable is held down.",
|
|
2105
|
+
"values": [
|
|
2106
|
+
true,
|
|
2107
|
+
false
|
|
2108
|
+
],
|
|
2109
|
+
"type": "state"
|
|
2110
|
+
}
|
|
2111
|
+
},
|
|
2026
2112
|
"Checkbox": {
|
|
2027
2113
|
"checked": {
|
|
2028
2114
|
"description": "Corresponds to a selected state for a checkbox or radio",
|
|
@@ -2161,7 +2247,8 @@
|
|
|
2161
2247
|
"expanded": {
|
|
2162
2248
|
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
2163
2249
|
"values": [
|
|
2164
|
-
true
|
|
2250
|
+
true,
|
|
2251
|
+
false
|
|
2165
2252
|
],
|
|
2166
2253
|
"type": "state"
|
|
2167
2254
|
}
|
|
@@ -2183,7 +2270,8 @@
|
|
|
2183
2270
|
"expanded": {
|
|
2184
2271
|
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
2185
2272
|
"values": [
|
|
2186
|
-
true
|
|
2273
|
+
true,
|
|
2274
|
+
false
|
|
2187
2275
|
],
|
|
2188
2276
|
"type": "state"
|
|
2189
2277
|
}
|
|
@@ -2336,7 +2424,8 @@
|
|
|
2336
2424
|
"expanded": {
|
|
2337
2425
|
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
2338
2426
|
"values": [
|
|
2339
|
-
true
|
|
2427
|
+
true,
|
|
2428
|
+
false
|
|
2340
2429
|
],
|
|
2341
2430
|
"type": "state"
|
|
2342
2431
|
},
|
|
@@ -2433,7 +2522,8 @@
|
|
|
2433
2522
|
"expanded": {
|
|
2434
2523
|
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
2435
2524
|
"values": [
|
|
2436
|
-
true
|
|
2525
|
+
true,
|
|
2526
|
+
false
|
|
2437
2527
|
],
|
|
2438
2528
|
"type": "state"
|
|
2439
2529
|
},
|
|
@@ -2886,7 +2976,8 @@
|
|
|
2886
2976
|
"expanded": {
|
|
2887
2977
|
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
2888
2978
|
"values": [
|
|
2889
|
-
true
|
|
2979
|
+
true,
|
|
2980
|
+
false
|
|
2890
2981
|
],
|
|
2891
2982
|
"type": "state"
|
|
2892
2983
|
},
|
|
@@ -2917,7 +3008,8 @@
|
|
|
2917
3008
|
"expanded": {
|
|
2918
3009
|
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
2919
3010
|
"values": [
|
|
2920
|
-
true
|
|
3011
|
+
true,
|
|
3012
|
+
false
|
|
2921
3013
|
],
|
|
2922
3014
|
"type": "state"
|
|
2923
3015
|
}
|
|
@@ -3099,7 +3191,8 @@
|
|
|
3099
3191
|
"expanded": {
|
|
3100
3192
|
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
3101
3193
|
"values": [
|
|
3102
|
-
true
|
|
3194
|
+
true,
|
|
3195
|
+
false
|
|
3103
3196
|
],
|
|
3104
3197
|
"type": "state"
|
|
3105
3198
|
}
|
|
@@ -3262,9 +3355,11 @@
|
|
|
3262
3355
|
},
|
|
3263
3356
|
"border": {
|
|
3264
3357
|
"default": 0,
|
|
3265
|
-
"nullable":
|
|
3358
|
+
"nullable": true,
|
|
3359
|
+
"type": "undefined|null",
|
|
3266
3360
|
"values": {
|
|
3267
|
-
"zero": 0
|
|
3361
|
+
"zero": 0,
|
|
3362
|
+
"none": null
|
|
3268
3363
|
}
|
|
3269
3364
|
},
|
|
3270
3365
|
"color": {
|
|
@@ -3281,6 +3376,7 @@
|
|
|
3281
3376
|
"nullable": true,
|
|
3282
3377
|
"type": "undefined|null",
|
|
3283
3378
|
"values": {
|
|
3379
|
+
"none": null,
|
|
3284
3380
|
"zero": 0,
|
|
3285
3381
|
"round": 99999999999999
|
|
3286
3382
|
}
|
|
@@ -6232,6 +6328,14 @@
|
|
|
6232
6328
|
"icon": "icon",
|
|
6233
6329
|
"backgroundColor": "color",
|
|
6234
6330
|
"borderRadius": "radius",
|
|
6331
|
+
"borderTopLeftRadius": "radius",
|
|
6332
|
+
"borderTopRightRadius": "radius",
|
|
6333
|
+
"borderBottomLeftRadius": "radius",
|
|
6334
|
+
"borderBottomRightRadius": "radius",
|
|
6335
|
+
"borderTopWidth": "border",
|
|
6336
|
+
"borderBottomWidth": "border",
|
|
6337
|
+
"borderLeftWidth": "border",
|
|
6338
|
+
"borderRightWidth": "border",
|
|
6235
6339
|
"borderColor": "color",
|
|
6236
6340
|
"borderWidth": "border",
|
|
6237
6341
|
"outerBorderWidth": "border",
|
|
@@ -6253,7 +6357,7 @@
|
|
|
6253
6357
|
"type": {
|
|
6254
6358
|
"name": "elementType"
|
|
6255
6359
|
},
|
|
6256
|
-
"required":
|
|
6360
|
+
"required": false,
|
|
6257
6361
|
"description": "Defines the icon to be rendered"
|
|
6258
6362
|
},
|
|
6259
6363
|
"href": {
|
|
@@ -10885,6 +10989,7 @@
|
|
|
10885
10989
|
"name": "custom",
|
|
10886
10990
|
"raw": {
|
|
10887
10991
|
"outerBorderColor": "color",
|
|
10992
|
+
"backgroundColor": "color",
|
|
10888
10993
|
"outerBorderWidth": "border",
|
|
10889
10994
|
"outerBorderGap": "size",
|
|
10890
10995
|
"borderRadius": "radius",
|
|
@@ -12315,15 +12420,7 @@
|
|
|
12315
12420
|
"showPanelTabs": "show",
|
|
12316
12421
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
12317
12422
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
12318
|
-
"
|
|
12319
|
-
"thumbnailBorderRadius": "radius",
|
|
12320
|
-
"thumbnailBorderWidth": "border",
|
|
12321
|
-
"thumbnailContainerPaddingTop": "size",
|
|
12322
|
-
"thumbnailMargin": "size",
|
|
12323
|
-
"thumbnailPadding": "size",
|
|
12324
|
-
"thumbnailSelectedBorderColor": "color",
|
|
12325
|
-
"thumbnailSelectedBorderWidth": "border",
|
|
12326
|
-
"thumbnailSize": "size"
|
|
12423
|
+
"stepTrackerCurrentBackgroundColor": "color"
|
|
12327
12424
|
}
|
|
12328
12425
|
},
|
|
12329
12426
|
"required": false,
|
|
@@ -12684,15 +12781,7 @@
|
|
|
12684
12781
|
"showPanelTabs": "show",
|
|
12685
12782
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
12686
12783
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
12687
|
-
"
|
|
12688
|
-
"thumbnailBorderRadius": "radius",
|
|
12689
|
-
"thumbnailBorderWidth": "border",
|
|
12690
|
-
"thumbnailContainerPaddingTop": "size",
|
|
12691
|
-
"thumbnailMargin": "size",
|
|
12692
|
-
"thumbnailPadding": "size",
|
|
12693
|
-
"thumbnailSelectedBorderColor": "color",
|
|
12694
|
-
"thumbnailSelectedBorderWidth": "border",
|
|
12695
|
-
"thumbnailSize": "size"
|
|
12784
|
+
"stepTrackerCurrentBackgroundColor": "color"
|
|
12696
12785
|
}
|
|
12697
12786
|
},
|
|
12698
12787
|
"required": false,
|
|
@@ -13098,15 +13187,7 @@
|
|
|
13098
13187
|
"showPanelTabs": "show",
|
|
13099
13188
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
13100
13189
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
13101
|
-
"
|
|
13102
|
-
"thumbnailBorderRadius": "radius",
|
|
13103
|
-
"thumbnailBorderWidth": "border",
|
|
13104
|
-
"thumbnailContainerPaddingTop": "size",
|
|
13105
|
-
"thumbnailMargin": "size",
|
|
13106
|
-
"thumbnailPadding": "size",
|
|
13107
|
-
"thumbnailSelectedBorderColor": "color",
|
|
13108
|
-
"thumbnailSelectedBorderWidth": "border",
|
|
13109
|
-
"thumbnailSize": "size"
|
|
13190
|
+
"stepTrackerCurrentBackgroundColor": "color"
|
|
13110
13191
|
}
|
|
13111
13192
|
},
|
|
13112
13193
|
"required": false,
|
|
@@ -27,7 +27,10 @@ const CarouselStepTracker = _ref => {
|
|
|
27
27
|
activeIndex,
|
|
28
28
|
totalItems,
|
|
29
29
|
getCopyWithPlaceholders,
|
|
30
|
-
themeTokens
|
|
30
|
+
themeTokens: {
|
|
31
|
+
stepTrackerCurrentBackgroundColor,
|
|
32
|
+
...themeTokens
|
|
33
|
+
}
|
|
31
34
|
} = (0, _CarouselContext.useCarousel)();
|
|
32
35
|
const stackViewTokens = {
|
|
33
36
|
justifyContent: 'center'
|
|
@@ -35,7 +38,8 @@ const CarouselStepTracker = _ref => {
|
|
|
35
38
|
const stepTrackerTokens = {
|
|
36
39
|
showStepLabel: false,
|
|
37
40
|
showStepTrackerLabel: true,
|
|
38
|
-
|
|
41
|
+
// TODO: StepTracker 'isComplete'/'isCurrent' is incorrect, see line StepTracker/Step.jsx line 63, refactor incorrect values and remove this
|
|
42
|
+
knobCompletedBackgroundColor: stepTrackerCurrentBackgroundColor ?? 'none',
|
|
39
43
|
connectorCompletedColor: 'none',
|
|
40
44
|
connectorColor: 'none',
|
|
41
45
|
containerPaddingTop: themeTokens.spaceBetweenSlideAndPanelNavigation
|
|
@@ -39,19 +39,20 @@ const CarouselTabsPanel = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
39
39
|
} = (0, _CarouselContext.useCarousel)();
|
|
40
40
|
const nextFocusRef = (0, _react.useRef)();
|
|
41
41
|
const firstTabRef = (0, _react.useRef)();
|
|
42
|
-
const [isInverse, setIsInverse] = (0, _react.useState)(false);
|
|
43
|
-
// For now, this picks an Allium variant, and does nothing in brands that lack it.
|
|
44
|
-
// See similar comment in Carousel and https://github.com/telus/universal-design-system/issues/1549
|
|
45
|
-
|
|
46
|
-
const dividerVariant = {
|
|
47
|
-
decorative: true
|
|
48
|
-
};
|
|
42
|
+
const [isInverse, setIsInverse] = (0, _react.useState)(false);
|
|
49
43
|
const lastTabSelected = activeIndex === items.length - 1; // Get current select tab style
|
|
50
44
|
|
|
51
45
|
(0, _react.useEffect)(() => {
|
|
52
46
|
const [selectedVariantIsInverse] = items.filter((_, index) => index === activeIndex);
|
|
53
47
|
setIsInverse(selectedVariantIsInverse === null || selectedVariantIsInverse === void 0 ? void 0 : selectedVariantIsInverse.inverse);
|
|
54
|
-
}, [items, activeIndex]);
|
|
48
|
+
}, [items, activeIndex]); // TODO: figure out a better cross-brand way to specify subcomponent variants.
|
|
49
|
+
// For now, this picks an Allium variant, and does nothing in brands that lack it.
|
|
50
|
+
// See similar comment in Carousel and https://github.com/telus/universal-design-system/issues/1549
|
|
51
|
+
|
|
52
|
+
const dividerVariant = {
|
|
53
|
+
decorative: true,
|
|
54
|
+
inverse: isInverse
|
|
55
|
+
};
|
|
55
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
56
57
|
style: selectTabPanelStyle(),
|
|
57
58
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
|
|
@@ -15,29 +15,52 @@ var _Image = _interopRequireDefault(require("react-native-web/dist/cjs/exports/I
|
|
|
15
15
|
|
|
16
16
|
var _CarouselContext = require("./CarouselContext");
|
|
17
17
|
|
|
18
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
19
|
+
|
|
20
|
+
var _ViewportProvider = require("../ViewportProvider");
|
|
21
|
+
|
|
18
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
23
|
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
26
|
+
const selectPressableTokens = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
borderColor,
|
|
29
|
+
borderRadius,
|
|
30
|
+
borderWidth,
|
|
31
|
+
margin,
|
|
32
|
+
padding
|
|
33
|
+
} = _ref;
|
|
34
|
+
return {
|
|
35
|
+
borderColor,
|
|
36
|
+
borderRadius,
|
|
37
|
+
borderWidth,
|
|
38
|
+
margin,
|
|
39
|
+
padding
|
|
40
|
+
};
|
|
41
|
+
};
|
|
22
42
|
/**
|
|
23
43
|
* `Carousel.Thumbnail` is used to wrap the content of an individual slide and is suppsoed to be the
|
|
24
44
|
* only top-level component passed to the `Carousel`
|
|
25
45
|
*/
|
|
26
|
-
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
const CarouselThumbnail = _ref2 => {
|
|
27
49
|
let {
|
|
28
50
|
accessibilityLabel,
|
|
29
51
|
alt,
|
|
30
52
|
index,
|
|
31
53
|
src
|
|
32
|
-
} =
|
|
54
|
+
} = _ref2;
|
|
33
55
|
const {
|
|
34
56
|
activeIndex,
|
|
35
57
|
itemLabel,
|
|
36
58
|
totalItems,
|
|
37
59
|
getCopyWithPlaceholders,
|
|
38
|
-
goTo
|
|
39
|
-
themeTokens
|
|
60
|
+
goTo
|
|
40
61
|
} = (0, _CarouselContext.useCarousel)();
|
|
62
|
+
const getThumbnailTokens = (0, _ThemeProvider.useThemeTokensCallback)('CarouselThumbnail');
|
|
63
|
+
const viewport = (0, _ViewportProvider.useViewport)();
|
|
41
64
|
const thumbnailTitle = alt ?? getCopyWithPlaceholders('stepTrackerLabel').replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, index).replace(/%\{stepCount\}/g, totalItems);
|
|
42
65
|
|
|
43
66
|
const handlePress = () => goTo(index);
|
|
@@ -48,37 +71,41 @@ const CarouselThumbnail = _ref => {
|
|
|
48
71
|
};
|
|
49
72
|
|
|
50
73
|
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = themeTokens;
|
|
74
|
+
borderWidth,
|
|
75
|
+
padding,
|
|
76
|
+
selectedBorderColor,
|
|
77
|
+
selectedBorderWidth,
|
|
78
|
+
size
|
|
79
|
+
} = getThumbnailTokens({
|
|
80
|
+
viewport
|
|
81
|
+
});
|
|
60
82
|
const styles = {
|
|
61
|
-
pressable: {
|
|
62
|
-
borderColor: thumbnailBorderColor,
|
|
63
|
-
borderRadius: thumbnailBorderRadius,
|
|
64
|
-
borderWidth: thumbnailBorderWidth,
|
|
65
|
-
margin: thumbnailMargin,
|
|
66
|
-
padding: thumbnailPadding
|
|
67
|
-
},
|
|
68
83
|
image: {
|
|
69
|
-
height:
|
|
70
|
-
width:
|
|
84
|
+
height: size,
|
|
85
|
+
width: size
|
|
71
86
|
},
|
|
72
87
|
selected: {
|
|
73
|
-
borderColor:
|
|
74
|
-
borderWidth:
|
|
75
|
-
padding:
|
|
88
|
+
borderColor: selectedBorderColor,
|
|
89
|
+
borderWidth: selectedBorderWidth,
|
|
90
|
+
padding: padding - selectedBorderWidth + borderWidth
|
|
76
91
|
}
|
|
77
92
|
};
|
|
78
93
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
79
94
|
onKeyDown: handleKeyDown,
|
|
80
95
|
onPress: handlePress,
|
|
81
|
-
style:
|
|
96
|
+
style: _ref3 => {
|
|
97
|
+
let {
|
|
98
|
+
hovered,
|
|
99
|
+
pressed,
|
|
100
|
+
focused
|
|
101
|
+
} = _ref3;
|
|
102
|
+
const pressableStyles = selectPressableTokens(getThumbnailTokens({
|
|
103
|
+
hover: hovered,
|
|
104
|
+
pressed,
|
|
105
|
+
focus: focused
|
|
106
|
+
}));
|
|
107
|
+
return [pressableStyles, index === activeIndex && styles.selected];
|
|
108
|
+
},
|
|
82
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
|
|
83
110
|
accessibilityIgnoresInvertColors: true,
|
|
84
111
|
accessibilityLabel: accessibilityLabel ?? alt,
|
|
@@ -17,6 +17,10 @@ var _CarouselThumbnail = _interopRequireDefault(require("./CarouselThumbnail"));
|
|
|
17
17
|
|
|
18
18
|
var _StackView = require("../StackView");
|
|
19
19
|
|
|
20
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
21
|
+
|
|
22
|
+
var _ViewportProvider = require("../ViewportProvider");
|
|
23
|
+
|
|
20
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
25
|
|
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -29,9 +33,14 @@ const CarouselThumbnailNavigation = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
29
33
|
let {
|
|
30
34
|
thumbnails = []
|
|
31
35
|
} = _ref;
|
|
36
|
+
const viewport = (0, _ViewportProvider.useViewport)();
|
|
37
|
+
const {
|
|
38
|
+
alignItems
|
|
39
|
+
} = (0, _ThemeProvider.useThemeTokens)('CarouselThumbnail', {}, {
|
|
40
|
+
viewport
|
|
41
|
+
});
|
|
32
42
|
const {
|
|
33
|
-
totalItems
|
|
34
|
-
themeTokens
|
|
43
|
+
totalItems
|
|
35
44
|
} = (0, _CarouselContext.useCarousel)();
|
|
36
45
|
|
|
37
46
|
if (thumbnails.length !== totalItems) {
|
|
@@ -39,15 +48,15 @@ const CarouselThumbnailNavigation = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
const {
|
|
42
|
-
thumbnailContainerPaddingTop,
|
|
43
|
-
thumbnailMargin
|
|
44
|
-
} =
|
|
51
|
+
containerPaddingTop: thumbnailContainerPaddingTop,
|
|
52
|
+
margin: thumbnailMargin
|
|
53
|
+
} = (0, _ThemeProvider.useThemeTokens)('CarouselThumbnail');
|
|
45
54
|
const stackWrapTokens = {
|
|
46
55
|
justifyContent: 'flex-start'
|
|
47
56
|
};
|
|
48
57
|
const containerStyles = {
|
|
49
58
|
justifyContent: 'center',
|
|
50
|
-
alignItems
|
|
59
|
+
alignItems,
|
|
51
60
|
paddingTop: thumbnailContainerPaddingTop - thumbnailMargin
|
|
52
61
|
};
|
|
53
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
@@ -36,10 +36,14 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
|
|
|
36
36
|
const selectOuterStyle = _ref => {
|
|
37
37
|
let {
|
|
38
38
|
backgroundColor,
|
|
39
|
-
borderRadius,
|
|
40
39
|
outerBorderWidth,
|
|
41
40
|
outerBorderColor,
|
|
42
41
|
outerBorderGap,
|
|
42
|
+
borderRadius,
|
|
43
|
+
borderTopLeftRadius,
|
|
44
|
+
borderTopRightRadius,
|
|
45
|
+
borderBottomLeftRadius,
|
|
46
|
+
borderBottomRightRadius,
|
|
43
47
|
shadow
|
|
44
48
|
} = _ref;
|
|
45
49
|
return [{
|
|
@@ -47,6 +51,10 @@ const selectOuterStyle = _ref => {
|
|
|
47
51
|
...(0, _ThemeProvider.applyShadowToken)(shadow),
|
|
48
52
|
...(0, _ThemeProvider.applyOuterBorder)({
|
|
49
53
|
borderRadius,
|
|
54
|
+
borderTopLeftRadius,
|
|
55
|
+
borderTopRightRadius,
|
|
56
|
+
borderBottomLeftRadius,
|
|
57
|
+
borderBottomRightRadius,
|
|
50
58
|
outerBorderWidth,
|
|
51
59
|
outerBorderColor,
|
|
52
60
|
outerBorderGap
|
|
@@ -60,20 +68,46 @@ const selectOuterStyle = _ref => {
|
|
|
60
68
|
}, staticStyles.outer];
|
|
61
69
|
};
|
|
62
70
|
|
|
71
|
+
const calculatePadding = (padding, borderWidth) => padding && Math.max(0, padding - borderWidth); // Stable size as border changes
|
|
72
|
+
|
|
73
|
+
|
|
63
74
|
const selectInnerStyle = _ref2 => {
|
|
64
75
|
let {
|
|
65
76
|
borderColor,
|
|
66
|
-
borderWidth
|
|
77
|
+
borderWidth,
|
|
78
|
+
borderTopLeftRadius,
|
|
79
|
+
borderTopRightRadius,
|
|
80
|
+
borderBottomLeftRadius,
|
|
81
|
+
borderBottomRightRadius,
|
|
67
82
|
borderRadius,
|
|
68
|
-
padding = 0
|
|
83
|
+
padding = 0,
|
|
84
|
+
borderTopWidth,
|
|
85
|
+
borderRightWidth,
|
|
86
|
+
borderBottomWidth,
|
|
87
|
+
borderLeftWidth,
|
|
88
|
+
paddingLeft,
|
|
89
|
+
paddingRight,
|
|
90
|
+
paddingTop,
|
|
91
|
+
paddingBottom
|
|
69
92
|
} = _ref2;
|
|
70
93
|
return {
|
|
71
94
|
// Inner borders animate with the icon and should be treated like a themable feature of the icon
|
|
72
95
|
borderColor,
|
|
73
96
|
borderRadius,
|
|
74
97
|
borderWidth,
|
|
75
|
-
|
|
76
|
-
|
|
98
|
+
borderTopLeftRadius,
|
|
99
|
+
borderTopRightRadius,
|
|
100
|
+
borderBottomLeftRadius,
|
|
101
|
+
borderBottomRightRadius,
|
|
102
|
+
borderTopWidth,
|
|
103
|
+
borderRightWidth,
|
|
104
|
+
borderBottomWidth,
|
|
105
|
+
borderLeftWidth,
|
|
106
|
+
padding: calculatePadding(padding, borderWidth),
|
|
107
|
+
paddingLeft: calculatePadding(paddingLeft, borderLeftWidth),
|
|
108
|
+
paddingRight: calculatePadding(paddingRight, borderRightWidth),
|
|
109
|
+
paddingTop: calculatePadding(paddingTop, borderTopWidth),
|
|
110
|
+
paddingBottom: calculatePadding(paddingBottom, borderBottomWidth)
|
|
77
111
|
};
|
|
78
112
|
};
|
|
79
113
|
/**
|
|
@@ -132,7 +166,7 @@ const IconButton = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
132
166
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
133
167
|
style: selectInnerStyle(themeTokens),
|
|
134
168
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
135
|
-
icon: IconComponent,
|
|
169
|
+
icon: IconComponent || themeTokens.icon,
|
|
136
170
|
title: selectedProps.accessibilityLabel,
|
|
137
171
|
tokens: (0, _utils.selectTokens)('Icon', themeTokens, 'icon'),
|
|
138
172
|
variant: variant
|
|
@@ -149,7 +183,7 @@ IconButton.propTypes = { ...selectedSystemPropTypes,
|
|
|
149
183
|
/**
|
|
150
184
|
* Defines the icon to be rendered
|
|
151
185
|
*/
|
|
152
|
-
icon: _propTypes.default.elementType
|
|
186
|
+
icon: _propTypes.default.elementType,
|
|
153
187
|
|
|
154
188
|
/**
|
|
155
189
|
* URL to navigate to when the `Iconbutton` is pressed
|