mautourco-components 0.2.53 → 0.2.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Chip from '../../atoms/Chip/Chip';
3
3
  export function DetailContentTransfer(props) {
4
- var pax = props.pax, clientType = props.clientType, carName = props.carName, airConditioning = props.airConditioning, luggageTruck = props.luggageTruck;
5
- return (_jsxs("div", { className: "flex gap-4", children: [_jsx(Chip, { type: "outline", color: "brand", label: pax, leadingIcon: "user", isBlackText: true }), _jsx(Chip, { type: "outline", color: "brand", label: "Client type: ".concat(clientType), leadingIcon: "user", isBlackText: true }), _jsx(Chip, { type: "outline", color: "brand", label: carName, leadingIcon: "car", isBlackText: true }), airConditioning && (_jsx(Chip, { type: "outline", color: "brand", label: "Air conditioning", leadingIcon: "air", isBlackText: true })), luggageTruck && (_jsx(Chip, { type: "outline", color: "brand", label: "Luggage truck: ".concat(luggageTruck > 1 ? "x".concat(luggageTruck) : luggageTruck), leadingIcon: "luggage", isBlackText: true }))] }));
4
+ var pax = props.pax, clientType = props.clientType, carName = props.carName, airConditioning = props.airConditioning, _a = props.luggageTruck, luggageTruck = _a === void 0 ? 0 : _a;
5
+ return (_jsxs("div", { className: "flex gap-4", children: [_jsx(Chip, { type: "outline", color: "brand", label: pax, leadingIcon: "user", isBlackText: true }), _jsx(Chip, { type: "outline", color: "brand", label: "Client type: ".concat(clientType), leadingIcon: "user", isBlackText: true }), _jsx(Chip, { type: "outline", color: "brand", label: carName, leadingIcon: "car", isBlackText: true }), airConditioning && (_jsx(Chip, { type: "outline", color: "brand", label: "Air conditioning", leadingIcon: "air", isBlackText: true })), luggageTruck > 0 && (_jsx(Chip, { type: "outline", color: "brand", label: "Luggage truck: ".concat(luggageTruck > 1 ? "x".concat(luggageTruck) : luggageTruck), leadingIcon: "luggage", isBlackText: true }))] }));
6
6
  }
@@ -44,6 +44,8 @@
44
44
  }
45
45
  img {
46
46
  object-fit: cover;
47
+ width: 100%;
48
+ height: 100%;
47
49
  }
48
50
  }
49
51
 
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { ServiceAccommodationProps } from '../../molecules/TimelineItem/ServiceAccommodation';
3
2
  import { ServiceExcursionProps } from '../../molecules/TimelineItem/ServiceExcursion';
4
3
  import { ServiceTransferProps } from '../../molecules/TimelineItem/ServiceTransfer';
@@ -12,4 +11,4 @@ export interface TimelineProps {
12
11
  services: TimelineServices[];
13
12
  className?: string;
14
13
  }
15
- export declare const Timeline: React.FC<TimelineProps>;
14
+ export declare function Timeline(props: TimelineProps): import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,8 @@ import { cn } from '../../../lib/utils';
14
14
  import { Text } from '../../atoms/Typography/Typography';
15
15
  import TextWithIcon from '../../molecules/TextWithIcon/TextWithIcon';
16
16
  import TimelineItem from '../../molecules/TimelineItem/TimelineItem';
17
- export var Timeline = function (props) {
17
+ export function Timeline(props) {
18
18
  var arrival = props.arrival, departure = props.departure, services = props.services, className = props.className;
19
- return (_jsxs("div", { className: cn('space-y-10', className), children: [_jsxs(TextWithIcon, { icon: "arrival", color: "accent", iconSize: "lg", textSize: "lg", children: ["Arrival :", ' ', _jsx(Text, { variant: "regular", size: "lg", leading: "5", color: "default", as: "span", children: arrival })] }), _jsx("div", { className: "overflow-x-auto", children: _jsx("div", { className: "flex gap-x-3 pb-8 2xl:pb-0", children: services.map(function (service, index) { return (_jsxs(TimelineItem, { children: [service.type === 'transfer' && (_jsx(TimelineItem.Transfer, __assign({}, service.data))), service.type === 'accommodation' && (_jsx(TimelineItem.Accommodation, __assign({}, service.data))), service.type === 'excursion' && (_jsx(TimelineItem.Excursion, __assign({}, service.data)))] }, "tm-".concat(index))); }) }) }), _jsxs(TextWithIcon, { icon: "departure", color: "accent", iconSize: "lg", textSize: "lg", children: ["Departure :", ' ', _jsx(Text, { variant: "regular", size: "lg", leading: "5", color: "default", as: "span", children: departure })] })] }));
20
- };
19
+ return (_jsxs("div", { className: cn('space-y-10', className), children: [_jsxs(TextWithIcon, { icon: "arrival", color: "accent", iconSize: "lg", textSize: "lg", children: ["Arrival :", ' ', _jsx(Text, { variant: "regular", size: "lg", leading: "5", color: "default", as: "span", children: arrival })] }), _jsx("div", { className: "overflow-x-auto overflow-y-hidden", children: _jsx("div", { className: "flex gap-x-3 pb-8 2xl:pb-0", children: services.map(function (service, index) { return (_jsxs(TimelineItem, { children: [service.type === 'transfer' && (_jsx(TimelineItem.Transfer, __assign({}, service.data))), service.type === 'accommodation' && (_jsx(TimelineItem.Accommodation, __assign({}, service.data))), service.type === 'excursion' && (_jsx(TimelineItem.Excursion, __assign({}, service.data)))] }, "tm-".concat(index))); }) }) }), _jsxs(TextWithIcon, { icon: "departure", color: "accent", iconSize: "lg", textSize: "lg", children: ["Departure :", ' ', _jsx(Text, { variant: "regular", size: "lg", leading: "5", color: "default", as: "span", children: departure })] })] }));
20
+ }
21
+ ;
@@ -2,6 +2,9 @@ import { differenceInDays } from 'date-fns';
2
2
  import { useMemo } from 'react';
3
3
  export default function useStays(dates) {
4
4
  var stay = useMemo(function () {
5
+ if (!dates) {
6
+ return 0;
7
+ }
5
8
  if (dates.length) {
6
9
  return differenceInDays(dates[1], dates[0]);
7
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mautourco-components",
3
- "version": "0.2.53",
3
+ "version": "0.2.55",
4
4
  "private": false,
5
5
  "description": "Bibliothèque de composants Mautourco pour le redesign",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,7 @@ export interface DetailContentTransferProps {
9
9
  }
10
10
 
11
11
  export function DetailContentTransfer(props: DetailContentTransferProps) {
12
- const { pax, clientType, carName, airConditioning, luggageTruck } = props;
12
+ const { pax, clientType, carName, airConditioning, luggageTruck = 0 } = props;
13
13
  return (
14
14
  <div className="flex gap-4">
15
15
  <Chip type="outline" color="brand" label={pax} leadingIcon="user" isBlackText />
@@ -30,7 +30,7 @@ export function DetailContentTransfer(props: DetailContentTransferProps) {
30
30
  isBlackText
31
31
  />
32
32
  )}
33
- {luggageTruck && (
33
+ {luggageTruck > 0 && (
34
34
  <Chip
35
35
  type="outline"
36
36
  color="brand"
@@ -31,6 +31,8 @@
31
31
  }
32
32
  img {
33
33
  object-fit: cover;
34
+ width: 100%;
35
+ height: 100%;
34
36
  }
35
37
  }
36
38
 
@@ -1,5 +1,4 @@
1
1
  import { cn } from '@/src/lib/utils';
2
- import React from 'react';
3
2
  import { Text } from '../../atoms/Typography/Typography';
4
3
  import TextWithIcon from '../../molecules/TextWithIcon/TextWithIcon';
5
4
  import { ServiceAccommodationProps } from '../../molecules/TimelineItem/ServiceAccommodation';
@@ -19,7 +18,7 @@ export interface TimelineProps {
19
18
  className?: string;
20
19
  }
21
20
 
22
- export const Timeline: React.FC<TimelineProps> = (props) => {
21
+ export function Timeline(props: TimelineProps) {
23
22
  const { arrival, departure, services, className } = props;
24
23
  return (
25
24
  <div className={cn('space-y-10', className)}>
@@ -29,7 +28,7 @@ export const Timeline: React.FC<TimelineProps> = (props) => {
29
28
  {arrival}
30
29
  </Text>
31
30
  </TextWithIcon>
32
- <div className="overflow-x-auto">
31
+ <div className="overflow-x-auto overflow-y-hidden">
33
32
  <div className="flex gap-x-3 pb-8 2xl:pb-0">
34
33
  {services.map((service, index) => (
35
34
  <TimelineItem key={`tm-${index}`}>