@ltht-react/document-summary 2.0.192 → 2.0.194

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 CHANGED
@@ -1,22 +1,22 @@
1
- # DocumentSummary
2
-
3
- <!-- STORY -->
4
-
5
- ### Import
6
-
7
- ```js
8
- import DocumentSummary from '@ltht-react/document-summary'
9
- ```
10
-
11
- ### Usage
12
-
13
- ```jsx
14
- <DocumentSummary documents={documentReferences} />
15
- ```
16
-
17
- ### Properties
18
-
19
- | Prop | Required | Default | Type | Description |
20
- | :------------- | :------- | :------ | :---------------------------------------- | :----------------------------------------------------- |
21
- | `documents` | No | | DocumentReference[] | An array of document references |
22
- | `clickHandler` | No | | clickHandler(document: DocumentReference) | A click handler that will return the selected document |
1
+ # DocumentSummary
2
+
3
+ <!-- STORY -->
4
+
5
+ ### Import
6
+
7
+ ```js
8
+ import DocumentSummary from '@ltht-react/document-summary'
9
+ ```
10
+
11
+ ### Usage
12
+
13
+ ```jsx
14
+ <DocumentSummary documents={documentReferences} />
15
+ ```
16
+
17
+ ### Properties
18
+
19
+ | Prop | Required | Default | Type | Description |
20
+ | :------------- | :------- | :------ | :---------------------------------------- | :----------------------------------------------------- |
21
+ | `documents` | No | | DocumentReference[] | An array of document references |
22
+ | `clickHandler` | No | | clickHandler(document: DocumentReference) | A click handler that will return the selected document |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/document-summary",
3
- "version": "2.0.192",
3
+ "version": "2.0.194",
4
4
  "description": "ltht-react clinical DocumentSummary component.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -28,13 +28,13 @@
28
28
  "dependencies": {
29
29
  "@emotion/react": "^11.0.0",
30
30
  "@emotion/styled": "^11.0.0",
31
- "@ltht-react/icon": "^2.0.192",
32
- "@ltht-react/list": "^2.0.192",
33
- "@ltht-react/styles": "^2.0.192",
34
- "@ltht-react/type-summary": "^2.0.192",
35
- "@ltht-react/types": "^2.0.192",
36
- "@ltht-react/utils": "^2.0.192",
31
+ "@ltht-react/icon": "^2.0.194",
32
+ "@ltht-react/list": "^2.0.194",
33
+ "@ltht-react/styles": "^2.0.194",
34
+ "@ltht-react/type-summary": "^2.0.194",
35
+ "@ltht-react/types": "^2.0.194",
36
+ "@ltht-react/utils": "^2.0.194",
37
37
  "react": "^18.2.0"
38
38
  },
39
- "gitHead": "d97c241ba79c5e28edb4dec124e156cda6e9af66"
39
+ "gitHead": "2eb4b88fa2bc19baa1be9433dbe29fe1a947dc62"
40
40
  }
