@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/Icon/Icon.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.iconComponentPropTypes = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
11
11
|
|
|
@@ -21,13 +21,18 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
|
|
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
|
+
|
|
28
|
+
const Icon = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
25
29
|
icon: IconComponent,
|
|
26
30
|
accessibilityLabel,
|
|
27
31
|
variant,
|
|
28
32
|
tokens,
|
|
29
|
-
scalesWithText = false
|
|
30
|
-
|
|
33
|
+
scalesWithText = false,
|
|
34
|
+
dataSet
|
|
35
|
+
}, ref) => {
|
|
31
36
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Icon', tokens, variant);
|
|
32
37
|
const size = scalesWithText ? (0, _utils.scaleWithText)(themeTokens.size) : themeTokens.size;
|
|
33
38
|
const iconContent = /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
@@ -35,18 +40,20 @@ const Icon = ({
|
|
|
35
40
|
size: size,
|
|
36
41
|
color: themeTokens.color
|
|
37
42
|
});
|
|
38
|
-
return _Platform.default.OS === 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default
|
|
39
|
-
|
|
43
|
+
return _Platform.default.OS === 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
44
|
+
ref: ref // eslint-disable-next-line react-native/no-inline-styles
|
|
45
|
+
,
|
|
40
46
|
style: {
|
|
41
47
|
// TODO: systematise animations.
|
|
42
48
|
// https://github.com/telus/universal-design-system/issues/487
|
|
43
49
|
transition: 'transform 200ms, color 200ms',
|
|
44
|
-
transform: [themeTokens.scale ?
|
|
50
|
+
transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' ')
|
|
45
51
|
},
|
|
52
|
+
dataSet: dataSet,
|
|
46
53
|
children: iconContent
|
|
47
54
|
}) : iconContent;
|
|
48
|
-
};
|
|
49
|
-
|
|
55
|
+
});
|
|
56
|
+
Icon.displayName = 'Icon';
|
|
50
57
|
const iconComponentPropTypes = {
|
|
51
58
|
variant: _utils.variantProp.propType,
|
|
52
59
|
tokens: (0, _utils.getTokensPropType)('Icon'),
|
package/lib/Icon/IconText.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,12 +21,12 @@ var _utils = require("../utils");
|
|
|
21
21
|
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
24
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); }
|
|
25
27
|
|
|
26
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; }
|
|
27
29
|
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
30
|
/**
|
|
31
31
|
* Returns an icon and some text with a sized gap between them. This is a utility component
|
|
32
32
|
* intended for use when creating components, not intended for use in applications on its own.
|
|
@@ -35,16 +35,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
35
35
|
* - inline within a <Text> element
|
|
36
36
|
* - within a container with `flexDirection: 'row'`
|
|
37
37
|
*/
|
|
38
|
-
const IconText = ({
|
|
38
|
+
const IconText = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
39
39
|
space,
|
|
40
40
|
iconPosition = 'left',
|
|
41
41
|
icon: IconComponent,
|
|
42
42
|
iconProps,
|
|
43
43
|
children
|
|
44
|
-
}) => {
|
|
44
|
+
}, ref) => {
|
|
45
45
|
var _iconProps$tokens;
|
|
46
46
|
|
|
47
47
|
const iconContent = IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
48
|
+
ref: ref,
|
|
48
49
|
icon: IconComponent,
|
|
49
50
|
scalesWithText: true,
|
|
50
51
|
...iconProps
|
|
@@ -64,8 +65,8 @@ const IconText = ({
|
|
|
64
65
|
space,
|
|
65
66
|
direction: 'row'
|
|
66
67
|
});
|
|
67
|
-
};
|
|
68
|
-
|
|
68
|
+
});
|
|
69
|
+
IconText.displayName = 'IconText';
|
|
69
70
|
IconText.propTypes = {
|
|
70
71
|
/**
|
|
71
72
|
* Amount of space to separate the text content and icon. Uses the themes's spacing scale
|
|
@@ -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
|
|
|
@@ -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 selectOuterStyle = ({
|
|
33
37
|
backgroundColor,
|
|
34
38
|
borderRadius,
|
|
@@ -73,7 +77,7 @@ const selectInnerStyle = ({
|
|
|
73
77
|
*/
|
|
74
78
|
|
|
75
79
|
|
|
76
|
-
const IconButton = ({
|
|
80
|
+
const IconButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
77
81
|
tokens,
|
|
78
82
|
variant,
|
|
79
83
|
icon: IconComponent,
|
|
@@ -82,7 +86,7 @@ const IconButton = ({
|
|
|
82
86
|
onPress,
|
|
83
87
|
accessibilityRole = href ? 'link' : 'button',
|
|
84
88
|
...rest
|
|
85
|
-
}) => {
|
|
89
|
+
}, ref) => {
|
|
86
90
|
const a11y = _propTypes2.a11yProps.select({ ...rest,
|
|
87
91
|
accessibilityRole
|
|
88
92
|
});
|
|
@@ -97,6 +101,7 @@ const IconButton = ({
|
|
|
97
101
|
const getOuterStyle = pressableState => selectOuterStyle(getTokens((0, _utils.resolvePressableState)(pressableState)));
|
|
98
102
|
|
|
99
103
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
104
|
+
ref: ref,
|
|
100
105
|
href: href,
|
|
101
106
|
onPress: handlePress,
|
|
102
107
|
hrefAttrs: hrefAttrs,
|
|
@@ -114,8 +119,8 @@ const IconButton = ({
|
|
|
114
119
|
});
|
|
115
120
|
}
|
|
116
121
|
});
|
|
117
|
-
};
|
|
118
|
-
|
|
122
|
+
});
|
|
123
|
+
IconButton.displayName = 'IconButton';
|
|
119
124
|
IconButton.propTypes = { ..._propTypes2.a11yProps.types,
|
|
120
125
|
variant: _utils.variantProp.propType,
|
|
121
126
|
tokens: (0, _utils.getTokensPropType)('IconButton'),
|
|
@@ -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
|
|
|
@@ -27,6 +27,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
30
34
|
const selectLabelStyles = tokens => (0, _ThemeProvider.applyTextStyles)((0, _utils.selectTokens)('Typography', tokens));
|
|
31
35
|
|
|
32
36
|
const selectHintStyles = ({
|
|
@@ -49,7 +53,7 @@ const selectGapStyles = ({
|
|
|
49
53
|
marginRight: gap
|
|
50
54
|
});
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
const InputLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
53
57
|
label,
|
|
54
58
|
forId,
|
|
55
59
|
hint,
|
|
@@ -58,11 +62,12 @@ function InputLabel({
|
|
|
58
62
|
tooltip,
|
|
59
63
|
tokens,
|
|
60
64
|
variant
|
|
61
|
-
}) {
|
|
65
|
+
}, ref) => {
|
|
62
66
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('InputLabel', tokens, variant);
|
|
63
67
|
const hasTooltip = tooltip !== undefined;
|
|
64
68
|
const isHintInline = hintPosition === 'inline';
|
|
65
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
70
|
+
ref: ref,
|
|
66
71
|
style: [staticStyles.container, !isHintInline && staticStyles.containerWithHintBelow],
|
|
67
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
68
73
|
style: [selectLabelStyles(themeTokens), selectGapStyles(themeTokens), staticStyles.label],
|
|
@@ -85,14 +90,37 @@ function InputLabel({
|
|
|
85
90
|
children: hint
|
|
86
91
|
})]
|
|
87
92
|
});
|
|
88
|
-
}
|
|
89
|
-
|
|
93
|
+
});
|
|
94
|
+
InputLabel.displayName = 'InputLabel';
|
|
90
95
|
InputLabel.propTypes = {
|
|
96
|
+
/**
|
|
97
|
+
* The input label.
|
|
98
|
+
*/
|
|
91
99
|
label: _propTypes.default.string.isRequired,
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The id attribute of the input which this label refers to.
|
|
103
|
+
*/
|
|
92
104
|
forId: _propTypes.default.string,
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* A short description of the expected input.
|
|
108
|
+
*/
|
|
93
109
|
hint: _propTypes.default.string,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Position of the hint relative to label. Use `below` to display a larger hint below the label.
|
|
113
|
+
*/
|
|
94
114
|
hintPosition: _propTypes.default.oneOf(['inline', 'below']),
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The id attribute passed down to the hint element.
|
|
118
|
+
*/
|
|
95
119
|
hintId: _propTypes.default.string,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
|
|
123
|
+
*/
|
|
96
124
|
tooltip: _propTypes.default.string,
|
|
97
125
|
tokens: (0, _utils.getTokensPropType)('InputLabel'),
|
|
98
126
|
variant: _utils.variantProp.propType
|
|
@@ -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
|
|
|
@@ -13,19 +13,29 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
const LabelContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
17
21
|
children,
|
|
18
22
|
forId
|
|
19
|
-
}) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var _default = LabelContent;
|
|
27
|
-
exports.default = _default;
|
|
23
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
24
|
+
ref: ref,
|
|
25
|
+
htmlFor: forId,
|
|
26
|
+
style: staticStyles.inheritCursor,
|
|
27
|
+
children: children
|
|
28
|
+
}));
|
|
29
|
+
LabelContent.displayName = 'LabelContent';
|
|
28
30
|
LabelContent.propTypes = {
|
|
29
31
|
children: _propTypes.default.string,
|
|
30
32
|
forId: _propTypes.default.string
|
|
31
|
-
};
|
|
33
|
+
}; // Note that <label> is not React Native, so we can't use `StyleSheet.create` here
|
|
34
|
+
|
|
35
|
+
const staticStyles = {
|
|
36
|
+
inheritCursor: {
|
|
37
|
+
cursor: 'inherit'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var _default = LabelContent;
|
|
41
|
+
exports.default = _default;
|
|
@@ -5,12 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
8
22
|
// Since there's no equivalent for web's <label> element we're simply rendering whatever is passed to this component.
|
|
9
|
-
|
|
23
|
+
const LabelContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
10
24
|
children
|
|
11
|
-
}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
}, ref) => ref ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
children: children
|
|
28
|
+
}) : children);
|
|
29
|
+
LabelContent.displayName = 'LabelContent';
|
|
30
|
+
LabelContent.propTypes = {
|
|
31
|
+
children: _propTypes.default.node
|
|
32
|
+
};
|
|
15
33
|
var _default = LabelContent;
|
|
16
34
|
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 _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 InputSupports = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
27
31
|
children,
|
|
28
32
|
label,
|
|
29
33
|
hint,
|
|
@@ -31,7 +35,7 @@ function InputSupports({
|
|
|
31
35
|
feedback,
|
|
32
36
|
tooltip,
|
|
33
37
|
validation
|
|
34
|
-
}) {
|
|
38
|
+
}, ref) => {
|
|
35
39
|
const {
|
|
36
40
|
space
|
|
37
41
|
} = (0, _ThemeProvider.useThemeTokens)('InputSupports');
|
|
@@ -48,6 +52,7 @@ function InputSupports({
|
|
|
48
52
|
});
|
|
49
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_StackView.default, {
|
|
50
54
|
space: space,
|
|
55
|
+
ref: ref,
|
|
51
56
|
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
|
|
52
57
|
label: label,
|
|
53
58
|
hint: hint,
|
|
@@ -64,8 +69,8 @@ function InputSupports({
|
|
|
64
69
|
validation: validation
|
|
65
70
|
})]
|
|
66
71
|
});
|
|
67
|
-
}
|
|
68
|
-
|
|
72
|
+
});
|
|
73
|
+
InputSupports.displayName = 'InputSupports';
|
|
69
74
|
InputSupports.propTypes = {
|
|
70
75
|
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
71
76
|
|
package/lib/Link/ChevronLink.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,19 +19,24 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
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
|
* `ChevronLink` is a convenience wrapper around the `Link` component to enable "directional" links.
|
|
24
28
|
* It effectively pre-binds left and right icons, and a directional translation of the icon on hover.
|
|
25
29
|
*
|
|
26
30
|
* ChevronLink is not intended to be deeply themable; variants passed to ChevronLink are forwarded to Link.
|
|
27
31
|
*/
|
|
28
|
-
const ChevronLink = ({
|
|
32
|
+
const ChevronLink = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
29
33
|
direction = 'right',
|
|
30
34
|
children,
|
|
31
35
|
tokens,
|
|
32
36
|
variant,
|
|
37
|
+
dataSet,
|
|
33
38
|
...linkProps
|
|
34
|
-
}) => {
|
|
39
|
+
}, ref) => {
|
|
35
40
|
const getChevronTokens = (0, _ThemeProvider.useThemeTokensCallback)('ChevronLink', tokens, variant);
|
|
36
41
|
|
|
37
42
|
const applyChevronTokens = linkState => {
|
|
@@ -51,10 +56,12 @@ const ChevronLink = ({
|
|
|
51
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkBase.default, { ...linkProps,
|
|
52
57
|
iconPosition: direction,
|
|
53
58
|
tokens: getTokens,
|
|
59
|
+
dataSet: dataSet,
|
|
60
|
+
ref: ref,
|
|
54
61
|
children: children
|
|
55
62
|
});
|
|
56
|
-
};
|
|
57
|
-
|
|
63
|
+
});
|
|
64
|
+
ChevronLink.displayName = 'ChevronLink';
|
|
58
65
|
ChevronLink.propTypes = { ..._LinkBase.default.propTypes,
|
|
59
66
|
tokens: (0, _utils.getTokensPropType)('ChevronLink', 'Link'),
|
|
60
67
|
direction: _propTypes.default.oneOf(['left', 'right'])
|
|
@@ -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 _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
|
|
11
11
|
|
|
@@ -15,6 +15,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
18
22
|
/**
|
|
19
23
|
* @typedef {import('react-native').PressableProps} PressableProps
|
|
20
24
|
*/
|
|
@@ -29,15 +33,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
29
33
|
*/
|
|
30
34
|
// React Native exports prop Types but not propTypes, use JSDoc types here rather than duplicate RN
|
|
31
35
|
// eslint-disable-next-line react/prop-types
|
|
32
|
-
const InlinePressable = ({
|
|
36
|
+
const InlinePressable = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
33
37
|
children,
|
|
34
38
|
style,
|
|
35
39
|
...props
|
|
36
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
40
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
41
|
+
ref: ref,
|
|
37
42
|
style: pressState => [staticStyles.inline, typeof style === 'function' ? style(pressState) : style],
|
|
38
43
|
...props,
|
|
39
44
|
children: pressState => typeof children === 'function' ? children(pressState) : children
|
|
40
|
-
});
|
|
45
|
+
}));
|
|
46
|
+
InlinePressable.displayName = 'InlinePressable';
|
|
41
47
|
|
|
42
48
|
const staticStyles = _StyleSheet.default.create({
|
|
43
49
|
inline: {
|
|
@@ -57,12 +57,12 @@ const pressablePropsToTouchable = ({
|
|
|
57
57
|
// eslint-disable-next-line react/prop-types
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
const InlinePressable = ({
|
|
60
|
+
const InlinePressable = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
61
61
|
onPress,
|
|
62
62
|
children,
|
|
63
63
|
style,
|
|
64
64
|
...rest
|
|
65
|
-
}) => {
|
|
65
|
+
}, ref) => {
|
|
66
66
|
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
67
67
|
|
|
68
68
|
const handleFocus = () => setIsFocused(true);
|
|
@@ -89,13 +89,14 @@ const InlinePressable = ({
|
|
|
89
89
|
onPressOut: handlePressOut,
|
|
90
90
|
onFocus: handleFocus,
|
|
91
91
|
onBlur: handleBlur,
|
|
92
|
+
ref: ref,
|
|
92
93
|
...pressablePropsToTouchable(rest),
|
|
93
94
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
94
95
|
style: currentStyle,
|
|
95
96
|
children: typeof children === 'function' ? children(pressState) : children
|
|
96
97
|
})
|
|
97
98
|
});
|
|
98
|
-
};
|
|
99
|
-
|
|
99
|
+
});
|
|
100
|
+
InlinePressable.displayName = 'InlinePressable';
|
|
100
101
|
var _default = InlinePressable;
|
|
101
102
|
exports.default = _default;
|
package/lib/Link/Link.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 _ThemeProvider = require("../ThemeProvider");
|
|
11
11
|
|
|
@@ -15,24 +15,31 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
const Link = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
19
23
|
href,
|
|
20
24
|
children,
|
|
21
25
|
accessibilityRole = 'link',
|
|
22
26
|
variant = {},
|
|
23
27
|
tokens,
|
|
28
|
+
dataSet,
|
|
24
29
|
...linkProps
|
|
25
|
-
}) => {
|
|
30
|
+
}, ref) => {
|
|
26
31
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('Link', tokens, variant);
|
|
27
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkBase.default, {
|
|
28
33
|
href: href,
|
|
29
34
|
accessibilityRole: accessibilityRole,
|
|
30
35
|
tokens: getTokens,
|
|
36
|
+
ref: ref,
|
|
37
|
+
dataSet: dataSet,
|
|
31
38
|
...linkProps,
|
|
32
39
|
children: children
|
|
33
40
|
});
|
|
34
|
-
};
|
|
35
|
-
|
|
41
|
+
});
|
|
42
|
+
Link.displayName = 'Link';
|
|
36
43
|
Link.propTypes = _LinkBase.default.propTypes;
|
|
37
44
|
var _default = Link;
|
|
38
45
|
exports.default = _default;
|
package/lib/Link/LinkBase.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
|
|
|
@@ -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 selectOuterBorderStyles = ({
|
|
33
37
|
outerBorderColor,
|
|
34
38
|
outerBorderWidth,
|
|
@@ -114,7 +118,7 @@ const selectIconTokens = ({
|
|
|
114
118
|
*/
|
|
115
119
|
|
|
116
120
|
|
|
117
|
-
const LinkBase = ({
|
|
121
|
+
const LinkBase = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
118
122
|
href,
|
|
119
123
|
onPress,
|
|
120
124
|
icon,
|
|
@@ -124,8 +128,9 @@ const LinkBase = ({
|
|
|
124
128
|
tokens = {},
|
|
125
129
|
children,
|
|
126
130
|
accessibilityRole = 'link',
|
|
131
|
+
dataSet,
|
|
127
132
|
...props
|
|
128
|
-
}) => {
|
|
133
|
+
}, ref) => {
|
|
129
134
|
const {
|
|
130
135
|
hrefAttrs,
|
|
131
136
|
rest
|
|
@@ -149,6 +154,8 @@ const LinkBase = ({
|
|
|
149
154
|
|
|
150
155
|
const blockLeftStyle = _Platform.default.OS === 'web' && staticStyles.blockLeft;
|
|
151
156
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InlinePressable.default, { ...linkPropSet,
|
|
157
|
+
ref: ref,
|
|
158
|
+
dataSet: dataSet,
|
|
152
159
|
style: linkState => {
|
|
153
160
|
const themeTokens = resolveLinkTokens(linkState);
|
|
154
161
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens);
|
|
@@ -180,8 +187,8 @@ const LinkBase = ({
|
|
|
180
187
|
});
|
|
181
188
|
}
|
|
182
189
|
});
|
|
183
|
-
};
|
|
184
|
-
|
|
190
|
+
});
|
|
191
|
+
LinkBase.displayName = 'LinkBase';
|
|
185
192
|
LinkBase.propTypes = { ..._propTypes2.a11yProps.types,
|
|
186
193
|
..._propTypes2.linkProps.types,
|
|
187
194
|
tokens: (0, _propTypes2.getTokensPropType)('Link'),
|