@opentripplanner/trip-details 9.0.5 → 9.0.7

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/styled.js CHANGED
@@ -1,97 +1,96 @@
1
- import styled, { css } from "styled-components";
2
- const InvisibleA11yStyles = css `
3
- display: inline-block;
4
- clip: rect(0, 0, 0, 0);
5
- height: 0;
6
- overflow: hidden;
7
- position: absolute;
8
- width: 0;
9
- `;
10
- export const InvisibleA11yLabel = styled.span `
11
- ${InvisibleA11yStyles}
12
- `;
13
- // Warning: https://github.com/opentripplanner/otp-ui/pull/855#discussion_r2248534209
14
- export const InvisibleA11yCaption = styled.caption `
15
- ${InvisibleA11yStyles}
16
- `;
17
- const BaseButton = styled.button `
18
- background: transparent;
19
- border: 0;
20
- cursor: pointer;
21
- display: inline-block;
22
- font-size: 14px;
23
- font-weight: 400;
24
- line-height: 1.42857143;
25
- margin: 0;
26
- padding: 0;
27
- text-decoration: none;
28
- touch-action: manipulation;
29
- user-select: none;
30
- vertical-align: middle;
31
- white-space: nowrap;
32
- `;
33
- export const CO2Description = styled.span ``;
34
- export const CO2Summary = styled.span ``;
35
- export const ExpandButton = styled(BaseButton) `
36
- color: #00f;
37
- font-size: 16px;
38
- margin-left: 6px;
39
- margin-top: -2px;
40
- `;
41
- export const Fare = styled.span ``;
42
- export const HideButton = styled(BaseButton) `
43
- float: right;
44
- `;
45
- export const TNCFare = styled.span ``;
46
- export const TNCFareCompanies = styled.span `
47
- text-transform: capitalize;
48
- `;
49
- export const Timing = styled.span ``;
50
- export const TransitFare = styled.details `
51
- display: inline-block;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TripDetailsHeader = exports.TripDetailsBody = exports.TripDetails = exports.TripDetailSummary = exports.TripDetailIcon = exports.TripDetailDescription = exports.TripDetail = exports.TransitFareSingle = exports.TransitFare = exports.Timing = exports.TNCFareCompanies = exports.TNCFare = exports.InvisibleA11yLabel = exports.InvisibleA11yCaption = exports.HideButton = exports.FlexSummary = exports.Fare = exports.ExpandButton = exports.CO2Summary = exports.CO2Description = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
+ const InvisibleA11yStyles = (0, _styledComponents.css)(["display:inline-block;clip:rect(0,0,0,0);height:0;overflow:hidden;position:absolute;width:0;"]);
10
+ const InvisibleA11yLabel = exports.InvisibleA11yLabel = _styledComponents.default.span.withConfig({
11
+ displayName: "styled__InvisibleA11yLabel",
12
+ componentId: "sc-6q2ok2-0"
13
+ })(["", ""], InvisibleA11yStyles);
52
14
 
53
- > span {
54
- display: block;
55
- /* This may seem wrong, but this value gives the most aligned results */
56
- /* see: https://github.com/opentripplanner/otp-ui/pull/294#discussion_r742045851 */
57
- padding-left: 1.75ch;
58
- }
59
- `;
60
- export const TransitFareSingle = styled.span ``;
61
- export const FlexSummary = styled.span ``;
62
- export const TripDetail = styled.div `
63
- margin-top: 6px;
64
- `;
65
- export const TripDetailDescription = styled.div `
66
- background-color: #fff;
67
- border: 1px solid #888;
68
- font-size: 12px;
69
- margin-top: 2px;
70
- padding: 8px;
71
- `;
72
- export const TripDetailIcon = styled.div `
73
- float: left;
74
- font-size: 17px;
75
- `;
76
- export const TripDetails = styled.div `
77
- background-color: #eee;
78
- border-radius: 6px;
79
- margin-bottom: 15px;
80
- margin-top: 16px;
81
- padding: 10px 16px;
82
- overflow-x: scroll;
83
- `;
84
- export const TripDetailsBody = styled.div ``;
85
- export const TripDetailsHeader = styled.h2 `
86
- font-size: 18px;
87
- font-weight: 600;
88
- margin: 0;
89
- `;
90
- export const TripDetailSummary = styled.div `
91
- margin-left: 28px;
92
- padding-top: 2px;
93
- display: flex;
94
- align-items: baseline;
95
- white-space: pre-wrap;
96
- `;
15
+ // Warning: https://github.com/opentripplanner/otp-ui/pull/855#discussion_r2248534209
16
+ const InvisibleA11yCaption = exports.InvisibleA11yCaption = _styledComponents.default.caption.withConfig({
17
+ displayName: "styled__InvisibleA11yCaption",
18
+ componentId: "sc-6q2ok2-1"
19
+ })(["", ""], InvisibleA11yStyles);
20
+ const BaseButton = _styledComponents.default.button.withConfig({
21
+ displayName: "styled__BaseButton",
22
+ componentId: "sc-6q2ok2-2"
23
+ })(["background:transparent;border:0;cursor:pointer;display:inline-block;font-size:14px;font-weight:400;line-height:1.42857143;margin:0;padding:0;text-decoration:none;touch-action:manipulation;user-select:none;vertical-align:middle;white-space:nowrap;"]);
24
+ const CO2Description = exports.CO2Description = _styledComponents.default.span.withConfig({
25
+ displayName: "styled__CO2Description",
26
+ componentId: "sc-6q2ok2-3"
27
+ })([""]);
28
+ const CO2Summary = exports.CO2Summary = _styledComponents.default.span.withConfig({
29
+ displayName: "styled__CO2Summary",
30
+ componentId: "sc-6q2ok2-4"
31
+ })([""]);
32
+ const ExpandButton = exports.ExpandButton = (0, _styledComponents.default)(BaseButton).withConfig({
33
+ displayName: "styled__ExpandButton",
34
+ componentId: "sc-6q2ok2-5"
35
+ })(["color:#00f;font-size:16px;margin-left:6px;margin-top:-2px;"]);
36
+ const Fare = exports.Fare = _styledComponents.default.span.withConfig({
37
+ displayName: "styled__Fare",
38
+ componentId: "sc-6q2ok2-6"
39
+ })([""]);
40
+ const HideButton = exports.HideButton = (0, _styledComponents.default)(BaseButton).withConfig({
41
+ displayName: "styled__HideButton",
42
+ componentId: "sc-6q2ok2-7"
43
+ })(["float:right;"]);
44
+ const TNCFare = exports.TNCFare = _styledComponents.default.span.withConfig({
45
+ displayName: "styled__TNCFare",
46
+ componentId: "sc-6q2ok2-8"
47
+ })([""]);
48
+ const TNCFareCompanies = exports.TNCFareCompanies = _styledComponents.default.span.withConfig({
49
+ displayName: "styled__TNCFareCompanies",
50
+ componentId: "sc-6q2ok2-9"
51
+ })(["text-transform:capitalize;"]);
52
+ const Timing = exports.Timing = _styledComponents.default.span.withConfig({
53
+ displayName: "styled__Timing",
54
+ componentId: "sc-6q2ok2-10"
55
+ })([""]);
56
+ const TransitFare = exports.TransitFare = _styledComponents.default.details.withConfig({
57
+ displayName: "styled__TransitFare",
58
+ componentId: "sc-6q2ok2-11"
59
+ })(["display:inline-block;> span{display:block;padding-left:1.75ch;}"]);
60
+ const TransitFareSingle = exports.TransitFareSingle = _styledComponents.default.span.withConfig({
61
+ displayName: "styled__TransitFareSingle",
62
+ componentId: "sc-6q2ok2-12"
63
+ })([""]);
64
+ const FlexSummary = exports.FlexSummary = _styledComponents.default.span.withConfig({
65
+ displayName: "styled__FlexSummary",
66
+ componentId: "sc-6q2ok2-13"
67
+ })([""]);
68
+ const TripDetail = exports.TripDetail = _styledComponents.default.div.withConfig({
69
+ displayName: "styled__TripDetail",
70
+ componentId: "sc-6q2ok2-14"
71
+ })(["margin-top:6px;"]);
72
+ const TripDetailDescription = exports.TripDetailDescription = _styledComponents.default.div.withConfig({
73
+ displayName: "styled__TripDetailDescription",
74
+ componentId: "sc-6q2ok2-15"
75
+ })(["background-color:#fff;border:1px solid #888;font-size:12px;margin-top:2px;padding:8px;"]);
76
+ const TripDetailIcon = exports.TripDetailIcon = _styledComponents.default.div.withConfig({
77
+ displayName: "styled__TripDetailIcon",
78
+ componentId: "sc-6q2ok2-16"
79
+ })(["float:left;font-size:17px;"]);
80
+ const TripDetails = exports.TripDetails = _styledComponents.default.div.withConfig({
81
+ displayName: "styled__TripDetails",
82
+ componentId: "sc-6q2ok2-17"
83
+ })(["background-color:#eee;border-radius:6px;margin-bottom:15px;margin-top:16px;padding:10px 16px;overflow-x:scroll;"]);
84
+ const TripDetailsBody = exports.TripDetailsBody = _styledComponents.default.div.withConfig({
85
+ displayName: "styled__TripDetailsBody",
86
+ componentId: "sc-6q2ok2-18"
87
+ })([""]);
88
+ const TripDetailsHeader = exports.TripDetailsHeader = _styledComponents.default.h2.withConfig({
89
+ displayName: "styled__TripDetailsHeader",
90
+ componentId: "sc-6q2ok2-19"
91
+ })(["font-size:18px;font-weight:600;margin:0;"]);
92
+ const TripDetailSummary = exports.TripDetailSummary = _styledComponents.default.div.withConfig({
93
+ displayName: "styled__TripDetailSummary",
94
+ componentId: "sc-6q2ok2-20"
95
+ })(["margin-left:28px;padding-top:2px;display:flex;align-items:baseline;white-space:pre-wrap;"]);
97
96
  //# sourceMappingURL=styled.js.map
package/lib/styled.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sourceRoot":"","sources":["../src/styled.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;CAO9B,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAA;IACzC,mBAAmB;CACtB,CAAC;AAEF,qFAAqF;AACrF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,CAAA;IAC9C,mBAAmB;CACtB,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;;;;;;;;CAe/B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAA,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAA,EAAE,CAAC;AAExC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;;;;CAK7C,CAAC;AA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","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","InvisibleA11yStyles","css","InvisibleA11yLabel","exports","styled","span","withConfig","displayName","componentId","InvisibleA11yCaption","caption","BaseButton","button","CO2Description","CO2Summary","ExpandButton","Fare","HideButton","TNCFare","TNCFareCompanies","Timing","TransitFare","details","TransitFareSingle","FlexSummary","TripDetail","div","TripDetailDescription","TripDetailIcon","TripDetails","TripDetailsBody","TripDetailsHeader","h2","TripDetailSummary"],"sources":["../src/styled.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nconst InvisibleA11yStyles = css`\n display: inline-block;\n clip: rect(0, 0, 0, 0);\n height: 0;\n overflow: hidden;\n position: absolute;\n width: 0;\n`;\nexport const InvisibleA11yLabel = styled.span`\n ${InvisibleA11yStyles}\n`;\n\n// Warning: https://github.com/opentripplanner/otp-ui/pull/855#discussion_r2248534209\nexport const InvisibleA11yCaption = styled.caption`\n ${InvisibleA11yStyles}\n`;\n\nconst BaseButton = styled.button`\n background: transparent;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n margin: 0;\n padding: 0;\n text-decoration: none;\n touch-action: manipulation;\n user-select: none;\n vertical-align: middle;\n white-space: nowrap;\n`;\n\nexport const CO2Description = styled.span``;\n\nexport const CO2Summary = styled.span``;\n\nexport const ExpandButton = styled(BaseButton)`\n color: #00f;\n font-size: 16px;\n margin-left: 6px;\n margin-top: -2px;\n`;\n\nexport const Fare = styled.span``;\n\nexport const HideButton = styled(BaseButton)`\n float: right;\n`;\n\nexport const TNCFare = styled.span``;\n\nexport const TNCFareCompanies = styled.span`\n text-transform: capitalize;\n`;\n\nexport const Timing = styled.span``;\n\nexport const TransitFare = styled.details`\n display: inline-block;\n\n > span {\n display: block;\n /* This may seem wrong, but this value gives the most aligned results */\n /* see: https://github.com/opentripplanner/otp-ui/pull/294#discussion_r742045851 */\n padding-left: 1.75ch;\n }\n`;\nexport const TransitFareSingle = styled.span``;\n\nexport const FlexSummary = styled.span``;\n\nexport const TripDetail = styled.div`\n margin-top: 6px;\n`;\n\nexport const TripDetailDescription = styled.div`\n background-color: #fff;\n border: 1px solid #888;\n font-size: 12px;\n margin-top: 2px;\n padding: 8px;\n`;\n\nexport const TripDetailIcon = styled.div`\n float: left;\n font-size: 17px;\n`;\n\nexport const TripDetails = styled.div`\n background-color: #eee;\n border-radius: 6px;\n margin-bottom: 15px;\n margin-top: 16px;\n padding: 10px 16px;\n overflow-x: scroll;\n`;\n\nexport const TripDetailsBody = styled.div``;\n\nexport const TripDetailsHeader = styled.h2`\n font-size: 18px;\n font-weight: 600;\n margin: 0;\n`;\n\nexport const TripDetailSummary = styled.div`\n margin-left: 28px;\n padding-top: 2px;\n display: flex;\n align-items: baseline;\n white-space: pre-wrap;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAA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AAzB,OAAA,CAAAyB,cAAA,GAAGxB,yBAAM,CAACsB,GAAG,CAAApB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kCAGvC;AAEM,MAAMqB,WAAW,GAAA1B,OAAA,CAAA0B,WAAA,GAAGzB,yBAAM,CAACsB,GAAG,CAAApB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,uHAOpC;AAEM,MAAMsB,eAAe,GAAA3B,OAAA,CAAA2B,eAAA,GAAG1B,yBAAM,CAACsB,GAAG,CAAApB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAE;AAEpC,MAAMuB,iBAAiB,GAAA5B,OAAA,CAAA4B,iBAAA,GAAG3B,yBAAM,CAAC4B,EAAE,CAAA1B,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gDAIzC;AAEM,MAAMyB,iBAAiB,GAAA9B,OAAA,CAAA8B,iBAAA,GAAG7B,yBAAM,CAACsB,GAAG,CAAApB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gGAM1C","ignoreList":[]}
@@ -1,43 +1,69 @@
1
- import React, { useState } from "react";
2
- import { QuestionCircle } from "@styled-icons/fa-solid/QuestionCircle";
3
- import { TimesCircle } from "@styled-icons/fa-solid/TimesCircle";
4
- import AnimateHeight from "react-animate-height";
5
- import { useIntl } from "react-intl";
6
- import * as S from "./styled";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _QuestionCircle = require("@styled-icons/fa-solid/QuestionCircle");
10
+ var _TimesCircle = require("@styled-icons/fa-solid/TimesCircle");
11
+ var _reactAnimateHeight = _interopRequireDefault(require("react-animate-height"));
12
+ var _reactIntl = require("react-intl");
13
+ var S = _interopRequireWildcard(require("./styled"));
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
7
15
  // TODO: Remove this helper method by moving to semantically correct HTML
8
16
  function uuidv4() {
9
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
10
- // eslint-disable-next-line no-bitwise
11
- const r = (Math.random() * 16) | 0;
12
- // eslint-disable-next-line no-bitwise
13
- const v = c === "x" ? r : (r & 0x3) | 0x8;
14
- return v.toString(16);
15
- });
17
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
18
+ // eslint-disable-next-line no-bitwise
19
+ const r = Math.random() * 16 | 0;
20
+ // eslint-disable-next-line no-bitwise
21
+ const v = c === "x" ? r : r & 0x3 | 0x8;
22
+ return v.toString(16);
23
+ });
16
24
  }
17
- const TripDetail = ({ icon, summary, description, className }) => {
18
- const intl = useIntl();
19
- const [expanded, setExpanded] = useState(false);
20
- const id = uuidv4();
21
- const toggle = () => {
22
- setExpanded(!expanded);
23
- };
24
- return (React.createElement(S.TripDetail, { role: "group", className: className },
25
- React.createElement(S.TripDetailIcon, { role: "presentation" }, icon),
26
- React.createElement(S.TripDetailSummary, null,
27
- summary,
28
- description && (React.createElement(S.ExpandButton, { "aria-label": expanded
29
- ? intl.formatMessage({
30
- id: "otpUi.TripDetails.hideDetail"
31
- })
32
- : intl.formatMessage({
33
- id: "otpUi.TripDetails.showDetail"
34
- }), "aria-controls": id, "aria-expanded": expanded, id: "expand-button", onClick: toggle, tabIndex: 0 },
35
- React.createElement(QuestionCircle, { size: "0.92em" })))),
36
- React.createElement(AnimateHeight, { duration: 300, height: expanded ? "auto" : 0 },
37
- React.createElement(S.TripDetailDescription, { "aria-labelledby": "expand-button", id: id },
38
- React.createElement(S.HideButton, { role: "presentation", onClick: () => setExpanded(false) },
39
- React.createElement(TimesCircle, { size: "0.92em" })),
40
- description))));
25
+ const TripDetail = ({
26
+ icon,
27
+ summary,
28
+ description,
29
+ className
30
+ }) => {
31
+ const intl = (0, _reactIntl.useIntl)();
32
+ const [expanded, setExpanded] = (0, _react.useState)(false);
33
+ const id = uuidv4();
34
+ const toggle = () => {
35
+ setExpanded(!expanded);
36
+ };
37
+ return /*#__PURE__*/_react.default.createElement(S.TripDetail, {
38
+ role: "group",
39
+ className: className
40
+ }, /*#__PURE__*/_react.default.createElement(S.TripDetailIcon, {
41
+ role: "presentation"
42
+ }, icon), /*#__PURE__*/_react.default.createElement(S.TripDetailSummary, null, summary, description && /*#__PURE__*/_react.default.createElement(S.ExpandButton, {
43
+ "aria-label": expanded ? intl.formatMessage({
44
+ id: "otpUi.TripDetails.hideDetail"
45
+ }) : intl.formatMessage({
46
+ id: "otpUi.TripDetails.showDetail"
47
+ }),
48
+ "aria-controls": id,
49
+ "aria-expanded": expanded,
50
+ id: "expand-button",
51
+ onClick: toggle,
52
+ tabIndex: 0
53
+ }, /*#__PURE__*/_react.default.createElement(_QuestionCircle.QuestionCircle, {
54
+ size: "0.92em"
55
+ }))), /*#__PURE__*/_react.default.createElement(_reactAnimateHeight.default, {
56
+ duration: 300,
57
+ height: expanded ? "auto" : 0
58
+ }, /*#__PURE__*/_react.default.createElement(S.TripDetailDescription, {
59
+ "aria-labelledby": "expand-button",
60
+ id: id
61
+ }, /*#__PURE__*/_react.default.createElement(S.HideButton, {
62
+ role: "presentation",
63
+ onClick: () => setExpanded(false)
64
+ }, /*#__PURE__*/_react.default.createElement(_TimesCircle.TimesCircle, {
65
+ size: "0.92em"
66
+ })), description)));
41
67
  };
42
- export default TripDetail;
68
+ var _default = exports.default = TripDetail;
43
69
  //# sourceMappingURL=trip-detail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trip-detail.js","sourceRoot":"","sources":["../src/trip-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAS9B,yEAAyE;AACzE,SAAS,MAAM;IACb,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAS,CAAC;QACvE,sCAAsC;QACtC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACnC,sCAAsC;QACtC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,EAClB,IAAI,EACJ,OAAO,EACP,WAAW,EACX,SAAS,EACH,EAAe,EAAE;IACvB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAEpB,MAAM,MAAM,GAAG,GAAS,EAAE;QACxB,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,CAAC,CAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS;QAC7C,oBAAC,CAAC,CAAC,cAAc,IAAC,IAAI,EAAC,cAAc,IAAE,IAAI,CAAoB;QAG/D,oBAAC,CAAC,CAAC,iBAAiB;YACjB,OAAO;YACP,WAAW,IAAI,CACd,oBAAC,CAAC,CAAC,YAAY,kBAEX,QAAQ;oBACN,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;wBACjB,EAAE,EAAE,8BAA8B;qBACnC,CAAC;oBACJ,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;wBACjB,EAAE,EAAE,8BAA8B;qBACnC,CAAC,mBAEO,EAAE,mBACF,QAAQ,EACvB,EAAE,EAAC,eAAe,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC;gBAEX,oBAAC,cAAc,IAAC,IAAI,EAAC,QAAQ,GAAG,CACjB,CAClB,CACmB;QACtB,oBAAC,aAAa,IAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACzD,oBAAC,CAAC,CAAC,qBAAqB,uBAAiB,eAAe,EAAC,EAAE,EAAE,EAAE;gBAI7D,oBAAC,CAAC,CAAC,UAAU,IAAC,IAAI,EAAC,cAAc,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC;oBACjE,oBAAC,WAAW,IAAC,IAAI,EAAC,QAAQ,GAAG,CAChB;gBACd,WAAW,CACY,CACZ,CACH,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"trip-detail.js","names":["_react","_interopRequireWildcard","require","_QuestionCircle","_TimesCircle","_reactAnimateHeight","_interopRequireDefault","_reactIntl","S","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","uuidv4","replace","c","Math","random","v","toString","TripDetail","icon","summary","description","className","intl","useIntl","expanded","setExpanded","useState","id","toggle","createElement","role","TripDetailIcon","TripDetailSummary","ExpandButton","formatMessage","onClick","tabIndex","QuestionCircle","size","duration","height","TripDetailDescription","HideButton","TimesCircle","_default","exports"],"sources":["../src/trip-detail.tsx"],"sourcesContent":["import React, { ReactElement, useState } from \"react\";\nimport { QuestionCircle } from \"@styled-icons/fa-solid/QuestionCircle\";\nimport { TimesCircle } from \"@styled-icons/fa-solid/TimesCircle\";\n\nimport AnimateHeight from \"react-animate-height\";\nimport { useIntl } from \"react-intl\";\nimport * as S from \"./styled\";\n\ntype Props = {\n className?: string;\n description?: ReactElement | string;\n icon: ReactElement;\n summary: ReactElement | string;\n};\n\n// TODO: Remove this helper method by moving to semantically correct HTML\nfunction uuidv4(): string {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(c) {\n // eslint-disable-next-line no-bitwise\n const r = (Math.random() * 16) | 0;\n // eslint-disable-next-line no-bitwise\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\nconst TripDetail = ({\n icon,\n summary,\n description,\n className\n}: Props): JSX.Element => {\n const intl = useIntl();\n const [expanded, setExpanded] = useState(false);\n\n const id = uuidv4();\n\n const toggle = (): void => {\n setExpanded(!expanded);\n };\n\n return (\n <S.TripDetail role=\"group\" className={className}>\n <S.TripDetailIcon role=\"presentation\">{icon}</S.TripDetailIcon>\n {/* TODO: Adjust the summary and description to be a `summary`/`details` pair, therefore semantically correct */}\n {/* https://github.com/opentripplanner/otp-ui/pull/530#discussion_r1074006057 */}\n <S.TripDetailSummary>\n {summary}\n {description && (\n <S.ExpandButton\n aria-label={\n expanded\n ? intl.formatMessage({\n id: \"otpUi.TripDetails.hideDetail\"\n })\n : intl.formatMessage({\n id: \"otpUi.TripDetails.showDetail\"\n })\n }\n aria-controls={id}\n aria-expanded={expanded}\n id=\"expand-button\"\n onClick={toggle}\n tabIndex={0}\n >\n <QuestionCircle size=\"0.92em\" />\n </S.ExpandButton>\n )}\n </S.TripDetailSummary>\n <AnimateHeight duration={300} height={expanded ? \"auto\" : 0}>\n <S.TripDetailDescription aria-labelledby=\"expand-button\" id={id}>\n {/** This button isn't needed for screen readers as the main expand-button is\n * more convenient.\n */}\n <S.HideButton role=\"presentation\" onClick={() => setExpanded(false)}>\n <TimesCircle size=\"0.92em\" />\n </S.HideButton>\n {description}\n </S.TripDetailDescription>\n </AnimateHeight>\n </S.TripDetail>\n );\n};\n\nexport default TripDetail;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,mBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,CAAA,GAAAP,uBAAA,CAAAC,OAAA;AAA8B,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,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ACZ,CACH,CAAC;AAEnB,CAAC;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAA5C,OAAA,GAEagB,UAAU","ignoreList":[]}
package/lib/types.js CHANGED
@@ -1,2 +1,6 @@
1
- export {};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
2
6
  //# sourceMappingURL=types.js.map
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["// Prettier does not recognize the import type syntax.\n// eslint-disable-next-line prettier/prettier\nimport type { \n FareProductSelector, \n Itinerary, \n Leg, \n MassUnitOption,\n Money\n } from \"@opentripplanner/types\";\n\nexport interface TimeActiveDetailsProps {\n bikeMinutes: number;\n minutesActive?: number;\n walkMinutes: number;\n}\n\nexport interface CO2ConfigType {\n carbonIntensity?: Record<string, number>;\n units?: MassUnitOption;\n enabled?: boolean;\n}\n\nexport interface DepartureDetailsProps {\n departureDate: Date;\n}\n\n\n// Total fare amount corresponding to a fare key\nexport type FareTotals = (FareProductSelector & { price: Money })[]\n\nexport interface FareDetailsProps {\n legs: Leg[];\n maxTNCFare: number;\n minTNCFare: number;\n}\n\nexport interface TripDetailsProps {\n /**\n * Used for additional styling with styled components for example.\n */\n className?: string;\n /**\n * Object containing the CO₂ config.\n */\n co2Config?: CO2ConfigType;\n /**\n * Determines which transit fare should be displayed by default, should there be multiple transit fare types.\n */\n defaultFareType?: FareProductSelector;\n /**\n * Slot for a custom component to render the expandable section for departure.\n */\n DepartureDetails?: React.ElementType<DepartureDetailsProps>;\n /**\n * Slot for a custom component to render the expandable section for fares.\n */\n FareDetails?: React.ElementType<FareDetailsProps>;\n /**\n * Itinerary that the user has selected to view, contains multiple legs.\n */\n itinerary: Itinerary;\n /**\n * show the '~' symbol in the trip details panel\n */\n showApproximateMinutesActive?: boolean;\n /**\n * Slot for a custom component to render the expandable section for time active.\n */\n TimeActiveDetails?: React.ElementType<TimeActiveDetailsProps>;\n}"],"mappings":"","ignoreList":[]}
package/lib/utils.js CHANGED
@@ -1,24 +1,38 @@
1
- import React from "react";
2
- import { FormattedNumber } from "react-intl";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.boldText = boldText;
8
+ exports.renderFare = renderFare;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _reactIntl = require("react-intl");
3
11
  /**
4
12
  * Format text bold (used with FormattedMessage).
5
13
  */
