@asdp/ferryui 0.1.22-dev.10593 → 0.1.22-dev.10601
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 +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +156 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2504,6 +2504,7 @@ type StepStatus = 'completed' | 'active' | 'inactive';
|
|
|
2504
2504
|
|
|
2505
2505
|
declare const Stepper: React$1.FC<StepperProps>;
|
|
2506
2506
|
|
|
2507
|
+
type NotificationType = 'whatsapp' | 'sms';
|
|
2507
2508
|
interface Orderer {
|
|
2508
2509
|
name?: string;
|
|
2509
2510
|
phoneNumber?: string;
|
|
@@ -2514,6 +2515,13 @@ interface CardOrdererInfoLabels {
|
|
|
2514
2515
|
ordererName: string;
|
|
2515
2516
|
phoneNumber: string;
|
|
2516
2517
|
email: string;
|
|
2518
|
+
addCcEmail: string;
|
|
2519
|
+
ccEmail: string;
|
|
2520
|
+
ccEmailPlaceholder: string;
|
|
2521
|
+
ccEmailHint: string;
|
|
2522
|
+
notificationLabel: string;
|
|
2523
|
+
whatsapp: string;
|
|
2524
|
+
sms: string;
|
|
2517
2525
|
}
|
|
2518
2526
|
interface CardOrdererInfoProps {
|
|
2519
2527
|
/**
|
|
@@ -2534,6 +2542,28 @@ interface CardOrdererInfoProps {
|
|
|
2534
2542
|
* Additional CSS class name
|
|
2535
2543
|
*/
|
|
2536
2544
|
className?: string;
|
|
2545
|
+
/**
|
|
2546
|
+
* Current CC email value
|
|
2547
|
+
*/
|
|
2548
|
+
ccEmail?: string;
|
|
2549
|
+
/**
|
|
2550
|
+
* Callback when CC email input value changes
|
|
2551
|
+
*/
|
|
2552
|
+
onCcEmailChange?: (value: string) => void;
|
|
2553
|
+
/**
|
|
2554
|
+
* Callback when CC email is removed (trash button clicked)
|
|
2555
|
+
* When provided, the "Tambahkan Cc Email" link is shown
|
|
2556
|
+
*/
|
|
2557
|
+
onCcEmailRemove?: () => void;
|
|
2558
|
+
/**
|
|
2559
|
+
* Selected notification type
|
|
2560
|
+
* @default 'whatsapp'
|
|
2561
|
+
*/
|
|
2562
|
+
notificationType?: NotificationType;
|
|
2563
|
+
/**
|
|
2564
|
+
* Callback when notification type changes
|
|
2565
|
+
*/
|
|
2566
|
+
onNotificationTypeChange?: (type: NotificationType) => void;
|
|
2537
2567
|
}
|
|
2538
2568
|
|
|
2539
2569
|
declare const CardOrdererInfo: React$1.FC<CardOrdererInfoProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2504,6 +2504,7 @@ type StepStatus = 'completed' | 'active' | 'inactive';
|
|
|
2504
2504
|
|
|
2505
2505
|
declare const Stepper: React$1.FC<StepperProps>;
|
|
2506
2506
|
|
|
2507
|
+
type NotificationType = 'whatsapp' | 'sms';
|
|
2507
2508
|
interface Orderer {
|
|
2508
2509
|
name?: string;
|
|
2509
2510
|
phoneNumber?: string;
|
|
@@ -2514,6 +2515,13 @@ interface CardOrdererInfoLabels {
|
|
|
2514
2515
|
ordererName: string;
|
|
2515
2516
|
phoneNumber: string;
|
|
2516
2517
|
email: string;
|
|
2518
|
+
addCcEmail: string;
|
|
2519
|
+
ccEmail: string;
|
|
2520
|
+
ccEmailPlaceholder: string;
|
|
2521
|
+
ccEmailHint: string;
|
|
2522
|
+
notificationLabel: string;
|
|
2523
|
+
whatsapp: string;
|
|
2524
|
+
sms: string;
|
|
2517
2525
|
}
|
|
2518
2526
|
interface CardOrdererInfoProps {
|
|
2519
2527
|
/**
|
|
@@ -2534,6 +2542,28 @@ interface CardOrdererInfoProps {
|
|
|
2534
2542
|
* Additional CSS class name
|
|
2535
2543
|
*/
|
|
2536
2544
|
className?: string;
|
|
2545
|
+
/**
|
|
2546
|
+
* Current CC email value
|
|
2547
|
+
*/
|
|
2548
|
+
ccEmail?: string;
|
|
2549
|
+
/**
|
|
2550
|
+
* Callback when CC email input value changes
|
|
2551
|
+
*/
|
|
2552
|
+
onCcEmailChange?: (value: string) => void;
|
|
2553
|
+
/**
|
|
2554
|
+
* Callback when CC email is removed (trash button clicked)
|
|
2555
|
+
* When provided, the "Tambahkan Cc Email" link is shown
|
|
2556
|
+
*/
|
|
2557
|
+
onCcEmailRemove?: () => void;
|
|
2558
|
+
/**
|
|
2559
|
+
* Selected notification type
|
|
2560
|
+
* @default 'whatsapp'
|
|
2561
|
+
*/
|
|
2562
|
+
notificationType?: NotificationType;
|
|
2563
|
+
/**
|
|
2564
|
+
* Callback when notification type changes
|
|
2565
|
+
*/
|
|
2566
|
+
onNotificationTypeChange?: (type: NotificationType) => void;
|
|
2537
2567
|
}
|
|
2538
2568
|
|
|
2539
2569
|
declare const CardOrdererInfo: React$1.FC<CardOrdererInfoProps>;
|
package/dist/index.js
CHANGED
|
@@ -10786,13 +10786,27 @@ var DEFAULT_LABELS21 = {
|
|
|
10786
10786
|
title: "Informasi Pemesan",
|
|
10787
10787
|
ordererName: "Nama Pemesan",
|
|
10788
10788
|
phoneNumber: "Nomor Handphone",
|
|
10789
|
-
email: "Email"
|
|
10789
|
+
email: "Email",
|
|
10790
|
+
addCcEmail: "Tambahkan Cc Email",
|
|
10791
|
+
ccEmail: "CC Email",
|
|
10792
|
+
ccEmailPlaceholder: "Masukkan email",
|
|
10793
|
+
ccEmailHint: "E-Tiket akan di kirim ke email ini",
|
|
10794
|
+
notificationLabel: "Pilih pengiriman notifkasi",
|
|
10795
|
+
whatsapp: "WhatsApp",
|
|
10796
|
+
sms: "SMS"
|
|
10790
10797
|
},
|
|
10791
10798
|
en: {
|
|
10792
10799
|
title: "Orderer Information",
|
|
10793
10800
|
ordererName: "Orderer Name",
|
|
10794
10801
|
phoneNumber: "Phone Number",
|
|
10795
|
-
email: "Email"
|
|
10802
|
+
email: "Email",
|
|
10803
|
+
addCcEmail: "Add Cc Email",
|
|
10804
|
+
ccEmail: "CC Email",
|
|
10805
|
+
ccEmailPlaceholder: "Enter email",
|
|
10806
|
+
ccEmailHint: "E-Ticket will be sent to this email",
|
|
10807
|
+
notificationLabel: "Select notification delivery",
|
|
10808
|
+
whatsapp: "WhatsApp",
|
|
10809
|
+
sms: "SMS"
|
|
10796
10810
|
}
|
|
10797
10811
|
};
|
|
10798
10812
|
var useStyles22 = reactComponents.makeStyles({
|
|
@@ -10802,46 +10816,169 @@ var useStyles22 = reactComponents.makeStyles({
|
|
|
10802
10816
|
boxShadow: reactComponents.tokens.shadow4,
|
|
10803
10817
|
zIndex: 3
|
|
10804
10818
|
},
|
|
10805
|
-
|
|
10819
|
+
header: {
|
|
10806
10820
|
display: "flex",
|
|
10807
|
-
|
|
10808
|
-
|
|
10821
|
+
alignItems: "center",
|
|
10822
|
+
gap: "1rem",
|
|
10823
|
+
marginBottom: "1.25rem"
|
|
10824
|
+
},
|
|
10825
|
+
title: {
|
|
10826
|
+
flexShrink: 0
|
|
10827
|
+
},
|
|
10828
|
+
divider: {
|
|
10829
|
+
flexGrow: 1
|
|
10809
10830
|
},
|
|
10810
10831
|
fieldGroup: {
|
|
10811
10832
|
display: "flex",
|
|
10812
10833
|
flexDirection: "column",
|
|
10813
|
-
gap: "0.25rem"
|
|
10834
|
+
gap: "0.25rem",
|
|
10835
|
+
flex: 1
|
|
10814
10836
|
},
|
|
10815
10837
|
label: {
|
|
10816
10838
|
color: reactComponents.tokens.colorNeutralForeground2
|
|
10817
10839
|
},
|
|
10818
10840
|
value: {
|
|
10819
10841
|
color: tokensV2_default.lightModeColors.Neutral_Foreground_Disabled_Rest
|
|
10842
|
+
},
|
|
10843
|
+
addCcLink: {
|
|
10844
|
+
marginTop: "0.375rem"
|
|
10845
|
+
},
|
|
10846
|
+
bottomRow: {
|
|
10847
|
+
display: "flex",
|
|
10848
|
+
flexDirection: "row",
|
|
10849
|
+
gap: "2rem",
|
|
10850
|
+
marginTop: "1.25rem",
|
|
10851
|
+
alignItems: "flex-start"
|
|
10852
|
+
},
|
|
10853
|
+
// Notification section aligns under the first column (Nama Pemesan)
|
|
10854
|
+
notificationSection: {
|
|
10855
|
+
flex: 1,
|
|
10856
|
+
display: "flex",
|
|
10857
|
+
flexDirection: "column"
|
|
10858
|
+
},
|
|
10859
|
+
notificationLabel: {
|
|
10860
|
+
color: reactComponents.tokens.colorNeutralForeground2,
|
|
10861
|
+
display: "block",
|
|
10862
|
+
marginBottom: "0.5rem"
|
|
10863
|
+
},
|
|
10864
|
+
// CC section spans the remaining two columns (Phone + Email)
|
|
10865
|
+
ccSection: {
|
|
10866
|
+
flex: 1,
|
|
10867
|
+
display: "flex",
|
|
10868
|
+
flexDirection: "column",
|
|
10869
|
+
gap: "0.375rem"
|
|
10870
|
+
},
|
|
10871
|
+
ccLabel: {
|
|
10872
|
+
color: reactComponents.tokens.colorNeutralForeground2
|
|
10873
|
+
},
|
|
10874
|
+
ccInputRow: {
|
|
10875
|
+
display: "flex",
|
|
10876
|
+
alignItems: "center"
|
|
10877
|
+
},
|
|
10878
|
+
ccInput: {
|
|
10879
|
+
flex: 1
|
|
10880
|
+
},
|
|
10881
|
+
deleteButton: {
|
|
10882
|
+
color: reactComponents.tokens.colorStatusDangerForeground1,
|
|
10883
|
+
minWidth: "unset",
|
|
10884
|
+
padding: "0 0.5rem"
|
|
10885
|
+
},
|
|
10886
|
+
ccHint: {
|
|
10887
|
+
color: tokensV2_default.lightModeColors.Neutral_Foreground_Disabled_Rest
|
|
10820
10888
|
}
|
|
10821
10889
|
});
|
|
10822
10890
|
var CardOrdererInfo = ({
|
|
10823
10891
|
language = "id",
|
|
10824
10892
|
orderer,
|
|
10825
10893
|
labels,
|
|
10826
|
-
className
|
|
10894
|
+
className,
|
|
10895
|
+
ccEmail,
|
|
10896
|
+
onCcEmailChange,
|
|
10897
|
+
onCcEmailRemove,
|
|
10898
|
+
notificationType: notificationTypeProp = "whatsapp",
|
|
10899
|
+
onNotificationTypeChange
|
|
10827
10900
|
}) => {
|
|
10828
10901
|
const styles = useStyles22();
|
|
10829
10902
|
const mergedLabels = { ...DEFAULT_LABELS21[language], ...labels };
|
|
10903
|
+
const [showCcForm, setShowCcForm] = React.useState(false);
|
|
10904
|
+
const [notificationType, setNotificationType] = React.useState(notificationTypeProp);
|
|
10905
|
+
const handleNotificationChange = (_e, data) => {
|
|
10906
|
+
const value = data.value;
|
|
10907
|
+
setNotificationType(value);
|
|
10908
|
+
onNotificationTypeChange?.(value);
|
|
10909
|
+
};
|
|
10910
|
+
const handleAddCcClick = () => {
|
|
10911
|
+
setShowCcForm(true);
|
|
10912
|
+
};
|
|
10913
|
+
const handleRemoveCc = () => {
|
|
10914
|
+
setShowCcForm(false);
|
|
10915
|
+
onCcEmailChange?.("");
|
|
10916
|
+
onCcEmailRemove?.();
|
|
10917
|
+
};
|
|
10830
10918
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Card, { className: className || styles.card, children: [
|
|
10831
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10832
|
-
|
|
10833
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10834
|
-
|
|
10919
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.header, children: [
|
|
10920
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Title3, { className: styles.title, children: mergedLabels.title }),
|
|
10921
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, { className: styles.divider })
|
|
10922
|
+
] }),
|
|
10923
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
|
|
10924
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { md: 4, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
10925
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption1, { className: styles.label, children: mergedLabels.ordererName }),
|
|
10835
10926
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.value, children: orderer?.name || "-" })
|
|
10836
|
-
] }),
|
|
10837
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
10838
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.
|
|
10927
|
+
] }) }),
|
|
10928
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { md: 4, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
10929
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption1, { className: styles.label, children: mergedLabels.phoneNumber }),
|
|
10839
10930
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.value, children: orderer?.phoneNumber || "-" })
|
|
10840
|
-
] }),
|
|
10841
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
10842
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.
|
|
10843
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.value, children: orderer?.email || "-" })
|
|
10844
|
-
|
|
10931
|
+
] }) }),
|
|
10932
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { md: 4, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fieldGroup, children: [
|
|
10933
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption1, { className: styles.label, children: mergedLabels.email }),
|
|
10934
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.value, children: orderer?.email || "-" }),
|
|
10935
|
+
!showCcForm && /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Link, { className: styles.addCcLink, onClick: handleAddCcClick, children: mergedLabels.addCcEmail })
|
|
10936
|
+
] }) }),
|
|
10937
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { md: 4, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.notificationSection, children: [
|
|
10938
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body2, { className: styles.notificationLabel, children: mergedLabels.notificationLabel }),
|
|
10939
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10940
|
+
reactComponents.RadioGroup,
|
|
10941
|
+
{
|
|
10942
|
+
layout: "horizontal",
|
|
10943
|
+
value: notificationType,
|
|
10944
|
+
onChange: handleNotificationChange,
|
|
10945
|
+
children: [
|
|
10946
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Radio, { value: "whatsapp", label: mergedLabels.whatsapp }),
|
|
10947
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Radio, { value: "sms", label: mergedLabels.sms })
|
|
10948
|
+
]
|
|
10949
|
+
}
|
|
10950
|
+
)
|
|
10951
|
+
] }) }),
|
|
10952
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { md: 4, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.ccSection, children: showCcForm && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10953
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption1, { className: styles.ccLabel, children: mergedLabels.ccEmail }),
|
|
10954
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.ccInputRow, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10955
|
+
reactComponents.Input,
|
|
10956
|
+
{
|
|
10957
|
+
className: styles.ccInput,
|
|
10958
|
+
type: "email",
|
|
10959
|
+
placeholder: mergedLabels.ccEmailPlaceholder,
|
|
10960
|
+
value: ccEmail ?? "",
|
|
10961
|
+
onChange: (_e, data) => onCcEmailChange?.(data.value),
|
|
10962
|
+
contentAfter: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10963
|
+
reactComponents.Button,
|
|
10964
|
+
{
|
|
10965
|
+
appearance: "transparent",
|
|
10966
|
+
className: styles.deleteButton,
|
|
10967
|
+
onClick: handleRemoveCc,
|
|
10968
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10969
|
+
react.Icon,
|
|
10970
|
+
{
|
|
10971
|
+
icon: "fluent:delete-24-regular",
|
|
10972
|
+
color: reactComponents.tokens.colorStatusDangerForeground1,
|
|
10973
|
+
width: 18
|
|
10974
|
+
}
|
|
10975
|
+
)
|
|
10976
|
+
}
|
|
10977
|
+
)
|
|
10978
|
+
}
|
|
10979
|
+
) }),
|
|
10980
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption2, { className: styles.ccHint, children: mergedLabels.ccEmailHint })
|
|
10981
|
+
] }) }) })
|
|
10845
10982
|
] })
|
|
10846
10983
|
] });
|
|
10847
10984
|
};
|