@gridui/tabs 3.0.0 → 4.0.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 +23 -6
- package/dist/index.js +6 -6
- package/dist/index.js.map +2 -2
- package/dist/shared/context.d.ts +2 -0
- package/dist/styled.js +3 -0
- package/dist/styles.css +217 -13
- package/dist/styles.local.css +273 -0
- package/dist/tabs/tabs.d.ts +2 -0
- package/dist/tabs-list/tabs-list.d.ts +6 -2
- package/dist/tabs-tab/tabs-tab.d.ts +4 -1
- package/docs/catalog.json +7 -6
- package/docs/reference/tabs-list.md +2 -10
- package/docs/reference/tabs-panel.md +2 -2
- package/docs/reference/tabs-tab.md +10 -2
- package/docs/reference/tabs.md +10 -2
- package/package.json +14 -9
package/README.md
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
# @gridui/tabs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Navigation 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
|
-
|
|
6
|
+
Applications own routes, labels, state persistence, and branding.
|
|
7
|
+
|
|
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-navigation/tabs/.changeset/history).
|
|
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.
|
|
7
18
|
|
|
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
19
|
|
|
10
20
|
## Selection and native props
|
|
11
21
|
|
|
@@ -23,7 +33,7 @@ GridUI props when adopting the next major version.
|
|
|
23
33
|
## Appearance and interaction
|
|
24
34
|
|
|
25
35
|
`Tabs appearance="indicator"` is the default. A persistent two-pixel selection
|
|
26
|
-
line accompanies the
|
|
36
|
+
line accompanies the selection surface: below horizontal tabs and on the
|
|
27
37
|
panel-facing edge of vertical tabs. That edge follows text direction.
|
|
28
38
|
|
|
29
39
|
`Tabs appearance="connected"` puts the list and panels inside one frame. The
|
|
@@ -35,7 +45,7 @@ connection. Both appearances support `standard` and `cells` list layouts.
|
|
|
35
45
|
Set `morph` on `TabsList` to move and resize the indicator between selections.
|
|
36
46
|
It applies only to `appearance="indicator"`; connected outlines remain static.
|
|
37
47
|
The static selection line remains visible until the moving indicator is ready.
|
|
38
|
-
|
|
48
|
+
The indicator always settles immediately
|
|
39
49
|
when the system requests reduced motion. Appearance changes preserve selection
|
|
40
50
|
and retained panels.
|
|
41
51
|
|
|
@@ -99,10 +109,17 @@ Import MotionConfig from `@gridui/motion` and the Tabs parts from `@gridui/tabs`
|
|
|
99
109
|
|
|
100
110
|
Shared animation policy and tempo come from `MotionConfig` in `@gridui/motion`.
|
|
101
111
|
Disabled or reduced-motion policy settles decoration without disabling interaction.
|
|
102
|
-
See the [motion guide](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-
|
|
112
|
+
See the [motion guide](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-foundation/motion)
|
|
103
113
|
for CSS scopes, portal behavior, and specialized timing contracts.
|
|
104
114
|
|
|
105
115
|
For panels with different natural heights, wrap the sibling TabsPanels in one
|
|
106
116
|
`MotionSize` from `@gridui/motion`. Its inner measurement wrapper follows the active
|
|
107
117
|
content while selection, keyboard behavior and keepMounted state remain with Tabs.
|
|
108
118
|
The `AnimatedPanels` Storybook example demonstrates this composition.
|
|
119
|
+
|
|
120
|
+
## Sizing and density
|
|
121
|
+
|
|
122
|
+
Tabs size small, medium (default) or large supplies TabsTab defaults; an explicit tab size wins. Both ordinary and cells layouts use the control recipe. TabsPanel padding and content typography remain independent, and live changes remeasure the indicator.
|
|
123
|
+
|
|
124
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
125
|
+
for native attributes, scope precedence, tokens and target behavior.
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import * as Primitive from "@radix-ui/react-tabs";
|
|
|
25
25
|
import { useCallback, useEffect, useEffectEvent, useImperativeHandle, useRef, useState } from "react";
|
|
26
26
|
import { jsx } from "react/jsx-runtime";
|
|
27
27
|
var Tabs = (props) => {
|
|
28
|
-
const { className, appearance = "indicator", value, defaultValue = null, onValueChange, ref, ...restProps } = props;
|
|
28
|
+
const { className, size = "medium", appearance = "indicator", value, defaultValue = null, onValueChange, ref, ...restProps } = props;
|
|
29
29
|
const [
|
|
30
30
|
local,
|
|
31
31
|
setLocal
|
|
@@ -92,6 +92,7 @@ var Tabs = (props) => {
|
|
|
92
92
|
TabsContext.Provider,
|
|
93
93
|
{
|
|
94
94
|
value: {
|
|
95
|
+
size,
|
|
95
96
|
appearance,
|
|
96
97
|
value: current,
|
|
97
98
|
change
|
|
@@ -219,10 +220,8 @@ var TabsList = (props) => {
|
|
|
219
220
|
loopFocus = true,
|
|
220
221
|
layout = "standard",
|
|
221
222
|
morph = false,
|
|
222
|
-
respectReducedMotion: _respectReducedMotion = true,
|
|
223
223
|
...restProps
|
|
224
224
|
} = props;
|
|
225
|
-
void _respectReducedMotion;
|
|
226
225
|
const appearance = useContext(TabsContext)?.appearance ?? "indicator";
|
|
227
226
|
const animated = morph && appearance === "indicator";
|
|
228
227
|
const viewport = useRef2(null);
|
|
@@ -318,11 +317,11 @@ var TabsPanel = (props) => {
|
|
|
318
317
|
|
|
319
318
|
// src/tabs-tab/style.ts
|
|
320
319
|
import { cva as cva4 } from "class-variance-authority";
|
|
321
|
-
var tabsTabStyles = cva4("gridui-tabs-tab gridui-u-tabs--min-h-
|
|
320
|
+
var tabsTabStyles = cva4("gridui-tabs-tab gridui-u-tabs--min-h-(--gridui-tab-min) gridui-u-tabs--shrink-0 gridui-u-tabs--cursor-pointer gridui-u-tabs--px-(--gridui-tab-inline) gridui-u-tabs--py-(--gridui-tab-block) 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", {
|
|
322
321
|
variants: {
|
|
323
322
|
layout: {
|
|
324
323
|
standard: "",
|
|
325
|
-
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-
|
|
324
|
+
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-tab-inline) gridui-u-tabs--py-(--gridui-tab-block) gridui-u-tabs--text-center gridui-u-tabs--text-foreground"
|
|
326
325
|
}
|
|
327
326
|
},
|
|
328
327
|
defaultVariants: { layout: "standard" }
|
|
@@ -334,8 +333,8 @@ import * as Primitive4 from "@radix-ui/react-tabs";
|
|
|
334
333
|
import { useContext as useContext3, useRef as useRef3 } from "react";
|
|
335
334
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
336
335
|
var TabsTab = (props) => {
|
|
337
|
-
const { className, disabled, onMouseDown, onKeyDown, onFocus, onClick, onBlur, ...restProps } = props;
|
|
338
336
|
const context = useContext3(TabsContext);
|
|
337
|
+
const { className, size = context?.size ?? "medium", disabled, onMouseDown, onKeyDown, onFocus, onClick, onBlur, ...restProps } = props;
|
|
339
338
|
const list = useContext3(TabsListContext);
|
|
340
339
|
const pointerActivated = useRef3(false);
|
|
341
340
|
const select = (event) => {
|
|
@@ -352,6 +351,7 @@ var TabsTab = (props) => {
|
|
|
352
351
|
"data-gridui-tab": props.value,
|
|
353
352
|
"data-appearance": context?.appearance ?? "indicator",
|
|
354
353
|
"data-layout": list.layout,
|
|
354
|
+
"data-size": size,
|
|
355
355
|
className: cn4(tabsTabStyles({ layout: list.layout }), className),
|
|
356
356
|
onMouseDown: (event) => {
|
|
357
357
|
onMouseDown?.(event);
|
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": ";
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Tabs\n * @namespace Shared\n * @description Context\n */\n\nimport type { Size } from \"@gridui/theme\";\nimport { createContext } from \"react\";\n\nexport type TabsAppearance = \"indicator\" | \"connected\";\n\nexport const TabsContext = createContext<{\n size: Size;\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 { Size } from \"@gridui/theme\";\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 size?: Size;\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, size = \"medium\", 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 size,\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};\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, ...restProps } = props;\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-(--gridui-tab-min) gridui-u-tabs--shrink-0 gridui-u-tabs--cursor-pointer gridui-u-tabs--px-(--gridui-tab-inline) gridui-u-tabs--py-(--gridui-tab-block) 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-tab-inline) gridui-u-tabs--py-(--gridui-tab-block) 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 type { Size } from \"@gridui/theme\";\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> & { readonly size?: Size };\n\nexport const TabsTab: FC<TabsTabProps> = (props: TabsTabProps) => {\n const context = useContext(TabsContext);\n const { className, size = context?.size ?? \"medium\", disabled, onMouseDown, onKeyDown, onFocus, onClick, onBlur, ...restProps } = props;\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 data-size={size}\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": ";AAQA,SAAS,qBAAqB;AAIvB,IAAM,cAAc,cAKjB,IAAI;AAEP,IAAM,kBAAkB,cAG5B;AAAA,EACC,iBAAiB;AAAA,EACjB,QAAQ;AACZ,CAAC;;;AClBD,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;;;ACPD,SAA6B,qBAAqB;AAClD,SAAS,UAAU;AACnB,YAAY,eAAe;AAC3B,SAA8C,aAAa,WAAW,gBAAgB,qBAAqB,QAAQ,gBAAg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f,iBAAe,WAAW,KAAK;AAAA,MAC/B,mBAAiB,MAAM;AAAA,MACvB,mBAAiB,SAAS,cAAc;AAAA,MACxC,eAAa,KAAK;AAAA,MAClB,aAAW;AAAA,MACX,WAAWJ,IAAG,cAAc,EAAE,QAAQ,KAAK,OAAO,CAAC,GAAG,SAAS;AAAA,MAC/D,aAAa,CAAC,UAAU;AACpB,sBAAc,KAAK;AACnB,yBAAiB,UAAU,CAAC,MAAM,oBAAoB,MAAM,WAAW;AACvE,YAAI,iBAAiB,SAAS;AAC1B,iBAAO,MAAM,WAAW;AAAA,QAC5B;AAAA,MACJ;AAAA,MACA,SAAS,CAAC,UAAU;AAChB,kBAAU,KAAK;AACf,YAAI,CAAC,MAAM,qBAAqB,MAAM,WAAW,KAAK,CAAC,iBAAiB,UAAU;AAC9E,iBAAO,MAAM,WAAW;AAAA,QAC5B;AACA,yBAAiB,UAAU;AAAA,MAC/B;AAAA,MACA,WAAW,CAAC,UAAU;AAClB,yBAAiB,UAAU;AAC3B,oBAAY,KAAK;AACjB,YAAI,CAAC,MAAM,qBAAqB,MAAM,QAAQ,WAAW,MAAM,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/shared/context.d.ts
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* @namespace Shared
|
|
5
5
|
* @description Context
|
|
6
6
|
*/
|
|
7
|
+
import type { Size } from "@gridui/theme";
|
|
7
8
|
export type TabsAppearance = "indicator" | "connected";
|
|
8
9
|
export declare const TabsContext: import("react").Context<{
|
|
10
|
+
size: Size;
|
|
9
11
|
appearance: TabsAppearance;
|
|
10
12
|
value: string | null;
|
|
11
13
|
change: (value: string, event: Event) => void;
|
package/dist/styled.js
ADDED
package/dist/styles.css
CHANGED
|
@@ -1,9 +1,205 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer utilities {
|
|
5
|
+
.gridui-u-overlay--z-\(--gridui-z-popover\) {
|
|
6
|
+
z-index: var(--gridui-z-popover);
|
|
7
|
+
}
|
|
8
|
+
.gridui-u-overlay--flex {
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
11
|
+
.gridui-u-overlay--inline-flex {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
}
|
|
14
|
+
.gridui-u-overlay--size-gridui-16 {
|
|
15
|
+
width: var(--gridui-space-16);
|
|
16
|
+
height: var(--gridui-space-16);
|
|
17
|
+
}
|
|
18
|
+
.gridui-u-overlay--min-w-0 {
|
|
19
|
+
min-width: 0px;
|
|
20
|
+
}
|
|
21
|
+
.gridui-u-overlay--shrink-0 {
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
}
|
|
24
|
+
.gridui-u-overlay--cursor-pointer {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
.gridui-u-overlay--items-center {
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
.gridui-u-overlay--justify-center {
|
|
31
|
+
justify-content: center;
|
|
32
|
+
}
|
|
33
|
+
.gridui-u-overlay--gap-gridui-8 {
|
|
34
|
+
gap: var(--gridui-space-8);
|
|
35
|
+
}
|
|
36
|
+
.gridui-u-overlay--rounded-control {
|
|
37
|
+
border-radius: var(--gridui-control-radius);
|
|
38
|
+
}
|
|
39
|
+
.gridui-u-overlay--border {
|
|
40
|
+
border-style: var(--tw-border-style);
|
|
41
|
+
border-width: 1px;
|
|
42
|
+
}
|
|
43
|
+
.gridui-u-overlay--border-solid {
|
|
44
|
+
--tw-border-style: solid;
|
|
45
|
+
border-style: solid;
|
|
46
|
+
}
|
|
47
|
+
.gridui-u-overlay--border-border {
|
|
48
|
+
border-color: var(--gridui-border);
|
|
49
|
+
}
|
|
50
|
+
.gridui-u-overlay--bg-background {
|
|
51
|
+
background-color: var(--gridui-background);
|
|
52
|
+
}
|
|
53
|
+
.gridui-u-overlay--p-0 {
|
|
54
|
+
padding: 0px;
|
|
55
|
+
}
|
|
56
|
+
.gridui-u-overlay--px-gridui-8 {
|
|
57
|
+
padding-inline: var(--gridui-space-8);
|
|
58
|
+
}
|
|
59
|
+
.gridui-u-overlay--type-data {
|
|
60
|
+
font: var(--gridui-type-data);
|
|
61
|
+
font-family: var(--gridui-font-body);
|
|
62
|
+
letter-spacing: normal;
|
|
63
|
+
font-variant-numeric: tabular-nums;
|
|
64
|
+
}
|
|
65
|
+
.gridui-u-overlay--type-caption {
|
|
66
|
+
font: var(--gridui-type-caption);
|
|
67
|
+
font-family: var(--gridui-font-body);
|
|
68
|
+
letter-spacing: normal;
|
|
69
|
+
}
|
|
70
|
+
.gridui-u-overlay--wrap-anywhere {
|
|
71
|
+
overflow-wrap: anywhere;
|
|
72
|
+
}
|
|
73
|
+
.gridui-u-overlay--whitespace-normal {
|
|
74
|
+
white-space: normal;
|
|
75
|
+
}
|
|
76
|
+
.gridui-u-overlay--text-foreground {
|
|
77
|
+
color: var(--gridui-foreground);
|
|
78
|
+
}
|
|
79
|
+
.gridui-u-overlay--text-inherit {
|
|
80
|
+
color: inherit;
|
|
81
|
+
}
|
|
82
|
+
.gridui-u-overlay--text-muted {
|
|
83
|
+
color: var(--gridui-muted);
|
|
84
|
+
}
|
|
85
|
+
.gridui-u-overlay--no-underline {
|
|
86
|
+
text-decoration-line: none;
|
|
87
|
+
}
|
|
88
|
+
.gridui-u-overlay--aria-selected\:bg-selection-background[aria-selected="true"] {
|
|
89
|
+
background-color: var(--gridui-selection-background);
|
|
90
|
+
}
|
|
91
|
+
.gridui-u-overlay--aria-\[current\=page\]\:bg-selection-background[aria-current="page"] {
|
|
92
|
+
background-color: var(--gridui-selection-background);
|
|
93
|
+
}
|
|
94
|
+
.gridui-u-overlay--data-disabled\:pointer-events-none[data-disabled] {
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
}
|
|
97
|
+
.gridui-u-overlay--data-disabled\:opacity-50[data-disabled] {
|
|
98
|
+
opacity: 50%;
|
|
99
|
+
}
|
|
100
|
+
.gridui-u-overlay--data-\[state\=checked\]\:bg-selection-background[data-state="checked"] {
|
|
101
|
+
background-color: var(--gridui-selection-background);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
@layer components {
|
|
105
|
+
.gridui-overlay-surface {
|
|
106
|
+
--gridui-surface-offset-x: 0px;
|
|
107
|
+
--gridui-surface-offset-y: 0px;
|
|
108
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
|
|
109
|
+
--gridui-overlay-fill-mode: both;
|
|
110
|
+
transform-origin: var(--gridui-overlay-origin, center);
|
|
111
|
+
}
|
|
112
|
+
.gridui-overlay-dialog {
|
|
113
|
+
--gridui-overlay-fill-mode: none;
|
|
114
|
+
transform-origin: center;
|
|
115
|
+
}
|
|
116
|
+
.gridui-overlay-tooltip {
|
|
117
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-quick);
|
|
118
|
+
}
|
|
119
|
+
.gridui-overlay-floating[data-side="bottom"] {
|
|
120
|
+
--gridui-surface-offset-y: calc(-1 * var(--gridui-motion-distance));
|
|
121
|
+
}
|
|
122
|
+
.gridui-overlay-floating[data-side="top"] {
|
|
123
|
+
--gridui-surface-offset-y: var(--gridui-motion-distance);
|
|
124
|
+
}
|
|
125
|
+
.gridui-overlay-floating[data-side="left"] {
|
|
126
|
+
--gridui-surface-offset-x: var(--gridui-motion-distance);
|
|
127
|
+
}
|
|
128
|
+
.gridui-overlay-floating[data-side="right"] {
|
|
129
|
+
--gridui-surface-offset-x: calc(-1 * var(--gridui-motion-distance));
|
|
130
|
+
}
|
|
131
|
+
.gridui-overlay-surface[data-state="closed"] {
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
}
|
|
134
|
+
.gridui-overlay-surface:not([data-side="none"]):is([data-state="open"], [data-state="delayed-open"], [data-state="instant-open"]) {
|
|
135
|
+
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));
|
|
136
|
+
}
|
|
137
|
+
.gridui-overlay-surface:not([data-side="none"])[data-state="closed"] {
|
|
138
|
+
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));
|
|
139
|
+
}
|
|
140
|
+
.gridui-overlay-backdrop {
|
|
141
|
+
background: var(--gridui-backdrop);
|
|
142
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
143
|
+
background: color-mix(in srgb, var(--gridui-backdrop) var(--gridui-backdrop-opacity), transparent);
|
|
144
|
+
}
|
|
145
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
|
|
146
|
+
--gridui-overlay-exit-duration: var(--gridui-motion-duration-quick);
|
|
147
|
+
--gridui-overlay-fill-mode: none;
|
|
148
|
+
}
|
|
149
|
+
.gridui-overlay-backdrop-deliberate {
|
|
150
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-deliberate);
|
|
151
|
+
--gridui-overlay-exit-duration: var(--gridui-motion-duration-normal);
|
|
152
|
+
--gridui-overlay-fill-mode: both;
|
|
153
|
+
}
|
|
154
|
+
.gridui-overlay-backdrop[data-state="open"] {
|
|
155
|
+
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));
|
|
156
|
+
}
|
|
157
|
+
.gridui-overlay-backdrop[data-state="closed"] {
|
|
158
|
+
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));
|
|
159
|
+
}
|
|
160
|
+
@media (prefers-reduced-motion: reduce) {
|
|
161
|
+
.gridui-overlay-surface:not([data-side="none"])[data-state], .gridui-overlay-backdrop[data-state] {
|
|
162
|
+
animation: none;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
.gridui-overlay-list {
|
|
166
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
167
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
168
|
+
}
|
|
169
|
+
.gridui-overlay-density-compact {
|
|
170
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-small);
|
|
171
|
+
--gridui-overlay-row-padding: var(--gridui-space-4);
|
|
172
|
+
}
|
|
173
|
+
.gridui-overlay-density-comfortable {
|
|
174
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
175
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
176
|
+
}
|
|
177
|
+
.gridui-overlay-list-item {
|
|
178
|
+
min-block-size: max(var(--gridui-overlay-row-min, var(--gridui-control-min-height-medium)), var(--gridui-target-min-size));
|
|
179
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
180
|
+
}
|
|
181
|
+
.gridui-overlay-list-label {
|
|
182
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
@property --tw-border-style {
|
|
186
|
+
syntax: "*";
|
|
187
|
+
inherits: false;
|
|
188
|
+
initial-value: solid;
|
|
189
|
+
}
|
|
190
|
+
@layer properties {
|
|
191
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
192
|
+
*, ::before, ::after, ::backdrop {
|
|
193
|
+
--tw-border-style: solid;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
1
198
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
199
|
@layer properties;
|
|
3
200
|
@layer theme, base, components, utilities;
|
|
4
201
|
@layer theme {
|
|
5
202
|
:root, :host {
|
|
6
|
-
--spacing: 0.25rem;
|
|
7
203
|
--font-weight-medium: 500;
|
|
8
204
|
}
|
|
9
205
|
}
|
|
@@ -14,8 +210,8 @@
|
|
|
14
210
|
.gridui-u-tabs--grid {
|
|
15
211
|
display: grid;
|
|
16
212
|
}
|
|
17
|
-
.gridui-u-tabs--min-h-
|
|
18
|
-
min-height:
|
|
213
|
+
.gridui-u-tabs--min-h-\(--gridui-tab-min\) {
|
|
214
|
+
min-height: var(--gridui-tab-min);
|
|
19
215
|
}
|
|
20
216
|
.gridui-u-tabs--w-full {
|
|
21
217
|
width: 100%;
|
|
@@ -77,17 +273,11 @@
|
|
|
77
273
|
.gridui-u-tabs--p-gridui-16 {
|
|
78
274
|
padding: var(--gridui-space-16);
|
|
79
275
|
}
|
|
80
|
-
.gridui-u-tabs--px
|
|
81
|
-
padding-inline: var(--gridui-
|
|
82
|
-
}
|
|
83
|
-
.gridui-u-tabs--px-gridui-16 {
|
|
84
|
-
padding-inline: var(--gridui-space-16);
|
|
276
|
+
.gridui-u-tabs--px-\(--gridui-tab-inline\) {
|
|
277
|
+
padding-inline: var(--gridui-tab-inline);
|
|
85
278
|
}
|
|
86
|
-
.gridui-u-tabs--py
|
|
87
|
-
padding-block: var(--gridui-
|
|
88
|
-
}
|
|
89
|
-
.gridui-u-tabs--py-gridui-16 {
|
|
90
|
-
padding-block: var(--gridui-space-16);
|
|
279
|
+
.gridui-u-tabs--py-\(--gridui-tab-block\) {
|
|
280
|
+
padding-block: var(--gridui-tab-block);
|
|
91
281
|
}
|
|
92
282
|
.gridui-u-tabs--text-center {
|
|
93
283
|
text-align: center;
|
|
@@ -246,6 +436,20 @@
|
|
|
246
436
|
border-color: Canvas;
|
|
247
437
|
}
|
|
248
438
|
}
|
|
439
|
+
.gridui-tabs-tab {
|
|
440
|
+
--gridui-tab-min: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
441
|
+
--gridui-tab-inline: var(--gridui-space-16);
|
|
442
|
+
--gridui-tab-block: var(--gridui-space-8);
|
|
443
|
+
}
|
|
444
|
+
.gridui-tabs-tab[data-size="small"] {
|
|
445
|
+
--gridui-tab-min: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
446
|
+
--gridui-tab-inline: var(--gridui-space-8);
|
|
447
|
+
--gridui-tab-block: var(--gridui-space-4);
|
|
448
|
+
}
|
|
449
|
+
.gridui-tabs-tab[data-size="large"] {
|
|
450
|
+
--gridui-tab-min: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
451
|
+
--gridui-tab-inline: var(--gridui-space-24);
|
|
452
|
+
}
|
|
249
453
|
}
|
|
250
454
|
@property --tw-border-style {
|
|
251
455
|
syntax: "*";
|
|
@@ -0,0 +1,273 @@
|
|
|
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
|
+
--font-weight-medium: 500;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@layer utilities {
|
|
10
|
+
.gridui-u-tabs--flex {
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
.gridui-u-tabs--grid {
|
|
14
|
+
display: grid;
|
|
15
|
+
}
|
|
16
|
+
.gridui-u-tabs--min-h-\(--gridui-tab-min\) {
|
|
17
|
+
min-height: var(--gridui-tab-min);
|
|
18
|
+
}
|
|
19
|
+
.gridui-u-tabs--w-full {
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
.gridui-u-tabs--min-w-0 {
|
|
23
|
+
min-width: 0px;
|
|
24
|
+
}
|
|
25
|
+
.gridui-u-tabs--flex-1 {
|
|
26
|
+
flex: 1;
|
|
27
|
+
}
|
|
28
|
+
.gridui-u-tabs--shrink-0 {
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
}
|
|
31
|
+
.gridui-u-tabs--cursor-pointer {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
.gridui-u-tabs--auto-cols-fr {
|
|
35
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
36
|
+
}
|
|
37
|
+
.gridui-u-tabs--grid-flow-col {
|
|
38
|
+
grid-auto-flow: column;
|
|
39
|
+
}
|
|
40
|
+
.gridui-u-tabs--flex-col {
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
43
|
+
.gridui-u-tabs--gap-px {
|
|
44
|
+
gap: 1px;
|
|
45
|
+
}
|
|
46
|
+
.gridui-u-tabs--overflow-auto {
|
|
47
|
+
overflow: auto;
|
|
48
|
+
}
|
|
49
|
+
.gridui-u-tabs--overflow-visible {
|
|
50
|
+
overflow: visible;
|
|
51
|
+
}
|
|
52
|
+
.gridui-u-tabs--border {
|
|
53
|
+
border-style: var(--tw-border-style);
|
|
54
|
+
border-width: 1px;
|
|
55
|
+
}
|
|
56
|
+
.gridui-u-tabs--border-0 {
|
|
57
|
+
border-style: var(--tw-border-style);
|
|
58
|
+
border-width: 0px;
|
|
59
|
+
}
|
|
60
|
+
.gridui-u-tabs--border-solid {
|
|
61
|
+
--tw-border-style: solid;
|
|
62
|
+
border-style: solid;
|
|
63
|
+
}
|
|
64
|
+
.gridui-u-tabs--border-border {
|
|
65
|
+
border-color: var(--gridui-border);
|
|
66
|
+
}
|
|
67
|
+
.gridui-u-tabs--bg-background {
|
|
68
|
+
background-color: var(--gridui-background);
|
|
69
|
+
}
|
|
70
|
+
.gridui-u-tabs--bg-border {
|
|
71
|
+
background-color: var(--gridui-border);
|
|
72
|
+
}
|
|
73
|
+
.gridui-u-tabs--bg-none {
|
|
74
|
+
background-image: none;
|
|
75
|
+
}
|
|
76
|
+
.gridui-u-tabs--p-gridui-16 {
|
|
77
|
+
padding: var(--gridui-space-16);
|
|
78
|
+
}
|
|
79
|
+
.gridui-u-tabs--px-\(--gridui-tab-inline\) {
|
|
80
|
+
padding-inline: var(--gridui-tab-inline);
|
|
81
|
+
}
|
|
82
|
+
.gridui-u-tabs--py-\(--gridui-tab-block\) {
|
|
83
|
+
padding-block: var(--gridui-tab-block);
|
|
84
|
+
}
|
|
85
|
+
.gridui-u-tabs--text-center {
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
.gridui-u-tabs--type-ui {
|
|
89
|
+
font: var(--gridui-type-ui);
|
|
90
|
+
font-family: var(--gridui-font-body);
|
|
91
|
+
letter-spacing: normal;
|
|
92
|
+
}
|
|
93
|
+
.gridui-u-tabs--wrap-anywhere {
|
|
94
|
+
overflow-wrap: anywhere;
|
|
95
|
+
}
|
|
96
|
+
.gridui-u-tabs--whitespace-normal {
|
|
97
|
+
white-space: normal;
|
|
98
|
+
}
|
|
99
|
+
.gridui-u-tabs--text-foreground {
|
|
100
|
+
color: var(--gridui-foreground);
|
|
101
|
+
}
|
|
102
|
+
.gridui-u-tabs--text-muted {
|
|
103
|
+
color: var(--gridui-muted);
|
|
104
|
+
}
|
|
105
|
+
.gridui-u-tabs--data-disabled\:cursor-not-allowed[data-disabled] {
|
|
106
|
+
cursor: not-allowed;
|
|
107
|
+
}
|
|
108
|
+
.gridui-u-tabs--data-disabled\:opacity-50[data-disabled] {
|
|
109
|
+
opacity: 50%;
|
|
110
|
+
}
|
|
111
|
+
.gridui-u-tabs--data-\[orientation\=vertical\]\:grid-flow-row[data-orientation="vertical"] {
|
|
112
|
+
grid-auto-flow: row;
|
|
113
|
+
}
|
|
114
|
+
.gridui-u-tabs--data-\[orientation\=vertical\]\:auto-rows-fr[data-orientation="vertical"] {
|
|
115
|
+
grid-auto-rows: minmax(0, 1fr);
|
|
116
|
+
}
|
|
117
|
+
.gridui-u-tabs--data-\[orientation\=vertical\]\:grid-cols-1[data-orientation="vertical"] {
|
|
118
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
119
|
+
}
|
|
120
|
+
.gridui-u-tabs--data-\[orientation\=vertical\]\:flex-col[data-orientation="vertical"] {
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
}
|
|
123
|
+
.gridui-u-tabs--data-\[orientation\=vertical\]\:flex-row[data-orientation="vertical"] {
|
|
124
|
+
flex-direction: row;
|
|
125
|
+
}
|
|
126
|
+
.gridui-u-tabs--data-\[state\=active\]\:font-medium[data-state="active"] {
|
|
127
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
128
|
+
font-weight: var(--font-weight-medium);
|
|
129
|
+
}
|
|
130
|
+
.gridui-u-tabs--data-\[state\=active\]\:text-foreground[data-state="active"] {
|
|
131
|
+
color: var(--gridui-foreground);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
@layer components {
|
|
135
|
+
.gridui-tabs-list {
|
|
136
|
+
background-image: linear-gradient(var(--gridui-border), var(--gridui-border));
|
|
137
|
+
background-position: bottom;
|
|
138
|
+
background-size: 100% 1px;
|
|
139
|
+
background-repeat: no-repeat;
|
|
140
|
+
}
|
|
141
|
+
.gridui-tabs-list[data-orientation="vertical"] {
|
|
142
|
+
background-position: right;
|
|
143
|
+
background-size: 1px 100%;
|
|
144
|
+
&:dir(rtl) {
|
|
145
|
+
background-position: left;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.gridui-tabs-list[data-morph] {
|
|
149
|
+
position: relative;
|
|
150
|
+
}
|
|
151
|
+
.gridui-tabs-list[data-morph][data-morph-positioned]::after {
|
|
152
|
+
position: absolute;
|
|
153
|
+
z-index: 1;
|
|
154
|
+
top: 0;
|
|
155
|
+
left: 0;
|
|
156
|
+
width: var(--gridui-tab-indicator-width);
|
|
157
|
+
height: var(--gridui-tab-indicator-height);
|
|
158
|
+
background: var(--gridui-selection-indicator);
|
|
159
|
+
content: "";
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
transform: translate(var(--gridui-tab-indicator-offset));
|
|
162
|
+
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));
|
|
163
|
+
}
|
|
164
|
+
@media (forced-colors: active) {
|
|
165
|
+
.gridui-tabs-list[data-morph][data-morph-positioned]::after {
|
|
166
|
+
forced-color-adjust: none;
|
|
167
|
+
background: Highlight;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
@media (prefers-reduced-motion: reduce) {
|
|
171
|
+
.gridui-tabs-list[data-morph][data-morph-positioned]::after {
|
|
172
|
+
transition: none;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
.gridui-tabs-tab {
|
|
176
|
+
position: relative;
|
|
177
|
+
border: 0 solid transparent;
|
|
178
|
+
border-block-end-width: 2px;
|
|
179
|
+
background: transparent;
|
|
180
|
+
background-clip: padding-box;
|
|
181
|
+
&[data-layout="cells"] {
|
|
182
|
+
background-color: var(--gridui-background);
|
|
183
|
+
}
|
|
184
|
+
&[data-orientation="vertical"] {
|
|
185
|
+
border-block-end-width: 0;
|
|
186
|
+
border-inline-end-width: 2px;
|
|
187
|
+
}
|
|
188
|
+
&[data-appearance="indicator"][data-state="active"] {
|
|
189
|
+
border-block-end-color: var(--gridui-selection-indicator);
|
|
190
|
+
background-color: var(--gridui-selection-background);
|
|
191
|
+
&[data-orientation="vertical"] {
|
|
192
|
+
border-inline-end-color: var(--gridui-selection-indicator);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
&[data-appearance="connected"] {
|
|
196
|
+
border-width: 0;
|
|
197
|
+
background-color: var(--gridui-surface);
|
|
198
|
+
&::after {
|
|
199
|
+
position: absolute;
|
|
200
|
+
inset: 0;
|
|
201
|
+
border: 0 solid var(--gridui-border);
|
|
202
|
+
border-block-end-width: 1px;
|
|
203
|
+
content: "";
|
|
204
|
+
pointer-events: none;
|
|
205
|
+
}
|
|
206
|
+
&[data-orientation="vertical"]::after {
|
|
207
|
+
border-block-end-width: 0;
|
|
208
|
+
border-inline-end-width: 1px;
|
|
209
|
+
}
|
|
210
|
+
&[data-state="active"] {
|
|
211
|
+
background-color: var(--gridui-background);
|
|
212
|
+
&::after {
|
|
213
|
+
border-width: 2px;
|
|
214
|
+
border-color: var(--gridui-selection-indicator);
|
|
215
|
+
border-block-end-width: 0;
|
|
216
|
+
}
|
|
217
|
+
&[data-orientation="vertical"]::after {
|
|
218
|
+
border-block-end-width: 2px;
|
|
219
|
+
border-inline-end-width: 0;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
.gridui-tabs-list[data-morph][data-morph-positioned] > .gridui-tabs-tab[data-appearance="indicator"][data-state="active"] {
|
|
225
|
+
border-color: transparent;
|
|
226
|
+
}
|
|
227
|
+
@media (forced-colors: active) {
|
|
228
|
+
.gridui-tabs-tab {
|
|
229
|
+
--gridui-background: Canvas;
|
|
230
|
+
--gridui-surface: Canvas;
|
|
231
|
+
--gridui-selection-background: Canvas;
|
|
232
|
+
--gridui-border: CanvasText;
|
|
233
|
+
--gridui-selection-indicator: Highlight;
|
|
234
|
+
&[data-state="inactive"] {
|
|
235
|
+
border-color: Canvas;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
.gridui-tabs-list[data-morph][data-morph-positioned] > .gridui-tabs-tab[data-appearance="indicator"][data-state="active"] {
|
|
239
|
+
border-color: Canvas;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
.gridui-tabs-tab {
|
|
243
|
+
--gridui-tab-min: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
244
|
+
--gridui-tab-inline: var(--gridui-space-16);
|
|
245
|
+
--gridui-tab-block: var(--gridui-space-8);
|
|
246
|
+
}
|
|
247
|
+
.gridui-tabs-tab[data-size="small"] {
|
|
248
|
+
--gridui-tab-min: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
249
|
+
--gridui-tab-inline: var(--gridui-space-8);
|
|
250
|
+
--gridui-tab-block: var(--gridui-space-4);
|
|
251
|
+
}
|
|
252
|
+
.gridui-tabs-tab[data-size="large"] {
|
|
253
|
+
--gridui-tab-min: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
254
|
+
--gridui-tab-inline: var(--gridui-space-24);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
@property --tw-border-style {
|
|
258
|
+
syntax: "*";
|
|
259
|
+
inherits: false;
|
|
260
|
+
initial-value: solid;
|
|
261
|
+
}
|
|
262
|
+
@property --tw-font-weight {
|
|
263
|
+
syntax: "*";
|
|
264
|
+
inherits: false;
|
|
265
|
+
}
|
|
266
|
+
@layer properties {
|
|
267
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
268
|
+
*, ::before, ::after, ::backdrop {
|
|
269
|
+
--tw-border-style: solid;
|
|
270
|
+
--tw-font-weight: initial;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
package/dist/tabs/tabs.d.ts
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
* @namespace Tabs
|
|
5
5
|
* @description Tabs
|
|
6
6
|
*/
|
|
7
|
+
import type { Size } from "@gridui/theme";
|
|
7
8
|
import { type TabsAppearance } from "../shared/context";
|
|
8
9
|
import { type ChangeDetails } from "@gridui/interaction";
|
|
9
10
|
import * as Primitive from "@radix-ui/react-tabs";
|
|
10
11
|
import { type ComponentPropsWithRef, type FC } from "react";
|
|
11
12
|
export type TabsProps = Omit<ComponentPropsWithRef<typeof Primitive.Root>, "value" | "defaultValue" | "onValueChange" | "activationMode"> & {
|
|
13
|
+
readonly size?: Size;
|
|
12
14
|
readonly appearance?: TabsAppearance | undefined;
|
|
13
15
|
readonly value?: string | null | undefined;
|
|
14
16
|
readonly defaultValue?: string | null | undefined;
|
|
@@ -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"> & {
|
|
@@ -5,7 +11,5 @@ export type TabsListProps = Omit<ComponentPropsWithRef<typeof Primitive.List>, "
|
|
|
5
11
|
readonly loopFocus?: boolean | undefined;
|
|
6
12
|
readonly layout?: "standard" | "cells" | undefined;
|
|
7
13
|
readonly morph?: boolean | undefined;
|
|
8
|
-
/** Legacy compatibility prop. System and ancestor motion policy is always respected. */
|
|
9
|
-
readonly respectReducedMotion?: boolean | undefined;
|
|
10
14
|
};
|
|
11
15
|
export declare const TabsList: FC<TabsListProps>;
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* @namespace TabsTab
|
|
5
5
|
* @description Tabs Tab
|
|
6
6
|
*/
|
|
7
|
+
import type { Size } from "@gridui/theme";
|
|
7
8
|
import * as Primitive from "@radix-ui/react-tabs";
|
|
8
9
|
import { type ComponentPropsWithRef, type FC } from "react";
|
|
9
|
-
export type TabsTabProps = ComponentPropsWithRef<typeof Primitive.Trigger
|
|
10
|
+
export type TabsTabProps = ComponentPropsWithRef<typeof Primitive.Trigger> & {
|
|
11
|
+
readonly size?: Size;
|
|
12
|
+
};
|
|
10
13
|
export declare const TabsTab: FC<TabsTabProps>;
|
package/docs/catalog.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/tabs",
|
|
4
|
-
"version": "
|
|
5
|
-
"category": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
|
+
"category": "navigation",
|
|
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.",
|
|
8
8
|
"documentation": [
|
|
@@ -60,10 +60,11 @@
|
|
|
60
60
|
"@gridui/overlay/styles.css",
|
|
61
61
|
"@gridui/tabs/styles.css"
|
|
62
62
|
],
|
|
63
|
+
"styledImport": "@gridui/tabs/styled",
|
|
63
64
|
"examples": [
|
|
64
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
65
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
66
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
67
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
65
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/content-panels.mdx",
|
|
66
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/framed-tabs.mdx",
|
|
67
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/getting-started.mdx",
|
|
68
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/tabs.stories.tsx"
|
|
68
69
|
]
|
|
69
70
|
}
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/tabs/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/tabs.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -85,11 +85,3 @@ Layout within the containing region.
|
|
|
85
85
|
|
|
86
86
|
Default: ``false``
|
|
87
87
|
|
|
88
|
-
### respectReducedMotion
|
|
89
|
-
|
|
90
|
-
``boolean | undefined`` · Optional
|
|
91
|
-
|
|
92
|
-
Default: ``true``
|
|
93
|
-
|
|
94
|
-
Legacy compatibility prop. System and ancestor motion policy is always respected.
|
|
95
|
-
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/tabs/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/tabs.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/tabs/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/tabs.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -65,3 +65,11 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
65
65
|
|
|
66
66
|
``boolean | undefined`` · Optional
|
|
67
67
|
|
|
68
|
+
### size
|
|
69
|
+
|
|
70
|
+
``Size | undefined`` · Optional
|
|
71
|
+
|
|
72
|
+
Default: ``context?.size ?? "medium"``
|
|
73
|
+
|
|
74
|
+
Component size preset.
|
|
75
|
+
|
package/docs/reference/tabs.md
CHANGED
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/tabs/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/tabs.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -72,6 +72,14 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
72
72
|
The orientation the tabs are layed out.
|
|
73
73
|
Mainly so arrow navigation is done accordingly (left & right vs. up & down)
|
|
74
74
|
|
|
75
|
+
### size
|
|
76
|
+
|
|
77
|
+
``Size | undefined`` · Optional
|
|
78
|
+
|
|
79
|
+
Default: ``"medium"``
|
|
80
|
+
|
|
81
|
+
Component size preset.
|
|
82
|
+
|
|
75
83
|
### appearance
|
|
76
84
|
|
|
77
85
|
``TabsAppearance | undefined`` · Optional
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/tabs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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.
|
|
31
|
-
"@gridui/motion": "^1.0.
|
|
32
|
-
"@gridui/overlay": "^2.
|
|
33
|
-
"@gridui/style-utils": "^4.
|
|
34
|
-
"@gridui/theme": "^
|
|
35
|
+
"@gridui/interaction": "^1.3.0",
|
|
36
|
+
"@gridui/motion": "^1.0.3",
|
|
37
|
+
"@gridui/overlay": "^2.5.0",
|
|
38
|
+
"@gridui/style-utils": "^4.1.0",
|
|
39
|
+
"@gridui/theme": "^5.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": "
|
|
45
|
+
"@gridui/button": "6.0.0",
|
|
41
46
|
"@jest/globals": "30.5.2",
|
|
42
47
|
"@storybook/react-vite": "10.6.7",
|
|
43
48
|
"@types/jest": "30.0.0",
|