neatkit 0.5.0 → 0.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/Alert-DQ5CCE0N.js +29 -0
- package/dist/Alert-LJDkNUqH.cjs +1 -0
- package/dist/Alert.cjs +1 -0
- package/dist/Alert.js +4 -0
- package/dist/Avatar.cjs +1 -0
- package/dist/Avatar.js +55 -0
- package/dist/Badge.cjs +1 -0
- package/dist/Badge.js +25 -0
- package/dist/Button-BAsLfA0D.js +99 -0
- package/dist/Button-D7JUO6Fs.cjs +1 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.js +5 -0
- package/dist/Card-CPq6dsut.js +34 -0
- package/dist/Card-CQ-8_1tO.cjs +1 -0
- package/dist/Card.cjs +1 -0
- package/dist/Card.js +4 -0
- package/dist/Checkbox-BvXM9VyY.js +68 -0
- package/dist/Checkbox-VQifZrZZ.cjs +1 -0
- package/dist/Checkbox.cjs +1 -0
- package/dist/Checkbox.js +5 -0
- package/dist/CheckboxGroup.cjs +1 -0
- package/dist/CheckboxGroup.js +144 -0
- package/dist/{Code-D4qqPnTN.js → Code-BP2ZCmUf.js} +4 -3
- package/dist/Code-eispVOW3.cjs +6 -0
- package/dist/Code.cjs +1 -0
- package/dist/Code.js +5 -0
- package/dist/Content.cjs +1 -0
- package/dist/Content.js +144 -0
- package/dist/Divider-BE15WVDI.js +42 -0
- package/dist/Divider-CJYbFcSX.cjs +1 -0
- package/dist/Divider.cjs +1 -0
- package/dist/Divider.js +4 -0
- package/dist/Field.cjs +1 -0
- package/dist/Field.js +115 -0
- package/dist/Icon-D8IZceys.cjs +1 -0
- package/dist/Icon-uQmpr5P2.js +1139 -0
- package/dist/Icon.cjs +1 -0
- package/dist/Icon.js +37 -0
- package/dist/Input.cjs +1 -0
- package/dist/Input.js +146 -0
- package/dist/{markdown.cjs → Markdown.cjs} +19 -19
- package/dist/{markdown.js → Markdown.js} +10 -8
- package/dist/Modal.cjs +1 -0
- package/dist/Modal.js +171 -0
- package/dist/PinInput.cjs +1 -0
- package/dist/PinInput.js +248 -0
- package/dist/Popover.cjs +1 -0
- package/dist/Popover.js +238 -0
- package/dist/Radio.cjs +1 -0
- package/dist/Radio.js +65 -0
- package/dist/RadioGroup.cjs +1 -0
- package/dist/RadioGroup.js +51 -0
- package/dist/RadioGroupContext-BX9KnDek.cjs +1 -0
- package/dist/RadioGroupContext-DbKM4zPZ.js +5 -0
- package/dist/Select.cjs +1 -0
- package/dist/Select.js +473 -0
- package/dist/Skeleton.cjs +1 -0
- package/dist/Skeleton.js +27 -0
- package/dist/Spinner-BXgw60UC.cjs +1 -0
- package/dist/Spinner-CVYvk6YK.js +25 -0
- package/dist/Spinner.cjs +1 -0
- package/dist/Spinner.js +4 -0
- package/dist/Surface-BttJYSDt.cjs +1 -0
- package/dist/Surface-vEFsZC12.js +17 -0
- package/dist/Switch.cjs +1 -0
- package/dist/Switch.js +39 -0
- package/dist/Table-83unQQOi.cjs +1 -0
- package/dist/Table-Cw8u-pEW.js +403 -0
- package/dist/Table.cjs +1 -0
- package/dist/Table.js +5 -0
- package/dist/Text-DWYlIcPj.cjs +1 -0
- package/dist/Text-rN6iDo0V.js +24 -0
- package/dist/Text.cjs +1 -0
- package/dist/Text.js +4 -0
- package/dist/TextArea.cjs +1 -0
- package/dist/TextArea.js +43 -0
- package/dist/Tooltip-BB82wNOE.cjs +1 -0
- package/dist/Tooltip-CqWK_GRD.js +236 -0
- package/dist/Tooltip.cjs +1 -0
- package/dist/Tooltip.js +6 -0
- package/dist/aria-DHnOMyYp.js +10 -0
- package/dist/aria-DKxpE8cA.cjs +1 -0
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/CheckboxGroup/index.d.ts +1 -1
- package/dist/components/Code/index.d.ts +1 -1
- package/dist/components/Content/index.d.ts +1 -1
- package/dist/components/Divider/index.d.ts +1 -1
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Markdown/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/PinInput/index.d.ts +1 -1
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/field-control-NfLwcPj6.cjs +1 -0
- package/dist/field-control-XAn_FKks.js +16 -0
- package/dist/focus-restoration-70WcQRr5.cjs +1 -0
- package/dist/focus-restoration-BvNZzrQA.js +16 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -2187
- package/dist/reference-C2guRuR0.cjs +1 -0
- package/dist/reference-CXMr27nM.js +12 -0
- package/dist/style.css +1 -1
- package/dist/units-BmjPCccF.js +90 -0
- package/dist/units-PzuiQNnw.cjs +1 -0
- package/dist/useFloatingPosition-CxzhAvy8.js +73 -0
- package/dist/useFloatingPosition-D1FqYy0l.cjs +1 -0
- package/dist/useFocusTrap--cgjy78G.cjs +1 -0
- package/dist/useFocusTrap-Da4nEash.js +134 -0
- package/dist/usePresence-DSPt6aKi.js +210 -0
- package/dist/usePresence-qe92UTvK.cjs +1 -0
- package/package.json +136 -11
- package/dist/Card-Ba5AcR4o.cjs +0 -1
- package/dist/Card-Cumb1Hon.js +0 -74
- package/dist/Code-CDHkXHVo.cjs +0 -6
- package/dist/Table-B5izJmMG.cjs +0 -1
- package/dist/Table-Gs5LkYRc.js +0 -2187
- package/dist/code.cjs +0 -1
- package/dist/code.js +0 -5
- package/dist/entries/code.d.ts +0 -1
- package/dist/entries/index.d.ts +0 -29
- package/dist/entries/markdown.d.ts +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { S as m } from "./Surface-vEFsZC12.js";
|
|
4
|
+
const N = c(function(r, a) {
|
|
5
|
+
const {
|
|
6
|
+
children: t,
|
|
7
|
+
className: n,
|
|
8
|
+
role: o,
|
|
9
|
+
tone: s = "info",
|
|
10
|
+
...l
|
|
11
|
+
} = r;
|
|
12
|
+
return /* @__PURE__ */ i(
|
|
13
|
+
m,
|
|
14
|
+
{
|
|
15
|
+
...l,
|
|
16
|
+
ref: a,
|
|
17
|
+
className: ["nk-alert", n].filter(Boolean).join(" "),
|
|
18
|
+
"data-tone": s,
|
|
19
|
+
role: o,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ e("span", { "aria-hidden": "true", className: "nk-alert__indicator" }),
|
|
22
|
+
/* @__PURE__ */ e("div", { className: "nk-alert__content", children: t })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
N as A
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("react"),l=require("./Surface-BttJYSDt.cjs"),u=i.forwardRef(function(r,t){const{children:n,className:a,role:s,tone:c="info",...o}=r;return e.jsxs(l.Surface,{...o,ref:t,className:["nk-alert",a].filter(Boolean).join(" "),"data-tone":c,role:s,children:[e.jsx("span",{"aria-hidden":"true",className:"nk-alert__indicator"}),e.jsx("div",{className:"nk-alert__content",children:n})]})});exports.Alert=u;
|
package/dist/Alert.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Alert-LJDkNUqH.cjs");exports.default=e.Alert;
|
package/dist/Alert.js
ADDED
package/dist/Avatar.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),u=require("react");function A(a){return(Array.from((a==null?void 0:a.trim())??"")[0]??"?").trim().toUpperCase()||"?"}function I(a){if(a==="?")return"neutral";const e=Array.from(a)[0]??"";if("AJO".includes(e))return"1";if("BNSV".includes(e))return"2";if("CFLQW".includes(e))return"3";if("EHKMPTX".includes(e))return"4";if("DGRUY".includes(e))return"5";if("IZ".includes(e))return"6";const n=e.codePointAt(0)??0;return String(n%6+1)}const y=u.forwardRef(function(e,n){const{alt:i,className:d,image:r,size:s=32,style:f,...m}=e,[v,g]=u.useState(),l=!!r&&r!==v,t=(i==null?void 0:i.trim())??"",c=A(t),b=typeof s=="number"?`${s}px`:s,k=t?{"aria-label":t,role:"img"}:{"aria-hidden":!0,role:void 0};function p(){g(r)}return o.jsx("div",{...m,...l?void 0:k,ref:n,className:["nk-avatar",d].filter(Boolean).join(" "),"data-palette":I(c),"data-state":l?"image":"fallback",style:{...f,"--nk-avatar-size":b},children:l?o.jsx("img",{alt:t,className:"nk-avatar__image",onError:p,src:r}):o.jsx("span",{"aria-hidden":"true",className:"nk-avatar__initial",children:c})})});exports.default=y;
|
package/dist/Avatar.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as A, useState as I } from "react";
|
|
4
|
+
function b(a) {
|
|
5
|
+
return (Array.from((a == null ? void 0 : a.trim()) ?? "")[0] ?? "?").trim().toUpperCase() || "?";
|
|
6
|
+
}
|
|
7
|
+
function y(a) {
|
|
8
|
+
if (a === "?") return "neutral";
|
|
9
|
+
const e = Array.from(a)[0] ?? "";
|
|
10
|
+
if ("AJO".includes(e)) return "1";
|
|
11
|
+
if ("BNSV".includes(e)) return "2";
|
|
12
|
+
if ("CFLQW".includes(e)) return "3";
|
|
13
|
+
if ("EHKMPTX".includes(e)) return "4";
|
|
14
|
+
if ("DGRUY".includes(e)) return "5";
|
|
15
|
+
if ("IZ".includes(e)) return "6";
|
|
16
|
+
const n = e.codePointAt(0) ?? 0;
|
|
17
|
+
return String(n % 6 + 1);
|
|
18
|
+
}
|
|
19
|
+
const P = A(function(e, n) {
|
|
20
|
+
const {
|
|
21
|
+
alt: i,
|
|
22
|
+
className: u,
|
|
23
|
+
image: r,
|
|
24
|
+
size: l = 32,
|
|
25
|
+
style: f,
|
|
26
|
+
...d
|
|
27
|
+
} = e, [m, v] = I(), s = !!r && r !== m, t = (i == null ? void 0 : i.trim()) ?? "", c = b(t), p = typeof l == "number" ? `${l}px` : l, g = t ? { "aria-label": t, role: "img" } : { "aria-hidden": !0, role: void 0 };
|
|
28
|
+
function k() {
|
|
29
|
+
v(r);
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ o(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
...d,
|
|
35
|
+
...s ? void 0 : g,
|
|
36
|
+
ref: n,
|
|
37
|
+
className: ["nk-avatar", u].filter(Boolean).join(" "),
|
|
38
|
+
"data-palette": y(c),
|
|
39
|
+
"data-state": s ? "image" : "fallback",
|
|
40
|
+
style: { ...f, "--nk-avatar-size": p },
|
|
41
|
+
children: s ? /* @__PURE__ */ o(
|
|
42
|
+
"img",
|
|
43
|
+
{
|
|
44
|
+
alt: t,
|
|
45
|
+
className: "nk-avatar__image",
|
|
46
|
+
onError: k,
|
|
47
|
+
src: r
|
|
48
|
+
}
|
|
49
|
+
) : /* @__PURE__ */ o("span", { "aria-hidden": "true", className: "nk-avatar__initial", children: c })
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
P as default
|
|
55
|
+
};
|
package/dist/Badge.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),l=require("react"),u=l.forwardRef(function(e,t){const{children:a,className:n,tone:r="neutral",variant:o="outline",...s}=e;return i.jsx("span",{...s,ref:t,className:["nk-badge",n].filter(Boolean).join(" "),"data-tone":r,"data-variant":o,children:a})});exports.default=u;
|
package/dist/Badge.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
const c = l(function(a, e) {
|
|
4
|
+
const {
|
|
5
|
+
children: t,
|
|
6
|
+
className: n,
|
|
7
|
+
tone: o = "neutral",
|
|
8
|
+
variant: r = "outline",
|
|
9
|
+
...s
|
|
10
|
+
} = a;
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
...s,
|
|
15
|
+
ref: e,
|
|
16
|
+
className: ["nk-badge", n].filter(Boolean).join(" "),
|
|
17
|
+
"data-tone": o,
|
|
18
|
+
"data-variant": r,
|
|
19
|
+
children: t
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
c as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as v, Fragment as q, jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as C, createElement as K, isValidElement as G, Fragment as O } from "react";
|
|
4
|
+
import { q as x } from "./Icon-uQmpr5P2.js";
|
|
5
|
+
import { S as V } from "./Spinner-CVYvk6YK.js";
|
|
6
|
+
function g(t) {
|
|
7
|
+
return t == null || typeof t == "boolean" || typeof t == "string" && !t.trim() ? !1 : Array.isArray(t) ? t.some(g) : G(t) && t.type === O ? g(t.props.children) : !0;
|
|
8
|
+
}
|
|
9
|
+
function W(t, s) {
|
|
10
|
+
const a = t.getBoundingClientRect(), p = s.clientX - a.left, l = s.clientY - a.top;
|
|
11
|
+
t.style.setProperty("--nk-button-glow-x", `${p}px`), t.style.setProperty("--nk-button-glow-y", `${l}px`);
|
|
12
|
+
}
|
|
13
|
+
const L = C(function(s, a) {
|
|
14
|
+
const {
|
|
15
|
+
as: p,
|
|
16
|
+
children: l,
|
|
17
|
+
className: P,
|
|
18
|
+
disabled: B,
|
|
19
|
+
fullWidth: w = !1,
|
|
20
|
+
icon: i,
|
|
21
|
+
iconAlignment: h = "left",
|
|
22
|
+
loading: f = !1,
|
|
23
|
+
onClick: A,
|
|
24
|
+
onKeyDown: k,
|
|
25
|
+
onMouseMove: D,
|
|
26
|
+
role: y,
|
|
27
|
+
shape: I = "capsule",
|
|
28
|
+
tabIndex: b,
|
|
29
|
+
textAlignment: j = "center",
|
|
30
|
+
tone: z,
|
|
31
|
+
variant: E = "primary",
|
|
32
|
+
...d
|
|
33
|
+
} = s, r = p ?? "button", e = B || f, M = !!i && !g(l), u = r === "a" && "href" in d && typeof d.href == "string", c = typeof r == "string" && r !== "button" && !u, N = (o) => {
|
|
34
|
+
if (e) {
|
|
35
|
+
o.preventDefault(), o.stopPropagation();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const n = A;
|
|
39
|
+
n == null || n(o);
|
|
40
|
+
}, R = (o) => {
|
|
41
|
+
W(o.currentTarget, o);
|
|
42
|
+
const n = D;
|
|
43
|
+
n == null || n(o);
|
|
44
|
+
}, S = (o) => {
|
|
45
|
+
const n = k;
|
|
46
|
+
n == null || n(o), !(o.defaultPrevented || e || !c || o.key !== "Enter" && o.key !== " ") && (o.preventDefault(), o.currentTarget.click());
|
|
47
|
+
}, _ = r === "button" ? {
|
|
48
|
+
disabled: e,
|
|
49
|
+
type: d.type ?? "button"
|
|
50
|
+
} : { "aria-disabled": e || void 0 }, F = u && e ? { href: void 0 } : void 0, T = u && e ? y ?? "link" : c ? y ?? "button" : y, $ = r === "button" ? b : u && e ? void 0 : e ? -1 : c ? b ?? 0 : b;
|
|
51
|
+
return K(
|
|
52
|
+
r,
|
|
53
|
+
{
|
|
54
|
+
...d,
|
|
55
|
+
..._,
|
|
56
|
+
...F,
|
|
57
|
+
ref: a,
|
|
58
|
+
"aria-busy": f || void 0,
|
|
59
|
+
className: ["nk-button", P].filter(Boolean).join(" "),
|
|
60
|
+
"data-full-width": w || void 0,
|
|
61
|
+
"data-icon-only": M || void 0,
|
|
62
|
+
"data-shape": I,
|
|
63
|
+
"data-tone": z,
|
|
64
|
+
"data-variant": E,
|
|
65
|
+
onClick: N,
|
|
66
|
+
onKeyDown: c ? S : k,
|
|
67
|
+
onMouseMove: R,
|
|
68
|
+
role: T,
|
|
69
|
+
tabIndex: $
|
|
70
|
+
},
|
|
71
|
+
/* @__PURE__ */ v(q, { children: [
|
|
72
|
+
/* @__PURE__ */ v(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
className: "nk-button__content",
|
|
76
|
+
style: { justifyContent: j },
|
|
77
|
+
children: [
|
|
78
|
+
i && h === "left" ? /* @__PURE__ */ m(x, { size: 14, type: i }) : null,
|
|
79
|
+
l,
|
|
80
|
+
i && h === "right" ? /* @__PURE__ */ m(x, { size: 14, type: i }) : null
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
f ? /* @__PURE__ */ m(
|
|
85
|
+
V,
|
|
86
|
+
{
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
"aria-label": void 0,
|
|
89
|
+
className: "nk-button__spinner",
|
|
90
|
+
role: void 0,
|
|
91
|
+
size: 16
|
|
92
|
+
}
|
|
93
|
+
) : null
|
|
94
|
+
] })
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
export {
|
|
98
|
+
L as B
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const r=require("react/jsx-runtime"),f=require("react"),v=require("./Icon-D8IZceys.cjs"),F=require("./Spinner-BXgw60UC.cjs");function m(t){return t==null||typeof t=="boolean"||typeof t=="string"&&!t.trim()?!1:Array.isArray(t)?t.some(m):f.isValidElement(t)&&t.type===f.Fragment?m(t.props.children):!0}function K(t,a){const l=t.getBoundingClientRect(),y=a.clientX-l.left,c=a.clientY-l.top;t.style.setProperty("--nk-button-glow-x",`${y}px`),t.style.setProperty("--nk-button-glow-y",`${c}px`)}const $=f.forwardRef(function(a,l){const{as:y,children:c,className:P,disabled:j,fullWidth:B=!1,icon:s,iconAlignment:x="left",loading:b=!1,onClick:w,onKeyDown:k,onMouseMove:I,role:h,shape:A="capsule",tabIndex:g,textAlignment:q="center",tone:D,variant:R="primary",...u}=a,i=y??"button",o=j||b,z=!!s&&!m(c),d=i==="a"&&"href"in u&&typeof u.href=="string",p=typeof i=="string"&&i!=="button"&&!d,E=n=>{if(o){n.preventDefault(),n.stopPropagation();return}const e=w;e==null||e(n)},M=n=>{K(n.currentTarget,n);const e=I;e==null||e(n)},N=n=>{const e=k;e==null||e(n),!(n.defaultPrevented||o||!p||n.key!=="Enter"&&n.key!==" ")&&(n.preventDefault(),n.currentTarget.click())},S=i==="button"?{disabled:o,type:u.type??"button"}:{"aria-disabled":o||void 0},_=d&&o?{href:void 0}:void 0,T=d&&o?h??"link":p?h??"button":h,C=i==="button"?g:d&&o?void 0:o?-1:p?g??0:g;return f.createElement(i,{...u,...S,..._,ref:l,"aria-busy":b||void 0,className:["nk-button",P].filter(Boolean).join(" "),"data-full-width":B||void 0,"data-icon-only":z||void 0,"data-shape":A,"data-tone":D,"data-variant":R,onClick:E,onKeyDown:p?N:k,onMouseMove:M,role:T,tabIndex:C},r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"nk-button__content",style:{justifyContent:q},children:[s&&x==="left"?r.jsx(v.Icon,{size:14,type:s}):null,c,s&&x==="right"?r.jsx(v.Icon,{size:14,type:s}):null]}),b?r.jsx(F.Spinner,{"aria-hidden":"true","aria-label":void 0,className:"nk-button__spinner",role:void 0,size:16}):null]}))});exports.Button=$;
|
package/dist/Button.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Button-D7JUO6Fs.cjs");exports.default=e.Button;
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { S as m } from "./Surface-vEFsZC12.js";
|
|
4
|
+
import { T as n } from "./Text-rN6iDo0V.js";
|
|
5
|
+
const b = c(function(i, d) {
|
|
6
|
+
const {
|
|
7
|
+
children: t,
|
|
8
|
+
className: l,
|
|
9
|
+
header: e,
|
|
10
|
+
spacing: r = "standard",
|
|
11
|
+
...o
|
|
12
|
+
} = i;
|
|
13
|
+
return /* @__PURE__ */ s(
|
|
14
|
+
m,
|
|
15
|
+
{
|
|
16
|
+
...o,
|
|
17
|
+
ref: d,
|
|
18
|
+
className: ["nk-card", l].filter(Boolean).join(" "),
|
|
19
|
+
"data-has-header": e ? !0 : void 0,
|
|
20
|
+
"data-spacing": r,
|
|
21
|
+
children: [
|
|
22
|
+
e ? /* @__PURE__ */ s("div", { className: "nk-card__header", children: [
|
|
23
|
+
e.title ? /* @__PURE__ */ a(n, { as: "span", size: "caption", tone: "muted", weight: "semibold", children: e.title }) : null,
|
|
24
|
+
e.title && e.subtitle ? /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "nk-card__separator", children: "•" }) : null,
|
|
25
|
+
e.subtitle ? /* @__PURE__ */ a(n, { as: "span", size: "caption", tone: "muted", weight: "semibold", children: e.subtitle }) : null
|
|
26
|
+
] }) : null,
|
|
27
|
+
e ? /* @__PURE__ */ a("div", { className: "nk-card__content", "data-spacing": r, children: t }) : t
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
b as C
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),l=require("react"),o=require("./Surface-BttJYSDt.cjs"),n=require("./Text-DWYlIcPj.cjs"),u=l.forwardRef(function(r,i){const{children:s,className:c,header:e,spacing:t="standard",...d}=r;return a.jsxs(o.Surface,{...d,ref:i,className:["nk-card",c].filter(Boolean).join(" "),"data-has-header":e?!0:void 0,"data-spacing":t,children:[e?a.jsxs("div",{className:"nk-card__header",children:[e.title?a.jsx(n.Text,{as:"span",size:"caption",tone:"muted",weight:"semibold",children:e.title}):null,e.title&&e.subtitle?a.jsx("span",{"aria-hidden":"true",className:"nk-card__separator",children:"•"}):null,e.subtitle?a.jsx(n.Text,{as:"span",size:"caption",tone:"muted",weight:"semibold",children:e.subtitle}):null]}):null,e?a.jsx("div",{className:"nk-card__content","data-spacing":t,children:s}):s]})});exports.Card=u;
|
package/dist/Card.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Card-CQ-8_1tO.cjs");exports.default=e.Card;
|
package/dist/Card.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as k, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as j, useContext as y, forwardRef as B } from "react";
|
|
4
|
+
import { r as S, h as V } from "./aria-DHnOMyYp.js";
|
|
5
|
+
import { q as P } from "./Icon-uQmpr5P2.js";
|
|
6
|
+
import { T as R } from "./Text-rN6iDo0V.js";
|
|
7
|
+
const T = j(void 0);
|
|
8
|
+
function w() {
|
|
9
|
+
return y(T);
|
|
10
|
+
}
|
|
11
|
+
const J = B(function(m, f) {
|
|
12
|
+
var u;
|
|
13
|
+
const {
|
|
14
|
+
"aria-invalid": s,
|
|
15
|
+
checked: v,
|
|
16
|
+
children: o,
|
|
17
|
+
className: b,
|
|
18
|
+
defaultChecked: x,
|
|
19
|
+
disabled: C = !1,
|
|
20
|
+
invalid: c = !1,
|
|
21
|
+
name: p,
|
|
22
|
+
onChange: n,
|
|
23
|
+
required: d = !1,
|
|
24
|
+
style: _,
|
|
25
|
+
value: t = "on",
|
|
26
|
+
...N
|
|
27
|
+
} = m, e = w(), i = String(t), r = (e == null ? void 0 : e.value) !== void 0, h = C || !!(e != null && e.disabled), q = !!(e != null && e.required && !e.hasSelection && e.validationValue === i), I = c || V(s);
|
|
28
|
+
function G(l) {
|
|
29
|
+
n == null || n(l), l.defaultPrevented || e == null || e.handleChange(l);
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ k(
|
|
32
|
+
"label",
|
|
33
|
+
{
|
|
34
|
+
className: ["nk-checkbox", b].filter(Boolean).join(" "),
|
|
35
|
+
"data-disabled": h || void 0,
|
|
36
|
+
"data-invalid": I || void 0,
|
|
37
|
+
style: _,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ a(
|
|
40
|
+
"input",
|
|
41
|
+
{
|
|
42
|
+
...N,
|
|
43
|
+
ref: f,
|
|
44
|
+
"aria-invalid": S(c, s),
|
|
45
|
+
checked: e ? r ? (u = e.value) == null ? void 0 : u.includes(i) : void 0 : v,
|
|
46
|
+
className: "nk-checkbox__control",
|
|
47
|
+
defaultChecked: e && !r ? e.defaultValue.includes(i) : x,
|
|
48
|
+
disabled: h,
|
|
49
|
+
name: (e == null ? void 0 : e.name) ?? p,
|
|
50
|
+
onChange: G,
|
|
51
|
+
required: d || q,
|
|
52
|
+
type: "checkbox",
|
|
53
|
+
value: t
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "nk-checkbox__visual", children: /* @__PURE__ */ a(P, { className: "nk-checkbox__icon", size: 12, type: "checkmark" }) }),
|
|
57
|
+
o !== void 0 ? /* @__PURE__ */ k(R, { as: "span", className: "nk-checkbox__label", children: [
|
|
58
|
+
o,
|
|
59
|
+
d ? /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "nk-checkbox__required", children: "*" }) : null
|
|
60
|
+
] }) : null
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
J as C,
|
|
67
|
+
T as a
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const a=require("react/jsx-runtime"),s=require("react"),k=require("./aria-DKxpE8cA.cjs"),B=require("./Icon-D8IZceys.cjs"),R=require("./Text-DWYlIcPj.cjs"),b=s.createContext(void 0);function S(){return s.useContext(b)}const V=s.forwardRef(function(v,f){var x;const{"aria-invalid":l,checked:C,children:o,className:m,defaultChecked:q,disabled:_=!1,invalid:t=!1,name:j,onChange:n,required:d=!1,style:N,value:r="on",...I}=v,e=S(),i=String(r),u=(e==null?void 0:e.value)!==void 0,h=_||!!(e!=null&&e.disabled),p=!!(e!=null&&e.required&&!e.hasSelection&&e.validationValue===i),G=t||k.hasInvalidState(l);function y(c){n==null||n(c),c.defaultPrevented||e==null||e.handleChange(c)}return a.jsxs("label",{className:["nk-checkbox",m].filter(Boolean).join(" "),"data-disabled":h||void 0,"data-invalid":G||void 0,style:N,children:[a.jsx("input",{...I,ref:f,"aria-invalid":k.resolveAriaInvalid(t,l),checked:e?u?(x=e.value)==null?void 0:x.includes(i):void 0:C,className:"nk-checkbox__control",defaultChecked:e&&!u?e.defaultValue.includes(i):q,disabled:h,name:(e==null?void 0:e.name)??j,onChange:y,required:d||p,type:"checkbox",value:r}),a.jsx("span",{"aria-hidden":"true",className:"nk-checkbox__visual",children:a.jsx(B.Icon,{className:"nk-checkbox__icon",size:12,type:"checkmark"})}),o!==void 0?a.jsxs(R.Text,{as:"span",className:"nk-checkbox__label",children:[o,d?a.jsx("span",{"aria-hidden":"true",className:"nk-checkbox__required",children:"*"}):null]}):null]})});exports.Checkbox=V;exports.CheckboxGroupContext=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Checkbox-VQifZrZZ.cjs");exports.default=e.Checkbox;
|
package/dist/Checkbox.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=require("react/jsx-runtime"),a=require("react"),R=require("./aria-DKxpE8cA.cjs"),I=require("./Checkbox-VQifZrZZ.cjs"),Y=require("./field-control-NfLwcPj6.cjs"),D=Object.freeze([]);function P(r,o){a.Children.forEach(r,e=>{if(e==null||typeof e=="boolean")return;if(!a.isValidElement(e))throw new Error("CheckboxGroup children must be direct Checkbox elements or fragments");if(e.type===a.Fragment){P(e.props.children,o);return}if(e.type!==I.Checkbox)throw new Error("CheckboxGroup children must be direct Checkbox elements or fragments");const n=e;o.push({disabled:!!n.props.disabled,required:!!n.props.required,value:String(n.props.value??"on")})})}function J(r){const o=[];P(r,o);const e=new Set;return o.forEach(n=>{if(e.has(n.value))throw new Error("CheckboxGroup Checkbox values must be unique");e.add(n.value)}),o}function Q(r,o,e){o.current=r,typeof e=="function"?e(r):e&&(e.current=r)}const T=a.forwardRef(function(o,e){const{"aria-invalid":n,children:c,className:A,defaultValue:l=D,disabled:u=!1,invalid:C=!1,name:L,onChange:v,orientation:M="vertical",required:h=!1,value:m,..._}=o,k=a.useRef(null),[F,g]=a.useState(l),d=m!==void 0,H=d?m:F,N=C||R.hasInvalidState(n),E=J(c),q=u?[]:E.filter(t=>!t.disabled).map(t=>t.value),S=new Set(q),U=H.some(t=>S.has(t)),f=q[0],x=E.find(t=>!t.disabled&&t.value===f),V=l.some(t=>S.has(t)),y=!!(x!=null&&x.required),z=a.useCallback(t=>Q(t,k,e),[e]);a.useEffect(()=>{var p;if(d)return;const t=(p=k.current)==null?void 0:p.querySelector('input[type="checkbox"]'),i=t instanceof HTMLInputElement?t.form:null;if(!i)return;const b=i.getRootNode();function s(G){var j;if(G.target!==i||G.defaultPrevented)return;const O=Array.from(((j=k.current)==null?void 0:j.querySelectorAll('input[type="checkbox"]'))??[]).find(w=>!w.disabled&&w.value===f);O&&(O.required=!!(y||h&&!V)),g(l)}return b.addEventListener("reset",s),()=>b.removeEventListener("reset",s)},[c,l,V,d,h,y,f]);function K(t){if(!d){const i=t.currentTarget.value,b=t.currentTarget.checked;g(s=>b?[...new Set([...s,i])]:s.filter(p=>p!==i))}v==null||v(t)}const X={defaultValue:l,disabled:u,handleChange:K,hasSelection:U,name:L,required:h,value:m,validationValue:f};return B.jsx(I.CheckboxGroupContext.Provider,{value:X,children:B.jsx("div",{..._,ref:z,"aria-disabled":u||void 0,"aria-invalid":R.resolveAriaInvalid(C,n),className:["nk-checkbox-group",A].filter(Boolean).join(" "),"data-disabled":u||void 0,"data-invalid":N||void 0,"data-orientation":M,role:"group",children:c})})});Y.markFieldGroupControl(T,"label");exports.default=T;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as _, useRef as z, useState as K, useCallback as X, useEffect as Y, Children as D, isValidElement as J, Fragment as Q } from "react";
|
|
4
|
+
import { r as W, h as Z } from "./aria-DHnOMyYp.js";
|
|
5
|
+
import { a as $, C as ee } from "./Checkbox-BvXM9VyY.js";
|
|
6
|
+
import { m as oe } from "./field-control-XAn_FKks.js";
|
|
7
|
+
const te = Object.freeze([]);
|
|
8
|
+
function I(r, t) {
|
|
9
|
+
D.forEach(r, (e) => {
|
|
10
|
+
if (e == null || typeof e == "boolean")
|
|
11
|
+
return;
|
|
12
|
+
if (!J(e))
|
|
13
|
+
throw new Error(
|
|
14
|
+
"CheckboxGroup children must be direct Checkbox elements or fragments"
|
|
15
|
+
);
|
|
16
|
+
if (e.type === Q) {
|
|
17
|
+
I(e.props.children, t);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (e.type !== ee)
|
|
21
|
+
throw new Error(
|
|
22
|
+
"CheckboxGroup children must be direct Checkbox elements or fragments"
|
|
23
|
+
);
|
|
24
|
+
const n = e;
|
|
25
|
+
t.push({
|
|
26
|
+
disabled: !!n.props.disabled,
|
|
27
|
+
required: !!n.props.required,
|
|
28
|
+
value: String(n.props.value ?? "on")
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function ne(r) {
|
|
33
|
+
const t = [];
|
|
34
|
+
I(r, t);
|
|
35
|
+
const e = /* @__PURE__ */ new Set();
|
|
36
|
+
return t.forEach((n) => {
|
|
37
|
+
if (e.has(n.value))
|
|
38
|
+
throw new Error("CheckboxGroup Checkbox values must be unique");
|
|
39
|
+
e.add(n.value);
|
|
40
|
+
}), t;
|
|
41
|
+
}
|
|
42
|
+
function re(r, t, e) {
|
|
43
|
+
t.current = r, typeof e == "function" ? e(r) : e && (e.current = r);
|
|
44
|
+
}
|
|
45
|
+
const ae = _(
|
|
46
|
+
function(t, e) {
|
|
47
|
+
const {
|
|
48
|
+
"aria-invalid": n,
|
|
49
|
+
children: s,
|
|
50
|
+
className: R,
|
|
51
|
+
defaultValue: i = te,
|
|
52
|
+
disabled: c = !1,
|
|
53
|
+
invalid: x = !1,
|
|
54
|
+
name: A,
|
|
55
|
+
onChange: b,
|
|
56
|
+
orientation: L = "vertical",
|
|
57
|
+
required: m = !1,
|
|
58
|
+
value: h,
|
|
59
|
+
...P
|
|
60
|
+
} = t, v = z(null), [T, C] = K(i), u = h !== void 0, j = u ? h : T, F = x || Z(n), g = ne(s), E = c ? [] : g.filter((o) => !o.disabled).map((o) => o.value), S = new Set(E), H = j.some(
|
|
61
|
+
(o) => S.has(o)
|
|
62
|
+
), d = E[0], k = g.find(
|
|
63
|
+
(o) => !o.disabled && o.value === d
|
|
64
|
+
), V = i.some(
|
|
65
|
+
(o) => S.has(o)
|
|
66
|
+
), q = !!(k != null && k.required), N = X(
|
|
67
|
+
(o) => re(
|
|
68
|
+
o,
|
|
69
|
+
v,
|
|
70
|
+
e
|
|
71
|
+
),
|
|
72
|
+
[e]
|
|
73
|
+
);
|
|
74
|
+
Y(() => {
|
|
75
|
+
var p;
|
|
76
|
+
if (u) return;
|
|
77
|
+
const o = (p = v.current) == null ? void 0 : p.querySelector(
|
|
78
|
+
'input[type="checkbox"]'
|
|
79
|
+
), a = o instanceof HTMLInputElement ? o.form : null;
|
|
80
|
+
if (!a) return;
|
|
81
|
+
const f = a.getRootNode();
|
|
82
|
+
function l(y) {
|
|
83
|
+
var O;
|
|
84
|
+
if (y.target !== a || y.defaultPrevented) return;
|
|
85
|
+
const G = Array.from(
|
|
86
|
+
((O = v.current) == null ? void 0 : O.querySelectorAll(
|
|
87
|
+
'input[type="checkbox"]'
|
|
88
|
+
)) ?? []
|
|
89
|
+
).find(
|
|
90
|
+
(w) => !w.disabled && w.value === d
|
|
91
|
+
);
|
|
92
|
+
G && (G.required = !!(q || m && !V)), C(i);
|
|
93
|
+
}
|
|
94
|
+
return f.addEventListener("reset", l), () => f.removeEventListener("reset", l);
|
|
95
|
+
}, [
|
|
96
|
+
s,
|
|
97
|
+
i,
|
|
98
|
+
V,
|
|
99
|
+
u,
|
|
100
|
+
m,
|
|
101
|
+
q,
|
|
102
|
+
d
|
|
103
|
+
]);
|
|
104
|
+
function M(o) {
|
|
105
|
+
if (!u) {
|
|
106
|
+
const a = o.currentTarget.value, f = o.currentTarget.checked;
|
|
107
|
+
C((l) => f ? [.../* @__PURE__ */ new Set([...l, a])] : l.filter((p) => p !== a));
|
|
108
|
+
}
|
|
109
|
+
b == null || b(o);
|
|
110
|
+
}
|
|
111
|
+
const U = {
|
|
112
|
+
defaultValue: i,
|
|
113
|
+
disabled: c,
|
|
114
|
+
handleChange: M,
|
|
115
|
+
hasSelection: H,
|
|
116
|
+
name: A,
|
|
117
|
+
required: m,
|
|
118
|
+
value: h,
|
|
119
|
+
validationValue: d
|
|
120
|
+
};
|
|
121
|
+
return /* @__PURE__ */ B($.Provider, { value: U, children: /* @__PURE__ */ B(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
...P,
|
|
125
|
+
ref: N,
|
|
126
|
+
"aria-disabled": c || void 0,
|
|
127
|
+
"aria-invalid": W(x, n),
|
|
128
|
+
className: [
|
|
129
|
+
"nk-checkbox-group",
|
|
130
|
+
R
|
|
131
|
+
].filter(Boolean).join(" "),
|
|
132
|
+
"data-disabled": c || void 0,
|
|
133
|
+
"data-invalid": F || void 0,
|
|
134
|
+
"data-orientation": L,
|
|
135
|
+
role: "group",
|
|
136
|
+
children: s
|
|
137
|
+
}
|
|
138
|
+
) });
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
oe(ae, "label");
|
|
142
|
+
export {
|
|
143
|
+
ae as default
|
|
144
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as Ne, jsxs as st } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as ot, useRef as an, useState as ct, useMemo as Ce, useCallback as lt, useEffect as ut } from "react";
|
|
4
|
-
import { a as dt
|
|
4
|
+
import { a as dt } from "./reference-CXMr27nM.js";
|
|
5
|
+
import { C as gt } from "./Card-CPq6dsut.js";
|
|
5
6
|
function bt(n) {
|
|
6
7
|
const t = n.regex, r = {}, i = {
|
|
7
8
|
begin: /\$\{/,
|
|
@@ -7320,7 +7321,7 @@ function ia(n, t) {
|
|
|
7320
7321
|
if (n.charCodeAt(i) === 10 && (r += 1), r > t) return !0;
|
|
7321
7322
|
return r > t;
|
|
7322
7323
|
}
|
|
7323
|
-
const
|
|
7324
|
+
const da = ot(function(t, r) {
|
|
7324
7325
|
const {
|
|
7325
7326
|
"aria-label": i,
|
|
7326
7327
|
className: _,
|
|
@@ -7440,6 +7441,6 @@ const ua = ot(function(t, r) {
|
|
|
7440
7441
|
);
|
|
7441
7442
|
});
|
|
7442
7443
|
export {
|
|
7443
|
-
|
|
7444
|
+
da as C,
|
|
7444
7445
|
Gt as g
|
|
7445
7446
|
};
|