@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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { makeStyles, tokens, createLightTheme, createDarkTheme, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Field, Caption1Strong, Caption2, Button, InfoLabel, Body1, Body1Strong, Caption1, Dialog, DialogSurface, DialogBody, DialogTitle, DialogTrigger, DialogContent, Carousel, CarouselButton, CarouselViewport, mergeClasses, CarouselSlider, CarouselNav, CarouselNavButton, CarouselCard, Skeleton, SkeletonItem, Subtitle2, Card, Tooltip, Badge, Title2, Divider, Title3, Spinner, Label, Text, Subtitle1, Checkbox, MessageBar, MessageBarBody, Accordion, AccordionItem, AccordionHeader, AccordionPanel, RadioGroup, Menu, MenuTrigger, MenuPopover, MenuList, Radio, DialogActions, Caption2Strong, Body2, Body1Stronger, Caption1Stronger, Display, Image, Title1, TabList, Tab, typographyStyles, Switch, Textarea, Link } from '@fluentui/react-components';
1
+ import { makeStyles, tokens, createLightTheme, createDarkTheme, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Field, Caption1Strong, Caption2, Button, InfoLabel, Body1, Body1Strong, Caption1, Dialog, DialogSurface, DialogBody, DialogTitle, DialogTrigger, DialogContent, Carousel, CarouselButton, CarouselViewport, mergeClasses, CarouselSlider, CarouselNav, CarouselNavButton, CarouselCard, Skeleton, SkeletonItem, Subtitle2, Card, Tooltip, Badge, Title2, Divider, Title3, Spinner, Label, Text, Subtitle1, Checkbox, MessageBar, MessageBarBody, Accordion, AccordionItem, AccordionHeader, AccordionPanel, RadioGroup, Menu, MenuTrigger, MenuPopover, MenuList, Radio, DialogActions, Caption2Strong, Link, Body2, Body1Stronger, Caption1Stronger, Display, Image, Title1, TabList, Tab, typographyStyles, Switch, Textarea } from '@fluentui/react-components';
2
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
3
  import React, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, Fragment as Fragment$1 } from 'react';
4
4
  import { ArrowDownloadRegular, Dismiss24Regular, DismissRegular, SubtractRegular, AddRegular, DeleteRegular, InfoRegular, SearchRegular } from '@fluentui/react-icons';
@@ -10777,13 +10777,27 @@ var DEFAULT_LABELS21 = {
10777
10777
  title: "Informasi Pemesan",
10778
10778
  ordererName: "Nama Pemesan",
10779
10779
  phoneNumber: "Nomor Handphone",
10780
- email: "Email"
10780
+ email: "Email",
10781
+ addCcEmail: "Tambahkan Cc Email",
10782
+ ccEmail: "CC Email",
10783
+ ccEmailPlaceholder: "Masukkan email",
10784
+ ccEmailHint: "E-Tiket akan di kirim ke email ini",
10785
+ notificationLabel: "Pilih pengiriman notifkasi",
10786
+ whatsapp: "WhatsApp",
10787
+ sms: "SMS"
10781
10788
  },
10782
10789
  en: {
10783
10790
  title: "Orderer Information",
10784
10791
  ordererName: "Orderer Name",
10785
10792
  phoneNumber: "Phone Number",
10786
- email: "Email"
10793
+ email: "Email",
10794
+ addCcEmail: "Add Cc Email",
10795
+ ccEmail: "CC Email",
10796
+ ccEmailPlaceholder: "Enter email",
10797
+ ccEmailHint: "E-Ticket will be sent to this email",
10798
+ notificationLabel: "Select notification delivery",
10799
+ whatsapp: "WhatsApp",
10800
+ sms: "SMS"
10787
10801
  }
10788
10802
  };
