@opentripplanner/trip-details 1.5.0 → 2.0.1

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["TransitFare","fareKey","fareNameFallback","fareKeyNameMap","transitFares","currentFare","centsToString","transitFare","propTypes","PropTypes","string","isRequired","shape","func","number","defaultProps","undefined","TripDetails","className","defaultFareKey","itinerary","longDateFormat","messages","routingType","timeOptions","date","startTime","coreUtils","mergeMessages","maxTNCFare","minTNCFare","calculateFares","defaultFare","companies","legs","forEach","leg","tncData","company","fare","fareKeys","Object","keys","sort","length","dollarsToString","TransitFareWrapper","S","TransitFareSingle","display","map","toLowerCase","bikeDuration","caloriesBurned","walkDuration","calculatePhysicalActivity","title","departDescription","depart","format","at","time","formatTime","transitFareDescription","Math","round","types","itineraryType","caloriesBurnedDescription","timeOptionsType"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;AACA;;;;;;AAEA,MAAMA,WAAW,GAAG,CAAC;AACnBC,EAAAA,OADmB;AAEnBC,EAAAA,gBAFmB;AAGnBC,EAAAA,cAHmB;AAInBC,EAAAA;AAJmB,CAAD,KAKd;AACJ,QAAMC,WAAW,GAAGD,YAAY,CAACH,OAAD,CAAhC;AAEA,sBACE,2CACGE,cAAc,CAACF,OAAD,CAAd,IAA2BC,gBAA3B,IAA+CD,OADlD,OAC4D,GAD5D,eAEE,wCAAII,WAAW,CAACC,aAAZ,CAA0BD,WAAW,CAACE,WAAtC,CAAJ,CAFF,CADF;AAMD,CAdD;;AAeAP,WAAW,CAACQ,SAAZ,GAAwB;AACtBP,EAAAA,OAAO,EAAEQ,mBAAUC,MAAV,CAAiBC,UADJ;AAEtBT,EAAAA,gBAAgB,EAAEO,mBAAUC,MAFN;AAGtBP,EAAAA,cAAc,EAAEM,mBAAUG,KAAV,CAAgB;AA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AUC,MAPO;AAQxB6B,IAAAA,IAAI,EAAE9B,mBAAUC,MARQ;AASxBH,IAAAA,WAAW,EAAEE,mBAAUC,MATC;AAUxBqD,IAAAA,sBAAsB,EAAEtD,mBAAUC;AAVV,GAAhB,CApBY;;AAgCtB;AACAa,EAAAA,WAAW,EAAEd,mBAAUC,MAjCD;;AAkCtB;AACAc,EAAAA,WAAW,EAAEG,mBAAUuC,KAAV,CAAgBG;AAnCP,CAAxB;AAsCApD,WAAW,CAACF,YAAZ,GAA2B;AACzBG,EAAAA,SAAS,EAAE,IADc;AAEzBC,EAAAA,cAAc,EAAE,SAFS;AAGzBhB,EAAAA,cAAc,EAAE,EAHS;AAIzBkB,EAAAA,cAAc,EAAE,IAJS;AAKzBC,EAAAA,QAAQ,EAAE;AACRsC,IAAAA,EAAE,EAAE,IADI;AAERP,IAAAA,cAAc,EAAE,iBAFR;AAGR;AACAe,IAAAA,yBAAyB,EAAE,IAJnB;AAKRV,IAAAA,MAAM,EAAE,QALA;AAMRD,IAAAA,iBAAiB,EAAE,IANX;AAORD,IAAAA,KAAK,EAAE,cAPC;AAQRjB,IAAAA,IAAI,EAAE,MARE;AASRhC,IAAAA,WAAW,EAAE,cATL;AAURwD,IAAAA,sBAAsB,EAAE;AAVhB,GALe;AAiBzBxC,EAAAA,WAAW,EAAE,WAjBY;AAkBzBC,EAAAA,WAAW,EAAE;AAlBY,CAA3B;eAqBeP,W,EAEf","sourcesContent":["import coreUtils from \"@opentripplanner/core-utils\";\nimport moment from \"moment\";\nimport PropTypes from \"prop-types\";\nimport React from \"react\";\nimport { CalendarAlt } from \"@styled-icons/fa-solid/CalendarAlt\";\nimport { Heartbeat } from \"@styled-icons/fa-solid/Heartbeat\";\nimport { MoneyBillAlt } from \"@styled-icons/fa-solid/MoneyBillAlt\";\n\nimport * as S from \"./styled\";\nimport TripDetail from \"./trip-detail\";\n\nconst TransitFare = ({\n fareKey,\n fareNameFallback,\n fareKeyNameMap,\n transitFares\n}) => {\n const currentFare = transitFares[fareKey];\n\n return (\n <span>\n {fareKeyNameMap[fareKey] || fareNameFallback || fareKey}:{\" \"}\n <b>{currentFare.centsToString(currentFare.transitFare)}</b>\n </span>\n );\n};\nTransitFare.propTypes = {\n fareKey: PropTypes.string.isRequired,\n fareNameFallback: PropTypes.string,\n fareKeyNameMap: PropTypes.shape({\n [PropTypes.string]: PropTypes.string\n }).isRequired,\n transitFares: PropTypes.shape({\n centsToString: PropTypes.func,\n transitFare: PropTypes.number\n }).isRequired\n};\nTransitFare.defaultProps = {\n fareNameFallback: undefined\n};\n\nfunction TripDetails({\n className,\n defaultFareKey,\n itinerary,\n fareKeyNameMap,\n longDateFormat,\n messages,\n routingType,\n timeOptions\n}) {\n const date = moment(itinerary.startTime);\n messages = coreUtils.messages.mergeMessages(\n TripDetails.defaultProps.messages,\n messages\n );\n\n // process the transit fare\n const {\n maxTNCFare,\n minTNCFare,\n transitFares\n } = coreUtils.itinerary.calculateFares(itinerary, true);\n\n let defaultFare = defaultFareKey;\n if (!transitFares[defaultFareKey]) {\n defaultFare = \"regular\";\n }\n\n let companies;\n itinerary.legs.forEach(leg => {\n if (leg.tncData) {\n companies = leg.tncData.company;\n }\n });\n let fare;\n\n const fareKeys = transitFares && Object.keys(transitFares).sort();\n\n if (transitFares && fareKeys.length > 0) {\n const { dollarsToString } = transitFares[defaultFare];\n // Depending on if there are additional fares to display either render a <span> or a <details>\n const TransitFareWrapper =\n transitFares && fareKeys.length > 1 ? S.TransitFare : S.TransitFareSingle;\n\n fare = (\n <S.Fare>\n <TransitFareWrapper>\n <summary style={{ display: fareKeys.length > 1 ? \"list-item\" : \"\" }}>\n <TransitFare\n fareNameFallback={messages.transitFare}\n fareKey={defaultFare}\n fareKeyNameMap={fareKeyNameMap}\n transitFares={transitFares}\n />\n </summary>\n {fareKeys.map(fareKey => {\n // Don't show the default fare twice!\n if (fareKey === defaultFare) {\n return null;\n }\n return (\n <TransitFare\n fareKey={fareKey}\n key={fareKey}\n fareKeyNameMap={fareKeyNameMap}\n transitFares={transitFares}\n />\n );\n })}\n </TransitFareWrapper>\n {minTNCFare !== 0 && (\n <S.TNCFare>\n <br />\n <S.TNCFareCompanies>\n {companies.toLowerCase()}\n </S.TNCFareCompanies>{\" \"}\n {messages.fare}:{\" \"}\n <b>\n {dollarsToString(minTNCFare)} - {dollarsToString(maxTNCFare)}\n </b>\n </S.TNCFare>\n )}\n </S.Fare>\n );\n }\n\n // Compute calories burned.\n const {\n bikeDuration,\n caloriesBurned,\n walkDuration\n } = coreUtils.itinerary.calculatePhysicalActivity(itinerary);\n\n return (\n <S.TripDetails className={className}>\n <S.TripDetailsHeader>{messages.title}</S.TripDetailsHeader>\n <S.TripDetailsBody>\n <TripDetail\n description={messages.departDescription}\n icon={<CalendarAlt size={17} />}\n summary={\n <S.Timing>\n <span>\n {messages.depart} <b>{date.format(longDateFormat)}</b>\n </span>\n {routingType === \"ITINERARY\" && (\n <span>\n {\" \"}\n {messages.at}{\" \"}\n <b>\n {coreUtils.time.formatTime(\n itinerary.startTime,\n timeOptions\n )}\n </b>\n </span>\n )}\n </S.Timing>\n }\n />\n {fare && (\n <TripDetail\n description={messages.transitFareDescription}\n icon={<MoneyBillAlt size={17} />}\n summary={fare}\n />\n )}\n {caloriesBurned > 0 && (\n <TripDetail\n icon={<Heartbeat size={17} />}\n summary={\n <S.CaloriesSummary>\n {messages.caloriesBurned}: <b>{Math.round(caloriesBurned)}</b>\n </S.CaloriesSummary>\n }\n description={\n <S.CaloriesDescription>\n Calories burned is based on{\" \"}\n <b>{Math.round(walkDuration / 60)} minute(s)</b> spent walking\n and <b>{Math.round(bikeDuration / 60)} minute(s)</b> spent\n biking during this trip. Adapted from{\" \"}\n <a\n href=\"https://health.gov/dietaryguidelines/dga2005/document/html/chapter3.htm#table4\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n Dietary Guidelines for Americans 2005, page 16, Table 4\n </a>\n .\n </S.CaloriesDescription>\n }\n />\n )}\n </S.TripDetailsBody>\n </S.TripDetails>\n );\n}\n\nTripDetails.propTypes = {\n /** Used for additional styling with styled components for example. */\n className: PropTypes.string,\n /** Determines which transit fare should be displayed by default, should there be multiple transit fare types */\n defaultFareKey: PropTypes.string,\n /** Itinerary that the user has selected to view, contains multiple legs */\n itinerary: coreUtils.types.itineraryType.isRequired,\n /** Mapping between fare keys and human-readable names for them */\n fareKeyNameMap: PropTypes.shape({\n [PropTypes.string]: PropTypes.string\n }),\n /** the desired format to use for a long date */\n longDateFormat: PropTypes.string,\n /**\n * messages to use for l10n/i8n\n *\n * Note: messages with default null values included here for visibility.\n * Overriding with a truthy string value will cause the expandable help\n * message to appear in trip details.\n */\n messages: PropTypes.shape({\n at: PropTypes.string,\n caloriesBurned: PropTypes.string,\n // FIXME: Add templated string description.\n caloriesBurnedDescription: PropTypes.string,\n depart: PropTypes.string,\n departDescription: PropTypes.string,\n title: PropTypes.string,\n fare: PropTypes.string,\n transitFare: PropTypes.string,\n transitFareDescription: PropTypes.string\n }),\n /** whether the routing type is an itinerary or a profile result */\n routingType: PropTypes.string,\n /** Contains the preferred format string for time display and a timezone offset */\n timeOptions: coreUtils.types.timeOptionsType\n};\n\nTripDetails.defaultProps = {\n className: null,\n defaultFareKey: \"regular\",\n fareKeyNameMap: {},\n longDateFormat: null,\n messages: {\n at: \"at\",\n caloriesBurned: \"Calories Burned\",\n // FIXME: Add templated string description.\n caloriesBurnedDescription: null,\n depart: \"Depart\",\n departDescription: null,\n title: \"Trip Details\",\n fare: \"Fare\",\n transitFare: \"Transit Fare\",\n transitFareDescription: null\n },\n routingType: \"ITINERARY\",\n timeOptions: null\n};\n\nexport default TripDetails;\n\n// Rename styled components for export\nexport { S as Styled };\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.tsx"],"names":["defaultMessages","defaultEnglishMessages","boldText","contents","renderFare","currencyCode","fare","dietaryLink","getFlexMessageValues","info","hasLeadTime","coreUtils","itinerary","isAdvanceBookingRequired","hasPhone","contactInfo","phoneNumber","leadDays","latestBookingTime","daysPrior","DefaultCaloriesDetails","bikeSeconds","calories","walkSeconds","bikeMinutes","Math","round","strong","walkMinutes","TransitFare","fareKey","fareNameFallback","fareKeyNameMap","transitFares","currentFare","name","value","currency","cents","TripDetails","CaloriesDetails","className","DepartureDetails","defaultFareKey","FareDetails","fareResult","calculateTncFares","maxTNCFare","minTNCFare","tncCurrencyCode","companies","legs","forEach","leg","tncData","company","fareKeys","Object","keys","sort","length","defaultFare","TransitFareWrapper","S","TransitFareSingle","display","map","toLowerCase","departureDate","Date","startTime","bikeDuration","caloriesBurned","walkDuration","calculatePhysicalActivity","containsFlex","some","isFlex","pickupBookingInfo","filter","dropOffBookingInfo","pickupMessage","dropOffMessage"],"mappings":";;;;;;;;;;AAAA;;AAGA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;AACA;;AASA;;;;;;AAvBA;AACA;AAqBA;AAGA;AACA;AACA;AACA;AACA,MAAMA,eAAuC,GAAG,mBAAQC,aAAR,CAAhD;AAEA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAkBC,QAAlB,EAAwD;AACtD,sBAAO,6CAASA,QAAT,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,UAAT,CAAoBC,YAApB,EAA0CC,IAA1C,EAAsE;AACpE,sBACE,6BAAC,0BAAD;AACE,IAAA,QAAQ,EAAED,YADZ,CAEE;AACA;AACA;AAJF;AAKE,IAAA,eAAe,EAAC,cALlB;AAME,IAAA,KAAK,EAAEC,IANT,CAOE;AAPF;AAQE,IAAA,KAAK,EAAC;AARR,IADF;AAYD;AAED;AACA;AACA;;;AACA,SAASC,WAAT,CAAqBJ,QAArB,EAA2D;AACzD,sBACE;AACE,IAAA,IAAI,EAAC,gFADP;AAEE,IAAA,GAAG,EAAC,qBAFN;AAGE,IAAA,MAAM,EAAC;AAHT,KAKGA,QALH,CADF;AASD;AAED;AACA;AACA;;;AACA,SAASK,oBAAT,CAA8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,IACjBA,kBAAkB,CAACd,GAAnB,CAAuBzD,IAAI,iBACzB,6BAAC,mBAAD;AACE,IAAA,WAAW,EAAEA,IAAI,CAACyE,cADpB;AAEE,IAAA,IAAI,EACFvE,mBAAUC,SAAV,CAAoBC,wBAApB,CAA6CJ,IAA7C,iBACE,6BAAC,wBAAD;AAAa,MAAA,IAAI,EAAE;AAAnB,MADF,gBAGE,6BAAC,oBAAD;AAAW,MAAA,IAAI,EAAE;AAAjB,MANN;AASE,IAAA,GAAG,EAAEA,IAAI,CAACyE,cATZ;AAUE,IAAA,OAAO,eACL,6BAAC,CAAD,CAAG,kBAAH,qBACE,6BAAC,2BAAD;AACE,MAAA,cAAc,EACZlF,eAAe,CAAC,sCAAD,CAFnB;AAIE,MAAA,WAAW,EAAC,oEAJd;AAKE,MAAA,EAAE,EAAC,sCALL;AAME,MAAA,MAAM,EAAEQ,oBAAoB,CAACC,IAAD;AAN9B,MADF;AAXJ,IADF,CAvGJ,CARF,CADF;AA4ID;;eAEc8B,W,EAEf","sourcesContent":["import flatten from \"flat\";\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore FIXME: Create TypeScript types for core-utils packages.\nimport coreUtils from \"@opentripplanner/core-utils\";\nimport { FlexBookingInfo } from \"@opentripplanner/types\";\nimport React, { ReactElement } from \"react\";\nimport { FormattedMessage, FormattedNumber } from \"react-intl\";\nimport { CalendarAlt } from \"@styled-icons/fa-solid/CalendarAlt\";\nimport { HandPaper } from \"@styled-icons/fa-solid/HandPaper\";\nimport { Heartbeat } from \"@styled-icons/fa-solid/Heartbeat\";\nimport { MoneyBillAlt } from \"@styled-icons/fa-solid/MoneyBillAlt\";\nimport { PhoneVolume } from \"@styled-icons/fa-solid/PhoneVolume\";\nimport { Route } from \"@styled-icons/fa-solid/Route\";\n\nimport * as S from \"./styled\";\nimport TripDetail from \"./trip-detail\";\n\nimport {\n CaloriesDetailsProps,\n TransitFareProps,\n TripDetailsProps\n} from \"./types\";\n\n// Load the default messages.\nimport defaultEnglishMessages from \"../i18n/en-US.yml\";\n\n// HACK: We should flatten the messages loaded above because\n// the YAML loaders behave differently between webpack and our version of jest:\n// - the yaml loader for webpack returns a nested object,\n// - the yaml loader for jest returns messages with flattened ids.\nconst defaultMessages: Record<string, string> = flatten(defaultEnglishMessages);\n\n/**\n * Format text bold (used with FormattedMessage).\n */\n// TODO: Find a better place for this utility.\nfunction boldText(contents: ReactElement): 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 */\nfunction 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\n/**\n * Helper function to specify the link to dietary table.\n */\nfunction dietaryLink(contents: ReactElement): ReactElement {\n return (\n <a\n href=\"https://health.gov/dietaryguidelines/dga2005/document/html/chapter3.htm#table4\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n {contents}\n </a>\n );\n}\n\n/**\n * Helper function that assembles values for flex pickup/dropoff messages.\n */\nfunction getFlexMessageValues(info: FlexBookingInfo) {\n return {\n hasLeadTime: coreUtils.itinerary.isAdvanceBookingRequired(info),\n hasPhone: !!info?.contactInfo?.phoneNumber,\n leadDays: info.latestBookingTime.daysPrior,\n phoneNumber: info?.contactInfo?.phoneNumber\n };\n}\n\n/**\n * Default rendering if no component is provided for the CaloriesDetails\n * slot in the TripDetails component.\n */\nfunction DefaultCaloriesDetails({\n bikeSeconds,\n calories,\n walkSeconds\n}: CaloriesDetailsProps): ReactElement {\n return (\n <FormattedMessage\n defaultMessage={defaultMessages[\"otpUi.TripDetails.caloriesDescription\"]}\n description=\"Text describing how the calories relate to the walking and biking duration of a trip.\"\n id=\"otpUi.TripDetails.caloriesDescription\"\n values={{\n bikeMinutes: Math.round(bikeSeconds / 60),\n calories: Math.round(calories),\n dietaryLink,\n strong: boldText,\n walkMinutes: Math.round(walkSeconds / 60)\n }}\n />\n );\n}\n\n/**\n * Helper component that renders a transit fare entry.\n */\nconst TransitFare = ({\n fareKey,\n fareNameFallback,\n fareKeyNameMap,\n transitFares\n}: TransitFareProps): ReactElement => {\n const currentFare = transitFares[fareKey];\n\n return (\n <span>\n <FormattedMessage\n defaultMessage={defaultMessages[\"otpUi.TripDetails.transitFareEntry\"]}\n description=\"Text showing the price of tickets on public transportation.\"\n id=\"otpUi.TripDetails.transitFareEntry\"\n values={{\n name: fareKeyNameMap[fareKey] || fareNameFallback || fareKey,\n strong: boldText,\n value: renderFare(\n currentFare.currency.currencyCode,\n currentFare.cents / 100\n )\n }}\n />\n </span>\n );\n};\n\n/**\n * Renders trip details such as departure instructions, fare amount, and calories spent.\n */\nexport function TripDetails({\n CaloriesDetails = DefaultCaloriesDetails,\n className = \"\",\n DepartureDetails = null,\n defaultFareKey = \"regular\",\n FareDetails = null,\n fareKeyNameMap = {},\n itinerary\n}: TripDetailsProps): ReactElement {\n // process the transit fare\n const fareResult = coreUtils.itinerary.calculateTncFares(itinerary);\n const { maxTNCFare, minTNCFare, tncCurrencyCode } = fareResult;\n const transitFares = itinerary?.fare?.fare;\n\n let companies = \"\";\n itinerary.legs.forEach(leg => {\n if (leg.tncData) {\n companies = leg.tncData.company;\n }\n });\n let fare;\n\n const fareKeys = transitFares && Object.keys(transitFares).sort();\n\n if (transitFares && fareKeys.length > 0) {\n let defaultFare = defaultFareKey;\n if (!transitFares[defaultFareKey]) {\n defaultFare = \"regular\";\n }\n\n // Depending on if there are additional fares to display either render a <span> or a <details>\n const TransitFareWrapper =\n transitFares && fareKeys.length > 1 ? S.TransitFare : S.TransitFareSingle;\n\n fare = (\n <S.Fare>\n <TransitFareWrapper>\n <summary style={{ display: fareKeys.length > 1 ? \"list-item\" : \"\" }}>\n <TransitFare\n fareNameFallback={\n <FormattedMessage\n defaultMessage={\n defaultMessages[\"otpUi.TripDetails.transitFare\"]\n }\n description=\"Text showing the price of tickets on public transportation.\"\n id=\"otpUi.TripDetails.transitFare\"\n />\n }\n fareKey={defaultFare}\n fareKeyNameMap={fareKeyNameMap}\n transitFares={transitFares}\n />\n </summary>\n {fareKeys.map(fareKey => {\n // Don't show the default fare twice!\n if (fareKey === defaultFare) {\n return null;\n }\n return (\n <TransitFare\n fareKey={fareKey}\n key={fareKey}\n fareKeyNameMap={fareKeyNameMap}\n transitFares={transitFares}\n />\n );\n })}\n </TransitFareWrapper>\n {minTNCFare !== 0 && (\n <S.TNCFare>\n <br />\n <FormattedMessage\n defaultMessage={defaultMessages[\"otpUi.TripDetails.tncFare\"]}\n description=\"Text showing the price paid to transportation network companies.\"\n id=\"otpUi.TripDetails.tncFare\"\n values={{\n companies: (\n // S.TNCFareCompanies capitalizes the TNC company ID (e.g. \"COMPANY\")\n // after it is converted to lowercase, so it renders as \"Company\".\n <S.TNCFareCompanies>\n {companies.toLowerCase()}\n </S.TNCFareCompanies>\n ),\n maxTNCFare: renderFare(tncCurrencyCode, maxTNCFare),\n minTNCFare: renderFare(tncCurrencyCode, minTNCFare),\n strong: boldText\n }}\n />\n </S.TNCFare>\n )}\n </S.Fare>\n );\n }\n\n const departureDate = new Date(itinerary.startTime);\n\n // Compute calories burned.\n const {\n bikeDuration,\n caloriesBurned,\n walkDuration\n } = coreUtils.itinerary.calculatePhysicalActivity(itinerary);\n\n // Parse flex info and generate appropriate strings\n const containsFlex = itinerary.legs.some(coreUtils.itinerary.isFlex);\n const pickupBookingInfo = itinerary.legs\n .map(leg => leg.pickupBookingInfo)\n .filter(info => !!info);\n const dropOffBookingInfo = itinerary.legs\n .map(leg => leg.dropOffBookingInfo)\n .filter(info => !!info);\n\n return (\n <S.TripDetails className={className}>\n <S.TripDetailsHeader>\n <FormattedMessage\n defaultMessage={defaultMessages[\"otpUi.TripDetails.title\"]}\n description=\"Title (heading) text of the component.\"\n id=\"otpUi.TripDetails.title\"\n />\n </S.TripDetailsHeader>\n <S.TripDetailsBody>\n <TripDetail\n // Any custom description for the Departure message needs to be handled by the slot.\n description={\n DepartureDetails && (\n <DepartureDetails departureDate={departureDate} />\n )\n }\n icon={<CalendarAlt size={17} />}\n summary={\n <S.Timing>\n <FormattedMessage\n defaultMessage={defaultMessages[\"otpUi.TripDetails.departure\"]}\n description=\"Text showing the departure date/time for a trip.\"\n id=\"otpUi.TripDetails.departure\"\n values={{\n departureDate,\n strong: boldText\n }}\n />\n </S.Timing>\n }\n />\n {fare && (\n <TripDetail\n // Any custom description for the transit fare needs to be handled by the slot.\n description={\n FareDetails && (\n <FareDetails\n maxTNCFare={maxTNCFare}\n minTNCFare={minTNCFare}\n transitFares={transitFares}\n />\n )\n }\n icon={<MoneyBillAlt size={17} />}\n summary={fare}\n />\n )}\n {caloriesBurned > 0 && (\n <TripDetail\n icon={<Heartbeat size={17} />}\n summary={\n <S.CaloriesSummary>\n <FormattedMessage\n defaultMessage={defaultMessages[\"otpUi.TripDetails.calories\"]}\n description=\"Text showing the number of calories for the walking and biking legs of a trip.\"\n id=\"otpUi.TripDetails.calories\"\n values={{\n calories: caloriesBurned,\n strong: boldText\n }}\n />\n </S.CaloriesSummary>\n }\n description={\n CaloriesDetails && (\n <CaloriesDetails\n bikeSeconds={bikeDuration}\n calories={caloriesBurned}\n walkSeconds={walkDuration}\n />\n )\n }\n />\n )}\n {containsFlex && (\n <TripDetail\n summary={\n <S.FlexSummary>\n <FormattedMessage\n defaultMessage={\n defaultMessages[\"otpUi.TripDetails.tripIncludesFlex\"]\n }\n description=\"Text stating that portions of the trip include a flex (on-demand) transit service.\"\n id=\"otpUi.TripDetails.tripIncludesFlex\"\n />\n </S.FlexSummary>\n }\n icon={<Route size={17} />}\n />\n )}\n {pickupBookingInfo &&\n pickupBookingInfo.map(info => (\n <TripDetail\n key={info.pickupMessage}\n icon={<PhoneVolume size={17} />}\n summary={\n <S.FlexPickupSummary>\n <FormattedMessage\n defaultMessage={\n defaultMessages[\"otpUi.TripDetails.flexPickupMessage\"]\n }\n description=\"Instructions for booking and boarding the flex (on-demand) transit service.\"\n id=\"otpUi.TripDetails.flexPickupMessage\"\n values={getFlexMessageValues(info)}\n />\n </S.FlexPickupSummary>\n }\n description={info.pickupMessage}\n />\n ))}\n {dropOffBookingInfo &&\n dropOffBookingInfo.map(info => (\n <TripDetail\n description={info.dropOffMessage}\n icon={\n coreUtils.itinerary.isAdvanceBookingRequired(info) ? (\n <PhoneVolume size={17} />\n ) : (\n <HandPaper size={17} />\n )\n }\n key={info.dropOffMessage}\n summary={\n <S.FlexDropOffSummary>\n <FormattedMessage\n defaultMessage={\n defaultMessages[\"otpUi.TripDetails.flexDropOffMessage\"]\n }\n description=\"Instructions for getting off the flex (on-demand) transit service.\"\n id=\"otpUi.TripDetails.flexDropOffMessage\"\n values={getFlexMessageValues(info)}\n />\n </S.FlexDropOffSummary>\n }\n />\n ))}\n </S.TripDetailsBody>\n </S.TripDetails>\n );\n}\n\nexport default TripDetails;\n\n// Rename styled components for export\nexport { S as Styled };\n"],"file":"index.js"}
@@ -0,0 +1,23 @@
1
+ export declare const CaloriesDescription: import("styled-components").StyledComponent<"span", any, {}, never>;
2
+ export declare const CaloriesSummary: import("styled-components").StyledComponent<"span", any, {}, never>;
3
+ export declare const ExpandButton: import("styled-components").StyledComponent<"button", any, {
4
+ "aria-label": "What does this mean?";
5
+ }, "aria-label">;
6
+ export declare const Fare: import("styled-components").StyledComponent<"span", any, {}, never>;
7
+ export declare const HideButton: import("styled-components").StyledComponent<"button", any, {}, never>;
8
+ export declare const TNCFare: import("styled-components").StyledComponent<"span", any, {}, never>;
9
+ export declare const TNCFareCompanies: import("styled-components").StyledComponent<"span", any, {}, never>;
10
+ export declare const Timing: import("styled-components").StyledComponent<"span", any, {}, never>;
11
+ export declare const TransitFare: import("styled-components").StyledComponent<"details", any, {}, never>;
12
+ export declare const TransitFareSingle: import("styled-components").StyledComponent<"span", any, {}, never>;
13
+ export declare const FlexSummary: import("styled-components").StyledComponent<"span", any, {}, never>;
14
+ export declare const FlexPickupSummary: import("styled-components").StyledComponent<"span", any, {}, never>;
15
+ export declare const FlexDropOffSummary: import("styled-components").StyledComponent<"span", any, {}, never>;
16
+ export declare const TripDetail: import("styled-components").StyledComponent<"div", any, {}, never>;
17
+ export declare const TripDetailDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
18
+ export declare const TripDetailIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
19
+ export declare const TripDetails: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ export declare const TripDetailsBody: import("styled-components").StyledComponent<"div", any, {}, never>;
21
+ export declare const TripDetailsHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
22
+ export declare const TripDetailSummary: import("styled-components").StyledComponent<"div", any, {}, never>;
23
+ //# sourceMappingURL=styled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,qEAAgB,CAAC;AAEjD,eAAO,MAAM,eAAe,qEAAgB,CAAC;AAE7C,eAAO,MAAM,YAAY;;gBAOxB,CAAC;AAEF,eAAO,MAAM,IAAI,qEAAgB,CAAC;AAElC,eAAO,MAAM,UAAU,uEAEtB,CAAC;AAEF,eAAO,MAAM,OAAO,qEAAgB,CAAC;AAErC,eAAO,MAAM,gBAAgB,qEAE5B,CAAC;AAEF,eAAO,MAAM,MAAM,qEAAgB,CAAC;AAEpC,eAAO,MAAM,WAAW,wEASvB,CAAC;AACF,eAAO,MAAM,iBAAiB,qEAAgB,CAAC;AAE/C,eAAO,MAAM,WAAW,qEAAgB,CAAC;AAEzC,eAAO,MAAM,iBAAiB,qEAAgB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,qEAAgB,CAAC;AAEhD,eAAO,MAAM,UAAU,oEAEtB,CAAC;AAEF,eAAO,MAAM,qBAAqB,oEAMjC,CAAC;AAEF,eAAO,MAAM,cAAc,oEAG1B,CAAC;AAEF,eAAO,MAAM,WAAW,oEAMvB,CAAC;AAEF,eAAO,MAAM,eAAe,oEAAe,CAAC;AAE5C,eAAO,MAAM,iBAAiB,oEAG7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,oEAK7B,CAAC"}
package/lib/styled.js CHANGED
@@ -5,25 +5,25 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.TripDetailSummary = exports.TripDetailsHeader = exports.TripDetailsBody = exports.TripDetails = exports.TripDetailIcon = exports.TripDetailDescription = exports.TripDetail = exports.TransitFareSingle = exports.TransitFare = exports.Timing = exports.TNCFareCompanies = exports.TNCFare = exports.HideButton = exports.Fare = exports.ExpandButton = exports.CaloriesSummary = exports.CaloriesDescription = void 0;
8
+ exports.TripDetailSummary = exports.TripDetailsHeader = exports.TripDetailsBody = exports.TripDetails = exports.TripDetailIcon = exports.TripDetailDescription = exports.TripDetail = exports.FlexDropOffSummary = exports.FlexPickupSummary = exports.FlexSummary = exports.TransitFareSingle = exports.TransitFare = exports.Timing = exports.TNCFareCompanies = exports.TNCFare = exports.HideButton = exports.Fare = exports.ExpandButton = exports.CaloriesSummary = exports.CaloriesDescription = void 0;
9
9
 
