@telus-uds/components-web 1.2.0 → 1.4.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 +34 -2
- package/lib/Breadcrumbs/Breadcrumbs.js +247 -0
- package/lib/Breadcrumbs/Item/Item.js +165 -0
- package/lib/Breadcrumbs/index.js +15 -0
- package/lib/Callout/Callout.js +121 -0
- package/lib/Callout/index.js +13 -0
- package/lib/DatePicker/CalendarContainer.js +221 -0
- package/lib/DatePicker/DatePicker.js +329 -0
- package/lib/DatePicker/dictionary.js +134 -0
- package/lib/DatePicker/index.js +13 -0
- package/lib/DatePicker/reactDatesCss.js +12 -0
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +75 -0
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +95 -0
- package/lib/ExpandCollapseMini/index.js +13 -0
- package/lib/Footnote/Footnote.js +571 -0
- package/lib/Footnote/FootnoteLink.js +149 -0
- package/lib/Footnote/dictionary.js +19 -0
- package/lib/Footnote/index.js +16 -0
- package/lib/OrderedList/Item.js +162 -0
- package/lib/OrderedList/ItemBase.js +42 -0
- package/lib/OrderedList/OrderedList.js +94 -0
- package/lib/OrderedList/OrderedListBase.js +68 -0
- package/lib/OrderedList/constants.js +9 -0
- package/lib/OrderedList/index.js +16 -0
- package/lib/PreviewCard/AuthorDate.js +64 -0
- package/lib/PreviewCard/PreviewCard.js +236 -0
- package/lib/PreviewCard/index.js +13 -0
- package/lib/PriceLockup/PriceLockup.js +237 -0
- package/lib/PriceLockup/index.js +13 -0
- package/lib/PriceLockup/tokens.js +131 -0
- package/lib/ResponsiveImage/ResponsiveImage.js +115 -0
- package/lib/ResponsiveImage/index.js +13 -0
- package/lib/Ribbon/Ribbon.js +0 -1
- package/lib/Span/Span.js +88 -0
- package/lib/Span/index.js +13 -0
- package/lib/index.js +91 -1
- package/lib/shared/FullBleedContent/FullBleedContent.js +121 -0
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +73 -0
- package/lib/shared/FullBleedContent/index.js +29 -0
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +73 -0
- package/lib/utils/index.js +32 -0
- package/lib/utils/logger.js +31 -0
- package/lib/utils/media.js +54 -0
- package/lib/utils/renderStructuredContent.js +89 -0
- package/lib/utils/useTypographyTheme.js +32 -0
- package/lib-module/Breadcrumbs/Breadcrumbs.js +228 -0
- package/lib-module/Breadcrumbs/Item/Item.js +141 -0
- package/lib-module/Breadcrumbs/index.js +1 -0
- package/lib-module/Callout/Callout.js +106 -0
- package/lib-module/Callout/index.js +2 -0
- package/lib-module/DatePicker/CalendarContainer.js +208 -0
- package/lib-module/DatePicker/DatePicker.js +302 -0
- package/lib-module/DatePicker/dictionary.js +127 -0
- package/lib-module/DatePicker/index.js +2 -0
- package/lib-module/DatePicker/reactDatesCss.js +3 -0
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +56 -0
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +80 -0
- package/lib-module/ExpandCollapseMini/index.js +2 -0
- package/lib-module/Footnote/Footnote.js +541 -0
- package/lib-module/Footnote/FootnoteLink.js +130 -0
- package/lib-module/Footnote/dictionary.js +12 -0
- package/lib-module/Footnote/index.js +4 -0
- package/lib-module/OrderedList/Item.js +139 -0
- package/lib-module/OrderedList/ItemBase.js +28 -0
- package/lib-module/OrderedList/OrderedList.js +71 -0
- package/lib-module/OrderedList/OrderedListBase.js +48 -0
- package/lib-module/OrderedList/constants.js +2 -0
- package/lib-module/OrderedList/index.js +4 -0
- package/lib-module/PreviewCard/AuthorDate.js +53 -0
- package/lib-module/PreviewCard/PreviewCard.js +211 -0
- package/lib-module/PreviewCard/index.js +2 -0
- package/lib-module/PriceLockup/PriceLockup.js +213 -0
- package/lib-module/PriceLockup/index.js +2 -0
- package/lib-module/PriceLockup/tokens.js +120 -0
- package/lib-module/ResponsiveImage/ResponsiveImage.js +100 -0
- package/lib-module/ResponsiveImage/index.js +2 -0
- package/lib-module/Ribbon/Ribbon.js +1 -2
- package/lib-module/Span/Span.js +70 -0
- package/lib-module/Span/index.js +2 -0
- package/lib-module/index.js +10 -0
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +106 -0
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +65 -0
- package/lib-module/shared/FullBleedContent/index.js +4 -0
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +65 -0
- package/lib-module/utils/index.js +5 -1
- package/lib-module/utils/logger.js +18 -0
- package/lib-module/utils/media.js +46 -0
- package/lib-module/utils/renderStructuredContent.js +77 -0
- package/lib-module/utils/useTypographyTheme.js +24 -0
- package/package.json +9 -4
- package/src/Breadcrumbs/Breadcrumbs.jsx +222 -0
- package/src/Breadcrumbs/Item/Item.jsx +127 -0
- package/src/Breadcrumbs/index.js +1 -0
- package/src/Callout/Callout.jsx +76 -0
- package/src/Callout/index.js +3 -0
- package/src/DatePicker/CalendarContainer.jsx +210 -0
- package/src/DatePicker/DatePicker.jsx +303 -0
- package/src/DatePicker/dictionary.js +92 -0
- package/src/DatePicker/index.js +3 -0
- package/src/DatePicker/reactDatesCss.js +892 -0
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +48 -0
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +67 -0
- package/src/ExpandCollapseMini/index.js +3 -0
- package/src/Footnote/Footnote.jsx +468 -0
- package/src/Footnote/FootnoteLink.jsx +120 -0
- package/src/Footnote/dictionary.js +12 -0
- package/src/Footnote/index.js +6 -0
- package/src/OrderedList/Item.jsx +121 -0
- package/src/OrderedList/ItemBase.jsx +18 -0
- package/src/OrderedList/OrderedList.jsx +61 -0
- package/src/OrderedList/OrderedListBase.jsx +38 -0
- package/src/OrderedList/constants.js +2 -0
- package/src/OrderedList/index.js +6 -0
- package/src/PreviewCard/AuthorDate.jsx +31 -0
- package/src/PreviewCard/PreviewCard.jsx +201 -0
- package/src/PreviewCard/index.js +3 -0
- package/src/PriceLockup/PriceLockup.jsx +210 -0
- package/src/PriceLockup/index.js +3 -0
- package/src/PriceLockup/tokens.js +58 -0
- package/src/ResponsiveImage/ResponsiveImage.jsx +77 -0
- package/src/ResponsiveImage/index.js +3 -0
- package/src/Ribbon/Ribbon.jsx +0 -1
- package/src/Span/Span.jsx +66 -0
- package/src/Span/index.js +3 -0
- package/src/index.js +10 -0
- package/src/shared/FullBleedContent/FullBleedContent.jsx +90 -0
- package/src/shared/FullBleedContent/getFullBleedBorderRadius.js +55 -0
- package/src/shared/FullBleedContent/index.js +6 -0
- package/src/shared/FullBleedContent/useFullBleedContentProps.js +63 -0
- package/src/utils/index.js +5 -1
- package/src/utils/logger.js +20 -0
- package/src/utils/media.js +40 -0
- package/src/utils/renderStructuredContent.jsx +73 -0
- package/src/utils/useTypographyTheme.js +14 -0
- package/types/Callout.d.ts +13 -0
- package/types/DatePicker.d.ts +21 -0
- package/types/Footnote.d.ts +21 -0
- package/types/FootnoteLink.d.ts +20 -0
- package/types/PriceLockup.d.ts +22 -0
- package/types/common.d.ts +14 -0
|
@@ -0,0 +1,115 @@
|
|
|
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 _componentsBase = require("@telus-uds/components-base");
|
|
13
|
+
|
|
14
|
+
var _systemConstants = require("@telus-uds/system-constants");
|
|
15
|
+
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
23
|
+
const staticStyles = {
|
|
24
|
+
image: {
|
|
25
|
+
display: 'block',
|
|
26
|
+
width: '100%'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Provide different image sources for different screen sizes.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
const ResponsiveImage = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
xsSrc,
|
|
36
|
+
smSrc,
|
|
37
|
+
mdSrc,
|
|
38
|
+
lgSrc,
|
|
39
|
+
xlSrc,
|
|
40
|
+
fallbackSrc,
|
|
41
|
+
alt,
|
|
42
|
+
loading = 'eager',
|
|
43
|
+
...rest
|
|
44
|
+
} = _ref;
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("picture", { ...selectProps(rest),
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
47
|
+
srcSet: xlSrc,
|
|
48
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.xl)}px)`
|
|
49
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
50
|
+
srcSet: lgSrc,
|
|
51
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.lg)}px)`
|
|
52
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
53
|
+
srcSet: mdSrc,
|
|
54
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.md)}px)`
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
56
|
+
srcSet: smSrc,
|
|
57
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.sm)}px)`
|
|
58
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
59
|
+
srcSet: xsSrc,
|
|
60
|
+
media: `(max-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.sm) - 1}px)`
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
62
|
+
src: fallbackSrc,
|
|
63
|
+
alt: alt,
|
|
64
|
+
style: staticStyles.image,
|
|
65
|
+
loading: loading
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
ResponsiveImage.propTypes = { ...selectedSystemPropTypes,
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The src attribute used for screen widths up to 575px
|
|
74
|
+
*/
|
|
75
|
+
xsSrc: _propTypes.default.string.isRequired,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The src attribute used for screen widths greater than 576px
|
|
79
|
+
*/
|
|
80
|
+
smSrc: _propTypes.default.string.isRequired,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The src attribute used for screen widths greater than 768px
|
|
84
|
+
*/
|
|
85
|
+
mdSrc: _propTypes.default.string,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The src attribute used for screen widths greater than 992px
|
|
89
|
+
*/
|
|
90
|
+
lgSrc: _propTypes.default.string,
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The src attribute used for screen widths greater than 1200px
|
|
94
|
+
*/
|
|
95
|
+
xlSrc: _propTypes.default.string,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The src attribute used for browsers that don't support responsive images (InternetExplorer)
|
|
99
|
+
*/
|
|
100
|
+
fallbackSrc: _propTypes.default.string.isRequired,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The alt attribute for the HTML img element. Setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content, and that non-visual browsers may omit it from rendering.
|
|
104
|
+
*/
|
|
105
|
+
alt: _propTypes.default.string.isRequired,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Loading strategy.
|
|
109
|
+
* @default 'eager'
|
|
110
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
|
|
111
|
+
*/
|
|
112
|
+
loading: _propTypes.default.oneOf(['eager', 'lazy'])
|
|
113
|
+
};
|
|
114
|
+
var _default = ResponsiveImage;
|
|
115
|
+
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 _ResponsiveImage = _interopRequireDefault(require("./ResponsiveImage"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _ResponsiveImage.default;
|
|
13
|
+
exports.default = _default;
|
package/lib/Ribbon/Ribbon.js
CHANGED
|
@@ -19,7 +19,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
// import palette from '@telus-uds/palette-allium/build/web/palette'
|
|
23
22
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
24
23
|
|
|
25
24
|
const RibbonWrapper = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
package/lib/Span/Span.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
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 _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
15
|
+
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
23
|
+
|
|
24
|
+
const StyledSpan = /*#__PURE__*/_styledComponents.default.span.withConfig({
|
|
25
|
+
displayName: "Span__StyledSpan",
|
|
26
|
+
componentId: "components-web__sc-o7sihn-0"
|
|
27
|
+
})(["", "};"], _ref => {
|
|
28
|
+
let {
|
|
29
|
+
flex
|
|
30
|
+
} = _ref;
|
|
31
|
+
return flex ? 'display: inline-flex' : '';
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Text as an HTML ```<span>``` element.
|
|
35
|
+
*
|
|
36
|
+
* Span may be used in cases where an inline span or direct access to HTML attributes is required.
|
|
37
|
+
* In most cases, `Typography` should be used for text, or Paragraph for body text.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
const Span = _ref2 => {
|
|
42
|
+
let {
|
|
43
|
+
children,
|
|
44
|
+
variant,
|
|
45
|
+
tokens,
|
|
46
|
+
testID,
|
|
47
|
+
flex,
|
|
48
|
+
...rest
|
|
49
|
+
} = _ref2;
|
|
50
|
+
const style = (0, _utils.useTypographyTheme)(variant, tokens);
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSpan, {
|
|
52
|
+
"data-testid": testID,
|
|
53
|
+
flex: flex,
|
|
54
|
+
style: style,
|
|
55
|
+
...selectProps(rest),
|
|
56
|
+
children: children
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
Span.propTypes = { ...selectedSystemPropTypes,
|
|
61
|
+
children: _propTypes.default.node.isRequired,
|
|
62
|
+
testID: _propTypes.default.string,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Sets display to inline-flex so that children are laid out using the flex model.
|
|
66
|
+
* Use this if the span contains children that expect to be inside a flex container.
|
|
67
|
+
*/
|
|
68
|
+
flex: _propTypes.default.bool,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Span takes the same tokens overrides as Typography
|
|
72
|
+
*/
|
|
73
|
+
tokens: _propTypes.default.oneOf([_propTypes.default.object, _propTypes.default.func]),
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Span can take any of Typography's theme variants
|
|
77
|
+
*/
|
|
78
|
+
variant: _propTypes.default.exact({
|
|
79
|
+
bold: _propTypes.default.bool,
|
|
80
|
+
colour: _propTypes.default.oneOf(['secondary', 'tertiary']),
|
|
81
|
+
compact: _propTypes.default.bool,
|
|
82
|
+
inverse: _propTypes.default.bool,
|
|
83
|
+
size: _propTypes.default.oneOf(['micro', 'small', 'large', 'eyebrow', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'display1', 'display2']),
|
|
84
|
+
weight: _propTypes.default.oneOf(['semibold', 'bold'])
|
|
85
|
+
})
|
|
86
|
+
};
|
|
87
|
+
var _default = Span;
|
|
88
|
+
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 _Span = _interopRequireDefault(require("./Span"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _Span.default;
|
|
13
|
+
exports.default = _default;
|
package/lib/index.js
CHANGED
|
@@ -5,8 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Badge: true,
|
|
8
|
+
OrderedList: true,
|
|
9
|
+
PreviewCard: true,
|
|
10
|
+
ResponsiveImage: true,
|
|
8
11
|
Ribbon: true,
|
|
9
|
-
|
|
12
|
+
DatePicker: true,
|
|
13
|
+
Span: true,
|
|
14
|
+
ExpandCollapseMini: true,
|
|
15
|
+
Callout: true,
|
|
16
|
+
PriceLockup: true,
|
|
17
|
+
Footnote: true,
|
|
18
|
+
transformGradient: true,
|
|
19
|
+
Breadcrumbs: true
|
|
10
20
|
};
|
|
11
21
|
Object.defineProperty(exports, "Badge", {
|
|
12
22
|
enumerable: true,
|
|
@@ -14,12 +24,72 @@ Object.defineProperty(exports, "Badge", {
|
|
|
14
24
|
return _Badge.default;
|
|
15
25
|
}
|
|
16
26
|
});
|
|
27
|
+
Object.defineProperty(exports, "Breadcrumbs", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _Breadcrumbs.default;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "Callout", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return _Callout.default;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "DatePicker", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return _DatePicker.default;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "ExpandCollapseMini", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () {
|
|
48
|
+
return _ExpandCollapseMini.default;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "Footnote", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _Footnote.default;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "OrderedList", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () {
|
|
60
|
+
return _OrderedList.default;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, "PreviewCard", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () {
|
|
66
|
+
return _PreviewCard.default;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "PriceLockup", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () {
|
|
72
|
+
return _PriceLockup.default;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(exports, "ResponsiveImage", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return _ResponsiveImage.default;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
17
81
|
Object.defineProperty(exports, "Ribbon", {
|
|
18
82
|
enumerable: true,
|
|
19
83
|
get: function () {
|
|
20
84
|
return _Ribbon.default;
|
|
21
85
|
}
|
|
22
86
|
});
|
|
87
|
+
Object.defineProperty(exports, "Span", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _Span.default;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
23
93
|
Object.defineProperty(exports, "transformGradient", {
|
|
24
94
|
enumerable: true,
|
|
25
95
|
get: function () {
|
|
@@ -29,10 +99,30 @@ Object.defineProperty(exports, "transformGradient", {
|
|
|
29
99
|
|
|
30
100
|
var _Badge = _interopRequireDefault(require("./Badge"));
|
|
31
101
|
|
|
102
|
+
var _OrderedList = _interopRequireDefault(require("./OrderedList"));
|
|
103
|
+
|
|
104
|
+
var _PreviewCard = _interopRequireDefault(require("./PreviewCard"));
|
|
105
|
+
|
|
106
|
+
var _ResponsiveImage = _interopRequireDefault(require("./ResponsiveImage"));
|
|
107
|
+
|
|
32
108
|
var _Ribbon = _interopRequireDefault(require("./Ribbon"));
|
|
33
109
|
|
|
110
|
+
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
|
111
|
+
|
|
112
|
+
var _Span = _interopRequireDefault(require("./Span"));
|
|
113
|
+
|
|
114
|
+
var _ExpandCollapseMini = _interopRequireDefault(require("./ExpandCollapseMini"));
|
|
115
|
+
|
|
116
|
+
var _Callout = _interopRequireDefault(require("./Callout"));
|
|
117
|
+
|
|
118
|
+
var _PriceLockup = _interopRequireDefault(require("./PriceLockup"));
|
|
119
|
+
|
|
120
|
+
var _Footnote = _interopRequireDefault(require("./Footnote"));
|
|
121
|
+
|
|
34
122
|
var _utils = require("./utils");
|
|
35
123
|
|
|
124
|
+
var _Breadcrumbs = _interopRequireDefault(require("./Breadcrumbs"));
|
|
125
|
+
|
|
36
126
|
var _baseExports = require("./baseExports");
|
|
37
127
|
|
|
38
128
|
Object.keys(_baseExports).forEach(function (key) {
|
|
@@ -0,0 +1,121 @@
|
|
|
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 _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _ResponsiveImage = _interopRequireDefault(require("../../ResponsiveImage"));
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
const selectFullBleedContentProps = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
alt,
|
|
23
|
+
height,
|
|
24
|
+
loading,
|
|
25
|
+
src,
|
|
26
|
+
width,
|
|
27
|
+
fallbackSrc = src,
|
|
28
|
+
lgSrc = src,
|
|
29
|
+
mdSrc = src,
|
|
30
|
+
smSrc = src,
|
|
31
|
+
xlSrc = src,
|
|
32
|
+
xsSrc = src
|
|
33
|
+
} = _ref;
|
|
34
|
+
return {
|
|
35
|
+
alt,
|
|
36
|
+
height,
|
|
37
|
+
loading,
|
|
38
|
+
src,
|
|
39
|
+
width,
|
|
40
|
+
fallbackSrc,
|
|
41
|
+
lgSrc,
|
|
42
|
+
mdSrc,
|
|
43
|
+
smSrc,
|
|
44
|
+
xlSrc,
|
|
45
|
+
xsSrc
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const FullBleedContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
50
|
+
displayName: "FullBleedContent__FullBleedContentContainer",
|
|
51
|
+
componentId: "components-web__sc-1130ea5-0"
|
|
52
|
+
})(_ref2 => {
|
|
53
|
+
let {
|
|
54
|
+
borderBottomLeftRadius,
|
|
55
|
+
borderBottomRightRadius,
|
|
56
|
+
borderTopLeftRadius,
|
|
57
|
+
borderTopRightRadius
|
|
58
|
+
} = _ref2;
|
|
59
|
+
return {
|
|
60
|
+
overflow: 'hidden',
|
|
61
|
+
borderBottomLeftRadius,
|
|
62
|
+
borderBottomRightRadius,
|
|
63
|
+
borderTopLeftRadius,
|
|
64
|
+
borderTopRightRadius
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Full bleed content component can accept either a single source,
|
|
69
|
+
* a number of sources corresponding to the `ResponsiveImage` component API,
|
|
70
|
+
* or a custom component.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
const FullBleedContent = _ref3 => {
|
|
75
|
+
let {
|
|
76
|
+
borderRadius,
|
|
77
|
+
content,
|
|
78
|
+
...rest
|
|
79
|
+
} = _ref3;
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FullBleedContentContainer, { ...borderRadius,
|
|
81
|
+
children: content ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveImage.default, { ...selectFullBleedContentProps(rest)
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
FullBleedContent.propTypes = {
|
|
87
|
+
/**
|
|
88
|
+
* Content border radius matching the edge values on the parent card.
|
|
89
|
+
*/
|
|
90
|
+
borderRadius: _propTypes.default.shape({
|
|
91
|
+
borderBottomLeftRadius: _propTypes.default.number,
|
|
92
|
+
borderBottomRightRadius: _propTypes.default.number,
|
|
93
|
+
borderTopLeftRadius: _propTypes.default.number,
|
|
94
|
+
borderTopRightRadius: _propTypes.default.number
|
|
95
|
+
}),
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Custom JSX to be used for rendering the content (defaults to `ResponsiveImage` receiving other props).
|
|
99
|
+
*/
|
|
100
|
+
content: _propTypes.default.node,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Image source.
|
|
104
|
+
*/
|
|
105
|
+
src: _propTypes.default.string,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Also accept props for `ResponsiveImage`...
|
|
109
|
+
*/
|
|
110
|
+
..._ResponsiveImage.default.propTypes,
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* ...but make the required ones optional.
|
|
114
|
+
*/
|
|
115
|
+
alt: _propTypes.default.string,
|
|
116
|
+
xsSrc: _propTypes.default.string,
|
|
117
|
+
smSrc: _propTypes.default.string,
|
|
118
|
+
fallbackSrc: _propTypes.default.string
|
|
119
|
+
};
|
|
120
|
+
var _default = FullBleedContent;
|
|
121
|
+
exports.default = _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Gets the border radius values for an item of content that goes right up to
|
|
10
|
+
* the edges of its container, to the top, bottom, left or right of other content.
|
|
11
|
+
*
|
|
12
|
+
* Gives the full bleed item the same border radius as the container on the corners
|
|
13
|
+
* that are flush with the corners of the container.
|
|
14
|
+
*
|
|
15
|
+
* @param {number} borderRadius
|
|
16
|
+
* @param {'top'|'bottom'|'left'|'right'} position
|
|
17
|
+
* @param {boolean} hasFooter
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
const getFullBleedBorderRadius = function (borderRadius, position) {
|
|
21
|
+
let hasFooter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
22
|
+
const innerBorderRadius = {
|
|
23
|
+
borderBottomLeftRadius: 0,
|
|
24
|
+
borderBottomRightRadius: 0,
|
|
25
|
+
borderTopLeftRadius: 0,
|
|
26
|
+
borderTopRightRadius: 0
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
if (position && position !== 'none') {
|
|
30
|
+
if (borderRadius) {
|
|
31
|
+
// Depending on the position of the image, we need to round some
|
|
32
|
+
// corners, but not the others
|
|
33
|
+
switch (position) {
|
|
34
|
+
case 'bottom':
|
|
35
|
+
if (!hasFooter) {
|
|
36
|
+
innerBorderRadius.borderBottomLeftRadius = borderRadius;
|
|
37
|
+
innerBorderRadius.borderBottomRightRadius = borderRadius;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
break;
|
|
41
|
+
|
|
42
|
+
case 'left':
|
|
43
|
+
if (!hasFooter) {
|
|
44
|
+
innerBorderRadius.borderBottomLeftRadius = borderRadius;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
innerBorderRadius.borderTopLeftRadius = borderRadius;
|
|
48
|
+
break;
|
|
49
|
+
|
|
50
|
+
case 'right':
|
|
51
|
+
if (!hasFooter) {
|
|
52
|
+
innerBorderRadius.borderBottomRightRadius = borderRadius;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
innerBorderRadius.borderTopRightRadius = borderRadius;
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case 'top':
|
|
59
|
+
innerBorderRadius.borderTopLeftRadius = borderRadius;
|
|
60
|
+
innerBorderRadius.borderTopRightRadius = borderRadius;
|
|
61
|
+
break;
|
|
62
|
+
|
|
63
|
+
default:
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return innerBorderRadius;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var _default = getFullBleedBorderRadius;
|
|
73
|
+
exports.default = _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
Object.defineProperty(exports, "getFullBleedBorderRadius", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _getFullBleedBorderRadius.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "useFullBleedContentProps", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _useFullBleedContentProps.default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _FullBleedContent = _interopRequireDefault(require("./FullBleedContent"));
|
|
21
|
+
|
|
22
|
+
var _getFullBleedBorderRadius = _interopRequireDefault(require("./getFullBleedBorderRadius"));
|
|
23
|
+
|
|
24
|
+
var _useFullBleedContentProps = _interopRequireDefault(require("./useFullBleedContentProps"));
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
var _default = _FullBleedContent.default;
|
|
29
|
+
exports.default = _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
9
|
+
|
|
10
|
+
const getContentStackDirection = fullBleedContentPosition => {
|
|
11
|
+
switch (fullBleedContentPosition) {
|
|
12
|
+
case 'left':
|
|
13
|
+
return 'row-reverse';
|
|
14
|
+
|
|
15
|
+
case 'right':
|
|
16
|
+
return 'row';
|
|
17
|
+
|
|
18
|
+
case 'top':
|
|
19
|
+
return 'column-reverse';
|
|
20
|
+
|
|
21
|
+
default:
|
|
22
|
+
return 'column';
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const getContentStackAlign = fullBleedContentAlign => {
|
|
27
|
+
switch (fullBleedContentAlign) {
|
|
28
|
+
case 'center':
|
|
29
|
+
return 'center';
|
|
30
|
+
|
|
31
|
+
case 'end':
|
|
32
|
+
case 'flex-end':
|
|
33
|
+
return 'flex-end';
|
|
34
|
+
|
|
35
|
+
case 'start':
|
|
36
|
+
case 'flex-start':
|
|
37
|
+
return 'flex-start';
|
|
38
|
+
|
|
39
|
+
default:
|
|
40
|
+
return 'stretch';
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Resolves a set of `FullBleedContent` props into the variables a container needs to
|
|
45
|
+
* correctly position a `FullBleedContent` component for the current viewport.
|
|
46
|
+
*
|
|
47
|
+
* @param {object} [fullBleedContent] - a set of valid proptypes for FullBleedContent
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
const useFullBleedContentProps = fullBleedContent => {
|
|
53
|
+
const {
|
|
54
|
+
align: fullBleedContentAlignProp,
|
|
55
|
+
position: fullBleedContentPositionProp,
|
|
56
|
+
...fullBleedContentProps
|
|
57
|
+
} = fullBleedContent ?? {
|
|
58
|
+
position: 'none'
|
|
59
|
+
};
|
|
60
|
+
const fullBleedContentPosition = (0, _componentsBase.useResponsiveProp)(fullBleedContentPositionProp, 'none');
|
|
61
|
+
const contentStackDirection = getContentStackDirection(fullBleedContentPosition);
|
|
62
|
+
const fullBleedContentAlign = (0, _componentsBase.useResponsiveProp)(fullBleedContentAlignProp, 'stretch');
|
|
63
|
+
const contentStackAlign = getContentStackAlign(fullBleedContentAlign);
|
|
64
|
+
return {
|
|
65
|
+
contentStackAlign,
|
|
66
|
+
contentStackDirection,
|
|
67
|
+
fullBleedContentPosition,
|
|
68
|
+
fullBleedContentProps
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var _default = useFullBleedContentProps;
|
|
73
|
+
exports.default = _default;
|