@asdp/ferryui 0.1.22-dev.8918 → 0.1.22-dev.8932
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 +20 -7
- package/dist/index.d.ts +20 -7
- package/dist/index.js +46 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -284,7 +284,7 @@ interface CardPromoProps {
|
|
|
284
284
|
/**
|
|
285
285
|
* Promo description/subtitle
|
|
286
286
|
*/
|
|
287
|
-
description: string;
|
|
287
|
+
description: string | React.ReactNode;
|
|
288
288
|
/**
|
|
289
289
|
* Image alt text
|
|
290
290
|
* @default "Promo image"
|
|
@@ -513,9 +513,9 @@ interface CardServiceMenuLabels {
|
|
|
513
513
|
interface CardServiceMenuProps {
|
|
514
514
|
/**
|
|
515
515
|
* Currently active service ID
|
|
516
|
-
* @default
|
|
516
|
+
* @default 1
|
|
517
517
|
*/
|
|
518
|
-
activeServiceId?:
|
|
518
|
+
activeServiceId?: number;
|
|
519
519
|
/**
|
|
520
520
|
* Language for labels (Indonesian or English)
|
|
521
521
|
* @default 'id'
|
|
@@ -524,7 +524,7 @@ interface CardServiceMenuProps {
|
|
|
524
524
|
/**
|
|
525
525
|
* Callback when a service is clicked
|
|
526
526
|
*/
|
|
527
|
-
onServiceClick?: (serviceId:
|
|
527
|
+
onServiceClick?: (serviceId: number) => void;
|
|
528
528
|
/**
|
|
529
529
|
* Whether to show descriptions on desktop
|
|
530
530
|
* @default true
|
|
@@ -538,6 +538,18 @@ interface CardServiceMenuProps {
|
|
|
538
538
|
* Custom labels override
|
|
539
539
|
*/
|
|
540
540
|
labels?: Partial<CardServiceMenuLabels>;
|
|
541
|
+
/**
|
|
542
|
+
* Menu items
|
|
543
|
+
*/
|
|
544
|
+
menuItems?: CardServiceMenuItem[];
|
|
545
|
+
}
|
|
546
|
+
interface CardServiceMenuItem {
|
|
547
|
+
id: number;
|
|
548
|
+
description: string;
|
|
549
|
+
imageUrl: string;
|
|
550
|
+
linkUrl: string;
|
|
551
|
+
name: string;
|
|
552
|
+
sortOrder: number;
|
|
541
553
|
}
|
|
542
554
|
|
|
543
555
|
declare const CardServiceMenu: React$1.FC<CardServiceMenuProps>;
|
|
@@ -627,12 +639,12 @@ interface CardTicketSearchProps {
|
|
|
627
639
|
onSwitchClick?: () => void;
|
|
628
640
|
onRoundTripChange?: (value: boolean) => void;
|
|
629
641
|
onSubmit?: (data: CardTicketSearchFormData) => void;
|
|
630
|
-
onServiceClick?: (serviceId:
|
|
642
|
+
onServiceClick?: (serviceId: number) => void;
|
|
631
643
|
/**
|
|
632
644
|
* Active service ID
|
|
633
|
-
* @default
|
|
645
|
+
* @default 1
|
|
634
646
|
*/
|
|
635
|
-
activeServiceId?:
|
|
647
|
+
activeServiceId?: number;
|
|
636
648
|
/**
|
|
637
649
|
* Custom labels override (optional)
|
|
638
650
|
* If not provided, default labels based on locale will be used
|
|
@@ -648,6 +660,7 @@ interface CardTicketSearchProps {
|
|
|
648
660
|
isRotating?: boolean;
|
|
649
661
|
showPassengerField?: boolean;
|
|
650
662
|
showRoundTrip?: boolean;
|
|
663
|
+
menuItems?: CardServiceMenuItem[];
|
|
651
664
|
}
|
|
652
665
|
|
|
653
666
|
declare const CardTicketSearch: React$1.FC<CardTicketSearchProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -284,7 +284,7 @@ interface CardPromoProps {
|
|
|
284
284
|
/**
|
|
285
285
|
* Promo description/subtitle
|
|
286
286
|
*/
|
|
287
|
-
description: string;
|
|
287
|
+
description: string | React.ReactNode;
|
|
288
288
|
/**
|
|
289
289
|
* Image alt text
|
|
290
290
|
* @default "Promo image"
|
|
@@ -513,9 +513,9 @@ interface CardServiceMenuLabels {
|
|
|
513
513
|
interface CardServiceMenuProps {
|
|
514
514
|
/**
|
|
515
515
|
* Currently active service ID
|
|
516
|
-
* @default
|
|
516
|
+
* @default 1
|
|
517
517
|
*/
|
|
518
|
-
activeServiceId?:
|
|
518
|
+
activeServiceId?: number;
|
|
519
519
|
/**
|
|
520
520
|
* Language for labels (Indonesian or English)
|
|
521
521
|
* @default 'id'
|
|
@@ -524,7 +524,7 @@ interface CardServiceMenuProps {
|
|
|
524
524
|
/**
|
|
525
525
|
* Callback when a service is clicked
|
|
526
526
|
*/
|
|
527
|
-
onServiceClick?: (serviceId:
|
|
527
|
+
onServiceClick?: (serviceId: number) => void;
|
|
528
528
|
/**
|
|
529
529
|
* Whether to show descriptions on desktop
|
|
530
530
|
* @default true
|
|
@@ -538,6 +538,18 @@ interface CardServiceMenuProps {
|
|
|
538
538
|
* Custom labels override
|
|
539
539
|
*/
|
|
540
540
|
labels?: Partial<CardServiceMenuLabels>;
|
|
541
|
+
/**
|
|
542
|
+
* Menu items
|
|
543
|
+
*/
|
|
544
|
+
menuItems?: CardServiceMenuItem[];
|
|
545
|
+
}
|
|
546
|
+
interface CardServiceMenuItem {
|
|
547
|
+
id: number;
|
|
548
|
+
description: string;
|
|
549
|
+
imageUrl: string;
|
|
550
|
+
linkUrl: string;
|
|
551
|
+
name: string;
|
|
552
|
+
sortOrder: number;
|
|
541
553
|
}
|
|
542
554
|
|
|
543
555
|
declare const CardServiceMenu: React$1.FC<CardServiceMenuProps>;
|
|
@@ -627,12 +639,12 @@ interface CardTicketSearchProps {
|
|
|
627
639
|
onSwitchClick?: () => void;
|
|
628
640
|
onRoundTripChange?: (value: boolean) => void;
|
|
629
641
|
onSubmit?: (data: CardTicketSearchFormData) => void;
|
|
630
|
-
onServiceClick?: (serviceId:
|
|
642
|
+
onServiceClick?: (serviceId: number) => void;
|
|
631
643
|
/**
|
|
632
644
|
* Active service ID
|
|
633
|
-
* @default
|
|
645
|
+
* @default 1
|
|
634
646
|
*/
|
|
635
|
-
activeServiceId?:
|
|
647
|
+
activeServiceId?: number;
|
|
636
648
|
/**
|
|
637
649
|
* Custom labels override (optional)
|
|
638
650
|
* If not provided, default labels based on locale will be used
|
|
@@ -648,6 +660,7 @@ interface CardTicketSearchProps {
|
|
|
648
660
|
isRotating?: boolean;
|
|
649
661
|
showPassengerField?: boolean;
|
|
650
662
|
showRoundTrip?: boolean;
|
|
663
|
+
menuItems?: CardServiceMenuItem[];
|
|
651
664
|
}
|
|
652
665
|
|
|
653
666
|
declare const CardTicketSearch: React$1.FC<CardTicketSearchProps>;
|
package/dist/index.js
CHANGED
|
@@ -1690,28 +1690,40 @@ var DEFAULT_LABELS6 = {
|
|
|
1690
1690
|
serviceAriaLabel: "Service"
|
|
1691
1691
|
}
|
|
1692
1692
|
};
|
|
1693
|
-
var ALIAS_MENU_ITEMS =
|
|
1694
|
-
|
|
1695
|
-
id:
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
},
|
|
1702
|
-
|
|
1703
|
-
id:
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
},
|
|
1710
|
-
|
|
1711
|
-
id:
|
|
1712
|
-
|
|
1693
|
+
var ALIAS_MENU_ITEMS = [
|
|
1694
|
+
{
|
|
1695
|
+
"id": 1,
|
|
1696
|
+
"name": "Ferizy",
|
|
1697
|
+
"description": "Layanan penyeberangan ferry ASDP",
|
|
1698
|
+
"imageUrl": "https://mock-api.tryztech.com/images?name=ferry.svg",
|
|
1699
|
+
"linkUrl": "https://ferizy.apps.devtix.swamedia.xyz",
|
|
1700
|
+
"sortOrder": 1
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
"id": 4,
|
|
1704
|
+
"name": "Hotel",
|
|
1705
|
+
"description": "Layanan pemesanan hotel",
|
|
1706
|
+
"imageUrl": "https://mock-api.tryztech.com/images?name=hotel.svg",
|
|
1707
|
+
"linkUrl": "https://hotel.apps.devtix.swamedia.xyz",
|
|
1708
|
+
"sortOrder": 2
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
"id": 5,
|
|
1712
|
+
"name": "Travel",
|
|
1713
|
+
"description": "Layanan pemesanan travel",
|
|
1714
|
+
"imageUrl": "https://mock-api.tryztech.com/images?name=small-bus.webp",
|
|
1715
|
+
"linkUrl": "https://travel.apps.devtix.swamedia.xyz",
|
|
1716
|
+
"sortOrder": 3
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"id": 6,
|
|
1720
|
+
"name": "Food",
|
|
1721
|
+
"description": "Layanan pemesanan makanan",
|
|
1722
|
+
"imageUrl": "https://mock-api.tryztech.com/images?name=food.png",
|
|
1723
|
+
"linkUrl": "https://food.apps.devtix.swamedia.xyz",
|
|
1724
|
+
"sortOrder": 4
|
|
1713
1725
|
}
|
|
1714
|
-
|
|
1726
|
+
];
|
|
1715
1727
|
var useStyles6 = reactComponents.makeStyles({
|
|
1716
1728
|
card: {
|
|
1717
1729
|
width: "100%",
|
|
@@ -1805,37 +1817,33 @@ var useStyles6 = reactComponents.makeStyles({
|
|
|
1805
1817
|
}
|
|
1806
1818
|
});
|
|
1807
1819
|
var CardServiceMenu = ({
|
|
1808
|
-
activeServiceId =
|
|
1820
|
+
activeServiceId = 1,
|
|
1809
1821
|
language = "id",
|
|
1810
1822
|
onServiceClick,
|
|
1811
1823
|
showDescriptions = true,
|
|
1812
1824
|
className,
|
|
1813
|
-
labels
|
|
1825
|
+
labels,
|
|
1826
|
+
menuItems = ALIAS_MENU_ITEMS
|
|
1814
1827
|
}) => {
|
|
1815
1828
|
const styles = useStyles6();
|
|
1816
|
-
|
|
1829
|
+
({ ...DEFAULT_LABELS6[language], ...labels });
|
|
1817
1830
|
const getMenuItemClass = (serviceId) => {
|
|
1818
1831
|
const isActive = activeServiceId === serviceId;
|
|
1819
1832
|
return reactComponents.mergeClasses(styles.menuItem, isActive && styles.menuItemActive);
|
|
1820
1833
|
};
|
|
1821
|
-
const menuItems = Object.values(ALIAS_MENU_ITEMS);
|
|
1822
1834
|
return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Card, { className: reactComponents.mergeClasses(styles.card, className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.menuList, children: menuItems.map((item, index) => {
|
|
1823
|
-
const labelKey = `${item.id}Label`;
|
|
1824
|
-
const descriptionKey = `${item.id}Description`;
|
|
1825
|
-
const label = mergedLabels[labelKey];
|
|
1826
|
-
const description = mergedLabels[descriptionKey];
|
|
1827
1835
|
return /* @__PURE__ */ jsxRuntime.jsxs(React5__default.default.Fragment, { children: [
|
|
1828
1836
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1829
1837
|
reactComponents.Button,
|
|
1830
1838
|
{
|
|
1831
1839
|
className: getMenuItemClass(item.id),
|
|
1832
1840
|
onClick: () => onServiceClick?.(item.id),
|
|
1833
|
-
"aria-label":
|
|
1841
|
+
"aria-label": item.name,
|
|
1834
1842
|
children: [
|
|
1835
|
-
/* @__PURE__ */ jsxRuntime.jsx("img", { src: item.
|
|
1843
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: item.imageUrl, alt: item.name, className: styles.logo }),
|
|
1836
1844
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.textContent, children: [
|
|
1837
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.label, children:
|
|
1838
|
-
showDescriptions && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.description, children: description })
|
|
1845
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.label, children: item.name }),
|
|
1846
|
+
showDescriptions && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.description, children: item.description })
|
|
1839
1847
|
] })
|
|
1840
1848
|
]
|
|
1841
1849
|
}
|
|
@@ -3483,13 +3491,14 @@ var CardTicketSearch = ({
|
|
|
3483
3491
|
onSwitchClick,
|
|
3484
3492
|
onRoundTripChange,
|
|
3485
3493
|
onSubmit,
|
|
3486
|
-
activeServiceId =
|
|
3494
|
+
activeServiceId = 1,
|
|
3487
3495
|
labels: customLabels,
|
|
3488
3496
|
className,
|
|
3489
3497
|
isRotating = false,
|
|
3490
3498
|
showPassengerField = false,
|
|
3491
3499
|
showRoundTrip = true,
|
|
3492
|
-
onServiceClick
|
|
3500
|
+
onServiceClick,
|
|
3501
|
+
menuItems
|
|
3493
3502
|
}) => {
|
|
3494
3503
|
const styles = useStyles8();
|
|
3495
3504
|
const labels = React5__default.default.useMemo(
|
|
@@ -3583,7 +3592,8 @@ var CardTicketSearch = ({
|
|
|
3583
3592
|
className: styles.serviceMenuCard,
|
|
3584
3593
|
activeServiceId,
|
|
3585
3594
|
language,
|
|
3586
|
-
onServiceClick
|
|
3595
|
+
onServiceClick,
|
|
3596
|
+
menuItems
|
|
3587
3597
|
}
|
|
3588
3598
|
)
|
|
3589
3599
|
}
|