@telus-uds/components-web 2.43.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +26 -0
- package/CHANGELOG.md +21 -2
- package/babel.config.cjs +4 -0
- package/jest.config.cjs +29 -0
- package/lib/Badge/Badge.js +21 -29
- package/lib/Badge/index.js +2 -10
- package/lib/BlockQuote/BlockQuote.js +31 -39
- package/lib/BlockQuote/index.js +2 -10
- package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
- package/lib/Breadcrumbs/Item/Item.js +26 -34
- package/lib/Breadcrumbs/index.js +1 -13
- package/lib/Callout/Callout.js +19 -27
- package/lib/Callout/index.js +2 -10
- package/lib/Card/Card.js +44 -54
- package/lib/Card/CardContent.js +17 -25
- package/lib/Card/CardFooter.js +16 -24
- package/lib/Card/index.js +2 -10
- package/lib/Countdown/Countdown.js +34 -42
- package/lib/Countdown/Segment.js +26 -34
- package/lib/Countdown/constants.js +4 -14
- package/lib/Countdown/dictionary.js +2 -9
- package/lib/Countdown/index.js +2 -10
- package/lib/Countdown/types.js +18 -28
- package/lib/Countdown/useCountdown.js +4 -11
- package/lib/DatePicker/CalendarContainer.js +6 -12
- package/lib/DatePicker/DatePicker.js +105 -101
- package/lib/DatePicker/dictionary.js +1 -8
- package/lib/DatePicker/index.js +2 -10
- package/lib/DatePicker/reactDatesCss.js +3 -10
- package/lib/Disclaimer/Disclaimer.js +15 -23
- package/lib/Disclaimer/index.js +1 -13
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
- package/lib/ExpandCollapseMini/index.js +2 -10
- package/lib/Footnote/Footnote.js +85 -95
- package/lib/Footnote/FootnoteLink.js +25 -33
- package/lib/Footnote/dictionary.js +2 -9
- package/lib/Footnote/index.js +4 -12
- package/lib/IconButton/IconButton.js +12 -20
- package/lib/IconButton/index.js +2 -10
- package/lib/Image/Image.js +17 -25
- package/lib/Image/index.js +6 -18
- package/lib/Image/server.js +4 -12
- package/lib/List/List.js +2 -9
- package/lib/List/ListItem.js +10 -18
- package/lib/List/index.js +4 -12
- package/lib/NavigationBar/NavigationBar.js +51 -59
- package/lib/NavigationBar/NavigationItem.js +19 -27
- package/lib/NavigationBar/NavigationSubMenu.js +34 -40
- package/lib/NavigationBar/collapseItems.js +1 -11
- package/lib/NavigationBar/index.js +4 -12
- package/lib/NavigationBar/resolveItemSelection.js +1 -8
- package/lib/OptimizeImage/OptimizeImage.js +26 -34
- package/lib/OptimizeImage/index.js +2 -10
- package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
- package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
- package/lib/OptimizeImage/utils/index.js +5 -34
- package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
- package/lib/OrderedList/Item.js +28 -36
- package/lib/OrderedList/ItemBase.js +8 -16
- package/lib/OrderedList/OrderedList.js +22 -30
- package/lib/OrderedList/OrderedListBase.js +12 -20
- package/lib/OrderedList/constants.js +1 -8
- package/lib/OrderedList/index.js +4 -12
- package/lib/Paragraph/Paragraph.js +22 -30
- package/lib/Paragraph/index.js +2 -10
- package/lib/PreviewCard/AuthorDate.js +17 -21
- package/lib/PreviewCard/PreviewCard.js +40 -49
- package/lib/PreviewCard/index.js +2 -10
- package/lib/PriceLockup/PriceLockup.js +56 -64
- package/lib/PriceLockup/index.js +2 -10
- package/lib/PriceLockup/tokens.js +2 -9
- package/lib/Progress/ProgressBar.js +17 -24
- package/lib/Progress/index.js +4 -12
- package/lib/QuantitySelector/QuantitySelector.js +55 -63
- package/lib/QuantitySelector/SideButton.js +15 -23
- package/lib/QuantitySelector/dictionary.js +2 -9
- package/lib/QuantitySelector/index.js +2 -10
- package/lib/QuantitySelector/styles.js +4 -13
- package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
- package/lib/ResponsiveImage/index.js +2 -10
- package/lib/Ribbon/Ribbon.js +22 -30
- package/lib/Ribbon/index.js +2 -10
- package/lib/SkeletonProvider/SkeletonImage.js +14 -22
- package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
- package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
- package/lib/SkeletonProvider/index.js +2 -10
- package/lib/Span/Span.js +23 -31
- package/lib/Span/index.js +2 -10
- package/lib/Spinner/Spinner.js +43 -51
- package/lib/Spinner/SpinnerContent.js +21 -29
- package/lib/Spinner/constants.js +4 -14
- package/lib/Spinner/index.js +2 -10
- package/lib/StoryCard/StoryCard.js +40 -49
- package/lib/StoryCard/index.js +2 -10
- package/lib/Table/Body.js +7 -15
- package/lib/Table/Cell.js +28 -38
- package/lib/Table/Header.js +11 -19
- package/lib/Table/Row.js +8 -16
- package/lib/Table/SubHeading.js +10 -18
- package/lib/Table/Table.js +26 -35
- package/lib/Table/index.js +12 -20
- package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
- package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
- package/lib/TermsAndConditions/dictionary.js +2 -9
- package/lib/TermsAndConditions/index.js +1 -13
- package/lib/Testimonial/Testimonial.js +37 -45
- package/lib/Testimonial/index.js +2 -10
- package/lib/Toast/Toast.js +32 -42
- package/lib/Toast/index.js +2 -10
- package/lib/Video/ControlBar/ControlBar.js +73 -81
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
- package/lib/Video/Video.js +74 -83
- package/lib/Video/index.js +2 -10
- package/lib/Video/videoText.js +1 -8
- package/lib/VideoPicker/VideoPicker.js +43 -53
- package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
- package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
- package/lib/VideoPicker/VideoSlider.js +17 -26
- package/lib/VideoPicker/index.js +2 -10
- package/lib/VideoPicker/videoPropType.js +9 -18
- package/lib/WaffleGrid/WaffleGrid.js +33 -43
- package/lib/WaffleGrid/index.js +2 -10
- package/lib/WebVideo/WebVideo.js +42 -52
- package/lib/WebVideo/index.js +2 -10
- package/lib/WebVideo/utils/index.js +3 -11
- package/lib/baseExports.js +18 -431
- package/lib/index.js +38 -323
- package/lib/server.js +4 -12
- package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
- package/lib/shared/ConditionalWrapper/index.js +2 -10
- package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
- package/lib/shared/FullBleedContent/index.js +4 -24
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
- package/lib/shared/VideoSplash/VideoSplash.js +24 -32
- package/lib/shared/VideoSplash/helpers.js +5 -14
- package/lib/utils/index.js +10 -75
- package/lib/utils/isElementFocusable.js +1 -8
- package/lib/utils/logger.js +6 -15
- package/lib/utils/media.js +5 -11
- package/lib/utils/renderStructuredContent.js +8 -15
- package/lib/utils/ssr.js +5 -12
- package/lib/utils/theming/get-theme-from-server.js +2 -10
- package/lib/utils/theming/with-client-theme.js +9 -17
- package/lib/utils/theming/with-server-theme.js +11 -19
- package/lib/utils/transforms.js +3 -11
- package/lib/utils/useOverlaidPosition.js +15 -23
- package/lib/utils/useTypographyTheme.js +6 -13
- package/package.json +18 -20
- package/src/Card/Card.jsx +2 -2
- package/src/DatePicker/DatePicker.jsx +17 -4
- package/src/PreviewCard/AuthorDate.jsx +5 -3
- package/src/utils/logger.js +2 -2
- package/lib-module/Badge/Badge.js +0 -121
- package/lib-module/Badge/index.js +0 -2
- package/lib-module/BlockQuote/BlockQuote.js +0 -204
- package/lib-module/BlockQuote/index.js +0 -2
- package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
- package/lib-module/Breadcrumbs/Item/Item.js +0 -175
- package/lib-module/Breadcrumbs/index.js +0 -1
- package/lib-module/Callout/Callout.js +0 -135
- package/lib-module/Callout/index.js +0 -2
- package/lib-module/Card/Card.js +0 -251
- package/lib-module/Card/CardContent.js +0 -90
- package/lib-module/Card/CardFooter.js +0 -78
- package/lib-module/Card/index.js +0 -2
- package/lib-module/Countdown/Countdown.js +0 -169
- package/lib-module/Countdown/Segment.js +0 -96
- package/lib-module/Countdown/constants.js +0 -4
- package/lib-module/Countdown/dictionary.js +0 -22
- package/lib-module/Countdown/index.js +0 -2
- package/lib-module/Countdown/types.js +0 -24
- package/lib-module/Countdown/useCountdown.js +0 -26
- package/lib-module/DatePicker/CalendarContainer.js +0 -208
- package/lib-module/DatePicker/DatePicker.js +0 -506
- package/lib-module/DatePicker/dictionary.js +0 -119
- package/lib-module/DatePicker/index.js +0 -2
- package/lib-module/DatePicker/reactDatesCss.js +0 -3
- package/lib-module/Disclaimer/Disclaimer.js +0 -54
- package/lib-module/Disclaimer/index.js +0 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
- package/lib-module/ExpandCollapseMini/index.js +0 -2
- package/lib-module/Footnote/Footnote.js +0 -632
- package/lib-module/Footnote/FootnoteLink.js +0 -118
- package/lib-module/Footnote/dictionary.js +0 -12
- package/lib-module/Footnote/index.js +0 -4
- package/lib-module/IconButton/IconButton.js +0 -55
- package/lib-module/IconButton/index.js +0 -2
- package/lib-module/Image/Image.js +0 -83
- package/lib-module/Image/index.js +0 -9
- package/lib-module/Image/server.js +0 -4
- package/lib-module/List/List.js +0 -2
- package/lib-module/List/ListItem.js +0 -28
- package/lib-module/List/index.js +0 -4
- package/lib-module/NavigationBar/NavigationBar.js +0 -224
- package/lib-module/NavigationBar/NavigationItem.js +0 -87
- package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
- package/lib-module/NavigationBar/collapseItems.js +0 -41
- package/lib-module/NavigationBar/index.js +0 -4
- package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
- package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
- package/lib-module/OptimizeImage/index.js +0 -2
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
- package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
- package/lib-module/OptimizeImage/utils/index.js +0 -5
- package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
- package/lib-module/OrderedList/Item.js +0 -145
- package/lib-module/OrderedList/ItemBase.js +0 -27
- package/lib-module/OrderedList/OrderedList.js +0 -86
- package/lib-module/OrderedList/OrderedListBase.js +0 -45
- package/lib-module/OrderedList/constants.js +0 -2
- package/lib-module/OrderedList/index.js +0 -4
- package/lib-module/Paragraph/Paragraph.js +0 -90
- package/lib-module/Paragraph/index.js +0 -2
- package/lib-module/PreviewCard/AuthorDate.js +0 -57
- package/lib-module/PreviewCard/PreviewCard.js +0 -209
- package/lib-module/PreviewCard/index.js +0 -2
- package/lib-module/PriceLockup/PriceLockup.js +0 -335
- package/lib-module/PriceLockup/index.js +0 -2
- package/lib-module/PriceLockup/tokens.js +0 -55
- package/lib-module/Progress/ProgressBar.js +0 -83
- package/lib-module/Progress/index.js +0 -4
- package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
- package/lib-module/QuantitySelector/SideButton.js +0 -70
- package/lib-module/QuantitySelector/dictionary.js +0 -26
- package/lib-module/QuantitySelector/index.js +0 -2
- package/lib-module/QuantitySelector/styles.js +0 -9
- package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
- package/lib-module/ResponsiveImage/index.js +0 -2
- package/lib-module/Ribbon/Ribbon.js +0 -216
- package/lib-module/Ribbon/index.js +0 -2
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
- package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib-module/SkeletonProvider/index.js +0 -2
- package/lib-module/Span/Span.js +0 -72
- package/lib-module/Span/index.js +0 -2
- package/lib-module/Spinner/Spinner.js +0 -215
- package/lib-module/Spinner/SpinnerContent.js +0 -94
- package/lib-module/Spinner/constants.js +0 -4
- package/lib-module/Spinner/index.js +0 -2
- package/lib-module/StoryCard/StoryCard.js +0 -212
- package/lib-module/StoryCard/index.js +0 -2
- package/lib-module/Table/Body.js +0 -17
- package/lib-module/Table/Cell.js +0 -176
- package/lib-module/Table/Header.js +0 -25
- package/lib-module/Table/Row.js +0 -19
- package/lib-module/Table/SubHeading.js +0 -23
- package/lib-module/Table/Table.js +0 -114
- package/lib-module/Table/index.js +0 -12
- package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
- package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
- package/lib-module/TermsAndConditions/dictionary.js +0 -16
- package/lib-module/TermsAndConditions/index.js +0 -1
- package/lib-module/Testimonial/Testimonial.js +0 -234
- package/lib-module/Testimonial/index.js +0 -2
- package/lib-module/Toast/Toast.js +0 -158
- package/lib-module/Toast/index.js +0 -2
- package/lib-module/Video/ControlBar/ControlBar.js +0 -288
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
- package/lib-module/Video/Video.js +0 -959
- package/lib-module/Video/index.js +0 -2
- package/lib-module/Video/videoText.js +0 -55
- package/lib-module/VideoPicker/VideoPicker.js +0 -190
- package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
- package/lib-module/VideoPicker/VideoSlider.js +0 -82
- package/lib-module/VideoPicker/index.js +0 -2
- package/lib-module/VideoPicker/videoPropType.js +0 -10
- package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
- package/lib-module/WaffleGrid/index.js +0 -2
- package/lib-module/WebVideo/WebVideo.js +0 -191
- package/lib-module/WebVideo/index.js +0 -2
- package/lib-module/WebVideo/utils/index.js +0 -50
- package/lib-module/baseExports.js +0 -19
- package/lib-module/index.js +0 -40
- package/lib-module/server.js +0 -5
- package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
- package/lib-module/shared/ConditionalWrapper/index.js +0 -2
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
- package/lib-module/shared/FullBleedContent/index.js +0 -4
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
- package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
- package/lib-module/shared/VideoSplash/helpers.js +0 -23
- package/lib-module/utils/index.js +0 -10
- package/lib-module/utils/isElementFocusable.js +0 -8
- package/lib-module/utils/logger.js +0 -18
- package/lib-module/utils/media.js +0 -39
- package/lib-module/utils/renderStructuredContent.js +0 -66
- package/lib-module/utils/ssr.js +0 -37
- package/lib-module/utils/theming/get-theme-from-server.js +0 -16
- package/lib-module/utils/theming/with-client-theme.js +0 -24
- package/lib-module/utils/theming/with-server-theme.js +0 -26
- package/lib-module/utils/transforms.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +0 -216
- package/lib-module/utils/useTypographyTheme.js +0 -24
package/lib/Table/Table.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
12
|
-
var _utils = require("../utils");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
16
|
-
const StyledContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { selectSystemProps, useSafeLayoutEffect, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
+
import throttle from 'lodash.throttle';
|
|
6
|
+
import { htmlAttrs } from '../utils';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
+
const StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
17
10
|
displayName: "Table__StyledContainer",
|
|
18
11
|
componentId: "components-web__sc-10d9q3m-0"
|
|
19
12
|
})(["overflow:auto;padding-bottom:", ";"], props => props.isScrollable ? `${props.tablePaddingBottom}px` : 0);
|
|
20
|
-
const StyledTable = /*#__PURE__*/
|
|
13
|
+
const StyledTable = /*#__PURE__*/styled.table.withConfig({
|
|
21
14
|
displayName: "Table__StyledTable",
|
|
22
15
|
componentId: "components-web__sc-10d9q3m-1"
|
|
23
16
|
})(["margin:0;padding:0;width:", ";border:", ";"], _ref => {
|
|
@@ -27,8 +20,8 @@ const StyledTable = /*#__PURE__*/_styledComponents.default.table.withConfig({
|
|
|
27
20
|
} = _ref;
|
|
28
21
|
return fullWidth ? '100%' : `${tableWidth}px`;
|
|
29
22
|
}, props => `${props.borderWidth}px solid ${props.borderColor}`);
|
|
30
|
-
const TableContext = /*#__PURE__*/
|
|
31
|
-
const useTableContext = () =>
|
|
23
|
+
const TableContext = /*#__PURE__*/React.createContext({});
|
|
24
|
+
export const useTableContext = () => React.useContext(TableContext);
|
|
32
25
|
|
|
33
26
|
/**
|
|
34
27
|
* Use `Table` to display tabular data.
|
|
@@ -44,7 +37,6 @@ const useTableContext = () => _react.default.useContext(TableContext);
|
|
|
44
37
|
* - Use `Table.Row` and `Table.Cell` to build up the tabular data
|
|
45
38
|
* - Use `Cell`'s `type` prop to visually mark it as a row heading (`type="rowHeading"`)
|
|
46
39
|
*/
|
|
47
|
-
exports.useTableContext = useTableContext;
|
|
48
40
|
const Table = _ref2 => {
|
|
49
41
|
let {
|
|
50
42
|
children,
|
|
@@ -59,12 +51,12 @@ const Table = _ref2 => {
|
|
|
59
51
|
tablePaddingBottom,
|
|
60
52
|
borderColor,
|
|
61
53
|
borderWidth
|
|
62
|
-
} =
|
|
63
|
-
const containerRef =
|
|
64
|
-
const tableRef =
|
|
65
|
-
const [containerWidth, setContainerWidth] =
|
|
66
|
-
const [tableWidth, setTableWidth] =
|
|
67
|
-
|
|
54
|
+
} = useThemeTokens('Table', tokens, variant);
|
|
55
|
+
const containerRef = React.useRef();
|
|
56
|
+
const tableRef = React.useRef();
|
|
57
|
+
const [containerWidth, setContainerWidth] = React.useState(0);
|
|
58
|
+
const [tableWidth, setTableWidth] = React.useState(0);
|
|
59
|
+
useSafeLayoutEffect(() => {
|
|
68
60
|
const updateDimensions = () => {
|
|
69
61
|
var _containerRef$current, _tableRef$current;
|
|
70
62
|
const containerClientWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientWidth;
|
|
@@ -72,7 +64,7 @@ const Table = _ref2 => {
|
|
|
72
64
|
setContainerWidth(containerClientWidth);
|
|
73
65
|
setTableWidth(responsiveTableWidth);
|
|
74
66
|
};
|
|
75
|
-
const throttledUpdateDimensions = (
|
|
67
|
+
const throttledUpdateDimensions = throttle(updateDimensions, 100, {
|
|
76
68
|
leading: false
|
|
77
69
|
});
|
|
78
70
|
updateDimensions();
|
|
@@ -86,18 +78,18 @@ const Table = _ref2 => {
|
|
|
86
78
|
};
|
|
87
79
|
}, []);
|
|
88
80
|
const isScrollable = tableWidth > containerWidth;
|
|
89
|
-
return /*#__PURE__*/(
|
|
81
|
+
return /*#__PURE__*/_jsx(StyledContainer, {
|
|
90
82
|
ref: containerRef,
|
|
91
83
|
isScrollable: isScrollable,
|
|
92
84
|
tablePaddingBottom: tablePaddingBottom,
|
|
93
|
-
children: /*#__PURE__*/(
|
|
85
|
+
children: /*#__PURE__*/_jsx(TableContext.Provider, {
|
|
94
86
|
value: {
|
|
95
87
|
text,
|
|
96
88
|
isScrollable,
|
|
97
89
|
tokens,
|
|
98
90
|
spacing
|
|
99
91
|
},
|
|
100
|
-
children: /*#__PURE__*/(
|
|
92
|
+
children: /*#__PURE__*/_jsx(StyledTable, {
|
|
101
93
|
borderColor: borderColor,
|
|
102
94
|
borderWidth: borderWidth,
|
|
103
95
|
tableWidth: tableWidth,
|
|
@@ -112,12 +104,11 @@ const Table = _ref2 => {
|
|
|
112
104
|
};
|
|
113
105
|
Table.propTypes = {
|
|
114
106
|
...selectedSystemPropTypes,
|
|
115
|
-
tokens:
|
|
116
|
-
children:
|
|
107
|
+
tokens: getTokensPropType('Table'),
|
|
108
|
+
children: PropTypes.node,
|
|
117
109
|
/**
|
|
118
110
|
* Sets text style
|
|
119
111
|
*/
|
|
120
|
-
text:
|
|
112
|
+
text: PropTypes.oneOf(['medium', 'small'])
|
|
121
113
|
};
|
|
122
|
-
|
|
123
|
-
exports.default = _default;
|
|
114
|
+
export default Table;
|
package/lib/Table/index.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
_Table.default.Header = _Header.default;
|
|
15
|
-
_Table.default.Body = _Body.default;
|
|
16
|
-
_Table.default.Row = _Row.default;
|
|
17
|
-
_Table.default.SubHeading = _SubHeading.default;
|
|
18
|
-
_Table.default.Cell = _Cell.default;
|
|
19
|
-
var _default = _Table.default;
|
|
20
|
-
exports.default = _default;
|
|
1
|
+
import Table from './Table';
|
|
2
|
+
import Header from './Header';
|
|
3
|
+
import Body from './Body';
|
|
4
|
+
import Row from './Row';
|
|
5
|
+
import SubHeading from './SubHeading';
|
|
6
|
+
import Cell from './Cell';
|
|
7
|
+
Table.Header = Header;
|
|
8
|
+
Table.Body = Body;
|
|
9
|
+
Table.Row = Row;
|
|
10
|
+
Table.SubHeading = SubHeading;
|
|
11
|
+
Table.Cell = Cell;
|
|
12
|
+
export default Table;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
const ExpandCollapseControl = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ExpandCollapse as ExpandCollapseBase, IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const ExpandCollapseControl = /*#__PURE__*/styled.div.withConfig({
|
|
14
7
|
displayName: "ExpandCollapse__ExpandCollapseControl",
|
|
15
8
|
componentId: "components-web__sc-1l2mmq7-0"
|
|
16
9
|
})({
|
|
@@ -20,7 +13,7 @@ const ExpandCollapseControl = /*#__PURE__*/_styledComponents.default.div.withCon
|
|
|
20
13
|
flex: 1,
|
|
21
14
|
justifyContent: 'flex-start'
|
|
22
15
|
});
|
|
23
|
-
const ExpandCollapseIconContainer = /*#__PURE__*/
|
|
16
|
+
const ExpandCollapseIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
24
17
|
displayName: "ExpandCollapse__ExpandCollapseIconContainer",
|
|
25
18
|
componentId: "components-web__sc-1l2mmq7-1"
|
|
26
19
|
})(_ref => {
|
|
@@ -35,7 +28,7 @@ const ExpandCollapseIconContainer = /*#__PURE__*/_styledComponents.default.div.w
|
|
|
35
28
|
width: tokens.expandIconContainerWidth
|
|
36
29
|
};
|
|
37
30
|
});
|
|
38
|
-
const ExpandCollapseTitle = /*#__PURE__*/
|
|
31
|
+
const ExpandCollapseTitle = /*#__PURE__*/styled.h4.withConfig({
|
|
39
32
|
displayName: "ExpandCollapse__ExpandCollapseTitle",
|
|
40
33
|
componentId: "components-web__sc-1l2mmq7-2"
|
|
41
34
|
})(_ref2 => {
|
|
@@ -70,7 +63,7 @@ const getIconButtonTokens = _ref3 => {
|
|
|
70
63
|
outerBorderWidth: iconOuterBorderWidth
|
|
71
64
|
};
|
|
72
65
|
};
|
|
73
|
-
const ExpandCollapse = /*#__PURE__*/
|
|
66
|
+
const ExpandCollapse = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
74
67
|
let {
|
|
75
68
|
children,
|
|
76
69
|
collapseTitle,
|
|
@@ -78,7 +71,7 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
78
71
|
expandLabel,
|
|
79
72
|
collapseLabel
|
|
80
73
|
} = _ref4;
|
|
81
|
-
const getTokens =
|
|
74
|
+
const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {});
|
|
82
75
|
const {
|
|
83
76
|
expandBaseBorderWidth,
|
|
84
77
|
expandContentPaddingBottom,
|
|
@@ -93,11 +86,11 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
93
86
|
expandTitleBorderColor,
|
|
94
87
|
expandTitleUnderline
|
|
95
88
|
} = getTokens();
|
|
96
|
-
return /*#__PURE__*/(
|
|
89
|
+
return /*#__PURE__*/_jsx(ExpandCollapseBase, {
|
|
97
90
|
tokens: {
|
|
98
91
|
borderWidth: expandBaseBorderWidth
|
|
99
92
|
},
|
|
100
|
-
children: expandProps => /*#__PURE__*/(
|
|
93
|
+
children: expandProps => /*#__PURE__*/_jsx(ExpandCollapseBase.Panel, {
|
|
101
94
|
...expandProps,
|
|
102
95
|
panelId: "ExpandCollapsePanel",
|
|
103
96
|
controlTokens: {
|
|
@@ -117,11 +110,11 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
117
110
|
} = pressableState || {};
|
|
118
111
|
const iconTokens = getIconButtonTokens(getTokens(pressableState || {}));
|
|
119
112
|
const label = expanded ? collapseLabel : expandLabel;
|
|
120
|
-
return /*#__PURE__*/(
|
|
113
|
+
return /*#__PURE__*/_jsxs(ExpandCollapseControl, {
|
|
121
114
|
ref: ref,
|
|
122
|
-
children: [/*#__PURE__*/(
|
|
115
|
+
children: [/*#__PURE__*/_jsx(ExpandCollapseIconContainer, {
|
|
123
116
|
tokens: getTokens(),
|
|
124
|
-
children: /*#__PURE__*/(
|
|
117
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
125
118
|
variant: {
|
|
126
119
|
size: 'small'
|
|
127
120
|
},
|
|
@@ -129,7 +122,7 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
129
122
|
focusable: false,
|
|
130
123
|
accessibilityLabel: label
|
|
131
124
|
})
|
|
132
|
-
}), /*#__PURE__*/(
|
|
125
|
+
}), /*#__PURE__*/_jsx(ExpandCollapseTitle, {
|
|
133
126
|
tokens: getTokens(),
|
|
134
127
|
children: expanded ? expandTitle : collapseTitle
|
|
135
128
|
})]
|
|
@@ -150,11 +143,10 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
150
143
|
});
|
|
151
144
|
ExpandCollapse.displayName = 'ExpandCollapse';
|
|
152
145
|
ExpandCollapse.propTypes = {
|
|
153
|
-
children:
|
|
154
|
-
collapseTitle:
|
|
155
|
-
expandTitle:
|
|
156
|
-
collapseLabel:
|
|
157
|
-
expandLabel:
|
|
146
|
+
children: PropTypes.node.isRequired,
|
|
147
|
+
collapseTitle: PropTypes.string.isRequired,
|
|
148
|
+
expandTitle: PropTypes.string,
|
|
149
|
+
collapseLabel: PropTypes.string,
|
|
150
|
+
expandLabel: PropTypes.string
|
|
158
151
|
};
|
|
159
|
-
|
|
160
|
-
exports.default = _default;
|
|
152
|
+
export default ExpandCollapse;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _OrderedListBase = _interopRequireDefault(require("../OrderedList/OrderedListBase"));
|
|
13
|
-
var _utils = require("../utils");
|
|
14
|
-
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
18
|
-
const ContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens, useViewport, getTokensPropType, useTheme, useResponsiveThemeTokens, createMediaQueryStyles, StyleSheet } from '@telus-uds/components-base';
|
|
5
|
+
import ExpandCollapse from './ExpandCollapse';
|
|
6
|
+
import OrderedListBase from '../OrderedList/OrderedListBase';
|
|
7
|
+
import { htmlAttrs, media, renderStructuredContent } from '../utils';
|
|
8
|
+
import defaultDictionary from './dictionary';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
11
|
+
const ContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
19
12
|
displayName: "TermsAndConditions__ContentContainer",
|
|
20
13
|
componentId: "components-web__sc-1199epn-0"
|
|
21
14
|
})(_ref => {
|
|
@@ -25,13 +18,13 @@ const ContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
25
18
|
return {
|
|
26
19
|
paddingBottom: tokens.contentPaddingBottom,
|
|
27
20
|
paddingLeft: tokens.contentPaddingLeft,
|
|
28
|
-
...
|
|
21
|
+
...media().from('md').css({
|
|
29
22
|
paddingBottom: tokens.mdContentPaddingBottom,
|
|
30
23
|
paddingLeft: tokens.mdContentPaddingLeft
|
|
31
24
|
})
|
|
32
25
|
};
|
|
33
26
|
});
|
|
34
|
-
const Ordered = /*#__PURE__*/(
|
|
27
|
+
const Ordered = /*#__PURE__*/styled(OrderedListBase).withConfig({
|
|
35
28
|
displayName: "TermsAndConditions__Ordered",
|
|
36
29
|
componentId: "components-web__sc-1199epn-1"
|
|
37
30
|
})(_ref2 => {
|
|
@@ -43,7 +36,7 @@ const Ordered = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.def
|
|
|
43
36
|
padding: tokens.orderedPadding
|
|
44
37
|
};
|
|
45
38
|
});
|
|
46
|
-
const Unordered = /*#__PURE__*/
|
|
39
|
+
const Unordered = /*#__PURE__*/styled.ul.withConfig({
|
|
47
40
|
displayName: "TermsAndConditions__Unordered",
|
|
48
41
|
componentId: "components-web__sc-1199epn-2"
|
|
49
42
|
})(_ref3 => {
|
|
@@ -57,7 +50,7 @@ const Unordered = /*#__PURE__*/_styledComponents.default.ul.withConfig({
|
|
|
57
50
|
paddingTop: tokens.unorderedPadding
|
|
58
51
|
};
|
|
59
52
|
});
|
|
60
|
-
const ListItem = /*#__PURE__*/(
|
|
53
|
+
const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
|
|
61
54
|
displayName: "TermsAndConditions__ListItem",
|
|
62
55
|
componentId: "components-web__sc-1199epn-3"
|
|
63
56
|
})(_ref4 => {
|
|
@@ -81,7 +74,7 @@ const ListItem = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.de
|
|
|
81
74
|
wordBreak: 'break-word'
|
|
82
75
|
};
|
|
83
76
|
});
|
|
84
|
-
const NonIndexedContentTitle = /*#__PURE__*/
|
|
77
|
+
const NonIndexedContentTitle = /*#__PURE__*/styled.div.withConfig({
|
|
85
78
|
displayName: "TermsAndConditions__NonIndexedContentTitle",
|
|
86
79
|
componentId: "components-web__sc-1199epn-4"
|
|
87
80
|
})(_ref5 => {
|
|
@@ -105,30 +98,30 @@ const NonIndexedContentTitle = /*#__PURE__*/_styledComponents.default.div.withCo
|
|
|
105
98
|
* - Responsive display based on breakpoints
|
|
106
99
|
* - Use `copy` to set language, ‘en’ for English or ‘fr’ for French
|
|
107
100
|
*/
|
|
108
|
-
const TermsAndConditions = /*#__PURE__*/
|
|
101
|
+
const TermsAndConditions = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
109
102
|
let {
|
|
110
103
|
copy = 'en',
|
|
111
104
|
indexedContent = [],
|
|
112
105
|
nonIndexedContent = [],
|
|
113
106
|
tokens = {},
|
|
114
107
|
variant = {},
|
|
115
|
-
dictionary =
|
|
108
|
+
dictionary = defaultDictionary,
|
|
116
109
|
...rest
|
|
117
110
|
} = _ref6;
|
|
118
|
-
const getCopy =
|
|
111
|
+
const getCopy = useCopy({
|
|
119
112
|
dictionary,
|
|
120
113
|
copy
|
|
121
114
|
});
|
|
122
115
|
const hasIndexedContent = indexedContent.length > 0;
|
|
123
116
|
const hasNonIndexedContent = nonIndexedContent.length > 0;
|
|
124
|
-
const viewport =
|
|
117
|
+
const viewport = useViewport();
|
|
125
118
|
const {
|
|
126
119
|
themeOptions
|
|
127
|
-
} =
|
|
120
|
+
} = useTheme();
|
|
128
121
|
const {
|
|
129
122
|
enableMediaQueryStyleSheet
|
|
130
123
|
} = themeOptions;
|
|
131
|
-
const useTokens = enableMediaQueryStyleSheet ?
|
|
124
|
+
const useTokens = enableMediaQueryStyleSheet ? useResponsiveThemeTokens : useThemeTokens;
|
|
132
125
|
const themeTokens = useTokens('TermsAndConditions', tokens, variant, !enableMediaQueryStyleSheet && {
|
|
133
126
|
viewport
|
|
134
127
|
});
|
|
@@ -153,12 +146,12 @@ const TermsAndConditions = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) =
|
|
|
153
146
|
transformedListItemThemeTokens: {},
|
|
154
147
|
transformedNonIndexedContentThemeTokens: {}
|
|
155
148
|
});
|
|
156
|
-
const listItemMediaQueryStyles =
|
|
157
|
-
const nonIndexedContentMediaQueryStyles =
|
|
149
|
+
const listItemMediaQueryStyles = createMediaQueryStyles(transformedListItemThemeTokens);
|
|
150
|
+
const nonIndexedContentMediaQueryStyles = createMediaQueryStyles(transformedNonIndexedContentThemeTokens);
|
|
158
151
|
const {
|
|
159
152
|
ids,
|
|
160
153
|
styles
|
|
161
|
-
} =
|
|
154
|
+
} = StyleSheet.create({
|
|
162
155
|
listItem: {
|
|
163
156
|
...themeTokens[viewport],
|
|
164
157
|
...listItemMediaQueryStyles
|
|
@@ -176,36 +169,36 @@ const TermsAndConditions = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) =
|
|
|
176
169
|
listItemStyles = themeTokens;
|
|
177
170
|
nonIndexedContentStyles = themeTokens;
|
|
178
171
|
}
|
|
179
|
-
return /*#__PURE__*/(
|
|
172
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
180
173
|
...selectProps(rest),
|
|
181
|
-
children: [/*#__PURE__*/(
|
|
174
|
+
children: [/*#__PURE__*/_jsx(Divider, {
|
|
182
175
|
tokens: {
|
|
183
176
|
color: themeTokens.dividerColor
|
|
184
177
|
}
|
|
185
|
-
}), /*#__PURE__*/(
|
|
178
|
+
}), /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
186
179
|
collapseTitle: getCopy('headingView'),
|
|
187
180
|
expandTitle: getCopy('headingHide'),
|
|
188
181
|
collapseLabel: getCopy('collapseLabel'),
|
|
189
182
|
expandLabel: getCopy('expandLabel'),
|
|
190
183
|
ref: ref,
|
|
191
|
-
children: /*#__PURE__*/(
|
|
184
|
+
children: /*#__PURE__*/_jsxs(ContentContainer, {
|
|
192
185
|
tokens: themeTokens,
|
|
193
|
-
children: [hasIndexedContent && /*#__PURE__*/(
|
|
186
|
+
children: [hasIndexedContent && /*#__PURE__*/_jsx(Ordered, {
|
|
194
187
|
tokens: themeTokens,
|
|
195
188
|
children: indexedContent.map((contentItem, idx) =>
|
|
196
189
|
/*#__PURE__*/
|
|
197
190
|
// eslint-disable-next-line react/no-array-index-key
|
|
198
|
-
(
|
|
191
|
+
_jsx(ListItem, {
|
|
199
192
|
tokens: listItemStyles,
|
|
200
193
|
media: listItemMediaIds,
|
|
201
|
-
children:
|
|
194
|
+
children: renderStructuredContent(contentItem)
|
|
202
195
|
}, idx))
|
|
203
|
-
}), hasNonIndexedContent && /*#__PURE__*/(
|
|
196
|
+
}), hasNonIndexedContent && /*#__PURE__*/_jsxs(Box, {
|
|
204
197
|
between: 3,
|
|
205
|
-
children: [/*#__PURE__*/(
|
|
198
|
+
children: [/*#__PURE__*/_jsx(NonIndexedContentTitle, {
|
|
206
199
|
tokens: nonIndexedContentStyles,
|
|
207
200
|
media: nonIndexedContentMediaIds,
|
|
208
|
-
children: /*#__PURE__*/(
|
|
201
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
209
202
|
block: true,
|
|
210
203
|
heading: true,
|
|
211
204
|
tokens: {
|
|
@@ -216,20 +209,20 @@ const TermsAndConditions = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) =
|
|
|
216
209
|
},
|
|
217
210
|
children: getCopy('nonIndexedTitle')
|
|
218
211
|
})
|
|
219
|
-
}), /*#__PURE__*/(
|
|
212
|
+
}), /*#__PURE__*/_jsx(Unordered, {
|
|
220
213
|
tokens: themeTokens,
|
|
221
214
|
children: nonIndexedContent.map((contentItem, idx) =>
|
|
222
215
|
/*#__PURE__*/
|
|
223
216
|
// eslint-disable-next-line react/no-array-index-key
|
|
224
|
-
(
|
|
217
|
+
_jsx(ListItem, {
|
|
225
218
|
tokens: listItemStyles,
|
|
226
219
|
media: listItemMediaIds,
|
|
227
|
-
children:
|
|
220
|
+
children: renderStructuredContent(contentItem)
|
|
228
221
|
}, idx))
|
|
229
222
|
})]
|
|
230
223
|
})]
|
|
231
224
|
})
|
|
232
|
-
}), /*#__PURE__*/(
|
|
225
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
|
233
226
|
tokens: {
|
|
234
227
|
color: themeTokens.dividerColor
|
|
235
228
|
}
|
|
@@ -239,10 +232,10 @@ const TermsAndConditions = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) =
|
|
|
239
232
|
TermsAndConditions.displayName = 'TermsAndConditions';
|
|
240
233
|
|
|
241
234
|
// If a language dictionary entry is provided, it must contain every key
|
|
242
|
-
const dictionaryContentShape =
|
|
243
|
-
headingHide:
|
|
244
|
-
headingView:
|
|
245
|
-
nonIndexedTitle:
|
|
235
|
+
const dictionaryContentShape = PropTypes.shape({
|
|
236
|
+
headingHide: PropTypes.string.isRequired,
|
|
237
|
+
headingView: PropTypes.string.isRequired,
|
|
238
|
+
nonIndexedTitle: PropTypes.string.isRequired
|
|
246
239
|
});
|
|
247
240
|
TermsAndConditions.propTypes = {
|
|
248
241
|
...selectedSystemPropTypes,
|
|
@@ -251,34 +244,33 @@ TermsAndConditions.propTypes = {
|
|
|
251
244
|
*
|
|
252
245
|
* To provide your own, pass a JSON object with the keys `headingView`, `headingHide`, and `nonIndexedTitle`.
|
|
253
246
|
*/
|
|
254
|
-
copy:
|
|
255
|
-
headingView:
|
|
256
|
-
headingHide:
|
|
257
|
-
nonIndexedTitle:
|
|
247
|
+
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), PropTypes.shape({
|
|
248
|
+
headingView: PropTypes.string,
|
|
249
|
+
headingHide: PropTypes.string,
|
|
250
|
+
nonIndexedTitle: PropTypes.string
|
|
258
251
|
})]),
|
|
259
252
|
/**
|
|
260
253
|
* Sets the tokens for TermsAndConditions element.
|
|
261
254
|
*/
|
|
262
|
-
tokens:
|
|
255
|
+
tokens: getTokensPropType('TermsAndConditions'),
|
|
263
256
|
/**
|
|
264
257
|
* An array of nodes, strings, or a combination to be displayed in an ordered list.
|
|
265
258
|
*
|
|
266
259
|
* Each item in the array must have a corresponding superscript in the page.
|
|
267
260
|
*/
|
|
268
|
-
indexedContent:
|
|
261
|
+
indexedContent: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.node, PropTypes.string])),
|
|
269
262
|
/**
|
|
270
263
|
* An array of nodes, strings, or a combination to be displayed in an unordered list.
|
|
271
264
|
*
|
|
272
265
|
* nonIndexedContent do not have a corresponding superscript and instead apply to the page as a whole.
|
|
273
266
|
*/
|
|
274
|
-
nonIndexedContent:
|
|
267
|
+
nonIndexedContent: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.node, PropTypes.string])),
|
|
275
268
|
/**
|
|
276
269
|
* Custom dictionary containing the labels to use for `TermsAndConditions`
|
|
277
270
|
*/
|
|
278
|
-
dictionary:
|
|
271
|
+
dictionary: PropTypes.shape({
|
|
279
272
|
en: dictionaryContentShape,
|
|
280
273
|
fr: dictionaryContentShape
|
|
281
274
|
})
|
|
282
275
|
};
|
|
283
|
-
|
|
284
|
-
exports.default = _default;
|
|
276
|
+
export default TermsAndConditions;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
1
|
+
export default {
|
|
8
2
|
en: {
|
|
9
3
|
headingHide: 'Hide terms and conditions',
|
|
10
4
|
headingView: 'View terms and conditions',
|
|
@@ -19,5 +13,4 @@ var _default = {
|
|
|
19
13
|
expandLabel: 'Détailler',
|
|
20
14
|
collapseLabel: 'Réduire'
|
|
21
15
|
}
|
|
22
|
-
};
|
|
23
|
-
exports.default = _default;
|
|
16
|
+
};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _TermsAndConditions.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _TermsAndConditions = _interopRequireDefault(require("./TermsAndConditions"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
export { default } from './TermsAndConditions';
|