@telus-uds/components-base 1.8.1 → 1.8.4
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 +35 -2
- package/component-docs.json +711 -669
- package/lib/A11yInfoProvider/index.js +4 -3
- package/lib/A11yText/index.js +6 -5
- package/lib/ActivityIndicator/Spinner.js +14 -13
- package/lib/ActivityIndicator/Spinner.native.js +10 -8
- package/lib/ActivityIndicator/index.js +6 -5
- package/lib/ActivityIndicator/shared.js +1 -1
- package/lib/BaseProvider/index.js +13 -10
- package/lib/Box/Box.js +20 -19
- package/lib/Button/Button.js +7 -6
- package/lib/Button/ButtonBase.js +97 -79
- package/lib/Button/ButtonGroup.js +34 -32
- package/lib/Button/ButtonLink.js +9 -7
- package/lib/Button/index.js +4 -4
- package/lib/Button/propTypes.js +1 -1
- package/lib/Card/Card.js +8 -7
- package/lib/Card/CardBase.js +35 -31
- package/lib/Card/PressableCardBase.js +14 -12
- package/lib/Checkbox/Checkbox.js +97 -83
- package/lib/Checkbox/CheckboxGroup.js +29 -27
- package/lib/Checkbox/CheckboxInput.js +12 -10
- package/lib/Divider/Divider.js +10 -9
- package/lib/ExpandCollapse/Control.js +42 -36
- package/lib/ExpandCollapse/ExpandCollapse.js +11 -10
- package/lib/ExpandCollapse/Panel.js +29 -40
- package/lib/Feedback/Feedback.js +48 -35
- package/lib/Fieldset/Fieldset.js +16 -15
- package/lib/Fieldset/FieldsetContainer.js +16 -13
- package/lib/Fieldset/FieldsetContainer.native.js +11 -8
- package/lib/Fieldset/Legend.js +10 -7
- package/lib/Fieldset/Legend.native.js +10 -7
- package/lib/FlexGrid/Col/Col.js +18 -17
- package/lib/FlexGrid/FlexGrid.js +15 -14
- package/lib/FlexGrid/Row/Row.js +13 -12
- package/lib/HorizontalScroll/HorizontalScroll.js +25 -20
- package/lib/HorizontalScroll/HorizontalScrollButton.js +18 -14
- package/lib/HorizontalScroll/ScrollViewEnd.js +6 -5
- package/lib/HorizontalScroll/ScrollViewEnd.native.js +12 -9
- package/lib/HorizontalScroll/itemPositions.js +19 -13
- package/lib/Icon/Icon.js +11 -10
- package/lib/Icon/IconText.js +8 -7
- package/lib/Icon/index.js +5 -5
- package/lib/IconButton/IconButton.js +50 -42
- package/lib/InputLabel/InputLabel.js +37 -30
- package/lib/InputLabel/LabelContent.js +12 -9
- package/lib/InputLabel/LabelContent.native.js +9 -6
- package/lib/InputSupports/InputSupports.js +11 -10
- package/lib/InputSupports/useInputSupports.js +7 -6
- package/lib/Link/ChevronLink.js +9 -8
- package/lib/Link/InlinePressable.js +13 -10
- package/lib/Link/InlinePressable.native.js +20 -16
- package/lib/Link/Link.js +10 -9
- package/lib/Link/LinkBase.js +96 -78
- package/lib/Link/TextButton.js +9 -8
- package/lib/List/List.js +20 -13
- package/lib/List/ListItem.js +103 -79
- package/lib/Modal/Modal.js +74 -60
- package/lib/Notification/Notification.js +46 -33
- package/lib/Pagination/PageButton.js +13 -12
- package/lib/Pagination/Pagination.js +43 -30
- package/lib/Pagination/SideButton.js +21 -18
- package/lib/Pagination/usePagination.js +7 -6
- package/lib/Progress/Progress.js +23 -19
- package/lib/Progress/ProgressBar.js +25 -21
- package/lib/Progress/ProgressBarBackground.js +7 -6
- package/lib/Radio/Radio.js +80 -69
- package/lib/Radio/RadioButton.js +63 -53
- package/lib/Radio/RadioGroup.js +30 -28
- package/lib/Radio/RadioInput.js +12 -10
- package/lib/RadioCard/RadioCard.js +16 -15
- package/lib/RadioCard/RadioCardGroup.js +30 -28
- package/lib/Search/Search.js +52 -32
- package/lib/Select/Group.js +5 -4
- package/lib/Select/Group.native.js +4 -3
- package/lib/Select/Item.js +10 -7
- package/lib/Select/Item.native.js +1 -9
- package/lib/Select/Picker.js +16 -15
- package/lib/Select/Picker.native.js +49 -38
- package/lib/Select/Select.js +134 -113
- package/lib/SideNav/Item.js +39 -33
- package/lib/SideNav/ItemContent.js +15 -12
- package/lib/SideNav/ItemsGroup.js +13 -11
- package/lib/SideNav/SideNav.js +21 -18
- package/lib/Skeleton/Skeleton.js +60 -44
- package/lib/Skeleton/skeleton.constant.js +1 -1
- package/lib/Skeleton/skeletonWebAnimation.js +1 -1
- package/lib/Spacer/Spacer.js +6 -5
- package/lib/StackView/StackView.js +12 -11
- package/lib/StackView/StackWrap.js +5 -3
- package/lib/StackView/StackWrapBox.js +12 -11
- package/lib/StackView/StackWrapGap.js +11 -10
- package/lib/StackView/common.js +14 -11
- package/lib/StackView/getStackedContent.js +10 -9
- package/lib/StackView/index.js +1 -1
- package/lib/StepTracker/Step.js +122 -103
- package/lib/StepTracker/StepTracker.js +48 -38
- package/lib/Tabs/Tabs.js +57 -27
- package/lib/Tabs/TabsItem.js +78 -68
- package/lib/Tags/Tags.js +68 -62
- package/lib/TextInput/TextArea.js +26 -20
- package/lib/TextInput/TextInput.js +20 -15
- package/lib/TextInput/TextInputBase.js +74 -62
- package/lib/TextInput/index.js +4 -4
- package/lib/ThemeProvider/ThemeProvider.js +6 -5
- package/lib/ThemeProvider/index.js +5 -5
- package/lib/ThemeProvider/useSetTheme.js +6 -3
- package/lib/ThemeProvider/useThemeTokens.js +7 -2
- package/lib/ThemeProvider/utils/styles.js +50 -43
- package/lib/ThemeProvider/utils/theme-tokens.js +33 -21
- package/lib/ToggleSwitch/ToggleSwitch.js +90 -74
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +37 -35
- package/lib/Tooltip/Backdrop.js +6 -13
- package/lib/Tooltip/Backdrop.native.js +5 -4
- package/lib/Tooltip/Tooltip.js +81 -65
- package/lib/Tooltip/getTooltipPosition.js +29 -18
- package/lib/TooltipButton/TooltipButton.js +28 -21
- package/lib/Typography/Typography.js +37 -33
- package/lib/ViewportProvider/ViewportProvider.js +4 -3
- package/lib/ViewportProvider/useViewportListener.js +6 -3
- package/lib/index.js +54 -54
- package/lib/utils/a11y/semantics.js +5 -2
- package/lib/utils/a11y/textSize.js +8 -6
- package/lib/utils/animation/useVerticalExpandAnimation.js +46 -19
- package/lib/utils/children.js +4 -3
- package/lib/utils/index.js +10 -10
- package/lib/utils/input.js +28 -29
- package/lib/utils/pressability.js +36 -22
- package/lib/utils/props/clickProps.js +2 -1
- package/lib/utils/props/componentPropType.js +3 -3
- package/lib/utils/props/getPropSelector.js +6 -3
- package/lib/utils/props/handlerProps.js +25 -19
- package/lib/utils/props/hrefAttrsProp.js +14 -11
- package/lib/utils/props/index.js +12 -12
- package/lib/utils/props/inputSupportsProps.js +15 -12
- package/lib/utils/props/linkProps.js +7 -6
- package/lib/utils/props/pressProps.js +1 -1
- package/lib/utils/props/selectSystemProps.js +2 -2
- package/lib/utils/props/tokens.js +29 -15
- package/lib/utils/ssr.js +6 -2
- package/lib/utils/useCopy.js +6 -4
- package/lib/utils/useHash.js +2 -1
- package/lib/utils/useResponsiveProp.js +1 -1
- package/lib/utils/useSpacingScale.js +3 -1
- package/lib/utils/useUniqueId.js +3 -2
- package/lib/utils/withLinkRouter.js +6 -5
- package/lib-module/A11yInfoProvider/index.js +4 -3
- package/lib-module/A11yText/index.js +6 -5
- package/lib-module/ActivityIndicator/Spinner.js +14 -13
- package/lib-module/ActivityIndicator/Spinner.native.js +9 -8
- package/lib-module/ActivityIndicator/index.js +6 -5
- package/lib-module/BaseProvider/index.js +13 -10
- package/lib-module/Box/Box.js +20 -19
- package/lib-module/Button/Button.js +7 -6
- package/lib-module/Button/ButtonBase.js +96 -79
- package/lib-module/Button/ButtonGroup.js +34 -32
- package/lib-module/Button/ButtonLink.js +8 -7
- package/lib-module/Card/Card.js +8 -7
- package/lib-module/Card/CardBase.js +35 -31
- package/lib-module/Card/PressableCardBase.js +12 -11
- package/lib-module/Checkbox/Checkbox.js +97 -83
- package/lib-module/Checkbox/CheckboxGroup.js +29 -27
- package/lib-module/Checkbox/CheckboxInput.js +12 -10
- package/lib-module/Divider/Divider.js +10 -9
- package/lib-module/ExpandCollapse/Control.js +42 -36
- package/lib-module/ExpandCollapse/ExpandCollapse.js +11 -10
- package/lib-module/ExpandCollapse/Panel.js +29 -37
- package/lib-module/Feedback/Feedback.js +46 -33
- package/lib-module/Fieldset/Fieldset.js +16 -15
- package/lib-module/Fieldset/FieldsetContainer.js +16 -13
- package/lib-module/Fieldset/FieldsetContainer.native.js +11 -8
- package/lib-module/Fieldset/Legend.js +10 -7
- package/lib-module/Fieldset/Legend.native.js +10 -7
- package/lib-module/FlexGrid/Col/Col.js +18 -17
- package/lib-module/FlexGrid/FlexGrid.js +15 -14
- package/lib-module/FlexGrid/Row/Row.js +13 -12
- package/lib-module/HorizontalScroll/HorizontalScroll.js +24 -19
- package/lib-module/HorizontalScroll/HorizontalScrollButton.js +18 -14
- package/lib-module/HorizontalScroll/ScrollViewEnd.js +6 -5
- package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +12 -9
- package/lib-module/HorizontalScroll/itemPositions.js +18 -12
- package/lib-module/Icon/Icon.js +10 -9
- package/lib-module/Icon/IconText.js +9 -7
- package/lib-module/IconButton/IconButton.js +48 -41
- package/lib-module/InputLabel/InputLabel.js +37 -30
- package/lib-module/InputLabel/LabelContent.js +12 -9
- package/lib-module/InputLabel/LabelContent.native.js +9 -6
- package/lib-module/InputSupports/InputSupports.js +11 -10
- package/lib-module/InputSupports/useInputSupports.js +7 -6
- package/lib-module/Link/ChevronLink.js +9 -8
- package/lib-module/Link/InlinePressable.js +13 -10
- package/lib-module/Link/InlinePressable.native.js +20 -16
- package/lib-module/Link/Link.js +10 -9
- package/lib-module/Link/LinkBase.js +94 -77
- package/lib-module/Link/TextButton.js +9 -8
- package/lib-module/List/List.js +20 -13
- package/lib-module/List/ListItem.js +103 -78
- package/lib-module/Modal/Modal.js +74 -60
- package/lib-module/Notification/Notification.js +46 -33
- package/lib-module/Pagination/PageButton.js +13 -12
- package/lib-module/Pagination/Pagination.js +43 -30
- package/lib-module/Pagination/SideButton.js +21 -18
- package/lib-module/Pagination/usePagination.js +7 -6
- package/lib-module/Progress/Progress.js +23 -19
- package/lib-module/Progress/ProgressBar.js +25 -21
- package/lib-module/Progress/ProgressBarBackground.js +7 -6
- package/lib-module/Radio/Radio.js +80 -69
- package/lib-module/Radio/RadioButton.js +62 -52
- package/lib-module/Radio/RadioGroup.js +30 -28
- package/lib-module/Radio/RadioInput.js +12 -10
- package/lib-module/RadioCard/RadioCard.js +16 -15
- package/lib-module/RadioCard/RadioCardGroup.js +30 -28
- package/lib-module/Search/Search.js +52 -32
- package/lib-module/Select/Group.js +5 -4
- package/lib-module/Select/Group.native.js +4 -3
- package/lib-module/Select/Item.js +10 -7
- package/lib-module/Select/Item.native.js +1 -7
- package/lib-module/Select/Picker.js +16 -15
- package/lib-module/Select/Picker.native.js +46 -36
- package/lib-module/Select/Select.js +134 -113
- package/lib-module/SideNav/Item.js +39 -33
- package/lib-module/SideNav/ItemContent.js +14 -11
- package/lib-module/SideNav/ItemsGroup.js +13 -11
- package/lib-module/SideNav/SideNav.js +21 -18
- package/lib-module/Skeleton/Skeleton.js +60 -44
- package/lib-module/Skeleton/skeletonWebAnimation.js +1 -1
- package/lib-module/Spacer/Spacer.js +6 -5
- package/lib-module/StackView/StackView.js +12 -11
- package/lib-module/StackView/StackWrap.js +5 -3
- package/lib-module/StackView/StackWrapBox.js +12 -11
- package/lib-module/StackView/StackWrapGap.js +11 -10
- package/lib-module/StackView/common.js +14 -11
- package/lib-module/StackView/getStackedContent.js +10 -9
- package/lib-module/StepTracker/Step.js +122 -103
- package/lib-module/StepTracker/StepTracker.js +48 -38
- package/lib-module/Tabs/Tabs.js +57 -27
- package/lib-module/Tabs/TabsItem.js +77 -68
- package/lib-module/Tags/Tags.js +68 -62
- package/lib-module/TextInput/TextArea.js +26 -20
- package/lib-module/TextInput/TextInput.js +19 -15
- package/lib-module/TextInput/TextInputBase.js +74 -62
- package/lib-module/ThemeProvider/ThemeProvider.js +5 -4
- package/lib-module/ThemeProvider/useSetTheme.js +6 -3
- package/lib-module/ThemeProvider/useThemeTokens.js +7 -2
- package/lib-module/ThemeProvider/utils/styles.js +48 -41
- package/lib-module/ThemeProvider/utils/theme-tokens.js +32 -20
- package/lib-module/ToggleSwitch/ToggleSwitch.js +90 -74
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +37 -35
- package/lib-module/Tooltip/Backdrop.js +6 -13
- package/lib-module/Tooltip/Backdrop.native.js +5 -4
- package/lib-module/Tooltip/Tooltip.js +81 -65
- package/lib-module/Tooltip/getTooltipPosition.js +29 -18
- package/lib-module/TooltipButton/TooltipButton.js +28 -21
- package/lib-module/Typography/Typography.js +35 -31
- package/lib-module/ViewportProvider/ViewportProvider.js +4 -3
- package/lib-module/ViewportProvider/useViewportListener.js +6 -3
- package/lib-module/utils/a11y/semantics.js +4 -1
- package/lib-module/utils/a11y/textSize.js +7 -5
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +47 -20
- package/lib-module/utils/children.js +4 -3
- package/lib-module/utils/input.js +28 -29
- package/lib-module/utils/pressability.js +35 -21
- package/lib-module/utils/props/clickProps.js +2 -1
- package/lib-module/utils/props/componentPropType.js +3 -3
- package/lib-module/utils/props/getPropSelector.js +6 -3
- package/lib-module/utils/props/handlerProps.js +24 -18
- package/lib-module/utils/props/hrefAttrsProp.js +14 -11
- package/lib-module/utils/props/inputSupportsProps.js +15 -12
- package/lib-module/utils/props/linkProps.js +7 -6
- package/lib-module/utils/props/selectSystemProps.js +2 -2
- package/lib-module/utils/props/tokens.js +27 -14
- package/lib-module/utils/ssr.js +5 -2
- package/lib-module/utils/useCopy.js +6 -4
- package/lib-module/utils/useHash.js +2 -1
- package/lib-module/utils/useSpacingScale.js +3 -1
- package/lib-module/utils/useUniqueId.js +3 -2
- package/lib-module/utils/withLinkRouter.js +6 -5
- package/package.json +13 -11
- package/src/ExpandCollapse/Panel.jsx +2 -19
- package/src/List/List.jsx +34 -19
- package/src/List/ListItem.jsx +12 -2
- package/src/Modal/Modal.jsx +2 -1
- package/src/Pagination/Pagination.jsx +3 -0
- package/src/Search/Search.jsx +11 -0
- package/src/Select/Item.native.jsx +0 -7
- package/src/Tabs/Tabs.jsx +24 -2
- package/src/Tabs/TabsItem.jsx +6 -5
- package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
|
@@ -12,33 +12,45 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
12
12
|
|
|
13
13
|
const selectStyles = tokens => selectTokens('Feedback', tokens);
|
|
14
14
|
|
|
15
|
-
const selectTitleTextStyles =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const selectTitleTextStyles = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
titleFontSize,
|
|
18
|
+
...tokens
|
|
19
|
+
} = _ref;
|
|
20
|
+
return applyTextStyles(selectTokens('Typography', { ...tokens,
|
|
21
|
+
fontSize: titleFontSize
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
21
24
|
|
|
22
|
-
const selectContentTextStyles =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const selectContentTextStyles = _ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
contentFontSize,
|
|
28
|
+
...tokens
|
|
29
|
+
} = _ref2;
|
|
30
|
+
return applyTextStyles(selectTokens('Typography', { ...tokens,
|
|
31
|
+
fontSize: contentFontSize
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
28
34
|
|
|
29
|
-
const selectIconTokens =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
const selectIconTokens = _ref3 => {
|
|
36
|
+
let {
|
|
37
|
+
iconSize,
|
|
38
|
+
iconColor
|
|
39
|
+
} = _ref3;
|
|
40
|
+
return {
|
|
41
|
+
size: iconSize,
|
|
42
|
+
color: iconColor
|
|
43
|
+
};
|
|
44
|
+
};
|
|
36
45
|
|
|
37
|
-
const selectIconContainerStyles =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
const selectIconContainerStyles = _ref4 => {
|
|
47
|
+
let {
|
|
48
|
+
iconGap
|
|
49
|
+
} = _ref4;
|
|
50
|
+
return {
|
|
51
|
+
paddingRight: iconGap
|
|
52
|
+
};
|
|
53
|
+
};
|
|
42
54
|
/**
|
|
43
55
|
* A feedback box commonly used with form fields.
|
|
44
56
|
*
|
|
@@ -59,15 +71,16 @@ const selectIconContainerStyles = ({
|
|
|
59
71
|
*/
|
|
60
72
|
|
|
61
73
|
|
|
62
|
-
const Feedback = /*#__PURE__*/forwardRef(({
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
const Feedback = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
75
|
+
let {
|
|
76
|
+
title,
|
|
77
|
+
children,
|
|
78
|
+
id,
|
|
79
|
+
validation,
|
|
80
|
+
tokens,
|
|
81
|
+
variant,
|
|
82
|
+
...rest
|
|
83
|
+
} = _ref5;
|
|
71
84
|
const themeTokens = useThemeTokens('Feedback', tokens, { ...variant,
|
|
72
85
|
validation
|
|
73
86
|
});
|
|
@@ -16,21 +16,22 @@ import Legend from './Legend';
|
|
|
16
16
|
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
const Fieldset = /*#__PURE__*/forwardRef(({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const Fieldset = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
20
|
+
let {
|
|
21
|
+
copy = 'en',
|
|
22
|
+
space,
|
|
23
|
+
feedback,
|
|
24
|
+
feedbackPosition = 'top',
|
|
25
|
+
validation,
|
|
26
|
+
legend,
|
|
27
|
+
hint,
|
|
28
|
+
hintPosition,
|
|
29
|
+
tooltip,
|
|
30
|
+
inactive,
|
|
31
|
+
accessibilityRole,
|
|
32
|
+
name: fieldsetName,
|
|
33
|
+
children
|
|
34
|
+
} = _ref;
|
|
34
35
|
// Skips `inputId` because a fieldset' legend describes multiple inputs
|
|
35
36
|
const {
|
|
36
37
|
hintId,
|
|
@@ -6,19 +6,22 @@ import cssReset from './cssReset';
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const FieldsetContainer = /*#__PURE__*/forwardRef(({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
const FieldsetContainer = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
10
|
+
let {
|
|
11
|
+
children,
|
|
12
|
+
inactive,
|
|
13
|
+
accessibilityRole,
|
|
14
|
+
name: fieldsetName
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_jsx("fieldset", {
|
|
17
|
+
ref: ref,
|
|
18
|
+
disabled: inactive,
|
|
19
|
+
style: cssReset,
|
|
20
|
+
role: accessibilityRole,
|
|
21
|
+
name: fieldsetName,
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
});
|
|
22
25
|
FieldsetContainer.displayName = 'FieldsetContainer';
|
|
23
26
|
FieldsetContainer.propTypes = {
|
|
24
27
|
accessibilityRole: PropTypes.string,
|
|
@@ -4,14 +4,17 @@ import View from "react-native-web/dist/exports/View"; // No equivalent of `<fie
|
|
|
4
4
|
// If a11y testing finds any additional handling is needed at the container level, add it here.
|
|
5
5
|
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const FieldsetContainer = /*#__PURE__*/forwardRef(({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const FieldsetContainer = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
accessibilityRole
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/_jsx(View, {
|
|
13
|
+
ref: ref,
|
|
14
|
+
accessibilityRole: accessibilityRole,
|
|
15
|
+
children: children
|
|
16
|
+
});
|
|
17
|
+
});
|
|
15
18
|
FieldsetContainer.displayName = 'FieldsetContainer';
|
|
16
19
|
FieldsetContainer.propTypes = {
|
|
17
20
|
children: PropTypes.node,
|
|
@@ -7,13 +7,16 @@ import cssReset from './cssReset';
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
const Legend = /*#__PURE__*/forwardRef(({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const Legend = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
11
|
+
let {
|
|
12
|
+
children
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/_jsx("legend", {
|
|
15
|
+
ref: ref,
|
|
16
|
+
style: cssReset,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
});
|
|
17
20
|
Legend.displayName = 'Legend';
|
|
18
21
|
Legend.propTypes = {
|
|
19
22
|
children: PropTypes.node
|
|
@@ -8,13 +8,16 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const Legend = /*#__PURE__*/forwardRef(({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const Legend = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
12
|
+
let {
|
|
13
|
+
children
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/_jsx(View, {
|
|
16
|
+
ref: ref,
|
|
17
|
+
style: staticStyles.stretch,
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
});
|
|
18
21
|
Legend.displayName = 'Legend';
|
|
19
22
|
Legend.propTypes = {
|
|
20
23
|
children: PropTypes.node
|
|
@@ -9,22 +9,23 @@ import { useViewport } from '../../ViewportProvider';
|
|
|
9
9
|
import applyInheritance from '../helpers';
|
|
10
10
|
import { responsiveProps } from '../../utils';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
const Col = /*#__PURE__*/forwardRef(({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
const Col = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
13
|
+
let {
|
|
14
|
+
horizontalAlign,
|
|
15
|
+
children,
|
|
16
|
+
xs,
|
|
17
|
+
sm,
|
|
18
|
+
md,
|
|
19
|
+
lg,
|
|
20
|
+
xl,
|
|
21
|
+
xsOffset,
|
|
22
|
+
smOffset,
|
|
23
|
+
mdOffset,
|
|
24
|
+
lgOffset,
|
|
25
|
+
xlOffset,
|
|
26
|
+
flex,
|
|
27
|
+
...viewProps
|
|
28
|
+
} = _ref;
|
|
28
29
|
const gutter = useContext(GutterContext);
|
|
29
30
|
const viewPort = useViewport();
|
|
30
31
|
const hiddenLevels = applyInheritance([xs, sm, md, lg, xl]);
|
|
@@ -44,7 +45,7 @@ const Col = /*#__PURE__*/forwardRef(({
|
|
|
44
45
|
const horizontalAlignLevel = getHorizontalAlignLevel();
|
|
45
46
|
|
|
46
47
|
const toPercent = num => {
|
|
47
|
-
return
|
|
48
|
+
return "".concat(num / 12 * 100, "%");
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
const calculateWidth = value => {
|
|
@@ -15,20 +15,21 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
15
15
|
* A mobile-first flexbox grid.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
const FlexGrid = /*#__PURE__*/forwardRef(({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
const FlexGrid = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
19
|
+
let {
|
|
20
|
+
limitWidth = true,
|
|
21
|
+
gutter = true,
|
|
22
|
+
outsideGutter = true,
|
|
23
|
+
xsReverse,
|
|
24
|
+
smReverse,
|
|
25
|
+
mdReverse,
|
|
26
|
+
lgReverse,
|
|
27
|
+
xlReverse,
|
|
28
|
+
tag,
|
|
29
|
+
accessibilityRole,
|
|
30
|
+
children,
|
|
31
|
+
...rest
|
|
32
|
+
} = _ref;
|
|
32
33
|
const viewPort = useViewport();
|
|
33
34
|
const reverseLevel = applyInheritance([xsReverse, smReverse, mdReverse, lgReverse, xlReverse]);
|
|
34
35
|
const marginVertical = 0;
|
|
@@ -71,18 +71,19 @@ const distributeStyles = distribute => {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const Row = /*#__PURE__*/forwardRef(({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
const Row = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
75
|
+
let {
|
|
76
|
+
horizontalAlign,
|
|
77
|
+
verticalAlign,
|
|
78
|
+
distribute,
|
|
79
|
+
xsReverse,
|
|
80
|
+
smReverse,
|
|
81
|
+
mdReverse,
|
|
82
|
+
lgReverse,
|
|
83
|
+
xlReverse,
|
|
84
|
+
children,
|
|
85
|
+
...rest
|
|
86
|
+
} = _ref;
|
|
86
87
|
const viewPort = useViewport();
|
|
87
88
|
const reverseLevel = applyInheritance([xsReverse, smReverse, mdReverse, lgReverse, xlReverse]);
|
|
88
89
|
let flexDirection = '';
|
|
@@ -19,13 +19,14 @@ export const selectHorizontalScrollTokens = (themeTokens, prefix) => selectToken
|
|
|
19
19
|
* @TODO revisit `ScrollButton` after IconButton is stable.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
const HorizontalScroll = /*#__PURE__*/forwardRef(({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const HorizontalScroll = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
ScrollButton,
|
|
25
|
+
tokens,
|
|
26
|
+
itemPositions,
|
|
27
|
+
children,
|
|
28
|
+
...rest
|
|
29
|
+
} = _ref;
|
|
29
30
|
const {
|
|
30
31
|
nextIcon,
|
|
31
32
|
previousIcon,
|
|
@@ -42,25 +43,29 @@ const HorizontalScroll = /*#__PURE__*/forwardRef(({
|
|
|
42
43
|
|
|
43
44
|
const handleContentWidth = width => setContentWidth(width);
|
|
44
45
|
|
|
45
|
-
const handleContainerLayout =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const handleContainerLayout = _ref2 => {
|
|
47
|
+
let {
|
|
48
|
+
nativeEvent: {
|
|
49
|
+
layout: {
|
|
50
|
+
width
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
53
|
+
} = _ref2;
|
|
54
|
+
return setContainerWidth(width);
|
|
55
|
+
}; // Update the scroll position only when scrolling actions ends to minimally rerender
|
|
52
56
|
// and update which buttons are conditionally rendered.
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
const [scrollOffset, setScrollOffset] = useState(0);
|
|
56
60
|
|
|
57
|
-
const handleScrollEnd =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
const handleScrollEnd = _ref3 => {
|
|
62
|
+
let {
|
|
63
|
+
nativeEvent: {
|
|
64
|
+
contentOffset: {
|
|
65
|
+
x
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
|
-
}
|
|
63
|
-
}) => {
|
|
68
|
+
} = _ref3;
|
|
64
69
|
setScrollOffset(x);
|
|
65
70
|
};
|
|
66
71
|
|
|
@@ -8,11 +8,14 @@ import IconButton from '../IconButton';
|
|
|
8
8
|
import dictionary from './dictionary';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
|
|
11
|
-
const selectContainerStyles =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const selectContainerStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
offset
|
|
14
|
+
} = _ref;
|
|
15
|
+
return {
|
|
16
|
+
marginTop: offset ? -offset : 0
|
|
17
|
+
};
|
|
18
|
+
};
|
|
16
19
|
/**
|
|
17
20
|
* Button within a Tabs component showing users that content is available to the left or
|
|
18
21
|
* right, scrolling a screen's worth of content left or right when pressed.
|
|
@@ -23,15 +26,16 @@ const selectContainerStyles = ({
|
|
|
23
26
|
*/
|
|
24
27
|
|
|
25
28
|
|
|
26
|
-
const HorizontalScrollButton = /*#__PURE__*/forwardRef(({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const HorizontalScrollButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
30
|
+
let {
|
|
31
|
+
direction = 'next',
|
|
32
|
+
icon,
|
|
33
|
+
offset,
|
|
34
|
+
onPress,
|
|
35
|
+
variant,
|
|
36
|
+
tokens,
|
|
37
|
+
copy
|
|
38
|
+
} = _ref2;
|
|
35
39
|
const themeTokens = useThemeTokens('HorizontalScrollButton', tokens, variant);
|
|
36
40
|
const getCopy = useCopy({
|
|
37
41
|
dictionary,
|
|
@@ -12,11 +12,12 @@ const DEBOUNCE_MS = 100;
|
|
|
12
12
|
* https://github.com/necolas/react-native-web/issues/1021
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const ScrollViewEnd = /*#__PURE__*/forwardRef(({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const ScrollViewEnd = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
|
+
let {
|
|
17
|
+
onScrollEnd,
|
|
18
|
+
onScroll,
|
|
19
|
+
...props
|
|
20
|
+
} = _ref;
|
|
20
21
|
// Return debounced function directly from useCallback so it has .cancel method etc.
|
|
21
22
|
// Linter complains this stops it automatically scanning the deps, but we can check them manually.
|
|
22
23
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -8,15 +8,18 @@ import ScrollView from "react-native-web/dist/exports/ScrollView";
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const ScrollViewEnd = /*#__PURE__*/forwardRef(({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const ScrollViewEnd = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
12
|
+
let {
|
|
13
|
+
onScrollEnd,
|
|
14
|
+
...props
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
...props,
|
|
19
|
+
onScrollEndDrag: onScrollEnd,
|
|
20
|
+
onMomentumScrollEnd: onScrollEnd
|
|
21
|
+
});
|
|
22
|
+
});
|
|
20
23
|
ScrollViewEnd.displayName = 'ScrollViewEnd';
|
|
21
24
|
ScrollViewEnd.propTypes = {
|
|
22
25
|
onScrollEnd: PropTypes.func.isRequired
|
|
@@ -29,15 +29,19 @@ import PropTypes from 'prop-types'; // Utilities to assist scrolling a parent so
|
|
|
29
29
|
* @returns {number}
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
export const getItemPositionScrollTarget = (x, scrollMax, positions
|
|
32
|
+
export const getItemPositionScrollTarget = function (x, scrollMax, positions) {
|
|
33
|
+
let buttonClearance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
33
34
|
if (x <= 0) return 0;
|
|
34
35
|
if (x >= scrollMax) return scrollMax; // If not scrolling all the way to the start or end, stop
|
|
35
36
|
// where the first item is not coverred by the scroll previous button
|
|
36
37
|
|
|
37
|
-
const targetItem = Object.values(positions).find(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const targetItem = Object.values(positions).find(_ref => {
|
|
39
|
+
let {
|
|
40
|
+
start,
|
|
41
|
+
end
|
|
42
|
+
} = _ref;
|
|
43
|
+
return start <= x && end > x;
|
|
44
|
+
}); // If there's no target item we're landing at a gap between items
|
|
41
45
|
|
|
42
46
|
const targetX = targetItem ? targetItem.start : x;
|
|
43
47
|
return Math.max(0, targetX - buttonClearance);
|
|
@@ -52,14 +56,16 @@ export const getItemPositionScrollTarget = (x, scrollMax, positions, buttonClear
|
|
|
52
56
|
*/
|
|
53
57
|
|
|
54
58
|
export const getItemPositionLayoutHandler = (positions, index) => {
|
|
55
|
-
const handleLayout =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
const handleLayout = _ref2 => {
|
|
60
|
+
let {
|
|
61
|
+
nativeEvent: {
|
|
62
|
+
layout: {
|
|
63
|
+
width,
|
|
64
|
+
x
|
|
65
|
+
}
|
|
60
66
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
67
|
+
} = _ref2;
|
|
68
|
+
|
|
63
69
|
/* eslint-disable-next-line no-param-reassign */
|
|
64
70
|
positions[index] = {
|
|
65
71
|
start: x,
|
package/lib-module/Icon/Icon.js
CHANGED
|
@@ -5,14 +5,15 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { useThemeTokens } from '../ThemeProvider';
|
|
6
6
|
import { getTokensPropType, scaleWithText, variantProp } from '../utils';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const Icon = /*#__PURE__*/forwardRef(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const Icon = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
9
|
+
let {
|
|
10
|
+
icon: IconComponent,
|
|
11
|
+
accessibilityLabel,
|
|
12
|
+
variant,
|
|
13
|
+
tokens,
|
|
14
|
+
scalesWithText = false,
|
|
15
|
+
dataSet
|
|
16
|
+
} = _ref;
|
|
16
17
|
const themeTokens = useThemeTokens('Icon', tokens, variant);
|
|
17
18
|
const size = scalesWithText ? scaleWithText(themeTokens.size) : themeTokens.size;
|
|
18
19
|
|
|
@@ -29,7 +30,7 @@ const Icon = /*#__PURE__*/forwardRef(({
|
|
|
29
30
|
// TODO: systematise animations.
|
|
30
31
|
// https://github.com/telus/universal-design-system/issues/487
|
|
31
32
|
transition: 'transform 200ms, color 200ms',
|
|
32
|
-
transform: [themeTokens.scale ?
|
|
33
|
+
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(' ')
|
|
33
34
|
},
|
|
34
35
|
dataSet: dataSet,
|
|
35
36
|
children: iconContent
|
|
@@ -15,15 +15,17 @@ import { spacingProps } from '../utils';
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
const IconText = /*#__PURE__*/forwardRef(({
|
|
19
|
-
space,
|
|
20
|
-
iconPosition = 'left',
|
|
21
|
-
icon: IconComponent,
|
|
22
|
-
iconProps,
|
|
23
|
-
children
|
|
24
|
-
}, ref) => {
|
|
18
|
+
const IconText = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
25
19
|
var _iconProps$tokens;
|
|
26
20
|
|
|
21
|
+
let {
|
|
22
|
+
space,
|
|
23
|
+
iconPosition = 'left',
|
|
24
|
+
icon: IconComponent,
|
|
25
|
+
iconProps,
|
|
26
|
+
children
|
|
27
|
+
} = _ref;
|
|
28
|
+
|
|
27
29
|
const iconContent = IconComponent && /*#__PURE__*/_jsx(Icon, {
|
|
28
30
|
ref: ref,
|
|
29
31
|
icon: IconComponent,
|