-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sn-filter-pane): use selected styles in segment line (#418)
Co-authored-by: Daniel Sjöstrand <99665802+DanielS-Qlik@users.noreply.github.com>
- Loading branch information
1 parent
9b6d675
commit 4469bdc
Showing
11 changed files
with
101 additions
and
54 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
56 changes: 27 additions & 29 deletions
56
packages/sn-filter-pane/src/components/FoldedListbox/SelectionSegmentsIndicator.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
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
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
4 changes: 2 additions & 2 deletions
4
...e/src/hooks/__tests__/use-styling.spec.ts → ...use-styling/__tests__/use-styling.spec.ts
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,3 @@ | ||
import useStyling from './use-styling'; | ||
|
||
export default useStyling; |
28 changes: 28 additions & 0 deletions
28
packages/sn-filter-pane/src/hooks/use-styling/selections-style.ts
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,28 @@ | ||
import { stardust } from '@nebula.js/stardust'; | ||
import { IComponentOverrides } from './types'; | ||
import { ISelectionsComponent } from '../types/components'; | ||
|
||
interface IGetSelectionStyles { | ||
componentsOverrides: IComponentOverrides; | ||
stardustTheme: stardust.Theme, | ||
} | ||
|
||
export default function getSelectionsStyle({ componentsOverrides, stardustTheme }: IGetSelectionStyles) { | ||
const selectionColors = componentsOverrides?.selections?.colors || {} as ISelectionsComponent['colors']; | ||
|
||
const getColor = stardustTheme?.getColorPickerColor || (() => false); | ||
|
||
const selected = getColor(selectionColors.selected || {}, false) || '#009845'; | ||
const alternative = getColor(selectionColors.alternative || {}, false) || '#E4E4E4'; | ||
const excluded = getColor(selectionColors.excluded || {}, false) || '#A9A9A9'; | ||
const selectedExcluded = getColor(selectionColors.selectedExcluded || {}, false) || '#A9A9A9'; | ||
const possible = getColor(selectionColors.possible || {}, false) || '#FFFFFF'; | ||
|
||
return { | ||
selected, | ||
alternative, | ||
excluded, | ||
selectedExcluded, | ||
possible, | ||
}; | ||
} |
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 { | ||
IComponent, ISelectionsComponent, IThemeComponent, | ||
} from '../types/components'; | ||
|
||
export type IComponentOverrides = { | ||
theme?: IThemeComponent; | ||
selections?: ISelectionsComponent; | ||
}; | ||
|
||
export interface ICreateStylingArgs { | ||
app?: EngineAPI.IApp, | ||
components?: IComponent[]; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.