@wrksz/docs 0.0.0-stage → 0.1.1

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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +157 -2
  3. package/dist/agents.d.ts +30 -0
  4. package/dist/agents.js +70 -0
  5. package/dist/components/agent-logos.js +90 -0
  6. package/dist/components/agent-prompt.d.ts +29 -0
  7. package/dist/components/agent-prompt.js +100 -0
  8. package/dist/components/badge.d.ts +16 -0
  9. package/dist/components/badge.js +26 -0
  10. package/dist/components/brand.js +32 -0
  11. package/dist/components/callout.d.ts +24 -0
  12. package/dist/components/callout.js +58 -0
  13. package/dist/components/cards.d.ts +26 -0
  14. package/dist/components/cards.js +48 -0
  15. package/dist/components/code-body.js +18 -0
  16. package/dist/components/code-group.d.ts +20 -0
  17. package/dist/components/code-group.js +41 -0
  18. package/dist/components/code-tabs.d.ts +30 -0
  19. package/dist/components/code-tabs.js +49 -0
  20. package/dist/components/content-tabs.d.ts +14 -0
  21. package/dist/components/content-tabs.js +27 -0
  22. package/dist/components/copy-code.js +41 -0
  23. package/dist/components/deferred-analytics.js +5 -0
  24. package/dist/components/details.d.ts +20 -0
  25. package/dist/components/details.js +29 -0
  26. package/dist/components/heading-link.js +23 -0
  27. package/dist/components/heading.d.ts +5 -0
  28. package/dist/components/heading.js +22 -0
  29. package/dist/components/icons.js +362 -0
  30. package/dist/components/image.d.ts +27 -0
  31. package/dist/components/image.js +204 -0
  32. package/dist/components/inline-text.js +14 -0
  33. package/dist/components/install.d.ts +22 -0
  34. package/dist/components/install.js +62 -0
  35. package/dist/components/mdx-tabs.d.ts +22 -0
  36. package/dist/components/mdx-tabs.js +30 -0
  37. package/dist/components/practice.d.ts +41 -0
  38. package/dist/components/practice.js +99 -0
  39. package/dist/components/props.d.ts +37 -0
  40. package/dist/components/props.js +70 -0
  41. package/dist/components/status.js +35 -0
  42. package/dist/components/steps.d.ts +18 -0
  43. package/dist/components/steps.js +23 -0
  44. package/dist/components/theme-switch.js +31 -0
  45. package/dist/components/ui/kbd.js +410 -0
  46. package/dist/components/ui/scroll-area.js +169 -0
  47. package/dist/components/ui/table.d.ts +33 -0
  48. package/dist/components/ui/table.js +103 -0
  49. package/dist/components/ui/tabs.js +69 -0
  50. package/dist/components/ui/toast.js +629 -0
  51. package/dist/components/ui/tooltip.js +31 -0
  52. package/dist/components/wrksz-mark.js +12 -0
  53. package/dist/docs/index.d.ts +8 -0
  54. package/dist/docs/index.js +8 -0
  55. package/dist/docs/layout.d.ts +6 -0
  56. package/dist/docs/layout.js +10 -0
  57. package/dist/docs/page-actions.d.ts +36 -0
  58. package/dist/docs/page-actions.js +136 -0
  59. package/dist/docs/page-footer.d.ts +14 -0
  60. package/dist/docs/page-footer.js +68 -0
  61. package/dist/docs/page-header.d.ts +13 -0
  62. package/dist/docs/page-header.js +57 -0
  63. package/dist/docs/page.d.ts +16 -0
  64. package/dist/docs/page.js +38 -0
  65. package/dist/docs/reading.js +64 -0
  66. package/dist/docs/shell.js +101 -0
  67. package/dist/docs/sidebar.js +161 -0
  68. package/dist/docs/toc-bar.d.ts +12 -0
  69. package/dist/docs/toc-bar.js +132 -0
  70. package/dist/docs/toc.d.ts +11 -0
  71. package/dist/docs/toc.js +127 -0
  72. package/dist/fonts/Inter-Italic.woff2 +0 -0
  73. package/dist/fonts/Inter-LICENSE.txt +92 -0
  74. package/dist/fonts/Inter.woff2 +0 -0
  75. package/dist/fonts/IoskeleyMono-Bold.woff2 +0 -0
  76. package/dist/fonts/IoskeleyMono-Italic.woff2 +0 -0
  77. package/dist/fonts/IoskeleyMono-LICENSE.txt +92 -0
  78. package/dist/fonts/IoskeleyMono-Regular.woff2 +0 -0
  79. package/dist/fonts.d.ts +1 -0
  80. package/dist/fonts.js +38 -0
  81. package/dist/home/features.d.ts +39 -0
  82. package/dist/home/features.js +75 -0
  83. package/dist/home/footer.d.ts +4 -0
  84. package/dist/home/footer.js +79 -0
  85. package/dist/home/hero-content.js +102 -0
  86. package/dist/home/hero-install.js +128 -0
  87. package/dist/home/hero-stage.d.ts +4 -0
  88. package/dist/home/hero-stage.js +9 -0
  89. package/dist/home/hero.d.ts +6 -0
  90. package/dist/home/hero.js +16 -0
  91. package/dist/home/home-header.d.ts +1 -0
  92. package/dist/home/home-header.js +173 -0
  93. package/dist/home/index.d.ts +7 -0
  94. package/dist/home/index.js +7 -0
  95. package/dist/home/layout.d.ts +6 -0
  96. package/dist/home/layout.js +15 -0
  97. package/dist/home/reveal.js +31 -0
  98. package/dist/index.d.ts +4 -0
  99. package/dist/index.js +4 -0
  100. package/dist/lib/clipboard.js +55 -0
  101. package/dist/lib/cn.js +1 -0
  102. package/dist/lib/format.js +9 -0
  103. package/dist/lib/package-manager-script.js +12 -0
  104. package/dist/lib/package-manager.js +54 -0
  105. package/dist/lib/theme-config.js +10 -0
  106. package/dist/llms.d.ts +34 -0
  107. package/dist/llms.js +111 -0
  108. package/dist/next.d.ts +18 -0
  109. package/dist/next.js +45 -0
  110. package/dist/node_modules/.pnpm/@types_mdast@4.0.4/node_modules/@types/mdast/index.d.ts +930 -0
  111. package/dist/node_modules/.pnpm/@types_mdx@2.0.14/node_modules/@types/mdx/types.d.ts +81 -0
  112. package/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts +80 -0
  113. package/dist/registry.d.ts +61 -0
  114. package/dist/registry.js +113 -0
  115. package/dist/root.d.ts +9 -0
  116. package/dist/root.js +34 -0
  117. package/dist/search.d.ts +5 -0
  118. package/dist/search.js +43 -0
  119. package/dist/seo/index.d.ts +6 -0
  120. package/dist/seo/index.js +6 -0
  121. package/dist/seo/json-ld.d.ts +17 -0
  122. package/dist/seo/json-ld.js +88 -0
  123. package/dist/seo/metadata.d.ts +21 -0
  124. package/dist/seo/metadata.js +75 -0
  125. package/dist/seo/robots.d.ts +14 -0
  126. package/dist/seo/robots.js +18 -0
  127. package/dist/seo/sitemap.d.ts +16 -0
  128. package/dist/seo/sitemap.js +26 -0
  129. package/dist/seo/url.d.ts +6 -0
  130. package/dist/seo/url.js +11 -0
  131. package/dist/server.js +63 -0
  132. package/dist/site-context.js +17 -0
  133. package/dist/site.d.ts +41 -0
  134. package/dist/site.js +13 -0
  135. package/dist/source/compile.d.ts +6 -0
  136. package/dist/source/compile.js +32 -0
  137. package/dist/source/errors.d.ts +4 -0
  138. package/dist/source/errors.js +10 -0
  139. package/dist/source/frontmatter.d.ts +13 -0
  140. package/dist/source/frontmatter.js +102 -0
  141. package/dist/source/highlight.js +102 -0
  142. package/dist/source/index.d.ts +36 -0
  143. package/dist/source/index.js +102 -0
  144. package/dist/source/markdown.d.ts +48 -0
  145. package/dist/source/markdown.js +393 -0
  146. package/dist/source/prompt.js +33 -0
  147. package/dist/source/scan.d.ts +8 -0
  148. package/dist/source/scan.js +64 -0
  149. package/dist/source/toc.d.ts +5 -0
  150. package/dist/source/toc.js +28 -0
  151. package/dist/source/tree.d.ts +29 -0
  152. package/dist/source/tree.js +91 -0
  153. package/dist/styles.css +879 -0
  154. package/dist/typography.d.ts +101 -0
  155. package/dist/typography.js +232 -0
  156. package/package.json +84 -4
