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