neatkit 0.8.0 → 0.10.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.
Files changed (113) hide show
  1. package/dist/Boundary.cjs +1 -1
  2. package/dist/Boundary.js +29 -29
  3. package/dist/Button-CVe9T_Zw.cjs +1 -0
  4. package/dist/Button-D6rXvcqq.js +101 -0
  5. package/dist/Button.cjs +1 -1
  6. package/dist/Button.js +1 -1
  7. package/dist/Checkbox.cjs +1 -1
  8. package/dist/Checkbox.js +111 -110
  9. package/dist/{Code-JDb4VFl7.cjs → Code-B7s_rN0G.cjs} +1 -1
  10. package/dist/{Code-ClkozPlv.js → Code-Bp2X1k-g.js} +1 -4
  11. package/dist/Code.cjs +1 -1
  12. package/dist/Code.js +1 -1
  13. package/dist/Divider-C7XGlr26.cjs +1 -0
  14. package/dist/{Divider-BE15WVDI.js → Divider-DZgpYpr-.js} +1 -1
  15. package/dist/Divider.cjs +1 -1
  16. package/dist/Divider.js +1 -1
  17. package/dist/Icon-BIBzgznI.cjs +1 -0
  18. package/dist/{Icon-BoEUoOk7.js → Icon-CxK1wlGk.js} +98 -52
  19. package/dist/Icon.cjs +1 -1
  20. package/dist/Icon.js +1 -1
  21. package/dist/Input.cjs +1 -1
  22. package/dist/Input.js +52 -51
  23. package/dist/Markdown.cjs +1 -1
  24. package/dist/Markdown.js +108 -104
  25. package/dist/Modal.cjs +1 -1
  26. package/dist/Modal.js +57 -56
  27. package/dist/PinInput.cjs +1 -1
  28. package/dist/PinInput.js +88 -87
  29. package/dist/Popover.cjs +1 -1
  30. package/dist/Popover.js +147 -141
  31. package/dist/Progress.cjs +1 -0
  32. package/dist/Progress.js +40 -0
  33. package/dist/Radio.cjs +1 -1
  34. package/dist/Radio.js +48 -47
  35. package/dist/Select.cjs +1 -1
  36. package/dist/Select.js +363 -359
  37. package/dist/Sidebar.cjs +1 -1
  38. package/dist/Sidebar.js +326 -311
  39. package/dist/Spinner-BE0F4y2S.cjs +1 -0
  40. package/dist/Spinner-CmxlDlOk.js +23 -0
  41. package/dist/Spinner.cjs +1 -1
  42. package/dist/Spinner.js +1 -1
  43. package/dist/Table-BqWBgMTU.cjs +1 -0
  44. package/dist/Table-DutHfiXR.js +423 -0
  45. package/dist/Table.cjs +1 -1
  46. package/dist/Table.js +1 -1
  47. package/dist/{Tooltip-B4bajPtk.cjs → Tooltip-CCuE-hfp.cjs} +1 -1
  48. package/dist/{Tooltip-BVqdnKK_.js → Tooltip-CeyRKNv4.js} +1 -1
  49. package/dist/Tooltip.cjs +1 -1
  50. package/dist/Tooltip.js +1 -1
  51. package/dist/albert-sans-cb3e34c4.woff2 +0 -0
  52. package/dist/components/Icon/icons/GearIcon.d.ts +11 -0
  53. package/dist/components/Icon/icons/ImageIcon.d.ts +11 -0
  54. package/dist/components/Icon/utils/registry.d.ts +2 -0
  55. package/dist/components/Portal/hooks/useAnchoredPosition.d.ts +59 -0
  56. package/dist/components/Progress/Progress.d.ts +38 -0
  57. package/dist/components/Progress/index.d.ts +2 -0
  58. package/dist/components/Progress/utils/value.d.ts +25 -0
  59. package/dist/components/Select/Select.d.ts +6 -74
  60. package/dist/components/Select/components/CustomSelect.d.ts +59 -0
  61. package/dist/components/Select/components/NativeSelect.d.ts +26 -0
  62. package/dist/components/Select/components/SelectListbox.d.ts +50 -0
  63. package/dist/components/Select/hooks/useSelectFormReset.d.ts +27 -0
  64. package/dist/components/Select/hooks/useSelectPosition.d.ts +12 -0
  65. package/dist/components/Select/hooks/useTypeahead.d.ts +14 -0
  66. package/dist/components/Select/utils/options.d.ts +38 -0
  67. package/dist/components/Sidebar/Sidebar.d.ts +36 -25
  68. package/dist/components/Sidebar/components/SidebarFooter.d.ts +5 -0
  69. package/dist/components/Sidebar/components/SidebarGroup.d.ts +5 -16
  70. package/dist/components/Sidebar/components/SidebarHeader.d.ts +29 -0
  71. package/dist/components/Sidebar/components/SidebarItem.d.ts +3 -0
  72. package/dist/components/Sidebar/components/SidebarOverlay.d.ts +3 -4
  73. package/dist/components/Sidebar/components/SidebarPanel.d.ts +4 -4
  74. package/dist/components/Sidebar/hooks/usePresentation.d.ts +2 -2
  75. package/dist/components/Sidebar/index.d.ts +1 -1
  76. package/dist/components/Sidebar/utils/presentation.d.ts +12 -0
  77. package/dist/components/Sidebar/utils/state.d.ts +2 -2
  78. package/dist/components/Table/Table.d.ts +21 -209
  79. package/dist/components/Table/components/TableAction.d.ts +18 -0
  80. package/dist/components/Table/components/TableActionCell.d.ts +15 -0
  81. package/dist/components/Table/components/TableActionHeaderCell.d.ts +13 -0
  82. package/dist/components/Table/components/TableBody.d.ts +27 -0
  83. package/dist/components/Table/components/TableCell.d.ts +42 -0
  84. package/dist/components/Table/components/TableFoot.d.ts +19 -0
  85. package/dist/components/Table/components/TableHead.d.ts +19 -0
  86. package/dist/components/Table/components/TableHeaderCell.d.ts +23 -0
  87. package/dist/components/Table/components/TableRow.d.ts +67 -0
  88. package/dist/components/Table/hooks/useHorizontalOverflow.d.ts +25 -0
  89. package/dist/components/Table/utils/cell.d.ts +25 -0
  90. package/dist/components/Table/utils/children.d.ts +18 -0
  91. package/dist/components/Table/utils/trigger.d.ts +54 -0
  92. package/dist/style.css +1 -1
  93. package/dist/useAnchoredPosition-C0VS7hm6.js +105 -0
  94. package/dist/useAnchoredPosition-D7GRFzoX.cjs +1 -0
  95. package/dist/useFloatingPosition-Dq8xpr3E.js +27 -0
  96. package/dist/useFloatingPosition-g5kXywoB.cjs +1 -0
  97. package/dist/useFocusTrap-C0IcCdNf.js +136 -0
  98. package/dist/useFocusTrap-gAK_402D.cjs +1 -0
  99. package/package.json +7 -1
  100. package/dist/Button-Chv4O66e.js +0 -99
  101. package/dist/Button-DCKtFvSo.cjs +0 -1
  102. package/dist/Divider-CJYbFcSX.cjs +0 -1
  103. package/dist/Icon-DJ4BigRz.cjs +0 -1
  104. package/dist/Spinner-BXgw60UC.cjs +0 -1
  105. package/dist/Spinner-CVYvk6YK.js +0 -25
  106. package/dist/Table-B30TBckZ.js +0 -402
  107. package/dist/Table-DceR12X9.cjs +0 -1
  108. package/dist/floating-position-5wJ5G5IT.js +0 -48
  109. package/dist/floating-position-Cy9xxdH4.cjs +0 -1
  110. package/dist/useFloatingPosition-BBEUHPqy.cjs +0 -1
  111. package/dist/useFloatingPosition-CMirP2-2.js +0 -43
  112. package/dist/useFocusTrap-BrFZdMqQ.cjs +0 -1
  113. package/dist/useFocusTrap-DhVnlboe.js +0 -136
