@asdp/ferryui 0.1.5 → 0.1.7

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 CHANGED
@@ -644,4 +644,214 @@ interface ModalSelectDateProps {
644
644
  */
645
645
  declare const ModalSelectDate: React.FC<ModalSelectDateProps>;
646
646
 
647
- export { BackgroundTicketCard, BackgroundTicketCardVertical, CardBanner, type CardBannerProps, CardPromo, type CardPromoProps, CardServiceMenu, type CardServiceMenuProps, CardTicket, type CardTicketButton, type CardTicketProps, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, type ModalPresetKey, ModalSearchHarbor, type ModalSearchHarborProps, ModalSelectDate, type ModalSelectDateProps, type RadioOption, type SelectOption, type ServiceMenuItem, type TabType, getModalPreset };
647
+ /**
648
+ * Service item structure
649
+ */
650
+ interface ServiceItem {
651
+ /**
652
+ * Unique identifier for the service
653
+ */
654
+ id: number;
655
+ /**
656
+ * Display name of the service type
657
+ */
658
+ serviceTypeName: string;
659
+ /**
660
+ * Code identifier for the service type
661
+ */
662
+ serviceTypeCode: string;
663
+ /**
664
+ * Detailed description of the service
665
+ */
666
+ serviceDescription: string;
667
+ }
668
+ /**
669
+ * Props for ModalService component
670
+ */
671
+ interface ModalServiceProps {
672
+ /**
673
+ * Whether the modal is open
674
+ */
675
+ open: boolean;
676
+ /**
677
+ * Callback when modal should close
678
+ */
679
+ onClose: () => void;
680
+ /**
681
+ * Modal title
682
+ * @default "Pilih Kelas Layanan"
683
+ */
684
+ title?: string;
685
+ /**
686
+ * Array of available services
687
+ */
688
+ services: ServiceItem[];
689
+ /**
690
+ * Array of currently selected service IDs
691
+ */
692
+ selectedServiceIds: number[];
693
+ /**
694
+ * Callback when save button is clicked
695
+ * @param services - Array of selected service items
696
+ */
697
+ onSave: (services: ServiceItem[]) => void;
698
+ /**
699
+ * Loading state for services data
700
+ * @default false
701
+ */
702
+ isLoading?: boolean;
703
+ /**
704
+ * Error state for services data
705
+ * @default false
706
+ */
707
+ isError?: boolean;
708
+ }
709
+ /**
710
+ * ModalService - A reusable modal component for selecting service classes
711
+ *
712
+ * This component provides a service selection modal with features like:
713
+ * - Multiple service selection with checkboxes
714
+ * - Select all/deselect all functionality
715
+ * - Service details display (name, code, description)
716
+ * - Save validation (requires at least one selection)
717
+ *
718
+ * @example
719
+ * ```tsx
720
+ * <ModalService
721
+ * open={isOpen}
722
+ * onClose={() => setIsOpen(false)}
723
+ * title="Pilih Kelas Layanan"
724
+ * services={servicesList}
725
+ * selectedServiceIds={selectedIds}
726
+ * onSave={handleSave}
727
+ * isLoading={isLoading}
728
+ * isError={isError}
729
+ * />
730
+ * ```
731
+ */
732
+ declare const ModalService: React.FC<ModalServiceProps>;
733
+
734
+ /**
735
+ * Service class codes for passenger services
736
+ */
737
+ type PassengerServiceCode = 'ECONOMY' | 'BUSINESS' | 'EXECUTIVE';
738
+ /**
739
+ * Service class data structure
740
+ */
741
+ interface ServiceClass {
742
+ id: number;
743
+ name: string;
744
+ key: string;
745
+ serviceName: PassengerServiceCode;
746
+ }
747
+ /**
748
+ * Default service classes available
749
+ */
750
+ declare const DEFAULT_SERVICE_CLASSES: ServiceClass[];
751
+
752
+ /**
753
+ * Passenger object structure
754
+ */
755
+ interface Passenger {
756
+ [key: string]: any;
757
+ }
758
+ /**
759
+ * Service with passenger count
760
+ */
761
+ interface PassengerService {
762
+ serviceId: number;
763
+ serviceName: PassengerServiceCode;
764
+ count: number;
765
+ passengers: Passenger[];
766
+ }
767
+ /**
768
+ * Passenger type from API
769
+ */
770
+ interface PassengerType {
771
+ id: number;
772
+ passengerTypeCode: string;
773
+ passengerTypeName: string;
774
+ }
775
+ /**
776
+ * Selected passenger item structure
777
+ */
778
+ interface SelectedPassengerItem {
779
+ passengerTypeId: number;
780
+ passengerTypeCode: string;
781
+ passengerTypeName: string;
782
+ services: PassengerService[];
783
+ }
784
+ /**
785
+ * Props for ModalTotalPassengers component
786
+ */
787
+ interface ModalTotalPassengersProps {
788
+ /**
789
+ * Whether the modal is open
790
+ */
791
+ open: boolean;
792
+ /**
793
+ * Callback when modal should close
794
+ */
795
+ onClose: () => void;
796
+ /**
797
+ * Modal title
798
+ * @default "Pilih Jumlah Penumpang"
799
+ */
800
+ title?: string;
801
+ /**
802
+ * Array of passenger types from API
803
+ */
804
+ passengerTypes: PassengerType[];
805
+ /**
806
+ * Array of service classes
807
+ * @default DEFAULT_SERVICE_CLASSES
808
+ */
809
+ serviceClasses?: ServiceClass[];
810
+ /**
811
+ * Currently selected passengers
812
+ */
813
+ selectedPassengers: SelectedPassengerItem[];
814
+ /**
815
+ * Callback when save button is clicked
816
+ */
817
+ onSave: (passengers: SelectedPassengerItem[]) => void;
818
+ /**
819
+ * Loading state
820
+ * @default false
821
+ */
822
+ isLoading?: boolean;
823
+ /**
824
+ * Maximum number of passengers allowed
825
+ * @default 10
826
+ */
827
+ maxPassengers?: number;
828
+ /**
829
+ * Message to display in the info bar
830
+ * @default "Anda dapat menambahkan hingga {maxPassengers} penumpang pada golongan kendaraan ini."
831
+ */
832
+ infoMessage?: string;
833
+ }
834
+ /**
835
+ * ModalTotalPassengers - A reusable modal component for selecting passenger counts
836
+ *
837
+ * This component provides a passenger selection modal with features like:
838
+ * - Accordion for each passenger type
839
+ * - Counter for each service class (Economy, Business, Executive)
840
+ * - Automatic default selection (1 adult economy)
841
+ * - Validation and save functionality
842
+ *
843
+ * @example
844
+ * ```tsx
845
+ * <ModalTotalPassengers
846
+ * open={isOpen}
847
+ * onClose={() => setIsOpen(false)}
848
+ * title="Pilih Jumlah Penumpang"
849
+ * passengerTypes={passengerTypes}
850
+ * selectedPassengers={selectedPassengers}
851
+ * onSave={handleSave}
852
+ * />
853
+ * ```
854
+ */
855
+ declare const ModalTotalPassengers: React$1.FC<ModalTotalPassengersProps>;
856
+
857
+ export { BackgroundTicketCard, BackgroundTicketCardVertical, CardBanner, type CardBannerProps, CardPromo, type CardPromoProps, CardServiceMenu, type CardServiceMenuProps, CardTicket, type CardTicketButton, type CardTicketProps, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, DEFAULT_SERVICE_CLASSES, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, type ModalPresetKey, ModalSearchHarbor, type ModalSearchHarborProps, ModalSelectDate, type ModalSelectDateProps, ModalService, type ModalServiceProps, ModalTotalPassengers, type ModalTotalPassengersProps, type Passenger, type PassengerService, type PassengerServiceCode, type PassengerType, type RadioOption, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceItem, type ServiceMenuItem, type TabType, getModalPreset };
package/dist/index.d.ts CHANGED
@@ -644,4 +644,214 @@ interface ModalSelectDateProps {
644
644
  */
645
645
  declare const ModalSelectDate: React.FC<ModalSelectDateProps>;
646
646
 
647
- export { BackgroundTicketCard, BackgroundTicketCardVertical, CardBanner, type CardBannerProps, CardPromo, type CardPromoProps, CardServiceMenu, type CardServiceMenuProps, CardTicket, type CardTicketButton, type CardTicketProps, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, type ModalPresetKey, ModalSearchHarbor, type ModalSearchHarborProps, ModalSelectDate, type ModalSelectDateProps, type RadioOption, type SelectOption, type ServiceMenuItem, type TabType, getModalPreset };
647
+ /**
648
+ * Service item structure
649
+ */
650
+ interface ServiceItem {
651
+ /**
652
+ * Unique identifier for the service
653
+ */
654
+ id: number;
655
+ /**
656
+ * Display name of the service type
657
+ */
658
+ serviceTypeName: string;
659
+ /**
660
+ * Code identifier for the service type
661
+ */
662
+ serviceTypeCode: string;
663
+ /**
664
+ * Detailed description of the service
665
+ */
666
+ serviceDescription: string;
667
+ }
668
+ /**
669
+ * Props for ModalService component
670
+ */
671
+ interface ModalServiceProps {
672
+ /**
673
+ * Whether the modal is open
674
+ */
675
+ open: boolean;
676
+ /**
677
+ * Callback when modal should close
678
+ */
679
+ onClose: () => void;
680
+ /**
681
+ * Modal title
682
+ * @default "Pilih Kelas Layanan"
683
+ */
684
+ title?: string;
685
+ /**
686
+ * Array of available services
687
+ */
688
+ services: ServiceItem[];
689
+ /**
690
+ * Array of currently selected service IDs
691
+ */
692
+ selectedServiceIds: number[];
693
+ /**
694
+ * Callback when save button is clicked
695
+ * @param services - Array of selected service items
696
+ */
697
+ onSave: (services: ServiceItem[]) => void;
698
+ /**
699
+ * Loading state for services data
700
+ * @default false
701
+ */
702
+ isLoading?: boolean;
703
+ /**
704
+ * Error state for services data
705
+ * @default false
706
+ */
707
+ isError?: boolean;
708
+ }
709
+ /**
710
+ * ModalService - A reusable modal component for selecting service classes
711
+ *
712
+ * This component provides a service selection modal with features like:
713
+ * - Multiple service selection with checkboxes
714
+ * - Select all/deselect all functionality
715
+ * - Service details display (name, code, description)
716
+ * - Save validation (requires at least one selection)
717
+ *
718
+ * @example
719
+ * ```tsx
720
+ * <ModalService
721
+ * open={isOpen}
722
+ * onClose={() => setIsOpen(false)}
723
+ * title="Pilih Kelas Layanan"
724
+ * services={servicesList}
725
+ * selectedServiceIds={selectedIds}
726
+ * onSave={handleSave}
727
+ * isLoading={isLoading}
728
+ * isError={isError}
729
+ * />
730
+ * ```
731
+ */
732
+ declare const ModalService: React.FC<ModalServiceProps>;
733
+
734
+ /**
735
+ * Service class codes for passenger services
736
+ */
737
+ type PassengerServiceCode = 'ECONOMY' | 'BUSINESS' | 'EXECUTIVE';
738
+ /**
739
+ * Service class data structure
740
+ */
741
+ interface ServiceClass {
742
+ id: number;
743
+ name: string;
744
+ key: string;
745
+ serviceName: PassengerServiceCode;
746
+ }
747
+ /**
748
+ * Default service classes available
749
+ */
750
+ declare const DEFAULT_SERVICE_CLASSES: ServiceClass[];
751
+
752
+ /**
753
+ * Passenger object structure
754
+ */
755
+ interface Passenger {
756
+ [key: string]: any;
757
+ }
758
+ /**
759
+ * Service with passenger count
760
+ */
761
+ interface PassengerService {
762
+ serviceId: number;
763
+ serviceName: PassengerServiceCode;
764
+ count: number;
765
+ passengers: Passenger[];
766
+ }
767
+ /**
768
+ * Passenger type from API
769
+ */
770
+ interface PassengerType {
771
+ id: number;
772
+ passengerTypeCode: string;
773
+ passengerTypeName: string;
774
+ }
775
+ /**
776
+ * Selected passenger item structure
777
+ */
778
+ interface SelectedPassengerItem {
779
+ passengerTypeId: number;
780
+ passengerTypeCode: string;
781
+ passengerTypeName: string;
782
+ services: PassengerService[];
783
+ }
784
+ /**
785
+ * Props for ModalTotalPassengers component
786
+ */
787
+ interface ModalTotalPassengersProps {
788
+ /**
789
+ * Whether the modal is open
790
+ */
791
+ open: boolean;
792
+ /**
793
+ * Callback when modal should close
794
+ */
795
+ onClose: () => void;
796
+ /**
797
+ * Modal title
798
+ * @default "Pilih Jumlah Penumpang"
799
+ */
800
+ title?: string;
801
+ /**
802
+ * Array of passenger types from API
803
+ */
804
+ passengerTypes: PassengerType[];
805
+ /**
806
+ * Array of service classes
807
+ * @default DEFAULT_SERVICE_CLASSES
808
+ */
809
+ serviceClasses?: ServiceClass[];
810
+ /**
811
+ * Currently selected passengers
812
+ */
813
+ selectedPassengers: SelectedPassengerItem[];
814
+ /**
815
+ * Callback when save button is clicked
816
+ */
817
+ onSave: (passengers: SelectedPassengerItem[]) => void;
818
+ /**
819
+ * Loading state
820
+ * @default false
821
+ */
822
+ isLoading?: boolean;
823
+ /**
824
+ * Maximum number of passengers allowed
825
+ * @default 10
826
+ */
827
+ maxPassengers?: number;
828
+ /**
829
+ * Message to display in the info bar
830
+ * @default "Anda dapat menambahkan hingga {maxPassengers} penumpang pada golongan kendaraan ini."
831
+ */
832
+ infoMessage?: string;
833
+ }
834
+ /**
835
+ * ModalTotalPassengers - A reusable modal component for selecting passenger counts
836
+ *
837
+ * This component provides a passenger selection modal with features like:
838
+ * - Accordion for each passenger type
839
+ * - Counter for each service class (Economy, Business, Executive)
840
+ * - Automatic default selection (1 adult economy)
841
+ * - Validation and save functionality
842
+ *
843
+ * @example
844
+ * ```tsx
845
+ * <ModalTotalPassengers
846
+ * open={isOpen}
847
+ * onClose={() => setIsOpen(false)}
848
+ * title="Pilih Jumlah Penumpang"
849
+ * passengerTypes={passengerTypes}
850
+ * selectedPassengers={selectedPassengers}
851
+ * onSave={handleSave}
852
+ * />
853
+ * ```
854
+ */
855
+ declare const ModalTotalPassengers: React$1.FC<ModalTotalPassengersProps>;
856
+
857
+ export { BackgroundTicketCard, BackgroundTicketCardVertical, CardBanner, type CardBannerProps, CardPromo, type CardPromoProps, CardServiceMenu, type CardServiceMenuProps, CardTicket, type CardTicketButton, type CardTicketProps, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, DEFAULT_SERVICE_CLASSES, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, type ModalPresetKey, ModalSearchHarbor, type ModalSearchHarborProps, ModalSelectDate, type ModalSelectDateProps, ModalService, type ModalServiceProps, ModalTotalPassengers, type ModalTotalPassengersProps, type Passenger, type PassengerService, type PassengerServiceCode, type PassengerType, type RadioOption, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceItem, type ServiceMenuItem, type TabType, getModalPreset };