@bloom-housing/ui-components 4.4.1-alpha.15 → 4.4.1-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.4.1-alpha.16](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.4.1-alpha.15...@bloom-housing/ui-components@4.4.1-alpha.16) (2022-06-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * changed aria-selected to aria-current issue [#698](https://github.com/bloom-housing/bloom/issues/698) ([bed1b23](https://github.com/bloom-housing/bloom/commit/bed1b23d63af134542f6760aa70d1ccac87940fa))
12
+
13
+
14
+ ### Features
15
+
16
+ * **sidenav component:** update Prototype SideNav Component for Production Usage ([4ae5e5c](https://github.com/bloom-housing/bloom/commit/4ae5e5c159c7150a808df85b2aa47e443256eb5f)), closes [#698](https://github.com/bloom-housing/bloom/issues/698)
17
+
18
+
19
+
20
+
21
+
6
22
  ## [4.4.1-alpha.15](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.4.1-alpha.14...@bloom-housing/ui-components@4.4.1-alpha.15) (2022-06-07)
7
23
 
8
24
  **Note:** Version bump only for package @bloom-housing/ui-components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloom-housing/ui-components",
3
- "version": "4.4.1-alpha.15",
3
+ "version": "4.4.1-alpha.16",
4
4
  "author": "Sean Albert <sean.albert@exygy.com>",
5
5
  "description": "Shared user interface components for Bloom affordable housing system",
6
6
  "homepage": "https://github.com/bloom-housing/bloom/tree/master/shared/ui-components",
@@ -103,5 +103,5 @@
103
103
  "tailwindcss": "2.2.10",
104
104
  "typesafe-actions": "^5.1.0"
105
105
  },
106
- "gitHead": "f8fadd88315f05fb2368211eb119cb7a6cf5b153"
106
+ "gitHead": "24998ae0a2c0566bebd60573d117496967042f71"
107
107
  }
@@ -3,13 +3,26 @@
3
3
  @apply rounded-lg;
4
4
 
5
5
  li {
6
- &:first-of-type a {
6
+ &:first-of-type {
7
7
  @apply rounded-t-lg;
8
8
  }
9
9
 
10
- &:last-of-type a {
10
+ &:last-of-type {
11
11
  @apply rounded-b-lg;
12
12
  }
13
+
14
+ &.is-current {
15
+ cursor: pointer;
16
+ @apply text-gray-900;
17
+ box-shadow: inset 3px 0px 0px 0px $tailwind-primary;
18
+ @apply block;
19
+ @apply px-4;
20
+ @apply py-2;
21
+ }
22
+
23
+ &:not(:last-child) {
24
+ @apply border-b;
25
+ }
13
26
  }
14
27
 
15
28
  a {
@@ -17,16 +30,9 @@
17
30
  @apply block;
18
31
  @apply px-4;
19
32
  @apply py-2;
20
- @apply border-b;
21
-
22
33
  &:hover {
23
34
  @apply bg-primary-lighter;
24
35
  @apply text-primary;
25
36
  }
26
-
27
- &.is-current {
28
- @apply text-gray-900;
29
- box-shadow: inset 3px 0px 0px 0px $tailwind-primary;
30
- }
31
37
  }
32
38
  }
@@ -0,0 +1,39 @@
1
+ import * as React from "react"
2
+ import { NavigationContext } from "../config/NavigationContext"
3
+ import "./SideNav.scss"
4
+
5
+ export interface SideNavItemProps {
6
+ current?: boolean
7
+ url: string
8
+ label: string
9
+ }
10
+
11
+ export interface SideNavProps {
12
+ navItems?: SideNavItemProps[]
13
+ }
14
+
15
+ const SideNav = (props: SideNavProps) => {
16
+ const { LinkComponent } = React.useContext(NavigationContext)
17
+
18
+ return (
19
+ <nav className="side-nav" aria-label="Secondary navigation">
20
+ <ul>
21
+ {props.navItems?.map((navItem: SideNavItemProps, index: number) => {
22
+ if (navItem.current) {
23
+ return (
24
+ <li className="is-current" key={index} aria-current="page">
25
+ {navItem.label}
26
+ </li>
27
+ )
28
+ }
29
+ return (
30
+ <li key={index}>
31
+ <LinkComponent href={navItem.url}>{navItem.label}</LinkComponent>
32
+ </li>
33
+ )
34
+ })}
35
+ </ul>
36
+ </nav>
37
+ )
38
+ }
39
+ export { SideNav as default, SideNav }
@@ -1,14 +0,0 @@
1
- import * as React from "react"
2
- import "./SideNav.scss"
3
-
4
- export interface SideNavProps {
5
- children: React.ReactNode[]
6
- }
7
-
8
- const SideNav = (props: SideNavProps) => (
9
- <nav className="side-nav" aria-label="Secondary navigation">
10
- <ul>{props.children}</ul>
11
- </nav>
12
- )
13
-
14
- export { SideNav as default, SideNav }