@silvery/examples 0.17.4 → 0.17.5

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 (62) hide show
  1. package/dist/_banner-A70_y2Vi.mjs +43 -0
  2. package/dist/{ansi-CCE2pVS0.mjs → ansi-0VXlUmNn.mjs} +7 -7
  3. package/dist/apng-B0gRaDVT.mjs +3 -0
  4. package/dist/{apng-HhhBjRGt.mjs → apng-BTRDTfDW.mjs} +2 -2
  5. package/dist/apps/aichat/index.mjs +69 -70
  6. package/dist/apps/app-todo.mjs +19 -20
  7. package/dist/apps/async-data.mjs +40 -41
  8. package/dist/apps/cli-wizard.mjs +51 -52
  9. package/dist/apps/clipboard.mjs +26 -27
  10. package/dist/apps/components.mjs +189 -190
  11. package/dist/apps/data-explorer.mjs +52 -53
  12. package/dist/apps/dev-tools.mjs +39 -40
  13. package/dist/apps/explorer.mjs +73 -74
  14. package/dist/apps/gallery.mjs +61 -62
  15. package/dist/apps/inline-bench.mjs +1 -1
  16. package/dist/apps/kanban.mjs +22 -23
  17. package/dist/apps/layout-ref.mjs +27 -28
  18. package/dist/apps/outline.mjs +35 -36
  19. package/dist/apps/paste-demo.mjs +33 -34
  20. package/dist/apps/scroll.mjs +11 -12
  21. package/dist/apps/search-filter.mjs +23 -24
  22. package/dist/apps/selection.mjs +30 -31
  23. package/dist/apps/spatial-focus-demo.mjs +32 -33
  24. package/dist/apps/task-list.mjs +25 -26
  25. package/dist/apps/terminal-caps-demo.mjs +30 -31
  26. package/dist/apps/terminal.mjs +157 -158
  27. package/dist/apps/text-selection-demo.mjs +62 -63
  28. package/dist/apps/textarea.mjs +21 -22
  29. package/dist/apps/theme.mjs +142 -143
  30. package/dist/apps/transform.mjs +25 -26
  31. package/dist/apps/virtual-10k.mjs +52 -53
  32. package/dist/{backends-Bahh9mKN.mjs → backends-Dj-11kZF.mjs} +1 -1
  33. package/dist/backends-U3QwStfO.mjs +3 -0
  34. package/dist/components/counter.mjs +6 -7
  35. package/dist/components/hello.mjs +5 -6
  36. package/dist/components/progress-bar.mjs +10 -11
  37. package/dist/components/select-list.mjs +8 -9
  38. package/dist/components/spinner.mjs +10 -11
  39. package/dist/components/text-input.mjs +8 -9
  40. package/dist/components/virtual-list.mjs +7 -8
  41. package/dist/{flexily-zero-adapter-UB-ra8fR.mjs → flexily-zero-adapter-ByVzLTFP.mjs} +1 -1
  42. package/dist/gif-B6NGH5gs.mjs +3 -0
  43. package/dist/{gif-BtnXuxLF.mjs → gif-CfkOF-iG.mjs} +2 -2
  44. package/dist/layout/dashboard.mjs +197 -198
  45. package/dist/layout/live-resize.mjs +44 -45
  46. package/dist/layout/overflow.mjs +16 -17
  47. package/dist/layout/text-layout.mjs +67 -68
  48. package/dist/{plugins-D1KtkT4a.mjs → plugins-CT0DdV_E.mjs} +12 -13
  49. package/dist/{src-BTEVGpd9.mjs → src-jO3Zuzjj.mjs} +3 -3
  50. package/dist/{yoga-adapter-BVtQ5OJR.mjs → yoga-adapter-BSQHuMV9.mjs} +1 -1
  51. package/package.json +4 -2
  52. package/dist/_banner-DLPxCqVy.mjs +0 -44
  53. package/dist/apng-mwUQbTTF.mjs +0 -3
  54. package/dist/backends-CCtCDQ94.mjs +0 -3
  55. package/dist/gif-BZaqPPVX.mjs +0 -3
  56. package/dist/jsx-runtime-dMs_8fNu.mjs +0 -241
  57. /package/dist/{UPNG-Cy7ViL8f.mjs → UPNG-ShUlaTDh.mjs} +0 -0
  58. /package/dist/{__vite-browser-external-2447137e-BML7CYau.mjs → __vite-browser-external-2447137e-Bopa5BFR.mjs} +0 -0
  59. /package/dist/{gifenc-CLRW41dk.mjs → gifenc-BI4ihP_T.mjs} +0 -0
  60. /package/dist/{node-NuJ94BWl.mjs → node-nsrAOjH4.mjs} +0 -0
  61. /package/dist/{resvg-js-C_8Wps1F.mjs → resvg-js-Cnk2o49d.mjs} +0 -0
  62. /package/dist/{src-CzfRafCQ.mjs → src-9ZhfQyzD.mjs} +0 -0
