Skip to content

Commit

Permalink
feat(confirmation): compact code-input if slotsCount > 6
Browse files Browse the repository at this point in the history
  • Loading branch information
SiebenSieben authored and reme3d2y committed Oct 18, 2021
1 parent 699154b commit 99be0e1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export const CodeInput = forwardRef<HTMLInputElement, CodeInputProps>(
<div
className={cn(styles.component, className, {
[styles.shake]: Boolean(error),
[styles.compact]: slotsCount > 6,
})}
>
{new Array(slotsCount).fill('').map((_, index) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
}
}

.compact .input {
width: 28px;
height: 40px;
}

@keyframes shake {
0% {
transform: translateX(0);
Expand Down
2 changes: 1 addition & 1 deletion packages/confirmation/src/docs/Component.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import vars from '!!raw-loader!../vars.css';
maxWidth: '375px',
margin: '16px 0 0',
padding: '16px',
border: '1px solid #eeeff1',
boxShadow: '0 0 0 1px #eeeff1',
boxSizing: 'border-box'
}}
>
Expand Down

0 comments on commit 99be0e1

Please sign in to comment.