@telus-uds/components-base 1.12.0 → 1.14.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 +41 -2
- package/component-docs.json +933 -55
- package/lib/BaseProvider/index.js +7 -2
- package/lib/Button/ButtonBase.js +52 -19
- package/lib/Button/ButtonGroup.js +7 -0
- package/lib/Button/propTypes.js +18 -0
- package/lib/Carousel/Carousel.js +83 -58
- package/lib/Carousel/CarouselContext.js +22 -8
- package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +73 -0
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +56 -0
- package/lib/Carousel/CarouselStepTracker/index.js +13 -0
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +70 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +95 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +148 -0
- package/lib/Carousel/CarouselTabs/index.js +13 -0
- package/lib/Carousel/CarouselThumbnail.js +99 -0
- package/lib/Carousel/CarouselThumbnailNavigation.js +87 -0
- package/lib/Carousel/dictionary.js +4 -2
- package/lib/Carousel/index.js +10 -1
- package/lib/Checkbox/Checkbox.js +7 -3
- package/lib/Checkbox/CheckboxGroup.js +8 -1
- package/lib/Feedback/Feedback.js +18 -10
- package/lib/Icon/IconText.js +6 -1
- package/lib/InputLabel/InputLabel.js +11 -5
- package/lib/Link/InlinePressable.js +1 -8
- package/lib/Link/LinkBase.js +13 -10
- package/lib/List/ListItem.js +8 -4
- package/lib/Notification/Notification.js +44 -24
- package/lib/Pagination/Pagination.js +7 -3
- package/lib/Radio/RadioGroup.js +8 -0
- package/lib/RadioCard/RadioCard.js +6 -1
- package/lib/RadioCard/RadioCardGroup.js +7 -0
- package/lib/Select/Select.js +7 -3
- package/lib/SkipLink/SkipLink.js +216 -0
- package/lib/SkipLink/index.js +13 -0
- package/lib/StepTracker/Step.js +8 -4
- package/lib/StepTracker/StepTracker.js +7 -3
- package/lib/Tabs/TabsItem.js +4 -0
- package/lib/TextInput/TextInputBase.js +7 -3
- package/lib/ThemeProvider/ThemeProvider.js +25 -3
- package/lib/ThemeProvider/utils/styles.js +8 -1
- package/lib/ThemeProvider/utils/theme-tokens.js +1 -1
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +7 -0
- package/lib/Typography/Typography.js +6 -2
- package/lib/index.js +9 -0
- package/lib-module/BaseProvider/index.js +7 -2
- package/lib-module/Button/ButtonBase.js +41 -9
- package/lib-module/Button/ButtonGroup.js +7 -0
- package/lib-module/Button/propTypes.js +17 -0
- package/lib-module/Carousel/Carousel.js +80 -57
- package/lib-module/Carousel/CarouselContext.js +21 -8
- package/lib-module/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +51 -0
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +42 -0
- package/lib-module/Carousel/CarouselStepTracker/index.js +2 -0
- package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +50 -0
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +76 -0
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanelItem.js +126 -0
- package/lib-module/Carousel/CarouselTabs/index.js +2 -0
- package/lib-module/Carousel/CarouselThumbnail.js +85 -0
- package/lib-module/Carousel/CarouselThumbnailNavigation.js +66 -0
- package/lib-module/Carousel/dictionary.js +4 -2
- package/lib-module/Carousel/index.js +2 -1
- package/lib-module/Checkbox/Checkbox.js +8 -4
- package/lib-module/Checkbox/CheckboxGroup.js +8 -1
- package/lib-module/Feedback/Feedback.js +19 -11
- package/lib-module/Icon/IconText.js +6 -1
- package/lib-module/InputLabel/InputLabel.js +12 -6
- package/lib-module/Link/InlinePressable.js +1 -8
- package/lib-module/Link/LinkBase.js +14 -11
- package/lib-module/List/ListItem.js +9 -5
- package/lib-module/Notification/Notification.js +46 -26
- package/lib-module/Pagination/Pagination.js +8 -4
- package/lib-module/Radio/RadioGroup.js +8 -0
- package/lib-module/RadioCard/RadioCard.js +7 -2
- package/lib-module/RadioCard/RadioCardGroup.js +7 -0
- package/lib-module/Select/Select.js +8 -4
- package/lib-module/SkipLink/SkipLink.js +188 -0
- package/lib-module/SkipLink/index.js +2 -0
- package/lib-module/StepTracker/Step.js +9 -5
- package/lib-module/StepTracker/StepTracker.js +8 -4
- package/lib-module/Tabs/TabsItem.js +5 -1
- package/lib-module/TextInput/TextInputBase.js +8 -4
- package/lib-module/ThemeProvider/ThemeProvider.js +24 -3
- package/lib-module/ThemeProvider/utils/styles.js +8 -1
- package/lib-module/ThemeProvider/utils/theme-tokens.js +1 -1
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +7 -0
- package/lib-module/Typography/Typography.js +7 -3
- package/lib-module/index.js +1 -0
- package/package.json +46 -47
- package/src/BaseProvider/index.jsx +6 -3
- package/src/Button/ButtonBase.jsx +36 -12
- package/src/Button/ButtonGroup.jsx +6 -0
- package/src/Button/propTypes.js +14 -0
- package/src/Carousel/Carousel.jsx +91 -64
- package/src/Carousel/CarouselContext.jsx +29 -5
- package/src/Carousel/CarouselFirstFocus/CarouselFirstFocus.jsx +49 -0
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +36 -0
- package/src/Carousel/CarouselStepTracker/index.js +3 -0
- package/src/Carousel/CarouselTabs/CarouselTabs.jsx +37 -0
- package/src/Carousel/CarouselTabs/CarouselTabsPanel.jsx +69 -0
- package/src/Carousel/CarouselTabs/CarouselTabsPanelItem.jsx +119 -0
- package/src/Carousel/CarouselTabs/index.js +3 -0
- package/src/Carousel/CarouselThumbnail.jsx +77 -0
- package/src/Carousel/CarouselThumbnailNavigation.jsx +53 -0
- package/src/Carousel/dictionary.js +4 -2
- package/src/Carousel/index.js +1 -0
- package/src/Checkbox/Checkbox.jsx +14 -11
- package/src/Checkbox/CheckboxGroup.jsx +8 -1
- package/src/Feedback/Feedback.jsx +14 -7
- package/src/Icon/IconText.jsx +3 -1
- package/src/InputLabel/InputLabel.jsx +13 -12
- package/src/Link/InlinePressable.jsx +2 -8
- package/src/Link/LinkBase.jsx +18 -21
- package/src/List/ListItem.jsx +10 -5
- package/src/Notification/Notification.jsx +40 -23
- package/src/Pagination/Pagination.jsx +6 -4
- package/src/Radio/RadioGroup.jsx +7 -0
- package/src/RadioCard/RadioCard.jsx +3 -2
- package/src/RadioCard/RadioCardGroup.jsx +6 -0
- package/src/Select/Select.jsx +12 -3
- package/src/SkipLink/SkipLink.jsx +179 -0
- package/src/SkipLink/index.js +3 -0
- package/src/StepTracker/Step.jsx +12 -4
- package/src/StepTracker/StepTracker.jsx +11 -10
- package/src/Tabs/TabsItem.jsx +3 -2
- package/src/TextInput/TextInputBase.jsx +11 -3
- package/src/ThemeProvider/ThemeProvider.jsx +22 -3
- package/src/ThemeProvider/utils/styles.js +9 -1
- package/src/ThemeProvider/utils/theme-tokens.js +1 -1
- package/src/ToggleSwitch/ToggleSwitchGroup.jsx +6 -0
- package/src/Typography/Typography.jsx +11 -12
- package/src/index.js +1 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _CarouselContext = require("../CarouselContext");
|
|
11
|
+
|
|
12
|
+
var _StepTracker = _interopRequireDefault(require("../../StepTracker"));
|
|
13
|
+
|
|
14
|
+
var _StackView = _interopRequireDefault(require("../../StackView"));
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
const CarouselStepTracker = () => {
|
|
21
|
+
const {
|
|
22
|
+
activeIndex,
|
|
23
|
+
totalItems,
|
|
24
|
+
getCopyWithPlaceholders,
|
|
25
|
+
themeTokens
|
|
26
|
+
} = (0, _CarouselContext.useCarousel)();
|
|
27
|
+
const stackViewTokens = {
|
|
28
|
+
justifyContent: 'center'
|
|
29
|
+
};
|
|
30
|
+
const stepTrackerTokens = {
|
|
31
|
+
showStepLabel: false,
|
|
32
|
+
showStepTrackerLabel: true,
|
|
33
|
+
knobCompletedBackgroundColor: 'none',
|
|
34
|
+
connectorCompletedColor: 'none',
|
|
35
|
+
connectorColor: 'none',
|
|
36
|
+
containerPaddingTop: themeTokens.spaceBetweenSlideAndPanelNavigation
|
|
37
|
+
};
|
|
38
|
+
const steps = Array.from(Array(totalItems)).map((_, index) => String(index));
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
|
|
40
|
+
direction: "row",
|
|
41
|
+
tokens: stackViewTokens,
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StepTracker.default, {
|
|
43
|
+
current: activeIndex,
|
|
44
|
+
steps: steps,
|
|
45
|
+
copy: {
|
|
46
|
+
// Give StepTracker copy from Carousel's language and dictionary
|
|
47
|
+
stepLabel: getCopyWithPlaceholders('stepLabel'),
|
|
48
|
+
stepTrackerLabel: getCopyWithPlaceholders('stepTrackerLabel')
|
|
49
|
+
},
|
|
50
|
+
tokens: stepTrackerTokens
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var _default = CarouselStepTracker;
|
|
56
|
+
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 _CarouselStepTracker = _interopRequireDefault(require("./CarouselStepTracker"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _CarouselStepTracker.default;
|
|
13
|
+
exports.default = _default;
|
|
@@ -0,0 +1,70 @@
|
|
|
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 _utils = require("../../utils");
|
|
13
|
+
|
|
14
|
+
var _Carousel = _interopRequireDefault(require("../Carousel"));
|
|
15
|
+
|
|
16
|
+
var _CarouselTabsPanel = _interopRequireDefault(require("./CarouselTabsPanel"));
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
var _CarouselTabs$propTyp, _CarouselTabs$propTyp2;
|
|
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
|
+
const CarouselTabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
29
|
+
let {
|
|
30
|
+
items,
|
|
31
|
+
refocus = true,
|
|
32
|
+
...carouselProps
|
|
33
|
+
} = _ref;
|
|
34
|
+
const panelNavigation = (0, _utils.useResponsiveProp)({
|
|
35
|
+
md: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselTabsPanel.default, {
|
|
36
|
+
items: items
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Carousel.default, {
|
|
40
|
+
refocus: refocus,
|
|
41
|
+
...carouselProps,
|
|
42
|
+
ref: ref,
|
|
43
|
+
panelNavigation: panelNavigation,
|
|
44
|
+
children: items.map(_ref2 => {
|
|
45
|
+
let {
|
|
46
|
+
title,
|
|
47
|
+
content
|
|
48
|
+
} = _ref2;
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
50
|
+
children: content
|
|
51
|
+
}, title);
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
CarouselTabs.displayName = 'CarouselTabs';
|
|
56
|
+
CarouselTabs.propTypes = {
|
|
57
|
+
/**
|
|
58
|
+
* An array of objects where title is the string shown in the slide's tab and content is the JSX for the slide itself
|
|
59
|
+
*/
|
|
60
|
+
items: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
61
|
+
title: _propTypes.default.string.isRequired,
|
|
62
|
+
content: _propTypes.default.node.isRequired
|
|
63
|
+
})),
|
|
64
|
+
..._Carousel.default.propTypes
|
|
65
|
+
}; // CarouselTabs doesn't require `children` prop, it uses `items` instead.
|
|
66
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
67
|
+
|
|
68
|
+
if ((_CarouselTabs$propTyp = CarouselTabs.propTypes) !== null && _CarouselTabs$propTyp !== void 0 && _CarouselTabs$propTyp.children) (_CarouselTabs$propTyp2 = CarouselTabs.propTypes) === null || _CarouselTabs$propTyp2 === void 0 ? true : delete _CarouselTabs$propTyp2.children;
|
|
69
|
+
var _default = CarouselTabs;
|
|
70
|
+
exports.default = _default;
|
|
@@ -0,0 +1,95 @@
|
|
|
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 _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _StackView = _interopRequireDefault(require("../../StackView"));
|
|
15
|
+
|
|
16
|
+
var _CarouselContext = require("../CarouselContext");
|
|
17
|
+
|
|
18
|
+
var _CarouselTabsPanelItem = _interopRequireDefault(require("./CarouselTabsPanelItem"));
|
|
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
|
+
const CarouselTabsPanel = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
29
|
+
let {
|
|
30
|
+
items
|
|
31
|
+
} = _ref;
|
|
32
|
+
const {
|
|
33
|
+
activeIndex,
|
|
34
|
+
goTo
|
|
35
|
+
} = (0, _CarouselContext.useCarousel)();
|
|
36
|
+
const nextFocusRef = (0, _react.useRef)();
|
|
37
|
+
const firstTabRef = (0, _react.useRef)(); // TODO: figure out a better cross-brand way to specify subcomponent variants.
|
|
38
|
+
// For now, this picks an Allium variant, and does nothing in brands that lack it.
|
|
39
|
+
// See similar comment in Carousel and https://github.com/telus/universal-design-system/issues/1549
|
|
40
|
+
|
|
41
|
+
const dividerVariant = {
|
|
42
|
+
decorative: true
|
|
43
|
+
};
|
|
44
|
+
const lastTabSelected = activeIndex === items.length - 1;
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
47
|
+
focusable: true,
|
|
48
|
+
accessible: true,
|
|
49
|
+
onFocus: event => {
|
|
50
|
+
// When user forward-tabs into this section, focus the next tab; if they backwards-tab
|
|
51
|
+
// (shift-tab) back into the carousel content, don't interfere.
|
|
52
|
+
const previousWebFocus = event.relatedTarget;
|
|
53
|
+
if (previousWebFocus !== firstTabRef.current) nextFocusRef.current.focus();
|
|
54
|
+
}
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
|
|
56
|
+
direction: "row",
|
|
57
|
+
space: 3,
|
|
58
|
+
divider: {
|
|
59
|
+
variant: dividerVariant
|
|
60
|
+
},
|
|
61
|
+
ref: ref,
|
|
62
|
+
children: items.map((_ref2, index) => {
|
|
63
|
+
let {
|
|
64
|
+
title,
|
|
65
|
+
onPress,
|
|
66
|
+
...panelItemProps
|
|
67
|
+
} = _ref2;
|
|
68
|
+
const selected = index === activeIndex;
|
|
69
|
+
const isNext = index === activeIndex + 1; // Selected item should be always unfocusable and unpressable
|
|
70
|
+
|
|
71
|
+
const handlePress = selected ? undefined : event => {
|
|
72
|
+
if (typeof onPress === 'function') onPress(event, index);
|
|
73
|
+
goTo(index);
|
|
74
|
+
};
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselTabsPanelItem.default, {
|
|
76
|
+
ref: isNext && nextFocusRef || index === 0 && firstTabRef || null,
|
|
77
|
+
title: title,
|
|
78
|
+
selected: selected,
|
|
79
|
+
onPress: handlePress,
|
|
80
|
+
...panelItemProps
|
|
81
|
+
}, title);
|
|
82
|
+
})
|
|
83
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
84
|
+
focusable: true,
|
|
85
|
+
accessible: true,
|
|
86
|
+
ref: lastTabSelected ? nextFocusRef : null
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
CarouselTabsPanel.displayName = 'CarouselTabsPanel';
|
|
91
|
+
CarouselTabsPanel.propTypes = {
|
|
92
|
+
items: _propTypes.default.arrayOf(_propTypes.default.shape(_CarouselTabsPanelItem.default.propTypes || {}))
|
|
93
|
+
};
|
|
94
|
+
var _default = CarouselTabsPanel;
|
|
95
|
+
exports.default = _default;
|
|
@@ -0,0 +1,148 @@
|
|
|
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 _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
17
|
+
|
|
18
|
+
var _ThemeProvider = require("../../ThemeProvider");
|
|
19
|
+
|
|
20
|
+
var _utils = require("../../utils");
|
|
21
|
+
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
const [selectPressProps, pressPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.pressProps, _utils.viewProps]);
|
|
31
|
+
const [selectTextProps, textPropTypes] = (0, _utils.selectSystemProps)([_utils.textProps]);
|
|
32
|
+
|
|
33
|
+
const selectContainerStyles = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
paddingLeft,
|
|
36
|
+
paddingRight,
|
|
37
|
+
paddingTop,
|
|
38
|
+
paddingBottom = 0,
|
|
39
|
+
borderBottomColor,
|
|
40
|
+
borderBottomWidth = 0,
|
|
41
|
+
borderBottomStyle,
|
|
42
|
+
flex,
|
|
43
|
+
alignItems,
|
|
44
|
+
justifyContent
|
|
45
|
+
} = _ref;
|
|
46
|
+
return {
|
|
47
|
+
paddingLeft,
|
|
48
|
+
paddingRight,
|
|
49
|
+
paddingTop,
|
|
50
|
+
paddingBottom: paddingBottom - borderBottomWidth,
|
|
51
|
+
borderBottomColor,
|
|
52
|
+
borderBottomWidth,
|
|
53
|
+
borderBottomStyle,
|
|
54
|
+
flex,
|
|
55
|
+
alignItems,
|
|
56
|
+
justifyContent,
|
|
57
|
+
..._Platform.default.select({
|
|
58
|
+
// Removes the default browser :focus outline
|
|
59
|
+
web: {
|
|
60
|
+
outline: 'none'
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const selectTextStyles = _ref2 => {
|
|
67
|
+
let {
|
|
68
|
+
fontSize,
|
|
69
|
+
fontScaleCap,
|
|
70
|
+
lineHeight,
|
|
71
|
+
letterSpacing,
|
|
72
|
+
fontWeight,
|
|
73
|
+
fontName,
|
|
74
|
+
color
|
|
75
|
+
} = _ref2;
|
|
76
|
+
return (0, _ThemeProvider.applyTextStyles)({
|
|
77
|
+
fontSize,
|
|
78
|
+
fontScaleCap,
|
|
79
|
+
lineHeight,
|
|
80
|
+
letterSpacing,
|
|
81
|
+
fontWeight,
|
|
82
|
+
fontName,
|
|
83
|
+
color
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const CarouselTabsPanelItem = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
88
|
+
let {
|
|
89
|
+
title,
|
|
90
|
+
selected,
|
|
91
|
+
inactive,
|
|
92
|
+
variant,
|
|
93
|
+
tokens,
|
|
94
|
+
accessibilityRole = 'tab',
|
|
95
|
+
...rest
|
|
96
|
+
} = _ref3;
|
|
97
|
+
// Workaround for React Native Web https://github.com/necolas/react-native-web/issues/2357
|
|
98
|
+
// Don't allow disabled to be set while focus is true else focus state gets locked `true`
|
|
99
|
+
// (must refocus _after_ calling `goTo`, else focus target content is not up to date)
|
|
100
|
+
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
101
|
+
const disabled = (inactive || selected) && !isFocused;
|
|
102
|
+
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('CarouselTabsPanelItem', tokens, variant);
|
|
103
|
+
|
|
104
|
+
const resolveTokens = pressState => getTokens((0, _utils.resolvePressableState)(pressState, {
|
|
105
|
+
selected
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
const getContainerStyle = pressState => selectContainerStyles(resolveTokens(pressState));
|
|
109
|
+
|
|
110
|
+
const getTextStyle = pressState => selectTextStyles(resolveTokens(pressState));
|
|
111
|
+
|
|
112
|
+
const {
|
|
113
|
+
onPress,
|
|
114
|
+
...selectedPressProps
|
|
115
|
+
} = selectPressProps(rest);
|
|
116
|
+
|
|
117
|
+
const handleKeyDown = event => {
|
|
118
|
+
// Allow using the spacebar for navigation
|
|
119
|
+
if ((event === null || event === void 0 ? void 0 : event.key) === ' ') onPress(event);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
123
|
+
onPress: onPress,
|
|
124
|
+
style: getContainerStyle,
|
|
125
|
+
accessibilityRole: accessibilityRole,
|
|
126
|
+
ref: ref,
|
|
127
|
+
onKeyDown: handleKeyDown,
|
|
128
|
+
onFocus: () => setIsFocused(true),
|
|
129
|
+
onBlur: () => setIsFocused(false),
|
|
130
|
+
disabled: disabled,
|
|
131
|
+
...selectedPressProps,
|
|
132
|
+
children: pressState => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
133
|
+
style: getTextStyle(pressState),
|
|
134
|
+
...selectTextProps(rest),
|
|
135
|
+
children: title
|
|
136
|
+
})
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
CarouselTabsPanelItem.displayName = 'CarouselTabsPanelItem';
|
|
140
|
+
CarouselTabsPanelItem.propTypes = { ...pressPropTypes,
|
|
141
|
+
...textPropTypes,
|
|
142
|
+
title: _propTypes.default.string.isRequired,
|
|
143
|
+
selected: _propTypes.default.bool,
|
|
144
|
+
tokens: (0, _utils.getTokensPropType)('CarouselTabsPanelItem'),
|
|
145
|
+
variant: _utils.variantProp.propType
|
|
146
|
+
};
|
|
147
|
+
var _default = CarouselTabsPanelItem;
|
|
148
|
+
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 _CarouselTabs = _interopRequireDefault(require("./CarouselTabs"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _CarouselTabs.default;
|
|
13
|
+
exports.default = _default;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(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 _Image = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Image"));
|
|
15
|
+
|
|
16
|
+
var _CarouselContext = require("./CarouselContext");
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* `Carousel.Thumbnail` is used to wrap the content of an individual slide and is suppsoed to be the
|
|
24
|
+
* only top-level component passed to the `Carousel`
|
|
25
|
+
*/
|
|
26
|
+
const CarouselThumbnail = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
accessibilityLabel,
|
|
29
|
+
alt,
|
|
30
|
+
index,
|
|
31
|
+
src
|
|
32
|
+
} = _ref;
|
|
33
|
+
const {
|
|
34
|
+
activeIndex,
|
|
35
|
+
itemLabel,
|
|
36
|
+
totalItems,
|
|
37
|
+
getCopyWithPlaceholders,
|
|
38
|
+
goTo,
|
|
39
|
+
themeTokens
|
|
40
|
+
} = (0, _CarouselContext.useCarousel)();
|
|
41
|
+
const thumbnailTitle = alt !== null && alt !== void 0 ? alt : getCopyWithPlaceholders('stepTrackerLabel').replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, index).replace(/%\{stepCount\}/g, totalItems);
|
|
42
|
+
|
|
43
|
+
const handlePress = () => goTo(index);
|
|
44
|
+
|
|
45
|
+
const handleKeyDown = event => {
|
|
46
|
+
// Allow using the spacebar for navigation
|
|
47
|
+
if ((event === null || event === void 0 ? void 0 : event.key) === ' ') goTo(index);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
thumbnailBorderColor,
|
|
52
|
+
thumbnailBorderRadius,
|
|
53
|
+
thumbnailBorderWidth,
|
|
54
|
+
thumbnailMargin,
|
|
55
|
+
thumbnailPadding,
|
|
56
|
+
thumbnailSelectedBorderColor,
|
|
57
|
+
thumbnailSelectedBorderWidth,
|
|
58
|
+
thumbnailSize
|
|
59
|
+
} = themeTokens;
|
|
60
|
+
const styles = {
|
|
61
|
+
pressable: {
|
|
62
|
+
borderColor: thumbnailBorderColor,
|
|
63
|
+
borderRadius: thumbnailBorderRadius,
|
|
64
|
+
borderWidth: thumbnailBorderWidth,
|
|
65
|
+
margin: thumbnailMargin,
|
|
66
|
+
padding: thumbnailPadding
|
|
67
|
+
},
|
|
68
|
+
image: {
|
|
69
|
+
height: thumbnailSize,
|
|
70
|
+
width: thumbnailSize
|
|
71
|
+
},
|
|
72
|
+
selected: {
|
|
73
|
+
borderColor: thumbnailSelectedBorderColor,
|
|
74
|
+
borderWidth: thumbnailSelectedBorderWidth,
|
|
75
|
+
padding: thumbnailPadding - thumbnailSelectedBorderWidth + thumbnailBorderWidth
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
79
|
+
onKeyDown: handleKeyDown,
|
|
80
|
+
onPress: handlePress,
|
|
81
|
+
style: [styles.pressable, index === activeIndex && styles.selected],
|
|
82
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
|
|
83
|
+
accessibilityIgnoresInvertColors: true,
|
|
84
|
+
accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : alt,
|
|
85
|
+
source: src,
|
|
86
|
+
style: styles.image,
|
|
87
|
+
title: thumbnailTitle
|
|
88
|
+
})
|
|
89
|
+
}, src);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
CarouselThumbnail.propTypes = {
|
|
93
|
+
accessibilityLabel: _propTypes.default.string,
|
|
94
|
+
alt: _propTypes.default.string,
|
|
95
|
+
index: _propTypes.default.number,
|
|
96
|
+
src: _propTypes.default.string
|
|
97
|
+
};
|
|
98
|
+
var _default = CarouselThumbnail;
|
|
99
|
+
exports.default = _default;
|
|
@@ -0,0 +1,87 @@
|
|
|
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 _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
13
|
+
|
|
14
|
+
var _CarouselContext = require("./CarouselContext");
|
|
15
|
+
|
|
16
|
+
var _CarouselThumbnail = _interopRequireDefault(require("./CarouselThumbnail"));
|
|
17
|
+
|
|
18
|
+
var _StackView = require("../StackView");
|
|
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
|
+
const CarouselThumbnailNavigation = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
29
|
+
let {
|
|
30
|
+
thumbnails = []
|
|
31
|
+
} = _ref;
|
|
32
|
+
const {
|
|
33
|
+
totalItems,
|
|
34
|
+
themeTokens
|
|
35
|
+
} = (0, _CarouselContext.useCarousel)();
|
|
36
|
+
|
|
37
|
+
if (thumbnails.length !== totalItems) {
|
|
38
|
+
throw new Error('Thumbnail set provided does not match the number of slides in the carousel');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const {
|
|
42
|
+
thumbnailContainerPaddingTop,
|
|
43
|
+
thumbnailMargin
|
|
44
|
+
} = themeTokens;
|
|
45
|
+
const stackWrapTokens = {
|
|
46
|
+
justifyContent: 'flex-start'
|
|
47
|
+
};
|
|
48
|
+
const containerStyles = {
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
paddingTop: thumbnailContainerPaddingTop - thumbnailMargin
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
54
|
+
style: containerStyles,
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.StackWrap, {
|
|
56
|
+
direction: "row",
|
|
57
|
+
tokens: stackWrapTokens,
|
|
58
|
+
ref: ref,
|
|
59
|
+
children: thumbnails.map((_ref2, index) => {
|
|
60
|
+
let {
|
|
61
|
+
accessibilityLabel,
|
|
62
|
+
alt,
|
|
63
|
+
src
|
|
64
|
+
} = _ref2;
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselThumbnail.default, {
|
|
66
|
+
accessibilityLabel: accessibilityLabel,
|
|
67
|
+
alt: alt,
|
|
68
|
+
index: index,
|
|
69
|
+
src: src
|
|
70
|
+
}, src);
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
CarouselThumbnailNavigation.displayName = 'CarouselThumbnailNavigation';
|
|
76
|
+
CarouselThumbnailNavigation.propTypes = {
|
|
77
|
+
/**
|
|
78
|
+
* An array of objects containing information on the thumbnail images.
|
|
79
|
+
*/
|
|
80
|
+
thumbnails: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
81
|
+
accessibilityLabel: _propTypes.default.string,
|
|
82
|
+
alt: _propTypes.default.string,
|
|
83
|
+
src: _propTypes.default.string
|
|
84
|
+
})).isRequired
|
|
85
|
+
};
|
|
86
|
+
var _default = CarouselThumbnailNavigation;
|
|
87
|
+
exports.default = _default;
|
|
@@ -10,14 +10,16 @@ var _default = {
|
|
|
10
10
|
carouselLabel: '%{stepCount} items',
|
|
11
11
|
iconButtonLabel: 'Show %{itemLabel} %{targetStep} of %{stepCount}',
|
|
12
12
|
stepLabel: '%{itemLabel} %{stepNumber}',
|
|
13
|
-
stepTrackerLabel: '%{itemLabel} %{stepNumber} of %{stepCount}'
|
|
13
|
+
stepTrackerLabel: '%{itemLabel} %{stepNumber} of %{stepCount}',
|
|
14
|
+
skipLink: 'Skip %{title}'
|
|
14
15
|
},
|
|
15
16
|
fr: {
|
|
16
17
|
// TODO: French translations here
|
|
17
18
|
carouselLabel: '(fr) %{stepCount} items',
|
|
18
19
|
iconButtonLabel: '(fr) Show %{itemLabel} %{targetStep} of %{stepCount}',
|
|
19
20
|
stepLabel: '(fr) %{itemLabel} %{stepNumber}',
|
|
20
|
-
stepTrackerLabel: '(fr) %{itemLabel} %{stepNumber} of %{stepCount}'
|
|
21
|
+
stepTrackerLabel: '(fr) %{itemLabel} %{stepNumber} of %{stepCount}',
|
|
22
|
+
skipLink: '(fr) Skip %{title}'
|
|
21
23
|
}
|
|
22
24
|
};
|
|
23
25
|
exports.default = _default;
|
package/lib/Carousel/index.js
CHANGED
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
Carousel: true
|
|
7
|
+
Carousel: true,
|
|
8
|
+
CarouselTabs: true
|
|
8
9
|
};
|
|
9
10
|
Object.defineProperty(exports, "Carousel", {
|
|
10
11
|
enumerable: true,
|
|
@@ -12,6 +13,12 @@ Object.defineProperty(exports, "Carousel", {
|
|
|
12
13
|
return _Carousel.default;
|
|
13
14
|
}
|
|
14
15
|
});
|
|
16
|
+
Object.defineProperty(exports, "CarouselTabs", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _CarouselTabs.default;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
15
22
|
|
|
16
23
|
var _CarouselContext = require("./CarouselContext");
|
|
17
24
|
|
|
@@ -29,4 +36,6 @@ Object.keys(_CarouselContext).forEach(function (key) {
|
|
|
29
36
|
|
|
30
37
|
var _Carousel = _interopRequireDefault(require("./Carousel"));
|
|
31
38
|
|
|
39
|
+
var _CarouselTabs = _interopRequireDefault(require("./CarouselTabs"));
|
|
40
|
+
|
|
32
41
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/Checkbox/Checkbox.js
CHANGED
|
@@ -74,7 +74,7 @@ const selectInputStyles = (_ref, isChecked) => {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
const selectLabelStyles = _ref2 => {
|
|
77
|
+
const selectLabelStyles = (_ref2, themeOptions) => {
|
|
78
78
|
let {
|
|
79
79
|
labelColor,
|
|
80
80
|
labelFontName,
|
|
@@ -90,7 +90,8 @@ const selectLabelStyles = _ref2 => {
|
|
|
90
90
|
fontName: labelFontName,
|
|
91
91
|
fontWeight: labelFontWeight,
|
|
92
92
|
fontSize: labelFontSize,
|
|
93
|
-
lineHeight: labelLineHeight
|
|
93
|
+
lineHeight: labelLineHeight,
|
|
94
|
+
themeOptions
|
|
94
95
|
})
|
|
95
96
|
};
|
|
96
97
|
};
|
|
@@ -215,6 +216,9 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
215
216
|
|
|
216
217
|
const uniqueId = (0, _useUniqueId.default)('checkbox');
|
|
217
218
|
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
219
|
+
const {
|
|
220
|
+
themeOptions
|
|
221
|
+
} = (0, _ThemeProvider.useTheme)();
|
|
218
222
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
219
223
|
style: staticStyles.wrapper,
|
|
220
224
|
ref: ref,
|
|
@@ -246,7 +250,7 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
246
250
|
pressed
|
|
247
251
|
});
|
|
248
252
|
const iconTokens = selectIconTokens(stateTokens);
|
|
249
|
-
const labelStyles = selectLabelStyles(stateTokens);
|
|
253
|
+
const labelStyles = selectLabelStyles(stateTokens, themeOptions);
|
|
250
254
|
const alignWithLabel = label ? [staticStyles.alignWithLabel, {
|
|
251
255
|
height: labelStyles.lineHeight
|
|
252
256
|
}] : null;
|