@blakesteve/roster 5.7.0 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +84 -4
  2. package/dist/components/atoms/Avatar/Avatar.cjs +1 -1
  3. package/dist/components/atoms/Avatar/Avatar.d.ts +4 -0
  4. package/dist/components/atoms/Avatar/Avatar.js +1 -1
  5. package/dist/components/atoms/AvatarStrip/AvatarStrip.cjs +1 -1
  6. package/dist/components/atoms/AvatarStrip/AvatarStrip.d.ts +10 -1
  7. package/dist/components/atoms/AvatarStrip/AvatarStrip.js +34 -30
  8. package/dist/components/atoms/Button/button-variants.cjs +1 -1
  9. package/dist/components/atoms/Button/button-variants.js +5 -3
  10. package/dist/components/atoms/Eyebrow/eyebrow-variants.cjs +1 -1
  11. package/dist/components/atoms/Eyebrow/eyebrow-variants.js +8 -4
  12. package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
  13. package/dist/components/atoms/MultiSelect/MultiSelect.d.ts +3 -1
  14. package/dist/components/atoms/MultiSelect/MultiSelect.js +87 -89
  15. package/dist/components/atoms/Progress/Progress.cjs +1 -1
  16. package/dist/components/atoms/Progress/Progress.d.ts +1 -0
  17. package/dist/components/atoms/Progress/Progress.js +28 -27
  18. package/dist/components/atoms/Stat/Stat.cjs +1 -1
  19. package/dist/components/atoms/Stat/Stat.js +5 -5
  20. package/dist/components/atoms/Stat/stat-variants.cjs +1 -1
  21. package/dist/components/atoms/Stat/stat-variants.js +10 -8
  22. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.cjs +1 -1
  23. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +10 -1
  24. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +31 -29
  25. package/dist/components/molecules/CallToAction/CallToAction.cjs +1 -1
  26. package/dist/components/molecules/CallToAction/CallToAction.d.ts +8 -1
  27. package/dist/components/molecules/CallToAction/CallToAction.js +34 -29
  28. package/dist/components/molecules/Carousel/Carousel.cjs +1 -1
  29. package/dist/components/molecules/Carousel/Carousel.d.ts +7 -0
  30. package/dist/components/molecules/Carousel/Carousel.js +155 -155
  31. package/dist/components/molecules/ErrorState/ErrorState.cjs +1 -1
  32. package/dist/components/molecules/ErrorState/ErrorState.d.ts +8 -1
  33. package/dist/components/molecules/ErrorState/ErrorState.js +44 -39
  34. package/dist/components/molecules/FileUpload/FileUpload.cjs +1 -1
  35. package/dist/components/molecules/FileUpload/FileUpload.js +23 -22
  36. package/dist/components/molecules/MediaPreview/MediaPreview.cjs +1 -1
  37. package/dist/components/molecules/MediaPreview/MediaPreview.d.ts +3 -1
  38. package/dist/components/molecules/MediaPreview/MediaPreview.js +13 -12
  39. package/dist/components/molecules/Pagination/Pagination.cjs +1 -1
  40. package/dist/components/molecules/Pagination/Pagination.d.ts +1 -0
  41. package/dist/components/molecules/Pagination/Pagination.js +47 -46
  42. package/dist/components/molecules/ProgressField/ProgressField.d.ts +1 -0
  43. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.cjs +1 -1
  44. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.d.ts +2 -2
  45. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.js +17 -17
  46. package/dist/components/molecules/StepProgress/StepProgress.cjs +1 -1
  47. package/dist/components/molecules/StepProgress/StepProgress.d.ts +1 -0
  48. package/dist/components/molecules/StepProgress/StepProgress.js +9 -8
  49. package/dist/components/organisms/Countdown/Countdown.cjs +1 -1
  50. package/dist/components/organisms/Countdown/Countdown.d.ts +13 -0
  51. package/dist/components/organisms/Countdown/Countdown.js +54 -47
  52. package/dist/components/organisms/DataTable/DataTable.cjs +1 -1
  53. package/dist/components/organisms/DataTable/DataTable.d.ts +5 -3
  54. package/dist/components/organisms/DataTable/DataTable.js +27 -26
  55. package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
  56. package/dist/components/organisms/Dialog/Dialog.d.ts +8 -1
  57. package/dist/components/organisms/Dialog/Dialog.js +25 -23
  58. package/dist/components/organisms/Footer/Footer.cjs +1 -1
  59. package/dist/components/organisms/Footer/Footer.d.ts +9 -0
  60. package/dist/components/organisms/Footer/Footer.js +21 -23
  61. package/dist/components/organisms/ModerationQueue/ModerationQueue.cjs +1 -1
  62. package/dist/components/organisms/ModerationQueue/ModerationQueue.d.ts +40 -1
  63. package/dist/components/organisms/ModerationQueue/ModerationQueue.js +262 -237
  64. package/dist/components/organisms/ModerationQueue/QueueEditDialog.cjs +1 -1
  65. package/dist/components/organisms/ModerationQueue/QueueEditDialog.d.ts +1 -1
  66. package/dist/components/organisms/ModerationQueue/QueueEditDialog.js +23 -21
  67. package/dist/components/organisms/ModerationQueue/QueueEditSheet.cjs +1 -1
  68. package/dist/components/organisms/ModerationQueue/QueueEditSheet.d.ts +1 -1
  69. package/dist/components/organisms/ModerationQueue/QueueEditSheet.js +22 -20
  70. package/dist/components/organisms/ModerationQueue/queue-actions.d.ts +29 -10
  71. package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
  72. package/dist/components/organisms/Navbar/Navbar.d.ts +38 -3
  73. package/dist/components/organisms/Navbar/Navbar.js +210 -187
  74. package/dist/components/organisms/Navbar/navbar-variants.cjs +1 -1
  75. package/dist/components/organisms/Navbar/navbar-variants.js +4 -2
  76. package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
  77. package/dist/components/organisms/Sheet/Sheet.d.ts +8 -1
  78. package/dist/components/organisms/Sheet/Sheet.js +65 -63
  79. package/dist/lib/labels.cjs +1 -0
  80. package/dist/lib/labels.d.ts +7 -0
  81. package/dist/lib/labels.js +12 -0
  82. package/dist/meta.json +3 -3
  83. package/dist/roster.css +1 -1
  84. package/package.json +1 -1
