@radix-ui/react-toggle-group
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,2 +0,2 @@ | ||
var e=require("@radix-ui/react-toggle").Toggle,r=require("@radix-ui/react-primitive").Primitive,o=require("@radix-ui/react-roving-focus"),t=o.RovingFocusGroup,a=o.useRovingFocus,n=require("@radix-ui/react-use-controllable-state").useControllableState,l=require("@radix-ui/primitive").composeEventHandlers,u=require("@radix-ui/react-context").createContext,i=c(require("react")),s=c(require("@babel/runtime/helpers/extends"));function c(e){return e&&e.__esModule?e.default:e}const d=i.forwardRef(((e,r)=>{if("single"===e.type)return i.createElement(m,s({},e,{ref:r}));if("multiple"===e.type)return i.createElement(f,s({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));exports.ToggleGroup=d,d.displayName="ToggleGroup";const[g,p]=u("ToggleGroup"),m=i.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:a=(()=>{}),...l}=e,[u,c]=n({prop:o,defaultProp:t,onChange:a});return i.createElement(g,{value:u?[u]:[],onItemActivate:c,onItemDeactivate:()=>c(void 0)},i.createElement(E,s({},l,{ref:r})))})),f=i.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:a=(()=>{}),...l}=e,[u=[],c]=n({prop:o,defaultProp:t,onChange:a}),d=i.useCallback((e=>c(((r=[])=>[...r,e]))),[c]),p=i.useCallback((e=>c(((r=[])=>r.filter((r=>r!==e))))),[c]);return i.createElement(g,{value:u,onItemActivate:d,onItemDeactivate:p},i.createElement(E,s({},l,{ref:r})))}));d.displayName="ToggleGroup";const[v,w]=u("ToggleGroup"),E=i.forwardRef(((e,o)=>{const{disabled:a=!1,rovingFocus:n=!0,...l}=e,u=i.createElement(r,s({role:"group"},l,{ref:o}));return i.createElement(v,{rovingFocus:n,disabled:a},n?i.createElement(t,{loop:!0},u):u)})),b=i.forwardRef(((e,r)=>w("ToggleGroupItem").rovingFocus?i.createElement(x,s({},e,{ref:r})):i.createElement(G,s({},e,{ref:r}))));exports.ToggleGroupItem=b,b.displayName="ToggleGroupItem";const x=i.forwardRef(((e,r)=>{const o=p("ToggleGroupItem"),t=w("ToggleGroupItem"),n=a({disabled:t.disabled||e.disabled,active:o.value.includes(e.value)});return i.createElement(G,s({},e,n,{ref:r,onFocus:l(e.onFocus,n.onFocus),onKeyDown:l(e.onKeyDown,n.onKeyDown),onMouseDown:l(e.onMouseDown,n.onMouseDown)}))})),G=i.forwardRef(((r,o)=>{const{value:t,...a}=r,n=w("ToggleGroupItem"),l=p("ToggleGroupItem"),u=l.value.includes(r.value),c=!!n.disabled||r.disabled;return i.createElement(e,s({},a,{ref:o,disabled:c,pressed:u,onPressedChange:e=>{e?l.onItemActivate(t):l.onItemDeactivate(t)}}))})),I=d;exports.Root=I;const T=b;exports.Item=T; | ||
var e=require("@radix-ui/react-toggle").Toggle,r=require("@radix-ui/react-primitive").Primitive,o=require("@radix-ui/react-roving-focus"),t=o.RovingFocusGroup,a=o.useRovingFocus,n=require("@radix-ui/react-use-controllable-state").useControllableState,u=require("@radix-ui/primitive").composeEventHandlers,l=require("@radix-ui/react-context").createContext,i=s(require("react")),c=s(require("@babel/runtime/helpers/extends"));function s(e){return e&&e.__esModule?e.default:e}const d=/*#__PURE__*/i.forwardRef(((e,r)=>{if("single"===e.type)/*#__PURE__*/return i.createElement(f,c({},e,{ref:r}));if("multiple"===e.type)/*#__PURE__*/return i.createElement(m,c({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));exports.ToggleGroup=d;const[g,p]=l("ToggleGroup"),f=/*#__PURE__*/i.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:a=(()=>{}),...u}=e,[l,s]=n({prop:o,defaultProp:t,onChange:a});/*#__PURE__*/return i.createElement(g,{value:l?[l]:[],onItemActivate:s,onItemDeactivate:()=>s(void 0)},/*#__PURE__*/i.createElement(E,c({},u,{ref:r})))})),m=/*#__PURE__*/i.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:a=(()=>{}),...u}=e,[l=[],s]=n({prop:o,defaultProp:t,onChange:a}),d=i.useCallback((e=>s(((r=[])=>[...r,e]))),[s]),p=i.useCallback((e=>s(((r=[])=>r.filter((r=>r!==e))))),[s]);/*#__PURE__*/return i.createElement(g,{value:l,onItemActivate:d,onItemDeactivate:p},/*#__PURE__*/i.createElement(E,c({},u,{ref:r})))})),[v,w]=l("ToggleGroup"),E=/*#__PURE__*/i.forwardRef(((e,o)=>{const{disabled:a=!1,rovingFocus:n=!0,...u}=e,l=/*#__PURE__*/i.createElement(r,c({role:"group"},u,{ref:o}));/*#__PURE__*/return i.createElement(v,{rovingFocus:n,disabled:a},n?/*#__PURE__*/i.createElement(t,{loop:!0},l):l)})),b=/*#__PURE__*/i.forwardRef(((e,r)=>w("ToggleGroupItem").rovingFocus?/*#__PURE__*/i.createElement(x,c({},e,{ref:r})):/*#__PURE__*/i.createElement(I,c({},e,{ref:r}))));exports.ToggleGroupItem=b;const x=/*#__PURE__*/i.forwardRef(((e,r)=>{const o=p("ToggleGroupItem"),t=w("ToggleGroupItem"),n=a({disabled:t.disabled||e.disabled,active:o.value.includes(e.value)});/*#__PURE__*/return i.createElement(I,c({},e,n,{ref:r,onFocus:u(e.onFocus,n.onFocus),onKeyDown:u(e.onKeyDown,n.onKeyDown),onMouseDown:u(e.onMouseDown,n.onMouseDown)}))})),I=/*#__PURE__*/i.forwardRef(((r,o)=>{const{value:t,...a}=r,n=w("ToggleGroupItem"),u=p("ToggleGroupItem"),l=u.value.includes(r.value),s=!!n.disabled||r.disabled;/*#__PURE__*/return i.createElement(e,c({},a,{ref:o,disabled:s,pressed:l,onPressedChange:e=>{e?u.onItemActivate(t):u.onItemDeactivate(t)}}))})),G=d;exports.Root=G;const T=b;exports.Item=T; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{Toggle as e}from"@radix-ui/react-toggle";import{Primitive as o}from"@radix-ui/react-primitive";import{RovingFocusGroup as r,useRovingFocus as t}from"@radix-ui/react-roving-focus";import{useControllableState as a}from"@radix-ui/react-use-controllable-state";import{composeEventHandlers as l}from"@radix-ui/primitive";import{createContext as n}from"@radix-ui/react-context";import u from"react";import i from"@babel/runtime/helpers/esm/extends";export const ToggleGroup=u.forwardRef(((e,o)=>{if("single"===e.type)return u.createElement(p,i({},e,{ref:o}));if("multiple"===e.type)return u.createElement(g,i({},e,{ref:o}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));ToggleGroup.displayName="ToggleGroup";const[m,c]=n("ToggleGroup"),p=u.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:l=(()=>{}),...n}=e,[c,p]=a({prop:r,defaultProp:t,onChange:l});return u.createElement(m,{value:c?[c]:[],onItemActivate:p,onItemDeactivate:()=>p(void 0)},u.createElement(f,i({},n,{ref:o})))})),g=u.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:l=(()=>{}),...n}=e,[c=[],p]=a({prop:r,defaultProp:t,onChange:l}),g=u.useCallback((e=>p(((o=[])=>[...o,e]))),[p]),s=u.useCallback((e=>p(((o=[])=>o.filter((o=>o!==e))))),[p]);return u.createElement(m,{value:c,onItemActivate:g,onItemDeactivate:s},u.createElement(f,i({},n,{ref:o})))}));ToggleGroup.displayName="ToggleGroup";const[s,d]=n("ToggleGroup"),f=u.forwardRef(((e,t)=>{const{disabled:a=!1,rovingFocus:l=!0,...n}=e,m=u.createElement(o,i({role:"group"},n,{ref:t}));return u.createElement(s,{rovingFocus:l,disabled:a},l?u.createElement(r,{loop:!0},m):m)}));export const ToggleGroupItem=u.forwardRef(((e,o)=>d("ToggleGroupItem").rovingFocus?u.createElement(v,i({},e,{ref:o})):u.createElement(G,i({},e,{ref:o}))));ToggleGroupItem.displayName="ToggleGroupItem";const v=u.forwardRef(((e,o)=>{const r=c("ToggleGroupItem"),a=d("ToggleGroupItem"),n=t({disabled:a.disabled||e.disabled,active:r.value.includes(e.value)});return u.createElement(G,i({},e,n,{ref:o,onFocus:l(e.onFocus,n.onFocus),onKeyDown:l(e.onKeyDown,n.onKeyDown),onMouseDown:l(e.onMouseDown,n.onMouseDown)}))})),G=u.forwardRef(((o,r)=>{const{value:t,...a}=o,l=d("ToggleGroupItem"),n=c("ToggleGroupItem"),m=n.value.includes(o.value),p=!!l.disabled||o.disabled;return u.createElement(e,i({},a,{ref:r,disabled:p,pressed:m,onPressedChange:e=>{e?n.onItemActivate(t):n.onItemDeactivate(t)}}))}));export const Root=ToggleGroup;export const Item=ToggleGroupItem; | ||
import{Toggle as e}from"@radix-ui/react-toggle";import{Primitive as o}from"@radix-ui/react-primitive";import{RovingFocusGroup as r,useRovingFocus as t}from"@radix-ui/react-roving-focus";import{useControllableState as a}from"@radix-ui/react-use-controllable-state";import{composeEventHandlers as n}from"@radix-ui/primitive";import{createContext as l}from"@radix-ui/react-context";import u from"react";import i from"@babel/runtime/helpers/esm/extends";export const ToggleGroup=/*#__PURE__*/u.forwardRef(((e,o)=>{if("single"===e.type)/*#__PURE__*/return u.createElement(s,i({},e,{ref:o}));if("multiple"===e.type)/*#__PURE__*/return u.createElement(p,i({},e,{ref:o}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));/*#__PURE__*/const[c,m]=l("ToggleGroup"),s=/*#__PURE__*/u.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:n=(()=>{}),...l}=e,[m,s]=a({prop:r,defaultProp:t,onChange:n});/*#__PURE__*/return u.createElement(c,{value:m?[m]:[],onItemActivate:s,onItemDeactivate:()=>s(void 0)},/*#__PURE__*/u.createElement(g,i({},l,{ref:o})))})),p=/*#__PURE__*/u.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:n=(()=>{}),...l}=e,[m=[],s]=a({prop:r,defaultProp:t,onChange:n}),p=u.useCallback((e=>s(((o=[])=>[...o,e]))),[s]),d=u.useCallback((e=>s(((o=[])=>o.filter((o=>o!==e))))),[s]);/*#__PURE__*/return u.createElement(c,{value:m,onItemActivate:p,onItemDeactivate:d},/*#__PURE__*/u.createElement(g,i({},l,{ref:o})))})),[d,f]=l("ToggleGroup"),g=/*#__PURE__*/u.forwardRef(((e,t)=>{const{disabled:a=!1,rovingFocus:n=!0,...l}=e,c=/*#__PURE__*/u.createElement(o,i({role:"group"},l,{ref:t}));/*#__PURE__*/return u.createElement(d,{rovingFocus:n,disabled:a},n?/*#__PURE__*/u.createElement(r,{loop:!0},c):c)}));export const ToggleGroupItem=/*#__PURE__*/u.forwardRef(((e,o)=>f("ToggleGroupItem").rovingFocus?/*#__PURE__*/u.createElement(v,i({},e,{ref:o})):/*#__PURE__*/u.createElement(w,i({},e,{ref:o}))));/*#__PURE__*/const v=/*#__PURE__*/u.forwardRef(((e,o)=>{const r=m("ToggleGroupItem"),a=f("ToggleGroupItem"),l=t({disabled:a.disabled||e.disabled,active:r.value.includes(e.value)});/*#__PURE__*/return u.createElement(w,i({},e,l,{ref:o,onFocus:n(e.onFocus,l.onFocus),onKeyDown:n(e.onKeyDown,l.onKeyDown),onMouseDown:n(e.onMouseDown,l.onMouseDown)}))})),w=/*#__PURE__*/u.forwardRef(((o,r)=>{const{value:t,...a}=o,n=f("ToggleGroupItem"),l=m("ToggleGroupItem"),c=l.value.includes(o.value),s=!!n.disabled||o.disabled;/*#__PURE__*/return u.createElement(e,i({},a,{ref:r,disabled:s,pressed:c,onPressedChange:e=>{e?l.onItemActivate(t):l.onItemDeactivate(t)}}))}));export const Root=ToggleGroup;export const Item=ToggleGroupItem; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-toggle-group", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"license": "MIT", | ||
@@ -21,9 +21,9 @@ "source": "src/index.ts", | ||
"@babel/runtime": "^7.13.10", | ||
"@radix-ui/primitive": "0.0.4", | ||
"@radix-ui/react-context": "0.0.4", | ||
"@radix-ui/react-polymorphic": "0.0.9", | ||
"@radix-ui/react-primitive": "0.0.10", | ||
"@radix-ui/react-roving-focus": "0.0.10", | ||
"@radix-ui/react-toggle": "0.0.5", | ||
"@radix-ui/react-use-controllable-state": "0.0.5" | ||
"@radix-ui/primitive": "0.0.5", | ||
"@radix-ui/react-context": "0.0.5", | ||
"@radix-ui/react-polymorphic": "0.0.10", | ||
"@radix-ui/react-primitive": "0.0.11", | ||
"@radix-ui/react-roving-focus": "0.0.11", | ||
"@radix-ui/react-toggle": "0.0.6", | ||
"@radix-ui/react-use-controllable-state": "0.0.6" | ||
}, | ||
@@ -30,0 +30,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
42769
105
0
+ Added@radix-ui/number@0.0.5(transitive)
+ Added@radix-ui/primitive@0.0.5(transitive)
+ Added@radix-ui/react-context@0.0.5(transitive)
+ Added@radix-ui/react-id@0.0.5(transitive)
+ Added@radix-ui/react-polymorphic@0.0.10(transitive)
+ Added@radix-ui/react-primitive@0.0.11(transitive)
+ Added@radix-ui/react-roving-focus@0.0.11(transitive)
+ Added@radix-ui/react-toggle@0.0.6(transitive)
+ Added@radix-ui/react-use-callback-ref@0.0.5(transitive)
+ Added@radix-ui/react-use-controllable-state@0.0.6(transitive)
- Removed@radix-ui/number@0.0.4(transitive)
- Removed@radix-ui/primitive@0.0.4(transitive)
- Removed@radix-ui/react-context@0.0.4(transitive)
- Removed@radix-ui/react-id@0.0.4(transitive)
- Removed@radix-ui/react-polymorphic@0.0.9(transitive)
- Removed@radix-ui/react-primitive@0.0.10(transitive)
- Removed@radix-ui/react-roving-focus@0.0.10(transitive)
- Removed@radix-ui/react-toggle@0.0.5(transitive)
- Removed@radix-ui/react-use-callback-ref@0.0.4(transitive)
- Removed@radix-ui/react-use-controllable-state@0.0.5(transitive)
Updated@radix-ui/primitive@0.0.5
Updated@radix-ui/react-toggle@0.0.6