@radix-ui/react-toolbar
Advanced tools
Comparing version 0.0.1 to 0.0.2
import * as React from "react"; | ||
import { RovingFocusGroup } from "@radix-ui/react-roving-focus"; | ||
import { Primitive } from "@radix-ui/react-primitive"; | ||
import * as Polymorphic from "@radix-ui/react-polymorphic"; | ||
import { Merge } from "@radix-ui/utils"; | ||
import { Separator } from "@radix-ui/react-separator"; | ||
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; | ||
import * as Polymorphic from "@radix-ui/react-polymorphic"; | ||
type RovingFocusGroupProps = React.ComponentProps<typeof RovingFocusGroup>; | ||
type ToolbarOwnProps = Merge<Polymorphic.OwnProps<typeof Primitive>, { | ||
type ToolbarOwnProps = Polymorphic.Merge<Polymorphic.OwnProps<typeof Primitive>, { | ||
/** | ||
@@ -36,3 +35,3 @@ * The orientation of the toolbar. | ||
declare const BUTTON_DEFAULT_TAG = "button"; | ||
type ToolbarButtonOwnProps = Merge<Polymorphic.OwnProps<typeof Primitive>>; | ||
type ToolbarButtonOwnProps = Polymorphic.Merge<Polymorphic.OwnProps<typeof Primitive>>; | ||
type ToolbarButtonPrimitive = Polymorphic.ForwardRefComponent<typeof BUTTON_DEFAULT_TAG, ToolbarButtonOwnProps>; | ||
@@ -47,3 +46,3 @@ export const ToolbarButton: ToolbarButtonPrimitive; | ||
export const ToolbarRadioGroup: ToolbarRadioGroupPrimitive; | ||
type ToolbarRadioOwnProps = Merge<Polymorphic.OwnProps<typeof ToolbarButton>, Polymorphic.OwnProps<typeof RadioGroupPrimitive.Item>>; | ||
type ToolbarRadioOwnProps = Polymorphic.Merge<Polymorphic.OwnProps<typeof ToolbarButton>, Polymorphic.OwnProps<typeof RadioGroupPrimitive.Item>>; | ||
type ToolbarRadioPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof RadioGroupPrimitive.Item>, ToolbarRadioOwnProps>; | ||
@@ -50,0 +49,0 @@ export const ToolbarRadioItem: ToolbarRadioPrimitive; |
@@ -1,2 +0,2 @@ | ||
var r=f({},require("@radix-ui/react-radio-group")),e=require("@radix-ui/react-separator").Separator,o=require("@radix-ui/react-utils"),t=o.createContext,a=o.composeEventHandlers,n=require("@radix-ui/utils").getSelector,i=require("@radix-ui/react-slot").Slot,l=require("@radix-ui/react-primitive").Primitive,u=require("@radix-ui/react-roving-focus"),c=u.RovingFocusGroup,s=u.useRovingFocus,d=f({},require("react"));function f(r,e){return Object.keys(e).forEach((function(o){"default"!==o&&"__esModule"!==o&&Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[o]}})})),r}function p(){return(p=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r}).apply(this,arguments)}function b(r,e){if(null==r)return{};var o,t,a=function(r,e){if(null==r)return{};var o,t,a={},n=Object.keys(r);for(t=0;t<n.length;t++)o=n[t],e.indexOf(o)>=0||(a[o]=r[o]);return a}(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(t=0;t<n.length;t++)o=n[t],e.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(r,o)&&(a[o]=r[o])}return a}function v(r,e){(null==e||e>r.length)&&(e=r.length);for(var o=0,t=new Array(e);o<e;o++)t[o]=r[o];return t}var y,m,x=t("ToolbarContext","Toolbar"),T=(m=2,function(r){if(Array.isArray(r))return r}(y=x)||function(r,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var o=[],t=!0,a=!1,n=void 0;try{for(var i,l=r[Symbol.iterator]();!(t=(i=l.next()).done)&&(o.push(i.value),!e||o.length!==e);t=!0);}catch(r){a=!0,n=r}finally{try{t||null==l.return||l.return()}finally{if(a)throw n}}return o}}(y,m)||function(r,e){if(r){if("string"==typeof r)return v(r,e);var o=Object.prototype.toString.call(r).slice(8,-1);return"Object"===o&&r.constructor&&(o=r.constructor.name),"Map"===o||"Set"===o?Array.from(r):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?v(r,e):void 0}}(y,m)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=T[0],g=T[1],R=d.forwardRef((function(r,e){var o=r.orientation,t=void 0===o?"horizontal":o,a=r.dir,i=void 0===a?"ltr":a,u=r.loop,s=void 0===u||u,f=b(r,["orientation","dir","loop"]),v=d.useMemo((function(){return{name:"ToolbarContext",orientation:t}}),[t]);return d.createElement(w.Provider,{value:v},d.createElement(c,{orientation:t,dir:i,loop:s},d.createElement(l,p({role:"toolbar","aria-orientation":t,"data-orientation":t},f,{selector:n("Toolbar"),ref:e}))))}));exports.Toolbar=R;var h=d.forwardRef((function(r,o){var t=g("ToolbarSeparator").orientation;return d.createElement(e,p({orientation:"horizontal"===t?"vertical":"horizontal"},r,{selector:n("ToolbarSeparator"),ref:o}))}));exports.ToolbarSeparator=h,h.displayName="ToolbarSeparator";var O=d.forwardRef((function(r,e){var o=r.as,t=void 0===o?"button":o,i=r.selector,u=void 0===i?n("ToolbarButton"):i,c=r.disabled,f=b(r,["as","selector","disabled"]),v=s({disabled:c,active:!1});return d.createElement(l,p({role:"toolbaritem"},f,{as:t,selector:u,ref:e,disabled:c},v,{onFocus:a(f.onFocus,v.onFocus),onKeyDown:a(f.onKeyDown,v.onKeyDown),onMouseDown:a(f.onMouseDown,v.onMouseDown)}))}));exports.ToolbarButton=O,O.displayName="ToolbarButton";var S=d.forwardRef((function(r,e){var o=r.as,t=void 0===o?"a":o,i=b(r,["as"]);return d.createElement(O,p({},i,{as:t,selector:n("ToolbarLink"),ref:e,onKeyDown:a(i.onKeyDown,(function(r){" "===r.key&&r.currentTarget.click()}))}))}));exports.ToolbarLink=S,S.displayName="ToolbarLink";var E=d.forwardRef((function(e,o){var t=g("ToolbarRadioGroup");return d.createElement(r.Root,p({"data-orientation":t.orientation},e,{selector:n("ToolbarRadioGroup"),ref:o,rovingFocus:!1}))}));exports.ToolbarRadioGroup=E,E.displayName="ToolbarRadioGroup";var j=d.forwardRef((function(e,o){return d.createElement(O,{as:i},d.createElement(r.Item,p({},e,{selector:n("ToolbarRadioItem"),ref:o})))}));exports.ToolbarRadioItem=j,j.displayName="ToolbarRadioItem";var I=R;exports.Root=I;var k=h;exports.Separator=k;var q=O;exports.Button=q;var D=S;exports.Link=D;var A=E;exports.RadioGroup=A;var F=j;exports.RadioItem=F; | ||
var r=s({},require("@radix-ui/react-radio-group")),e=require("@radix-ui/react-separator").Separator,o=require("@radix-ui/react-slot").Slot,t=require("@radix-ui/react-primitive").Primitive,a=require("@radix-ui/react-roving-focus"),n=a.RovingFocusGroup,i=a.useRovingFocus,u=require("@radix-ui/react-context").createContext,l=require("@radix-ui/primitive").composeEventHandlers,c=s({},require("react"));function s(r,e){return Object.keys(e).forEach((function(o){"default"!==o&&"__esModule"!==o&&Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[o]}})})),r}function f(){return(f=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r}).apply(this,arguments)}function d(r,e){if(null==r)return{};var o,t,a=function(r,e){if(null==r)return{};var o,t,a={},n=Object.keys(r);for(t=0;t<n.length;t++)o=n[t],e.indexOf(o)>=0||(a[o]=r[o]);return a}(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(t=0;t<n.length;t++)o=n[t],e.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(r,o)&&(a[o]=r[o])}return a}function p(r,e){(null==e||e>r.length)&&(e=r.length);for(var o=0,t=new Array(e);o<e;o++)t[o]=r[o];return t}var v,b,y=u("Toolbar"),m=(b=2,function(r){if(Array.isArray(r))return r}(v=y)||function(r,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var o=[],t=!0,a=!1,n=void 0;try{for(var i,u=r[Symbol.iterator]();!(t=(i=u.next()).done)&&(o.push(i.value),!e||o.length!==e);t=!0);}catch(r){a=!0,n=r}finally{try{t||null==u.return||u.return()}finally{if(a)throw n}}return o}}(v,b)||function(r,e){if(r){if("string"==typeof r)return p(r,e);var o=Object.prototype.toString.call(r).slice(8,-1);return"Object"===o&&r.constructor&&(o=r.constructor.name),"Map"===o||"Set"===o?Array.from(r):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?p(r,e):void 0}}(v,b)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),x=m[0],w=m[1],g=c.forwardRef((function(r,e){var o=r.orientation,a=void 0===o?"horizontal":o,i=r.dir,u=void 0===i?"ltr":i,l=r.loop,s=void 0===l||l,p=d(r,["orientation","dir","loop"]);return c.createElement(x,{orientation:a},c.createElement(n,{orientation:a,dir:u,loop:s},c.createElement(t,f({role:"toolbar","aria-orientation":a,"data-orientation":a},p,{ref:e}))))}));exports.Toolbar=g;var h=c.forwardRef((function(r,o){var t=w("ToolbarSeparator");return c.createElement(e,f({orientation:"horizontal"===t.orientation?"vertical":"horizontal"},r,{ref:o}))}));exports.ToolbarSeparator=h,h.displayName="ToolbarSeparator";var R=c.forwardRef((function(r,e){var o=r.as,a=void 0===o?"button":o,n=r.disabled,u=d(r,["as","disabled"]),s=i({disabled:n,active:!1});return c.createElement(t,f({role:"toolbaritem",disabled:n},u,{as:a,ref:e},s,{onFocus:l(u.onFocus,s.onFocus),onKeyDown:l(u.onKeyDown,s.onKeyDown),onMouseDown:l(u.onMouseDown,s.onMouseDown)}))}));exports.ToolbarButton=R,R.displayName="ToolbarButton";var O=c.forwardRef((function(r,e){var o=r.as,t=void 0===o?"a":o,a=d(r,["as"]);return c.createElement(R,f({},a,{as:t,ref:e,onKeyDown:l(a.onKeyDown,(function(r){" "===r.key&&r.currentTarget.click()}))}))}));exports.ToolbarLink=O,O.displayName="ToolbarLink";var T=c.forwardRef((function(e,o){var t=w("ToolbarRadioGroup");return c.createElement(r.Root,f({"data-orientation":t.orientation},e,{ref:o,rovingFocus:!1}))}));exports.ToolbarRadioGroup=T,T.displayName="ToolbarRadioGroup";var S=c.forwardRef((function(e,t){return c.createElement(R,{as:o},c.createElement(r.Item,f({},e,{ref:t})))}));exports.ToolbarRadioItem=S,S.displayName="ToolbarRadioItem";var E=g;exports.Root=E;var j=h;exports.Separator=j;var q=R;exports.Button=q;var D=O;exports.Link=D;var I=T;exports.RadioGroup=I;var k=S;exports.RadioItem=k; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import*as o from"@radix-ui/react-radio-group";import{Separator as r}from"@radix-ui/react-separator";import{createContext as t,composeEventHandlers as e}from"@radix-ui/react-utils";import{getSelector as a}from"@radix-ui/utils";import{Slot as n}from"@radix-ui/react-slot";import{Primitive as i}from"@radix-ui/react-primitive";import{RovingFocusGroup as l,useRovingFocus as s}from"@radix-ui/react-roving-focus";import*as c from"react";function p(){return(p=Object.assign||function(o){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(o[e]=t[e])}return o}).apply(this,arguments)}const[u,d]=t("ToolbarContext","Toolbar");export const Toolbar=c.forwardRef(((o,r)=>{const{orientation:t="horizontal",dir:e="ltr",loop:n=!0,...s}=o,d=c.useMemo((()=>({name:"ToolbarContext",orientation:t})),[t]);return c.createElement(u.Provider,{value:d},c.createElement(l,{orientation:t,dir:e,loop:n},c.createElement(i,p({role:"toolbar","aria-orientation":t,"data-orientation":t},s,{selector:a("Toolbar"),ref:r}))))}));export const ToolbarSeparator=c.forwardRef(((o,t)=>{const{orientation:e}=d("ToolbarSeparator");return c.createElement(r,p({orientation:"horizontal"===e?"vertical":"horizontal"},o,{selector:a("ToolbarSeparator"),ref:t}))}));ToolbarSeparator.displayName="ToolbarSeparator";const b="ToolbarButton",m="button";export const ToolbarButton=c.forwardRef(((o,r)=>{const{as:t=m,selector:n=a(b),disabled:l,...u}=o,d=s({disabled:l,active:!1});return c.createElement(i,p({role:"toolbaritem"},u,{as:t,selector:n,ref:r,disabled:l},d,{onFocus:e(u.onFocus,d.onFocus),onKeyDown:e(u.onKeyDown,d.onKeyDown),onMouseDown:e(u.onMouseDown,d.onMouseDown)}))}));ToolbarButton.displayName=b;const T="a";export const ToolbarLink=c.forwardRef(((o,r)=>{const{as:t=T,...n}=o;return c.createElement(ToolbarButton,p({},n,{as:t,selector:a("ToolbarLink"),ref:r,onKeyDown:e(n.onKeyDown,(o=>{" "===o.key&&o.currentTarget.click()}))}))}));ToolbarLink.displayName="ToolbarLink";export const ToolbarRadioGroup=c.forwardRef(((r,t)=>{const e=d("ToolbarRadioGroup");return c.createElement(o.Root,p({"data-orientation":e.orientation},r,{selector:a("ToolbarRadioGroup"),ref:t,rovingFocus:!1}))}));ToolbarRadioGroup.displayName="ToolbarRadioGroup";export const ToolbarRadioItem=c.forwardRef(((r,t)=>c.createElement(ToolbarButton,{as:n},c.createElement(o.Item,p({},r,{selector:a("ToolbarRadioItem"),ref:t})))));ToolbarRadioItem.displayName="ToolbarRadioItem";export const Root=Toolbar;export const Separator=ToolbarSeparator;export const Button=ToolbarButton;export const Link=ToolbarLink;export const RadioGroup=ToolbarRadioGroup;export const RadioItem=ToolbarRadioItem; | ||
import*as o from"@radix-ui/react-radio-group";import{Separator as r}from"@radix-ui/react-separator";import{Slot as t}from"@radix-ui/react-slot";import{Primitive as a}from"@radix-ui/react-primitive";import{RovingFocusGroup as e,useRovingFocus as n}from"@radix-ui/react-roving-focus";import{createContext as i}from"@radix-ui/react-context";import{composeEventHandlers as l}from"@radix-ui/primitive";import*as c from"react";function s(){return(s=Object.assign||function(o){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(o[a]=t[a])}return o}).apply(this,arguments)}const[p,d]=i("Toolbar");export const Toolbar=c.forwardRef(((o,r)=>{const{orientation:t="horizontal",dir:n="ltr",loop:i=!0,...l}=o;return c.createElement(p,{orientation:t},c.createElement(e,{orientation:t,dir:n,loop:i},c.createElement(a,s({role:"toolbar","aria-orientation":t,"data-orientation":t},l,{ref:r}))))}));export const ToolbarSeparator=c.forwardRef(((o,t)=>{const a=d("ToolbarSeparator");return c.createElement(r,s({orientation:"horizontal"===a.orientation?"vertical":"horizontal"},o,{ref:t}))}));ToolbarSeparator.displayName="ToolbarSeparator";const u="button";export const ToolbarButton=c.forwardRef(((o,r)=>{const{as:t=u,disabled:e,...i}=o,p=n({disabled:e,active:!1});return c.createElement(a,s({role:"toolbaritem",disabled:e},i,{as:t,ref:r},p,{onFocus:l(i.onFocus,p.onFocus),onKeyDown:l(i.onKeyDown,p.onKeyDown),onMouseDown:l(i.onMouseDown,p.onMouseDown)}))}));ToolbarButton.displayName="ToolbarButton";const m="a";export const ToolbarLink=c.forwardRef(((o,r)=>{const{as:t=m,...a}=o;return c.createElement(ToolbarButton,s({},a,{as:t,ref:r,onKeyDown:l(a.onKeyDown,(o=>{" "===o.key&&o.currentTarget.click()}))}))}));ToolbarLink.displayName="ToolbarLink";export const ToolbarRadioGroup=c.forwardRef(((r,t)=>{const a=d("ToolbarRadioGroup");return c.createElement(o.Root,s({"data-orientation":a.orientation},r,{ref:t,rovingFocus:!1}))}));ToolbarRadioGroup.displayName="ToolbarRadioGroup";export const ToolbarRadioItem=c.forwardRef(((r,a)=>c.createElement(ToolbarButton,{as:t},c.createElement(o.Item,s({},r,{ref:a})))));ToolbarRadioItem.displayName="ToolbarRadioItem";export const Root=Toolbar;export const Separator=ToolbarSeparator;export const Button=ToolbarButton;export const Link=ToolbarLink;export const RadioGroup=ToolbarRadioGroup;export const RadioItem=ToolbarRadioItem; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-toolbar", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "MIT", | ||
@@ -19,8 +19,10 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@radix-ui/react-polymorphic": "0.0.5", | ||
"@radix-ui/react-primitive": "0.0.4", | ||
"@radix-ui/react-roving-focus": "0.0.5", | ||
"@radix-ui/react-slot": "0.0.3", | ||
"@radix-ui/react-utils": "0.0.5", | ||
"@radix-ui/utils": "0.0.3" | ||
"@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.5", | ||
"@radix-ui/react-radio-group": "0.0.7", | ||
"@radix-ui/react-roving-focus": "0.0.6", | ||
"@radix-ui/react-separator": "0.0.6", | ||
"@radix-ui/react-slot": "0.0.4" | ||
}, | ||
@@ -27,0 +29,0 @@ "peerDependencies": { |
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
35091
9
81
+ Added@radix-ui/primitive@0.0.1
+ Added@radix-ui/number@0.0.1(transitive)
+ Added@radix-ui/primitive@0.0.1(transitive)
+ Added@radix-ui/react-compose-refs@0.0.1(transitive)
+ Added@radix-ui/react-context@0.0.1(transitive)
+ Added@radix-ui/react-id@0.0.1(transitive)
+ Added@radix-ui/react-label@0.0.6(transitive)
+ Added@radix-ui/react-polymorphic@0.0.6(transitive)
+ Added@radix-ui/react-presence@0.0.6(transitive)
+ Added@radix-ui/react-primitive@0.0.5(transitive)
+ Added@radix-ui/react-radio-group@0.0.7(transitive)
+ Added@radix-ui/react-roving-focus@0.0.6(transitive)
+ Added@radix-ui/react-separator@0.0.6(transitive)
+ Added@radix-ui/react-slot@0.0.4(transitive)
+ Added@radix-ui/react-use-callback-ref@0.0.1(transitive)
+ Added@radix-ui/react-use-controllable-state@0.0.1(transitive)
- Removed@radix-ui/react-utils@0.0.5
- Removed@radix-ui/utils@0.0.3
- Removed@radix-ui/react-polymorphic@0.0.5(transitive)
- Removed@radix-ui/react-primitive@0.0.4(transitive)
- Removed@radix-ui/react-roving-focus@0.0.5(transitive)
- Removed@radix-ui/react-slot@0.0.3(transitive)
- Removed@radix-ui/react-utils@0.0.5(transitive)
- Removed@radix-ui/utils@0.0.3(transitive)
Updated@radix-ui/react-slot@0.0.4