@asdp/ferryui 0.1.22-dev.9700 → 0.1.22-dev.9705
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 +48 -11
- package/dist/index.d.ts +48 -11
- package/dist/index.js +74 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -32
- 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
|
|
@@ -1114,7 +1144,8 @@ var DEFAULT_LABELS5 = {
|
|
|
1114
1144
|
selectTicketButton: "Pilih Tiket",
|
|
1115
1145
|
timezoneLabel: "WIB",
|
|
1116
1146
|
currencySymbol: "IDR",
|
|
1117
|
-
logoAlt: "Logo ASDP"
|
|
1147
|
+
logoAlt: "Logo ASDP",
|
|
1148
|
+
verifyingTicketButton: "Memeriksa Tiket"
|
|
1118
1149
|
},
|
|
1119
1150
|
en: {
|
|
1120
1151
|
availableSeatsLabel: "Available",
|
|
@@ -1126,7 +1157,8 @@ var DEFAULT_LABELS5 = {
|
|
|
1126
1157
|
selectTicketButton: "Select Ticket",
|
|
1127
1158
|
timezoneLabel: "WIB",
|
|
1128
1159
|
currencySymbol: "IDR",
|
|
1129
|
-
logoAlt: "ASDP Logo"
|
|
1160
|
+
logoAlt: "ASDP Logo",
|
|
1161
|
+
verifyingTicketButton: "Verifying Ticket"
|
|
1130
1162
|
}
|
|
1131
1163
|
};
|
|
1132
1164
|
|
|
@@ -1342,7 +1374,8 @@ var CardTicket = ({
|
|
|
1342
1374
|
onPriceDetailClick,
|
|
1343
1375
|
onPolicyClick,
|
|
1344
1376
|
onSelectTicket,
|
|
1345
|
-
isLoading = false
|
|
1377
|
+
isLoading = false,
|
|
1378
|
+
isVerifyingTicket = false
|
|
1346
1379
|
}) => {
|
|
1347
1380
|
const styles = useStyles5();
|
|
1348
1381
|
const { width } = useWindowSize();
|
|
@@ -1692,8 +1725,13 @@ var CardTicket = ({
|
|
|
1692
1725
|
style: { backgroundColor: brandColors["60"] },
|
|
1693
1726
|
size: "medium",
|
|
1694
1727
|
shape: "circular",
|
|
1695
|
-
icon: /* @__PURE__ */ jsx(Icon, { icon: "fluent:ticket-diagonal-24-filled" }),
|
|
1696
|
-
|
|
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
|
|
1697
1735
|
}
|
|
1698
1736
|
)
|
|
1699
1737
|
] }),
|
|
@@ -8741,18 +8779,18 @@ var DEFAULT_LABELS16 = {
|
|
|
8741
8779
|
}
|
|
8742
8780
|
};
|
|
8743
8781
|
var getSortOptions = (labels) => [
|
|
8744
|
-
{ value: "
|
|
8745
|
-
{ value: "
|
|
8746
|
-
{ value: "
|
|
8747
|
-
{ value: "
|
|
8748
|
-
{ 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 }
|
|
8749
8787
|
];
|
|
8750
8788
|
var DEFAULT_SORT_OPTIONS = [
|
|
8751
|
-
{ value: "
|
|
8752
|
-
{ value: "
|
|
8753
|
-
{ value: "
|
|
8754
|
-
{ value: "
|
|
8755
|
-
{ 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" }
|
|
8756
8794
|
];
|
|
8757
8795
|
var getSortLabel = (value) => {
|
|
8758
8796
|
const option = DEFAULT_SORT_OPTIONS.find((opt) => opt.value === value);
|
|
@@ -8826,8 +8864,9 @@ var SortMenu = ({
|
|
|
8826
8864
|
() => sortOptions.find((opt) => opt.value === value)?.label || labels.recommendation,
|
|
8827
8865
|
[sortOptions, value, labels.recommendation]
|
|
8828
8866
|
);
|
|
8867
|
+
const defaultOption = sortOptions.find((opt) => opt.value === "recommended") || sortOptions[0];
|
|
8829
8868
|
const handleReset = () => {
|
|
8830
|
-
onChange(
|
|
8869
|
+
onChange(defaultOption);
|
|
8831
8870
|
};
|
|
8832
8871
|
return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
8833
8872
|
onFilterClick && /* @__PURE__ */ jsx(
|
|
@@ -8859,7 +8898,10 @@ var SortMenu = ({
|
|
|
8859
8898
|
RadioGroup,
|
|
8860
8899
|
{
|
|
8861
8900
|
value,
|
|
8862
|
-
onChange: (_, data) =>
|
|
8901
|
+
onChange: (_, data) => {
|
|
8902
|
+
const selected = sortOptions.find((opt) => opt.value === data.value);
|
|
8903
|
+
if (selected) onChange(selected);
|
|
8904
|
+
},
|
|
8863
8905
|
children: sortOptions.map((option) => /* @__PURE__ */ jsx(
|
|
8864
8906
|
Radio,
|
|
8865
8907
|
{
|
|
@@ -9108,11 +9150,12 @@ var ModalFilterTicket = ({
|
|
|
9108
9150
|
};
|
|
9109
9151
|
}
|
|
9110
9152
|
}, [open]);
|
|
9111
|
-
const handleServiceTypeToggle = (
|
|
9112
|
-
|
|
9113
|
-
|
|
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));
|
|
9114
9157
|
} else {
|
|
9115
|
-
onServiceTypesChange([...selectedServiceTypes, value]);
|
|
9158
|
+
onServiceTypesChange([...selectedServiceTypes, { id: service.value, label: service.label }]);
|
|
9116
9159
|
}
|
|
9117
9160
|
};
|
|
9118
9161
|
const handleDepartureTimeChange = (value, checked) => {
|
|
@@ -9288,8 +9331,8 @@ var ModalFilterTicket = ({
|
|
|
9288
9331
|
isLoading ? renderServiceTypesSkeleton() : /* @__PURE__ */ jsxs("div", { className: styles.section, children: [
|
|
9289
9332
|
/* @__PURE__ */ jsx(Body1, { children: mergedLabels.serviceTypeLabel }),
|
|
9290
9333
|
/* @__PURE__ */ jsx("div", { className: styles.buttonGrid, children: serviceTypes.map((service) => {
|
|
9291
|
-
const isSelected = selectedServiceTypes.
|
|
9292
|
-
service.value
|
|
9334
|
+
const isSelected = selectedServiceTypes.some(
|
|
9335
|
+
(s) => s.id === service.value
|
|
9293
9336
|
);
|
|
9294
9337
|
return /* @__PURE__ */ jsx(
|
|
9295
9338
|
Button,
|
|
@@ -9297,7 +9340,7 @@ var ModalFilterTicket = ({
|
|
|
9297
9340
|
appearance: isSelected ? "primary" : "outline",
|
|
9298
9341
|
className: isSelected ? "" : styles.outlinePrimary,
|
|
9299
9342
|
size: "large",
|
|
9300
|
-
onClick: () => handleServiceTypeToggle(service
|
|
9343
|
+
onClick: () => handleServiceTypeToggle(service),
|
|
9301
9344
|
style: { width: "100%" },
|
|
9302
9345
|
children: service.label
|
|
9303
9346
|
},
|
|
@@ -13347,23 +13390,23 @@ var useStyles28 = makeStyles({
|
|
|
13347
13390
|
},
|
|
13348
13391
|
circularLeft: {
|
|
13349
13392
|
position: "absolute",
|
|
13350
|
-
width: "
|
|
13351
|
-
height: "
|
|
13393
|
+
width: "75px",
|
|
13394
|
+
height: "75px",
|
|
13352
13395
|
borderRadius: "50%",
|
|
13353
13396
|
backgroundColor: tokens.colorNeutralBackground1Hover,
|
|
13354
13397
|
left: "-37px",
|
|
13355
|
-
bottom: "-
|
|
13398
|
+
bottom: "-42px",
|
|
13356
13399
|
zIndex: 2,
|
|
13357
13400
|
boxShadow: "inset -3px 0px 1px rgba(0, 0, 0, 0.1)"
|
|
13358
13401
|
},
|
|
13359
13402
|
circularRight: {
|
|
13360
13403
|
position: "absolute",
|
|
13361
|
-
width: "
|
|
13362
|
-
height: "
|
|
13404
|
+
width: "75px",
|
|
13405
|
+
height: "75px",
|
|
13363
13406
|
borderRadius: "50%",
|
|
13364
13407
|
backgroundColor: tokens.colorNeutralBackground1Hover,
|
|
13365
13408
|
right: "-37px",
|
|
13366
|
-
bottom: "-
|
|
13409
|
+
bottom: "-42px",
|
|
13367
13410
|
zIndex: 2,
|
|
13368
13411
|
boxShadow: "inset 3px 0px 1px rgba(0, 0, 0, 0.1)"
|
|
13369
13412
|
},
|