Skip to content

Commit 56ca7fb

Browse files
committed
feat: enhance sidebar and sheet components with data slots and improved styling
- Added data-slot attributes to various sidebar components for better accessibility and debugging. - Refactored Sidebar components to improve layout and styling consistency. - Introduced new CardAction and SheetOverlay components with appropriate props and styles. - Updated GlobalSettings to handle boolean values more robustly. - Improved Skeleton and Tooltip components with data-slot attributes for enhanced usability. - Removed unused imports and optimized existing code for better performance.
1 parent 7e689d5 commit 56ca7fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+331
-202
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/frontend/components.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://shadcn-vue.com/schema.json",
3-
"style": "new-york",
3+
"style": "default",
44
"typescript": true,
55
"tailwind": {
66
"config": "tailwind.config.js",
@@ -17,4 +17,4 @@
1717
"lib": "@/lib"
1818
},
1919
"iconLibrary": "lucide"
20-
}
20+
}

services/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"vue": "^3.5.16",
3030
"vue-i18n": "^11.1.5",
3131
"vue-router": "^4.5.1",
32-
"zod": "^3.25.42"
32+
"zod": "^3.25.49"
3333
},
3434
"devDependencies": {
3535
"@commitlint/cli": "^19.8.1",

services/frontend/src/assets/index.css

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
--sidebar-accent-foreground: hsl(240 5.9% 10%);
4040
--sidebar-border: hsl(220 13% 91%);
4141
--sidebar-ring: hsl(217.2 91.2% 59.8%);
42+
--sidebar: hsl(0 0% 98%);
4243
}
4344

4445
/* Dark mode variables */
@@ -100,6 +101,14 @@
100101
--color-input: var(--input);
101102
--color-ring: var(--ring);
102103
--radius: var(--radius);
104+
--color-sidebar-ring: var(--sidebar-ring);
105+
--color-sidebar-border: var(--sidebar-border);
106+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
107+
--color-sidebar-accent: var(--sidebar-accent);
108+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
109+
--color-sidebar-primary: var(--sidebar-primary);
110+
--color-sidebar-foreground: var(--sidebar-foreground);
111+
--color-sidebar: var(--sidebar);
103112
}
104113

105114
/* Add animation plugin for shadcn components */
@@ -132,8 +141,6 @@ button,
132141
cursor: pointer;
133142
}
134143

135-
136-
137144
/* Ensure disabled buttons don't show pointer cursor */
138145
button:disabled,
139146
[role="button"]:disabled,
@@ -148,3 +155,23 @@ a[role="button"] {
148155
cursor: pointer;
149156
}
150157

158+
.dark {
159+
--sidebar: hsl(240 5.9% 10%);
160+
--sidebar-foreground: hsl(240 4.8% 95.9%);
161+
--sidebar-primary: hsl(224.3 76.3% 48%);
162+
--sidebar-primary-foreground: hsl(0 0% 100%);
163+
--sidebar-accent: hsl(240 3.7% 15.9%);
164+
--sidebar-accent-foreground: hsl(240 4.8% 95.9%);
165+
--sidebar-border: hsl(240 3.7% 15.9%);
166+
--sidebar-ring: hsl(217.2 91.2% 59.8%);
167+
}
168+
169+
@layer base {
170+
* {
171+
@apply border-border outline-ring/50;
172+
}
173+
body {
174+
@apply bg-background text-foreground;
175+
}
176+
}
177+

services/frontend/src/components/ui/button/Button.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import type { HTMLAttributes } from 'vue'
3-
import { cn } from '@/lib/utils'
43
import { Primitive, type PrimitiveProps } from 'reka-ui'
4+
import { cn } from '@/lib/utils'
55
import { type ButtonVariants, buttonVariants } from '.'
66
77
interface Props extends PrimitiveProps {
@@ -17,6 +17,7 @@ const props = withDefaults(defineProps<Props>(), {
1717

1818
<template>
1919
<Primitive
20+
data-slot="button"
2021
:as="as"
2122
:as-child="asChild"
2223
:class="cn(buttonVariants({ variant, size }), props.class)"

services/frontend/src/components/ui/button/index.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@ import { cva, type VariantProps } from 'class-variance-authority'
33
export { default as Button } from './Button.vue'
44

55
export const buttonVariants = cva(
6-
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
6+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
77
{
88
variants: {
99
variant: {
10-
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
10+
default:
11+
'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
1112
destructive:
12-
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
13+
'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
1314
outline:
14-
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
15+
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
1516
secondary:
16-
'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
17-
ghost: 'hover:bg-accent hover:text-accent-foreground',
17+
'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
18+
ghost:
19+
'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
1820
link: 'text-primary underline-offset-4 hover:underline',
1921
},
2022
size: {
21-
default: 'h-9 px-4 py-2',
22-
xs: 'h-7 rounded px-2',
23-
sm: 'h-8 rounded-md px-3 text-xs',
24-
lg: 'h-10 rounded-md px-8',
25-
icon: 'h-9 w-9',
23+
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
24+
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
25+
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
26+
icon: 'size-9',
2627
},
2728
},
2829
defaultVariants: {

services/frontend/src/components/ui/card/Card.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ const props = defineProps<{
99

1010
<template>
1111
<div
12+
data-slot="card"
1213
:class="
1314
cn(
14-
'rounded-xl border bg-card text-card-foreground shadow',
15+
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
1516
props.class,
1617
)
1718
"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
3+
import { cn } from '@/lib/utils'
4+
5+
const props = defineProps<{
6+
class?: HTMLAttributes['class']
7+
}>()
8+
</script>
9+
10+
<template>
11+
<div
12+
data-slot="card-action"
13+
:class="cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', props.class)"
14+
>
15+
<slot />
16+
</div>
17+
</template>

services/frontend/src/components/ui/card/CardContent.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const props = defineProps<{
88
</script>
99

1010
<template>
11-
<div :class="cn('p-6 pt-0', props.class)">
11+
<div
12+
data-slot="card-content"
13+
:class="cn('px-6', props.class)"
14+
>
1215
<slot />
1316
</div>
1417
</template>

services/frontend/src/components/ui/card/CardDescription.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const props = defineProps<{
88
</script>
99

1010
<template>
11-
<p :class="cn('text-sm text-muted-foreground', props.class)">
11+
<p
12+
data-slot="card-description"
13+
:class="cn('text-muted-foreground text-sm', props.class)"
14+
>
1215
<slot />
1316
</p>
1417
</template>

0 commit comments

Comments
 (0)