coveragebook_components 0.17.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2af0604e33ee8ea690a93abf997f126ecaeb23528b3bf682fadc79eed353df2
4
- data.tar.gz: 6d055a247adaa8f2a794d3a6864d38a23fd2059d0c01d08ea183e751c06c440c
3
+ metadata.gz: 1fc0953881f78a258a61ca7b0f24ea84133a1f63046af384ea9d081cbc2db6d8
4
+ data.tar.gz: dfc32ff156d2b19aa5271e42a44c540e0337a9c1b0674d470e88e8b4c4e74845
5
5
  SHA512:
6
- metadata.gz: eb41e2bfb905a693fb9a9ac36019d09699001552fa9f6aa2ce0df0b7f8281ebcc159f15cf41a58c059e1f83fe6907c085265cddee43dc893d8d475e34b146092
7
- data.tar.gz: 9c229a0bf2926994c7bf5699485365d74956e3fc23cb0df41842b11ca5e27df24f3603c9339a86771316acdf94b185e83250f9e2b5c651771f0fcb130c0f7f24
6
+ metadata.gz: e4730eeebb41cd89b8bd77645fc50779339b83c3157bab022990d3bfcfcfae2a21b217d7f6d03f011830a6491623f5cfd8fe2529d4acf4625d878551ecf0a061
7
+ data.tar.gz: 3c0929b433a8eab7860b52107965f3cb7f5b481603e6d903cec8c2bf0554e2ee32f26cd0ac695a8074fceb6037682b413b89ab90957c8f28b2756e6be9785062
@@ -4549,56 +4549,72 @@ select{
4549
4549
 
4550
4550
  [data-coco][data-component="modal-dialog"]{
4551
4551
  width: 100%;
4552
- border-radius: 0.75rem
4552
+ border-radius: 2rem;
4553
+ --tw-bg-opacity: 1;
4554
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity))
4553
4555
  }
4554
4556
 
4555
4557
  .modal-frame [data-coco][data-component="modal-dialog"]{
4556
- --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
4557
- --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
4558
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
4559
- max-width: 42rem /* temp until sizes added */
4558
+ --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
4559
+ --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);
4560
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
4560
4561
  }
4561
4562
 
4563
+ .modal-frame [data-coco][data-component="modal-dialog"][data-size="sm"] {
4564
+ max-width: 480px;
4565
+ }
4566
+
4567
+ .modal-frame [data-coco][data-component="modal-dialog"][data-size="md"] {
4568
+ max-width: 520px;
4569
+ }
4570
+
4571
+ .modal-frame [data-coco][data-component="modal-dialog"][data-size="lg"] {
4572
+ max-width: 640px;
4573
+ }
4574
+
4562
4575
  [data-coco][data-component="modal-dialog"] .modal-dialog-header{
4563
- position: relative;
4564
- display: flex;
4565
- align-items: center;
4566
- height: 3.5rem;
4567
- border-top-left-radius: 0.75rem;
4568
- border-top-right-radius: 0.75rem;
4569
- border-bottom-width: 1px;
4570
- --tw-border-opacity: 1;
4571
- border-color: rgb(209 213 219 / var(--tw-border-opacity));
4576
+ border-top-left-radius: 2rem;
4577
+ border-top-right-radius: 2rem;
4572
4578
  --tw-bg-opacity: 1;
4573
4579
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
4574
4580
  padding-left: 1rem;
4575
- padding-right: 1rem
4581
+ padding-right: 1rem;
4582
+ padding-top: 1rem;
4583
+ padding-bottom: 1rem
4576
4584
  }
4577
4585
 
4578
4586
  @media (min-width: 576px){
4579
4587
 
4580
4588
  [data-coco][data-component="modal-dialog"] .modal-dialog-header{
4581
- height: 4rem;
4582
- padding-left: 2rem;
4583
- padding-right: 2rem
4589
+ padding-left: 2.5rem;
4590
+ padding-right: 2.5rem;
4591
+ padding-top: 1.5rem;
4592
+ padding-bottom: 1.5rem
4584
4593
  }
4585
4594
  }
4586
4595
 
4596
+ [data-coco][data-component="modal-dialog"] .modal-dialog-header-container{
4597
+ position: relative;
4598
+ display: flex;
4599
+ height: 2.75rem;
4600
+ align-items: center
4601
+ }
4602
+
4587
4603
  [data-coco][data-component="modal-dialog"] .modal-dialog-title{
4588
4604
  width: 100%;
4589
4605
  overflow: hidden;
4590
4606
  text-overflow: ellipsis;
4591
4607
  white-space: nowrap;
4592
4608
  padding-right: 1.5rem;
4593
- font-size: 1.125rem;
4594
- line-height: 1.75rem;
4609
+ font-size: 20px;
4610
+ line-height: 24px;
4595
4611
  font-weight: 700
4596
4612
  }
4597
4613
 