10
10
  var _styledComponents = _interopRequireDefault(require("styled-components"));
11
11
 
12
12
  const BaseButton = _styledComponents.default.button.withConfig({
13
13
  displayName: "styled__BaseButton",
14
- componentId: "sr23bt-0"
14
+ componentId: "sc-6q2ok2-0"
15
15
  })(["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;"]);
16
16
 
17
17
  const CaloriesDescription = _styledComponents.default.span.withConfig({
18
18
  displayName: "styled__CaloriesDescription",
19
- componentId: "sr23bt-1"
19
+ componentId: "sc-6q2ok2-1"
20
20
  })([""]);
21
21
 
22
22
  exports.CaloriesDescription = CaloriesDescription;
23
23
 
24
24
  const CaloriesSummary = _styledComponents.default.span.withConfig({
25
25
  displayName: "styled__CaloriesSummary",
26
- componentId: "sr23bt-2"
26
+ componentId: "sc-6q2ok2-2"
27
27
  })([""]);
28
28
 
29
29
  exports.CaloriesSummary = CaloriesSummary;
@@ -31,102 +31,123 @@ const ExpandButton = (0, _styledComponents.default)(BaseButton).attrs({
31
31
  "aria-label": "What does this mean?"
32
32
  }).withConfig({
33
33
  displayName: "styled__ExpandButton",
34
- componentId: "sr23bt-3"
34
+ componentId: "sc-6q2ok2-3"
35
35
  })(["color:#00f;font-size:16px;margin-left:6px;margin-top:-2px;"]);
