@jamsrui/tabs 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +19 -4
- package/dist/index.mjs +1 -1
- package/dist/tab-context.mjs +1 -1
- package/dist/tabs-config.d.mts +2 -2
- package/dist/tabs-config.mjs +1 -1
- package/dist/tabs-context.mjs +1 -1
- package/dist/tabs.mjs +1 -1
- package/dist/use-tab.mjs +1 -1
- package/dist/use-tabs.mjs +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -5,18 +5,33 @@ import { TabIndicator } from './tab-indicator.mjs';
|
|
|
5
5
|
import { TabList } from './tab-list.mjs';
|
|
6
6
|
import { TabPanel } from './tab-panel.mjs';
|
|
7
7
|
import { T as Tabs$1 } from './tabs-DgVVpbTS.mjs';
|
|
8
|
-
|
|
8
|
+
import { TabsConfig } from './tabs-config.mjs';
|
|
9
|
+
export { useTabsConfig } from './tabs-config.mjs';
|
|
10
|
+
export { TabsContext, useTabsContext } from './tabs-context.mjs';
|
|
11
|
+
export { TabsSlots, TabsVariants, tabsVariant } from './styles.mjs';
|
|
9
12
|
import '@jamsrui/utils';
|
|
10
13
|
import 'motion/react';
|
|
11
|
-
import './styles.mjs';
|
|
12
14
|
import '@jamsrui/core';
|
|
13
15
|
|
|
14
16
|
declare const Tabs: ((props: Tabs$1.Props) => react_jsx_runtime.JSX.Element) & {
|
|
15
|
-
Root: (props: Tabs$1.Props) => react_jsx_runtime.JSX.Element;
|
|
16
17
|
List: (props: TabList.Props) => react_jsx_runtime.JSX.Element;
|
|
17
18
|
Tab: (props: Tab.Props) => react_jsx_runtime.JSX.Element;
|
|
18
19
|
Panel: (props: TabPanel.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
19
20
|
Indicator: (props: TabIndicator.Props) => react_jsx_runtime.JSX.Element | null;
|
|
20
21
|
};
|
|
22
|
+
declare namespace Tabs {
|
|
23
|
+
interface Props extends Tabs$1.Props {
|
|
24
|
+
}
|
|
25
|
+
interface Config extends TabsConfig.Props {
|
|
26
|
+
}
|
|
27
|
+
interface List extends TabList.Props {
|
|
28
|
+
}
|
|
29
|
+
interface Tab extends Tab.Props {
|
|
30
|
+
}
|
|
31
|
+
interface Panel extends TabPanel.Props {
|
|
32
|
+
}
|
|
33
|
+
interface Indicator extends TabIndicator.Props {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
21
36
|
|
|
22
|
-
export { Tab, TabIndicator, TabList, TabPanel, Tabs };
|
|
37
|
+
export { type Tab, TabIndicator, TabList, TabPanel, Tabs, TabsConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Tab as
|
|
1
|
+
import{Tab as t}from"./tab.mjs";import{TabIndicator as a}from"./tab-indicator.mjs";import{TabList as o}from"./tab-list.mjs";import{TabPanel as e}from"./tab-panel.mjs";import{Tabs as r}from"./tabs.mjs";import{TabsConfig as s,useTabsConfig as n}from"./tabs-config.mjs";import{TabsContext as i,useTabsContext as p}from"./tabs-context.mjs";import{tabsVariant as b}from"./styles.mjs";const I=Object.assign(r,{List:o,Tab:t,Panel:e,Indicator:a});export{t as Tab,a as TabIndicator,o as TabList,e as TabPanel,I as Tabs,s as TabsConfig,i as TabsContext,b as tabsVariant,n as useTabsConfig,p as useTabsContext};
|
package/dist/tab-context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as e,use as o}from"react";const n=e(null),a=()=>{const t=o(n);if(!t)throw new Error("useTabContext must be used within a TabContext");return t};export{n as TabContext,a as useTabContext};
|
|
1
|
+
"use client";import{createContext as e,use as o}from"react";const n=e(null),a=()=>{const t=o(n);if(!t)throw new Error("useTabContext must be used within a TabContext");return t};export{n as TabContext,a as useTabContext};
|
package/dist/tabs-config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { WithGlobalConfig } from '@jamsrui/core';
|
|
3
3
|
import { T as Tabs } from './tabs-DgVVpbTS.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@jamsrui/utils';
|
|
@@ -16,7 +16,7 @@ declare const TabsConfig: (props: Omit<Partial<TabsConfig.Props>, "children"> &
|
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
}) => react_jsx_runtime.JSX.Element;
|
|
18
18
|
declare namespace TabsConfig {
|
|
19
|
-
interface Props extends
|
|
19
|
+
interface Props extends WithGlobalConfig<Tabs.Props> {
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
package/dist/tabs-config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[
|
|
1
|
+
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[s,t]=o({displayName:"TabsConfig"});export{s as TabsConfig,t as useTabsConfig};
|
package/dist/tabs-context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as t,use as
|
|
1
|
+
"use client";import{createContext as t,use as s}from"react";const o=t(null),r=()=>{const e=s(o);if(!e)throw new Error("useTabsContext must be used within a TabsContext");return e};export{o as TabsContext,r as useTabsContext};
|
package/dist/tabs.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as b}from"react/jsx-runtime";import{useRenderElement as p}from"@jamsrui/hooks";import{mergeConfigProps as a}from"@jamsrui/utils";import{tabsVariant as m}from"./styles.mjs";import{useTabsConfig as i}from"./tabs-config.mjs";import{TabsContext as f}from"./tabs-context.mjs";import{useTabs as c}from"./use-tabs.mjs";const l=e=>{const r=i(),t=a(m.defaultVariants,r,e),o=c(t),{getRootProps:s}=o,n=p("div",{props:[s({})]});return b(f,{value:o,children:n})};export{l as Tabs};
|
package/dist/use-tab.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as u,useMemo as n}from"react";import{useTabsContext as c}from"./tabs-context.mjs";const
|
|
1
|
+
"use client";import{useCallback as u,useMemo as n}from"react";import{useTabsContext as c}from"./tabs-context.mjs";const p=o=>{const{value:e}=o,{value:r,setValue:s}=c(),t=u(()=>{s(e)},[s,e]),a=r===e;return n(()=>({isActive:a,handleClick:t}),[t,a])};export{p as useTab};
|
package/dist/use-tabs.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e,useMemo as y}from"react";import{useControlledState as V}from"@jamsrui/hooks";import{dataAttrDev as s,mapPropsVariants as v}from"@jamsrui/utils";import{tabsVariant as b}from"./styles.mjs";const x=P=>{const[d,u]=v(P,b.variantKeys),{defaultValue:T,value:f,onValueChange:N,children:g,...o}=d,t=b(u),[r,l]=V({defaultProp:T,onChange:N,prop:f}),
|
|
1
|
+
"use client";import{useCallback as e,useMemo as y}from"react";import{useControlledState as V}from"@jamsrui/hooks";import{dataAttrDev as s,mapPropsVariants as v}from"@jamsrui/utils";import{tabsVariant as b}from"./styles.mjs";const x=P=>{const[d,u]=v(P,b.variantKeys),{defaultValue:T,value:f,onValueChange:N,children:g,...o}=d,t=b(u),[r,l]=V({defaultProp:T,onChange:N,prop:f}),n=e(()=>({...o,"data-slot":s("root"),"data-component":s("tabs"),className:t.root({className:o.className}),children:g}),[o,t]),p=e(a=>({...a,"data-slot":s("tab-list"),className:t.list({className:a.className})}),[t]),i=e(a=>({...a,"data-slot":s("tab"),className:t.tab({className:a.className})}),[t]),m=e(a=>({layoutId:"indicator",...a,"data-slot":s("indicator"),className:t.indicator({className:a.className})}),[t]),c=e(a=>({...a,"data-slot":s("tab-panel"),className:t.panel({className:a.className})}),[t]);return y(()=>({getRootProps:n,getTabListProps:p,getTabProps:i,getIndicatorProps:m,value:r,setValue:l,getPanelProps:c}),[m,c,n,p,i,l,r])};export{x as useTabs};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/tabs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"motion": ">=12",
|
|
6
6
|
"react": ">=19"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jamsrui/
|
|
10
|
-
"@jamsrui/core": "^0.0.
|
|
11
|
-
"@jamsrui/
|
|
9
|
+
"@jamsrui/hooks": "^0.0.18",
|
|
10
|
+
"@jamsrui/core": "^0.0.14",
|
|
11
|
+
"@jamsrui/utils": "^0.0.18"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|