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 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"),c=require("./utils-scPUmbSO.cjs"),g=require("./mainstack-design-system553.cjs"),u=require("./mainstack-design-system555.cjs"),P=require("./mainstack-design-system554.cjs"),b=require("./mainstack-design-system556.cjs"),x=require("./mainstack-design-system557.cjs"),p=require("./mainstack-design-system596.cjs"),t=({totalResults:n=3,limit:s,page:a,setPage:o,setLimit:i,className:d})=>{const r=Math.ceil(n/s),{isScrolling:m,atBottom:l}=p.useTableScroll();return e.jsxs("div",{"data-slot":"table-pagination",className:c.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 ",m?"mds:rounded-t-20 mds:shadow-lg ":"mds:rounded-20 ",l?"mds:rounded-b-20 mds:border":"mds:rounded-b-none",d),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(g.PaginationRoot,{page:a,totalPages:r,onPageChange:o,limit:s,onLimitChange:i,className:"mds:flex mds:items-center mds:w-full mds:gap-12 mds:justify-end",children:[e.jsx(x.PaginationPageSize,{}),e.jsx(P.PaginationPrev,{}),e.jsx(b.PaginationPageButton,{}),e.jsx(u.PaginationNext,{})]})]})};t.displayName="TablePagination";exports.TablePagination=t;
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 g } from "./mainstack-design-system553.js";
4
- import { PaginationNext as b } from "./mainstack-design-system555.js";
5
- import { PaginationPrev as f } from "./mainstack-design-system554.js";
6
- import { PaginationPageButton as p } from "./mainstack-design-system556.js";
7
- import { PaginationPageSize as u } from "./mainstack-design-system557.js";
8
- import { useTableScroll as x } from "./mainstack-design-system596.js";
9
- const P = ({
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
- page: a,
13
- setPage: o,
14
- setLimit: t,
15
- className: r
12
+ defaultLimit: a,
13
+ page: o,
14
+ setPage: t,
15
+ setLimit: r,
16
+ className: i
16
17
  }) => {
17
- const i = Math.ceil(d / e), { isScrolling: n, atBottom: l } = x();
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: c(
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
- n ? "mds:rounded-t-20 mds:shadow-lg " : "mds:rounded-20 ",
25
- l ? "mds:rounded-b-20 mds:border" : "mds:rounded-b-none",
26
- r
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
- g,
35
+ b,
35
36
  {
36
- page: a,
37
- totalPages: i,
38
- onPageChange: o,
37
+ page: o,
38
+ totalPages: n,
39
+ onPageChange: t,
40
+ defaultLimit: a,
39
41
  limit: e,
40
- onLimitChange: t,
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(u, {}),
44
- /* @__PURE__ */ m(f, {}),
45
+ /* @__PURE__ */ m(x, {}),
45
46
  /* @__PURE__ */ m(p, {}),
46
- /* @__PURE__ */ m(b, {})
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
- P.displayName = "TablePagination";
56
+ h.displayName = "TablePagination";
55
57
  export {
56
- P as TablePagination
58
+ h as TablePagination
57
59
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("./utils-scPUmbSO.cjs"),c=require("./mainstack-design-system597.cjs"),e=({children:i,page:n,totalPages:o,limit:s,onPageChange:a,onLimitChange:r,className:d})=>t.jsx(c.PaginationContext.Provider,{value:{page:n,totalPages:o,limit:s,setPage:a,setLimit:r},children:t.jsx("div",{className:m.cn("mds:flex mds:items-center mds:space-x-4 mds:w-full mds:gap-12 mds:justify-end",d),children:i})});e.displayName="PaginationRoot";exports.PaginationRoot=e;
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 r } from "./utils-Cs1D8Nxl.js";
3
- import { PaginationContext as d } from "./mainstack-design-system597.js";
4
- const c = ({
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
- onPageChange: m,
10
- onLimitChange: a,
11
- className: n
9
+ defaultLimit: m,
10
+ onPageChange: a,
11
+ onLimitChange: n,
12
+ className: r
12
13
  }) => /* @__PURE__ */ t(
13
- d.Provider,
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: m,
20
- setLimit: a
21
+ setPage: a,
22
+ setLimit: n
21
23
  },
22
24
  children: /* @__PURE__ */ t(
23
25
  "div",
24
26
  {
25
- className: r(
27
+ className: d(
26
28
  "mds:flex mds:items-center mds:space-x-4 mds:w-full mds:gap-12 mds:justify-end",
27
- n
29
+ r
28
30
  ),
29
31
  children: e
30
32
  }
31
33
  )
32
34
  }
33
35
  );
34
- c.displayName = "PaginationRoot";
36
+ l.displayName = "PaginationRoot";
35
37
  export {
36
- c as PaginationRoot
38
+ l as PaginationRoot
37
39
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./mainstack-design-system568.cjs"),s=require("./mainstack-design-system461.cjs"),c=require("./mainstack-design-system462.cjs"),u=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 m=require("./mainstack-design-system597.cjs"),l=()=>{const{limit:a,setLimit:i}=m.usePagination(),r=[{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 i?e.jsxs(o.SelectRoot,{options:r,value:String(a),onValueChange:t=>i(Number(t)),children:[e.jsx(s.SelectInputField,{shape:"full-radius",className:"mds:min-h-36"}),e.jsx(c.SelectPortal,{children:e.jsx(u.SelectOptions,{children:({options:t})=>t.map(n=>e.jsx(p.SelectOptionItem,{value:n.value,children:n.label},n.value))})})]}):null};l.displayName="PaginationPageSize";exports.PaginationPageSize=l;
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 m, jsx as e } from "react/jsx-runtime";
2
- import { SelectRoot as o } from "./mainstack-design-system568.js";
3
- import { SelectInputField as p } from "./mainstack-design-system461.js";
4
- import { SelectPortal as n } from "./mainstack-design-system462.js";
5
- import { SelectOptions as s } from "./mainstack-design-system463.js";
6
- import { SelectOptionItem as u } from "./mainstack-design-system464.js";
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 c } from "./mainstack-design-system597.js";
12
- const g = () => {
13
- const { limit: a, setLimit: l } = c(), r = [
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 l ? /* @__PURE__ */ m(
20
- o,
19
+ return a ? /* @__PURE__ */ o(
20
+ p,
21
21
  {
22
- options: r,
23
- value: String(a),
24
- onValueChange: (i) => l(Number(i)),
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(p, { shape: "full-radius", className: "mds:min-h-36" }),
27
- /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(s, { children: ({ options: i }) => i.map((t) => /* @__PURE__ */ e(u, { value: t.value, children: t.label }, t.value)) }) })
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
- g.displayName = "PaginationPageSize";
33
+ f.displayName = "PaginationPageSize";
33
34
  export {
34
- g as PaginationPageSize
35
+ f as PaginationPageSize
35
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",