@spark-ui/progress 9.1.3 → 9.1.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [9.1.5](https://github.com/adevinta/spark/compare/v9.1.4...v9.1.5) (2025-02-19)
7
+
8
+ **Note:** Version bump only for package @spark-ui/progress
9
+
10
+ ## [9.1.4](https://github.com/adevinta/spark/compare/v9.1.3...v9.1.4) (2025-02-19)
11
+
12
+ **Note:** Version bump only for package @spark-ui/progress
13
+
6
14
  ## [9.1.3](https://github.com/adevinta/spark/compare/v9.1.2...v9.1.3) (2025-02-19)
7
15
 
8
16
  **Note:** Version bump only for package @spark-ui/progress
@@ -1,7 +1,7 @@
1
- import { ProgressProps as ProgressPrimitiveProps } from '@radix-ui/react-progress';
1
+ import { Progress as RadixProgress } from 'radix-ui';
2
2
  import { PropsWithChildren, Ref } from 'react';
3
3
  import { ProgressIndicatorStylesProps } from './ProgressIndicator.styles';
4
- export interface ProgressProps extends ProgressPrimitiveProps, Pick<ProgressIndicatorStylesProps, 'intent'> {
4
+ export interface ProgressProps extends RadixProgress.ProgressProps, Pick<ProgressIndicatorStylesProps, 'intent'> {
5
5
  shape?: 'square' | 'rounded';
6
6
  isIndeterminate?: boolean;
7
7
  ref?: Ref<HTMLDivElement>;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),h=require("@radix-ui/react-progress"),g=require("class-variance-authority"),x=require("@spark-ui/use-merge-refs"),I=g.cva(["relative","h-sz-4 w-full","transform-gpu overflow-hidden","bg-on-background/dim-4"],{variants:{shape:{square:[],rounded:["rounded-sm"]}}}),v=e.createContext(null),b=()=>{const a=e.useContext(v);if(!a)throw new Error("useProgress must be used within a Progress provider");return a},E=g.cva(["h-full w-full","transition-transform duration-400"],{variants:{intent:{basic:["bg-basic"],main:["bg-main"],support:["bg-support"],accent:["bg-accent"],success:["bg-success"],alert:["bg-alert"],danger:["bg-error"],info:["bg-info"],neutral:["bg-neutral"]},shape:{square:[],rounded:["rounded-sm"]},isIndeterminate:{true:["absolute","-translate-x-1/2","animate-standalone-indeterminate-bar"],false:[]}}}),u=({className:a,style:r,ref:s,...n})=>{const{value:l,max:t,intent:o,shape:c,isIndeterminate:i}=b(),d=(t-l)/t*100;return e.createElement(h.ProgressIndicator,{className:E({className:a,intent:o,shape:c,isIndeterminate:i}),style:{...r,...!i&&{transform:`translateX(-${d}%)`}},ref:s,...n})};u.displayName="Progress.Indicator";const m=({className:a,children:r=e.createElement(u,null),ref:s,...n})=>{const{shape:l}=b();return e.createElement("div",{className:I({className:a,shape:l}),ref:s,...n},r)};m.displayName="Progress.Bar";const P=({className:a,value:r,max:s=100,shape:n="square",intent:l="basic",isIndeterminate:t=!1,children:o=e.createElement(m,null),ref:c,...i})=>{const[d,f]=e.useState(),y=e.useMemo(()=>({value:r??0,max:s,intent:l,shape:n,isIndeterminate:t,onLabelId:f}),[s,r,l,n,t,f]);return e.createElement(v.Provider,{"data-spark-component":"progress",value:y},e.createElement(h.Progress,{ref:c,className:g.cx("flex flex-col gap-sm",a),value:r,"aria-labelledby":d,max:s,...i},o))};P.displayName="Progress";const p=({id:a,children:r,ref:s,...n})=>{const l=`:progress-label-${e.useId()}`,t=a||l,{onLabelId:o}=b(),c=e.useCallback(d=>{o(d?t:void 0)},[t,o]),i=x.useMergeRefs(s,c);return e.createElement("span",{id:t,className:"text-body-2 text-on-surface",ref:i,...n},r)};p.displayName="Progress.Label";const N=Object.assign(P,{Label:p,Bar:m,Indicator:u});N.displayName="Progress",m.displayName="Progress.Bar",u.displayName="Progress.Indicator",p.displayName="Progress.Label",exports.Progress=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),g=require("class-variance-authority"),P=require("radix-ui"),x=require("@spark-ui/use-merge-refs"),I=g.cva(["relative","h-sz-4 w-full","transform-gpu overflow-hidden","bg-on-background/dim-4"],{variants:{shape:{square:[],rounded:["rounded-sm"]}}}),h=e.createContext(null),b=()=>{const r=e.useContext(h);if(!r)throw new Error("useProgress must be used within a Progress provider");return r},E=g.cva(["h-full w-full","transition-transform duration-400"],{variants:{intent:{basic:["bg-basic"],main:["bg-main"],support:["bg-support"],accent:["bg-accent"],success:["bg-success"],alert:["bg-alert"],danger:["bg-error"],info:["bg-info"],neutral:["bg-neutral"]},shape:{square:[],rounded:["rounded-sm"]},isIndeterminate:{true:["absolute","-translate-x-1/2","animate-standalone-indeterminate-bar"],false:[]}}}),u=({className:r,style:a,ref:s,...n})=>{const{value:l,max:t,intent:o,shape:c,isIndeterminate:i}=b(),d=(t-l)/t*100;return e.createElement(P.Progress.ProgressIndicator,{className:E({className:r,intent:o,shape:c,isIndeterminate:i}),style:{...a,...!i&&{transform:`translateX(-${d}%)`}},ref:s,...n})};u.displayName="Progress.Indicator";const m=({className:r,children:a=e.createElement(u,null),ref:s,...n})=>{const{shape:l}=b();return e.createElement("div",{className:I({className:r,shape:l}),ref:s,...n},a)};m.displayName="Progress.Bar";const v=({className:r,value:a,max:s=100,shape:n="square",intent:l="basic",isIndeterminate:t=!1,children:o=e.createElement(m,null),ref:c,...i})=>{const[d,f]=e.useState(),y=e.useMemo(()=>({value:a??0,max:s,intent:l,shape:n,isIndeterminate:t,onLabelId:f}),[s,a,l,n,t,f]);return e.createElement(h.Provider,{"data-spark-component":"progress",value:y},e.createElement(P.Progress.Progress,{ref:c,className:g.cx("gap-sm flex flex-col",r),value:a,"aria-labelledby":d,max:s,...i},o))};v.displayName="Progress";const p=({id:r,children:a,ref:s,...n})=>{const l=`:progress-label-${e.useId()}`,t=r||l,{onLabelId:o}=b(),c=e.useCallback(d=>{o(d?t:void 0)},[t,o]),i=x.useMergeRefs(s,c);return e.createElement("span",{id:t,className:"text-body-2 text-on-surface",ref:i,...n},a)};p.displayName="Progress.Label";const N=Object.assign(v,{Label:p,Bar:m,Indicator:u});N.displayName="Progress",m.displayName="Progress.Bar",u.displayName="Progress.Indicator",p.displayName="Progress.Label",exports.Progress=N;
package/dist/index.mjs CHANGED
@@ -1,36 +1,36 @@
1
- import o, { createContext as P, useContext as x, useState as y, useMemo as I, useId as E, useCallback as w } from "react";
2
- import { ProgressIndicator as L, Progress as k } from "@radix-ui/react-progress";
3
- import { cva as f, cx as q } from "class-variance-authority";
4
- import { useMergeRefs as B } from "@spark-ui/use-merge-refs";
5
- const C = f(["relative", "h-sz-4 w-full", "transform-gpu overflow-hidden", "bg-on-background/dim-4"], { variants: { shape: { square: [], rounded: ["rounded-sm"] } } }), N = P(null), p = () => {
6
- const e = x(N);
1
+ import o, { createContext as x, useContext as y, useState as I, useMemo as E, useId as w, useCallback as L } from "react";
2
+ import { cva as f, cx as k } from "class-variance-authority";
3
+ import { Progress as N } from "radix-ui";
4
+ import { useMergeRefs as q } from "@spark-ui/use-merge-refs";
5
+ const B = f(["relative", "h-sz-4 w-full", "transform-gpu overflow-hidden", "bg-on-background/dim-4"], { variants: { shape: { square: [], rounded: ["rounded-sm"] } } }), h = x(null), p = () => {
6
+ const e = y(h);
7
7
  if (!e)
8
8
  throw new Error("useProgress must be used within a Progress provider");
9
9
  return e;
10
- }, M = f(["h-full w-full", "transition-transform duration-400"], { variants: { intent: { basic: ["bg-basic"], main: ["bg-main"], support: ["bg-support"], accent: ["bg-accent"], success: ["bg-success"], alert: ["bg-alert"], danger: ["bg-error"], info: ["bg-info"], neutral: ["bg-neutral"] }, shape: { square: [], rounded: ["rounded-sm"] }, isIndeterminate: { true: ["absolute", "-translate-x-1/2", "animate-standalone-indeterminate-bar"], false: [] } } }), d = ({ className: e, style: a, ref: s, ...t }) => {
10
+ }, C = f(["h-full w-full", "transition-transform duration-400"], { variants: { intent: { basic: ["bg-basic"], main: ["bg-main"], support: ["bg-support"], accent: ["bg-accent"], success: ["bg-success"], alert: ["bg-alert"], danger: ["bg-error"], info: ["bg-info"], neutral: ["bg-neutral"] }, shape: { square: [], rounded: ["rounded-sm"] }, isIndeterminate: { true: ["absolute", "-translate-x-1/2", "animate-standalone-indeterminate-bar"], false: [] } } }), d = ({ className: e, style: a, ref: s, ...t }) => {
11
11
  const { value: n, max: r, intent: l, shape: m, isIndeterminate: i } = p(), c = (r - n) / r * 100;
12
- return o.createElement(L, { className: M({ className: e, intent: l, shape: m, isIndeterminate: i }), style: { ...a, ...!i && { transform: `translateX(-${c}%)` } }, ref: s, ...t });
12
+ return o.createElement(N.ProgressIndicator, { className: C({ className: e, intent: l, shape: m, isIndeterminate: i }), style: { ...a, ...!i && { transform: `translateX(-${c}%)` } }, ref: s, ...t });
13
13
  };
14
14
  d.displayName = "Progress.Indicator";
15
15
  const u = ({ className: e, children: a = o.createElement(d, null), ref: s, ...t }) => {
16
16
  const { shape: n } = p();
17
- return o.createElement("div", { className: C({ className: e, shape: n }), ref: s, ...t }, a);
17
+ return o.createElement("div", { className: B({ className: e, shape: n }), ref: s, ...t }, a);
18
18
  };
19
19
  u.displayName = "Progress.Bar";
20
- const h = ({ className: e, value: a, max: s = 100, shape: t = "square", intent: n = "basic", isIndeterminate: r = !1, children: l = o.createElement(u, null), ref: m, ...i }) => {
21
- const [c, b] = y(), v = I(() => ({ value: a ?? 0, max: s, intent: n, shape: t, isIndeterminate: r, onLabelId: b }), [s, a, n, t, r, b]);
22
- return o.createElement(N.Provider, { "data-spark-component": "progress", value: v }, o.createElement(k, { ref: m, className: q("flex flex-col gap-sm", e), value: a, "aria-labelledby": c, max: s, ...i }, l));
20
+ const v = ({ className: e, value: a, max: s = 100, shape: t = "square", intent: n = "basic", isIndeterminate: r = !1, children: l = o.createElement(u, null), ref: m, ...i }) => {
21
+ const [c, b] = I(), P = E(() => ({ value: a ?? 0, max: s, intent: n, shape: t, isIndeterminate: r, onLabelId: b }), [s, a, n, t, r, b]);
22
+ return o.createElement(h.Provider, { "data-spark-component": "progress", value: P }, o.createElement(N.Progress, { ref: m, className: k("gap-sm flex flex-col", e), value: a, "aria-labelledby": c, max: s, ...i }, l));
23
23
  };
24
- h.displayName = "Progress";
24
+ v.displayName = "Progress";
25
25
  const g = ({ id: e, children: a, ref: s, ...t }) => {
26
- const n = `:progress-label-${E()}`, r = e || n, { onLabelId: l } = p(), m = w((c) => {
26
+ const n = `:progress-label-${w()}`, r = e || n, { onLabelId: l } = p(), m = L((c) => {
27
27
  l(c ? r : void 0);
28
- }, [r, l]), i = B(s, m);
28
+ }, [r, l]), i = q(s, m);
29
29
  return o.createElement("span", { id: r, className: "text-body-2 text-on-surface", ref: i, ...t }, a);
30
30
  };
31
31
  g.displayName = "Progress.Label";
32
- const $ = Object.assign(h, { Label: g, Bar: u, Indicator: d });
33
- $.displayName = "Progress", u.displayName = "Progress.Bar", d.displayName = "Progress.Indicator", g.displayName = "Progress.Label";
32
+ const M = Object.assign(v, { Label: g, Bar: u, Indicator: d });
33
+ M.displayName = "Progress", u.displayName = "Progress.Bar", d.displayName = "Progress.Indicator", g.displayName = "Progress.Label";
34
34
  export {
35
- $ as Progress
35
+ M as Progress
36
36
  };
@@ -76,12 +76,12 @@
76
76
  "description": "",
77
77
  "name": "value",
78
78
  "parent": {
79
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
79
+ "fileName": "spark/node_modules/radix-ui/node_modules/@radix-ui/react-progress/dist/index.d.ts",
80
80
  "name": "ProgressProps"
81
81
  },
82
82
  "declarations": [
83
83
  {
84
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
84
+ "fileName": "spark/node_modules/radix-ui/node_modules/@radix-ui/react-progress/dist/index.d.ts",
85
85
  "name": "ProgressProps"
86
86
  }
87
87
  ],
@@ -95,12 +95,12 @@
95
95
  "description": "",
96
96
  "name": "max",
97
97
  "parent": {
98
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
98
+ "fileName": "spark/node_modules/radix-ui/node_modules/@radix-ui/react-progress/dist/index.d.ts",
99
99
  "name": "ProgressProps"
100
100
  },
101
101
  "declarations": [
102
102
  {
103
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
103
+ "fileName": "spark/node_modules/radix-ui/node_modules/@radix-ui/react-progress/dist/index.d.ts",
104
104
  "name": "ProgressProps"
105
105
  }
106
106
  ],
@@ -114,12 +114,12 @@
114
114
  "description": "",
115
115
  "name": "getValueLabel",
116
116
  "parent": {
117
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
117
+ "fileName": "spark/node_modules/radix-ui/node_modules/@radix-ui/react-progress/dist/index.d.ts",
118
118
  "name": "ProgressProps"
119
119
  },
120
120
  "declarations": [
121
121
  {
122
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
122
+ "fileName": "spark/node_modules/radix-ui/node_modules/@radix-ui/react-progress/dist/index.d.ts",
123
123
  "name": "ProgressProps"
124
124
  }
125
125
  ],
@@ -134,7 +134,7 @@
134
134
  "name": "asChild",
135
135
  "declarations": [
136
136
  {
137
- "fileName": "spark/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.d.ts",
137
+ "fileName": "spark/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive/dist/index.d.ts",
138
138
  "name": "TypeLiteral"
139
139
  }
140
140
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/progress",
3
- "version": "9.1.3",
3
+ "version": "9.1.5",
4
4
  "description": "Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,9 +23,9 @@
23
23
  "build": "vite build"
24
24
  },
25
25
  "dependencies": {
26
- "@radix-ui/react-progress": "1.1.1",
27
- "@spark-ui/use-merge-refs": "^9.1.3",
28
- "class-variance-authority": "0.7.0"
26
+ "@spark-ui/use-merge-refs": "^9.1.5",
27
+ "class-variance-authority": "0.7.0",
28
+ "radix-ui": "1.1.3"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@spark-ui/theme-utils": "latest",
@@ -47,5 +47,5 @@
47
47
  },
48
48
  "homepage": "https://sparkui.vercel.app",
49
49
  "license": "MIT",
50
- "gitHead": "ad661a89667c2af4dd86045456ff623cb0cae9cf"
50
+ "gitHead": "40f516e5bc7cb13131a2ded3b1240638897302bf"
51
51
  }