@radix-ui/react-toggle-group
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
function e(e,r,o){Object.defineProperty(e,r,{get:o,enumerable:!0})}var r,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=(r=require("react"))&&r.__esModule?r.default:r,g={};function p(){return(p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(this,arguments)}const d=s.forwardRef(((e,r)=>{if("single"===e.type)return s.createElement(v,p({},e,{ref:r}));if("multiple"===e.type)return s.createElement(b,p({},e,{ref:r}));throw new Error("Missing prop `type` expected on `ToggleGroup`")}));exports.ToggleGroup=d,d.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(I,p({},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]),g=s.useCallback((e=>i(((r=[])=>r.filter((r=>r!==e))))),[i]);return s.createElement(f,{value:u,onItemActivate:c,onItemDeactivate:g},s.createElement(I,p({},a,{ref:r})))}));d.displayName="ToggleGroup";const[w,G]=c("ToggleGroup"),I=s.forwardRef(((e,r)=>{const{disabled:o=!1,rovingFocus:n=!0,...u}=e,l=s.createElement(t,p({role:"group"},u,{ref:r}));return s.createElement(w,{rovingFocus:n,disabled:o},n?s.createElement(a,{loop:!0},l):l)})),T=s.forwardRef(((e,r)=>G("ToggleGroupItem").rovingFocus?s.createElement(E,p({},e,{ref:r})):s.createElement(x,p({},e,{ref:r}))));exports.ToggleGroupItem=T,T.displayName="ToggleGroupItem";const E=s.forwardRef(((e,r)=>{const o=m("ToggleGroupItem"),t=G("ToggleGroupItem"),n=u({disabled:t.disabled||e.disabled,active:o.value.includes(e.value)});return s.createElement(x,p({},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=G("ToggleGroupItem"),u=m("ToggleGroupItem"),l=u.value.includes(e.value),i=!!a.disabled||e.disabled;return s.createElement(o,p({},n,{ref:r,disabled:i,pressed:l,onPressedChange:e=>{e?u.onItemActivate(t):u.onItemDeactivate(t)}}))})),y=d;exports.Root=y;const R=T;exports.Item=R,e(g,"Item",(function(){return R})),e(g,"Root",(function(){return y})),e(g,"ToggleGroupItem",(function(){return T})),e(g,"ToggleGroup",(function(){return d})); | ||
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")),d=e(require("@babel/runtime-corejs3/core-js-stable/instance/includes")),f=e(require("@babel/runtime-corejs3/core-js-stable/instance/filter")),g=e(require("@babel/runtime-corejs3/core-js-stable/instance/concat")),v=e(require("@babel/runtime-corejs3/helpers/extends")),p=e(require("@babel/runtime-corejs3/helpers/slicedToArray")),m=e(require("@babel/runtime-corejs3/helpers/objectWithoutProperties")),b=e(require("@babel/runtime-corejs3/helpers/toConsumableArray")),T={},G=s.forwardRef((function(e,r){if("single"===e.type)return s.createElement(q,v({},e,{ref:r}));if("multiple"===e.type)return s.createElement(x,v({},e,{ref:r}));throw new Error("Missing prop `type` expected on `".concat("ToggleGroup","`"))}));exports.ToggleGroup=G,G.displayName="ToggleGroup";var I=c("ToggleGroup"),h=p(I,2),w=h[0],E=h[1],q=s.forwardRef((function(e,r){var o=e.value,t=e.defaultValue,n=e.onValueChange,a=void 0===n?function(){}:n,u=m(e,["value","defaultValue","onValueChange"]),i=l({prop:o,defaultProp:t,onChange:a}),c=p(i,2),d=c[0],f=c[1];return s.createElement(w,{value:d?[d]:[],onItemActivate:f,onItemDeactivate:function(){return f(void 0)}},s.createElement(D,v({},u,{ref:r})))})),x=s.forwardRef((function(e,r){var o=e.value,t=e.defaultValue,n=e.onValueChange,a=void 0===n?function(){}:n,u=m(e,["value","defaultValue","onValueChange"]),i=l({prop:o,defaultProp:t,onChange:a}),c=p(i,2),d=c[0],T=void 0===d?[]:d,G=c[1],I=s.useCallback((function(e){return G((function(){var r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return g(r=[]).call(r,b(o),[e])}))}),[G]),h=s.useCallback((function(e){return G((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return f(r).call(r,(function(r){return r!==e}))}))}),[G]);return s.createElement(w,{value:T,onItemActivate:I,onItemDeactivate:h},s.createElement(D,v({},u,{ref:r})))}));G.displayName="ToggleGroup";var j=c("ToggleGroup"),y=p(j,2),C=y[0],R=y[1],D=s.forwardRef((function(e,r){var o=e.disabled,n=void 0!==o&&o,u=e.rovingFocus,l=void 0===u||u,i=m(e,["disabled","rovingFocus"]),c=s.createElement(t,v({role:"group"},i,{ref:r}));return s.createElement(C,{rovingFocus:l,disabled:n},l?s.createElement(a,{loop:!0},c):c)})),F=s.forwardRef((function(e,r){return R("ToggleGroupItem").rovingFocus?s.createElement(V,v({},e,{ref:r})):s.createElement(P,v({},e,{ref:r}))}));exports.ToggleGroupItem=F,F.displayName="ToggleGroupItem";var V=s.forwardRef((function(e,r){var o,t=E("ToggleGroupItem"),n=R("ToggleGroupItem"),a=u({disabled:n.disabled||e.disabled,active:d(o=t.value).call(o,e.value)});return s.createElement(P,v({},e,a,{ref:r,onFocus:i(e.onFocus,a.onFocus),onKeyDown:i(e.onKeyDown,a.onKeyDown),onMouseDown:i(e.onMouseDown,a.onMouseDown)}))})),P=s.forwardRef((function(e,r){var t,n=e.value,a=m(e,["value"]),u=R("ToggleGroupItem"),l=E("ToggleGroupItem"),i=d(t=l.value).call(t,e.value),c=!!u.disabled||e.disabled;return s.createElement(o,v({},a,{ref:r,disabled:c,pressed:i,onPressedChange:function(e){e?l.onItemActivate(n):l.onItemDeactivate(n)}}))})),A=G;exports.Root=A;var M=F;exports.Item=M,r(T,"Item",(function(){return M})),r(T,"Root",(function(){return A})),r(T,"ToggleGroupItem",(function(){return F})),r(T,"ToggleGroup",(function(){return G})); | ||
//# 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";var c={};function g(){return(g=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}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[p,m]=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(p,{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}),m=i.useCallback((e=>c(((o=[])=>[...o,e]))),[c]),s=i.useCallback((e=>c(((o=[])=>o.filter((o=>o!==e))))),[c]);return i.createElement(p,{value:u,onItemActivate:m,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=m("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=m("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})); | ||
function e(e,r,o){Object.defineProperty(e,r,{get:o,enumerable:!0})}import{Toggle as r}from"@radix-ui/react-toggle";import{Primitive as o}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 u}from"@radix-ui/primitive";import{createContext as l}from"@radix-ui/react-context";import i from"react";import c from"@babel/runtime-corejs3/core-js-stable/instance/includes";import m from"@babel/runtime-corejs3/core-js-stable/instance/filter";import f from"@babel/runtime-corejs3/core-js-stable/instance/concat";import p from"@babel/runtime-corejs3/helpers/esm/extends";import g from"@babel/runtime-corejs3/helpers/esm/slicedToArray";import s from"@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";import d from"@babel/runtime-corejs3/helpers/esm/toConsumableArray";var v={};export var ToggleGroup=i.forwardRef((function(e,r){if("single"===e.type)return i.createElement(h,p({},e,{ref:r}));if("multiple"===e.type)return i.createElement(w,p({},e,{ref:r}));throw new Error("Missing prop `type` expected on `".concat("ToggleGroup","`"))}));ToggleGroup.displayName="ToggleGroup";var b=l("ToggleGroup"),T=g(b,2),G=T[0],I=T[1],h=i.forwardRef((function(e,r){var o=e.value,t=e.defaultValue,n=e.onValueChange,u=void 0===n?function(){}:n,l=s(e,["value","defaultValue","onValueChange"]),c=a({prop:o,defaultProp:t,onChange:u}),m=g(c,2),f=m[0],d=m[1];return i.createElement(G,{value:f?[f]:[],onItemActivate:d,onItemDeactivate:function(){return d(void 0)}},i.createElement(C,p({},l,{ref:r})))})),w=i.forwardRef((function(e,r){var o=e.value,t=e.defaultValue,n=e.onValueChange,u=void 0===n?function(){}:n,l=s(e,["value","defaultValue","onValueChange"]),c=a({prop:o,defaultProp:t,onChange:u}),v=g(c,2),b=v[0],T=void 0===b?[]:b,I=v[1],h=i.useCallback((function(e){return I((function(){var r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return f(r=[]).call(r,d(o),[e])}))}),[I]),w=i.useCallback((function(e){return I((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return m(r).call(r,(function(r){return r!==e}))}))}),[I]);return i.createElement(G,{value:T,onItemActivate:h,onItemDeactivate:w},i.createElement(C,p({},l,{ref:r})))}));ToggleGroup.displayName="ToggleGroup";var E=l("ToggleGroup"),x=g(E,2),j=x[0],y=x[1],C=i.forwardRef((function(e,r){var n=e.disabled,a=void 0!==n&&n,u=e.rovingFocus,l=void 0===u||u,c=s(e,["disabled","rovingFocus"]),m=i.createElement(o,p({role:"group"},c,{ref:r}));return i.createElement(j,{rovingFocus:l,disabled:a},l?i.createElement(t,{loop:!0},m):m)}));export var ToggleGroupItem=i.forwardRef((function(e,r){return y("ToggleGroupItem").rovingFocus?i.createElement(R,p({},e,{ref:r})):i.createElement(D,p({},e,{ref:r}))}));ToggleGroupItem.displayName="ToggleGroupItem";var R=i.forwardRef((function(e,r){var o,t=I("ToggleGroupItem"),a=y("ToggleGroupItem"),l=n({disabled:a.disabled||e.disabled,active:c(o=t.value).call(o,e.value)});return i.createElement(D,p({},e,l,{ref:r,onFocus:u(e.onFocus,l.onFocus),onKeyDown:u(e.onKeyDown,l.onKeyDown),onMouseDown:u(e.onMouseDown,l.onMouseDown)}))})),D=i.forwardRef((function(e,o){var t,n=e.value,a=s(e,["value"]),u=y("ToggleGroupItem"),l=I("ToggleGroupItem"),m=c(t=l.value).call(t,e.value),f=!!u.disabled||e.disabled;return i.createElement(r,p({},a,{ref:o,disabled:f,pressed:m,onPressedChange:function(e){e?l.onItemActivate(n):l.onItemDeactivate(n)}}))}));export var Root=ToggleGroup;export var Item=ToggleGroupItem;e(v,"Item",(function(){return Item})),e(v,"Root",(function(){return Root})),e(v,"ToggleGroupItem",(function(){return ToggleGroupItem})),e(v,"ToggleGroup",(function(){return ToggleGroup})); | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-toggle-group", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "MIT", | ||
@@ -16,12 +16,14 @@ "source": "src/index.ts", | ||
"clean": "rm -rf dist", | ||
"prepublish": "yarn clean" | ||
"prepublish": "yarn clean", | ||
"version": "yarn version" | ||
}, | ||
"dependencies": { | ||
"@radix-ui/primitive": "0.0.1", | ||
"@radix-ui/react-context": "0.0.1", | ||
"@radix-ui/react-polymorphic": "0.0.6", | ||
"@radix-ui/react-primitive": "0.0.6", | ||
"@radix-ui/react-roving-focus": "0.0.6", | ||
"@radix-ui/react-toggle": "0.0.1", | ||
"@radix-ui/react-use-controllable-state": "0.0.1" | ||
"@babel/runtime-corejs3": "^7.13.10", | ||
"@radix-ui/primitive": "0.0.2", | ||
"@radix-ui/react-context": "0.0.2", | ||
"@radix-ui/react-polymorphic": "0.0.7", | ||
"@radix-ui/react-primitive": "0.0.7", | ||
"@radix-ui/react-roving-focus": "0.0.7", | ||
"@radix-ui/react-toggle": "0.0.2", | ||
"@radix-ui/react-use-controllable-state": "0.0.2" | ||
}, | ||
@@ -28,0 +30,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
47198
113
9
1
+ Added@babel/runtime-corejs3@7.26.7(transitive)
+ Added@radix-ui/number@0.0.2(transitive)
+ Added@radix-ui/primitive@0.0.2(transitive)
+ Added@radix-ui/react-context@0.0.2(transitive)
+ Added@radix-ui/react-id@0.0.2(transitive)
+ Added@radix-ui/react-polymorphic@0.0.7(transitive)
+ Added@radix-ui/react-primitive@0.0.7(transitive)
+ Added@radix-ui/react-roving-focus@0.0.7(transitive)
+ Added@radix-ui/react-toggle@0.0.2(transitive)
+ Added@radix-ui/react-use-callback-ref@0.0.2(transitive)
+ Added@radix-ui/react-use-controllable-state@0.0.2(transitive)
+ Addedcore-js-pure@3.40.0(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
- Removed@radix-ui/number@0.0.1(transitive)
- Removed@radix-ui/primitive@0.0.1(transitive)
- Removed@radix-ui/react-context@0.0.1(transitive)
- Removed@radix-ui/react-id@0.0.1(transitive)
- Removed@radix-ui/react-polymorphic@0.0.6(transitive)
- Removed@radix-ui/react-primitive@0.0.6(transitive)
- Removed@radix-ui/react-roving-focus@0.0.6(transitive)
- Removed@radix-ui/react-toggle@0.0.1(transitive)
- Removed@radix-ui/react-use-callback-ref@0.0.1(transitive)
- Removed@radix-ui/react-use-controllable-state@0.0.1(transitive)
Updated@radix-ui/primitive@0.0.2
Updated@radix-ui/react-toggle@0.0.2