Skip to content

A self-hosted media server and file management system

chore: standardise layout cards

aminnausinaf4f2812909e
diff --git a/package-lock.json b/package-lock.json
index 95ec5cab..e794c748 100755
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,6 +5,7 @@
"packages": {
"": {
"dependencies": {
+ "@aminnausin/cedar-ui": "^0.0.9",
"@tanstack/vue-query": "^5.77.2",
"@vueuse/components": "^10.11.0",
"@vueuse/core": "^10.11.0",
@@ -70,7 +71,7 @@
"prettier": "3.5.3",
"prettier-plugin-tailwindcss": "^0.7.1",
"pusher-js": "^8.4.0-rc2",
- "tailwind-scrollbar-hide": "^1.1.7",
+ "tailwind-scrollbar-hide": "^4.0.0",
"tailwindcss": "^4.1.17",
"typescript": "~5.8.0",
"unplugin-icons": "^22.1.0",
@@ -93,6 +94,35 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/@aminnausin/cedar-ui": {
+ "version": "0.0.9",
+ "resolved": "https://registry.npmjs.org/@aminnausin/cedar-ui/-/cedar-ui-0.0.9.tgz",
+ "integrity": "sha512-Z9hJESuXfo/Y8j/1LmiuRITEB7m8olOhdSBvUbaS/eEtQEx3ga7y/yRtF5iqZtQeIWY3/LcCjcDBQj56COBfFQ==",
+ "license": "MIT",
+ "dependencies": {
+ "clsx": "^2.1.1",
+ "fast-deep-equal": "^3.1.3",
+ "focus-trap": "^7.6.5",
+ "tailwind-merge": "^3.3.1",
+ "tailwind-scrollbar-hide": "^2.0.0"
+ },
+ "peerDependencies": {
+ "@vueuse/components": ">=10.11.1 <14.0.0",
+ "@vueuse/core": ">=10.11.1 <14.0.0",
+ "@vueuse/integrations": ">=11.3.0 <14.0.0",
+ "vue": ">=3.5.13 <4.0.0",
+ "vue-router": ">=4.5.0 <5.0.0"
+ }
+ },
+ "node_modules/@aminnausin/cedar-ui/node_modules/tailwind-scrollbar-hide": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tailwind-scrollbar-hide/-/tailwind-scrollbar-hide-2.0.0.tgz",
+ "integrity": "sha512-lqiIutHliEiODwBRHy4G2+Tcayo2U7+3+4frBmoMETD72qtah+XhOk5XcPzC1nJvXhXUdfl2ajlMhUc2qC6CIg==",
+ "license": "MIT",
+ "peerDependencies": {
+ "tailwindcss": ">=3.0.0 || >= 4.0.0 || >= 4.0.0-beta.8 || >= 4.0.0-alpha.20"
+ }
+ },
"node_modules/@ampproject/remapping": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
@@ -3709,6 +3739,15 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
+ "node_modules/clsx": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -4845,7 +4884,6 @@
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
- "dev": true,
"license": "MIT"
},
"node_modules/fast-diff": {
@@ -8056,10 +8094,20 @@
"integrity": "sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ==",
"license": "MIT"
},
+ "node_modules/tailwind-merge": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.4.0.tgz",
+ "integrity": "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/dcastil"
+ }
+ },
"node_modules/tailwind-scrollbar-hide": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/tailwind-scrollbar-hide/-/tailwind-scrollbar-hide-1.3.1.tgz",
- "integrity": "sha512-eUAvPTltKnAGHbCBRpOk5S7+UZTkFZgDKmZLZ6jZXXs4V7mRXvwshBjeMwrv3vmiWqm3IGEDFVKzUSm1JuoXKw==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/tailwind-scrollbar-hide/-/tailwind-scrollbar-hide-4.0.0.tgz",
+ "integrity": "sha512-gobtvVcThB2Dxhy0EeYSS1RKQJ5baDFkamkhwBvzvevwX6L4XQfpZ3me9s25Ss1ecFVT5jPYJ50n+7xTBJG9WQ==",
"dev": true,
"license": "MIT",
"peerDependencies": {
@@ -8070,7 +8118,6 @@
"version": "4.1.17",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz",
"integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==",
- "dev": true,
"license": "MIT"
},
"node_modules/tapable": {
diff --git a/package.json b/package.json
index 12e0ca43..9e0107cc 100755
--- a/package.json
+++ b/package.json
@@ -83,7 +83,7 @@
"prettier": "3.5.3",
"prettier-plugin-tailwindcss": "^0.7.1",
"pusher-js": "^8.4.0-rc2",
- "tailwind-scrollbar-hide": "^1.1.7",
+ "tailwind-scrollbar-hide": "^4.0.0",
"tailwindcss": "^4.1.17",
"typescript": "~5.8.0",
"unplugin-icons": "^22.1.0",
@@ -93,6 +93,7 @@
"vue-tsc": "^2.2.8"
},
"dependencies": {
+ "@aminnausin/cedar-ui": "^0.0.9",
"@tanstack/vue-query": "^5.77.2",
"@vueuse/components": "^10.11.0",
"@vueuse/core": "^10.11.0",
diff --git a/resources/js/layouts/LayoutBase.vue b/resources/js/layouts/LayoutBase.vue
index ffbb530e..a2e1a575 100755
--- a/resources/js/layouts/LayoutBase.vue
+++ b/resources/js/layouts/LayoutBase.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { useAppStore } from '@/stores/AppStore';
import { storeToRefs } from 'pinia';
+import { cn } from '@aminnausin/cedar-ui';
import NavBar from '@/components/panels/NavBar.vue';
@@ -8,38 +9,42 @@ const { selectedSideBar, sideBarTarget } = storeToRefs(useAppStore());
</script>
<template>
- <main
- class="pt-3 sm:pt-6 p-6 md:h-auto grid grid-cols-1 lg:grid-cols-10 2xl:grid-cols-6 gap-3 sm:gap-6 snap-y bg-primary-900 dark:bg-primary-dark-900 sm:bg-primary-950 sm:dark:bg-primary-dark-950 dark:text-white text-gray-900 antialiased overflow-x-clip"
- >
+ <main class="page grid snap-y grid-cols-1 gap-3 overflow-x-clip sm:gap-6 md:h-auto lg:grid-cols-10 2xl:grid-cols-6">
<section
id="left-card"
:class="[
- `col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-2 lg:order-1 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl sm:scroll-mt-6 ring-gray-900/5`,
- `${selectedSideBar && sideBarTarget === 'left-card' ? 'sm:ring-1' : 'hidden lg:block lg:invisible'}`,
- 'sm:p-3 flex flex-col gap-3',
+ 'card',
+ `order-2 col-span-1 sm:scroll-mt-6 lg:order-1 lg:col-span-2 2xl:col-span-1`,
+ `${selectedSideBar && sideBarTarget === 'left-card' ? 'sm:ring-1' : 'hidden lg:invisible lg:block'}`,
+ 'flex flex-col gap-3 sm:p-3',
]"
>
<slot name="leftSidebar"></slot>
</section>
- <section
- id="content-card"
- :class="[
- 'col-span-full lg:col-span-6 2xl:col-span-4 grow order-1 lg:order-2 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl w-full h-fit sm:ring-1 ring-gray-900/5',
- 'flex flex-col gap-3 sm:pt-3 sm:p-6',
- ]"
- >
+ <section id="content-card" :class="['card', 'order-1 col-span-full w-full grow lg:order-2 lg:col-span-6 2xl:col-span-4', 'flex flex-col gap-3 sm:p-6 sm:pt-3']">
<NavBar />
<slot name="content" class="relative z-0"></slot>
</section>
<section
id="list-card"
- :class="[
- `col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-3 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl sm:scroll-mt-6 ring-gray-900/5`,
- `${selectedSideBar && sideBarTarget === 'list-card' ? 'sm:ring-1' : 'hidden'}`,
- 'sm:p-3 flex flex-col gap-3',
- ]"
+ :class="
+ cn(`card order-3 col-span-1 sm:scroll-mt-6 lg:col-span-2 2xl:col-span-1`, 'hidden flex-col gap-3 sm:p-3', {
+ flex: selectedSideBar && sideBarTarget === 'list-card',
+ })
+ "
>
<slot name="sidebar"></slot>
</section>
</main>
</template>
+
+<style lang="css" scoped>
+@reference "../../css/app.css";
+.card {
+ @apply bg-primary-900 dark:bg-primary-dark-900 h-fit ring-gray-900/5 sm:rounded-2xl sm:shadow-xl sm:ring-1;
+}
+
+.page {
+ @apply bg-primary-900 dark:bg-primary-dark-900 sm:bg-primary-950 sm:dark:bg-primary-dark-950 p-6 pt-3 text-gray-900 antialiased sm:pt-6 dark:text-white;
+}
+</style>