@petrarca/sonnet-playground 0.2.0 → 0.4.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 (75) hide show
  1. package/README.md +142 -0
  2. package/dist/PlayAdvancedComponents-ZYK66UII.js +8 -0
  3. package/dist/PlayColorPalette-IWECRZUS.js +8 -0
  4. package/dist/PlayCoreComponents-GXFMB24T.js +8 -0
  5. package/dist/PlayDataComponents-M4SJ4XEL.js +8 -0
  6. package/dist/PlayFormComponents-4E2A2Y2W.js +8 -0
  7. package/dist/PlayFormWidgets-IWJJQ5XL.js +8 -0
  8. package/dist/PlayForms-FOF3XE6G.js +7 -0
  9. package/dist/PlayGraph-3F56PREG.js +7 -0
  10. package/dist/PlayJsonEditor-SYZYEJEA.js +7 -0
  11. package/dist/PlayShellApi-5O6VYR2X.js +8 -0
  12. package/dist/PlayShellApi-5O6VYR2X.js.map +1 -0
  13. package/dist/PlayTypography-T6SMPHUB.js +8 -0
  14. package/dist/PlayTypography-T6SMPHUB.js.map +1 -0
  15. package/dist/chunk-32DDRRWU.js +617 -0
  16. package/dist/chunk-32DDRRWU.js.map +1 -0
  17. package/dist/chunk-4Y4JFKAK.js +240 -0
  18. package/dist/chunk-4Y4JFKAK.js.map +1 -0
  19. package/dist/{chunk-QIETZUEN.js → chunk-6DZ3TSV4.js} +66 -71
  20. package/dist/chunk-6DZ3TSV4.js.map +1 -0
  21. package/dist/{chunk-CYNK2P2Q.js → chunk-7IBZEHLI.js} +14 -13
  22. package/dist/chunk-7IBZEHLI.js.map +1 -0
  23. package/dist/chunk-C2EZ2ECG.js +40 -0
  24. package/dist/chunk-C2EZ2ECG.js.map +1 -0
  25. package/dist/chunk-CQ6PGFRV.js +341 -0
  26. package/dist/chunk-CQ6PGFRV.js.map +1 -0
  27. package/dist/{chunk-A3IK3CVW.js → chunk-DA3BIB5N.js} +24 -25
  28. package/dist/{chunk-A3IK3CVW.js.map → chunk-DA3BIB5N.js.map} +1 -1
  29. package/dist/chunk-DZB6WFHA.js +401 -0
  30. package/dist/chunk-DZB6WFHA.js.map +1 -0
  31. package/dist/{chunk-KAT24CQQ.js → chunk-FZ3ZC7VM.js} +8 -6
  32. package/dist/chunk-FZ3ZC7VM.js.map +1 -0
  33. package/dist/{chunk-PGI54O43.js → chunk-VOC5VZG2.js} +84 -46
  34. package/dist/chunk-VOC5VZG2.js.map +1 -0
  35. package/dist/{chunk-TZGJH7YS.js → chunk-YEBK2TUW.js} +325 -331
  36. package/dist/chunk-YEBK2TUW.js.map +1 -0
  37. package/dist/chunk-YOOWJORD.js +934 -0
  38. package/dist/chunk-YOOWJORD.js.map +1 -0
  39. package/dist/index.d.ts +10 -6
  40. package/dist/index.js +41 -17
  41. package/dist/index.js.map +1 -1
  42. package/dist/pages/index.d.ts +15 -11
  43. package/dist/pages/index.js +20 -12
  44. package/package.json +6 -6
  45. package/dist/PlayColorPalette-UFMTJTUB.js +0 -8
  46. package/dist/PlayCoreComponents-7QCDFQLT.js +0 -7
  47. package/dist/PlayDataComponents-GZSRTW4F.js +0 -7
  48. package/dist/PlayFormComponents-RJB6WZHD.js +0 -7
  49. package/dist/PlayFormWidgets-OFV7TJKH.js +0 -7
  50. package/dist/PlayForms-24XX5DC6.js +0 -7
  51. package/dist/PlayGraph-FLGLSUWV.js +0 -8
  52. package/dist/PlayJsonEditor-4L5INQPU.js +0 -7
  53. package/dist/PlayTypography-ID6DLFZD.js +0 -8
  54. package/dist/chunk-5V27QDAY.js +0 -617
  55. package/dist/chunk-5V27QDAY.js.map +0 -1
  56. package/dist/chunk-CYNK2P2Q.js.map +0 -1
  57. package/dist/chunk-FTN2A5YL.js +0 -20
  58. package/dist/chunk-FTN2A5YL.js.map +0 -1
  59. package/dist/chunk-GYKEPHHA.js +0 -1154
  60. package/dist/chunk-GYKEPHHA.js.map +0 -1
  61. package/dist/chunk-KAT24CQQ.js.map +0 -1
  62. package/dist/chunk-P7I5IDXA.js +0 -432
  63. package/dist/chunk-P7I5IDXA.js.map +0 -1
  64. package/dist/chunk-PGI54O43.js.map +0 -1
  65. package/dist/chunk-QIETZUEN.js.map +0 -1
  66. package/dist/chunk-TZGJH7YS.js.map +0 -1
  67. /package/dist/{PlayColorPalette-UFMTJTUB.js.map → PlayAdvancedComponents-ZYK66UII.js.map} +0 -0
  68. /package/dist/{PlayCoreComponents-7QCDFQLT.js.map → PlayColorPalette-IWECRZUS.js.map} +0 -0
  69. /package/dist/{PlayDataComponents-GZSRTW4F.js.map → PlayCoreComponents-GXFMB24T.js.map} +0 -0
  70. /package/dist/{PlayFormComponents-RJB6WZHD.js.map → PlayDataComponents-M4SJ4XEL.js.map} +0 -0
  71. /package/dist/{PlayFormWidgets-OFV7TJKH.js.map → PlayFormComponents-4E2A2Y2W.js.map} +0 -0
  72. /package/dist/{PlayForms-24XX5DC6.js.map → PlayFormWidgets-IWJJQ5XL.js.map} +0 -0
  73. /package/dist/{PlayGraph-FLGLSUWV.js.map → PlayForms-FOF3XE6G.js.map} +0 -0
  74. /package/dist/{PlayJsonEditor-4L5INQPU.js.map → PlayGraph-3F56PREG.js.map} +0 -0
  75. /package/dist/{PlayTypography-ID6DLFZD.js.map → PlayJsonEditor-SYZYEJEA.js.map} +0 -0
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # @petrarca/sonnet-playground
2
+
3
+ Playground framework and built-in component demos for the Petrarca Sonnet
4
+ component library.
5
+
6
+ ## What's included
7
+
8
+ **Playground framework** — Registry, overview tile grid, and `createPlaygroundModule()`
9
+ factory. Wire a playground into any `sonnet-shell` app with a few lines.
10
+
11
+ **Built-in demos** — Pre-built showcase pages for all Sonnet components:
12
+ Typography, Color Palette, Core UI, Advanced Components, JSON Editor, Forms,
13
+ Form Components, Form Widgets, Data Components, Graph Visualization, Shell API.
14
+
15
+ **PlaygroundSection** — Shared section wrapper (`default` and `card` variants)
16
+ used by all playground pages.
17
+
18
+ ---
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ pnpm add @petrarca/sonnet-playground
24
+ ```
25
+
26
+ Peer dependencies: `react`, `react-dom`, `@petrarca/sonnet-shell`,
27
+ `@petrarca/sonnet-ui`, `@petrarca/sonnet-forms`, `@petrarca/sonnet-graph`.
28
+
29
+ ---
30
+
31
+ ## Basic usage
32
+
33
+ ```ts
34
+ // src/modules/playground/index.ts
35
+ import {
36
+ createPlaygroundRegistry,
37
+ createPlaygroundModule,
38
+ } from "@petrarca/sonnet-playground";
39
+
40
+ const registry = createPlaygroundRegistry();
41
+
42
+ // Optionally add app-specific pages:
43
+ registry.register({
44
+ id: "app.my-page",
45
+ title: "My Page",
46
+ description: "Custom demo page.",
47
+ icon: SomeIcon,
48
+ color: "teal",
49
+ path: "my-page",
50
+ component: React.lazy(() => import("./pages/MyPage")),
51
+ group: "App",
52
+ order: 0,
53
+ });
54
+
55
+ export default createPlaygroundModule(registry);
56
+ ```
57
+
58
+ ```ts
59
+ // src/modules/registry.ts
60
+ import { createModuleRegistry } from "@petrarca/sonnet-shell";
61
+ import home from "./home";
62
+ import playground from "./playground";
63
+
64
+ export const registry = createModuleRegistry([
65
+ home,
66
+ playground, // pinBottom: true is set automatically by createPlaygroundModule
67
+ ]);
68
+ ```
69
+
70
+ `createPlaygroundModule` returns a `ShellModule` — pass it directly to
71
+ `createModuleRegistry` alongside your app's own modules.
72
+
73
+ ---
74
+
75
+ ## Adding app-specific pages
76
+
77
+ Register your own pages alongside the built-in demos by calling
78
+ `registry.register()` before passing the registry to `createPlaygroundModule`.
79
+ Pages appear in the overview tile grid grouped under your chosen `group` label.
80
+
81
+ ```ts
82
+ // src/modules/playground/index.ts
83
+ import { lazy } from "react";
84
+ import { Search } from "lucide-react";
85
+ import {
86
+ createPlaygroundRegistry,
87
+ createPlaygroundModule,
88
+ } from "@petrarca/sonnet-playground";
89
+
90
+ const registry = createPlaygroundRegistry();
91
+
92
+ // Register app-specific pages
93
+ registry.register({
94
+ id: "app.my-widget",
95
+ title: "My Widget",
96
+ description: "Interactive demo of MyWidget with live configuration.",
97
+ icon: Search,
98
+ color: "teal",
99
+ path: "my-widget",
100
+ component: lazy(() => import("./pages/PlayMyWidget")),
101
+ group: "App Components", // appears as a group heading in the overview
102
+ order: 0,
103
+ });
104
+
105
+ export default createPlaygroundModule(registry);
106
+ ```
107
+
108
+ Pages are lazy-loaded automatically — wrap the component in `React.lazy()`
109
+ as shown above. The framework handles the `Suspense` boundary.
110
+
111
+ `group` is optional. Pages without a group appear under the default group in
112
+ the overview. Pages with the same `group` string are grouped together.
113
+
114
+ ---
115
+
116
+ ## Pages subpath
117
+
118
+ Individual built-in pages are available at `@petrarca/sonnet-playground/pages`
119
+ for consumers who want to cherry-pick or re-export them:
120
+
121
+ ```tsx
122
+ import { PlayTypography, PlayColorPalette } from "@petrarca/sonnet-playground/pages";
123
+ ```
124
+
125
+ ---
126
+
127
+ ## createPlaygroundModule options
128
+
129
+ | Option | Type | Default |
130
+ |---|---|---|
131
+ | `icon` | `LucideIcon` | `FlaskConical` |
132
+ | `label` | `string` | `"Playground"` |
133
+ | `basePath` | `string` | `"/playground"` |
134
+ | `overviewTitle` | `string` | `"Developer Playground"` |
135
+ | `overviewSubtitle` | `string` | `""` |
136
+ | `grouped` | `boolean` | `true` |
137
+
138
+ ---
139
+
140
+ ## License
141
+
142
+ See [LICENSE.md](../../LICENSE.md).
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayAdvancedComponents
3
+ } from "./chunk-4Y4JFKAK.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayAdvancedComponents as default
7
+ };
8
+ //# sourceMappingURL=PlayAdvancedComponents-ZYK66UII.js.map
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayColorPalette
3
+ } from "./chunk-DA3BIB5N.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayColorPalette as default
7
+ };
8
+ //# sourceMappingURL=PlayColorPalette-IWECRZUS.js.map
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayCoreComponents
3
+ } from "./chunk-YOOWJORD.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayCoreComponents as default
7
+ };
8
+ //# sourceMappingURL=PlayCoreComponents-GXFMB24T.js.map
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayDataComponents
3
+ } from "./chunk-YEBK2TUW.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayDataComponents as default
7
+ };
8
+ //# sourceMappingURL=PlayDataComponents-M4SJ4XEL.js.map
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayFormComponents
3
+ } from "./chunk-32DDRRWU.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayFormComponents as default
7
+ };
8
+ //# sourceMappingURL=PlayFormComponents-4E2A2Y2W.js.map
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayFormWidgets
3
+ } from "./chunk-DZB6WFHA.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayFormWidgets as default
7
+ };
8
+ //# sourceMappingURL=PlayFormWidgets-IWJJQ5XL.js.map
@@ -0,0 +1,7 @@
1
+ import {
2
+ PlayForms
3
+ } from "./chunk-6DZ3TSV4.js";
4
+ export {
5
+ PlayForms as default
6
+ };
7
+ //# sourceMappingURL=PlayForms-FOF3XE6G.js.map
@@ -0,0 +1,7 @@
1
+ import {
2
+ PlayGraph
3
+ } from "./chunk-VOC5VZG2.js";
4
+ export {
5
+ PlayGraph as default
6
+ };
7
+ //# sourceMappingURL=PlayGraph-3F56PREG.js.map
@@ -0,0 +1,7 @@
1
+ import {
2
+ PlayJsonEditor
3
+ } from "./chunk-FZ3ZC7VM.js";
4
+ export {
5
+ PlayJsonEditor as default
6
+ };
7
+ //# sourceMappingURL=PlayJsonEditor-SYZYEJEA.js.map
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayShellApi
3
+ } from "./chunk-CQ6PGFRV.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayShellApi as default
7
+ };
8
+ //# sourceMappingURL=PlayShellApi-5O6VYR2X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ PlayTypography
3
+ } from "./chunk-7IBZEHLI.js";
4
+ import "./chunk-C2EZ2ECG.js";
5
+ export {
6
+ PlayTypography as default
7
+ };
8
+ //# sourceMappingURL=PlayTypography-T6SMPHUB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}