@underverse-ui/underverse 0.2.17 → 0.2.19

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.js CHANGED
@@ -2251,29 +2251,28 @@ var useToast = () => {
2251
2251
  }
2252
2252
  return context;
2253
2253
  };
2254
- var ToastProvider = ({
2255
- children,
2256
- position = "top-right",
2257
- maxToasts = 5
2258
- }) => {
2254
+ var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
2259
2255
  const [toasts, setToasts] = useState8([]);
2260
2256
  const idRef = useRef2(0);
2261
2257
  const removeToast = useCallback2((id) => {
2262
2258
  setToasts((prev) => prev.filter((toast) => toast.id !== id));
2263
2259
  }, []);
2264
- const addToast = useCallback2((toast) => {
2265
- const id = `toast-${++idRef.current}`;
2266
- const newToast = { ...toast, id };
2267
- setToasts((prev) => {
2268
- const updated = [newToast, ...prev];
2269
- return updated.slice(0, maxToasts);
2270
- });
2271
- if (toast.duration !== 0) {
2272
- setTimeout(() => {
2273
- removeToast(id);
2274
- }, toast.duration || 5e3);
2275
- }
2276
- }, [maxToasts, removeToast]);
2260
+ const addToast = useCallback2(
2261
+ (toast) => {
2262
+ const id = `toast-${++idRef.current}`;
2263
+ const newToast = { ...toast, id };
2264
+ setToasts((prev) => {
2265
+ const updated = [newToast, ...prev];
2266
+ return updated.slice(0, maxToasts);
2267
+ });
2268
+ if (toast.duration !== 0) {
2269
+ setTimeout(() => {
2270
+ removeToast(id);
2271
+ }, toast.duration || 5e3);
2272
+ }
2273
+ },
2274
+ [maxToasts, removeToast]
2275
+ );
2277
2276
  const positionClasses = {
2278
2277
  "top-right": "top-4 right-4",
2279
2278
  "top-left": "top-4 left-4",
@@ -2284,7 +2283,7 @@ var ToastProvider = ({
2284
2283
  };
2285
2284
  return /* @__PURE__ */ jsxs12(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
2286
2285
  children,
2287
- /* @__PURE__ */ jsx14("div", { className: cn("fixed z-50 flex flex-col gap-2 pointer-events-none", positionClasses[position]), "aria-live": "polite", "aria-atomic": true, children: toasts.map((toast) => /* @__PURE__ */ jsx14(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
2286
+ /* @__PURE__ */ jsx14("div", { className: cn("fixed z-[99999] flex flex-col gap-2 pointer-events-none", positionClasses[position]), "aria-live": "polite", "aria-atomic": true, children: toasts.map((toast) => /* @__PURE__ */ jsx14(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
2288
2287
  ] });
2289
2288
  };
2290
2289
  var ToastComponent = ({ toast, onRemove }) => {
@@ -3725,36 +3724,34 @@ var DropdownMenu = ({
3725
3724
  if (open && triggerRef.current && contentRef.current) {
3726
3725
  const rect = triggerRef.current.getBoundingClientRect();
3727
3726
  const menuRect = contentRef.current.getBoundingClientRect();
3728
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
3729
- const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
3730
3727
  const viewportHeight = window.innerHeight;
3731
- let top = rect.bottom + scrollTop + 4;
3732
- let left = rect.left + scrollLeft;
3728
+ let top = rect.bottom + 4;
3729
+ let left = rect.left;
3733
3730
  if (rect.bottom + menuRect.height > viewportHeight && rect.top > menuRect.height) {
3734
- top = rect.top + scrollTop - menuRect.height - 4;
3731
+ top = rect.top - menuRect.height - 4;
3735
3732
  }
3736
3733
  switch (placement) {
3737
3734
  case "top":
3738
3735
  case "top-start":
3739
- top = rect.top + scrollTop - menuRect.height - 4;
3736
+ top = rect.top - menuRect.height - 4;
3740
3737
  break;
3741
3738
  case "top-end":
3742
- top = rect.top + scrollTop - menuRect.height - 4;
3743
- left = rect.right + scrollLeft - menuRect.width;
3739
+ top = rect.top - menuRect.height - 4;
3740
+ left = rect.right - menuRect.width;
3744
3741
  break;
3745
3742
  case "bottom":
3746
3743
  case "bottom-start":
3747
3744
  break;
3748
3745
  case "bottom-end":
3749
- left = rect.right + scrollLeft - menuRect.width;
3746
+ left = rect.right - menuRect.width;
3750
3747
  break;
3751
3748
  case "left":
3752
- top = rect.top + scrollTop;
3753
- left = rect.left + scrollLeft - menuRect.width - 4;
3749
+ top = rect.top;
3750
+ left = rect.left - menuRect.width - 4;
3754
3751
  break;
3755
3752
  case "right":
3756
- top = rect.top + scrollTop;
3757
- left = rect.right + scrollLeft + 4;
3753
+ top = rect.top;
3754
+ left = rect.right + 4;
3758
3755
  break;
3759
3756
  }
3760
3757
  setPosition({ top, left });
@@ -3828,7 +3825,7 @@ var DropdownMenu = ({
3828
3825
  "data-combobox-dropdown": true,
3829
3826
  ref: contentRef,
3830
3827
  style: {
3831
- position: "absolute",
3828
+ position: "fixed",
3832
3829
  top: position?.top ?? -9999,
3833
3830
  left: position?.left ?? -9999,
3834
3831
  zIndex: 9999,
@@ -4919,7 +4916,7 @@ var DatePicker = ({
4919
4916
  size === "sm" ? "w-7 h-7 text-[12px]" : "w-8 h-8 text-sm",
4920
4917
  "datepicker-day rounded-md focus:outline-none",
4921
4918
  "transition-colors",
4922
- isSelected ? "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary focus:text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
4919
+ isSelected ? "!bg-primary text-primary-foreground font-bold ring-2 ring-primary-foreground/60 shadow-lg scale-105 z-10 hover:!bg-primary focus:!bg-primary focus:text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
4923
4920
  isToday2 && !isSelected && "bg-accent text-accent-foreground font-semibold"
4924
4921
  ),
4925
4922
  children: day
@@ -9834,68 +9831,28 @@ var LoadingBar = ({
9834
9831
  // ../../components/ui/Table.tsx
9835
9832
  import React36 from "react";
9836
9833
  import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
9837
- var Table = React36.forwardRef(
9838
- ({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx45(
9839
- "div",
9840
- {
9841
- className: cn(
9842
- "relative w-full overflow-auto",
9843
- "rounded-lg md:rounded-xl border border-border",
9844
- "bg-card text-card-foreground shadow-sm",
9845
- "backdrop-blur-sm transition-all duration-300",
9846
- containerClassName
9847
- ),
9848
- children: /* @__PURE__ */ jsx45(
9849
- "table",
9850
- {
9851
- ref,
9852
- className: cn("w-full caption-bottom text-sm", className),
9853
- ...props
9854
- }
9855
- )
9856
- }
9857
- )
9858
- );
9859
- Table.displayName = "Table";
9860
- var TableHeader = React36.forwardRef(
9861
- ({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs40(
9862
- "thead",
9863
- {
9864
- ref,
9865
- className: cn(
9866
- "[&_tr]:border-b [&_tr]:border-border",
9867
- "bg-muted/20",
9868
- className
9869
- ),
9870
- ...props,
9871
- children: [
9872
- children,
9873
- filterRow
9874
- ]
9875
- }
9876
- )
9877
- );
9878
- TableHeader.displayName = "TableHeader";
9879
- var TableBody = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
9880
- "tbody",
9834
+ var Table = React36.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx45(
9835
+ "div",
9881
9836
  {
9882
- ref,
9883
- className: cn("[&_tr:last-child]:border-0", className),
9884
- ...props
9885
- }
9886
- ));
9887
- TableBody.displayName = "TableBody";
9888
- var TableFooter = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
9889
- "tfoot",
9890
- {
9891
- ref,
9892
9837
  className: cn(
9893
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
9894
- className
9838
+ "relative w-full overflow-auto",
9839
+ "rounded-lg md:rounded-xl border border-border",
9840
+ "bg-card text-card-foreground shadow-sm",
9841
+ "backdrop-blur-sm transition-all duration-300",
9842
+ containerClassName
9895
9843
  ),
9896
- ...props
9844
+ children: /* @__PURE__ */ jsx45("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props })
9897
9845
  }
9898
9846
  ));
9847
+ Table.displayName = "Table";
9848
+ var TableHeader = React36.forwardRef(({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs40("thead", { ref, className: cn("[&_tr]:border-b [&_tr]:border-border", "bg-muted/50", className), ...props, children: [
9849
+ children,
9850
+ filterRow
9851
+ ] }));
9852
+ TableHeader.displayName = "TableHeader";
9853
+ var TableBody = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
9854
+ TableBody.displayName = "TableBody";
9855
+ var TableFooter = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
9899
9856
  TableFooter.displayName = "TableFooter";
9900
9857
  var TableRow = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
9901
9858
  "tr",
@@ -9915,31 +9872,14 @@ var TableHead = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE_
9915
9872
  "th",
9916
9873
  {
9917
9874
  ref,
9918
- className: cn(
9919
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
9920
- className
9921
- ),
9875
+ className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className),
9922
9876
  ...props
9923
9877
  }
9924
9878
  ));
9925
9879
  TableHead.displayName = "TableHead";
9926
- var TableCell = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
9927
- "td",
9928
- {
9929
- ref,
9930
- className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
9931
- ...props
9932
- }
9933
- ));
9880
+ var TableCell = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props }));
9934
9881
  TableCell.displayName = "TableCell";
9935
- var TableCaption = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
9936
- "caption",
9937
- {
9938
- ref,
9939
- className: cn("mt-4 text-sm text-muted-foreground", className),
9940
- ...props
9941
- }
9942
- ));
9882
+ var TableCaption = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
9943
9883
  TableCaption.displayName = "TableCaption";
9944
9884
 
9945
9885
  // ../../components/ui/DataTable.tsx
@@ -10310,7 +10250,7 @@ function DataTable({
10310
10250
  /* @__PURE__ */ jsx46("span", { className: "text-sm", children: "Loading..." })
10311
10251
  ] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ jsx46(TableRow, { children: /* @__PURE__ */ jsx46(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => {
10312
10252
  const isLastRow = idx === displayedData.length - 1;
10313
- return /* @__PURE__ */ jsx46(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col, colIdx) => {
10253
+ return /* @__PURE__ */ jsx46(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/50"), children: visibleColumns.map((col, colIdx) => {
10314
10254
  const value = col.dataIndex ? row[col.dataIndex] : void 0;
10315
10255
  return /* @__PURE__ */ jsx46(
10316
10256
  TableCell,