diff --git a/src/frontend/components/button--custom.tsx b/src/frontend/components/button--custom.tsx new file mode 100644 index 00000000..c9371fd0 --- /dev/null +++ b/src/frontend/components/button--custom.tsx @@ -0,0 +1,16 @@ +interface ButtonProps { + text: string; + onClick?: () => void; + className?: string; +} + +const CustomButton = ({ text, onClick, className }: ButtonProps) => ( + +); + +export default CustomButton; diff --git a/src/frontend/components/node--goal--card.tsx b/src/frontend/components/node--goal--card.tsx index 2d8bfa4b..085df651 100644 --- a/src/frontend/components/node--goal--card.tsx +++ b/src/frontend/components/node--goal--card.tsx @@ -40,7 +40,7 @@ export function NodeGoalCard({ goal, ...props }: NodeGoalCardProps) { /> )} -
+
-
+
@@ -77,15 +77,15 @@ export function NodePlan({node, storageData, ...props}: NodePlanProps) {
} {node.body && - ( -
-

Description

-
-
- )} + ( +
+

Description

+
+
+ )} {field_file &&
- +

Goals

@@ -107,6 +107,7 @@ export function NodePlan({node, storageData, ...props}: NodePlanProps) {
- + {listView - ? ( -
    - {field_goals.map((goal, index) => { - let listBorders = "border-top"; - let linkBorders = "" - if (index === 0) { - listBorders = "radius-top-lg"; - linkBorders = "radius-top-lg"; - } else if (index === field_goals.length - 1) { - listBorders = "radius-bottom-lg border-top"; - } - return( -
  • - + ? ( +
      + {field_goals.map((goal, index) => { + let listBorders = "border-top"; + let linkBorders = "" + if (index === 0) { + listBorders = "radius-top-lg"; + linkBorders = "radius-top-lg"; + } else if (index === field_goals.length - 1) { + listBorders = "radius-bottom-lg border-top"; + } + return ( +
    • + {goal.title} - -
    • - ); - })} -
    - ) - : ( -
    -
      - + + ); + })} +
    + ) + : ( +
    +
      + - - {field_goals.map((goal) => { - return( - -
      -
      -

      {goal.title}

      -
      -
      -
      - {/* + + {field_goals.map((goal) => { + return ( + +
      +
      +

      {goal.title}

      +
      +
      +
      + {/* A placeholder image */} +
      -
      - - ) - })} - - -
    -
    - ) + + ) + })} + + +
