@spear-ai/spectral 1.21.3 → 1.22.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","names":[],"sources":["../src/components/Drawer/Drawer.tsx"],"mappings":";;;;;;UAMiB,WAAA;EACf,SAAA;EACA,QAAA,GAAW,SAAA;EACX,WAAA;EACA,WAAA,GAAc,SAAA;EACd,SAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA,GAAa,MAAA,CAAO,KAAA,CAAM,KAAA;EAC1B,YAAA,GAAe,MAAA,CAAO,KAAA,CAAM,KAAA;EAC5B,KAAA;EACA,YAAA;EACA,YAAA,IAAgB,IAAA;EAChB,IAAA;EACA,IAAA;EACA,KAAA,GAAQ,SAAA;EACR,OAAA,EAAS,SAAA;AAAA;AAAA,cA8BE,MAAA;EAAM,QAAA;EAAA,SAAA;EAAA,WAAA;EAAA,WAAA;EAAA,SAAA;EAAA,WAAA;EAAA,YAAA;EAAA,UAAA;EAAA,YAAA;EAAA,KAAA;EAAA,YAAA;EAAA,YAAA;EAAA,IAAA;EAAA,IAAA;EAAA,KAAA;EAAA;AAAA,GAiBhB,WAAA,KAAW,oBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"Drawer.d.ts","names":[],"sources":["../src/components/Drawer/Drawer.tsx"],"mappings":";;;;;;UAMiB,WAAA;EACf,SAAA;EACA,QAAA,GAAW,SAAA;EACX,WAAA;EACA,WAAA,GAAc,SAAA;EACd,SAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA,GAAa,MAAA,CAAO,KAAA,CAAM,KAAA;EAC1B,YAAA,GAAe,MAAA,CAAO,KAAA,CAAM,KAAA;EAC5B,KAAA;EACA,YAAA;EACA,YAAA,IAAgB,IAAA;EAChB,IAAA;EACA,IAAA;EACA,KAAA,GAAQ,SAAA;EACR,OAAA,EAAS,SAAA;AAAA;AAAA,cA8BE,MAAA;EAAM,QAAA;EAAA,SAAA;EAAA,WAAA;EAAA,WAAA;EAAA,SAAA;EAAA,WAAA;EAAA,YAAA;EAAA,UAAA;EAAA,YAAA;EAAA,KAAA;EAAA,YAAA;EAAA,YAAA;EAAA,IAAA;EAAA,IAAA;EAAA,KAAA;EAAA;AAAA,GAgBhB,WAAA,KAAW,oBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","names":[],"sources":["../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { Dialog } from '@base-ui/react/dialog'\nimport { Drawer as DrawerGesture } from '@base-ui/react/drawer'\nimport { SpectralProvider } from '@components/SpectralProvider/SpectralProvider'\nimport { cn } from '@utils/twUtils'\nimport { Fragment, isValidElement, type CSSProperties, type ElementType, type ReactElement, type ReactNode } from 'react'\n\nexport interface DrawerProps {\n className?: string\n children?: ReactNode\n defaultOpen?: boolean\n description?: ReactNode\n direction?: 'left' | 'right' | 'top' | 'bottom'\n dismissible?: boolean\n dragBehavior?: 'surface' | 'handle' | 'none'\n finalFocus?: Dialog.Popup.Props['finalFocus']\n initialFocus?: Dialog.Popup.Props['initialFocus']\n modal?: boolean\n nativeButton?: boolean\n onOpenChange?: (open: boolean) => void\n open?: boolean\n size?: string\n title?: ReactNode\n trigger: ReactNode\n}\n\nconst hasRenderableText = (value: ReactNode) => (typeof value === 'string' ? value.trim().length > 0 : typeof value === 'number')\n\nconst hasRenderableContent = (value: ReactNode) => {\n if (hasRenderableText(value)) {\n return true\n }\n\n if (value === null || value === undefined || typeof value === 'boolean' || typeof value === 'string') {\n return false\n }\n\n return true\n}\n\nconst isElementAndNotFragment = (element: ReactNode) => isValidElement(element) && element.type !== Fragment\n\n// Dismissal reasons that should be blocked when `dismissible` is false. The\n// close button (`close-press`), trigger, and imperative actions stay allowed.\nconst BLOCKED_DISMISS_REASONS = new Set(['outside-press', 'escape-key', 'focus-out', 'swipe', 'close-watcher'])\n\nconst swipeDirectionByDirection = {\n left: 'left',\n right: 'right',\n top: 'up',\n bottom: 'down',\n} as const\n\nexport const Drawer = ({\n children,\n className,\n defaultOpen =\n false,\n description,\n direction = 'right',\n dismissible = true,\n dragBehavior = 'surface',\n finalFocus,\n initialFocus,\n modal = true,\n nativeButton = true,\n onOpenChange,\n open,\n size = '380px',\n title, trigger\n}: DrawerProps) => {\n const baseStyles = 'font-sans! fixed transition-transform duration-300 ease-out motion-reduce:transition-none'\n const hasTitle = hasRenderableContent(title)\n const hasDescription = hasRenderableContent(description)\n const isTextTitle = hasRenderableText(title)\n const isTextDescription = hasRenderableText(description)\n const isCustomTitleElement = isElementAndNotFragment(title)\n const isCustomDescriptionElement = isElementAndNotFragment(description)\n // Only the handle variant keeps a drag-to-close gesture; everything else is a\n // positioned Dialog so content interaction and text selection never dismiss it.\n const usesGesture = dragBehavior === 'handle'\n const shouldRenderHandle = dragBehavior === 'handle'\n\n const directionStyles = {\n left: {\n className: cn(baseStyles, 'top-0 bottom-0 left-0 shadow-[20px_0_20px_var(--color-black-40)] data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full'),\n style: { width: size },\n },\n right: {\n className: cn(baseStyles, 'top-0 bottom-0 right-0 shadow-[-20px_0_20px_var(--color-black-40)] data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full'),\n style: { width: size },\n },\n top: {\n className: cn(baseStyles, 'top-0 left-0 right-0 shadow-[0_20px_20px_var(--color-black-40)] data-[ending-style]:-translate-y-full data-[starting-style]:-translate-y-full'),\n style: { height: size },\n },\n bottom: {\n className: cn(baseStyles, 'bottom-0 left-0 right-0 shadow-[0_-20px_20px_var(--color-black-40)] data-[ending-style]:translate-y-full data-[starting-style]:translate-y-full'),\n style: { height: size },\n },\n }\n\n const { className: directionClassName, style } = directionStyles[direction]\n // During a handle swipe, follow the pointer live (Base UI exposes the offset\n // via CSS variables) and disable the open/close transition.\n const swipeClassName = usesGesture ? 'data-[swiping]:transition-none data-[swiping]:[transform:translate(var(--drawer-swipe-movement-x,0px),var(--drawer-swipe-movement-y,0px))]' : ''\n\n const handleOpenChange = (nextOpen: boolean, eventDetails: { reason?: string; cancel: () => void }) => {\n if (!dismissible && !nextOpen && eventDetails.reason && BLOCKED_DISMISS_REASONS.has(eventDetails.reason)) {\n eventDetails.cancel()\n return\n }\n\n onOpenChange?.(nextOpen)\n }\n\n const Primitive = usesGesture ? DrawerGesture : Dialog\n const Root = Primitive.Root as ElementType\n const Trigger = Primitive.Trigger as ElementType\n const Portal = Primitive.Portal as ElementType\n const Backdrop = Primitive.Backdrop as ElementType\n const Popup = Primitive.Popup as ElementType\n const Title = Primitive.Title as ElementType\n const Description = Primitive.Description as ElementType\n const Close = Primitive.Close as ElementType\n const Viewport = DrawerGesture.Viewport as ElementType\n\n const rootProps = {\n defaultOpen,\n disablePointerDismissal: !dismissible,\n modal,\n onOpenChange: handleOpenChange,\n open,\n ...(usesGesture ? { swipeDirection: swipeDirectionByDirection[direction] } : {}),\n }\n\n const popup = (\n <Popup\n aria-label={!hasTitle && !hasDescription ? 'Drawer' : undefined}\n className={cn('z-50 flex flex-col overscroll-contain bg-drawer-bg **:box-border focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent', directionClassName, swipeClassName, className)}\n data-testid='spectral-drawer-content'\n finalFocus={finalFocus}\n initialFocus={initialFocus}\n render={<div className='min-h-0 flex h-full flex-col' />}\n style={style as CSSProperties}\n >\n <Close />\n {shouldRenderHandle && (\n <div\n className='mt-2 mb-1 h-1.5 w-12 mx-auto shrink-0 cursor-grab touch-none rounded-full bg-text-secondary/40 active:cursor-grabbing'\n data-testid='spectral-drawer-handle'\n />\n )}\n {/* Opt content out of swipe dismissal so interaction and text selection\n never close the drawer; only the handle (above) initiates a drag. */}\n <div\n className='min-h-0 flex flex-1 flex-col'\n data-base-ui-swipe-ignore=''\n >\n {hasTitle && (\n <>\n {isTextTitle && (\n <Title\n className='px-3 pt-4 text-xl font-semibold text-text-primary'\n data-testid='spectral-drawer-title'\n >\n {title}\n </Title>\n )}\n {!isTextTitle && isCustomTitleElement && (\n <Title\n data-testid='spectral-drawer-title'\n render={title as ReactElement}\n />\n )}\n {!isTextTitle && !isCustomTitleElement && <Title data-testid='spectral-drawer-title'>{title}</Title>}\n </>\n )}\n {hasDescription && (\n <>\n {isTextDescription && (\n <Description\n className='mb-2 px-3 text-xs! text-text-secondary! uppercase'\n data-testid='spectral-drawer-description'\n >\n {description}\n </Description>\n )}\n {!isTextDescription && isCustomDescriptionElement && (\n <Description\n data-testid='spectral-drawer-description'\n render={description as ReactElement}\n />\n )}\n {!isTextDescription && !isCustomDescriptionElement && <Description data-testid='spectral-drawer-description'>{description}</Description>}\n </>\n )}\n <div\n className='py-2 px-3 min-w-0 [&>*]:min-w-0 [&_*]:min-w-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain *:box-border'\n data-testid='spectral-drawer-body'\n >\n {children}\n </div>\n </div>\n </Popup>\n )\n\n return (\n <SpectralProvider>\n <Root {...rootProps}>\n <Trigger\n data-testid='spectral-drawer-trigger'\n nativeButton={nativeButton}\n render={trigger as ReactElement}\n />\n <Portal>\n <Backdrop\n className='inset-0 fixed bg-transparent'\n data-testid='spectral-drawer-overlay'\n />\n {usesGesture ? <Viewport className='inset-0 fixed z-50'>{popup}</Viewport> : popup}\n </Portal>\n </Root>\n </SpectralProvider>\n )\n}\n"],"mappings":";;;;;;;;;AAyBA,MAAM,qBAAqB,UAAsB,OAAO,UAAU,WAAW,MAAM,MAAM,CAAC,SAAS,IAAI,OAAO,UAAU;AAExH,MAAM,wBAAwB,UAAqB;AACjD,KAAI,kBAAkB,MAAM,CAC1B,QAAO;AAGT,KAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,aAAa,OAAO,UAAU,SAC1F,QAAO;AAGT,QAAO;;AAGT,MAAM,2BAA2B,YAAuB,eAAe,QAAQ,IAAI,QAAQ,SAAS;AAIpG,MAAM,0BAA0B,IAAI,IAAI;CAAC;CAAiB;CAAc;C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{"version":3,"file":"Drawer.js","names":[],"sources":["../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { Dialog } from '@base-ui/react/dialog'\nimport { Drawer as DrawerGesture } from '@base-ui/react/drawer'\nimport { SpectralProvider } from '@components/SpectralProvider/SpectralProvider'\nimport { cn } from '@utils/twUtils'\nimport { Fragment, isValidElement, type CSSProperties, type ElementType, type ReactElement, type ReactNode } from 'react'\n\nexport interface DrawerProps {\n className?: string\n children?: ReactNode\n defaultOpen?: boolean\n description?: ReactNode\n direction?: 'left' | 'right' | 'top' | 'bottom'\n dismissible?: boolean\n dragBehavior?: 'surface' | 'handle' | 'none'\n finalFocus?: Dialog.Popup.Props['finalFocus']\n initialFocus?: Dialog.Popup.Props['initialFocus']\n modal?: boolean\n nativeButton?: boolean\n onOpenChange?: (open: boolean) => void\n open?: boolean\n size?: string\n title?: ReactNode\n trigger: ReactNode\n}\n\nconst hasRenderableText = (value: ReactNode) => (typeof value === 'string' ? value.trim().length > 0 : typeof value === 'number')\n\nconst hasRenderableContent = (value: ReactNode) => {\n if (hasRenderableText(value)) {\n return true\n }\n\n if (value === null || value === undefined || typeof value === 'boolean' || typeof value === 'string') {\n return false\n }\n\n return true\n}\n\nconst isElementAndNotFragment = (element: ReactNode) => isValidElement(element) && element.type !== Fragment\n\n// Dismissal reasons that should be blocked when `dismissible` is false. The\n// close button (`close-press`), trigger, and imperative actions stay allowed.\nconst BLOCKED_DISMISS_REASONS = new Set(['outside-press', 'escape-key', 'focus-out', 'swipe', 'close-watcher'])\n\nconst swipeDirectionByDirection = {\n left: 'left',\n right: 'right',\n top: 'up',\n bottom: 'down',\n} as const\n\nexport const Drawer = ({\n children,\n className,\n defaultOpen = false,\n description,\n direction = 'right',\n dismissible = true,\n dragBehavior = 'surface',\n finalFocus,\n initialFocus,\n modal = true,\n nativeButton = true,\n onOpenChange,\n open,\n size = '380px',\n title, trigger\n}: DrawerProps) => {\n const baseStyles = 'font-sans! fixed transition-transform duration-300 ease-out motion-reduce:transition-none'\n const hasTitle = hasRenderableContent(title)\n const hasDescription = hasRenderableContent(description)\n const isTextTitle = hasRenderableText(title)\n const isTextDescription = hasRenderableText(description)\n const isCustomTitleElement = isElementAndNotFragment(title)\n const isCustomDescriptionElement = isElementAndNotFragment(description)\n // Only the handle variant keeps a drag-to-close gesture; everything else is a\n // positioned Dialog so content interaction and text selection never dismiss it.\n const usesGesture = dragBehavior === 'handle'\n const shouldRenderHandle = dragBehavior === 'handle'\n\n const directionStyles = {\n left: {\n className: cn(baseStyles, 'top-0 bottom-0 left-0 shadow-[20px_0_20px_var(--color-black-40)] data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full'),\n style: { width: size },\n },\n right: {\n className: cn(baseStyles, 'top-0 bottom-0 right-0 shadow-[-20px_0_20px_var(--color-black-40)] data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full'),\n style: { width: size },\n },\n top: {\n className: cn(baseStyles, 'top-0 left-0 right-0 shadow-[0_20px_20px_var(--color-black-40)] data-[ending-style]:-translate-y-full data-[starting-style]:-translate-y-full'),\n style: { height: size },\n },\n bottom: {\n className: cn(baseStyles, 'bottom-0 left-0 right-0 shadow-[0_-20px_20px_var(--color-black-40)] data-[ending-style]:translate-y-full data-[starting-style]:translate-y-full'),\n style: { height: size },\n },\n }\n\n const { className: directionClassName, style } = directionStyles[direction]\n // During a handle swipe, follow the pointer live (Base UI exposes the offset\n // via CSS variables) and disable the open/close transition.\n const swipeClassName = usesGesture ? 'data-[swiping]:transition-none data-[swiping]:[transform:translate(var(--drawer-swipe-movement-x,0px),var(--drawer-swipe-movement-y,0px))]' : ''\n\n const handleOpenChange = (nextOpen: boolean, eventDetails: { reason?: string; cancel: () => void }) => {\n if (!dismissible && !nextOpen && eventDetails.reason && BLOCKED_DISMISS_REASONS.has(eventDetails.reason)) {\n eventDetails.cancel()\n return\n }\n\n onOpenChange?.(nextOpen)\n }\n\n const Primitive = usesGesture ? DrawerGesture : Dialog\n const Root = Primitive.Root as ElementType\n const Trigger = Primitive.Trigger as ElementType\n const Portal = Primitive.Portal as ElementType\n const Backdrop = Primitive.Backdrop as ElementType\n const Popup = Primitive.Popup as ElementType\n const Title = Primitive.Title as ElementType\n const Description = Primitive.Description as ElementType\n const Close = Primitive.Close as ElementType\n const Viewport = DrawerGesture.Viewport as ElementType\n\n const rootProps = {\n defaultOpen,\n disablePointerDismissal: !dismissible,\n modal,\n onOpenChange: handleOpenChange,\n open,\n ...(usesGesture ? { swipeDirection: swipeDirectionByDirection[direction] } : {}),\n }\n\n const popup = (\n <Popup\n aria-label={!hasTitle && !hasDescription ? 'Drawer' : undefined}\n className={cn('z-50 flex flex-col overscroll-contain bg-drawer-bg **:box-border focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent', directionClassName, swipeClassName, className)}\n data-testid='spectral-drawer-content'\n finalFocus={finalFocus}\n initialFocus={initialFocus}\n render={<div className='min-h-0 flex h-full flex-col' />}\n style={style as CSSProperties}\n >\n <Close />\n {shouldRenderHandle && (\n <div\n className='mt-2 mb-1 h-1.5 w-12 mx-auto shrink-0 cursor-grab touch-none rounded-full bg-text-secondary/40 active:cursor-grabbing'\n data-testid='spectral-drawer-handle'\n />\n )}\n {/* Opt content out of swipe dismissal so interaction and text selection\n never close the drawer; only the handle (above) initiates a drag. */}\n <div\n className='min-h-0 flex flex-1 flex-col'\n data-base-ui-swipe-ignore=''\n >\n {hasTitle && (\n <>\n {isTextTitle && (\n <Title\n className='px-3 pt-4 text-xl font-semibold text-text-primary'\n data-testid='spectral-drawer-title'\n >\n {title}\n </Title>\n )}\n {!isTextTitle && isCustomTitleElement && (\n <Title\n data-testid='spectral-drawer-title'\n render={title as ReactElement}\n />\n )}\n {!isTextTitle && !isCustomTitleElement && <Title data-testid='spectral-drawer-title'>{title}</Title>}\n </>\n )}\n {hasDescription && (\n <>\n {isTextDescription && (\n <Description\n className='mb-2 px-3 text-xs! text-text-secondary! uppercase'\n data-testid='spectral-drawer-description'\n >\n {description}\n </Description>\n )}\n {!isTextDescription && isCustomDescriptionElement && (\n <Description\n data-testid='spectral-drawer-description'\n render={description as ReactElement}\n />\n )}\n {!isTextDescription && !isCustomDescriptionElement && <Description data-testid='spectral-drawer-description'>{description}</Description>}\n </>\n )}\n <div\n className='py-2 px-3 min-w-0 [&>*]:min-w-0 [&_*]:min-w-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain *:box-border'\n data-testid='spectral-drawer-body'\n >\n {children}\n </div>\n </div>\n </Popup>\n )\n\n return (\n <SpectralProvider>\n <Root {...rootProps}>\n <Trigger\n data-testid='spectral-drawer-trigger'\n nativeButton={nativeButton}\n render={trigger as ReactElement}\n />\n <Portal>\n <Backdrop\n className='inset-0 fixed bg-transparent'\n data-testid='spectral-drawer-overlay'\n />\n {usesGesture ? <Viewport className='inset-0 fixed z-50'>{popup}</Viewport> : popup}\n </Portal>\n </Root>\n </SpectralProvider>\n )\n}\n"],"mappings":";;;;;;;;;AAyBA,MAAM,qBAAqB,UAAsB,OAAO,UAAU,WAAW,MAAM,MAAM,CAAC,SAAS,IAAI,OAAO,UAAU;AAExH,MAAM,wBAAwB,UAAqB;AACjD,KAAI,kBAAkB,MAAM,CAC1B,QAAO;AAGT,KAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,aAAa,OAAO,UAAU,SAC1F,QAAO;AAGT,QAAO;;AAGT,MAAM,2BAA2B,YAAuB,eAAe,QAAQ,IAAI,QAAQ,SAAS;AAIpG,MAAM,0BAA0B,IAAI,IAAI;CAAC;CAAiB;CAAc;CAAa;CAAS;CAAgB,CAAA;AAE9G,MAAM,4BAA4B;CAChC,MAAM;CACN,OAAO;CACP,KAAK;CACL,QAAQ;CACT;AAED,MAAa,UAAU,EACrB,UACA,WACA,cAAc,OACd,aACA,YAAY,SACZ,cAAc,MACd,eAAe,WACf,YACA,cACA,QAAQ,MACR,eAAe,MACf,cACA,MACA,OAAO,SACP,OAAO,cACU;CACjB,MAAM,aAAa;CACnB,M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CAEA,MAAM,QACJ,qBAAC,OAAD;EACE,cAAY,CAAC,YAAY,CAAC,iBAAiB,WAAW;EACtD,WAAW,GAAG,2KAA2K,oBAAoB,gBAAgB,UAAU;EAE3N;EACE;EACd,QAAQ,oBAAC,OAAD,EAAK,WAAU,gCAAiC;EACjD;YAPT;GASE,oBAAC,OAAD,EAAQ;GACP,sBACC,oBAAC,OAAD,EACE,WAAU,yHAEX;GAIH,qBAAC,OAAD;IACE,WAAU;IACV,6BAA0B;cAF5B;KAIG,YACC;MACG,eACC,oBAAC,OAAD;OACE,WAAU;iBAGT;OACI;MAER,CAAC,eAAe,wBACf,oBAAC,OAAD,EAEE,QAAQ,OACT;MAEF,CAAC,eAAe,CAAC,wBAAwB,oBAAC,OAAD,YAA4C,OAAc;MACpG;KAEH,kBACC;MACG,qBACC,oBAAC,aAAD;OACE,WAAU;iBAGT;OACU;MAEd,CAAC,qBAAqB,8BACrB,oBAAC,aAAD,EAEE,QAAQ,aACT;MAEF,CAAC,qBAAqB,CAAC,8BAA8B,oBAAC,aAAD,YAAwD,aAA0B;MACxI;KAEJ,oBAAC,OAAD;MACE,WAAU;MAGT;MACE;KACF;;GACA;;AAGT,QACE,oBAAC,kBAAD,YACE,qBAAC,MAAD;EAAM,GAAI;YAAV,CACE,oBAAC,SAAD;GAEgB;GACd,QAAQ;GACT,GACD,qBAAC,QAAD,aACE,oBAAC,UAAD,EACE,WAAU,gCAEX,GACA,cAAc,oBAAC,UAAD;GAAU,WAAU;aAAsB;GAAiB,IAAG,MACvE,IACJ;KACU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spear-ai/spectral",
3
- "version": "1.21.3",
3
+ "version": "1.22.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "engines": {