@blakesteve/roster 4.2.1 → 4.3.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 +52 -0
- package/dist/{Table-Cqm_mtRS.cjs → Table-B3KkU-Bc.cjs} +9 -9
- package/dist/{Table-BaJ8qfrV.js → Table-CJZFk__H.js} +724 -724
- package/dist/components/atoms/AvatarStrip/AvatarStrip.d.ts +7 -1
- package/dist/components/organisms/ActionBar/action-bar-variants.d.ts +1 -1
- package/dist/components/organisms/Navbar/Navbar.d.ts +1 -1
- package/dist/data-table.cjs.js +1 -1
- package/dist/data-table.es.js +42 -42
- package/dist/roster.cjs.js +2 -2
- package/dist/roster.css +1 -1
- package/dist/roster.es.js +4124 -4124
- package/dist/utils-C7BfXGiM.cjs +1 -0
- package/dist/{utils-DtaLkIY8.js → utils-hNxf9HpA.js} +409 -390
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +1 -1
- package/package.json +4 -3
- package/dist/utils-D2U2F80P.cjs +0 -1
|
@@ -38,7 +38,13 @@ export interface AvatarStripProps {
|
|
|
38
38
|
/**
|
|
39
39
|
* Tailwind class that sets the ring color around each avatar and the overflow chip.
|
|
40
40
|
* Should match the background the strip is rendered on to produce the cutout stack effect.
|
|
41
|
-
*
|
|
41
|
+
*
|
|
42
|
+
* Pass your own classes unprefixed, exactly as you write them in your app —
|
|
43
|
+
* they land in your `utilities` layer and win, which is the point of the prop.
|
|
44
|
+
* Only Roster's default carries the `rst:` prefix, so a host that happens to
|
|
45
|
+
* use `ring-white` itself cannot silently repaint the strip.
|
|
46
|
+
*
|
|
47
|
+
* Default: `"rst:ring-white rst:dark:ring-gray-900"`.
|
|
42
48
|
*/
|
|
43
49
|
ringClass?: string;
|
|
44
50
|
/** Extra classes applied to the outermost `<div>`. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const actionBarVariants: (props?: ({
|
|
2
2
|
variant?: "primary" | "default" | "soft" | "transparent" | null | undefined;
|
|
3
|
-
position?: "
|
|
3
|
+
position?: "bottom" | "top" | "static" | null | undefined;
|
|
4
4
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -27,7 +27,7 @@ export interface NavbarProps extends React.HTMLAttributes<HTMLElement>, VariantP
|
|
|
27
27
|
logoSize?: string | number;
|
|
28
28
|
/**
|
|
29
29
|
* Classes applied to the logo image. Replaces the default rounding, so a
|
|
30
|
-
* circular mark can pass `"rounded-full"` and a square one `""`.
|
|
30
|
+
* circular mark can pass `"rst:rounded-full"` and a square one `""`.
|
|
31
31
|
*/
|
|
32
32
|
logoClassName?: string;
|
|
33
33
|
brandName: string;
|
package/dist/data-table.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-B3KkU-Bc.cjs"),p=require("react"),r=require("@tanstack/react-table"),o=require("./utils-C7BfXGiM.cjs"),R=r.tableFeatures({rowSortingFeature:r.rowSortingFeature,rowPaginationFeature:r.rowPaginationFeature,sortedRowModel:r.createSortedRowModel(),paginatedRowModel:r.createPaginatedRowModel(),sortFns:r.sortFns});function f({columns:a,data:i,className:l,tableClassName:x,paginationClassName:c,variant:u="default",size:g="md",hoverable:m=!1}){const[d,j]=p.useState([]),t=r.useTable({features:R,data:i,columns:a,onSortingChange:j,state:{sorting:d},initialState:{pagination:{pageIndex:0,pageSize:10}}});return e.jsxRuntimeExports.jsxs("div",{className:o.cn("rst:flex rst:flex-col rst:gap-4",l),children:[e.jsxRuntimeExports.jsxs(e.Table,{variant:u,size:g,hoverable:m,className:x,children:[e.jsxRuntimeExports.jsx(e.TableHeader,{children:t.getHeaderGroups().map(n=>e.jsxRuntimeExports.jsx(e.TableRow,{children:n.headers.map(s=>e.jsxRuntimeExports.jsx(e.TableHead,{children:s.isPlaceholder?null:e.jsxRuntimeExports.jsxs("div",{className:o.cn("rst:flex rst:items-center rst:gap-2 rst:transition-opacity",s.column.getCanSort()&&"rst:cursor-pointer rst:select-none rst:opacity-80 rst:hover:opacity-100"),onClick:s.column.getToggleSortingHandler(),children:[r.flexRender(s.column.columnDef.header,s.getContext()),s.column.getCanSort()&&e.jsxRuntimeExports.jsx("span",{className:"rst:w-4 rst:flex rst:justify-center rst:text-primary-500",children:s.column.getIsSorted()==="asc"?e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faCaretUp}):s.column.getIsSorted()==="desc"?e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faCaretDown}):null})]})},s.id))},n.id))}),e.jsxRuntimeExports.jsx(e.TableBody,{children:t.getRowModel().rows?.length?t.getRowModel().rows.map(n=>e.jsxRuntimeExports.jsx(e.TableRow,{children:n.getAllCells().map(s=>e.jsxRuntimeExports.jsx(e.TableCell,{children:r.flexRender(s.column.columnDef.cell,s.getContext())},s.id))},n.id)):e.jsxRuntimeExports.jsx(e.TableRow,{children:e.jsxRuntimeExports.jsx(e.TableCell,{colSpan:a.length,className:"rst:h-24 rst:text-center rst:text-gray-500 rst:dark:text-gray-400 rst:italic",children:"No results found."})})})]}),e.jsxRuntimeExports.jsxs("div",{className:o.cn("rst:flex rst:flex-col rst:sm:flex-row rst:items-center rst:justify-between rst:gap-4 rst:px-2",c),children:[e.jsxRuntimeExports.jsxs("div",{className:"rst:text-sm rst:font-medium rst:text-gray-500 rst:dark:text-gray-400",children:["Page"," ",e.jsxRuntimeExports.jsx("strong",{className:"rst:text-gray-900 rst:dark:text-gray-100",children:t.state.pagination.pageIndex+1})," ","of"," ",e.jsxRuntimeExports.jsx("strong",{className:"rst:text-gray-900 rst:dark:text-gray-100",children:t.getPageCount()})]}),e.jsxRuntimeExports.jsxs("div",{className:"rst:flex rst:items-center rst:space-x-2",children:[e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),"aria-label":"Go to first page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAnglesLeft})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),"aria-label":"Go to previous page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAngleLeft})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),"aria-label":"Go to next page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAngleRight})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),"aria-label":"Go to last page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAnglesRight})})]})]})]})}exports.DataTable=f;
|
package/dist/data-table.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as e, T as C, a as S, b as
|
|
2
|
+
import { j as e, T as C, a as S, b as l, c as P, F as a, f as w, d as y, e as v, g as c, B as n, h as N, i as R, k as T, l as k } from "./Table-CJZFk__H.js";
|
|
3
3
|
import { useState as F } from "react";
|
|
4
4
|
import { tableFeatures as I, sortFns as A, rowPaginationFeature as M, rowSortingFeature as z, createPaginatedRowModel as D, createSortedRowModel as G, useTable as H, flexRender as g } from "@tanstack/react-table";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as o } from "./utils-hNxf9HpA.js";
|
|
6
6
|
const B = I({
|
|
7
7
|
rowSortingFeature: z,
|
|
8
8
|
rowPaginationFeature: M,
|
|
@@ -13,7 +13,7 @@ const B = I({
|
|
|
13
13
|
sortFns: A
|
|
14
14
|
});
|
|
15
15
|
function J({
|
|
16
|
-
columns:
|
|
16
|
+
columns: i,
|
|
17
17
|
data: d,
|
|
18
18
|
className: x,
|
|
19
19
|
tableClassName: m,
|
|
@@ -22,10 +22,10 @@ function J({
|
|
|
22
22
|
size: f = "md",
|
|
23
23
|
hoverable: j = !1
|
|
24
24
|
}) {
|
|
25
|
-
const [h, b] = F([]),
|
|
25
|
+
const [h, b] = F([]), t = H({
|
|
26
26
|
features: B,
|
|
27
27
|
data: d,
|
|
28
|
-
columns:
|
|
28
|
+
columns: i,
|
|
29
29
|
onSortingChange: b,
|
|
30
30
|
state: {
|
|
31
31
|
sorting: h
|
|
@@ -37,7 +37,7 @@ function J({
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
40
|
+
return /* @__PURE__ */ e.jsxs("div", { className: o("rst:flex rst:flex-col rst:gap-4", x), children: [
|
|
41
41
|
/* @__PURE__ */ e.jsxs(
|
|
42
42
|
C,
|
|
43
43
|
{
|
|
@@ -46,33 +46,33 @@ function J({
|
|
|
46
46
|
hoverable: j,
|
|
47
47
|
className: m,
|
|
48
48
|
children: [
|
|
49
|
-
/* @__PURE__ */ e.jsx(S, { children:
|
|
49
|
+
/* @__PURE__ */ e.jsx(S, { children: t.getHeaderGroups().map((r) => /* @__PURE__ */ e.jsx(l, { children: r.headers.map((s) => /* @__PURE__ */ e.jsx(P, { children: s.isPlaceholder ? null : /* @__PURE__ */ e.jsxs(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
|
-
className:
|
|
53
|
-
"flex items-center gap-2 transition-opacity",
|
|
54
|
-
|
|
52
|
+
className: o(
|
|
53
|
+
"rst:flex rst:items-center rst:gap-2 rst:transition-opacity",
|
|
54
|
+
s.column.getCanSort() && "rst:cursor-pointer rst:select-none rst:opacity-80 rst:hover:opacity-100"
|
|
55
55
|
),
|
|
56
|
-
onClick:
|
|
56
|
+
onClick: s.column.getToggleSortingHandler(),
|
|
57
57
|
children: [
|
|
58
58
|
g(
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
s.column.columnDef.header,
|
|
60
|
+
s.getContext()
|
|
61
61
|
),
|
|
62
|
-
|
|
62
|
+
s.column.getCanSort() && /* @__PURE__ */ e.jsx("span", { className: "rst:w-4 rst:flex rst:justify-center rst:text-primary-500", children: s.column.getIsSorted() === "asc" ? /* @__PURE__ */ e.jsx(a, { icon: w }) : s.column.getIsSorted() === "desc" ? /* @__PURE__ */ e.jsx(a, { icon: y }) : null })
|
|
63
63
|
]
|
|
64
64
|
}
|
|
65
|
-
) },
|
|
66
|
-
/* @__PURE__ */ e.jsx(v, { children:
|
|
65
|
+
) }, s.id)) }, r.id)) }),
|
|
66
|
+
/* @__PURE__ */ e.jsx(v, { children: t.getRowModel().rows?.length ? (
|
|
67
67
|
// No data-state on the row: row selection is not one of the
|
|
68
68
|
// registered features, and v8's getIsSelected() was always false
|
|
69
69
|
// here, so React omitted the attribute anyway.
|
|
70
|
-
|
|
71
|
-
) : /* @__PURE__ */ e.jsx(
|
|
70
|
+
t.getRowModel().rows.map((r) => /* @__PURE__ */ e.jsx(l, { children: r.getAllCells().map((s) => /* @__PURE__ */ e.jsx(c, { children: g(s.column.columnDef.cell, s.getContext()) }, s.id)) }, r.id))
|
|
71
|
+
) : /* @__PURE__ */ e.jsx(l, { children: /* @__PURE__ */ e.jsx(
|
|
72
72
|
c,
|
|
73
73
|
{
|
|
74
|
-
colSpan:
|
|
75
|
-
className: "h-24 text-center text-gray-500 dark:text-gray-400 italic",
|
|
74
|
+
colSpan: i.length,
|
|
75
|
+
className: "rst:h-24 rst:text-center rst:text-gray-500 rst:dark:text-gray-400 rst:italic",
|
|
76
76
|
children: "No results found."
|
|
77
77
|
}
|
|
78
78
|
) }) })
|
|
@@ -82,67 +82,67 @@ function J({
|
|
|
82
82
|
/* @__PURE__ */ e.jsxs(
|
|
83
83
|
"div",
|
|
84
84
|
{
|
|
85
|
-
className:
|
|
86
|
-
"flex flex-col sm:flex-row items-center justify-between gap-4 px-2",
|
|
85
|
+
className: o(
|
|
86
|
+
"rst:flex rst:flex-col rst:sm:flex-row rst:items-center rst:justify-between rst:gap-4 rst:px-2",
|
|
87
87
|
u
|
|
88
88
|
),
|
|
89
89
|
children: [
|
|
90
|
-
/* @__PURE__ */ e.jsxs("div", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: [
|
|
90
|
+
/* @__PURE__ */ e.jsxs("div", { className: "rst:text-sm rst:font-medium rst:text-gray-500 rst:dark:text-gray-400", children: [
|
|
91
91
|
"Page",
|
|
92
92
|
" ",
|
|
93
|
-
/* @__PURE__ */ e.jsx("strong", { className: "text-gray-900 dark:text-gray-100", children:
|
|
93
|
+
/* @__PURE__ */ e.jsx("strong", { className: "rst:text-gray-900 rst:dark:text-gray-100", children: t.state.pagination.pageIndex + 1 }),
|
|
94
94
|
" ",
|
|
95
95
|
"of",
|
|
96
96
|
" ",
|
|
97
|
-
/* @__PURE__ */ e.jsx("strong", { className: "text-gray-900 dark:text-gray-100", children:
|
|
97
|
+
/* @__PURE__ */ e.jsx("strong", { className: "rst:text-gray-900 rst:dark:text-gray-100", children: t.getPageCount() })
|
|
98
98
|
] }),
|
|
99
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
99
|
+
/* @__PURE__ */ e.jsxs("div", { className: "rst:flex rst:items-center rst:space-x-2", children: [
|
|
100
100
|
/* @__PURE__ */ e.jsx(
|
|
101
|
-
|
|
101
|
+
n,
|
|
102
102
|
{
|
|
103
103
|
variant: "outline",
|
|
104
104
|
colorScheme: "neutral",
|
|
105
105
|
size: "sm",
|
|
106
|
-
onClick: () =>
|
|
107
|
-
disabled: !
|
|
106
|
+
onClick: () => t.setPageIndex(0),
|
|
107
|
+
disabled: !t.getCanPreviousPage(),
|
|
108
108
|
"aria-label": "Go to first page",
|
|
109
|
-
children: /* @__PURE__ */ e.jsx(
|
|
109
|
+
children: /* @__PURE__ */ e.jsx(a, { icon: N })
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
112
|
/* @__PURE__ */ e.jsx(
|
|
113
|
-
|
|
113
|
+
n,
|
|
114
114
|
{
|
|
115
115
|
variant: "outline",
|
|
116
116
|
colorScheme: "neutral",
|
|
117
117
|
size: "sm",
|
|
118
|
-
onClick: () =>
|
|
119
|
-
disabled: !
|
|
118
|
+
onClick: () => t.previousPage(),
|
|
119
|
+
disabled: !t.getCanPreviousPage(),
|
|
120
120
|
"aria-label": "Go to previous page",
|
|
121
|
-
children: /* @__PURE__ */ e.jsx(
|
|
121
|
+
children: /* @__PURE__ */ e.jsx(a, { icon: R })
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
124
|
/* @__PURE__ */ e.jsx(
|
|
125
|
-
|
|
125
|
+
n,
|
|
126
126
|
{
|
|
127
127
|
variant: "outline",
|
|
128
128
|
colorScheme: "neutral",
|
|
129
129
|
size: "sm",
|
|
130
|
-
onClick: () =>
|
|
131
|
-
disabled: !
|
|
130
|
+
onClick: () => t.nextPage(),
|
|
131
|
+
disabled: !t.getCanNextPage(),
|
|
132
132
|
"aria-label": "Go to next page",
|
|
133
|
-
children: /* @__PURE__ */ e.jsx(
|
|
133
|
+
children: /* @__PURE__ */ e.jsx(a, { icon: T })
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
/* @__PURE__ */ e.jsx(
|
|
137
|
-
|
|
137
|
+
n,
|
|
138
138
|
{
|
|
139
139
|
variant: "outline",
|
|
140
140
|
colorScheme: "neutral",
|
|
141
141
|
size: "sm",
|
|
142
|
-
onClick: () =>
|
|
143
|
-
disabled: !
|
|
142
|
+
onClick: () => t.setPageIndex(t.getPageCount() - 1),
|
|
143
|
+
disabled: !t.getCanNextPage(),
|
|
144
144
|
"aria-label": "Go to last page",
|
|
145
|
-
children: /* @__PURE__ */ e.jsx(
|
|
145
|
+
children: /* @__PURE__ */ e.jsx(a, { icon: k })
|
|
146
146
|
}
|
|
147
147
|
)
|
|
148
148
|
] })
|