@underverse-ui/underverse 2.0.18 → 2.0.20

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "sourceEntry": "src/index.ts",
5
- "totalExports": 259,
5
+ "totalExports": 260,
6
6
  "exports": [
7
7
  {
8
8
  "name": "*",
@@ -1533,6 +1533,13 @@
1533
1533
  "local": false,
1534
1534
  "aliasOf": "default"
1535
1535
  },
1536
+ {
1537
+ "name": "ToastProviderProps",
1538
+ "kind": "type",
1539
+ "source": "./components/Toast",
1540
+ "reexport": true,
1541
+ "local": false
1542
+ },
1536
1543
  {
1537
1544
  "name": "ToggleGroup",
1538
1545
  "kind": "value",
package/dist/index.cjs CHANGED
@@ -13213,7 +13213,12 @@ var useToast = () => {
13213
13213
  }
13214
13214
  return context;
13215
13215
  };
13216
- var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
13216
+ var ToastProvider = ({
13217
+ children,
13218
+ position = "top-right",
13219
+ maxToasts = 5,
13220
+ viewportClassName
13221
+ }) => {
13217
13222
  const [toasts, setToasts] = (0, import_react13.useState)([]);
13218
13223
  const idRef = (0, import_react13.useRef)(0);
13219
13224
  const removeToast = (0, import_react13.useCallback)((id) => {
@@ -13240,7 +13245,15 @@ var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
13240
13245
  };
13241
13246
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
13242
13247
  children,
13243
- /* @__PURE__ */ (0, import_jsx_runtime26.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_runtime26.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
13248
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
13249
+ "div",
13250
+ {
13251
+ className: cn("fixed z-99999 flex flex-col gap-2 pointer-events-none", positionClasses[position], viewportClassName),
13252
+ "aria-live": "polite",
13253
+ "aria-atomic": true,
13254
+ children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id))
13255
+ }
13256
+ )
13244
13257
  ] });
13245
13258
  };
13246
13259
  var ToastComponent = ({ toast, onRemove }) => {
@@ -13312,6 +13325,7 @@ var ToastComponent = ({ toast, onRemove }) => {
13312
13325
  isVisible ? "opacity-100 translate-x-0" : "opacity-0 translate-x-full"
13313
13326
  ),
13314
13327
  role: "status",
13328
+ "data-variant": toast.type,
13315
13329
  "aria-live": toast.type === "error" ? "assertive" : "polite",
13316
13330
  onMouseEnter: () => {
13317
13331
  if (toast.duration === 0) return;
@@ -31873,6 +31887,7 @@ function DataTableHeader({
31873
31887
  // src/components/DataTable/components/Pagination.tsx
31874
31888
  var import_react35 = __toESM(require("react"), 1);
31875
31889
  init_cn();
31890
+ init_radius();
31876
31891
  var import_jsx_runtime71 = require("react/jsx-runtime");
31877
31892
  function DataTablePagination({
31878
31893
  totalItems,
@@ -31883,7 +31898,8 @@ function DataTablePagination({
31883
31898
  setCurPageSize,
31884
31899
  size,
31885
31900
  align,
31886
- paginationRange
31901
+ paginationRange,
31902
+ borderMode
31887
31903
  }) {
31888
31904
  const totalPages = Math.ceil(totalItems / curPageSize);
31889
31905
  const pages = import_react35.default.useMemo(() => {
@@ -31899,7 +31915,8 @@ function DataTablePagination({
31899
31915
  const controlButtonSize = size === "lg" ? "md" : "sm";
31900
31916
  const navBtnClass = size === "sm" ? "h-6 w-6 p-0 rounded-full" : size === "lg" ? "h-8 w-8 p-0 rounded-full" : "h-7 w-7 p-0 rounded-full";
31901
31917
  const navIconClass = size === "sm" ? "h-3.5 w-3.5" : size === "lg" ? "h-5 w-5" : "h-4 w-4";
31902
- const pageBtnClass = size === "sm" ? "h-6 min-w-6 px-1.5 rounded-full text-[11px] font-medium transition-colors" : size === "lg" ? "h-8 min-w-8 px-2.5 rounded-full text-sm font-medium transition-colors" : "h-7 min-w-7 px-2 rounded-full text-xs font-medium transition-colors";
31918
+ const pageBtnRadiusClass = getBorderRadiusClass(borderMode);
31919
+ const pageBtnClass = size === "sm" ? "h-6 min-w-6 px-1.5 text-[11px] font-medium transition-colors" : size === "lg" ? "h-8 min-w-8 px-2.5 text-sm font-medium transition-colors" : "h-7 min-w-7 px-2 text-xs font-medium transition-colors";
31903
31920
  const containerTextClass = size === "sm" ? "text-[11px]" : size === "lg" ? "text-sm" : "text-xs";
31904
31921
  const pageSizeClass = size === "sm" ? "w-16" : size === "lg" ? "w-24" : "w-20";
31905
31922
  return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: cn("relative flex items-center gap-2 px-1 pt-3 text-muted-foreground", containerTextClass), children: [
@@ -31929,7 +31946,7 @@ function DataTablePagination({
31929
31946
  "div",
31930
31947
  {
31931
31948
  className: cn(
31932
- "flex items-center gap-0.5",
31949
+ "flex items-center gap-3",
31933
31950
  align === "center" && "absolute left-1/2 -translate-x-1/2",
31934
31951
  align === "right" && "ml-auto"
31935
31952
  ),
@@ -31945,17 +31962,17 @@ function DataTablePagination({
31945
31962
  children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("svg", { className: navIconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
31946
31963
  }
31947
31964
  ),
31948
- pages.map(
31965
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "flex items-center gap-2", children: pages.map(
31949
31966
  (p, i) => p === "..." ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "px-1 text-muted-foreground/60", children: "\u2026" }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
31950
31967
  "button",
31951
31968
  {
31952
31969
  onClick: () => setCurPage(p),
31953
- className: cn(pageBtnClass, curPage === p ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground"),
31970
+ className: cn(pageBtnClass, pageBtnRadiusClass, curPage === p ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground"),
31954
31971
  children: p
31955
31972
  },
31956
31973
  p
31957
31974
  )
31958
- ),
31975
+ ) }),
31959
31976
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
31960
31977
  Button_default,
31961
31978
  {
@@ -32934,7 +32951,8 @@ function DataTable({
32934
32951
  setCurPageSize,
32935
32952
  size,
32936
32953
  align: paginationAlign,
32937
- paginationRange
32954
+ paginationRange,
32955
+ borderMode: resolvedBorderMode
32938
32956
  }
32939
32957
  )
32940
32958
  ] });