4598
4614
  [data-coco][data-component="modal-dialog"] .modal-dialog-close{
4599
4615
  position: absolute;
4600
4616
  top: 50%;
4601
- right: 0.25rem;
4617
+ right: -0.25rem;
4602
4618
  display: block;
4603
4619
  flex: none;
4604
4620
  --tw-translate-y: -50%;
@@ -4609,18 +4625,24 @@ select{
4609
4625
  @media (min-width: 576px){
4610
4626
 
4611
4627
  [data-coco][data-component="modal-dialog"] .modal-dialog-close{
4612
- right: 0.75rem
4628
+ right: -0.5rem
4613
4629
  }
4614
4630
  }
4615
4631
 
4616
4632
  [data-coco][data-component="modal-dialog"] .modal-dialog-close{
4633
+ border-radius: 9999px;
4617
4634
  --tw-text-opacity: 1;
4618
- color: rgb(156 163 175 / var(--tw-text-opacity))
4635
+ color: rgb(17 24 39 / var(--tw-text-opacity));
4636
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
4637
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
4638
+ transition-duration: 150ms
4619
4639
  }
4620
4640
 
4621
4641
  [data-coco][data-component="modal-dialog"] .modal-dialog-close:hover{
4642
+ --tw-bg-opacity: 1;
4643
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity));
4622
4644
  --tw-text-opacity: 1;
4623
- color: rgb(31 41 55 / var(--tw-text-opacity))
4645
+ color: rgb(17 24 39 / var(--tw-text-opacity))
4624
4646
  }
4625
4647
 
4626
4648
  [data-coco][data-component="modal-dialog"] .modal-dialog-close:focus{
@@ -4631,23 +4653,37 @@ select{
4631
4653
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)
4632
4654
  }
4633
4655
 
4656
+ [data-coco][data-component="modal-dialog"] .modal-dialog-notice [data-component="notice"]{
4657
+ margin-bottom: 1rem;
4658
+ padding-left: 1rem;
4659
+ padding-right: 1rem
4660
+ }
4661
+
4662
+ @media (min-width: 576px){
4663
+
4664
+ [data-coco][data-component="modal-dialog"] .modal-dialog-notice [data-component="notice"]{
4665
+ margin-bottom: 1.5rem;
4666
+ padding-left: 2.5rem;
4667
+ padding-right: 2.5rem
4668
+ }
4669
+ }
4670
+
4634
4671
  [data-coco][data-component="modal-dialog"] .modal-dialog-content{
4635
- border-radius: 0.75rem;
4672
+ border-bottom-right-radius: 2rem;
4673
+ border-bottom-left-radius: 2rem;
4636
4674
  --tw-bg-opacity: 1;
4637
- background-color: rgb(243 244 246 / var(--tw-bg-opacity));
4675
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
4638
4676
  padding-left: 1rem;
4639
4677
  padding-right: 1rem;
4640
- padding-top: 1rem;
4641
- padding-bottom: 1rem
4678
+ padding-bottom: 1.5rem
4642
4679
  }
4643
4680
 
4644
4681
  @media (min-width: 576px){
4645
4682
 
4646
4683
  [data-coco][data-component="modal-dialog"] .modal-dialog-content{
4647
- padding-left: 2rem;
4648
- padding-right: 2rem;
4649
- padding-top: 1.5rem;
4650
- padding-bottom: 1.5rem
4684
+ padding-left: 2.5rem;
4685
+ padding-right: 2.5rem;
4686
+ padding-bottom: 2rem
4651
4687
  }
4652
4688
  }
4653
4689
 
@@ -15415,7 +15415,7 @@ var alpine_default = import_alpinejs.default;
15415
15415
  // ../../../package.json
