mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: hydration
This commit is contained in:
1 parent
369ac113fa
commit
47b583821e
5 files changed
+37
-24
No files matched your search
@@ -9,6 +9,7 @@
|
||||
|
||||
background-color: var(--gray-1);
|
||||
box-shadow: var(--shadow-interactive), var(--shadow-cavity);
|
||||
cursor: text;
|
||||
|
||||
font-size: var(--font-size-regular);
|
||||
color: var(--gray-11);
|
||||
@@ -26,6 +27,17 @@
|
||||
box-shadow: var(--shadow-focus);
|
||||
}
|
||||
|
||||
&[data-disabled="true"] {
|
||||
cursor: not-allowed;
|
||||
background-color: var(--gray-3);
|
||||
|
||||
color: var(--gray-9);
|
||||
|
||||
input::placeholder {
|
||||
color: var(--gray-9);
|
||||
}
|
||||
}
|
||||
|
||||
svg {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
@@ -37,6 +49,7 @@
|
||||
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: inherit;
|
||||
|
||||
font-size: inherit;
|
||||
font-weight: medium;
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface TextFieldProps extends ComponentProps<"input"> {
|
||||
}
|
||||
|
||||
export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
||||
({ children, className, ...props }, ref) => {
|
||||
({ children, className, disabled, ...props }, ref) => {
|
||||
const input = useRef<HTMLInputElement>(null);
|
||||
|
||||
useImperativeHandle(ref, () => input.current!, []);
|
||||
@@ -22,9 +22,10 @@ export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
||||
<div
|
||||
className={classNames("text-field", className)}
|
||||
data-has-icon={children !== undefined}
|
||||
data-disabled={disabled}
|
||||
>
|
||||
{children}
|
||||
<input ref={input} {...props} />
|
||||
<input disabled={disabled} ref={input} {...props} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user