@uibot/renderer-react 0.15.0 → 0.16.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,13 @@
1
+ .uibot-color-palette{display:grid;gap:16px;color:var(--foreground);font-size:12px;min-width:0}
2
+ .uibot-color-palette h4{font-size:12px;font-weight:600;margin:0 0 10px}.uibot-color-palette p{font-size:11px;line-height:1.6;color:var(--muted-foreground);margin:8px 0 0}
3
+ .uibot-color-swatches{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}.uibot-color-cell{position:relative;min-width:0}
4
+ .uibot-color-swatch{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1;border:1px solid #0002;border-radius:8px;cursor:pointer;box-shadow:inset 0 0 0 1px #fff1}
5
+ .uibot-color-swatch svg{width:22px;height:22px}.uibot-color-swatch[aria-pressed=true]{outline:2px solid var(--primary);outline-offset:3px}.uibot-color-swatch:hover{transform:translateY(-1px)}
6
+ .uibot-color-palette button:focus-visible,.uibot-color-palette input:focus-visible{outline:2px solid var(--ring,var(--primary));outline-offset:3px}
7
+ .uibot-color-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.uibot-color-link{font-size:11px;color:var(--primary);cursor:pointer}
8
+ .uibot-color-delete{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;width:21px;height:21px;border-radius:50%;background:var(--foreground);color:var(--background);border:2px solid var(--background);font-size:15px;cursor:pointer}
9
+ .uibot-color-custom{width:100%;padding:9px;border:1px dashed var(--border);border-radius:7px;text-align:center;font-size:12px;cursor:pointer}.uibot-color-custom:hover,.uibot-color-custom[aria-expanded=true]{border-color:var(--primary);color:var(--primary);background:color-mix(in srgb,var(--primary) 7%,var(--background))}
10
+ .uibot-color-current{display:flex;align-items:center;gap:10px;font-size:11px;color:var(--muted-foreground)}.uibot-color-current .uibot-color-cell{width:30px}
11
+ .uibot-color-custom-editor{display:grid;gap:12px;border:1px solid var(--border);border-radius:8px;padding:12px}.uibot-color-well,.uibot-color-hex{display:flex;align-items:center;justify-content:space-between;gap:10px}
12
+ .uibot-color-well input{width:64px;height:38px;cursor:pointer;padding:2px;border:1px solid var(--border);border-radius:6px}.uibot-color-hex input{width:105px;min-width:0;border:1px solid var(--border);border-radius:5px;padding:6px 8px;background:var(--background);color:var(--foreground);font-family:monospace}
13
+ .uibot-color-actions{display:flex;justify-content:flex-end;gap:8px}.uibot-color-actions button{padding:7px 12px;border:1px solid var(--border);border-radius:6px;font-size:12px;cursor:pointer}.uibot-color-actions button:last-child{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}
@@ -0,0 +1,31 @@
1
+ export declare const DEFAULT_COLOR_SWATCHES: readonly ["#2563eb", "#0ea5e9", "#4f46e5", "#a855f7", "#db2777", "#dc2626", "#f97316", "#f59e0b", "#84cc16", "#16a34a", "#059669", "#0891b2", "#171717", "#64748b", "#94a3b8", "#cbd5e1", "#e2e8f0", "#f1f5f9", "#fafafa", "#ffffff"];
2
+ declare const english: {
3
+ presets: string;
4
+ saved: string;
5
+ custom: string;
6
+ manage: string;
7
+ done: string;
8
+ remove: string;
9
+ save: string;
10
+ use: string;
11
+ cancel: string;
12
+ hex: string;
13
+ picker: string;
14
+ invalid: string;
15
+ empty: string;
16
+ help: string;
17
+ current: string;
18
+ };
19
+ export interface ColorPaletteProps {
20
+ value: string;
21
+ onChange: (color: string) => void;
22
+ presets?: readonly string[];
23
+ savedColors?: readonly string[];
24
+ onSaveColor?: (color: string) => boolean;
25
+ onRemoveColor?: (color: string) => void;
26
+ storageError?: string;
27
+ labels?: Partial<typeof english>;
28
+ }
29
+ /** Shared controlled palette. The host provides persistence and popover placement. */
30
+ export declare function ColorPalette({ value, onChange, presets, savedColors, onSaveColor, onRemoveColor, storageError, labels, }: ColorPaletteProps): import("react").JSX.Element;
31
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ export { ColorPalette, DEFAULT_COLOR_SWATCHES } from "./color-palette.js";
2
+ export type { ColorPaletteProps } from "./color-palette.js";
3
+ export { normalizeSwatch, parseSavedColors, serializeSavedColors, SAVED_COLOR_LIMIT, } from "./saved-colors.js";
1
4
  import type { ActionChain, ActionEventScope, CapabilityDescriptor, CompiledUIBotSpec, PropValue, UIElement, VisibilityCondition } from "@uibot/contracts";
2
5
  /**
3
6
  * Dispatches an event ActionChain (e.g. a block's `onChange` → SetState).