@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
package/lib-module/List/List.js
CHANGED
|
@@ -11,24 +11,31 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
11
11
|
* allows icon, dividers and customized typography
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
const List = /*#__PURE__*/forwardRef(({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
const List = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
showDivider,
|
|
18
|
+
tokens,
|
|
19
|
+
variant,
|
|
20
|
+
accessibilityRole = Platform.select({
|
|
21
|
+
web: 'list',
|
|
22
|
+
default: undefined
|
|
23
|
+
}),
|
|
24
|
+
...rest
|
|
25
|
+
} = _ref;
|
|
25
26
|
const items = Children.map(children, (child, index) => {
|
|
26
|
-
|
|
27
|
+
var _child$type, _child$type2;
|
|
28
|
+
|
|
29
|
+
// Pass ListItem-specific props to children (by name so teams can add their own ListItems)
|
|
30
|
+
const isListItem = componentName => Boolean(componentName === ListItem.displayName);
|
|
31
|
+
|
|
32
|
+
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)) {
|
|
27
33
|
return /*#__PURE__*/cloneElement(child, {
|
|
28
34
|
showDivider,
|
|
29
35
|
isLastItem: index + 1 === Children.count(children),
|
|
30
36
|
tokens,
|
|
31
|
-
variant
|
|
37
|
+
variant,
|
|
38
|
+
...child.props
|
|
32
39
|
});
|
|
33
40
|
}
|
|
34
41
|
|
|
@@ -10,93 +10,122 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
12
12
|
|
|
13
|
-
const selectBulletStyles =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
const selectBulletStyles = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
itemBulletWidth,
|
|
16
|
+
itemBulletHeight,
|
|
17
|
+
itemBulletColor
|
|
18
|
+
} = _ref;
|
|
19
|
+
return {
|
|
20
|
+
width: itemBulletWidth,
|
|
21
|
+
height: itemBulletHeight,
|
|
22
|
+
borderRadius: itemBulletHeight / 2,
|
|
23
|
+
backgroundColor: itemBulletColor
|
|
24
|
+
};
|
|
25
|
+
};
|
|
23
26
|
|
|
24
|
-
const selectBulletContainerStyles =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const selectBulletContainerStyles = _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
itemBulletContainerWidth,
|
|
30
|
+
itemBulletContainerAlign
|
|
31
|
+
} = _ref2;
|
|
32
|
+
return {
|
|
33
|
+
width: itemBulletContainerWidth,
|
|
34
|
+
alignItems: itemBulletContainerAlign
|
|
35
|
+
};
|
|
36
|
+
};
|
|
31
37
|
|
|
32
|
-
const selectItemIconTokens =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
const selectItemIconTokens = _ref3 => {
|
|
39
|
+
let {
|
|
40
|
+
itemIconSize,
|
|
41
|
+
itemIconColor
|
|
42
|
+
} = _ref3;
|
|
43
|
+
return {
|
|
44
|
+
size: itemIconSize,
|
|
45
|
+
color: itemIconColor
|
|
46
|
+
};
|
|
47
|
+
};
|
|
39
48
|
|
|
40
|
-
const selectSideItemContainerStyles =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
const selectSideItemContainerStyles = _ref4 => {
|
|
50
|
+
let {
|
|
51
|
+
listGutter,
|
|
52
|
+
iconMarginTop
|
|
53
|
+
} = _ref4;
|
|
54
|
+
return {
|
|
55
|
+
marginTop: iconMarginTop,
|
|
56
|
+
marginRight: listGutter
|
|
57
|
+
};
|
|
58
|
+
}; // Align bullets with the top line of text the same way icons are aligned
|
|
47
59
|
|
|
48
60
|
|
|
49
|
-
const selectBulletPositioningStyles =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
const selectBulletPositioningStyles = _ref5 => {
|
|
62
|
+
let {
|
|
63
|
+
itemIconSize
|
|
64
|
+
} = _ref5;
|
|
65
|
+
return {
|
|
66
|
+
width: itemIconSize,
|
|
67
|
+
height: itemIconSize
|
|
68
|
+
};
|
|
69
|
+
};
|
|
55
70
|
|
|
56
|
-
const selectItemStyles =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
const selectItemStyles = _ref6 => {
|
|
72
|
+
let {
|
|
73
|
+
itemFontWeight,
|
|
74
|
+
itemFontSize,
|
|
75
|
+
itemLineHeight,
|
|
76
|
+
itemFontName
|
|
77
|
+
} = _ref6;
|
|
78
|
+
return applyTextStyles({
|
|
79
|
+
fontWeight: itemFontWeight,
|
|
80
|
+
fontSize: itemFontSize,
|
|
81
|
+
lineHeight: itemLineHeight,
|
|
82
|
+
fontName: itemFontName
|
|
83
|
+
});
|
|
84
|
+
};
|
|
67
85
|
|
|
68
|
-
const selectItemBlockStyles =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
const selectItemBlockStyles = _ref7 => {
|
|
87
|
+
let {
|
|
88
|
+
interItemMargin
|
|
89
|
+
} = _ref7;
|
|
90
|
+
return {
|
|
91
|
+
marginBottom: interItemMargin
|
|
92
|
+
};
|
|
93
|
+
};
|
|
73
94
|
|
|
74
|
-
const selectDividerStyles =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
const selectDividerStyles = _ref8 => {
|
|
96
|
+
let {
|
|
97
|
+
dividerColor,
|
|
98
|
+
dividerSize,
|
|
99
|
+
interItemMarginWithDivider
|
|
100
|
+
} = _ref8;
|
|
101
|
+
return {
|
|
102
|
+
borderBottomWidth: dividerSize,
|
|
103
|
+
borderColor: dividerColor,
|
|
104
|
+
marginBottom: interItemMarginWithDivider,
|
|
105
|
+
paddingBottom: interItemMarginWithDivider
|
|
106
|
+
};
|
|
107
|
+
};
|
|
84
108
|
/**
|
|
85
109
|
* ListItem is responsible for rendering icon or a bullet as side item
|
|
86
110
|
*/
|
|
87
111
|
|
|
88
112
|
|
|
89
|
-
const ListItem = /*#__PURE__*/forwardRef(({
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
113
|
+
const ListItem = /*#__PURE__*/forwardRef((_ref9, ref) => {
|
|
114
|
+
let {
|
|
115
|
+
tokens,
|
|
116
|
+
variant,
|
|
117
|
+
icon,
|
|
118
|
+
iconColor,
|
|
119
|
+
iconSize,
|
|
120
|
+
showDivider,
|
|
121
|
+
children,
|
|
122
|
+
isLastItem,
|
|
123
|
+
accessibilityRole = Platform.select({
|
|
124
|
+
web: 'listitem',
|
|
125
|
+
default: undefined
|
|
126
|
+
}),
|
|
127
|
+
...rest
|
|
128
|
+
} = _ref9;
|
|
100
129
|
const themeTokens = useThemeTokens('List', tokens, variant);
|
|
101
130
|
const itemStyles = selectItemStyles(themeTokens);
|
|
102
131
|
const itemBlockStyles = selectItemBlockStyles(themeTokens);
|
|
@@ -106,10 +135,6 @@ const ListItem = /*#__PURE__*/forwardRef(({
|
|
|
106
135
|
const itemBulletPositioningStyles = selectBulletPositioningStyles(themeTokens);
|
|
107
136
|
const iconTokens = selectItemIconTokens(themeTokens);
|
|
108
137
|
const sideItemContainerStyles = selectSideItemContainerStyles(themeTokens);
|
|
109
|
-
const accessibilityRole = Platform.select({
|
|
110
|
-
web: 'listitem',
|
|
111
|
-
default: 'item'
|
|
112
|
-
});
|
|
113
138
|
|
|
114
139
|
const renderItem = () => /*#__PURE__*/_jsx(View, {
|
|
115
140
|
style: staticStyles.wrap,
|
|
@@ -14,57 +14,69 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
16
16
|
|
|
17
|
-
const selectContainerStyles =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
const selectContainerStyles = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
containerPaddingLeft,
|
|
20
|
+
containerPaddingRight,
|
|
21
|
+
containerPaddingTop,
|
|
22
|
+
containerPaddingBottom,
|
|
23
|
+
maxWidth,
|
|
24
|
+
height
|
|
25
|
+
} = _ref;
|
|
26
|
+
return {
|
|
27
|
+
height,
|
|
28
|
+
maxWidth,
|
|
29
|
+
paddingLeft: containerPaddingLeft,
|
|
30
|
+
paddingRight: containerPaddingRight,
|
|
31
|
+
paddingTop: containerPaddingTop,
|
|
32
|
+
paddingBottom: containerPaddingBottom
|
|
33
|
+
};
|
|
34
|
+
};
|
|
32
35
|
|
|
33
|
-
const selectModalStyles =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
const selectModalStyles = _ref2 => {
|
|
37
|
+
let {
|
|
38
|
+
backgroundColor,
|
|
39
|
+
borderRadius,
|
|
40
|
+
height,
|
|
41
|
+
paddingLeft,
|
|
42
|
+
paddingRight,
|
|
43
|
+
paddingTop,
|
|
44
|
+
paddingBottom,
|
|
45
|
+
shadow
|
|
46
|
+
} = _ref2;
|
|
47
|
+
return {
|
|
48
|
+
backgroundColor,
|
|
49
|
+
borderRadius,
|
|
50
|
+
height,
|
|
51
|
+
paddingLeft,
|
|
52
|
+
paddingRight,
|
|
53
|
+
paddingTop,
|
|
54
|
+
paddingBottom,
|
|
55
|
+
...applyShadowToken(shadow)
|
|
56
|
+
};
|
|
57
|
+
};
|
|
52
58
|
|
|
53
|
-
const selectBackdropStyles =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
const selectBackdropStyles = _ref3 => {
|
|
60
|
+
let {
|
|
61
|
+
backdropColor,
|
|
62
|
+
backdropOpacity
|
|
63
|
+
} = _ref3;
|
|
64
|
+
return {
|
|
65
|
+
backgroundColor: backdropColor,
|
|
66
|
+
opacity: backdropOpacity
|
|
67
|
+
};
|
|
68
|
+
};
|
|
60
69
|
|
|
61
|
-
const selectCloseButtonContainerStyles =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
const selectCloseButtonContainerStyles = _ref4 => {
|
|
71
|
+
let {
|
|
72
|
+
paddingRight,
|
|
73
|
+
paddingTop
|
|
74
|
+
} = _ref4;
|
|
75
|
+
return {
|
|
76
|
+
paddingRight,
|
|
77
|
+
paddingTop
|
|
78
|
+
};
|
|
79
|
+
};
|
|
68
80
|
/**
|
|
69
81
|
* A modal window is a secondary window that opens on top of the main one.
|
|
70
82
|
* Users have to interact with it before they can carry out their task and return to the main window.
|
|
@@ -81,17 +93,18 @@ const selectCloseButtonContainerStyles = ({
|
|
|
81
93
|
*/
|
|
82
94
|
|
|
83
95
|
|
|
84
|
-
const Modal = /*#__PURE__*/forwardRef(({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
97
|
+
let {
|
|
98
|
+
children,
|
|
99
|
+
isOpen,
|
|
100
|
+
onClose,
|
|
101
|
+
maxWidth,
|
|
102
|
+
tokens,
|
|
103
|
+
variant,
|
|
104
|
+
copy,
|
|
105
|
+
closeButton,
|
|
106
|
+
...rest
|
|
107
|
+
} = _ref5;
|
|
95
108
|
const viewport = useViewport();
|
|
96
109
|
const themeTokens = useThemeTokens('Modal', tokens, variant, {
|
|
97
110
|
viewport,
|
|
@@ -203,6 +216,7 @@ const staticStyles = StyleSheet.create({
|
|
|
203
216
|
closeButtonContainer: {
|
|
204
217
|
position: 'absolute',
|
|
205
218
|
top: 0,
|
|
206
|
-
right: 0
|
|
219
|
+
right: 0,
|
|
220
|
+
zIndex: 1
|
|
207
221
|
}
|
|
208
222
|
});
|
|
@@ -16,33 +16,45 @@ const selectContainerStyles = tokens => ({ ...tokens
|
|
|
16
16
|
|
|
17
17
|
const selectTextStyles = tokens => applyTextStyles(selectTokens('Typography', tokens));
|
|
18
18
|
|
|
19
|
-
const selectIconProps =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const selectIconProps = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
iconSize,
|
|
22
|
+
iconColor
|
|
23
|
+
} = _ref;
|
|
24
|
+
return {
|
|
25
|
+
size: iconSize,
|
|
26
|
+
color: iconColor
|
|
27
|
+
};
|
|
28
|
+
};
|
|
26
29
|
|
|
27
|
-
const selectIconContainerStyles =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const selectIconContainerStyles = _ref2 => {
|
|
31
|
+
let {
|
|
32
|
+
iconGap
|
|
33
|
+
} = _ref2;
|
|
34
|
+
return {
|
|
35
|
+
paddingRight: iconGap
|
|
36
|
+
};
|
|
37
|
+
};
|
|
32
38
|
|
|
33
|
-
const selectDismissIconProps =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const selectDismissIconProps = _ref3 => {
|
|
40
|
+
let {
|
|
41
|
+
dismissIconSize,
|
|
42
|
+
dismissIconColor
|
|
43
|
+
} = _ref3;
|
|
44
|
+
return {
|
|
45
|
+
size: dismissIconSize,
|
|
46
|
+
color: dismissIconColor
|
|
47
|
+
};
|
|
48
|
+
};
|
|
40
49
|
|
|
41
|
-
const selectDismissButtonContainerStyles =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
const selectDismissButtonContainerStyles = _ref4 => {
|
|
51
|
+
let {
|
|
52
|
+
dismissButtonGap
|
|
53
|
+
} = _ref4;
|
|
54
|
+
return {
|
|
55
|
+
paddingLeft: dismissButtonGap
|
|
56
|
+
};
|
|
57
|
+
};
|
|
46
58
|
/**
|
|
47
59
|
* A banner that highlights important messages:
|
|
48
60
|
* - Status message to show there is an error or outage of services
|
|
@@ -96,15 +108,16 @@ const selectDismissButtonContainerStyles = ({
|
|
|
96
108
|
*/
|
|
97
109
|
|
|
98
110
|
|
|
99
|
-
const Notification = /*#__PURE__*/forwardRef(({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
const Notification = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
112
|
+
let {
|
|
113
|
+
children,
|
|
114
|
+
system,
|
|
115
|
+
dismissible,
|
|
116
|
+
copy = 'en',
|
|
117
|
+
tokens,
|
|
118
|
+
variant,
|
|
119
|
+
...rest
|
|
120
|
+
} = _ref5;
|
|
108
121
|
const [isDismissed, setIsDismissed] = useState(false);
|
|
109
122
|
const themeTokens = useThemeTokens('Notification', tokens, variant, {
|
|
110
123
|
system
|
|
@@ -6,16 +6,17 @@ import { a11yProps, copyPropTypes, getTokensPropType, hrefAttrsProp, linkProps,
|
|
|
6
6
|
import useCopy from '../utils/useCopy';
|
|
7
7
|
import dictionary from './dictionary';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const PageButton = /*#__PURE__*/forwardRef(({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const PageButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
10
|
+
let {
|
|
11
|
+
label,
|
|
12
|
+
onPress,
|
|
13
|
+
href,
|
|
14
|
+
isActive,
|
|
15
|
+
copy,
|
|
16
|
+
variant,
|
|
17
|
+
tokens,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
19
20
|
const getTokens = useThemeTokensCallback('PaginationPageButton', tokens, variant);
|
|
20
21
|
const getCopy = useCopy({
|
|
21
22
|
dictionary,
|
|
@@ -32,8 +33,8 @@ const PageButton = /*#__PURE__*/forwardRef(({
|
|
|
32
33
|
key: 'active-item'
|
|
33
34
|
} : {};
|
|
34
35
|
const accessibilityRole = href !== undefined ? 'link' : 'button';
|
|
35
|
-
const activeLabel = isActive ?
|
|
36
|
-
const accessibilityLabel =
|
|
36
|
+
const activeLabel = isActive ? " ".concat(getCopy('currentLabel')) : '';
|
|
37
|
+
const accessibilityLabel = "".concat(getCopy('goToLabel'), " ").concat(label).concat(activeLabel);
|
|
37
38
|
const {
|
|
38
39
|
hrefAttrs,
|
|
39
40
|
rest
|
|
@@ -12,31 +12,35 @@ import SideButton from './SideButton';
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
14
14
|
|
|
15
|
-
const selectTextStyles =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
const selectTextStyles = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
color,
|
|
18
|
+
fontName,
|
|
19
|
+
fontSize,
|
|
20
|
+
fontWeight,
|
|
21
|
+
lineHeight
|
|
22
|
+
} = _ref;
|
|
23
|
+
return applyTextStyles({
|
|
24
|
+
color,
|
|
25
|
+
fontName,
|
|
26
|
+
fontSize,
|
|
27
|
+
fontWeight,
|
|
28
|
+
lineHeight
|
|
29
|
+
});
|
|
30
|
+
};
|
|
28
31
|
|
|
29
|
-
const Pagination = /*#__PURE__*/forwardRef(({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
const Pagination = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
33
|
+
let {
|
|
34
|
+
children,
|
|
35
|
+
copy = 'en',
|
|
36
|
+
variant,
|
|
37
|
+
tokens,
|
|
38
|
+
sideButtonVariant,
|
|
39
|
+
sideButtonTokens,
|
|
40
|
+
LinkRouter,
|
|
41
|
+
linkRouterProps,
|
|
42
|
+
...rest
|
|
43
|
+
} = _ref2;
|
|
40
44
|
const viewport = useViewport();
|
|
41
45
|
const {
|
|
42
46
|
truncateAbove,
|
|
@@ -75,9 +79,11 @@ const Pagination = /*#__PURE__*/forwardRef(({
|
|
|
75
79
|
LinkRouter: LinkRouter,
|
|
76
80
|
linkRouterProps: linkRouterProps
|
|
77
81
|
}), ...items.map((_child, itemIndex) => {
|
|
78
|
-
|
|
82
|
+
var _itemProps$LinkRouter;
|
|
83
|
+
|
|
84
|
+
const buttonLabel = "".concat(itemIndex + 1);
|
|
79
85
|
const itemProps = getItemProps(itemIndex);
|
|
80
|
-
const ItemLinkRouter = itemProps.LinkRouter
|
|
86
|
+
const ItemLinkRouter = (_itemProps$LinkRouter = itemProps.LinkRouter) !== null && _itemProps$LinkRouter !== void 0 ? _itemProps$LinkRouter : LinkRouter;
|
|
81
87
|
const itemLinkRouterProps = { ...linkRouterProps,
|
|
82
88
|
...itemProps.linkRouterProps
|
|
83
89
|
};
|
|
@@ -113,12 +119,19 @@ const Pagination = /*#__PURE__*/forwardRef(({
|
|
|
113
119
|
ref: ref,
|
|
114
120
|
...selectProps(rest),
|
|
115
121
|
children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
|
|
116
|
-
.map((element, index) => [element,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
122
|
+
.map((element, index) => [element, "page-".concat(index + 1)]).filter(_ref3 => {
|
|
123
|
+
let [element] = _ref3;
|
|
124
|
+
return element !== null;
|
|
125
|
+
}).map(_ref4 => {
|
|
126
|
+
let [element, key] = _ref4;
|
|
127
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
128
|
+
right: gap,
|
|
129
|
+
children: element
|
|
130
|
+
}, key);
|
|
131
|
+
})
|
|
120
132
|
});
|
|
121
133
|
});
|
|
134
|
+
Pagination.displayName = 'Pagination';
|
|
122
135
|
PageButton.displayName = 'PageButton';
|
|
123
136
|
Pagination.PageButton = PageButton;
|
|
124
137
|
Pagination.propTypes = { ...selectedSystemPropTypes,
|