36
36
  exports.ExpandButton = ExpandButton;
37
37
 
38
38
  const Fare = _styledComponents.default.span.withConfig({
39
39
  displayName: "styled__Fare",
40
- componentId: "sr23bt-4"
40
+ componentId: "sc-6q2ok2-4"
41
41
  })([""]);
42
42
 
43
43
  exports.Fare = Fare;
44
44
  const HideButton = (0, _styledComponents.default)(BaseButton).withConfig({
45
45
  displayName: "styled__HideButton",
46
- componentId: "sr23bt-5"
46
+ componentId: "sc-6q2ok2-5"
47
47
  })(["float:right;"]);
48
48
  exports.HideButton = HideButton;
49
49
 
50
50
  const TNCFare = _styledComponents.default.span.withConfig({
51
51
  displayName: "styled__TNCFare",
52
- componentId: "sr23bt-6"
52
+ componentId: "sc-6q2ok2-6"
53
53
  })([""]);
54
54
 
55
55
  exports.TNCFare = TNCFare;
56
56
 
57
57
  const TNCFareCompanies = _styledComponents.default.span.withConfig({
58
58
  displayName: "styled__TNCFareCompanies",
59
- componentId: "sr23bt-7"
59
+ componentId: "sc-6q2ok2-7"
60
60
  })(["text-transform:capitalize;"]);
