@telus-uds/components-base 1.14.3 → 1.15.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.
Files changed (139) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/__tests17__/A11yText/A11yText.test.jsx +34 -0
  3. package/__tests17__/ActivityIndicator/ActivityIndicator.test.jsx +68 -0
  4. package/__tests17__/ActivityIndicator/__snapshots__/ActivityIndicator.test.jsx.snap +299 -0
  5. package/__tests17__/Box/Box.test.jsx +111 -0
  6. package/__tests17__/Button/Button.test.jsx +86 -0
  7. package/__tests17__/Button/ButtonBase.test.jsx +82 -0
  8. package/__tests17__/Button/ButtonGroup.test.jsx +347 -0
  9. package/__tests17__/Button/ButtonLink.test.jsx +61 -0
  10. package/__tests17__/Card/Card.test.jsx +63 -0
  11. package/__tests17__/Carousel/Carousel.test.jsx +128 -0
  12. package/__tests17__/Carousel/CarouselTabs.test.jsx +142 -0
  13. package/__tests17__/Checkbox/Checkbox.test.jsx +94 -0
  14. package/__tests17__/Checkbox/CheckboxGroup.test.jsx +246 -0
  15. package/__tests17__/Divider/Divider.test.jsx +91 -0
  16. package/__tests17__/ExpandCollapse/ExpandCollapse.test.jsx +109 -0
  17. package/__tests17__/Feedback/Feedback.test.jsx +42 -0
  18. package/__tests17__/FlexGrid/Col.test.jsx +261 -0
  19. package/__tests17__/FlexGrid/FlexGrid.test.jsx +136 -0
  20. package/__tests17__/FlexGrid/Row.test.jsx +273 -0
  21. package/__tests17__/HorizontalScroll/HorizontalScroll.test.jsx +165 -0
  22. package/__tests17__/Icon/Icon.test.jsx +61 -0
  23. package/__tests17__/IconButton/IconButton.test.jsx +52 -0
  24. package/__tests17__/InputLabel/InputLabel.test.jsx +28 -0
  25. package/__tests17__/InputLabel/__snapshots__/InputLabel.test.jsx.snap +3 -0
  26. package/__tests17__/InputSupports/InputSupports.test.jsx +60 -0
  27. package/__tests17__/Link/Link.test.jsx +63 -0
  28. package/__tests17__/Link/TextButton.test.jsx +35 -0
  29. package/__tests17__/List/List.test.jsx +82 -0
  30. package/__tests17__/Modal/Modal.test.jsx +47 -0
  31. package/__tests17__/Notification/Notification.test.jsx +20 -0
  32. package/__tests17__/Pagination/Pagination.test.jsx +160 -0
  33. package/__tests17__/Progress/Progress.test.jsx +79 -0
  34. package/__tests17__/Radio/Radio.test.jsx +87 -0
  35. package/__tests17__/Radio/RadioGroup.test.jsx +220 -0
  36. package/__tests17__/RadioCard/RadioCard.test.jsx +87 -0
  37. package/__tests17__/RadioCard/RadioCardGroup.test.jsx +246 -0
  38. package/__tests17__/Search/Search.test.jsx +87 -0
  39. package/__tests17__/Select/Select.test.jsx +94 -0
  40. package/__tests17__/SideNav/SideNav.test.jsx +110 -0
  41. package/__tests17__/Skeleton/Skeleton.test.jsx +61 -0
  42. package/__tests17__/SkipLink/SkipLink.test.jsx +61 -0
  43. package/__tests17__/Spacer/Spacer.test.jsx +63 -0
  44. package/__tests17__/StackView/StackView.test.jsx +211 -0
  45. package/__tests17__/StackView/StackWrap.test.jsx +47 -0
  46. package/__tests17__/StackView/getStackedContent.test.jsx +295 -0
  47. package/__tests17__/StepTracker/StepTracker.test.jsx +108 -0
  48. package/__tests17__/Tabs/Tabs.test.jsx +49 -0
  49. package/__tests17__/Tags/Tags.test.jsx +327 -0
  50. package/__tests17__/TextInput/TextArea.test.jsx +35 -0
  51. package/__tests17__/TextInput/TextInputBase.test.jsx +125 -0
  52. package/__tests17__/ThemeProvider/ThemeProvider.test.jsx +80 -0
  53. package/__tests17__/ThemeProvider/useThemeTokens.test.jsx +514 -0
  54. package/__tests17__/ThemeProvider/utils/theme-tokens.test.js +41 -0
  55. package/__tests17__/ToggleSwitch/ToggleSwitch.test.jsx +82 -0
  56. package/__tests17__/ToggleSwitch/ToggleSwitchGroup.test.jsx +192 -0
  57. package/__tests17__/Tooltip/Tooltip.test.jsx +65 -0
  58. package/__tests17__/Tooltip/getTooltipPosition.test.js +79 -0
  59. package/__tests17__/Typography/typography.test.jsx +90 -0
  60. package/__tests17__/utils/children.test.jsx +128 -0
  61. package/__tests17__/utils/containUniqueFields.test.js +25 -0
  62. package/__tests17__/utils/input.test.js +375 -0
  63. package/__tests17__/utils/props.test.js +36 -0
  64. package/__tests17__/utils/semantics.test.jsx +34 -0
  65. package/__tests17__/utils/useCopy.test.js +42 -0
  66. package/__tests17__/utils/useResponsiveProp.test.jsx +202 -0
  67. package/__tests17__/utils/useSpacingScale.test.jsx +273 -0
  68. package/__tests17__/utils/useUniqueId.test.js +31 -0
  69. package/component-docs.json +85 -438
  70. package/lib/A11yInfoProvider/index.js +14 -5
  71. package/lib/Button/ButtonGroup.js +3 -2
  72. package/lib/Checkbox/Checkbox.js +9 -6
  73. package/lib/ExpandCollapse/Control.js +6 -5
  74. package/lib/ExpandCollapse/Panel.js +5 -4
  75. package/lib/List/ListItem.js +10 -236
  76. package/lib/List/ListItemBase.js +162 -0
  77. package/lib/List/ListItemContent.js +85 -0
  78. package/lib/List/ListItemMark.js +158 -0
  79. package/lib/List/PressableListItemBase.js +147 -0
  80. package/lib/Notification/Notification.js +2 -1
  81. package/lib/Pagination/Pagination.js +4 -3
  82. package/lib/Radio/Radio.js +9 -6
  83. package/lib/RadioCard/RadioCard.js +9 -6
  84. package/lib/Tabs/Tabs.js +12 -3
  85. package/lib/Tags/Tags.js +3 -3
  86. package/lib/TextInput/TextInput.js +5 -4
  87. package/lib/ViewportProvider/useViewportListener.js +11 -5
  88. package/lib/utils/hasOwnProperty.js +18 -0
  89. package/lib/utils/props/a11yProps.js +212 -45
  90. package/lib/utils/props/getPropSelector.js +47 -5
  91. package/lib/utils/useResponsiveProp.js +5 -3
  92. package/lib/utils/withLinkRouter.js +3 -5
  93. package/lib-module/A11yInfoProvider/index.js +14 -4
  94. package/lib-module/Button/ButtonGroup.js +3 -2
  95. package/lib-module/Checkbox/Checkbox.js +9 -6
  96. package/lib-module/ExpandCollapse/Control.js +6 -5
  97. package/lib-module/ExpandCollapse/Panel.js +5 -4
  98. package/lib-module/List/ListItem.js +13 -235
  99. package/lib-module/List/ListItemBase.js +139 -0
  100. package/lib-module/List/ListItemContent.js +66 -0
  101. package/lib-module/List/ListItemMark.js +143 -0
  102. package/lib-module/List/PressableListItemBase.js +117 -0
  103. package/lib-module/Notification/Notification.js +2 -1
  104. package/lib-module/Pagination/Pagination.js +5 -3
  105. package/lib-module/Radio/Radio.js +9 -6
  106. package/lib-module/RadioCard/RadioCard.js +9 -6
  107. package/lib-module/Tabs/Tabs.js +13 -4
  108. package/lib-module/Tags/Tags.js +3 -3
  109. package/lib-module/TextInput/TextInput.js +5 -4
  110. package/lib-module/ViewportProvider/useViewportListener.js +10 -4
  111. package/lib-module/utils/hasOwnProperty.js +11 -0
  112. package/lib-module/utils/props/a11yProps.js +210 -45
  113. package/lib-module/utils/props/getPropSelector.js +44 -5
  114. package/lib-module/utils/useResponsiveProp.js +3 -4
  115. package/lib-module/utils/withLinkRouter.js +3 -5
  116. package/package.json +11 -16
  117. package/src/A11yInfoProvider/index.jsx +20 -4
  118. package/src/Button/ButtonGroup.jsx +4 -2
  119. package/src/Checkbox/Checkbox.jsx +7 -3
  120. package/src/ExpandCollapse/Control.jsx +8 -5
  121. package/src/ExpandCollapse/Panel.jsx +7 -5
  122. package/src/List/ListItem.jsx +12 -191
  123. package/src/List/ListItemBase.jsx +118 -0
  124. package/src/List/ListItemContent.jsx +52 -0
  125. package/src/List/ListItemMark.jsx +99 -0
  126. package/src/List/PressableListItemBase.jsx +102 -0
  127. package/src/Notification/Notification.jsx +1 -1
  128. package/src/Pagination/Pagination.jsx +6 -1
  129. package/src/Radio/Radio.jsx +7 -3
  130. package/src/RadioCard/RadioCard.jsx +7 -3
  131. package/src/Tabs/Tabs.jsx +19 -2
  132. package/src/Tags/Tags.jsx +3 -3
  133. package/src/TextInput/TextInput.jsx +4 -4
  134. package/src/ViewportProvider/useViewportListener.js +10 -5
  135. package/src/utils/hasOwnProperty.js +11 -0
  136. package/src/utils/props/a11yProps.js +168 -55
  137. package/src/utils/props/getPropSelector.js +45 -4
  138. package/src/utils/useResponsiveProp.js +3 -3
  139. package/src/utils/withLinkRouter.jsx +1 -3