@@ -1,36 +1,36 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as o } from "react/jsx-runtime";
3
3
  import { cn as n } from "../../../lib/utils.js";
4
- import { Card as u } from "../../atoms/Card/Card.js";
5
- import { Eyebrow as f } from "../../atoms/Eyebrow/Eyebrow.js";
6
- import { statValueVariants as w, statSourceClass as h } from "../../atoms/Stat/stat-variants.js";
7
- import { TableRow as g, TableCell as k } from "../../organisms/Table/Table.js";
4
+ import { Card as p } from "../../atoms/Card/Card.js";
5
+ import { Eyebrow as u } from "../../atoms/Eyebrow/Eyebrow.js";
6
+ import { statValueVariants as f, statSourceClass as h } from "../../atoms/Stat/stat-variants.js";
7
+ import { TableRow as w, TableCell as g } from "../../organisms/Table/Table.js";
8
8
  import { Skeleton as r } from "../../atoms/Skeleton/Skeleton.js";
9
- function T({ media: s, lines: a = 3, variant: e, padding: l, className: i }) {
10
- return /* @__PURE__ */ o(u, { variant: e, padding: l, className: i, "aria-hidden": "true", "data-skeleton": "card", children: [
9
+ function C({ media: s, lines: a = 3, variant: e, padding: l, className: i }) {
10
+ return /* @__PURE__ */ o(p, { variant: e, padding: l, className: i, "aria-hidden": "true", "data-skeleton": "card", children: [
11
11
  s !== void 0 && /* @__PURE__ */ t(r, { shape: "block", height: s, className: "rst:mb-4" }),
12
12
  /* @__PURE__ */ t(r, { size: "lg", width: "45%" }),
13
13
  a > 0 && /* @__PURE__ */ t(r, { size: "md", lines: a, className: "rst:mt-2" })
14
14
  ] });
15
15
  }
16
- function j({ columns: s, className: a }) {
16
+ function T({ columns: s, className: a }) {
17
17
  const e = ["70%", "50%", "60%", "40%"];
18
- return /* @__PURE__ */ t(g, { "aria-hidden": "true", className: a, "data-skeleton": "table-row", children: Array.from({ length: Math.max(1, s) }, (l, i) => /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(r, { size: "inherit", width: e[i % e.length] }) }, i)) });
18
+ return /* @__PURE__ */ t(w, { "aria-hidden": "true", className: a, "data-skeleton": "table-row", children: Array.from({ length: Math.max(1, s) }, (l, i) => /* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(r, { size: "inherit", width: e[i % e.length] }) }, i)) });
19
19
  }
20
- function y({ size: s = "md", withName: a = !1, className: e }) {
20
+ function j({ size: s = "md", withName: a = !1, className: e }) {
21
21
  return a ? /* @__PURE__ */ o("span", { "aria-hidden": "true", className: n("rst:flex rst:items-center rst:gap-3", e), "data-skeleton": "avatar", children: [
22
22
  /* @__PURE__ */ t(r, { shape: "circle", size: s }),
23
23
  /* @__PURE__ */ t(r, { size: "md", width: "8rem" })
24
24
  ] }) : /* @__PURE__ */ t(r, { shape: "circle", size: s, className: e });
25
25
  }
26
- function A({ size: s = "md", semantics: a = "definition", source: e = !1, className: l }) {
27
- const i = w({ size: s, colorScheme: "neutral" }), d = /* @__PURE__ */ t(r, { size: "inherit", width: "2.5em" }), c = (p) => /* @__PURE__ */ t(f, { size: "xs", children: /* @__PURE__ */ t(r, { size: "inherit", width: "9em", className: p ? "rst:inline-block rst:align-baseline" : void 0 }) }), m = /* @__PURE__ */ t("span", { className: h, children: /* @__PURE__ */ t(r, { size: "inherit", width: "12em" }) });
26
+ function y({ size: s = "md", semantics: a = "definition", source: e = !1, className: l }) {
27
+ const i = f({ size: s, colorScheme: "neutral" }), d = /* @__PURE__ */ t(r, { size: "inherit", width: "2.5em" }), c = /* @__PURE__ */ t(u, { size: "xs", children: /* @__PURE__ */ t(r, { size: "inherit", width: "9em" }) }), m = /* @__PURE__ */ t("span", { className: h, children: /* @__PURE__ */ t(r, { size: "inherit", width: "12em" }) });
28
28
  return a === "standalone" ? /* @__PURE__ */ o("span", { "aria-hidden": "true", className: n("rst:flex rst:flex-col rst:gap-[3px]", l), "data-skeleton": "stat", children: [
29
29
  /* @__PURE__ */ t("span", { className: i, children: d }),
30
- c(!1),
30
+ c,
31
31
  e && m
32
32
  ] }) : /* @__PURE__ */ o("div", { "aria-hidden": "true", className: n("rst:grid rst:content-start rst:gap-[3px]", l), "data-skeleton": "stat", children: [
33
- /* @__PURE__ */ t("dt", { className: "rst:relative rst:col-start-1 rst:row-start-2", children: c(!0) }),
33
+ /* @__PURE__ */ t("dt", { className: "rst:relative rst:col-start-1 rst:row-start-2 rst:flex", children: c }),
34
34
  e ? /* @__PURE__ */ o("dd", { className: n("rst:m-0", i, "rst:col-start-1 rst:row-span-3 rst:row-start-1 rst:grid rst:grid-rows-subgrid"), children: [
35
35
  /* @__PURE__ */ t("span", { className: "rst:row-start-1", children: d }),
36
36
  /* @__PURE__ */ t("span", { className: n(h, "rst:row-start-3"), children: /* @__PURE__ */ t(r, { size: "inherit", width: "12em" }) })
@@ -38,8 +38,8 @@ function A({ size: s = "md", semantics: a = "definition", source: e = !1, classN
38
38
  ] });
39
39
  }
40
40
  export {
41
- y as SkeletonAvatar,
42
- T as SkeletonCard,
43
- A as SkeletonStat,
44
- j as SkeletonTableRow
41
+ j as SkeletonAvatar,
42
+ C as SkeletonCard,
43
+ y as SkeletonStat,
44
+ T as SkeletonTableRow
45
45
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("../../../lib/utils.cjs"),h=require("../../atoms/Progress/Progress.cjs"),b={nav:"Progress",position:(s,c)=>`Step ${s} of ${c}`,done:"done",number:s=>String(s)},y=()=>r.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M20 6 9 17l-5-5"})});function j({steps:s,current:c,variant:g="stepper",labels:f,className:p}){const o={...b,...f},n=s.length;if(n===0)return null;const t=Math.min(Math.max(1,Math.floor(Number.isFinite(c)?c:1)),n+1),d=t>n,u=d?o.position(n,n):o.position(t,n),x=d?u:`${u}: ${s[t-1]}`;return g==="segmented"?r.jsxs("div",{className:l.cn("rst:font-ui rst:w-full rst:min-w-0",p),"data-step-progress":"segmented",children:[r.jsxs("div",{className:"rst:mb-1.5 rst:flex rst:items-baseline rst:justify-between rst:gap-3 rst:text-sm","aria-hidden":"true",children:[r.jsx("span",{className:"rst:font-medium rst:text-[var(--roster-control-text)]","data-step-position":"",children:u}),!d&&r.jsx("span",{className:"rst:min-w-0 rst:truncate rst:text-gray-600 rst:dark:text-gray-400","data-step-name":"",children:s[t-1]})]}),r.jsx(h.Progress,{variant:"segmented",segments:s.map((m,i)=>i+1<t?"done":i+1===t?"current":"remaining"),announce:!1}),r.jsx("span",{role:"status",className:"rst:sr-only","data-step-status":"",children:x})]}):r.jsxs("div",{className:l.cn("rst:font-ui rst:w-full",p),"data-step-progress":"stepper",children:[r.jsx("ol",{"aria-label":o.nav,className:"rst:m-0 rst:flex rst:w-full rst:list-none rst:p-0",children:s.map((m,i)=>{const a=i+1,e=a<t?"done":a===t?"current":"upcoming";return r.jsxs("li",{"aria-current":e==="current"?"step":void 0,className:"rst:relative rst:flex rst:min-w-0 rst:flex-1 rst:flex-col rst:items-center rst:gap-1.5 rst:text-center","data-step":e,children:[i>0&&r.jsx("span",{"aria-hidden":"true",className:l.cn("rst:absolute rst:right-1/2 rst:top-4 rst:h-0.5 rst:w-full rst:-translate-y-1/2",a<=t?"rst:bg-primary-600 rst:dark:bg-primary-400 rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[Highlight]":"rst:bg-[var(--roster-skeleton)] rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[GrayText]"),"data-step-connector":a<=t?"filled":"empty"}),r.jsx("span",{"aria-hidden":"true",className:l.cn("rst:relative rst:z-10 rst:flex rst:h-8 rst:w-8 rst:items-center rst:justify-center rst:rounded-full rst:text-sm rst:font-semibold rst:tabular-nums",e==="done"&&"rst:bg-primary-600 rst:text-primary-600-ink rst:dark:bg-primary-400 rst:dark:text-gray-950 rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[Highlight] rst:forced-colors:text-[HighlightText]",e==="current"&&"rst:border-2 rst:border-primary-600 rst:bg-[var(--roster-card-bg)] rst:text-primary-600 rst:dark:border-primary-400 rst:dark:text-primary-400",e==="upcoming"&&"rst:bg-[var(--roster-skeleton)] rst:text-gray-600 rst:dark:text-gray-300 rst:forced-colors:border"),"data-step-marker":"",children:e==="done"?r.jsx(y,{}):o.number(a)}),r.jsxs("span",{className:l.cn("rst:w-full rst:px-1 rst:text-xs rst:leading-4 rst:break-words",e==="current"?"rst:font-semibold rst:text-[var(--roster-control-text)]":"rst:text-gray-600 rst:dark:text-gray-400"),children:[m,e==="done"&&r.jsx("span",{className:"rst:sr-only",children:`, ${o.done}`})]})]},`${a}-${m}`)})}),r.jsx("span",{role:"status",className:"rst:sr-only","data-step-status":"",children:x})]})}exports.StepProgress=j;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("../../../lib/utils.cjs"),h=require("../../../lib/labels.cjs"),b=require("../../atoms/Progress/Progress.cjs"),y={nav:"Progress",position:(s,c)=>`Step ${s} of ${c}`,done:"done",number:s=>String(s)},j=()=>r.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M20 6 9 17l-5-5"})});function k({steps:s,current:c,variant:g="stepper",labels:f,className:p}){const o=h.withLabels(y,f),n=s.length;if(n===0)return null;const t=Math.min(Math.max(1,Math.floor(Number.isFinite(c)?c:1)),n+1),d=t>n,u=d?o.position(n,n):o.position(t,n),x=d?u:`${u}: ${s[t-1]}`;return g==="segmented"?r.jsxs("div",{className:l.cn("rst:font-ui rst:w-full rst:min-w-0",p),"data-step-progress":"segmented",children:[r.jsxs("div",{className:"rst:mb-1.5 rst:flex rst:items-baseline rst:justify-between rst:gap-3 rst:text-sm","aria-hidden":"true",children:[r.jsx("span",{className:"rst:font-medium rst:text-[var(--roster-control-text)]","data-step-position":"",children:u}),!d&&r.jsx("span",{className:"rst:min-w-0 rst:truncate rst:text-gray-600 rst:dark:text-gray-400","data-step-name":"",children:s[t-1]})]}),r.jsx(b.Progress,{variant:"segmented",segments:s.map((m,i)=>i+1<t?"done":i+1===t?"current":"remaining"),announce:!1}),r.jsx("span",{role:"status",className:"rst:sr-only","data-step-status":"",children:x})]}):r.jsxs("div",{className:l.cn("rst:font-ui rst:w-full",p),"data-step-progress":"stepper",children:[r.jsx("ol",{"aria-label":o.nav,className:"rst:m-0 rst:flex rst:w-full rst:list-none rst:p-0",children:s.map((m,i)=>{const a=i+1,e=a<t?"done":a===t?"current":"upcoming";return r.jsxs("li",{"aria-current":e==="current"?"step":void 0,className:"rst:relative rst:flex rst:min-w-0 rst:flex-1 rst:flex-col rst:items-center rst:gap-1.5 rst:text-center","data-step":e,children:[i>0&&r.jsx("span",{"aria-hidden":"true",className:l.cn("rst:absolute rst:right-1/2 rst:top-4 rst:h-0.5 rst:w-full rst:-translate-y-1/2",a<=t?"rst:bg-primary-600 rst:dark:bg-primary-400 rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[Highlight]":"rst:bg-[var(--roster-skeleton)] rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[GrayText]"),"data-step-connector":a<=t?"filled":"empty"}),r.jsx("span",{"aria-hidden":"true",className:l.cn("rst:relative rst:z-10 rst:flex rst:h-8 rst:w-8 rst:items-center rst:justify-center rst:rounded-full rst:text-sm rst:font-semibold rst:tabular-nums",e==="done"&&"rst:bg-primary-600 rst:text-primary-600-ink rst:dark:bg-primary-400 rst:dark:text-gray-950 rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[Highlight] rst:forced-colors:text-[HighlightText]",e==="current"&&"rst:border-2 rst:border-primary-600 rst:bg-[var(--roster-card-bg)] rst:text-primary-600 rst:dark:border-primary-400 rst:dark:text-primary-400",e==="upcoming"&&"rst:bg-[var(--roster-skeleton)] rst:text-gray-600 rst:dark:text-gray-300 rst:forced-colors:border"),"data-step-marker":"",children:e==="done"?r.jsx(j,{}):o.number(a)}),r.jsxs("span",{className:l.cn("rst:w-full rst:px-1 rst:text-xs rst:leading-4 rst:break-words",e==="current"?"rst:font-semibold rst:text-[var(--roster-control-text)]":"rst:text-gray-600 rst:dark:text-gray-400"),children:[m,e==="done"&&r.jsx("span",{className:"rst:sr-only",children:`, ${o.done}`})]})]},`${a}-${m}`)})}),r.jsx("span",{role:"status",className:"rst:sr-only","data-step-status":"",children:x})]})}exports.StepProgress=k;
@@ -22,6 +22,7 @@ export interface StepProgressProps {
22
22
  * come with them.
23
23
  */
24
24
  variant?: "stepper" | "segmented";
25
+ /** The component's own words, replaced; any left out stay English. */
25
26
  labels?: Partial<StepProgressLabels>;
26
27
  className?: string;
27
28
  }
@@ -1,15 +1,16 @@
1
1
  "use client";
2
2
  import { jsxs as l, jsx as r } from "react/jsx-runtime";
3
3
  import { cn as d } from "../../../lib/utils.js";
4
- import { Progress as b } from "../../atoms/Progress/Progress.js";
5
- const y = {
4
+ import { withLabels as b } from "../../../lib/labels.js";
5
+ import { Progress as y } from "../../atoms/Progress/Progress.js";
6
+ const k = {
6
7
  nav: "Progress",
7
8
  position: (s, c) => `Step ${s} of ${c}`,
8
9
  done: "done",
9
10
  number: (s) => String(s)
10
- }, k = () => /* @__PURE__ */ r("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { d: "M20 6 9 17l-5-5" }) });
11
- function j({ steps: s, current: c, variant: h = "stepper", labels: x, className: g }) {
12
- const n = { ...y, ...x }, a = s.length;
11
+ }, v = () => /* @__PURE__ */ r("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { d: "M20 6 9 17l-5-5" }) });
12
+ function L({ steps: s, current: c, variant: h = "stepper", labels: x, className: g }) {
13
+ const n = b(k, x), a = s.length;
13
14
  if (a === 0) return null;
14
15
  const t = Math.min(Math.max(1, Math.floor(Number.isFinite(c) ? c : 1)), a + 1), m = t > a, p = m ? n.position(a, a) : n.position(t, a), f = m ? p : `${p}: ${s[t - 1]}`;
15
16
  return h === "segmented" ? /* @__PURE__ */ l("div", { className: d("rst:font-ui rst:w-full rst:min-w-0", g), "data-step-progress": "segmented", children: [
@@ -18,7 +19,7 @@ function j({ steps: s, current: c, variant: h = "stepper", labels: x, className:
18
19
  !m && /* @__PURE__ */ r("span", { className: "rst:min-w-0 rst:truncate rst:text-gray-600 rst:dark:text-gray-400", "data-step-name": "", children: s[t - 1] })
19
20
  ] }),
20
21
  /* @__PURE__ */ r(
21
- b,
22
+ y,
22
23
  {
23
24
  variant: "segmented",
24
25
  segments: s.map((u, i) => i + 1 < t ? "done" : i + 1 === t ? "current" : "remaining"),
@@ -60,7 +61,7 @@ function j({ steps: s, current: c, variant: h = "stepper", labels: x, className:
60
61
  e === "upcoming" && "rst:bg-[var(--roster-skeleton)] rst:text-gray-600 rst:dark:text-gray-300 rst:forced-colors:border"
61
62
  ),
62
63
  "data-step-marker": "",
63
- children: e === "done" ? /* @__PURE__ */ r(k, {}) : n.number(o)
64
+ children: e === "done" ? /* @__PURE__ */ r(v, {}) : n.number(o)
64
65
  }
65
66
  ),
66
67
  /* @__PURE__ */ l(
@@ -85,5 +86,5 @@ function j({ steps: s, current: c, variant: h = "stepper", labels: x, className:
85
86
  ] });
86
87
  }
87
88
  export {
88
- j as StepProgress
89
+ L as StepProgress
89
90
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),b=require("react"),r=require("../../../lib/utils.cjs"),g=require("../../../hooks/useCountdown.cjs"),l=require("./countdown-variants.cjs"),a=({value:c,label:n,size:s,variant:e})=>t.jsxs("div",{className:"rst:flex rst:flex-col rst:items-center",children:[t.jsx("span",{className:r.cn(l.countdownNumberVariants({size:s,variant:e})),children:String(c).padStart(2,"0")}),t.jsx("span",{className:r.cn(l.countdownLabelVariants({size:s}),"rst:@max-[22rem]:text-[9px]"),children:n})]}),x=b.forwardRef(({targetDate:c,title:n,size:s,variant:e="gradient",className:o,completionText:u,...d},i)=>{const{days:m,hours:j,minutes:w,seconds:f,isFinished:h}=g.useCountdown(c);return h?u?t.jsx("div",{ref:i,className:r.cn("rst:font-bold rst:w-full rst:text-center rst:text-gray-900 rst:dark:text-gray-100",o),...d,children:t.jsx("h3",{className:r.cn(l.countdownTitleVariants({size:s}),"rst:mb-0"),children:u})}):null:t.jsx("div",{ref:i,className:r.cn("rst:font-bold rst:w-full rst:text-center rst:text-gray-900 rst:dark:text-gray-100",o),...d,children:t.jsxs("div",{className:"rst:@container rst:w-full",children:[n&&t.jsx("h3",{className:r.cn(l.countdownTitleVariants({size:s})),children:n}),t.jsxs("div",{className:"rst:flex rst:justify-center rst:gap-3 rst:@[22rem]:gap-6 rst:@[35rem]:gap-8",children:[t.jsx(a,{value:m,label:"Days",size:s,variant:e}),t.jsx(a,{value:j,label:"Hours",size:s,variant:e}),t.jsx(a,{value:w,label:"Minutes",size:s,variant:e}),t.jsx(a,{value:f,label:"Seconds",size:s,variant:e})]})]})})});x.displayName="Countdown";exports.Countdown=x;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),n=require("../../../lib/utils.cjs"),N=require("../../../lib/labels.cjs"),v=require("../../../hooks/useCountdown.cjs"),c=require("./countdown-variants.cjs"),l=({value:o,label:r,size:t,variant:e})=>s.jsxs("div",{className:"rst:flex rst:flex-col rst:items-center",children:[s.jsx("span",{className:n.cn(c.countdownNumberVariants({size:t,variant:e})),children:String(o).padStart(2,"0")}),s.jsx("span",{className:n.cn(c.countdownLabelVariants({size:t}),"rst:@max-[22rem]:text-[9px]"),children:r})]}),p={days:()=>"Days",hours:()=>"Hours",minutes:()=>"Minutes",seconds:()=>"Seconds"},b=g.forwardRef(({targetDate:o,title:r,size:t,variant:e="gradient",className:u,completionText:d,labels:f,...i},x)=>{const a=N.withLabels(p,f),{days:m,hours:h,minutes:j,seconds:w,isFinished:y}=v.useCountdown(o);return y?d?s.jsx("div",{ref:x,className:n.cn("rst:font-bold rst:w-full rst:text-center rst:text-gray-900 rst:dark:text-gray-100",u),...i,children:s.jsx("h3",{className:n.cn(c.countdownTitleVariants({size:t}),"rst:mb-0"),children:d})}):null:s.jsx("div",{ref:x,className:n.cn("rst:font-bold rst:w-full rst:text-center rst:text-gray-900 rst:dark:text-gray-100",u),...i,children:s.jsxs("div",{className:"rst:@container rst:w-full",children:[r&&s.jsx("h3",{className:n.cn(c.countdownTitleVariants({size:t})),children:r}),s.jsxs("div",{className:"rst:flex rst:justify-center rst:gap-3 rst:@[22rem]:gap-6 rst:@[35rem]:gap-8",children:[s.jsx(l,{value:m,label:a.days(m),size:t,variant:e}),s.jsx(l,{value:h,label:a.hours(h),size:t,variant:e}),s.jsx(l,{value:j,label:a.minutes(j),size:t,variant:e}),s.jsx(l,{value:w,label:a.seconds(w),size:t,variant:e})]})]})})});b.displayName="Countdown";exports.Countdown=b;
@@ -1,11 +1,24 @@
1
1
  import { default as React } from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import { countdownTitleVariants, countdownNumberVariants } from './countdown-variants';
4
+ /**
5
+ * Every word Countdown shows of its own. Pass any of them in `labels` to
6
+ * replace it. Each takes the number beside it, for a language whose word
7
+ * changes with the count.
8
+ */
9
+ export interface CountdownLabels {
10
+ days: (count: number) => string;
11
+ hours: (count: number) => string;
12
+ minutes: (count: number) => string;
13
+ seconds: (count: number) => string;
14
+ }
4
15
  export interface CountdownProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof countdownTitleVariants> {
5
16
  targetDate: Date;
6
17
  title?: string;
7
18
  completionText?: string;
8
19
  variant?: VariantProps<typeof countdownNumberVariants>["variant"];
20
+ /** Replaces the unit words under the numbers. */
21
+ labels?: Partial<CountdownLabels>;
9
22
  }
10
23
  declare const Countdown: React.ForwardRefExoticComponent<CountdownProps & React.RefAttributes<HTMLDivElement>>;
11
24
  export { Countdown };
@@ -1,89 +1,96 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
+ import { jsx as t, jsxs as d } from "react/jsx-runtime";
3
3
  import N from "react";
4
- import { cn as s } from "../../../lib/utils.js";
5
- import { useCountdown as b } from "../../../hooks/useCountdown.js";
6
- import { countdownTitleVariants as i, countdownNumberVariants as g, countdownLabelVariants as y } from "./countdown-variants.js";
7
- const n = ({ value: l, label: a, size: r, variant: e }) => /* @__PURE__ */ o("div", { className: "rst:flex rst:flex-col rst:items-center", children: [
8
- /* @__PURE__ */ t("span", { className: s(g({ size: r, variant: e })), children: String(l).padStart(2, "0") }),
4
+ import { cn as e } from "../../../lib/utils.js";
5
+ import { withLabels as g } from "../../../lib/labels.js";
6
+ import { useCountdown as v } from "../../../hooks/useCountdown.js";
7
+ import { countdownTitleVariants as w, countdownNumberVariants as C, countdownLabelVariants as L } from "./countdown-variants.js";
8
+ const l = ({ value: o, label: n, size: r, variant: s }) => /* @__PURE__ */ d("div", { className: "rst:flex rst:flex-col rst:items-center", children: [
9
+ /* @__PURE__ */ t("span", { className: e(C({ size: r, variant: s })), children: String(o).padStart(2, "0") }),
9
10
  /* @__PURE__ */ t(
10
11
  "span",
11
12
  {
12
- className: s(
13
- y({ size: r }),
13
+ className: e(
14
+ L({ size: r }),
14
15
  "rst:@max-[22rem]:text-[9px]"
15
16
  ),
16
- children: a
17
+ children: n
17
18
  }
18
19
  )
19
- ] }), v = N.forwardRef(
20
+ ] }), S = {
21
+ days: () => "Days",
22
+ hours: () => "Hours",
23
+ minutes: () => "Minutes",
24
+ seconds: () => "Seconds"
25
+ }, j = N.forwardRef(
20
26
  ({
21
- targetDate: l,
22
- title: a,
27
+ targetDate: o,
28
+ title: n,
23
29
  size: r,
24
- variant: e = "gradient",
25
- className: d,
26
- completionText: c,
27
- ...m
28
- }, u) => {
29
- const { days: f, hours: x, minutes: h, seconds: p, isFinished: w } = b(l);
30
- return w ? c ? /* @__PURE__ */ t(
30
+ variant: s = "gradient",
31
+ className: c,
32
+ completionText: m,
33
+ labels: b,
34
+ ...u
35
+ }, i) => {
36
+ const a = g(S, b), { days: f, hours: h, minutes: x, seconds: p, isFinished: y } = v(o);
37
+ return y ? m ? /* @__PURE__ */ t(
31
38
  "div",
32
39
  {
33
- ref: u,
34
- className: s(
40
+ ref: i,
41
+ className: e(
35
42
  "rst:font-bold rst:w-full rst:text-center rst:text-gray-900 rst:dark:text-gray-100",
36
- d
43
+ c
37
44
  ),
38
- ...m,
39
- children: /* @__PURE__ */ t("h3", { className: s(i({ size: r }), "rst:mb-0"), children: c })
45
+ ...u,
46
+ children: /* @__PURE__ */ t("h3", { className: e(w({ size: r }), "rst:mb-0"), children: m })
40
47
  }
41
48
  ) : null : /* @__PURE__ */ t(
42
49
  "div",
43
50
  {
44
- ref: u,
45
- className: s(
51
+ ref: i,
52
+ className: e(
46
53
  "rst:font-bold rst:w-full rst:text-center rst:text-gray-900 rst:dark:text-gray-100",
47
- d
54
+ c
48
55
  ),
49
- ...m,
50
- children: /* @__PURE__ */ o("div", { className: "rst:@container rst:w-full", children: [
51
- a && /* @__PURE__ */ t("h3", { className: s(i({ size: r })), children: a }),
52
- /* @__PURE__ */ o("div", { className: "rst:flex rst:justify-center rst:gap-3 rst:@[22rem]:gap-6 rst:@[35rem]:gap-8", children: [
56
+ ...u,
57
+ children: /* @__PURE__ */ d("div", { className: "rst:@container rst:w-full", children: [
58
+ n && /* @__PURE__ */ t("h3", { className: e(w({ size: r })), children: n }),
59
+ /* @__PURE__ */ d("div", { className: "rst:flex rst:justify-center rst:gap-3 rst:@[22rem]:gap-6 rst:@[35rem]:gap-8", children: [
53
60
  /* @__PURE__ */ t(
54
- n,
61
+ l,
55
62
  {
56
63
  value: f,
57
- label: "Days",
64
+ label: a.days(f),
58
65
  size: r,
59
- variant: e
66
+ variant: s
60
67
  }
61
68
  ),
62
69
  /* @__PURE__ */ t(
63
- n,
70
+ l,
64
71
  {
65
- value: x,
66
- label: "Hours",
72
+ value: h,
73
+ label: a.hours(h),
67
74
  size: r,
68
- variant: e
75
+ variant: s
69
76
  }
70
77
  ),
71
78
  /* @__PURE__ */ t(
72
- n,
79
+ l,
73
80
  {
74
- value: h,
75
- label: "Minutes",
81
+ value: x,
82
+ label: a.minutes(x),
76
83
  size: r,
77
- variant: e
84
+ variant: s
78
85
  }
79
86
  ),
80
87
  /* @__PURE__ */ t(
81
- n,
88
+ l,
82
89
  {
83
90
  value: p,
84
- label: "Seconds",
91
+ label: a.seconds(p),
85
92
  size: r,
86
- variant: e
93
+ variant: s
87
94
  }
88
95
  )
89
96
  ] })
@@ -92,7 +99,7 @@ const n = ({ value: l, label: a, size: r, variant: e }) => /* @__PURE__ */ o("di
92
99
  );
93
100
  }
94
101
  );
95
- v.displayName = "Countdown";
102
+ j.displayName = "Countdown";
96
103
  export {
97
- v as Countdown
104
+ j as Countdown
98
105
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("react"),a=require("@tanstack/react-table"),c=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),g=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),l=require("../../../lib/utils.cjs"),h=require("../../molecules/Pagination/Pagination.cjs"),r=require("../Table/Table.cjs"),T=a.tableFeatures({rowSortingFeature:a.rowSortingFeature,rowPaginationFeature:a.rowPaginationFeature,sortedRowModel:a.createSortedRowModel(),paginatedRowModel:a.createPaginatedRowModel(),sortFns:a.sortFns});function C({columns:i,data:d,className:u,tableClassName:x,paginationClassName:m,variant:p="default",size:f="md",hoverable:j=!1,paginationLabels:o}){const[w,b]=y.useState([]),s=a.useTable({features:T,data:d,columns:i,onSortingChange:b,state:{sorting:w},initialState:{pagination:{pageIndex:0,pageSize:10}}});return e.jsxs("div",{className:l.cn("rst:font-ui rst:flex rst:flex-col rst:gap-4",u),children:[e.jsxs(r.Table,{variant:p,size:f,hoverable:j,className:x,children:[e.jsx(r.TableHeader,{children:s.getHeaderGroups().map(n=>e.jsx(r.TableRow,{children:n.headers.map(t=>e.jsx(r.TableHead,{children:t.isPlaceholder?null:e.jsxs("div",{className:l.cn("rst:flex rst:items-center rst:gap-2 rst:transition-opacity",t.column.getCanSort()&&"rst:cursor-pointer rst:select-none rst:opacity-80 rst:hover:opacity-100"),onClick:t.column.getToggleSortingHandler(),children:[a.flexRender(t.column.columnDef.header,t.getContext()),t.column.getCanSort()&&e.jsx("span",{className:"rst:w-4 rst:flex rst:justify-center rst:text-primary-500",children:t.column.getIsSorted()==="asc"?e.jsx(c.FontAwesomeIcon,{icon:g.faCaretUp}):t.column.getIsSorted()==="desc"?e.jsx(c.FontAwesomeIcon,{icon:g.faCaretDown}):null})]})},t.id))},n.id))}),e.jsx(r.TableBody,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map(n=>e.jsx(r.TableRow,{children:n.getAllCells().map(t=>e.jsx(r.TableCell,{children:a.flexRender(t.column.columnDef.cell,t.getContext())},t.id))},n.id)):e.jsx(r.TableRow,{children:e.jsx(r.TableCell,{colSpan:i.length,className:"rst:h-24 rst:text-center rst:text-gray-500 rst:dark:text-gray-400 rst:italic",children:"No results found."})})})]}),e.jsxs("div",{className:l.cn("rst:flex rst:flex-col rst:sm:flex-row rst:items-center rst:justify-between rst:gap-4 rst:px-2",m),children:[e.jsx("div",{className:"rst:text-sm rst:font-medium rst:text-gray-500 rst:dark:text-gray-400",children:o?.status?o.status(s.state.pagination.pageIndex+1,s.getPageCount()):e.jsxs(e.Fragment,{children:["Page"," ",e.jsx("strong",{className:"rst:text-gray-900 rst:dark:text-gray-100",children:s.state.pagination.pageIndex+1})," ","of"," ",e.jsx("strong",{className:"rst:text-gray-900 rst:dark:text-gray-100",children:s.getPageCount()})]})}),e.jsx(h.Pagination,{layout:"arrows",align:"end",variant:"outline",page:s.state.pagination.pageIndex+1,pageCount:s.getPageCount(),onPageChange:n=>s.setPageIndex(n-1),labels:o})]})]})}exports.DataTable=C;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),a=require("@tanstack/react-table"),c=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),g=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),l=require("../../../lib/utils.cjs"),T=require("../../molecules/Pagination/Pagination.cjs"),r=require("../Table/Table.cjs"),C=a.tableFeatures({rowSortingFeature:a.rowSortingFeature,rowPaginationFeature:a.rowPaginationFeature,sortedRowModel:a.createSortedRowModel(),paginatedRowModel:a.createPaginatedRowModel(),sortFns:a.sortFns});function S({columns:i,data:d,className:u,tableClassName:x,paginationClassName:m,variant:p="default",size:f="md",hoverable:j=!1,paginationLabels:o,emptyMessage:w="No results found."}){const[b,y]=h.useState([]),s=a.useTable({features:C,data:d,columns:i,onSortingChange:y,state:{sorting:b},initialState:{pagination:{pageIndex:0,pageSize:10}}});return e.jsxs("div",{className:l.cn("rst:font-ui rst:flex rst:flex-col rst:gap-4",u),children:[e.jsxs(r.Table,{variant:p,size:f,hoverable:j,className:x,children:[e.jsx(r.TableHeader,{children:s.getHeaderGroups().map(n=>e.jsx(r.TableRow,{children:n.headers.map(t=>e.jsx(r.TableHead,{children:t.isPlaceholder?null:e.jsxs("div",{className:l.cn("rst:flex rst:items-center rst:gap-2 rst:transition-opacity",t.column.getCanSort()&&"rst:cursor-pointer rst:select-none rst:opacity-80 rst:hover:opacity-100"),onClick:t.column.getToggleSortingHandler(),children:[a.flexRender(t.column.columnDef.header,t.getContext()),t.column.getCanSort()&&e.jsx("span",{className:"rst:w-4 rst:flex rst:justify-center rst:text-primary-500",children:t.column.getIsSorted()==="asc"?e.jsx(c.FontAwesomeIcon,{icon:g.faCaretUp}):t.column.getIsSorted()==="desc"?e.jsx(c.FontAwesomeIcon,{icon:g.faCaretDown}):null})]})},t.id))},n.id))}),e.jsx(r.TableBody,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map(n=>e.jsx(r.TableRow,{children:n.getAllCells().map(t=>e.jsx(r.TableCell,{children:a.flexRender(t.column.columnDef.cell,t.getContext())},t.id))},n.id)):e.jsx(r.TableRow,{children:e.jsx(r.TableCell,{colSpan:i.length,className:"rst:h-24 rst:text-center rst:text-gray-500 rst:dark:text-gray-400 rst:italic",children:w})})})]}),e.jsxs("div",{className:l.cn("rst:flex rst:flex-col rst:sm:flex-row rst:items-center rst:justify-between rst:gap-4 rst:px-2",m),children:[e.jsx("div",{className:"rst:text-sm rst:font-medium rst:text-gray-500 rst:dark:text-gray-400",children:o?.status?o.status(s.state.pagination.pageIndex+1,s.getPageCount()):e.jsxs(e.Fragment,{children:["Page"," ",e.jsx("strong",{className:"rst:text-gray-900 rst:dark:text-gray-100",children:s.state.pagination.pageIndex+1})," ","of"," ",e.jsx("strong",{className:"rst:text-gray-900 rst:dark:text-gray-100",children:s.getPageCount()})]})}),e.jsx(T.Pagination,{layout:"arrows",align:"end",variant:"outline",page:s.state.pagination.pageIndex+1,pageCount:s.getPageCount(),onPageChange:n=>s.setPageIndex(n-1),labels:o})]})]})}exports.DataTable=S;
@@ -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. ("No results found." is
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 S } from "react/jsx-runtime";
3
- import { useState as b } from "react";
4
- import { useTable as N, flexRender as c, tableFeatures as P, sortFns as T, rowPaginationFeature as I, rowSortingFeature as R, createPaginatedRowModel as F, createSortedRowModel as v } from "@tanstack/react-table";
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 M, faCaretDown as k } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
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 j } from "../../molecules/Pagination/Pagination.js";
9
- import { Table as D, TableHeader as H, TableRow as l, TableHead as A, TableBody as z, TableCell as d } from "../Table/Table.js";
10
- const B = /* @__PURE__ */ P({
11
- rowSortingFeature: R,
12
- rowPaginationFeature: I,
13
- sortedRowModel: v(),
14
- paginatedRowModel: F(),
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: T
17
+ sortFns: I
18
18
  });
19
- function V({
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 [y, C] = b([]), r = N({
31
- features: B,
31
+ const [C, S] = N([]), r = P({
32
+ features: U,
32
33
  data: m,
33
34
  columns: i,
34
- onSortingChange: C,
35
+ onSortingChange: S,
35
36
  state: {
36
- sorting: y
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
- D,
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(H, { children: r.getHeaderGroups().map((a) => /* @__PURE__ */ t(l, { children: a.headers.map((e) => /* @__PURE__ */ t(A, { children: e.isPlaceholder ? null : /* @__PURE__ */ s(
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: M }) : e.column.getIsSorted() === "desc" ? /* @__PURE__ */ t(g, { icon: k }) : null })
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(z, { children: r.getRowModel().rows?.length ? (
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: "No results found."
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(S, { children: [
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
- j,
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
- V as DataTable
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"),h=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),k=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"),j=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"),w=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"}}),N=o.cva("rst:text-xl rst:font-bold rst:leading-6 rst:text-inherit"),_=o.cva("rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75"),q=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"),F=({isOpen:u,onClose:i,title:m,description:n,size:x,variant:l,status:g,children:f,className:v,onAfterClose:b})=>{const[p,y]=t.useState(!1);t.useLayoutEffect(()=>{y(!0)},[]);const e=u&&p,c=t.useRef(null);return t.useLayoutEffect(()=>{if(e)return j.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:b,children:r.jsxs(a.DialogPanel,{className:s.cn(w({size:x,variant:l,status:g}),v),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(N()),children:m}),n&&r.jsx("p",{className:s.cn(_()),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(q()),"aria-label":"Close dialog",children:r.jsx(h.FontAwesomeIcon,{icon:k.faXmark,className:"rst:h-5 rst:w-5"})})})]}),r.jsx("div",{className:"rst:mt-6",children:f})]})})})})]})]})};exports.Dialog=F;
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 };