@lax-wp/design-system 0.3.22 → 0.3.23

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,46 @@
1
+ /**
2
+ * Props for the MdInput component
3
+ */
4
+ export interface MdInputProps {
5
+ /** Unique identifier for the markdown input */
6
+ id?: string;
7
+ /** Current markdown value */
8
+ value?: string;
9
+ /** Callback function called when the markdown value changes */
10
+ onChange: (value: string) => void;
11
+ /** Placeholder text for the textarea */
12
+ placeholder?: string;
13
+ /** Number of visible text lines for the textarea */
14
+ rows?: number;
15
+ /** Whether the input is disabled */
16
+ disabled?: boolean;
17
+ /** Additional CSS classes for the wrapper container */
18
+ className?: string;
19
+ /** Additional CSS classes for the textarea */
20
+ textareaClassName?: string;
21
+ /** Additional CSS classes for the preview container */
22
+ previewClassName?: string;
23
+ /** Initial mode (markdown or preview) */
24
+ defaultMode?: "markdown" | "preview";
25
+ /** Current mode (markdown or preview) */
26
+ mode?: "markdown" | "preview";
27
+ /** Label text to display above the input */
28
+ label?: string;
29
+ /** Whether the field is required */
30
+ required?: boolean;
31
+ }
32
+ /**
33
+ * A markdown input component with preview mode support.
34
+ * Features a toggle switch to switch between markdown editing and preview modes.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <MdInput
39
+ * value={markdown}
40
+ * onChange={setMarkdown}
41
+ * placeholder="Enter markdown content..."
42
+ * defaultMode="markdown"
43
+ * />
44
+ * ```
45
+ */
46
+ export declare const MdInput: ({ id, value, onChange, placeholder, rows, disabled, className, textareaClassName, previewClassName, defaultMode, mode: modeProp, label, required, }: MdInputProps) => import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -22,6 +22,8 @@ export { PercentageInputField } from "./components/forms/percentage-input/Percen
22
22
  export type { PercentageInputFieldProps } from "./components/forms/percentage-input/PercentageInputField";
23
23
  export { Toggle } from "./components/forms/toggle/Toggle";
24
24
  export type { ToggleProps, ToggleDirection, } from "./components/forms/toggle/Toggle";
25
+ export { MdInput } from "./components/forms/md-input/MdInput";
26
+ export type { MdInputProps } from "./components/forms/md-input/MdInput";
25
27
  export { MultiFileUpload } from "./components/forms/multi-file-upload/MultiFileUpload";
26
28
  export type { MultiFileUploadProps, FileUploadResult, FileChangeValue, } from "./components/forms/multi-file-upload/MultiFileUpload";
27
29
  export { FileUpload } from "./components/forms/file-upload/FileUpload";