feat: Use border-main (#721)

This commit is contained in:
Aman Harwara
2021-11-05 19:29:54 +05:30
committed by GitHub
parent 54c09b9b49
commit 42b3cf5750
14 changed files with 44 additions and 33 deletions

View File

@@ -9,16 +9,20 @@ const baseClass = `rounded px-4 py-1.75 font-bold text-sm fit-content`;
type ButtonType = 'normal' | 'primary' | 'danger';
const buttonClasses: { [type in ButtonType]: string } = {
normal: `${baseClass} bg-default color-text border-solid border-neutral border-1 focus:bg-contrast hover:bg-contrast`,
normal: `${baseClass} bg-default color-text border-solid border-main border-1 focus:bg-contrast hover:bg-contrast`,
primary: `${baseClass} no-border bg-info color-info-contrast hover:brightness-130 focus:brightness-130`,
danger: `${baseClass} bg-default color-danger border-solid border-neutral border-1 focus:bg-contrast hover:bg-contrast`,
danger: `${baseClass} bg-default color-danger border-solid border-main border-1 focus:bg-contrast hover:bg-contrast`,
};
export const Button: FunctionComponent<{
className?: string;
type: ButtonType;
label: string;
onClick: (event: TargetedEvent<HTMLFormElement> | TargetedMouseEvent<HTMLButtonElement>) => void;
onClick: (
event:
| TargetedEvent<HTMLFormElement>
| TargetedMouseEvent<HTMLButtonElement>
) => void;
disabled?: boolean;
}> = ({ type, label, className = '', onClick, disabled = false }) => {
const buttonClass = buttonClasses[type];

View File

@@ -31,10 +31,11 @@ export const DecoratedInput: FunctionalComponent<Props> = ({
'rounded py-1.5 px-3 text-input my-1 h-8 flex flex-row items-center bg-contrast';
const stateClasses = disabled
? 'no-border'
: 'border-solid border-1 border-neutral';
: 'border-solid border-1 border-main';
const classes = `${baseClasses} ${stateClasses} ${className}`;
const inputBaseClasses = 'w-full no-border color-text focus:shadow-none bg-contrast';
const inputBaseClasses =
'w-full no-border color-text focus:shadow-none bg-contrast';
const inputStateClasses = disabled ? 'overflow-ellipsis' : '';
return (
<div className={`${classes} focus-within:ring-info`}>

View File

@@ -44,7 +44,7 @@ export const FloatingLabelInput: FunctionComponent<Props> = forwardRef(
const INPUT_CLASSNAME = `w-full h-full ${
focused || value ? 'pt-6 pb-2' : 'py-2.5'
} px-3 text-input border-1 border-solid border-neutral rounded placeholder-medium text-input focus:ring-info ${
} px-3 text-input border-1 border-solid border-main rounded placeholder-medium text-input focus:ring-info ${
isInvalid ? 'border-dark-red placeholder-dark-red' : ''
} ${inputClassName}`;

View File

@@ -14,7 +14,7 @@ export const Input: FunctionalComponent<Props> = ({
const base = `rounded py-1.5 px-3 text-input my-1 h-8 bg-contrast`;
const stateClasses = disabled
? 'no-border'
: 'border-solid border-1 border-neutral';
: 'border-solid border-1 border-main';
const classes = `${base} ${stateClasses} ${className}`;
return (
<input type="text" className={classes} disabled={disabled} value={text} />

View File

@@ -51,7 +51,7 @@ export const InputWithIcon: FunctionComponent<Props> = forwardRef(
return (
<div
className={`flex items-stretch position-relative bg-default border-1 border-solid border-neutral rounded focus-within:ring-info overflow-hidden ${
className={`flex items-stretch position-relative bg-default border-1 border-solid border-main rounded focus-within:ring-info overflow-hidden ${
disabled ? DISABLED_CLASSNAME : ''
} ${className}`}
>

View File

@@ -17,7 +17,7 @@ export const NotesListOptionsMenu: FunctionComponent<Props> = observer(
({ setShowMenuFalse, application }) => {
const menuClassName =
'sn-dropdown sn-dropdown--animated min-w-70 overflow-y-auto \
border-1 border-solid border-neutral text-sm z-index-dropdown-menu \
border-1 border-solid border-main text-sm z-index-dropdown-menu \
flex flex-col py-2 bottom-0 left-2 absolute';
const [sortBy, setSortBy] = useState(() =>
application.getPreference(PrefKey.SortNotesBy, CollectionSort.CreatedAt)

View File

@@ -4,11 +4,17 @@ export const Title: FunctionComponent = ({ children }) => (
<h2 className="text-base m-0 mb-1">{children}</h2>
);
export const Subtitle: FunctionComponent<{ className?: string }> = ({ children, className = "" }) => (
export const Subtitle: FunctionComponent<{ className?: string }> = ({
children,
className = '',
}) => (
<h4 className={`font-medium text-sm m-0 mb-1 ${className}`}>{children}</h4>
);
export const SubtitleLight: FunctionComponent<{ className?: string }> = ({ children, className = "" }) => (
export const SubtitleLight: FunctionComponent<{ className?: string }> = ({
children,
className = '',
}) => (
<h4 className={`font-normal text-sm m-0 mb-1 ${className}`}>{children}</h4>
);
@@ -19,7 +25,7 @@ export const Text: FunctionComponent<{ className?: string }> = ({
const buttonClasses = `block bg-default color-text rounded border-solid \
border-1 px-4 py-1.75 font-bold text-sm fit-content \
focus:bg-contrast hover:bg-contrast border-neutral`;
focus:bg-contrast hover:bg-contrast border-main`;
export const LinkButton: FunctionComponent<{
label: string;

View File

@@ -7,18 +7,18 @@ const HorizontalLine: FunctionComponent<{ index: number; length: number }> = ({
}) => (index < length - 1 ? <HorizontalSeparator classes="my-4" /> : null);
export const PreferencesGroup: FunctionComponent = ({ children }) => (
<div className="bg-default border-1 border-solid rounded border-neutral px-6 py-6 flex flex-col mb-3">
<div className="bg-default border-1 border-solid rounded border-main px-6 py-6 flex flex-col mb-3">
{Array.isArray(children)
? children
.filter(
(child) => child != undefined && child !== '' && child !== false
)
.map((child, i, arr) => (
<>
{child}
<HorizontalLine index={i} length={arr.length} />
</>
))
.filter(
(child) => child != undefined && child !== '' && child !== false
)
.map((child, i, arr) => (
<>
{child}
<HorizontalLine index={i} length={arr.length} />
</>
))
: children}
</div>
);

View File

@@ -36,7 +36,7 @@ export const PurchaseFlowView: FunctionComponent<PurchaseFlowViewProps> =
return (
<div className="flex items-center justify-center h-full w-full absolute top-left-0 z-index-purchase-flow bg-grey-2">
<div className="relative fit-content">
<div className="relative p-12 mb-4 bg-default border-1 border-solid border-neutral rounded">
<div className="relative p-12 mb-4 bg-default border-1 border-solid border-main rounded">
<SNLogoFull className="mb-5" />
<PurchaseFlowPaneSelector
currentPane={currentPane}