@fairmint/ui 0.3.28 → 0.3.30
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/dist/_virtual/index3.cjs +5 -3
- package/dist/_virtual/index3.cjs.map +1 -1
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index4.cjs +3 -5
- package/dist/_virtual/index4.cjs.map +1 -1
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index4.js.map +1 -1
- package/dist/components/generic/TablePagination/TablePagination.cjs +86 -0
- package/dist/components/generic/TablePagination/TablePagination.cjs.map +1 -0
- package/dist/components/generic/TablePagination/TablePagination.d.ts +29 -0
- package/dist/components/generic/TablePagination/TablePagination.d.ts.map +1 -0
- package/dist/components/generic/TablePagination/TablePagination.js +86 -0
- package/dist/components/generic/TablePagination/TablePagination.js.map +1 -0
- package/dist/components/layout/SideNav/SideNav.cjs +5 -2
- package/dist/components/layout/SideNav/SideNav.cjs.map +1 -1
- package/dist/components/layout/SideNav/SideNav.d.ts.map +1 -1
- package/dist/components/layout/SideNav/SideNav.js +5 -2
- package/dist/components/layout/SideNav/SideNav.js.map +1 -1
- package/dist/components/primitives/muiCompat.cjs +0 -84
- package/dist/components/primitives/muiCompat.cjs.map +1 -1
- package/dist/components/primitives/muiCompat.d.ts +1 -1
- package/dist/components/primitives/muiCompat.d.ts.map +1 -1
- package/dist/components/primitives/muiCompat.js +0 -84
- package/dist/components/primitives/muiCompat.js.map +1 -1
- package/dist/fairmint-ui.cjs +2 -1
- package/dist/fairmint-ui.cjs.map +1 -1
- package/dist/fairmint-ui.js +2 -1
- package/dist/fairmint-ui.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.cjs +1 -1
- package/dist/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.js +1 -1
- package/dist/node_modules/prop-types/index.cjs +1 -1
- package/dist/node_modules/prop-types/index.js +1 -1
- package/package.json +1 -1
|
@@ -23,23 +23,6 @@ import { Stack as Stack$1 } from "../../node_modules/@mantine/core/esm/component
|
|
|
23
23
|
import { Menu } from "../../node_modules/@mantine/core/esm/components/Menu/Menu.js";
|
|
24
24
|
import { TextInput } from "../../node_modules/@mantine/core/esm/components/TextInput/TextInput.js";
|
|
25
25
|
dayjs.extend(customParseFormat);
|
|
26
|
-
const ChevronIcon = ({ direction }) => /* @__PURE__ */ jsx(
|
|
27
|
-
"svg",
|
|
28
|
-
{
|
|
29
|
-
"aria-hidden": "true",
|
|
30
|
-
fill: "none",
|
|
31
|
-
focusable: "false",
|
|
32
|
-
height: "20",
|
|
33
|
-
stroke: "currentColor",
|
|
34
|
-
strokeLinecap: "round",
|
|
35
|
-
strokeLinejoin: "round",
|
|
36
|
-
strokeWidth: "2",
|
|
37
|
-
viewBox: "0 0 24 24",
|
|
38
|
-
width: "20",
|
|
39
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
-
children: /* @__PURE__ */ jsx("path", { d: direction === "left" ? "M15 6 9 12l6 6" : "m9 6 6 6-6 6" })
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
26
|
const compatBreakpointKeys = ["xs", "sm", "md", "lg", "xl"];
|
|
44
27
|
const compatFallbackBreakpoints = {
|
|
45
28
|
xs: "30em",
|
|
@@ -626,72 +609,6 @@ const TableCell = ({ align, children, component, style, sx, ...props }) => {
|
|
|
626
609
|
const CellComponent = component === "th" ? Table.Th : Table.Td;
|
|
627
610
|
return /* @__PURE__ */ jsx(CellComponent, { ta: align, style: { ...sxToStyle(sx), ...style }, ...props, children });
|
|
628
611
|
};
|
|
629
|
-
const TablePagination = ({
|
|
630
|
-
count,
|
|
631
|
-
onPageChange,
|
|
632
|
-
onRowsPerPageChange,
|
|
633
|
-
page,
|
|
634
|
-
rowsPerPage,
|
|
635
|
-
rowsPerPageOptions = [10, 25, 50, 100]
|
|
636
|
-
}) => {
|
|
637
|
-
const isAllRows = rowsPerPage === -1;
|
|
638
|
-
const hasRows = count !== 0;
|
|
639
|
-
const firstRow = hasRows ? isAllRows ? 1 : page * rowsPerPage + 1 : 0;
|
|
640
|
-
const lastRow = !hasRows ? 0 : isAllRows ? count === -1 ? firstRow : count : count === -1 ? (page + 1) * rowsPerPage : Math.min(count, (page + 1) * rowsPerPage);
|
|
641
|
-
const totalRowsLabel = count === -1 ? `more than ${lastRow}` : count;
|
|
642
|
-
const canGoBack = page > 0;
|
|
643
|
-
const canGoForward = count === -1 ? !isAllRows : !isAllRows && (page + 1) * rowsPerPage < count;
|
|
644
|
-
const rowsPerPageData = rowsPerPageOptions.map((option) => {
|
|
645
|
-
if (option && typeof option === "object") {
|
|
646
|
-
return { label: String(option.label ?? option.value), value: String(option.value) };
|
|
647
|
-
}
|
|
648
|
-
return { label: String(option), value: String(option) };
|
|
649
|
-
});
|
|
650
|
-
return /* @__PURE__ */ jsxs(Group, { gap: "sm", justify: "flex-end", children: [
|
|
651
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", children: "Rows per page:" }),
|
|
652
|
-
/* @__PURE__ */ jsx(
|
|
653
|
-
Select,
|
|
654
|
-
{
|
|
655
|
-
value: String(rowsPerPage),
|
|
656
|
-
data: rowsPerPageData,
|
|
657
|
-
onChange: (value) => onRowsPerPageChange?.({ target: { value } })
|
|
658
|
-
}
|
|
659
|
-
),
|
|
660
|
-
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
661
|
-
firstRow,
|
|
662
|
-
"–",
|
|
663
|
-
lastRow,
|
|
664
|
-
" of ",
|
|
665
|
-
totalRowsLabel
|
|
666
|
-
] }),
|
|
667
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
668
|
-
/* @__PURE__ */ jsx(
|
|
669
|
-
ActionIcon,
|
|
670
|
-
{
|
|
671
|
-
"aria-label": "Previous page",
|
|
672
|
-
disabled: !canGoBack,
|
|
673
|
-
onClick: (event) => onPageChange?.(event, page - 1),
|
|
674
|
-
color: resolveCompatColor("default"),
|
|
675
|
-
type: "button",
|
|
676
|
-
variant: "subtle",
|
|
677
|
-
children: /* @__PURE__ */ jsx(ChevronIcon, { direction: "left" })
|
|
678
|
-
}
|
|
679
|
-
),
|
|
680
|
-
/* @__PURE__ */ jsx(
|
|
681
|
-
ActionIcon,
|
|
682
|
-
{
|
|
683
|
-
"aria-label": "Next page",
|
|
684
|
-
disabled: !canGoForward,
|
|
685
|
-
onClick: (event) => onPageChange?.(event, page + 1),
|
|
686
|
-
color: resolveCompatColor("default"),
|
|
687
|
-
type: "button",
|
|
688
|
-
variant: "subtle",
|
|
689
|
-
children: /* @__PURE__ */ jsx(ChevronIcon, { direction: "right" })
|
|
690
|
-
}
|
|
691
|
-
)
|
|
692
|
-
] })
|
|
693
|
-
] });
|
|
694
|
-
};
|
|
695
612
|
const MenuItem = ({ children, component, disabled, onClick, value, ...props }) => {
|
|
696
613
|
const Component = component || Menu.Item;
|
|
697
614
|
return /* @__PURE__ */ jsx(Component, { disabled, onClick, value, ...props, children });
|
|
@@ -1604,7 +1521,6 @@ export {
|
|
|
1604
1521
|
TableBody,
|
|
1605
1522
|
TableCell,
|
|
1606
1523
|
TableHead,
|
|
1607
|
-
TablePagination,
|
|
1608
1524
|
TableRow,
|
|
1609
1525
|
TextField,
|
|
1610
1526
|
ThemeProvider,
|