neatkit 0.9.0 → 0.11.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/Boundary.cjs +1 -1
- package/dist/Boundary.js +191 -120
- package/dist/{Button-DU4j_IED.cjs → Button-DtrX4X-s.cjs} +1 -1
- package/dist/{Button-BV5OUXpc.js → Button-LmEHdRkW.js} +2 -2
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +112 -111
- package/dist/Field.cjs +1 -1
- package/dist/Field.js +57 -62
- package/dist/Icon-CMSHMSDJ.cjs +1 -0
- package/dist/{Icon-CxK1wlGk.js → Icon-NT3kRJYz.js} +275 -94
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +53 -52
- package/dist/Markdown.cjs +1 -1
- package/dist/Markdown.js +1 -1
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +58 -57
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +89 -88
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +117 -119
- package/dist/Progress.cjs +1 -0
- package/dist/Progress.js +40 -0
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +48 -47
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +364 -359
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +381 -332
- package/dist/Spinner-BE0F4y2S.cjs +1 -0
- package/dist/Spinner-CmxlDlOk.js +23 -0
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/{Table-qetwZpTC.cjs → Table-Bjw9lUKS.cjs} +1 -1
- package/dist/{Table-CADupJEU.js → Table-GeoE4h-u.js} +2 -2
- 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-CpyROf6x.js +225 -0
- package/dist/Tooltip-DDPh_YFO.cjs +1 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/aria-Bv-xVREf.js +17 -0
- package/dist/aria-DM-xYEHQ.cjs +1 -0
- package/dist/components/Boundary/hooks/useDocumentBackground.d.ts +28 -0
- package/dist/components/Icon/icons/AppleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/BingIcon.d.ts +11 -0
- package/dist/components/Icon/icons/FacebookIcon.d.ts +11 -0
- package/dist/components/Icon/icons/GoogleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/InstagramIcon.d.ts +11 -0
- package/dist/components/Icon/icons/MicrosoftIcon.d.ts +11 -0
- package/dist/components/Icon/icons/TwitterIcon.d.ts +11 -0
- package/dist/components/Icon/utils/registry.d.ts +7 -0
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Portal/hooks/useAnchoredPosition.d.ts +59 -0
- package/dist/components/Progress/Progress.d.ts +38 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/utils/value.d.ts +25 -0
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +6 -74
- package/dist/components/Select/components/CustomSelect.d.ts +59 -0
- package/dist/components/Select/components/NativeSelect.d.ts +26 -0
- package/dist/components/Select/components/SelectListbox.d.ts +50 -0
- package/dist/components/Select/hooks/useSelectFormReset.d.ts +27 -0
- package/dist/components/Select/hooks/useSelectPosition.d.ts +12 -0
- package/dist/components/Select/hooks/useTypeahead.d.ts +14 -0
- package/dist/components/Select/utils/options.d.ts +38 -0
- package/dist/components/Sidebar/Sidebar.d.ts +30 -24
- package/dist/components/Sidebar/components/SidebarFallbackTrigger.d.ts +32 -0
- package/dist/components/Sidebar/components/SidebarOverlay.d.ts +3 -4
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +3 -3
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +4 -0
- package/dist/effects-D98vUn6N.cjs +1 -0
- package/dist/effects-DGbA6Q2O.js +18 -0
- package/dist/style.css +1 -1
- package/dist/useAnchoredPosition-C0VS7hm6.js +105 -0
- package/dist/useAnchoredPosition-D7GRFzoX.cjs +1 -0
- package/dist/useFloatingPosition-DQgw-w_Z.cjs +1 -0
- package/dist/useFloatingPosition-MGoyautY.js +57 -0
- package/dist/useFocusTrap-BxPazAL6.js +136 -0
- package/dist/useFocusTrap-CrMcAu8s.cjs +1 -0
- package/dist/{usePresence-CqegYqy4.js → usePresence-BTRY1_l-.js} +47 -56
- package/dist/usePresence-Dm0mls5p.cjs +1 -0
- package/dist/utils/aria.d.ts +4 -5
- package/dist/utils/trigger.d.ts +46 -0
- package/package.json +6 -1
- package/dist/Icon-BIBzgznI.cjs +0 -1
- package/dist/Spinner-BXgw60UC.cjs +0 -1
- package/dist/Spinner-CVYvk6YK.js +0 -25
- package/dist/Tooltip-B2d5ss7S.cjs +0 -1
- package/dist/Tooltip-BK64rkxV.js +0 -231
- package/dist/aria-Bntn6ad_.cjs +0 -1
- package/dist/aria-CeA9QfD1.js +0 -15
- package/dist/effects-D5CWf-Pl.js +0 -8
- package/dist/effects-D85L_7zM.cjs +0 -1
- package/dist/floating-position-DIjh2wnP.cjs +0 -1
- package/dist/floating-position-DvR6e334.js +0 -50
- package/dist/useFloatingPosition-B3ZC-v3v.js +0 -43
- package/dist/useFloatingPosition-GzkP9dCc.cjs +0 -1
- package/dist/useFocusTrap-BrFZdMqQ.cjs +0 -1
- package/dist/useFocusTrap-DhVnlboe.js +0 -136
- package/dist/usePresence-B5RYv4e1.cjs +0 -1
package/dist/Popover.js
CHANGED
|
@@ -1,230 +1,228 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as ne, Fragment as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { m as
|
|
5
|
-
import { u as
|
|
6
|
-
import { g as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { u as
|
|
10
|
-
import { S as
|
|
11
|
-
function
|
|
12
|
-
const { inert: a, panelElement: i } =
|
|
13
|
-
return
|
|
2
|
+
import { jsxs as ne, Fragment as Ne, jsx as I } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as _e, Fragment as Be, useId as qe, useContext as ze, useState as A, useRef as y, useReducer as Ae, useMemo as Me, useCallback as h, useEffect as M, cloneElement as $e } from "react";
|
|
4
|
+
import { m as je } from "./aria-Bv-xVREf.js";
|
|
5
|
+
import { u as He, a as Ke } from "./effects-DGbA6Q2O.js";
|
|
6
|
+
import { g as Ve, a as se } from "./reference-CXMr27nM.js";
|
|
7
|
+
import { u as Ue, r as Ge } from "./useFloatingPosition-MGoyautY.js";
|
|
8
|
+
import { F as oe, b as Je, c as Qe, d as We, P as Xe } from "./usePresence-BTRY1_l-.js";
|
|
9
|
+
import { u as Ye } from "./useFocusTrap-BxPazAL6.js";
|
|
10
|
+
import { S as Ze } from "./Surface-vEFsZC12.js";
|
|
11
|
+
function er(t) {
|
|
12
|
+
const { inert: a, panelElement: i } = t;
|
|
13
|
+
return Ke(() => {
|
|
14
14
|
i && (i.inert = a);
|
|
15
15
|
}, [a, i]), null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
a.current =
|
|
17
|
+
function rr(t, a, i) {
|
|
18
|
+
a.current = t, se(i, t);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
a.current =
|
|
20
|
+
function tr(t, a, i) {
|
|
21
|
+
a.current = t, se(i, t);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const a =
|
|
25
|
-
return
|
|
23
|
+
function nr(t) {
|
|
24
|
+
const a = t.tagName.toLowerCase();
|
|
25
|
+
return t.getAttribute("role") === "button" && a !== "button" ? !1 : ["button", "input", "select", "summary", "textarea"].includes(a) ? !0 : a === "a" && t.hasAttribute("href");
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
27
|
+
function or(t) {
|
|
28
|
+
return t === "grid" || t === "listbox" || t === "menu" || t === "tree" ? t : "dialog";
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const mr = _e(function(a, i) {
|
|
31
31
|
const {
|
|
32
|
-
"aria-label":
|
|
32
|
+
"aria-label": $,
|
|
33
33
|
"aria-labelledby": ae,
|
|
34
|
-
autoFocus:
|
|
34
|
+
autoFocus: D = !0,
|
|
35
35
|
children: ie,
|
|
36
36
|
className: ce,
|
|
37
37
|
closeOnEscape: le = !0,
|
|
38
38
|
closeOnOutsideInteraction: ue = !0,
|
|
39
39
|
defaultOpen: de = !1,
|
|
40
40
|
disabled: R = !1,
|
|
41
|
-
initialFocusReference:
|
|
41
|
+
initialFocusReference: P,
|
|
42
42
|
onEscapeKeyDown: fe,
|
|
43
43
|
onOpenChange: x,
|
|
44
|
-
onPointerDownOutside:
|
|
45
|
-
open:
|
|
46
|
-
placement:
|
|
44
|
+
onPointerDownOutside: O,
|
|
45
|
+
open: j,
|
|
46
|
+
placement: H = "bottom",
|
|
47
47
|
restoreFocus: L = !0,
|
|
48
|
-
role:
|
|
48
|
+
role: K = "dialog",
|
|
49
49
|
style: V,
|
|
50
50
|
tabIndex: pe,
|
|
51
|
-
trapFocus:
|
|
51
|
+
trapFocus: g = !1,
|
|
52
52
|
trigger: l,
|
|
53
|
-
...
|
|
53
|
+
...ge
|
|
54
54
|
} = a;
|
|
55
55
|
if (l.type === Be)
|
|
56
56
|
throw new Error("Popover requires a single non-Fragment trigger");
|
|
57
|
-
const U =
|
|
57
|
+
const U = qe(), me = ze(oe), G = `${U}-popover`, o = l.props, J = Ve(l), Q = o.id ?? `${U}-trigger`, m = R || o.disabled === !0 || o["aria-disabled"] === !0 || o["aria-disabled"] === "true", T = j !== void 0, [be, ve] = A(de), r = T ? j : be, k = Je(r), W = y(null), X = y(null), N = y("programmatic"), _ = y(null), Y = y(r), E = y(null), [ye, he] = Ae(
|
|
58
58
|
(e) => e + 1,
|
|
59
59
|
0
|
|
60
|
-
), [c, Pe] =
|
|
60
|
+
), [c, Pe] = A(null), [u, Te] = A(null), s = (c == null ? void 0 : c.ownerDocument) ?? (typeof document > "u" ? null : document), C = He("Popover").boundaryElement, S = Qe(k.present, C), Ee = Me(
|
|
61
61
|
() => [W, X],
|
|
62
62
|
[]
|
|
63
|
-
), d =
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
), d = Ue(
|
|
64
|
+
k.present,
|
|
65
|
+
H,
|
|
66
66
|
c,
|
|
67
67
|
u,
|
|
68
|
-
|
|
69
|
-
), Ie =
|
|
68
|
+
C
|
|
69
|
+
), Ie = h(
|
|
70
70
|
(e) => {
|
|
71
|
-
|
|
71
|
+
tr(
|
|
72
72
|
e,
|
|
73
73
|
W,
|
|
74
74
|
J
|
|
75
75
|
), Pe(e);
|
|
76
76
|
},
|
|
77
77
|
[J]
|
|
78
|
-
), Re =
|
|
78
|
+
), Re = h(
|
|
79
79
|
(e) => {
|
|
80
|
-
|
|
80
|
+
rr(
|
|
81
81
|
e,
|
|
82
82
|
X,
|
|
83
83
|
i
|
|
84
|
-
),
|
|
84
|
+
), Te(e);
|
|
85
85
|
},
|
|
86
86
|
[i]
|
|
87
|
-
), f =
|
|
88
|
-
r !== e && (
|
|
87
|
+
), f = h((e, n) => {
|
|
88
|
+
r !== e && (T ? (_.current = {
|
|
89
89
|
open: e,
|
|
90
|
-
reason:
|
|
91
|
-
}, he()) : (N.current =
|
|
92
|
-
}, [
|
|
90
|
+
reason: n
|
|
91
|
+
}, he()) : (N.current = n, ve(e)), x == null || x(e, n));
|
|
92
|
+
}, [T, x, r]), xe = h(() => {
|
|
93
93
|
f(!1, "escape");
|
|
94
|
-
}, [f]),
|
|
94
|
+
}, [f]), Oe = h(() => {
|
|
95
95
|
f(!1, "outside");
|
|
96
|
-
}, [f]),
|
|
96
|
+
}, [f]), ke = h((e) => {
|
|
97
97
|
var p;
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
(
|
|
102
|
-
) ?? e.target :
|
|
103
|
-
}, [
|
|
104
|
-
|
|
105
|
-
boundary:
|
|
98
|
+
if (O == null || O(e), e.defaultPrevented) return;
|
|
99
|
+
const n = (p = s == null ? void 0 : s.defaultView) == null ? void 0 : p.HTMLElement;
|
|
100
|
+
n ? E.current = e.composedPath().find(
|
|
101
|
+
(v) => v instanceof n && v.tabIndex >= 0
|
|
102
|
+
) ?? e.target : E.current = e.target;
|
|
103
|
+
}, [O, s]);
|
|
104
|
+
We({
|
|
105
|
+
boundary: C,
|
|
106
106
|
active: r,
|
|
107
|
-
boundaries:
|
|
107
|
+
boundaries: Ee,
|
|
108
108
|
dismissOnEscape: le,
|
|
109
109
|
dismissOnPointerDownOutside: ue,
|
|
110
|
-
layerId:
|
|
110
|
+
layerId: S.id,
|
|
111
111
|
onEscapeDismiss: xe,
|
|
112
112
|
onEscapeKeyDown: fe,
|
|
113
|
-
onPointerDownOutside:
|
|
114
|
-
onPointerDownOutsideDismiss:
|
|
113
|
+
onPointerDownOutside: ke,
|
|
114
|
+
onPointerDownOutsideDismiss: Oe,
|
|
115
115
|
ownerDocument: s
|
|
116
116
|
});
|
|
117
|
-
const
|
|
118
|
-
boundary:
|
|
119
|
-
active: r &&
|
|
120
|
-
autoFocus:
|
|
117
|
+
const Ce = Ye({
|
|
118
|
+
boundary: C,
|
|
119
|
+
active: r && g,
|
|
120
|
+
autoFocus: D,
|
|
121
121
|
container: u,
|
|
122
|
-
initialFocusReference:
|
|
123
|
-
layerId:
|
|
122
|
+
initialFocusReference: P,
|
|
123
|
+
layerId: S.id,
|
|
124
124
|
restoreFocus: L
|
|
125
125
|
});
|
|
126
|
-
|
|
127
|
-
if (!r ||
|
|
126
|
+
M(() => {
|
|
127
|
+
if (!r || g || !D || !u) return;
|
|
128
128
|
let e = !0;
|
|
129
129
|
return Promise.resolve().then(() => {
|
|
130
130
|
if (!e) return;
|
|
131
|
-
const
|
|
132
|
-
(
|
|
131
|
+
const n = P == null ? void 0 : P.current;
|
|
132
|
+
(n && u.contains(n) ? n : u).focus({ preventScroll: !0 });
|
|
133
133
|
}), () => {
|
|
134
134
|
e = !1;
|
|
135
135
|
};
|
|
136
|
-
}, [
|
|
136
|
+
}, [D, P, r, u, g]), M(() => {
|
|
137
137
|
var te;
|
|
138
138
|
const e = Y.current;
|
|
139
139
|
Y.current = r;
|
|
140
|
-
const
|
|
140
|
+
const n = _.current;
|
|
141
141
|
let p = N.current;
|
|
142
|
-
if (
|
|
143
|
-
N.current = "programmatic",
|
|
142
|
+
if (T && (p = "programmatic", e !== r && (n == null ? void 0 : n.open) === r && (p = n.reason)), _.current = null, r) {
|
|
143
|
+
N.current = "programmatic", E.current = null;
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
const
|
|
147
|
-
e && !
|
|
146
|
+
const v = s == null ? void 0 : s.activeElement, q = E.current, z = (te = s == null ? void 0 : s.defaultView) == null ? void 0 : te.HTMLElement, Le = p === "outside" && z && q instanceof z && v instanceof z && (q === v || q.contains(v));
|
|
147
|
+
e && !g && L && !Le && (c == null || c.focus({ preventScroll: !0 })), E.current = null;
|
|
148
148
|
}, [
|
|
149
149
|
ye,
|
|
150
|
-
|
|
150
|
+
T,
|
|
151
151
|
r,
|
|
152
152
|
s,
|
|
153
153
|
L,
|
|
154
|
-
|
|
154
|
+
g,
|
|
155
155
|
c
|
|
156
|
-
]),
|
|
156
|
+
]), M(() => {
|
|
157
157
|
R && r && f(!1, "programmatic");
|
|
158
158
|
}, [R, r, f]);
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
-
if (P) {
|
|
159
|
+
function Se(e) {
|
|
160
|
+
if (m) {
|
|
162
161
|
e.preventDefault(), e.stopPropagation();
|
|
163
162
|
return;
|
|
164
163
|
}
|
|
165
|
-
|
|
164
|
+
e.defaultPrevented || f(!r, "trigger");
|
|
166
165
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
169
|
-
(t = n.onKeyDown) == null || t.call(n, e), !(e.defaultPrevented || P || rr(e.currentTarget) || e.key !== "Enter" && e.key !== " ") && (e.preventDefault(), e.currentTarget.click());
|
|
166
|
+
function we(e) {
|
|
167
|
+
e.defaultPrevented || m || nr(e.currentTarget) || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.currentTarget.click());
|
|
170
168
|
}
|
|
171
169
|
if (R) return l;
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
let
|
|
176
|
-
|
|
177
|
-
const
|
|
170
|
+
const B = typeof l.type == "string", b = B ? l.type : null, Z = b === "a" && typeof o.href == "string", ee = B && !(b === "button" || b === "input" || b === "select" || b === "summary" || b === "textarea" || Z), re = Z && m;
|
|
171
|
+
let w = o.role;
|
|
172
|
+
w === void 0 && (re ? w = "link" : ee && (w = "button"));
|
|
173
|
+
let F = o.tabIndex;
|
|
174
|
+
F === void 0 && ee && (F = 0), m && (F = -1);
|
|
175
|
+
const Fe = m ? { ...o, onClick: void 0 } : o, De = $e(
|
|
178
176
|
l,
|
|
179
|
-
{
|
|
180
|
-
"aria-controls": r ?
|
|
177
|
+
Ge(Fe, {
|
|
178
|
+
"aria-controls": r ? je(o["aria-controls"], G) : o["aria-controls"],
|
|
181
179
|
"aria-expanded": r,
|
|
182
|
-
"aria-haspopup":
|
|
183
|
-
"aria-disabled":
|
|
184
|
-
className:
|
|
185
|
-
href: re ? void 0 :
|
|
180
|
+
"aria-haspopup": o["aria-haspopup"] ?? or(K),
|
|
181
|
+
"aria-disabled": m ? !0 : o["aria-disabled"],
|
|
182
|
+
className: "nk-popover__trigger",
|
|
183
|
+
href: re ? void 0 : o.href,
|
|
186
184
|
id: Q,
|
|
187
|
-
onClick:
|
|
188
|
-
onKeyDown:
|
|
185
|
+
onClick: Se,
|
|
186
|
+
onKeyDown: B ? we : void 0,
|
|
189
187
|
ref: Ie,
|
|
190
|
-
role:
|
|
191
|
-
tabIndex:
|
|
192
|
-
}
|
|
188
|
+
role: w,
|
|
189
|
+
tabIndex: F
|
|
190
|
+
})
|
|
193
191
|
);
|
|
194
|
-
return /* @__PURE__ */ ne(
|
|
195
|
-
|
|
192
|
+
return /* @__PURE__ */ ne(Ne, { children: [
|
|
193
|
+
De,
|
|
196
194
|
/* @__PURE__ */ I(
|
|
197
195
|
oe.Provider,
|
|
198
196
|
{
|
|
199
|
-
value: r &&
|
|
200
|
-
children:
|
|
201
|
-
|
|
197
|
+
value: r && g ? Ce : me,
|
|
198
|
+
children: k.present && s ? /* @__PURE__ */ I(Xe, { children: /* @__PURE__ */ ne(
|
|
199
|
+
Ze,
|
|
202
200
|
{
|
|
203
|
-
...
|
|
201
|
+
...ge,
|
|
204
202
|
ref: Re,
|
|
205
203
|
"aria-hidden": r ? void 0 : !0,
|
|
206
|
-
"aria-label": r ?
|
|
207
|
-
"aria-labelledby": r ? ae ?? (
|
|
204
|
+
"aria-label": r ? $ : void 0,
|
|
205
|
+
"aria-labelledby": r ? ae ?? ($ === void 0 ? Q : void 0) : void 0,
|
|
208
206
|
className: ["nk-popover", ce].filter(Boolean).join(" "),
|
|
209
|
-
"data-placement": (d == null ? void 0 : d.placement) ??
|
|
210
|
-
"data-state":
|
|
207
|
+
"data-placement": (d == null ? void 0 : d.placement) ?? H,
|
|
208
|
+
"data-state": k.state === "closing" ? "closing" : "open",
|
|
211
209
|
id: G,
|
|
212
|
-
role: r ?
|
|
210
|
+
role: r ? K : void 0,
|
|
213
211
|
style: d ? {
|
|
214
212
|
...V,
|
|
215
213
|
"--nk-popover-arrow-offset": `${d.arrowOffset}px`,
|
|
216
214
|
left: d.left,
|
|
217
215
|
top: d.top,
|
|
218
|
-
zIndex:
|
|
216
|
+
zIndex: S.zIndex
|
|
219
217
|
} : {
|
|
220
218
|
...V,
|
|
221
219
|
visibility: "hidden",
|
|
222
|
-
zIndex:
|
|
220
|
+
zIndex: S.zIndex
|
|
223
221
|
},
|
|
224
222
|
tabIndex: pe ?? -1,
|
|
225
223
|
children: [
|
|
226
224
|
/* @__PURE__ */ I(
|
|
227
|
-
|
|
225
|
+
er,
|
|
228
226
|
{
|
|
229
227
|
inert: !r,
|
|
230
228
|
panelElement: u
|
|
@@ -240,5 +238,5 @@ const pr = Ne(function(a, i) {
|
|
|
240
238
|
] });
|
|
241
239
|
});
|
|
242
240
|
export {
|
|
243
|
-
|
|
241
|
+
mr as default
|
|
244
242
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),p=require("react"),c=100;function g(s,r){if(typeof s!="number"||!Number.isFinite(s))return;const t=Number.isFinite(r)&&r>0?r:c,o=Math.min(Math.max(s,0),t),n=o/t*100;return{max:t,value:o,percentage:n}}const f=p.forwardRef(function(r,t){const{className:o,max:n=c,style:l,tone:u="accent",value:d,...v}=r,e=g(d,n),a=e===void 0,m={...l,...e?{"--nk-progress-completion":`${e.percentage}%`}:void 0};return i.jsx("div",{...v,ref:t,"aria-valuemax":e==null?void 0:e.max,"aria-valuemin":a?void 0:0,"aria-valuenow":e==null?void 0:e.value,className:["nk-progress",o].filter(Boolean).join(" "),"data-indeterminate":a||void 0,"data-tone":u,role:"progressbar",style:m,children:i.jsx("span",{"aria-hidden":"true",className:"nk-progress__indicator"})})});exports.default=f;
|
package/dist/Progress.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v } from "react";
|
|
3
|
+
const c = 100;
|
|
4
|
+
function f(a, r) {
|
|
5
|
+
if (typeof a != "number" || !Number.isFinite(a)) return;
|
|
6
|
+
const o = Number.isFinite(r) && r > 0 ? r : c, n = Math.min(Math.max(a, 0), o), s = n / o * 100;
|
|
7
|
+
return { max: o, value: n, percentage: s };
|
|
8
|
+
}
|
|
9
|
+
const M = v(function(r, o) {
|
|
10
|
+
const {
|
|
11
|
+
className: n,
|
|
12
|
+
max: s = c,
|
|
13
|
+
style: l,
|
|
14
|
+
tone: d = "accent",
|
|
15
|
+
value: m,
|
|
16
|
+
...p
|
|
17
|
+
} = r, e = f(m, s), t = e === void 0, u = {
|
|
18
|
+
...l,
|
|
19
|
+
...e ? { "--nk-progress-completion": `${e.percentage}%` } : void 0
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ i(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
...p,
|
|
25
|
+
ref: o,
|
|
26
|
+
"aria-valuemax": e == null ? void 0 : e.max,
|
|
27
|
+
"aria-valuemin": t ? void 0 : 0,
|
|
28
|
+
"aria-valuenow": e == null ? void 0 : e.value,
|
|
29
|
+
className: ["nk-progress", n].filter(Boolean).join(" "),
|
|
30
|
+
"data-indeterminate": t || void 0,
|
|
31
|
+
"data-tone": d,
|
|
32
|
+
role: "progressbar",
|
|
33
|
+
style: u,
|
|
34
|
+
children: /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "nk-progress__indicator" })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
M as default
|
|
40
|
+
};
|
package/dist/Radio.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),r=require("react"),C=require("./reference-C2guRuR0.cjs"),m=require("./aria-DM-xYEHQ.cjs"),j=require("./field-control-NfLwcPj6.cjs"),q=require("./Text-DWYlIcPj.cjs"),x=r.createContext(void 0),g=r.forwardRef(function(l,t){const{"aria-invalid":c,children:v,className:p,defaultValue:R,disabled:o=!1,invalid:f=!1,name:e,onChange:u,orientation:a="vertical",required:n=!1,value:b,...h}=l,s=f||m.hasInvalidState(c),k={defaultValue:R,disabled:o,name:e,onChange:u,required:n,value:b};return d.jsx(x.Provider,{value:k,children:d.jsx("div",{...h,ref:t,"aria-disabled":o||void 0,"aria-invalid":m.resolveAriaInvalid(f,c),"aria-required":n||void 0,className:["nk-radio-group",p].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-invalid":s||void 0,"data-orientation":a,role:"radiogroup",children:v})})});j.markFieldGroupControl(g,"group");function _(){const i=r.useContext(x);if(!i)throw new Error("Radio must be rendered within RadioGroup");return i}function G(i,l,t){l.current=i,C.assignElementReference(t,i)}const N=r.forwardRef(function(l,t){const{children:c,className:v,disabled:p=!1,style:R,value:o,...f}=l,e=_(),u=r.useRef(null),a=e.disabled||p,n=e.value!==void 0,b=e.value===o,h=r.useCallback(s=>G(s,u,t),[t]);return r.useEffect(()=>{var s;!n&&a&&((s=u.current)!=null&&s.checked)&&(u.current.checked=!1)},[n,a]),d.jsxs("label",{className:["nk-radio",v].filter(Boolean).join(" "),"data-disabled":a||void 0,style:R,children:[d.jsx("input",{...f,ref:h,checked:n?!a&&b:void 0,className:"nk-radio__control",defaultChecked:n?void 0:!a&&e.defaultValue===o,disabled:a,name:e.name,onChange:e.onChange,required:e.required,type:"radio",value:o}),d.jsx("span",{"aria-hidden":"true",className:"nk-radio__visual"}),d.jsx(q.Text,{as:"span",className:"nk-radio__label",children:c})]})}),w=Object.assign(N,{Group:g});exports.default=w;
|
package/dist/Radio.js
CHANGED
|
@@ -1,110 +1,111 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as l, jsxs as g } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as x, forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { createContext as x, forwardRef as R, useContext as G, useRef as N, useCallback as _, useEffect as j } from "react";
|
|
4
|
+
import { a as q } from "./reference-CXMr27nM.js";
|
|
5
|
+
import { r as I, h as V } from "./aria-Bv-xVREf.js";
|
|
6
|
+
import { m as w } from "./field-control-XAn_FKks.js";
|
|
7
|
+
import { T as E } from "./Text-rN6iDo0V.js";
|
|
8
|
+
const b = x(void 0), k = R(
|
|
9
|
+
function(d, n) {
|
|
9
10
|
const {
|
|
10
|
-
"aria-invalid":
|
|
11
|
+
"aria-invalid": c,
|
|
11
12
|
children: f,
|
|
12
13
|
className: p,
|
|
13
14
|
defaultValue: v,
|
|
14
|
-
disabled:
|
|
15
|
-
invalid:
|
|
15
|
+
disabled: i = !1,
|
|
16
|
+
invalid: u = !1,
|
|
16
17
|
name: e,
|
|
17
|
-
onChange:
|
|
18
|
-
orientation:
|
|
18
|
+
onChange: s,
|
|
19
|
+
orientation: a = "vertical",
|
|
19
20
|
required: r = !1,
|
|
20
21
|
value: m,
|
|
21
22
|
...h
|
|
22
|
-
} =
|
|
23
|
+
} = d, t = u || V(c), C = {
|
|
23
24
|
defaultValue: v,
|
|
24
|
-
disabled:
|
|
25
|
+
disabled: i,
|
|
25
26
|
name: e,
|
|
26
|
-
onChange:
|
|
27
|
+
onChange: s,
|
|
27
28
|
required: r,
|
|
28
29
|
value: m
|
|
29
30
|
};
|
|
30
|
-
return /* @__PURE__ */ l(
|
|
31
|
+
return /* @__PURE__ */ l(b.Provider, { value: C, children: /* @__PURE__ */ l(
|
|
31
32
|
"div",
|
|
32
33
|
{
|
|
33
34
|
...h,
|
|
34
|
-
ref:
|
|
35
|
-
"aria-disabled":
|
|
36
|
-
"aria-invalid":
|
|
35
|
+
ref: n,
|
|
36
|
+
"aria-disabled": i || void 0,
|
|
37
|
+
"aria-invalid": I(u, c),
|
|
37
38
|
"aria-required": r || void 0,
|
|
38
39
|
className: ["nk-radio-group", p].filter(Boolean).join(" "),
|
|
39
|
-
"data-disabled":
|
|
40
|
+
"data-disabled": i || void 0,
|
|
40
41
|
"data-invalid": t || void 0,
|
|
41
|
-
"data-orientation":
|
|
42
|
+
"data-orientation": a,
|
|
42
43
|
role: "radiogroup",
|
|
43
44
|
children: f
|
|
44
45
|
}
|
|
45
46
|
) });
|
|
46
47
|
}
|
|
47
48
|
);
|
|
48
|
-
|
|
49
|
+
w(k, "group");
|
|
49
50
|
function P() {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
51
|
+
const o = G(b);
|
|
52
|
+
if (!o)
|
|
52
53
|
throw new Error("Radio must be rendered within RadioGroup");
|
|
53
|
-
return
|
|
54
|
+
return o;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
56
|
+
function y(o, d, n) {
|
|
57
|
+
d.current = o, q(n, o);
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
+
const B = R(function(d, n) {
|
|
59
60
|
const {
|
|
60
|
-
children:
|
|
61
|
+
children: c,
|
|
61
62
|
className: f,
|
|
62
63
|
disabled: p = !1,
|
|
63
64
|
style: v,
|
|
64
|
-
value:
|
|
65
|
-
...
|
|
66
|
-
} =
|
|
67
|
-
(t) =>
|
|
65
|
+
value: i,
|
|
66
|
+
...u
|
|
67
|
+
} = d, e = P(), s = N(null), a = e.disabled || p, r = e.value !== void 0, m = e.value === i, h = _(
|
|
68
|
+
(t) => y(
|
|
68
69
|
t,
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
s,
|
|
71
|
+
n
|
|
71
72
|
),
|
|
72
|
-
[
|
|
73
|
+
[n]
|
|
73
74
|
);
|
|
74
75
|
return j(() => {
|
|
75
76
|
var t;
|
|
76
|
-
!r &&
|
|
77
|
-
}, [r,
|
|
77
|
+
!r && a && ((t = s.current) != null && t.checked) && (s.current.checked = !1);
|
|
78
|
+
}, [r, a]), /* @__PURE__ */ g(
|
|
78
79
|
"label",
|
|
79
80
|
{
|
|
80
81
|
className: ["nk-radio", f].filter(Boolean).join(" "),
|
|
81
|
-
"data-disabled":
|
|
82
|
+
"data-disabled": a || void 0,
|
|
82
83
|
style: v,
|
|
83
84
|
children: [
|
|
84
85
|
/* @__PURE__ */ l(
|
|
85
86
|
"input",
|
|
86
87
|
{
|
|
87
|
-
...
|
|
88
|
+
...u,
|
|
88
89
|
ref: h,
|
|
89
|
-
checked: r ? !
|
|
90
|
+
checked: r ? !a && m : void 0,
|
|
90
91
|
className: "nk-radio__control",
|
|
91
|
-
defaultChecked: r ? void 0 : !
|
|
92
|
-
disabled:
|
|
92
|
+
defaultChecked: r ? void 0 : !a && e.defaultValue === i,
|
|
93
|
+
disabled: a,
|
|
93
94
|
name: e.name,
|
|
94
95
|
onChange: e.onChange,
|
|
95
96
|
required: e.required,
|
|
96
97
|
type: "radio",
|
|
97
|
-
value:
|
|
98
|
+
value: i
|
|
98
99
|
}
|
|
99
100
|
),
|
|
100
101
|
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: "nk-radio__visual" }),
|
|
101
|
-
/* @__PURE__ */ l(
|
|
102
|
+
/* @__PURE__ */ l(E, { as: "span", className: "nk-radio__label", children: c })
|
|
102
103
|
]
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
|
-
}),
|
|
106
|
-
Group:
|
|
106
|
+
}), z = Object.assign(B, {
|
|
107
|
+
Group: k
|
|
107
108
|
});
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
z as default
|
|
110
111
|
};
|