mautourco-components 0.2.138 → 0.2.139

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.
@@ -8,5 +8,6 @@ export interface ItemColProps {
8
8
  iconName?: IconName;
9
9
  showName?: boolean;
10
10
  children?: React.ReactNode;
11
+ extraContent?: string;
11
12
  }
12
13
  export declare function ItemCol(props: ItemColProps): import("react/jsx-runtime").JSX.Element;
@@ -3,11 +3,16 @@ import { Text } from '../../atoms/Typography/Typography';
3
3
  import { cn } from '../../../lib/utils';
4
4
  import Chip from '../../atoms/Chip/Chip';
5
5
  import TextWithIcon from '../TextWithIcon/TextWithIcon';
6
+ var ExtraContent = function (props) {
7
+ return (_jsxs("div", { children: [_jsx(Text, { variant: "bold", size: "sm", leading: "5", children: props.label }), _jsx(Text, { variant: "regular", size: "sm", leading: "5", children: props.children })] }));
8
+ };
6
9
  export function ItemCol(props) {
7
- var serviceType = props.serviceType, serviceName = props.serviceName, offers = props.offers, status = props.status, _a = props.iconName, iconName = _a === void 0 ? 'accom' : _a, _b = props.showName, showName = _b === void 0 ? true : _b, extraTitle = props.extraTitle, children = props.children;
10
+ var serviceType = props.serviceType, serviceName = props.serviceName, offers = props.offers, status = props.status, _a = props.iconName, iconName = _a === void 0 ? 'accom' : _a, _b = props.showName, showName = _b === void 0 ? true : _b, extraTitle = props.extraTitle, extraContent = props.extraContent, children = props.children;
8
11
  var isOnRequest = (status === null || status === void 0 ? void 0 : status.toLowerCase()) === 'on request';
9
- return (_jsxs("div", { className: cn('grid', (offers === null || offers === void 0 ? void 0 : offers.length) && 'gap-y-3'), children: [_jsxs("div", { children: [serviceName && (_jsxs("div", { className: "grid gap-y-1", children: [_jsxs("div", { className: "flex items-center gap-x-2", children: [_jsx(TextWithIcon, { icon: iconName, color: isOnRequest ? 'yellow' : 'accent', children: serviceType }), isOnRequest && _jsx(Chip, { color: "yellow", children: status }), extraTitle] }), _jsx(Text, { variant: "bold", size: "sm", children: showName && serviceName })] })), children] }), offers && offers.length > 0 && (_jsxs("div", { children: [_jsx(Text, { variant: "bold", size: "sm", leading: "5", children: "Applicable offers:" }), _jsx(Text, { variant: "regular", size: "sm", leading: "5", children: offers.map(function (o) {
10
- var offerValue = o.OfferType === 'GIFT' ? o.OfferName : "".concat(o.OfferValue, "% offers applied");
11
- return _jsx("span", { children: offerValue });
12
- }) })] }))] }));
12
+ return (_jsxs("div", { className: cn('grid', {
13
+ 'gap-y-3': (offers === null || offers === void 0 ? void 0 : offers.length) || !!extraContent,
14
+ }), children: [_jsxs("div", { children: [serviceName && (_jsxs("div", { className: "grid gap-y-1", children: [_jsxs("div", { className: "flex items-center gap-x-2", children: [_jsx(TextWithIcon, { icon: iconName, color: isOnRequest ? 'yellow' : 'accent', children: serviceType }), isOnRequest && _jsx(Chip, { color: "yellow", children: status }), extraTitle] }), _jsx(Text, { variant: "bold", size: "sm", children: showName && serviceName })] })), children] }), serviceType === 'Excursion' && (_jsx(ExtraContent, { label: "Pick up point", children: extraContent })), offers && offers.length > 0 && (_jsx(ExtraContent, { label: "Applicable offers:", children: offers.map(function (o) {
15
+ var offerValue = o.OfferType === 'GIFT' ? o.OfferName : "".concat(o.OfferValue, "% offers applied");
16
+ return _jsx("span", { children: offerValue });
17
+ }) }))] }));
13
18
  }
@@ -15,8 +15,8 @@ export function DetailsCol(props) {
15
15
  ] }));
16
16
  }
17
17
  function FirstCol(props) {
18
- var serviceName = props.serviceName, offers = props.offers;
19
- return (_jsx(ItemCol, { serviceType: "Excursion", serviceName: serviceName, offers: offers, iconName: "map" }));
18
+ var serviceName = props.serviceName, extraContent = props.extraContent;
19
+ return (_jsx(ItemCol, { serviceType: "Excursion", serviceName: serviceName, extraContent: extraContent, iconName: "map" }));
20
20
  }
21
21
  RowExcursion.FirstCol = FirstCol;
22
22
  RowExcursion.DetailsCol = DetailsCol;
@@ -23,7 +23,7 @@ export var detailResumeColumns = function (params) {
23
23
  }
24
24
  if (value === ServiceType.EXCURSION) {
25
25
  var excursion = raw;
26
- return (_jsx(RowExcursion.FirstCol, { serviceName: excursion.ExcursionName }));
26
+ return (_jsx(RowExcursion.FirstCol, { serviceName: excursion.ExcursionName, extraContent: excursion.LocationToName }));
27
27
  }
28
28
  if (value === ServiceType.TRANSFER) {
29
29
  var transfer = raw;
@@ -60,7 +60,7 @@ export interface DetailResumeAccommodation extends TableRowData<DetailResumeItem
60
60
  Description: string;
61
61
  TitleDescription: string;
62
62
  Rooms: Room[];
63
- RoomIndex: number;
63
+ RoomIndex?: number;
64
64
  }
65
65
  export interface DetailResumeTransfer extends TableRowData<DetailResumeItem> {
66
66
  Type: ServiceType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mautourco-components",
3
- "version": "0.2.138",
3
+ "version": "0.2.139",
4
4
  "private": false,
5
5
  "description": "Bibliothèque de composants Mautourco pour le redesign",
6
6
  "main": "dist/index.js",
@@ -13,8 +13,22 @@ export interface ItemColProps {
13
13
  iconName?: IconName;
14
14
  showName?: boolean;
15
15
  children?: React.ReactNode;
16
+ extraContent?: string;
16
17
  }
17
18
 
19
+ const ExtraContent = (props: { label: string; children: React.ReactNode }) => {
20
+ return (
21
+ <div>
22
+ <Text variant="bold" size="sm" leading="5">
23
+ {props.label}
24
+ </Text>
25
+ <Text variant="regular" size="sm" leading="5">
26
+ {props.children}
27
+ </Text>
28
+ </div>
29
+ );
30
+ };
31
+
18
32
  export function ItemCol(props: ItemColProps) {
19
33
  const {
20
34
  serviceType,
@@ -24,13 +38,17 @@ export function ItemCol(props: ItemColProps) {
24
38
  iconName = 'accom',
25
39
  showName = true,
26
40
  extraTitle,
41
+ extraContent,
27
42
  children,
28
43
  } = props;
29
44
 
30
45
  const isOnRequest = status?.toLowerCase() === 'on request';
31
46
 
32
47
  return (
33
- <div className={cn('grid', offers?.length && 'gap-y-3')}>
48
+ <div
49
+ className={cn('grid', {
50
+ 'gap-y-3': offers?.length || !!extraContent,
51
+ })}>
34
52
  <div>
35
53
  {serviceName && (
36
54
  <div className="grid gap-y-1">
@@ -48,20 +66,18 @@ export function ItemCol(props: ItemColProps) {
48
66
  )}
49
67
  {children}
50
68
  </div>
69
+ {serviceType === 'Excursion' && (
70
+ <ExtraContent label="Pick up point">{extraContent}</ExtraContent>
71
+ )}
51
72
  {offers && offers.length > 0 && (
52
- <div>
53
- <Text variant="bold" size="sm" leading="5">
54
- Applicable offers:
55
- </Text>
56
- <Text variant="regular" size="sm" leading="5">
57
- {offers.map((o) => {
58
- const offerValue =
59
- o.OfferType === 'GIFT' ? o.OfferName : `${o.OfferValue}% offers applied`;
73
+ <ExtraContent label="Applicable offers:">
74
+ {offers.map((o) => {
75
+ const offerValue =
76
+ o.OfferType === 'GIFT' ? o.OfferName : `${o.OfferValue}% offers applied`;
60
77
 
61
- return <span>{offerValue}</span>;
62
- })}
63
- </Text>
64
- </div>
78
+ return <span>{offerValue}</span>;
79
+ })}
80
+ </ExtraContent>
65
81
  )}
66
82
  </div>
67
83
  );
@@ -30,13 +30,13 @@ export function DetailsCol(props: RowExcursionProps) {
30
30
  }
31
31
 
32
32
  function FirstCol(props: Omit<ItemColProps, 'serviceType' | 'status'>) {
33
- const { serviceName, offers } = props;
33
+ const { serviceName, extraContent } = props;
34
34
 
35
35
  return (
36
36
  <ItemCol
37
37
  serviceType="Excursion"
38
38
  serviceName={serviceName}
39
- offers={offers}
39
+ extraContent={extraContent}
40
40
  iconName="map"
41
41
  />
42
42
  );
@@ -40,7 +40,10 @@ export const detailResumeColumns: (params?: {
40
40
  if (value === ServiceType.EXCURSION) {
41
41
  const excursion = raw as DetailResumeExcursion;
42
42
  return (
43
- <RowExcursion.FirstCol serviceName={excursion.ExcursionName as string} />
43
+ <RowExcursion.FirstCol
44
+ serviceName={excursion.ExcursionName as string}
45
+ extraContent={excursion.LocationToName}
46
+ />
44
47
  );
45
48
  }
46
49
  if (value === ServiceType.TRANSFER) {
@@ -67,7 +67,7 @@ export interface DetailResumeAccommodation
67
67
  Description: string;
68
68
  TitleDescription: string;
69
69
  Rooms: Room[];
70
- RoomIndex: number;
70
+ RoomIndex?: number;
71
71
  }
72
72
 
73
73
  export interface DetailResumeTransfer extends TableRowData<DetailResumeItem> {