@asdp/ferryui 0.1.22-dev.10403 → 0.1.22-dev.10424

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 CHANGED
@@ -3145,6 +3145,9 @@ interface CardBookingTicketLabels {
3145
3145
  routeTitle: string;
3146
3146
  estimationPrefix: string;
3147
3147
  totalPriceLabel: string;
3148
+ agreementPrefix: string;
3149
+ termsAndConditions: string;
3150
+ agreementSuffix: string;
3148
3151
  nextButton: string;
3149
3152
  cancelButton: string;
3150
3153
  previousButton: string;
@@ -3156,6 +3159,7 @@ interface CardBookingTicketLabels {
3156
3159
  cancelDialogBody: string;
3157
3160
  cancelDialogConfirm: string;
3158
3161
  cancelDialogDismiss: string;
3162
+ nextPaymentButton: string;
3159
3163
  }
3160
3164
  interface CardBookingTicketProps {
3161
3165
  /**
@@ -3235,6 +3239,10 @@ interface CardBookingTicketProps {
3235
3239
  * Callback for price detail click
3236
3240
  */
3237
3241
  onPriceDetailClick: () => void;
3242
+ /**
3243
+ * Optional click handler for Terms & Conditions text inside the review checkbox
3244
+ */
3245
+ onTermsAndConditionsClick?: () => void;
3238
3246
  onCancel: () => void;
3239
3247
  /**
3240
3248
  * Callback for Next button (Lanjutkan / Lihat Pemesanan)
package/dist/index.d.ts CHANGED
@@ -3145,6 +3145,9 @@ interface CardBookingTicketLabels {
3145
3145
  routeTitle: string;
3146
3146
  estimationPrefix: string;
3147
3147
  totalPriceLabel: string;
3148
+ agreementPrefix: string;
3149
+ termsAndConditions: string;
3150
+ agreementSuffix: string;
3148
3151
  nextButton: string;
3149
3152
  cancelButton: string;
3150
3153
  previousButton: string;
@@ -3156,6 +3159,7 @@ interface CardBookingTicketLabels {
3156
3159
  cancelDialogBody: string;
3157
3160
  cancelDialogConfirm: string;
3158
3161
  cancelDialogDismiss: string;
3162
+ nextPaymentButton: string;
3159
3163
  }
3160
3164
  interface CardBookingTicketProps {
3161
3165
  /**
@@ -3235,6 +3239,10 @@ interface CardBookingTicketProps {
3235
3239
  * Callback for price detail click
3236
3240
  */
3237
3241
  onPriceDetailClick: () => void;
3242
+ /**
3243
+ * Optional click handler for Terms & Conditions text inside the review checkbox
3244
+ */
3245
+ onTermsAndConditionsClick?: () => void;
3238
3246
  onCancel: () => void;
3239
3247
  /**
3240
3248
  * Callback for Next button (Lanjutkan / Lihat Pemesanan)
package/dist/index.js CHANGED
@@ -13892,6 +13892,9 @@ var DEFAULT_LABELS27 = {
13892
13892
  routeTitle: "Rute Perjalanan",
13893
13893
  estimationPrefix: "Estimasi",
13894
13894
  totalPriceLabel: "Total Harga",
13895
+ agreementPrefix: "Saya menyetujui",
13896
+ termsAndConditions: "Syarat & Ketentuan",
13897
+ agreementSuffix: "Ferizy",
13895
13898
  nextButton: "Lanjutkan",
13896
13899
  cancelButton: "Batalkan Pesanan",
13897
13900
  previousButton: "Sebelumnya",
@@ -13902,13 +13905,17 @@ var DEFAULT_LABELS27 = {
13902
13905
  cancelDialogTitle: "Buang perubahan?",
13903
13906
  cancelDialogBody: "Perubahan belum disimpan dan akan hilang jika Anda melanjutkan.",
13904
13907
  cancelDialogConfirm: "Buang Perubahan",
13905
- cancelDialogDismiss: "Batal"
13908
+ cancelDialogDismiss: "Batal",
13909
+ nextPaymentButton: "Lanjut ke Pembayaran"
13906
13910
  },
13907
13911
  en: {
13908
13912
  bookingDetails: "Booking Details",
13909
13913
  routeTitle: "Travel Route",
13910
13914
  estimationPrefix: "Estimation",
13911
13915
  totalPriceLabel: "Total Price",
13916
+ agreementPrefix: "I agree to the",
13917
+ termsAndConditions: "Terms & Conditions",
13918
+ agreementSuffix: "Ferizy",
13912
13919
  nextButton: "Continue",
13913
13920
  cancelButton: "Cancel Booking",
13914
13921
  previousButton: "Previous",
@@ -13919,7 +13926,8 @@ var DEFAULT_LABELS27 = {
13919
13926
  cancelDialogTitle: "Discard changes?",
13920
13927
  cancelDialogBody: "Changes have not been saved and will be lost if you continue.",
13921
13928
  cancelDialogConfirm: "Discard Changes",
13922
- cancelDialogDismiss: "Cancel"
13929
+ cancelDialogDismiss: "Cancel",
13930
+ nextPaymentButton: "Proceed to Payment"
13923
13931
  }
13924
13932
  };
13925
13933
  var useStyles28 = reactComponents.makeStyles({
@@ -13994,6 +14002,12 @@ var useStyles28 = reactComponents.makeStyles({
13994
14002
  gap: "1rem"
13995
14003
  },
13996
14004
  ticketInfo: {
14005
+ display: "flex",
14006
+ justifyContent: "space-between",
14007
+ alignItems: "center",
14008
+ gap: "0.5em"
14009
+ },
14010
+ ticketinfoCard: {
13997
14011
  display: "flex",
13998
14012
  justifyContent: "space-between",
13999
14013
  alignItems: "center",
@@ -14089,6 +14103,7 @@ var CardBookingTicket = ({
14089
14103
  reservationStep,
14090
14104
  paymentStep,
14091
14105
  onPriceDetailClick,
14106
+ onTermsAndConditionsClick,
14092
14107
  onCancel,
14093
14108
  onNext,
14094
14109
  onPrevious,
@@ -14097,6 +14112,11 @@ var CardBookingTicket = ({
14097
14112
  const styles = useStyles28();
14098
14113
  const mergedLabels = { ...DEFAULT_LABELS27[language], ...labels };
14099
14114
  const [cancelDialogOpen, setCancelDialogOpen] = React.useState(false);
14115
+ const [isTermsAccepted, setIsTermsAccepted] = React.useState(false);
14116
+ const handleTermsAndConditionsClick = () => {
14117
+ onTermsAndConditionsClick?.();
14118
+ };
14119
+ const isNextButtonDisabled = disableNextButton || reservationStep === "review" && !isTermsAccepted;
14100
14120
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles.container} ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.bookingDetail, children: [
14101
14121
  /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Card, { className: styles.bookingDetailTop, children: [
14102
14122
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle1, { children: mergedLabels.bookingDetails }),
@@ -14150,26 +14170,32 @@ var CardBookingTicket = ({
14150
14170
  }
14151
14171
  ),
14152
14172
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Strong, { children: mergedLabels.routeTitle }),
14153
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.ticketInfo, children: [
14154
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.ticketTime, children: [
14155
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: departureDay }),
14156
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Stronger, { children: departureTime }),
14157
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: departureLocation })
14158
- ] }),
14159
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.ticketDuration, children: [
14160
- /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:vehicle-ship-24-regular" }),
14161
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Caption2, { children: [
14162
- mergedLabels.estimationPrefix,
14163
- " ",
14164
- formatDuration(duration)
14165
- ] })
14166
- ] }),
14167
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.ticketTime, children: [
14168
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: arrivalDay }),
14169
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Stronger, { children: arrivalTime }),
14170
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: arrivalLocation })
14171
- ] })
14172
- ] }) }),
14173
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
14174
+ "div",
14175
+ {
14176
+ className: reservationStep === "review" ? styles.ticketinfoCard : styles.ticketInfo,
14177
+ children: [
14178
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.ticketTime, children: [
14179
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: departureDay }),
14180
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Stronger, { children: departureTime }),
14181
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: departureLocation })
14182
+ ] }),
14183
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.ticketDuration, children: [
14184
+ /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:vehicle-ship-24-regular" }),
14185
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Caption2, { children: [
14186
+ mergedLabels.estimationPrefix,
14187
+ " ",
14188
+ formatDuration(duration)
14189
+ ] })
14190
+ ] }),
14191
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.ticketTime, children: [
14192
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: arrivalDay }),
14193
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Stronger, { children: arrivalTime }),
14194
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { children: arrivalLocation })
14195
+ ] })
14196
+ ]
14197
+ }
14198
+ ) }),
14173
14199
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.circularLeft }),
14174
14200
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.circularRight })
14175
14201
  ] }),
@@ -14205,15 +14231,28 @@ var CardBookingTicket = ({
14205
14231
  reservationStep === "review" && /* @__PURE__ */ jsxRuntime.jsx(
14206
14232
  reactComponents.Checkbox,
14207
14233
  {
14234
+ checked: isTermsAccepted,
14235
+ onChange: (_, data) => setIsTermsAccepted(!!data.checked),
14208
14236
  label: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { children: [
14209
- "Saya menyetujui",
14237
+ mergedLabels.agreementPrefix,
14210
14238
  " ",
14211
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: brandColors[80] }, children: [
14212
- " ",
14213
- "Syarat & Ketentuan"
14214
- ] }),
14239
+ /* @__PURE__ */ jsxRuntime.jsx(
14240
+ "button",
14241
+ {
14242
+ type: "button",
14243
+ onClick: handleTermsAndConditionsClick,
14244
+ style: {
14245
+ color: brandColors[80],
14246
+ background: "transparent",
14247
+ border: "none",
14248
+ padding: 0,
14249
+ cursor: "pointer"
14250
+ },
14251
+ children: mergedLabels.termsAndConditions
14252
+ }
14253
+ ),
14215
14254
  " ",
14216
- "ferizy"
14255
+ mergedLabels.agreementSuffix
14217
14256
  ] })