61
61
 
62
62
  exports.TNCFareCompanies = TNCFareCompanies;
63
63
 
64
64
  const Timing = _styledComponents.default.span.withConfig({
65
65
  displayName: "styled__Timing",
66
- componentId: "sr23bt-8"
66
+ componentId: "sc-6q2ok2-8"
67
67
  })([""]);
68
68
 
69
69
  exports.Timing = Timing;
70
70
 
71
71
  const TransitFare = _styledComponents.default.details.withConfig({
72
72
  displayName: "styled__TransitFare",
73
- componentId: "sr23bt-9"
73
+ componentId: "sc-6q2ok2-9"
74
74
  })(["display:inline-block;> span{display:block;padding-left:1.75ch;}"]);
75
75
 
76
76
  exports.TransitFare = TransitFare;
77
77
 
78
78
  const TransitFareSingle = _styledComponents.default.span.withConfig({
79
79
  displayName: "styled__TransitFareSingle",
80
- componentId: "sr23bt-10"
80
+ componentId: "sc-6q2ok2-10"
81
81
  })([""]);
82
82
 
83
83
  exports.TransitFareSingle = TransitFareSingle;
84
84
 
85
+ const FlexSummary = _styledComponents.default.span.withConfig({
86
+ displayName: "styled__FlexSummary",
87
+ componentId: "sc-6q2ok2-11"
88
+ })([""]);
89
+
90
+ exports.FlexSummary = FlexSummary;
91
+
92
+ const FlexPickupSummary = _styledComponents.default.span.withConfig({
93
+ displayName: "styled__FlexPickupSummary",
94
+ componentId: "sc-6q2ok2-12"
95
+ })([""]);
96
+
97
+ exports.FlexPickupSummary = FlexPickupSummary;
98
+
99
+ const FlexDropOffSummary = _styledComponents.default.span.withConfig({
100
+ displayName: "styled__FlexDropOffSummary",
101
+ componentId: "sc-6q2ok2-13"
102
+ })([""]);
103
+
104
+ exports.FlexDropOffSummary = FlexDropOffSummary;
105
+
85
106
  const TripDetail = _styledComponents.default.div.withConfig({
86
107
  displayName: "styled__TripDetail",
87
- componentId: "sr23bt-11"
108
+ componentId: "sc-6q2ok2-14"
88
109
  })(["margin-top:6px;"]);
