@brightlocal/ui-components 3.4.0 → 3.5.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 +22 -3
- package/README.md +177 -109
- package/component-meta.json +1061 -102
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +13 -2
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +4 -3
- package/dist/banner.cjs +1 -1
- package/dist/banner.d.ts +47 -11
- package/dist/banner.d.ts.map +1 -1
- package/dist/banner.js +156 -79
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +40 -5
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +59 -52
- package/dist/blocks/input-list.d.ts +1 -0
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +12 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +64 -63
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +47 -43
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +12 -0
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +115 -97
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -10
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +281 -296
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +430 -343
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -2
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +212 -207
- package/dist/count-indicator.cjs +1 -0
- package/dist/count-indicator.d.ts +85 -0
- package/dist/count-indicator.d.ts.map +1 -0
- package/dist/count-indicator.js +72 -0
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +101 -11
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +593 -523
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +26 -3
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +62 -47
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +8 -4
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +37 -38
- package/dist/file-upload.cjs +1 -0
- package/dist/file-upload.d.ts +546 -0
- package/dist/file-upload.d.ts.map +1 -0
- package/dist/file-upload.js +1103 -0
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +7 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +52 -52
- package/dist/hooks/use-file-dropzone.cjs +1 -0
- package/dist/hooks/use-file-dropzone.d.ts +75 -0
- package/dist/hooks/use-file-dropzone.d.ts.map +1 -0
- package/dist/hooks/use-file-dropzone.js +133 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +29 -16
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +153 -36
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +676 -640
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +30 -1
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +131 -115
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +37 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +131 -114
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +6 -6
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.d.ts +27 -1
- package/dist/lib/empty-canvas.d.ts.map +1 -1
- package/dist/lib/empty-canvas.js +27 -23
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +19 -2
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +14 -9
- package/dist/lib/field-aria.cjs +1 -1
- package/dist/lib/field-aria.d.ts +4 -4
- package/dist/lib/field-aria.d.ts.map +1 -1
- package/dist/lib/field-aria.js +7 -5
- package/dist/lib/media-viewer-content.cjs +1 -1
- package/dist/lib/media-viewer-content.js +1 -1
- package/dist/lib/table-internal.cjs +1 -1
- package/dist/lib/table-internal.d.ts +19 -0
- package/dist/lib/table-internal.d.ts.map +1 -1
- package/dist/lib/table-internal.js +22 -7
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +13 -0
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +103 -82
- package/dist/logo-mark.cjs +1 -1
- package/dist/logo-mark.d.ts +18 -2
- package/dist/logo-mark.d.ts.map +1 -1
- package/dist/logo-mark.js +159 -79
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.d.ts +50 -7
- package/dist/media-empty.d.ts.map +1 -1
- package/dist/media-empty.js +14 -13
- package/dist/media-viewer.cjs +1 -1
- package/dist/media-viewer.js +6 -6
- package/dist/multi-select-filter.cjs +1 -1
- package/dist/multi-select-filter.d.ts.map +1 -1
- package/dist/multi-select-filter.js +92 -101
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +11 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +17 -17
- package/dist/relative-date.d.ts +6 -0
- package/dist/relative-date.d.ts.map +1 -1
- package/dist/resizable.d.ts +1 -1
- package/dist/result-count.cjs +1 -1
- package/dist/result-count.d.ts +13 -16
- package/dist/result-count.d.ts.map +1 -1
- package/dist/result-count.js +24 -33
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +22 -3
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +152 -125
- package/dist/single-select-filter.cjs +1 -1
- package/dist/single-select-filter.d.ts.map +1 -1
- package/dist/single-select-filter.js +67 -76
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +77 -76
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +39 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +127 -76
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +34 -0
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +115 -19
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +137 -131
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +6 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +14 -13
- package/package.json +3 -4
- package/src/blocks/empty-state.tsx +108 -48
- package/src/blocks/input-list.tsx +1 -0
- package/src/blocks/sidebar.tsx +39 -16
- package/src/components/alert-dialog.tsx +18 -2
- package/src/components/banner.tsx +247 -68
- package/src/components/button.tsx +27 -10
- package/src/components/card.tsx +89 -7
- package/src/components/chart.tsx +47 -67
- package/src/components/combobox.tsx +221 -12
- package/src/components/command.tsx +83 -37
- package/src/components/count-indicator.tsx +188 -0
- package/src/components/data-table.tsx +506 -159
- package/src/components/dialog.tsx +74 -5
- package/src/components/drawer.tsx +52 -32
- package/src/components/file-upload.tsx +2574 -0
- package/src/components/global-layout.tsx +18 -5
- package/src/components/hover-card.tsx +395 -65
- package/src/components/input-chip.tsx +67 -2
- package/src/components/input-group.tsx +89 -6
- package/src/components/list.tsx +40 -3
- package/src/components/logo-mark.tsx +109 -25
- package/src/components/media-empty.tsx +62 -7
- package/src/components/multi-select-filter.tsx +9 -16
- package/src/components/pagination.tsx +15 -2
- package/src/components/relative-date.tsx +6 -0
- package/src/components/result-count.tsx +27 -54
- package/src/components/sheet.tsx +86 -8
- package/src/components/single-select-filter.tsx +9 -16
- package/src/components/table.tsx +16 -1
- package/src/components/tabs.tsx +223 -41
- package/src/components/textarea.tsx +271 -4
- package/src/components/tooltip.tsx +29 -2
- package/src/components/typography-text.tsx +7 -2
- package/src/hooks/use-file-dropzone.ts +325 -0
- package/src/index.ts +3 -0
- package/src/lib/empty-canvas.tsx +47 -20
- package/src/lib/empty-chip.tsx +38 -3
- package/src/lib/field-aria.tsx +11 -6
- package/src/lib/table-internal.ts +38 -0
package/dist/pagination.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResultCount as J } from "./result-count.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as p from "react";
|
|
3
3
|
import { ChevronLeft as K, ChevronRight as Q, MoreHorizontal as U } from "@brightlocal/icons";
|
|
4
4
|
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
5
5
|
import { jsx as r, jsxs as M } from "react/jsx-runtime";
|
|
@@ -7,15 +7,15 @@ import { cva as W } from "class-variance-authority";
|
|
|
7
7
|
import { useIsBelowBreakpoint as L } from "@brightlocal/ui-components/hooks/use-breakpoint";
|
|
8
8
|
function X({ page: i, totalPages: a }) {
|
|
9
9
|
const t = L("sm") ? 5 : 7;
|
|
10
|
-
return
|
|
10
|
+
return p.useMemo(() => {
|
|
11
11
|
const o = Math.max(5, t), n = [];
|
|
12
12
|
if (n.push("previous"), a <= o) for (let e = 1; e <= a; e++) n.push(e);
|
|
13
13
|
else {
|
|
14
|
-
const e = Math.floor((o - 5) / 2), s = o - 3,
|
|
14
|
+
const e = Math.floor((o - 5) / 2), s = o - 3, g = a - s + 1;
|
|
15
15
|
if (i <= s) {
|
|
16
16
|
for (let l = 1; l <= o - 2; l++) n.push(l);
|
|
17
17
|
n.push("ellipsis", a);
|
|
18
|
-
} else if (i >=
|
|
18
|
+
} else if (i >= g) {
|
|
19
19
|
n.push(1, "ellipsis");
|
|
20
20
|
for (let l = a - (o - 3); l <= a; l++) n.push(l);
|
|
21
21
|
} else {
|
|
@@ -24,8 +24,8 @@ function X({ page: i, totalPages: a }) {
|
|
|
24
24
|
n.push("ellipsis", a);
|
|
25
25
|
}
|
|
26
26
|
for (let l = 1; l < n.length - 1; l++) {
|
|
27
|
-
const
|
|
28
|
-
n[l] === "ellipsis" && typeof
|
|
27
|
+
const f = n[l - 1], c = n[l + 1];
|
|
28
|
+
n[l] === "ellipsis" && typeof f == "number" && typeof c == "number" && c - f === 2 && (n[l] = f + 1);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
return n.push("next"), n;
|
|
@@ -99,7 +99,7 @@ function b(i) {
|
|
|
99
99
|
...i
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
var v =
|
|
102
|
+
var v = p.forwardRef(({ className: i, variant: a, isActive: t, children: o, ...n }, e) => /* @__PURE__ */ r("button", {
|
|
103
103
|
ref: e,
|
|
104
104
|
"aria-current": t ? "page" : void 0,
|
|
105
105
|
className: d(P({ variant: a }), i),
|
|
@@ -110,7 +110,7 @@ var v = f.forwardRef(({ className: i, variant: a, isActive: t, children: o, ...n
|
|
|
110
110
|
children: o
|
|
111
111
|
}));
|
|
112
112
|
v.displayName = "PaginationButton";
|
|
113
|
-
var j =
|
|
113
|
+
var j = p.forwardRef(({ className: i, disabled: a, ariaLabel: t, ...o }, n) => /* @__PURE__ */ r(v, {
|
|
114
114
|
ref: n,
|
|
115
115
|
"aria-disabled": a,
|
|
116
116
|
"aria-label": t ?? "Go to previous page",
|
|
@@ -121,7 +121,7 @@ var j = f.forwardRef(({ className: i, disabled: a, ariaLabel: t, ...o }, n) => /
|
|
|
121
121
|
children: /* @__PURE__ */ r(K, {})
|
|
122
122
|
}));
|
|
123
123
|
j.displayName = "PaginationPrevious";
|
|
124
|
-
var B =
|
|
124
|
+
var B = p.forwardRef(({ className: i, disabled: a, ariaLabel: t, ...o }, n) => /* @__PURE__ */ r(v, {
|
|
125
125
|
ref: n,
|
|
126
126
|
"aria-disabled": a,
|
|
127
127
|
"aria-label": t ?? "Go to next page",
|
|
@@ -132,7 +132,7 @@ var B = f.forwardRef(({ className: i, disabled: a, ariaLabel: t, ...o }, n) => /
|
|
|
132
132
|
children: /* @__PURE__ */ r(Q, {})
|
|
133
133
|
}));
|
|
134
134
|
B.displayName = "PaginationNext";
|
|
135
|
-
var $ =
|
|
135
|
+
var $ = p.forwardRef(({ className: i, page: a, isActive: t, ariaLabel: o, ...n }, e) => /* @__PURE__ */ r(v, {
|
|
136
136
|
ref: e,
|
|
137
137
|
"aria-label": o ? o.replace("{page}", String(a)) : `Go to page ${a}`,
|
|
138
138
|
className: i,
|
|
@@ -154,11 +154,11 @@ function Z({ className: i, srLabel: a = "More pages", ...t }) {
|
|
|
154
154
|
})]
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
var _ =
|
|
157
|
+
var _ = p.forwardRef(({ className: i, page: a, totalPages: t, onPageChange: o, dataHook: n, totalItems: e, pageSize: s, captionLabel: g, captionLabelOne: l, captionEmptyLabel: f, renderCaption: c, ariaLabel: C, prevAriaLabel: V, nextAriaLabel: G, pageAriaLabel: F, ellipsisSrLabel: T, updating: z, updatingLabel: S, trackingEl: E, trackingLabel: O, ...q }, A) => {
|
|
158
158
|
const D = X({
|
|
159
159
|
page: a,
|
|
160
160
|
totalPages: t
|
|
161
|
-
}), H = L("sm"),
|
|
161
|
+
}), H = L("sm"), m = (() => {
|
|
162
162
|
if (H || c === null || e === void 0 || s === void 0 || !Number.isFinite(s) || s <= 0 || !Number.isFinite(e) || e < 0) return null;
|
|
163
163
|
const u = Math.max(1, Math.ceil(e / s)), h = Math.min(Math.max(1, Math.floor(a) || 1), u), w = e === 0 ? 0 : (h - 1) * s + 1, N = Math.min(h * s, e);
|
|
164
164
|
if (c) {
|
|
@@ -179,15 +179,15 @@ var _ = f.forwardRef(({ className: i, page: a, totalPages: t, onPageChange: o, d
|
|
|
179
179
|
return /* @__PURE__ */ r(J, {
|
|
180
180
|
className: "whitespace-nowrap",
|
|
181
181
|
dataHook: `${n}-caption`,
|
|
182
|
-
emptyLabel:
|
|
182
|
+
emptyLabel: f,
|
|
183
183
|
from: w,
|
|
184
|
-
rangeLabel:
|
|
184
|
+
rangeLabel: g,
|
|
185
185
|
rangeLabelOne: l,
|
|
186
186
|
to: N,
|
|
187
187
|
total: e
|
|
188
188
|
});
|
|
189
|
-
})(), x = t > 1, y =
|
|
190
|
-
return
|
|
189
|
+
})(), x = t > 1, y = m != null && (!!c || e !== 0);
|
|
190
|
+
return m == null && !x ? null : /* @__PURE__ */ M("div", {
|
|
191
191
|
ref: A,
|
|
192
192
|
className: d("flex w-full flex-wrap items-center gap-x-4 gap-y-2", (y || x) && "min-h-9", y ? "justify-between" : "justify-center", i),
|
|
193
193
|
"data-hook": n,
|
|
@@ -195,7 +195,7 @@ var _ = f.forwardRef(({ className: i, page: a, totalPages: t, onPageChange: o, d
|
|
|
195
195
|
"data-tracking-el": E || "pagination-controls",
|
|
196
196
|
"data-tracking-label": O,
|
|
197
197
|
...q,
|
|
198
|
-
children: [
|
|
198
|
+
children: [m, x && /* @__PURE__ */ r(R, {
|
|
199
199
|
ariaLabel: C,
|
|
200
200
|
className: d(y && "mx-0 w-auto grow justify-end"),
|
|
201
201
|
dataHook: `${n}-nav`,
|
package/dist/relative-date.d.ts
CHANGED
|
@@ -60,6 +60,12 @@ export declare function toDate(value: string | Date): Date;
|
|
|
60
60
|
export declare function dateLabel(date: Date, now?: Date): string;
|
|
61
61
|
export declare function exactText(date: Date, dateOnly: boolean): string;
|
|
62
62
|
export declare function relativeWords(value: string | Date, now: Date, labels?: RelativeDateLabels): string;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the current `Date`, re-rendering the consumer on a configurable interval.
|
|
65
|
+
*
|
|
66
|
+
* @param every - Refresh interval in milliseconds
|
|
67
|
+
* @default 30_000
|
|
68
|
+
*/
|
|
63
69
|
export declare function useNow(every?: number): Date;
|
|
64
70
|
export declare const RelativeDate: import('react').ForwardRefExoticComponent<RelativeDateProps & import('react').RefAttributes<HTMLElement>>;
|
|
65
71
|
//# sourceMappingURL=relative-date.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative-date.d.ts","sourceRoot":"","sources":["../../src/components/relative-date.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;I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IAAI,EACT,MAAM,GAAE,kBAAiD,GACxD,MAAM,CAyBR;AAED,wBAAgB,MAAM,CAAC,KAAK,SAAc,GAAG,IAAI,CAehD;AAED,eAAO,MAAM,YAAY,2GA8DxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"relative-date.d.ts","sourceRoot":"","sources":["../../src/components/relative-date.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAU1C,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAQD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAExD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAGjD;AAOD,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAa,GAAG,MAAM,CAM9D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAiB/D;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,GAAG,EAAE,IAAI,EACT,MAAM,GAAE,kBAAiD,GACxD,MAAM,CAyBR;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,KAAK,SAAc,GAAG,IAAI,CAehD;AAED,eAAO,MAAM,YAAY,2GA8DxB,CAAC"}
|
package/dist/resizable.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ type ResizablePanelProps = Omit<PanelProps, "defaultSize" | "minSize" | "maxSize
|
|
|
51
51
|
* Individual resizable panel within a panel group.
|
|
52
52
|
* `ref` is the root element; use the `panelRef` prop for the imperative handle.
|
|
53
53
|
*/
|
|
54
|
-
declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<PanelProps, "
|
|
54
|
+
declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<PanelProps, "maxSize" | "minSize" | "elementRef" | "defaultSize" | "collapsedSize"> & {
|
|
55
55
|
/** Initial size. A number is a percentage of the group. */
|
|
56
56
|
defaultSize?: PanelSize;
|
|
57
57
|
/** Minimum size. A number is a percentage of the group. */
|
package/dist/result-count.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const
|
|
1
|
+
"use client";const N=require("./_virtual/_rolldown/runtime.cjs");let i=require("react");i=N.__toESM(i,1);let C=require("@brightlocal/ui-components/lib/utils"),n=require("react/jsx-runtime");function a(l,o){return Object.entries(o).reduce((t,[r,s])=>t.replaceAll(`{{${r}}}`,String(s)).replaceAll(`{${r}}`,String(s)),l)}var _=i.forwardRef(({className:l,dataHook:o,count:t,from:r,to:s,total:e,label:c,labelOne:g,noTotalLabel:d,noTotalLabelOne:x,rangeLabel:f,rangeLabelOne:y,emptyLabel:b,trackingEl:h,trackingLabel:j,updating:S,updatingLabel:k,...q},R)=>{const m=typeof r=="number"&&typeof s=="number",p=m?e===0:t===0;let u;return m?u=a(e===1?y??f??"{from} to {to} of {total} result":f??"{from} to {to} of {total} results",{from:r,to:s,total:e??0}):e!==void 0?u=a(e===1?g??c??"{count} of {total} result":c??"{count} of {total} results",{count:t??0,total:e}):u=a(t===1?x??d??"{count} result":d??"{count} results",{count:t??0}),(0,n.jsxs)("p",{ref:R,className:(0,C.cn)("text-muted-foreground text-body-sm relative",l),"data-hook":o,"data-slot":"result-count","data-tracking-el":h??"result-count","data-tracking-label":j,role:"status",...q,children:[!p&&(0,n.jsx)("span",{"data-slot":"result-count-text",children:u}),p&&(0,n.jsx)("span",{className:"sr-only","data-slot":"result-count-empty",children:b??"No results"})]})});_.displayName="ResultCount";exports.ResultCount=_;
|
package/dist/result-count.d.ts
CHANGED
|
@@ -5,20 +5,6 @@ interface ResultCountBaseProps extends Omit<React.ComponentPropsWithoutRef<"p">,
|
|
|
5
5
|
* @example "locations-result-count"
|
|
6
6
|
*/
|
|
7
7
|
dataHook: string;
|
|
8
|
-
/**
|
|
9
|
-
* Refetch in flight — the live region announces the updating message
|
|
10
|
-
* alone, while the previous count stays on screen (aria-hidden) beside
|
|
11
|
-
* the spinner. Dimming the rows is the consumer's job; this indicator is
|
|
12
|
-
* what makes dimming never the only signal.
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
updating?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Text shown beside the spinner during a refetch — and, on its own, the
|
|
18
|
-
* whole of what the live region announces while it is in flight.
|
|
19
|
-
* @default "Updating results"
|
|
20
|
-
*/
|
|
21
|
-
updatingLabel?: string;
|
|
22
8
|
/**
|
|
23
9
|
* Screen-reader-only text while the collection is empty. The visible
|
|
24
10
|
* count hides at zero — the empty state already says it — but the live
|
|
@@ -30,6 +16,17 @@ interface ResultCountBaseProps extends Omit<React.ComponentPropsWithoutRef<"p">,
|
|
|
30
16
|
trackingEl?: string;
|
|
31
17
|
/** Analytics label */
|
|
32
18
|
trackingLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated No-op since 3.5.0 — the count holds its previous value
|
|
21
|
+
* during a refetch; the DataTable's `refetchingLabel` live region covers
|
|
22
|
+
* SR announcements. Will be removed in the next major version.
|
|
23
|
+
*/
|
|
24
|
+
updating?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated No-op since 3.5.0 — removed together with `updating`.
|
|
27
|
+
* Will be removed in the next major version.
|
|
28
|
+
*/
|
|
29
|
+
updatingLabel?: string;
|
|
33
30
|
}
|
|
34
31
|
/** Plain form: how many records the filters left, out of an optional total. */
|
|
35
32
|
interface ResultCountPlainProps extends ResultCountBaseProps {
|
|
@@ -101,8 +98,8 @@ interface ResultCountRangeProps extends ResultCountBaseProps {
|
|
|
101
98
|
type ResultCountProps = ResultCountPlainProps | ResultCountRangeProps;
|
|
102
99
|
/**
|
|
103
100
|
* The collection's count as a `role="status"` live region — one per
|
|
104
|
-
* screen. Announces the new count once per change,
|
|
105
|
-
*
|
|
101
|
+
* screen. Announces the new count once per change, and the empty label
|
|
102
|
+
* (screen-reader only) at zero.
|
|
106
103
|
*/
|
|
107
104
|
declare const ResultCount: React.ForwardRefExoticComponent<ResultCountProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
108
105
|
export { ResultCount };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-count.d.ts","sourceRoot":"","sources":["../../src/components/result-count.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,UAAU,oBAAqB,SAAQ,IAAI,CACzC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EACnC,UAAU,CACX;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"result-count.d.ts","sourceRoot":"","sources":["../../src/components/result-count.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,UAAU,oBAAqB,SAAQ,IAAI,CACzC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EACnC,UAAU,CACX;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+EAA+E;AAC/E,UAAU,qBAAsB,SAAQ,oBAAoB;IAC1D,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,EAAE,CAAC,EAAE,KAAK,CAAC;IACX;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB;AAED,4EAA4E;AAC5E,UAAU,qBAAsB,SAAQ,oBAAoB;IAC1D,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB;AAED,KAAK,gBAAgB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC;AAgBtE;;;;GAIG;AACH,QAAA,MAAM,WAAW,+FA6EhB,CAAC;AAIF,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/result-count.js
CHANGED
|
@@ -1,49 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return Object.entries(a).reduce((t, [r, s]) => t.replaceAll(`{{${r}}}`, String(s)).replaceAll(`{${r}}`, String(s)), l);
|
|
2
|
+
import * as j from "react";
|
|
3
|
+
import { cn as k } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { jsx as m, jsxs as v } from "react/jsx-runtime";
|
|
5
|
+
function n(l, u) {
|
|
6
|
+
return Object.entries(u).reduce((t, [r, s]) => t.replaceAll(`{{${r}}}`, String(s)).replaceAll(`{${r}}`, String(s)), l);
|
|
8
7
|
}
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
return
|
|
8
|
+
var A = j.forwardRef(({ className: l, dataHook: u, count: t, from: r, to: s, total: e, label: a, labelOne: p, noTotalLabel: c, noTotalLabelOne: g, rangeLabel: i, rangeLabelOne: x, emptyLabel: y, trackingEl: R, trackingLabel: h, updating: C, updatingLabel: S, ...N }, b) => {
|
|
9
|
+
const d = typeof r == "number" && typeof s == "number", f = d ? e === 0 : t === 0;
|
|
10
|
+
let o;
|
|
11
|
+
return d ? o = n(e === 1 ? x ?? i ?? "{from} to {to} of {total} result" : i ?? "{from} to {to} of {total} results", {
|
|
13
12
|
from: r,
|
|
14
13
|
to: s,
|
|
15
14
|
total: e ?? 0
|
|
16
|
-
}) : e !== void 0 ?
|
|
15
|
+
}) : e !== void 0 ? o = n(e === 1 ? p ?? a ?? "{count} of {total} result" : a ?? "{count} of {total} results", {
|
|
17
16
|
count: t ?? 0,
|
|
18
17
|
total: e
|
|
19
|
-
}) :
|
|
20
|
-
ref:
|
|
21
|
-
className:
|
|
22
|
-
"data-hook":
|
|
18
|
+
}) : o = n(t === 1 ? g ?? c ?? "{count} result" : c ?? "{count} results", { count: t ?? 0 }), /* @__PURE__ */ v("p", {
|
|
19
|
+
ref: b,
|
|
20
|
+
className: k("text-muted-foreground text-body-sm relative", l),
|
|
21
|
+
"data-hook": u,
|
|
23
22
|
"data-slot": "result-count",
|
|
24
|
-
"data-tracking-el":
|
|
25
|
-
"data-tracking-label":
|
|
23
|
+
"data-tracking-el": R ?? "result-count",
|
|
24
|
+
"data-tracking-label": h,
|
|
26
25
|
role: "status",
|
|
27
|
-
...
|
|
28
|
-
children:
|
|
29
|
-
"aria-hidden": "true",
|
|
26
|
+
...N,
|
|
27
|
+
children: [!f && /* @__PURE__ */ m("span", {
|
|
30
28
|
"data-slot": "result-count-text",
|
|
31
|
-
children:
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
-
className: "inline-flex items-center gap-1.5",
|
|
34
|
-
"data-slot": "result-count-updating",
|
|
35
|
-
children: [/* @__PURE__ */ o($, { size: "sm" }), N ?? "Updating results"]
|
|
36
|
-
})] }) : p ? /* @__PURE__ */ o("span", {
|
|
29
|
+
children: o
|
|
30
|
+
}), f && /* @__PURE__ */ m("span", {
|
|
37
31
|
className: "sr-only",
|
|
38
32
|
"data-slot": "result-count-empty",
|
|
39
|
-
children:
|
|
40
|
-
})
|
|
41
|
-
"data-slot": "result-count-text",
|
|
42
|
-
children: n
|
|
43
|
-
})
|
|
33
|
+
children: y ?? "No results"
|
|
34
|
+
})]
|
|
44
35
|
});
|
|
45
36
|
});
|
|
46
|
-
|
|
37
|
+
A.displayName = "ResultCount";
|
|
47
38
|
export {
|
|
48
|
-
|
|
39
|
+
A as ResultCount
|
|
49
40
|
};
|
package/dist/sheet.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const
|
|
1
|
+
"use client";const K=require("./_virtual/_rolldown/runtime.cjs");let r=require("react");r=K.__toESM(r,1);let k=require("@brightlocal/icons"),u=require("@brightlocal/ui-components/lib/utils"),e=require("react/jsx-runtime"),ae=require("class-variance-authority"),se=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock"),R=require("@brightlocal/ui-components/button"),P=require("@brightlocal/ui-components/spinner"),n=require("@radix-ui/react-dialog");n=K.__toESM(n,1);let re=require("@brightlocal/ui-components/scroll-area");var oe=(0,ae.cva)(["bg-background","data-[state=open]:animate-in","data-[state=closed]:animate-out","fixed","z-50","flex","flex-col","gap-4","p-6","shadow-lg","ease-out","data-[state=closed]:ease-in","data-[state=open]:duration-slow","data-[state=closed]:duration-250"],{variants:{side:{top:["data-[state=closed]:slide-out-to-top","data-[state=open]:slide-in-from-top","inset-x-0","top-0","h-auto","border-b"],right:["data-[state=closed]:slide-out-to-right","data-[state=open]:slide-in-from-right","inset-y-0","right-0","h-full","border-l"],bottom:["data-[state=closed]:slide-out-to-bottom","data-[state=open]:slide-in-from-bottom","inset-x-0","bottom-0","h-auto","border-t"],left:["data-[state=closed]:slide-out-to-left","data-[state=open]:slide-in-from-left","inset-y-0","left-0","h-full","border-r"]},size:{default:[],sm:[],lg:[],xl:[]}},compoundVariants:[{side:["left","right"],size:"default",className:["w-3/4","sm:max-w-sm"]},{side:["left","right"],size:"sm",className:["w-fit","min-w-(--ds-container-2xs)","max-w-(--ds-container-xs)"]},{side:["left","right"],size:"lg",className:["w-3/4","sm:max-w-lg"]},{side:["left","right"],size:"xl",className:["w-full","sm:w-120","xl:w-160"]}],defaultVariants:{side:"right",size:"default"}});function O({...t}){return(0,e.jsx)(n.Root,{"data-slot":"sheet",modal:!0,...t})}O.displayName="Sheet";var A=r.forwardRef(({dataHook:t,...a},o)=>(0,e.jsx)(n.Trigger,{ref:o,"data-slot":"sheet-trigger",...t!=null&&{"data-hook":t},...a}));A.displayName="SheetTrigger";var L=r.forwardRef(({...t},a)=>(0,e.jsx)(n.Close,{ref:a,"data-slot":"sheet-close",...t}));L.displayName="SheetClose";function C({...t}){return(0,e.jsx)(n.Portal,{"data-slot":"sheet-portal",...t})}C.displayName="SheetPortal";var q=r.forwardRef(({className:t,...a},o)=>(0,e.jsx)(n.Overlay,{ref:o,className:(0,u.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),"data-slot":"sheet-overlay",...a}));q.displayName="SheetOverlay";var E=r.forwardRef(({className:t,children:a,side:o,size:l,dataHook:i,trackingEl:m,trackingLabel:_,closeLabel:p,...d},b)=>((0,se.useOverlayPointerLock)(),(0,e.jsxs)(C,{children:[(0,e.jsx)(q,{}),(0,e.jsxs)(n.Content,{ref:b,className:(0,u.cn)(oe({side:o,size:l}),t),"data-hook":i,"data-slot":"sheet-content","data-tracking-el":m,"data-tracking-label":_,...d,children:[a,(0,e.jsx)(n.Close,{asChild:!0,children:(0,e.jsxs)(R.Button,{iconOnly:!0,className:"absolute top-6 right-4",dataHook:"sheet-close",variant:"ghost",children:[(0,e.jsx)(k.X,{}),(0,e.jsx)("span",{className:"sr-only",children:p??"Close"})]})})]})]})));E.displayName="SheetContent";var H=r.forwardRef(({className:t,...a},o)=>(0,e.jsx)("div",{ref:o,className:(0,u.cn)("flex flex-col gap-2 text-center sm:text-left",t),"data-slot":"sheet-header",...a}));H.displayName="SheetHeader";var F=r.forwardRef(({className:t,onPrevious:a,onNext:o,current:l,total:i,hasPrevious:m,hasNext:_,renderPosition:p,loading:d=!1,loadingLabel:b,ariaLabel:X,prevAriaLabel:G,nextAriaLabel:J,dataHook:x,trackingEl:Q,trackingLabel:W,...Y},Z)=>{const h=m??(l==null||l>1),f=_??(l==null||i==null||l<i),y=r.useRef(null),v=r.useRef(null),g=r.useRef(null),[T,w]=r.useState(null),N=`${d}|${l}|${i}|${h}|${f}`,[ee,te]=r.useState(N);N!==ee&&(te(N),d||w(null)),r.useEffect(()=>{if(d)return;const s=g.current;if(g.current=null,!s)return;const c=document.activeElement;c!==s&&c!==document.body||(!h&&s===y.current&&f?v.current?.focus():!f&&s===v.current&&h&&y.current?.focus())},[d,l,i,h,f]);const B=s=>{const c=s.relatedTarget;c&&c!==y.current&&c!==v.current&&(g.current=null)},S=(s,c)=>{if(!d)if(s==="previous"){if(!h)return;g.current=c,w("previous"),a()}else{if(!f)return;g.current=c,w("next"),o()}},D=d&&T==="previous",$=d&&T==="next",z=s=>{s.key==="ArrowUp"||s.key==="ArrowLeft"?(s.preventDefault(),S("previous",s.currentTarget)):(s.key==="ArrowDown"||s.key==="ArrowRight")&&(s.preventDefault(),S("next",s.currentTarget))};let j=null;return p!==null&&l!=null&&i!=null&&(j=p?p({current:l,total:i}):`${l} of ${i}`),(0,e.jsxs)("div",{ref:Z,"aria-label":X??"Item navigation",className:(0,u.cn)("relative mb-2 flex items-center gap-1",t),"data-hook":x,"data-slot":"sheet-pagination","data-tracking-el":Q,"data-tracking-label":W,role:"group",...Y,children:[(0,e.jsx)(R.Button,{ref:y,"aria-busy":D?"true":void 0,ariaLabel:G??"Previous item",dataHook:`${x}-previous`,disabled:!h,variant:"ghost",onBlur:B,onClick:s=>S("previous",s.currentTarget),onKeyDown:z,children:D?(0,e.jsx)(P.Spinner,{dataHook:`${x}-previous-loading`}):(0,e.jsx)(k.ChevronUp,{})}),(0,e.jsx)(R.Button,{ref:v,"aria-busy":$?"true":void 0,ariaLabel:J??"Next item",dataHook:`${x}-next`,disabled:!f,variant:"ghost",onBlur:B,onClick:s=>S("next",s.currentTarget),onKeyDown:z,children:$?(0,e.jsx)(P.Spinner,{dataHook:`${x}-next-loading`}):(0,e.jsx)(k.ChevronDown,{})}),j!=null&&(0,e.jsx)("span",{"aria-live":"polite",className:"text-body-sm text-muted-foreground","data-slot":"sheet-pagination-position",children:j}),(0,e.jsx)("span",{className:"sr-only","data-slot":"sheet-pagination-status",role:"status",children:d?b??"Loading item":null})]})});F.displayName="SheetPagination";var V=r.forwardRef(({className:t,children:a,dataHook:o,...l},i)=>(0,e.jsx)(re.ScrollArea,{ref:i,className:(0,u.cn)("-mx-6 min-h-0 flex-1",t),"data-slot":"sheet-body",dataHook:o??"sheet-body",...l,children:(0,e.jsx)("div",{className:"px-5","data-slot":"sheet-body-content",children:a})}));V.displayName="SheetBody";var M=r.forwardRef(({className:t,...a},o)=>(0,e.jsx)("div",{ref:o,className:(0,u.cn)("mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",t),"data-slot":"sheet-footer",...a}));M.displayName="SheetFooter";var U=r.forwardRef(({className:t,icon:a,children:o,dataHook:l,...i},m)=>(0,e.jsxs)(n.Title,{ref:m,className:(0,u.cn)("text-foreground text-heading-section",a&&"flex items-center gap-2",t),"data-hook":l,"data-slot":"sheet-title",...i,children:[a&&(0,e.jsx)("span",{className:"shrink-0 [&_svg]:size-5","data-slot":"sheet-title-icon",children:a}),o]}));U.displayName="SheetTitle";var I=r.forwardRef(({className:t,dataHook:a,...o},l)=>(0,e.jsx)(n.Description,{ref:l,className:(0,u.cn)("text-body-sm text-muted-foreground",t),"data-hook":a,"data-slot":"sheet-description",...o}));I.displayName="SheetDescription";exports.Sheet=O;exports.SheetBody=V;exports.SheetClose=L;exports.SheetContent=E;exports.SheetDescription=I;exports.SheetFooter=M;exports.SheetHeader=H;exports.SheetOverlay=q;exports.SheetPagination=F;exports.SheetPortal=C;exports.SheetTitle=U;exports.SheetTrigger=A;
|
package/dist/sheet.d.ts
CHANGED
|
@@ -17,11 +17,13 @@ export type SheetSide = "top" | "right" | "bottom" | "left";
|
|
|
17
17
|
* partly visible behind it on phones (used by the Sidebar mobile nav)
|
|
18
18
|
* - lg: Panel fills 75% of the viewport up to 512px — detail panels with
|
|
19
19
|
* dense content (date pickers, thumbnail rows)
|
|
20
|
+
* - xl: Full width on phones, 480px from the `sm` breakpoint and 640px from
|
|
21
|
+
* `xl` — edit forms with a table or a row of selects (DS-1245)
|
|
20
22
|
*/
|
|
21
|
-
export type SheetSize = "default" | "sm" | "lg";
|
|
23
|
+
export type SheetSize = "default" | "sm" | "lg" | "xl";
|
|
22
24
|
declare const sheetContentVariants: (props?: ({
|
|
23
25
|
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
24
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
26
|
+
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
25
27
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
26
28
|
/**
|
|
27
29
|
* Sheet root component that provides context for the sheet dialog.
|
|
@@ -75,7 +77,8 @@ interface SheetContentProps extends React.ComponentProps<typeof SheetPrimitive.C
|
|
|
75
77
|
/**
|
|
76
78
|
* Width preset for side panels. `sm` hugs the content between 288 and
|
|
77
79
|
* 320px; `default` keeps the classic 75%-up-to-384px drawer width; `lg`
|
|
78
|
-
* widens to 75%-up-to-512px for dense detail panels
|
|
80
|
+
* widens to 75%-up-to-512px for dense detail panels; `xl` is the form
|
|
81
|
+
* width — full width on phones, 480px from `sm`, 640px from `xl`.
|
|
79
82
|
* Ignored for top/bottom sheets.
|
|
80
83
|
* @default "default"
|
|
81
84
|
*/
|
|
@@ -148,6 +151,22 @@ interface SheetPaginationProps extends Omit<React.ComponentProps<"div">, "childr
|
|
|
148
151
|
* @default Renders "{current} of {total}", or nothing when either is unset.
|
|
149
152
|
*/
|
|
150
153
|
renderPosition?: ((info: SheetPaginationPositionInfo) => React.ReactNode) | null;
|
|
154
|
+
/**
|
|
155
|
+
* Marks the step the user just requested as in flight — e.g. the next item
|
|
156
|
+
* sits on a page that is still being fetched. The button that requested
|
|
157
|
+
* the step (by click or arrow key) swaps its chevron for a spinner and sets
|
|
158
|
+
* `aria-busy`; both buttons ignore clicks and arrow keys until the flag
|
|
159
|
+
* clears, without a disabled look, so focus stays where it is. Screen
|
|
160
|
+
* readers hear `loadingLabel`. Keep `hasPrevious` / `hasNext` describing
|
|
161
|
+
* the list, not the fetch.
|
|
162
|
+
* @default false
|
|
163
|
+
*/
|
|
164
|
+
loading?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Text announced to screen readers while `loading` is true.
|
|
167
|
+
* @default "Loading item"
|
|
168
|
+
*/
|
|
169
|
+
loadingLabel?: string;
|
|
151
170
|
/**
|
|
152
171
|
* Accessible label for the item navigation group.
|
|
153
172
|
* @default "Item navigation"
|
package/dist/sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAIpE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D;;;;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