Spaces:
Running
Running
Download frontend/src/components/Button.js from xenecode/Jaguar_Project: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/frontend/src/components/Button.js
- Command line
-
hf download hf://spaces/xenecode/Jaguar_Project/frontend/src/components/Button.js
-
curl -L -o Button.js https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/frontend/src/components/Button.js
1.34 kB
| import React from 'react'; | |
| const Button = ({ text, onClick, type = 'primary', disabled = false, className = '' }) => { | |
| const buttonTypes = { | |
| primary: 'border-hmi-accent bg-hmi-accent text-hmi-bg [@media(hover:hover)]:hover:brightness-110', | |
| secondary: 'border-hmi-line bg-hmi-raised text-hmi-text [@media(hover:hover)]:hover:border-hmi-muted', | |
| success: 'border-hmi-ok bg-hmi-ok text-hmi-bg', | |
| danger: 'border-red-600 bg-red-600 text-white [@media(hover:hover)]:hover:bg-red-500', | |
| outline: 'border-hmi-line bg-transparent text-hmi-text [@media(hover:hover)]:hover:border-hmi-muted', | |
| link: 'border-transparent bg-transparent text-hmi-accent hover:underline', | |
| }; | |
| return ( | |
| <button | |
| type="button" | |
| className={` | |
| inline-flex min-h-[44px] items-center justify-center gap-2 border-2 px-5 | |
| text-sm font-semibold uppercase tracking-[0.08em] | |
| select-none touch-manipulation transition active:translate-y-px | |
| focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hmi-accent | |
| disabled:cursor-not-allowed disabled:opacity-50 disabled:active:translate-y-0 | |
| ${buttonTypes[type]} | |
| ${className} | |
| `} | |
| onClick={onClick} | |
| disabled={disabled} | |
| > | |
| {text} | |
| </button> | |
| ); | |
| }; | |
| export default Button; | |