-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace deprecated nav components (#1492)
Relates to #1477 refactor navigation components - `OnyxFlyoutMenu`: rename default slot to options - previous `OnyxNavItem` component is now `OnyxNavButton` with changed API - new `OnyxNavItem` is now only intended to be used as children for the new `OnyxNavButton` - `OnyxUserMenu`: property `avatar` now only accepts a string, not an object - fix(OnyxUserMenu): use correct font weight for username
- Loading branch information
1 parent
48b24d2
commit 555ac22
Showing
106 changed files
with
782 additions
and
1,212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"sit-onyx": major | ||
--- | ||
|
||
refactor navigation components | ||
|
||
- `OnyxFlyoutMenu`: rename default slot to options | ||
- previous `OnyxNavItem` component is now `OnyxNavButton` with changed API | ||
- new `OnyxNavItem` is now only intended to be used as children for the new `OnyxNavButton` | ||
- `OnyxUserMenu`: property `avatar` now only accepts a string, not an object | ||
- fix(OnyxUserMenu): use correct font weight for username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"sit-onyx": patch | ||
--- | ||
|
||
fix(OnyxMenuItem): make whole button/link clickable | ||
|
||
Also add missing export for the component itself |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-137 Bytes
(100%)
...laywright/snapshots/components/OnyxNavBar/Navigation-bar-lg--chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-175 Bytes
(100%)
...playwright/snapshots/components/OnyxNavBar/Navigation-bar-lg--firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-161 Bytes
(99%)
.../playwright/snapshots/components/OnyxNavBar/Navigation-bar-lg--webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-137 Bytes
(100%)
...laywright/snapshots/components/OnyxNavBar/Navigation-bar-md--chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-145 Bytes
(100%)
...playwright/snapshots/components/OnyxNavBar/Navigation-bar-md--firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-169 Bytes
(99%)
.../playwright/snapshots/components/OnyxNavBar/Navigation-bar-md--webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-132 Bytes
(100%)
...laywright/snapshots/components/OnyxNavBar/Navigation-bar-sm--chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-129 Bytes
(100%)
...playwright/snapshots/components/OnyxNavBar/Navigation-bar-sm--firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-157 Bytes
(99%)
.../playwright/snapshots/components/OnyxNavBar/Navigation-bar-sm--webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-140 Bytes
(100%)
...laywright/snapshots/components/OnyxNavBar/Navigation-bar-xl--chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-190 Bytes
(100%)
...playwright/snapshots/components/OnyxNavBar/Navigation-bar-xl--firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-149 Bytes
(100%)
.../playwright/snapshots/components/OnyxNavBar/Navigation-bar-xl--webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-95 Bytes
(99%)
...x/playwright/snapshots/components/OnyxNavBar/grid-default-lg-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-119 Bytes
(99%)
...yx/playwright/snapshots/components/OnyxNavBar/grid-default-lg-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-137 Bytes
(99%)
...nyx/playwright/snapshots/components/OnyxNavBar/grid-default-lg-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-128 Bytes
(99%)
...x/playwright/snapshots/components/OnyxNavBar/grid-default-md-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-114 Bytes
(99%)
...yx/playwright/snapshots/components/OnyxNavBar/grid-default-md-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-144 Bytes
(98%)
...nyx/playwright/snapshots/components/OnyxNavBar/grid-default-md-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-124 Bytes
(99%)
...x/playwright/snapshots/components/OnyxNavBar/grid-default-sm-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-115 Bytes
(99%)
...yx/playwright/snapshots/components/OnyxNavBar/grid-default-sm-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-142 Bytes
(98%)
...nyx/playwright/snapshots/components/OnyxNavBar/grid-default-sm-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-116 Bytes
(99%)
...x/playwright/snapshots/components/OnyxNavBar/grid-default-xl-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-123 Bytes
(99%)
...yx/playwright/snapshots/components/OnyxNavBar/grid-default-xl-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-149 Bytes
(98%)
...nyx/playwright/snapshots/components/OnyxNavBar/grid-default-xl-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-95 Bytes
(99%)
...laywright/snapshots/components/OnyxNavBar/grid-max-center-lg-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-119 Bytes
(99%)
...playwright/snapshots/components/OnyxNavBar/grid-max-center-lg-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
-137 Bytes
(99%)
.../playwright/snapshots/components/OnyxNavBar/grid-max-center-lg-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
-119 Bytes
(99%)
...laywright/snapshots/components/OnyxNavBar/grid-max-center-xl-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
-123 Bytes
(99%)
...playwright/snapshots/components/OnyxNavBar/grid-max-center-xl-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
-144 Bytes
(99%)
.../playwright/snapshots/components/OnyxNavBar/grid-max-center-xl-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
-95 Bytes
(99%)
...playwright/snapshots/components/OnyxNavBar/grid-max-width-lg-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
-119 Bytes
(99%)
.../playwright/snapshots/components/OnyxNavBar/grid-max-width-lg-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
-137 Bytes
(99%)
...x/playwright/snapshots/components/OnyxNavBar/grid-max-width-lg-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
-95 Bytes
(99%)
...playwright/snapshots/components/OnyxNavBar/grid-max-width-xl-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
-124 Bytes
(99%)
.../playwright/snapshots/components/OnyxNavBar/grid-max-width-xl-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
-147 Bytes
(99%)
...x/playwright/snapshots/components/OnyxNavBar/grid-max-width-xl-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
...pshots/components/OnyxNavBar/modules/OnyxNavButton/NavButton-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
-32 Bytes
(100%)
...apshots/components/OnyxNavBar/modules/OnyxNavButton/NavButton-firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+37.8 KB
...omponents/OnyxNavBar/modules/OnyxNavButton/NavButton-mobile--chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+58.2 KB
...components/OnyxNavBar/modules/OnyxNavButton/NavButton-mobile--firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+35 KB
.../components/OnyxNavBar/modules/OnyxNavButton/NavButton-mobile--webkit-linux.png
Oops, something went wrong.
Binary file added
BIN
+26.3 KB
...NavBar/modules/OnyxNavButton/NavButton-mobile-open-children--chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+37.3 KB
...xNavBar/modules/OnyxNavButton/NavButton-mobile-open-children--firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.9 KB
...yxNavBar/modules/OnyxNavButton/NavButton-mobile-open-children--webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
+77 Bytes
(100%)
...napshots/components/OnyxNavBar/modules/OnyxNavButton/NavButton-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
-315 Bytes
(98%)
.../snapshots/components/OnyxNavBar/modules/OnyxNavItem/NavItem-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
+201 Bytes
(100%)
...t/snapshots/components/OnyxNavBar/modules/OnyxNavItem/NavItem-firefox-linux.png
Oops, something went wrong.
Binary file removed
BIN
-37.2 KB
...ts/components/OnyxNavBar/modules/OnyxNavItem/NavItem-mobile--chromium-linux.png
Diff not rendered.
Binary file removed
BIN
-57.8 KB
...ots/components/OnyxNavBar/modules/OnyxNavItem/NavItem-mobile--firefox-linux.png
Diff not rendered.
Binary file removed
BIN
-34.7 KB
...hots/components/OnyxNavBar/modules/OnyxNavItem/NavItem-mobile--webkit-linux.png
Diff not rendered.
Binary file removed
BIN
-25.4 KB
...OnyxNavBar/modules/OnyxNavItem/NavItem-mobile-open-children--chromium-linux.png
Diff not rendered.
Binary file removed
BIN
-36.5 KB
.../OnyxNavBar/modules/OnyxNavItem/NavItem-mobile-open-children--firefox-linux.png
Diff not rendered.
Binary file removed
BIN
-23.5 KB
...s/OnyxNavBar/modules/OnyxNavItem/NavItem-mobile-open-children--webkit-linux.png
Diff not rendered.
Binary file modified
BIN
-938 Bytes
(95%)
...ht/snapshots/components/OnyxNavBar/modules/OnyxNavItem/NavItem-webkit-linux.png
Oops, something went wrong.
Binary file removed
BIN
-26.9 KB
...ents/OnyxNavBar/modules/OnyxNavItem/NavItem-with-nestedItems-chromium-linux.png
Diff not rendered.
Binary file removed
BIN
-40.1 KB
...nents/OnyxNavBar/modules/OnyxNavItem/NavItem-with-nestedItems-firefox-linux.png
Diff not rendered.
Binary file removed
BIN
-25.3 KB
...onents/OnyxNavBar/modules/OnyxNavItem/NavItem-with-nestedItems-webkit-linux.png
Diff not rendered.
Binary file modified
BIN
+14.9 KB
(140%)
...apshots/components/OnyxNavBar/modules/OnyxUserMenu/User-menu-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
+30.8 KB
(150%)
...napshots/components/OnyxNavBar/modules/OnyxUserMenu/User-menu-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+21.7 KB
(150%)
...snapshots/components/OnyxNavBar/modules/OnyxUserMenu/User-menu-webkit-linux.png
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
packages/sit-onyx/src/components/OnyxExternalLinkIcon/OnyxExternalLinkIcon.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { defineStorybookActionsAndVModels } from "@sit-onyx/storybook-utils"; | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
import { textColorDecorator } from "../../utils/storybook"; | ||
import OnyxExternalLinkIcon from "./OnyxExternalLinkIcon.vue"; | ||
|
||
/** | ||
* Icon for external links. Will be hidden if the link is not external or icon is disabled. | ||
* Mainly used internally inside other components like the OnyxLink, OnyxNavButton etc. | ||
*/ | ||
const meta: Meta<typeof OnyxExternalLinkIcon> = { | ||
title: "Support/ExternalLinkIcon", | ||
...defineStorybookActionsAndVModels({ | ||
component: OnyxExternalLinkIcon, | ||
events: [], | ||
argTypes: { | ||
withExternalIcon: { | ||
options: ["auto", true, false], | ||
control: { type: "radio" }, | ||
}, | ||
}, | ||
decorators: [textColorDecorator], | ||
}), | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof OnyxExternalLinkIcon>; | ||
|
||
export const Default = { | ||
args: { | ||
href: "https://onyx.schwarz", | ||
}, | ||
} satisfies Story; |
36 changes: 36 additions & 0 deletions
36
packages/sit-onyx/src/components/OnyxExternalLinkIcon/OnyxExternalLinkIcon.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script lang="ts" setup> | ||
import arrowSmallUpRight from "@sit-onyx/icons/arrow-small-up-right.svg?raw"; | ||
import { computed } from "vue"; | ||
import { isExternalLink } from "../../utils"; | ||
import OnyxIcon from "../OnyxIcon/OnyxIcon.vue"; | ||
import type { OnyxExternalLinkIcon } from "./types"; | ||
const props = withDefaults(defineProps<OnyxExternalLinkIcon>(), { | ||
withExternalIcon: "auto", | ||
}); | ||
const isVisible = computed(() => { | ||
const withExternalIcon = props.withExternalIcon; | ||
if (withExternalIcon !== "auto") return withExternalIcon; | ||
return isExternalLink(props.href ?? ""); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<OnyxIcon | ||
v-if="isVisible" | ||
class="onyx-external-link-icon" | ||
:icon="arrowSmallUpRight" | ||
size="16px" | ||
/> | ||
</template> | ||
|
||
<style lang="scss"> | ||
@use "../../styles/mixins/layers.scss"; | ||
.onyx-external-link-icon { | ||
@include layers.component() { | ||
align-self: flex-start; | ||
} | ||
} | ||
</style> |
12 changes: 12 additions & 0 deletions
12
packages/sit-onyx/src/components/OnyxExternalLinkIcon/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type OnyxExternalLinkIcon = { | ||
/** | ||
* The URL/link to point to. | ||
*/ | ||
href?: string; | ||
/** | ||
* Whether to show the external link icon. | ||
* If set to `auto`, it will be shown when the `href` leads to another website | ||
* (starting with "http://" or "https://") and will be hidden otherwise. | ||
*/ | ||
withExternalIcon?: boolean | "auto"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.