@@ -1,23 +1,23 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { DocumentReference } from '@ltht-react/types'
5
- import { formatDate } from '@ltht-react/utils'
6
-
7
- const StyledDocumentDate = styled.div``
8
-
9
- const DocumentDate: FC<Props> = ({ document: { created, description, indexed }, ...rest }) => {
10
- if (!description) return <></>
11
-
12
- const date = created?.value ? created?.value ?? '' : indexed.value ?? ''
13
-
14
- const formattedDate = formatDate(new Date(Date.parse(date)))
15
-
16
- return <StyledDocumentDate {...rest}>{formattedDate}</StyledDocumentDate>
17
- }
18
-
19
- interface Props extends HTMLAttributes<HTMLDivElement> {
20
- document: DocumentReference
21
- }
22
-
23
- export default DocumentDate
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { DocumentReference } from '@ltht-react/types'
5
+ import { formatDate } from '@ltht-react/utils'
6
+
7
+ const StyledDocumentDate = styled.div``
8
+
9
+ const DocumentDate: FC<Props> = ({ document: { created, description, indexed }, ...rest }) => {
10
+ if (!description) return <></>
11
+
12
+ const date = created?.value ? created?.value ?? '' : indexed.value ?? ''
13
+
14
+ const formattedDate = formatDate(new Date(Date.parse(date)))
15
+
16
+ return <StyledDocumentDate {...rest}>{formattedDate}</StyledDocumentDate>
17
+ }
18
+
19
+ interface Props extends HTMLAttributes<HTMLDivElement> {
20
+ document: DocumentReference
21
+ }
22
+
23
+ export default DocumentDate
@@ -1,18 +1,18 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { DocumentReference } from '@ltht-react/types'
5
-
6
- const StyledDocumentDescription = styled.div``
7
-
8
- const DocumentDescription: FC<Props> = ({ document: { description } }, ...rest) => {
9
- if (!description) return <></>
10
-
11
- return <StyledDocumentDescription {...rest}>{description}</StyledDocumentDescription>
12
- }
13
-
14
- interface Props extends HTMLAttributes<HTMLDivElement> {
15
- document: DocumentReference
16
- }
17
-
18
- export default DocumentDescription
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { DocumentReference } from '@ltht-react/types'
5
+
6
+ const StyledDocumentDescription = styled.div``
7
+
8
+ const DocumentDescription: FC<Props> = ({ document: { description } }, ...rest) => {
9
+ if (!description) return <></>
10
+
11
+ return <StyledDocumentDescription {...rest}>{description}</StyledDocumentDescription>
12
+ }
13
+
14
+ interface Props extends HTMLAttributes<HTMLDivElement> {
15
+ document: DocumentReference
16
+ }
17
+
18
+ export default DocumentDescription
@@ -1,21 +1,21 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { titleCase } from '@ltht-react/utils'
5
- import { DocumentReference } from '@ltht-react/types'
6
-
7
- const StyledDocumentSource = styled.div``
8
-
9
- const DocumentSource: FC<Props> = ({ document, ...rest }) => {
10
- const source = document.metadata?.dataSources ? document.metadata.dataSources[0]?.display : undefined
11
-
12
- if (!source) return <></>
13
-
14
- return <StyledDocumentSource {...rest}>{titleCase(source)}</StyledDocumentSource>
15
- }
16
-
17
- interface Props extends HTMLAttributes<HTMLDivElement> {
18
- document: DocumentReference
19
- }
20
-
21
- export default DocumentSource
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { titleCase } from '@ltht-react/utils'
5
+ import { DocumentReference } from '@ltht-react/types'
6
+
7
+ const StyledDocumentSource = styled.div``
8
+
9
+ const DocumentSource: FC<Props> = ({ document, ...rest }) => {
10
+ const source = document.metadata?.dataSources ? document.metadata.dataSources[0]?.display : undefined
11
+
12
+ if (!source) return <></>
13
+
14
+ return <StyledDocumentSource {...rest}>{titleCase(source)}</StyledDocumentSource>
15
+ }
16
+
17
+ interface Props extends HTMLAttributes<HTMLDivElement> {
18
+ document: DocumentReference
19
+ }
20
+
21
+ export default DocumentSource
@@ -1,23 +1,23 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { TEXT_COLOURS } from '@ltht-react/styles'
5
- import { titleCase } from '@ltht-react/utils'
6
- import { DocumentReference } from '@ltht-react/types'
7
-
8
- const StyledStatus = styled.div`
9
- font-size: smaller;
10
- color: ${TEXT_COLOURS.SECONDARY.VALUE};
11
- `
12
-
13
- const DocumentStatus: FC<Props> = ({ document: { status } }) => {
14
- if (!status) return <></>
15
-
16
- return <StyledStatus>{titleCase(status)}</StyledStatus>
17
- }
18
-
19
- interface Props extends HTMLAttributes<HTMLDivElement> {
20
- document: DocumentReference
21
- }
22
-
23
- export default DocumentStatus
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { titleCase } from '@ltht-react/utils'
6
+ import { DocumentReference } from '@ltht-react/types'
7
+
8
+ const StyledStatus = styled.div`
9
+ font-size: smaller;
10
+ color: ${TEXT_COLOURS.SECONDARY.VALUE};
11
+ `
12
+
13
+ const DocumentStatus: FC<Props> = ({ document: { status } }) => {
14
+ if (!status) return <></>
15
+
16
+ return <StyledStatus>{titleCase(status)}</StyledStatus>
17
+ }
18
+
19
+ interface Props extends HTMLAttributes<HTMLDivElement> {
20
+ document: DocumentReference
21
+ }
22
+
23
+ export default DocumentStatus
package/src/index.tsx CHANGED
@@ -1,3 +1,3 @@
1
- import DocumentSummary from './organisms/document-summary'
2
-
3
- export default DocumentSummary
1
+ import DocumentSummary from './organisms/document-summary'
2
+
3
+ export default DocumentSummary
@@ -1,32 +1,32 @@
1
- import { FC } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { DocumentReference } from '@ltht-react/types'
5
- import { RedactedDescription } from '@ltht-react/type-summary'
6
-
7
- import Date from '../atoms/document-date'
8
-
9
- const StyledDescription = styled.div`
10
- flex: 1;
11
- text-align: right;
12
- `
13
- const StyledDate = styled.div`
14
- flex: 1;
15
- `
16
-
17
- const DocumentRedacted: FC<Props> = ({ document }) => (
18
- <>
19
- <StyledDate>
20
- <Date document={document} />
21
- </StyledDate>
22
- <StyledDescription>
23
- <RedactedDescription />
24
- </StyledDescription>
25
- </>
26
- )
27
-
28
- interface Props {
29
- document: DocumentReference
30
- }
31
-
32
- export default DocumentRedacted
1
+ import { FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { DocumentReference } from '@ltht-react/types'
5
+ import { RedactedDescription } from '@ltht-react/type-summary'
6
+
7
+ import Date from '../atoms/document-date'
8
+
9
+ const StyledDescription = styled.div`
10
+ flex: 1;
11
+ text-align: right;
12
+ `
13
+ const StyledDate = styled.div`
14
+ flex: 1;
15
+ `
16
+
17
+ const DocumentRedacted: FC<Props> = ({ document }) => (
18
+ <>
19
+ <StyledDate>
20
+ <Date document={document} />
21
+ </StyledDate>
22
+ <StyledDescription>
23
+ <RedactedDescription />
24
+ </StyledDescription>
25
+ </>
26
+ )
27
+
28
+ interface Props {
29
+ document: DocumentReference
30
+ }
31
+
32
+ export default DocumentRedacted
@@ -1,61 +1,61 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { DocumentReference } from '@ltht-react/types'
5
-
6
- import Date from '../atoms/document-date'
7
- import Description from '../atoms/document-description'
8
- import Source from '../atoms/document-source'
9
- import Status from '../atoms/document-status'
10
- import Redacted from '../molecules/document-redacted'
11
-
12
- const StyledSummary = styled.div`
13
- display: flex;
14
- flex-direction: row;
15
- align-items: center;
16
- `
17
-
18
- const StyledDate = styled.div`
19
- margin-right: 0.5rem;
20
- `
21
-
22
- const StyledDescription = styled.div`
23
- flex-grow: 1;
24
- `
25
-
26
- const StyledSource = styled.div`
27
- display: flex;
28
- flex-direction: column;
29
- text-align: right;
30
- `
31
-
32
- const DocumentSummary: FC<Props> = ({ document, ...rest }) => {
33
- if (document.metadata.isRedacted) {
34
- return (
35
- <StyledSummary {...rest}>
36
- <Redacted document={document} />
37
- </StyledSummary>
38
- )
39
- }
40
-
41
- return (
42
- <StyledSummary {...rest}>
43
- <StyledDate>
44
- <Date document={document} />
45
- </StyledDate>
46
- <StyledDescription>
47
- <Description document={document} />
48
- </StyledDescription>
49
- <StyledSource>
50
- <Source document={document} />
51
- <Status document={document} />
52
- </StyledSource>
53
- </StyledSummary>
54
- )
55
- }
56
-
57
- interface Props extends HTMLAttributes<HTMLDivElement> {
58
- document: DocumentReference
59
- }
60
-
61
- export default DocumentSummary
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { DocumentReference } from '@ltht-react/types'
5
+
6
+ import Date from '../atoms/document-date'
7
+ import Description from '../atoms/document-description'
8
+ import Source from '../atoms/document-source'
9
+ import Status from '../atoms/document-status'
10
+ import Redacted from '../molecules/document-redacted'
11
+
12
+ const StyledSummary = styled.div`
13
+ display: flex;
14
+ flex-direction: row;
15
+ align-items: center;
16
+ `
17
+
18
+ const StyledDate = styled.div`
19
+ margin-right: 0.5rem;
20
+ `
21
+
22
+ const StyledDescription = styled.div`
23
+ flex-grow: 1;
24
+ `
25
+
26
+ const StyledSource = styled.div`
27
+ display: flex;
28
+ flex-direction: column;
29
+ text-align: right;
30
+ `
31
+
32
+ const DocumentSummary: FC<Props> = ({ document, ...rest }) => {
33
+ if (document.metadata.isRedacted) {
34
+ return (
35
+ <StyledSummary {...rest}>
36
+ <Redacted document={document} />
37
+ </StyledSummary>
38
+ )
39
+ }
40
+
41
+ return (
42
+ <StyledSummary {...rest}>
43
+ <StyledDate>
44
+ <Date document={document} />
45
+ </StyledDate>
46
+ <StyledDescription>
47
+ <Description document={document} />
48
+ </StyledDescription>
49
+ <StyledSource>
50
+ <Source document={document} />
51
+ <Status document={document} />
52
+ </StyledSource>
53
+ </StyledSummary>
54
+ )
55
+ }
56
+
57
+ interface Props extends HTMLAttributes<HTMLDivElement> {
58
+ document: DocumentReference
59
+ }
60
+
61
+ export default DocumentSummary
@@ -1,7 +0,0 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { DocumentReference } from '@ltht-react/types';
3
- declare const DocumentDate: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- document: DocumentReference;
6
- }
7
- export default DocumentDate;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __rest = (this && this.__rest) || function (s, e) {
18
- var t = {};
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
- t[p] = s[p];
21
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
- t[p[i]] = s[p[i]];
25
- }
26
- return t;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- var jsx_runtime_1 = require("react/jsx-runtime");
33
- var styled_1 = __importDefault(require("@emotion/styled"));
34
- var utils_1 = require("@ltht-react/utils");
35
- var StyledDocumentDate = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
36
- var DocumentDate = function (_a) {
37
- var _b, _c;
38
- var _d = _a.document, created = _d.created, description = _d.description, indexed = _d.indexed, rest = __rest(_a, ["document"]);
39
- if (!description)
40
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
41
- var date = (created === null || created === void 0 ? void 0 : created.value) ? (_b = created === null || created === void 0 ? void 0 : created.value) !== null && _b !== void 0 ? _b : '' : (_c = indexed.value) !== null && _c !== void 0 ? _c : '';
42
- var formattedDate = (0, utils_1.formatDate)(new Date(Date.parse(date)));
43
- return (0, jsx_runtime_1.jsx)(StyledDocumentDate, __assign({}, rest, { children: formattedDate }));
44
- };
45
- exports.default = DocumentDate;
46
- var templateObject_1;
47
- //# sourceMappingURL=document-date.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-date.js","sourceRoot":"","sources":["../../src/atoms/document-date.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAGpC,2CAA8C;AAE9C,IAAM,kBAAkB,GAAG,gBAAM,CAAC,GAAG,qEAAA,EAAE,IAAA,CAAA;AAEvC,IAAM,YAAY,GAAc,UAAC,EAAwD;;IAAtD,IAAA,gBAA2C,EAA/B,OAAO,aAAA,EAAE,WAAW,iBAAA,EAAE,OAAO,aAAA,EAAO,IAAI,cAAtD,YAAwD,CAAF;IACrF,IAAI,CAAC,WAAW;QAAE,OAAO,kDAAK,CAAA;IAE9B,IAAM,IAAI,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAC,CAAC,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,KAAK,mCAAI,EAAE,CAAA;IAExE,IAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAE5D,OAAO,uBAAC,kBAAkB,eAAK,IAAI,cAAG,aAAa,IAAsB,CAAA;AAC3E,CAAC,CAAA;AAMD,kBAAe,YAAY,CAAA"}
@@ -1,7 +0,0 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { DocumentReference } from '@ltht-react/types';
3
- declare const DocumentDescription: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- document: DocumentReference;
6
- }
7
- export default DocumentDescription;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- var jsx_runtime_1 = require("react/jsx-runtime");
22
- var styled_1 = __importDefault(require("@emotion/styled"));
23
- var StyledDocumentDescription = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
24
- var DocumentDescription = function (_a) {
25
- var description = _a.document.description;
26
- var rest = [];
27
- for (var _i = 1; _i < arguments.length; _i++) {
28
- rest[_i - 1] = arguments[_i];
29
- }
30
- if (!description)
31
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
32
- return (0, jsx_runtime_1.jsx)(StyledDocumentDescription, __assign({}, rest, { children: description }));
33
- };
34
- exports.default = DocumentDescription;
35
- var templateObject_1;
36
- //# sourceMappingURL=document-description.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-description.js","sourceRoot":"","sources":["../../src/atoms/document-description.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAIpC,IAAM,yBAAyB,GAAG,gBAAM,CAAC,GAAG,qEAAA,EAAE,IAAA,CAAA;AAE9C,IAAM,mBAAmB,GAAc,UAAC,EAA6B;QAAf,WAAW,0BAAA;IAAM,cAAO;SAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;QAAP,6BAAO;;IAC5E,IAAI,CAAC,WAAW;QAAE,OAAO,kDAAK,CAAA;IAE9B,OAAO,uBAAC,yBAAyB,eAAK,IAAI,cAAG,WAAW,IAA6B,CAAA;AACvF,CAAC,CAAA;AAMD,kBAAe,mBAAmB,CAAA"}
@@ -1,7 +0,0 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { DocumentReference } from '@ltht-react/types';
3
- declare const DocumentSource: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- document: DocumentReference;
6
- }
7
- export default DocumentSource;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __rest = (this && this.__rest) || function (s, e) {
18
- var t = {};
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
- t[p] = s[p];
21
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
- t[p[i]] = s[p[i]];
25
- }
26
- return t;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- var jsx_runtime_1 = require("react/jsx-runtime");
33
- var styled_1 = __importDefault(require("@emotion/styled"));
34
- var utils_1 = require("@ltht-react/utils");
35
- var StyledDocumentSource = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
36
- var DocumentSource = function (_a) {
37
- var _b, _c;
38
- var document = _a.document, rest = __rest(_a, ["document"]);
39
- var source = ((_b = document.metadata) === null || _b === void 0 ? void 0 : _b.dataSources) ? (_c = document.metadata.dataSources[0]) === null || _c === void 0 ? void 0 : _c.display : undefined;
40
- if (!source)
41
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
42
- return (0, jsx_runtime_1.jsx)(StyledDocumentSource, __assign({}, rest, { children: (0, utils_1.titleCase)(source) }));
43
- };
44
- exports.default = DocumentSource;
45
- var templateObject_1;
46
- //# sourceMappingURL=document-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-source.js","sourceRoot":"","sources":["../../src/atoms/document-source.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAEpC,2CAA6C;AAG7C,IAAM,oBAAoB,GAAG,gBAAM,CAAC,GAAG,qEAAA,EAAE,IAAA,CAAA;AAEzC,IAAM,cAAc,GAAc,UAAC,EAAqB;;IAAnB,IAAA,QAAQ,cAAA,EAAK,IAAI,cAAnB,YAAqB,CAAF;IACpD,IAAM,MAAM,GAAG,CAAA,MAAA,QAAQ,CAAC,QAAQ,0CAAE,WAAW,EAAC,CAAC,CAAC,MAAA,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,0CAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;IAErG,IAAI,CAAC,MAAM;QAAE,OAAO,kDAAK,CAAA;IAEzB,OAAO,uBAAC,oBAAoB,eAAK,IAAI,cAAG,IAAA,iBAAS,EAAC,MAAM,CAAC,IAAwB,CAAA;AACnF,CAAC,CAAA;AAMD,kBAAe,cAAc,CAAA"}
@@ -1,7 +0,0 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { DocumentReference } from '@ltht-react/types';
3
- declare const DocumentStatus: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- document: DocumentReference;
6
- }
7
- export default DocumentStatus;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- var jsx_runtime_1 = require("react/jsx-runtime");
11
- var styled_1 = __importDefault(require("@emotion/styled"));
12
- var styles_1 = require("@ltht-react/styles");
13
- var utils_1 = require("@ltht-react/utils");
14
- var StyledStatus = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: smaller;\n color: ", ";\n"], ["\n font-size: smaller;\n color: ", ";\n"])), styles_1.TEXT_COLOURS.SECONDARY.VALUE);
15
- var DocumentStatus = function (_a) {
16
- var status = _a.document.status;
17
- if (!status)
18
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
19
- return (0, jsx_runtime_1.jsx)(StyledStatus, { children: (0, utils_1.titleCase)(status) });
20
- };
21
- exports.default = DocumentStatus;
22
- var templateObject_1;
23
- //# sourceMappingURL=document-status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-status.js","sourceRoot":"","sources":["../../src/atoms/document-status.tsx"],"names":[],"mappings":";;;;;;;;;;AACA,2DAAoC;AAEpC,6CAAiD;AACjD,2CAA6C;AAG7C,IAAM,YAAY,GAAG,gBAAM,CAAC,GAAG,8GAAA,oCAEpB,EAA4B,KACtC,KADU,qBAAY,CAAC,SAAS,CAAC,KAAK,CACtC,CAAA;AAED,IAAM,cAAc,GAAc,UAAC,EAAwB;QAAV,MAAM,qBAAA;IACrD,IAAI,CAAC,MAAM;QAAE,OAAO,kDAAK,CAAA;IAEzB,OAAO,uBAAC,YAAY,cAAE,IAAA,iBAAS,EAAC,MAAM,CAAC,GAAgB,CAAA;AACzD,CAAC,CAAA;AAMD,kBAAe,cAAc,CAAA"}
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import DocumentSummary from './organisms/document-summary';
2
- export default DocumentSummary;
package/lib/index.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var document_summary_1 = __importDefault(require("./organisms/document-summary"));
7
- exports.default = document_summary_1.default;
8
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;AAAA,kFAA0D;AAE1D,kBAAe,0BAAe,CAAA"}
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- import { DocumentReference } from '@ltht-react/types';
3
- declare const DocumentRedacted: FC<Props>;
4
- interface Props {
5
- document: DocumentReference;
6
- }
7
- export default DocumentRedacted;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- var jsx_runtime_1 = require("react/jsx-runtime");
11
- var styled_1 = __importDefault(require("@emotion/styled"));
12
- var type_summary_1 = require("@ltht-react/type-summary");
13
- var document_date_1 = __importDefault(require("../atoms/document-date"));
14
- var StyledDescription = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n text-align: right;\n"], ["\n flex: 1;\n text-align: right;\n"])));
15
- var StyledDate = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
16
- var DocumentRedacted = function (_a) {
17
- var document = _a.document;
18
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledDate, { children: (0, jsx_runtime_1.jsx)(document_date_1.default, { document: document }) }), (0, jsx_runtime_1.jsx)(StyledDescription, { children: (0, jsx_runtime_1.jsx)(type_summary_1.RedactedDescription, {}) })] }));
19
- };
20
- exports.default = DocumentRedacted;
21
- var templateObject_1, templateObject_2;
22
- //# sourceMappingURL=document-redacted.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-redacted.js","sourceRoot":"","sources":["../../src/molecules/document-redacted.tsx"],"names":[],"mappings":";;;;;;;;;;AACA,2DAAoC;AAGpC,yDAA8D;AAE9D,yEAAyC;AAEzC,IAAM,iBAAiB,GAAG,gBAAM,CAAC,GAAG,yGAAA,sCAGnC,IAAA,CAAA;AACD,IAAM,UAAU,GAAG,gBAAM,CAAC,GAAG,mFAAA,gBAE5B,IAAA,CAAA;AAED,IAAM,gBAAgB,GAAc,UAAC,EAAY;QAAV,QAAQ,cAAA;IAAO,OAAA,CACpD,6DACE,uBAAC,UAAU,cACT,uBAAC,uBAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,GACjB,EACb,uBAAC,iBAAiB,cAChB,uBAAC,kCAAmB,KAAG,GACL,IACnB,CACJ;AATqD,CASrD,CAAA;AAMD,kBAAe,gBAAgB,CAAA"}
@@ -1,7 +0,0 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { DocumentReference } from '@ltht-react/types';
3
- declare const DocumentSummary: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- document: DocumentReference;
6
- }
7
- export default DocumentSummary;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __rest = (this && this.__rest) || function (s, e) {
18
- var t = {};
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
- t[p] = s[p];
21
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
- t[p[i]] = s[p[i]];
25
- }
26
- return t;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- var jsx_runtime_1 = require("react/jsx-runtime");
33
- var styled_1 = __importDefault(require("@emotion/styled"));
34
- var document_date_1 = __importDefault(require("../atoms/document-date"));
35
- var document_description_1 = __importDefault(require("../atoms/document-description"));
36
- var document_source_1 = __importDefault(require("../atoms/document-source"));
37
- var document_status_1 = __importDefault(require("../atoms/document-status"));
38
- var document_redacted_1 = __importDefault(require("../molecules/document-redacted"));
39
- var StyledSummary = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n"])));
40
- var StyledDate = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-right: 0.5rem;\n"], ["\n margin-right: 0.5rem;\n"])));
41
- var StyledDescription = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
42
- var StyledSource = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n text-align: right;\n"], ["\n display: flex;\n flex-direction: column;\n text-align: right;\n"])));
43
- var DocumentSummary = function (_a) {
44
- var document = _a.document, rest = __rest(_a, ["document"]);
45
- if (document.metadata.isRedacted) {
46
- return ((0, jsx_runtime_1.jsx)(StyledSummary, __assign({}, rest, { children: (0, jsx_runtime_1.jsx)(document_redacted_1.default, { document: document }) })));
47
- }
48
- return ((0, jsx_runtime_1.jsxs)(StyledSummary, __assign({}, rest, { children: [(0, jsx_runtime_1.jsx)(StyledDate, { children: (0, jsx_runtime_1.jsx)(document_date_1.default, { document: document }) }), (0, jsx_runtime_1.jsx)(StyledDescription, { children: (0, jsx_runtime_1.jsx)(document_description_1.default, { document: document }) }), (0, jsx_runtime_1.jsxs)(StyledSource, { children: [(0, jsx_runtime_1.jsx)(document_source_1.default, { document: document }), (0, jsx_runtime_1.jsx)(document_status_1.default, { document: document })] })] })));
49
- };
50
- exports.default = DocumentSummary;
51
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
52
- //# sourceMappingURL=document-summary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-summary.js","sourceRoot":"","sources":["../../src/organisms/document-summary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAIpC,yEAAyC;AACzC,uFAAuD;AACvD,6EAA6C;AAC7C,6EAA6C;AAC7C,qFAAqD;AAErD,IAAM,aAAa,GAAG,gBAAM,CAAC,GAAG,yIAAA,sEAI/B,IAAA,CAAA;AAED,IAAM,UAAU,GAAG,gBAAM,CAAC,GAAG,gGAAA,6BAE5B,IAAA,CAAA;AAED,IAAM,iBAAiB,GAAG,gBAAM,CAAC,GAAG,wFAAA,qBAEnC,IAAA,CAAA;AAED,IAAM,YAAY,GAAG,gBAAM,CAAC,GAAG,0IAAA,uEAI9B,IAAA,CAAA;AAED,IAAM,eAAe,GAAc,UAAC,EAAqB;IAAnB,IAAA,QAAQ,cAAA,EAAK,IAAI,cAAnB,YAAqB,CAAF;IACrD,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjC,OAAO,CACL,uBAAC,aAAa,eAAK,IAAI,cACrB,uBAAC,2BAAQ,IAAC,QAAQ,EAAE,QAAQ,GAAI,IAClB,CACjB,CAAA;IACH,CAAC;IAED,OAAO,CACL,wBAAC,aAAa,eAAK,IAAI,eACrB,uBAAC,UAAU,cACT,uBAAC,uBAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,GACjB,EACb,uBAAC,iBAAiB,cAChB,uBAAC,8BAAW,IAAC,QAAQ,EAAE,QAAQ,GAAI,GACjB,EACpB,wBAAC,YAAY,eACX,uBAAC,yBAAM,IAAC,QAAQ,EAAE,QAAQ,GAAI,EAC9B,uBAAC,yBAAM,IAAC,QAAQ,EAAE,QAAQ,GAAI,IACjB,KACD,CACjB,CAAA;AACH,CAAC,CAAA;AAMD,kBAAe,eAAe,CAAA"}