@jamsrui/circular-progress 0.0.12 → 0.0.14
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/circular-progress-config.mjs +1 -1
- package/dist/circular-progress.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/styles.mjs +1 -1
- package/dist/use-circular-progress.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-BX7O4L5O.mjs +0 -1
- package/dist/chunk-Q2GZXDOX.mjs +0 -1
- package/dist/chunk-Q6AUZAGM.mjs +0 -1
- package/dist/chunk-S2GU4VPD.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createConfigContext as r}from"@jamsrui/utils";const[s,e]=r({displayName:"CircularProgressContext"});export{s as CircularProgressConfig,e as useCircularProgressConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as r,jsxs as m}from"react/jsx-runtime";import{mergeConfigProps as l}from"@jamsrui/utils";import{useCircularProgressConfig as n}from"./circular-progress-config.mjs";import{useCircularProgress as u}from"./use-circular-progress.mjs";const b=s=>{const o=n(),e=l(o,o,s),t=u(e),{showLabel:c,getRootProps:g,getTrackProps:p,getLabelProps:P,getProgressProps:i,label:a}=t;return m("svg",{...g({}),children:[r("circle",{...p({})}),r("circle",{...i({})}),!!c&&r("text",{...P({}),children:a})]})};export{b as CircularProgress};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{CircularProgress as e}from"./circular-progress.mjs";import{CircularProgressConfig as i,useCircularProgressConfig as g}from"./circular-progress-config.mjs";export{e as CircularProgress,i as CircularProgressConfig,g as useCircularProgressConfig};
|
package/dist/styles.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{tv as r}from"@jamsrui/utils";const e=r({slots:{root:"size-5",track:"stroke-background-secondary",progress:"stroke-success",label:"fill-foreground text-xs"},variants:{isIntermediate:{true:{root:"animate-spin"}},color:{current:{progress:"stroke-current"},default:{progress:"stroke-background-tertiary"},primary:{progress:"stroke-primary"},danger:{progress:"stroke-danger"},success:{progress:"stroke-success"},secondary:{progress:"stroke-secondary"},warning:{progress:"stroke-warning"}}},defaultVariants:{color:"primary",isIntermediate:!0}});export{e as circularProgressVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useCallback as i,useMemo as v}from"react";import{cn as p,dataAttrDev as l,mapPropsVariants as L,mergeProps as g}from"@jamsrui/utils";import{circularProgressVariants as S}from"./styles.mjs";const w=V=>{const[y,W]=L(V,S.variantKeys),{value:n=40,size:r=40,classNames:o,strokeWidth:b,progressWidth:m=b??3,trackWidth:P=b??3,showLabel:d=!1,labelFormatter:k=s=>`${s}%`,slotProps:e,...u}=y,t=(r-Math.max(P,m))/2,c=2*Math.PI*t,f=c-n/100*c,a=S(W),C=i(()=>({width:r,height:r,viewBox:`0 0 ${r} ${r}`,...u,"data-component":l("circular-progress"),"data-slot":l("root"),className:a.root({className:p(o?.root,u.className)})}),[o?.root,u,r,a]),N=i(s=>({cx:r/2,cy:r/2,r:t,fill:"none",stroke:"currentColor",strokeWidth:P,...g(e?.track,s),"data-slot":l("track"),className:a.track({className:p(e?.track?.className,o?.track,s.className)})}),[o?.track,t,r,e?.track,P,a]),h=i(s=>({cx:r/2,cy:r/2,r:t,fill:"none",stroke:"currentColor",strokeWidth:m,strokeDasharray:c,strokeDashoffset:f,strokeLinecap:"round",transform:`rotate(-90) ${r/2} ${r/2}`,...g(e?.progress,s),"data-slot":l("progress"),className:a.progress({className:p(e?.progress?.className,o?.progress,s.className)})}),[c,o?.progress,f,m,t,r,e?.progress,a]),x=i(s=>({x:"50%",y:"50%",textAnchor:"middle",dy:"0.3em",fontSize:"18",...g(e?.label,s),"data-slot":l("label"),className:a.label({className:p(e?.label?.className,o?.label,s.className)})}),[o?.label,e?.label,a]),G=k?k(n):n;return v(()=>({getRootProps:C,getProgressProps:h,getTrackProps:N,getLabelProps:x,showLabel:d,label:G}),[x,h,C,N,G,d])};export{w as useCircularProgress};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/circular-progress",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/core": "^0.0.
|
|
10
|
-
"@jamsrui/
|
|
8
|
+
"@jamsrui/hooks": "^0.0.14",
|
|
9
|
+
"@jamsrui/core": "^0.0.12",
|
|
10
|
+
"@jamsrui/utils": "^0.0.14"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
package/dist/chunk-BX7O4L5O.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-Q6AUZAGM.mjs";import{useCallback as i,useMemo as v}from"react";import{cn as p,dataAttrDev as l,mapPropsVariants as L,mergeProps as b}from"@jamsrui/utils";var w=V=>{let[y,W]=L(V,g.variantKeys),{value:n=40,size:r=40,classNames:o,strokeWidth:d,progressWidth:m=d??3,trackWidth:P=d??3,showLabel:k=!1,labelFormatter:f=s=>`${s}%`,slotProps:e,...u}=y,t=(r-Math.max(P,m))/2,c=2*Math.PI*t,C=c-n/100*c,a=g(W),N=i(()=>({width:r,height:r,viewBox:`0 0 ${r} ${r}`,...u,"data-component":l("circular-progress"),"data-slot":l("root"),className:a.root({className:p(o?.root,u.className)})}),[o?.root,u,r,a]),h=i(s=>({cx:r/2,cy:r/2,r:t,fill:"none",stroke:"currentColor",strokeWidth:P,...b(e?.track,s),"data-slot":l("track"),className:a.track({className:p(e?.track?.className,o?.track,s.className)})}),[o?.track,t,r,e?.track,P,a]),x=i(s=>({cx:r/2,cy:r/2,r:t,fill:"none",stroke:"currentColor",strokeWidth:m,strokeDasharray:c,strokeDashoffset:C,strokeLinecap:"round",transform:`rotate(-90) ${r/2} ${r/2}`,...b(e?.progress,s),"data-slot":l("progress"),className:a.progress({className:p(e?.progress?.className,o?.progress,s.className)})}),[c,o?.progress,C,m,t,r,e?.progress,a]),G=i(s=>({x:"50%",y:"50%",textAnchor:"middle",dy:"0.3em",fontSize:"18",...b(e?.label,s),"data-slot":l("label"),className:a.label({className:p(e?.label?.className,o?.label,s.className)})}),[o?.label,e?.label,a]),S=f?f(n):n;return v(()=>({getRootProps:N,getProgressProps:x,getTrackProps:h,getLabelProps:G,showLabel:k,label:S}),[G,x,N,h,S,k])};export{w as a};
|
package/dist/chunk-Q2GZXDOX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createConfigContext as r}from"@jamsrui/utils";var[s,e]=r({displayName:"CircularProgressContext"});export{s as a,e as b};
|
package/dist/chunk-Q6AUZAGM.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{tv as r}from"@jamsrui/utils";var e=r({slots:{root:"",track:"stroke-background-secondary",progress:"stroke-success",label:"fill-foreground text-xs"},variants:{isIntermediate:{true:{root:"animate-spin"}},color:{current:{progress:"stroke-current"},default:{progress:"stroke-background-tertiary"},primary:{progress:"stroke-primary"},danger:{progress:"stroke-danger"},success:{progress:"stroke-success"},secondary:{progress:"stroke-secondary"},warning:{progress:"stroke-warning"}}},defaultVariants:{color:"primary",isIntermediate:!0}});export{e as a};
|
package/dist/chunk-S2GU4VPD.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as s}from"./chunk-Q2GZXDOX.mjs";import{a as e}from"./chunk-BX7O4L5O.mjs";import{mergeConfigProps as u}from"@jamsrui/utils";import{jsx as r,jsxs as m}from"react/jsx-runtime";var b=t=>{let o=s(),c=u(o,o,t),g=e(c),{showLabel:p,getRootProps:P,getTrackProps:i,getLabelProps:a,getProgressProps:l,label:n}=g;return m("svg",{...P({}),children:[r("circle",{...i({})}),r("circle",{...l({})}),!!p&&r("text",{...a({}),children:n})]})};export{b as a};
|