Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/button style #1446

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/friendly-planes-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@alfalab/core-components-button': minor
---

- Изменены цвета для hint
- Изменена высота строки для размера 48, 56
- Добавлена минимальная высота для размера 48, 56
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion packages/button/src/components/base-button/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ export const BaseButton = React.forwardRef<
})}
>
{children}
{showHint && <span className={commonStyles.hint}>{hint}</span>}
{showHint && (
<span className={cn(commonStyles.hint, colorStyles[colors].hint)}>
{hint}
</span>
)}
</span>
)}

Expand Down
24 changes: 24 additions & 0 deletions packages/button/src/components/base-button/default.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

.primary {
border: 1px solid transparent;

& .hint {
color: var(--button-primary-hint-color);
}
}

.secondary {
Expand All @@ -31,6 +35,10 @@
& > .loader {
color: var(--button-spinner-default-color);
}

& .hint {
color: var(--button-secondary-hint-color);
}
}

.outlined {
Expand All @@ -52,6 +60,10 @@
& > .loader {
color: var(--button-spinner-default-color);
}

& .hint {
color: var(--button-outlined-hint-color);
}
}

.tertiary {
Expand All @@ -73,6 +85,10 @@
& > .loader {
color: var(--button-spinner-default-color);
}

& .hint {
color: var(--button-tertiary-hint-color);
}
}

.filled {
Expand Down Expand Up @@ -113,6 +129,10 @@
& > .loader {
color: var(--button-spinner-default-color);
}

& .hint {
color: var(--button-transparent-base-hint-color);
}
}

.link {
Expand Down Expand Up @@ -148,6 +168,10 @@
& > .loader {
color: var(--button-spinner-default-color);
}

& .hint {
color: var(--button-text-base-hint-color);
}
}

.ghost {
Expand Down
11 changes: 9 additions & 2 deletions packages/button/src/components/base-button/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
min-width: 104px;
min-height: var(--size-s-height);
font-size: 16px;
line-height: 24px;
line-height: 20px;

&.iconOnly {
min-width: var(--size-s-height);
Expand All @@ -110,7 +110,7 @@
min-height: var(--size-m-height);
padding: var(--gap-0) 27px;
font-size: 16px;
line-height: 24px;
line-height: 20px;

&.iconOnly {
min-width: var(--size-m-height);
Expand Down Expand Up @@ -221,6 +221,13 @@
}
}

.text.text {
&.size-48,
&.size-56 {
min-height: 24px;
}
}

/* Disabled */

.component[disabled] {
Expand Down
24 changes: 24 additions & 0 deletions packages/button/src/components/base-button/inverted.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

.primary {
border: 1px solid transparent;

& .hint {
color: var(--button-inverted-primary-hint-color);
}
}

.secondary {
Expand All @@ -31,6 +35,10 @@
& > .loader {
color: var(--button-spinner-inverted-color);
}

& .hint {
color: var(--button-inverted-secondary-hint-color);
}
}

.outlined {
Expand All @@ -52,6 +60,10 @@
& > .loader {
color: var(--button-spinner-inverted-color);
}

& .hint {
color: var(--button-inverted-outlined-hint-color);
}
}

.tertiary {
Expand All @@ -73,6 +85,10 @@
& > .loader {
color: var(--button-spinner-inverted-color);
}

& .hint {
color: var(--button-inverted-tertiary-hint-color);
}
}

.filled {
Expand Down Expand Up @@ -113,6 +129,10 @@
& > .loader {
color: var(--button-spinner-inverted-color);
}

& .hint {
color: var(--button-inverted-transparent-base-hint-color);
}
}

.link {
Expand Down Expand Up @@ -149,6 +169,10 @@
& > .loader {
color: var(--button-spinner-inverted-color);
}

& .hint {
color: var(--button-inverted-text-base-hint-color);
}
}

.ghost {
Expand Down
12 changes: 12 additions & 0 deletions packages/button/src/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
--button-primary-disabled-bg-color: var(--color-light-neutral-translucent-100);
--button-primary-color: var(--color-light-text-primary-inverted);
--button-primary-disabled-color: var(--color-light-text-tertiary);
--button-primary-hint-color: var(--color-light-text-secondary-inverted);

/* accent */
--button-accent-base-bg-color: var(--color-light-accent-primary);
Expand All @@ -37,6 +38,7 @@
--button-secondary-base-border-color: transparent;
--button-secondary-disabled-border-color: transparent;
--button-secondary-color: var(--color-light-text-primary);
--button-secondary-hint-color: var(--color-light-text-secondary);
--button-secondary-disabled-color: var(--color-light-text-tertiary);

/* tertiary */
Expand All @@ -48,6 +50,7 @@
--button-tertiary-base-border-color: var(--color-light-neutral-translucent-1300);
--button-tertiary-disabled-border-color: var(--color-light-neutral-translucent-500);
--button-tertiary-color: var(--color-light-text-primary);
--button-tertiary-hint-color: var(--color-light-text-secondary);
--button-tertiary-disabled-color: var(--color-light-text-tertiary);

/* outlined */
Expand All @@ -59,6 +62,7 @@
--button-outlined-base-border-color: var(--color-light-neutral-translucent-1300);
--button-outlined-disabled-border-color: var(--color-light-neutral-translucent-500);
--button-outlined-color: var(--color-light-text-primary);
--button-outlined-hint-color: var(--color-light-text-secondary);
--button-outlined-disabled-color: var(--color-light-text-tertiary);

/* ghost */
Expand All @@ -69,6 +73,7 @@

/* text */
--button-text-base-color: var(--color-light-text-primary);
--button-text-base-hint-color: var(--color-light-text-secondary);
--button-text-hover-color: var(--color-light-text-primary-hover);
--button-text-active-color: var(--color-light-text-primary-press);
--button-text-disabled-color: var(--color-light-text-tertiary);
Expand All @@ -81,6 +86,7 @@

/* transparent */
--button-transparent-base-color: var(--color-light-text-primary);
--button-transparent-base-hint-color: var(--color-light-text-secondary);
--button-transparent-hover-bg-color: var(--color-light-transparent-default-hover);
--button-transparent-active-bg-color: var(--color-light-transparent-default-press);
--button-transparent-disabled-color: var(--color-light-text-tertiary);
Expand All @@ -99,6 +105,7 @@
);
--button-inverted-primary-disabled-color: var(--color-light-text-tertiary-inverted);
--button-inverted-primary-color: var(--color-light-text-primary);
--button-inverted-primary-hint-color: var(--color-light-text-secondary);

/* accent inverted */
--button-inverted-accent-base-bg-color: var(--color-light-accent-primary-inverted);
Expand All @@ -122,6 +129,7 @@
--button-inverted-secondary-base-border-color: transparent;
--button-inverted-secondary-disabled-border-color: transparent;
--button-inverted-secondary-color: var(--color-light-text-primary-inverted);
--button-inverted-secondary-hint-color: var(--color-light-text-secondary-inverted);
--button-inverted-secondary-disabled-color: var(--color-light-text-tertiary-inverted);

/* tertiary inverted */
Expand All @@ -143,6 +151,7 @@
--color-light-neutral-translucent-500-inverted
);
--button-inverted-tertiary-color: var(--color-light-text-primary-inverted);
--button-inverted-tertiary-hint-color: var(--color-light-text-secondary-inverted);
--button-inverted-tertiary-disabled-color: var(--color-light-text-tertiary-inverted);

/* outlined inverted */
Expand All @@ -164,6 +173,7 @@
--color-light-neutral-translucent-500-inverted
);
--button-inverted-outlined-color: var(--color-light-text-primary-inverted);
--button-inverted-outlined-hint-color: var(--color-light-text-secondary-inverted);
--button-inverted-outlined-disabled-color: var(--color-light-text-tertiary-inverted);

/* ghost inverted */
Expand All @@ -174,6 +184,7 @@

/* text inverted */
--button-inverted-text-base-color: var(--color-light-text-primary-inverted);
--button-inverted-text-base-hint-color: var(--color-light-text-secondary-inverted);
--button-inverted-text-hover-color: var(--color-light-text-primary-inverted-hover);
--button-inverted-text-active-color: var(--color-light-text-primary-inverted-press);
--button-inverted-text-disabled-color: var(--color-light-text-tertiary-inverted);
Expand All @@ -186,6 +197,7 @@

/* transparent inverted */
--button-inverted-transparent-base-color: var(--color-light-text-primary-inverted);
--button-inverted-transparent-base-hint-color: var(--color-light-text-secondary-inverted);
--button-inverted-transparent-hover-bg-color: var(
--color-light-transparent-default-inverted-hover
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading