gridsmith-ui 0.4.0 → 0.6.0

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.
Files changed (58) hide show
  1. package/README.md +63 -3
  2. package/dist/charts.d.ts +246 -0
  3. package/dist/charts.js +1028 -0
  4. package/dist/charts.js.map +1 -0
  5. package/dist/chunk-4SDKQDYV.js +93 -0
  6. package/dist/chunk-4SDKQDYV.js.map +1 -0
  7. package/dist/chunk-CHNY75QI.js +278 -0
  8. package/dist/chunk-CHNY75QI.js.map +1 -0
  9. package/dist/chunk-DPF6776I.js +36 -0
  10. package/dist/chunk-DPF6776I.js.map +1 -0
  11. package/dist/{chunk-5XIPPVH7.js → chunk-IUBWNDUK.js} +15 -4
  12. package/dist/chunk-IUBWNDUK.js.map +1 -0
  13. package/dist/chunk-OUYJXVLQ.js +41 -0
  14. package/dist/chunk-OUYJXVLQ.js.map +1 -0
  15. package/dist/{chunk-6TMNEBBJ.js → chunk-XUBVMRIE.js} +44 -35
  16. package/dist/chunk-XUBVMRIE.js.map +1 -0
  17. package/dist/data-grid.d.ts +27 -0
  18. package/dist/data-grid.js +293 -0
  19. package/dist/data-grid.js.map +1 -0
  20. package/dist/editor.d.ts +18 -0
  21. package/dist/editor.js +632 -0
  22. package/dist/editor.js.map +1 -0
  23. package/dist/{feather-432JQGUB.js → feather-V32UNIQL.js} +2 -3
  24. package/dist/feather-V32UNIQL.js.map +1 -0
  25. package/dist/{heroicons-CCKJHFZY.js → heroicons-CA5OQ76O.js} +2 -3
  26. package/dist/heroicons-CA5OQ76O.js.map +1 -0
  27. package/dist/icons.js +1 -2
  28. package/dist/index.d.ts +430 -133
  29. package/dist/index.js +10510 -98031
  30. package/dist/index.js.map +1 -1
  31. package/dist/kanban.d.ts +25 -0
  32. package/dist/kanban.js +224 -0
  33. package/dist/kanban.js.map +1 -0
  34. package/dist/{lucide-Z74WVRAK.js → lucide-AILUUOAJ.js} +2 -3
  35. package/dist/lucide-AILUUOAJ.js.map +1 -0
  36. package/dist/{phosphor-DYUCR5S2.js → phosphor-A4JOBGMT.js} +2 -3
  37. package/dist/phosphor-A4JOBGMT.js.map +1 -0
  38. package/dist/resizable.d.ts +39 -0
  39. package/dist/resizable.js +89 -0
  40. package/dist/resizable.js.map +1 -0
  41. package/dist/roots.css +46 -11
  42. package/dist/{tabler-GRXDPAHR.js → tabler-TVOR6AFM.js} +2 -3
  43. package/dist/tabler-TVOR6AFM.js.map +1 -0
  44. package/dist/use-breakpoint-Cn51IubK.d.ts +30 -0
  45. package/dist/utils.js +1 -2
  46. package/dist/virtualized.d.ts +16 -0
  47. package/dist/virtualized.js +55 -0
  48. package/dist/virtualized.js.map +1 -0
  49. package/package.json +144 -4
  50. package/dist/chunk-5WRI5ZAA.js +0 -29
  51. package/dist/chunk-5WRI5ZAA.js.map +0 -1
  52. package/dist/chunk-5XIPPVH7.js.map +0 -1
  53. package/dist/chunk-6TMNEBBJ.js.map +0 -1
  54. package/dist/feather-432JQGUB.js.map +0 -1
  55. package/dist/heroicons-CCKJHFZY.js.map +0 -1
  56. package/dist/lucide-Z74WVRAK.js.map +0 -1
  57. package/dist/phosphor-DYUCR5S2.js.map +0 -1
  58. package/dist/tabler-GRXDPAHR.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../showcase/src/lib/slot.tsx","../../../showcase/src/lib/use-position.ts","../../../showcase/src/components/Tooltip.tsx","../../../showcase/src/lib/use-text-overflow.ts"],"names":["rafId","useState","useRef","useCallback","jsx"],"mappings":";;;;;AAgBA,SAAS,aAAa,IAAA,EAAsE;AAC1F,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,MAAA,CAAO,OAAO,CAAA;AACpC,EAAA,IAAI,QAAA,CAAS,MAAA,KAAW,CAAA,EAAG,OAAO,MAAA;AAClC,EAAA,IAAI,QAAA,CAAS,MAAA,KAAW,CAAA,EAAG,OAAO,SAAS,CAAC,CAAA;AAC5C,EAAA,OAAO,CAAC,IAAA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ErB,QAAA,MAAM,OAAA,GAA4B,MAAM,QAAA,CAAS,OAAA,IAAU;AAC3D,QAAA,aAAA,CAAc,OAAA,GAAU,OAAA;AACxB,QAAA,OAAA,CAAQ,MAAM,OAAO,CAAA;AAErB,QAAA,MAAM,OAAA,GAAU,aAAA,CAAc,IAAA,EAAM,KAAK,CAAA;AACzC,QAAA,cAAA,CAAe,OAAO,CAAA;AAAA,MACxB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,OAAO,QAAQ;AAAA,GAClB;AAGA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,UAAA,CAAW,OAAA,IAAW,aAAA,CAAc,OAAA,EAAS;AAC/C,QAAA,SAAA,CAAU,UAAA,CAAW,OAAA,EAAS,aAAA,CAAc,OAAO,CAAA;AAAA,MACrD;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,EAAE,KAAK,WAAA,EAAY;AAC5B","file":"chunk-CHNY75QI.js","sourcesContent":["import {\n type ReactNode,\n type ReactElement,\n type HTMLAttributes,\n type Ref,\n isValidElement,\n cloneElement,\n createElement,\n Children,\n} from \"react\";\n\ntype SlotProps = HTMLAttributes<HTMLElement> & {\n children?: ReactNode;\n ref?: Ref<HTMLElement>;\n};\n\nfunction mergeRefs(...refs: (Ref<HTMLElement> | undefined)[]): Ref<HTMLElement> | undefined {\n const filtered = refs.filter(Boolean) as Ref<HTMLElement>[];\n if (filtered.length === 0) return undefined;\n if (filtered.length === 1) return filtered[0];\n return (node: HTMLElement | null) => {\n for (const ref of filtered) {\n if (typeof ref === \"function\") ref(node);\n else if (ref && typeof ref === \"object\") (ref as { current: HTMLElement | null }).current = node;\n }\n };\n}\n\n/**\n * Merges its own props onto its single React element child instead of\n * rendering a wrapper DOM node. Used by trigger-based components\n * (Tooltip, HoverCard, Popover, DropdownMenu) via the `asChild` prop\n * to let consumers control the rendered element.\n *\n * Follows the same contract as Radix UI's Slot / `asChild` pattern.\n */\nexport function Slot({ children, ref, ...slotProps }: SlotProps) {\n if (!isValidElement(children)) {\n console.warn(\"Slot: expected a single React element child.\");\n return null;\n }\n\n const childProps = children.props as Record<string, unknown>;\n const slotRecord = slotProps as Record<string, unknown>;\n\n const mergedProps: Record<string, unknown> = { ...slotProps };\n for (const key of Object.keys(childProps)) {\n if (key === \"style\") {\n mergedProps.style = { ...(slotProps.style ?? {}), ...(childProps.style as object) };\n } else if (key === \"className\") {\n mergedProps.className = [slotProps.className, childProps.className].filter(Boolean).join(\" \");\n } else if (key.startsWith(\"on\") && typeof slotRecord[key] === \"function\") {\n const slotHandler = slotRecord[key] as (...args: unknown[]) => void;\n const childHandler = childProps[key] as (...args: unknown[]) => void;\n mergedProps[key] = (...args: unknown[]) => {\n childHandler?.(...args);\n slotHandler?.(...args);\n };\n } else {\n mergedProps[key] = childProps[key] ?? slotRecord[key];\n }\n }\n\n if (ref) {\n const childRef = (children as ReactElement & { ref?: Ref<HTMLElement> }).ref ?? (childProps.ref as Ref<HTMLElement> | undefined);\n mergedProps.ref = mergeRefs(ref, childRef);\n }\n\n return cloneElement(children as ReactElement, mergedProps);\n}\n\n/**\n * Renders either a Slot (when `asChild` is true — merging props onto\n * the consumer's child element) or the given `fallback` tag (default\n * behaviour, rendering a wrapper element with the given props).\n */\nexport function Slottable({\n asChild,\n fallback: Tag = \"span\",\n children,\n ref,\n ...rest\n}: {\n asChild?: boolean;\n fallback?: keyof HTMLElementTagNameMap;\n children?: ReactNode;\n ref?: Ref<HTMLElement>;\n} & HTMLAttributes<HTMLElement>) {\n if (asChild) {\n const child = Children.only(children);\n return <Slot ref={ref} {...rest}>{child}</Slot>;\n }\n return createElement(Tag, { ref, ...rest } as Record<string, unknown>, children);\n}\n","import { useState, useCallback, useLayoutEffect, useRef, type RefObject } from \"react\";\n\nexport type Side = \"top\" | \"right\" | \"bottom\" | \"left\";\nexport type Align = \"start\" | \"center\" | \"end\";\n\ninterface PositionOptions {\n side?: Side;\n align?: Align;\n offset?: number;\n flip?: boolean;\n}\n\ninterface PositionResult {\n top: number;\n left: number;\n placement: Side;\n}\n\nconst VIEWPORT_PADDING = 8;\n\nexport function usePosition(\n triggerRef: RefObject<HTMLElement | null>,\n floatingRef: RefObject<HTMLElement | null>,\n open: boolean,\n options: PositionOptions = {}\n): PositionResult {\n const { side = \"bottom\", align = \"center\", offset = 8, flip = true } = options;\n const [pos, setPos] = useState<PositionResult>({ top: 0, left: 0, placement: side });\n const rafId = useRef(0);\n\n const compute = useCallback(() => {\n const trigger = triggerRef.current;\n const floating = floatingRef.current;\n if (!trigger || !floating) return;\n\n const tRect = trigger.getBoundingClientRect();\n const fRect = floating.getBoundingClientRect();\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n let placement = side;\n\n if (flip) {\n if (placement === \"bottom\" && tRect.bottom + offset + fRect.height > vh - VIEWPORT_PADDING && tRect.top - offset - fRect.height > VIEWPORT_PADDING) {\n placement = \"top\";\n } else if (placement === \"top\" && tRect.top - offset - fRect.height < VIEWPORT_PADDING && tRect.bottom + offset + fRect.height < vh - VIEWPORT_PADDING) {\n placement = \"bottom\";\n } else if (placement === \"right\" && tRect.right + offset + fRect.width > vw - VIEWPORT_PADDING && tRect.left - offset - fRect.width > VIEWPORT_PADDING) {\n placement = \"left\";\n } else if (placement === \"left\" && tRect.left - offset - fRect.width < VIEWPORT_PADDING && tRect.right + offset + fRect.width < vw - VIEWPORT_PADDING) {\n placement = \"right\";\n }\n }\n\n let top: number;\n let left: number;\n\n if (placement === \"bottom\" || placement === \"top\") {\n top = placement === \"bottom\" ? tRect.bottom + offset : tRect.top - fRect.height - offset;\n\n switch (align) {\n case \"start\":\n left = tRect.left;\n break;\n case \"end\":\n left = tRect.right - fRect.width;\n break;\n default:\n left = tRect.left + (tRect.width - fRect.width) / 2;\n }\n } else {\n left = placement === \"right\" ? tRect.right + offset : tRect.left - fRect.width - offset;\n\n switch (align) {\n case \"start\":\n top = tRect.top;\n break;\n case \"end\":\n top = tRect.bottom - fRect.height;\n break;\n default:\n top = tRect.top + (tRect.height - fRect.height) / 2;\n }\n }\n\n left = Math.max(VIEWPORT_PADDING, Math.min(left, vw - fRect.width - VIEWPORT_PADDING));\n top = Math.max(VIEWPORT_PADDING, Math.min(top, vh - fRect.height - VIEWPORT_PADDING));\n\n setPos({ top, left, placement });\n }, [triggerRef, floatingRef, side, align, offset, flip]);\n\n useLayoutEffect(() => {\n if (!open) return;\n\n compute();\n\n const onUpdate = () => {\n cancelAnimationFrame(rafId.current);\n rafId.current = requestAnimationFrame(compute);\n };\n\n window.addEventListener(\"scroll\", onUpdate, true);\n window.addEventListener(\"resize\", onUpdate);\n\n return () => {\n cancelAnimationFrame(rafId.current);\n window.removeEventListener(\"scroll\", onUpdate, true);\n window.removeEventListener(\"resize\", onUpdate);\n };\n }, [open, compute]);\n\n return pos;\n}\n","import { useState, useRef, useCallback, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn, GLASS_DROPDOWN } from \"../lib/utils\";\nimport { Slot } from \"../lib/slot\";\nimport { usePosition, type Side } from \"../lib/use-position\";\n\ninterface TooltipProps {\n content: ReactNode;\n children: ReactNode;\n side?: Side;\n delay?: number;\n className?: string;\n container?: Element | DocumentFragment;\n}\n\nexport function Tooltip({ content, children, side = \"top\", delay = 300, className, container }: TooltipProps) {\n const [open, setOpen] = useState(false);\n const triggerRef = useRef<HTMLElement>(null);\n const floatingRef = useRef<HTMLDivElement>(null);\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n const id = useRef(`tooltip-${Math.random().toString(36).slice(2, 8)}`).current;\n\n const pos = usePosition(triggerRef, floatingRef, open, { side, offset: 6, flip: true });\n\n const show = useCallback(() => {\n timeoutRef.current = setTimeout(() => setOpen(true), delay);\n }, [delay]);\n\n const hide = useCallback(() => {\n clearTimeout(timeoutRef.current);\n setOpen(false);\n }, []);\n\n return (\n <>\n <Slot\n ref={triggerRef}\n onMouseEnter={show}\n onMouseLeave={hide}\n onFocus={show}\n onBlur={hide}\n aria-describedby={open ? id : undefined}\n >\n {children}\n </Slot>\n {open && createPortal(\n <div\n ref={floatingRef}\n id={id}\n role=\"tooltip\"\n className={cn(\n \"fixed z-[var(--ds-z-tooltip)] pointer-events-none\",\n \"px-ds-2.5 py-ds-1.5 text-xs\",\n \"max-w-[280px] break-words\",\n \"bg-[var(--ds-bg-surface-elevated)] text-[var(--ds-text-primary)]\",\n GLASS_DROPDOWN,\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]\",\n \"rounded-[var(--ds-radius-sm)]\",\n className\n )}\n style={{ top: pos.top, left: pos.left }}\n >\n {content}\n </div>,\n container ?? document.body\n )}\n </>\n );\n}\n","import { useState, useCallback, useRef, useEffect } from \"react\";\n\n// ─── Shared ResizeObserver (singleton per document) ────────────────────────────\n// All useTextOverflow instances share a single ResizeObserver. This avoids the\n// performance cost of 80+ independent observers on pages with many truncated elements.\n\ntype OverflowCallback = () => void;\n\nconst registry = new WeakMap<Element, Set<OverflowCallback>>();\nlet sharedObserver: ResizeObserver | null = null;\nlet rafId: number | null = null;\nconst pendingElements = new Set<Element>();\n\nfunction getSharedObserver(): ResizeObserver {\n if (sharedObserver) return sharedObserver;\n sharedObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n pendingElements.add(entry.target);\n }\n if (rafId === null) {\n rafId = requestAnimationFrame(flush);\n }\n });\n return sharedObserver;\n}\n\nfunction flush() {\n rafId = null;\n for (const el of pendingElements) {\n const callbacks = registry.get(el);\n if (callbacks) {\n for (const cb of callbacks) cb();\n }\n }\n pendingElements.clear();\n}\n\nfunction observe(el: Element, callback: OverflowCallback) {\n let set = registry.get(el);\n if (!set) {\n set = new Set();\n registry.set(el, set);\n }\n set.add(callback);\n if (set.size === 1) {\n getSharedObserver().observe(el);\n }\n}\n\nfunction unobserve(el: Element, callback: OverflowCallback) {\n const set = registry.get(el);\n if (!set) return;\n set.delete(callback);\n if (set.size === 0) {\n registry.delete(el);\n getSharedObserver().unobserve(el);\n }\n}\n\n// ─── Overflow detection ────────────────────────────────────────────────────────\n\nconst TOLERANCE = 1; // px — accounts for integer rounding in scrollWidth/clientWidth\n\nfunction checkOverflow(el: HTMLElement, lines: number): boolean {\n if (lines <= 1) {\n return el.scrollWidth - el.clientWidth > TOLERANCE;\n }\n return el.scrollHeight - el.clientHeight > TOLERANCE;\n}\n\n// ─── Hook ──────────────────────────────────────────────────────────────────────\n\nexport interface UseTextOverflowOptions {\n /** Number of visible lines before truncation. 1 = single-line ellipsis, >1 = line-clamp. */\n lines?: number;\n /** Disable overflow detection (e.g. when component is hidden) */\n disabled?: boolean;\n /** Content key — triggers re-check when this value changes (use for dynamic text content) */\n content?: unknown;\n}\n\nexport interface UseTextOverflowResult {\n /** Callback ref — attach to the element that has truncation CSS applied */\n ref: (node: HTMLElement | null) => void;\n /** True when the element's text is currently overflowing/truncated */\n isTruncated: boolean;\n}\n\n/**\n * Detects whether an element's text content is overflowing (truncated).\n * Uses a single shared ResizeObserver for all instances on the page.\n *\n * @example\n * const { ref, isTruncated } = useTextOverflow({ lines: 1 });\n * return (\n * <Tooltip content={fullText} disabled={!isTruncated}>\n * <span ref={ref} className=\"truncate\">{fullText}</span>\n * </Tooltip>\n * );\n */\nexport function useTextOverflow(options: UseTextOverflowOptions = {}): UseTextOverflowResult {\n const { lines = 1, disabled = false, content } = options;\n const [isTruncated, setIsTruncated] = useState(false);\n const elementRef = useRef<HTMLElement | null>(null);\n // Separate refs: one for the latest check logic, one for the observer-registered function\n const checkRef = useRef<OverflowCallback | null>(null);\n const registeredRef = useRef<OverflowCallback | null>(null);\n\n const doCheck = useCallback(() => {\n if (!elementRef.current || disabled) {\n setIsTruncated(false);\n return;\n }\n const next = checkOverflow(elementRef.current, lines);\n setIsTruncated((prev) => (prev !== next ? next : prev));\n }, [lines, disabled]);\n\n // Keep the check logic ref current so the stable wrapper always uses the latest\n checkRef.current = doCheck;\n\n // Re-check when content changes (handles dynamic text like Dropdown selection)\n // or when disabled state changes\n useEffect(() => {\n if (disabled) {\n setIsTruncated(false);\n } else if (elementRef.current) {\n const next = checkOverflow(elementRef.current, lines);\n setIsTruncated((prev) => (prev !== next ? next : prev));\n }\n }, [content, lines, disabled]);\n\n const ref = useCallback(\n (node: HTMLElement | null) => {\n const prev = elementRef.current;\n\n // Unregister previous element using the SAME function we registered with\n if (prev && registeredRef.current) {\n unobserve(prev, registeredRef.current);\n registeredRef.current = null;\n }\n\n elementRef.current = node;\n\n if (node && !disabled) {\n // Stable wrapper that delegates to the latest check logic\n const wrapper: OverflowCallback = () => checkRef.current?.();\n registeredRef.current = wrapper;\n observe(node, wrapper);\n // Initial check on mount\n const initial = checkOverflow(node, lines);\n setIsTruncated(initial);\n }\n },\n [lines, disabled],\n );\n\n // Cleanup on unmount — uses the registered wrapper, not the check function\n useEffect(() => {\n return () => {\n if (elementRef.current && registeredRef.current) {\n unobserve(elementRef.current, registeredRef.current);\n }\n };\n }, []);\n\n return { ref, isTruncated };\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { createContext, createElement, useContext, useMemo, useState, useEffect } from 'react';
