@ltht-react/involved-team-summary 2.0.3 → 2.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/involved-team-summary",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "ltht-react clinical InvolvedTeamSummary component.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -8,7 +8,8 @@
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
11
- "lib"
11
+ "lib",
12
+ "src"
12
13
  ],
13
14
  "directories": {
14
15
  "lib": "lib"
@@ -23,12 +24,12 @@
23
24
  "dependencies": {
24
25
  "@emotion/react": "^11.0.0",
25
26
  "@emotion/styled": "^11.0.0",
26
- "@ltht-react/list": "^2.0.3",
27
- "@ltht-react/styles": "^2.0.3",
28
- "@ltht-react/type-summary": "^2.0.3",
29
- "@ltht-react/types": "^2.0.3",
30
- "@ltht-react/utils": "^2.0.3",
27
+ "@ltht-react/list": "^2.0.4",
28
+ "@ltht-react/styles": "^2.0.4",
29
+ "@ltht-react/type-summary": "^2.0.4",
30
+ "@ltht-react/types": "^2.0.4",
31
+ "@ltht-react/utils": "^2.0.4",
31
32
  "react": "^18.2.0"
32
33
  },
33
- "gitHead": "6f18742bbf2f44123b6478257e52fbbdd291a25b"
34
+ "gitHead": "b8fe243323a0f1b9ab345475db38c73fd3b35312"
34
35
  }
@@ -0,0 +1,22 @@
1
+ import { HTMLAttributes, FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { EpisodeOfCare } from '@ltht-react/types'
6
+
7
+ const StyledInvolvedTeamDescription = styled.div`
8
+ color: ${TEXT_COLOURS.SECONDARY.VALUE};
9
+ text-align: left;
10
+ font-size: smaller;
11
+ padding-top: 0.25rem;
12
+ `
13
+
14
+ const InvolvedTeamDescription: FC<Props> = ({ episodeOfCare, ...rest }) => (
15
+ <StyledInvolvedTeamDescription {...rest}>{episodeOfCare.careManager?.display}</StyledInvolvedTeamDescription>
16
+ )
17
+
18
+ interface Props extends HTMLAttributes<HTMLDivElement> {
19
+ episodeOfCare: EpisodeOfCare
20
+ }
21
+
22
+ export default InvolvedTeamDescription
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes, FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { EpisodeOfCare } from '@ltht-react/types'
6
+ import { resourceReferenceDisplaySummary } from '@ltht-react/utils'
7
+
8
+ const StyledInvolvedTeamTitle = styled.div`
9
+ color: ${TEXT_COLOURS.PRIMARY};
10
+ text-align: left;
11
+ `
12
+
13
+ const InvolvedTeamTitle: FC<Props> = ({ episodeOfCare, ...rest }) => (
14
+ <StyledInvolvedTeamTitle {...rest}>
15
+ {episodeOfCare.team && resourceReferenceDisplaySummary(episodeOfCare.team)}
16
+ </StyledInvolvedTeamTitle>
17
+ )
18
+
19
+ interface Props extends HTMLAttributes<HTMLDivElement> {
20
+ episodeOfCare: EpisodeOfCare
21
+ }
22
+
23
+ export default InvolvedTeamTitle
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes, FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { EpisodeOfCare } from '@ltht-react/types'
6
+ import { titleCase } from '@ltht-react/utils'
7
+
8
+ const StyledInvolvedTeamType = styled.div`
9
+ color: ${TEXT_COLOURS.SECONDARY.VALUE};
10
+ text-align: right;
11
+ font-size: smaller;
12
+ padding-top: 0.25rem;
13
+ `
14
+
15
+ const InvolvedTeamType: FC<Props> = ({ episodeOfCare, ...rest }) => (
16
+ <StyledInvolvedTeamType {...rest}>{titleCase(episodeOfCare.status)}</StyledInvolvedTeamType>
17
+ )
18
+
19
+ interface Props extends HTMLAttributes<HTMLDivElement> {
20
+ episodeOfCare: EpisodeOfCare
21
+ }
22
+
23
+ export default InvolvedTeamType
package/src/index.tsx ADDED
@@ -0,0 +1,3 @@
1
+ import InvolvedTeamSummary from './organisms/involved-team-summary'
2
+
3
+ export default InvolvedTeamSummary
@@ -0,0 +1,33 @@
1
+ import { HTMLAttributes, FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { EpisodeOfCare } from '@ltht-react/types'
5
+ import { RedactedDescription, PeriodSummary } from '@ltht-react/type-summary'
6
+
7
+ const StyledRedacted = styled.div`
8
+ display: flex;
9
+ `
10
+ const StyledDescription = styled.div`
11
+ flex: 1;
12
+ `
13
+ const StyledDate = styled.div`
14
+ flex: 1;
15
+ text-align: right;
16
+ `
17
+
18
+ const InvolvedTeamRedacted: FC<Props> = ({ episodeOfCare, ...rest }) => (
19
+ <StyledRedacted {...rest}>
20
+ <StyledDescription>
21
+ <RedactedDescription />
22
+ </StyledDescription>
23
+ <StyledDate>
24
+ <PeriodSummary period={episodeOfCare.period} />
25
+ </StyledDate>
26
+ </StyledRedacted>
27
+ )
28
+
29
+ interface Props extends HTMLAttributes<HTMLDivElement> {
30
+ episodeOfCare: EpisodeOfCare
31
+ }
32
+
33
+ export default InvolvedTeamRedacted
@@ -0,0 +1,46 @@
1
+ import { FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { EpisodeOfCare } from '@ltht-react/types'
5
+ import { PeriodSummary } from '@ltht-react/type-summary'
6
+
7
+ import Description from '../atoms/involved-team-description'
8
+ import Type from '../atoms/involved-team-type'
9
+ import Title from '../atoms/involved-team-title'
10
+ import Redacted from '../molecules/involved-team-redacted'
11
+
12
+ const StyledSummary = styled.div`
13
+ display: flex;
14
+ `
15
+ const StyledDescription = styled.div`
16
+ flex: 1;
17
+ `
18
+ const StyledDate = styled.div`
19
+ flex: 1;
20
+ text-align: right;
21
+ `
22
+
23
+ const InvolvedTeamSummary: FC<Props> = ({ episodeOfCare }) => {
24
+ if (episodeOfCare.metadata.isRedacted) {
25
+ return <Redacted episodeOfCare={episodeOfCare} />
26
+ }
27
+
28
+ return (
29
+ <StyledSummary>
30
+ <StyledDescription>
31
+ <Title episodeOfCare={episodeOfCare} />
32
+ <Description episodeOfCare={episodeOfCare} />
33
+ </StyledDescription>
34
+ <StyledDate>
35
+ <PeriodSummary period={episodeOfCare.period} />
36
+ <Type episodeOfCare={episodeOfCare} />
37
+ </StyledDate>
38
+ </StyledSummary>
39
+ )
40
+ }
41
+
42
+ interface Props {
43
+ episodeOfCare: EpisodeOfCare
44
+ }
45
+
46
+ export default InvolvedTeamSummary