mainstack-design-system 1.12.0 → 1.12.1
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/assets/styles.css +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/mainstack-design-system547.cjs +1 -1
- package/dist/mainstack-design-system547.js +35 -21
- package/dist/mainstack-design-system548.cjs +1 -1
- package/dist/mainstack-design-system548.js +26 -21
- package/dist/mainstack-design-system550.cjs +1 -1
- package/dist/mainstack-design-system550.js +30 -21
- package/dist/mainstack-design-system553.cjs +1 -1
- package/dist/mainstack-design-system553.js +30 -21
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9417,7 +9417,7 @@ declare interface TableBodyProps extends React.ComponentPropsWithoutRef<"tbody">
|
|
|
9417
9417
|
}
|
|
9418
9418
|
|
|
9419
9419
|
export declare const TableCell: {
|
|
9420
|
-
({ isSticky, className, ...props }: TableCellProps): JSX.Element;
|
|
9420
|
+
({ isSticky, stickySide, className, ...props }: TableCellProps): JSX.Element;
|
|
9421
9421
|
displayName: string;
|
|
9422
9422
|
};
|
|
9423
9423
|
|
|
@@ -9436,6 +9436,7 @@ declare interface TableCellLabelProps extends React_2.HTMLAttributes<HTMLDivElem
|
|
|
9436
9436
|
|
|
9437
9437
|
declare interface TableCellProps extends React.ComponentPropsWithoutRef<"td"> {
|
|
9438
9438
|
isSticky?: boolean;
|
|
9439
|
+
stickySide?: "left" | "right";
|
|
9439
9440
|
}
|
|
9440
9441
|
|
|
9441
9442
|
export declare const TableGroup: {
|
|
@@ -9452,7 +9453,7 @@ export declare const TableGroup: {
|
|
|
9452
9453
|
displayName: string;
|
|
9453
9454
|
};
|
|
9454
9455
|
Cell: {
|
|
9455
|
-
({ isSticky, className, ...props }: TableCellProps): JSX.Element;
|
|
9456
|
+
({ isSticky, stickySide, className, ...props }: TableCellProps): JSX.Element;
|
|
9456
9457
|
displayName: string;
|
|
9457
9458
|
};
|
|
9458
9459
|
CellLable: ForwardRefExoticComponent<TableCellLabelProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -9466,7 +9467,7 @@ export declare const TableGroup: {
|
|
|
9466
9467
|
displayName: string;
|
|
9467
9468
|
};
|
|
9468
9469
|
Head: {
|
|
9469
|
-
({ isSticky, className, ...props }: TableHeadProps): JSX.Element;
|
|
9470
|
+
({ isSticky, stickySide, className, ...props }: TableHeadProps): JSX.Element;
|
|
9470
9471
|
displayName: string;
|
|
9471
9472
|
};
|
|
9472
9473
|
Pagination: {
|
|
@@ -9476,7 +9477,7 @@ export declare const TableGroup: {
|
|
|
9476
9477
|
};
|
|
9477
9478
|
|
|
9478
9479
|
export declare const TableHead: {
|
|
9479
|
-
({ isSticky, className, ...props }: TableHeadProps): JSX.Element;
|
|
9480
|
+
({ isSticky, stickySide, className, ...props }: TableHeadProps): JSX.Element;
|
|
9480
9481
|
displayName: string;
|
|
9481
9482
|
};
|
|
9482
9483
|
|
|
@@ -9490,6 +9491,7 @@ declare interface TableHeaderProps extends React.ComponentPropsWithoutRef<"thead
|
|
|
9490
9491
|
|
|
9491
9492
|
declare interface TableHeadProps extends React.ComponentPropsWithoutRef<"th"> {
|
|
9492
9493
|
isSticky?: boolean;
|
|
9494
|
+
stickySide?: "left" | "right";
|
|
9493
9495
|
}
|
|
9494
9496
|
|
|
9495
9497
|
export declare const TablePagination: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),w=require("./utils-sX9NhwD-.cjs"),e=require("react"),E=require("./mainstack-design-system600.cjs"),a=({className:c,...u})=>{const[t,l]=e.useState(null),[d,r]=e.useState(!1),[m,f]=e.useState(!1),[v,S]=e.useState(!0),[T,b]=e.useState(!1);return e.useEffect(()=>{if(!t)return;let s;const o=()=>{r(!0),s&&clearTimeout(s),s=setTimeout(()=>r(!1),150);const{scrollTop:g,scrollHeight:h,clientHeight:L,scrollLeft:n,scrollWidth:R,clientWidth:x}=t;f(g+L>=h-1),S(n<=2),b(n+x>=R-2)};return t.addEventListener("scroll",o),window.addEventListener("resize",o),o(),()=>{t.removeEventListener("scroll",o),window.removeEventListener("resize",o),s&&clearTimeout(s)}},[t]),i.jsx(E.TableContext.Provider,{value:{isScrolling:d,atBottom:m,atLeft:v,atRight:T,setScrollContainer:l},children:i.jsx("div",{ref:l,className:w.cn("mds:w-full mds:mx-auto mds:relative",c),...u})})};a.displayName="TableRoot";exports.TableRoot=a;
|
|
@@ -1,31 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import { TableContext as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as S } from "./utils-BuJ7DVbu.js";
|
|
3
|
+
import { useState as r, useEffect as x } from "react";
|
|
4
|
+
import { TableContext as R } from "./mainstack-design-system600.js";
|
|
5
|
+
const b = ({ className: c, ...a }) => {
|
|
6
|
+
const [t, l] = r(
|
|
7
|
+
null
|
|
8
|
+
), [m, s] = r(!1), [f, d] = r(!1), [u, v] = r(!0), [h, p] = r(!1);
|
|
9
|
+
return x(() => {
|
|
9
10
|
if (!t) return;
|
|
10
11
|
let e;
|
|
11
12
|
const o = () => {
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
|
|
13
|
+
s(!0), e && clearTimeout(e), e = setTimeout(() => s(!1), 150);
|
|
14
|
+
const {
|
|
15
|
+
scrollTop: L,
|
|
16
|
+
scrollHeight: T,
|
|
17
|
+
clientHeight: g,
|
|
18
|
+
scrollLeft: i,
|
|
19
|
+
scrollWidth: w,
|
|
20
|
+
clientWidth: E
|
|
21
|
+
} = t;
|
|
22
|
+
d(L + g >= T - 1), v(i <= 2), p(i + E >= w - 2);
|
|
15
23
|
};
|
|
16
|
-
return t.addEventListener("scroll", o), o(), () => {
|
|
17
|
-
t.removeEventListener("scroll", o), e && clearTimeout(e);
|
|
24
|
+
return t.addEventListener("scroll", o), window.addEventListener("resize", o), o(), () => {
|
|
25
|
+
t.removeEventListener("scroll", o), window.removeEventListener("resize", o), e && clearTimeout(e);
|
|
18
26
|
};
|
|
19
|
-
}, []), /* @__PURE__ */
|
|
20
|
-
|
|
27
|
+
}, [t]), /* @__PURE__ */ n(
|
|
28
|
+
R.Provider,
|
|
21
29
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
value: { isScrolling: m, atBottom: f, atLeft: u, atRight: h, setScrollContainer: l },
|
|
31
|
+
children: /* @__PURE__ */ n(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
ref: l,
|
|
35
|
+
className: S("mds:w-full mds:mx-auto mds:relative", c),
|
|
36
|
+
...a
|
|
37
|
+
}
|
|
38
|
+
)
|
|
25
39
|
}
|
|
26
|
-
)
|
|
40
|
+
);
|
|
27
41
|
};
|
|
28
|
-
|
|
42
|
+
b.displayName = "TableRoot";
|
|
29
43
|
export {
|
|
30
|
-
|
|
44
|
+
b as TableRoot
|
|
31
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("./utils-sX9NhwD-.cjs"),t=({className:s,...r})
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("./utils-sX9NhwD-.cjs"),o=require("./mainstack-design-system600.cjs"),t=({className:s,...l})=>{const{setScrollContainer:r}=o.useTableScroll();return e.jsx("div",{"data-slot":"table-container",ref:r,className:a.cn("mds:overflow-auto mds:md:border mds:md:border-border-interactive-neutral mds:rounded-20 mds:sm:justify-center",s),children:e.jsx("table",{"data-slot":"table",className:"mds:text-left mds:w-full",...l})})};t.displayName="Table";exports.Table=t;
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
import { c as o } from "./utils-BuJ7DVbu.js";
|
|
3
|
+
import { useTableScroll as s } from "./mainstack-design-system600.js";
|
|
4
|
+
const l = ({ className: r, ...t }) => {
|
|
5
|
+
const { setScrollContainer: a } = s();
|
|
6
|
+
return /* @__PURE__ */ e(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
"data-slot": "table-container",
|
|
10
|
+
ref: a,
|
|
11
|
+
className: o(
|
|
12
|
+
"mds:overflow-auto mds:md:border mds:md:border-border-interactive-neutral mds:rounded-20 mds:sm:justify-center",
|
|
13
|
+
r
|
|
14
|
+
),
|
|
15
|
+
children: /* @__PURE__ */ e(
|
|
16
|
+
"table",
|
|
17
|
+
{
|
|
18
|
+
"data-slot": "table",
|
|
19
|
+
className: "mds:text-left mds:w-full",
|
|
20
|
+
...t
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
l.displayName = "Table";
|
|
22
27
|
export {
|
|
23
|
-
|
|
28
|
+
l as Table
|
|
24
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),r=require("./utils-sX9NhwD-.cjs"),n=require("./mainstack-design-system600.cjs"),t=({isSticky:e,stickySide:l="left",className:a,...s})=>{const{atLeft:d,atRight:o}=n.useTableScroll();return m.jsx("td",{role:"cell","data-slot":"table-cell","data-sticky-cell":e,className:r.cn("mds:p-12 mds:body-extrasmall-regular mds:transition-shadow mds:duration-200",e&&"mds:md:sticky mds:md:bg-surface-neutral-l1 mds:md:z-10",e&&l==="left"&&"mds:md:left-0",e&&l==="right"&&"mds:md:right-0",e&&l==="left"&&(d?"mds:shadow-none":"mds:shadow-100"),e&&l==="right"&&(o?"mds:shadow-none":"mds:shadow-100"),a),...s})};t.displayName="TableCell";exports.TableCell=t;
|
|
@@ -1,24 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as t } from "./utils-BuJ7DVbu.js";
|
|
3
|
+
import { useTableScroll as r } from "./mainstack-design-system600.js";
|
|
4
|
+
const n = ({
|
|
4
5
|
isSticky: l,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
stickySide: a = "left",
|
|
7
|
+
className: m,
|
|
8
|
+
...d
|
|
9
|
+
}) => {
|
|
10
|
+
const { atLeft: s, atRight: e } = r();
|
|
11
|
+
return /* @__PURE__ */ o(
|
|
12
|
+
"td",
|
|
13
|
+
{
|
|
14
|
+
role: "cell",
|
|
15
|
+
"data-slot": "table-cell",
|
|
16
|
+
"data-sticky-cell": l,
|
|
17
|
+
className: t(
|
|
18
|
+
"mds:p-12 mds:body-extrasmall-regular mds:transition-shadow mds:duration-200",
|
|
19
|
+
l && "mds:md:sticky mds:md:bg-surface-neutral-l1 mds:md:z-10",
|
|
20
|
+
l && a === "left" && "mds:md:left-0",
|
|
21
|
+
l && a === "right" && "mds:md:right-0",
|
|
22
|
+
l && a === "left" && (s ? "mds:shadow-none" : "mds:shadow-100"),
|
|
23
|
+
l && a === "right" && (e ? "mds:shadow-none" : "mds:shadow-100"),
|
|
24
|
+
m
|
|
25
|
+
),
|
|
26
|
+
...d
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
n.displayName = "TableCell";
|
|
22
31
|
export {
|
|
23
|
-
|
|
32
|
+
n as TableCell
|
|
24
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("./utils-sX9NhwD-.cjs"),r=require("./mainstack-design-system600.cjs"),a=({isSticky:e,stickySide:s="left",className:t,...d})=>{const{atLeft:l,atRight:m}=r.useTableScroll();return o.jsx("th",{role:"columnheader","data-slot":"table-head",className:n.cn(e&&"mds:sticky mds:bg-surface-neutral-l3 mds:z-10",e&&s==="left"&&"mds:left-0",e&&s==="right"&&"mds:right-0",e&&s==="left"&&(l?"mds:shadow-none":"mds:shadow-100"),e&&s==="right"&&(m?"mds:shadow-none":"mds:shadow-100"),"mds:text-secondary mds:px-12 mds:py-16 mds:text-left mds:align-middle mds:body-small-medium mds:whitespace-nowrap mds:transition-shadow mds:duration-200",t),...d})};a.displayName="TableHead";exports.TableHead=a;
|
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "./utils-BuJ7DVbu.js";
|
|
3
|
+
import { useTableScroll as r } from "./mainstack-design-system600.js";
|
|
4
|
+
const n = ({
|
|
5
|
+
isSticky: d,
|
|
6
|
+
stickySide: a = "left",
|
|
7
|
+
className: m,
|
|
8
|
+
...s
|
|
9
|
+
}) => {
|
|
10
|
+
const { atLeft: e, atRight: t } = r();
|
|
11
|
+
return /* @__PURE__ */ o(
|
|
12
|
+
"th",
|
|
13
|
+
{
|
|
14
|
+
role: "columnheader",
|
|
15
|
+
"data-slot": "table-head",
|
|
16
|
+
className: l(
|
|
17
|
+
d && "mds:sticky mds:bg-surface-neutral-l3 mds:z-10",
|
|
18
|
+
d && a === "left" && "mds:left-0",
|
|
19
|
+
d && a === "right" && "mds:right-0",
|
|
20
|
+
d && a === "left" && (e ? "mds:shadow-none" : "mds:shadow-100"),
|
|
21
|
+
d && a === "right" && (t ? "mds:shadow-none" : "mds:shadow-100"),
|
|
22
|
+
"mds:text-secondary mds:px-12 mds:py-16 mds:text-left mds:align-middle mds:body-small-medium mds:whitespace-nowrap mds:transition-shadow mds:duration-200",
|
|
23
|
+
m
|
|
24
|
+
),
|
|
25
|
+
...s
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
n.displayName = "TableHead";
|
|
21
30
|
export {
|
|
22
|
-
|
|
31
|
+
n as TableHead
|
|
23
32
|
};
|