89
110
 
90
111
  exports.TripDetail = TripDetail;
91
112
 
92
113
  const TripDetailDescription = _styledComponents.default.div.withConfig({
93
114
  displayName: "styled__TripDetailDescription",
94
- componentId: "sr23bt-12"
115
+ componentId: "sc-6q2ok2-15"
95
116
  })(["background-color:#fff;border:1px solid #888;font-size:12px;margin-top:2px;padding:8px;"]);
96
117
 
97
118
  exports.TripDetailDescription = TripDetailDescription;
98
119
 
99
120
  const TripDetailIcon = _styledComponents.default.div.withConfig({
100
121
  displayName: "styled__TripDetailIcon",
101
- componentId: "sr23bt-13"
122
+ componentId: "sc-6q2ok2-16"
102
123
  })(["float:left;font-size:17px;"]);
103
124
 
104
125
  exports.TripDetailIcon = TripDetailIcon;
105
126
 
106
127
  const TripDetails = _styledComponents.default.div.withConfig({
107
128
  displayName: "styled__TripDetails",
108
- componentId: "sr23bt-14"
129
+ componentId: "sc-6q2ok2-17"
109
130
  })(["background-color:#eee;border-radius:6px;margin-bottom:15px;margin-top:16px;padding:10px 16px;"]);
