@ltht-react/timeline 1.0.223 → 1.0.225

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.
@@ -1,64 +1,64 @@
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 styles_1 = require("@ltht-react/styles");
24
- var hooks_1 = require("@ltht-react/hooks");
25
- var utils_1 = require("@ltht-react/utils");
26
- var timeline_description_1 = __importDefault(require("../atoms/timeline-description"));
27
- var timeline_author_1 = __importDefault(require("../atoms/timeline-author"));
28
- var timeline_title_1 = __importDefault(require("../atoms/timeline-title"));
29
- var timeline_time_1 = __importDefault(require("../atoms/timeline-time"));
30
- var timeline_button_1 = __importDefault(require("../atoms/timeline-button"));
31
- 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) {
32
- var isSelected = _a.isSelected;
33
- return (isSelected ? styles_1.HIGHLIGHT_GREEN.VALUE : styles_1.TRANSLUCENT_DARK_BLUE);
34
- });
35
- var StyledTimelineAuthor = styled_1.default(timeline_author_1.default)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 1;\n margin-bottom: 0.5rem;\n"], ["\n flex-grow: 1;\n margin-bottom: 0.5rem;\n"])));
36
- var StyledTimelineTime = styled_1.default(timeline_time_1.default)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: black;\n"], ["\n color: black;\n"])));
37
- var StyledTimelineItemTop = styled_1.default.div(templateObject_4 || (templateObject_4 = __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"])));
38
- var StyledTimelineItemMiddle = styled_1.default.div(templateObject_5 || (templateObject_5 = __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"])));
39
- var StyledTimelineItemBottom = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: grey;\n display: flex;\n margin: 0.5rem;\n"], ["\n color: grey;\n display: flex;\n margin: 0.5rem;\n"])));
40
- var StyledTimelineTitle = styled_1.default(timeline_title_1.default, {
41
- shouldForwardProp: function (prop) { return prop !== 'isMobile'; },
42
- })(templateObject_7 || (templateObject_7 = __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) {
43
- var isMobile = _a.isMobile;
44
- return (isMobile ? 'medium' : 'large');
45
- });
46
- var StyledTimelineDescription = styled_1.default(timeline_description_1.default)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: black;\n font-size: small;\n"], ["\n color: black;\n font-size: small;\n"])));
47
- var TimelineItem = function (_a) {
48
- var timelineItem = _a.timelineItem, domainResourceType = _a.domainResourceType;
49
- var width = hooks_1.useWindowSize().width;
50
- var isMobile = utils_1.isMobileView(width);
51
- if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
52
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
53
- }
54
- var domainResource = timelineItem.domainResource, buttonState = timelineItem.buttonState;
55
- var itemKey = "timelineItem_" + domainResource.id;
56
- return (jsx_runtime_1.jsxs(StyledTimelineItem, __assign({ isSelected: buttonState === 'selected-button' }, { children: [jsx_runtime_1.jsxs(StyledTimelineItemTop, { children: [jsx_runtime_1.jsx(StyledTimelineTitle, { isMobile: isMobile, domainResource: domainResource, domainResourceType: domainResourceType }, void 0),
57
- isMobile && (jsx_runtime_1.jsx(StyledTimelineTime, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0))] }, void 0),
58
- jsx_runtime_1.jsx(StyledTimelineItemMiddle, { children: jsx_runtime_1.jsx(StyledTimelineDescription, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
59
- jsx_runtime_1.jsx(StyledTimelineItemBottom, { children: jsx_runtime_1.jsx(StyledTimelineAuthor, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
60
- jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0)] }), itemKey));
61
- };
62
- exports.default = TimelineItem;
63
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
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 styles_1 = require("@ltht-react/styles");
24
+ var hooks_1 = require("@ltht-react/hooks");
25
+ var utils_1 = require("@ltht-react/utils");
26
+ var timeline_description_1 = __importDefault(require("../atoms/timeline-description"));
27
+ var timeline_author_1 = __importDefault(require("../atoms/timeline-author"));
28
+ var timeline_title_1 = __importDefault(require("../atoms/timeline-title"));
29
+ var timeline_time_1 = __importDefault(require("../atoms/timeline-time"));
30
+ var timeline_button_1 = __importDefault(require("../atoms/timeline-button"));
31
+ 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) {
32
+ var isSelected = _a.isSelected;
33
+ return (isSelected ? styles_1.HIGHLIGHT_GREEN.VALUE : styles_1.TRANSLUCENT_DARK_BLUE);
34
+ });
35
+ var StyledTimelineAuthor = styled_1.default(timeline_author_1.default)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 1;\n margin-bottom: 0.5rem;\n"], ["\n flex-grow: 1;\n margin-bottom: 0.5rem;\n"])));
36
+ var StyledTimelineTime = styled_1.default(timeline_time_1.default)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: black;\n"], ["\n color: black;\n"])));
37
+ var StyledTimelineItemTop = styled_1.default.div(templateObject_4 || (templateObject_4 = __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"])));
38
+ var StyledTimelineItemMiddle = styled_1.default.div(templateObject_5 || (templateObject_5 = __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"])));
39
+ var StyledTimelineItemBottom = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: grey;\n display: flex;\n margin: 0.5rem;\n"], ["\n color: grey;\n display: flex;\n margin: 0.5rem;\n"])));
40
+ var StyledTimelineTitle = styled_1.default(timeline_title_1.default, {
41
+ shouldForwardProp: function (prop) { return prop !== 'isMobile'; },
42
+ })(templateObject_7 || (templateObject_7 = __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) {
43
+ var isMobile = _a.isMobile;
44
+ return (isMobile ? 'medium' : 'large');
45
+ });
46
+ var StyledTimelineDescription = styled_1.default(timeline_description_1.default)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: black;\n font-size: small;\n"], ["\n color: black;\n font-size: small;\n"])));
47
+ var TimelineItem = function (_a) {
48
+ var timelineItem = _a.timelineItem, domainResourceType = _a.domainResourceType;
49
+ var width = hooks_1.useWindowSize().width;
50
+ var isMobile = utils_1.isMobileView(width);
51
+ if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
52
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
53
+ }
54
+ var domainResource = timelineItem.domainResource, buttonState = timelineItem.buttonState;
55
+ var itemKey = "timelineItem_" + domainResource.id;
56
+ return (jsx_runtime_1.jsxs(StyledTimelineItem, __assign({ isSelected: buttonState === 'selected-button' }, { children: [jsx_runtime_1.jsxs(StyledTimelineItemTop, { children: [jsx_runtime_1.jsx(StyledTimelineTitle, { isMobile: isMobile, domainResource: domainResource, domainResourceType: domainResourceType }, void 0),
57
+ isMobile && (jsx_runtime_1.jsx(StyledTimelineTime, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0))] }, void 0),
58
+ jsx_runtime_1.jsx(StyledTimelineItemMiddle, { children: jsx_runtime_1.jsx(StyledTimelineDescription, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
59
+ jsx_runtime_1.jsx(StyledTimelineItemBottom, { children: jsx_runtime_1.jsx(StyledTimelineAuthor, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
60
+ jsx_runtime_1.jsx(timeline_button_1.default, { timelineItem: timelineItem }, void 0)] }), itemKey));
61
+ };
62
+ exports.default = TimelineItem;
63
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
64
64
  //# sourceMappingURL=timeline-item.js.map
@@ -1,19 +1,19 @@
1
- import { FC } from 'react';
2
- import { Maybe, TimelineDomainResourceType } from '@ltht-react/types';
3
- import { ITimelineItem } from '../molecules/timeline-item';
4
- declare const Timeline: FC<IProps>;
5
- interface IProps {
6
- timelineItems: Maybe<ITimelineItem>[];
7
- domainResourceType: TimelineDomainResourceType;
8
- filters?: ITimelineFilter[];
9
- onFilterChange?: (value: string[]) => void;
10
- }
11
- export interface ITimelineFilter {
12
- label: string;
13
- options: ITimelineFilterOption[];
14
- }
15
- export interface ITimelineFilterOption {
16
- value?: string;
17
- label: string;
18
- }
19
- export default Timeline;
1
+ import { FC } from 'react';
2
+ import { Maybe, TimelineDomainResourceType } from '@ltht-react/types';
3
+ import { ITimelineItem } from '../molecules/timeline-item';
4
+ declare const Timeline: FC<IProps>;
5
+ interface IProps {
6
+ timelineItems: Maybe<ITimelineItem>[];
7
+ domainResourceType: TimelineDomainResourceType;
8
+ filters?: ITimelineFilter[];
9
+ onFilterChange?: (value: string[]) => void;
10
+ }
11
+ export interface ITimelineFilter {
12
+ label: string;
13
+ options: ITimelineFilterOption[];
14
+ }
15
+ export interface ITimelineFilterOption {
16
+ value?: string;
17
+ label: string;
18
+ }
19
+ export default Timeline;