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