mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
✨ styles: button ghost
This commit is contained in:
@@ -48,6 +48,18 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ghost {
|
||||
@apply bg-white;
|
||||
color: var(--primary);
|
||||
border: 1px solid var(--primary);
|
||||
&.loading {
|
||||
&::before {
|
||||
border-top-color: var(--primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.large {
|
||||
padding: 3.2rem 4.8rem;
|
||||
&.loading {
|
||||
|
@@ -5,8 +5,8 @@ import s from './ButtonCommon.module.scss'
|
||||
|
||||
interface Props {
|
||||
children?: React.ReactNode,
|
||||
type?: ButonType,
|
||||
size?: ButtonSize,
|
||||
type?: 'primary' | 'light' | 'ghost',
|
||||
size?: 'default' | 'large',
|
||||
icon?: any,
|
||||
isIconSuffix?: boolean,
|
||||
loading?: boolean,
|
||||
@@ -14,7 +14,7 @@ interface Props {
|
||||
onClick?: () => void,
|
||||
}
|
||||
|
||||
const ButtonCommon = memo(({ type = ButonType.primary, size = ButtonSize.default,
|
||||
const ButtonCommon = memo(({ type = 'primary', size = 'default',
|
||||
icon, loading, disabled, isIconSuffix, children, onClick }: Props) => {
|
||||
return (
|
||||
<button className={classNames({
|
||||
|
@@ -1,5 +1,5 @@
|
||||
@import "../../../styles/utilities";
|
||||
|
||||
.inputCommon {
|
||||
@apply custom-border-radius bg-primary transition-all duration-200 text-white font-bold;
|
||||
@apply custom-border-radius bg-primary transition-all duration-200;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
||||
import { InputType, KEY } from 'src/utils/constanst.utils';
|
||||
import { KEY } from 'src/utils/constanst.utils';
|
||||
import s from './InputCommon.module.scss';
|
||||
|
||||
type Ref = {
|
||||
@@ -10,7 +10,7 @@ interface Props {
|
||||
children?: React.ReactNode,
|
||||
value?: string | number,
|
||||
placeholder?: string,
|
||||
type?: InputType,
|
||||
type?: 'text' | 'number',
|
||||
onChange?: (value: string | number) => void,
|
||||
onEnter?: (value: string | number) => void,
|
||||
}
|
||||
|
@@ -1,20 +1,3 @@
|
||||
|
||||
|
||||
export enum ButonType {
|
||||
primary = 'primary',
|
||||
light = 'light',
|
||||
}
|
||||
|
||||
export enum ButtonSize {
|
||||
default = 'default',
|
||||
large = 'large',
|
||||
}
|
||||
|
||||
export enum InputType {
|
||||
text = 'text',
|
||||
number = 'number',
|
||||
}
|
||||
|
||||
export const KEY = {
|
||||
ENTER: 'Enter',
|
||||
}
|
||||
|
Reference in New Issue
Block a user