@jamsrui/circular-progress 0.0.15 → 0.0.17
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as CircularProgress } from './circular-progress-Cfg-Pzva.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { WithGlobalConfig } from '@jamsrui/core';
|
|
4
4
|
import '@jamsrui/utils';
|
|
5
5
|
import './styles.mjs';
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ declare const CircularProgressConfig: (props: Omit<Partial<CircularProgressConfi
|
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
}) => react_jsx_runtime.JSX.Element;
|
|
12
12
|
declare namespace CircularProgressConfig {
|
|
13
|
-
interface Props extends
|
|
13
|
+
interface Props extends WithGlobalConfig<CircularProgress.Props> {
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createConfigContext as r}from"@jamsrui/utils";const[s
|
|
1
|
+
"use client";import{createConfigContext as r}from"@jamsrui/utils";const[e,s]=r({displayName:"CircularProgressContext"});export{e as CircularProgressConfig,s as useCircularProgressConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
"use client";import{jsx as r,jsxs as f}from"react/jsx-runtime";import{mergeConfigProps as l}from"@jamsrui/utils";import{useCircularProgressConfig as n}from"./circular-progress-config.mjs";import{circularProgressVariants as u}from"./styles.mjs";import{useCircularProgress as m}from"./use-circular-progress.mjs";const v=s=>{const o=n(),e=l(u.defaultVariants,o,s),t=m(e),{showLabel:c,getRootProps:g,getTrackProps:i,getLabelProps:a,getProgressProps:p,label:P}=t;return f("svg",{...g({}),children:[r("circle",{...i({})}),r("circle",{...p({})}),!!c&&r("text",{...a({}),children:P})]})};export{v as CircularProgress};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{CircularProgress as s}from"./circular-progress.mjs";import{CircularProgressConfig as g,useCircularProgressConfig as i}from"./circular-progress-config.mjs";export{s as CircularProgress,g as CircularProgressConfig,i as useCircularProgressConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as i,useMemo as v}from"react";import{cn as
|
|
1
|
+
"use client";import{useCallback as i,useMemo as v}from"react";import{cn as n,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:p=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,a=(r-Math.max(P,m))/2,c=2*Math.PI*a,f=c-p/100*c,t=S(W),C=i(()=>({width:r,height:r,viewBox:`0 0 ${r} ${r}`,...u,"data-component":l("circular-progress"),"data-slot":l("root"),className:t.root({className:n(o?.root,u.className)})}),[o?.root,u,r,t]),N=i(s=>({cx:r/2,cy:r/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:P,...g(e?.track,s),"data-slot":l("track"),className:t.track({className:n(e?.track?.className,o?.track,s.className)})}),[o?.track,a,r,e?.track,P,t]),h=i(s=>({cx:r/2,cy:r/2,r:a,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:t.progress({className:n(e?.progress?.className,o?.progress,s.className)})}),[c,o?.progress,f,m,a,r,e?.progress,t]),x=i(s=>({x:"50%",y:"50%",textAnchor:"middle",dy:"0.3em",fontSize:"18",...g(e?.label,s),"data-slot":l("label"),className:t.label({className:n(e?.label?.className,o?.label,s.className)})}),[o?.label,e?.label,t]),G=k?k(p):p;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.17",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/
|
|
10
|
-
"@jamsrui/
|
|
8
|
+
"@jamsrui/core": "^0.0.14",
|
|
9
|
+
"@jamsrui/hooks": "^0.0.17",
|
|
10
|
+
"@jamsrui/utils": "^0.0.17"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|