@asdp/ferryui 0.1.22-dev.9767 → 0.1.22-dev.9789

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.js CHANGED
@@ -1709,7 +1709,7 @@ var CardTicket = ({
1709
1709
  },
1710
1710
  children: [
1711
1711
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle2, { children: mergedLabels.totalPriceLabel }),
1712
- /* @__PURE__ */ jsxRuntime.jsxs(
1712
+ /* @__PURE__ */ jsxRuntime.jsx(
1713
1713
  reactComponents.Title3,
1714
1714
  {
1715
1715
  style: {
@@ -1717,11 +1717,7 @@ var CardTicket = ({
1717
1717
  flex: "column",
1718
1718
  justifyContent: "end"
1719
1719
  },
1720
- children: [
1721
- mergedLabels.currencySymbol,
1722
- "\xA0",
1723
- departureItem?.billingDetail?.total?.formatted
1724
- ]
1720
+ children: departureItem?.billingDetail?.total?.formatted
1725
1721
  }
1726
1722
  )
1727
1723
  ]
@@ -4260,14 +4256,29 @@ var InputDynamic = ({
4260
4256
  const shouldFocusRef = React.useRef(false);
4261
4257
  const isBackspaceNavigationRef = React.useRef(false);
4262
4258
  const rawEmailOrPhoneInputRef = React.useRef("");
4259
+ const wrapperRef = React.useRef(null);
4263
4260
  const [selectPortalTarget, setSelectPortalTarget] = React.useState(null);
4261
+ const [isMobile, setIsMobile] = React.useState(false);
4262
+ const [isInsideDialog, setIsInsideDialog] = React.useState(false);
4264
4263
  React.useEffect(() => {
4265
- if (typeof document !== "undefined") {
4266
- const provider = document.querySelector(
4267
- ".fui-FluentProvider"
4264
+ if (typeof document === "undefined" || typeof window === "undefined") return;
4265
+ const provider = document.querySelector(
4266
+ ".fui-FluentProvider"
4267
+ );
4268
+ setSelectPortalTarget(provider ?? document.body);
4269
+ const MOBILE_BREAKPOINT = 768;
4270
+ const checkMobile = () => setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
4271
+ checkMobile();
4272
+ window.addEventListener("resize", checkMobile);
4273
+ if (wrapperRef.current) {
4274
+ const dialog = wrapperRef.current.closest(
4275
+ ".fui-DialogBody, [role='dialog']"
4268
4276
  );
4269
- setSelectPortalTarget(provider ?? document.body);
4277
+ setIsInsideDialog(!!dialog);
4270
4278
  }
4279
+ return () => {
4280
+ window.removeEventListener("resize", checkMobile);
4281
+ };
4271
4282
  }, []);
4272
4283
  const getPhoneInputValue = (val) => {
4273
4284
  let cleaned = val.startsWith("+") ? stripNonDigits(val.substring(1)) : stripNonDigits(val);
@@ -4371,7 +4382,9 @@ var InputDynamic = ({
4371
4382
  menuList: (provided) => ({
4372
4383
  ...provided,
4373
4384
  padding: 0,
4374
- maxHeight: "300px",
4385
+ // On mobile inside a Dialog: limit height to 200px to prevent viewport overflow.
4386
+ // Otherwise keep 300px. Breakpoint: designTokens.breakpoints.md = 768px.
4387
+ maxHeight: isMobile && isInsideDialog ? "180px" : "300px",
4375
4388
  /* Targetkan Webkit Scrollbar di menuList */
4376
4389
  "&::-webkit-scrollbar": {
4377
4390
  width: "8px",
@@ -5391,7 +5404,7 @@ var InputDynamic = ({
5391
5404
  }
5392
5405
  return rules;
5393
5406
  };
5394
- return /* @__PURE__ */ jsxRuntime.jsx(
5407
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: { display: "contents" }, children: /* @__PURE__ */ jsxRuntime.jsx(
5395
5408
  reactHookForm.Controller,
5396
5409
  {
5397
5410
  name,
@@ -5451,7 +5464,7 @@ var InputDynamic = ({
5451
5464
  }
5452
5465
  )
5453
5466
  }
5454
- );
5467
+ ) });
5455
5468
  };
5456
5469
  var InputDynamic_default = InputDynamic;
5457
5470
 
@@ -5463,7 +5476,7 @@ var DEFAULT_LABELS8 = {
5463
5476
  departureDateLabel: "Tanggal Berangkat",
5464
5477
  returnDateLabel: "Tanggal Pulang",
5465
5478
  serviceClassLabel: "Kelas Layanan",
5466
- typeOfServiceLabel: "Jenis Layanan",
5479
+ typeOfServiceLabel: "Jenis Penumpang",
5467
5480
  passengerLabel: "Penumpang",
5468
5481
  roundTripLabel: "Pulang Pergi",
5469
5482
  searchButton: "Cari Tiket",
@@ -5472,7 +5485,7 @@ var DEFAULT_LABELS8 = {
5472
5485
  placeholderDepartureDate: "Pilih Tanggal Keberangkatan",
5473
5486
  placeholderReturnDate: "Pilih Tanggal Kepulangan",
5474
5487
  placeholderTypeClass: "Pilih Kelas Layanan",
5475
- placeholderTypeService: "Pilih Jenis Layanan",
5488
+ placeholderTypeService: "Pilih Jenis Penumpang",
5476
5489
  placeholderPassenger: "Pilih Jumlah Penumpang",
5477
5490
  errorOriginRequired: "Pelabuhan asal wajib diisi",
5478
5491
  errorDestinationRequired: "Pelabuhan tujuan wajib diisi",
@@ -5491,7 +5504,7 @@ var DEFAULT_LABELS8 = {
5491
5504
  departureDateLabel: "Departure Date",
5492
5505
  returnDateLabel: "Return Date",
5493
5506
  serviceClassLabel: "Service Class",
5494
- typeOfServiceLabel: "Service Type",
5507
+ typeOfServiceLabel: "Type Of Passenger",
5495
5508
  passengerLabel: "Passenger",
5496
5509
  roundTripLabel: "Round Trip",
5497
5510
  searchButton: "Search Ticket",
@@ -6168,7 +6181,7 @@ var DEFAULT_LABELS9 = {
6168
6181
  destinationHarbor: "Pelabuhan Tujuan",
6169
6182
  departureDate: "Tanggal Keberangkatan",
6170
6183
  serviceClass: "Kelas Layanan",
6171
- typeOfService: "Jenis Layanan",
6184
+ typeOfService: "Jenis Penumpang",
6172
6185
  totalPassengers: "Jumlah Penumpang",
6173
6186
  changeSearchButton: "Ganti Pencarian",
6174
6187
  swapAriaLabel: "Tukar asal dan tujuan"
@@ -6178,7 +6191,7 @@ var DEFAULT_LABELS9 = {
6178
6191
  destinationHarbor: "Destination Port",
6179
6192
  departureDate: "Departure Date",
6180
6193
  serviceClass: "Service Class",
6181
- typeOfService: "Service Type",
6194
+ typeOfService: "Type Of Passenger",
6182
6195
  totalPassengers: "Total Passengers",
6183
6196
  changeSearchButton: "Change Search",
6184
6197
  swapAriaLabel: "Swap origin and destination"
@@ -8294,20 +8307,20 @@ var ModalTotalPassengers = ({
8294
8307
  // src/components/ModalTypeOfService/ModalTypeOfService.constants.ts
8295
8308
  var DEFAULT_LABELS15 = {
8296
8309
  id: {
8297
- title: "Pilih Jenis Layanan",
8310
+ title: "Pilih Jenis Penumpang",
8298
8311
  cancelButton: "Batal",
8299
8312
  saveButton: "Simpan",
8300
8313
  vehiclesAlt: "kendaraan",
8301
8314
  closeAriaLabel: "Tutup",
8302
- emptyContent: "Jenis Layanan"
8315
+ emptyContent: "Jenis Penumpang"
8303
8316
  },
8304
8317
  en: {
8305
- title: "Select Service Type",
8318
+ title: "Select Type Of Passenger",
8306
8319
  cancelButton: "Cancel",
8307
8320
  saveButton: "Save",
8308
8321
  vehiclesAlt: "vehicles",
8309
8322
  closeAriaLabel: "Close",
8310
- emptyContent: "Service Type"
8323
+ emptyContent: "Type Of Passenger"
8311
8324
  }
8312
8325
  };
8313
8326
  var DEFAULT_VEHICLE_ICONS = {
@@ -8502,7 +8515,8 @@ var HoverableRadioItem = ({
8502
8515
  item,
8503
8516
  imageRenderer,
8504
8517
  styles,
8505
- isChild = false
8518
+ isChild = false,
8519
+ onClick
8506
8520
  }) => {
8507
8521
  const [isHovered, setIsHovered] = React.useState(false);
8508
8522
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -8512,6 +8526,7 @@ var HoverableRadioItem = ({
8512
8526
  style: { padding: reactComponents.tokens.spacingHorizontalXS, cursor: "pointer" },
8513
8527
  onMouseEnter: () => setIsHovered(true),
8514
8528
  onMouseLeave: () => setIsHovered(false),
8529
+ onClick,
8515
8530
  children: [
8516
8531
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: isChild ? void 0 : { marginLeft: 2 }, children: imageRenderer({
8517
8532
  src: item.image,
@@ -8732,7 +8747,8 @@ var ModalTypeOfService = ({
8732
8747
  item: childItem,
8733
8748
  imageRenderer,
8734
8749
  styles,
8735
- isChild: true
8750
+ isChild: true,
8751
+ onClick: () => setSelectedServiceId(childItem.id)
8736
8752
  },
8737
8753
  childIndex
8738
8754
  )) })
@@ -8747,7 +8763,8 @@ var ModalTypeOfService = ({
8747
8763
  item,
8748
8764
  imageRenderer,
8749
8765
  styles,
8750
- isChild: false
8766
+ isChild: false,
8767
+ onClick: () => setSelectedServiceId(item.id)
8751
8768
  },
8752
8769
  index
8753
8770
  );
@@ -8984,7 +9001,7 @@ var SortMenu = ({
8984
9001
  var DEFAULT_LABELS17 = {
8985
9002
  id: {
8986
9003
  title: "Filter dengan",
8987
- serviceTypeLabel: "Jenis Layanan",
9004
+ serviceTypeLabel: "Jenis Penumpang",
8988
9005
  departureTimeLabel: "Waktu pergi",
8989
9006
  arrivalTimeLabel: "Waktu tiba",
8990
9007
  priceLabel: "Harga",