@ltht-react/community-treatment-order-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 +9 -8
- package/src/atoms/community-treatment-order-summary-consent.tsx +24 -0
- package/src/atoms/community-treatment-order-summary-restrictions.tsx +24 -0
- package/src/atoms/community-treatment-order-summary-status.tsx +22 -0
- package/src/index.tsx +3 -0
- package/src/molecules/community-treatment-order-redacted.tsx +31 -0
- package/src/organisms/community-treatment-order-summary.tsx +50 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/community-treatment-order-summary",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "ltht-react clinical CommunityTreatmentOrderSummary 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.
|
|
27
|
-
"@ltht-react/styles": "^2.0.
|
|
28
|
-
"@ltht-react/type-summary": "^2.0.
|
|
29
|
-
"@ltht-react/types": "^2.0.
|
|
30
|
-
"@ltht-react/utils": "^2.0.
|
|
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": "
|
|
34
|
+
"gitHead": "b8fe243323a0f1b9ab345475db38c73fd3b35312"
|
|
34
35
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
|
+
import { LypftCommunityTreatmentOrder } from '@ltht-react/types'
|
|
6
|
+
|
|
7
|
+
const StyledCommunityTreatmentOrderSummaryConsent = styled.div`
|
|
8
|
+
color: ${TEXT_COLOURS.SECONDARY.VALUE};
|
|
9
|
+
text-align: right;
|
|
10
|
+
font-size: smaller;
|
|
11
|
+
padding-top: 0.25rem;
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
const CommunityTreatmentOrderSummaryConsent: FC<Props> = ({ communityTreatmentOrder, ...rest }) => (
|
|
15
|
+
<StyledCommunityTreatmentOrderSummaryConsent {...rest}>
|
|
16
|
+
{communityTreatmentOrder.consentToTreat && communityTreatmentOrder.consentToTreat}
|
|
17
|
+
</StyledCommunityTreatmentOrderSummaryConsent>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
communityTreatmentOrder: LypftCommunityTreatmentOrder
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default CommunityTreatmentOrderSummaryConsent
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
|
+
import { LypftCommunityTreatmentOrder } from '@ltht-react/types'
|
|
6
|
+
|
|
7
|
+
const StyledCommunityTreatmentOrderSummaryRestrictions = 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 CommunityTreatmentOrderSummaryRestrictions: FC<Props> = ({ communityTreatmentOrder, ...rest }) => (
|
|
15
|
+
<StyledCommunityTreatmentOrderSummaryRestrictions {...rest}>
|
|
16
|
+
{communityTreatmentOrder.restrictions && communityTreatmentOrder.restrictions}
|
|
17
|
+
</StyledCommunityTreatmentOrderSummaryRestrictions>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
communityTreatmentOrder: LypftCommunityTreatmentOrder
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default CommunityTreatmentOrderSummaryRestrictions
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
|
+
import { LypftCommunityTreatmentOrder } from '@ltht-react/types'
|
|
6
|
+
|
|
7
|
+
const StyledCommunityTreatmentOrderConsent = styled.div`
|
|
8
|
+
color: ${TEXT_COLOURS.PRIMARY};
|
|
9
|
+
text-align: left;
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
const CommunityTreatmentOrderConsent: FC<Props> = ({ communityTreatmentOrder, ...rest }) => (
|
|
13
|
+
<StyledCommunityTreatmentOrderConsent {...rest}>
|
|
14
|
+
{communityTreatmentOrder.legalStatus && communityTreatmentOrder.legalStatus.text}
|
|
15
|
+
</StyledCommunityTreatmentOrderConsent>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
communityTreatmentOrder: LypftCommunityTreatmentOrder
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default CommunityTreatmentOrderConsent
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FC } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { LypftCommunityTreatmentOrder } from '@ltht-react/types'
|
|
5
|
+
import { RedactedDescription, PeriodSummary } from '@ltht-react/type-summary'
|
|
6
|
+
|
|
7
|
+
const StyledRedactedDescription = styled.div`
|
|
8
|
+
flex-grow: 1;
|
|
9
|
+
text-align: left;
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
const StyledPeriodSummary = styled.div`
|
|
13
|
+
text-align: right;
|
|
14
|
+
`
|
|
15
|
+
|
|
16
|
+
const CommunityTreatmentOrderRedacted: FC<Props> = ({ communityTreatmentOrder }) => (
|
|
17
|
+
<>
|
|
18
|
+
<StyledRedactedDescription>
|
|
19
|
+
<RedactedDescription />
|
|
20
|
+
</StyledRedactedDescription>
|
|
21
|
+
<StyledPeriodSummary>
|
|
22
|
+
<PeriodSummary period={communityTreatmentOrder.period} />
|
|
23
|
+
</StyledPeriodSummary>
|
|
24
|
+
</>
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
interface Props {
|
|
28
|
+
communityTreatmentOrder: LypftCommunityTreatmentOrder
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default CommunityTreatmentOrderRedacted
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { LypftCommunityTreatmentOrder } from '@ltht-react/types'
|
|
5
|
+
import { PeriodSummary } from '@ltht-react/type-summary'
|
|
6
|
+
|
|
7
|
+
import Consent from '../atoms/community-treatment-order-summary-consent'
|
|
8
|
+
import Restrictions from '../atoms/community-treatment-order-summary-restrictions'
|
|
9
|
+
import Status from '../atoms/community-treatment-order-summary-status'
|
|
10
|
+
import Redacted from '../molecules/community-treatment-order-redacted'
|
|
11
|
+
|
|
12
|
+
const StyledSummary = styled.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
`
|
|
16
|
+
const StyledDescription = styled.div`
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
`
|
|
19
|
+
const StyledDate = styled.div`
|
|
20
|
+
text-align: right;
|
|
21
|
+
`
|
|
22
|
+
|
|
23
|
+
const CommunityTreatmentOrderSummary: FC<Props> = ({ communityTreatmentOrder, ...rest }) => {
|
|
24
|
+
if (communityTreatmentOrder.metadata.isRedacted) {
|
|
25
|
+
return (
|
|
26
|
+
<StyledSummary {...rest}>
|
|
27
|
+
<Redacted communityTreatmentOrder={communityTreatmentOrder} />
|
|
28
|
+
</StyledSummary>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<StyledSummary {...rest}>
|
|
34
|
+
<StyledDescription>
|
|
35
|
+
<Status communityTreatmentOrder={communityTreatmentOrder} />
|
|
36
|
+
<Restrictions communityTreatmentOrder={communityTreatmentOrder} />
|
|
37
|
+
</StyledDescription>
|
|
38
|
+
<StyledDate>
|
|
39
|
+
<PeriodSummary period={communityTreatmentOrder.period} />
|
|
40
|
+
<Consent communityTreatmentOrder={communityTreatmentOrder} />
|
|
41
|
+
</StyledDate>
|
|
42
|
+
</StyledSummary>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
47
|
+
communityTreatmentOrder: LypftCommunityTreatmentOrder
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default CommunityTreatmentOrderSummary
|