faw_toast 1.2.1 → 1.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b51a2a9ed8f15f940950a4edfaabb8268ae8f422966a085ef8d49f6780d19d5e
4
- data.tar.gz: 44371edb70e43029d9e1004bd4f3c269a7048f5178a81e17f598d8269346bf24
3
+ metadata.gz: 97af3db39ecce4321a32c7d9665e315efdf96ba083675608ec3094d97eb202d2
4
+ data.tar.gz: 6cbe421d337750c6ab154725650b236ac2ac15ec5b118dc1201f1b9b67c1ecb1
5
5
  SHA512:
6
- metadata.gz: e28dd393e86c36a71baeefbb41ed25753acd5f79886b08480bae06798cc3c0f994aa94cd462ff1305948b4b4cf6afa619f92d4e9e4e6dc78ce18de098d35f6c7
7
- data.tar.gz: a6446d7cfeaf3f4027e9914df062570d95db2ff36f1fd1d32c52ed1ade48a9020ec6923b60d3b56068f415c117a66e4f3f2cb8e028547ce352bbf5c3670f0743
6
+ metadata.gz: e509fb2b7809f80aed827af9fe82c8555c0fc63d8513d54723d805ac0ab6fe2c4c8f2f5ba3900eb5a31f35f65be99008a78ecbf54c7fa0e8153f5ebc8652ac8e
7
+ data.tar.gz: '007483292ba291241a3825cf79e6e8c5a3d9be9c93ac3cef567d970b3030d2f30d0d58911da5a4cea172d05fc220144a7dea4eaa2dbf7ae3043e42f5427f7a91'
data/README.md CHANGED
@@ -9,7 +9,7 @@ A simple, configurable toast notification system for Rails applications. FawToas
9
9
  - CSS-only animations
10
10
  - Configurable toast duration and position
11
11
  - Customizable CSS classes for different flash types
12
- - Support for standard flash types plus additional success and info types
12
+ - Support for standard flash types plus additional success, info and danger types
13
13
  - Simple to install and use
14
14
 
15
15
  ## Installation
