ariadne_view_components 0.0.70 → 0.0.71
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +20 -1
- data/app/assets/javascripts/ariadne_view_components.js +14 -14
- data/app/assets/javascripts/ariadne_view_components.js.br +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.gz +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css.br +0 -0
- data/app/assets/stylesheets/ariadne_view_components.css.gz +0 -0
- data/app/components/ariadne/base_component.rb +9 -1
- data/app/components/ariadne/behaviors/captionable.rb +55 -0
- data/app/components/ariadne/behaviors/tooltipable.rb +15 -15
- data/app/components/ariadne/form/base_component.rb +1 -1
- data/app/components/ariadne/form/checkbox/component.html.erb +6 -0
- data/app/components/ariadne/form/checkbox/component.rb +34 -0
- data/app/components/ariadne/form/group/component.html.erb +2 -2
- data/app/components/ariadne/form/group/component.rb +29 -2
- data/app/components/ariadne/form/hidden_field/component.html.erb +6 -1
- data/app/components/ariadne/form/hidden_field/component.rb +10 -3
- data/app/components/ariadne/form/radio/component.html.erb +6 -0
- data/app/components/ariadne/form/radio/component.rb +26 -0
- data/app/components/ariadne/form/radio_button/component.html.erb +6 -0
- data/app/components/ariadne/form/radio_button/component.rb +60 -0
- data/app/components/ariadne/form/radio_button_group/component.html.erb +24 -0
- data/app/components/ariadne/form/radio_button_group/component.rb +59 -0
- data/app/components/ariadne/form/text_field/component.html.erb +1 -0
- data/app/components/ariadne/layout/grid/component.html.erb +7 -0
- data/app/components/ariadne/layout/grid/component.rb +36 -0
- data/app/components/ariadne/layout/nav_bar/component.html.erb +12 -101
- data/app/components/ariadne/layout/nav_bar/component.rb +38 -9
- data/app/components/ariadne/layout/two_panel/component.html.erb +14 -0
- data/app/components/ariadne/layout/two_panel/component.rb +38 -0
- data/app/components/ariadne/layout/wide/component.html.erb +9 -0
- data/app/components/ariadne/layout/wide/component.rb +24 -0
- data/app/components/ariadne/turbo/frame/component.html.erb +3 -0
- data/app/components/ariadne/turbo/frame/component.rb +16 -0
- data/app/components/ariadne/turbo/stream_action/component.html.erb +4 -0
- data/app/components/ariadne/turbo/stream_action/component.rb +25 -0
- data/app/components/ariadne/ui/badge/component.html.erb +1 -0
- data/app/components/ariadne/ui/badge/component.rb +76 -0
- data/app/components/ariadne/ui/blankslate/component.html.erb +9 -0
- data/app/components/ariadne/ui/blankslate/component.rb +37 -0
- data/app/components/ariadne/ui/button/component.rb +2 -1
- data/app/components/ariadne/ui/color_dot/component.html.erb +7 -0
- data/app/components/ariadne/ui/color_dot/component.rb +39 -0
- data/app/components/ariadne/ui/combobox/component.html.erb +9 -15
- data/app/components/ariadne/ui/combobox/component.rb +38 -26
- data/app/components/ariadne/ui/combobox/{menu_item → item}/component.html.erb +1 -1
- data/app/components/ariadne/ui/combobox/item/component.rb +61 -0
- data/app/components/ariadne/ui/combobox/option/component.html.erb +1 -1
- data/app/components/ariadne/ui/combobox/option/component.rb +11 -12
- data/app/components/ariadne/ui/data_table/component.html.erb +1 -0
- data/app/components/ariadne/ui/data_table/component.rb +11 -0
- data/app/components/ariadne/ui/dialog/component.html.erb +32 -0
- data/app/components/ariadne/ui/dialog/component.rb +37 -0
- data/app/components/ariadne/ui/dialog/component.ts +27 -0
- data/app/components/ariadne/ui/heroicon/component.rb +6 -1
- data/app/components/ariadne/ui/list/component.html.erb +6 -0
- data/app/components/ariadne/ui/list/component.rb +12 -0
- data/app/components/ariadne/ui/list/item/component.html.erb +16 -0
- data/app/components/ariadne/ui/list/item/component.rb +17 -0
- data/app/components/ariadne/ui/table/cell/component.html.erb +3 -0
- data/app/components/ariadne/ui/table/cell/component.rb +38 -0
- data/app/components/ariadne/ui/table/component.html.erb +13 -0
- data/app/components/ariadne/ui/table/component.rb +45 -0
- data/app/components/ariadne/ui/table/footer/component.html.erb +0 -0
- data/app/components/ariadne/ui/table/footer/component.rb +14 -0
- data/app/components/ariadne/ui/table/header/component.html.erb +3 -0
- data/app/components/ariadne/ui/table/header/component.rb +40 -0
- data/app/components/ariadne/ui/table/row/component.html.erb +5 -0
- data/app/components/ariadne/ui/table/row/component.rb +28 -0
- data/app/components/ariadne/ui/typography/component.html.erb +1 -3
- data/app/components/ariadne/ui/typography/component.rb +62 -2
- data/app/frontend/ariadne/index.ts +0 -1
- data/app/frontend/controllers/autosubmittable_controller.ts +25 -0
- data/lib/ariadne/forms/base.html.erb +4 -5
- data/lib/ariadne/forms/dsl/badge.rb +35 -0
- data/lib/ariadne/forms/dsl/button_input.rb +4 -3
- data/lib/ariadne/forms/dsl/form_object.rb +8 -0
- data/lib/ariadne/forms/dsl/form_reference_input.rb +59 -0
- data/lib/ariadne/forms/dsl/hidden_input.rb +32 -0
- data/lib/ariadne/forms/dsl/input.rb +4 -2
- data/lib/ariadne/forms/dsl/input_group.rb +3 -3
- data/lib/ariadne/forms/dsl/radio_button_group_input.rb +50 -0
- data/lib/ariadne/forms/dsl/radio_button_input.rb +48 -0
- data/lib/ariadne/forms/dsl/text_field_input.rb +4 -1
- data/lib/ariadne/view_components/version.rb +1 -1
- metadata +54 -10
- data/app/components/ariadne/form/caption/component.html.erb +0 -10
- data/app/components/ariadne/form/caption/component.rb +0 -32
- data/app/components/ariadne/form/spacing_wrapper/component.html.erb +0 -3
- data/app/components/ariadne/form/spacing_wrapper/component.rb +0 -10
- data/app/components/ariadne/ui/combobox/menu_item/component.rb +0 -53
- data/app/frontend/controllers/tooltip.ts +0 -75
- data/app/frontend/stylesheets/typography.css +0 -117
@@ -13,8 +13,18 @@ module Ariadne
|
|
13
13
|
|
14
14
|
def tag_name
|
15
15
|
case type
|
16
|
-
when :
|
16
|
+
when :title
|
17
17
|
:h1
|
18
|
+
when :heading
|
19
|
+
:h2
|
20
|
+
when :subheading
|
21
|
+
:h3
|
22
|
+
when :ann
|
23
|
+
:h4
|
24
|
+
when :lead
|
25
|
+
:p
|
26
|
+
when :code
|
27
|
+
:code
|
18
28
|
else
|
19
29
|
:span
|
20
30
|
end
|
@@ -23,7 +33,7 @@ module Ariadne
|
|
23
33
|
style do
|
24
34
|
variants do
|
25
35
|
type do
|
26
|
-
|
36
|
+
title do
|
27
37
|
[
|
28
38
|
"ariadne-scroll-m-20",
|
29
39
|
"ariadne-text-4xl",
|
@@ -32,6 +42,56 @@ module Ariadne
|
|
32
42
|
"lg:ariadne-text-5xl",
|
33
43
|
]
|
34
44
|
end
|
45
|
+
|
46
|
+
heading do
|
47
|
+
[
|
48
|
+
"ariadne-scroll-m-20",
|
49
|
+
"ariadne-border-b",
|
50
|
+
"ariadne-pb-2",
|
51
|
+
"ariadne-text-3xl",
|
52
|
+
"ariadne-font-semibold",
|
53
|
+
"ariadne-tracking-tight",
|
54
|
+
"first:ariadne-mt-0",
|
55
|
+
]
|
56
|
+
end
|
57
|
+
|
58
|
+
subheading do
|
59
|
+
[
|
60
|
+
"ariadne-scroll-m-20",
|
61
|
+
"ariadne-text-2xl",
|
62
|
+
"ariadne-font-semibold",
|
63
|
+
"ariadne-tracking-tight",
|
64
|
+
]
|
65
|
+
end
|
66
|
+
|
67
|
+
ann do
|
68
|
+
[
|
69
|
+
"ariadne-scroll-m-20",
|
70
|
+
"ariadne-text-xl",
|
71
|
+
"ariadne-font-semibold",
|
72
|
+
"ariadne-tracking-tight",
|
73
|
+
]
|
74
|
+
end
|
75
|
+
|
76
|
+
lede do
|
77
|
+
[
|
78
|
+
"ariadne-text-xl",
|
79
|
+
"ariadne-gray-90",
|
80
|
+
]
|
81
|
+
end
|
82
|
+
|
83
|
+
code do
|
84
|
+
[
|
85
|
+
"ariadne-relative",
|
86
|
+
"ariadne-rounded",
|
87
|
+
"ariadne-bg-neutral-100",
|
88
|
+
"ariadne-px-[0.3rem]",
|
89
|
+
"ariadne-py-[0.2rem]",
|
90
|
+
"ariadne-font-mono",
|
91
|
+
"ariadne-text-sm",
|
92
|
+
"ariadne-font-semibold",
|
93
|
+
]
|
94
|
+
end
|
35
95
|
end
|
36
96
|
end
|
37
97
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import {Controller} from '@hotwired/stimulus'
|
2
|
+
|
3
|
+
import {useDebounce} from 'stimulus-use'
|
4
|
+
|
5
|
+
// can't use controllerFactory because it seems to conflict with `useDebounce`
|
6
|
+
export default class AutoSubmittableController extends Controller<HTMLFormElement> {
|
7
|
+
static debounces = ['save']
|
8
|
+
static targets = ['form']
|
9
|
+
declare readonly formTarget: HTMLFormElement
|
10
|
+
declare readonly formTargets: HTMLFormElement[]
|
11
|
+
|
12
|
+
declare readonly hasFormTarget: boolean
|
13
|
+
|
14
|
+
connect(): void {
|
15
|
+
useDebounce(this)
|
16
|
+
}
|
17
|
+
|
18
|
+
save(): void {
|
19
|
+
if (this.hasFormTarget) {
|
20
|
+
this.formTarget.requestSubmit()
|
21
|
+
} else {
|
22
|
+
this.element.requestSubmit()
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
</div>
|
1
|
+
<% inputs.each do |input| %>
|
2
|
+
<%= render(input.to_component) %>
|
3
|
+
<% end %>
|
4
|
+
|
6
5
|
<% if after_content? %>
|
7
6
|
<%= render_after_content %>
|
8
7
|
<% end %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Ariadne
|
4
|
+
module Forms
|
5
|
+
module Dsl
|
6
|
+
# :nodoc:
|
7
|
+
class Badge
|
8
|
+
include InputMethods
|
9
|
+
|
10
|
+
attr_reader :builder, :form, :text, :options
|
11
|
+
|
12
|
+
def initialize(builder:, form:, text:, **options)
|
13
|
+
@builder = builder
|
14
|
+
@form = form
|
15
|
+
@text = text
|
16
|
+
@options = options
|
17
|
+
|
18
|
+
yield(self) if block_given?
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_component
|
22
|
+
Ariadne::UI::Badge::Component.new(text: @text, **@options)
|
23
|
+
end
|
24
|
+
|
25
|
+
def type
|
26
|
+
:group
|
27
|
+
end
|
28
|
+
|
29
|
+
def input?
|
30
|
+
true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -7,16 +7,17 @@ module Ariadne
|
|
7
7
|
class ButtonInput < Input
|
8
8
|
attr_reader :name, :label, :block
|
9
9
|
|
10
|
-
def initialize(name:, label:, **
|
10
|
+
def initialize(name:, label:, **options, &block)
|
11
11
|
@name = name
|
12
12
|
@label = label
|
13
|
+
@caption = options.delete(:caption)
|
13
14
|
@block = block
|
14
15
|
|
15
|
-
super(**
|
16
|
+
super(**options)
|
16
17
|
end
|
17
18
|
|
18
19
|
def to_component
|
19
|
-
Ariadne::UI::Button::Component.new(
|
20
|
+
Ariadne::UI::Button::Component.new.with_caption(@caption).with_block(@block)
|
20
21
|
end
|
21
22
|
|
22
23
|
# :nocov:
|
@@ -20,6 +20,14 @@ module Ariadne
|
|
20
20
|
def group(**options, &block)
|
21
21
|
add_input(InputGroup.new(builder: @builder, form: @form, **options, &block))
|
22
22
|
end
|
23
|
+
|
24
|
+
def button(**options, &block)
|
25
|
+
add_input(ButtonInput.new(builder: @builder, form: @form, **options, &block))
|
26
|
+
end
|
27
|
+
|
28
|
+
def badge(**options, &block)
|
29
|
+
add_input(Badge.new(builder: @builder, form: @form, **options, &block))
|
30
|
+
end
|
23
31
|
end
|
24
32
|
end
|
25
33
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Ariadne
|
4
|
+
module Forms
|
5
|
+
module Dsl
|
6
|
+
# :nodoc:
|
7
|
+
class FormReferenceInput < Input
|
8
|
+
attr_reader :ref_block, :fields_for_args, :fields_for_kwargs, :nested
|
9
|
+
alias_method :nested?, :nested
|
10
|
+
|
11
|
+
# Pass `nested: false` to prevent the referenced form fields from being treated as nested
|
12
|
+
# under the parent form's model. For example, consider these models:
|
13
|
+
|
14
|
+
# class User < ActiveRecord::Base
|
15
|
+
# has_many :addresses
|
16
|
+
# end
|
17
|
+
|
18
|
+
# class Address < ActiveRecord::Base
|
19
|
+
# belongs_to :user
|
20
|
+
# end
|
21
|
+
|
22
|
+
# A sign-up form might include fields from `User` as well as `Address`. Since addresses are
|
23
|
+
# associated with users, it's perfectly natural to accept the address fields as nested
|
24
|
+
# attributes. Rails will name each field accordingly. For example, the `street` field on
|
25
|
+
# `Address` will be named `user[address][street]`.
|
26
|
+
|
27
|
+
# For situations like this where an association exists between two models, the nested
|
28
|
+
# attributes approach works great. However sometimes all you want is to compose two forms
|
29
|
+
# together that aren't connected by an association. In such cases the fields will still
|
30
|
+
# include the name of the parent model, eg. `user[address][street]` instead of what we want,
|
31
|
+
# `address[street]`. To render the form independent of the parent, pass `nested: false`.
|
32
|
+
def initialize(*fields_for_args, builder:, form:, nested: true, **fields_for_kwargs, &block)
|
33
|
+
@fields_for_args = fields_for_args
|
34
|
+
@fields_for_kwargs = fields_for_kwargs
|
35
|
+
@nested = nested
|
36
|
+
@ref_block = block
|
37
|
+
|
38
|
+
super(builder: builder, form: form, **fields_for_kwargs)
|
39
|
+
end
|
40
|
+
|
41
|
+
def to_component
|
42
|
+
Ariadne::Form::FormReference::Component.new(input: self)
|
43
|
+
end
|
44
|
+
|
45
|
+
def name
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
|
49
|
+
def label
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def type
|
54
|
+
:form
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Ariadne
|
4
|
+
module Forms
|
5
|
+
module Dsl
|
6
|
+
# :nodoc:
|
7
|
+
class HiddenInput < Input
|
8
|
+
attr_reader :name, :value
|
9
|
+
|
10
|
+
def initialize(name:, value:, **options)
|
11
|
+
@name = name
|
12
|
+
@value = value
|
13
|
+
super(**options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_component
|
17
|
+
html_attrs = @input_attributes || {}
|
18
|
+
Ariadne::Form::HiddenField::Component.new(name:, value:, html_attrs: html_attrs)
|
19
|
+
end
|
20
|
+
|
21
|
+
# :nocov:
|
22
|
+
def type
|
23
|
+
:hidden
|
24
|
+
end
|
25
|
+
|
26
|
+
def supports_validation?
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -55,7 +55,7 @@ module Ariadne
|
|
55
55
|
@builder = builder
|
56
56
|
@form = form
|
57
57
|
|
58
|
-
@options = options
|
58
|
+
@options = options.dup
|
59
59
|
@input_attributes = @options.delete(:html_attrs) || {}
|
60
60
|
@input_attributes.delete(:id) if @input_attributes[:id].blank?
|
61
61
|
@label_attributes = @options[:label_html_attributes] || {}
|
@@ -70,6 +70,8 @@ module Ariadne
|
|
70
70
|
@label_attributes.delete(:class) if @label_attributes[:class].blank?
|
71
71
|
|
72
72
|
@caption = @options.delete(:caption)
|
73
|
+
@placeholder = @options.delete(:placeholder)
|
74
|
+
@disabled = @options.delete(:disabled)
|
73
75
|
@validation_message = @options.delete(:validation_message)
|
74
76
|
@invalid = @options.delete(:invalid)
|
75
77
|
@full_width = @options.delete(:full_width) { true }
|
@@ -209,7 +211,7 @@ module Ariadne
|
|
209
211
|
end
|
210
212
|
|
211
213
|
def disabled?
|
212
|
-
|
214
|
+
@disabled.present?
|
213
215
|
end
|
214
216
|
|
215
217
|
def size
|
@@ -9,16 +9,16 @@ module Ariadne
|
|
9
9
|
|
10
10
|
attr_reader :builder, :form, :system_arguments
|
11
11
|
|
12
|
-
def initialize(builder:, form:, **
|
12
|
+
def initialize(builder:, form:, **options)
|
13
13
|
@builder = builder
|
14
14
|
@form = form
|
15
|
-
@
|
15
|
+
@options = options
|
16
16
|
|
17
17
|
yield(self) if block_given?
|
18
18
|
end
|
19
19
|
|
20
20
|
def to_component
|
21
|
-
Ariadne::Form::Group::Component.new(inputs: inputs, builder: builder, form: form, **@
|
21
|
+
Ariadne::Form::Group::Component.new(inputs: inputs, builder: builder, form: form, **@options)
|
22
22
|
end
|
23
23
|
|
24
24
|
def type
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Ariadne
|
4
|
+
module Forms
|
5
|
+
module Dsl
|
6
|
+
# :nodoc:
|
7
|
+
class RadioButtonGroupInput < Input
|
8
|
+
attr_reader :name, :label, :radio_buttons
|
9
|
+
|
10
|
+
def initialize(name:, label: nil, **options)
|
11
|
+
@name = name
|
12
|
+
@label = label
|
13
|
+
@radio_buttons = []
|
14
|
+
|
15
|
+
super(**options)
|
16
|
+
|
17
|
+
yield(self) if block_given?
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_component
|
21
|
+
component = Ariadne::Form::RadioButtonGroup::Component.new(name:, label:, **@options)
|
22
|
+
@radio_buttons.each do |radio_button|
|
23
|
+
component.rendered_radio_button(radio_button)
|
24
|
+
end
|
25
|
+
component
|
26
|
+
end
|
27
|
+
|
28
|
+
def type
|
29
|
+
:radio_button_group
|
30
|
+
end
|
31
|
+
|
32
|
+
def autofocus!
|
33
|
+
@radio_buttons.first&.autofocus!
|
34
|
+
end
|
35
|
+
|
36
|
+
def focusable?
|
37
|
+
true
|
38
|
+
end
|
39
|
+
|
40
|
+
def radio_button(**options, &block)
|
41
|
+
@radio_buttons << RadioButtonInput.new(
|
42
|
+
builder: @builder, form: @form, name: @name, disabled: disabled?,
|
43
|
+
**options,
|
44
|
+
&block
|
45
|
+
).to_component
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Ariadne
|
4
|
+
module Forms
|
5
|
+
module Dsl
|
6
|
+
# :nodoc:
|
7
|
+
class RadioButtonInput < Input
|
8
|
+
attr_reader :name, :value, :label, :nested_form_block, :nested_form_arguments
|
9
|
+
|
10
|
+
def initialize(name:, value:, label:, **options)
|
11
|
+
@name = name
|
12
|
+
@value = value
|
13
|
+
@label = label
|
14
|
+
|
15
|
+
super(**options)
|
16
|
+
|
17
|
+
yield(self) if block_given?
|
18
|
+
end
|
19
|
+
|
20
|
+
# radio buttons cannot be invalid, as both selected and unselected are valid states
|
21
|
+
# :nocov:
|
22
|
+
def valid?
|
23
|
+
true
|
24
|
+
end
|
25
|
+
# :nocov:
|
26
|
+
|
27
|
+
def to_component
|
28
|
+
Ariadne::Form::RadioButton::Component.new(name:, value:, label:, **@options)
|
29
|
+
end
|
30
|
+
|
31
|
+
def nested_form(**system_arguments, &block)
|
32
|
+
@nested_form_arguments = system_arguments
|
33
|
+
@nested_form_block = block
|
34
|
+
end
|
35
|
+
|
36
|
+
# :nocov:
|
37
|
+
def type
|
38
|
+
:radio_button
|
39
|
+
end
|
40
|
+
# :nocov:
|
41
|
+
|
42
|
+
def supports_validation?
|
43
|
+
false
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -25,7 +25,10 @@ module Ariadne
|
|
25
25
|
|
26
26
|
def to_component
|
27
27
|
html_attrs = @input_attributes || {}
|
28
|
-
|
28
|
+
html_attrs[:placeholder] = @placeholder if @placeholder.present?
|
29
|
+
html_attrs[:disabled] = true if @disabled
|
30
|
+
|
31
|
+
Ariadne::Form::TextField::Component.new(name: @name, label: @label, caption: @caption, html_attrs: html_attrs, **@options)
|
29
32
|
end
|
30
33
|
|
31
34
|
def type
|
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.
|
4
|
+
version: 0.0.71
|
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: 2024-04-
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tailwind_merge
|
@@ -130,12 +130,13 @@ files:
|
|
130
130
|
- app/assets/stylesheets/ariadne_view_components.css.gz
|
131
131
|
- app/components/ariadne/ariadne-form.ts
|
132
132
|
- app/components/ariadne/base_component.rb
|
133
|
+
- app/components/ariadne/behaviors/captionable.rb
|
133
134
|
- app/components/ariadne/behaviors/tooltipable.rb
|
134
135
|
- app/components/ariadne/conditional_wrapper.rb
|
135
136
|
- app/components/ariadne/form/base_component.rb
|
136
137
|
- app/components/ariadne/form/base_input_component.rb
|
137
|
-
- app/components/ariadne/form/
|
138
|
-
- app/components/ariadne/form/
|
138
|
+
- app/components/ariadne/form/checkbox/component.html.erb
|
139
|
+
- app/components/ariadne/form/checkbox/component.rb
|
139
140
|
- app/components/ariadne/form/form_control/component.html.erb
|
140
141
|
- app/components/ariadne/form/form_control/component.rb
|
141
142
|
- app/components/ariadne/form/form_reference/component.html.erb
|
@@ -144,47 +145,85 @@ files:
|
|
144
145
|
- app/components/ariadne/form/group/component.rb
|
145
146
|
- app/components/ariadne/form/hidden_field/component.html.erb
|
146
147
|
- app/components/ariadne/form/hidden_field/component.rb
|
148
|
+
- app/components/ariadne/form/radio/component.html.erb
|
149
|
+
- app/components/ariadne/form/radio/component.rb
|
150
|
+
- app/components/ariadne/form/radio_button/component.html.erb
|
151
|
+
- app/components/ariadne/form/radio_button/component.rb
|
152
|
+
- app/components/ariadne/form/radio_button_group/component.html.erb
|
153
|
+
- app/components/ariadne/form/radio_button_group/component.rb
|
147
154
|
- app/components/ariadne/form/separator/component.html.erb
|
148
155
|
- app/components/ariadne/form/separator/component.rb
|
149
|
-
- app/components/ariadne/form/spacing_wrapper/component.html.erb
|
150
|
-
- app/components/ariadne/form/spacing_wrapper/component.rb
|
151
156
|
- app/components/ariadne/form/text_field/component.html.erb
|
152
157
|
- app/components/ariadne/form/text_field/component.rb
|
153
158
|
- app/components/ariadne/form/validation_message/component.html.erb
|
154
159
|
- app/components/ariadne/form/validation_message/component.rb
|
160
|
+
- app/components/ariadne/layout/grid/component.html.erb
|
161
|
+
- app/components/ariadne/layout/grid/component.rb
|
155
162
|
- app/components/ariadne/layout/narrow/component.html.erb
|
156
163
|
- app/components/ariadne/layout/narrow/component.rb
|
157
164
|
- app/components/ariadne/layout/nav_bar/component.css
|
158
165
|
- app/components/ariadne/layout/nav_bar/component.html.erb
|
159
166
|
- app/components/ariadne/layout/nav_bar/component.rb
|
167
|
+
- app/components/ariadne/layout/two_panel/component.html.erb
|
168
|
+
- app/components/ariadne/layout/two_panel/component.rb
|
169
|
+
- app/components/ariadne/layout/wide/component.html.erb
|
170
|
+
- app/components/ariadne/layout/wide/component.rb
|
171
|
+
- app/components/ariadne/turbo/frame/component.html.erb
|
172
|
+
- app/components/ariadne/turbo/frame/component.rb
|
173
|
+
- app/components/ariadne/turbo/stream_action/component.html.erb
|
174
|
+
- app/components/ariadne/turbo/stream_action/component.rb
|
175
|
+
- app/components/ariadne/ui/badge/component.html.erb
|
176
|
+
- app/components/ariadne/ui/badge/component.rb
|
177
|
+
- app/components/ariadne/ui/blankslate/component.html.erb
|
178
|
+
- app/components/ariadne/ui/blankslate/component.rb
|
160
179
|
- app/components/ariadne/ui/button/component.html.erb
|
161
180
|
- app/components/ariadne/ui/button/component.rb
|
162
181
|
- app/components/ariadne/ui/clipboard_copy/component.html.erb
|
163
182
|
- app/components/ariadne/ui/clipboard_copy/component.rb
|
164
183
|
- app/components/ariadne/ui/clipboard_copy/component.ts
|
184
|
+
- app/components/ariadne/ui/color_dot/component.html.erb
|
185
|
+
- app/components/ariadne/ui/color_dot/component.rb
|
165
186
|
- app/components/ariadne/ui/combobox/component.html.erb
|
166
187
|
- app/components/ariadne/ui/combobox/component.rb
|
167
188
|
- app/components/ariadne/ui/combobox/component.ts
|
168
|
-
- app/components/ariadne/ui/combobox/
|
169
|
-
- app/components/ariadne/ui/combobox/
|
189
|
+
- app/components/ariadne/ui/combobox/item/component.html.erb
|
190
|
+
- app/components/ariadne/ui/combobox/item/component.rb
|
170
191
|
- app/components/ariadne/ui/combobox/option/component.html.erb
|
171
192
|
- app/components/ariadne/ui/combobox/option/component.rb
|
193
|
+
- app/components/ariadne/ui/data_table/component.html.erb
|
194
|
+
- app/components/ariadne/ui/data_table/component.rb
|
195
|
+
- app/components/ariadne/ui/dialog/component.html.erb
|
196
|
+
- app/components/ariadne/ui/dialog/component.rb
|
197
|
+
- app/components/ariadne/ui/dialog/component.ts
|
172
198
|
- app/components/ariadne/ui/heroicon/component.html.erb
|
173
199
|
- app/components/ariadne/ui/heroicon/component.rb
|
174
200
|
- app/components/ariadne/ui/image/component.rb
|
175
201
|
- app/components/ariadne/ui/link/component.html.erb
|
176
202
|
- app/components/ariadne/ui/link/component.rb
|
203
|
+
- app/components/ariadne/ui/list/component.html.erb
|
204
|
+
- app/components/ariadne/ui/list/component.rb
|
205
|
+
- app/components/ariadne/ui/list/item/component.html.erb
|
206
|
+
- app/components/ariadne/ui/list/item/component.rb
|
207
|
+
- app/components/ariadne/ui/table/cell/component.html.erb
|
208
|
+
- app/components/ariadne/ui/table/cell/component.rb
|
209
|
+
- app/components/ariadne/ui/table/component.html.erb
|
210
|
+
- app/components/ariadne/ui/table/component.rb
|
211
|
+
- app/components/ariadne/ui/table/footer/component.html.erb
|
212
|
+
- app/components/ariadne/ui/table/footer/component.rb
|
213
|
+
- app/components/ariadne/ui/table/header/component.html.erb
|
214
|
+
- app/components/ariadne/ui/table/header/component.rb
|
215
|
+
- app/components/ariadne/ui/table/row/component.html.erb
|
216
|
+
- app/components/ariadne/ui/table/row/component.rb
|
177
217
|
- app/components/ariadne/ui/typography/component.html.erb
|
178
218
|
- app/components/ariadne/ui/typography/component.rb
|
179
219
|
- app/frontend/ariadne/index.ts
|
180
220
|
- app/frontend/ariadne/stimulus_app.ts
|
181
221
|
- app/frontend/ariadne/theme.ts
|
182
|
-
- app/frontend/controllers/
|
222
|
+
- app/frontend/controllers/autosubmittable_controller.ts
|
183
223
|
- app/frontend/entrypoints/application.ts
|
184
224
|
- app/frontend/stylesheets/ariadne_view_components.css
|
185
225
|
- app/frontend/stylesheets/scrollbar.css
|
186
226
|
- app/frontend/stylesheets/tippy.js/themes/tomato.css
|
187
|
-
- app/frontend/stylesheets/typography.css
|
188
227
|
- app/frontend/utils/createController.ts
|
189
228
|
- app/helpers/ariadne/form_helper.rb
|
190
229
|
- app/lib/ariadne/attributes_helper.rb
|
@@ -201,11 +240,16 @@ files:
|
|
201
240
|
- lib/ariadne/forms/base.rb
|
202
241
|
- lib/ariadne/forms/buffer_rewriter.rb
|
203
242
|
- lib/ariadne/forms/builder.rb
|
243
|
+
- lib/ariadne/forms/dsl/badge.rb
|
204
244
|
- lib/ariadne/forms/dsl/button_input.rb
|
205
245
|
- lib/ariadne/forms/dsl/form_object.rb
|
246
|
+
- lib/ariadne/forms/dsl/form_reference_input.rb
|
247
|
+
- lib/ariadne/forms/dsl/hidden_input.rb
|
206
248
|
- lib/ariadne/forms/dsl/input.rb
|
207
249
|
- lib/ariadne/forms/dsl/input_group.rb
|
208
250
|
- lib/ariadne/forms/dsl/input_methods.rb
|
251
|
+
- lib/ariadne/forms/dsl/radio_button_group_input.rb
|
252
|
+
- lib/ariadne/forms/dsl/radio_button_input.rb
|
209
253
|
- lib/ariadne/forms/dsl/submit_button_input.rb
|
210
254
|
- lib/ariadne/forms/dsl/text_field_input.rb
|
211
255
|
- lib/ariadne/forms/utils.rb
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<% if @input.caption? && !@input.caption.blank? %>
|
2
|
-
<span class="FormControl-caption" id="<%= @input.caption_id %>"><%= @input.caption %></span>
|
3
|
-
<% elsif caption_template? %>
|
4
|
-
<% caption_template = render_caption_template %>
|
5
|
-
<% unless caption_template.blank? %>
|
6
|
-
<span class="FormControl-caption" id="<%= @input.caption_id %>">
|
7
|
-
<%= caption_template %>
|
8
|
-
</span>
|
9
|
-
<% end %>
|
10
|
-
<% end %>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Ariadne
|
4
|
-
module Form
|
5
|
-
# :nodoc:
|
6
|
-
module Caption
|
7
|
-
class Component
|
8
|
-
Ariadne::Form::BaseInputComponent
|
9
|
-
def initialize(input:)
|
10
|
-
@input = input
|
11
|
-
end
|
12
|
-
|
13
|
-
def caption_template?
|
14
|
-
@input.caption_template?
|
15
|
-
end
|
16
|
-
|
17
|
-
def render_caption_template
|
18
|
-
@input.render_caption_template
|
19
|
-
end
|
20
|
-
|
21
|
-
def before_render
|
22
|
-
return unless @input.caption? && caption_template?
|
23
|
-
|
24
|
-
raise <<~MESSAGE
|
25
|
-
Please provide either a caption: argument or caption template for the
|
26
|
-
'#{@input.name}' input; both were found.
|
27
|
-
MESSAGE
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|