2
+
3
+ // ../../showcase/src/lib/use-breakpoint.ts
4
+ var DEFAULT_BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280 };
5
+ var BreakpointWidthCtx = createContext(null);
6
+ function BreakpointWidthProvider({ width, children }) {
7
+ return createElement(BreakpointWidthCtx, { value: width }, children);
8
+ }
9
+ function readBpFromCSS(key) {
10
+ if (typeof window === "undefined") return DEFAULT_BREAKPOINTS[key];
11
+ const raw = getComputedStyle(document.documentElement).getPropertyValue(`--ds-bp-${key}`).trim();
12
+ const px = parseInt(raw, 10);
13
+ return isNaN(px) ? DEFAULT_BREAKPOINTS[key] : px;
14
+ }
15
+ function useBreakpoint(key) {
16
+ const overrideWidth = useContext(BreakpointWidthCtx);
17
+ const px = useMemo(() => readBpFromCSS(key), [key]);
18
+ const [matches, setMatches] = useState(() => {
19
+ if (overrideWidth !== null) return overrideWidth <= px;
20
+ return typeof window !== "undefined" ? window.matchMedia(`(max-width: ${px}px)`).matches : false;
21
+ });
22
+ useEffect(() => {
23
+ if (overrideWidth !== null) return;
24
+ const mql = window.matchMedia(`(max-width: ${px}px)`);
25
+ const handler = (e) => setMatches(e.matches);
26
+ mql.addEventListener("change", handler);
27
+ setMatches(mql.matches);
28
+ return () => mql.removeEventListener("change", handler);
29
+ }, [px, overrideWidth]);
30
+ if (overrideWidth !== null) return overrideWidth <= px;
31
+ return matches;
32
+ }
33
+
34
+ export { BreakpointWidthProvider, useBreakpoint };
35
+ //# sourceMappingURL=chunk-DPF6776I.js.map
36
+ //# sourceMappingURL=chunk-DPF6776I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../showcase/src/lib/use-breakpoint.ts"],"names":[],"mappings":";;;AAEA,IAAM,mBAAA,GAAsB,EAAE,EAAA,EAAI,GAAA,EAAK,IAAI,GAAA,EAAK,EAAA,EAAI,IAAA,EAAM,EAAA,EAAI,IAAA,EAAK;AAInE,IAAM,kBAAA,GAAqB,cAA6B,IAAI,CAAA;AAOrD,SAAS,uBAAA,CAAwB,EAAE,KAAA,EAAO,QAAA,EAAS,EAAkD;AAC1G,EAAA,OAAO,cAAc,kBAAA,EAAoB,EAAE,KAAA,EAAO,KAAA,IAAS,QAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,GAAA,EAA4B;AACjD,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,OAAO,oBAAoB,GAAG,CAAA;AACjE,EAAA,MAAM,GAAA,GAAM,gBAAA,CAAiB,QAAA,CAAS,eAAe,CAAA,CAClD,iBAAiB,CAAA,QAAA,EAAW,GAAG,CAAA,CAAE,CAAA,CACjC,IAAA,EAAK;AACR,EAAA,MAAM,EAAA,GAAK,QAAA,CAAS,GAAA,EAAK,EAAE,CAAA;AAC3B,EAAA,OAAO,KAAA,CAAM,EAAE,CAAA,GAAI,mBAAA,CAAoB,GAAG,CAAA,GAAI,EAAA;AAChD;AAUO,SAAS,cAAc,GAAA,EAA6B;AACzD,EAAA,MAAM,aAAA,GAAgB,WAAW,kBAAkB,CAAA;AACnD,EAAA,MAAM,EAAA,GAAK,QAAQ,MAAM,aAAA,CAAc,GAAG,CAAA,EAAG,CAAC,GAAG,CAAC,CAAA;AAElD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,MAAM;AAC3C,IAAA,IAAI,aAAA,KAAkB,IAAA,EAAM,OAAO,aAAA,IAAiB,EAAA;AACpD,IAAA,OAAO,OAAO,WAAW,WAAA,GACrB,MAAA,CAAO,WAAW,CAAA,YAAA,EAAe,EAAE,CAAA,GAAA,CAAK,CAAA,CAAE,OAAA,GAC1C,KAAA;AAAA,EACN,CAAC,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,kBAAkB,IAAA,EAAM;AAC5B,IAAA,MAAM,GAAA,GAAM,MAAA,CAAO,UAAA,CAAW,CAAA,YAAA,EAAe,EAAE,CAAA,GAAA,CAAK,CAAA;AACpD,IAAA,MAAM,OAAA,GAAU,CAAC,CAAA,KAA2B,UAAA,CAAW,EAAE,OAAO,CAAA;AAChE,IAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,OAAO,CAAA;AACtC,IAAA,UAAA,CAAW,IAAI,OAAO,CAAA;AACtB,IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,OAAO,CAAA;AAAA,EACxD,CAAA,EAAG,CAAC,EAAA,EAAI,aAAa,CAAC,CAAA;AAEtB,EAAA,IAAI,aAAA,KAAkB,IAAA,EAAM,OAAO,aAAA,IAAiB,EAAA;AACpD,EAAA,OAAO,OAAA;AACT","file":"chunk-DPF6776I.js","sourcesContent":["import { useState, useEffect, useMemo, createContext, useContext, createElement, type ReactNode } from \"react\";\n\nconst DEFAULT_BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280 } as const;\n\nexport type BreakpointKey = keyof typeof DEFAULT_BREAKPOINTS;\n\nconst BreakpointWidthCtx = createContext<number | null>(null);\n\n/**\n * Provides an override container width for all `useBreakpoint` calls within\n * this subtree. Used by the builder's viewport preview to make components\n * respond to the constrained canvas width instead of the browser viewport.\n */\nexport function BreakpointWidthProvider({ width, children }: { width: number | null; children: ReactNode }) {\n return createElement(BreakpointWidthCtx, { value: width }, children);\n}\n\nfunction readBpFromCSS(key: BreakpointKey): number {\n if (typeof window === \"undefined\") return DEFAULT_BREAKPOINTS[key];\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue(`--ds-bp-${key}`)\n .trim();\n const px = parseInt(raw, 10);\n return isNaN(px) ? DEFAULT_BREAKPOINTS[key] : px;\n}\n\n/**\n * Reactive breakpoint check that reads `--ds-bp-*` CSS variables.\n * Returns true when the viewport (or override container) is at or below the\n * named breakpoint.\n *\n * @example\n * const isMobile = useBreakpoint(\"md\"); // true when ≤768px\n */\nexport function useBreakpoint(key: BreakpointKey): boolean {\n const overrideWidth = useContext(BreakpointWidthCtx);\n const px = useMemo(() => readBpFromCSS(key), [key]);\n\n const [matches, setMatches] = useState(() => {\n if (overrideWidth !== null) return overrideWidth <= px;\n return typeof window !== \"undefined\"\n ? window.matchMedia(`(max-width: ${px}px)`).matches\n : false;\n });\n\n useEffect(() => {\n if (overrideWidth !== null) return;\n const mql = window.matchMedia(`(max-width: ${px}px)`);\n const handler = (e: MediaQueryListEvent) => setMatches(e.matches);\n mql.addEventListener(\"change\", handler);\n setMatches(mql.matches);\n return () => mql.removeEventListener(\"change\", handler);\n }, [px, overrideWidth]);\n\n if (overrideWidth !== null) return overrideWidth <= px;\n return matches;\n}\n"]}
@@ -9,13 +9,24 @@ var GLASS_BACKDROP = "[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop
9
9
  var GLASS_SURFACE = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-card),var(--ds-glass-inset)]`;
10
10
  var GLASS_OVERLAY = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-modal),var(--ds-glass-inset)]`;
