@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,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as u, Fragment as I, jsx as
|
|
3
|
-
import { useId as
|
|
2
|
+
import { jsxs as u, Fragment as I, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useId as rt, useState as X, useRef as et, useMemo as st } from "react";
|
|
4
4
|
import { cn as x } from "../../../lib/utils.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
5
|
+
import { withLabels as at } from "../../../lib/labels.js";
|
|
6
|
+
import { Button as nt } from "../../atoms/Button/Button.js";
|
|
7
|
+
import { buttonVariants as it } from "../../atoms/Button/button-variants.js";
|
|
8
|
+
import { selectTriggerVariants as lt } from "../../atoms/Select/select-variants.js";
|
|
9
|
+
import { clampPage as ot, pageItems as ct } from "./page-items.js";
|
|
10
|
+
const dt = {
|
|
10
11
|
nav: "Pagination",
|
|
11
12
|
page: (t) => `Page ${t}`,
|
|
12
13
|
number: (t) => String(t),
|
|
@@ -21,8 +22,8 @@ const ct = {
|
|
|
21
22
|
of: (t) => `of ${t}`,
|
|
22
23
|
status: (t, i) => `Page ${t} of ${i}`
|
|
23
24
|
};
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
function ut({ href: t, className: i, children: c, onClick: o, ...p }) {
|
|
26
|
+
return /* @__PURE__ */ r(
|
|
26
27
|
"a",
|
|
27
28
|
{
|
|
28
29
|
href: t,
|
|
@@ -35,8 +36,8 @@ function dt({ href: t, className: i, children: c, onClick: o, ...p }) {
|
|
|
35
36
|
}
|
|
36
37
|
);
|
|
37
38
|
}
|
|
38
|
-
const
|
|
39
|
-
function
|
|
39
|
+
const pt = "rst:h-11 rst:min-w-11 rst:px-2", ft = "rst:cursor-not-allowed rst:opacity-50", mt = "rst:forced-colors:border-2 rst:forced-colors:underline rst:forced-colors:decoration-2 rst:forced-colors:underline-offset-4", Y = { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0 }, j = ({ dir: t, double: i = !1 }) => /* @__PURE__ */ r("svg", { ...Y, className: "rst:shrink-0", children: t === "left" ? i ? /* @__PURE__ */ r("path", { d: "m11 17-5-5 5-5M18 17l-5-5 5-5" }) : /* @__PURE__ */ r("path", { d: "m15 18-6-6 6-6" }) : i ? /* @__PURE__ */ r("path", { d: "m13 17 5-5-5-5M6 17l5-5-5-5" }) : /* @__PURE__ */ r("path", { d: "m9 18 6-6-6-6" }) });
|
|
40
|
+
function ht({
|
|
40
41
|
id: t,
|
|
41
42
|
describedBy: i,
|
|
42
43
|
page: c,
|
|
@@ -44,13 +45,13 @@ function mt({
|
|
|
44
45
|
number: p,
|
|
45
46
|
onCommit: P
|
|
46
47
|
}) {
|
|
47
|
-
const [d, N] = X(null), f =
|
|
48
|
+
const [d, N] = X(null), f = et(!1), v = d && d.page === c ? d.value : null, y = (l) => {
|
|
48
49
|
N(null), l !== c && P(l);
|
|
49
50
|
}, $ = st(
|
|
50
|
-
() => Array.from({ length: o }, (l, m) => /* @__PURE__ */
|
|
51
|
+
() => Array.from({ length: o }, (l, m) => /* @__PURE__ */ r("option", { value: m + 1, children: p(m + 1) }, m + 1)),
|
|
51
52
|
[o, p]
|
|
52
53
|
);
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ r(
|
|
54
55
|
"select",
|
|
55
56
|
{
|
|
56
57
|
id: t,
|
|
@@ -78,7 +79,7 @@ function mt({
|
|
|
78
79
|
v !== null && y(v);
|
|
79
80
|
},
|
|
80
81
|
className: x(
|
|
81
|
-
|
|
82
|
+
lt({ variant: "outline" }),
|
|
82
83
|
/* 16px: iOS zooms the page into a select whose text is smaller. */
|
|
83
84
|
"rst:h-11 rst:w-auto rst:min-w-16 rst:appearance-none rst:pl-3 rst:pr-8 rst:text-base rst:tabular-nums"
|
|
84
85
|
),
|
|
@@ -87,7 +88,7 @@ function mt({
|
|
|
87
88
|
}
|
|
88
89
|
);
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function $t({
|
|
91
92
|
page: t,
|
|
92
93
|
pageCount: i,
|
|
93
94
|
onPageChange: c,
|
|
@@ -103,20 +104,20 @@ function kt({
|
|
|
103
104
|
labels: l,
|
|
104
105
|
className: m
|
|
105
106
|
}) {
|
|
106
|
-
const a =
|
|
107
|
+
const a = at(dt, l), h = Number.isFinite(i) ? Math.max(0, Math.floor(i)) : 0, n = ot(t, h), S = rt(), Z = p ?? ut, [T, H] = X({ page: n, text: "" });
|
|
107
108
|
T.page !== n && H({ page: n, text: $ ? a.status(n, h) : "" });
|
|
108
|
-
const D = (
|
|
109
|
-
|
|
110
|
-
}, w = (
|
|
111
|
-
const g =
|
|
109
|
+
const D = (e) => {
|
|
110
|
+
e !== Math.floor(t) && c?.(e);
|
|
111
|
+
}, w = (e, s, k, F) => {
|
|
112
|
+
const g = e === "page" && s === n, L = s === null, q = x(pt, L && ft, g && mt, F.className), J = e === "page" ? `page-${s}` : e;
|
|
112
113
|
if (o) {
|
|
113
114
|
const Q = o(s ?? n);
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ r(
|
|
115
116
|
Z,
|
|
116
117
|
{
|
|
117
118
|
href: Q,
|
|
118
119
|
to: Q,
|
|
119
|
-
className: x(
|
|
120
|
+
className: x(it({ variant: g ? "solid" : y, colorScheme: g ? "primary" : "neutral" }), q),
|
|
120
121
|
"aria-label": F.label,
|
|
121
122
|
"aria-current": g ? "page" : void 0,
|
|
122
123
|
"aria-disabled": L ? !0 : void 0,
|
|
@@ -132,8 +133,8 @@ function kt({
|
|
|
132
133
|
J
|
|
133
134
|
);
|
|
134
135
|
}
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
|
|
136
|
+
return /* @__PURE__ */ r(
|
|
137
|
+
nt,
|
|
137
138
|
{
|
|
138
139
|
type: "button",
|
|
139
140
|
variant: g ? "solid" : y,
|
|
@@ -149,42 +150,42 @@ function kt({
|
|
|
149
150
|
},
|
|
150
151
|
J
|
|
151
152
|
);
|
|
152
|
-
}, B = n > 1 ? n - 1 : null, K = n < h ? n + 1 : null, R = n > 1 ? 1 : null, O = n < h ? h : null, M = (
|
|
153
|
+
}, B = n > 1 ? n - 1 : null, K = n < h ? n + 1 : null, R = n > 1 ? 1 : null, O = n < h ? h : null, M = (e) => w(
|
|
153
154
|
"previous",
|
|
154
155
|
B,
|
|
155
156
|
/* @__PURE__ */ u(I, { children: [
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
|
|
157
|
+
/* @__PURE__ */ r(j, { dir: "left" }),
|
|
158
|
+
e && /* @__PURE__ */ r("span", { className: "rst:hidden rst:pr-1 rst:@[36rem]:inline", children: a.previous })
|
|
158
159
|
] }),
|
|
159
160
|
{ label: a.previousPage(B) }
|
|
160
|
-
), A = (
|
|
161
|
+
), A = (e) => w(
|
|
161
162
|
"next",
|
|
162
163
|
K,
|
|
163
164
|
/* @__PURE__ */ u(I, { children: [
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
e && /* @__PURE__ */ r("span", { className: "rst:hidden rst:pl-1 rst:@[36rem]:inline", children: a.next }),
|
|
166
|
+
/* @__PURE__ */ r(j, { dir: "right" })
|
|
166
167
|
] }),
|
|
167
168
|
{ label: a.nextPage(K) }
|
|
168
|
-
), V = (
|
|
169
|
+
), V = (e) => w("first", R, /* @__PURE__ */ r(j, { dir: "left", double: !0 }), {
|
|
169
170
|
label: a.firstPage(R),
|
|
170
|
-
className:
|
|
171
|
-
}), _ = (
|
|
171
|
+
className: e ? "rst:hidden rst:@[24rem]:inline-flex" : void 0
|
|
172
|
+
}), _ = (e) => w("last", O, /* @__PURE__ */ r(j, { dir: "right", double: !0 }), {
|
|
172
173
|
label: a.lastPage(O),
|
|
173
|
-
className:
|
|
174
|
-
}), C = "rst:flex rst:flex-wrap rst:items-center rst:gap-1", E = { start: "rst:justify-start", center: "rst:justify-center", end: "rst:justify-end" }[v], z = (
|
|
174
|
+
className: e ? "rst:hidden rst:@[24rem]:inline-flex" : void 0
|
|
175
|
+
}), C = "rst:flex rst:flex-wrap rst:items-center rst:gap-1", E = { start: "rst:justify-start", center: "rst:justify-center", end: "rst:justify-end" }[v], z = (e) => /* @__PURE__ */ u("div", { className: x(C, E, e), "data-pagination-layout": "pages", children: [
|
|
175
176
|
M(!0),
|
|
176
|
-
|
|
177
|
-
(s) => typeof s == "number" ? w("page", s, a.number(s), { label: a.page(s) }) : /* @__PURE__ */
|
|
177
|
+
ct(n, h, N).map(
|
|
178
|
+
(s) => typeof s == "number" ? w("page", s, a.number(s), { label: a.page(s) }) : /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "rst:inline-flex rst:h-11 rst:w-11 rst:items-center rst:justify-center rst:text-sm rst:text-gray-500 rst:dark:text-gray-400", children: a.gap }, s)
|
|
178
179
|
),
|
|
179
180
|
A(!0)
|
|
180
|
-
] }), G = `${S}-picker`, U = `${S}-of`, W = (
|
|
181
|
+
] }), G = `${S}-picker`, U = `${S}-of`, W = (e) => /* @__PURE__ */ u("div", { className: x(C, E, e), "data-pagination-layout": "compact", children: [
|
|
181
182
|
f && V(!0),
|
|
182
183
|
M(!1),
|
|
183
184
|
/* @__PURE__ */ u("div", { className: "rst:flex rst:items-center rst:gap-2 rst:px-1 rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)]", children: [
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ r("label", { htmlFor: G, children: a.picker }),
|
|
185
186
|
/* @__PURE__ */ u("span", { className: "rst:relative rst:inline-flex", children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
187
|
+
/* @__PURE__ */ r(
|
|
188
|
+
ht,
|
|
188
189
|
{
|
|
189
190
|
id: G,
|
|
190
191
|
describedBy: U,
|
|
@@ -200,9 +201,9 @@ function kt({
|
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ r("svg", { ...Y, width: 16, height: 16, className: "rst:pointer-events-none rst:absolute rst:right-2.5 rst:top-1/2 rst:-translate-y-1/2 rst:text-gray-500 rst:dark:text-gray-400", children: /* @__PURE__ */ r("path", { d: "m6 9 6 6 6-6" }) })
|
|
204
205
|
] }),
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ r("span", { id: U, className: "rst:tabular-nums", children: a.of(h) })
|
|
206
207
|
] }),
|
|
207
208
|
A(!1),
|
|
208
209
|
f && _(!0)
|
|
@@ -236,12 +237,12 @@ function kt({
|
|
|
236
237
|
z("rst:hidden rst:@[28rem]:flex"),
|
|
237
238
|
W("rst:@[28rem]:hidden")
|
|
238
239
|
] }),
|
|
239
|
-
$ && /* @__PURE__ */
|
|
240
|
+
$ && /* @__PURE__ */ r("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", className: "rst:sr-only", "data-pagination-live": "", children: T.text })
|
|
240
241
|
]
|
|
241
242
|
}
|
|
242
243
|
)
|
|
243
244
|
);
|
|
244
245
|
}
|
|
245
246
|
export {
|
|
246
|
-
|
|
247
|
+
$t as Pagination
|
|
247
248
|
};
|
|
@@ -7,6 +7,7 @@ export interface ProgressFieldProps extends Pick<ProgressProps, "value" | "max"
|
|
|
7
7
|
valueText?: string;
|
|
8
8
|
/** A line under the bar: bytes, a step counter, a time left. */
|
|
9
9
|
detail?: ReactNode;
|
|
10
|
+
/** The component's own words, replaced; any left out stay English. */
|
|
10
11
|
labels?: Partial<ProgressLabels>;
|
|
11
12
|
className?: string;
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../../lib/utils.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../../lib/utils.cjs"),x=require("../../atoms/Card/Card.cjs"),m=require("../../atoms/Eyebrow/Eyebrow.cjs"),c=require("../../atoms/Stat/stat-variants.cjs"),h=require("../../organisms/Table/Table.cjs"),t=require("../../atoms/Skeleton/Skeleton.cjs");function j({media:r,lines:a=3,variant:s,padding:i,className:n}){return e.jsxs(x.Card,{variant:s,padding:i,className:n,"aria-hidden":"true","data-skeleton":"card",children:[r!==void 0&&e.jsx(t.Skeleton,{shape:"block",height:r,className:"rst:mb-4"}),e.jsx(t.Skeleton,{size:"lg",width:"45%"}),a>0&&e.jsx(t.Skeleton,{size:"md",lines:a,className:"rst:mt-2"})]})}function S({columns:r,className:a}){const s=["70%","50%","60%","40%"];return e.jsx(h.TableRow,{"aria-hidden":"true",className:a,"data-skeleton":"table-row",children:Array.from({length:Math.max(1,r)},(i,n)=>e.jsx(h.TableCell,{children:e.jsx(t.Skeleton,{size:"inherit",width:s[n%s.length]})},n))})}function k({size:r="md",withName:a=!1,className:s}){return a?e.jsxs("span",{"aria-hidden":"true",className:l.cn("rst:flex rst:items-center rst:gap-3",s),"data-skeleton":"avatar",children:[e.jsx(t.Skeleton,{shape:"circle",size:r}),e.jsx(t.Skeleton,{size:"md",width:"8rem"})]}):e.jsx(t.Skeleton,{shape:"circle",size:r,className:s})}function w({size:r="md",semantics:a="definition",source:s=!1,className:i}){const n=c.statValueVariants({size:r,colorScheme:"neutral"}),o=e.jsx(t.Skeleton,{size:"inherit",width:"2.5em"}),d=e.jsx(m.Eyebrow,{size:"xs",children:e.jsx(t.Skeleton,{size:"inherit",width:"9em"})}),u=e.jsx("span",{className:c.statSourceClass,children:e.jsx(t.Skeleton,{size:"inherit",width:"12em"})});return a==="standalone"?e.jsxs("span",{"aria-hidden":"true",className:l.cn("rst:flex rst:flex-col rst:gap-[3px]",i),"data-skeleton":"stat",children:[e.jsx("span",{className:n,children:o}),d,s&&u]}):e.jsxs("div",{"aria-hidden":"true",className:l.cn("rst:grid rst:content-start rst:gap-[3px]",i),"data-skeleton":"stat",children:[e.jsx("dt",{className:"rst:relative rst:col-start-1 rst:row-start-2 rst:flex",children:d}),s?e.jsxs("dd",{className:l.cn("rst:m-0",n,"rst:col-start-1 rst:row-span-3 rst:row-start-1 rst:grid rst:grid-rows-subgrid"),children:[e.jsx("span",{className:"rst:row-start-1",children:o}),e.jsx("span",{className:l.cn(c.statSourceClass,"rst:row-start-3"),children:e.jsx(t.Skeleton,{size:"inherit",width:"12em"})})]}):e.jsx("dd",{className:l.cn("rst:m-0 rst:col-start-1 rst:row-start-1",n),children:o})]})}exports.SkeletonAvatar=k;exports.SkeletonCard=j;exports.SkeletonStat=w;exports.SkeletonTableRow=S;
|
|
@@ -48,8 +48,8 @@ export interface SkeletonStatProps {
|
|
|
48
48
|
/**
|
|
49
49
|
* A Stat loading. Stat's own markup in each of its forms, with lines in place
|
|
50
50
|
* of its words, so the figure that arrives is the height of what held it:
|
|
51
|
-
* the label is the real Eyebrow,
|
|
52
|
-
*
|
|
51
|
+
* the label is the real Eyebrow, a flex item where Stat's is, so it makes the
|
|
52
|
+
* same line.
|
|
53
53
|
*/
|
|
54
54
|
declare function SkeletonStat({ size, semantics, source, className }: SkeletonStatProps): import("react/jsx-runtime").JSX.Element;
|
|
55
55
|
export { SkeletonCard, SkeletonTableRow, SkeletonAvatar, SkeletonStat };
|
|
@@ -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
|
|
5
|
-
import { Eyebrow as
|
|
6
|
-
import { statValueVariants as
|
|
7
|
-
import { TableRow as
|
|
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
|
|
10
|
-
return /* @__PURE__ */ o(
|
|
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
|
|
16
|
+
function T({ columns: s, className: a }) {
|
|
17
17
|
const e = ["70%", "50%", "60%", "40%"];
|
|
18
|
-
return /* @__PURE__ */ t(
|
|
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
|
|
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
|
|
27
|
-
const i =
|
|
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
|
|
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
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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"),
|
|
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;
|
|
@@ -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 {
|
|
5
|
-
|
|
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
|
-
},
|
|
11
|
-
function
|
|
12
|
-
const n =
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
89
|
+
L as StepProgress
|
|
89
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
|
2
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
import N from "react";
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
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:
|
|
13
|
-
|
|
13
|
+
className: e(
|
|
14
|
+
L({ size: r }),
|
|
14
15
|
"rst:@max-[22rem]:text-[9px]"
|
|
15
16
|
),
|
|
16
|
-
children:
|
|
17
|
+
children: n
|
|
17
18
|
}
|
|
18
19
|
)
|
|
19
|
-
] }),
|
|
20
|
+
] }), S = {
|
|
21
|
+
days: () => "Days",
|
|
22
|
+
hours: () => "Hours",
|
|
23
|
+
minutes: () => "Minutes",
|
|
24
|
+
seconds: () => "Seconds"
|
|
25
|
+
}, j = N.forwardRef(
|
|
20
26
|
({
|
|
21
|
-
targetDate:
|
|
22
|
-
title:
|
|
27
|
+
targetDate: o,
|
|
28
|
+
title: n,
|
|
23
29
|
size: r,
|
|
24
|
-
variant:
|
|
25
|
-
className:
|
|
26
|
-
completionText:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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:
|
|
34
|
-
className:
|
|
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
|
-
|
|
43
|
+
c
|
|
37
44
|
),
|
|
38
|
-
...
|
|
39
|
-
children: /* @__PURE__ */ t("h3", { className:
|
|
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:
|
|
45
|
-
className:
|
|
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
|
-
|
|
54
|
+
c
|
|
48
55
|
),
|
|
49
|
-
...
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
61
|
+
l,
|
|
55
62
|
{
|
|
56
63
|
value: f,
|
|
57
|
-
label:
|
|
64
|
+
label: a.days(f),
|
|
58
65
|
size: r,
|
|
59
|
-
variant:
|
|
66
|
+
variant: s
|
|
60
67
|
}
|
|
61
68
|
),
|
|
62
69
|
/* @__PURE__ */ t(
|
|
63
|
-
|
|
70
|
+
l,
|
|
64
71
|
{
|
|
65
|
-
value:
|
|
66
|
-
label:
|
|
72
|
+
value: h,
|
|
73
|
+
label: a.hours(h),
|
|
67
74
|
size: r,
|
|
68
|
-
variant:
|
|
75
|
+
variant: s
|
|
69
76
|
}
|
|
70
77
|
),
|
|
71
78
|
/* @__PURE__ */ t(
|
|
72
|
-
|
|
79
|
+
l,
|
|
73
80
|
{
|
|
74
|
-
value:
|
|
75
|
-
label:
|
|
81
|
+
value: x,
|
|
82
|
+
label: a.minutes(x),
|
|
76
83
|
size: r,
|
|
77
|
-
variant:
|
|
84
|
+
variant: s
|
|
78
85
|
}
|
|
79
86
|
),
|
|
80
87
|
/* @__PURE__ */ t(
|
|
81
|
-
|
|
88
|
+
l,
|
|
82
89
|
{
|
|
83
90
|
value: p,
|
|
84
|
-
label:
|
|
91
|
+
label: a.seconds(p),
|
|
85
92
|
size: r,
|
|
86
|
-
variant:
|
|
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
|
-
|
|
102
|
+
j.displayName = "Countdown";
|
|
96
103
|
export {
|
|
97
|
-
|
|
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"),
|
|
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;
|