@telus-uds/components-web 2.6.0 → 2.8.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 +36 -2
- package/component-docs.json +12 -10
- package/lib/Autocomplete/Autocomplete.js +6 -5
- package/lib/DatePicker/CalendarContainer.js +10 -25
- package/lib/DatePicker/DatePicker.js +104 -57
- package/lib/DatePicker/reactDatesCss.js +1 -1
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +3 -1
- package/lib/Footnote/Footnote.js +6 -2
- package/lib/Listbox/ListboxItem.js +3 -2
- package/lib/Listbox/ListboxOverlay.js +3 -1
- package/lib/NavigationBar/NavigationItem.js +5 -4
- package/lib/StoryCard/StoryCard.js +3 -6
- package/lib/Table/Table.js +1 -1
- package/lib/WebPortal/WebPortal.js +46 -0
- package/lib/WebPortal/index.js +13 -0
- package/lib/WebVideo/WebVideo.js +1 -1
- package/lib/baseExports.js +6 -0
- package/lib/index.js +10 -1
- package/lib-module/Autocomplete/Autocomplete.js +6 -5
- package/lib-module/DatePicker/CalendarContainer.js +10 -25
- package/lib-module/DatePicker/DatePicker.js +103 -58
- package/lib-module/DatePicker/reactDatesCss.js +1 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +3 -1
- package/lib-module/Footnote/Footnote.js +6 -2
- package/lib-module/Listbox/ListboxItem.js +3 -2
- package/lib-module/Listbox/ListboxOverlay.js +3 -2
- package/lib-module/NavigationBar/NavigationItem.js +6 -3
- package/lib-module/StoryCard/StoryCard.js +3 -6
- package/lib-module/Table/Table.js +1 -1
- package/lib-module/WebPortal/WebPortal.js +35 -0
- package/lib-module/WebPortal/index.js +2 -0
- package/lib-module/WebVideo/WebVideo.js +1 -1
- package/lib-module/baseExports.js +1 -1
- package/lib-module/index.js +1 -0
- package/package.json +5 -4
- package/src/Autocomplete/Autocomplete.jsx +3 -2
- package/src/DatePicker/CalendarContainer.jsx +10 -25
- package/src/DatePicker/DatePicker.jsx +99 -65
- package/src/DatePicker/reactDatesCss.js +4 -67
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +1 -1
- package/src/Footnote/Footnote.jsx +6 -2
- package/src/Listbox/ListboxItem.jsx +3 -2
- package/src/Listbox/ListboxOverlay.jsx +4 -3
- package/src/NavigationBar/NavigationItem.jsx +5 -3
- package/src/StoryCard/StoryCard.jsx +3 -7
- package/src/Table/Table.jsx +1 -1
- package/src/WebPortal/WebPortal.jsx +36 -0
- package/src/WebPortal/index.js +3 -0
- package/src/WebVideo/WebVideo.jsx +1 -1
- package/src/baseExports.js +2 -1
- package/src/index.js +1 -0
- package/types/WebVideo.d.ts +2 -2
|
@@ -115,21 +115,17 @@ const StoryCard = forwardRef(
|
|
|
115
115
|
space={1}
|
|
116
116
|
tokens={{ justifyContent: 'space-between', alignItems: 'baseline' }}
|
|
117
117
|
>
|
|
118
|
-
{Boolean(tag) &&
|
|
119
|
-
<Typography variant={{ size: 'eyebrow', colour: 'secondary' }}>
|
|
120
|
-
{tag}
|
|
121
|
-
</Typography>
|
|
122
|
-
)}
|
|
118
|
+
{Boolean(tag) && <Typography variant={{ size: 'eyebrow' }}>{tag}</Typography>}
|
|
123
119
|
{Boolean(date) && (
|
|
124
120
|
// TODO: get user locale and apply date formatting: "MMM DD, YYYY" for `en` and "YYYY-MM-DD" for `fr`
|
|
125
121
|
// Get locale based on decision of https://github.com/telus/universal-design-system/issues/715
|
|
126
|
-
<Typography variant={{ size: 'small'
|
|
122
|
+
<Typography variant={{ size: 'small' }}>{date}</Typography>
|
|
127
123
|
)}
|
|
128
124
|
</StackWrap>
|
|
129
125
|
<Spacer space={2} />
|
|
130
126
|
<Divider variant={{ decorative: true }} />
|
|
131
127
|
<Spacer space={3} />
|
|
132
|
-
<Typography variant={{ size: 'h3'
|
|
128
|
+
<Typography variant={{ size: 'h3' }}>{title}</Typography>
|
|
133
129
|
<Spacer space={2} />
|
|
134
130
|
<Typography>{description}</Typography>
|
|
135
131
|
</Box>
|
package/src/Table/Table.jsx
CHANGED
|
@@ -36,7 +36,7 @@ export const useTableContext = () => useContext(TableContext)
|
|
|
36
36
|
* - Use `Table.Row` and `Table.Cell` to build up the tabular data
|
|
37
37
|
* - Use `Cell`'s `type` prop to visually mark it as a row heading (`type="rowHeading"`)
|
|
38
38
|
*/
|
|
39
|
-
const Table = ({ children, fullWidth =
|
|
39
|
+
const Table = ({ children, fullWidth = true, text = 'medium', tokens, variant, ...rest }) => {
|
|
40
40
|
const { tablePaddingBottom } = useThemeTokens('Table', tokens, variant)
|
|
41
41
|
const containerRef = useRef()
|
|
42
42
|
const tableRef = useRef()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WebPortal component renders its children in a separate portal container appended to the document body.
|
|
6
|
+
*
|
|
7
|
+
* While `@gorhom/portal` works well for a lot of use-cases, there are some issues with it, particularly around
|
|
8
|
+
* reading context values (see issues below). For web-only components, it is safe to replace `Portal` from `@gorhom/portal`
|
|
9
|
+
* to `WebPortal` to solve such issues
|
|
10
|
+
*
|
|
11
|
+
* https://github.com/gorhom/react-native-portal/issues/34
|
|
12
|
+
* https://github.com/gorhom/react-native-portal/issues/2
|
|
13
|
+
* https://github.com/gorhom/react-native-portal/issues/3
|
|
14
|
+
* https://github.com/gorhom/react-native-portal/issues/31
|
|
15
|
+
*
|
|
16
|
+
* @component
|
|
17
|
+
* @param {object} props - The component props.
|
|
18
|
+
* @param {React.ReactNode} props.children - The content to render within the portal.
|
|
19
|
+
* @returns {React.ReactPortal} The React portal component.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const WebPortal = ({ children }) => {
|
|
23
|
+
const portalContainer = document.createElement('div')
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
document.body.appendChild(portalContainer)
|
|
27
|
+
|
|
28
|
+
return () => {
|
|
29
|
+
document.body.removeChild(portalContainer)
|
|
30
|
+
}
|
|
31
|
+
}, [portalContainer])
|
|
32
|
+
|
|
33
|
+
return ReactDOM.createPortal(children, portalContainer)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default WebPortal
|
|
@@ -119,7 +119,7 @@ export const VideoProps = {
|
|
|
119
119
|
/**
|
|
120
120
|
* The splash screen UI's language as an ISO language code. It currently supports English and French.
|
|
121
121
|
*/
|
|
122
|
-
copy: PropTypes.oneOf(['en', 'fr'])
|
|
122
|
+
copy: PropTypes.oneOf(['en', 'fr']),
|
|
123
123
|
/**
|
|
124
124
|
* A function to be run when the play button is pressed on the video splash screen and the video is ready to play.
|
|
125
125
|
*/
|
package/src/baseExports.js
CHANGED
|
@@ -67,5 +67,6 @@ export {
|
|
|
67
67
|
// Enable access to the viewports system for app-specific responsive layouts and features
|
|
68
68
|
useResponsiveProp,
|
|
69
69
|
useViewport, // TODO reenable ViewportContext once published from base // enable localised viewport overrides e.g. in tests, narrow columns, etc
|
|
70
|
-
useCarousel
|
|
70
|
+
useCarousel,
|
|
71
|
+
useSetTheme
|
|
71
72
|
} from '@telus-uds/components-base'
|
package/src/index.js
CHANGED
|
@@ -37,6 +37,7 @@ export { default as TermsAndConditions } from './TermsAndConditions'
|
|
|
37
37
|
export { default as NavigationBar } from './NavigationBar'
|
|
38
38
|
export { default as Progress } from './Progress'
|
|
39
39
|
export { default as SkeletonProvider } from './SkeletonProvider'
|
|
40
|
+
export { default as WebPortal } from './WebPortal'
|
|
40
41
|
|
|
41
42
|
export { ssrStyles } from './utils'
|
|
42
43
|
|
package/types/WebVideo.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export interface WebVideoProps extends HTMLAttrs {
|
|
|
8
8
|
defaultVolume?: number
|
|
9
9
|
beginMuted?: boolean
|
|
10
10
|
videoLength: number
|
|
11
|
-
copy
|
|
12
|
-
onStart
|
|
11
|
+
copy?: 'en' | 'fr'
|
|
12
|
+
onStart?: () => void
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
declare const WebVideo: ComponentType<WebVideoProps>
|