@telus-uds/components-base 1.8.3 → 1.9.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 +37 -2
- package/component-docs.json +17 -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/Card/Card.js +9 -4
- 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 +12 -18
- 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 +8 -2
- 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/TextInput/TextInput.js +0 -11
- package/lib/TextInput/TextInputBase.js +9 -0
- package/lib/TextInput/propTypes.js +3 -8
- 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/textInputProps.js +8 -1
- 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 +85 -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 +159 -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 +64 -0
- package/lib-module/TextInput/TextInputBase.js +254 -0
- package/lib-module/TextInput/index.js +3 -0
- package/lib-module/TextInput/propTypes.js +33 -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 +201 -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 -3
- package/src/Card/Card.jsx +6 -4
- package/src/Checkbox/Checkbox.jsx +3 -1
- package/src/ExpandCollapse/Panel.jsx +10 -20
- package/src/Link/InlinePressable.jsx +5 -2
- package/src/Link/LinkBase.jsx +4 -1
- package/src/List/List.jsx +6 -2
- package/src/Tabs/Tabs.jsx +24 -2
- package/src/Tabs/TabsItem.jsx +6 -5
- package/src/TextInput/TextInput.jsx +1 -8
- package/src/TextInput/TextInputBase.jsx +11 -1
- package/src/TextInput/propTypes.js +3 -7
- package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
- package/src/utils/props/textInputProps.js +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 08 Jul 2022 22:41:05 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.9.0
|
|
8
|
+
|
|
9
|
+
Fri, 08 Jul 2022 22:41:05 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- feat: add a controlRef prop to ExpandCollapse.Panel (ruslan.bredikhin@nearform.com)
|
|
14
|
+
|
|
15
|
+
### Patches
|
|
16
|
+
|
|
17
|
+
- don't throw if pattern used without ref (alan.slater@nearform.com)
|
|
18
|
+
- Add forwardRef to Card (alan.slater@nearform.com)
|
|
19
|
+
- Support pattern in all text input components (alan.slater@nearform.com)
|
|
20
|
+
|
|
21
|
+
## 1.8.5
|
|
22
|
+
|
|
23
|
+
Tue, 28 Jun 2022 21:36:14 GMT
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- fix: add forcing inline display on links without icons (ruslan.bredikhin@nearform.com)
|
|
28
|
+
- fix: move testID to the icon container (ruslan.bredikhin@nearform.com)
|
|
29
|
+
|
|
30
|
+
## 1.8.4
|
|
31
|
+
|
|
32
|
+
Wed, 22 Jun 2022 15:03:54 GMT
|
|
33
|
+
|
|
34
|
+
### Patches
|
|
35
|
+
|
|
36
|
+
- fix published lib-modules (cody.zuschlag@nearform.com)
|
|
37
|
+
- don't override List.Item props with less-specific List props (alan.slater@nearform.com)
|
|
38
|
+
- better tabs roles for tablist/navigation usage (simon.lawrence@nearform.com)
|
|
39
|
+
- better ExpandCollapse style timing (alan.slater@nearform.com)
|
|
40
|
+
- Bump @telus-uds/browserslist-config to v1.0.4
|
|
41
|
+
|
|
7
42
|
## 1.8.3
|
|
8
43
|
|
|
9
|
-
Wed, 15 Jun 2022 19:23:
|
|
44
|
+
Wed, 15 Jun 2022 19:23:57 GMT
|
|
10
45
|
|
|
11
46
|
### Patches
|
|
12
47
|
|
package/component-docs.json
CHANGED
|
@@ -1810,6 +1810,14 @@
|
|
|
1810
1810
|
},
|
|
1811
1811
|
"required": false,
|
|
1812
1812
|
"description": "Optional theme token overrides that may be passed to the ExpandCollapseControl element."
|
|
1813
|
+
},
|
|
1814
|
+
"controlRef": {
|
|
1815
|
+
"type": {
|
|
1816
|
+
"name": "custom",
|
|
1817
|
+
"raw": "ABBPropTypes.ref()"
|
|
1818
|
+
},
|
|
1819
|
+
"required": false,
|
|
1820
|
+
"description": "An optional ref to be attached to the control"
|
|
1813
1821
|
}
|
|
1814
1822
|
},
|
|
1815
1823
|
"attributes": {
|
|
@@ -2694,6 +2702,14 @@
|
|
|
2694
2702
|
},
|
|
2695
2703
|
"required": false,
|
|
2696
2704
|
"description": "Optional theme token overrides that may be passed to the ExpandCollapseControl element."
|
|
2705
|
+
},
|
|
2706
|
+
"controlRef": {
|
|
2707
|
+
"type": {
|
|
2708
|
+
"name": "custom",
|
|
2709
|
+
"raw": "ABBPropTypes.ref()"
|
|
2710
|
+
},
|
|
2711
|
+
"required": false,
|
|
2712
|
+
"description": "An optional ref to be attached to the control"
|
|
2697
2713
|
}
|
|
2698
2714
|
},
|
|
2699
2715
|
"attributes": {
|
|
@@ -7043,7 +7059,7 @@
|
|
|
7043
7059
|
},
|
|
7044
7060
|
"Tabs": {
|
|
7045
7061
|
"docs": {
|
|
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.",
|
|
7062
|
+
"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.",
|
|
7047
7063
|
"props": {
|
|
7048
7064
|
"items": {
|
|
7049
7065
|
"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/Card/Card.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -23,6 +23,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
26
30
|
const [selectProps, selectedSystemPropTypes] = (0, _props.selectSystemProps)([_props.a11yProps, _props.viewProps]);
|
|
27
31
|
/**
|
|
28
32
|
* A basic card component, unstyled by default.
|
|
@@ -73,7 +77,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _props.selectSystemProps)([_p
|
|
|
73
77
|
* depending on what you are trying to achieve.
|
|
74
78
|
*/
|
|
75
79
|
|
|
76
|
-
const Card = _ref => {
|
|
80
|
+
const Card = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
77
81
|
let {
|
|
78
82
|
children,
|
|
79
83
|
tokens,
|
|
@@ -86,13 +90,14 @@ const Card = _ref => {
|
|
|
86
90
|
viewport
|
|
87
91
|
});
|
|
88
92
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardBase.default, {
|
|
93
|
+
ref: ref,
|
|
89
94
|
tokens: themeTokens,
|
|
90
95
|
dataSet: dataSet,
|
|
91
96
|
...selectProps(rest),
|
|
92
97
|
children: children
|
|
93
98
|
});
|
|
94
|
-
};
|
|
95
|
-
|
|
99
|
+
});
|
|
100
|
+
Card.displayName = 'Card';
|
|
96
101
|
Card.propTypes = { ...selectedSystemPropTypes,
|
|
97
102
|
children: _propTypes.default.node,
|
|
98
103
|
tokens: (0, _utils.getTokensPropType)('Card'),
|
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,12 +11,12 @@ 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"));
|
|
19
17
|
|
|
18
|
+
var _airbnbPropTypes = _interopRequireDefault(require("airbnb-prop-types"));
|
|
19
|
+
|
|
20
20
|
var _Control = _interopRequireDefault(require("./Control"));
|
|
21
21
|
|
|
22
22
|
var _ThemeProvider = require("../ThemeProvider");
|
|
@@ -72,6 +72,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
72
72
|
children,
|
|
73
73
|
tokens,
|
|
74
74
|
variant,
|
|
75
|
+
controlRef,
|
|
75
76
|
...rest
|
|
76
77
|
} = _ref2;
|
|
77
78
|
const [containerHeight, setContainerHeight] = (0, _react.useState)(null);
|
|
@@ -105,13 +106,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
105
106
|
containerHeight,
|
|
106
107
|
isExpanded,
|
|
107
108
|
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;
|
|
109
|
+
});
|
|
115
110
|
const focusabilityProps = isExpanded ? {} : _utils.a11yProps.nonFocusableProps;
|
|
116
111
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
117
112
|
ref: ref,
|
|
@@ -120,10 +115,11 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
120
115
|
isExpanded: isExpanded,
|
|
121
116
|
tokens: controlTokens,
|
|
122
117
|
onPress: handleControlPress,
|
|
118
|
+
ref: controlRef,
|
|
123
119
|
children: control
|
|
124
120
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
125
121
|
ref: animatedRef,
|
|
126
|
-
style:
|
|
122
|
+
style: animatedStyles,
|
|
127
123
|
...focusabilityProps,
|
|
128
124
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
129
125
|
onLayout: onContainerLayout,
|
|
@@ -175,14 +171,12 @@ ExpandCollapsePanel.propTypes = { ...selectedSystemPropTypes,
|
|
|
175
171
|
/**
|
|
176
172
|
* Optional theme token overrides that may be passed to the ExpandCollapseControl element.
|
|
177
173
|
*/
|
|
178
|
-
controlTokens: (0, _utils.getTokensPropType)('ExpandCollapseControl')
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const staticStyles = _StyleSheet.default.create({
|
|
182
|
-
itemsContainer: {
|
|
183
|
-
overflow: 'hidden'
|
|
184
|
-
}
|
|
185
|
-
});
|
|
174
|
+
controlTokens: (0, _utils.getTokensPropType)('ExpandCollapseControl'),
|
|
186
175
|
|
|
176
|
+
/**
|
|
177
|
+
* An optional ref to be attached to the control
|
|
178
|
+
*/
|
|
179
|
+
controlRef: _airbnbPropTypes.default.ref()
|
|
180
|
+
};
|
|
187
181
|
var _default = ExpandCollapsePanel;
|
|
188
182
|
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
|
@@ -45,12 +45,18 @@ const List = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
45
45
|
} = _ref;
|
|
46
46
|
|
|
47
47
|
const items = _react.Children.map(children, (child, index) => {
|
|
48
|
-
|
|
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)) {
|
|
49
54
|
return /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
50
55
|
showDivider,
|
|
51
56
|
isLastItem: index + 1 === _react.Children.count(children),
|
|
52
57
|
tokens,
|
|
53
|
-
variant
|
|
58
|
+
variant,
|
|
59
|
+
...child.props
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -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);
|
package/lib/Search/Search.js
CHANGED
|
@@ -158,7 +158,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
|
158
158
|
|
|
159
159
|
const a11yLabelText = accessibilityLabel || getCopy('accessibilityLabel'); // Placeholder is optional and may be unset by passing an empty string
|
|
160
160
|
|
|
161
|
-
const placeholderText = placeholder
|
|
161
|
+
const placeholderText = placeholder !== null && placeholder !== void 0 ? placeholder : a11yLabelText;
|
|
162
162
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
163
163
|
style: staticStyles.container,
|
|
164
164
|
...selectContainerProps(rest),
|