mautourco-components 0.2.138 → 0.2.140

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;
@@ -46,24 +46,37 @@
46
46
  }
47
47
  }
48
48
  .table__body {
49
- tr {
49
+ > tr {
50
50
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
51
51
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
52
52
  transition-duration: 150ms;
53
53
  }
54
- tr {
54
+ > tr {
55
55
  transition-duration: 200ms;
56
56
  }
57
- tr {
57
+ > tr {
58
58
  border-top: solid 1px var(--color-surface-300);
59
- &:hover:not(.table__no-hover) {
59
+ &:hover:not(.table__row-with-children) {
60
60
  background-color: var(--color-elevation-state-hover-subtle);
61
61
  }
62
62
  &.table__row-highlighted:hover {
63
- tr {
63
+ .table__row-div-highlighted {
64
64
  background-color: var(--color-yellow-100);
65
65
  }
66
66
  }
67
+ &.table__row-div-highlighted {
68
+ div.table__nested-wrapper table tr {
69
+ background-color: var(--color-yellow-50);
70
+ &:hover {
71
+ background-color: var(--color-yellow-100);
72
+ }
73
+ }
74
+ }
75
+ &.table__row-with-children {
76
+ tr:hover {
77
+ background-color: var(--color-elevation-state-hover-subtle);
78
+ }
79
+ }
67
80
  &:first-child {
68
81
  border-top: none;
69
82
  }
@@ -72,7 +85,6 @@
72
85
  &:not(:nth-of-type(1)) {
73
86
  td {
74
87
  vertical-align: top;
75
- padding-top: 0;
76
88
  }
77
89
  }
78
90
  }
@@ -188,9 +200,13 @@
188
200
  }
189
201
  .table .table__nested-wrapper tr {
190
202
  border-top: none;
203
+ background-color: #fff;
191
204
  &:last-child {
192
205
  border-bottom: solid 1px var(--color-surface-300);
193
206
  }
207
+ &:hover {
208
+ background-color: var(--color-elevation-state-hover-subtle);
209
+ }
194
210
  }
195
211
  }
196
212
 
@@ -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.140",
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
  );
@@ -37,17 +37,30 @@
37
37
  }
38
38
  }
39
39
  .table__body {
40
- tr {
40
+ > tr {
41
41
  @apply transition-colors duration-200;
42
42
  border-top: solid 1px var(--color-surface-300);
43
- &:hover:not(.table__no-hover) {
43
+ &:hover:not(.table__row-with-children) {
44
44
  background-color: var(--color-elevation-state-hover-subtle);
45
45
  }
46
46
  &.table__row-highlighted:hover {
47
- tr {
47
+ .table__row-div-highlighted {
48
48
  background-color: var(--color-yellow-100);
49
49
  }
50
50
  }
51
+ &.table__row-div-highlighted {
52
+ div.table__nested-wrapper table tr {
53
+ background-color: var(--color-yellow-50);
54
+ &:hover {
55
+ background-color: var(--color-yellow-100);
56
+ }
57
+ }
58
+ }
59
+ &.table__row-with-children {
60
+ tr:hover {
61
+ background-color: var(--color-elevation-state-hover-subtle);
62
+ }
63
+ }
51
64
  &:first-child {
52
65
  border-top: none;
53
66
  }
@@ -56,7 +69,6 @@
56
69
  &:not(:nth-of-type(1)) {
57
70
  td {
58
71
  vertical-align: top;
59
- padding-top: 0;
60
72
  }
61
73
  }
62
74
  }
@@ -166,9 +178,13 @@
166
178
  }
167
179
  .table .table__nested-wrapper tr {
168
180
  border-top: none;
181
+ background-color: #fff;
169
182
  &:last-child {
170
183
  border-bottom: solid 1px var(--color-surface-300);
171
184
  }
185
+ &:hover {
186
+ background-color: var(--color-elevation-state-hover-subtle);
187
+ }
172
188
  }
173
189
  }
174
190
 
@@ -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> {