From 192b1b2b75beb3b67caaec72b2dcff824964e5df Mon Sep 17 00:00:00 2001 From: Wilbert Mui Date: Wed, 26 Apr 2023 23:09:09 -0700 Subject: [PATCH] refactor: update side-nav to point to new @weave-design --- deprecated/side-nav/README.md | 4 +--- deprecated/side-nav/package.json | 22 +++++++++---------- .../src/CollapseButton/CollapseButton.js | 6 ++--- deprecated/side-nav/src/Group/Group.js | 4 ++-- deprecated/side-nav/src/Link/Link.js | 8 +++---- .../presenters/ModuleCompactPresenter.js | 4 ++-- .../presenters/ModuleCompactPresenter.test.js | 2 +- .../src/Module/presenters/ModulePresenter.js | 4 ++-- .../src/Module/presenters/TitlePresenter.js | 6 ++--- deprecated/side-nav/src/Search/Search.js | 6 ++--- .../src/SideNavSkeleton/SideNavSkeleton.js | 2 +- .../side-nav/src/Submodule/Submodule.js | 6 ++--- .../src/__stories__/ExampleSideNav.js | 4 ++-- .../src/__stories__/SideNavCompact.story.js | 2 +- .../src/__stories__/SideNavContainer.story.js | 2 +- .../src/__stories__/SideNavModule.story.js | 2 +- .../__stories__/SideNavModuleCompact.story.js | 2 +- .../__stories__/SideNavModuleGroup.story.js | 2 +- .../side-nav/src/containers/BelowTopNav.js | 4 ++-- .../src/containers/BelowTopNavCompact.js | 4 ++-- deprecated/side-nav/src/containers/Docked.js | 2 +- .../src/presenters/ExternalLinkIcon.js | 2 +- .../src/presenters/ExternalLinkIcon.test.js | 2 +- deprecated/side-nav/src/presenters/SideNav.js | 12 +++++----- 24 files changed, 56 insertions(+), 58 deletions(-) diff --git a/deprecated/side-nav/README.md b/deprecated/side-nav/README.md index c9cae3e4a3..812365cba3 100644 --- a/deprecated/side-nav/README.md +++ b/deprecated/side-nav/README.md @@ -2,12 +2,10 @@ The Side Navigation component provides the highest level navigation tier and allows the user to switch between modules. It also houses secondary and legal/copyright links. -Read more about when and how to use the SideNav component [on the internal wiki](https://wiki.autodesk.com/x/S3n2Eg). - ## Getting started ```bash -yarn add @hig/side-nav @hig/theme-context @hig/theme-data +yarn add @hig/side-nav @weave-design/theme-context @weave-design/theme-data ``` ### Import diff --git a/deprecated/side-nav/package.json b/deprecated/side-nav/package.json index f25d00f100..1de2d84f42 100644 --- a/deprecated/side-nav/package.json +++ b/deprecated/side-nav/package.json @@ -1,6 +1,6 @@ { "name": "@hig/side-nav", - "version": "3.1.1", + "version": "4.0.1", "description": "HIG SideNav components", "author": "Autodesk Inc.", "license": "Apache-2.0", @@ -18,13 +18,13 @@ "build/*" ], "dependencies": { - "@hig/icon-button": "^3.1.0", - "@hig/icons": "^4.1.0", - "@hig/skeleton-item": "^2.1.0", - "@hig/surface": "^2.1.0", - "@hig/text-link": "^2.1.0", - "@hig/typography": "^2.1.0", - "@hig/utils": "^0.4.1", + "@weave-design/icon-button": "^1.0.0", + "@weave-design/icons": "^1.1.0", + "@weave-design/skeleton-item": "^1.0.0", + "@weave-design/surface": "^1.0.0", + "@weave-design/text-link": "^1.0.0", + "@weave-design/typography": "^1.0.0", + "@weave-design/utils": "^1.0.0", "emotion": "^10.0.0", "prop-types": "^15.7.1" }, @@ -36,9 +36,9 @@ "@weave-design/semantic-release-config": "^1.0.0" }, "peerDependencies": { - "@hig/theme-context": "^4.2.0", - "@hig/theme-data": "^3.4.2", - "react": "^17.0.0" + "@weave-design/theme-context": "^1.0.0", + "@weave-design/theme-data": "^1.3.0", + "react": "^17.0.0 || ^18.0.0" }, "scripts": { "build": "weave-scripts-build", diff --git a/deprecated/side-nav/src/CollapseButton/CollapseButton.js b/deprecated/side-nav/src/CollapseButton/CollapseButton.js index 9752671b95..7b5129727f 100644 --- a/deprecated/side-nav/src/CollapseButton/CollapseButton.js +++ b/deprecated/side-nav/src/CollapseButton/CollapseButton.js @@ -1,9 +1,9 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import { CaretDownMUI, CaretDownSUI } from "@hig/icons"; -import ThemeContext from "@hig/theme-context"; -import { memoizeCreateButtonEventHandlers } from "@hig/utils"; +import { CaretDownMUI, CaretDownSUI } from "@weave-design/icons"; +import ThemeContext from "@weave-design/theme-context"; +import { memoizeCreateButtonEventHandlers } from "@weave-design/utils"; import stylesheet from "./stylesheet"; /** diff --git a/deprecated/side-nav/src/Group/Group.js b/deprecated/side-nav/src/Group/Group.js index d59f8497d2..fac752caca 100644 --- a/deprecated/side-nav/src/Group/Group.js +++ b/deprecated/side-nav/src/Group/Group.js @@ -1,8 +1,8 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import ThemeContext from "@hig/theme-context"; -import { createCustomClassNames } from "@hig/utils"; +import ThemeContext from "@weave-design/theme-context"; +import { createCustomClassNames } from "@weave-design/utils"; import stylesheet from "./stylesheet"; export default class Group extends Component { diff --git a/deprecated/side-nav/src/Link/Link.js b/deprecated/side-nav/src/Link/Link.js index 97f16a0c21..e1c882f502 100644 --- a/deprecated/side-nav/src/Link/Link.js +++ b/deprecated/side-nav/src/Link/Link.js @@ -1,9 +1,9 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; -import { sizes as iconSizes } from "@hig/icons"; -import ThemeContext from "@hig/theme-context"; -import Typography from "@hig/typography"; -import { createCustomClassNames } from "@hig/utils"; +import { sizes as iconSizes } from "@weave-design/icons"; +import ThemeContext from "@weave-design/theme-context"; +import Typography from "@weave-design/typography"; +import { createCustomClassNames } from "@weave-design/utils"; import { css, cx } from "emotion"; import { AVAILABLE_TARGETS } from "../targets"; diff --git a/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.js b/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.js index c9b04ea3a9..a6c1b471de 100644 --- a/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.js +++ b/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.js @@ -1,11 +1,11 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import ThemeContext from "@hig/theme-context"; +import ThemeContext from "@weave-design/theme-context"; import { createCustomClassNames, memoizeCreateButtonEventHandlers, -} from "@hig/utils"; +} from "@weave-design/utils"; import stylesheet from "./stylesheet"; export default class ModuleCompact extends Component { diff --git a/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.test.js b/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.test.js index 754dd5e8ae..c8ec7ac798 100644 --- a/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.test.js +++ b/deprecated/side-nav/src/Module/presenters/ModuleCompactPresenter.test.js @@ -1,5 +1,5 @@ import React from "react"; -import { Collaboration24 } from "@hig/icons"; +import { Collaboration24 } from "@weave-design/icons"; import { takeSnapshotsOf } from "@weave-design/jest-preset/helpers"; import ModuleCompactPresenter from "./ModuleCompactPresenter"; diff --git a/deprecated/side-nav/src/Module/presenters/ModulePresenter.js b/deprecated/side-nav/src/Module/presenters/ModulePresenter.js index 1664af1bfe..334856f00c 100644 --- a/deprecated/side-nav/src/Module/presenters/ModulePresenter.js +++ b/deprecated/side-nav/src/Module/presenters/ModulePresenter.js @@ -1,8 +1,8 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import ThemeContext from "@hig/theme-context"; -import { createCustomClassNames } from "@hig/utils"; +import ThemeContext from "@weave-design/theme-context"; +import { createCustomClassNames } from "@weave-design/utils"; import CollapseButton from "../../CollapseButton"; import TitlePresenter from "./TitlePresenter"; diff --git a/deprecated/side-nav/src/Module/presenters/TitlePresenter.js b/deprecated/side-nav/src/Module/presenters/TitlePresenter.js index 4631b6f9e7..4b3ca3c4ec 100644 --- a/deprecated/side-nav/src/Module/presenters/TitlePresenter.js +++ b/deprecated/side-nav/src/Module/presenters/TitlePresenter.js @@ -2,12 +2,12 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import { sizes as iconSizes } from "@hig/icons"; -import ThemeContext from "@hig/theme-context"; +import { sizes as iconSizes } from "@weave-design/icons"; +import ThemeContext from "@weave-design/theme-context"; import { createCustomClassNames, memoizeCreateButtonEventHandlers, -} from "@hig/utils"; +} from "@weave-design/utils"; import { targets, AVAILABLE_TARGETS } from "../../targets"; import ExternalLinkIcon from "../../presenters/ExternalLinkIcon"; diff --git a/deprecated/side-nav/src/Search/Search.js b/deprecated/side-nav/src/Search/Search.js index 049ee4e57e..cc577ea82c 100644 --- a/deprecated/side-nav/src/Search/Search.js +++ b/deprecated/side-nav/src/Search/Search.js @@ -1,12 +1,12 @@ import React, { useState, useEffect } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import ThemeContext from "@hig/theme-context"; -import { Search24, CloseLUI } from "@hig/icons"; +import ThemeContext from "@weave-design/theme-context"; +import { Search24, CloseLUI } from "@weave-design/icons"; import { createCustomClassNames, memoizeCreateButtonEventHandlers, -} from "@hig/utils"; +} from "@weave-design/utils"; import stylesheet from "./stylesheet"; const Search = (props) => { diff --git a/deprecated/side-nav/src/SideNavSkeleton/SideNavSkeleton.js b/deprecated/side-nav/src/SideNavSkeleton/SideNavSkeleton.js index cf887bb08a..283d45ede1 100644 --- a/deprecated/side-nav/src/SideNavSkeleton/SideNavSkeleton.js +++ b/deprecated/side-nav/src/SideNavSkeleton/SideNavSkeleton.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import SkeletonItem from "@hig/skeleton-item"; +import SkeletonItem from "@weave-design/skeleton-item"; import stylesheet from "./stylesheet"; const skeletonItemStyles = Object.freeze([ diff --git a/deprecated/side-nav/src/Submodule/Submodule.js b/deprecated/side-nav/src/Submodule/Submodule.js index 0627392d93..36500d9f98 100644 --- a/deprecated/side-nav/src/Submodule/Submodule.js +++ b/deprecated/side-nav/src/Submodule/Submodule.js @@ -1,12 +1,12 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import { sizes as iconSizes } from "@hig/icons"; -import ThemeContext from "@hig/theme-context"; +import { sizes as iconSizes } from "@weave-design/icons"; +import ThemeContext from "@weave-design/theme-context"; import { createCustomClassNames, memoizeCreateButtonEventHandlers, -} from "@hig/utils"; +} from "@weave-design/utils"; import { AVAILABLE_TARGETS, targets } from "../targets"; import ExternalLinkIcon from "../presenters/ExternalLinkIcon"; diff --git a/deprecated/side-nav/src/__stories__/ExampleSideNav.js b/deprecated/side-nav/src/__stories__/ExampleSideNav.js index 6edbe60ab6..db2bae45ef 100644 --- a/deprecated/side-nav/src/__stories__/ExampleSideNav.js +++ b/deprecated/side-nav/src/__stories__/ExampleSideNav.js @@ -1,6 +1,6 @@ import React from "react"; -import { Graph24, ProductsAndServices24, Collaboration24 } from "@hig/icons"; -import Typography from "@hig/typography"; +import { Graph24, ProductsAndServices24, Collaboration24 } from "@weave-design/icons"; +import Typography from "@weave-design/typography"; import SideNav from "../index"; diff --git a/deprecated/side-nav/src/__stories__/SideNavCompact.story.js b/deprecated/side-nav/src/__stories__/SideNavCompact.story.js index af8aea1290..b9ce984674 100644 --- a/deprecated/side-nav/src/__stories__/SideNavCompact.story.js +++ b/deprecated/side-nav/src/__stories__/SideNavCompact.story.js @@ -1,6 +1,6 @@ import React from "react"; import { ArgsTable, Primary, Stories } from "@storybook/addon-docs"; -import { Collaboration24, Graph24, ProductsAndServices24 } from "@hig/icons"; +import { Collaboration24, Graph24, ProductsAndServices24 } from "@weave-design/icons"; import SideNav, { BelowTopNavCompact } from "../index"; import Readme from "../../README.md"; diff --git a/deprecated/side-nav/src/__stories__/SideNavContainer.story.js b/deprecated/side-nav/src/__stories__/SideNavContainer.story.js index 98de5fdf66..6ce4f9887c 100644 --- a/deprecated/side-nav/src/__stories__/SideNavContainer.story.js +++ b/deprecated/side-nav/src/__stories__/SideNavContainer.story.js @@ -1,6 +1,6 @@ import React from "react"; import { ArgsTable, Primary, Stories } from "@storybook/addon-docs"; -import Surface from "@hig/surface"; +import Surface from "@weave-design/surface"; import SideNav, { BelowTopNavCompact, Docked } from "../index"; import ExampleSideNav from "./ExampleSideNav"; diff --git a/deprecated/side-nav/src/__stories__/SideNavModule.story.js b/deprecated/side-nav/src/__stories__/SideNavModule.story.js index d4418b4044..6adfac3d35 100644 --- a/deprecated/side-nav/src/__stories__/SideNavModule.story.js +++ b/deprecated/side-nav/src/__stories__/SideNavModule.story.js @@ -1,6 +1,6 @@ import React from "react"; import { ArgsTable, Primary, Stories } from "@storybook/addon-docs"; -import { Graph24 } from "@hig/icons"; +import { Graph24 } from "@weave-designweave-design/icons"; import SideNav from "../index"; import Readme from "../../README.md"; diff --git a/deprecated/side-nav/src/__stories__/SideNavModuleCompact.story.js b/deprecated/side-nav/src/__stories__/SideNavModuleCompact.story.js index 9984fa1dfc..d01e3e7d62 100644 --- a/deprecated/side-nav/src/__stories__/SideNavModuleCompact.story.js +++ b/deprecated/side-nav/src/__stories__/SideNavModuleCompact.story.js @@ -1,6 +1,6 @@ import React from "react"; import { ArgsTable, Primary, Stories } from "@storybook/addon-docs"; -import { Graph24 } from "@hig/icons"; +import { Graph24 } from "@weave-design/icons"; import SideNav from "../index"; import Readme from "../../README.md"; diff --git a/deprecated/side-nav/src/__stories__/SideNavModuleGroup.story.js b/deprecated/side-nav/src/__stories__/SideNavModuleGroup.story.js index c56631764a..8d190ef422 100644 --- a/deprecated/side-nav/src/__stories__/SideNavModuleGroup.story.js +++ b/deprecated/side-nav/src/__stories__/SideNavModuleGroup.story.js @@ -1,6 +1,6 @@ import React from "react"; import { ArgsTable, Primary, Stories } from "@storybook/addon-docs"; -import { Collaboration24, Graph24, ProductsAndServices24 } from "@hig/icons"; +import { Collaboration24, Graph24, ProductsAndServices24 } from "@weave-design/icons"; import SideNav from "../index"; import Readme from "../../README.md"; diff --git a/deprecated/side-nav/src/containers/BelowTopNav.js b/deprecated/side-nav/src/containers/BelowTopNav.js index 514bab79f6..8bc7dc88a0 100644 --- a/deprecated/side-nav/src/containers/BelowTopNav.js +++ b/deprecated/side-nav/src/containers/BelowTopNav.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; -import Surface from "@hig/surface"; -import ThemeContext from "@hig/theme-context"; +import Surface from "@weave-design/surface"; +import ThemeContext from "@weave-design/theme-context"; import stylesheet from "./stylesheet"; export default class BelowTopNav extends Component { diff --git a/deprecated/side-nav/src/containers/BelowTopNavCompact.js b/deprecated/side-nav/src/containers/BelowTopNavCompact.js index e7644b3ca3..304353cf56 100644 --- a/deprecated/side-nav/src/containers/BelowTopNavCompact.js +++ b/deprecated/side-nav/src/containers/BelowTopNavCompact.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; -import Surface from "@hig/surface"; -import ThemeContext from "@hig/theme-context"; +import Surface from "@weave-design/surface"; +import ThemeContext from "@weave-design/theme-context"; import stylesheet from "./stylesheet"; export default class BelowTopNavCompact extends Component { diff --git a/deprecated/side-nav/src/containers/Docked.js b/deprecated/side-nav/src/containers/Docked.js index 5cb265d3a5..c0596b93ad 100644 --- a/deprecated/side-nav/src/containers/Docked.js +++ b/deprecated/side-nav/src/containers/Docked.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import ThemeContext from "@hig/theme-context"; +import ThemeContext from "@weave-design/theme-context"; import stylesheet from "./stylesheet"; export default class Docked extends Component { diff --git a/deprecated/side-nav/src/presenters/ExternalLinkIcon.js b/deprecated/side-nav/src/presenters/ExternalLinkIcon.js index 9cb9ccacf3..7cc2735ab0 100644 --- a/deprecated/side-nav/src/presenters/ExternalLinkIcon.js +++ b/deprecated/side-nav/src/presenters/ExternalLinkIcon.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; -import { ExternalLink16, ExternalLink24, sizes as iconSizes } from "@hig/icons"; +import { ExternalLink16, ExternalLink24, sizes as iconSizes } from "@weave-design/icons"; export default class ExternalLinkIcon extends Component { // eslint-disable-next-line react/static-property-placement diff --git a/deprecated/side-nav/src/presenters/ExternalLinkIcon.test.js b/deprecated/side-nav/src/presenters/ExternalLinkIcon.test.js index 46eb95fb8a..6b92819c67 100644 --- a/deprecated/side-nav/src/presenters/ExternalLinkIcon.test.js +++ b/deprecated/side-nav/src/presenters/ExternalLinkIcon.test.js @@ -1,6 +1,6 @@ import { shallow } from "enzyme"; import React from "react"; -import { ExternalLink16, ExternalLink24, sizes as iconSizes } from "@hig/icons"; +import { ExternalLink16, ExternalLink24, sizes as iconSizes } from "@weave-design/icons"; import ExternalLinkIcon from "./ExternalLinkIcon"; diff --git a/deprecated/side-nav/src/presenters/SideNav.js b/deprecated/side-nav/src/presenters/SideNav.js index 8967f94ed2..cd3e675d3d 100644 --- a/deprecated/side-nav/src/presenters/SideNav.js +++ b/deprecated/side-nav/src/presenters/SideNav.js @@ -1,12 +1,12 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import { css, cx } from "emotion"; -import { ThemeContext } from "@hig/theme-context"; -import { Back24, Back16 } from "@hig/icons"; -import Typography from "@hig/typography"; -import TextLink from "@hig/text-link"; -import IconButton from "@hig/icon-button"; -import { createCustomClassNames } from "@hig/utils"; +import { ThemeContext } from "@weave-design/theme-context"; +import { Back24, Back16 } from "@weave-design/icons"; +import Typography from "@weave-design/typography"; +import TextLink from "@weave-design/text-link"; +import IconButton from "@weave-design/icon-button"; +import { createCustomClassNames } from "@weave-design/utils"; import stylesheet from "./stylesheet";