daisyui 2.0.0 → 2.0.1

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: fe7d742ea5321a80e5f6689bd3df51ad59aae0a5ee9ee0617f8f237a654ebad4
4
- data.tar.gz: 9ff82a86a33f3d01165f59b3b94e9e6867bd43c43ab190c0bfbc7f14fa49e546
3
+ metadata.gz: d30cb25a7b084c35be2de937df6e73bb3700a2f5acfb4c985c5e7cb4824cdda0
4
+ data.tar.gz: e5527dde4ac27befb95a4073a1facbfe9a19a1552390d0236ba40a7495efbb02
5
5
  SHA512:
6
- metadata.gz: fe53957f3b594373cfdbd7865a3e143f5526e679c9dcbb8d8da1eef10a95a0cccf0d55dcf5c33889ad268ed382b3dd21f56b8b74e28f2adc289697e8cf10fedc
7
- data.tar.gz: 3bee4c79945a177706b8f30231b5f4f0a2aab66aa3dd4031842a9d3e603cc09621ebefce8a7cd79062f5e9a9f0bc1823a1701ba10953c687a3d5c03a0b36bd10
6
+ metadata.gz: 4db77994d5bf816005c30bcac72f43b9e0a699b47d5c58963fca047d63a0d51618df468db7e07e09961efffbdb7f8656da5490765180c59424534f87953b74ff
7
+ data.tar.gz: 27c490791fa5006f8670df8f69159c978bad805a93a30dd65740ca6ab6202b76cd92af02ce03599eb1398a9465e66c744172f30de6ad6ff429265935bf2f103e
data/CHANGELOG.md CHANGED
@@ -75,6 +75,9 @@ wins. `Button(:sm, class: "btn-lg")` renders `btn btn-lg` (1.x rendered
75
75
  ### Fixed
76
76
 
77
77
  - Popover tooltips no longer clip arrows that extend beyond the tooltip card.
78
+ - Button renders the `disabled` attribute on `button`/`input` elements when given
79
+ `:disabled` or `disabled: true`, so a disabled submit button no longer submits
80
+ its form from the keyboard (#52).
78
81
 
79
82
  ## [0.1.0] - 2024-08-02
80
83
 
@@ -6,6 +6,8 @@ module DaisyUI
6
6
  class Button < Base
7
7
  self.component_class = :btn
8
8
 
9
+ FORM_CONTROLS = %i[button input].freeze
10
+
9
11
  def initialize(*, as: :button, modal: nil, **)
10
12
  super(*, as:, **)
11
13
  @modal = modal
@@ -29,6 +31,16 @@ module DaisyUI
29
31
 
30
32
  attr_reader :modal
31
33
 
34
+ # `disabled` is consumed as a modifier (btn-disabled), which only blocks
35
+ # pointer events. Form controls also need the attribute so keyboard
36
+ # activation and implicit form submission are blocked too.
37
+ def attributes
38
+ attrs = super
39
+ return attrs unless FORM_CONTROLS.include?(as.to_sym) && modifiers.include?(:disabled)
40
+
41
+ attrs.merge(disabled: true)
42
+ end
43
+
32
44
  register_modifiers(
33
45
  style: {
34
46
  # "sm:btn-ghost"
@@ -3,5 +3,5 @@
3
3
  module DaisyUI
4
4
  # This timestamp is automatically updated when releasing a new version
5
5
  # Format: YYYY-MM-DD HH:MM:SS UTC
6
- UPDATED_AT = "2026-09-30 16:38:52 UTC"
6
+ UPDATED_AT = "2026-10-09 17:02:17 UTC"
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DaisyUI
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daisyui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson