@jamsrui/icon-button 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3VT7MADY.mjs +1 -0
- package/dist/chunk-642ZKQLN.mjs +1 -0
- package/dist/chunk-AM5OBLNV.mjs +1 -0
- package/dist/chunk-C2NDYKQV.mjs +1 -0
- package/dist/chunk-DR6VZTQI.mjs +1 -0
- package/dist/chunk-FAPKIOXX.mjs +1 -0
- package/dist/chunk-NOUFGOWI.mjs +1 -0
- package/dist/chunk-O6GV3TA3.mjs +1 -0
- package/dist/icon-button-config.d.mts +3 -1
- package/dist/icon-button-config.mjs +1 -1
- package/dist/icon-button-context.d.mts +14 -0
- package/dist/icon-button-context.mjs +1 -0
- package/dist/icon-button-label.d.mts +5 -0
- package/dist/icon-button-label.mjs +1 -0
- package/dist/icon-button-loading.d.mts +10 -0
- package/dist/icon-button-loading.mjs +1 -0
- package/dist/icon-button-root.d.mts +11 -0
- package/dist/icon-button-root.mjs +1 -0
- package/dist/icon-button.d.mts +11 -1
- package/dist/icon-button.mjs +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +1 -1
- package/dist/spinner.d.mts +8 -0
- package/dist/spinner.mjs +1 -0
- package/dist/styles.d.mts +0 -3
- package/dist/styles.mjs +1 -1
- package/dist/use-icon-button.d.mts +22 -4
- package/dist/use-icon-button.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-5BXYNIKP.mjs +0 -1
- package/dist/chunk-67ROXZH3.mjs +0 -1
- package/dist/chunk-BK47RZ6L.mjs +0 -1
- package/dist/chunk-WOIOR7OF.mjs +0 -1
- package/dist/icon-button-CNSWjtbn.d.mts +0 -25
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createConfigContext as o}from"@jamsrui/utils";var[n,e]=o({displayName:"IconButtonConfig"});export{n as a,e as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as i}from"react/jsx-runtime";var o=e=>{let{size:r=20}=e;return t("svg",{fill:"currentColor",height:r,viewBox:"0 0 24 24",width:r,xmlns:"http://www.w3.org/2000/svg",children:i("g",{children:[t("rect",{height:5,opacity:".14",width:2,x:11,y:1}),t("rect",{height:5,opacity:".29",transform:"rotate(30 12 12)",width:2,x:11,y:1}),t("rect",{height:5,opacity:".43",transform:"rotate(60 12 12)",width:2,x:11,y:1}),t("rect",{height:5,opacity:".57",transform:"rotate(90 12 12)",width:2,x:11,y:1}),t("rect",{height:5,opacity:".71",transform:"rotate(120 12 12)",width:2,x:11,y:1}),t("rect",{height:5,opacity:".86",transform:"rotate(150 12 12)",width:2,x:11,y:1}),t("rect",{height:5,transform:"rotate(180 12 12)",width:2,x:11,y:1}),t("animateTransform",{attributeName:"transform",calcMode:"discrete",dur:"0.75s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12"})]})})};export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk-NOUFGOWI.mjs";import{a as n}from"./chunk-O6GV3TA3.mjs";import{a as t}from"./chunk-DR6VZTQI.mjs";import{jsx as e}from"react/jsx-runtime";var p=o=>{let{children:r}=o,u=c(o);return e(t,{value:u,children:e(n,{children:r})})};export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o}from"./chunk-DR6VZTQI.mjs";import{jsx as e}from"react/jsx-runtime";var s=()=>{let{getLabelProps:t,label:n}=o();return e("span",{...t({}),children:n})};export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as o,use as n}from"react";var e=o(null),r=()=>{let t=n(e);if(!t)throw new Error("useIconButtonContext must be used within a IconButtonContext");return t};export{e as a,r as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{allColors as r,allVariants as i,colorVariants as n,radiusBaseVariant as e,tv as o}from"@jamsrui/utils";var d=o({base:["icon-button","z-0","cursor-default","shrink-0","group","relative","inline-flex","items-center","justify-center","box-border","appearance-none","outline-none","select-none","whitespace-nowrap","min-w-max","font-medium","tap-highlight-transparent","transition-transform duration-300","focus-visible:ring-2 focus-visible:ring-primary","data-disabled:cursor-not-allowed data-disabled:opacity-60","text-transform-inherit"],variants:{color:{default:"",primary:"",secondary:"",success:"",warning:"",danger:""},variant:{solid:"",bordered:"border bg-transparent",light:"",text:"",flat:""},size:{sm:"size-6 rounded",md:"size-8 min-w-8 rounded-lg",lg:"size-10 min-w-10 rounded-xl"},disableAnimation:{true:"transition-none!",false:"data-pressed:scale-98"},radius:e},compoundVariants:[...i.flatMap(a=>r.map(t=>({variant:a,color:t,className:n[a][t]})))],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!1}});export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-FAPKIOXX.mjs";import{useCallback as b,useId as V,useMemo as h}from"react";import{useHover as C,useMergeRefs as L,usePress as N}from"@jamsrui/hooks";import{cn as A,dataAttr as e,dataAttrDev as D,mapPropsVariants as G}from"@jamsrui/utils";var E=I=>{let[g,B]=G(I,r.variantKeys),{type:a="button",label:n,isLoading:t=!1,disabled:y=!1,className:i,ref:R,loadingIcon:p,...c}=g,d=r(B),s=V(),o=t||y,{isHovered:l,ref:v}=C({isDisabled:o}),{isPressed:m,ref:x}=N({isDisabled:o}),u=L([R,v,x]),f=b(()=>({...c,ref:u,"data-component":D("icon-button"),className:A(d,i),"aria-labelledby":s,type:a,disabled:o,"data-disabled":e(o),"aria-disabled":e(o),"data-loading":e(t),"data-pressed":e(m),"data-hover":e(l)}),[i,s,o,l,t,m,u,c,d,a]),P=b(()=>({"aria-hidden":!0,id:s,className:"sr-only"}),[s]);return h(()=>({getButtonProps:f,getLabelProps:P,isLoading:t,isDisabled:o,label:n,loadingIcon:p}),[f,P,o,t,n,p])};export{E as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-C2NDYKQV.mjs";import{b as o}from"./chunk-DR6VZTQI.mjs";import{a as n}from"./chunk-642ZKQLN.mjs";import{useRenderElement as s}from"@jamsrui/hooks";import{Fragment as c,jsx as r,jsxs as d}from"react/jsx-runtime";var h=e=>{let{getButtonProps:p,loadingIcon:i=r(n,{}),isLoading:m}=o();return s("button",{props:[p(),{children:d(c,{children:[r(t,{}),m?i:e.children]})}]})};export{h as a};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconButton } from './icon-button.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { GlobalConfigProps } from '@jamsrui/core';
|
|
4
|
+
import './use-icon-button.mjs';
|
|
4
5
|
import 'react';
|
|
5
6
|
import '@jamsrui/utils';
|
|
7
|
+
import './icon-button-root.mjs';
|
|
6
8
|
import './styles.mjs';
|
|
7
9
|
|
|
8
10
|
declare const useIconButtonConfig: () => Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
"use client";import{a,b}from"./chunk-3VT7MADY.mjs";export{a as IconButtonConfig,b as useIconButtonConfig};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { useIconButton } from './use-icon-button.mjs';
|
|
3
|
+
import '@jamsrui/utils';
|
|
4
|
+
import './icon-button-root.mjs';
|
|
5
|
+
import './styles.mjs';
|
|
6
|
+
|
|
7
|
+
declare const useIconButtonContext: () => IconButtonContext.Props;
|
|
8
|
+
declare const IconButtonContext: react.Context<IconButtonContext.Props | null>;
|
|
9
|
+
declare namespace IconButtonContext {
|
|
10
|
+
interface Props extends ReturnType<typeof useIconButton> {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { IconButtonContext, useIconButtonContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a,b}from"./chunk-DR6VZTQI.mjs";export{a as IconButtonContext,b as useIconButtonContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-C2NDYKQV.mjs";import"./chunk-DR6VZTQI.mjs";export{a as IconButtonLabel};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare const IconButtonLoading: (props: IconButtonLoading.Props) => react_jsx_runtime.JSX.Element;
|
|
4
|
+
declare namespace IconButtonLoading {
|
|
5
|
+
interface Props {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { IconButtonLoading };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as o}from"./chunk-DR6VZTQI.mjs";import{a as t}from"./chunk-642ZKQLN.mjs";import{jsx as e}from"react/jsx-runtime";var s=c=>{let{children:a=e(t,{})}=c,{isLoading:n}=o();return e("span",{className:n?"":"hidden",children:n?a:null})};export{s as IconButtonLoading};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { UIProps } from '@jamsrui/utils';
|
|
4
|
+
|
|
5
|
+
declare const IconButtonRoot: (props: PropsWithChildren) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
6
|
+
declare namespace IconButtonRoot {
|
|
7
|
+
interface Props extends UIProps<"button"> {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { IconButtonRoot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-O6GV3TA3.mjs";import"./chunk-C2NDYKQV.mjs";import"./chunk-DR6VZTQI.mjs";import"./chunk-642ZKQLN.mjs";export{a as IconButtonRoot};
|
package/dist/icon-button.d.mts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { useIconButton } from './use-icon-button.mjs';
|
|
1
3
|
import 'react';
|
|
2
|
-
export { I as IconButton } from './icon-button-CNSWjtbn.mjs';
|
|
3
4
|
import '@jamsrui/utils';
|
|
5
|
+
import './icon-button-root.mjs';
|
|
4
6
|
import './styles.mjs';
|
|
7
|
+
|
|
8
|
+
declare const IconButton: (props: IconButton.Props) => react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare namespace IconButton {
|
|
10
|
+
interface Props extends useIconButton.Props {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { IconButton };
|
package/dist/icon-button.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
"use client";import{a}from"./chunk-AM5OBLNV.mjs";import"./chunk-NOUFGOWI.mjs";import"./chunk-FAPKIOXX.mjs";import"./chunk-O6GV3TA3.mjs";import"./chunk-C2NDYKQV.mjs";import"./chunk-DR6VZTQI.mjs";import"./chunk-642ZKQLN.mjs";export{a as IconButton};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { IconButton } from './icon-button.mjs';
|
|
2
2
|
export { IconButtonConfig, useIconButtonConfig } from './icon-button-config.mjs';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import './use-icon-button.mjs';
|
|
3
5
|
import 'react';
|
|
4
6
|
import '@jamsrui/utils';
|
|
7
|
+
import './icon-button-root.mjs';
|
|
5
8
|
import './styles.mjs';
|
|
6
|
-
import 'react/jsx-runtime';
|
|
7
9
|
import '@jamsrui/core';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as o,b as n}from"./chunk-3VT7MADY.mjs";import{a as t}from"./chunk-AM5OBLNV.mjs";import"./chunk-NOUFGOWI.mjs";import"./chunk-FAPKIOXX.mjs";import"./chunk-O6GV3TA3.mjs";import"./chunk-C2NDYKQV.mjs";import"./chunk-DR6VZTQI.mjs";import"./chunk-642ZKQLN.mjs";export{t as IconButton,o as IconButtonConfig,n as useIconButtonConfig};
|
package/dist/spinner.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-642ZKQLN.mjs";export{a as LoadingSpinner};
|
package/dist/styles.d.mts
CHANGED
|
@@ -18,7 +18,6 @@ declare const iconButtonVariants: _jamsrui_utils.TVReturnType<{
|
|
|
18
18
|
flat: string;
|
|
19
19
|
};
|
|
20
20
|
size: {
|
|
21
|
-
xs: string;
|
|
22
21
|
sm: string;
|
|
23
22
|
md: string;
|
|
24
23
|
lg: string;
|
|
@@ -54,7 +53,6 @@ declare const iconButtonVariants: _jamsrui_utils.TVReturnType<{
|
|
|
54
53
|
flat: string;
|
|
55
54
|
};
|
|
56
55
|
size: {
|
|
57
|
-
xs: string;
|
|
58
56
|
sm: string;
|
|
59
57
|
md: string;
|
|
60
58
|
lg: string;
|
|
@@ -90,7 +88,6 @@ declare const iconButtonVariants: _jamsrui_utils.TVReturnType<{
|
|
|
90
88
|
flat: string;
|
|
91
89
|
};
|
|
92
90
|
size: {
|
|
93
|
-
xs: string;
|
|
94
91
|
sm: string;
|
|
95
92
|
md: string;
|
|
96
93
|
lg: string;
|
package/dist/styles.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-FAPKIOXX.mjs";export{a as iconButtonVariants};
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import '@jamsrui/utils';
|
|
3
|
-
|
|
4
|
-
import './styles.mjs';
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { PropGetter } from '@jamsrui/utils';
|
|
3
|
+
import { IconButtonRoot } from './icon-button-root.mjs';
|
|
4
|
+
import { IconButtonVariantProps } from './styles.mjs';
|
|
5
|
+
|
|
6
|
+
declare const useIconButton: (props: useIconButton.Props) => {
|
|
7
|
+
getButtonProps: () => Partial<IconButtonRoot.Props>;
|
|
8
|
+
getLabelProps: PropGetter<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
isDisabled: boolean;
|
|
11
|
+
label: string;
|
|
12
|
+
loadingIcon: react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare namespace useIconButton {
|
|
15
|
+
interface Props extends IconButtonVariantProps, IconButtonRoot.Props {
|
|
16
|
+
label: string;
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
loadingIcon?: React.ReactElement;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { useIconButton };
|
package/dist/use-icon-button.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-NOUFGOWI.mjs";import"./chunk-FAPKIOXX.mjs";export{a as useIconButton};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/icon-button",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/
|
|
10
|
-
"@jamsrui/
|
|
8
|
+
"@jamsrui/hooks": "^0.0.13",
|
|
9
|
+
"@jamsrui/core": "^0.0.11",
|
|
10
|
+
"@jamsrui/utils": "^0.0.13"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
package/dist/chunk-5BXYNIKP.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{allColors as i,allVariants as t,colorVariants as e,radiusBaseVariant as n,tv as s}from"@jamsrui/utils";var d=s({base:["z-0","cursor-default","shrink-0","group","relative","inline-flex","items-center","justify-center","box-border","appearance-none","outline-none","select-none","whitespace-nowrap","min-w-max","font-medium","tap-highlight-transparent","transition-transform duration-300","focus-visible:ring-2 focus-visible:ring-primary","data-disabled:cursor-not-allowed data-disabled:opacity-60","text-transform-inherit"],variants:{color:{default:"",primary:"",secondary:"",success:"",warning:"",danger:""},variant:{solid:"",bordered:"border bg-transparent",light:"",text:"",flat:""},size:{xs:"size-6 rounded",sm:"size-8 min-w-8 rounded-lg",md:"size-10 min-w-10 rounded-xl",lg:"size-12 min-w-12 rounded-2xl"},disableAnimation:{true:"transition-none!",false:"data-pressed:scale-98"},radius:n},compoundVariants:[...t.flatMap(a=>i.map(r=>({variant:a,color:r,className:e[a][r]})))],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!1}});export{d as a};
|
package/dist/chunk-67ROXZH3.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-BK47RZ6L.mjs";import{useRenderElement as p}from"@jamsrui/hooks";import{Fragment as d,jsx as u,jsxs as m}from"react/jsx-runtime";var I=o=>{let{children:n}=o,e=t(o),{getButtonProps:r,getLabelProps:s}=e,c=m(d,{children:[u("span",{...s({})}),n]});return p("button",{props:[r(),{children:c}]})};export{I as a};
|
package/dist/chunk-BK47RZ6L.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-5BXYNIKP.mjs";import{useCallback as b,useId as x,useMemo as R}from"react";import{useHover as V,useMergeRefs as h,usePress as C}from"@jamsrui/hooks";import{cn as L,dataAttr as e,dataAttrDev as N,mapPropsVariants as A}from"@jamsrui/utils";var k=P=>{let[f,y]=A(P,r.variantKeys),{type:a="button",label:G,isDisabled:I=!1,isLoading:t=!1,disabled:B=!1,className:n,ref:g,...i}=f,p=r(y),s=x(),o=I||t||B,{isHovered:l,ref:v}=V({isDisabled:o}),{isPressed:d,ref:D}=C({isDisabled:o}),c=h([g,v,D]),m=b(()=>({...i,ref:c,"data-component":N("icon-button"),className:L(p,n),"aria-labelledby":s,type:a,disabled:o,"data-disabled":e(o),"aria-disabled":e(o),"data-loading":e(t),"data-pressed":e(d),"data-hover":e(l)}),[n,s,o,l,t,d,c,i,p,a]),u=b(()=>({"aria-hidden":!0,id:s,className:"sr-only"}),[s]);return R(()=>({getButtonProps:m,getLabelProps:u,isLoading:t,isDisabled:o}),[m,u,o,t])};export{k as a};
|
package/dist/chunk-WOIOR7OF.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createConfigContext as o}from"@jamsrui/utils";var[n,r]=o({displayName:"IconButtonConfig"});export{n as a,r as b};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { PropGetter, UIProps } from '@jamsrui/utils';
|
|
3
|
-
import { IconButtonVariantProps } from './styles.mjs';
|
|
4
|
-
|
|
5
|
-
declare const useIconButton: (props: useIconButton.Props) => {
|
|
6
|
-
getButtonProps: () => Partial<IconButton.Props>;
|
|
7
|
-
getLabelProps: PropGetter<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
8
|
-
isLoading: boolean;
|
|
9
|
-
isDisabled: boolean;
|
|
10
|
-
};
|
|
11
|
-
declare namespace useIconButton {
|
|
12
|
-
interface Props extends IconButtonVariantProps, UIProps<"button"> {
|
|
13
|
-
label: string;
|
|
14
|
-
isDisabled?: boolean;
|
|
15
|
-
isLoading?: boolean;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare const IconButton: (props: IconButton.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
20
|
-
declare namespace IconButton {
|
|
21
|
-
interface Props extends useIconButton.Props {
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { IconButton as I, useIconButton as u };
|