@@ -88,6 +88,7 @@ Turbo::StreamsChannel.broadcast_append_to(
88
88
  FawToast supports the following flash types out of the box:
89
89
  - `:success` - Green border
90
90
  - `:alert` - Red border
91
+ - `:danger` - Red border (same as alert, but provides semantic difference)
91
92
  - `:info` - Sky blue border
92
93
  - `:notice` - Sky blue border
93
94
  - Any other type will use the default indigo border
@@ -107,11 +108,12 @@ FawToast.configure do |config|
107
108
 
108
109
  # CSS classes for different flash types
109
110
  config.css_classes = {
110
- success: 'border-l-10 border-green-500',
111
- alert: 'border-l-10 border-red-500',
112
- info: 'border-l-10 border-sky-600',
113
- notice: 'border-l-10 border-sky-600',
114
- default: 'border-l-10 border-indigo-500'
111
+ success: 'faw-toast-border-l-10 faw-toast-border-green',
112
+ alert: 'faw-toast-border-l-10 faw-toast-border-red',
113
+ danger: 'faw-toast-border-l-10 faw-toast-border-red',
114
+ info: 'faw-toast-border-l-10 faw-toast-border-sky',
115
+ notice: 'faw-toast-border-l-10 faw-toast-border-sky',
116
+ default: 'faw-toast-border-l-10 faw-toast-border-indigo'
115
117
  }
116
118
  end
117
119
  ```
@@ -41,13 +41,13 @@
41
41
  .faw-toast.faw-toast-border-l-10 {
42
42
  border-left-width: 10px;
43
43
  border-left-style: solid; }
44
- .faw-toast.faw-toast-border-green-500 {
44
+ .faw-toast.faw-toast-border-green {
45
45
  border-left-color: #10b981; }
46
- .faw-toast.faw-toast-border-red-500 {
46
+ .faw-toast.faw-toast-border-red {
47
47
  border-left-color: #ef4444; }
48
- .faw-toast.faw-toast-border-sky-600 {
48
+ .faw-toast.faw-toast-border-sky {
49
49
  border-left-color: #0284c7; }
50
- .faw-toast.faw-toast-border-indigo-500 {
50
+ .faw-toast.faw-toast-border-indigo {
51
51
  border-left-color: #6366f1; }
52
52
  .faw-toast .faw-toast-content {
53
53
  flex: 1; }
@@ -57,19 +57,19 @@
57
57
  border-left-style: solid;
58
58
  }
59
59
 
60
- &.faw-toast-border-green-500 {
60
+ &.faw-toast-border-green {
61
61
  border-left-color: #10b981;
62
62
  }
63
63
 
64
- &.faw-toast-border-red-500 {
64
+ &.faw-toast-border-red {
65
65
  border-left-color: #ef4444;
66
66
  }
67
67
 
68
- &.faw-toast-border-sky-600 {
68
+ &.faw-toast-border-sky {
69
69
  border-left-color: #0284c7;
70
70
  }
71
71
 
72
- &.faw-toast-border-indigo-500 {
72
+ &.faw-toast-border-indigo {
73
73
  border-left-color: #6366f1;
74
74
  }
75
75
 
@@ -8,11 +8,12 @@ module FawToast
8
8
  @duration_seconds = "7s"
9
9
  @position = 'top-right'
10
10
  @css_classes = {
11
- success: 'faw-toast-border-l-10 faw-toast-border-green-500',
12
- alert: 'faw-toast-border-l-10 faw-toast-border-red-500',
13
- info: 'faw-toast-border-l-10 faw-toast-border-sky-600',
14
- notice: 'faw-toast-border-l-10 faw-toast-border-sky-600',
15
- default: 'faw-toast-border-l-10 faw-toast-border-indigo-500'
11
+ success: 'faw-toast-border-l-10 faw-toast-border-green',
12
+ alert: 'faw-toast-border-l-10 faw-toast-border-red',
13
+ danger: 'faw-toast-border-l-10 faw-toast-border-red',
14
+ info: 'faw-toast-border-l-10 faw-toast-border-sky',
15
+ notice: 'faw-toast-border-l-10 faw-toast-border-sky',
16
+ default: 'faw-toast-border-l-10 faw-toast-border-indigo'
16
17
  }
17
18
  end
18
19
  end
@@ -15,7 +15,7 @@ module FawToast
15
15
  end
16
16
 
17
17
  initializer "faw_toast.flash_types" do
18
- ActionController::Base.add_flash_types :success, :info
18
+ ActionController::Base.add_flash_types :success, :info, :danger
19
19
  end
20
20
  end
21
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FawToast
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
@@ -10,10 +10,10 @@ FawToast.configure do |config|
10
10
 
11
11
  # CSS classes for different flash types
12
12
  # config.css_classes = {
13
- # success: 'faw-toast-border-l-10 faw-toast-border-green-500',
14
- # alert: 'faw-toast-border-l-10 faw-toast-border-red-500',
15
- # info: 'faw-toast-border-l-10 faw-toast-border-sky-600',
16
- # notice: 'faw-toast-border-l-10 faw-toast-border-sky-600',
17
- # default: 'faw-toast-border-l-10 faw-toast-border-indigo-500'
13
+ # success: 'faw-toast-border-l-10 faw-toast-border-green',
14
+ # alert: 'faw-toast-border-l-10 faw-toast-border-red',
15
+ # info: 'faw-toast-border-l-10 faw-toast-border-sky',
16
+ # notice: 'faw-toast-border-l-10 faw-toast-border-sky',
17
+ # default: 'faw-toast-border-l-10 faw-toast-border-indigo'
18
18
  # }
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faw_toast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexwebgr