CHANGED: style and components directories, removed redundant imports from styles
ADDED: container and card component, card-subcomponents WIP
This commit is contained in:
44
src/primitive-components/button-components/button/button.tsx
Normal file
44
src/primitive-components/button-components/button/button.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
'use client';
|
||||
|
||||
import { forwardRef } from 'react';
|
||||
import { Icon } from '../../components';
|
||||
import { ButtonProps } from './button.types';
|
||||
import { bool, oneOf, string } from 'prop-types';
|
||||
import { ButtonLayout } from '../button-layout/button-layout';
|
||||
|
||||
/**
|
||||
* Button component
|
||||
** description
|
||||
*/
|
||||
|
||||
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
(
|
||||
{
|
||||
icon,
|
||||
className = '',
|
||||
disabled = false,
|
||||
variant = 'filled',
|
||||
centralRipple = false,
|
||||
...props
|
||||
},
|
||||
ref,
|
||||
) => (
|
||||
<ButtonLayout
|
||||
{...props}
|
||||
centralRipple={centralRipple}
|
||||
className={`${variant} ${className}`}
|
||||
disabled={disabled}
|
||||
ref={ref}
|
||||
>
|
||||
{icon ? <Icon iconSize={20}>{icon}</Icon> : <></>}
|
||||
<span className={'label-large'}>{props.children}</span>
|
||||
</ButtonLayout>
|
||||
),
|
||||
);
|
||||
|
||||
Button.propTypes = {
|
||||
icon: string,
|
||||
children: string,
|
||||
centralRipple: bool,
|
||||
variant: oneOf(['filled', 'outlined', 'elevated', 'tonal', 'text']),
|
||||
};
|
||||
Reference in New Issue
Block a user