10789
10803
  var useStyles22 = makeStyles({
@@ -10793,46 +10807,169 @@ var useStyles22 = makeStyles({
10793
10807
  boxShadow: tokens.shadow4,
10794
10808
  zIndex: 3
10795
10809
  },
10796
- container: {
10810
+ header: {
10797
10811
  display: "flex",
10798
- justifyContent: "space-between",
10799
- marginTop: "1rem"
10812
+ alignItems: "center",
10813
+ gap: "1rem",
10814
+ marginBottom: "1.25rem"
10815
+ },
10816
+ title: {
10817
+ flexShrink: 0
10818
+ },
10819
+ divider: {
10820
+ flexGrow: 1
10800
10821
  },
10801
10822
  fieldGroup: {
10802
10823
  display: "flex",
10803
10824
  flexDirection: "column",
10804
- gap: "0.25rem"
10825
+ gap: "0.25rem",
10826
+ flex: 1
10805
10827
  },
10806
10828
  label: {
10807
10829
  color: tokens.colorNeutralForeground2
10808
10830
  },
10809
10831
  value: {
10810
10832
  color: tokensV2_default.lightModeColors.Neutral_Foreground_Disabled_Rest
10833
+ },
10834
+ addCcLink: {
10835
+ marginTop: "0.375rem"
10836
+ },
10837
+ bottomRow: {
10838
+ display: "flex",
10839
+ flexDirection: "row",
10840
+ gap: "2rem",
10841
+ marginTop: "1.25rem",
10842
+ alignItems: "flex-start"
10843
+ },
10844
+ // Notification section aligns under the first column (Nama Pemesan)
10845
+ notificationSection: {
10846
+ flex: 1,
10847
+ display: "flex",
10848
+ flexDirection: "column"
10849
+ },
10850
+ notificationLabel: {
10851
+ color: tokens.colorNeutralForeground2,
10852
+ display: "block",
10853
+ marginBottom: "0.5rem"
10854
+ },
10855
+ // CC section spans the remaining two columns (Phone + Email)
10856
+ ccSection: {
10857
+ flex: 1,
10858
+ display: "flex",
10859
+ flexDirection: "column",
10860
+ gap: "0.375rem"
10861
+ },
10862
+ ccLabel: {
10863
+ color: tokens.colorNeutralForeground2
10864
+ },
10865
+ ccInputRow: {
10866
+ display: "flex",
10867
+ alignItems: "center"
10868
+ },
10869
+ ccInput: {
10870
+ flex: 1
10871
+ },
10872
+ deleteButton: {
10873
+ color: tokens.colorStatusDangerForeground1,
10874
+ minWidth: "unset",
10875
+ padding: "0 0.5rem"
10876
+ },
10877
+ ccHint: {
10878
+ color: tokensV2_default.lightModeColors.Neutral_Foreground_Disabled_Rest
10811
10879
  }
10812
10880
  });
10813
10881
  var CardOrdererInfo = ({
10814
10882
  language = "id",
10815
10883
  orderer,
10816
10884
  labels,
10817
- className
10885
+ className,
10886
+ ccEmail,
10887
+ onCcEmailChange,
10888
+ onCcEmailRemove,
10889
+ notificationType: notificationTypeProp = "whatsapp",
10890
+ onNotificationTypeChange
10818
10891
  }) => {
10819
10892
  const styles = useStyles22();
10820
10893
  const mergedLabels = { ...DEFAULT_LABELS21[language], ...labels };
10894
+ const [showCcForm, setShowCcForm] = useState(false);
10895
+ const [notificationType, setNotificationType] = useState(notificationTypeProp);
10896
+ const handleNotificationChange = (_e, data) => {
10897
+ const value = data.value;
10898
+ setNotificationType(value);
10899
+ onNotificationTypeChange?.(value);
10900
+ };
10901
+ const handleAddCcClick = () => {
10902
+ setShowCcForm(true);
10903
+ };
10904
+ const handleRemoveCc = () => {
10905
+ setShowCcForm(false);
10906
+ onCcEmailChange?.("");
10907
+ onCcEmailRemove?.();
10908
+ };
10821
10909
  return /* @__PURE__ */ jsxs(Card, { className: className || styles.card, children: [
10822
- /* @__PURE__ */ jsx(Title3, { children: mergedLabels.title }),
10823
- /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
10824
- /* @__PURE__ */ jsxs("div", { className: styles.fieldGroup, children: [
10825
- /* @__PURE__ */ jsx(Subtitle2, { className: styles.label, children: mergedLabels.ordererName }),
10910
+ /* @__PURE__ */ jsxs("div", { className: styles.header, children: [
10911
+ /* @__PURE__ */ jsx(Title3, { className: styles.title, children: mergedLabels.title }),
10912
+ /* @__PURE__ */ jsx(Divider, { className: styles.divider })
10913
+ ] }),
10914
+ /* @__PURE__ */ jsxs(Row, { children: [
10915
+ /* @__PURE__ */ jsx(Col, { md: 4, children: /* @__PURE__ */ jsxs("div", { className: styles.fieldGroup, children: [
10916
+ /* @__PURE__ */ jsx(Caption1, { className: styles.label, children: mergedLabels.ordererName }),
10826
10917
  /* @__PURE__ */ jsx(Body1, { className: styles.value, children: orderer?.name || "-" })
10827
- ] }),
10828
- /* @__PURE__ */ jsxs("div", { className: styles.fieldGroup, children: [
10829
- /* @__PURE__ */ jsx(Subtitle2, { className: styles.label, children: mergedLabels.phoneNumber }),
10918
+ ] }) }),
10919
+ /* @__PURE__ */ jsx(Col, { md: 4, children: /* @__PURE__ */ jsxs("div", { className: styles.fieldGroup, children: [
10920
+ /* @__PURE__ */ jsx(Caption1, { className: styles.label, children: mergedLabels.phoneNumber }),
10830
10921
  /* @__PURE__ */ jsx(Body1, { className: styles.value, children: orderer?.phoneNumber || "-" })
10831
- ] }),
10832
- /* @__PURE__ */ jsxs("div", { className: styles.fieldGroup, children: [
10833
- /* @__PURE__ */ jsx(Subtitle2, { className: styles.label, children: mergedLabels.email }),
10834
- /* @__PURE__ */ jsx(Body1, { className: styles.value, children: orderer?.email || "-" })
10835
- ] })
10922
+ ] }) }),
10923
+ /* @__PURE__ */ jsx(Col, { md: 4, children: /* @__PURE__ */ jsxs("div", { className: styles.fieldGroup, children: [
10924
+ /* @__PURE__ */ jsx(Caption1, { className: styles.label, children: mergedLabels.email }),
10925
+ /* @__PURE__ */ jsx(Body1, { className: styles.value, children: orderer?.email || "-" }),
10926
+ !showCcForm && /* @__PURE__ */ jsx(Link, { className: styles.addCcLink, onClick: handleAddCcClick, children: mergedLabels.addCcEmail })
10927
+ ] }) }),
10928
+ /* @__PURE__ */ jsx(Col, { md: 4, children: /* @__PURE__ */ jsxs("div", { className: styles.notificationSection, children: [
10929
+ /* @__PURE__ */ jsx(Body2, { className: styles.notificationLabel, children: mergedLabels.notificationLabel }),
10930
+ /* @__PURE__ */ jsxs(
10931
+ RadioGroup,
10932
+ {
10933
+ layout: "horizontal",
10934
+ value: notificationType,
10935
+ onChange: handleNotificationChange,
10936
+ children: [
10937
+ /* @__PURE__ */ jsx(Radio, { value: "whatsapp", label: mergedLabels.whatsapp }),
10938
+ /* @__PURE__ */ jsx(Radio, { value: "sms", label: mergedLabels.sms })
10939
+ ]
10940
+ }
10941
+ )
10942
+ ] }) }),
10943
+ /* @__PURE__ */ jsx(Col, { md: 4, children: /* @__PURE__ */ jsx("div", { className: styles.ccSection, children: showCcForm && /* @__PURE__ */ jsxs(Fragment, { children: [
10944
+ /* @__PURE__ */ jsx(Caption1, { className: styles.ccLabel, children: mergedLabels.ccEmail }),
10945
+ /* @__PURE__ */ jsx("div", { className: styles.ccInputRow, children: /* @__PURE__ */ jsx(
10946
+ Input,
10947
+ {
10948
+ className: styles.ccInput,
10949
+ type: "email",
10950
+ placeholder: mergedLabels.ccEmailPlaceholder,
10951
+ value: ccEmail ?? "",
10952
+ onChange: (_e, data) => onCcEmailChange?.(data.value),
10953
+ contentAfter: /* @__PURE__ */ jsx(
10954
+ Button,
10955
+ {
10956
+ appearance: "transparent",
10957
+ className: styles.deleteButton,
10958
+ onClick: handleRemoveCc,
10959
+ icon: /* @__PURE__ */ jsx(
10960
+ Icon,
10961
+ {
10962
+ icon: "fluent:delete-24-regular",
10963
+ color: tokens.colorStatusDangerForeground1,
10964
+ width: 18
10965
+ }
10966
+ )
10967
+ }
10968
+ )
10969
+ }
10970
+ ) }),
10971
+ /* @__PURE__ */ jsx(Caption2, { className: styles.ccHint, children: mergedLabels.ccEmailHint })
10972
+ ] }) }) })
10836
10973
  ] })
10837
10974
  ] });
10838
10975
  };