-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add new slider to unstable blocks
- Loading branch information
1 parent
b3dfd03
commit db53d43
Showing
25 changed files
with
1,290 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@import '../../../../styles/mixins.scss'; | ||
@import '../../../../styles/variables.scss'; | ||
|
||
$block: '.#{$ns}slider-new-block-arrow'; | ||
|
||
%flex { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
#{$block} { | ||
@include desktop-tablet-only(); | ||
@extend %flex; | ||
|
||
$root: &; | ||
|
||
width: $sliderArrowSize; | ||
height: $sliderArrowSize; | ||
cursor: pointer; | ||
|
||
&_type_left { | ||
#{$root}__icon-wrapper { | ||
transform: rotate(180deg); | ||
} | ||
} | ||
|
||
&__button { | ||
@include reset-button-style(); | ||
@include shadow(); | ||
@extend %flex; | ||
|
||
width: $sliderArrowSize; | ||
height: $sliderArrowSize; | ||
|
||
color: var(--g-color-text-secondary); | ||
border-radius: 100%; | ||
background-color: var(--g-color-base-background); | ||
box-shadow: 0 4px 24px var(--pc-color-sfx-shadow), 0 2px 8px var(--pc-color-sfx-shadow); | ||
|
||
transition: box-shadow 0.3s $ease-out-cubic, color 0.3s $ease-out-cubic; | ||
|
||
@include focusable(); | ||
} | ||
|
||
&:hover { | ||
#{$root}__button { | ||
color: var(--g-color-text-primary); | ||
box-shadow: 0 2px 12px var(--pc-color-sfx-shadow), 0 4px 24px var(--pc-color-sfx-shadow); | ||
} | ||
} | ||
|
||
&__icon-wrapper { | ||
@extend %flex; | ||
} | ||
|
||
&__icon { | ||
position: relative; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
|
||
import ToggleArrow from '../../../components/ToggleArrow/ToggleArrow'; | ||
import {ClassNameProps} from '../../../models'; | ||
import {block} from '../../../utils'; | ||
import {i18n} from '../i18n'; | ||
|
||
import './Arrow.scss'; | ||
|
||
const b = block('slider-new-block-arrow'); | ||
|
||
export type ArrowType = 'left' | 'right'; | ||
|
||
export interface ArrowProps { | ||
type: ArrowType; | ||
onClick?: () => void; | ||
size?: number; | ||
} | ||
|
||
const Arrow = ({type, onClick, className, size = 16}: ArrowProps & ClassNameProps) => ( | ||
<div className={b({type}, className)}> | ||
<button className={b('button')} onClick={onClick} aria-label={i18n(`arrow-${type}`)}> | ||
<span className={b('icon-wrapper')}> | ||
<ToggleArrow | ||
size={size} | ||
type={'horizontal'} | ||
iconType="navigation" | ||
className={b('icon')} | ||
/> | ||
</span> | ||
</button> | ||
</div> | ||
); | ||
|
||
export default Arrow; |
Oops, something went wrong.