@asdp/ferryui 0.1.22-dev.8463 → 0.1.22-dev.8491
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/dist/index.d.mts +326 -1
- package/dist/index.d.ts +326 -1
- package/dist/index.js +778 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +775 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -545,6 +545,7 @@ var sharedColors = {
|
|
|
545
545
|
"Shared_Red_Primary": "#d13438",
|
|
546
546
|
"Shared_Green_Primary": "#107c10"};
|
|
547
547
|
var lightModeColors2 = {
|
|
548
|
+
"Neutral_Foreground_Disabled_Rest": "#bdbdbd",
|
|
548
549
|
"Brand_Stroke_1_Rest": "#00B3BD"};
|
|
549
550
|
var tokensV2_default = {
|
|
550
551
|
lightModeColors: lightModeColors2};
|
|
@@ -6429,10 +6430,783 @@ var ModalSearchTicket = ({
|
|
|
6429
6430
|
}
|
|
6430
6431
|
);
|
|
6431
6432
|
};
|
|
6433
|
+
var useStyles18 = reactComponents.makeStyles({
|
|
6434
|
+
stepperWrapper: {
|
|
6435
|
+
position: "relative",
|
|
6436
|
+
width: "100%",
|
|
6437
|
+
maxWidth: "988px",
|
|
6438
|
+
margin: "0 auto",
|
|
6439
|
+
[`@media (max-width: ${extendedTokens.breakpointMd})`]: {
|
|
6440
|
+
maxWidth: "100%"
|
|
6441
|
+
}
|
|
6442
|
+
},
|
|
6443
|
+
stepperContainer: {
|
|
6444
|
+
position: "relative",
|
|
6445
|
+
width: "100%",
|
|
6446
|
+
height: "78px",
|
|
6447
|
+
display: "flex",
|
|
6448
|
+
flexDirection: "column",
|
|
6449
|
+
[`@media (max-width: ${extendedTokens.breakpointMd})`]: {
|
|
6450
|
+
height: "60px"
|
|
6451
|
+
}
|
|
6452
|
+
},
|
|
6453
|
+
stepperBackground: {
|
|
6454
|
+
position: "absolute",
|
|
6455
|
+
top: 0,
|
|
6456
|
+
left: 0,
|
|
6457
|
+
width: "100%",
|
|
6458
|
+
height: "100%",
|
|
6459
|
+
objectFit: "cover",
|
|
6460
|
+
zIndex: 0,
|
|
6461
|
+
pointerEvents: "none"
|
|
6462
|
+
},
|
|
6463
|
+
stepsRow: {
|
|
6464
|
+
position: "relative",
|
|
6465
|
+
display: "flex",
|
|
6466
|
+
alignItems: "center",
|
|
6467
|
+
justifyContent: "space-around",
|
|
6468
|
+
padding: "0 60px",
|
|
6469
|
+
height: "50%",
|
|
6470
|
+
zIndex: 2,
|
|
6471
|
+
[`@media (max-width: ${extendedTokens.breakpointMd})`]: {
|
|
6472
|
+
padding: "0 30px"
|
|
6473
|
+
}
|
|
6474
|
+
},
|
|
6475
|
+
stepCircleWrapper: {
|
|
6476
|
+
display: "flex",
|
|
6477
|
+
flexDirection: "column",
|
|
6478
|
+
alignItems: "center",
|
|
6479
|
+
position: "relative",
|
|
6480
|
+
zIndex: 3
|
|
6481
|
+
},
|
|
6482
|
+
stepCircle: {
|
|
6483
|
+
width: "24px",
|
|
6484
|
+
height: "24px",
|
|
6485
|
+
borderRadius: "25%",
|
|
6486
|
+
display: "flex",
|
|
6487
|
+
alignItems: "center",
|
|
6488
|
+
justifyContent: "center",
|
|
6489
|
+
fontSize: "16px",
|
|
6490
|
+
fontWeight: "bold",
|
|
6491
|
+
transition: "all 0.3s ease",
|
|
6492
|
+
[`@media (max-width: ${extendedTokens.breakpointMd})`]: {
|
|
6493
|
+
width: "16px",
|
|
6494
|
+
height: "16px",
|
|
6495
|
+
fontSize: "14px"
|
|
6496
|
+
}
|
|
6497
|
+
},
|
|
6498
|
+
stepCircleActive: {
|
|
6499
|
+
backgroundColor: "#FFFFFF",
|
|
6500
|
+
color: "#00AEEF",
|
|
6501
|
+
boxShadow: "0 2px 8px rgba(0, 174, 239, 0.3)"
|
|
6502
|
+
},
|
|
6503
|
+
stepCircleCompleted: {
|
|
6504
|
+
backgroundColor: "#8DC63F",
|
|
6505
|
+
color: "#FFFFFF",
|
|
6506
|
+
border: "none"
|
|
6507
|
+
},
|
|
6508
|
+
stepCircleInactive: {
|
|
6509
|
+
backgroundColor: "#FFFFFF",
|
|
6510
|
+
color: "#999999"
|
|
6511
|
+
},
|
|
6512
|
+
stepLabel: {
|
|
6513
|
+
position: "absolute",
|
|
6514
|
+
top: "50%",
|
|
6515
|
+
marginTop: "28px",
|
|
6516
|
+
left: "50%",
|
|
6517
|
+
transform: "translateX(-50%)",
|
|
6518
|
+
fontSize: "12px",
|
|
6519
|
+
fontWeight: "600",
|
|
6520
|
+
textAlign: "center",
|
|
6521
|
+
whiteSpace: "nowrap",
|
|
6522
|
+
color: "#FFFFFF",
|
|
6523
|
+
[`@media (max-width: ${extendedTokens.breakpointMd})`]: {
|
|
6524
|
+
marginTop: "20px",
|
|
6525
|
+
fontSize: "9px"
|
|
6526
|
+
}
|
|
6527
|
+
},
|
|
6528
|
+
ferryIcon: {
|
|
6529
|
+
width: "40px",
|
|
6530
|
+
height: "40px",
|
|
6531
|
+
[`@media (max-width: ${extendedTokens.breakpointMd})`]: {
|
|
6532
|
+
width: "30px",
|
|
6533
|
+
height: "30px"
|
|
6534
|
+
}
|
|
6535
|
+
},
|
|
6536
|
+
stepConnector: {
|
|
6537
|
+
flex: 1,
|
|
6538
|
+
height: "4px",
|
|
6539
|
+
backgroundColor: "#CCCCCC",
|
|
6540
|
+
margin: "0 8px",
|
|
6541
|
+
alignSelf: "center",
|
|
6542
|
+
[`@media (max-width: ${extendedTokens.breakpointMd})`]: {
|
|
6543
|
+
height: "3px",
|
|
6544
|
+
margin: "0 4px"
|
|
6545
|
+
}
|
|
6546
|
+
},
|
|
6547
|
+
stepConnectorCompleted: {
|
|
6548
|
+
backgroundColor: "#8DC63F"
|
|
6549
|
+
}
|
|
6550
|
+
});
|
|
6551
|
+
var Stepper = ({
|
|
6552
|
+
steps,
|
|
6553
|
+
currentStep,
|
|
6554
|
+
className
|
|
6555
|
+
}) => {
|
|
6556
|
+
const styles = useStyles18();
|
|
6557
|
+
const currentStepIndex = React5.useMemo(() => {
|
|
6558
|
+
if (typeof currentStep === "number") {
|
|
6559
|
+
return steps.findIndex((step) => step.number === currentStep);
|
|
6560
|
+
}
|
|
6561
|
+
return steps.findIndex((step) => step.id === currentStep);
|
|
6562
|
+
}, [steps, currentStep]);
|
|
6563
|
+
const activeStepNumber = React5.useMemo(() => {
|
|
6564
|
+
return currentStepIndex >= 0 ? steps[currentStepIndex].number : 1;
|
|
6565
|
+
}, [currentStepIndex, steps]);
|
|
6566
|
+
const getStepStatus = (stepNumber) => {
|
|
6567
|
+
if (stepNumber < activeStepNumber) return "completed";
|
|
6568
|
+
if (stepNumber === activeStepNumber) return "active";
|
|
6569
|
+
return "inactive";
|
|
6570
|
+
};
|
|
6571
|
+
const getCircleClass = (stepNumber) => {
|
|
6572
|
+
const status = getStepStatus(stepNumber);
|
|
6573
|
+
const baseClass = styles.stepCircle;
|
|
6574
|
+
if (status === "active") return `${baseClass} ${styles.stepCircleActive}`;
|
|
6575
|
+
if (status === "completed") return `${baseClass} ${styles.stepCircleCompleted}`;
|
|
6576
|
+
return `${baseClass} ${styles.stepCircleInactive}`;
|
|
6577
|
+
};
|
|
6578
|
+
const getConnectorClass = (currentStepNumber) => {
|
|
6579
|
+
if (currentStepNumber < activeStepNumber) {
|
|
6580
|
+
return `${styles.stepConnector} ${styles.stepConnectorCompleted}`;
|
|
6581
|
+
}
|
|
6582
|
+
return styles.stepConnector;
|
|
6583
|
+
};
|
|
6584
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: reactComponents.mergeClasses(styles.stepperWrapper, className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.stepperContainer, children: [
|
|
6585
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6586
|
+
"img",
|
|
6587
|
+
{
|
|
6588
|
+
src: "/assets/images/reservation/stepper_bg.svg",
|
|
6589
|
+
alt: "Stepper Background",
|
|
6590
|
+
className: styles.stepperBackground
|
|
6591
|
+
}
|
|
6592
|
+
),
|
|
6593
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.stepsRow, children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(React5.Fragment, { children: [
|
|
6594
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.stepCircleWrapper, children: [
|
|
6595
|
+
getStepStatus(step.number) === "active" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6596
|
+
"img",
|
|
6597
|
+
{
|
|
6598
|
+
src: "/assets/images/reservation/ferry_step.svg",
|
|
6599
|
+
alt: "Ferry",
|
|
6600
|
+
className: styles.ferryIcon
|
|
6601
|
+
}
|
|
6602
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: getCircleClass(step.number), children: step.number }),
|
|
6603
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.stepLabel, children: step.label })
|
|
6604
|
+
] }),
|
|
6605
|
+
index < steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: getConnectorClass(step.number) })
|
|
6606
|
+
] }, step.id)) })
|
|
6607
|
+
] }) });
|
|
6608
|
+
};
|
|
6609
|
+
var useStyles19 = reactComponents.makeStyles({
|
|
6610
|
+
card: {
|
|
6611
|
+
padding: "1.5rem",
|
|
6612
|
+
borderRadius: reactComponents.tokens.borderRadiusXLarge,
|
|
6613
|
+
boxShadow: reactComponents.tokens.shadow4,
|
|
6614
|
+
zIndex: 3
|
|
6615
|
+
},
|
|
6616
|
+
container: {
|
|
6617
|
+
display: "flex",
|
|
6618
|
+
justifyContent: "space-between",
|
|
6619
|
+
marginTop: "1rem"
|
|
6620
|
+
},
|
|
6621
|
+
fieldGroup: {
|
|
6622
|
+
display: "flex",
|
|
6623
|
+
flexDirection: "column",
|
|
6624
|
+
gap: "0.25rem"
|
|
6625
|
+
},
|
|
6626
|
+
label: {
|
|
6627
|
+
color: reactComponents.tokens.colorNeutralForeground2
|
|
6628
|
+
},
|
|
6629
|
+
value: {
|
|
6630
|
+
color: tokensV2_default.lightModeColors.Neutral_Foreground_Disabled_Rest
|
|
6631
|
+
}
|
|
6632
|
+
});
|
|
6633
|
+
var CardOrdererInfo = ({
|
|
6634
|
+
orderer,
|
|
6635
|
+
className
|
|
6636
|
+
}) => {
|
|
6637
|
+
const styles = useStyles19();
|
|
6638
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Card, { className: className || styles.card, children: [
|
|
6639
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Title3, { children: "Informasi Pemesan" }),
|
|
6640
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.container, children: [
|
|
6641
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
6642
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle2, { className: styles.label, children: "Nama Pemesan" }),
|
|
6643
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.value, children: orderer?.name || "-" })
|
|
6644
|
+
] }),
|
|
6645
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
6646
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle2, { className: styles.label, children: "Nomor Handphone" }),
|
|
6647
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.value, children: orderer?.phoneNumber || "-" })
|
|
6648
|
+
] }),
|
|
6649
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
6650
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle2, { className: styles.label, children: "Email" }),
|
|
6651
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.value, children: orderer?.email || "-" })
|
|
6652
|
+
] })
|
|
6653
|
+
] })
|
|
6654
|
+
] });
|
|
6655
|
+
};
|
|
6656
|
+
var useStyles20 = reactComponents.makeStyles({
|
|
6657
|
+
dialogSurface: {
|
|
6658
|
+
maxWidth: "600px",
|
|
6659
|
+
width: "100%",
|
|
6660
|
+
borderRadius: reactComponents.tokens.borderRadiusXLarge
|
|
6661
|
+
},
|
|
6662
|
+
content: {
|
|
6663
|
+
display: "flex",
|
|
6664
|
+
flexDirection: "column",
|
|
6665
|
+
gap: "1.5rem",
|
|
6666
|
+
padding: "1.5rem"
|
|
6667
|
+
},
|
|
6668
|
+
searchInput: {
|
|
6669
|
+
width: "100%"
|
|
6670
|
+
},
|
|
6671
|
+
passengerList: {
|
|
6672
|
+
display: "flex",
|
|
6673
|
+
flexDirection: "column",
|
|
6674
|
+
gap: "0.5rem"
|
|
6675
|
+
},
|
|
6676
|
+
passengerItem: {
|
|
6677
|
+
display: "flex",
|
|
6678
|
+
alignItems: "center",
|
|
6679
|
+
justifyContent: "space-between",
|
|
6680
|
+
padding: "1rem",
|
|
6681
|
+
borderRadius: reactComponents.tokens.borderRadiusMedium,
|
|
6682
|
+
border: `1px solid ${reactComponents.tokens.colorNeutralStroke2}`,
|
|
6683
|
+
cursor: "pointer",
|
|
6684
|
+
transition: "all 0.2s ease",
|
|
6685
|
+
":hover": {
|
|
6686
|
+
backgroundColor: reactComponents.tokens.colorNeutralBackground1Hover
|
|
6687
|
+
}
|
|
6688
|
+
},
|
|
6689
|
+
actions: {
|
|
6690
|
+
display: "flex",
|
|
6691
|
+
gap: "1rem",
|
|
6692
|
+
justifyContent: "flex-end",
|
|
6693
|
+
marginTop: "1rem"
|
|
6694
|
+
}
|
|
6695
|
+
});
|
|
6696
|
+
var ModalListPassenger = ({
|
|
6697
|
+
open,
|
|
6698
|
+
onClose,
|
|
6699
|
+
title = "Detail Penumpang",
|
|
6700
|
+
passengers,
|
|
6701
|
+
searchQuery,
|
|
6702
|
+
onSearchChange,
|
|
6703
|
+
onSelectPassenger,
|
|
6704
|
+
onEditPassenger,
|
|
6705
|
+
onAddPassenger,
|
|
6706
|
+
sameAsOrderer,
|
|
6707
|
+
onSameAsOrdererChange
|
|
6708
|
+
}) => {
|
|
6709
|
+
const styles = useStyles20();
|
|
6710
|
+
const handleClose = () => {
|
|
6711
|
+
onClose();
|
|
6712
|
+
onSearchChange("");
|
|
6713
|
+
};
|
|
6714
|
+
const handleSelectPassenger = (passenger) => {
|
|
6715
|
+
onSelectPassenger(passenger);
|
|
6716
|
+
handleClose();
|
|
6717
|
+
};
|
|
6718
|
+
const filteredPassengers = passengers.filter((passenger) => {
|
|
6719
|
+
if (!searchQuery) return true;
|
|
6720
|
+
const query = searchQuery.toLowerCase();
|
|
6721
|
+
return passenger.name?.toLowerCase().includes(query) || passenger.category?.toLowerCase().includes(query);
|
|
6722
|
+
});
|
|
6723
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6724
|
+
reactComponents.Dialog,
|
|
6725
|
+
{
|
|
6726
|
+
open,
|
|
6727
|
+
onOpenChange: (_, data) => {
|
|
6728
|
+
if (!data.open) {
|
|
6729
|
+
handleClose();
|
|
6730
|
+
}
|
|
6731
|
+
},
|
|
6732
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.DialogSurface, { className: styles.dialogSurface, children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.DialogBody, { children: [
|
|
6733
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6734
|
+
reactComponents.DialogTitle,
|
|
6735
|
+
{
|
|
6736
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6737
|
+
reactComponents.Switch,
|
|
6738
|
+
{
|
|
6739
|
+
label: "Sama Dengan Pemesan",
|
|
6740
|
+
checked: sameAsOrderer,
|
|
6741
|
+
onChange: (_, data) => onSameAsOrdererChange(data.checked)
|
|
6742
|
+
}
|
|
6743
|
+
),
|
|
6744
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle1, { children: title })
|
|
6745
|
+
}
|
|
6746
|
+
),
|
|
6747
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactComponents.DialogContent, { className: styles.content, children: [
|
|
6748
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6749
|
+
reactComponents.Input,
|
|
6750
|
+
{
|
|
6751
|
+
className: styles.searchInput,
|
|
6752
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:search-24-regular" }),
|
|
6753
|
+
placeholder: "Cari Penumpang",
|
|
6754
|
+
value: searchQuery,
|
|
6755
|
+
onChange: (_, data) => onSearchChange(data.value),
|
|
6756
|
+
size: "large"
|
|
6757
|
+
}
|
|
6758
|
+
),
|
|
6759
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.passengerList, children: filteredPassengers.map((passenger, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6760
|
+
"div",
|
|
6761
|
+
{
|
|
6762
|
+
className: styles.passengerItem,
|
|
6763
|
+
onClick: () => handleSelectPassenger(passenger),
|
|
6764
|
+
role: "button",
|
|
6765
|
+
tabIndex: 0,
|
|
6766
|
+
onKeyDown: (e) => {
|
|
6767
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6768
|
+
e.preventDefault();
|
|
6769
|
+
handleSelectPassenger(passenger);
|
|
6770
|
+
}
|
|
6771
|
+
},
|
|
6772
|
+
children: [
|
|
6773
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Subtitle2, { children: [
|
|
6774
|
+
passenger.name,
|
|
6775
|
+
" (",
|
|
6776
|
+
passenger.category,
|
|
6777
|
+
")"
|
|
6778
|
+
] }) }),
|
|
6779
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6780
|
+
react.Icon,
|
|
6781
|
+
{
|
|
6782
|
+
icon: "fluent:chevron-right-24-regular",
|
|
6783
|
+
onClick: (e) => {
|
|
6784
|
+
e.preventDefault();
|
|
6785
|
+
e.stopPropagation();
|
|
6786
|
+
onEditPassenger(passenger);
|
|
6787
|
+
},
|
|
6788
|
+
width: 20,
|
|
6789
|
+
height: 20
|
|
6790
|
+
}
|
|
6791
|
+
)
|
|
6792
|
+
]
|
|
6793
|
+
},
|
|
6794
|
+
passenger.id || `passenger-${index}`
|
|
6795
|
+
)) }),
|
|
6796
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.actions, children: [
|
|
6797
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6798
|
+
reactComponents.Button,
|
|
6799
|
+
{
|
|
6800
|
+
appearance: "primary",
|
|
6801
|
+
size: "large",
|
|
6802
|
+
shape: "circular",
|
|
6803
|
+
onClick: onAddPassenger,
|
|
6804
|
+
children: "Tambah Penumpang"
|
|
6805
|
+
}
|
|
6806
|
+
),
|
|
6807
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6808
|
+
reactComponents.Button,
|
|
6809
|
+
{
|
|
6810
|
+
appearance: "secondary",
|
|
6811
|
+
size: "large",
|
|
6812
|
+
shape: "circular",
|
|
6813
|
+
onClick: handleClose,
|
|
6814
|
+
children: "Batal"
|
|
6815
|
+
}
|
|
6816
|
+
)
|
|
6817
|
+
] })
|
|
6818
|
+
] })
|
|
6819
|
+
] }) })
|
|
6820
|
+
}
|
|
6821
|
+
);
|
|
6822
|
+
};
|
|
6823
|
+
var useStyles21 = reactComponents.makeStyles({
|
|
6824
|
+
dialogSurface: {
|
|
6825
|
+
maxWidth: "600px",
|
|
6826
|
+
width: "100%",
|
|
6827
|
+
borderRadius: reactComponents.tokens.borderRadiusXLarge
|
|
6828
|
+
},
|
|
6829
|
+
content: {
|
|
6830
|
+
display: "flex",
|
|
6831
|
+
flexDirection: "column",
|
|
6832
|
+
gap: "1.5rem"
|
|
6833
|
+
},
|
|
6834
|
+
actions: {
|
|
6835
|
+
display: "flex",
|
|
6836
|
+
gap: "1rem",
|
|
6837
|
+
justifyContent: "flex-end",
|
|
6838
|
+
marginTop: "1rem"
|
|
6839
|
+
}
|
|
6840
|
+
});
|
|
6841
|
+
var ModalPassengerForm = ({
|
|
6842
|
+
open,
|
|
6843
|
+
onClose,
|
|
6844
|
+
title = "Detail Penumpang",
|
|
6845
|
+
onSubmit,
|
|
6846
|
+
defaultValues,
|
|
6847
|
+
isAdultForm = true,
|
|
6848
|
+
titleOptions,
|
|
6849
|
+
idTypeOptions,
|
|
6850
|
+
cityOptions,
|
|
6851
|
+
ticketClassOptions
|
|
6852
|
+
}) => {
|
|
6853
|
+
const styles = useStyles21();
|
|
6854
|
+
const { control, handleSubmit, reset } = reactHookForm.useForm({
|
|
6855
|
+
defaultValues
|
|
6856
|
+
});
|
|
6857
|
+
React5.useEffect(() => {
|
|
6858
|
+
reset(defaultValues);
|
|
6859
|
+
}, [defaultValues, reset]);
|
|
6860
|
+
const handleFormSubmit = (data) => {
|
|
6861
|
+
onSubmit(data);
|
|
6862
|
+
reset();
|
|
6863
|
+
};
|
|
6864
|
+
const handleClose = () => {
|
|
6865
|
+
onClose();
|
|
6866
|
+
reset();
|
|
6867
|
+
};
|
|
6868
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6869
|
+
reactComponents.Dialog,
|
|
6870
|
+
{
|
|
6871
|
+
open,
|
|
6872
|
+
onOpenChange: (_, data) => {
|
|
6873
|
+
if (!data.open) {
|
|
6874
|
+
handleClose();
|
|
6875
|
+
}
|
|
6876
|
+
},
|
|
6877
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.DialogSurface, { className: styles.dialogSurface, children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.DialogBody, { children: [
|
|
6878
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.DialogTitle, { children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle1, { children: title }) }),
|
|
6879
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.DialogContent, { className: styles.content, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit(handleFormSubmit), children: [
|
|
6880
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6881
|
+
InputDynamic_default,
|
|
6882
|
+
{
|
|
6883
|
+
name: "title",
|
|
6884
|
+
control,
|
|
6885
|
+
type: "select",
|
|
6886
|
+
label: "Title",
|
|
6887
|
+
placeholder: "Pilih",
|
|
6888
|
+
options: titleOptions,
|
|
6889
|
+
size: "large",
|
|
6890
|
+
required: true,
|
|
6891
|
+
validationRules: {
|
|
6892
|
+
required: "Title harus dipilih"
|
|
6893
|
+
}
|
|
6894
|
+
}
|
|
6895
|
+
),
|
|
6896
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6897
|
+
InputDynamic_default,
|
|
6898
|
+
{
|
|
6899
|
+
name: "name",
|
|
6900
|
+
control,
|
|
6901
|
+
type: "text",
|
|
6902
|
+
label: "Nama Lengkap",
|
|
6903
|
+
placeholder: "Masukkan Nama",
|
|
6904
|
+
size: "large",
|
|
6905
|
+
required: true,
|
|
6906
|
+
validationRules: {
|
|
6907
|
+
required: "Nama lengkap harus diisi",
|
|
6908
|
+
minLength: {
|
|
6909
|
+
value: 3,
|
|
6910
|
+
message: "Nama minimal 3 karakter"
|
|
6911
|
+
}
|
|
6912
|
+
}
|
|
6913
|
+
}
|
|
6914
|
+
),
|
|
6915
|
+
isAdultForm ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6916
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6917
|
+
InputDynamic_default,
|
|
6918
|
+
{
|
|
6919
|
+
name: "idType",
|
|
6920
|
+
control,
|
|
6921
|
+
type: "select",
|
|
6922
|
+
label: "Jenis ID",
|
|
6923
|
+
placeholder: "Pilih",
|
|
6924
|
+
options: idTypeOptions,
|
|
6925
|
+
size: "large",
|
|
6926
|
+
required: true,
|
|
6927
|
+
validationRules: {
|
|
6928
|
+
required: "Jenis ID harus dipilih"
|
|
6929
|
+
}
|
|
6930
|
+
}
|
|
6931
|
+
),
|
|
6932
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6933
|
+
InputDynamic_default,
|
|
6934
|
+
{
|
|
6935
|
+
name: "idNumber",
|
|
6936
|
+
control,
|
|
6937
|
+
type: "text",
|
|
6938
|
+
label: "Nomor Identitas",
|
|
6939
|
+
placeholder: "Masukkan Nomor Identitas",
|
|
6940
|
+
size: "large",
|
|
6941
|
+
required: true,
|
|
6942
|
+
validationRules: {
|
|
6943
|
+
required: "Nomor identitas harus diisi",
|
|
6944
|
+
minLength: {
|
|
6945
|
+
value: 6,
|
|
6946
|
+
message: "Nomor identitas minimal 6 karakter"
|
|
6947
|
+
}
|
|
6948
|
+
}
|
|
6949
|
+
}
|
|
6950
|
+
),
|
|
6951
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6952
|
+
InputDynamic_default,
|
|
6953
|
+
{
|
|
6954
|
+
name: "age",
|
|
6955
|
+
control,
|
|
6956
|
+
type: "number",
|
|
6957
|
+
label: "Usia",
|
|
6958
|
+
placeholder: "Masukkan Usia",
|
|
6959
|
+
size: "large",
|
|
6960
|
+
required: true,
|
|
6961
|
+
validationRules: {
|
|
6962
|
+
required: "Usia harus diisi",
|
|
6963
|
+
min: {
|
|
6964
|
+
value: 1,
|
|
6965
|
+
message: "Usia minimal 1 tahun"
|
|
6966
|
+
},
|
|
6967
|
+
max: {
|
|
6968
|
+
value: 150,
|
|
6969
|
+
message: "Usia maksimal 150 tahun"
|
|
6970
|
+
}
|
|
6971
|
+
}
|
|
6972
|
+
}
|
|
6973
|
+
)
|
|
6974
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6975
|
+
InputDynamic_default,
|
|
6976
|
+
{
|
|
6977
|
+
name: "date",
|
|
6978
|
+
control,
|
|
6979
|
+
type: "date",
|
|
6980
|
+
label: "Tanggal Lahir",
|
|
6981
|
+
placeholder: "Masukkan Tanggal Lahir",
|
|
6982
|
+
size: "large",
|
|
6983
|
+
required: true,
|
|
6984
|
+
validationRules: {
|
|
6985
|
+
required: "Tanggal lahir harus diisi"
|
|
6986
|
+
}
|
|
6987
|
+
}
|
|
6988
|
+
) }),
|
|
6989
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6990
|
+
InputDynamic_default,
|
|
6991
|
+
{
|
|
6992
|
+
name: "cityId",
|
|
6993
|
+
control,
|
|
6994
|
+
type: "select",
|
|
6995
|
+
label: "Kota Kabupaten",
|
|
6996
|
+
options: cityOptions,
|
|
6997
|
+
placeholder: "Masukkan Nama Kota/Kabupaten",
|
|
6998
|
+
size: "large",
|
|
6999
|
+
required: true,
|
|
7000
|
+
validationRules: {
|
|
7001
|
+
required: "Kota/Kabupaten harus diisi"
|
|
7002
|
+
}
|
|
7003
|
+
}
|
|
7004
|
+
),
|
|
7005
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
7006
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, {}),
|
|
7007
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
7008
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7009
|
+
InputDynamic_default,
|
|
7010
|
+
{
|
|
7011
|
+
name: "ticketClass",
|
|
7012
|
+
control,
|
|
7013
|
+
type: "radiobutton",
|
|
7014
|
+
label: "Kelas penumpang",
|
|
7015
|
+
options: ticketClassOptions,
|
|
7016
|
+
required: true,
|
|
7017
|
+
disabled: true
|
|
7018
|
+
}
|
|
7019
|
+
),
|
|
7020
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.actions, children: [
|
|
7021
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Button, { appearance: "primary", size: "large", shape: "circular", type: "submit", children: "Simpan" }),
|
|
7022
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7023
|
+
reactComponents.Button,
|
|
7024
|
+
{
|
|
7025
|
+
appearance: "secondary",
|
|
7026
|
+
size: "large",
|
|
7027
|
+
shape: "circular",
|
|
7028
|
+
type: "button",
|
|
7029
|
+
onClick: handleClose,
|
|
7030
|
+
children: "Batal"
|
|
7031
|
+
}
|
|
7032
|
+
)
|
|
7033
|
+
] })
|
|
7034
|
+
] }) })
|
|
7035
|
+
] }) })
|
|
7036
|
+
}
|
|
7037
|
+
);
|
|
7038
|
+
};
|
|
7039
|
+
var getBadgeConfig = (ticketClass) => {
|
|
7040
|
+
const normalizedClass = ticketClass?.toUpperCase();
|
|
7041
|
+
switch (normalizedClass) {
|
|
7042
|
+
case "EKONOMI":
|
|
7043
|
+
case "ECONOMY":
|
|
7044
|
+
return {
|
|
7045
|
+
color: "#A74109",
|
|
7046
|
+
icon: "/assets/images/class/shield_badge_ekonomi.svg"
|
|
7047
|
+
};
|
|
7048
|
+
case "BISNIS":
|
|
7049
|
+
case "BUSINESS":
|
|
7050
|
+
return {
|
|
7051
|
+
color: "#859599",
|
|
7052
|
+
icon: "/assets/images/class/ribbon_badge_bisnis.svg"
|
|
7053
|
+
};
|
|
7054
|
+
case "EKSEKUTIF":
|
|
7055
|
+
case "EXECUTIVE":
|
|
7056
|
+
return {
|
|
7057
|
+
color: "#C19C00",
|
|
7058
|
+
icon: "/assets/images/class/crown_badge_eksekutif.svg"
|
|
7059
|
+
};
|
|
7060
|
+
default:
|
|
7061
|
+
return {
|
|
7062
|
+
color: reactComponents.tokens.colorNeutralBackground3,
|
|
7063
|
+
icon: ""
|
|
7064
|
+
};
|
|
7065
|
+
}
|
|
7066
|
+
};
|
|
7067
|
+
var useStyles22 = reactComponents.makeStyles({
|
|
7068
|
+
card: {
|
|
7069
|
+
padding: "1.5rem",
|
|
7070
|
+
borderRadius: reactComponents.tokens.borderRadiusXLarge,
|
|
7071
|
+
boxShadow: reactComponents.tokens.shadow4,
|
|
7072
|
+
zIndex: 3
|
|
7073
|
+
},
|
|
7074
|
+
headerContainer: {
|
|
7075
|
+
display: "flex",
|
|
7076
|
+
alignItems: "center",
|
|
7077
|
+
marginBottom: "1rem",
|
|
7078
|
+
gap: "1rem"
|
|
7079
|
+
},
|
|
7080
|
+
headerTitle: {
|
|
7081
|
+
whiteSpace: "nowrap"
|
|
7082
|
+
},
|
|
7083
|
+
headerLine: {
|
|
7084
|
+
height: "1px",
|
|
7085
|
+
flexGrow: 1,
|
|
7086
|
+
backgroundColor: reactComponents.tokens.colorNeutralStroke2
|
|
7087
|
+
},
|
|
7088
|
+
passengerList: {
|
|
7089
|
+
display: "flex",
|
|
7090
|
+
flexDirection: "column"
|
|
7091
|
+
},
|
|
7092
|
+
passengerItem: {
|
|
7093
|
+
display: "flex",
|
|
7094
|
+
alignItems: "center",
|
|
7095
|
+
justifyContent: "space-between",
|
|
7096
|
+
padding: "1rem 0",
|
|
7097
|
+
cursor: "pointer",
|
|
7098
|
+
borderBottom: `1px solid ${reactComponents.tokens.colorNeutralStroke2}`,
|
|
7099
|
+
":last-child": {
|
|
7100
|
+
borderBottom: "none"
|
|
7101
|
+
},
|
|
7102
|
+
":hover": {
|
|
7103
|
+
backgroundColor: reactComponents.tokens.colorNeutralBackground1Hover,
|
|
7104
|
+
paddingLeft: "0.5rem",
|
|
7105
|
+
paddingRight: "0.5rem",
|
|
7106
|
+
margin: "0 -0.5rem"
|
|
7107
|
+
},
|
|
7108
|
+
transition: "all 0.2s ease"
|
|
7109
|
+
},
|
|
7110
|
+
passengerInfo: {
|
|
7111
|
+
display: "flex",
|
|
7112
|
+
alignItems: "center",
|
|
7113
|
+
gap: "0.75rem"
|
|
7114
|
+
},
|
|
7115
|
+
passengerText: {
|
|
7116
|
+
color: "#00B8D4"
|
|
7117
|
+
},
|
|
7118
|
+
badgeContainer: {
|
|
7119
|
+
display: "flex",
|
|
7120
|
+
alignItems: "center",
|
|
7121
|
+
position: "relative"
|
|
7122
|
+
},
|
|
7123
|
+
badgeContent: {
|
|
7124
|
+
display: "flex",
|
|
7125
|
+
alignItems: "center",
|
|
7126
|
+
padding: "0.25rem 0.75rem 0.25rem 1.5rem",
|
|
7127
|
+
borderTopRightRadius: "9999px",
|
|
7128
|
+
borderBottomRightRadius: "9999px",
|
|
7129
|
+
color: "white",
|
|
7130
|
+
fontSize: reactComponents.tokens.fontSizeBase200,
|
|
7131
|
+
fontWeight: reactComponents.tokens.fontWeightMedium,
|
|
7132
|
+
marginLeft: "-14px",
|
|
7133
|
+
minHeight: "24px"
|
|
7134
|
+
},
|
|
7135
|
+
badgeIcon: {
|
|
7136
|
+
width: "28px",
|
|
7137
|
+
height: "32px",
|
|
7138
|
+
zIndex: 1,
|
|
7139
|
+
filter: "drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.1))"
|
|
7140
|
+
}
|
|
7141
|
+
});
|
|
7142
|
+
var CardPassengerList = ({
|
|
7143
|
+
title = "Data Penumpang",
|
|
7144
|
+
passengers,
|
|
7145
|
+
onPassengerClick,
|
|
7146
|
+
className
|
|
7147
|
+
}) => {
|
|
7148
|
+
const styles = useStyles22();
|
|
7149
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Card, { className: className || styles.card, children: [
|
|
7150
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.headerContainer, children: [
|
|
7151
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Title3, { className: styles.headerTitle, children: title }),
|
|
7152
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.headerLine })
|
|
7153
|
+
] }),
|
|
7154
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.passengerList, children: passengers.map((passenger, index) => {
|
|
7155
|
+
const badgeConfig = getBadgeConfig(passenger.serviceName);
|
|
7156
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7157
|
+
"div",
|
|
7158
|
+
{
|
|
7159
|
+
className: styles.passengerItem,
|
|
7160
|
+
onClick: () => onPassengerClick(passenger),
|
|
7161
|
+
role: "button",
|
|
7162
|
+
tabIndex: 0,
|
|
7163
|
+
onKeyDown: (e) => {
|
|
7164
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7165
|
+
e.preventDefault();
|
|
7166
|
+
onPassengerClick(passenger);
|
|
7167
|
+
}
|
|
7168
|
+
},
|
|
7169
|
+
children: [
|
|
7170
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.passengerInfo, children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Subtitle2, { className: styles.passengerText, children: [
|
|
7171
|
+
passenger.name || `Penumpang ${index + 1}`,
|
|
7172
|
+
" (",
|
|
7173
|
+
passenger.passengerType,
|
|
7174
|
+
")"
|
|
7175
|
+
] }) }),
|
|
7176
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "1rem" }, children: [
|
|
7177
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.badgeContainer, children: [
|
|
7178
|
+
badgeConfig.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7179
|
+
"img",
|
|
7180
|
+
{
|
|
7181
|
+
src: badgeConfig.icon,
|
|
7182
|
+
alt: passenger.serviceName,
|
|
7183
|
+
className: styles.badgeIcon
|
|
7184
|
+
}
|
|
7185
|
+
),
|
|
7186
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7187
|
+
"div",
|
|
7188
|
+
{
|
|
7189
|
+
className: styles.badgeContent,
|
|
7190
|
+
style: { backgroundColor: badgeConfig.color },
|
|
7191
|
+
children: passenger.serviceName
|
|
7192
|
+
}
|
|
7193
|
+
)
|
|
7194
|
+
] }),
|
|
7195
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:chevron-right-24-regular", width: 20, height: 20 })
|
|
7196
|
+
] })
|
|
7197
|
+
]
|
|
7198
|
+
},
|
|
7199
|
+
passenger.id || `passenger-${index}`
|
|
7200
|
+
);
|
|
7201
|
+
}) })
|
|
7202
|
+
] });
|
|
7203
|
+
};
|
|
6432
7204
|
|
|
6433
7205
|
exports.BackgroundTicketCard = BackgroundTicketCard_default;
|
|
6434
7206
|
exports.BackgroundTicketCardVertical = BackgroundTicketCardVertical_default;
|
|
6435
7207
|
exports.CardBanner = CardBanner;
|
|
7208
|
+
exports.CardOrdererInfo = CardOrdererInfo;
|
|
7209
|
+
exports.CardPassengerList = CardPassengerList;
|
|
6436
7210
|
exports.CardPromo = CardPromo;
|
|
6437
7211
|
exports.CardServiceMenu = CardServiceMenu;
|
|
6438
7212
|
exports.CardTicket = CardTicket;
|
|
@@ -6457,6 +7231,8 @@ exports.MODAL_PRESETS = MODAL_PRESETS;
|
|
|
6457
7231
|
exports.ModalFilterTicket = ModalFilterTicket;
|
|
6458
7232
|
exports.ModalFilterTicketDefaultLabels = DEFAULT_LABELS3;
|
|
6459
7233
|
exports.ModalIllustration = ModalIllustration;
|
|
7234
|
+
exports.ModalListPassenger = ModalListPassenger;
|
|
7235
|
+
exports.ModalPassengerForm = ModalPassengerForm;
|
|
6460
7236
|
exports.ModalSearchHarbor = ModalSearchHarbor;
|
|
6461
7237
|
exports.ModalSearchTicket = ModalSearchTicket;
|
|
6462
7238
|
exports.ModalSelectDate = ModalSelectDate;
|
|
@@ -6464,6 +7240,8 @@ exports.ModalService = ModalService;
|
|
|
6464
7240
|
exports.ModalTotalPassengers = ModalTotalPassengers;
|
|
6465
7241
|
exports.ModalTypeOfService = ModalTypeOfService;
|
|
6466
7242
|
exports.SortMenu = SortMenu;
|
|
7243
|
+
exports.Stepper = Stepper;
|
|
7244
|
+
exports.getBadgeConfig = getBadgeConfig;
|
|
6467
7245
|
exports.getModalPreset = getModalPreset;
|
|
6468
7246
|
exports.getSortLabel = getSortLabel;
|
|
6469
7247
|
//# sourceMappingURL=index.js.map
|