@rafal.lemieszewski/tide-ui 0.7.2 → 0.8.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/components/index.d.ts +2 -2
- package/dist/components/ui/editable.d.ts +61 -44
- package/dist/index.cjs.js +1671 -1671
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5163 -5337
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/listbox.d.ts +0 -43
|
@@ -25,8 +25,8 @@ export { Skeleton, SkeletonAvatar, SkeletonButton, SkeletonCard, SkeletonTable,
|
|
|
25
25
|
export { Switch } from './ui/switch';
|
|
26
26
|
export { Textarea } from './ui/textarea';
|
|
27
27
|
export type { TextareaProps } from './ui/textarea';
|
|
28
|
-
export { Editable, EditablePreview, EditableInput,
|
|
29
|
-
export type { EditableProps,
|
|
28
|
+
export { Editable, EditablePreview, EditableInput, EditableDisplay, EditableField } from './ui/editable';
|
|
29
|
+
export type { EditableProps, EditablePreviewProps, EditableInputProps } from './ui/editable';
|
|
30
30
|
export { FormField, FormLabel, FormControl, FormHelperText, FormErrorMessage } from './ui/form-field';
|
|
31
31
|
export type { FormFieldProps, FormLabelProps, FormControlProps, FormHelperTextProps, FormErrorMessageProps } from './ui/form-field';
|
|
32
32
|
export { Tabs, TabsList, TabsTrigger, TabsContent, TabsGroupLabel } from './ui/tabs';
|
|
@@ -1,53 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
-
export interface EditableContextValue {
|
|
7
|
-
isEditing: boolean;
|
|
8
|
-
value: string;
|
|
9
|
-
originalValue: string;
|
|
10
|
-
onEdit: () => void;
|
|
11
|
-
onCancel: () => void;
|
|
12
|
-
onSubmit: () => void;
|
|
13
|
-
onChange: (value: string) => void;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
invalid?: boolean;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
maxLength?: number;
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
triggerMode: "click" | "dblclick" | "focus";
|
|
20
|
-
previewFontSize?: string;
|
|
21
|
-
setPreviewFontSize: (fontSize: string | undefined) => void;
|
|
22
|
-
}
|
|
23
|
-
declare const useEditable: () => EditableContextValue;
|
|
24
|
-
export interface EditableProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onSubmit">, VariantProps<typeof editableVariants> {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface EditableProps {
|
|
3
|
+
/** The current value of the editable field */
|
|
25
4
|
value?: string;
|
|
5
|
+
/** Default value for uncontrolled usage */
|
|
26
6
|
defaultValue?: string;
|
|
27
|
-
|
|
28
|
-
onEdit?: () => void;
|
|
29
|
-
onCancel?: () => void;
|
|
7
|
+
/** Called when the value is submitted (Enter key or blur) */
|
|
30
8
|
onSubmit?: (value: string) => void;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
maxLength?: number;
|
|
9
|
+
/** Called when the value changes during editing */
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
/** Whether the field is disabled from editing */
|
|
35
12
|
disabled?: boolean;
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
/** Placeholder text when empty */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** Whether to auto-focus when editing starts */
|
|
16
|
+
autoFocus?: boolean;
|
|
17
|
+
/** Whether to select all text when editing starts */
|
|
18
|
+
selectAllOnFocus?: boolean;
|
|
19
|
+
/** Children components (EditablePreview, EditableInput) */
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/** CSS class name */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Inline styles */
|
|
24
|
+
style?: React.CSSProperties;
|
|
38
25
|
}
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
export interface EditablePreviewProps {
|
|
27
|
+
/** CSS class name */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Inline styles */
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
/** Custom render function */
|
|
41
32
|
children?: React.ReactNode;
|
|
42
33
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
export interface EditableInputProps {
|
|
35
|
+
/** CSS class name */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Inline styles */
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
/** Input type */
|
|
40
|
+
type?: string;
|
|
41
|
+
/** Auto-sizing behavior */
|
|
50
42
|
autoResize?: boolean;
|
|
43
|
+
/** Minimum width for auto-resize */
|
|
44
|
+
minWidth?: number;
|
|
45
|
+
/** Character width multiplier for auto-resize */
|
|
46
|
+
charWidth?: number;
|
|
51
47
|
}
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Editable - A compound component for inline editing
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <Editable defaultValue="Click to edit" onSubmit={handleSubmit}>
|
|
54
|
+
* <EditablePreview className="cursor-pointer hover:bg-gray-100 p-2" />
|
|
55
|
+
* <EditableInput className="border-2 border-blue-500 p-2" autoResize />
|
|
56
|
+
* </Editable>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const Editable: React.FC<EditableProps>;
|
|
60
|
+
/**
|
|
61
|
+
* EditablePreview - Shows the value when not editing
|
|
62
|
+
*/
|
|
63
|
+
export declare const EditablePreview: React.FC<EditablePreviewProps>;
|
|
64
|
+
/**
|
|
65
|
+
* EditableInput - Shows the input field when editing
|
|
66
|
+
*/
|
|
67
|
+
export declare const EditableInput: React.FC<EditableInputProps>;
|
|
68
|
+
export { EditablePreview as EditableDisplay };
|
|
69
|
+
export { EditableInput as EditableField };
|
|
70
|
+
export default Editable;
|