@gridui/tabs 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,10 +3,20 @@
3
3
  Core family. Public API: `Tabs`, `TabsList`, `TabsListProps`, `TabsPanel`, `TabsPanelProps`, `TabsProps`, `TabsTab`, `TabsTabProps`.
4
4
 
5
5
  Import components from `@gridui/tabs` and load `@gridui/tabs/styles.css` after Theme.
6
- Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
6
+ Applications own routes, labels, state persistence, and branding.
7
7
 
8
8
  See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/tabs/.changeset/history).
9
9
 
10
+ ## Styles
11
+
12
+ Load Theme once. Use `@gridui/tabs/styled` for automatic component CSS in
13
+ CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/tabs/styles.css`.
14
+ Both entries expose the same root API. The standalone stylesheet includes component
15
+ dependency styles; Theme/reset remain separate. See the
16
+ [integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
17
+ for static HTML loading, SSR limits, and avoiding duplicate CSS.
18
+
19
+
10
20
  ## Selection and native props
11
21
 
12
22
  Removing the selected uncontrolled tab requests the first enabled tab in the
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/shared/context.ts", "../src/tabs/style.ts", "../src/tabs/tabs.tsx", "../src/tabs-list/tabs-list.tsx", "../src/tabs-list/style.ts", "../src/tabs-list/use-tab-indicator.ts", "../src/tabs-panel/style.ts", "../src/tabs-panel/tabs-panel.tsx", "../src/tabs-tab/style.ts", "../src/tabs-tab/tabs-tab.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Tabs\n * @namespace Shared\n * @description Context\n */\n\nimport { createContext } from \"react\";\n\nexport type TabsAppearance = \"indicator\" | \"connected\";\n\nexport const TabsContext = createContext<{\n appearance: TabsAppearance;\n value: string | null;\n change: (value: string, event: Event) => void;\n} | null>(null);\n\nexport const TabsListContext = createContext<{\n activateOnFocus: boolean;\n layout: \"standard\" | \"cells\";\n}>({\n activateOnFocus: false,\n layout: \"standard\",\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace Tabs\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsStyles = cva(\"gridui-u-tabs--flex gridui-u-tabs--min-w-0 gridui-u-tabs--flex-col gridui-u-tabs--data-[orientation=vertical]:flex-row\", {\n variants: {\n appearance: {\n indicator: \"\",\n connected: \"gridui-u-tabs--border gridui-u-tabs--border-solid gridui-u-tabs--border-border gridui-u-tabs--bg-background\",\n },\n },\n defaultVariants: { appearance: \"indicator\" },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace Tabs\n * @description Tabs\n */\n\nimport { type TabsAppearance, TabsContext } from \"../shared/context\";\nimport { tabsStyles } from \"./style\";\nimport { type ChangeDetails, changeDetails } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useCallback, useEffect, useEffectEvent, useImperativeHandle, useRef, useState } from \"react\";\n\nexport type TabsProps = Omit<ComponentPropsWithRef<typeof Primitive.Root>, \"value\" | \"defaultValue\" | \"onValueChange\" | \"activationMode\"> & {\n readonly appearance?: TabsAppearance | undefined;\n readonly value?: string | null | undefined;\n readonly defaultValue?: string | null | undefined;\n readonly onValueChange?: ((value: string | null, details: ChangeDetails) => void) | undefined;\n};\n\nexport const Tabs: FC<TabsProps> = (props: TabsProps) => {\n const { className, appearance = \"indicator\", value, defaultValue = null, onValueChange, ref, ...restProps } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultValue);\n const root = useRef<HTMLDivElement>(null);\n const current = value === undefined ? local : value;\n useImperativeHandle(ref, () => {\n return root.current as HTMLDivElement;\n });\n const change = useCallback((next: string, event: Event) => {\n if (next === current) {\n return;\n }\n const details = changeDetails(event);\n onValueChange?.(next, details);\n if (!details.isCanceled && value === undefined) {\n setLocal(next);\n }\n }, [\n current,\n onValueChange,\n value,\n ]);\n const reconcile = useEffectEvent(() => {\n const element = root.current;\n if (!element || value !== undefined || current === null) {\n return;\n }\n const tabs = Array.from(element.querySelectorAll<HTMLButtonElement>(\"[data-gridui-tab]\")).filter(tab => {\n return tab.closest(\"[data-gridui-tabs]\") === element;\n });\n if (!tabs.some(tab => {\n return tab.dataset.griduiTab === current;\n })) {\n const first = tabs.find(tab => {\n return tab.getAttribute(\"aria-disabled\") !== \"true\";\n });\n if (first?.dataset.griduiTab) {\n change(first.dataset.griduiTab, new Event(\"change\"));\n }\n }\n });\n useEffect(() => {\n const element = root.current;\n if (!element) {\n return;\n }\n const observer = new MutationObserver(() => {\n reconcile();\n });\n observer.observe(element, {\n childList: true,\n subtree: true,\n });\n reconcile();\n return () => {\n observer.disconnect();\n };\n }, [\n value,\n current,\n ]);\n return (<TabsContext.Provider\n value={{\n appearance,\n value: current,\n change,\n }}\n >\n <Primitive.Root\n {...restProps}\n data-gridui-tabs=\"\"\n data-appearance={appearance}\n ref={root}\n value={current ?? \"\"}\n activationMode=\"manual\"\n className={cn(tabsStyles({ appearance }), className)}\n />\n </TabsContext.Provider>);\n};\n", "import { useMotionStyle } from \"@gridui/motion/policy\";\n/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsList\n * @description Tabs List\n */\n\nimport { TabsContext, TabsListContext } from \"../shared/context\";\nimport { tabsListStyles } from \"./style\";\nimport { useTabIndicator } from \"./use-tab-indicator\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useContext, useImperativeHandle, useRef } from \"react\";\n\nexport type TabsListProps = Omit<ComponentPropsWithRef<typeof Primitive.List>, \"loop\"> & {\n readonly activateOnFocus?: boolean | undefined;\n readonly loopFocus?: boolean | undefined;\n readonly layout?: \"standard\" | \"cells\" | undefined;\n readonly morph?: boolean | undefined;\n /** Legacy compatibility prop. System and ancestor motion policy is always respected. */\n readonly respectReducedMotion?: boolean | undefined;\n};\n\nexport const TabsList: FC<TabsListProps> = (props: TabsListProps) => {\n const motionStyle = useMotionStyle();\n const { ref: forwardedRef, className, activateOnFocus = false, loopFocus = true, layout = \"standard\",\n morph = false, respectReducedMotion: _respectReducedMotion = true, ...restProps } = props;\n // Keep the deprecated prop off the DOM; policy can no longer be bypassed.\n void _respectReducedMotion;\n const appearance = useContext(TabsContext)?.appearance ?? \"indicator\";\n const animated = morph && appearance === \"indicator\";\n const viewport = useRef<HTMLDivElement>(null);\n useImperativeHandle(animated ? forwardedRef : undefined, () => {\n return viewport.current as HTMLDivElement;\n });\n useTabIndicator(viewport, animated);\n const scrollbarRef = useScrollbars({ ref: animated ? viewport : forwardedRef });\n const ref = useInteractionOutline({\n ref: scrollbarRef,\n selector: '[role=\"tab\"]',\n });\n return (<TabsListContext.Provider\n value={{\n activateOnFocus,\n layout,\n }}\n >\n <Primitive.List\n {...restProps}\n ref={ref}\n loop={loopFocus}\n data-layout={layout}\n data-appearance={appearance}\n data-morph={animated || undefined}\n className={cn(tabsListStyles({\n layout,\n appearance,\n }), className)}\n style={{ ...(props.style), ...motionStyle }}\n />\n </TabsListContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsList\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsListStyles = cva(\"gridui-tabs-list gridui-u-tabs--flex gridui-u-tabs--shrink-0 gridui-u-tabs--overflow-auto gridui-u-tabs--data-[orientation=vertical]:flex-col\", {\n variants: {\n appearance: {\n indicator: \"\",\n connected: \"\",\n },\n layout: {\n standard: \"\",\n cells: \"gridui-u-tabs--grid gridui-u-tabs--grid-flow-col gridui-u-tabs--auto-cols-fr gridui-u-tabs--gap-px gridui-u-tabs--border gridui-u-tabs--border-solid gridui-u-tabs--border-border gridui-u-tabs--bg-border gridui-u-tabs--bg-none gridui-u-tabs--overflow-visible gridui-u-tabs--data-[orientation=vertical]:grid-flow-row gridui-u-tabs--data-[orientation=vertical]:auto-rows-fr gridui-u-tabs--data-[orientation=vertical]:grid-cols-1\",\n },\n },\n compoundVariants: [\n {\n appearance: \"connected\",\n layout: \"cells\",\n class: \"gridui-u-tabs--border-0\",\n },\n ],\n defaultVariants: {\n layout: \"standard\",\n appearance: \"indicator\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsList\n * @description Use Tab Indicator\n */\n\nimport { type RefObject, useLayoutEffect } from \"react\";\n\nexport const useTabIndicator = (viewport: RefObject<HTMLDivElement | null>, enabled: boolean): void => {\n useLayoutEffect(() => {\n const list = viewport.current;\n if (!list || !enabled) {\n return;\n }\n // Keep the previous position during selection updates so CSS can interpolate.\n return () => {\n list.removeAttribute(\"data-morph-positioned\");\n list.style.removeProperty(\"--gridui-tab-indicator-offset\");\n list.style.removeProperty(\"--gridui-tab-indicator-width\");\n list.style.removeProperty(\"--gridui-tab-indicator-height\");\n };\n }, [\n enabled,\n viewport,\n ]);\n useLayoutEffect(() => {\n const list = viewport.current;\n if (!list || !enabled) {\n return;\n }\n const update = () => {\n const tab = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"][aria-selected=\"true\"]')).find((candidate) => {\n return candidate.closest('[role=\"tablist\"]') === list;\n });\n if (!tab || !tab.offsetWidth || !tab.offsetHeight) {\n list.removeAttribute(\"data-morph-positioned\");\n return;\n }\n const bounds = list.getBoundingClientRect();\n const target = tab.getBoundingClientRect();\n const scaleX = bounds.width / list.offsetWidth || 1;\n const scaleY = bounds.height / list.offsetHeight || 1;\n const vertical = list.dataset.orientation === \"vertical\";\n const rtl = getComputedStyle(list).direction === \"rtl\";\n const width = vertical ? 2 : target.width / scaleX;\n const height = vertical ? target.height / scaleY : 2;\n const left = (target.left - bounds.left) / scaleX + list.scrollLeft - list.clientLeft;\n const top = (target.top - bounds.top) / scaleY + list.scrollTop - list.clientTop;\n const x = left + (vertical && !rtl ? target.width / scaleX - width : 0);\n const y = top + (vertical ? 0 : target.height / scaleY - height);\n list.style.setProperty(\"--gridui-tab-indicator-offset\", `${x}px, ${y}px`);\n list.style.setProperty(\"--gridui-tab-indicator-width\", `${width}px`);\n list.style.setProperty(\"--gridui-tab-indicator-height\", `${height}px`);\n list.setAttribute(\"data-morph-positioned\", \"\");\n };\n update();\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const resize = new ResizeObserver(update);\n resize.observe(list);\n for (const tab of list.querySelectorAll('[role=\"tab\"]')) {\n resize.observe(tab);\n }\n return () => {\n resize.disconnect();\n };\n });\n};\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsPanel\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsPanelStyles = cva(\"gridui-u-tabs--min-w-0 gridui-u-tabs--flex-1 gridui-u-tabs--p-gridui-16 gridui-u-tabs--hidden:hidden\", {\n variants: {\n appearance: {\n indicator: \"\",\n connected: \"gridui-u-tabs--bg-background\",\n },\n },\n defaultVariants: { appearance: \"indicator\" },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsPanel\n * @description Tabs Panel\n */\n\nimport { TabsContext } from \"../shared/context\";\nimport { tabsPanelStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { LayoutMotion, Presence } from \"@gridui/motion\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useContext } from \"react\";\n\nexport type TabsPanelProps = Omit<ComponentPropsWithRef<typeof Primitive.Content>, \"forceMount\"> & {\n readonly keepMounted?: boolean | undefined;\n readonly motion?: boolean | undefined;\n};\n\nexport const TabsPanel: FC<TabsPanelProps> = (props: TabsPanelProps) => {\n const { className, keepMounted, motion = false, ...restProps } = props;\n const context = useContext(TabsContext);\n const hidden = context?.value !== restProps.value;\n if (motion) {\n if (restProps.asChild) {throw new TypeError(\"TabsPanel motion owns its panel element; asChild is not supported.\");}\n const { children, ...panelProps } = restProps;\n return <Presence mode=\"popLayout\">\n {(!hidden || keepMounted) && <Primitive.Content\n {...panelProps}\n key={restProps.value}\n forceMount\n asChild\n hidden={keepMounted ? hidden : false}\n data-appearance={context?.appearance ?? \"indicator\"}\n className={cn(tabsPanelStyles({ appearance: context?.appearance }), className)}\n >\n <LayoutMotion layout={false} enter={{ opacity: 0 }} exit={{ opacity: 0 }}>\n {children}\n </LayoutMotion>\n </Primitive.Content>}\n </Presence>;\n }\n return (<Primitive.Content\n {...restProps}\n forceMount={keepMounted ? true : undefined}\n hidden={hidden}\n data-appearance={context?.appearance ?? \"indicator\"}\n className={cn(tabsPanelStyles({ appearance: context?.appearance }), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsTab\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsTabStyles = cva(\"gridui-tabs-tab gridui-u-tabs--min-h-11 gridui-u-tabs--shrink-0 gridui-u-tabs--cursor-pointer gridui-u-tabs--px-gridui-16 gridui-u-tabs--py-gridui-8 gridui-u-tabs--text-muted gridui-u-tabs--type-ui gridui-u-tabs--data-[state=active]:text-foreground gridui-u-tabs--data-[state=active]:font-medium gridui-u-tabs--data-disabled:cursor-not-allowed gridui-u-tabs--data-disabled:opacity-50\", {\n variants: {\n layout: {\n standard: \"\",\n cells: \"gridui-u-tabs--w-full gridui-u-tabs--min-w-0 gridui-u-tabs--whitespace-normal gridui-u-tabs--wrap-anywhere gridui-u-tabs--px-gridui-8 gridui-u-tabs--py-gridui-16 gridui-u-tabs--text-center gridui-u-tabs--text-foreground\",\n },\n },\n defaultVariants: { layout: \"standard\" },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsTab\n * @description Tabs Tab\n */\n\nimport { TabsContext, TabsListContext } from \"../shared/context\";\nimport { tabsTabStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useContext, useRef } from \"react\";\n\nexport type TabsTabProps = ComponentPropsWithRef<typeof Primitive.Trigger>;\n\nexport const TabsTab: FC<TabsTabProps> = (props: TabsTabProps) => {\n const { className, disabled, onMouseDown, onKeyDown, onFocus, onClick, onBlur, ...restProps } = props;\n const context = useContext(TabsContext);\n const list = useContext(TabsListContext);\n const pointerActivated = useRef(false);\n const select = (event: Event) => {\n if (!disabled) {\n context?.change(props.value, event);\n }\n };\n return (<Primitive.Trigger\n {...restProps}\n aria-disabled={disabled}\n data-disabled={disabled ? \"\" : undefined}\n data-gridui-tab={props.value}\n data-appearance={context?.appearance ?? \"indicator\"}\n data-layout={list.layout}\n className={cn(tabsTabStyles({ layout: list.layout }), className)}\n onMouseDown={(event) => {\n onMouseDown?.(event);\n pointerActivated.current = !event.defaultPrevented && event.button === 0;\n if (pointerActivated.current) {\n select(event.nativeEvent);\n }\n }}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && (event.detail === 0 || !pointerActivated.current)) {\n select(event.nativeEvent);\n }\n pointerActivated.current = false;\n }}\n onKeyDown={(event) => {\n pointerActivated.current = false;\n onKeyDown?.(event);\n if (!event.defaultPrevented && (event.key === \"Enter\" || event.key === \" \")) {\n select(event.nativeEvent); event.preventDefault();\n }\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (list.activateOnFocus && !event.defaultPrevented && !pointerActivated.current) {\n select(event.nativeEvent);\n }\n }}\n onBlur={(event) => {\n pointerActivated.current = false;\n onBlur?.(event);\n }}\n />);\n};\n"],
5
- "mappings": ";AAOA,SAAS,qBAAqB;AAIvB,IAAM,cAAc,cAIjB,IAAI;AAEP,IAAM,kBAAkB,cAG5B;AAAA,EACC,iBAAiB;AAAA,EACjB,QAAQ;AACZ,CAAC;;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AAAA,MACA,QAAQ,CAAC,UAAU;AACf,yBAAiB,UAAU;AAC3B,iBAAS,KAAK;AAAA,MAClB;AAAA;AAAA,EACJ;AACJ;",
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Tabs\n * @namespace Shared\n * @description Context\n */\n\nimport { createContext } from \"react\";\n\nexport type TabsAppearance = \"indicator\" | \"connected\";\n\nexport const TabsContext = createContext<{\n appearance: TabsAppearance;\n value: string | null;\n change: (value: string, event: Event) => void;\n} | null>(null);\n\nexport const TabsListContext = createContext<{\n activateOnFocus: boolean;\n layout: \"standard\" | \"cells\";\n}>({\n activateOnFocus: false,\n layout: \"standard\",\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace Tabs\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsStyles = cva(\"gridui-u-tabs--flex gridui-u-tabs--min-w-0 gridui-u-tabs--flex-col gridui-u-tabs--data-[orientation=vertical]:flex-row\", {\n variants: {\n appearance: {\n indicator: \"\",\n connected: \"gridui-u-tabs--border gridui-u-tabs--border-solid gridui-u-tabs--border-border gridui-u-tabs--bg-background\",\n },\n },\n defaultVariants: { appearance: \"indicator\" },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace Tabs\n * @description Tabs\n */\n\nimport { type TabsAppearance, TabsContext } from \"../shared/context\";\nimport { tabsStyles } from \"./style\";\nimport { type ChangeDetails, changeDetails } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useCallback, useEffect, useEffectEvent, useImperativeHandle, useRef, useState } from \"react\";\n\nexport type TabsProps = Omit<ComponentPropsWithRef<typeof Primitive.Root>, \"value\" | \"defaultValue\" | \"onValueChange\" | \"activationMode\"> & {\n readonly appearance?: TabsAppearance | undefined;\n readonly value?: string | null | undefined;\n readonly defaultValue?: string | null | undefined;\n readonly onValueChange?: ((value: string | null, details: ChangeDetails) => void) | undefined;\n};\n\nexport const Tabs: FC<TabsProps> = (props: TabsProps) => {\n const { className, appearance = \"indicator\", value, defaultValue = null, onValueChange, ref, ...restProps } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultValue);\n const root = useRef<HTMLDivElement>(null);\n const current = value === undefined ? local : value;\n useImperativeHandle(ref, () => {\n return root.current as HTMLDivElement;\n });\n const change = useCallback((next: string, event: Event) => {\n if (next === current) {\n return;\n }\n const details = changeDetails(event);\n onValueChange?.(next, details);\n if (!details.isCanceled && value === undefined) {\n setLocal(next);\n }\n }, [\n current,\n onValueChange,\n value,\n ]);\n const reconcile = useEffectEvent(() => {\n const element = root.current;\n if (!element || value !== undefined || current === null) {\n return;\n }\n const tabs = Array.from(element.querySelectorAll<HTMLButtonElement>(\"[data-gridui-tab]\")).filter(tab => {\n return tab.closest(\"[data-gridui-tabs]\") === element;\n });\n if (!tabs.some(tab => {\n return tab.dataset.griduiTab === current;\n })) {\n const first = tabs.find(tab => {\n return tab.getAttribute(\"aria-disabled\") !== \"true\";\n });\n if (first?.dataset.griduiTab) {\n change(first.dataset.griduiTab, new Event(\"change\"));\n }\n }\n });\n useEffect(() => {\n const element = root.current;\n if (!element) {\n return;\n }\n const observer = new MutationObserver(() => {\n reconcile();\n });\n observer.observe(element, {\n childList: true,\n subtree: true,\n });\n reconcile();\n return () => {\n observer.disconnect();\n };\n }, [\n value,\n current,\n ]);\n return (<TabsContext.Provider\n value={{\n appearance,\n value: current,\n change,\n }}\n >\n <Primitive.Root\n {...restProps}\n data-gridui-tabs=\"\"\n data-appearance={appearance}\n ref={root}\n value={current ?? \"\"}\n activationMode=\"manual\"\n className={cn(tabsStyles({ appearance }), className)}\n />\n </TabsContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsList\n * @description Tabs List\n */\n\nimport { useMotionStyle } from \"@gridui/motion/policy\";\n/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsList\n * @description Tabs List\n */\n\nimport { TabsContext, TabsListContext } from \"../shared/context\";\nimport { tabsListStyles } from \"./style\";\nimport { useTabIndicator } from \"./use-tab-indicator\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useContext, useImperativeHandle, useRef } from \"react\";\n\nexport type TabsListProps = Omit<ComponentPropsWithRef<typeof Primitive.List>, \"loop\"> & {\n readonly activateOnFocus?: boolean | undefined;\n readonly loopFocus?: boolean | undefined;\n readonly layout?: \"standard\" | \"cells\" | undefined;\n readonly morph?: boolean | undefined;\n /** Legacy compatibility prop. System and ancestor motion policy is always respected. */\n readonly respectReducedMotion?: boolean | undefined;\n};\n\nexport const TabsList: FC<TabsListProps> = (props: TabsListProps) => {\n const motionStyle = useMotionStyle();\n const { ref: forwardedRef, className, activateOnFocus = false, loopFocus = true, layout = \"standard\",\n morph = false, respectReducedMotion: _respectReducedMotion = true, ...restProps } = props;\n // Keep the deprecated prop off the DOM; policy can no longer be bypassed.\n void _respectReducedMotion;\n const appearance = useContext(TabsContext)?.appearance ?? \"indicator\";\n const animated = morph && appearance === \"indicator\";\n const viewport = useRef<HTMLDivElement>(null);\n useImperativeHandle(animated ? forwardedRef : undefined, () => {\n return viewport.current as HTMLDivElement;\n });\n useTabIndicator(viewport, animated);\n const scrollbarRef = useScrollbars({ ref: animated ? viewport : forwardedRef });\n const ref = useInteractionOutline({\n ref: scrollbarRef,\n selector: '[role=\"tab\"]',\n });\n return (<TabsListContext.Provider\n value={{\n activateOnFocus,\n layout,\n }}\n >\n <Primitive.List\n {...restProps}\n ref={ref}\n loop={loopFocus}\n data-layout={layout}\n data-appearance={appearance}\n data-morph={animated || undefined}\n className={cn(tabsListStyles({\n layout,\n appearance,\n }), className)}\n style={{ ...(props.style), ...motionStyle }}\n />\n </TabsListContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsList\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsListStyles = cva(\"gridui-tabs-list gridui-u-tabs--flex gridui-u-tabs--shrink-0 gridui-u-tabs--overflow-auto gridui-u-tabs--data-[orientation=vertical]:flex-col\", {\n variants: {\n appearance: {\n indicator: \"\",\n connected: \"\",\n },\n layout: {\n standard: \"\",\n cells: \"gridui-u-tabs--grid gridui-u-tabs--grid-flow-col gridui-u-tabs--auto-cols-fr gridui-u-tabs--gap-px gridui-u-tabs--border gridui-u-tabs--border-solid gridui-u-tabs--border-border gridui-u-tabs--bg-border gridui-u-tabs--bg-none gridui-u-tabs--overflow-visible gridui-u-tabs--data-[orientation=vertical]:grid-flow-row gridui-u-tabs--data-[orientation=vertical]:auto-rows-fr gridui-u-tabs--data-[orientation=vertical]:grid-cols-1\",\n },\n },\n compoundVariants: [\n {\n appearance: \"connected\",\n layout: \"cells\",\n class: \"gridui-u-tabs--border-0\",\n },\n ],\n defaultVariants: {\n layout: \"standard\",\n appearance: \"indicator\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsList\n * @description Use Tab Indicator\n */\n\nimport { type RefObject, useLayoutEffect } from \"react\";\n\nexport const useTabIndicator = (viewport: RefObject<HTMLDivElement | null>, enabled: boolean): void => {\n useLayoutEffect(() => {\n const list = viewport.current;\n if (!list || !enabled) {\n return;\n }\n // Keep the previous position during selection updates so CSS can interpolate.\n return () => {\n list.removeAttribute(\"data-morph-positioned\");\n list.style.removeProperty(\"--gridui-tab-indicator-offset\");\n list.style.removeProperty(\"--gridui-tab-indicator-width\");\n list.style.removeProperty(\"--gridui-tab-indicator-height\");\n };\n }, [\n enabled,\n viewport,\n ]);\n useLayoutEffect(() => {\n const list = viewport.current;\n if (!list || !enabled) {\n return;\n }\n const update = () => {\n const tab = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"][aria-selected=\"true\"]')).find((candidate) => {\n return candidate.closest('[role=\"tablist\"]') === list;\n });\n if (!tab || !tab.offsetWidth || !tab.offsetHeight) {\n list.removeAttribute(\"data-morph-positioned\");\n return;\n }\n const bounds = list.getBoundingClientRect();\n const target = tab.getBoundingClientRect();\n const scaleX = bounds.width / list.offsetWidth || 1;\n const scaleY = bounds.height / list.offsetHeight || 1;\n const vertical = list.dataset.orientation === \"vertical\";\n const rtl = getComputedStyle(list).direction === \"rtl\";\n const width = vertical ? 2 : target.width / scaleX;\n const height = vertical ? target.height / scaleY : 2;\n const left = (target.left - bounds.left) / scaleX + list.scrollLeft - list.clientLeft;\n const top = (target.top - bounds.top) / scaleY + list.scrollTop - list.clientTop;\n const x = left + (vertical && !rtl ? target.width / scaleX - width : 0);\n const y = top + (vertical ? 0 : target.height / scaleY - height);\n list.style.setProperty(\"--gridui-tab-indicator-offset\", `${x}px, ${y}px`);\n list.style.setProperty(\"--gridui-tab-indicator-width\", `${width}px`);\n list.style.setProperty(\"--gridui-tab-indicator-height\", `${height}px`);\n list.setAttribute(\"data-morph-positioned\", \"\");\n };\n update();\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const resize = new ResizeObserver(update);\n resize.observe(list);\n for (const tab of list.querySelectorAll('[role=\"tab\"]')) {\n resize.observe(tab);\n }\n return () => {\n resize.disconnect();\n };\n });\n};\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsPanel\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsPanelStyles = cva(\"gridui-u-tabs--min-w-0 gridui-u-tabs--flex-1 gridui-u-tabs--p-gridui-16 gridui-u-tabs--hidden:hidden\", {\n variants: {\n appearance: {\n indicator: \"\",\n connected: \"gridui-u-tabs--bg-background\",\n },\n },\n defaultVariants: { appearance: \"indicator\" },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsPanel\n * @description Tabs Panel\n */\n\nimport { TabsContext } from \"../shared/context\";\nimport { tabsPanelStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { LayoutMotion, Presence } from \"@gridui/motion\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useContext } from \"react\";\n\nexport type TabsPanelProps = Omit<ComponentPropsWithRef<typeof Primitive.Content>, \"forceMount\"> & {\n readonly keepMounted?: boolean | undefined;\n readonly motion?: boolean | undefined;\n};\n\nexport const TabsPanel: FC<TabsPanelProps> = (props: TabsPanelProps) => {\n const { className, keepMounted, motion = false, ...restProps } = props;\n const context = useContext(TabsContext);\n const hidden = context?.value !== restProps.value;\n if (motion) {\n if (restProps.asChild) {throw new TypeError(\"TabsPanel motion owns its panel element; asChild is not supported.\");}\n const { children, ...panelProps } = restProps;\n return <Presence mode=\"popLayout\">\n {(!hidden || keepMounted) && <Primitive.Content\n {...panelProps}\n key={restProps.value}\n forceMount\n asChild\n hidden={keepMounted ? hidden : false}\n data-appearance={context?.appearance ?? \"indicator\"}\n className={cn(tabsPanelStyles({ appearance: context?.appearance }), className)}\n >\n <LayoutMotion layout={false} enter={{ opacity: 0 }} exit={{ opacity: 0 }}>\n {children}\n </LayoutMotion>\n </Primitive.Content>}\n </Presence>;\n }\n return (<Primitive.Content\n {...restProps}\n forceMount={keepMounted ? true : undefined}\n hidden={hidden}\n data-appearance={context?.appearance ?? \"indicator\"}\n className={cn(tabsPanelStyles({ appearance: context?.appearance }), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsTab\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const tabsTabStyles = cva(\"gridui-tabs-tab gridui-u-tabs--min-h-11 gridui-u-tabs--shrink-0 gridui-u-tabs--cursor-pointer gridui-u-tabs--px-gridui-16 gridui-u-tabs--py-gridui-8 gridui-u-tabs--text-muted gridui-u-tabs--type-ui gridui-u-tabs--data-[state=active]:text-foreground gridui-u-tabs--data-[state=active]:font-medium gridui-u-tabs--data-disabled:cursor-not-allowed gridui-u-tabs--data-disabled:opacity-50\", {\n variants: {\n layout: {\n standard: \"\",\n cells: \"gridui-u-tabs--w-full gridui-u-tabs--min-w-0 gridui-u-tabs--whitespace-normal gridui-u-tabs--wrap-anywhere gridui-u-tabs--px-gridui-8 gridui-u-tabs--py-gridui-16 gridui-u-tabs--text-center gridui-u-tabs--text-foreground\",\n },\n },\n defaultVariants: { layout: \"standard\" },\n});\n", "/**\n * @author WMXPY\n * @package Tabs\n * @namespace TabsTab\n * @description Tabs Tab\n */\n\nimport { TabsContext, TabsListContext } from \"../shared/context\";\nimport { tabsTabStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-tabs\";\nimport { type ComponentPropsWithRef, type FC, useContext, useRef } from \"react\";\n\nexport type TabsTabProps = ComponentPropsWithRef<typeof Primitive.Trigger>;\n\nexport const TabsTab: FC<TabsTabProps> = (props: TabsTabProps) => {\n const { className, disabled, onMouseDown, onKeyDown, onFocus, onClick, onBlur, ...restProps } = props;\n const context = useContext(TabsContext);\n const list = useContext(TabsListContext);\n const pointerActivated = useRef(false);\n const select = (event: Event) => {\n if (!disabled) {\n context?.change(props.value, event);\n }\n };\n return (<Primitive.Trigger\n {...restProps}\n aria-disabled={disabled}\n data-disabled={disabled ? \"\" : undefined}\n data-gridui-tab={props.value}\n data-appearance={context?.appearance ?? \"indicator\"}\n data-layout={list.layout}\n className={cn(tabsTabStyles({ layout: list.layout }), className)}\n onMouseDown={(event) => {\n onMouseDown?.(event);\n pointerActivated.current = !event.defaultPrevented && event.button === 0;\n if (pointerActivated.current) {\n select(event.nativeEvent);\n }\n }}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && (event.detail === 0 || !pointerActivated.current)) {\n select(event.nativeEvent);\n }\n pointerActivated.current = false;\n }}\n onKeyDown={(event) => {\n pointerActivated.current = false;\n onKeyDown?.(event);\n if (!event.defaultPrevented && (event.key === \"Enter\" || event.key === \" \")) {\n select(event.nativeEvent); event.preventDefault();\n }\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (list.activateOnFocus && !event.defaultPrevented && !pointerActivated.current) {\n select(event.nativeEvent);\n }\n }}\n onBlur={(event) => {\n pointerActivated.current = false;\n onBlur?.(event);\n }}\n />);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,qBAAqB;AAIvB,IAAM,cAAc,cAIjB,IAAI;AAEP,IAAM,kBAAkB,cAG5B;AAAA,EACC,iBAAiB;AAAA,EACjB,QAAQ;AACZ,CAAC;;;AChBD,SAAS,WAAW;AAEb,IAAM,aAAa,IAAI,0HAA0H;AAAA,EACpJ,UAAU;AAAA,IACN,YAAY;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,IACf;AAAA,EACJ;AAAA,EACA,iBAAiB,EAAE,YAAY,YAAY;AAC/C,CAAC;;;ACRD,SAA6B,qBAAqB;AAClD,SAAS,UAAU;AACnB,YAAY,eAAe;AAC3B,SAA8C,aAAa,WAAW,gBAAgB,qBAAqB,QAAQ,gBAAgB;AAgF3H;AAvED,IAAM,OAAsB,CAAC,UAAqB;AACrD,QAAM,EAAE,WAAW,aAAa,aAAa,OAAO,eAAe,MAAM,eAAe,KAAK,GAAG,UAAU,IAAI;AAC9G,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAAS,YAAY;AACzB,QAAM,OAAO,OAAuB,IAAI;AACxC,QAAM,UAAU,UAAU,SAAY,QAAQ;AAC9C,sBAAoB,KAAK,MAAM;AAC3B,WAAO,KAAK;AAAA,EAChB,CAAC;AACD,QAAM,SAAS,YAAY,CAAC,MAAc,UAAiB;AACvD,QAAI,SAAS,SAAS;AAClB;AAAA,IACJ;AACA,UAAM,UAAU,cAAc,KAAK;AACnC,oBAAgB,MAAM,OAAO;AAC7B,QAAI,CAAC,QAAQ,cAAc,UAAU,QAAW;AAC5C,eAAS,IAAI;AAAA,IACjB;AAAA,EACJ,GAAG;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAC;AACD,QAAM,YAAY,eAAe,MAAM;AACnC,UAAM,UAAU,KAAK;AACrB,QAA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QAAQ,MAAM;AACzE,iBAAO,MAAM,WAAW;AAAG,gBAAM,eAAe;AAAA,QACpD;AAAA,MACJ;AAAA,MACA,SAAS,CAAC,UAAU;AAChB,kBAAU,KAAK;AACf,YAAI,KAAK,mBAAmB,CAAC,MAAM,oBAAoB,CAAC,iBAAiB,SAAS;AAC9E,iBAAO,MAAM,WAAW;AAAA,QAC5B;AAAA,MACJ;AAAA,MACA,QAAQ,CAAC,UAAU;AACf,yBAAiB,UAAU;AAC3B,iBAAS,KAAK;AAAA,MAClB;AAAA;AAAA,EACJ;AACJ;",
6
6
  "names": ["cva", "cn", "Primitive", "useImperativeHandle", "useRef", "jsx", "cva", "cn", "Primitive", "useContext", "jsx", "cva", "cn", "Primitive", "useContext", "useRef", "jsx"]
7
7
  }
package/dist/styled.js ADDED
@@ -0,0 +1,3 @@
1
+ import "@gridui/overlay/styled";
2
+ import "./styles.local.css";
3
+ export * from "./index.js";
package/dist/styles.css CHANGED
@@ -1,3 +1,195 @@
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer theme, base, components, utilities;
4
+ @layer theme {
5
+ :root, :host {
6
+ --spacing: 0.25rem;
7
+ }
8
+ }
9
+ @layer utilities {
10
+ .gridui-u-overlay--z-\(--gridui-z-popover\) {
11
+ z-index: var(--gridui-z-popover);
12
+ }
13
+ .gridui-u-overlay--flex {
14
+ display: flex;
15
+ }
16
+ .gridui-u-overlay--inline-flex {
17
+ display: inline-flex;
18
+ }
19
+ .gridui-u-overlay--size-gridui-16 {
20
+ width: var(--gridui-space-16);
21
+ height: var(--gridui-space-16);
22
+ }
23
+ .gridui-u-overlay--min-h-10 {
24
+ min-height: calc(var(--spacing) * 10);
25
+ }
26
+ .gridui-u-overlay--min-w-0 {
27
+ min-width: 0px;
28
+ }
29
+ .gridui-u-overlay--shrink-0 {
30
+ flex-shrink: 0;
31
+ }
32
+ .gridui-u-overlay--cursor-pointer {
33
+ cursor: pointer;
34
+ }
35
+ .gridui-u-overlay--items-center {
36
+ align-items: center;
37
+ }
38
+ .gridui-u-overlay--justify-center {
39
+ justify-content: center;
40
+ }
41
+ .gridui-u-overlay--gap-gridui-8 {
42
+ gap: var(--gridui-space-8);
43
+ }
44
+ .gridui-u-overlay--rounded-control {
45
+ border-radius: var(--gridui-control-radius);
46
+ }
47
+ .gridui-u-overlay--border {
48
+ border-style: var(--tw-border-style);
49
+ border-width: 1px;
50
+ }
51
+ .gridui-u-overlay--border-solid {
52
+ --tw-border-style: solid;
53
+ border-style: solid;
54
+ }
55
+ .gridui-u-overlay--border-border {
56
+ border-color: var(--gridui-border);
57
+ }
58
+ .gridui-u-overlay--bg-background {
59
+ background-color: var(--gridui-background);
60
+ }
61
+ .gridui-u-overlay--p-0 {
62
+ padding: 0px;
63
+ }
64
+ .gridui-u-overlay--p-gridui-8 {
65
+ padding: var(--gridui-space-8);
66
+ }
67
+ .gridui-u-overlay--px-gridui-8 {
68
+ padding-inline: var(--gridui-space-8);
69
+ }
70
+ .gridui-u-overlay--py-gridui-8 {
71
+ padding-block: var(--gridui-space-8);
72
+ }
73
+ .gridui-u-overlay--type-data {
74
+ font: var(--gridui-type-data);
75
+ font-family: var(--gridui-font-body);
76
+ letter-spacing: normal;
77
+ font-variant-numeric: tabular-nums;
78
+ }
79
+ .gridui-u-overlay--type-caption {
80
+ font: var(--gridui-type-caption);
81
+ font-family: var(--gridui-font-body);
82
+ letter-spacing: normal;
83
+ }
84
+ .gridui-u-overlay--wrap-anywhere {
85
+ overflow-wrap: anywhere;
86
+ }
87
+ .gridui-u-overlay--whitespace-normal {
88
+ white-space: normal;
89
+ }
90
+ .gridui-u-overlay--text-foreground {
91
+ color: var(--gridui-foreground);
92
+ }
93
+ .gridui-u-overlay--text-inherit {
94
+ color: inherit;
95
+ }
96
+ .gridui-u-overlay--text-muted {
97
+ color: var(--gridui-muted);
98
+ }
99
+ .gridui-u-overlay--no-underline {
100
+ text-decoration-line: none;
101
+ }
102
+ .gridui-u-overlay--aria-selected\:bg-selection-background[aria-selected="true"] {
103
+ background-color: var(--gridui-selection-background);
104
+ }
105
+ .gridui-u-overlay--aria-\[current\=page\]\:bg-selection-background[aria-current="page"] {
106
+ background-color: var(--gridui-selection-background);
107
+ }
108
+ .gridui-u-overlay--data-disabled\:pointer-events-none[data-disabled] {
109
+ pointer-events: none;
110
+ }
111
+ .gridui-u-overlay--data-disabled\:opacity-50[data-disabled] {
112
+ opacity: 50%;
113
+ }
114
+ .gridui-u-overlay--data-\[state\=checked\]\:bg-selection-background[data-state="checked"] {
115
+ background-color: var(--gridui-selection-background);
116
+ }
117
+ }
118
+ @layer components {
119
+ .gridui-overlay-surface {
120
+ --gridui-surface-offset-x: 0px;
121
+ --gridui-surface-offset-y: 0px;
122
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
123
+ --gridui-overlay-fill-mode: both;
124
+ transform-origin: var(--gridui-overlay-origin, center);
125
+ }
126
+ .gridui-overlay-dialog {
127
+ --gridui-overlay-fill-mode: none;
128
+ transform-origin: center;
129
+ }
130
+ .gridui-overlay-tooltip {
131
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-quick);
132
+ }
133
+ .gridui-overlay-floating[data-side="bottom"] {
134
+ --gridui-surface-offset-y: calc(-1 * var(--gridui-motion-distance));
135
+ }
136
+ .gridui-overlay-floating[data-side="top"] {
137
+ --gridui-surface-offset-y: var(--gridui-motion-distance);
138
+ }
139
+ .gridui-overlay-floating[data-side="left"] {
140
+ --gridui-surface-offset-x: var(--gridui-motion-distance);
141
+ }
142
+ .gridui-overlay-floating[data-side="right"] {
143
+ --gridui-surface-offset-x: calc(-1 * var(--gridui-motion-distance));
144
+ }
145
+ .gridui-overlay-surface[data-state="closed"] {
146
+ pointer-events: none;
147
+ }
148
+ .gridui-overlay-surface:not([data-side="none"]):is([data-state="open"], [data-state="delayed-open"], [data-state="instant-open"]) {
149
+ animation: var(--gridui-motion-animation, gridui-surface-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
150
+ }
151
+ .gridui-overlay-surface:not([data-side="none"])[data-state="closed"] {
152
+ animation: var(--gridui-motion-animation, gridui-surface-exit calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
153
+ }
154
+ .gridui-overlay-backdrop {
155
+ background: var(--gridui-backdrop);
156
+ @supports (color: color-mix(in lab, red, red)) {
157
+ background: color-mix(in srgb, var(--gridui-backdrop) var(--gridui-backdrop-opacity), transparent);
158
+ }
159
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
160
+ --gridui-overlay-exit-duration: var(--gridui-motion-duration-quick);
161
+ --gridui-overlay-fill-mode: none;
162
+ }
163
+ .gridui-overlay-backdrop-deliberate {
164
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-deliberate);
165
+ --gridui-overlay-exit-duration: var(--gridui-motion-duration-normal);
166
+ --gridui-overlay-fill-mode: both;
167
+ }
168
+ .gridui-overlay-backdrop[data-state="open"] {
169
+ animation: var(--gridui-motion-animation, gridui-fade-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
170
+ }
171
+ .gridui-overlay-backdrop[data-state="closed"] {
172
+ animation: var(--gridui-motion-animation, gridui-fade-exit calc(var(--gridui-overlay-exit-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
173
+ }
174
+ @media (prefers-reduced-motion: reduce) {
175
+ .gridui-overlay-surface:not([data-side="none"])[data-state], .gridui-overlay-backdrop[data-state] {
176
+ animation: none;
177
+ }
178
+ }
179
+ }
180
+ @property --tw-border-style {
181
+ syntax: "*";
182
+ inherits: false;
183
+ initial-value: solid;
184
+ }
185
+ @layer properties {
186
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
187
+ *, ::before, ::after, ::backdrop {
188
+ --tw-border-style: solid;
189
+ }
190
+ }
191
+ }
192
+
1
193
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
194
  @layer properties;
3
195
  @layer theme, base, components, utilities;
@@ -0,0 +1,266 @@
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer theme, base, components, utilities;
4
+ @layer theme {
5
+ :root, :host {
6
+ --spacing: 0.25rem;
7
+ --font-weight-medium: 500;
8
+ }
9
+ }
10
+ @layer utilities {
11
+ .gridui-u-tabs--flex {
12
+ display: flex;
13
+ }
14
+ .gridui-u-tabs--grid {
15
+ display: grid;
16
+ }
17
+ .gridui-u-tabs--min-h-11 {
18
+ min-height: calc(var(--spacing) * 11);
19
+ }
20
+ .gridui-u-tabs--w-full {
21
+ width: 100%;
22
+ }
23
+ .gridui-u-tabs--min-w-0 {
24
+ min-width: 0px;
25
+ }
26
+ .gridui-u-tabs--flex-1 {
27
+ flex: 1;
28
+ }
29
+ .gridui-u-tabs--shrink-0 {
30
+ flex-shrink: 0;
31
+ }
32
+ .gridui-u-tabs--cursor-pointer {
33
+ cursor: pointer;
34
+ }
35
+ .gridui-u-tabs--auto-cols-fr {
36
+ grid-auto-columns: minmax(0, 1fr);
37
+ }
38
+ .gridui-u-tabs--grid-flow-col {
39
+ grid-auto-flow: column;
40
+ }
41
+ .gridui-u-tabs--flex-col {
42
+ flex-direction: column;
43
+ }
44
+ .gridui-u-tabs--gap-px {
45
+ gap: 1px;
46
+ }
47
+ .gridui-u-tabs--overflow-auto {
48
+ overflow: auto;
49
+ }
50
+ .gridui-u-tabs--overflow-visible {
51
+ overflow: visible;
52
+ }
53
+ .gridui-u-tabs--border {
54
+ border-style: var(--tw-border-style);
55
+ border-width: 1px;
56
+ }
57
+ .gridui-u-tabs--border-0 {
58
+ border-style: var(--tw-border-style);
59
+ border-width: 0px;
60
+ }
61
+ .gridui-u-tabs--border-solid {
62
+ --tw-border-style: solid;
63
+ border-style: solid;
64
+ }
65
+ .gridui-u-tabs--border-border {
66
+ border-color: var(--gridui-border);
67
+ }
68
+ .gridui-u-tabs--bg-background {
69
+ background-color: var(--gridui-background);
70
+ }
71
+ .gridui-u-tabs--bg-border {
72
+ background-color: var(--gridui-border);
73
+ }
74
+ .gridui-u-tabs--bg-none {
75
+ background-image: none;
76
+ }
77
+ .gridui-u-tabs--p-gridui-16 {
78
+ padding: var(--gridui-space-16);
79
+ }
80
+ .gridui-u-tabs--px-gridui-8 {
81
+ padding-inline: var(--gridui-space-8);
82
+ }
83
+ .gridui-u-tabs--px-gridui-16 {
84
+ padding-inline: var(--gridui-space-16);
85
+ }
86
+ .gridui-u-tabs--py-gridui-8 {
87
+ padding-block: var(--gridui-space-8);
88
+ }
89
+ .gridui-u-tabs--py-gridui-16 {
90
+ padding-block: var(--gridui-space-16);
91
+ }
92
+ .gridui-u-tabs--text-center {
93
+ text-align: center;
94
+ }
95
+ .gridui-u-tabs--type-ui {
96
+ font: var(--gridui-type-ui);
97
+ font-family: var(--gridui-font-body);
98
+ letter-spacing: normal;
99
+ }
100
+ .gridui-u-tabs--wrap-anywhere {
101
+ overflow-wrap: anywhere;
102
+ }
103
+ .gridui-u-tabs--whitespace-normal {
104
+ white-space: normal;
105
+ }
106
+ .gridui-u-tabs--text-foreground {
107
+ color: var(--gridui-foreground);
108
+ }
109
+ .gridui-u-tabs--text-muted {
110
+ color: var(--gridui-muted);
111
+ }
112
+ .gridui-u-tabs--data-disabled\:cursor-not-allowed[data-disabled] {
113
+ cursor: not-allowed;
114
+ }
115
+ .gridui-u-tabs--data-disabled\:opacity-50[data-disabled] {
116
+ opacity: 50%;
117
+ }
118
+ .gridui-u-tabs--data-\[orientation\=vertical\]\:grid-flow-row[data-orientation="vertical"] {
119
+ grid-auto-flow: row;
120
+ }
121
+ .gridui-u-tabs--data-\[orientation\=vertical\]\:auto-rows-fr[data-orientation="vertical"] {
122
+ grid-auto-rows: minmax(0, 1fr);
123
+ }
124
+ .gridui-u-tabs--data-\[orientation\=vertical\]\:grid-cols-1[data-orientation="vertical"] {
125
+ grid-template-columns: repeat(1, minmax(0, 1fr));
126
+ }
127
+ .gridui-u-tabs--data-\[orientation\=vertical\]\:flex-col[data-orientation="vertical"] {
128
+ flex-direction: column;
129
+ }
130
+ .gridui-u-tabs--data-\[orientation\=vertical\]\:flex-row[data-orientation="vertical"] {
131
+ flex-direction: row;
132
+ }
133
+ .gridui-u-tabs--data-\[state\=active\]\:font-medium[data-state="active"] {
134
+ --tw-font-weight: var(--font-weight-medium);
135
+ font-weight: var(--font-weight-medium);
136
+ }
137
+ .gridui-u-tabs--data-\[state\=active\]\:text-foreground[data-state="active"] {
138
+ color: var(--gridui-foreground);
139
+ }
140
+ }
141
+ @layer components {
142
+ .gridui-tabs-list {
143
+ background-image: linear-gradient(var(--gridui-border), var(--gridui-border));
144
+ background-position: bottom;
145
+ background-size: 100% 1px;
146
+ background-repeat: no-repeat;
147
+ }
148
+ .gridui-tabs-list[data-orientation="vertical"] {
149
+ background-position: right;
150
+ background-size: 1px 100%;
151
+ &:dir(rtl) {
152
+ background-position: left;
153
+ }
154
+ }
155
+ .gridui-tabs-list[data-morph] {
156
+ position: relative;
157
+ }
158
+ .gridui-tabs-list[data-morph][data-morph-positioned]::after {
159
+ position: absolute;
160
+ z-index: 1;
161
+ top: 0;
162
+ left: 0;
163
+ width: var(--gridui-tab-indicator-width);
164
+ height: var(--gridui-tab-indicator-height);
165
+ background: var(--gridui-selection-indicator);
166
+ content: "";
167
+ pointer-events: none;
168
+ transform: translate(var(--gridui-tab-indicator-offset));
169
+ transition: var(--gridui-motion-transition, transform calc(var(--gridui-motion-duration-normal) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out), width calc(var(--gridui-motion-duration-normal) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out), height calc(var(--gridui-motion-duration-normal) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out));
170
+ }
171
+ @media (forced-colors: active) {
172
+ .gridui-tabs-list[data-morph][data-morph-positioned]::after {
173
+ forced-color-adjust: none;
174
+ background: Highlight;
175
+ }
176
+ }
177
+ @media (prefers-reduced-motion: reduce) {
178
+ .gridui-tabs-list[data-morph][data-morph-positioned]::after {
179
+ transition: none;
180
+ }
181
+ }
182
+ .gridui-tabs-tab {
183
+ position: relative;
184
+ border: 0 solid transparent;
185
+ border-block-end-width: 2px;
186
+ background: transparent;
187
+ background-clip: padding-box;
188
+ &[data-layout="cells"] {
189
+ background-color: var(--gridui-background);
190
+ }
191
+ &[data-orientation="vertical"] {
192
+ border-block-end-width: 0;
193
+ border-inline-end-width: 2px;
194
+ }
195
+ &[data-appearance="indicator"][data-state="active"] {
196
+ border-block-end-color: var(--gridui-selection-indicator);
197
+ background-color: var(--gridui-selection-background);
198
+ &[data-orientation="vertical"] {
199
+ border-inline-end-color: var(--gridui-selection-indicator);
200
+ }
201
+ }
202
+ &[data-appearance="connected"] {
203
+ border-width: 0;
204
+ background-color: var(--gridui-surface);
205
+ &::after {
206
+ position: absolute;
207
+ inset: 0;
208
+ border: 0 solid var(--gridui-border);
209
+ border-block-end-width: 1px;
210
+ content: "";
211
+ pointer-events: none;
212
+ }
213
+ &[data-orientation="vertical"]::after {
214
+ border-block-end-width: 0;
215
+ border-inline-end-width: 1px;
216
+ }
217
+ &[data-state="active"] {
218
+ background-color: var(--gridui-background);
219
+ &::after {
220
+ border-width: 2px;
221
+ border-color: var(--gridui-selection-indicator);
222
+ border-block-end-width: 0;
223
+ }
224
+ &[data-orientation="vertical"]::after {
225
+ border-block-end-width: 2px;
226
+ border-inline-end-width: 0;
227
+ }
228
+ }
229
+ }
230
+ }
231
+ .gridui-tabs-list[data-morph][data-morph-positioned] > .gridui-tabs-tab[data-appearance="indicator"][data-state="active"] {
232
+ border-color: transparent;
233
+ }
234
+ @media (forced-colors: active) {
235
+ .gridui-tabs-tab {
236
+ --gridui-background: Canvas;
237
+ --gridui-surface: Canvas;
238
+ --gridui-selection-background: Canvas;
239
+ --gridui-border: CanvasText;
240
+ --gridui-selection-indicator: Highlight;
241
+ &[data-state="inactive"] {
242
+ border-color: Canvas;
243
+ }
244
+ }
245
+ .gridui-tabs-list[data-morph][data-morph-positioned] > .gridui-tabs-tab[data-appearance="indicator"][data-state="active"] {
246
+ border-color: Canvas;
247
+ }
248
+ }
249
+ }
250
+ @property --tw-border-style {
251
+ syntax: "*";
252
+ inherits: false;
253
+ initial-value: solid;
254
+ }
255
+ @property --tw-font-weight {
256
+ syntax: "*";
257
+ inherits: false;
258
+ }
259
+ @layer properties {
260
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
261
+ *, ::before, ::after, ::backdrop {
262
+ --tw-border-style: solid;
263
+ --tw-font-weight: initial;
264
+ }
265
+ }
266
+ }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Tabs
4
+ * @namespace TabsList
5
+ * @description Tabs List
6
+ */
1
7
  import * as Primitive from "@radix-ui/react-tabs";
2
8
  import { type ComponentPropsWithRef, type FC } from "react";
3
9
  export type TabsListProps = Omit<ComponentPropsWithRef<typeof Primitive.List>, "loop"> & {
package/docs/catalog.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/tabs",
4
- "version": "3.0.0",
4
+ "version": "3.1.0",
5
5
  "category": "core",
6
6
  "description": "GridUI React tabs",
7
7
  "usage": "Removing the selected uncontrolled tab requests the first enabled tab in the current Tabs root; nested Tabs do not participate. Controlled selection remains owned by the caller, and change requests remain cancellable. One pointer gesture requests a change once, including when the caller cancels or rejects it.",
@@ -60,6 +60,7 @@
60
60
  "@gridui/overlay/styles.css",
61
61
  "@gridui/tabs/styles.css"
62
62
  ],
63
+ "styledImport": "@gridui/tabs/styled",
63
64
  "examples": [
64
65
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tabs/stories/content-panels.mdx",
65
66
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tabs/stories/framed-tabs.mdx",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/tabs",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "GridUI React tabs",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -10,14 +10,19 @@
10
10
  "docs"
11
11
  ],
12
12
  "sideEffects": [
13
- "**/*.css"
13
+ "**/*.css",
14
+ "./dist/styled.js"
14
15
  ],
15
16
  "exports": {
16
17
  ".": {
17
18
  "types": "./dist/index.d.ts",
18
19
  "import": "./dist/index.js"
19
20
  },
20
- "./styles.css": "./dist/styles.css"
21
+ "./styles.css": "./dist/styles.css",
22
+ "./styled": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/styled.js"
25
+ }
21
26
  },
22
27
  "publishConfig": {
23
28
  "access": "public"
@@ -27,17 +32,17 @@
27
32
  "react-dom": "^19.2.0"
28
33
  },
29
34
  "dependencies": {
30
- "@gridui/interaction": "^1.2.1",
31
- "@gridui/motion": "^1.0.1",
32
- "@gridui/overlay": "^2.3.0",
35
+ "@gridui/interaction": "^1.3.0",
36
+ "@gridui/motion": "^1.0.2",
37
+ "@gridui/overlay": "^2.4.0",
33
38
  "@gridui/style-utils": "^4.0.0",
34
- "@gridui/theme": "^3.0.0",
39
+ "@gridui/theme": "^4.0.0",
35
40
  "@radix-ui/react-tabs": "1.2.1",
36
41
  "class-variance-authority": "0.7.1"
37
42
  },
38
43
  "devDependencies": {
39
44
  "@gridui-internal/configuration": "0.0.0-internal",
40
- "@gridui/button": "5.1.0",
45
+ "@gridui/button": "5.2.0",
41
46
  "@jest/globals": "30.5.2",
42
47
  "@storybook/react-vite": "10.6.7",
43
48
  "@types/jest": "30.0.0",