@brightlocal/ui-components 2.26.0 → 2.27.0

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.
Files changed (89) hide show
  1. package/README.md +4 -2
  2. package/component-meta.json +3761 -360
  3. package/dist/blocks/progress-screen.cjs +1 -0
  4. package/dist/blocks/progress-screen.d.ts +109 -0
  5. package/dist/blocks/progress-screen.d.ts.map +1 -0
  6. package/dist/blocks/progress-screen.js +339 -0
  7. package/dist/blocks/sidebar.cjs +1 -1
  8. package/dist/blocks/sidebar.d.ts.map +1 -1
  9. package/dist/blocks/sidebar.js +155 -153
  10. package/dist/brand-illustration-motif.d.ts +1 -1
  11. package/dist/breadcrumb.cjs +1 -1
  12. package/dist/breadcrumb.d.ts.map +1 -1
  13. package/dist/breadcrumb.js +44 -40
  14. package/dist/button.cjs +1 -1
  15. package/dist/button.d.ts.map +1 -1
  16. package/dist/button.js +28 -28
  17. package/dist/chip.cjs +1 -1
  18. package/dist/chip.d.ts +1 -1
  19. package/dist/chip.d.ts.map +1 -1
  20. package/dist/chip.js +42 -41
  21. package/dist/combobox.cjs +3 -3
  22. package/dist/combobox.d.ts +4 -2
  23. package/dist/combobox.d.ts.map +1 -1
  24. package/dist/combobox.js +161 -161
  25. package/dist/data-table.cjs +1 -1
  26. package/dist/data-table.d.ts +138 -3
  27. package/dist/data-table.d.ts.map +1 -1
  28. package/dist/data-table.js +455 -309
  29. package/dist/global-layout.cjs +1 -1
  30. package/dist/global-layout.d.ts +31 -5
  31. package/dist/global-layout.d.ts.map +1 -1
  32. package/dist/global-layout.js +276 -194
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +462 -451
  37. package/dist/lib/motion.cjs +1 -1
  38. package/dist/lib/motion.js +10 -8
  39. package/dist/link.cjs +1 -1
  40. package/dist/link.d.ts +8 -6
  41. package/dist/link.d.ts.map +1 -1
  42. package/dist/link.js +52 -20
  43. package/dist/list.cjs +1 -1
  44. package/dist/list.js +65 -63
  45. package/dist/progress.cjs +1 -1
  46. package/dist/progress.d.ts +61 -3
  47. package/dist/progress.d.ts.map +1 -1
  48. package/dist/progress.js +142 -65
  49. package/dist/route-progress.cjs +1 -0
  50. package/dist/route-progress.d.ts +103 -0
  51. package/dist/route-progress.d.ts.map +1 -0
  52. package/dist/route-progress.js +106 -0
  53. package/dist/sheet.cjs +1 -1
  54. package/dist/sheet.d.ts +35 -2
  55. package/dist/sheet.d.ts.map +1 -1
  56. package/dist/sheet.js +102 -65
  57. package/dist/sonner.cjs +1 -1
  58. package/dist/sonner.d.ts.map +1 -1
  59. package/dist/sonner.js +11 -15
  60. package/dist/spinner.cjs +1 -0
  61. package/dist/spinner.d.ts +57 -0
  62. package/dist/spinner.d.ts.map +1 -0
  63. package/dist/spinner.js +35 -0
  64. package/dist/stepper.cjs +1 -1
  65. package/dist/stepper.d.ts.map +1 -1
  66. package/dist/stepper.js +26 -25
  67. package/dist/table.cjs +1 -1
  68. package/dist/table.d.ts +1 -1
  69. package/dist/table.d.ts.map +1 -1
  70. package/dist/table.js +6 -2
  71. package/package.json +14 -2
  72. package/src/blocks/progress-screen.tsx +481 -0
  73. package/src/blocks/sidebar.tsx +22 -15
  74. package/src/components/breadcrumb.tsx +9 -4
  75. package/src/components/button.tsx +2 -5
  76. package/src/components/chip.tsx +4 -3
  77. package/src/components/combobox.tsx +15 -8
  78. package/src/components/data-table.tsx +333 -14
  79. package/src/components/global-layout.tsx +228 -62
  80. package/src/components/link.tsx +39 -5
  81. package/src/components/list.tsx +5 -5
  82. package/src/components/progress.tsx +217 -30
  83. package/src/components/route-progress.tsx +354 -0
  84. package/src/components/sheet.tsx +87 -5
  85. package/src/components/sonner.tsx +3 -12
  86. package/src/components/spinner.tsx +94 -0
  87. package/src/components/stepper.tsx +3 -4
  88. package/src/components/table.tsx +6 -2
  89. package/src/index.ts +3 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={type:"spring",stiffness:500,damping:45},n={stiffness:180,damping:24,mass:1},t={type:"spring",stiffness:80,damping:20,mass:1},S={type:"spring",stiffness:30,damping:9,mass:.5};exports.SPRING_GENTLE=t;exports.SPRING_SETTLE=S;exports.SPRING_SMOOTH=n;exports.SPRING_SNAPPY=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=150,S=200,N={type:"spring",stiffness:500,damping:45},_={stiffness:180,damping:24,mass:1},n={type:"spring",stiffness:80,damping:20,mass:1},t={type:"spring",stiffness:30,damping:9,mass:.5};exports.MOTION_DURATION_BASE_MS=S;exports.MOTION_DURATION_FAST_MS=s;exports.SPRING_GENTLE=n;exports.SPRING_SETTLE=t;exports.SPRING_SMOOTH=_;exports.SPRING_SNAPPY=N;