15416
15416
  var package_default = {
15417
15417
  name: "coveragebook-components",
15418
- version: "0.17.2",
15418
+ version: "0.17.3",
15419
15419
  repository: "git@github.com:coveragebook/coco.git",
15420
15420
  license: "NO LICENSE",
15421
15421
  author: "Mark Perkins <mark@coveragebook.com>",
@@ -35,6 +35,11 @@ module Coco
35
35
  unless tag_attr?(:id)
36
36
  set_tag_attr(:id, "alert-#{rand(1000)}")
37
37
  end
38
+ with_title { @title } unless title?
39
+ end
40
+
41
+ def initialize(title: nil, **kwargs)
42
+ @title = title
38
43
  end
39
44
 
40
45
  def dismissable?
@@ -14,5 +14,13 @@ module Coco
14
14
  alert.send(:"with_#{slot_name}", *args, **kwargs, &block)
15
15
  end
16
16
  end
17
+
18
+ before_render do
19
+ with_title { @title } unless title?
20
+ end
21
+
22
+ def initialize(title: nil, **kwargs)
23
+ @title = title
24
+ end
17
25
  end
18
26
  end
@@ -1,28 +1,46 @@
1
1
  @layer components {
2
2
  [data-coco][data-component="modal-dialog"] {
3
- @apply rounded-xl w-full;
3
+ @apply rounded-[2rem] w-full bg-background-light-1;
4
4
 
5
5
  .modal-frame & {
6
- @apply shadow-2xl;
7
- @apply max-w-2xl; /* temp until sizes added */
6
+ @apply shadow-xl;
7
+
8
+ &[data-size="sm"] {
9
+ max-width: 480px;
10
+ }
11
+
12
+ &[data-size="md"] {
13
+ max-width: 520px;
14
+ }
15
+
16
+ &[data-size="lg"] {
17
+ max-width: 640px;
18
+ }
8
19
  }
9
20
 
10
21
  .modal-dialog-header {
11
- @apply relative flex items-center;
12
- @apply px-4 sm:px-8 h-14 sm:h-16 border-b border-coco-gray-300 rounded-t-xl bg-white;
22
+ @apply px-4 sm:px-10 py-4 sm:py-6 rounded-t-[2rem] bg-background-light-1;
23
+ }
24
+
25
+ .modal-dialog-header-container {
26
+ @apply relative flex items-center h-11;
13
27
  }
14
28
 
15
29
  .modal-dialog-title {
16
- @apply text-lg pr-6 w-full font-bold truncate;
30
+ @apply text-heading-5 pr-6 w-full font-bold truncate;
17
31
  }
18
32
 
19
33
  .modal-dialog-close {
20
- @apply flex-none block p-2 absolute top-1/2 right-1 sm:right-3 -translate-y-1/2;
21
- @apply focus:ring-0 focus:outline-none text-content-dark-muted hover:text-content-dark-2;
34
+ @apply flex-none block p-2 absolute top-1/2 -right-1 sm:-right-2 -translate-y-1/2;
35
+ @apply focus:ring-0 focus:outline-none text-content-dark-1 hover:text-content-dark-1 rounded-full hover:bg-coco-gray-100 transition-colors;
36
+ }
37
+
38
+ .modal-dialog-notice [data-component="notice"] {
39
+ @apply px-4 sm:px-10 mb-4 sm:mb-6;
22
40
  }
23
41
 
24
42
  .modal-dialog-content {
25
- @apply px-4 sm:px-8 py-4 sm:py-6 rounded-xl bg-background-light-3;
43
+ @apply px-4 sm:px-10 pb-6 sm:pb-8 rounded-b-[2rem] bg-background-light-1;
26
44
  }
27
45
 
28
46
  .modal-dialog-header + .modal-dialog-content {
@@ -1,18 +1,27 @@
1
1
  <%= render component_tag(x: {data: x_data("modalDialog")}) do %>
2
2
  <% if header? %>
3
3
  <header class="modal-dialog-header">
4
- <% if title? %>
5
- <h4 class="modal-dialog-title" data-role="title">
6
- <%= title %>
7
- </h4>
8
- <% end %>
9
- <% if dismissable? %>
10
- <button type="button" class="modal-dialog-close" data-role="close" @click="close">
11
- <%= coco_icon(:x, size: :md) %>
12
- </button>
13
- <% end %>
4
+ <div class="modal-dialog-header-container">
5
+ <% if title? %>
6
+ <h4 class="modal-dialog-title" data-role="title">
7
+ <%= title %>
8
+ </h4>
9
+ <% end %>
10
+ <% if dismissable? %>
11
+ <button type="button" class="modal-dialog-close" data-role="close" @click="close">
12
+ <%= coco_icon(:x, size: :md) %>
13
+ </button>
14
+ <% end %>
15
+ </div>
14
16
  </header>
15
17
  <% end %>
18
+
19
+ <% if notice? %>
20
+ <div class="modal-dialog-notice">
21
+ <%= notice %>
22
+ </div>
23
+ <% end %>
24
+
16
25
  <div class="modal-dialog-content">
17
26
  <%= content %>
18
27
  </div>
@@ -3,6 +3,11 @@ module Coco
3
3
  include Concerns::AcceptsOptions
4
4
 
5
5
  accepts_option :dismissable, from: [true, false], default: true
6
+ accepts_option :size, from: [:sm, :md, :lg], default: :md
7
+
8
+ renders_one :notice, ->(**kwargs) do
9
+ Coco::Notice.new(**kwargs, dismissable: false)
10
+ end
6
11
 
7
12
  renders_one :title
8
13
 
@@ -168,9 +168,9 @@ module Coco
168
168
  render(Coco::Modal.new(name: name, **), &)
169
169
  end
170
170
 
171
- def coco_modal_dialog(name = "default", **, &block)
171
+ def coco_modal_dialog(name = "default", size: :md, **, &block)
172
172
  render(Coco::Modal.new(name: name, **)) do |modal|
173
- modal.with_container_dialog(&block)
173
+ modal.with_container_dialog(size: size, &block)
174
174
  end
175
175
  end
176
176
 
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.17.2"
2
+ VERSION = "0.17.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveragebook_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.2
4
+ version: 0.17.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-21 00:00:00.000000000 Z
11
+ date: 2024-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails