@petrarca/sonnet-playground 0.1.2
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/PlayColorPalette-UFMTJTUB.js +8 -0
- package/dist/PlayColorPalette-UFMTJTUB.js.map +1 -0
- package/dist/PlayCoreComponents-7QCDFQLT.js +7 -0
- package/dist/PlayCoreComponents-7QCDFQLT.js.map +1 -0
- package/dist/PlayDataComponents-GZSRTW4F.js +7 -0
- package/dist/PlayDataComponents-GZSRTW4F.js.map +1 -0
- package/dist/PlayFormComponents-RJB6WZHD.js +7 -0
- package/dist/PlayFormComponents-RJB6WZHD.js.map +1 -0
- package/dist/PlayFormWidgets-OFV7TJKH.js +7 -0
- package/dist/PlayFormWidgets-OFV7TJKH.js.map +1 -0
- package/dist/PlayForms-24XX5DC6.js +7 -0
- package/dist/PlayForms-24XX5DC6.js.map +1 -0
- package/dist/PlayJsonEditor-4L5INQPU.js +7 -0
- package/dist/PlayJsonEditor-4L5INQPU.js.map +1 -0
- package/dist/PlayTypography-ID6DLFZD.js +8 -0
- package/dist/PlayTypography-ID6DLFZD.js.map +1 -0
- package/dist/chunk-5V27QDAY.js +617 -0
- package/dist/chunk-5V27QDAY.js.map +1 -0
- package/dist/chunk-A3IK3CVW.js +212 -0
- package/dist/chunk-A3IK3CVW.js.map +1 -0
- package/dist/chunk-CYNK2P2Q.js +411 -0
- package/dist/chunk-CYNK2P2Q.js.map +1 -0
- package/dist/chunk-FTN2A5YL.js +20 -0
- package/dist/chunk-FTN2A5YL.js.map +1 -0
- package/dist/chunk-GYKEPHHA.js +1154 -0
- package/dist/chunk-GYKEPHHA.js.map +1 -0
- package/dist/chunk-KAT24CQQ.js +125 -0
- package/dist/chunk-KAT24CQQ.js.map +1 -0
- package/dist/chunk-P7I5IDXA.js +432 -0
- package/dist/chunk-P7I5IDXA.js.map +1 -0
- package/dist/chunk-QIETZUEN.js +885 -0
- package/dist/chunk-QIETZUEN.js.map +1 -0
- package/dist/chunk-TZGJH7YS.js +837 -0
- package/dist/chunk-TZGJH7YS.js.map +1 -0
- package/dist/index.d.ts +160 -0
- package/dist/index.js +328 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/index.d.ts +69 -0
- package/dist/pages/index.js +36 -0
- package/dist/pages/index.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
// src/pages/PlayFormWidgets.tsx
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { SimpleStack, Card } from "@petrarca/sonnet-ui";
|
|
4
|
+
import {
|
|
5
|
+
TextInputWidget,
|
|
6
|
+
TextareaWidget,
|
|
7
|
+
NumberWidget,
|
|
8
|
+
CheckboxWidget,
|
|
9
|
+
SelectWidget,
|
|
10
|
+
QuantityWidget,
|
|
11
|
+
DEFAULT_WIDGETS
|
|
12
|
+
} from "@petrarca/sonnet-forms";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function PlayFormWidgets() {
|
|
15
|
+
const [textValue, setTextValue] = useState("");
|
|
16
|
+
const [textareaValue, setTextareaValue] = useState("");
|
|
17
|
+
const [numberValue, setNumberValue] = useState(void 0);
|
|
18
|
+
const [checkboxValue, setCheckboxValue] = useState(false);
|
|
19
|
+
const [selectValue, setSelectValue] = useState("");
|
|
20
|
+
const [multiSelectValue, setMultiSelectValue] = useState([]);
|
|
21
|
+
const [multiSelectColorValue, setMultiSelectColorValue] = useState(
|
|
22
|
+
[]
|
|
23
|
+
);
|
|
24
|
+
const [tempValue, setTempValue] = useState({
|
|
25
|
+
value: 37,
|
|
26
|
+
unit: "degC"
|
|
27
|
+
});
|
|
28
|
+
const [weightValue, setWeightValue] = useState({
|
|
29
|
+
value: void 0,
|
|
30
|
+
unit: "kg"
|
|
31
|
+
});
|
|
32
|
+
const [bpValue, setBpValue] = useState({
|
|
33
|
+
value: 72,
|
|
34
|
+
unit: "bpm"
|
|
35
|
+
});
|
|
36
|
+
const [priceValue, setPriceValue] = useState({
|
|
37
|
+
value: 49.99,
|
|
38
|
+
unit: "EUR"
|
|
39
|
+
});
|
|
40
|
+
const onTextChange = useCallback(
|
|
41
|
+
(v) => setTextValue(typeof v === "string" ? v : ""),
|
|
42
|
+
[]
|
|
43
|
+
);
|
|
44
|
+
const onTextareaChange = useCallback(
|
|
45
|
+
(v) => setTextareaValue(typeof v === "string" ? v : ""),
|
|
46
|
+
[]
|
|
47
|
+
);
|
|
48
|
+
const onNumberChange = useCallback(
|
|
49
|
+
(v) => setNumberValue(typeof v === "number" ? v : void 0),
|
|
50
|
+
[]
|
|
51
|
+
);
|
|
52
|
+
const onCheckboxChange = useCallback(
|
|
53
|
+
(v) => setCheckboxValue(typeof v === "boolean" ? v : false),
|
|
54
|
+
[]
|
|
55
|
+
);
|
|
56
|
+
const onSelectChange = useCallback(
|
|
57
|
+
(v) => setSelectValue(typeof v === "string" ? v : ""),
|
|
58
|
+
[]
|
|
59
|
+
);
|
|
60
|
+
const onMultiSelectChange = useCallback(
|
|
61
|
+
(v) => setMultiSelectValue(Array.isArray(v) ? v : []),
|
|
62
|
+
[]
|
|
63
|
+
);
|
|
64
|
+
const onMultiSelectColorChange = useCallback(
|
|
65
|
+
(v) => setMultiSelectColorValue(Array.isArray(v) ? v : []),
|
|
66
|
+
[]
|
|
67
|
+
);
|
|
68
|
+
const onTempChange = useCallback((v) => {
|
|
69
|
+
if (v != null && typeof v === "object" && !Array.isArray(v)) {
|
|
70
|
+
setTempValue(v);
|
|
71
|
+
}
|
|
72
|
+
}, []);
|
|
73
|
+
const onWeightChange = useCallback((v) => {
|
|
74
|
+
if (v != null && typeof v === "object" && !Array.isArray(v)) {
|
|
75
|
+
setWeightValue(v);
|
|
76
|
+
}
|
|
77
|
+
}, []);
|
|
78
|
+
const onBpChange = useCallback((v) => {
|
|
79
|
+
if (v != null && typeof v === "object" && !Array.isArray(v)) {
|
|
80
|
+
setBpValue(v);
|
|
81
|
+
}
|
|
82
|
+
}, []);
|
|
83
|
+
const onPriceChange = useCallback((v) => {
|
|
84
|
+
if (v != null && typeof v === "object" && !Array.isArray(v)) {
|
|
85
|
+
setPriceValue(v);
|
|
86
|
+
}
|
|
87
|
+
}, []);
|
|
88
|
+
const dummySchema = {
|
|
89
|
+
title: "Form Widgets Demo",
|
|
90
|
+
type: "object",
|
|
91
|
+
properties: {},
|
|
92
|
+
"x-entity": {
|
|
93
|
+
type: "entity",
|
|
94
|
+
label: "Demo",
|
|
95
|
+
relations: []
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ jsxs(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
style: {
|
|
102
|
+
width: "100%",
|
|
103
|
+
height: "100vh",
|
|
104
|
+
display: "flex",
|
|
105
|
+
flexDirection: "column",
|
|
106
|
+
overflow: "hidden"
|
|
107
|
+
},
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { style: { padding: "1rem 1rem 0 1rem" }, children: [
|
|
110
|
+
/* @__PURE__ */ jsx("h1", { children: "Basic Form Widgets Playground" }),
|
|
111
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-3", children: "Interactive demonstration of all basic form widgets" })
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: "0 1rem 1rem 1rem" }, children: /* @__PURE__ */ jsxs(SimpleStack, { gap: "md", style: { maxWidth: "900px" }, children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Card, { className: "border shadow-sm p-4", children: /* @__PURE__ */ jsxs(SimpleStack, { gap: "sm", children: [
|
|
115
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: "TextInputWidget" }),
|
|
116
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Single-line text input with support for various HTML input types (text, email, password, url, etc.)" }),
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
TextInputWidget,
|
|
119
|
+
{
|
|
120
|
+
id: "text-input-demo",
|
|
121
|
+
name: "textInput",
|
|
122
|
+
value: textValue,
|
|
123
|
+
onChange: onTextChange,
|
|
124
|
+
label: "Text Input",
|
|
125
|
+
description: "Enter some text",
|
|
126
|
+
placeholder: "Type here...",
|
|
127
|
+
propertySchema: { type: "string" },
|
|
128
|
+
schema: dummySchema,
|
|
129
|
+
registry: DEFAULT_WIDGETS
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
TextInputWidget,
|
|
134
|
+
{
|
|
135
|
+
id: "text-input-email",
|
|
136
|
+
name: "emailInput",
|
|
137
|
+
value: textValue,
|
|
138
|
+
onChange: onTextChange,
|
|
139
|
+
label: "Email Input",
|
|
140
|
+
description: "Input type: email",
|
|
141
|
+
placeholder: "user@example.com",
|
|
142
|
+
propertySchema: { type: "string", format: "email" },
|
|
143
|
+
schema: dummySchema,
|
|
144
|
+
registry: DEFAULT_WIDGETS,
|
|
145
|
+
options: { inputType: "email" }
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify({ value: textValue }, null, 2) }) })
|
|
149
|
+
] }) }),
|
|
150
|
+
/* @__PURE__ */ jsx(Card, { className: "border shadow-sm p-4", children: /* @__PURE__ */ jsxs(SimpleStack, { gap: "sm", children: [
|
|
151
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: "TextareaWidget" }),
|
|
152
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Multi-line text input with configurable rows and autosize support" }),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
TextareaWidget,
|
|
155
|
+
{
|
|
156
|
+
id: "textarea-demo",
|
|
157
|
+
name: "textarea",
|
|
158
|
+
value: textareaValue,
|
|
159
|
+
onChange: onTextareaChange,
|
|
160
|
+
label: "Textarea",
|
|
161
|
+
description: "Enter multiple lines",
|
|
162
|
+
placeholder: "Type here...",
|
|
163
|
+
propertySchema: { type: "string" },
|
|
164
|
+
schema: dummySchema,
|
|
165
|
+
registry: DEFAULT_WIDGETS,
|
|
166
|
+
options: { rows: 4 }
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify({ value: textareaValue }, null, 2) }) })
|
|
170
|
+
] }) }),
|
|
171
|
+
/* @__PURE__ */ jsx(Card, { className: "border shadow-sm p-4", children: /* @__PURE__ */ jsxs(SimpleStack, { gap: "sm", children: [
|
|
172
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: "NumberWidget" }),
|
|
173
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Number input with support for min, max, and step constraints" }),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
NumberWidget,
|
|
176
|
+
{
|
|
177
|
+
id: "number-demo",
|
|
178
|
+
name: "number",
|
|
179
|
+
value: numberValue,
|
|
180
|
+
onChange: onNumberChange,
|
|
181
|
+
label: "Number Input",
|
|
182
|
+
description: "Enter a number (0-100, step: 5)",
|
|
183
|
+
placeholder: "0",
|
|
184
|
+
propertySchema: { type: "number", minimum: 0, maximum: 100 },
|
|
185
|
+
schema: dummySchema,
|
|
186
|
+
registry: DEFAULT_WIDGETS,
|
|
187
|
+
options: { step: 5 }
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify({ value: numberValue }, null, 2) }) })
|
|
191
|
+
] }) }),
|
|
192
|
+
/* @__PURE__ */ jsx(Card, { className: "border shadow-sm p-4", children: /* @__PURE__ */ jsxs(SimpleStack, { gap: "sm", children: [
|
|
193
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: "CheckboxWidget" }),
|
|
194
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Boolean checkbox for true/false values" }),
|
|
195
|
+
/* @__PURE__ */ jsx(
|
|
196
|
+
CheckboxWidget,
|
|
197
|
+
{
|
|
198
|
+
id: "checkbox-demo",
|
|
199
|
+
name: "checkbox",
|
|
200
|
+
value: checkboxValue,
|
|
201
|
+
onChange: onCheckboxChange,
|
|
202
|
+
label: "Enable Feature",
|
|
203
|
+
description: "Check to enable",
|
|
204
|
+
propertySchema: { type: "boolean" },
|
|
205
|
+
schema: dummySchema,
|
|
206
|
+
registry: DEFAULT_WIDGETS
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify({ value: checkboxValue }, null, 2) }) })
|
|
210
|
+
] }) }),
|
|
211
|
+
/* @__PURE__ */ jsx(Card, { className: "border shadow-sm p-4", children: /* @__PURE__ */ jsxs(SimpleStack, { gap: "sm", children: [
|
|
212
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: "SelectWidget" }),
|
|
213
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Dropdown select for enum values with single-select, multi-select, and custom badge colors" }),
|
|
214
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
215
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-1", children: "Single Select" }),
|
|
216
|
+
/* @__PURE__ */ jsx(
|
|
217
|
+
SelectWidget,
|
|
218
|
+
{
|
|
219
|
+
id: "select-demo",
|
|
220
|
+
name: "select",
|
|
221
|
+
value: selectValue,
|
|
222
|
+
onChange: onSelectChange,
|
|
223
|
+
label: "Select Status",
|
|
224
|
+
description: "Choose a status",
|
|
225
|
+
placeholder: "Select one...",
|
|
226
|
+
propertySchema: {
|
|
227
|
+
type: "string",
|
|
228
|
+
enum: ["active", "inactive", "pending", "archived"]
|
|
229
|
+
},
|
|
230
|
+
schema: dummySchema,
|
|
231
|
+
registry: DEFAULT_WIDGETS,
|
|
232
|
+
options: {
|
|
233
|
+
enumNames: {
|
|
234
|
+
active: "Active",
|
|
235
|
+
inactive: "Inactive",
|
|
236
|
+
pending: "Pending",
|
|
237
|
+
archived: "Archived"
|
|
238
|
+
},
|
|
239
|
+
searchable: true,
|
|
240
|
+
clearable: true
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify({ value: selectValue }, null, 2) }) })
|
|
245
|
+
] }),
|
|
246
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
247
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-1", children: "Multi Select (auto-enabled when type is 'array')" }),
|
|
248
|
+
/* @__PURE__ */ jsx(
|
|
249
|
+
SelectWidget,
|
|
250
|
+
{
|
|
251
|
+
id: "multiselect-demo",
|
|
252
|
+
name: "multiselect",
|
|
253
|
+
value: multiSelectValue,
|
|
254
|
+
onChange: onMultiSelectChange,
|
|
255
|
+
label: "Select Tags",
|
|
256
|
+
description: "Choose multiple tags",
|
|
257
|
+
placeholder: "Select tags...",
|
|
258
|
+
propertySchema: {
|
|
259
|
+
type: "array",
|
|
260
|
+
items: { type: "string" },
|
|
261
|
+
enum: [
|
|
262
|
+
"frontend",
|
|
263
|
+
"backend",
|
|
264
|
+
"database",
|
|
265
|
+
"devops",
|
|
266
|
+
"testing",
|
|
267
|
+
"security"
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
schema: dummySchema,
|
|
271
|
+
registry: DEFAULT_WIDGETS,
|
|
272
|
+
options: { searchable: true, clearable: true }
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify({ value: multiSelectValue }, null, 2) }) })
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
278
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-1", children: "Multi Select with Custom Badge Color" }),
|
|
279
|
+
/* @__PURE__ */ jsx(
|
|
280
|
+
SelectWidget,
|
|
281
|
+
{
|
|
282
|
+
id: "multiselect-color-demo",
|
|
283
|
+
name: "multiselectColor",
|
|
284
|
+
value: multiSelectColorValue,
|
|
285
|
+
onChange: onMultiSelectColorChange,
|
|
286
|
+
label: "Select Categories",
|
|
287
|
+
description: "Custom grape-colored badges",
|
|
288
|
+
placeholder: "Select categories...",
|
|
289
|
+
propertySchema: {
|
|
290
|
+
type: "array",
|
|
291
|
+
items: { type: "string" },
|
|
292
|
+
enum: [
|
|
293
|
+
"feature",
|
|
294
|
+
"bugfix",
|
|
295
|
+
"enhancement",
|
|
296
|
+
"documentation",
|
|
297
|
+
"refactor"
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
schema: dummySchema,
|
|
301
|
+
registry: DEFAULT_WIDGETS,
|
|
302
|
+
options: {
|
|
303
|
+
searchable: true,
|
|
304
|
+
clearable: true,
|
|
305
|
+
badgeColor: "grape",
|
|
306
|
+
enumNames: {
|
|
307
|
+
feature: "Feature",
|
|
308
|
+
bugfix: "Bug Fix",
|
|
309
|
+
enhancement: "Enhancement",
|
|
310
|
+
documentation: "Documentation",
|
|
311
|
+
refactor: "Refactor"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify({ value: multiSelectColorValue }, null, 2) }) })
|
|
317
|
+
] })
|
|
318
|
+
] }) }),
|
|
319
|
+
/* @__PURE__ */ jsx(Card, { className: "border shadow-sm p-4", children: /* @__PURE__ */ jsxs(SimpleStack, { gap: "sm", children: [
|
|
320
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: "QuantityWidget" }),
|
|
321
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Compound numeric value + unit selector. Multi-unit shows a dropdown, single-unit shows static text, prefix mode places the unit before the value." }),
|
|
322
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
323
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-1", children: "Multi-unit suffix (Temperature)" }),
|
|
324
|
+
/* @__PURE__ */ jsx(
|
|
325
|
+
QuantityWidget,
|
|
326
|
+
{
|
|
327
|
+
id: "quantity-temp",
|
|
328
|
+
name: "temperature",
|
|
329
|
+
value: tempValue,
|
|
330
|
+
onChange: onTempChange,
|
|
331
|
+
label: "Temperature",
|
|
332
|
+
description: "Body temperature with per-unit validation",
|
|
333
|
+
placeholder: "0.0",
|
|
334
|
+
propertySchema: { type: "object" },
|
|
335
|
+
schema: dummySchema,
|
|
336
|
+
registry: DEFAULT_WIDGETS,
|
|
337
|
+
options: {
|
|
338
|
+
precision: 1,
|
|
339
|
+
units: [
|
|
340
|
+
{ value: "degC", label: "C", min: 35, max: 42 },
|
|
341
|
+
{ value: "degF", label: "F", min: 95, max: 108 }
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify(tempValue, null, 2) }) })
|
|
347
|
+
] }),
|
|
348
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
349
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-1", children: "Single-unit suffix (Weight) -- unit shown as static text" }),
|
|
350
|
+
/* @__PURE__ */ jsx(
|
|
351
|
+
QuantityWidget,
|
|
352
|
+
{
|
|
353
|
+
id: "quantity-weight",
|
|
354
|
+
name: "weight",
|
|
355
|
+
value: weightValue,
|
|
356
|
+
onChange: onWeightChange,
|
|
357
|
+
label: "Weight",
|
|
358
|
+
description: "Single unit, global min/max from schema",
|
|
359
|
+
placeholder: "0",
|
|
360
|
+
propertySchema: { type: "object", minimum: 0, maximum: 500 },
|
|
361
|
+
schema: dummySchema,
|
|
362
|
+
registry: DEFAULT_WIDGETS,
|
|
363
|
+
options: {
|
|
364
|
+
precision: 1,
|
|
365
|
+
units: [{ value: "kg", label: "kg" }]
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify(weightValue, null, 2) }) })
|
|
370
|
+
] }),
|
|
371
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
372
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-1", children: "Integer mode (Heart Rate)" }),
|
|
373
|
+
/* @__PURE__ */ jsx(
|
|
374
|
+
QuantityWidget,
|
|
375
|
+
{
|
|
376
|
+
id: "quantity-hr",
|
|
377
|
+
name: "heartRate",
|
|
378
|
+
value: bpValue,
|
|
379
|
+
onChange: onBpChange,
|
|
380
|
+
label: "Heart Rate",
|
|
381
|
+
description: "Integer with per-unit validation (30-250 bpm)",
|
|
382
|
+
placeholder: "0",
|
|
383
|
+
propertySchema: { type: "object" },
|
|
384
|
+
schema: dummySchema,
|
|
385
|
+
registry: DEFAULT_WIDGETS,
|
|
386
|
+
options: {
|
|
387
|
+
precision: 0,
|
|
388
|
+
units: [{ value: "bpm", label: "bpm", min: 30, max: 250 }]
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify(bpValue, null, 2) }) })
|
|
393
|
+
] }),
|
|
394
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
395
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-1", children: "Multi-unit prefix (Currency) -- unit before the value" }),
|
|
396
|
+
/* @__PURE__ */ jsx(
|
|
397
|
+
QuantityWidget,
|
|
398
|
+
{
|
|
399
|
+
id: "quantity-price",
|
|
400
|
+
name: "price",
|
|
401
|
+
value: priceValue,
|
|
402
|
+
onChange: onPriceChange,
|
|
403
|
+
label: "Price",
|
|
404
|
+
description: "Currency symbol as prefix, multi-unit selector",
|
|
405
|
+
placeholder: "0.00",
|
|
406
|
+
propertySchema: { type: "object", minimum: 0 },
|
|
407
|
+
schema: dummySchema,
|
|
408
|
+
registry: DEFAULT_WIDGETS,
|
|
409
|
+
options: {
|
|
410
|
+
precision: 2,
|
|
411
|
+
unitPosition: "prefix",
|
|
412
|
+
units: [
|
|
413
|
+
{ value: "EUR", label: "EUR" },
|
|
414
|
+
{ value: "USD", label: "$" },
|
|
415
|
+
{ value: "GBP", label: "GBP" }
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify(priceValue, null, 2) }) })
|
|
421
|
+
] })
|
|
422
|
+
] }) })
|
|
423
|
+
] }) })
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export {
|
|
430
|
+
PlayFormWidgets
|
|
431
|
+
};
|
|
432
|
+
//# sourceMappingURL=chunk-P7I5IDXA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pages/PlayFormWidgets.tsx"],"sourcesContent":["/**\n * Playground page for testing form widgets\n * Accessible at /playground/form-widgets\n */\n\nimport { useCallback, useState } from \"react\";\nimport { SimpleStack, Card } from \"@petrarca/sonnet-ui\";\nimport {\n TextInputWidget,\n TextareaWidget,\n NumberWidget,\n CheckboxWidget,\n SelectWidget,\n QuantityWidget,\n DEFAULT_WIDGETS,\n type QuantityValue,\n} from \"@petrarca/sonnet-forms\";\nimport type { JsonSchema } from \"@petrarca/sonnet-core/schema\";\n\nexport default function PlayFormWidgets() {\n // State for each widget\n const [textValue, setTextValue] = useState<string>(\"\");\n const [textareaValue, setTextareaValue] = useState<string>(\"\");\n const [numberValue, setNumberValue] = useState<number | undefined>(undefined);\n const [checkboxValue, setCheckboxValue] = useState<boolean>(false);\n const [selectValue, setSelectValue] = useState<string>(\"\");\n const [multiSelectValue, setMultiSelectValue] = useState<string[]>([]);\n const [multiSelectColorValue, setMultiSelectColorValue] = useState<string[]>(\n [],\n );\n const [tempValue, setTempValue] = useState<QuantityValue>({\n value: 37.0,\n unit: \"degC\",\n });\n const [weightValue, setWeightValue] = useState<QuantityValue>({\n value: undefined,\n unit: \"kg\",\n });\n const [bpValue, setBpValue] = useState<QuantityValue>({\n value: 72,\n unit: \"bpm\",\n });\n const [priceValue, setPriceValue] = useState<QuantityValue>({\n value: 49.99,\n unit: \"EUR\",\n });\n\n // Narrowing adapters: WidgetProps.onChange is (value: unknown) => void.\n // All quantity adapters have stable identity (empty deps) -- the fallback\n // branch is dropped so the state setter is not captured in the closure.\n const onTextChange = useCallback(\n (v: unknown) => setTextValue(typeof v === \"string\" ? v : \"\"),\n [],\n );\n const onTextareaChange = useCallback(\n (v: unknown) => setTextareaValue(typeof v === \"string\" ? v : \"\"),\n [],\n );\n const onNumberChange = useCallback(\n (v: unknown) => setNumberValue(typeof v === \"number\" ? v : undefined),\n [],\n );\n const onCheckboxChange = useCallback(\n (v: unknown) => setCheckboxValue(typeof v === \"boolean\" ? v : false),\n [],\n );\n const onSelectChange = useCallback(\n (v: unknown) => setSelectValue(typeof v === \"string\" ? v : \"\"),\n [],\n );\n const onMultiSelectChange = useCallback(\n (v: unknown) =>\n setMultiSelectValue(Array.isArray(v) ? (v as string[]) : []),\n [],\n );\n const onMultiSelectColorChange = useCallback(\n (v: unknown) =>\n setMultiSelectColorValue(Array.isArray(v) ? (v as string[]) : []),\n [],\n );\n // H3: Quantity onChange adapters use the functional updater form so the\n // setter itself is stable (no state value in closure, no dep array entry).\n // QuantityWidget always passes a QuantityValue; the guard ensures type safety\n // without capturing the previous state value.\n const onTempChange = useCallback((v: unknown) => {\n if (v != null && typeof v === \"object\" && !Array.isArray(v)) {\n setTempValue(v as QuantityValue);\n }\n }, []);\n const onWeightChange = useCallback((v: unknown) => {\n if (v != null && typeof v === \"object\" && !Array.isArray(v)) {\n setWeightValue(v as QuantityValue);\n }\n }, []);\n const onBpChange = useCallback((v: unknown) => {\n if (v != null && typeof v === \"object\" && !Array.isArray(v)) {\n setBpValue(v as QuantityValue);\n }\n }, []);\n const onPriceChange = useCallback((v: unknown) => {\n if (v != null && typeof v === \"object\" && !Array.isArray(v)) {\n setPriceValue(v as QuantityValue);\n }\n }, []);\n\n // Dummy schema for widgets\n const dummySchema: JsonSchema = {\n title: \"Form Widgets Demo\",\n type: \"object\",\n properties: {},\n \"x-entity\": {\n type: \"entity\",\n label: \"Demo\",\n relations: [],\n },\n };\n\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }}\n >\n <div style={{ padding: \"1rem 1rem 0 1rem\" }}>\n <h1>Basic Form Widgets Playground</h1>\n <p className=\"text-sm text-muted-foreground mb-3\">\n Interactive demonstration of all basic form widgets\n </p>\n </div>\n\n <div style={{ flex: 1, overflow: \"auto\", padding: \"0 1rem 1rem 1rem\" }}>\n <SimpleStack gap=\"md\" style={{ maxWidth: \"900px\" }}>\n {/* TextInputWidget */}\n <Card className=\"border shadow-sm p-4\">\n <SimpleStack gap=\"sm\">\n <p className=\"text-lg font-semibold\">TextInputWidget</p>\n <p className=\"text-sm text-muted-foreground\">\n Single-line text input with support for various HTML input types\n (text, email, password, url, etc.)\n </p>\n\n <TextInputWidget\n id=\"text-input-demo\"\n name=\"textInput\"\n value={textValue}\n onChange={onTextChange}\n label=\"Text Input\"\n description=\"Enter some text\"\n placeholder=\"Type here...\"\n propertySchema={{ type: \"string\" }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n />\n\n <TextInputWidget\n id=\"text-input-email\"\n name=\"emailInput\"\n value={textValue}\n onChange={onTextChange}\n label=\"Email Input\"\n description=\"Input type: email\"\n placeholder=\"user@example.com\"\n propertySchema={{ type: \"string\", format: \"email\" }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{ inputType: \"email\" }}\n />\n\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto\">\n <code>{JSON.stringify({ value: textValue }, null, 2)}</code>\n </pre>\n </SimpleStack>\n </Card>\n\n {/* TextareaWidget */}\n <Card className=\"border shadow-sm p-4\">\n <SimpleStack gap=\"sm\">\n <p className=\"text-lg font-semibold\">TextareaWidget</p>\n <p className=\"text-sm text-muted-foreground\">\n Multi-line text input with configurable rows and autosize\n support\n </p>\n\n <TextareaWidget\n id=\"textarea-demo\"\n name=\"textarea\"\n value={textareaValue}\n onChange={onTextareaChange}\n label=\"Textarea\"\n description=\"Enter multiple lines\"\n placeholder=\"Type here...\"\n propertySchema={{ type: \"string\" }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{ rows: 4 }}\n />\n\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto\">\n <code>{JSON.stringify({ value: textareaValue }, null, 2)}</code>\n </pre>\n </SimpleStack>\n </Card>\n\n {/* NumberWidget */}\n <Card className=\"border shadow-sm p-4\">\n <SimpleStack gap=\"sm\">\n <p className=\"text-lg font-semibold\">NumberWidget</p>\n <p className=\"text-sm text-muted-foreground\">\n Number input with support for min, max, and step constraints\n </p>\n\n <NumberWidget\n id=\"number-demo\"\n name=\"number\"\n value={numberValue}\n onChange={onNumberChange}\n label=\"Number Input\"\n description=\"Enter a number (0-100, step: 5)\"\n placeholder=\"0\"\n propertySchema={{ type: \"number\", minimum: 0, maximum: 100 }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{ step: 5 }}\n />\n\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto\">\n <code>{JSON.stringify({ value: numberValue }, null, 2)}</code>\n </pre>\n </SimpleStack>\n </Card>\n\n {/* CheckboxWidget */}\n <Card className=\"border shadow-sm p-4\">\n <SimpleStack gap=\"sm\">\n <p className=\"text-lg font-semibold\">CheckboxWidget</p>\n <p className=\"text-sm text-muted-foreground\">\n Boolean checkbox for true/false values\n </p>\n\n <CheckboxWidget\n id=\"checkbox-demo\"\n name=\"checkbox\"\n value={checkboxValue}\n onChange={onCheckboxChange}\n label=\"Enable Feature\"\n description=\"Check to enable\"\n propertySchema={{ type: \"boolean\" }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n />\n\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto\">\n <code>{JSON.stringify({ value: checkboxValue }, null, 2)}</code>\n </pre>\n </SimpleStack>\n </Card>\n\n {/* SelectWidget - All Variations */}\n <Card className=\"border shadow-sm p-4\">\n <SimpleStack gap=\"sm\">\n <p className=\"text-lg font-semibold\">SelectWidget</p>\n <p className=\"text-sm text-muted-foreground\">\n Dropdown select for enum values with single-select,\n multi-select, and custom badge colors\n </p>\n\n {/* Single Select */}\n <div>\n <p className=\"text-sm font-medium mb-1\">Single Select</p>\n <SelectWidget\n id=\"select-demo\"\n name=\"select\"\n value={selectValue}\n onChange={onSelectChange}\n label=\"Select Status\"\n description=\"Choose a status\"\n placeholder=\"Select one...\"\n propertySchema={{\n type: \"string\",\n enum: [\"active\", \"inactive\", \"pending\", \"archived\"],\n }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{\n enumNames: {\n active: \"Active\",\n inactive: \"Inactive\",\n pending: \"Pending\",\n archived: \"Archived\",\n },\n searchable: true,\n clearable: true,\n }}\n />\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2\">\n <code>{JSON.stringify({ value: selectValue }, null, 2)}</code>\n </pre>\n </div>\n\n {/* Multi Select */}\n <div>\n <p className=\"text-sm font-medium mb-1\">\n Multi Select (auto-enabled when type is 'array')\n </p>\n <SelectWidget\n id=\"multiselect-demo\"\n name=\"multiselect\"\n value={multiSelectValue}\n onChange={onMultiSelectChange}\n label=\"Select Tags\"\n description=\"Choose multiple tags\"\n placeholder=\"Select tags...\"\n propertySchema={{\n type: \"array\",\n items: { type: \"string\" },\n enum: [\n \"frontend\",\n \"backend\",\n \"database\",\n \"devops\",\n \"testing\",\n \"security\",\n ],\n }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{ searchable: true, clearable: true }}\n />\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2\">\n <code>\n {JSON.stringify({ value: multiSelectValue }, null, 2)}\n </code>\n </pre>\n </div>\n\n {/* Multi Select with Badge Color */}\n <div>\n <p className=\"text-sm font-medium mb-1\">\n Multi Select with Custom Badge Color\n </p>\n <SelectWidget\n id=\"multiselect-color-demo\"\n name=\"multiselectColor\"\n value={multiSelectColorValue}\n onChange={onMultiSelectColorChange}\n label=\"Select Categories\"\n description=\"Custom grape-colored badges\"\n placeholder=\"Select categories...\"\n propertySchema={{\n type: \"array\",\n items: { type: \"string\" },\n enum: [\n \"feature\",\n \"bugfix\",\n \"enhancement\",\n \"documentation\",\n \"refactor\",\n ],\n }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{\n searchable: true,\n clearable: true,\n badgeColor: \"grape\",\n enumNames: {\n feature: \"Feature\",\n bugfix: \"Bug Fix\",\n enhancement: \"Enhancement\",\n documentation: \"Documentation\",\n refactor: \"Refactor\",\n },\n }}\n />\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2\">\n <code>\n {JSON.stringify({ value: multiSelectColorValue }, null, 2)}\n </code>\n </pre>\n </div>\n </SimpleStack>\n </Card>\n\n {/* QuantityWidget */}\n <Card className=\"border shadow-sm p-4\">\n <SimpleStack gap=\"sm\">\n <p className=\"text-lg font-semibold\">QuantityWidget</p>\n <p className=\"text-sm text-muted-foreground\">\n Compound numeric value + unit selector. Multi-unit shows a\n dropdown, single-unit shows static text, prefix mode places the\n unit before the value.\n </p>\n\n {/* Multi-unit suffix: Temperature */}\n <div>\n <p className=\"text-sm font-medium mb-1\">\n Multi-unit suffix (Temperature)\n </p>\n <QuantityWidget\n id=\"quantity-temp\"\n name=\"temperature\"\n value={tempValue}\n onChange={onTempChange}\n label=\"Temperature\"\n description=\"Body temperature with per-unit validation\"\n placeholder=\"0.0\"\n propertySchema={{ type: \"object\" }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{\n precision: 1,\n units: [\n { value: \"degC\", label: \"C\", min: 35, max: 42 },\n { value: \"degF\", label: \"F\", min: 95, max: 108 },\n ],\n }}\n />\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2\">\n <code>{JSON.stringify(tempValue, null, 2)}</code>\n </pre>\n </div>\n\n {/* Single-unit suffix: Weight */}\n <div>\n <p className=\"text-sm font-medium mb-1\">\n Single-unit suffix (Weight) -- unit shown as static text\n </p>\n <QuantityWidget\n id=\"quantity-weight\"\n name=\"weight\"\n value={weightValue}\n onChange={onWeightChange}\n label=\"Weight\"\n description=\"Single unit, global min/max from schema\"\n placeholder=\"0\"\n propertySchema={{ type: \"object\", minimum: 0, maximum: 500 }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{\n precision: 1,\n units: [{ value: \"kg\", label: \"kg\" }],\n }}\n />\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2\">\n <code>{JSON.stringify(weightValue, null, 2)}</code>\n </pre>\n </div>\n\n {/* Single-unit suffix: Heart rate (integer) */}\n <div>\n <p className=\"text-sm font-medium mb-1\">\n Integer mode (Heart Rate)\n </p>\n <QuantityWidget\n id=\"quantity-hr\"\n name=\"heartRate\"\n value={bpValue}\n onChange={onBpChange}\n label=\"Heart Rate\"\n description=\"Integer with per-unit validation (30-250 bpm)\"\n placeholder=\"0\"\n propertySchema={{ type: \"object\" }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{\n precision: 0,\n units: [{ value: \"bpm\", label: \"bpm\", min: 30, max: 250 }],\n }}\n />\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2\">\n <code>{JSON.stringify(bpValue, null, 2)}</code>\n </pre>\n </div>\n\n {/* Multi-unit prefix: Currency */}\n <div>\n <p className=\"text-sm font-medium mb-1\">\n Multi-unit prefix (Currency) -- unit before the value\n </p>\n <QuantityWidget\n id=\"quantity-price\"\n name=\"price\"\n value={priceValue}\n onChange={onPriceChange}\n label=\"Price\"\n description=\"Currency symbol as prefix, multi-unit selector\"\n placeholder=\"0.00\"\n propertySchema={{ type: \"object\", minimum: 0 }}\n schema={dummySchema}\n registry={DEFAULT_WIDGETS}\n options={{\n precision: 2,\n unitPosition: \"prefix\",\n units: [\n { value: \"EUR\", label: \"EUR\" },\n { value: \"USD\", label: \"$\" },\n { value: \"GBP\", label: \"GBP\" },\n ],\n }}\n />\n <pre className=\"text-[11px] bg-muted p-2 rounded overflow-x-auto mt-2\">\n <code>{JSON.stringify(priceValue, null, 2)}</code>\n </pre>\n </div>\n </SimpleStack>\n </Card>\n </SimpleStack>\n </div>\n </div>\n );\n}\n"],"mappings":";AAKA,SAAS,aAAa,gBAAgB;AACtC,SAAS,aAAa,YAAY;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA+GD,SACE,KADF;AA5GS,SAAR,kBAAmC;AAExC,QAAM,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