6
- export function boldText(contents) {
7
- return React.createElement("strong", null, contents);
14
+ function boldText(contents) {
15
+ return /*#__PURE__*/_react.default.createElement("strong", null, contents);
8
16
  }
17
+
9
18
  /**
10
19
  * Render formatted fare.
11
20
  * @param currencyCode The ISO currency code to use (USD, GBP, EUR).
12
21
  * @param fare The fare value, in currency units, to be shown.
13
22
  * @returns The formatted fare value according to the selected locale.
14
23
  */
15
- export function renderFare(currencyCode, fare) {
16
- return (React.createElement(FormattedNumber, { currency: currencyCode,
17
- // For dollars in locales such as 'fr',
18
- // this will limit the display to just the dollar sign
19
- // (otherwise it will render e.g. '2,50 $US' instead of '2,50 $').
20
- currencyDisplay: "narrowSymbol", value: fare,
21
- // eslint-disable-next-line react/style-prop-object
22
- style: "currency" }));
24
+ function renderFare(currencyCode, fare) {
25
+ return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedNumber, {
26
+ currency: currencyCode
27
+ // For dollars in locales such as 'fr',
28
+ // this will limit the display to just the dollar sign
29
+ // (otherwise it will render e.g. '2,50 $US' instead of '2,50 $').
30
+ ,
31
+ currencyDisplay: "narrowSymbol",
32
+ value: fare
33
+ // eslint-disable-next-line react/style-prop-object
34
+ ,
35
+ style: "currency"
36
+ });
23
37
  }
24
38
  //# sourceMappingURL=utils.js.map
package/lib/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAmB;IAC1C,OAAO,oCAAS,QAAQ,CAAU,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,YAAoB,EAAE,IAAY;IAC3D,OAAO,CACL,oBAAC,eAAe,IACd,QAAQ,EAAE,YAAY;QACtB,uCAAuC;QACvC,sDAAsD;QACtD,kEAAkE;QAClE,eAAe,EAAC,cAAc,EAC9B,KAAK,EAAE,IAAI;QACX,mDAAmD;QACnD,KAAK,EAAC,UAAU,GAChB,CACH,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"utils.js","names":["_react","_interopRequireDefault","require","_reactIntl","boldText","contents","default","createElement","renderFare","currencyCode","fare","FormattedNumber","currency","currencyDisplay","value","style"],"sources":["../src/utils.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from \"react\";\nimport { FormattedNumber } from \"react-intl\";\n\n/**\n * Format text bold (used with FormattedMessage).\n */\nexport function boldText(contents: ReactNode): ReactElement {\n return <strong>{contents}</strong>;\n}\n\n/**\n * Render formatted fare.\n * @param currencyCode The ISO currency code to use (USD, GBP, EUR).\n * @param fare The fare value, in currency units, to be shown.\n * @returns The formatted fare value according to the selected locale.\n */\nexport function renderFare(currencyCode: string, fare: number): ReactElement {\n return (\n <FormattedNumber\n currency={currencyCode}\n // For dollars in locales such as 'fr',\n // this will limit the display to just the dollar sign\n // (otherwise it will render e.g. '2,50 $US' instead of '2,50 $').\n currencyDisplay=\"narrowSymbol\"\n value={fare}\n // eslint-disable-next-line react/style-prop-object\n style=\"currency\"\n />\n );\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACO,SAASE,QAAQA,CAACC,QAAmB,EAAgB;EAC1D,oBAAOL,MAAA,CAAAM,OAAA,CAAAC,aAAA,iBAASF,QAAiB,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,UAAUA,CAACC,YAAoB,EAAEC,IAAY,EAAgB;EAC3E,oBACEV,MAAA,CAAAM,OAAA,CAAAC,aAAA,CAACJ,UAAA,CAAAQ,eAAe;IACdC,QAAQ,EAAEH;IACV;IACA;IACA;IAAA;IACAI,eAAe,EAAC,cAAc;IAC9BC,KAAK,EAAEJ;IACP;IAAA;IACAK,KAAK,EAAC;EAAU,CACjB,CAAC;AAEN","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentripplanner/trip-details",
3
- "version": "9.0.5",
3
+ "version": "9.0.7",
4
4
  "description": "A component for displaying details about a trip planning itinerary",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
@@ -15,7 +15,7 @@
15
15
  "@styled-icons/fa-solid": "^10.34.0",
16
16
  "flat": "^5.0.2",
17
17
  "react-animate-height": "^3.0.4",
18
- "@opentripplanner/core-utils": "14.3.1"
18
+ "@opentripplanner/core-utils": "14.3.2"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@opentripplanner/types": "8.3.1"
@@ -137,7 +137,9 @@ export default function Fares({
137
137
 
138
138
  return (
139
139
  <>
140
- {itinerary.legs.some(leg => leg.fareProducts) && (
140
+ {itinerary.legs.some(
141
+ leg => leg.fareProducts && leg.fareProducts.length > 0
142
+ ) && (
141
143
  <TripDetail
142
144
  className="fares"
143
145
  // Any custom description for the transit fare needs to be handled by the slot.