@asdp/ferryui 0.1.22-dev.9698 → 0.1.22-dev.9701
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 +62 -32
- package/dist/index.d.ts +62 -32
- package/dist/index.js +95 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeStyles, tokens, createLightTheme, createDarkTheme, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Field, Caption1Strong, Caption2, Button, InfoLabel, 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, Subtitle1, Checkbox, MessageBar, MessageBarBody, Accordion, AccordionItem, AccordionHeader, AccordionPanel, RadioGroup, Menu, MenuTrigger, MenuPopover, MenuList, Radio, DialogActions, Caption2Strong, Body2, Body1Stronger, Caption1Stronger, Display, Image, Title1, TabList, Tab, typographyStyles, Switch, Textarea, Link } from '@fluentui/react-components';
|
|
1
|
+
import { makeStyles, tokens, createLightTheme, createDarkTheme, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Field, Caption1Strong, Caption2, Button, InfoLabel, 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, Spinner, Label, Text, Subtitle1, Checkbox, MessageBar, MessageBarBody, Accordion, AccordionItem, AccordionHeader, AccordionPanel, RadioGroup, Menu, MenuTrigger, MenuPopover, MenuList, Radio, DialogActions, Caption2Strong, Body2, Body1Stronger, Caption1Stronger, Display, Image, Title1, TabList, Tab, typographyStyles, Switch, Textarea, Link } from '@fluentui/react-components';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import React, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { ArrowDownloadRegular, Dismiss24Regular, DismissRegular, SubtractRegular, AddRegular, DeleteRegular, InfoRegular, SearchRegular } from '@fluentui/react-icons';
|
|
@@ -80,6 +80,34 @@ var PRESET_CONTENT = {
|
|
|
80
80
|
imageSrc: "/assets/images/illustrations/mobile-pay.svg",
|
|
81
81
|
imageAlt: "Transaction Limit Illustration"
|
|
82
82
|
}
|
|
83
|
+
},
|
|
84
|
+
UNAUTHENTICATED: {
|
|
85
|
+
id: {
|
|
86
|
+
title: "Masuk untuk melanjutkan pemesanan",
|
|
87
|
+
message: "Untuk memesan tiket dan mengisi manifest penumpang, Anda perlu masuk terlebih dahulu. Pilihan jadwal Anda akan tetap tersimpan.",
|
|
88
|
+
imageSrc: "/assets/images/illustrations/auth.svg",
|
|
89
|
+
imageAlt: "Unauthenticated Illustration"
|
|
90
|
+
},
|
|
91
|
+
en: {
|
|
92
|
+
title: "Sign in to continue booking",
|
|
93
|
+
message: "To book tickets and fill in the passenger manifest, you need to sign in first. Your schedule selection will be saved.",
|
|
94
|
+
imageSrc: "/assets/images/illustrations/auth.svg",
|
|
95
|
+
imageAlt: "Unauthenticated Illustration"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
PROFILE_NOT_COMPLETE: {
|
|
99
|
+
id: {
|
|
100
|
+
title: "Profil Belum Lengkap",
|
|
101
|
+
message: "Untuk melanjutkan pemesanan tiket, kami memerlukan data profil yang lengkap sesuai ketentuan ASDP. Lengkapi profil Anda terlebih dahulu agar dapat melanjutkan ke pengisian manifest.",
|
|
102
|
+
imageSrc: "/assets/images/illustrations/profile.svg",
|
|
103
|
+
imageAlt: "Profile Not Complete Illustration"
|
|
104
|
+
},
|
|
105
|
+
en: {
|
|
106
|
+
title: "Profile Not Complete",
|
|
107
|
+
message: "To continue booking tickets, we need complete profile data according to ASDP provisions. Please complete your profile first to proceed to manifest filling.",
|
|
108
|
+
imageSrc: "/assets/images/illustrations/profile.svg",
|
|
109
|
+
imageAlt: "Profile Not Complete Illustration"
|
|
110
|
+
}
|
|
83
111
|
}
|
|
84
112
|
};
|
|
85
113
|
var useStyles = makeStyles({
|
|
@@ -189,7 +217,9 @@ var MODAL_PRESETS = {
|
|
|
189
217
|
RADIUS: getModalPreset("RADIUS", "id"),
|
|
190
218
|
SESSION_EXPIRED: getModalPreset("SESSION_EXPIRED", "id"),
|
|
191
219
|
PURCHASE_PERIOD_EXPIRED: getModalPreset("PURCHASE_PERIOD_EXPIRED", "id"),
|
|
192
|
-
TRANSACTION_LIMIT: getModalPreset("TRANSACTION_LIMIT", "id")
|
|
220
|
+
TRANSACTION_LIMIT: getModalPreset("TRANSACTION_LIMIT", "id"),
|
|
221
|
+
UNAUTHENTICATED: getModalPreset("UNAUTHENTICATED", "id"),
|
|
222
|
+
PROFILE_NOT_COMPLETE: getModalPreset("PROFILE_NOT_COMPLETE", "id")
|
|
193
223
|
};
|
|
194
224
|
|
|
195
225
|
// src/components/CarouselWithCustomNav/CarouselWithCustomNav.constants.ts
|
|
@@ -238,6 +268,8 @@ var fontWeight = {
|
|
|
238
268
|
var sharedColors = {
|
|
239
269
|
"Shared_Cranberry_Primary": "#c50f1f",
|
|
240
270
|
"Shared_Red_Primary": "#d13438",
|
|
271
|
+
"Shared_Orange_Shade_20": "#bc4b09",
|
|
272
|
+
"Shared_Orange_Tint_60": "#fff9f5",
|
|
241
273
|
"Shared_Green_Primary": "#107c10"};
|
|
242
274
|
var lightModeColors = {
|
|
243
275
|
"Neutral_Foreground_Disabled_Rest": "#bdbdbd",
|
|
@@ -1112,7 +1144,8 @@ var DEFAULT_LABELS5 = {
|
|
|
1112
1144
|
selectTicketButton: "Pilih Tiket",
|
|
1113
1145
|
timezoneLabel: "WIB",
|
|
1114
1146
|
currencySymbol: "IDR",
|
|
1115
|
-
logoAlt: "Logo ASDP"
|
|
1147
|
+
logoAlt: "Logo ASDP",
|
|
1148
|
+
verifyingTicketButton: "Memeriksa Tiket"
|
|
1116
1149
|
},
|
|
1117
1150
|
en: {
|
|
1118
1151
|
availableSeatsLabel: "Available",
|
|
@@ -1124,7 +1157,8 @@ var DEFAULT_LABELS5 = {
|
|
|
1124
1157
|
selectTicketButton: "Select Ticket",
|
|
1125
1158
|
timezoneLabel: "WIB",
|
|
1126
1159
|
currencySymbol: "IDR",
|
|
1127
|
-
logoAlt: "ASDP Logo"
|
|
1160
|
+
logoAlt: "ASDP Logo",
|
|
1161
|
+
verifyingTicketButton: "Verifying Ticket"
|
|
1128
1162
|
}
|
|
1129
1163
|
};
|
|
1130
1164
|
|
|
@@ -1340,7 +1374,8 @@ var CardTicket = ({
|
|
|
1340
1374
|
onPriceDetailClick,
|
|
1341
1375
|
onPolicyClick,
|
|
1342
1376
|
onSelectTicket,
|
|
1343
|
-
isLoading = false
|
|
1377
|
+
isLoading = false,
|
|
1378
|
+
isVerifyingTicket = false
|
|
1344
1379
|
}) => {
|
|
1345
1380
|
const styles = useStyles5();
|
|
1346
1381
|
const { width } = useWindowSize();
|
|
@@ -1690,8 +1725,13 @@ var CardTicket = ({
|
|
|
1690
1725
|
style: { backgroundColor: brandColors["60"] },
|
|
1691
1726
|
size: "medium",
|
|
1692
1727
|
shape: "circular",
|
|
1693
|
-
icon: /* @__PURE__ */ jsx(Icon, { icon: "fluent:ticket-diagonal-24-filled" }),
|
|
1694
|
-
|
|
1728
|
+
icon: isVerifyingTicket ? null : /* @__PURE__ */ jsx(Icon, { icon: "fluent:ticket-diagonal-24-filled" }),
|
|
1729
|
+
disabled: isVerifyingTicket,
|
|
1730
|
+
children: isVerifyingTicket ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1731
|
+
/* @__PURE__ */ jsx(Spinner, { size: "extra-tiny", style: { marginRight: "5px" } }),
|
|
1732
|
+
" ",
|
|
1733
|
+
mergedLabels.verifyingTicketButton
|
|
1734
|
+
] }) : buttonText || mergedLabels.selectTicketButton
|
|
1695
1735
|
}
|
|
1696
1736
|
)
|
|
1697
1737
|
] }),
|
|
@@ -8739,18 +8779,18 @@ var DEFAULT_LABELS16 = {
|
|
|
8739
8779
|
}
|
|
8740
8780
|
};
|
|
8741
8781
|
var getSortOptions = (labels) => [
|
|
8742
|
-
{ value: "
|
|
8743
|
-
{ value: "
|
|
8744
|
-
{ value: "
|
|
8745
|
-
{ value: "
|
|
8746
|
-
{ value: "
|
|
8782
|
+
{ value: "recommended", sortBy: "recommendation", sortDir: "ASC", label: labels.recommendation },
|
|
8783
|
+
{ value: "price-desc", sortBy: "price", sortDir: "DESC", label: labels.highestPrice },
|
|
8784
|
+
{ value: "price-asc", sortBy: "price", sortDir: "ASC", label: labels.lowestPrice },
|
|
8785
|
+
{ value: "departure-asc", sortBy: "departure", sortDir: "ASC", label: labels.earliestDeparture },
|
|
8786
|
+
{ value: "departure-desc", sortBy: "departure", sortDir: "DESC", label: labels.latestDeparture }
|
|
8747
8787
|
];
|
|
8748
8788
|
var DEFAULT_SORT_OPTIONS = [
|
|
8749
|
-
{ value: "
|
|
8750
|
-
{ value: "
|
|
8751
|
-
{ value: "
|
|
8752
|
-
{ value: "
|
|
8753
|
-
{ value: "
|
|
8789
|
+
{ value: "recommended", sortBy: "recommendation", sortDir: "ASC", label: "Rekomendasi" },
|
|
8790
|
+
{ value: "price-desc", sortBy: "price", sortDir: "DESC", label: "Harga Tertinggi" },
|
|
8791
|
+
{ value: "price-asc", sortBy: "price", sortDir: "ASC", label: "Harga Terendah" },
|
|
8792
|
+
{ value: "departure-asc", sortBy: "departure", sortDir: "ASC", label: "Keberangkatan Paling Awal" },
|
|
8793
|
+
{ value: "departure-desc", sortBy: "departure", sortDir: "DESC", label: "Keberangkatan Paling Akhir" }
|
|
8754
8794
|
];
|
|
8755
8795
|
var getSortLabel = (value) => {
|
|
8756
8796
|
const option = DEFAULT_SORT_OPTIONS.find((opt) => opt.value === value);
|
|
@@ -8824,8 +8864,9 @@ var SortMenu = ({
|
|
|
8824
8864
|
() => sortOptions.find((opt) => opt.value === value)?.label || labels.recommendation,
|
|
8825
8865
|
[sortOptions, value, labels.recommendation]
|
|
8826
8866
|
);
|
|
8867
|
+
const defaultOption = sortOptions.find((opt) => opt.value === "recommended") || sortOptions[0];
|
|
8827
8868
|
const handleReset = () => {
|
|
8828
|
-
onChange(
|
|
8869
|
+
onChange(defaultOption);
|
|
8829
8870
|
};
|
|
8830
8871
|
return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
8831
8872
|
onFilterClick && /* @__PURE__ */ jsx(
|
|
@@ -8857,7 +8898,10 @@ var SortMenu = ({
|
|
|
8857
8898
|
RadioGroup,
|
|
8858
8899
|
{
|
|
8859
8900
|
value,
|
|
8860
|
-
onChange: (_, data) =>
|
|
8901
|
+
onChange: (_, data) => {
|
|
8902
|
+
const selected = sortOptions.find((opt) => opt.value === data.value);
|
|
8903
|
+
if (selected) onChange(selected);
|
|
8904
|
+
},
|
|
8861
8905
|
children: sortOptions.map((option) => /* @__PURE__ */ jsx(
|
|
8862
8906
|
Radio,
|
|
8863
8907
|
{
|
|
@@ -9106,11 +9150,12 @@ var ModalFilterTicket = ({
|
|
|
9106
9150
|
};
|
|
9107
9151
|
}
|
|
9108
9152
|
}, [open]);
|
|
9109
|
-
const handleServiceTypeToggle = (
|
|
9110
|
-
|
|
9111
|
-
|
|
9153
|
+
const handleServiceTypeToggle = (service) => {
|
|
9154
|
+
const exists = selectedServiceTypes.some((s) => s.id === service.value);
|
|
9155
|
+
if (exists) {
|
|
9156
|
+
onServiceTypesChange(selectedServiceTypes.filter((s) => s.id !== service.value));
|
|
9112
9157
|
} else {
|
|
9113
|
-
onServiceTypesChange([...selectedServiceTypes, value]);
|
|
9158
|
+
onServiceTypesChange([...selectedServiceTypes, { id: service.value, label: service.label }]);
|
|
9114
9159
|
}
|
|
9115
9160
|
};
|
|
9116
9161
|
const handleDepartureTimeChange = (value, checked) => {
|
|
@@ -9286,8 +9331,8 @@ var ModalFilterTicket = ({
|
|
|
9286
9331
|
isLoading ? renderServiceTypesSkeleton() : /* @__PURE__ */ jsxs("div", { className: styles.section, children: [
|
|
9287
9332
|
/* @__PURE__ */ jsx(Body1, { children: mergedLabels.serviceTypeLabel }),
|
|
9288
9333
|
/* @__PURE__ */ jsx("div", { className: styles.buttonGrid, children: serviceTypes.map((service) => {
|
|
9289
|
-
const isSelected = selectedServiceTypes.
|
|
9290
|
-
service.value
|
|
9334
|
+
const isSelected = selectedServiceTypes.some(
|
|
9335
|
+
(s) => s.id === service.value
|
|
9291
9336
|
);
|
|
9292
9337
|
return /* @__PURE__ */ jsx(
|
|
9293
9338
|
Button,
|
|
@@ -9295,7 +9340,7 @@ var ModalFilterTicket = ({
|
|
|
9295
9340
|
appearance: isSelected ? "primary" : "outline",
|
|
9296
9341
|
className: isSelected ? "" : styles.outlinePrimary,
|
|
9297
9342
|
size: "large",
|
|
9298
|
-
onClick: () => handleServiceTypeToggle(service
|
|
9343
|
+
onClick: () => handleServiceTypeToggle(service),
|
|
9299
9344
|
style: { width: "100%" },
|
|
9300
9345
|
children: service.label
|
|
9301
9346
|
},
|
|
@@ -11849,6 +11894,25 @@ var useStyles25 = makeStyles({
|
|
|
11849
11894
|
height: "32px",
|
|
11850
11895
|
zIndex: 1,
|
|
11851
11896
|
filter: "drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.1))"
|
|
11897
|
+
},
|
|
11898
|
+
warningBanner: {
|
|
11899
|
+
display: "flex",
|
|
11900
|
+
alignItems: "center",
|
|
11901
|
+
gap: "0.75rem",
|
|
11902
|
+
backgroundColor: sharedColors.Shared_Orange_Tint_60,
|
|
11903
|
+
border: `1px solid ${sharedColors.Shared_Orange_Shade_20}`,
|
|
11904
|
+
borderRadius: tokens.borderRadiusLarge,
|
|
11905
|
+
padding: "0.75rem 1rem",
|
|
11906
|
+
marginBottom: "1.5rem"
|
|
11907
|
+
},
|
|
11908
|
+
warningIcon: {
|
|
11909
|
+
color: sharedColors.Shared_Orange_Shade_20,
|
|
11910
|
+
flexShrink: 0,
|
|
11911
|
+
display: "flex"
|
|
11912
|
+
},
|
|
11913
|
+
warningText: {
|
|
11914
|
+
color: sharedColors.Shared_Orange_Shade_20,
|
|
11915
|
+
fontSize: tokens.fontSizeBase300
|
|
11852
11916
|
}
|
|
11853
11917
|
});
|
|
11854
11918
|
var CardPassengerList = ({
|
|
@@ -11867,6 +11931,10 @@ var CardPassengerList = ({
|
|
|
11867
11931
|
/* @__PURE__ */ jsx(Title3, { className: styles.headerTitle, children: displayTitle }),
|
|
11868
11932
|
/* @__PURE__ */ jsx("div", { className: styles.headerLine })
|
|
11869
11933
|
] }),
|
|
11934
|
+
passengers.filter((p) => p.id).length !== passengers.length && /* @__PURE__ */ jsxs("div", { className: styles.warningBanner, children: [
|
|
11935
|
+
/* @__PURE__ */ jsx("div", { className: styles.warningIcon, children: /* @__PURE__ */ jsx(Icon, { icon: "fluent:warning-20-filled", width: 24, height: 24 }) }),
|
|
11936
|
+
/* @__PURE__ */ jsx("div", { className: styles.warningText, children: "Harap isi data penumpang dibawah ini untuk bisa melanjutkan pembelian tiket." })
|
|
11937
|
+
] }),
|
|
11870
11938
|
/* @__PURE__ */ jsx("div", { className: styles.passengerList, children: passengers.map((passenger, index) => {
|
|
11871
11939
|
const badgeConfig = getBadgeConfig(passenger.serviceName);
|
|
11872
11940
|
return /* @__PURE__ */ jsxs(
|
|
@@ -11884,7 +11952,7 @@ var CardPassengerList = ({
|
|
|
11884
11952
|
},
|
|
11885
11953
|
children: [
|
|
11886
11954
|
/* @__PURE__ */ jsx("div", { className: styles.passengerInfo, children: /* @__PURE__ */ jsxs(Subtitle2, { className: styles.passengerText, children: [
|
|
11887
|
-
passenger.
|
|
11955
|
+
passenger.fullName || `${mergedLabels.passengerPrefix} ${index + 1}`,
|
|
11888
11956
|
" ",
|
|
11889
11957
|
"(",
|
|
11890
11958
|
passenger.passengerType,
|
|
@@ -11916,7 +11984,7 @@ var CardPassengerList = ({
|
|
|
11916
11984
|
/* @__PURE__ */ jsx(
|
|
11917
11985
|
Icon,
|
|
11918
11986
|
{
|
|
11919
|
-
icon: passenger.
|
|
11987
|
+
icon: passenger.id && passenger.serviceName ? "fluent:edit-24-regular" : "fluent:chevron-right-24-regular",
|
|
11920
11988
|
width: 20,
|
|
11921
11989
|
height: 20
|
|
11922
11990
|
}
|