@telus-uds/components-base 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -2
- package/component-docs.json +1322 -346
- package/lib/BaseProvider/index.js +5 -1
- package/lib/Button/ButtonBase.js +2 -1
- package/lib/Carousel/Carousel.js +18 -2
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +6 -7
- package/lib/List/List.js +11 -8
- package/lib/List/PressableListItemBase.js +5 -9
- package/lib/QuickLinks/QuickLinks.js +91 -0
- package/lib/QuickLinks/QuickLinksCard.js +47 -0
- package/lib/QuickLinks/QuickLinksItem.js +73 -0
- package/lib/QuickLinks/index.js +16 -0
- package/lib/Skeleton/Skeleton.js +18 -13
- package/lib/Skeleton/useSkeletonNativeAnimation.js +4 -2
- package/lib/Timeline/Timeline.js +193 -0
- package/lib/Timeline/index.js +13 -0
- package/lib/ToggleSwitch/ToggleSwitch.js +24 -19
- package/lib/index.js +28 -1
- package/lib/utils/props/a11yProps.js +50 -47
- package/lib-module/BaseProvider/index.js +4 -1
- package/lib-module/Button/ButtonBase.js +2 -1
- package/lib-module/Carousel/Carousel.js +16 -2
- package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +7 -6
- package/lib-module/List/List.js +12 -8
- package/lib-module/List/PressableListItemBase.js +6 -10
- package/lib-module/QuickLinks/QuickLinks.js +71 -0
- package/lib-module/QuickLinks/QuickLinksCard.js +33 -0
- package/lib-module/QuickLinks/QuickLinksItem.js +50 -0
- package/lib-module/QuickLinks/index.js +4 -0
- package/lib-module/Skeleton/Skeleton.js +15 -13
- package/lib-module/Skeleton/useSkeletonNativeAnimation.js +3 -2
- package/lib-module/Timeline/Timeline.js +174 -0
- package/lib-module/Timeline/index.js +2 -0
- package/lib-module/ToggleSwitch/ToggleSwitch.js +24 -19
- package/lib-module/index.js +4 -1
- package/lib-module/utils/props/a11yProps.js +50 -47
- package/package.json +8 -7
- package/src/BaseProvider/index.jsx +2 -1
- package/src/Button/ButtonBase.jsx +2 -2
- package/src/Carousel/Carousel.jsx +15 -2
- package/src/Carousel/CarouselTabs/CarouselTabs.jsx +5 -3
- package/src/List/List.jsx +9 -13
- package/src/List/PressableListItemBase.jsx +7 -9
- package/src/QuickLinks/QuickLinks.jsx +61 -0
- package/src/QuickLinks/QuickLinksCard.jsx +26 -0
- package/src/QuickLinks/QuickLinksItem.jsx +46 -0
- package/src/QuickLinks/index.js +6 -0
- package/src/Skeleton/Skeleton.jsx +25 -19
- package/src/Skeleton/useSkeletonNativeAnimation.js +3 -3
- package/src/Timeline/Timeline.jsx +148 -0
- package/src/Timeline/index.js +3 -0
- package/src/ToggleSwitch/ToggleSwitch.jsx +3 -3
- package/src/index.js +3 -0
- package/src/utils/props/a11yProps.js +61 -68
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
13
|
+
|
|
14
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
15
|
+
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
|
|
18
|
+
var _ViewportProvider = require("../ViewportProvider");
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
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
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
const selectDotStyles = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
dotWidth,
|
|
31
|
+
timelineColor,
|
|
32
|
+
dotBorderWidth,
|
|
33
|
+
dotColor
|
|
34
|
+
} = _ref;
|
|
35
|
+
return {
|
|
36
|
+
width: dotWidth,
|
|
37
|
+
height: dotWidth,
|
|
38
|
+
borderRadius: dotWidth / 2,
|
|
39
|
+
backgroundColor: dotColor,
|
|
40
|
+
borderWidth: dotBorderWidth,
|
|
41
|
+
borderColor: timelineColor
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const selectConnectorStyles = _ref2 => {
|
|
46
|
+
let {
|
|
47
|
+
timelineColor,
|
|
48
|
+
connectorHeight,
|
|
49
|
+
connectorWidth
|
|
50
|
+
} = _ref2;
|
|
51
|
+
return {
|
|
52
|
+
width: connectorWidth,
|
|
53
|
+
height: connectorHeight,
|
|
54
|
+
backgroundColor: timelineColor
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const selectTimelineContainerStyle = _ref3 => {
|
|
59
|
+
let {
|
|
60
|
+
timelineContainerDirection
|
|
61
|
+
} = _ref3;
|
|
62
|
+
return {
|
|
63
|
+
flexDirection: timelineContainerDirection
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const selectLineItemStyles = _ref4 => {
|
|
68
|
+
let {
|
|
69
|
+
lineItemAlign,
|
|
70
|
+
lineItemDirection,
|
|
71
|
+
lineItemMarginBottom,
|
|
72
|
+
lineItemMarginRight
|
|
73
|
+
} = _ref4;
|
|
74
|
+
return {
|
|
75
|
+
alignItems: lineItemAlign,
|
|
76
|
+
flexDirection: lineItemDirection,
|
|
77
|
+
marginBottom: lineItemMarginBottom,
|
|
78
|
+
marginRight: lineItemMarginRight,
|
|
79
|
+
overflow: 'hidden'
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const selectLineItemContainer = _ref5 => {
|
|
84
|
+
let {
|
|
85
|
+
lineItemContainerDirection,
|
|
86
|
+
lineContainerFlexSize
|
|
87
|
+
} = _ref5;
|
|
88
|
+
return {
|
|
89
|
+
flexDirection: lineItemContainerDirection,
|
|
90
|
+
flex: lineContainerFlexSize
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const selectItemContentStyles = (_ref6, isLastChild) => {
|
|
95
|
+
let {
|
|
96
|
+
itemContentFlexSize,
|
|
97
|
+
itemContentMarginBottom,
|
|
98
|
+
itemContentMarginRight
|
|
99
|
+
} = _ref6;
|
|
100
|
+
return {
|
|
101
|
+
flex: itemContentFlexSize,
|
|
102
|
+
marginBottom: !isLastChild && itemContentMarginBottom,
|
|
103
|
+
marginRight: !isLastChild && itemContentMarginRight
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
108
|
+
/**
|
|
109
|
+
* Timeline is a component that displays either a horizontal or vertical list of the
|
|
110
|
+
* children components passed by props
|
|
111
|
+
*
|
|
112
|
+
* ## Component API
|
|
113
|
+
*
|
|
114
|
+
* - `horizontal` In order to display the Component list horizontally
|
|
115
|
+
*
|
|
116
|
+
*
|
|
117
|
+
* ## A11y guidelines
|
|
118
|
+
* Timeline link supports all the common a11y props.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
const Timeline = /*#__PURE__*/(0, _react.forwardRef)((_ref7, ref) => {
|
|
122
|
+
let {
|
|
123
|
+
tokens,
|
|
124
|
+
variant = {},
|
|
125
|
+
children,
|
|
126
|
+
accessibilityLabel,
|
|
127
|
+
tag = 'ul',
|
|
128
|
+
childrenTag = 'li',
|
|
129
|
+
...rest
|
|
130
|
+
} = _ref7;
|
|
131
|
+
const viewport = (0, _ViewportProvider.useViewport)();
|
|
132
|
+
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Timeline', tokens, variant, {
|
|
133
|
+
viewport
|
|
134
|
+
});
|
|
135
|
+
const containerProps = { ...selectProps(rest),
|
|
136
|
+
...(0, _utils.getA11yPropsFromHtmlTag)(tag, rest.accessibilityRole || 'list'),
|
|
137
|
+
accessibilityLabel
|
|
138
|
+
};
|
|
139
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { ...containerProps,
|
|
140
|
+
ref: ref,
|
|
141
|
+
style: selectTimelineContainerStyle(themeTokens),
|
|
142
|
+
children: children.map((child, index) => {
|
|
143
|
+
var _child$props;
|
|
144
|
+
|
|
145
|
+
const childrenProps = { ...(0, _utils.getA11yPropsFromHtmlTag)(childrenTag, (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.accessibilityRole) || 'listitem')
|
|
146
|
+
};
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
148
|
+
style: selectLineItemContainer(themeTokens) // eslint-disable-next-line react/no-array-index-key
|
|
149
|
+
,
|
|
150
|
+
...childrenProps,
|
|
151
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
152
|
+
style: selectLineItemStyles(themeTokens),
|
|
153
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
154
|
+
style: selectDotStyles(themeTokens)
|
|
155
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
156
|
+
style: selectConnectorStyles(themeTokens)
|
|
157
|
+
})]
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
159
|
+
style: selectItemContentStyles(themeTokens, index + 1 === children.length),
|
|
160
|
+
children: child
|
|
161
|
+
})]
|
|
162
|
+
}, "timeline-".concat(index, "-").concat(child.displayName));
|
|
163
|
+
})
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
Timeline.displayName = 'Timeline';
|
|
167
|
+
Timeline.propTypes = { ...selectedSystemPropTypes,
|
|
168
|
+
tokens: (0, _utils.getTokensPropType)('Timeline'),
|
|
169
|
+
variant: _utils.variantProp.propType,
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* A list of components that will be rendered either horizontally or vertically
|
|
173
|
+
*/
|
|
174
|
+
children: _propTypes.default.arrayOf(_propTypes.default.node).isRequired,
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* A required accessibility label that needs to be passed to be used on List
|
|
178
|
+
* which is applied as normal for a React Native accessibilityLabel prop.
|
|
179
|
+
*/
|
|
180
|
+
accessibilityLabel: _propTypes.default.string.isRequired,
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Sets the HTML tag of the outer container and the children. By default `'li'` for the children
|
|
184
|
+
* and `'ul'` for the container
|
|
185
|
+
*
|
|
186
|
+
* If either `tag` or `childrenTag` is overridden, the other should be too, to avoid producing invalid HTML.
|
|
187
|
+
*
|
|
188
|
+
*/
|
|
189
|
+
tag: _propTypes.default.oneOf(_utils.layoutTags),
|
|
190
|
+
childrenTag: _propTypes.default.oneOf(_utils.layoutTags)
|
|
191
|
+
};
|
|
192
|
+
var _default = Timeline;
|
|
193
|
+
exports.default = _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _Timeline = _interopRequireDefault(require("./Timeline"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _Timeline.default;
|
|
13
|
+
exports.default = _default;
|
|
@@ -35,32 +35,39 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
35
35
|
|
|
36
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
37
|
|
|
38
|
-
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.focusHandlerProps, _utils.pressProps, _utils.viewProps]);
|
|
38
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.focusHandlerProps, _utils.pressProps, _utils.viewProps]); // We need to drop the icon before passing it to the `ButtonBase`, because it's
|
|
39
|
+
// being handled separately in this case
|
|
39
40
|
|
|
40
|
-
const selectButtonTokens =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const selectButtonTokens = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
icon: _,
|
|
44
|
+
...tokens
|
|
45
|
+
} = _ref;
|
|
46
|
+
return (0, _utils.selectTokens)('Button', { ...tokens,
|
|
47
|
+
// Width tokens are applied to our inner track. Disable Button width token so it wraps our track width.
|
|
48
|
+
width: null
|
|
49
|
+
});
|
|
50
|
+
}; // Map and rename icon-specific tokens to name used within Icon
|
|
44
51
|
|
|
45
52
|
|
|
46
|
-
const selectIconTokens =
|
|
53
|
+
const selectIconTokens = _ref2 => {
|
|
47
54
|
let {
|
|
48
55
|
iconSize,
|
|
49
56
|
iconColor
|
|
50
|
-
} =
|
|
57
|
+
} = _ref2;
|
|
51
58
|
return {
|
|
52
59
|
size: iconSize,
|
|
53
60
|
color: iconColor
|
|
54
61
|
};
|
|
55
62
|
};
|
|
56
63
|
|
|
57
|
-
const selectTrackStyles =
|
|
64
|
+
const selectTrackStyles = _ref3 => {
|
|
58
65
|
let {
|
|
59
66
|
trackBorderWidth,
|
|
60
67
|
trackBorderColor,
|
|
61
68
|
trackBorderRadius,
|
|
62
69
|
width
|
|
63
|
-
} =
|
|
70
|
+
} = _ref3;
|
|
64
71
|
return {
|
|
65
72
|
borderWidth: trackBorderWidth,
|
|
66
73
|
borderColor: trackBorderColor,
|
|
@@ -69,7 +76,7 @@ const selectTrackStyles = _ref2 => {
|
|
|
69
76
|
};
|
|
70
77
|
};
|
|
71
78
|
|
|
72
|
-
const selectSwitchStyles =
|
|
79
|
+
const selectSwitchStyles = _ref4 => {
|
|
73
80
|
let {
|
|
74
81
|
switchSize,
|
|
75
82
|
switchColor,
|
|
@@ -77,7 +84,7 @@ const selectSwitchStyles = _ref3 => {
|
|
|
77
84
|
switchBorderColor,
|
|
78
85
|
switchBorderRadius,
|
|
79
86
|
switchShadow
|
|
80
|
-
} =
|
|
87
|
+
} = _ref4;
|
|
81
88
|
return {
|
|
82
89
|
width: switchSize,
|
|
83
90
|
height: switchSize,
|
|
@@ -95,23 +102,23 @@ const selectSwitchStyles = _ref3 => {
|
|
|
95
102
|
};
|
|
96
103
|
};
|
|
97
104
|
|
|
98
|
-
const selectLabelStyles =
|
|
105
|
+
const selectLabelStyles = _ref5 => {
|
|
99
106
|
let {
|
|
100
107
|
labelMarginLeft
|
|
101
|
-
} =
|
|
108
|
+
} = _ref5;
|
|
102
109
|
return {
|
|
103
110
|
marginLeft: labelMarginLeft
|
|
104
111
|
};
|
|
105
112
|
};
|
|
106
113
|
|
|
107
|
-
const selectLabelTokens =
|
|
114
|
+
const selectLabelTokens = _ref6 => {
|
|
108
115
|
let {
|
|
109
116
|
labelColor,
|
|
110
117
|
labelFontName,
|
|
111
118
|
labelFontSize,
|
|
112
119
|
labelFontWeight,
|
|
113
120
|
labelLineHeight
|
|
114
|
-
} =
|
|
121
|
+
} = _ref6;
|
|
115
122
|
return {
|
|
116
123
|
color: labelColor,
|
|
117
124
|
fontName: labelFontName,
|
|
@@ -121,7 +128,7 @@ const selectLabelTokens = _ref5 => {
|
|
|
121
128
|
};
|
|
122
129
|
};
|
|
123
130
|
|
|
124
|
-
const ToggleSwitch = /*#__PURE__*/(0, _react.forwardRef)((
|
|
131
|
+
const ToggleSwitch = /*#__PURE__*/(0, _react.forwardRef)((_ref7, ref) => {
|
|
125
132
|
let {
|
|
126
133
|
copy = 'en',
|
|
127
134
|
value,
|
|
@@ -136,7 +143,7 @@ const ToggleSwitch = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
136
143
|
accessibilityRole = 'switch',
|
|
137
144
|
accessibilityLabel = label,
|
|
138
145
|
...rest
|
|
139
|
-
} =
|
|
146
|
+
} = _ref7;
|
|
140
147
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('ToggleSwitch', tokens, variant);
|
|
141
148
|
const themeTokens = getTokens();
|
|
142
149
|
const {
|
|
@@ -260,8 +267,6 @@ ToggleSwitch.propTypes = { ...selectedSystemPropTypes,
|
|
|
260
267
|
|
|
261
268
|
const staticStyles = _StyleSheet.default.create({
|
|
262
269
|
track: {
|
|
263
|
-
flexGrow: 1,
|
|
264
|
-
alignSelf: 'stretch',
|
|
265
270
|
flexDirection: 'row'
|
|
266
271
|
},
|
|
267
272
|
switch: {
|
package/lib/index.js
CHANGED
|
@@ -28,6 +28,7 @@ var _exportNames = {
|
|
|
28
28
|
Notification: true,
|
|
29
29
|
Pagination: true,
|
|
30
30
|
Progress: true,
|
|
31
|
+
QuickLinks: true,
|
|
31
32
|
Radio: true,
|
|
32
33
|
RadioCard: true,
|
|
33
34
|
Search: true,
|
|
@@ -40,6 +41,7 @@ var _exportNames = {
|
|
|
40
41
|
StepTracker: true,
|
|
41
42
|
Tabs: true,
|
|
42
43
|
Tags: true,
|
|
44
|
+
Timeline: true,
|
|
43
45
|
Tooltip: true,
|
|
44
46
|
TooltipButton: true,
|
|
45
47
|
Typography: true,
|
|
@@ -56,7 +58,8 @@ var _exportNames = {
|
|
|
56
58
|
getThemeTokens: true,
|
|
57
59
|
applyOuterBorder: true,
|
|
58
60
|
applyTextStyles: true,
|
|
59
|
-
applyShadowToken: true
|
|
61
|
+
applyShadowToken: true,
|
|
62
|
+
Portal: true
|
|
60
63
|
};
|
|
61
64
|
Object.defineProperty(exports, "A11yInfoProvider", {
|
|
62
65
|
enumerable: true,
|
|
@@ -202,6 +205,12 @@ Object.defineProperty(exports, "Pagination", {
|
|
|
202
205
|
return _Pagination.default;
|
|
203
206
|
}
|
|
204
207
|
});
|
|
208
|
+
Object.defineProperty(exports, "Portal", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return _portal.Portal;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
205
214
|
Object.defineProperty(exports, "PressableCardBase", {
|
|
206
215
|
enumerable: true,
|
|
207
216
|
get: function () {
|
|
@@ -214,6 +223,12 @@ Object.defineProperty(exports, "Progress", {
|
|
|
214
223
|
return _Progress.default;
|
|
215
224
|
}
|
|
216
225
|
});
|
|
226
|
+
Object.defineProperty(exports, "QuickLinks", {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
get: function () {
|
|
229
|
+
return _QuickLinks.default;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
217
232
|
Object.defineProperty(exports, "Radio", {
|
|
218
233
|
enumerable: true,
|
|
219
234
|
get: function () {
|
|
@@ -292,6 +307,12 @@ Object.defineProperty(exports, "ThemeProvider", {
|
|
|
292
307
|
return _ThemeProvider.default;
|
|
293
308
|
}
|
|
294
309
|
});
|
|
310
|
+
Object.defineProperty(exports, "Timeline", {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
get: function () {
|
|
313
|
+
return _Timeline.default;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
295
316
|
Object.defineProperty(exports, "Tooltip", {
|
|
296
317
|
enumerable: true,
|
|
297
318
|
get: function () {
|
|
@@ -495,6 +516,8 @@ var _Pagination = _interopRequireDefault(require("./Pagination"));
|
|
|
495
516
|
|
|
496
517
|
var _Progress = _interopRequireDefault(require("./Progress"));
|
|
497
518
|
|
|
519
|
+
var _QuickLinks = _interopRequireDefault(require("./QuickLinks"));
|
|
520
|
+
|
|
498
521
|
var _Radio = _interopRequireWildcard(require("./Radio"));
|
|
499
522
|
|
|
500
523
|
Object.keys(_Radio).forEach(function (key) {
|
|
@@ -569,6 +592,8 @@ Object.keys(_TextInput).forEach(function (key) {
|
|
|
569
592
|
});
|
|
570
593
|
});
|
|
571
594
|
|
|
595
|
+
var _Timeline = _interopRequireDefault(require("./Timeline"));
|
|
596
|
+
|
|
572
597
|
var _ToggleSwitch = require("./ToggleSwitch");
|
|
573
598
|
|
|
574
599
|
Object.keys(_ToggleSwitch).forEach(function (key) {
|
|
@@ -611,6 +636,8 @@ Object.keys(_utils).forEach(function (key) {
|
|
|
611
636
|
});
|
|
612
637
|
});
|
|
613
638
|
|
|
639
|
+
var _portal = require("@gorhom/portal");
|
|
640
|
+
|
|
614
641
|
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); }
|
|
615
642
|
|
|
616
643
|
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; }
|
|
@@ -48,55 +48,58 @@ const nativeA11yPropTypes = {
|
|
|
48
48
|
onAccessibilityEscape: _propTypes.default.func,
|
|
49
49
|
onAccessibilityTap: _propTypes.default.func
|
|
50
50
|
};
|
|
51
|
+
const a11yPropTypes = { ...nativeA11yPropTypes,
|
|
52
|
+
// React Native Web adds many a11y props that alias aria-* attributes
|
|
53
|
+
// Types based on https://necolas.github.io/react-native-web/docs/accessibility/
|
|
54
|
+
accessibilityActiveDescendant: _propTypes.default.string,
|
|
55
|
+
accessibilityAtomic: _propTypes.default.bool,
|
|
56
|
+
accessibilityAutoComplete: _propTypes.default.string,
|
|
57
|
+
accessibilityBusy: _propTypes.default.bool,
|
|
58
|
+
accessibilityChecked: _propTypes.default.oneOf([true, false, 'mixed']),
|
|
59
|
+
accessibilityColumnCount: _propTypes.default.number,
|
|
60
|
+
accessibilityColumnIndex: _propTypes.default.number,
|
|
61
|
+
accessibilityColumnSpan: _propTypes.default.number,
|
|
62
|
+
accessibilityControls: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
63
|
+
accessibilityCurrent: _propTypes.default.oneOf([true, false, 'page', 'step', 'location', 'date', 'time']),
|
|
64
|
+
accessibilityDescribedBy: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
65
|
+
accessibilityDetails: _propTypes.default.string,
|
|
66
|
+
accessibilityDisabled: _propTypes.default.bool,
|
|
67
|
+
accessibilityErrorMessage: _propTypes.default.string,
|
|
68
|
+
accessibilityExpanded: _propTypes.default.bool,
|
|
69
|
+
accessibilityFlowTo: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
70
|
+
accessibilityHasPopup: _propTypes.default.string,
|
|
71
|
+
accessibilityHidden: _propTypes.default.bool,
|
|
72
|
+
accessibilityInvalid: _propTypes.default.bool,
|
|
73
|
+
accessibilityKeyShortcuts: _propTypes.default.string,
|
|
74
|
+
accessibilityLabelledBy: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
75
|
+
accessibilityLevel: _propTypes.default.number,
|
|
76
|
+
accessibilityModal: _propTypes.default.bool,
|
|
77
|
+
accessibilityMultiline: _propTypes.default.bool,
|
|
78
|
+
accessibilityMultiSelectable: _propTypes.default.bool,
|
|
79
|
+
accessibilityOrientation: _propTypes.default.oneOf(['horizontal', 'vertical']),
|
|
80
|
+
accessibilityOwns: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
81
|
+
accessibilityPlaceholder: _propTypes.default.string,
|
|
82
|
+
accessibilityPosInSet: _propTypes.default.number,
|
|
83
|
+
accessibilityPressed: _propTypes.default.bool,
|
|
84
|
+
accessibilityReadOnly: _propTypes.default.bool,
|
|
85
|
+
accessibilityRequired: _propTypes.default.bool,
|
|
86
|
+
accessibilityRoleDescription: _propTypes.default.string,
|
|
87
|
+
accessibilityRowCount: _propTypes.default.number,
|
|
88
|
+
accessibilityRowIndex: _propTypes.default.number,
|
|
89
|
+
accessibilityRowSpan: _propTypes.default.number,
|
|
90
|
+
accessibilitySelected: _propTypes.default.bool,
|
|
91
|
+
accessibilitySetSize: _propTypes.default.number,
|
|
92
|
+
accessibilitySort: _propTypes.default.oneOf(['ascending', 'descending', 'none', 'other']),
|
|
93
|
+
accessibilityValueMax: _propTypes.default.number,
|
|
94
|
+
accessibilityValueMin: _propTypes.default.number,
|
|
95
|
+
accessibilityValueNow: _propTypes.default.number,
|
|
96
|
+
accessibilityValueText: _propTypes.default.string
|
|
97
|
+
};
|
|
51
98
|
|
|
52
|
-
const
|
|
99
|
+
const a11yPropTypesByPlatform = _Platform.default.select({
|
|
53
100
|
// React Native Web adds many a11y props that alias aria-* attributes
|
|
54
101
|
// Types based on https://necolas.github.io/react-native-web/docs/accessibility/
|
|
55
|
-
web:
|
|
56
|
-
accessibilityActiveDescendant: _propTypes.default.string,
|
|
57
|
-
accessibilityAtomic: _propTypes.default.bool,
|
|
58
|
-
accessibilityAutoComplete: _propTypes.default.string,
|
|
59
|
-
accessibilityBusy: _propTypes.default.bool,
|
|
60
|
-
accessibilityChecked: _propTypes.default.oneOf([true, false, 'mixed']),
|
|
61
|
-
accessibilityColumnCount: _propTypes.default.number,
|
|
62
|
-
accessibilityColumnIndex: _propTypes.default.number,
|
|
63
|
-
accessibilityColumnSpan: _propTypes.default.number,
|
|
64
|
-
accessibilityControls: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
65
|
-
accessibilityCurrent: _propTypes.default.oneOf([true, false, 'page', 'step', 'location', 'date', 'time']),
|
|
66
|
-
accessibilityDescribedBy: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
67
|
-
accessibilityDetails: _propTypes.default.string,
|
|
68
|
-
accessibilityDisabled: _propTypes.default.bool,
|
|
69
|
-
accessibilityErrorMessage: _propTypes.default.string,
|
|
70
|
-
accessibilityExpanded: _propTypes.default.bool,
|
|
71
|
-
accessibilityFlowTo: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
72
|
-
accessibilityHasPopup: _propTypes.default.string,
|
|
73
|
-
accessibilityHidden: _propTypes.default.bool,
|
|
74
|
-
accessibilityInvalid: _propTypes.default.bool,
|
|
75
|
-
accessibilityKeyShortcuts: _propTypes.default.string,
|
|
76
|
-
accessibilityLabelledBy: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
77
|
-
accessibilityLevel: _propTypes.default.number,
|
|
78
|
-
accessibilityModal: _propTypes.default.bool,
|
|
79
|
-
accessibilityMultiline: _propTypes.default.bool,
|
|
80
|
-
accessibilityMultiSelectable: _propTypes.default.bool,
|
|
81
|
-
accessibilityOrientation: _propTypes.default.oneOf(['horizontal', 'vertical']),
|
|
82
|
-
accessibilityOwns: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
83
|
-
accessibilityPlaceholder: _propTypes.default.string,
|
|
84
|
-
accessibilityPosInSet: _propTypes.default.number,
|
|
85
|
-
accessibilityPressed: _propTypes.default.bool,
|
|
86
|
-
accessibilityReadOnly: _propTypes.default.bool,
|
|
87
|
-
accessibilityRequired: _propTypes.default.bool,
|
|
88
|
-
accessibilityRoleDescription: _propTypes.default.string,
|
|
89
|
-
accessibilityRowCount: _propTypes.default.number,
|
|
90
|
-
accessibilityRowIndex: _propTypes.default.number,
|
|
91
|
-
accessibilityRowSpan: _propTypes.default.number,
|
|
92
|
-
accessibilitySelected: _propTypes.default.bool,
|
|
93
|
-
accessibilitySetSize: _propTypes.default.number,
|
|
94
|
-
accessibilitySort: _propTypes.default.oneOf(['ascending', 'descending', 'none', 'other']),
|
|
95
|
-
accessibilityValueMax: _propTypes.default.number,
|
|
96
|
-
accessibilityValueMin: _propTypes.default.number,
|
|
97
|
-
accessibilityValueNow: _propTypes.default.number,
|
|
98
|
-
accessibilityValueText: _propTypes.default.string
|
|
99
|
-
},
|
|
102
|
+
web: a11yPropTypes,
|
|
100
103
|
// Ignore web-only props in native builds
|
|
101
104
|
default: nativeA11yPropTypes
|
|
102
105
|
}); // These RNW-only props only exist in RNW >=0.18. Catch them and map them according to platform
|
|
@@ -269,7 +272,7 @@ var _default = {
|
|
|
269
272
|
* then spread the returned object into the component's props (usually its outer container).
|
|
270
273
|
*/
|
|
271
274
|
select: (0, _getPropSelector.default)( // Allow all React Native accessibility props
|
|
272
|
-
|
|
275
|
+
a11yPropTypesByPlatform, // Allow any `aria-*` attribute on web; ignore them on native
|
|
273
276
|
_Platform.default.OS === 'web' && /^aria-/, // For the props added and deprecated in React Native Web 0.18, convert them to
|
|
274
277
|
// a form that is platform-appropriate and RNW-version safe
|
|
275
278
|
(key, value) => {
|
|
@@ -2,6 +2,7 @@ var _ThemeProvider$propTy;
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
+
import { PortalProvider } from '@gorhom/portal';
|
|
5
6
|
import A11yInfoProvider from '../A11yInfoProvider';
|
|
6
7
|
import ViewportProvider from '../ViewportProvider';
|
|
7
8
|
import ThemeProvider from '../ThemeProvider';
|
|
@@ -18,7 +19,9 @@ const BaseProvider = _ref => {
|
|
|
18
19
|
children: /*#__PURE__*/_jsx(ThemeProvider, {
|
|
19
20
|
defaultTheme: defaultTheme,
|
|
20
21
|
themeOptions: themeOptions,
|
|
21
|
-
children:
|
|
22
|
+
children: /*#__PURE__*/_jsx(PortalProvider, {
|
|
23
|
+
children: children
|
|
24
|
+
})
|
|
22
25
|
})
|
|
23
26
|
})
|
|
24
27
|
});
|
|
@@ -171,11 +171,12 @@ const selectWebOnlyStyles = (inactive, themeTokens, _ref7) => {
|
|
|
171
171
|
const selectItemIconTokens = _ref8 => {
|
|
172
172
|
let {
|
|
173
173
|
color,
|
|
174
|
+
iconColor,
|
|
174
175
|
iconSize
|
|
175
176
|
} = _ref8;
|
|
176
177
|
return {
|
|
177
178
|
size: iconSize,
|
|
178
|
-
color
|
|
179
|
+
color: iconColor || color
|
|
179
180
|
};
|
|
180
181
|
};
|
|
181
182
|
|
|
@@ -16,6 +16,8 @@ import SkipLink from '../SkipLink';
|
|
|
16
16
|
import A11yText from '../A11yText';
|
|
17
17
|
import CarouselStepTracker from './CarouselStepTracker';
|
|
18
18
|
import CarouselThumbnailNavigation from './CarouselThumbnailNavigation';
|
|
19
|
+
import CarouselTabsPanel from './CarouselTabs/CarouselTabsPanel';
|
|
20
|
+
import CarouselTabsPanelItem from './CarouselTabs/CarouselTabsPanelItem';
|
|
19
21
|
import dictionary from './dictionary';
|
|
20
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -138,7 +140,8 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
138
140
|
onAnimationEnd,
|
|
139
141
|
onIndexChanged,
|
|
140
142
|
skipLinkHref,
|
|
141
|
-
|
|
143
|
+
tabs,
|
|
144
|
+
refocus = Boolean(tabs),
|
|
142
145
|
title = 'carousel',
|
|
143
146
|
springConfig = undefined,
|
|
144
147
|
thumbnails = undefined,
|
|
@@ -161,6 +164,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
161
164
|
nextIcon,
|
|
162
165
|
showPreviousNextNavigation,
|
|
163
166
|
showPanelNavigation,
|
|
167
|
+
showPanelTabs,
|
|
164
168
|
spaceBetweenSlideAndPreviousNextNavigation
|
|
165
169
|
} = themeTokens;
|
|
166
170
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
@@ -389,6 +393,9 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
389
393
|
|
|
390
394
|
return "".concat(copyText[0].toUpperCase()).concat(copyText.slice(1));
|
|
391
395
|
}, [activeIndex, childrenArray.length, itemLabel, getCopy, title]);
|
|
396
|
+
const activePanelNavigation = tabs && showPanelTabs ? /*#__PURE__*/_jsx(CarouselTabsPanel, {
|
|
397
|
+
items: tabs
|
|
398
|
+
}) : panelNavigation;
|
|
392
399
|
return /*#__PURE__*/_jsxs(CarouselProvider, {
|
|
393
400
|
activeIndex: activeIndex,
|
|
394
401
|
goTo: goTo,
|
|
@@ -462,7 +469,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
462
469
|
accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex + 2)
|
|
463
470
|
})
|
|
464
471
|
})]
|
|
465
|
-
}), showPanelNavigation ?
|
|
472
|
+
}), showPanelNavigation ? activePanelNavigation : null]
|
|
466
473
|
});
|
|
467
474
|
});
|
|
468
475
|
Carousel.propTypes = { ...selectedSystemPropTypes,
|
|
@@ -543,6 +550,13 @@ Carousel.propTypes = { ...selectedSystemPropTypes,
|
|
|
543
550
|
*/
|
|
544
551
|
skipLinkHref: PropTypes.string,
|
|
545
552
|
|
|
553
|
+
/**
|
|
554
|
+
* If provided, defaults the navigation panel to a CarouselTabsPanel element passing each item as props for one tab.
|
|
555
|
+
*
|
|
556
|
+
* Be careful to ensure that the order of each element in the items array matches the order of each child in the Carousel.
|
|
557
|
+
*/
|
|
558
|
+
tabs: PropTypes.arrayOf(PropTypes.shape(CarouselTabsPanelItem.propTypes || {})),
|
|
559
|
+
|
|
546
560
|
/**
|
|
547
561
|
* If true, whenever a new slide comes into view, the focus of the Carousel switches to the start.
|
|
548
562
|
*
|
|
@@ -4,7 +4,10 @@ import React, { forwardRef } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useResponsiveProp } from '../../utils';
|
|
6
6
|
import Carousel from '../Carousel';
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Please use Carousel and pass the `tabs` prop.
|
|
9
|
+
*/
|
|
10
|
+
|
|
8
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
12
|
const CarouselTabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
10
13
|
let {
|
|
@@ -12,16 +15,14 @@ const CarouselTabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
12
15
|
refocus = true,
|
|
13
16
|
...carouselProps
|
|
14
17
|
} = _ref;
|
|
15
|
-
const
|
|
16
|
-
md:
|
|
17
|
-
items: items
|
|
18
|
-
})
|
|
18
|
+
const tabs = useResponsiveProp({
|
|
19
|
+
md: items
|
|
19
20
|
});
|
|
20
21
|
return /*#__PURE__*/_jsx(Carousel, {
|
|
21
22
|
refocus: refocus,
|
|
22
23
|
...carouselProps,
|
|
23
24
|
ref: ref,
|
|
24
|
-
|
|
25
|
+
tabs: tabs,
|
|
25
26
|
children: items.map(_ref2 => {
|
|
26
27
|
let {
|
|
27
28
|
title,
|