@spark-ui/progress 1.1.0 → 1.1.2

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,18 @@
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
+ ## [1.1.2](https://github.com/adevinta/spark/compare/@spark-ui/progress@1.1.1...@spark-ui/progress@1.1.2) (2023-09-14)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **progress:** meta-tags ([eebbde2](https://github.com/adevinta/spark/commit/eebbde2e052342d99f01049f90851b0a3a993e86))
11
+
12
+ ## [1.1.1](https://github.com/adevinta/spark/compare/@spark-ui/progress@1.1.0...@spark-ui/progress@1.1.1) (2023-09-11)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **progress:** harmonize progress displayNames ([02f8f08](https://github.com/adevinta/spark/commit/02f8f083b7c43827345a7b28b44d05f9aaf12b2b))
17
+
6
18
  # [1.1.0](https://github.com/adevinta/spark/compare/@spark-ui/progress@1.0.0...@spark-ui/progress@1.1.0) (2023-09-04)
7
19
 
8
20
  ### Features
package/dist/index.d.ts CHANGED
@@ -3,11 +3,11 @@ import { ProgressProps } from './Progress';
3
3
  import { ProgressBar } from './ProgressBar';
4
4
  import { ProgressIndicator } from './ProgressIndicator';
5
5
  import { ProgressLabel } from './ProgressLabel';
6
- export { type ProgressBarProps } from './ProgressBar';
7
- export { type ProgressLabelProps } from './ProgressLabel';
8
- export { type ProgressIndicatorProps } from './ProgressIndicator';
9
6
  export declare const Progress: FC<ProgressProps> & {
10
7
  Label: typeof ProgressLabel;
11
8
  Bar: typeof ProgressBar;
12
9
  Indicator: typeof ProgressIndicator;
13
10
  };
