@ltht-react/flag-detail 2.0.138 → 2.0.139

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 (3) hide show
  1. package/README.md +15 -15
  2. package/package.json +7 -7
  3. package/src/index.tsx +86 -86
package/README.md CHANGED
@@ -1,15 +1,15 @@
1
- # FlagDetail
2
-
3
- <!-- STORY -->
4
-
5
- ### Import
6
-
7
- ```js
8
- import FlagDetail from '@ltht-react/flag-detail'
9
- ```
10
-
11
- ### Usage
12
-
13
- ```jsx
14
- <FlagDetail />
15
- ```
1
+ # FlagDetail
2
+
3
+ <!-- STORY -->
4
+
5
+ ### Import
6
+
7
+ ```js
8
+ import FlagDetail from '@ltht-react/flag-detail'
9
+ ```
10
+
11
+ ### Usage
12
+
13
+ ```jsx
14
+ <FlagDetail />
15
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/flag-detail",
3
- "version": "2.0.138",
3
+ "version": "2.0.139",
4
4
  "description": "ltht-react clinical FlagDetail component.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -28,12 +28,12 @@
28
28
  "dependencies": {
29
29
  "@emotion/react": "^11.0.0",
30
30
  "@emotion/styled": "^11.0.0",
31
- "@ltht-react/button": "^2.0.138",
32
- "@ltht-react/styles": "^2.0.138",
33
- "@ltht-react/type-detail": "^2.0.138",
34
- "@ltht-react/types": "^2.0.138",
35
- "@ltht-react/utils": "^2.0.138",
31
+ "@ltht-react/button": "^2.0.139",
32
+ "@ltht-react/styles": "^2.0.139",
33
+ "@ltht-react/type-detail": "^2.0.139",
34
+ "@ltht-react/types": "^2.0.139",
35
+ "@ltht-react/utils": "^2.0.139",
36
36
  "react": "^18.2.0"
37
37
  },
38
- "gitHead": "5dc9de48844854943aa1f6392d640c213a43c850"
38
+ "gitHead": "125c4d49af461809ebc1a2080afdc8865c86b8cb"
39
39
  }
package/src/index.tsx CHANGED
@@ -1,86 +1,86 @@
1
- import { FC } from 'react'
2
- import styled from '@emotion/styled'
3
- import { DetailViewType, Flag } from '@ltht-react/types'
4
- import { codeableConceptCodeSummary, getStringExtension } from '@ltht-react/utils'
5
- import { Button, ButtonProps } from '@ltht-react/button'
6
- import { MOBILE_MAXIMUM_MEDIA_QUERY, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY } from '@ltht-react/styles'
7
-
8
- import {
9
- CodeableConceptDetail,
10
- StringDetail,
11
- PeriodDetail,
12
- NarrativeDetail,
13
- ResourceReferenceDetail,
14
- CollapsibleDetailCollectionProps,
15
- CollapsibleDetailCollection,
16
- } from '@ltht-react/type-detail'
17
-
18
- const StyledControlsContainer = styled.div`
19
- display: flex;
20
- margin: auto 10px auto 10px;
21
- flex-direction: column;
22
-
23
- ${MOBILE_MAXIMUM_MEDIA_QUERY} {
24
- margin: 10px 0 0 0;
25
- flex-flow: row wrap;
26
- }
27
-
28
- ${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
29
- margin: 10px 5px 0 0;
30
- flex-direction: column;
31
- }
32
- `
33
- const StyledButton = styled(Button)`
34
- margin: 2px 0 2px 0;
35
- font-size: 0.8em !important;
36
- padding: 1px 5px;
37
-
38
- ${MOBILE_MAXIMUM_MEDIA_QUERY} {
39
- margin: 2px 5px 2px 0;
40
- width: fit-content;
41
- }
42
-
43
- ${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
44
- margin: 2px 0 2px 0;
45
- width: 100%;
46
- max-width: 200px;
47
- }
48
- `
49
-
50
- const FlagDetail: FC<Props> = ({ flag, controls = [], viewType = DetailViewType.Compact }) => {
51
- let buttons = <></>
52
- if (controls.length) {
53
- buttons = (
54
- <StyledControlsContainer>
55
- {controls.map((props, index) => (
56
- <StyledButton key={index} {...props} />
57
- ))}
58
- </StyledControlsContainer>
59
- )
60
- }
61
-
62
- return (
63
- <CollapsibleDetailCollection viewType={viewType}>
64
- <StringDetail term="Code" description={codeableConceptCodeSummary(flag?.code)} />
65
- <CodeableConceptDetail term="Name" concept={flag?.code} />
66
- <StringDetail term="Status" description={flag.status.toString()} />
67
- <CodeableConceptDetail term="Category" concept={flag?.category} />
68
- <PeriodDetail period={flag?.period} />
69
- <NarrativeDetail term="Description" narrative={flag?.text} />
70
- <StringDetail
71
- term="Advice"
72
- description={getStringExtension(flag?.extension, 'https://leedsth.nhs.uk/alert/advice')}
73
- parse={false}
74
- />
75
- {buttons}
76
- <ResourceReferenceDetail term="Author" resourceReference={flag?.author} />
77
- </CollapsibleDetailCollection>
78
- )
79
- }
80
-
81
- interface Props extends CollapsibleDetailCollectionProps {
82
- flag: Flag
83
- controls?: ButtonProps[]
84
- }
85
-
86
- export default FlagDetail
1
+ import { FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+ import { DetailViewType, Flag } from '@ltht-react/types'
4
+ import { codeableConceptCodeSummary, getStringExtension } from '@ltht-react/utils'
5
+ import { Button, ButtonProps } from '@ltht-react/button'
6
+ import { MOBILE_MAXIMUM_MEDIA_QUERY, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY } from '@ltht-react/styles'
7
+
8
+ import {
9
+ CodeableConceptDetail,
10
+ StringDetail,
11
+ PeriodDetail,
12
+ NarrativeDetail,
13
+ ResourceReferenceDetail,
14
+ CollapsibleDetailCollectionProps,
15
+ CollapsibleDetailCollection,
16
+ } from '@ltht-react/type-detail'
17
+
18
+ const StyledControlsContainer = styled.div`
19
+ display: flex;
20
+ margin: auto 10px auto 10px;
21
+ flex-direction: column;
22
+
23
+ ${MOBILE_MAXIMUM_MEDIA_QUERY} {
24
+ margin: 10px 0 0 0;
25
+ flex-flow: row wrap;
26
+ }
27
+
28
+ ${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
29
+ margin: 10px 5px 0 0;
30
+ flex-direction: column;
31
+ }
32
+ `
33
+ const StyledButton = styled(Button)`
34
+ margin: 2px 0 2px 0;
35
+ font-size: 0.8em !important;
36
+ padding: 1px 5px;
37
+
38
+ ${MOBILE_MAXIMUM_MEDIA_QUERY} {
39
+ margin: 2px 5px 2px 0;
40
+ width: fit-content;
41
+ }
42
+
43
+ ${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
44
+ margin: 2px 0 2px 0;
45
+ width: 100%;
46
+ max-width: 200px;
47
+ }
48
+ `
49
+
50
+ const FlagDetail: FC<Props> = ({ flag, controls = [], viewType = DetailViewType.Compact }) => {
51
+ let buttons = <></>
52
+ if (controls.length) {
53
+ buttons = (
54
+ <StyledControlsContainer>
55
+ {controls.map((props, index) => (
56
+ <StyledButton key={index} {...props} />
57
+ ))}
58
+ </StyledControlsContainer>
59
+ )
60
+ }
61
+
62
+ return (
63
+ <CollapsibleDetailCollection viewType={viewType}>
64
+ <StringDetail term="Code" description={codeableConceptCodeSummary(flag?.code)} />
65
+ <CodeableConceptDetail term="Name" concept={flag?.code} />
66
+ <StringDetail term="Status" description={flag.status.toString()} />
67
+ <CodeableConceptDetail term="Category" concept={flag?.category} />
68
+ <PeriodDetail period={flag?.period} />
69
+ <NarrativeDetail term="Description" narrative={flag?.text} />
70
+ <StringDetail
71
+ term="Advice"
72
+ description={getStringExtension(flag?.extension, 'https://leedsth.nhs.uk/alert/advice')}
73
+ parse={false}
74
+ />
75
+ {buttons}
76
+ <ResourceReferenceDetail term="Author" resourceReference={flag?.author} />
77
+ </CollapsibleDetailCollection>
78
+ )
79
+ }
80
+
81
+ interface Props extends CollapsibleDetailCollectionProps {
82
+ flag: Flag
83
+ controls?: ButtonProps[]
84
+ }
85
+
86
+ export default FlagDetail