@scripso-homepad/ui 0.4.34 → 0.4.36

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.
@@ -169,6 +169,22 @@ type BuildingIconProps = {
169
169
  };
170
170
  declare function BuildingIcon({ className }: BuildingIconProps): react.JSX.Element;
171
171
 
172
+ type SidebarCollapseIconProps = {
173
+ className?: string;
174
+ size?: number | string;
175
+ strokeWidth?: number | string;
176
+ };
177
+ /** Shown when the sidebar is open — click collapses it. */
178
+ declare function SidebarCollapseIcon({ className, size, strokeWidth, }: SidebarCollapseIconProps): react.JSX.Element;
179
+
180
+ type SidebarExpandIconProps = {
181
+ className?: string;
182
+ size?: number | string;
183
+ strokeWidth?: number | string;
184
+ };
185
+ /** Shown when the sidebar is closed — click expands it. */
186
+ declare function SidebarExpandIcon({ className, size, strokeWidth, }: SidebarExpandIconProps): react.JSX.Element;
187
+
172
188
  type TableMoreIconProps = {
173
189
  className?: string;
174
190
  };
@@ -270,12 +286,14 @@ type TableActionsMenuProps = {
270
286
  triggerAriaLabel: string;
271
287
  className?: string;
272
288
  menuClassName?: string;
289
+ /** Optional custom trigger icon. Defaults to TableMoreIcon. */
290
+ triggerIcon?: ReactNode;
273
291
  /** Dropdown menu width in pixels. Defaults to 231. Ignored when menuFitContent is true. */
274
292
  menuWidth?: number;
275
293
  /** Size the menu to its content width instead of a fixed pixel width. Defaults to true so labels stay on one line. */
276
294
  menuFitContent?: boolean;
277
295
  };
278
- declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
296
+ declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, triggerIcon, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
279
297
 
280
298
  type TableRowActionsConfig = {
281
299
  status: ReactNode;
@@ -531,4 +549,4 @@ declare function useOnClickOutside<T extends HTMLElement>(ref: OutsideTarget<T>,
531
549
 
532
550
  declare function cn(...inputs: ClassValue[]): string;
533
551
 
534
- 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 };
552
+ 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 };
@@ -169,6 +169,22 @@ type BuildingIconProps = {
169
169
  };
170
170
  declare function BuildingIcon({ className }: BuildingIconProps): react.JSX.Element;
171
171
 
172
+ type SidebarCollapseIconProps = {
173
+ className?: string;
174
+ size?: number | string;
175
+ strokeWidth?: number | string;
176
+ };
177
+ /** Shown when the sidebar is open — click collapses it. */
178
+ declare function SidebarCollapseIcon({ className, size, strokeWidth, }: SidebarCollapseIconProps): react.JSX.Element;
179
+
180
+ type SidebarExpandIconProps = {
181
+ className?: string;
182
+ size?: number | string;
183
+ strokeWidth?: number | string;
184
+ };
185
+ /** Shown when the sidebar is closed — click expands it. */
186
+ declare function SidebarExpandIcon({ className, size, strokeWidth, }: SidebarExpandIconProps): react.JSX.Element;
187
+
172
188
  type TableMoreIconProps = {
173
189
  className?: string;
174
190
  };
@@ -270,12 +286,14 @@ type TableActionsMenuProps = {
270
286
  triggerAriaLabel: string;
271
287
  className?: string;
272
288
  menuClassName?: string;
289
+ /** Optional custom trigger icon. Defaults to TableMoreIcon. */
290
+ triggerIcon?: ReactNode;
273
291
  /** Dropdown menu width in pixels. Defaults to 231. Ignored when menuFitContent is true. */
274
292
  menuWidth?: number;
275
293
  /** Size the menu to its content width instead of a fixed pixel width. Defaults to true so labels stay on one line. */
276
294
  menuFitContent?: boolean;
277
295
  };
278
- declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
296
+ declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, triggerIcon, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
279
297
 
