@infinityfx/fluid 1.4.9 → 1.4.10

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,3 +1,3 @@
1
1
  "use client";
2
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{combineClasses as i,classes as o}from"../../core/utils.js";import{Animatable as t}from"@infinityfx/lively";import{useLink as s}from"@infinityfx/lively/hooks";import{useEffect as a}from"react";import{createStyles as l}from"../../core/style.js";const n=l("circular-progress",{".wrapper":{position:"relative",width:"3.2em",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},".track":{stroke:"var(--f-clr-fg-100)",strokeWidth:"var(--width)",strokeLinecap:"round",strokeDasharray:1},".progress":{stroke:"var(--color, var(--f-clr-primary-100))",strokeWidth:"var(--width)",strokeLinecap:"round",transition:"background-color .3s"},".label":{position:"absolute",fontSize:"0.7em",fontWeight:600},".s__xsm":{fontSize:"var(--f-font-size-xsm)"},".s__sml":{fontSize:"var(--f-font-size-sml)"},".s__med":{fontSize:"var(--f-font-size-med)"},".s__lrg":{fontSize:"var(--f-font-size-lrg)"}});function c({children:l,cc:c={},size:f="med",slice:m=0,value:d,defaultValue:p=0,color:v,...h}){const u=i(n,c),k=void 0!==d?d:p,g=s(k*(1-m));return a((()=>g.set(k*(1-m),{duration:.3})),[k,m]),e("div",{...h,"aria-label":void 0,className:o(u.wrapper,u[`s__${f}`],h.className),children:[r("div",{className:u.label,children:l}),e("svg",{overflow:"visible",viewBox:"0 0 100 100",role:"progressbar","aria-valuenow":100*k,"aria-label":h["aria-label"],style:{rotate:90+180*m+"deg",width:"100%","--color":v,"--width":"10px"},children:[r("circle",{r:45,cx:50,cy:50,fill:"none",className:u.track,pathLength:1,style:{strokeDashoffset:m}}),r(t,{animate:{strokeLength:g},initial:{strokeDashoffset:1-g()},children:r("circle",{r:45,cx:50,cy:50,fill:"none",className:u.progress})})]})]})}export{c as default};
2
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{combineClasses as t,classes as s,combineRefs as a}from"../../core/utils.js";import{useRef as o,useLayoutEffect as i}from"react";import{createStyles as n}from"../../core/style.js";const l=n("circular-progress",{".wrapper":{position:"relative",minWidth:"min(100vw, 3.6em)",display:"flex",alignItems:"center",justifyContent:"center"},".track, .progress":{fill:"none",strokeDasharray:1,strokeWidth:"calc(.45em * var(--scale, 1))",strokeLinecap:"round",transformOrigin:"center",transition:"background-color .3s, stroke-dashoffset .3s, rotate .3s"},".track":{stroke:"var(--f-clr-fg-100)"},".progress":{stroke:"var(--color, var(--f-clr-primary-100))"},".label":{position:"absolute",fontSize:"0.7em",fontWeight:600},".s__xsm":{fontSize:"var(--f-font-size-xsm)"},".s__sml":{fontSize:"var(--f-font-size-sml)"},".s__med":{fontSize:"var(--f-font-size-med)"},".s__lrg":{fontSize:"var(--f-font-size-lrg)"}});function c({children:n,cc:c={},size:f="med",slice:m=0,value:p=0,color:d,gap:h=0,fixedStrokeWidth:u=!0,...v}){const g=t(l,c),k=o(null);return i((()=>{if(!u)return;const e=new ResizeObserver((function(){if(!k.current)return;const{width:e,fontSize:r}=getComputedStyle(k.current);k.current.style.setProperty("--scale",3.6*parseFloat(r)/parseFloat(e)+"")}));return k.current&&e.observe(k.current),()=>e.disconnect()}),[]),e("div",{...v,ref:a(v.ref,k),"aria-label":void 0,className:s(g.wrapper,g[`s__${f}`],v.className),children:[r("div",{className:g.label,children:n}),e("svg",{overflow:"visible",viewBox:"0 0 100 100",role:"progressbar","aria-valuenow":100*p,"aria-label":v["aria-label"],style:{rotate:90+180*m+"deg","--color":d},children:[r("circle",{r:45,cx:50,cy:50,pathLength:1,className:g.track,style:{strokeDashoffset:p?Math.min(p*(1-m)+Math.max(m,h/2)+h/2,1):m,rotate:(p?360*Math.min(p*(1-m)+h/2,1-m):0)+"deg"}}),r("circle",{r:45,cx:50,cy:50,pathLength:1,className:g.progress,style:{strokeDashoffset:p<1?Math.min(1-p*(1-m)+Math.max(h/2-m,0)+h/2,1):m,rotate:(p<1?360*Math.max(h/2-m,0):0)+"deg"}})]})]})}export{c as default};
3
3
  //# sourceMappingURL=circular-progress.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as r}from"react/jsx-runtime";import{combineClasses as o,classes as e}from"../../core/utils.js";import{Animatable as i}from"@infinityfx/lively";import{useLink as s}from"@infinityfx/lively/hooks";import{useEffect as t}from"react";import{createStyles as a}from"../../core/style.js";const l=a("progress-bar",{".track":{height:".4em",minWidth:"min(100vw, 12em)",borderRadius:"999px",overflow:"hidden",backgroundColor:"var(--f-clr-fg-100)"},".progress":{height:"100%",backgroundColor:"var(--color, var(--f-clr-primary-100))",transformOrigin:"left",transition:"background-color .3s",borderRadius:"999px"},".s__xsm":{fontSize:"var(--f-font-size-xsm)"},".s__sml":{fontSize:"var(--f-font-size-sml)"},".s__med":{fontSize:"var(--f-font-size-med)"},".s__lrg":{fontSize:"var(--f-font-size-lrg)"}});function n({cc:a={},size:n="med",value:f,defaultValue:m=0,color:c,...d}){const v=o(l,a),u=void 0!==f?f:m,p=s(u);return t((()=>p.set(u,{duration:.3})),[u]),r("div",{...d,role:"progressbar","aria-valuenow":100*u,className:e(v.track,v[`s__${n}`],d.className),children:r(i,{animate:{scale:p((r=>`${r} 1`))},initial:{scale:`${p()} 1`},deform:!1,children:r("div",{className:v.progress,style:{"--color":c}})})})}export{n as default};
