@scripso-homepad/ui 0.4.39 → 0.4.41

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.
@@ -396,7 +396,7 @@ type TableHeadProps = ThHTMLAttributes<HTMLTableCellElement> & {
396
396
  onSort?: () => void;
397
397
  children?: ReactNode;
398
398
  };
399
- declare function TableHead({ className, align, sortable, sortDirection, onSort, children, ...props }: TableHeadProps): react.JSX.Element;
399
+ declare function TableHead({ className, align, sortable, sortDirection, onSort, children, onClick, onKeyDown, ...props }: TableHeadProps): react.JSX.Element;
400
400
 
401
401
  type TableCellProps = TdHTMLAttributes<HTMLTableCellElement> & {
402
402
  variant?: TableCellVariant;
@@ -396,7 +396,7 @@ type TableHeadProps = ThHTMLAttributes<HTMLTableCellElement> & {
396
396
  onSort?: () => void;
397
397
  children?: ReactNode;
398
398
  };
399
- declare function TableHead({ className, align, sortable, sortDirection, onSort, children, ...props }: TableHeadProps): react.JSX.Element;
399
+ declare function TableHead({ className, align, sortable, sortDirection, onSort, children, onClick, onKeyDown, ...props }: TableHeadProps): react.JSX.Element;
400
400
 
401
401
  type TableCellProps = TdHTMLAttributes<HTMLTableCellElement> & {
402
402
  variant?: TableCellVariant;
package/dist/web/index.js CHANGED
@@ -27528,7 +27528,7 @@ var require_react_dom_development = __commonJS({
27528
27528
  return root2;
27529
27529
  }
27530
27530
  var ReactVersion = "18.3.1";
27531
- function createPortal3(children, containerInfo, implementation) {
27531
+ function createPortal4(children, containerInfo, implementation) {
27532
27532
  var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
27533
27533
  {
27534
27534
  checkKeyStringCoercion(key);
@@ -28384,7 +28384,7 @@ var require_react_dom_development = __commonJS({
28384
28384
  if (!isValidContainer(container)) {
28385
28385
  throw new Error("Target container is not a DOM element.");
28386
28386
  }
28387
- return createPortal3(children, container, null, key);
28387
+ return createPortal4(children, container, null, key);
28388
28388
  }
28389
28389
  function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
28390
28390
  return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
@@ -29254,12 +29254,12 @@ function Sidebar({
29254
29254
  )
29255
29255
  }
29256
29256
  ),
29257
- showCollapsedRail && mobileOpen ? /* @__PURE__ */ jsx("div", { className: "h-screen w-[76px] shrink-0", "aria-hidden": true }) : null,
29257
+ showCollapsedRail && mobileOpen ? /* @__PURE__ */ jsx("div", { className: "h-dvh w-[76px] shrink-0", "aria-hidden": true }) : null,
29258
29258
  /* @__PURE__ */ jsxs(
29259
29259
  "aside",
29260
29260
  {
29261
29261
  className: cn(
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",
29262
+ "fixed inset-y-0 left-0 z-50 flex h-dvh w-[min(300px,85vw)] flex-col gap-8 overflow-hidden bg-navy p-4 shadow-xl",
29263
29263
  "transition-[transform,width,padding,gap] duration-300 ease-in-out will-change-[transform,width]",
29264
29264
  mobileOpen ? "translate-x-0" : "-translate-x-full pointer-events-none",
29265
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",
@@ -29392,9 +29392,9 @@ function DashboardLayout({
29392
29392
  className,
29393
29393
  mainClassName
29394
29394
  }) {
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 }) }),
29397
- /* @__PURE__ */ jsxs("div", { className: "flex h-screen min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: [
29395
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-dvh min-w-0 overflow-hidden flex-row bg-storm-gray-0", className), children: [
29396
+ /* @__PURE__ */ jsx("div", { className: "max-md:contents md:h-dvh md:shrink-0", children: /* @__PURE__ */ jsx(Sidebar, { ...sidebar }) }),
29397
+ /* @__PURE__ */ jsxs("div", { className: "flex h-dvh min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: [
29398
29398
  /* @__PURE__ */ jsx(SidebarMobileHeader, { ...mobileHeader }),
29399
29399
  /* @__PURE__ */ jsx(AppHeader, { ...header }),
29400
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 })
@@ -29926,16 +29926,16 @@ function TableHead({
29926
29926
  sortDirection = null,
29927
29927
  onSort,
29928
29928
  children,
29929
+ onClick,
29930
+ onKeyDown,
29929
29931
  ...props
29930
29932
  }) {
29931
29933
  const isSortable = sortable && onSort != null;
29932
29934
  const content = isSortable ? /* @__PURE__ */ jsxs(
29933
- "button",
29935
+ "span",
29934
29936
  {
29935
- type: "button",
29936
- onClick: onSort,
29937
29937
  className: cn(
29938
- "inline-flex w-full cursor-pointer items-center gap-2.5 border-0 bg-transparent p-0 font-[inherit] text-[length:inherit] leading-[inherit] tracking-[inherit] text-inherit transition-colors hover:text-storm-gray-500",
29938
+ "inline-flex w-full items-center gap-2.5 font-[inherit] text-[length:inherit] leading-[inherit] tracking-[inherit] text-inherit",
29939
29939
  tableHeadSortButtonAlignClasses[align]
29940
29940
  ),
29941
29941
  children: [
@@ -29952,10 +29952,29 @@ function TableHead({
29952
29952
  tableHeadPaddingClassName,
29953
29953
  tableHeaderClassName,
29954
29954
  !isSortable && tableAlignClasses[align],
29955
+ isSortable && "cursor-pointer select-none hover:text-storm-gray-500",
29955
29956
  className
29956
29957
  ),
29957
29958
  "aria-sort": resolveAriaSort(sortDirection, isSortable),
29959
+ tabIndex: isSortable ? 0 : void 0,
29958
29960
  ...props,
29961
+ onClick: (event) => {
29962
+ onClick?.(event);
29963
+ if (event.defaultPrevented || !isSortable) {
29964
+ return;
29965
+ }
29966
+ onSort();
29967
+ },
29968
+ onKeyDown: (event) => {
29969
+ onKeyDown?.(event);
29970
+ if (event.defaultPrevented || !isSortable) {
29971
+ return;
29972
+ }
29973
+ if (event.key === "Enter" || event.key === " ") {
29974
+ event.preventDefault();
29975
+ onSort();
29976
+ }
29977
+ },
29959
29978
  children: content
29960
29979
  }
29961
29980
  );
@@ -30562,16 +30581,22 @@ function Modal({
30562
30581
  );
30563
30582
  return typeof document !== "undefined" ? (0, import_react_dom2.createPortal)(modal, document.body) : modal;
30564
30583
  }
30584
+
30585
+ // src/web/components/Drawer.tsx
30586
+ var import_react_dom3 = __toESM(require_react_dom(), 1);
30565
30587
  var DRAWER_TRANSITION_MS = 300;
30566
30588
  var bodyScrollLockCount = 0;
30567
30589
  var previousBodyOverflow = "";
30590
+ var previousHtmlOverflow = "";
30568
30591
  function lockBodyScroll() {
30569
30592
  if (typeof document === "undefined") {
30570
30593
  return;
30571
30594
  }
30572
30595
  if (bodyScrollLockCount === 0) {
30573
30596
  previousBodyOverflow = document.body.style.overflow;
30597
+ previousHtmlOverflow = document.documentElement.style.overflow;
30574
30598
  document.body.style.overflow = "hidden";
30599
+ document.documentElement.style.overflow = "hidden";
30575
30600
  }
30576
30601
  bodyScrollLockCount += 1;
30577
30602
  }
@@ -30582,7 +30607,9 @@ function unlockBodyScroll() {
30582
30607
  bodyScrollLockCount = Math.max(0, bodyScrollLockCount - 1);
30583
30608
  if (bodyScrollLockCount === 0) {
30584
30609
  document.body.style.overflow = previousBodyOverflow;
30610
+ document.documentElement.style.overflow = previousHtmlOverflow;
30585
30611
  previousBodyOverflow = "";
30612
+ previousHtmlOverflow = "";
30586
30613
  }
30587
30614
  }
30588
30615
  function Drawer({
@@ -30656,10 +30683,10 @@ function Drawer({
30656
30683
  if (!isPresent) {
30657
30684
  return null;
30658
30685
  }
30659
- return /* @__PURE__ */ jsxs(
30686
+ const drawer = /* @__PURE__ */ jsxs(
30660
30687
  "div",
30661
30688
  {
30662
- className: "fixed inset-0 z-50 flex justify-end p-2 max-md:p-0",
30689
+ className: "fixed inset-0 z-50 flex justify-end overscroll-none p-2 max-md:p-0",
30663
30690
  role: "presentation",
30664
30691
  children: [
30665
30692
  /* @__PURE__ */ jsx(
@@ -30683,7 +30710,7 @@ function Drawer({
30683
30710
  "aria-labelledby": "homepad-drawer-title",
30684
30711
  ...subtitle ? { "aria-describedby": "homepad-drawer-subtitle" } : {},
30685
30712
  className: cn(
30686
- "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",
30713
+ "relative z-10 flex h-full max-h-full min-h-0 cursor-auto flex-col overflow-hidden rounded-[16px] bg-white shadow-2xl transition-transform duration-300 ease-in-out max-md:rounded-none",
30687
30714
  // Keep GPU transform only while animating — settled translate-x-0 blurs text.
30688
30715
  !isTransformSettled && "will-change-transform",
30689
30716
  isAnimatedIn ? isTransformSettled ? "transform-none" : "translate-x-0" : "translate-x-full",
@@ -30750,6 +30777,7 @@ function Drawer({
30750
30777
  ]
30751
30778
  }
30752
30779
  );
30780
+ return typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(drawer, document.body) : drawer;
30753
30781
  }
30754
30782
  function TimelineCheckIcon({ className, ...props }) {
30755
30783
  return /* @__PURE__ */ jsx(