@jamsrui/circular-progress 0.0.16 → 0.0.18

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 { GlobalConfigProps } from '@jamsrui/core';
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 CircularProgress.Props, GlobalConfigProps<CircularProgress.Props> {
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,e]=r({displayName:"CircularProgressContext"});export{s as CircularProgressConfig,e as useCircularProgressConfig};
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 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};
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
- "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};
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 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};
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.16",
3
+ "version": "0.0.18",
4
4
  "peerDependencies": {
5
5
  "react": ">=19"
6
6
  },
7
7
  "dependencies": {
8
- "@jamsrui/hooks": "^0.0.16",
9
- "@jamsrui/utils": "^0.0.16",
10
- "@jamsrui/core": "^0.0.13"
8
+ "@jamsrui/hooks": "^0.0.18",
9
+ "@jamsrui/core": "^0.0.14",
10
+ "@jamsrui/utils": "^0.0.18"
11
11
  },
12
12
  "exports": {
13
13
  ".": {