@@ -1,402 +0,0 @@
1
- "use client";
2
- import { jsx as r, jsxs as A } from "react/jsx-runtime";
3
- import { createContext as V, forwardRef as k, useRef as x, useState as L, useCallback as z, useEffect as M, useContext as Y, Children as I, isValidElement as D, Fragment as O, cloneElement as j, createElement as X } from "react";
4
- import { a as W } from "./reference-CXMr27nM.js";
5
- import { B as $ } from "./Button-Chv4O66e.js";
6
- import { T as q } from "./Tooltip-BVqdnKK_.js";
7
- const S = V("body"), G = [
8
- "a[href]",
9
- "audio[controls]",
10
- "button",
11
- "iframe",
12
- "input",
13
- "label",
14
- "select",
15
- "summary",
16
- "textarea",
17
- "video[controls]",
18
- "[contenteditable]:not([contenteditable='false'])"
19
- ].join(","), J = /* @__PURE__ */ new Set([
20
- "button",
21
- "checkbox",
22
- "combobox",
23
- "grid",
24
- "link",
25
- "listbox",
26
- "menu",
27
- "menubar",
28
- "menuitem",
29
- "menuitemcheckbox",
30
- "menuitemradio",
31
- "option",
32
- "radio",
33
- "radiogroup",
34
- "scrollbar",
35
- "searchbox",
36
- "slider",
37
- "spinbutton",
38
- "switch",
39
- "tab",
40
- "tablist",
41
- "textbox",
42
- "tree",
43
- "treegrid",
44
- "treeitem"
45
- ]);
46
- function Q(n, l) {
47
- var e;
48
- let t = n;
49
- for (; t && t !== l; ) {
50
- if (t.matches(G) || (((e = t.getAttribute("role")) == null ? void 0 : e.split(/\s+/)) ?? []).some((i) => J.has(i)))
51
- return !0;
52
- t = t.parentElement;
53
- }
54
- return !1;
55
- }
56
- function U(n, l, t) {
57
- return n === void 0 ? l : t ? t(n) : n instanceof Date ? Number.isNaN(n.getTime()) ? "Invalid Date" : n.toISOString().slice(0, 10) : typeof n == "boolean" ? n ? "Yes" : "No" : n;
58
- }
59
- function Z(n) {
60
- if (typeof n == "number" || typeof n == "string")
61
- return String(n);
62
- }
63
- function H(n) {
64
- for (const l of I.toArray(n)) {
65
- if (D(l) && l.type === O) {
66
- if (H(l.props.children)) return !0;
67
- continue;
68
- }
69
- return !0;
70
- }
71
- return !1;
72
- }
73
- function ee(n, l) {
74
- let t = !1;
75
- function e(i) {
76
- return I.map(i, (s) => D(s) ? s.type === O ? j(
77
- s,
78
- void 0,
79
- e(
80
- s.props.children
81
- )
82
- ) : !t && s.type === F ? (t = !0, j(
83
- s,
84
- { rowTrigger: l }
85
- )) : s : s);
86
- }
87
- const c = e(n);
88
- return { attached: t, content: c };
89
- }
90
- const te = k(
91
- function(l, t) {
92
- const { children: e, className: c, ...i } = l;
93
- return /* @__PURE__ */ r(
94
- "thead",
95
- {
96
- ...i,
97
- ref: t,
98
- className: ["nk-table__head", c].filter(Boolean).join(" "),
99
- children: /* @__PURE__ */ r(S.Provider, { value: "head", children: e })
100
- }
101
- );
102
- }
103
- ), ne = k(
104
- function(l, t) {
105
- const {
106
- children: e,
107
- className: c,
108
- emptyColumnCount: i = 1,
109
- emptyMessage: s,
110
- ...m
111
- } = l, d = !H(e), h = Number.isFinite(i) ? Math.max(1, Math.floor(i)) : 1;
112
- return /* @__PURE__ */ r(
113
- "tbody",
114
- {
115
- ...m,
116
- ref: t,
117
- className: ["nk-table__body", c].filter(Boolean).join(" "),
118
- children: d && s !== void 0 ? /* @__PURE__ */ r("tr", { className: "nk-table__row", children: /* @__PURE__ */ r(
119
- "td",
120
- {
121
- className: "nk-table__cell nk-table__empty-cell",
122
- colSpan: h,
123
- children: /* @__PURE__ */ r("div", { className: "nk-table__empty-content", children: s })
124
- }
125
- ) }) : /* @__PURE__ */ r(S.Provider, { value: "body", children: e })
126
- }
127
- );
128
- }
129
- ), le = k(
130
- function(l, t) {
131
- const { children: e, className: c, ...i } = l;
132
- return /* @__PURE__ */ r(
133
- "tfoot",
134
- {
135
- ...i,
136
- ref: t,
137
- className: ["nk-table__foot", c].filter(Boolean).join(" "),
138
- children: /* @__PURE__ */ r(S.Provider, { value: "foot", children: e })
139
- }
140
- );
141
- }
142
- ), oe = k(
143
- function(l, t) {
144
- const {
145
- "aria-label": e,
146
- actions: c,
147
- children: i,
148
- className: s,
149
- download: m,
150
- href: d,
151
- hrefLang: h,
152
- onClick: f,
153
- onNavigate: a,
154
- rel: T,
155
- target: p,
156
- ...N
157
- } = l, _ = x(null), w = Y(S), u = d !== void 0 || f !== void 0, v = (e == null ? void 0 : e.trim()) || (d !== void 0 ? "Open row" : "Activate row");
158
- function g(o) {
159
- _.current = o;
160
- }
161
- const R = d !== void 0 ? {
162
- ariaLabel: v,
163
- kind: "link",
164
- linkProperties: {
165
- download: m,
166
- href: d,
167
- hrefLang: h,
168
- onNavigate: a,
169
- rel: T,
170
- target: p
171
- },
172
- reference: g
173
- } : f !== void 0 ? {
174
- ariaLabel: v,
175
- kind: "button",
176
- onClick: f,
177
- reference: g
178
- } : void 0, C = R ? ee(i, R) : { content: i }, b = w === "head" ? /* @__PURE__ */ r(re, {}) : /* @__PURE__ */ r(ie, { actions: c ?? [] });
179
- function E(o) {
180
- if (o.defaultPrevented) return;
181
- const y = o.target;
182
- if (!(y instanceof Element) || Q(y, o.currentTarget)) return;
183
- const P = _.current;
184
- if (!P) return;
185
- const B = P.ownerDocument.defaultView;
186
- if (!B) {
187
- P.click();
188
- return;
189
- }
190
- P.dispatchEvent(new B.MouseEvent("click", {
191
- altKey: o.altKey,
192
- bubbles: !0,
193
- button: o.button,
194
- buttons: o.buttons,
195
- cancelable: !0,
196
- clientX: o.clientX,
197
- clientY: o.clientY,
198
- ctrlKey: o.ctrlKey,
199
- metaKey: o.metaKey,
200
- shiftKey: o.shiftKey
201
- }));
202
- }
203
- return /* @__PURE__ */ A(
204
- "tr",
205
- {
206
- ...N,
207
- ref: t,
208
- "aria-label": u ? void 0 : e,
209
- className: ["nk-table__row", s].filter(Boolean).join(" "),
210
- "data-interactive": u || void 0,
211
- onClick: u ? E : void 0,
212
- children: [
213
- C.content,
214
- b
215
- ]
216
- }
217
- );
218
- }
219
- ), K = k(function(l, t) {
220
- const {
221
- align: e = "left",
222
- children: c,
223
- className: i,
224
- scope: s = "col",
225
- sticky: m = !1,
226
- ...d
227
- } = l;
228
- return /* @__PURE__ */ r(
229
- "th",
230
- {
231
- ...d,
232
- ref: t,
233
- className: ["nk-table__header-cell", i].filter(Boolean).join(" "),
234
- "data-align": e,
235
- "data-sticky": m || void 0,
236
- scope: s,
237
- children: c
238
- }
239
- );
240
- }), re = k(function(l, t) {
241
- const { children: e, className: c, ...i } = l;
242
- return /* @__PURE__ */ r(
243
- K,
244
- {
245
- ...i,
246
- ref: t,
247
- align: "right",
248
- className: ["nk-table__action-header-cell", c].filter(Boolean).join(" "),
249
- children: e ?? /* @__PURE__ */ r("span", { className: "nk-table__visually-hidden", children: "Row actions" })
250
- }
251
- );
252
- }), F = k(
253
- function(l, t) {
254
- const {
255
- align: e = "left",
256
- children: c,
257
- className: i,
258
- format: s,
259
- title: m,
260
- truncate: d,
261
- value: h,
262
- ...f
263
- } = l, { rowTrigger: a, ...T } = f, p = U(h, c, s), N = d === void 0 ? void 0 : { maxWidth: d }, _ = m ?? (d === void 0 ? void 0 : Z(p));
264
- return /* @__PURE__ */ A(
265
- "td",
266
- {
267
- ...T,
268
- ref: t,
269
- className: ["nk-table__cell", i].filter(Boolean).join(" "),
270
- "data-align": e,
271
- title: _,
272
- children: [
273
- (a == null ? void 0 : a.kind) === "link" && a.linkProperties ? /* @__PURE__ */ r(
274
- "a",
275
- {
276
- ref: a.reference,
277
- "aria-label": a.ariaLabel,
278
- className: "nk-table__row-trigger",
279
- download: a.linkProperties.download,
280
- href: a.linkProperties.href,
281
- hrefLang: a.linkProperties.hrefLang,
282
- onClick: a.linkProperties.onNavigate,
283
- rel: a.linkProperties.rel,
284
- target: a.linkProperties.target
285
- }
286
- ) : null,
287
- (a == null ? void 0 : a.kind) === "button" ? /* @__PURE__ */ r(
288
- "button",
289
- {
290
- ref: a.reference,
291
- "aria-label": a.ariaLabel,
292
- className: "nk-table__row-trigger",
293
- onClick: a.onClick,
294
- type: "button"
295
- }
296
- ) : null,
297
- d !== void 0 ? /* @__PURE__ */ r("span", { className: "nk-table__truncated-content", style: N, children: p }) : p
298
- ]
299
- }
300
- );
301
- }
302
- );
303
- function ae(n) {
304
- const {
305
- "aria-label": l,
306
- icon: t,
307
- label: e,
308
- ...c
309
- } = n;
310
- return /* @__PURE__ */ r(q, { content: e, children: /* @__PURE__ */ r(
311
- $,
312
- {
313
- ...c,
314
- "aria-label": l ?? e,
315
- className: "nk-table__action",
316
- icon: t,
317
- shape: "rectangle",
318
- type: "button",
319
- variant: "ghost"
320
- }
321
- ) });
322
- }
323
- function ie(n) {
324
- const { actions: l } = n;
325
- function t(e) {
326
- e.stopPropagation();
327
- }
328
- return /* @__PURE__ */ r(
329
- "td",
330
- {
331
- className: "nk-table__cell nk-table__action-cell",
332
- "data-align": "right",
333
- onClick: t,
334
- children: l.length > 0 ? /* @__PURE__ */ r("span", { className: "nk-table__action-list", children: l.map((e) => /* @__PURE__ */ X(ae, { ...e, key: e.label })) }) : null
335
- }
336
- );
337
- }
338
- const ce = k(function(l, t) {
339
- const {
340
- "aria-label": e,
341
- children: c,
342
- className: i,
343
- containerClassName: s,
344
- ...m
345
- } = l, d = x(null), h = x(null), [f, a] = L(!1), [T, p] = L(!1), N = e ? `${e} scroll area` : "Scrollable table", _ = z(
346
- (u) => {
347
- h.current = u, W(t, u);
348
- },
349
- [t]
350
- );
351
- M(() => {
352
- const u = d.current, v = h.current;
353
- if (!u || !v) return;
354
- const g = u, R = v;
355
- function C() {
356
- const y = g.scrollWidth > g.clientWidth;
357
- a(y), y || p(!1);
358
- }
359
- C();
360
- const b = g.ownerDocument.defaultView;
361
- b == null || b.addEventListener("resize", C);
362
- const E = b == null ? void 0 : b.ResizeObserver, o = E ? new E(C) : void 0;
363
- return o == null || o.observe(g), o == null || o.observe(R), () => {
364
- b == null || b.removeEventListener("resize", C), o == null || o.disconnect();
365
- };
366
- }, []);
367
- function w(u) {
368
- p(f && u.currentTarget.scrollLeft > 1);
369
- }
370
- return /* @__PURE__ */ r(
371
- "div",
372
- {
373
- ref: d,
374
- "aria-label": f ? N : void 0,
375
- className: ["nk-table__container", s].filter(Boolean).join(" "),
376
- "data-scrolled": T || void 0,
377
- onScroll: w,
378
- role: f ? "region" : void 0,
379
- tabIndex: f ? 0 : void 0,
380
- children: /* @__PURE__ */ r(
381
- "table",
382
- {
383
- ...m,
384
- ref: _,
385
- "aria-label": e,
386
- className: ["nk-table", i].filter(Boolean).join(" "),
387
- children: c
388
- }
389
- )
390
- }
391
- );
392
- }), me = Object.assign(ce, {
393
- Body: ne,
394
- Cell: F,
395
- Foot: le,
396
- HeaderCell: K,
397
- Head: te,
398
- Row: oe
399
- });
400
- export {
401
- me as T
402
- };
@@ -1 +0,0 @@
1
- "use client";"use strict";const o=require("react/jsx-runtime"),l=require("react"),A=require("./reference-C2guRuR0.cjs"),I=require("./Button-DCKtFvSo.cjs"),D=require("./Tooltip-B4bajPtk.cjs"),w=l.createContext("body"),O=["a[href]","audio[controls]","button","iframe","input","label","select","summary","textarea","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(","),H=new Set(["button","checkbox","combobox","grid","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","scrollbar","searchbox","slider","spinbutton","switch","tab","tablist","textbox","tree","treegrid","treeitem"]);function K(n,r){var e;let t=n;for(;t&&t!==r;){if(t.matches(O)||(((e=t.getAttribute("role"))==null?void 0:e.split(/\s+/))??[]).some(s=>H.has(s)))return!0;t=t.parentElement}return!1}function F(n,r,t){return n===void 0?r:t?t(n):n instanceof Date?Number.isNaN(n.getTime())?"Invalid Date":n.toISOString().slice(0,10):typeof n=="boolean"?n?"Yes":"No":n}function V(n){if(typeof n=="number"||typeof n=="string")return String(n)}function S(n){for(const r of l.Children.toArray(n)){if(l.isValidElement(r)&&r.type===l.Fragment){if(S(r.props.children))return!0;continue}return!0}return!1}function q(n,r){let t=!1;function e(s){return l.Children.map(s,d=>l.isValidElement(d)?d.type===l.Fragment?l.cloneElement(d,void 0,e(d.props.children)):!t&&d.type===L?(t=!0,l.cloneElement(d,{rowTrigger:r})):d:d)}const c=e(n);return{attached:t,content:c}}const z=l.forwardRef(function(r,t){const{children:e,className:c,...s}=r;return o.jsx("thead",{...s,ref:t,className:["nk-table__head",c].filter(Boolean).join(" "),children:o.jsx(w.Provider,{value:"head",children:e})})}),M=l.forwardRef(function(r,t){const{children:e,className:c,emptyColumnCount:s=1,emptyMessage:d,...h}=r,u=!S(e),p=Number.isFinite(s)?Math.max(1,Math.floor(s)):1;return o.jsx("tbody",{...h,ref:t,className:["nk-table__body",c].filter(Boolean).join(" "),children:u&&d!==void 0?o.jsx("tr",{className:"nk-table__row",children:o.jsx("td",{className:"nk-table__cell nk-table__empty-cell",colSpan:p,children:o.jsx("div",{className:"nk-table__empty-content",children:d})})}):o.jsx(w.Provider,{value:"body",children:e})})}),Y=l.forwardRef(function(r,t){const{children:e,className:c,...s}=r;return o.jsx("tfoot",{...s,ref:t,className:["nk-table__foot",c].filter(Boolean).join(" "),children:o.jsx(w.Provider,{value:"foot",children:e})})}),X=l.forwardRef(function(r,t){const{"aria-label":e,actions:c,children:s,className:d,download:h,href:u,hrefLang:p,onClick:m,onNavigate:i,rel:T,target:k,...x}=r,_=l.useRef(null),E=l.useContext(w),f=u!==void 0||m!==void 0,N=(e==null?void 0:e.trim())||(u!==void 0?"Open row":"Activate row");function g(a){_.current=a}const j=u!==void 0?{ariaLabel:N,kind:"link",linkProperties:{download:h,href:u,hrefLang:p,onNavigate:i,rel:T,target:k},reference:g}:m!==void 0?{ariaLabel:N,kind:"button",onClick:m,reference:g}:void 0,C=j?q(s,j):{content:s},b=E==="head"?o.jsx(W,{}):o.jsx(G,{actions:c??[]});function y(a){if(a.defaultPrevented)return;const v=a.target;if(!(v instanceof Element)||K(v,a.currentTarget))return;const R=_.current;if(!R)return;const P=R.ownerDocument.defaultView;if(!P){R.click();return}R.dispatchEvent(new P.MouseEvent("click",{altKey:a.altKey,bubbles:!0,button:a.button,buttons:a.buttons,cancelable:!0,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,shiftKey:a.shiftKey}))}return o.jsxs("tr",{...x,ref:t,"aria-label":f?void 0:e,className:["nk-table__row",d].filter(Boolean).join(" "),"data-interactive":f||void 0,onClick:f?y:void 0,children:[C.content,b]})}),B=l.forwardRef(function(r,t){const{align:e="left",children:c,className:s,scope:d="col",sticky:h=!1,...u}=r;return o.jsx("th",{...u,ref:t,className:["nk-table__header-cell",s].filter(Boolean).join(" "),"data-align":e,"data-sticky":h||void 0,scope:d,children:c})}),W=l.forwardRef(function(r,t){const{children:e,className:c,...s}=r;return o.jsx(B,{...s,ref:t,align:"right",className:["nk-table__action-header-cell",c].filter(Boolean).join(" "),children:e??o.jsx("span",{className:"nk-table__visually-hidden",children:"Row actions"})})}),L=l.forwardRef(function(r,t){const{align:e="left",children:c,className:s,format:d,title:h,truncate:u,value:p,...m}=r,{rowTrigger:i,...T}=m,k=F(p,c,d),x=u===void 0?void 0:{maxWidth:u},_=h??(u===void 0?void 0:V(k));return o.jsxs("td",{...T,ref:t,className:["nk-table__cell",s].filter(Boolean).join(" "),"data-align":e,title:_,children:[(i==null?void 0:i.kind)==="link"&&i.linkProperties?o.jsx("a",{ref:i.reference,"aria-label":i.ariaLabel,className:"nk-table__row-trigger",download:i.linkProperties.download,href:i.linkProperties.href,hrefLang:i.linkProperties.hrefLang,onClick:i.linkProperties.onNavigate,rel:i.linkProperties.rel,target:i.linkProperties.target}):null,(i==null?void 0:i.kind)==="button"?o.jsx("button",{ref:i.reference,"aria-label":i.ariaLabel,className:"nk-table__row-trigger",onClick:i.onClick,type:"button"}):null,u!==void 0?o.jsx("span",{className:"nk-table__truncated-content",style:x,children:k}):k]})});function $(n){const{"aria-label":r,icon:t,label:e,...c}=n;return o.jsx(D.Tooltip2,{content:e,children:o.jsx(I.Button,{...c,"aria-label":r??e,className:"nk-table__action",icon:t,shape:"rectangle",type:"button",variant:"ghost"})})}function G(n){const{actions:r}=n;function t(e){e.stopPropagation()}return o.jsx("td",{className:"nk-table__cell nk-table__action-cell","data-align":"right",onClick:t,children:r.length>0?o.jsx("span",{className:"nk-table__action-list",children:r.map(e=>l.createElement($,{...e,key:e.label}))}):null})}const J=l.forwardRef(function(r,t){const{"aria-label":e,children:c,className:s,containerClassName:d,...h}=r,u=l.useRef(null),p=l.useRef(null),[m,i]=l.useState(!1),[T,k]=l.useState(!1),x=e?`${e} scroll area`:"Scrollable table",_=l.useCallback(f=>{p.current=f,A.assignElementReference(t,f)},[t]);l.useEffect(()=>{const f=u.current,N=p.current;if(!f||!N)return;const g=f,j=N;function C(){const v=g.scrollWidth>g.clientWidth;i(v),v||k(!1)}C();const b=g.ownerDocument.defaultView;b==null||b.addEventListener("resize",C);const y=b==null?void 0:b.ResizeObserver,a=y?new y(C):void 0;return a==null||a.observe(g),a==null||a.observe(j),()=>{b==null||b.removeEventListener("resize",C),a==null||a.disconnect()}},[]);function E(f){k(m&&f.currentTarget.scrollLeft>1)}return o.jsx("div",{ref:u,"aria-label":m?x:void 0,className:["nk-table__container",d].filter(Boolean).join(" "),"data-scrolled":T||void 0,onScroll:E,role:m?"region":void 0,tabIndex:m?0:void 0,children:o.jsx("table",{...h,ref:_,"aria-label":e,className:["nk-table",s].filter(Boolean).join(" "),children:c})})}),Q=Object.assign(J,{Body:M,Cell:L,Foot:Y,HeaderCell:B,Head:z,Row:X});exports.Table=Q;
@@ -1,48 +0,0 @@
1
- const P = {
2
- bottom: "top",
3
- left: "right",
4
- right: "left",
5
- top: "bottom"
6
- };
7
- function O(e, h) {
8
- const t = Math.min(12, h / 2);
9
- return Math.min(Math.max(t, e), h - t);
10
- }
11
- function _(e) {
12
- return P[e];
13
- }
14
- function a(e, h) {
15
- return h === "left" || h === "right" ? e.width : e.height;
16
- }
17
- function I(e, h, t) {
18
- const f = Math.max(e.left, 0), m = Math.max(e.top, 0), i = Math.min(e.right, h), M = Math.min(e.bottom, t);
19
- return i <= f || M <= m ? e : { bottom: M, left: f, right: i, top: m };
20
- }
21
- function T(e, h, t, f, m) {
22
- const i = {
23
- bottom: m.bottom - t.bottom - h * 2,
24
- left: t.left - m.left - h * 2,
25
- right: m.right - t.right - h * 2,
26
- top: t.top - m.top - h * 2
27
- }, M = _(e), E = a(f, e), o = i[e] < E && i[M] > i[e] ? M : e;
28
- let l = t.left + (t.width - f.width) / 2, c = t.top + (t.height - f.height) / 2;
29
- o === "top" ? c = t.top - f.height - h : o === "bottom" ? c = t.bottom + h : o === "left" ? l = t.left - f.width - h : l = t.right + h;
30
- const w = m.left + h, x = m.top + h;
31
- return l = Math.min(
32
- Math.max(w, l),
33
- Math.max(w, m.right - h - f.width)
34
- ), c = Math.min(
35
- Math.max(x, c),
36
- Math.max(x, m.bottom - h - f.height)
37
- ), { arrowOffset: o === "top" || o === "bottom" ? O(
38
- t.left + t.width / 2 - l,
39
- f.width
40
- ) : O(
41
- t.top + t.height / 2 - c,
42
- f.height
43
- ), left: l, placement: o, top: c };
44
- }
45
- export {
46
- T as c,
47
- I as g
48
- };
@@ -1 +0,0 @@
1
- "use strict";const a={bottom:"top",left:"right",right:"left",top:"bottom"};function x(i,h){const t=Math.min(12,h/2);return Math.min(Math.max(t,i),h-t)}function E(i){return a[i]}function _(i,h){return h==="left"||h==="right"?i.width:i.height}function A(i,h,t){const e=Math.max(i.left,0),f=Math.max(i.top,0),m=Math.min(i.right,h),M=Math.min(i.bottom,t);return m<=e||M<=f?i:{bottom:M,left:e,right:m,top:f}}function F(i,h,t,e,f){const m={bottom:f.bottom-t.bottom-h*2,left:t.left-f.left-h*2,right:f.right-t.right-h*2,top:t.top-f.top-h*2},M=E(i),P=_(e,i),o=m[i]<P&&m[M]>m[i]?M:i;let l=t.left+(t.width-e.width)/2,c=t.top+(t.height-e.height)/2;o==="top"?c=t.top-e.height-h:o==="bottom"?c=t.bottom+h:o==="left"?l=t.left-e.width-h:l=t.right+h;const w=f.left+h,O=f.top+h;return l=Math.min(Math.max(w,l),Math.max(w,f.right-h-e.width)),c=Math.min(Math.max(O,c),Math.max(O,f.bottom-h-e.height)),{arrowOffset:o==="top"||o==="bottom"?x(t.left+t.width/2-l,e.width):x(t.top+t.height/2-c,e.height),left:l,placement:o,top:c}}exports.calculateFloatingPosition=F;exports.getVisibleBounds=A;
@@ -1 +0,0 @@
1
- "use strict";const B=require("react"),L=require("./floating-position-Cy9xxdH4.cjs"),S=8;function A(d,r,o,s,c){const[P,p]=B.useState(null);return B.useEffect(()=>{if(!d||!o||!s||!c){p(null);return}const C=o,F=s,i=c,a=o.ownerDocument.defaultView;if(!a)return;const n=a,m=n.getComputedStyle(o),f=Number.parseFloat(m.getPropertyValue("--nk-space-8")),w=Number.isFinite(f)?f:S;function e(){const v=C.getBoundingClientRect(),E=F.getBoundingClientRect(),u=i.getBoundingClientRect(),l=L.calculateFloatingPosition(r,w,v,E,L.getVisibleBounds(u,n.innerWidth,n.innerHeight));p({...l,left:l.left-u.left-i.clientLeft+i.scrollLeft,top:l.top-u.top-i.clientTop+i.scrollTop})}e(),n.addEventListener("scroll",e,!0),n.addEventListener("resize",e);const g=n.ResizeObserver,t=g?new g(e):null;return t==null||t.observe(o),t==null||t.observe(s),t==null||t.observe(c),()=>{n.removeEventListener("scroll",e,!0),n.removeEventListener("resize",e),t==null||t.disconnect()}},[d,c,s,r,o]),P}exports.useFloatingPosition=A;
@@ -1,43 +0,0 @@
1
- import { useState as v, useEffect as E } from "react";
2
- import { c as S, g as A } from "./floating-position-5wJ5G5IT.js";
3
- const N = 8;
4
- function V(d, r, n, s, c) {
5
- const [m, p] = v(null);
6
- return E(() => {
7
- if (!d || !n || !s || !c) {
8
- p(null);
9
- return;
10
- }
11
- const B = n, L = s, i = c, f = n.ownerDocument.defaultView;
12
- if (!f) return;
13
- const o = f, C = o.getComputedStyle(n), a = Number.parseFloat(
14
- C.getPropertyValue("--nk-space-8")
15
- ), P = Number.isFinite(a) ? a : N;
16
- function e() {
17
- const w = B.getBoundingClientRect(), F = L.getBoundingClientRect(), l = i.getBoundingClientRect(), u = S(
18
- r,
19
- P,
20
- w,
21
- F,
22
- A(
23
- l,
24
- o.innerWidth,
25
- o.innerHeight
26
- )
27
- );
28
- p({
29
- ...u,
30
- left: u.left - l.left - i.clientLeft + i.scrollLeft,
31
- top: u.top - l.top - i.clientTop + i.scrollTop
32
- });
33
- }
34
- e(), o.addEventListener("scroll", e, !0), o.addEventListener("resize", e);
35
- const g = o.ResizeObserver, t = g ? new g(e) : null;
36
- return t == null || t.observe(n), t == null || t.observe(s), t == null || t.observe(c), () => {
37
- o.removeEventListener("scroll", e, !0), o.removeEventListener("resize", e), t == null || t.disconnect();
38
- };
39
- }, [d, c, s, r, n]), m;
40
- }
41
- export {
42
- V as u
43
- };
@@ -1 +0,0 @@
1
- "use strict";const h=require("react"),E=require("./usePresence-B5RYv4e1.cjs"),N=require("./focus-restoration-70WcQRr5.cjs"),V=["a[href]","area[href]","button","input:not([type=hidden])","select","textarea","iframe","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(",");function B(n,o){let t=n;for(;t;){if(t.hidden||t.inert||t.getAttribute("aria-hidden")==="true")return!0;const s=t.ownerDocument.defaultView,e=s==null?void 0:s.getComputedStyle(t);if((e==null?void 0:e.display)==="none"||(e==null?void 0:e.visibility)==="hidden")return!0;if(t===o)break;t=t.parentElement}return!1}function K(n,o){var u;const t=(u=n.ownerDocument.defaultView)==null?void 0:u.HTMLInputElement;if(!t||!(n instanceof t)||n.type!=="radio"||!n.name)return!0;const s=o.filter(c=>c instanceof t&&c.type==="radio"&&c.name===n.name&&c.form===n.form),e=s.find(c=>c.checked);return e?e===n:s[0]===n}function P(n){const o=Array.from(n.querySelectorAll(V)).filter(t=>!t.matches(":disabled")&&t.tabIndex>=0&&!B(t,n));return o.filter(t=>K(t,o))}function C(n,o){const t=[n,...o];return[...new Set(t.flatMap(e=>P(e)))].sort((e,u)=>{var a;if(e===u)return 0;const c=e.compareDocumentPosition(u),m=((a=e.ownerDocument.defaultView)==null?void 0:a.Node.DOCUMENT_POSITION_FOLLOWING)??4;return c&m?-1:1})}function w(n,o,t){return t?n.contains(t)||[...o].some(s=>s.contains(t)):!1}function _(n){const{active:o,autoFocus:t=!0,boundary:s,container:e,initialFocusReference:u,layerId:c,restoreFocus:m=!0}=n,a=h.useRef(new Set),S=h.useCallback(f=>(a.current.add(f),()=>a.current.delete(f)),[]),k=h.useMemo(()=>({registerBranch:S}),[S]);return E.useOverlayFocusLayer(o&&!!e,s,c),h.useEffect(()=>{var g,I;if(!o||!e||!s)return;const f=s,i=e.ownerDocument,L=(g=i.defaultView)==null?void 0:g.HTMLElement,T=(I=i.defaultView)==null?void 0:I.Node,p=L&&i.activeElement instanceof L?i.activeElement:null;let v=!0;function O(){const r=u==null?void 0:u.current;(r&&w(e,a.current,r)?r:C(e,a.current)[0]??e).focus({preventScroll:!0})}function D(r){if(r.key!=="Tab"||!E.isTopmostFocusLayer(f,c)||E.isFocusInsideAnotherOverlay(i,f))return;const l=C(e,a.current);if(l.length===0){r.preventDefault(),e==null||e.focus({preventScroll:!0});return}const y=l[0],b=l[l.length-1],d=i.activeElement,q=w(e,a.current,d),A=!l.some(M=>M===d)&&(d===e||d===(u==null?void 0:u.current));if(!q||A){r.preventDefault(),(r.shiftKey?b:y).focus();return}r.shiftKey&&d===y?(r.preventDefault(),b.focus()):!r.shiftKey&&d===b&&(r.preventDefault(),y.focus())}function F(r){E.isTopmostFocusLayer(f,c)&&!E.isFocusInsideAnotherOverlay(i,f)&&T&&r.target instanceof T&&!w(e,a.current,r.target)&&O()}return i.addEventListener("keydown",D,!0),i.addEventListener("focusin",F,!0),t&&Promise.resolve().then(()=>{v&&O()}),()=>{v=!1,i.removeEventListener("keydown",D,!0),i.removeEventListener("focusin",F,!0),m&&(p!=null&&p.isConnected)&&N.restoreElementFocus(p)}},[o,t,s,e,u,c,m]),k}exports.useFocusTrap=_;
@@ -1,136 +0,0 @@
1
- import { useRef as V, useCallback as q, useMemo as x, useEffect as B } from "react";
2
- import { u as K, i as C, a as I } from "./usePresence-CqegYqy4.js";
3
- import { r as _ } from "./focus-restoration-BvNZzrQA.js";
4
- const H = [
5
- "a[href]",
6
- "area[href]",
7
- "button",
8
- "input:not([type=hidden])",
9
- "select",
10
- "textarea",
11
- "iframe",
12
- "[contenteditable]:not([contenteditable='false'])",
13
- "[tabindex]"
14
- ].join(",");
15
- function P(n, o) {
16
- let t = n;
17
- for (; t; ) {
18
- if (t.hidden || t.inert || t.getAttribute("aria-hidden") === "true")
19
- return !0;
20
- const s = t.ownerDocument.defaultView, e = s == null ? void 0 : s.getComputedStyle(t);
21
- if ((e == null ? void 0 : e.display) === "none" || (e == null ? void 0 : e.visibility) === "hidden")
22
- return !0;
23
- if (t === o) break;
24
- t = t.parentElement;
25
- }
26
- return !1;
27
- }
28
- function G(n, o) {
29
- var u;
30
- const t = (u = n.ownerDocument.defaultView) == null ? void 0 : u.HTMLInputElement;
31
- if (!t || !(n instanceof t) || n.type !== "radio" || !n.name)
32
- return !0;
33
- const s = o.filter(
34
- (c) => c instanceof t && c.type === "radio" && c.name === n.name && c.form === n.form
35
- ), e = s.find((c) => c.checked);
36
- return e ? e === n : s[0] === n;
37
- }
38
- function R(n) {
39
- const o = Array.from(
40
- n.querySelectorAll(H)
41
- ).filter((t) => !t.matches(":disabled") && t.tabIndex >= 0 && !P(t, n));
42
- return o.filter(
43
- (t) => G(t, o)
44
- );
45
- }
46
- function F(n, o) {
47
- const t = [n, ...o];
48
- return [...new Set(
49
- t.flatMap(
50
- (e) => R(e)
51
- )
52
- )].sort((e, u) => {
53
- var a;
54
- if (e === u) return 0;
55
- const c = e.compareDocumentPosition(u), m = ((a = e.ownerDocument.defaultView) == null ? void 0 : a.Node.DOCUMENT_POSITION_FOLLOWING) ?? 4;
56
- return c & m ? -1 : 1;
57
- });
58
- }
59
- function y(n, o, t) {
60
- return t ? n.contains(t) || [...o].some((s) => s.contains(t)) : !1;
61
- }
62
- function Q(n) {
63
- const {
64
- active: o,
65
- autoFocus: t = !0,
66
- boundary: s,
67
- container: e,
68
- initialFocusReference: u,
69
- layerId: c,
70
- restoreFocus: m = !0
71
- } = n, a = V(/* @__PURE__ */ new Set()), b = q((f) => (a.current.add(f), () => a.current.delete(f)), []), k = x(() => ({ registerBranch: b }), [b]);
72
- return K(o && !!e, s, c), B(() => {
73
- var T, g;
74
- if (!o || !e || !s) return;
75
- const f = s, i = e.ownerDocument, w = (T = i.defaultView) == null ? void 0 : T.HTMLElement, S = (g = i.defaultView) == null ? void 0 : g.Node, E = w && i.activeElement instanceof w ? i.activeElement : null;
76
- let L = !0;
77
- function v() {
78
- const r = u == null ? void 0 : u.current;
79
- (r && y(
80
- e,
81
- a.current,
82
- r
83
- ) ? r : F(
84
- e,
85
- a.current
86
- )[0] ?? e).focus({ preventScroll: !0 });
87
- }
88
- function D(r) {
89
- if (r.key !== "Tab" || !C(f, c) || I(i, f))
90
- return;
91
- const l = F(
92
- e,
93
- a.current
94
- );
95
- if (l.length === 0) {
96
- r.preventDefault(), e == null || e.focus({ preventScroll: !0 });
97
- return;
98
- }
99
- const p = l[0], h = l[l.length - 1], d = i.activeElement, M = y(
100
- e,
101
- a.current,
102
- d
103
- ), N = !l.some(
104
- (A) => A === d
105
- ) && (d === e || d === (u == null ? void 0 : u.current));
106
- if (!M || N) {
107
- r.preventDefault(), (r.shiftKey ? h : p).focus();
108
- return;
109
- }
110
- r.shiftKey && d === p ? (r.preventDefault(), h.focus()) : !r.shiftKey && d === h && (r.preventDefault(), p.focus());
111
- }
112
- function O(r) {
113
- C(f, c) && !I(i, f) && S && r.target instanceof S && !y(
114
- e,
115
- a.current,
116
- r.target
117
- ) && v();
118
- }
119
- return i.addEventListener("keydown", D, !0), i.addEventListener("focusin", O, !0), t && Promise.resolve().then(() => {
120
- L && v();
121
- }), () => {
122
- L = !1, i.removeEventListener("keydown", D, !0), i.removeEventListener("focusin", O, !0), m && (E != null && E.isConnected) && _(E);
123
- };
124
- }, [
125
- o,
126
- t,
127
- s,
128
- e,
129
- u,
130
- c,
131
- m
132
- ]), k;
133
- }
134
- export {
135
- Q as u
136
- };