@radix-ui/react-toggle-group
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&e.__esModule?e.default:e}function r(e,r,o){Object.defineProperty(e,r,{get:o,enumerable:!0})}var o=require("@radix-ui/react-toggle").Toggle,t=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-roving-focus"),a=n.RovingFocusGroup,u=n.useRovingFocus,l=require("@radix-ui/react-use-controllable-state").useControllableState,i=require("@radix-ui/primitive").composeEventHandlers,c=require("@radix-ui/react-context").createContext,s=e(require("react")),g=e(require("@babel/runtime/helpers/extends")),d={};const p=s.forwardRef(((e,r)=>{if("single"===e.type)return s.createElement(v,g({},e,{ref:r}));if("multiple"===e.type)return s.createElement(b,g({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));exports.ToggleGroup=p,p.displayName="ToggleGroup";const[f,m]=c("ToggleGroup"),v=s.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:n=(()=>{}),...a}=e,[u,i]=l({prop:o,defaultProp:t,onChange:n});return s.createElement(f,{value:u?[u]:[],onItemActivate:i,onItemDeactivate:()=>i(void 0)},s.createElement(T,g({},a,{ref:r})))})),b=s.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:n=(()=>{}),...a}=e,[u=[],i]=l({prop:o,defaultProp:t,onChange:n}),c=s.useCallback((e=>i(((r=[])=>[...r,e]))),[i]),d=s.useCallback((e=>i(((r=[])=>r.filter((r=>r!==e))))),[i]);return s.createElement(f,{value:u,onItemActivate:c,onItemDeactivate:d},s.createElement(T,g({},a,{ref:r})))}));p.displayName="ToggleGroup";const[G,I]=c("ToggleGroup"),T=s.forwardRef(((e,r)=>{const{disabled:o=!1,rovingFocus:n=!0,...u}=e,l=s.createElement(t,g({role:"group"},u,{ref:r}));return s.createElement(G,{rovingFocus:n,disabled:o},n?s.createElement(a,{loop:!0},l):l)})),w=s.forwardRef(((e,r)=>I("ToggleGroupItem").rovingFocus?s.createElement(E,g({},e,{ref:r})):s.createElement(x,g({},e,{ref:r}))));exports.ToggleGroupItem=w,w.displayName="ToggleGroupItem";const E=s.forwardRef(((e,r)=>{const o=m("ToggleGroupItem"),t=I("ToggleGroupItem"),n=u({disabled:t.disabled||e.disabled,active:o.value.includes(e.value)});return s.createElement(x,g({},e,n,{ref:r,onFocus:i(e.onFocus,n.onFocus),onKeyDown:i(e.onKeyDown,n.onKeyDown),onMouseDown:i(e.onMouseDown,n.onMouseDown)}))})),x=s.forwardRef(((e,r)=>{const{value:t,...n}=e,a=I("ToggleGroupItem"),u=m("ToggleGroupItem"),l=u.value.includes(e.value),i=!!a.disabled||e.disabled;return s.createElement(o,g({},n,{ref:r,disabled:i,pressed:l,onPressedChange:e=>{e?u.onItemActivate(t):u.onItemDeactivate(t)}}))})),R=p;exports.Root=R;const y=w;exports.Item=y,r(d,"Item",(function(){return y})),r(d,"Root",(function(){return R})),r(d,"ToggleGroupItem",(function(){return w})),r(d,"ToggleGroup",(function(){return p})); | ||
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; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
function e(e,o,r){Object.defineProperty(e,o,{get:r,enumerable:!0})}import{Toggle as o}from"@radix-ui/react-toggle";import{Primitive as r}from"@radix-ui/react-primitive";import{RovingFocusGroup as t,useRovingFocus as n}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 u}from"@radix-ui/react-context";import i from"react";import g from"@babel/runtime/helpers/esm/extends";var c={};export const ToggleGroup=i.forwardRef(((e,o)=>{if("single"===e.type)return i.createElement(s,g({},e,{ref:o}));if("multiple"===e.type)return i.createElement(f,g({},e,{ref:o}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));ToggleGroup.displayName="ToggleGroup";const[m,p]=u("ToggleGroup"),s=i.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:n=(()=>{}),...l}=e,[u,c]=a({prop:r,defaultProp:t,onChange:n});return i.createElement(m,{value:u?[u]:[],onItemActivate:c,onItemDeactivate:()=>c(void 0)},i.createElement(G,g({},l,{ref:o})))})),f=i.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:n=(()=>{}),...l}=e,[u=[],c]=a({prop:r,defaultProp:t,onChange:n}),p=i.useCallback((e=>c(((o=[])=>[...o,e]))),[c]),s=i.useCallback((e=>c(((o=[])=>o.filter((o=>o!==e))))),[c]);return i.createElement(m,{value:u,onItemActivate:p,onItemDeactivate:s},i.createElement(G,g({},l,{ref:o})))}));ToggleGroup.displayName="ToggleGroup";const[d,v]=u("ToggleGroup"),G=i.forwardRef(((e,o)=>{const{disabled:n=!1,rovingFocus:a=!0,...l}=e,u=i.createElement(r,g({role:"group"},l,{ref:o}));return i.createElement(d,{rovingFocus:a,disabled:n},a?i.createElement(t,{loop:!0},u):u)}));export const ToggleGroupItem=i.forwardRef(((e,o)=>v("ToggleGroupItem").rovingFocus?i.createElement(T,g({},e,{ref:o})):i.createElement(I,g({},e,{ref:o}))));ToggleGroupItem.displayName="ToggleGroupItem";const T=i.forwardRef(((e,o)=>{const r=p("ToggleGroupItem"),t=v("ToggleGroupItem"),a=n({disabled:t.disabled||e.disabled,active:r.value.includes(e.value)});return i.createElement(I,g({},e,a,{ref:o,onFocus:l(e.onFocus,a.onFocus),onKeyDown:l(e.onKeyDown,a.onKeyDown),onMouseDown:l(e.onMouseDown,a.onMouseDown)}))})),I=i.forwardRef(((e,r)=>{const{value:t,...n}=e,a=v("ToggleGroupItem"),l=p("ToggleGroupItem"),u=l.value.includes(e.value),c=!!a.disabled||e.disabled;return i.createElement(o,g({},n,{ref:r,disabled:c,pressed:u,onPressedChange:e=>{e?l.onItemActivate(t):l.onItemDeactivate(t)}}))}));export const Root=ToggleGroup;export const Item=ToggleGroupItem;e(c,"Item",(function(){return Item})),e(c,"Root",(function(){return Root})),e(c,"ToggleGroupItem",(function(){return ToggleGroupItem})),e(c,"ToggleGroup",(function(){return ToggleGroup})); | ||
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; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-toggle-group", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"license": "MIT", | ||
@@ -21,9 +21,9 @@ "source": "src/index.ts", | ||
"@babel/runtime": "^7.13.10", | ||
"@radix-ui/primitive": "0.0.3", | ||
"@radix-ui/react-context": "0.0.3", | ||
"@radix-ui/react-polymorphic": "0.0.8", | ||
"@radix-ui/react-primitive": "0.0.9", | ||
"@radix-ui/react-roving-focus": "0.0.9", | ||
"@radix-ui/react-toggle": "0.0.4", | ||
"@radix-ui/react-use-controllable-state": "0.0.4" | ||
"@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" | ||
}, | ||
@@ -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
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
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
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
42587
103
1
+ Added@radix-ui/number@0.0.4(transitive)
+ Added@radix-ui/primitive@0.0.4(transitive)
+ Added@radix-ui/react-context@0.0.4(transitive)
+ Added@radix-ui/react-id@0.0.4(transitive)
+ Added@radix-ui/react-polymorphic@0.0.9(transitive)
+ Added@radix-ui/react-primitive@0.0.10(transitive)
+ Added@radix-ui/react-roving-focus@0.0.10(transitive)
+ Added@radix-ui/react-toggle@0.0.5(transitive)
+ Added@radix-ui/react-use-callback-ref@0.0.4(transitive)
+ Added@radix-ui/react-use-controllable-state@0.0.5(transitive)
- Removed@radix-ui/number@0.0.3(transitive)
- Removed@radix-ui/primitive@0.0.3(transitive)
- Removed@radix-ui/react-context@0.0.3(transitive)
- Removed@radix-ui/react-id@0.0.3(transitive)
- Removed@radix-ui/react-polymorphic@0.0.8(transitive)
- Removed@radix-ui/react-primitive@0.0.9(transitive)
- Removed@radix-ui/react-roving-focus@0.0.9(transitive)
- Removed@radix-ui/react-toggle@0.0.4(transitive)
- Removed@radix-ui/react-use-callback-ref@0.0.3(transitive)
- Removed@radix-ui/react-use-controllable-state@0.0.4(transitive)
Updated@radix-ui/primitive@0.0.4
Updated@radix-ui/react-toggle@0.0.5