14218
14257
  }
14219
14258
  ),
@@ -14222,17 +14261,17 @@ var CardBookingTicket = ({
14222
14261
  reactComponents.Button,
14223
14262
  {
14224
14263
  appearance: "primary",
14225
- disabled: disableNextButton,
14264
+ disabled: isNextButtonDisabled,
14226
14265
  onClick: onNext,
14227
14266
  shape: "circular",
14228
14267
  size: "large",
14229
14268
  style: { width: "100%" },
14230
14269
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:chevron-right-20-regular" }),
14231
14270
  iconPosition: "after",
14232
- children: mergedLabels.nextButton
14271
+ children: reservationStep === "review" ? mergedLabels.nextPaymentButton : mergedLabels.nextButton
14233
14272
  }
14234
14273
  ),
14235
- ["addon", "meals", "review", "payment", "eticket"].includes(
14274
+ ["addon", "meals", "review", "eticket"].includes(
14236
14275
  reservationStep
14237
14276
  ) && !["pay"].includes(paymentStep) && /* @__PURE__ */ jsxRuntime.jsx(
14238
14277
  reactComponents.Button,
@@ -14247,31 +14286,18 @@ var CardBookingTicket = ({
14247
14286
  children: mergedLabels.previousButton
14248
14287
  }
14249
14288
  ),
14250
- paymentStep === "pay" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14251
- /* @__PURE__ */ jsxRuntime.jsx(
14252
- reactComponents.Button,
14253
- {
14254
- appearance: "primary",
14255
- disabled: disableNextButton,
14256
- onClick: onNext,
14257
- shape: "circular",
14258
- size: "large",
14259
- style: { width: "100%" },
14260
- children: mergedLabels.viewBookingButton
14261
- }
14262
- ),
14263
- /* @__PURE__ */ jsxRuntime.jsx(
14264
- reactComponents.Button,
14265
- {
14266
- appearance: "secondary",
14267
- shape: "circular",
14268
- size: "large",
14269
- className: styles.secondaryButton,
14270
- onClick: onPrevious,
14271
- children: mergedLabels.changePaymentButton
14272
- }
14273
- )
14274
- ] }),
14289
+ paymentStep === "pay" && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
14290
+ reactComponents.Button,
14291
+ {
14292
+ appearance: "primary",
14293
+ disabled: disableNextButton,
14294
+ onClick: onNext,
14295
+ shape: "circular",
14296
+ size: "large",
14297
+ style: { width: "100%" },
14298
+ children: mergedLabels.viewBookingButton
14299
+ }
14300
+ ) }),
14275
14301
  reservationStep === "manifest" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14276
14302
  /* @__PURE__ */ jsxRuntime.jsx(
14277
14303
  reactComponents.Button,