@lambda-development/erp-core 0.6.9 → 0.6.11

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,21 @@
1
+ interface ConfirmButtonProps {
2
+ onConfirm: () => void;
3
+ /** Resting trigger content (icon or text). */
4
+ children: React.ReactNode;
5
+ confirmLabel?: React.ReactNode;
6
+ cancelLabel?: React.ReactNode;
7
+ title?: string;
8
+ danger?: boolean;
9
+ disabled?: boolean;
10
+ className?: string;
11
+ timeout?: number;
12
+ /** Armed-button size: "sm" (compact, for icon triggers — default) or "md"
13
+ * (normal button height, to match a full-size labelled trigger). */
14
+ size?: "sm" | "md";
15
+ /** Which side the Cancel button sits on when armed. It should land where the
16
+ * trigger was so a double-click cancels: "left" for a left-aligned trigger
17
+ * (default), "right" for a right-aligned one (e.g. a toolbar delete button). */
18
+ cancelSide?: "left" | "right";
19
+ }
20
+ export declare function ConfirmButton({ onConfirm, children, confirmLabel, cancelLabel, title, danger, disabled, className, timeout, size, cancelSide, }: ConfirmButtonProps): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ type ConfirmOpts = {
3
+ title: string;
4
+ body?: ReactNode;
5
+ confirmLabel?: string;
6
+ cancelLabel?: string;
7
+ danger?: boolean;
8
+ };
9
+ type PromptOpts = ConfirmOpts & {
10
+ defaultValue?: string;
11
+ placeholder?: string;
12
+ inputType?: "text" | "date" | "number";
13
+ };
14
+ export declare function DialogProvider({ children }: {
15
+ children: ReactNode;
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ /** Returns confirm(opts) => Promise<boolean>. Replaces window.confirm. */
18
+ export declare function useConfirm(): (opts: ConfirmOpts) => Promise<boolean>;
19
+ /** Returns prompt(opts) => Promise<string|null>. Replaces window.prompt. */
20
+ export declare function usePrompt(): (opts: PromptOpts) => Promise<string | null>;
21
+ export {};
package/dist/index.d.ts CHANGED
@@ -22,6 +22,8 @@ export type { DoctypeConfig, FieldDef, ChildTableDef, ConversionDef, } from './l
22
22
  export { getNavGroups, registerNavGroup, registerNavItem } from './lib/nav';
23
23
  export type { NavGroup, NavItem } from './lib/nav';
24
24
  export { registerComponent, getComponent } from './lib/component-registry';
25
+ export { DialogProvider, useConfirm, usePrompt } from './components/ui/dialog';
26
+ export { ConfirmButton } from './components/ui/confirm-button';
25
27
  export { DocPager } from './components/document/doc-pager';
26
28
  export { setListContext, getListContext } from './lib/doc-list-context';
27
29
  export type { ListContext } from './lib/doc-list-context';