Show Share initials, a readable link, and a copy confirmation.
Filled avatars used white ink on yellow, the link field was a dimmed disabled input, and Copy failed silently when the clipboard API was denied.
This commit is contained in:
1 parent
3a264ac2df
commit
0fe2624002
11 files changed
+132
-14
No files matched your search
@@ -16,6 +16,7 @@ const TextInputContainer = forwardRef<HTMLInputElement, TextInputProps>(
|
||||
state: externalStateProp = "default",
|
||||
inputSize: inputSizeProp = "medium",
|
||||
disabled = false,
|
||||
readOnly = false,
|
||||
error = false,
|
||||
label,
|
||||
placeholder,
|
||||
@@ -109,6 +110,16 @@ const TextInputContainer = forwardRef<HTMLInputElement, TextInputProps>(
|
||||
};
|
||||
}
|
||||
|
||||
if (readOnly) {
|
||||
return {
|
||||
input:
|
||||
"bg-[var(--color-surface-default-secondary)] text-[var(--color-content-default-primary)] border border-solid border-[var(--color-border-default-primary)] cursor-default",
|
||||
label: "text-[var(--color-content-default-secondary)]",
|
||||
inputWrapper: "relative",
|
||||
focusRing: "",
|
||||
};
|
||||
}
|
||||
|
||||
if (error) {
|
||||
const filledStyles = isFilled
|
||||
? "font-medium leading-[20px]"
|
||||
@@ -231,6 +242,7 @@ const TextInputContainer = forwardRef<HTMLInputElement, TextInputProps>(
|
||||
labelId={labelId}
|
||||
state={actualState}
|
||||
disabled={disabled}
|
||||
readOnly={readOnly}
|
||||
error={error}
|
||||
label={label}
|
||||
placeholder={placeholder}
|
||||
|
||||
@@ -16,6 +16,7 @@ export interface TextInputProps extends Omit<
|
||||
*/
|
||||
inputSize?: TextInputSizeValue;
|
||||
disabled?: boolean;
|
||||
readOnly?: boolean;
|
||||
error?: boolean;
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
@@ -43,6 +44,7 @@ export interface TextInputViewProps {
|
||||
labelId: string;
|
||||
state: "default" | "active" | "hover" | "focus";
|
||||
disabled: boolean;
|
||||
readOnly: boolean;
|
||||
error: boolean;
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
|
||||
@@ -13,6 +13,7 @@ export const TextInputView = forwardRef<HTMLInputElement, TextInputViewProps>(
|
||||
name,
|
||||
type,
|
||||
disabled,
|
||||
readOnly = false,
|
||||
error = false,
|
||||
className: _className,
|
||||
containerClasses,
|
||||
@@ -90,6 +91,7 @@ export const TextInputView = forwardRef<HTMLInputElement, TextInputViewProps>(
|
||||
onKeyDown={onKeyDown}
|
||||
onMouseDown={handleMouseDown}
|
||||
disabled={disabled}
|
||||
readOnly={readOnly}
|
||||
maxLength={maxLength}
|
||||
autoComplete={autoComplete}
|
||||
inputMode={inputMode}
|
||||
|
||||
Reference in new issue
Block a user