diff --git a/packages/admin/composer.json b/packages/admin/composer.json index 3eddd0f7b..ed7d1e6b7 100755 --- a/packages/admin/composer.json +++ b/packages/admin/composer.json @@ -21,6 +21,8 @@ "bacon/bacon-qr-code": "^2.0", "danharrin/livewire-rate-limiting": "^0.3|^1.0", "filament/forms": "^3.2", + "filament/spatie-laravel-media-library-plugin": "^3.2", + "filament/tables": "^3.2", "gehrisandro/tailwind-merge-laravel": "^1.2", "illuminate/console": "^10.0|^11.0", "illuminate/contracts": "^10.0|^11.0", diff --git a/packages/admin/config/components/brand.php b/packages/admin/config/components/brand.php index e8c374509..5ee96276a 100644 --- a/packages/admin/config/components/brand.php +++ b/packages/admin/config/components/brand.php @@ -2,8 +2,7 @@ declare(strict_types=1); -use Shopper\Livewire\Components; -use Shopper\Livewire\Pages; +use Shopper\Livewire; return [ @@ -13,7 +12,9 @@ |-------------------------------------------------------------------------- */ - 'pages' => [], + 'pages' => [ + 'index' => Livewire\Pages\Brand\Index::class, + ], /* |-------------------------------------------------------------------------- @@ -22,9 +23,7 @@ */ 'components' => [ - 'brands.browse' => Components\Brands\Browse::class, - 'brands.create' => Components\Brands\Create::class, - 'brands.edit' => Components\Brands\Edit::class, + 'slide-overs.brand-form' => Livewire\SlideOvers\BrandForm::class, ], ]; diff --git a/packages/admin/config/components/dashboard.php b/packages/admin/config/components/dashboard.php index ce077bcbb..e59c2cbc4 100644 --- a/packages/admin/config/components/dashboard.php +++ b/packages/admin/config/components/dashboard.php @@ -25,7 +25,7 @@ 'components' => [ // 'search' => Components\Search::class, - 'side-panel' => Components\SidePanel::class, + 'side-panel' => Components\SlideOverPanel::class, ], ]; diff --git a/packages/admin/public/shopper.css b/packages/admin/public/shopper.css index d17273c3d..9b92fbd06 100755 --- a/packages/admin/public/shopper.css +++ b/packages/admin/public/shopper.css @@ -3598,6 +3598,14 @@ html { right: 3rem; } +.right-2 { + right: 0.5rem; +} + +.right-2\.5 { + right: 0.625rem; +} + .right-6 { right: 1.5rem; } @@ -3694,6 +3702,10 @@ html { grid-column: span 6 / span 6; } +.col-span-full { + grid-column: 1 / -1; +} + .col-start-2 { grid-column-start: 2; } @@ -3786,6 +3798,16 @@ html { margin-bottom: -0.5rem; } +.mx-1 { + margin-left: 0.25rem; + margin-right: 0.25rem; +} + +.mx-3 { + margin-left: 0.75rem; + margin-right: 0.75rem; +} + .mx-auto { margin-left: auto; margin-right: auto; @@ -3801,6 +3823,11 @@ html { margin-bottom: 0.5rem; } +.my-4 { + margin-top: 1rem; + margin-bottom: 1rem; +} + .my-8 { margin-top: 2rem; margin-bottom: 2rem; @@ -3810,6 +3837,10 @@ html { margin-top: 0px !important; } +.-mb-4 { + margin-bottom: -1rem; +} + .-mb-6 { margin-bottom: -1.5rem; } @@ -3874,6 +3905,10 @@ html { margin-top: -1.5rem; } +.-mt-7 { + margin-top: -1.75rem; +} + .-mt-px { margin-top: -1px; } @@ -4325,6 +4360,10 @@ html { width: 69.25rem; } +.w-\[calc\(100\%\+2rem\)\] { + width: calc(100% + 2rem); +} + .w-auto { width: auto; } @@ -4938,6 +4977,10 @@ html { row-gap: 0.25rem; } +.gap-y-1\.5 { + row-gap: 0.375rem; +} + .gap-y-2 { row-gap: 0.5rem; } @@ -4958,6 +5001,10 @@ html { row-gap: 1.5rem; } +.gap-y-px { + row-gap: 1px; +} + .-space-x-1 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(-0.25rem * var(--tw-space-x-reverse)); @@ -5203,6 +5250,10 @@ html { white-space: nowrap; } +.whitespace-normal { + white-space: normal; +} + .whitespace-nowrap { white-space: nowrap; } @@ -5336,6 +5387,15 @@ html { border-right-width: 0.5px; } +.border-y { + border-top-width: 1px; + border-bottom-width: 1px; +} + +.\!border-t-0 { + border-top-width: 0px !important; +} + .border-b { border-bottom-width: 1px; } @@ -5506,17 +5566,17 @@ html { .bg-custom-100 { --tw-bg-opacity: 1; - background-color: rgb(219 234 254 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-100), var(--tw-bg-opacity)); } .bg-custom-50 { --tw-bg-opacity: 1; - background-color: rgb(239 246 255 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-50), var(--tw-bg-opacity)); } .bg-custom-600 { --tw-bg-opacity: 1; - background-color: rgb(37 99 235 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-600), var(--tw-bg-opacity)); } .bg-danger-100 { @@ -5543,6 +5603,10 @@ html { background-color: rgba(var(--gray-100), 0.5); } +.bg-gray-100\/75 { + background-color: rgba(var(--gray-100), 0.75); +} + .bg-gray-200 { --tw-bg-opacity: 1; background-color: rgba(var(--gray-200), var(--tw-bg-opacity)); @@ -5692,10 +5756,6 @@ html { background-color: rgb(255 255 255 / 0.05); } -.bg-white\/60 { - background-color: rgb(255 255 255 / 0.6); -} - .bg-white\/75 { background-color: rgb(255 255 255 / 0.75); } @@ -5978,6 +6038,11 @@ html { padding-bottom: 0.75rem; } +.py-3\.5 { + padding-top: 0.875rem; + padding-bottom: 0.875rem; +} + .py-4 { padding-top: 1rem; padding-bottom: 1rem; @@ -6054,10 +6119,6 @@ html { padding-left: 2.5rem; } -.pl-16 { - padding-left: 4rem; -} - .pl-18 { padding-left: 4.5rem; } @@ -6134,10 +6195,18 @@ html { padding-inline-start: 0.75rem; } +.ps-4 { + padding-inline-start: 1rem; +} + .ps-\[5\.25rem\] { padding-inline-start: 5.25rem; } +.pt-0 { + padding-top: 0px; +} + .pt-1 { padding-top: 0.25rem; } @@ -6174,10 +6243,6 @@ html { padding-top: 1.5rem; } -.pt-8 { - padding-top: 2rem; -} - .text-left { text-align: left; } @@ -6202,6 +6267,10 @@ html { text-align: end; } +.align-top { + vertical-align: top; +} + .align-middle { vertical-align: middle; } @@ -6356,21 +6425,21 @@ html { .text-custom-400 { --tw-text-opacity: 1; - color: rgb(96 165 250 / var(--tw-text-opacity)); + color: rgba(var(--c-400), var(--tw-text-opacity)); } .text-custom-500 { --tw-text-opacity: 1; - color: rgb(59 130 246 / var(--tw-text-opacity)); + color: rgba(var(--c-500), var(--tw-text-opacity)); } .text-custom-600 { --tw-text-opacity: 1; - color: rgb(37 99 235 / var(--tw-text-opacity)); + color: rgba(var(--c-600), var(--tw-text-opacity)); } .text-custom-700\/50 { - color: rgb(29 78 216 / 0.5); + color: rgba(var(--c-700), 0.5); } .text-danger-400 { @@ -6700,15 +6769,15 @@ html { .ring-custom-600 { --tw-ring-opacity: 1; - --tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity)); + --tw-ring-color: rgba(var(--c-600), var(--tw-ring-opacity)); } .ring-custom-600\/10 { - --tw-ring-color: rgb(37 99 235 / 0.1); + --tw-ring-color: rgba(var(--c-600), 0.1); } .ring-custom-600\/20 { - --tw-ring-color: rgb(37 99 235 / 0.2); + --tw-ring-color: rgba(var(--c-600), 0.2); } .ring-danger-500\/10 { @@ -6772,6 +6841,11 @@ html { --tw-ring-opacity: 0.05; } +.blur { + --tw-blur: blur(8px); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + .blur-3xl { --tw-blur: blur(64px); filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); @@ -6994,6 +7068,39 @@ input[type='number'] { display: block; } +.fi-modal-close-overlay { + --tw-backdrop-blur: blur(4px); + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + +@keyframes shaking { + 0% { + transform: translateX(0) + } + + 25% { + transform: translateX(5px) + } + + 50% { + transform: translateX(-5px) + } + + 75% { + transform: translateX(5px) + } + + 100% { + transform: translateX(0) + } +} + +.horizontal-shake { + animation: shaking 0.35s normal; + animation-iteration-count: 1 +} + .iti { position: relative; display: block; @@ -8557,6 +8664,12 @@ input[type='number'] { position: absolute; } +.before\:inset-y-0::before { + content: var(--tw-content); + top: 0px; + bottom: 0px; +} + .before\:start-0::before { content: var(--tw-content); inset-inline-start: 0px; @@ -8587,10 +8700,22 @@ input[type='number'] { border-inline-start-width: 0px; } +.first\:border-t-0:first-child { + border-top-width: 0px; +} + .last\:border-e-0:last-child { border-inline-end-width: 0px; } +.first-of-type\:ps-1:first-of-type { + padding-inline-start: 0.25rem; +} + +.last-of-type\:pe-1:last-of-type { + padding-inline-end: 0.25rem; +} + .checked\:ring-0:checked { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color); @@ -8621,17 +8746,17 @@ input[type='number'] { } .hover\:bg-custom-400\/10:hover { - background-color: rgb(96 165 250 / 0.1); + background-color: rgba(var(--c-400), 0.1); } .hover\:bg-custom-50:hover { --tw-bg-opacity: 1; - background-color: rgb(239 246 255 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-50), var(--tw-bg-opacity)); } .hover\:bg-custom-500:hover { --tw-bg-opacity: 1; - background-color: rgb(59 130 246 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-500), var(--tw-bg-opacity)); } .hover\:bg-danger-100:hover { @@ -8683,11 +8808,11 @@ input[type='number'] { .hover\:text-custom-600:hover { --tw-text-opacity: 1; - color: rgb(37 99 235 / var(--tw-text-opacity)); + color: rgba(var(--c-600), var(--tw-text-opacity)); } .hover\:text-custom-700\/75:hover { - color: rgb(29 78 216 / 0.75); + color: rgba(var(--c-700), 0.75); } .hover\:text-gray-100:hover { @@ -8911,16 +9036,6 @@ input[type='number'] { --tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity)); } -.focus\:ring-gray-500:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgba(var(--gray-500), var(--tw-ring-opacity)); -} - -.focus\:ring-indigo-500:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity)); -} - .focus\:ring-primary-200:focus { --tw-ring-opacity: 1; --tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity)); @@ -8952,10 +9067,6 @@ input[type='number'] { --tw-ring-offset-color: #eff6ff; } -.focus\:ring-offset-primary-800:focus { - --tw-ring-offset-color: #1e40af; -} - .checked\:focus\:ring-danger-500\/50:focus:checked { --tw-ring-color: rgb(239 68 68 / 0.5); } @@ -8975,7 +9086,7 @@ input[type='number'] { .focus-visible\:bg-custom-50:focus-visible { --tw-bg-opacity: 1; - background-color: rgb(239 246 255 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-50), var(--tw-bg-opacity)); } .focus-visible\:bg-gray-50:focus-visible { @@ -8984,7 +9095,12 @@ input[type='number'] { } .focus-visible\:text-custom-700\/75:focus-visible { - color: rgb(29 78 216 / 0.75); + color: rgba(var(--c-700), 0.75); +} + +.focus-visible\:text-gray-500:focus-visible { + --tw-text-opacity: 1; + color: rgba(var(--gray-500), var(--tw-text-opacity)); } .focus-visible\:text-gray-700\/75:focus-visible { @@ -9013,12 +9129,12 @@ input[type='number'] { } .focus-visible\:ring-custom-500\/50:focus-visible { - --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-color: rgba(var(--c-500), 0.5); } .focus-visible\:ring-custom-600:focus-visible { --tw-ring-opacity: 1; - --tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity)); + --tw-ring-color: rgba(var(--c-600), var(--tw-ring-opacity)); } .focus-visible\:ring-gray-400\/40:focus-visible { @@ -9159,6 +9275,11 @@ input[type='number'] { border-color: rgb(147 197 253 / var(--tw-border-opacity)); } +.group:focus-visible .group-focus-visible\:text-gray-500 { + --tw-text-opacity: 1; + color: rgba(var(--gray-500), var(--tw-text-opacity)); +} + .group:focus-visible .group-focus-visible\:text-gray-700 { --tw-text-opacity: 1; color: rgba(var(--gray-700), var(--tw-text-opacity)); @@ -9172,19 +9293,6 @@ input[type='number'] { text-decoration-line: underline; } -:is(.dark .dark\:flex) { - display: flex; -} - -:is(.dark .dark\:hidden) { - display: none; -} - -:is(.dark .dark\:translate-x-5) { - --tw-translate-x: 1.25rem; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - :is(.dark .dark\:divide-gray-600) > :not([hidden]) ~ :not([hidden]) { --tw-divide-opacity: 1; border-color: rgba(var(--gray-600), var(--tw-divide-opacity)); @@ -9235,6 +9343,10 @@ input[type='number'] { border-color: rgb(255 255 255 / 0.1); } +:is(.dark .dark\:border-white\/5) { + border-color: rgb(255 255 255 / 0.05); +} + :is(.dark .dark\:border-t-white\/10) { border-top-color: rgb(255 255 255 / 0.1); } @@ -9245,16 +9357,16 @@ input[type='number'] { } :is(.dark .dark\:bg-custom-400\/10) { - background-color: rgb(96 165 250 / 0.1); + background-color: rgba(var(--c-400), 0.1); } :is(.dark .dark\:bg-custom-500) { --tw-bg-opacity: 1; - background-color: rgb(59 130 246 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-500), var(--tw-bg-opacity)); } :is(.dark .dark\:bg-custom-500\/20) { - background-color: rgb(59 130 246 / 0.2); + background-color: rgba(var(--c-500), 0.2); } :is(.dark .dark\:bg-danger-400\/10) { @@ -9322,10 +9434,6 @@ input[type='number'] { background-color: rgba(var(--gray-900), 0.5); } -:is(.dark .dark\:bg-gray-900\/80) { - background-color: rgba(var(--gray-900), 0.8); -} - :is(.dark .dark\:bg-gray-950) { --tw-bg-opacity: 1; background-color: rgba(var(--gray-950), var(--tw-bg-opacity)); @@ -9356,6 +9464,10 @@ input[type='number'] { background-color: transparent; } +:is(.dark .dark\:bg-white\/10) { + background-color: rgb(255 255 255 / 0.1); +} + :is(.dark .dark\:bg-white\/5) { background-color: rgb(255 255 255 / 0.05); } @@ -9413,12 +9525,12 @@ input[type='number'] { } :is(.dark .dark\:text-custom-300\/50) { - color: rgb(147 197 253 / 0.5); + color: rgba(var(--c-300), 0.5); } :is(.dark .dark\:text-custom-400) { --tw-text-opacity: 1; - color: rgb(96 165 250 / var(--tw-text-opacity)); + color: rgba(var(--c-400), var(--tw-text-opacity)); } :is(.dark .dark\:text-danger-400) { @@ -9517,23 +9629,17 @@ input[type='number'] { color: rgba(var(--gray-400), var(--tw-placeholder-opacity)); } -:is(.dark .dark\:shadow-lg) { - --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); -} - :is(.dark .dark\:ring-black\/10) { --tw-ring-color: rgb(0 0 0 / 0.1); } :is(.dark .dark\:ring-custom-400\/30) { - --tw-ring-color: rgb(96 165 250 / 0.3); + --tw-ring-color: rgba(var(--c-400), 0.3); } :is(.dark .dark\:ring-custom-500) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); + --tw-ring-color: rgba(var(--c-500), var(--tw-ring-opacity)); } :is(.dark .dark\:ring-danger-500) { @@ -9585,6 +9691,14 @@ input[type='number'] { --tw-ring-color: rgb(255 255 255 / 0.2); } +:is(.dark .dark\:ring-white\/5) { + --tw-ring-color: rgb(255 255 255 / 0.05); +} + +:is(.dark .dark\:ring-offset-gray-900) { + --tw-ring-offset-color: rgba(var(--gray-900), 1); +} + :is(.dark .dark\:placeholder\:text-gray-500)::-moz-placeholder { --tw-text-opacity: 1; color: rgba(var(--gray-500), var(--tw-text-opacity)); @@ -9633,11 +9747,11 @@ input[type='number'] { :is(.dark .dark\:hover\:bg-custom-400:hover) { --tw-bg-opacity: 1; - background-color: rgb(96 165 250 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-400), var(--tw-bg-opacity)); } :is(.dark .dark\:hover\:bg-custom-400\/10:hover) { - background-color: rgb(96 165 250 / 0.1); + background-color: rgba(var(--c-400), 0.1); } :is(.dark .dark\:hover\:bg-danger-400\/20:hover) { @@ -9682,11 +9796,11 @@ input[type='number'] { :is(.dark .dark\:hover\:text-custom-300:hover) { --tw-text-opacity: 1; - color: rgb(147 197 253 / var(--tw-text-opacity)); + color: rgba(var(--c-300), var(--tw-text-opacity)); } :is(.dark .dark\:hover\:text-custom-300\/75:hover) { - color: rgb(147 197 253 / 0.75); + color: rgba(var(--c-300), 0.75); } :is(.dark .dark\:hover\:text-gray-200:hover) { @@ -9728,6 +9842,10 @@ input[type='number'] { color: rgb(255 255 255 / var(--tw-text-opacity)); } +:is(.dark .dark\:hover\:ring-white\/20:hover) { + --tw-ring-color: rgb(255 255 255 / 0.2); +} + :is(.dark .dark\:focus\:border-primary-500:focus) { --tw-border-opacity: 1; border-color: rgb(59 130 246 / var(--tw-border-opacity)); @@ -9785,7 +9903,7 @@ input[type='number'] { } :is(.dark .dark\:focus-visible\:bg-custom-400\/10:focus-visible) { - background-color: rgb(96 165 250 / 0.1); + background-color: rgba(var(--c-400), 0.1); } :is(.dark .dark\:focus-visible\:bg-white\/5:focus-visible) { @@ -9793,20 +9911,25 @@ input[type='number'] { } :is(.dark .dark\:focus-visible\:text-custom-300\/75:focus-visible) { - color: rgb(147 197 253 / 0.75); + color: rgba(var(--c-300), 0.75); } :is(.dark .dark\:focus-visible\:text-gray-300\/75:focus-visible) { color: rgba(var(--gray-300), 0.75); } +:is(.dark .dark\:focus-visible\:text-gray-400:focus-visible) { + --tw-text-opacity: 1; + color: rgba(var(--gray-400), var(--tw-text-opacity)); +} + :is(.dark .dark\:focus-visible\:ring-custom-400\/50:focus-visible) { - --tw-ring-color: rgb(96 165 250 / 0.5); + --tw-ring-color: rgba(var(--c-400), 0.5); } :is(.dark .dark\:focus-visible\:ring-custom-500:focus-visible) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); + --tw-ring-color: rgba(var(--c-500), var(--tw-ring-opacity)); } :is(.dark .dark\:focus-visible\:ring-primary-500:focus-visible) { @@ -9874,6 +9997,11 @@ input[type='number'] { color: rgba(var(--gray-200), var(--tw-text-opacity)); } +:is(.dark .group:focus-visible .dark\:group-focus-visible\:text-gray-400) { + --tw-text-opacity: 1; + color: rgba(var(--gray-400), var(--tw-text-opacity)); +} + @media (min-width: 640px) { .sm\:col-\[--col-span-sm\] { grid-column: var(--col-span-sm); @@ -9930,6 +10058,10 @@ input[type='number'] { margin-left: auto; } + .sm\:ms-auto { + margin-inline-start: auto; + } + .sm\:mt-0 { margin-top: 0px; } @@ -9946,6 +10078,10 @@ input[type='number'] { display: flex; } + .sm\:table-cell { + display: table-cell; + } + .sm\:grid { display: grid; } @@ -9982,6 +10118,10 @@ input[type='number'] { width: 16rem; } + .sm\:w-\[calc\(100\%\+3rem\)\] { + width: calc(100% + 3rem); + } + .sm\:w-auto { width: auto; } @@ -10096,6 +10236,10 @@ input[type='number'] { flex-direction: row-reverse; } + .sm\:flex-nowrap { + flex-wrap: nowrap; + } + .sm\:items-start { align-items: flex-start; } @@ -10112,6 +10256,14 @@ input[type='number'] { justify-content: space-between; } + .sm\:gap-1 { + gap: 0.25rem; + } + + .sm\:gap-3 { + gap: 0.75rem; + } + .sm\:gap-4 { gap: 1rem; } @@ -10194,11 +10346,6 @@ input[type='number'] { padding-right: 0px; } - .sm\:px-4 { - padding-left: 1rem; - padding-right: 1rem; - } - .sm\:px-5 { padding-left: 1.25rem; padding-right: 1.25rem; @@ -10209,6 +10356,16 @@ input[type='number'] { padding-right: 1.5rem; } + .sm\:py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; + } + + .sm\:py-1\.5 { + padding-top: 0.375rem; + padding-bottom: 0.375rem; + } + .sm\:py-12 { padding-top: 3rem; padding-bottom: 3rem; @@ -10234,6 +10391,14 @@ input[type='number'] { padding-bottom: 1.5rem; } + .sm\:pe-3 { + padding-inline-end: 0.75rem; + } + + .sm\:pe-6 { + padding-inline-end: 1.5rem; + } + .sm\:pl-8 { padding-left: 2rem; } @@ -10242,6 +10407,14 @@ input[type='number'] { padding-right: 2rem; } + .sm\:ps-3 { + padding-inline-start: 0.75rem; + } + + .sm\:ps-6 { + padding-inline-start: 1.5rem; + } + .sm\:pt-1 { padding-top: 0.25rem; } @@ -10293,6 +10466,22 @@ input[type='number'] { line-height: 2.25rem; } + .sm\:first-of-type\:ps-3:first-of-type { + padding-inline-start: 0.75rem; + } + + .sm\:first-of-type\:ps-6:first-of-type { + padding-inline-start: 1.5rem; + } + + .sm\:last-of-type\:pe-3:last-of-type { + padding-inline-end: 0.75rem; + } + + .sm\:last-of-type\:pe-6:last-of-type { + padding-inline-end: 1.5rem; + } + :is(.dark .sm\:dark\:border-gray-700) { --tw-border-opacity: 1; border-color: rgba(var(--gray-700), var(--tw-border-opacity)); @@ -10328,6 +10517,10 @@ input[type='number'] { display: flex; } + .md\:table-cell { + display: table-cell; + } + .md\:inline-grid { display: inline-grid; } @@ -10410,10 +10603,22 @@ input[type='number'] { align-items: center; } + .md\:justify-end { + justify-content: flex-end; + } + .md\:justify-between { justify-content: space-between; } + .md\:gap-1 { + gap: 0.25rem; + } + + .md\:gap-3 { + gap: 0.75rem; + } + .md\:gap-x-12 { -moz-column-gap: 3rem; column-gap: 3rem; @@ -10448,6 +10653,10 @@ input[type='number'] { .md\:p-20 { padding: 5rem; } + + .md\:ps-3 { + padding-inline-start: 0.75rem; + } } @media (min-width: 1024px) { @@ -10545,26 +10754,6 @@ input[type='number'] { height: 100%; } - .lg\:h-\[650px\] { - height: 650px; - } - - .lg\:max-h-\[650px\] { - max-height: 650px; - } - - .lg\:max-h-\[550px\] { - max-height: 550px; - } - - .lg\:max-h-\[600px\] { - max-height: 600px; - } - - .lg\:max-h-\[620px\] { - max-height: 620px; - } - .lg\:max-h-\[580px\] { max-height: 580px; } @@ -10674,6 +10863,14 @@ input[type='number'] { justify-content: space-between; } + .lg\:gap-1 { + gap: 0.25rem; + } + + .lg\:gap-3 { + gap: 0.75rem; + } + .lg\:gap-4 { gap: 1rem; } @@ -10827,6 +11024,10 @@ input[type='number'] { padding-top: 1.25rem; } + .lg\:pt-6 { + padding-top: 1.5rem; + } + .lg\:text-left { text-align: left; } @@ -10870,6 +11071,14 @@ input[type='number'] { grid-column-start: var(--col-start-xl); } + .xl\:block { + display: block; + } + + .xl\:table-cell { + display: table-cell; + } + .xl\:inline-grid { display: inline-grid; } @@ -10934,6 +11143,14 @@ input[type='number'] { .xl\:items-center { align-items: center; } + + .xl\:gap-1 { + gap: 0.25rem; + } + + .xl\:gap-3 { + gap: 0.75rem; + } } @media (min-width: 1536px) { @@ -10945,6 +11162,14 @@ input[type='number'] { grid-column-start: var(--col-start-2xl); } + .\32xl\:block { + display: block; + } + + .\32xl\:table-cell { + display: table-cell; + } + .\32xl\:inline-grid { display: inline-grid; } @@ -11006,6 +11231,14 @@ input[type='number'] { align-items: center; } + .\32xl\:gap-1 { + gap: 0.25rem; + } + + .\32xl\:gap-3 { + gap: 0.75rem; + } + .\32xl\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; @@ -11071,6 +11304,10 @@ input[type='number'] { display: none; } +.\[\&\:not\(\:first-of-type\)\]\:border-s:not(:first-of-type) { + border-inline-start-width: 1px; +} + .\[\&\:not\(\:has\(\.fi-ac-action\:focus\)\)\]\:focus-within\:ring-2:focus-within:not(:has(.fi-ac-action:focus)) { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); @@ -11097,6 +11334,10 @@ input[type='number'] { --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); } +.\[\&\:not\(\:last-of-type\)\]\:border-e:not(:last-of-type) { + border-inline-end-width: 1px; +} + .\[\&\:not\(\:nth-child\(1_of_\.fi-btn\)\)\]\:shadow-\[-1px_0_0_0_theme\(colors\.gray\.200\)\]:not(:nth-child(1 of .fi-btn)) { --tw-shadow: -1px 0 0 0 rgba(var(--gray-200), 1); --tw-shadow-colored: -1px 0 0 0 var(--tw-shadow-color); @@ -11123,10 +11364,47 @@ input[type='number'] { border-end-end-radius: 0.5rem; } +.\[\&\>\*\:first-child\]\:relative>*:first-child { + position: relative; +} + .\[\&\>\*\:first-child\]\:mt-0>*:first-child { margin-top: 0px; } +.\[\&\>\*\:first-child\]\:before\:absolute>*:first-child::before { + content: var(--tw-content); + position: absolute; +} + +.\[\&\>\*\:first-child\]\:before\:inset-y-0>*:first-child::before { + content: var(--tw-content); + top: 0px; + bottom: 0px; +} + +.\[\&\>\*\:first-child\]\:before\:start-0>*:first-child::before { + content: var(--tw-content); + inset-inline-start: 0px; +} + +.\[\&\>\*\:first-child\]\:before\:w-0\.5>*:first-child::before { + content: var(--tw-content); + width: 0.125rem; +} + +.\[\&\>\*\:first-child\]\:before\:bg-primary-600>*:first-child::before { + content: var(--tw-content); + --tw-bg-opacity: 1; + background-color: rgb(37 99 235 / var(--tw-bg-opacity)); +} + +:is(.dark .\[\&\>\*\:first-child\]\:dark\:before\:bg-primary-500)>*:first-child::before { + content: var(--tw-content); + --tw-bg-opacity: 1; + background-color: rgb(59 130 246 / var(--tw-bg-opacity)); +} + .\[\&\>\*\:last-child\]\:mb-0>*:last-child { margin-bottom: 0px; } @@ -11168,9 +11446,23 @@ input[type='number'] { color: rgb(255 255 255 / var(--tw-text-opacity)); } +@media(hover:hover) { + .\[\@media\(hover\:hover\)\]\:transition { + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + } + + .\[\@media\(hover\:hover\)\]\:duration-75 { + transition-duration: 75ms; + } +} + input:checked+.\[input\:checked\+\&\]\:bg-custom-600 { --tw-bg-opacity: 1; - background-color: rgb(37 99 235 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-600), var(--tw-bg-opacity)); } input:checked+.\[input\:checked\+\&\]\:text-white { @@ -11186,25 +11478,25 @@ input:checked+.\[input\:checked\+\&\]\:ring-0 { input:checked+.\[input\:checked\+\&\]\:hover\:bg-custom-500:hover { --tw-bg-opacity: 1; - background-color: rgb(59 130 246 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-500), var(--tw-bg-opacity)); } :is(.dark input:checked+.dark\:\[input\:checked\+\&\]\:bg-custom-500) { --tw-bg-opacity: 1; - background-color: rgb(59 130 246 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-500), var(--tw-bg-opacity)); } :is(.dark input:checked+.dark\:\[input\:checked\+\&\]\:hover\:bg-custom-400:hover) { --tw-bg-opacity: 1; - background-color: rgb(96 165 250 / var(--tw-bg-opacity)); + background-color: rgba(var(--c-400), var(--tw-bg-opacity)); } input:checked:focus-visible+.\[input\:checked\:focus-visible\+\&\]\:ring-custom-500\/50 { - --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-color: rgba(var(--c-500), 0.5); } :is(.dark input:checked:focus-visible+.dark\:\[input\:checked\:focus-visible\+\&\]\:ring-custom-400\/50) { - --tw-ring-color: rgb(96 165 250 / 0.5); + --tw-ring-color: rgba(var(--c-400), 0.5); } input:focus-visible+.\[input\:focus-visible\+\&\]\:z-10 { diff --git a/packages/admin/public/shopper.js b/packages/admin/public/shopper.js index 1627bc24c..12812203d 100755 --- a/packages/admin/public/shopper.js +++ b/packages/admin/public/shopper.js @@ -1,3 +1,174 @@ (() => { + // resources/js/components/panel.js + var SlideOverPanel = () => { + return { + open: false, + showActiveComponent: true, + activeComponent: false, + componentHistory: [], + panelWidth: null, + listeners: [], + getActiveComponentPanelAttribute(key) { + if (this.$wire.get("components")[this.activeComponent] !== void 0) { + return this.$wire.get("components")[this.activeComponent]["panelAttributes"][key]; + } + }, + closePanelOnEscape(trigger) { + if (this.getActiveComponentPanelAttribute("closeOnEscape") === false) { + return; + } + let force = this.getActiveComponentPanelAttribute("closeOnEscapeIsForceful") === true; + this.closePanel(force); + }, + closePanelOnClickAway(trigger) { + if (this.getActiveComponentPanelAttribute("closeOnClickAway") === false) { + return; + } + this.closePanel(true); + }, + closePanel(force = false, skipPreviousPanels = 0, destroySkipped = false) { + if (this.show === false) { + return; + } + if (this.getActiveComponentPanelAttribute("dispatchCloseEvent") === true) { + const componentName = this.$wire.get("components")[this.activeComponent].name; + Livewire.dispatch("panelClosed", { name: componentName }); + } + if (this.getActiveComponentPanelAttribute("destroyOnClose") === true) { + Livewire.dispatch("destroyComponent", { id: this.activeComponent }); + } + if (skipPreviousPanels > 0) { + for (let i = 0; i < skipPreviousPanels; i++) { + if (destroySkipped) { + const id2 = this.componentHistory[this.componentHistory.length - 1]; + Livewire.dispatch("destroyComponent", { id: id2 }); + } + this.componentHistory.pop(); + } + } + const id = this.componentHistory.pop(); + if (id && !force) { + if (id) { + this.setActivePanelComponent(id, true); + } else { + this.setShowPropertyTo(false); + } + } else { + this.setShowPropertyTo(false); + } + }, + setActivePanelComponent(id, skip = false) { + this.setShowPropertyTo(true); + if (this.activeComponent === id) { + return; + } + if (this.activeComponent !== false && skip === false) { + this.componentHistory.push(this.activeComponent); + } + let focusableTimeout = 50; + if (this.activeComponent === false) { + this.activeComponent = id; + this.showActiveComponent = true; + this.panelWidth = this.getActiveComponentPanelAttribute("maxWidthClass"); + } else { + this.showActiveComponent = false; + focusableTimeout = 400; + setTimeout(() => { + this.activeComponent = id; + this.showActiveComponent = true; + this.panelWidth = this.getActiveComponentPanelAttribute("maxWidthClass"); + }, 300); + } + this.$nextTick(() => { + let focusable = this.$refs[id]?.querySelector("[autofocus]"); + if (focusable) { + setTimeout(() => { + focusable.focus(); + }, focusableTimeout); + } + }); + }, + focusables() { + let selector = "a, button, input:not([type='hidden'], textarea, select, details, [tabindex]:not([tabindex='-1'])"; + return [...this.$el.querySelectorAll(selector)].filter((el) => !el.hasAttribute("disabled")); + }, + firstFocusable() { + return this.focusables()[0]; + }, + lastFocusable() { + return this.focusables().slice(-1)[0]; + }, + nextFocusable() { + return this.focusables()[this.nextFocusableIndex()] || this.firstFocusable(); + }, + prevFocusable() { + return this.focusables()[this.prevFocusableIndex()] || this.lastFocusable(); + }, + nextFocusableIndex() { + return (this.focusables().indexOf(document.activeElement) + 1) % (this.focusables().length + 1); + }, + prevFocusableIndex() { + return Math.max(0, this.focusables().indexOf(document.activeElement)) - 1; + }, + setShowPropertyTo(open) { + this.open = open; + if (open) { + document.body.classList.add("overflow-y-hidden"); + } else { + document.body.classList.remove("overflow-y-hidden"); + setTimeout(() => { + this.activeComponent = false; + this.$wire.resetState(); + }, 300); + } + }, + init() { + this.panelWidth = this.getActiveComponentPanelAttribute("maxWidthClass"); + this.listeners.push( + Livewire.on("closePanel", (data) => { + this.closePanel(data?.force ?? false, data?.skipPreviousPanels ?? 0, data?.destroySkipped ?? false); + }) + ); + this.listeners.push( + Livewire.on("activePanelComponentChanged", ({ id }) => { + this.setActivePanelComponent(id); + }) + ); + }, + destroy() { + this.listeners.forEach((listener) => { + listener(); + }); + } + }; + }; + var panel_default = SlideOverPanel; + + // resources/js/index.js + window.SlideOverPanel = panel_default; + document.addEventListener("alpine:init", () => { + const theme = localStorage.getItem("theme") ?? "light"; + window.Alpine.store( + "theme", + theme === "dark" || theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" + ); + window.addEventListener("theme-changed", (event) => { + let theme2 = event.detail; + localStorage.setItem("theme", theme2); + if (theme2 === "system") { + theme2 = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; + } + window.Alpine.store("theme", theme2); + }); + window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (event) => { + if (localStorage.getItem("theme") === "system") { + window.Alpine.store("theme", event.matches ? "dark" : "light"); + } + }); + window.Alpine.effect(() => { + const theme2 = window.Alpine.store("theme"); + theme2 === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"); + }); + }); })(); -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vcmVzb3VyY2VzL2pzL2NvbXBvbmVudHMvcGFuZWwuanMiLCAiLi4vcmVzb3VyY2VzL2pzL2luZGV4LmpzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBTbGlkZU92ZXJQYW5lbCA9ICgpID0+IHtcbiAgcmV0dXJuIHtcbiAgICBvcGVuOiBmYWxzZSxcbiAgICBzaG93QWN0aXZlQ29tcG9uZW50OiB0cnVlLFxuICAgIGFjdGl2ZUNvbXBvbmVudDogZmFsc2UsXG4gICAgY29tcG9uZW50SGlzdG9yeTogW10sXG4gICAgcGFuZWxXaWR0aDogbnVsbCxcbiAgICBsaXN0ZW5lcnM6IFtdLFxuICAgIGdldEFjdGl2ZUNvbXBvbmVudFBhbmVsQXR0cmlidXRlKGtleSkge1xuICAgICAgaWYgKHRoaXMuJHdpcmUuZ2V0KCdjb21wb25lbnRz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0FBQztBQUVILFdBQU8sT0FBTyxPQUFPLE1BQU07QUFDekIsWUFBTUEsU0FBUSxPQUFPLE9BQU8sTUFBTSxPQUFPO0FBRXpDLE1BQUFBLFdBQVUsU0FDTixTQUFTLGdCQUFnQixVQUFVLElBQUksTUFBTSxJQUM3QyxTQUFTLGdCQUFnQixVQUFVLE9BQU8sTUFBTTtBQUFBLElBQ3RELENBQUM7QUFBQSxFQUNILENBQUM7IiwKICAibmFtZXMiOiBbImlkIiwgInRoZW1lIl0KfQo= diff --git a/packages/admin/resources/css/components/filament.css b/packages/admin/resources/css/components/filament.css new file mode 100644 index 000000000..fb2a03af7 --- /dev/null +++ b/packages/admin/resources/css/components/filament.css @@ -0,0 +1,16 @@ +.fi-modal-close-overlay { + @apply backdrop-blur-sm; +} + +@keyframes shaking { + 0% { transform: translateX(0) } + 25% { transform: translateX(5px) } + 50% { transform: translateX(-5px) } + 75% { transform: translateX(5px) } + 100% { transform: translateX(0) } +} + +.horizontal-shake { + animation: shaking 0.35s normal; + animation-iteration-count: 1 +} diff --git a/packages/admin/resources/css/shopper.css b/packages/admin/resources/css/shopper.css index 178f807cd..5f487114c 100755 --- a/packages/admin/resources/css/shopper.css +++ b/packages/admin/resources/css/shopper.css @@ -4,6 +4,7 @@ @import 'base.css'; @import 'components/sidebar.css'; +@import 'components/filament.css'; @import 'components/intl-phone.css'; @layer base { diff --git a/packages/admin/resources/js/plugins/internationalNumber.js b/packages/admin/resources/js/components/internationalNumber.js similarity index 100% rename from packages/admin/resources/js/plugins/internationalNumber.js rename to packages/admin/resources/js/components/internationalNumber.js diff --git a/packages/admin/resources/js/components/panel.js b/packages/admin/resources/js/components/panel.js new file mode 100644 index 000000000..3d24f39ae --- /dev/null +++ b/packages/admin/resources/js/components/panel.js @@ -0,0 +1,164 @@ +const SlideOverPanel = () => { + return { + open: false, + showActiveComponent: true, + activeComponent: false, + componentHistory: [], + panelWidth: null, + listeners: [], + getActiveComponentPanelAttribute(key) { + if (this.$wire.get('components')[this.activeComponent] !== undefined) { + return this.$wire.get('components')[this.activeComponent]['panelAttributes'][key]; + } + }, + closePanelOnEscape(trigger) { + if (this.getActiveComponentPanelAttribute('closeOnEscape') === false) { + return; + } + + let force = this.getActiveComponentPanelAttribute('closeOnEscapeIsForceful') === true; + this.closePanel(force); + }, + closePanelOnClickAway(trigger) { + if (this.getActiveComponentPanelAttribute('closeOnClickAway') === false) { + return; + } + + this.closePanel(true); + }, + closePanel(force = false, skipPreviousPanels = 0, destroySkipped = false) { + if(this.show === false) { + return; + } + + if (this.getActiveComponentPanelAttribute('dispatchCloseEvent') === true) { + const componentName = this.$wire.get('components')[this.activeComponent].name; + Livewire.dispatch('panelClosed', { name: componentName }); + } + + if (this.getActiveComponentPanelAttribute('destroyOnClose') === true) { + Livewire.dispatch('destroyComponent', { id: this.activeComponent }); + } + + if (skipPreviousPanels > 0) { + for (let i = 0; i < skipPreviousPanels; i++) { + if (destroySkipped) { + const id = this.componentHistory[this.componentHistory.length - 1]; + Livewire.dispatch('destroyComponent', { id: id }); + } + this.componentHistory.pop(); + } + } + + const id = this.componentHistory.pop(); + + if (id && !force) { + if (id) { + this.setActivePanelComponent(id, true); + } else { + this.setShowPropertyTo(false); + } + } else { + this.setShowPropertyTo(false); + } + }, + setActivePanelComponent(id, skip = false) { + this.setShowPropertyTo(true); + + if (this.activeComponent === id) { + return; + } + + if (this.activeComponent !== false && skip === false) { + this.componentHistory.push(this.activeComponent); + } + + let focusableTimeout = 50; + + if (this.activeComponent === false) { + this.activeComponent = id + this.showActiveComponent = true; + this.panelWidth = this.getActiveComponentPanelAttribute('maxWidthClass'); + } else { + this.showActiveComponent = false; + + focusableTimeout = 400; + + setTimeout(() => { + this.activeComponent = id; + this.showActiveComponent = true; + this.panelWidth = this.getActiveComponentPanelAttribute('maxWidthClass'); + }, 300); + } + + this.$nextTick(() => { + let focusable = this.$refs[id]?.querySelector('[autofocus]'); + if (focusable) { + setTimeout(() => { + focusable.focus(); + }, focusableTimeout); + } + }); + }, + focusables() { + let selector = 'a, button, input:not([type=\'hidden\'], textarea, select, details, [tabindex]:not([tabindex=\'-1\'])' + + return [...this.$el.querySelectorAll(selector)] + .filter(el => !el.hasAttribute('disabled')) + }, + firstFocusable() { + return this.focusables()[0] + }, + lastFocusable() { + return this.focusables().slice(-1)[0] + }, + nextFocusable() { + return this.focusables()[this.nextFocusableIndex()] || this.firstFocusable() + }, + prevFocusable() { + return this.focusables()[this.prevFocusableIndex()] || this.lastFocusable() + }, + nextFocusableIndex() { + return (this.focusables().indexOf(document.activeElement) + 1) % (this.focusables().length + 1) + }, + prevFocusableIndex() { + return Math.max(0, this.focusables().indexOf(document.activeElement)) - 1 + }, + setShowPropertyTo(open) { + this.open = open; + + if (open) { + document.body.classList.add('overflow-y-hidden'); + } else { + document.body.classList.remove('overflow-y-hidden'); + + setTimeout(() => { + this.activeComponent = false; + this.$wire.resetState(); + }, 300); + } + }, + init() { + this.panelWidth = this.getActiveComponentPanelAttribute('maxWidthClass'); + + this.listeners.push( + Livewire.on('closePanel', (data) => { + this.closePanel(data?.force ?? false, data?.skipPreviousPanels ?? 0, data?.destroySkipped ?? false); + }) + ); + + this.listeners.push( + Livewire.on('activePanelComponentChanged', ({ id }) => { + this.setActivePanelComponent(id); + }) + ); + }, + destroy() { + this.listeners.forEach((listener) => { + listener(); + }); + } + } +} + +export default SlideOverPanel diff --git a/packages/admin/resources/js/helpers/shortcut.js b/packages/admin/resources/js/helpers/shortcut.js deleted file mode 100755 index 9a5c966b0..000000000 --- a/packages/admin/resources/js/helpers/shortcut.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * http://www.openjs.com/scripts/events/keyboard_shortcuts/ - * Version : 2.01.B - * By Binny V A - * License : BSD - */ -shortcut = { - all_shortcuts: {}, //All the shortcuts are stored in this array - add: function (shortcut_combination, callback, opt) { - //Provide a set of default options - let default_options = { - type: 'keydown', - propagate: false, - disable_in_input: false, - target: document, - keycode: false, - } - - if (!opt) opt = default_options - else { - for (let dfo in default_options) { - if (typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo] - } - } - - let ele = opt.target - if (typeof opt.target == 'string') ele = document.getElementById(opt.target) - let ths = this - shortcut_combination = shortcut_combination.toLowerCase() - - //The function to be called at keypress - const func = function (e) { - e = e || window.event - - if (opt['disable_in_input']) { - //Don't enable shortcut keys in Input, Textarea fields - let element - if (e.target) element = e.target - else if (e.srcElement) element = e.srcElement - if (element.nodeType === 3) element = element.parentNode - - if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') - return - } - - //Find Which key is pressed - if (e.keyCode) code = e.keyCode - else if (e.which) code = e.which - let character = String.fromCharCode(code).toLowerCase() - - if (code === 188) character = ',' //If the user presses , when the type is onkeydown - if (code === 190) character = '.' //If the user presses , when the type is onkeydown - - const keys = shortcut_combination.split('+') - //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked - let kp = 0 - - //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken - const shift_nums = { - '`': '~', - 1: '!', - 2: '@', - 3: '#', - 4: '$', - 5: '%', - 6: '^', - 7: '&', - 8: '*', - 9: '(', - 0: ')', - '-': '_', - '=': '+', - ';': ':', - "'": '"', - ',': '<', - '.': '>', - '/': '?', - '\\': '|', - } - //Special Keys - and their codes - const special_keys = { - esc: 27, - escape: 27, - tab: 9, - space: 32, - return: 13, - enter: 13, - backspace: 8, - - scrolllock: 145, - scroll_lock: 145, - scroll: 145, - capslock: 20, - caps_lock: 20, - caps: 20, - numlock: 144, - num_lock: 144, - num: 144, - - pause: 19, - break: 19, - - insert: 45, - home: 36, - delete: 46, - end: 35, - - pageup: 33, - page_up: 33, - pu: 33, - - pagedown: 34, - page_down: 34, - pd: 34, - - left: 37, - up: 38, - right: 39, - down: 40, - - f1: 112, - f2: 113, - f3: 114, - f4: 115, - f5: 116, - f6: 117, - f7: 118, - f8: 119, - f9: 120, - f10: 121, - f11: 122, - f12: 123, - } - - const modifiers = { - shift: { wanted: false, pressed: false }, - ctrl: { wanted: false, pressed: false }, - alt: { wanted: false, pressed: false }, - meta: { wanted: false, pressed: false }, //Meta is Mac specific - } - - if (e.ctrlKey) modifiers.ctrl.pressed = true - if (e.shiftKey) modifiers.shift.pressed = true - if (e.altKey) modifiers.alt.pressed = true - if (e.metaKey) modifiers.meta.pressed = true - - let k - for (let i = 0; (k = keys[i]), i < keys.length; i++) { - //Modifiers - if (k === 'ctrl' || k === 'control') { - kp++ - modifiers.ctrl.wanted = true - } else if (k === 'shift') { - kp++ - modifiers.shift.wanted = true - } else if (k === 'alt') { - kp++ - modifiers.alt.wanted = true - } else if (k === 'meta') { - kp++ - modifiers.meta.wanted = true - } else if (k.length > 1) { - //If it is a special key - if (special_keys[k] === code) kp++ - } else if (opt['keycode']) { - if (opt['keycode'] === code) kp++ - } else { - //The special keys did not match - if (character === k) kp++ - else { - if (shift_nums[character] && e.shiftKey) { - //Stupid Shift key bug created by using lowercase - character = shift_nums[character] - if (character === k) kp++ - } - } - } - } - - if ( - kp === keys.length && - modifiers.ctrl.pressed === modifiers.ctrl.wanted && - modifiers.shift.pressed === modifiers.shift.wanted && - modifiers.alt.pressed === modifiers.alt.wanted && - modifiers.meta.pressed === modifiers.meta.wanted - ) { - callback(e) - - if (!opt['propagate']) { - //Stop the event - //e.cancelBubble is supported by IE - this will kill the bubbling process. - e.cancelBubble = true - e.returnValue = false - - //e.stopPropagation works in Firefox. - if (e.stopPropagation) { - e.stopPropagation() - e.preventDefault() - } - return false - } - } - } - this.all_shortcuts[shortcut_combination] = { - callback: func, - target: ele, - event: opt['type'], - } - //Attach the function with the event - if (ele.addEventListener) ele.addEventListener(opt['type'], func, false) - else if (ele.attachEvent) ele.attachEvent('on' + opt['type'], func) - else ele['on' + opt['type']] = func - }, - - //Remove the shortcut - just specify the shortcut and I will remove the binding - remove: function (shortcut_combination) { - shortcut_combination = shortcut_combination.toLowerCase() - const binding = this.all_shortcuts[shortcut_combination] - delete this.all_shortcuts[shortcut_combination] - if (!binding) return - const type = binding['event'] - const ele = binding['target'] - const callback = binding['callback'] - - if (ele.detachEvent) ele.detachEvent('on' + type, callback) - else if (ele.removeEventListener) - ele.removeEventListener(type, callback, false) - else ele['on' + type] = false - }, -} diff --git a/packages/admin/resources/js/helpers/trix.js b/packages/admin/resources/js/helpers/trix.js deleted file mode 100755 index 798f36352..000000000 --- a/packages/admin/resources/js/helpers/trix.js +++ /dev/null @@ -1,46 +0,0 @@ -import Trix from 'trix' - -Trix.config.blockAttributes.heading = { - tagName: 'h2', - terminal: true, - breakOnReturn: true, - group: false, -} - -Trix.config.blockAttributes.subHeading = { - tagName: 'h3', - terminal: true, - breakOnReturn: true, - group: false, -} - -Trix.config.textAttributes.underline = { - style: { textDecoration: 'underline' }, - inheritable: true, - parser: (element) => { - const style = window.getComputedStyle(element) - - return style.textDecoration.includes('underline') - }, -} - -Trix.Block.prototype.breaksOnReturn = function () { - const lastAttribute = this.getLastAttribute() - const blockConfig = Trix.getBlockConfig( - lastAttribute ? lastAttribute : 'default', - ) - - return blockConfig?.breakOnReturn ?? false -} - -Trix.LineBreakInsertion.prototype.shouldInsertBlockBreak = function () { - if ( - this.block.hasAttributes() && - this.block.isListItem() && - !this.block.isEmpty() - ) { - return this.startLocation.offset > 0 - } else { - return !this.shouldBreakFormattedBlock() ? this.breaksOnReturn : false - } -} diff --git a/packages/admin/resources/js/helpers/window.js b/packages/admin/resources/js/helpers/window.js deleted file mode 100755 index c83eea17d..000000000 --- a/packages/admin/resources/js/helpers/window.js +++ /dev/null @@ -1,16 +0,0 @@ -import Choices from 'choices.js' -import TomSelect from 'tom-select' - -window.choices = (element) => { - return new Choices(element, { removeItemButton: true }) -} - -window.tomSelect = (element, options = {}) => { - return new TomSelect(element, options) -} - -window.scrollToPosition = (selector) => - document.querySelector(selector).scrollIntoView({ - behavior: 'smooth', - block: 'end', - }) diff --git a/packages/admin/resources/js/index.js b/packages/admin/resources/js/index.js index b51a1b56d..66cde8f11 100755 --- a/packages/admin/resources/js/index.js +++ b/packages/admin/resources/js/index.js @@ -54,3 +54,49 @@ window.Alpine.effect(() => { Livewire.start() */ +import SlideOverPanel from './components/panel' + +window.SlideOverPanel = SlideOverPanel + +document.addEventListener('alpine:init', () => { + const theme = localStorage.getItem('theme') ?? 'light' + + window.Alpine.store( + 'theme', + theme === 'dark' || + (theme === 'system' && + window.matchMedia('(prefers-color-scheme: dark)').matches) + ? 'dark' + : 'light', + ) + + window.addEventListener('theme-changed', (event) => { + let theme = event.detail + + localStorage.setItem('theme', theme) + + if (theme === 'system') { + theme = window.matchMedia('(prefers-color-scheme: dark)').matches + ? 'dark' + : 'light' + } + + window.Alpine.store('theme', theme) + }) + + window + .matchMedia('(prefers-color-scheme: dark)') + .addEventListener('change', (event) => { + if (localStorage.getItem('theme') === 'system') { + window.Alpine.store('theme', event.matches ? 'dark' : 'light') + } + }) + + window.Alpine.effect(() => { + const theme = window.Alpine.store('theme') + + theme === 'dark' + ? document.documentElement.classList.add('dark') + : document.documentElement.classList.remove('dark') + }) +}) diff --git a/packages/admin/resources/js/plugins/keyPress.js b/packages/admin/resources/js/plugins/keyPress.js deleted file mode 100755 index b59908c01..000000000 --- a/packages/admin/resources/js/plugins/keyPress.js +++ /dev/null @@ -1,14 +0,0 @@ -import '../helpers/shortcut' - -export default function (Alpine) { - Alpine.directive('keypress', (el) => { - // Display the list of shortcuts - shortcut.add('Shift+F1', function () { - window.dispatchEvent(new CustomEvent('shortcut-list', { bubbles: true })) - }) - // Move to the documentation - shortcut.add('Alt+D', function () { - window.open('https://laravelshopper.dev', '_blank') - }) - }) -} diff --git a/packages/admin/resources/lang/en/layout.php b/packages/admin/resources/lang/en/layout.php index 8e4b60730..b6d9b1223 100755 --- a/packages/admin/resources/lang/en/layout.php +++ b/packages/admin/resources/lang/en/layout.php @@ -190,6 +190,7 @@ 'apply' => 'Apply', 'next' => 'Next', 'back' => 'Back', + 'theme_switcher' => 'Enable :label theme', ], 'error' => 'Your submission contains errors. Please try again', diff --git a/packages/admin/resources/lang/en/notifications.php b/packages/admin/resources/lang/en/notifications.php index 921c305f4..a12cc306b 100755 --- a/packages/admin/resources/lang/en/notifications.php +++ b/packages/admin/resources/lang/en/notifications.php @@ -5,6 +5,7 @@ return [ 'actions' => [ + 'save' => ':item successfully save', 'create' => ':item successfully added', 'update' => ':item successfully updated', 'remove' => ':item successfully removed', diff --git a/packages/admin/resources/lang/fr/layout.php b/packages/admin/resources/lang/fr/layout.php index 79a26b514..0c27ed007 100755 --- a/packages/admin/resources/lang/fr/layout.php +++ b/packages/admin/resources/lang/fr/layout.php @@ -190,6 +190,7 @@ 'apply' => 'Appliquer', 'next' => 'Suivant', 'back' => 'Retour', + 'theme_switcher' => 'Activer :label theme', ], 'error' => 'Votre soumission contient des erreurs. Veuillez réessayer', diff --git a/packages/admin/resources/lang/fr/notifications.php b/packages/admin/resources/lang/fr/notifications.php index 50311723f..ddbbcdb2f 100755 --- a/packages/admin/resources/lang/fr/notifications.php +++ b/packages/admin/resources/lang/fr/notifications.php @@ -5,6 +5,7 @@ return [ 'actions' => [ + 'save' => ':item enregistré avec succès', 'create' => ':item ajouté avec succès', 'update' => ':item mis à jour avec succès', 'remove' => ':item supprimé(e) avec succès', diff --git a/packages/admin/resources/lang/fr/words.php b/packages/admin/resources/lang/fr/words.php index c781edf13..bbff97884 100755 --- a/packages/admin/resources/lang/fr/words.php +++ b/packages/admin/resources/lang/fr/words.php @@ -77,7 +77,7 @@ 'is_enabled' => 'Est activé', 'selected_tab' => 'Onglet sélectionné', - 'set_visibility' => 'Rendre visible la\le :name pour les clients.', + 'set_visibility' => 'Rendre visible :name pour les clients.', 'set_global_visibility' => 'Visibilité de la page pour les clients.', 'log_out' => 'Se déconnecter', 'browser_platform' => ':browser sur :platform', diff --git a/packages/admin/resources/views/components/empty-state.blade.php b/packages/admin/resources/views/components/empty-state.blade.php index 1e25ed383..19c840a14 100755 --- a/packages/admin/resources/views/components/empty-state.blade.php +++ b/packages/admin/resources/views/components/empty-state.blade.php @@ -4,9 +4,10 @@ 'button' => false, 'permission' => false, 'url' => false, + 'panel' => null, ]) -