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
package/dist/Input.js CHANGED
@@ -1,95 +1,96 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as c } from "react/jsx-runtime";
2
+ import { jsxs as _, jsx as d } from "react/jsx-runtime";
3
3
  import { forwardRef as F, useId as G, useRef as J, useState as V, useEffect as K, useCallback as L } from "react";
4
- import { B as C } from "./Button-Chv4O66e.js";
5
- import { S as M } from "./Spinner-CVYvk6YK.js";
4
+ import { B as C } from "./Button-D6rXvcqq.js";
5
+ import { S as M } from "./Spinner-CmxlDlOk.js";
6
6
  import { h as Q, r as W } from "./aria-CeA9QfD1.js";
7
+ import { a as X } from "./reference-CXMr27nM.js";
7
8
  function f(a) {
8
9
  return Array.isArray(a) ? a.length > 0 : a != null && String(a).length > 0;
9
10
  }
10
- function X(a, i, t) {
11
- i.current = a, typeof t == "function" ? t(a) : t && (t.current = a);
11
+ function Y(a, t, n) {
12
+ t.current = a, X(n, a);
12
13
  }
13
- function Y(a) {
14
- var t;
15
- const i = (t = Object.getOwnPropertyDescriptor(
14
+ function Z(a) {
15
+ var n;
16
+ const t = (n = Object.getOwnPropertyDescriptor(
16
17
  Object.getPrototypeOf(a),
17
18
  "value"
18
- )) == null ? void 0 : t.set;
19
- i ? i.call(a, "") : a.value = "";
19
+ )) == null ? void 0 : n.set;
20
+ t ? t.call(a, "") : a.value = "";
20
21
  }
21
- const sa = F(function(i, t) {
22
+ const la = F(function(t, n) {
22
23
  const {
23
24
  "aria-busy": A,
24
25
  "aria-invalid": v,
25
26
  className: N,
26
27
  clearable: b = !1,
27
- defaultValue: y,
28
+ defaultValue: h,
28
29
  disabled: S = !1,
29
30
  id: x,
30
- invalid: h = !1,
31
+ invalid: y = !1,
31
32
  loading: s = !1,
32
- onChange: d,
33
+ onChange: c,
33
34
  readOnly: u = !1,
34
35
  style: P,
35
- type: e = "text",
36
+ type: i = "text",
36
37
  value: l,
37
38
  ...j
38
- } = i, O = G(), g = J(null), [B, T] = V(
39
- f(y)
40
- ), [o, m] = V(!1);
39
+ } = t, O = G(), g = J(null), [R, B] = V(
40
+ f(h)
41
+ ), [r, m] = V(!1);
41
42
  K(() => {
42
- e !== "password" && m(!1);
43
- }, [e]);
44
- const D = L(
45
- (n) => X(
46
- n,
43
+ i !== "password" && m(!1);
44
+ }, [i]);
45
+ const E = L(
46
+ (e) => Y(
47
+ e,
47
48
  g,
48
- t
49
+ n
49
50
  ),
50
- [t]
51
- ), p = x ?? `${O}-control`, r = S || s, E = h || Q(v), H = l !== void 0 ? f(l) : B, U = e === "password" && o ? "text" : e, z = W(h, v), I = b && H && !u && !r, k = e === "password" && !s, _ = I || k;
52
- function R(n) {
53
- l === void 0 && T(f(n.currentTarget.value)), d == null || d(n);
51
+ [n]
52
+ ), p = x ?? `${O}-control`, o = S || s, T = y || Q(v), D = l !== void 0 ? f(l) : R, H = i === "password" && r ? "text" : i, U = W(y, v), I = b && D && !u && !o, w = i === "password" && !s, k = I || w;
53
+ function z(e) {
54
+ l === void 0 && B(f(e.currentTarget.value)), c == null || c(e);
54
55
  }
55
56
  function $() {
56
- const n = g.current;
57
- n && (Y(n), n.dispatchEvent(new Event("input", { bubbles: !0 })), n.focus());
57
+ const e = g.current;
58
+ e && (Z(e), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
58
59
  }
59
60
  function q() {
60
- m((n) => !n);
61
+ m((e) => !e);
61
62
  }
62
- return /* @__PURE__ */ w(
63
+ return /* @__PURE__ */ _(
63
64
  "div",
64
65
  {
65
66
  className: ["nk-input", N].filter(Boolean).join(" "),
66
67
  "data-clearable": b || void 0,
67
- "data-disabled": r || void 0,
68
- "data-invalid": E || void 0,
68
+ "data-disabled": o || void 0,
69
+ "data-invalid": T || void 0,
69
70
  "data-loading": s || void 0,
70
71
  "data-read-only": u || void 0,
71
- "data-has-trailing-action": _ || void 0,
72
+ "data-has-trailing-action": k || void 0,
72
73
  style: P,
73
74
  children: [
74
- /* @__PURE__ */ c(
75
+ /* @__PURE__ */ d(
75
76
  "input",
76
77
  {
77
78
  ...j,
78
- ref: D,
79
+ ref: E,
79
80
  "aria-busy": s ? !0 : A,
80
- "aria-invalid": z,
81
+ "aria-invalid": U,
81
82
  className: "nk-input__control",
82
- defaultValue: y,
83
- disabled: r,
83
+ defaultValue: h,
84
+ disabled: o,
84
85
  id: p,
85
- onChange: R,
86
+ onChange: z,
86
87
  readOnly: u,
87
- type: U,
88
+ type: H,
88
89
  value: l
89
90
  }
90
91
  ),
91
- _ ? /* @__PURE__ */ w("span", { className: "nk-input__trailing", children: [
92
- I ? /* @__PURE__ */ c(
92
+ k ? /* @__PURE__ */ _("span", { className: "nk-input__trailing", children: [
93
+ I ? /* @__PURE__ */ d(
93
94
  C,
94
95
  {
95
96
  "aria-controls": p,
@@ -102,15 +103,15 @@ const sa = F(function(i, t) {
102
103
  variant: "ghost"
103
104
  }
104
105
  ) : null,
105
- k ? /* @__PURE__ */ c(
106
+ w ? /* @__PURE__ */ d(
106
107
  C,
107
108
  {
108
109
  "aria-controls": p,
109
- "aria-label": o ? "Hide password" : "Show password",
110
- "aria-pressed": o,
110
+ "aria-label": r ? "Hide password" : "Show password",
111
+ "aria-pressed": r,
111
112
  className: "nk-input__action",
112
- disabled: r,
113
- icon: o ? "eye-off" : "eye",
113
+ disabled: o,
114
+ icon: r ? "eye-off" : "eye",
114
115
  onClick: q,
115
116
  shape: "rectangle",
116
117
  type: "button",
@@ -118,7 +119,7 @@ const sa = F(function(i, t) {
118
119
  }
119
120
  ) : null
120
121
  ] }) : null,
121
- s ? /* @__PURE__ */ c(
122
+ s ? /* @__PURE__ */ d(
122
123
  M,
123
124
  {
124
125
  "aria-hidden": "true",
@@ -133,5 +134,5 @@ const sa = F(function(i, t) {
133
134
  );
134
135
  });
135
136
  export {
136
- sa as default
137
+ la as default
137
138
  };
package/dist/Markdown.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),M=require("react"),G=require("react-markdown"),W=require("rehype-raw"),H=require("rehype-sanitize"),V=require("rehype-slug"),J=require("remark-gfm"),Y=require("./Alert-LJDkNUqH.cjs"),X=require("./Code-JDb4VFl7.cjs"),Q=require("./Divider-CJYbFcSX.cjs"),_=require("./Table-DceR12X9.cjs"),k=require("./Text-DWYlIcPj.cjs"),Z={bash:"Shell",c:"C","c++":"C++",cpp:"C++",css:"CSS",go:"Go",golang:"Go",html:"HTML",js:"JavaScript",javascript:"JavaScript",jsx:"JavaScript",json:"JSON",markdown:"Markdown",md:"Markdown",py:"Python",python:"Python",rb:"Ruby",ruby:"Ruby",rs:"Rust",rust:"Rust",sh:"Shell",shell:"Shell",sql:"SQL",ts:"TypeScript",tsx:"TypeScript",typescript:"TypeScript",xml:"HTML",yaml:"YAML",yml:"YAML"};function ee(e){var a;const o=(a=e==null?void 0:e.split(/\s+/).find(m=>m.startsWith("language-")))==null?void 0:a.slice(9).toLowerCase();return o?Z[o]:void 0}const A="md-",B=["a","blockquote","br","code","del","em","h1","h2","h3","h4","h5","h6","hr","img","input","li","ol","p","picture","pre","section","source","strong","sup","table","tbody","td","th","thead","tr","ul"],ne={...H.defaultSchema,allowComments:!1,allowDoctypes:!1,ancestors:{...H.defaultSchema.ancestors,source:["picture"]},attributes:{"*":["dir","id","lang","title"],a:["ariaDescribedBy","ariaLabel","dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href","hrefLang"],code:[["className",/^language-[\w+-]+$/]],h2:[["className","sr-only"]],img:["alt","height","src","srcSet","width"],input:["checked",["disabled",!0],"readOnly",["type","checkbox"]],li:[["className","task-list-item"]],ol:["start",["className","contains-task-list"]],section:["dataFootnotes",["className","footnotes"]],source:["media","srcSet","type"],td:["align","colSpan","rowSpan"],th:["align","colSpan","rowSpan","scope"],ul:[["className","contains-task-list"]]},clobber:H.defaultSchema.clobber,clobberPrefix:A,strip:["script","style"],tagNames:[...B]};function re(e,o){const a=o.flags.replace(/[gy]/g,"");return new RegExp(o.source,a).test(e)}function te(e){if(!e)return null;try{const o=new URL(e);return o.protocol!=="http:"&&o.protocol!=="https:"||o.username||o.password?null:o}catch{return null}}function R(e,o,a){if(e.includes("\\")||/[\u0000-\u0020\u007f]/.test(e)||o===void 0)return;const m=/^[a-z][a-z\d+.-]*:/i.test(e),h=e.startsWith("//");if(o==="*")return!m&&!h||/^https?:/i.test(e)||h?e:void 0;const s=Array.isArray(o)?o:[o],t=te(a);try{const n=m?new URL(e):t?new URL(e,t):null;if(!n||n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password)return;const r=n.href;return s.some(d=>re(r,d))?r:void 0}catch{return}}function v(e,o,a){if(!e)return;const h=e.split(",").map(s=>{const t=s.trim().split(/\s+/),[n,r]=t,d=r===void 0||/^(?:\d+w|(?:\d+(?:\.\d+)?|\.\d+)x)$/.test(r);if(t.length>2||!d||n===void 0||n.length===0)return null;const c=R(n,o,a);return c?`${c}${r?` ${r}`:""}`:null});return h.every(s=>s!==null)?h.join(", "):void 0}function oe(){function e(o){o.children=o.children.filter(a=>a.type!=="element"||a.tagName!=="input"||a.position===void 0),o.children.forEach(a=>{a.type==="element"&&e(a)})}return o=>e(o)}function S(e,o){return Array.isArray(e)?e.map(a=>typeof a=="string"?`${o}${a}`:a):typeof e=="string"?e.split(/\s+/).map(a=>`${o}${a}`).join(" "):e}function se(e){const{clobberPrefix:o,prefix:a}=e;function m(h){if(h.type==="element"){const{properties:s}=h;s.id=S(s.id,a),s.name=S(s.name,a),s.ariaDescribedBy=S(s.ariaDescribedBy,a),s.ariaLabelledBy=S(s.ariaLabelledBy,a),typeof s.href=="string"&&s.href.startsWith("#")&&(s.href=`#${o}${a}${s.href.slice(1)}`)}"children"in h&&h.children.forEach(m)}return h=>m(h)}function C(e){return e==="center"||e==="left"||e==="right"?e:void 0}function E(e){return e.type==="text"?e.value:"children"in e?e.children.map(E).join(""):""}function T(e){return typeof e=="string"?e:void 0}function ie(e){if(!e)return null;const o=e.children.find(n=>n.type==="element"&&n.tagName==="code");if(!o||e.children.some(n=>n!==o&&(n.type!=="text"||n.value.trim().length>0)))return null;const m=o.properties.className,h=Array.isArray(m)?m.join(" "):typeof m=="string"?m:void 0,s=o.children.map(E).join("").replace(/\n$/,"");return{codeProps:{className:h,dir:T(o.properties.dir),id:T(o.properties.id),lang:T(o.properties.lang),title:T(o.properties.title)},content:s}}function ae(e,o,a,m,h){return{a:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,...i}=t;return u.jsx("a",{...i,className:["nk-markdown__link",r].filter(Boolean).join(" "),onClick:h,children:n})},blockquote:function(t){const{children:n,dangerouslySetInnerHTML:r,node:d,...c}=t;return u.jsx("blockquote",{...c,className:"nk-markdown__blockquote",children:n})},code:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,...i}=t;return u.jsx("code",{...i,className:["nk-markdown__inline-code",r].filter(Boolean).join(" "),children:n})},h1:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,ref:i,...l}=t;return u.jsx(k.Text,{...l,as:"h1",className:["nk-markdown__heading",r].filter(Boolean).join(" "),size:"heading",weight:"semibold",children:n})},h2:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,ref:i,...l}=t;return u.jsx(k.Text,{...l,as:"h2",className:["nk-markdown__heading",r!=null&&r.split(/\s+/).includes("sr-only")?"nk-markdown__visually-hidden":void 0].filter(Boolean).join(" "),size:"title",weight:"semibold",children:n})},h3:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,ref:i,...l}=t;return u.jsx(k.Text,{...l,as:"h3",className:["nk-markdown__heading",r].filter(Boolean).join(" "),size:"subtitle",weight:"semibold",children:n})},h4:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,ref:i,...l}=t;return u.jsx(k.Text,{...l,as:"h4",className:["nk-markdown__heading",r].filter(Boolean).join(" "),weight:"semibold",children:n})},h5:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,ref:i,...l}=t;return u.jsx(k.Text,{...l,as:"h5",className:["nk-markdown__heading",r].filter(Boolean).join(" "),weight:"semibold",children:n})},h6:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,ref:i,...l}=t;return u.jsx(k.Text,{...l,as:"h6",className:["nk-markdown__heading",r].filter(Boolean).join(" "),weight:"medium",children:n})},hr:function(t){const{dangerouslySetInnerHTML:n,node:r,...d}=t;return u.jsx(Q.Divider,{...d})},img:function(t){const{alt:n,className:r,dangerouslySetInnerHTML:d,node:c,src:i,srcSet:l,...b}=t,x=R(typeof i=="string"?i:"",e,o),L=v(l,e,o);return x?u.jsx("img",{...b,alt:n??"",className:["nk-markdown__image",r].filter(Boolean).join(" "),decoding:"async",loading:"lazy",src:x,srcSet:L}):n?u.jsx("span",{className:"nk-markdown__blocked-image",children:n}):null},input:function(t){const{checked:n,className:r,dangerouslySetInnerHTML:d,node:c,...i}=t;return u.jsxs(u.Fragment,{children:[u.jsx("input",{...i,"aria-label":n?"Completed task":"Incomplete task",checked:n,className:["nk-markdown__task-control","nk-markdown__visually-hidden",r].filter(Boolean).join(" "),disabled:!0,readOnly:!0,type:"checkbox"}),u.jsx("span",{"aria-hidden":"true",className:"nk-markdown__task",children:n?"☒":"☐"})]})},li:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,...i}=t,l=(r==null?void 0:r.split(/\s+/).includes("task-list-item"))??!1;return u.jsx("li",{...i,className:["nk-markdown__list-item",l?"nk-markdown__list-item--task":void 0].filter(Boolean).join(" "),children:n})},ol:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,...i}=t,l=(r==null?void 0:r.split(/\s+/).includes("contains-task-list"))??!1;return u.jsx("ol",{...i,className:["nk-markdown__list","nk-markdown__list--ordered",l?"nk-markdown__list--tasks":void 0].filter(Boolean).join(" "),children:n})},p:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,ref:i,...l}=t;return u.jsx(k.Text,{...l,className:["nk-markdown__paragraph",r].filter(Boolean).join(" "),children:n})},picture:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,...i}=t;return u.jsx("picture",{...i,className:["nk-markdown__picture",r].filter(Boolean).join(" "),children:n})},pre:function(t){const{children:n,dangerouslySetInnerHTML:r,node:d,ref:c,...i}=t,l=ie(d);return l?u.jsx(X.Code,{code:l.content,codeProps:l.codeProps,language:ee(l.codeProps.className),maxHighlightLength:a,maxLineCount:m,preProps:i}):u.jsx("pre",{...i,children:n})},source:function(t){const{children:n,dangerouslySetInnerHTML:r,node:d,srcSet:c,...i}=t,l=v(c,e,o);return l?u.jsx("source",{...i,srcSet:l}):null},table:function(t){const{children:n,dangerouslySetInnerHTML:r,node:d,...c}=t;return u.jsx(_.Table,{...c,children:n})},tbody:function(t){const{children:n,dangerouslySetInnerHTML:r,node:d,...c}=t;return u.jsx(_.Table.Body,{...c,children:n})},td:function(t){const{align:n,children:r,dangerouslySetInnerHTML:d,node:c,style:i,...l}=t;return u.jsx(_.Table.Cell,{...l,align:C((i==null?void 0:i.textAlign)??n),children:r})},th:function(t){const{align:n,children:r,dangerouslySetInnerHTML:d,node:c,style:i,...l}=t;return u.jsx(_.Table.HeaderCell,{...l,align:C((i==null?void 0:i.textAlign)??n),children:r})},thead:function(t){const{children:n,dangerouslySetInnerHTML:r,node:d,...c}=t;return u.jsx(_.Table.Head,{...c,children:n})},tr:function(t){const{children:n,dangerouslySetInnerHTML:r,node:d,onClick:c,...i}=t;return u.jsx(_.Table.Row,{...i,children:n})},ul:function(t){const{children:n,className:r,dangerouslySetInnerHTML:d,node:c,...i}=t,l=(r==null?void 0:r.split(/\s+/).includes("contains-task-list"))??!1;return u.jsx("ul",{...i,className:["nk-markdown__list","nk-markdown__list--unordered",l?"nk-markdown__list--tasks":void 0].filter(Boolean).join(" "),children:n})}}}const le={clobberPrefix:""},ce=25e3,de="Markdown content exceeds the rendering limit.";function ue(e,o){if(!e.startsWith("#")||e.length===1)return null;let a=e.slice(1);try{a=decodeURIComponent(a)}catch{return null}return o.getElementById(a)}function me(e){const o=e.tabIndex<0&&!e.hasAttribute("tabindex");if(o&&e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0}),!!o){if(e.ownerDocument.activeElement!==e){e.removeAttribute("tabindex");return}e.addEventListener("blur",()=>e.removeAttribute("tabindex"),{once:!0})}}function he(e,o){const a=e,m=new a.HashChangeEvent("hashchange",{newURL:e.location.href,oldURL:o});e.dispatchEvent(m)}function fe(e){return e===null?null:Number.isFinite(e)?Math.max(0,Math.floor(e)):0}const pe=M.forwardRef(function(o,a){const{allowedImageSources:m,anchorPrefix:h="",className:s,content:t,dangerouslySetInnerHTML:n,imageBaseUrl:r,maxCodeHighlightLength:d,maxCodeLineCount:c,maxContentLength:i=ce,rehypePlugins:l,remarkPlugins:b,scrollOffset:g=128,style:x,...L}=o,j=fe(i),D=j!==null&&t.length>j,P=M.useCallback(f=>{var N;if(f.defaultPrevented||f.button!==0||f.metaKey||f.ctrlKey||f.shiftKey||f.altKey)return;const y=f.currentTarget.getAttribute("href");if(!y)return;const w=ue(y,f.currentTarget.ownerDocument);if(!w||typeof w.scrollIntoView!="function")return;const p=w.ownerDocument.defaultView;if(!p)return;f.preventDefault();const z=((N=p.matchMedia)==null?void 0:N.call(p,"(prefers-reduced-motion: reduce)").matches)??!1,F=g===null||z?"auto":"smooth",U=p.location.href,K=p.location.hash!==y;p.location.hash!==y&&p.history.pushState(p.history.state,"",y),me(w),w.scrollIntoView({behavior:F,block:"start"}),K&&he(p,U)},[g]),O=M.useMemo(()=>ae(m,r,d,c,P),[m,P,r,d,c]),q=M.useMemo(()=>[J,...b??[]],[b]),$=M.useMemo(()=>[W,...l??[],oe,V,[se,{clobberPrefix:A,prefix:h}],[H,ne]],[h,l]),I={...x};if(g!==null){const f=Number.isFinite(g)?Math.max(0,g):0;I["--nk-markdown-scroll-offset"]=`${f}px`}return u.jsx("div",{...L,ref:a,className:["nk-markdown",s].filter(Boolean).join(" "),style:I,children:D?u.jsx(Y.Alert,{role:"alert",tone:"warning",children:de}):u.jsx(G,{allowedElements:B,components:O,rehypePlugins:$,remarkPlugins:q,remarkRehypeOptions:le,children:t})})});exports.default=pe;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),M=require("react"),G=require("react-markdown"),W=require("rehype-raw"),H=require("rehype-sanitize"),V=require("rehype-slug"),J=require("remark-gfm"),Y=require("./Alert-LJDkNUqH.cjs"),X=require("./Code-B7s_rN0G.cjs"),Q=require("./Divider-C7XGlr26.cjs"),_=require("./Table-BqWBgMTU.cjs"),k=require("./Text-DWYlIcPj.cjs"),Z={bash:"Shell",c:"C","c++":"C++",cpp:"C++",css:"CSS",go:"Go",golang:"Go",html:"HTML",js:"JavaScript",javascript:"JavaScript",jsx:"JavaScript",json:"JSON",markdown:"Markdown",md:"Markdown",py:"Python",python:"Python",rb:"Ruby",ruby:"Ruby",rs:"Rust",rust:"Rust",sh:"Shell",shell:"Shell",sql:"SQL",ts:"TypeScript",tsx:"TypeScript",typescript:"TypeScript",xml:"HTML",yaml:"YAML",yml:"YAML"};function ee(e){var a;const o=(a=e==null?void 0:e.split(/\s+/).find(f=>f.startsWith("language-")))==null?void 0:a.slice(9).toLowerCase();return o?Z[o]:void 0}const A="md-",B=["a","blockquote","br","code","del","em","h1","h2","h3","h4","h5","h6","hr","img","input","li","ol","p","picture","pre","section","source","strong","sup","table","tbody","td","th","thead","tr","ul"],ne={...H.defaultSchema,allowComments:!1,allowDoctypes:!1,ancestors:{...H.defaultSchema.ancestors,source:["picture"]},attributes:{"*":["dir","id","lang","title"],a:["ariaDescribedBy","ariaLabel","dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href","hrefLang"],code:[["className",/^language-[\w+-]+$/]],h2:[["className","sr-only"]],img:["alt","height","src","srcSet","width"],input:["checked",["disabled",!0],"readOnly",["type","checkbox"]],li:[["className","task-list-item"]],ol:["start",["className","contains-task-list"]],section:["dataFootnotes",["className","footnotes"]],source:["media","srcSet","type"],td:["align","colSpan","rowSpan"],th:["align","colSpan","rowSpan","scope"],ul:[["className","contains-task-list"]]},clobber:H.defaultSchema.clobber,clobberPrefix:A,strip:["script","style"],tagNames:[...B]};function re(e,o){const a=o.flags.replace(/[gy]/g,"");return new RegExp(o.source,a).test(e)}function te(e){if(!e)return null;try{const o=new URL(e);return o.protocol!=="http:"&&o.protocol!=="https:"||o.username||o.password?null:o}catch{return null}}function R(e,o,a){if(e.includes("\\")||/[\u0000-\u0020\u007f]/.test(e)||o===void 0)return;const f=/^[a-z][a-z\d+.-]*:/i.test(e),m=e.startsWith("//");if(o==="*")return!f&&!m||/^https?:/i.test(e)||m?e:void 0;const s=Array.isArray(o)?o:[o],t=te(a);try{let n=null;if(f?n=new URL(e):t&&(n=new URL(e,t)),!n||n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password)return;const r=n.href;return s.some(l=>re(r,l))?r:void 0}catch{return}}function v(e,o,a){if(!e)return;const m=e.split(",").map(s=>{const t=s.trim().split(/\s+/),[n,r]=t,u=r===void 0||/^(?:\d+w|(?:\d+(?:\.\d+)?|\.\d+)x)$/.test(r);if(t.length>2||!u||n===void 0||n.length===0)return null;const l=R(n,o,a);return l?`${l}${r?` ${r}`:""}`:null});if(!m.some(s=>s===null))return m.join(", ")}function oe(){function e(o){o.children=o.children.filter(a=>a.type!=="element"||a.tagName!=="input"||a.position===void 0),o.children.forEach(a=>{a.type==="element"&&e(a)})}return o=>e(o)}function S(e,o){return Array.isArray(e)?e.map(a=>typeof a=="string"?`${o}${a}`:a):typeof e=="string"?e.split(/\s+/).map(a=>`${o}${a}`).join(" "):e}function se(e){const{clobberPrefix:o,prefix:a}=e;function f(m){if(m.type==="element"){const{properties:s}=m;s.id=S(s.id,a),s.name=S(s.name,a),s.ariaDescribedBy=S(s.ariaDescribedBy,a),s.ariaLabelledBy=S(s.ariaLabelledBy,a),typeof s.href=="string"&&s.href.startsWith("#")&&(s.href=`#${o}${a}${s.href.slice(1)}`)}"children"in m&&m.children.forEach(f)}return m=>f(m)}function C(e){return e==="center"||e==="left"||e==="right"?e:void 0}function E(e){return e.type==="text"?e.value:"children"in e?e.children.map(E).join(""):""}function T(e){return typeof e=="string"?e:void 0}function ie(e){if(!e)return null;const o=e.children.find(n=>n.type==="element"&&n.tagName==="code");if(!o||e.children.some(n=>n!==o&&(n.type!=="text"||n.value.trim().length>0)))return null;const f=o.properties.className;let m;Array.isArray(f)?m=f.join(" "):typeof f=="string"&&(m=f);const s=o.children.map(E).join("").replace(/\n$/,"");return{codeProps:{className:m,dir:T(o.properties.dir),id:T(o.properties.id),lang:T(o.properties.lang),title:T(o.properties.title)},content:s}}function ae(e,o,a,f,m){return{a:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,...i}=t;return d.jsx("a",{...i,className:["nk-markdown__link",r].filter(Boolean).join(" "),onClick:m,children:n})},blockquote:function(t){const{children:n,dangerouslySetInnerHTML:r,node:u,...l}=t;return d.jsx("blockquote",{...l,className:"nk-markdown__blockquote",children:n})},code:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,...i}=t;return d.jsx("code",{...i,className:["nk-markdown__inline-code",r].filter(Boolean).join(" "),children:n})},h1:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,ref:i,...c}=t;return d.jsx(k.Text,{...c,as:"h1",className:["nk-markdown__heading",r].filter(Boolean).join(" "),size:"heading",weight:"semibold",children:n})},h2:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,ref:i,...c}=t;return d.jsx(k.Text,{...c,as:"h2",className:["nk-markdown__heading",r!=null&&r.split(/\s+/).includes("sr-only")?"nk-markdown__visually-hidden":void 0].filter(Boolean).join(" "),size:"title",weight:"semibold",children:n})},h3:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,ref:i,...c}=t;return d.jsx(k.Text,{...c,as:"h3",className:["nk-markdown__heading",r].filter(Boolean).join(" "),size:"subtitle",weight:"semibold",children:n})},h4:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,ref:i,...c}=t;return d.jsx(k.Text,{...c,as:"h4",className:["nk-markdown__heading",r].filter(Boolean).join(" "),weight:"semibold",children:n})},h5:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,ref:i,...c}=t;return d.jsx(k.Text,{...c,as:"h5",className:["nk-markdown__heading",r].filter(Boolean).join(" "),weight:"semibold",children:n})},h6:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,ref:i,...c}=t;return d.jsx(k.Text,{...c,as:"h6",className:["nk-markdown__heading",r].filter(Boolean).join(" "),weight:"medium",children:n})},hr:function(t){const{dangerouslySetInnerHTML:n,node:r,...u}=t;return d.jsx(Q.Divider,{...u})},img:function(t){const{alt:n,className:r,dangerouslySetInnerHTML:u,node:l,src:i,srcSet:c,...b}=t,x=R(typeof i=="string"?i:"",e,o),L=v(c,e,o);return x?d.jsx("img",{...b,alt:n??"",className:["nk-markdown__image",r].filter(Boolean).join(" "),decoding:"async",loading:"lazy",src:x,srcSet:L}):n?d.jsx("span",{className:"nk-markdown__blocked-image",children:n}):null},input:function(t){const{checked:n,className:r,dangerouslySetInnerHTML:u,node:l,...i}=t;return d.jsxs(d.Fragment,{children:[d.jsx("input",{...i,"aria-label":n?"Completed task":"Incomplete task",checked:n,className:["nk-markdown__task-control","nk-markdown__visually-hidden",r].filter(Boolean).join(" "),disabled:!0,readOnly:!0,type:"checkbox"}),d.jsx("span",{"aria-hidden":"true",className:"nk-markdown__task",children:n?"☒":"☐"})]})},li:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,...i}=t,c=(r==null?void 0:r.split(/\s+/).includes("task-list-item"))??!1;return d.jsx("li",{...i,className:["nk-markdown__list-item",c?"nk-markdown__list-item--task":void 0].filter(Boolean).join(" "),children:n})},ol:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,...i}=t,c=(r==null?void 0:r.split(/\s+/).includes("contains-task-list"))??!1;return d.jsx("ol",{...i,className:["nk-markdown__list","nk-markdown__list--ordered",c?"nk-markdown__list--tasks":void 0].filter(Boolean).join(" "),children:n})},p:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,ref:i,...c}=t;return d.jsx(k.Text,{...c,className:["nk-markdown__paragraph",r].filter(Boolean).join(" "),children:n})},picture:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,...i}=t;return d.jsx("picture",{...i,className:["nk-markdown__picture",r].filter(Boolean).join(" "),children:n})},pre:function(t){const{children:n,dangerouslySetInnerHTML:r,node:u,ref:l,...i}=t,c=ie(u);return c?d.jsx(X.Code,{code:c.content,codeProps:c.codeProps,language:ee(c.codeProps.className),maxHighlightLength:a,maxLineCount:f,preProps:i}):d.jsx("pre",{...i,children:n})},source:function(t){const{children:n,dangerouslySetInnerHTML:r,node:u,srcSet:l,...i}=t,c=v(l,e,o);return c?d.jsx("source",{...i,srcSet:c}):null},table:function(t){const{children:n,dangerouslySetInnerHTML:r,node:u,...l}=t;return d.jsx(_.Table,{...l,children:n})},tbody:function(t){const{children:n,dangerouslySetInnerHTML:r,node:u,...l}=t;return d.jsx(_.Table.Body,{...l,children:n})},td:function(t){const{align:n,children:r,dangerouslySetInnerHTML:u,node:l,style:i,...c}=t;return d.jsx(_.Table.Cell,{...c,align:C((i==null?void 0:i.textAlign)??n),children:r})},th:function(t){const{align:n,children:r,dangerouslySetInnerHTML:u,node:l,style:i,...c}=t;return d.jsx(_.Table.HeaderCell,{...c,align:C((i==null?void 0:i.textAlign)??n),children:r})},thead:function(t){const{children:n,dangerouslySetInnerHTML:r,node:u,...l}=t;return d.jsx(_.Table.Head,{...l,children:n})},tr:function(t){const{children:n,dangerouslySetInnerHTML:r,node:u,onClick:l,...i}=t;return d.jsx(_.Table.Row,{...i,children:n})},ul:function(t){const{children:n,className:r,dangerouslySetInnerHTML:u,node:l,...i}=t,c=(r==null?void 0:r.split(/\s+/).includes("contains-task-list"))??!1;return d.jsx("ul",{...i,className:["nk-markdown__list","nk-markdown__list--unordered",c?"nk-markdown__list--tasks":void 0].filter(Boolean).join(" "),children:n})}}}const le={clobberPrefix:""},ce=25e3,de="Markdown content exceeds the rendering limit.";function ue(e,o){if(!e.startsWith("#")||e.length===1)return null;let a=e.slice(1);try{a=decodeURIComponent(a)}catch{return null}return o.getElementById(a)}function me(e){const o=e.tabIndex<0&&!e.hasAttribute("tabindex");if(o&&e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0}),!!o){if(e.ownerDocument.activeElement!==e){e.removeAttribute("tabindex");return}e.addEventListener("blur",()=>e.removeAttribute("tabindex"),{once:!0})}}function fe(e,o){const a=e,f=new a.HashChangeEvent("hashchange",{newURL:e.location.href,oldURL:o});e.dispatchEvent(f)}function he(e){return e===null?null:Number.isFinite(e)?Math.max(0,Math.floor(e)):0}const pe=M.forwardRef(function(o,a){const{allowedImageSources:f,anchorPrefix:m="",className:s,content:t,dangerouslySetInnerHTML:n,imageBaseUrl:r,maxCodeHighlightLength:u,maxCodeLineCount:l,maxContentLength:i=ce,rehypePlugins:c,remarkPlugins:b,scrollOffset:g=128,style:x,...L}=o,P=he(i),D=P!==null&&t.length>P,j=M.useCallback(h=>{var N;if(h.defaultPrevented||h.button!==0||h.metaKey||h.ctrlKey||h.shiftKey||h.altKey)return;const y=h.currentTarget.getAttribute("href");if(!y)return;const w=ue(y,h.currentTarget.ownerDocument);if(!w||typeof w.scrollIntoView!="function")return;const p=w.ownerDocument.defaultView;if(!p)return;h.preventDefault();const z=((N=p.matchMedia)==null?void 0:N.call(p,"(prefers-reduced-motion: reduce)").matches)??!1,F=g===null||z?"auto":"smooth",U=p.location.href,K=p.location.hash!==y;p.location.hash!==y&&p.history.pushState(p.history.state,"",y),me(w),w.scrollIntoView({behavior:F,block:"start"}),K&&fe(p,U)},[g]),O=M.useMemo(()=>ae(f,r,u,l,j),[f,j,r,u,l]),q=M.useMemo(()=>[J,...b??[]],[b]),$=M.useMemo(()=>[W,...c??[],oe,V,[se,{clobberPrefix:A,prefix:m}],[H,ne]],[m,c]),I={...x};if(g!==null){const h=Number.isFinite(g)?Math.max(0,g):0;I["--nk-markdown-scroll-offset"]=`${h}px`}return d.jsx("div",{...L,ref:a,className:["nk-markdown",s].filter(Boolean).join(" "),style:I,children:D?d.jsx(Y.Alert,{role:"alert",tone:"warning",children:de}):d.jsx(G,{allowedElements:B,components:O,rehypePlugins:$,remarkPlugins:q,remarkRehypeOptions:le,children:t})})});exports.default=pe;