@ltht-react/timeline 2.0.62 → 2.0.64

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 (50) hide show
  1. package/README.md +19 -19
  2. package/lib/atoms/time-element.d.ts +11 -0
  3. package/lib/atoms/time-element.js +50 -0
  4. package/lib/atoms/time-element.js.map +1 -0
  5. package/lib/atoms/timeline-author.d.ts +8 -0
  6. package/lib/atoms/timeline-author.js +88 -0
  7. package/lib/atoms/timeline-author.js.map +1 -0
  8. package/lib/atoms/timeline-button.d.ts +7 -0
  9. package/lib/atoms/timeline-button.js +26 -0
  10. package/lib/atoms/timeline-button.js.map +1 -0
  11. package/lib/atoms/timeline-description.d.ts +8 -0
  12. package/lib/atoms/timeline-description.js +67 -0
  13. package/lib/atoms/timeline-description.js.map +1 -0
  14. package/lib/atoms/timeline-time.d.ts +11 -0
  15. package/lib/atoms/timeline-time.js +66 -0
  16. package/lib/atoms/timeline-time.js.map +1 -0
  17. package/lib/atoms/timeline-title-redacted.d.ts +3 -0
  18. package/lib/atoms/timeline-title-redacted.js +28 -0
  19. package/lib/atoms/timeline-title-redacted.js.map +1 -0
  20. package/lib/atoms/timeline-title.d.ts +8 -0
  21. package/lib/atoms/timeline-title.js +55 -0
  22. package/lib/atoms/timeline-title.js.map +1 -0
  23. package/lib/constants.d.ts +2 -0
  24. package/lib/constants.js +5 -0
  25. package/lib/constants.js.map +1 -0
  26. package/lib/index.d.ts +5 -0
  27. package/lib/index.js +11 -0
  28. package/lib/index.js.map +1 -0
  29. package/lib/molecules/timeline-item-redacted.d.ts +3 -0
  30. package/lib/molecules/timeline-item-redacted.js +32 -0
  31. package/lib/molecules/timeline-item-redacted.js.map +1 -0
  32. package/lib/molecules/timeline-item.d.ts +16 -0
  33. package/lib/molecules/timeline-item.js +49 -0
  34. package/lib/molecules/timeline-item.js.map +1 -0
  35. package/lib/organisms/timeline.d.ts +19 -0
  36. package/lib/organisms/timeline.js +207 -0
  37. package/lib/organisms/timeline.js.map +1 -0
  38. package/package.json +10 -10
  39. package/src/atoms/time-element.tsx +52 -52
  40. package/src/atoms/timeline-author.tsx +88 -88
  41. package/src/atoms/timeline-button.tsx +44 -44
  42. package/src/atoms/timeline-description.tsx +52 -52
  43. package/src/atoms/timeline-time.tsx +69 -69
  44. package/src/atoms/timeline-title-redacted.tsx +13 -13
  45. package/src/atoms/timeline-title.tsx +41 -41
  46. package/src/constants.ts +3 -3
  47. package/src/index.tsx +6 -6
  48. package/src/molecules/timeline-item-redacted.tsx +47 -47
  49. package/src/molecules/timeline-item.tsx +130 -130
  50. package/src/organisms/timeline.tsx +419 -419
