From adb051ee7ce73f8550dc231fdf6c74a9d9972f10 Mon Sep 17 00:00:00 2001 From: Josiah Ivey Date: Fri, 24 May 2024 10:30:03 -0700 Subject: [PATCH 1/4] add role toolbar and allow props on wrapper --- src/components/NavBar.tsx | 12 ++++++------ src/components/__snapshots__/NavBar.spec.tsx.snap | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index eeedc5e4a..074c0d3b8 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -1,4 +1,4 @@ -import { navDesktopHeight, navMobileHeight } from '../../src/constants'; +import * as Constants from '../../src/constants'; import styled, { css } from 'styled-components'; import theme from '../../src/theme'; import { NavBarLogo as OpenstaxLogo } from './NavBarLogo'; @@ -44,18 +44,18 @@ type NavBarProps = React.PropsWithChildren<{ justifyContent?: string; }> -export const NavBar = ({ logo = false, maxWidth, ...props }: NavBarProps) => { +export const NavBar = ({ logo = false, maxWidth, navDesktopHeight, navMobileHeight, justifyContent, ...props }: NavBarProps) => { const logoIsObject = typeof logo === 'object'; const renderAnchor = logoIsObject && 'href' in logo; const {alt = 'OpenStax Logo', ...anchorProps} = logoIsObject ? logo : {}; const logoComponent = logo ? : null; - return + return {renderAnchor ? {logoComponent} : logoComponent} {props.children} diff --git a/src/components/__snapshots__/NavBar.spec.tsx.snap b/src/components/__snapshots__/NavBar.spec.tsx.snap index e1f5efe3d..2f1928ecd 100644 --- a/src/components/__snapshots__/NavBar.spec.tsx.snap +++ b/src/components/__snapshots__/NavBar.spec.tsx.snap @@ -3,6 +3,7 @@ exports[`NavBar matches snapshot 1`] = `
Date: Fri, 24 May 2024 10:31:12 -0700 Subject: [PATCH 2/4] fix coverage --- src/components/Radio.spec.tsx | 8 ++++++++ src/components/__snapshots__/Radio.spec.tsx.snap | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/components/Radio.spec.tsx b/src/components/Radio.spec.tsx index aeeb97275..d842b55fe 100644 --- a/src/components/Radio.spec.tsx +++ b/src/components/Radio.spec.tsx @@ -8,4 +8,12 @@ describe('Radio', () => { ).toJSON(); expect(tree).toMatchSnapshot(); }); + + it('matches disabled snapshot', () => { + const tree = renderer.create( + Disabled + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); diff --git a/src/components/__snapshots__/Radio.spec.tsx.snap b/src/components/__snapshots__/Radio.spec.tsx.snap index 822499062..3c2dfd274 100644 --- a/src/components/__snapshots__/Radio.spec.tsx.snap +++ b/src/components/__snapshots__/Radio.spec.tsx.snap @@ -1,5 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Radio matches disabled snapshot 1`] = ` + +`; + exports[`Radio matches snapshot 1`] = `
, ] `; + +exports[`Tooltip uses icon 1`] = ` + +`; From ccb459f2719e93cac722324a1b94cdbb6d186711 Mon Sep 17 00:00:00 2001 From: Josiah Ivey Date: Fri, 24 May 2024 10:47:32 -0700 Subject: [PATCH 4/4] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d203708f0..f671ecf3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstax/ui-components", - "version": "1.7.8", + "version": "1.7.9", "license": "MIT", "source": "./src/index.ts", "types": "./dist/index.d.ts",