Skip to content

Commit

Permalink
fix: InsetInput focus style [MDS-1016] (#2557)
Browse files Browse the repository at this point in the history
* fix: InsetInput focus style [MDS-1016]

* fix: error focau state of Input [MDS-1016]
  • Loading branch information
dkireev authored Feb 28, 2024
1 parent 1f35f61 commit aacde18
Show file tree
Hide file tree
Showing 10 changed files with 414 additions and 425 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions next-docs/public/examples/input/Controled.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Input } from '@heathmont/moon-core-tw';
import { Hint, Input } from '@heathmont/moon-core-tw';
import { useState } from 'react';

const Example = () => {
Expand All @@ -12,9 +12,7 @@ const Example = () => {
setColor(e.target.value);
}}
/>
<p className="text-moon-18 pt-2">
<b>Result:</b> {color}
</p>
<Hint>Result: {color}</Hint>
</div>
);
};
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions workspaces/core/src/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
className={mergeClassnames(
'block w-full max-w-full py-0 px-4 m-0 appearance-none text-moon-16 text-bulma',
'transition-shadow box-border relative z-[2] bg-goku shadow-input hover:shadow-input-hov',
'focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus',
'focus-visible::outline-none before:box-border after:box-border placeholder:delay-75',
'focus:shadow-input-focus focus:outline-none focus-visible:shadow-input-focus',
'focus-visible:outline-none before:box-border after:box-border placeholder:delay-75',
'placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity',
'read-only:outline-0 read-only:border-none read-only:cursor-not-allowed',
'read-only:hover:shadow-input read-only:focus:shadow-input',
Expand Down
6 changes: 3 additions & 3 deletions workspaces/core/src/input/private/utils/getTypeStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const getTypeStyles = (type?: InputProps['type']): string | undefined => {
case 'number':
return 'input-number-clear';
case 'date':
return 'ltr:input-d rtl:input-d-rtl [&::-webkit-datetime-edit]:text-trunks';
return 'ltr:input-d rtl:input-d-rtl ';
case 'time':
return 'ltr:input-t rtl:input-t-rtl [&::-webkit-datetime-edit]:text-trunks';
return 'ltr:input-t rtl:input-t-rtl ';
case 'datetime-local':
return 'ltr:input-d rtl:input-dt-local-rtl [&::-webkit-datetime-edit]:text-trunks';
return 'ltr:input-d rtl:input-dt-local-rtl';
default:
return;
}
Expand Down
7 changes: 3 additions & 4 deletions workspaces/core/src/insetInput/InsetInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@ const InsetInputRoot = forwardRef<HTMLInputElement, InsetInputProps>(
'block w-full py-0 px-4 m-0 appearance-none text-moon-16 text-bulma',
'transition-shadow box-border relative z-[2] bg-transparent shadow-input',
'hover:shadow-input-hov focus:shadow-input-focus focus:outline-none',
'focus-visible:shadow-input-focus focus-visible::outline-none',
'focus-visible:shadow-input-err h-14 leading-[3.5rem] rounded-moon-i-sm',
'before:box-border after:box-border placeholder:text-trunks placeholder:opacity-100',
'focus-visible:shadow-input-focus focus-visible:outline-none h-14 leading-[3.5rem]',
'rounded-moon-i-sm placeholder:text-trunks placeholder:opacity-100',
'placeholder:transition-opacity placeholder:delay-75 read-only:outline-0',
'read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input',
'read-only:focus:shadow-input read-only:focus-visible:shadow-input',
'invalid:shadow-input-err invalid:hover:shadow-input-err input-xl-dt-shared',
'invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err',
error &&
'shadow-input-err hover:shadow-input-err focus:shadow-input-err',
'shadow-input-err hover:shadow-input-err focus:shadow-input-err focus-visible:shadow-input-err',
getTypeStyles(rest.type),
isLabel && 'input-xl pt-[1.125rem] input-xl-dt-label'
)}
Expand Down

0 comments on commit aacde18

Please sign in to comment.