11
+ export { type ProgressBarProps } from './ProgressBar';
12
+ export { type ProgressLabelProps } from './ProgressLabel';
13
+ export { type ProgressIndicatorProps } from './ProgressIndicator';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),g=require("@radix-ui/react-progress"),m=require("class-variance-authority"),P=require("@radix-ui/react-id"),y=require("@spark-ui/use-merge-refs"),b=e.createContext(null),p=()=>{const r=e.useContext(b);if(!r)throw new Error("useProgress must be used within a Progress provider");return r},I=m.cva(["h-full w-full","bg-basic","rounded-sm","transition-transform duration-400"],{variants:{isIndeterminate:{true:["absolute","-translate-x-1/2","animate-standalone-indeterminate-bar"],false:[]}}}),u=e.forwardRef(({className:r,style:a,...s},t)=>{const{value:n,max:l,isIndeterminate:o}=p(),i=(l-n)/l*100;return e.createElement(g.ProgressIndicator,{className:I({isIndeterminate:o,className:r}),style:{...a,...!o&&{transform:`translateX(-${i}%)`}},ref:t,...s})});u.displayName="Progress.Indicator";const f=e.forwardRef(({className:r,children:a=e.createElement(u,null),...s},t)=>e.createElement("div",{className:m.cx("relative h-sz-4 w-full transform-gpu overflow-hidden rounded-sm bg-on-background/dim-4",r),ref:t,...s},a));f.displayName="Progress.Bar";const v=e.forwardRef(({className:r,value:a,max:s=100,isIndeterminate:t=!1,children:n=e.createElement(f,null),...l},o)=>{const[i,d]=e.useState(),x=e.useMemo(()=>({value:a??0,max:s,isIndeterminate:t,onLabelId:d}),[s,a,t,d]);return e.createElement(b.Provider,{"data-spark-component":"progress",value:x},e.createElement(g.Progress,{ref:o,className:m.cx("flex flex-col gap-sm",r),value:a,"aria-labelledby":i,max:s,...l},n))});v.displayName="Progress";const N=e.forwardRef(({id:r,children:a,...s},t)=>{const n=P.useId(r),{onLabelId:l}=p(),o=e.useCallback(d=>{l(d?n:void 0)},[n,l]),i=y.useMergeRefs(t,o);return e.createElement("span",{id:n,className:"text-body-2 text-on-surface",ref:i,...s},a)});N.displayName="Progress.Label";const c=Object.assign(v,{Label:N,Bar:f,Indicator:u});c.Label.displayName="Progress.Label",c.Bar.displayName="Progress.Bar",exports.Progress=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),b=require("@radix-ui/react-progress"),u=require("class-variance-authority"),y=require("@radix-ui/react-id"),x=require("@spark-ui/use-merge-refs"),p=e.createContext(null),N=()=>{const r=e.useContext(p);if(!r)throw new Error("useProgress must be used within a Progress provider");return r},I=u.cva(["h-full w-full","bg-basic","rounded-sm","transition-transform duration-400"],{variants:{isIndeterminate:{true:["absolute","-translate-x-1/2","animate-standalone-indeterminate-bar"],false:[]}}}),m=e.forwardRef(({className:r,style:a,...s},t)=>{const{value:n,max:l,isIndeterminate:o}=N(),i=(l-n)/l*100;return e.createElement(b.ProgressIndicator,{className:I({isIndeterminate:o,className:r}),style:{...a,...!o&&{transform:`translateX(-${i}%)`}},ref:t,...s})});m.displayName="Progress.Indicator";const c=e.forwardRef(({className:r,children:a=e.createElement(m,null),...s},t)=>e.createElement("div",{className:u.cx("relative h-sz-4 w-full transform-gpu overflow-hidden rounded-sm bg-on-background/dim-4",r),ref:t,...s},a));c.displayName="Progress.Bar";const P=e.forwardRef(({className:r,value:a,max:s=100,isIndeterminate:t=!1,children:n=e.createElement(c,null),...l},o)=>{const[i,d]=e.useState(),v=e.useMemo(()=>({value:a??0,max:s,isIndeterminate:t,onLabelId:d}),[s,a,t,d]);return e.createElement(p.Provider,{"data-spark-component":"progress",value:v},e.createElement(b.Progress,{ref:o,className:u.cx("flex flex-col gap-sm",r),value:a,"aria-labelledby":i,max:s,...l},n))});P.displayName="Progress";const f=e.forwardRef(({id:r,children:a,...s},t)=>{const n=y.useId(r),{onLabelId:l}=N(),o=e.useCallback(d=>{l(d?n:void 0)},[n,l]),i=x.useMergeRefs(t,o);return e.createElement("span",{id:n,className:"text-body-2 text-on-surface",ref:i,...s},a)});f.displayName="Progress.Label";const g=Object.assign(P,{Label:f,Bar:c,Indicator:m});g.displayName="Progress",c.displayName="Progress.Bar",m.displayName="Progress.Indicator",f.displayName="Progress.Label",exports.Progress=g;
package/dist/index.mjs CHANGED
@@ -1,34 +1,34 @@
1
- import o, { createContext as P, useContext as y, forwardRef as d, useState as I, useMemo as h, useCallback as E } from "react";
2
- import { ProgressIndicator as w, Progress as L } from "@radix-ui/react-progress";
3
- import { cva as B, cx as g } from "class-variance-authority";
1
+ import o, { createContext as v, useContext as x, forwardRef as d, useState as y, useMemo as I, useCallback as h } from "react";
2
+ import { ProgressIndicator as E, Progress as w } from "@radix-ui/react-progress";
3
+ import { cva as L, cx as g } from "class-variance-authority";
4
4
  import { useId as k } from "@radix-ui/react-id";