11
11
  var GLASS_DROPDOWN = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-dropdown),var(--ds-glass-inset)]`;
12
+ var scrollLockCount = 0;
13
+ var scrollLockPreviousOverflow = "";
12
14
  function lockBodyScroll() {
13
- document.body.style.overflow = "hidden";
15
+ if (scrollLockCount === 0) {
16
+ scrollLockPreviousOverflow = document.body.style.overflow;
17
+ document.body.style.overflow = "hidden";
18
+ }
19
+ scrollLockCount++;
14
20
  }
15
21
  function unlockBodyScroll() {
16
- document.body.style.overflow = "";
22
+ if (scrollLockCount === 0) return;
23
+ scrollLockCount--;
24
+ if (scrollLockCount === 0) {
25
+ document.body.style.overflow = scrollLockPreviousOverflow;
26
+ scrollLockPreviousOverflow = "";
27
+ }
17
28
  }
18
29
 
19
30
  export { GLASS_BACKDROP, GLASS_DROPDOWN, GLASS_OVERLAY, GLASS_SURFACE, cn, lockBodyScroll, unlockBodyScroll };
20
- //# sourceMappingURL=chunk-5XIPPVH7.js.map
21
- //# sourceMappingURL=chunk-5XIPPVH7.js.map
31
+ //# sourceMappingURL=chunk-IUBWNDUK.js.map
32
+ //# sourceMappingURL=chunk-IUBWNDUK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../showcase/src/lib/utils.ts"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;AAEO,IAAM,cAAA,GAAiB;AAEvB,IAAM,aAAA,GAAgB,GAAG,cAAc,CAAA,qDAAA;AAEvC,IAAM,aAAA,GAAgB,GAAG,cAAc,CAAA,sDAAA;AAEvC,IAAM,cAAA,GAAiB,GAAG,cAAc,CAAA,yDAAA;AAM/C,IAAI,eAAA,GAAkB,CAAA;AACtB,IAAI,0BAAA,GAA6B,EAAA;AAE1B,SAAS,cAAA,GAAiB;AAC/B,EAAA,IAAI,oBAAoB,CAAA,EAAG;AACzB,IAAA,0BAAA,GAA6B,QAAA,CAAS,KAAK,KAAA,CAAM,QAAA;AACjD,IAAA,QAAA,CAAS,IAAA,CAAK,MAAM,QAAA,GAAW,QAAA;AAAA,EACjC;AACA,EAAA,eAAA,EAAA;AACF;AAEO,SAAS,gBAAA,GAAmB;AACjC,EAAA,IAAI,oBAAoB,CAAA,EAAG;AAC3B,EAAA,eAAA,EAAA;AACA,EAAA,IAAI,oBAAoB,CAAA,EAAG;AACzB,IAAA,QAAA,CAAS,IAAA,CAAK,MAAM,QAAA,GAAW,0BAAA;AAC/B,IAAA,0BAAA,GAA6B,EAAA;AAAA,EAC/B;AACF","file":"chunk-IUBWNDUK.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n\nexport const GLASS_BACKDROP = \"[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]\";\n\nexport const GLASS_SURFACE = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-card),var(--ds-glass-inset)]`;\n\nexport const GLASS_OVERLAY = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-modal),var(--ds-glass-inset)]`;\n\nexport const GLASS_DROPDOWN = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-dropdown),var(--ds-glass-inset)]`;\n\n// Body scroll lock is reference-counted so stacked overlays (a Dialog opened\n// from a Drawer, for example) only restore scrolling when the LAST one\n// closes. The original overflow value is captured on the first lock and put\n// back on the last unlock; an unbalanced unlock is clamped at zero.\nlet scrollLockCount = 0;\nlet scrollLockPreviousOverflow = \"\";\n\nexport function lockBodyScroll() {\n if (scrollLockCount === 0) {\n scrollLockPreviousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n }\n scrollLockCount++;\n}\n\nexport function unlockBodyScroll() {\n if (scrollLockCount === 0) return;\n scrollLockCount--;\n if (scrollLockCount === 0) {\n document.body.style.overflow = scrollLockPreviousOverflow;\n scrollLockPreviousOverflow = \"\";\n }\n}\n\n/** Test-only: current number of active locks. */\nexport function getBodyScrollLockCount() {\n return scrollLockCount;\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { cn } from './chunk-IUBWNDUK.js';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+
4
+ function Bone({ className, style }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "div",
7
+ {
8
+ className: cn("rounded-[var(--ds-radius-sm)] bg-[var(--ds-bg-emphasis)] animate-pulse", className),
9
+ style
10
+ }
11
+ );
12
+ }
13
+ function Skeleton({ variant = "text", lines = 3, width, height, className }) {
14
+ if (variant === "custom") {
15
+ return /* @__PURE__ */ jsx(Bone, { className, style: { width, height } });
16
+ }
17
+ if (variant === "avatar") {
18
+ return /* @__PURE__ */ jsx(Bone, { className: cn("h-10 w-10 rounded-[var(--ds-radius-full)]", className) });
19
+ }
20
+ if (variant === "card") {
21
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-ds-3", className), children: [
22
+ /* @__PURE__ */ jsx(Bone, { className: "h-32 w-full rounded-[var(--ds-radius-md)]" }),
23
+ /* @__PURE__ */ jsx(Bone, { className: "h-4 w-3/4" }),
24
+ /* @__PURE__ */ jsx(Bone, { className: "h-4 w-1/2" })
25
+ ] });
26
+ }
27
+ if (variant === "table-row") {
28
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-ds-4", className), children: [
29
+ /* @__PURE__ */ jsx(Bone, { className: "h-4 flex-[3]" }),
30
+ /* @__PURE__ */ jsx(Bone, { className: "h-4 flex-[2]" }),
31
+ /* @__PURE__ */ jsx(Bone, { className: "h-4 flex-1" }),
32
+ /* @__PURE__ */ jsx(Bone, { className: "h-4 flex-1" })
33
+ ] });
34
+ }
35
+ const widths = ["w-3/4", "w-1/2", "w-5/6", "w-2/3", "w-4/5"];
36
+ return /* @__PURE__ */ jsx("div", { className: cn("space-y-ds-3", className), children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx(Bone, { className: cn("h-4", widths[i % widths.length]) }, i)) });
37
+ }
38
+
39
+ export { Skeleton };
40
+ //# sourceMappingURL=chunk-OUYJXVLQ.js.map
41
+ //# sourceMappingURL=chunk-OUYJXVLQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../showcase/src/components/Skeleton.tsx"],"names":[],"mappings":";;;AAUA,SAAS,IAAA,CAAK,EAAE,SAAA,EAAW,KAAA,EAAM,EAAwD;AACvF,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,wEAAA,EAA0E,SAAS,CAAA;AAAA,MACjG;AAAA;AAAA,GACF;AAEJ;AAEO,SAAS,QAAA,CAAS,EAAE,OAAA,GAAU,MAAA,EAAQ,QAAQ,CAAA,EAAG,KAAA,EAAO,MAAA,EAAQ,SAAA,EAAU,EAAkB;AACjG,EAAA,IAAI,YAAY,QAAA,EAAU;AACxB,IAAA,2BAAQ,IAAA,EAAA,EAAK,SAAA,EAAsB,OAAO,EAAE,KAAA,EAAO,QAAO,EAAG,CAAA;AAAA,EAC/D;AAEA,EAAA,IAAI,YAAY,QAAA,EAAU;AACxB,IAAA,2BAAQ,IAAA,EAAA,EAAK,SAAA,EAAW,EAAA,CAAG,2CAAA,EAA6C,SAAS,CAAA,EAAG,CAAA;AAAA,EACtF;AAEA,EAAA,IAAI,YAAY,MAAA,EAAQ;AACtB,IAAA,4BACG,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,cAAA,EAAgB,SAAS,CAAA,EAC1C,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,WAAU,2CAAA,EAA4C,CAAA;AAAA,sBAC5D,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,WAAA,EAAY,CAAA;AAAA,sBAC5B,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,WAAA,EAAY;AAAA,KAAA,EAC9B,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,YAAY,WAAA,EAAa;AAC3B,IAAA,4BACG,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,eAAA,EAAiB,SAAS,CAAA,EAC3C,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,WAAU,cAAA,EAAe,CAAA;AAAA,sBAC/B,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,cAAA,EAAe,CAAA;AAAA,sBAC/B,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,YAAA,EAAa,CAAA;AAAA,sBAC7B,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,YAAA,EAAa;AAAA,KAAA,EAC/B,CAAA;AAAA,EAEJ;AAGA,EAAA,MAAM,SAAS,CAAC,OAAA,EAAS,OAAA,EAAS,OAAA,EAAS,SAAS,OAAO,CAAA;AAC3D,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,cAAA,EAAgB,SAAS,CAAA,EACzC,QAAA,EAAA,KAAA,CAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,KAAA,EAAM,EAAG,CAAC,CAAA,EAAG,CAAA,qBACjC,GAAA,CAAC,IAAA,EAAA,EAAa,SAAA,EAAW,EAAA,CAAG,KAAA,EAAO,MAAA,CAAO,CAAA,GAAI,MAAA,CAAO,MAAM,CAAC,CAAA,EAAA,EAAjD,CAAoD,CAChE,CAAA,EACH,CAAA;AAEJ","file":"chunk-OUYJXVLQ.js","sourcesContent":["import { cn } from \"../lib/utils\";\n\ninterface SkeletonProps {\n variant?: \"text\" | \"avatar\" | \"card\" | \"table-row\" | \"custom\";\n lines?: number;\n width?: string;\n height?: string;\n className?: string;\n}\n\nfunction Bone({ className, style }: { className?: string; style?: React.CSSProperties }) {\n return (\n <div\n className={cn(\"rounded-[var(--ds-radius-sm)] bg-[var(--ds-bg-emphasis)] animate-pulse\", className)}\n style={style}\n />\n );\n}\n\nexport function Skeleton({ variant = \"text\", lines = 3, width, height, className }: SkeletonProps) {\n if (variant === \"custom\") {\n return <Bone className={className} style={{ width, height }} />;\n }\n\n if (variant === \"avatar\") {\n return <Bone className={cn(\"h-10 w-10 rounded-[var(--ds-radius-full)]\", className)} />;\n }\n\n if (variant === \"card\") {\n return (\n <div className={cn(\"space-y-ds-3\", className)}>\n <Bone className=\"h-32 w-full rounded-[var(--ds-radius-md)]\" />\n <Bone className=\"h-4 w-3/4\" />\n <Bone className=\"h-4 w-1/2\" />\n </div>\n );\n }\n\n if (variant === \"table-row\") {\n return (\n <div className={cn(\"flex gap-ds-4\", className)}>\n <Bone className=\"h-4 flex-[3]\" />\n <Bone className=\"h-4 flex-[2]\" />\n <Bone className=\"h-4 flex-1\" />\n <Bone className=\"h-4 flex-1\" />\n </div>\n );\n }\n\n // text variant\n const widths = [\"w-3/4\", \"w-1/2\", \"w-5/6\", \"w-2/3\", \"w-4/5\"];\n return (\n <div className={cn(\"space-y-ds-3\", className)}>\n {Array.from({ length: lines }, (_, i) => (\n <Bone key={i} className={cn(\"h-4\", widths[i % widths.length])} />\n ))}\n </div>\n );\n}\n"]}
@@ -29,48 +29,57 @@ function useExtendedMap(pack) {
29
29
  );