@@ -0,0 +1,362 @@
1
+ import { useId } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ // src/components/icons.tsx
4
+ const hole = {
5
+ fill: "black",
6
+ stroke: "none"
7
+ };
8
+ function Solid({ children, ...props }) {
9
+ const mask = `solid-${useId().replace(/[^a-zA-Z0-9]/g, "")}`;
10
+ return /* @__PURE__ */ jsxs("svg", {
11
+ viewBox: "0 0 16 16",
12
+ fill: "none",
13
+ "aria-hidden": true,
14
+ ...props,
15
+ children: [/* @__PURE__ */ jsx("mask", {
16
+ id: mask,
17
+ children: /* @__PURE__ */ jsx("g", {
18
+ fill: "white",
19
+ stroke: "white",
20
+ strokeWidth: "1.5",
21
+ strokeLinecap: "round",
22
+ strokeLinejoin: "round",
23
+ children
24
+ })
25
+ }), /* @__PURE__ */ jsx("rect", {
26
+ width: "16",
27
+ height: "16",
28
+ fill: "currentColor",
29
+ mask: `url(#${mask})`
30
+ })]
31
+ });
32
+ }
33
+ const arrowPath = "M3.25 8h9.5M8.75 4 12.75 8l-4 4";
34
+ function ArrowRightIcon(props) {
35
+ return /* @__PURE__ */ jsx(Solid, {
36
+ ...props,
37
+ children: /* @__PURE__ */ jsx("path", {
38
+ fill: "none",
39
+ d: arrowPath
40
+ })
41
+ });
42
+ }
43
+ function CopyIcon(props) {
44
+ return /* @__PURE__ */ jsxs(Solid, {
45
+ ...props,
46
+ children: [
47
+ /* @__PURE__ */ jsx("rect", {
48
+ x: "5.5",
49
+ y: "2.25",
50
+ width: "8.25",
51
+ height: "8.25",
52
+ rx: "2"
53
+ }),
54
+ /* @__PURE__ */ jsx("rect", {
55
+ x: "2.25",
56
+ y: "5.5",
57
+ width: "8.25",
58
+ height: "8.25",
59
+ rx: "2",
60
+ fill: "black",
61
+ stroke: "black",
62
+ strokeWidth: "4.5"
63
+ }),
64
+ /* @__PURE__ */ jsx("rect", {
65
+ x: "2.25",
66
+ y: "5.5",
67
+ width: "8.25",
68
+ height: "8.25",
69
+ rx: "2"
70
+ })
71
+ ]
72
+ });
73
+ }
74
+ function CheckIcon(props) {
75
+ return /* @__PURE__ */ jsx(Solid, {
76
+ ...props,
77
+ children: /* @__PURE__ */ jsx("path", {
78
+ fill: "none",
79
+ d: "m3.25 8.5 3.25 3.25 6.25-7.5"
80
+ })
81
+ });
82
+ }
83
+ function ChevronDownIcon(props) {
84
+ return /* @__PURE__ */ jsx(Solid, {
85
+ ...props,
86
+ children: /* @__PURE__ */ jsx("path", {
87
+ fill: "none",
88
+ d: "m4 6 4 4 4-4"
89
+ })
90
+ });
91
+ }
92
+ function DownloadIcon(props) {
93
+ return /* @__PURE__ */ jsx(Solid, {
94
+ ...props,
95
+ children: /* @__PURE__ */ jsx("path", {
96
+ fill: "none",
97
+ d: "M8 2.75v7.5M5 7.5l3 3 3-3M3 13.25h10"
98
+ })
99
+ });
100
+ }
101
+ function StarIcon(props) {
102
+ return /* @__PURE__ */ jsx(Solid, {
103
+ ...props,
104
+ children: /* @__PURE__ */ jsx("path", { d: "m8 2.25 1.7 3.6 3.95.5-2.9 2.72.75 3.93L8 11.07 4.5 13l.75-3.93-2.9-2.72 3.95-.5Z" })
105
+ });
106
+ }
107
+ function SearchIcon(props) {
108
+ return /* @__PURE__ */ jsxs(Solid, {
109
+ ...props,
110
+ children: [/* @__PURE__ */ jsx("circle", {
111
+ cx: "7.25",
112
+ cy: "7.25",
113
+ r: "4.5",
114
+ fill: "none"
115
+ }), /* @__PURE__ */ jsx("path", {
116
+ fill: "none",
117
+ d: "m10.5 10.5 3 3"
118
+ })]
119
+ });
120
+ }
121
+ function GitHubIcon(props) {
122
+ return /* @__PURE__ */ jsx(Solid, {
123
+ ...props,
124
+ children: /* @__PURE__ */ jsx("path", {
125
+ stroke: "none",
126
+ transform: "translate(1 1) scale(0.875)",
127
+ d: "M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"
128
+ })
129
+ });
130
+ }
131
+ function NpmIcon(props) {
132
+ return /* @__PURE__ */ jsxs(Solid, {
133
+ ...props,
134
+ children: [/* @__PURE__ */ jsx("rect", {
135
+ x: "2.25",
136
+ y: "2.25",
137
+ width: "11.5",
138
+ height: "11.5",
139
+ rx: "2"
140
+ }), /* @__PURE__ */ jsx("path", {
141
+ fill: "black",
142
+ stroke: "black",
143
+ strokeWidth: "0.6",
144
+ d: "M3.96 3.96h8.06v8.06h-1.59V5.54H7.65v6.48H3.96Z"
145
+ })]
146
+ });
147
+ }
148
+ function SunIcon(props) {
149
+ return /* @__PURE__ */ jsxs(Solid, {
150
+ ...props,
151
+ children: [/* @__PURE__ */ jsx("circle", {
152
+ cx: "8",
153
+ cy: "8",
154
+ r: "2.75"
155
+ }), /* @__PURE__ */ jsx("path", {
156
+ fill: "none",
157
+ d: "M8 1.75v1.5M8 12.75v1.5M1.75 8h1.5M12.75 8h1.5M3.58 3.58l1.06 1.06M11.36 11.36l1.06 1.06M3.58 12.42l1.06-1.06M11.36 4.64l1.06-1.06"
158
+ })]
159
+ });
160
+ }
161
+ function MoonIcon(props) {
162
+ return /* @__PURE__ */ jsx(Solid, {
163
+ ...props,
164
+ children: /* @__PURE__ */ jsx("path", { d: "M13.25 9.75A5.5 5.5 0 0 1 6.25 2.75a5.5 5.5 0 1 0 7 7Z" })
165
+ });
166
+ }
167
+ function PyPIIcon(props) {
168
+ return /* @__PURE__ */ jsx(Solid, {
169
+ ...props,
170
+ children: /* @__PURE__ */ jsx("path", {
171
+ stroke: "none",
172
+ transform: "translate(2.25 2.25) scale(0.479)",
173
+ d: "M11.858 0c-.978.005-1.913.088-2.736.234C6.7.662 6.26 1.558 6.26 3.21v2.182h5.725v.727H4.111c-1.664 0-3.121 1-3.577 2.903-.526 2.181-.549 3.542 0 5.82.407 1.694 1.379 2.902 3.043 2.902h1.969v-2.616c0-1.89 1.635-3.557 3.576-3.557h5.72c1.591 0 2.862-1.31 2.862-2.91v-5.45c0-1.553-1.309-2.718-2.863-2.977A18 18 0 0 0 11.858 0M8.762 1.755c.591 0 1.074.491 1.074 1.095 0 .601-.483 1.087-1.074 1.087A1.08 1.08 0 0 1 7.688 2.85c0-.604.48-1.095 1.074-1.095m9.656 4.364v2.543c0 1.971-1.671 3.63-3.577 3.63H9.122c-1.566 0-2.862 1.34-2.862 2.91v5.452c0 1.551 1.349 2.464 2.862 2.91 1.813.532 3.55.628 5.72 0 1.44-.418 2.862-1.258 2.862-2.91V18.47h-5.719v-.727h8.582c1.664 0 2.284-1.16 2.862-2.903.598-1.793.573-3.518 0-5.819-.41-1.656-1.196-2.903-2.862-2.903zm-3.216 13.807a1.08 1.08 0 0 1 1.074 1.088c0 .604-.48 1.094-1.074 1.094-.592 0-1.075-.49-1.075-1.094 0-.601.483-1.088 1.075-1.088"
174
+ })
175
+ });
176
+ }
177
+ function ArrowUpRightIcon(props) {
178
+ return /* @__PURE__ */ jsx(Solid, {
179
+ ...props,
180
+ children: /* @__PURE__ */ jsx("path", {
181
+ fill: "none",
182
+ d: "M3.75 12.25 11.75 4.25M5.75 3.75h6.5v6.5"
183
+ })
184
+ });
185
+ }
186
+ function SparkIcon(props) {
187
+ return /* @__PURE__ */ jsxs(Solid, {
188
+ ...props,
189
+ children: [/* @__PURE__ */ jsx("path", { d: "M6.75 2.5c.4 2.9 1.35 3.85 4.25 4.25-2.9.4-3.85 1.35-4.25 4.25-.4-2.9-1.35-3.85-4.25-4.25 2.9-.4 3.85-1.35 4.25-4.25Z" }), /* @__PURE__ */ jsx("path", {
190
+ fill: "none",
191
+ d: "M12.25 10.5v3M10.75 12h3"
192
+ })]
193
+ });
194
+ }
195
+ function FlaskIcon(props) {
196
+ return /* @__PURE__ */ jsxs(Solid, {
197
+ ...props,
198
+ children: [/* @__PURE__ */ jsx("path", {
199
+ fill: "none",
200
+ d: "M5.5 2.25h5M6.5 2.25v3.5l-3.75 6a1.25 1.25 0 0 0 1.07 1.75h8.36a1.25 1.25 0 0 0 1.07-1.75l-3.75-6v-3.5"
201
+ }), /* @__PURE__ */ jsx("path", { d: "M4.3 9.25h7.4l1.55 2.5a1.25 1.25 0 0 1-1.07 1.75H3.82a1.25 1.25 0 0 1-1.07-1.75Z" })]
202
+ });
203
+ }
204
+ function WarningIcon(props) {
205
+ return /* @__PURE__ */ jsxs(Solid, {
206
+ ...props,
207
+ children: [
208
+ /* @__PURE__ */ jsx("path", {
209
+ stroke: "none",
210
+ d: "M6.7 2.25a1.5 1.5 0 0 1 2.6 0l5.45 9.5A1.5 1.5 0 0 1 13.45 14H2.55a1.5 1.5 0 0 1-1.3-2.25Z"
211
+ }),
212
+ /* @__PURE__ */ jsx("rect", {
213
+ x: "7.25",
214
+ y: "5.4",
215
+ width: "1.5",
216
+ height: "3.4",
217
+ rx: "0.75",
218
+ ...hole
219
+ }),
220
+ /* @__PURE__ */ jsx("circle", {
221
+ cx: "8",
222
+ cy: "11",
223
+ r: "0.9",
224
+ ...hole
225
+ })
226
+ ]
227
+ });
228
+ }
229
+ function InfoIcon(props) {
230
+ return /* @__PURE__ */ jsxs(Solid, {
231
+ ...props,
232
+ children: [
233
+ /* @__PURE__ */ jsx("circle", {
234
+ cx: "8",
235
+ cy: "8",
236
+ r: "6.5",
237
+ stroke: "none"
238
+ }),
239
+ /* @__PURE__ */ jsx("circle", {
240
+ cx: "8",
241
+ cy: "5.35",
242
+ r: "0.9",
243
+ ...hole
244
+ }),
245
+ /* @__PURE__ */ jsx("rect", {
246
+ x: "7.25",
247
+ y: "7.25",
248
+ width: "1.5",
249
+ height: "4.25",
250
+ rx: "0.75",
251
+ ...hole
252
+ })
253
+ ]
254
+ });
255
+ }
256
+ function SuccessIcon(props) {
257
+ return /* @__PURE__ */ jsxs(Solid, {
258
+ ...props,
259
+ children: [/* @__PURE__ */ jsx("circle", {
260
+ cx: "8",
261
+ cy: "8",
262
+ r: "6.5",
263
+ stroke: "none"
264
+ }), /* @__PURE__ */ jsx("path", {
265
+ fill: "none",
266
+ stroke: "black",
267
+ d: "m5.25 8.25 1.85 1.85 3.65-4.35"
268
+ })]
269
+ });
270
+ }
271
+ function DangerIcon(props) {
272
+ return /* @__PURE__ */ jsxs(Solid, {
273
+ ...props,
274
+ children: [
275
+ /* @__PURE__ */ jsx("circle", {
276
+ cx: "8",
277
+ cy: "8",
278
+ r: "6.5",
279
+ stroke: "none"
280
+ }),
281
+ /* @__PURE__ */ jsx("rect", {
282
+ x: "7.25",
283
+ y: "4.25",
284
+ width: "1.5",
285
+ height: "4.5",
286
+ rx: "0.75",
287
+ ...hole
288
+ }),
289
+ /* @__PURE__ */ jsx("circle", {
290
+ cx: "8",
291
+ cy: "10.85",
292
+ r: "0.9",
293
+ ...hole
294
+ })
295
+ ]
296
+ });
297
+ }
298
+ function SpinnerIcon(props) {
299
+ return /* @__PURE__ */ jsx(Solid, {
300
+ ...props,
301
+ children: /* @__PURE__ */ jsx("path", {
302
+ fill: "none",
303
+ d: "M8 2.5a5.5 5.5 0 1 1-5.5 5.5"
304
+ })
305
+ });
306
+ }
307
+ function RetryIcon(props) {
308
+ return /* @__PURE__ */ jsx(Solid, {
309
+ ...props,
310
+ children: /* @__PURE__ */ jsx("path", {
311
+ fill: "none",
312
+ d: "M13.25 8.1a5.25 5.25 0 1 1-5.25-5.25c1.47 0 2.88.58 3.93 1.6l1.32 1.65M13.25 2.6v3.5h-3.5"
313
+ })
314
+ });
315
+ }
316
+ function CloseIcon(props) {
317
+ return /* @__PURE__ */ jsx(Solid, {
318
+ ...props,
319
+ children: /* @__PURE__ */ jsx("path", {
320
+ fill: "none",
321
+ d: "m3.75 3.75 8.5 8.5m0-8.5-8.5 8.5"
322
+ })
323
+ });
324
+ }
325
+ function HashIcon(props) {
326
+ return /* @__PURE__ */ jsx(Solid, {
327
+ ...props,
328
+ children: /* @__PURE__ */ jsx("path", {
329
+ fill: "none",
330
+ d: "M6.75 3.25 5.5 12.75M10.5 3.25l-1.25 9.5M3.5 6.25h9.25M3.25 9.75h9.25"
331
+ })
332
+ });
333
+ }
334
+ function ZoomInIcon(props) {
335
+ return /* @__PURE__ */ jsxs(Solid, {
336
+ ...props,
337
+ children: [/* @__PURE__ */ jsx("circle", {
338
+ cx: "7.25",
339
+ cy: "7.25",
340
+ r: "4.5",
341
+ fill: "none"
342
+ }), /* @__PURE__ */ jsx("path", {
343
+ fill: "none",
344
+ d: "m10.5 10.5 3 3M5.5 7.25h3.5M7.25 5.5v3.5"
345
+ })]
346
+ });
347
+ }
348
+ function ZoomOutIcon(props) {
349
+ return /* @__PURE__ */ jsxs(Solid, {
350
+ ...props,
351
+ children: [/* @__PURE__ */ jsx("circle", {
352
+ cx: "7.25",
353
+ cy: "7.25",
354
+ r: "4.5",
355
+ fill: "none"
356
+ }), /* @__PURE__ */ jsx("path", {
357
+ fill: "none",
358
+ d: "m10.5 10.5 3 3M5.5 7.25h3.5"
359
+ })]
360
+ });
361
+ }
362
+ export { ArrowRightIcon, ArrowUpRightIcon, CheckIcon, ChevronDownIcon, CloseIcon, CopyIcon, DangerIcon, DownloadIcon, FlaskIcon, GitHubIcon, HashIcon, InfoIcon, MoonIcon, NpmIcon, PyPIIcon, RetryIcon, SearchIcon, SparkIcon, SpinnerIcon, StarIcon, SuccessIcon, SunIcon, WarningIcon, ZoomInIcon, ZoomOutIcon };
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from "react";
2
+ type ImageProps = {
3
+ /** Image for the light theme, or for both when `dark` is left out. */
4
+ src: string;
5
+ /** Image for the dark theme. */
6
+ dark?: string;
7
+ /** What the image shows, read by screen readers; leave empty only for decoration. */
8
+ alt?: string;
9
+ /** Text under the image, also shown above it in the viewer. */
10
+ caption?: ReactNode;
11
+ /** Intrinsic size, which reserves the space before the file loads. */
12
+ width?: number | string;
13
+ height?: number | string;
14
+ className?: string;
15
+ };
16
+ /**
17
+ * An image of the docs, with an optional caption and a separate file for the dark theme.
18
+ * A click opens it in a full-screen viewer with zoom. The light and dark files swap through
19
+ * CSS, so the right one shows on the first paint.
20
+ *
21
+ * ```mdx
22
+ * <Image src="/toggle.png" dark="/toggle-dark.png" alt="The theme toggle" caption="…" />
23
+ * ![The theme toggle](/toggle.png)
24
+ * ```
25
+ */
26
+ export declare function Image({ src, dark, alt, caption, width, height, className }: ImageProps): import("react").JSX.Element;
27
+ export {};
@@ -0,0 +1,204 @@
1
+ "use client";
2
+ import { Dialog } from "@base-ui/react/dialog";
3
+ import { useRef, useState } from "react";
4
+ import { flushSync } from "react-dom";
5
+ import { cn } from "../lib/cn.js";
6
+ import { CloseIcon, ZoomInIcon, ZoomOutIcon } from "./icons.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ // src/components/image.tsx
9
+ /** Zoom levels of the viewer, relative to the image fitted to the screen. */
10
+ const STEPS = [
11
+ 1,
12
+ 1.5,
13
+ 2,
14
+ 3,
15
+ 4
16
+ ];
17
+ const TOOL = "grid size-10 shrink-0 place-items-center rounded-full text-white/80 outline-none transition-[background-color,color,opacity] duration-150 hover:bg-white/12 hover:text-white focus-visible:ring-2 focus-visible:ring-white/70 disabled:pointer-events-none disabled:opacity-35";
18
+ /**
19
+ * The full-screen view: the image fitted to the screen, a bar with its description, zoom
20
+ * buttons and a close button. A click on the image zooms to 200% around the point under the
21
+ * pointer and back; `+`, `-` and `0` do the same from the keyboard, and a zoomed image pans
22
+ * by scrolling or dragging a finger. A click outside the image closes the viewer.
23
+ */
24
+ function Viewer({ src: light, dark, alt, title, onClose }) {
25
+ const scroller = useRef(null);
26
+ const image = useRef(null);
27
+ const [src] = useState(() => dark && document.documentElement.classList.contains("dark") ? dark : light);
28
+ const [step, setStep] = useState(0);
29
+ const [fitted, setFitted] = useState(0);
30
+ const scale = STEPS[step] ?? 1;
31
+ /** Zooms to `next`, keeping the point under `at` (viewport pixels) where it is. */
32
+ function zoomTo(next, at) {
33
+ const box = scroller.current;
34
+ const img = image.current;
35
+ if (!box || !img) return;
36
+ const clamped = Math.min(Math.max(next, 0), STEPS.length - 1);
37
+ if (clamped === step) return;
38
+ const frame = box.getBoundingClientRect();
39
+ const point = at ?? {
40
+ x: frame.left + frame.width / 2,
41
+ y: frame.top + frame.height / 2
42
+ };
43
+ const rect = img.getBoundingClientRect();
44
+ const share = {
45
+ x: Math.min(Math.max((point.x - rect.left) / rect.width, 0), 1),
46
+ y: Math.min(Math.max((point.y - rect.top) / rect.height, 0), 1)
47
+ };
48
+ flushSync(() => {
49
+ if (step === 0) setFitted(img.clientWidth);
50
+ setStep(clamped);
51
+ });
52
+ const after = img.getBoundingClientRect();
53
+ box.scrollLeft += after.left + share.x * after.width - point.x;
54
+ box.scrollTop += after.top + share.y * after.height - point.y;
55
+ }
56
+ function onImageClick(event) {
57
+ const at = event.detail === 0 ? void 0 : {
58
+ x: event.clientX,
59
+ y: event.clientY
60
+ };
61
+ zoomTo(step === 0 ? STEPS.indexOf(2) : 0, at);
62
+ }
63
+ /** A click that lands on the space around the image, not on the image or the bar. */
64
+ function onPopupClick(event) {
65
+ if (event.target.hasAttribute("data-viewer-space")) onClose();
66
+ }
67
+ function onKeyDown(event) {
68
+ if (event.key === "+" || event.key === "=") zoomTo(step + 1);
69
+ else if (event.key === "-") zoomTo(step - 1);
70
+ else if (event.key === "0") zoomTo(0);
71
+ else return;
72
+ event.preventDefault();
73
+ }
74
+ const size = step > 0 && fitted ? fitted * scale : void 0;
75
+ return /* @__PURE__ */ jsxs(Dialog.Popup, {
76
+ onKeyDown,
77
+ onClick: onPopupClick,
78
+ className: "fixed inset-0 z-50 flex flex-col outline-none transition-[opacity,scale] duration-200 ease-[cubic-bezier(0.2,0,0,1)] data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-[0.98] data-starting-style:opacity-0 motion-reduce:transition-none",
79
+ children: [/* @__PURE__ */ jsxs("div", {
80
+ className: "flex min-h-14 shrink-0 items-center gap-3 px-3 py-2 sm:px-4",
81
+ children: [/* @__PURE__ */ jsx(Dialog.Title, {
82
+ className: "min-w-0 flex-1 truncate ps-1 text-sm text-white/85",
83
+ children: title
84
+ }), /* @__PURE__ */ jsxs("div", {
85
+ className: "flex items-center",
86
+ children: [
87
+ /* @__PURE__ */ jsx("button", {
88
+ type: "button",
89
+ "aria-label": "Zoom out",
90
+ disabled: step === 0,
91
+ onClick: () => zoomTo(step - 1),
92
+ className: TOOL,
93
+ children: /* @__PURE__ */ jsx(ZoomOutIcon, { className: "size-4" })
94
+ }),
95
+ /* @__PURE__ */ jsxs("output", {
96
+ "aria-live": "polite",
97
+ className: "w-12 text-center text-xs text-white/70 tabular-nums",
98
+ children: [Math.round(scale * 100), "%"]
99
+ }),
100
+ /* @__PURE__ */ jsx("button", {
101
+ type: "button",
102
+ "aria-label": "Zoom in",
103
+ disabled: step === STEPS.length - 1,
104
+ onClick: () => zoomTo(step + 1),
105
+ className: TOOL,
106
+ children: /* @__PURE__ */ jsx(ZoomInIcon, { className: "size-4" })
107
+ }),
108
+ /* @__PURE__ */ jsx(Dialog.Close, {
109
+ "aria-label": "Close",
110
+ className: cn(TOOL, "ms-1"),
111
+ children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-4" })
112
+ })
113
+ ]
114
+ })]
115
+ }), /* @__PURE__ */ jsx("div", {
116
+ ref: scroller,
117
+ "data-viewer-space": true,
118
+ className: "min-h-0 flex-1 overflow-auto overscroll-contain",
119
+ children: /* @__PURE__ */ jsx("div", {
120
+ "data-viewer-space": true,
121
+ className: "grid min-h-full w-max min-w-full place-items-center px-4 pb-6 sm:px-8",
122
+ children: /* @__PURE__ */ jsx("button", {
123
+ type: "button",
124
+ "aria-label": step === 0 ? "Zoom in" : "Zoom out",
125
+ onClick: onImageClick,
126
+ className: cn("block rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-white/70", step === 0 ? "cursor-zoom-in" : "cursor-zoom-out"),
127
+ children: /* @__PURE__ */ jsx("img", {
128
+ ref: image,
129
+ src,
130
+ alt,
131
+ draggable: false,
132
+ style: size ? {
133
+ width: size,
134
+ maxWidth: "none",
135
+ maxHeight: "none"
136
+ } : void 0,
137
+ className: cn("block h-auto rounded-lg select-none", step === 0 && "max-h-[calc(100svh-6rem)] max-w-[calc(100vw-2rem)] object-contain sm:max-w-[calc(100vw-4rem)]")
138
+ })
139
+ })
140
+ })
141
+ })]
142
+ });
143
+ }
144
+ /**
145
+ * An image of the docs, with an optional caption and a separate file for the dark theme.
146
+ * A click opens it in a full-screen viewer with zoom. The light and dark files swap through
147
+ * CSS, so the right one shows on the first paint.
148
+ *
149
+ * ```mdx
150
+ * <Image src="/toggle.png" dark="/toggle-dark.png" alt="The theme toggle" caption="…" />
151
+ * ![The theme toggle](/toggle.png)
152
+ * ```
153
+ */
154
+ function Image({ src, dark, alt = "", caption, width, height, className }) {
155
+ const [open, setOpen] = useState(false);
156
+ const size = {
157
+ width,
158
+ height
159
+ };
160
+ const thumb = "block h-auto w-full max-w-full rounded-xl";
161
+ return /* @__PURE__ */ jsxs("figure", {
162
+ className: cn("flex flex-col gap-2.5", className),
163
+ children: [/* @__PURE__ */ jsxs(Dialog.Root, {
164
+ open,
165
+ onOpenChange: setOpen,
166
+ children: [/* @__PURE__ */ jsxs(Dialog.Trigger, {
167
+ "aria-label": alt ? `View full size: ${alt}` : "View full size",
168
+ className: "group relative block cursor-zoom-in rounded-xl shadow-[0_0_0_1px_var(--control-ring)] outline-none focus-visible:ring-2 focus-visible:ring-fd-ring",
169
+ children: [
170
+ /* @__PURE__ */ jsx("img", {
171
+ src,
172
+ alt,
173
+ ...size,
174
+ loading: "lazy",
175
+ decoding: "async",
176
+ className: cn(thumb, dark && "dark:hidden")
177
+ }),
178
+ dark ? /* @__PURE__ */ jsx("img", {
179
+ src: dark,
180
+ alt,
181
+ ...size,
182
+ loading: "lazy",
183
+ decoding: "async",
184
+ className: cn(thumb, "hidden dark:block")
185
+ }) : null,
186
+ /* @__PURE__ */ jsx("span", {
187
+ className: "absolute top-2 right-2 grid size-8 place-items-center rounded-lg bg-black/55 text-white opacity-0 backdrop-blur-sm transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 pointer-coarse:hidden",
188
+ children: /* @__PURE__ */ jsx(ZoomInIcon, { className: "size-4" })
189
+ })
190
+ ]
191
+ }), /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: "fixed inset-0 z-50 bg-black/85 backdrop-blur-sm transition-opacity duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none" }), /* @__PURE__ */ jsx(Viewer, {
192
+ src,
193
+ dark,
194
+ alt,
195
+ title: caption ?? alt,
196
+ onClose: () => setOpen(false)
197
+ })] })]
198
+ }), caption ? /* @__PURE__ */ jsx("figcaption", {
199
+ className: "text-center text-sm text-pretty text-fd-muted-foreground",
200
+ children: caption
201
+ }) : null]
202
+ });
203
+ }
204
+ export { Image };
@@ -0,0 +1,14 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ // src/components/inline-text.tsx
3
+ /**
4
+ * Renders `code` in backticks inside text that arrives as a plain string, such as an MDX
5
+ * attribute, which MDX never parses as Markdown. Anything that is not a string passes through.
6
+ */
7
+ function InlineText({ children }) {
8
+ if (typeof children !== "string") return children;
9
+ return children.split(/(`[^`]+`)/).map((part, index) => part.startsWith("`") && part.endsWith("`") && part.length > 2 ? /* @__PURE__ */ jsx("code", {
10
+ className: "rounded-[5px] bg-fd-foreground/7 px-[0.3em] py-[0.1em] font-mono text-[0.9em] text-fd-foreground",
11
+ children: part.slice(1, -1)
12
+ }, index) : part);
13
+ }
14
+ export { InlineText };
@@ -0,0 +1,22 @@
1
+ import { Registry } from "../registry.js";
2
+ /**
3
+ * The install command for each package manager of a registry, one per tab. The reader's
4
+ * choice is saved and shared with every other `Install` and the home page.
5
+ *
6
+ * ```mdx
7
+ * <Install package="@wrksz/themes" />
8
+ * <Install package="vitest" dev />
9
+ * <Install package="ruff" registry="pypi" />
10
+ * ```
11
+ */
12
+ export declare function Install({ package: name, dev, registry }: {
13
+ /** Package to install, e.g. `@wrksz/themes`. */
14
+ package: string;
15
+ /** Install it as a development dependency. */
16
+ dev?: boolean;
17
+ /**
18
+ * Registry to install from: an id (`npm`, `pypi` or the site's own registry) or a
19
+ * registry object. Defaults to the site's package registry.
20
+ */
21
+ registry?: string | Registry;
22
+ }): import("react").JSX.Element;
@@ -0,0 +1,62 @@
1
+ "use client";
2
+ import { usePackageManager, usePmReady, writePm } from "../lib/package-manager.js";
3
+ import { findRegistry, installCommands } from "../registry.js";
4
+ import { useSite } from "../site-context.js";
5
+ import { CodeBody } from "./code-body.js";
6
+ import { CodeTabs } from "./code-tabs.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ // src/components/install.tsx
9
+ /** Colours a token through the same variables the highlighter sets. */
10
+ function tone(color) {
11
+ return {
12
+ "--hl-light": color,
13
+ "--hl-dark": color
14
+ };
15
+ }
16
+ /**
17
+ * The install command for each package manager of a registry, one per tab. The reader's
18
+ * choice is saved and shared with every other `Install` and the home page.
19
+ *
20
+ * ```mdx
21
+ * <Install package="@wrksz/themes" />
22
+ * <Install package="vitest" dev />
23
+ * <Install package="ruff" registry="pypi" />
24
+ * ```
25
+ */
26
+ function Install({ package: name, dev = false, registry }) {
27
+ const site = useSite();
28
+ const source = typeof registry === "string" ? findRegistry(registry, site.package.registry) : registry ?? site.package.registry;
29
+ if (!source) throw new Error(`<Install>: unknown registry "${String(registry)}".`);
30
+ const manager = usePackageManager(source);
31
+ const ready = usePmReady();
32
+ return /* @__PURE__ */ jsx(CodeTabs, {
33
+ label: "Package manager",
34
+ value: manager,
35
+ onValueChange: (value) => writePm(source, value),
36
+ persist: {
37
+ registry: source.id,
38
+ ready
39
+ },
40
+ tabs: installCommands(source, name, { dev }).map(({ manager: pm, command }) => {
41
+ const [binary = "", ...rest] = command.split(" ");
42
+ return {
43
+ value: pm,
44
+ label: pm,
45
+ content: /* @__PURE__ */ jsx(CodeBody, {
46
+ "data-language": "bash",
47
+ children: /* @__PURE__ */ jsxs("span", {
48
+ className: "line",
49
+ children: [/* @__PURE__ */ jsx("span", {
50
+ style: tone("var(--code-command)"),
51
+ children: binary
52
+ }), /* @__PURE__ */ jsxs("span", {
53
+ style: tone("var(--code-arg)"),
54
+ children: [" ", rest.join(" ")]
55
+ })]
56
+ })
57
+ })
58
+ };
59
+ })
60
+ });
61
+ }
62
+ export { Install };