-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Denis 🎃 Khripkov
committed
Dec 18, 2024
1 parent
bd71aed
commit 983edf5
Showing
9 changed files
with
77 additions
and
9 deletions.
There are no files selected for viewing
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,6 @@ | ||
--- | ||
'@alfalab/core-components-select': minor | ||
--- | ||
|
||
- Добавлен сплит select/option | ||
- В select/shared добавлены OptionDesktop и OptionMobile |
9 changes: 9 additions & 0 deletions
9
packages/select/src/components/option/Component.responsive.tsx
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,9 @@ | ||
import React from 'react'; | ||
|
||
import type { OptionProps } from '../../typings'; | ||
|
||
import { OptionDesktop } from './desktop/Component' | ||
import { OptionMobile } from './mobile/Component' | ||
|
||
export const OptionResponsive = ({mobile, ...props}: OptionProps) => | ||
mobile ? <OptionMobile {...props} /> : <OptionDesktop {...props} /> |
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
11 changes: 11 additions & 0 deletions
11
packages/select/src/components/option/desktop/Component.tsx
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,11 @@ | ||
import React from 'react'; | ||
|
||
import type { OptionCommonProps } from '../../../typings'; | ||
import { Checkmark as DefaultCheckMark } from '../../checkmark'; | ||
import { OptionBase } from '../Component'; | ||
|
||
import styles from './index.module.css'; | ||
|
||
export const OptionDesktop = ({ Checkmark = DefaultCheckMark, ...props }: OptionCommonProps) => ( | ||
<OptionBase {...props} mobile={false} Checkmark={Checkmark} styles={styles} /> | ||
); |
13 changes: 13 additions & 0 deletions
13
packages/select/src/components/option/desktop/index.module.css
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,13 @@ | ||
@import '../../../../../vars/src/index.css'; | ||
@import '../../../vars.css'; | ||
@import '../index.module.css'; | ||
|
||
.highlighted { | ||
background: var(--select-option-hover-background); | ||
color: var(--select-option-hover-color); | ||
|
||
&:before, | ||
& + .option:before { | ||
opacity: 0; | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from './Component'; | ||
export * from './desktop/Component'; | ||
export * from './mobile/Component'; | ||
export { OptionResponsive as Option } from './Component.responsive'; |
11 changes: 11 additions & 0 deletions
11
packages/select/src/components/option/mobile/Component.tsx
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,11 @@ | ||
import React from 'react'; | ||
|
||
import type { OptionCommonProps } from '../../../typings'; | ||
import { Checkmark as DefaultCheckMark } from '../../checkmark-mobile'; | ||
import { OptionBase } from '../Component'; | ||
|
||
import styles from './index.module.css'; | ||
|
||
export const OptionMobile = ({ Checkmark = DefaultCheckMark, ...props }: OptionCommonProps) => ( | ||
<OptionBase {...props} mobile={true} Checkmark={Checkmark} styles={styles} /> | ||
); |
3 changes: 3 additions & 0 deletions
3
packages/select/src/components/option/mobile/index.module.css
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,3 @@ | ||
@import '../../../../../vars/src/index.css'; | ||
@import '../../../vars.css'; | ||
@import '../index.module.css'; |
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