@telus-uds/components-base 0.0.2-prerelease.9 → 1.1.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/.eslintrc.js +9 -0
- package/.storybook/main.js +4 -0
- package/.storybook/preview.js +37 -0
- package/.ultra.cache.json +1 -1
- package/CHANGELOG.md +50 -0
- package/README.md +4 -2
- package/__fixtures__/test-utils.js +25 -0
- package/__fixtures__/testTheme.js +4 -2
- package/__tests__/Button/ButtonGroup.test.jsx +4 -5
- package/__tests__/Checkbox/Checkbox.test.jsx +2 -2
- package/__tests__/Checkbox/CheckboxGroup.test.jsx +4 -5
- package/__tests__/ExpandCollapse/ExpandCollapse.test.jsx +2 -2
- package/__tests__/HorizontalScroll/HorizontalScroll.test.jsx +164 -0
- package/__tests__/Link/LinkBase.test.jsx +0 -14
- package/__tests__/Radio/Radio.test.jsx +2 -2
- package/__tests__/Radio/RadioGroup.test.jsx +4 -5
- package/__tests__/RadioCard/RadioCard.test.jsx +2 -2
- package/__tests__/RadioCard/RadioCardGroup.test.jsx +4 -5
- package/__tests__/Search/Search.test.jsx +9 -8
- package/__tests__/Select/Select.test.jsx +3 -2
- package/__tests__/Tabs/Tabs.test.jsx +1 -161
- package/__tests__/Tags/Tags.test.jsx +4 -5
- package/__tests__/TextInput/TextArea.test.jsx +3 -2
- package/__tests__/TextInput/TextInputBase.test.jsx +10 -5
- package/__tests__/ThemeProvider/ThemeProvider.test.jsx +77 -0
- package/__tests__/ThemeProvider/useThemeTokens.test.jsx +9 -5
- package/__tests__/ThemeProvider/utils/theme-tokens.test.js +41 -0
- package/__tests__/ToggleSwitch/ToggleSwitch.test.jsx +3 -2
- package/__tests__/utils/children.test.jsx +128 -0
- package/__tests__/utils/input.test.js +1 -1
- package/__tests__/utils/semantics.test.jsx +43 -0
- package/babel.config.js +9 -16
- package/component-docs.json +10313 -0
- package/generate-component-docs.js +56 -0
- package/lib/A11yText/index.js +10 -5
- package/lib/ActivityIndicator/Spinner.js +16 -13
- package/lib/ActivityIndicator/Spinner.native.js +12 -8
- package/lib/Box/Box.js +103 -8
- package/lib/Button/Button.js +9 -8
- package/lib/Button/ButtonBase.js +14 -7
- package/lib/Button/ButtonGroup.js +25 -10
- package/lib/Button/ButtonLink.js +10 -7
- package/lib/Card/Card.js +2 -0
- package/lib/Card/CardBase.js +13 -5
- package/lib/Card/PressableCardBase.js +12 -8
- package/lib/Checkbox/Checkbox.js +25 -14
- package/lib/Checkbox/CheckboxGroup.js +22 -12
- package/lib/Divider/Divider.js +12 -7
- package/lib/ExpandCollapse/Accordion.js +10 -4
- package/lib/ExpandCollapse/Control.js +12 -6
- package/lib/ExpandCollapse/ExpandCollapse.js +10 -5
- package/lib/ExpandCollapse/Panel.js +8 -7
- package/lib/Feedback/Feedback.js +10 -5
- package/lib/Fieldset/Fieldset.js +10 -5
- package/lib/Fieldset/FieldsetContainer.js +10 -5
- package/lib/Fieldset/FieldsetContainer.native.js +10 -5
- package/lib/Fieldset/Legend.js +10 -5
- package/lib/Fieldset/Legend.native.js +10 -5
- package/lib/FlexGrid/Col/Col.js +8 -5
- package/lib/FlexGrid/FlexGrid.js +31 -6
- package/lib/FlexGrid/Row/Row.js +12 -5
- package/lib/{Tabs → HorizontalScroll}/HorizontalScroll.js +5 -4
- package/lib/{Tabs/TabsScrollButton.js → HorizontalScroll/HorizontalScrollButton.js} +14 -8
- package/lib/{Tabs → HorizontalScroll}/ScrollViewEnd.js +0 -0
- package/lib/{Tabs → HorizontalScroll}/ScrollViewEnd.native.js +0 -0
- package/lib/{Tabs → HorizontalScroll}/dictionary.js +0 -0
- package/lib/HorizontalScroll/index.js +35 -0
- package/lib/{Tabs → HorizontalScroll}/itemPositions.js +0 -0
- package/lib/Icon/Icon.js +16 -9
- package/lib/Icon/IconText.js +8 -7
- package/lib/IconButton/IconButton.js +10 -5
- package/lib/InputLabel/InputLabel.js +33 -5
- package/lib/InputLabel/LabelContent.js +22 -12
- package/lib/InputLabel/LabelContent.native.js +23 -5
- package/lib/InputSupports/InputSupports.js +10 -5
- package/lib/Link/ChevronLink.js +12 -5
- package/lib/Link/InlinePressable.js +10 -4
- package/lib/Link/InlinePressable.native.js +5 -4
- package/lib/Link/Link.js +12 -5
- package/lib/Link/LinkBase.js +12 -5
- package/lib/Link/TextButton.js +10 -5
- package/lib/List/List.js +6 -6
- package/lib/List/ListItem.js +28 -33
- package/lib/List/index.js +15 -0
- package/lib/Modal/Modal.js +10 -5
- package/lib/Notification/Notification.js +21 -5
- package/lib/Pagination/PageButton.js +16 -11
- package/lib/Pagination/Pagination.js +12 -7
- package/lib/Pagination/SideButton.js +12 -7
- package/lib/Pagination/usePagination.js +2 -2
- package/lib/Progress/Progress.js +10 -5
- package/lib/Progress/ProgressBar.js +21 -10
- package/lib/Progress/ProgressBarBackground.js +12 -8
- package/lib/Radio/Radio.js +14 -13
- package/lib/Radio/RadioButton.js +20 -9
- package/lib/Radio/RadioGroup.js +24 -13
- package/lib/RadioCard/RadioCard.js +14 -10
- package/lib/RadioCard/RadioCardGroup.js +13 -12
- package/lib/Search/Search.js +29 -18
- package/lib/Select/Picker.js +11 -6
- package/lib/Select/Picker.native.js +21 -6
- package/lib/Select/Select.js +46 -4
- package/lib/SideNav/Item.js +10 -5
- package/lib/SideNav/ItemsGroup.js +10 -5
- package/lib/SideNav/SideNav.js +11 -7
- package/lib/Skeleton/Skeleton.js +15 -15
- package/lib/Skeleton/skeletonWebAnimation.js +1 -1
- package/lib/Spacer/Spacer.js +19 -7
- package/lib/StackView/StackView.js +26 -7
- package/lib/StackView/StackWrap.js +24 -13
- package/lib/StackView/StackWrapBox.js +34 -8
- package/lib/StackView/StackWrapGap.js +16 -7
- package/lib/StackView/common.js +4 -2
- package/lib/StackView/getStackedContent.js +2 -2
- package/lib/StepTracker/StepTracker.js +10 -5
- package/lib/Tabs/Tabs.js +26 -19
- package/lib/Tabs/TabsItem.js +16 -12
- package/lib/Tags/Tags.js +27 -11
- package/lib/TextInput/TextArea.js +7 -5
- package/lib/TextInput/TextInput.js +12 -6
- package/lib/TextInput/TextInputBase.js +12 -8
- package/lib/ThemeProvider/ThemeProvider.js +14 -10
- package/lib/ThemeProvider/useSetTheme.js +6 -1
- package/lib/ThemeProvider/utils/styles.js +2 -2
- package/lib/ThemeProvider/utils/theme-tokens.js +39 -8
- package/lib/ToggleSwitch/ToggleSwitch.js +11 -6
- package/lib/Tooltip/Backdrop.js +10 -2
- package/lib/Tooltip/Tooltip.js +5 -4
- package/lib/Typography/Typography.js +40 -24
- package/lib/index.js +36 -1
- package/lib/utils/a11y/index.js +13 -0
- package/lib/utils/a11y/propTypes.js +61 -0
- package/lib/utils/a11y/propTypes.native.js +47 -0
- package/lib/utils/a11y/semantics.js +173 -0
- package/lib/utils/animation/useVerticalExpandAnimation.js +1 -1
- package/lib/utils/children.js +55 -8
- package/lib/utils/input.js +27 -17
- package/lib/utils/propTypes.js +40 -68
- package/lib/utils/useCopy.js +1 -1
- package/lib/utils/useHash.js +8 -4
- package/lib/utils/useSpacingScale.js +1 -3
- package/lib/utils/useUniqueId.js +1 -1
- package/package.json +14 -6
- package/release-context.json +4 -4
- package/src/A11yText/index.jsx +6 -4
- package/src/ActivityIndicator/Spinner.jsx +5 -3
- package/src/ActivityIndicator/Spinner.native.jsx +5 -3
- package/src/Box/Box.jsx +125 -39
- package/src/Button/Button.jsx +7 -4
- package/src/Button/ButtonBase.jsx +86 -77
- package/src/Button/ButtonGroup.jsx +81 -69
- package/src/Button/ButtonLink.jsx +18 -13
- package/src/Card/Card.jsx +2 -2
- package/src/Card/CardBase.jsx +6 -4
- package/src/Card/PressableCardBase.jsx +71 -64
- package/src/Checkbox/Checkbox.jsx +118 -108
- package/src/Checkbox/CheckboxGroup.jsx +72 -62
- package/src/Divider/Divider.jsx +7 -4
- package/src/ExpandCollapse/Accordion.jsx +3 -2
- package/src/ExpandCollapse/Control.jsx +40 -43
- package/src/ExpandCollapse/ExpandCollapse.jsx +26 -23
- package/src/ExpandCollapse/Panel.jsx +69 -63
- package/src/Feedback/Feedback.jsx +36 -33
- package/src/Fieldset/Fieldset.jsx +63 -56
- package/src/Fieldset/FieldsetContainer.jsx +14 -5
- package/src/Fieldset/FieldsetContainer.native.jsx +7 -4
- package/src/Fieldset/Legend.jsx +7 -2
- package/src/Fieldset/Legend.native.jsx +7 -2
- package/src/FlexGrid/Col/Col.jsx +139 -132
- package/src/FlexGrid/FlexGrid.jsx +79 -51
- package/src/FlexGrid/Row/Row.jsx +55 -48
- package/src/HorizontalScroll/HorizontalScroll.jsx +168 -0
- package/src/HorizontalScroll/HorizontalScrollButton.jsx +105 -0
- package/src/{Tabs → HorizontalScroll}/ScrollViewEnd.jsx +0 -0
- package/src/{Tabs → HorizontalScroll}/ScrollViewEnd.native.jsx +0 -0
- package/src/{Tabs → HorizontalScroll}/dictionary.js +0 -0
- package/src/HorizontalScroll/index.js +17 -0
- package/src/{Tabs → HorizontalScroll}/itemPositions.js +0 -0
- package/src/Icon/Icon.jsx +37 -35
- package/src/Icon/IconText.jsx +22 -17
- package/src/IconButton/IconButton.jsx +49 -42
- package/src/InputLabel/InputLabel.jsx +53 -38
- package/src/InputLabel/LabelContent.jsx +14 -6
- package/src/InputLabel/LabelContent.native.jsx +11 -2
- package/src/InputSupports/InputSupports.jsx +29 -34
- package/src/Link/ChevronLink.jsx +26 -16
- package/src/Link/InlinePressable.jsx +5 -3
- package/src/Link/InlinePressable.native.jsx +5 -3
- package/src/Link/Link.jsx +22 -16
- package/src/Link/LinkBase.jsx +67 -58
- package/src/Link/TextButton.jsx +30 -23
- package/src/List/List.jsx +6 -7
- package/src/List/ListItem.jsx +70 -90
- package/src/List/index.js +5 -0
- package/src/Modal/Modal.jsx +9 -4
- package/src/Notification/Notification.jsx +58 -43
- package/src/Pagination/PageButton.jsx +37 -34
- package/src/Pagination/Pagination.jsx +88 -92
- package/src/Pagination/SideButton.jsx +44 -41
- package/src/Progress/Progress.jsx +5 -4
- package/src/Progress/ProgressBar.jsx +42 -29
- package/src/Progress/ProgressBarBackground.jsx +5 -3
- package/src/Radio/Radio.jsx +85 -78
- package/src/Radio/RadioButton.jsx +54 -43
- package/src/Radio/RadioGroup.jsx +74 -63
- package/src/RadioCard/RadioCard.jsx +75 -68
- package/src/RadioCard/RadioCardGroup.jsx +82 -75
- package/src/Search/Search.jsx +127 -106
- package/src/Select/Picker.jsx +49 -42
- package/src/Select/Picker.native.jsx +56 -49
- package/src/Select/Select.jsx +115 -72
- package/src/SideNav/Item.jsx +53 -46
- package/src/SideNav/ItemsGroup.jsx +50 -43
- package/src/SideNav/SideNav.jsx +68 -60
- package/src/Skeleton/Skeleton.jsx +9 -13
- package/src/Spacer/Spacer.jsx +11 -4
- package/src/StackView/StackView.jsx +47 -23
- package/src/StackView/StackWrap.jsx +14 -12
- package/src/StackView/StackWrapBox.jsx +62 -28
- package/src/StackView/StackWrapGap.jsx +46 -24
- package/src/StackView/common.jsx +3 -2
- package/src/StepTracker/StepTracker.jsx +73 -62
- package/src/Tabs/Tabs.jsx +70 -62
- package/src/Tabs/TabsItem.jsx +111 -103
- package/src/Tags/Tags.jsx +114 -102
- package/src/TextInput/TextArea.jsx +5 -4
- package/src/TextInput/TextInput.jsx +5 -4
- package/src/TextInput/TextInputBase.jsx +84 -77
- package/src/ThemeProvider/ThemeProvider.jsx +11 -7
- package/src/ThemeProvider/useSetTheme.js +4 -0
- package/src/ThemeProvider/utils/theme-tokens.js +28 -0
- package/src/ToggleSwitch/ToggleSwitch.jsx +49 -50
- package/src/Tooltip/Tooltip.jsx +134 -130
- package/src/Typography/Typography.jsx +67 -44
- package/src/index.js +3 -1
- package/src/utils/a11y/index.js +1 -0
- package/src/utils/a11y/propTypes.js +61 -0
- package/src/utils/a11y/propTypes.native.js +39 -0
- package/src/utils/a11y/semantics.js +162 -0
- package/src/utils/children.jsx +60 -7
- package/src/utils/input.js +20 -17
- package/src/utils/propTypes.js +30 -76
- package/src/utils/useCopy.js +1 -1
- package/src/utils/useHash.js +8 -3
- package/stories/A11yText/A11yText.stories.jsx +3 -3
- package/stories/ActivityIndicator/ActivityIndicator.stories.jsx +2 -2
- package/stories/Box/Box.stories.jsx +2 -2
- package/stories/Button/Button.stories.jsx +3 -3
- package/stories/Button/ButtonGroup.stories.jsx +2 -2
- package/stories/Button/ButtonLink.stories.jsx +2 -2
- package/stories/Card/Card.stories.jsx +2 -2
- package/stories/Checkbox/Checkbox.stories.jsx +2 -2
- package/stories/Divider/Divider.stories.jsx +2 -2
- package/stories/ExpandCollapse/ExpandCollapse.stories.jsx +3 -3
- package/stories/Feedback/Feedback.stories.jsx +2 -2
- package/stories/FlexGrid/01 FlexGrid.stories.jsx +2 -2
- package/stories/FlexGrid/02 Row.stories.jsx +2 -2
- package/stories/FlexGrid/03 Col.stories.jsx +2 -2
- package/stories/Icon/Icon.stories.jsx +2 -2
- package/stories/IconButton/IconButton.stories.jsx +2 -2
- package/stories/InputLabel/InputLabel.stories.jsx +2 -2
- package/stories/Link/ChevronLink.stories.jsx +2 -2
- package/stories/Link/Link.stories.jsx +2 -2
- package/stories/Link/TextButton.stories.jsx +2 -2
- package/stories/List/List.stories.jsx +2 -2
- package/stories/Modal/Modal.stories.jsx +2 -2
- package/stories/Notification/Notification.stories.jsx +2 -2
- package/stories/Pagination/Pagination.stories.jsx +2 -2
- package/stories/Progress/Progress.stories.jsx +2 -2
- package/stories/Radio/Radio.stories.jsx +2 -2
- package/stories/RadioCard/RadioCard.stories.jsx +2 -2
- package/stories/Search/Search.stories.jsx +2 -2
- package/stories/Select/Select.stories.jsx +2 -2
- package/stories/SideNav/SideNav.stories.jsx +2 -2
- package/stories/SideNav/SideNavItem.stories.jsx +2 -2
- package/stories/SideNav/SideNavItemsGroup.stories.jsx +2 -2
- package/stories/Skeleton/Skeleton.stories.jsx +3 -3
- package/stories/Spacer/Spacer.stories.jsx +2 -2
- package/stories/StackView/StackView.stories.jsx +2 -2
- package/stories/StackView/StackWrap.stories.jsx +2 -2
- package/stories/StepTracker/StepTracker.stories.jsx +2 -2
- package/stories/Tabs/Tabs.stories.jsx +2 -2
- package/stories/Tags/Tags.stories.jsx +2 -2
- package/stories/TextInput/TextArea.stories.jsx +2 -2
- package/stories/TextInput/TextInput.stories.jsx +2 -2
- package/stories/ToggleSwitch/ToggleSwitch.stories.jsx +2 -2
- package/stories/Tooltip/Tooltip.stories.jsx +2 -2
- package/stories/TooltipButton/TooltipButton.stories.jsx +2 -2
- package/stories/Typography/Typography.stories.jsx +2 -2
- package/stories/platform-supports.jsx +1 -1
- package/stories/supports.jsx +4 -5
- package/src/Tabs/HorizontalScroll.jsx +0 -165
- package/src/Tabs/TabsScrollButton.jsx +0 -100
package/lib/Link/TextButton.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
|
|
|
@@ -19,12 +19,16 @@ var _TextButton$propTypes;
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
22
26
|
/**
|
|
23
27
|
* `TextButton` is a button that looks like a Link. It uses the same theming and variants as
|
|
24
28
|
* Link but has the accessibility role of a `Button`. It should be used for actions that
|
|
25
29
|
* take place on the current page, or for navigation within an app.
|
|
26
30
|
*/
|
|
27
|
-
const TextButton = ({
|
|
31
|
+
const TextButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
28
32
|
onPress,
|
|
29
33
|
children,
|
|
30
34
|
variant,
|
|
@@ -33,17 +37,18 @@ const TextButton = ({
|
|
|
33
37
|
// `onPress` in an omniplatform app that uses React Navigation's useLinkProps for internal nav.
|
|
34
38
|
accessibilityRole = 'button',
|
|
35
39
|
...linkProps
|
|
36
|
-
}) => {
|
|
40
|
+
}, ref) => {
|
|
37
41
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('Link', tokens, variant);
|
|
38
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkBase.default, {
|
|
39
43
|
onPress: onPress,
|
|
40
44
|
accessibilityRole: accessibilityRole,
|
|
41
45
|
tokens: getTokens,
|
|
46
|
+
ref: ref,
|
|
42
47
|
...linkProps,
|
|
43
48
|
children: children
|
|
44
49
|
});
|
|
45
|
-
};
|
|
46
|
-
|
|
50
|
+
});
|
|
51
|
+
TextButton.displayName = 'TextButton';
|
|
47
52
|
TextButton.propTypes = { ..._LinkBase.default.propTypes,
|
|
48
53
|
onPress: _propTypes.default.func.isRequired
|
|
49
54
|
}; // Remove incompatible Link prop (if this build includes propTypes)
|
package/lib/List/List.js
CHANGED
|
@@ -28,16 +28,16 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
28
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
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* An unordered List component has a child a ListItem that
|
|
32
32
|
* allows icon, dividers and customized typography
|
|
33
33
|
*/
|
|
34
|
-
const List = ({
|
|
34
|
+
const List = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
35
35
|
children,
|
|
36
36
|
showDivider,
|
|
37
37
|
tokens,
|
|
38
38
|
variant,
|
|
39
39
|
...rest
|
|
40
|
-
}) => {
|
|
40
|
+
}, ref) => {
|
|
41
41
|
const accessibilityRole = _Platform.default.select({
|
|
42
42
|
web: 'list',
|
|
43
43
|
default: 'none'
|
|
@@ -59,13 +59,13 @@ const List = ({
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
62
|
+
ref: ref,
|
|
62
63
|
accessibilityRole: accessibilityRole,
|
|
63
64
|
...a11y,
|
|
64
65
|
children: items
|
|
65
66
|
});
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
List.Item = _ListItem.default;
|
|
67
|
+
});
|
|
68
|
+
List.displayName = 'List';
|
|
69
69
|
List.propTypes = { ..._propTypes2.a11yProps.types,
|
|
70
70
|
tokens: (0, _utils.getTokensPropType)('List'),
|
|
71
71
|
variant: _utils.variantProp.propType,
|
package/lib/List/ListItem.js
CHANGED
|
@@ -5,14 +5,12 @@ 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 _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
11
11
|
|
|
12
12
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
13
13
|
|
|
14
|
-
var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
|
|
15
|
-
|
|
16
14
|
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
17
15
|
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -25,6 +23,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
25
23
|
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
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
|
+
|
|
28
30
|
const selectBulletStyles = ({
|
|
29
31
|
itemBulletWidth,
|
|
30
32
|
itemBulletHeight,
|
|
@@ -53,6 +55,12 @@ const selectItemIconTokens = ({
|
|
|
53
55
|
color: itemIconColor
|
|
54
56
|
});
|
|
55
57
|
|
|
58
|
+
const selectCommonIconStyles = ({
|
|
59
|
+
iconMarginTop
|
|
60
|
+
}) => ({
|
|
61
|
+
marginTop: iconMarginTop
|
|
62
|
+
});
|
|
63
|
+
|
|
56
64
|
const selectSideItemContainerStyles = ({
|
|
57
65
|
listGutter
|
|
58
66
|
}) => ({
|
|
@@ -92,7 +100,7 @@ const selectDividerStyles = ({
|
|
|
92
100
|
*/
|
|
93
101
|
|
|
94
102
|
|
|
95
|
-
const ListItem = ({
|
|
103
|
+
const ListItem = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
96
104
|
tokens,
|
|
97
105
|
variant,
|
|
98
106
|
icon,
|
|
@@ -101,7 +109,7 @@ const ListItem = ({
|
|
|
101
109
|
showDivider,
|
|
102
110
|
children,
|
|
103
111
|
isLastItem
|
|
104
|
-
}) => {
|
|
112
|
+
}, ref) => {
|
|
105
113
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('List', tokens, variant);
|
|
106
114
|
const itemStyles = selectItemStyles(themeTokens);
|
|
107
115
|
const itemBlockStyles = selectItemBlockStyles(themeTokens);
|
|
@@ -109,6 +117,7 @@ const ListItem = ({
|
|
|
109
117
|
const itemBulletContainerStyles = selectBulletContainerStyles(themeTokens);
|
|
110
118
|
const itemBulletStyles = selectBulletStyles(themeTokens);
|
|
111
119
|
const iconTokens = selectItemIconTokens(themeTokens);
|
|
120
|
+
const commonIconStyles = selectCommonIconStyles(themeTokens);
|
|
112
121
|
const sideItemContainerStyles = selectSideItemContainerStyles(themeTokens);
|
|
113
122
|
|
|
114
123
|
const accessibilityRole = _Platform.default.select({
|
|
@@ -116,26 +125,12 @@ const ListItem = ({
|
|
|
116
125
|
default: 'item'
|
|
117
126
|
});
|
|
118
127
|
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const renderItem = () => {
|
|
128
|
-
if (areChildrenStrings()) {
|
|
129
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
130
|
-
style: itemStyles,
|
|
131
|
-
children: children
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
136
|
-
children: children
|
|
137
|
-
});
|
|
138
|
-
};
|
|
128
|
+
const renderItem = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
129
|
+
style: staticStyles.wrap,
|
|
130
|
+
children: (0, _utils.wrapStringsInText)(children, {
|
|
131
|
+
style: itemStyles
|
|
132
|
+
})
|
|
133
|
+
});
|
|
139
134
|
/**
|
|
140
135
|
* Function responsible returning styling, in case the item is the last shouldn't
|
|
141
136
|
* add extra margin on the bottom, if "showDivider" is true it should add a divider
|
|
@@ -166,12 +161,10 @@ const ListItem = ({
|
|
|
166
161
|
|
|
167
162
|
if (icon) {
|
|
168
163
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
169
|
-
style: [sideItemContainerStyles,
|
|
164
|
+
style: [sideItemContainerStyles, commonIconStyles],
|
|
170
165
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
color: iconColor || iconTokens.color
|
|
174
|
-
}
|
|
166
|
+
size: iconSize || iconTokens.size,
|
|
167
|
+
color: iconColor || iconTokens.color
|
|
175
168
|
})
|
|
176
169
|
});
|
|
177
170
|
}
|
|
@@ -186,18 +179,20 @@ const ListItem = ({
|
|
|
186
179
|
};
|
|
187
180
|
|
|
188
181
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
182
|
+
ref: ref,
|
|
189
183
|
style: [staticStyles.itemContainer, getContainerStyle()],
|
|
190
184
|
accessibilityRole: accessibilityRole,
|
|
191
185
|
children: [renderMarker(), renderItem()]
|
|
192
186
|
});
|
|
193
|
-
};
|
|
187
|
+
});
|
|
188
|
+
ListItem.displayName = 'ListItem';
|
|
194
189
|
|
|
195
190
|
const staticStyles = _StyleSheet.default.create({
|
|
196
191
|
itemContainer: {
|
|
197
192
|
flexDirection: 'row'
|
|
198
193
|
},
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
wrap: {
|
|
195
|
+
flex: 1
|
|
201
196
|
}
|
|
202
197
|
});
|
|
203
198
|
|
package/lib/List/index.js
CHANGED
|
@@ -3,11 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "ListBase", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _List.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ListItem", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ListItem.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
6
18
|
exports.default = void 0;
|
|
7
19
|
|
|
8
20
|
var _List = _interopRequireDefault(require("./List"));
|
|
9
21
|
|
|
22
|
+
var _ListItem = _interopRequireDefault(require("./ListItem"));
|
|
23
|
+
|
|
10
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
25
|
|
|
26
|
+
_List.default.Item = _ListItem.default;
|
|
12
27
|
var _default = _List.default;
|
|
13
28
|
exports.default = _default;
|
package/lib/Modal/Modal.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 _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
11
11
|
|
|
@@ -33,6 +33,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
33
33
|
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
35
|
|
|
36
|
+
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); }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
36
40
|
const selectContainerStyles = ({
|
|
37
41
|
containerPaddingLeft,
|
|
38
42
|
containerPaddingRight,
|
|
@@ -108,7 +112,7 @@ const selectCloseIconProps = ({
|
|
|
108
112
|
*/
|
|
109
113
|
|
|
110
114
|
|
|
111
|
-
const Modal = ({
|
|
115
|
+
const Modal = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
112
116
|
children,
|
|
113
117
|
isOpen,
|
|
114
118
|
onClose,
|
|
@@ -116,7 +120,7 @@ const Modal = ({
|
|
|
116
120
|
tokens,
|
|
117
121
|
variant,
|
|
118
122
|
copy
|
|
119
|
-
}) => {
|
|
123
|
+
}, ref) => {
|
|
120
124
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
121
125
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Modal', tokens, variant, {
|
|
122
126
|
viewport,
|
|
@@ -153,6 +157,7 @@ const Modal = ({
|
|
|
153
157
|
pointerEvents: "box-none" // don't capture backdrop press events
|
|
154
158
|
,
|
|
155
159
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
160
|
+
ref: ref,
|
|
156
161
|
style: [staticStyles.modal, selectModalStyles(themeTokens)],
|
|
157
162
|
onKeyUp: handleKeyUp,
|
|
158
163
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
@@ -175,8 +180,8 @@ const Modal = ({
|
|
|
175
180
|
})]
|
|
176
181
|
})
|
|
177
182
|
});
|
|
178
|
-
};
|
|
179
|
-
|
|
183
|
+
});
|
|
184
|
+
Modal.displayName = 'Modal';
|
|
180
185
|
Modal.propTypes = {
|
|
181
186
|
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)]),
|
|
182
187
|
copy: _utils.copyPropTypes,
|
|
@@ -77,7 +77,7 @@ const selectDismissButtonContainerStyles = ({
|
|
|
77
77
|
* - Show system notifications at the top of the page, below the navigation, and expands the full-width of the viewport
|
|
78
78
|
* - When showing multiple notifications, show them in order of importance from top to bottom
|
|
79
79
|
* - Use variants to visually show the type of message contained within the Notification.
|
|
80
|
-
* The icon and colour will indicate meaning and importance
|
|
80
|
+
* - The icon and colour will indicate meaning and importance
|
|
81
81
|
*
|
|
82
82
|
* ### Variants
|
|
83
83
|
* - Use `variant.style` to set the visual style of the notification
|
|
@@ -118,14 +118,14 @@ const selectDismissButtonContainerStyles = ({
|
|
|
118
118
|
*/
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
const Notification = ({
|
|
121
|
+
const Notification = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
122
122
|
children,
|
|
123
123
|
system,
|
|
124
124
|
dismissible,
|
|
125
125
|
copy = 'en',
|
|
126
126
|
tokens,
|
|
127
127
|
variant
|
|
128
|
-
}) => {
|
|
128
|
+
}, ref) => {
|
|
129
129
|
const [isDismissed, setIsDismissed] = (0, _react.useState)(false);
|
|
130
130
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Notification', tokens, variant, {
|
|
131
131
|
system
|
|
@@ -153,6 +153,7 @@ const Notification = ({
|
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
156
|
+
ref: ref,
|
|
156
157
|
style: [staticStyles.container, selectContainerStyles(themeTokens)],
|
|
157
158
|
children: [IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
158
159
|
style: selectIconContainerStyles(themeTokens),
|
|
@@ -175,12 +176,27 @@ const Notification = ({
|
|
|
175
176
|
})
|
|
176
177
|
})]
|
|
177
178
|
});
|
|
178
|
-
};
|
|
179
|
-
|
|
179
|
+
});
|
|
180
|
+
Notification.displayName = 'Notification';
|
|
180
181
|
Notification.propTypes = {
|
|
182
|
+
/**
|
|
183
|
+
* Content of the `Notification`.
|
|
184
|
+
*/
|
|
181
185
|
children: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node, _propTypes.default.func]),
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Use `system` prop to set the visual style of the notification and denote an announcement from the system or application
|
|
189
|
+
*/
|
|
182
190
|
system: _propTypes.default.bool,
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Use the `dismissible` prop to allow users to dismiss the Notification at any time.
|
|
194
|
+
*/
|
|
183
195
|
dismissible: _propTypes.default.bool,
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Select english or french copy for the accessible label of the dismiss button.
|
|
199
|
+
*/
|
|
184
200
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), _propTypes.default.shape({
|
|
185
201
|
dismiss: _propTypes.default.string
|
|
186
202
|
})]),
|
|
@@ -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,7 +23,11 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
function
|
|
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
|
+
|
|
30
|
+
const PageButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
27
31
|
label,
|
|
28
32
|
onPress,
|
|
29
33
|
href,
|
|
@@ -32,7 +36,7 @@ function PageButton({
|
|
|
32
36
|
variant,
|
|
33
37
|
tokens,
|
|
34
38
|
...props
|
|
35
|
-
}) {
|
|
39
|
+
}, ref) => {
|
|
36
40
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('PaginationPageButton', tokens, variant);
|
|
37
41
|
const getCopy = (0, _useCopy.default)({
|
|
38
42
|
dictionary: _dictionary.default,
|
|
@@ -49,8 +53,8 @@ function PageButton({
|
|
|
49
53
|
key: 'active-item'
|
|
50
54
|
} : {};
|
|
51
55
|
const accessibilityRole = href !== undefined ? 'link' : 'button';
|
|
52
|
-
const activeLabel = isActive ?
|
|
53
|
-
const accessibilityLabel =
|
|
56
|
+
const activeLabel = isActive ? ` ${getCopy('currentLabel')}` : '';
|
|
57
|
+
const accessibilityLabel = `${getCopy('goToLabel')} ${label}${activeLabel}`;
|
|
54
58
|
|
|
55
59
|
const {
|
|
56
60
|
hrefAttrs,
|
|
@@ -65,20 +69,21 @@ function PageButton({
|
|
|
65
69
|
hrefAttrs,
|
|
66
70
|
...rest
|
|
67
71
|
};
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
|
|
73
|
+
ref: ref,
|
|
74
|
+
...buttonProps,
|
|
69
75
|
tokens: getButtonTokens,
|
|
70
76
|
...activeProps,
|
|
71
77
|
children: label
|
|
72
78
|
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
PageButton.propTypes = {
|
|
79
|
+
});
|
|
80
|
+
PageButton.displayName = 'PageButton';
|
|
81
|
+
PageButton.propTypes = { ..._utils.linkProps.types,
|
|
76
82
|
label: _propTypes.default.string,
|
|
77
83
|
isActive: _propTypes.default.bool,
|
|
78
84
|
copy: _utils.copyPropTypes,
|
|
79
85
|
variant: _utils.variantProp.propType,
|
|
80
|
-
tokens: (0, _utils.getTokensPropType)('PaginationPageButton')
|
|
81
|
-
..._utils.linkProps.types
|
|
86
|
+
tokens: (0, _utils.getTokensPropType)('PaginationPageButton')
|
|
82
87
|
};
|
|
83
88
|
var _default = PageButton;
|
|
84
89
|
exports.default = _default;
|
|
@@ -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 _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
11
11
|
|
|
@@ -31,6 +31,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
34
|
+
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); }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
34
38
|
const selectTextStyles = ({
|
|
35
39
|
color,
|
|
36
40
|
fontName,
|
|
@@ -45,14 +49,14 @@ const selectTextStyles = ({
|
|
|
45
49
|
lineHeight
|
|
46
50
|
});
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
const Pagination = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
49
53
|
children,
|
|
50
54
|
copy = 'en',
|
|
51
55
|
variant,
|
|
52
56
|
tokens,
|
|
53
57
|
sideButtonVariant,
|
|
54
58
|
sideButtonTokens
|
|
55
|
-
}) {
|
|
59
|
+
}, ref) => {
|
|
56
60
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
57
61
|
const {
|
|
58
62
|
truncateAbove,
|
|
@@ -91,7 +95,7 @@ function Pagination({
|
|
|
91
95
|
variant: sideButtonVariant,
|
|
92
96
|
tokens: sideButtonTokens
|
|
93
97
|
}), ...items.map((child, itemIndex) => {
|
|
94
|
-
const buttonLabel =
|
|
98
|
+
const buttonLabel = `${itemIndex + 1}`;
|
|
95
99
|
const itemProps = getItemProps(itemIndex);
|
|
96
100
|
|
|
97
101
|
if (shouldRenderButton(itemIndex)) {
|
|
@@ -118,14 +122,15 @@ function Pagination({
|
|
|
118
122
|
})];
|
|
119
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
120
124
|
style: staticStyles.container,
|
|
125
|
+
ref: ref,
|
|
121
126
|
children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
|
|
122
|
-
.map((element, index) => [element,
|
|
127
|
+
.map((element, index) => [element, `page-${index + 1}`]).filter(([element]) => element !== null).map(([element, key]) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
123
128
|
right: gap,
|
|
124
129
|
children: element
|
|
125
130
|
}, key))
|
|
126
131
|
});
|
|
127
|
-
}
|
|
128
|
-
|
|
132
|
+
});
|
|
133
|
+
_PageButton.default.displayName = 'PageButton';
|
|
129
134
|
Pagination.PageButton = _PageButton.default;
|
|
130
135
|
Pagination.propTypes = {
|
|
131
136
|
children: (0, _utils.componentPropType)('PageButton'),
|
|
@@ -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 _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
|
|
11
11
|
|
|
@@ -29,6 +29,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
32
36
|
const selectIconTokens = ({
|
|
33
37
|
color,
|
|
34
38
|
iconSize,
|
|
@@ -45,8 +49,7 @@ const directionToSide = {
|
|
|
45
49
|
previous: 'left',
|
|
46
50
|
next: 'right'
|
|
47
51
|
};
|
|
48
|
-
|
|
49
|
-
function SideButton({
|
|
52
|
+
const SideButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
50
53
|
direction = 'previous',
|
|
51
54
|
onPress,
|
|
52
55
|
href,
|
|
@@ -54,7 +57,7 @@ function SideButton({
|
|
|
54
57
|
variant,
|
|
55
58
|
tokens,
|
|
56
59
|
...props
|
|
57
|
-
}) {
|
|
60
|
+
}, ref) => {
|
|
58
61
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
59
62
|
const buttonVariant = {
|
|
60
63
|
direction,
|
|
@@ -92,7 +95,9 @@ function SideButton({
|
|
|
92
95
|
hrefAttrs,
|
|
93
96
|
...rest
|
|
94
97
|
};
|
|
95
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
|
|
99
|
+
ref: ref,
|
|
100
|
+
...buttonProps,
|
|
96
101
|
tokens: getButtonTokens,
|
|
97
102
|
children: ({
|
|
98
103
|
textStyles,
|
|
@@ -113,8 +118,8 @@ function SideButton({
|
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
120
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
121
|
+
});
|
|
122
|
+
SideButton.displayName = 'SideButton';
|
|
118
123
|
SideButton.propTypes = {
|
|
119
124
|
direction: _propTypes.default.oneOf(['previous', 'next']),
|
|
120
125
|
copy: _utils.copyPropTypes,
|
|
@@ -20,7 +20,7 @@ function usePagination({
|
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
const getItemProps = index => {
|
|
23
|
-
var _items$index
|
|
23
|
+
var _items$index;
|
|
24
24
|
|
|
25
25
|
const {
|
|
26
26
|
onPress,
|
|
@@ -28,7 +28,7 @@ function usePagination({
|
|
|
28
28
|
hrefAttrs,
|
|
29
29
|
variant,
|
|
30
30
|
tokens
|
|
31
|
-
} = (
|
|
31
|
+
} = ((_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) ?? {};
|
|
32
32
|
return {
|
|
33
33
|
onPress,
|
|
34
34
|
href,
|
package/lib/Progress/Progress.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
|
|
|
@@ -21,6 +21,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
24
28
|
const selectProgressStyles = ({
|
|
25
29
|
backgroundColor,
|
|
26
30
|
borderWidth,
|
|
@@ -65,20 +69,21 @@ const selectProgressStyles = ({
|
|
|
65
69
|
*/
|
|
66
70
|
|
|
67
71
|
|
|
68
|
-
const Progress = ({
|
|
72
|
+
const Progress = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
69
73
|
children,
|
|
70
74
|
tokens,
|
|
71
75
|
variant,
|
|
72
76
|
...rest
|
|
73
|
-
}) => {
|
|
77
|
+
}, ref) => {
|
|
74
78
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Progress', tokens, variant);
|
|
75
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
80
|
+
ref: ref,
|
|
76
81
|
style: selectProgressStyles(themeTokens),
|
|
77
82
|
..._propTypes2.a11yProps.select(rest),
|
|
78
83
|
children: children
|
|
79
84
|
});
|
|
80
|
-
};
|
|
81
|
-
|
|
85
|
+
});
|
|
86
|
+
Progress.displayName = 'Progress';
|
|
82
87
|
Progress.propTypes = {
|
|
83
88
|
/**
|
|
84
89
|
* Use the `children` prop to supply one or several `ProgressBar`s.
|