elseware-ui 2.37.0 → 2.37.2

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 CHANGED
@@ -1708,7 +1708,7 @@ interface ContentAreaProps {
1708
1708
  styles?: string;
1709
1709
  enablePadding?: boolean;
1710
1710
  }
1711
- declare function ContentArea({ children, styles, enablePadding, }: ContentAreaProps): React__default.JSX.Element;
1711
+ declare const ContentArea: React__default.ForwardRefExoticComponent<ContentAreaProps & React__default.RefAttributes<HTMLDivElement>>;
1712
1712
 
1713
1713
  interface FlexColProps$1 {
1714
1714
  children?: React__default.ReactNode;
@@ -1836,10 +1836,13 @@ interface DrawerProps {
1836
1836
  side?: "left" | "right" | "top" | "bottom";
1837
1837
  handleClose: () => void;
1838
1838
  styles?: string;
1839
+ backdropStyles?: string;
1839
1840
  showBackdrop?: boolean;
1840
1841
  closeOnBackdropClick?: boolean;
1842
+ offsetTop?: string;
1843
+ offsetBottom?: string;
1841
1844
  }
1842
- declare const Drawer: ({ children, visibility, side, handleClose, styles, showBackdrop, closeOnBackdropClick, }: DrawerProps) => React__default.JSX.Element;
1845
+ declare const Drawer: ({ children, visibility, side, handleClose, styles, backdropStyles, showBackdrop, closeOnBackdropClick, offsetTop, offsetBottom, }: DrawerProps) => React__default.JSX.Element;
1843
1846
 
1844
1847
  interface DrawerTogglerProps {
1845
1848
  icon?: ReactNode;
@@ -3149,6 +3152,7 @@ declare const useDrawer: (defaultVisibility?: boolean) => {
3149
3152
  show: boolean;
3150
3153
  openDrawer: () => void;
3151
3154
  closeDrawer: () => void;
3155
+ toggleDrawer: () => void;
3152
3156
  };
3153
3157
 
3154
3158
  declare const useModal: () => {
package/dist/index.d.ts CHANGED
@@ -1708,7 +1708,7 @@ interface ContentAreaProps {
1708
1708
  styles?: string;
1709
1709
  enablePadding?: boolean;
1710
1710
  }
1711
- declare function ContentArea({ children, styles, enablePadding, }: ContentAreaProps): React__default.JSX.Element;
1711
+ declare const ContentArea: React__default.ForwardRefExoticComponent<ContentAreaProps & React__default.RefAttributes<HTMLDivElement>>;
1712
1712
 
1713
1713
  interface FlexColProps$1 {
1714
1714
  children?: React__default.ReactNode;
@@ -1836,10 +1836,13 @@ interface DrawerProps {
1836
1836
  side?: "left" | "right" | "top" | "bottom";
1837
1837
  handleClose: () => void;
1838
1838
  styles?: string;
1839
+ backdropStyles?: string;
1839
1840
  showBackdrop?: boolean;
1840
1841
  closeOnBackdropClick?: boolean;
1842
+ offsetTop?: string;
1843
+ offsetBottom?: string;
1841
1844
  }
1842
- declare const Drawer: ({ children, visibility, side, handleClose, styles, showBackdrop, closeOnBackdropClick, }: DrawerProps) => React__default.JSX.Element;
1845
+ declare const Drawer: ({ children, visibility, side, handleClose, styles, backdropStyles, showBackdrop, closeOnBackdropClick, offsetTop, offsetBottom, }: DrawerProps) => React__default.JSX.Element;
1843
1846
 
1844
1847
  interface DrawerTogglerProps {
1845
1848
  icon?: ReactNode;
@@ -3149,6 +3152,7 @@ declare const useDrawer: (defaultVisibility?: boolean) => {
3149
3152
  show: boolean;
3150
3153
  openDrawer: () => void;
3151
3154
  closeDrawer: () => void;
3155
+ toggleDrawer: () => void;
3152
3156
  };
3153
3157
 
3154
3158
  declare const useModal: () => {
package/dist/index.js CHANGED
@@ -19596,25 +19596,24 @@ function TextArea({
19596
19596
  ] });
19597
19597
  }
19598
19598
  var TextArea_default = TextArea;
19599
- function ContentArea({
19600
- children,
19601
- styles,
19602
- enablePadding = false
19603
- }) {
19604
- return /* @__PURE__ */ jsxRuntime.jsx(
19605
- "div",
19606
- {
19607
- className: classNames17__default.default({
19608
- "min-h-screen h-full w-full py-3 px-5": true,
19609
- "py-3 px-5": !enablePadding,
19610
- "py-3 px-5 lg:px-[150px]": enablePadding,
19611
- "transition-all duration-[200ms]": true,
19612
- [`${styles}`]: styles
19613
- }),
19614
- children
19615
- }
19616
- );
19617
- }
19599
+ var ContentArea = React2.forwardRef(
19600
+ ({ children, styles, enablePadding = false }, ref) => {
19601
+ return /* @__PURE__ */ jsxRuntime.jsx(
19602
+ "div",
19603
+ {
19604
+ ref,
19605
+ className: classNames17__default.default({
19606
+ "min-h-screen h-full w-full transition-all duration-[200ms]": true,
19607
+ "py-3 px-5": !enablePadding,
19608
+ "py-3 px-5 lg:px-[150px]": enablePadding,
19609
+ [`${styles}`]: Boolean(styles)
19610
+ }),
19611
+ children
19612
+ }
19613
+ );
19614
+ }
19615
+ );
19616
+ ContentArea.displayName = "ContentArea";
19618
19617
  var ContentArea_default = ContentArea;
19619
19618
  function FlexCol({ children, gap = 3, styles }) {
19620
19619
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -20196,26 +20195,40 @@ var Drawer = ({
20196
20195
  side = "left",
20197
20196
  handleClose,
20198
20197
  styles,
20198
+ backdropStyles,
20199
20199
  showBackdrop = true,
20200
- closeOnBackdropClick = true
20200
+ closeOnBackdropClick = true,
20201
+ offsetTop = "0px",
20202
+ offsetBottom = "0px"
20201
20203
  }) => {
20202
20204
  const isHorizontal = side === "left" || side === "right";
20203
20205
  const isMobile = useIsMobile_default();
20206
+ const hasOffset = offsetTop !== "0px" || offsetBottom !== "0px";
20207
+ const drawerStyle = isHorizontal ? {
20208
+ top: offsetTop,
20209
+ bottom: offsetBottom,
20210
+ height: hasOffset ? `calc(100vh - ${offsetTop} - ${offsetBottom})` : void 0
20211
+ } : void 0;
20204
20212
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20205
20213
  isMobile && showBackdrop && /* @__PURE__ */ jsxRuntime.jsx(TransitionFade_default, { visibility, leaveDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsx(
20206
20214
  "div",
20207
20215
  {
20208
- className: "fixed inset-0 bg-black/50 z-40",
20216
+ className: classNames17__default.default(
20217
+ "fixed inset-0 bg-black/50 z-40",
20218
+ backdropStyles
20219
+ ),
20209
20220
  onClick: closeOnBackdropClick ? handleClose : void 0
20210
20221
  }
20211
20222
  ) }),
20212
20223
  /* @__PURE__ */ jsxRuntime.jsx(TransitionSlide_default, { visibility, side, leaveDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsx(
20213
20224
  "div",
20214
20225
  {
20226
+ style: drawerStyle,
20215
20227
  className: classNames17__default.default(
20216
20228
  "fixed shadow-lg z-50",
20217
20229
  {
20218
- "h-full w-[300px] top-0": isHorizontal,
20230
+ "h-full w-[300px] top-0": isHorizontal && !hasOffset,
20231
+ "w-[300px]": isHorizontal && hasOffset,
20219
20232
  "w-full h-[300px] left-0": !isHorizontal,
20220
20233
  "left-0": side === "left",
20221
20234
  "right-0": side === "right",
@@ -21751,16 +21764,20 @@ function CommentHeader({ comment, config }) {
21751
21764
  var CommentHeader_default = CommentHeader;
21752
21765
  var useDrawer = (defaultVisibility = true) => {
21753
21766
  const [show, setShow] = React2.useState(defaultVisibility);
21754
- const openDrawer = () => {
21755
- setShow((prev) => !prev);
21756
- };
21757
- const closeDrawer = () => {
21767
+ const openDrawer = React2.useCallback(() => {
21768
+ setShow(true);
21769
+ }, []);
21770
+ const closeDrawer = React2.useCallback(() => {
21758
21771
  setShow(false);
21759
- };
21772
+ }, []);
21773
+ const toggleDrawer = React2.useCallback(() => {
21774
+ setShow((prev) => !prev);
21775
+ }, []);
21760
21776
  return {
21761
21777
  show,
21762
21778
  openDrawer,
21763
- closeDrawer
21779
+ closeDrawer,
21780
+ toggleDrawer
21764
21781
  };
21765
21782
  };
21766
21783
  var useDrawer_default = useDrawer;
@@ -23561,12 +23578,7 @@ function MyReviewPanel({
23561
23578
  maxRating: config.maxRating
23562
23579
  }
23563
23580
  ),
23564
- config.allowRecommendation && /* @__PURE__ */ jsxRuntime.jsx(
23565
- RecommendationComponent,
23566
- {
23567
- isRecommended: myReview.isRecommended
23568
- }
23569
- )
23581
+ config.allowRecommendation && /* @__PURE__ */ jsxRuntime.jsx(RecommendationComponent, { isRecommended: myReview.isRecommended })
23570
23582
  ] })
23571
23583
  ] }) })
23572
23584
  ] });
@@ -23940,7 +23952,13 @@ function ReviewItem({
23940
23952
  ] }),
23941
23953
  /* @__PURE__ */ jsxRuntime.jsx(ContentComponent, { review }),
23942
23954
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
23943
- /* @__PURE__ */ jsxRuntime.jsx(RatingComponent, { rating: review.rating, maxRating: config.maxRating }),
23955
+ /* @__PURE__ */ jsxRuntime.jsx(
23956
+ RatingComponent,
23957
+ {
23958
+ rating: review.rating,
23959
+ maxRating: config.maxRating
23960
+ }
23961
+ ),
23944
23962
  config.allowRecommendation && /* @__PURE__ */ jsxRuntime.jsx(RecommendationComponent, { isRecommended: review.isRecommended })
23945
23963
  ] }),