30
30
  }
31
31
  var loadingPacks = /* @__PURE__ */ new Set();
32
+ var failedPacks = /* @__PURE__ */ new Set();
32
33
  async function loadPack(pack) {
33
- if (curatedCache.has(pack) || loadingPacks.has(pack)) return;
34
+ if (curatedCache.has(pack) || loadingPacks.has(pack) || failedPacks.has(pack)) return;
34
35
  loadingPacks.add(pack);
35
36
  let mod;
36
- switch (pack) {
37
- case "lucide":
38
- mod = await import('./lucide-Z74WVRAK.js');
39
- break;
40
- case "phosphor":
41
- try {
42
- mod = await import('./phosphor-DYUCR5S2.js');
43
- } catch {
44
- throw new Error("gridsmith-ui: @phosphor-icons/react is not installed. Run: npm install @phosphor-icons/react");
45
- }
46
- break;
47
- case "heroicons":
48
- try {
49
- mod = await import('./heroicons-CCKJHFZY.js');
50
- } catch {
51
- throw new Error("gridsmith-ui: @heroicons/react is not installed. Run: npm install @heroicons/react");
52
- }
53
- break;
54
- case "tabler":
55
- try {
56
- mod = await import('./tabler-GRXDPAHR.js');
57
- } catch {
58
- throw new Error("gridsmith-ui: @tabler/icons-react is not installed. Run: npm install @tabler/icons-react");
59
- }
60
- break;
61
- case "feather":
62
- try {
63
- mod = await import('./feather-432JQGUB.js');
64
- } catch {
65
- throw new Error("gridsmith-ui: react-icons is not installed. Run: npm install react-icons");
66
- }
67
- break;
37
+ try {
38
+ switch (pack) {
39
+ case "lucide":
40
+ mod = await import('./lucide-AILUUOAJ.js');
41
+ break;
42
+ case "phosphor":
43
+ try {
44
+ mod = await import('./phosphor-A4JOBGMT.js');
45
+ } catch {
46
+ throw new Error("gridsmith-ui: @phosphor-icons/react is not installed. Run: npm install @phosphor-icons/react");
47
+ }
48
+ break;
49
+ case "heroicons":
50
+ try {
51
+ mod = await import('./heroicons-CA5OQ76O.js');
52
+ } catch {
53
+ throw new Error("gridsmith-ui: @heroicons/react is not installed. Run: npm install @heroicons/react");
54
+ }
55
+ break;
56
+ case "tabler":
57
+ try {
58
+ mod = await import('./tabler-TVOR6AFM.js');
59
+ } catch {
60
+ throw new Error("gridsmith-ui: @tabler/icons-react is not installed. Run: npm install @tabler/icons-react");
61
+ }
62
+ break;
63
+ case "feather":
64
+ try {
65
+ mod = await import('./feather-V32UNIQL.js');
66
+ } catch {
67
+ throw new Error("gridsmith-ui: react-icons is not installed. Run: npm install react-icons");
68
+ }
69
+ break;
70
+ }
71
+ } catch (err) {
72
+ loadingPacks.delete(pack);
73
+ failedPacks.add(pack);
74
+ console.error(err instanceof Error ? err.message : err);
75
+ return;
68
76
  }
69
77
  curatedCache.set(pack, mod.loadCurated());
70
78
  notifySubscribers();
71
79
  mod.loadExtended().then((extended) => {
72
80
  extendedCache.set(pack, extended);
73
81
  notifySubscribers();
82
+ }).catch(() => {
74
83
  });
75
84
  }
76
85
  var IconCtx = createContext({ pack: "lucide", weight: 1.5 });
@@ -136,5 +145,5 @@ function Icon({ name, size = 16, className }) {
136
145
  }
137
146
 
138
147
  export { Icon, IconProvider, preloadPack };
139
- //# sourceMappingURL=chunk-6TMNEBBJ.js.map
140
- //# sourceMappingURL=chunk-6TMNEBBJ.js.map
148
+ //# sourceMappingURL=chunk-XUBVMRIE.js.map
149
+ //# sourceMappingURL=chunk-XUBVMRIE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../showcase/src/lib/icons.tsx"],"names":[],"mappings":";;;;AA6CA,IAAM,WAAA,uBAAkB,GAAA,EAAgB;AACxC,SAAS,iBAAA,GAAoB;AAC3B,EAAA,WAAA,CAAY,OAAA,CAAQ,CAAC,EAAA,KAAO,EAAA,EAAI,CAAA;AAClC;AACA,SAAS,UAAU,EAAA,EAA4B;AAC7C,EAAA,WAAA,CAAY,IAAI,EAAE,CAAA;AAClB,EAAA,OAAO,MAAM;AAAE,IAAA,WAAA,CAAY,OAAO,EAAE,CAAA;AAAA,EAAG,CAAA;AACzC;AAEA,IAAM,YAAA,uBAAmB,GAAA,EAAuB;AAChD,IAAM,aAAA,uBAAoB,GAAA,EAAuB;AAEjD,SAAS,cAAc,IAAA,EAAgC;AACrD,EAAA,OAAO,oBAAA;AAAA,IACL,SAAA;AAAA,IACA,MAAM,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA,IAAK,IAAA;AAAA,IAChC,MAAM;AAAA,GACR;AACF;AAEA,SAAS,eAAe,IAAA,EAAgC;AACtD,EAAA,OAAO,oBAAA;AAAA,IACL,SAAA;AAAA,IACA,MAAM,aAAA,CAAc,GAAA,CAAI,IAAI,CAAA,IAAK,IAAA;AAAA,IACjC,MAAM;AAAA,GACR;AACF;AAaA,IAAM,YAAA,uBAAmB,GAAA,EAAc;AACvC,IAAM,WAAA,uBAAkB,GAAA,EAAc;AAOtC,eAAe,SAAS,IAAA,EAA+B;AACrD,EAAA,I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AAA,EAAS,cAAA,EAAgB,KAAA,EAAO,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAK,EAAG,SAAA,EAAsB,CAAA;AAAA,EACpG;AAEA,EAAA,IAAI,eAAe,UAAA,EAAY;AAC7B,IAAA,2BAAQ,IAAA,EAAA,EAAK,IAAA,EAAY,QAAQ,iBAAA,CAAkB,MAAM,GAAG,SAAA,EAAsB,CAAA;AAAA,EACpF;AAEA,EAAA,IAAI,eAAe,WAAA,EAAa;AAC9B,IAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAsB,KAAA,EAAO,EAAE,KAAA,EAAO,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,WAAA,EAAa,MAAA,EAAO,EAAG,CAAA;AAAA,EAChG;AAEA,EAAA,IAAI,eAAe,QAAA,EAAU;AAC3B,IAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAY,MAAA,EAAQ,QAAQ,SAAA,EAAsB,CAAA;AAAA,EACjE;AAEA,EAAA,IAAI,eAAe,SAAA,EAAW;AAC5B,IAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAY,SAAA,EAAsB,aAAa,MAAA,EAAQ,CAAA;AAAA,EACtE;AAEA,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAY,WAAA,EAAa,QAAQ,SAAA,EAAsB,CAAA;AACtE","file":"chunk-XUBVMRIE.js","sourcesContent":["import { createContext, useContext, useEffect, useSyncExternalStore, type ReactNode, type ComponentType } from \"react\";\n\n/* ── Types ────────────────────────────────────────────────────── */\n\n/**\n * Runtime list of curated icon names. The CuratedIconName type derives from\n * this array, so adding a name here extends autocomplete automatically.\n * Every name must have an alias (or auto-kebab match) in ALL five packs —\n * icon-completeness.test.tsx enforces this.\n */\nexport const CURATED_ICON_NAMES = [\n \"home\", \"folder\", \"chart\", \"settings\",\n \"chevron-right\", \"close\", \"plus\", \"search\",\n \"bell\", \"user\", \"check\", \"warning\", \"info\", \"error\",\n \"clock\", \"calendar\",\n \"bold\", \"italic\", \"underline\", \"strikethrough\",\n \"align-left\", \"align-center\", \"align-right\",\n \"list\", \"list-ordered\", \"list-checks\",\n \"link\", \"image\", \"table\", \"code\", \"quote\", \"minus\",\n \"superscript\", \"subscript\", \"highlight\", \"type\",\n \"chevron-up\", \"chevron-down\", \"trash\",\n \"undo\", \"redo\",\n \"arrow-left\", \"grip-vertical\",\n \"mic\", \"paperclip\", \"send\",\n \"log-out\", \"edit\", \"menu\",\n \"star\", \"bookmark\", \"download\", \"upload\",\n] as const;\n\ntype CuratedIconName = (typeof CURATED_ICON_NAMES)[number];\n\n/**\n * Curated names provide autocomplete and work identically across all 5 packs.\n * Any kebab-case string is also accepted — it resolves directly against the\n * active pack's native exports (e.g. \"clipboard-copy\" → Lucide's ClipboardCopy).\n */\nexport type IconName = CuratedIconName | (string & {});\n\nexport type IconPack = \"lucide\" | \"phosphor\" | \"heroicons\" | \"tabler\" | \"feather\";\n\ntype IconComponent = ComponentType<Record<string, unknown>>;\ntype IconMap = Record<string, IconComponent>;\n\n/* ── External store ──────────────────────────────────────────── */\n\ntype Subscriber = () => void;\nconst subscribers = new Set<Subscriber>();\nfunction notifySubscribers() {\n subscribers.forEach((fn) => fn());\n}\nfunction subscribe(cb: Subscriber): () => void {\n subscribers.add(cb);\n return () => { subscribers.delete(cb); };\n}\n\nconst curatedCache = new Map<IconPack, IconMap>();\nconst extendedCache = new Map<IconPack, IconMap>();\n\nfunction useCuratedMap(pack: IconPack): IconMap | null {\n return useSyncExternalStore(\n subscribe,\n () => curatedCache.get(pack) ?? null,\n () => null,\n );\n}\n\nfunction useExtendedMap(pack: IconPack): IconMap | null {\n return useSyncExternalStore(\n subscribe,\n () => extendedCache.get(pack) ?? null,\n () => null,\n );\n}\n\n/* ── Pack loading ────────────────────────────────────────────────\n Each pack is isolated in its own file under ./icon-packs/.\n Only the active pack's module is dynamically imported at runtime,\n so bundlers won't resolve unused pack dependencies at build time.\n\n Loading is two-phase:\n 1. Curated map (50 static named imports) — available as soon as\n the pack chunk loads, cached and notified immediately.\n 2. Extended map (full barrel import + kebab-case iteration) —\n loaded in the background, cached and notified when ready. */\n\nconst loadingPacks = new Set<IconPack>();\nconst failedPacks = new Set<IconPack>();\n\ntype PackModule = {\n loadCurated(): IconMap;\n loadExtended(): Promise<IconMap>;\n};\n\nasync function loadPack(pack: IconPack): Promise<void> {\n if (curatedCache.has(pack) || loadingPacks.has(pack) || failedPacks.has(pack)) return;\n loadingPacks.add(pack);\n\n let mod: PackModule;\n try {\n switch (pack) {\n case \"lucide\":\n mod = await import(\"./icon-packs/lucide\");\n break;\n case \"phosphor\":\n try { mod = await import(\"./icon-packs/phosphor\"); }\n catch { throw new Error(\"gridsmith-ui: @phosphor-icons/react is not installed. Run: npm install @phosphor-icons/react\"); }\n break;\n case \"heroicons\":\n try { mod = await import(\"./icon-packs/heroicons\"); }\n catch { throw new Error(\"gridsmith-ui: @heroicons/react is not installed. Run: npm install @heroicons/react\"); }\n break;\n case \"tabler\":\n try { mod = await import(\"./icon-packs/tabler\"); }\n catch { throw new Error(\"gridsmith-ui: @tabler/icons-react is not installed. Run: npm install @tabler/icons-react\"); }\n break;\n case \"feather\":\n try { mod = await import(\"./icon-packs/feather\"); }\n catch { throw new Error(\"gridsmith-ui: react-icons is not installed. Run: npm install react-icons\"); }\n break;\n }\n } catch (err) {\n loadingPacks.delete(pack);\n failedPacks.add(pack);\n console.error(err instanceof Error ? err.message : err);\n return;\n }\n\n curatedCache.set(pack, mod!.loadCurated());\n notifySubscribers();\n\n mod!.loadExtended().then((extended) => {\n extendedCache.set(pack, extended);\n notifySubscribers();\n }).catch(() => {\n // Extended map failed (e.g. network error loading the full barrel).\n // Curated icons still work; extended names will not resolve.\n });\n}\n\n/** Exported for the icon-completeness test — not part of the public API. */\nexport const packLoaders: Record<IconPack, {\n curated: () => Promise<IconMap>;\n extended: () => Promise<IconMap>;\n}> = {\n lucide: { curated: () => import(\"./icon-packs/lucide\").then((m) => m.loadCurated()), extended: () => import(\"./icon-packs/lucide\").then((m) => m.loadExtended()) },\n phosphor: { curated: () => import(\"./icon-packs/phosphor\").then((m) => m.loadCurated()), extended: () => import(\"./icon-packs/phosphor\").then((m) => m.loadExtended()) },\n heroicons: { curated: () => import(\"./icon-packs/heroicons\").then((m) => m.loadCurated()), extended: () => import(\"./icon-packs/heroicons\").then((m) => m.loadExtended()) },\n tabler: { curated: () => import(\"./icon-packs/tabler\").then((m) => m.loadCurated()), extended: () => import(\"./icon-packs/tabler\").then((m) => m.loadExtended()) },\n feather: { curated: () => import(\"./icon-packs/feather\").then((m) => m.loadCurated()), extended: () => import(\"./icon-packs/feather\").then((m) => m.loadExtended()) },\n};\n\n/* ── Context ──────────────────────────────────────────────────── */\n\ninterface IconContextValue {\n pack: IconPack;\n weight: number;\n}\n\nconst IconCtx = createContext<IconContextValue>({ pack: \"lucide\", weight: 1.5 });\n\nexport function IconProvider({ pack, weight, children }: { pack: IconPack; weight: number; children: ReactNode }) {\n useEffect(() => {\n loadPack(pack);\n if (pack !== \"lucide\") loadPack(\"lucide\");\n }, [pack]);\n\n return <IconCtx.Provider value={{ pack, weight }}>{children}</IconCtx.Provider>;\n}\n\n/**\n * Start loading a pack's icon chunk before React mounts. Call this in your\n * app's entry point (e.g. main.tsx) for the fastest possible cold start:\n *\n * import { preloadPack } from 'gridsmith-ui/icons'\n * preloadPack('lucide')\n */\nexport function preloadPack(pack: IconPack): void {\n loadPack(pack);\n}\n\n/* ── Phosphor weight mapping ──────────────────────────────────── */\n\nfunction getPhosphorWeight(numericWeight: number): \"thin\" | \"light\" | \"regular\" | \"bold\" | \"fill\" | \"duotone\" {\n if (numericWeight <= 0.75) return \"thin\";\n if (numericWeight <= 1.25) return \"light\";\n if (numericWeight <= 1.75) return \"regular\";\n if (numericWeight <= 2.25) return \"bold\";\n return \"fill\";\n}\n\n/* ── Icon component ───────────────────────────────────────────── */\n\nexport function Icon({ name, size = 16, className }: { name: IconName; size?: number; className?: string }) {\n const { pack, weight } = useContext(IconCtx);\n\n const curatedMap = useCuratedMap(pack);\n const extendedMap = useExtendedMap(pack);\n const lucideCurated = useCuratedMap(\"lucide\");\n const lucideExtended = useExtendedMap(\"lucide\");\n\n // Ensure the active pack is loading (covers cases where Icon mounts\n // before IconProvider's useEffect fires, e.g. during SSR hydration)\n if (!curatedCache.has(pack) && !loadingPacks.has(pack)) {\n loadPack(pack);\n }\n\n let Comp: IconComponent | undefined | null = null;\n let renderPack: IconPack = pack;\n\n // Tier 1: curated map (available once pack chunk has loaded)\n if (curatedMap) {\n Comp = curatedMap[name];\n }\n\n // Tier 2: extended map (available after barrel import completes)\n if (!Comp && extendedMap) {\n Comp = extendedMap[name];\n }\n\n // Tier 3: lucide fallback (curated first, then extended)\n if (!Comp && pack !== \"lucide\") {\n const fallback = lucideCurated?.[name] ?? lucideExtended?.[name];\n if (fallback) {\n Comp = fallback;\n renderPack = \"lucide\";\n }\n }\n\n if (!Comp) {\n const allMapsLoaded = curatedMap && extendedMap &&\n (pack === \"lucide\" || (lucideCurated && lucideExtended));\n if (allMapsLoaded) return null;\n return <span style={{ display: \"inline-block\", width: size, height: size }} className={className} />;\n }\n\n if (renderPack === \"phosphor\") {\n return <Comp size={size} weight={getPhosphorWeight(weight)} className={className} />;\n }\n\n if (renderPack === \"heroicons\") {\n return <Comp className={className} style={{ width: size, height: size, strokeWidth: weight }} />;\n }\n\n if (renderPack === \"tabler\") {\n return <Comp size={size} stroke={weight} className={className} />;\n }\n\n if (renderPack === \"feather\") {\n return <Comp size={size} className={className} strokeWidth={weight} />;\n }\n\n return <Comp size={size} strokeWidth={weight} className={className} />;\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ColumnDef } from '@tanstack/react-table';
3
+ import { B as BreakpointKey } from './use-breakpoint-Cn51IubK.js';
4
+ import 'react';
5
+
6
+ /** Column meta for opt-in truncation. Set on ColumnDef.meta. */
7
+ interface DataGridColumnMeta {
8
+ /** true = single-line, or { lines: N } for multi-line clamp. */
9
+ truncate?: boolean | {
10
+ lines: number;
11
+ };
12
+ /** CSS max-width for the column. */
13
+ maxWidth?: string;
14
+ }
15
+ interface DataGridProps<T> {
16
+ data: T[];
17
+ columns: ColumnDef<T, any>[];
18
+ pageSize?: number;
19
+ editable?: boolean;
20
+ onCellEdit?: (rowIndex: number, columnId: string, value: unknown) => void;
21
+ /** Breakpoint at which the grid switches to card layout. Defaults to "md" (768px). */
22
+ mobileBreakpoint?: BreakpointKey;
23
+ className?: string;
24
+ }
25
+ declare function DataGrid<T>({ data, columns, pageSize, editable, onCellEdit, mobileBreakpoint, className, }: DataGridProps<T>): react_jsx_runtime.JSX.Element;
26
+
27
+ export { DataGrid, type DataGridColumnMeta };