|
17 | 17 | // This object contains variables that will be used across form components. |
18 | 18 |
|
19 | 19 | import { breakPoints } from "mds"; |
| 20 | +import get from "lodash/get"; |
20 | 21 |
|
21 | 22 | const inputLabelBase = { |
22 | 23 | fontWeight: 600, |
@@ -416,55 +417,55 @@ export const typesSelection = { |
416 | 417 | }, |
417 | 418 | }; |
418 | 419 |
|
419 | | -export const widgetCommon = { |
420 | | - singleValueContainer: { |
| 420 | +export const widgetCommon = (theme: any) => ({ |
| 421 | + "& .singleValueContainer": { |
421 | 422 | height: 200, |
422 | | - border: "#eaeaea 1px solid", |
423 | | - backgroundColor: "#fff", |
424 | | - borderRadius: "3px", |
| 423 | + border: `${get(theme, "borderColor", "#eaeaea")} 1px solid`, |
| 424 | + borderRadius: 2, |
| 425 | + backgroundColor: get(theme, "bgColor", "#fff"), |
425 | 426 | padding: 16, |
426 | 427 | }, |
427 | | - titleContainer: { |
428 | | - color: "#404143", |
| 428 | + "& .titleContainer": { |
| 429 | + color: get(theme, "mutedText", "#87888d"), |
429 | 430 | fontSize: 16, |
430 | 431 | fontWeight: 600, |
431 | 432 | paddingBottom: 14, |
432 | 433 | marginBottom: 5, |
433 | 434 | display: "flex" as const, |
434 | 435 | justifyContent: "space-between" as const, |
435 | 436 | }, |
436 | | - contentContainer: { |
| 437 | + "& .contentContainer": { |
437 | 438 | justifyContent: "center" as const, |
438 | 439 | alignItems: "center" as const, |
439 | 440 | display: "flex" as const, |
440 | 441 | width: "100%", |
441 | 442 | height: 140, |
442 | 443 | }, |
443 | | - singleLegendContainer: { |
| 444 | + "& .singleLegendContainer": { |
444 | 445 | display: "flex", |
445 | 446 | alignItems: "center", |
446 | 447 | padding: "0 10px", |
447 | 448 | maxWidth: "100%", |
448 | 449 | }, |
449 | | - colorContainer: { |
| 450 | + "& .colorContainer": { |
450 | 451 | width: 8, |
451 | 452 | height: 8, |
452 | 453 | minWidth: 8, |
453 | 454 | marginRight: 5, |
454 | 455 | }, |
455 | | - legendLabel: { |
| 456 | + "& .legendLabel": { |
456 | 457 | fontSize: "80%", |
457 | | - color: "#393939", |
| 458 | + color: get(theme, "mutedText", "#87888d"), |
458 | 459 | whiteSpace: "nowrap" as const, |
459 | 460 | overflow: "hidden" as const, |
460 | 461 | textOverflow: "ellipsis" as const, |
461 | 462 | }, |
462 | | - zoomChartCont: { |
| 463 | + "& .zoomChartCont": { |
463 | 464 | position: "relative" as const, |
464 | 465 | height: 340, |
465 | 466 | width: "100%", |
466 | 467 | }, |
467 | | -}; |
| 468 | +}); |
468 | 469 |
|
469 | 470 | export const tooltipCommon = { |
470 | 471 | customTooltip: { |
@@ -646,44 +647,6 @@ export const inputFieldStyles = { |
646 | 647 | }, |
647 | 648 | }; |
648 | 649 |
|
649 | | -const commonStateIcon = { |
650 | | - marginRight: 10, |
651 | | - lineHeight: 1, |
652 | | - display: "inline-flex", |
653 | | - marginTop: 6, |
654 | | -}; |
655 | | - |
656 | | -export const commonDashboardInfocard: any = { |
657 | | - redState: { |
658 | | - color: "#F55B5B", |
659 | | - ...commonStateIcon, |
660 | | - }, |
661 | | - greenState: { |
662 | | - color: "#9FF281", |
663 | | - ...commonStateIcon, |
664 | | - }, |
665 | | - yellowState: { |
666 | | - color: "#F7A25A", |
667 | | - ...commonStateIcon, |
668 | | - }, |
669 | | - greyState: { |
670 | | - color: "grey", |
671 | | - ...commonStateIcon, |
672 | | - }, |
673 | | - healthStatusIcon: { |
674 | | - position: "absolute" as const, |
675 | | - fontSize: 8, |
676 | | - left: 18, |
677 | | - height: 10, |
678 | | - bottom: 2, |
679 | | - marginRight: 10, |
680 | | - "& .min-icon": { |
681 | | - width: 5, |
682 | | - height: 5, |
683 | | - }, |
684 | | - }, |
685 | | -}; |
686 | | - |
687 | 650 | export const tableStyles: any = { |
688 | 651 | tableBlock: { |
689 | 652 | display: "flex", |
|
0 commit comments