@asdp/ferryui 0.1.22-dev.9114 → 0.1.22-dev.9117

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,6 +1,6 @@
1
1
  import { makeStyles, tokens, createLightTheme, createDarkTheme, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Field, Caption1Strong, Caption2, Button, 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, Label, Text, Checkbox, MessageBar, MessageBarBody, Accordion, AccordionItem, AccordionHeader, AccordionPanel, RadioGroup, Radio, Menu, MenuTrigger, MenuPopover, MenuList, DialogActions, Caption2Strong, Subtitle1, Body1Stronger, Caption1Stronger, Display, Image, Title1, TabList, Tab, Body2, typographyStyles, Switch, Textarea, Link } from '@fluentui/react-components';
2
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
- import React5, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, Fragment as Fragment$1 } from 'react';
3
+ import React, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, Fragment as Fragment$1 } from 'react';
4
4
  import { Dismiss24Regular, DismissRegular, SubtractRegular, AddRegular, DeleteRegular, InfoRegular, SearchRegular } from '@fluentui/react-icons';
5
5
  import { Container, Row, Col, Visible } from 'react-grid-system';
6
6
  import { Icon } from '@iconify/react';
@@ -598,11 +598,13 @@ var CarouselWithCustomNav = ({
598
598
  cardFocus = false,
599
599
  showNavButtons = false,
600
600
  showCloseButton = false,
601
- onCloseClick
601
+ onCloseClick,
602
+ autoPlay = false,
603
+ autoPlayInterval = 5e3
602
604
  }) => {
603
605
  const styles = useStyles2();
604
606
  const [internalIndex, setInternalIndex] = useState(0);
605
- const labels = React5.useMemo(
607
+ const labels = React.useMemo(
606
608
  () => ({
607
609
  ...DEFAULT_LABELS2[language],
608
610
  ...customLabels,
@@ -620,6 +622,32 @@ var CarouselWithCustomNav = ({
620
622
  },
621
623
  [controlledIndex, onActiveIndexChange]
622
624
  );
625
+ React.useEffect(() => {
626
+ if (!autoPlay) return;
627
+ const totalSlides = React.Children.count(children);
628
+ if (totalSlides <= 1) return;
629
+ const intervalId = setInterval(() => {
630
+ let nextIndex = activeIndex + 1;
631
+ if (nextIndex >= totalSlides) {
632
+ nextIndex = circular ? 0 : activeIndex;
633
+ }
634
+ if (nextIndex !== activeIndex) {
635
+ if (controlledIndex === void 0) {
636
+ setInternalIndex(nextIndex);
637
+ }
638
+ onActiveIndexChange?.(nextIndex);
639
+ }
640
+ }, autoPlayInterval);
641
+ return () => clearInterval(intervalId);
642
+ }, [
643
+ autoPlay,
644
+ autoPlayInterval,
645
+ children,
646
+ circular,
647
+ activeIndex,
648
+ controlledIndex,
649
+ onActiveIndexChange
650
+ ]);
623
651
  const defaultAnnouncement = useCallback(
624
652
  (index, totalSlides) => {
625
653
  return labels.announcementTemplate.replace("{index}", (index + 1).toString()).replace("{total}", totalSlides.toString());
@@ -957,12 +985,12 @@ var useStyles4 = makeStyles({
957
985
  padding: 0,
958
986
  backgroundColor: "transparent",
959
987
  border: "none",
960
- height: "450px",
988
+ aspectRatio: "3/1",
961
989
  borderRadius: tokens.borderRadiusXLarge
962
990
  },
963
991
  bannerImage: {
964
992
  width: "100%",
965
- height: "auto",
993
+ aspectRatio: "3/1",
966
994
  objectFit: "cover",
967
995
  display: "block",
968
996
  cursor: "pointer",
@@ -1961,7 +1989,7 @@ var CardServiceMenu = ({
1961
1989
  return mergeClasses(styles.menuItem, isActive && styles.menuItemActive);
1962
1990
  };
1963
1991
  return /* @__PURE__ */ jsx(Card, { className: mergeClasses(styles.card, className), children: /* @__PURE__ */ jsx("div", { className: styles.menuList, children: menuItems.map((item, index) => {
1964
- return /* @__PURE__ */ jsxs(React5.Fragment, { children: [
1992
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
1965
1993
  /* @__PURE__ */ jsxs(
1966
1994
  Button,
1967
1995
  {
@@ -3757,7 +3785,7 @@ var CardTicketSearch = ({
3757
3785
  menuItems
3758
3786
  }) => {
3759
3787
  const styles = useStyles8();
3760
- const labels = React5.useMemo(
3788
+ const labels = React.useMemo(
3761
3789
  () => ({ ...DEFAULT_LABELS8[language], ...customLabels }),
3762
3790
  [language, customLabels]
3763
3791
  );
@@ -3778,7 +3806,7 @@ var CardTicketSearch = ({
3778
3806
  name: "roundTrip",
3779
3807
  defaultValue: roundTrip
3780
3808
  });
3781
- React5.useEffect(() => {
3809
+ React.useEffect(() => {
3782
3810
  setValue("from", from);
3783
3811
  setValue("to", to);
3784
3812
  setValue("startDate", startDate);
@@ -3798,7 +3826,7 @@ var CardTicketSearch = ({
3798
3826
  passenger,
3799
3827
  setValue
3800
3828
  ]);
3801
- React5.useEffect(() => {
3829
+ React.useEffect(() => {
3802
3830
  if (onRoundTripChange) {
3803
3831
  onRoundTripChange(roundTripValue);
3804
3832
  }
@@ -6312,7 +6340,7 @@ var SortMenu = ({
6312
6340
  clearFiltersText: deprecatedClearFiltersText
6313
6341
  }) => {
6314
6342
  const styles = useStyles15();
6315
- const labels = React5.useMemo(
6343
+ const labels = React.useMemo(
6316
6344
  () => ({
6317
6345
  ...DEFAULT_LABELS15[language],
6318
6346
  ...customLabels,
@@ -6335,11 +6363,11 @@ var SortMenu = ({
6335
6363
  deprecatedClearFiltersText
6336
6364
  ]
6337
6365
  );
6338
- const sortOptions = React5.useMemo(
6366
+ const sortOptions = React.useMemo(
6339
6367
  () => customSortOptions || getSortOptions(labels),
6340
6368
  [customSortOptions, labels]
6341
6369
  );
6342
- const currentSortLabel = React5.useMemo(
6370
+ const currentSortLabel = React.useMemo(
6343
6371
  () => sortOptions.find((opt) => opt.value === value)?.label || labels.recommendation,
6344
6372
  [sortOptions, value, labels.recommendation]
6345
6373
  );
@@ -11598,7 +11626,7 @@ var CardReview = ({
11598
11626
  }
11599
11627
  ) : (
11600
11628
  // Clone element to append className if it's a valid React element
11601
- React5.isValidElement(item.label) ? React5.cloneElement(item.label, {
11629
+ React.isValidElement(item.label) ? React.cloneElement(item.label, {
11602
11630
  className: `${styles.defaultLabel} ${item.labelClassName || ""}${item.label.props.className ? " " + item.label.props.className : ""}`
11603
11631
  }) : /* @__PURE__ */ jsx(
11604
11632
  "div",
@@ -11951,7 +11979,7 @@ var CardPriceDetails = ({
11951
11979
  const renderItem = (item, key) => {
11952
11980
  const variantClass = getVariantClass(item.variant);
11953
11981
  const isTaxLike = item.variant === "danger";
11954
- return /* @__PURE__ */ jsxs(React5.Fragment, { children: [
11982
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
11955
11983
  /* @__PURE__ */ jsxs("div", { className: styles.row, children: [
11956
11984
  isTaxLike ? /* @__PURE__ */ jsx(Body1Strong, { className: variantClass, children: item.name }) : /* @__PURE__ */ jsx(Caption1, { className: mergeClasses(styles.label, variantClass), children: item.name }),
11957
11985
  isTaxLike ? /* @__PURE__ */ jsxs(Body1Strong, { className: mergeClasses(styles.value, variantClass), children: [
@@ -11978,7 +12006,7 @@ var CardPriceDetails = ({
11978
12006
  section.detail.map((item, i) => renderItem(item, i))
11979
12007
  ] }, index);
11980
12008
  }
11981
- return /* @__PURE__ */ jsx(React5.Fragment, { children: section.detail.map((item, i) => renderItem(item, i)) }, index);
12009
+ return /* @__PURE__ */ jsx(React.Fragment, { children: section.detail.map((item, i) => renderItem(item, i)) }, index);
11982
12010
  }),
11983
12011
  /* @__PURE__ */ jsx(Divider, {}),
11984
12012
  /* @__PURE__ */ jsxs("div", { className: styles.totalRow, children: [
@@ -12972,7 +13000,7 @@ var uploadStyles = makeStyles({
12972
13000
  objectFit: "contain"
12973
13001
  }
12974
13002
  });
12975
- var FileUpload = React5.forwardRef(
13003
+ var FileUpload = React.forwardRef(
12976
13004
  ({
12977
13005
  name,
12978
13006
  control,