ariadne_view_components 0.0.96.2 → 0.0.96.3

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: 39f7da8e77bf4218cb84f4c335ad0cc2dcd1c57e7ce7a44cadbbac7bf2d962e0
4
- data.tar.gz: f46f8b2315a2b106e91a6b6f82aa26619163f1bb8fc7a5591fa24ecb962aed6f
3
+ metadata.gz: d1b2f0b1adc8c19934d638cb2a6af46f361746c038f6e5180a834497ed5f447d
4
+ data.tar.gz: 0f1ba422f5cef8d3232432f57b78dde417a64744c7ddd0197ef1f6c2b8ddb7b0
5
5
  SHA512:
6
- metadata.gz: a5d79327546dc7f898a1ce34d14d736231396c42e38c801321050330534d49d6b7ab241753c3610c9a78a0a1593c70b558dae99efb50584d9b343dc6a85b659c
7
- data.tar.gz: '0108d2b2caa19708d6032f37818d10d3b7f8c6b023a0313773772398f5b20e5e1b43bfa4882837368b63664aa022ee9db00015cc9981220b56111be9d40b13b3'
6
+ metadata.gz: 9d374dda9c6da3add8f79c43a1abc752d580a945e7c8db87a325f1b7aabe2bd46b0f60468a764191b81ba463aa35acbb5afd0d55873025d3823b884426d2c34f
7
+ data.tar.gz: 923610d570e4530c045efdd653ba2f3712a4c61f0fa9da62b2373d2be94ac74713169d0fe4aa55bb3645d21dcd1be73d20df4bd084b29e43e33176241a7961a6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # [v0.0.96.3] - 28-03-2025
2
+ ## What's Changed
3
+ * new content layout by @arielconti10 in https://github.com/yettoapp/ariadne/pull/578
4
+
5
+
6
+ **Full Changelog**: https://github.com/yettoapp/ariadne/compare/v0.0.96.2...v0.0.96.3
1
7
  # [v0.0.96.2] - 27-03-2025
2
8
  ## What's Changed
3
9
  * Sidebar and themes by @arielconti10 in https://github.com/yettoapp/ariadne/pull/573
@@ -0,0 +1,5 @@
1
+ <div class="<%= style %>">
2
+ <div class="<%= style(:main_content) %>">
3
+ <%= main_content if main_content %>
4
+ </div>
5
+ </div>
@@ -0,0 +1,45 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ module Ariadne
5
+ module Layout
6
+ module Content
7
+ # Renders a layout with a main content area on a purple background.
8
+ # This layout is designed for full-width content without a sidebar.
9
+ class Component < Ariadne::BaseComponent
10
+ # Main content area to be rendered
11
+ renders_one :main_content, Ariadne::BaseComponent::ACCEPT_ANYTHING
12
+
13
+ # Style definitions for the layout container
14
+ style do
15
+ base do
16
+ [
17
+ "ariadne:flex",
18
+ "ariadne:h-full",
19
+ "ariadne:min-h-screen",
20
+ "ariadne:overflow-hidden",
21
+ "ariadne:bg-purple-100",
22
+ "ariadne:dark:bg-purple-900",
23
+ ]
24
+ end
25
+ end
26
+
27
+ # Main content area styles
28
+ style(:main_content) do
29
+ base do
30
+ [
31
+ "ariadne:flex-1",
32
+ "ariadne:overflow-auto",
33
+ "ariadne:bg-purple-50",
34
+ "ariadne:dark:bg-purple-950",
35
+ "ariadne:rounded-xl",
36
+ "ariadne:m-4",
37
+ "ariadne:shadow-sm",
38
+ "ariadne:p-4",
39
+ ]
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -90,14 +90,22 @@ module Ariadne
90
90
  @placeholder_text = (text || "").strip.split[0..len].map { |word| word.capitalize[0] }.join
91
91
 
92
92
  # Generate default aria-label for accessibility if not provided
93
- @aria_label ||= if @text.present?
94
- @text
95
- elsif @src.present? && @alt.present?
96
- @src
93
+ @aria_label ||= if text.present?
94
+ "Avatar for #{text}"
95
+ elsif src.present? && alt.present?
96
+ "Avatar: #{alt}"
97
+ else
98
+ "User avatar"
97
99
  end
98
100
 
99
101
  # Ensure alt text is always provided for images to meet WCAG requirements
100
- @alt ||= @text
102
+ @alt ||= if text.present?
103
+ # Won't be used since text avatars don't use images
104
+ text
105
+ else
106
+ # For src-based avatars, default alt text is required
107
+ "User avatar"
108
+ end
101
109
  end
102
110
 
103
111
  private def validate!
@@ -3,6 +3,6 @@
3
3
  # :nocov:
4
4
  module Ariadne
5
5
  module ViewComponents
6
- VERSION = "0.0.96.2"
6
+ VERSION = "0.0.96.3"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ariadne_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.96.2
4
+ version: 0.0.96.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-27 00:00:00.000000000 Z
11
+ date: 2025-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tailwind_merge
@@ -163,6 +163,8 @@ files:
163
163
  - app/components/ariadne/form/toggle_group/option/component.rb
164
164
  - app/components/ariadne/form/validation_message/component.html.erb
165
165
  - app/components/ariadne/form/validation_message/component.rb
166
+ - app/components/ariadne/layout/content/component.html.erb
167
+ - app/components/ariadne/layout/content/component.rb
166
168
  - app/components/ariadne/layout/grid/component.html.erb
167
169
  - app/components/ariadne/layout/grid/component.rb
168
170
  - app/components/ariadne/layout/grid/item/component.html.erb