@scripso-homepad/ui 0.4.36 → 0.4.37
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/{chunk-AOBKWDGW.js → chunk-4FBZM62E.js} +3 -3
- package/dist/chunk-4FBZM62E.js.map +1 -0
- package/dist/index.cjs +9 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +55 -41
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +6 -2
- package/dist/web/index.d.ts +6 -2
- package/dist/web/index.js +56 -42
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button.tsx +5 -1
- package/src/components/PhoneInput.tsx +5 -0
- package/src/web/components/Drawer.tsx +2 -2
- package/src/web/components/Pagination.tsx +62 -58
- package/src/web/components/table/DataTable.tsx +2 -1
- package/src/web/components/table/TableScrollArea.tsx +1 -1
- package/src/web/layout/DashboardLayout.stories.tsx +2 -1
- package/src/web/layout/DashboardLayout.tsx +3 -3
- package/src/web/layout/Sidebar.stories.tsx +1 -0
- package/src/web/layout/Sidebar.tsx +33 -23
- package/src/web/layout/SidebarMobileHeader.stories.tsx +20 -0
- package/src/web/layout/SidebarMobileHeader.tsx +8 -3
- package/dist/chunk-AOBKWDGW.js.map +0 -1
package/dist/web/index.cjs
CHANGED
|
@@ -5382,7 +5382,7 @@ var require_react_dom_production_min = __commonJS({
|
|
|
5382
5382
|
if (5 === d || 6 === d) a = a.stateNode, b ? c.insertBefore(a, b) : c.appendChild(a);
|
|
5383
5383
|
else if (4 !== d && (a = a.child, null !== a)) for (Wj(a, b, c), a = a.sibling; null !== a; ) Wj(a, b, c), a = a.sibling;
|
|
5384
5384
|
}
|
|
5385
|
-
var
|
|
5385
|
+
var X2 = null;
|
|
5386
5386
|
var Xj = false;
|
|
5387
5387
|
function Yj(a, b, c) {
|
|
5388
5388
|
for (c = c.child; null !== c; ) Zj(a, b, c), c = c.sibling;
|
|
@@ -5396,23 +5396,23 @@ var require_react_dom_production_min = __commonJS({
|
|
|
5396
5396
|
case 5:
|
|
5397
5397
|
U || Lj(c, b);
|
|
5398
5398
|
case 6:
|
|
5399
|
-
var d =
|
|
5400
|
-
|
|
5399
|
+
var d = X2, e = Xj;
|
|
5400
|
+
X2 = null;
|
|
5401
5401
|
Yj(a, b, c);
|
|
5402
|
-
|
|
5402
|
+
X2 = d;
|
|
5403
5403
|
Xj = e;
|
|
5404
|
-
null !==
|
|
5404
|
+
null !== X2 && (Xj ? (a = X2, c = c.stateNode, 8 === a.nodeType ? a.parentNode.removeChild(c) : a.removeChild(c)) : X2.removeChild(c.stateNode));
|
|
5405
5405
|
break;
|
|
5406
5406
|
case 18:
|
|
5407
|
-
null !==
|
|
5407
|
+
null !== X2 && (Xj ? (a = X2, c = c.stateNode, 8 === a.nodeType ? Kf(a.parentNode, c) : 1 === a.nodeType && Kf(a, c), bd(a)) : Kf(X2, c.stateNode));
|
|
5408
5408
|
break;
|
|
5409
5409
|
case 4:
|
|
5410
|
-
d =
|
|
5410
|
+
d = X2;
|
|
5411
5411
|
e = Xj;
|
|
5412
|
-
|
|
5412
|
+
X2 = c.stateNode.containerInfo;
|
|
5413
5413
|
Xj = true;
|
|
5414
5414
|
Yj(a, b, c);
|
|
5415
|
-
|
|
5415
|
+
X2 = d;
|
|
5416
5416
|
Xj = e;
|
|
5417
5417
|
break;
|
|
5418
5418
|
case 0:
|
|
@@ -5469,23 +5469,23 @@ var require_react_dom_production_min = __commonJS({
|
|
|
5469
5469
|
a: for (; null !== h; ) {
|
|
5470
5470
|
switch (h.tag) {
|
|
5471
5471
|
case 5:
|
|
5472
|
-
|
|
5472
|
+
X2 = h.stateNode;
|
|
5473
5473
|
Xj = false;
|
|
5474
5474
|
break a;
|
|
5475
5475
|
case 3:
|
|
5476
|
-
|
|
5476
|
+
X2 = h.stateNode.containerInfo;
|
|
5477
5477
|
Xj = true;
|
|
5478
5478
|
break a;
|
|
5479
5479
|
case 4:
|
|
5480
|
-
|
|
5480
|
+
X2 = h.stateNode.containerInfo;
|
|
5481
5481
|
Xj = true;
|
|
5482
5482
|
break a;
|
|
5483
5483
|
}
|
|
5484
5484
|
h = h.return;
|
|
5485
5485
|
}
|
|
5486
|
-
if (null ===
|
|
5486
|
+
if (null === X2) throw Error(p(160));
|
|
5487
5487
|
Zj(f, g, e);
|
|
5488
|
-
|
|
5488
|
+
X2 = null;
|
|
5489
5489
|
Xj = false;
|
|
5490
5490
|
var k = e.alternate;
|
|
5491
5491
|
null !== k && (k.return = null);
|
|
@@ -29782,6 +29782,7 @@ function Sidebar({
|
|
|
29782
29782
|
className,
|
|
29783
29783
|
mobileOpen,
|
|
29784
29784
|
onMobileClose,
|
|
29785
|
+
onMobileOpen,
|
|
29785
29786
|
onNavItemClick,
|
|
29786
29787
|
collapseIcon,
|
|
29787
29788
|
expandIcon,
|
|
@@ -29790,12 +29791,14 @@ function Sidebar({
|
|
|
29790
29791
|
collapsed,
|
|
29791
29792
|
onCollapsedChange
|
|
29792
29793
|
}) {
|
|
29793
|
-
const isDesktop = useMediaQuery("(min-width:
|
|
29794
|
+
const isDesktop = useMediaQuery("(min-width: 1024px)");
|
|
29795
|
+
const isRailLayout = useMediaQuery("(min-width: 768px)");
|
|
29794
29796
|
const [internalCollapsed, setInternalCollapsed] = react.useState(
|
|
29795
29797
|
() => readInitialCollapsedState(sidebarStorageKey, initialCollapsed)
|
|
29796
29798
|
);
|
|
29797
29799
|
const isCollapsed = collapsed ?? internalCollapsed;
|
|
29798
|
-
const isExpanded = isDesktop ? !isCollapsed :
|
|
29800
|
+
const isExpanded = isDesktop ? !isCollapsed : mobileOpen;
|
|
29801
|
+
const showCollapsedRail = isRailLayout && !isDesktop;
|
|
29799
29802
|
const setCollapsed = react.useCallback(
|
|
29800
29803
|
(next) => {
|
|
29801
29804
|
if (collapsed === void 0) {
|
|
@@ -29814,8 +29817,12 @@ function Sidebar({
|
|
|
29814
29817
|
toggleCollapsed();
|
|
29815
29818
|
return;
|
|
29816
29819
|
}
|
|
29817
|
-
|
|
29818
|
-
|
|
29820
|
+
if (mobileOpen) {
|
|
29821
|
+
onMobileClose?.();
|
|
29822
|
+
return;
|
|
29823
|
+
}
|
|
29824
|
+
onMobileOpen?.();
|
|
29825
|
+
}, [isDesktop, mobileOpen, onMobileClose, onMobileOpen, toggleCollapsed]);
|
|
29819
29826
|
const handleNavItemNavigate = react.useCallback(
|
|
29820
29827
|
(item) => {
|
|
29821
29828
|
onNavItemClick?.(item);
|
|
@@ -29855,23 +29862,26 @@ function Sidebar({
|
|
|
29855
29862
|
"aria-label": labels.closeMenu,
|
|
29856
29863
|
onClick: onMobileClose,
|
|
29857
29864
|
className: cn(
|
|
29858
|
-
"fixed inset-0 z-40 bg-navy-800/60 backdrop-blur-[1px] transition-opacity duration-300 ease-in-out
|
|
29865
|
+
"fixed inset-0 z-40 bg-navy-800/60 backdrop-blur-[1px] transition-opacity duration-300 ease-in-out lg:hidden",
|
|
29859
29866
|
mobileOpen ? "opacity-100" : "pointer-events-none opacity-0"
|
|
29860
29867
|
)
|
|
29861
29868
|
}
|
|
29862
29869
|
),
|
|
29870
|
+
showCollapsedRail && mobileOpen ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-screen w-[76px] shrink-0", "aria-hidden": true }) : null,
|
|
29863
29871
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
29864
29872
|
"aside",
|
|
29865
29873
|
{
|
|
29866
29874
|
className: cn(
|
|
29867
29875
|
"fixed inset-y-0 left-0 z-50 flex h-screen w-[min(300px,85vw)] flex-col gap-8 overflow-hidden bg-navy p-4 shadow-xl",
|
|
29868
29876
|
"transition-[transform,width,padding,gap] duration-300 ease-in-out will-change-[transform,width]",
|
|
29869
|
-
mobileOpen ? "translate-x-0" : "-translate-x-full",
|
|
29870
|
-
"md:relative md:z-auto md:w-[
|
|
29871
|
-
|
|
29877
|
+
mobileOpen ? "translate-x-0" : "-translate-x-full pointer-events-none",
|
|
29878
|
+
"md:relative md:z-auto md:w-[76px] md:translate-x-0 md:pointer-events-auto md:shadow-none md:items-center md:gap-2 md:px-3 md:py-4",
|
|
29879
|
+
mobileOpen && "md:fixed md:z-50 md:w-[min(300px,85vw)] md:items-stretch md:gap-8 md:p-4 md:shadow-xl",
|
|
29880
|
+
"lg:relative lg:z-auto lg:translate-x-0 lg:pointer-events-auto lg:shadow-none",
|
|
29881
|
+
isExpanded ? "lg:w-[300px] lg:items-stretch lg:gap-8 lg:p-4" : "lg:w-[76px] lg:items-center lg:gap-2 lg:px-3 lg:py-4",
|
|
29872
29882
|
className
|
|
29873
29883
|
),
|
|
29874
|
-
"aria-hidden": !isDesktop && !mobileOpen,
|
|
29884
|
+
"aria-hidden": !isDesktop && !mobileOpen && !showCollapsedRail,
|
|
29875
29885
|
children: [
|
|
29876
29886
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
29877
29887
|
"div",
|
|
@@ -29903,8 +29913,8 @@ function Sidebar({
|
|
|
29903
29913
|
type: "button",
|
|
29904
29914
|
onClick: handleHeaderAction,
|
|
29905
29915
|
className: "shrink-0 cursor-pointer text-white transition-[opacity,transform] duration-200 hover:opacity-80 active:scale-95",
|
|
29906
|
-
"aria-label":
|
|
29907
|
-
children:
|
|
29916
|
+
"aria-label": isExpanded ? isDesktop ? labels.collapse : labels.closeMenu : labels.expand,
|
|
29917
|
+
children: isExpanded ? collapseIcon ?? closeIcon ?? /* @__PURE__ */ jsxRuntime.jsx(SidebarCollapseIcon, {}) : expandIcon ?? /* @__PURE__ */ jsxRuntime.jsx(SidebarExpandIcon, {})
|
|
29908
29918
|
}
|
|
29909
29919
|
)
|
|
29910
29920
|
]
|
|
@@ -29953,7 +29963,8 @@ function SidebarMobileHeader({
|
|
|
29953
29963
|
openMenuLabel,
|
|
29954
29964
|
onOpenMenu,
|
|
29955
29965
|
menuOpen = false,
|
|
29956
|
-
className
|
|
29966
|
+
className,
|
|
29967
|
+
end
|
|
29957
29968
|
}) {
|
|
29958
29969
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29959
29970
|
"header",
|
|
@@ -29971,16 +29982,17 @@ function SidebarMobileHeader({
|
|
|
29971
29982
|
className: "flex size-10 items-center justify-center rounded-xl text-navy transition-colors hover:bg-storm-gray-50",
|
|
29972
29983
|
"aria-label": openMenuLabel,
|
|
29973
29984
|
"aria-expanded": menuOpen,
|
|
29974
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29985
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SidebarExpandIcon, { size: 22 })
|
|
29975
29986
|
}
|
|
29976
29987
|
),
|
|
29977
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
29988
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
29978
29989
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: branding.logoIconSrc, alt: "", className: "h-[30px] w-[42px] shrink-0" }),
|
|
29979
29990
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 leading-none", children: [
|
|
29980
29991
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-base font-bold tracking-tight text-navy", children: branding.logoTitle }),
|
|
29981
29992
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[6.5px] font-normal tracking-[-0.26px] text-navy-300 uppercase", children: branding.logoTagline })
|
|
29982
29993
|
] })
|
|
29983
|
-
] })
|
|
29994
|
+
] }),
|
|
29995
|
+
end ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: end }) : null
|
|
29984
29996
|
]
|
|
29985
29997
|
}
|
|
29986
29998
|
);
|
|
@@ -29993,12 +30005,12 @@ function DashboardLayout({
|
|
|
29993
30005
|
className,
|
|
29994
30006
|
mainClassName
|
|
29995
30007
|
}) {
|
|
29996
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex h-screen overflow-hidden flex-row bg-storm-gray-0", className), children: [
|
|
29997
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-screen shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Sidebar, { ...sidebar }) }),
|
|
30008
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex h-screen min-w-0 overflow-hidden flex-row bg-storm-gray-0", className), children: [
|
|
30009
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-md:contents md:h-screen md:shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Sidebar, { ...sidebar }) }),
|
|
29998
30010
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-screen min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: [
|
|
29999
30011
|
/* @__PURE__ */ jsxRuntime.jsx(SidebarMobileHeader, { ...mobileHeader }),
|
|
30000
30012
|
/* @__PURE__ */ jsxRuntime.jsx(AppHeader, { ...header }),
|
|
30001
|
-
/* @__PURE__ */ jsxRuntime.jsx("main", { className: mainClassName ?? "min-h-0 flex-1 overflow-y-auto p-4
|
|
30013
|
+
/* @__PURE__ */ jsxRuntime.jsx("main", { className: mainClassName ?? "min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto p-4 xl:p-6", children })
|
|
30002
30014
|
] })
|
|
30003
30015
|
] });
|
|
30004
30016
|
}
|
|
@@ -30334,21 +30346,22 @@ function Pagination({
|
|
|
30334
30346
|
const visiblePages = getVisiblePageNumbers(safePage, totalPages, maxPageButtons);
|
|
30335
30347
|
const canGoPrevious = safePage > 1;
|
|
30336
30348
|
const canGoNext = safePage < totalPages;
|
|
30337
|
-
|
|
30349
|
+
const showPageControls = totalPages > 1;
|
|
30350
|
+
if (hideOnSinglePage && !showPageControls) {
|
|
30338
30351
|
return null;
|
|
30339
30352
|
}
|
|
30340
30353
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30341
30354
|
"div",
|
|
30342
30355
|
{
|
|
30343
30356
|
className: cn(
|
|
30344
|
-
"flex flex-col gap-4 px-4 pb-4 pt-4 font-[family-name:var(--font-sans)] sm:flex-row sm:items-center sm:justify-between",
|
|
30357
|
+
"flex flex-col items-center gap-4 px-4 pb-4 pt-4 text-center font-[family-name:var(--font-sans)] sm:flex-row sm:items-center sm:justify-between sm:text-left",
|
|
30345
30358
|
variant === "standalone" && cn("rounded-xl border bg-storm-gray-0", "border-storm-gray-50"),
|
|
30346
30359
|
dataTableClassNames.pagination,
|
|
30347
30360
|
className
|
|
30348
30361
|
),
|
|
30349
30362
|
children: [
|
|
30350
30363
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "typography-12 font-medium text-storm-gray-200", children: mergedLabels.showing({ start, end, total }) }),
|
|
30351
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
30364
|
+
showPageControls ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30352
30365
|
"nav",
|
|
30353
30366
|
{
|
|
30354
30367
|
"aria-label": "Pagination",
|
|
@@ -30416,7 +30429,7 @@ function Pagination({
|
|
|
30416
30429
|
)
|
|
30417
30430
|
]
|
|
30418
30431
|
}
|
|
30419
|
-
)
|
|
30432
|
+
) : null
|
|
30420
30433
|
]
|
|
30421
30434
|
}
|
|
30422
30435
|
);
|
|
@@ -30858,7 +30871,7 @@ function TableScrollArea({
|
|
|
30858
30871
|
"div",
|
|
30859
30872
|
{
|
|
30860
30873
|
className: cn(
|
|
30861
|
-
"table-scroll-area w-full overflow-auto",
|
|
30874
|
+
"table-scroll-area w-full min-w-0 max-w-full overflow-auto",
|
|
30862
30875
|
fillHeight && "min-h-0 flex-1",
|
|
30863
30876
|
className
|
|
30864
30877
|
),
|
|
@@ -30912,7 +30925,7 @@ function DataTable({
|
|
|
30912
30925
|
}),
|
|
30913
30926
|
[className, classNames, footerClassName, scrollClassName, tableClassName]
|
|
30914
30927
|
);
|
|
30915
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DataTableClassNamesContext.Provider, { value: mergedClassNames, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col", fillHeight && "min-h-0 flex-1", mergedClassNames.root), children: [
|
|
30928
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DataTableClassNamesContext.Provider, { value: mergedClassNames, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex min-w-0 flex-col", fillHeight && "min-h-0 flex-1", mergedClassNames.root), children: [
|
|
30916
30929
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30917
30930
|
"div",
|
|
30918
30931
|
{
|
|
@@ -30940,6 +30953,7 @@ function DataTable({
|
|
|
30940
30953
|
"div",
|
|
30941
30954
|
{
|
|
30942
30955
|
className: cn(
|
|
30956
|
+
"shrink-0",
|
|
30943
30957
|
tableFooterShellClassName,
|
|
30944
30958
|
tableBorderClassName,
|
|
30945
30959
|
mergedClassNames.footer
|
|
@@ -31092,7 +31106,7 @@ function Button({
|
|
|
31092
31106
|
const customIcon = icon != null && typeof icon !== "boolean" ? icon : void 0;
|
|
31093
31107
|
const hasIcon = showIcon || icon === true || customIcon != null;
|
|
31094
31108
|
const resolvedContainerClassName = [
|
|
31095
|
-
reactNative.Platform.OS === "web" ? "max-md:px-4!" : "",
|
|
31109
|
+
reactNative.Platform.OS === "web" ? hasIcon ? "max-md:pl-4! pr-2!" : "max-md:px-4!" : "",
|
|
31096
31110
|
className
|
|
31097
31111
|
].filter(Boolean).join(" ");
|
|
31098
31112
|
useApplyWebClassName(containerRef, resolvedContainerClassName || void 0);
|
|
@@ -31445,7 +31459,7 @@ function Drawer({
|
|
|
31445
31459
|
type: "button",
|
|
31446
31460
|
"aria-label": closeAriaLabel,
|
|
31447
31461
|
className: cn(
|
|
31448
|
-
"absolute inset-0 bg-storm-gray-850/40 backdrop-blur-[12px] transition-opacity duration-300 ease-in-out",
|
|
31462
|
+
"absolute inset-0 z-0 cursor-pointer bg-storm-gray-850/40 backdrop-blur-[12px] transition-opacity duration-300 ease-in-out",
|
|
31449
31463
|
isAnimatedIn ? "opacity-100" : "opacity-0"
|
|
31450
31464
|
),
|
|
31451
31465
|
onClick: onClose
|
|
@@ -31459,7 +31473,7 @@ function Drawer({
|
|
|
31459
31473
|
"aria-labelledby": "homepad-drawer-title",
|
|
31460
31474
|
...subtitle ? { "aria-describedby": "homepad-drawer-subtitle" } : {},
|
|
31461
31475
|
className: cn(
|
|
31462
|
-
"relative z-10 flex h-[calc(100dvh-16px)] min-h-0 flex-col overflow-hidden rounded-[16px] bg-white shadow-2xl transition-transform duration-300 ease-in-out max-md:h-dvh max-md:rounded-none",
|
|
31476
|
+
"relative z-10 flex h-[calc(100dvh-16px)] min-h-0 cursor-auto flex-col overflow-hidden rounded-[16px] bg-white shadow-2xl transition-transform duration-300 ease-in-out max-md:h-dvh max-md:rounded-none",
|
|
31463
31477
|
// Keep GPU transform only while animating — settled translate-x-0 blurs text.
|
|
31464
31478
|
!isTransformSettled && "will-change-transform",
|
|
31465
31479
|
isAnimatedIn ? isTransformSettled ? "transform-none" : "translate-x-0" : "translate-x-full",
|