Skip to content

Commit

Permalink
feat(select): переход к темизации цвета иконки
Browse files Browse the repository at this point in the history
удалена переменная --select-arrow-background, добавлена --select-arrow-color

BREAKING CHANGE: удалена переменная --select-arrow-background
  • Loading branch information
SiebenSieben committed Oct 8, 2021
1 parent adf1dfd commit 112cd95
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,19 @@ exports[`IntlPhoneInput should match snapshot 1`] = `
class="flagIcon m ru"
/>
</span>
<span
<svg
class="arrow"
/>
fill="currentColor"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M12 14L6.5 8.5 5 10l7 7 7-7-1.5-1.5L12 14z"
/>
</svg>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,19 @@ exports[`SelectWithTags Display tests should match snapshot 1`] = `
<div
class="addons rightAddons addons addons-size-xl"
>
<span
<svg
class="arrow"
/>
fill="currentColor"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M12 14L6.5 8.5 5 10l7 7 7-7-1.5-1.5L12 14z"
/>
</svg>
</div>
</div>
</div>
Expand Down Expand Up @@ -182,9 +192,19 @@ exports[`SelectWithTags Display tests should match snapshot with selected tags 1
<div
class="addons rightAddons addons addons-size-xl"
>
<span
<svg
class="arrow"
/>
fill="currentColor"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M12 14L6.5 8.5 5 10l7 7 7-7-1.5-1.5L12 14z"
/>
</svg>
</div>
</div>
</div>
Expand Down
56 changes: 48 additions & 8 deletions packages/select/src/__snapshots__/Component.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ Object {
<div
class="addons rightAddons"
>
<span
<svg
class="arrow arrow"
/>
fill="currentColor"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M12 14L6.5 8.5 5 10l7 7 7-7-1.5-1.5L12 14z"
/>
</svg>
</div>
</div>
</div>
Expand Down Expand Up @@ -87,9 +97,19 @@ Object {
<div
class="addons rightAddons"
>
<span
<svg
class="arrow arrow"
/>
fill="currentColor"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M12 14L6.5 8.5 5 10l7 7 7-7-1.5-1.5L12 14z"
/>
</svg>
</div>
</div>
</div>
Expand Down Expand Up @@ -186,9 +206,19 @@ exports[`Select Snapshots tests should match snapshot with fatal error 1`] = `
<div
class="addons rightAddons"
>
<span
<svg
class="arrow arrow"
/>
fill="currentColor"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M12 14L6.5 8.5 5 10l7 7 7-7-1.5-1.5L12 14z"
/>
</svg>
</div>
</div>
<span
Expand Down Expand Up @@ -239,9 +269,19 @@ exports[`Select Snapshots tests should match snapshot with visibleOptions 1`] =
<div
class="addons rightAddons"
>
<span
<svg
class="arrow arrow open"
/>
fill="currentColor"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M12 14L6.5 8.5 5 10l7 7 7-7-1.5-1.5L12 14z"
/>
</svg>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion packages/select/src/components/arrow/Component.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import cn from 'classnames';
import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
import { ArrowProps } from '../../typings';

import styles from './index.module.css';

export const Arrow = ({ open, className }: ArrowProps) => (
<span className={cn(styles.arrow, className, { [styles.open]: open })} />
<ChevronDownMIcon className={cn(styles.arrow, className, { [styles.open]: open })} />
);
4 changes: 1 addition & 3 deletions packages/select/src/components/arrow/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
display: block;
width: 24px;
height: 24px;
color: var(--select-arrow-color);

background: var(--select-arrow-background);
background-size: cover;
background-position: center;
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/select/src/vars.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:root {
--select-error-color: var(--color-light-text-negative);
--select-arrow-background: url('https://alfabank.st/icons/glyph_chevron-down_m.svg');
--select-arrow-color: var(--color-light-graphic-primary);
--select-arrow-hover-opacity: 0.7;

/* options list */
Expand Down

0 comments on commit 112cd95

Please sign in to comment.