@@ -1,44 +1,43 @@
1
- import { t as require_jsx_runtime } from "../jsx-runtime-dMs_8fNu.mjs";
2
1
  import "react";
3
2
  import { Box, Spinner, Text } from "silvery";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { run, useInput as useInput$1 } from "silvery/runtime";
5
5
  //#region components/spinner.tsx
6
- var import_jsx_runtime = require_jsx_runtime();
7
6
  function SpinnerDemo() {
8
7
  useInput$1((input, key) => {
9
8
  if (input === "q" || key.escape) return "exit";
10
9
  });
11
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
10
+ return /* @__PURE__ */ jsxs(Box, {
12
11
  flexDirection: "column",
13
12
  padding: 1,
14
13
  gap: 1,
15
14
  children: [
16
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
15
+ /* @__PURE__ */ jsx(Text, {
17
16
  bold: true,
18
17
  children: "Spinner Styles"
19
18
  }),
20
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
19
+ /* @__PURE__ */ jsxs(Box, {
21
20
  flexDirection: "column",
22
21
  children: [
23
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {
22
+ /* @__PURE__ */ jsx(Spinner, {
24
23
  type: "dots",
25
24
  label: "Loading packages..."
26
25
  }),
27
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {
26
+ /* @__PURE__ */ jsx(Spinner, {
28
27
  type: "line",
29
28
  label: "Compiling..."
30
29
  }),
31
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {
30
+ /* @__PURE__ */ jsx(Spinner, {
32
31
  type: "arc",
33
32
  label: "Optimizing..."
34
33
  }),
35
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {
34
+ /* @__PURE__ */ jsx(Spinner, {
36
35
  type: "bounce",
37
36
  label: "Connecting..."
38
37
  })
39
38
  ]
40
39
  }),
41
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
40
+ /* @__PURE__ */ jsx(Text, {
42
41
  color: "$muted",
43
42
  children: "q: quit"
44
43
  })
@@ -50,7 +49,7 @@ const meta = {
50
49
  description: "Four animated loading spinner styles"
51
50
  };
52
51
  async function main() {
53
- await (await run(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpinnerDemo, {}))).waitUntilExit();
52
+ await (await run(/* @__PURE__ */ jsx(SpinnerDemo, {}))).waitUntilExit();
54
53
  }
55
54
  if (import.meta.main) await main();
56
55
  //#endregion
@@ -1,6 +1,6 @@
1
- import { t as require_jsx_runtime } from "../jsx-runtime-dMs_8fNu.mjs";
2
1
  import { useState } from "react";
3
2
  import { Box, Text, TextInput } from "silvery";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { run, useInput as useInput$1 } from "silvery/runtime";
5
5
  //#region components/text-input.tsx
6
6
  /**
@@ -11,19 +11,18 @@ import { run, useInput as useInput$1 } from "silvery/runtime";
11
11
  *
12
12
  * Usage: bun examples/components/text-input.tsx
13
13
  */
14
- var import_jsx_runtime = require_jsx_runtime();
15
14
  function TextInputDemo() {
16
15
  const [value, setValue] = useState("");
17
16
  const [submitted, setSubmitted] = useState([]);
18
17
  useInput$1((_, key) => {
19
18
  if (key.escape) return "exit";
20
19
  });
21
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
20
+ return /* @__PURE__ */ jsxs(Box, {
22
21
  flexDirection: "column",
23
22
  padding: 1,
24
23
  gap: 1,
25
24
  children: [
26
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextInput, {
25
+ /* @__PURE__ */ jsx(TextInput, {
27
26
  value,
28
27
  onChange: setValue,
29
28
  onSubmit: (val) => {
@@ -33,17 +32,17 @@ function TextInputDemo() {
33
32
  placeholder: "Type something and press Enter...",
34
33
  prompt: "> "
35
34
  }),
36
- submitted.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
35
+ submitted.length > 0 && /* @__PURE__ */ jsxs(Box, {
37
36
  flexDirection: "column",
38
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
37
+ children: [/* @__PURE__ */ jsx(Text, {
39
38
  color: "$muted",
40
39
  children: "Submitted:"
41
- }), submitted.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
40
+ }), submitted.map((s, i) => /* @__PURE__ */ jsx(Text, {
42
41
  color: "$success",
43
42
  children: s
44
43
  }, i))]
45
44
  }),
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
45
+ /* @__PURE__ */ jsx(Text, {
47
46
  color: "$muted",
48
47
  children: "Enter: submit Esc: quit"
49
48
  })
@@ -55,7 +54,7 @@ const meta = {
55
54
  description: "Single-line text entry with readline keybindings"
56
55
  };
57
56
  async function main() {
58
- await (await run(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextInputDemo, {}))).waitUntilExit();
57
+ await (await run(/* @__PURE__ */ jsx(TextInputDemo, {}))).waitUntilExit();
59
58
  }
60
59
  if (import.meta.main) await main();
61
60
  //#endregion
@@ -1,9 +1,8 @@
1
- import { t as require_jsx_runtime } from "../jsx-runtime-dMs_8fNu.mjs";
2
1
  import "react";
3
2
  import { Box, ListView, Text } from "silvery";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { run, useInput as useInput$1 } from "silvery/runtime";
5
5
  //#region components/virtual-list.tsx
6
- var import_jsx_runtime = require_jsx_runtime();
7
6
  const items = Array.from({ length: 200 }, (_, i) => ({
8
7
  id: i,
9
8
  name: `Item ${i + 1}`
@@ -12,27 +11,27 @@ function ListViewDemo() {
12
11
  useInput$1((input, key) => {
13
12
  if (input === "q" || key.escape) return "exit";
14
13
  });
15
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
14
+ return /* @__PURE__ */ jsxs(Box, {
16
15
  flexDirection: "column",
17
16
  padding: 1,
18
17
  gap: 1,
19
18
  children: [
20
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
19
+ /* @__PURE__ */ jsx(Text, {
21
20
  bold: true,
22
21
  children: "200 items (virtualized)"
23
22
  }),
24
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListView, {
23
+ /* @__PURE__ */ jsx(ListView, {
25
24
  items,
26
25
  height: 12,
27
26
  estimateHeight: 1,
28
27
  nav: true,
29
- renderItem: (item, _index, meta) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
28
+ renderItem: (item, _index, meta) => /* @__PURE__ */ jsxs(Text, {
30
29
  color: meta.isCursor ? "$primary" : void 0,
31
30
  bold: meta.isCursor,
32
31
  children: [meta.isCursor ? "> " : " ", item.name]
33
32
  }, item.id)
34
33
  }),
35
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
34
+ /* @__PURE__ */ jsx(Text, {
36
35
  color: "$muted",
37
36
  children: "j/k: navigate q: quit"
38
37
  })
@@ -44,7 +43,7 @@ const meta = {
44
43
  description: "Efficient scrollable list with 200 virtualized items"
45
44
  };
46
45
  async function main() {
47
- await (await run(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListViewDemo, {}))).waitUntilExit();
46
+ await (await run(/* @__PURE__ */ jsx(ListViewDemo, {}))).waitUntilExit();
48
47
  }
49
48
  if (import.meta.main) await main();
50
49
  //#endregion
@@ -169,7 +169,7 @@ function applyMinMax(size, min, max, available) {
169
169
  let _logger = null;
170
170
  async function createFallbackLogger(namespace) {
171
171
  try {
172
- const { default: createDebug } = await import("./src-CzfRafCQ.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
172
+ const { default: createDebug } = await import("./src-9ZhfQyzD.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
173
173
  const debug = createDebug(namespace);
174
174
  return { debug: debug.enabled ? debug : void 0 };
175
175
  } catch {
@@ -0,0 +1,3 @@
1
+ import { n as init_gif, t as createGif } from "./gif-CfkOF-iG.mjs";
2
+ init_gif();
3
+ export { createGif };
@@ -3,7 +3,7 @@ import { n as __esmMin, o as __toESM } from "./chunk-BSw8zbkd.mjs";
3
3
  async function loadGifenc() {
4
4
  if (gifencModule) return gifencModule;
5
5
  try {
6
- gifencModule = await import("./gifenc-CLRW41dk.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
6
+ gifencModule = await import("./gifenc-BI4ihP_T.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
7
7
  return gifencModule;
8
8
  } catch {
9
9
  throw new Error("createGif() requires gifenc. Install it:\n bun add gifenc");
@@ -12,7 +12,7 @@ async function loadGifenc() {
12
12
  async function loadResvg() {
13
13
  if (resvgModule) return resvgModule;
14
14
  try {
15
- resvgModule = await import("./resvg-js-C_8Wps1F.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
15
+ resvgModule = await import("./resvg-js-Cnk2o49d.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
16
16
  return resvgModule;
17
17
  } catch {
18
18
  throw new Error("createGif() requires @resvg/resvg-js. Install it:\n bun add @resvg/resvg-js");