gridsmith-ui 0.2.18 → 0.2.19

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/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { cn, GLASS_BACKDROP, lockBodyScroll, unlockBodyScroll, GLASS_OVERLAY, GLASS_DROPDOWN, GLASS_SURFACE } from './chunk-5XIPPVH7.js';
1
+ import { cn, GLASS_BACKDROP, GLASS_DROPDOWN, lockBodyScroll, unlockBodyScroll, GLASS_OVERLAY, GLASS_SURFACE } from './chunk-5XIPPVH7.js';
2
2
  import { Icon } from './chunk-H2XI6OUB.js';
3
3
  import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
4
4
  import * as React6 from 'react';
5
- import React6__default, { createContext, forwardRef, useState, useCallback, useRef, useContext, useId, useMemo, useEffect, createElement, Fragment as Fragment$1, useLayoutEffect, isValidElement, cloneElement, useDebugValue, memo, useReducer, useSyncExternalStore as useSyncExternalStore$1, useImperativeHandle } from 'react';
5
+ import React6__default, { createContext, forwardRef, useState, useCallback, useRef, useContext, useId, useMemo, useEffect, useLayoutEffect, isValidElement, cloneElement, createElement, Fragment as Fragment$1, useDebugValue, memo, useReducer, useSyncExternalStore as useSyncExternalStore$1, useImperativeHandle } from 'react';
6
6
  import ReactDOM, { createPortal, unstable_batchedUpdates, flushSync } from 'react-dom';
7
7
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
8
  import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
@@ -94149,26 +94149,29 @@ var Sidebar = forwardRef(function Sidebar2({
94149
94149
  }
94150
94150
  ),
94151
94151
  /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children }),
94152
- showCollapse && /* @__PURE__ */ jsxs(
94153
- "button",
94154
- {
94155
- onClick: () => handleCollapsedChange(!collapsed),
94156
- "aria-expanded": !collapsed,
94157
- "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
94158
- className: cn(
94159
- "flex items-center gap-ds-2 py-ds-2 mx-ds-2 text-sm rounded-[var(--ds-radius-md)]",
94160
- "transition-colors cursor-pointer",
94161
- "text-[var(--ds-sidebar-text-muted)] hover:bg-[var(--ds-sidebar-item-hover)] hover:text-[var(--ds-sidebar-text)]",
94162
- "focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
94163
- collapsed ? "justify-center px-0" : "px-ds-3"
94164
- ),
94165
- style: { marginBottom: footer ? 0 : "var(--ds-space-3)" },
94166
- children: [
94167
- /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 16, className: cn("transition-transform", !collapsed && "rotate-180") }),
94168
- !collapsed && /* @__PURE__ */ jsx("span", { children: "Collapse" })
94169
- ]
94170
- }
94171
- ),
94152
+ showCollapse && (() => {
94153
+ const collapseButton = /* @__PURE__ */ jsxs(
94154
+ "button",
94155
+ {
94156
+ onClick: () => handleCollapsedChange(!collapsed),
94157
+ "aria-expanded": !collapsed,
94158
+ "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
94159
+ className: cn(
94160
+ "flex items-center gap-ds-2 py-ds-2 mx-ds-2 text-sm rounded-[var(--ds-radius-md)]",
94161
+ "transition-colors cursor-pointer",
94162
+ "text-[var(--ds-sidebar-text-muted)] hover:bg-[var(--ds-sidebar-item-hover)] hover:text-[var(--ds-sidebar-text)]",
94163
+ "focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
94164
+ collapsed ? "justify-center px-0" : "px-ds-3"
94165
+ ),
94166
+ style: { marginBottom: footer ? 0 : "var(--ds-space-3)" },
94167
+ children: [
94168
+ /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 16, className: cn("transition-transform", !collapsed && "rotate-180") }),
94169
+ !collapsed && /* @__PURE__ */ jsx("span", { children: "Collapse" })
94170
+ ]
94171
+ }
94172
+ );
94173
+ return collapsed ? /* @__PURE__ */ jsx(Tooltip, { content: "Expand sidebar", side: "right", delay: 100, container: portalEl ?? void 0, children: collapseButton }) : collapseButton;
94174
+ })(),
94172
94175
  footer && /* @__PURE__ */ jsx(
94173
94176
  "div",
94174
94177
  {