@radix-ui/react-toggle-group
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -1,2 +0,2 @@ | ||
var e=require("@radix-ui/react-use-controllable-state").useControllableState,r=require("@radix-ui/react-toggle").Toggle,t=require("@radix-ui/react-slot").Slot,o=require("@radix-ui/react-roving-focus"),a=o.RovingFocusGroup,l=o.RovingFocusItem,n=require("@radix-ui/react-primitive").Primitive,u=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="div",f=/*#__PURE__*/i.forwardRef(((e,r)=>{if("single"===e.type)/*#__PURE__*/return i.createElement(m,c({},e,{ref:r}));if("multiple"===e.type)/*#__PURE__*/return i.createElement(v,c({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));exports.ToggleGroup=f;const[g,p]=u("ToggleGroup"),m=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u,s]=e({prop:o,defaultProp:a,onChange:l});/*#__PURE__*/return i.createElement(g,{value:u?[u]:[],onItemActivate:s,onItemDeactivate:()=>s(void 0)},/*#__PURE__*/i.createElement(x,c({},n,{ref:t})))})),v=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u=[],s]=e({prop:o,defaultProp:a,onChange:l}),d=i.useCallback((e=>s(((r=[])=>[...r,e]))),[s]),f=i.useCallback((e=>s(((r=[])=>r.filter((r=>r!==e))))),[s]);/*#__PURE__*/return i.createElement(g,{value:u,onItemActivate:d,onItemDeactivate:f},/*#__PURE__*/i.createElement(x,c({},n,{ref:t})))})),[E,b]=u("ToggleGroup"),x=/*#__PURE__*/i.forwardRef(((e,r)=>{const{as:t=d,disabled:o=!1,rovingFocus:l=!0,orientation:u,dir:s="ltr",loop:f=!0,...g}=e;/*#__PURE__*/return i.createElement(E,{rovingFocus:l,disabled:o},l?/*#__PURE__*/i.createElement(a,c({role:"group",orientation:u,dir:s,loop:f},g,{as:t,ref:r})):/*#__PURE__*/i.createElement(n,c({role:"group"},g,{as:t,ref:r})))})),I=/*#__PURE__*/i.forwardRef(((e,r)=>{const t=p("ToggleGroupItem"),o=b("ToggleGroupItem"),a=t.value.includes(e.value),l=o.disabled||e.disabled;return o.rovingFocus?/*#__PURE__*/i.createElement(R,c({},e,{ref:r,pressed:a,disabled:l})):/*#__PURE__*/i.createElement(w,c({},e,{ref:r,pressed:a,disabled:l}))}));exports.ToggleGroupItem=I;const R=/*#__PURE__*/i.forwardRef(((e,r)=>/*#__PURE__*/i.createElement(l,{as:t,focusable:!e.disabled,active:e.pressed},/*#__PURE__*/i.createElement(w,c({},e,{ref:r}))))),w=/*#__PURE__*/i.forwardRef(((e,t)=>{const{value:o,...a}=e,l=p("ToggleGroupItem");/*#__PURE__*/return i.createElement(r,c({},a,{ref:t,onPressedChange:e=>{e?l.onItemActivate(o):l.onItemDeactivate(o)}}))})),C=f;exports.Root=C;const G=I;exports.Item=G; | ||
var e=require("@radix-ui/react-use-controllable-state").useControllableState,r=require("@radix-ui/react-toggle").Toggle,t=require("@radix-ui/react-slot").Slot,o=require("@radix-ui/react-roving-focus"),a=o.RovingFocusGroup,l=o.RovingFocusItem,n=require("@radix-ui/react-primitive").Primitive,u=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="div",f=/*#__PURE__*/i.forwardRef(((e,r)=>{if("single"===e.type)/*#__PURE__*/return i.createElement(m,c({},e,{ref:r}));if("multiple"===e.type)/*#__PURE__*/return i.createElement(v,c({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));exports.ToggleGroup=f;const[g,p]=u("ToggleGroup"),m=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u,s]=e({prop:o,defaultProp:a,onChange:l});/*#__PURE__*/return i.createElement(g,{value:u?[u]:[],onItemActivate:s,onItemDeactivate:i.useCallback((()=>s("")),[s])},/*#__PURE__*/i.createElement(x,c({},n,{ref:t})))})),v=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u=[],s]=e({prop:o,defaultProp:a,onChange:l}),d=i.useCallback((e=>s(((r=[])=>[...r,e]))),[s]),f=i.useCallback((e=>s(((r=[])=>r.filter((r=>r!==e))))),[s]);/*#__PURE__*/return i.createElement(g,{value:u,onItemActivate:d,onItemDeactivate:f},/*#__PURE__*/i.createElement(x,c({},n,{ref:t})))})),[b,E]=u("ToggleGroup"),x=/*#__PURE__*/i.forwardRef(((e,r)=>{const{as:t=d,disabled:o=!1,rovingFocus:l=!0,orientation:u,dir:s="ltr",loop:f=!0,...g}=e;/*#__PURE__*/return i.createElement(b,{rovingFocus:l,disabled:o},l?/*#__PURE__*/i.createElement(a,c({role:"group",orientation:u,dir:s,loop:f},g,{as:t,ref:r})):/*#__PURE__*/i.createElement(n,c({role:"group"},g,{as:t,ref:r})))})),I=/*#__PURE__*/i.forwardRef(((e,r)=>{const t=p("ToggleGroupItem"),o=E("ToggleGroupItem"),a=t.value.includes(e.value),l=o.disabled||e.disabled;return o.rovingFocus?/*#__PURE__*/i.createElement(C,c({},e,{ref:r,pressed:a,disabled:l})):/*#__PURE__*/i.createElement(R,c({},e,{ref:r,pressed:a,disabled:l}))}));exports.ToggleGroupItem=I;const C=/*#__PURE__*/i.forwardRef(((e,r)=>/*#__PURE__*/i.createElement(l,{as:t,focusable:!e.disabled,active:e.pressed},/*#__PURE__*/i.createElement(R,c({},e,{ref:r}))))),R=/*#__PURE__*/i.forwardRef(((e,t)=>{const{value:o,...a}=e,l=p("ToggleGroupItem");/*#__PURE__*/return i.createElement(r,c({},a,{ref:t,onPressedChange:e=>{e?l.onItemActivate(o):l.onItemDeactivate(o)}}))})),w=f;exports.Root=w;const G=I;exports.Item=G; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{useControllableState as e}from"@radix-ui/react-use-controllable-state";import{Toggle as r}from"@radix-ui/react-toggle";import{Slot as t}from"@radix-ui/react-slot";import{RovingFocusGroup as o,RovingFocusItem as a}from"@radix-ui/react-roving-focus";import{Primitive as l}from"@radix-ui/react-primitive";import{createContext as n}from"@radix-ui/react-context";import i from"react";import c from"@babel/runtime/helpers/esm/extends";const u="div";export const ToggleGroup=/*#__PURE__*/i.forwardRef(((e,r)=>{if("single"===e.type)/*#__PURE__*/return i.createElement(p,c({},e,{ref:r}));if("multiple"===e.type)/*#__PURE__*/return i.createElement(d,c({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));/*#__PURE__*/const[s,m]=n("ToggleGroup"),p=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u,m]=e({prop:o,defaultProp:a,onChange:l});/*#__PURE__*/return i.createElement(s,{value:u?[u]:[],onItemActivate:m,onItemDeactivate:()=>m(void 0)},/*#__PURE__*/i.createElement(v,c({},n,{ref:t})))})),d=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u=[],m]=e({prop:o,defaultProp:a,onChange:l}),p=i.useCallback((e=>m(((r=[])=>[...r,e]))),[m]),d=i.useCallback((e=>m(((r=[])=>r.filter((r=>r!==e))))),[m]);/*#__PURE__*/return i.createElement(s,{value:u,onItemActivate:p,onItemDeactivate:d},/*#__PURE__*/i.createElement(v,c({},n,{ref:t})))})),[f,g]=n("ToggleGroup"),v=/*#__PURE__*/i.forwardRef(((e,r)=>{const{as:t=u,disabled:a=!1,rovingFocus:n=!0,orientation:s,dir:m="ltr",loop:p=!0,...d}=e;/*#__PURE__*/return i.createElement(f,{rovingFocus:n,disabled:a},n?/*#__PURE__*/i.createElement(o,c({role:"group",orientation:s,dir:m,loop:p},d,{as:t,ref:r})):/*#__PURE__*/i.createElement(l,c({role:"group"},d,{as:t,ref:r})))}));export const ToggleGroupItem=/*#__PURE__*/i.forwardRef(((e,r)=>{const t=m("ToggleGroupItem"),o=g("ToggleGroupItem"),a=t.value.includes(e.value),l=o.disabled||e.disabled;return o.rovingFocus?/*#__PURE__*/i.createElement(E,c({},e,{ref:r,pressed:a,disabled:l})):/*#__PURE__*/i.createElement(b,c({},e,{ref:r,pressed:a,disabled:l}))}));/*#__PURE__*/const E=/*#__PURE__*/i.forwardRef(((e,r)=>/*#__PURE__*/i.createElement(a,{as:t,focusable:!e.disabled,active:e.pressed},/*#__PURE__*/i.createElement(b,c({},e,{ref:r}))))),b=/*#__PURE__*/i.forwardRef(((e,t)=>{const{value:o,...a}=e,l=m("ToggleGroupItem");/*#__PURE__*/return i.createElement(r,c({},a,{ref:t,onPressedChange:e=>{e?l.onItemActivate(o):l.onItemDeactivate(o)}}))}));export const Root=ToggleGroup;export const Item=ToggleGroupItem; | ||
import{useControllableState as e}from"@radix-ui/react-use-controllable-state";import{Toggle as r}from"@radix-ui/react-toggle";import{Slot as t}from"@radix-ui/react-slot";import{RovingFocusGroup as o,RovingFocusItem as a}from"@radix-ui/react-roving-focus";import{Primitive as l}from"@radix-ui/react-primitive";import{createContext as n}from"@radix-ui/react-context";import i from"react";import c from"@babel/runtime/helpers/esm/extends";const u="div";export const ToggleGroup=/*#__PURE__*/i.forwardRef(((e,r)=>{if("single"===e.type)/*#__PURE__*/return i.createElement(p,c({},e,{ref:r}));if("multiple"===e.type)/*#__PURE__*/return i.createElement(d,c({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));/*#__PURE__*/const[s,m]=n("ToggleGroup"),p=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u,m]=e({prop:o,defaultProp:a,onChange:l});/*#__PURE__*/return i.createElement(s,{value:u?[u]:[],onItemActivate:m,onItemDeactivate:i.useCallback((()=>m("")),[m])},/*#__PURE__*/i.createElement(v,c({},n,{ref:t})))})),d=/*#__PURE__*/i.forwardRef(((r,t)=>{const{value:o,defaultValue:a,onValueChange:l=(()=>{}),...n}=r,[u=[],m]=e({prop:o,defaultProp:a,onChange:l}),p=i.useCallback((e=>m(((r=[])=>[...r,e]))),[m]),d=i.useCallback((e=>m(((r=[])=>r.filter((r=>r!==e))))),[m]);/*#__PURE__*/return i.createElement(s,{value:u,onItemActivate:p,onItemDeactivate:d},/*#__PURE__*/i.createElement(v,c({},n,{ref:t})))})),[f,g]=n("ToggleGroup"),v=/*#__PURE__*/i.forwardRef(((e,r)=>{const{as:t=u,disabled:a=!1,rovingFocus:n=!0,orientation:s,dir:m="ltr",loop:p=!0,...d}=e;/*#__PURE__*/return i.createElement(f,{rovingFocus:n,disabled:a},n?/*#__PURE__*/i.createElement(o,c({role:"group",orientation:s,dir:m,loop:p},d,{as:t,ref:r})):/*#__PURE__*/i.createElement(l,c({role:"group"},d,{as:t,ref:r})))}));export const ToggleGroupItem=/*#__PURE__*/i.forwardRef(((e,r)=>{const t=m("ToggleGroupItem"),o=g("ToggleGroupItem"),a=t.value.includes(e.value),l=o.disabled||e.disabled;return o.rovingFocus?/*#__PURE__*/i.createElement(E,c({},e,{ref:r,pressed:a,disabled:l})):/*#__PURE__*/i.createElement(b,c({},e,{ref:r,pressed:a,disabled:l}))}));/*#__PURE__*/const E=/*#__PURE__*/i.forwardRef(((e,r)=>/*#__PURE__*/i.createElement(a,{as:t,focusable:!e.disabled,active:e.pressed},/*#__PURE__*/i.createElement(b,c({},e,{ref:r}))))),b=/*#__PURE__*/i.forwardRef(((e,t)=>{const{value:o,...a}=e,l=m("ToggleGroupItem");/*#__PURE__*/return i.createElement(r,c({},a,{ref:t,onPressedChange:e=>{e?l.onItemActivate(o):l.onItemDeactivate(o)}}))}));export const Root=ToggleGroup;export const Item=ToggleGroupItem; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-toggle-group", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"license": "MIT", | ||
@@ -25,4 +25,4 @@ "source": "src/index.ts", | ||
"@radix-ui/react-primitive": "0.0.14", | ||
"@radix-ui/react-roving-focus": "0.0.14", | ||
"@radix-ui/react-slot": "0.0.11", | ||
"@radix-ui/react-roving-focus": "0.0.15", | ||
"@radix-ui/react-slot": "0.0.12", | ||
"@radix-ui/react-toggle": "0.0.9", | ||
@@ -29,0 +29,0 @@ "@radix-ui/react-use-controllable-state": "0.0.6" |
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
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
43185
+ Added@radix-ui/react-collection@0.0.14(transitive)
+ Added@radix-ui/react-roving-focus@0.0.15(transitive)
+ Added@radix-ui/react-slot@0.0.12(transitive)
- Removed@radix-ui/react-collection@0.0.13(transitive)
- Removed@radix-ui/react-roving-focus@0.0.14(transitive)
- Removed@radix-ui/react-slot@0.0.11(transitive)
Updated@radix-ui/react-slot@0.0.12