keystone_ui 0.12.0 → 0.12.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: 1ba08014c8024c4d2be934c04bf5986fabf96067a28816c89b27a68593865878
4
- data.tar.gz: 22c8e2fe139a1cb802d7c7e694f54aa95f627f2a8eb0808f9ec65db78a5762ab
3
+ metadata.gz: 702c1e314aec36dbb95ed4f5541c4bdab916eba0e92f19a85f74ff641ed183f0
4
+ data.tar.gz: 0252fa96678cb96ab89cae69ad368cc5139ef30ea3c2f8c4ffdfe880a1e511e9
5
5
  SHA512:
6
- metadata.gz: 8115ce638bb73b100305498b251d5ce6a8d4993d82587061f74dfe24f04f5c039f5bfc33158661daf8d6e305e8c9b866c78ef70102be03e1a7da892b02170ffe
7
- data.tar.gz: 7f92473cf68ce1eda055362700d86ac278844b4825763ea7b304dad3ddc0d2a2661b1572b8808a9d5043b36fafaf3518ebb00908b04f01f09910d9c74d08ce70
6
+ metadata.gz: 9e8be46029fad363c665045bec462c689ceeec5c5b31a4cdec2de99e1a0f661506d8dcc09585d4a1457c201174de5f46ff9bd730524fba0506b0403b28bf4bff
7
+ data.tar.gz: 22301b268679a53f5c128a1ef20b921cddedf8532f279e3c8065379d72e4a5eaeb64a27f0702bd06593ee4bcd224ab57d468c6c12f6748294061ed9634991021
@@ -1,4 +1,4 @@
1
- <label class="block cursor-pointer">
1
+ <label class="inline-block cursor-pointer">
2
2
  <input type="radio" name="<%= name %>" value="<%= value %>" <%= "checked" if checked? %> class="peer sr-only">
3
3
  <span class="<%= classes %>">
4
4
  <span class="<%= label_classes %>"><%= label %></span>
@@ -3,10 +3,10 @@
3
3
  module Keystone
4
4
  module Ui
5
5
  class RadioCardComponent < ViewComponent::Base
6
- BASE_CLASSES = "block p-4 rounded-lg border-2 cursor-pointer transition"
7
- HIGHLIGHT_CLASSES = "border-surface-200 peer-checked:border-accent-500 peer-checked:bg-accent-50"
8
- LABEL_CLASSES = "block font-medium text-surface-900"
9
- HINT_CLASSES = "block mt-1 text-sm text-surface-500"
6
+ BASE_CLASSES = "inline-flex flex-col px-4 py-3 rounded-lg border-2 cursor-pointer transition"
7
+ HIGHLIGHT_CLASSES = "border-gray-200 dark:border-zinc-700 peer-checked:border-accent-500 peer-checked:bg-accent-50 dark:peer-checked:bg-zinc-800"
8
+ LABEL_CLASSES = "block font-medium text-gray-900 dark:text-gray-100"
9
+ HINT_CLASSES = "block mt-1 text-sm text-surface-500 dark:text-gray-400"
10
10
 
11
11
  attr_reader :name, :value, :label, :hint
12
12
 
@@ -14,7 +14,5 @@
14
14
  <p class="<%= value_classes %>">
15
15
  <% if link? %><a href="<%= href %>" class="<%= value_link_classes %>"><%= value %></a><% else %><%= value %><% end %><% if suffix? %><span class="<%= suffix_classes %>"> <%= suffix %></span><% end %>
16
16
  </p>
17
- <% if change? %>
18
- <p class="mt-1 text-sm font-medium <%= change_classes %>"><%= change_label %></p>
19
- <% end %>
17
+ <p class="<%= change_row_classes %>"><%= change_label %></p>
20
18
  </div>
@@ -8,6 +8,7 @@ module Keystone
8
8
  VALUE_BASE_CLASSES = "mt-1 text-3xl font-bold"
9
9
  SUFFIX_CLASSES = "text-lg text-gray-500 dark:text-gray-400"
10
10
  DISCLOSURE_CLASSES = "hidden peer-hover:block peer-focus-visible:block absolute inset-x-0 top-full z-10 mt-2 space-y-1 rounded-lg border border-gray-200 bg-white p-3 text-sm text-gray-600 shadow-lg dark:border-zinc-700 dark:bg-zinc-800 dark:text-gray-400"
11
+ CHANGE_ROW_CLASSES = "mt-1 h-5 text-sm font-medium"
11
12
  VALUE_LINK_CLASSES = "hover:underline focus:outline-none focus-visible:underline"
12
13
  INFO_BUTTON_CLASSES = "peer shrink-0 text-gray-400 transition hover:text-accent-600 dark:hover:text-accent-400"
13
14
 
@@ -73,14 +74,20 @@ module Keystone
73
74
  end
74
75
 
75
76
  def change_label
77
+ return "" unless change?
78
+
76
79
  formatted = "#{format("%.1f", @change.abs)}%"
77
80
  return formatted if @change.zero?
78
81
 
79
82
  "#{@change.negative? ? "▼" : "▲"} #{formatted}"
80
83
  end
81
84
 
85
+ def change_row_classes
86
+ "#{CHANGE_ROW_CLASSES} #{change_classes}"
87
+ end
88
+
82
89
  def change_classes
83
- return "text-gray-500 dark:text-gray-400" if @change.zero?
90
+ return "text-gray-500 dark:text-gray-400" if !change? || @change.zero?
84
91
  return "text-red-600 dark:text-red-400" if @change.negative?
85
92
 
86
93
  "text-green-600 dark:text-green-400"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KeystoneUi
4
- VERSION = "0.12.0"
4
+ VERSION = "0.12.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keystone_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Schneider
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-09-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: keystone_ui-styles
@@ -219,8 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
218
  - !ruby/object:Gem::Version
220
219
  version: '0'
221
220
  requirements: []
222
- rubygems_version: 3.5.16
223
- signing_key:
221
+ rubygems_version: 4.0.20
224
222
  specification_version: 4
225
223
  summary: Reusable UI component system for Rails applications.
226
224
  test_files: []