5
- import { useMergeRefs as C } from "@spark-ui/use-merge-refs";
6
- const p = P(null), b = () => {
7
- const e = y(p);
5
+ import { useMergeRefs as B } from "@spark-ui/use-merge-refs";
6
+ const p = v(null), b = () => {
7
+ const e = x(p);
8
8
  if (!e)
9
9
  throw new Error("useProgress must be used within a Progress provider");
10
10
  return e;
11
- }, M = B(["h-full w-full", "bg-basic", "rounded-sm", "transition-transform duration-400"], { variants: { isIndeterminate: { true: ["absolute", "-translate-x-1/2", "animate-standalone-indeterminate-bar"], false: [] } } }), c = d(({ className: e, style: a, ...r }, s) => {
11
+ }, C = L(["h-full w-full", "bg-basic", "rounded-sm", "transition-transform duration-400"], { variants: { isIndeterminate: { true: ["absolute", "-translate-x-1/2", "animate-standalone-indeterminate-bar"], false: [] } } }), c = d(({ className: e, style: a, ...s }, r) => {
12
12
  const { value: t, max: n, isIndeterminate: l } = b(), m = (n - t) / n * 100;
13
- return o.createElement(w, { className: M({ isIndeterminate: l, className: e }), style: { ...a, ...!l && { transform: `translateX(-${m}%)` } }, ref: s, ...r });
13
+ return o.createElement(E, { className: C({ isIndeterminate: l, className: e }), style: { ...a, ...!l && { transform: `translateX(-${m}%)` } }, ref: r, ...s });
14
14
  });
15
15
  c.displayName = "Progress.Indicator";
16
- const u = d(({ className: e, children: a = o.createElement(c, null), ...r }, s) => o.createElement("div", { className: g("relative h-sz-4 w-full transform-gpu overflow-hidden rounded-sm bg-on-background/dim-4", e), ref: s, ...r }, a));
16
+ const u = d(({ className: e, children: a = o.createElement(c, null), ...s }, r) => o.createElement("div", { className: g("relative h-sz-4 w-full transform-gpu overflow-hidden rounded-sm bg-on-background/dim-4", e), ref: r, ...s }, a));
17
17
  u.displayName = "Progress.Bar";
18
- const N = d(({ className: e, value: a, max: r = 100, isIndeterminate: s = !1, children: t = o.createElement(u, null), ...n }, l) => {
19
- const [m, i] = I(), x = h(() => ({ value: a ?? 0, max: r, isIndeterminate: s, onLabelId: i }), [r, a, s, i]);
20
- return o.createElement(p.Provider, { "data-spark-component": "progress", value: x }, o.createElement(L, { ref: l, className: g("flex flex-col gap-sm", e), value: a, "aria-labelledby": m, max: r, ...n }, t));
18
+ const N = d(({ className: e, value: a, max: s = 100, isIndeterminate: r = !1, children: t = o.createElement(u, null), ...n }, l) => {
19
+ const [m, i] = y(), P = I(() => ({ value: a ?? 0, max: s, isIndeterminate: r, onLabelId: i }), [s, a, r, i]);
20
+ return o.createElement(p.Provider, { "data-spark-component": "progress", value: P }, o.createElement(w, { ref: l, className: g("flex flex-col gap-sm", e), value: a, "aria-labelledby": m, max: s, ...n }, t));
21
21
  });
22
22
  N.displayName = "Progress";
23
- const v = d(({ id: e, children: a, ...r }, s) => {
24
- const t = k(e), { onLabelId: n } = b(), l = E((i) => {
23
+ const f = d(({ id: e, children: a, ...s }, r) => {
24
+ const t = k(e), { onLabelId: n } = b(), l = h((i) => {
25
25
  n(i ? t : void 0);
26
- }, [t, n]), m = C(s, l);
27
- return o.createElement("span", { id: t, className: "text-body-2 text-on-surface", ref: m, ...r }, a);
26
+ }, [t, n]), m = B(r, l);
27
+ return o.createElement("span", { id: t, className: "text-body-2 text-on-surface", ref: m, ...s }, a);
28
28
  });
29
- v.displayName = "Progress.Label";
30
- const f = Object.assign(N, { Label: v, Bar: u, Indicator: c });
31
- f.Label.displayName = "Progress.Label", f.Bar.displayName = "Progress.Bar";
29
+ f.displayName = "Progress.Label";
30
+ const M = Object.assign(N, { Label: f, Bar: u, Indicator: c });
31
+ M.displayName = "Progress", u.displayName = "Progress.Bar", c.displayName = "Progress.Indicator", f.displayName = "Progress.Label";
32
32
  export {
33
- f as Progress
33
+ M as Progress
34
34
  };
@@ -6,9 +6,7 @@
6
6
  "methods": [],
7
7
  "props": {
8
8
  "isIndeterminate": {
9
- "defaultValue": {
10
- "value": "false"
11
- },
9
+ "defaultValue": null,
12
10
  "description": "",
13
11
  "name": "isIndeterminate",
14
12
  "parent": {
@@ -46,9 +44,7 @@
46
44
  }
47
45
  },
48
46
  "max": {
49
- "defaultValue": {
50
- "value": "100"
51
- },
47
+ "defaultValue": null,
52
48
  "description": "",
53
49
  "name": "max",
54
50
  "parent": {
@@ -121,98 +117,6 @@
121
117
  "description": "",
122
118
  "displayName": "Progress.Label",
123
119
  "methods": [],
124
- "props": {
125
- "isIndeterminate": {
126
- "defaultValue": null,
127
- "description": "",
128
- "name": "isIndeterminate",
129
- "parent": {
130
- "fileName": "progress/src/Progress.tsx",
131
- "name": "ProgressProps"
132
- },
133
- "declarations": [
134
- {
135
- "fileName": "progress/src/Progress.tsx",
136
- "name": "ProgressProps"
137
- }
138
- ],
139
- "required": false,
140
- "type": {
141
- "name": "boolean"
142
- }
143
- },
144
- "value": {
145
- "defaultValue": null,
146
- "description": "",
147
- "name": "value",
148
- "parent": {
149
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
150
- "name": "ProgressProps"
151
- },
152
- "declarations": [
153
- {
154
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
155
- "name": "ProgressProps"
156
- }
157
- ],
158
- "required": false,
159
- "type": {
160
- "name": "number"
161
- }
162
- },
163
- "max": {
164
- "defaultValue": null,
165
- "description": "",
166
- "name": "max",
167
- "parent": {
168
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
169
- "name": "ProgressProps"
170
- },
171
- "declarations": [
172
- {
173
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
174
- "name": "ProgressProps"
175
- }
176
- ],
177
- "required": false,
178
- "type": {
179
- "name": "number"
180
- }
181
- },
182
- "getValueLabel": {
183
- "defaultValue": null,
184
- "description": "",
185
- "name": "getValueLabel",
186
- "parent": {
187
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
188
- "name": "ProgressProps"
189
- },
190
- "declarations": [
191
- {
192
- "fileName": "spark/node_modules/@radix-ui/react-progress/dist/index.d.ts",
193
- "name": "ProgressProps"
194
- }
195
- ],
196
- "required": false,
197
- "type": {
198
- "name": "(value: number, max: number) => string"
199
- }
200
- },
201
- "asChild": {
202
- "defaultValue": null,
203
- "description": "",
204
- "name": "asChild",
205
- "declarations": [
206
- {
207
- "fileName": "spark/node_modules/@radix-ui/react-primitive/dist/index.d.ts",
208
- "name": "TypeLiteral"
209
- }
210
- ],
211
- "required": false,
212
- "type": {
213
- "name": "boolean"
214
- }
215
- }
216
- }
120
+ "props": {}
217
121
  }
218
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/progress",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
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"
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@radix-ui/react-id": "1.0.1",
27
27
  "@radix-ui/react-progress": "1.0.3",
28
- "@spark-ui/use-merge-refs": "^0.3.7",
28
+ "@spark-ui/use-merge-refs": "^0.3.8",
29
29
  "class-variance-authority": "0.7.0"
30
30
  },
31
31
  "peerDependencies": {
@@ -36,13 +36,17 @@
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "git@github.com:adevinta/spark.git",
39
+ "url": "https://github.com/adevinta/spark.git",
40
40
  "directory": "packages/components/progress"
41
41
  },
42
+ "config": {
43
+ "title": "progress",
44
+ "category": "components"
45
+ },
42
46
  "bugs": {
43
- "url": "https://github.com/adevinta/spark/issues"
47
+ "url": "https://github.com/adevinta/spark/issues?q=label%3Acomponent+label%3Aprogress"
44
48
  },
45
49
  "homepage": "https://sparkui.vercel.app",
46
50
  "license": "MIT",
47
- "gitHead": "b29fbceac31642a9e6ad3c815b2abec885d53bbb"
51
+ "gitHead": "318dcc9d11ad26f351ab7f7f8f78bbfad06a4d25"
48
52
  }