@blakesteve/roster 5.7.0 → 5.9.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/README.md +169 -5
- package/dist/components/atoms/Avatar/Avatar.cjs +1 -1
- package/dist/components/atoms/Avatar/Avatar.d.ts +4 -0
- package/dist/components/atoms/Avatar/Avatar.js +1 -1
- package/dist/components/atoms/AvatarStrip/AvatarStrip.cjs +1 -1
- package/dist/components/atoms/AvatarStrip/AvatarStrip.d.ts +10 -1
- package/dist/components/atoms/AvatarStrip/AvatarStrip.js +34 -30
- package/dist/components/atoms/Button/button-variants.cjs +1 -1
- package/dist/components/atoms/Button/button-variants.js +5 -3
- package/dist/components/atoms/Eyebrow/eyebrow-variants.cjs +1 -1
- package/dist/components/atoms/Eyebrow/eyebrow-variants.js +8 -4
- package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/atoms/MultiSelect/MultiSelect.d.ts +3 -1
- package/dist/components/atoms/MultiSelect/MultiSelect.js +87 -89
- package/dist/components/atoms/Progress/Progress.cjs +1 -1
- package/dist/components/atoms/Progress/Progress.d.ts +1 -0
- package/dist/components/atoms/Progress/Progress.js +28 -27
- package/dist/components/atoms/Stat/Stat.cjs +1 -1
- package/dist/components/atoms/Stat/Stat.js +5 -5
- package/dist/components/atoms/Stat/stat-variants.cjs +1 -1
- package/dist/components/atoms/Stat/stat-variants.js +10 -8
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +10 -1
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +31 -29
- package/dist/components/molecules/CallToAction/CallToAction.cjs +1 -1
- package/dist/components/molecules/CallToAction/CallToAction.d.ts +8 -1
- package/dist/components/molecules/CallToAction/CallToAction.js +34 -29
- package/dist/components/molecules/Carousel/Carousel.cjs +1 -1
- package/dist/components/molecules/Carousel/Carousel.d.ts +7 -0
- package/dist/components/molecules/Carousel/Carousel.js +155 -155
- package/dist/components/molecules/ErrorState/ErrorState.cjs +1 -1
- package/dist/components/molecules/ErrorState/ErrorState.d.ts +8 -1
- package/dist/components/molecules/ErrorState/ErrorState.js +44 -39
- package/dist/components/molecules/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/molecules/FileUpload/FileUpload.js +23 -22
- package/dist/components/molecules/MediaPreview/MediaPreview.cjs +1 -1
- package/dist/components/molecules/MediaPreview/MediaPreview.d.ts +3 -1
- package/dist/components/molecules/MediaPreview/MediaPreview.js +13 -12
- package/dist/components/molecules/Menu/Menu.cjs +1 -0
- package/dist/components/molecules/Menu/Menu.d.ts +169 -0
- package/dist/components/molecules/Menu/Menu.js +577 -0
- package/dist/components/molecules/Menu/menu-typeahead.cjs +1 -0
- package/dist/components/molecules/Menu/menu-typeahead.d.ts +7 -0
- package/dist/components/molecules/Menu/menu-typeahead.js +13 -0
- package/dist/components/molecules/Pagination/Pagination.cjs +1 -1
- package/dist/components/molecules/Pagination/Pagination.d.ts +1 -0
- package/dist/components/molecules/Pagination/Pagination.js +47 -46
- package/dist/components/molecules/ProgressField/ProgressField.d.ts +1 -0
- package/dist/components/molecules/SkeletonPresets/SkeletonPresets.cjs +1 -1
- package/dist/components/molecules/SkeletonPresets/SkeletonPresets.d.ts +2 -2
- package/dist/components/molecules/SkeletonPresets/SkeletonPresets.js +17 -17
- package/dist/components/molecules/StepProgress/StepProgress.cjs +1 -1
- package/dist/components/molecules/StepProgress/StepProgress.d.ts +1 -0
- package/dist/components/molecules/StepProgress/StepProgress.js +9 -8
- package/dist/components/organisms/Countdown/Countdown.cjs +1 -1
- package/dist/components/organisms/Countdown/Countdown.d.ts +13 -0
- package/dist/components/organisms/Countdown/Countdown.js +54 -47
- package/dist/components/organisms/DataTable/DataTable.cjs +1 -1
- package/dist/components/organisms/DataTable/DataTable.d.ts +5 -3
- package/dist/components/organisms/DataTable/DataTable.js +27 -26
- package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
- package/dist/components/organisms/Dialog/Dialog.d.ts +8 -1
- package/dist/components/organisms/Dialog/Dialog.js +25 -23
- package/dist/components/organisms/Footer/Footer.cjs +1 -1
- package/dist/components/organisms/Footer/Footer.d.ts +9 -0
- package/dist/components/organisms/Footer/Footer.js +21 -23
- package/dist/components/organisms/ModerationQueue/ModerationQueue.cjs +1 -1
- package/dist/components/organisms/ModerationQueue/ModerationQueue.d.ts +40 -1
- package/dist/components/organisms/ModerationQueue/ModerationQueue.js +262 -237
- package/dist/components/organisms/ModerationQueue/QueueEditDialog.cjs +1 -1
- package/dist/components/organisms/ModerationQueue/QueueEditDialog.d.ts +1 -1
- package/dist/components/organisms/ModerationQueue/QueueEditDialog.js +23 -21
- package/dist/components/organisms/ModerationQueue/QueueEditSheet.cjs +1 -1
- package/dist/components/organisms/ModerationQueue/QueueEditSheet.d.ts +1 -1
- package/dist/components/organisms/ModerationQueue/QueueEditSheet.js +22 -20
- package/dist/components/organisms/ModerationQueue/queue-actions.d.ts +29 -10
- package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
- package/dist/components/organisms/Navbar/Navbar.d.ts +39 -4
- package/dist/components/organisms/Navbar/Navbar.js +297 -301
- package/dist/components/organisms/Navbar/navbar-variants.cjs +1 -1
- package/dist/components/organisms/Navbar/navbar-variants.js +4 -2
- package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
- package/dist/components/organisms/Sheet/Sheet.d.ts +8 -1
- package/dist/components/organisms/Sheet/Sheet.js +65 -63
- package/dist/index.d.ts +1 -0
- package/dist/lib/labels.cjs +1 -0
- package/dist/lib/labels.d.ts +7 -0
- package/dist/lib/labels.js +12 -0
- package/dist/meta.json +3 -3
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +7 -7
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +2 -2
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +5 -5
- package/dist/node_modules/@headlessui/react/dist/components/portal/portal.js +6 -6
- package/dist/node_modules/@headlessui/react/dist/utils/focus-management.cjs +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +52 -61
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +6 -6
- package/dist/roster.cjs +1 -1
- package/dist/roster.css +1 -1
- package/dist/roster.js +127 -116
- package/package.json +2 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.cjs +0 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +0 -21
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.cjs +0 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +0 -120
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu.cjs +0 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu.js +0 -197
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { ColumnDef, RowData } from '@tanstack/react-table';
|
|
2
3
|
import { PaginationLabels } from '../../molecules/Pagination/Pagination';
|
|
3
4
|
import { TableProps } from '../Table/Table';
|
|
@@ -46,10 +47,11 @@ export interface DataTableProps<TData extends RowData> {
|
|
|
46
47
|
hoverable?: boolean;
|
|
47
48
|
/**
|
|
48
49
|
* Replaces the pager's words; see Pagination's `labels`. `status` also
|
|
49
|
-
* replaces the "Page N of M" line beside it.
|
|
50
|
-
* DataTable's own and isn't covered.)
|
|
50
|
+
* replaces the "Page N of M" line beside it.
|
|
51
51
|
*/
|
|
52
52
|
paginationLabels?: Partial<PaginationLabels>;
|
|
53
|
+
/** What an empty table says. "No results found." by default. */
|
|
54
|
+
emptyMessage?: ReactNode;
|
|
53
55
|
}
|
|
54
|
-
export declare function DataTable<TData extends RowData>({ columns, data, className, tableClassName, paginationClassName, variant, size, hoverable, paginationLabels, }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare function DataTable<TData extends RowData>({ columns, data, className, tableClassName, paginationClassName, variant, size, hoverable, paginationLabels, emptyMessage, }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
55
57
|
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as s, jsx as t, Fragment as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useTable as
|
|
2
|
+
import { jsxs as s, jsx as t, Fragment as b } from "react/jsx-runtime";
|
|
3
|
+
import { useState as N } from "react";
|
|
4
|
+
import { useTable as P, flexRender as c, tableFeatures as T, sortFns as I, rowPaginationFeature as R, rowSortingFeature as F, createPaginatedRowModel as v, createSortedRowModel as M } from "@tanstack/react-table";
|
|
5
5
|
import { FontAwesomeIcon as g } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
6
|
-
import { faCaretUp as
|
|
6
|
+
import { faCaretUp as k, faCaretDown as j } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
7
7
|
import { cn as o } from "../../../lib/utils.js";
|
|
8
|
-
import { Pagination as
|
|
9
|
-
import { Table as
|
|
10
|
-
const
|
|
11
|
-
rowSortingFeature:
|
|
12
|
-
rowPaginationFeature:
|
|
13
|
-
sortedRowModel:
|
|
14
|
-
paginatedRowModel:
|
|
8
|
+
import { Pagination as D } from "../../molecules/Pagination/Pagination.js";
|
|
9
|
+
import { Table as H, TableHeader as A, TableRow as l, TableHead as z, TableBody as B, TableCell as d } from "../Table/Table.js";
|
|
10
|
+
const U = /* @__PURE__ */ T({
|
|
11
|
+
rowSortingFeature: F,
|
|
12
|
+
rowPaginationFeature: R,
|
|
13
|
+
sortedRowModel: M(),
|
|
14
|
+
paginatedRowModel: v(),
|
|
15
15
|
// The whole built-in registry, not a subset: DataTable is generic over
|
|
16
16
|
// consumer data, so auto sort detection has to be able to reach any of them.
|
|
17
|
-
sortFns:
|
|
17
|
+
sortFns: I
|
|
18
18
|
});
|
|
19
|
-
function
|
|
19
|
+
function W({
|
|
20
20
|
columns: i,
|
|
21
21
|
data: m,
|
|
22
22
|
className: u,
|
|
@@ -25,15 +25,16 @@ function V({
|
|
|
25
25
|
variant: x = "default",
|
|
26
26
|
size: h = "md",
|
|
27
27
|
hoverable: w = !1,
|
|
28
|
-
paginationLabels: n
|
|
28
|
+
paginationLabels: n,
|
|
29
|
+
emptyMessage: y = "No results found."
|
|
29
30
|
}) {
|
|
30
|
-
const [
|
|
31
|
-
features:
|
|
31
|
+
const [C, S] = N([]), r = P({
|
|
32
|
+
features: U,
|
|
32
33
|
data: m,
|
|
33
34
|
columns: i,
|
|
34
|
-
onSortingChange:
|
|
35
|
+
onSortingChange: S,
|
|
35
36
|
state: {
|
|
36
|
-
sorting:
|
|
37
|
+
sorting: C
|
|
37
38
|
},
|
|
38
39
|
initialState: {
|
|
39
40
|
pagination: {
|
|
@@ -44,14 +45,14 @@ function V({
|
|
|
44
45
|
});
|
|
45
46
|
return /* @__PURE__ */ s("div", { className: o("rst:font-ui rst:flex rst:flex-col rst:gap-4", u), children: [
|
|
46
47
|
/* @__PURE__ */ s(
|
|
47
|
-
|
|
48
|
+
H,
|
|
48
49
|
{
|
|
49
50
|
variant: x,
|
|
50
51
|
size: h,
|
|
51
52
|
hoverable: w,
|
|
52
53
|
className: p,
|
|
53
54
|
children: [
|
|
54
|
-
/* @__PURE__ */ t(
|
|
55
|
+
/* @__PURE__ */ t(A, { children: r.getHeaderGroups().map((a) => /* @__PURE__ */ t(l, { children: a.headers.map((e) => /* @__PURE__ */ t(z, { children: e.isPlaceholder ? null : /* @__PURE__ */ s(
|
|
55
56
|
"div",
|
|
56
57
|
{
|
|
57
58
|
className: o(
|
|
@@ -64,11 +65,11 @@ function V({
|
|
|
64
65
|
e.column.columnDef.header,
|
|
65
66
|
e.getContext()
|
|
66
67
|
),
|
|
67
|
-
e.column.getCanSort() && /* @__PURE__ */ t("span", { className: "rst:w-4 rst:flex rst:justify-center rst:text-primary-500", children: e.column.getIsSorted() === "asc" ? /* @__PURE__ */ t(g, { icon:
|
|
68
|
+
e.column.getCanSort() && /* @__PURE__ */ t("span", { className: "rst:w-4 rst:flex rst:justify-center rst:text-primary-500", children: e.column.getIsSorted() === "asc" ? /* @__PURE__ */ t(g, { icon: k }) : e.column.getIsSorted() === "desc" ? /* @__PURE__ */ t(g, { icon: j }) : null })
|
|
68
69
|
]
|
|
69
70
|
}
|
|
70
71
|
) }, e.id)) }, a.id)) }),
|
|
71
|
-
/* @__PURE__ */ t(
|
|
72
|
+
/* @__PURE__ */ t(B, { children: r.getRowModel().rows?.length ? (
|
|
72
73
|
// No data-state on the row: row selection is not one of the
|
|
73
74
|
// registered features, and v8's getIsSelected() was always false
|
|
74
75
|
// here, so React omitted the attribute anyway.
|
|
@@ -78,7 +79,7 @@ function V({
|
|
|
78
79
|
{
|
|
79
80
|
colSpan: i.length,
|
|
80
81
|
className: "rst:h-24 rst:text-center rst:text-gray-500 rst:dark:text-gray-400 rst:italic",
|
|
81
|
-
children:
|
|
82
|
+
children: y
|
|
82
83
|
}
|
|
83
84
|
) }) })
|
|
84
85
|
]
|
|
@@ -92,7 +93,7 @@ function V({
|
|
|
92
93
|
f
|
|
93
94
|
),
|
|
94
95
|
children: [
|
|
95
|
-
/* @__PURE__ */ t("div", { className: "rst:text-sm rst:font-medium rst:text-gray-500 rst:dark:text-gray-400", children: n?.status ? n.status(r.state.pagination.pageIndex + 1, r.getPageCount()) : /* @__PURE__ */ s(
|
|
96
|
+
/* @__PURE__ */ t("div", { className: "rst:text-sm rst:font-medium rst:text-gray-500 rst:dark:text-gray-400", children: n?.status ? n.status(r.state.pagination.pageIndex + 1, r.getPageCount()) : /* @__PURE__ */ s(b, { children: [
|
|
96
97
|
"Page",
|
|
97
98
|
" ",
|
|
98
99
|
/* @__PURE__ */ t("strong", { className: "rst:text-gray-900 rst:dark:text-gray-100", children: r.state.pagination.pageIndex + 1 }),
|
|
@@ -102,7 +103,7 @@ function V({
|
|
|
102
103
|
/* @__PURE__ */ t("strong", { className: "rst:text-gray-900 rst:dark:text-gray-100", children: r.getPageCount() })
|
|
103
104
|
] }) }),
|
|
104
105
|
/* @__PURE__ */ t(
|
|
105
|
-
|
|
106
|
+
D,
|
|
106
107
|
{
|
|
107
108
|
layout: "arrows",
|
|
108
109
|
align: "end",
|
|
@@ -119,5 +120,5 @@ function V({
|
|
|
119
120
|
] });
|
|
120
121
|
}
|
|
121
122
|
export {
|
|
122
|
-
|
|
123
|
+
W as DataTable
|
|
123
124
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),j=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),w=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),o=require("../../../node_modules/class-variance-authority/dist/index.cjs"),s=require("../../../lib/utils.cjs"),N=require("../../../lib/labels.cjs"),_=require("../../../internal/page-inert.cjs"),a=require("../../../node_modules/@headlessui/react/dist/components/dialog/dialog.cjs"),d=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),q=o.cva("rst:relative rst:w-full rst:transform rst:overflow-hidden rst:rounded-2xl rst:p-6 rst:text-left rst:align-middle rst:elevation-overlay rst:transition-all rst:border",{variants:{size:{xs:"rst:max-w-xs",sm:"rst:max-w-sm",md:"rst:max-w-md",lg:"rst:max-w-lg",xl:"rst:max-w-xl","2xl":"rst:max-w-2xl","3xl":"rst:max-w-3xl",full:"rst:max-w-[95vw] rst:m-4"},variant:{white:"rst:bg-[var(--roster-popover-bg)] rst:border-[var(--roster-popover-border)] rst:text-[var(--roster-popover-text)]",slate:"rst:bg-gray-700 rst:border-gray-600 rst:text-gray-100 rst:dark:bg-gray-900 rst:dark:border-gray-800 rst:[--roster-ring:var(--roster-primary-400,#5ea3de)] rst:[--roster-ring-offset:var(--roster-gray-700,#44403c)] rst:dark:[--roster-ring-offset:var(--roster-gray-900,#1c1917)] rst:[--roster-control-text:var(--roster-gray-100,#f5f5f4)] rst:[--roster-control-border:var(--roster-gray-400,#a8a29e)] rst:[--roster-control-border-focus:var(--roster-primary-400,#5ea3de)]",primary:"rst:bg-primary-700 rst:border-primary-600 rst:text-primary-700-ink rst:dark:text-white rst:dark:bg-primary-950 rst:dark:border-primary-900 rst:[--roster-ring:var(--roster-primary-400,#5ea3de)] rst:[--roster-ring-offset:var(--roster-primary-700,#084063)] rst:dark:[--roster-ring-offset:var(--roster-primary-950,#021724)] rst:[--roster-control-text:var(--roster-gray-100,#f5f5f4)] rst:[--roster-control-border:var(--roster-gray-400,#a8a29e)] rst:[--roster-control-border-focus:var(--roster-primary-400,#5ea3de)]",glass:"rst:bg-white/80 rst:border-white/20 rst:backdrop-blur-xl rst:text-gray-900 rst:dark:bg-slate-900/80 rst:dark:border-slate-700/50 rst:dark:text-white"},status:{default:"",destructive:"rst:border-t-4 rst:border-t-error-500",success:"rst:border-t-4 rst:border-t-success-500"}},defaultVariants:{size:"md",variant:"white",status:"default"}}),F=o.cva("rst:text-xl rst:font-bold rst:leading-6 rst:text-inherit"),T=o.cva("rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75"),D=o.cva("rst:inline-flex rst:size-11 rst:shrink-0 rst:items-center rst:justify-center rst:-m-3 rst:cursor-pointer rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-50 rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:transition-opacity"),L={close:"Close dialog"},V=({isOpen:u,onClose:i,title:m,description:n,size:x,variant:l,status:b,children:g,className:f,onAfterClose:v,labels:p})=>{const y=N.withLabels(L,p),[h,k]=t.useState(!1);t.useLayoutEffect(()=>{k(!0)},[]);const e=u&&h,c=t.useRef(null);return t.useLayoutEffect(()=>{if(e)return _.lockPage(c.current)},[e]),r.jsxs(r.Fragment,{children:[e&&r.jsx("span",{ref:c,hidden:!0}),r.jsxs(a.Dialog,{open:e,as:"div",className:"rst:font-ui rst:relative rst:z-50",onClose:i,children:[r.jsx(d.TransitionChild,{as:t.Fragment,enter:"rst:ease-out rst:duration-300",enterFrom:"rst:opacity-0",enterTo:"rst:opacity-100",leave:"rst:ease-in rst:duration-200",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",children:r.jsx(a.DialogBackdrop,{className:s.cn("rst:fixed rst:inset-0 rst:transition-opacity",l==="glass"?"rst:bg-[var(--roster-backdrop,color-mix(in_oklab,oklch(20.8%_0.042_265.755)_40%,transparent))] rst:dark:bg-[var(--roster-backdrop,color-mix(in_oklab,var(--roster-black,#1e1c1a)_60%,transparent))]":"rst:bg-[var(--roster-backdrop,color-mix(in_oklab,oklch(20.8%_0.042_265.755)_60%,transparent))] rst:dark:bg-[var(--roster-backdrop,color-mix(in_oklab,var(--roster-black,#1e1c1a)_80%,transparent))] rst:backdrop-blur-backdrop")})}),r.jsx("div",{className:"rst:fixed rst:inset-0 rst:overflow-y-auto",children:r.jsx("div",{className:"rst:flex rst:min-h-full rst:items-center rst:justify-center rst:p-4 rst:text-center",children:r.jsx(d.TransitionChild,{as:t.Fragment,enter:"rst:ease-out rst:duration-300",enterFrom:"rst:opacity-0 rst:scale-95",enterTo:"rst:opacity-100 rst:scale-100",leave:"rst:ease-in rst:duration-200",leaveFrom:"rst:opacity-100 rst:scale-100",leaveTo:"rst:opacity-0 rst:scale-95",afterLeave:v,children:r.jsxs(a.DialogPanel,{className:s.cn(q({size:x,variant:l,status:b}),f),children:[r.jsxs("div",{className:"rst:flex rst:items-start rst:justify-between",children:[r.jsxs("div",{children:[r.jsx(a.DialogTitle,{as:"h2",className:s.cn(F()),children:m}),n&&r.jsx("p",{className:s.cn(T()),children:n})]}),r.jsx("div",{className:"rst:ml-4 rst:flex rst:shrink-0",children:r.jsx("button",{type:"button",onClick:i,className:s.cn(D()),"aria-label":y.close,children:r.jsx(j.FontAwesomeIcon,{icon:w.faXmark,className:"rst:h-5 rst:w-5"})})})]}),r.jsx("div",{className:"rst:mt-6",children:g})]})})})})]})]})};exports.Dialog=V;
|
|
@@ -5,6 +5,11 @@ declare const dialogVariants: (props?: ({
|
|
|
5
5
|
variant?: "primary" | "white" | "slate" | "glass" | null | undefined;
|
|
6
6
|
status?: "success" | "default" | "destructive" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
/** Every word Dialog says of its own. Pass any of them in `labels` to replace it. */
|
|
9
|
+
export interface DialogLabels {
|
|
10
|
+
/** The close button's name. */
|
|
11
|
+
close: string;
|
|
12
|
+
}
|
|
8
13
|
export interface DialogProps extends VariantProps<typeof dialogVariants> {
|
|
9
14
|
isOpen: boolean;
|
|
10
15
|
onClose: () => void;
|
|
@@ -20,6 +25,8 @@ export interface DialogProps extends VariantProps<typeof dialogVariants> {
|
|
|
20
25
|
* while open.
|
|
21
26
|
*/
|
|
22
27
|
onAfterClose?: () => void;
|
|
28
|
+
/** The component's own words, replaced; any left out stay English. */
|
|
29
|
+
labels?: Partial<DialogLabels>;
|
|
23
30
|
}
|
|
24
|
-
declare const Dialog: ({ isOpen, onClose, title, description, size, variant, status, children, className, onAfterClose, }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare const Dialog: ({ isOpen, onClose, title, description, size, variant, status, children, className, onAfterClose, labels, }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
32
|
export { Dialog };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as t, Fragment as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { FontAwesomeIcon as
|
|
5
|
-
import { faXmark as
|
|
2
|
+
import { jsxs as t, Fragment as N, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useState as _, useLayoutEffect as c, useRef as F, Fragment as d } from "react";
|
|
4
|
+
import { FontAwesomeIcon as L } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
5
|
+
import { faXmark as T } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
6
6
|
import { cva as a } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
7
7
|
import { cn as s } from "../../../lib/utils.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { withLabels as j } from "../../../lib/labels.js";
|
|
9
|
+
import { lockPage as z } from "../../../internal/page-inert.js";
|
|
10
|
+
import { Dialog as D, DialogBackdrop as V, DialogPanel as A, DialogTitle as B } from "../../../node_modules/@headlessui/react/dist/components/dialog/dialog.js";
|
|
10
11
|
import { TransitionChild as m } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
|
|
11
|
-
const
|
|
12
|
+
const C = /* @__PURE__ */ a(
|
|
12
13
|
"rst:relative rst:w-full rst:transform rst:overflow-hidden rst:rounded-2xl rst:p-6 rst:text-left rst:align-middle rst:elevation-overlay rst:transition-all rst:border",
|
|
13
14
|
{
|
|
14
15
|
variants: {
|
|
@@ -77,9 +78,9 @@ const L = /* @__PURE__ */ a(
|
|
|
77
78
|
status: "default"
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
),
|
|
81
|
+
), E = /* @__PURE__ */ a("rst:text-xl rst:font-bold rst:leading-6 rst:text-inherit"), P = /* @__PURE__ */ a("rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75"), R = /* @__PURE__ */ a(
|
|
81
82
|
"rst:inline-flex rst:size-11 rst:shrink-0 rst:items-center rst:justify-center rst:-m-3 rst:cursor-pointer rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-50 rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:transition-opacity"
|
|
82
|
-
),
|
|
83
|
+
), S = { close: "Close dialog" }, K = ({
|
|
83
84
|
isOpen: f,
|
|
84
85
|
onClose: o,
|
|
85
86
|
title: p,
|
|
@@ -89,20 +90,21 @@ const L = /* @__PURE__ */ a(
|
|
|
89
90
|
status: g,
|
|
90
91
|
children: v,
|
|
91
92
|
className: u,
|
|
92
|
-
onAfterClose: x
|
|
93
|
+
onAfterClose: x,
|
|
94
|
+
labels: y
|
|
93
95
|
}) => {
|
|
94
|
-
const
|
|
96
|
+
const h = j(S, y), [k, w] = _(!1);
|
|
95
97
|
c(() => {
|
|
96
|
-
|
|
98
|
+
w(!0);
|
|
97
99
|
}, []);
|
|
98
|
-
const e = f &&
|
|
100
|
+
const e = f && k, l = F(null);
|
|
99
101
|
return c(() => {
|
|
100
102
|
if (e)
|
|
101
|
-
return
|
|
102
|
-
}, [e]), /* @__PURE__ */ t(
|
|
103
|
+
return z(l.current);
|
|
104
|
+
}, [e]), /* @__PURE__ */ t(N, { children: [
|
|
103
105
|
e && /* @__PURE__ */ r("span", { ref: l, hidden: !0 }),
|
|
104
106
|
/* @__PURE__ */ t(
|
|
105
|
-
|
|
107
|
+
D,
|
|
106
108
|
{
|
|
107
109
|
open: e,
|
|
108
110
|
as: "div",
|
|
@@ -120,7 +122,7 @@ const L = /* @__PURE__ */ a(
|
|
|
120
122
|
leaveFrom: "rst:opacity-100",
|
|
121
123
|
leaveTo: "rst:opacity-0",
|
|
122
124
|
children: /* @__PURE__ */ r(
|
|
123
|
-
|
|
125
|
+
V,
|
|
124
126
|
{
|
|
125
127
|
className: s(
|
|
126
128
|
"rst:fixed rst:inset-0 rst:transition-opacity",
|
|
@@ -142,16 +144,16 @@ const L = /* @__PURE__ */ a(
|
|
|
142
144
|
leaveTo: "rst:opacity-0 rst:scale-95",
|
|
143
145
|
afterLeave: x,
|
|
144
146
|
children: /* @__PURE__ */ t(
|
|
145
|
-
|
|
147
|
+
A,
|
|
146
148
|
{
|
|
147
149
|
className: s(
|
|
148
|
-
|
|
150
|
+
C({ size: b, variant: n, status: g }),
|
|
149
151
|
u
|
|
150
152
|
),
|
|
151
153
|
children: [
|
|
152
154
|
/* @__PURE__ */ t("div", { className: "rst:flex rst:items-start rst:justify-between", children: [
|
|
153
155
|
/* @__PURE__ */ t("div", { children: [
|
|
154
|
-
/* @__PURE__ */ r(
|
|
156
|
+
/* @__PURE__ */ r(B, { as: "h2", className: s(E()), children: p }),
|
|
155
157
|
i && /* @__PURE__ */ r("p", { className: s(P()), children: i })
|
|
156
158
|
] }),
|
|
157
159
|
/* @__PURE__ */ r("div", { className: "rst:ml-4 rst:flex rst:shrink-0", children: /* @__PURE__ */ r(
|
|
@@ -160,8 +162,8 @@ const L = /* @__PURE__ */ a(
|
|
|
160
162
|
type: "button",
|
|
161
163
|
onClick: o,
|
|
162
164
|
className: s(R()),
|
|
163
|
-
"aria-label":
|
|
164
|
-
children: /* @__PURE__ */ r(
|
|
165
|
+
"aria-label": h.close,
|
|
166
|
+
children: /* @__PURE__ */ r(L, { icon: T, className: "rst:h-5 rst:w-5" })
|
|
165
167
|
}
|
|
166
168
|
) })
|
|
167
169
|
] }),
|
|
@@ -177,5 +179,5 @@ const L = /* @__PURE__ */ a(
|
|
|
177
179
|
] });
|
|
178
180
|
};
|
|
179
181
|
export {
|
|
180
|
-
|
|
182
|
+
K as Dialog
|
|
181
183
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("react"),p=require("../../../lib/utils.cjs"),d=require("../../../lib/labels.cjs"),g=require("./footer-variants.cjs"),y={nav:"Footer navigation",copyright:(r,s)=>`© ${r} ${s}, All rights reserved.`},i=m.forwardRef(({className:r,variant:s,companyName:n="Ball Collaborative",links:a,routerElement:c,labels:l,...x},h)=>{const u=new Date().getFullYear(),o=d.withLabels(y,l),f=c??"a";return t.jsx("footer",{ref:h,className:p.cn(g.footerVariants({variant:s}),r),...x,children:t.jsxs("div",{className:"rst:container rst:mx-auto rst:px-4 rst:flex rst:flex-col rst:items-center rst:gap-2",children:[a&&a.length>0&&t.jsx("nav",{"aria-label":o.nav,className:"rst:flex rst:flex-wrap rst:justify-center rst:gap-x-5 rst:gap-y-1",children:a.map(e=>t.jsx(f,{href:e.href,to:e.href,className:"rst:text-sm rst:text-inherit rst:opacity-70 rst:hover:opacity-100 rst:transition-opacity",children:e.label},e.href))}),t.jsx("p",{className:"rst:text-center rst:text-sm rst:font-medium rst:text-inherit",children:o.copyright(u,n)})]})})});i.displayName="Footer";exports.Footer=i;
|
|
@@ -5,6 +5,13 @@ export interface FooterLink {
|
|
|
5
5
|
label: string;
|
|
6
6
|
href: string;
|
|
7
7
|
}
|
|
8
|
+
/** Every word Footer shows or says of its own. Pass any of them in `labels` to replace it. */
|
|
9
|
+
export interface FooterLabels {
|
|
10
|
+
/** The link row's name. */
|
|
11
|
+
nav: string;
|
|
12
|
+
/** The copyright line. */
|
|
13
|
+
copyright: (year: number, companyName: string) => string;
|
|
14
|
+
}
|
|
8
15
|
export interface FooterProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof footerVariants> {
|
|
9
16
|
/**
|
|
10
17
|
* The company name to display in the copyright notice.
|
|
@@ -21,6 +28,8 @@ export interface FooterProps extends React.HTMLAttributes<HTMLElement>, VariantP
|
|
|
21
28
|
* footer link is rendered with this element instead of a plain `<a>` tag.
|
|
22
29
|
*/
|
|
23
30
|
routerElement?: React.ElementType;
|
|
31
|
+
/** The component's own words, replaced; any left out stay English. */
|
|
32
|
+
labels?: Partial<FooterLabels>;
|
|
24
33
|
}
|
|
25
34
|
declare const Footer: React.ForwardRefExoticComponent<FooterProps & React.RefAttributes<HTMLElement>>;
|
|
26
35
|
export { Footer };
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import x from "react";
|
|
4
|
+
import { cn as d } from "../../../lib/utils.js";
|
|
5
|
+
import { withLabels as g } from "../../../lib/labels.js";
|
|
6
|
+
import { footerVariants as u } from "./footer-variants.js";
|
|
7
|
+
const v = {
|
|
8
|
+
nav: "Footer navigation",
|
|
9
|
+
copyright: (e, s) => `© ${e} ${s}, All rights reserved.`
|
|
10
|
+
}, y = x.forwardRef(
|
|
11
|
+
({ className: e, variant: s, companyName: i = "Ball Collaborative", links: a, routerElement: c, labels: l, ...n }, m) => {
|
|
12
|
+
const f = (/* @__PURE__ */ new Date()).getFullYear(), o = g(v, l), p = c ?? "a";
|
|
13
|
+
return /* @__PURE__ */ r(
|
|
10
14
|
"footer",
|
|
11
15
|
{
|
|
12
|
-
ref:
|
|
13
|
-
className:
|
|
14
|
-
...
|
|
15
|
-
children: /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
ref: m,
|
|
17
|
+
className: d(u({ variant: s }), e),
|
|
18
|
+
...n,
|
|
19
|
+
children: /* @__PURE__ */ h("div", { className: "rst:container rst:mx-auto rst:px-4 rst:flex rst:flex-col rst:items-center rst:gap-2", children: [
|
|
20
|
+
a && a.length > 0 && /* @__PURE__ */ r("nav", { "aria-label": o.nav, className: "rst:flex rst:flex-wrap rst:justify-center rst:gap-x-5 rst:gap-y-1", children: a.map((t) => /* @__PURE__ */ r(
|
|
21
|
+
p,
|
|
18
22
|
{
|
|
19
23
|
href: t.href,
|
|
20
24
|
to: t.href,
|
|
@@ -23,19 +27,13 @@ const d = p.forwardRef(
|
|
|
23
27
|
},
|
|
24
28
|
t.href
|
|
25
29
|
)) }),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
"© ",
|
|
28
|
-
m,
|
|
29
|
-
" ",
|
|
30
|
-
i,
|
|
31
|
-
", All rights reserved."
|
|
32
|
-
] })
|
|
30
|
+
/* @__PURE__ */ r("p", { className: "rst:text-center rst:text-sm rst:font-medium rst:text-inherit", children: o.copyright(f, i) })
|
|
33
31
|
] })
|
|
34
32
|
}
|
|
35
33
|
);
|
|
36
34
|
}
|
|
37
35
|
);
|
|
38
|
-
|
|
36
|
+
y.displayName = "Footer";
|
|
39
37
|
export {
|
|
40
|
-
|
|
38
|
+
y as Footer
|
|
41
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),P=require("../../../lib/utils.cjs"),ge=require("../../atoms/Button/Button.cjs"),Le=require("../../atoms/Card/Card.cjs"),Oe=require("../../atoms/Spinner/Spinner.cjs"),Pe=require("../../atoms/Textarea/Textarea.cjs"),Y=require("../../molecules/Alert/Alert.cjs"),ze=require("../../molecules/EmptyState/EmptyState.cjs"),De=require("../../molecules/RadioGroup/RadioGroup.cjs"),He=require("./queue-actions.cjs"),me={primary:{colorScheme:"primary",variant:"solid"},success:{colorScheme:"success",variant:"solid"},danger:{colorScheme:"error",variant:"soft"},neutral:{colorScheme:"neutral",variant:"outline"}},Ke={edit:He.editAction},R=c=>c.edit?c:null,Qe=c=>c===0?"None left.":`${c} left.`,Ge=c=>Math.min(6,Math.max(1,c)),We=c=>c instanceof Error&&c.message?c.message:"Something went wrong.";function B(c,d){const p={...c};return delete p[d],p}function Z({busy:c=!1,blocked:d=!1,onClick:p,children:j,className:v,...y}){return n.jsx(ge.Button,{size:"lg",...y,isLoading:c,"aria-disabled":d||void 0,className:P.cn(d&&!c&&"rst:cursor-not-allowed rst:opacity-50",v),onClick:g=>{if(d){g.preventDefault();return}p?.(g)},children:j})}function Je({label:c,hideLabel:d=!1,headingLevel:p=2,itemHeadingLevel:j,items:v,getKey:y,itemLabel:g,renderMeta:xe,renderContent:he,actions:z,status:_="ready",error:ve,onRetry:ee,empty:te={title:"Nothing waiting"},density:re="comfortable",footer:be,className:ye}){const Se=typeof z=="function"?z(Ke):z,N=a.useId(),q=a.useRef(null),k=v.map(y),T=a.useRef(new Map);T.current=new Map(v.map((e,t)=>[k[t],e]));const[D,je]=a.useState({}),$=a.useRef({}),ne=e=>{$.current=e($.current),je($.current)},[se,E]=a.useState({}),[oe,qe]=a.useState({}),x=a.useRef({}),h=(e,t)=>{x.current=t?{...x.current,[e]:t}:B(x.current,e),qe(x.current)},[H,ke]=a.useState({text:"",n:0}),K=a.useRef([]),w=a.useRef(null),ce=a.useCallback(e=>{K.current.push(e),!w.current&&(w.current=setTimeout(()=>{w.current=null;const t=K.current.join(" ");K.current=[],ke(r=>({text:t,n:r.n+1}))},0))},[]);a.useLayoutEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]);const[$e,Re]=a.useState(0),Q=a.useRef(null),S=a.useCallback(e=>{Q.current=e,Re(t=>t+1)},[]),ie=a.useCallback(e=>{const t=q.current;if(!t)return null;const r="key"in e?CSS.escape(e.key):"";switch(e.kind){case"item":return t.querySelector(`[data-queue-item="${r}"]`);case"empty":return t.querySelector("[data-queue-empty]");case"trigger":return t.querySelector(`[data-queue-item="${r}"] [data-queue-action="${CSS.escape(e.actionId)}"]`);case"step":return t.querySelector(`[data-queue-item="${r}"] [data-queue-step]`)}},[]);a.useLayoutEffect(()=>{const e=Q.current;if(!e)return;Q.current=null,(ie(e)??q.current?.querySelector("[data-queue-item]")??q.current?.querySelector("[data-queue-empty]"))?.focus()},[$e,ie]);const G=a.useRef(null),Ne=e=>()=>{G.current=e},we=e=>{e.relatedTarget&&!q.current?.contains(e.relatedTarget)&&(G.current=null)},F=e=>{if(G.current!==e)return!1;const t=document.activeElement;return!t||t===document.body?!0:q.current?.contains(t)?!!t.closest(`[data-queue-item="${CSS.escape(e)}"]`):!1},C=a.useRef(null),A=(e,t)=>{C.current=t,h(e.key,{...e,open:!1})},ae=a.useRef(k),W=a.useRef(new Map),[,Ce]=a.useState(0),J=a.useRef(new Set),ue=(e,t,r)=>{const o=t.indexOf(e),f=t.slice(o+1).find(i=>r.has(i));if(f)return{kind:"item",key:f};const s=t.slice(0,o).reverse().find(i=>r.has(i));return s?{kind:"item",key:s}:{kind:"empty"}};a.useLayoutEffect(()=>{const e=ae.current;ae.current=k;const t=new Set(k),r=W.current;W.current=new Map;const o=[];let f=!1;for(const[s,i]of r){const u=t.has(s);o.push(i.announce??i.sentence),u||(f=!0),J.current.delete(s);const l=u?{kind:"trigger",key:s,actionId:i.actionId}:e.includes(s)?ue(s,e,t):null,m=x.current[s];if(m?.surface)A(m,l??{kind:"empty"});else{const I=F(s);m&&h(s,null),l&&I&&S(l)}}for(const s of e.filter(i=>!t.has(i))){if(r.has(s))continue;E(m=>s in m?B(m,s):m);const i=ue(s,e,t),u=C.current;if(u&&"key"in u&&u.key===s&&(C.current=i),$.current[s]){J.current.add(s),F(s)&&S(i);continue}const l=x.current[s];if(l&&!(l.surface&&!l.open))if(o.push(`${l.label} was decided elsewhere.`),f=!0,l.surface)A(l,i);else{const m=F(s);h(s,null),m&&S(i)}else!l&&F(s)&&S(i)}o.length&&ce(`${o.join(" ")}${f?` ${Qe(k.length)}`:""}`)});const M=async(e,t,r,o)=>{const f=T.current.get(e)??t,s=g(f),i=r.edit?R(r).run:r.run;ne(u=>({...u,[e]:r.id})),E(u=>B(u,e));try{const u=await i(f,o);W.current.set(e,{actionId:r.id,sentence:`${r.done??r.label}: ${s}.`,announce:u?u.announce:void 0}),Ce(l=>l+1)}catch(u){const l=We(u);ce(`${r.label} didn't go through for ${s}. ${l}`);const m=x.current[e];J.current.delete(e)?m?.surface?A(m,{kind:"empty"}):m&&h(e,null):m?h(e,{...m,error:l}):E(I=>({...I,[e]:l}))}finally{ne(u=>B(u,e))}},Ie=(e,t)=>{const r=y(e),o=R(t);if(!t.confirm&&!t.reason&&!o){M(r,e,t,{});return}E(f=>B(f,r)),h(r,{key:r,label:g(e),item:e,action:t,draft:o?o.edit.initial(e):void 0,reason:{},surface:!!o?.edit.surface,open:!0}),o?.edit.surface||S({kind:"step",key:r})},U=e=>{const t=x.current[e];if(!t||$.current[e])return;const r={kind:"trigger",key:e,actionId:t.action.id};t.surface?A(t,r):(h(e,null),S(r))},Be=e=>{const t=x.current[e];!t||$.current[e]||pe(t,T.current.get(e)??t.item)||(t.action.edit?M(e,t.item,t.action,{draft:t.draft}):t.action.reason?M(e,t.item,t.action,{reason:Ue(t.reason)}):M(e,t.item,t.action,{}))},Te=e=>{const t=C.current;C.current=null,h(e,null),t&&S(t)},Ee=`h${p}`,le=j??Ge(p+1),Fe=`h${le}`,V=`${N}-label`,de=(e,t)=>{const{action:r}=e,o=R(r),f=T.current.get(e.key)??e.item,s=!!D[e.key],i=pe(e,f),u=`${N}-step-${t}-message`,l=n.jsx(Z,{...me[r.tone??"neutral"],busy:s,blocked:!!i,"aria-describedby":i?u:void 0,onClick:()=>Be(e.key),"data-queue-submit":"",children:o?o.edit.submitLabel:r.label}),m=n.jsx(Z,{variant:"ghost",colorScheme:"neutral",blocked:s,onClick:()=>U(e.key),children:"Cancel"}),I=n.jsxs(n.Fragment,{children:[r.reason&&n.jsx(Ve,{id:`${N}-step-${t}`,step:r.reason,value:e.reason,disabled:s,onChange:X=>h(e.key,{...x.current[e.key],reason:X})}),o&&n.jsx(o.edit.Form,{item:f,value:e.draft,onChange:X=>h(e.key,{...x.current[e.key],draft:X})}),i&&n.jsx("p",{id:u,className:"rst:text-sm rst:text-error-600 rst:dark:text-error-400","data-queue-validation":"",children:i}),e.error&&n.jsx(Y.Alert,{colorScheme:"error",role:"group","aria-live":"off",children:e.error})]});return{submitButton:l,cancelButton:m,fields:I}},Ae=(e,t)=>{const{submitButton:r,cancelButton:o,fields:f}=de(e,t),s=`${N}-step-${t}-prompt`,i=R(e.action),u=e.action.confirm?.prompt??e.action.reason?.prompt??i?.edit.title;return n.jsxs("div",{role:"group","aria-labelledby":s,tabIndex:-1,"data-queue-step":"",onKeyDown:l=>{l.key==="Escape"&&(l.stopPropagation(),U(e.key))},className:"rst:flex rst:flex-col rst:gap-3 rst:rounded-lg rst:border rst:border-[var(--roster-card-border)] rst:p-4 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:[n.jsx("p",{id:s,className:"rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)]",children:u}),i?.edit.description&&n.jsx("p",{className:"rst:text-sm rst:text-gray-600 rst:dark:text-gray-300",children:i.edit.description}),f,n.jsxs("div",{className:"rst:flex rst:flex-wrap rst:gap-2",children:[r,o]})]})},Me=(e,t)=>{const r=D[t];return n.jsx("div",{role:"group","aria-label":`Decide: ${g(e)}`,className:"rst:flex rst:flex-wrap rst:gap-2",children:Se.filter(o=>!o.hidden?.(e)).map(o=>n.jsx(Z,{...me[o.tone??"neutral"],"data-queue-action":o.id,busy:r===o.id,blocked:!!r&&r!==o.id,onClick:()=>Ie(e,o),children:o.label},o.id))})},b=Object.values(oe).find(e=>e.surface)??null,L=b?R(b.action):null,fe=L?.edit.surface,O=b?de(b,-1):null;return n.jsxs("section",{ref:q,"aria-labelledby":V,onBlur:we,className:P.cn("rst:font-ui rst:flex rst:flex-col rst:gap-4",ye),children:[n.jsx(Ee,{id:V,className:P.cn("rst:text-lg rst:font-semibold rst:text-[var(--roster-control-text)]",d&&"rst:sr-only"),children:c}),n.jsxs("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"rst:sr-only","data-queue-live":"","data-queue-live-n":H.n,children:[H.text,H.n%2?" ":""]}),_==="loading"?n.jsx("div",{className:"rst:flex rst:justify-center rst:py-12","aria-busy":"true",children:n.jsx(Oe.Spinner,{size:"lg",label:`Loading ${c}`})}):_==="error"?n.jsx(Y.Alert,{colorScheme:"error",children:n.jsxs("div",{className:"rst:flex rst:flex-col rst:items-start rst:gap-3",children:[n.jsx("div",{children:ve??"The queue couldn't load."}),ee&&n.jsx(ge.Button,{size:"lg",variant:"outline",colorScheme:"neutral",onClick:ee,children:"Retry"})]})}):v.length===0?n.jsx(ze.EmptyState,{title:te.title,description:te.description,headingLevel:le,tabIndex:-1,"data-queue-empty":"",className:"rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring"}):n.jsx("ul",{role:"list","aria-labelledby":V,className:"rst:m-0 rst:flex rst:list-none rst:flex-col rst:gap-3 rst:p-0",children:v.map((e,t)=>{const r=k[t],o=`${N}-item-${t}`,f=xe?.(e),s=oe[r];return n.jsx("li",{children:n.jsx("article",{"data-queue-item":r,tabIndex:-1,"aria-labelledby":o,onFocus:Ne(r),className:"rst:rounded-xl rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",children:n.jsx(Le.Card,{padding:re==="compact"?"sm":"md",children:n.jsxs("div",{className:P.cn("rst:flex rst:flex-col",re==="compact"?"rst:gap-3":"rst:gap-4"),children:[n.jsxs("div",{className:"rst:flex rst:flex-wrap rst:items-baseline rst:gap-x-3 rst:gap-y-1",children:[n.jsx(Fe,{id:o,className:"rst:text-base rst:font-semibold",children:g(e)}),f&&n.jsx("div",{className:"rst:flex rst:flex-wrap rst:items-center rst:gap-2 rst:text-sm rst:text-gray-600 rst:dark:text-gray-300",children:f})]}),n.jsx("div",{className:"rst:min-w-0",children:he(e)}),se[r]&&n.jsx(Y.Alert,{colorScheme:"error",role:"group","aria-live":"off",children:se[r]}),s&&!s.surface?Ae(s,t):Me(e,r)]})})})},r)})}),be,fe&&b&&L&&O&&n.jsx(fe,{open:b.open,title:L.edit.title,description:L.edit.description,busy:!!D[b.key],onCancel:()=>U(b.key),onAfterClose:()=>Te(b.key),submitButton:O.submitButton,cancelButton:O.cancelButton,children:n.jsx("div",{className:"rst:flex rst:flex-col rst:gap-4",children:O.fields})})]})}function pe(c,d){const p=R(c.action);if(p)return p.edit.validate?.(c.draft,d);if(c.action.reason){if(c.action.reason.required&&!c.reason.value)return"Pick a reason.";if(c.action.reason.note==="required"&&!c.reason.note?.trim())return"Add a note."}}function Ue(c){const d=c.note?.trim();return{...c.value?{value:c.value}:{},...d?{note:d}:{}}}function Ve({id:c,step:d,value:p,disabled:j,onChange:v}){const y=d.note??"optional";return n.jsxs(n.Fragment,{children:[d.options&&d.options.length>0&&n.jsx(De.RadioGroup,{label:d.required?"Reason":"Reason (optional)",options:d.options,value:p.value??"",onChange:g=>v({...p,value:g}),disabled:j}),y!=="none"&&n.jsx(Pe.Textarea,{id:`${c}-note`,label:d.noteLabel??(y==="required"?"Note":"Note (optional)"),rows:3,value:p.note??"",onChange:g=>v({...p,note:g.target.value}),disabled:j})]})}exports.ModerationQueue=Je;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),D=require("../../../lib/utils.cjs"),Pe=require("../../../lib/labels.cjs"),he=require("../../atoms/Button/Button.cjs"),ze=require("../../atoms/Card/Card.cjs"),De=require("../../atoms/Spinner/Spinner.cjs"),He=require("../../atoms/Textarea/Textarea.cjs"),_=require("../../molecules/Alert/Alert.cjs"),Ke=require("../../molecules/EmptyState/EmptyState.cjs"),Qe=require("../../molecules/RadioGroup/RadioGroup.cjs"),Ge=require("./queue-actions.cjs"),We={loading:n=>`Loading ${n}`,loadFailed:"The queue couldn't load.",retry:"Retry",busy:"loading",cancel:"Cancel",decide:n=>`Decide: ${n}`,decided:(n,a)=>`${n}: ${a}.`,failed:(n,a,p)=>`${n} didn't go through for ${a}. ${p}`,unknownError:"Something went wrong.",decidedElsewhere:n=>`${n} was decided elsewhere.`,left:n=>n===0?"None left.":`${n} left.`,pickReason:"Pick a reason.",addNote:"Add a note.",reason:"Reason",reasonOptional:"Reason (optional)",note:"Note",noteOptional:"Note (optional)"},ge={primary:{colorScheme:"primary",variant:"solid"},success:{colorScheme:"success",variant:"solid"},danger:{colorScheme:"error",variant:"soft"},neutral:{colorScheme:"neutral",variant:"outline"}},Je={edit:Ge.editAction},N=n=>n.edit?n:null,Ue=n=>Math.min(6,Math.max(1,n)),Ve=(n,a)=>n instanceof Error&&n.message?n.message:a;function T(n,a){const p={...n};return delete p[a],p}function ee({busy:n=!1,blocked:a=!1,onClick:p,children:v,className:y,...S}){return s.jsx(he.Button,{size:"lg",...S,isLoading:n,"aria-disabled":a||void 0,className:D.cn(a&&!n&&"rst:cursor-not-allowed rst:opacity-50",y),onClick:h=>{if(a){h.preventDefault();return}p?.(h)},children:v})}function Xe({label:n,hideLabel:a=!1,headingLevel:p=2,itemHeadingLevel:v,items:y,getKey:S,itemLabel:h,renderMeta:w,renderContent:be,actions:H,status:te="ready",error:ve,onRetry:re,empty:ne={title:"Nothing waiting"},density:se="comfortable",footer:ye,labels:Se,className:je}){const g=Pe.withLabels(We,Se),qe=typeof H=="function"?H(Je):H,C=l.useId(),k=l.useRef(null),R=y.map(S),F=l.useRef(new Map);F.current=new Map(y.map((e,t)=>[R[t],e]));const[K,ke]=l.useState({}),$=l.useRef({}),oe=e=>{$.current=e($.current),ke($.current)},[ce,L]=l.useState({}),[ie,Re]=l.useState({}),x=l.useRef({}),b=(e,t)=>{x.current=t?{...x.current,[e]:t}:T(x.current,e),Re(x.current)},[Q,$e]=l.useState({text:"",n:0}),G=l.useRef([]),B=l.useRef(null),ae=l.useCallback(e=>{G.current.push(e),!B.current&&(B.current=setTimeout(()=>{B.current=null;const t=G.current.join(" ");G.current=[],$e(r=>({text:t,n:r.n+1}))},0))},[]);l.useLayoutEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const[Ne,we]=l.useState(0),W=l.useRef(null),q=l.useCallback(e=>{W.current=e,we(t=>t+1)},[]),le=l.useCallback(e=>{const t=k.current;if(!t)return null;const r="key"in e?CSS.escape(e.key):"";switch(e.kind){case"item":return t.querySelector(`[data-queue-item="${r}"]`);case"empty":return t.querySelector("[data-queue-empty]");case"trigger":return t.querySelector(`[data-queue-item="${r}"] [data-queue-action="${CSS.escape(e.actionId)}"]`);case"step":return t.querySelector(`[data-queue-item="${r}"] [data-queue-step]`)}},[]);l.useLayoutEffect(()=>{const e=W.current;if(!e)return;W.current=null,(le(e)??k.current?.querySelector("[data-queue-item]")??k.current?.querySelector("[data-queue-empty]"))?.focus()},[Ne,le]);const J=l.useRef(null),Ce=e=>()=>{J.current=e},Be=e=>{e.relatedTarget&&!k.current?.contains(e.relatedTarget)&&(J.current=null)},A=e=>{if(J.current!==e)return!1;const t=document.activeElement;return!t||t===document.body?!0:k.current?.contains(t)?!!t.closest(`[data-queue-item="${CSS.escape(e)}"]`):!1},E=l.useRef(null),O=(e,t)=>{E.current=t,b(e.key,{...e,open:!1})},ue=l.useRef(R),U=l.useRef(new Map),[,Ee]=l.useState(0),V=l.useRef(new Set),de=(e,t,r)=>{const c=t.indexOf(e),f=t.slice(c+1).find(i=>r.has(i));if(f)return{kind:"item",key:f};const o=t.slice(0,c).reverse().find(i=>r.has(i));return o?{kind:"item",key:o}:{kind:"empty"}};l.useLayoutEffect(()=>{const e=ue.current;ue.current=R;const t=new Set(R),r=U.current;U.current=new Map;const c=[];let f=!1;for(const[o,i]of r){const u=t.has(o);c.push(i.announce??i.sentence),u||(f=!0),V.current.delete(o);const d=u?{kind:"trigger",key:o,actionId:i.actionId}:e.includes(o)?de(o,e,t):null,m=x.current[o];if(m?.surface)O(m,d??{kind:"empty"});else{const I=A(o);m&&b(o,null),d&&I&&q(d)}}for(const o of e.filter(i=>!t.has(i))){if(r.has(o))continue;L(m=>o in m?T(m,o):m);const i=de(o,e,t),u=E.current;if(u&&"key"in u&&u.key===o&&(E.current=i),$.current[o]){V.current.add(o),A(o)&&q(i);continue}const d=x.current[o];if(d&&!(d.surface&&!d.open))if(c.push(g.decidedElsewhere(d.label)),f=!0,d.surface)O(d,i);else{const m=A(o);b(o,null),m&&q(i)}else!d&&A(o)&&q(i)}c.length&&ae(`${c.join(" ")}${f?` ${g.left(R.length)}`:""}`)});const M=async(e,t,r,c)=>{const f=F.current.get(e)??t,o=h(f),i=r.edit?N(r).run:r.run;oe(u=>({...u,[e]:r.id})),L(u=>T(u,e));try{const u=await i(f,c);U.current.set(e,{actionId:r.id,sentence:g.decided(r.done??r.label,o),announce:u?u.announce:void 0}),Ee(d=>d+1)}catch(u){const d=Ve(u,g.unknownError);ae(g.failed(r.label,o,d));const m=x.current[e];V.current.delete(e)?m?.surface?O(m,{kind:"empty"}):m&&b(e,null):m?b(e,{...m,error:d}):L(I=>({...I,[e]:d}))}finally{oe(u=>T(u,e))}},Ie=(e,t)=>{const r=S(e),c=N(t);if(!t.confirm&&!t.reason&&!c){M(r,e,t,{});return}L(f=>T(f,r)),b(r,{key:r,label:h(e),item:e,action:t,draft:c?c.edit.initial(e):void 0,reason:{},surface:!!c?.edit.surface,open:!0}),c?.edit.surface||q({kind:"step",key:r})},X=e=>{const t=x.current[e];if(!t||$.current[e])return;const r={kind:"trigger",key:e,actionId:t.action.id};t.surface?O(t,r):(b(e,null),q(r))},Te=e=>{const t=x.current[e];!t||$.current[e]||xe(t,F.current.get(e)??t.item,g)||(t.action.edit?M(e,t.item,t.action,{draft:t.draft}):t.action.reason?M(e,t.item,t.action,{reason:Ye(t.reason)}):M(e,t.item,t.action,{}))},Fe=e=>{const t=E.current;E.current=null,b(e,null),t&&q(t)},Le=`h${p}`,fe=v??Ue(p+1),Ae=`h${fe}`,Y=`${C}-label`,pe=(e,t)=>{const{action:r}=e,c=N(r),f=F.current.get(e.key)??e.item,o=!!K[e.key],i=xe(e,f,g),u=`${C}-step-${t}-message`,d=s.jsx(ee,{...ge[r.tone??"neutral"],busy:o,loadingLabel:g.busy,blocked:!!i,"aria-describedby":i?u:void 0,onClick:()=>Te(e.key),"data-queue-submit":"",children:c?c.edit.submitLabel:r.label}),m=s.jsx(ee,{variant:"ghost",colorScheme:"neutral",blocked:o,onClick:()=>X(e.key),children:g.cancel}),I=s.jsxs(s.Fragment,{children:[r.reason&&s.jsx(Ze,{id:`${C}-step-${t}`,step:r.reason,labels:g,value:e.reason,disabled:o,onChange:Z=>b(e.key,{...x.current[e.key],reason:Z})}),c&&s.jsx(c.edit.Form,{item:f,value:e.draft,onChange:Z=>b(e.key,{...x.current[e.key],draft:Z})}),i&&s.jsx("p",{id:u,className:"rst:text-sm rst:text-error-600 rst:dark:text-error-400","data-queue-validation":"",children:i}),e.error&&s.jsx(_.Alert,{colorScheme:"error",role:"group","aria-live":"off",children:e.error})]});return{submitButton:d,cancelButton:m,fields:I}},Oe=(e,t)=>{const{submitButton:r,cancelButton:c,fields:f}=pe(e,t),o=`${C}-step-${t}-prompt`,i=N(e.action),u=e.action.reason?.prompt??e.action.confirm?.prompt??i?.edit.title;return s.jsxs("div",{role:"group","aria-labelledby":o,tabIndex:-1,"data-queue-step":"",onKeyDown:d=>{d.key==="Escape"&&(d.stopPropagation(),X(e.key))},className:"rst:flex rst:flex-col rst:gap-3 rst:rounded-lg rst:border rst:border-[var(--roster-card-border)] rst:p-4 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:[s.jsx("p",{id:o,className:"rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)]",children:u}),i?.edit.description&&s.jsx("p",{className:"rst:text-sm rst:text-gray-600 rst:dark:text-gray-300",children:i.edit.description}),f,s.jsxs("div",{className:"rst:flex rst:flex-wrap rst:gap-2",children:[r,c]})]})},Me=(e,t)=>{const r=K[t];return s.jsx("div",{role:"group","aria-label":g.decide(h(e)),className:"rst:flex rst:flex-wrap rst:gap-2",children:qe.filter(c=>!c.hidden?.(e)).map(c=>s.jsx(ee,{...ge[c.tone??"neutral"],"data-queue-action":c.id,busy:r===c.id,loadingLabel:g.busy,blocked:!!r&&r!==c.id,onClick:()=>Ie(e,c),children:c.label},c.id))})},j=Object.values(ie).find(e=>e.surface)??null,P=j?N(j.action):null,me=P?.edit.surface,z=j?pe(j,-1):null;return s.jsxs("section",{ref:k,"aria-labelledby":Y,onBlur:Be,className:D.cn("rst:font-ui rst:flex rst:flex-col rst:gap-4",je),children:[s.jsx(Le,{id:Y,className:D.cn("rst:text-lg rst:font-semibold rst:text-[var(--roster-control-text)]",a&&"rst:sr-only"),children:n}),s.jsxs("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"rst:sr-only","data-queue-live":"","data-queue-live-n":Q.n,children:[Q.text,Q.n%2?" ":""]}),te==="loading"?s.jsx("div",{className:"rst:flex rst:justify-center rst:py-12","aria-busy":"true",children:s.jsx(De.Spinner,{size:"lg",label:g.loading(n)})}):te==="error"?s.jsx(_.Alert,{colorScheme:"error",children:s.jsxs("div",{className:"rst:flex rst:flex-col rst:items-start rst:gap-3",children:[s.jsx("div",{children:ve??g.loadFailed}),re&&s.jsx(he.Button,{size:"lg",variant:"outline",colorScheme:"neutral",onClick:re,children:g.retry})]})}):y.length===0?s.jsx(Ke.EmptyState,{title:ne.title,description:ne.description,headingLevel:fe,tabIndex:-1,"data-queue-empty":"",className:"rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring"}):s.jsx("ul",{role:"list","aria-labelledby":Y,className:"rst:m-0 rst:flex rst:list-none rst:flex-col rst:gap-3 rst:p-0",children:y.map((e,t)=>{const r=R[t],c=`${C}-item-${t}`,f=w?.(e),o=ie[r];return s.jsx("li",{children:s.jsx("article",{"data-queue-item":r,tabIndex:-1,"aria-labelledby":c,onFocus:Ce(r),className:"rst:rounded-xl rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",children:s.jsx(ze.Card,{padding:se==="compact"?"sm":"md",children:s.jsxs("div",{className:D.cn("rst:flex rst:flex-col",se==="compact"?"rst:gap-3":"rst:gap-4"),children:[s.jsxs("div",{className:"rst:flex rst:flex-wrap rst:items-baseline rst:gap-x-3 rst:gap-y-1",children:[s.jsx(Ae,{id:c,className:"rst:text-base rst:font-semibold",children:h(e)}),f&&s.jsx("div",{className:"rst:flex rst:flex-wrap rst:items-center rst:gap-2 rst:text-sm rst:text-gray-600 rst:dark:text-gray-300",children:f})]}),s.jsx("div",{className:"rst:min-w-0",children:be(e)}),ce[r]&&s.jsx(_.Alert,{colorScheme:"error",role:"group","aria-live":"off",children:ce[r]}),o&&!o.surface?Oe(o,t):Me(e,r)]})})})},r)})}),ye,me&&j&&P&&z&&s.jsx(me,{open:j.open,title:P.edit.title,description:P.edit.description,busy:!!K[j.key],onCancel:()=>X(j.key),onAfterClose:()=>Fe(j.key),submitButton:z.submitButton,cancelButton:z.cancelButton,closeLabel:g.close,children:s.jsx("div",{className:"rst:flex rst:flex-col rst:gap-4",children:z.fields})})]})}function xe(n,a,p){const v=N(n.action);if(v)return v.edit.validate?.(n.draft,a);if(n.action.reason){if(n.action.reason.required&&n.action.reason.options?.length&&!n.reason.value)return p.pickReason;if(n.action.reason.note==="required"&&!n.reason.note?.trim())return p.addNote}}function Ye(n){const a=n.note?.trim();return{...n.value?{value:n.value}:{},...a?{note:a}:{}}}function Ze({id:n,step:a,value:p,disabled:v,onChange:y,labels:S}){const h=a.note??"optional";return s.jsxs(s.Fragment,{children:[a.options&&a.options.length>0&&s.jsx(Qe.RadioGroup,{label:a.required?S.reason:S.reasonOptional,options:a.options,value:p.value??"",onChange:w=>y({...p,value:w}),disabled:v}),h!=="none"&&s.jsx(He.Textarea,{id:`${n}-note`,label:a.noteLabel??(h==="required"?S.note:S.noteOptional),rows:3,value:p.note??"",onChange:w=>y({...p,note:w.target.value}),disabled:v})]})}exports.ModerationQueue=Xe;
|
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { QueueAction, QueueActionKit, QueueCheckedEditAction, QueueHeadingLevel } from './queue-actions';
|
|
3
|
+
/** Every word ModerationQueue shows or says of its own. Pass any of them in `labels` to replace it. */
|
|
4
|
+
export interface ModerationQueueLabels {
|
|
5
|
+
/** The spinner's name while the queue loads, from its `label`. */
|
|
6
|
+
loading: (label: string) => string;
|
|
7
|
+
/** The whole-queue error when `error` gives none. */
|
|
8
|
+
loadFailed: string;
|
|
9
|
+
/** The whole-queue error's retry button. */
|
|
10
|
+
retry: string;
|
|
11
|
+
/** A button's spinner while its decision is in flight. */
|
|
12
|
+
busy: string;
|
|
13
|
+
/** A step's cancel button. */
|
|
14
|
+
cancel: string;
|
|
15
|
+
/** An item's action bar's name, from `itemLabel`. */
|
|
16
|
+
decide: (item: string) => string;
|
|
17
|
+
/** Said when a decision lands: the action's `done` (or `label`) and the item. */
|
|
18
|
+
decided: (action: string, item: string) => string;
|
|
19
|
+
/** Said when a decision fails, with the error's message. */
|
|
20
|
+
failed: (action: string, item: string, message: string) => string;
|
|
21
|
+
/** The message when a failed `run` throws without one. */
|
|
22
|
+
unknownError: string;
|
|
23
|
+
/** Said when an item with its step open leaves without a decision of ours. */
|
|
24
|
+
decidedElsewhere: (item: string) => string;
|
|
25
|
+
/** Said after an item leaves: how many are left. */
|
|
26
|
+
left: (count: number) => string;
|
|
27
|
+
/** Why a step with a required reason can't be submitted yet. */
|
|
28
|
+
pickReason: string;
|
|
29
|
+
/** Why a step with a required note can't be submitted yet. */
|
|
30
|
+
addNote: string;
|
|
31
|
+
/** The reason choices' label, required and optional. */
|
|
32
|
+
reason: string;
|
|
33
|
+
reasonOptional: string;
|
|
34
|
+
/** The note's label, required and optional, unless the step sets `noteLabel`. */
|
|
35
|
+
note: string;
|
|
36
|
+
noteOptional: string;
|
|
37
|
+
/** The close button of an edit's Dialog or Sheet. Unset, each keeps its own. */
|
|
38
|
+
close?: string;
|
|
39
|
+
}
|
|
3
40
|
export interface ModerationQueueProps<T> {
|
|
4
41
|
/** The queue's heading, and the list's accessible name. */
|
|
5
42
|
label: string;
|
|
@@ -42,6 +79,8 @@ export interface ModerationQueueProps<T> {
|
|
|
42
79
|
density?: "comfortable" | "compact";
|
|
43
80
|
/** After the list: "Load more", if the app pages. */
|
|
44
81
|
footer?: ReactNode;
|
|
82
|
+
/** The component's own words, replaced; any left out stay English. */
|
|
83
|
+
labels?: Partial<ModerationQueueLabels>;
|
|
45
84
|
className?: string;
|
|
46
85
|
}
|
|
47
86
|
/**
|
|
@@ -68,6 +107,6 @@ export interface ModerationQueueProps<T> {
|
|
|
68
107
|
* elsewhere. Focus moves only if it was inside the item.
|
|
69
108
|
* - Several outcomes in one render are said in one sentence.
|
|
70
109
|
*/
|
|
71
|
-
declare function ModerationQueue<T>({ label, hideLabel, headingLevel, itemHeadingLevel, items, getKey, itemLabel, renderMeta, renderContent, actions: actionsProp, status, error, onRetry, empty, density, footer, className, }: ModerationQueueProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
declare function ModerationQueue<T>({ label, hideLabel, headingLevel, itemHeadingLevel, items, getKey, itemLabel, renderMeta, renderContent, actions: actionsProp, status, error, onRetry, empty, density, footer, labels, className, }: ModerationQueueProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
72
111
|
export type { QueueCheckedEditAction };
|
|
73
112
|
export { ModerationQueue };
|