@telus-uds/components-web 1.3.0 → 1.5.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.
Files changed (128) hide show
  1. package/CHANGELOG.md +32 -2
  2. package/lib/Breadcrumbs/Breadcrumbs.js +247 -0
  3. package/lib/Breadcrumbs/Item/Item.js +165 -0
  4. package/lib/Breadcrumbs/index.js +15 -0
  5. package/lib/Callout/Callout.js +121 -0
  6. package/lib/Callout/index.js +13 -0
  7. package/lib/DatePicker/CalendarContainer.js +221 -0
  8. package/lib/DatePicker/DatePicker.js +329 -0
  9. package/lib/DatePicker/dictionary.js +134 -0
  10. package/lib/DatePicker/index.js +13 -0
  11. package/lib/DatePicker/reactDatesCss.js +12 -0
  12. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +75 -0
  13. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +95 -0
  14. package/lib/ExpandCollapseMini/index.js +13 -0
  15. package/lib/Footnote/Footnote.js +571 -0
  16. package/lib/Footnote/FootnoteLink.js +149 -0
  17. package/lib/Footnote/dictionary.js +19 -0
  18. package/lib/Footnote/index.js +16 -0
  19. package/lib/Paragraph/Paragraph.js +107 -0
  20. package/lib/Paragraph/index.js +13 -0
  21. package/lib/PreviewCard/AuthorDate.js +64 -0
  22. package/lib/PreviewCard/PreviewCard.js +236 -0
  23. package/lib/PreviewCard/index.js +13 -0
  24. package/lib/PriceLockup/PriceLockup.js +237 -0
  25. package/lib/PriceLockup/index.js +13 -0
  26. package/lib/PriceLockup/tokens.js +131 -0
  27. package/lib/ResponsiveImage/ResponsiveImage.js +115 -0
  28. package/lib/ResponsiveImage/index.js +13 -0
  29. package/lib/Ribbon/Ribbon.js +0 -1
  30. package/lib/Span/Span.js +88 -0
  31. package/lib/Span/index.js +13 -0
  32. package/lib/index.js +91 -1
  33. package/lib/shared/FullBleedContent/FullBleedContent.js +121 -0
  34. package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +73 -0
  35. package/lib/shared/FullBleedContent/index.js +29 -0
  36. package/lib/shared/FullBleedContent/useFullBleedContentProps.js +73 -0
  37. package/lib/utils/index.js +32 -0
  38. package/lib/utils/logger.js +31 -0
  39. package/lib/utils/media.js +54 -0
  40. package/lib/utils/renderStructuredContent.js +89 -0
  41. package/lib/utils/useTypographyTheme.js +32 -0
  42. package/lib-module/Breadcrumbs/Breadcrumbs.js +228 -0
  43. package/lib-module/Breadcrumbs/Item/Item.js +141 -0
  44. package/lib-module/Breadcrumbs/index.js +1 -0
  45. package/lib-module/Callout/Callout.js +106 -0
  46. package/lib-module/Callout/index.js +2 -0
  47. package/lib-module/DatePicker/CalendarContainer.js +208 -0
  48. package/lib-module/DatePicker/DatePicker.js +302 -0
  49. package/lib-module/DatePicker/dictionary.js +127 -0
  50. package/lib-module/DatePicker/index.js +2 -0
  51. package/lib-module/DatePicker/reactDatesCss.js +3 -0
  52. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +56 -0
  53. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +80 -0
  54. package/lib-module/ExpandCollapseMini/index.js +2 -0
  55. package/lib-module/Footnote/Footnote.js +541 -0
  56. package/lib-module/Footnote/FootnoteLink.js +130 -0
  57. package/lib-module/Footnote/dictionary.js +12 -0
  58. package/lib-module/Footnote/index.js +4 -0
  59. package/lib-module/Paragraph/Paragraph.js +89 -0
  60. package/lib-module/Paragraph/index.js +2 -0
  61. package/lib-module/PreviewCard/AuthorDate.js +53 -0
  62. package/lib-module/PreviewCard/PreviewCard.js +211 -0
  63. package/lib-module/PreviewCard/index.js +2 -0
  64. package/lib-module/PriceLockup/PriceLockup.js +213 -0
  65. package/lib-module/PriceLockup/index.js +2 -0
  66. package/lib-module/PriceLockup/tokens.js +120 -0
  67. package/lib-module/ResponsiveImage/ResponsiveImage.js +100 -0
  68. package/lib-module/ResponsiveImage/index.js +2 -0
  69. package/lib-module/Ribbon/Ribbon.js +1 -2
  70. package/lib-module/Span/Span.js +70 -0
  71. package/lib-module/Span/index.js +2 -0
  72. package/lib-module/index.js +10 -0
  73. package/lib-module/shared/FullBleedContent/FullBleedContent.js +106 -0
  74. package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +65 -0
  75. package/lib-module/shared/FullBleedContent/index.js +4 -0
  76. package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +65 -0
  77. package/lib-module/utils/index.js +5 -1
  78. package/lib-module/utils/logger.js +18 -0
  79. package/lib-module/utils/media.js +46 -0
  80. package/lib-module/utils/renderStructuredContent.js +77 -0
  81. package/lib-module/utils/useTypographyTheme.js +24 -0
  82. package/package.json +9 -5
  83. package/src/Breadcrumbs/Breadcrumbs.jsx +222 -0
  84. package/src/Breadcrumbs/Item/Item.jsx +127 -0
  85. package/src/Breadcrumbs/index.js +1 -0
  86. package/src/Callout/Callout.jsx +76 -0
  87. package/src/Callout/index.js +3 -0
  88. package/src/DatePicker/CalendarContainer.jsx +210 -0
  89. package/src/DatePicker/DatePicker.jsx +303 -0
  90. package/src/DatePicker/dictionary.js +92 -0
  91. package/src/DatePicker/index.js +3 -0
  92. package/src/DatePicker/reactDatesCss.js +892 -0
  93. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +48 -0
  94. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +67 -0
  95. package/src/ExpandCollapseMini/index.js +3 -0
  96. package/src/Footnote/Footnote.jsx +468 -0
  97. package/src/Footnote/FootnoteLink.jsx +120 -0
  98. package/src/Footnote/dictionary.js +12 -0
  99. package/src/Footnote/index.js +6 -0
  100. package/src/Paragraph/Paragraph.jsx +79 -0
  101. package/src/Paragraph/index.js +3 -0
  102. package/src/PreviewCard/AuthorDate.jsx +31 -0
  103. package/src/PreviewCard/PreviewCard.jsx +201 -0
  104. package/src/PreviewCard/index.js +3 -0
  105. package/src/PriceLockup/PriceLockup.jsx +210 -0
  106. package/src/PriceLockup/index.js +3 -0
  107. package/src/PriceLockup/tokens.js +58 -0
  108. package/src/ResponsiveImage/ResponsiveImage.jsx +77 -0
  109. package/src/ResponsiveImage/index.js +3 -0
  110. package/src/Ribbon/Ribbon.jsx +0 -1
  111. package/src/Span/Span.jsx +66 -0
  112. package/src/Span/index.js +3 -0
  113. package/src/index.js +10 -0
  114. package/src/shared/FullBleedContent/FullBleedContent.jsx +90 -0
  115. package/src/shared/FullBleedContent/getFullBleedBorderRadius.js +55 -0
  116. package/src/shared/FullBleedContent/index.js +6 -0
  117. package/src/shared/FullBleedContent/useFullBleedContentProps.js +63 -0
  118. package/src/utils/index.js +5 -1
  119. package/src/utils/logger.js +20 -0
  120. package/src/utils/media.js +40 -0
  121. package/src/utils/renderStructuredContent.jsx +73 -0
  122. package/src/utils/useTypographyTheme.js +14 -0
  123. package/types/Callout.d.ts +13 -0
  124. package/types/DatePicker.d.ts +21 -0
  125. package/types/Footnote.d.ts +21 -0
  126. package/types/FootnoteLink.d.ts +20 -0
  127. package/types/PriceLockup.d.ts +22 -0
  128. package/types/common.d.ts +14 -0
