@pragma-sh/scratchpad 0.1.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.
@@ -0,0 +1,514 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ function __accessProp(key) {
6
+ return this[key];
7
+ }
8
+ var __reExport = (target, mod, secondTarget) => {
9
+ var keys = __getOwnPropNames(mod);
10
+ for (let key of keys)
11
+ if (!__hasOwnProp.call(target, key) && key !== "default")
12
+ __defProp(target, key, {
13
+ get: __accessProp.bind(mod, key),
14
+ enumerable: true
15
+ });
16
+ if (secondTarget) {
17
+ for (let key of keys)
18
+ if (!__hasOwnProp.call(secondTarget, key) && key !== "default")
19
+ __defProp(secondTarget, key, {
20
+ get: __accessProp.bind(mod, key),
21
+ enumerable: true
22
+ });
23
+ return secondTarget;
24
+ }
25
+ };
26
+ var __toCommonJS = (from) => {
27
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
28
+ if (entry)
29
+ return entry;
30
+ entry = __defProp({}, "__esModule", { value: true });
31
+ if (from && typeof from === "object" || typeof from === "function") {
32
+ for (var key of __getOwnPropNames(from))
33
+ if (!__hasOwnProp.call(entry, key))
34
+ __defProp(entry, key, {
35
+ get: __accessProp.bind(from, key),
36
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
37
+ });
38
+ }
39
+ __moduleCache.set(from, entry);
40
+ return entry;
41
+ };
42
+ var __moduleCache;
43
+ var __returnValue = (v) => v;
44
+ function __exportSetter(name, newValue) {
45
+ this[name] = __returnValue.bind(null, newValue);
46
+ }
47
+ var __export = (target, all) => {
48
+ for (var name in all)
49
+ __defProp(target, name, {
50
+ get: all[name],
51
+ enumerable: true,
52
+ configurable: true,
53
+ set: __exportSetter.bind(all, name)
54
+ });
55
+ };
56
+
57
+ // src/primitives.tsx
58
+ var exports_primitives = {};
59
+ __export(exports_primitives, {
60
+ Textarea: () => Textarea,
61
+ Progress: () => Progress,
62
+ Input: () => Input,
63
+ Card: () => Card,
64
+ Button: () => Button,
65
+ Badge: () => Badge
66
+ });
67
+ module.exports = __toCommonJS(exports_primitives);
68
+
69
+ // src/styles.ts
70
+ var SCRATCHPAD_STYLE_ELEMENT_ID = "pragma-scratchpad-styles";
71
+ var SCRATCHPAD_STYLES = `
72
+ .pragma-card {
73
+ display: grid;
74
+ gap: 0.75rem;
75
+ margin: 1rem 0;
76
+ padding: 0.875rem 1rem;
77
+ border: 1px solid var(--border, #3f3f46);
78
+ border-radius: var(--radius-lg, 10px);
79
+ background: var(--card, #18181b);
80
+ color: var(--card-foreground, #fafafa);
81
+ box-shadow: var(--shadow-raised, 0 1px 2px rgb(0 0 0 / 0.3));
82
+ font-family: var(--font-sans, system-ui, sans-serif);
83
+ font-size: 0.8125rem;
84
+ line-height: 1.55;
85
+ }
86
+ .pragma-card > :first-child { margin-top: 0; }
87
+ .pragma-card > :last-child { margin-bottom: 0; }
88
+
89
+ .pragma-eyebrow {
90
+ font-size: 0.6875rem;
91
+ font-weight: 600;
92
+ letter-spacing: 0.06em;
93
+ text-transform: uppercase;
94
+ color: var(--muted-foreground, #a1a1aa);
95
+ }
96
+ .pragma-title {
97
+ font-size: 0.9375rem;
98
+ font-weight: 600;
99
+ line-height: 1.4;
100
+ color: var(--card-foreground, #fafafa);
101
+ }
102
+ .pragma-hint { font-size: 0.75rem; color: var(--muted-foreground, #a1a1aa); }
103
+ .pragma-stack { display: grid; gap: 0.5rem; }
104
+ .pragma-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
105
+ .pragma-row--between { justify-content: space-between; }
106
+ .pragma-row--end { justify-content: flex-end; }
107
+ .pragma-empty {
108
+ padding: 0.75rem;
109
+ border: 1px dashed var(--border, #3f3f46);
110
+ border-radius: var(--radius-md, 8px);
111
+ font-size: 0.75rem;
112
+ color: var(--muted-foreground, #a1a1aa);
113
+ text-align: center;
114
+ }
115
+ .pragma-chip {
116
+ padding: 0.0625rem 0.375rem;
117
+ border-radius: var(--radius-sm, 6px);
118
+ background: var(--muted, #27272a);
119
+ color: var(--muted-foreground, #a1a1aa);
120
+ font-family: var(--font-mono, ui-monospace, monospace);
121
+ font-size: 0.6875rem;
122
+ }
123
+
124
+ .pragma-button {
125
+ display: inline-flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ gap: 0.375rem;
129
+ min-height: 2rem;
130
+ padding: 0 0.75rem;
131
+ border: 1px solid transparent;
132
+ border-radius: var(--radius-md, 8px);
133
+ font-family: inherit;
134
+ font-size: 0.8125rem;
135
+ font-weight: 500;
136
+ line-height: 1;
137
+ cursor: pointer;
138
+ white-space: nowrap;
139
+ transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
140
+ }
141
+ .pragma-button:focus-visible { outline: 2px solid var(--ring, #22d3ee); outline-offset: 2px; }
142
+ .pragma-button:disabled { cursor: not-allowed; opacity: 0.5; }
143
+ .pragma-button--sm { min-height: 1.75rem; padding: 0 0.5rem; font-size: 0.75rem; }
144
+ .pragma-button--primary {
145
+ background: var(--primary, #2563eb);
146
+ color: var(--primary-foreground, #fafafa);
147
+ }
148
+ .pragma-button--primary:hover:not(:disabled) { background: var(--primary-hover, #1d4ed8); }
149
+ .pragma-button--secondary {
150
+ background: var(--secondary, #27272a);
151
+ color: var(--secondary-foreground, #fafafa);
152
+ }
153
+ .pragma-button--secondary:hover:not(:disabled) { background: var(--accent, #3f3f46); }
154
+ .pragma-button--outline {
155
+ border-color: var(--input, #3f3f46);
156
+ background: transparent;
157
+ color: var(--foreground, #fafafa);
158
+ }
159
+ .pragma-button--outline:hover:not(:disabled) {
160
+ background: var(--accent, #27272a);
161
+ color: var(--accent-foreground, #fafafa);
162
+ }
163
+ .pragma-button--ghost { background: transparent; color: var(--muted-foreground, #a1a1aa); }
164
+ .pragma-button--ghost:hover:not(:disabled) {
165
+ background: var(--accent, #27272a);
166
+ color: var(--accent-foreground, #fafafa);
167
+ }
168
+ .pragma-button--danger {
169
+ background: var(--destructive, #ef4444);
170
+ color: var(--destructive-foreground, #fafafa);
171
+ }
172
+ .pragma-button--danger:hover:not(:disabled) { filter: brightness(1.08); }
173
+
174
+ .pragma-input,
175
+ .pragma-textarea {
176
+ width: 100%;
177
+ padding: 0.4375rem 0.625rem;
178
+ border: 1px solid var(--input, #3f3f46);
179
+ border-radius: var(--radius-md, 8px);
180
+ background: var(--background, #09090b);
181
+ color: var(--foreground, #fafafa);
182
+ font-family: inherit;
183
+ font-size: 0.8125rem;
184
+ line-height: 1.5;
185
+ transition: border-color 0.12s ease;
186
+ }
187
+ .pragma-input::placeholder,
188
+ .pragma-textarea::placeholder { color: var(--muted-foreground, #71717a); }
189
+ .pragma-input:focus-visible,
190
+ .pragma-textarea:focus-visible {
191
+ border-color: var(--ring, #22d3ee);
192
+ outline: 2px solid var(--ring, #22d3ee);
193
+ outline-offset: -1px;
194
+ }
195
+ .pragma-input:disabled,
196
+ .pragma-textarea:disabled { cursor: not-allowed; opacity: 0.5; }
197
+ .pragma-textarea { min-height: 5rem; resize: vertical; }
198
+
199
+ /*
200
+ * Choice list shared by every AskQuestion shape: a circular radio for a single
201
+ * answer, a square checkbox for multi-select. The native control is restyled
202
+ * (\`appearance: none\`) rather than replaced, so keyboard roving, labels and
203
+ * form semantics keep working inside the sandboxed frame.
204
+ */
205
+ .pragma-choices { display: grid; gap: 0.25rem; }
206
+ .pragma-choice {
207
+ display: flex;
208
+ align-items: center;
209
+ gap: 0.5rem;
210
+ padding: 0.4375rem 0.5rem;
211
+ border: 1px solid transparent;
212
+ border-radius: var(--radius-md, 8px);
213
+ cursor: pointer;
214
+ transition: background-color 0.12s ease, border-color 0.12s ease;
215
+ }
216
+ .pragma-choice:hover { background: var(--accent, #27272a); }
217
+ .pragma-choice--checked {
218
+ border-color: color-mix(in oklab, var(--primary, #2563eb) 45%, transparent);
219
+ background: color-mix(in oklab, var(--primary, #2563eb) 10%, transparent);
220
+ }
221
+ .pragma-choice:has(:disabled) { cursor: not-allowed; opacity: 0.5; }
222
+ .pragma-choice:has(:disabled):hover { background: transparent; }
223
+ .pragma-choice__control {
224
+ appearance: none;
225
+ -webkit-appearance: none;
226
+ display: grid;
227
+ place-content: center;
228
+ flex: none;
229
+ width: 1rem;
230
+ height: 1rem;
231
+ margin: 0;
232
+ border: 1px solid var(--input, #3f3f46);
233
+ background: var(--background, #09090b);
234
+ cursor: inherit;
235
+ transition: background-color 0.12s ease, border-color 0.12s ease;
236
+ }
237
+ .pragma-choice__control--radio { border-radius: 999px; }
238
+ .pragma-choice__control--check { border-radius: var(--radius-sm, 6px); }
239
+ .pragma-choice__control:focus-visible { outline: 2px solid var(--ring, #22d3ee); outline-offset: 2px; }
240
+ .pragma-choice__control:checked { border-color: var(--primary, #2563eb); }
241
+ .pragma-choice__control--radio:checked::after {
242
+ content: "";
243
+ width: 0.5rem;
244
+ height: 0.5rem;
245
+ border-radius: 999px;
246
+ background: var(--primary, #2563eb);
247
+ }
248
+ .pragma-choice__control--check:checked { background: var(--primary, #2563eb); }
249
+ .pragma-choice__control--check:checked::after {
250
+ content: "";
251
+ width: 0.3125rem;
252
+ height: 0.5625rem;
253
+ margin-top: -0.125rem;
254
+ border: solid var(--primary-foreground, #fafafa);
255
+ border-width: 0 2px 2px 0;
256
+ transform: rotate(45deg);
257
+ }
258
+ .pragma-choice__label { flex: 1; min-width: 0; font-size: 0.8125rem; }
259
+ /* The "Other" row swaps its text for this field, so it has to sit on the row. */
260
+ .pragma-choice__other {
261
+ padding: 0.125rem 0.375rem;
262
+ font-size: 0.8125rem;
263
+ cursor: text;
264
+ }
265
+
266
+ .pragma-progress {
267
+ appearance: none;
268
+ width: 100%;
269
+ height: 0.375rem;
270
+ border: 0;
271
+ border-radius: 999px;
272
+ overflow: hidden;
273
+ background: var(--muted, #27272a);
274
+ color: var(--pragma-tone, var(--primary, #22d3ee));
275
+ }
276
+ .pragma-progress::-webkit-progress-bar { background: var(--muted, #27272a); border-radius: 999px; }
277
+ .pragma-progress::-webkit-progress-value {
278
+ background: var(--pragma-tone, var(--primary, #22d3ee));
279
+ border-radius: 999px;
280
+ transition: width 0.25s ease;
281
+ }
282
+ .pragma-progress::-moz-progress-bar {
283
+ background: var(--pragma-tone, var(--primary, #22d3ee));
284
+ border-radius: 999px;
285
+ }
286
+
287
+ .pragma-badge {
288
+ display: inline-flex;
289
+ align-items: center;
290
+ gap: 0.25rem;
291
+ padding: 0.0625rem 0.4375rem;
292
+ border: 1px solid currentColor;
293
+ border-radius: 999px;
294
+ background: transparent;
295
+ color: var(--muted-foreground, #a1a1aa);
296
+ font-size: 0.6875rem;
297
+ font-weight: 500;
298
+ line-height: 1.5;
299
+ }
300
+ .pragma-badge--primary { color: var(--primary, #22d3ee); }
301
+ .pragma-badge--success { color: var(--success, #22c55e); }
302
+ .pragma-badge--warning { color: var(--warning, #eab308); }
303
+ .pragma-badge--danger { color: var(--destructive, #ef4444); }
304
+
305
+ .pragma-whiteboard__open {
306
+ display: block;
307
+ width: 100%;
308
+ padding: 0;
309
+ border: 0;
310
+ border-radius: var(--radius-md, 8px);
311
+ background: transparent;
312
+ cursor: pointer;
313
+ }
314
+ .pragma-whiteboard__open:focus-visible {
315
+ outline: 2px solid var(--ring, #22d3ee);
316
+ outline-offset: 2px;
317
+ }
318
+ .pragma-whiteboard__open:hover .pragma-whiteboard__image {
319
+ border-color: var(--primary, #22d3ee);
320
+ }
321
+ .pragma-whiteboard__image {
322
+ display: block;
323
+ width: 100%;
324
+ height: auto;
325
+ max-height: 36rem;
326
+ object-fit: contain;
327
+ border: 1px solid var(--border, #3f3f46);
328
+ border-radius: var(--radius-md, 8px);
329
+ background: var(--background, #09090b);
330
+ transition: border-color 0.15s ease;
331
+ }
332
+ .pragma-whiteboard__error {
333
+ margin: 0;
334
+ color: var(--destructive, #ef4444);
335
+ font-size: 0.75rem;
336
+ }
337
+
338
+ /*
339
+ * Side-by-side diff modelled on the desktop's \`@codemirror/merge\` view: one
340
+ * scroll container so both panes stay row-aligned, a line-number gutter per
341
+ * pane, whole-line tinting for inserted/deleted lines and a stronger tint on
342
+ * the words that actually changed (the equivalent of \`cm-changedText\`).
343
+ */
344
+ .pragma-diff {
345
+ display: grid;
346
+ grid-template-columns: repeat(2, minmax(0, 1fr));
347
+ max-height: 24rem;
348
+ overflow-y: auto;
349
+ border: 1px solid var(--border, #3f3f46);
350
+ border-radius: var(--radius-md, 8px);
351
+ background: var(--background, #09090b);
352
+ font-family: var(--font-mono, ui-monospace, monospace);
353
+ font-size: 0.75rem;
354
+ line-height: 1.6;
355
+ --pragma-diff-added: var(--diff-added, #22c55e);
356
+ --pragma-diff-removed: var(--diff-removed, #ef4444);
357
+ }
358
+ @media (max-width: 34rem) { .pragma-diff { grid-template-columns: minmax(0, 1fr); } }
359
+ .pragma-diff__pane { min-width: 0; overflow-x: auto; }
360
+ .pragma-diff__pane--after { border-left: 1px solid var(--border, #3f3f46); }
361
+ @media (max-width: 34rem) {
362
+ .pragma-diff__pane--after {
363
+ border-left: 0;
364
+ border-top: 1px solid var(--border, #3f3f46);
365
+ }
366
+ }
367
+ .pragma-diff__label {
368
+ display: flex;
369
+ justify-content: space-between;
370
+ gap: 0.5rem;
371
+ padding: 0.25rem 0.625rem;
372
+ border-bottom: 1px solid var(--border, #3f3f46);
373
+ background: var(--card, #18181b);
374
+ font-family: var(--font-sans, system-ui, sans-serif);
375
+ font-size: 0.6875rem;
376
+ font-weight: 600;
377
+ letter-spacing: 0.06em;
378
+ text-transform: uppercase;
379
+ }
380
+ .pragma-diff__pane--before .pragma-diff__label { color: var(--pragma-diff-removed); }
381
+ .pragma-diff__pane--after .pragma-diff__label { color: var(--pragma-diff-added); }
382
+
383
+ .pragma-diff__lines { display: grid; padding: 0.25rem 0; min-width: max-content; }
384
+ .pragma-diff__line {
385
+ display: grid;
386
+ grid-template-columns: 2.75rem minmax(0, 1fr);
387
+ min-height: 1.6em;
388
+ white-space: pre;
389
+ }
390
+ .pragma-diff__gutter {
391
+ padding-right: 0.625rem;
392
+ color: var(--muted-foreground, #71717a);
393
+ opacity: 0.7;
394
+ text-align: right;
395
+ user-select: none;
396
+ }
397
+ .pragma-diff__text { padding-right: 0.75rem; font: inherit; }
398
+ .pragma-diff__line--removed {
399
+ background: color-mix(in oklab, var(--pragma-diff-removed) 12%, transparent);
400
+ }
401
+ .pragma-diff__line--added {
402
+ background: color-mix(in oklab, var(--pragma-diff-added) 12%, transparent);
403
+ }
404
+ .pragma-diff__pane--before .pragma-diff__line--changed {
405
+ background: color-mix(in oklab, var(--pragma-diff-removed) 12%, transparent);
406
+ }
407
+ .pragma-diff__pane--after .pragma-diff__line--changed {
408
+ background: color-mix(in oklab, var(--pragma-diff-added) 12%, transparent);
409
+ }
410
+ .pragma-diff__line--spacer { background: var(--muted, #27272a); opacity: 0.35; }
411
+ .pragma-diff__pane--before .pragma-diff__changed {
412
+ background: color-mix(in oklab, var(--pragma-diff-removed) 30%, transparent);
413
+ }
414
+ .pragma-diff__pane--after .pragma-diff__changed {
415
+ background: color-mix(in oklab, var(--pragma-diff-added) 30%, transparent);
416
+ }
417
+
418
+ .pragma-progress-row { display: grid; gap: 0.3125rem; }
419
+ .pragma-progress-row + .pragma-progress-row {
420
+ padding-top: 0.625rem;
421
+ border-top: 1px solid var(--border, #3f3f46);
422
+ }
423
+ .pragma-progress-row__name {
424
+ min-width: 0;
425
+ overflow: hidden;
426
+ font-weight: 500;
427
+ text-overflow: ellipsis;
428
+ white-space: nowrap;
429
+ }
430
+ `;
431
+ function ensureScratchpadStyles() {
432
+ if (typeof document === "undefined")
433
+ return;
434
+ if (document.getElementById(SCRATCHPAD_STYLE_ELEMENT_ID))
435
+ return;
436
+ const element = document.createElement("style");
437
+ element.id = SCRATCHPAD_STYLE_ELEMENT_ID;
438
+ element.textContent = SCRATCHPAD_STYLES;
439
+ document.head.append(element);
440
+ }
441
+
442
+ // src/primitives.tsx
443
+ var jsx_runtime = require("react/jsx-runtime");
444
+ var TONE_VARIABLE = {
445
+ neutral: "var(--muted-foreground)",
446
+ primary: "var(--primary)",
447
+ success: "var(--success)",
448
+ warning: "var(--warning)",
449
+ danger: "var(--destructive)"
450
+ };
451
+ function classNames(...values) {
452
+ return values.filter(Boolean).join(" ");
453
+ }
454
+ function Button({
455
+ className,
456
+ size = "md",
457
+ type = "button",
458
+ variant = "secondary",
459
+ ...rest
460
+ }) {
461
+ ensureScratchpadStyles();
462
+ return /* @__PURE__ */ jsx_runtime.jsx("button", {
463
+ ...rest,
464
+ className: classNames("pragma-button", `pragma-button--${variant}`, size === "sm" && "pragma-button--sm", className),
465
+ type
466
+ });
467
+ }
468
+ function Input({
469
+ className,
470
+ ...rest
471
+ }) {
472
+ ensureScratchpadStyles();
473
+ return /* @__PURE__ */ jsx_runtime.jsx("input", {
474
+ ...rest,
475
+ className: classNames("pragma-input", className)
476
+ });
477
+ }
478
+ function Textarea({
479
+ className,
480
+ ...rest
481
+ }) {
482
+ ensureScratchpadStyles();
483
+ return /* @__PURE__ */ jsx_runtime.jsx("textarea", {
484
+ ...rest,
485
+ className: classNames("pragma-textarea", className)
486
+ });
487
+ }
488
+ function Progress({
489
+ className,
490
+ style,
491
+ tone = "primary",
492
+ ...rest
493
+ }) {
494
+ ensureScratchpadStyles();
495
+ return /* @__PURE__ */ jsx_runtime.jsx("progress", {
496
+ ...rest,
497
+ className: classNames("pragma-progress", className),
498
+ style: { ["--pragma-tone"]: TONE_VARIABLE[tone], ...style }
499
+ });
500
+ }
501
+ function Card({ className, ...rest }) {
502
+ ensureScratchpadStyles();
503
+ return /* @__PURE__ */ jsx_runtime.jsx("section", {
504
+ ...rest,
505
+ className: classNames("pragma-card", className)
506
+ });
507
+ }
508
+ function Badge({ className, tone = "neutral", ...rest }) {
509
+ ensureScratchpadStyles();
510
+ return /* @__PURE__ */ jsx_runtime.jsx("span", {
511
+ ...rest,
512
+ className: classNames("pragma-badge", tone !== "neutral" && `pragma-badge--${tone}`, className)
513
+ });
514
+ }
@@ -0,0 +1,31 @@
1
+ import { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, ProgressHTMLAttributes, TextareaHTMLAttributes } from "react";
2
+ /** Visual weight of a scratchpad {@link Button}. */
3
+ type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger";
4
+ /** Semantic color of a {@link Badge} or {@link Progress}. */
5
+ type Tone = "neutral" | "primary" | "success" | "warning" | "danger";
6
+ /** Props for {@link Button}. */
7
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
8
+ variant?: ButtonVariant;
9
+ size?: "sm" | "md";
10
+ }
11
+ /** Scratchpad button matching desktop shadcn button proportions and tokens. */
12
+ declare function Button({ className, size, type, variant,...rest }: ButtonProps): React.JSX.Element;
13
+ /** Scratchpad single-line input matching desktop shadcn input tokens. */
14
+ declare function Input({ className,...rest }: InputHTMLAttributes<HTMLInputElement>): React.JSX.Element;
15
+ /** Scratchpad multiline input matching desktop shadcn textarea tokens. */
16
+ declare function Textarea({ className,...rest }: TextareaHTMLAttributes<HTMLTextAreaElement>): React.JSX.Element;
17
+ /** Props for {@link Progress}. */
18
+ interface ProgressProps extends ProgressHTMLAttributes<HTMLProgressElement> {
19
+ tone?: Tone;
20
+ }
21
+ /** Scratchpad progress bar using desktop semantic colors. */
22
+ declare function Progress({ className, style, tone,...rest }: ProgressProps): React.JSX.Element;
23
+ /** Surface that frames one scratchpad component, matching desktop cards. */
24
+ declare function Card({ className,...rest }: HTMLAttributes<HTMLElement>): React.JSX.Element;
25
+ /** Props for {@link Badge}. */
26
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
27
+ tone?: Tone;
28
+ }
29
+ /** Small state pill; color communicates state, never decoration. */
30
+ declare function Badge({ className, tone,...rest }: BadgeProps): React.JSX.Element;
31
+ export { Tone, Textarea, ProgressProps, Progress, Input, Card, ButtonVariant, ButtonProps, Button, BadgeProps, Badge };
@@ -0,0 +1,31 @@
1
+ import { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, ProgressHTMLAttributes, TextareaHTMLAttributes } from "react";
2
+ /** Visual weight of a scratchpad {@link Button}. */
3
+ type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger";
4
+ /** Semantic color of a {@link Badge} or {@link Progress}. */
5
+ type Tone = "neutral" | "primary" | "success" | "warning" | "danger";
6
+ /** Props for {@link Button}. */
7
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
8
+ variant?: ButtonVariant;
9
+ size?: "sm" | "md";
10
+ }
11
+ /** Scratchpad button matching desktop shadcn button proportions and tokens. */
12
+ declare function Button({ className, size, type, variant,...rest }: ButtonProps): React.JSX.Element;
13
+ /** Scratchpad single-line input matching desktop shadcn input tokens. */
14
+ declare function Input({ className,...rest }: InputHTMLAttributes<HTMLInputElement>): React.JSX.Element;
15
+ /** Scratchpad multiline input matching desktop shadcn textarea tokens. */
16
+ declare function Textarea({ className,...rest }: TextareaHTMLAttributes<HTMLTextAreaElement>): React.JSX.Element;
17
+ /** Props for {@link Progress}. */
18
+ interface ProgressProps extends ProgressHTMLAttributes<HTMLProgressElement> {
19
+ tone?: Tone;
20
+ }
21
+ /** Scratchpad progress bar using desktop semantic colors. */
22
+ declare function Progress({ className, style, tone,...rest }: ProgressProps): React.JSX.Element;
23
+ /** Surface that frames one scratchpad component, matching desktop cards. */
24
+ declare function Card({ className,...rest }: HTMLAttributes<HTMLElement>): React.JSX.Element;
25
+ /** Props for {@link Badge}. */
26
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
27
+ tone?: Tone;
28
+ }
29
+ /** Small state pill; color communicates state, never decoration. */
30
+ declare function Badge({ className, tone,...rest }: BadgeProps): React.JSX.Element;
31
+ export { Tone, Textarea, ProgressProps, Progress, Input, Card, ButtonVariant, ButtonProps, Button, BadgeProps, Badge };