2
+ import{jsx as r}from"react/jsx-runtime";import{combineClasses as o,classes as e}from"../../core/utils.js";import{Animatable as i}from"@infinityfx/lively";import{useLink as s}from"@infinityfx/lively/hooks";import{useEffect as t}from"react";import{createStyles as a}from"../../core/style.js";const n=a("progress-bar",{".track":{height:".4em",minWidth:"min(100vw, 12em)",borderRadius:"999px",overflow:"hidden",backgroundColor:"var(--f-clr-fg-100)"},".progress":{height:"100%",backgroundColor:"var(--color, var(--f-clr-primary-100))",transformOrigin:"left",transition:"background-color .3s",borderRadius:"999px"},".s__xsm":{fontSize:"var(--f-font-size-xsm)"},".s__sml":{fontSize:"var(--f-font-size-sml)"},".s__med":{fontSize:"var(--f-font-size-med)"},".s__lrg":{fontSize:"var(--f-font-size-lrg)"}});function l({cc:a={},size:l="med",value:f=0,color:m,...c}){const d=o(n,a),v=s(f);return t((()=>v.set(f,{duration:.3})),[f]),r("div",{...c,role:"progressbar","aria-valuenow":100*f,className:e(d.track,d[`s__${l}`],c.className),children:r(i,{animate:{scale:v((r=>`${r} 1`))},initial:{scale:`${v()} 1`},deform:!1,children:r("div",{className:d.progress,style:{"--color":m}})})})}export{l as default};
3
3
  //# sourceMappingURL=progress-bar.js.map
@@ -5,12 +5,13 @@ export type CircularProgressSelectors = Selectors<'wrapper' | 'track' | 'progres
5
5
  *
6
6
  * @see {@link https://fluid.infinityfx.dev/docs/components/circular-progress}
7
7
  */
8
- export default function CircularProgress({ children, cc, size, slice, value, defaultValue, color, ...props }: {
8
+ export default function CircularProgress({ children, cc, size, slice, value, color, gap, fixedStrokeWidth, ...props }: {
9
9
  ref?: React.Ref<HTMLDivElement>;
10
10
  cc?: CircularProgressSelectors;
11
11
  size?: FluidSize;
12
12
  slice?: number;
13
13
  value?: number;
14
- defaultValue?: number;
15
14
  color?: string;
16
- } & Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'>): import("react/jsx-runtime").JSX.Element;
15
+ gap?: number;
16
+ fixedStrokeWidth?: boolean;
17
+ } & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -5,11 +5,10 @@ export type ProgressBarSelectors = Selectors<'track' | 'progress' | 's__xsm' | '
5
5
  *
6
6
  * @see {@link https://fluid.infinityfx.dev/docs/components/progress-bar}
7
7
  */
8
- export default function ProgressBar({ cc, size, value, defaultValue, color, ...props }: {
8
+ export default function ProgressBar({ cc, size, value, color, ...props }: {
9
9
  ref?: React.Ref<HTMLDivElement>;
10
10
  cc?: ProgressBarSelectors;
11
11
  size?: FluidSize;
12
12
  value?: number;
13
- defaultValue?: number;
14
13
  color?: string;
15
- } & Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue'>): import("react/jsx-runtime").JSX.Element;
14
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinityfx/fluid",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "type": "module",
5
5
  "description": "React UI library, using zero-runtime CSS-in-JS.",
6
6
  "main": "dist/index.js",