@@ -0,0 +1,228 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { Helmet, HelmetProvider } from 'react-helmet-async';
5
+ import { componentPropType, selectSystemProps, unpackFragment, withLinkRouter } from '@telus-uds/components-base';
6
+ import { htmlAttrs } from '../utils';
7
+ import Item from './Item/Item';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { createElement as _createElement } from "react";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
12
+ const StyledList = /*#__PURE__*/styled.ol.withConfig({
13
+ displayName: "Breadcrumbs__StyledList",
14
+ componentId: "components-web__sc-gwwxrc-0"
15
+ })({
16
+ display: 'flex',
17
+ flexDirection: 'row',
18
+ flexWrap: 'wrap',
19
+ listStyle: 'none',
20
+ listStylePosition: 'inside',
21
+ margin: 0,
22
+ padding: 0
23
+ });
24
+
25
+ const omitProps = _ref => {
26
+ let {
27
+ current,
28
+ path,
29
+ breadcrumbName,
30
+ indexRoute,
31
+ childRoutes,
32
+ component,
33
+ ...props
34
+ } = _ref;
35
+ return props;
36
+ };
37
+
38
+ const getBreadcrumbName = (item, params) => {
39
+ if (!item.breadcrumbName) {
40
+ return null;
41
+ }
42
+
43
+ let {
44
+ breadcrumbName
45
+ } = item;
46
+ Object.keys(params).forEach(key => {
47
+ breadcrumbName = breadcrumbName.replace(`:${key}`, params[key]);
48
+ });
49
+ return breadcrumbName;
50
+ };
51
+
52
+ const getPath = (path, params, concatenatePaths, paths) => {
53
+ let p = path;
54
+
55
+ if (concatenatePaths) {
56
+ p = p.replace(/^\//, '');
57
+ Object.keys(params).forEach(key => {
58
+ p = p.replace(`:${key}`, params[key]);
59
+ });
60
+
61
+ if (p) {
62
+ paths.push(p);
63
+ }
64
+
65
+ return `/${paths.join('/')}`;
66
+ }
67
+
68
+ return p;
69
+ };
70
+
71
+ const getItems = (items, params, concatenatePaths) => {
72
+ const paths = [];
73
+ return items.filter(item => item.path).map((item, i, filteredItems) => {
74
+ const isLast = i === filteredItems.length - 1;
75
+ const breadcrumbName = getBreadcrumbName(item, params);
76
+ const href = getPath(item.path, params, concatenatePaths, paths);
77
+ return {
78
+ breadcrumbName,
79
+ href,
80
+ current: isLast,
81
+ ...omitProps(selectProps(item))
82
+ };
83
+ });
84
+ };
85
+
86
+ const getStructuredData = (items, baseUrl) => {
87
+ return items.map((item, index) => ({
88
+ '@type': 'ListItem',
89
+ position: index + 1,
90
+ item: {
91
+ '@id': `${baseUrl || ''}${item.href}`,
92
+ name: item.breadcrumbName
93
+ }
94
+ }));
95
+ };
96
+ /**
97
+ * Display a hierarchy of links, commonly used for navigation.
98
+ */
99
+
100
+
101
+ const Breadcrumbs = _ref2 => {
102
+ let {
103
+ baseUrl,
104
+ children,
105
+ linkRouterProps,
106
+ params = {},
107
+ tokens,
108
+ reactRouterLinkComponent,
109
+ routes,
110
+ variant,
111
+ LinkRouter,
112
+ ...rest
113
+ } = _ref2;
114
+ // React Helmet can cause a memory leak in SSR if not properly configured.
115
+ // Only run it in SSR if theme options tells us to.
116
+
117
+ /* const {
118
+ themeOptions: { enableHelmetSSR }
119
+ } = useTheme() */
120
+ // const isHydrating = useHydrationContext()
121
+ // const isSSR = typeof window === 'undefined' || isHydrating
122
+ // const hasMetadata = isSSR ? enableHelmetSSR : true
123
+ const helmetContext = {};
124
+ const activeRoutes = children ? React.Children.map(unpackFragment(children), _ref3 => {
125
+ let {
126
+ props: {
127
+ href,
128
+ children: breadcrumbName,
129
+ ...itemRest
130
+ },
131
+ ref
132
+ } = _ref3;
133
+ return {
134
+ path: href,
135
+ breadcrumbName,
136
+ ref,
137
+ ...itemRest
138
+ };
139
+ }) : routes.filter(route => route.path && route.breadcrumbName);
140
+ const items = getItems(activeRoutes, params, !children);
141
+
142
+ const metadata = /*#__PURE__*/_jsx(HelmetProvider, {
143
+ context: helmetContext,
144
+ children: /*#__PURE__*/_jsx(Helmet, {
145
+ children: /*#__PURE__*/_jsx("script", {
146
+ type: "application/ld+json",
147
+ children: `
148
+ {
149
+ "@context": "http://schema.org",
150
+ "@type": "BreadcrumbList",
151
+ "itemListElement": ${JSON.stringify(getStructuredData(items, baseUrl))}
152
+ }
153
+ `
154
+ })
155
+ })
156
+ });
157
+
158
+ return /*#__PURE__*/_jsxs("nav", { ...selectProps(rest),
159
+ children: [/*#__PURE__*/_jsx(StyledList, {
160
+ children: items.map(_ref4 => {
161
+ let {
162
+ href,
163
+ current,
164
+ breadcrumbName,
165
+ reactRouterLinkComponent: linkComponent = reactRouterLinkComponent,
166
+ LinkRouter: ItemLinkRouter = LinkRouter,
167
+ linkRouterProps: itemLinkRouterProps,
168
+ ...itemRest
169
+ } = _ref4;
170
+ return /*#__PURE__*/_createElement(Item, { ...itemRest,
171
+ current: current,
172
+ href: href,
173
+ tokens: tokens,
174
+ key: href,
175
+ linkRouterProps: { ...linkRouterProps,
176
+ itemLinkRouterProps
177
+ },
178
+ reactRouterLinkComponent: linkComponent,
179
+ variant: variant,
180
+ LinkRouter: ItemLinkRouter
181
+ }, breadcrumbName);
182
+ })
183
+ }), metadata]
184
+ });
185
+ };
186
+
187
+ Breadcrumbs.propTypes = { ...selectedSystemPropTypes,
188
+ ...withLinkRouter.propTypes,
189
+
190
+ /**
191
+ * Base URL used to build structured data.
192
+ */
193
+ baseUrl: PropTypes.string,
194
+
195
+ /**
196
+ * A list of Items to be used as an alternative to the `routes` prop.
197
+ */
198
+ children: componentPropType('Item'),
199
+
200
+ /**
201
+ * React Router params.
202
+ */
203
+ params: PropTypes.object,
204
+
205
+ /**
206
+ * React Router Link component.
207
+ * @deprecated please use `LinkRouter` and `linkRouterProps` instead
208
+ */
209
+ reactRouterLinkComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
210
+
211
+ /**
212
+ * An array of routes to be displayed as breadcrumbs.
213
+ */
214
+ routes: PropTypes.arrayOf(PropTypes.shape({
215
+ path: PropTypes.string,
216
+ breadcrumbName: PropTypes.string
217
+ })),
218
+
219
+ /**
220
+ * Variant to render.
221
+ */
222
+ variant: PropTypes.shape({
223
+ inverse: PropTypes.bool,
224
+ light: PropTypes.bool
225
+ })
226
+ };
227
+ Breadcrumbs.Item = Item;
228
+ export default Breadcrumbs;
@@ -0,0 +1,141 @@
1
+ import React, { forwardRef } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { Link, Typography, clickProps, selectSystemProps, useThemeTokens, withLinkRouter } from '@telus-uds/components-base';
5
+ import { htmlAttrs } from '../../utils';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { Fragment as _Fragment } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
10
+ const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
11
+ displayName: "Item__StyledItemContainer",
12
+ componentId: "components-web__sc-1rfdaul-0"
13
+ })({
14
+ display: 'flex',
15
+ paddingLeft: _ref => {
16
+ let {
17
+ listItemPadding
18
+ } = _ref;
19
+ return `${listItemPadding}px`;
20
+ }
21
+ });
22
+ const IconContainer = /*#__PURE__*/styled.span.withConfig({
23
+ displayName: "Item__IconContainer",
24
+ componentId: "components-web__sc-1rfdaul-1"
25
+ })({
26
+ display: 'inline-flex',
27
+ alignItems: 'center',
28
+ paddingLeft: _ref2 => {
29
+ let {
30
+ iconPadding
31
+ } = _ref2;
32
+ return `${iconPadding}px`;
33
+ },
34
+ paddingRight: _ref3 => {
35
+ let {
36
+ iconPadding
37
+ } = _ref3;
38
+ return `${iconPadding}px`;
39
+ }
40
+ });
41
+ const Item = /*#__PURE__*/forwardRef((_ref4, ref) => {
42
+ let {
43
+ href,
44
+ reactRouterLinkComponent: ReactRouterLink,
45
+ children,
46
+ current = false,
47
+ tokens,
48
+ variant = {
49
+ light: true
50
+ },
51
+ // `light` variant (shared with the `Link` component) is default by design
52
+ ...rest
53
+ } = _ref4;
54
+ const {
55
+ iconColor,
56
+ icon: ChevronRightIcon,
57
+ ...themeTokens
58
+ } = useThemeTokens('Breadcrumbs', tokens, variant);
59
+ const linkOptions = clickProps.toPressProps(selectProps(rest));
60
+
61
+ if (ReactRouterLink) {
62
+ linkOptions.to = href;
63
+ } else {
64
+ linkOptions.href = href;
65
+ }
66
+
67
+ return /*#__PURE__*/_jsx(StyledItemContainer, { ...themeTokens,
68
+ children: current ? /*#__PURE__*/_jsx(Typography, {
69
+ variant: { ...variant,
70
+ secondary: true
71
+ },
72
+ children: children
73
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
74
+ children: [ReactRouterLink ? /*#__PURE__*/_jsx(ReactRouterLink, { ...linkOptions,
75
+ // TODO refactor
76
+ // eslint-disable-next-line react/no-unstable-nested-components
77
+ component: props => {
78
+ return /*#__PURE__*/_jsx(Link, { ...props,
79
+ variant: variant
80
+ });
81
+ },
82
+ ref: ref,
83
+ children: children
84
+ }) : /*#__PURE__*/_jsx(Link, { ...linkOptions,
85
+ ref: ref,
86
+ variant: variant,
87
+ children: children
88
+ }), /*#__PURE__*/_jsx(IconContainer, { ...themeTokens,
89
+ children: /*#__PURE__*/_jsx(ChevronRightIcon, {
90
+ size: 16,
91
+ color: iconColor
92
+ })
93
+ })]
94
+ })
95
+ });
96
+ });
97
+ Item.displayName = 'Item';
98
+ Item.propTypes = { ...selectedSystemPropTypes,
99
+
100
+ /**
101
+ * Breadcrumb text
102
+ */
103
+ children: PropTypes.node.isRequired,
104
+
105
+ /**
106
+ * @ignore
107
+ *
108
+ * Indicates whether or not the Item should be as current/active
109
+ */
110
+ current: PropTypes.bool,
111
+
112
+ /**
113
+ * Target URL. This will be converted to `to` if the `reactRouterLinkComponent`
114
+ * prop is provided to the `Item` or parent `Breadcrumbs` element.
115
+ */
116
+ href: PropTypes.string.isRequired,
117
+
118
+ /**
119
+ * React Router Link component. This will be passed down from the parent
120
+ * `<Breadcrumbs>` if the parent has a `reactRouterLinkComponent` provided.
121
+ * @deprecated please use `LinkRouter` and `linkRouterProps` instead
122
+ */
123
+ reactRouterLinkComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
124
+
125
+ /**
126
+ * Variant to render.
127
+ */
128
+ variant: PropTypes.shape({
129
+ inverse: PropTypes.bool
130
+ })
131
+ }; // Since react/require-default-props eslint rule doesn't pick up default arguments as default props when combined with `forwardRef`
132
+ // - probably related https://github.com/yannickcr/eslint-plugin-react/issues/2760
133
+
134
+ Item.defaultProps = {
135
+ current: false,
136
+ reactRouterLinkComponent: undefined,
137
+ variant: {
138
+ light: true
139
+ }
140
+ };
141
+ export default withLinkRouter(Item);
@@ -0,0 +1 @@
1
+ export { default } from './Breadcrumbs';
@@ -0,0 +1,106 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { Icon, selectSystemProps, Typography, useThemeTokens } from '@telus-uds/components-base';
5
+ import { htmlAttrs } from '../utils';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
9
+
10
+ const verticalAlignToFlex = verticalAlign => {
11
+ switch (verticalAlign) {
12
+ case 'top':
13
+ return 'flex-start';
14
+
15
+ case 'middle':
16
+ return 'center';
17
+
18
+ case 'bottom':
19
+ return 'flex-end';
20
+
21
+ default:
22
+ return 'top';
23
+ }
24
+ };
25
+
26
+ const CalloutContainer = /*#__PURE__*/styled.div.withConfig({
27
+ displayName: "Callout__CalloutContainer",
28
+ componentId: "components-web__sc-1a7ptx-0"
29
+ })(_ref => {
30
+ let {
31
+ rounded,
32
+ verticalAlign = 'top',
33
+ background,
34
+ gap,
35
+ borderRadius,
36
+ padding
37
+ } = _ref;
38
+ return {
39
+ background,
40
+ display: 'flex',
41
+ gap,
42
+ borderRadius,
43
+ padding,
44
+ justifyContent: `${rounded ? 'center' : 'flex-start'}`,
45
+ alignItems: verticalAlignToFlex(verticalAlign)
46
+ };
47
+ });
48
+
49
+ const Callout = _ref2 => {
50
+ let {
51
+ icon,
52
+ children,
53
+ verticalAlign = 'top',
54
+ tokens,
55
+ variant = {},
56
+ ...rest
57
+ } = _ref2;
58
+ const {
59
+ background,
60
+ gap,
61
+ borderRadius,
62
+ paddingLeft,
63
+ paddingRight,
64
+ paddingTop,
65
+ paddingBottom,
66
+ color
67
+ } = useThemeTokens('Callout', tokens, variant);
68
+ const {
69
+ rounded = false,
70
+ size = 'medium'
71
+ } = variant;
72
+ return /*#__PURE__*/_jsxs(CalloutContainer, {
73
+ size: size,
74
+ rounded: rounded,
75
+ "data-testid": "callout-container",
76
+ verticalAlign: verticalAlign,
77
+ background: background,
78
+ gap: gap,
79
+ borderRadius: borderRadius,
80
+ padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
81
+ ...selectProps(rest),
82
+ children: [icon && /*#__PURE__*/_jsx(Icon, {
83
+ icon: icon,
84
+ variant: {
85
+ rank: 'primary',
86
+ size
87
+ }
88
+ }), /*#__PURE__*/_jsx(Typography, {
89
+ variant: {
90
+ size,
91
+ compact: size === 'small'
92
+ },
93
+ tokens: {
94
+ color
95
+ },
96
+ children: children
97
+ })]
98
+ });
99
+ };
100
+
101
+ Callout.propTypes = { ...selectedSystemPropTypes,
102
+ icon: PropTypes.elementType,
103
+ children: PropTypes.node.isRequired,
104
+ verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom'])
105
+ };
106
+ export default Callout;
@@ -0,0 +1,2 @@
1
+ import Callout from './Callout';
2
+ export default Callout;
@@ -0,0 +1,208 @@
1
+ import styled from 'styled-components';
2
+ import defaultReactDatesCss from './reactDatesCss';
3
+ const CalendarContainer = /*#__PURE__*/styled.div.withConfig({
4
+ displayName: "CalendarContainer",
5
+ componentId: "components-web__sc-qdc1tg-0"
6
+ })(_ref => {
7
+ let {
8
+ daySize,
9
+ validation,
10
+ remainingTokens,
11
+ calendarMonthFontTokens,
12
+ dayPickerNavigationButtonTokens,
13
+ defaultFontTokens
14
+ } = _ref;
15
+ return `
16
+ ${defaultReactDatesCss}
17
+ > div {
18
+ z-index: 3;
19
+ }
20
+ .SingleDatePicker,
21
+ .SingleDatePickerInput {
22
+ display: block;
23
+ }
24
+ .SingleDatePicker_picker {
25
+ box-shadow: none;
26
+ border: 1px solid ${remainingTokens.singleDatePickerBorderColor};
27
+ border-radius: ${remainingTokens.singleDatePickerRadius};
28
+ padding: ${remainingTokens.singleDatePickerPaddingTopBottom}px ${remainingTokens.singleDatePickerLeftRight}px;
29
+ z-index: 3;
30
+ }
31
+ .DateInput {
32
+ width: 100%;
33
+ border: 2px solid ${remainingTokens.dateInputBorderColor};
34
+ border-radius: ${remainingTokens.dateInputBorderRadius};
35
+ ${validation === 'error' && `input { border-color: ${remainingTokens.invalidInputMixin}; }`};
36
+ ${validation === 'success' && `input { border-color: ${remainingTokens.validInputMixin}; }`};
37
+ }
38
+ .DateInput:hover {
39
+ border: 2px solid ${remainingTokens.dateInputHoverBorderColor};
40
+ }
41
+ .DateInput:focus {
42
+ border: 2px solid ${remainingTokens.dateInputFocusBorderColor};
43
+ }
44
+ .SingleDatePickerInput__withBorder {
45
+ border: 0 !important;
46
+ }
47
+ .DateInput_input {
48
+ box-sizing: border-box;
49
+ padding: 1rem;
50
+ border: 1px solid ${remainingTokens.dateInputInsideBorderColor};
51
+ border-radius: 4px;
52
+ min-height: 3.25rem;
53
+ color: ${remainingTokens.dateInputInsideColor};
54
+ font-weight: 400;
55
+ font-size: 1rem;
56
+ box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
57
+ }
58
+ .DateInput_fang {
59
+ transform: translateY(2px);
60
+ z-index: 4;
61
+ left: ${(daySize * 8.5 - 20) / 2}px;
62
+ }
63
+ .DateInput_fangStroke {
64
+ stroke: ${remainingTokens.dateInputStrokeColor};
65
+ }
66
+ .CalendarMonth_caption {
67
+ color: ${remainingTokens.calendarMonthCaptionColor};
68
+ font-family: ${calendarMonthFontTokens.fontFamily};
69
+ font-size: ${remainingTokens.calendarMonthCaptionFontSize};
70
+ font-weight: ${calendarMonthFontTokens.fontWeight};
71
+ line-height: ${remainingTokens.calendarMonthCaptionLineHeight};
72
+ padding-bottom: ${remainingTokens.calendarMonthCaptionPaddingBottom}px;
73
+ }
74
+ .DayPicker__withBorder {
75
+ box-shadow: none;
76
+ }
77
+ .DayPickerNavigation_button {
78
+ align-items: center;
79
+ display: flex;
80
+ justify-content: center;
81
+ border: 1px solid ${remainingTokens.dayPickerNavigationButtonBorderColor};
82
+ background-color: ${remainingTokens.dayPickerNavigationButtonBackgroundColor};
83
+ border-radius: 50%;
84
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
85
+ max-height: ${remainingTokens.dayPickerNavigationButtonMaxHeight}px;
86
+ max-width: ${remainingTokens.dayPickerNavigationButtonMaxWidth}px;
87
+ position: absolute;
88
+ top: 18px;
89
+ line-height: 0.78;
90
+ padding: ${remainingTokens.dayPickerNavigationButtonPadding}px;
91
+ cursor: pointer;
92
+ user-select: none;
93
+ &:nth-child(1) {
94
+ left: ${remainingTokens.dayPickerNavigationButtonChildLeft}px;
95
+ }
96
+ &:nth-child(2) {
97
+ right: ${remainingTokens.dayPickerNavigationButtonChildRight}px;
98
+ i {
99
+ font-family: 'TELUS Core Icons';
100
+ display: inline-block;
101
+ font-weight: normal;
102
+ font-style: normal;
103
+ speak: none;
104
+ text-decoration: inherit;
105
+ text-transform: none;
106
+ text-rendering: auto;
107
+ -webkit-font-smoothing: antialiased;
108
+ -moz-osx-font-smoothing: grayscale;
109
+ line-height: 1;
110
+ vertical-align: middle;
111
+ &:before {
112
+ content: '\\F107';
113
+ display: inline-block;
114
+ }
115
+ }
116
+ }
117
+ & svg {
118
+ fill: ${remainingTokens.dayPickerNavigationButtonChildSvgFill};
119
+ }
120
+ }
121
+ .DayPickerNavigation_button__default:focus,
122
+ .DayPickerNavigation_button__default:hover {
123
+ border: 1px solid ${remainingTokens.dayPickerNavigationButtonDefaultHoverBorderColor};
124
+ }
125
+ .DayPickerNavigation_svg__horizontal {
126
+ fill: ${remainingTokens.dayPickerNavigationSVGHorizontalFill};
127
+ }
128
+ .DayPicker_weekHeader {
129
+ color: ${remainingTokens.dayPickerWeekHeaderColor};
130
+ font-family: ${dayPickerNavigationButtonTokens.fontFamily};
131
+ font-weight: ${dayPickerNavigationButtonTokens.fontWeight};
132
+ font-feature-settings: 'ss01' on, 'ss03' on, 'ss08' on;
133
+ line-height: ${remainingTokens.dayPickerWeekHeaderLineHeight};
134
+ & small {
135
+ font-size: ${remainingTokens.dayPickerWeekHeaderSmall};
136
+ }
137
+ & li {
138
+ max-width: ${daySize}px !important;
139
+ }
140
+ }
141
+ .CalendarDay__default {
142
+ padding: 0px;
143
+ position: relative;
144
+ background-clip: padding-box;
145
+ border: ${remainingTokens.calendarDayDefaultBorder} solid ${remainingTokens.calendarDayDefaultBorderColor};
146
+ vertical-align: middle;
147
+ font-family: ${defaultFontTokens.fontFamily};
148
+ font-weight: ${defaultFontTokens.fontWeight}
149
+ font-feature-settings: 'ss01' on, 'ss03' on, 'ss08' on;
150
+ font-size: ${remainingTokens.calendarDayDefaultFontSize};
151
+ line-height: ${daySize - 3}px !important;
152
+ color: ${remainingTokens.calendarDayDefaultColor};
153
+ text-decoration: none;
154
+ transition: all 0.3s;
155
+ &:before {
156
+ content: '';
157
+ position: absolute;
158
+ top: 50%;
159
+ left: 50%;
160
+ transform: translate(-50%, -50%);
161
+ height: ${remainingTokens.calendarDayDefaultBeforeHeight}px;
162
+ width: ${remainingTokens.calendarDayDefaultBeforeWidth}px;
163
+ border-radius: 50%;
164
+ background: transparent;
165
+ transition: all 0.3s;
166
+ z-index: -1;
167
+ }
168
+ }
169
+ .CalendarDay__default:hover,
170
+ .CalendarDay__selected,
171
+ .CalendarDay__selected:active,
172
+ .CalendarDay__selected:hover {
173
+ background: none;
174
+ border: 1px solid ${remainingTokens.calendarDaySelectedHoverBorderColor};
175
+ color: ${remainingTokens.calendarDaySelectedHoverColor};
176
+ text-decoration: none;
177
+ z-index: 0;
178
+ &:before {
179
+ background: ${remainingTokens.calendarDaySelectedHoverBeforeBackground};
180
+ }
181
+ }
182
+ .CalendarDay__default.CalendarDay__selected,
183
+ .CalendarDay__default.CalendarDay__selected:active
184
+ .CalendarDay__default.CalendarDay__selected:hover {
185
+ color: ${remainingTokens.calendarDayDefaultCalendarDaySelectedHoverColor};
186
+ text-decoration: none;
187
+ &:before {
188
+ background: ${remainingTokens.calendarDayDefaultCalendarDaySelectedHoverBackground};
189
+ }
190
+ }
191
+ .CalendarDay__blocked_out_of_range,
192
+ .CalendarDay__blocked_out_of_range:active,
193
+ .CalendarDay__blocked_out_of_range:hover,
194
+ .CalendarDay__blocked_calendar,
195
+ .CalendarDay__blocked_calendar:active,
196
+ .CalendarDay__blocked_calendar:hover {
197
+ font-weight: 300;
198
+ background: ${remainingTokens.calendarDayBlockedCalendarHoverBackground};
199
+ background-clip: padding-box;
200
+ color: ${remainingTokens.calendarDayBlockedCalendarHoverColor};
201
+ text-decoration: none;
202
+ &:before {
203
+ content: none;
204
+ }
205
+ }
206
+ `;
207
+ });
208
+ export default CalendarContainer;