@solibo/solibo-ui 0.4.12 → 0.5.4
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/README.md +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +0 -1
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/_avatar/index.cjs +1 -1
- package/dist/components/_avatar/index.cjs.map +1 -1
- package/dist/components/_avatar/index.js +9 -9
- package/dist/components/_avatar/index.js.map +1 -1
- package/dist/components/_card/index.cjs +1 -1
- package/dist/components/_card/index.js +12 -12
- package/dist/components/_collapsible/index.cjs +1 -1
- package/dist/components/_collapsible/index.js +1 -1
- package/dist/components/_croppable/index.cjs +1 -1
- package/dist/components/_croppable/index.js +175 -175
- package/dist/components/_dropdown/index.cjs +1 -1
- package/dist/components/_dropdown/index.cjs.map +1 -1
- package/dist/components/_dropdown/index.js +87 -87
- package/dist/components/_dropdown/index.js.map +1 -1
- package/dist/components/_dropzone/index.cjs +1 -1
- package/dist/components/_dropzone/index.js +34 -34
- package/dist/components/_editor/index.cjs +16 -16
- package/dist/components/_editor/index.cjs.map +1 -1
- package/dist/components/_editor/index.js +19 -19
- package/dist/components/_editor/index.js.map +1 -1
- package/dist/components/_messages/index.cjs +1 -1
- package/dist/components/_messages/index.cjs.map +1 -1
- package/dist/components/_messages/index.js +15 -15
- package/dist/components/_messages/index.js.map +1 -1
- package/dist/components/_portal/index.cjs +1 -1
- package/dist/components/_portal/index.cjs.map +1 -1
- package/dist/components/_portal/index.js +17 -16
- package/dist/components/_portal/index.js.map +1 -1
- package/dist/components/_sortable/index.cjs +1 -1
- package/dist/components/_sortable/index.cjs.map +1 -1
- package/dist/components/_sortable/index.js +21 -21
- package/dist/components/_sortable/index.js.map +1 -1
- package/dist/components/_widget/index.cjs +1 -1
- package/dist/components/_widget/index.js +3 -3
- package/dist/components/app-link/index.cjs +1 -1
- package/dist/components/app-link/index.cjs.map +1 -1
- package/dist/components/app-link/index.js +9 -9
- package/dist/components/app-link/index.js.map +1 -1
- package/dist/components/aside/index.cjs +1 -1
- package/dist/components/aside/index.js +6 -6
- package/dist/components/badge/index.cjs +1 -1
- package/dist/components/badge/index.cjs.map +1 -1
- package/dist/components/badge/index.js +19 -18
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/banner/index.cjs +1 -1
- package/dist/components/banner/index.js +9 -9
- package/dist/components/branding/index.cjs +1 -1
- package/dist/components/branding/index.js +12 -12
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +12 -12
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +7 -7
- package/dist/components/controls/index.cjs +1 -1
- package/dist/components/controls/index.cjs.map +1 -1
- package/dist/components/controls/index.js +21 -10
- package/dist/components/controls/index.js.map +1 -1
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.js +3 -3
- package/dist/components/figure/index.cjs +1 -1
- package/dist/components/figure/index.cjs.map +1 -1
- package/dist/components/figure/index.js +11 -11
- package/dist/components/figure/index.js.map +1 -1
- package/dist/components/file/index.cjs +1 -1
- package/dist/components/file/index.cjs.map +1 -1
- package/dist/components/file/index.js +14 -13
- package/dist/components/file/index.js.map +1 -1
- package/dist/components/footer/index.cjs +1 -1
- package/dist/components/footer/index.js +3 -3
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +11 -11
- package/dist/components/graph/index.cjs +1 -1
- package/dist/components/graph/index.cjs.map +1 -1
- package/dist/components/graph/index.js +31 -31
- package/dist/components/graph/index.js.map +1 -1
- package/dist/components/group/index.cjs +1 -1
- package/dist/components/group/index.js +1 -1
- package/dist/components/header/index.cjs +1 -1
- package/dist/components/header/index.js +3 -3
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.cjs.map +1 -1
- package/dist/components/icon/index.js +26 -26
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/image/index.cjs +1 -1
- package/dist/components/image/index.js +9 -9
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.cjs.map +1 -1
- package/dist/components/input/index.js +34 -33
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/link/index.cjs +1 -1
- package/dist/components/link/index.js +11 -11
- package/dist/components/list/index.cjs +1 -1
- package/dist/components/list/index.js +7 -7
- package/dist/components/loading/index.cjs +1 -1
- package/dist/components/loading/index.js +13 -13
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.js +7 -7
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.js +23 -23
- package/dist/components/object/index.cjs +1 -1
- package/dist/components/object/index.cjs.map +1 -1
- package/dist/components/object/index.js +1 -1
- package/dist/components/object/index.js.map +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/table/index.cjs +1 -1
- package/dist/components/table/index.cjs.map +1 -1
- package/dist/components/table/index.js +22 -22
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.cjs.map +1 -1
- package/dist/components/textarea/index.js +23 -23
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.cjs.map +1 -1
- package/dist/components/toast/index.js +23 -24
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/toolbar/index.cjs +1 -1
- package/dist/components/toolbar/index.js +9 -9
- package/dist/index-CiEbbnD6.js +42 -0
- package/dist/index-CiEbbnD6.js.map +1 -0
- package/dist/index-ClrKYsAQ.cjs +2 -0
- package/dist/index-ClrKYsAQ.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +20 -23
- package/dist/index.js +40 -42
- package/dist/index.js.map +1 -1
- package/dist/styles.module-BOTEBJ0C.js +9 -0
- package/dist/styles.module-BOTEBJ0C.js.map +1 -0
- package/dist/styles.module-BPvMQa_x.cjs +2 -0
- package/dist/styles.module-BPvMQa_x.cjs.map +1 -0
- package/dist/tokens.css +44 -12
- package/dist/tokens.json +541 -68
- package/package.json +1 -1
- package/dist/assets/index45.css +0 -1
- package/dist/components/layout/index.cjs +0 -2
- package/dist/components/layout/index.cjs.map +0 -1
- package/dist/components/layout/index.js +0 -18
- package/dist/components/layout/index.js.map +0 -1
- package/dist/index-BNaQZHo6.js +0 -40
- package/dist/index-BNaQZHo6.js.map +0 -1
- package/dist/index-Bh5n72jH.cjs +0 -2
- package/dist/index-Bh5n72jH.cjs.map +0 -1
- package/dist/styles.module-DZXAP_eP.js +0 -8
- package/dist/styles.module-DZXAP_eP.js.map +0 -1
- package/dist/styles.module-Vt6mmlsz.cjs +0 -2
- package/dist/styles.module-Vt6mmlsz.cjs.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import '../../assets/
|
|
4
|
-
link:
|
|
5
|
-
primary:
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { t as _ } from "../../classix-DG18itHa.js";
|
|
3
|
+
import '../../assets/index37.css';const s = "_link_xhd9q_1", l = "_primary_xhd9q_7", e = "_danger_xhd9q_13", c = "_minimal_xhd9q_21", n = {
|
|
4
|
+
link: s,
|
|
5
|
+
primary: l,
|
|
6
6
|
danger: e,
|
|
7
7
|
minimal: c
|
|
8
8
|
}, k = ({
|
|
9
|
-
children:
|
|
10
|
-
className:
|
|
11
|
-
to:
|
|
12
|
-
variant:
|
|
13
|
-
...
|
|
14
|
-
}) => /* @__PURE__ */
|
|
9
|
+
children: r,
|
|
10
|
+
className: i,
|
|
11
|
+
to: m = "#",
|
|
12
|
+
variant: a = "primary",
|
|
13
|
+
...t
|
|
14
|
+
}) => /* @__PURE__ */ o("a", { className: _(i, n.link, n[a]), href: m, ...t, "data-component": "link", children: r });
|
|
15
15
|
export {
|
|
16
16
|
k as Link
|
|
17
17
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const c=require("react/jsx-runtime"),_=require("../../classix-5H4IWnMA.cjs"),r=require("../../helpers-BD5fFZi-.cjs"),d="_horizontal_1w5i6_1",w="_list_1w5i6_12",x="_columns_1w5i6_53",s={horizontal:d,list:w,columns:x};function y({children:t,className:a,columns:o=1,horizontal:u,ordered:m,style:h,...l}){const i=Number.isFinite(o)?Math.max(1,Math.floor(o)):1,n=_.t(a,s.list,i>1&&s.columns,u&&s.horizontal),e={...h,"--list-columns":i};return m?c.jsx("ol",{className:n,style:e,...l,"data-component":"list",children:r.wrapChildren(t)}):c.jsx("ul",{className:n,style:e,...l,"data-component":"list",children:r.wrapChildren(t)})}exports.List=y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { t as u } from "../../classix-DG18itHa.js";
|
|
3
|
-
import { w as
|
|
4
|
-
import '../../assets/
|
|
5
|
-
horizontal:
|
|
3
|
+
import { w as r } from "../../helpers-D56OHkFI.js";
|
|
4
|
+
import '../../assets/index38.css';const w = "_horizontal_1w5i6_1", f = "_list_1w5i6_12", p = "_columns_1w5i6_53", t = {
|
|
5
|
+
horizontal: w,
|
|
6
6
|
list: f,
|
|
7
7
|
columns: p
|
|
8
8
|
};
|
|
9
9
|
function y({
|
|
10
10
|
children: o,
|
|
11
|
-
className:
|
|
11
|
+
className: m,
|
|
12
12
|
columns: s = 1,
|
|
13
13
|
horizontal: e,
|
|
14
14
|
ordered: h,
|
|
15
15
|
style: _,
|
|
16
16
|
...l
|
|
17
17
|
}) {
|
|
18
|
-
const
|
|
18
|
+
const i = Number.isFinite(s) ? Math.max(1, Math.floor(s)) : 1, n = u(m, t.list, i > 1 && t.columns, e && t.horizontal), a = {
|
|
19
19
|
..._,
|
|
20
|
-
"--list-columns":
|
|
20
|
+
"--list-columns": i
|
|
21
21
|
};
|
|
22
|
-
return h ? /* @__PURE__ */ c("ol", { className:
|
|
22
|
+
return h ? /* @__PURE__ */ c("ol", { className: n, style: a, ...l, "data-component": "list", children: r(o) }) : /* @__PURE__ */ c("ul", { className: n, style: a, ...l, "data-component": "list", children: r(o) });
|
|
23
23
|
}
|
|
24
24
|
export {
|
|
25
25
|
y as List
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index14.css');const t=require("react/jsx-runtime"),i=require("../../classix-5H4IWnMA.cjs"),c="_loading_1nndz_23",l="_spin_1nndz_1",_="_ping_1nndz_39",r="_sticky_1nndz_65",s={loading:c,default:"_default_1nndz_28",spin:l,ping:_,sticky:r},g=({variant:o="default",size:n,sticky:d=!1,...a})=>{const e={"--border-size":n?n/8+"px":void 0,"--size":n?n+"px":void 0};return t.jsx("div",{className:i.t(s.loading,d&&s.sticky),"data-component":"loading",children:t.jsx("span",{className:i.t(s.loading,s[o]),style:e,...a})})};exports.Loading=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { t
|
|
3
|
-
import '../../assets/
|
|
4
|
-
loading:
|
|
5
|
-
default: "
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { t } from "../../classix-DG18itHa.js";
|
|
3
|
+
import '../../assets/index14.css';const l = "_loading_1nndz_23", _ = "_spin_1nndz_1", p = "_ping_1nndz_39", e = "_sticky_1nndz_65", o = {
|
|
4
|
+
loading: l,
|
|
5
|
+
default: "_default_1nndz_28",
|
|
6
6
|
spin: _,
|
|
7
7
|
ping: p,
|
|
8
8
|
sticky: e
|
|
9
|
-
},
|
|
9
|
+
}, m = ({
|
|
10
10
|
variant: i = "default",
|
|
11
|
-
size:
|
|
12
|
-
sticky:
|
|
11
|
+
size: n,
|
|
12
|
+
sticky: d = !1,
|
|
13
13
|
...a
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
"--border-size":
|
|
17
|
-
"--size":
|
|
15
|
+
const c = {
|
|
16
|
+
"--border-size": n ? n / 8 + "px" : void 0,
|
|
17
|
+
"--size": n ? n + "px" : void 0
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ s("div", { className: t(o.loading, d && o.sticky), "data-component": "loading", children: /* @__PURE__ */ s("span", { className: t(o.loading, o[i]), style: c, ...a }) });
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
m as Loading
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),o=require("../../classix-5H4IWnMA.cjs"),r=require("../icon/index.cjs"),c="_message_k0j8z_1",m="_preview_k0j8z_40",t={message:c,preview:m},g=({content:a,id:n,preview:i,type:e="default"})=>s.jsxs("div",{className:o.t(t.message,i&&t.preview),"data-id":n,"data-type":e,"data-component":"message",children:[e=="system"&&s.jsx(r.Icon,{gap:"right",name:"info"}),a]});exports.Message=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { t as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import '../../assets/
|
|
5
|
-
message:
|
|
6
|
-
preview:
|
|
2
|
+
import { t as i } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { Icon as n } from "../icon/index.js";
|
|
4
|
+
import '../../assets/index39.css';const p = "_message_k0j8z_1", c = "_preview_k0j8z_40", s = {
|
|
5
|
+
message: p,
|
|
6
|
+
preview: c
|
|
7
7
|
}, f = ({
|
|
8
8
|
content: t,
|
|
9
9
|
id: a,
|
|
10
10
|
preview: m,
|
|
11
11
|
type: e = "default"
|
|
12
|
-
}) => /* @__PURE__ */ o("div", { className:
|
|
13
|
-
e == "system" && /* @__PURE__ */ r(
|
|
12
|
+
}) => /* @__PURE__ */ o("div", { className: i(s.message, m && s.preview), "data-id": a, "data-type": e, "data-component": "message", children: [
|
|
13
|
+
e == "system" && /* @__PURE__ */ r(n, { gap: "right", name: "info" }),
|
|
14
14
|
t
|
|
15
15
|
] });
|
|
16
16
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const p=require("react/jsx-runtime"),_=require("../../classix-5H4IWnMA.cjs"),f=require("react"),v=require("../../icons-C_cX1FYp.cjs"),h="_nav_2unxd_1",x="_horizontal_2unxd_7",b="_tabs_2unxd_17",g="_pills_2unxd_38",t={nav:h,horizontal:x,tabs:b,pills:g},m={default:t.default,pills:t.pills,tabs:t.tabs},w=({animation:o,children:i,className:l,horizontal:s=!1,variant:e="default",...r})=>{const[c,a]=f.useState(!1),u={"--icon-svg":v.iconSVG("chevron")};return p.jsx("nav",{className:_.t(l,s&&t.horizontal,t.nav,m[e]),"data-animation":o,"data-open":c?"true":"false","data-orientation":s?"horizontal":"vertical",onBlurCapture:n=>{if(e!=="pills"||window.innerWidth>960)return;const d=n.relatedTarget;n.currentTarget.contains(d)||a(!1)},onClick:()=>{e!=="pills"||window.innerWidth>960||a(n=>!n)},style:u,...r,"data-component":"nav",children:i})};exports.Nav=w;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { i as
|
|
5
|
-
import '../../assets/
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { t as f } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { useState as _ } from "react";
|
|
4
|
+
import { i as m } from "../../icons-DfmpRbxE.js";
|
|
5
|
+
import '../../assets/index40.css';const v = "_nav_2unxd_1", h = "_horizontal_2unxd_7", x = "_tabs_2unxd_17", b = "_pills_2unxd_38", t = {
|
|
6
6
|
nav: v,
|
|
7
7
|
horizontal: h,
|
|
8
|
-
tabs:
|
|
9
|
-
pills:
|
|
8
|
+
tabs: x,
|
|
9
|
+
pills: b
|
|
10
10
|
}, w = {
|
|
11
11
|
default: t.default,
|
|
12
12
|
pills: t.pills,
|
|
13
13
|
tabs: t.tabs
|
|
14
|
-
},
|
|
15
|
-
animation:
|
|
16
|
-
children:
|
|
17
|
-
className:
|
|
18
|
-
horizontal:
|
|
19
|
-
variant:
|
|
20
|
-
...
|
|
14
|
+
}, N = ({
|
|
15
|
+
animation: i,
|
|
16
|
+
children: e,
|
|
17
|
+
className: l,
|
|
18
|
+
horizontal: o = !1,
|
|
19
|
+
variant: a = "default",
|
|
20
|
+
...r
|
|
21
21
|
}) => {
|
|
22
|
-
const [c, s] =
|
|
23
|
-
"--icon-svg":
|
|
22
|
+
const [c, s] = _(!1), p = {
|
|
23
|
+
"--icon-svg": m("chevron")
|
|
24
24
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
n.currentTarget.contains(
|
|
25
|
+
return /* @__PURE__ */ u("nav", { className: f(l, o && t.horizontal, t.nav, w[a]), "data-animation": i, "data-open": c ? "true" : "false", "data-orientation": o ? "horizontal" : "vertical", onBlurCapture: (n) => {
|
|
26
|
+
if (a !== "pills" || window.innerWidth > 960) return;
|
|
27
|
+
const d = n.relatedTarget;
|
|
28
|
+
n.currentTarget.contains(d) || s(!1);
|
|
29
29
|
}, onClick: () => {
|
|
30
|
-
|
|
31
|
-
}, style: p, ...
|
|
30
|
+
a !== "pills" || window.innerWidth > 960 || s((n) => !n);
|
|
31
|
+
}, style: p, ...r, "data-component": "nav", children: e });
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
N as Nav
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index4.css');const e=require("react/jsx-runtime"),n="_object_1esdj_1",s={object:n},a=({
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index4.css');const e=require("react/jsx-runtime"),n="_object_1esdj_1",s={object:n},a=({accessibleLabel:c,url:t,...o})=>e.jsx("object",{"aria-label":c,className:s.object,data:t,type:"application/pdf",...o,"data-component":"objectcomponent",children:t&&e.jsxs(e.Fragment,{children:["We cannot show this file. You can try accessing it directly:",e.jsx("br",{}),e.jsx("a",{href:t,children:t})]})});exports.Object=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/object/index.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport styles from './styles.module.css';\n\nexport type ObjectProps = Omit<ComponentPropsWithoutRef<'object'>, 'data' | 'type'> & {\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/object/index.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport styles from './styles.module.css';\n\nexport type ObjectProps = Omit<ComponentPropsWithoutRef<'object'>, 'data' | 'type'> & {\n accessibleLabel: string;\n url: string;\n};\n\nconst ObjectComponent = ({ accessibleLabel, url, ...props }: ObjectProps) => {\n return (\n <object\n aria-label={accessibleLabel}\n className={styles.object}\n data={url}\n type={`application/pdf`}\n {...props}\n >\n {url && (\n <>\n We cannot show this file. You can try accessing it directly:\n <br />\n <a href={url}>{url}</a>\n </>\n )}\n </object>\n );\n};\n\nexport { ObjectComponent as Object };\n"],"names":["ObjectComponent","accessibleLabel","url","props","styles","object","jsxs","Fragment","jsx"],"mappings":"sJASMA,EAAkBA,CAAC,CAAEC,gBAAAA,EAAiBC,IAAAA,EAAK,GAAGC,CAAmB,UAElE,SAAA,CACC,aAAYF,EACZ,UAAWG,EAAOC,OAClB,KAAMH,EACN,KAAM,kBACN,GAAIC,EAAM,iBAAA,kBAETD,YACCI,EAAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,qEAEG,KAAA,EAAE,EACHC,EAAAA,IAAC,IAAA,CAAE,KAAMN,EAAMA,SAAAA,CAAAA,CAAI,CAAA,CAAA,CACrB,CAAA,CAEJ"}
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as n, Fragment as a } from "react/jsx-runtime";
|
|
|
2
2
|
import '../../assets/index4.css';const s = "_object_1esdj_1", i = {
|
|
3
3
|
object: s
|
|
4
4
|
}, r = ({
|
|
5
|
-
|
|
5
|
+
accessibleLabel: c,
|
|
6
6
|
url: t,
|
|
7
7
|
...o
|
|
8
8
|
}) => /* @__PURE__ */ e("object", { "aria-label": c, className: i.object, data: t, type: "application/pdf", ...o, "data-component": "objectcomponent", children: t && /* @__PURE__ */ n(a, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/object/index.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport styles from './styles.module.css';\n\nexport type ObjectProps = Omit<ComponentPropsWithoutRef<'object'>, 'data' | 'type'> & {\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/object/index.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport styles from './styles.module.css';\n\nexport type ObjectProps = Omit<ComponentPropsWithoutRef<'object'>, 'data' | 'type'> & {\n accessibleLabel: string;\n url: string;\n};\n\nconst ObjectComponent = ({ accessibleLabel, url, ...props }: ObjectProps) => {\n return (\n <object\n aria-label={accessibleLabel}\n className={styles.object}\n data={url}\n type={`application/pdf`}\n {...props}\n >\n {url && (\n <>\n We cannot show this file. You can try accessing it directly:\n <br />\n <a href={url}>{url}</a>\n </>\n )}\n </object>\n );\n};\n\nexport { ObjectComponent as Object };\n"],"names":["ObjectComponent","accessibleLabel","url","props","styles","object","jsxs","Fragment","jsx"],"mappings":";;;GASMA,IAAkBA,CAAC;AAAA,EAAEC,iBAAAA;AAAAA,EAAiBC,KAAAA;AAAAA,EAAK,GAAGC;AAAmB,wBAElE,UAAA,EACC,cAAYF,GACZ,WAAWG,EAAOC,QAClB,MAAMH,GACN,MAAM,mBACN,GAAIC,GAAM,kBAAA,mBAETD,eACC,gBAAAI,EAAAC,GAAA,EAAA,UAAA;AAAA,EAAA;AAAA,oBAEG,MAAA,EAAE;AAAA,EACH,gBAAAC,EAAC,KAAA,EAAE,MAAMN,GAAMA,UAAAA,EAAAA,CAAI;AAAA,EAAA,CACrB,EAAA,CAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("../../icons-C_cX1FYp.cjs");require("../../utils-DBzf7CFq.cjs");const e=require("../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("../../icons-C_cX1FYp.cjs");require("../../utils-DBzf7CFq.cjs");const e=require("../../index-ClrKYsAQ.cjs");exports.Select=e.Select;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "../../classix-DG18itHa.js";
|
|
3
3
|
import "../../icons-DfmpRbxE.js";
|
|
4
4
|
import "../../utils--n2yqjCy.js";
|
|
5
|
-
import { S as e } from "../../index-
|
|
5
|
+
import { S as e } from "../../index-CiEbbnD6.js";
|
|
6
6
|
export {
|
|
7
7
|
e as Select
|
|
8
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index3.css');const f=require("react/jsx-runtime"),i=require("react"),k=require("../icon/index.cjs"),z="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index3.css');const f=require("react/jsx-runtime"),i=require("react"),k=require("../icon/index.cjs"),z="_table_1egqd_1",D="_sortable_1egqd_27",h={table:z,sortable:D},m=r=>i.isValidElement(r),q=r=>i.Children.toArray(r).reduce((e,t)=>m(t)?e+(t.type==="td"||t.type==="th"?1:q(t.props.children)):e,0),v=r=>{for(const e of i.Children.toArray(r)){if(!m(e))continue;if(e.type==="tr")return q(e.props.children);const t=v(e.props.children);if(t!==null)return t}return null},S=(r,e)=>i.Children.map(r,t=>{if(!m(t))return t;let s=t.props.children===void 0?t.props.children:S(t.props.children,e),n;return t.type==="td"&&t.props["data-span"]==="all"&&(n={colSpan:e}),t.type==="th"&&t.props["data-type"]&&(s=f.jsxs("span",{className:h.sortable,children:[s,f.jsx(k.Icon,{name:"updown",variant:"primary"})]})),n||s!==t.props.children?i.cloneElement(t,n,s):t}),I=(r,e,t,s,n=1)=>{if(t==="text")return r.localeCompare(e,s,{sensitivity:"base"})*n;const l=t==="date"?Date.parse(r):Number.parseFloat(r),c=t==="date"?Date.parse(e):Number.parseFloat(e);return Number.isNaN(l)&&Number.isNaN(c)?0:Number.isNaN(l)?1:Number.isNaN(c)?-1:(l-c)*n},P=({children:r,locale:e,...t})=>{const s=i.useRef(null),n=v(r),l=n&&n>0?S(r,n):r,c=(d,u,o)=>{d.querySelectorAll("th[data-type]").forEach(a=>{a===u?(a.dataset.dir=o,a.setAttribute("aria-sort",o==="asc"?"ascending":"descending")):(delete a.dataset.dir,a.setAttribute("aria-sort","none"))})},j=i.useCallback(d=>{var x,g;const u=s.current;if(!u)return;const o=(x=d.target)==null?void 0:x.closest("th");if(!o)return;const p=u.tHead;if(!p||!p.contains(o))return;const a=o.cellIndex;if(a<0)return;const b=(g=u.tBodies)==null?void 0:g[0];if(!b)return;const y=o.getAttribute("data-type");if(!y)return;const N=o.dataset.dir==="asc"?"desc":"asc";c(p,o,N);const w=N==="asc"?1:-1,C=Array.from(b.rows);C.sort((E,R)=>{var _,A;const T=(((_=E.cells[a])==null?void 0:_.textContent)??"").trim(),F=(((A=R.cells[a])==null?void 0:A.textContent)??"").trim();return I(T,F,y,e,w)}),b.append(...C)},[e]);return f.jsx("table",{className:h.table,onClick:j,ref:s,...t,"data-component":"table",children:l})};exports.Table=P;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/table/index.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, useCallback, useRef } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type TableProps = React.TableHTMLAttributes<HTMLTableElement> & {\n children?: React.ReactNode;\n locale?: string | string[];\n};\n\ntype SortType = 'date' | 'number' | 'text';\n\ntype TableChildProps = {\n children?: React.ReactNode;\n colSpan?: number;\n 'data-span'?: string;\n 'data-type'?: SortType;\n};\n\nconst isTableElement = (child: React.ReactNode): child is React.ReactElement<TableChildProps> =>\n isValidElement<TableChildProps>(child);\n\nconst countCells = (children: React.ReactNode): number =>\n Children.toArray(children).reduce<number>((count, child) => {\n if (!isTableElement(child)) return count;\n return (\n count + (child.type === 'td' || child.type === 'th' ? 1 : countCells(child.props.children))\n );\n }, 0);\n\nconst getFirstRowCellCount = (children: React.ReactNode): number | null => {\n for (const child of Children.toArray(children)) {\n if (!isTableElement(child)) continue;\n\n if (child.type === 'tr') return countCells(child.props.children);\n\n const nestedCount = getFirstRowCellCount(child.props.children);\n if (nestedCount !== null) return nestedCount;\n }\n\n return null;\n};\n\nconst normalizeChildren = (children: React.ReactNode, columnCount: number): React.ReactNode =>\n Children.map(children, (child) => {\n if (!isTableElement(child)) return child;\n\n let nextChildren =\n child.props.children === undefined\n ? child.props.children\n : normalizeChildren(child.props.children, columnCount);\n let nextProps: Partial<TableChildProps> | undefined;\n\n if (child.type === 'td' && child.props['data-span'] === 'all') {\n nextProps = { colSpan: columnCount };\n }\n\n if (child.type === 'th' && child.props['data-type']) {\n nextChildren = (\n <span className={styles.sortable}>\n {nextChildren}\n <Icon\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/table/index.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, useCallback, useRef } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type TableProps = React.TableHTMLAttributes<HTMLTableElement> & {\n children?: React.ReactNode;\n locale?: string | string[];\n};\n\ntype SortType = 'date' | 'number' | 'text';\n\ntype TableChildProps = {\n children?: React.ReactNode;\n colSpan?: number;\n 'data-span'?: string;\n 'data-type'?: SortType;\n};\n\nconst isTableElement = (child: React.ReactNode): child is React.ReactElement<TableChildProps> =>\n isValidElement<TableChildProps>(child);\n\nconst countCells = (children: React.ReactNode): number =>\n Children.toArray(children).reduce<number>((count, child) => {\n if (!isTableElement(child)) return count;\n return (\n count + (child.type === 'td' || child.type === 'th' ? 1 : countCells(child.props.children))\n );\n }, 0);\n\nconst getFirstRowCellCount = (children: React.ReactNode): number | null => {\n for (const child of Children.toArray(children)) {\n if (!isTableElement(child)) continue;\n\n if (child.type === 'tr') return countCells(child.props.children);\n\n const nestedCount = getFirstRowCellCount(child.props.children);\n if (nestedCount !== null) return nestedCount;\n }\n\n return null;\n};\n\nconst normalizeChildren = (children: React.ReactNode, columnCount: number): React.ReactNode =>\n Children.map(children, (child) => {\n if (!isTableElement(child)) return child;\n\n let nextChildren =\n child.props.children === undefined\n ? child.props.children\n : normalizeChildren(child.props.children, columnCount);\n let nextProps: Partial<TableChildProps> | undefined;\n\n if (child.type === 'td' && child.props['data-span'] === 'all') {\n nextProps = { colSpan: columnCount };\n }\n\n if (child.type === 'th' && child.props['data-type']) {\n nextChildren = (\n <span className={styles.sortable}>\n {nextChildren}\n <Icon\n name='updown'\n variant='primary'\n />\n </span>\n );\n }\n\n return nextProps || nextChildren !== child.props.children\n ? cloneElement(child, nextProps, nextChildren)\n : child;\n });\n\n/**\n * Sortable columns must provide data-type (text, number, or date) in the `th` element.\n */\n\nconst compare = (a: string, b: string, type: SortType, locale?: string | string[], dir = 1) => {\n if (type === 'text') {\n return a.localeCompare(b, locale, { sensitivity: 'base' }) * dir;\n }\n\n const left = type === 'date' ? Date.parse(a) : Number.parseFloat(a);\n const right = type === 'date' ? Date.parse(b) : Number.parseFloat(b);\n\n if (Number.isNaN(left) && Number.isNaN(right)) return 0;\n if (Number.isNaN(left)) return 1;\n if (Number.isNaN(right)) return -1;\n return (left - right) * dir;\n};\n\nexport const Table = ({ children, locale, ...props }: TableProps) => {\n const ref = useRef<HTMLTableElement | null>(null);\n const columnCount = getFirstRowCellCount(children);\n const normalizedChildren =\n columnCount && columnCount > 0 ? normalizeChildren(children, columnCount) : children;\n\n const setSortState = (\n thead: HTMLTableSectionElement,\n active: HTMLTableCellElement,\n dir: 'asc' | 'desc'\n ) => {\n const ths = thead.querySelectorAll<HTMLTableCellElement>('th[data-type]');\n\n ths.forEach((th) => {\n if (th === active) {\n th.dataset.dir = dir;\n th.setAttribute('aria-sort', dir === 'asc' ? 'ascending' : 'descending');\n } else {\n delete th.dataset.dir;\n th.setAttribute('aria-sort', 'none');\n }\n });\n };\n\n const onClick = useCallback(\n (e: React.MouseEvent<HTMLTableElement>) => {\n const table = ref.current;\n if (!table) return;\n\n const th = (e.target as HTMLElement | null)?.closest('th');\n if (!th) return;\n\n const thead = table.tHead;\n if (!thead || !thead.contains(th)) return;\n\n const col = th.cellIndex;\n if (col < 0) return;\n\n const tbody = table.tBodies?.[0];\n if (!tbody) return;\n\n const type = th.getAttribute('data-type') as SortType | null;\n if (!type) return;\n\n const direction = th.dataset.dir === 'asc' ? 'desc' : 'asc';\n setSortState(thead, th, direction);\n const dir = direction === 'asc' ? 1 : -1;\n\n const rows = Array.from(tbody.rows);\n\n rows.sort((a, b) => {\n const av = (a.cells[col]?.textContent ?? '').trim();\n const bv = (b.cells[col]?.textContent ?? '').trim();\n return compare(av, bv, type, locale, dir);\n });\n\n tbody.append(...rows);\n },\n [locale]\n );\n\n return (\n <table\n className={styles.table}\n onClick={onClick}\n ref={ref}\n {...props}\n >\n {normalizedChildren}\n </table>\n );\n};\n"],"names":["isTableElement","child","isValidElement","countCells","children","Children","toArray","reduce","count","type","props","getFirstRowCellCount","nestedCount","normalizeChildren","columnCount","map","nextChildren","undefined","nextProps","colSpan","jsxs","styles","sortable","jsx","Icon","cloneElement","compare","a","b","locale","dir","localeCompare","sensitivity","left","Date","parse","Number","parseFloat","right","isNaN","Table","ref","useRef","normalizedChildren","setSortState","thead","active","querySelectorAll","forEach","th","dataset","setAttribute","onClick","useCallback","e","table","current","target","closest","tHead","contains","col","cellIndex","tbody","tBodies","getAttribute","direction","rows","Array","from","sort","av","cells","textContent","trim","bv","append"],"mappings":"wOAmBMA,EAAkBC,GACtBC,EAAAA,eAAgCD,CAAK,EAEjCE,EAAcC,GAClBC,EAAAA,SAASC,QAAQF,CAAQ,EAAEG,OAAe,CAACC,EAAOP,IAC3CD,EAAeC,CAAK,EAEvBO,GAASP,EAAMQ,OAAS,MAAQR,EAAMQ,OAAS,KAAO,EAAIN,EAAWF,EAAMS,MAAMN,QAAQ,GAFxDI,EAIlC,CAAC,EAEAG,EAAwBP,GAA6C,CACzE,UAAWH,KAASI,EAAAA,SAASC,QAAQF,CAAQ,EAAG,CAC9C,GAAI,CAACJ,EAAeC,CAAK,EAAG,SAE5B,GAAIA,EAAMQ,OAAS,YAAaN,EAAWF,EAAMS,MAAMN,QAAQ,EAE/D,MAAMQ,EAAcD,EAAqBV,EAAMS,MAAMN,QAAQ,EAC7D,GAAIQ,IAAgB,KAAM,OAAOA,CACnC,CAEA,OAAO,IACT,EAEMC,EAAoBA,CAACT,EAA2BU,IACpDT,EAAAA,SAASU,IAAIX,EAAWH,GAAU,CAChC,GAAI,CAACD,EAAeC,CAAK,EAAG,OAAOA,EAEnC,IAAIe,EACFf,EAAMS,MAAMN,WAAaa,OACrBhB,EAAMS,MAAMN,SACZS,EA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A,CACC,UAAWF,EAAOkC,MAClB,QAAAH,EACA,IAAAX,EACA,GAAI/B,EAAM,iBAAA,QAETiC,SAAAA,CAAAA,CACH,CAEJ"}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsx as _, jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as _, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as I, useCallback as R, Children as f, cloneElement as T, isValidElement as B } from "react";
|
|
3
3
|
import { Icon as H } from "../icon/index.js";
|
|
4
|
-
import '../../assets/index3.css';const P = "
|
|
4
|
+
import '../../assets/index3.css';const P = "_table_1egqd_1", V = "_sortable_1egqd_27", v = {
|
|
5
5
|
table: P,
|
|
6
6
|
sortable: V
|
|
7
|
-
}, m = (r) => B(r),
|
|
7
|
+
}, m = (r) => B(r), h = (r) => f.toArray(r).reduce((e, t) => m(t) ? e + (t.type === "td" || t.type === "th" ? 1 : h(t.props.children)) : e, 0), w = (r) => {
|
|
8
8
|
for (const e of f.toArray(r)) {
|
|
9
9
|
if (!m(e)) continue;
|
|
10
|
-
if (e.type === "tr") return
|
|
11
|
-
const t =
|
|
10
|
+
if (e.type === "tr") return h(e.props.children);
|
|
11
|
+
const t = w(e.props.children);
|
|
12
12
|
if (t !== null) return t;
|
|
13
13
|
}
|
|
14
14
|
return null;
|
|
15
|
-
},
|
|
15
|
+
}, E = (r, e) => f.map(r, (t) => {
|
|
16
16
|
if (!m(t)) return t;
|
|
17
|
-
let s = t.props.children === void 0 ? t.props.children :
|
|
17
|
+
let s = t.props.children === void 0 ? t.props.children : E(t.props.children, e), n;
|
|
18
18
|
return t.type === "td" && t.props["data-span"] === "all" && (n = {
|
|
19
19
|
colSpan: e
|
|
20
|
-
}), t.type === "th" && t.props["data-type"] && (s = /* @__PURE__ */
|
|
20
|
+
}), t.type === "th" && t.props["data-type"] && (s = /* @__PURE__ */ D("span", { className: v.sortable, children: [
|
|
21
21
|
s,
|
|
22
|
-
/* @__PURE__ */ _(H, {
|
|
23
|
-
] })), n || s !== t.props.children ?
|
|
22
|
+
/* @__PURE__ */ _(H, { name: "updown", variant: "primary" })
|
|
23
|
+
] })), n || s !== t.props.children ? T(t, n, s) : t;
|
|
24
24
|
}), G = (r, e, t, s, n = 1) => {
|
|
25
25
|
if (t === "text")
|
|
26
26
|
return r.localeCompare(e, s, {
|
|
27
27
|
sensitivity: "base"
|
|
28
28
|
}) * n;
|
|
29
|
-
const
|
|
30
|
-
return Number.isNaN(
|
|
29
|
+
const l = t === "date" ? Date.parse(r) : Number.parseFloat(r), i = t === "date" ? Date.parse(e) : Number.parseFloat(e);
|
|
30
|
+
return Number.isNaN(l) && Number.isNaN(i) ? 0 : Number.isNaN(l) ? 1 : Number.isNaN(i) ? -1 : (l - i) * n;
|
|
31
31
|
}, M = ({
|
|
32
32
|
children: r,
|
|
33
33
|
locale: e,
|
|
34
34
|
...t
|
|
35
35
|
}) => {
|
|
36
|
-
const s =
|
|
36
|
+
const s = I(null), n = w(r), l = n && n > 0 ? E(r, n) : r, i = (u, c, o) => {
|
|
37
37
|
u.querySelectorAll("th[data-type]").forEach((a) => {
|
|
38
38
|
a === c ? (a.dataset.dir = o, a.setAttribute("aria-sort", o === "asc" ? "ascending" : "descending")) : (delete a.dataset.dir, a.setAttribute("aria-sort", "none"));
|
|
39
39
|
});
|
|
40
|
-
},
|
|
40
|
+
}, S = R((u) => {
|
|
41
41
|
var C, x;
|
|
42
42
|
const c = s.current;
|
|
43
43
|
if (!c) return;
|
|
@@ -52,15 +52,15 @@ import '../../assets/index3.css';const P = "_table_18uji_1", V = "_sortable_18uj
|
|
|
52
52
|
const b = o.getAttribute("data-type");
|
|
53
53
|
if (!b) return;
|
|
54
54
|
const N = o.dataset.dir === "asc" ? "desc" : "asc";
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
y.sort((F,
|
|
58
|
-
var
|
|
59
|
-
const
|
|
60
|
-
return G(
|
|
55
|
+
i(p, o, N);
|
|
56
|
+
const q = N === "asc" ? 1 : -1, y = Array.from(d.rows);
|
|
57
|
+
y.sort((F, j) => {
|
|
58
|
+
var g, A;
|
|
59
|
+
const k = (((g = F.cells[a]) == null ? void 0 : g.textContent) ?? "").trim(), z = (((A = j.cells[a]) == null ? void 0 : A.textContent) ?? "").trim();
|
|
60
|
+
return G(k, z, b, e, q);
|
|
61
61
|
}), d.append(...y);
|
|
62
62
|
}, [e]);
|
|
63
|
-
return /* @__PURE__ */ _("table", { className:
|
|
63
|
+
return /* @__PURE__ */ _("table", { className: v.table, onClick: S, ref: s, ...t, "data-component": "table", children: l });
|
|
64
64
|
};
|
|
65
65
|
export {
|
|
66
66
|
M as Table
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/table/index.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, useCallback, useRef } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type TableProps = React.TableHTMLAttributes<HTMLTableElement> & {\n children?: React.ReactNode;\n locale?: string | string[];\n};\n\ntype SortType = 'date' | 'number' | 'text';\n\ntype TableChildProps = {\n children?: React.ReactNode;\n colSpan?: number;\n 'data-span'?: string;\n 'data-type'?: SortType;\n};\n\nconst isTableElement = (child: React.ReactNode): child is React.ReactElement<TableChildProps> =>\n isValidElement<TableChildProps>(child);\n\nconst countCells = (children: React.ReactNode): number =>\n Children.toArray(children).reduce<number>((count, child) => {\n if (!isTableElement(child)) return count;\n return (\n count + (child.type === 'td' || child.type === 'th' ? 1 : countCells(child.props.children))\n );\n }, 0);\n\nconst getFirstRowCellCount = (children: React.ReactNode): number | null => {\n for (const child of Children.toArray(children)) {\n if (!isTableElement(child)) continue;\n\n if (child.type === 'tr') return countCells(child.props.children);\n\n const nestedCount = getFirstRowCellCount(child.props.children);\n if (nestedCount !== null) return nestedCount;\n }\n\n return null;\n};\n\nconst normalizeChildren = (children: React.ReactNode, columnCount: number): React.ReactNode =>\n Children.map(children, (child) => {\n if (!isTableElement(child)) return child;\n\n let nextChildren =\n child.props.children === undefined\n ? child.props.children\n : normalizeChildren(child.props.children, columnCount);\n let nextProps: Partial<TableChildProps> | undefined;\n\n if (child.type === 'td' && child.props['data-span'] === 'all') {\n nextProps = { colSpan: columnCount };\n }\n\n if (child.type === 'th' && child.props['data-type']) {\n nextChildren = (\n <span className={styles.sortable}>\n {nextChildren}\n <Icon\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/table/index.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, useCallback, useRef } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type TableProps = React.TableHTMLAttributes<HTMLTableElement> & {\n children?: React.ReactNode;\n locale?: string | string[];\n};\n\ntype SortType = 'date' | 'number' | 'text';\n\ntype TableChildProps = {\n children?: React.ReactNode;\n colSpan?: number;\n 'data-span'?: string;\n 'data-type'?: SortType;\n};\n\nconst isTableElement = (child: React.ReactNode): child is React.ReactElement<TableChildProps> =>\n isValidElement<TableChildProps>(child);\n\nconst countCells = (children: React.ReactNode): number =>\n Children.toArray(children).reduce<number>((count, child) => {\n if (!isTableElement(child)) return count;\n return (\n count + (child.type === 'td' || child.type === 'th' ? 1 : countCells(child.props.children))\n );\n }, 0);\n\nconst getFirstRowCellCount = (children: React.ReactNode): number | null => {\n for (const child of Children.toArray(children)) {\n if (!isTableElement(child)) continue;\n\n if (child.type === 'tr') return countCells(child.props.children);\n\n const nestedCount = getFirstRowCellCount(child.props.children);\n if (nestedCount !== null) return nestedCount;\n }\n\n return null;\n};\n\nconst normalizeChildren = (children: React.ReactNode, columnCount: number): React.ReactNode =>\n Children.map(children, (child) => {\n if (!isTableElement(child)) return child;\n\n let nextChildren =\n child.props.children === undefined\n ? child.props.children\n : normalizeChildren(child.props.children, columnCount);\n let nextProps: Partial<TableChildProps> | undefined;\n\n if (child.type === 'td' && child.props['data-span'] === 'all') {\n nextProps = { colSpan: columnCount };\n }\n\n if (child.type === 'th' && child.props['data-type']) {\n nextChildren = (\n <span className={styles.sortable}>\n {nextChildren}\n <Icon\n name='updown'\n variant='primary'\n />\n </span>\n );\n }\n\n return nextProps || nextChildren !== child.props.children\n ? cloneElement(child, nextProps, nextChildren)\n : child;\n });\n\n/**\n * Sortable columns must provide data-type (text, number, or date) in the `th` element.\n */\n\nconst compare = (a: string, b: string, type: SortType, locale?: string | string[], dir = 1) => {\n if (type === 'text') {\n return a.localeCompare(b, locale, { sensitivity: 'base' }) * dir;\n }\n\n const left = type === 'date' ? Date.parse(a) : Number.parseFloat(a);\n const right = type === 'date' ? Date.parse(b) : Number.parseFloat(b);\n\n if (Number.isNaN(left) && Number.isNaN(right)) return 0;\n if (Number.isNaN(left)) return 1;\n if (Number.isNaN(right)) return -1;\n return (left - right) * dir;\n};\n\nexport const Table = ({ children, locale, ...props }: TableProps) => {\n const ref = useRef<HTMLTableElement | null>(null);\n const columnCount = getFirstRowCellCount(children);\n const normalizedChildren =\n columnCount && columnCount > 0 ? normalizeChildren(children, columnCount) : children;\n\n const setSortState = (\n thead: HTMLTableSectionElement,\n active: HTMLTableCellElement,\n dir: 'asc' | 'desc'\n ) => {\n const ths = thead.querySelectorAll<HTMLTableCellElement>('th[data-type]');\n\n ths.forEach((th) => {\n if (th === active) {\n th.dataset.dir = dir;\n th.setAttribute('aria-sort', dir === 'asc' ? 'ascending' : 'descending');\n } else {\n delete th.dataset.dir;\n th.setAttribute('aria-sort', 'none');\n }\n });\n };\n\n const onClick = useCallback(\n (e: React.MouseEvent<HTMLTableElement>) => {\n const table = ref.current;\n if (!table) return;\n\n const th = (e.target as HTMLElement | null)?.closest('th');\n if (!th) return;\n\n const thead = table.tHead;\n if (!thead || !thead.contains(th)) return;\n\n const col = th.cellIndex;\n if (col < 0) return;\n\n const tbody = table.tBodies?.[0];\n if (!tbody) return;\n\n const type = th.getAttribute('data-type') as SortType | null;\n if (!type) return;\n\n const direction = th.dataset.dir === 'asc' ? 'desc' : 'asc';\n setSortState(thead, th, direction);\n const dir = direction === 'asc' ? 1 : -1;\n\n const rows = Array.from(tbody.rows);\n\n rows.sort((a, b) => {\n const av = (a.cells[col]?.textContent ?? '').trim();\n const bv = (b.cells[col]?.textContent ?? '').trim();\n return compare(av, bv, type, locale, dir);\n });\n\n tbody.append(...rows);\n },\n [locale]\n );\n\n return (\n <table\n className={styles.table}\n onClick={onClick}\n ref={ref}\n {...props}\n >\n {normalizedChildren}\n </table>\n );\n};\n"],"names":["isTableElement","child","isValidElement","countCells","children","Children","toArray","reduce","count","type","props","getFirstRowCellCount","nestedCount","normalizeChildren","columnCount","map","nextChildren","undefined","nextProps","colSpan","jsxs","styles","sortable","jsx","Icon","cloneElement","compare","a","b","locale","dir","localeCompare","sensitivity","left","Date","parse","Number","parseFloat","right","isNaN","Table","ref","useRef","normalizedChildren","setSortState","thead","active","ths","querySelectorAll","forEach","th","dataset","setAttribute","onClick","useCallback","e","table","current","target","closest","tHead","contains","col","cellIndex","tbody","tBodies","getAttribute","direction","rows","Array","from","sort","av","cells","textContent","trim","bv","append"],"mappings":";;;;;;GAmBMA,IAAiBA,CAACC,MACtBC,EAAgCD,CAAK,GAEjCE,IAAaA,CAACC,MAClBC,EAASC,QAAQF,CAAQ,EAAEG,OAAe,CAACC,GAAOP,MAC3CD,EAAeC,CAAK,IAEvBO,KAASP,EAAMQ,SAAS,QAAQR,EAAMQ,SAAS,OAAO,IAAIN,EAAWF,EAAMS,MAAMN,QAAQ,KAFxDI,GAIlC,CAAC,GAEAG,IAAuBA,CAACP,MAA6C;AACzE,aAAWH,KAASI,EAASC,QAAQF,CAAQ,GAAG;AAC9C,QAAI,CAACJ,EAAeC,CAAK,EAAG;AAE5B,QAAIA,EAAMQ,SAAS,aAAaN,EAAWF,EAAMS,MAAMN,QAAQ;AAE/D,UAAMQ,IAAcD,EAAqBV,EAAMS,MAAMN,QAAQ;AAC7D,QAAIQ,MAAgB,KAAM,QAAOA;AAAAA,EACnC;AAEA,SAAO;AACT,GAEMC,IAAoBA,C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+C,gBAAe,IAAIC,KAAAA,GACvCC,OAAMhD,IAAAA,EAAE6C,MAAMX,CAAG,MAAXlC,gBAAAA,EAAc8C,gBAAe,IAAIC,KAAAA;AAC7C,aAAOjD,EAAQ8C,GAAII,GAAInE,GAAMoB,GAAQC,CAAG;AAAA,IAC1C,CAAC,GAEDkC,EAAMa,OAAO,GAAGT,CAAI;AAAA,EACtB,GACA,CAACvC,CAAM,CACT;AAEA,SACE,gBAAAN,EAAC,SAAA,EACC,WAAWF,EAAOmC,OAClB,SAAAH,GACA,KAAAZ,GACA,GAAI/B,GAAM,kBAAA,SAETiC,UAAAA,EAAAA,CACH;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index42.css');const e=require("react/jsx-runtime"),n=require("../../classix-5H4IWnMA.cjs"),x=require("../../utils-DBzf7CFq.cjs"),t=require("../../styles.module-BPvMQa_x.cjs"),d="_textarea_19s8w_5",m={textarea:d},y=({label:s,maxRows:o=12,minRows:c=3,required:r,value:a,...u})=>{const{touched:i,onBlur:l}=x.useTouched(a==="");return e.jsxs("label",{"data-component":"textarea",children:[s&&e.jsx("span",{className:n.t(r&&t.inputStyles.required),children:s}),e.jsx("textarea",{className:n.t(t.inputStyles.input,m.textarea,i&&t.inputStyles.touched),onBlur:l,...u,required:r,style:{"--min-rows":c,"--max-rows":o},value:a})]})};exports.Textarea=y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched &&
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span className={cx(required && inputStyles.required)}>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && inputStyles.touched)}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n />\n </label>\n );\n};\n"],"names":["Textarea","label","maxRows","minRows","required","value","props","touched","onBlur","useTouched","jsxs","jsx","cx","inputStyles","input","styles","textarea"],"mappings":"sRAaaA,EAAWA,CAAC,CACvBC,MAAAA,EACAC,QAAAA,EAAU,GACVC,QAAAA,EAAU,EACVC,SAAAA,EACAC,MAAAA,EACA,GAAGC,CACU,IAAM,CACnB,KAAM,CAAEC,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,EAAAA,WAAWJ,IAAU,EAAE,EAEnD,OACEK,EAAAA,KAAC,QAAA,CAAK,iBAAA,WACHT,SAAAA,CAAAA,GAASU,EAAAA,IAAC,QAAK,UAAWC,EAAAA,EAAGR,GAAYS,EAAAA,YAAYT,QAAQ,EAAIH,SAAAA,CAAAA,CAAM,QACvE,WAAA,CACC,UAAWW,EAAAA,EAAGC,EAAAA,YAAYC,MAAOC,EAAOC,SAAUT,GAAWM,EAAAA,YAAYN,OAAO,EAChF,OAAAC,EACA,GAAIF,EACJ,SAAAF,EACA,MACE,CACE,aAAcD,EACd,aAAcD,CAAAA,EAGlB,MAAAG,CAAA,CAAa,CAAA,EAEjB,CAEJ"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { u
|
|
4
|
-
import { i as
|
|
5
|
-
import '../../assets/
|
|
6
|
-
textarea:
|
|
7
|
-
},
|
|
8
|
-
label:
|
|
9
|
-
maxRows:
|
|
10
|
-
minRows:
|
|
11
|
-
required:
|
|
12
|
-
value:
|
|
13
|
-
...
|
|
1
|
+
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { t as o } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { u } from "../../utils--n2yqjCy.js";
|
|
4
|
+
import { i as t } from "../../styles.module-BOTEBJ0C.js";
|
|
5
|
+
import '../../assets/index42.css';const l = "_textarea_19s8w_5", d = {
|
|
6
|
+
textarea: l
|
|
7
|
+
}, _ = ({
|
|
8
|
+
label: e,
|
|
9
|
+
maxRows: n = 12,
|
|
10
|
+
minRows: m = 3,
|
|
11
|
+
required: a,
|
|
12
|
+
value: r,
|
|
13
|
+
...c
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
|
-
touched:
|
|
17
|
-
onBlur:
|
|
18
|
-
} =
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
"--min-rows":
|
|
23
|
-
"--max-rows":
|
|
24
|
-
}, value:
|
|
16
|
+
touched: x,
|
|
17
|
+
onBlur: i
|
|
18
|
+
} = u(r === "");
|
|
19
|
+
return /* @__PURE__ */ p("label", { "data-component": "textarea", children: [
|
|
20
|
+
e && /* @__PURE__ */ s("span", { className: o(a && t.required), children: e }),
|
|
21
|
+
/* @__PURE__ */ s("textarea", { className: o(t.input, d.textarea, x && t.touched), onBlur: i, ...c, required: a, style: {
|
|
22
|
+
"--min-rows": m,
|
|
23
|
+
"--max-rows": n
|
|
24
|
+
}, value: r })
|
|
25
25
|
] });
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
_ as Textarea
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched &&
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span className={cx(required && inputStyles.required)}>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && inputStyles.touched)}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n />\n </label>\n );\n};\n"],"names":["Textarea","label","maxRows","minRows","required","value","props","touched","onBlur","useTouched","jsxs","jsx","cx","inputStyles","input","styles","textarea"],"mappings":";;;;;;GAaaA,IAAWA,CAAC;AAAA,EACvBC,OAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACVC,SAAAA,IAAU;AAAA,EACVC,UAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACA,GAAGC;AACU,MAAM;AACnB,QAAM;AAAA,IAAEC,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWJ,MAAU,EAAE;AAEnD,SACE,gBAAAK,EAAC,SAAA,EAAK,kBAAA,YACHT,UAAAA;AAAAA,IAAAA,KAAS,gBAAAU,EAAC,UAAK,WAAWC,EAAGR,KAAYS,EAAYT,QAAQ,GAAIH,UAAAA,EAAAA,CAAM;AAAA,sBACvE,YAAA,EACC,WAAWW,EAAGC,EAAYC,OAAOC,EAAOC,UAAUT,KAAWM,EAAYN,OAAO,GAChF,QAAAC,GACA,GAAIF,GACJ,UAAAF,GACA,OACE;AAAA,MACE,cAAcD;AAAAA,MACd,cAAcD;AAAAA,IAAAA,GAGlB,OAAAG,EAAA,CAAa;AAAA,EAAA,GAEjB;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index43.css');const o=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),n=require("react"),q=require("../icon/index.cjs"),d="_toast_12yql_1",f="_active_12yql_21",m="_error_12yql_27",y="_success_12yql_36",c={toast:d,active:f,error:m,success:y},v=({label:i,type:t="success",onClick:u,onExitComplete:e,open:r=!0})=>{const[_,a]=n.useState(!1);return n.useEffect(()=>{if(!r)return a(!1);const s=requestAnimationFrame(()=>a(!0));return()=>cancelAnimationFrame(s)},[r]),o.jsxs("div",{"aria-live":t==="error"?"assertive":"polite",className:l.t(c.toast,c[t],_&&c.active),onClick:u,onTransitionEnd:s=>{r||s.propertyName!=="opacity"||s.currentTarget!==s.target||e==null||e()},"data-component":"toast",children:[o.jsx(q.Icon,{name:t}),i]})};exports.Toast=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|