@radix-ui/react-tabs
Advanced tools
Comparing version 0.1.1-rc.16 to 0.1.1-rc.17
import * as React from "react"; | ||
import * as Radix from "@radix-ui/react-primitive"; | ||
import { Primitive } from "@radix-ui/react-primitive"; | ||
import { RovingFocusGroup } from "@radix-ui/react-roving-focus"; | ||
type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup>; | ||
import * as RovingFocusGroup from "@radix-ui/react-roving-focus"; | ||
export const createTabsScope: import("@radix-ui/react-context").CreateScope; | ||
type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>; | ||
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>; | ||
@@ -7,0 +8,0 @@ export interface TabsProps extends PrimitiveDivProps { |
@@ -1,2 +0,2 @@ | ||
var e,t,r,a=require("@radix-ui/react-id").useId,o=require("@radix-ui/react-roving-focus"),i=o.RovingFocusGroup,n=o.RovingFocusItem,s=require("@radix-ui/react-primitive").Primitive,d=require("@radix-ui/react-use-controllable-state").useControllableState,u=require("@radix-ui/react-use-callback-ref").useCallbackRef,c=require("@radix-ui/react-context").createContext,l=require("@radix-ui/primitive").composeEventHandlers,b=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e),v=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r;const[f,p]=c("Tabs"),x=/*#__PURE__*/b.forwardRef(((e,t)=>{const{value:r,onValueChange:o,defaultValue:i,orientation:n="horizontal",dir:u="ltr",activationMode:c="automatic",...l}=e,[p,x]=d({prop:r,onChange:o,defaultProp:i});/*#__PURE__*/return b.createElement(f,{baseId:a(),value:p,onValueChange:x,orientation:n,dir:u,activationMode:c},/*#__PURE__*/b.createElement(s.div,v({"data-orientation":n},l,{ref:t})))}));exports.Tabs=x;const g=/*#__PURE__*/b.forwardRef(((e,t)=>{const{loop:r=!0,...a}=e,o=p("TabsList");/*#__PURE__*/return b.createElement(i,{asChild:!0,orientation:o.orientation,dir:o.dir,loop:r},/*#__PURE__*/b.createElement(s.div,v({role:"tablist",dir:o.dir},a,{ref:t})))}));exports.TabsList=g;const m=/*#__PURE__*/b.forwardRef(((e,t)=>{const{value:r,disabled:a=!1,...o}=e,i=p("TabsTrigger"),d=h(i.baseId,r),c=T(i.baseId,r),f=r===i.value,x=u((()=>i.onValueChange(r)));/*#__PURE__*/return b.createElement(n,{asChild:!0,focusable:!a,active:f},/*#__PURE__*/b.createElement(s.div,v({role:"tab","aria-selected":f,"aria-controls":c,"aria-disabled":a||void 0,"data-state":f?"active":"inactive","data-disabled":a?"":void 0,id:d},o,{ref:t,onKeyDown:l(e.onKeyDown,(e=>{a||" "!==e.key&&"Enter"!==e.key||x()})),onMouseDown:l(e.onMouseDown,(e=>{a||0!==e.button||!1!==e.ctrlKey||x()})),onFocus:l(e.onFocus,(()=>{const e="manual"!==i.activationMode;f||a||!e||x()}))})))}));exports.TabsTrigger=m;const C=/*#__PURE__*/b.forwardRef(((e,t)=>{const{value:r,children:a,...o}=e,i=p("TabsContent"),n=h(i.baseId,r),d=T(i.baseId,r),u=r===i.value;/*#__PURE__*/return b.createElement(s.div,v({"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":n,hidden:!u,id:d,tabIndex:0},o,{ref:t}),u&&a)}));function h(e,t){return`${e}-trigger-${t}`}function T(e,t){return`${e}-content-${t}`}exports.TabsContent=C;const E=x;exports.Root=E;const q=g;exports.List=q;const w=m;exports.Trigger=w;const y=C;exports.Content=y; | ||
var e,t=require("@radix-ui/react-id").useId,a=require("@radix-ui/react-roving-focus"),r=b({},a),o=a.createRovingFocusGroupScope,n=require("@radix-ui/react-primitive").Primitive,i=require("@radix-ui/react-use-controllable-state").useControllableState,s=require("@radix-ui/react-use-callback-ref").useCallbackRef,c=require("@radix-ui/react-context").createContextScope,d=require("@radix-ui/primitive").composeEventHandlers,u=b({},require("react")),l=(e=require("@babel/runtime/helpers/extends"))&&e.__esModule?e.default:e;function b(e,t){return Object.keys(t).forEach((function(a){"default"!==a&&"__esModule"!==a&&Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[a]}})})),e}const[p,f]=c("Tabs",[o]);exports.createTabsScope=f;const v=o(),[x,T]=p("Tabs"),m=/*#__PURE__*/u.forwardRef(((e,a)=>{const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:c,orientation:d="horizontal",dir:b="ltr",activationMode:p="automatic",...f}=e,[v,T]=i({prop:o,onChange:s,defaultProp:c});/*#__PURE__*/return u.createElement(x,{scope:r,baseId:t(),value:v,onValueChange:T,orientation:d,dir:b,activationMode:p},/*#__PURE__*/u.createElement(n.div,l({"data-orientation":d},f,{ref:a})))}));exports.Tabs=m;const g=/*#__PURE__*/u.forwardRef(((e,t)=>{const{__scopeTabs:a,loop:o=!0,...i}=e,s=T("TabsList",a),c=v(a);/*#__PURE__*/return u.createElement(r.Root,l({asChild:!0},c,{orientation:s.orientation,dir:s.dir,loop:o}),/*#__PURE__*/u.createElement(n.div,l({role:"tablist",dir:s.dir},i,{ref:t})))}));exports.TabsList=g;const C=/*#__PURE__*/u.forwardRef(((e,t)=>{const{__scopeTabs:a,value:o,disabled:i=!1,...c}=e,b=T("TabsTrigger",a),p=v(a),f=h(b.baseId,o),x=E(b.baseId,o),m=o===b.value,g=s((()=>b.onValueChange(o)));/*#__PURE__*/return u.createElement(r.Item,l({asChild:!0},p,{focusable:!i,active:m}),/*#__PURE__*/u.createElement(n.div,l({role:"tab","aria-selected":m,"aria-controls":x,"aria-disabled":i||void 0,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,id:f},c,{ref:t,onKeyDown:d(e.onKeyDown,(e=>{i||" "!==e.key&&"Enter"!==e.key||g()})),onMouseDown:d(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey||g()})),onFocus:d(e.onFocus,(()=>{const e="manual"!==b.activationMode;m||i||!e||g()}))})))}));exports.TabsTrigger=C;const _=/*#__PURE__*/u.forwardRef(((e,t)=>{const{__scopeTabs:a,value:r,children:o,...i}=e,s=T("TabsContent",a),c=h(s.baseId,r),d=E(s.baseId,r),b=r===s.value;/*#__PURE__*/return u.createElement(n.div,l({"data-state":b?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:d,tabIndex:0},i,{ref:t}),b&&o)}));function h(e,t){return`${e}-trigger-${t}`}function E(e,t){return`${e}-content-${t}`}exports.TabsContent=_;const q=m;exports.Root=q;const w=g;exports.List=w;const y=C;exports.Trigger=y;const I=_;exports.Content=I; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{useId as e}from"@radix-ui/react-id";import{RovingFocusGroup as t,RovingFocusItem as a}from"@radix-ui/react-roving-focus";import{Primitive as r}from"@radix-ui/react-primitive";import{useControllableState as o}from"@radix-ui/react-use-controllable-state";import{useCallbackRef as i}from"@radix-ui/react-use-callback-ref";import{createContext as n}from"@radix-ui/react-context";import{composeEventHandlers as s}from"@radix-ui/primitive";import*as d from"react";import c from"@babel/runtime/helpers/esm/extends";const[l,u]=n("Tabs");export const Tabs=/*#__PURE__*/d.forwardRef(((t,a)=>{const{value:i,onValueChange:n,defaultValue:s,orientation:u="horizontal",dir:b="ltr",activationMode:m="automatic",...f}=t,[p,v]=o({prop:i,onChange:n,defaultProp:s});/*#__PURE__*/return d.createElement(l,{baseId:e(),value:p,onValueChange:v,orientation:u,dir:b,activationMode:m},/*#__PURE__*/d.createElement(r.div,c({"data-orientation":u},f,{ref:a})))}));/*#__PURE__*/export const TabsList=/*#__PURE__*/d.forwardRef(((e,a)=>{const{loop:o=!0,...i}=e,n=u("TabsList");/*#__PURE__*/return d.createElement(t,{asChild:!0,orientation:n.orientation,dir:n.dir,loop:o},/*#__PURE__*/d.createElement(r.div,c({role:"tablist",dir:n.dir},i,{ref:a})))}));/*#__PURE__*/export const TabsTrigger=/*#__PURE__*/d.forwardRef(((e,t)=>{const{value:o,disabled:n=!1,...l}=e,f=u("TabsTrigger"),p=b(f.baseId,o),v=m(f.baseId,o),x=o===f.value,T=i((()=>f.onValueChange(o)));/*#__PURE__*/return d.createElement(a,{asChild:!0,focusable:!n,active:x},/*#__PURE__*/d.createElement(r.div,c({role:"tab","aria-selected":x,"aria-controls":v,"aria-disabled":n||void 0,"data-state":x?"active":"inactive","data-disabled":n?"":void 0,id:p},l,{ref:t,onKeyDown:s(e.onKeyDown,(e=>{n||" "!==e.key&&"Enter"!==e.key||T()})),onMouseDown:s(e.onMouseDown,(e=>{n||0!==e.button||!1!==e.ctrlKey||T()})),onFocus:s(e.onFocus,(()=>{const e="manual"!==f.activationMode;x||n||!e||T()}))})))}));/*#__PURE__*/export const TabsContent=/*#__PURE__*/d.forwardRef(((e,t)=>{const{value:a,children:o,...i}=e,n=u("TabsContent"),s=b(n.baseId,a),l=m(n.baseId,a),f=a===n.value;/*#__PURE__*/return d.createElement(r.div,c({"data-state":f?"active":"inactive","data-orientation":n.orientation,role:"tabpanel","aria-labelledby":s,hidden:!f,id:l,tabIndex:0},i,{ref:t}),f&&o)}));/*#__PURE__*/function b(e,t){return`${e}-trigger-${t}`}function m(e,t){return`${e}-content-${t}`}export const Root=Tabs;export const List=TabsList;export const Trigger=TabsTrigger;export const Content=TabsContent; | ||
import{useId as e}from"@radix-ui/react-id";import*as t from"@radix-ui/react-roving-focus";import{createRovingFocusGroupScope as a}from"@radix-ui/react-roving-focus";import{Primitive as o}from"@radix-ui/react-primitive";import{useControllableState as r}from"@radix-ui/react-use-controllable-state";import{useCallbackRef as i}from"@radix-ui/react-use-callback-ref";import{createContextScope as n}from"@radix-ui/react-context";import{composeEventHandlers as s}from"@radix-ui/primitive";import*as c from"react";import d from"@babel/runtime/helpers/esm/extends";const[l,u]=n("Tabs",[a]);export{u as createTabsScope};const b=a(),[m,p]=l("Tabs");export const Tabs=/*#__PURE__*/c.forwardRef(((t,a)=>{const{__scopeTabs:i,value:n,onValueChange:s,defaultValue:l,orientation:u="horizontal",dir:b="ltr",activationMode:p="automatic",...f}=t,[v,T]=r({prop:n,onChange:s,defaultProp:l});/*#__PURE__*/return c.createElement(m,{scope:i,baseId:e(),value:v,onValueChange:T,orientation:u,dir:b,activationMode:p},/*#__PURE__*/c.createElement(o.div,d({"data-orientation":u},f,{ref:a})))}));/*#__PURE__*/export const TabsList=/*#__PURE__*/c.forwardRef(((e,a)=>{const{__scopeTabs:r,loop:i=!0,...n}=e,s=p("TabsList",r),l=b(r);/*#__PURE__*/return c.createElement(t.Root,d({asChild:!0},l,{orientation:s.orientation,dir:s.dir,loop:i}),/*#__PURE__*/c.createElement(o.div,d({role:"tablist",dir:s.dir},n,{ref:a})))}));/*#__PURE__*/export const TabsTrigger=/*#__PURE__*/c.forwardRef(((e,a)=>{const{__scopeTabs:r,value:n,disabled:l=!1,...u}=e,m=p("TabsTrigger",r),T=b(r),x=f(m.baseId,n),g=v(m.baseId,n),h=n===m.value,C=i((()=>m.onValueChange(n)));/*#__PURE__*/return c.createElement(t.Item,d({asChild:!0},T,{focusable:!l,active:h}),/*#__PURE__*/c.createElement(o.div,d({role:"tab","aria-selected":h,"aria-controls":g,"aria-disabled":l||void 0,"data-state":h?"active":"inactive","data-disabled":l?"":void 0,id:x},u,{ref:a,onKeyDown:s(e.onKeyDown,(e=>{l||" "!==e.key&&"Enter"!==e.key||C()})),onMouseDown:s(e.onMouseDown,(e=>{l||0!==e.button||!1!==e.ctrlKey||C()})),onFocus:s(e.onFocus,(()=>{const e="manual"!==m.activationMode;h||l||!e||C()}))})))}));/*#__PURE__*/export const TabsContent=/*#__PURE__*/c.forwardRef(((e,t)=>{const{__scopeTabs:a,value:r,children:i,...n}=e,s=p("TabsContent",a),l=f(s.baseId,r),u=v(s.baseId,r),b=r===s.value;/*#__PURE__*/return c.createElement(o.div,d({"data-state":b?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:u,tabIndex:0},n,{ref:t}),b&&i)}));/*#__PURE__*/function f(e,t){return`${e}-trigger-${t}`}function v(e,t){return`${e}-content-${t}`}export const Root=Tabs;export const List=TabsList;export const Trigger=TabsTrigger;export const Content=TabsContent; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-tabs", | ||
"version": "0.1.1-rc.16", | ||
"version": "0.1.1-rc.17", | ||
"license": "MIT", | ||
@@ -21,6 +21,6 @@ "source": "src/index.ts", | ||
"@radix-ui/primitive": "0.1.0", | ||
"@radix-ui/react-context": "0.1.0", | ||
"@radix-ui/react-id": "0.1.0", | ||
"@radix-ui/react-primitive": "0.1.1-rc.16", | ||
"@radix-ui/react-roving-focus": "0.1.1-rc.16", | ||
"@radix-ui/react-context": "0.1.1-rc.1", | ||
"@radix-ui/react-id": "0.1.1-rc.1", | ||
"@radix-ui/react-primitive": "0.1.1-rc.17", | ||
"@radix-ui/react-roving-focus": "0.1.1-rc.17", | ||
"@radix-ui/react-use-callback-ref": "0.1.0", | ||
@@ -27,0 +27,0 @@ "@radix-ui/react-use-controllable-state": "0.1.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
37265
71
+ Added@radix-ui/react-collection@0.1.1-rc.17(transitive)
+ Added@radix-ui/react-context@0.1.1-rc.1(transitive)
+ Added@radix-ui/react-id@0.1.1-rc.1(transitive)
+ Added@radix-ui/react-primitive@0.1.1-rc.17(transitive)
+ Added@radix-ui/react-roving-focus@0.1.1-rc.17(transitive)
+ Added@radix-ui/react-slot@0.1.1-rc.13(transitive)
- Removed@radix-ui/react-collection@0.1.1-rc.16(transitive)
- Removed@radix-ui/react-context@0.1.0(transitive)
- Removed@radix-ui/react-id@0.1.0(transitive)
- Removed@radix-ui/react-primitive@0.1.1-rc.16(transitive)
- Removed@radix-ui/react-roving-focus@0.1.1-rc.16(transitive)
- Removed@radix-ui/react-slot@0.1.1-rc.12(transitive)