@spark-ui/components 17.0.0 → 17.0.1
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/tabs/Tabs.d.ts +3 -3
- package/dist/tabs/TabsContent.d.ts +4 -4
- package/dist/tabs/TabsContext.d.ts +2 -2
- package/dist/tabs/TabsList.d.ts +3 -3
- package/dist/tabs/TabsTrigger.d.ts +3 -3
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +183 -174
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tabs/useRenderSlot.d.ts +1 -0
- package/package.json +4 -4
package/dist/tabs/Tabs.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Tabs as
|
|
2
|
-
import { PropsWithChildren, Ref } from 'react';
|
|
1
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
2
|
+
import { ComponentProps, PropsWithChildren, Ref } from 'react';
|
|
3
3
|
import { TabsTriggerVariantsProps } from './TabsTrigger.styles';
|
|
4
|
-
export interface TabsProps extends Omit<
|
|
4
|
+
export interface TabsProps extends Omit<ComponentProps<typeof BaseTabs.Root>, 'render'>, PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {
|
|
5
5
|
/**
|
|
6
6
|
* Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.
|
|
7
7
|
* @default false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Tabs as
|
|
2
|
-
import { PropsWithChildren, Ref } from 'react';
|
|
3
|
-
export interface TabsContentProps extends PropsWithChildren<Omit<
|
|
1
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
2
|
+
import { ComponentProps, PropsWithChildren, Ref } from 'react';
|
|
3
|
+
export interface TabsContentProps extends PropsWithChildren<Omit<ComponentProps<typeof BaseTabs.Panel>, 'keepMounted' | 'render'>> {
|
|
4
4
|
/**
|
|
5
5
|
* A unique value that associates the content with a trigger.
|
|
6
6
|
*/
|
|
@@ -17,6 +17,6 @@ export interface TabsContentProps extends PropsWithChildren<Omit<RadixTabs.TabsC
|
|
|
17
17
|
ref?: Ref<HTMLDivElement>;
|
|
18
18
|
}
|
|
19
19
|
export declare const TabsContent: {
|
|
20
|
-
({ children, asChild, className, ref, ...rest }: TabsContentProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
({ children, asChild, className, ref, forceMount, ...rest }: TabsContentProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Tabs as RadixTabs } from 'radix-ui';
|
|
2
1
|
import { TabsTriggerVariantsProps } from './TabsTrigger.styles';
|
|
3
|
-
export type TabsContextInterface = TabsTriggerVariantsProps &
|
|
2
|
+
export type TabsContextInterface = TabsTriggerVariantsProps & {
|
|
3
|
+
orientation?: 'horizontal' | 'vertical';
|
|
4
4
|
forceMount?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare const TabsContext: import('react').Context<TabsContextInterface>;
|
package/dist/tabs/TabsList.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Tabs as
|
|
2
|
-
import { ReactElement, Ref } from 'react';
|
|
3
|
-
export interface TabsListProps extends Omit<
|
|
1
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
2
|
+
import { ComponentProps, ReactElement, Ref } from 'react';
|
|
3
|
+
export interface TabsListProps extends Omit<ComponentProps<typeof BaseTabs.List>, 'render' | 'loopFocus'> {
|
|
4
4
|
/**
|
|
5
5
|
* Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.
|
|
6
6
|
* @default false
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Tabs as
|
|
2
|
-
import { ReactNode, Ref } from 'react';
|
|
1
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
2
|
+
import { ComponentProps, ReactNode, Ref } from 'react';
|
|
3
3
|
import { ConfiguredPopoverComponent } from './TabsPopoverAbstraction';
|
|
4
|
-
export interface TabsTriggerProps extends
|
|
4
|
+
export interface TabsTriggerProps extends Omit<ComponentProps<typeof BaseTabs.Tab>, 'render'> {
|
|
5
5
|
/**
|
|
6
6
|
* A unique value that associates the trigger with a content.
|
|
7
7
|
*/
|
package/dist/tabs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),w=require("@base-ui/react/tabs"),s=require("react"),m=require("class-variance-authority"),K=require("../Slot-DQ8z2zsy.js"),H=require("@spark-ui/icons/ArrowVerticalLeft"),U=require("@spark-ui/icons/ArrowVerticalRight"),M=require("../Button-FZceRWG2.js"),R=require("../Icon-C-cNTnzd.js"),V=require("@spark-ui/hooks/use-merge-refs"),$=require("@spark-ui/icons/MoreMenuHorizontal"),G=require("../IconButton-BR1bJSQA.js"),T=require("../popover/index.js"),J=require("@spark-ui/internal-utils"),E=s.createContext({}),N=()=>{const t=s.useContext(E);if(!t)throw Error("useTabsContext must be used within a TabsContext Provider");return t},Q=m.cva(["flex","data-[orientation=horizontal]:flex-col","data-[orientation=vertical]:flex-row","max-w-full"]);function z(t){return t?({...r})=>o.jsx(K.Slot,{...r}):void 0}const I=({intent:t="support",size:r="md",asChild:l=!1,forceMount:c=!1,orientation:n="horizontal",children:i,className:a,ref:d,...e})=>{const h=z(l);return o.jsx(E.Provider,{value:{intent:t,size:r,orientation:n,forceMount:c},children:o.jsx(w.Tabs.Root,{ref:d,orientation:n,className:Q({className:a}),"data-spark-component":"tabs",render:h,...e,children:i})})};I.displayName="Tabs";const X=m.cva(["w-full p-lg","focus-visible:u-outline-inset"],{variants:{forceMount:{true:"data-[hidden]:hidden",false:""}}}),S=({children:t,asChild:r=!1,className:l,ref:c,forceMount:n,...i})=>{const{forceMount:a}=N(),d=z(r),e=a||n;return o.jsx(w.Tabs.Panel,{"data-spark-component":"tabs-content",ref:c,keepMounted:e,className:X({className:l,forceMount:e}),render:d,...i,children:t})};S.displayName="Tabs.Content";const Y=m.cva(["relative flex"]),Z=m.cva(["flex w-full","data-[orientation=horizontal]:flex-row","data-[orientation=vertical]:flex-col","overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden","after:flex after:shrink after:grow after:border-outline","data-[orientation=horizontal]:after:border-b-sm","data-[orientation=vertical]:after:border-r-sm"]),W=m.cva(["h-auto! flex-none","border-b-sm border-outline","outline-hidden","focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!"]),_=(t,r)=>{const[l,c]=s.useState({width:void 0,height:void 0}),n=s.useRef(null),i=s.useRef(r);return s.useEffect(()=>{i.current=r},[r]),s.useEffect(()=>{const a=t&&"current"in t?t.current:t;if(!(!a||n.current))return n.current=new ResizeObserver(([d])=>{const{inlineSize:e,blockSize:h}=d?.borderBoxSize?.[0]??{};i.current?.(d),c({width:e,height:h})}),n.current.observe(a),()=>{n.current&&n.current.unobserve(a)}},[t,n,i]),l},L=({asChild:t=!1,loop:r=!1,children:l,className:c,ref:n,...i})=>{const a=s.useRef(null),d=s.useRef(null),e=n||d,{orientation:h}=N(),y=z(t),{width:x}=_(a),[u,g]=s.useState({prev:"hidden",next:"hidden"});s.useEffect(()=>{typeof e=="function"||!e.current||g(h!=="horizontal"?{prev:"hidden",next:"hidden"}:{prev:e.current.scrollWidth>e.current.clientWidth?"visible":"hidden",next:e.current.scrollWidth>e.current.clientWidth?"visible":"hidden"})},[h,e,x]),s.useEffect(()=>{if(typeof e=="function"||!e.current||u.prev==="hidden"||r)return;const v=f=>{g({prev:f.scrollLeft>0?"visible":"disabled",next:f.scrollLeft+f.clientWidth<f.scrollWidth?"visible":"disabled"})},p=e.current;return v(p),p.addEventListener("scroll",({target:f})=>v(f)),()=>p.removeEventListener("scroll",({target:f})=>v(f))},[e,u.prev,r]);const j=()=>{if(typeof e=="function"||!e.current)return;const v=r&&e.current.scrollLeft<=0;e.current.scrollTo({left:v?e.current.scrollLeft+e.current.scrollWidth-e.current.clientWidth:e.current.scrollLeft-e.current.clientWidth,behavior:"smooth"})},C=()=>{if(typeof e=="function"||!e.current)return;const v=r&&e.current.scrollLeft+e.current.clientWidth>=e.current.scrollWidth;e.current.scrollTo({left:v?0:e.current.scrollLeft+e.current.clientWidth,behavior:"smooth"})};return o.jsxs("div",{className:Y({className:c}),ref:a,children:[u.prev!=="hidden"&&o.jsx(M.Button,{shape:"square",intent:"surface",size:"sm",className:W(),onClick:j,disabled:u.prev==="disabled","aria-label":"Scroll left",children:o.jsx(R.Icon,{children:o.jsx(H.ArrowVerticalLeft,{})})}),o.jsx(w.Tabs.List,{"data-spark-component":"tabs-list",ref:e,className:Z(),render:y,loopFocus:r,activateOnFocus:!0,...i,children:l}),u.next!=="hidden"&&o.jsx(M.Button,{shape:"square",intent:"surface",size:"sm",className:W(),onClick:C,disabled:u.next==="disabled","aria-label":"Scroll right",children:o.jsx(R.Icon,{children:o.jsx(U.ArrowVerticalRight,{})})})]})};L.displayName="Tabs.List";const P=s.createContext(void 0),A=()=>{const t=s.useContext(P);if(!t)throw new Error("TabsPopover components must be used within TabsPopover");return t},B=s.forwardRef(({"aria-label":t,children:r,...l},c)=>{const{popoverTriggerRef:n}=A(),i=V.useMergeRefs(c,n);return o.jsx(T.Popover.Trigger,{asChild:!0,...l,children:o.jsx(G.IconButton,{ref:i,size:"sm",intent:"surfaceInverse",design:"ghost","aria-label":t,tabIndex:-1,children:o.jsx(R.Icon,{children:r||o.jsx($.MoreMenuHorizontal,{})})})})});B.displayName="Popover.Trigger";const O=s.forwardRef(({side:t,align:r="start",className:l,...c},n)=>{const{popoverSide:i}=A(),a=m.cx("gap-sm flex flex-col",l);return o.jsx(T.Popover.Content,{ref:n,...c,side:t??i,align:r,className:a})});O.displayName="Popover.Content";const F=({popoverSide:t,popoverTriggerRef:r,children:l})=>{const c=s.useMemo(()=>({popoverSide:t,popoverTriggerRef:r}),[t,r]),i=Object.assign((a=>o.jsx(P.Provider,{value:c,children:o.jsx(T.Popover,{...a,children:a.children})})),T.Popover,{Content:O,Trigger:B});return o.jsx(P.Provider,{value:c,children:l(i)})};F.displayName="Popover";const ee=m.cva(["px-md","relative flex flex-none items-center","border-outline","hover:not-disabled:bg-surface-hovered","after:absolute","data-[active]:font-bold","not-data-[active]:not-disabled:cursor-pointer","data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2","data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2","focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset","disabled:cursor-not-allowed disabled:opacity-dim-3","gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md","[&>svg:last-child:first-child]:mx-auto"],{variants:{intent:J.makeVariants({main:["data-[active]:text-main data-[active]:after:bg-main"],support:["data-[active]:text-support data-[active]:after:bg-support"]}),size:{xs:["h-sz-32 min-w-sz-32 text-caption"],sm:["h-sz-36 min-w-sz-36 text-body-2"],md:["h-sz-40 min-w-sz-40 text-body-1"]},hasMenu:{true:"pr-3xl"},orientation:{horizontal:"",vertical:""}},compoundVariants:[{hasMenu:!0,orientation:"vertical",class:"w-full"}],defaultVariants:{intent:"support",size:"md",hasMenu:!1,orientation:"horizontal"}}),k=({asChild:t=!1,value:r,disabled:l=!1,children:c,className:n,ref:i,onKeyDown:a,renderMenu:d,...e})=>{const{intent:h,size:y,orientation:x}=N(),u=s.useRef(null),g=s.useRef(null),j=z(t),C=V.useMergeRefs(i,g),v=b=>{b.key==="F10"&&b.shiftKey&&d&&u.current&&(b.preventDefault(),u.current.click()),a?.(b)},p=!!d,f=x==="vertical"?"right":"bottom",q=o.jsx(w.Tabs.Tab,{"data-spark-component":"tabs-trigger",ref:C,className:ee({intent:h,size:y,hasMenu:p,orientation:x??"horizontal",className:n}),render:j,disabled:l,value:r,onFocus:({target:b})=>b.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),onKeyDown:v,"aria-haspopup":p?"true":void 0,...e,children:c});return p?o.jsxs("div",{className:x==="vertical"?"relative w-full":"relative",children:[q,o.jsx("div",{className:"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2",children:o.jsx(F,{popoverSide:f,popoverTriggerRef:u,children:b=>d?.({Popover:b})})})]}):q};k.displayName="Tabs.Trigger";const D=Object.assign(I,{List:L,Trigger:k,Content:S});D.displayName="Tabs";L.displayName="Tabs.List";k.displayName="Tabs.Trigger";S.displayName="Tabs.Content";exports.Tabs=D;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/tabs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { Tabs as RadixTabs } from 'radix-ui'\nimport { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps &\n Pick<RadixTabs.TabsProps, 'orientation'> & {\n forceMount?: boolean\n }\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Tabs as RadixTabs } from 'radix-ui'\nimport { type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport interface TabsProps\n extends Omit<RadixTabs.TabsProps, 'activationMode'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#root\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <RadixTabs.Root\n ref={ref}\n asChild={asChild}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n activationMode=\"automatic\"\n {...rest}\n >\n {children}\n </RadixTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[state=inactive]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as RadixTabs } from 'radix-ui'\nimport { type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\n\nexport interface TabsContentProps\n extends PropsWithChildren<Omit<RadixTabs.TabsContentProps, 'forceMount'>> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\nexport const TabsContent = ({\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#content\n */\n children,\n asChild = false,\n className,\n ref,\n ...rest\n}: TabsContentProps) => {\n const { forceMount } = useTabsContext()\n\n return (\n <RadixTabs.Content\n data-spark-component=\"tabs-content\"\n ref={ref}\n forceMount={forceMount || rest.forceMount}\n className={contentStyles({ className, forceMount })}\n asChild={asChild}\n {...rest}\n >\n {children}\n </RadixTabs.Content>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { Tabs as RadixTabs } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps extends Omit<RadixTabs.TabsListProps, 'children'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\nexport const TabsList = ({\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#list\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <RadixTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n asChild={asChild}\n loop={loop}\n {...rest}\n >\n {children}\n </RadixTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[state=active]:font-bold',\n 'data-[state=inactive]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[state=active]:text-main data-[state=active]:after:bg-main'],\n support: ['data-[state=active]:text-support data-[state=active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { Tabs as RadixTabs } from 'radix-ui'\nimport { type FocusEvent, type KeyboardEvent, type ReactNode, Ref, useRef } from 'react'\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\n\nexport interface TabsTriggerProps extends RadixTabs.TabsTriggerProps {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TabsTrigger = ({\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#trigger\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <RadixTabs.Trigger\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n asChild={asChild}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </RadixTabs.Trigger>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"names":["TabsContext","createContext","useTabsContext","context","useContext","rootStyles","cva","Tabs","intent","size","asChild","forceMount","orientation","children","className","ref","rest","jsx","RadixTabs","contentStyles","TabsContent","wrapperStyles","listStyles","navigationArrowStyles","useResizeObserver","target","onResize","setSize","useState","resizeObserverRef","useRef","resizeCallbackRef","useEffect","targetElm","entry","width","height","TabsList","loop","wrapperRef","innerRef","listRef","arrows","setArrows","toggleArrowsVisibility","currentList","handlePrevClick","shouldLoopForward","handleNextClick","shouldLoopBackward","jsxs","Button","Icon","ArrowVerticalLeft","ArrowVerticalRight","TabsPopoverContext","useTabsPopoverContext","TabsPopoverTrigger","forwardRef","ariaLabel","iconChildren","triggerProps","forwardedRef","popoverTriggerRef","mergedRef","useMergeRefs","SparkPopover","IconButton","MoreMenuHorizontal","TabsPopoverContent","side","align","contentProps","popoverSide","mergedClassName","cx","Popover","contextValue","useMemo","PopoverComponent","props","triggerVariants","makeVariants","TabsTrigger","value","disabled","onKeyDown","renderMenu","tabsTriggerRef","handleKeyDown","e","hasMenu","trigger","PopoverAbstraction","Root","List","Trigger","Content"],"mappings":"ijBAUaA,EAAcC,EAAAA,cAAoC,EAA0B,EAE5EC,EAAiB,IAAM,CAClC,MAAMC,EAAUC,EAAAA,WAAWJ,CAAW,EAEtC,GAAI,C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EAEMC,EAAU,CAAC,CAACJ,EACZd,EAAc7D,IAAgB,WAAa,QAAU,SAErDgF,EACJ3E,EAAAA,IAACC,EAAAA,KAAU,QAAV,CACC,uBAAqB,eACrB,IAAK8C,EACL,UAAWiB,EAAgB,CACzB,OAAAzE,EACA,KAAAC,EACA,QAAAkF,EACA,YAAa/E,GAAe,aAC5B,UAAAE,CAAA,CACD,EACD,QAAAJ,EACA,SAAA2E,EACA,MAAAD,EACA,QAAS,CAAC,CAAE,OAAA3D,KACVA,EAAO,eAAe,CACpB,SAAU,SACV,MAAO,UACP,OAAQ,SAAA,CACT,EAEH,UAAWgE,EACX,gBAAeE,EAAU,OAAS,OACjC,GAAG3E,EAEH,SAAAH,CAAA,CAAA,EAIL,OAAK8E,SAKF,MAAA,CAAI,UAAW/E,IAAgB,WAAa,kBAAoB,WAC9D,SAAA,CAAAgF,EACD3E,EAAAA,IAAC,MAAA,CAAI,UAAU,uEACb,eAAC2D,EAAA,CAAQ,YAAAH,EAA0B,kBAAAV,EAChC,SAAA8B,GAAsBN,IAAa,CAAE,QAASM,CAAA,CAAoB,EACrE,CAAA,CACF,CAAA,EACF,EAXOD,CAaX,EAEAT,EAAY,YAAc,eCrHnB,MAAM5E,EAIT,OAAO,OAAOuF,EAAM,CAAA,KACtBC,EAAA,QACAC,EAAA,QACAC,CACF,CAAC,EAED1F,EAAK,YAAc,OACnBwF,EAAK,YAAc,YACnBC,EAAQ,YAAc,eACtBC,EAAQ,YAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/useRenderSlot.tsx","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps & {\n orientation?: 'horizontal' | 'vertical'\n forceMount?: boolean\n}\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean) {\n return asChild ? ({ ...props }: object) => <Slot {...props} /> : undefined\n}\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsProps\n extends Omit<ComponentProps<typeof BaseTabs.Root>, 'render'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <BaseTabs.Root\n ref={ref}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[hidden]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsContentProps\n extends PropsWithChildren<Omit<ComponentProps<typeof BaseTabs.Panel>, 'keepMounted' | 'render'>> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\nexport const TabsContent = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n children,\n asChild = false,\n className,\n ref,\n forceMount,\n ...rest\n}: TabsContentProps) => {\n const { forceMount: contextForceMount } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n const keepMounted = contextForceMount || forceMount\n\n return (\n <BaseTabs.Panel\n data-spark-component=\"tabs-content\"\n ref={ref}\n keepMounted={keepMounted}\n className={contentStyles({ className, forceMount: keepMounted })}\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Panel>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { type ComponentProps, type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useRenderSlot } from './useRenderSlot'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps\n extends Omit<ComponentProps<typeof BaseTabs.List>, 'render' | 'loopFocus'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\nexport const TabsList = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <BaseTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n render={renderSlot}\n loopFocus={loop}\n activateOnFocus\n {...rest}\n >\n {children}\n </BaseTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[active]:font-bold',\n 'not-data-[active]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[active]:text-main data-[active]:after:bg-main'],\n support: ['data-[active]:text-support data-[active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { type ComponentProps, type FocusEvent, type ReactNode, Ref, useRef } from 'react'\n\ntype TabKeyDownEvent = Parameters<NonNullable<ComponentProps<typeof BaseTabs.Tab>['onKeyDown']>>[0]\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsTriggerProps extends Omit<ComponentProps<typeof BaseTabs.Tab>, 'render'> {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TabsTrigger = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n const renderSlot = useRenderSlot(asChild)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: TabKeyDownEvent) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <BaseTabs.Tab\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n render={renderSlot}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </BaseTabs.Tab>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"names":["TabsContext","createContext","useTabsContext","context","useContext","rootStyles","cva","useRenderSlot","asChild","props","jsx","Slot","Tabs","intent","size","forceMount","orientation","children","className","ref","rest","renderSlot","BaseTabs","contentStyles","TabsContent","contextForceMount","keepMounted","wrapperStyles","listStyles","navigationArrowStyles","useResizeObserver","target","onResize","setSize","useState","resizeObserverRef","useRef","resizeCallbackRef","useEffect","targetElm","entry","width","height","TabsList","loop","wrapperRef","innerRef","listRef","arrows","setArrows","toggleArrowsVisibility","currentList","handlePrevClick","shouldLoopForward","handleNextClick","shouldLoopBackward","jsxs","Button","Icon","ArrowVerticalLeft","ArrowVerticalRight","TabsPopoverContext","useTabsPopoverContext","TabsPopoverTrigger","forwardRef","ariaLabel","iconChildren","triggerProps","forwardedRef","popoverTriggerRef","mergedRef","useMergeRefs","SparkPopover","IconButton","MoreMenuHorizontal","TabsPopoverContent","side","align","contentProps","popoverSide","mergedClassName","cx","Popover","contextValue","useMemo","PopoverComponent","triggerVariants","makeVariants","TabsTrigger","value","disabled","onKeyDown","renderMenu","tabsTriggerRef","handleKeyDown","e","hasMenu","trigger","PopoverAbstraction","Root","List","Trigger","Content"],"mappings":"6lBASaA,EAAcC,EAAAA,cAAoC,EAA0B,EAE5EC,EAAiB,IAAM,CAClC,MAAMC,EAAUC,EAAAA,WAAWJ,CAAW,EAEtC,GAAI,CAACG,EACH,MAAM,MAAM,2DAA2D,EAGzE,OAAOA,CACT,ECjBaE,EAAaC,EAAAA,IAAI,CAC5B,OACA,yCACA,uCACA,YACF,CAAC,ECLM,SAASC,EAAcC,EAAkB,CAC9C,OAAOA,EAAU,CAAC,CAAE,GAAGC,CAAA,IAAoBC,MAACC,EAAAA,KAAA,CAAM,GAAGF,CAAA,CAAO,EAAK,MACnE,CCyBO,MAAMG,EAAO,CAAC,CACnB,OAAAC,EAAS,UACT,KAAAC,EAAO,KAKP,QAAAN,EAAU,GACV,WAAAO,EAAa,GACb,YAAAC,EAAc,aACd,SAAAC,EACA,UAAAC,EACA,IAAAC,EACA,GAAGC,CACL,IAAiB,CACf,MAAMC,EAAad,EAAcC,CAAO,EAExC,OACEE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AAzE,EACA,KAAAC,EACA,QAAAkF,EACA,YAAahF,GAAe,aAC5B,UAAAE,CAAA,CACD,EACD,OAAQG,EACR,SAAAqE,EACA,MAAAD,EACA,QAAS,CAAC,CAAE,OAAA1D,KACVA,EAAO,eAAe,CACpB,SAAU,SACV,MAAO,UACP,OAAQ,SAAA,CACT,EAEH,UAAW+D,EACX,gBAAeE,EAAU,OAAS,OACjC,GAAG5E,EAEH,SAAAH,CAAA,CAAA,EAIL,OAAK+E,SAKF,MAAA,CAAI,UAAWhF,IAAgB,WAAa,kBAAoB,WAC9D,SAAA,CAAAiF,EACDvF,EAAAA,IAAC,MAAA,CAAI,UAAU,uEACb,eAACwE,EAAA,CAAQ,YAAAH,EAA0B,kBAAAV,EAChC,SAAA6B,GAAsBN,IAAa,CAAE,QAASM,CAAA,CAAoB,EACrE,CAAA,CACF,CAAA,EACF,EAXOD,CAaX,EAEAT,EAAY,YAAc,eCzHnB,MAAM5E,EAIT,OAAO,OAAOuF,EAAM,CAAA,KACtBC,EAAA,QACAC,EAAA,QACAC,CACF,CAAC,EAED1F,EAAK,YAAc,OACnBwF,EAAK,YAAc,YACnBC,EAAQ,YAAc,eACtBC,EAAQ,YAAc"}
|
package/dist/tabs/index.mjs
CHANGED
|
@@ -1,99 +1,107 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Tabs as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { cva as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as o, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as z } from "@base-ui/react/tabs";
|
|
3
|
+
import { createContext as O, useContext as A, useState as B, useRef as v, useEffect as w, forwardRef as j, useMemo as Q } from "react";
|
|
4
|
+
import { cva as b, cx as U } from "class-variance-authority";
|
|
5
|
+
import { S as X } from "../Slot-DLY1rJrG.mjs";
|
|
6
|
+
import { ArrowVerticalLeft as Y } from "@spark-ui/icons/ArrowVerticalLeft";
|
|
7
|
+
import { ArrowVerticalRight as Z } from "@spark-ui/icons/ArrowVerticalRight";
|
|
8
|
+
import { B as I } from "../Button-1M9DcZl0.mjs";
|
|
9
|
+
import { I as S } from "../Icon-BO327oHU.mjs";
|
|
10
|
+
import { useMergeRefs as D } from "@spark-ui/hooks/use-merge-refs";
|
|
11
|
+
import { MoreMenuHorizontal as _ } from "@spark-ui/icons/MoreMenuHorizontal";
|
|
12
|
+
import { I as ee } from "../IconButton-DdB3Pq13.mjs";
|
|
13
|
+
import { Popover as T } from "../popover/index.mjs";
|
|
14
|
+
import { makeVariants as te } from "@spark-ui/internal-utils";
|
|
15
|
+
const K = O({}), k = () => {
|
|
16
|
+
const t = A(K);
|
|
16
17
|
if (!t)
|
|
17
18
|
throw Error("useTabsContext must be used within a TabsContext Provider");
|
|
18
19
|
return t;
|
|
19
|
-
},
|
|
20
|
+
}, re = b([
|
|
20
21
|
"flex",
|
|
21
22
|
"data-[orientation=horizontal]:flex-col",
|
|
22
23
|
"data-[orientation=vertical]:flex-row",
|
|
23
24
|
"max-w-full"
|
|
24
|
-
])
|
|
25
|
+
]);
|
|
26
|
+
function y(t) {
|
|
27
|
+
return t ? ({ ...r }) => /* @__PURE__ */ o(X, { ...r }) : void 0;
|
|
28
|
+
}
|
|
29
|
+
const $ = ({
|
|
25
30
|
intent: t = "support",
|
|
26
31
|
size: r = "md",
|
|
27
32
|
/**
|
|
28
|
-
* Default
|
|
29
|
-
* see https://
|
|
33
|
+
* Default Base UI Primitive values
|
|
34
|
+
* see https://base-ui.com/react/components/tabs
|
|
30
35
|
*/
|
|
31
|
-
asChild:
|
|
36
|
+
asChild: l = !1,
|
|
32
37
|
forceMount: a = !1,
|
|
33
|
-
orientation:
|
|
38
|
+
orientation: n = "horizontal",
|
|
34
39
|
children: i,
|
|
35
|
-
className:
|
|
40
|
+
className: s,
|
|
36
41
|
ref: c,
|
|
37
42
|
...e
|
|
38
|
-
}) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
}) => {
|
|
44
|
+
const h = y(l);
|
|
45
|
+
return /* @__PURE__ */ o(
|
|
46
|
+
K.Provider,
|
|
47
|
+
{
|
|
48
|
+
value: {
|
|
49
|
+
intent: t,
|
|
50
|
+
size: r,
|
|
51
|
+
orientation: n,
|
|
52
|
+
forceMount: a
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ o(
|
|
55
|
+
z.Root,
|
|
56
|
+
{
|
|
57
|
+
ref: c,
|
|
58
|
+
orientation: n,
|
|
59
|
+
className: re({ className: s }),
|
|
60
|
+
"data-spark-component": "tabs",
|
|
61
|
+
render: h,
|
|
62
|
+
...e,
|
|
63
|
+
children: i
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
$.displayName = "Tabs";
|
|
70
|
+
const oe = b(["w-full p-lg", "focus-visible:u-outline-inset"], {
|
|
64
71
|
variants: {
|
|
65
72
|
forceMount: {
|
|
66
|
-
true: "data-[
|
|
73
|
+
true: "data-[hidden]:hidden",
|
|
67
74
|
false: ""
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
|
-
}),
|
|
77
|
+
}), R = ({
|
|
71
78
|
/**
|
|
72
|
-
* Default
|
|
73
|
-
* see https://
|
|
79
|
+
* Default Base UI Primitive values
|
|
80
|
+
* see https://base-ui.com/react/components/tabs
|
|
74
81
|
*/
|
|
75
82
|
children: t,
|
|
76
83
|
asChild: r = !1,
|
|
77
|
-
className:
|
|
84
|
+
className: l,
|
|
78
85
|
ref: a,
|
|
79
|
-
|
|
86
|
+
forceMount: n,
|
|
87
|
+
...i
|
|
80
88
|
}) => {
|
|
81
|
-
const { forceMount:
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
|
|
89
|
+
const { forceMount: s } = k(), c = y(r), e = s || n;
|
|
90
|
+
return /* @__PURE__ */ o(
|
|
91
|
+
z.Panel,
|
|
84
92
|
{
|
|
85
93
|
"data-spark-component": "tabs-content",
|
|
86
94
|
ref: a,
|
|
87
|
-
|
|
88
|
-
className:
|
|
89
|
-
|
|
90
|
-
...
|
|
95
|
+
keepMounted: e,
|
|
96
|
+
className: oe({ className: l, forceMount: e }),
|
|
97
|
+
render: c,
|
|
98
|
+
...i,
|
|
91
99
|
children: t
|
|
92
100
|
}
|
|
93
101
|
);
|
|
94
102
|
};
|
|
95
|
-
|
|
96
|
-
const
|
|
103
|
+
R.displayName = "Tabs.Content";
|
|
104
|
+
const ne = b(["relative flex"]), ie = b([
|
|
97
105
|
"flex w-full",
|
|
98
106
|
"data-[orientation=horizontal]:flex-row",
|
|
99
107
|
"data-[orientation=vertical]:flex-col",
|
|
@@ -101,64 +109,64 @@ const te = x(["relative flex"]), re = x([
|
|
|
101
109
|
"after:flex after:shrink after:grow after:border-outline",
|
|
102
110
|
"data-[orientation=horizontal]:after:border-b-sm",
|
|
103
111
|
"data-[orientation=vertical]:after:border-r-sm"
|
|
104
|
-
]),
|
|
112
|
+
]), E = b([
|
|
105
113
|
"h-auto! flex-none",
|
|
106
114
|
"border-b-sm border-outline",
|
|
107
115
|
"outline-hidden",
|
|
108
116
|
"focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!"
|
|
109
|
-
]),
|
|
110
|
-
const [
|
|
111
|
-
return
|
|
117
|
+
]), se = (t, r) => {
|
|
118
|
+
const [l, a] = B({ width: void 0, height: void 0 }), n = v(null), i = v(r);
|
|
119
|
+
return w(() => {
|
|
112
120
|
i.current = r;
|
|
113
|
-
}, [r]),
|
|
114
|
-
const
|
|
115
|
-
if (!(!
|
|
116
|
-
return
|
|
117
|
-
const { inlineSize: e, blockSize:
|
|
118
|
-
i.current?.(c), a({ width: e, height:
|
|
119
|
-
}),
|
|
120
|
-
|
|
121
|
+
}, [r]), w(() => {
|
|
122
|
+
const s = t && "current" in t ? t.current : t;
|
|
123
|
+
if (!(!s || n.current))
|
|
124
|
+
return n.current = new ResizeObserver(([c]) => {
|
|
125
|
+
const { inlineSize: e, blockSize: h } = c?.borderBoxSize?.[0] ?? {};
|
|
126
|
+
i.current?.(c), a({ width: e, height: h });
|
|
127
|
+
}), n.current.observe(s), () => {
|
|
128
|
+
n.current && n.current.unobserve(s);
|
|
121
129
|
};
|
|
122
|
-
}, [t,
|
|
123
|
-
},
|
|
130
|
+
}, [t, n, i]), l;
|
|
131
|
+
}, W = ({
|
|
124
132
|
/**
|
|
125
|
-
* Default
|
|
126
|
-
* see https://
|
|
133
|
+
* Default Base UI Primitive values
|
|
134
|
+
* see https://base-ui.com/react/components/tabs
|
|
127
135
|
*/
|
|
128
136
|
asChild: t = !1,
|
|
129
137
|
loop: r = !1,
|
|
130
|
-
children:
|
|
138
|
+
children: l,
|
|
131
139
|
className: a,
|
|
132
|
-
ref:
|
|
140
|
+
ref: n,
|
|
133
141
|
...i
|
|
134
142
|
}) => {
|
|
135
|
-
const
|
|
143
|
+
const s = v(null), c = v(null), e = n || c, { orientation: h } = k(), C = y(t), { width: x } = se(s), [d, g] = B({
|
|
136
144
|
prev: "hidden",
|
|
137
145
|
next: "hidden"
|
|
138
146
|
});
|
|
139
|
-
|
|
140
|
-
typeof e == "function" || !e.current ||
|
|
147
|
+
w(() => {
|
|
148
|
+
typeof e == "function" || !e.current || g(h !== "horizontal" ? { prev: "hidden", next: "hidden" } : {
|
|
141
149
|
prev: e.current.scrollWidth > e.current.clientWidth ? "visible" : "hidden",
|
|
142
150
|
next: e.current.scrollWidth > e.current.clientWidth ? "visible" : "hidden"
|
|
143
151
|
});
|
|
144
|
-
}, [
|
|
152
|
+
}, [h, e, x]), w(() => {
|
|
145
153
|
if (typeof e == "function" || !e.current || d.prev === "hidden" || r)
|
|
146
154
|
return;
|
|
147
155
|
const f = (u) => {
|
|
148
|
-
|
|
156
|
+
g({
|
|
149
157
|
prev: u.scrollLeft > 0 ? "visible" : "disabled",
|
|
150
158
|
next: u.scrollLeft + u.clientWidth < u.scrollWidth ? "visible" : "disabled"
|
|
151
159
|
});
|
|
152
|
-
},
|
|
153
|
-
return f(
|
|
160
|
+
}, p = e.current;
|
|
161
|
+
return f(p), p.addEventListener(
|
|
154
162
|
"scroll",
|
|
155
163
|
({ target: u }) => f(u)
|
|
156
|
-
), () =>
|
|
164
|
+
), () => p.removeEventListener(
|
|
157
165
|
"scroll",
|
|
158
166
|
({ target: u }) => f(u)
|
|
159
167
|
);
|
|
160
168
|
}, [e, d.prev, r]);
|
|
161
|
-
const
|
|
169
|
+
const N = () => {
|
|
162
170
|
if (typeof e == "function" || !e.current)
|
|
163
171
|
return;
|
|
164
172
|
const f = r && e.current.scrollLeft <= 0;
|
|
@@ -166,7 +174,7 @@ const te = x(["relative flex"]), re = x([
|
|
|
166
174
|
left: f ? e.current.scrollLeft + e.current.scrollWidth - e.current.clientWidth : e.current.scrollLeft - e.current.clientWidth,
|
|
167
175
|
behavior: "smooth"
|
|
168
176
|
});
|
|
169
|
-
},
|
|
177
|
+
}, P = () => {
|
|
170
178
|
if (typeof e == "function" || !e.current)
|
|
171
179
|
return;
|
|
172
180
|
const f = r && e.current.scrollLeft + e.current.clientWidth >= e.current.scrollWidth;
|
|
@@ -175,58 +183,59 @@ const te = x(["relative flex"]), re = x([
|
|
|
175
183
|
behavior: "smooth"
|
|
176
184
|
});
|
|
177
185
|
};
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
d.prev !== "hidden" && /* @__PURE__ */
|
|
180
|
-
|
|
186
|
+
return /* @__PURE__ */ F("div", { className: ne({ className: a }), ref: s, children: [
|
|
187
|
+
d.prev !== "hidden" && /* @__PURE__ */ o(
|
|
188
|
+
I,
|
|
181
189
|
{
|
|
182
190
|
shape: "square",
|
|
183
191
|
intent: "surface",
|
|
184
192
|
size: "sm",
|
|
185
|
-
className:
|
|
186
|
-
onClick:
|
|
193
|
+
className: E(),
|
|
194
|
+
onClick: N,
|
|
187
195
|
disabled: d.prev === "disabled",
|
|
188
196
|
"aria-label": "Scroll left",
|
|
189
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(Y, {}) })
|
|
190
198
|
}
|
|
191
199
|
),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
200
|
+
/* @__PURE__ */ o(
|
|
201
|
+
z.List,
|
|
194
202
|
{
|
|
195
203
|
"data-spark-component": "tabs-list",
|
|
196
204
|
ref: e,
|
|
197
|
-
className:
|
|
198
|
-
|
|
199
|
-
|
|
205
|
+
className: ie(),
|
|
206
|
+
render: C,
|
|
207
|
+
loopFocus: r,
|
|
208
|
+
activateOnFocus: !0,
|
|
200
209
|
...i,
|
|
201
|
-
children:
|
|
210
|
+
children: l
|
|
202
211
|
}
|
|
203
212
|
),
|
|
204
|
-
d.next !== "hidden" && /* @__PURE__ */
|
|
205
|
-
|
|
213
|
+
d.next !== "hidden" && /* @__PURE__ */ o(
|
|
214
|
+
I,
|
|
206
215
|
{
|
|
207
216
|
shape: "square",
|
|
208
217
|
intent: "surface",
|
|
209
218
|
size: "sm",
|
|
210
|
-
className:
|
|
211
|
-
onClick:
|
|
219
|
+
className: E(),
|
|
220
|
+
onClick: P,
|
|
212
221
|
disabled: d.next === "disabled",
|
|
213
222
|
"aria-label": "Scroll right",
|
|
214
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(Z, {}) })
|
|
215
224
|
}
|
|
216
225
|
)
|
|
217
226
|
] });
|
|
218
227
|
};
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
const t = A(
|
|
228
|
+
W.displayName = "Tabs.List";
|
|
229
|
+
const L = O(void 0), q = () => {
|
|
230
|
+
const t = A(L);
|
|
222
231
|
if (!t)
|
|
223
232
|
throw new Error("TabsPopover components must be used within TabsPopover");
|
|
224
233
|
return t;
|
|
225
|
-
},
|
|
226
|
-
({ "aria-label": t, children: r, ...
|
|
227
|
-
const { popoverTriggerRef:
|
|
228
|
-
return /* @__PURE__ */
|
|
229
|
-
|
|
234
|
+
}, H = j(
|
|
235
|
+
({ "aria-label": t, children: r, ...l }, a) => {
|
|
236
|
+
const { popoverTriggerRef: n } = q(), i = D(a, n);
|
|
237
|
+
return /* @__PURE__ */ o(T.Trigger, { asChild: !0, ...l, children: /* @__PURE__ */ o(
|
|
238
|
+
ee,
|
|
230
239
|
{
|
|
231
240
|
ref: i,
|
|
232
241
|
size: "sm",
|
|
@@ -234,48 +243,48 @@ const P = E(void 0), K = () => {
|
|
|
234
243
|
design: "ghost",
|
|
235
244
|
"aria-label": t,
|
|
236
245
|
tabIndex: -1,
|
|
237
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ o(S, { children: r || /* @__PURE__ */ o(_, {}) })
|
|
238
247
|
}
|
|
239
248
|
) });
|
|
240
249
|
}
|
|
241
250
|
);
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
({ side: t, align: r = "start", className:
|
|
245
|
-
const { popoverSide: i } =
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
|
|
251
|
+
H.displayName = "Popover.Trigger";
|
|
252
|
+
const G = j(
|
|
253
|
+
({ side: t, align: r = "start", className: l, ...a }, n) => {
|
|
254
|
+
const { popoverSide: i } = q(), s = U("gap-sm flex flex-col", l);
|
|
255
|
+
return /* @__PURE__ */ o(
|
|
256
|
+
T.Content,
|
|
248
257
|
{
|
|
249
|
-
ref:
|
|
258
|
+
ref: n,
|
|
250
259
|
...a,
|
|
251
260
|
side: t ?? i,
|
|
252
261
|
align: r,
|
|
253
|
-
className:
|
|
262
|
+
className: s
|
|
254
263
|
}
|
|
255
264
|
);
|
|
256
265
|
}
|
|
257
266
|
);
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
const a =
|
|
267
|
+
G.displayName = "Popover.Content";
|
|
268
|
+
const J = ({ popoverSide: t, popoverTriggerRef: r, children: l }) => {
|
|
269
|
+
const a = Q(
|
|
261
270
|
() => ({ popoverSide: t, popoverTriggerRef: r }),
|
|
262
271
|
[t, r]
|
|
263
|
-
), i = Object.assign(((
|
|
264
|
-
Content:
|
|
265
|
-
Trigger:
|
|
272
|
+
), i = Object.assign(((s) => /* @__PURE__ */ o(L.Provider, { value: a, children: /* @__PURE__ */ o(T, { ...s, children: s.children }) })), T, {
|
|
273
|
+
Content: G,
|
|
274
|
+
Trigger: H
|
|
266
275
|
});
|
|
267
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ o(L.Provider, { value: a, children: l(i) });
|
|
268
277
|
};
|
|
269
|
-
|
|
270
|
-
const
|
|
278
|
+
J.displayName = "Popover";
|
|
279
|
+
const ae = b(
|
|
271
280
|
[
|
|
272
281
|
"px-md",
|
|
273
282
|
"relative flex flex-none items-center",
|
|
274
283
|
"border-outline",
|
|
275
284
|
"hover:not-disabled:bg-surface-hovered",
|
|
276
285
|
"after:absolute",
|
|
277
|
-
"data-[
|
|
278
|
-
"data-[
|
|
286
|
+
"data-[active]:font-bold",
|
|
287
|
+
"not-data-[active]:not-disabled:cursor-pointer",
|
|
279
288
|
"data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2",
|
|
280
289
|
"data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2",
|
|
281
290
|
"focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset",
|
|
@@ -289,9 +298,9 @@ const ne = x(
|
|
|
289
298
|
* Change the color scheme of the tabs
|
|
290
299
|
* @default support
|
|
291
300
|
*/
|
|
292
|
-
intent:
|
|
293
|
-
main: ["data-[
|
|
294
|
-
support: ["data-[
|
|
301
|
+
intent: te({
|
|
302
|
+
main: ["data-[active]:text-main data-[active]:after:bg-main"],
|
|
303
|
+
support: ["data-[active]:text-support data-[active]:after:bg-support"]
|
|
295
304
|
}),
|
|
296
305
|
/**
|
|
297
306
|
* Change the size of the tabs
|
|
@@ -324,65 +333,65 @@ const ne = x(
|
|
|
324
333
|
orientation: "horizontal"
|
|
325
334
|
}
|
|
326
335
|
}
|
|
327
|
-
),
|
|
336
|
+
), M = ({
|
|
328
337
|
/**
|
|
329
|
-
* Default
|
|
330
|
-
* see https://
|
|
338
|
+
* Default Base UI Primitive values
|
|
339
|
+
* see https://base-ui.com/react/components/tabs
|
|
331
340
|
*/
|
|
332
341
|
asChild: t = !1,
|
|
333
342
|
value: r,
|
|
334
|
-
disabled:
|
|
343
|
+
disabled: l = !1,
|
|
335
344
|
children: a,
|
|
336
|
-
className:
|
|
345
|
+
className: n,
|
|
337
346
|
ref: i,
|
|
338
|
-
onKeyDown:
|
|
347
|
+
onKeyDown: s,
|
|
339
348
|
renderMenu: c,
|
|
340
349
|
...e
|
|
341
350
|
}) => {
|
|
342
|
-
const { intent:
|
|
343
|
-
|
|
344
|
-
},
|
|
345
|
-
|
|
351
|
+
const { intent: h, size: C, orientation: x } = k(), d = v(null), g = v(null), N = y(t), P = D(i, g), f = (m) => {
|
|
352
|
+
m.key === "F10" && m.shiftKey && c && d.current && (m.preventDefault(), d.current.click()), s?.(m);
|
|
353
|
+
}, p = !!c, u = x === "vertical" ? "right" : "bottom", V = /* @__PURE__ */ o(
|
|
354
|
+
z.Tab,
|
|
346
355
|
{
|
|
347
356
|
"data-spark-component": "tabs-trigger",
|
|
348
|
-
ref:
|
|
349
|
-
className:
|
|
350
|
-
intent:
|
|
351
|
-
size:
|
|
352
|
-
hasMenu:
|
|
353
|
-
orientation:
|
|
354
|
-
className:
|
|
357
|
+
ref: P,
|
|
358
|
+
className: ae({
|
|
359
|
+
intent: h,
|
|
360
|
+
size: C,
|
|
361
|
+
hasMenu: p,
|
|
362
|
+
orientation: x ?? "horizontal",
|
|
363
|
+
className: n
|
|
355
364
|
}),
|
|
356
|
-
|
|
357
|
-
disabled:
|
|
365
|
+
render: N,
|
|
366
|
+
disabled: l,
|
|
358
367
|
value: r,
|
|
359
|
-
onFocus: ({ target:
|
|
368
|
+
onFocus: ({ target: m }) => m.scrollIntoView({
|
|
360
369
|
behavior: "smooth",
|
|
361
370
|
block: "nearest",
|
|
362
371
|
inline: "nearest"
|
|
363
372
|
}),
|
|
364
373
|
onKeyDown: f,
|
|
365
|
-
"aria-haspopup":
|
|
374
|
+
"aria-haspopup": p ? "true" : void 0,
|
|
366
375
|
...e,
|
|
367
376
|
children: a
|
|
368
377
|
}
|
|
369
378
|
);
|
|
370
|
-
return
|
|
371
|
-
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
] }) :
|
|
379
|
+
return p ? /* @__PURE__ */ F("div", { className: x === "vertical" ? "relative w-full" : "relative", children: [
|
|
380
|
+
V,
|
|
381
|
+
/* @__PURE__ */ o("div", { className: "right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2", children: /* @__PURE__ */ o(J, { popoverSide: u, popoverTriggerRef: d, children: (m) => c?.({ Popover: m }) }) })
|
|
382
|
+
] }) : V;
|
|
374
383
|
};
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
List:
|
|
378
|
-
Trigger:
|
|
379
|
-
Content:
|
|
384
|
+
M.displayName = "Tabs.Trigger";
|
|
385
|
+
const le = Object.assign($, {
|
|
386
|
+
List: W,
|
|
387
|
+
Trigger: M,
|
|
388
|
+
Content: R
|
|
380
389
|
});
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
390
|
+
le.displayName = "Tabs";
|
|
391
|
+
W.displayName = "Tabs.List";
|
|
392
|
+
M.displayName = "Tabs.Trigger";
|
|
393
|
+
R.displayName = "Tabs.Content";
|
|
385
394
|
export {
|
|
386
|
-
|
|
395
|
+
le as Tabs
|
|
387
396
|
};
|
|
388
397
|
//# sourceMappingURL=index.mjs.map
|
package/dist/tabs/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { Tabs as RadixTabs } from 'radix-ui'\nimport { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps &\n Pick<RadixTabs.TabsProps, 'orientation'> & {\n forceMount?: boolean\n }\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Tabs as RadixTabs } from 'radix-ui'\nimport { type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport interface TabsProps\n extends Omit<RadixTabs.TabsProps, 'activationMode'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#root\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <RadixTabs.Root\n ref={ref}\n asChild={asChild}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n activationMode=\"automatic\"\n {...rest}\n >\n {children}\n </RadixTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[state=inactive]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as RadixTabs } from 'radix-ui'\nimport { type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\n\nexport interface TabsContentProps\n extends PropsWithChildren<Omit<RadixTabs.TabsContentProps, 'forceMount'>> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\nexport const TabsContent = ({\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#content\n */\n children,\n asChild = false,\n className,\n ref,\n ...rest\n}: TabsContentProps) => {\n const { forceMount } = useTabsContext()\n\n return (\n <RadixTabs.Content\n data-spark-component=\"tabs-content\"\n ref={ref}\n forceMount={forceMount || rest.forceMount}\n className={contentStyles({ className, forceMount })}\n asChild={asChild}\n {...rest}\n >\n {children}\n </RadixTabs.Content>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { Tabs as RadixTabs } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps extends Omit<RadixTabs.TabsListProps, 'children'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\nexport const TabsList = ({\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#list\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <RadixTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n asChild={asChild}\n loop={loop}\n {...rest}\n >\n {children}\n </RadixTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[state=active]:font-bold',\n 'data-[state=inactive]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[state=active]:text-main data-[state=active]:after:bg-main'],\n support: ['data-[state=active]:text-support data-[state=active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { Tabs as RadixTabs } from 'radix-ui'\nimport { type FocusEvent, type KeyboardEvent, type ReactNode, Ref, useRef } from 'react'\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\n\nexport interface TabsTriggerProps extends RadixTabs.TabsTriggerProps {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TabsTrigger = ({\n /**\n * Default Radix Primitive values\n * see https://www.radix-ui.com/docs/primitives/components/tabs#trigger\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <RadixTabs.Trigger\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n asChild={asChild}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </RadixTabs.Trigger>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"names":["TabsContext","createContext","useTabsContext","context","useContext","rootStyles","cva","Tabs","intent","size","asChild","forceMount","orientation","children","className","ref","rest","jsx","RadixTabs","contentStyles","TabsContent","wrapperStyles","listStyles","navigationArrowStyles","useResizeObserver","target","onResize","setSize","useState","resizeObserverRef","useRef","resizeCallbackRef","useEffect","targetElm","entry","width","height","TabsList","loop","wrapperRef","innerRef","listRef","arrows","setArrows","toggleArrowsVisibility","currentList","handlePrevClick","shouldLoopForward","handleNextClick","shouldLoopBackward","jsxs","Button","Icon","ArrowVerticalLeft","ArrowVerticalRight","TabsPopoverContext","useTabsPopoverContext","TabsPopoverTrigger","forwardRef","ariaLabel","iconChildren","triggerProps","forwardedRef","popoverTriggerRef","mergedRef","useMergeRefs","SparkPopover","IconButton","MoreMenuHorizontal","TabsPopoverContent","side","align","contentProps","popoverSide","mergedClassName","cx","Popover","contextValue","useMemo","PopoverComponent","props","triggerVariants","makeVariants","TabsTrigger","value","disabled","onKeyDown","renderMenu","tabsTriggerRef","handleKeyDown","e","hasMenu","trigger","PopoverAbstraction","Root","List","Trigger","Content"],"mappings":";;;;;;;;;;;;;AAUO,MAAMA,IAAcC,EAAoC,EAA0B,GAE5EC,IAAiB,MAAM;AAClC,QAAMC,IAAUC,EAAWJ,CAAW;AAEtC,MAAI,CAACG;AACH,UAAM,MAAM,2DAA2D;AAGzE,SAAOA;AACT,GClBaE,IAAaC,EAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GCqBYC,IAAO,CAAC;AAAA,EACnB,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKP,SAAAC,IAAU;AAAA,EACV,YAAAC,IAAa;AAAA,EACb,aAAAC,IAAc;AAAA,EACd,UAAAC;AA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A,aAAa/E,KAAe;AAAA,QAC5B,WAAAE;AAAA,MAAA,CACD;AAAA,MACD,SAAAJ;AAAA,MACA,UAAA2E;AAAA,MACA,OAAAD;AAAA,MACA,SAAS,CAAC,EAAE,QAAA3D,QACVA,EAAO,eAAe;AAAA,QACpB,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,MAAA,CACT;AAAA,MAEH,WAAWgE;AAAA,MACX,iBAAeE,IAAU,SAAS;AAAA,MACjC,GAAG3E;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EAAA;AAIL,SAAK8E,sBAKF,OAAA,EAAI,WAAW/E,MAAgB,aAAa,oBAAoB,YAC9D,UAAA;AAAA,IAAAgF;AAAA,IACD,gBAAA3E,EAAC,OAAA,EAAI,WAAU,wEACb,4BAAC2D,GAAA,EAAQ,aAAAH,GAA0B,mBAAAV,GAChC,UAAA,CAAA8B,MAAsBN,IAAa,EAAE,SAASM,EAAA,CAAoB,GACrE,EAAA,CACF;AAAA,EAAA,GACF,IAXOD;AAaX;AAEAT,EAAY,cAAc;ACrHnB,MAAM5E,KAIT,OAAO,OAAOuF,GAAM;AAAA,EAAA,MACtBC;AAAAA,EAAA,SACAC;AAAAA,EAAA,SACAC;AACF,CAAC;AAED1F,GAAK,cAAc;AACnBwF,EAAK,cAAc;AACnBC,EAAQ,cAAc;AACtBC,EAAQ,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/useRenderSlot.tsx","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps & {\n orientation?: 'horizontal' | 'vertical'\n forceMount?: boolean\n}\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean) {\n return asChild ? ({ ...props }: object) => <Slot {...props} /> : undefined\n}\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsProps\n extends Omit<ComponentProps<typeof BaseTabs.Root>, 'render'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <BaseTabs.Root\n ref={ref}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[hidden]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsContentProps\n extends PropsWithChildren<Omit<ComponentProps<typeof BaseTabs.Panel>, 'keepMounted' | 'render'>> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\nexport const TabsContent = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n children,\n asChild = false,\n className,\n ref,\n forceMount,\n ...rest\n}: TabsContentProps) => {\n const { forceMount: contextForceMount } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n const keepMounted = contextForceMount || forceMount\n\n return (\n <BaseTabs.Panel\n data-spark-component=\"tabs-content\"\n ref={ref}\n keepMounted={keepMounted}\n className={contentStyles({ className, forceMount: keepMounted })}\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Panel>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { type ComponentProps, type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useRenderSlot } from './useRenderSlot'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps\n extends Omit<ComponentProps<typeof BaseTabs.List>, 'render' | 'loopFocus'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\nexport const TabsList = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <BaseTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n render={renderSlot}\n loopFocus={loop}\n activateOnFocus\n {...rest}\n >\n {children}\n </BaseTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[active]:font-bold',\n 'not-data-[active]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[active]:text-main data-[active]:after:bg-main'],\n support: ['data-[active]:text-support data-[active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { type ComponentProps, type FocusEvent, type ReactNode, Ref, useRef } from 'react'\n\ntype TabKeyDownEvent = Parameters<NonNullable<ComponentProps<typeof BaseTabs.Tab>['onKeyDown']>>[0]\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsTriggerProps extends Omit<ComponentProps<typeof BaseTabs.Tab>, 'render'> {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TabsTrigger = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n const renderSlot = useRenderSlot(asChild)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: TabKeyDownEvent) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <BaseTabs.Tab\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n render={renderSlot}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </BaseTabs.Tab>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"names":["TabsContext","createContext","useTabsContext","context","useContext","rootStyles","cva","useRenderSlot","asChild","props","jsx","Slot","Tabs","intent","size","forceMount","orientation","children","className","ref","rest","renderSlot","BaseTabs","contentStyles","TabsContent","contextForceMount","keepMounted","wrapperStyles","listStyles","navigationArrowStyles","useResizeObserver","target","onResize","setSize","useState","resizeObserverRef","useRef","resizeCallbackRef","useEffect","targetElm","entry","width","height","TabsList","loop","wrapperRef","innerRef","listRef","arrows","setArrows","toggleArrowsVisibility","currentList","handlePrevClick","shouldLoopForward","handleNextClick","shouldLoopBackward","jsxs","Button","Icon","ArrowVerticalLeft","ArrowVerticalRight","TabsPopoverContext","useTabsPopoverContext","TabsPopoverTrigger","forwardRef","ariaLabel","iconChildren","triggerProps","forwardedRef","popoverTriggerRef","mergedRef","useMergeRefs","SparkPopover","IconButton","MoreMenuHorizontal","TabsPopoverContent","side","align","contentProps","popoverSide","mergedClassName","cx","Popover","contextValue","useMemo","PopoverComponent","triggerVariants","makeVariants","TabsTrigger","value","disabled","onKeyDown","renderMenu","tabsTriggerRef","handleKeyDown","e","hasMenu","trigger","PopoverAbstraction","Root","List","Trigger","Content"],"mappings":";;;;;;;;;;;;;;AASO,MAAMA,IAAcC,EAAoC,EAA0B,GAE5EC,IAAiB,MAAM;AAClC,QAAMC,IAAUC,EAAWJ,CAAW;AAEtC,MAAI,CAACG;AACH,UAAM,MAAM,2DAA2D;AAGzE,SAAOA;AACT,GCjBaE,KAAaC,EAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;ACLM,SAASC,EAAcC,GAAkB;AAC9C,SAAOA,IAAU,CAAC,EAAE,GAAGC,EAAA,MAAoB,gBAAAC,EAACC,GAAA,EAAM,GAAGF,EAAA,CAAO,IAAK;AACnE;ACyBO,MAAMG,IAAO,CAAC;AAAA,EACnB,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKP,SAAAN,IAAU;AAAA,EACV,YAAAO,IAAa;AAAA,EACb,aAAAC,IAAc;AAAA,EACd,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,KAAAC;AAAA,EACA,GAAGC;AACL,MAAi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AqB;AAAA,MACrB,KAAKgD;AAAA,MACL,WAAWgB,GAAgB;AAAA,QACzB,QAAAzE;AAAA,QACA,MAAAC;AAAA,QACA,SAAAkF;AAAA,QACA,aAAahF,KAAe;AAAA,QAC5B,WAAAE;AAAA,MAAA,CACD;AAAA,MACD,QAAQG;AAAA,MACR,UAAAqE;AAAA,MACA,OAAAD;AAAA,MACA,SAAS,CAAC,EAAE,QAAA1D,QACVA,EAAO,eAAe;AAAA,QACpB,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,MAAA,CACT;AAAA,MAEH,WAAW+D;AAAA,MACX,iBAAeE,IAAU,SAAS;AAAA,MACjC,GAAG5E;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EAAA;AAIL,SAAK+E,sBAKF,OAAA,EAAI,WAAWhF,MAAgB,aAAa,oBAAoB,YAC9D,UAAA;AAAA,IAAAiF;AAAA,IACD,gBAAAvF,EAAC,OAAA,EAAI,WAAU,wEACb,4BAACwE,GAAA,EAAQ,aAAAH,GAA0B,mBAAAV,GAChC,UAAA,CAAA6B,MAAsBN,IAAa,EAAE,SAASM,EAAA,CAAoB,GACrE,EAAA,CACF;AAAA,EAAA,GACF,IAXOD;AAaX;AAEAT,EAAY,cAAc;ACzHnB,MAAM5E,KAIT,OAAO,OAAOuF,GAAM;AAAA,EAAA,MACtBC;AAAAA,EAAA,SACAC;AAAAA,EAAA,SACAC;AACF,CAAC;AAED1F,GAAK,cAAc;AACnBwF,EAAK,cAAc;AACnBC,EAAQ,cAAc;AACtBC,EAAQ,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRenderSlot(asChild: boolean): (({ ...props }: object) => import("react/jsx-runtime").JSX.Element) | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-ui/components",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Spark (Leboncoin design system) components.",
|
|
6
6
|
"exports": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@react-aria/toast": "^3.0.0-beta.18",
|
|
55
55
|
"@react-stately/numberfield": "3.9.11",
|
|
56
56
|
"@react-stately/toast": "^3.0.0-beta.7",
|
|
57
|
-
"@spark-ui/hooks": "^17.0.
|
|
58
|
-
"@spark-ui/icons": "^17.0.
|
|
59
|
-
"@spark-ui/internal-utils": "^17.0.
|
|
57
|
+
"@spark-ui/hooks": "^17.0.1",
|
|
58
|
+
"@spark-ui/icons": "^17.0.1",
|
|
59
|
+
"@spark-ui/internal-utils": "^17.0.1",
|
|
60
60
|
"@zag-js/pagination": "1.30.0",
|
|
61
61
|
"@zag-js/react": "1.30.0",
|
|
62
62
|
"class-variance-authority": "0.7.1",
|