From e34402ac2a49960f3f05ce24952680d798344705 Mon Sep 17 00:00:00 2001 From: NicolasMerget Date: Tue, 9 Apr 2024 18:04:19 +0200 Subject: [PATCH 1/2] chore: rename main-navigation to navigation --- .../DBNavigation-should-match-screenshot.png} | Bin .../DBNavigation-should-match-screenshot.png} | Bin .../DBNavigation-should-match-screenshot.png} | Bin docs/migration/alpha-beta.md | 15 +++---- .../src/components/main-navigation/index.ts | 1 - .../src/components/navigation/index.ts | 1 + .../scripts/post-build/components.js | 2 +- .../src/components/header/docs/Angular.md | 6 +-- .../src/components/header/docs/React.md | 6 +-- .../src/components/header/docs/Vue.md | 6 +-- .../src/components/main-navigation/index.ts | 1 - .../main-navigation-web-component.scss | 1 - .../main-navigation/main-navigation.lite.tsx | 37 ------------------ .../src/components/main-navigation/model.ts | 9 ----- .../navigation-item/navigation-item.scss | 2 +- .../docs/Angular.md | 8 ++-- .../docs/HTML.md | 2 +- .../docs/Migration.md | 6 +-- .../docs/React.md | 6 +-- .../docs/Vue.md | 6 +-- .../src/components/navigation/index.ts | 1 + .../src/components/navigation/model.ts | 9 +++++ .../navigation/navigation-web-component.scss | 1 + .../components/navigation/navigation.lite.tsx | 31 +++++++++++++++ .../navigation.scss} | 8 ++-- .../navigation.spec.tsx} | 14 +++---- packages/components/src/index.ts | 2 +- .../src/styles/db-ui-components.scss | 6 +-- .../src/app/app.component.html | 4 +- .../angular-showcase/src/app/app.component.ts | 4 +- .../navigation.component.html} | 6 +-- .../navigation.component.ts} | 12 +++--- .../src/app/utils/navigation-item.ts | 8 ++-- showcases/patternhub/README.md | 2 +- .../components/component-parser/data.ts | 2 +- .../components/component-parser/index.tsx | 8 ++-- .../components/navigation/index.tsx | 6 +-- showcases/patternhub/data/routes.ts | 4 +- .../src/components/header/index.tsx | 6 +-- .../{main-navigation => navigation}/index.tsx | 20 +++++----- .../src/components/page/index.tsx | 6 +-- .../react-showcase/src/navigation/index.tsx | 6 +-- .../src/utils/navigation-item.tsx | 8 ++-- .../{main-navigation.json => navigation.json} | 0 showcases/vue-showcase/src/App.vue | 6 +-- .../Navigation.vue} | 16 +++----- .../src/utils/navigation-items.ts | 8 ++-- 47 files changed, 154 insertions(+), 165 deletions(-) rename __snapshots__/{main-navigation/component/chromium/DBMainNavigation-should-match-screenshot.png => navigation/component/chromium/DBNavigation-should-match-screenshot.png} (100%) rename __snapshots__/{main-navigation/component/firefox/DBMainNavigation-should-match-screenshot.png => navigation/component/firefox/DBNavigation-should-match-screenshot.png} (100%) rename __snapshots__/{main-navigation/component/mobile-chrome/DBMainNavigation-should-match-screenshot.png => navigation/component/mobile-chrome/DBNavigation-should-match-screenshot.png} (100%) delete mode 100644 packages/components/overrides/angular/src/components/main-navigation/index.ts create mode 100644 packages/components/overrides/angular/src/components/navigation/index.ts delete mode 100644 packages/components/src/components/main-navigation/index.ts delete mode 100644 packages/components/src/components/main-navigation/main-navigation-web-component.scss delete mode 100644 packages/components/src/components/main-navigation/main-navigation.lite.tsx delete mode 100644 packages/components/src/components/main-navigation/model.ts rename packages/components/src/components/{main-navigation => navigation}/docs/Angular.md (91%) rename packages/components/src/components/{main-navigation => navigation}/docs/HTML.md (97%) rename packages/components/src/components/{main-navigation => navigation}/docs/Migration.md (75%) rename packages/components/src/components/{main-navigation => navigation}/docs/React.md (90%) rename packages/components/src/components/{main-navigation => navigation}/docs/Vue.md (89%) create mode 100644 packages/components/src/components/navigation/index.ts create mode 100644 packages/components/src/components/navigation/model.ts create mode 100644 packages/components/src/components/navigation/navigation-web-component.scss create mode 100644 packages/components/src/components/navigation/navigation.lite.tsx rename packages/components/src/components/{main-navigation/main-navigation.scss => navigation/navigation.scss} (92%) rename packages/components/src/components/{main-navigation/main-navigation.spec.tsx => navigation/navigation.spec.tsx} (74%) rename showcases/angular-showcase/src/app/components/{main-navigation/main-navigation.component.html => navigation/navigation.component.html} (95%) rename showcases/angular-showcase/src/app/components/{main-navigation/main-navigation.component.ts => navigation/navigation.component.ts} (60%) rename showcases/react-showcase/src/components/{main-navigation => navigation}/index.tsx (69%) rename showcases/shared/{main-navigation.json => navigation.json} (100%) rename showcases/vue-showcase/src/components/{main-navigation/MainNavigation.vue => navigation/Navigation.vue} (78%) diff --git a/__snapshots__/main-navigation/component/chromium/DBMainNavigation-should-match-screenshot.png b/__snapshots__/navigation/component/chromium/DBNavigation-should-match-screenshot.png similarity index 100% rename from __snapshots__/main-navigation/component/chromium/DBMainNavigation-should-match-screenshot.png rename to __snapshots__/navigation/component/chromium/DBNavigation-should-match-screenshot.png diff --git a/__snapshots__/main-navigation/component/firefox/DBMainNavigation-should-match-screenshot.png b/__snapshots__/navigation/component/firefox/DBNavigation-should-match-screenshot.png similarity index 100% rename from __snapshots__/main-navigation/component/firefox/DBMainNavigation-should-match-screenshot.png rename to __snapshots__/navigation/component/firefox/DBNavigation-should-match-screenshot.png diff --git a/__snapshots__/main-navigation/component/mobile-chrome/DBMainNavigation-should-match-screenshot.png b/__snapshots__/navigation/component/mobile-chrome/DBNavigation-should-match-screenshot.png similarity index 100% rename from __snapshots__/main-navigation/component/mobile-chrome/DBMainNavigation-should-match-screenshot.png rename to __snapshots__/navigation/component/mobile-chrome/DBNavigation-should-match-screenshot.png diff --git a/docs/migration/alpha-beta.md b/docs/migration/alpha-beta.md index 7e1b0eb23ae..3fa68df0b4f 100644 --- a/docs/migration/alpha-beta.md +++ b/docs/migration/alpha-beta.md @@ -31,13 +31,14 @@ > > The prop labelVariant for form-components (input, checkbox, ...) has been renamed to `variant`. -| Name | Description | Action | -| ------------------------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 🔄 renamed `db-alert` to `db-notification` | renamed `alert` to `notification` and add/changed some additional properties | 1. Replace `DBAlert`, `db-alert` by `DBNotification` / `db-notification`
2. `Link` was removed, add a normal `a` or `DBLink` to the `slotLink`
3. `props.type` has been changed to `props.variant` | -| 🔄 changed `db-button` variants | We renamed the variants for the button | `primary` ➡ `brand`
`solid` ➡ `filled`
`text` ➡ `ghost` | -| 🔄 changed `db-card` elevation | We replaced the box-shadow elevation with bg-level | 1. `props.elevation` ➡ `props.elevationLevel` (1,2,3)
2. `props.variant` ➡ `props.behaviour`
3. Removed card-image | -| 🆕 valid/invalid message form-components | We add additional messages for `required` form-components like `DBInput` etc. | Use `validMessage="XXX"` and `invalidMessage="XXX"` to display the required information for form-components. Otherwise you will see a default message with a `TODO: ...` | -| 🔄 changed `db-link` variant | We renamed the variants for the link | `primary` ➡ `brand` | +| Name | Description | Action | +| -------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 🔄 renamed `db-alert` to `db-notification` | renamed `alert` to `notification` and add/changed some additional properties | 1. Replace `DBAlert`, `db-alert` by `DBNotification` / `db-notification`
2. `Link` was removed, add a normal `a` or `DBLink` to the `slotLink`
3. `props.type` has been changed to `props.variant` | +| 🔄 renamed `db-main-navigation` to `db-navigation` | renamed `main-navigation` to `navigation` | Replace `DBMainNavigation`, `db-main-navigation` by `DBNavigation` / `db-navigation` | +| 🔄 changed `db-button` variants | We renamed the variants for the button | `primary` ➡ `brand`
`solid` ➡ `filled`
`text` ➡ `ghost` | +| 🔄 changed `db-card` elevation | We replaced the box-shadow elevation with bg-level | 1. `props.elevation` ➡ `props.elevationLevel` (1,2,3)
2. `props.variant` ➡ `props.behaviour`
3. Removed card-image | +| 🆕 valid/invalid message form-components | We add additional messages for `required` form-components like `DBInput` etc. | Use `validMessage="XXX"` and `invalidMessage="XXX"` to display the required information for form-components. Otherwise you will see a default message with a `TODO: ...` | +| 🔄 changed `db-link` variant | We renamed the variants for the link | `primary` ➡ `brand` | ### React diff --git a/packages/components/overrides/angular/src/components/main-navigation/index.ts b/packages/components/overrides/angular/src/components/main-navigation/index.ts deleted file mode 100644 index f279281ed62..00000000000 --- a/packages/components/overrides/angular/src/components/main-navigation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { DBMainNavigation } from './main-navigation'; diff --git a/packages/components/overrides/angular/src/components/navigation/index.ts b/packages/components/overrides/angular/src/components/navigation/index.ts new file mode 100644 index 00000000000..c9087ebc608 --- /dev/null +++ b/packages/components/overrides/angular/src/components/navigation/index.ts @@ -0,0 +1 @@ +export { DBNavigation } from './navigation'; diff --git a/packages/components/scripts/post-build/components.js b/packages/components/scripts/post-build/components.js index b1064639355..1e942f75623 100644 --- a/packages/components/scripts/post-build/components.js +++ b/packages/components/scripts/post-build/components.js @@ -113,7 +113,7 @@ const getComponents = () => [ }, { - name: 'main-navigation' + name: 'navigation' }, { name: 'navigation-item', diff --git a/packages/components/src/components/header/docs/Angular.md b/packages/components/src/components/header/docs/Angular.md index a564d08539c..8296c402a83 100644 --- a/packages/components/src/components/header/docs/Angular.md +++ b/packages/components/src/components/header/docs/Angular.md @@ -61,9 +61,9 @@ export class AppComponent { My Awesome App - - - + + + Imprint Help diff --git a/packages/components/src/components/header/docs/React.md b/packages/components/src/components/header/docs/React.md index c58aacafd8d..bc384be70be 100644 --- a/packages/components/src/components/header/docs/React.md +++ b/packages/components/src/components/header/docs/React.md @@ -54,10 +54,10 @@ const App = () => ( } > - + // - https://github.com/db-ui/mono/blob/main/packages/components/src/components/main-navigation/docs/React.md - + https://github.com/db-ui/mono/blob/main/packages/components/src/components/navigation/docs/React.md + ); diff --git a/packages/components/src/components/header/docs/Vue.md b/packages/components/src/components/header/docs/Vue.md index 940cf5404a3..4b23a62d4e8 100644 --- a/packages/components/src/components/header/docs/Vue.md +++ b/packages/components/src/components/header/docs/Vue.md @@ -60,10 +60,10 @@ const toggleDrawer = (open: boolean) => { Help - + // - https://github.com/db-ui/mono/blob/main/packages/components/src/components/main-navigation/docs/Vue.md - + https://github.com/db-ui/mono/blob/main/packages/components/src/components/navigation/docs/Vue.md + ``` diff --git a/packages/components/src/components/main-navigation/index.ts b/packages/components/src/components/main-navigation/index.ts deleted file mode 100644 index 846a714dbd6..00000000000 --- a/packages/components/src/components/main-navigation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as DBMainNavigation } from './main-navigation'; diff --git a/packages/components/src/components/main-navigation/main-navigation-web-component.scss b/packages/components/src/components/main-navigation/main-navigation-web-component.scss deleted file mode 100644 index 7aad751257f..00000000000 --- a/packages/components/src/components/main-navigation/main-navigation-web-component.scss +++ /dev/null @@ -1 +0,0 @@ -@forward "main-navigation"; diff --git a/packages/components/src/components/main-navigation/main-navigation.lite.tsx b/packages/components/src/components/main-navigation/main-navigation.lite.tsx deleted file mode 100644 index 0a61b274f5a..00000000000 --- a/packages/components/src/components/main-navigation/main-navigation.lite.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { - onMount, - Show, - useMetadata, - useRef, - useStore -} from '@builder.io/mitosis'; -import { DBMainNavigationState, DBMainNavigationProps } from './model'; -import { cls, uuid } from '../../utils'; -import { DEFAULT_ID } from '../../shared/constants'; - -useMetadata({ - isAttachedToShadowDom: true -}); - -export default function DBMainNavigation(props: DBMainNavigationProps) { - const ref = useRef(null); - // jscpd:ignore-start - const state = useStore({ - _id: DEFAULT_ID - }); - - onMount(() => { - state._id = props.id || 'main-navigation-' + uuid(); - }); - - // jscpd:ignore-end - - return ( - - ); -} diff --git a/packages/components/src/components/main-navigation/model.ts b/packages/components/src/components/main-navigation/model.ts deleted file mode 100644 index 00b497d9644..00000000000 --- a/packages/components/src/components/main-navigation/model.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { GlobalProps, GlobalState } from '../../shared/model'; - -export interface DBMainNavigationDefaultProps {} - -export type DBMainNavigationProps = DBMainNavigationDefaultProps & GlobalProps; - -export interface DBMainNavigationDefaultState {} - -export type DBMainNavigationState = DBMainNavigationDefaultState & GlobalState; diff --git a/packages/components/src/components/navigation-item/navigation-item.scss b/packages/components/src/components/navigation-item/navigation-item.scss index 8798d922977..0bdf6e817d7 100644 --- a/packages/components/src/components/navigation-item/navigation-item.scss +++ b/packages/components/src/components/navigation-item/navigation-item.scss @@ -119,7 +119,7 @@ &:has([aria-current="page"]), &[aria-current="page"] { - // add puls for main-navigation items + // add puls for navigation items @extend %show-db-puls-auto; font-weight: 700; } diff --git a/packages/components/src/components/main-navigation/docs/Angular.md b/packages/components/src/components/navigation/docs/Angular.md similarity index 91% rename from packages/components/src/components/main-navigation/docs/Angular.md rename to packages/components/src/components/navigation/docs/Angular.md index 0837e77cdd6..7d765cd06fa 100644 --- a/packages/components/src/components/main-navigation/docs/Angular.md +++ b/packages/components/src/components/navigation/docs/Angular.md @@ -6,12 +6,12 @@ For general installation and configuration look at the [ngx-components](https:// ```ts app.component.ts // app.component.ts -import { DBMainNavigation } from '@db-ui/ngx-components'; +import { DBNavigation } from '@db-ui/ngx-components'; @Component({ // ... standalone: true, - imports: [..., DBMainNavigation], + imports: [..., DBNavigation], // ... }) ``` @@ -21,7 +21,7 @@ import { DBMainNavigation } from '@db-ui/ngx-components'; ```html app.component.html - + @@ -59,5 +59,5 @@ import { DBMainNavigation } from '@db-ui/ngx-components'; Navi-Item 3 - + ``` diff --git a/packages/components/src/components/main-navigation/docs/HTML.md b/packages/components/src/components/navigation/docs/HTML.md similarity index 97% rename from packages/components/src/components/main-navigation/docs/HTML.md rename to packages/components/src/components/navigation/docs/HTML.md index 70041e6dc95..c8f56c1eb61 100644 --- a/packages/components/src/components/main-navigation/docs/HTML.md +++ b/packages/components/src/components/navigation/docs/HTML.md @@ -8,7 +8,7 @@ For general installation and configuration look at the [components](https://www. ... -