Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
e173aa7
chore: remove unused files
digitlimit Mar 7, 2025
e2a94dc
chore: remove comments
digitlimit Mar 7, 2025
13c7392
chore: remove comment
digitlimit Mar 7, 2025
5554c47
load modal on mount
digitlimit Mar 7, 2025
bbbc95c
feat: set default tag
digitlimit Mar 7, 2025
9eeee20
feat: set default tag
digitlimit Mar 7, 2025
e0da077
feat: fix config
digitlimit Mar 8, 2025
4e03c36
feat: add alert retrieval nethods
digitlimit Mar 8, 2025
f384be3
feat: add alert retrieval nethods
digitlimit Mar 8, 2025
34c4b51
feat: add svg icons
digitlimit Mar 9, 2025
4b8a14e
feat: add alert icons
digitlimit Mar 9, 2025
2842c5e
feat: add toastr
digitlimit Mar 9, 2025
8b9b4f5
feat: rename notify to toastr
digitlimit Mar 9, 2025
8acb1a9
chore: clean up helpers
digitlimit Mar 9, 2025
f60b9ac
chore: clean up helpers
digitlimit Mar 9, 2025
22b9eff
feat: add notify
digitlimit Mar 9, 2025
d9faad6
feat: add notify
digitlimit Mar 9, 2025
9f2ebee
feat: add notify
digitlimit Mar 9, 2025
914d55d
feat: add notify helper
digitlimit Mar 9, 2025
8aa45cf
feat: add notify helper
digitlimit Mar 9, 2025
892d72f
fix: update notify
digitlimit Mar 9, 2025
61f3165
fix: update notify
digitlimit Mar 9, 2025
ce8086d
fix: update notify class
digitlimit Mar 10, 2025
ae1d02f
feat: add circle and non circled icons
digitlimit Mar 10, 2025
dc06b9a
feat: improve notify
digitlimit Mar 10, 2025
b44f6e3
feat: rebuild css
digitlimit Mar 10, 2025
fe21f24
feat: rebuild css
digitlimit Mar 10, 2025
b469c5f
feat: add scss for notify
digitlimit Mar 11, 2025
3e5ea02
feat: add modal button classes in the view
digitlimit Mar 11, 2025
faf1bd9
feat: add modal button classes in the view
digitlimit Mar 11, 2025
bb2bfe4
feat: remove button attributes from config
digitlimit Mar 11, 2025
5245d56
fix: add progress-bar animation
digitlimit Mar 11, 2025
01a5997
fix: add alert.css
digitlimit Mar 11, 2025
fe3f199
fix: add buttons class
digitlimit Mar 11, 2025
7b625ad
fix: add button @click
digitlimit Mar 12, 2025
d63494f
fix: add button @click
digitlimit Mar 12, 2025
b1cce3c
fix: use variable
digitlimit Mar 12, 2025
8b6fc17
feat: add position classes to notify
digitlimit Mar 12, 2025
85c67f5
feat: add position classes to notify
digitlimit Mar 12, 2025
af7ce3b
feat: add position classes to notify
digitlimit Mar 12, 2025
609b401
feat: add position classes to notify
digitlimit Mar 12, 2025
6299cce
feat: add runner shell
digitlimit Mar 15, 2025
e39753f
feat: add runner shell
digitlimit Mar 16, 2025
0ffd3d4
feat: support multiple alerts
digitlimit Mar 17, 2025
db5be56
feat: support multiple alerts
digitlimit Mar 19, 2025
c069b32
feat: support multiple alerts
digitlimit Mar 22, 2025
396dae2
fix: remove inline tailwind
digitlimit Mar 22, 2025
a85c5d5
fix: remove div wrapper on message
digitlimit Mar 22, 2025
bad8c4f
fix: buttons position
digitlimit Mar 22, 2025
6c24bd5
feat: add cancel button
digitlimit Mar 22, 2025
e590bc1
fix: cancel button
digitlimit Mar 22, 2025
c42670e
chore: remove console log
digitlimit Mar 22, 2025
6a8aa08
fix: reposition button
digitlimit Mar 22, 2025
0f48c34
fix: custom buttons
digitlimit Mar 22, 2025
ef9bbf2
feat: add ability to display multiple messages
digitlimit Mar 22, 2025
8482623
fix: remove duplicate messages
digitlimit Mar 22, 2025
230f54f
feat: implement multiple toastr and modal
digitlimit Mar 22, 2025
c43a9df
feat: improve toastr
digitlimit Mar 22, 2025
333508a
feat: implement multi modals
digitlimit Mar 22, 2025
6060de1
feat: add tap to button
digitlimit Mar 22, 2025
5d0f7b4
feat: remove flashes from helper
digitlimit Mar 23, 2025
619b3e8
fix: remove multiple unwanted alerts
digitlimit Mar 23, 2025
83953ac
feat: add timeout to modal and message
digitlimit Mar 23, 2025
6a2338a
feat: add timeout to modal and message
digitlimit Mar 23, 2025
d6066af
feat: add progress cicle around the close button
digitlimit Mar 23, 2025
fe495bb
feat: add icons test
digitlimit Mar 23, 2025
b5d9854
feat: add icons test
digitlimit Mar 23, 2025
716f0e6
chore: fix style
digitlimit Mar 23, 2025
94c6a67
chore: fix style
digitlimit Mar 23, 2025
737381a
fix: resolve issue with type
digitlimit Mar 23, 2025
8cc2c99
feat: improve alert
digitlimit Mar 25, 2025
6a522b3
fix: resolve message failure to display
digitlimit Mar 27, 2025
3358840
feat: improve alerts
digitlimit Mar 29, 2025
605a99c
feat: improve alerts
digitlimit Mar 29, 2025
7f5b8d6
fix: cancel button
digitlimit Mar 30, 2025
a5a85d5
fix: cancel button
digitlimit Mar 30, 2025
e2c2412
fix: cancel button
digitlimit Mar 30, 2025
7f548ba
fix: fix button tests
digitlimit Mar 30, 2025
1c69d8e
fix: fix message tests
digitlimit Mar 30, 2025
cf673d6
fix: fix modal fill
digitlimit Apr 1, 2025
792783f
fix: fix modal fill
digitlimit Apr 1, 2025
e9630ed
feat: add notify test
digitlimit Apr 1, 2025
dbaa11d
feat: add toastr test
digitlimit Apr 1, 2025
e024a26
fix: resolve tests
digitlimit Apr 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 14 additions & 79 deletions config/alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
'tailwind' => Themes\Tailwind\Tailwind::class,
],

'icons' => [
'success' => \Digitlimit\Alert\Icons\Success::class,
'error' => \Digitlimit\Alert\Icons\Error::class,
'warning' => \Digitlimit\Alert\Icons\Warning::class,
'info' => \Digitlimit\Alert\Icons\Info::class,
],

/*
|--------------------------------------------------------------------------
| Themes Settings
Expand Down Expand Up @@ -56,12 +63,19 @@
'component' => Themes\Tailwind\Components\Modal::class,
],

'toastr' => [
'view' => 'alert-toastr',
'alert' => Types\Toastr::class,
'component' => Themes\Tailwind\Components\Toastr::class,
],

'notify' => [
'view' => 'alert-notify',
'alert' => Types\Notify::class,
'component' => Themes\Tailwind\Components\Notify::class,
],
],

'attributes' => [
'buttons' => [
'action' => [
Expand All @@ -84,84 +98,5 @@
],
],
],
'classes' => [
'buttons' => [
'primary' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-neutral-900 focus:ring-offset-2 bg-neutral-950 hover:bg-neutral-900',
'secondary' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium transition-colors border rounded-md focus:outline-none focus:ring-2 focus:ring-neutral-100 focus:ring-offset-2',

'success' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-green-700 focus:ring-offset-2 bg-green-600 hover:bg-green-700',
'error' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-red-700 focus:ring-offset-2 bg-red-600 hover:bg-red-700',
'warning' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-black transition-colors border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-600 focus:ring-offset-2 bg-yellow-400 hover:bg-yellow-500',
'info' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-blue-700 focus:ring-offset-2 bg-blue-600 hover:bg-blue-700',
'light' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-black transition-colors border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 bg-white hover:bg-gray-100',
'dark' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 bg-gray-800 hover:bg-gray-900',
'link' => 'inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-blue-600 transition-colors rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 hover:underline',
],

'field' => [
'levels' => [
'success' => [
'container' => 'p-3 text-green-800',
],
'error' => [
'container' => 'p-3 text-red-800',
],
'warning' => [
'container' => 'p-3 text-yellow-800',
],
'info' => [
'container' => 'p-3 text-blue-800',
],
],
],

'notify' => [
'levels' => [
'success' => [
'container' => 'bg-gray-900 bg-gradient-to-r text-white rounded-t mb-3 shadow-lg flex items-center from-green-400 to-green-500',
],
'error' => [
'container' => 'bg-gray-900 bg-gradient-to-r text-white rounded-t mb-3 shadow-lg flex items-center from-red-400 to-pink-500',
],
'warning' => [
'container' => 'bg-gray-900 bg-gradient-to-r text-white rounded-t mb-3 shadow-lg flex items-center from-yellow-400 to-yellow-500',
],
'info' => [
'container' => 'bg-gray-900 bg-gradient-to-r text-white rounded-t mb-3 shadow-lg flex items-center from-blue-400 to-blue-500',
],
],

'position' => [
'top-right' => 'top-0 right-0',
'top-left' => 'top-0 left-0',
'bottom-right' => 'bottom-0 right-0',
'bottom-left' => 'bottom-0 left-0',
'top-center' => 'top-0 left-1/2 transform -translate-x-1/2',
'bottom-center' => 'bottom-0 left-1/2 transform -translate-x-1/2',
'center' => 'top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2',
],
],

'message' => [
'levels' => [
'success' => [
'container' => 'flex items-center p-4 mb-4 text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400',
'close' => 'ms-auto -mx-1.5 -my-1.5 bg-blue-50 text-blue-500 rounded-lg focus:ring-2 focus:ring-blue-400 p-1.5 hover:bg-blue-200 inline-flex items-center justify-center h-8 w-8 dark:bg-gray-800 dark:text-blue-400 dark:hover:bg-gray-700',
],
'error' => [
'container' => 'flex items-center p-4 mb-4 text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400',
'close' => 'ms-auto -mx-1.5 -my-1.5 bg-red-50 text-red-500 rounded-lg focus:ring-2 focus:ring-red-400 p-1.5 hover:bg-red-200 inline-flex items-center justify-center h-8 w-8 dark:bg-gray-800 dark:text-red-400 dark:hover:bg-gray-700',
],
'warning' => [
'container' => 'flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300',
'close' => 'ms-auto -mx-1.5 -my-1.5 bg-yellow-50 text-yellow-500 rounded-lg focus:ring-2 focus:ring-yellow-400 p-1.5 hover:bg-yellow-200 inline-flex items-center justify-center h-8 w-8 dark:bg-gray-800 dark:text-yellow-400 dark:hover:bg-gray-700',
],
'info' => [
'container' => 'flex items-center p-4 mb-4 text-blue-800 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400',
'close' => 'ms-auto -mx-1.5 -my-1.5 bg-blue-50 text-blue-500 rounded-lg focus:ring-2 focus:ring-blue-400 p-1.5 hover:bg-blue-200 inline-flex items-center justify-center h-8 w-8 dark:bg-gray-800 dark:text-blue-400 dark:hover:bg-gray-700',
],
],
],
],
],
];
133 changes: 109 additions & 24 deletions resources/css/themes/tailwind/alert.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,52 @@
@apply inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium text-blue-600 transition-colors rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 hover:underline;
}

.alert-notify-position {
.alert-toastr-position {
@apply fixed px-2 mt-3 overflow-x-hidden z-50;
}

.alert-notify-position.top-right {
.alert-toastr-position.top-right {
@apply top-0 right-0;
}

.alert-notify-position.top-left {
.alert-toastr-position.top-left {
@apply top-0 left-0;
}

.alert-notify-position.bottom-right {
.alert-toastr-position.bottom-right {
@apply bottom-0 right-0;
}

.alert-notify-position.bottom-left {
.alert-toastr-position.bottom-left {
@apply bottom-0 left-0;
}

.alert-notify-position.top-center {
.alert-toastr-position.top-center {
@apply top-0 left-1/2 transform -translate-x-1/2;
}

.alert-notify-position.bottom-center {
.alert-toastr-position.bottom-center {
@apply bottom-0 left-1/2 transform -translate-x-1/2;
}

.alert-notify-position.center {
.alert-toastr-position.center {
@apply top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2;
}

.alert-field.success {
@apply p-3 text-green-800;
@apply pt-2 text-green-800;
}

.alert-field.error {
@apply p-3 text-red-800;
@apply pt-2 text-red-800;
}

.alert-field.warning {
@apply p-3 text-yellow-800;
@apply pt-2 text-yellow-800;
}

.alert-field.info {
@apply p-3 text-blue-800;
@apply pt-2 text-blue-800;
}

.alert-message {
Expand Down Expand Up @@ -146,54 +146,139 @@
@apply sr-only;
}

.alert-notify {
.alert-toastr {
@apply bg-gray-900 bg-gradient-to-r text-white rounded-t mb-3 shadow-lg flex items-center;
}

.alert-notify.success {
.alert-toastr.success {
@apply from-green-400 to-green-500;
}

.alert-notify.error {
.alert-toastr.error {
@apply from-red-400 to-pink-500;
}

.alert-notify.warning {
.alert-toastr.warning {
@apply from-yellow-400 to-yellow-500;
}

.alert-notify.info {
.alert-toastr.info {
@apply from-blue-400 to-blue-500;
}

.alert-notify.top-right {
.alert-toastr.top-right {
@apply top-0 right-0;
}

.alert-notify.top-left {
.alert-toastr.top-left {
@apply top-0 left-0;
}

.alert-notify.bottom-right {
.alert-toastr.bottom-right {
@apply bottom-0 right-0;
}

.alert-notify.bottom-left {
.alert-toastr.bottom-left {
@apply bottom-0 left-0;
}

.alert-notify.top-center {
.alert-toastr.top-center {
@apply top-0 left-1/2 transform -translate-x-1/2;
}

.alert-notify.bottom-center {
.alert-toastr.bottom-center {
@apply bottom-0 left-1/2 transform -translate-x-1/2;
}

.alert-notify.center {
.alert-toastr.center {
@apply top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2;
}

@keyframes progress-bar {
from {
width: 0%;
}
to {
width: 100%;
}
}
.alert-toastr .animate-width {
animation: progress-bar 5s linear forwards;
}

.notify-container {
@apply pointer-events-none fixed bottom-0 left-1/2 z-[100] flex w-full -translate-x-1/2 flex-col items-center space-y-4 transition-all will-change-transform -translate-y-10;
}

.notify-container .notifies {
@apply relative z-50 w-full max-w-[400px];
}

.notify-container .notify {
@apply py-2 bg-gray-800 pointer-events-auto relative flex min-h-12 w-full items-center justify-between gap-4 overflow-hidden rounded-xl pl-3 pr-2 shadow-2xl;
}

.notify-container .notify.top-right {
@apply top-0 right-0;
}

.notify-container .notify.top-left {
@apply top-0 left-0;
}

.notify-container .notify.bottom-right {
@apply bottom-0 right-0;
}

.notify-container .notify.bottom-left {
@apply bottom-0 left-0;
}

.notify-container .notify.top-center {
@apply top-0 left-1/2 transform -translate-x-1/2;
}

.notify-container .notify.bottom-center {
@apply bottom-0 left-1/2 transform -translate-x-1/2;
}

.notify-container .notify.center {
@apply top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2;
}

.notify-container .notify-content {
@apply relative flex flex-1 items-center gap-3;
}

.notify-container .notify-message {
@apply text-gray-300;
}

.notify-container .notify-buttons {
@apply flex items-center gap-3;
}

.notify-container .notify-buttons .cancel-button {
@apply cursor-default relative isolate inline-flex items-center justify-center rounded-md border font-medium whitespace-nowrap focus:outline-none disabled:opacity-50 px-4 min-h-8 border-transparent bg-gray-600 text-white hover:bg-gray-500;
}

.notify-container .notify-buttons .action-button {
@apply cursor-default relative isolate inline-flex items-center justify-center rounded-md border font-medium whitespace-nowrap focus:outline-none disabled:opacity-50 px-4 min-h-8 border-transparent bg-blue-500 text-white hover:bg-blue-400;
}

@keyframes progress-bar {
from {
width: 0;
}
to {
width: 100%;
}
}
.notify-container .notify-progress {
@apply absolute inset-0 animate-width bg-gray-700;
animation: progress-bar 10s linear forwards;
}

.alert-modal {
@apply fixed top-0 left-0 z-[99] flex items-center justify-center w-screen h-screen;
}
Expand Down
8 changes: 4 additions & 4 deletions resources/css/themes/tailwind/components/field.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.alert-field.success {
@apply p-3 text-green-800;
@apply pt-2 text-green-800;
}
.alert-field.error {
@apply p-3 text-red-800;
@apply pt-2 text-red-800;
}
.alert-field.warning {
@apply p-3 text-yellow-800;
@apply pt-2 text-yellow-800;
}
.alert-field.info {
@apply p-3 text-blue-800;
@apply pt-2 text-blue-800;
}
Loading
Loading