-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Security Solution][Onboarding] Card icons poor contrast on dar…
…k mode (#210870) (#212716) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution][Onboarding] Card icons poor contrast on dark mode (#210870)](#210870) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Agustina Nahir Ruidiaz","email":"61565784+agusruidiazgd@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-14T12:56:58Z","message":"[Security Solution][Onboarding] Card icons poor contrast on dark mode (#210870)\n\n## Summary\r\n\r\nThis PR addresses https://github.com/elastic/kibana/issues/206086\r\n<img width=\"1142\" alt=\"Screenshot 2025-02-12 at 16 50 32\"\r\nsrc=\"https://github.com/user-attachments/assets/22d3fe32-729a-499b-8f5e-5a1e30f85e09\"\r\n/>\r\n<img width=\"1097\" alt=\"Screenshot 2025-02-12 at 16 51 10\"\r\nsrc=\"https://github.com/user-attachments/assets/778d21ac-eec9-4184-9bc0-7714391217c1\"\r\n/>\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"791be629340680be04d014d1e920935e4cad7ad8","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","Team:Threat Hunting:Explore","ci:cloud-deploy","backport:version","EUI Visual Refresh","v9.1.0"],"title":"[Security Solution][Onboarding] Card icons poor contrast on dark mode","number":210870,"url":"https://github.com/elastic/kibana/pull/210870","mergeCommit":{"message":"[Security Solution][Onboarding] Card icons poor contrast on dark mode (#210870)\n\n## Summary\r\n\r\nThis PR addresses https://github.com/elastic/kibana/issues/206086\r\n<img width=\"1142\" alt=\"Screenshot 2025-02-12 at 16 50 32\"\r\nsrc=\"https://github.com/user-attachments/assets/22d3fe32-729a-499b-8f5e-5a1e30f85e09\"\r\n/>\r\n<img width=\"1097\" alt=\"Screenshot 2025-02-12 at 16 51 10\"\r\nsrc=\"https://github.com/user-attachments/assets/778d21ac-eec9-4184-9bc0-7714391217c1\"\r\n/>\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"791be629340680be04d014d1e920935e4cad7ad8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210870","number":210870,"mergeCommit":{"message":"[Security Solution][Onboarding] Card icons poor contrast on dark mode (#210870)\n\n## Summary\r\n\r\nThis PR addresses https://github.com/elastic/kibana/issues/206086\r\n<img width=\"1142\" alt=\"Screenshot 2025-02-12 at 16 50 32\"\r\nsrc=\"https://github.com/user-attachments/assets/22d3fe32-729a-499b-8f5e-5a1e30f85e09\"\r\n/>\r\n<img width=\"1097\" alt=\"Screenshot 2025-02-12 at 16 51 10\"\r\nsrc=\"https://github.com/user-attachments/assets/778d21ac-eec9-4184-9bc0-7714391217c1\"\r\n/>\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"791be629340680be04d014d1e920935e4cad7ad8"}}]}] BACKPORT--> Co-authored-by: Agustina Nahir Ruidiaz <61565784+agusruidiazgd@users.noreply.github.com>
- Loading branch information
1 parent
c0560be
commit 9e6a1e8
Showing
23 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
Binary file removed
BIN
-124 KB
...lic/onboarding/components/onboarding_body/cards/alerts/images/alert_details.png
Binary file not shown.
Binary file removed
BIN
-65.9 KB
...ion/public/onboarding/components/onboarding_body/cards/alerts/images/alerts.png
Binary file not shown.
Binary file modified
BIN
+142 Bytes
(100%)
...ublic/onboarding/components/onboarding_body/cards/alerts/images/alerts_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.3 KB
.../onboarding/components/onboarding_body/cards/alerts/images/alerts_icon_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file added
BIN
+1.54 KB
...rding/components/onboarding_body/cards/assistant/images/assistant_icon_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions
66
...security_solution/public/onboarding/components/onboarding_body/cards/common/card_icon.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,66 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import React from 'react'; | ||
import { useDarkMode } from '@kbn/kibana-react-plugin/public'; | ||
import { OnboardingCardId } from '../../../../constants'; | ||
import rulesIcon from '../rules/images/rules_icon.png'; | ||
import rulesDarkIcon from '../rules/images/rules_icon_dark.png'; | ||
import integrationsIcon from '../integrations/images/integrations_icon.png'; | ||
import integrationsDarkIcon from '../integrations/images/integrations_icon_dark.png'; | ||
import dashboardsIcon from '../dashboards/images/dashboards_icon.png'; | ||
import dashboardsDarkIcon from '../dashboards/images/dashboards_icon_dark.png'; | ||
import alertsIcon from '../alerts/images/alerts_icon.png'; | ||
import alertsDarkIcon from '../alerts/images/alerts_icon_dark.png'; | ||
import startMigrationIcon from '../siem_migrations/start_migration/images/start_migration_icon.png'; | ||
import startMigrationDarkIcon from '../siem_migrations/start_migration/images/start_migration_icon_dark.png'; | ||
|
||
interface CardIcons { | ||
[key: string]: { | ||
light: string; | ||
dark: string; | ||
}; | ||
} | ||
|
||
const cardIcons: CardIcons = { | ||
[OnboardingCardId.rules]: { | ||
light: rulesIcon, | ||
dark: rulesDarkIcon, | ||
}, | ||
[OnboardingCardId.integrations]: { | ||
light: integrationsIcon, | ||
dark: integrationsDarkIcon, | ||
}, | ||
[OnboardingCardId.dashboards]: { | ||
light: dashboardsIcon, | ||
dark: dashboardsDarkIcon, | ||
}, | ||
[OnboardingCardId.alerts]: { | ||
light: alertsIcon, | ||
dark: alertsDarkIcon, | ||
}, | ||
[OnboardingCardId.siemMigrationsStart]: { | ||
light: startMigrationIcon, | ||
dark: startMigrationDarkIcon, | ||
}, | ||
}; | ||
|
||
interface CardIconProps { | ||
cardId: OnboardingCardId; | ||
} | ||
|
||
export const CardIcon = React.memo<CardIconProps>(({ cardId }) => { | ||
const isDarkMode = useDarkMode(); | ||
const icon = cardIcons[cardId]?.[isDarkMode ? 'dark' : 'light'] || ''; | ||
|
||
if (!icon) return null; | ||
|
||
return <img src={icon} alt={`${cardId}-card-icon`} width={24} height={24} />; | ||
}); | ||
|
||
CardIcon.displayName = 'CardIcon'; | ||
|
||
export const getCardIcon = (cardId: OnboardingCardId) => <CardIcon cardId={cardId} />; |
Binary file removed
BIN
-48.4 KB
...ic/onboarding/components/onboarding_body/cards/dashboards/images/dashboards.png
Binary file not shown.
Binary file modified
BIN
+31 Bytes
(100%)
...boarding/components/onboarding_body/cards/dashboards/images/dashboards_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.47 KB
...ing/components/onboarding_body/cards/dashboards/images/dashboards_icon_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
+8 Bytes
(100%)
...ding/components/onboarding_body/cards/integrations/images/integrations_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.58 KB
...components/onboarding_body/cards/integrations/images/integrations_icon_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file removed
BIN
-69.4 KB
...ution/public/onboarding/components/onboarding_body/cards/rules/images/rules.png
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.../public/onboarding/components/onboarding_body/cards/rules/images/rules_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.27 KB
...ic/onboarding/components/onboarding_body/cards/rules/images/rules_icon_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file removed
BIN
-1.22 KB
...boarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png
Binary file not shown.
Binary file added
BIN
+1.22 KB
...ding_body/cards/siem_migrations/start_migration/images/start_migration_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.27 KB
...body/cards/siem_migrations/start_migration/images/start_migration_icon_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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