@ltht-react/community-treatment-order-summary 2.0.13 → 2.0.15
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/README.md +27 -27
- package/package.json +7 -7
- package/src/atoms/community-treatment-order-summary-consent.tsx +24 -24
- package/src/atoms/community-treatment-order-summary-restrictions.tsx +24 -24
- package/src/atoms/community-treatment-order-summary-status.tsx +22 -22
- package/src/index.tsx +3 -3
- package/src/molecules/community-treatment-order-redacted.tsx +31 -31
- package/src/organisms/community-treatment-order-summary.tsx +50 -50
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# Community Treatment Order Summary
|
|
2
|
-
|
|
3
|
-
<!-- STORY -->
|
|
4
|
-
|
|
5
|
-
### Import
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import CommunityTreatmentOrderSummary from '@ltht-react/community-treatment-order-summary'
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Usage
|
|
12
|
-
|
|
13
|
-
```jsx
|
|
14
|
-
<CommunityTreatmentOrderSummary
|
|
15
|
-
title="Community Treatment Orders"
|
|
16
|
-
communityTreatmentOrders={communityTreatmentOrders}
|
|
17
|
-
clickHandler={handleClick}
|
|
18
|
-
/>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Properties
|
|
22
|
-
|
|
23
|
-
| Prop | Required | Default | Type | Description |
|
|
24
|
-
| :------------------------- | :------- | :------------------------- | :----------------------------- | :-------------------------------------------------- |
|
|
25
|
-
| `title` | No | Community Treatment Orders | string | Header text |
|
|
26
|
-
| `communityTreatmentOrders` | Yes | | LypftCommunityTreatmentOrder[] | Array of community treatment orders to display |
|
|
27
|
-
| `clickHandler` | No | undefined | Function | Callback click handler containing the selected item |
|
|
1
|
+
# Community Treatment Order Summary
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
### Import
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import CommunityTreatmentOrderSummary from '@ltht-react/community-treatment-order-summary'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<CommunityTreatmentOrderSummary
|
|
15
|
+
title="Community Treatment Orders"
|
|
16
|
+
communityTreatmentOrders={communityTreatmentOrders}
|
|
17
|
+
clickHandler={handleClick}
|
|
18
|
+
/>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Properties
|
|
22
|
+
|
|
23
|
+
| Prop | Required | Default | Type | Description |
|
|
24
|
+
| :------------------------- | :------- | :------------------------- | :----------------------------- | :-------------------------------------------------- |
|
|
25
|
+
| `title` | No | Community Treatment Orders | string | Header text |
|
|
26
|
+
| `communityTreatmentOrders` | Yes | | LypftCommunityTreatmentOrder[] | Array of community treatment orders to display |
|
|
27
|
+
| `clickHandler` | No | undefined | Function | Callback click handler containing the selected item |
|
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.15",
|
|
4
4
|
"description": "ltht-react clinical CommunityTreatmentOrderSummary component.",
|
|
5
5
|
"author": "LTHT",
|
|
6
6
|
"homepage": "",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@emotion/react": "^11.0.0",
|
|
26
26
|
"@emotion/styled": "^11.0.0",
|
|
27
|
-
"@ltht-react/list": "^2.0.
|
|
28
|
-
"@ltht-react/styles": "^2.0.
|
|
29
|
-
"@ltht-react/type-summary": "^2.0.
|
|
30
|
-
"@ltht-react/types": "^2.0.
|
|
31
|
-
"@ltht-react/utils": "^2.0.
|
|
27
|
+
"@ltht-react/list": "^2.0.15",
|
|
28
|
+
"@ltht-react/styles": "^2.0.15",
|
|
29
|
+
"@ltht-react/type-summary": "^2.0.15",
|
|
30
|
+
"@ltht-react/types": "^2.0.15",
|
|
31
|
+
"@ltht-react/utils": "^2.0.15",
|
|
32
32
|
"react": "^18.2.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "bf4e3bced3025e07519c7cf664175f0d125fafd7"
|
|
35
35
|
}
|
|
@@ -1,24 +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
|
|
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
|
|
@@ -1,24 +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
|
|
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
|
|
@@ -1,22 +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
|
|
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
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CommunityTreatmentOrderSummary from './organisms/community-treatment-order-summary'
|
|
2
|
-
|
|
3
|
-
export default CommunityTreatmentOrderSummary
|
|
1
|
+
import CommunityTreatmentOrderSummary from './organisms/community-treatment-order-summary'
|
|
2
|
+
|
|
3
|
+
export default CommunityTreatmentOrderSummary
|
|
@@ -1,31 +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
|
|
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
|
|
@@ -1,50 +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
|
|
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
|