![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@simpozio/aha-button
Advanced tools
React component for aha-button.
npm i @simpozio/aha-button
import {useState} from 'react';
import {AhaButton} from '@simpozio/aha-button';
const Component = () => {
const [loading, setLoading] = useState(false);
const onButtonHover = (event) => {/* */}
const onButtonFocus = (event) => {/* */}
const onButtonBlur = (event) => {/* */}
const onButtonClick = (event) => setLoading(true)
return (
<AhaButton
pending={loading}
onHover={onButtonHover}
onFocus={onButtonFocus}
onBlur={onButtonBlur}
onClick={onButtonClick}
/>
)
}
import {useContext} from 'react';
import {AhaButton} from '@simpozio/aha-button';
import {ThemeContext} from 'styled-components`;
const defaultTheme = {
FONT: {
SIZE: {
XS: '1rem',
S: '1.2rem',
M: '1.6rem'
},
FAMILY: {
BASE: '"Helvetica", sans-serif'
},
WEIGHT: {
BASE: 600
},
SPACING: {
M: '0.1em'
}
},
COLOR: {
PRIMARY: 'purple',
INVERT: '#fff'
},
BACKGROUND: {
INVERT: 'purple'
},
TRANSITION: {
TIMING: {
EASE_OUT_QUAD: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)'
},
DURATION: {
BASE: '0.3s'
}
},
MEDIA: {
SM: 768,
MD: 1024
}
};
const Component = () => {
const currentTheme = useContext(ThemeContext);
const onButtonHover = (event) => {/* */}
const onButtonFocus = (event) => {/* */}
const onButtonBlur = (event) => {/* */}
const onButtonClick = (event) => {/* */}
return (
<AhaButton theme={currentTheme || defaultTheme}>Submit</AhaButton>
)
}
Default styling with styled components
import styled from 'styled-components';
import Color from 'color'
import {AhaButton} from '@simpozio/aha-button';
const StyledAhaButton = styled(AhaButton)`
color: #fff;
background: #43a047;
border: 0.2em solid #43a047 !important;
padding: 0 1.6em;
height: 3em;
line-height: 2.8em;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.05em;
transition: border-color linear 0.2s, background-color linear 0.2s,
color linear 0.2s;
svg {
opacity: 0 !important;
}
&:hover,
&:focus,
&:active {
color: rgba(255, 255, 255, 0.9);
background-color: ${Color('#43a047')
.alpha(0.9)
.string()};
border-color: transparent !important;
}
&:disabled {
color: ${Color('#fff')
.alpha(0.6)
.string()};
border-color: transparent !important;
background: ${Color('#43a047')
.alpha(0.6)
.string()};
}
`;
const Component = () => {
const onButtonHover = (event) => {/* */}
const onButtonFocus = (event) => {/* */}
const onButtonBlur = (event) => {/* */}
const onButtonClick = (event) => {/* */}
return (
<StyledAhaButton>Submit</StyledAhaButton>
)
}
In this method you can access all inner props of Aha Button
import {css} from 'styled-components';
import {AhaButton} from '@simpozio/aha-button';
const customCss = css(
({Spin, outlined, pending, theme}) => css`
color: ${theme.COLOR.PRIMARY};
font-weight: 500;
letter-spacing: 0.05em;
text-transform: uppercase;
${Spin} rect {
stroke: #607d8b;
fill: ${outlined ? 'none' : '#607D8B'};
}
&:hover,
&:focus,
&:active {
color: #607d8b;
}
&:disabled {
color: ${Color(outlined ? theme.COLOR.PRIMARY : theme.COLOR.INVERT)
.alpha(0.6)
.string()};
${Spin} rect {
stroke: transparent;
${pending &&
css`
stroke: #607d8b;
`}
}
}
`
);
const Component = () => {
const onButtonHover = (event) => {/* */}
const onButtonFocus = (event) => {/* */}
const onButtonBlur = (event) => {/* */}
const onButtonClick = (event) => {/* */}
return (
<AhaButton styles={customStyles}>Submit</AhaButton>
)
}
Button accepts standard HTML-attributes:
className: string
type: 'submit' | 'button' | 'reset'
disabled: boolean
onFocus: function
onBlur: function
onClick: function
Additional props:
outlined: boolean
- set outlined style of buttonpending: boolean
- set pending state of buttonicon: JSX.Element
- icon component, if you pass icon prop - all children will be ignored!theme: object
- object with theme propsstyles: CSSProp
- custom styles in format of interpolated styled components stringonHover: function
- implemetation of onmouseenter
callbackFAQs
Package for aha-button component
The npm package @simpozio/aha-button receives a total of 0 weekly downloads. As such, @simpozio/aha-button popularity was classified as not popular.
We found that @simpozio/aha-button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.