Skip to content

Commit

Permalink
Merge pull request #11 from BQXBQX/dev-bqx
Browse files Browse the repository at this point in the history
Dev bqx
  • Loading branch information
BQXBQX authored Feb 6, 2024
2 parents e354706 + 460ceab commit e97fe89
Show file tree
Hide file tree
Showing 12 changed files with 239 additions and 192 deletions.
10 changes: 8 additions & 2 deletions packages/ui/lib/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@
color: var(--primary-color);
border: 1px solid var(--primary-color);
}
&.border {
border: solid 1px #f1f1f1;
background-color: var(--white-color);
color: var(--black-color);
font-weight: 500;
}
&.ghost {
&:hover {
// background-color: #ffffffc4;
&:hover:not(.disabled) {
filter: brightness(1);
backdrop-filter: brightness(0.97);
}
Expand All @@ -40,6 +45,7 @@
&.disabled {
filter: grayscale(1);
cursor: not-allowed;
opacity: 0.4;
&:hover {
backdrop-filter: none;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/lib/Button/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const meta = {
tags: ['autodocs'],
argTypes: {
color: {
options: ['primary', 'secondary', 'ghost', 'danger'],
options: ['primary', 'secondary', 'ghost', 'danger', 'border'],
control: { type: 'select' },
},
size: {
Expand Down
13 changes: 10 additions & 3 deletions packages/ui/lib/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
/**
* The color of the button.
*/
color?: 'primary' | 'secondary' | 'ghost' | 'danger';
color?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'border';
/**
* The size of the button.
*/
Expand All @@ -19,10 +19,17 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
* If `true`, the button will be disabled.
*/
disabled?: boolean;
/**
* className of the button
*/
className?: string;
}

export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ color = 'primary', shadow = 'none', size = 'medium', disabled = false, ...rest }, ref) => {
(
{ color = 'primary', shadow = 'none', size = 'medium', disabled = false, className, ...rest },
ref,
) => {
const btnClass = classnames(
styles['base'],
styles[color],
Expand All @@ -33,7 +40,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
return (
<button
ref={ref}
className={btnClass}
className={`${btnClass} ${className}`}
{...rest}
disabled={disabled}
/>
Expand Down
72 changes: 40 additions & 32 deletions packages/ui/lib/Pagination/Pagination.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,48 @@
display: flex;
flex-direction: row;
gap: 5px;
&.disabled {
.item {
opacity: 0.4 !important;
cursor: not-allowed !important;
}
}
.item {
height: 32px;
.pagination-item {
width: 32px;
border-radius: 8px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
border: solid 1px #f1f1f1;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: none;
&:hover:not(&.more):not(&.active) {
background-color: #f1f1f1;
transition: all 0.2s ease-in-out;
}
&.active {
background-color: var(--primary-color);
color: var(--white-color);
transition: all 0.1s ease-in-out;
}
&.disabled {
opacity: 0.4;
cursor: not-allowed;
}
&.more:hover {
opacity: 0.6 !important;
transition: all 0.2s ease-in-out;
}
justify-content: center;
font-size: 13px !important;
}
// &.disabled {
// .item {
// opacity: 0.4 !important;
// cursor: not-allowed !important;
// }
// }
// .item {
// height: 32px;
// width: 32px;
// border-radius: 8px;
// display: flex;
// justify-content: center;
// align-items: center;
// border: solid 1px #f1f1f1;
// font-size: 13px;
// font-weight: 500;
// cursor: pointer;
// transition: none;
// &:hover:not(&.more):not(&.active) {
// background-color: #f1f1f1;
// transition: all 0.2s ease-in-out;
// }
// &.active {
// background-color: var(--primary-color);
// color: var(--white-color);
// transition: all 0.1s ease-in-out;
// }
// &.disabled {
// opacity: 0.4;
// cursor: not-allowed;
// }
// &.more:hover {
// opacity: 0.6 !important;
// transition: all 0.2s ease-in-out;
// }
// }
}
2 changes: 1 addition & 1 deletion packages/ui/lib/Pagination/Pagination.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const defaultProps: PaginationProps = {
total: 80,
pageSize: 10,
activePage: undefined,
defaultActivePage: 1,
defaultActivePage: 4,
onChange: test,
disabled: false,
};
Expand Down
Loading

0 comments on commit e97fe89

Please sign in to comment.