110
131
 
111
132
  exports.TripDetails = TripDetails;
112
133
 
113
134
  const TripDetailsBody = _styledComponents.default.div.withConfig({
114
135
  displayName: "styled__TripDetailsBody",
115
- componentId: "sr23bt-15"
136
+ componentId: "sc-6q2ok2-18"
116
137
  })([""]);
117
138
 
118
139
  exports.TripDetailsBody = TripDetailsBody;
119
140
 
120
141
  const TripDetailsHeader = _styledComponents.default.div.withConfig({
121
142
  displayName: "styled__TripDetailsHeader",
122
- componentId: "sr23bt-16"
143
+ componentId: "sc-6q2ok2-19"
123
144
  })(["font-size:18px;font-weight:600;"]);
124
145
 
125
146
  exports.TripDetailsHeader = TripDetailsHeader;
126
147
 
127
148
  const TripDetailSummary = _styledComponents.default.div.withConfig({
128
149
  displayName: "styled__TripDetailSummary",
129
- componentId: "sr23bt-17"
150
+ componentId: "sc-6q2ok2-20"
130
151
  })(["margin-left:28px;padding-top:2px;display:flex;align-items:baseline;"]);
131
152
 
132
153
  exports.TripDetailSummary = TripDetailSummary;
package/lib/styled.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/styled.js"],"names":["BaseButton","styled","button","CaloriesDescription","span","CaloriesSummary","ExpandButton","attrs","Fare","HideButton","TNCFare","TNCFareCompanies","Timing","TransitFare","details","Transit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,MAAMI,eAAe,GAAGpB,0BAAOgB,GAAV;AAAA;AAAA;AAAA,QAArB;;;;AAEA,MAAMK,iBAAiB,GAAGrB,0BAAOgB,GAAV;AAAA;AAAA;AAAA,uCAAvB;;;;AAKA,MAAMM,iBAAiB,GAAGtB,0BAAOgB,GAAV;AAAA;AAAA;AAAA,2EAAvB","sourcesContent":["import styled from \"styled-components\";\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 CaloriesDescription = styled.span``;\n\nexport const CaloriesSummary = styled.span``;\n\nexport const ExpandButton = styled(BaseButton).attrs({\n \"aria-label\": \"What does this mean?\"\n})`\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 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`;\n\nexport const TripDetailsBody = styled.div``;\n\nexport const TripDetailsHeader = styled.div`\n font-size: 18px;\n font-weight: 600;\n`;\n\nexport const TripDetailSummary = styled.div`\n margin-left: 28px;\n padding-top: 2px;\n display: flex;\n align-items: baseline;\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../src/styled.ts"],"names":["BaseButton","styled","button","CaloriesDescription","span","CaloriesSummary","ExpandButton","attrs","Fare","HideButton","TNCFare","TNCFareCompanies","Timing","TransitFare","details","TransitFareSingle","FlexSummary","FlexPickupSummary","FlexDropOffSummary","TripDetail","div","TripDetailDescription","TripDetailIcon","TripDetails","TripDetailsBody","TripDetailsHeader","TripDetailSummary"],"mappings":";;;;;;;;;AAAA;;AAEA,MAAMA,UAAU,GAAGC,0BAAOC,MAAV;AAAA;AAAA;AAAA,8PAAhB;;AAiBO,MAAMC,mBAAmB,GAAGF,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAzB;;;;AAEA,MAAMC,eAAe,GAAGJ,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAArB;;;AAEA,MAAME,YAAY,GAAG,+BAAON,UAAP,EAAmBO,KAAnB,CAAyB;AACnD,gBAAc;AADqC,CAAzB,CAAH;AAAA;AAAA;AAAA,kEAAlB;;;AASA,MAAMC,IAAI,GAAGP,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAV;;;AAEA,MAAMK,UAAU,GAAG,+BAAOT,UAAP,CAAH;AAAA;AAAA;AAAA,oBAAhB;;;AAIA,MAAMU,OAAO,GAAGT,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAb;;;;AAEA,MAAMO,gBAAgB,GAAGV,0BAAOG,IAAV;AAAA;AAAA;AAAA,kCAAtB;;;;AAIA,MAAMQ,MAAM,GAAGX,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAZ;;;;AAEA,MAAMS,WAAW,GAAGZ,0BAAOa,OAAV;AAAA;AAAA;AAAA,uEAAjB;;;;AAUA,MAAMC,iBAAiB,GAAGd,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAvB;;;;AAEA,MAAMY,WAAW,GAAGf,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAjB;;;;AAEA,MAAMa,iBAAiB,GAAGhB,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAvB;;;;AAEA,MAAMc,kBAAkB,GAAGjB,0BAAOG,IAAV;AAAA;AAAA;AAAA,QAAxB;;;;AAEA,MAAMe,UAAU,GAAGlB,0BAAOmB,GAAV;AAAA;AAAA;AAAA,uBAAhB;;;;AAIA,MAAMC,qBAAqB,GAAGpB,0BAAOmB,GAAV;AAAA;AAAA;AAAA,8FAA3B;;;;AAQA,MAAME,cAAc,GAAGrB,0BAAOmB,GAAV;AAAA;AAAA;AAAA,kCAApB;;;;AAKA,MAAMG,WAAW,GAAGtB,0BAAOmB,GAAV;AAAA;AAAA;AAAA,qGAAjB;;;;AAQA,MAAMI,eAAe,GAAGvB,0BAAOmB,GAAV;AAAA;AAAA;AAAA,QAArB;;;;AAEA,MAAMK,iBAAiB,GAAGxB,0BAAOmB,GAAV;AAAA;AAAA;AAAA,uCAAvB;;;;AAKA,MAAMM,iBAAiB,GAAGzB,0BAAOmB,GAAV;AAAA;AAAA;AAAA,2EAAvB","sourcesContent":["import styled from \"styled-components\";\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 CaloriesDescription = styled.span``;\n\nexport const CaloriesSummary = styled.span``;\n\nexport const ExpandButton = styled(BaseButton).attrs({\n \"aria-label\": \"What does this mean?\"\n})`\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 FlexPickupSummary = styled.span``;\n\nexport const FlexDropOffSummary = 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`;\n\nexport const TripDetailsBody = styled.div``;\n\nexport const TripDetailsHeader = styled.div`\n font-size: 18px;\n font-weight: 600;\n`;\n\nexport const TripDetailSummary = styled.div`\n margin-left: 28px;\n padding-top: 2px;\n display: flex;\n align-items: baseline;\n`;\n"],"file":"styled.js"}
@@ -0,0 +1,18 @@
1
+ import { Component, ReactElement } from "react";
2
+ declare type Props = {
3
+ description?: ReactElement | string;
4
+ icon: ReactElement;
5
+ summary: ReactElement | string;
6
+ };
7
+ declare type State = {
8
+ expanded: boolean;
9
+ };
10
+ export default class TripDetail extends Component<Props, State> {
11
+ constructor(props: Props);
12
+ toggle: () => void;
13
+ onExpandClick: () => void;
14
+ onHideClick: () => void;
15
+ render(): ReactElement;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=trip-detail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trip-detail.d.ts","sourceRoot":"","sources":["../src/trip-detail.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAOvD,aAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IACpC,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC;CAChC,CAAC;AAEF,aAAK,KAAK,GAAG;IACX,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBACjD,KAAK,EAAE,KAAK;IAOxB,MAAM,QAAO,IAAI,CAIf;IAEF,aAAa,QAAO,IAAI,CAEtB;IAEF,WAAW,QAAO,IAAI,CAEpB;IAEF,MAAM,IAAI,YAAY;CA8BvB"}
@@ -1,14 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.default = void 0;
9
7
 
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
8
  var _react = _interopRequireWildcard(require("react"));
13
9
 
14
10
  var _QuestionCircle = require("@styled-icons/fa-solid/QuestionCircle");
@@ -81,12 +77,4 @@ class TripDetail extends _react.Component {
81
77
  }
82
78
 
83
79
  exports.default = TripDetail;
84
- TripDetail.propTypes = {
85
- icon: _propTypes.default.node.isRequired,
86
- summary: _propTypes.default.node.isRequired,
87
- description: _propTypes.default.node
88
- };
89
- TripDetail.defaultProps = {
90
- description: undefined
91
- };
92
80
  //# sourceMappingURL=trip-detail.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/trip-detail.js"],"names":["TripDetail","Component","constructor","props","toggle","expanded","state","onHideClick","onExpandClick","setState","render","icon","summary","description","animation","propTypes","PropTypes","node","isRequired","defaultProps","undefined"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEe,MAAMA,UAAN,SAAyBC,gBAAzB,CAAmC;AAChDC,EAA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,oBACE,6BAAC,wBAAD;AAAa,MAAA,IAAI,EAAC;AAAlB,MADF,CADF,EAIGM,WAJH,CALJ,CAVF,CADF;AA0BD;;AAnD+C;;;AAsDlDb,UAAU,CAACe,SAAX,GAAuB;AACrBJ,EAAAA,IAAI,EAAEK,mBAAUC,IAAV,CAAeC,UADA;AAErBN,EAAAA,OAAO,EAAEI,mBAAUC,IAAV,CAAeC,UAFH;AAGrBL,EAAAA,WAAW,EAAEG,mBAAUC;AAHF,CAAvB;AAMAjB,UAAU,CAACmB,YAAX,GAA0B;AACxBN,EAAAA,WAAW,EAAEO;AADW,CAA1B","sourcesContent":["import PropTypes from \"prop-types\";\nimport React, { Component } from \"react\";\nimport { QuestionCircle } from \"@styled-icons/fa-solid/QuestionCircle\";\nimport { TimesCircle } from \"@styled-icons/fa-solid/TimesCircle\";\nimport { VelocityTransitionGroup } from \"velocity-react\";\n\nimport * as S from \"./styled\";\n\nexport default class TripDetail extends Component {\n constructor(props) {\n super(props);\n this.state = {\n expanded: false\n };\n }\n\n toggle = () => {\n const { expanded } = this.state;\n if (expanded) this.onHideClick();\n else this.onExpandClick();\n };\n\n onExpandClick = () => {\n this.setState({ expanded: true });\n };\n\n onHideClick = () => {\n this.setState({ expanded: false });\n };\n\n render() {\n const { icon, summary, description } = this.props;\n const { expanded } = this.state;\n return (\n <S.TripDetail>\n <S.TripDetailIcon>{icon}</S.TripDetailIcon>\n <S.TripDetailSummary>\n {summary}\n {description && (\n <S.ExpandButton onClick={this.toggle}>\n <QuestionCircle size=\"0.92em\" />\n </S.ExpandButton>\n )}\n </S.TripDetailSummary>\n <VelocityTransitionGroup\n enter={{ animation: \"slideDown\" }}\n leave={{ animation: \"slideUp\" }}\n >\n {expanded && (\n <S.TripDetailDescription>\n <S.HideButton onClick={this.onHideClick}>\n <TimesCircle size=\"0.92em\" />\n </S.HideButton>\n {description}\n </S.TripDetailDescription>\n )}\n </VelocityTransitionGroup>\n </S.TripDetail>\n );\n }\n}\n\nTripDetail.propTypes = {\n icon: PropTypes.node.isRequired,\n summary: PropTypes.node.isRequired,\n description: PropTypes.node\n};\n\nTripDetail.defaultProps = {\n description: undefined\n};\n"],"file":"trip-detail.js"}
1
+ {"version":3,"sources":["../src/trip-detail.tsx"],"names":["TripDetail","Component","constructor","props","toggle","expanded","state","onHideClick","onExpandClick","setState","render","icon","summary","description","animation"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAYe,MAAMA,UAAN,SAAyBC,gBAAzB,CAAiD;AAC9DC,EAAAA,WAAW,CAACC,KAAD,EAAe;AACxB,UAAMA,KAAN;;AADwB,SAO1BC,MAP0B,GAOjB,MAAY;AACnB,YAAM;AAAEC,QAAAA;AAAF,UAAe,KAAKC,KAA1B;AACA,UAAID,QAAJ,EAAc,KAAKE,WAAL,GAAd,KACK,KAAKC,aAAL;AACN,KAXyB;;AAAA,SAa1BA,aAb0B,GAaV,MAAY;AAC1B,WAAKC,QAAL,CAAc;AAAEJ,QAAAA,QAAQ,EAAE;AAAZ,OAAd;AACD,KAfyB;;AAAA,SAiB1BE,WAjB0B,GAiBZ,MAAY;AACxB,WAAKE,QAAL,CAAc;AAAEJ,QAAAA,QAAQ,EAAE;AAAZ,OAAd;AACD,KAnByB;;AAExB,SAAKC,KAAL,GAAa;AACXD,MAAAA,QAAQ,EAAE;AADC,KAAb;AAGD;;AAgBDK,EAAAA,MAAM,GAAiB;AACrB,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,OAAR;AAAiBC,MAAAA;AAAjB,QAAiC,KAAKV,KAA5C;AACA,UAAM;AAAEE,MAAAA;AAAF,QAAe,KAAKC,KAA1B;AACA,wBACE,6BAAC,CAAD,CAAG,UAAH,qBACE,6BAAC,CAAD,CAAG,cAAH,QAAmBK,IAAnB,CADF,eAEE,6BAAC,CAAD,CAAG,iBAAH,QACGC,OADH,EAEGC,WAAW,iBACV,6BAAC,CAAD,CAAG,YAAH;AAAgB,MAAA,OAAO,EAAE,KAAKT;AAA9B,oBACE,6BAAC,8BAAD;AAAgB,MAAA,IAAI,EAAC;AAArB,MADF,CAHJ,CAFF,eAUE,6BAAC,sCAAD;AACE,MAAA,KAAK,EAAE;AAAEU,QAAAA,SAAS,EAAE;AAAb,OADT;AAEE,MAAA,KAAK,EAAE;AAAEA,QAAAA,SAAS,EAAE;AAAb;AAFT,OAIGT,QAAQ,iBACP,6BAAC,CAAD,CAAG,qBAAH,qBACE,6BAAC,CAAD,CAAG,UAAH;AAAc,MAAA,OAAO,EAAE,KAAKE;AAA5B,oBACE,6BAAC,wBAAD;AAAa,MAAA,IAAI,EAAC;AAAlB,MADF,CADF,EAIGM,WAJH,CALJ,CAVF,CADF;AA0BD;;AAnD6D","sourcesContent":["import React, { Component, ReactElement } from \"react\";\nimport { QuestionCircle } from \"@styled-icons/fa-solid/QuestionCircle\";\nimport { TimesCircle } from \"@styled-icons/fa-solid/TimesCircle\";\nimport { VelocityTransitionGroup } from \"velocity-react\";\n\nimport * as S from \"./styled\";\n\ntype Props = {\n description?: ReactElement | string;\n icon: ReactElement;\n summary: ReactElement | string;\n};\n\ntype State = {\n expanded: boolean;\n};\n\nexport default class TripDetail extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = {\n expanded: false\n };\n }\n\n toggle = (): void => {\n const { expanded } = this.state;\n if (expanded) this.onHideClick();\n else this.onExpandClick();\n };\n\n onExpandClick = (): void => {\n this.setState({ expanded: true });\n };\n\n onHideClick = (): void => {\n this.setState({ expanded: false });\n };\n\n render(): ReactElement {\n const { icon, summary, description } = this.props;\n const { expanded } = this.state;\n return (\n <S.TripDetail>\n <S.TripDetailIcon>{icon}</S.TripDetailIcon>\n <S.TripDetailSummary>\n {summary}\n {description && (\n <S.ExpandButton onClick={this.toggle}>\n <QuestionCircle size=\"0.92em\" />\n </S.ExpandButton>\n )}\n </S.TripDetailSummary>\n <VelocityTransitionGroup\n enter={{ animation: \"slideDown\" }}\n leave={{ animation: \"slideUp\" }}\n >\n {expanded && (\n <S.TripDetailDescription>\n <S.HideButton onClick={this.onHideClick}>\n <TimesCircle size=\"0.92em\" />\n </S.HideButton>\n {description}\n </S.TripDetailDescription>\n )}\n </VelocityTransitionGroup>\n </S.TripDetail>\n );\n }\n}\n"],"file":"trip-detail.js"}
package/lib/types.d.ts ADDED
@@ -0,0 +1,67 @@
1
+ import type { Itinerary } from "@opentripplanner/types";
2
+ import type { ReactElement } from "react";
3
+ export interface CaloriesDetailsProps {
4
+ bikeSeconds: number;
5
+ calories: number;
6
+ walkSeconds: number;
7
+ }
8
+ export interface DepartureDetailsProps {
9
+ departureDate: Date;
10
+ }
11
+ export interface TransitFareData {
12
+ [key: string]: {
13
+ currency: {
14
+ currencyCode: string;
15
+ defaultFractionDigits: number;
16
+ currency: string;
17
+ symbol: string;
18
+ };
19
+ cents: number;
20
+ };
21
+ }
22
+ export interface FareDetailsProps {
23
+ maxTNCFare: number;
24
+ minTNCFare: number;
25
+ transitFares: TransitFareData;
26
+ }
27
+ export interface TransitFareProps {
28
+ fareKey: string;
29
+ fareNameFallback?: ReactElement;
30
+ fareKeyNameMap: {
31
+ [key: string]: string;
32
+ };
33
+ transitFares: TransitFareData;
34
+ }
35
+ export interface TripDetailsProps {
36
+ /**
37
+ * Slot for a custom component to render the expandable section for calories.
38
+ */
39
+ CaloriesDetails?: React.ElementType<CaloriesDetailsProps>;
40
+ /**
41
+ * Used for additional styling with styled components for example.
42
+ */
43
+ className?: string;
44
+ /**
45
+ * Determines which transit fare should be displayed by default, should there be multiple transit fare types.
46
+ */
47
+ defaultFareKey?: string;
48
+ /**
49
+ * Slot for a custom component to render the expandable section for departure.
50
+ */
51
+ DepartureDetails?: React.ElementType<DepartureDetailsProps>;
52
+ /**
53
+ * Slot for a custom component to render the expandable section for fares.
54
+ */
55
+ FareDetails?: React.ElementType<FareDetailsProps>;
56
+ /**
57
+ * Mapping between fare keys and human-readable names for them.
58
+ */
59
+ fareKeyNameMap?: {
60
+ [name: string]: string;
61
+ };
62
+ /**
63
+ * Itinerary that the user has selected to view, contains multiple legs.
64
+ */
65
+ itinerary: Itinerary;
66
+ }
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,QAAQ,EAAE;YACR,YAAY,EAAE,MAAM,CAAA;YACpB,qBAAqB,EAAE,MAAM,CAAA;YAC7B,QAAQ,EAAE,MAAM,CAAA;YAChB,MAAM,EAAE,MAAM,CAAA;SACf,CAAC;QACF,KAAK,EAAE,MAAM,CAAC;KACf,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,cAAc,EAAE;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAC1D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAC5D;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAClD;;OAEG;IACH,cAAc,CAAC,EAAE;QACf,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,CAAC;IACF;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;CACtB"}
package/lib/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
package/package.json CHANGED
@@ -1,32 +1,35 @@
1
1
  {
2
2
  "name": "@opentripplanner/trip-details",
3
- "version": "1.5.0",
3
+ "version": "2.0.1",
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",
7
+ "types": "lib/index.d.js",
7
8
  "repository": "https://github.com/opentripplanner/otp-ui.git",
8
9
  "homepage": "https://github.com/opentripplanner/otp-ui#readme",
9
10
  "author": "Evan Siroky",
10
11
  "license": "MIT",
11
12
  "private": false,
12
13
  "dependencies": {
13
- "@opentripplanner/core-utils": "^4.3.0",
14
- "@opentripplanner/humanize-distance": "^1.1.0",
15
- "moment": "^2.24.0",
16
- "prop-types": "^15.7.2",
14
+ "@opentripplanner/core-utils": "^4.6.0",
17
15
  "@styled-icons/fa-solid": "^10.34.0",
16
+ "flat": "^5.0.2",
18
17
  "velocity-react": "^1.4.3"
19
18
  },
20
19
  "devDependencies": {
21
- "@opentripplanner/icons": "^1.2.1",
22
- "@opentripplanner/itinerary-body": "^2.5.0"
20
+ "@opentripplanner/types": "^1.1.0",
21
+ "@types/flat": "^5.0.2"
23
22
  },
24
23
  "peerDependencies": {
25
24
  "react": "^16.14.0",
25
+ "react-intl": "^5.24.6",
26
26
  "styled-components": "^5.3.0"
27
27
  },
28
28
  "bugs": {
29
29
  "url": "https://github.com/opentripplanner/otp-ui/issues"
30
30
  },
31
- "gitHead": "0af1b7cda60bd4252b219dcf893e01c2acb2ed5d"
31
+ "gitHead": "0af1b7cda60bd4252b219dcf893e01c2acb2ed5d",
32
+ "scripts": {
33
+ "tsc": "tsc && echo Remove the @ts-expect-error exception in index.tsx once core-utils is typed!"
34
+ }
32
35
  }