23946
23964
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -23991,13 +24009,7 @@ function ReviewList({
23991
24009
  const ItemComponent = components?.Item ?? ReviewItem_default;
23992
24010
  const EmptyStateComponent = components?.EmptyState ?? ReviewEmptyState_default;
23993
24011
  if (!reviews.length) {
23994
- return /* @__PURE__ */ jsxRuntime.jsx(
23995
- EmptyStateComponent,
23996
- {
23997
- title: config.emptyTitle,
23998
- text: config.emptyText
23999
- }
24000
- );
24012
+ return /* @__PURE__ */ jsxRuntime.jsx(EmptyStateComponent, { title: config.emptyTitle, text: config.emptyText });
24001
24013
  }
24002
24014
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-5", children: reviews.map((review) => /* @__PURE__ */ jsxRuntime.jsx(
24003
24015
  ItemComponent,
@@ -24220,12 +24232,7 @@ function useReviewThreadState({
24220
24232
  setIsCreatingReviewReply(false);
24221
24233
  }
24222
24234
  },
24223
- [
24224
- applyReview,
24225
- applyReviewUpdater,
24226
- config.maxRepliesPerReview,
24227
- dataSource
24228
- ]
24235
+ [applyReview, applyReviewUpdater, config.maxRepliesPerReview, dataSource]
24229
24236
  );
24230
24237
  const updateReviewReply2 = React2.useCallback(
24231
24238
  async (input) => {