@duffel/components 3.5.0--canary-6 → 3.5.0--canary-8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -125,7 +125,7 @@ If you are not in a node environment and can't rely on npm to install the packag
125
125
  document.querySelector("duffel-ancillaries");
126
126
 
127
127
  duffelAncillariesElement.addEventListener("onPayloadReady", (event) =>
128
- console.log("onPayloadReady\n", event.detail)
128
+ console.log("onPayloadReady\n", event.detail),
129
129
  );
130
130
  ```
131
131
 
@@ -1,8 +1,4 @@
1
1
  import * as React from "react";
2
2
  import { DuffelCardFormProps } from "./lib/types";
3
- type DuffelCardFormActions = {
4
- saveCard: () => void;
5
- createCardForTemporaryUse: () => void;
6
- };
3
+ import { DuffelCardFormActions } from "./lib/useDuffelCardFormActions";
7
4
  export declare const DuffelCardForm: React.ForwardRefExoticComponent<DuffelCardFormProps & React.RefAttributes<DuffelCardFormActions>>;
8
- export {};
@@ -1,23 +1,24 @@
1
- import { DuffelCardFormProps } from "./types";
1
+ import React from "react";
2
+ export interface DuffelCardFormActions {
3
+ saveCard: () => void;
4
+ createCardForTemporaryUse: () => void;
5
+ }
2
6
  export interface UseDuffelCardFormActionsHook {
3
7
  /**
4
- * The actions array that should be passed to the `actions` prop of the `DuffelCardForm` component.
5
- * You do not have have to modify this array directly, instead rely on `triggerSaveCard` and `triggerCreateCardForTemporaryUse` to update the array.
8
+ * The ref you should pass to the DuffelCardForm component.
6
9
  */
7
- actions: DuffelCardFormProps["actions"];
10
+ ref: React.RefObject<DuffelCardFormActions>;
8
11
  /**
9
12
  * Call this function to tell the component to save the card.
10
13
  */
11
- triggerSaveCard: () => void;
14
+ saveCard: () => void;
12
15
  /**
13
16
  * Call this function to tell the component to create a card for temporary use.
14
17
  */
15
- triggerCreateCardForTemporaryUse: () => void;
18
+ createCardForTemporaryUse: () => void;
16
19
  }
17
20
  /**
18
- * This hook gives you convinient helpers to read and reason through the DuffelCardForm integration.
19
- * Add `actions` to the `DuffelCardForm` actions prop and call the functions to trigger the actions you'd like.
20
- *
21
- * In the background, this hook is setting the state on actions prop and the component's useEffect hook will trigger the action.
21
+ * This hook abstracts the ref for convenience and readability.
22
+ * Add `ref` to the `DuffelCardForm` `ref` prop and call the functions to trigger the actions you'd like.
22
23
  */
23
24
  export declare function useDuffelCardFormActions(): UseDuffelCardFormActionsHook;
@@ -2,5 +2,7 @@ import * as React from "react";
2
2
  import { OfferWithNGS } from "./lib";
3
3
  export interface DuffelNGSViewProps {
4
4
  offers: OfferWithNGS[];
5
+ sliceIndex: number;
6
+ onSelect: (offerId: string) => void;
5
7
  }
6
8
  export declare const DuffelNGSView: React.FC<DuffelNGSViewProps>;
@@ -2,5 +2,6 @@ import * as React from "react";
2
2
  import { NGSShelf } from "./lib";
3
3
  export interface NGSShelfInfoCardProps {
4
4
  ngs_shelf: NGSShelf;
5
+ className?: string;
5
6
  }
6
7
  export declare const NGSShelfInfoCard: React.FC<NGSShelfInfoCardProps>;
@@ -6,5 +6,6 @@ export interface NGSSliceFareCardProps {
6
6
  selected?: boolean;
7
7
  onSelect?: () => void;
8
8
  compareToAmount?: number;
9
+ className?: string;
9
10
  }
10
11
  export declare const NGSSliceFareCard: React.FC<NGSSliceFareCardProps>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="@duffel/api" />
2
+ import { OfferSlice } from "@duffel/api/types";
3
+ import React from "react";
4
+ export interface SliceSummaryProps {
5
+ slice: OfferSlice;
6
+ }
7
+ export declare const SliceSummary: React.FC<SliceSummaryProps>;
@@ -0,0 +1,3 @@
1
+ import { NGSShelf, OfferSliceWithNGS, OfferWithNGS } from ".";
2
+ export type NGSOfferRow = Record<"slice", OfferSliceWithNGS> & Record<NGSShelf, OfferWithNGS | null>;
3
+ export declare const groupOffersForNGSView: (offers: OfferWithNGS[], sliceIndex: number) => NGSOfferRow[];
@@ -1,7 +1,7 @@
1
1
  /// <reference types="@duffel/api" />
2
2
  import { IconName } from "@components/shared/Icon";
3
3
  import { Offer, OfferSlice, OfferSliceSegment, OfferSliceSegmentPassenger } from "@duffel/api/types";
4
- export declare const NGS_SHELVES: readonly ["1", "2", "3", "4", "5", "6"];
4
+ export declare const NGS_SHELVES: readonly ["1", "2", "3", "4", "5"];
5
5
  export type NGSShelf = (typeof NGS_SHELVES)[number];
6
6
  type SeatWithNGS = {
7
7
  type: string;
@@ -31,7 +31,7 @@ type OfferSliceSegmentPassengerWithNGS = OfferSliceSegmentPassenger & {
31
31
  export type OfferSliceSegmentWithNGS = OfferSliceSegment & {
32
32
  passengers: OfferSliceSegmentPassengerWithNGS[];
33
33
  };
34
- type OfferSliceWithNGS = OfferSlice & {
34
+ export type OfferSliceWithNGS = OfferSlice & {
35
35
  segments: OfferSliceSegmentWithNGS[];
36
36
  ngs_shelf: NGSShelf;
37
37
  };
@@ -0,0 +1,4 @@
1
+ import { NGSShelf } from ".";
2
+ import { NGSOfferRow } from "./group-offers-for-ngs-view";
3
+ export type SortDirection = "asc" | "desc";
4
+ export declare const sortNGSRows: (rows: NGSOfferRow[], sortShelf: NGSShelf, sortDirection: SortDirection) => NGSOfferRow[];
@@ -10,9 +10,11 @@ export declare const ICON_MAP: {
10
10
  airline_seat_recline_normal: import("react/jsx-runtime").JSX.Element;
11
11
  airplane_ticket: import("react/jsx-runtime").JSX.Element;
12
12
  apartment: import("react/jsx-runtime").JSX.Element;
13
+ arrow_downward: import("react/jsx-runtime").JSX.Element;
13
14
  arrow_forward: import("react/jsx-runtime").JSX.Element;
14
15
  arrow_left: import("react/jsx-runtime").JSX.Element;
15
16
  arrow_right: import("react/jsx-runtime").JSX.Element;
17
+ arrow_upward: import("react/jsx-runtime").JSX.Element;
16
18
  atm: import("react/jsx-runtime").JSX.Element;
17
19
  autorenew: import("react/jsx-runtime").JSX.Element;
18
20
  bakery_dining: import("react/jsx-runtime").JSX.Element;
@@ -69,6 +71,7 @@ export declare const ICON_MAP: {
69
71
  spa: import("react/jsx-runtime").JSX.Element;
70
72
  stairs: import("react/jsx-runtime").JSX.Element;
71
73
  star: import("react/jsx-runtime").JSX.Element;
74
+ unfold_more: import("react/jsx-runtime").JSX.Element;
72
75
  wallet: import("react/jsx-runtime").JSX.Element;
73
76
  warning: import("react/jsx-runtime").JSX.Element;
74
77
  wifi: import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /// <reference types="@duffel/api" />
2
+ import { OfferSlice } from "@duffel/api/types";
3
+ import * as React from "react";
4
+ export interface SliceCarriersTitleProps {
5
+ slice: OfferSlice;
6
+ }
7
+ export declare const SliceCarriersTitle: React.FC<SliceCarriersTitleProps>;