neatkit 0.7.0 → 0.8.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/Avatar-Belo7qAY.cjs +1 -0
- package/dist/Avatar-DjDCFqNG.js +55 -0
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.js +2 -52
- package/dist/Boundary.cjs +1 -0
- package/dist/Boundary.js +176 -0
- package/dist/{Button-BAsLfA0D.js → Button-Chv4O66e.js} +35 -35
- package/dist/Button-DCKtFvSo.cjs +1 -0
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +213 -2
- package/dist/Code-ClkozPlv.js +227 -0
- package/dist/Code-JDb4VFl7.cjs +4 -0
- package/dist/Code.cjs +1 -1
- package/dist/Code.js +1 -1
- package/dist/{Icon-uQmpr5P2.js → Icon-BoEUoOk7.js} +144 -177
- package/dist/Icon-DJ4BigRz.cjs +1 -0
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +2 -35
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +70 -79
- package/dist/Markdown.cjs +1 -31
- package/dist/Markdown.js +461 -18062
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +100 -122
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +1 -1
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +106 -106
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +86 -41
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +326 -315
- package/dist/Sidebar.cjs +1 -0
- package/dist/Sidebar.js +475 -0
- package/dist/Skeleton.cjs +1 -1
- package/dist/Skeleton.js +20 -16
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Table-B30TBckZ.js +402 -0
- package/dist/Table-DceR12X9.cjs +1 -0
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/TextArea.cjs +1 -1
- package/dist/TextArea.js +1 -1
- package/dist/Tooltip-B4bajPtk.cjs +1 -0
- package/dist/Tooltip-BVqdnKK_.js +231 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +2 -3
- package/dist/aria-Bntn6ad_.cjs +1 -0
- package/dist/aria-CeA9QfD1.js +15 -0
- package/dist/components/Boundary/Boundary.d.ts +65 -0
- package/dist/components/Boundary/contexts/BoundaryContext.d.ts +28 -0
- package/dist/components/Boundary/hooks/useBoundary.d.ts +19 -0
- package/dist/components/Boundary/hooks/useBoundaryWidth.d.ts +23 -0
- package/dist/components/Boundary/index.d.ts +2 -0
- package/dist/components/Boundary/utils/width.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -1
- package/dist/components/{CheckboxGroup → Checkbox/components}/CheckboxGroup.d.ts +2 -2
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/utils/checkbox-option.d.ts +17 -0
- package/dist/components/Icon/Icon.d.ts +1 -0
- package/dist/components/Icon/index.d.ts +0 -33
- package/dist/components/Input/Input.d.ts +1 -9
- package/dist/components/Modal/Modal.d.ts +0 -4
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +2 -6
- package/dist/components/Portal/Portal.d.ts +11 -8
- package/dist/components/Portal/hooks/useDismissableLayer.d.ts +2 -0
- package/dist/components/Portal/hooks/useFloatingPosition.d.ts +4 -3
- package/dist/components/Portal/hooks/useFocusTrap.d.ts +2 -0
- package/dist/components/Portal/hooks/useScrollLock.d.ts +9 -3
- package/dist/components/Portal/utils/boundary-focus.d.ts +23 -0
- package/dist/components/Portal/utils/floating-position.d.ts +43 -9
- package/dist/components/Portal/utils/overlay-stack.d.ts +22 -10
- package/dist/components/Portal/utils/scroll-container.d.ts +13 -0
- package/dist/components/Radio/Radio.d.ts +9 -1
- package/dist/components/{RadioGroup → Radio/components}/RadioGroup.d.ts +9 -2
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +0 -2
- package/dist/components/Select/utils/listbox-position.d.ts +28 -0
- package/dist/components/Sidebar/Sidebar.d.ts +108 -0
- package/dist/components/Sidebar/components/SidebarFooter.d.ts +19 -0
- package/dist/components/Sidebar/components/SidebarGroup.d.ts +42 -0
- package/dist/components/Sidebar/components/SidebarItem.d.ts +43 -0
- package/dist/components/Sidebar/components/SidebarOverlay.d.ts +38 -0
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarUser.d.ts +59 -0
- package/dist/components/Sidebar/hooks/usePresentation.d.ts +14 -0
- package/dist/components/Sidebar/hooks/useSidebar.d.ts +9 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/utils/state.d.ts +62 -0
- package/dist/components/Skeleton/Skeleton.d.ts +21 -5
- package/dist/components/Table/Table.d.ts +9 -49
- package/dist/components/Table/contexts/TableContext.d.ts +4 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +10 -4
- package/dist/components/Tooltip/TooltipProvider.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +0 -1
- package/dist/effects-D5CWf-Pl.js +8 -0
- package/dist/effects-D85L_7zM.cjs +1 -0
- package/dist/floating-position-5wJ5G5IT.js +48 -0
- package/dist/floating-position-Cy9xxdH4.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/tokens.d.ts +1 -0
- package/dist/useFloatingPosition-BBEUHPqy.cjs +1 -0
- package/dist/useFloatingPosition-CMirP2-2.js +43 -0
- package/dist/useFocusTrap-BrFZdMqQ.cjs +1 -0
- package/dist/useFocusTrap-DhVnlboe.js +136 -0
- package/dist/usePresence-B5RYv4e1.cjs +1 -0
- package/dist/usePresence-CqegYqy4.js +221 -0
- package/dist/useScrollLock-Drd7OZRC.js +62 -0
- package/dist/useScrollLock-Dy8MZaSn.cjs +1 -0
- package/dist/utils/aria.d.ts +9 -0
- package/dist/utils/effects.d.ts +12 -0
- package/package.json +11 -16
- package/dist/Button-D7JUO6Fs.cjs +0 -1
- package/dist/Checkbox-BvXM9VyY.js +0 -68
- package/dist/Checkbox-VQifZrZZ.cjs +0 -1
- package/dist/CheckboxGroup.cjs +0 -1
- package/dist/CheckboxGroup.js +0 -144
- package/dist/Code-BP2ZCmUf.js +0 -7446
- package/dist/Code-eispVOW3.cjs +0 -6
- package/dist/Content.cjs +0 -1
- package/dist/Content.js +0 -144
- package/dist/Icon-D8IZceys.cjs +0 -1
- package/dist/RadioGroup.cjs +0 -1
- package/dist/RadioGroup.js +0 -51
- package/dist/RadioGroupContext-BX9KnDek.cjs +0 -1
- package/dist/RadioGroupContext-DbKM4zPZ.js +0 -5
- package/dist/Table-83unQQOi.cjs +0 -1
- package/dist/Table-Cw8u-pEW.js +0 -403
- package/dist/Tooltip-BB82wNOE.cjs +0 -1
- package/dist/Tooltip-CqWK_GRD.js +0 -236
- package/dist/aria-DHnOMyYp.js +0 -10
- package/dist/aria-DKxpE8cA.cjs +0 -1
- package/dist/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/components/Content/Content.d.ts +0 -60
- package/dist/components/Content/hooks/useContentLayout.d.ts +0 -18
- package/dist/components/Content/index.d.ts +0 -2
- package/dist/components/Content/utils/layout.d.ts +0 -11
- package/dist/components/RadioGroup/index.d.ts +0 -2
- package/dist/useFloatingPosition-CxzhAvy8.js +0 -73
- package/dist/useFloatingPosition-D1FqYy0l.cjs +0 -1
- package/dist/useFocusTrap--cgjy78G.cjs +0 -1
- package/dist/useFocusTrap-Da4nEash.js +0 -134
- package/dist/usePresence-DSPt6aKi.js +0 -210
- package/dist/usePresence-qe92UTvK.cjs +0 -1
- /package/dist/components/{CheckboxGroup → Checkbox}/contexts/CheckboxGroupContext.d.ts +0 -0
- /package/dist/components/{CheckboxGroup → Checkbox}/hooks/useCheckboxGroup.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/contexts/RadioGroupContext.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/hooks/useRadioGroup.d.ts +0 -0
package/dist/CheckboxGroup.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|
package/dist/CheckboxGroup.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
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
|
-
};
|