@telus-uds/components-base 1.15.0 → 1.16.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 +18 -2
- package/component-docs.json +393 -5
- package/lib/Carousel/Carousel.js +18 -2
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +6 -7
- package/lib/Skeleton/Skeleton.js +18 -13
- package/lib/Skeleton/useSkeletonNativeAnimation.js +4 -2
- package/lib/ToggleSwitch/ToggleSwitch.js +24 -19
- package/lib/utils/props/a11yProps.js +50 -47
- package/lib-module/Carousel/Carousel.js +16 -2
- package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +7 -6
- package/lib-module/Skeleton/Skeleton.js +15 -13
- package/lib-module/Skeleton/useSkeletonNativeAnimation.js +3 -2
- package/lib-module/ToggleSwitch/ToggleSwitch.js +24 -19
- package/lib-module/utils/props/a11yProps.js +50 -47
- package/package.json +4 -4
- package/src/Carousel/Carousel.jsx +15 -2
- package/src/Carousel/CarouselTabs/CarouselTabs.jsx +5 -3
- package/src/Skeleton/Skeleton.jsx +25 -19
- package/src/Skeleton/useSkeletonNativeAnimation.js +3 -3
- package/src/ToggleSwitch/ToggleSwitch.jsx +3 -3
- package/src/utils/props/a11yProps.js +61 -68
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 12 Sep 2022 20:03:12 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.16.0
|
|
8
|
+
|
|
9
|
+
Mon, 12 Sep 2022 20:03:12 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Support React ^18.1 (alan.slater@nearform.com)
|
|
14
|
+
- Add tabs prop to Carousel, deprecating CarouselTabs (alan.slater@nearform.com)
|
|
15
|
+
- Bump @telus-uds/system-theme-tokens to v2.5.0
|
|
16
|
+
|
|
17
|
+
### Patches
|
|
18
|
+
|
|
19
|
+
- fix: correct ToggleSwitch regressions (ruslan.bredikhin@nearform.com)
|
|
20
|
+
- fix Skeleton animation to work with RNW 0.18 (ruslan.bredikhin@nearform.com)
|
|
21
|
+
- fix: docs button & buttonlink a11yprops build crash (srikanthkhari@gmail.com)
|
|
22
|
+
|
|
7
23
|
## 1.15.0
|
|
8
24
|
|
|
9
|
-
Thu, 08 Sep 2022 15:
|
|
25
|
+
Thu, 08 Sep 2022 15:38:07 GMT
|
|
10
26
|
|
|
11
27
|
### Minor changes
|
|
12
28
|
|
package/component-docs.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"previousIcon": "icon",
|
|
90
90
|
"showPreviousNextNavigation": "show",
|
|
91
91
|
"showPanelNavigation": "show",
|
|
92
|
+
"showPanelTabs": "show",
|
|
92
93
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
93
94
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
94
95
|
"thumbnailBorderColor": "color",
|
|
@@ -5553,7 +5554,7 @@
|
|
|
5553
5554
|
}
|
|
5554
5555
|
},
|
|
5555
5556
|
"attributes": {
|
|
5556
|
-
"acceptsRNA11yProps":
|
|
5557
|
+
"acceptsRNA11yProps": true
|
|
5557
5558
|
}
|
|
5558
5559
|
}
|
|
5559
5560
|
}
|
|
@@ -8141,6 +8142,154 @@
|
|
|
8141
8142
|
}
|
|
8142
8143
|
}
|
|
8143
8144
|
},
|
|
8145
|
+
"Button": {
|
|
8146
|
+
"docs": {
|
|
8147
|
+
"description": "",
|
|
8148
|
+
"props": {
|
|
8149
|
+
"tokens": {
|
|
8150
|
+
"type": {
|
|
8151
|
+
"name": "custom",
|
|
8152
|
+
"raw": {
|
|
8153
|
+
"borderColor": "color",
|
|
8154
|
+
"borderWidth": "border",
|
|
8155
|
+
"borderRadius": "radius",
|
|
8156
|
+
"shadow": "shadow",
|
|
8157
|
+
"fontSize": "fontSize",
|
|
8158
|
+
"color": "color",
|
|
8159
|
+
"lineHeight": "lineHeight",
|
|
8160
|
+
"textAlign": "flexJustifyContent",
|
|
8161
|
+
"alignSelf": "flexAlign",
|
|
8162
|
+
"fontName": "fontName",
|
|
8163
|
+
"fontWeight": "fontWeight",
|
|
8164
|
+
"backgroundColor": "color",
|
|
8165
|
+
"opacity": "opacity",
|
|
8166
|
+
"paddingLeft": "size",
|
|
8167
|
+
"paddingRight": "size",
|
|
8168
|
+
"paddingTop": "size",
|
|
8169
|
+
"paddingBottom": "size",
|
|
8170
|
+
"width": "size",
|
|
8171
|
+
"minWidth": "size",
|
|
8172
|
+
"iconSize": "size",
|
|
8173
|
+
"iconSpace": "integer",
|
|
8174
|
+
"icon": "icon",
|
|
8175
|
+
"outerBorderColor": "color",
|
|
8176
|
+
"outerBorderWidth": "border",
|
|
8177
|
+
"outerBorderGap": "size",
|
|
8178
|
+
"outerBackgroundColor": "color"
|
|
8179
|
+
}
|
|
8180
|
+
},
|
|
8181
|
+
"required": false,
|
|
8182
|
+
"description": ""
|
|
8183
|
+
},
|
|
8184
|
+
"inactive": {
|
|
8185
|
+
"type": {
|
|
8186
|
+
"name": "bool"
|
|
8187
|
+
},
|
|
8188
|
+
"required": false,
|
|
8189
|
+
"description": "If true, prevents the button from being pressed, changes the cursor (on web) and accessibility\nattributes to communicate this to the user, and applies `inactive: true` appearances from the theme"
|
|
8190
|
+
},
|
|
8191
|
+
"disabled": {
|
|
8192
|
+
"type": {
|
|
8193
|
+
"name": "bool"
|
|
8194
|
+
},
|
|
8195
|
+
"required": false,
|
|
8196
|
+
"description": "Alias for `inactive`"
|
|
8197
|
+
},
|
|
8198
|
+
"children": {
|
|
8199
|
+
"type": {
|
|
8200
|
+
"name": "custom",
|
|
8201
|
+
"raw": "ABBPropTypes.childrenOf(\n PropTypes.oneOfType([ABBPropTypes.elementType(A11yText), PropTypes.string])\n)"
|
|
8202
|
+
},
|
|
8203
|
+
"required": false,
|
|
8204
|
+
"description": "Button's children must be either:\n - One or more text strings and / or A11yText components\n - A render function with contents that responds to current button state by being passed an object of:\n```\n{ hovered<bool>, focused<bool>, pressed<bool>, inactive<bool>, selected<bool>, textStyles<RNStyle> }\n```"
|
|
8205
|
+
},
|
|
8206
|
+
"onPress": {
|
|
8207
|
+
"type": {
|
|
8208
|
+
"name": "func"
|
|
8209
|
+
},
|
|
8210
|
+
"required": false,
|
|
8211
|
+
"description": "Function called when the button is pressed. Required unless the button has a href."
|
|
8212
|
+
},
|
|
8213
|
+
"iconProps": {
|
|
8214
|
+
"type": {
|
|
8215
|
+
"name": "exact",
|
|
8216
|
+
"value": {
|
|
8217
|
+
"variant": {
|
|
8218
|
+
"name": "custom",
|
|
8219
|
+
"raw": "variantProp.propType",
|
|
8220
|
+
"required": false
|
|
8221
|
+
},
|
|
8222
|
+
"tokens": {
|
|
8223
|
+
"name": "custom",
|
|
8224
|
+
"raw": "getTokensPropType('Icon')",
|
|
8225
|
+
"required": false
|
|
8226
|
+
},
|
|
8227
|
+
"accessibilityLabel": {
|
|
8228
|
+
"name": "string",
|
|
8229
|
+
"description": "Descriptive label used in web SVG title tag for accessibility",
|
|
8230
|
+
"required": false
|
|
8231
|
+
},
|
|
8232
|
+
"scalesWithText": {
|
|
8233
|
+
"name": "bool",
|
|
8234
|
+
"description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
|
|
8235
|
+
"required": false
|
|
8236
|
+
}
|
|
8237
|
+
}
|
|
8238
|
+
},
|
|
8239
|
+
"required": false,
|
|
8240
|
+
"description": "Optional variant that may be passed down to the link's icon if there is one"
|
|
8241
|
+
},
|
|
8242
|
+
"iconPosition": {
|
|
8243
|
+
"type": {
|
|
8244
|
+
"name": "enum",
|
|
8245
|
+
"value": [
|
|
8246
|
+
{
|
|
8247
|
+
"value": "'left'",
|
|
8248
|
+
"computed": false
|
|
8249
|
+
},
|
|
8250
|
+
{
|
|
8251
|
+
"value": "'right'",
|
|
8252
|
+
"computed": false
|
|
8253
|
+
}
|
|
8254
|
+
]
|
|
8255
|
+
},
|
|
8256
|
+
"required": false,
|
|
8257
|
+
"description": "When `icon` is provided, use `iconPosition` to place the Icon to the left or right side of the button."
|
|
8258
|
+
},
|
|
8259
|
+
"icon": {
|
|
8260
|
+
"type": {
|
|
8261
|
+
"name": "func"
|
|
8262
|
+
},
|
|
8263
|
+
"required": false,
|
|
8264
|
+
"description": "A function component for an SVG icon to render inside the link. Inherits size and color from\nthe link and any Typography the link is nested inside."
|
|
8265
|
+
},
|
|
8266
|
+
"variant": {
|
|
8267
|
+
"type": {
|
|
8268
|
+
"name": "objectOf",
|
|
8269
|
+
"value": {
|
|
8270
|
+
"name": "union",
|
|
8271
|
+
"value": [
|
|
8272
|
+
{
|
|
8273
|
+
"name": "string"
|
|
8274
|
+
},
|
|
8275
|
+
{
|
|
8276
|
+
"name": "number"
|
|
8277
|
+
},
|
|
8278
|
+
{
|
|
8279
|
+
"name": "bool"
|
|
8280
|
+
}
|
|
8281
|
+
]
|
|
8282
|
+
}
|
|
8283
|
+
},
|
|
8284
|
+
"required": false,
|
|
8285
|
+
"description": ""
|
|
8286
|
+
}
|
|
8287
|
+
},
|
|
8288
|
+
"attributes": {
|
|
8289
|
+
"acceptsRNA11yProps": true
|
|
8290
|
+
}
|
|
8291
|
+
}
|
|
8292
|
+
},
|
|
8144
8293
|
"ButtonGroup": {
|
|
8145
8294
|
"docs": {
|
|
8146
8295
|
"description": "",
|
|
@@ -8382,6 +8531,214 @@
|
|
|
8382
8531
|
}
|
|
8383
8532
|
}
|
|
8384
8533
|
},
|
|
8534
|
+
"ButtonLink": {
|
|
8535
|
+
"docs": {
|
|
8536
|
+
"description": "`ButtonLink` is a component with the semantics and behaviour of a link, but with the visual appearance of a button.\nButtonLink is a block-level component and should not be used inline.",
|
|
8537
|
+
"props": {
|
|
8538
|
+
"tokens": {
|
|
8539
|
+
"type": {
|
|
8540
|
+
"name": "custom",
|
|
8541
|
+
"raw": {
|
|
8542
|
+
"borderColor": "color",
|
|
8543
|
+
"borderWidth": "border",
|
|
8544
|
+
"borderRadius": "radius",
|
|
8545
|
+
"shadow": "shadow",
|
|
8546
|
+
"fontSize": "fontSize",
|
|
8547
|
+
"color": "color",
|
|
8548
|
+
"lineHeight": "lineHeight",
|
|
8549
|
+
"textAlign": "flexJustifyContent",
|
|
8550
|
+
"alignSelf": "flexAlign",
|
|
8551
|
+
"fontName": "fontName",
|
|
8552
|
+
"fontWeight": "fontWeight",
|
|
8553
|
+
"backgroundColor": "color",
|
|
8554
|
+
"opacity": "opacity",
|
|
8555
|
+
"paddingLeft": "size",
|
|
8556
|
+
"paddingRight": "size",
|
|
8557
|
+
"paddingTop": "size",
|
|
8558
|
+
"paddingBottom": "size",
|
|
8559
|
+
"width": "size",
|
|
8560
|
+
"minWidth": "size",
|
|
8561
|
+
"iconSize": "size",
|
|
8562
|
+
"iconSpace": "integer",
|
|
8563
|
+
"icon": "icon",
|
|
8564
|
+
"outerBorderColor": "color",
|
|
8565
|
+
"outerBorderWidth": "border",
|
|
8566
|
+
"outerBorderGap": "size",
|
|
8567
|
+
"outerBackgroundColor": "color"
|
|
8568
|
+
}
|
|
8569
|
+
},
|
|
8570
|
+
"required": false,
|
|
8571
|
+
"description": ""
|
|
8572
|
+
},
|
|
8573
|
+
"inactive": {
|
|
8574
|
+
"type": {
|
|
8575
|
+
"name": "bool"
|
|
8576
|
+
},
|
|
8577
|
+
"required": false,
|
|
8578
|
+
"description": "If true, prevents the button from being pressed, changes the cursor (on web) and accessibility\nattributes to communicate this to the user, and applies `inactive: true` appearances from the theme"
|
|
8579
|
+
},
|
|
8580
|
+
"disabled": {
|
|
8581
|
+
"type": {
|
|
8582
|
+
"name": "bool"
|
|
8583
|
+
},
|
|
8584
|
+
"required": false,
|
|
8585
|
+
"description": "Alias for `inactive`"
|
|
8586
|
+
},
|
|
8587
|
+
"children": {
|
|
8588
|
+
"type": {
|
|
8589
|
+
"name": "custom",
|
|
8590
|
+
"raw": "ABBPropTypes.childrenOf(\n PropTypes.oneOfType([ABBPropTypes.elementType(A11yText), PropTypes.string])\n)"
|
|
8591
|
+
},
|
|
8592
|
+
"required": false,
|
|
8593
|
+
"description": "Button's children must be either:\n - One or more text strings and / or A11yText components\n - A render function with contents that responds to current button state by being passed an object of:\n```\n{ hovered<bool>, focused<bool>, pressed<bool>, inactive<bool>, selected<bool>, textStyles<RNStyle> }\n```"
|
|
8594
|
+
},
|
|
8595
|
+
"onPress": {
|
|
8596
|
+
"type": {
|
|
8597
|
+
"name": "func"
|
|
8598
|
+
},
|
|
8599
|
+
"required": false,
|
|
8600
|
+
"description": "Function called when the button is pressed. Required unless the button has a href."
|
|
8601
|
+
},
|
|
8602
|
+
"iconProps": {
|
|
8603
|
+
"type": {
|
|
8604
|
+
"name": "exact",
|
|
8605
|
+
"value": {
|
|
8606
|
+
"variant": {
|
|
8607
|
+
"name": "custom",
|
|
8608
|
+
"raw": "variantProp.propType",
|
|
8609
|
+
"required": false
|
|
8610
|
+
},
|
|
8611
|
+
"tokens": {
|
|
8612
|
+
"name": "custom",
|
|
8613
|
+
"raw": "getTokensPropType('Icon')",
|
|
8614
|
+
"required": false
|
|
8615
|
+
},
|
|
8616
|
+
"accessibilityLabel": {
|
|
8617
|
+
"name": "string",
|
|
8618
|
+
"description": "Descriptive label used in web SVG title tag for accessibility",
|
|
8619
|
+
"required": false
|
|
8620
|
+
},
|
|
8621
|
+
"scalesWithText": {
|
|
8622
|
+
"name": "bool",
|
|
8623
|
+
"description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
|
|
8624
|
+
"required": false
|
|
8625
|
+
}
|
|
8626
|
+
}
|
|
8627
|
+
},
|
|
8628
|
+
"required": false,
|
|
8629
|
+
"description": "Optional variant that may be passed down to the link's icon if there is one"
|
|
8630
|
+
},
|
|
8631
|
+
"iconPosition": {
|
|
8632
|
+
"type": {
|
|
8633
|
+
"name": "enum",
|
|
8634
|
+
"value": [
|
|
8635
|
+
{
|
|
8636
|
+
"value": "'left'",
|
|
8637
|
+
"computed": false
|
|
8638
|
+
},
|
|
8639
|
+
{
|
|
8640
|
+
"value": "'right'",
|
|
8641
|
+
"computed": false
|
|
8642
|
+
}
|
|
8643
|
+
]
|
|
8644
|
+
},
|
|
8645
|
+
"required": false,
|
|
8646
|
+
"description": "When `icon` is provided, use `iconPosition` to place the Icon to the left or right side of the button."
|
|
8647
|
+
},
|
|
8648
|
+
"icon": {
|
|
8649
|
+
"type": {
|
|
8650
|
+
"name": "func"
|
|
8651
|
+
},
|
|
8652
|
+
"required": false,
|
|
8653
|
+
"description": "A function component for an SVG icon to render inside the link. Inherits size and color from\nthe link and any Typography the link is nested inside."
|
|
8654
|
+
},
|
|
8655
|
+
"variant": {
|
|
8656
|
+
"type": {
|
|
8657
|
+
"name": "objectOf",
|
|
8658
|
+
"value": {
|
|
8659
|
+
"name": "union",
|
|
8660
|
+
"value": [
|
|
8661
|
+
{
|
|
8662
|
+
"name": "string"
|
|
8663
|
+
},
|
|
8664
|
+
{
|
|
8665
|
+
"name": "number"
|
|
8666
|
+
},
|
|
8667
|
+
{
|
|
8668
|
+
"name": "bool"
|
|
8669
|
+
}
|
|
8670
|
+
]
|
|
8671
|
+
}
|
|
8672
|
+
},
|
|
8673
|
+
"required": false,
|
|
8674
|
+
"description": ""
|
|
8675
|
+
},
|
|
8676
|
+
"onPressIn": {
|
|
8677
|
+
"type": {
|
|
8678
|
+
"name": "func"
|
|
8679
|
+
},
|
|
8680
|
+
"required": false,
|
|
8681
|
+
"description": ""
|
|
8682
|
+
},
|
|
8683
|
+
"onPressOut": {
|
|
8684
|
+
"type": {
|
|
8685
|
+
"name": "func"
|
|
8686
|
+
},
|
|
8687
|
+
"required": false,
|
|
8688
|
+
"description": ""
|
|
8689
|
+
},
|
|
8690
|
+
"href": {
|
|
8691
|
+
"type": {
|
|
8692
|
+
"name": "string"
|
|
8693
|
+
},
|
|
8694
|
+
"required": false,
|
|
8695
|
+
"description": ""
|
|
8696
|
+
},
|
|
8697
|
+
"hrefAttrs": {
|
|
8698
|
+
"type": {
|
|
8699
|
+
"name": "shape",
|
|
8700
|
+
"value": {
|
|
8701
|
+
"download": {
|
|
8702
|
+
"name": "string",
|
|
8703
|
+
"required": false
|
|
8704
|
+
},
|
|
8705
|
+
"rel": {
|
|
8706
|
+
"name": "string",
|
|
8707
|
+
"required": false
|
|
8708
|
+
},
|
|
8709
|
+
"target": {
|
|
8710
|
+
"name": "enum",
|
|
8711
|
+
"value": [
|
|
8712
|
+
{
|
|
8713
|
+
"value": "'_self'",
|
|
8714
|
+
"computed": false
|
|
8715
|
+
},
|
|
8716
|
+
{
|
|
8717
|
+
"value": "'_blank'",
|
|
8718
|
+
"computed": false
|
|
8719
|
+
},
|
|
8720
|
+
{
|
|
8721
|
+
"value": "'_parent'",
|
|
8722
|
+
"computed": false
|
|
8723
|
+
},
|
|
8724
|
+
{
|
|
8725
|
+
"value": "'_top'",
|
|
8726
|
+
"computed": false
|
|
8727
|
+
}
|
|
8728
|
+
],
|
|
8729
|
+
"required": false
|
|
8730
|
+
}
|
|
8731
|
+
}
|
|
8732
|
+
},
|
|
8733
|
+
"required": false,
|
|
8734
|
+
"description": ""
|
|
8735
|
+
}
|
|
8736
|
+
},
|
|
8737
|
+
"attributes": {
|
|
8738
|
+
"acceptsRNA11yProps": true
|
|
8739
|
+
}
|
|
8740
|
+
}
|
|
8741
|
+
},
|
|
8385
8742
|
"Carousel": {
|
|
8386
8743
|
"docs": {
|
|
8387
8744
|
"description": "Carousel is a general-purpose content slider that can be used to render content in terms of slides.\n\n ## Usage\n - `Carousel` is a top-level export from `@telus-uds/components-base` which is used to render a Carousel\n - Immediately within `Carousel`, individual slides are wrapped in `Carousel.Item` for the top-level `Carousel` to know how to identify an individual slide\n - You can use any UDS component or other platform-specific component, (based on the platform you're rendering) to achieve any desired layout\n - By default, Carousel takea all the `width` available to it and the `height` is determined based on the content in the slide with more content\n - You may want to wrap Carousel in other layout components like `Box`, `FlexGrid` etc, to achieve a responsive layout of your need\n\n ## `useCarousel` custom hook\n\n ```jsx\n import { useCarousel } from '@telus-uds/components-base'\n\n const SomeComponentWithinCarouselItem = () => {\n const {\n activeIndex,\n totalItems,\n width,\n goTo\n } = useCarousel()\n return <Text>Hi!</Text>\n }\n ```\n\n You can use `useCarousel` to hook into internal state of the Carousel component like:\n - `activeIndex`: Index of the current slide\n - `totalItems`: Total number of items/slides passed to the Carousel\n - `width`: Width of the individual carousel slide\n - `goTo`: A function to go to a particular slide by passing the index of that slide, e.g: goTo(0) where `0` is the index of the first slide\n\n ## Accessibility\n\n - Top-level `Carousel` and `Carousel.Item` can take all possible React Native's `View` and `a11y` props\n - If your slide contains input elements like buttons, you may want to configure them to be only focusable when `activeIndex` is equal to the current slide index in order to avoid tabbing going between slides\n\n ## Platform considerations\n The component is available on both native platforms and web.\n\n ## Other considerations\n - You may want to use the same kind of layout in all your slides to avoid visual and height differences\n - `previous` and `next` navigation buttons are automatically removed in `sm` and `xs` viewports, as these smaller viewports offers swipe functionality\n\n ## Tokens\n\n You can override the following tokens in exceptional circumstances:\n - `previousIcon` - Icon of the previous button\n - `nextIcon` - Icon of the next button\n - `showPreviousNextNavigation` - If you want to show/hide the previous/next navigation\n - `showPanelNavigation` - If you want to show/hide the panel navigation\n - `spaceBetweenSlideAndPreviousNextNavigation` - Horizontal space between slide and previous/next navigational buttons\n - `spaceBetweenSlideAndPanelNavigation` - Vertical space between slide area and panel navigation area",
|
|
@@ -8469,6 +8826,17 @@
|
|
|
8469
8826
|
"required": false,
|
|
8470
8827
|
"description": "Minimal part of slide width must be swiped for changing index.\nOtherwise animation restore current slide. Default value 0.2 means that 20% must be swiped for change index"
|
|
8471
8828
|
},
|
|
8829
|
+
"refocus": {
|
|
8830
|
+
"defaultValue": {
|
|
8831
|
+
"value": "Boolean(tabs)",
|
|
8832
|
+
"computed": true
|
|
8833
|
+
},
|
|
8834
|
+
"type": {
|
|
8835
|
+
"name": "bool"
|
|
8836
|
+
},
|
|
8837
|
+
"required": false,
|
|
8838
|
+
"description": "If true, whenever a new slide comes into view, the focus of the Carousel switches to the start.\n\nPass this as true when using carousel items that contain interactive content, so a user can easily tab into that content.\n\nIf skipLinkHref is passed, the focus target will be the SkipLink; if not, it'll be an empty element before the slide content."
|
|
8839
|
+
},
|
|
8472
8840
|
"title": {
|
|
8473
8841
|
"defaultValue": {
|
|
8474
8842
|
"value": "'carousel'",
|
|
@@ -8641,6 +9009,7 @@
|
|
|
8641
9009
|
"previousIcon": "icon",
|
|
8642
9010
|
"showPreviousNextNavigation": "show",
|
|
8643
9011
|
"showPanelNavigation": "show",
|
|
9012
|
+
"showPanelTabs": "show",
|
|
8644
9013
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
8645
9014
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
8646
9015
|
"thumbnailBorderColor": "color",
|
|
@@ -8710,12 +9079,17 @@
|
|
|
8710
9079
|
"required": false,
|
|
8711
9080
|
"description": "If this is a complex carousel with a lot of focusable content, pass a href for a skip link. Typically, this will be an anchor link\nwith the ID of a focusable element immediately after the Carousel, e.g. `'#section-2-heading'`."
|
|
8712
9081
|
},
|
|
8713
|
-
"
|
|
9082
|
+
"tabs": {
|
|
8714
9083
|
"type": {
|
|
8715
|
-
"name": "
|
|
9084
|
+
"name": "arrayOf",
|
|
9085
|
+
"value": {
|
|
9086
|
+
"name": "shape",
|
|
9087
|
+
"value": "CarouselTabsPanelItem.propTypes || {}",
|
|
9088
|
+
"computed": true
|
|
9089
|
+
}
|
|
8716
9090
|
},
|
|
8717
9091
|
"required": false,
|
|
8718
|
-
"description": "If
|
|
9092
|
+
"description": "If provided, defaults the navigation panel to a CarouselTabsPanel element passing each item as props for one tab.\n\nBe careful to ensure that the order of each element in the items array matches the order of each child in the Carousel."
|
|
8719
9093
|
},
|
|
8720
9094
|
"onAnimationStart": {
|
|
8721
9095
|
"type": {
|
|
@@ -8906,7 +9280,7 @@
|
|
|
8906
9280
|
},
|
|
8907
9281
|
"CarouselTabs": {
|
|
8908
9282
|
"docs": {
|
|
8909
|
-
"description": "",
|
|
9283
|
+
"description": "@deprecated Please use Carousel and pass the `tabs` prop.",
|
|
8910
9284
|
"props": {
|
|
8911
9285
|
"refocus": {
|
|
8912
9286
|
"defaultValue": {
|
|
@@ -8947,6 +9321,7 @@
|
|
|
8947
9321
|
"previousIcon": "icon",
|
|
8948
9322
|
"showPreviousNextNavigation": "show",
|
|
8949
9323
|
"showPanelNavigation": "show",
|
|
9324
|
+
"showPanelTabs": "show",
|
|
8950
9325
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
8951
9326
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
8952
9327
|
"thumbnailBorderColor": "color",
|
|
@@ -9110,6 +9485,18 @@
|
|
|
9110
9485
|
"required": false,
|
|
9111
9486
|
"description": "If this is a complex carousel with a lot of focusable content, pass a href for a skip link. Typically, this will be an anchor link\nwith the ID of a focusable element immediately after the Carousel, e.g. `'#section-2-heading'`."
|
|
9112
9487
|
},
|
|
9488
|
+
"tabs": {
|
|
9489
|
+
"type": {
|
|
9490
|
+
"name": "arrayOf",
|
|
9491
|
+
"value": {
|
|
9492
|
+
"name": "shape",
|
|
9493
|
+
"value": "CarouselTabsPanelItem.propTypes || {}",
|
|
9494
|
+
"computed": true
|
|
9495
|
+
}
|
|
9496
|
+
},
|
|
9497
|
+
"required": false,
|
|
9498
|
+
"description": "If provided, defaults the navigation panel to a CarouselTabsPanel element passing each item as props for one tab.\n\nBe careful to ensure that the order of each element in the items array matches the order of each child in the Carousel."
|
|
9499
|
+
},
|
|
9113
9500
|
"panelNavigation": {
|
|
9114
9501
|
"type": {
|
|
9115
9502
|
"name": "element"
|
|
@@ -9326,6 +9713,7 @@
|
|
|
9326
9713
|
"previousIcon": "icon",
|
|
9327
9714
|
"showPreviousNextNavigation": "show",
|
|
9328
9715
|
"showPanelNavigation": "show",
|
|
9716
|
+
"showPanelTabs": "show",
|
|
9329
9717
|
"spaceBetweenSlideAndPreviousNextNavigation": "size",
|
|
9330
9718
|
"spaceBetweenSlideAndPanelNavigation": "size",
|
|
9331
9719
|
"thumbnailBorderColor": "color",
|
package/lib/Carousel/Carousel.js
CHANGED
|
@@ -41,6 +41,10 @@ var _CarouselStepTracker = _interopRequireDefault(require("./CarouselStepTracker
|
|
|
41
41
|
|
|
42
42
|
var _CarouselThumbnailNavigation = _interopRequireDefault(require("./CarouselThumbnailNavigation"));
|
|
43
43
|
|
|
44
|
+
var _CarouselTabsPanel = _interopRequireDefault(require("./CarouselTabs/CarouselTabsPanel"));
|
|
45
|
+
|
|
46
|
+
var _CarouselTabsPanelItem = _interopRequireDefault(require("./CarouselTabs/CarouselTabsPanelItem"));
|
|
47
|
+
|
|
44
48
|
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
45
49
|
|
|
46
50
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -166,7 +170,8 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
166
170
|
onAnimationEnd,
|
|
167
171
|
onIndexChanged,
|
|
168
172
|
skipLinkHref,
|
|
169
|
-
|
|
173
|
+
tabs,
|
|
174
|
+
refocus = Boolean(tabs),
|
|
170
175
|
title = 'carousel',
|
|
171
176
|
springConfig = undefined,
|
|
172
177
|
thumbnails = undefined,
|
|
@@ -189,6 +194,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
189
194
|
nextIcon,
|
|
190
195
|
showPreviousNextNavigation,
|
|
191
196
|
showPanelNavigation,
|
|
197
|
+
showPanelTabs,
|
|
192
198
|
spaceBetweenSlideAndPreviousNextNavigation
|
|
193
199
|
} = themeTokens;
|
|
194
200
|
|
|
@@ -442,6 +448,9 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
442
448
|
return "".concat(copyText[0].toUpperCase()).concat(copyText.slice(1));
|
|
443
449
|
}, [activeIndex, childrenArray.length, itemLabel, getCopy, title]);
|
|
444
450
|
|
|
451
|
+
const activePanelNavigation = tabs && showPanelTabs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselTabsPanel.default, {
|
|
452
|
+
items: tabs
|
|
453
|
+
}) : panelNavigation;
|
|
445
454
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CarouselContext.CarouselProvider, {
|
|
446
455
|
activeIndex: activeIndex,
|
|
447
456
|
goTo: goTo,
|
|
@@ -517,7 +526,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
517
526
|
accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex + 2)
|
|
518
527
|
})
|
|
519
528
|
})]
|
|
520
|
-
}), showPanelNavigation ?
|
|
529
|
+
}), showPanelNavigation ? activePanelNavigation : null]
|
|
521
530
|
});
|
|
522
531
|
});
|
|
523
532
|
|
|
@@ -599,6 +608,13 @@ Carousel.propTypes = { ...selectedSystemPropTypes,
|
|
|
599
608
|
*/
|
|
600
609
|
skipLinkHref: _propTypes.default.string,
|
|
601
610
|
|
|
611
|
+
/**
|
|
612
|
+
* If provided, defaults the navigation panel to a CarouselTabsPanel element passing each item as props for one tab.
|
|
613
|
+
*
|
|
614
|
+
* Be careful to ensure that the order of each element in the items array matches the order of each child in the Carousel.
|
|
615
|
+
*/
|
|
616
|
+
tabs: _propTypes.default.arrayOf(_propTypes.default.shape(_CarouselTabsPanelItem.default.propTypes || {})),
|
|
617
|
+
|
|
602
618
|
/**
|
|
603
619
|
* If true, whenever a new slide comes into view, the focus of the Carousel switches to the start.
|
|
604
620
|
*
|
|
@@ -13,8 +13,6 @@ var _utils = require("../../utils");
|
|
|
13
13
|
|
|
14
14
|
var _Carousel = _interopRequireDefault(require("../Carousel"));
|
|
15
15
|
|
|
16
|
-
var _CarouselTabsPanel = _interopRequireDefault(require("./CarouselTabsPanel"));
|
|
17
|
-
|
|
18
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
17
|
|
|
20
18
|
var _CarouselTabs$propTyp, _CarouselTabs$propTyp2;
|
|
@@ -25,22 +23,23 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
23
|
|
|
26
24
|
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; }
|
|
27
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Please use Carousel and pass the `tabs` prop.
|
|
28
|
+
*/
|
|
28
29
|
const CarouselTabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
29
30
|
let {
|
|
30
31
|
items,
|
|
31
32
|
refocus = true,
|
|
32
33
|
...carouselProps
|
|
33
34
|
} = _ref;
|
|
34
|
-
const
|
|
35
|
-
md:
|
|
36
|
-
items: items
|
|
37
|
-
})
|
|
35
|
+
const tabs = (0, _utils.useResponsiveProp)({
|
|
36
|
+
md: items
|
|
38
37
|
});
|
|
39
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Carousel.default, {
|
|
40
39
|
refocus: refocus,
|
|
41
40
|
...carouselProps,
|
|
42
41
|
ref: ref,
|
|
43
|
-
|
|
42
|
+
tabs: tabs,
|
|
44
43
|
children: items.map(_ref2 => {
|
|
45
44
|
let {
|
|
46
45
|
title,
|
package/lib/Skeleton/Skeleton.js
CHANGED
|
@@ -11,6 +11,10 @@ var _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/export
|
|
|
11
11
|
|
|
12
12
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
13
13
|
|
|
14
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
15
|
+
|
|
16
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
17
|
+
|
|
14
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
19
|
|
|
16
20
|
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
@@ -36,14 +40,12 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
|
|
|
36
40
|
const selectSkeletonStyles = _ref => {
|
|
37
41
|
let {
|
|
38
42
|
color,
|
|
39
|
-
radius
|
|
40
|
-
fadeAnimation
|
|
43
|
+
radius
|
|
41
44
|
} = _ref;
|
|
42
45
|
return {
|
|
43
46
|
backgroundColor: color,
|
|
44
47
|
borderRadius: radius,
|
|
45
|
-
maxWidth: '100%'
|
|
46
|
-
...fadeAnimation
|
|
48
|
+
maxWidth: '100%'
|
|
47
49
|
};
|
|
48
50
|
};
|
|
49
51
|
|
|
@@ -101,12 +103,15 @@ const Skeleton = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
101
103
|
const skeletonHeight = (0, _utils.useSpacingScale)(spacingScaleValue);
|
|
102
104
|
const nativeAnimation = (0, _useSkeletonNativeAnimation.default)();
|
|
103
105
|
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
const getAnimationBasedOnPlatform = () => {
|
|
107
|
+
const animation = _Platform.default.OS === 'web' ? _skeletonWebAnimation.default : nativeAnimation; // We must pass the animation styles through `StyleSheet.create`
|
|
108
|
+
// @see https://github.com/necolas/react-native-web/issues/2387
|
|
109
|
+
|
|
110
|
+
const styles = _StyleSheet.default.create({
|
|
111
|
+
animation
|
|
112
|
+
});
|
|
108
113
|
|
|
109
|
-
return
|
|
114
|
+
return styles.animation;
|
|
110
115
|
};
|
|
111
116
|
|
|
112
117
|
const getLineWidth = () => {
|
|
@@ -140,11 +145,11 @@ const Skeleton = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
140
145
|
|
|
141
146
|
const renderSkeleton = function () {
|
|
142
147
|
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
143
|
-
|
|
148
|
+
// @see https://github.com/necolas/react-native-web/issues/2387
|
|
149
|
+
const Component = _Platform.default.OS === 'web' ? _View.default : _Animated.default.View;
|
|
150
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
144
151
|
testID: "skeleton",
|
|
145
|
-
style: [selectSkeletonStyles(
|
|
146
|
-
fadeAnimation: getAnimationBaseOnPlatform()
|
|
147
|
-
}), getStyledBasedOnShape()]
|
|
152
|
+
style: [selectSkeletonStyles(themeTokens), getAnimationBasedOnPlatform(), getStyledBasedOnShape()]
|
|
148
153
|
}, "skeleton-".concat(index + 1));
|
|
149
154
|
};
|
|
150
155
|
|