@particle-academy/react-fancy 4.5.0 → 4.6.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/dist/index.d.cts CHANGED
@@ -518,20 +518,27 @@ interface DisplayValueProps {
518
518
  trailing?: ReactNode;
519
519
  /** Shown when the value is empty. Default `—`. */
520
520
  empty?: ReactNode;
521
+ /** When true the value is clickable to enter edit mode (inline click-to-edit). */
522
+ interactive?: boolean;
523
+ /** Called when an interactive value is activated (click / Enter / Space). */
524
+ onActivate?: () => void;
521
525
  className?: string;
522
526
  }
523
527
  /**
524
528
  * The read-only counterpart to an `<input>`. Renders a non-interactive value
525
529
  * with the same size rhythm as the editable control (reusing
526
- * {@link inputSizeClasses}) but without the border / background / focus ring
527
- * view text should read as text, not a disabled box. Dropped into the SAME
528
- * `Field` wrapper the editable control uses, so label / description / error
529
- * chrome stays byte-identical between edit and view.
530
+ * {@link inputSizeClasses}) but without the border / background / focus ring.
530
531
  *
531
- * Carries `data-react-fancy-display` / `data-mode="view"` stable handles so
532
- * agents and tests can locate rendered values (Human+ contract).
532
+ * When `interactive` (inline click-to-edit), the value becomes a focusable,
533
+ * hoverable target that calls `onActivate` on click / Enter / Space to swap in
534
+ * the real control. Dropped into the SAME `Field` wrapper the editable control
535
+ * uses, so label / description / error chrome stays byte-identical between the
536
+ * display and the editor.
537
+ *
538
+ * Carries `data-react-fancy-display` / `data-mode="view"` stable handles for
539
+ * agents and tests (Human+ contract).
533
540
  */
534
- declare function DisplayValue({ children, size, leading, trailing, empty, className, }: DisplayValueProps): react.JSX.Element;
541
+ declare function DisplayValue({ children, size, leading, trailing, empty, interactive, onActivate, className, }: DisplayValueProps): react.JSX.Element;
535
542
 
536
543
  interface FieldModeContextValue {
537
544
  mode: FieldMode;
package/dist/index.d.ts CHANGED
@@ -518,20 +518,27 @@ interface DisplayValueProps {
518
518
  trailing?: ReactNode;
519
519
  /** Shown when the value is empty. Default `—`. */
520
520
  empty?: ReactNode;
521
+ /** When true the value is clickable to enter edit mode (inline click-to-edit). */
522
+ interactive?: boolean;
523
+ /** Called when an interactive value is activated (click / Enter / Space). */
524
+ onActivate?: () => void;
521
525
  className?: string;
522
526
  }
523
527
  /**
524
528
  * The read-only counterpart to an `<input>`. Renders a non-interactive value
525
529
  * with the same size rhythm as the editable control (reusing
526
- * {@link inputSizeClasses}) but without the border / background / focus ring
527
- * view text should read as text, not a disabled box. Dropped into the SAME
528
- * `Field` wrapper the editable control uses, so label / description / error
529
- * chrome stays byte-identical between edit and view.
530
+ * {@link inputSizeClasses}) but without the border / background / focus ring.
530
531
  *
531
- * Carries `data-react-fancy-display` / `data-mode="view"` stable handles so
532
- * agents and tests can locate rendered values (Human+ contract).
532
+ * When `interactive` (inline click-to-edit), the value becomes a focusable,
533
+ * hoverable target that calls `onActivate` on click / Enter / Space to swap in
534
+ * the real control. Dropped into the SAME `Field` wrapper the editable control
535
+ * uses, so label / description / error chrome stays byte-identical between the
536
+ * display and the editor.
537
+ *
538
+ * Carries `data-react-fancy-display` / `data-mode="view"` stable handles for
539
+ * agents and tests (Human+ contract).
533
540
  */
534
- declare function DisplayValue({ children, size, leading, trailing, empty, className, }: DisplayValueProps): react.JSX.Element;
541
+ declare function DisplayValue({ children, size, leading, trailing, empty, interactive, onActivate, className, }: DisplayValueProps): react.JSX.Element;
535
542
 
536
543
  interface FieldModeContextValue {
537
544
  mode: FieldMode;