@telus-uds/components-base 1.8.2 → 1.8.5
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 +33 -2
- package/component-docs.json +36 -1
- package/lib/ActivityIndicator/Spinner.js +7 -7
- package/lib/ActivityIndicator/Spinner.native.js +2 -2
- package/lib/Button/ButtonBase.js +2 -2
- package/lib/Button/ButtonGroup.js +1 -1
- package/lib/Checkbox/Checkbox.js +5 -3
- package/lib/Checkbox/CheckboxGroup.js +2 -2
- package/lib/Divider/Divider.js +2 -2
- package/lib/ExpandCollapse/Panel.js +2 -17
- package/lib/FlexGrid/Col/Col.js +1 -1
- package/lib/Icon/Icon.js +1 -1
- package/lib/Link/InlinePressable.js +5 -1
- package/lib/Link/LinkBase.js +5 -2
- package/lib/List/List.js +12 -7
- package/lib/List/ListItem.js +4 -5
- package/lib/Modal/Modal.js +2 -1
- package/lib/Pagination/PageButton.js +2 -2
- package/lib/Pagination/Pagination.js +5 -3
- package/lib/Pagination/usePagination.js +2 -2
- package/lib/Progress/ProgressBar.js +3 -3
- package/lib/Progress/ProgressBarBackground.js +3 -3
- package/lib/Radio/Radio.js +2 -2
- package/lib/Radio/RadioGroup.js +2 -2
- package/lib/RadioCard/RadioCard.js +1 -1
- package/lib/RadioCard/RadioCardGroup.js +2 -2
- package/lib/Search/Search.js +1 -1
- package/lib/SideNav/SideNav.js +2 -2
- package/lib/Skeleton/Skeleton.js +1 -1
- package/lib/Skeleton/skeletonWebAnimation.js +1 -1
- package/lib/StackView/StackWrap.js +3 -1
- package/lib/StackView/getStackedContent.js +2 -2
- package/lib/Tabs/Tabs.js +28 -3
- package/lib/Tabs/TabsItem.js +5 -6
- package/lib/Tags/Tags.js +1 -1
- package/lib/ThemeProvider/utils/styles.js +2 -2
- package/lib/ThemeProvider/utils/theme-tokens.js +7 -9
- package/lib/ToggleSwitch/ToggleSwitch.js +1 -1
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +1 -1
- package/lib/Tooltip/Backdrop.js +2 -10
- package/lib/utils/animation/useVerticalExpandAnimation.js +40 -14
- package/lib/utils/children.js +2 -2
- package/lib/utils/input.js +6 -12
- package/lib/utils/props/componentPropType.js +3 -3
- package/lib/utils/props/selectSystemProps.js +2 -2
- package/lib/utils/props/tokens.js +2 -2
- package/lib/utils/useSpacingScale.js +3 -1
- package/lib/utils/useUniqueId.js +1 -1
- package/lib-module/A11yInfoProvider/index.js +63 -0
- package/lib-module/A11yText/index.js +56 -0
- package/lib-module/ActivityIndicator/Spinner.js +77 -0
- package/lib-module/ActivityIndicator/Spinner.native.js +144 -0
- package/lib-module/ActivityIndicator/index.js +41 -0
- package/lib-module/ActivityIndicator/shared.js +12 -0
- package/lib-module/BaseProvider/index.js +29 -0
- package/lib-module/Box/Box.js +244 -0
- package/lib-module/Box/index.js +2 -0
- package/lib-module/Button/Button.js +26 -0
- package/lib-module/Button/ButtonBase.js +271 -0
- package/lib-module/Button/ButtonGroup.js +247 -0
- package/lib-module/Button/ButtonLink.js +40 -0
- package/lib-module/Button/index.js +4 -0
- package/lib-module/Button/propTypes.js +36 -0
- package/lib-module/Card/Card.js +84 -0
- package/lib-module/Card/CardBase.js +66 -0
- package/lib-module/Card/PressableCardBase.js +114 -0
- package/lib-module/Card/index.js +4 -0
- package/lib-module/Checkbox/Checkbox.js +348 -0
- package/lib-module/Checkbox/CheckboxGroup.js +233 -0
- package/lib-module/Checkbox/CheckboxInput.js +60 -0
- package/lib-module/Checkbox/CheckboxInput.native.js +6 -0
- package/lib-module/Checkbox/index.js +3 -0
- package/lib-module/Divider/Divider.js +124 -0
- package/lib-module/Divider/index.js +2 -0
- package/lib-module/ExpandCollapse/Accordion.js +15 -0
- package/lib-module/ExpandCollapse/Control.js +136 -0
- package/lib-module/ExpandCollapse/ExpandCollapse.js +95 -0
- package/lib-module/ExpandCollapse/Panel.js +151 -0
- package/lib-module/ExpandCollapse/index.js +7 -0
- package/lib-module/Feedback/Feedback.js +157 -0
- package/lib-module/Feedback/index.js +2 -0
- package/lib-module/Fieldset/Fieldset.js +153 -0
- package/lib-module/Fieldset/FieldsetContainer.js +32 -0
- package/lib-module/Fieldset/FieldsetContainer.native.js +23 -0
- package/lib-module/Fieldset/Legend.js +24 -0
- package/lib-module/Fieldset/Legend.native.js +31 -0
- package/lib-module/Fieldset/cssReset.js +14 -0
- package/lib-module/Fieldset/index.js +2 -0
- package/lib-module/FlexGrid/Col/Col.js +276 -0
- package/lib-module/FlexGrid/Col/index.js +2 -0
- package/lib-module/FlexGrid/FlexGrid.js +148 -0
- package/lib-module/FlexGrid/Row/Row.js +184 -0
- package/lib-module/FlexGrid/Row/index.js +2 -0
- package/lib-module/FlexGrid/helpers/index.js +18 -0
- package/lib-module/FlexGrid/index.js +2 -0
- package/lib-module/FlexGrid/providers/GutterContext.js +3 -0
- package/lib-module/HorizontalScroll/HorizontalScroll.js +175 -0
- package/lib-module/HorizontalScroll/HorizontalScrollButton.js +81 -0
- package/lib-module/HorizontalScroll/ScrollViewEnd.js +48 -0
- package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +27 -0
- package/lib-module/HorizontalScroll/dictionary.js +11 -0
- package/lib-module/HorizontalScroll/index.js +11 -0
- package/lib-module/HorizontalScroll/itemPositions.js +112 -0
- package/lib-module/Icon/Icon.js +62 -0
- package/lib-module/Icon/IconText.js +83 -0
- package/lib-module/Icon/index.js +4 -0
- package/lib-module/IconButton/IconButton.js +122 -0
- package/lib-module/IconButton/index.js +2 -0
- package/lib-module/InputLabel/InputLabel.js +148 -0
- package/lib-module/InputLabel/LabelContent.js +27 -0
- package/lib-module/InputLabel/LabelContent.native.js +19 -0
- package/lib-module/InputLabel/index.js +2 -0
- package/lib-module/InputSupports/InputSupports.js +96 -0
- package/lib-module/InputSupports/index.js +2 -0
- package/lib-module/InputSupports/useInputSupports.js +32 -0
- package/lib-module/Link/ChevronLink.js +52 -0
- package/lib-module/Link/InlinePressable.js +44 -0
- package/lib-module/Link/InlinePressable.native.js +89 -0
- package/lib-module/Link/Link.js +28 -0
- package/lib-module/Link/LinkBase.js +243 -0
- package/lib-module/Link/TextButton.js +35 -0
- package/lib-module/Link/index.js +5 -0
- package/lib-module/List/List.js +62 -0
- package/lib-module/List/ListItem.js +248 -0
- package/lib-module/List/index.js +5 -0
- package/lib-module/Modal/Modal.js +222 -0
- package/lib-module/Modal/dictionary.js +9 -0
- package/lib-module/Modal/index.js +2 -0
- package/lib-module/Notification/Notification.js +209 -0
- package/lib-module/Notification/dictionary.js +8 -0
- package/lib-module/Notification/index.js +2 -0
- package/lib-module/Pagination/PageButton.js +66 -0
- package/lib-module/Pagination/Pagination.js +153 -0
- package/lib-module/Pagination/SideButton.js +106 -0
- package/lib-module/Pagination/dictionary.js +18 -0
- package/lib-module/Pagination/index.js +2 -0
- package/lib-module/Pagination/usePagination.js +73 -0
- package/lib-module/Progress/Progress.js +89 -0
- package/lib-module/Progress/ProgressBar.js +138 -0
- package/lib-module/Progress/ProgressBarBackground.js +42 -0
- package/lib-module/Progress/index.js +4 -0
- package/lib-module/Radio/Radio.js +285 -0
- package/lib-module/Radio/RadioButton.js +138 -0
- package/lib-module/Radio/RadioGroup.js +243 -0
- package/lib-module/Radio/RadioInput.js +62 -0
- package/lib-module/Radio/RadioInput.native.js +6 -0
- package/lib-module/Radio/index.js +3 -0
- package/lib-module/RadioCard/RadioCard.js +219 -0
- package/lib-module/RadioCard/RadioCardGroup.js +250 -0
- package/lib-module/RadioCard/index.js +3 -0
- package/lib-module/Search/Search.js +261 -0
- package/lib-module/Search/dictionary.js +12 -0
- package/lib-module/Search/index.js +2 -0
- package/lib-module/Select/Group.js +21 -0
- package/lib-module/Select/Group.native.js +15 -0
- package/lib-module/Select/Item.js +20 -0
- package/lib-module/Select/Item.native.js +3 -0
- package/lib-module/Select/Picker.js +68 -0
- package/lib-module/Select/Picker.native.js +120 -0
- package/lib-module/Select/Select.js +337 -0
- package/lib-module/Select/index.js +6 -0
- package/lib-module/SideNav/Item.js +145 -0
- package/lib-module/SideNav/ItemContent.js +48 -0
- package/lib-module/SideNav/ItemsGroup.js +117 -0
- package/lib-module/SideNav/SideNav.js +136 -0
- package/lib-module/SideNav/index.js +1 -0
- package/lib-module/Skeleton/Skeleton.js +179 -0
- package/lib-module/Skeleton/index.js +2 -0
- package/lib-module/Skeleton/skeleton.constant.js +3 -0
- package/lib-module/Skeleton/skeletonWebAnimation.js +18 -0
- package/lib-module/Skeleton/useSkeletonNativeAnimation.js +24 -0
- package/lib-module/Spacer/Spacer.js +98 -0
- package/lib-module/Spacer/index.js +2 -0
- package/lib-module/StackView/StackView.js +125 -0
- package/lib-module/StackView/StackWrap.js +50 -0
- package/lib-module/StackView/StackWrap.native.js +3 -0
- package/lib-module/StackView/StackWrapBox.js +115 -0
- package/lib-module/StackView/StackWrapGap.js +59 -0
- package/lib-module/StackView/common.js +35 -0
- package/lib-module/StackView/getStackedContent.js +124 -0
- package/lib-module/StackView/index.js +5 -0
- package/lib-module/StepTracker/Step.js +248 -0
- package/lib-module/StepTracker/StepTracker.js +185 -0
- package/lib-module/StepTracker/dictionary.js +10 -0
- package/lib-module/StepTracker/index.js +2 -0
- package/lib-module/Tabs/Tabs.js +143 -0
- package/lib-module/Tabs/TabsItem.js +224 -0
- package/lib-module/Tabs/index.js +2 -0
- package/lib-module/Tags/Tags.js +251 -0
- package/lib-module/Tags/index.js +2 -0
- package/lib-module/TextInput/TextArea.js +94 -0
- package/lib-module/TextInput/TextInput.js +72 -0
- package/lib-module/TextInput/TextInputBase.js +245 -0
- package/lib-module/TextInput/index.js +3 -0
- package/lib-module/TextInput/propTypes.js +37 -0
- package/lib-module/ThemeProvider/ThemeProvider.js +36 -0
- package/lib-module/ThemeProvider/index.js +6 -0
- package/lib-module/ThemeProvider/useSetTheme.js +25 -0
- package/lib-module/ThemeProvider/useTheme.js +14 -0
- package/lib-module/ThemeProvider/useThemeTokens.js +110 -0
- package/lib-module/ThemeProvider/utils/index.js +2 -0
- package/lib-module/ThemeProvider/utils/styles.js +181 -0
- package/lib-module/ThemeProvider/utils/theme-tokens.js +163 -0
- package/lib-module/ToggleSwitch/ToggleSwitch.js +250 -0
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +220 -0
- package/lib-module/ToggleSwitch/index.js +3 -0
- package/lib-module/Tooltip/Backdrop.js +45 -0
- package/lib-module/Tooltip/Backdrop.native.js +44 -0
- package/lib-module/Tooltip/Tooltip.js +348 -0
- package/lib-module/Tooltip/dictionary.js +8 -0
- package/lib-module/Tooltip/getTooltipPosition.js +175 -0
- package/lib-module/Tooltip/index.js +2 -0
- package/lib-module/TooltipButton/TooltipButton.js +78 -0
- package/lib-module/TooltipButton/index.js +2 -0
- package/lib-module/Typography/Typography.js +124 -0
- package/lib-module/Typography/index.js +2 -0
- package/lib-module/ViewportProvider/ViewportProvider.js +29 -0
- package/lib-module/ViewportProvider/index.js +3 -0
- package/lib-module/ViewportProvider/useViewport.js +3 -0
- package/lib-module/ViewportProvider/useViewportListener.js +46 -0
- package/lib-module/index.js +48 -0
- package/lib-module/utils/a11y/index.js +2 -0
- package/lib-module/utils/a11y/semantics.js +157 -0
- package/lib-module/utils/a11y/textSize.js +36 -0
- package/lib-module/utils/animation/index.js +2 -0
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +88 -0
- package/lib-module/utils/children.js +119 -0
- package/lib-module/utils/containUniqueFields.js +26 -0
- package/lib-module/utils/index.js +16 -0
- package/lib-module/utils/info/index.js +7 -0
- package/lib-module/utils/info/platform/index.js +11 -0
- package/lib-module/utils/info/platform/platform.android.js +1 -0
- package/lib-module/utils/info/platform/platform.ios.js +1 -0
- package/lib-module/utils/info/platform/platform.js +1 -0
- package/lib-module/utils/info/platform/platform.native.js +4 -0
- package/lib-module/utils/info/versions.js +5 -0
- package/lib-module/utils/input.js +179 -0
- package/lib-module/utils/pressability.js +111 -0
- package/lib-module/utils/props/a11yProps.js +140 -0
- package/lib-module/utils/props/clickProps.js +26 -0
- package/lib-module/utils/props/componentPropType.js +63 -0
- package/lib-module/utils/props/copyPropTypes.js +2 -0
- package/lib-module/utils/props/getPropSelector.js +9 -0
- package/lib-module/utils/props/handlerProps.js +65 -0
- package/lib-module/utils/props/hrefAttrsProp.js +33 -0
- package/lib-module/utils/props/index.js +19 -0
- package/lib-module/utils/props/inputSupportsProps.js +62 -0
- package/lib-module/utils/props/linkProps.js +44 -0
- package/lib-module/utils/props/paddingProp.js +9 -0
- package/lib-module/utils/props/pressProps.js +42 -0
- package/lib-module/utils/props/rectProp.js +9 -0
- package/lib-module/utils/props/responsiveProps.js +30 -0
- package/lib-module/utils/props/selectSystemProps.js +24 -0
- package/lib-module/utils/props/spacingProps.js +56 -0
- package/lib-module/utils/props/textInputProps.js +194 -0
- package/lib-module/utils/props/textProps.js +59 -0
- package/lib-module/utils/props/tokens.js +133 -0
- package/lib-module/utils/props/variantProp.js +18 -0
- package/lib-module/utils/props/viewProps.js +22 -0
- package/lib-module/utils/ssr.js +38 -0
- package/lib-module/utils/useCopy.js +44 -0
- package/lib-module/utils/useHash.js +45 -0
- package/lib-module/utils/useHash.native.js +7 -0
- package/lib-module/utils/useResponsiveProp.js +47 -0
- package/lib-module/utils/useSpacingScale.js +125 -0
- package/lib-module/utils/useUniqueId.js +13 -0
- package/lib-module/utils/withLinkRouter.js +83 -0
- package/package.json +3 -2
- package/src/Checkbox/Checkbox.jsx +3 -1
- package/src/ExpandCollapse/Panel.jsx +2 -19
- package/src/Link/InlinePressable.jsx +5 -2
- package/src/Link/LinkBase.jsx +4 -1
- package/src/List/List.jsx +34 -19
- package/src/List/ListItem.jsx +12 -2
- package/src/Modal/Modal.jsx +2 -1
- package/src/Tabs/Tabs.jsx +24 -2
- package/src/Tabs/TabsItem.jsx +6 -5
- package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue,
|
|
3
|
+
This log was last generated on Tue, 28 Jun 2022 21:35:29 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.8.5
|
|
8
|
+
|
|
9
|
+
Tue, 28 Jun 2022 21:35:29 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- fix: add forcing inline display on links without icons (ruslan.bredikhin@nearform.com)
|
|
14
|
+
- fix: move testID to the icon container (ruslan.bredikhin@nearform.com)
|
|
15
|
+
|
|
16
|
+
## 1.8.4
|
|
17
|
+
|
|
18
|
+
Wed, 22 Jun 2022 15:03:54 GMT
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- fix published lib-modules (cody.zuschlag@nearform.com)
|
|
23
|
+
- don't override List.Item props with less-specific List props (alan.slater@nearform.com)
|
|
24
|
+
- better tabs roles for tablist/navigation usage (simon.lawrence@nearform.com)
|
|
25
|
+
- better ExpandCollapse style timing (alan.slater@nearform.com)
|
|
26
|
+
- Bump @telus-uds/browserslist-config to v1.0.4
|
|
27
|
+
|
|
28
|
+
## 1.8.3
|
|
29
|
+
|
|
30
|
+
Wed, 15 Jun 2022 19:23:57 GMT
|
|
31
|
+
|
|
32
|
+
### Patches
|
|
33
|
+
|
|
34
|
+
- fix List.Item crash on Android (alan.slater@nearform.com)
|
|
35
|
+
- fix modal close button zIndex (eugene@michasiw.com)
|
|
36
|
+
- Bump @telus-uds/browserslist-config to v1.0.3
|
|
37
|
+
|
|
7
38
|
## 1.8.2
|
|
8
39
|
|
|
9
|
-
Tue, 14 Jun 2022 15:
|
|
40
|
+
Tue, 14 Jun 2022 15:27:31 GMT
|
|
10
41
|
|
|
11
42
|
### Patches
|
|
12
43
|
|
package/component-docs.json
CHANGED
|
@@ -4314,6 +4314,13 @@
|
|
|
4314
4314
|
"docs": {
|
|
4315
4315
|
"description": "An unordered List component has a child a ListItem that\nallows icon, dividers and customized typography",
|
|
4316
4316
|
"props": {
|
|
4317
|
+
"accessibilityRole": {
|
|
4318
|
+
"defaultValue": {
|
|
4319
|
+
"value": "Platform.select({ web: 'list', default: undefined })",
|
|
4320
|
+
"computed": true
|
|
4321
|
+
},
|
|
4322
|
+
"required": false
|
|
4323
|
+
},
|
|
4317
4324
|
"tokens": {
|
|
4318
4325
|
"type": {
|
|
4319
4326
|
"name": "custom",
|
|
@@ -4385,6 +4392,13 @@
|
|
|
4385
4392
|
"docs": {
|
|
4386
4393
|
"description": "ListItem is responsible for rendering icon or a bullet as side item",
|
|
4387
4394
|
"props": {
|
|
4395
|
+
"accessibilityRole": {
|
|
4396
|
+
"defaultValue": {
|
|
4397
|
+
"value": "Platform.select({ web: 'listitem', default: undefined })",
|
|
4398
|
+
"computed": true
|
|
4399
|
+
},
|
|
4400
|
+
"required": false
|
|
4401
|
+
},
|
|
4388
4402
|
"tokens": {
|
|
4389
4403
|
"type": {
|
|
4390
4404
|
"name": "custom",
|
|
@@ -4471,6 +4485,13 @@
|
|
|
4471
4485
|
"docs": {
|
|
4472
4486
|
"description": "An unordered List component has a child a ListItem that\nallows icon, dividers and customized typography",
|
|
4473
4487
|
"props": {
|
|
4488
|
+
"accessibilityRole": {
|
|
4489
|
+
"defaultValue": {
|
|
4490
|
+
"value": "Platform.select({ web: 'list', default: undefined })",
|
|
4491
|
+
"computed": true
|
|
4492
|
+
},
|
|
4493
|
+
"required": false
|
|
4494
|
+
},
|
|
4474
4495
|
"tokens": {
|
|
4475
4496
|
"type": {
|
|
4476
4497
|
"name": "custom",
|
|
@@ -4542,6 +4563,13 @@
|
|
|
4542
4563
|
"docs": {
|
|
4543
4564
|
"description": "ListItem is responsible for rendering icon or a bullet as side item",
|
|
4544
4565
|
"props": {
|
|
4566
|
+
"accessibilityRole": {
|
|
4567
|
+
"defaultValue": {
|
|
4568
|
+
"value": "Platform.select({ web: 'listitem', default: undefined })",
|
|
4569
|
+
"computed": true
|
|
4570
|
+
},
|
|
4571
|
+
"required": false
|
|
4572
|
+
},
|
|
4545
4573
|
"tokens": {
|
|
4546
4574
|
"type": {
|
|
4547
4575
|
"name": "custom",
|
|
@@ -4628,6 +4656,13 @@
|
|
|
4628
4656
|
"docs": {
|
|
4629
4657
|
"description": "ListItem is responsible for rendering icon or a bullet as side item",
|
|
4630
4658
|
"props": {
|
|
4659
|
+
"accessibilityRole": {
|
|
4660
|
+
"defaultValue": {
|
|
4661
|
+
"value": "Platform.select({ web: 'listitem', default: undefined })",
|
|
4662
|
+
"computed": true
|
|
4663
|
+
},
|
|
4664
|
+
"required": false
|
|
4665
|
+
},
|
|
4631
4666
|
"tokens": {
|
|
4632
4667
|
"type": {
|
|
4633
4668
|
"name": "custom",
|
|
@@ -7008,7 +7043,7 @@
|
|
|
7008
7043
|
},
|
|
7009
7044
|
"Tabs": {
|
|
7010
7045
|
"docs": {
|
|
7011
|
-
"description": "Tabs renders a horizontally-scrolling menu of selectable buttons which may link\nto a page or control what content is displayed on this page.",
|
|
7046
|
+
"description": "Tabs renders a horizontally-scrolling menu of selectable buttons which may link\nto a page or control what content is displayed on this page.\n\nIf you are using Tabs to navigate to a new page (web-only) you should pass\n`navigation`as the `accessibilityRole` to te Tabs component, this will cause\nTabItems to default to a role of link and obtain aria-current behaviour.",
|
|
7012
7047
|
"props": {
|
|
7013
7048
|
"items": {
|
|
7014
7049
|
"defaultValue": {
|
|
@@ -23,14 +23,14 @@ const MIN_SVG_LENGTH = _shared.MIN_STROKE_ANGLE / 360 * SVG_CIRCUMFERENCE;
|
|
|
23
23
|
const MAX_SVG_LENGTH = (1 - _shared.MIN_EMPTY_ANGLE / 360) * SVG_CIRCUMFERENCE;
|
|
24
24
|
const animationProps = {
|
|
25
25
|
begin: '0s',
|
|
26
|
-
dur:
|
|
26
|
+
dur: "".concat(_shared.DURATION, "ms"),
|
|
27
27
|
fill: 'freeze',
|
|
28
28
|
repeatCount: 'indefinite'
|
|
29
29
|
};
|
|
30
30
|
const bezierProps = {
|
|
31
31
|
calcMode: 'spline',
|
|
32
32
|
keyTimes: '0; 0.5; 1',
|
|
33
|
-
keySplines:
|
|
33
|
+
keySplines: "".concat(_shared.BEZIER.join(', '), " ; ").concat(_shared.BEZIER.join(', '))
|
|
34
34
|
}; // We're using svg rather than css here to define the animation to avoid needing to introduce css injection mechanism
|
|
35
35
|
// It's possible to replicate this functionality with RNW animations, but it snags on chrome at least, see https://github.com/telus/universal-design-system/pull/477 for details.
|
|
36
36
|
|
|
@@ -46,8 +46,8 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
46
46
|
} = (0, _A11yInfoProvider.useA11yInfo)();
|
|
47
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
48
48
|
ref: ref,
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
49
|
+
width: "".concat(size, "px"),
|
|
50
|
+
height: "".concat(size, "px"),
|
|
51
51
|
viewBox: "0 0 48 48",
|
|
52
52
|
"aria-valuetext": label,
|
|
53
53
|
role: "progressbar",
|
|
@@ -56,7 +56,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
56
56
|
children: [reduceMotionEnabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)("animateTransform", {
|
|
57
57
|
attributeName: "transform",
|
|
58
58
|
type: "rotate",
|
|
59
|
-
values:
|
|
59
|
+
values: "-180 24 24;".concat(360 + _shared.MIN_STROKE_ANGLE - 180, " 24 24"),
|
|
60
60
|
...animationProps
|
|
61
61
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
|
|
62
62
|
fill: "none",
|
|
@@ -71,12 +71,12 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
71
71
|
children: reduceMotionEnabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
72
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
|
|
73
73
|
attributeName: "stroke-dashoffset",
|
|
74
|
-
values:
|
|
74
|
+
values: "0;-10;".concat(MIN_SVG_LENGTH - SVG_CIRCUMFERENCE),
|
|
75
75
|
...animationProps,
|
|
76
76
|
...bezierProps
|
|
77
77
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
|
|
78
78
|
attributeName: "stroke-dasharray",
|
|
79
|
-
values:
|
|
79
|
+
values: "".concat(MIN_SVG_LENGTH, ", 200;").concat(MAX_SVG_LENGTH, ", 200;").concat(MIN_SVG_LENGTH, ", 200"),
|
|
80
80
|
...animationProps,
|
|
81
81
|
...bezierProps
|
|
82
82
|
})]
|
|
@@ -95,7 +95,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
const direction = index ? -1 : +1;
|
|
98
|
-
return
|
|
98
|
+
return "".concat(direction * (180 - (sa + ea)) * easing(progress) + rotation, "deg");
|
|
99
99
|
});
|
|
100
100
|
const layerStyle = {
|
|
101
101
|
width: size,
|
|
@@ -110,7 +110,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
110
110
|
layerStyle.transform = [{
|
|
111
111
|
rotate: timer.interpolate({
|
|
112
112
|
inputRange: [0, 1],
|
|
113
|
-
outputRange: [
|
|
113
|
+
outputRange: ["".concat(0 + ea + sa, "deg"), "".concat(2 * 360 + ea + sa, "deg")]
|
|
114
114
|
})
|
|
115
115
|
}];
|
|
116
116
|
viewportStyle.transform = [{
|
package/lib/Button/ButtonBase.js
CHANGED
|
@@ -98,7 +98,7 @@ const selectOuterWidthStyles = _ref3 => {
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
if (_Platform.default.OS === 'web') {
|
|
101
|
-
widthStyles.width =
|
|
101
|
+
widthStyles.width = "calc(".concat(width, " + ").concat(outerBorderOffset * 2, "px)");
|
|
102
102
|
return widthStyles;
|
|
103
103
|
} // Can't use calc() on native but (unlike on web) flexGrow fills the container width here
|
|
104
104
|
|
|
@@ -180,7 +180,7 @@ const selectWebOnlyStyles = (inactive, themeTokens, _ref7) => {
|
|
|
180
180
|
return _Platform.default.select({
|
|
181
181
|
web: {
|
|
182
182
|
// if it would overflow the container, wraps instead
|
|
183
|
-
maxWidth:
|
|
183
|
+
maxWidth: "calc(100% + ".concat(getOuterBorderOffset(themeTokens) * 2, "px)"),
|
|
184
184
|
outline: 'none',
|
|
185
185
|
// removes the default browser :focus outline
|
|
186
186
|
...(0, _utils2.getCursorStyle)(inactive, accessibilityRole)
|
|
@@ -91,7 +91,7 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
91
91
|
const uniqueFields = ['id', 'label'];
|
|
92
92
|
|
|
93
93
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
94
|
-
throw new Error(
|
|
94
|
+
throw new Error("ButtonGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
95
95
|
} // Some web screenreaders e.g. MacOS Voiceover don't handle radiogroups properly unless radio is direct child of radiogroup
|
|
96
96
|
|
|
97
97
|
|
package/lib/Checkbox/Checkbox.js
CHANGED
|
@@ -214,7 +214,7 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
const uniqueId = (0, _useUniqueId.default)('checkbox');
|
|
217
|
-
const inputId = id
|
|
217
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
218
218
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
219
219
|
style: staticStyles.wrapper,
|
|
220
220
|
ref: ref,
|
|
@@ -265,8 +265,10 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
265
265
|
isControlled: isControlled,
|
|
266
266
|
name: name,
|
|
267
267
|
value: value
|
|
268
|
-
}), isChecked && IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
269
|
-
testID: "Checkbox-Icon"
|
|
268
|
+
}), isChecked && IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
269
|
+
testID: "Checkbox-Icon",
|
|
270
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, { ...iconTokens
|
|
271
|
+
})
|
|
270
272
|
})]
|
|
271
273
|
})
|
|
272
274
|
}), Boolean(label) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
@@ -119,7 +119,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
119
119
|
const uniqueFields = ['id', 'label'];
|
|
120
120
|
|
|
121
121
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
122
|
-
throw new Error(
|
|
122
|
+
throw new Error("CheckboxGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
const checkboxes = items.map((_ref2, index) => {
|
|
@@ -130,7 +130,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
130
130
|
ref: itemRef,
|
|
131
131
|
...itemRest
|
|
132
132
|
} = _ref2;
|
|
133
|
-
const checkboxId = id ||
|
|
133
|
+
const checkboxId = id || "Checkbox[".concat(index, "]");
|
|
134
134
|
|
|
135
135
|
const handleChange = (newCheckedState, event) => {
|
|
136
136
|
if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
|
package/lib/Divider/Divider.js
CHANGED
|
@@ -116,9 +116,9 @@ const Divider = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
116
116
|
};
|
|
117
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
118
118
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
|
|
119
|
-
testID: testID ?
|
|
119
|
+
testID: testID ? "".concat(testID, "-Spacer-before") : undefined
|
|
120
120
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
|
|
121
|
-
testID: testID ?
|
|
121
|
+
testID: testID ? "".concat(testID, "-Spacer-after") : undefined
|
|
122
122
|
})]
|
|
123
123
|
});
|
|
124
124
|
});
|
|
@@ -11,8 +11,6 @@ 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
14
|
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
17
15
|
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -105,13 +103,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
105
103
|
containerHeight,
|
|
106
104
|
isExpanded,
|
|
107
105
|
tokens: themeTokens
|
|
108
|
-
});
|
|
109
|
-
// this won't work on native platforms
|
|
110
|
-
|
|
111
|
-
const overflowContainerStyles = containerHeight === null && _Platform.default.OS === 'web' ? {
|
|
112
|
-
height: 0,
|
|
113
|
-
visibility: 'hidden'
|
|
114
|
-
} : undefined;
|
|
106
|
+
});
|
|
115
107
|
const focusabilityProps = isExpanded ? {} : _utils.a11yProps.nonFocusableProps;
|
|
116
108
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
117
109
|
ref: ref,
|
|
@@ -123,7 +115,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
123
115
|
children: control
|
|
124
116
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
125
117
|
ref: animatedRef,
|
|
126
|
-
style:
|
|
118
|
+
style: animatedStyles,
|
|
127
119
|
...focusabilityProps,
|
|
128
120
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
129
121
|
onLayout: onContainerLayout,
|
|
@@ -177,12 +169,5 @@ ExpandCollapsePanel.propTypes = { ...selectedSystemPropTypes,
|
|
|
177
169
|
*/
|
|
178
170
|
controlTokens: (0, _utils.getTokensPropType)('ExpandCollapseControl')
|
|
179
171
|
};
|
|
180
|
-
|
|
181
|
-
const staticStyles = _StyleSheet.default.create({
|
|
182
|
-
itemsContainer: {
|
|
183
|
-
overflow: 'hidden'
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
172
|
var _default = ExpandCollapsePanel;
|
|
188
173
|
exports.default = _default;
|
package/lib/FlexGrid/Col/Col.js
CHANGED
|
@@ -69,7 +69,7 @@ const Col = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
69
69
|
const horizontalAlignLevel = getHorizontalAlignLevel();
|
|
70
70
|
|
|
71
71
|
const toPercent = num => {
|
|
72
|
-
return
|
|
72
|
+
return "".concat(num / 12 * 100, "%");
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const calculateWidth = value => {
|
package/lib/Icon/Icon.js
CHANGED
|
@@ -48,7 +48,7 @@ const Icon = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
48
48
|
// TODO: systematise animations.
|
|
49
49
|
// https://github.com/telus/universal-design-system/issues/487
|
|
50
50
|
transition: 'transform 200ms, color 200ms',
|
|
51
|
-
transform: [themeTokens.scale ?
|
|
51
|
+
transform: [themeTokens.scale ? "scale(".concat(themeTokens.scale, ")") : '', themeTokens.translateX ? "translateX(".concat(themeTokens.translateX, "px)") : '', themeTokens.translateY ? "translateY(".concat(themeTokens.translateY, "px)") : ''].filter(exists => exists).join(' ')
|
|
52
52
|
},
|
|
53
53
|
dataSet: dataSet,
|
|
54
54
|
children: iconContent
|
|
@@ -37,11 +37,12 @@ const InlinePressable = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
37
37
|
let {
|
|
38
38
|
children,
|
|
39
39
|
style,
|
|
40
|
+
inline = false,
|
|
40
41
|
...props
|
|
41
42
|
} = _ref;
|
|
42
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
43
44
|
ref: ref,
|
|
44
|
-
style: pressState => [staticStyles
|
|
45
|
+
style: pressState => [staticStyles[inline ? 'inline' : 'inlineFlex'], typeof style === 'function' ? style(pressState) : style],
|
|
45
46
|
...props,
|
|
46
47
|
children: pressState => typeof children === 'function' ? children(pressState) : children
|
|
47
48
|
});
|
|
@@ -51,6 +52,9 @@ InlinePressable.displayName = 'InlinePressable';
|
|
|
51
52
|
const staticStyles = _StyleSheet.default.create({
|
|
52
53
|
inline: {
|
|
53
54
|
// Stop Pressable defaulting to (block) flex
|
|
55
|
+
display: 'inline'
|
|
56
|
+
},
|
|
57
|
+
inlineFlex: {
|
|
54
58
|
display: 'inline-flex'
|
|
55
59
|
}
|
|
56
60
|
});
|
package/lib/Link/LinkBase.js
CHANGED
|
@@ -186,17 +186,20 @@ const LinkBase = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
186
186
|
|
|
187
187
|
const resolveLinkTokens = pressState => (0, _pressability.resolvePressableTokens)(tokens, pressState, {
|
|
188
188
|
iconPosition
|
|
189
|
-
});
|
|
189
|
+
});
|
|
190
190
|
|
|
191
|
+
const defaultThemeTokens = resolveLinkTokens({});
|
|
192
|
+
const hasIcon = Boolean(icon || defaultThemeTokens.icon); // On web, this makes focus rings wrap only the link, not the entire block
|
|
191
193
|
|
|
192
194
|
const blockLeftStyle = _Platform.default.OS === 'web' && staticStyles.blockLeft;
|
|
193
195
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InlinePressable.default, { ...selectedProps,
|
|
196
|
+
inline: hasIcon // assuming links without icons should be inline (even if they are long)
|
|
197
|
+
,
|
|
194
198
|
ref: ref,
|
|
195
199
|
style: linkState => {
|
|
196
200
|
const themeTokens = resolveLinkTokens(linkState);
|
|
197
201
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens);
|
|
198
202
|
const decorationStyles = selectDecorationStyles(themeTokens);
|
|
199
|
-
const hasIcon = Boolean(icon || themeTokens.icon);
|
|
200
203
|
return [outerBorderStyles, blockLeftStyle, decorationStyles, hasIcon && staticStyles.rowContainer];
|
|
201
204
|
},
|
|
202
205
|
children: linkState => {
|
package/lib/List/List.js
CHANGED
|
@@ -37,21 +37,26 @@ const List = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
37
37
|
showDivider,
|
|
38
38
|
tokens,
|
|
39
39
|
variant,
|
|
40
|
+
accessibilityRole = _Platform.default.select({
|
|
41
|
+
web: 'list',
|
|
42
|
+
default: undefined
|
|
43
|
+
}),
|
|
40
44
|
...rest
|
|
41
45
|
} = _ref;
|
|
42
46
|
|
|
43
|
-
const accessibilityRole = _Platform.default.select({
|
|
44
|
-
web: 'list',
|
|
45
|
-
default: 'none'
|
|
46
|
-
});
|
|
47
|
-
|
|
48
47
|
const items = _react.Children.map(children, (child, index) => {
|
|
49
|
-
|
|
48
|
+
var _child$type, _child$type2;
|
|
49
|
+
|
|
50
|
+
// Pass ListItem-specific props to children (by name so teams can add their own ListItems)
|
|
51
|
+
const isListItem = componentName => Boolean(componentName === _ListItem.default.displayName);
|
|
52
|
+
|
|
53
|
+
if (isListItem(child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) || isListItem(child === null || child === void 0 ? void 0 : (_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.name)) {
|
|
50
54
|
return /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
51
55
|
showDivider,
|
|
52
56
|
isLastItem: index + 1 === _react.Children.count(children),
|
|
53
57
|
tokens,
|
|
54
|
-
variant
|
|
58
|
+
variant,
|
|
59
|
+
...child.props
|
|
55
60
|
});
|
|
56
61
|
}
|
|
57
62
|
|
package/lib/List/ListItem.js
CHANGED
|
@@ -139,6 +139,10 @@ const ListItem = /*#__PURE__*/(0, _react.forwardRef)((_ref9, ref) => {
|
|
|
139
139
|
showDivider,
|
|
140
140
|
children,
|
|
141
141
|
isLastItem,
|
|
142
|
+
accessibilityRole = _Platform.default.select({
|
|
143
|
+
web: 'listitem',
|
|
144
|
+
default: undefined
|
|
145
|
+
}),
|
|
142
146
|
...rest
|
|
143
147
|
} = _ref9;
|
|
144
148
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('List', tokens, variant);
|
|
@@ -151,11 +155,6 @@ const ListItem = /*#__PURE__*/(0, _react.forwardRef)((_ref9, ref) => {
|
|
|
151
155
|
const iconTokens = selectItemIconTokens(themeTokens);
|
|
152
156
|
const sideItemContainerStyles = selectSideItemContainerStyles(themeTokens);
|
|
153
157
|
|
|
154
|
-
const accessibilityRole = _Platform.default.select({
|
|
155
|
-
web: 'listitem',
|
|
156
|
-
default: 'item'
|
|
157
|
-
});
|
|
158
|
-
|
|
159
158
|
const renderItem = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
160
159
|
style: staticStyles.wrap,
|
|
161
160
|
children: (0, _utils.wrapStringsInText)(children, {
|
package/lib/Modal/Modal.js
CHANGED
|
@@ -54,8 +54,8 @@ const PageButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
54
54
|
key: 'active-item'
|
|
55
55
|
} : {};
|
|
56
56
|
const accessibilityRole = href !== undefined ? 'link' : 'button';
|
|
57
|
-
const activeLabel = isActive ?
|
|
58
|
-
const accessibilityLabel =
|
|
57
|
+
const activeLabel = isActive ? " ".concat(getCopy('currentLabel')) : '';
|
|
58
|
+
const accessibilityLabel = "".concat(getCopy('goToLabel'), " ").concat(label).concat(activeLabel);
|
|
59
59
|
|
|
60
60
|
const {
|
|
61
61
|
hrefAttrs,
|
|
@@ -106,9 +106,11 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
106
106
|
LinkRouter: LinkRouter,
|
|
107
107
|
linkRouterProps: linkRouterProps
|
|
108
108
|
}), ...items.map((_child, itemIndex) => {
|
|
109
|
-
|
|
109
|
+
var _itemProps$LinkRouter;
|
|
110
|
+
|
|
111
|
+
const buttonLabel = "".concat(itemIndex + 1);
|
|
110
112
|
const itemProps = getItemProps(itemIndex);
|
|
111
|
-
const ItemLinkRouter = itemProps.LinkRouter
|
|
113
|
+
const ItemLinkRouter = (_itemProps$LinkRouter = itemProps.LinkRouter) !== null && _itemProps$LinkRouter !== void 0 ? _itemProps$LinkRouter : LinkRouter;
|
|
112
114
|
const itemLinkRouterProps = { ...linkRouterProps,
|
|
113
115
|
...itemProps.linkRouterProps
|
|
114
116
|
};
|
|
@@ -144,7 +146,7 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
144
146
|
ref: ref,
|
|
145
147
|
...selectProps(rest),
|
|
146
148
|
children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
|
|
147
|
-
.map((element, index) => [element,
|
|
149
|
+
.map((element, index) => [element, "page-".concat(index + 1)]).filter(_ref3 => {
|
|
148
150
|
let [element] = _ref3;
|
|
149
151
|
return element !== null;
|
|
150
152
|
}).map(_ref4 => {
|
|
@@ -21,7 +21,7 @@ function usePagination(_ref) {
|
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
const getItemProps = index => {
|
|
24
|
-
var _items$index;
|
|
24
|
+
var _items$index$props, _items$index;
|
|
25
25
|
|
|
26
26
|
const {
|
|
27
27
|
onPress,
|
|
@@ -29,7 +29,7 @@ function usePagination(_ref) {
|
|
|
29
29
|
hrefAttrs,
|
|
30
30
|
variant,
|
|
31
31
|
tokens
|
|
32
|
-
} = ((_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props)
|
|
32
|
+
} = (_items$index$props = (_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) !== null && _items$index$props !== void 0 ? _items$index$props : {};
|
|
33
33
|
return {
|
|
34
34
|
onPress,
|
|
35
35
|
href,
|
|
@@ -43,7 +43,7 @@ const selectBarStyles = (_ref, percentage) => {
|
|
|
43
43
|
borderRadius,
|
|
44
44
|
outlineWidth,
|
|
45
45
|
outlineColor,
|
|
46
|
-
width:
|
|
46
|
+
width: "".concat(percentage, "%")
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
@@ -104,7 +104,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
104
104
|
min: 0,
|
|
105
105
|
max: 100,
|
|
106
106
|
now: percentage,
|
|
107
|
-
text:
|
|
107
|
+
text: "".concat(percentage, "%")
|
|
108
108
|
},
|
|
109
109
|
...rest
|
|
110
110
|
});
|
|
@@ -112,7 +112,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
112
112
|
ref: ref,
|
|
113
113
|
style: [staticStyles.bar, selectBarStyles(themeTokens, percentage)],
|
|
114
114
|
...selectedProps,
|
|
115
|
-
children: children
|
|
115
|
+
children: children !== null && children !== void 0 ? children : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarBackground.default, {
|
|
116
116
|
variant: variant
|
|
117
117
|
})
|
|
118
118
|
}) : null;
|
|
@@ -21,8 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
const inactiveBackground =
|
|
25
|
-
const negativeBackground =
|
|
24
|
+
const inactiveBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='DisabledProgress7' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23B2B9BF'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23DisabledProgress7");'%3E%3C/path%3E%3C/svg%3E";
|
|
25
|
+
const negativeBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='NegativeProgress6' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23C12335'%3E%3C/rect%3E%3Cpath d='M 0,8 l 8,-8 M -2,2 l 4,-4 M 6,10 l 4,-4' stroke-width='2' shape-rendering='auto' stroke='%23e7adb4' stroke-linecap='square'%3E%3C/path%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23NegativeProgress6");'%3E%3C/path%3E%3C/svg%3E";
|
|
26
26
|
const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
27
27
|
let {
|
|
28
28
|
variant
|
|
@@ -40,7 +40,7 @@ const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) =>
|
|
|
40
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageBackground.default, {
|
|
41
41
|
ref: ref,
|
|
42
42
|
source: {
|
|
43
|
-
uri:
|
|
43
|
+
uri: "data:image/svg+xml,".concat(source)
|
|
44
44
|
},
|
|
45
45
|
style: staticStyles.imageBackground
|
|
46
46
|
});
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -70,7 +70,7 @@ const selectDescriptionStyles = _ref2 => {
|
|
|
70
70
|
labelMarginLeft = 0
|
|
71
71
|
} = _ref2;
|
|
72
72
|
return {
|
|
73
|
-
marginLeft: descriptionMarginLeft
|
|
73
|
+
marginLeft: descriptionMarginLeft !== null && descriptionMarginLeft !== void 0 ? descriptionMarginLeft : containerPaddingLeft + inputSize + labelMarginLeft,
|
|
74
74
|
...(0, _ThemeProvider.applyTextStyles)({
|
|
75
75
|
fontSize: descriptionFontSize,
|
|
76
76
|
lineHeight: descriptionLineHeight
|
|
@@ -174,7 +174,7 @@ const Radio = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
const uniqueId = (0, _utils.useUniqueId)('radio');
|
|
177
|
-
const inputId = id
|
|
177
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
178
178
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
179
179
|
ref: ref,
|
|
180
180
|
disabled: inactive,
|
package/lib/Radio/RadioGroup.js
CHANGED
|
@@ -121,7 +121,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
121
121
|
const uniqueFields = ['id', 'label'];
|
|
122
122
|
|
|
123
123
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
124
|
-
throw new Error(
|
|
124
|
+
throw new Error("RadioGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const radios = items.map((_ref2, index) => {
|
|
@@ -132,7 +132,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
132
132
|
ref: itemRef,
|
|
133
133
|
...itemRest
|
|
134
134
|
} = _ref2;
|
|
135
|
-
const radioId = id ||
|
|
135
|
+
const radioId = id || "Radio[".concat(index, "]");
|
|
136
136
|
const isChecked = currentValue === radioId;
|
|
137
137
|
|
|
138
138
|
const handleChange = (newCheckedState, event) => {
|
|
@@ -102,7 +102,7 @@ const RadioCard = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
const uniqueId = (0, _utils.useUniqueId)('RadioCard');
|
|
105
|
-
const inputId = id
|
|
105
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
106
106
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('RadioCard', tokens, variant);
|
|
107
107
|
|
|
108
108
|
const getCardTokens = cardState => (0, _Card.selectPressableCardTokens)(getTokens(cardState));
|
|
@@ -126,7 +126,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
126
126
|
const uniqueFields = ['id'];
|
|
127
127
|
|
|
128
128
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
129
|
-
throw new Error(
|
|
129
|
+
throw new Error("RadioCardGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
|
|
@@ -153,7 +153,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
153
153
|
onChange: itemOnChange,
|
|
154
154
|
...itemRest
|
|
155
155
|
} = _ref2;
|
|
156
|
-
const cardId = id ||
|
|
156
|
+
const cardId = id || "RadioCard[".concat(index, "]");
|
|
157
157
|
|
|
158
158
|
const handleChange = (newCheckedState, event) => {
|
|
159
159
|
if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
|