mainstack-design-system 1.8.1 → 1.8.2
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/index.d.ts +6 -4
- package/dist/mainstack-design-system552.cjs +1 -1
- package/dist/mainstack-design-system552.js +29 -27
- package/dist/mainstack-design-system553.cjs +1 -1
- package/dist/mainstack-design-system553.js +15 -13
- package/dist/mainstack-design-system557.cjs +1 -1
- package/dist/mainstack-design-system557.js +19 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5887,7 +5887,7 @@ export declare const PageviewIcon: ({ variant, ...props }: VariableIconProps) =>
|
|
|
5887
5887
|
|
|
5888
5888
|
export declare const Pagination: {
|
|
5889
5889
|
Root: {
|
|
5890
|
-
({ children, page, totalPages, limit, onPageChange, onLimitChange, className, }: PaginationRootProps): JSX.Element;
|
|
5890
|
+
({ children, page, totalPages, limit, defaultLimit, onPageChange, onLimitChange, className, }: PaginationRootProps): JSX.Element;
|
|
5891
5891
|
displayName: string;
|
|
5892
5892
|
};
|
|
5893
5893
|
Next: {
|
|
@@ -5932,7 +5932,7 @@ export declare const PaginationPrev: {
|
|
|
5932
5932
|
};
|
|
5933
5933
|
|
|
5934
5934
|
export declare const PaginationRoot: {
|
|
5935
|
-
({ children, page, totalPages, limit, onPageChange, onLimitChange, className, }: PaginationRootProps): JSX.Element;
|
|
5935
|
+
({ children, page, totalPages, limit, defaultLimit, onPageChange, onLimitChange, className, }: PaginationRootProps): JSX.Element;
|
|
5936
5936
|
displayName: string;
|
|
5937
5937
|
};
|
|
5938
5938
|
|
|
@@ -5941,6 +5941,7 @@ declare interface PaginationRootProps {
|
|
|
5941
5941
|
page: number;
|
|
5942
5942
|
totalPages: number;
|
|
5943
5943
|
limit: number;
|
|
5944
|
+
defaultLimit?: number;
|
|
5944
5945
|
onPageChange: (p: number) => void;
|
|
5945
5946
|
onLimitChange: (limit: number) => void;
|
|
5946
5947
|
className?: string;
|
|
@@ -9413,7 +9414,7 @@ export declare const TableGroup: {
|
|
|
9413
9414
|
displayName: string;
|
|
9414
9415
|
};
|
|
9415
9416
|
Pagination: {
|
|
9416
|
-
({ totalResults, limit, page, setPage, setLimit, className, }: TablePaginationProps): JSX.Element;
|
|
9417
|
+
({ totalResults, limit, defaultLimit, page, setPage, setLimit, className, }: TablePaginationProps): JSX.Element;
|
|
9417
9418
|
displayName: string;
|
|
9418
9419
|
};
|
|
9419
9420
|
};
|
|
@@ -9436,13 +9437,14 @@ declare interface TableHeadProps extends React.ComponentPropsWithoutRef<"th"> {
|
|
|
9436
9437
|
}
|
|
9437
9438
|
|
|
9438
9439
|
export declare const TablePagination: {
|
|
9439
|
-
({ totalResults, limit, page, setPage, setLimit, className, }: TablePaginationProps): JSX.Element;
|
|
9440
|
+
({ totalResults, limit, defaultLimit, page, setPage, setLimit, className, }: TablePaginationProps): JSX.Element;
|
|
9440
9441
|
displayName: string;
|
|
9441
9442
|
};
|
|
9442
9443
|
|
|
9443
9444
|
declare interface TablePaginationProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
9444
9445
|
totalResults: number;
|
|
9445
9446
|
limit: number;
|
|
9447
|
+
defaultLimit?: number;
|
|
9446
9448
|
page: number;
|
|
9447
9449
|
setPage: (page: number) => void;
|
|
9448
9450
|
setLimit: (limit: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("./utils-scPUmbSO.cjs"),u=require("./mainstack-design-system553.cjs"),P=require("./mainstack-design-system555.cjs"),b=require("./mainstack-design-system554.cjs"),x=require("./mainstack-design-system556.cjs"),p=require("./mainstack-design-system557.cjs"),_=require("./mainstack-design-system596.cjs"),t=({totalResults:n=3,limit:s,defaultLimit:a,page:o,setPage:i,setLimit:d,className:r})=>{const m=Math.ceil(n/s),{isScrolling:l,atBottom:c}=_.useTableScroll();return e.jsxs("div",{"data-slot":"table-pagination",className:g.cn("mds:flex mds:items-center mds:justify-between mds:w-full mds:p-16 mds:mt-12 mds:border-t mds:border-x mds:border-border-interactive-neutral mds:sticky mds:bottom-0 mds:z-20 mds:bg-surface-neutral-l1 mds:transition-all mds:duration-200 ",l?"mds:rounded-t-20 mds:shadow-lg ":"mds:rounded-20 ",c?"mds:rounded-b-20 mds:border":"mds:rounded-b-none",r),children:[e.jsxs("div",{className:"mds:text-primary body-extrasmall-regular mds:flex-1 mds:hidden mds:md:flex mds:gap-2",children:[e.jsx("p",{className:"body-extrasmall-semibold",children:n})," results"]}),e.jsxs(u.PaginationRoot,{page:o,totalPages:m,onPageChange:i,defaultLimit:a,limit:s,onLimitChange:d,className:"mds:flex mds:items-center mds:w-full mds:gap-12 mds:justify-end",children:[e.jsx(p.PaginationPageSize,{}),e.jsx(b.PaginationPrev,{}),e.jsx(x.PaginationPageButton,{}),e.jsx(P.PaginationNext,{})]})]})};t.displayName="TablePagination";exports.TablePagination=t;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { jsxs as s, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "./utils-Cs1D8Nxl.js";
|
|
3
|
-
import { PaginationRoot as
|
|
4
|
-
import { PaginationNext as
|
|
5
|
-
import { PaginationPrev as
|
|
6
|
-
import { PaginationPageButton as
|
|
7
|
-
import { PaginationPageSize as
|
|
8
|
-
import { useTableScroll as
|
|
9
|
-
const
|
|
2
|
+
import { c as g } from "./utils-Cs1D8Nxl.js";
|
|
3
|
+
import { PaginationRoot as b } from "./mainstack-design-system553.js";
|
|
4
|
+
import { PaginationNext as f } from "./mainstack-design-system555.js";
|
|
5
|
+
import { PaginationPrev as p } from "./mainstack-design-system554.js";
|
|
6
|
+
import { PaginationPageButton as u } from "./mainstack-design-system556.js";
|
|
7
|
+
import { PaginationPageSize as x } from "./mainstack-design-system557.js";
|
|
8
|
+
import { useTableScroll as P } from "./mainstack-design-system596.js";
|
|
9
|
+
const h = ({
|
|
10
10
|
totalResults: d = 3,
|
|
11
11
|
limit: e,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
defaultLimit: a,
|
|
13
|
+
page: o,
|
|
14
|
+
setPage: t,
|
|
15
|
+
setLimit: r,
|
|
16
|
+
className: i
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
+
const n = Math.ceil(d / e), { isScrolling: l, atBottom: c } = P();
|
|
18
19
|
return /* @__PURE__ */ s(
|
|
19
20
|
"div",
|
|
20
21
|
{
|
|
21
22
|
"data-slot": "table-pagination",
|
|
22
|
-
className:
|
|
23
|
+
className: g(
|
|
23
24
|
"mds:flex mds:items-center mds:justify-between mds:w-full mds:p-16 mds:mt-12 mds:border-t mds:border-x mds:border-border-interactive-neutral mds:sticky mds:bottom-0 mds:z-20 mds:bg-surface-neutral-l1 mds:transition-all mds:duration-200 ",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
l ? "mds:rounded-t-20 mds:shadow-lg " : "mds:rounded-20 ",
|
|
26
|
+
c ? "mds:rounded-b-20 mds:border" : "mds:rounded-b-none",
|
|
27
|
+
i
|
|
27
28
|
),
|
|
28
29
|
children: [
|
|
29
30
|
/* @__PURE__ */ s("div", { className: "mds:text-primary body-extrasmall-regular mds:flex-1 mds:hidden mds:md:flex mds:gap-2", children: [
|
|
@@ -31,19 +32,20 @@ const P = ({
|
|
|
31
32
|
" results"
|
|
32
33
|
] }),
|
|
33
34
|
/* @__PURE__ */ s(
|
|
34
|
-
|
|
35
|
+
b,
|
|
35
36
|
{
|
|
36
|
-
page:
|
|
37
|
-
totalPages:
|
|
38
|
-
onPageChange:
|
|
37
|
+
page: o,
|
|
38
|
+
totalPages: n,
|
|
39
|
+
onPageChange: t,
|
|
40
|
+
defaultLimit: a,
|
|
39
41
|
limit: e,
|
|
40
|
-
onLimitChange:
|
|
42
|
+
onLimitChange: r,
|
|
41
43
|
className: "mds:flex mds:items-center mds:w-full mds:gap-12 mds:justify-end",
|
|
42
44
|
children: [
|
|
43
|
-
/* @__PURE__ */ m(
|
|
44
|
-
/* @__PURE__ */ m(f, {}),
|
|
45
|
+
/* @__PURE__ */ m(x, {}),
|
|
45
46
|
/* @__PURE__ */ m(p, {}),
|
|
46
|
-
/* @__PURE__ */ m(
|
|
47
|
+
/* @__PURE__ */ m(u, {}),
|
|
48
|
+
/* @__PURE__ */ m(f, {})
|
|
47
49
|
]
|
|
48
50
|
}
|
|
49
51
|
)
|
|
@@ -51,7 +53,7 @@ const P = ({
|
|
|
51
53
|
}
|
|
52
54
|
);
|
|
53
55
|
};
|
|
54
|
-
|
|
56
|
+
h.displayName = "TablePagination";
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
h as TablePagination
|
|
57
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("./utils-scPUmbSO.cjs"),l=require("./mainstack-design-system597.cjs"),e=({children:i,page:n,totalPages:o,limit:s,defaultLimit:a,onPageChange:r,onLimitChange:d,className:m})=>t.jsx(l.PaginationContext.Provider,{value:{page:n,totalPages:o,defaultLimit:a,limit:s,setPage:r,setLimit:d},children:t.jsx("div",{className:c.cn("mds:flex mds:items-center mds:space-x-4 mds:w-full mds:gap-12 mds:justify-end",m),children:i})});e.displayName="PaginationRoot";exports.PaginationRoot=e;
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { PaginationContext as
|
|
4
|
-
const
|
|
2
|
+
import { c as d } from "./utils-Cs1D8Nxl.js";
|
|
3
|
+
import { PaginationContext as c } from "./mainstack-design-system597.js";
|
|
4
|
+
const l = ({
|
|
5
5
|
children: e,
|
|
6
6
|
page: i,
|
|
7
7
|
totalPages: o,
|
|
8
8
|
limit: s,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
defaultLimit: m,
|
|
10
|
+
onPageChange: a,
|
|
11
|
+
onLimitChange: n,
|
|
12
|
+
className: r
|
|
12
13
|
}) => /* @__PURE__ */ t(
|
|
13
|
-
|
|
14
|
+
c.Provider,
|
|
14
15
|
{
|
|
15
16
|
value: {
|
|
16
17
|
page: i,
|
|
17
18
|
totalPages: o,
|
|
19
|
+
defaultLimit: m,
|
|
18
20
|
limit: s,
|
|
19
|
-
setPage:
|
|
20
|
-
setLimit:
|
|
21
|
+
setPage: a,
|
|
22
|
+
setLimit: n
|
|
21
23
|
},
|
|
22
24
|
children: /* @__PURE__ */ t(
|
|
23
25
|
"div",
|
|
24
26
|
{
|
|
25
|
-
className:
|
|
27
|
+
className: d(
|
|
26
28
|
"mds:flex mds:items-center mds:space-x-4 mds:w-full mds:gap-12 mds:justify-end",
|
|
27
|
-
|
|
29
|
+
r
|
|
28
30
|
),
|
|
29
31
|
children: e
|
|
30
32
|
}
|
|
31
33
|
)
|
|
32
34
|
}
|
|
33
35
|
);
|
|
34
|
-
|
|
36
|
+
l.displayName = "PaginationRoot";
|
|
35
37
|
export {
|
|
36
|
-
|
|
38
|
+
l as PaginationRoot
|
|
37
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./mainstack-design-system568.cjs"),c=require("./mainstack-design-system461.cjs"),u=require("./mainstack-design-system462.cjs"),m=require("./mainstack-design-system463.cjs"),p=require("./mainstack-design-system464.cjs");require("./mainstack-design-system465.cjs");require("./mainstack-design-system466.cjs");require("./mainstack-design-system459.cjs");require("./mainstack-design-system460.cjs");const S=require("./mainstack-design-system597.cjs"),a=()=>{const{defaultLimit:n,limit:r,setLimit:l}=S.usePagination(),o=[{value:"10",label:"10 items per page"},{value:"20",label:"20 items per page"},{value:"50",label:"50 items per page"},{value:"100",label:"100 items per page"}];return l?e.jsxs(s.SelectRoot,{options:o,value:String(r),onValueChange:t=>l(Number(t)),defaultValue:n?String(n):"10",children:[e.jsx(c.SelectInputField,{shape:"full-radius",className:"mds:min-h-36"}),e.jsx(u.SelectPortal,{children:e.jsx(m.SelectOptions,{children:({options:t})=>t.map(i=>e.jsx(p.SelectOptionItem,{value:i.value,children:i.label},i.value))})})]}):null};a.displayName="PaginationPageSize";exports.PaginationPageSize=a;
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { SelectRoot as
|
|
3
|
-
import { SelectInputField as
|
|
4
|
-
import { SelectPortal as
|
|
5
|
-
import { SelectOptions as
|
|
6
|
-
import { SelectOptionItem as
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { SelectRoot as p } from "./mainstack-design-system568.js";
|
|
3
|
+
import { SelectInputField as n } from "./mainstack-design-system461.js";
|
|
4
|
+
import { SelectPortal as s } from "./mainstack-design-system462.js";
|
|
5
|
+
import { SelectOptions as u } from "./mainstack-design-system463.js";
|
|
6
|
+
import { SelectOptionItem as c } from "./mainstack-design-system464.js";
|
|
7
7
|
import "./mainstack-design-system465.js";
|
|
8
8
|
import "./mainstack-design-system466.js";
|
|
9
9
|
import "./mainstack-design-system459.js";
|
|
10
10
|
import "./mainstack-design-system460.js";
|
|
11
|
-
import { usePagination as
|
|
12
|
-
const
|
|
13
|
-
const { limit:
|
|
11
|
+
import { usePagination as g } from "./mainstack-design-system597.js";
|
|
12
|
+
const f = () => {
|
|
13
|
+
const { defaultLimit: l, limit: r, setLimit: a } = g(), m = [
|
|
14
14
|
{ value: "10", label: "10 items per page" },
|
|
15
15
|
{ value: "20", label: "20 items per page" },
|
|
16
16
|
{ value: "50", label: "50 items per page" },
|
|
17
17
|
{ value: "100", label: "100 items per page" }
|
|
18
18
|
];
|
|
19
|
-
return
|
|
20
|
-
|
|
19
|
+
return a ? /* @__PURE__ */ o(
|
|
20
|
+
p,
|
|
21
21
|
{
|
|
22
|
-
options:
|
|
23
|
-
value: String(
|
|
24
|
-
onValueChange: (
|
|
22
|
+
options: m,
|
|
23
|
+
value: String(r),
|
|
24
|
+
onValueChange: (t) => a(Number(t)),
|
|
25
|
+
defaultValue: l ? String(l) : "10",
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */ e(
|
|
27
|
-
/* @__PURE__ */ e(
|
|
27
|
+
/* @__PURE__ */ e(n, { shape: "full-radius", className: "mds:min-h-36" }),
|
|
28
|
+
/* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(u, { children: ({ options: t }) => t.map((i) => /* @__PURE__ */ e(c, { value: i.value, children: i.label }, i.value)) }) })
|
|
28
29
|
]
|
|
29
30
|
}
|
|
30
31
|
) : null;
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
+
f.displayName = "PaginationPageSize";
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
f as PaginationPageSize
|
|
35
36
|
};
|