@scripso-homepad/ui 0.4.35 → 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 +113 -41
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +23 -3
- package/dist/web/index.d.ts +23 -3
- package/dist/web/index.js +113 -43
- 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/icons/SidebarCollapseIcon.tsx +32 -0
- package/src/web/icons/SidebarExpandIcon.tsx +32 -0
- package/src/web/index.ts +2 -0
- 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 +35 -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.d.cts
CHANGED
|
@@ -103,6 +103,7 @@ type SidebarProps = {
|
|
|
103
103
|
className?: string;
|
|
104
104
|
mobileOpen: boolean;
|
|
105
105
|
onMobileClose?: () => void;
|
|
106
|
+
onMobileOpen?: () => void;
|
|
106
107
|
/**
|
|
107
108
|
* Host-owned navigation. Call `navigate(item.to)` from the app router here.
|
|
108
109
|
* The sidebar never imports react-router, so this must perform the route change.
|
|
@@ -115,7 +116,7 @@ type SidebarProps = {
|
|
|
115
116
|
collapsed?: boolean;
|
|
116
117
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
117
118
|
};
|
|
118
|
-
declare function Sidebar({ navItems, footerNavItems, branding, labels, sidebarStorageKey, pathname, user, onLogout, className, mobileOpen, onMobileClose, onNavItemClick, collapseIcon, expandIcon, closeIcon, initialCollapsed, collapsed, onCollapsedChange, }: SidebarProps): react.JSX.Element;
|
|
119
|
+
declare function Sidebar({ navItems, footerNavItems, branding, labels, sidebarStorageKey, pathname, user, onLogout, className, mobileOpen, onMobileClose, onMobileOpen, onNavItemClick, collapseIcon, expandIcon, closeIcon, initialCollapsed, collapsed, onCollapsedChange, }: SidebarProps): react.JSX.Element;
|
|
119
120
|
|
|
120
121
|
type SidebarMobileHeaderProps = {
|
|
121
122
|
branding: Pick<AdminSidebarBranding, 'logoIconSrc' | 'logoTitle' | 'logoTagline'>;
|
|
@@ -123,8 +124,10 @@ type SidebarMobileHeaderProps = {
|
|
|
123
124
|
onOpenMenu: () => void;
|
|
124
125
|
menuOpen?: boolean;
|
|
125
126
|
className?: string;
|
|
127
|
+
/** Rendered on the right side of the mobile header (e.g. notifications). */
|
|
128
|
+
end?: ReactNode;
|
|
126
129
|
};
|
|
127
|
-
declare function SidebarMobileHeader({ branding, openMenuLabel, onOpenMenu, menuOpen, className, }: SidebarMobileHeaderProps): react.JSX.Element;
|
|
130
|
+
declare function SidebarMobileHeader({ branding, openMenuLabel, onOpenMenu, menuOpen, className, end, }: SidebarMobileHeaderProps): react.JSX.Element;
|
|
128
131
|
|
|
129
132
|
type DashboardLayoutProps = {
|
|
130
133
|
sidebar: SidebarProps;
|
|
@@ -169,6 +172,22 @@ type BuildingIconProps = {
|
|
|
169
172
|
};
|
|
170
173
|
declare function BuildingIcon({ className }: BuildingIconProps): react.JSX.Element;
|
|
171
174
|
|
|
175
|
+
type SidebarCollapseIconProps = {
|
|
176
|
+
className?: string;
|
|
177
|
+
size?: number | string;
|
|
178
|
+
strokeWidth?: number | string;
|
|
179
|
+
};
|
|
180
|
+
/** Shown when the sidebar is open — click collapses it. */
|
|
181
|
+
declare function SidebarCollapseIcon({ className, size, strokeWidth, }: SidebarCollapseIconProps): react.JSX.Element;
|
|
182
|
+
|
|
183
|
+
type SidebarExpandIconProps = {
|
|
184
|
+
className?: string;
|
|
185
|
+
size?: number | string;
|
|
186
|
+
strokeWidth?: number | string;
|
|
187
|
+
};
|
|
188
|
+
/** Shown when the sidebar is closed — click expands it. */
|
|
189
|
+
declare function SidebarExpandIcon({ className, size, strokeWidth, }: SidebarExpandIconProps): react.JSX.Element;
|
|
190
|
+
|
|
172
191
|
type TableMoreIconProps = {
|
|
173
192
|
className?: string;
|
|
174
193
|
};
|
|
@@ -252,6 +271,7 @@ type PaginationProps = {
|
|
|
252
271
|
*/
|
|
253
272
|
variant?: PaginationVariant;
|
|
254
273
|
className?: string;
|
|
274
|
+
/** Hide the entire bar when there is only one page. Page buttons are always hidden in that case. */
|
|
255
275
|
hideOnSinglePage?: boolean;
|
|
256
276
|
};
|
|
257
277
|
declare function Pagination({ page, pageSize, total, onPageChange, labels, maxPageButtons, variant, className, hideOnSinglePage, }: PaginationProps): react.JSX.Element | null;
|
|
@@ -533,4 +553,4 @@ declare function useOnClickOutside<T extends HTMLElement>(ref: OutsideTarget<T>,
|
|
|
533
553
|
|
|
534
554
|
declare function cn(...inputs: ClassValue[]): string;
|
|
535
555
|
|
|
536
|
-
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, ConfirmModal, type ConfirmModalProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Drawer, type DrawerProps, HistoryTimeline, type HistoryTimelineItem, type HistoryTimelineProps, type HomepadToasterProps, Modal, type ModalFooterAlign, type ModalFooterLayout, type ModalProps, type MutationToastMessages, type MutationToastResult, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, type RunMutationWithToastOptions, Sidebar, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, Toaster, ToasterProvider, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, isNavItemActive, runMutationWithToast, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
556
|
+
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, ConfirmModal, type ConfirmModalProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Drawer, type DrawerProps, HistoryTimeline, type HistoryTimelineItem, type HistoryTimelineProps, type HomepadToasterProps, Modal, type ModalFooterAlign, type ModalFooterLayout, type ModalProps, type MutationToastMessages, type MutationToastResult, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, type RunMutationWithToastOptions, Sidebar, SidebarCollapseIcon, SidebarExpandIcon, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, Toaster, ToasterProvider, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, isNavItemActive, runMutationWithToast, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
package/dist/web/index.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ type SidebarProps = {
|
|
|
103
103
|
className?: string;
|
|
104
104
|
mobileOpen: boolean;
|
|
105
105
|
onMobileClose?: () => void;
|
|
106
|
+
onMobileOpen?: () => void;
|
|
106
107
|
/**
|
|
107
108
|
* Host-owned navigation. Call `navigate(item.to)` from the app router here.
|
|
108
109
|
* The sidebar never imports react-router, so this must perform the route change.
|
|
@@ -115,7 +116,7 @@ type SidebarProps = {
|
|
|
115
116
|
collapsed?: boolean;
|
|
116
117
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
117
118
|
};
|
|
118
|
-
declare function Sidebar({ navItems, footerNavItems, branding, labels, sidebarStorageKey, pathname, user, onLogout, className, mobileOpen, onMobileClose, onNavItemClick, collapseIcon, expandIcon, closeIcon, initialCollapsed, collapsed, onCollapsedChange, }: SidebarProps): react.JSX.Element;
|
|
119
|
+
declare function Sidebar({ navItems, footerNavItems, branding, labels, sidebarStorageKey, pathname, user, onLogout, className, mobileOpen, onMobileClose, onMobileOpen, onNavItemClick, collapseIcon, expandIcon, closeIcon, initialCollapsed, collapsed, onCollapsedChange, }: SidebarProps): react.JSX.Element;
|
|
119
120
|
|
|
120
121
|
type SidebarMobileHeaderProps = {
|
|
121
122
|
branding: Pick<AdminSidebarBranding, 'logoIconSrc' | 'logoTitle' | 'logoTagline'>;
|
|
@@ -123,8 +124,10 @@ type SidebarMobileHeaderProps = {
|
|
|
123
124
|
onOpenMenu: () => void;
|
|
124
125
|
menuOpen?: boolean;
|
|
125
126
|
className?: string;
|
|
127
|
+
/** Rendered on the right side of the mobile header (e.g. notifications). */
|
|
128
|
+
end?: ReactNode;
|
|
126
129
|
};
|
|
127
|
-
declare function SidebarMobileHeader({ branding, openMenuLabel, onOpenMenu, menuOpen, className, }: SidebarMobileHeaderProps): react.JSX.Element;
|
|
130
|
+
declare function SidebarMobileHeader({ branding, openMenuLabel, onOpenMenu, menuOpen, className, end, }: SidebarMobileHeaderProps): react.JSX.Element;
|
|
128
131
|
|
|
129
132
|
type DashboardLayoutProps = {
|
|
130
133
|
sidebar: SidebarProps;
|
|
@@ -169,6 +172,22 @@ type BuildingIconProps = {
|
|
|
169
172
|
};
|
|
170
173
|
declare function BuildingIcon({ className }: BuildingIconProps): react.JSX.Element;
|
|
171
174
|
|
|
175
|
+
type SidebarCollapseIconProps = {
|
|
176
|
+
className?: string;
|
|
177
|
+
size?: number | string;
|
|
178
|
+
strokeWidth?: number | string;
|
|
179
|
+
};
|
|
180
|
+
/** Shown when the sidebar is open — click collapses it. */
|
|
181
|
+
declare function SidebarCollapseIcon({ className, size, strokeWidth, }: SidebarCollapseIconProps): react.JSX.Element;
|
|
182
|
+
|
|
183
|
+
type SidebarExpandIconProps = {
|
|
184
|
+
className?: string;
|
|
185
|
+
size?: number | string;
|
|
186
|
+
strokeWidth?: number | string;
|
|
187
|
+
};
|
|
188
|
+
/** Shown when the sidebar is closed — click expands it. */
|
|
189
|
+
declare function SidebarExpandIcon({ className, size, strokeWidth, }: SidebarExpandIconProps): react.JSX.Element;
|
|
190
|
+
|
|
172
191
|
type TableMoreIconProps = {
|
|
173
192
|
className?: string;
|
|
174
193
|
};
|
|
@@ -252,6 +271,7 @@ type PaginationProps = {
|
|
|
252
271
|
*/
|
|
253
272
|
variant?: PaginationVariant;
|
|
254
273
|
className?: string;
|
|
274
|
+
/** Hide the entire bar when there is only one page. Page buttons are always hidden in that case. */
|
|
255
275
|
hideOnSinglePage?: boolean;
|
|
256
276
|
};
|
|
257
277
|
declare function Pagination({ page, pageSize, total, onPageChange, labels, maxPageButtons, variant, className, hideOnSinglePage, }: PaginationProps): react.JSX.Element | null;
|
|
@@ -533,4 +553,4 @@ declare function useOnClickOutside<T extends HTMLElement>(ref: OutsideTarget<T>,
|
|
|
533
553
|
|
|
534
554
|
declare function cn(...inputs: ClassValue[]): string;
|
|
535
555
|
|
|
536
|
-
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, ConfirmModal, type ConfirmModalProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Drawer, type DrawerProps, HistoryTimeline, type HistoryTimelineItem, type HistoryTimelineProps, type HomepadToasterProps, Modal, type ModalFooterAlign, type ModalFooterLayout, type ModalProps, type MutationToastMessages, type MutationToastResult, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, type RunMutationWithToastOptions, Sidebar, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, Toaster, ToasterProvider, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, isNavItemActive, runMutationWithToast, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
556
|
+
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, ConfirmModal, type ConfirmModalProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Drawer, type DrawerProps, HistoryTimeline, type HistoryTimelineItem, type HistoryTimelineProps, type HomepadToasterProps, Modal, type ModalFooterAlign, type ModalFooterLayout, type ModalProps, type MutationToastMessages, type MutationToastResult, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, type RunMutationWithToastOptions, Sidebar, SidebarCollapseIcon, SidebarExpandIcon, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, Toaster, ToasterProvider, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, isNavItemActive, runMutationWithToast, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
package/dist/web/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __commonJS, __require, __toESM, Input, Button } from '../chunk-
|
|
2
|
-
import { ChevronsUpDown, Search, LogOut,
|
|
1
|
+
import { __commonJS, __require, __toESM, Input, Button } from '../chunk-4FBZM62E.js';
|
|
2
|
+
import { ChevronsUpDown, Search, LogOut, ChevronLeft, ChevronRight, X } from 'lucide-react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -5344,7 +5344,7 @@ var require_react_dom_production_min = __commonJS({
|
|
|
5344
5344
|
if (5 === d || 6 === d) a = a.stateNode, b ? c.insertBefore(a, b) : c.appendChild(a);
|
|
5345
5345
|
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;
|
|
5346
5346
|
}
|
|
5347
|
-
var
|
|
5347
|
+
var X2 = null;
|
|
5348
5348
|
var Xj = false;
|
|
5349
5349
|
function Yj(a, b, c) {
|
|
5350
5350
|
for (c = c.child; null !== c; ) Zj(a, b, c), c = c.sibling;
|
|
@@ -5358,23 +5358,23 @@ var require_react_dom_production_min = __commonJS({
|
|
|
5358
5358
|
case 5:
|
|
5359
5359
|
U || Lj(c, b);
|
|
5360
5360
|
case 6:
|
|
5361
|
-
var d =
|
|
5362
|
-
|
|
5361
|
+
var d = X2, e = Xj;
|
|
5362
|
+
X2 = null;
|
|
5363
5363
|
Yj(a, b, c);
|
|
5364
|
-
|
|
5364
|
+
X2 = d;
|
|
5365
5365
|
Xj = e;
|
|
5366
|
-
null !==
|
|
5366
|
+
null !== X2 && (Xj ? (a = X2, c = c.stateNode, 8 === a.nodeType ? a.parentNode.removeChild(c) : a.removeChild(c)) : X2.removeChild(c.stateNode));
|
|
5367
5367
|
break;
|
|
5368
5368
|
case 18:
|
|
5369
|
-
null !==
|
|
5369
|
+
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));
|
|
5370
5370
|
break;
|
|
5371
5371
|
case 4:
|
|
5372
|
-
d =
|
|
5372
|
+
d = X2;
|
|
5373
5373
|
e = Xj;
|
|
5374
|
-
|
|
5374
|
+
X2 = c.stateNode.containerInfo;
|
|
5375
5375
|
Xj = true;
|
|
5376
5376
|
Yj(a, b, c);
|
|
5377
|
-
|
|
5377
|
+
X2 = d;
|
|
5378
5378
|
Xj = e;
|
|
5379
5379
|
break;
|
|
5380
5380
|
case 0:
|
|
@@ -5431,23 +5431,23 @@ var require_react_dom_production_min = __commonJS({
|
|
|
5431
5431
|
a: for (; null !== h; ) {
|
|
5432
5432
|
switch (h.tag) {
|
|
5433
5433
|
case 5:
|
|
5434
|
-
|
|
5434
|
+
X2 = h.stateNode;
|
|
5435
5435
|
Xj = false;
|
|
5436
5436
|
break a;
|
|
5437
5437
|
case 3:
|
|
5438
|
-
|
|
5438
|
+
X2 = h.stateNode.containerInfo;
|
|
5439
5439
|
Xj = true;
|
|
5440
5440
|
break a;
|
|
5441
5441
|
case 4:
|
|
5442
|
-
|
|
5442
|
+
X2 = h.stateNode.containerInfo;
|
|
5443
5443
|
Xj = true;
|
|
5444
5444
|
break a;
|
|
5445
5445
|
}
|
|
5446
5446
|
h = h.return;
|
|
5447
5447
|
}
|
|
5448
|
-
if (null ===
|
|
5448
|
+
if (null === X2) throw Error(p(160));
|
|
5449
5449
|
Zj(f, g, e);
|
|
5450
|
-
|
|
5450
|
+
X2 = null;
|
|
5451
5451
|
Xj = false;
|
|
5452
5452
|
var k = e.alternate;
|
|
5453
5453
|
null !== k && (k.return = null);
|
|
@@ -28887,6 +28887,62 @@ function AppHeader({
|
|
|
28887
28887
|
}
|
|
28888
28888
|
);
|
|
28889
28889
|
}
|
|
28890
|
+
function SidebarCollapseIcon({
|
|
28891
|
+
className,
|
|
28892
|
+
size = 20,
|
|
28893
|
+
strokeWidth = 2
|
|
28894
|
+
}) {
|
|
28895
|
+
return /* @__PURE__ */ jsx(
|
|
28896
|
+
"svg",
|
|
28897
|
+
{
|
|
28898
|
+
width: size,
|
|
28899
|
+
height: size,
|
|
28900
|
+
viewBox: "0 0 20 20",
|
|
28901
|
+
fill: "none",
|
|
28902
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28903
|
+
"aria-hidden": true,
|
|
28904
|
+
className,
|
|
28905
|
+
children: /* @__PURE__ */ jsx(
|
|
28906
|
+
"path",
|
|
28907
|
+
{
|
|
28908
|
+
d: "M12.5 2.5V17.5M8.33333 12.5L5.83333 10L8.33333 7.5M4.16667 2.5H15.8333C16.7538 2.5 17.5 3.24619 17.5 4.16667V15.8333C17.5 16.7538 16.7538 17.5 15.8333 17.5H4.16667C3.24619 17.5 2.5 16.7538 2.5 15.8333V4.16667C2.5 3.24619 3.24619 2.5 4.16667 2.5Z",
|
|
28909
|
+
stroke: "currentColor",
|
|
28910
|
+
strokeWidth,
|
|
28911
|
+
strokeLinecap: "round",
|
|
28912
|
+
strokeLinejoin: "round"
|
|
28913
|
+
}
|
|
28914
|
+
)
|
|
28915
|
+
}
|
|
28916
|
+
);
|
|
28917
|
+
}
|
|
28918
|
+
function SidebarExpandIcon({
|
|
28919
|
+
className,
|
|
28920
|
+
size = 20,
|
|
28921
|
+
strokeWidth = 2
|
|
28922
|
+
}) {
|
|
28923
|
+
return /* @__PURE__ */ jsx(
|
|
28924
|
+
"svg",
|
|
28925
|
+
{
|
|
28926
|
+
width: size,
|
|
28927
|
+
height: size,
|
|
28928
|
+
viewBox: "0 0 20 20",
|
|
28929
|
+
fill: "none",
|
|
28930
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28931
|
+
"aria-hidden": true,
|
|
28932
|
+
className,
|
|
28933
|
+
children: /* @__PURE__ */ jsx(
|
|
28934
|
+
"path",
|
|
28935
|
+
{
|
|
28936
|
+
d: "M12.5 2.5V17.5M6.66667 7.5L9.16667 10L6.66667 12.5M4.16667 2.5H15.8333C16.7538 2.5 17.5 3.24619 17.5 4.16667V15.8333C17.5 16.7538 16.7538 17.5 15.8333 17.5H4.16667C3.24619 17.5 2.5 16.7538 2.5 15.8333V4.16667C2.5 3.24619 3.24619 2.5 4.16667 2.5Z",
|
|
28937
|
+
stroke: "currentColor",
|
|
28938
|
+
strokeWidth,
|
|
28939
|
+
strokeLinecap: "round",
|
|
28940
|
+
strokeLinejoin: "round"
|
|
28941
|
+
}
|
|
28942
|
+
)
|
|
28943
|
+
}
|
|
28944
|
+
);
|
|
28945
|
+
}
|
|
28890
28946
|
function useMediaQuery(query) {
|
|
28891
28947
|
const [matches, setMatches] = useState(() => {
|
|
28892
28948
|
if (typeof window === "undefined") {
|
|
@@ -29113,6 +29169,7 @@ function Sidebar({
|
|
|
29113
29169
|
className,
|
|
29114
29170
|
mobileOpen,
|
|
29115
29171
|
onMobileClose,
|
|
29172
|
+
onMobileOpen,
|
|
29116
29173
|
onNavItemClick,
|
|
29117
29174
|
collapseIcon,
|
|
29118
29175
|
expandIcon,
|
|
@@ -29121,12 +29178,14 @@ function Sidebar({
|
|
|
29121
29178
|
collapsed,
|
|
29122
29179
|
onCollapsedChange
|
|
29123
29180
|
}) {
|
|
29124
|
-
const isDesktop = useMediaQuery("(min-width:
|
|
29181
|
+
const isDesktop = useMediaQuery("(min-width: 1024px)");
|
|
29182
|
+
const isRailLayout = useMediaQuery("(min-width: 768px)");
|
|
29125
29183
|
const [internalCollapsed, setInternalCollapsed] = useState(
|
|
29126
29184
|
() => readInitialCollapsedState(sidebarStorageKey, initialCollapsed)
|
|
29127
29185
|
);
|
|
29128
29186
|
const isCollapsed = collapsed ?? internalCollapsed;
|
|
29129
|
-
const isExpanded = isDesktop ? !isCollapsed :
|
|
29187
|
+
const isExpanded = isDesktop ? !isCollapsed : mobileOpen;
|
|
29188
|
+
const showCollapsedRail = isRailLayout && !isDesktop;
|
|
29130
29189
|
const setCollapsed = useCallback(
|
|
29131
29190
|
(next) => {
|
|
29132
29191
|
if (collapsed === void 0) {
|
|
@@ -29145,8 +29204,12 @@ function Sidebar({
|
|
|
29145
29204
|
toggleCollapsed();
|
|
29146
29205
|
return;
|
|
29147
29206
|
}
|
|
29148
|
-
|
|
29149
|
-
|
|
29207
|
+
if (mobileOpen) {
|
|
29208
|
+
onMobileClose?.();
|
|
29209
|
+
return;
|
|
29210
|
+
}
|
|
29211
|
+
onMobileOpen?.();
|
|
29212
|
+
}, [isDesktop, mobileOpen, onMobileClose, onMobileOpen, toggleCollapsed]);
|
|
29150
29213
|
const handleNavItemNavigate = useCallback(
|
|
29151
29214
|
(item) => {
|
|
29152
29215
|
onNavItemClick?.(item);
|
|
@@ -29186,23 +29249,26 @@ function Sidebar({
|
|
|
29186
29249
|
"aria-label": labels.closeMenu,
|
|
29187
29250
|
onClick: onMobileClose,
|
|
29188
29251
|
className: cn(
|
|
29189
|
-
"fixed inset-0 z-40 bg-navy-800/60 backdrop-blur-[1px] transition-opacity duration-300 ease-in-out
|
|
29252
|
+
"fixed inset-0 z-40 bg-navy-800/60 backdrop-blur-[1px] transition-opacity duration-300 ease-in-out lg:hidden",
|
|
29190
29253
|
mobileOpen ? "opacity-100" : "pointer-events-none opacity-0"
|
|
29191
29254
|
)
|
|
29192
29255
|
}
|
|
29193
29256
|
),
|
|
29257
|
+
showCollapsedRail && mobileOpen ? /* @__PURE__ */ jsx("div", { className: "h-screen w-[76px] shrink-0", "aria-hidden": true }) : null,
|
|
29194
29258
|
/* @__PURE__ */ jsxs(
|
|
29195
29259
|
"aside",
|
|
29196
29260
|
{
|
|
29197
29261
|
className: cn(
|
|
29198
29262
|
"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",
|
|
29199
29263
|
"transition-[transform,width,padding,gap] duration-300 ease-in-out will-change-[transform,width]",
|
|
29200
|
-
mobileOpen ? "translate-x-0" : "-translate-x-full",
|
|
29201
|
-
"md:relative md:z-auto md:w-[
|
|
29202
|
-
|
|
29264
|
+
mobileOpen ? "translate-x-0" : "-translate-x-full pointer-events-none",
|
|
29265
|
+
"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",
|
|
29266
|
+
mobileOpen && "md:fixed md:z-50 md:w-[min(300px,85vw)] md:items-stretch md:gap-8 md:p-4 md:shadow-xl",
|
|
29267
|
+
"lg:relative lg:z-auto lg:translate-x-0 lg:pointer-events-auto lg:shadow-none",
|
|
29268
|
+
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",
|
|
29203
29269
|
className
|
|
29204
29270
|
),
|
|
29205
|
-
"aria-hidden": !isDesktop && !mobileOpen,
|
|
29271
|
+
"aria-hidden": !isDesktop && !mobileOpen && !showCollapsedRail,
|
|
29206
29272
|
children: [
|
|
29207
29273
|
/* @__PURE__ */ jsxs(
|
|
29208
29274
|
"div",
|
|
@@ -29234,8 +29300,8 @@ function Sidebar({
|
|
|
29234
29300
|
type: "button",
|
|
29235
29301
|
onClick: handleHeaderAction,
|
|
29236
29302
|
className: "shrink-0 cursor-pointer text-white transition-[opacity,transform] duration-200 hover:opacity-80 active:scale-95",
|
|
29237
|
-
"aria-label":
|
|
29238
|
-
children:
|
|
29303
|
+
"aria-label": isExpanded ? isDesktop ? labels.collapse : labels.closeMenu : labels.expand,
|
|
29304
|
+
children: isExpanded ? collapseIcon ?? closeIcon ?? /* @__PURE__ */ jsx(SidebarCollapseIcon, {}) : expandIcon ?? /* @__PURE__ */ jsx(SidebarExpandIcon, {})
|
|
29239
29305
|
}
|
|
29240
29306
|
)
|
|
29241
29307
|
]
|
|
@@ -29284,7 +29350,8 @@ function SidebarMobileHeader({
|
|
|
29284
29350
|
openMenuLabel,
|
|
29285
29351
|
onOpenMenu,
|
|
29286
29352
|
menuOpen = false,
|
|
29287
|
-
className
|
|
29353
|
+
className,
|
|
29354
|
+
end
|
|
29288
29355
|
}) {
|
|
29289
29356
|
return /* @__PURE__ */ jsxs(
|
|
29290
29357
|
"header",
|
|
@@ -29302,16 +29369,17 @@ function SidebarMobileHeader({
|
|
|
29302
29369
|
className: "flex size-10 items-center justify-center rounded-xl text-navy transition-colors hover:bg-storm-gray-50",
|
|
29303
29370
|
"aria-label": openMenuLabel,
|
|
29304
29371
|
"aria-expanded": menuOpen,
|
|
29305
|
-
children: /* @__PURE__ */ jsx(
|
|
29372
|
+
children: /* @__PURE__ */ jsx(SidebarExpandIcon, { size: 22 })
|
|
29306
29373
|
}
|
|
29307
29374
|
),
|
|
29308
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
29375
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
29309
29376
|
/* @__PURE__ */ jsx("img", { src: branding.logoIconSrc, alt: "", className: "h-[30px] w-[42px] shrink-0" }),
|
|
29310
29377
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 leading-none", children: [
|
|
29311
29378
|
/* @__PURE__ */ jsx("p", { className: "truncate text-base font-bold tracking-tight text-navy", children: branding.logoTitle }),
|
|
29312
29379
|
/* @__PURE__ */ jsx("p", { className: "truncate text-[6.5px] font-normal tracking-[-0.26px] text-navy-300 uppercase", children: branding.logoTagline })
|
|
29313
29380
|
] })
|
|
29314
|
-
] })
|
|
29381
|
+
] }),
|
|
29382
|
+
end ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: end }) : null
|
|
29315
29383
|
]
|
|
29316
29384
|
}
|
|
29317
29385
|
);
|
|
@@ -29324,12 +29392,12 @@ function DashboardLayout({
|
|
|
29324
29392
|
className,
|
|
29325
29393
|
mainClassName
|
|
29326
29394
|
}) {
|
|
29327
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex h-screen overflow-hidden flex-row bg-storm-gray-0", className), children: [
|
|
29328
|
-
/* @__PURE__ */ jsx("div", { className: "h-screen shrink-0", children: /* @__PURE__ */ jsx(Sidebar, { ...sidebar }) }),
|
|
29395
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex h-screen min-w-0 overflow-hidden flex-row bg-storm-gray-0", className), children: [
|
|
29396
|
+
/* @__PURE__ */ jsx("div", { className: "max-md:contents md:h-screen md:shrink-0", children: /* @__PURE__ */ jsx(Sidebar, { ...sidebar }) }),
|
|
29329
29397
|
/* @__PURE__ */ jsxs("div", { className: "flex h-screen min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: [
|
|
29330
29398
|
/* @__PURE__ */ jsx(SidebarMobileHeader, { ...mobileHeader }),
|
|
29331
29399
|
/* @__PURE__ */ jsx(AppHeader, { ...header }),
|
|
29332
|
-
/* @__PURE__ */ jsx("main", { className: mainClassName ?? "min-h-0 flex-1 overflow-y-auto p-4
|
|
29400
|
+
/* @__PURE__ */ jsx("main", { className: mainClassName ?? "min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto p-4 xl:p-6", children })
|
|
29333
29401
|
] })
|
|
29334
29402
|
] });
|
|
29335
29403
|
}
|
|
@@ -29665,21 +29733,22 @@ function Pagination({
|
|
|
29665
29733
|
const visiblePages = getVisiblePageNumbers(safePage, totalPages, maxPageButtons);
|
|
29666
29734
|
const canGoPrevious = safePage > 1;
|
|
29667
29735
|
const canGoNext = safePage < totalPages;
|
|
29668
|
-
|
|
29736
|
+
const showPageControls = totalPages > 1;
|
|
29737
|
+
if (hideOnSinglePage && !showPageControls) {
|
|
29669
29738
|
return null;
|
|
29670
29739
|
}
|
|
29671
29740
|
return /* @__PURE__ */ jsxs(
|
|
29672
29741
|
"div",
|
|
29673
29742
|
{
|
|
29674
29743
|
className: cn(
|
|
29675
|
-
"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",
|
|
29744
|
+
"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",
|
|
29676
29745
|
variant === "standalone" && cn("rounded-xl border bg-storm-gray-0", "border-storm-gray-50"),
|
|
29677
29746
|
dataTableClassNames.pagination,
|
|
29678
29747
|
className
|
|
29679
29748
|
),
|
|
29680
29749
|
children: [
|
|
29681
29750
|
/* @__PURE__ */ jsx("p", { className: "typography-12 font-medium text-storm-gray-200", children: mergedLabels.showing({ start, end, total }) }),
|
|
29682
|
-
/* @__PURE__ */ jsxs(
|
|
29751
|
+
showPageControls ? /* @__PURE__ */ jsxs(
|
|
29683
29752
|
"nav",
|
|
29684
29753
|
{
|
|
29685
29754
|
"aria-label": "Pagination",
|
|
@@ -29747,7 +29816,7 @@ function Pagination({
|
|
|
29747
29816
|
)
|
|
29748
29817
|
]
|
|
29749
29818
|
}
|
|
29750
|
-
)
|
|
29819
|
+
) : null
|
|
29751
29820
|
]
|
|
29752
29821
|
}
|
|
29753
29822
|
);
|
|
@@ -30189,7 +30258,7 @@ function TableScrollArea({
|
|
|
30189
30258
|
"div",
|
|
30190
30259
|
{
|
|
30191
30260
|
className: cn(
|
|
30192
|
-
"table-scroll-area w-full overflow-auto",
|
|
30261
|
+
"table-scroll-area w-full min-w-0 max-w-full overflow-auto",
|
|
30193
30262
|
fillHeight && "min-h-0 flex-1",
|
|
30194
30263
|
className
|
|
30195
30264
|
),
|
|
@@ -30243,7 +30312,7 @@ function DataTable({
|
|
|
30243
30312
|
}),
|
|
30244
30313
|
[className, classNames, footerClassName, scrollClassName, tableClassName]
|
|
30245
30314
|
);
|
|
30246
|
-
return /* @__PURE__ */ jsx(DataTableClassNamesContext.Provider, { value: mergedClassNames, children: /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", fillHeight && "min-h-0 flex-1", mergedClassNames.root), children: [
|
|
30315
|
+
return /* @__PURE__ */ jsx(DataTableClassNamesContext.Provider, { value: mergedClassNames, children: /* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-col", fillHeight && "min-h-0 flex-1", mergedClassNames.root), children: [
|
|
30247
30316
|
/* @__PURE__ */ jsx(
|
|
30248
30317
|
"div",
|
|
30249
30318
|
{
|
|
@@ -30271,6 +30340,7 @@ function DataTable({
|
|
|
30271
30340
|
"div",
|
|
30272
30341
|
{
|
|
30273
30342
|
className: cn(
|
|
30343
|
+
"shrink-0",
|
|
30274
30344
|
tableFooterShellClassName,
|
|
30275
30345
|
tableBorderClassName,
|
|
30276
30346
|
mergedClassNames.footer
|
|
@@ -30582,7 +30652,7 @@ function Drawer({
|
|
|
30582
30652
|
type: "button",
|
|
30583
30653
|
"aria-label": closeAriaLabel,
|
|
30584
30654
|
className: cn(
|
|
30585
|
-
"absolute inset-0 bg-storm-gray-850/40 backdrop-blur-[12px] transition-opacity duration-300 ease-in-out",
|
|
30655
|
+
"absolute inset-0 z-0 cursor-pointer bg-storm-gray-850/40 backdrop-blur-[12px] transition-opacity duration-300 ease-in-out",
|
|
30586
30656
|
isAnimatedIn ? "opacity-100" : "opacity-0"
|
|
30587
30657
|
),
|
|
30588
30658
|
onClick: onClose
|
|
@@ -30596,7 +30666,7 @@ function Drawer({
|
|
|
30596
30666
|
"aria-labelledby": "homepad-drawer-title",
|
|
30597
30667
|
...subtitle ? { "aria-describedby": "homepad-drawer-subtitle" } : {},
|
|
30598
30668
|
className: cn(
|
|
30599
|
-
"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",
|
|
30669
|
+
"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",
|
|
30600
30670
|
// Keep GPU transform only while animating — settled translate-x-0 blurs text.
|
|
30601
30671
|
!isTransformSettled && "will-change-transform",
|
|
30602
30672
|
isAnimatedIn ? isTransformSettled ? "transform-none" : "translate-x-0" : "translate-x-full",
|
|
@@ -31074,6 +31144,6 @@ react-dom/cjs/react-dom.development.js:
|
|
|
31074
31144
|
*)
|
|
31075
31145
|
*/
|
|
31076
31146
|
|
|
31077
|
-
export { AppHeader, Badge, BellIcon, BuildingIcon, BuildingSelect, ConfirmModal, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, DataTable, Drawer, HistoryTimeline, Modal, Pagination, Sidebar, SidebarMobileHeader, SidebarNavItem, SidebarUserCard, StatusBadge, Table, TableActionButton, TableActionsCell, TableActionsMenu, TableBody, TableCell, TableHead, TableHeader, TableIconText, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, TableRow, TableRowStatusActions, TableScrollArea, TableSortIcon, TableStatusActionsCell, Toaster, ToasterProvider, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, isNavItemActive, runMutationWithToast, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
31147
|
+
export { AppHeader, Badge, BellIcon, BuildingIcon, BuildingSelect, ConfirmModal, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, DataTable, Drawer, HistoryTimeline, Modal, Pagination, Sidebar, SidebarCollapseIcon, SidebarExpandIcon, SidebarMobileHeader, SidebarNavItem, SidebarUserCard, StatusBadge, Table, TableActionButton, TableActionsCell, TableActionsMenu, TableBody, TableCell, TableHead, TableHeader, TableIconText, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, TableRow, TableRowStatusActions, TableScrollArea, TableSortIcon, TableStatusActionsCell, Toaster, ToasterProvider, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, isNavItemActive, runMutationWithToast, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
31078
31148
|
//# sourceMappingURL=index.js.map
|
|
31079
31149
|
//# sourceMappingURL=index.js.map
|