@objectifthunes/whiteboard 0.2.7 → 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.
- package/README.md +33 -1223
- package/dist/index.d.ts +125 -30
- package/dist/index.js +857 -744
- package/dist/whiteboard.css +299 -24
- package/package.json +7 -6
- package/LICENSE +0 -21
package/dist/index.d.ts
CHANGED
|
@@ -28,14 +28,6 @@ declare interface AlertProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
|
28
28
|
|
|
29
29
|
declare type AlertTone = 'error' | 'muted' | 'info' | 'success';
|
|
30
30
|
|
|
31
|
-
export declare function AssetCardSkeleton(): JSX_2.Element;
|
|
32
|
-
|
|
33
|
-
export declare function AssetTitle({ as, clamp, className, ...props }: AssetTitleProps): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
34
|
-
|
|
35
|
-
declare interface AssetTitleProps extends TypographyProps {
|
|
36
|
-
clamp?: boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
31
|
export declare function AvatarBadge({ className, ...props }: HTMLAttributes<HTMLSpanElement>): JSX_2.Element;
|
|
40
32
|
|
|
41
33
|
export declare function AvatarSkeleton(props: HTMLAttributes<HTMLDivElement>): JSX_2.Element;
|
|
@@ -82,6 +74,38 @@ declare interface CanvasStageProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
82
74
|
hint?: string;
|
|
83
75
|
}
|
|
84
76
|
|
|
77
|
+
/** Generic composed card skeleton — thumb + title + line + optional chips + optional actions. */
|
|
78
|
+
export declare function CardSkeleton({ withThumb, chipCount, actionCount, className, ...props }: CardSkeletonProps): JSX_2.Element;
|
|
79
|
+
|
|
80
|
+
declare interface CardSkeletonProps extends HTMLAttributes<HTMLLIElement> {
|
|
81
|
+
/** Show a thumbnail placeholder at the top of the card. Defaults to true. */
|
|
82
|
+
withThumb?: boolean;
|
|
83
|
+
/** Number of chip placeholders shown above the title. */
|
|
84
|
+
chipCount?: number;
|
|
85
|
+
/** Number of action-button placeholders shown at the bottom of the card. */
|
|
86
|
+
actionCount?: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export declare function CardTitle({ as, clamp, className, ...props }: CardTitleProps): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
90
|
+
|
|
91
|
+
declare interface CardTitleProps extends TypographyProps {
|
|
92
|
+
clamp?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* A labeled checkbox row. The input pins its own size and flex so host
|
|
97
|
+
* (or kit) globals like `input { flex: 1 }` can never stretch it across
|
|
98
|
+
* the row.
|
|
99
|
+
*/
|
|
100
|
+
export declare function Checkbox({ label, hint, className, ...props }: CheckboxProps): JSX_2.Element;
|
|
101
|
+
|
|
102
|
+
declare interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
103
|
+
/** Sentence-case text rendered next to the box. */
|
|
104
|
+
label?: ReactNode;
|
|
105
|
+
/** Muted addition after the label, e.g. "(dirty scans)". */
|
|
106
|
+
hint?: ReactNode;
|
|
107
|
+
}
|
|
108
|
+
|
|
85
109
|
export declare function Chip({ className, ...props }: ChipProps): JSX_2.Element;
|
|
86
110
|
|
|
87
111
|
declare type ChipProps = HTMLAttributes<HTMLSpanElement>;
|
|
@@ -163,6 +187,13 @@ declare interface CoordInputProps extends Omit<InputHTMLAttributes<HTMLInputElem
|
|
|
163
187
|
axis: string;
|
|
164
188
|
}
|
|
165
189
|
|
|
190
|
+
/** Hairline separator; vertical inside toolbars/inlines, horizontal in stacks. */
|
|
191
|
+
export declare function Divider({ orientation, className, ...props }: DividerProps): JSX_2.Element;
|
|
192
|
+
|
|
193
|
+
declare interface DividerProps extends HTMLAttributes<HTMLElement> {
|
|
194
|
+
orientation?: 'horizontal' | 'vertical';
|
|
195
|
+
}
|
|
196
|
+
|
|
166
197
|
export declare function EmptyState({ title, description, action }: EmptyStateProps): JSX_2.Element;
|
|
167
198
|
|
|
168
199
|
declare interface EmptyStateProps {
|
|
@@ -255,6 +286,9 @@ declare interface ItemListProps extends HTMLAttributes<HTMLElement> {
|
|
|
255
286
|
as?: ElementType;
|
|
256
287
|
}
|
|
257
288
|
|
|
289
|
+
/** Keyboard-key chip for shortcut hints: <Kbd>esc</Kbd> <Kbd>⌫</Kbd>. */
|
|
290
|
+
export declare function Kbd({ className, ...props }: HTMLAttributes<HTMLElement>): JSX_2.Element;
|
|
291
|
+
|
|
258
292
|
export declare function Label({ className, ...props }: LabelProps): JSX_2.Element;
|
|
259
293
|
|
|
260
294
|
declare type LabelProps = LabelHTMLAttributes<HTMLLabelElement>;
|
|
@@ -287,6 +321,20 @@ export declare function MutedText({ as, size, className, ...props }: TypographyP
|
|
|
287
321
|
|
|
288
322
|
declare type MutedTextSize = 'xs' | 'sm' | 'md';
|
|
289
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Labeled numeric input. Values come back as numbers, clamped to
|
|
326
|
+
* [min, max] when provided; non-numeric keystrokes are ignored rather
|
|
327
|
+
* than emitted as NaN.
|
|
328
|
+
*/
|
|
329
|
+
export declare function NumberField({ label, hint, value, onChange, min, max, step, id, className, ...props }: NumberFieldProps): JSX_2.Element;
|
|
330
|
+
|
|
331
|
+
declare interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
332
|
+
label?: ReactNode;
|
|
333
|
+
hint?: ReactNode;
|
|
334
|
+
value: number;
|
|
335
|
+
onChange: (value: number) => void;
|
|
336
|
+
}
|
|
337
|
+
|
|
290
338
|
export declare function OverlayIconButton({ className, placement, onPointerDown, onWheel, onContextMenu, ...props }: OverlayIconButtonProps): JSX_2.Element;
|
|
291
339
|
|
|
292
340
|
declare interface OverlayIconButtonProps extends Omit<ComponentProps<typeof Button>, 'variant' | 'iconOnly'> {
|
|
@@ -312,6 +360,7 @@ export declare class PanelErrorBoundary extends Component<Props_6, State> {
|
|
|
312
360
|
render(): string | number | boolean | JSX_2.Element | Iterable<ReactNode> | null | undefined;
|
|
313
361
|
}
|
|
314
362
|
|
|
363
|
+
/** Skeleton for a panel body containing inputs + an optional submit button. */
|
|
315
364
|
export declare function PanelFormSkeleton({ inputs, showButton, className, ...props }: PanelFormSkeletonProps): JSX_2.Element;
|
|
316
365
|
|
|
317
366
|
declare interface PanelFormSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -357,24 +406,23 @@ declare interface PickerCardProps extends HTMLAttributes<HTMLElement> {
|
|
|
357
406
|
}
|
|
358
407
|
|
|
359
408
|
/**
|
|
360
|
-
*
|
|
361
|
-
* Replaces `<List className="picker-grid picker-grid--elements">`, etc.
|
|
409
|
+
* Responsive grid for picker cards. Uses `repeat(auto-fill, minmax(minItemWidth, 1fr))`.
|
|
362
410
|
*/
|
|
363
|
-
export declare function PickerGrid({
|
|
411
|
+
export declare function PickerGrid({ minItemWidth, className, style, ...props }: PickerGridProps): JSX_2.Element;
|
|
364
412
|
|
|
365
413
|
declare interface PickerGridProps extends HTMLAttributes<HTMLUListElement> {
|
|
366
|
-
|
|
414
|
+
/** Minimum width (px) of each cell. The grid auto-fills as many columns as fit. */
|
|
415
|
+
minItemWidth?: number;
|
|
367
416
|
}
|
|
368
417
|
|
|
369
|
-
export declare function PickerGridSkeleton({ count,
|
|
418
|
+
export declare function PickerGridSkeleton({ count, minItemWidth }: PickerGridSkeletonProps): JSX_2.Element;
|
|
370
419
|
|
|
371
420
|
declare interface PickerGridSkeletonProps {
|
|
372
421
|
count?: number;
|
|
373
|
-
|
|
422
|
+
/** Minimum width (px) per cell — should match the real grid for layout stability. */
|
|
423
|
+
minItemWidth?: number;
|
|
374
424
|
}
|
|
375
425
|
|
|
376
|
-
declare type PickerGridVariant = 'elements' | 'characters' | 'library';
|
|
377
|
-
|
|
378
426
|
export declare function Pill({ tone, className, ...props }: PillProps): JSX_2.Element;
|
|
379
427
|
|
|
380
428
|
declare interface PillProps extends HTMLAttributes<HTMLSpanElement> {
|
|
@@ -466,12 +514,29 @@ declare interface SkeletonProps extends HTMLAttributes<HTMLElement> {
|
|
|
466
514
|
|
|
467
515
|
declare type SkeletonRadius = 'sm' | 'md' | 'pill';
|
|
468
516
|
|
|
517
|
+
/**
|
|
518
|
+
* The settings-panel slider pattern: label left, live readout right,
|
|
519
|
+
* range underneath. Numbers come back as numbers.
|
|
520
|
+
*/
|
|
521
|
+
export declare function Slider({ label, display, value, onChange, className, ...props }: SliderProps): JSX_2.Element;
|
|
522
|
+
|
|
523
|
+
declare interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'onChange'> {
|
|
524
|
+
/** Uppercase header on the left (rendered like a widget label). */
|
|
525
|
+
label?: ReactNode;
|
|
526
|
+
/** Right-aligned readout; defaults to the raw value. */
|
|
527
|
+
display?: ReactNode;
|
|
528
|
+
value: number;
|
|
529
|
+
onChange: (value: number) => void;
|
|
530
|
+
}
|
|
531
|
+
|
|
469
532
|
export declare function snapToWhiteboardGrid(value: number): number;
|
|
470
533
|
|
|
471
534
|
/**
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
535
|
+
* Two- or three-column grid for media + content (+ actions) rows.
|
|
536
|
+
*
|
|
537
|
+
* - `media-content` — fixed media column + flexible content column.
|
|
538
|
+
* - `single` — one column (use as the small-screen fallback).
|
|
539
|
+
* - `media-content-actions` — auto media + flexible content + auto actions.
|
|
475
540
|
*/
|
|
476
541
|
export declare function SplitLayout({ variant, className, ...props }: SplitLayoutProps): JSX_2.Element;
|
|
477
542
|
|
|
@@ -479,7 +544,7 @@ declare interface SplitLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
479
544
|
variant: SplitLayoutVariant;
|
|
480
545
|
}
|
|
481
546
|
|
|
482
|
-
declare type SplitLayoutVariant = '
|
|
547
|
+
declare type SplitLayoutVariant = 'media-content' | 'single' | 'media-content-actions';
|
|
483
548
|
|
|
484
549
|
export declare function Stack({ as, size, className, ...props }: StackProps): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
485
550
|
|
|
@@ -494,9 +559,21 @@ declare interface State {
|
|
|
494
559
|
error: Error | null;
|
|
495
560
|
}
|
|
496
561
|
|
|
497
|
-
|
|
562
|
+
/**
|
|
563
|
+
* The plain floating surface: --wb-surface background, border, radius,
|
|
564
|
+
* soft shadow. For overlays that live OUTSIDE a WhiteboardShell —
|
|
565
|
+
* selection menus, legends, log panes — where FloatingPanel's canvas
|
|
566
|
+
* coupling would be wrong.
|
|
567
|
+
*/
|
|
568
|
+
export declare function Surface({ as, padding, className, ...props }: SurfaceProps): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
498
569
|
|
|
499
|
-
|
|
570
|
+
declare interface SurfaceProps extends HTMLAttributes<HTMLElement> {
|
|
571
|
+
as?: ElementType;
|
|
572
|
+
padding?: 'none' | 'sm' | 'md';
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/** A labeled on/off switch — same API as Checkbox, slider visuals. */
|
|
576
|
+
export declare function Switch({ label, hint, className, ...props }: CheckboxProps): JSX_2.Element;
|
|
500
577
|
|
|
501
578
|
/**
|
|
502
579
|
* A horizontal wrapping row for chips/tags/pills/small items.
|
|
@@ -539,6 +616,32 @@ declare interface TitleRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
539
616
|
|
|
540
617
|
export declare function TitleSkeleton(props: HTMLAttributes<HTMLDivElement>): JSX_2.Element;
|
|
541
618
|
|
|
619
|
+
/**
|
|
620
|
+
* Horizontal sibling of VerticalToolbar — same surface, same rhythm.
|
|
621
|
+
* The app-chrome bar: title, file chip, navigation, primary action.
|
|
622
|
+
*/
|
|
623
|
+
export declare function Toolbar({ children, end, position, className, ...props }: ToolbarProps): JSX_2.Element;
|
|
624
|
+
|
|
625
|
+
declare interface ToolbarProps extends HTMLAttributes<HTMLElement> {
|
|
626
|
+
/** 'top' (fixed, centered) · 'bottom' · 'static' (position it yourself). */
|
|
627
|
+
position?: 'top' | 'bottom' | 'static';
|
|
628
|
+
/** Actions pinned to the end of the bar after a divider gap. */
|
|
629
|
+
end?: ReactNode;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* CSS-only tooltip: shows on hover and on keyboard focus, no JS, no
|
|
634
|
+
* portal. Wraps its child inline.
|
|
635
|
+
*/
|
|
636
|
+
export declare function Tooltip({ label, placement, className, children, ...props }: TooltipProps): JSX_2.Element;
|
|
637
|
+
|
|
638
|
+
declare interface TooltipProps extends HTMLAttributes<HTMLSpanElement> {
|
|
639
|
+
/** Bubble content. Keep it to a few words. */
|
|
640
|
+
label: ReactNode;
|
|
641
|
+
placement?: 'top' | 'bottom';
|
|
642
|
+
children: ReactNode;
|
|
643
|
+
}
|
|
644
|
+
|
|
542
645
|
declare interface TypographyProps extends HTMLAttributes<HTMLElement> {
|
|
543
646
|
as?: ElementType;
|
|
544
647
|
}
|
|
@@ -549,14 +652,6 @@ export declare function usePanelRect(initial: {
|
|
|
549
652
|
y: number;
|
|
550
653
|
}): MutableRefObject<PanelRect>;
|
|
551
654
|
|
|
552
|
-
export declare function UserCardSkeleton(): JSX_2.Element;
|
|
553
|
-
|
|
554
|
-
export declare function UserListSkeleton({ count }: UserListSkeletonProps): JSX_2.Element;
|
|
555
|
-
|
|
556
|
-
declare interface UserListSkeletonProps {
|
|
557
|
-
count?: number;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
655
|
export declare function useWhiteboardLayout<T extends WidthMap>({ widths, startX, y, gap, }: UseWhiteboardLayoutOptions<T>): {
|
|
561
656
|
layout: {
|
|
562
657
|
startX: number;
|