@asdp/ferryui 0.1.22-dev.10850 → 0.1.22-dev.10936

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.mjs CHANGED
@@ -7167,8 +7167,10 @@ var ModalSearchHarbor = ({
7167
7167
  const styles = useStyles12();
7168
7168
  const mergedLabels = { ...DEFAULT_LABELS10[language], ...labels };
7169
7169
  const isError = isErrorTravelPlan && isErrorPort;
7170
- const handleSelect = (harbor) => {
7171
- onAddLastSearched(harbor);
7170
+ const handleSelect = (harbor, addRecent = true) => {
7171
+ if (addRecent) {
7172
+ onAddLastSearched(harbor);
7173
+ }
7172
7174
  onSelectHarbor(harbor);
7173
7175
  onSearchChange("");
7174
7176
  };
@@ -7249,7 +7251,7 @@ var ModalSearchHarbor = ({
7249
7251
  /* @__PURE__ */ jsx("div", { className: styles.buttonContainer, children: favoriteHarbors.map((harbor) => /* @__PURE__ */ jsxs(
7250
7252
  Button,
7251
7253
  {
7252
- onClick: () => handleSelect(harbor),
7254
+ onClick: () => handleSelect(harbor, false),
7253
7255
  size: "medium",
7254
7256
  appearance: "subtle",
7255
7257
  iconPosition: "before",
@@ -7300,7 +7302,7 @@ var ModalSearchHarbor = ({
7300
7302
  HarborListItem,
7301
7303
  {
7302
7304
  harbor,
7303
- onSelect: handleSelect,
7305
+ onSelect: (harbor2) => handleSelect(harbor2, false),
7304
7306
  containerClassName: styles.historyItem,
7305
7307
  trailingIcon: showButtonFavorite && /* @__PURE__ */ jsx(
7306
7308
  Icon,
@@ -7322,7 +7324,7 @@ var ModalSearchHarbor = ({
7322
7324
  HarborListItem,
7323
7325
  {
7324
7326
  harbor,
7325
- onSelect: handleSelect,
7327
+ onSelect: (harbor2) => handleSelect(harbor2, false),
7326
7328
  containerClassName: styles.historyItem,
7327
7329
  trailingIcon: showButtonFavorite && /* @__PURE__ */ jsx(
7328
7330
  Icon,
@@ -7362,7 +7364,7 @@ var ModalSearchHarbor = ({
7362
7364
  HarborListItem,
7363
7365
  {
7364
7366
  harbor,
7365
- onSelect: handleSelect,
7367
+ onSelect: (harbor2) => handleSelect(harbor2, !!searchQuery),
7366
7368
  containerClassName: styles.harborItem,
7367
7369
  trailingIcon: showButtonFavorite && /* @__PURE__ */ jsx(
7368
7370
  Icon,
@@ -16533,6 +16535,17 @@ var useStyles38 = makeStyles({
16533
16535
  height: "40px",
16534
16536
  objectFit: "contain"
16535
16537
  },
16538
+ skeletonOption: {
16539
+ display: "flex",
16540
+ alignItems: "center",
16541
+ justifyContent: "space-between",
16542
+ width: "100%"
16543
+ },
16544
+ skeletonOptionLeft: {
16545
+ display: "flex",
16546
+ alignItems: "center",
16547
+ gap: tokens.spacingHorizontalL
16548
+ },
16536
16549
  card: {
16537
16550
  position: "relative",
16538
16551
  borderRadius: tokens.borderRadiusXLarge,
@@ -16549,13 +16562,53 @@ var CardPaymentMethodList = ({
16549
16562
  labels,
16550
16563
  methods,
16551
16564
  selectedValue,
16552
- onSelect
16565
+ onSelect,
16566
+ isLoading = false,
16567
+ skeletonCount = 3
16553
16568
  }) => {
16554
16569
  const styles = useStyles38();
16555
16570
  const mergedLabels = { ...DEFAULT_LABELS36[language], ...labels };
16556
16571
  return /* @__PURE__ */ jsx("div", { className: styles.card, children: /* @__PURE__ */ jsxs("div", { className: `${styles.container}`, children: [
16557
16572
  /* @__PURE__ */ jsx(Subtitle1, { children: mergedLabels.method }),
16558
- methods.map((category, index) => /* @__PURE__ */ jsxs("div", { children: [
16573
+ isLoading ? Array.from({ length: skeletonCount }).map((_, index) => /* @__PURE__ */ jsxs("div", { children: [
16574
+ index > 0 && /* @__PURE__ */ jsx("div", { className: styles.dividerContainer, children: /* @__PURE__ */ jsx(Divider, {}) }),
16575
+ /* @__PURE__ */ jsxs(Skeleton, { children: [
16576
+ /* @__PURE__ */ jsx(
16577
+ SkeletonItem,
16578
+ {
16579
+ style: {
16580
+ width: "60%",
16581
+ height: "20px",
16582
+ marginBottom: tokens.spacingVerticalXXL
16583
+ }
16584
+ }
16585
+ ),
16586
+ /* @__PURE__ */ jsxs("div", { className: styles.skeletonOption, children: [
16587
+ /* @__PURE__ */ jsxs("div", { className: styles.skeletonOptionLeft, children: [
16588
+ /* @__PURE__ */ jsx(
16589
+ SkeletonItem,
16590
+ {
16591
+ shape: "circle",
16592
+ style: { width: "40px", height: "40px" }
16593
+ }
16594
+ ),
16595
+ /* @__PURE__ */ jsx(
16596
+ SkeletonItem,
16597
+ {
16598
+ style: { width: "140px", height: "18px" }
16599
+ }
16600
+ )
16601
+ ] }),
16602
+ /* @__PURE__ */ jsx(
16603
+ SkeletonItem,
16604
+ {
16605
+ shape: "circle",
16606
+ style: { width: "20px", height: "20px" }
16607
+ }
16608
+ )
16609
+ ] })
16610
+ ] })
16611
+ ] }, `payment-method-skeleton-${index}`)) : methods.map((category, index) => /* @__PURE__ */ jsxs("div", { children: [
16559
16612
  index > 0 && /* @__PURE__ */ jsx("div", { className: styles.dividerContainer, children: /* @__PURE__ */ jsx(Divider, {}) }),
16560
16613
  /* @__PURE__ */ jsx(Accordion, { multiple: true, collapsible: true, children: /* @__PURE__ */ jsxs(AccordionItem, { value: category.value, children: [
16561
16614
  /* @__PURE__ */ jsx(
@@ -16639,6 +16692,17 @@ var useStyles39 = makeStyles({
16639
16692
  ),
16640
16693
  backgroundColor: tokens.colorNeutralBackground1,
16641
16694
  zIndex: 3
16695
+ },
16696
+ skeletonRow: {
16697
+ display: "flex",
16698
+ alignItems: "center",
16699
+ justifyContent: "space-between",
16700
+ width: "100%"
16701
+ },
16702
+ skeletonLeft: {
16703
+ display: "flex",
16704
+ alignItems: "center",
16705
+ gap: tokens.spacingHorizontalL
16642
16706
  }
16643
16707
  });
16644
16708
  var CardPaymentMethodFavorite = ({
@@ -16649,7 +16713,9 @@ var CardPaymentMethodFavorite = ({
16649
16713
  onSelect,
16650
16714
  onViewAllMethods,
16651
16715
  showWarning = true,
16652
- showViewAllButton = true
16716
+ showViewAllButton = true,
16717
+ isLoading = false,
16718
+ skeletonCount = 3
16653
16719
  }) => {
16654
16720
  const styles = useStyles39();
16655
16721
  const mergedLabels = { ...DEFAULT_LABELS37[language], ...labels };
@@ -16669,29 +16735,61 @@ var CardPaymentMethodFavorite = ({
16669
16735
  )
16670
16736
  }
16671
16737
  ),
16672
- /* @__PURE__ */ jsx(Row, { nogutter: true, style: { gap: tokens.spacingVerticalL }, children: methods.map((option) => /* @__PURE__ */ jsx(Col, { xs: 12, onClick: () => onSelect(option.value), style: { cursor: "pointer" }, children: /* @__PURE__ */ jsxs(Row, { justify: "between", children: [
16673
- /* @__PURE__ */ jsx(Col, { xs: "content", children: /* @__PURE__ */ jsx(
16674
- "img",
16675
- {
16676
- src: option.image,
16677
- alt: option.label,
16678
- className: styles.image
16679
- }
16680
- ) }),
16681
- /* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsx(Subtitle2, { children: option.label }) }),
16682
- /* @__PURE__ */ jsx(Col, { xs: "content", children: /* @__PURE__ */ jsx(
16683
- Radio,
16738
+ isLoading ? /* @__PURE__ */ jsx(Skeleton, { children: /* @__PURE__ */ jsx(Row, { nogutter: true, style: { gap: tokens.spacingVerticalL }, children: Array.from({ length: skeletonCount }).map((_, index) => /* @__PURE__ */ jsx(Col, { xs: 12, children: /* @__PURE__ */ jsxs("div", { className: styles.skeletonRow, children: [
16739
+ /* @__PURE__ */ jsxs("div", { className: styles.skeletonLeft, children: [
16740
+ /* @__PURE__ */ jsx(
16741
+ SkeletonItem,
16742
+ {
16743
+ shape: "circle",
16744
+ style: { width: "40px", height: "40px" }
16745
+ }
16746
+ ),
16747
+ /* @__PURE__ */ jsx(
16748
+ SkeletonItem,
16749
+ {
16750
+ style: { width: "140px", height: "18px" }
16751
+ }
16752
+ )
16753
+ ] }),
16754
+ /* @__PURE__ */ jsx(
16755
+ SkeletonItem,
16684
16756
  {
16685
- checked: selectedValue === option.value,
16686
- onChange: () => onSelect(option.value),
16687
- value: option.value,
16688
- name: "payment-method-favorite",
16689
- disabled: option.disabled,
16690
- "aria-label": `${mergedLabels.selectAriaLabel} ${option.label}`
16757
+ shape: "circle",
16758
+ style: { width: "20px", height: "20px" }
16691
16759
  }
16692
- ) })
16693
- ] }) }, option.value)) }),
16694
- showViewAllButton && /* @__PURE__ */ jsx(
16760
+ )
16761
+ ] }) }, `payment-favorite-skeleton-${index}`)) }) }) : /* @__PURE__ */ jsx(Row, { nogutter: true, style: { gap: tokens.spacingVerticalL }, children: methods.map((option) => /* @__PURE__ */ jsx(
16762
+ Col,
16763
+ {
16764
+ xs: 12,
16765
+ onClick: () => onSelect(option.value),
16766
+ style: { cursor: "pointer" },
16767
+ children: /* @__PURE__ */ jsxs(Row, { justify: "between", children: [
16768
+ /* @__PURE__ */ jsx(Col, { xs: "content", children: /* @__PURE__ */ jsx(
16769
+ "img",
16770
+ {
16771
+ src: option.image,
16772
+ alt: option.label,
16773
+ className: styles.image
16774
+ }
16775
+ ) }),
16776
+ /* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsx(Subtitle2, { children: option.label }) }),
16777
+ /* @__PURE__ */ jsx(Col, { xs: "content", children: /* @__PURE__ */ jsx(
16778
+ Radio,
16779
+ {
16780
+ checked: selectedValue === option.value,
16781
+ onChange: () => onSelect(option.value),
16782
+ value: option.value,
16783
+ name: "payment-method-favorite",
16784
+ disabled: option.disabled,
16785
+ "aria-label": `${mergedLabels.selectAriaLabel} ${option.label}`
16786
+ }
16787
+ ) })
16788
+ ] })
16789
+ },
16790
+ option.value
16791
+ )) }),
16792
+ showViewAllButton && !isLoading && /* @__PURE__ */ jsx(
16695
16793
  Button,
16696
16794
  {
16697
16795
  style: { width: "100%" },
@@ -16868,6 +16966,18 @@ var useStyles41 = makeStyles({
16868
16966
  tokens.spacingHorizontalM
16869
16967
  ),
16870
16968
  color: tokens.colorNeutralForeground4
16969
+ },
16970
+ skeletonCenter: {
16971
+ display: "flex",
16972
+ flexDirection: "column",
16973
+ alignItems: "center",
16974
+ gap: tokens.spacingHorizontalM
16975
+ },
16976
+ skeletonRow: {
16977
+ display: "flex",
16978
+ alignItems: "center",
16979
+ justifyContent: "center",
16980
+ gap: tokens.spacingHorizontalM
16871
16981
  }
16872
16982
  });
16873
16983
  var CardPaymentInfo = ({
@@ -16880,11 +16990,103 @@ var CardPaymentInfo = ({
16880
16990
  guides,
16881
16991
  onCopyVA,
16882
16992
  onCheckStatus,
16883
- onChangePayment
16993
+ onChangePayment,
16994
+ isLoading = false
16884
16995
  }) => {
16885
16996
  const styles = useStyles41();
16886
16997
  const mergedLabels = { ...DEFAULT_LABELS39[language], ...labels };
16887
- return /* @__PURE__ */ jsx("div", { className: styles.card, children: /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
16998
+ return /* @__PURE__ */ jsx("div", { className: styles.card, children: /* @__PURE__ */ jsx("div", { className: styles.container, children: isLoading ? /* @__PURE__ */ jsxs(Skeleton, { children: [
16999
+ /* @__PURE__ */ jsxs("div", { className: styles.headerRow, children: [
17000
+ /* @__PURE__ */ jsx(SkeletonItem, { style: { width: "180px", height: "20px" } }),
17001
+ /* @__PURE__ */ jsx(SkeletonItem, { style: { width: "260px", height: "28px" } })
17002
+ ] }),
17003
+ /* @__PURE__ */ jsxs("div", { className: styles.infoCard, children: [
17004
+ /* @__PURE__ */ jsxs("div", { className: styles.codeCard, children: [
17005
+ /* @__PURE__ */ jsxs("div", { className: styles.skeletonRow, children: [
17006
+ /* @__PURE__ */ jsx(
17007
+ SkeletonItem,
17008
+ {
17009
+ shape: "circle",
17010
+ style: { width: "40px", height: "40px" }
17011
+ }
17012
+ ),
17013
+ /* @__PURE__ */ jsx(SkeletonItem, { style: { width: "160px", height: "20px" } })
17014
+ ] }),
17015
+ /* @__PURE__ */ jsxs("div", { className: styles.skeletonCenter, children: [
17016
+ /* @__PURE__ */ jsx(SkeletonItem, { style: { width: "260px", height: "36px" } }),
17017
+ /* @__PURE__ */ jsx(
17018
+ SkeletonItem,
17019
+ {
17020
+ style: {
17021
+ width: "80%",
17022
+ height: "40px",
17023
+ borderRadius: tokens.borderRadiusCircular
17024
+ }
17025
+ }
17026
+ )
17027
+ ] })
17028
+ ] }),
17029
+ /* @__PURE__ */ jsx(
17030
+ SkeletonItem,
17031
+ {
17032
+ style: {
17033
+ width: "100%",
17034
+ height: "40px",
17035
+ borderRadius: tokens.borderRadiusCircular
17036
+ }
17037
+ }
17038
+ ),
17039
+ /* @__PURE__ */ jsxs("div", { children: [
17040
+ /* @__PURE__ */ jsx(
17041
+ SkeletonItem,
17042
+ {
17043
+ style: {
17044
+ width: "120px",
17045
+ height: "18px",
17046
+ marginBottom: "8px"
17047
+ }
17048
+ }
17049
+ ),
17050
+ /* @__PURE__ */ jsx(
17051
+ SkeletonItem,
17052
+ {
17053
+ style: {
17054
+ width: "100%",
17055
+ height: "36px",
17056
+ borderRadius: tokens.borderRadius2XLarge
17057
+ }
17058
+ }
17059
+ )
17060
+ ] })
17061
+ ] }),
17062
+ /* @__PURE__ */ jsxs("div", { children: [
17063
+ /* @__PURE__ */ jsx(
17064
+ SkeletonItem,
17065
+ {
17066
+ style: {
17067
+ width: "75%",
17068
+ height: "18px",
17069
+ marginBottom: tokens.spacingVerticalM
17070
+ }
17071
+ }
17072
+ ),
17073
+ /* @__PURE__ */ jsx(
17074
+ SkeletonItem,
17075
+ {
17076
+ style: {
17077
+ width: "100%",
17078
+ height: "40px",
17079
+ borderRadius: tokens.borderRadiusCircular
17080
+ }
17081
+ }
17082
+ )
17083
+ ] }),
17084
+ /* @__PURE__ */ jsxs("div", { className: styles.infoCard, children: [
17085
+ /* @__PURE__ */ jsx(SkeletonItem, { style: { width: "55%", height: "20px" } }),
17086
+ /* @__PURE__ */ jsx(SkeletonItem, { style: { width: "100%", height: "16px" } }),
17087
+ /* @__PURE__ */ jsx(SkeletonItem, { style: { width: "85%", height: "16px" } })
17088
+ ] })
17089
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
16888
17090
  /* @__PURE__ */ jsxs("div", { className: styles.headerRow, children: [
16889
17091
  /* @__PURE__ */ jsx(Subtitle1, { children: mergedLabels.expiryPrefix }),
16890
17092
  /* @__PURE__ */ jsx(Title2, { className: styles.expiryTitle, children: expiryDate })
@@ -16937,7 +17139,16 @@ var CardPaymentInfo = ({
16937
17139
  )
16938
17140
  ] }),
16939
17141
  /* @__PURE__ */ jsxs("div", { children: [
16940
- /* @__PURE__ */ jsx("div", { style: { marginBottom: tokens.spacingVerticalM }, children: /* @__PURE__ */ jsx(Subtitle2, { style: { color: tokens.colorNeutralStrokeAccessible, fontWeight: fontWeight.Medium }, children: mergedLabels.checkStatusInfo }) }),
17142
+ /* @__PURE__ */ jsx("div", { style: { marginBottom: tokens.spacingVerticalM }, children: /* @__PURE__ */ jsx(
17143
+ Subtitle2,
17144
+ {
17145
+ style: {
17146
+ color: tokens.colorNeutralStrokeAccessible,
17147
+ fontWeight: fontWeight.Medium
17148
+ },
17149
+ children: mergedLabels.checkStatusInfo
17150
+ }
17151
+ ) }),
16941
17152
  /* @__PURE__ */ jsx(
16942
17153
  Button,
16943
17154
  {
@@ -16951,7 +17162,7 @@ var CardPaymentInfo = ({
16951
17162
  )
16952
17163
  ] }),
16953
17164
  /* @__PURE__ */ jsx(CardPaymentGuide, { guides, language })
16954
- ] }) });
17165
+ ] }) }) });
16955
17166
  };
16956
17167
 
16957
17168
  // src/components/CardStatusOrder/CardStatusOrder.constants.ts