@asdp/ferryui 0.1.6 → 0.1.8
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 +220 -1
- package/dist/index.d.ts +220 -1
- package/dist/index.js +593 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +591 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -731,4 +731,223 @@ interface ModalServiceProps {
|
|
|
731
731
|
*/
|
|
732
732
|
declare const ModalService: React.FC<ModalServiceProps>;
|
|
733
733
|
|
|
734
|
-
|
|
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
|
+
/**
|
|
858
|
+
* Service type item structure
|
|
859
|
+
*/
|
|
860
|
+
interface TypeOfService {
|
|
861
|
+
id: number;
|
|
862
|
+
image: string;
|
|
863
|
+
title: string;
|
|
864
|
+
info: string;
|
|
865
|
+
price: number;
|
|
866
|
+
type: string;
|
|
867
|
+
parentId?: number;
|
|
868
|
+
parentTitle?: string;
|
|
869
|
+
child: TypeOfService[];
|
|
870
|
+
typeOfPassanger: string;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Props for ModalTypeOfService component
|
|
874
|
+
*/
|
|
875
|
+
interface ModalTypeOfServiceProps {
|
|
876
|
+
/**
|
|
877
|
+
* Whether the modal is open
|
|
878
|
+
*/
|
|
879
|
+
open: boolean;
|
|
880
|
+
/**
|
|
881
|
+
* Callback when modal should close
|
|
882
|
+
*/
|
|
883
|
+
onClose: () => void;
|
|
884
|
+
/**
|
|
885
|
+
* Modal title
|
|
886
|
+
* @default "Pilih Tipe Layanan"
|
|
887
|
+
*/
|
|
888
|
+
title?: string;
|
|
889
|
+
/**
|
|
890
|
+
* Array of service types
|
|
891
|
+
*/
|
|
892
|
+
serviceTypes: TypeOfService[];
|
|
893
|
+
/**
|
|
894
|
+
* Currently selected service
|
|
895
|
+
*/
|
|
896
|
+
selectedService?: TypeOfService | null;
|
|
897
|
+
/**
|
|
898
|
+
* Callback when save button is clicked
|
|
899
|
+
*/
|
|
900
|
+
onSave: (service: TypeOfService) => void;
|
|
901
|
+
/**
|
|
902
|
+
* Optional custom image renderer
|
|
903
|
+
* Useful for Next.js Image component or other custom renderers
|
|
904
|
+
*/
|
|
905
|
+
renderImage?: (props: {
|
|
906
|
+
src: string;
|
|
907
|
+
alt: string;
|
|
908
|
+
width: number;
|
|
909
|
+
height: number;
|
|
910
|
+
}) => ReactNode;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* ModalTypeOfService - A reusable modal component for selecting service types
|
|
914
|
+
*
|
|
915
|
+
* This component provides a service type selection modal with features like:
|
|
916
|
+
* - Accordion for categories with children (vehicles, goods, etc.)
|
|
917
|
+
* - Radio buttons for individual selections
|
|
918
|
+
* - Image display for each service type
|
|
919
|
+
* - Customizable image renderer for framework-specific components
|
|
920
|
+
*
|
|
921
|
+
* @example
|
|
922
|
+
* ```tsx
|
|
923
|
+
* <ModalTypeOfService
|
|
924
|
+
* open={isOpen}
|
|
925
|
+
* onClose={() => setIsOpen(false)}
|
|
926
|
+
* title="Pilih Tipe Layanan"
|
|
927
|
+
* serviceTypes={serviceTypes}
|
|
928
|
+
* selectedService={selectedService}
|
|
929
|
+
* onSave={handleSave}
|
|
930
|
+
* renderImage={(props) => <Image {...props} />}
|
|
931
|
+
* />
|
|
932
|
+
* ```
|
|
933
|
+
*/
|
|
934
|
+
declare const ModalTypeOfService: React$1.FC<ModalTypeOfServiceProps>;
|
|
935
|
+
|
|
936
|
+
/**
|
|
937
|
+
* Default paths for vehicle icon images
|
|
938
|
+
* These images are bundled with the library in the assets directory
|
|
939
|
+
*/
|
|
940
|
+
declare const DEFAULT_VEHICLE_ICONS: {
|
|
941
|
+
readonly pedestrian: "/assets/images/icons/pedestrian.webp";
|
|
942
|
+
readonly roadbike: "/assets/images/icons/roadbike.webp";
|
|
943
|
+
readonly motorbike1: "/assets/images/icons/motorbike-1.webp";
|
|
944
|
+
readonly motorbike2: "/assets/images/icons/motorbike-2.svg";
|
|
945
|
+
readonly smallCar: "/assets/images/icons/small-car.webp";
|
|
946
|
+
readonly smallBus: "/assets/images/icons/small-bus.webp";
|
|
947
|
+
readonly bigBus: "/assets/images/icons/big-bus.webp";
|
|
948
|
+
readonly truck: "/assets/images/icons/truck.webp";
|
|
949
|
+
readonly bigTruck: "/assets/images/icons/big-truck.webp";
|
|
950
|
+
readonly looseLoad: "/assets/images/icons/loose-load.webp";
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
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, DEFAULT_VEHICLE_ICONS, 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, ModalTypeOfService, type ModalTypeOfServiceProps, type Passenger, type PassengerService, type PassengerServiceCode, type PassengerType, type RadioOption, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceItem, type ServiceMenuItem, type TabType, type TypeOfService, getModalPreset };
|
package/dist/index.d.ts
CHANGED
|
@@ -731,4 +731,223 @@ interface ModalServiceProps {
|
|
|
731
731
|
*/
|
|
732
732
|
declare const ModalService: React.FC<ModalServiceProps>;
|
|
733
733
|
|
|
734
|
-
|
|
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
|
+
/**
|
|
858
|
+
* Service type item structure
|
|
859
|
+
*/
|
|
860
|
+
interface TypeOfService {
|
|
861
|
+
id: number;
|
|
862
|
+
image: string;
|
|
863
|
+
title: string;
|
|
864
|
+
info: string;
|
|
865
|
+
price: number;
|
|
866
|
+
type: string;
|
|
867
|
+
parentId?: number;
|
|
868
|
+
parentTitle?: string;
|
|
869
|
+
child: TypeOfService[];
|
|
870
|
+
typeOfPassanger: string;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Props for ModalTypeOfService component
|
|
874
|
+
*/
|
|
875
|
+
interface ModalTypeOfServiceProps {
|
|
876
|
+
/**
|
|
877
|
+
* Whether the modal is open
|
|
878
|
+
*/
|
|
879
|
+
open: boolean;
|
|
880
|
+
/**
|
|
881
|
+
* Callback when modal should close
|
|
882
|
+
*/
|
|
883
|
+
onClose: () => void;
|
|
884
|
+
/**
|
|
885
|
+
* Modal title
|
|
886
|
+
* @default "Pilih Tipe Layanan"
|
|
887
|
+
*/
|
|
888
|
+
title?: string;
|
|
889
|
+
/**
|
|
890
|
+
* Array of service types
|
|
891
|
+
*/
|
|
892
|
+
serviceTypes: TypeOfService[];
|
|
893
|
+
/**
|
|
894
|
+
* Currently selected service
|
|
895
|
+
*/
|
|
896
|
+
selectedService?: TypeOfService | null;
|
|
897
|
+
/**
|
|
898
|
+
* Callback when save button is clicked
|
|
899
|
+
*/
|
|
900
|
+
onSave: (service: TypeOfService) => void;
|
|
901
|
+
/**
|
|
902
|
+
* Optional custom image renderer
|
|
903
|
+
* Useful for Next.js Image component or other custom renderers
|
|
904
|
+
*/
|
|
905
|
+
renderImage?: (props: {
|
|
906
|
+
src: string;
|
|
907
|
+
alt: string;
|
|
908
|
+
width: number;
|
|
909
|
+
height: number;
|
|
910
|
+
}) => ReactNode;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* ModalTypeOfService - A reusable modal component for selecting service types
|
|
914
|
+
*
|
|
915
|
+
* This component provides a service type selection modal with features like:
|
|
916
|
+
* - Accordion for categories with children (vehicles, goods, etc.)
|
|
917
|
+
* - Radio buttons for individual selections
|
|
918
|
+
* - Image display for each service type
|
|
919
|
+
* - Customizable image renderer for framework-specific components
|
|
920
|
+
*
|
|
921
|
+
* @example
|
|
922
|
+
* ```tsx
|
|
923
|
+
* <ModalTypeOfService
|
|
924
|
+
* open={isOpen}
|
|
925
|
+
* onClose={() => setIsOpen(false)}
|
|
926
|
+
* title="Pilih Tipe Layanan"
|
|
927
|
+
* serviceTypes={serviceTypes}
|
|
928
|
+
* selectedService={selectedService}
|
|
929
|
+
* onSave={handleSave}
|
|
930
|
+
* renderImage={(props) => <Image {...props} />}
|
|
931
|
+
* />
|
|
932
|
+
* ```
|
|
933
|
+
*/
|
|
934
|
+
declare const ModalTypeOfService: React$1.FC<ModalTypeOfServiceProps>;
|
|
935
|
+
|
|
936
|
+
/**
|
|
937
|
+
* Default paths for vehicle icon images
|
|
938
|
+
* These images are bundled with the library in the assets directory
|
|
939
|
+
*/
|
|
940
|
+
declare const DEFAULT_VEHICLE_ICONS: {
|
|
941
|
+
readonly pedestrian: "/assets/images/icons/pedestrian.webp";
|
|
942
|
+
readonly roadbike: "/assets/images/icons/roadbike.webp";
|
|
943
|
+
readonly motorbike1: "/assets/images/icons/motorbike-1.webp";
|
|
944
|
+
readonly motorbike2: "/assets/images/icons/motorbike-2.svg";
|
|
945
|
+
readonly smallCar: "/assets/images/icons/small-car.webp";
|
|
946
|
+
readonly smallBus: "/assets/images/icons/small-bus.webp";
|
|
947
|
+
readonly bigBus: "/assets/images/icons/big-bus.webp";
|
|
948
|
+
readonly truck: "/assets/images/icons/truck.webp";
|
|
949
|
+
readonly bigTruck: "/assets/images/icons/big-truck.webp";
|
|
950
|
+
readonly looseLoad: "/assets/images/icons/loose-load.webp";
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
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, DEFAULT_VEHICLE_ICONS, 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, ModalTypeOfService, type ModalTypeOfServiceProps, type Passenger, type PassengerService, type PassengerServiceCode, type PassengerType, type RadioOption, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceItem, type ServiceMenuItem, type TabType, type TypeOfService, getModalPreset };
|