Skip to content

Commit c47f788

Browse files
committed
fix: UnraidToaster component and update dialog close button
- Introduced a new UnraidToaster component for displaying notifications with customizable positions. - Updated the DialogClose component to use a span element for better semantic structure. - Enhanced CSS for the sonner component to ensure proper layout and styling. These changes improve user feedback through notifications and refine the dialog close button's implementation.
1 parent 0c727c3 commit c47f788

5 files changed

Lines changed: 18 additions & 28 deletions

File tree

@tailwind-shared/sonner.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@
229229
top: 0;
230230
height: 20px;
231231
width: 20px;
232+
min-width: inherit !important;
233+
margin: 0 !important;
232234
display: flex;
233235
justify-content: center;
234236
align-items: center;

unraid-ui/src/components/ui/dialog/DialogClose.vue

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,7 @@ const props = defineProps<DialogCloseProps>();
55
</script>
66

77
<template>
8-
<DialogClose v-bind="props">
8+
<DialogClose v-bind="props" as="span">
99
<slot />
1010
</DialogClose>
1111
</template>
12-
13-
<style>
14-
/* Reset webgui button styles for dialog close buttons */
15-
[role='dialog'] button[type='button'],
16-
button[aria-label*='close' i],
17-
button[aria-label*='dismiss' i] {
18-
/* Reset ALL webgui button styles using !important where needed */
19-
all: unset !important;
20-
21-
/* Re-apply necessary styles after reset */
22-
display: inline-flex !important;
23-
font-family: inherit !important;
24-
font-size: inherit !important;
25-
font-weight: inherit !important;
26-
line-height: inherit !important;
27-
cursor: pointer !important;
28-
box-sizing: border-box !important;
29-
30-
/* Reset any webgui CSS variables */
31-
--button-border: none !important;
32-
--button-text-color: inherit !important;
33-
--button-background: transparent !important;
34-
--button-background-size: auto !important;
35-
}
36-
</style>

web/components/UnraidToaster.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script lang="ts" setup>
2+
import { Toaster } from '@unraid/ui';
3+
4+
defineProps<{
5+
position: 'top-center' | 'top-right' | 'top-left' | 'bottom-center' | 'bottom-right' | 'bottom-left';
6+
}>();
7+
</script>
8+
9+
<template>
10+
<Toaster rich-colors close-button :position="position" />
11+
</template>

web/components/standalone-mount.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import ThemeSwitcher from './ThemeSwitcher.ce.vue';
1717
import ApiKeyPage from './ApiKeyPage.ce.vue';
1818
import DevModalTest from './DevModalTest.ce.vue';
1919
import ApiKeyAuthorize from './ApiKeyAuthorize.ce.vue';
20-
20+
import UnraidToaster from './UnraidToaster.vue';
2121
// Import utilities
2222
import { autoMountComponent, mountVueApp, getMountedApp } from './Wrapper/vue-mount-app';
2323
import { useThemeStore } from '~/store/theme';
@@ -152,6 +152,7 @@ const componentMappings = [
152152
{ component: ApiKeyPage, selector: 'unraid-api-key-manager', appId: 'api-key-manager' },
153153
{ component: DevModalTest, selector: 'unraid-dev-modal-test', appId: 'dev-modal-test' },
154154
{ component: ApiKeyAuthorize, selector: 'unraid-api-key-authorize', appId: 'api-key-authorize' },
155+
{ component: UnraidToaster, selector: 'uui-toaster', appId: 'toaster' },
155156
];
156157

157158
// Auto-mount all components
@@ -197,6 +198,7 @@ if (typeof window !== 'undefined') {
197198
ApiKeyPage,
198199
DevModalTest,
199200
ApiKeyAuthorize,
201+
UnraidToaster,
200202
};
201203

202204
// Expose utility functions

web/scripts/deploy-dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if [ "$has_standalone" = true ]; then
3535
# Ensure remote directory exists
3636
ssh root@"${server_name}" "mkdir -p /usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/standalone/"
3737
# Clear the remote standalone directory before rsyncing
38-
ssh root@"${server_name}" "rm -rf /usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/standalone/*"
38+
ssh root@"${server_name}" "rm -rf /usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/*"
3939
# Run rsync with proper quoting
4040
rsync -avz --delete -e "ssh" "$standalone_directory" "root@${server_name}:/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/standalone/"
4141
standalone_exit_code=$?

0 commit comments

Comments
 (0)