welcome-ui 10.5.0 → 10.6.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/dist/Swiper.js +1 -1
- package/dist/Table.css +1 -1
- package/dist/Table.js +28 -40
- package/dist/types/components/Table/index.d.ts +1 -1
- package/dist/types/components/Table/types.d.ts +2 -6
- package/dist/use-viewport-DuW6YjHT.js +20 -0
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/use-viewport-GQu4vkby.js +0 -20
package/dist/Swiper.js
CHANGED
|
@@ -3,7 +3,7 @@ import './Swiper.css';
|
|
|
3
3
|
import { jsx as $ } from "react/jsx-runtime";
|
|
4
4
|
import { a as z, g as pe, c as K, u as fe } from "./index-B6iGEm-i.js";
|
|
5
5
|
import { useRef as Z, useEffect as W, Children as se, cloneElement as ge, createContext as me, useContext as be, useState as H, useMemo as ee, useCallback as A } from "react";
|
|
6
|
-
import { u as we } from "./use-viewport-
|
|
6
|
+
import { u as we } from "./use-viewport-DuW6YjHT.js";
|
|
7
7
|
import { Button as oe } from "./Button.js";
|
|
8
8
|
import { Icon as le } from "./Icon.js";
|
|
9
9
|
var Y, ae;
|
package/dist/Table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@layer components{._root_msc2t_2{width:100%;overflow:hidden;border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md)}._content_msc2t_8{width:100%;overflow-x:auto}._content_msc2t_8 table{--borderWidth: var(--table-cell-border-width);--borderColorChecked: var(--table-cell-color-border-checked);width:100%;border-collapse:collapse}._content_msc2t_8 table tr{font-family:var(--font-family-body);font-size:var(--font-size-sm);border-bottom-color:var(--table-cell-color-border-default);border-bottom-width:var(--borderWidth);border-bottom-style:solid}._content_msc2t_8 table tr[data-clickable=true]{cursor:pointer}._content_msc2t_8 table tr[data-clickable=true]:hover{border-top-width:var(--borderWidth);border-top-style:solid;background-color:var(--table-cell-color-background-hover);border-color:var(--borderColorChecked)}._content_msc2t_8 table th,._content_msc2t_8 table td{padding:var(--table-cell-padding);text-align:left}._content_msc2t_8 table th:has(>[aria-checked]:only-child),._content_msc2t_8 table td:has(>[aria-checked]:only-child){max-width:var(--table-cell-size-checkbox)}._content_msc2t_8 table thead{background-color:var(--table-header-color-background-warm)}._content_msc2t_8 table thead tr{line-height:var(--font-line-height-xs);font-weight:var(--font-weight-medium)}._content_msc2t_8 table tbody tr{line-height:var(--font-line-height-md);font-weight:var(--font-weight-regular)}._content_msc2t_8 table tbody tr[aria-selected=true]{background-color:var(--table-cell-color-background-checked);border-bottom-width:0}._content_msc2t_8 table tbody tr[aria-selected=true]:not(tr[aria-selected=true]+tr[aria-selected=true]){border-top-width:var(--borderWidth);border-top-color:var(--borderColorChecked)}._content_msc2t_8 table tbody tr[aria-selected=true]:not(:has(+tr[aria-selected=true])){border-bottom-width:var(--borderWidth);border-bottom-color:var(--borderColorChecked)}._content_msc2t_8 table:has(tbody tr[data-clickable=true]:first-child:hover) thead tr,._content_msc2t_8 table:has(tbody tr:first-child[aria-selected=true]) thead tr{border-bottom-width:0}._content_msc2t_8 table tr:has(+tr[data-clickable=true]:hover),._content_msc2t_8 table tr:has(+tr[aria-selected=true]){border-bottom-width:0}._withColumnDivider_msc2t_73 table tbody td{border-right-color:var(--table-cell-color-border-default);border-right-width:var(--table-cell-border-width);border-right-style:solid}._withColumnDivider_msc2t_73 table tbody td:last-child{border-right:none}}
|
package/dist/Table.js
CHANGED
|
@@ -1,47 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Table.css';
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { c as
|
|
6
|
-
const
|
|
7
|
-
root:
|
|
8
|
-
content:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"variant-success": "_variant-success_14phd_62",
|
|
13
|
-
"variant-info": "_variant-info_14phd_66",
|
|
14
|
-
indent: y
|
|
15
|
-
}, r = T(N), o = p(
|
|
16
|
-
({ children: a, className: e, indent: n, ...s }, b) => /* @__PURE__ */ t("div", { className: r("root", e), ref: b, ...s, children: /* @__PURE__ */ t("div", { className: r("content", n && "indent"), children: /* @__PURE__ */ t("table", { children: a }) }) })
|
|
3
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef as b } from "react";
|
|
5
|
+
import { c as h } from "./index-B6iGEm-i.js";
|
|
6
|
+
const p = "_root_msc2t_2", u = "_content_msc2t_8", y = "_withColumnDivider_msc2t_73", N = {
|
|
7
|
+
root: p,
|
|
8
|
+
content: u,
|
|
9
|
+
withColumnDivider: y
|
|
10
|
+
}, s = h(N), n = b(
|
|
11
|
+
({ children: t, className: a, withColumnDivider: o = !1, ...m }, T) => /* @__PURE__ */ e("div", { className: s("root", a), ref: T, ...m, children: /* @__PURE__ */ e("div", { className: s("content", o && "withColumnDivider"), children: /* @__PURE__ */ e("table", { children: t }) }) })
|
|
17
12
|
);
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
_.displayName = "Table.Tr";
|
|
36
|
-
const k = Object.assign(o, {
|
|
37
|
-
Tbody: c,
|
|
38
|
-
Td: l,
|
|
39
|
-
Th: d,
|
|
40
|
-
Thead: i,
|
|
41
|
-
Tr: _
|
|
13
|
+
n.displayName = "Table";
|
|
14
|
+
const r = (t) => /* @__PURE__ */ e("tbody", { ...t });
|
|
15
|
+
r.displayName = "Table.Tbody";
|
|
16
|
+
const l = (t) => /* @__PURE__ */ e("th", { ...t });
|
|
17
|
+
l.displayName = "Table.Th";
|
|
18
|
+
const c = (t) => /* @__PURE__ */ e("thead", { ...t });
|
|
19
|
+
c.displayName = "Table.Thead";
|
|
20
|
+
const i = (t) => /* @__PURE__ */ e("td", { ...t });
|
|
21
|
+
i.displayName = "Table.Td";
|
|
22
|
+
const d = ({ className: t, onClick: a, ...o }) => /* @__PURE__ */ e("tr", { className: t, "data-clickable": !!a, onClick: a, ...o });
|
|
23
|
+
d.displayName = "Table.Tr";
|
|
24
|
+
const w = Object.assign(n, {
|
|
25
|
+
Tbody: r,
|
|
26
|
+
Td: i,
|
|
27
|
+
Th: l,
|
|
28
|
+
Thead: c,
|
|
29
|
+
Tr: d
|
|
42
30
|
});
|
|
43
31
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
w as Table,
|
|
33
|
+
n as TableComponent,
|
|
46
34
|
N as tableClasses
|
|
47
35
|
};
|
|
@@ -20,7 +20,7 @@ export declare const Table: import('react').ForwardRefExoticComponent<Omit<Table
|
|
|
20
20
|
displayName: string;
|
|
21
21
|
};
|
|
22
22
|
Tr: {
|
|
23
|
-
({ className, onClick,
|
|
23
|
+
({ className, onClick, ...rest }: TableTrProps): import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
displayName: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -3,18 +3,14 @@ export type TableProps = ComponentPropsWithRef<'div'> & HTMLAttributes<HTMLDivEl
|
|
|
3
3
|
export type TableTrProps = ComponentPropsWithoutRef<'tr'> & HTMLAttributes<HTMLTableRowElement> & TableTrOptions;
|
|
4
4
|
interface TableOptions {
|
|
5
5
|
/**
|
|
6
|
-
* Add
|
|
6
|
+
* Add vertical divider between columns
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
withColumnDivider?: boolean;
|
|
9
9
|
}
|
|
10
10
|
interface TableTrOptions {
|
|
11
11
|
/**
|
|
12
12
|
* Change the cursor to pointer to indicate the row is clickable
|
|
13
13
|
*/
|
|
14
14
|
onClick?: (props?: unknown) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Change the background color of the row to represent a specific state
|
|
17
|
-
*/
|
|
18
|
-
variant?: 'danger' | 'info' | 'success' | 'warning';
|
|
19
15
|
}
|
|
20
16
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as s, useLayoutEffect as u, useState as a, useRef as f } from "react";
|
|
3
|
+
const m = typeof window > "u" ? s : u;
|
|
4
|
+
function h() {
|
|
5
|
+
const [n, i] = a({ height: void 0, width: void 0 }), e = f();
|
|
6
|
+
return m(() => {
|
|
7
|
+
const t = new ResizeObserver(([o]) => {
|
|
8
|
+
const { blockSize: r, inlineSize: c } = o.contentBoxSize[0];
|
|
9
|
+
cancelAnimationFrame(e.current), e.current = requestAnimationFrame(() => {
|
|
10
|
+
i({ height: r, width: c });
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
return t.observe(document.documentElement), () => {
|
|
14
|
+
cancelAnimationFrame(e.current), t.disconnect();
|
|
15
|
+
};
|
|
16
|
+
}, []), n;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
h as u
|
|
20
|
+
};
|
package/dist/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ import './utils.css';
|
|
|
3
3
|
import { u, b as f } from "./index-B6iGEm-i.js";
|
|
4
4
|
import { c as b } from "./index-B6iGEm-i.js";
|
|
5
5
|
import { f as S } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
6
|
-
import { u as p } from "./use-viewport-
|
|
6
|
+
import { u as p } from "./use-viewport-DuW6YjHT.js";
|
|
7
7
|
import { useState as a, useCallback as d } from "react";
|
|
8
8
|
function y(e = "includeThreshold") {
|
|
9
9
|
const { width: o } = p(), t = u(), i = o ?? (typeof window < "u" ? window.innerWidth : 0), c = (r) => e === "includeThreshold" ? i >= r : i > r, s = Object.keys(t).filter((r) => r !== "xxl").sort((r, n) => t[r] - t[n]);
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect as s, useLayoutEffect as u, useState as f, useRef as d } from "react";
|
|
3
|
-
const m = typeof window > "u" ? s : u, S = 300;
|
|
4
|
-
function z() {
|
|
5
|
-
const [o, i] = f({ height: void 0, width: void 0 }), e = d();
|
|
6
|
-
return m(() => {
|
|
7
|
-
const t = new ResizeObserver(([n]) => {
|
|
8
|
-
const { blockSize: c, inlineSize: r } = n.contentBoxSize[0];
|
|
9
|
-
clearTimeout(e.current), e.current = setTimeout(() => {
|
|
10
|
-
i({ height: c, width: r });
|
|
11
|
-
}, S);
|
|
12
|
-
});
|
|
13
|
-
return t.observe(document.documentElement), () => {
|
|
14
|
-
clearTimeout(e.current), t.disconnect();
|
|
15
|
-
};
|
|
16
|
-
}, []), o;
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
z as u
|
|
20
|
-
};
|