@shortstravelmgmt/component-lib 0.1.0
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 +209 -0
- package/dist/index.d.ts +2146 -0
- package/dist/index.esm.js +2163 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2296 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/styles.css.map +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,2163 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React, { forwardRef, useId, useState, useRef, useEffect, Children, useMemo, useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
const createIcon = (children, displayName) => {
|
|
5
|
+
const Icon = ({ size = 24, color = 'currentColor', ...props }) => (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", width: size, height: size, ...props, children: children }));
|
|
6
|
+
Icon.displayName = displayName;
|
|
7
|
+
return Icon;
|
|
8
|
+
};
|
|
9
|
+
// Travel / segment type icons
|
|
10
|
+
const PlaneIcon$4 = createIcon(jsx("path", { d: "M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z" }), 'PlaneIcon');
|
|
11
|
+
const CarIcon$2 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2" }), jsx("circle", { cx: "7", cy: "17", r: "2" }), jsx("path", { d: "M9 17h6" }), jsx("circle", { cx: "17", cy: "17", r: "2" })] }), 'CarIcon');
|
|
12
|
+
const HotelIcon$4 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M10 22v-6.57" }), jsx("path", { d: "M12 11h.01" }), jsx("path", { d: "M12 7h.01" }), jsx("path", { d: "M14 15.43V22" }), jsx("path", { d: "M15 16a5 5 0 0 0-6 0" }), jsx("path", { d: "M16 11h.01" }), jsx("path", { d: "M16 7h.01" }), jsx("path", { d: "M8 11h.01" }), jsx("path", { d: "M8 7h.01" }), jsx("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2" })] }), 'HotelIcon');
|
|
13
|
+
const LimoIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "m21 8-2 2-1.5-3.7A2 2 0 0 0 15.646 5H8.4a2 2 0 0 0-1.903 1.257L5 10 3 8" }), jsx("path", { d: "M7 14h.01" }), jsx("path", { d: "M17 14h.01" }), jsx("rect", { width: "18", height: "8", x: "3", y: "10", rx: "2" }), jsx("path", { d: "M5 18v2" }), jsx("path", { d: "M19 18v2" })] }), 'LimoIcon');
|
|
14
|
+
const RailIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M8 3.1V7a4 4 0 0 0 8 0V3.1" }), jsx("path", { d: "m9 15-1-1" }), jsx("path", { d: "m15 15 1-1" }), jsx("path", { d: "M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z" }), jsx("path", { d: "m8 19-2 3" }), jsx("path", { d: "m16 19 2 3" })] }), 'RailIcon');
|
|
15
|
+
const BusIcon$3 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M8 6v6" }), jsx("path", { d: "M15 6v6" }), jsx("path", { d: "M2 12h19.6" }), jsx("path", { d: "M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3" }), jsx("circle", { cx: "7", cy: "18", r: "2" }), jsx("path", { d: "M9 18h5" }), jsx("circle", { cx: "16", cy: "18", r: "2" })] }), 'BusIcon');
|
|
16
|
+
// Control / chrome icons
|
|
17
|
+
const SearchIcon$1 = createIcon(jsxs(Fragment, { children: [jsx("circle", { cx: "11", cy: "11", r: "8" }), jsx("path", { d: "m21 21-4.3-4.3" })] }), 'SearchIcon');
|
|
18
|
+
const ChevronDownIcon$1 = createIcon(jsx("path", { d: "m6 9 6 6 6-6" }), 'ChevronDownIcon');
|
|
19
|
+
const ChevronUpIcon = createIcon(jsx("path", { d: "m18 15-6-6-6 6" }), 'ChevronUpIcon');
|
|
20
|
+
const ChevronRightIcon$1 = createIcon(jsx("path", { d: "m9 18 6-6-6-6" }), 'ChevronRightIcon');
|
|
21
|
+
const ChevronLeftIcon = createIcon(jsx("path", { d: "m15 18-6-6 6-6" }), 'ChevronLeftIcon');
|
|
22
|
+
const ArrowUpRightIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M7 7h10v10" }), jsx("path", { d: "M7 17 17 7" })] }), 'ArrowUpRightIcon');
|
|
23
|
+
const EyeIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }), jsx("circle", { cx: "12", cy: "12", r: "3" })] }), 'EyeIcon');
|
|
24
|
+
const DownloadIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), jsx("polyline", { points: "7 10 12 15 17 10" }), jsx("line", { x1: "12", x2: "12", y1: "15", y2: "3" })] }), 'DownloadIcon');
|
|
25
|
+
const FilterIcon$1 = createIcon(jsx("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }), 'FilterIcon');
|
|
26
|
+
const CalendarIcon$1 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M8 2v4" }), jsx("path", { d: "M16 2v4" }), jsx("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2" }), jsx("path", { d: "M3 10h18" })] }), 'CalendarIcon');
|
|
27
|
+
const UserIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }), jsx("circle", { cx: "12", cy: "7", r: "4" })] }), 'UserIcon');
|
|
28
|
+
const UsersIcon$1 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }), jsx("circle", { cx: "9", cy: "7", r: "4" }), jsx("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }), jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })] }), 'UsersIcon');
|
|
29
|
+
const MailIcon = createIcon(jsxs(Fragment, { children: [jsx("rect", { width: "20", height: "16", x: "2", y: "4", rx: "2" }), jsx("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })] }), 'MailIcon');
|
|
30
|
+
const PhoneIcon = createIcon(jsx("path", { d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" }), 'PhoneIcon');
|
|
31
|
+
const PrinterIcon = createIcon(jsxs(Fragment, { children: [jsx("polyline", { points: "6 9 6 2 18 2 18 9" }), jsx("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }), jsx("rect", { width: "12", height: "8", x: "6", y: "14" })] }), 'PrinterIcon');
|
|
32
|
+
const RefreshIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }), jsx("path", { d: "M21 3v5h-5" }), jsx("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }), jsx("path", { d: "M8 16H3v5" })] }), 'RefreshIcon');
|
|
33
|
+
const WarningIcon$1 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }), jsx("path", { d: "M12 9v4" }), jsx("path", { d: "M12 17h.01" })] }), 'WarningIcon');
|
|
34
|
+
const CheckIcon$2 = createIcon(jsx("polyline", { points: "20 6 9 17 4 12" }), 'CheckIcon');
|
|
35
|
+
const XIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M18 6 6 18" }), jsx("path", { d: "m6 6 12 12" })] }), 'XIcon');
|
|
36
|
+
const PlusIcon$2 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M5 12h14" }), jsx("path", { d: "M12 5v14" })] }), 'PlusIcon');
|
|
37
|
+
const MinusIcon = createIcon(jsx("path", { d: "M5 12h14" }), 'MinusIcon');
|
|
38
|
+
const MenuIcon = createIcon(jsxs(Fragment, { children: [jsx("line", { x1: "4", x2: "20", y1: "12", y2: "12" }), jsx("line", { x1: "4", x2: "20", y1: "6", y2: "6" }), jsx("line", { x1: "4", x2: "20", y1: "18", y2: "18" })] }), 'MenuIcon');
|
|
39
|
+
const LightbulbIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5" }), jsx("path", { d: "M9 18h6" }), jsx("path", { d: "M10 22h4" })] }), 'LightbulbIcon');
|
|
40
|
+
const MegaphoneIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "m3 11 18-5v12L3 13v-2z" }), jsx("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })] }), 'MegaphoneIcon');
|
|
41
|
+
// Additional icons
|
|
42
|
+
const CloseIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M18 6 6 18" }), jsx("path", { d: "m6 6 12 12" })] }), 'CloseIcon');
|
|
43
|
+
const DashboardIcon = createIcon(jsxs(Fragment, { children: [jsx("rect", { width: "7", height: "9", x: "3", y: "3", rx: "1" }), jsx("rect", { width: "7", height: "5", x: "14", y: "3", rx: "1" }), jsx("rect", { width: "7", height: "9", x: "14", y: "12", rx: "1" }), jsx("rect", { width: "7", height: "5", x: "3", y: "16", rx: "1" })] }), 'DashboardIcon');
|
|
44
|
+
const ReportIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7l-5-5z" }), jsx("path", { d: "M14 2v5h5" }), jsx("path", { d: "M10 9h4" }), jsx("path", { d: "M10 13h4" }), jsx("path", { d: "M10 17h4" })] }), 'ReportIcon');
|
|
45
|
+
const SettingsIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }), jsx("circle", { cx: "12", cy: "12", r: "3" })] }), 'SettingsIcon');
|
|
46
|
+
const LogoIcon = createIcon(jsxs(Fragment, { children: [jsx("circle", { cx: "12", cy: "12", r: "10" }), jsx("path", { d: "M12 6v6l4 2" })] }), 'LogoIcon');
|
|
47
|
+
const TrendUpIcon = createIcon(jsxs(Fragment, { children: [jsx("polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17" }), jsx("polyline", { points: "16 7 22 7 22 13" })] }), 'TrendUpIcon');
|
|
48
|
+
const TrendDownIcon = createIcon(jsxs(Fragment, { children: [jsx("polyline", { points: "22 17 13.5 8.5 8.5 13.5 2 7" }), jsx("polyline", { points: "16 17 22 17 22 11" })] }), 'TrendDownIcon');
|
|
49
|
+
const InfoIcon$1 = createIcon(jsxs(Fragment, { children: [jsx("circle", { cx: "12", cy: "12", r: "10" }), jsx("path", { d: "M12 16v-4" }), jsx("path", { d: "M12 8h.01" })] }), 'InfoIcon');
|
|
50
|
+
const DocumentIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z" }), jsx("path", { d: "M14 2v6h6" }), jsx("path", { d: "M16 13H8" }), jsx("path", { d: "M16 17H8" })] }), 'DocumentIcon');
|
|
51
|
+
const BuildingIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }), jsx("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }), jsx("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }), jsx("path", { d: "M10 6h4" }), jsx("path", { d: "M10 10h4" }), jsx("path", { d: "M10 14h4" }), jsx("path", { d: "M10 18h4" })] }), 'BuildingIcon');
|
|
52
|
+
const GridIcon = createIcon(jsxs(Fragment, { children: [jsx("rect", { width: "7", height: "7", x: "3", y: "3", rx: "1" }), jsx("rect", { width: "7", height: "7", x: "14", y: "3", rx: "1" }), jsx("rect", { width: "7", height: "7", x: "14", y: "14", rx: "1" }), jsx("rect", { width: "7", height: "7", x: "3", y: "14", rx: "1" })] }), 'GridIcon');
|
|
53
|
+
const EditIcon$2 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" }), jsx("path", { d: "m15 5 4 4" })] }), 'EditIcon');
|
|
54
|
+
const HomeIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "m3 11 9-8 9 8" }), jsx("path", { d: "M5 10v10h14V10" }), jsx("path", { d: "M9 20v-6h6v6" })] }), 'HomeIcon');
|
|
55
|
+
const CubeIcon = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "m21 16-9 5-9-5V8l9-5 9 5z" }), jsx("path", { d: "m3.3 7 8.7 5 8.7-5" }), jsx("path", { d: "M12 22V12" })] }), 'CubeIcon');
|
|
56
|
+
const LockIcon$1 = createIcon(jsxs(Fragment, { children: [jsx("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2" }), jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }), 'LockIcon');
|
|
57
|
+
const TrashIcon$2 = createIcon(jsxs(Fragment, { children: [jsx("path", { d: "M3 6h18" }), jsx("path", { d: "M8 6V4h8v2" }), jsx("path", { d: "m19 6-1 15H6L5 6" }), jsx("path", { d: "M10 11v5" }), jsx("path", { d: "M14 11v5" })] }), 'TrashIcon');
|
|
58
|
+
// Export all icons as a map for dynamic access
|
|
59
|
+
const Icons = {
|
|
60
|
+
Plane: PlaneIcon$4,
|
|
61
|
+
Car: CarIcon$2,
|
|
62
|
+
Hotel: HotelIcon$4,
|
|
63
|
+
Limo: LimoIcon,
|
|
64
|
+
Rail: RailIcon,
|
|
65
|
+
Bus: BusIcon$3,
|
|
66
|
+
Search: SearchIcon$1,
|
|
67
|
+
ChevronDown: ChevronDownIcon$1,
|
|
68
|
+
ChevronUp: ChevronUpIcon,
|
|
69
|
+
ChevronRight: ChevronRightIcon$1,
|
|
70
|
+
ChevronLeft: ChevronLeftIcon,
|
|
71
|
+
ArrowUpRight: ArrowUpRightIcon,
|
|
72
|
+
Eye: EyeIcon,
|
|
73
|
+
Download: DownloadIcon,
|
|
74
|
+
Filter: FilterIcon$1,
|
|
75
|
+
Calendar: CalendarIcon$1,
|
|
76
|
+
User: UserIcon,
|
|
77
|
+
Users: UsersIcon$1,
|
|
78
|
+
Mail: MailIcon,
|
|
79
|
+
Phone: PhoneIcon,
|
|
80
|
+
Printer: PrinterIcon,
|
|
81
|
+
Refresh: RefreshIcon,
|
|
82
|
+
Warning: WarningIcon$1,
|
|
83
|
+
Check: CheckIcon$2,
|
|
84
|
+
X: XIcon,
|
|
85
|
+
Close: CloseIcon,
|
|
86
|
+
Plus: PlusIcon$2,
|
|
87
|
+
Minus: MinusIcon,
|
|
88
|
+
Menu: MenuIcon,
|
|
89
|
+
Lightbulb: LightbulbIcon,
|
|
90
|
+
Megaphone: MegaphoneIcon,
|
|
91
|
+
Dashboard: DashboardIcon,
|
|
92
|
+
Report: ReportIcon,
|
|
93
|
+
Settings: SettingsIcon,
|
|
94
|
+
Logo: LogoIcon,
|
|
95
|
+
TrendUp: TrendUpIcon,
|
|
96
|
+
TrendDown: TrendDownIcon,
|
|
97
|
+
Info: InfoIcon$1,
|
|
98
|
+
Document: DocumentIcon,
|
|
99
|
+
Building: BuildingIcon,
|
|
100
|
+
Grid: GridIcon,
|
|
101
|
+
Edit: EditIcon$2,
|
|
102
|
+
Home: HomeIcon,
|
|
103
|
+
Cube: CubeIcon,
|
|
104
|
+
Lock: LockIcon$1,
|
|
105
|
+
Trash: TrashIcon$2,
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var styles$$ = {"alert":"Alert-module_alert__xxiES","content":"Alert-module_content__CVX32","icon":"Alert-module_icon__Xyh6J","body":"Alert-module_body__TTkmt","title":"Alert-module_title__7wNPO","message":"Alert-module_message__plreL","dismissButton":"Alert-module_dismissButton__MdRWh","primary":"Alert-module_primary__nME13","success":"Alert-module_success__GDt4S","warning":"Alert-module_warning__y4bLx","error":"Alert-module_error__nKMAG"};
|
|
109
|
+
|
|
110
|
+
const variantIcons = {
|
|
111
|
+
primary: LightbulbIcon,
|
|
112
|
+
success: CheckIcon$2,
|
|
113
|
+
warning: WarningIcon$1,
|
|
114
|
+
error: WarningIcon$1,
|
|
115
|
+
};
|
|
116
|
+
const Alert = ({ variant = 'primary', title, children, dismissible = false, onDismiss, className = '', }) => {
|
|
117
|
+
const IconComponent = variantIcons[variant];
|
|
118
|
+
return (jsx("div", { className: `${styles$$.alert} ${styles$$[variant]} ${className}`, role: "alert", children: jsxs("div", { className: styles$$.content, children: [jsx(IconComponent, { className: styles$$.icon, size: 20 }), jsxs("div", { className: styles$$.body, children: [title && jsx("h4", { className: styles$$.title, children: title }), jsx("div", { className: styles$$.message, children: children })] }), dismissible && onDismiss && (jsx("button", { type: "button", onClick: onDismiss, className: styles$$.dismissButton, "aria-label": "Dismiss alert", children: jsx(CloseIcon, { size: 16 }) }))] }) }));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
var styles$_ = {"avatar":"Avatar-module_avatar__AcTRg","xs":"Avatar-module_xs__4uGxI","sm":"Avatar-module_sm__NvzTi","md":"Avatar-module_md__PgY8p","lg":"Avatar-module_lg__lhkAZ","xl":"Avatar-module_xl__qTDTF","image":"Avatar-module_image__GX2c9","initials":"Avatar-module_initials__58FHH","group":"Avatar-module_group__XW0b1","overflow":"Avatar-module_overflow__ul4Cc"};
|
|
122
|
+
|
|
123
|
+
const getInitials = (name) => {
|
|
124
|
+
const parts = name.trim().split(/\s+/);
|
|
125
|
+
if (parts.length >= 2) {
|
|
126
|
+
return `${parts[0][0]}${parts[parts.length - 1][0]}`.toUpperCase();
|
|
127
|
+
}
|
|
128
|
+
return name.slice(0, 2).toUpperCase();
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Avatar component for user profile images or initials.
|
|
132
|
+
*/
|
|
133
|
+
const Avatar = ({ src, alt, initials, name, size = 'md', className = '', ...props }) => {
|
|
134
|
+
const displayInitials = initials || (name ? getInitials(name) : '?');
|
|
135
|
+
const classNames = [
|
|
136
|
+
styles$_.avatar,
|
|
137
|
+
styles$_[size],
|
|
138
|
+
className,
|
|
139
|
+
]
|
|
140
|
+
.filter(Boolean)
|
|
141
|
+
.join(' ');
|
|
142
|
+
return (jsx("div", { className: classNames, ...props, children: src ? (jsx("img", { src: src, alt: alt || name || 'Avatar', className: styles$_.image })) : (jsx("span", { className: styles$_.initials, children: displayInitials })) }));
|
|
143
|
+
};
|
|
144
|
+
Avatar.displayName = 'Avatar';
|
|
145
|
+
const AvatarGroup = ({ max = 4, className = '', children, ...props }) => {
|
|
146
|
+
const childArray = React.Children.toArray(children);
|
|
147
|
+
const visibleChildren = childArray.slice(0, max);
|
|
148
|
+
const remainingCount = childArray.length - max;
|
|
149
|
+
const classNames = [styles$_.group, className].filter(Boolean).join(' ');
|
|
150
|
+
return (jsxs("div", { className: classNames, ...props, children: [visibleChildren, remainingCount > 0 && (jsx("div", { className: `${styles$_.avatar} ${styles$_.md} ${styles$_.overflow}`, children: jsxs("span", { className: styles$_.initials, children: ["+", remainingCount] }) }))] }));
|
|
151
|
+
};
|
|
152
|
+
AvatarGroup.displayName = 'AvatarGroup';
|
|
153
|
+
|
|
154
|
+
var styles$Z = {"badge":"Badge-module_badge__lvuUg","sm":"Badge-module_sm__OTBAp","md":"Badge-module_md__YG44i","dot":"Badge-module_dot__RgcVD","default":"Badge-module_default__1ga4w","success":"Badge-module_success__jEfI9","warning":"Badge-module_warning__978mf","error":"Badge-module_error__xZJlm","info":"Badge-module_info__Xk7MM"};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Badge component for status indicators, labels, and tags.
|
|
158
|
+
*/
|
|
159
|
+
const Badge = ({ variant = 'default', size = 'md', dot = false, className = '', children, ...props }) => {
|
|
160
|
+
const classNames = [
|
|
161
|
+
styles$Z.badge,
|
|
162
|
+
styles$Z[variant],
|
|
163
|
+
styles$Z[size],
|
|
164
|
+
className,
|
|
165
|
+
]
|
|
166
|
+
.filter(Boolean)
|
|
167
|
+
.join(' ');
|
|
168
|
+
return (jsxs("span", { className: classNames, ...props, children: [dot && jsx("span", { className: styles$Z.dot }), children] }));
|
|
169
|
+
};
|
|
170
|
+
Badge.displayName = 'Badge';
|
|
171
|
+
|
|
172
|
+
var styles$Y = {"button":"Button-module_button__xDdzH","sm":"Button-module_sm__fb2AF","md":"Button-module_md__XOa6t","lg":"Button-module_lg__UN9rL","square":"Button-module_square__-o34b","primary":"Button-module_primary__jWHqR","secondary":"Button-module_secondary__30FUq","outline":"Button-module_outline__v98mS","ghost":"Button-module_ghost__XUGB1","danger":"Button-module_danger__NUxPy","fullWidth":"Button-module_fullWidth__p2otK","loading":"Button-module_loading__TsL5I","spinner":"Button-module_spinner__6bZoj","spin":"Button-module_spin__ZPDMG","icon":"Button-module_icon__21hUM","content":"Button-module_content__iVRPQ"};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Primary button component for user interactions.
|
|
176
|
+
* Supports multiple variants, sizes, and states.
|
|
177
|
+
*/
|
|
178
|
+
const Button = forwardRef(({ variant = 'primary', size = 'md', fullWidth = false, loading = false, leftIcon, rightIcon, square = false, className = '', disabled, children, ...props }, ref) => {
|
|
179
|
+
const classNames = [
|
|
180
|
+
styles$Y.button,
|
|
181
|
+
styles$Y[variant],
|
|
182
|
+
styles$Y[size],
|
|
183
|
+
fullWidth ? styles$Y.fullWidth : '',
|
|
184
|
+
square ? styles$Y.square : '',
|
|
185
|
+
loading ? styles$Y.loading : '',
|
|
186
|
+
className,
|
|
187
|
+
]
|
|
188
|
+
.filter(Boolean)
|
|
189
|
+
.join(' ');
|
|
190
|
+
return (jsxs("button", { ref: ref, className: classNames, disabled: disabled || loading, ...props, children: [loading && (jsx("span", { className: styles$Y.spinner, children: jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("circle", { cx: "12", cy: "12", r: "10", strokeOpacity: "0.25" }), jsx("path", { d: "M12 2a10 10 0 0 1 10 10", strokeLinecap: "round" })] }) })), !loading && leftIcon && jsx("span", { className: styles$Y.icon, children: leftIcon }), children && jsx("span", { className: styles$Y.content, children: children }), !loading && rightIcon && jsx("span", { className: styles$Y.icon, children: rightIcon })] }));
|
|
191
|
+
});
|
|
192
|
+
Button.displayName = 'Button';
|
|
193
|
+
|
|
194
|
+
var styles$X = {"wrapper":"Checkbox-module_wrapper__tYM-f","label":"Checkbox-module_label__x7c9f","disabled":"Checkbox-module_disabled__YtL8b","checkboxWrapper":"Checkbox-module_checkboxWrapper__ez0mi","input":"Checkbox-module_input__xBHoX","checkbox":"Checkbox-module_checkbox__zGuTf","sm":"Checkbox-module_sm__naurE","md":"Checkbox-module_md__LlE6O","lg":"Checkbox-module_lg__dMWT-","hasError":"Checkbox-module_hasError__aCefd","labelText":"Checkbox-module_labelText__7arlw","helperText":"Checkbox-module_helperText__jR4oi","errorText":"Checkbox-module_errorText__u8puP"};
|
|
195
|
+
|
|
196
|
+
const CheckIcon$1 = () => (jsx("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M1 4L3.5 6.5L9 1", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
197
|
+
const IndeterminateIcon = () => (jsx("svg", { width: "10", height: "2", viewBox: "0 0 10 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M1 1H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
|
|
198
|
+
/**
|
|
199
|
+
* Checkbox component for boolean selections.
|
|
200
|
+
*/
|
|
201
|
+
const Checkbox = forwardRef(({ label, size = 'md', helperText, error, indeterminate = false, className = '', disabled, id, checked, ...props }, ref) => {
|
|
202
|
+
const generatedId = useId();
|
|
203
|
+
const checkboxId = id || generatedId;
|
|
204
|
+
const helperId = `${checkboxId}-helper`;
|
|
205
|
+
const errorId = `${checkboxId}-error`;
|
|
206
|
+
const wrapperClasses = [
|
|
207
|
+
styles$X.wrapper,
|
|
208
|
+
styles$X[size],
|
|
209
|
+
disabled ? styles$X.disabled : '',
|
|
210
|
+
error ? styles$X.hasError : '',
|
|
211
|
+
className,
|
|
212
|
+
].filter(Boolean).join(' ');
|
|
213
|
+
// Handle indeterminate state via ref
|
|
214
|
+
const inputRef = (node) => {
|
|
215
|
+
if (node) {
|
|
216
|
+
node.indeterminate = indeterminate;
|
|
217
|
+
}
|
|
218
|
+
// Forward ref
|
|
219
|
+
if (typeof ref === 'function') {
|
|
220
|
+
ref(node);
|
|
221
|
+
}
|
|
222
|
+
else if (ref) {
|
|
223
|
+
ref.current = node;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
return (jsxs("div", { className: wrapperClasses, children: [jsxs("label", { className: styles$X.label, children: [jsxs("div", { className: styles$X.checkboxWrapper, children: [jsx("input", { ref: inputRef, type: "checkbox", id: checkboxId, className: styles$X.input, disabled: disabled, checked: checked, "aria-invalid": !!error, "aria-describedby": [error ? errorId : null, helperText ? helperId : null]
|
|
227
|
+
.filter(Boolean)
|
|
228
|
+
.join(' ') || undefined, ...props }), jsx("span", { className: styles$X.checkbox, children: indeterminate ? jsx(IndeterminateIcon, {}) : jsx(CheckIcon$1, {}) })] }), label && jsx("span", { className: styles$X.labelText, children: label })] }), error && (jsx("span", { id: errorId, className: styles$X.errorText, children: error })), helperText && !error && (jsx("span", { id: helperId, className: styles$X.helperText, children: helperText }))] }));
|
|
229
|
+
});
|
|
230
|
+
Checkbox.displayName = 'Checkbox';
|
|
231
|
+
|
|
232
|
+
var styles$W = {"wrapper":"Datepicker-module_wrapper__SdezU","fullWidth":"Datepicker-module_fullWidth__CAeMt","label":"Datepicker-module_label__qUNBV","inputWrapper":"Datepicker-module_inputWrapper__FK2IJ","sm":"Datepicker-module_sm__DuDMB","md":"Datepicker-module_md__oyus3","lg":"Datepicker-module_lg__2sqBg","icon":"Datepicker-module_icon__WdaRf","input":"Datepicker-module_input__4TCcy","disabled":"Datepicker-module_disabled__W0e-a","error":"Datepicker-module_error__XPpIy","helperText":"Datepicker-module_helperText__UllZP","errorText":"Datepicker-module_errorText__lveyr"};
|
|
233
|
+
|
|
234
|
+
const CalendarIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })] }));
|
|
235
|
+
/**
|
|
236
|
+
* Datepicker component for selecting dates.
|
|
237
|
+
*/
|
|
238
|
+
const Datepicker = forwardRef(({ size = 'md', label, helperText, error, fullWidth = false, className = '', id, disabled, ...props }, ref) => {
|
|
239
|
+
const generatedId = useId();
|
|
240
|
+
const inputId = id || generatedId;
|
|
241
|
+
const helperId = `${inputId}-helper`;
|
|
242
|
+
const errorId = `${inputId}-error`;
|
|
243
|
+
const wrapperClasses = [
|
|
244
|
+
styles$W.wrapper,
|
|
245
|
+
fullWidth ? styles$W.fullWidth : '',
|
|
246
|
+
className,
|
|
247
|
+
].filter(Boolean).join(' ');
|
|
248
|
+
const inputWrapperClasses = [
|
|
249
|
+
styles$W.inputWrapper,
|
|
250
|
+
styles$W[size],
|
|
251
|
+
error ? styles$W.error : '',
|
|
252
|
+
disabled ? styles$W.disabled : '',
|
|
253
|
+
].filter(Boolean).join(' ');
|
|
254
|
+
return (jsxs("div", { className: wrapperClasses, children: [label && (jsx("label", { htmlFor: inputId, className: styles$W.label, children: label })), jsxs("div", { className: inputWrapperClasses, children: [jsx("span", { className: styles$W.icon, children: jsx(CalendarIcon, {}) }), jsx("input", { ref: ref, type: "date", id: inputId, className: styles$W.input, disabled: disabled, "aria-invalid": !!error, "aria-describedby": [error ? errorId : null, helperText ? helperId : null]
|
|
255
|
+
.filter(Boolean)
|
|
256
|
+
.join(' ') || undefined, ...props })] }), error && (jsx("span", { id: errorId, className: styles$W.errorText, children: error })), helperText && !error && (jsx("span", { id: helperId, className: styles$W.helperText, children: helperText }))] }));
|
|
257
|
+
});
|
|
258
|
+
Datepicker.displayName = 'Datepicker';
|
|
259
|
+
|
|
260
|
+
var styles$V = {"wrapper":"Input-module_wrapper__-8ija","fullWidth":"Input-module_fullWidth__xXOvN","label":"Input-module_label__t4LH-","inputWrapper":"Input-module_inputWrapper__U4EEd","error":"Input-module_error__fT9Sb","disabled":"Input-module_disabled__3tnIE","sm":"Input-module_sm__lGHP-","md":"Input-module_md__pReoW","lg":"Input-module_lg__iqqov","input":"Input-module_input__PeHY6","icon":"Input-module_icon__jkJiF","textarea":"Input-module_textarea__ZgdBz","helperText":"Input-module_helperText__eKsC8","errorText":"Input-module_errorText__xoiKP"};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Input component for text entry.
|
|
264
|
+
*/
|
|
265
|
+
const Input = forwardRef(({ size = 'md', label, helperText, error, leftIcon, rightIcon, fullWidth = false, className = '', id, disabled, ...props }, ref) => {
|
|
266
|
+
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
267
|
+
const wrapperClasses = [
|
|
268
|
+
styles$V.wrapper,
|
|
269
|
+
fullWidth ? styles$V.fullWidth : '',
|
|
270
|
+
className,
|
|
271
|
+
]
|
|
272
|
+
.filter(Boolean)
|
|
273
|
+
.join(' ');
|
|
274
|
+
const inputWrapperClasses = [
|
|
275
|
+
styles$V.inputWrapper,
|
|
276
|
+
styles$V[size],
|
|
277
|
+
error ? styles$V.error : '',
|
|
278
|
+
disabled ? styles$V.disabled : '',
|
|
279
|
+
]
|
|
280
|
+
.filter(Boolean)
|
|
281
|
+
.join(' ');
|
|
282
|
+
return (jsxs("div", { className: wrapperClasses, children: [label && (jsx("label", { htmlFor: inputId, className: styles$V.label, children: label })), jsxs("div", { className: inputWrapperClasses, children: [leftIcon && jsx("span", { className: styles$V.icon, children: leftIcon }), jsx("input", { ref: ref, id: inputId, className: styles$V.input, disabled: disabled, "aria-invalid": !!error, "aria-describedby": error ? `${inputId}-error` : helperText ? `${inputId}-helper` : undefined, ...props }), rightIcon && jsx("span", { className: styles$V.icon, children: rightIcon })] }), error && (jsx("span", { id: `${inputId}-error`, className: styles$V.errorText, children: error })), helperText && !error && (jsx("span", { id: `${inputId}-helper`, className: styles$V.helperText, children: helperText }))] }));
|
|
283
|
+
});
|
|
284
|
+
Input.displayName = 'Input';
|
|
285
|
+
const Textarea = forwardRef(({ size = 'md', label, helperText, error, fullWidth = false, className = '', id, disabled, rows = 4, ...props }, ref) => {
|
|
286
|
+
const textareaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
287
|
+
const wrapperClasses = [
|
|
288
|
+
styles$V.wrapper,
|
|
289
|
+
fullWidth ? styles$V.fullWidth : '',
|
|
290
|
+
className,
|
|
291
|
+
]
|
|
292
|
+
.filter(Boolean)
|
|
293
|
+
.join(' ');
|
|
294
|
+
const textareaClasses = [
|
|
295
|
+
styles$V.textarea,
|
|
296
|
+
styles$V[size],
|
|
297
|
+
error ? styles$V.error : '',
|
|
298
|
+
disabled ? styles$V.disabled : '',
|
|
299
|
+
]
|
|
300
|
+
.filter(Boolean)
|
|
301
|
+
.join(' ');
|
|
302
|
+
return (jsxs("div", { className: wrapperClasses, children: [label && (jsx("label", { htmlFor: textareaId, className: styles$V.label, children: label })), jsx("textarea", { ref: ref, id: textareaId, className: textareaClasses, disabled: disabled, rows: rows, "aria-invalid": !!error, "aria-describedby": error ? `${textareaId}-error` : helperText ? `${textareaId}-helper` : undefined, ...props }), error && (jsx("span", { id: `${textareaId}-error`, className: styles$V.errorText, children: error })), helperText && !error && (jsx("span", { id: `${textareaId}-helper`, className: styles$V.helperText, children: helperText }))] }));
|
|
303
|
+
});
|
|
304
|
+
Textarea.displayName = 'Textarea';
|
|
305
|
+
|
|
306
|
+
var styles$U = {"metric":"Metric-module_metric__LZ8D-","dark":"Metric-module_dark__FKdvj","clickable":"Metric-module_clickable__c3-pM","content":"Metric-module_content__YYpBG","valueRow":"Metric-module_valueRow__JpgYR","valueContainer":"Metric-module_valueContainer__CzjZ1","prefix":"Metric-module_prefix__Agpzq","value":"Metric-module_value__zspnf","suffix":"Metric-module_suffix__qvCMJ","warningIcon":"Metric-module_warningIcon__F-Ol5","label":"Metric-module_label__ydcti"};
|
|
307
|
+
|
|
308
|
+
const WarningIcon = () => (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: jsx("path", { d: "M12 2L1 21h22L12 2zm0 3.5L19.5 19H4.5L12 5.5zM11 10v4h2v-4h-2zm0 6v2h2v-2h-2z" }) }));
|
|
309
|
+
/**
|
|
310
|
+
* Metric component for displaying key performance indicators.
|
|
311
|
+
* Used in dashboards for trip counts, costs, and status metrics.
|
|
312
|
+
*/
|
|
313
|
+
const Metric = ({ value, label, prefix, suffix, dark = false, onClick, className = '', warning = false, }) => {
|
|
314
|
+
const displayValue = value !== undefined && !isNaN(parseFloat(String(value))) ? value : 0;
|
|
315
|
+
return (jsx("div", { className: `
|
|
316
|
+
${styles$U.metric}
|
|
317
|
+
${dark ? styles$U.dark : ''}
|
|
318
|
+
${onClick ? styles$U.clickable : ''}
|
|
319
|
+
${className}
|
|
320
|
+
`, onClick: onClick, children: value !== undefined && (jsxs("div", { className: styles$U.content, children: [jsxs("div", { className: styles$U.valueRow, children: [jsxs("div", { className: styles$U.valueContainer, children: [prefix && jsx("span", { className: styles$U.prefix, children: prefix }), jsx("span", { className: styles$U.value, children: displayValue }), suffix && jsx("span", { className: styles$U.suffix, children: suffix })] }), warning && (jsx("div", { className: styles$U.warningIcon, children: jsx(WarningIcon, {}) }))] }), jsx("div", { className: styles$U.label, children: label })] })) }));
|
|
321
|
+
};
|
|
322
|
+
Metric.displayName = 'Metric';
|
|
323
|
+
|
|
324
|
+
var styles$T = {"wrapper":"Select-module_wrapper__UN2Bo","fullWidth":"Select-module_fullWidth__GgV-D","label":"Select-module_label__aSRVE","selectWrapper":"Select-module_selectWrapper__OCGYf","sm":"Select-module_sm__oTHGX","md":"Select-module_md__VSZQg","lg":"Select-module_lg__nknhY","select":"Select-module_select__DY-Id","hasLeftIcon":"Select-module_hasLeftIcon__ZrReQ","leftIcon":"Select-module_leftIcon__nBU1-","chevron":"Select-module_chevron__1MAEQ","disabled":"Select-module_disabled__0GOXE","error":"Select-module_error__Yijk5","helperText":"Select-module_helperText__rHrqP","errorText":"Select-module_errorText__1kM2R"};
|
|
325
|
+
|
|
326
|
+
const ChevronDownIcon = () => (jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "6 9 12 15 18 9" }) }));
|
|
327
|
+
/**
|
|
328
|
+
* Select component for choosing from a list of options.
|
|
329
|
+
*/
|
|
330
|
+
const Select = forwardRef(({ options, optionGroups, size = 'md', label, placeholder, helperText, error, leftIcon, fullWidth = false, className = '', id, disabled, ...props }, ref) => {
|
|
331
|
+
const generatedId = useId();
|
|
332
|
+
const selectId = id || generatedId;
|
|
333
|
+
const helperId = `${selectId}-helper`;
|
|
334
|
+
const errorId = `${selectId}-error`;
|
|
335
|
+
const wrapperClasses = [
|
|
336
|
+
styles$T.wrapper,
|
|
337
|
+
fullWidth ? styles$T.fullWidth : '',
|
|
338
|
+
className,
|
|
339
|
+
].filter(Boolean).join(' ');
|
|
340
|
+
const selectWrapperClasses = [
|
|
341
|
+
styles$T.selectWrapper,
|
|
342
|
+
styles$T[size],
|
|
343
|
+
error ? styles$T.error : '',
|
|
344
|
+
disabled ? styles$T.disabled : '',
|
|
345
|
+
leftIcon ? styles$T.hasLeftIcon : '',
|
|
346
|
+
].filter(Boolean).join(' ');
|
|
347
|
+
const renderOptions = () => {
|
|
348
|
+
// Render grouped options
|
|
349
|
+
if (optionGroups && optionGroups.length > 0) {
|
|
350
|
+
return optionGroups.map((group, i) => (jsx("optgroup", { label: group.label, children: group.options.map((option) => (jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value))) }, i)));
|
|
351
|
+
}
|
|
352
|
+
// Render flat options
|
|
353
|
+
if (options && options.length > 0) {
|
|
354
|
+
return options.map((option) => (jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value)));
|
|
355
|
+
}
|
|
356
|
+
return null;
|
|
357
|
+
};
|
|
358
|
+
return (jsxs("div", { className: wrapperClasses, children: [label && (jsx("label", { htmlFor: selectId, className: styles$T.label, children: label })), jsxs("div", { className: selectWrapperClasses, children: [leftIcon && jsx("span", { className: styles$T.leftIcon, children: leftIcon }), jsxs("select", { ref: ref, id: selectId, className: styles$T.select, disabled: disabled, "aria-invalid": !!error, "aria-describedby": [error ? errorId : null, helperText ? helperId : null]
|
|
359
|
+
.filter(Boolean)
|
|
360
|
+
.join(' ') || undefined, ...props, children: [placeholder && (jsx("option", { value: "", disabled: true, children: placeholder })), renderOptions()] }), jsx("span", { className: styles$T.chevron, children: jsx(ChevronDownIcon, {}) })] }), error && (jsx("span", { id: errorId, className: styles$T.errorText, children: error })), helperText && !error && (jsx("span", { id: helperId, className: styles$T.helperText, children: helperText }))] }));
|
|
361
|
+
});
|
|
362
|
+
Select.displayName = 'Select';
|
|
363
|
+
|
|
364
|
+
var styles$S = {"spinner":"Spinner-module_spinner__OZwmB","svg":"Spinner-module_svg__Tusqk","spin":"Spinner-module_spin__YAPc9","track":"Spinner-module_track__NxLfV","indicator":"Spinner-module_indicator__gSUxF","xs":"Spinner-module_xs__4-WEg","sm":"Spinner-module_sm__enoDn","md":"Spinner-module_md__6axf9","lg":"Spinner-module_lg__EvJyC","xl":"Spinner-module_xl__yIXoK","srOnly":"Spinner-module_srOnly__WnZYf"};
|
|
365
|
+
|
|
366
|
+
const Spinner = ({ size = 'md', className = '', color, label = 'Loading...', }) => {
|
|
367
|
+
return (jsxs("span", { className: `${styles$S.spinner} ${styles$S[size]} ${className}`, role: "status", "aria-label": label, style: color ? { color } : undefined, children: [jsxs("svg", { className: styles$S.svg, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("circle", { className: styles$S.track, cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), jsx("path", { className: styles$S.indicator, fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), jsx("span", { className: styles$S.srOnly, children: label })] }));
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
var styles$R = {"badge":"StatusBadge-module_badge__-BwEk","ticketed":"StatusBadge-module_ticketed__AJVZM","itinerary":"StatusBadge-module_itinerary__yRFNy","not-ticketed":"StatusBadge-module_not-ticketed__76GXg","submitted":"StatusBadge-module_submitted__QW0LL","pending":"StatusBadge-module_pending__FpMYC","cancelled":"StatusBadge-module_cancelled__XRz4S"};
|
|
371
|
+
|
|
372
|
+
const statusLabels = {
|
|
373
|
+
ticketed: 'Ticketed',
|
|
374
|
+
itinerary: 'Itinerary',
|
|
375
|
+
'not-ticketed': 'Not Ticketed',
|
|
376
|
+
submitted: 'Submitted',
|
|
377
|
+
pending: 'Pending',
|
|
378
|
+
cancelled: 'Cancelled',
|
|
379
|
+
};
|
|
380
|
+
const StatusBadge = ({ status, label, className, }) => {
|
|
381
|
+
const displayLabel = label || statusLabels[status] || status;
|
|
382
|
+
return (jsx("span", { className: `${styles$R.badge} ${styles$R[status]} ${className || ''}`, "data-status": status, children: displayLabel }));
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
var styles$Q = {"tag":"Tag-module_tag__uQVQa","content":"Tag-module_content__Z5bK9","sm":"Tag-module_sm__DvKJV","md":"Tag-module_md__KTo2m","lg":"Tag-module_lg__8xhWB","default":"Tag-module_default__5-uQz","primary":"Tag-module_primary__lwwYl","success":"Tag-module_success__kl3II","warning":"Tag-module_warning__peZRm","error":"Tag-module_error__6xzkl","info":"Tag-module_info__eKYiV","clickable":"Tag-module_clickable__TyiNK","removeButton":"Tag-module_removeButton__peMwo","removeIcon":"Tag-module_removeIcon__dQyJZ"};
|
|
386
|
+
|
|
387
|
+
const Tag = ({ children, variant = 'default', size = 'md', removable = false, onRemove, onClick, className = '', style, }) => {
|
|
388
|
+
const isClickable = Boolean(onClick);
|
|
389
|
+
return (jsxs("span", { className: `${styles$Q.tag} ${styles$Q[variant]} ${styles$Q[size]} ${isClickable ? styles$Q.clickable : ''} ${className}`, onClick: onClick, style: style, role: isClickable ? 'button' : undefined, tabIndex: isClickable ? 0 : undefined, children: [jsx("span", { className: styles$Q.content, children: children }), removable && (jsx("button", { type: "button", className: styles$Q.removeButton, onClick: (e) => {
|
|
390
|
+
e.stopPropagation();
|
|
391
|
+
onRemove?.();
|
|
392
|
+
}, "aria-label": "Remove", children: jsx("svg", { className: styles$Q.removeIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) }))] }));
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
var styles$P = {"wrapper":"Timepicker-module_wrapper__pPrwn","fullWidth":"Timepicker-module_fullWidth__de3hO","label":"Timepicker-module_label__5RDrm","inputWrapper":"Timepicker-module_inputWrapper__-E5pk","sm":"Timepicker-module_sm__sWJu2","md":"Timepicker-module_md__TfpGX","lg":"Timepicker-module_lg__xSlw-","icon":"Timepicker-module_icon__NuPk4","input":"Timepicker-module_input__NxTmR","disabled":"Timepicker-module_disabled__lyxzF","error":"Timepicker-module_error__TOMK7","helperText":"Timepicker-module_helperText__MmcqS","errorText":"Timepicker-module_errorText__pXdnE"};
|
|
396
|
+
|
|
397
|
+
const ClockIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("circle", { cx: "12", cy: "12", r: "10" }), jsx("polyline", { points: "12 6 12 12 16 14" })] }));
|
|
398
|
+
/**
|
|
399
|
+
* Timepicker component for selecting times.
|
|
400
|
+
*/
|
|
401
|
+
const Timepicker = forwardRef(({ size = 'md', label, helperText, error, fullWidth = false, className = '', id, disabled, ...props }, ref) => {
|
|
402
|
+
const generatedId = useId();
|
|
403
|
+
const inputId = id || generatedId;
|
|
404
|
+
const helperId = `${inputId}-helper`;
|
|
405
|
+
const errorId = `${inputId}-error`;
|
|
406
|
+
const wrapperClasses = [
|
|
407
|
+
styles$P.wrapper,
|
|
408
|
+
fullWidth ? styles$P.fullWidth : '',
|
|
409
|
+
className,
|
|
410
|
+
].filter(Boolean).join(' ');
|
|
411
|
+
const inputWrapperClasses = [
|
|
412
|
+
styles$P.inputWrapper,
|
|
413
|
+
styles$P[size],
|
|
414
|
+
error ? styles$P.error : '',
|
|
415
|
+
disabled ? styles$P.disabled : '',
|
|
416
|
+
].filter(Boolean).join(' ');
|
|
417
|
+
return (jsxs("div", { className: wrapperClasses, children: [label && (jsx("label", { htmlFor: inputId, className: styles$P.label, children: label })), jsxs("div", { className: inputWrapperClasses, children: [jsx("span", { className: styles$P.icon, children: jsx(ClockIcon, {}) }), jsx("input", { ref: ref, type: "time", id: inputId, className: styles$P.input, disabled: disabled, "aria-invalid": !!error, "aria-describedby": [error ? errorId : null, helperText ? helperId : null]
|
|
418
|
+
.filter(Boolean)
|
|
419
|
+
.join(' ') || undefined, ...props })] }), error && (jsx("span", { id: errorId, className: styles$P.errorText, children: error })), helperText && !error && (jsx("span", { id: helperId, className: styles$P.helperText, children: helperText }))] }));
|
|
420
|
+
});
|
|
421
|
+
Timepicker.displayName = 'Timepicker';
|
|
422
|
+
|
|
423
|
+
var styles$O = {"title":"Title-module_title__mSSqn","light":"Title-module_light__7mlh-","normal":"Title-module_normal__ZYrS4","medium":"Title-module_medium__UK-Bj","semibold":"Title-module_semibold__07lTs","bold":"Title-module_bold__-oWUS"};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Title component for page headings.
|
|
427
|
+
* Large, prominent text for page titles.
|
|
428
|
+
*/
|
|
429
|
+
const Title = ({ children, weight = 'light', className = '', }) => {
|
|
430
|
+
return (jsx("h1", { className: `${styles$O.title} ${styles$O[weight]} ${className}`, children: children }));
|
|
431
|
+
};
|
|
432
|
+
Title.displayName = 'Title';
|
|
433
|
+
|
|
434
|
+
var styles$N = {"toggle":"Toggle-module_toggle__lRFvk","checked":"Toggle-module_checked__duOWU","disabled":"Toggle-module_disabled__DV2FB","thumb":"Toggle-module_thumb__ehIbb","sm":"Toggle-module_sm__Gs9bK","md":"Toggle-module_md__hTNCY","lg":"Toggle-module_lg__DpHtS","wrapper":"Toggle-module_wrapper__-Bvff","wrapperDisabled":"Toggle-module_wrapperDisabled__ZSCvM","label":"Toggle-module_label__GeuIf"};
|
|
435
|
+
|
|
436
|
+
const Toggle = ({ checked, onChange, disabled = false, size = 'md', label, labelPosition = 'right', className = '', 'aria-label': ariaLabel, }) => {
|
|
437
|
+
const handleClick = () => {
|
|
438
|
+
if (!disabled) {
|
|
439
|
+
onChange?.(!checked);
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
const handleKeyDown = (e) => {
|
|
443
|
+
if ((e.key === 'Enter' || e.key === ' ') && !disabled) {
|
|
444
|
+
e.preventDefault();
|
|
445
|
+
onChange?.(!checked);
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
const toggleElement = (jsx("div", { className: `${styles$N.toggle} ${styles$N[size]} ${checked ? styles$N.checked : ''} ${disabled ? styles$N.disabled : ''} ${className}`, onClick: handleClick, onKeyDown: handleKeyDown, role: "switch", "aria-checked": checked, "aria-disabled": disabled, "aria-label": ariaLabel || label, tabIndex: disabled ? -1 : 0, children: jsx("span", { className: styles$N.thumb }) }));
|
|
449
|
+
if (label) {
|
|
450
|
+
return (jsxs("label", { className: `${styles$N.wrapper} ${disabled ? styles$N.wrapperDisabled : ''}`, children: [labelPosition === 'left' && jsx("span", { className: styles$N.label, children: label }), toggleElement, labelPosition === 'right' && jsx("span", { className: styles$N.label, children: label })] }));
|
|
451
|
+
}
|
|
452
|
+
return toggleElement;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
var styles$M = {"wrapper":"Tooltip-module_wrapper__9SUwl","tooltip":"Tooltip-module_tooltip__KQ7km","fadeIn":"Tooltip-module_fadeIn__dL8S5","content":"Tooltip-module_content__kO8yx","dark":"Tooltip-module_dark__Y66ss","light":"Tooltip-module_light__mItfR","top":"Tooltip-module_top__1jrIn","bottom":"Tooltip-module_bottom__99YBc","left":"Tooltip-module_left__ZNd1H","right":"Tooltip-module_right__r0j5Q","arrow":"Tooltip-module_arrow__qcKWx","arrowTop":"Tooltip-module_arrowTop__k13dt","arrowBottom":"Tooltip-module_arrowBottom__FP-w2","arrowLeft":"Tooltip-module_arrowLeft__7T1uO","arrowRight":"Tooltip-module_arrowRight__FbPdB"};
|
|
456
|
+
|
|
457
|
+
const Tooltip = ({ content, children, position = 'top', variant = 'dark', delay = 200, disabled = false, className = '', }) => {
|
|
458
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
459
|
+
const [actualPosition, setActualPosition] = useState(position);
|
|
460
|
+
const timeoutRef = useRef(null);
|
|
461
|
+
const tooltipRef = useRef(null);
|
|
462
|
+
const triggerRef = useRef(null);
|
|
463
|
+
const checkBounds = () => {
|
|
464
|
+
if (!tooltipRef.current || !triggerRef.current)
|
|
465
|
+
return;
|
|
466
|
+
const tooltip = tooltipRef.current.getBoundingClientRect();
|
|
467
|
+
const viewport = {
|
|
468
|
+
width: window.innerWidth,
|
|
469
|
+
height: window.innerHeight,
|
|
470
|
+
};
|
|
471
|
+
let bestPosition = position;
|
|
472
|
+
if (position === 'right' && tooltip.right > viewport.width) {
|
|
473
|
+
bestPosition = 'left';
|
|
474
|
+
}
|
|
475
|
+
else if (position === 'left' && tooltip.left < 0) {
|
|
476
|
+
bestPosition = 'right';
|
|
477
|
+
}
|
|
478
|
+
else if (position === 'top' && tooltip.top < 0) {
|
|
479
|
+
bestPosition = 'bottom';
|
|
480
|
+
}
|
|
481
|
+
else if (position === 'bottom' && tooltip.bottom > viewport.height) {
|
|
482
|
+
bestPosition = 'top';
|
|
483
|
+
}
|
|
484
|
+
setActualPosition(bestPosition);
|
|
485
|
+
};
|
|
486
|
+
useEffect(() => {
|
|
487
|
+
if (isVisible) {
|
|
488
|
+
checkBounds();
|
|
489
|
+
}
|
|
490
|
+
}, [isVisible, position]);
|
|
491
|
+
const handleMouseEnter = () => {
|
|
492
|
+
if (disabled)
|
|
493
|
+
return;
|
|
494
|
+
timeoutRef.current = setTimeout(() => {
|
|
495
|
+
setIsVisible(true);
|
|
496
|
+
}, delay);
|
|
497
|
+
};
|
|
498
|
+
const handleMouseLeave = () => {
|
|
499
|
+
if (timeoutRef.current) {
|
|
500
|
+
clearTimeout(timeoutRef.current);
|
|
501
|
+
}
|
|
502
|
+
setIsVisible(false);
|
|
503
|
+
};
|
|
504
|
+
const handleFocus = () => {
|
|
505
|
+
if (!disabled) {
|
|
506
|
+
setIsVisible(true);
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
const handleBlur = () => {
|
|
510
|
+
setIsVisible(false);
|
|
511
|
+
};
|
|
512
|
+
useEffect(() => {
|
|
513
|
+
return () => {
|
|
514
|
+
if (timeoutRef.current) {
|
|
515
|
+
clearTimeout(timeoutRef.current);
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
}, []);
|
|
519
|
+
return (jsxs("div", { ref: triggerRef, className: `${styles$M.wrapper} ${className}`, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onFocus: handleFocus, onBlur: handleBlur, children: [children, isVisible && content && (jsxs("div", { ref: tooltipRef, className: `${styles$M.tooltip} ${styles$M[actualPosition]} ${styles$M[variant]}`, role: "tooltip", children: [jsx("div", { className: styles$M.content, children: content }), jsx("div", { className: `${styles$M.arrow} ${styles$M[`arrow${actualPosition.charAt(0).toUpperCase()}${actualPosition.slice(1)}`]}` })] }))] }));
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
var styles$L = {"service":"TravelServiceIcon-module_service__-4EZb","code":"TravelServiceIcon-module_code__vElzI","multi":"TravelServiceIcon-module_multi__nqZLM","multiIndicator":"TravelServiceIcon-module_multiIndicator__KJF1L"};
|
|
523
|
+
|
|
524
|
+
// Airline brand colors
|
|
525
|
+
const vendorColors = {
|
|
526
|
+
DL: { bg: '#003366', fg: '#FFFFFF' }, // Delta
|
|
527
|
+
AA: { bg: '#0078D2', fg: '#FFFFFF' }, // American
|
|
528
|
+
UA: { bg: '#002244', fg: '#FFFFFF' }, // United
|
|
529
|
+
WN: { bg: '#F9B612', fg: '#304CB2' }, // Southwest
|
|
530
|
+
B6: { bg: '#003876', fg: '#FFFFFF' }, // JetBlue
|
|
531
|
+
AS: { bg: '#016191', fg: '#FFFFFF' }, // Alaska
|
|
532
|
+
F9: { bg: '#2D8B45', fg: '#FFFFFF' }, // Frontier
|
|
533
|
+
NK: { bg: '#FFC72C', fg: '#000000' }, // Spirit
|
|
534
|
+
G4: { bg: '#00386C', fg: '#FFFFFF' }, // Allegiant
|
|
535
|
+
HA: { bg: '#660099', fg: '#FFFFFF' }, // Hawaiian
|
|
536
|
+
};
|
|
537
|
+
// Type-specific background colors when no vendor
|
|
538
|
+
const typeColors$1 = {
|
|
539
|
+
A: { bg: 'var(--color-primary-light, #E6ECFB)', fg: 'var(--color-primary, #0A53EF)' },
|
|
540
|
+
C: { bg: 'var(--color-tangerine-light, #FFE2C1)', fg: 'var(--color-warning, #9F5500)' },
|
|
541
|
+
H: { bg: 'var(--color-forest-light, #E2F0EC)', fg: 'var(--color-success, #138660)' },
|
|
542
|
+
L: { bg: '#EDE9FE', fg: '#7C3AED' },
|
|
543
|
+
R: { bg: 'var(--stm-brand-blue-tint, #E5EDF4)', fg: 'var(--stm-brand-blue, #15538C)' },
|
|
544
|
+
B: { bg: '#FEF3C7', fg: '#D97706' },
|
|
545
|
+
U: { bg: 'var(--color-secondary, #E4E5E7)', fg: 'var(--fg-3, #5C5C5C)' },
|
|
546
|
+
};
|
|
547
|
+
// Icon paths for each type
|
|
548
|
+
const typeIcons$1 = {
|
|
549
|
+
A: (jsx("path", { d: "M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z" })),
|
|
550
|
+
C: (jsx("path", { d: "M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z" })),
|
|
551
|
+
H: (jsx("path", { d: "M7 13c1.66 0 3-1.34 3-3S8.66 7 7 7s-3 1.34-3 3 1.34 3 3 3zm12-6h-8v7H3V5H1v15h2v-3h18v3h2v-9c0-2.21-1.79-4-4-4z" })),
|
|
552
|
+
L: (jsx("path", { d: "M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z" })),
|
|
553
|
+
R: (jsx("path", { d: "M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h12v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-4-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-6H6V6h5v5zm2 0V6h5v5h-5zm3.5 6c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z" })),
|
|
554
|
+
B: (jsx("path", { d: "M4 16c0 .88.39 1.67 1 2.22V20c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h8v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1.78c.61-.55 1-1.34 1-2.22V6c0-3.5-3.58-4-8-4s-8 .5-8 4v10zm3.5 1c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm9 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm1.5-6H6V6h12v5z" })),
|
|
555
|
+
U: (jsx("path", { d: "M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" })),
|
|
556
|
+
};
|
|
557
|
+
const TravelServiceIcon = ({ type, vendor, mode = 'icon', size = 28, multi = false, className, }) => {
|
|
558
|
+
const vendorKey = vendor?.toUpperCase() || '';
|
|
559
|
+
const colors = mode === 'icon' && vendorColors[vendorKey]
|
|
560
|
+
? vendorColors[vendorKey]
|
|
561
|
+
: typeColors$1[type] || typeColors$1.U;
|
|
562
|
+
return (jsxs("span", { className: `${styles$L.service} ${multi ? styles$L.multi : ''} ${className || ''}`, style: {
|
|
563
|
+
width: size,
|
|
564
|
+
height: size,
|
|
565
|
+
backgroundColor: colors.bg,
|
|
566
|
+
color: colors.fg,
|
|
567
|
+
fontSize: size * 0.4,
|
|
568
|
+
}, title: vendor ? `${vendor} (${type})` : type, children: [mode === 'code' && vendor ? (jsx("span", { className: styles$L.code, children: vendor })) : (jsx("svg", { viewBox: "0 0 24 24", width: size * 0.55, height: size * 0.55, fill: "currentColor", children: typeIcons$1[type] || typeIcons$1.U })), multi && jsx("span", { className: styles$L.multiIndicator, children: "+" })] }));
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
var styles$K = {"icon":"TypeIcon-module_icon__WUL-x"};
|
|
572
|
+
|
|
573
|
+
const typeLabels = {
|
|
574
|
+
A: 'Air',
|
|
575
|
+
C: 'Car',
|
|
576
|
+
H: 'Hotel',
|
|
577
|
+
L: 'Limo',
|
|
578
|
+
R: 'Rail',
|
|
579
|
+
B: 'Bus',
|
|
580
|
+
U: 'Unknown',
|
|
581
|
+
};
|
|
582
|
+
const typeColors = {
|
|
583
|
+
A: { bg: 'var(--color-primary-light, #E6ECFB)', fg: 'var(--color-primary, #0A53EF)' },
|
|
584
|
+
C: { bg: 'var(--color-tangerine-light, #FFE2C1)', fg: 'var(--color-warning, #9F5500)' },
|
|
585
|
+
H: { bg: 'var(--color-forest-light, #E2F0EC)', fg: 'var(--color-success, #138660)' },
|
|
586
|
+
L: { bg: '#EDE9FE', fg: '#7C3AED' }, // Purple for Limo
|
|
587
|
+
R: { bg: 'var(--stm-brand-blue-tint, #E5EDF4)', fg: 'var(--stm-brand-blue, #15538C)' },
|
|
588
|
+
B: { bg: '#FEF3C7', fg: '#D97706' }, // Amber for Bus
|
|
589
|
+
U: { bg: 'var(--color-secondary, #E4E5E7)', fg: 'var(--fg-3, #5C5C5C)' },
|
|
590
|
+
};
|
|
591
|
+
// SVG path data for each icon
|
|
592
|
+
const typeIcons = {
|
|
593
|
+
A: (jsx("path", { d: "M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z" })),
|
|
594
|
+
C: (jsx("path", { d: "M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z" })),
|
|
595
|
+
H: (jsx("path", { d: "M7 13c1.66 0 3-1.34 3-3S8.66 7 7 7s-3 1.34-3 3 1.34 3 3 3zm12-6h-8v7H3V5H1v15h2v-3h18v3h2v-9c0-2.21-1.79-4-4-4z" })),
|
|
596
|
+
L: (jsx("path", { d: "M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z" })),
|
|
597
|
+
R: (jsx("path", { d: "M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h12v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-4-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-6H6V6h5v5zm2 0V6h5v5h-5zm3.5 6c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z" })),
|
|
598
|
+
B: (jsx("path", { d: "M4 16c0 .88.39 1.67 1 2.22V20c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h8v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1.78c.61-.55 1-1.34 1-2.22V6c0-3.5-3.58-4-8-4s-8 .5-8 4v10zm3.5 1c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm9 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm1.5-6H6V6h12v5z" })),
|
|
599
|
+
U: (jsx("path", { d: "M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" })),
|
|
600
|
+
};
|
|
601
|
+
const TypeIcon = ({ type, size = 18, showTooltip = true, className, }) => {
|
|
602
|
+
const colors = typeColors[type] || typeColors.U;
|
|
603
|
+
const label = typeLabels[type] || 'Unknown';
|
|
604
|
+
return (jsx("span", { className: `${styles$K.icon} ${className || ''}`, style: {
|
|
605
|
+
width: size,
|
|
606
|
+
height: size,
|
|
607
|
+
backgroundColor: colors.bg,
|
|
608
|
+
color: colors.fg,
|
|
609
|
+
}, title: showTooltip ? label : undefined, "aria-label": label, children: jsx("svg", { viewBox: "0 0 24 24", width: size * 0.6, height: size * 0.6, fill: "currentColor", children: typeIcons[type] || typeIcons.U }) }));
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
var styles$J = {"accordion":"Accordion-module_accordion__I3hmS","headerContainer":"Accordion-module_headerContainer__QhfHx","toggle":"Accordion-module_toggle__rlK5n","caret":"Accordion-module_caret__iZAh1","open":"Accordion-module_open__5jX-w","header":"Accordion-module_header__gzKrn","body":"Accordion-module_body__xTgL6","hidden":"Accordion-module_hidden__wcCWd","visible":"Accordion-module_visible__116om","timeline":"Accordion-module_timeline__ikrdK","line":"Accordion-module_line__buDP1","endCaret":"Accordion-module_endCaret__OXpPJ","content":"Accordion-module_content__aL8Vn"};
|
|
613
|
+
|
|
614
|
+
const CaretIcon = ({ className }) => (jsx("svg", { className: className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "9 18 15 12 9 6" }) }));
|
|
615
|
+
/**
|
|
616
|
+
* Accordion component for collapsible content sections.
|
|
617
|
+
* Used in travel request forms for expandable form segments.
|
|
618
|
+
*/
|
|
619
|
+
const Accordion = ({ header, children, defaultOpen = true, open: controlledOpen, onOpenChange, showTimeline = false, className, }) => {
|
|
620
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
621
|
+
const isControlled = controlledOpen !== undefined;
|
|
622
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
623
|
+
const handleToggle = () => {
|
|
624
|
+
const newOpen = !isOpen;
|
|
625
|
+
if (!isControlled) {
|
|
626
|
+
setInternalOpen(newOpen);
|
|
627
|
+
}
|
|
628
|
+
onOpenChange?.(newOpen);
|
|
629
|
+
};
|
|
630
|
+
return (jsxs("div", { className: `${styles$J.accordion} ${className || ''}`, children: [jsxs("div", { className: styles$J.headerContainer, children: [jsx("button", { type: "button", className: styles$J.toggle, onClick: handleToggle, "aria-expanded": isOpen, children: jsx(CaretIcon, { className: `${styles$J.caret} ${isOpen ? styles$J.open : ''}` }) }), jsx("div", { className: styles$J.header, children: header })] }), jsxs("div", { className: `${styles$J.body} ${isOpen ? styles$J.visible : styles$J.hidden}`, "aria-hidden": !isOpen, children: [showTimeline && (jsxs("div", { className: styles$J.timeline, children: [jsx("div", { className: styles$J.line }), jsx(CaretIcon, { className: styles$J.endCaret })] })), jsx("div", { className: styles$J.content, children: children })] })] }));
|
|
631
|
+
};
|
|
632
|
+
Accordion.displayName = 'Accordion';
|
|
633
|
+
|
|
634
|
+
var styles$I = {"dropdown":"Dropdown-module_dropdown__K4-yz","arrow":"Dropdown-module_arrow__2Xuwf","arrowOpen":"Dropdown-module_arrowOpen__5g2iY","menu":"Dropdown-module_menu__dCgm8","menuOpen":"Dropdown-module_menuOpen__-IXFR","left":"Dropdown-module_left__tnNcS","center":"Dropdown-module_center__s9zhj","right":"Dropdown-module_right__s71gz","item":"Dropdown-module_item__R008o","itemDisabled":"Dropdown-module_itemDisabled__XIuNm","itemIcon":"Dropdown-module_itemIcon__DbSnD"};
|
|
635
|
+
|
|
636
|
+
const Dropdown = ({ label, children, alignment = 'left', width, className = '', disabled = false, }) => {
|
|
637
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
638
|
+
const dropdownRef = useRef(null);
|
|
639
|
+
useEffect(() => {
|
|
640
|
+
const handleClickOutside = (event) => {
|
|
641
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
642
|
+
setIsOpen(false);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
if (isOpen) {
|
|
646
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
647
|
+
}
|
|
648
|
+
return () => {
|
|
649
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
650
|
+
};
|
|
651
|
+
}, [isOpen]);
|
|
652
|
+
const handleKeyDown = (e) => {
|
|
653
|
+
if (e.key === 'Escape') {
|
|
654
|
+
setIsOpen(false);
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
return (jsxs("div", { ref: dropdownRef, className: `${styles$I.dropdown} ${className}`, onKeyDown: handleKeyDown, children: [jsxs(Button, { variant: "secondary", onClick: () => !disabled && setIsOpen(!isOpen), disabled: disabled, "aria-expanded": isOpen, "aria-haspopup": "true", children: [label, jsx("svg", { className: `${styles$I.arrow} ${isOpen ? styles$I.arrowOpen : ''}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", width: "16", height: "16", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) })] }), jsx("div", { className: `${styles$I.menu} ${styles$I[alignment]} ${isOpen ? styles$I.menuOpen : ''}`, style: width ? { minWidth: `${width}px` } : undefined, role: "menu", children: children })] }));
|
|
658
|
+
};
|
|
659
|
+
const DropdownItem = ({ children, onClick, disabled = false, icon, className = '', }) => {
|
|
660
|
+
return (jsxs("button", { type: "button", className: `${styles$I.item} ${disabled ? styles$I.itemDisabled : ''} ${className}`, onClick: onClick, disabled: disabled, role: "menuitem", children: [icon && jsx("span", { className: styles$I.itemIcon, children: icon }), children] }));
|
|
661
|
+
};
|
|
662
|
+
Dropdown.Item = DropdownItem;
|
|
663
|
+
|
|
664
|
+
var styles$H = {"wrapper":"FilterChip-module_wrapper__YDRSW","chip":"FilterChip-module_chip__pF7K5","open":"FilterChip-module_open__EYBp7","active":"FilterChip-module_active__JEkku","label":"FilterChip-module_label__tRr-y","value":"FilterChip-module_value__0EcVu","chevron":"FilterChip-module_chevron__kh13z","rotated":"FilterChip-module_rotated__U-FzI","dropdown":"FilterChip-module_dropdown__w3ytW","infoMessage":"FilterChip-module_infoMessage__0TzcA","searchWrapper":"FilterChip-module_searchWrapper__VHOSK","searchIcon":"FilterChip-module_searchIcon__jJ2K-","searchInput":"FilterChip-module_searchInput__FqwvR","optionsList":"FilterChip-module_optionsList__P0dgd","option":"FilterChip-module_option__DMuqM","selected":"FilterChip-module_selected__ltt9Y","noResults":"FilterChip-module_noResults__QGNao"};
|
|
665
|
+
|
|
666
|
+
const FilterChip = ({ label, value, options, onChange, searchable = false, searchPlaceholder = 'Search...', infoMessage, className, }) => {
|
|
667
|
+
const [open, setOpen] = useState(false);
|
|
668
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
669
|
+
const ref = useRef(null);
|
|
670
|
+
// Close on outside click
|
|
671
|
+
useEffect(() => {
|
|
672
|
+
if (!open)
|
|
673
|
+
return;
|
|
674
|
+
const handleClick = (e) => {
|
|
675
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
676
|
+
setOpen(false);
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
const handleKey = (e) => {
|
|
680
|
+
if (e.key === 'Escape')
|
|
681
|
+
setOpen(false);
|
|
682
|
+
};
|
|
683
|
+
document.addEventListener('mousedown', handleClick);
|
|
684
|
+
document.addEventListener('keydown', handleKey);
|
|
685
|
+
return () => {
|
|
686
|
+
document.removeEventListener('mousedown', handleClick);
|
|
687
|
+
document.removeEventListener('keydown', handleKey);
|
|
688
|
+
};
|
|
689
|
+
}, [open]);
|
|
690
|
+
// Reset search when closing
|
|
691
|
+
useEffect(() => {
|
|
692
|
+
if (!open)
|
|
693
|
+
setSearchQuery('');
|
|
694
|
+
}, [open]);
|
|
695
|
+
const filteredOptions = searchable && searchQuery
|
|
696
|
+
? options.filter(opt => opt.label.toLowerCase().includes(searchQuery.toLowerCase()))
|
|
697
|
+
: options;
|
|
698
|
+
const selectedOption = options.find(opt => opt.value === value);
|
|
699
|
+
const displayValue = selectedOption?.label || value;
|
|
700
|
+
const isDefault = value === options[0]?.value;
|
|
701
|
+
return (jsxs("div", { ref: ref, className: `${styles$H.wrapper} ${className || ''}`, children: [jsxs("button", { type: "button", className: `${styles$H.chip} ${open ? styles$H.open : ''} ${!isDefault ? styles$H.active : ''}`, onClick: () => setOpen(!open), "aria-haspopup": "listbox", "aria-expanded": open, children: [jsxs("span", { className: styles$H.label, children: [label, ":"] }), jsx("span", { className: styles$H.value, children: displayValue }), jsx("svg", { className: `${styles$H.chevron} ${open ? styles$H.rotated : ''}`, width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "6 9 12 15 18 9" }) })] }), open && (jsxs("div", { className: styles$H.dropdown, role: "listbox", children: [infoMessage && (jsxs("div", { className: styles$H.infoMessage, children: [jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", children: jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }), jsx("span", { children: infoMessage })] })), searchable && (jsxs("div", { className: styles$H.searchWrapper, children: [jsxs("svg", { className: styles$H.searchIcon, width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("circle", { cx: "11", cy: "11", r: "8" }), jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })] }), jsx("input", { type: "text", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: searchPlaceholder, className: styles$H.searchInput, autoFocus: true })] })), jsxs("div", { className: styles$H.optionsList, children: [filteredOptions.map((option) => (jsx("button", { type: "button", role: "option", "aria-selected": option.value === value, className: `${styles$H.option} ${option.value === value ? styles$H.selected : ''}`, onClick: () => {
|
|
702
|
+
onChange(option.value);
|
|
703
|
+
setOpen(false);
|
|
704
|
+
}, children: option.label }, option.value))), filteredOptions.length === 0 && (jsx("div", { className: styles$H.noResults, children: "No results found" }))] })] }))] }));
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
var styles$G = {"formField":"FormField-module_formField__VhLhK","label":"FormField-module_label__CNCs6","required":"FormField-module_required__HkPQf","inputElement":"FormField-module_inputElement__9uvGR","inputError":"FormField-module_inputError__xD7fk","helperText":"FormField-module_helperText__D99kd","errorText":"FormField-module_errorText__8mXAJ","visuallyHidden":"FormField-module_visuallyHidden__YQc7S"};
|
|
708
|
+
|
|
709
|
+
const FormField = forwardRef(({ label, helperText, error, required = false, hideLabel = false, className, as = 'input', inputProps, textareaProps, children, }, ref) => {
|
|
710
|
+
const generatedId = useId();
|
|
711
|
+
const inputId = inputProps?.id || textareaProps?.id || generatedId;
|
|
712
|
+
const helperId = `${inputId}-helper`;
|
|
713
|
+
const errorId = `${inputId}-error`;
|
|
714
|
+
const hasError = Boolean(error);
|
|
715
|
+
const describedBy = [
|
|
716
|
+
helperText ? helperId : null,
|
|
717
|
+
hasError ? errorId : null,
|
|
718
|
+
]
|
|
719
|
+
.filter(Boolean)
|
|
720
|
+
.join(' ') || undefined;
|
|
721
|
+
const renderInput = () => {
|
|
722
|
+
if (children) {
|
|
723
|
+
return children;
|
|
724
|
+
}
|
|
725
|
+
if (as === 'textarea') {
|
|
726
|
+
return (jsx(Textarea, { ref: ref, id: inputId, "aria-describedby": describedBy, "aria-invalid": hasError, "aria-required": required, ...textareaProps, className: `${styles$G.inputElement} ${hasError ? styles$G.inputError : ''} ${textareaProps?.className || ''}` }));
|
|
727
|
+
}
|
|
728
|
+
return (jsx(Input, { ref: ref, id: inputId, "aria-describedby": describedBy, "aria-invalid": hasError, "aria-required": required, ...inputProps, className: `${styles$G.inputElement} ${hasError ? styles$G.inputError : ''} ${inputProps?.className || ''}` }));
|
|
729
|
+
};
|
|
730
|
+
return (jsxs("div", { className: `${styles$G.formField} ${className || ''}`, children: [jsxs("label", { htmlFor: inputId, className: `${styles$G.label} ${hideLabel ? styles$G.visuallyHidden : ''}`, children: [label, required && jsx("span", { className: styles$G.required, "aria-hidden": "true", children: "*" })] }), renderInput(), helperText && !hasError && (jsx("p", { id: helperId, className: styles$G.helperText, children: helperText })), hasError && (jsx("p", { id: errorId, className: styles$G.errorText, role: "alert", children: error }))] }));
|
|
731
|
+
});
|
|
732
|
+
FormField.displayName = 'FormField';
|
|
733
|
+
|
|
734
|
+
var styles$F = {"row":"FormRow-module_row__2ObP9","cols1":"FormRow-module_cols1__WsxX3","cols2":"FormRow-module_cols2__t548T","cols3":"FormRow-module_cols3__zjoSR","cols4":"FormRow-module_cols4__DbZL-","gapsm":"FormRow-module_gapsm__sl0ji","gapmd":"FormRow-module_gapmd__77Yp3","gaplg":"FormRow-module_gaplg__Yb-fh","stackMobile":"FormRow-module_stackMobile__6UluR"};
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* FormRow component for laying out form fields in a responsive grid.
|
|
738
|
+
* Stacks on mobile by default and arranges in columns on larger screens.
|
|
739
|
+
*/
|
|
740
|
+
const FormRow = ({ children, columns, gap = 'md', className, stackOnMobile = true, }) => {
|
|
741
|
+
const childCount = Children.count(children);
|
|
742
|
+
const colCount = columns || (childCount > 4 ? 4 : childCount);
|
|
743
|
+
return (jsx("div", { className: `
|
|
744
|
+
${styles$F.row}
|
|
745
|
+
${styles$F[`cols${colCount}`]}
|
|
746
|
+
${styles$F[`gap${gap}`]}
|
|
747
|
+
${stackOnMobile ? styles$F.stackMobile : ''}
|
|
748
|
+
${className || ''}
|
|
749
|
+
`, children: children }));
|
|
750
|
+
};
|
|
751
|
+
FormRow.displayName = 'FormRow';
|
|
752
|
+
|
|
753
|
+
var styles$E = {"section":"FormSection-module_section__T17Vg","header":"FormSection-module_header__2MkY6","icon":"FormSection-module_icon__uywPB","title":"FormSection-module_title__dlvYD","fieldset":"FormSection-module_fieldset__pDDIo","disabled":"FormSection-module_disabled__xC3-e","status":"FormSection-module_status__2XOyW","statusLabel":"FormSection-module_statusLabel__VAuDb","statusValue":"FormSection-module_statusValue__YKSc-","submitted":"FormSection-module_submitted__sS-zT","not-submitted":"FormSection-module_not-submitted__Kuk2i","draft":"FormSection-module_draft__XHq3-"};
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* FormSection component for grouping related form fields with a title and icon.
|
|
757
|
+
* Used in travel request forms for sections like General, Air, Hotel, etc.
|
|
758
|
+
*/
|
|
759
|
+
const FormSection = ({ title, icon, status, disabled = false, children, className, id, }) => {
|
|
760
|
+
const isSubmitted = status === 'submitted';
|
|
761
|
+
const isDisabled = disabled || isSubmitted;
|
|
762
|
+
return (jsxs("div", { className: `${styles$E.section} ${className || ''}`, id: id, children: [jsxs("div", { className: styles$E.header, children: [icon && jsx("span", { className: styles$E.icon, children: icon }), jsx("h2", { className: styles$E.title, children: title })] }), jsxs("fieldset", { disabled: isDisabled, className: `${styles$E.fieldset} ${isDisabled ? styles$E.disabled : ''}`, children: [status && (jsxs("div", { className: styles$E.status, children: [jsx("span", { className: styles$E.statusLabel, children: "Status:" }), jsx("span", { className: `${styles$E.statusValue} ${styles$E[status]}`, children: status === 'submitted' ? 'Submitted' : status === 'draft' ? 'Draft' : 'Not Submitted' })] })), children] })] }));
|
|
763
|
+
};
|
|
764
|
+
FormSection.displayName = 'FormSection';
|
|
765
|
+
|
|
766
|
+
var styles$D = {"toggle":"ManifestViewToggle-module_toggle__sHnAd","lockedToggle":"ManifestViewToggle-module_lockedToggle__m70h9","tab":"ManifestViewToggle-module_tab__qcwg7","active":"ManifestViewToggle-module_active__ln3B8","locked":"ManifestViewToggle-module_locked__Udun8","lockedActive":"ManifestViewToggle-module_lockedActive__kYSaF","count":"ManifestViewToggle-module_count__M-8a8"};
|
|
767
|
+
|
|
768
|
+
const ManifestViewToggle = ({ view, onView, paxCount, eqCount, locked, className = '', }) => {
|
|
769
|
+
const tabs = [
|
|
770
|
+
{ key: 'passengers', label: 'Passengers', count: paxCount, icon: UsersIcon$1 },
|
|
771
|
+
{ key: 'equipment', label: 'Equipment', count: eqCount, icon: CubeIcon },
|
|
772
|
+
];
|
|
773
|
+
return (jsx("div", { className: [styles$D.toggle, locked ? styles$D.lockedToggle : '', className].filter(Boolean).join(' '), role: "tablist", "aria-label": "Manifest view", children: tabs.map((tab) => {
|
|
774
|
+
const active = view === tab.key;
|
|
775
|
+
const Icon = locked ? LockIcon$1 : tab.icon;
|
|
776
|
+
return (jsxs("button", { type: "button", role: "tab", "aria-selected": active, onClick: () => onView(tab.key), className: [
|
|
777
|
+
styles$D.tab,
|
|
778
|
+
active ? styles$D.active : '',
|
|
779
|
+
locked ? styles$D.locked : '',
|
|
780
|
+
locked && active ? styles$D.lockedActive : '',
|
|
781
|
+
].filter(Boolean).join(' '), children: [jsx(Icon, { size: 16 }), tab.label, jsx("span", { className: styles$D.count, children: tab.count })] }, tab.key));
|
|
782
|
+
}) }));
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
var styles$C = {"navItem":"NavItem-module_navItem__4PpZU","disabled":"NavItem-module_disabled__uYqez","default":"NavItem-module_default__VB92P","active":"NavItem-module_active__3bcnW","pill":"NavItem-module_pill__pn5gl","icon":"NavItem-module_icon__j9VQ5","label":"NavItem-module_label__3S3KY","sm":"NavItem-module_sm__1oeZI","md":"NavItem-module_md__ySO90","lg":"NavItem-module_lg__OmaBw","collapsed":"NavItem-module_collapsed__ciZ6-","iconSm":"NavItem-module_iconSm__UvWnu","iconMd":"NavItem-module_iconMd__uAMlQ","iconLg":"NavItem-module_iconLg__PFPKD","badge":"NavItem-module_badge__oP9u2"};
|
|
786
|
+
|
|
787
|
+
const NavItem = ({ icon, label, active = false, collapsed = false, variant = 'default', size = 'md', badge, badgeVariant = 'default', onClick, disabled = false, href, external = false, className, 'aria-label': ariaLabel, }) => {
|
|
788
|
+
const content = (jsxs(Fragment, { children: [icon && jsx("span", { className: `${styles$C.icon} ${styles$C[`icon${size.charAt(0).toUpperCase()}${size.slice(1)}`]}`, "aria-hidden": "true", children: icon }), !collapsed && (jsx("span", { className: styles$C.label, children: label })), badge !== undefined && !collapsed && (jsx(Badge, { variant: badgeVariant, className: styles$C.badge, children: badge }))] }));
|
|
789
|
+
const classNames = [
|
|
790
|
+
styles$C.navItem,
|
|
791
|
+
styles$C[variant],
|
|
792
|
+
styles$C[size],
|
|
793
|
+
active ? styles$C.active : '',
|
|
794
|
+
collapsed ? styles$C.collapsed : '',
|
|
795
|
+
disabled ? styles$C.disabled : '',
|
|
796
|
+
className || '',
|
|
797
|
+
].filter(Boolean).join(' ');
|
|
798
|
+
const commonProps = {
|
|
799
|
+
className: classNames,
|
|
800
|
+
'aria-label': ariaLabel || (collapsed ? label : undefined),
|
|
801
|
+
'aria-current': active ? 'page' : undefined,
|
|
802
|
+
'aria-disabled': disabled,
|
|
803
|
+
};
|
|
804
|
+
if (href && !disabled) {
|
|
805
|
+
return (jsx("a", { href: href, ...commonProps, target: external ? '_blank' : undefined, rel: external ? 'noopener noreferrer' : undefined, children: content }));
|
|
806
|
+
}
|
|
807
|
+
return (jsx("button", { type: "button", onClick: disabled ? undefined : onClick, disabled: disabled, ...commonProps, children: content }));
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
var styles$B = {"barContainer":"Progress-module_barContainer__e4v8v","barTrack":"Progress-module_barTrack__tJsPO","barFill":"Progress-module_barFill__RbcDy","barxs":"Progress-module_barxs__TLS4q","barsm":"Progress-module_barsm__BFAiw","barmd":"Progress-module_barmd__QDW-h","barlg":"Progress-module_barlg__C-Mzw","barLabel":"Progress-module_barLabel__4PFJ7","circleContainer":"Progress-module_circleContainer__zyOTa","circleSvg":"Progress-module_circleSvg__0Tt1Q","circleTrack":"Progress-module_circleTrack__p4VWf","circleFill":"Progress-module_circleFill__6fU2M","circleLabel":"Progress-module_circleLabel__vHLfU","primary":"Progress-module_primary__H2wpc","success":"Progress-module_success__rmmnE","warning":"Progress-module_warning__68ovy","error":"Progress-module_error__ZXkH0"};
|
|
811
|
+
|
|
812
|
+
const dimensions = {
|
|
813
|
+
xs: 32,
|
|
814
|
+
sm: 48,
|
|
815
|
+
md: 64,
|
|
816
|
+
lg: 80,
|
|
817
|
+
};
|
|
818
|
+
const strokeWidths = {
|
|
819
|
+
xs: 3,
|
|
820
|
+
sm: 4,
|
|
821
|
+
md: 5,
|
|
822
|
+
lg: 6,
|
|
823
|
+
};
|
|
824
|
+
const ProgressBar = ({ value, max = 100, size = 'md', variant = 'primary', showLabel = false, className = '', }) => {
|
|
825
|
+
const percentage = Math.min(Math.max((value / max) * 100, 0), 100);
|
|
826
|
+
return (jsxs("div", { className: `${styles$B.barContainer} ${styles$B[`bar${size}`]} ${className}`, children: [jsx("div", { className: styles$B.barTrack, children: jsx("div", { className: `${styles$B.barFill} ${styles$B[variant]}`, style: { width: `${percentage}%` }, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max }) }), showLabel && (jsxs("span", { className: styles$B.barLabel, children: [Math.round(percentage), "%"] }))] }));
|
|
827
|
+
};
|
|
828
|
+
const ProgressCircle = ({ value, max = 100, size = 'md', variant = 'primary', showLabel = false, className = '', }) => {
|
|
829
|
+
const percentage = Math.min(Math.max((value / max) * 100, 0), 100);
|
|
830
|
+
const dimension = dimensions[size];
|
|
831
|
+
const strokeWidth = strokeWidths[size];
|
|
832
|
+
const radius = (dimension - strokeWidth) / 2;
|
|
833
|
+
const circumference = radius * 2 * Math.PI;
|
|
834
|
+
const strokeDashoffset = circumference - (percentage / 100) * circumference;
|
|
835
|
+
return (jsxs("div", { className: `${styles$B.circleContainer} ${className}`, style: { width: dimension, height: dimension }, children: [jsxs("svg", { width: dimension, height: dimension, className: styles$B.circleSvg, children: [jsx("circle", { className: styles$B.circleTrack, cx: dimension / 2, cy: dimension / 2, r: radius, strokeWidth: strokeWidth, fill: "transparent" }), jsx("circle", { className: `${styles$B.circleFill} ${styles$B[variant]}`, cx: dimension / 2, cy: dimension / 2, r: radius, strokeWidth: strokeWidth, fill: "transparent", strokeDasharray: circumference, strokeDashoffset: strokeDashoffset, strokeLinecap: "round", role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max })] }), showLabel && (jsxs("span", { className: styles$B.circleLabel, style: { fontSize: size === 'xs' ? '8px' : size === 'sm' ? '10px' : size === 'md' ? '12px' : '14px' }, children: [Math.round(percentage), "%"] }))] }));
|
|
836
|
+
};
|
|
837
|
+
// Combined export
|
|
838
|
+
const Progress = {
|
|
839
|
+
Bar: ProgressBar,
|
|
840
|
+
Circle: ProgressCircle,
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
var styles$A = {"toolbar":"RosterToolbar-module_toolbar__IHjs9","leftSection":"RosterToolbar-module_leftSection__baz7E","rightSection":"RosterToolbar-module_rightSection__R2b-D","dropdown":"RosterToolbar-module_dropdown__NKaWV","dropdownTrigger":"RosterToolbar-module_dropdownTrigger__nCoaZ","dropdownMenu":"RosterToolbar-module_dropdownMenu__7QuED","dropdownItem":"RosterToolbar-module_dropdownItem__mrsat","dropdownItemIcon":"RosterToolbar-module_dropdownItemIcon__gx5tx","lockButton":"RosterToolbar-module_lockButton__zw3s0","locked":"RosterToolbar-module_locked__DVnqB","saveButton":"RosterToolbar-module_saveButton__th1lq","spinner":"RosterToolbar-module_spinner__uWdPg"};
|
|
844
|
+
|
|
845
|
+
const ImportIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), jsx("polyline", { points: "17 8 12 3 7 8" }), jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })] }));
|
|
846
|
+
const ExportIcon$1 = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), jsx("polyline", { points: "7 10 12 15 17 10" }), jsx("line", { x1: "12", y1: "15", x2: "12", y2: "3" })] }));
|
|
847
|
+
const ChevronIcon$2 = () => (jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "6 9 12 15 18 9" }) }));
|
|
848
|
+
const LockIcon = () => (jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }));
|
|
849
|
+
const UnlockIcon = () => (jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsx("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })] }));
|
|
850
|
+
const SaveIcon = () => (jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }), jsx("polyline", { points: "17 21 17 13 7 13 7 21" }), jsx("polyline", { points: "7 3 7 8 15 8" })] }));
|
|
851
|
+
const SpinnerIcon = () => (jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: styles$A.spinner, children: jsx("circle", { cx: "12", cy: "12", r: "10", strokeDasharray: "32", strokeDashoffset: "32" }) }));
|
|
852
|
+
const DropdownButton = ({ label, icon, options, }) => {
|
|
853
|
+
return (jsxs("div", { className: styles$A.dropdown, children: [jsxs("button", { type: "button", className: styles$A.dropdownTrigger, children: [icon, jsx("span", { children: label }), jsx(ChevronIcon$2, {})] }), jsx("div", { className: styles$A.dropdownMenu, children: options.map((option, i) => (jsxs("button", { type: "button", className: styles$A.dropdownItem, onClick: option.onClick, disabled: option.disabled, children: [option.icon && jsx("span", { className: styles$A.dropdownItemIcon, children: option.icon }), option.label] }, i))) })] }));
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* RosterToolbar - Toolbar for roster management with import/export/save actions
|
|
857
|
+
*/
|
|
858
|
+
const RosterToolbar = ({ importOptions, exportOptions, lockToggle, saveButton, additionalActions, searchField, className = '', }) => {
|
|
859
|
+
const toolbarClasses = [styles$A.toolbar, className].filter(Boolean).join(' ');
|
|
860
|
+
return (jsxs("div", { className: toolbarClasses, children: [jsxs("div", { className: styles$A.leftSection, children: [searchField, additionalActions] }), jsxs("div", { className: styles$A.rightSection, children: [importOptions && importOptions.length > 0 && (jsx(DropdownButton, { label: "Import", icon: jsx(ImportIcon, {}), options: importOptions })), exportOptions && exportOptions.length > 0 && (jsx(DropdownButton, { label: "Export", icon: jsx(ExportIcon$1, {}), options: exportOptions })), lockToggle && (jsxs("button", { type: "button", className: [
|
|
861
|
+
styles$A.lockButton,
|
|
862
|
+
lockToggle.isLocked ? styles$A.locked : '',
|
|
863
|
+
].filter(Boolean).join(' '), onClick: () => lockToggle.onToggle(!lockToggle.isLocked), disabled: lockToggle.disabled, "aria-label": lockToggle.isLocked ? 'Unlock roster' : 'Lock roster', children: [lockToggle.isLocked ? jsx(LockIcon, {}) : jsx(UnlockIcon, {}), jsx("span", { children: lockToggle.isLocked ? 'Locked' : 'Unlocked' })] })), saveButton && (jsxs("button", { type: "button", className: styles$A.saveButton, onClick: saveButton.onClick, disabled: saveButton.disabled || saveButton.loading, children: [saveButton.loading ? jsx(SpinnerIcon, {}) : jsx(SaveIcon, {}), jsx("span", { children: saveButton.label || 'Save' })] }))] })] }));
|
|
864
|
+
};
|
|
865
|
+
RosterToolbar.displayName = 'RosterToolbar';
|
|
866
|
+
|
|
867
|
+
var styles$z = {"searchField":"SearchField-module_searchField__c7gUE","inputWrapper":"SearchField-module_inputWrapper__SUzHv","searchIcon":"SearchField-module_searchIcon__MOZ2m","input":"SearchField-module_input__abJcl","clearButton":"SearchField-module_clearButton__RMIg2","sm":"SearchField-module_sm__-sayT","lg":"SearchField-module_lg__QKacI"};
|
|
868
|
+
|
|
869
|
+
const SearchField = forwardRef(({ placeholder = 'Search...', value, defaultValue = '', onChange, onSearch, onClear, size = 'md', disabled = false, showClear = true, showButton = true, className, id, 'aria-label': ariaLabel = 'Search', ...props }, ref) => {
|
|
870
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
871
|
+
const currentValue = value !== undefined ? value : internalValue;
|
|
872
|
+
const handleChange = (e) => {
|
|
873
|
+
const newValue = e.target.value;
|
|
874
|
+
if (value === undefined) {
|
|
875
|
+
setInternalValue(newValue);
|
|
876
|
+
}
|
|
877
|
+
onChange?.(newValue);
|
|
878
|
+
};
|
|
879
|
+
const handleClear = () => {
|
|
880
|
+
if (value === undefined) {
|
|
881
|
+
setInternalValue('');
|
|
882
|
+
}
|
|
883
|
+
onChange?.('');
|
|
884
|
+
onClear?.();
|
|
885
|
+
};
|
|
886
|
+
const handleSubmit = (e) => {
|
|
887
|
+
e.preventDefault();
|
|
888
|
+
onSearch?.(currentValue);
|
|
889
|
+
};
|
|
890
|
+
const handleKeyDown = (e) => {
|
|
891
|
+
if (e.key === 'Enter') {
|
|
892
|
+
onSearch?.(currentValue);
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
return (jsxs("form", { className: `${styles$z.searchField} ${styles$z[size]} ${className || ''}`, onSubmit: handleSubmit, role: "search", children: [jsxs("div", { className: styles$z.inputWrapper, children: [jsx(SearchIcon$1, { className: styles$z.searchIcon, "aria-hidden": "true" }), jsx(Input, { ref: ref, id: id, type: "search", placeholder: placeholder, value: currentValue, onChange: handleChange, onKeyDown: handleKeyDown, disabled: disabled, className: styles$z.input, "aria-label": ariaLabel, ...props }), showClear && currentValue && (jsx("button", { type: "button", className: styles$z.clearButton, onClick: handleClear, disabled: disabled, "aria-label": "Clear search", children: jsx(CloseIcon, { size: 16 }) }))] }), showButton && (jsx(Button, { type: "submit", variant: "primary", size: size, disabled: disabled, children: "Search" }))] }));
|
|
896
|
+
});
|
|
897
|
+
SearchField.displayName = 'SearchField';
|
|
898
|
+
|
|
899
|
+
var styles$y = {"segment":"Segment-module_segment__UF-SG","fullWidth":"Segment-module_fullWidth__Hi19i","option":"Segment-module_option__UJUhj","disabled":"Segment-module_disabled__CSxuQ","selected":"Segment-module_selected__gRnVj","sm":"Segment-module_sm__h8S7Z","md":"Segment-module_md__4uTae","lg":"Segment-module_lg__zL0Hv","icon":"Segment-module_icon__ZHRr6"};
|
|
900
|
+
|
|
901
|
+
const Segment = ({ options, value, onChange, size = 'md', fullWidth = false, className = '', 'aria-label': ariaLabel, }) => {
|
|
902
|
+
return (jsx("div", { className: `${styles$y.segment} ${styles$y[size]} ${fullWidth ? styles$y.fullWidth : ''} ${className}`, role: "radiogroup", "aria-label": ariaLabel, children: options.map((option) => (jsxs("button", { type: "button", className: `${styles$y.option} ${value === option.value ? styles$y.selected : ''} ${option.disabled ? styles$y.disabled : ''}`, onClick: () => !option.disabled && onChange(option.value), disabled: option.disabled, role: "radio", "aria-checked": value === option.value, children: [option.icon && jsx("span", { className: styles$y.icon, children: option.icon }), option.label] }, option.value))) }));
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
var styles$x = {"container":"SelectFilter-module_container__tCC9y","trigger":"SelectFilter-module_trigger__5WbMf","open":"SelectFilter-module_open__oo-Y6","disabled":"SelectFilter-module_disabled__JUdi3","triggerText":"SelectFilter-module_triggerText__LM07K","placeholder":"SelectFilter-module_placeholder__J0xyo","chevron":"SelectFilter-module_chevron__x-Pnr","dropdown":"SelectFilter-module_dropdown__52FPP","tabs":"SelectFilter-module_tabs__wp6on","tab":"SelectFilter-module_tab__JpnWo","activeTab":"SelectFilter-module_activeTab__ShP7x","actions":"SelectFilter-module_actions__phfFl","actionBtn":"SelectFilter-module_actionBtn__ppB--","options":"SelectFilter-module_options__p1iCX","option":"SelectFilter-module_option__0vwfy","selected":"SelectFilter-module_selected__2vxyT","checkbox":"SelectFilter-module_checkbox__qTUjy","optionLabel":"SelectFilter-module_optionLabel__L4CMA","footer":"SelectFilter-module_footer__aq4JP","applyBtn":"SelectFilter-module_applyBtn__RFKei"};
|
|
906
|
+
|
|
907
|
+
const ChevronIcon$1 = () => (jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "6 9 12 15 18 9" }) }));
|
|
908
|
+
const CheckIcon = () => (jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "20 6 9 17 4 12" }) }));
|
|
909
|
+
/**
|
|
910
|
+
* SelectFilter component for filtering data with dropdown selections.
|
|
911
|
+
* Supports single/multi select, grouped options with tabs.
|
|
912
|
+
*/
|
|
913
|
+
const SelectFilter = ({ label, options = [], groupedOptions = {}, value = [], onChange, multiselect = false, tabs = [], showValue = false, grouped = false, disabled = false, width = 360, className = '', }) => {
|
|
914
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
915
|
+
const [activeTab, setActiveTab] = useState(tabs[0] || '');
|
|
916
|
+
const [selectedValues, setSelectedValues] = useState(value);
|
|
917
|
+
const dropdownRef = useRef(null);
|
|
918
|
+
useEffect(() => {
|
|
919
|
+
setSelectedValues(value);
|
|
920
|
+
}, [value]);
|
|
921
|
+
useEffect(() => {
|
|
922
|
+
const handleClickOutside = (event) => {
|
|
923
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
924
|
+
setIsOpen(false);
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
928
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
929
|
+
}, []);
|
|
930
|
+
const allOptions = useMemo(() => {
|
|
931
|
+
if (grouped && groupedOptions) {
|
|
932
|
+
return tabs.reduce((acc, tab) => acc.concat(groupedOptions[tab] || []), []);
|
|
933
|
+
}
|
|
934
|
+
return options;
|
|
935
|
+
}, [grouped, groupedOptions, options, tabs]);
|
|
936
|
+
const currentOptions = useMemo(() => {
|
|
937
|
+
if (grouped && groupedOptions && activeTab) {
|
|
938
|
+
return groupedOptions[activeTab] || [];
|
|
939
|
+
}
|
|
940
|
+
return options;
|
|
941
|
+
}, [activeTab, grouped, groupedOptions, options]);
|
|
942
|
+
const handleSelect = (optionValue) => {
|
|
943
|
+
let newValues;
|
|
944
|
+
if (multiselect) {
|
|
945
|
+
newValues = selectedValues.includes(optionValue)
|
|
946
|
+
? selectedValues.filter(v => v !== optionValue)
|
|
947
|
+
: [...selectedValues, optionValue];
|
|
948
|
+
}
|
|
949
|
+
else {
|
|
950
|
+
newValues = [optionValue];
|
|
951
|
+
setIsOpen(false);
|
|
952
|
+
}
|
|
953
|
+
setSelectedValues(newValues);
|
|
954
|
+
onChange?.(newValues);
|
|
955
|
+
};
|
|
956
|
+
const handleSelectAll = () => {
|
|
957
|
+
const allValues = allOptions.map(opt => opt.value);
|
|
958
|
+
setSelectedValues(allValues);
|
|
959
|
+
onChange?.(allValues);
|
|
960
|
+
};
|
|
961
|
+
const handleClear = () => {
|
|
962
|
+
setSelectedValues([]);
|
|
963
|
+
onChange?.([]);
|
|
964
|
+
};
|
|
965
|
+
const getDisplayText = () => {
|
|
966
|
+
if (selectedValues.length === 0) {
|
|
967
|
+
return `Select ${label}`;
|
|
968
|
+
}
|
|
969
|
+
if (selectedValues.length === allOptions.length) {
|
|
970
|
+
return `All ${label}s`;
|
|
971
|
+
}
|
|
972
|
+
const selected = allOptions.filter(opt => selectedValues.includes(opt.value));
|
|
973
|
+
if (selected.length <= 2) {
|
|
974
|
+
return selected.map(opt => showValue ? opt.value : opt.label).join(', ');
|
|
975
|
+
}
|
|
976
|
+
return `${selected.length} selected`;
|
|
977
|
+
};
|
|
978
|
+
return (jsxs("div", { ref: dropdownRef, className: `${styles$x.container} ${className}`, children: [jsxs("button", { type: "button", className: `${styles$x.trigger} ${disabled ? styles$x.disabled : ''} ${isOpen ? styles$x.open : ''}`, onClick: () => !disabled && setIsOpen(!isOpen), children: [jsx("span", { className: `${styles$x.triggerText} ${selectedValues.length === 0 ? styles$x.placeholder : ''}`, children: getDisplayText() }), jsx("span", { className: styles$x.chevron, children: jsx(ChevronIcon$1, {}) })] }), isOpen && (jsxs("div", { className: styles$x.dropdown, style: { width }, children: [grouped && tabs.length > 0 && (jsx("div", { className: styles$x.tabs, children: tabs.map(tab => (jsx("button", { type: "button", className: `${styles$x.tab} ${activeTab === tab ? styles$x.activeTab : ''}`, onClick: () => setActiveTab(tab), children: tab.charAt(0).toUpperCase() + tab.slice(1) }, tab))) })), multiselect && (jsxs("div", { className: styles$x.actions, children: [jsx("button", { type: "button", className: styles$x.actionBtn, onClick: handleSelectAll, children: "Select All" }), jsx("button", { type: "button", className: styles$x.actionBtn, onClick: handleClear, children: "Clear" })] })), jsx("div", { className: styles$x.options, children: currentOptions.map(option => (jsxs("div", { className: `${styles$x.option} ${selectedValues.includes(option.value) ? styles$x.selected : ''}`, onClick: () => handleSelect(option.value), children: [multiselect && (jsx("span", { className: styles$x.checkbox, children: selectedValues.includes(option.value) && jsx(CheckIcon, {}) })), jsx("span", { className: styles$x.optionLabel, children: option.label })] }, option.value))) }), multiselect && (jsx("div", { className: styles$x.footer, children: jsx("button", { type: "button", className: styles$x.applyBtn, onClick: () => setIsOpen(false), children: "Apply" }) }))] }))] }));
|
|
979
|
+
};
|
|
980
|
+
SelectFilter.displayName = 'SelectFilter';
|
|
981
|
+
|
|
982
|
+
var styles$w = {"list":"ServiceToggle-module_list__bBts8","item":"ServiceToggle-module_item__4wEbQ","labelContainer":"ServiceToggle-module_labelContainer__oz-I1","clickable":"ServiceToggle-module_clickable__yzQxe","icon":"ServiceToggle-module_icon__8IdST","label":"ServiceToggle-module_label__J98Ve"};
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* ServiceToggle component for a single service item.
|
|
986
|
+
* Shows an icon, label, and optional toggle switch.
|
|
987
|
+
*/
|
|
988
|
+
const ServiceToggle = ({ label, icon, hasToggle = true, enabled = false, onToggle, onClick, disabled = false, }) => {
|
|
989
|
+
const isClickable = !hasToggle || enabled;
|
|
990
|
+
const handleClick = () => {
|
|
991
|
+
if (isClickable && onClick) {
|
|
992
|
+
onClick();
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
return (jsxs("div", { className: styles$w.item, children: [jsxs("div", { className: `${styles$w.labelContainer} ${isClickable ? styles$w.clickable : ''}`, onClick: handleClick, children: [icon && jsx("span", { className: styles$w.icon, children: icon }), jsx("span", { className: styles$w.label, children: label })] }), hasToggle && (jsx(Toggle, { checked: enabled, onChange: (checked) => onToggle?.(checked), disabled: disabled, size: "sm" }))] }));
|
|
996
|
+
};
|
|
997
|
+
/**
|
|
998
|
+
* ServiceToggleList component for displaying a list of services with toggles.
|
|
999
|
+
* Used in travel request forms for service selection (Air, Hotel, Ground, etc.)
|
|
1000
|
+
*/
|
|
1001
|
+
const ServiceToggleList = ({ services, enabledServices = {}, onToggle, onClick, className, }) => {
|
|
1002
|
+
return (jsx("div", { className: `${styles$w.list} ${className || ''}`, children: services.map((service) => (jsx(ServiceToggle, { serviceKey: service.key, label: service.label, icon: service.icon, hasToggle: service.hasToggle, enabled: enabledServices[service.key] ?? false, onToggle: (enabled) => onToggle?.(service.key, enabled), onClick: () => onClick?.(service.key) }, service.key))) }));
|
|
1003
|
+
};
|
|
1004
|
+
ServiceToggle.displayName = 'ServiceToggle';
|
|
1005
|
+
ServiceToggleList.displayName = 'ServiceToggleList';
|
|
1006
|
+
|
|
1007
|
+
var styles$v = {"header":"TeamHeader-module_header__3Zx1c","left":"TeamHeader-module_left__yqug2","backButton":"TeamHeader-module_backButton__MqElX","titles":"TeamHeader-module_titles__m3Ne9","pretitle":"TeamHeader-module_pretitle__rZUD6","title":"TeamHeader-module_title__i3dmZ","actions":"TeamHeader-module_actions__ft1DN"};
|
|
1008
|
+
|
|
1009
|
+
const BackIcon = () => (jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("line", { x1: "19", y1: "12", x2: "5", y2: "12" }), jsx("polyline", { points: "12 19 5 12 12 5" })] }));
|
|
1010
|
+
/**
|
|
1011
|
+
* TeamHeader - Header component for team management pages
|
|
1012
|
+
*/
|
|
1013
|
+
const TeamHeader = ({ teamCode, teamName, pretitle = 'Team Management', backHref, onBack, actions, className = '', }) => {
|
|
1014
|
+
const headerClasses = [
|
|
1015
|
+
styles$v.header,
|
|
1016
|
+
className,
|
|
1017
|
+
].filter(Boolean).join(' ');
|
|
1018
|
+
const title = teamCode && teamName
|
|
1019
|
+
? `${teamCode} - ${teamName}`
|
|
1020
|
+
: teamName || teamCode || '';
|
|
1021
|
+
const handleBack = () => {
|
|
1022
|
+
if (onBack) {
|
|
1023
|
+
onBack();
|
|
1024
|
+
}
|
|
1025
|
+
else if (backHref) {
|
|
1026
|
+
// Allow consumer to handle navigation
|
|
1027
|
+
window.location.href = backHref;
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
return (jsxs("div", { className: headerClasses, children: [jsxs("div", { className: styles$v.left, children: [(backHref || onBack) && (jsx("button", { type: "button", className: styles$v.backButton, onClick: handleBack, "aria-label": "Go back", children: jsx(BackIcon, {}) })), jsxs("div", { className: styles$v.titles, children: [pretitle && jsx("span", { className: styles$v.pretitle, children: pretitle }), title && jsx("h1", { className: styles$v.title, children: title })] })] }), actions && (jsx("div", { className: styles$v.actions, children: actions }))] }));
|
|
1031
|
+
};
|
|
1032
|
+
TeamHeader.displayName = 'TeamHeader';
|
|
1033
|
+
|
|
1034
|
+
var styles$u = {"segment":"TripSegment-module_segment__jX-Nq","light":"TripSegment-module_light__hHSb3","dark":"TripSegment-module_dark__3Fuo7","empty":"TripSegment-module_empty__vmzg0","item":"TripSegment-module_item__S-RC1","itemHeader":"TripSegment-module_itemHeader__wFWMo","itemType":"TripSegment-module_itemType__NsDLe","itemName":"TripSegment-module_itemName__ysYsC","route":"TripSegment-module_route__Shyz0","location":"TripSegment-module_location__8VCMH","details":"TripSegment-module_details__4U4Km","dates":"TripSegment-module_dates__Wn4-k"};
|
|
1035
|
+
|
|
1036
|
+
const PlaneIcon$3 = () => (jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("path", { d: "M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5Z" }) }));
|
|
1037
|
+
const BusIcon$2 = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("rect", { x: "4", y: "4", width: "16", height: "14", rx: "2" }), jsx("path", { d: "M8 6v6" }), jsx("path", { d: "M16 6v6" }), jsx("circle", { cx: "8", cy: "16", r: "1" }), jsx("circle", { cx: "16", cy: "16", r: "1" })] }));
|
|
1038
|
+
const HotelIcon$3 = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M3 21h18" }), jsx("path", { d: "M19 21V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v16" }), jsx("path", { d: "M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4" })] }));
|
|
1039
|
+
const ArrowIcon = () => (jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }), jsx("polyline", { points: "12 5 19 12 12 19" })] }));
|
|
1040
|
+
/**
|
|
1041
|
+
* Base TripSegment component wrapper
|
|
1042
|
+
*/
|
|
1043
|
+
const TripSegment = ({ type: _type, variant = 'light', className = '', children, }) => {
|
|
1044
|
+
return (jsx("div", { className: `${styles$u.segment} ${styles$u[variant]} ${className}`, children: children }));
|
|
1045
|
+
};
|
|
1046
|
+
/**
|
|
1047
|
+
* AirSegment component for displaying flight information
|
|
1048
|
+
*/
|
|
1049
|
+
const AirSegment = ({ flights, variant = 'light', className = '', }) => {
|
|
1050
|
+
if (!flights || flights.length === 0) {
|
|
1051
|
+
return (jsx(TripSegment, { type: "air", variant: variant, className: className, children: jsx("span", { className: styles$u.empty, children: "No flights" }) }));
|
|
1052
|
+
}
|
|
1053
|
+
return (jsx(TripSegment, { type: "air", variant: variant, className: className, children: flights.map((flight, i) => (jsxs("div", { className: styles$u.item, children: [jsxs("div", { className: styles$u.itemHeader, children: [jsx(PlaneIcon$3, {}), jsx("span", { className: styles$u.itemType, children: flight.type === 'charter' ? 'Charter' : 'Commercial' })] }), jsxs("div", { className: styles$u.route, children: [jsx("span", { className: styles$u.location, children: flight.departure }), jsx(ArrowIcon, {}), jsx("span", { className: styles$u.location, children: flight.arrival })] }), jsxs("div", { className: styles$u.details, children: [jsx("span", { children: flight.departureDate }), flight.departureTime && jsx("span", { children: flight.departureTime })] }), flight.airline && (jsxs("div", { className: styles$u.details, children: [jsx("span", { children: flight.airline }), flight.flightNumber && jsxs("span", { children: ["#", flight.flightNumber] })] }))] }, i))) }));
|
|
1054
|
+
};
|
|
1055
|
+
/**
|
|
1056
|
+
* GroundSegment component for displaying ground transportation
|
|
1057
|
+
*/
|
|
1058
|
+
const GroundSegment = ({ segments, variant = 'light', className = '', }) => {
|
|
1059
|
+
if (!segments || segments.length === 0) {
|
|
1060
|
+
return (jsx(TripSegment, { type: "ground", variant: variant, className: className, children: jsx("span", { className: styles$u.empty, children: "No ground transportation" }) }));
|
|
1061
|
+
}
|
|
1062
|
+
return (jsx(TripSegment, { type: "ground", variant: variant, className: className, children: segments.map((segment, i) => (jsxs("div", { className: styles$u.item, children: [jsxs("div", { className: styles$u.itemHeader, children: [jsx(BusIcon$2, {}), jsx("span", { className: styles$u.itemType, children: segment.type.charAt(0).toUpperCase() + segment.type.slice(1) })] }), jsxs("div", { className: styles$u.route, children: [jsx("span", { className: styles$u.location, children: segment.pickupLocation }), jsx(ArrowIcon, {}), jsx("span", { className: styles$u.location, children: segment.dropoffLocation })] }), jsxs("div", { className: styles$u.details, children: [jsx("span", { children: segment.pickupDate }), segment.pickupTime && jsx("span", { children: segment.pickupTime })] }), segment.company && (jsxs("div", { className: styles$u.details, children: [jsx("span", { children: segment.company }), segment.vehicleCount && jsxs("span", { children: [segment.vehicleCount, " vehicles"] })] }))] }, i))) }));
|
|
1063
|
+
};
|
|
1064
|
+
/**
|
|
1065
|
+
* HotelSegment component for displaying hotel information
|
|
1066
|
+
*/
|
|
1067
|
+
const HotelSegment = ({ hotels, variant = 'light', className = '', }) => {
|
|
1068
|
+
if (!hotels || hotels.length === 0) {
|
|
1069
|
+
return (jsx(TripSegment, { type: "hotel", variant: variant, className: className, children: jsx("span", { className: styles$u.empty, children: "No hotels" }) }));
|
|
1070
|
+
}
|
|
1071
|
+
return (jsx(TripSegment, { type: "hotel", variant: variant, className: className, children: hotels.map((hotel, i) => (jsxs("div", { className: styles$u.item, children: [jsxs("div", { className: styles$u.itemHeader, children: [jsx(HotelIcon$3, {}), jsx("span", { className: styles$u.itemName, children: hotel.name })] }), hotel.city && (jsx("div", { className: styles$u.details, children: jsx("span", { children: hotel.city }) })), jsxs("div", { className: styles$u.dates, children: [jsx("span", { children: hotel.checkIn }), jsx("span", { children: "\u2013" }), jsx("span", { children: hotel.checkOut })] }), hotel.roomCount && (jsx("div", { className: styles$u.details, children: jsxs("span", { children: [hotel.roomCount, " rooms"] }) }))] }, i))) }));
|
|
1072
|
+
};
|
|
1073
|
+
TripSegment.displayName = 'TripSegment';
|
|
1074
|
+
AirSegment.displayName = 'AirSegment';
|
|
1075
|
+
GroundSegment.displayName = 'GroundSegment';
|
|
1076
|
+
HotelSegment.displayName = 'HotelSegment';
|
|
1077
|
+
|
|
1078
|
+
var styles$t = {"card":"Card-module_card__Ak6-W","default":"Card-module_default__e-M3H","bordered":"Card-module_bordered__pUL4k","elevated":"Card-module_elevated__8f-WS","interactive":"Card-module_interactive__6B4fH","padding-none":"Card-module_padding-none__c1qKN","padding-sm":"Card-module_padding-sm__Uejon","padding-md":"Card-module_padding-md__kR4F9","padding-lg":"Card-module_padding-lg__MleX9","header":"Card-module_header__NiVTV","headerContent":"Card-module_headerContent__LyJRB","title":"Card-module_title__3DN1v","subtitle":"Card-module_subtitle__gE5L-","actions":"Card-module_actions__gHmpq","body":"Card-module_body__BU4oo","footer":"Card-module_footer__zjjTd"};
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Card component for grouping related content.
|
|
1082
|
+
*/
|
|
1083
|
+
const Card = forwardRef(({ variant = 'default', padding = 'md', interactive = false, className = '', children, ...props }, ref) => {
|
|
1084
|
+
const classNames = [
|
|
1085
|
+
styles$t.card,
|
|
1086
|
+
styles$t[variant],
|
|
1087
|
+
styles$t[`padding-${padding}`],
|
|
1088
|
+
interactive ? styles$t.interactive : '',
|
|
1089
|
+
className,
|
|
1090
|
+
]
|
|
1091
|
+
.filter(Boolean)
|
|
1092
|
+
.join(' ');
|
|
1093
|
+
return (jsx("div", { ref: ref, className: classNames, ...props, children: children }));
|
|
1094
|
+
});
|
|
1095
|
+
Card.displayName = 'Card';
|
|
1096
|
+
const CardHeader = ({ title, subtitle, actions, className = '', children, ...props }) => {
|
|
1097
|
+
const classNames = [styles$t.header, className].filter(Boolean).join(' ');
|
|
1098
|
+
return (jsxs("div", { className: classNames, ...props, children: [jsxs("div", { className: styles$t.headerContent, children: [title && jsx("h3", { className: styles$t.title, children: title }), subtitle && jsx("p", { className: styles$t.subtitle, children: subtitle }), children] }), actions && jsx("div", { className: styles$t.actions, children: actions })] }));
|
|
1099
|
+
};
|
|
1100
|
+
CardHeader.displayName = 'CardHeader';
|
|
1101
|
+
const CardBody = ({ className = '', children, ...props }) => {
|
|
1102
|
+
const classNames = [styles$t.body, className].filter(Boolean).join(' ');
|
|
1103
|
+
return (jsx("div", { className: classNames, ...props, children: children }));
|
|
1104
|
+
};
|
|
1105
|
+
CardBody.displayName = 'CardBody';
|
|
1106
|
+
const CardFooter = ({ className = '', children, ...props }) => {
|
|
1107
|
+
const classNames = [styles$t.footer, className].filter(Boolean).join(' ');
|
|
1108
|
+
return (jsx("div", { className: classNames, ...props, children: children }));
|
|
1109
|
+
};
|
|
1110
|
+
CardFooter.displayName = 'CardFooter';
|
|
1111
|
+
|
|
1112
|
+
var styles$s = {"container":"ContactList-module_container__1kjze","alert":"ContactList-module_alert__KC0tz","card":"ContactList-module_card__TOyp2","header":"ContactList-module_header__QysLx","titleRow":"ContactList-module_titleRow__tUDMS","title":"ContactList-module_title__R-IOd","tooltip":"ContactList-module_tooltip__DDMka","list":"ContactList-module_list__6tjo-","contactItem":"ContactList-module_contactItem__4SoW-","contactInfo":"ContactList-module_contactInfo__6cQpi","contactName":"ContactList-module_contactName__z748K","badge":"ContactList-module_badge__USFpb","badgeSecondary":"ContactList-module_badgeSecondary__OSwqF","contactRole":"ContactList-module_contactRole__6kfuQ","contactDetails":"ContactList-module_contactDetails__ihY0M","contactLink":"ContactList-module_contactLink__sWGp9","contactPhone":"ContactList-module_contactPhone__dUn6z","contactActions":"ContactList-module_contactActions__6WT-z","actionButton":"ContactList-module_actionButton__aPnGZ","actionButtonDanger":"ContactList-module_actionButtonDanger__yRBz0","empty":"ContactList-module_empty__bRTDB","footer":"ContactList-module_footer__18gB-","addButton":"ContactList-module_addButton__STUhp"};
|
|
1113
|
+
|
|
1114
|
+
const InfoIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("circle", { cx: "12", cy: "12", r: "10" }), jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }), jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })] }));
|
|
1115
|
+
const EditIcon$1 = () => (jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })] }));
|
|
1116
|
+
const TrashIcon$1 = () => (jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("polyline", { points: "3 6 5 6 21 6" }), jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })] }));
|
|
1117
|
+
const PlusIcon$1 = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" })] }));
|
|
1118
|
+
/**
|
|
1119
|
+
* ContactList - Displays a list of contacts with edit/remove actions
|
|
1120
|
+
*/
|
|
1121
|
+
const ContactList = ({ title = 'Contacts', tooltip, contacts, onEdit, onRemove, onAdd, showAdd = true, addLabel = 'Add Contact', alert, className = '', }) => {
|
|
1122
|
+
const listClasses = [
|
|
1123
|
+
styles$s.container,
|
|
1124
|
+
className,
|
|
1125
|
+
].filter(Boolean).join(' ');
|
|
1126
|
+
return (jsxs("div", { className: listClasses, children: [alert && (jsx("div", { className: styles$s.alert, children: alert })), jsxs("div", { className: styles$s.card, children: [jsx("div", { className: styles$s.header, children: jsxs("div", { className: styles$s.titleRow, children: [jsx("h3", { className: styles$s.title, children: title }), tooltip && (jsx("span", { className: styles$s.tooltip, children: jsx(InfoIcon, {}) }))] }) }), jsxs("div", { className: styles$s.list, children: [contacts.map((contact) => (jsxs("div", { className: styles$s.contactItem, children: [jsxs("div", { className: styles$s.contactInfo, children: [jsxs("div", { className: styles$s.contactName, children: [contact.name, contact.isPrimary && (jsx("span", { className: styles$s.badge, children: "Primary" })), contact.isSecondary && (jsx("span", { className: `${styles$s.badge} ${styles$s.badgeSecondary}`, children: "Secondary" }))] }), contact.role && (jsx("div", { className: styles$s.contactRole, children: contact.role })), jsxs("div", { className: styles$s.contactDetails, children: [contact.email && (jsx("a", { href: `mailto:${contact.email}`, className: styles$s.contactLink, children: contact.email })), contact.phone && (jsx("span", { className: styles$s.contactPhone, children: contact.phone }))] })] }), jsxs("div", { className: styles$s.contactActions, children: [onEdit && (jsx("button", { type: "button", className: styles$s.actionButton, onClick: () => onEdit(contact), "aria-label": "Edit contact", children: jsx(EditIcon$1, {}) })), onRemove && (jsx("button", { type: "button", className: `${styles$s.actionButton} ${styles$s.actionButtonDanger}`, onClick: () => onRemove(contact), "aria-label": "Remove contact", children: jsx(TrashIcon$1, {}) }))] })] }, contact.id))), contacts.length === 0 && (jsx("div", { className: styles$s.empty, children: "No contacts added" }))] }), showAdd && onAdd && (jsx("div", { className: styles$s.footer, children: jsxs("button", { type: "button", className: styles$s.addButton, onClick: onAdd, children: [jsx(PlusIcon$1, {}), addLabel] }) }))] })] }));
|
|
1127
|
+
};
|
|
1128
|
+
ContactList.displayName = 'ContactList';
|
|
1129
|
+
|
|
1130
|
+
var styles$r = {"container":"Drawer-module_container__hXuOY","backdrop":"Drawer-module_backdrop__MIipQ","fadeIn":"Drawer-module_fadeIn__QsuvQ","backdropOpen":"Drawer-module_backdropOpen__YpH--","drawer":"Drawer-module_drawer__EHbbs","right":"Drawer-module_right__x6P6Q","drawerOpen":"Drawer-module_drawerOpen__KTgFg","left":"Drawer-module_left__aVF9t","top":"Drawer-module_top__wuvhi","bottom":"Drawer-module_bottom__rt-VZ","sizeSm":"Drawer-module_sizeSm__LFrm3","sizeMd":"Drawer-module_sizeMd__A1QTQ","sizeLg":"Drawer-module_sizeLg__6laD8","sizeXl":"Drawer-module_sizeXl__FY9mZ","sizeFull":"Drawer-module_sizeFull__BGQ1q","header":"Drawer-module_header__MpR14","headerContent":"Drawer-module_headerContent__dFcLH","title":"Drawer-module_title__0AmOX","closeButton":"Drawer-module_closeButton__VuXsE","body":"Drawer-module_body__GLUGo","footer":"Drawer-module_footer__K5ekS"};
|
|
1131
|
+
|
|
1132
|
+
const DrawerHeader = ({ title, children, showClose = true, onClose, className = '', }) => (jsxs("div", { className: `${styles$r.header} ${className}`, children: [jsxs("div", { className: styles$r.headerContent, children: [title && jsx("h2", { className: styles$r.title, children: title }), children] }), showClose && (jsx("button", { type: "button", className: styles$r.closeButton, onClick: onClose, "aria-label": "Close drawer", children: jsx("svg", { width: "20", height: "20", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) }))] }));
|
|
1133
|
+
const DrawerBody = ({ children, className = '' }) => (jsx("div", { className: `${styles$r.body} ${className}`, children: children }));
|
|
1134
|
+
const DrawerFooter = ({ children, className = '' }) => (jsx("div", { className: `${styles$r.footer} ${className}`, children: children }));
|
|
1135
|
+
const Drawer = ({ isOpen, onClose, position = 'right', size = 'md', children, closeOnBackdropClick = true, closeOnEscape = true, showBackdrop = true, className = '', }) => {
|
|
1136
|
+
const handleEscape = useCallback((e) => {
|
|
1137
|
+
if (closeOnEscape && e.key === 'Escape') {
|
|
1138
|
+
onClose();
|
|
1139
|
+
}
|
|
1140
|
+
}, [closeOnEscape, onClose]);
|
|
1141
|
+
useEffect(() => {
|
|
1142
|
+
if (isOpen) {
|
|
1143
|
+
document.addEventListener('keydown', handleEscape);
|
|
1144
|
+
document.body.style.overflow = 'hidden';
|
|
1145
|
+
}
|
|
1146
|
+
return () => {
|
|
1147
|
+
document.removeEventListener('keydown', handleEscape);
|
|
1148
|
+
document.body.style.overflow = '';
|
|
1149
|
+
};
|
|
1150
|
+
}, [isOpen, handleEscape]);
|
|
1151
|
+
const handleBackdropClick = () => {
|
|
1152
|
+
if (closeOnBackdropClick) {
|
|
1153
|
+
onClose();
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
if (!isOpen)
|
|
1157
|
+
return null;
|
|
1158
|
+
return (jsxs("div", { className: styles$r.container, children: [showBackdrop && (jsx("div", { className: `${styles$r.backdrop} ${isOpen ? styles$r.backdropOpen : ''}`, onClick: handleBackdropClick })), jsx("div", { className: `${styles$r.drawer} ${styles$r[position]} ${styles$r[`size${size.charAt(0).toUpperCase()}${size.slice(1)}`]} ${isOpen ? styles$r.drawerOpen : ''} ${className}`, role: "dialog", "aria-modal": "true", children: React.Children.map(children, (child) => {
|
|
1159
|
+
if (React.isValidElement(child) && child.type === DrawerHeader) {
|
|
1160
|
+
return React.cloneElement(child, {
|
|
1161
|
+
onClose,
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
return child;
|
|
1165
|
+
}) })] }));
|
|
1166
|
+
};
|
|
1167
|
+
Drawer.Header = DrawerHeader;
|
|
1168
|
+
Drawer.Body = DrawerBody;
|
|
1169
|
+
Drawer.Footer = DrawerFooter;
|
|
1170
|
+
|
|
1171
|
+
var styles$q = {"container":"MembershipPrograms-module_container__qsGZu","loading":"MembershipPrograms-module_loading__tjDtr","alert":"MembershipPrograms-module_alert__GZc0f","header":"MembershipPrograms-module_header__ywXOE","title":"MembershipPrograms-module_title__WZGyt","addButton":"MembershipPrograms-module_addButton__rNlNb","empty":"MembershipPrograms-module_empty__pYrHW","list":"MembershipPrograms-module_list__8A9MG","group":"MembershipPrograms-module_group__v1Vc6","groupHeader":"MembershipPrograms-module_groupHeader__I5KJO","groupIcon":"MembershipPrograms-module_groupIcon__e1LIq","groupLabel":"MembershipPrograms-module_groupLabel__Wqift","programs":"MembershipPrograms-module_programs__hxHXQ","program":"MembershipPrograms-module_program__S3HTM","programInfo":"MembershipPrograms-module_programInfo__RJruG","programProvider":"MembershipPrograms-module_programProvider__c7enz","programName":"MembershipPrograms-module_programName__TN42s","programNumber":"MembershipPrograms-module_programNumber__GKav4","programStatus":"MembershipPrograms-module_programStatus__2imvX","programActions":"MembershipPrograms-module_programActions__36LkY","actionButton":"MembershipPrograms-module_actionButton__y-GI4","removeButton":"MembershipPrograms-module_removeButton__cTTuZ"};
|
|
1172
|
+
|
|
1173
|
+
const PlaneIcon$2 = () => (jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("path", { d: "M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5Z" }) }));
|
|
1174
|
+
const HotelIcon$2 = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M3 21h18" }), jsx("path", { d: "M19 21V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v16" }), jsx("path", { d: "M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4" })] }));
|
|
1175
|
+
const CarIcon$1 = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M7 17m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }), jsx("path", { d: "M17 17m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }), jsx("path", { d: "M5 17h-2v-6l2 -5h9l4 5h1a2 2 0 0 1 2 2v4h-2m-4 0h-6m-6 -6h15m-6 0v-5" })] }));
|
|
1176
|
+
const StarIcon = () => (jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) }));
|
|
1177
|
+
const EditIcon = () => (jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" }) }));
|
|
1178
|
+
const TrashIcon = () => (jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("polyline", { points: "3 6 5 6 21 6" }), jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })] }));
|
|
1179
|
+
const PlusIcon = () => (jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" })] }));
|
|
1180
|
+
const TYPE_ICONS = {
|
|
1181
|
+
airline: jsx(PlaneIcon$2, {}),
|
|
1182
|
+
hotel: jsx(HotelIcon$2, {}),
|
|
1183
|
+
car: jsx(CarIcon$1, {}),
|
|
1184
|
+
other: jsx(StarIcon, {}),
|
|
1185
|
+
};
|
|
1186
|
+
const TYPE_LABELS = {
|
|
1187
|
+
airline: 'Airline',
|
|
1188
|
+
hotel: 'Hotel',
|
|
1189
|
+
car: 'Car Rental',
|
|
1190
|
+
other: 'Other',
|
|
1191
|
+
};
|
|
1192
|
+
/**
|
|
1193
|
+
* MembershipPrograms - Displays a list of frequent flyer/loyalty programs
|
|
1194
|
+
*/
|
|
1195
|
+
const MembershipPrograms = ({ title = 'Membership Programs', programs, onEdit, onRemove, onAdd, alert, isLoading = false, emptyMessage = 'No membership programs added', className = '', }) => {
|
|
1196
|
+
const containerClasses = [
|
|
1197
|
+
styles$q.container,
|
|
1198
|
+
isLoading ? styles$q.loading : '',
|
|
1199
|
+
className,
|
|
1200
|
+
].filter(Boolean).join(' ');
|
|
1201
|
+
const groupedPrograms = programs.reduce((acc, program) => {
|
|
1202
|
+
const type = program.type || 'other';
|
|
1203
|
+
if (!acc[type])
|
|
1204
|
+
acc[type] = [];
|
|
1205
|
+
acc[type].push(program);
|
|
1206
|
+
return acc;
|
|
1207
|
+
}, {});
|
|
1208
|
+
const typeOrder = ['airline', 'hotel', 'car', 'other'];
|
|
1209
|
+
return (jsxs("div", { className: containerClasses, children: [alert && jsx("div", { className: styles$q.alert, children: alert }), jsxs("div", { className: styles$q.header, children: [jsx("h2", { className: styles$q.title, children: title }), onAdd && (jsxs("button", { type: "button", className: styles$q.addButton, onClick: onAdd, "aria-label": "Add membership program", children: [jsx(PlusIcon, {}), jsx("span", { children: "Add Program" })] }))] }), programs.length === 0 ? (jsx("div", { className: styles$q.empty, children: jsx("p", { children: emptyMessage }) })) : (jsx("div", { className: styles$q.list, children: typeOrder.map((type) => {
|
|
1210
|
+
const typePrograms = groupedPrograms[type];
|
|
1211
|
+
if (!typePrograms || typePrograms.length === 0)
|
|
1212
|
+
return null;
|
|
1213
|
+
return (jsxs("div", { className: styles$q.group, children: [jsxs("div", { className: styles$q.groupHeader, children: [jsx("span", { className: styles$q.groupIcon, children: TYPE_ICONS[type] }), jsx("span", { className: styles$q.groupLabel, children: TYPE_LABELS[type] })] }), jsx("div", { className: styles$q.programs, children: typePrograms.map((program) => (jsxs("div", { className: styles$q.program, children: [jsxs("div", { className: styles$q.programInfo, children: [jsx("div", { className: styles$q.programProvider, children: program.provider }), program.programName && (jsx("div", { className: styles$q.programName, children: program.programName })), jsx("div", { className: styles$q.programNumber, children: program.membershipNumber }), program.status && (jsx("div", { className: styles$q.programStatus, children: program.status }))] }), jsxs("div", { className: styles$q.programActions, children: [onEdit && (jsx("button", { type: "button", className: styles$q.actionButton, onClick: () => onEdit(program), "aria-label": `Edit ${program.provider} program`, children: jsx(EditIcon, {}) })), onRemove && (jsx("button", { type: "button", className: [styles$q.actionButton, styles$q.removeButton].join(' '), onClick: () => onRemove(program), "aria-label": `Remove ${program.provider} program`, children: jsx(TrashIcon, {}) }))] })] }, program.id))) })] }, type));
|
|
1214
|
+
}) }))] }));
|
|
1215
|
+
};
|
|
1216
|
+
MembershipPrograms.displayName = 'MembershipPrograms';
|
|
1217
|
+
|
|
1218
|
+
var styles$p = {"stats":"ManifestCapacityStats-module_stats__BA5-o","stat":"ManifestCapacityStats-module_stat__qLJtb","labelRow":"ManifestCapacityStats-module_labelRow__iDQqn","label":"ManifestCapacityStats-module_label__5BRoZ","value":"ManifestCapacityStats-module_value__4hiE5","sub":"ManifestCapacityStats-module_sub__w7djZ","warningText":"ManifestCapacityStats-module_warningText__CZZ9a","warningIcon":"ManifestCapacityStats-module_warningIcon__NoXmW","alertIcon":"ManifestCapacityStats-module_alertIcon__h0QHJ","meter":"ManifestCapacityStats-module_meter__DrUuq","meterFill":"ManifestCapacityStats-module_meterFill__v7zKW","meterOver":"ManifestCapacityStats-module_meterOver__UqigI","alert":"ManifestCapacityStats-module_alert__vwkBX"};
|
|
1219
|
+
|
|
1220
|
+
const Stat = ({ label, value, sub, meterValue, meterMax, warn = false }) => {
|
|
1221
|
+
const ratio = meterMax > 0 ? Math.min(100, Math.max(0, (meterValue / meterMax) * 100)) : 0;
|
|
1222
|
+
return (jsxs("div", { className: styles$p.stat, children: [jsxs("div", { className: styles$p.labelRow, children: [jsx("span", { className: styles$p.label, children: label }), warn && jsx(WarningIcon$1, { size: 14, className: styles$p.warningIcon, "aria-label": `${label} warning` })] }), jsx("div", { className: [styles$p.value, warn ? styles$p.warningText : ''].filter(Boolean).join(' '), children: value }), jsx("div", { className: styles$p.sub, children: sub }), jsx("div", { className: styles$p.meter, "aria-hidden": "true", children: jsx("span", { className: [styles$p.meterFill, warn ? styles$p.meterOver : ''].filter(Boolean).join(' '), style: { width: `${ratio}%` } }) })] }));
|
|
1223
|
+
};
|
|
1224
|
+
/** Advisory seat and payload meters from Hub's charter manifest. */
|
|
1225
|
+
const ManifestCapacityStats = ({ paxCount, seats, paxWeight, cargoWeight, payloadLimit, className = '', }) => {
|
|
1226
|
+
const totalWeight = paxWeight + cargoWeight;
|
|
1227
|
+
const overSeats = seats > 0 && paxCount > seats;
|
|
1228
|
+
const overPayload = payloadLimit > 0 && totalWeight > payloadLimit;
|
|
1229
|
+
return (jsxs("div", { className: className, children: [jsxs("div", { className: styles$p.stats, children: [jsx(Stat, { label: "Seats", value: `${paxCount} / ${seats}`, sub: overSeats ? `${paxCount - seats} over capacity` : `${Math.max(0, seats - paxCount)} seats open`, meterValue: paxCount, meterMax: seats, warn: overSeats }), jsx(Stat, { label: "Passenger weight", value: `${paxWeight.toLocaleString()} lb`, sub: `${paxCount} passengers`, meterValue: paxWeight, meterMax: payloadLimit }), jsx(Stat, { label: "Cargo weight", value: `${cargoWeight.toLocaleString()} lb`, sub: "Equipment + bags", meterValue: cargoWeight, meterMax: payloadLimit }), jsx(Stat, { label: "Total payload", value: `${totalWeight.toLocaleString()} lb`, sub: overPayload ? `${(totalWeight - payloadLimit).toLocaleString()} lb over limit` : `Limit ${payloadLimit.toLocaleString()} lb`, meterValue: totalWeight, meterMax: payloadLimit, warn: overPayload })] }), (overSeats || overPayload) && (jsxs("div", { className: styles$p.alert, role: "alert", children: [jsx(WarningIcon$1, { size: 20, className: styles$p.alertIcon }), jsxs("div", { children: [overSeats && (jsxs("div", { children: [jsx("strong", { children: "Over seat capacity." }), " Remove ", paxCount - seats, " passenger(s) or split the manifest by segment."] })), overPayload && (jsxs("div", { children: [jsx("strong", { children: "Over the contracted payload." }), " Total payload exceeds the quoted maximum \u2014 coordinate with the team/client and confirm with the carrier before sending."] }))] })] }))] }));
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
var styles$o = {"overlay":"Modal-module_overlay__n7Paz","fadeIn":"Modal-module_fadeIn__upWKg","modal":"Modal-module_modal__YZQ-K","slideIn":"Modal-module_slideIn__mtAFr","sm":"Modal-module_sm__QSWSJ","md":"Modal-module_md__6t9J8","lg":"Modal-module_lg__5r3uQ","xl":"Modal-module_xl__JPpjn","full":"Modal-module_full__y9leS","header":"Modal-module_header__xTw6j","title":"Modal-module_title__KvPHy","closeButton":"Modal-module_closeButton__JoRui","body":"Modal-module_body__K3swC","footer":"Modal-module_footer__Z1UcB","footerButtons":"Modal-module_footerButtons__u-Ayv","confirmMessage":"Modal-module_confirmMessage__ZlKV8"};
|
|
1233
|
+
|
|
1234
|
+
const Modal = ({ isOpen, onClose, title, children, size = 'md', showCloseButton = true, closeOnBackdropClick = true, closeOnEscape = true, footer, className = '', }) => {
|
|
1235
|
+
const handleEscape = useCallback((e) => {
|
|
1236
|
+
if (closeOnEscape && e.key === 'Escape') {
|
|
1237
|
+
onClose();
|
|
1238
|
+
}
|
|
1239
|
+
}, [closeOnEscape, onClose]);
|
|
1240
|
+
useEffect(() => {
|
|
1241
|
+
if (isOpen) {
|
|
1242
|
+
document.addEventListener('keydown', handleEscape);
|
|
1243
|
+
document.body.style.overflow = 'hidden';
|
|
1244
|
+
}
|
|
1245
|
+
return () => {
|
|
1246
|
+
document.removeEventListener('keydown', handleEscape);
|
|
1247
|
+
document.body.style.overflow = '';
|
|
1248
|
+
};
|
|
1249
|
+
}, [isOpen, handleEscape]);
|
|
1250
|
+
const handleBackdropClick = (e) => {
|
|
1251
|
+
if (closeOnBackdropClick && e.target === e.currentTarget) {
|
|
1252
|
+
onClose();
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
if (!isOpen)
|
|
1256
|
+
return null;
|
|
1257
|
+
return (jsx("div", { className: styles$o.overlay, onClick: handleBackdropClick, children: jsxs("div", { className: `${styles$o.modal} ${styles$o[size]} ${className}`, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? 'modal-title' : undefined, children: [(title || showCloseButton) && (jsxs("div", { className: styles$o.header, children: [title && (jsx("h2", { id: "modal-title", className: styles$o.title, children: title })), showCloseButton && (jsx("button", { type: "button", className: styles$o.closeButton, onClick: onClose, "aria-label": "Close modal", children: jsx("svg", { width: "20", height: "20", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) }))] })), jsx("div", { className: styles$o.body, children: children }), footer && jsx("div", { className: styles$o.footer, children: footer })] }) }));
|
|
1258
|
+
};
|
|
1259
|
+
const ModalFooter = ({ children, className = '' }) => (jsx("div", { className: `${styles$o.footerButtons} ${className}`, children: children }));
|
|
1260
|
+
const ConfirmModal = ({ message, confirmText = 'Confirm', cancelText = 'Cancel', onConfirm, onClose, destructive = false, loading = false, ...props }) => (jsx(Modal, { ...props, onClose: onClose, size: "sm", footer: jsxs(ModalFooter, { children: [jsx(Button, { variant: "secondary", onClick: onClose, children: cancelText }), jsx(Button, { variant: destructive ? 'danger' : 'primary', onClick: onConfirm, disabled: loading, children: loading ? 'Loading...' : confirmText })] }), children: jsx("div", { className: styles$o.confirmMessage, children: message }) }));
|
|
1261
|
+
|
|
1262
|
+
var styles$n = {"module":"Module-module_module__1Lglz","header":"Module-module_header__-qP6m","closed":"Module-module_closed__J5FYJ","sm":"Module-module_sm__g-iVI","md":"Module-module_md__zmKQE","lg":"Module-module_lg__5uVgV","titleRow":"Module-module_titleRow__3upJc","icon":"Module-module_icon__MXVy7","iconSpaced":"Module-module_iconSpaced__O8F0i","title":"Module-module_title__Qdyv0","badge":"Module-module_badge__zoNEC","tools":"Module-module_tools__w6Z1b","toggleBtn":"Module-module_toggleBtn__VxH2u","bodyWrapper":"Module-module_bodyWrapper__IogVT","body":"Module-module_body__O9n9B","hidden":"Module-module_hidden__mmUYg","footer":"Module-module_footer__hrUY9","divider":"Module-module_divider__YQKdf","dark":"Module-module_dark__w8Fb-","verticalDivider":"Module-module_verticalDivider__t3g-3"};
|
|
1263
|
+
|
|
1264
|
+
const ChevronIcon = ({ direction }) => (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", style: { transform: direction === 'up' ? 'rotate(180deg)' : 'none' }, children: jsx("polyline", { points: "6 9 12 15 18 9" }) }));
|
|
1265
|
+
/**
|
|
1266
|
+
* Module component - a collapsible card with header, body, and footer sections.
|
|
1267
|
+
* Used for grouping related content like trip segments (Air, Ground, Hotel).
|
|
1268
|
+
*/
|
|
1269
|
+
const Module = ({ title, icon, iconClassName = '', badge, before, children, after, footer, tools, className = '', headerClassName = '', titleClassName = '', bodyClassName = '', size = 'md', useToggle = true, show = true, onToggle, }) => {
|
|
1270
|
+
const [open, setOpen] = useState(show);
|
|
1271
|
+
useEffect(() => {
|
|
1272
|
+
if (typeof show === 'boolean') {
|
|
1273
|
+
setOpen(show);
|
|
1274
|
+
}
|
|
1275
|
+
}, [show]);
|
|
1276
|
+
const handleToggle = () => {
|
|
1277
|
+
if (typeof onToggle === 'function') {
|
|
1278
|
+
onToggle();
|
|
1279
|
+
}
|
|
1280
|
+
else {
|
|
1281
|
+
setOpen(!open);
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
return (jsxs("div", { className: `${styles$n.module} ${className}`, children: [title && (jsx("div", { className: `${styles$n.header} ${styles$n[size]} ${!open ? styles$n.closed : ''} ${headerClassName}`, children: jsxs("div", { className: `${styles$n.titleRow} ${styles$n[size]} ${titleClassName}`, children: [icon && (jsx("span", { className: `${styles$n.icon} ${size === 'sm' ? '' : styles$n.iconSpaced} ${iconClassName}`, children: icon })), jsx("span", { className: styles$n.title, children: title }), badge && jsx("span", { className: styles$n.badge, children: badge }), jsxs("div", { className: styles$n.tools, children: [tools, useToggle && (jsx("button", { type: "button", className: styles$n.toggleBtn, onClick: handleToggle, "aria-expanded": open, children: jsx(ChevronIcon, { direction: open ? 'up' : 'down' }) }))] })] }) })), jsxs("div", { className: styles$n.bodyWrapper, children: [before, jsx("div", { className: `${styles$n.body} ${styles$n[size]} ${!open ? styles$n.hidden : ''} ${bodyClassName}`, children: children }), after] }), footer && (jsx("div", { className: `${styles$n.footer} ${!open ? styles$n.hidden : ''}`, children: footer }))] }));
|
|
1285
|
+
};
|
|
1286
|
+
/**
|
|
1287
|
+
* Horizontal divider for Module content
|
|
1288
|
+
*/
|
|
1289
|
+
const ModuleDivider = ({ dark = false, className = '' }) => (jsx("hr", { className: `${styles$n.divider} ${dark ? styles$n.dark : ''} ${className}` }));
|
|
1290
|
+
/**
|
|
1291
|
+
* Vertical divider for Module content
|
|
1292
|
+
*/
|
|
1293
|
+
const ModuleVerticalDivider = ({ dark = false, className = '' }) => (jsx("div", { className: `${styles$n.verticalDivider} ${dark ? styles$n.dark : ''} ${className}` }));
|
|
1294
|
+
Module.displayName = 'Module';
|
|
1295
|
+
|
|
1296
|
+
var styles$m = {"stack":"PageBanners-module_stack__v6nwz","banner":"PageBanners-module_banner__8lgnU","system":"PageBanners-module_system__Xiqoe","alert":"PageBanners-module_alert__O2lYb","systemIcon":"PageBanners-module_systemIcon__su3aG","alertIcon":"PageBanners-module_alertIcon__owy3V","alertTitle":"PageBanners-module_alertTitle__zeo3d","alertDismiss":"PageBanners-module_alertDismiss__2JI9V","content":"PageBanners-module_content__ZHLA9","title":"PageBanners-module_title__-53EA","detail":"PageBanners-module_detail__xgNJE","clamp":"PageBanners-module_clamp__iWIIp","alertLink":"PageBanners-module_alertLink__mxQM5","dismiss":"PageBanners-module_dismiss__aWRXw"};
|
|
1297
|
+
|
|
1298
|
+
const decodeEntities = (value) => {
|
|
1299
|
+
if (typeof document === 'undefined')
|
|
1300
|
+
return value;
|
|
1301
|
+
const element = document.createElement('textarea');
|
|
1302
|
+
element.innerHTML = value;
|
|
1303
|
+
return element.value;
|
|
1304
|
+
};
|
|
1305
|
+
const PageBanners = ({ systemBanners, alertBanners, className = '', }) => {
|
|
1306
|
+
const [dismissed, setDismissed] = useState(new Set());
|
|
1307
|
+
const previousSystem = useRef(systemBanners);
|
|
1308
|
+
const previousAlerts = useRef(alertBanners);
|
|
1309
|
+
useEffect(() => {
|
|
1310
|
+
if (previousSystem.current !== systemBanners || previousAlerts.current !== alertBanners) {
|
|
1311
|
+
setDismissed(new Set());
|
|
1312
|
+
previousSystem.current = systemBanners;
|
|
1313
|
+
previousAlerts.current = alertBanners;
|
|
1314
|
+
}
|
|
1315
|
+
}, [alertBanners, systemBanners]);
|
|
1316
|
+
const dismiss = (id) => {
|
|
1317
|
+
setDismissed((current) => new Set([...current, id]));
|
|
1318
|
+
};
|
|
1319
|
+
const visibleSystem = systemBanners.filter((banner) => !dismissed.has(banner.id));
|
|
1320
|
+
const visibleAlerts = alertBanners.filter((banner) => !dismissed.has(banner.id));
|
|
1321
|
+
if (!visibleSystem.length && !visibleAlerts.length)
|
|
1322
|
+
return null;
|
|
1323
|
+
return (jsxs("div", { className: [styles$m.stack, className].filter(Boolean).join(' '), role: "region", "aria-label": "Page notices", children: [visibleSystem.map((banner) => (jsxs("div", { className: [styles$m.banner, styles$m.system].join(' '), role: "status", children: [jsx(InfoIcon$1, { className: styles$m.systemIcon, size: 20, "aria-hidden": "true" }), jsxs("div", { className: styles$m.content, children: [jsx("p", { className: styles$m.title, dangerouslySetInnerHTML: { __html: banner.html } }), banner.detailHtml && (jsx("p", { className: styles$m.detail, dangerouslySetInnerHTML: { __html: banner.detailHtml } }))] }), jsx("button", { type: "button", className: styles$m.dismiss, "aria-label": "Dismiss notice", onClick: () => dismiss(banner.id), children: jsx(CloseIcon, { size: 16 }) })] }, banner.id))), visibleAlerts.map((banner) => {
|
|
1324
|
+
const content = (jsxs("div", { className: styles$m.content, children: [jsx("p", { className: [styles$m.title, styles$m.alertTitle].join(' '), children: decodeEntities(banner.title) }), banner.body && jsx("p", { className: [styles$m.detail, styles$m.clamp].join(' '), children: decodeEntities(banner.body) })] }));
|
|
1325
|
+
return (jsxs("div", { className: [styles$m.banner, styles$m.alert].join(' '), role: "alert", children: [jsx(WarningIcon$1, { className: styles$m.alertIcon, size: 20, "aria-hidden": "true" }), banner.href ? (jsx("a", { href: banner.href, className: styles$m.alertLink, children: content })) : (content), jsx("button", { type: "button", className: [styles$m.dismiss, styles$m.alertDismiss].join(' '), "aria-label": "Dismiss alert", onClick: () => dismiss(banner.id), children: jsx(CloseIcon, { size: 16 }) })] }, banner.id));
|
|
1326
|
+
})] }));
|
|
1327
|
+
};
|
|
1328
|
+
|
|
1329
|
+
var styles$l = {"panel":"PreferencesPanel-module_panel__xsxcw","loading":"PreferencesPanel-module_loading__GopYy","alert":"PreferencesPanel-module_alert__9yYz3","title":"PreferencesPanel-module_title__Z5dpP","grid":"PreferencesPanel-module_grid__e0urP","section":"PreferencesPanel-module_section__6cbAx","sectionHeader":"PreferencesPanel-module_sectionHeader__X6e5h","sectionIcon":"PreferencesPanel-module_sectionIcon__jVJwn","sectionTitle":"PreferencesPanel-module_sectionTitle__29M-O","fields":"PreferencesPanel-module_fields__rryQ3","field":"PreferencesPanel-module_field__W3Z9z","fieldLabel":"PreferencesPanel-module_fieldLabel__usgRa","fieldValue":"PreferencesPanel-module_fieldValue__AEJ1C","fieldInput":"PreferencesPanel-module_fieldInput__rS8OR","footer":"PreferencesPanel-module_footer__qTYqi"};
|
|
1330
|
+
|
|
1331
|
+
const PlaneIcon$1 = () => (jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("path", { d: "M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5Z" }) }));
|
|
1332
|
+
const BusIcon$1 = () => (jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("rect", { x: "4", y: "4", width: "16", height: "14", rx: "2" }), jsx("path", { d: "M8 6v6" }), jsx("path", { d: "M16 6v6" }), jsx("circle", { cx: "8", cy: "16", r: "1" }), jsx("circle", { cx: "16", cy: "16", r: "1" })] }));
|
|
1333
|
+
const HotelIcon$1 = () => (jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M3 21h18" }), jsx("path", { d: "M19 21V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v16" }), jsx("path", { d: "M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4" })] }));
|
|
1334
|
+
const DEFAULT_ICONS = {
|
|
1335
|
+
air: jsx(PlaneIcon$1, {}),
|
|
1336
|
+
ground: jsx(BusIcon$1, {}),
|
|
1337
|
+
hotel: jsx(HotelIcon$1, {}),
|
|
1338
|
+
};
|
|
1339
|
+
/**
|
|
1340
|
+
* PreferencesPanel - Displays travel preferences in a multi-column layout
|
|
1341
|
+
*/
|
|
1342
|
+
const PreferencesPanel = ({ title, sections, alert, footer, isLoading = false, className = '', }) => {
|
|
1343
|
+
const panelClasses = [
|
|
1344
|
+
styles$l.panel,
|
|
1345
|
+
isLoading ? styles$l.loading : '',
|
|
1346
|
+
className,
|
|
1347
|
+
].filter(Boolean).join(' ');
|
|
1348
|
+
return (jsxs("div", { className: panelClasses, children: [alert && (jsx("div", { className: styles$l.alert, children: alert })), title && jsx("h2", { className: styles$l.title, children: title }), jsx("div", { className: styles$l.grid, children: sections.map((section, i) => (jsxs("div", { className: styles$l.section, children: [jsxs("div", { className: styles$l.sectionHeader, children: [(section.icon || DEFAULT_ICONS[section.title.toLowerCase()]) && (jsx("span", { className: styles$l.sectionIcon, children: section.icon || DEFAULT_ICONS[section.title.toLowerCase()] })), jsx("h3", { className: styles$l.sectionTitle, children: section.title })] }), jsx("div", { className: styles$l.fields, children: section.fields.map((field, j) => (jsxs("div", { className: styles$l.field, children: [jsx("label", { className: styles$l.fieldLabel, children: field.label }), field.input ? (jsx("div", { className: styles$l.fieldInput, children: field.input })) : (jsx("div", { className: styles$l.fieldValue, children: field.value || '—' }))] }, j))) })] }, i))) }), footer && (jsx("div", { className: styles$l.footer, children: footer }))] }));
|
|
1349
|
+
};
|
|
1350
|
+
PreferencesPanel.displayName = 'PreferencesPanel';
|
|
1351
|
+
|
|
1352
|
+
var styles$k = {"summary":"RequestSummary-module_summary__nxews","title":"RequestSummary-module_title__NAq53","submissionInfo":"RequestSummary-module_submissionInfo__dwkaf","label":"RequestSummary-module_label__pGo-5","value":"RequestSummary-module_value__F8m9g","sections":"RequestSummary-module_sections__uWXtM","section":"RequestSummary-module_section__TlxbY","sectionTitle":"RequestSummary-module_sectionTitle__iMPB2","segment":"RequestSummary-module_segment__xq-Lp","segmentTitle":"RequestSummary-module_segmentTitle__ey5-f","row":"RequestSummary-module_row__tfJzQ","empty":"RequestSummary-module_empty__fzxmd"};
|
|
1353
|
+
|
|
1354
|
+
/**
|
|
1355
|
+
* SummaryItem component displays a single label-value pair.
|
|
1356
|
+
*/
|
|
1357
|
+
const SummaryItemRow = ({ item, value }) => {
|
|
1358
|
+
if (!value)
|
|
1359
|
+
return null;
|
|
1360
|
+
const formattedValue = item.format ? item.format(value) : String(value);
|
|
1361
|
+
return (jsxs("div", { className: styles$k.row, children: [jsx("span", { className: styles$k.label, children: item.label }), jsx("span", { className: styles$k.value, children: formattedValue })] }));
|
|
1362
|
+
};
|
|
1363
|
+
/**
|
|
1364
|
+
* SummarySection component for a group of related summary items.
|
|
1365
|
+
*/
|
|
1366
|
+
const SummarySection = ({ section, values }) => {
|
|
1367
|
+
// Check if any items have values
|
|
1368
|
+
const hasItems = section.items?.some(item => values[item.label] || values[`${section.key}_${item.label}`]);
|
|
1369
|
+
const hasSegments = section.segments?.some(seg => seg.items.some(item => values[`${section.key}_${seg.label}_${item.label}`] || values[item.label]));
|
|
1370
|
+
if (!hasItems && !hasSegments)
|
|
1371
|
+
return null;
|
|
1372
|
+
return (jsxs("div", { className: styles$k.section, children: [jsx("h3", { className: styles$k.sectionTitle, children: section.title }), section.items?.map((item, i) => (jsx(SummaryItemRow, { item: item, value: values[item.label] || values[`${section.key}_${item.label}`] }, i))), section.segments?.map((segment, i) => (jsxs("div", { className: styles$k.segment, children: [jsx("h4", { className: styles$k.segmentTitle, children: segment.label }), segment.items.map((item, j) => (jsx(SummaryItemRow, { item: item, value: values[`${section.key}_${segment.label}_${item.label}`] || values[item.label] }, j)))] }, i)))] }));
|
|
1373
|
+
};
|
|
1374
|
+
/**
|
|
1375
|
+
* RequestSummary component for displaying a summary of travel request form data.
|
|
1376
|
+
* Shows enabled sections with their filled-in values.
|
|
1377
|
+
*/
|
|
1378
|
+
const RequestSummary = ({ sections, values, enabledSections = {}, submissionInfo, className, title = 'Request Summary', }) => {
|
|
1379
|
+
const visibleSections = sections.filter(section => enabledSections[section.key] !== false);
|
|
1380
|
+
return (jsxs("div", { className: `${styles$k.summary} ${className || ''}`, children: [jsx("h2", { className: styles$k.title, children: title }), submissionInfo && (jsxs("div", { className: styles$k.submissionInfo, children: [jsx("span", { className: styles$k.label, children: "Submitted by" }), jsx("span", { className: styles$k.value, children: submissionInfo.submittedBy }), jsx("span", { className: styles$k.label, children: "on" }), jsx("span", { className: styles$k.value, children: submissionInfo.submittedOn })] })), jsx("div", { className: styles$k.sections, children: visibleSections.map((section) => (jsx(SummarySection, { section: section, values: values }, section.key))) }), visibleSections.length === 0 && (jsx("p", { className: styles$k.empty, children: "No services selected" }))] }));
|
|
1381
|
+
};
|
|
1382
|
+
RequestSummary.displayName = 'RequestSummary';
|
|
1383
|
+
|
|
1384
|
+
var styles$j = {"sidenav":"Sidenav-module_sidenav__9DKVg","expanded":"Sidenav-module_expanded__TfkMs","collapsed":"Sidenav-module_collapsed__xyLkg","toggle":"Sidenav-module_toggle__JCoZu","logoContainer":"Sidenav-module_logoContainer__lLl0-","nav":"Sidenav-module_nav__ZwGrU","navItem":"Sidenav-module_navItem__HhFpj","active":"Sidenav-module_active__-oHUp","icon":"Sidenav-module_icon__7XJWf","label":"Sidenav-module_label__DJDBw","footer":"Sidenav-module_footer__EgrDk"};
|
|
1385
|
+
|
|
1386
|
+
/**
|
|
1387
|
+
* Sidenav component for main navigation.
|
|
1388
|
+
* Supports expanded and collapsed states with icons and labels.
|
|
1389
|
+
*/
|
|
1390
|
+
const Sidenav = ({ logo, logoCollapsed, items, activeKey, onItemClick, defaultExpanded = true, footer, className = '', ...props }) => {
|
|
1391
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
1392
|
+
const classNames = [
|
|
1393
|
+
styles$j.sidenav,
|
|
1394
|
+
expanded ? styles$j.expanded : styles$j.collapsed,
|
|
1395
|
+
className,
|
|
1396
|
+
]
|
|
1397
|
+
.filter(Boolean)
|
|
1398
|
+
.join(' ');
|
|
1399
|
+
const handleItemClick = (item) => {
|
|
1400
|
+
if (item.onClick) {
|
|
1401
|
+
item.onClick();
|
|
1402
|
+
}
|
|
1403
|
+
if (onItemClick) {
|
|
1404
|
+
onItemClick(item.key);
|
|
1405
|
+
}
|
|
1406
|
+
};
|
|
1407
|
+
return (jsxs("aside", { className: classNames, ...props, children: [jsx("button", { className: styles$j.toggle, onClick: () => setExpanded(!expanded), "aria-label": expanded ? 'Collapse sidebar' : 'Expand sidebar', children: expanded ? (jsx(ChevronLeftIcon, { size: 16 })) : (jsx(ChevronRightIcon$1, { size: 16 })) }), jsx("div", { className: styles$j.logoContainer, children: expanded ? logo : logoCollapsed || logo }), jsx("nav", { className: styles$j.nav, children: items.map((item) => {
|
|
1408
|
+
const isActive = item.key === activeKey;
|
|
1409
|
+
const itemClasses = [
|
|
1410
|
+
styles$j.navItem,
|
|
1411
|
+
isActive ? styles$j.active : '',
|
|
1412
|
+
]
|
|
1413
|
+
.filter(Boolean)
|
|
1414
|
+
.join(' ');
|
|
1415
|
+
return (jsxs("button", { className: itemClasses, onClick: () => handleItemClick(item), "aria-current": isActive ? 'page' : undefined, title: !expanded ? item.label : undefined, children: [jsx("span", { className: styles$j.icon, children: item.icon }), expanded && jsx("span", { className: styles$j.label, children: item.label })] }, item.key));
|
|
1416
|
+
}) }), footer && jsx("div", { className: styles$j.footer, children: footer })] }));
|
|
1417
|
+
};
|
|
1418
|
+
Sidenav.displayName = 'Sidenav';
|
|
1419
|
+
|
|
1420
|
+
var styles$i = {"wrapper":"Table-module_wrapper__1klo5","table":"Table-module_table__fkuUB","header":"Table-module_header__vRy6j","headerCell":"Table-module_headerCell__2KzYn","headerContent":"Table-module_headerContent__HPl8-","sortable":"Table-module_sortable__NiS6E","sortIcon":"Table-module_sortIcon__Fy6z7","body":"Table-module_body__Wt52U","row":"Table-module_row__4GEgX","cell":"Table-module_cell__Xr-7H","alignLeft":"Table-module_alignLeft__FtI9E","alignCenter":"Table-module_alignCenter__p8Tr8","alignRight":"Table-module_alignRight__Ca7Yr","bordered":"Table-module_bordered__9bM3L","striped":"Table-module_striped__6TMF-","hoverable":"Table-module_hoverable__KN5Fp","compact":"Table-module_compact__opzS-","clickable":"Table-module_clickable__2ummV","loading":"Table-module_loading__tFELE","empty":"Table-module_empty__urRiw","pulse":"Table-module_pulse__t32v9"};
|
|
1421
|
+
|
|
1422
|
+
const Table = ({ columns, data, rowKey = 'id', bordered = false, striped = false, hoverable = true, compact = false, loading = false, emptyMessage = 'No data available', onRowClick, className = '', }) => {
|
|
1423
|
+
const [sortColumn, setSortColumn] = useState(null);
|
|
1424
|
+
const [sortDirection, setSortDirection] = useState('asc');
|
|
1425
|
+
const handleSort = (column) => {
|
|
1426
|
+
if (!column.sortable)
|
|
1427
|
+
return;
|
|
1428
|
+
if (sortColumn === column.key) {
|
|
1429
|
+
setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
|
|
1430
|
+
}
|
|
1431
|
+
else {
|
|
1432
|
+
setSortColumn(column.key);
|
|
1433
|
+
setSortDirection('asc');
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
const sortedData = useMemo(() => {
|
|
1437
|
+
if (!sortColumn)
|
|
1438
|
+
return data;
|
|
1439
|
+
return [...data].sort((a, b) => {
|
|
1440
|
+
const aVal = a[sortColumn];
|
|
1441
|
+
const bVal = b[sortColumn];
|
|
1442
|
+
if (aVal === bVal)
|
|
1443
|
+
return 0;
|
|
1444
|
+
if (aVal === null || aVal === undefined)
|
|
1445
|
+
return 1;
|
|
1446
|
+
if (bVal === null || bVal === undefined)
|
|
1447
|
+
return -1;
|
|
1448
|
+
const comparison = aVal < bVal ? -1 : 1;
|
|
1449
|
+
return sortDirection === 'asc' ? comparison : -comparison;
|
|
1450
|
+
});
|
|
1451
|
+
}, [data, sortColumn, sortDirection]);
|
|
1452
|
+
const getRowKey = (row, index) => {
|
|
1453
|
+
if (typeof rowKey === 'function') {
|
|
1454
|
+
return rowKey(row);
|
|
1455
|
+
}
|
|
1456
|
+
return row[rowKey] ?? index;
|
|
1457
|
+
};
|
|
1458
|
+
return (jsx("div", { className: `${styles$i.wrapper} ${className}`, children: jsxs("table", { className: `${styles$i.table} ${bordered ? styles$i.bordered : ''} ${striped ? styles$i.striped : ''} ${hoverable ? styles$i.hoverable : ''} ${compact ? styles$i.compact : ''}`, children: [jsx("thead", { className: styles$i.header, children: jsx("tr", { children: columns.map((column) => (jsx("th", { className: `${styles$i.headerCell} ${column.sortable ? styles$i.sortable : ''} ${styles$i[`align${(column.align || 'left').charAt(0).toUpperCase()}${(column.align || 'left').slice(1)}`]}`, style: column.width ? { width: column.width } : undefined, onClick: () => handleSort(column), children: jsxs("span", { className: styles$i.headerContent, children: [column.label, column.sortable && (jsx("span", { className: styles$i.sortIcon, children: sortColumn === column.key ? (sortDirection === 'asc' ? '↑' : '↓') : ('↕') }))] }) }, column.key))) }) }), jsx("tbody", { className: styles$i.body, children: loading ? (jsx("tr", { children: jsx("td", { colSpan: columns.length, className: styles$i.loading, children: "Loading..." }) })) : sortedData.length === 0 ? (jsx("tr", { children: jsx("td", { colSpan: columns.length, className: styles$i.empty, children: emptyMessage }) })) : (sortedData.map((row, rowIndex) => (jsx("tr", { className: `${styles$i.row} ${onRowClick ? styles$i.clickable : ''}`, onClick: () => onRowClick?.(row, rowIndex), children: columns.map((column) => (jsx("td", { className: `${styles$i.cell} ${styles$i[`align${(column.align || 'left').charAt(0).toUpperCase()}${(column.align || 'left').slice(1)}`]}`, children: column.render
|
|
1459
|
+
? column.render(row[column.key], row, rowIndex)
|
|
1460
|
+
: row[column.key] }, column.key))) }, getRowKey(row, rowIndex))))) })] }) }));
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1463
|
+
var styles$h = {"card":"TeamCard-module_card__R2u4q","header":"TeamCard-module_header__XXRUp","icon":"TeamCard-module_icon__l2Go2","title":"TeamCard-module_title__llL8V","tabs":"TeamCard-module_tabs__SJ7t-","tab":"TeamCard-module_tab__Q5j3C","tabActive":"TeamCard-module_tabActive__dUPwX","list":"TeamCard-module_list__a734u","teamItem":"TeamCard-module_teamItem__OYVIK","teamName":"TeamCard-module_teamName__-Bds2","chevron":"TeamCard-module_chevron__zBxM6","teamCode":"TeamCard-module_teamCode__BHB63","empty":"TeamCard-module_empty__8b5hb"};
|
|
1464
|
+
|
|
1465
|
+
const TEAM_GROUPS = [
|
|
1466
|
+
{ label: 'All', key: undefined },
|
|
1467
|
+
{ label: 'Men', key: 'men' },
|
|
1468
|
+
{ label: 'Women', key: 'women' },
|
|
1469
|
+
{ label: 'Mixed', key: 'mixed' },
|
|
1470
|
+
];
|
|
1471
|
+
const getTeamColor = (code) => {
|
|
1472
|
+
const firstChar = code.charAt(0).toUpperCase();
|
|
1473
|
+
switch (firstChar) {
|
|
1474
|
+
case 'M':
|
|
1475
|
+
return 'var(--color-blue-100)';
|
|
1476
|
+
case 'W':
|
|
1477
|
+
return 'var(--color-pink-100)';
|
|
1478
|
+
case 'X':
|
|
1479
|
+
return 'var(--color-purple-100)';
|
|
1480
|
+
default:
|
|
1481
|
+
return 'var(--color-gray-100)';
|
|
1482
|
+
}
|
|
1483
|
+
};
|
|
1484
|
+
const UsersIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }), jsx("circle", { cx: "9", cy: "7", r: "4" }), jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }), jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })] }));
|
|
1485
|
+
const ChevronRightIcon = () => (jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "9 18 15 12 9 6" }) }));
|
|
1486
|
+
/**
|
|
1487
|
+
* TeamCard - Displays a list of teams with category filters
|
|
1488
|
+
*/
|
|
1489
|
+
const TeamCard = ({ title = 'Administer Teams', icon, teams, onTeamSelect, className = '', }) => {
|
|
1490
|
+
const [activeTab, setActiveTab] = useState();
|
|
1491
|
+
const filteredTeams = useMemo(() => {
|
|
1492
|
+
if (!activeTab)
|
|
1493
|
+
return teams;
|
|
1494
|
+
return teams.filter(team => team.category === activeTab);
|
|
1495
|
+
}, [teams, activeTab]);
|
|
1496
|
+
const cardClasses = [
|
|
1497
|
+
styles$h.card,
|
|
1498
|
+
className,
|
|
1499
|
+
].filter(Boolean).join(' ');
|
|
1500
|
+
return (jsxs("div", { className: cardClasses, children: [jsxs("div", { className: styles$h.header, children: [jsx("span", { className: styles$h.icon, children: icon || jsx(UsersIcon, {}) }), jsx("h3", { className: styles$h.title, children: title })] }), jsx("div", { className: styles$h.tabs, children: TEAM_GROUPS.map(({ label, key }) => (jsx("button", { type: "button", onClick: () => setActiveTab(key), className: `${styles$h.tab} ${activeTab === key ? styles$h.tabActive : ''}`, children: label }, label))) }), jsxs("div", { className: styles$h.list, children: [filteredTeams.map((team) => (jsxs("button", { type: "button", className: styles$h.teamItem, onClick: () => onTeamSelect?.(team), children: [jsx("span", { className: styles$h.teamCode, style: { backgroundColor: getTeamColor(team.code) }, children: team.code }), jsx("span", { className: styles$h.teamName, children: team.description }), jsx("span", { className: styles$h.chevron, children: jsx(ChevronRightIcon, {}) })] }, team.id))), filteredTeams.length === 0 && (jsx("div", { className: styles$h.empty, children: "No teams found" }))] })] }));
|
|
1501
|
+
};
|
|
1502
|
+
TeamCard.displayName = 'TeamCard';
|
|
1503
|
+
|
|
1504
|
+
var styles$g = {"topbar":"Topbar-module_topbar__U9CDj","left":"Topbar-module_left__m4aap","accountWrapper":"Topbar-module_accountWrapper__5mjDZ","accountSelector":"Topbar-module_accountSelector__iqI--","open":"Topbar-module_open__2Xsp1","accountCode":"Topbar-module_accountCode__KMKWm","accountName":"Topbar-module_accountName__XZYjB","chevron":"Topbar-module_chevron__OSXcD","chevronOpen":"Topbar-module_chevronOpen__jVvEl","dropdown":"Topbar-module_dropdown__fA5Gw","dropdownSearch":"Topbar-module_dropdownSearch__9zqy3","searchIcon":"Topbar-module_searchIcon__sHGnK","searchInput":"Topbar-module_searchInput__1TSc3","dropdownList":"Topbar-module_dropdownList__P4q9b","dropdownItem":"Topbar-module_dropdownItem__w-eHf","selected":"Topbar-module_selected__MylKY","dropdownItemCode":"Topbar-module_dropdownItemCode__cUAn6","dropdownItemName":"Topbar-module_dropdownItemName__MYw3k","noResults":"Topbar-module_noResults__PkNfT","actions":"Topbar-module_actions__KtaiZ"};
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* Topbar component for the main header.
|
|
1508
|
+
* Includes account selector with dropdown and action buttons.
|
|
1509
|
+
*/
|
|
1510
|
+
const Topbar = ({ account, accounts, onAccountSelect, onAccountClick, actions, leftContent, className = '', ...props }) => {
|
|
1511
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
1512
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
1513
|
+
const dropdownRef = useRef(null);
|
|
1514
|
+
const searchInputRef = useRef(null);
|
|
1515
|
+
const classNames = [styles$g.topbar, className].filter(Boolean).join(' ');
|
|
1516
|
+
// Close dropdown on outside click
|
|
1517
|
+
useEffect(() => {
|
|
1518
|
+
if (!isOpen)
|
|
1519
|
+
return;
|
|
1520
|
+
const handleClickOutside = (event) => {
|
|
1521
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1522
|
+
setIsOpen(false);
|
|
1523
|
+
setSearchQuery('');
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
const handleEscape = (event) => {
|
|
1527
|
+
if (event.key === 'Escape') {
|
|
1528
|
+
setIsOpen(false);
|
|
1529
|
+
setSearchQuery('');
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
1533
|
+
document.addEventListener('keydown', handleEscape);
|
|
1534
|
+
return () => {
|
|
1535
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
1536
|
+
document.removeEventListener('keydown', handleEscape);
|
|
1537
|
+
};
|
|
1538
|
+
}, [isOpen]);
|
|
1539
|
+
// Focus search input when dropdown opens
|
|
1540
|
+
useEffect(() => {
|
|
1541
|
+
if (isOpen && searchInputRef.current) {
|
|
1542
|
+
searchInputRef.current.focus();
|
|
1543
|
+
}
|
|
1544
|
+
}, [isOpen]);
|
|
1545
|
+
const handleToggle = () => {
|
|
1546
|
+
if (accounts && accounts.length > 0) {
|
|
1547
|
+
setIsOpen(!isOpen);
|
|
1548
|
+
if (!isOpen) {
|
|
1549
|
+
setSearchQuery('');
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
else if (onAccountClick) {
|
|
1553
|
+
onAccountClick();
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1556
|
+
const handleSelectAccount = (selectedAccount) => {
|
|
1557
|
+
onAccountSelect?.(selectedAccount);
|
|
1558
|
+
setIsOpen(false);
|
|
1559
|
+
setSearchQuery('');
|
|
1560
|
+
};
|
|
1561
|
+
const filteredAccounts = accounts?.filter(acc => acc.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
1562
|
+
acc.code.toLowerCase().includes(searchQuery.toLowerCase())) || [];
|
|
1563
|
+
const hasDropdown = accounts && accounts.length > 0;
|
|
1564
|
+
return (jsxs("header", { className: classNames, ...props, children: [jsxs("div", { className: styles$g.left, children: [leftContent, account && (jsxs("div", { className: styles$g.accountWrapper, ref: dropdownRef, children: [jsxs("button", { className: `${styles$g.accountSelector} ${isOpen ? styles$g.open : ''}`, onClick: handleToggle, "aria-expanded": isOpen, "aria-haspopup": hasDropdown ? 'listbox' : undefined, children: [jsx("span", { className: styles$g.accountCode, children: account.code }), jsx("span", { className: styles$g.accountName, children: account.name }), hasDropdown && (jsx(ChevronDownIcon$1, { size: 16, className: `${styles$g.chevron} ${isOpen ? styles$g.chevronOpen : ''}` }))] }), isOpen && hasDropdown && (jsxs("div", { className: styles$g.dropdown, role: "listbox", children: [jsxs("div", { className: styles$g.dropdownSearch, children: [jsxs("svg", { className: styles$g.searchIcon, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("circle", { cx: "11", cy: "11", r: "8" }), jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })] }), jsx("input", { ref: searchInputRef, type: "text", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search accounts...", className: styles$g.searchInput })] }), jsx("div", { className: styles$g.dropdownList, children: filteredAccounts.length > 0 ? (filteredAccounts.map((acc) => (jsxs("button", { className: `${styles$g.dropdownItem} ${acc.code === account.code ? styles$g.selected : ''}`, onClick: () => handleSelectAccount(acc), role: "option", "aria-selected": acc.code === account.code, children: [jsx("span", { className: styles$g.dropdownItemCode, children: acc.code }), jsx("span", { className: styles$g.dropdownItemName, children: acc.name })] }, acc.code)))) : (jsx("div", { className: styles$g.noResults, children: "No accounts found" })) })] }))] }))] }), actions && jsx("div", { className: styles$g.actions, children: actions })] }));
|
|
1565
|
+
};
|
|
1566
|
+
Topbar.displayName = 'Topbar';
|
|
1567
|
+
|
|
1568
|
+
var styles$f = {"form":"TravelerForm-module_form__wgss7","loading":"TravelerForm-module_loading__u38gT","header":"TravelerForm-module_header__X6v0S","title":"TravelerForm-module_title__pDabg","subtitle":"TravelerForm-module_subtitle__wArO7","content":"TravelerForm-module_content__NDu--","sections":"TravelerForm-module_sections__rnhZw","section":"TravelerForm-module_section__ukKVw","sectionTitle":"TravelerForm-module_sectionTitle__rtWV2","sectionContent":"TravelerForm-module_sectionContent__HPqkN","footer":"TravelerForm-module_footer__qQM1J"};
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* TravelerForm - Form layout for editing traveler/roster member details
|
|
1572
|
+
*/
|
|
1573
|
+
const TravelerForm = ({ values = {}, title, subtitle, children, renderNameSection, renderDetailsSection, renderPreferencesSection, footer, isLoading = false, className = '', }) => {
|
|
1574
|
+
const formClasses = [
|
|
1575
|
+
styles$f.form,
|
|
1576
|
+
isLoading ? styles$f.loading : '',
|
|
1577
|
+
className,
|
|
1578
|
+
].filter(Boolean).join(' ');
|
|
1579
|
+
return (jsxs("div", { className: formClasses, children: [(title || subtitle) && (jsxs("div", { className: styles$f.header, children: [title && jsx("h2", { className: styles$f.title, children: title }), subtitle && jsx("p", { className: styles$f.subtitle, children: subtitle })] })), children ? (jsx("div", { className: styles$f.content, children: children })) : (jsxs("div", { className: styles$f.sections, children: [renderNameSection && (jsxs("div", { className: styles$f.section, children: [jsx("h3", { className: styles$f.sectionTitle, children: "Name" }), jsx("div", { className: styles$f.sectionContent, children: renderNameSection(values) })] })), renderDetailsSection && (jsxs("div", { className: styles$f.section, children: [jsx("h3", { className: styles$f.sectionTitle, children: "Details" }), jsx("div", { className: styles$f.sectionContent, children: renderDetailsSection(values) })] })), renderPreferencesSection && (jsxs("div", { className: styles$f.section, children: [jsx("h3", { className: styles$f.sectionTitle, children: "Travel Preferences" }), jsx("div", { className: styles$f.sectionContent, children: renderPreferencesSection(values) })] }))] })), footer && (jsx("div", { className: styles$f.footer, children: footer }))] }));
|
|
1580
|
+
};
|
|
1581
|
+
TravelerForm.displayName = 'TravelerForm';
|
|
1582
|
+
|
|
1583
|
+
var styles$e = {"table":"TripTable-module_table__28HM1","header":"TripTable-module_header__VNQyG","serviceHeader":"TripTable-module_serviceHeader__AXqua","requestedHeader":"TripTable-module_requestedHeader__7RhgA","row":"TripTable-module_row__EIDoN","serviceRow":"TripTable-module_serviceRow__jhL2v","requestedRow":"TripTable-module_requestedRow__Sofhd","compact":"TripTable-module_compact__QiKWg","textMuted":"TripTable-module_textMuted__Wl7pk","pnrLink":"TripTable-module_pnrLink__XmIdV","vendorCode":"TripTable-module_vendorCode__mfnDQ","typesCell":"TripTable-module_typesCell__u7wYw","serviceCell":"TripTable-module_serviceCell__8PcQl","servicePlaceholder":"TripTable-module_servicePlaceholder__BEBJ7","viewCol":"TripTable-module_viewCol__LLt-7","viewLink":"TripTable-module_viewLink__lr6Rf","travelerCell":"TripTable-module_travelerCell__8X804","moreCount":"TripTable-module_moreCount__ZoYs5","requestedByCell":"TripTable-module_requestedByCell__6ARM-","submittedDate":"TripTable-module_submittedDate__FBqEI","empty":"TripTable-module_empty__Nzic2","emptyTitle":"TripTable-module_emptyTitle__QkWAx","emptyText":"TripTable-module_emptyText__KPP9Q"};
|
|
1584
|
+
|
|
1585
|
+
// TravelerCell component
|
|
1586
|
+
const TravelerCell = ({ names }) => {
|
|
1587
|
+
if (names.length === 0)
|
|
1588
|
+
return jsx("span", { children: "\u2014" });
|
|
1589
|
+
if (names.length === 1)
|
|
1590
|
+
return jsx("span", { children: names[0] });
|
|
1591
|
+
return (jsxs("span", { className: styles$e.travelerCell, children: [jsx("span", { children: names[0] }), jsxs("span", { className: styles$e.moreCount, children: ["+", names.length - 1] })] }));
|
|
1592
|
+
};
|
|
1593
|
+
// Chevron icon
|
|
1594
|
+
const ChevronRight$1 = ({ size = 20 }) => (jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: jsx("polyline", { points: "9 18 15 12 9 6" }) }));
|
|
1595
|
+
const TripTable = ({ trips, variant = 'current', density = 'comfortable', vendorMode = 'icon', useServiceColumn = false, onViewTrip, emptyMessage, className, }) => {
|
|
1596
|
+
const isRequested = variant === 'requested';
|
|
1597
|
+
const isCompact = density === 'compact';
|
|
1598
|
+
const serviceIconSize = isCompact ? 24 : 28;
|
|
1599
|
+
// Map status strings to our variants
|
|
1600
|
+
const mapStatus = (status) => {
|
|
1601
|
+
const statusMap = {
|
|
1602
|
+
'Ticketed': 'ticketed',
|
|
1603
|
+
'Itinerary': 'itinerary',
|
|
1604
|
+
'Not Ticketed': 'not-ticketed',
|
|
1605
|
+
'Submitted': 'submitted',
|
|
1606
|
+
'Pending': 'pending',
|
|
1607
|
+
'Cancelled': 'cancelled',
|
|
1608
|
+
};
|
|
1609
|
+
return statusMap[status] || status.toLowerCase();
|
|
1610
|
+
};
|
|
1611
|
+
return (jsxs("div", { className: `${styles$e.table} ${className || ''}`, children: [jsx("div", { className: `${styles$e.header} ${isRequested ? styles$e.requestedHeader : ''} ${useServiceColumn ? styles$e.serviceHeader : ''}`, children: isRequested ? (jsxs(Fragment, { children: [jsx("div", { children: "Request ID" }), jsx("div", { children: "Traveler(s)" }), jsx("div", { children: "Trip Type" }), jsx("div", { children: "Requested By" }), jsx("div", { className: styles$e.viewCol, children: "View" })] })) : (jsxs(Fragment, { children: [jsx("div", { children: "Traveler" }), jsx("div", { children: "Sport" }), jsx("div", { children: "PNR" }), useServiceColumn ? (jsxs(Fragment, { children: [jsx("div", { children: "Service" }), jsx("div", { children: "Itinerary" })] })) : (jsxs(Fragment, { children: [jsx("div", { children: "Vendor" }), jsx("div", { children: "Itinerary" }), jsx("div", { children: "Types" })] })), jsx("div", { children: "Travel Dates" }), jsx("div", { children: "Status" }), jsx("div", {})] })) }), trips.length === 0 ? (jsxs("div", { className: styles$e.empty, children: [jsx("div", { className: styles$e.emptyTitle, children: isRequested ? 'No Requested Trips' : 'No Trips Found' }), jsx("div", { className: styles$e.emptyText, children: emptyMessage || (isRequested
|
|
1612
|
+
? 'Travel requests submitted to STM will appear here until an agent books them.'
|
|
1613
|
+
: 'Try clearing your filters or widening the date range.') })] })) : (trips.map((trip, index) => (jsx("div", { className: `
|
|
1614
|
+
${styles$e.row}
|
|
1615
|
+
${isRequested ? styles$e.requestedRow : ''}
|
|
1616
|
+
${useServiceColumn ? styles$e.serviceRow : ''}
|
|
1617
|
+
${isCompact ? styles$e.compact : ''}
|
|
1618
|
+
`, onClick: () => onViewTrip?.(trip.pnr || trip.reqId || trip.id), children: isRequested ? (jsxs(Fragment, { children: [jsx("div", { children: jsx("a", { href: "#", className: styles$e.pnrLink, onClick: (e) => {
|
|
1619
|
+
e.preventDefault();
|
|
1620
|
+
e.stopPropagation();
|
|
1621
|
+
onViewTrip?.(trip.reqId || trip.id);
|
|
1622
|
+
}, children: trip.reqId }) }), jsx("div", { className: styles$e.textMuted, children: jsx(TravelerCell, { names: trip.travelers }) }), jsx("div", { className: styles$e.typesCell, children: trip.types.map((t, ti) => (jsx(TypeIcon, { type: t, size: isCompact ? 14 : 16 }, ti))) }), jsxs("div", { className: styles$e.requestedByCell, children: [jsx("div", { className: styles$e.textMuted, children: trip.requestedBy }), trip.submitted && (jsxs("div", { className: styles$e.submittedDate, children: ["Submitted ", trip.submitted] }))] }), jsx("div", { className: styles$e.viewCol, children: jsx("a", { href: "#", className: styles$e.viewLink, onClick: (e) => {
|
|
1623
|
+
e.preventDefault();
|
|
1624
|
+
e.stopPropagation();
|
|
1625
|
+
onViewTrip?.(trip.reqId || trip.id);
|
|
1626
|
+
}, title: "View request detail", children: jsx(ChevronRight$1, {}) }) })] })) : (jsxs(Fragment, { children: [jsx("div", { className: styles$e.textMuted, children: jsx(TravelerCell, { names: trip.travelers }) }), jsx("div", { className: styles$e.textMuted, children: trip.sport || '—' }), jsx("div", { children: jsx("a", { href: "#", className: styles$e.pnrLink, onClick: (e) => {
|
|
1627
|
+
e.preventDefault();
|
|
1628
|
+
e.stopPropagation();
|
|
1629
|
+
onViewTrip?.(trip.pnr || trip.id);
|
|
1630
|
+
}, children: trip.pnr }) }), useServiceColumn ? (jsxs(Fragment, { children: [jsx("div", { className: styles$e.serviceCell, children: ['A', 'H', 'C'].map(slot => (trip.types.includes(slot) ? (jsx(TravelServiceIcon, { type: slot, vendor: slot === 'A' ? trip.vendor : undefined, mode: vendorMode, size: serviceIconSize, multi: trip.multiSegments?.includes(slot) }, slot)) : (jsx("span", { className: styles$e.servicePlaceholder, style: { width: serviceIconSize, height: serviceIconSize } }, slot)))) }), jsx("div", { className: styles$e.textMuted, children: trip.itinerary || '—' })] })) : (jsxs(Fragment, { children: [jsx("div", { children: trip.vendor && vendorMode === 'icon' ? (jsx(TravelServiceIcon, { type: "A", vendor: trip.vendor, mode: "icon", size: 24 })) : (jsx("span", { className: styles$e.vendorCode, children: trip.vendor || '—' })) }), jsx("div", { className: styles$e.textMuted, children: trip.itinerary || '—' }), jsx("div", { className: styles$e.typesCell, children: trip.types.map((t, ti) => (jsx(TypeIcon, { type: t, size: isCompact ? 14 : 16 }, ti))) })] })), jsx("div", { className: styles$e.textMuted, children: trip.dates }), jsx("div", { children: jsx(StatusBadge, { status: mapStatus(trip.status) }) }), jsx("div", { className: styles$e.viewCol, children: jsx("a", { href: "#", className: styles$e.viewLink, onClick: (e) => {
|
|
1631
|
+
e.preventDefault();
|
|
1632
|
+
e.stopPropagation();
|
|
1633
|
+
onViewTrip?.(trip.pnr || trip.id);
|
|
1634
|
+
}, title: "View itinerary", children: jsx(ChevronRight$1, {}) }) })] })) }, trip.id || trip.pnr || trip.reqId || index))))] }));
|
|
1635
|
+
};
|
|
1636
|
+
|
|
1637
|
+
var styles$d = {"appLayout":"AppLayout-module_appLayout__hc9Tm","mainArea":"AppLayout-module_mainArea__yrO-w","content":"AppLayout-module_content__swPpZ"};
|
|
1638
|
+
|
|
1639
|
+
const AppLayout = ({ navItems = [], activeNavKey, logo, collapsedLogo, account, defaultExpanded = true, onNavItemClick, onAccountClick, children, navFooter, topbarActions, className, }) => {
|
|
1640
|
+
return (jsxs("div", { className: `${styles$d.appLayout} ${className || ''}`, children: [jsx(Sidenav, { items: navItems, activeKey: activeNavKey, defaultExpanded: defaultExpanded, onItemClick: onNavItemClick, logo: logo, logoCollapsed: collapsedLogo, footer: navFooter }), jsxs("div", { className: styles$d.mainArea, children: [jsx(Topbar, { account: account, onAccountClick: onAccountClick, actions: topbarActions }), jsx("main", { className: styles$d.content, children: children })] })] }));
|
|
1641
|
+
};
|
|
1642
|
+
|
|
1643
|
+
var styles$c = {"layout":"RequestFormLayout-module_layout__DGr3F","header":"RequestFormLayout-module_header__1Fjzd","headerContent":"RequestFormLayout-module_headerContent__xmuP9","headerTitle":"RequestFormLayout-module_headerTitle__PPhML","pagination":"RequestFormLayout-module_pagination__9jgEV","separator":"RequestFormLayout-module_separator__RhyUN","eventName":"RequestFormLayout-module_eventName__uE2BF","headerRight":"RequestFormLayout-module_headerRight__wNqWM","body":"RequestFormLayout-module_body__UkKrz","sidebar":"RequestFormLayout-module_sidebar__4vSWS","showOnMobile":"RequestFormLayout-module_showOnMobile__aQbIq","sidebarContent":"RequestFormLayout-module_sidebarContent__yxQaB","main":"RequestFormLayout-module_main__h8sP3","mainContent":"RequestFormLayout-module_mainContent__H0hQb","summarySidebar":"RequestFormLayout-module_summarySidebar__cA6UQ","summaryContent":"RequestFormLayout-module_summaryContent__kUsbQ","footer":"RequestFormLayout-module_footer__-tAMs","footerContent":"RequestFormLayout-module_footerContent__i8-QZ","button":"RequestFormLayout-module_button__Ql3Z-","primary":"RequestFormLayout-module_primary__U3rme","secondary":"RequestFormLayout-module_secondary__CZtSr"};
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* RequestFormHeader component for the fixed header in travel request forms.
|
|
1647
|
+
*/
|
|
1648
|
+
const RequestFormHeader = ({ title, currentPage, totalPages, eventName, rightContent, className, }) => {
|
|
1649
|
+
const showPagination = currentPage !== undefined && totalPages !== undefined && totalPages > 1;
|
|
1650
|
+
return (jsx("header", { className: `${styles$c.header} ${className || ''}`, children: jsxs("div", { className: styles$c.headerContent, children: [jsxs("h1", { className: styles$c.headerTitle, children: [title, showPagination && (jsxs("span", { className: styles$c.pagination, children: ["(", currentPage, "/", totalPages, ")"] })), eventName && (jsxs(Fragment, { children: [jsx("span", { className: styles$c.separator, children: "\u2013" }), jsx("span", { className: styles$c.eventName, children: eventName })] }))] }), rightContent && jsx("div", { className: styles$c.headerRight, children: rightContent })] }) }));
|
|
1651
|
+
};
|
|
1652
|
+
/**
|
|
1653
|
+
* RequestFormFooter component for the fixed footer with navigation buttons.
|
|
1654
|
+
*/
|
|
1655
|
+
const RequestFormFooter = ({ onPrevious, onNext, isFirstPage = false, isLastPage = false, isSubmitting = false, previousText, nextText, className, }) => {
|
|
1656
|
+
const prevLabel = previousText || (isFirstPage ? 'Cancel' : 'Previous');
|
|
1657
|
+
const nextLabel = nextText || (isLastPage ? 'Submit' : 'Next');
|
|
1658
|
+
return (jsx("footer", { className: `${styles$c.footer} ${className || ''}`, children: jsxs("div", { className: styles$c.footerContent, children: [jsx("button", { type: "button", className: `${styles$c.button} ${styles$c.secondary}`, onClick: onPrevious, disabled: isSubmitting, children: prevLabel }), jsx("button", { type: "button", className: `${styles$c.button} ${styles$c.primary}`, onClick: onNext, disabled: isSubmitting, children: isSubmitting ? 'Submitting...' : nextLabel })] }) }));
|
|
1659
|
+
};
|
|
1660
|
+
/**
|
|
1661
|
+
* RequestFormLayout template for travel request forms.
|
|
1662
|
+
* Provides a three-column layout with fixed header and footer.
|
|
1663
|
+
*/
|
|
1664
|
+
const RequestFormLayout = ({ header, sidebar, children, summary, footer, className, showSidebarOnMobile = false, }) => {
|
|
1665
|
+
return (jsxs("div", { className: `${styles$c.layout} ${className || ''}`, children: [header, jsxs("div", { className: styles$c.body, children: [sidebar && (jsx("aside", { className: `${styles$c.sidebar} ${showSidebarOnMobile ? styles$c.showOnMobile : ''}`, children: jsx("div", { className: styles$c.sidebarContent, children: sidebar }) })), jsx("main", { className: styles$c.main, children: jsx("div", { className: styles$c.mainContent, children: children }) }), summary && (jsx("aside", { className: styles$c.summarySidebar, children: jsx("div", { className: styles$c.summaryContent, children: summary }) }))] }), footer] }));
|
|
1666
|
+
};
|
|
1667
|
+
RequestFormLayout.displayName = 'RequestFormLayout';
|
|
1668
|
+
RequestFormHeader.displayName = 'RequestFormHeader';
|
|
1669
|
+
RequestFormFooter.displayName = 'RequestFormFooter';
|
|
1670
|
+
|
|
1671
|
+
var styles$b = {"page":"AdministrationPage-module_page__48Run","header":"AdministrationPage-module_header__HNQnE","tabs":"AdministrationPage-module_tabs__QPvcD","tab":"AdministrationPage-module_tab__bNaU8","activeTab":"AdministrationPage-module_activeTab__B-e3a","cards":"AdministrationPage-module_cards__nISnI","card":"AdministrationPage-module_card__6r45y","cardIcon":"AdministrationPage-module_cardIcon__GTb3t","cardCopy":"AdministrationPage-module_cardCopy__o9pWk","cardTitle":"AdministrationPage-module_cardTitle__56qEV","cardDescription":"AdministrationPage-module_cardDescription__66e9F","comingSoon":"AdministrationPage-module_comingSoon__LSm-x","chevron":"AdministrationPage-module_chevron__d9RPb"};
|
|
1672
|
+
|
|
1673
|
+
const DEFAULT_CARDS = [
|
|
1674
|
+
{
|
|
1675
|
+
key: 'announcements',
|
|
1676
|
+
title: 'Announcements',
|
|
1677
|
+
description: 'Manage system-wide announcements and notifications',
|
|
1678
|
+
icon: jsx(DocumentIcon, { size: 16 }),
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
key: 'suppliers',
|
|
1682
|
+
title: 'Suppliers',
|
|
1683
|
+
description: 'Manage air, car, and hotel suppliers',
|
|
1684
|
+
icon: jsx(PlaneIcon$4, { size: 16 }),
|
|
1685
|
+
},
|
|
1686
|
+
];
|
|
1687
|
+
/** Hub administration shell and system-card index. */
|
|
1688
|
+
const AdministrationPage = ({ activeTab = 'system', onTabChange, cards = DEFAULT_CARDS, onCardClick, children, className = '', }) => (jsxs("div", { className: [styles$b.page, className].filter(Boolean).join(' '), children: [jsx("header", { className: styles$b.header, children: jsx("h1", { children: "Administration\u00A0" }) }), jsx("div", { className: styles$b.tabs, role: "tablist", "aria-label": "Administration sections", children: ['system', 'client'].map((tab) => (jsx("button", { type: "button", role: "tab", "aria-selected": activeTab === tab, className: [styles$b.tab, activeTab === tab ? styles$b.activeTab : ''].filter(Boolean).join(' '), onClick: () => onTabChange?.(tab), children: tab === 'system' ? 'System' : 'Client' }, tab))) }), children ?? (activeTab === 'system' ? (jsx("div", { className: styles$b.cards, children: cards.map((card) => (jsxs("button", { type: "button", className: styles$b.card, onClick: () => onCardClick?.(card), children: [jsx("span", { className: styles$b.cardIcon, children: card.icon }), jsxs("span", { className: styles$b.cardCopy, children: [jsx("span", { className: styles$b.cardTitle, children: card.title }), jsx("span", { className: styles$b.cardDescription, children: card.description })] }), jsx(ChevronRightIcon$1, { className: styles$b.chevron, size: 14 })] }, card.key))) })) : (jsx("p", { className: styles$b.comingSoon, children: "Client administration settings coming soon." })))] }));
|
|
1689
|
+
|
|
1690
|
+
var styles$a = {"page":"CharterManifestPage-module_page__4UnP4","header":"CharterManifestPage-module_header__7t4UK","headerRow":"CharterManifestPage-module_headerRow__am-n5","back":"CharterManifestPage-module_back__mkIGo","headerActions":"CharterManifestPage-module_headerActions__mRD0H","status":"CharterManifestPage-module_status__cH7xC","statusLocked":"CharterManifestPage-module_statusLocked__HYrMe","dateRow":"CharterManifestPage-module_dateRow__vK3mC","metaRow":"CharterManifestPage-module_metaRow__At8EU","dateLine":"CharterManifestPage-module_dateLine__03Ffw","layout":"CharterManifestPage-module_layout__No8EZ","rail":"CharterManifestPage-module_rail__-vvQH","eyebrow":"CharterManifestPage-module_eyebrow__7xT-c","scopeList":"CharterManifestPage-module_scopeList__dFBWN","scope":"CharterManifestPage-module_scope__gLjhn","activeScope":"CharterManifestPage-module_activeScope__3-l04","carrierCard":"CharterManifestPage-module_carrierCard__CG8-U","capacityCard":"CharterManifestPage-module_capacityCard__LkwXi","finalize":"CharterManifestPage-module_finalize__zmVtB","main":"CharterManifestPage-module_main__RtVqB","viewRow":"CharterManifestPage-module_viewRow__5MIfn","lockedMessage":"CharterManifestPage-module_lockedMessage__dtFNK","tableActions":"CharterManifestPage-module_tableActions__yq0AD","sortToggle":"CharterManifestPage-module_sortToggle__QQbqt","activeSort":"CharterManifestPage-module_activeSort__IpZJr","tableWrap":"CharterManifestPage-module_tableWrap__WbU-G","empty":"CharterManifestPage-module_empty__MH8nG","typeTag":"CharterManifestPage-module_typeTag__WqQDj","typePlayer":"CharterManifestPage-module_typePlayer__B6VjC","typeCoach":"CharterManifestPage-module_typeCoach__X4kV4","typeMedical":"CharterManifestPage-module_typeMedical__N7k22","remove":"CharterManifestPage-module_remove__8R1PT","finalizeActions":"CharterManifestPage-module_finalizeActions__3Gabv"};
|
|
1691
|
+
|
|
1692
|
+
const TYPE_ORDER = ['Player', 'Coach', 'Staff', 'Medical', 'Support', 'Admin'];
|
|
1693
|
+
const formatDate = (value) => {
|
|
1694
|
+
if (!value)
|
|
1695
|
+
return '';
|
|
1696
|
+
const date = new Date(value);
|
|
1697
|
+
if (Number.isNaN(date.getTime()))
|
|
1698
|
+
return value;
|
|
1699
|
+
return date.toLocaleDateString(undefined, { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric' });
|
|
1700
|
+
};
|
|
1701
|
+
const TypeTag = ({ type }) => (jsx("span", { className: [styles$a.typeTag, styles$a[`type${type}`] ?? ''].filter(Boolean).join(' '), children: type }));
|
|
1702
|
+
const StatusPill = ({ sendState, locked }) => {
|
|
1703
|
+
const label = locked ? 'Final sent · Locked' : sendState === 'initial-sent' ? 'Initial sent' : sendState === 'final-sent' ? 'Final sent' : 'Not sent';
|
|
1704
|
+
return jsx("span", { className: [styles$a.status, locked ? styles$a.statusLocked : ''].filter(Boolean).join(' '), children: label });
|
|
1705
|
+
};
|
|
1706
|
+
/** Stateless, service-free rendering of Hub's charter manifest page. */
|
|
1707
|
+
const CharterManifestPage = ({ tripName, travelStartDate, travelEndDate, seats, payloadLimit, passengerWeight, cargoWeight, carrierName = 'No carrier selected', carrierNote = 'Select a carrier to configure manifest fields.', passengers = [], equipment = [], segments = [], locked = false, sendState = 'none', onBack, onGenerateFile, onChangeCarrier, onSplitSegments, onAddPassengers, onAddEquipment, onRemovePassenger, onRemoveEquipment, onSendInitial, onSendFinal, onUndoInitial, className = '', }) => {
|
|
1708
|
+
const [view, setView] = useState('passengers');
|
|
1709
|
+
const [sort, setSort] = useState('name');
|
|
1710
|
+
const [scope, setScope] = useState('all');
|
|
1711
|
+
const sortedPassengers = useMemo(() => [...passengers].sort((a, b) => {
|
|
1712
|
+
if (sort === 'type') {
|
|
1713
|
+
const aRank = TYPE_ORDER.indexOf(a.travelerType);
|
|
1714
|
+
const bRank = TYPE_ORDER.indexOf(b.travelerType);
|
|
1715
|
+
const normalizedA = aRank < 0 ? TYPE_ORDER.length : aRank;
|
|
1716
|
+
const normalizedB = bRank < 0 ? TYPE_ORDER.length : bRank;
|
|
1717
|
+
return normalizedA - normalizedB || a.lastName.localeCompare(b.lastName);
|
|
1718
|
+
}
|
|
1719
|
+
return a.lastName.localeCompare(b.lastName);
|
|
1720
|
+
}), [passengers, sort]);
|
|
1721
|
+
return (jsxs("div", { className: [styles$a.page, className].filter(Boolean).join(' '), "data-screen-label": "Charter Trip Manifest", children: [jsxs("header", { className: styles$a.header, children: [jsxs("div", { className: styles$a.headerRow, children: [jsx("button", { type: "button", "aria-label": "Back", className: styles$a.back, onClick: onBack, children: jsx(ChevronLeftIcon, { size: 28 }) }), jsxs("h1", { children: [jsx("strong", { children: "Manifest" }), jsx(ChevronRightIcon$1, { size: 24 }), jsx("span", { children: tripName })] }), jsxs("div", { className: styles$a.headerActions, children: [jsx(StatusPill, { sendState: sendState, locked: locked }), jsx(Button, { variant: "outline", leftIcon: jsx(DocumentIcon, { size: 16 }), disabled: carrierName === 'No carrier selected', onClick: onGenerateFile, children: "Generate File" })] })] }), (travelStartDate || travelEndDate) && (jsxs("div", { className: styles$a.dateRow, children: [jsx("span", { children: formatDate(travelStartDate) }), jsx("span", { className: styles$a.dateLine, children: "\u25B6" }), jsx("span", { children: formatDate(travelEndDate) })] })), jsxs("div", { className: styles$a.metaRow, children: [jsxs("span", { children: [jsx(PlaneIcon$4, { size: 16 }), seats, " seats"] }), jsxs("span", { children: [jsx(CubeIcon, { size: 16 }), "Payload limit ", payloadLimit.toLocaleString(), " lb"] })] })] }), jsxs("div", { className: styles$a.layout, children: [jsxs("aside", { className: styles$a.rail, children: [jsxs("div", { children: [jsx("div", { className: styles$a.eyebrow, children: "Flight Manifest" }), jsx("div", { className: styles$a.scopeList, children: [{ id: 'all', label: 'Full Trip', detail: 'All flight segments' }, ...segments].map((item) => (jsxs("button", { type: "button", className: [styles$a.scope, scope === item.id ? styles$a.activeScope : ''].filter(Boolean).join(' '), onClick: () => setScope(item.id), children: [jsx("strong", { children: item.label }), jsx("span", { children: item.detail })] }, item.id))) })] }), segments.length > 0 && (jsx(Button, { variant: "outline", size: "sm", disabled: locked, onClick: onSplitSegments, children: "Split by Segment" })), jsxs("div", { className: styles$a.carrierCard, children: [jsx("div", { className: styles$a.eyebrow, children: "Carrier" }), jsx("strong", { children: carrierName }), jsx("p", { children: carrierNote }), jsx(Button, { variant: "outline", size: "sm", fullWidth: true, disabled: locked, leftIcon: jsx(SettingsIcon, { size: 15 }), onClick: onChangeCarrier, children: "Change Carrier" })] })] }), jsxs("main", { className: styles$a.main, children: [jsx("section", { className: styles$a.capacityCard, children: jsx(ManifestCapacityStats, { paxCount: passengers.length, seats: seats, paxWeight: passengerWeight, cargoWeight: cargoWeight, payloadLimit: payloadLimit }) }), jsxs("div", { className: styles$a.viewRow, children: [jsx(ManifestViewToggle, { view: view, onView: setView, paxCount: passengers.length, eqCount: equipment.length, locked: locked }), locked && jsx("span", { className: styles$a.lockedMessage, children: "Locked \u2014 coordinate any changes directly with the carrier." })] }), view === 'passengers' ? (jsxs("section", { children: [!locked && (jsxs("div", { className: styles$a.tableActions, children: [jsxs("strong", { children: [passengers.length, " Passengers"] }), jsxs("div", { children: [jsx("span", { children: "Order by" }), jsx("span", { className: styles$a.sortToggle, children: ['name', 'type'].map((option) => (jsx("button", { type: "button", className: sort === option ? styles$a.activeSort : '', onClick: () => setSort(option), children: option }, option))) }), jsx(Button, { size: "sm", leftIcon: jsx(PlusIcon$2, { size: 15 }), onClick: onAddPassengers, children: "Add Passengers" })] })] })), jsx("div", { className: styles$a.tableWrap, children: jsxs("table", { children: [jsx("thead", { children: jsxs("tr", { children: [jsx("th", { children: "#" }), jsx("th", { children: "Passenger" }), jsx("th", { children: "Type" }), jsx("th", { children: "TSA Screening" }), jsx("th", { children: "Personal" }), jsx("th", { children: "Carry-On" }), jsx("th", { children: "Checked" }), jsx("th", { children: "Seat" }), jsx("th", {})] }) }), jsxs("tbody", { children: [!sortedPassengers.length && jsx("tr", { children: jsx("td", { colSpan: 9, className: styles$a.empty, children: "No passengers on this manifest yet. Add passengers from the master list." }) }), sortedPassengers.map((passenger, index) => (jsxs("tr", { children: [jsx("td", { children: index + 1 }), jsxs("td", { children: [jsx("strong", { children: passenger.lastName }), jsxs("span", { children: [", ", passenger.firstName] })] }), jsx("td", { children: jsx(TypeTag, { type: passenger.travelerType }) }), jsx("td", { children: passenger.screeningType || '—' }), jsxs("td", { children: [passenger.personalWeight ?? 0, " lb"] }), jsxs("td", { children: [passenger.carryOnWeight ?? 0, " lb"] }), jsxs("td", { children: [passenger.checkedWeight ?? 0, " lb"] }), jsx("td", { children: passenger.seatAssignment || '—' }), jsx("td", { children: !locked && jsx("button", { type: "button", "aria-label": `Remove ${passenger.firstName} ${passenger.lastName}`, className: styles$a.remove, onClick: () => onRemovePassenger?.(passenger), children: jsx(TrashIcon$2, { size: 16 }) }) })] }, passenger.id)))] })] }) })] })) : (jsxs("section", { children: [!locked && jsxs("div", { className: styles$a.tableActions, children: [jsxs("strong", { children: [equipment.length, " Equipment Items"] }), jsx(Button, { size: "sm", leftIcon: jsx(PlusIcon$2, { size: 15 }), onClick: onAddEquipment, children: "Add Equipment" })] }), jsx("div", { className: styles$a.tableWrap, children: jsxs("table", { children: [jsx("thead", { children: jsxs("tr", { children: [jsx("th", { children: "Equipment" }), jsx("th", { children: "Quantity" }), jsx("th", { children: "Weight" }), jsx("th", { children: "Total" }), jsx("th", {})] }) }), jsx("tbody", { children: equipment.map((item) => jsxs("tr", { children: [jsx("td", { children: jsx("strong", { children: item.name }) }), jsx("td", { children: item.quantity }), jsxs("td", { children: [item.weight.toLocaleString(), " lb"] }), jsxs("td", { children: [(item.quantity * item.weight).toLocaleString(), " lb"] }), jsx("td", { children: !locked && jsx("button", { type: "button", "aria-label": `Remove ${item.name}`, className: styles$a.remove, onClick: () => onRemoveEquipment?.(item), children: jsx(TrashIcon$2, { size: 16 }) }) })] }, item.id)) })] }) })] })), !locked && (jsxs("section", { className: styles$a.finalize, children: [jsx(StatusPill, { sendState: sendState, locked: false }), jsx("p", { children: sendState === 'initial-sent' ? 'Initial manifest sent. The final manifest may be sent within 3 days of departure.' : 'No manifest has been transmitted to the carrier yet.' }), jsxs("div", { className: styles$a.finalizeActions, children: [sendState === 'none' && jsx(Button, { onClick: onSendInitial, children: "Send Initial Manifest" }), sendState === 'initial-sent' && jsxs(Fragment, { children: [jsx(Button, { onClick: onSendFinal, children: "Send Final Manifest" }), jsx(Button, { variant: "ghost", size: "sm", onClick: onUndoInitial, children: "Undo initial" })] })] })] }))] })] })] }));
|
|
1722
|
+
};
|
|
1723
|
+
|
|
1724
|
+
var styles$9 = {"page":"ContactUsPage-module_page__j9LWO","title":"ContactUsPage-module_title__0m1Pk","alert":"ContactUsPage-module_alert__3cwsB","grid":"ContactUsPage-module_grid__-OzjC","card":"ContactUsPage-module_card__WPn4v","cardTitle":"ContactUsPage-module_cardTitle__vcMbd","contacts":"ContactUsPage-module_contacts__oBDr8","contact":"ContactUsPage-module_contact__wX00R","field":"ContactUsPage-module_field__yiMo-","label":"ContactUsPage-module_label__C2fa2","value":"ContactUsPage-module_value__7qJ-W","link":"ContactUsPage-module_link__Pyps-","badge247":"ContactUsPage-module_badge247__720LI"};
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* ContactUsPage - Contact information page layout
|
|
1728
|
+
*
|
|
1729
|
+
* Shows a page with:
|
|
1730
|
+
* - Title
|
|
1731
|
+
* - Optional alert banner
|
|
1732
|
+
* - Contact cards grid
|
|
1733
|
+
*/
|
|
1734
|
+
const ContactUsPage = ({ title = 'Contact Us', alert, cards = [], children, className = '', }) => {
|
|
1735
|
+
const pageClasses = [
|
|
1736
|
+
styles$9.page,
|
|
1737
|
+
className,
|
|
1738
|
+
].filter(Boolean).join(' ');
|
|
1739
|
+
return (jsxs("div", { className: pageClasses, children: [jsx("h1", { className: styles$9.title, children: title }), alert && (jsx("div", { className: styles$9.alert, children: alert })), children ? (children) : (jsx("div", { className: styles$9.grid, children: cards.map((card, i) => (jsxs("div", { className: styles$9.card, children: [jsx("h2", { className: styles$9.cardTitle, children: card.title }), jsx("div", { className: styles$9.contacts, children: card.contacts.map((contact, j) => (jsxs("div", { className: styles$9.contact, children: [contact.name && (jsxs("div", { className: styles$9.field, children: [jsx("span", { className: styles$9.label, children: "Name:" }), jsx("span", { className: styles$9.value, children: contact.name })] })), contact.email && (jsxs("div", { className: styles$9.field, children: [jsx("span", { className: styles$9.label, children: "Email:" }), jsx("a", { href: `mailto:${contact.email}`, className: styles$9.link, children: contact.email })] })), contact.phone && (jsxs("div", { className: styles$9.field, children: [jsx("span", { className: styles$9.label, children: "Phone:" }), jsxs("span", { className: styles$9.value, children: [contact.phone, contact.show247 && jsx("span", { className: styles$9.badge247, children: " (24/7)" })] })] }))] }, j))) })] }, i))) }))] }));
|
|
1740
|
+
};
|
|
1741
|
+
ContactUsPage.displayName = 'ContactUsPage';
|
|
1742
|
+
|
|
1743
|
+
var styles$8 = {"page":"DashboardPage-module_page__PPkbS","pageHeader":"DashboardPage-module_pageHeader__gb8MO","pageActions":"DashboardPage-module_pageActions__1Zgv1","outlineButton":"DashboardPage-module_outlineButton__iLuAv","textButton":"DashboardPage-module_textButton__rEtbe","primaryButton":"DashboardPage-module_primaryButton__uaCW9","customizeButton":"DashboardPage-module_customizeButton__D6kV3","editBanner":"DashboardPage-module_editBanner__7IN5D","syncStatus":"DashboardPage-module_syncStatus__BxFQW","syncError":"DashboardPage-module_syncError__U-uis","grid":"DashboardPage-module_grid__OVgfA","sizeS":"DashboardPage-module_sizeS__leLYa","sizeM":"DashboardPage-module_sizeM__TkfbJ","sizeL":"DashboardPage-module_sizeL__Gbs5b","widget":"DashboardPage-module_widget__p6N-1","widgetHeader":"DashboardPage-module_widgetHeader__m7YWn","widgetIcon":"DashboardPage-module_widgetIcon__1npXI","dragHandle":"DashboardPage-module_dragHandle__rWGWh","widgetActions":"DashboardPage-module_widgetActions__E2pfv","iconButton":"DashboardPage-module_iconButton__v7jtL","sizeToggle":"DashboardPage-module_sizeToggle__wmv6Y","activeSize":"DashboardPage-module_activeSize__vFi0w","widgetBody":"DashboardPage-module_widgetBody__8IPCC","rows":"DashboardPage-module_rows__rPy8n","row":"DashboardPage-module_row__uIAgO","state":"DashboardPage-module_state__h3q31","skeleton":"DashboardPage-module_skeleton__V--PR","pulse":"DashboardPage-module_pulse__VLsO0","widgetFooter":"DashboardPage-module_widgetFooter__OWOyX","editFooter":"DashboardPage-module_editFooter__OHwct","emptyPage":"DashboardPage-module_emptyPage__2QBJk","scrim":"DashboardPage-module_scrim__9ftDX","catalog":"DashboardPage-module_catalog__PoSpA","catalogBody":"DashboardPage-module_catalogBody__AmzLB","catalogItem":"DashboardPage-module_catalogItem__tgxzn","catalogIcon":"DashboardPage-module_catalogIcon__rXPbn","added":"DashboardPage-module_added__c9XNj"};
|
|
1744
|
+
|
|
1745
|
+
const CATALOG = [
|
|
1746
|
+
{ type: 'travelers', title: "Today's Travelers", description: 'Current travelers with dates and travel types.' },
|
|
1747
|
+
{ type: 'unused', title: 'Unused Tickets', description: 'Unused, unexpired airline tickets and available credit.' },
|
|
1748
|
+
{ type: 'info', title: 'Info Center', description: 'Informational links, newsletters, and training resources.' },
|
|
1749
|
+
];
|
|
1750
|
+
const WidgetIcon = ({ type }) => type === 'travelers' ? jsx(UsersIcon$1, { size: 20 }) : jsx(InfoIcon$1, { size: 20 });
|
|
1751
|
+
const WidgetCard = ({ widget, editMode, onRefresh, onRemove, onResize }) => (jsxs("article", { className: styles$8.widget, children: [jsxs("header", { className: styles$8.widgetHeader, children: [editMode && jsx("span", { className: styles$8.dragHandle, "aria-hidden": "true", children: "\u22EE\u22EE" }), jsx("span", { className: styles$8.widgetIcon, children: jsx(WidgetIcon, { type: widget.type }) }), jsx("h3", { children: widget.title }), jsx("div", { className: styles$8.widgetActions, children: editMode ? (jsxs(Fragment, { children: [jsx("span", { className: styles$8.sizeToggle, role: "group", "aria-label": `${widget.title} size`, children: ['S', 'M', 'L'].map((size) => jsx("button", { type: "button", "aria-label": { S: 'Small', M: 'Medium', L: 'Large' }[size], "aria-pressed": widget.size === size, className: widget.size === size ? styles$8.activeSize : '', onClick: () => onResize?.(widget, size), children: size }, size)) }), !widget.pinned && jsx("button", { type: "button", className: styles$8.iconButton, "aria-label": `Remove ${widget.title} card`, onClick: () => onRemove?.(widget), children: jsx(CloseIcon, { size: 16 }) })] })) : (jsx("button", { type: "button", className: styles$8.iconButton, "aria-label": `Refresh ${widget.title}`, onClick: () => onRefresh?.(widget), disabled: widget.state === 'loading', children: jsx(RefreshIcon, { size: 20 }) })) })] }), jsx("div", { className: styles$8.widgetBody, children: widget.state === 'loading' ? jsxs("div", { className: styles$8.skeleton, children: [jsx("i", {}), jsx("i", {}), jsx("i", {}), jsx("span", { children: "Refreshing\u2026" })] })
|
|
1752
|
+
: widget.state === 'error' ? jsx("div", { className: styles$8.state, children: "Couldn't load this card." })
|
|
1753
|
+
: widget.state === 'empty' || !widget.rows?.length ? jsx("div", { className: styles$8.state, children: widget.emptyMessage ?? 'No records available.' })
|
|
1754
|
+
: jsx("div", { className: styles$8.rows, children: widget.rows.map((row, index) => jsxs("div", { className: styles$8.row, children: [jsxs("div", { children: [jsx("strong", { children: row.primary }), row.secondary && jsx("span", { children: row.secondary })] }), row.badge && jsx("small", { children: row.badge }), row.value && jsx("b", { children: row.value })] }, `${row.primary}-${index}`)) }) }), !editMode && widget.footerLabel && jsx("footer", { className: styles$8.widgetFooter, children: jsxs("a", { href: `#${widget.type}`, children: [widget.footerLabel, jsx("span", { children: "\u2192" })] }) }), editMode && jsxs("footer", { className: styles$8.editFooter, children: [jsx("span", { children: "Reorder" }), jsx("button", { type: "button", "aria-label": `Move ${widget.title} earlier`, children: "\u2190" }), jsx("button", { type: "button", "aria-label": `Move ${widget.title} later`, children: "\u2192" })] })] }));
|
|
1755
|
+
/** Hub's personalized post-login landing page. */
|
|
1756
|
+
const DashboardPage = ({ greeting = 'Good morning', firstName, accountName, widgets = [], systemBanners = [], alertBanners = [], syncStatus = 'idle', onRefresh, onRemove, onResize, onReset, onAddWidget, className = '', }) => {
|
|
1757
|
+
const [editMode, setEditMode] = useState(false);
|
|
1758
|
+
const [catalogOpen, setCatalogOpen] = useState(false);
|
|
1759
|
+
const presentTypes = new Set(widgets.map((widget) => widget.type));
|
|
1760
|
+
return (jsxs("div", { className: [styles$8.page, className].filter(Boolean).join(' '), children: [jsx(PageBanners, { systemBanners: systemBanners, alertBanners: alertBanners }), jsxs("header", { className: styles$8.pageHeader, children: [jsxs("div", { children: [jsxs("h1", { children: [greeting, firstName ? `, ${firstName}` : ''] }), accountName && jsxs("p", { children: ["Here's your personalized travel overview for ", accountName, "."] })] }), jsx("div", { className: styles$8.pageActions, children: editMode ? jsxs(Fragment, { children: [jsxs("button", { type: "button", className: styles$8.outlineButton, onClick: () => setCatalogOpen(true), children: [jsx(PlusIcon$2, { size: 20 }), "Add card"] }), jsx("button", { type: "button", className: styles$8.textButton, onClick: onReset, children: "Reset to default" }), jsxs("button", { type: "button", className: styles$8.primaryButton, onClick: () => { setEditMode(false); setCatalogOpen(false); }, children: [jsx(CheckIcon$2, { size: 20 }), "Done"] })] }) : jsxs("button", { type: "button", className: styles$8.customizeButton, onClick: () => setEditMode(true), children: [jsx(SettingsIcon, { size: 20 }), "Customize Your Home Page"] }) })] }), editMode && jsxs("div", { className: styles$8.editBanner, children: [jsx(EditIcon$2, { size: 20 }), jsxs("span", { children: [jsx("strong", { children: "Customizing your home page." }), " Drag cards to reorder, resize with S / M / L, or remove cards. Your layout saves automatically."] })] }), syncStatus === 'saving' && jsx("p", { className: styles$8.syncStatus, "aria-live": "polite", children: "Saving layout\u2026" }), syncStatus === 'error' && jsx("p", { className: [styles$8.syncStatus, styles$8.syncError].join(' '), role: "alert", children: "Layout couldn't be saved. Changes are preserved locally." }), widgets.length ? jsx("div", { className: styles$8.grid, children: widgets.map((widget) => jsx("div", { className: styles$8[`size${widget.size}`], children: jsx(WidgetCard, { widget: widget, editMode: editMode, onRefresh: onRefresh, onRemove: onRemove, onResize: onResize }) }, widget.id)) })
|
|
1761
|
+
: jsxs("div", { className: styles$8.emptyPage, children: [jsx(PlusIcon$2, { size: 28 }), jsx("strong", { children: "Your home page is empty" }), jsx("span", { children: "Use \"Customize\" to add cards from the catalog." })] }), catalogOpen && jsxs(Fragment, { children: [jsx("button", { type: "button", className: styles$8.scrim, "aria-label": "Close card catalog", onClick: () => setCatalogOpen(false) }), jsxs("aside", { className: styles$8.catalog, "aria-label": "Add cards", children: [jsxs("header", { children: [jsxs("div", { children: [jsx("h2", { children: "Add cards" }), jsx("p", { children: "Choose what appears on your home page." })] }), jsx("button", { type: "button", "aria-label": "Close card catalog", onClick: () => setCatalogOpen(false), children: jsx(CloseIcon, { size: 20 }) })] }), jsx("div", { className: styles$8.catalogBody, children: CATALOG.map((item) => jsxs("div", { className: styles$8.catalogItem, children: [jsx("span", { className: styles$8.catalogIcon, children: jsx(WidgetIcon, { type: item.type }) }), jsxs("div", { children: [jsx("strong", { children: item.title }), jsx("p", { children: item.description })] }), presentTypes.has(item.type) ? jsxs("span", { className: styles$8.added, children: [jsx(CheckIcon$2, { size: 16 }), "Added"] }) : jsxs("button", { type: "button", onClick: () => onAddWidget?.(item.type), children: [jsx(PlusIcon$2, { size: 16 }), "Add"] })] }, item.type)) }), jsx("footer", { children: "Each card can appear once on your home page." })] })] })] }));
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
var styles$7 = {"sidebarSection":"GroupTravelRequestPage-module_sidebarSection__reGmm","sidebarTitle":"GroupTravelRequestPage-module_sidebarTitle__G-Oc7","formContent":"GroupTravelRequestPage-module_formContent__1nzfw","field":"GroupTravelRequestPage-module_field__-HfoK","label":"GroupTravelRequestPage-module_label__sEOeK","input":"GroupTravelRequestPage-module_input__lXQDl","select":"GroupTravelRequestPage-module_select__D7ICw","textarea":"GroupTravelRequestPage-module_textarea__AYtX1","radioGroup":"GroupTravelRequestPage-module_radioGroup__xP97-","radioLabel":"GroupTravelRequestPage-module_radioLabel__9wYXU","segmentHeader":"GroupTravelRequestPage-module_segmentHeader__8a1Re"};
|
|
1765
|
+
|
|
1766
|
+
// Icons
|
|
1767
|
+
const EventsIcon = () => (jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })] }));
|
|
1768
|
+
const PlaneIcon = () => (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("path", { d: "M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5Z" }) }));
|
|
1769
|
+
const HotelIcon = () => (jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M3 21h18" }), jsx("path", { d: "M19 21V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v16" }), jsx("path", { d: "M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4" }), jsx("path", { d: "M10 9h4" }), jsx("path", { d: "M10 5h4" })] }));
|
|
1770
|
+
const CarIcon = () => (jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10H8s-2.7.6-4.5 1.1C2.7 11.3 2 12.1 2 13v3c0 .6.4 1 1 1h2" }), jsx("circle", { cx: "7", cy: "17", r: "2" }), jsx("path", { d: "M9 17h6" }), jsx("circle", { cx: "17", cy: "17", r: "2" })] }));
|
|
1771
|
+
const BusIcon = () => (jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M8 6v6" }), jsx("path", { d: "M16 6v6" }), jsx("path", { d: "M2 12h20" }), jsx("path", { d: "M4 18v2" }), jsx("path", { d: "M20 18v2" }), jsx("rect", { x: "4", y: "4", width: "16", height: "14", rx: "2" }), jsx("circle", { cx: "8", cy: "16", r: "1" }), jsx("circle", { cx: "16", cy: "16", r: "1" })] }));
|
|
1772
|
+
// Service configuration
|
|
1773
|
+
const TRAVEL_SERVICES = [
|
|
1774
|
+
{ key: 'general', label: 'General Details', icon: jsx(EventsIcon, {}), hasToggle: false },
|
|
1775
|
+
{ key: 'air', label: 'Commercial Air', icon: jsx(PlaneIcon, {}), hasToggle: true },
|
|
1776
|
+
{ key: 'charter', label: 'Charter Air', icon: jsx(PlaneIcon, {}), hasToggle: true },
|
|
1777
|
+
{ key: 'hotel', label: 'Hotel', icon: jsx(HotelIcon, {}), hasToggle: true },
|
|
1778
|
+
{ key: 'ground', label: 'Ground Transportation', icon: jsx(CarIcon, {}), hasToggle: true },
|
|
1779
|
+
{ key: 'bus', label: 'Bus Needed', icon: jsx(BusIcon, {}), hasToggle: true },
|
|
1780
|
+
];
|
|
1781
|
+
// Summary configuration
|
|
1782
|
+
const SUMMARY_SECTIONS = [
|
|
1783
|
+
{
|
|
1784
|
+
key: 'general',
|
|
1785
|
+
title: 'General Details',
|
|
1786
|
+
items: [
|
|
1787
|
+
{ label: 'Travel Party Size', value: null },
|
|
1788
|
+
{ label: 'Trip Start', value: null },
|
|
1789
|
+
{ label: 'Trip Return', value: null },
|
|
1790
|
+
{ label: 'Booking Contact', value: null },
|
|
1791
|
+
],
|
|
1792
|
+
},
|
|
1793
|
+
{
|
|
1794
|
+
key: 'air',
|
|
1795
|
+
title: 'Commercial Air Request',
|
|
1796
|
+
items: [
|
|
1797
|
+
{ label: 'Flight Type', value: null },
|
|
1798
|
+
{ label: 'Departure Airport', value: null },
|
|
1799
|
+
{ label: 'Arrival Airport', value: null },
|
|
1800
|
+
],
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
key: 'hotel',
|
|
1804
|
+
title: 'Hotel Request',
|
|
1805
|
+
items: [
|
|
1806
|
+
{ label: 'Check-in Date', value: null },
|
|
1807
|
+
{ label: 'Check-out Date', value: null },
|
|
1808
|
+
{ label: 'Number of Rooms', value: null },
|
|
1809
|
+
],
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
key: 'ground',
|
|
1813
|
+
title: 'Ground Transportation',
|
|
1814
|
+
items: [
|
|
1815
|
+
{ label: 'Vehicle Type', value: null },
|
|
1816
|
+
{ label: 'Pickup Location', value: null },
|
|
1817
|
+
],
|
|
1818
|
+
},
|
|
1819
|
+
];
|
|
1820
|
+
/**
|
|
1821
|
+
* GroupTravelRequestPage component provides a complete travel request form page.
|
|
1822
|
+
* Includes service toggles, form sections, and summary panel.
|
|
1823
|
+
*/
|
|
1824
|
+
const GroupTravelRequestPage = ({ eventName = 'New Trip', totalPages = 1, onSubmit, onCancel, initialValues = {}, services = TRAVEL_SERVICES, summarySections = SUMMARY_SECTIONS, className, }) => {
|
|
1825
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
1826
|
+
const [enabledServices, setEnabledServices] = useState({
|
|
1827
|
+
general: true,
|
|
1828
|
+
air: false,
|
|
1829
|
+
charter: false,
|
|
1830
|
+
hotel: false,
|
|
1831
|
+
ground: false,
|
|
1832
|
+
bus: false,
|
|
1833
|
+
...Object.fromEntries(Object.entries(initialValues)
|
|
1834
|
+
.filter(([key]) => services.some(s => s.key === key))
|
|
1835
|
+
.map(([key, value]) => [key, Boolean(value)])),
|
|
1836
|
+
});
|
|
1837
|
+
const [formValues, setFormValues] = useState(initialValues);
|
|
1838
|
+
const handleToggle = (key, enabled) => {
|
|
1839
|
+
setEnabledServices(prev => ({ ...prev, [key]: enabled }));
|
|
1840
|
+
};
|
|
1841
|
+
const handleServiceClick = (key) => {
|
|
1842
|
+
const element = document.getElementById(key);
|
|
1843
|
+
if (element) {
|
|
1844
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
1845
|
+
}
|
|
1846
|
+
};
|
|
1847
|
+
const handlePrevious = () => {
|
|
1848
|
+
if (currentPage > 1) {
|
|
1849
|
+
setCurrentPage(currentPage - 1);
|
|
1850
|
+
}
|
|
1851
|
+
else {
|
|
1852
|
+
onCancel?.();
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
const handleNext = () => {
|
|
1856
|
+
if (currentPage < totalPages) {
|
|
1857
|
+
setCurrentPage(currentPage + 1);
|
|
1858
|
+
}
|
|
1859
|
+
else {
|
|
1860
|
+
onSubmit?.(formValues);
|
|
1861
|
+
}
|
|
1862
|
+
};
|
|
1863
|
+
const updateFormValue = (key, value) => {
|
|
1864
|
+
setFormValues(prev => ({ ...prev, [key]: value }));
|
|
1865
|
+
};
|
|
1866
|
+
return (jsx(RequestFormLayout, { className: className, header: jsx(RequestFormHeader, { title: "Group Travel Request", currentPage: totalPages > 1 ? currentPage : undefined, totalPages: totalPages > 1 ? totalPages : undefined, eventName: eventName }), sidebar: jsxs("div", { className: styles$7.sidebarSection, children: [jsx("h3", { className: styles$7.sidebarTitle, children: "Services" }), jsx(ServiceToggleList, { services: services, enabledServices: enabledServices, onToggle: handleToggle, onClick: handleServiceClick })] }), summary: jsx(RequestSummary, { sections: summarySections, values: formValues, enabledSections: enabledServices }), footer: jsx(RequestFormFooter, { onPrevious: handlePrevious, onNext: handleNext, isFirstPage: currentPage === 1, isLastPage: currentPage === totalPages }), children: jsxs("div", { className: styles$7.formContent, children: [jsxs(FormSection, { id: "general", title: "General Details", icon: jsx(EventsIcon, {}), children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Travel Party Size *" }), jsx("input", { type: "number", className: styles$7.input, style: { width: '200px' }, min: 1, max: 999, value: formValues['Travel Party Size'] || '', onChange: (e) => updateFormValue('Travel Party Size', e.target.value) })] }), jsxs(FormRow, { columns: 2, children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Trip Start *" }), jsx("input", { type: "date", className: styles$7.input, value: formValues['Trip Start'] || '', onChange: (e) => updateFormValue('Trip Start', e.target.value) })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Trip Return *" }), jsx("input", { type: "date", className: styles$7.input, value: formValues['Trip Return'] || '', onChange: (e) => updateFormValue('Trip Return', e.target.value) })] })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Booking Contact *" }), jsx("input", { type: "text", className: styles$7.input, placeholder: "Full Name", value: formValues['Booking Contact'] || '', onChange: (e) => updateFormValue('Booking Contact', e.target.value) })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "General Notes" }), jsx("textarea", { className: styles$7.textarea, rows: 4, placeholder: "Any notes regarding this trip...", value: formValues['General Notes'] || '', onChange: (e) => updateFormValue('General Notes', e.target.value) })] })] }), enabledServices.air && (jsxs(FormSection, { id: "air", title: "Commercial Air Request", icon: jsx(PlaneIcon, {}), children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Flight Type *" }), jsx("div", { className: styles$7.radioGroup, children: ['One Way', 'Round Trip', 'Multiple Destinations'].map(option => (jsxs("label", { className: styles$7.radioLabel, children: [jsx("input", { type: "radio", name: "flightType", value: option, checked: formValues['Flight Type'] === option, onChange: (e) => updateFormValue('Flight Type', e.target.value) }), jsx("span", { children: option })] }, option))) })] }), jsxs(Accordion, { header: jsx("span", { className: styles$7.segmentHeader, children: "Flight 1" }), showTimeline: true, children: [jsxs(FormRow, { columns: 2, children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Departure Airport *" }), jsx("input", { type: "text", className: styles$7.input, placeholder: "e.g., JFK", value: formValues['Departure Airport'] || '', onChange: (e) => updateFormValue('Departure Airport', e.target.value) })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Arrival Airport *" }), jsx("input", { type: "text", className: styles$7.input, placeholder: "e.g., LAX", value: formValues['Arrival Airport'] || '', onChange: (e) => updateFormValue('Arrival Airport', e.target.value) })] })] }), jsxs(FormRow, { columns: 2, children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Departure Date *" }), jsx("input", { type: "date", className: styles$7.input, value: formValues['Departure Date'] || '', onChange: (e) => updateFormValue('Departure Date', e.target.value) })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Departure Time *" }), jsxs("select", { className: styles$7.select, value: formValues['Departure Time'] || '', onChange: (e) => updateFormValue('Departure Time', e.target.value), children: [jsx("option", { value: "", children: "Select time range" }), jsx("option", { value: "Early Morning (5:00am \u2013 8:00am)", children: "Early Morning (5:00am \u2013 8:00am)" }), jsx("option", { value: "Morning (8:00am \u2013 12:00pm)", children: "Morning (8:00am \u2013 12:00pm)" }), jsx("option", { value: "Afternoon (12:00pm - 3:00pm)", children: "Afternoon (12:00pm - 3:00pm)" }), jsx("option", { value: "Late Afternoon (3:00pm \u2013 6:00pm)", children: "Late Afternoon (3:00pm \u2013 6:00pm)" }), jsx("option", { value: "Evening (6:00pm \u2013 12:00am)", children: "Evening (6:00pm \u2013 12:00am)" })] })] })] })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Air Travel Notes" }), jsx("textarea", { className: styles$7.textarea, rows: 3, placeholder: "Any special requirements for air travel..." })] })] })), enabledServices.hotel && (jsxs(FormSection, { id: "hotel", title: "Hotel Request", icon: jsx(HotelIcon, {}), children: [jsxs(FormRow, { columns: 2, children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Check-in Date *" }), jsx("input", { type: "date", className: styles$7.input, value: formValues['Check-in Date'] || '', onChange: (e) => updateFormValue('Check-in Date', e.target.value) })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Check-out Date *" }), jsx("input", { type: "date", className: styles$7.input, value: formValues['Check-out Date'] || '', onChange: (e) => updateFormValue('Check-out Date', e.target.value) })] })] }), jsxs(FormRow, { columns: 2, children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Number of Rooms *" }), jsx("input", { type: "number", className: styles$7.input, min: 1, value: formValues['Number of Rooms'] || '', onChange: (e) => updateFormValue('Number of Rooms', e.target.value) })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Room Type" }), jsxs("select", { className: styles$7.select, value: formValues['Room Type'] || '', onChange: (e) => updateFormValue('Room Type', e.target.value), children: [jsx("option", { value: "", children: "Select room type" }), jsx("option", { value: "Standard", children: "Standard" }), jsx("option", { value: "Double", children: "Double" }), jsx("option", { value: "Suite", children: "Suite" })] })] })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Hotel Preferences" }), jsx("textarea", { className: styles$7.textarea, rows: 3, placeholder: "Preferred hotel chain, location requirements, amenities...", value: formValues['Hotel Preferences'] || '', onChange: (e) => updateFormValue('Hotel Preferences', e.target.value) })] })] })), enabledServices.ground && (jsxs(FormSection, { id: "ground", title: "Ground Transportation", icon: jsx(CarIcon, {}), children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Vehicle Type *" }), jsxs("select", { className: styles$7.select, value: formValues['Vehicle Type'] || '', onChange: (e) => updateFormValue('Vehicle Type', e.target.value), children: [jsx("option", { value: "", children: "Select vehicle type" }), jsx("option", { value: "Sedan", children: "Sedan" }), jsx("option", { value: "SUV", children: "SUV" }), jsx("option", { value: "Van", children: "Van" }), jsx("option", { value: "Limousine", children: "Limousine" })] })] }), jsxs(FormRow, { columns: 2, children: [jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Pickup Location *" }), jsx("input", { type: "text", className: styles$7.input, placeholder: "Airport, hotel, etc.", value: formValues['Pickup Location'] || '', onChange: (e) => updateFormValue('Pickup Location', e.target.value) })] }), jsxs("div", { className: styles$7.field, children: [jsx("label", { className: styles$7.label, children: "Dropoff Location *" }), jsx("input", { type: "text", className: styles$7.input, placeholder: "Hotel, venue, etc.", value: formValues['Dropoff Location'] || '', onChange: (e) => updateFormValue('Dropoff Location', e.target.value) })] })] })] }))] }) }));
|
|
1867
|
+
};
|
|
1868
|
+
GroupTravelRequestPage.displayName = 'GroupTravelRequestPage';
|
|
1869
|
+
|
|
1870
|
+
var styles$6 = {"page":"IndividualTravelPage-module_page__4nshX","header":"IndividualTravelPage-module_header__2cECC","title":"IndividualTravelPage-module_title__DQ26Y","tabsContainer":"IndividualTravelPage-module_tabsContainer__O0d2o","tabs":"IndividualTravelPage-module_tabs__IY24z","tab":"IndividualTravelPage-module_tab__ZmAOW","active":"IndividualTravelPage-module_active__Pgl5K","tabCount":"IndividualTravelPage-module_tabCount__ZCeht","activeCount":"IndividualTravelPage-module_activeCount__Tqyde","exportWrapper":"IndividualTravelPage-module_exportWrapper__-JTJo","exportButton":"IndividualTravelPage-module_exportButton__A7fl-","exportMenu":"IndividualTravelPage-module_exportMenu__DyL7-","exportInfo":"IndividualTravelPage-module_exportInfo__x2Hoz","filters":"IndividualTravelPage-module_filters__5IzR1","searchWrapper":"IndividualTravelPage-module_searchWrapper__R5hnF","searchIcon":"IndividualTravelPage-module_searchIcon__OqCpr","searchInput":"IndividualTravelPage-module_searchInput__B9n8z","advancedButton":"IndividualTravelPage-module_advancedButton__7s0pt","advancedActive":"IndividualTravelPage-module_advancedActive__QrQ6D","advancedFilters":"IndividualTravelPage-module_advancedFilters__lb-y3","advancedHeader":"IndividualTravelPage-module_advancedHeader__5xUOz","closeButton":"IndividualTravelPage-module_closeButton__tHiLw","advancedGrid":"IndividualTravelPage-module_advancedGrid__LdXg4","filterField":"IndividualTravelPage-module_filterField__TvLHn","filterActions":"IndividualTravelPage-module_filterActions__-1hYi","applyButton":"IndividualTravelPage-module_applyButton__omOOS","resetButton":"IndividualTravelPage-module_resetButton__NPX4N","pagination":"IndividualTravelPage-module_pagination__D-XBU","paginationInfo":"IndividualTravelPage-module_paginationInfo__4s0T-","paginationControls":"IndividualTravelPage-module_paginationControls__Gsrsp","pageButton":"IndividualTravelPage-module_pageButton__FDBIx","pageInfo":"IndividualTravelPage-module_pageInfo__b2cb5"};
|
|
1871
|
+
|
|
1872
|
+
// Default sport options
|
|
1873
|
+
const defaultSportOptions = [
|
|
1874
|
+
{ value: 'all', label: 'All Sports' },
|
|
1875
|
+
{ value: 'MFB', label: 'MFB' },
|
|
1876
|
+
{ value: 'MBB', label: 'MBB' },
|
|
1877
|
+
{ value: 'WBB', label: 'WBB' },
|
|
1878
|
+
{ value: 'MSO', label: 'MSO' },
|
|
1879
|
+
{ value: 'WSO', label: 'WSO' },
|
|
1880
|
+
{ value: 'MIH', label: 'MIH' },
|
|
1881
|
+
{ value: 'WIH', label: 'WIH' },
|
|
1882
|
+
{ value: 'XTO', label: 'XTO' },
|
|
1883
|
+
];
|
|
1884
|
+
// Icons
|
|
1885
|
+
const SearchIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("circle", { cx: "11", cy: "11", r: "8" }), jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })] }));
|
|
1886
|
+
const FilterIcon = () => (jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }) }));
|
|
1887
|
+
const ExportIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M7 17L17 7" }), jsx("path", { d: "M7 7h10v10" })] }));
|
|
1888
|
+
const ChevronLeft = () => (jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "15 18 9 12 15 6" }) }));
|
|
1889
|
+
const ChevronRight = () => (jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "9 18 15 12 9 6" }) }));
|
|
1890
|
+
const IndividualTravelPage = ({ currentTrips, pastTrips, requestedTrips, sportOptions = defaultSportOptions, travelerOptions, initialTab = 'current', density = 'comfortable', vendorMode = 'icon', useServiceColumn = false, onViewTrip, onViewRequest, onExport, showTravelerScopeInfo = false, className, }) => {
|
|
1891
|
+
const [activeTab, setActiveTab] = useState(initialTab);
|
|
1892
|
+
const [sport, setSport] = useState('all');
|
|
1893
|
+
const [traveler, setTraveler] = useState('all');
|
|
1894
|
+
const [search, setSearch] = useState('');
|
|
1895
|
+
const [showAdvancedFilters, setShowAdvancedFilters] = useState(false);
|
|
1896
|
+
const [showExportMenu, setShowExportMenu] = useState(false);
|
|
1897
|
+
// Build traveler options from data if not provided
|
|
1898
|
+
const computedTravelerOptions = useMemo(() => {
|
|
1899
|
+
if (travelerOptions)
|
|
1900
|
+
return travelerOptions;
|
|
1901
|
+
const names = new Set();
|
|
1902
|
+
[...currentTrips, ...pastTrips].forEach(trip => {
|
|
1903
|
+
trip.travelers.forEach(name => names.add(name));
|
|
1904
|
+
});
|
|
1905
|
+
return [
|
|
1906
|
+
{ value: 'all', label: 'All Travelers' },
|
|
1907
|
+
...[...names].sort().map(name => ({ value: name, label: name })),
|
|
1908
|
+
];
|
|
1909
|
+
}, [travelerOptions, currentTrips, pastTrips]);
|
|
1910
|
+
// Get current data based on tab
|
|
1911
|
+
const currentData = useMemo(() => {
|
|
1912
|
+
let data = activeTab === 'requested' ? requestedTrips
|
|
1913
|
+
: activeTab === 'current' ? currentTrips
|
|
1914
|
+
: pastTrips;
|
|
1915
|
+
// Apply filters
|
|
1916
|
+
if (sport !== 'all') {
|
|
1917
|
+
data = data.filter(trip => trip.sport?.toUpperCase() === sport.toUpperCase());
|
|
1918
|
+
}
|
|
1919
|
+
if (traveler !== 'all') {
|
|
1920
|
+
data = data.filter(trip => trip.travelers.includes(traveler));
|
|
1921
|
+
}
|
|
1922
|
+
if (search) {
|
|
1923
|
+
const q = search.toLowerCase();
|
|
1924
|
+
data = data.filter(trip => trip.travelers.join(' ').toLowerCase().includes(q) ||
|
|
1925
|
+
(trip.pnr || '').toLowerCase().includes(q) ||
|
|
1926
|
+
(trip.reqId || '').toLowerCase().includes(q) ||
|
|
1927
|
+
(trip.itinerary || '').toLowerCase().includes(q) ||
|
|
1928
|
+
(trip.vendor || '').toLowerCase().includes(q));
|
|
1929
|
+
}
|
|
1930
|
+
return data;
|
|
1931
|
+
}, [activeTab, requestedTrips, currentTrips, pastTrips, sport, traveler, search]);
|
|
1932
|
+
const hasActiveFilters = sport !== 'all' || traveler !== 'all' || !!search;
|
|
1933
|
+
const tabs = [
|
|
1934
|
+
{ key: 'requested', label: 'Requested Trips', count: requestedTrips.length },
|
|
1935
|
+
{ key: 'current', label: 'Current & Future Trips', count: currentTrips.length },
|
|
1936
|
+
{ key: 'past', label: 'Past Trips', count: pastTrips.length },
|
|
1937
|
+
];
|
|
1938
|
+
const handleViewTrip = (id) => {
|
|
1939
|
+
if (activeTab === 'requested') {
|
|
1940
|
+
onViewRequest?.(id);
|
|
1941
|
+
}
|
|
1942
|
+
else {
|
|
1943
|
+
onViewTrip?.(id);
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
return (jsxs("div", { className: `${styles$6.page} ${className || ''}`, children: [jsx("div", { className: styles$6.header, children: jsx("h1", { className: styles$6.title, children: "Individual & Small Group Travel" }) }), jsxs("div", { className: styles$6.tabsContainer, children: [jsx("div", { className: styles$6.tabs, children: tabs.map(tab => (jsxs("button", { className: `${styles$6.tab} ${activeTab === tab.key ? styles$6.active : ''}`, onClick: () => setActiveTab(tab.key), children: [tab.label, jsx("span", { className: `${styles$6.tabCount} ${activeTab === tab.key ? styles$6.activeCount : ''}`, children: tab.count })] }, tab.key))) }), jsxs("div", { className: styles$6.exportWrapper, children: [jsxs("button", { className: styles$6.exportButton, onClick: () => setShowExportMenu(!showExportMenu), children: [jsx("span", { children: "Export" }), jsx(ExportIcon, {})] }), showExportMenu && (jsxs("div", { className: styles$6.exportMenu, children: [hasActiveFilters && (jsxs("div", { className: styles$6.exportInfo, children: [jsx(FilterIcon, {}), jsx("span", { children: "Active filters will be applied to the export." })] })), jsx("button", { onClick: () => { onExport?.('all'); setShowExportMenu(false); }, children: "Export All Trips" }), jsx("button", { onClick: () => { onExport?.('current'); setShowExportMenu(false); }, children: "Export Current & Future" }), jsx("button", { onClick: () => { onExport?.('past'); setShowExportMenu(false); }, children: "Export Past Trips" })] }))] })] }), jsxs("div", { className: styles$6.filters, children: [jsxs("div", { className: styles$6.searchWrapper, children: [jsx("span", { className: styles$6.searchIcon, children: jsx(SearchIcon, {}) }), jsx("input", { type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search traveler, PNR, route\u2026", className: styles$6.searchInput })] }), jsx(FilterChip, { label: "Sport", value: sport, options: sportOptions, onChange: setSport }), jsx(FilterChip, { label: "Traveler", value: traveler, options: computedTravelerOptions, onChange: setTraveler, searchable: true, searchPlaceholder: "Search travelers\u2026", infoMessage: showTravelerScopeInfo ? "Scoped to travelers in your assigned sports." : undefined }), activeTab === 'past' && (jsxs("button", { className: `${styles$6.advancedButton} ${showAdvancedFilters ? styles$6.advancedActive : ''}`, onClick: () => setShowAdvancedFilters(!showAdvancedFilters), children: [jsx(FilterIcon, {}), "Advanced filters"] }))] }), activeTab === 'past' && showAdvancedFilters && (jsxs("div", { className: styles$6.advancedFilters, children: [jsxs("div", { className: styles$6.advancedHeader, children: [jsx("h3", { children: "Advanced filters" }), jsx("button", { className: styles$6.closeButton, onClick: () => setShowAdvancedFilters(false), children: "\u00D7" })] }), jsxs("div", { className: styles$6.advancedGrid, children: [jsxs("div", { className: styles$6.filterField, children: [jsx("label", { children: "Travel Dates" }), jsx("input", { type: "text", placeholder: "Pick a date range" })] }), jsxs("div", { className: styles$6.filterField, children: [jsx("label", { children: "Destination / Routing" }), jsx("input", { type: "text", placeholder: "e.g. LAS, DFW" })] }), jsxs("div", { className: styles$6.filterField, children: [jsx("label", { children: "Vendor" }), jsx("input", { type: "text", placeholder: "e.g. DL, UA" })] }), jsxs("div", { className: styles$6.filterField, children: [jsx("label", { children: "Confirmation / PNR" }), jsx("input", { type: "text", placeholder: "e.g. GA12X7" })] }), jsxs("div", { className: styles$6.filterField, children: [jsx("label", { children: "Ticket Number" }), jsx("input", { type: "text", placeholder: "e.g. 0067123456789" })] }), jsxs("div", { className: styles$6.filterField, children: [jsx("label", { children: "Total / Billed Amount" }), jsx("input", { type: "text", placeholder: "$0.00 \u2013 $0.00" })] }), jsxs("div", { className: styles$6.filterActions, children: [jsx("button", { className: styles$6.applyButton, children: "Apply" }), jsx("button", { className: styles$6.resetButton, children: "Reset" })] })] })] })), jsx(TripTable, { trips: currentData, variant: activeTab, density: density, vendorMode: vendorMode, useServiceColumn: useServiceColumn, onViewTrip: handleViewTrip }), currentData.length > 0 && (jsxs("div", { className: styles$6.pagination, children: [jsxs("div", { className: styles$6.paginationInfo, children: ["Showing 1\u2013", currentData.length, " of ", currentData.length] }), jsxs("div", { className: styles$6.paginationControls, children: [jsx("button", { className: styles$6.pageButton, disabled: true, children: jsx(ChevronLeft, {}) }), jsx("span", { className: styles$6.pageInfo, children: "Page 1 of 1" }), jsx("button", { className: styles$6.pageButton, disabled: true, children: jsx(ChevronRight, {}) })] })] }))] }));
|
|
1947
|
+
};
|
|
1948
|
+
|
|
1949
|
+
var styles$5 = {"page":"InfoCenterPage-module_page__HHBce","breadcrumb":"InfoCenterPage-module_breadcrumb__zv3nA","header":"InfoCenterPage-module_header__qE3KR","headerText":"InfoCenterPage-module_headerText__c8aGS","title":"InfoCenterPage-module_title__apmMY","subtitle":"InfoCenterPage-module_subtitle__ezXCh","stateBlock":"InfoCenterPage-module_stateBlock__qMt4V","stateError":"InfoCenterPage-module_stateError__baFlU","stateText":"InfoCenterPage-module_stateText__N4Uh8","tabs":"InfoCenterPage-module_tabs__HpsCQ","tab":"InfoCenterPage-module_tab__3gKz5","tabActive":"InfoCenterPage-module_tabActive__GJSm9","tabAlert":"InfoCenterPage-module_tabAlert__y642s","grid":"InfoCenterPage-module_grid__-9ra8","card":"InfoCenterPage-module_card__B-coQ","cardAlert":"InfoCenterPage-module_cardAlert__Vwbal","categoryBadge":"InfoCenterPage-module_categoryBadge__wBXtL","categoryAlert":"InfoCenterPage-module_categoryAlert__GhwXY","cardTitle":"InfoCenterPage-module_cardTitle__h8Wb6","cardBody":"InfoCenterPage-module_cardBody__aH8dq","readMore":"InfoCenterPage-module_readMore__oK2fh","editButton":"InfoCenterPage-module_editButton__cpPSU","modalContent":"InfoCenterPage-module_modalContent__BIJPj","articleText":"InfoCenterPage-module_articleText__ch-fl","articleHtml":"InfoCenterPage-module_articleHtml__-DcJ-","externalLink":"InfoCenterPage-module_externalLink__E-upr"};
|
|
1950
|
+
|
|
1951
|
+
const CATEGORY_META = {
|
|
1952
|
+
Alert: { label: 'Alert', icon: WarningIcon$1, alert: true },
|
|
1953
|
+
Air: { label: 'Air', icon: PlaneIcon$4 },
|
|
1954
|
+
Car: { label: 'Car', icon: CarIcon$2 },
|
|
1955
|
+
Hotel: { label: 'Hotel', icon: HotelIcon$4 },
|
|
1956
|
+
Policy: { label: 'Policy', icon: DocumentIcon },
|
|
1957
|
+
General: { label: 'General', icon: DocumentIcon },
|
|
1958
|
+
STM: { label: "Short's Info", icon: InfoIcon$1 },
|
|
1959
|
+
'Client Specific': { label: 'Client Specific', icon: BuildingIcon },
|
|
1960
|
+
};
|
|
1961
|
+
const DEFAULT_META = { label: 'General', icon: DocumentIcon };
|
|
1962
|
+
const metaFor = (cat) => CATEGORY_META[cat] ?? DEFAULT_META;
|
|
1963
|
+
const CATEGORY_ORDER = ['Alert', 'General', 'Air', 'Car', 'Hotel', 'Policy', 'STM', 'Client Specific'];
|
|
1964
|
+
const ArticleCard = ({ article, isAdmin, onOpen, onEdit }) => {
|
|
1965
|
+
const meta = metaFor(article.category);
|
|
1966
|
+
const CategoryIcon = meta.icon;
|
|
1967
|
+
return (jsxs("div", { className: [styles$5.card, meta.alert ? styles$5.cardAlert : ''].filter(Boolean).join(' '), children: [jsxs("span", { className: [styles$5.categoryBadge, meta.alert ? styles$5.categoryAlert : ''].filter(Boolean).join(' '), children: [jsx(CategoryIcon, { size: 13 }), meta.label] }), jsx("h3", { className: styles$5.cardTitle, children: article.title }), article.body && jsx("p", { className: styles$5.cardBody, children: article.body }), jsxs("button", { type: "button", className: styles$5.readMore, onClick: () => onOpen(article), children: ["Read more", jsx(ChevronRightIcon$1, { size: 14 })] }), isAdmin && (jsx("button", { type: "button", className: styles$5.editButton, onClick: () => onEdit?.(article), title: "Edit article", "aria-label": "Edit article", children: jsx(EditIcon$2, { size: 14 }) }))] }));
|
|
1968
|
+
};
|
|
1969
|
+
/**
|
|
1970
|
+
* InfoCenterPage - Info Center article browser
|
|
1971
|
+
*
|
|
1972
|
+
* Shows all published Info Center articles for the active account,
|
|
1973
|
+
* filtered by category tab. "Read more" on an article with an external
|
|
1974
|
+
* href opens it in a new tab; articles without an href open an inline
|
|
1975
|
+
* modal that renders the full article body.
|
|
1976
|
+
*/
|
|
1977
|
+
const InfoCenterPage = ({ title = 'Info Center', accountName, articles = [], state, isAdmin = false, onAddArticle, onEditArticle, onOpenExternal, className = '', showBreadcrumb = true, homeHref = '/home', initialArticleId, onInitialArticleOpen, }) => {
|
|
1978
|
+
const pageState = state ?? (articles.length > 0 ? 'data' : 'empty');
|
|
1979
|
+
const [activeCategory, setActiveCategory] = useState('All');
|
|
1980
|
+
const [modalArticle, setModalArticle] = useState(null);
|
|
1981
|
+
// Ordered, de-duped category list derived from the data
|
|
1982
|
+
const categories = useMemo(() => {
|
|
1983
|
+
const seen = new Set();
|
|
1984
|
+
const found = [];
|
|
1985
|
+
CATEGORY_ORDER.forEach((c) => {
|
|
1986
|
+
if (articles.some((a) => a.category === c)) {
|
|
1987
|
+
seen.add(c);
|
|
1988
|
+
found.push(c);
|
|
1989
|
+
}
|
|
1990
|
+
});
|
|
1991
|
+
articles.forEach((a) => {
|
|
1992
|
+
if (!seen.has(a.category)) {
|
|
1993
|
+
seen.add(a.category);
|
|
1994
|
+
found.push(a.category);
|
|
1995
|
+
}
|
|
1996
|
+
});
|
|
1997
|
+
return found;
|
|
1998
|
+
}, [articles]);
|
|
1999
|
+
const filtered = useMemo(() => (activeCategory === 'All' ? articles : articles.filter((a) => a.category === activeCategory)), [articles, activeCategory]);
|
|
2000
|
+
useEffect(() => {
|
|
2001
|
+
if (!initialArticleId)
|
|
2002
|
+
return;
|
|
2003
|
+
const article = articles.find((item) => item.id === initialArticleId);
|
|
2004
|
+
if (!article)
|
|
2005
|
+
return;
|
|
2006
|
+
setModalArticle(article);
|
|
2007
|
+
onInitialArticleOpen?.();
|
|
2008
|
+
}, [articles, initialArticleId, onInitialArticleOpen]);
|
|
2009
|
+
const handleOpen = (article) => {
|
|
2010
|
+
if (article.href) {
|
|
2011
|
+
onOpenExternal?.(article);
|
|
2012
|
+
window.open(article.href, '_blank', 'noopener,noreferrer');
|
|
2013
|
+
}
|
|
2014
|
+
else {
|
|
2015
|
+
setModalArticle(article);
|
|
2016
|
+
}
|
|
2017
|
+
};
|
|
2018
|
+
const modalMeta = modalArticle ? metaFor(modalArticle.category) : null;
|
|
2019
|
+
const ModalCategoryIcon = modalMeta?.icon;
|
|
2020
|
+
return (jsxs("div", { className: [styles$5.page, className].filter(Boolean).join(' '), children: [showBreadcrumb && (jsxs("nav", { className: styles$5.breadcrumb, "aria-label": "Breadcrumb", children: [jsxs("a", { href: homeHref, children: [jsx(HomeIcon, { size: 14 }), "Home"] }), jsx("span", { children: "/" }), jsx("span", { children: "Info Center" })] })), jsxs("div", { className: styles$5.header, children: [jsxs("div", { className: styles$5.headerText, children: [jsx("h1", { className: styles$5.title, children: title }), accountName && (jsxs("p", { className: styles$5.subtitle, children: ["Travel resources and program information for ", accountName, "."] }))] }), isAdmin && (jsxs(Button, { variant: "primary", size: "sm", onClick: onAddArticle, children: [jsx(PlusIcon$2, { size: 15 }), "Add Article"] }))] }), pageState === 'loading' && (jsxs("div", { className: styles$5.stateBlock, children: [jsx(Spinner, { size: "md" }), jsx("span", { children: "Loading\u2026" })] })), pageState === 'error' && (jsxs("div", { className: [styles$5.stateBlock, styles$5.stateError].join(' '), children: [jsx(WarningIcon$1, { size: 28 }), jsx("p", { className: styles$5.stateText, children: "Unable to load Info Center resources." })] })), pageState === 'empty' && (jsxs("div", { className: styles$5.stateBlock, children: [jsx(InfoIcon$1, { size: 28 }), jsx("p", { className: styles$5.stateText, children: "No resources available." })] })), pageState === 'data' && (jsxs(Fragment, { children: [jsxs("div", { className: styles$5.tabs, role: "tablist", "aria-label": "Article categories", children: [jsxs("button", { type: "button", role: "tab", "aria-selected": activeCategory === 'All', onClick: () => setActiveCategory('All'), className: [styles$5.tab, activeCategory === 'All' ? styles$5.tabActive : ''].filter(Boolean).join(' '), children: [jsx(GridIcon, { size: 15 }), "All"] }), categories.map((cat) => {
|
|
2021
|
+
const m = metaFor(cat);
|
|
2022
|
+
const TabIcon = m.icon;
|
|
2023
|
+
const isActive = activeCategory === cat;
|
|
2024
|
+
return (jsxs("button", { type: "button", role: "tab", "aria-selected": isActive, onClick: () => setActiveCategory(cat), className: [
|
|
2025
|
+
styles$5.tab,
|
|
2026
|
+
isActive ? styles$5.tabActive : '',
|
|
2027
|
+
m.alert ? styles$5.tabAlert : '',
|
|
2028
|
+
]
|
|
2029
|
+
.filter(Boolean)
|
|
2030
|
+
.join(' '), children: [jsx(TabIcon, { size: 15 }), m.label] }, cat));
|
|
2031
|
+
})] }), filtered.length === 0 ? (jsxs("div", { className: styles$5.stateBlock, children: [jsx(InfoIcon$1, { size: 24 }), jsx("p", { className: styles$5.stateText, children: "No resources in this category." })] })) : (jsx("div", { className: styles$5.grid, children: filtered.map((article) => (jsx(ArticleCard, { article: article, isAdmin: isAdmin, onOpen: handleOpen, onEdit: onEditArticle }, article.id))) }))] })), jsx(Modal, { isOpen: modalArticle !== null, onClose: () => setModalArticle(null), title: modalArticle?.title, size: "lg", footer: modalArticle?.href ? (jsxs("a", { href: modalArticle.href, target: "_blank", rel: "noopener noreferrer", className: styles$5.externalLink, children: ["Open external resource", jsx(ArrowUpRightIcon, { size: 14 })] })) : undefined, children: modalArticle && (jsxs("div", { className: styles$5.modalContent, children: [modalMeta && ModalCategoryIcon && (jsxs("span", { className: [styles$5.categoryBadge, modalMeta.alert ? styles$5.categoryAlert : '']
|
|
2032
|
+
.filter(Boolean)
|
|
2033
|
+
.join(' '), children: [jsx(ModalCategoryIcon, { size: 13 }), modalMeta.label] })), modalArticle.fullText ? (jsx("div", { className: styles$5.articleHtml, dangerouslySetInnerHTML: { __html: modalArticle.fullText } })) : (jsx("p", { className: styles$5.articleText, children: modalArticle.body }))] })) })] }));
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
var styles$4 = {"page":"NotFoundPage-module_page__Wg8P8","card":"NotFoundPage-module_card__pgJYC","illustration":"NotFoundPage-module_illustration__uOy-Q","errorCode":"NotFoundPage-module_errorCode__2uerJ","title":"NotFoundPage-module_title__8AOy7","message":"NotFoundPage-module_message__PcyZ-","action":"NotFoundPage-module_action__7rQHt"};
|
|
2037
|
+
|
|
2038
|
+
const DefaultIllustration = () => (jsxs("svg", { width: "120", height: "120", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1", children: [jsx("circle", { cx: "12", cy: "12", r: "10" }), jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })] }));
|
|
2039
|
+
/**
|
|
2040
|
+
* NotFoundPage - 404 error page layout
|
|
2041
|
+
*
|
|
2042
|
+
* Shows a centered error page with:
|
|
2043
|
+
* - Error code (404)
|
|
2044
|
+
* - Title and message
|
|
2045
|
+
* - Optional action button
|
|
2046
|
+
* - Optional illustration
|
|
2047
|
+
*/
|
|
2048
|
+
const NotFoundPage = ({ errorCode = '404', title = 'Page Not Found', message = 'The page you are looking for does not exist or you do not have permission to access it.', action, illustration, className = '', }) => {
|
|
2049
|
+
const pageClasses = [
|
|
2050
|
+
styles$4.page,
|
|
2051
|
+
className,
|
|
2052
|
+
].filter(Boolean).join(' ');
|
|
2053
|
+
return (jsx("div", { className: pageClasses, children: jsxs("div", { className: styles$4.card, children: [jsx("div", { className: styles$4.illustration, children: illustration || jsx(DefaultIllustration, {}) }), jsx("h1", { className: styles$4.errorCode, children: errorCode }), jsx("h2", { className: styles$4.title, children: title }), jsx("p", { className: styles$4.message, children: message }), action && (jsx("div", { className: styles$4.action, children: action }))] }) }));
|
|
2054
|
+
};
|
|
2055
|
+
NotFoundPage.displayName = 'NotFoundPage';
|
|
2056
|
+
|
|
2057
|
+
var styles$3 = {"page":"TeamManagementPage-module_page__iRm2r","header":"TeamManagementPage-module_header__ychcg","tabNav":"TeamManagementPage-module_tabNav__uJdI0","tabButton":"TeamManagementPage-module_tabButton__lvZVy","active":"TeamManagementPage-module_active__weGUn","tabIcon":"TeamManagementPage-module_tabIcon__OuuMJ","tabBadge":"TeamManagementPage-module_tabBadge__dapL0","body":"TeamManagementPage-module_body__10aka","main":"TeamManagementPage-module_main__-lFtT","sidebar":"TeamManagementPage-module_sidebar__u8syG","footer":"TeamManagementPage-module_footer__he9G0"};
|
|
2058
|
+
|
|
2059
|
+
const RosterIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }), jsx("circle", { cx: "9", cy: "7", r: "4" }), jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }), jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })] }));
|
|
2060
|
+
const ContactsIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }), jsx("polyline", { points: "22,6 12,13 2,6" })] }));
|
|
2061
|
+
const PreferencesIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("circle", { cx: "12", cy: "12", r: "3" }), jsx("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })] }));
|
|
2062
|
+
const ProgramsIcon = () => (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsx("rect", { x: "3", y: "4", width: "18", height: "4", rx: "1" }), jsx("rect", { x: "3", y: "10", width: "18", height: "4", rx: "1" }), jsx("rect", { x: "3", y: "16", width: "18", height: "4", rx: "1" })] }));
|
|
2063
|
+
const DEFAULT_TABS = [
|
|
2064
|
+
{ id: 'roster', label: 'Roster', icon: jsx(RosterIcon, {}) },
|
|
2065
|
+
{ id: 'contacts', label: 'Contacts', icon: jsx(ContactsIcon, {}) },
|
|
2066
|
+
{ id: 'preferences', label: 'Preferences', icon: jsx(PreferencesIcon, {}) },
|
|
2067
|
+
{ id: 'programs', label: 'Programs', icon: jsx(ProgramsIcon, {}) },
|
|
2068
|
+
];
|
|
2069
|
+
/**
|
|
2070
|
+
* TeamManagementPage - Layout for team management with tabbed navigation
|
|
2071
|
+
*/
|
|
2072
|
+
const TeamManagementPage = ({ header, tabs = DEFAULT_TABS, activeTab = 'roster', onTabChange, children, sidebar, footer, className = '', }) => {
|
|
2073
|
+
const pageClasses = [styles$3.page, className].filter(Boolean).join(' ');
|
|
2074
|
+
return (jsxs("div", { className: pageClasses, children: [header && jsx("div", { className: styles$3.header, children: header }), jsx("div", { className: styles$3.tabNav, children: tabs.map((tab) => (jsxs("button", { type: "button", className: [
|
|
2075
|
+
styles$3.tabButton,
|
|
2076
|
+
activeTab === tab.id ? styles$3.active : '',
|
|
2077
|
+
].filter(Boolean).join(' '), onClick: () => onTabChange?.(tab.id), "aria-selected": activeTab === tab.id, children: [tab.icon && jsx("span", { className: styles$3.tabIcon, children: tab.icon }), jsx("span", { children: tab.label }), tab.badge !== undefined && tab.badge > 0 && (jsx("span", { className: styles$3.tabBadge, children: tab.badge }))] }, tab.id))) }), jsxs("div", { className: styles$3.body, children: [jsx("main", { className: styles$3.main, children: children }), sidebar && (jsx("aside", { className: styles$3.sidebar, children: sidebar }))] }), footer && jsx("div", { className: styles$3.footer, children: footer })] }));
|
|
2078
|
+
};
|
|
2079
|
+
TeamManagementPage.displayName = 'TeamManagementPage';
|
|
2080
|
+
|
|
2081
|
+
var styles$2 = {"page":"TeamSchedulePage-module_page__ubf0D","header":"TeamSchedulePage-module_header__kS9hw","headerMobile":"TeamSchedulePage-module_headerMobile__3oBL2","titleSection":"TeamSchedulePage-module_titleSection__IAfn0","title":"TeamSchedulePage-module_title__XA2Pn","filters":"TeamSchedulePage-module_filters__yJBro","metrics":"TeamSchedulePage-module_metrics__lzVBG","metric":"TeamSchedulePage-module_metric__xhoOH","metricValue":"TeamSchedulePage-module_metricValue__-pZxP","metricLabel":"TeamSchedulePage-module_metricLabel__am8yI","actions":"TeamSchedulePage-module_actions__XNEbT","content":"TeamSchedulePage-module_content__-5J1x"};
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
* TeamSchedulePage - Team travel schedule page layout
|
|
2085
|
+
*
|
|
2086
|
+
* Shows a page with:
|
|
2087
|
+
* - Title and filter row
|
|
2088
|
+
* - Summary metrics
|
|
2089
|
+
* - Action buttons
|
|
2090
|
+
* - Schedule table (compact or expanded view)
|
|
2091
|
+
*/
|
|
2092
|
+
const TeamSchedulePage = ({ title = 'Team Travel Schedule', mobileTitle = 'Travel Schedule', metrics = [], teamFilter, serviceFilter, actions, compactView, expandedView, viewMode = 'compact', isMobile = false, className = '', }) => {
|
|
2093
|
+
const pageClasses = [
|
|
2094
|
+
styles$2.page,
|
|
2095
|
+
className,
|
|
2096
|
+
].filter(Boolean).join(' ');
|
|
2097
|
+
const headerClasses = [
|
|
2098
|
+
styles$2.header,
|
|
2099
|
+
isMobile ? styles$2.headerMobile : '',
|
|
2100
|
+
].filter(Boolean).join(' ');
|
|
2101
|
+
return (jsxs("div", { className: pageClasses, children: [jsxs("div", { className: headerClasses, children: [jsxs("div", { className: styles$2.titleSection, children: [jsx("h1", { className: styles$2.title, children: isMobile ? mobileTitle : title }), jsxs("div", { className: styles$2.filters, children: [teamFilter, serviceFilter] })] }), metrics.length > 0 && (jsx("div", { className: styles$2.metrics, children: metrics.map((metric, i) => (jsxs("div", { className: styles$2.metric, children: [jsxs("span", { className: styles$2.metricValue, children: [metric.prefix, metric.value, metric.suffix] }), jsx("span", { className: styles$2.metricLabel, children: metric.label })] }, i))) }))] }), actions && (jsx("div", { className: styles$2.actions, children: actions })), jsx("div", { className: styles$2.content, children: viewMode === 'compact' ? compactView : expandedView })] }));
|
|
2102
|
+
};
|
|
2103
|
+
TeamSchedulePage.displayName = 'TeamSchedulePage';
|
|
2104
|
+
|
|
2105
|
+
var styles$1 = {"page":"TeamTravelCalendarPage-module_page__uRR69","header":"TeamTravelCalendarPage-module_header__WWbAV","headerMobile":"TeamTravelCalendarPage-module_headerMobile__qSE3G","titleSection":"TeamTravelCalendarPage-module_titleSection__CjVKu","title":"TeamTravelCalendarPage-module_title__a03rT","filters":"TeamTravelCalendarPage-module_filters__BMjwJ","metrics":"TeamTravelCalendarPage-module_metrics__qy4Vv","metric":"TeamTravelCalendarPage-module_metric__72yC9","metricValue":"TeamTravelCalendarPage-module_metricValue__z83Jz","metricLabel":"TeamTravelCalendarPage-module_metricLabel__jkWNF","contentWrapper":"TeamTravelCalendarPage-module_contentWrapper__9LKRp","content":"TeamTravelCalendarPage-module_content__w4LsI","sidebar":"TeamTravelCalendarPage-module_sidebar__8IV7J"};
|
|
2106
|
+
|
|
2107
|
+
/**
|
|
2108
|
+
* TeamTravelCalendarPage - Team travel calendar page layout
|
|
2109
|
+
*
|
|
2110
|
+
* Shows a page with:
|
|
2111
|
+
* - Title and filter row
|
|
2112
|
+
* - Summary metrics
|
|
2113
|
+
* - View switcher (calendar/card/list)
|
|
2114
|
+
* - Main calendar/card/list view
|
|
2115
|
+
* - Sidebar for due dates
|
|
2116
|
+
*/
|
|
2117
|
+
const TeamTravelCalendarPage = ({ title = 'Team Travel Calendar', mobileTitle = 'Travel Calendar', metrics = [], teamFilter, serviceFilter, viewSelector, typeSelector, calendarView, cardView, listView, sidebar, view = 'calendar', sidebarOpen = false, isMobile = false, className = '', }) => {
|
|
2118
|
+
const pageClasses = [
|
|
2119
|
+
styles$1.page,
|
|
2120
|
+
className,
|
|
2121
|
+
].filter(Boolean).join(' ');
|
|
2122
|
+
const headerClasses = [
|
|
2123
|
+
styles$1.header,
|
|
2124
|
+
isMobile ? styles$1.headerMobile : '',
|
|
2125
|
+
].filter(Boolean).join(' ');
|
|
2126
|
+
const renderView = () => {
|
|
2127
|
+
switch (view) {
|
|
2128
|
+
case 'calendar':
|
|
2129
|
+
return calendarView;
|
|
2130
|
+
case 'card':
|
|
2131
|
+
return cardView;
|
|
2132
|
+
case 'list':
|
|
2133
|
+
return listView;
|
|
2134
|
+
default:
|
|
2135
|
+
return null;
|
|
2136
|
+
}
|
|
2137
|
+
};
|
|
2138
|
+
return (jsxs("div", { className: pageClasses, children: [jsxs("div", { className: headerClasses, children: [jsxs("div", { className: styles$1.titleSection, children: [jsx("h1", { className: styles$1.title, children: isMobile ? mobileTitle : title }), jsxs("div", { className: styles$1.filters, children: [teamFilter, serviceFilter, viewSelector, typeSelector] })] }), metrics.length > 0 && (jsx("div", { className: styles$1.metrics, children: metrics.map((metric, i) => (jsxs("button", { className: styles$1.metric, onClick: metric.onClick, type: "button", disabled: !metric.onClick, children: [jsx("span", { className: styles$1.metricValue, children: metric.value }), jsx("span", { className: styles$1.metricLabel, children: metric.label })] }, i))) }))] }), jsxs("div", { className: styles$1.contentWrapper, children: [jsx("div", { className: styles$1.content, children: renderView() }), sidebar && sidebarOpen && (jsx("div", { className: styles$1.sidebar, children: sidebar }))] })] }));
|
|
2139
|
+
};
|
|
2140
|
+
TeamTravelCalendarPage.displayName = 'TeamTravelCalendarPage';
|
|
2141
|
+
|
|
2142
|
+
var styles = {"page":"TripDetailPage-module_page__gdFhe","header":"TripDetailPage-module_header__mLflo","content":"TripDetailPage-module_content__9xX9O","mainColumn":"TripDetailPage-module_mainColumn__vaTm1","segmentsGrid":"TripDetailPage-module_segmentsGrid__boKee","segmentCard":"TripDetailPage-module_segmentCard__Q3OsL","segmentTitle":"TripDetailPage-module_segmentTitle__0Y9Dh","empty":"TripDetailPage-module_empty__jP84u","section":"TripDetailPage-module_section__Y5hCV","sectionTitle":"TripDetailPage-module_sectionTitle__D9FFD","sidebar":"TripDetailPage-module_sidebar__xWbCK","sidebarSection":"TripDetailPage-module_sidebarSection__ObZf3"};
|
|
2143
|
+
|
|
2144
|
+
/**
|
|
2145
|
+
* TripDetailPage - Trip detail view layout
|
|
2146
|
+
*
|
|
2147
|
+
* Displays a trip with:
|
|
2148
|
+
* - Header with trip info and status
|
|
2149
|
+
* - Main content area:
|
|
2150
|
+
* - Left (7 cols): Segments (Air/Ground/Hotel), Files, Team
|
|
2151
|
+
* - Right (3 cols): Events, Due Dates
|
|
2152
|
+
*/
|
|
2153
|
+
const TripDetailPage = ({ header, airSegment, groundSegment, hotelSegment, filesSection, teamSection, eventsSection, dueDatesSection, className = '', }) => {
|
|
2154
|
+
const pageClasses = [
|
|
2155
|
+
styles.page,
|
|
2156
|
+
className,
|
|
2157
|
+
].filter(Boolean).join(' ');
|
|
2158
|
+
return (jsxs("div", { className: pageClasses, children: [header && (jsx("div", { className: styles.header, children: header })), jsxs("div", { className: styles.content, children: [jsxs("div", { className: styles.mainColumn, children: [jsxs("div", { className: styles.segmentsGrid, children: [jsxs("div", { className: styles.segmentCard, children: [jsx("h3", { className: styles.segmentTitle, children: "Air" }), airSegment || jsx("div", { className: styles.empty, children: "No flights" })] }), jsxs("div", { className: styles.segmentCard, children: [jsx("h3", { className: styles.segmentTitle, children: "Ground" }), groundSegment || jsx("div", { className: styles.empty, children: "No ground transportation" })] }), jsxs("div", { className: styles.segmentCard, children: [jsx("h3", { className: styles.segmentTitle, children: "Hotel" }), hotelSegment || jsx("div", { className: styles.empty, children: "No hotels" })] })] }), filesSection && (jsxs("div", { className: styles.section, children: [jsx("h3", { className: styles.sectionTitle, children: "Files" }), filesSection] })), teamSection && (jsxs("div", { className: styles.section, children: [jsx("h3", { className: styles.sectionTitle, children: "Team Roster" }), teamSection] }))] }), jsxs("div", { className: styles.sidebar, children: [eventsSection && (jsxs("div", { className: styles.sidebarSection, children: [jsx("h3", { className: styles.sectionTitle, children: "Events" }), eventsSection] })), dueDatesSection && (jsxs("div", { className: styles.sidebarSection, children: [jsx("h3", { className: styles.sectionTitle, children: "Due Dates" }), dueDatesSection] }))] })] })] }));
|
|
2159
|
+
};
|
|
2160
|
+
TripDetailPage.displayName = 'TripDetailPage';
|
|
2161
|
+
|
|
2162
|
+
export { Accordion, AdministrationPage, AirSegment, Alert, AppLayout, ArrowUpRightIcon, Avatar, AvatarGroup, Badge, BuildingIcon, BusIcon$3 as BusIcon, Button, CalendarIcon$1 as CalendarIcon, CarIcon$2 as CarIcon, Card, CardBody, CardFooter, CardHeader, CharterManifestPage, CheckIcon$2 as CheckIcon, Checkbox, ChevronDownIcon$1 as ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon$1 as ChevronRightIcon, ChevronUpIcon, CloseIcon, ConfirmModal, ContactList, ContactUsPage, CubeIcon, DashboardIcon, DashboardPage, Datepicker, DocumentIcon, DownloadIcon, Drawer, DrawerBody, DrawerFooter, DrawerHeader, Dropdown, EditIcon$2 as EditIcon, EyeIcon, FilterChip, FilterIcon$1 as FilterIcon, FormField, FormRow, FormSection, GridIcon, GroundSegment, GroupTravelRequestPage, HomeIcon, HotelIcon$4 as HotelIcon, HotelSegment, Icons, IndividualTravelPage, InfoCenterPage, InfoIcon$1 as InfoIcon, Input, LightbulbIcon, LimoIcon, LockIcon$1 as LockIcon, LogoIcon, MailIcon, ManifestCapacityStats, ManifestViewToggle, MegaphoneIcon, MembershipPrograms, MenuIcon, Metric, MinusIcon, Modal, ModalFooter, Module, ModuleDivider, ModuleVerticalDivider, NavItem, NotFoundPage, PageBanners, PhoneIcon, PlaneIcon$4 as PlaneIcon, PlusIcon$2 as PlusIcon, PreferencesPanel, PrinterIcon, Progress, ProgressBar, ProgressCircle, RailIcon, RefreshIcon, ReportIcon, RequestFormFooter, RequestFormHeader, RequestFormLayout, RequestSummary, RosterToolbar, SearchField, SearchIcon$1 as SearchIcon, Segment, Select, SelectFilter, ServiceToggle, ServiceToggleList, SettingsIcon, Sidenav, Spinner, StatusBadge, SummarySection, Table, Tag, TeamCard, TeamHeader, TeamManagementPage, TeamSchedulePage, TeamTravelCalendarPage, Textarea, Timepicker, Title, Toggle, Tooltip, Topbar, TrashIcon$2 as TrashIcon, TravelServiceIcon, TravelerForm, TrendDownIcon, TrendUpIcon, TripDetailPage, TripSegment, TripTable, TypeIcon, UserIcon, UsersIcon$1 as UsersIcon, WarningIcon$1 as WarningIcon, XIcon };
|
|
2163
|
+
//# sourceMappingURL=index.esm.js.map
|