@@ -1,47 +1,47 @@
1
- import { FC } from 'react'
2
- import styled from '@emotion/styled'
3
- import { HIGHLIGHT_GREEN, TRANSLUCENT_DARK_BLUE } from '@ltht-react/styles'
4
- import { useWindowSize } from '@ltht-react/hooks'
5
- import { isMobileView } from '@ltht-react/utils'
6
- import TimelineTitleRedacted from '../atoms/timeline-title-redacted'
7
-
8
- const StyledTimelineItem = styled.div<IStyledTimelineItem>`
9
- background-color: ${({ isSelected }) => (isSelected ? HIGHLIGHT_GREEN.VALUE : TRANSLUCENT_DARK_BLUE)};
10
- padding: 0.5rem;
11
- `
12
- const StyledTimelineItemTop = styled.div`
13
- display: flex;
14
- color: black;
15
- padding-bottom: 0.25rem;
16
- `
17
- const StyledTitle = styled.div<IStyledMobile>`
18
- flex-grow: 1;
19
- color: black;
20
- font-size: ${({ isMobile }) => (isMobile ? 'medium' : 'large')};
21
- font-weight: bold;
22
- `
23
-
24
- const TimelineItemRedacted: FC = () => {
25
- const { width } = useWindowSize()
26
- const isMobile = isMobileView(width)
27
-
28
- return (
29
- <StyledTimelineItem isSelected={false}>
30
- <StyledTimelineItemTop>
31
- <StyledTitle isMobile={isMobile}>
32
- <TimelineTitleRedacted />
33
- </StyledTitle>
34
- </StyledTimelineItemTop>
35
- </StyledTimelineItem>
36
- )
37
- }
38
-
39
- interface IStyledTimelineItem {
40
- isSelected: boolean
41
- }
42
-
43
- interface IStyledMobile {
44
- isMobile: boolean
45
- }
46
-
47
- export default TimelineItemRedacted
1
+ import { FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+ import { HIGHLIGHT_GREEN, TRANSLUCENT_DARK_BLUE } from '@ltht-react/styles'
4
+ import { useWindowSize } from '@ltht-react/hooks'
5
+ import { isMobileView } from '@ltht-react/utils'
6
+ import TimelineTitleRedacted from '../atoms/timeline-title-redacted'
7
+
8
+ const StyledTimelineItem = styled.div<IStyledTimelineItem>`
9
+ background-color: ${({ isSelected }) => (isSelected ? HIGHLIGHT_GREEN.VALUE : TRANSLUCENT_DARK_BLUE)};
10
+ padding: 0.5rem;
11
+ `
12
+ const StyledTimelineItemTop = styled.div`
13
+ display: flex;
14
+ color: black;
15
+ padding-bottom: 0.25rem;
16
+ `
17
+ const StyledTitle = styled.div<IStyledMobile>`
18
+ flex-grow: 1;
19
+ color: black;
20
+ font-size: ${({ isMobile }) => (isMobile ? 'medium' : 'large')};
21
+ font-weight: bold;
22
+ `
23
+
24
+ const TimelineItemRedacted: FC = () => {
25
+ const { width } = useWindowSize()
26
+ const isMobile = isMobileView(width)
27
+
28
+ return (
29
+ <StyledTimelineItem isSelected={false}>
30
+ <StyledTimelineItemTop>
31
+ <StyledTitle isMobile={isMobile}>
32
+ <TimelineTitleRedacted />
33
+ </StyledTitle>
34
+ </StyledTimelineItemTop>
35
+ </StyledTimelineItem>
36
+ )
37
+ }
38
+
39
+ interface IStyledTimelineItem {
40
+ isSelected: boolean
41
+ }
42
+
43
+ interface IStyledMobile {
44
+ isMobile: boolean
45
+ }
46
+
47
+ export default TimelineItemRedacted
@@ -1,130 +1,130 @@
1
- import { FC } from 'react'
2
- import styled from '@emotion/styled'
3
- import { HIGHLIGHT_GREEN, TRANSLUCENT_DARK_BLUE } from '@ltht-react/styles'
4
- import {
5
- AuditEvent,
6
- DocumentReference,
7
- Maybe,
8
- QuestionnaireResponse,
9
- TimelineDomainResourceType,
10
- } from '@ltht-react/types'
11
- import { useWindowSize } from '@ltht-react/hooks'
12
- import { isMobileView } from '@ltht-react/utils'
13
- import TimelineDescription from '../atoms/timeline-description'
14
- import TimelineAuthor from '../atoms/timeline-author'
15
- import TimelineTitle from '../atoms/timeline-title'
16
- import TimelineTime from '../atoms/timeline-time'
17
- import TimelineButton from '../atoms/timeline-button'
18
-
19
- const StyledTimelineItem = styled.div<IStyledTimelineItem>`
20
- background-color: ${({ isSelected }) => (isSelected ? HIGHLIGHT_GREEN.VALUE : TRANSLUCENT_DARK_BLUE)};
21
- padding-top: 0.5rem;
22
- `
23
-
24
- const StyledTimelineAuthor = styled(TimelineAuthor)`
25
- flex-grow: 1;
26
- margin-bottom: 0.5rem;
27
- `
28
-
29
- const StyledTimelineTime = styled(TimelineTime)`
30
- color: black;
31
- `
32
-
33
- const StyledTimelineItemTop = styled.div`
34
- display: flex;
35
- color: black;
36
- padding-bottom: 0.25rem;
37
- margin: 0.5rem;
38
- `
39
-
40
- const StyledTimelineItemMiddle = styled.div`
41
- color: black;
42
- padding-bottom: 1rem;
43
- margin: 0.5rem;
44
- `
45
-
46
- const StyledTimelineItemBottom = styled.div`
47
- color: grey;
48
- display: flex;
49
- margin: 0.5rem;
50
- `
51
-
52
- const StyledTimelineTitle = styled(TimelineTitle, {
53
- shouldForwardProp: (prop) => prop !== 'isMobile',
54
- })<IStyledMobile>`
55
- flex-grow: 1;
56
- color: black;
57
- font-size: ${({ isMobile }) => (isMobile ? 'medium' : 'large')};
58
- font-weight: bold;
59
- `
60
-
61
- const StyledTimelineDescription = styled(TimelineDescription)`
62
- color: black;
63
- font-size: small;
64
- `
65
-
66
- const TimelineItem: FC<IProps> = ({ timelineItem, domainResourceType }) => {
67
- const { width } = useWindowSize()
68
- const isMobile = isMobileView(width)
69
-
70
- if (!timelineItem?.domainResource) {
71
- return <></>
72
- }
73
-
74
- const { domainResource, buttonState } = timelineItem
75
-
76
- const itemKey = `timelineItem_${domainResource.id}`
77
-
78
- return (
79
- <StyledTimelineItem isSelected={buttonState === 'selected-button'} key={itemKey}>
80
- <StyledTimelineItemTop>
81
- <StyledTimelineTitle
82
- isMobile={isMobile}
83
- domainResource={domainResource}
84
- domainResourceType={domainResourceType}
85
- />
86
- {isMobile && (
87
- <StyledTimelineTime domainResource={timelineItem.domainResource} domainResourceType={domainResourceType} />
88
- )}
89
- </StyledTimelineItemTop>
90
-
91
- <StyledTimelineItemMiddle>
92
- <StyledTimelineDescription
93
- domainResource={timelineItem.domainResource}
94
- domainResourceType={domainResourceType}
95
- />
96
- </StyledTimelineItemMiddle>
97
-
98
- <StyledTimelineItemBottom>
99
- <StyledTimelineAuthor domainResource={timelineItem.domainResource} domainResourceType={domainResourceType} />
100
- </StyledTimelineItemBottom>
101
-
102
- <TimelineButton timelineItem={timelineItem} />
103
- </StyledTimelineItem>
104
- )
105
- }
106
-
107
- interface IProps {
108
- timelineItem: Maybe<ITimelineItem>
109
- domainResourceType: TimelineDomainResourceType
110
- }
111
-
112
- export interface ITimelineItem {
113
- domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>
114
- buttonState: TimeLineItemButtonState
115
- itemClickHandler?(): void
116
- pointInTimeClickHandler?: (date: Date) => void
117
- buttonText?: string
118
- }
119
-
120
- type TimeLineItemButtonState = 'no-button' | 'selectable-button' | 'selected-button' | 'permission-denied-button'
121
-
122
- interface IStyledTimelineItem {
123
- isSelected: boolean
124
- }
125
-
126
- interface IStyledMobile {
127
- isMobile: boolean
128
- }
129
-
130
- export default TimelineItem
1
+ import { FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+ import { HIGHLIGHT_GREEN, TRANSLUCENT_DARK_BLUE } from '@ltht-react/styles'
4
+ import {
5
+ AuditEvent,
6
+ DocumentReference,
7
+ Maybe,
8
+ QuestionnaireResponse,
9
+ TimelineDomainResourceType,
10
+ } from '@ltht-react/types'
11
+ import { useWindowSize } from '@ltht-react/hooks'
12
+ import { isMobileView } from '@ltht-react/utils'
13
+ import TimelineDescription from '../atoms/timeline-description'
14
+ import TimelineAuthor from '../atoms/timeline-author'
15
+ import TimelineTitle from '../atoms/timeline-title'
16
+ import TimelineTime from '../atoms/timeline-time'
17
+ import TimelineButton from '../atoms/timeline-button'
18
+
19
+ const StyledTimelineItem = styled.div<IStyledTimelineItem>`
20
+ background-color: ${({ isSelected }) => (isSelected ? HIGHLIGHT_GREEN.VALUE : TRANSLUCENT_DARK_BLUE)};
21
+ padding-top: 0.5rem;
22
+ `
23
+
24
+ const StyledTimelineAuthor = styled(TimelineAuthor)`
25
+ flex-grow: 1;
26
+ margin-bottom: 0.5rem;
27
+ `
28
+
29
+ const StyledTimelineTime = styled(TimelineTime)`
30
+ color: black;
31
+ `
32
+
33
+ const StyledTimelineItemTop = styled.div`
34
+ display: flex;
35
+ color: black;
36
+ padding-bottom: 0.25rem;
37
+ margin: 0.5rem;
38
+ `
39
+
40
+ const StyledTimelineItemMiddle = styled.div`
41
+ color: black;
42
+ padding-bottom: 1rem;
43
+ margin: 0.5rem;
44
+ `
45
+
46
+ const StyledTimelineItemBottom = styled.div`
47
+ color: grey;
48
+ display: flex;
49
+ margin: 0.5rem;
50
+ `
51
+
52
+ const StyledTimelineTitle = styled(TimelineTitle, {
53
+ shouldForwardProp: (prop) => prop !== 'isMobile',
54
+ })<IStyledMobile>`
55
+ flex-grow: 1;
56
+ color: black;
57
+ font-size: ${({ isMobile }) => (isMobile ? 'medium' : 'large')};
58
+ font-weight: bold;
59
+ `
60
+
61
+ const StyledTimelineDescription = styled(TimelineDescription)`
62
+ color: black;
63
+ font-size: small;
64
+ `
65
+
66
+ const TimelineItem: FC<IProps> = ({ timelineItem, domainResourceType }) => {
67
+ const { width } = useWindowSize()
68
+ const isMobile = isMobileView(width)
69
+
70
+ if (!timelineItem?.domainResource) {
71
+ return <></>
72
+ }
73
+
74
+ const { domainResource, buttonState } = timelineItem
75
+
76
+ const itemKey = `timelineItem_${domainResource.id}`
77
+
78
+ return (
79
+ <StyledTimelineItem isSelected={buttonState === 'selected-button'} key={itemKey}>
80
+ <StyledTimelineItemTop>
81
+ <StyledTimelineTitle
82
+ isMobile={isMobile}
83
+ domainResource={domainResource}
84
+ domainResourceType={domainResourceType}
85
+ />
86
+ {isMobile && (
87
+ <StyledTimelineTime domainResource={timelineItem.domainResource} domainResourceType={domainResourceType} />
88
+ )}
89
+ </StyledTimelineItemTop>
90
+
91
+ <StyledTimelineItemMiddle>
92
+ <StyledTimelineDescription
93
+ domainResource={timelineItem.domainResource}
94
+ domainResourceType={domainResourceType}
95
+ />
96
+ </StyledTimelineItemMiddle>
97
+
98
+ <StyledTimelineItemBottom>
99
+ <StyledTimelineAuthor domainResource={timelineItem.domainResource} domainResourceType={domainResourceType} />
100
+ </StyledTimelineItemBottom>
101
+
102
+ <TimelineButton timelineItem={timelineItem} />
103
+ </StyledTimelineItem>
104
+ )
105
+ }
106
+
107
+ interface IProps {
108
+ timelineItem: Maybe<ITimelineItem>
109
+ domainResourceType: TimelineDomainResourceType
110
+ }
111
+
112
+ export interface ITimelineItem {
113
+ domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>
114
+ buttonState: TimeLineItemButtonState
115
+ itemClickHandler?(): void
116
+ pointInTimeClickHandler?: (date: Date) => void
117
+ buttonText?: string
118
+ }
119
+
120
+ type TimeLineItemButtonState = 'no-button' | 'selectable-button' | 'selected-button' | 'permission-denied-button'
121
+
122
+ interface IStyledTimelineItem {
123
+ isSelected: boolean
124
+ }
125
+
126
+ interface IStyledMobile {
127
+ isMobile: boolean
128
+ }
129
+
130
+ export default TimelineItem