@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.cjs CHANGED
@@ -2406,29 +2406,28 @@ var useToast = () => {
2406
2406
  }
2407
2407
  return context;
2408
2408
  };
2409
- var ToastProvider = ({
2410
- children,
2411
- position = "top-right",
2412
- maxToasts = 5
2413
- }) => {
2409
+ var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
2414
2410
  const [toasts, setToasts] = (0, import_react7.useState)([]);
2415
2411
  const idRef = (0, import_react7.useRef)(0);
2416
2412
  const removeToast = (0, import_react7.useCallback)((id) => {
2417
2413
  setToasts((prev) => prev.filter((toast) => toast.id !== id));
2418
2414
  }, []);
2419
- const addToast = (0, import_react7.useCallback)((toast) => {
2420
- const id = `toast-${++idRef.current}`;
2421
- const newToast = { ...toast, id };
2422
- setToasts((prev) => {
2423
- const updated = [newToast, ...prev];
2424
- return updated.slice(0, maxToasts);
2425
- });
2426
- if (toast.duration !== 0) {
2427
- setTimeout(() => {
2428
- removeToast(id);
2429
- }, toast.duration || 5e3);
2430
- }
2431
- }, [maxToasts, removeToast]);
2415
+ const addToast = (0, import_react7.useCallback)(
2416
+ (toast) => {
2417
+ const id = `toast-${++idRef.current}`;
2418
+ const newToast = { ...toast, id };
2419
+ setToasts((prev) => {
2420
+ const updated = [newToast, ...prev];
2421
+ return updated.slice(0, maxToasts);
2422
+ });
2423
+ if (toast.duration !== 0) {
2424
+ setTimeout(() => {
2425
+ removeToast(id);
2426
+ }, toast.duration || 5e3);
2427
+ }
2428
+ },
2429
+ [maxToasts, removeToast]
2430
+ );
2432
2431
  const positionClasses = {
2433
2432
  "top-right": "top-4 right-4",
2434
2433
  "top-left": "top-4 left-4",
@@ -2439,7 +2438,7 @@ var ToastProvider = ({
2439
2438
  };
2440
2439
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
2441
2440
  children,
2442
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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__ */ (0, import_jsx_runtime14.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
2441
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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__ */ (0, import_jsx_runtime14.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
2443
2442
  ] });
2444
2443
  };
2445
2444
  var ToastComponent = ({ toast, onRemove }) => {
@@ -3880,36 +3879,34 @@ var DropdownMenu = ({
3880
3879
  if (open && triggerRef.current && contentRef.current) {
3881
3880
  const rect = triggerRef.current.getBoundingClientRect();
3882
3881
  const menuRect = contentRef.current.getBoundingClientRect();
3883
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
3884
- const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
3885
3882
  const viewportHeight = window.innerHeight;
3886
- let top = rect.bottom + scrollTop + 4;
3887
- let left = rect.left + scrollLeft;
3883
+ let top = rect.bottom + 4;
3884
+ let left = rect.left;
3888
3885
  if (rect.bottom + menuRect.height > viewportHeight && rect.top > menuRect.height) {
3889
- top = rect.top + scrollTop - menuRect.height - 4;
3886
+ top = rect.top - menuRect.height - 4;
3890
3887
  }
3891
3888
  switch (placement) {
3892
3889
  case "top":
3893
3890
  case "top-start":
3894
- top = rect.top + scrollTop - menuRect.height - 4;
3891
+ top = rect.top - menuRect.height - 4;
3895
3892
  break;
3896
3893
  case "top-end":
3897
- top = rect.top + scrollTop - menuRect.height - 4;
3898
- left = rect.right + scrollLeft - menuRect.width;
3894
+ top = rect.top - menuRect.height - 4;
3895
+ left = rect.right - menuRect.width;
3899
3896
  break;
3900
3897
  case "bottom":
3901
3898
  case "bottom-start":
3902
3899
  break;
3903
3900
  case "bottom-end":
3904
- left = rect.right + scrollLeft - menuRect.width;
3901
+ left = rect.right - menuRect.width;
3905
3902
  break;
3906
3903
  case "left":
3907
- top = rect.top + scrollTop;
3908
- left = rect.left + scrollLeft - menuRect.width - 4;
3904
+ top = rect.top;
3905
+ left = rect.left - menuRect.width - 4;
3909
3906
  break;
3910
3907
  case "right":
3911
- top = rect.top + scrollTop;
3912
- left = rect.right + scrollLeft + 4;
3908
+ top = rect.top;
3909
+ left = rect.right + 4;
3913
3910
  break;
3914
3911
  }
3915
3912
  setPosition({ top, left });
@@ -3983,7 +3980,7 @@ var DropdownMenu = ({
3983
3980
  "data-combobox-dropdown": true,
3984
3981
  ref: contentRef,
3985
3982
  style: {
3986
- position: "absolute",
3983
+ position: "fixed",
3987
3984
  top: position?.top ?? -9999,
3988
3985
  left: position?.left ?? -9999,
3989
3986
  zIndex: 9999,
@@ -5074,7 +5071,7 @@ var DatePicker = ({
5074
5071
  size === "sm" ? "w-7 h-7 text-[12px]" : "w-8 h-8 text-sm",
5075
5072
  "datepicker-day rounded-md focus:outline-none",
5076
5073
  "transition-colors",
5077
- 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",
5074
+ 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",
5078
5075
  isToday2 && !isSelected && "bg-accent text-accent-foreground font-semibold"
5079
5076
  ),
5080
5077
  children: day
@@ -9989,68 +9986,28 @@ var LoadingBar = ({
9989
9986
  // ../../components/ui/Table.tsx
9990
9987
  var import_react22 = __toESM(require("react"), 1);
9991
9988
  var import_jsx_runtime45 = require("react/jsx-runtime");
9992
- var Table = import_react22.default.forwardRef(
9993
- ({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
9994
- "div",
9995
- {
9996
- className: cn(
9997
- "relative w-full overflow-auto",
9998
- "rounded-lg md:rounded-xl border border-border",
9999
- "bg-card text-card-foreground shadow-sm",
10000
- "backdrop-blur-sm transition-all duration-300",
10001
- containerClassName
10002
- ),
10003
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10004
- "table",
10005
- {
10006
- ref,
10007
- className: cn("w-full caption-bottom text-sm", className),
10008
- ...props
10009
- }
10010
- )
10011
- }
10012
- )
10013
- );
10014
- Table.displayName = "Table";
10015
- var TableHeader = import_react22.default.forwardRef(
10016
- ({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
10017
- "thead",
10018
- {
10019
- ref,
10020
- className: cn(
10021
- "[&_tr]:border-b [&_tr]:border-border",
10022
- "bg-muted/20",
10023
- className
10024
- ),
10025
- ...props,
10026
- children: [
10027
- children,
10028
- filterRow
10029
- ]
10030
- }
10031
- )
10032
- );
10033
- TableHeader.displayName = "TableHeader";
10034
- var TableBody = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10035
- "tbody",
9989
+ var Table = import_react22.default.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
9990
+ "div",
10036
9991
  {
10037
- ref,
10038
- className: cn("[&_tr:last-child]:border-0", className),
10039
- ...props
10040
- }
10041
- ));
10042
- TableBody.displayName = "TableBody";
10043
- var TableFooter = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10044
- "tfoot",
10045
- {
10046
- ref,
10047
9992
  className: cn(
10048
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
10049
- className
9993
+ "relative w-full overflow-auto",
9994
+ "rounded-lg md:rounded-xl border border-border",
9995
+ "bg-card text-card-foreground shadow-sm",
9996
+ "backdrop-blur-sm transition-all duration-300",
9997
+ containerClassName
10050
9998
  ),
10051
- ...props
9999
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props })
10052
10000
  }
10053
10001
  ));
10002
+ Table.displayName = "Table";
10003
+ var TableHeader = import_react22.default.forwardRef(({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("thead", { ref, className: cn("[&_tr]:border-b [&_tr]:border-border", "bg-muted/50", className), ...props, children: [
10004
+ children,
10005
+ filterRow
10006
+ ] }));
10007
+ TableHeader.displayName = "TableHeader";
10008
+ var TableBody = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
10009
+ TableBody.displayName = "TableBody";
10010
+ var TableFooter = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
10054
10011
  TableFooter.displayName = "TableFooter";
10055
10012
  var TableRow = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10056
10013
  "tr",
@@ -10070,31 +10027,14 @@ var TableHead = import_react22.default.forwardRef(({ className, ...props }, ref)
10070
10027
  "th",
10071
10028
  {
10072
10029
  ref,
10073
- className: cn(
10074
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
10075
- className
10076
- ),
10030
+ className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className),
10077
10031
  ...props
10078
10032
  }
10079
10033
  ));
10080
10034
  TableHead.displayName = "TableHead";
10081
- var TableCell = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10082
- "td",
10083
- {
10084
- ref,
10085
- className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
10086
- ...props
10087
- }
10088
- ));
10035
+ var TableCell = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props }));
10089
10036
  TableCell.displayName = "TableCell";
10090
- var TableCaption = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10091
- "caption",
10092
- {
10093
- ref,
10094
- className: cn("mt-4 text-sm text-muted-foreground", className),
10095
- ...props
10096
- }
10097
- ));
10037
+ var TableCaption = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
10098
10038
  TableCaption.displayName = "TableCaption";
10099
10039
 
10100
10040
  // ../../components/ui/DataTable.tsx
@@ -10465,7 +10405,7 @@ function DataTable({
10465
10405
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm", children: "Loading..." })
10466
10406
  ] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => {
10467
10407
  const isLastRow = idx === displayedData.length - 1;
10468
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col, colIdx) => {
10408
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/50"), children: visibleColumns.map((col, colIdx) => {
10469
10409
  const value = col.dataIndex ? row[col.dataIndex] : void 0;
10470
10410
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
10471
10411
  TableCell,