neatkit 0.12.1 → 0.13.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/Sidebar.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { jsx as p, jsxs as D, Fragment as $ } from "react/jsx-runtime";
3
- import { useCallback as _, useSyncExternalStore as le, forwardRef as R, useId as ce, createElement as ye, useState as w, useRef as I, Children as Se, isValidElement as re, Fragment as de, cloneElement as z, useContext as _e, useMemo as te, useEffect as ae } from "react";
2
+ import { jsx as p, jsxs as D, Fragment as q } from "react/jsx-runtime";
3
+ import { useCallback as _, useSyncExternalStore as le, forwardRef as R, useId as ce, createElement as ye, useState as w, useRef as I, Children as Se, isValidElement as re, Fragment as de, cloneElement as $, useContext as _e, useMemo as te, useEffect as ae } from "react";
4
4
  import { u as K, a as M } from "./effects-DGbA6Q2O.js";
5
5
  import { g as Ee, a as ue } from "./reference-CXMr27nM.js";
6
6
  import { F as se, c as ke, d as Ce, b as Ne, P as oe } from "./usePresence-BTRY1_l-.js";
7
- import { B as Y } from "./Button-B0E-M8mp.js";
7
+ import { B as Y } from "./Button-CyUpMPtt.js";
8
8
  import { T as V } from "./Text-rN6iDo0V.js";
9
9
  import { u as Pe } from "./useFocusTrap-BxPazAL6.js";
10
10
  import { u as Te } from "./useScrollLock-Drd7OZRC.js";
@@ -13,7 +13,7 @@ import { r as Le } from "./useFloatingPosition-MGoyautY.js";
13
13
  import { A as Re } from "./Avatar-DjDCFqNG.js";
14
14
  import { S as Be } from "./Spinner-CmxlDlOk.js";
15
15
  import { T as Oe } from "./Tooltip-CpyROf6x.js";
16
- import { b as Fe } from "./units-BmjPCccF.js";
16
+ import { b as Fe } from "./units-Bx_CBIy8.js";
17
17
  function xe(t) {
18
18
  const { label: n, onToggle: e, panelId: r, reference: u, side: l, sidebarOpen: o } = t;
19
19
  return /* @__PURE__ */ p(
@@ -27,6 +27,8 @@ function xe(t) {
27
27
  className: "nk-sidebar__fallback-trigger",
28
28
  "data-side": l,
29
29
  icon: "burger",
30
+ variant: "secondary",
31
+ size: "large",
30
32
  onClick: e
31
33
  }
32
34
  );
@@ -137,7 +139,7 @@ const be = R(
137
139
  }
138
140
  ) : null;
139
141
  }
140
- ), Ge = R(
142
+ ), ze = R(
141
143
  function(n, e) {
142
144
  const {
143
145
  active: r = !1,
@@ -173,6 +175,7 @@ const be = R(
173
175
  icon: v,
174
176
  onClick: g,
175
177
  shape: "rectangle",
178
+ size: "small",
176
179
  textAlignment: "left",
177
180
  type: d ? i ?? "button" : i,
178
181
  variant: "ghost",
@@ -180,17 +183,17 @@ const be = R(
180
183
  }
181
184
  ) }) : null;
182
185
  }
183
- ), qe = 1;
184
- function $e(t) {
186
+ ), Ge = 1;
187
+ function qe(t) {
185
188
  return t == null ? void 0 : t.ResizeObserver;
186
189
  }
187
- function ze(t) {
190
+ function $e(t) {
188
191
  return t == null ? void 0 : t.MutationObserver;
189
192
  }
190
193
  function Ve() {
191
194
  const [t, n] = w(!1), e = I(null), r = _((o) => {
192
195
  const a = o.scrollHeight - o.scrollTop - o.clientHeight;
193
- n(a > qe);
196
+ n(a > Ge);
194
197
  }, []), u = _((o) => {
195
198
  var m;
196
199
  if ((m = e.current) == null || m.call(e), e.current = null, !o) return;
@@ -201,7 +204,7 @@ function Ve() {
201
204
  }
202
205
  const f = a.ownerDocument.defaultView;
203
206
  f == null || f.addEventListener("resize", v);
204
- const y = $e(f), i = y ? new y(v) : void 0;
207
+ const y = qe(f), i = y ? new y(v) : void 0;
205
208
  function b() {
206
209
  i == null || i.disconnect(), i == null || i.observe(a);
207
210
  for (const E of a.children)
@@ -213,7 +216,7 @@ function Ve() {
213
216
  (S) => S.type === "childList"
214
217
  ) && b(), v();
215
218
  }
216
- const s = ze(f), d = s ? new s(c) : void 0;
219
+ const s = $e(f), d = s ? new s(c) : void 0;
217
220
  d == null || d.observe(a, {
218
221
  attributeFilter: ["class", "hidden", "style"],
219
222
  characterData: !0,
@@ -231,11 +234,11 @@ function Ke(t, n) {
231
234
  for (const e of Se.toArray(t)) {
232
235
  if (re(e) && e.type === de) {
233
236
  const r = pe(e.props.children);
234
- r.bodyChildren.length > 0 && n.bodyChildren.push(z(
237
+ r.bodyChildren.length > 0 && n.bodyChildren.push($(
235
238
  e,
236
239
  void 0,
237
240
  ...r.bodyChildren
238
- )), r.footerChildren.length > 0 && n.footerChildren.push(z(
241
+ )), r.footerChildren.length > 0 && n.footerChildren.push($(
239
242
  e,
240
243
  void 0,
241
244
  ...r.footerChildren
@@ -387,7 +390,7 @@ function Je(t) {
387
390
  }, [e]);
388
391
  if (!e) return null;
389
392
  const { id: y, open: i, presentation: b, variant: c } = e;
390
- return z(
393
+ return $(
391
394
  n,
392
395
  Le(r, {
393
396
  "aria-controls": i && b === "overlay" ? Ie(r["aria-controls"], y) : r["aria-controls"],
@@ -411,7 +414,7 @@ const Qe = R(
411
414
  name: v,
412
415
  onClick: f,
413
416
  ...y
414
- } = n, i = l != null && typeof l != "boolean", b = /* @__PURE__ */ D($, { children: [
417
+ } = n, i = l != null && typeof l != "boolean", b = /* @__PURE__ */ D(q, { children: [
415
418
  /* @__PURE__ */ p(
416
419
  Re,
417
420
  {
@@ -441,7 +444,7 @@ const Qe = R(
441
444
  ...y,
442
445
  ref: e,
443
446
  className: ["nk-sidebar__user", u].filter(Boolean).join(" "),
444
- children: a ? /* @__PURE__ */ p(Be, { className: "nk-sidebar__user-spinner", size: 16 }) : /* @__PURE__ */ D($, { children: [
447
+ children: a ? /* @__PURE__ */ p(Be, { className: "nk-sidebar__user-spinner", size: 16 }) : /* @__PURE__ */ D(q, { children: [
445
448
  f ? /* @__PURE__ */ p(
446
449
  "button",
447
450
  {
@@ -484,7 +487,7 @@ function Ze(t, n) {
484
487
  (e == null ? void 0 : e.read) ?? ie,
485
488
  ie
486
489
  );
487
- return t !== "responsive" ? t : r === void 0 ? "pending" : r >= Fe("md") ? "inline" : "overlay";
490
+ return t !== "responsive" ? t : r === void 0 ? "pending" : r >= Fe("medium") ? "inline" : "overlay";
488
491
  }
489
492
  const We = 32, en = R(function(n, e) {
490
493
  var ne;
@@ -524,7 +527,7 @@ const We = 32, en = R(function(n, e) {
524
527
  C > 0 && N.splice(C, 1);
525
528
  }
526
529
  J.current = h, h && N.push({ current: h });
527
- }, [N]), G = te(() => ({
530
+ }, [N]), z = te(() => ({
528
531
  id: d,
529
532
  open: T,
530
533
  presentation: g,
@@ -544,11 +547,11 @@ const We = 32, en = R(function(n, e) {
544
547
  M(() => {
545
548
  const h = s == null ? void 0 : s.boundaryElement;
546
549
  if (!h) return;
547
- if (De(h, m, G) === !1)
550
+ if (De(h, m, z) === !1)
548
551
  throw new Error(
549
552
  "A Boundary supports one Sidebar. Neatkit resolves Trigger, Group, and Item interactions against the single Sidebar published to the nearest Boundary, so give each Sidebar a Boundary of its own."
550
553
  );
551
- }, [s == null ? void 0 : s.boundaryElement, m, G]), M(() => {
554
+ }, [s == null ? void 0 : s.boundaryElement, m, z]), M(() => {
552
555
  const h = s == null ? void 0 : s.boundaryElement;
553
556
  if (h)
554
557
  return () => we(h, m);
@@ -564,7 +567,7 @@ const We = 32, en = R(function(n, e) {
564
567
  );
565
568
  return () => h.clearTimeout(k);
566
569
  }, [s == null ? void 0 : s.boundaryElement]);
567
- const q = Ne(T && g === "overlay"), W = ((ne = s == null ? void 0 : s.boundaryElement) == null ? void 0 : ne.ownerDocument) ?? (typeof document > "u" ? null : document);
570
+ const G = Ne(T && g === "overlay"), W = ((ne = s == null ? void 0 : s.boundaryElement) == null ? void 0 : ne.ownerDocument) ?? (typeof document > "u" ? null : document);
568
571
  if (g !== "overlay")
569
572
  return /* @__PURE__ */ p(
570
573
  me,
@@ -584,13 +587,13 @@ const We = 32, en = R(function(n, e) {
584
587
  {
585
588
  label: `Open ${c["aria-label"] ?? "Sidebar"}`,
586
589
  onToggle: () => x(!T, "trigger"),
587
- panelId: q.present ? d : void 0,
590
+ panelId: G.present ? d : void 0,
588
591
  reference: ge,
589
592
  side: y,
590
593
  sidebarOpen: T
591
594
  }
592
595
  ) }) : null;
593
- return !q.present || !W ? ee : /* @__PURE__ */ D($, { children: [
596
+ return !G.present || !W ? ee : /* @__PURE__ */ D(q, { children: [
594
597
  ee,
595
598
  /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ p(
596
599
  Ye,
@@ -601,10 +604,10 @@ const We = 32, en = R(function(n, e) {
601
604
  lockScroll: o,
602
605
  ownerDocument: W,
603
606
  panelReference: Q,
604
- presenceState: q.state === "closing" ? "closing" : "open",
607
+ presenceState: G.state === "closing" ? "closing" : "open",
605
608
  restoreFocus: f,
606
609
  side: y,
607
- sidebar: G,
610
+ sidebar: z,
608
611
  width: b
609
612
  }
610
613
  ) })
@@ -613,7 +616,7 @@ const We = 32, en = R(function(n, e) {
613
616
  Footer: be,
614
617
  Group: He,
615
618
  Header: Ue,
616
- Item: Ge,
619
+ Item: ze,
617
620
  Trigger: Je,
618
621
  User: Qe
619
622
  });
@@ -1 +1 @@
1
- "use client";"use strict";const a=require("react/jsx-runtime"),o=require("react"),A=require("./reference-C2guRuR0.cjs"),I=require("./Surface-BttJYSDt.cjs"),H=require("./Button-6oWs-pyF.cjs"),D=require("./Tooltip-DDPh_YFO.cjs"),v=o.createContext("body"),w=o.forwardRef(function(r,e){const{align:t="left",children:s,className:i,scope:c="col",sticky:b=!1,...d}=r;return a.jsx("th",{...d,ref:e,className:["nk-table__header-cell",i].filter(Boolean).join(" "),"data-align":t,"data-sticky":b||void 0,scope:c,children:s})});function S(n){for(const r of o.Children.toArray(n)){if(o.isValidElement(r)&&r.type===o.Fragment){if(S(r.props.children))return!0;continue}return!0}return!1}const K=o.forwardRef(function(r,e){const{children:t,className:s,emptyColumnCount:i=1,emptyMessage:c,...b}=r,d=!S(t),h=Number.isFinite(i)?Math.max(1,Math.floor(i)):1;return a.jsx("tbody",{...b,ref:e,className:["nk-table__body",s].filter(Boolean).join(" "),children:d&&c!==void 0?a.jsx("tr",{className:"nk-table__row",children:a.jsx("td",{className:"nk-table__cell nk-table__empty-cell",colSpan:h,children:a.jsx("div",{className:"nk-table__empty-content",children:c})})}):a.jsx(v.Provider,{value:"body",children:t})})});function O(n,r,e){return n===void 0?r:e?e(n):n instanceof Date?Number.isNaN(n.getTime())?"Invalid Date":n.toISOString().slice(0,10):typeof n=="boolean"?n?"Yes":"No":n}function F(n){if(typeof n=="number"||typeof n=="string")return String(n)}const P=o.forwardRef(function(r,e){const{align:t="left",children:s,className:i,format:c,title:b,truncate:d,value:h,...p}=r,{rowTrigger:l,...u}=p,k=O(h,s,c),f=d===void 0?void 0:{maxWidth:d},g=b??(d===void 0?void 0:F(k));return a.jsxs("td",{...u,ref:e,className:["nk-table__cell",i].filter(Boolean).join(" "),"data-align":t,title:g,children:[(l==null?void 0:l.kind)==="link"&&l.linkProperties?a.jsx("a",{ref:l.reference,"aria-label":l.ariaLabel,className:"nk-table__row-trigger",download:l.linkProperties.download,href:l.linkProperties.href,hrefLang:l.linkProperties.hrefLang,onClick:l.linkProperties.onNavigate,rel:l.linkProperties.rel,target:l.linkProperties.target}):null,(l==null?void 0:l.kind)==="button"?a.jsx("button",{ref:l.reference,"aria-label":l.ariaLabel,className:"nk-table__row-trigger",onClick:l.onClick,type:"button"}):null,d!==void 0?a.jsx("span",{className:"nk-table__truncated-content",style:f,children:k}):k]})}),q=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx("tfoot",{...i,ref:e,className:["nk-table__foot",s].filter(Boolean).join(" "),children:a.jsx(v.Provider,{value:"foot",children:t})})}),z=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx("thead",{...i,ref:e,className:["nk-table__head",s].filter(Boolean).join(" "),children:a.jsx(v.Provider,{value:"head",children:t})})}),V=["a[href]","audio[controls]","button","iframe","input","label","select","summary","textarea","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(","),M=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 Y(n,r){var t;let e=n;for(;e&&e!==r;){if(e.matches(V)||(((t=e.getAttribute("role"))==null?void 0:t.split(/\s+/))??[]).some(i=>M.has(i)))return!0;e=e.parentElement}return!1}function X(n,r){let e=!1;function t(i){return o.Children.map(i,c=>o.isValidElement(c)?c.type===o.Fragment?o.cloneElement(c,void 0,t(c.props.children)):!e&&c.type===P?(e=!0,o.cloneElement(c,{rowTrigger:r})):c:c)}const s=t(n);return{attached:e,content:s}}function $(n){const{"aria-label":r,icon:e,label:t,...s}=n;return a.jsx(D.Tooltip2,{content:t,children:a.jsx(H.Button,{...s,"aria-label":r??t,className:"nk-table__action",icon:e,shape:"rectangle",type:"button",variant:"ghost"})})}function G(n){const{actions:r}=n;function e(t){t.stopPropagation()}return a.jsx("td",{className:"nk-table__cell nk-table__action-cell","data-align":"right",onClick:e,children:r.length>0?a.jsx("span",{className:"nk-table__action-list",children:r.map(t=>o.createElement($,{...t,key:t.label}))}):null})}const J=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx(w,{...i,ref:e,align:"right",className:["nk-table__action-header-cell",s].filter(Boolean).join(" "),children:t??a.jsx("span",{className:"nk-table__visually-hidden",children:"Row actions"})})}),Q=o.forwardRef(function(r,e){const{"aria-label":t,actions:s,children:i,className:c,download:b,href:d,hrefLang:h,onClick:p,onNavigate:l,rel:u,target:k,...f}=r,g=o.useRef(null),C=o.useContext(v),T=d!==void 0||p!==void 0,N=(t==null?void 0:t.trim())||(d!==void 0?"Open row":"Activate row");function j(m){g.current=m}let _;d!==void 0?_={ariaLabel:N,kind:"link",linkProperties:{download:b,href:d,hrefLang:h,onNavigate:l,rel:u,target:k},reference:j}:p!==void 0&&(_={ariaLabel:N,kind:"button",onClick:p,reference:j});const E=_?X(i,_):{content:i};function B(m){if(m.defaultPrevented)return;const y=m.target;if(!(y instanceof Element)||Y(y,m.currentTarget))return;const x=g.current;if(!x)return;const R=x.ownerDocument.defaultView;if(!R){x.click();return}x.dispatchEvent(new R.MouseEvent("click",{altKey:m.altKey,bubbles:!0,button:m.button,buttons:m.buttons,cancelable:!0,clientX:m.clientX,clientY:m.clientY,ctrlKey:m.ctrlKey,metaKey:m.metaKey,shiftKey:m.shiftKey}))}const L=C==="head"?a.jsx(J,{}):a.jsx(G,{actions:s??[]});return a.jsxs("tr",{...f,ref:e,"aria-label":T?void 0:t,className:["nk-table__row",c].filter(Boolean).join(" "),"data-interactive":T||void 0,onClick:T?B:void 0,children:[E.content,L]})});function U(){const n=o.useRef(null),r=o.useRef(null),[e,t]=o.useState(!1),[s,i]=o.useState(!1);o.useEffect(()=>{const b=n.current,d=r.current;if(!b||!d)return;const h=b,p=d;function l(){const g=h.scrollWidth>h.clientWidth;t(g),g||i(!1)}l();const u=h.ownerDocument.defaultView;u==null||u.addEventListener("resize",l);const k=u==null?void 0:u.ResizeObserver,f=k?new k(l):void 0;return f==null||f.observe(h),f==null||f.observe(p),()=>{u==null||u.removeEventListener("resize",l),f==null||f.disconnect()}},[]);function c(b){i(e&&b.currentTarget.scrollLeft>1)}return{containerReference:n,contentReference:r,isScrollable:e,isScrolled:s,handleScroll:c}}const W=o.forwardRef(function(r,e){const{"aria-label":t,children:s,className:i,containerClassName:c,frame:b="outline",...d}=r,{containerReference:h,contentReference:p,isScrollable:l,isScrolled:u,handleScroll:k}=U(),f=t?`${t} scroll area`:"Scrollable table",g=o.useCallback(C=>{p.current=C,A.assignElementReference(e,C)},[p,e]);return a.jsx(I.Surface,{ref:h,"aria-label":l?f:void 0,className:["nk-table",c].filter(Boolean).join(" "),"data-frame":b,"data-scrolled":u||void 0,onScroll:k,role:l?"region":void 0,tabIndex:l?0:void 0,children:a.jsx("table",{...d,ref:g,"aria-label":t,className:["nk-table__element",i].filter(Boolean).join(" "),children:s})})}),Z=Object.assign(W,{Body:K,Cell:P,Foot:q,HeaderCell:w,Head:z,Row:Q});exports.Table=Z;
1
+ "use client";"use strict";const a=require("react/jsx-runtime"),o=require("react"),A=require("./reference-C2guRuR0.cjs"),I=require("./Surface-BttJYSDt.cjs"),H=require("./Button-CTzvBhGH.cjs"),D=require("./Tooltip-DDPh_YFO.cjs"),v=o.createContext("body"),w=o.forwardRef(function(r,e){const{align:t="left",children:s,className:i,scope:c="col",sticky:b=!1,...d}=r;return a.jsx("th",{...d,ref:e,className:["nk-table__header-cell",i].filter(Boolean).join(" "),"data-align":t,"data-sticky":b||void 0,scope:c,children:s})});function S(n){for(const r of o.Children.toArray(n)){if(o.isValidElement(r)&&r.type===o.Fragment){if(S(r.props.children))return!0;continue}return!0}return!1}const K=o.forwardRef(function(r,e){const{children:t,className:s,emptyColumnCount:i=1,emptyMessage:c,...b}=r,d=!S(t),h=Number.isFinite(i)?Math.max(1,Math.floor(i)):1;return a.jsx("tbody",{...b,ref:e,className:["nk-table__body",s].filter(Boolean).join(" "),children:d&&c!==void 0?a.jsx("tr",{className:"nk-table__row",children:a.jsx("td",{className:"nk-table__cell nk-table__empty-cell",colSpan:h,children:a.jsx("div",{className:"nk-table__empty-content",children:c})})}):a.jsx(v.Provider,{value:"body",children:t})})});function O(n,r,e){return n===void 0?r:e?e(n):n instanceof Date?Number.isNaN(n.getTime())?"Invalid Date":n.toISOString().slice(0,10):typeof n=="boolean"?n?"Yes":"No":n}function F(n){if(typeof n=="number"||typeof n=="string")return String(n)}const P=o.forwardRef(function(r,e){const{align:t="left",children:s,className:i,format:c,title:b,truncate:d,value:h,...p}=r,{rowTrigger:l,...u}=p,k=O(h,s,c),f=d===void 0?void 0:{maxWidth:d},g=b??(d===void 0?void 0:F(k));return a.jsxs("td",{...u,ref:e,className:["nk-table__cell",i].filter(Boolean).join(" "),"data-align":t,title:g,children:[(l==null?void 0:l.kind)==="link"&&l.linkProperties?a.jsx("a",{ref:l.reference,"aria-label":l.ariaLabel,className:"nk-table__row-trigger",download:l.linkProperties.download,href:l.linkProperties.href,hrefLang:l.linkProperties.hrefLang,onClick:l.linkProperties.onNavigate,rel:l.linkProperties.rel,target:l.linkProperties.target}):null,(l==null?void 0:l.kind)==="button"?a.jsx("button",{ref:l.reference,"aria-label":l.ariaLabel,className:"nk-table__row-trigger",onClick:l.onClick,type:"button"}):null,d!==void 0?a.jsx("span",{className:"nk-table__truncated-content",style:f,children:k}):k]})}),q=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx("tfoot",{...i,ref:e,className:["nk-table__foot",s].filter(Boolean).join(" "),children:a.jsx(v.Provider,{value:"foot",children:t})})}),z=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx("thead",{...i,ref:e,className:["nk-table__head",s].filter(Boolean).join(" "),children:a.jsx(v.Provider,{value:"head",children:t})})}),V=["a[href]","audio[controls]","button","iframe","input","label","select","summary","textarea","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(","),M=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 Y(n,r){var t;let e=n;for(;e&&e!==r;){if(e.matches(V)||(((t=e.getAttribute("role"))==null?void 0:t.split(/\s+/))??[]).some(i=>M.has(i)))return!0;e=e.parentElement}return!1}function X(n,r){let e=!1;function t(i){return o.Children.map(i,c=>o.isValidElement(c)?c.type===o.Fragment?o.cloneElement(c,void 0,t(c.props.children)):!e&&c.type===P?(e=!0,o.cloneElement(c,{rowTrigger:r})):c:c)}const s=t(n);return{attached:e,content:s}}function $(n){const{"aria-label":r,icon:e,label:t,...s}=n;return a.jsx(D.Tooltip2,{content:t,children:a.jsx(H.Button,{...s,"aria-label":r??t,icon:e,shape:"rectangle",size:"small",type:"button",variant:"ghost"})})}function G(n){const{actions:r}=n;function e(t){t.stopPropagation()}return a.jsx("td",{className:"nk-table__cell nk-table__action-cell","data-align":"right",onClick:e,children:r.length>0?a.jsx("span",{className:"nk-table__action-list",children:r.map(t=>o.createElement($,{...t,key:t.label}))}):null})}const J=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx(w,{...i,ref:e,align:"right",className:["nk-table__action-header-cell",s].filter(Boolean).join(" "),children:t??a.jsx("span",{className:"nk-table__visually-hidden",children:"Row actions"})})}),Q=o.forwardRef(function(r,e){const{"aria-label":t,actions:s,children:i,className:c,download:b,href:d,hrefLang:h,onClick:p,onNavigate:l,rel:u,target:k,...f}=r,g=o.useRef(null),C=o.useContext(v),T=d!==void 0||p!==void 0,j=(t==null?void 0:t.trim())||(d!==void 0?"Open row":"Activate row");function y(m){g.current=m}let x;d!==void 0?x={ariaLabel:j,kind:"link",linkProperties:{download:b,href:d,hrefLang:h,onNavigate:l,rel:u,target:k},reference:y}:p!==void 0&&(x={ariaLabel:j,kind:"button",onClick:p,reference:y});const E=x?X(i,x):{content:i};function B(m){if(m.defaultPrevented)return;const N=m.target;if(!(N instanceof Element)||Y(N,m.currentTarget))return;const _=g.current;if(!_)return;const R=_.ownerDocument.defaultView;if(!R){_.click();return}_.dispatchEvent(new R.MouseEvent("click",{altKey:m.altKey,bubbles:!0,button:m.button,buttons:m.buttons,cancelable:!0,clientX:m.clientX,clientY:m.clientY,ctrlKey:m.ctrlKey,metaKey:m.metaKey,shiftKey:m.shiftKey}))}const L=C==="head"?a.jsx(J,{}):a.jsx(G,{actions:s??[]});return a.jsxs("tr",{...f,ref:e,"aria-label":T?void 0:t,className:["nk-table__row",c].filter(Boolean).join(" "),"data-interactive":T||void 0,onClick:T?B:void 0,children:[E.content,L]})});function U(){const n=o.useRef(null),r=o.useRef(null),[e,t]=o.useState(!1),[s,i]=o.useState(!1);o.useEffect(()=>{const b=n.current,d=r.current;if(!b||!d)return;const h=b,p=d;function l(){const g=h.scrollWidth>h.clientWidth;t(g),g||i(!1)}l();const u=h.ownerDocument.defaultView;u==null||u.addEventListener("resize",l);const k=u==null?void 0:u.ResizeObserver,f=k?new k(l):void 0;return f==null||f.observe(h),f==null||f.observe(p),()=>{u==null||u.removeEventListener("resize",l),f==null||f.disconnect()}},[]);function c(b){i(e&&b.currentTarget.scrollLeft>1)}return{containerReference:n,contentReference:r,isScrollable:e,isScrolled:s,handleScroll:c}}const W=o.forwardRef(function(r,e){const{"aria-label":t,children:s,className:i,containerClassName:c,frame:b="outline",...d}=r,{containerReference:h,contentReference:p,isScrollable:l,isScrolled:u,handleScroll:k}=U(),f=t?`${t} scroll area`:"Scrollable table",g=o.useCallback(C=>{p.current=C,A.assignElementReference(e,C)},[p,e]);return a.jsx(I.Surface,{ref:h,"aria-label":l?f:void 0,className:["nk-table",c].filter(Boolean).join(" "),"data-frame":b,"data-scrolled":u||void 0,onScroll:k,role:l?"region":void 0,tabIndex:l?0:void 0,children:a.jsx("table",{...d,ref:g,"aria-label":t,className:["nk-table__element",i].filter(Boolean).join(" "),children:s})})}),Z=Object.assign(W,{Body:K,Cell:P,Foot:q,HeaderCell:w,Head:z,Row:Q});exports.Table=Z;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as a, jsxs as B } from "react/jsx-runtime";
3
- import { createContext as z, forwardRef as g, Children as L, isValidElement as j, Fragment as A, cloneElement as x, createElement as M, useRef as y, useContext as V, useState as E, useEffect as Y, useCallback as X } from "react";
3
+ import { createContext as F, forwardRef as g, Children as L, isValidElement as j, Fragment as A, cloneElement as x, createElement as M, useRef as N, useContext as V, useState as E, useEffect as Y, useCallback as X } from "react";
4
4
  import { a as $ } from "./reference-CXMr27nM.js";
5
5
  import { S as q } from "./Surface-vEFsZC12.js";
6
- import { B as G } from "./Button-B0E-M8mp.js";
6
+ import { B as G } from "./Button-CyUpMPtt.js";
7
7
  import { T as J } from "./Tooltip-CpyROf6x.js";
8
- const T = z("body"), I = g(function(l, e) {
8
+ const T = F("body"), I = g(function(l, e) {
9
9
  const {
10
10
  align: t = "left",
11
11
  children: i,
@@ -225,9 +225,9 @@ function re(n) {
225
225
  {
226
226
  ...i,
227
227
  "aria-label": l ?? t,
228
- className: "nk-table__action",
229
228
  icon: e,
230
229
  shape: "rectangle",
230
+ size: "small",
231
231
  type: "button",
232
232
  variant: "ghost"
233
233
  }
@@ -275,7 +275,7 @@ const ie = g(function(l, e) {
275
275
  rel: d,
276
276
  target: p,
277
277
  ...u
278
- } = l, k = y(null), C = V(T), N = s !== void 0 || h !== void 0, R = (t == null ? void 0 : t.trim()) || (s !== void 0 ? "Open row" : "Activate row");
278
+ } = l, k = N(null), C = V(T), y = s !== void 0 || h !== void 0, R = (t == null ? void 0 : t.trim()) || (s !== void 0 ? "Open row" : "Activate row");
279
279
  function S(b) {
280
280
  k.current = b;
281
281
  }
@@ -323,26 +323,26 @@ const ie = g(function(l, e) {
323
323
  shiftKey: b.shiftKey
324
324
  }));
325
325
  }
326
- const F = C === "head" ? /* @__PURE__ */ a(ie, {}) : /* @__PURE__ */ a(ae, { actions: i ?? [] });
326
+ const z = C === "head" ? /* @__PURE__ */ a(ie, {}) : /* @__PURE__ */ a(ae, { actions: i ?? [] });
327
327
  return /* @__PURE__ */ B(
328
328
  "tr",
329
329
  {
330
330
  ...u,
331
331
  ref: e,
332
- "aria-label": N ? void 0 : t,
332
+ "aria-label": y ? void 0 : t,
333
333
  className: ["nk-table__row", c].filter(Boolean).join(" "),
334
- "data-interactive": N || void 0,
335
- onClick: N ? O : void 0,
334
+ "data-interactive": y || void 0,
335
+ onClick: y ? O : void 0,
336
336
  children: [
337
337
  K.content,
338
- F
338
+ z
339
339
  ]
340
340
  }
341
341
  );
342
342
  }
343
343
  );
344
344
  function se() {
345
- const n = y(null), l = y(null), [e, t] = E(!1), [i, r] = E(!1);
345
+ const n = N(null), l = N(null), [e, t] = E(!1), [i, r] = E(!1);
346
346
  Y(() => {
347
347
  const f = n.current, s = l.current;
348
348
  if (!f || !s) return;
package/dist/Table.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Table-Z8Q6XRkc.cjs");exports.default=e.Table;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Table-BbH9oy3Z.cjs");exports.default=e.Table;
package/dist/Table.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { T as a } from "./Table-B2G8CHJ9.js";
2
+ import { T as a } from "./Table-rTy_IuSv.js";
3
3
  export {
4
4
  a as default
5
5
  };
@@ -4,6 +4,8 @@ import "./styles/badge.css";
4
4
  export type BadgeVariant = "outline" | "soft" | "solid";
5
5
  /** A type representing the semantic color treatment applied to a Badge. */
6
6
  export type BadgeTone = "neutral" | "info" | "success" | "warning" | "danger";
7
+ /** A type representing the visual size applied to a Badge. */
8
+ export type BadgeSize = "small" | "medium" | "large";
7
9
  /** A type representing properties owned by the Badge component. */
8
10
  type BadgeOwnProps = {
9
11
  /** The label content displayed within the Badge. */
@@ -12,6 +14,8 @@ type BadgeOwnProps = {
12
14
  variant?: BadgeVariant;
13
15
  /** The semantic color treatment applied to the Badge. */
14
16
  tone?: BadgeTone;
17
+ /** The visual size applied to the Badge. Defaults to medium. */
18
+ size?: BadgeSize;
15
19
  };
16
20
  /** A type representing the reference accepted by a polymorphic element. */
17
21
  type BadgeReference<Component extends ElementType> = ComponentPropsWithRef<Component>["ref"];
@@ -1,2 +1,2 @@
1
1
  export { default } from "./Badge";
2
- export type { BadgeProps, BadgeTone, BadgeVariant } from "./Badge";
2
+ export type { BadgeProps, BadgeSize, BadgeTone, BadgeVariant } from "./Badge";
@@ -7,6 +7,8 @@ export type ButtonVariant = "primary" | "secondary" | "ghost";
7
7
  export type ButtonTone = "info" | "success" | "warning" | "danger";
8
8
  /** A type representing the outline shape of a Button. */
9
9
  export type ButtonShape = "rectangle" | "capsule";
10
+ /** A type representing the visual size applied to a Button. */
11
+ export type ButtonSize = "small" | "medium" | "large";
10
12
  /** A type representing the placement of a Button icon. */
11
13
  export type ButtonIconAlignment = "left" | "right";
12
14
  /** A type representing the horizontal alignment of Button contents. */
@@ -21,6 +23,8 @@ type ButtonOwnProps = {
21
23
  tone?: ButtonTone;
22
24
  /** The outline shape applied to the Button. Defaults to capsule. */
23
25
  shape?: ButtonShape;
26
+ /** The visual size applied to the Button. Defaults to medium. */
27
+ size?: ButtonSize;
24
28
  /** Whether the Button fills its containing block. */
25
29
  fullWidth?: boolean;
26
30
  /** Whether the Button displays a loading indicator and blocks interaction. */
@@ -1,2 +1,2 @@
1
1
  export { default } from "./Button";
2
- export type { ButtonIconAlignment, ButtonProps, ButtonShape, ButtonTextAlignment, ButtonTone, ButtonVariant, } from "./Button";
2
+ export type { ButtonIconAlignment, ButtonProps, ButtonShape, ButtonSize, ButtonTextAlignment, ButtonTone, ButtonVariant, } from "./Button";
@@ -1,7 +1,7 @@
1
1
  import { type ButtonProps } from "../../Button";
2
2
  import type { IconType } from "../../Icon";
3
3
  /** A type representing one consistently styled Table row action. */
4
- export type TableRowAction = Omit<ButtonProps<"button">, "as" | "children" | "className" | "fullWidth" | "icon" | "iconAlignment" | "shape" | "style" | "textAlignment" | "type" | "variant"> & {
4
+ export type TableRowAction = Omit<ButtonProps<"button">, "as" | "children" | "className" | "fullWidth" | "icon" | "iconAlignment" | "shape" | "size" | "style" | "textAlignment" | "type" | "variant"> & {
5
5
  /** The icon identifying the row action. */
6
6
  icon: IconType;
7
7
  /** The short Tooltip label and base accessible name for the row action. */
@@ -3,7 +3,7 @@ import "./styles/text.css";
3
3
  /** A type representing the visual size applied to Text. */
4
4
  export type TextSize = "caption" | "body" | "subtitle" | "title" | "heading";
5
5
  /** A type representing the visual weight applied to Text. */
6
- export type TextWeight = "regular" | "medium" | "semibold";
6
+ export type TextWeight = "regular" | "medium" | "semibold" | "bold";
7
7
  /** A type representing the semantic color treatment applied to Text. */
8
8
  export type TextTone = "default" | "muted" | "accent" | "info" | "success" | "warning" | "danger";
9
9
  /** A type representing the horizontal alignment applied to Text. */
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./units-PzuiQNnw.cjs");exports.breakpoint=e.breakpoint;exports.cell=e.cell;exports.px=e.px;exports.space=e.space;exports.tokens=e.tokens;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./units-CpnLv2H4.cjs");exports.breakpoint=e.breakpoint;exports.cell=e.cell;exports.px=e.px;exports.space=e.space;exports.tokens=e.tokens;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as e, c as p, p as o, s as t, t as c } from "./units-BmjPCccF.js";
1
+ import { b as e, c as p, p as o, s as t, t as c } from "./units-Bx_CBIy8.js";
2
2
  export {
3
3
  e as breakpoint,
4
4
  p as cell,