@@ -4646,12 +4646,26 @@
4646
4646
  "docs": {
4647
4647
  "description": "ListItem is responsible for rendering icon or a bullet as side item",
4648
4648
  "props": {
4649
- "accessibilityRole": {
4650
- "defaultValue": {
4651
- "value": "Platform.select({ web: 'listitem', default: undefined })",
4652
- "computed": true
4649
+ "variant": {
4650
+ "type": {
4651
+ "name": "objectOf",
4652
+ "value": {
4653
+ "name": "union",
4654
+ "value": [
4655
+ {
4656
+ "name": "string"
4657
+ },
4658
+ {
4659
+ "name": "number"
4660
+ },
4661
+ {
4662
+ "name": "bool"
4663
+ }
4664
+ ]
4665
+ }
4653
4666
  },
4654
- "required": false
4667
+ "required": false,
4668
+ "description": ""
4655
4669
  },
4656
4670
  "tokens": {
4657
4671
  "type": {
@@ -4679,30 +4693,17 @@
4679
4693
  "required": false,
4680
4694
  "description": ""
4681
4695
  },
4682
- "variant": {
4683
- "type": {
4684
- "name": "objectOf",
4685
- "value": {
4686
- "name": "union",
4687
- "value": [
4688
- {
4689
- "name": "string"
4690
- },
4691
- {
4692
- "name": "number"
4693
- },
4694
- {
4695
- "name": "bool"
4696
- }
4697
- ]
4698
- }
4699
- },
4700
- "required": false,
4701
- "description": ""
4702
- },
4703
4696
  "children": {
4704
4697
  "type": {
4705
- "name": "node"
4698
+ "name": "union",
4699
+ "value": [
4700
+ {
4701
+ "name": "node"
4702
+ },
4703
+ {
4704
+ "name": "func"
4705
+ }
4706
+ ]
4706
4707
  },
4707
4708
  "required": true,
4708
4709
  "description": ""
@@ -4817,12 +4818,26 @@
4817
4818
  "docs": {
4818
4819
  "description": "ListItem is responsible for rendering icon or a bullet as side item",
4819
4820
  "props": {
4820
- "accessibilityRole": {
4821
- "defaultValue": {
4822
- "value": "Platform.select({ web: 'listitem', default: undefined })",
4823
- "computed": true
4821
+ "variant": {
4822
+ "type": {
4823
+ "name": "objectOf",
4824
+ "value": {
4825
+ "name": "union",
4826
+ "value": [
4827
+ {
4828
+ "name": "string"
4829
+ },
4830
+ {
4831
+ "name": "number"
4832
+ },
4833
+ {
4834
+ "name": "bool"
4835
+ }
4836
+ ]
4837
+ }
4824
4838
  },
4825
- "required": false
4839
+ "required": false,
4840
+ "description": ""
4826
4841
  },
4827
4842
  "tokens": {
4828
4843
  "type": {
@@ -4850,30 +4865,17 @@
4850
4865
  "required": false,
4851
4866
  "description": ""
4852
4867
  },
4853
- "variant": {
4854
- "type": {
4855
- "name": "objectOf",
4856
- "value": {
4857
- "name": "union",
4858
- "value": [
4859
- {
4860
- "name": "string"
4861
- },
4862
- {
4863
- "name": "number"
4864
- },
4865
- {
4866
- "name": "bool"
4867
- }
4868
- ]
4869
- }
4870
- },
4871
- "required": false,
4872
- "description": ""
4873
- },
4874
4868
  "children": {
4875
4869
  "type": {
4876
- "name": "node"
4870
+ "name": "union",
4871
+ "value": [
4872
+ {
4873
+ "name": "node"
4874
+ },
4875
+ {
4876
+ "name": "func"
4877
+ }
4878
+ ]
4877
4879
  },
4878
4880
  "required": true,
4879
4881
  "description": ""
@@ -4910,12 +4912,26 @@
4910
4912
  "docs": {
4911
4913
  "description": "ListItem is responsible for rendering icon or a bullet as side item",
4912
4914
  "props": {
4913
- "accessibilityRole": {
4914
- "defaultValue": {
4915
- "value": "Platform.select({ web: 'listitem', default: undefined })",
4916
- "computed": true
4915
+ "variant": {
4916
+ "type": {
4917
+ "name": "objectOf",
4918
+ "value": {
4919
+ "name": "union",
4920
+ "value": [
4921
+ {
4922
+ "name": "string"
4923
+ },
4924
+ {
4925
+ "name": "number"
4926
+ },
4927
+ {
4928
+ "name": "bool"
4929
+ }
4930
+ ]
4931
+ }
4917
4932
  },
4918
- "required": false
4933
+ "required": false,
4934
+ "description": ""
4919
4935
  },
4920
4936
  "tokens": {
4921
4937
  "type": {
@@ -4943,30 +4959,17 @@
4943
4959
  "required": false,
4944
4960
  "description": ""
4945
4961
  },
4946
- "variant": {
4947
- "type": {
4948
- "name": "objectOf",
4949
- "value": {
4950
- "name": "union",
4951
- "value": [
4952
- {
4953
- "name": "string"
4954
- },
4955
- {
4956
- "name": "number"
4957
- },
4958
- {
4959
- "name": "bool"
4960
- }
4961
- ]
4962
- }
4963
- },
4964
- "required": false,
4965
- "description": ""
4966
- },
4967
4962
  "children": {
4968
4963
  "type": {
4969
- "name": "node"
4964
+ "name": "union",
4965
+ "value": [
4966
+ {
4967
+ "name": "node"
4968
+ },
4969
+ {
4970
+ "name": "func"
4971
+ }
4972
+ ]
4970
4973
  },
4971
4974
  "required": true,
4972
4975
  "description": ""
@@ -5550,7 +5553,7 @@
5550
5553
  }
5551
5554
  },
5552
5555
  "attributes": {
5553
- "acceptsRNA11yProps": true
5556
+ "acceptsRNA11yProps": false
5554
5557
  }
5555
5558
  }
5556
5559
  }
@@ -8138,154 +8141,6 @@
8138
8141
  }
8139
8142
  }
8140
8143
  },
8141
- "Button": {
8142
- "docs": {
8143
- "description": "",
8144
- "props": {
8145
- "tokens": {
8146
- "type": {
8147
- "name": "custom",
8148
- "raw": {
8149
- "borderColor": "color",
8150
- "borderWidth": "border",
8151
- "borderRadius": "radius",
8152
- "shadow": "shadow",
8153
- "fontSize": "fontSize",
8154
- "color": "color",
8155
- "lineHeight": "lineHeight",
8156
- "textAlign": "flexJustifyContent",
8157
- "alignSelf": "flexAlign",
8158
- "fontName": "fontName",
8159
- "fontWeight": "fontWeight",
8160
- "backgroundColor": "color",
8161
- "opacity": "opacity",
8162
- "paddingLeft": "size",
8163
- "paddingRight": "size",
8164
- "paddingTop": "size",
8165
- "paddingBottom": "size",
8166
- "width": "size",
8167
- "minWidth": "size",
8168
- "iconSize": "size",
8169
- "iconSpace": "integer",
8170
- "icon": "icon",
8171
- "outerBorderColor": "color",
8172
- "outerBorderWidth": "border",
8173
- "outerBorderGap": "size",
8174
- "outerBackgroundColor": "color"
8175
- }
8176
- },
8177
- "required": false,
8178
- "description": ""
8179
- },
8180
- "inactive": {
8181
- "type": {
8182
- "name": "bool"
8183
- },
8184
- "required": false,
8185
- "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"
8186
- },
8187
- "disabled": {
8188
- "type": {
8189
- "name": "bool"
8190
- },
8191
- "required": false,
8192
- "description": "Alias for `inactive`"
8193
- },
8194
- "children": {
8195
- "type": {
8196
- "name": "custom",
8197
- "raw": "ABBPropTypes.childrenOf(\n PropTypes.oneOfType([ABBPropTypes.elementType(A11yText), PropTypes.string])\n)"
8198
- },
8199
- "required": false,
8200
- "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```"
8201
- },
8202
- "onPress": {
8203
- "type": {
8204
- "name": "func"
8205
- },
8206
- "required": false,
8207
- "description": "Function called when the button is pressed. Required unless the button has a href."
8208
- },
8209
- "iconProps": {
8210
- "type": {
8211
- "name": "exact",
8212
- "value": {
8213
- "variant": {
8214
- "name": "custom",
8215
- "raw": "variantProp.propType",
8216
- "required": false
8217
- },
8218
- "tokens": {
8219
- "name": "custom",
8220
- "raw": "getTokensPropType('Icon')",
8221
- "required": false
8222
- },
8223
- "accessibilityLabel": {
8224
- "name": "string",
8225
- "description": "Descriptive label used in web SVG title tag for accessibility",
8226
- "required": false
8227
- },
8228
- "scalesWithText": {
8229
- "name": "bool",
8230
- "description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
8231
- "required": false
8232
- }
8233
- }
8234
- },
8235
- "required": false,
8236
- "description": "Optional variant that may be passed down to the link's icon if there is one"
8237
- },
8238
- "iconPosition": {
8239
- "type": {
8240
- "name": "enum",
8241
- "value": [
8242
- {
8243
- "value": "'left'",
8244
- "computed": false
8245
- },
8246
- {
8247
- "value": "'right'",
8248
- "computed": false
8249
- }
8250
- ]
8251
- },
8252
- "required": false,
8253
- "description": "When `icon` is provided, use `iconPosition` to place the Icon to the left or right side of the button."
8254
- },
8255
- "icon": {
8256
- "type": {
8257
- "name": "func"
8258
- },
8259
- "required": false,
8260
- "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."
8261
- },
8262
- "variant": {
8263
- "type": {
8264
- "name": "objectOf",
8265
- "value": {
8266
- "name": "union",
8267
- "value": [
8268
- {
8269
- "name": "string"
8270
- },
8271
- {
8272
- "name": "number"
8273
- },
8274
- {
8275
- "name": "bool"
8276
- }
8277
- ]
8278
- }
8279
- },
8280
- "required": false,
8281
- "description": ""
8282
- }
8283
- },
8284
- "attributes": {
8285
- "acceptsRNA11yProps": true
8286
- }
8287
- }
8288
- },
8289
8144
  "ButtonGroup": {
8290
8145
  "docs": {
8291
8146
  "description": "",
@@ -8527,214 +8382,6 @@
8527
8382
  }
8528
8383
  }
8529
8384
  },
8530
- "ButtonLink": {
8531
- "docs": {
8532
- "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.",
8533
- "props": {
8534
- "tokens": {
8535
- "type": {
8536
- "name": "custom",
8537
- "raw": {
8538
- "borderColor": "color",
8539
- "borderWidth": "border",
8540
- "borderRadius": "radius",
8541
- "shadow": "shadow",
8542
- "fontSize": "fontSize",
8543
- "color": "color",
8544
- "lineHeight": "lineHeight",
8545
- "textAlign": "flexJustifyContent",
8546
- "alignSelf": "flexAlign",
8547
- "fontName": "fontName",
8548
- "fontWeight": "fontWeight",
8549
- "backgroundColor": "color",
8550
- "opacity": "opacity",
8551
- "paddingLeft": "size",
8552
- "paddingRight": "size",
8553
- "paddingTop": "size",
8554
- "paddingBottom": "size",
8555
- "width": "size",
8556
- "minWidth": "size",
8557
- "iconSize": "size",
8558
- "iconSpace": "integer",
8559
- "icon": "icon",
8560
- "outerBorderColor": "color",
8561
- "outerBorderWidth": "border",
8562
- "outerBorderGap": "size",
8563
- "outerBackgroundColor": "color"
8564
- }
8565
- },
8566
- "required": false,
8567
- "description": ""
8568
- },
8569
- "inactive": {
8570
- "type": {
8571
- "name": "bool"
8572
- },
8573
- "required": false,
8574
- "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"
8575
- },
8576
- "disabled": {
8577
- "type": {
8578
- "name": "bool"
8579
- },
8580
- "required": false,
8581
- "description": "Alias for `inactive`"
8582
- },
8583
- "children": {
8584
- "type": {
8585
- "name": "custom",
8586
- "raw": "ABBPropTypes.childrenOf(\n PropTypes.oneOfType([ABBPropTypes.elementType(A11yText), PropTypes.string])\n)"
8587
- },
8588
- "required": false,
8589
- "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```"
8590
- },
8591
- "onPress": {
8592
- "type": {
8593
- "name": "func"
8594
- },
8595
- "required": false,
8596
- "description": "Function called when the button is pressed. Required unless the button has a href."
8597
- },
8598
- "iconProps": {
8599
- "type": {
8600
- "name": "exact",
8601
- "value": {
8602
- "variant": {
8603
- "name": "custom",
8604
- "raw": "variantProp.propType",
8605
- "required": false
8606
- },
8607
- "tokens": {
8608
- "name": "custom",
8609
- "raw": "getTokensPropType('Icon')",
8610
- "required": false
8611
- },
8612
- "accessibilityLabel": {
8613
- "name": "string",
8614
- "description": "Descriptive label used in web SVG title tag for accessibility",
8615
- "required": false
8616
- },
8617
- "scalesWithText": {
8618
- "name": "bool",
8619
- "description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
8620
- "required": false
8621
- }
8622
- }
8623
- },
8624
- "required": false,
8625
- "description": "Optional variant that may be passed down to the link's icon if there is one"
8626
- },
8627
- "iconPosition": {
8628
- "type": {
8629
- "name": "enum",
8630
- "value": [
8631
- {
8632
- "value": "'left'",
8633
- "computed": false
8634
- },
8635
- {
8636
- "value": "'right'",
8637
- "computed": false
8638
- }
8639
- ]
8640
- },
8641
- "required": false,
8642
- "description": "When `icon` is provided, use `iconPosition` to place the Icon to the left or right side of the button."
8643
- },
8644
- "icon": {
8645
- "type": {
8646
- "name": "func"
8647
- },
8648
- "required": false,
8649
- "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."
8650
- },
8651
- "variant": {
8652
- "type": {
8653
- "name": "objectOf",
8654
- "value": {
8655
- "name": "union",
8656
- "value": [
8657
- {
8658
- "name": "string"
8659
- },
8660
- {
8661
- "name": "number"
8662
- },
8663
- {
8664
- "name": "bool"
8665
- }
8666
- ]
8667
- }
8668
- },
8669
- "required": false,
8670
- "description": ""
8671
- },
8672
- "onPressIn": {
8673
- "type": {
8674
- "name": "func"
8675
- },
8676
- "required": false,
8677
- "description": ""
8678
- },
8679
- "onPressOut": {
8680
- "type": {
8681
- "name": "func"
8682
- },
8683
- "required": false,
8684
- "description": ""
8685
- },
8686
- "href": {
8687
- "type": {
8688
- "name": "string"
8689
- },
8690
- "required": false,
8691
- "description": ""
8692
- },
8693
- "hrefAttrs": {
8694
- "type": {
8695
- "name": "shape",
8696
- "value": {
8697
- "download": {
8698
- "name": "string",
8699
- "required": false
8700
- },
8701
- "rel": {
8702
- "name": "string",
8703
- "required": false
8704
- },
8705
- "target": {
8706
- "name": "enum",
8707
- "value": [
8708
- {
8709
- "value": "'_self'",
8710
- "computed": false
8711
- },
8712
- {
8713
- "value": "'_blank'",
8714
- "computed": false
8715
- },
8716
- {
8717
- "value": "'_parent'",
8718
- "computed": false
8719
- },
8720
- {
8721
- "value": "'_top'",
8722
- "computed": false
8723
- }
8724
- ],
8725
- "required": false
8726
- }
8727
- }
8728
- },
8729
- "required": false,
8730
- "description": ""
8731
- }
8732
- },
8733
- "attributes": {
8734
- "acceptsRNA11yProps": true
8735
- }
8736
- }
8737
- },
8738
8385
  "Carousel": {
8739
8386
  "docs": {
8740
8387
  "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",
@@ -37,9 +37,9 @@ const A11yInfoProvider = _ref => {
37
37
  return () => {};
38
38
  }
39
39
 
40
- _AccessibilityInfo.default.addEventListener('reduceMotionChanged', setReduceMotionEnabled);
40
+ const motionSubscription = _AccessibilityInfo.default.addEventListener('reduceMotionChanged', setReduceMotionEnabled);
41
41
 
42
- _AccessibilityInfo.default.addEventListener('screenReaderChanged', setScreenReaderEnabled);
42
+ const screenReaderSubscription = _AccessibilityInfo.default.addEventListener('screenReaderChanged', setScreenReaderEnabled);
43
43
 
44
44
  const setInitialA11yInfo = async () => {
45
45
  const [initialReduceMotionEnabled, initialScreenReaderEnabled] = await Promise.all([_AccessibilityInfo.default.isReduceMotionEnabled(), _AccessibilityInfo.default.isScreenReaderEnabled()]); // Browsers can't detect screen readers; in RNW isScreenReaderEnabled() is always `true`
@@ -55,9 +55,18 @@ const A11yInfoProvider = _ref => {
55
55
  }
56
56
 
57
57
  return () => {
58
- _AccessibilityInfo.default.removeEventListener('reduceMotionChanged', setReduceMotionEnabled);
59
-
60
- _AccessibilityInfo.default.removeEventListener('screenReaderChanged', setScreenReaderEnabled);
58
+ // From react-native 0.65, AccessibilityInfo.removeEventListener is deprecated for `remove` on addEventListener return value
59
+ if (typeof (motionSubscription === null || motionSubscription === void 0 ? void 0 : motionSubscription.remove) === 'function') {
60
+ motionSubscription === null || motionSubscription === void 0 ? void 0 : motionSubscription.remove();
61
+ } else if (typeof _AccessibilityInfo.default.removeEventListener === 'function') {
62
+ _AccessibilityInfo.default.removeEventListener('reduceMotionChanged', setReduceMotionEnabled);
63
+ }
64
+
65
+ if (typeof (screenReaderSubscription === null || screenReaderSubscription === void 0 ? void 0 : screenReaderSubscription.remove) === 'function') {
66
+ screenReaderSubscription === null || screenReaderSubscription === void 0 ? void 0 : screenReaderSubscription.remove();
67
+ } else if (typeof _AccessibilityInfo.default.removeEventListener === 'function') {
68
+ _AccessibilityInfo.default.removeEventListener('screenReaderChanged', setScreenReaderEnabled);
69
+ }
61
70
  };
62
71
  }, []);
63
72
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(ReducedMotionContext.Provider, {
@@ -155,8 +155,9 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
155
155
  tokens: getButtonTokens,
156
156
  selected: isSelected,
157
157
  inactive: inactive,
158
- ...itemA11y,
159
- ...selectItemProps(itemRest),
158
+ ...selectItemProps({ ...itemRest,
159
+ ...itemA11y
160
+ }),
160
161
  children: label
161
162
  }, id);
162
163
  })
@@ -219,6 +219,14 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
219
219
  const {
220
220
  themeOptions
221
221
  } = (0, _ThemeProvider.useTheme)();
222
+ const selectedProps = selectProps({
223
+ accessibilityRole: 'checkbox',
224
+ accessibilityState: {
225
+ checked: isChecked,
226
+ disabled: inactive
227
+ },
228
+ ...rest
229
+ });
222
230
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
223
231
  style: staticStyles.wrapper,
224
232
  ref: ref,
@@ -229,12 +237,7 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
229
237
  disabled: inactive,
230
238
  onKeyDown: handleKeyDown,
231
239
  onPress: handleChange,
232
- accessibilityRole: "checkbox",
233
- accessibilityState: {
234
- checked: isChecked,
235
- disabled: inactive
236
- },
237
- ...selectProps(rest),
240
+ ...selectedProps,
238
241
  children: _ref6 => {
239
242
  let {
240
243
  focused: focus,