@@ -1,25 +1,27 @@
1
- const s = {
1
+ const s = 150, n = 200, t = {
2
2
  type: "spring",
3
3
  stiffness: 500,
4
4
  damping: 45
5
- }, n = {
5
+ }, i = {
6
6
  stiffness: 180,
7
7
  damping: 24,
8
8
  mass: 1
9
- }, t = {
9
+ }, p = {
10
10
  type: "spring",
11
11
  stiffness: 80,
12
12
  damping: 20,
13
13
  mass: 1
14
- }, i = {
14
+ }, S = {
15
15
  type: "spring",
16
16
  stiffness: 30,
17
17
  damping: 9,
18
18
  mass: 0.5
19
19
  };
20
20
  export {
21
- t as SPRING_GENTLE,
22
- i as SPRING_SETTLE,
23
- n as SPRING_SMOOTH,
24
- s as SPRING_SNAPPY
21
+ n as MOTION_DURATION_BASE_MS,
22
+ s as MOTION_DURATION_FAST_MS,
23
+ p as SPRING_GENTLE,
24
+ S as SPRING_SETTLE,
25
+ i as SPRING_SMOOTH,
26
+ t as SPRING_SNAPPY
25
27
  };
package/dist/link.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),h=require("react"),m=require("@brightlocal/icons"),u=require("@radix-ui/react-slot"),j=require("class-variance-authority"),S=require("@brightlocal/ui-components/button"),o=require("@brightlocal/ui-components/lib/utils");function q(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const O=q(h),L=new Set(["aria-disabled:opacity-50","aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40","aria-invalid:border-destructive","data-[state=open]:bg-accent"]),i=t=>o.cn(S.ButtonVariants({variant:t,size:"default"}).split(/\s+/).filter(e=>e&&!L.has(e)).join(" "),"no-underline"),P=j.cva("",{variants:{variant:{inline:["inline-flex","items-center","gap-2","cursor-pointer","outline-none","rounded-sm","text-link","dark:text-link-dark","no-underline","hover:underline","hover:underline-offset-4","active:text-link/80","visited:text-link-visited","visited:dark:text-link-visited-dark","transition-[text-decoration,text-decoration-color,text-underline-offset,color]","duration-fast","ease-out","focus-visible:shadow-default"],primary:i("primary"),filled:i("secondary"),outline:o.cn(i("outline"),"text-foreground"),ghost:i("ghost"),icon:o.cn(i("ghost"),"size-9 p-0")}},defaultVariants:{variant:"inline"}}),f=O.forwardRef(({className:t,variant:e="inline",dataHook:n,trackingEl:r,trackingLabel:k,asChild:g=!1,external:s=!1,showExternalIcon:p=!0,children:l,...b},v)=>{const x=s?{target:"_blank",rel:"noopener noreferrer"}:{},y=e==="inline"?"link-default":`link-${e}`,c={ref:v,className:o.cn(P({variant:e}),t),"data-hook":n,"data-slot":"link","data-tracking-el":r||y,"data-tracking-label":k,...x,...b},d=s&&p&&a.jsx(m.ExternalLink,{"aria-hidden":"true","data-slot":"external-icon"});return g?a.jsxs(u.Slot,{...c,children:[a.jsx(u.Slottable,{children:l}),d]}):a.jsxs("a",{...c,children:[l,d]})});f.displayName="Link";exports.Link=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),y=require("@brightlocal/icons"),u=require("@radix-ui/react-slot"),j=require("class-variance-authority"),S=require("@brightlocal/ui-components/button"),a=require("@brightlocal/ui-components/lib/utils");function q(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const O=q(m),_=new Set(["aria-disabled:opacity-50","aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40","aria-invalid:border-destructive","data-[state=open]:bg-accent"]),i=t=>a.cn(S.ButtonVariants({variant:t,size:"default"}).split(/\s+/).filter(e=>e&&!_.has(e)).join(" "),"no-underline"),w=j.cva("",{variants:{variant:{inline:["inline-flex","items-center","gap-2","cursor-pointer","outline-none","rounded-sm","text-link","dark:text-link-dark","no-underline","hover:underline","hover:underline-offset-4","active:text-link/80","visited:text-link-visited","visited:dark:text-link-visited-dark","transition-[text-decoration,text-decoration-color,text-underline-offset,color]","duration-fast","ease-out","focus-visible:shadow-default"],inherit:["inline","cursor-pointer","outline-none","rounded-sm","text-inherit","underline","underline-offset-4","decoration-current/60","hover:decoration-current","[&_svg]:ml-1","[&_svg]:inline","[&_svg]:align-text-bottom","transition-[text-decoration-color]","duration-fast","ease-out","focus-visible:shadow-default"],primary:i("primary"),filled:i("secondary"),outline:a.cn(i("outline"),"text-foreground"),ghost:i("ghost"),icon:a.cn(i("ghost"),"size-9 p-0")}},defaultVariants:{variant:"inline"}}),f=O.forwardRef(({className:t,variant:e="inline",dataHook:n,trackingEl:r,trackingLabel:k,asChild:g=!1,external:s=!1,showExternalIcon:v=!0,children:l,...x},b)=>{const p=s?{target:"_blank",rel:"noopener noreferrer"}:{},h=e==="inline"?"link-default":`link-${e}`,c={ref:b,className:a.cn(w({variant:e}),t),"data-hook":n,"data-slot":"link","data-tracking-el":r||h,"data-tracking-label":k,...p,...x},d=s&&v&&o.jsx(y.ExternalLink,{"aria-hidden":"true","data-slot":"external-icon"});return g?o.jsxs(u.Slot,{...c,children:[o.jsx(u.Slottable,{children:l}),d]}):o.jsxs("a",{...c,children:[l,d]})});f.displayName="Link";exports.Link=f;
package/dist/link.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const linkVariants: (props?: ({
4
- variant?: "inline" | "ghost" | "filled" | "icon" | "outline" | "primary" | null | undefined;
4
+ variant?: "inherit" | "inline" | "ghost" | "filled" | "icon" | "outline" | "primary" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  /** Supported visual style variants for the Link component. */
7
7
  export type LinkVariant = NonNullable<VariantProps<typeof linkVariants>["variant"]>;
@@ -11,11 +11,13 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
11
11
  */
12
12
  dataHook: string;
13
13
  /**
14
- * Visual style variant. `inline` renders a standard text link; `primary`
15
- * renders the brand CTA treatment (matches `Button variant="primary"`);
16
- * `filled`, `outline` and `ghost` render button-styled treatments for
17
- * inline actions and high-priority navigation; `icon` renders a circular
18
- * icon-only link (provide an `aria-label` since there is no text content).
14
+ * Visual style variant. `inline` renders a standard text link; `inherit`
15
+ * renders an always-underlined link that takes the surrounding text colour
16
+ * (for links inside body copy, alerts and muted text); `primary` renders
17
+ * the brand CTA treatment (matches `Button variant="primary"`); `filled`,
18
+ * `outline` and `ghost` render button-styled treatments for inline actions
19
+ * and high-priority navigation; `icon` renders a circular icon-only link
20
+ * (provide an `aria-label` since there is no text content).
19
21
  * @default "inline"
20
22
  */
21
23
  variant?: LinkVariant;
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmClE,QAAA,MAAM,YAAY;;8EAsDjB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,WAAW,CACnC,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,SAAS,CAAC,CAC7C,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,IAAI,qFAwDT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmClE,QAAA,MAAM,YAAY;;8EAsFjB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,WAAW,CACnC,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,SAAS,CAAC,CAC7C,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,IAAI,qFAwDT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/link.js CHANGED
@@ -2,19 +2,19 @@ import { jsxs as s, jsx as d } from "react/jsx-runtime";
2
2
  import * as h from "react";
3
3
  import { ExternalLink as b } from "@brightlocal/icons";
4
4
  import { Slot as y, Slottable as S } from "@radix-ui/react-slot";
5
- import { cva as L } from "class-variance-authority";
6
- import { ButtonVariants as j } from "@brightlocal/ui-components/button";
7
- import { cn as i } from "@brightlocal/ui-components/lib/utils";
8
- const w = /* @__PURE__ */ new Set([
5
+ import { cva as w } from "class-variance-authority";
6
+ import { ButtonVariants as L } from "@brightlocal/ui-components/button";
7
+ import { cn as n } from "@brightlocal/ui-components/lib/utils";
8
+ const _ = /* @__PURE__ */ new Set([
9
9
  "aria-disabled:opacity-50",
10
10
  "aria-invalid:ring-destructive/20",
11
11
  "dark:aria-invalid:ring-destructive/40",
12
12
  "aria-invalid:border-destructive",
13
13
  "data-[state=open]:bg-accent"
14
- ]), e = (n) => i(
15
- j({ variant: n, size: "default" }).split(/\s+/).filter((t) => t && !w.has(t)).join(" "),
14
+ ]), e = (i) => n(
15
+ L({ variant: i, size: "default" }).split(/\s+/).filter((t) => t && !_.has(t)).join(" "),
16
16
  "no-underline"
17
- ), V = L(
17
+ ), j = w(
18
18
  // No shared base: the button-styled variants carry the Button base classes,
19
19
  // and a base here would be silently overridden by them in tailwind-merge
20
20
  // (last wins). Each variant is self-contained.
@@ -48,6 +48,38 @@ const w = /* @__PURE__ */ new Set([
48
48
  // Focus state
49
49
  "focus-visible:shadow-default"
50
50
  ],
51
+ // Inline link that reads as part of the surrounding sentence: no
52
+ // link colour of its own — `color: inherit` picks up whatever the
53
+ // parent text sets (muted body copy, alert foregrounds, ...).
54
+ // Because colour no longer distinguishes the link from the text
55
+ // around it, the underline is the only affordance and is therefore
56
+ // persistent (WCAG 1.4.1) — hover feedback comes from the underline
57
+ // strengthening, not from a colour change. Deliberately no `visited:`
58
+ // styling: a purple visited colour would break the "part of the
59
+ // sentence" goal. Plain `inline` display (not `inline-flex`) so the
60
+ // link wraps naturally across lines inside a paragraph.
61
+ inherit: [
62
+ "inline",
63
+ "cursor-pointer",
64
+ "outline-none",
65
+ "rounded-sm",
66
+ "text-inherit",
67
+ // Persistent underline; softened until hovered
68
+ "underline",
69
+ "underline-offset-4",
70
+ "decoration-current/60",
71
+ "hover:decoration-current",
72
+ // External icon sits in the text flow with the label
73
+ "[&_svg]:ml-1",
74
+ "[&_svg]:inline",
75
+ "[&_svg]:align-text-bottom",
76
+ // Transitions
77
+ "transition-[text-decoration-color]",
78
+ "duration-fast",
79
+ "ease-out",
80
+ // Focus state
81
+ "focus-visible:shadow-default"
82
+ ],
51
83
  // Button-styled, brand CTA (matches Button `primary`).
52
84
  primary: e("primary"),
53
85
  // Button-styled, filled (maps to Button `secondary`).
@@ -55,22 +87,22 @@ const w = /* @__PURE__ */ new Set([
55
87
  // Button-styled, bordered (matches Button `outline`). Button's outline
56
88
  // declares no text color (buttons default sensibly; anchors inherit
57
89
  // ambient/link colors), so links must pin `text-foreground` explicitly.
58
- outline: i(e("outline"), "text-foreground"),
90
+ outline: n(e("outline"), "text-foreground"),
59
91
  // Button-styled, transparent (matches Button `ghost`).
60
92
  ghost: e("ghost"),
61
93
  // Icon-only, circular. Mirrors `ghost` in a fixed 36px square
62
94
  // footprint — the same `size-9 p-0` Button applies to icon-only
63
95
  // buttons. Requires an `aria-label` since there is no text content.
64
- icon: i(e("ghost"), "size-9 p-0")
96
+ icon: n(e("ghost"), "size-9 p-0")
65
97
  }
66
98
  },
67
99
  defaultVariants: {
68
100
  variant: "inline"
69
101
  }
70
102
  }
71
- ), z = h.forwardRef(
103
+ ), V = h.forwardRef(
72
104
  ({
73
- className: n,
105
+ className: i,
74
106
  variant: t = "inline",
75
107
  dataHook: c,
76
108
  trackingEl: u,
@@ -78,12 +110,12 @@ const w = /* @__PURE__ */ new Set([
78
110
  asChild: k = !1,
79
111
  external: r = !1,
80
112
  showExternalIcon: m = !0,
81
- children: a,
113
+ children: o,
82
114
  ...p
83
115
  }, v) => {
84
- const x = r ? { target: "_blank", rel: "noopener noreferrer" } : {}, g = t === "inline" ? "link-default" : `link-${t}`, o = {
116
+ const x = r ? { target: "_blank", rel: "noopener noreferrer" } : {}, g = t === "inline" ? "link-default" : `link-${t}`, a = {
85
117
  ref: v,
86
- className: i(V({ variant: t }), n),
118
+ className: n(j({ variant: t }), i),
87
119
  "data-hook": c,
88
120
  "data-slot": "link",
89
121
  "data-tracking-el": u || g,
@@ -91,16 +123,16 @@ const w = /* @__PURE__ */ new Set([
91
123
  ...x,
92
124
  ...p
93
125
  }, l = r && m && /* @__PURE__ */ d(b, { "aria-hidden": "true", "data-slot": "external-icon" });
94
- return k ? /* @__PURE__ */ s(y, { ...o, children: [
95
- /* @__PURE__ */ d(S, { children: a }),
126
+ return k ? /* @__PURE__ */ s(y, { ...a, children: [
127
+ /* @__PURE__ */ d(S, { children: o }),
96
128
  l
97
- ] }) : /* @__PURE__ */ s("a", { ...o, children: [
98
- a,
129
+ ] }) : /* @__PURE__ */ s("a", { ...a, children: [
130
+ o,
99
131
  l
100
132
  ] });
101
133
  }
102
134
  );
103
- z.displayName = "Link";
135
+ V.displayName = "Link";
104
136
  export {
105
- z as Link
137
+ V as Link
106
138
  };
package/dist/list.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),w=require("@radix-ui/react-slot"),R=require("class-variance-authority"),o=require("@brightlocal/ui-components/lib/utils"),d=require("@brightlocal/ui-components/skeleton");function S(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const r=S(k),c=R.cva(["flex","items-center","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-fast","ease-out"],{variants:{variant:{default:[],filled:["bg-card"],outline:["bg-background","border","border-border"],loading:["flex-col","gap-2","px-0","pt-0","pb-3"]}},defaultVariants:{variant:"filled"}}),m=r.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:n,...i},l)=>s.jsx("ul",{ref:l,className:o.cn("flex flex-col gap-2",e),"data-hook":a,"data-slot":"list","data-tracking-el":t,"data-tracking-label":n,...i}));m.displayName="List";const f=r.forwardRef(({asChild:e=!1,className:a,variant:t,dataHook:n,trackingEl:i,trackingLabel:l,children:N,...j},y)=>{const h=e?w.Slot:"li";return s.jsx(h,{ref:y,className:o.cn(c({variant:t}),a),"data-hook":n,"data-slot":"item","data-tracking-el":i,"data-tracking-label":l,...j,children:t==="loading"?s.jsxs(s.Fragment,{children:[s.jsx(d.Skeleton,{className:"h-4 w-full"}),s.jsx(d.Skeleton,{className:"h-4 w-full"})]}):N})});f.displayName="Item";const u=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("shrink-0",e),"data-slot":"item-media",...a}));u.displayName="ItemMedia";const p=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("flex flex-1 flex-col gap-1",e),"data-slot":"item-content",...a}));p.displayName="ItemContent";const g=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-foreground text-base leading-normal font-medium",e),"data-slot":"item-title",...a}));g.displayName="ItemTitle";const x=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-muted-foreground text-sm leading-normal font-normal",e),"data-slot":"item-description",...a}));x.displayName="ItemDescription";const b=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",e),"data-slot":"item-actions",...a}));b.displayName="ItemActions";const I=r.forwardRef(({className:e,dataHook:a,...t},n)=>s.jsx("li",{ref:n,className:o.cn("text-muted-foreground flex items-center py-2 pr-2 pl-4 text-base leading-none font-medium",e),"data-hook":a,"data-slot":"item-subheader",...t}));I.displayName="ItemSubheader";exports.Item=f;exports.ItemActions=b;exports.ItemContent=p;exports.ItemDescription=x;exports.ItemMedia=u;exports.ItemSubheader=I;exports.ItemTitle=g;exports.List=m;exports.itemVariants=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),k=require("react"),h=require("@radix-ui/react-slot"),R=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils"),v=require("@brightlocal/ui-components/skeleton");function w(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const r=w(k),d=R.cva(["flex","items-center","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-fast","ease-out"],{variants:{variant:{default:[],filled:["bg-card"],outline:["bg-background","border","border-border"],loading:["p-0"]}},defaultVariants:{variant:"filled"}}),c=r.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:s,...i},l)=>o.jsx("ul",{ref:l,className:n.cn("flex flex-col gap-2",e),"data-hook":a,"data-slot":"list","data-tracking-el":t,"data-tracking-label":s,...i}));c.displayName="List";const m=r.forwardRef(({asChild:e=!1,className:a,variant:t,dataHook:s,trackingEl:i,trackingLabel:l,children:I,...N},y)=>{const j=e?h.Slot:"li";return o.jsx(j,{ref:y,className:n.cn(d({variant:t}),a),"data-hook":s,"data-slot":"item","data-tracking-el":i,"data-tracking-label":l,...N,children:t==="loading"?o.jsx(v.Skeleton,{className:"h-13 w-full rounded-lg"}):I})});m.displayName="Item";const f=r.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:n.cn("shrink-0",e),"data-slot":"item-media",...a}));f.displayName="ItemMedia";const u=r.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:n.cn("flex flex-1 flex-col gap-1",e),"data-slot":"item-content",...a}));u.displayName="ItemContent";const p=r.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:n.cn("text-foreground text-base leading-normal font-medium",e),"data-slot":"item-title",...a}));p.displayName="ItemTitle";const g=r.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:n.cn("text-muted-foreground text-sm leading-normal font-normal",e),"data-slot":"item-description",...a}));g.displayName="ItemDescription";const x=r.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:n.cn("text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",e),"data-slot":"item-actions",...a}));x.displayName="ItemActions";const b=r.forwardRef(({className:e,dataHook:a,...t},s)=>o.jsx("li",{ref:s,className:n.cn("text-muted-foreground flex items-center py-2 pr-2 pl-4 text-base leading-none font-medium",e),"data-hook":a,"data-slot":"item-subheader",...t}));b.displayName="ItemSubheader";exports.Item=m;exports.ItemActions=x;exports.ItemContent=u;exports.ItemDescription=g;exports.ItemMedia=f;exports.ItemSubheader=b;exports.ItemTitle=p;exports.List=c;exports.itemVariants=d;
package/dist/list.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as o, jsxs as p, Fragment as u } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { Slot as g } from "@radix-ui/react-slot";
4
- import { cva as x } from "class-variance-authority";
5
- import { cn as r } from "@brightlocal/ui-components/lib/utils";
6
- import { Skeleton as m } from "@brightlocal/ui-components/skeleton";
7
- const N = x(
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { Slot as c } from "@radix-ui/react-slot";
4
+ import { cva as p } from "class-variance-authority";
5
+ import { cn as i } from "@brightlocal/ui-components/lib/utils";
6
+ import { Skeleton as u } from "@brightlocal/ui-components/skeleton";
7
+ const g = p(
8
8
  [
9
9
  "flex",
10
10
  "items-center",
@@ -23,86 +23,88 @@ const N = x(
23
23
  default: [],
24
24
  filled: ["bg-card"],
25
25
  outline: ["bg-background", "border", "border-border"],
26
- loading: ["flex-col", "gap-2", "px-0", "pt-0", "pb-3"]
26
+ loading: ["p-0"]
27
27
  }
28
28
  },
29
29
  defaultVariants: {
30
30
  variant: "filled"
31
31
  }
32
32
  }
33
- ), b = l.forwardRef(
34
- ({ className: t, dataHook: a, trackingEl: e, trackingLabel: s, ...i }, d) => /* @__PURE__ */ o(
33
+ ), x = r.forwardRef(
34
+ ({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, ...d }, s) => /* @__PURE__ */ o(
35
35
  "ul",
36
36
  {
37
- ref: d,
38
- className: r("flex flex-col gap-2", t),
37
+ ref: s,
38
+ className: i("flex flex-col gap-2", t),
39
39
  "data-hook": a,
40
40
  "data-slot": "list",
41
41
  "data-tracking-el": e,
42
- "data-tracking-label": s,
43
- ...i
42
+ "data-tracking-label": l,
43
+ ...d
44
44
  }
45
45
  )
46
46
  );
47
- b.displayName = "List";
48
- const I = l.forwardRef(
47
+ x.displayName = "List";
48
+ const N = r.forwardRef(
49
49
  ({
50
50
  asChild: t = !1,
51
51
  className: a,
52
52
  variant: e,
53
- dataHook: s,
54
- trackingEl: i,
55
- trackingLabel: d,
56
- children: n,
57
- ...f
58
- }, c) => /* @__PURE__ */ o(
59
- t ? g : "li",
53
+ dataHook: l,
54
+ trackingEl: d,
55
+ trackingLabel: s,
56
+ children: m,
57
+ ...n
58
+ }, f) => /* @__PURE__ */ o(
59
+ t ? c : "li",
60
60
  {
61
- ref: c,
62
- className: r(N({ variant: e }), a),
63
- "data-hook": s,
61
+ ref: f,
62
+ className: i(g({ variant: e }), a),
63
+ "data-hook": l,
64
64
  "data-slot": "item",
65
- "data-tracking-el": i,
66
- "data-tracking-label": d,
67
- ...f,
68
- children: e === "loading" ? /* @__PURE__ */ p(u, { children: [
69
- /* @__PURE__ */ o(m, { className: "h-4 w-full" }),
70
- /* @__PURE__ */ o(m, { className: "h-4 w-full" })
71
- ] }) : n
65
+ "data-tracking-el": d,
66
+ "data-tracking-label": s,
67
+ ...n,
68
+ children: e === "loading" ? (
69
+ /* One skeleton per data row, mirroring the filled row's footprint:
70
+ h-13 = py-2 × 2 + the size-9 actions slot that drives the row's
71
+ height, so nothing shifts when the content arrives. */
72
+ /* @__PURE__ */ o(u, { className: "h-13 w-full rounded-lg" })
73
+ ) : m
72
74
  }
73
75
  )
74
76
  );
75
- I.displayName = "Item";
76
- const h = l.forwardRef(
77
+ N.displayName = "Item";
78
+ const I = r.forwardRef(
77
79
  ({ className: t, ...a }, e) => /* @__PURE__ */ o(
78
80
  "div",
79
81
  {
80
82
  ref: e,
81
- className: r("shrink-0", t),
83
+ className: i("shrink-0", t),
82
84
  "data-slot": "item-media",
83
85
  ...a
84
86
  }
85
87
  )
86
88
  );
87
- h.displayName = "ItemMedia";
88
- const k = l.forwardRef(
89
+ I.displayName = "ItemMedia";
90
+ const b = r.forwardRef(
89
91
  ({ className: t, ...a }, e) => /* @__PURE__ */ o(
90
92
  "div",
91
93
  {
92
94
  ref: e,
93
- className: r("flex flex-1 flex-col gap-1", t),
95
+ className: i("flex flex-1 flex-col gap-1", t),
94
96
  "data-slot": "item-content",
95
97
  ...a
96
98
  }
97
99
  )
98
100
  );
99
- k.displayName = "ItemContent";
100
- const y = l.forwardRef(
101
+ b.displayName = "ItemContent";
102
+ const k = r.forwardRef(
101
103
  ({ className: t, ...a }, e) => /* @__PURE__ */ o(
102
104
  "div",
103
105
  {
104
106
  ref: e,
105
- className: r(
107
+ className: i(
106
108
  "text-foreground text-base leading-normal font-medium",
107
109
  t
108
110
  ),
@@ -111,13 +113,13 @@ const y = l.forwardRef(
111
113
  }
112
114
  )
113
115
  );
114
- y.displayName = "ItemTitle";
115
- const w = l.forwardRef(
116
+ k.displayName = "ItemTitle";
117
+ const y = r.forwardRef(
116
118
  ({ className: t, ...a }, e) => /* @__PURE__ */ o(
117
119
  "div",
118
120
  {
119
121
  ref: e,
120
- className: r(
122
+ className: i(
121
123
  "text-muted-foreground text-sm leading-normal font-normal",
122
124
  t
123
125
  ),
@@ -126,13 +128,13 @@ const w = l.forwardRef(
126
128
  }
127
129
  )
128
130
  );
129
- w.displayName = "ItemDescription";
130
- const R = l.forwardRef(
131
+ y.displayName = "ItemDescription";
132
+ const h = r.forwardRef(
131
133
  ({ className: t, ...a }, e) => /* @__PURE__ */ o(
132
134
  "div",
133
135
  {
134
136
  ref: e,
135
- className: r(
137
+ className: i(
136
138
  "text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",
137
139
  t
138
140
  ),
@@ -141,13 +143,13 @@ const R = l.forwardRef(
141
143
  }
142
144
  )
143
145
  );
144
- R.displayName = "ItemActions";
145
- const v = l.forwardRef(
146
- ({ className: t, dataHook: a, ...e }, s) => /* @__PURE__ */ o(
146
+ h.displayName = "ItemActions";
147
+ const w = r.forwardRef(
148
+ ({ className: t, dataHook: a, ...e }, l) => /* @__PURE__ */ o(
147
149
  "li",
148
150
  {
149
- ref: s,
150
- className: r(
151
+ ref: l,
152
+ className: i(
151
153
  "text-muted-foreground flex items-center py-2 pr-2 pl-4 text-base leading-none font-medium",
152
154
  t
153
155
  ),
@@ -157,15 +159,15 @@ const v = l.forwardRef(
157
159
  }
158
160
  )
159
161
  );
160
- v.displayName = "ItemSubheader";
162
+ w.displayName = "ItemSubheader";
161
163
  export {
162
- I as Item,
163
- R as ItemActions,
164
- k as ItemContent,
165
- w as ItemDescription,
166
- h as ItemMedia,
167
- v as ItemSubheader,
168
- y as ItemTitle,
169
- b as List,
170
- N as itemVariants
164
+ N as Item,
165
+ h as ItemActions,
166
+ b as ItemContent,
167
+ y as ItemDescription,
168
+ I as ItemMedia,
169
+ w as ItemSubheader,
170
+ k as ItemTitle,
171
+ x as List,
172
+ g as itemVariants
171
173
  };
package/dist/progress.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),S=require("react"),$=require("@radix-ui/react-progress"),q=require("framer-motion"),i=require("@brightlocal/ui-components/lib/utils"),_=require("@brightlocal/ui-components/hooks/use-prefers-reduced-motion"),v=require("./lib/motion.cjs");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const b=h(S),p=h($),m={green:{track:"bg-brand-primary-foreground/20",indicator:"bg-green-400"},red:{track:"bg-brand-red/20",indicator:"bg-brand-red"},orange:{track:"bg-brand-orange/20",indicator:"bg-brand-orange"},yellow:{track:"bg-brand-yellow/20",indicator:"bg-brand-yellow"}};function I(e,t,r){if(e==null)return"–";if(r==="%")return`${t>0?Math.min(100,Math.max(0,Math.round(e/t*100))):0}%`;const n=r?` ${r}`:"";return t>0?`${e} / ${t}${n}`:`${e}${n}`}const P=b.forwardRef(({className:e,value:t,max:r=100,dataHook:n,trackingEl:c,trackingLabel:y,ariaLabel:j="Progress",label:d,color:x="green",showValue:s=!1,unit:M="%",indicatorClassName:k,disabled:l,...R},N)=>{const g=b.useId(),a=!!d,w=_.usePrefersReducedMotion(),u=m[x]??m.green,O=r>0?Math.min(100,Math.max(0,(t??0)/r*100)):0,f=o.jsx(p.Root,{ref:N,"aria-label":a?void 0:j,"aria-labelledby":a?g:void 0,className:i.cn("relative h-2 w-full overflow-hidden rounded-full",u.track,!a&&!s&&l&&"opacity-50",e),"data-hook":n,"data-slot":"progress","data-tracking-el":c,"data-tracking-label":y,max:r,value:t,...R,children:o.jsx(p.Indicator,{asChild:!0,children:o.jsx(q.motion.div,{animate:{transform:`translateX(-${100-O}%)`},className:i.cn("h-full w-full flex-1",u.indicator,k),"data-slot":"progress-indicator",initial:!1,transition:w?{duration:0}:v.SPRING_GENTLE})})});return!a&&!s?f:o.jsxs("div",{className:i.cn("flex w-full items-center gap-2",l&&"opacity-50"),"data-slot":"progress-wrapper",children:[a&&o.jsx("span",{className:"text-foreground text-xs leading-none font-medium","data-slot":"progress-label",id:g,children:d}),f,s&&o.jsx("span",{className:"text-muted-foreground shrink-0 text-xs leading-none tabular-nums","data-slot":"progress-value",children:I(t,r,M)})]})});P.displayName="Progress";exports.Progress=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),B=require("react"),C=require("@radix-ui/react-progress"),G=require("framer-motion"),a=require("@brightlocal/ui-components/lib/utils"),H=require("@brightlocal/ui-components/hooks/use-prefers-reduced-motion"),Y=require("./lib/motion.cjs");function _(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const S=_(B),b=_(C),k={sm:{text:"text-sm",bar:"h-2"},md:{text:"text-base",bar:"h-3"}},R={green:{track:"bg-brand-primary-foreground/20",indicator:"bg-green-400"},red:{track:"bg-brand-red/20",indicator:"bg-brand-red"},orange:{track:"bg-brand-orange/20",indicator:"bg-brand-orange"},yellow:{track:"bg-brand-yellow/20",indicator:"bg-brand-yellow"}},D="40%";function M(r,t,e){if(r==null)return"–";if(e==="%")return`${t>0?Math.min(100,Math.max(0,Math.round(r/t*100))):0}%`;const o=e?` ${e}`:"";return t>0?`${r} / ${t}${o}`:`${r}${o}`}const L=S.forwardRef(({className:r,value:t,max:e=100,dataHook:o,trackingEl:m,trackingLabel:O,ariaLabel:$="Progress",label:h,labelWidth:x=D,color:q="green",size:E="sm",showValue:I=!1,unit:w="%",indicatorClassName:j,statusDescription:l,indeterminate:d=!1,disabled:u,...T},z)=>{const y=S.useId(),n=!!h,v=H.usePrefersReducedMotion(),g=R[q]??R.green,i=k[E]??k.sm,f=x==="auto",c=I&&!d,p=l!=null&&l!==!1,V=n||c,A=e>0?Math.min(100,Math.max(0,(t??0)/e*100)):0,P=s.jsx(b.Root,{ref:z,"aria-label":n?void 0:$,"aria-labelledby":n?y:void 0,className:a.cn("relative w-full overflow-hidden rounded-full",V&&"min-w-0 flex-1",i.bar,g.track,!n&&!c&&u&&"opacity-50",r),"data-hook":o,"data-slot":"progress","data-tracking-el":m,"data-tracking-label":O,max:e,value:d?null:t??0,...T,children:d?s.jsx(b.Indicator,{asChild:!0,children:s.jsx("div",{className:a.cn("h-full w-2/5 rounded-full",g.indicator,v?"translate-x-[75%]":"animate-ambient-sweep",j),"data-slot":"progress-indicator"})}):s.jsx(b.Indicator,{asChild:!0,children:s.jsx(G.motion.div,{animate:{transform:`translateX(-${100-A}%)`},className:a.cn("h-full w-full flex-1",g.indicator,j),"data-slot":"progress-indicator",initial:!1,transition:v?{duration:0}:Y.SPRING_GENTLE})})});if(!n&&!c&&!p)return P;const N=s.jsxs("div",{className:a.cn("flex w-full items-center gap-2",!p&&u&&"opacity-50"),"data-slot":"progress-wrapper",children:[n&&s.jsx("span",{className:a.cn("text-foreground shrink-0 font-medium break-words",f&&"max-w-2/5",i.text),"data-label-width":f?"auto":void 0,"data-slot":"progress-label",id:y,style:f?void 0:{width:x},children:h}),P,c&&s.jsxs("span",{className:a.cn("text-muted-foreground grid min-w-10 shrink-0 text-right tabular-nums",i.text),"data-slot":"progress-value",children:[s.jsx("span",{"aria-hidden":"true",className:"invisible col-start-1 row-start-1","data-slot":"progress-value-sizer",children:M(e,e,w)}),s.jsx("span",{className:"col-start-1 row-start-1","data-slot":"progress-value-text",children:M(t,e,w)})]})]});return p?s.jsxs("div",{className:a.cn("flex w-full flex-col gap-2",u&&"opacity-50"),"data-slot":"progress-status-wrapper",children:[s.jsx("span",{"aria-live":"polite",className:a.cn("text-muted-foreground",i.text),"data-slot":"progress-status",children:l}),N]}):N});L.displayName="Progress";exports.Progress=L;
@@ -8,6 +8,17 @@ import * as ProgressPrimitive from "@radix-ui/react-progress";
8
8
  * - `red` — critical / urgent
9
9
  */
10
10
  type ProgressColor = "green" | "red" | "orange" | "yellow";
11
+ /**
12
+ * Text size of the label and value.
13
+ * - `sm` — 14px (`text-sm`), the default for metric rows in cards
14
+ * - `md` — 16px (`text-base`) for roomier layouts
15
+ */
16
+ type ProgressSize = "sm" | "md";
17
+ /**
18
+ * Width of the label column as a share of the row, or `auto` to hug the text.
19
+ * Mirrors the Figma `Progress / Label` Width options.
20
+ */
21
+ type ProgressLabelWidth = "auto" | "20%" | "30%" | "40%" | "50%";
11
22
  /**
12
23
  * Props for the Progress component.
13
24
  */
@@ -30,14 +41,31 @@ interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Ro
30
41
  */
31
42
  ariaLabel?: string;
32
43
  /**
33
- * Optional visible label text displayed to the left of the progress bar
44
+ * Optional visible label text displayed to the left of the progress bar.
45
+ * Rendered inside a fixed-width column (see `labelWidth`); longer labels
46
+ * wrap onto further lines while the bar and value stay in their columns.
34
47
  */
35
48
  label?: string;
49
+ /**
50
+ * Width of the label column: `"20%"` … `"50%"` of the row in 10% steps, or
51
+ * `"auto"`. Every row that uses the same percentage starts its bar at the
52
+ * same x-position, so stacked rows inside a card line up — pick the step that
53
+ * keeps the labels in that card to one or two lines. Use `"auto"` for a
54
+ * single row that isn't aligned with others: the label hugs its text (capped
55
+ * at 40% of the row) and the bar starts right after it.
56
+ * @default "40%"
57
+ */
58
+ labelWidth?: ProgressLabelWidth;
36
59
  /**
37
60
  * Brand color for the indicator.
38
61
  * @default "green"
39
62
  */
40
63
  color?: ProgressColor;
64
+ /**
65
+ * Row size: `sm` = 14px text with an 8px bar, `md` = 16px text with a 12px bar.
66
+ * @default "sm"
67
+ */
68
+ size?: ProgressSize;
41
69
  /**
42
70
  * Whether to render the numeric value to the right of the progress bar.
43
71
  * Falls back to `–` when no value is provided so the layout stays consistent.
@@ -53,9 +81,33 @@ interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Ro
53
81
  unit?: string;
54
82
  /**
55
83
  * Custom class name for the indicator (progress fill)
56
- * Use this to customize the color, e.g., "bg-red-500"
84
+ * Use this to customize the color, e.g., "bg-chart-red"
57
85
  */
58
86
  indicatorClassName?: string;
87
+ /**
88
+ * A line describing what the run is doing right now — the step, not the
89
+ * number. Renders on its own line above the bar's row, so `label` stays on
90
+ * the left and the value on the right. It takes the row's `size`, so it reads
91
+ * as a peer of the value rather than a second scale.
92
+ *
93
+ * It is a polite live region, and it never becomes the bar's accessible name
94
+ * (`ariaLabel` still owns that) — which is what makes it the right slot for a
95
+ * status that moves, where `label` is not.
96
+ * @example "Scanning search results across your area"
97
+ */
98
+ statusDescription?: React.ReactNode;
99
+ /**
100
+ * Runs the bar as an indeterminate sweep: a short pill travelling the track
101
+ * for "running, and we cannot say how far". Use when work is genuinely
102
+ * underway but the backend reports no percentage — never as a stand-in for a
103
+ * number you could have fetched.
104
+ *
105
+ * `value` is ignored while this is set, the numeric readout is suppressed
106
+ * (there is nothing to report), and the bar drops `aria-valuenow` so assistive
107
+ * technology announces it as indeterminate rather than as 0%.
108
+ * @default false
109
+ */
110
+ indeterminate?: boolean;
59
111
  /**
60
112
  * Whether the progress is in a disabled state
61
113
  * When disabled, the component renders with 50% opacity
@@ -65,8 +117,14 @@ interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Ro
65
117
  /**
66
118
  * Progress component for displaying loading states and task completion.
67
119
  * Built on Radix UI Progress primitive with Framer Motion animation.
120
+ *
121
+ * With a `label` and/or `showValue` the bar renders as a three-column row:
122
+ * a fixed-width label column, the bar filling the remaining space, and a
123
+ * right-aligned value column sized to the widest value it can show — so rows
124
+ * stacked in a card share the same bar start position and width, even when
125
+ * a label wraps onto two lines.
68
126
  */
69
127
  declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
70
128
  export { Progress };
71
- export type { ProgressProps, ProgressColor };
129
+ export type { ProgressProps, ProgressColor, ProgressSize, ProgressLabelWidth };
72
130
  //# sourceMappingURL=progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAO9D;;;;;;GAMG;AACH,KAAK,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AA0D3D;;GAEG;AACH,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAClD,OAAO,iBAAiB,CAAC,IAAI,CAC9B;IACC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,QAAA,MAAM,QAAQ,mGAqGb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAO9D;;;;;;GAMG;AACH,KAAK,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D;;;;GAIG;AACH,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AA6ChC;;;GAGG;AACH,KAAK,kBAAkB,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAkCjE;;GAEG;AACH,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAClD,OAAO,iBAAiB,CAAC,IAAI,CAC9B;IACC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,QAAQ,mGAiNb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC"}