-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: remove tailwind from input file component * feat: remove tailwind from components * chore: remove styles from index.tsx * style: remove tailwind * style: fix global styles * style: fix menu-item, nfa-row, skeleton detail nfa * style: fix mint nfa/ create ap align * Update ui/src/components/core/color-picker/color-picker.tsx Co-authored-by: Felipe Mendes <[email protected]> * Update ui/src/components/core/color-picker/color-picker.tsx Co-authored-by: Felipe Mendes <[email protected]> * Update ui/src/components/core/switch/switch.styles.ts Co-authored-by: Felipe Mendes <[email protected]> * Update ui/src/index.tsx Co-authored-by: Felipe Mendes <[email protected]> * Update ui/src/views/mint/nfa-step/verify-step/verify-nfa-step.styles.ts Co-authored-by: Felipe Mendes <[email protected]> * Update ui/src/theme/globals.ts Co-authored-by: Felipe Mendes <[email protected]> * style: fix styles for switch --------- Co-authored-by: Felipe Mendes <[email protected]>
- Loading branch information
Showing
38 changed files
with
292 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
ui/src/components/core/color-picker/color-picker.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Flex } from '@/components'; | ||
import { styled } from '@/theme'; | ||
|
||
export const ColorPickerStyles = { | ||
Container: styled('div', { | ||
position: 'relative', | ||
|
||
[`${Flex}`]: { | ||
gap: '$3h', | ||
alignItems: 'center', | ||
}, | ||
}), | ||
Input: styled('input', { | ||
position: 'absolute', | ||
right: '4rem', | ||
height: '1.25rem', | ||
}), | ||
Image: styled('img', { | ||
display: 'none', | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { Switch } from '@headlessui/react'; | ||
|
||
import { styled } from '@/theme'; | ||
|
||
export const SwitchStyles = { | ||
Wrapper: styled(Switch, { | ||
position: 'relative', | ||
display: 'inline-flex', | ||
height: '2rem', | ||
width: '4.625rem', | ||
flexShrink: 0, | ||
cursor: 'pointer', | ||
borderRadius: '$full', | ||
borderWidth: '0.125rem', | ||
borderColor: 'transparent', | ||
|
||
transitionProperty: 'all', | ||
|
||
transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)', | ||
transitionDuration: '200ms', | ||
|
||
'&:focus': { | ||
outline: '0.125rem solid transparent', | ||
outlineOffset: '0.125rem', | ||
}, | ||
|
||
variants: { | ||
isChecked: { | ||
true: { | ||
backgroundColor: '$green4', | ||
}, | ||
false: { | ||
backgroundColor: '$red4', | ||
}, | ||
}, | ||
}, | ||
}), | ||
Text: styled('span', { | ||
position: 'absolute', | ||
top: '25%', | ||
fontSize: '$sm', | ||
|
||
variants: { | ||
checked: { | ||
true: { | ||
right: '0.75rem', | ||
color: '$green11', | ||
}, | ||
false: { | ||
left: '1rem', | ||
color: '$red11', | ||
}, | ||
}, | ||
}, | ||
}), | ||
Dot: styled('span', { | ||
position: 'absolute', | ||
top: '5px', | ||
left: '5px', | ||
pointerEvents: 'none', | ||
display: 'inline-block', | ||
height: '1.25rem', | ||
width: '1.25rem', | ||
borderRadius: '$full', | ||
|
||
transitionProperty: 'all', | ||
|
||
transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)', | ||
transitionDuration: '200ms', | ||
|
||
variants: { | ||
checked: { | ||
true: { | ||
backgroundColor: '$green11', | ||
transform: 'translateX(0px)', | ||
}, | ||
false: { | ||
backgroundColor: '$red11', | ||
transform: 'translateX(2.625rem)', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
import { Switch as SwitchComponent } from '@headlessui/react'; | ||
import { Switch as SwitchHeadless } from '@headlessui/react'; | ||
import React from 'react'; | ||
|
||
import { SwitchStyles as S } from './switch.styles'; | ||
|
||
type SwitchProps = { | ||
checked: boolean; | ||
onChange: (checked: boolean) => void; | ||
}; | ||
|
||
export const Switch: React.FC<SwitchProps> = ({ checked, onChange }) => ( | ||
<SwitchComponent | ||
<SwitchHeadless | ||
as={S.Wrapper} | ||
checked={checked} | ||
onChange={onChange} | ||
className={`${checked ? 'bg-green4' : 'bg-red4'} | ||
relative inline-flex h-[32px] w-[74px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`} | ||
isChecked={checked} | ||
> | ||
<span | ||
className={`absolute top-1 ${ | ||
checked ? 'right-3 text-green11' : 'text-red11 left-4' | ||
}`} | ||
> | ||
{checked ? 'Yes' : 'No'} | ||
</span> | ||
<span | ||
aria-hidden="true" | ||
className={`${ | ||
checked ? 'bg-green11 translate-x-0' : 'bg-red11 translate-x-[2.625rem]' | ||
} | ||
absolute top-1 left-1 pointer-events-none inline-block h-[20px] w-[20px] transform rounded-full shadow-lg ring-0 transition duration-200 ease-in-out`} | ||
/> | ||
</SwitchComponent> | ||
<S.Text checked={checked}>{checked ? 'Yes' : 'No'}</S.Text> | ||
<S.Dot checked={checked} /> | ||
</SwitchHeadless> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.