@ltht-react/timeline 1.0.110 → 1.0.112
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/lib/atoms/timeline-button.d.ts +7 -0
- package/lib/atoms/timeline-button.js +34 -0
- package/lib/atoms/timeline-button.js.map +1 -0
- package/lib/atoms/timeline-button.test.d.ts +1 -0
- package/lib/atoms/timeline-button.test.js +120 -0
- package/lib/atoms/timeline-button.test.js.map +1 -0
- package/lib/molecules/timeline-item-redacted.d.ts +0 -8
- package/lib/molecules/timeline-item-redacted.js.map +1 -1
- package/lib/molecules/timeline-item.d.ts +3 -3
- package/lib/molecules/timeline-item.js +8 -13
- package/lib/molecules/timeline-item.js.map +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { ITimelineItem } from '../molecules/timeline-item';
|
|
3
|
+
declare const TimelineButton: FC<Props>;
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
timelineItem: ITimelineItem;
|
|
6
|
+
}
|
|
7
|
+
export default TimelineButton;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
var banner_1 = require("@ltht-react/banner");
|
|
16
|
+
var icon_1 = require("@ltht-react/icon");
|
|
17
|
+
var TimelineButton = function (_a) {
|
|
18
|
+
var timelineItem = _a.timelineItem;
|
|
19
|
+
var clickHandler = timelineItem.clickHandler, buttonState = timelineItem.buttonState, buttonText = timelineItem.buttonText;
|
|
20
|
+
switch (buttonState) {
|
|
21
|
+
case 'no-button':
|
|
22
|
+
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
|
|
23
|
+
case 'permission-denied-button':
|
|
24
|
+
return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ type: "warning", disabled: true }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : 'Insufficient privileges to view this item' }), void 0));
|
|
25
|
+
case 'selectable-button':
|
|
26
|
+
return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ type: "info", onClick: clickHandler }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : '' }), void 0));
|
|
27
|
+
case 'selected-button':
|
|
28
|
+
return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ type: "highlight", icon: jsx_runtime_1.jsx(icon_1.InfoCircleIcon, { status: "info", size: "medium" }, void 0), onClick: clickHandler }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : '' }), void 0));
|
|
29
|
+
default:
|
|
30
|
+
throw new Error('ButtonState must be a valid value.');
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.default = TimelineButton;
|
|
34
|
+
//# sourceMappingURL=timeline-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-button.js","sourceRoot":"","sources":["../../src/atoms/timeline-button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAAiD;AACjD,yCAAiD;AAIjD,IAAM,cAAc,GAAc,UAAC,EAAgB;QAAd,YAAY,kBAAA;IACvC,IAAA,YAAY,GAA8B,YAAY,aAA1C,EAAE,WAAW,GAAiB,YAAY,YAA7B,EAAE,UAAU,GAAK,YAAY,WAAjB,CAAiB;IAE9D,QAAQ,WAAW,EAAE;QACnB,KAAK,WAAW;YACd,OAAO,qDAAK,CAAA;QACd,KAAK,0BAA0B;YAC7B,OAAO,CACL,kBAAC,qBAAY,aAAC,IAAI,EAAC,SAAS,EAAC,QAAQ,sBAClC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,2CAA2C,YAC7C,CAChB,CAAA;QACH,KAAK,mBAAmB;YACtB,OAAO,CACL,kBAAC,qBAAY,aAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,YAAY,gBAC5C,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,YACJ,CAChB,CAAA;QACH,KAAK,iBAAiB;YACpB,OAAO,CACL,kBAAC,qBAAY,aAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAE,kBAAC,qBAAc,IAAC,MAAM,EAAC,MAAM,EAAC,IAAI,EAAC,QAAQ,WAAG,EAAE,OAAO,EAAE,YAAY,gBACvG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,YACJ,CAChB,CAAA;QACH;YACE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;KACxD;AACH,CAAC,CAAA;AAMD,kBAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
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 jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var react_1 = require("@testing-library/react");
|
|
8
|
+
var timeline_button_1 = __importDefault(require("./timeline-button"));
|
|
9
|
+
describe('Timeline Button', function () {
|
|
10
|
+
it.each([
|
|
11
|
+
{
|
|
12
|
+
buttonState: 'no-button',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
buttonState: 'no-button',
|
|
16
|
+
clickHandler: function () { return undefined; },
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
buttonState: 'no-button',
|
|
20
|
+
buttonText: 'Click me!',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
buttonState: 'no-button',
|
|
24
|
+
clickHandler: function () { return undefined; },
|
|
25
|
+
buttonText: 'Click me!',
|
|
26
|
+
},
|
|
27
|
+
])("Renders a fragment if button state is no-button, regardless of other properties", function (timelineItem) {
|
|
28
|
+
var asFragment = react_1.render(jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0)).asFragment;
|
|
29
|
+
expect(asFragment().firstChild).toBeNull();
|
|
30
|
+
});
|
|
31
|
+
it.each([
|
|
32
|
+
{
|
|
33
|
+
buttonState: 'selectable-button',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
buttonState: 'selectable-button',
|
|
37
|
+
buttonText: 'Click me!',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
buttonState: 'selectable-button',
|
|
41
|
+
clickHandler: function () { return undefined; },
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
buttonState: 'selectable-button',
|
|
45
|
+
clickHandler: function () { return undefined; },
|
|
46
|
+
},
|
|
47
|
+
])('Renders a button if button state is selectable-button, regardless of other properties', function (timelineItem) {
|
|
48
|
+
react_1.render(jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0));
|
|
49
|
+
expect(react_1.screen.getByRole('button')).toBeVisible();
|
|
50
|
+
});
|
|
51
|
+
it.each([
|
|
52
|
+
{
|
|
53
|
+
buttonState: 'selected-button',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
buttonState: 'selected-button',
|
|
57
|
+
buttonText: 'Click me!',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
buttonState: 'selected-button',
|
|
61
|
+
clickHandler: function () { return undefined; },
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
buttonState: 'selected-button',
|
|
65
|
+
clickHandler: function () { return undefined; },
|
|
66
|
+
},
|
|
67
|
+
])('Renders a button if button state is selected-button, regardless of other properties', function (timelineItem) {
|
|
68
|
+
react_1.render(jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0));
|
|
69
|
+
expect(react_1.screen.getByRole('button')).toBeVisible();
|
|
70
|
+
});
|
|
71
|
+
it.each([
|
|
72
|
+
{
|
|
73
|
+
buttonState: 'permission-denied-button',
|
|
74
|
+
buttonText: 'This is some button text',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
buttonState: 'permission-denied-button',
|
|
78
|
+
buttonText: 'This is some button text',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
buttonState: 'permission-denied-button',
|
|
82
|
+
buttonText: 'This is some button text',
|
|
83
|
+
clickHandler: function () { return undefined; },
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
buttonState: 'permission-denied-button',
|
|
87
|
+
buttonText: 'This is some button text',
|
|
88
|
+
clickHandler: function () { return undefined; },
|
|
89
|
+
},
|
|
90
|
+
])('Renders a disabled button if button state is permission-denied-button', function (timelineItem) {
|
|
91
|
+
react_1.render(jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0));
|
|
92
|
+
expect(react_1.screen.getByRole('button', { name: /This is some button text/ })).toBeVisible();
|
|
93
|
+
expect(react_1.screen.getByRole('button', { name: /This is some button text/ })).toBeDisabled();
|
|
94
|
+
});
|
|
95
|
+
it.each([
|
|
96
|
+
{
|
|
97
|
+
buttonState: 'selectable-button',
|
|
98
|
+
buttonText: 'This is some button text',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
buttonState: 'selected-button',
|
|
102
|
+
buttonText: 'This is some button text',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
buttonState: 'permission-denied-button',
|
|
106
|
+
buttonText: 'This is some button text',
|
|
107
|
+
},
|
|
108
|
+
])('Renders the button text', function (timelineItem) {
|
|
109
|
+
react_1.render(jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0));
|
|
110
|
+
expect(react_1.screen.getByRole('button', { name: /This is some button text/ })).toBeVisible();
|
|
111
|
+
});
|
|
112
|
+
it('Uses the default permissions text if no custom text is provided', function () {
|
|
113
|
+
var timelineItem = {
|
|
114
|
+
buttonState: 'permission-denied-button',
|
|
115
|
+
};
|
|
116
|
+
react_1.render(jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0));
|
|
117
|
+
expect(react_1.screen.getByRole('button', { name: /Insufficient privileges to view this item/ })).toBeVisible();
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=timeline-button.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-button.test.js","sourceRoot":"","sources":["../../src/atoms/timeline-button.test.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAuD;AAEvD,sEAA8C;AAE9C,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,IAAI,CAAC;QACN;YACE,WAAW,EAAE,WAAW;SACR;QAClB;YACE,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,cAAM,OAAA,SAAS,EAAT,CAAS;SACb;QAClB;YACE,WAAW,EAAE,WAAW;YACxB,UAAU,EAAE,WAAW;SACP;QAClB;YACE,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,cAAM,OAAA,SAAS,EAAT,CAAS;YAC7B,UAAU,EAAE,WAAW;SACP;KACnB,CAAC,CACA,iFAAiF,EACjF,UAAC,YAA2B;QAClB,IAAA,UAAU,GAAK,cAAM,CAAC,kBAAC,yBAAc,IAAC,YAAY,EAAE,YAAY,WAAI,CAAC,WAA3D,CAA2D;QAE7E,MAAM,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAA;IAC5C,CAAC,CACF,CAAA;IAED,EAAE,CAAC,IAAI,CAAC;QACN;YACE,WAAW,EAAE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AS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,2CAA2C,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;IACzG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { AuditEvent, DocumentReference, Maybe, QuestionnaireResponse } from '@ltht-react/types';
|
|
3
2
|
declare const TimelineItemRedacted: FC;
|
|
4
|
-
export interface ITimelineItem {
|
|
5
|
-
domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
|
|
6
|
-
clickHandler?(): void;
|
|
7
|
-
clickPrompt?: string;
|
|
8
|
-
isSelected: boolean | undefined;
|
|
9
|
-
deselectPrompt?: string;
|
|
10
|
-
}
|
|
11
3
|
export default TimelineItemRedacted;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-item-redacted.js","sourceRoot":"","sources":["../../src/molecules/timeline-item-redacted.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AACpC,6CAA2E;
|
|
1
|
+
{"version":3,"file":"timeline-item-redacted.js","sourceRoot":"","sources":["../../src/molecules/timeline-item-redacted.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AACpC,6CAA2E;AAC3E,2CAAiD;AACjD,2CAAgD;AAChD,6FAAoE;AAEpE,IAAM,kBAAkB,GAAG,gBAAM,CAAC,GAAG,sHAAqB,wBACpC,EAAgF,yBAErG,KAFqB,UAAC,EAAc;QAAZ,UAAU,gBAAA;IAAO,OAAA,CAAC,UAAU,CAAC,CAAC,CAAC,wBAAe,CAAC,KAAK,CAAC,CAAC,CAAC,8BAAqB,CAAC;AAA5D,CAA4D,CAErG,CAAA;AACD,IAAM,qBAAqB,GAAG,gBAAM,CAAC,GAAG,sIAAA,mEAIvC,IAAA,CAAA;AACD,IAAM,WAAW,GAAG,gBAAM,CAAC,GAAG,mJAAe,mDAG9B,EAAiD,2BAE/D,KAFc,UAAC,EAAY;QAAV,QAAQ,cAAA;IAAO,OAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AAA/B,CAA+B,CAE/D,CAAA;AAED,IAAM,oBAAoB,GAAO;IACvB,IAAA,KAAK,GAAK,qBAAa,EAAE,MAApB,CAAoB;IACjC,IAAM,QAAQ,GAAG,oBAAY,CAAC,KAAK,CAAC,CAAA;IAEpC,OAAO,CACL,kBAAC,kBAAkB,aAAC,UAAU,EAAE,KAAK,gBACnC,kBAAC,qBAAqB,cACpB,kBAAC,WAAW,aAAC,QAAQ,EAAE,QAAQ,gBAC7B,kBAAC,iCAAqB,aAAG,YACb,WACQ,YACL,CACtB,CAAA;AACH,CAAC,CAAA;AAUD,kBAAe,oBAAoB,CAAA"}
|
|
@@ -7,9 +7,9 @@ interface IProps {
|
|
|
7
7
|
}
|
|
8
8
|
export interface ITimelineItem {
|
|
9
9
|
domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
|
|
10
|
+
buttonState: TimeLineItemButtonState;
|
|
10
11
|
clickHandler?(): void;
|
|
11
|
-
|
|
12
|
-
isSelected: boolean | undefined;
|
|
13
|
-
deselectPrompt?: string;
|
|
12
|
+
buttonText?: string;
|
|
14
13
|
}
|
|
14
|
+
declare type TimeLineItemButtonState = 'no-button' | 'selectable-button' | 'selected-button' | 'permission-denied-button';
|
|
15
15
|
export default TimelineItem;
|
|
@@ -20,8 +20,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
22
|
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
23
|
-
var banner_1 = __importDefault(require("@ltht-react/banner"));
|
|
24
|
-
var icon_1 = require("@ltht-react/icon");
|
|
25
23
|
var styles_1 = require("@ltht-react/styles");
|
|
26
24
|
var hooks_1 = require("@ltht-react/hooks");
|
|
27
25
|
var utils_1 = require("@ltht-react/utils");
|
|
@@ -30,26 +28,24 @@ var timeline_author_1 = __importDefault(require("../atoms/timeline-author"));
|
|
|
30
28
|
var timeline_status_1 = __importDefault(require("../atoms/timeline-status"));
|
|
31
29
|
var timeline_title_1 = __importDefault(require("../atoms/timeline-title"));
|
|
32
30
|
var timeline_time_1 = __importDefault(require("../atoms/timeline-time"));
|
|
33
|
-
var
|
|
31
|
+
var timeline_button_1 = __importDefault(require("../atoms/timeline-button"));
|
|
32
|
+
var StyledTimelineItem = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n padding-top: 0.5rem;\n"], ["\n background-color: ", ";\n padding-top: 0.5rem;\n"])), function (_a) {
|
|
34
33
|
var isSelected = _a.isSelected;
|
|
35
34
|
return (isSelected ? styles_1.HIGHLIGHT_GREEN.VALUE : styles_1.TRANSLUCENT_DARK_BLUE);
|
|
36
35
|
});
|
|
37
36
|
var StyledTimelineItemLeft = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
|
|
38
37
|
var StyledTimelineItemRight = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
|
|
39
38
|
var StyledTimelineTime = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: black;\n"], ["\n color: black;\n"])));
|
|
40
|
-
var StyledTimelineItemTop = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n"], ["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n"])));
|
|
41
|
-
var StyledTimelineItemMiddle = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: black;\n padding-bottom: 1rem;\n"], ["\n color: black;\n padding-bottom: 1rem;\n"])));
|
|
42
|
-
var StyledTimelineItemBottom = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: grey;\n display: flex;\n"], ["\n color: grey;\n display: flex;\n"])));
|
|
39
|
+
var StyledTimelineItemTop = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n margin: 0.5rem;\n"], ["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n margin: 0.5rem;\n"])));
|
|
40
|
+
var StyledTimelineItemMiddle = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: black;\n padding-bottom: 1rem;\n margin: 0.5rem;\n"], ["\n color: black;\n padding-bottom: 1rem;\n margin: 0.5rem;\n"])));
|
|
41
|
+
var StyledTimelineItemBottom = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: grey;\n display: flex;\n margin: 0.5rem;\n"], ["\n color: grey;\n display: flex;\n margin: 0.5rem;\n"])));
|
|
43
42
|
var StyledTitle = styled_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n flex-grow: 1;\n color: black;\n font-size: ", ";\n font-weight: bold;\n"], ["\n flex-grow: 1;\n color: black;\n font-size: ", ";\n font-weight: bold;\n"])), function (_a) {
|
|
44
43
|
var isMobile = _a.isMobile;
|
|
45
44
|
return (isMobile ? 'medium' : 'large');
|
|
46
45
|
});
|
|
47
46
|
var StyledDescription = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: black;\n font-size: small;\n"], ["\n color: black;\n font-size: small;\n"])));
|
|
48
47
|
var StyledStatus = styled_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
|
|
49
|
-
var StyledBanner = styled_1.default(banner_1.default)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n margin: -0.5rem;\n margin-top: 0.5rem;\n"], ["\n margin: -0.5rem;\n margin-top: 0.5rem;\n"])));
|
|
50
|
-
var StyledBannerContent = styled_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject([""], [""])));
|
|
51
48
|
var TimelineItem = function (_a) {
|
|
52
|
-
var _b;
|
|
53
49
|
var timelineItem = _a.timelineItem, domainResourceType = _a.domainResourceType;
|
|
54
50
|
var width = hooks_1.useWindowSize().width;
|
|
55
51
|
var isMobile = utils_1.isMobileView(width);
|
|
@@ -57,14 +53,13 @@ var TimelineItem = function (_a) {
|
|
|
57
53
|
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
|
|
58
54
|
}
|
|
59
55
|
var itemKey = "timelineItem_" + timelineItem.domainResource.id;
|
|
60
|
-
return (jsx_runtime_1.jsxs(StyledTimelineItem, __assign({ isSelected:
|
|
56
|
+
return (jsx_runtime_1.jsxs(StyledTimelineItem, __assign({ isSelected: timelineItem.buttonState === 'selected-button' }, { children: [jsx_runtime_1.jsxs(StyledTimelineItemTop, { children: [jsx_runtime_1.jsx(StyledTitle, __assign({ isMobile: isMobile }, { children: jsx_runtime_1.jsx(timeline_title_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }), void 0),
|
|
61
57
|
isMobile && (jsx_runtime_1.jsx(StyledTimelineTime, { children: jsx_runtime_1.jsx(timeline_time_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0))] }, void 0),
|
|
62
58
|
jsx_runtime_1.jsx(StyledTimelineItemMiddle, { children: jsx_runtime_1.jsx(StyledDescription, { children: jsx_runtime_1.jsx(timeline_description_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0) }, void 0),
|
|
63
59
|
jsx_runtime_1.jsxs(StyledTimelineItemBottom, { children: [jsx_runtime_1.jsx(StyledTimelineItemLeft, { children: jsx_runtime_1.jsx(timeline_author_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
|
|
64
60
|
jsx_runtime_1.jsx(StyledTimelineItemRight, { children: jsx_runtime_1.jsx(StyledStatus, { children: jsx_runtime_1.jsx(timeline_status_1.default, {}, void 0) }, void 0) }, void 0)] }, void 0),
|
|
65
|
-
|
|
66
|
-
timelineItem.clickHandler && timelineItem.isSelected && (jsx_runtime_1.jsx(StyledBanner, __assign({ type: "highlight", icon: jsx_runtime_1.jsx(icon_1.InfoCircleIcon, { status: "info", size: "medium" }, void 0), onClick: timelineItem.clickHandler }, { children: timelineItem.deselectPrompt && jsx_runtime_1.jsx(StyledBannerContent, { children: timelineItem.deselectPrompt }, void 0) }), void 0))] }), itemKey));
|
|
61
|
+
jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0)] }), itemKey));
|
|
67
62
|
};
|
|
68
63
|
exports.default = TimelineItem;
|
|
69
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10
|
|
64
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
70
65
|
//# sourceMappingURL=timeline-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-item.js","sourceRoot":"","sources":["../../src/molecules/timeline-item.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"timeline-item.js","sourceRoot":"","sources":["../../src/molecules/timeline-item.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AACpC,6CAA2E;AAQ3E,2CAAiD;AACjD,2CAAgD;AAChD,uFAA+D;AAC/D,6EAAqD;AACrD,6EAAqD;AACrD,2EAAmD;AACnD,yEAAiD;AACjD,6EAAqD;AAErD,IAAM,kBAAkB,GAAG,gBAAM,CAAC,GAAG,0HAAqB,wBACpC,EAAgF,6BAErG,KAFqB,U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,CAAA;KACb;IAED,IAAM,OAAO,GAAG,kBAAgB,YAAY,CAAC,cAAc,CAAC,EAAI,CAAA;IAEhE,OAAO,CACL,mBAAC,kBAAkB,aAAC,UAAU,EAAE,YAAY,CAAC,WAAW,KAAK,iBAAiB,iBAC5E,mBAAC,qBAAqB,eACpB,kBAAC,WAAW,aAAC,QAAQ,EAAE,QAAQ,gBAC7B,kBAAC,wBAAa,IAAC,cAAc,EAAE,YAAY,CAAC,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,WAAI,YAC1F;oBACb,QAAQ,IAAI,CACX,kBAAC,kBAAkB,cACjB,kBAAC,uBAAY,IAAC,cAAc,EAAE,YAAY,CAAC,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,WAAI,WAClF,CACtB,YACqB;YACxB,kBAAC,wBAAwB,cACvB,kBAAC,iBAAiB,cAChB,kBAAC,8BAAmB,IAAC,cAAc,EAAE,YAAY,CAAC,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,WAAI,WAC1F,WACK;YAC3B,mBAAC,wBAAwB,eACvB,kBAAC,sBAAsB,cACrB,kBAAC,yBAAc,IAAC,cAAc,EAAE,YAAY,CAAC,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,WAAI,WAChF;oBACzB,kBAAC,uBAAuB,cACtB,kBAAC,YAAY,cACX,kBAAC,yBAAc,aAAG,WACL,WACS,YACD;YAC3B,kBAAC,yBAAc,IAAC,YAAY,EAAE,YAAY,WAAI,MA1BqC,OAAO,CA2BvE,CACtB,CAAA;AACH,CAAC,CAAA;AAwBD,kBAAe,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/timeline",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.112",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Jonny Dyson",
|
|
6
6
|
"homepage": "",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@emotion/styled": "^11.0.0",
|
|
26
|
-
"@ltht-react/banner": "^1.0.
|
|
27
|
-
"@ltht-react/hooks": "^1.0.
|
|
28
|
-
"@ltht-react/icon": "^1.3.
|
|
29
|
-
"@ltht-react/styles": "^1.3.
|
|
30
|
-
"@ltht-react/types": "^1.0.
|
|
31
|
-
"@ltht-react/utils": "^1.1.
|
|
26
|
+
"@ltht-react/banner": "^1.0.97",
|
|
27
|
+
"@ltht-react/hooks": "^1.0.114",
|
|
28
|
+
"@ltht-react/icon": "^1.3.124",
|
|
29
|
+
"@ltht-react/styles": "^1.3.116",
|
|
30
|
+
"@ltht-react/types": "^1.0.120",
|
|
31
|
+
"@ltht-react/utils": "^1.1.122",
|
|
32
32
|
"react": "^17.0.0",
|
|
33
33
|
"react-html-parser": "^2.0.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b633fbf0a9db43eb3b6078cbe2fb0616e5c70fd6"
|
|
36
36
|
}
|