@telus-uds/components-base 1.51.0 → 1.52.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 +22 -3
- package/component-docs.json +318 -131
- package/lib/A11yText/index.js +8 -0
- package/lib/Divider/Divider.js +4 -0
- package/lib/IconButton/IconButton.js +16 -0
- package/lib/Link/ChevronLink.js +4 -0
- package/lib/Listbox/ListboxContext.js +20 -0
- package/lib/Listbox/PressableItem.js +170 -0
- package/lib/Listbox/index.js +32 -0
- package/lib/Modal/Modal.js +17 -2
- package/lib/MultiSelectFilter/MultiSelectFilter.js +19 -5
- package/lib/Pagination/PageButton.js +12 -0
- package/lib/Pagination/Pagination.js +12 -0
- package/lib/QuickLinks/QuickLinks.js +12 -0
- package/lib/Responsive/Responsive.js +7 -0
- package/lib/Select/Group.js +4 -0
- package/lib/Select/Group.native.js +4 -0
- package/lib/Select/Item.js +4 -0
- package/lib/SideNav/ItemsGroup.js +4 -0
- package/lib/SideNav/SideNav.js +8 -0
- package/lib/StepTracker/StepTracker.js +16 -0
- package/lib/Tabs/Tabs.js +20 -0
- package/lib/Timeline/Timeline.js +2 -2
- package/lib/index.js +14 -0
- package/lib/utils/htmlAttrs.js +33 -0
- package/lib/utils/index.js +10 -1
- package/lib-module/A11yText/index.js +8 -0
- package/lib-module/Divider/Divider.js +4 -0
- package/lib-module/IconButton/IconButton.js +16 -0
- package/lib-module/Link/ChevronLink.js +4 -0
- package/lib-module/Listbox/ListboxContext.js +6 -0
- package/lib-module/Listbox/PressableItem.js +150 -0
- package/lib-module/Listbox/index.js +2 -0
- package/lib-module/Modal/Modal.js +18 -3
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +15 -5
- package/lib-module/Pagination/PageButton.js +12 -0
- package/lib-module/Pagination/Pagination.js +12 -0
- package/lib-module/QuickLinks/QuickLinks.js +12 -0
- package/lib-module/Responsive/Responsive.js +7 -0
- package/lib-module/Select/Group.js +4 -0
- package/lib-module/Select/Group.native.js +4 -0
- package/lib-module/Select/Item.js +4 -0
- package/lib-module/SideNav/ItemsGroup.js +4 -0
- package/lib-module/SideNav/SideNav.js +8 -0
- package/lib-module/StepTracker/StepTracker.js +16 -0
- package/lib-module/Tabs/Tabs.js +20 -0
- package/lib-module/Timeline/Timeline.js +2 -2
- package/lib-module/index.js +1 -0
- package/lib-module/utils/htmlAttrs.js +22 -0
- package/lib-module/utils/index.js +2 -1
- package/package.json +2 -2
- package/src/A11yText/index.jsx +6 -0
- package/src/Divider/Divider.jsx +3 -0
- package/src/IconButton/IconButton.jsx +12 -0
- package/src/Link/ChevronLink.jsx +3 -0
- package/src/Listbox/ListboxContext.js +6 -0
- package/src/Listbox/PressableItem.jsx +143 -0
- package/src/Listbox/index.js +2 -0
- package/src/Modal/Modal.jsx +13 -3
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +10 -4
- package/src/Pagination/PageButton.jsx +9 -0
- package/src/Pagination/Pagination.jsx +9 -0
- package/src/QuickLinks/QuickLinks.jsx +9 -0
- package/src/Responsive/Responsive.jsx +6 -0
- package/src/Select/Group.jsx +3 -0
- package/src/Select/Group.native.jsx +3 -0
- package/src/Select/Item.jsx +3 -0
- package/src/SideNav/ItemsGroup.jsx +3 -0
- package/src/SideNav/SideNav.jsx +6 -0
- package/src/StepTracker/StepTracker.jsx +12 -0
- package/src/Tabs/Tabs.jsx +15 -0
- package/src/Timeline/Timeline.jsx +2 -2
- package/src/index.js +1 -0
- package/src/utils/htmlAttrs.js +29 -0
- package/src/utils/index.js +1 -0
package/lib/A11yText/index.js
CHANGED
|
@@ -57,7 +57,15 @@ const A11yText = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
57
57
|
});
|
|
58
58
|
A11yText.displayName = 'A11yText';
|
|
59
59
|
A11yText.propTypes = { ...selectedSystemPropTypes,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Text to be read by screen readers
|
|
63
|
+
*/
|
|
60
64
|
text: _propTypes.default.string.isRequired,
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether text should be rendered as a heading
|
|
68
|
+
*/
|
|
61
69
|
heading: _propTypes.default.bool
|
|
62
70
|
};
|
|
63
71
|
|
package/lib/Divider/Divider.js
CHANGED
|
@@ -128,6 +128,10 @@ const Divider = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
128
128
|
Divider.displayName = 'Divider';
|
|
129
129
|
Divider.propTypes = { ...selectedSystemPropTypes,
|
|
130
130
|
tokens: (0, _utils.getTokensPropType)('Divider'),
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A number referring to a position on the space scale to create space on either side of the divider
|
|
134
|
+
*/
|
|
131
135
|
space: _utils.spacingProps.types.spacingValue,
|
|
132
136
|
variant: _utils.variantProp.propType,
|
|
133
137
|
|
|
@@ -145,9 +145,25 @@ IconButton.displayName = 'IconButton';
|
|
|
145
145
|
IconButton.propTypes = { ...selectedSystemPropTypes,
|
|
146
146
|
variant: _utils.variantProp.propType,
|
|
147
147
|
tokens: (0, _utils.getTokensPropType)('IconButton'),
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Defines the icon to be rendered
|
|
151
|
+
*/
|
|
148
152
|
icon: _propTypes.default.elementType.isRequired,
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* URL to navigate to when the `Iconbutton` is pressed
|
|
156
|
+
*/
|
|
149
157
|
href: _propTypes.default.string,
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* URL options to navigate to when the `Iconbutton` is pressed
|
|
161
|
+
*/
|
|
150
162
|
hrefAttrs: _propTypes.default.shape(_utils.hrefAttrsProp.types),
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Function to execute when the `Iconbutton` is pressed
|
|
166
|
+
*/
|
|
151
167
|
onPress: _propTypes.default.func
|
|
152
168
|
};
|
|
153
169
|
|
package/lib/Link/ChevronLink.js
CHANGED
|
@@ -70,6 +70,10 @@ const ChevronLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
70
70
|
ChevronLink.displayName = 'ChevronLink';
|
|
71
71
|
ChevronLink.propTypes = { ..._LinkBase.default.propTypes,
|
|
72
72
|
tokens: (0, _utils.getTokensPropType)('ChevronLink', 'Link'),
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Changes direction of chevron icon
|
|
76
|
+
*/
|
|
73
77
|
direction: _propTypes.default.oneOf(['left', 'right'])
|
|
74
78
|
};
|
|
75
79
|
var _default = ChevronLink;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useListboxContext = exports.ListboxContext = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
const ListboxContext = /*#__PURE__*/_react.default.createContext({});
|
|
15
|
+
|
|
16
|
+
exports.ListboxContext = ListboxContext;
|
|
17
|
+
|
|
18
|
+
const useListboxContext = () => (0, _react.useContext)(ListboxContext);
|
|
19
|
+
|
|
20
|
+
exports.useListboxContext = useListboxContext;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
|
|
13
|
+
|
|
14
|
+
var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
|
|
15
|
+
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
|
|
18
|
+
var _ListboxContext = require("./ListboxContext");
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
|
|
28
|
+
/* eslint-disable react/require-default-props */
|
|
29
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.htmlAttrs]);
|
|
30
|
+
|
|
31
|
+
const getItemStyles = _ref => {
|
|
32
|
+
let {
|
|
33
|
+
groupFontName,
|
|
34
|
+
groupFontWeight,
|
|
35
|
+
itemFontSize,
|
|
36
|
+
itemPaddingTop,
|
|
37
|
+
itemPaddingBottom,
|
|
38
|
+
itemPaddingLeft,
|
|
39
|
+
itemBorderLeftWidth,
|
|
40
|
+
itemPaddingRight,
|
|
41
|
+
itemBackgroundColor,
|
|
42
|
+
itemColor,
|
|
43
|
+
itemDisplay,
|
|
44
|
+
itemOutline,
|
|
45
|
+
itemTextDecoration,
|
|
46
|
+
itemBorderLeftColor,
|
|
47
|
+
itemBorderRightWidth,
|
|
48
|
+
itemBorderRightColor,
|
|
49
|
+
itemBorderTopWidth,
|
|
50
|
+
itemBorderTopColor,
|
|
51
|
+
itemBorderBottomWidth,
|
|
52
|
+
itemBorderBottomColor,
|
|
53
|
+
itemBorderRadius,
|
|
54
|
+
itemHeight
|
|
55
|
+
} = _ref;
|
|
56
|
+
return {
|
|
57
|
+
fontFamily: `${groupFontName}${groupFontWeight}normal`,
|
|
58
|
+
fontSize: itemFontSize,
|
|
59
|
+
paddingTop: itemPaddingTop - itemBorderTopWidth,
|
|
60
|
+
paddingBottom: itemPaddingBottom - itemBorderBottomWidth,
|
|
61
|
+
paddingLeft: itemPaddingLeft - itemBorderLeftWidth,
|
|
62
|
+
paddingRight: itemPaddingRight - itemBorderRightWidth,
|
|
63
|
+
width: '100%',
|
|
64
|
+
backgroundColor: itemBackgroundColor,
|
|
65
|
+
color: itemColor,
|
|
66
|
+
display: itemDisplay,
|
|
67
|
+
outline: itemOutline,
|
|
68
|
+
textDecoration: itemTextDecoration,
|
|
69
|
+
borderLeft: `${itemBorderLeftWidth}px solid ${itemBorderLeftColor}`,
|
|
70
|
+
borderRight: `${itemBorderRightWidth}px solid ${itemBorderRightColor}`,
|
|
71
|
+
borderTop: `${itemBorderTopWidth}px solid ${itemBorderTopColor}`,
|
|
72
|
+
borderBottom: `${itemBorderBottomWidth}px solid ${itemBorderBottomColor}`,
|
|
73
|
+
borderRadius: itemBorderRadius,
|
|
74
|
+
height: itemHeight,
|
|
75
|
+
justifyContent: 'center'
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const PressableItem = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
80
|
+
let {
|
|
81
|
+
children,
|
|
82
|
+
href,
|
|
83
|
+
isChild = false,
|
|
84
|
+
onBlur,
|
|
85
|
+
onPress,
|
|
86
|
+
tabIndex = 0,
|
|
87
|
+
nextItemRef,
|
|
88
|
+
prevItemRef,
|
|
89
|
+
tokens,
|
|
90
|
+
id,
|
|
91
|
+
...rest
|
|
92
|
+
} = _ref2;
|
|
93
|
+
const {
|
|
94
|
+
selectedId,
|
|
95
|
+
setSelectedId
|
|
96
|
+
} = (0, _ListboxContext.useListboxContext)();
|
|
97
|
+
|
|
98
|
+
const selectTextStyles = _ref3 => {
|
|
99
|
+
let {
|
|
100
|
+
groupFontName,
|
|
101
|
+
groupFontWeight,
|
|
102
|
+
itemFontSize,
|
|
103
|
+
itemColor,
|
|
104
|
+
lineHeight
|
|
105
|
+
} = _ref3;
|
|
106
|
+
return {
|
|
107
|
+
fontFamily: `${groupFontName}${groupFontWeight}normal`,
|
|
108
|
+
fontSize: itemFontSize,
|
|
109
|
+
color: itemColor,
|
|
110
|
+
lineHeight: lineHeight * itemFontSize
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const resolveButtonTokens = pressableState => {
|
|
115
|
+
const themeTokens = (0, _utils.resolvePressableTokens)(tokens, pressableState, {
|
|
116
|
+
isChild,
|
|
117
|
+
current: id === selectedId && id !== undefined
|
|
118
|
+
});
|
|
119
|
+
return themeTokens;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const handleKeyPress = event => {
|
|
123
|
+
if (['Enter', ' '].includes(event === null || event === void 0 ? void 0 : event.key)) {
|
|
124
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(event);
|
|
125
|
+
} else if ((event === null || event === void 0 ? void 0 : event.key) === 'ArrowDown') {
|
|
126
|
+
nextItemRef.current.focus();
|
|
127
|
+
} else if ((event === null || event === void 0 ? void 0 : event.key) === 'ArrowUp' && prevItemRef !== null && prevItemRef !== void 0 && prevItemRef.current) {
|
|
128
|
+
prevItemRef.current.focus();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
133
|
+
isChild: isChild,
|
|
134
|
+
style: pressableState => getItemStyles(resolveButtonTokens(pressableState)),
|
|
135
|
+
onBlur: onBlur,
|
|
136
|
+
onClick: onPress,
|
|
137
|
+
onKeyPress: handleKeyPress,
|
|
138
|
+
ref: ref,
|
|
139
|
+
tabIndex: tabIndex,
|
|
140
|
+
...(href && {
|
|
141
|
+
href
|
|
142
|
+
}),
|
|
143
|
+
...(onPress && {
|
|
144
|
+
onClick: onPress
|
|
145
|
+
}),
|
|
146
|
+
...selectProps(rest),
|
|
147
|
+
onPress: () => {
|
|
148
|
+
setSelectedId(id);
|
|
149
|
+
onPress();
|
|
150
|
+
},
|
|
151
|
+
children: pressableState => {
|
|
152
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, {
|
|
153
|
+
style: selectTextStyles(resolveButtonTokens(pressableState)),
|
|
154
|
+
children: [children, " "]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
PressableItem.displayName = 'PressableItem';
|
|
160
|
+
PressableItem.propTypes = { ...selectedSystemPropTypes,
|
|
161
|
+
href: _propTypes.default.string,
|
|
162
|
+
isChild: _propTypes.default.bool,
|
|
163
|
+
children: _propTypes.default.node.isRequired,
|
|
164
|
+
onBlur: _propTypes.default.func,
|
|
165
|
+
onPress: _propTypes.default.func,
|
|
166
|
+
nextItemRef: _propTypes.default.object,
|
|
167
|
+
prevItemRef: _propTypes.default.object
|
|
168
|
+
};
|
|
169
|
+
var _default = PressableItem;
|
|
170
|
+
exports.default = _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
PressableItem: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "PressableItem", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _PressableItem.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
var _ListboxContext = require("./ListboxContext");
|
|
17
|
+
|
|
18
|
+
Object.keys(_ListboxContext).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
21
|
+
if (key in exports && exports[key] === _ListboxContext[key]) return;
|
|
22
|
+
Object.defineProperty(exports, key, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return _ListboxContext[key];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
var _PressableItem = _interopRequireDefault(require("./PressableItem"));
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/Modal/Modal.js
CHANGED
|
@@ -183,8 +183,7 @@ const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
183
183
|
onPress: handleClose,
|
|
184
184
|
icon: CloseIconComponent,
|
|
185
185
|
accessibilityRole: "button",
|
|
186
|
-
accessibilityLabel: closeLabel
|
|
187
|
-
tokens: (0, _utils.selectTokens)('IconButton', themeTokens, 'close')
|
|
186
|
+
accessibilityLabel: closeLabel
|
|
188
187
|
})
|
|
189
188
|
}), children]
|
|
190
189
|
})
|
|
@@ -200,9 +199,25 @@ const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
200
199
|
Modal.displayName = 'Modal';
|
|
201
200
|
Modal.propTypes = { ...selectedSystemPropTypes,
|
|
202
201
|
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)]),
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* To define the locale of the copy
|
|
205
|
+
*/
|
|
203
206
|
copy: _utils.copyPropTypes,
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Setting this to `true` will open the `Modal`
|
|
210
|
+
*/
|
|
204
211
|
isOpen: _propTypes.default.bool,
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* This function is triggered when the `Modal` is closed
|
|
215
|
+
*/
|
|
205
216
|
onClose: _propTypes.default.func,
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* `max-width` is applied to the `Modal` container
|
|
220
|
+
*/
|
|
206
221
|
maxWidth: _propTypes.default.bool,
|
|
207
222
|
tokens: (0, _utils.getTokensPropType)('Modal'),
|
|
208
223
|
variant: _utils.variantProp.propType,
|
|
@@ -9,6 +9,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
13
|
+
|
|
14
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
15
|
+
|
|
12
16
|
var _ThemeProvider = require("../ThemeProvider");
|
|
13
17
|
|
|
14
18
|
var _utils = require("../utils");
|
|
@@ -311,11 +315,14 @@ const MultiSelectFilter = _ref3 => {
|
|
|
311
315
|
isReady: isReady,
|
|
312
316
|
onLayout: onTargetLayout,
|
|
313
317
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Row, {
|
|
314
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
318
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
319
|
+
style: styles.textContainerStyle,
|
|
320
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
321
|
+
tokens: { ...headerStyles,
|
|
322
|
+
lineHeight: headerLineHeight
|
|
323
|
+
},
|
|
324
|
+
children: getCopy('filterByLabel').replace(/%\{filterCategory\}/g, label.toLowerCase())
|
|
325
|
+
})
|
|
319
326
|
})
|
|
320
327
|
}), subtitle && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
321
328
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, {
|
|
@@ -384,6 +391,13 @@ const MultiSelectFilter = _ref3 => {
|
|
|
384
391
|
};
|
|
385
392
|
|
|
386
393
|
MultiSelectFilter.displayName = 'MultiSelectFilter';
|
|
394
|
+
|
|
395
|
+
const styles = _StyleSheet.default.create({
|
|
396
|
+
textContainerStyle: {
|
|
397
|
+
marginRight: 52
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
|
|
387
401
|
MultiSelectFilter.propTypes = {
|
|
388
402
|
/**
|
|
389
403
|
* The text displayed to the user in a ButtonDropdown.
|
|
@@ -80,8 +80,20 @@ const PageButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
80
80
|
});
|
|
81
81
|
PageButton.displayName = 'PageButton';
|
|
82
82
|
PageButton.propTypes = { ..._utils.linkProps.types,
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* To set custom label for the button
|
|
86
|
+
*/
|
|
83
87
|
label: _propTypes.default.string,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* To set `PageButton` to active state
|
|
91
|
+
*/
|
|
84
92
|
isActive: _propTypes.default.bool,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* To change the language for labels
|
|
96
|
+
*/
|
|
85
97
|
copy: _utils.copyPropTypes,
|
|
86
98
|
variant: _utils.variantProp.propType,
|
|
87
99
|
tokens: (0, _utils.getTokensPropType)('PaginationPageButton')
|
|
@@ -210,10 +210,22 @@ Pagination.PageButton = _PageButton.default;
|
|
|
210
210
|
Pagination.propTypes = { ...selectedSystemPropTypes,
|
|
211
211
|
..._utils.withLinkRouter.propTypes,
|
|
212
212
|
children: (0, _utils.componentPropType)('PageButton'),
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* To change the language for labels
|
|
216
|
+
*/
|
|
213
217
|
copy: _utils.copyPropTypes,
|
|
214
218
|
variant: _utils.variantProp.propType,
|
|
215
219
|
tokens: (0, _utils.getTokensPropType)('Pagination'),
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* When passed as `{{ compact: true }}`, `Pagination` does not render labels along side buttons
|
|
223
|
+
*/
|
|
216
224
|
sideButtonVariant: _utils.variantProp.propType,
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Custom tokens for `PaginationSideButton`
|
|
228
|
+
*/
|
|
217
229
|
sideButtonTokens: (0, _utils.getTokensPropType)('PaginationSideButton')
|
|
218
230
|
};
|
|
219
231
|
|
|
@@ -81,8 +81,20 @@ const QuickLinks = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
81
81
|
QuickLinks.displayName = 'QuickLinks';
|
|
82
82
|
QuickLinks.propTypes = {
|
|
83
83
|
tokens: (0, _utils.getTokensPropType)('QuickLinks'),
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Custom tokens override for `Card`
|
|
87
|
+
*/
|
|
84
88
|
cardTokens: (0, _utils.getTokensPropType)('Card'),
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Custom tokens override for `QuickLinksList`
|
|
92
|
+
*/
|
|
85
93
|
listTokens: (0, _utils.getTokensPropType)('QuickLinksList'),
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The HTML tag to render the list as
|
|
97
|
+
*/
|
|
86
98
|
tag: _propTypes.default.string,
|
|
87
99
|
variant: _utils.variantProp.propType,
|
|
88
100
|
children: _propTypes.default.node
|
|
@@ -50,7 +50,14 @@ const Responsive = _ref => {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
Responsive.propTypes = {
|
|
53
|
+
/**
|
|
54
|
+
* To hide children of `Responsive` if the current viewport is smaller than `min`
|
|
55
|
+
*/
|
|
53
56
|
min: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* To hide children of `Responsive` if the current viewport is larger than `max`
|
|
60
|
+
*/
|
|
54
61
|
max: _propTypes.default.oneOf(['sm', 'md', 'lg', 'xl']),
|
|
55
62
|
children: _propTypes.default.node.isRequired
|
|
56
63
|
};
|
package/lib/Select/Group.js
CHANGED
package/lib/Select/Item.js
CHANGED
|
@@ -141,6 +141,10 @@ ItemsGroup.propTypes = {
|
|
|
141
141
|
isActive: _propTypes.default.bool,
|
|
142
142
|
variant: _utils.variantProp.propType,
|
|
143
143
|
tokens: (0, _utils.getTokensPropType)('SideNavItemsGroup'),
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Custom tokens for `SideNav.Item`
|
|
147
|
+
*/
|
|
144
148
|
itemTokens: (0, _utils.getTokensPropType)('SideNavItem')
|
|
145
149
|
};
|
|
146
150
|
var _default = ItemsGroup;
|
package/lib/SideNav/SideNav.js
CHANGED
|
@@ -147,7 +147,15 @@ SideNav.propTypes = { ...selectedSystemPropTypes,
|
|
|
147
147
|
accordion: _propTypes.default.bool,
|
|
148
148
|
variant: _utils.variantProp.propType,
|
|
149
149
|
tokens: (0, _utils.getTokensPropType)('SideNav'),
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Custom tokens for `SideNav.Item`
|
|
153
|
+
*/
|
|
150
154
|
itemTokens: (0, _utils.getTokensPropType)('SideNavItem'),
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Custom tokens for `SideNavItemsGroup`
|
|
158
|
+
*/
|
|
151
159
|
groupTokens: (0, _utils.getTokensPropType)('SideNavItemsGroup')
|
|
152
160
|
};
|
|
153
161
|
SideNav.Item = _Item.default;
|
|
@@ -194,12 +194,28 @@ const dictionaryContentShape = _propTypes.default.shape({
|
|
|
194
194
|
});
|
|
195
195
|
|
|
196
196
|
StepTracker.propTypes = { ...selectedSystemPropTypes,
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The current step, 0-based number
|
|
200
|
+
*/
|
|
197
201
|
current: _propTypes.default.number,
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The language to use for the labels
|
|
205
|
+
*/
|
|
198
206
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), dictionaryContentShape]),
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Custom dictionary containing the labels to use for the steps
|
|
210
|
+
*/
|
|
199
211
|
dictionary: _propTypes.default.shape({
|
|
200
212
|
en: dictionaryContentShape,
|
|
201
213
|
fr: dictionaryContentShape
|
|
202
214
|
}),
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* An array of strings defining the step titles
|
|
218
|
+
*/
|
|
203
219
|
steps: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
204
220
|
tokens: (0, _utils.getTokensPropType)('StepTracker'),
|
|
205
221
|
variant: _utils.variantProp.propType
|
package/lib/Tabs/Tabs.js
CHANGED
|
@@ -154,6 +154,10 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
154
154
|
Tabs.displayName = 'Tabs';
|
|
155
155
|
Tabs.propTypes = { ...selectedSystemPropTypes,
|
|
156
156
|
..._utils.withLinkRouter.PropTypes,
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Array of `TabsItem`s
|
|
160
|
+
*/
|
|
157
161
|
items: _propTypes.default.arrayOf(_propTypes.default.shape({ ...selectedItemPropTypes,
|
|
158
162
|
..._utils.withLinkRouter.PropTypes,
|
|
159
163
|
href: _propTypes.default.string,
|
|
@@ -161,11 +165,27 @@ Tabs.propTypes = { ...selectedSystemPropTypes,
|
|
|
161
165
|
id: _propTypes.default.string,
|
|
162
166
|
ref: _airbnbPropTypes.default.ref()
|
|
163
167
|
})),
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* `id` property of the current tab in the items array
|
|
171
|
+
*/
|
|
164
172
|
value: _propTypes.default.string,
|
|
165
173
|
initialValue: _propTypes.default.string,
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Callback for when the selected tab changes
|
|
177
|
+
*/
|
|
166
178
|
onChange: _propTypes.default.func,
|
|
167
179
|
tokens: (0, _utils.getTokensPropType)('Tabs'),
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Custom tokens for `TabsItem`
|
|
183
|
+
*/
|
|
168
184
|
itemTokens: (0, _utils.getTokensPropType)('TabsItem'),
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Custom tokens for `HorizontalScrollButton`
|
|
188
|
+
*/
|
|
169
189
|
scrollButtonTokens: (0, _utils.getTokensPropType)('HorizontalScrollButton'),
|
|
170
190
|
variant: _utils.variantProp.propType
|
|
171
191
|
};
|
package/lib/Timeline/Timeline.js
CHANGED
|
@@ -44,14 +44,14 @@ const selectDotStyles = _ref => {
|
|
|
44
44
|
|
|
45
45
|
const selectConnectorStyles = _ref2 => {
|
|
46
46
|
let {
|
|
47
|
-
|
|
47
|
+
timelineConnectorColor,
|
|
48
48
|
connectorHeight,
|
|
49
49
|
connectorWidth
|
|
50
50
|
} = _ref2;
|
|
51
51
|
return {
|
|
52
52
|
width: connectorWidth,
|
|
53
53
|
height: connectorHeight,
|
|
54
|
-
backgroundColor:
|
|
54
|
+
backgroundColor: timelineConnectorColor
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
|
package/lib/index.js
CHANGED
|
@@ -476,6 +476,20 @@ Object.keys(_Carousel).forEach(function (key) {
|
|
|
476
476
|
});
|
|
477
477
|
});
|
|
478
478
|
|
|
479
|
+
var _Listbox = require("./Listbox");
|
|
480
|
+
|
|
481
|
+
Object.keys(_Listbox).forEach(function (key) {
|
|
482
|
+
if (key === "default" || key === "__esModule") return;
|
|
483
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
484
|
+
if (key in exports && exports[key] === _Listbox[key]) return;
|
|
485
|
+
Object.defineProperty(exports, key, {
|
|
486
|
+
enumerable: true,
|
|
487
|
+
get: function () {
|
|
488
|
+
return _Listbox[key];
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
});
|
|
492
|
+
|
|
479
493
|
var _Checkbox = _interopRequireWildcard(require("./Checkbox"));
|
|
480
494
|
|
|
481
495
|
Object.keys(_Checkbox).forEach(function (key) {
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const htmlAttrTypes = {
|
|
13
|
+
dataSet: _propTypes.default.object,
|
|
14
|
+
id: _propTypes.default.string,
|
|
15
|
+
loading: _propTypes.default.oneOf(['eager', 'lazy']),
|
|
16
|
+
// @todo figure out if we need to enum all the possible roles or maybe use
|
|
17
|
+
// an npm package
|
|
18
|
+
role: _propTypes.default.string,
|
|
19
|
+
src: _propTypes.default.string,
|
|
20
|
+
tabIndex: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
21
|
+
testID: _propTypes.default.string,
|
|
22
|
+
title: _propTypes.default.string
|
|
23
|
+
};
|
|
24
|
+
var _default = {
|
|
25
|
+
types: htmlAttrTypes,
|
|
26
|
+
select: props => Object.entries(props).reduce((items, _ref) => {
|
|
27
|
+
let [key, value] = _ref;
|
|
28
|
+
return Object.keys(htmlAttrTypes).includes(key) || /^(data|aria)-/.test(key) ? { ...items,
|
|
29
|
+
[key]: value
|
|
30
|
+
} : items;
|
|
31
|
+
}, {})
|
|
32
|
+
};
|
|
33
|
+
exports.default = _default;
|