@plutocms/pluto 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## [0.3.0](https://github.com/plutocms/pluto/compare/v0.2.1...v0.3.0) (2026-09-09)
5
+
6
+
7
+ ### Features
8
+
9
+ * make admin shell responsive ([#119](https://github.com/plutocms/pluto/issues/119)) ([5a4808d](https://github.com/plutocms/pluto/commit/5a4808de34e1a3796c496a8fad093290a8f7fb90))
10
+
11
+ ## [0.2.1](https://github.com/plutocms/pluto/compare/v0.2.0...v0.2.1) (2026-09-08)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * remove invalid @typescript-eslint/comma-dangle rule override ([db269da](https://github.com/plutocms/pluto/commit/db269da152beb7f0ff931a4c21dd64bb5cd99708))
17
+
4
18
  ## [0.2.0](https://github.com/plutocms/pluto/compare/v0.1.0...v0.2.0) (2026-09-03)
5
19
 
6
20
 
@@ -1,7 +1,9 @@
1
1
  <script setup lang="ts"></script>
2
2
 
3
3
  <template>
4
- <UContainer class="flex max-w-300 flex-col gap-y-8 py-10">
4
+ <UContainer
5
+ class="flex max-w-300 flex-col gap-y-6 px-4 py-6 sm:px-6 lg:gap-y-8 lg:px-8 lg:py-10"
6
+ >
5
7
  <slot />
6
8
  </UContainer>
7
9
  </template>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <template>
4
4
  <nav
5
- class="light:bg-white light:border-black/10 font-outfit sticky top-0 z-50 h-10 shrink-0 border-b dark:border-white/5 dark:bg-black dark:text-white"
5
+ class="light:bg-white light:border-black/10 font-outfit sticky top-0 z-50 h-14 shrink-0 border-b lg:h-10 dark:border-white/5 dark:bg-black dark:text-white"
6
6
  >
7
7
  <slot />
8
8
  </nav>
@@ -35,9 +35,9 @@ const resolvedClasses = computed(() => {
35
35
  const defaultClasses = `
36
36
  group
37
37
  relative
38
- w-234 h-fit
38
+ w-234 max-w-[calc(100vw-1rem)] h-fit
39
39
  rounded-lg
40
- my-4 mx-4
40
+ my-2 mx-2 sm:my-4 sm:mx-4
41
41
  shadow-2xl
42
42
  bg-default
43
43
  light:text-zinc-800 dark:text-white
@@ -68,7 +68,7 @@ const resolvedOverlayClasses = computed(() => {
68
68
  fixed
69
69
  left-0 top-0
70
70
  z-51
71
- h-screen w-screen
71
+ h-dvh w-screen
72
72
  bg-black/90
73
73
  `
74
74
 
@@ -109,14 +109,14 @@ function closeModal() {
109
109
  :class="resolvedOverlayClasses"
110
110
  @click="props.preventClickOutside === false ? closeModal() : null"
111
111
  >
112
- <div ref="scrollRef" class="h-full overflow-y-scroll py-4">
112
+ <div ref="scrollRef" class="h-full overflow-y-auto py-2 sm:py-4">
113
113
  <div class="flex min-h-full items-center justify-center">
114
114
  <div
115
115
  :class="twMerge(['modal-content my-auto', resolvedClasses])"
116
116
  :style="{
117
117
  width:
118
118
  !props.size && props.customSize
119
- ? `${props.customSize}px`
119
+ ? `min(${props.customSize}px, calc(100vw - 1rem))`
120
120
  : '',
121
121
  }"
122
122
  v-bind="$attrs"
@@ -3,7 +3,7 @@ import { twMerge } from 'tailwind-merge'
3
3
  </script>
4
4
 
5
5
  <template>
6
- <div class="flex flex-col gap-8 py-1">
6
+ <div class="flex flex-col gap-5 py-1 sm:gap-8">
7
7
  <div
8
8
  v-if="$slots.header"
9
9
  :class="twMerge(['bg-opacity-90 sticky z-50 backdrop-blur-md'])"
@@ -12,7 +12,7 @@ import { twMerge } from 'tailwind-merge'
12
12
  <slot name="header" />
13
13
  </div>
14
14
 
15
- <div class="px-4 pt-6">
15
+ <div class="px-3 pt-4 sm:px-4 sm:pt-6">
16
16
  <slot />
17
17
  </div>
18
18
  </div>
@@ -52,7 +52,10 @@ const resolvedClasses = computed(() => {
52
52
  "
53
53
  />
54
54
 
55
- <div :class="resolvedAlign" class="flex py-4">
55
+ <div
56
+ :class="resolvedAlign"
57
+ class="flex flex-wrap gap-2 px-3 py-3 sm:px-4 sm:py-4"
58
+ >
56
59
  <slot />
57
60
  </div>
58
61
  </div>
@@ -45,8 +45,12 @@ function closeModal() {
45
45
  class="bg-default absolute top-0 left-0 z-[-1] h-full w-full rounded-t-lg backdrop-blur-md"
46
46
  />
47
47
 
48
- <div class="flex items-start justify-between py-4">
49
- <h2 :class="twMerge(['text-3xl leading-10 font-medium'])">
48
+ <div class="flex items-start justify-between gap-3 py-3 sm:py-4">
49
+ <h2
50
+ :class="
51
+ twMerge(['text-2xl leading-8 font-medium sm:text-3xl sm:leading-10'])
52
+ "
53
+ >
50
54
  <slot />
51
55
  </h2>
52
56
 
@@ -7,6 +7,12 @@ import type { NavigationMenuItem } from '@nuxt/ui'
7
7
  type SidebarMenuItem = Omit<NavigationMenuItem, 'to'>
8
8
 
9
9
  const { actions: sidebarActions } = useSidebarAdminActions()
10
+ const route = useRoute()
11
+ const isSidebarOpen = useState<boolean>('pluto-admin-sidebar-open', () => false)
12
+
13
+ function closeSidebar() {
14
+ isSidebarOpen.value = false
15
+ }
10
16
 
11
17
  const menu = shallowRef<SidebarMenuItem[]>([
12
18
  {
@@ -21,18 +27,46 @@ const menu = shallowRef<SidebarMenuItem[]>([
21
27
  icon: 'lucide:settings',
22
28
  },
23
29
  ])
30
+
31
+ watch(
32
+ () => route.fullPath,
33
+ closeSidebar
34
+ )
24
35
  </script>
25
36
 
26
37
  <template>
27
38
  <div
28
- class="dark:bg-admin-content light:bg-white font-outfit flex h-full grow flex-col"
39
+ class="dark:bg-admin-content light:bg-white font-outfit flex h-dvh min-h-0 grow flex-col overflow-hidden"
29
40
  >
30
41
  <NavbarAdmin />
31
42
 
32
- <div class="flex h-full items-stretch">
33
- <div
34
- class="dark:bg-admin-sidebar light:bg-zinc-100 w-64 shrink-0 px-4 py-4"
43
+ <div class="relative flex min-h-0 flex-1 items-stretch">
44
+ <Transition name="sidebar-fade">
45
+ <button
46
+ v-if="isSidebarOpen"
47
+ type="button"
48
+ aria-label="Close navigation"
49
+ class="fixed inset-x-0 top-14 bottom-0 z-40 bg-black/50 backdrop-blur-xs lg:hidden"
50
+ @click="closeSidebar"
51
+ />
52
+ </Transition>
53
+
54
+ <aside
55
+ :class="isSidebarOpen ? 'translate-x-0' : '-translate-x-full'"
56
+ class="dark:bg-admin-sidebar light:bg-zinc-100 border-default fixed inset-y-14 left-0 z-50 flex w-[min(18rem,85vw)] shrink-0 flex-col border-r px-3 py-4 shadow-2xl transition-transform duration-200 lg:static lg:inset-auto lg:z-auto lg:w-64 lg:translate-x-0 lg:shadow-none"
35
57
  >
58
+ <div class="mb-3 flex items-center justify-between px-2 lg:hidden">
59
+ <span class="text-muted text-sm font-semibold">Navigation</span>
60
+ <UButton
61
+ icon="lucide:x"
62
+ color="neutral"
63
+ variant="ghost"
64
+ aria-label="Close navigation"
65
+ square
66
+ @click="closeSidebar"
67
+ />
68
+ </div>
69
+
36
70
  <UNavigationMenu
37
71
  :items="menu"
38
72
  :ui="{
@@ -42,11 +76,23 @@ const menu = shallowRef<SidebarMenuItem[]>([
42
76
  class="data-[orientation=vertical]:w-full"
43
77
  highlight
44
78
  />
45
- </div>
79
+ </aside>
46
80
 
47
- <div class="grow overflow-hidden">
81
+ <div class="min-w-0 grow overflow-x-hidden overflow-y-auto">
48
82
  <slot />
49
83
  </div>
50
84
  </div>
51
85
  </div>
52
86
  </template>
87
+
88
+ <style scoped>
89
+ .sidebar-fade-enter-active,
90
+ .sidebar-fade-leave-active {
91
+ transition: opacity 200ms ease;
92
+ }
93
+
94
+ .sidebar-fade-enter-from,
95
+ .sidebar-fade-leave-to {
96
+ opacity: 0;
97
+ }
98
+ </style>
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts"></script>
2
2
 
3
3
  <template>
4
- <div class="bg-admin-content font-outfit flex h-full grow flex-col">
4
+ <div class="bg-admin-content font-outfit flex min-h-dvh grow flex-col">
5
5
  <slot />
6
6
  </div>
7
7
  </template>
@@ -7,9 +7,9 @@ useHead({
7
7
  <template>
8
8
  <main>
9
9
  <AdminView>
10
- <h1 class="text-4xl font-bold">Admin Dashboard</h1>
10
+ <h1 class="text-3xl font-bold lg:text-4xl">Admin Dashboard</h1>
11
11
 
12
- <div class="grid grid-cols-3 gap-x-4 gap-y-6">
12
+ <div class="grid grid-cols-1 gap-4 lg:grid-cols-3 lg:gap-x-4 lg:gap-y-6">
13
13
  <div
14
14
  v-for="i in 6"
15
15
  :key="i"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plutocms/pluto",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "description": "The layerable CMS",
6
6
  "author": "Victor Ribeiro",
7
7
  "license": "MIT",
@@ -30,7 +30,8 @@
30
30
  "prettier": "prettier --write .",
31
31
  "lint": "eslint .",
32
32
  "lint:fix": "eslint . --fix && prettier --write .",
33
- "typecheck": "nuxt prepare && vue-tsc -b --noEmit"
33
+ "typecheck": "nuxt prepare && vue-tsc -b --noEmit",
34
+ "test": "vitest run"
34
35
  },
35
36
  "trustedDependencies": [
36
37
  "@parcel/watcher",
@@ -41,7 +42,7 @@
41
42
  "vue-demi"
42
43
  ],
43
44
  "dependencies": {
44
- "@plutocms/utils": "^0.1.0",
45
+ "@plutocms/utils": "^0.2.0",
45
46
  "@vueuse/nuxt": "^14.3.0"
46
47
  },
47
48
  "devDependencies": {
@@ -61,6 +62,7 @@
61
62
  "tailwind-merge": "^3.6.0",
62
63
  "tailwindcss": "^4.3.2",
63
64
  "typescript": "6.0.3",
65
+ "vitest": "^5.0.0",
64
66
  "vue": "^3.5.39",
65
67
  "vue-router": "^5.1.0",
66
68
  "vue-tsc": "^3.3.7"