+
+ ) }
diff --git a/src/frontend/components/view--goal-search.tsx b/src/frontend/components/view--goal-search.tsx index ee920e10..bfd074af 100644 --- a/src/frontend/components/view--goal-search.tsx +++ b/src/frontend/components/view--goal-search.tsx @@ -6,6 +6,7 @@ import { NodeGoalCard } from "./node--goal--card"; import { NodePlanCard } from "./node--plan--card"; import { ViewGoalSearchFulltext } from "./view--goal-search--fulltext"; import ViewGoalFacets from "./view--goal-facets"; +import CustomButton from "./button--custom"; interface ViewGoalSearch { goals: Array, @@ -70,9 +71,11 @@ export default function GoalsSearchView({ filters, goals, total, description }:
{!filtersOpen && (
- + setFiltersOpen(!filtersOpen)} + className={`search-goals--filter ${filtersOpen ? `button--is-open` : ``}`} + />
)}
@@ -96,28 +99,28 @@ export default function GoalsSearchView({ filters, goals, total, description }:
  • - +
  • - +
  • - +
  • - +
@@ -165,4 +168,4 @@ export default function GoalsSearchView({ filters, goals, total, description }:
); -} +} \ No newline at end of file diff --git a/src/frontend/styles/components/button.scss b/src/frontend/styles/components/button.scss new file mode 100644 index 00000000..b4c52040 --- /dev/null +++ b/src/frontend/styles/components/button.scss @@ -0,0 +1,19 @@ +@use "../utilities/mixins.scss" as mixin; + +$goals-gray: rgba(202, 204, 216, 1); + +.button-state-styles { + @include mixin.button-state-styles; +} + +// Gray bg for disabled buttons +button, +.usa-button, +.usa-button--outline { + &:disabled { + background-color: $goals-gray; + } + &:hover:disabled { + background-color: $goals-gray; + } +} diff --git a/src/frontend/styles/components/usa--header.scss b/src/frontend/styles/components/usa--header.scss index a02337d0..69c2010b 100644 --- a/src/frontend/styles/components/usa--header.scss +++ b/src/frontend/styles/components/usa--header.scss @@ -13,7 +13,12 @@ border-bottom: 2px transparent solid; &:hover, &:focus, + &:visited, &.usa-current { border-bottom: 2px #ffffff solid; } } + +header a:visited { + color: #fff; +} diff --git a/src/frontend/styles/project-styles.scss b/src/frontend/styles/project-styles.scss index 8b442c0d..11a8701c 100644 --- a/src/frontend/styles/project-styles.scss +++ b/src/frontend/styles/project-styles.scss @@ -3,6 +3,7 @@ @import "./components/usa--in-page-nav.scss"; @import "./components/usa--breadcrumb.scss"; @import "./components/objective-indicator.scss"; +@import "./components/button.scss"; body { background-color: #e6e6e6; diff --git a/src/frontend/styles/style.scss b/src/frontend/styles/style.scss index 99b58c2a..78ee1c4b 100644 --- a/src/frontend/styles/style.scss +++ b/src/frontend/styles/style.scss @@ -4,10 +4,18 @@ // 2. Load USWDS source code @forward "uswds"; -//// 3. Load custom Sass +// 3. Load extra utility files & helpers. +@use "./utilities/mixins.scss" as mixin; + +// 3. Load custom Sass @forward "project-styles.scss"; $goals-gray: rgba(202, 204, 216, 1); +$ink: #1b1b1b; + +a { + @include mixin.universal-link-styles; +} .goal-card { min-width: 360px; @@ -26,12 +34,35 @@ $goals-gray: rgba(202, 204, 216, 1); padding-left: 394px; } +.goal-card .usa-card__container { + border-width: 1px; +} + +.usa-card__footer { + padding-left: 0; + padding-right: 0; + margin-left: 1.5rem; + margin-right: 1.5rem; +} + +.goal-card:hover .usa-card__container { + border-color: $ink; +} + .side-bar { background-color: white; min-height: 100%; width: 394px; max-width: 394px; padding: 24px; + + a { + color: mixin.$goalsblue-dark; + + &:visited { + color: mixin.$goalsblue; + } + } } .filter-bar { @@ -109,12 +140,22 @@ $goals-gray: rgba(202, 204, 216, 1); &--toggle { margin: 0 auto; + + // 30em = mobile-lg breakpoint for USWDS. Source: https://designsystem.digital.gov/utilities/layout-grid/#responsive-variants. + @media (min-width: 40em) { + display: flex; + gap: 4px; + } + > li { display: inline-block; width: auto; } .active { background: white; + &:hover { + background: white; + } } } } diff --git a/src/frontend/styles/utilities/mixins.scss b/src/frontend/styles/utilities/mixins.scss new file mode 100644 index 00000000..44c8bab3 --- /dev/null +++ b/src/frontend/styles/utilities/mixins.scss @@ -0,0 +1,27 @@ +$ink: #1b1b1b; +$goals-gray: rgba( + 202, + 204, + 216, + 1 +); //@todo Consolidate color in a reused sass file. Or figure out how to use USWDS color tokens. +$goalsblue: #223db2; +$goalsblue-dark: #162152; + +@mixin button-state-styles { + &:hover { + background-color: $goals-gray; + border-color: $goals-gray; + border-bottom-width: 1px; + } + + &.button--is-open { + border-color: $ink; // @todo: Update to uswds token 'ink' + } +} + +@mixin universal-link-styles { + &:hover { + text-decoration: underline; + } +}