280
298
  type TableRowActionsConfig = {
281
299
  status: ReactNode;
@@ -531,4 +549,4 @@ declare function useOnClickOutside<T extends HTMLElement>(ref: OutsideTarget<T>,
531
549
 
532
550
  declare function cn(...inputs: ClassValue[]): string;
533
551
 
534
- 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 };
552
+ 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
1
  import { __commonJS, __require, __toESM, Input, Button } from '../chunk-AOBKWDGW.js';
2
- import { ChevronsUpDown, Search, LogOut, PanelLeftClose, PanelLeftOpen, X, Menu, ChevronLeft, ChevronRight } from 'lucide-react';
2
+ import { ChevronsUpDown, Search, LogOut, X, Menu, ChevronLeft, ChevronRight } 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';
@@ -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") {
@@ -29235,7 +29291,7 @@ function Sidebar({
29235
29291
  onClick: handleHeaderAction,
29236
29292
  className: "shrink-0 cursor-pointer text-white transition-[opacity,transform] duration-200 hover:opacity-80 active:scale-95",
29237
29293
  "aria-label": isDesktop ? isExpanded ? labels.collapse : labels.expand : labels.closeMenu,
29238
- children: isDesktop ? isExpanded ? collapseIcon ?? /* @__PURE__ */ jsx(PanelLeftClose, { size: 20, strokeWidth: 1.75 }) : expandIcon ?? /* @__PURE__ */ jsx(PanelLeftOpen, { size: 20, strokeWidth: 1.75 }) : closeIcon ?? /* @__PURE__ */ jsx(X, { size: 20, strokeWidth: 1.75 })
29294
+ children: isDesktop ? isExpanded ? collapseIcon ?? /* @__PURE__ */ jsx(SidebarCollapseIcon, {}) : expandIcon ?? /* @__PURE__ */ jsx(SidebarExpandIcon, {}) : closeIcon ?? /* @__PURE__ */ jsx(X, { size: 20, strokeWidth: 1.75 })
29239
29295
  }
29240
29296
  )
29241
29297
  ]
@@ -30009,6 +30065,7 @@ function TableActionsMenu({
30009
30065
  triggerAriaLabel,
30010
30066
  className,
30011
30067
  menuClassName,
30068
+ triggerIcon,
30012
30069
  menuWidth = MENU_WIDTH_PX,
30013
30070
  menuFitContent = true
30014
30071
  }) {
@@ -30105,12 +30162,22 @@ function TableActionsMenu({
30105
30162
  item.onSelect();
30106
30163
  },
30107
30164
  className: cn(
30108
- "flex h-[51px] w-full cursor-pointer items-center gap-2.5 px-3 text-left typography-14 font-medium text-storm-gray-900 transition-colors hover:bg-storm-gray-0",
30165
+ "flex h-[51px] w-full cursor-pointer items-center gap-2.5 px-3 text-left typography-14 font-medium transition-colors hover:bg-storm-gray-0",
30109
30166
  index > 0 && "border-t border-storm-gray-50",
30110
- item.disabled && "cursor-not-allowed opacity-50"
30167
+ item.disabled && "cursor-not-allowed opacity-50",
30168
+ item.tone === "danger" ? "text-[#AE0011]" : item.tone === "success" ? "text-green-600" : "text-storm-gray-900"
30111
30169
  ),
30112
30170
  children: [
30113
- icon ? /* @__PURE__ */ jsx("span", { className: "inline-flex size-5 shrink-0 items-center justify-center text-storm-gray-200", children: icon }) : null,
30171
+ icon ? /* @__PURE__ */ jsx(
30172
+ "span",
30173
+ {
30174
+ className: cn(
30175
+ "inline-flex size-5 shrink-0 items-center justify-center",
30176
+ item.tone === "danger" ? "text-[#AE0011]" : item.tone === "success" ? "text-green-600" : "text-storm-gray-200"
30177
+ ),
30178
+ children: icon
30179
+ }
30180
+ ) : null,
30114
30181
  /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: item.label })
30115
30182
  ]
30116
30183
  },
@@ -30125,7 +30192,7 @@ function TableActionsMenu({
30125
30192
  {
30126
30193
  ref: triggerRef,
30127
30194
  variant: "menu",
30128
- icon: /* @__PURE__ */ jsx(TableMoreIcon, { className: "size-5" }),
30195
+ icon: triggerIcon ?? /* @__PURE__ */ jsx(TableMoreIcon, { className: "size-5" }),
30129
30196
  ariaLabel: triggerAriaLabel,
30130
30197
  onClick: () => setOpen((current) => !current),
30131
30198
  "aria-expanded": open,
@@ -31063,6 +31130,6 @@ react-dom/cjs/react-dom.development.js:
31063
31130
  *)
31064
31131
  */
31065
31132
 
31066
- 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 };
31133
+ 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 };
31067
31134
  //# sourceMappingURL=index.js.map
31068
31135
  //# sourceMappingURL=index.js.map