@asdp/ferryui 0.1.22-dev.9114 → 0.1.22-dev.9151
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 +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +130 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeStyles, tokens, createLightTheme, createDarkTheme, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Field, Caption1Strong, Caption2, Button, Body1, Body1Strong, Caption1, Dialog, DialogSurface, DialogBody, DialogTitle, DialogTrigger, DialogContent, Carousel, CarouselButton, CarouselViewport, mergeClasses, CarouselSlider, CarouselNav, CarouselNavButton, CarouselCard, Skeleton, SkeletonItem, Subtitle2, Card, Tooltip, Badge, Title2, Divider, Title3, Label, Text, Checkbox, MessageBar, MessageBarBody, Accordion, AccordionItem, AccordionHeader, AccordionPanel, RadioGroup, Radio, Menu, MenuTrigger, MenuPopover, MenuList, DialogActions, Caption2Strong, Subtitle1, Body1Stronger, Caption1Stronger, Display, Image, Title1, TabList, Tab, Body2, typographyStyles, Switch, Textarea, Link } from '@fluentui/react-components';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { Dismiss24Regular, DismissRegular, SubtractRegular, AddRegular, DeleteRegular, InfoRegular, SearchRegular } from '@fluentui/react-icons';
|
|
5
5
|
import { Container, Row, Col, Visible } from 'react-grid-system';
|
|
6
6
|
import { Icon } from '@iconify/react';
|
|
@@ -598,11 +598,13 @@ var CarouselWithCustomNav = ({
|
|
|
598
598
|
cardFocus = false,
|
|
599
599
|
showNavButtons = false,
|
|
600
600
|
showCloseButton = false,
|
|
601
|
-
onCloseClick
|
|
601
|
+
onCloseClick,
|
|
602
|
+
autoPlay = false,
|
|
603
|
+
autoPlayInterval = 5e3
|
|
602
604
|
}) => {
|
|
603
605
|
const styles = useStyles2();
|
|
604
606
|
const [internalIndex, setInternalIndex] = useState(0);
|
|
605
|
-
const labels =
|
|
607
|
+
const labels = React.useMemo(
|
|
606
608
|
() => ({
|
|
607
609
|
...DEFAULT_LABELS2[language],
|
|
608
610
|
...customLabels,
|
|
@@ -620,6 +622,32 @@ var CarouselWithCustomNav = ({
|
|
|
620
622
|
},
|
|
621
623
|
[controlledIndex, onActiveIndexChange]
|
|
622
624
|
);
|
|
625
|
+
React.useEffect(() => {
|
|
626
|
+
if (!autoPlay) return;
|
|
627
|
+
const totalSlides = React.Children.count(children);
|
|
628
|
+
if (totalSlides <= 1) return;
|
|
629
|
+
const intervalId = setInterval(() => {
|
|
630
|
+
let nextIndex = activeIndex + 1;
|
|
631
|
+
if (nextIndex >= totalSlides) {
|
|
632
|
+
nextIndex = circular ? 0 : activeIndex;
|
|
633
|
+
}
|
|
634
|
+
if (nextIndex !== activeIndex) {
|
|
635
|
+
if (controlledIndex === void 0) {
|
|
636
|
+
setInternalIndex(nextIndex);
|
|
637
|
+
}
|
|
638
|
+
onActiveIndexChange?.(nextIndex);
|
|
639
|
+
}
|
|
640
|
+
}, autoPlayInterval);
|
|
641
|
+
return () => clearInterval(intervalId);
|
|
642
|
+
}, [
|
|
643
|
+
autoPlay,
|
|
644
|
+
autoPlayInterval,
|
|
645
|
+
children,
|
|
646
|
+
circular,
|
|
647
|
+
activeIndex,
|
|
648
|
+
controlledIndex,
|
|
649
|
+
onActiveIndexChange
|
|
650
|
+
]);
|
|
623
651
|
const defaultAnnouncement = useCallback(
|
|
624
652
|
(index, totalSlides) => {
|
|
625
653
|
return labels.announcementTemplate.replace("{index}", (index + 1).toString()).replace("{total}", totalSlides.toString());
|
|
@@ -957,12 +985,12 @@ var useStyles4 = makeStyles({
|
|
|
957
985
|
padding: 0,
|
|
958
986
|
backgroundColor: "transparent",
|
|
959
987
|
border: "none",
|
|
960
|
-
|
|
988
|
+
aspectRatio: "3/1",
|
|
961
989
|
borderRadius: tokens.borderRadiusXLarge
|
|
962
990
|
},
|
|
963
991
|
bannerImage: {
|
|
964
992
|
width: "100%",
|
|
965
|
-
|
|
993
|
+
aspectRatio: "3/1",
|
|
966
994
|
objectFit: "cover",
|
|
967
995
|
display: "block",
|
|
968
996
|
cursor: "pointer",
|
|
@@ -1961,7 +1989,7 @@ var CardServiceMenu = ({
|
|
|
1961
1989
|
return mergeClasses(styles.menuItem, isActive && styles.menuItemActive);
|
|
1962
1990
|
};
|
|
1963
1991
|
return /* @__PURE__ */ jsx(Card, { className: mergeClasses(styles.card, className), children: /* @__PURE__ */ jsx("div", { className: styles.menuList, children: menuItems.map((item, index) => {
|
|
1964
|
-
return /* @__PURE__ */ jsxs(
|
|
1992
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
1965
1993
|
/* @__PURE__ */ jsxs(
|
|
1966
1994
|
Button,
|
|
1967
1995
|
{
|
|
@@ -3757,7 +3785,7 @@ var CardTicketSearch = ({
|
|
|
3757
3785
|
menuItems
|
|
3758
3786
|
}) => {
|
|
3759
3787
|
const styles = useStyles8();
|
|
3760
|
-
const labels =
|
|
3788
|
+
const labels = React.useMemo(
|
|
3761
3789
|
() => ({ ...DEFAULT_LABELS8[language], ...customLabels }),
|
|
3762
3790
|
[language, customLabels]
|
|
3763
3791
|
);
|
|
@@ -3778,7 +3806,7 @@ var CardTicketSearch = ({
|
|
|
3778
3806
|
name: "roundTrip",
|
|
3779
3807
|
defaultValue: roundTrip
|
|
3780
3808
|
});
|
|
3781
|
-
|
|
3809
|
+
React.useEffect(() => {
|
|
3782
3810
|
setValue("from", from);
|
|
3783
3811
|
setValue("to", to);
|
|
3784
3812
|
setValue("startDate", startDate);
|
|
@@ -3798,7 +3826,7 @@ var CardTicketSearch = ({
|
|
|
3798
3826
|
passenger,
|
|
3799
3827
|
setValue
|
|
3800
3828
|
]);
|
|
3801
|
-
|
|
3829
|
+
React.useEffect(() => {
|
|
3802
3830
|
if (onRoundTripChange) {
|
|
3803
3831
|
onRoundTripChange(roundTripValue);
|
|
3804
3832
|
}
|
|
@@ -6312,7 +6340,7 @@ var SortMenu = ({
|
|
|
6312
6340
|
clearFiltersText: deprecatedClearFiltersText
|
|
6313
6341
|
}) => {
|
|
6314
6342
|
const styles = useStyles15();
|
|
6315
|
-
const labels =
|
|
6343
|
+
const labels = React.useMemo(
|
|
6316
6344
|
() => ({
|
|
6317
6345
|
...DEFAULT_LABELS15[language],
|
|
6318
6346
|
...customLabels,
|
|
@@ -6335,11 +6363,11 @@ var SortMenu = ({
|
|
|
6335
6363
|
deprecatedClearFiltersText
|
|
6336
6364
|
]
|
|
6337
6365
|
);
|
|
6338
|
-
const sortOptions =
|
|
6366
|
+
const sortOptions = React.useMemo(
|
|
6339
6367
|
() => customSortOptions || getSortOptions(labels),
|
|
6340
6368
|
[customSortOptions, labels]
|
|
6341
6369
|
);
|
|
6342
|
-
const currentSortLabel =
|
|
6370
|
+
const currentSortLabel = React.useMemo(
|
|
6343
6371
|
() => sortOptions.find((opt) => opt.value === value)?.label || labels.recommendation,
|
|
6344
6372
|
[sortOptions, value, labels.recommendation]
|
|
6345
6373
|
);
|
|
@@ -10749,44 +10777,44 @@ var DEFAULT_LABELS27 = {
|
|
|
10749
10777
|
var DEFAULT_FAQ_ITEMS = {
|
|
10750
10778
|
id: [
|
|
10751
10779
|
{
|
|
10752
|
-
|
|
10780
|
+
id: 1,
|
|
10753
10781
|
question: "Bagaimana cara memesan tiket?",
|
|
10754
10782
|
answer: "Anda dapat memesan tiket melalui halaman pencarian tiket dengan memilih pelabuhan asal, tujuan, dan tanggal keberangkatan."
|
|
10755
10783
|
},
|
|
10756
10784
|
{
|
|
10757
|
-
|
|
10785
|
+
id: 2,
|
|
10758
10786
|
question: "Apakah bisa mengajukan refund?",
|
|
10759
10787
|
answer: "Ya, pengajuan refund dapat dilakukan melalui menu Riwayat Pesanan sesuai dengan syarat dan ketentuan yang berlaku."
|
|
10760
10788
|
},
|
|
10761
10789
|
{
|
|
10762
|
-
|
|
10790
|
+
id: 3,
|
|
10763
10791
|
question: "Metode pembayaran apa saja yang tersedia?",
|
|
10764
10792
|
answer: "Kami mendukung berbagai metode pembayaran termasuk Virtual Account, E-Wallet, dan Kartu Kredit/Debit."
|
|
10765
10793
|
},
|
|
10766
10794
|
{
|
|
10767
|
-
|
|
10795
|
+
id: 4,
|
|
10768
10796
|
question: "Apakah tiket perlu dicetak?",
|
|
10769
10797
|
answer: "Tidak perlu. Anda dapat menunjukkan E-Tiket atau QR Code pada saat check-in di pelabuhan."
|
|
10770
10798
|
}
|
|
10771
10799
|
],
|
|
10772
10800
|
en: [
|
|
10773
10801
|
{
|
|
10774
|
-
|
|
10802
|
+
id: 1,
|
|
10775
10803
|
question: "How to book a ticket?",
|
|
10776
10804
|
answer: "You can book tickets through the ticket search page by selecting origin, destination, and departure date."
|
|
10777
10805
|
},
|
|
10778
10806
|
{
|
|
10779
|
-
|
|
10807
|
+
id: 2,
|
|
10780
10808
|
question: "Can I request a refund?",
|
|
10781
10809
|
answer: "Yes, refund requests can be made via the Order History menu subject to applicable terms and conditions."
|
|
10782
10810
|
},
|
|
10783
10811
|
{
|
|
10784
|
-
|
|
10812
|
+
id: 3,
|
|
10785
10813
|
question: "What payment methods are available?",
|
|
10786
10814
|
answer: "We support various payment methods including Virtual Account, E-Wallet, and Credit/Debit Cards."
|
|
10787
10815
|
},
|
|
10788
10816
|
{
|
|
10789
|
-
|
|
10817
|
+
id: 4,
|
|
10790
10818
|
question: "Do I need to print the ticket?",
|
|
10791
10819
|
answer: "No physically printed ticket needed. You can show your E-Ticket or QR Code during check-in at the port."
|
|
10792
10820
|
}
|
|
@@ -10824,7 +10852,7 @@ var CardFAQ = ({
|
|
|
10824
10852
|
/* @__PURE__ */ jsx(Accordion, { collapsible: true, children: faqItems.map((item) => /* @__PURE__ */ jsxs(
|
|
10825
10853
|
AccordionItem,
|
|
10826
10854
|
{
|
|
10827
|
-
value: item.
|
|
10855
|
+
value: item.id,
|
|
10828
10856
|
className: styles.accordionItem,
|
|
10829
10857
|
children: [
|
|
10830
10858
|
/* @__PURE__ */ jsxs(
|
|
@@ -10848,7 +10876,7 @@ var CardFAQ = ({
|
|
|
10848
10876
|
/* @__PURE__ */ jsx(AccordionPanel, { children: item.answer })
|
|
10849
10877
|
]
|
|
10850
10878
|
},
|
|
10851
|
-
item.
|
|
10879
|
+
item.id
|
|
10852
10880
|
)) })
|
|
10853
10881
|
] });
|
|
10854
10882
|
};
|
|
@@ -11598,7 +11626,7 @@ var CardReview = ({
|
|
|
11598
11626
|
}
|
|
11599
11627
|
) : (
|
|
11600
11628
|
// Clone element to append className if it's a valid React element
|
|
11601
|
-
|
|
11629
|
+
React.isValidElement(item.label) ? React.cloneElement(item.label, {
|
|
11602
11630
|
className: `${styles.defaultLabel} ${item.labelClassName || ""}${item.label.props.className ? " " + item.label.props.className : ""}`
|
|
11603
11631
|
}) : /* @__PURE__ */ jsx(
|
|
11604
11632
|
"div",
|
|
@@ -11951,7 +11979,7 @@ var CardPriceDetails = ({
|
|
|
11951
11979
|
const renderItem = (item, key) => {
|
|
11952
11980
|
const variantClass = getVariantClass(item.variant);
|
|
11953
11981
|
const isTaxLike = item.variant === "danger";
|
|
11954
|
-
return /* @__PURE__ */ jsxs(
|
|
11982
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
11955
11983
|
/* @__PURE__ */ jsxs("div", { className: styles.row, children: [
|
|
11956
11984
|
isTaxLike ? /* @__PURE__ */ jsx(Body1Strong, { className: variantClass, children: item.name }) : /* @__PURE__ */ jsx(Caption1, { className: mergeClasses(styles.label, variantClass), children: item.name }),
|
|
11957
11985
|
isTaxLike ? /* @__PURE__ */ jsxs(Body1Strong, { className: mergeClasses(styles.value, variantClass), children: [
|
|
@@ -11978,7 +12006,7 @@ var CardPriceDetails = ({
|
|
|
11978
12006
|
section.detail.map((item, i) => renderItem(item, i))
|
|
11979
12007
|
] }, index);
|
|
11980
12008
|
}
|
|
11981
|
-
return /* @__PURE__ */ jsx(
|
|
12009
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: section.detail.map((item, i) => renderItem(item, i)) }, index);
|
|
11982
12010
|
}),
|
|
11983
12011
|
/* @__PURE__ */ jsx(Divider, {}),
|
|
11984
12012
|
/* @__PURE__ */ jsxs("div", { className: styles.totalRow, children: [
|
|
@@ -12972,7 +13000,7 @@ var uploadStyles = makeStyles({
|
|
|
12972
13000
|
objectFit: "contain"
|
|
12973
13001
|
}
|
|
12974
13002
|
});
|
|
12975
|
-
var FileUpload =
|
|
13003
|
+
var FileUpload = React.forwardRef(
|
|
12976
13004
|
({
|
|
12977
13005
|
name,
|
|
12978
13006
|
control,
|