@brightlocal/ui-components 2.20.0 → 2.22.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.
- package/AI_USAGE.md +2 -0
- package/README.md +26 -13
- package/component-meta.json +41 -14
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts +35 -3
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +178 -154
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +2 -2
- package/dist/blocks/sidebar.js +18 -18
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +9 -6
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +12 -12
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +45 -45
- package/dist/index.cjs +1 -1
- package/dist/index.js +69 -68
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +7 -5
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +1 -1
- package/dist/logo.js +2 -2
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts +17 -0
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +120 -90
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +12 -8
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +117 -113
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +28 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +90 -49
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/sonner.d.ts +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +22 -2
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +57 -43
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +36 -36
- package/package.json +7 -3
- package/src/blocks/data-table.tsx +56 -4
- package/src/blocks/sidebar.tsx +5 -5
- package/src/components/breadcrumb.tsx +6 -3
- package/src/components/button.tsx +7 -1
- package/src/components/hover-card.tsx +6 -3
- package/src/components/logo.tsx +3 -3
- package/src/components/navigation-menu.tsx +113 -32
- package/src/components/pagination.tsx +47 -67
- package/src/components/progress.tsx +118 -14
- package/src/components/skeleton.tsx +1 -1
- package/src/components/sonner.tsx +1 -1
- package/src/components/table.tsx +44 -7
- package/src/components/tooltip.tsx +8 -5
- package/src/lib/utils.ts +3 -0
package/dist/pagination.js
CHANGED
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { MoreHorizontal as v, ChevronRight as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
boundaryCount: a = 1
|
|
1
|
+
import { jsx as s, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { MoreHorizontal as v, ChevronRight as b, ChevronLeft as x } from "@brightlocal/icons";
|
|
4
|
+
import { cva as y } from "class-variance-authority";
|
|
5
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { useIsBelowBreakpoint as N } from "@brightlocal/ui-components/hooks/use-breakpoint";
|
|
7
|
+
function I({
|
|
8
|
+
page: i,
|
|
9
|
+
totalPages: a
|
|
11
10
|
}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
r.push(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
r.push(
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
const n = N("sm") ? 5 : 7;
|
|
12
|
+
return c.useMemo(() => {
|
|
13
|
+
const t = Math.max(5, n), r = [];
|
|
14
|
+
if (r.push("previous"), a <= t)
|
|
15
|
+
for (let u = 1; u <= a; u++)
|
|
16
|
+
r.push(u);
|
|
17
|
+
else {
|
|
18
|
+
const u = Math.floor((t - 5) / 2), f = t - 3, m = a - f;
|
|
19
|
+
if (i <= f) {
|
|
20
|
+
for (let o = 1; o <= t - 2; o++)
|
|
21
|
+
r.push(o);
|
|
22
|
+
r.push("ellipsis", a);
|
|
23
|
+
} else if (i >= m) {
|
|
24
|
+
r.push(1, "ellipsis");
|
|
25
|
+
for (let o = a - (t - 3); o <= a; o++)
|
|
26
|
+
r.push(o);
|
|
27
|
+
} else {
|
|
28
|
+
r.push(1, "ellipsis");
|
|
29
|
+
for (let o = i - u; o <= i + u; o++)
|
|
30
|
+
r.push(o);
|
|
31
|
+
r.push("ellipsis", a);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
35
34
|
return r.push("next"), r;
|
|
36
|
-
}, [
|
|
35
|
+
}, [i, a, n]);
|
|
37
36
|
}
|
|
38
|
-
const
|
|
37
|
+
const g = y(
|
|
39
38
|
[
|
|
40
39
|
// Base styles - circular button
|
|
41
40
|
"inline-flex items-center justify-center",
|
|
42
41
|
"h-9 w-9",
|
|
43
42
|
"rounded-full",
|
|
44
43
|
"text-sm font-medium",
|
|
45
|
-
"transition-colors",
|
|
44
|
+
"transition-colors duration-200 ease-out",
|
|
46
45
|
"focus-visible:outline-none focus-visible:shadow-default"
|
|
47
46
|
],
|
|
48
47
|
{
|
|
@@ -71,7 +70,12 @@ const u = N(
|
|
|
71
70
|
// Disabled state
|
|
72
71
|
"aria-disabled:opacity-50 aria-disabled:cursor-default aria-disabled:pointer-events-none"
|
|
73
72
|
],
|
|
74
|
-
ellipsis: [
|
|
73
|
+
ellipsis: [
|
|
74
|
+
"relative",
|
|
75
|
+
"cursor-default",
|
|
76
|
+
"text-foreground",
|
|
77
|
+
"pointer-events-none"
|
|
78
|
+
]
|
|
75
79
|
}
|
|
76
80
|
},
|
|
77
81
|
defaultVariants: {
|
|
@@ -80,130 +84,130 @@ const u = N(
|
|
|
80
84
|
}
|
|
81
85
|
);
|
|
82
86
|
function k({
|
|
83
|
-
className:
|
|
84
|
-
dataHook:
|
|
85
|
-
trackingEl:
|
|
86
|
-
trackingLabel:
|
|
87
|
-
ariaLabel:
|
|
88
|
-
...
|
|
87
|
+
className: i,
|
|
88
|
+
dataHook: a,
|
|
89
|
+
trackingEl: e,
|
|
90
|
+
trackingLabel: n,
|
|
91
|
+
ariaLabel: l,
|
|
92
|
+
...t
|
|
89
93
|
}) {
|
|
90
|
-
return /* @__PURE__ */
|
|
94
|
+
return /* @__PURE__ */ s(
|
|
91
95
|
"nav",
|
|
92
96
|
{
|
|
93
|
-
"aria-label":
|
|
94
|
-
className:
|
|
95
|
-
"data-hook":
|
|
97
|
+
"aria-label": l ?? "Pagination",
|
|
98
|
+
className: d("mx-auto flex w-full justify-center", i),
|
|
99
|
+
"data-hook": a,
|
|
96
100
|
"data-slot": "pagination",
|
|
97
|
-
"data-tracking-el":
|
|
98
|
-
"data-tracking-label":
|
|
101
|
+
"data-tracking-el": e || "pagination",
|
|
102
|
+
"data-tracking-label": n,
|
|
99
103
|
role: "navigation",
|
|
100
|
-
...
|
|
104
|
+
...t
|
|
101
105
|
}
|
|
102
106
|
);
|
|
103
107
|
}
|
|
104
108
|
k.displayName = "Pagination";
|
|
105
|
-
function
|
|
106
|
-
className:
|
|
107
|
-
...
|
|
109
|
+
function V({
|
|
110
|
+
className: i,
|
|
111
|
+
...a
|
|
108
112
|
}) {
|
|
109
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ s(
|
|
110
114
|
"ul",
|
|
111
115
|
{
|
|
112
|
-
className:
|
|
116
|
+
className: d("flex flex-row items-center gap-2", i),
|
|
113
117
|
"data-slot": "pagination-content",
|
|
114
|
-
...
|
|
118
|
+
...a
|
|
115
119
|
}
|
|
116
120
|
);
|
|
117
121
|
}
|
|
118
|
-
function
|
|
119
|
-
return /* @__PURE__ */
|
|
122
|
+
function L(i) {
|
|
123
|
+
return /* @__PURE__ */ s("li", { "data-slot": "pagination-item", ...i });
|
|
120
124
|
}
|
|
121
|
-
const
|
|
125
|
+
const p = c.forwardRef(({ className: i, variant: a, isActive: e, children: n, ...l }, t) => /* @__PURE__ */ s(
|
|
122
126
|
"button",
|
|
123
127
|
{
|
|
124
|
-
ref:
|
|
125
|
-
"aria-current":
|
|
126
|
-
className:
|
|
127
|
-
"data-active":
|
|
128
|
+
ref: t,
|
|
129
|
+
"aria-current": e ? "page" : void 0,
|
|
130
|
+
className: d(g({ variant: a }), i),
|
|
131
|
+
"data-active": e,
|
|
128
132
|
"data-slot": "pagination-button",
|
|
129
133
|
type: "button",
|
|
130
|
-
...
|
|
131
|
-
children:
|
|
134
|
+
...l,
|
|
135
|
+
children: n
|
|
132
136
|
}
|
|
133
137
|
));
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
|
|
138
|
+
p.displayName = "PaginationButton";
|
|
139
|
+
const P = c.forwardRef(({ className: i, disabled: a, ariaLabel: e, ...n }, l) => /* @__PURE__ */ s(
|
|
140
|
+
p,
|
|
137
141
|
{
|
|
138
|
-
ref:
|
|
139
|
-
"aria-disabled":
|
|
140
|
-
"aria-label":
|
|
141
|
-
className:
|
|
142
|
-
disabled:
|
|
142
|
+
ref: l,
|
|
143
|
+
"aria-disabled": a,
|
|
144
|
+
"aria-label": e ?? "Go to previous page",
|
|
145
|
+
className: i,
|
|
146
|
+
disabled: a,
|
|
143
147
|
variant: "previous",
|
|
144
|
-
...
|
|
145
|
-
children: /* @__PURE__ */
|
|
148
|
+
...n,
|
|
149
|
+
children: /* @__PURE__ */ s(x, {})
|
|
146
150
|
}
|
|
147
151
|
));
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
({ className:
|
|
151
|
-
|
|
152
|
+
P.displayName = "PaginationPrevious";
|
|
153
|
+
const w = c.forwardRef(
|
|
154
|
+
({ className: i, disabled: a, ariaLabel: e, ...n }, l) => /* @__PURE__ */ s(
|
|
155
|
+
p,
|
|
152
156
|
{
|
|
153
|
-
ref:
|
|
154
|
-
"aria-disabled":
|
|
155
|
-
"aria-label":
|
|
156
|
-
className:
|
|
157
|
-
disabled:
|
|
157
|
+
ref: l,
|
|
158
|
+
"aria-disabled": a,
|
|
159
|
+
"aria-label": e ?? "Go to next page",
|
|
160
|
+
className: i,
|
|
161
|
+
disabled: a,
|
|
158
162
|
variant: "next",
|
|
159
|
-
...
|
|
160
|
-
children: /* @__PURE__ */
|
|
163
|
+
...n,
|
|
164
|
+
children: /* @__PURE__ */ s(b, {})
|
|
161
165
|
}
|
|
162
166
|
)
|
|
163
167
|
);
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
({ className:
|
|
167
|
-
|
|
168
|
+
w.displayName = "PaginationNext";
|
|
169
|
+
const R = c.forwardRef(
|
|
170
|
+
({ className: i, page: a, isActive: e, ariaLabel: n, ...l }, t) => /* @__PURE__ */ s(
|
|
171
|
+
p,
|
|
168
172
|
{
|
|
169
|
-
ref:
|
|
170
|
-
"aria-label":
|
|
171
|
-
className:
|
|
172
|
-
isActive:
|
|
173
|
+
ref: t,
|
|
174
|
+
"aria-label": n ? n.replace("{page}", String(a)) : `Go to page ${a}`,
|
|
175
|
+
className: i,
|
|
176
|
+
isActive: e,
|
|
173
177
|
variant: "link",
|
|
174
|
-
...
|
|
175
|
-
children:
|
|
178
|
+
...l,
|
|
179
|
+
children: a
|
|
176
180
|
}
|
|
177
181
|
)
|
|
178
182
|
);
|
|
179
|
-
|
|
180
|
-
function
|
|
181
|
-
className:
|
|
182
|
-
srLabel:
|
|
183
|
-
...
|
|
183
|
+
R.displayName = "PaginationLink";
|
|
184
|
+
function T({
|
|
185
|
+
className: i,
|
|
186
|
+
srLabel: a = "More pages",
|
|
187
|
+
...e
|
|
184
188
|
}) {
|
|
185
189
|
return /* @__PURE__ */ h(
|
|
186
190
|
"span",
|
|
187
191
|
{
|
|
188
192
|
"aria-hidden": "true",
|
|
189
|
-
className:
|
|
193
|
+
className: d(g({ variant: "ellipsis" }), i),
|
|
190
194
|
"data-slot": "pagination-ellipsis",
|
|
191
|
-
...
|
|
195
|
+
...e,
|
|
192
196
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ s(v, {}),
|
|
198
|
+
/* @__PURE__ */ s("span", { className: "sr-only", children: a })
|
|
195
199
|
]
|
|
196
200
|
}
|
|
197
201
|
);
|
|
198
202
|
}
|
|
199
203
|
export {
|
|
200
204
|
k as Pagination,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
p as PaginationButton,
|
|
206
|
+
V as PaginationContent,
|
|
207
|
+
T as PaginationEllipsis,
|
|
208
|
+
L as PaginationItem,
|
|
209
|
+
R as PaginationLink,
|
|
210
|
+
w as PaginationNext,
|
|
211
|
+
P as PaginationPrevious,
|
|
212
|
+
I as usePagination
|
|
209
213
|
};
|
package/dist/progress.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),N=require("react"),S=require("@radix-ui/react-progress"),q=require("framer-motion"),i=require("@brightlocal/ui-components/lib/utils"),v=require("@brightlocal/ui-components/hooks/use-prefers-reduced-motion");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(N),p=h(S),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 _(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 y=b.forwardRef(({className:e,value:t,max:r=100,dataHook:n,trackingEl:c,trackingLabel:P,ariaLabel:j="Progress",label:d,color:x="green",showValue:o=!1,unit:M="%",indicatorClassName:k,disabled:l,...R},w)=>{const g=b.useId(),s=!!d,O=v.usePrefersReducedMotion(),u=m[x]??m.green,$=r>0?Math.min(100,Math.max(0,(t??0)/r*100)):0,f=a.jsx(p.Root,{ref:w,"aria-label":s?void 0:j,"aria-labelledby":s?g:void 0,className:i.cn("relative h-2 w-full overflow-hidden rounded-full",u.track,!s&&!o&&l&&"opacity-50",e),"data-hook":n,"data-slot":"progress","data-tracking-el":c,"data-tracking-label":P,max:r,value:t,...R,children:a.jsx(p.Indicator,{asChild:!0,children:a.jsx(q.motion.div,{animate:{transform:`translateX(-${100-$}%)`},className:i.cn("h-full w-full flex-1",u.indicator,k),"data-slot":"progress-indicator",initial:!1,transition:O?{duration:0}:{type:"spring",stiffness:80,damping:20,mass:1}})})});return!s&&!o?f:a.jsxs("div",{className:i.cn("flex w-full items-center gap-2",l&&"opacity-50"),"data-slot":"progress-wrapper",children:[s&&a.jsx("span",{className:"text-foreground text-xs leading-none font-medium","data-slot":"progress-label",id:g,children:d}),f,o&&a.jsx("span",{className:"text-muted-foreground shrink-0 text-xs leading-none tabular-nums","data-slot":"progress-value",children:_(t,r,M)})]})});y.displayName="Progress";exports.Progress=y;
|
package/dist/progress.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
+
/**
|
|
4
|
+
* Brand color for the progress indicator, drawn from the shared brand palette.
|
|
5
|
+
* - `green` — strong / healthy / complete
|
|
6
|
+
* - `yellow` — moderate / acceptable
|
|
7
|
+
* - `orange` — weak / needs attention
|
|
8
|
+
* - `red` — critical / urgent
|
|
9
|
+
*/
|
|
10
|
+
type ProgressColor = "green" | "red" | "orange" | "yellow";
|
|
3
11
|
/**
|
|
4
12
|
* Props for the Progress component.
|
|
5
13
|
*/
|
|
@@ -22,9 +30,27 @@ interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Ro
|
|
|
22
30
|
*/
|
|
23
31
|
ariaLabel?: string;
|
|
24
32
|
/**
|
|
25
|
-
* Optional visible label text displayed
|
|
33
|
+
* Optional visible label text displayed to the left of the progress bar
|
|
26
34
|
*/
|
|
27
35
|
label?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Brand color for the indicator.
|
|
38
|
+
* @default "green"
|
|
39
|
+
*/
|
|
40
|
+
color?: ProgressColor;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to render the numeric value to the right of the progress bar.
|
|
43
|
+
* Falls back to `–` when no value is provided so the layout stays consistent.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
showValue?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Unit/suffix appended to the displayed value. Use `"%"` for percentage form
|
|
49
|
+
* (value as a percentage of `max`, e.g. `90%`); any other unit renders
|
|
50
|
+
* fraction form (`3 / 5 steps`).
|
|
51
|
+
* @default "%"
|
|
52
|
+
*/
|
|
53
|
+
unit?: string;
|
|
28
54
|
/**
|
|
29
55
|
* Custom class name for the indicator (progress fill)
|
|
30
56
|
* Use this to customize the color, e.g., "bg-red-500"
|
|
@@ -42,5 +68,5 @@ interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Ro
|
|
|
42
68
|
*/
|
|
43
69
|
declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
44
70
|
export { Progress };
|
|
45
|
-
export type { ProgressProps };
|
|
71
|
+
export type { ProgressProps, ProgressColor };
|
|
46
72
|
//# sourceMappingURL=progress.d.ts.map
|
package/dist/progress.d.ts.map
CHANGED
|
@@ -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;AAM9D;;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,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,QAAA,MAAM,QAAQ,
|
|
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;AAM9D;;;;;;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,mGA8Gb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/progress.js
CHANGED
|
@@ -1,52 +1,85 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { usePrefersReducedMotion as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as o, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import * as b from "@radix-ui/react-progress";
|
|
4
|
+
import { motion as v } from "framer-motion";
|
|
5
|
+
import { cn as i } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { usePrefersReducedMotion as I } from "@brightlocal/ui-components/hooks/use-prefers-reduced-motion";
|
|
7
|
+
const u = {
|
|
8
|
+
green: {
|
|
9
|
+
track: "bg-brand-primary-foreground/20",
|
|
10
|
+
indicator: "bg-green-400"
|
|
11
|
+
},
|
|
12
|
+
red: {
|
|
13
|
+
track: "bg-brand-red/20",
|
|
14
|
+
indicator: "bg-brand-red"
|
|
15
|
+
},
|
|
16
|
+
orange: {
|
|
17
|
+
track: "bg-brand-orange/20",
|
|
18
|
+
indicator: "bg-brand-orange"
|
|
19
|
+
},
|
|
20
|
+
yellow: {
|
|
21
|
+
track: "bg-brand-yellow/20",
|
|
22
|
+
indicator: "bg-brand-yellow"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function L(t, r, e) {
|
|
26
|
+
if (t == null)
|
|
27
|
+
return "–";
|
|
28
|
+
if (e === "%")
|
|
29
|
+
return `${r > 0 ? Math.min(100, Math.max(0, Math.round(t / r * 100))) : 0}%`;
|
|
30
|
+
const n = e ? ` ${e}` : "";
|
|
31
|
+
return r > 0 ? `${t} / ${r}${n}` : `${t}${n}`;
|
|
32
|
+
}
|
|
33
|
+
const S = p.forwardRef(
|
|
8
34
|
({
|
|
9
|
-
className:
|
|
10
|
-
value:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
35
|
+
className: t,
|
|
36
|
+
value: r,
|
|
37
|
+
max: e = 100,
|
|
38
|
+
dataHook: n,
|
|
39
|
+
trackingEl: d,
|
|
40
|
+
trackingLabel: h,
|
|
41
|
+
ariaLabel: y = "Progress",
|
|
42
|
+
label: l,
|
|
43
|
+
color: k = "green",
|
|
44
|
+
showValue: s = !1,
|
|
45
|
+
unit: x = "%",
|
|
46
|
+
indicatorClassName: $,
|
|
47
|
+
disabled: c,
|
|
48
|
+
...w
|
|
49
|
+
}, M) => {
|
|
50
|
+
const g = p.useId(), a = !!l, P = I(), f = u[k] ?? u.green, N = e > 0 ? Math.min(100, Math.max(0, (r ?? 0) / e * 100)) : 0, m = /* @__PURE__ */ o(
|
|
51
|
+
b.Root,
|
|
22
52
|
{
|
|
23
|
-
ref:
|
|
24
|
-
"aria-label": a ? void 0 :
|
|
25
|
-
"aria-labelledby": a ?
|
|
26
|
-
className:
|
|
53
|
+
ref: M,
|
|
54
|
+
"aria-label": a ? void 0 : y,
|
|
55
|
+
"aria-labelledby": a ? g : void 0,
|
|
56
|
+
className: i(
|
|
27
57
|
"relative h-2 w-full overflow-hidden rounded-full",
|
|
28
|
-
|
|
29
|
-
!a &&
|
|
30
|
-
|
|
58
|
+
f.track,
|
|
59
|
+
!a && !s && c && "opacity-50",
|
|
60
|
+
t
|
|
31
61
|
),
|
|
32
|
-
"data-hook":
|
|
62
|
+
"data-hook": n,
|
|
33
63
|
"data-slot": "progress",
|
|
34
|
-
"data-tracking-el":
|
|
35
|
-
"data-tracking-label":
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
64
|
+
"data-tracking-el": d,
|
|
65
|
+
"data-tracking-label": h,
|
|
66
|
+
max: e,
|
|
67
|
+
value: r,
|
|
68
|
+
...w,
|
|
69
|
+
children: /* @__PURE__ */ o(b.Indicator, { asChild: !0, children: /* @__PURE__ */ o(
|
|
70
|
+
v.div,
|
|
39
71
|
{
|
|
40
72
|
animate: {
|
|
41
|
-
transform: `translateX(-${100 -
|
|
73
|
+
transform: `translateX(-${100 - N}%)`
|
|
42
74
|
},
|
|
43
|
-
className:
|
|
44
|
-
"h-full w-full flex-1
|
|
45
|
-
|
|
75
|
+
className: i(
|
|
76
|
+
"h-full w-full flex-1",
|
|
77
|
+
f.indicator,
|
|
78
|
+
$
|
|
46
79
|
),
|
|
47
80
|
"data-slot": "progress-indicator",
|
|
48
81
|
initial: !1,
|
|
49
|
-
transition:
|
|
82
|
+
transition: P ? { duration: 0 } : {
|
|
50
83
|
type: "spring",
|
|
51
84
|
stiffness: 80,
|
|
52
85
|
damping: 20,
|
|
@@ -56,31 +89,39 @@ const P = l.forwardRef(
|
|
|
56
89
|
) })
|
|
57
90
|
}
|
|
58
91
|
);
|
|
59
|
-
return
|
|
92
|
+
return !a && !s ? m : /* @__PURE__ */ R(
|
|
60
93
|
"div",
|
|
61
94
|
{
|
|
62
|
-
className:
|
|
95
|
+
className: i(
|
|
63
96
|
"flex w-full items-center gap-2",
|
|
64
|
-
|
|
97
|
+
c && "opacity-50"
|
|
65
98
|
),
|
|
66
99
|
"data-slot": "progress-wrapper",
|
|
67
100
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
101
|
+
a && /* @__PURE__ */ o(
|
|
69
102
|
"span",
|
|
70
103
|
{
|
|
71
|
-
className: "text-foreground text-
|
|
104
|
+
className: "text-foreground text-xs leading-none font-medium",
|
|
72
105
|
"data-slot": "progress-label",
|
|
73
|
-
id:
|
|
74
|
-
children:
|
|
106
|
+
id: g,
|
|
107
|
+
children: l
|
|
75
108
|
}
|
|
76
109
|
),
|
|
77
|
-
|
|
110
|
+
m,
|
|
111
|
+
s && /* @__PURE__ */ o(
|
|
112
|
+
"span",
|
|
113
|
+
{
|
|
114
|
+
className: "text-muted-foreground shrink-0 text-xs leading-none tabular-nums",
|
|
115
|
+
"data-slot": "progress-value",
|
|
116
|
+
children: L(r, e, x)
|
|
117
|
+
}
|
|
118
|
+
)
|
|
78
119
|
]
|
|
79
120
|
}
|
|
80
|
-
)
|
|
121
|
+
);
|
|
81
122
|
}
|
|
82
123
|
);
|
|
83
|
-
|
|
124
|
+
S.displayName = "Progress";
|
|
84
125
|
export {
|
|
85
|
-
|
|
126
|
+
S as Progress
|
|
86
127
|
};
|
package/dist/skeleton.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),u=require("@brightlocal/ui-components/lib/utils");function d(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 f=d(i),o=f.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:n,loadingLabel:c,...l},s)=>r.jsx("div",{ref:s,"aria-busy":"true",className:u.cn("bg-accent animate-pulse rounded-md",e),"data-hook":a,"data-slot":"skeleton","data-tracking-el":t,"data-tracking-label":n,...l,children:r.jsx("span",{className:"sr-only",children:c??"Loading"})}));o.displayName="Skeleton";exports.Skeleton=o;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),u=require("@brightlocal/ui-components/lib/utils");function d(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 f=d(i),o=f.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:n,loadingLabel:c,...l},s)=>r.jsx("div",{ref:s,"aria-busy":"true",className:u.cn("bg-accent relative animate-pulse rounded-md",e),"data-hook":a,"data-slot":"skeleton","data-tracking-el":t,"data-tracking-label":n,...l,children:r.jsx("span",{className:"sr-only",children:c??"Loading"})}));o.displayName="Skeleton";exports.Skeleton=o;
|
package/dist/skeleton.js
CHANGED
package/dist/sonner.d.ts
CHANGED
|
@@ -171,7 +171,7 @@ declare namespace Sonner {
|
|
|
171
171
|
* // Show loading toast
|
|
172
172
|
* sonner({
|
|
173
173
|
* title: "Uploading...",
|
|
174
|
-
* description: "
|
|
174
|
+
* description: "Uploading your file.",
|
|
175
175
|
* icon: "loading",
|
|
176
176
|
* id: loadingToastId
|
|
177
177
|
* });
|
package/dist/table.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),N=require("react"),f=require("class-variance-authority"),r=require("@brightlocal/ui-components/lib/utils");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const s=j(N),k=f.cva("align-middle bg-transparent text-foreground text-sm font-normal leading-normal break-words",{variants:{size:{default:"h-12 p-2",md:"h-16 p-2",lg:"h-24 p-2"},align:{left:"text-left",right:"text-right",center:"text-center"}},defaultVariants:{size:"default",align:"left"}}),R=f.cva("h-10 p-2 align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",{variants:{align:{left:"text-left",right:"text-right",center:"text-center"}},defaultVariants:{align:"left"}}),u=s.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:l,layout:d="auto",minWidth:n,scrollRegionLabel:i,style:c,...b},w)=>o.jsx("div",{className:r.cn("relative w-full overflow-x-auto",n&&"focus-visible:shadow-default rounded-md outline-none"),"data-slot":"table-container",...n?{role:"region","aria-label":i??"Scrollable table",tabIndex:0}:void 0,children:o.jsx("table",{ref:w,className:r.cn("w-full caption-bottom text-sm",d==="fixed"&&"table-fixed",e),"data-hook":t,"data-slot":"table","data-tracking-el":a,"data-tracking-label":l,style:{minWidth:n,...c},...b})}));u.displayName="Table";const m=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("thead",{ref:l,className:r.cn(e),"data-hook":t,"data-slot":"table-header",...a}));m.displayName="TableHeader";const g=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("tbody",{ref:l,className:r.cn(e),"data-hook":t,"data-slot":"table-body",...a}));g.displayName="TableBody";const p=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("tfoot",{ref:l,className:r.cn("bg-muted/50",e),"data-hook":t,"data-slot":"table-footer",...a}));p.displayName="TableFooter";const x=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("tr",{ref:l,className:r.cn("data-[state=selected]:bg-muted transition-colors duration-150 ease-in-out",e),"data-hook":t,"data-slot":"table-row",...a}));x.displayName="TableRow";const T=s.forwardRef(({className:e,dataHook:t,align:a,width:l,minWidth:d,style:n,scope:i="col",...c},b)=>o.jsx("th",{ref:b,className:r.cn(R({align:a}),e),"data-hook":t,"data-slot":"table-head",scope:i,style:{width:l,minWidth:d,...n},...c}));T.displayName="TableHead";const h=s.forwardRef(({className:e,dataHook:t,size:a,align:l,width:d,minWidth:n,style:i,...c},b)=>o.jsx("td",{ref:b,className:r.cn(k({size:a,align:l}),e),"data-hook":t,"data-slot":"table-cell",style:{width:d,minWidth:n,...i},...c}));h.displayName="TableCell";const y=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("caption",{ref:l,className:r.cn("caption-bottom py-4",e),"data-hook":t,"data-slot":"table-caption",...a}));y.displayName="TableCaption";exports.Table=u;exports.TableBody=g;exports.TableCaption=y;exports.TableCell=h;exports.TableFooter=p;exports.TableHead=T;exports.TableHeader=m;exports.TableRow=x;
|
package/dist/table.d.ts
CHANGED
|
@@ -20,6 +20,17 @@ interface TableProps extends React.ComponentProps<"table"> {
|
|
|
20
20
|
* Tracking label for analytics context
|
|
21
21
|
*/
|
|
22
22
|
trackingLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Table layout algorithm.
|
|
25
|
+
* - `"auto"` (default) — browser sizes columns based on content.
|
|
26
|
+
* - `"fixed"` — columns respect explicit `width` values on `TableHead`/`TableCell`
|
|
27
|
+
* and split remaining space equally. Use when you set `width` on headers.
|
|
28
|
+
*
|
|
29
|
+
* **Migration note:** `"fixed"` will become the default in the next major release.
|
|
30
|
+
* Consumers should start setting explicit `width` on `TableHead` columns now.
|
|
31
|
+
* @default "auto"
|
|
32
|
+
*/
|
|
33
|
+
layout?: "auto" | "fixed";
|
|
23
34
|
/**
|
|
24
35
|
* Minimum width for the table (e.g., "600px", "40rem").
|
|
25
36
|
* Prevents columns from compressing on narrow viewports and enables
|
|
@@ -70,7 +81,11 @@ interface TableHeadProps extends Omit<React.ComponentProps<"th">, "align">, Vari
|
|
|
70
81
|
*/
|
|
71
82
|
dataHook?: string;
|
|
72
83
|
/**
|
|
73
|
-
*
|
|
84
|
+
* Explicit width for the column (e.g., "200px", "50%", "10rem").
|
|
85
|
+
*/
|
|
86
|
+
width?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Minimum width for the column (e.g., "100px", "8rem").
|
|
74
89
|
*/
|
|
75
90
|
minWidth?: string;
|
|
76
91
|
/**
|
|
@@ -86,7 +101,12 @@ interface TableCellProps extends Omit<React.ComponentProps<"td">, "align">, Vari
|
|
|
86
101
|
*/
|
|
87
102
|
dataHook?: string;
|
|
88
103
|
/**
|
|
89
|
-
*
|
|
104
|
+
* Width for the cell (e.g., "200px", "50%", "10rem").
|
|
105
|
+
* Set `layout="fixed"` on the parent `Table` for this value to be respected as an exact constraint.
|
|
106
|
+
*/
|
|
107
|
+
width?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Minimum width for the cell (e.g., "100px", "8rem").
|
|
90
110
|
*/
|
|
91
111
|
minWidth?: string;
|
|
92
112
|
/**
|