lightning_ui_kit 0.2.5 → 0.3.0
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 +4 -4
- data/README.md +1 -1
- data/Rakefile +2 -9
- data/app/assets/builds/lightning_ui_kit.css +31 -588
- data/app/assets/builds/lightning_ui_kit.js +2 -9
- data/app/assets/builds/lightning_ui_kit.js.map +4 -4
- data/app/assets/vendor/lightning_ui_kit.css +88 -582
- data/app/assets/vendor/lightning_ui_kit.js +2 -9
- data/app/components/lightning_ui_kit/button_component.html.erb +0 -4
- data/app/components/lightning_ui_kit/button_component.rb +3 -24
- data/app/components/lightning_ui_kit/checkbox_component.html.erb +7 -2
- data/app/components/lightning_ui_kit/checkbox_component.rb +0 -13
- data/app/components/lightning_ui_kit/dropdown_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/dropdown_component.rb +1 -1
- data/app/components/lightning_ui_kit/dropzone_component.html.erb +38 -13
- data/app/components/lightning_ui_kit/dropzone_component.rb +16 -43
- data/app/components/lightning_ui_kit/file_input_component.html.erb +34 -4
- data/app/components/lightning_ui_kit/file_input_component.rb +20 -54
- data/app/components/lightning_ui_kit/input_component.html.erb +98 -14
- data/app/components/lightning_ui_kit/input_component.rb +19 -154
- data/app/components/lightning_ui_kit/modal_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/select_component.html.erb +27 -6
- data/app/components/lightning_ui_kit/select_component.rb +23 -65
- data/app/components/lightning_ui_kit/textarea_component.html.erb +37 -5
- data/app/components/lightning_ui_kit/textarea_component.rb +17 -50
- data/app/javascript/lightning_ui_kit/controllers/modal_controller.js +1 -7
- data/app/javascript/lightning_ui_kit/index.js +0 -8
- data/config/deploy.yml +5 -2
- data/lib/lightning_ui_kit/engine.rb +6 -1
- data/lib/lightning_ui_kit/version.rb +1 -1
- metadata +17 -17
- data/app/components/lightning_ui_kit/combobox_component.html.erb +0 -137
- data/app/components/lightning_ui_kit/combobox_component.rb +0 -205
- data/app/components/lightning_ui_kit/layout_component.html.erb +0 -118
- data/app/components/lightning_ui_kit/layout_component.rb +0 -26
- data/app/components/lightning_ui_kit/sidebar_link_component.html.erb +0 -6
- data/app/components/lightning_ui_kit/sidebar_link_component.rb +0 -33
- data/app/components/lightning_ui_kit/sidebar_section_component.html.erb +0 -8
- data/app/components/lightning_ui_kit/sidebar_section_component.rb +0 -18
- data/app/components/lightning_ui_kit/tooltip_component.html.erb +0 -15
- data/app/components/lightning_ui_kit/tooltip_component.rb +0 -26
- data/app/javascript/lightning_ui_kit/controllers/combobox_controller.js +0 -704
- data/app/javascript/lightning_ui_kit/controllers/field_controller.js +0 -23
- data/app/javascript/lightning_ui_kit/controllers/layout_controller.js +0 -19
- data/app/javascript/lightning_ui_kit/controllers/tooltip_controller.js +0 -235
|
@@ -3,30 +3,36 @@
|
|
|
3
3
|
<div class="lui:w-full lui:grid lui:gap-1 lui:my-4" id="#NEW_FILE" data-lui-dropzone-target="file">
|
|
4
4
|
<div class="lui:flex lui:items-center lui:justify-between lui:gap-2">
|
|
5
5
|
<div class="lui:flex lui:items-center lui:gap-2">
|
|
6
|
-
<%= heroicon("document", variant: :outline, options: {class: "lui:w-10 lui:h-10 lui:text-
|
|
6
|
+
<%= heroicon("document", variant: :outline, options: {class: "lui:w-10 lui:h-10 lui:text-indigo-500"}) %>
|
|
7
7
|
<div class="lui:grid lui:gap-1">
|
|
8
|
-
<h4 class="lui:text-
|
|
9
|
-
<h5 class="lui:text-
|
|
8
|
+
<h4 class="lui:text-gray-900 lui:text-sm lui:font-normal lui:leading-snug" data-lui-dropzone-target="filename"></h4>
|
|
9
|
+
<h5 class="lui:text-gray-400 lui:text-xs lui:font-normal lui:leading-[18px]" data-lui-dropzone-target="status"></h5>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
<%= heroicon(
|
|
13
13
|
"x-circle",
|
|
14
14
|
variant: :outline,
|
|
15
15
|
options: {
|
|
16
|
-
class: "lui:w-6 lui:h-6 lui:text-zinc-
|
|
16
|
+
class: "lui:w-6 lui:h-6 lui:text-zinc-300 lui:hover:text-indigo-500 lui:hover:cursor-pointer",
|
|
17
17
|
data_action: "click->lui-dropzone#removeFile"
|
|
18
18
|
}) %>
|
|
19
19
|
</div>
|
|
20
20
|
<div class="lui:relative lui:flex lui:items-center lui:gap-2.5 lui:py-1.5">
|
|
21
|
-
<div class="lui:relative lui:w-full lui:h-2.5 lui:overflow-hidden lui:rounded-3xl lui:bg-
|
|
22
|
-
<div data-lui-dropzone-target="progressbar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 0%" class="lui:flex lui:h-full lui:items-center lui:justify-center lui:bg-
|
|
21
|
+
<div class="lui:relative lui:w-full lui:h-2.5 lui:overflow-hidden lui:rounded-3xl lui:bg-gray-100">
|
|
22
|
+
<div data-lui-dropzone-target="progressbar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 0%" class="lui:flex lui:h-full lui:items-center lui:justify-center lui:bg-indigo-600 lui:text-white lui:rounded-3xl"></div>
|
|
23
23
|
</div>
|
|
24
|
-
<span data-lui-dropzone-target="percentage-progress" class="lui:ml-2 lui:bg-white lui:rounded-full lui:text-
|
|
24
|
+
<span data-lui-dropzone-target="percentage-progress" class="lui:ml-2 lui:bg-white lui:rounded-full lui:text-gray-800 lui:text-xs lui:font-medium lui:flex lui:justify-center lui:items-center">0%</span>
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
<% if @label %>
|
|
30
|
+
<%= tag.label(
|
|
31
|
+
@label,
|
|
32
|
+
class: "lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
33
|
+
data: label_data
|
|
34
|
+
) %>
|
|
35
|
+
<% end %>
|
|
30
36
|
<% if @description %>
|
|
31
37
|
<%= tag.p(
|
|
32
38
|
@description,
|
|
@@ -35,15 +41,34 @@
|
|
|
35
41
|
) %>
|
|
36
42
|
<% end %>
|
|
37
43
|
|
|
38
|
-
<div class="lui:py-9 lui:bg-zinc-50 lui:rounded-2xl lui:border lui:border-
|
|
44
|
+
<div class="lui:py-9 lui:bg-zinc-50 lui:rounded-2xl lui:border lui:border-gray-300 lui:border-dotted lui:hover:cursor-pointer lui:hover:bg-zinc-100" data-action="click->lui-dropzone#selectFiles">
|
|
39
45
|
<div class="lui:mb-3 lui:flex lui:items-center lui:justify-center">
|
|
40
|
-
<%= heroicon("cloud-arrow-up", variant: :outline, options: {class: "lui:w-10 lui:h-10 lui:text-
|
|
46
|
+
<%= heroicon("cloud-arrow-up", variant: :outline, options: {class: "lui:w-10 lui:h-10 lui:text-indigo-500"}) %>
|
|
41
47
|
</div>
|
|
42
|
-
<p class="lui:text-center lui:text-
|
|
48
|
+
<p class="lui:text-center lui:text-gray-900 lui:text-base lui:font-medium lui:leading-snug"><%= t("dropzone.default_message") %></p>
|
|
43
49
|
<% if @placeholder %>
|
|
44
|
-
<p class="lui:text-center lui:text-
|
|
50
|
+
<p class="lui:text-center lui:text-gray-400 lui:text-base lui:sm:text-sm/6 lui:font-normal lui:leading-4 lui:mt-1.5"><%= @placeholder %></p>
|
|
51
|
+
<% end %>
|
|
52
|
+
<% if @form %>
|
|
53
|
+
<%= @form.file_field(
|
|
54
|
+
@name,
|
|
55
|
+
multiple: @multiple,
|
|
56
|
+
class: "lui:hidden",
|
|
57
|
+
direct_upload: true,
|
|
58
|
+
data: input_data,
|
|
59
|
+
accept: @accept
|
|
60
|
+
) %>
|
|
61
|
+
<% else %>
|
|
62
|
+
<%= file_field_tag(
|
|
63
|
+
@name,
|
|
64
|
+
value: @value,
|
|
65
|
+
multiple: @multiple,
|
|
66
|
+
class: "lui:hidden",
|
|
67
|
+
direct_upload: true,
|
|
68
|
+
data: input_data,
|
|
69
|
+
accept: @accept
|
|
70
|
+
) %>
|
|
45
71
|
<% end %>
|
|
46
|
-
<%= render_file_input %>
|
|
47
72
|
</div>
|
|
48
73
|
|
|
49
74
|
<% if has_errors? %>
|
|
@@ -26,63 +26,36 @@ class LightningUiKit::DropzoneComponent < LightningUiKit::BaseComponent
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def input_data
|
|
29
|
-
(@options[:input_data] || {}).
|
|
29
|
+
(@options[:input_data] || {}).tap do |data|
|
|
30
30
|
data[:lui_dropzone_target] = "input"
|
|
31
31
|
data[:action] = "dragover->lui-dropzone#activate drop->lui-dropzone#uploadFiles change->lui-dropzone#uploadFiles"
|
|
32
|
-
|
|
32
|
+
if has_errors?
|
|
33
|
+
data[:invalid] = "true"
|
|
34
|
+
end
|
|
33
35
|
end
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
def label_data
|
|
37
|
-
{slot: "label"}.merge(@options[:label_data] || {}).
|
|
38
|
-
|
|
39
|
+
{slot: "label"}.merge(@options[:label_data] || {}).tap do |data|
|
|
40
|
+
if @disabled
|
|
41
|
+
data[:disabled] = "true"
|
|
42
|
+
end
|
|
39
43
|
end
|
|
40
44
|
end
|
|
41
45
|
|
|
42
46
|
def description_data
|
|
43
|
-
{slot: "description"}.merge(@options[:description_data] || {}).
|
|
44
|
-
|
|
47
|
+
{slot: "description"}.merge(@options[:description_data] || {}).tap do |data|
|
|
48
|
+
if @disabled
|
|
49
|
+
data[:disabled] = "true"
|
|
50
|
+
end
|
|
45
51
|
end
|
|
46
52
|
end
|
|
47
53
|
|
|
48
54
|
def error_data
|
|
49
|
-
{slot: "error"}.merge(@options[:error_data] || {}).
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def label_html_options
|
|
55
|
-
{
|
|
56
|
-
class: "lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
57
|
-
data: label_data
|
|
58
|
-
}
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def render_label
|
|
62
|
-
return unless @label
|
|
63
|
-
|
|
64
|
-
if @form
|
|
65
|
-
@form.label(@name, @label, **label_html_options)
|
|
66
|
-
else
|
|
67
|
-
helpers.label_tag(@name, @label, **label_html_options)
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def file_input_html_options
|
|
72
|
-
{
|
|
73
|
-
multiple: @multiple,
|
|
74
|
-
class: "lui:hidden",
|
|
75
|
-
direct_upload: true,
|
|
76
|
-
data: input_data,
|
|
77
|
-
accept: @accept
|
|
78
|
-
}
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
def render_file_input
|
|
82
|
-
if @form
|
|
83
|
-
@form.file_field(@name, **file_input_html_options)
|
|
84
|
-
else
|
|
85
|
-
helpers.file_field_tag(@name, value: @value, **file_input_html_options)
|
|
55
|
+
{slot: "error"}.merge(@options[:error_data] || {}).tap do |data|
|
|
56
|
+
if @disabled
|
|
57
|
+
data[:disabled] = "true"
|
|
58
|
+
end
|
|
86
59
|
end
|
|
87
60
|
end
|
|
88
61
|
end
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
<%= tag.div(class: classes, data:
|
|
2
|
-
|
|
1
|
+
<%= tag.div(class: classes, data:) do %>
|
|
2
|
+
<% if @label %>
|
|
3
|
+
<%= label_tag(
|
|
4
|
+
@name,
|
|
5
|
+
@label.is_a?(String) ? @label : nil,
|
|
6
|
+
class: "lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
7
|
+
data: label_data
|
|
8
|
+
) %>
|
|
9
|
+
<% end %>
|
|
3
10
|
<% if @description %>
|
|
4
11
|
<%= tag.p(
|
|
5
12
|
@description,
|
|
@@ -7,8 +14,31 @@
|
|
|
7
14
|
data: description_data
|
|
8
15
|
) %>
|
|
9
16
|
<% end %>
|
|
10
|
-
<span data-slot="control" class="
|
|
11
|
-
|
|
17
|
+
<span data-slot="control" class="lui:relative lui:block lui:w-full lui:before:absolute lui:before:inset-px lui:before:rounded-[calc(var(--radius-lg)-1px)] lui:before:bg-white lui:before:shadow-sm lui:after:pointer-events-none lui:after:absolute lui:after:inset-0 lui:after:rounded-lg lui:after:ring-transparent lui:after:ring-inset lui:sm:focus-within:after:ring-2 lui:sm:focus-within:after:ring-blue-500 lui:has-data-disabled:opacity-50 lui:has-data-disabled:before:bg-zinc-950/5 lui:has-data-disabled:before:shadow-none lui:has-data-invalid:before:shadow-red-500/10">
|
|
18
|
+
<% if @form %>
|
|
19
|
+
<%= @form.file_field(
|
|
20
|
+
@name,
|
|
21
|
+
data: input_data,
|
|
22
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:lui:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:data-disabled:hover:none lui:data-disabled:cursor-not-allowed lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500 lui:data-disabled:border-zinc-950/20",
|
|
23
|
+
disabled: @disabled,
|
|
24
|
+
autofocus: @autofocus,
|
|
25
|
+
multiple: @multiple,
|
|
26
|
+
accept: @accept,
|
|
27
|
+
placeholder: @placeholder
|
|
28
|
+
) %>
|
|
29
|
+
<% else %>
|
|
30
|
+
<%= file_field_tag(
|
|
31
|
+
@name,
|
|
32
|
+
value: @value,
|
|
33
|
+
data: input_data,
|
|
34
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500 lui:data-disabled:hover:none lui:data-disabled:cursor-not-allowed lui:data-disabled:border-zinc-950/20 lui:data-disabled:file:cursor-not-allowed lui:data-disabled:file:cursor-not-allowed lui:file:cursor-pointer lui:cursor-pointer lui:file:border-0 lui:file:px-[calc(--spacing(3.5)-1px)] lui:file:py-[calc(--spacing(2.5)-1px)] lui:file:sm:px-[calc(--spacing(3)-1px)] lui:file:sm:py-[calc(--spacing(1.5)-1px)] lui:file:mr-4 lui:file:bg-zinc-100",
|
|
35
|
+
disabled: @disabled,
|
|
36
|
+
autofocus: @autofocus,
|
|
37
|
+
multiple: @multiple,
|
|
38
|
+
accept: @accept,
|
|
39
|
+
placeholder: @placeholder
|
|
40
|
+
) %>
|
|
41
|
+
<% end %>
|
|
12
42
|
</span>
|
|
13
43
|
<% if has_errors? %>
|
|
14
44
|
<%= tag.p(
|
|
@@ -22,75 +22,41 @@ class LightningUiKit::FileInputComponent < LightningUiKit::BaseComponent
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def data
|
|
25
|
-
|
|
25
|
+
@options[:data] || {}
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def input_data
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
(@options[:input_data] || {}).tap do |data|
|
|
30
|
+
if @disabled
|
|
31
|
+
data[:disabled] = "true"
|
|
32
|
+
end
|
|
33
|
+
if has_errors?
|
|
34
|
+
data[:invalid] = "true"
|
|
35
|
+
end
|
|
32
36
|
end
|
|
33
37
|
end
|
|
34
38
|
|
|
35
39
|
def label_data
|
|
36
|
-
{slot: "label"}.merge(@options[:label_data] || {}).
|
|
37
|
-
|
|
40
|
+
{slot: "label"}.merge(@options[:label_data] || {}).tap do |data|
|
|
41
|
+
if @disabled
|
|
42
|
+
data[:disabled] = "true"
|
|
43
|
+
end
|
|
38
44
|
end
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
def description_data
|
|
42
|
-
{slot: "description"}.merge(@options[:description_data] || {}).
|
|
43
|
-
|
|
48
|
+
{slot: "description"}.merge(@options[:description_data] || {}).tap do |data|
|
|
49
|
+
if @disabled
|
|
50
|
+
data[:disabled] = "true"
|
|
51
|
+
end
|
|
44
52
|
end
|
|
45
53
|
end
|
|
46
54
|
|
|
47
55
|
def error_data
|
|
48
|
-
{slot: "error"}.merge(@options[:error_data] || {}).
|
|
49
|
-
|
|
56
|
+
{slot: "error"}.merge(@options[:error_data] || {}).tap do |data|
|
|
57
|
+
if @disabled
|
|
58
|
+
data[:disabled] = "true"
|
|
59
|
+
end
|
|
50
60
|
end
|
|
51
61
|
end
|
|
52
|
-
|
|
53
|
-
def label_html_options
|
|
54
|
-
{
|
|
55
|
-
class: "lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
56
|
-
data: label_data
|
|
57
|
-
}
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def render_label
|
|
61
|
-
return unless @label
|
|
62
|
-
|
|
63
|
-
if @form
|
|
64
|
-
@form.label(@name, @label, **label_html_options)
|
|
65
|
-
else
|
|
66
|
-
helpers.label_tag(@name, @label, **label_html_options)
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def file_input_classes
|
|
71
|
-
"lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:data-[hover]:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:data-[hover]:border-red-500 lui:data-disabled:cursor-not-allowed lui:data-disabled:border-zinc-950/20 lui:data-disabled:file:cursor-not-allowed lui:file:cursor-pointer lui:cursor-pointer lui:file:border-0 lui:file:px-[calc(--spacing(3.5)-1px)] lui:file:py-[calc(--spacing(2.5)-1px)] lui:file:sm:px-[calc(--spacing(3)-1px)] lui:file:sm:py-[calc(--spacing(1.5)-1px)] lui:file:mr-4 lui:file:bg-zinc-100 lui:file:rounded-l-[calc(var(--radius-lg)-1px)]"
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def file_input_html_options
|
|
75
|
-
{
|
|
76
|
-
data: input_data,
|
|
77
|
-
class: file_input_classes,
|
|
78
|
-
disabled: @disabled,
|
|
79
|
-
autofocus: @autofocus,
|
|
80
|
-
multiple: @multiple,
|
|
81
|
-
accept: @accept
|
|
82
|
-
}
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def render_file_input
|
|
86
|
-
if @form
|
|
87
|
-
@form.file_field(@name, **file_input_html_options)
|
|
88
|
-
else
|
|
89
|
-
helpers.file_field_tag(@name, value: @value, **file_input_html_options)
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def control_classes
|
|
94
|
-
"lui:relative lui:block lui:w-full lui:after:pointer-events-none lui:after:absolute lui:after:inset-0 lui:after:rounded-lg lui:after:ring-transparent lui:after:ring-inset lui:sm:focus-within:after:ring-2 lui:sm:focus-within:after:ring-blue-500 lui:has-data-disabled:opacity-50"
|
|
95
|
-
end
|
|
96
62
|
end
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
<%= tag.div(
|
|
2
|
-
|
|
1
|
+
<%= tag.div(
|
|
2
|
+
class: classes,
|
|
3
|
+
data:
|
|
4
|
+
) do %>
|
|
5
|
+
<% if @label %>
|
|
6
|
+
<%= tag.label(
|
|
7
|
+
@label,
|
|
8
|
+
class: "lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
9
|
+
data: label_data
|
|
10
|
+
) %>
|
|
11
|
+
<% end %>
|
|
3
12
|
<% if @description %>
|
|
4
13
|
<%= tag.p(
|
|
5
14
|
@description,
|
|
@@ -7,19 +16,94 @@
|
|
|
7
16
|
data: description_data
|
|
8
17
|
) %>
|
|
9
18
|
<% end %>
|
|
10
|
-
<% if @
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
<% if @form %>
|
|
20
|
+
<span data-slot="control" class="lui:relative lui:block lui:w-full lui:before:absolute lui:before:inset-px lui:before:rounded-[calc(var(--radius-lg)-1px)] lui:before:bg-white lui:before:shadow-sm lui:after:pointer-events-none lui:after:absolute lui:after:inset-0 lui:after:rounded-lg lui:after:ring-transparent lui:after:ring-inset lui:sm:focus-within:after:ring-2 lui:sm:focus-within:after:ring-blue-500 lui:has-data-disabled:opacity-50 lui:has-data-disabled:before:bg-zinc-950/5 lui:has-data-disabled:before:shadow-none lui:has-data-invalid:before:shadow-red-500/10">
|
|
21
|
+
<% case @type %>
|
|
22
|
+
<% when :text %>
|
|
23
|
+
<%= @form.text_field(
|
|
24
|
+
@name,
|
|
25
|
+
data: input_data,
|
|
26
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
27
|
+
disabled: @disabled,
|
|
28
|
+
autofocus: @autofocus,
|
|
29
|
+
placeholder: @placeholder
|
|
30
|
+
) %>
|
|
31
|
+
<% when :email %>
|
|
32
|
+
<%= @form.email_field(
|
|
33
|
+
@name,
|
|
34
|
+
data: input_data,
|
|
35
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
36
|
+
disabled: @disabled,
|
|
37
|
+
autofocus: @autofocus,
|
|
38
|
+
placeholder: @placeholder
|
|
39
|
+
) %>
|
|
40
|
+
<% when :password %>
|
|
41
|
+
<%= @form.password_field(
|
|
42
|
+
@name,
|
|
43
|
+
data: input_data,
|
|
44
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
45
|
+
disabled: @disabled,
|
|
46
|
+
autofocus: @autofocus,
|
|
47
|
+
placeholder: @placeholder
|
|
48
|
+
) %>
|
|
49
|
+
<% when :number %>
|
|
50
|
+
<%= @form.number_field(
|
|
51
|
+
@name,
|
|
52
|
+
data: input_data,
|
|
53
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
54
|
+
disabled: @disabled,
|
|
55
|
+
autofocus: @autofocus,
|
|
56
|
+
placeholder: @placeholder,
|
|
57
|
+
min: @options[:min],
|
|
58
|
+
max: @options[:max],
|
|
59
|
+
step: @options[:step]
|
|
60
|
+
) %>
|
|
61
|
+
<% end %>
|
|
19
62
|
</span>
|
|
20
|
-
<%
|
|
21
|
-
<span data-slot="control" class="
|
|
22
|
-
|
|
63
|
+
<% else %>
|
|
64
|
+
<span data-slot="control" class="lui:relative lui:block lui:w-full lui:before:absolute lui:before:inset-px lui:before:rounded-[calc(var(--radius-lg)-1px)] lui:before:bg-white lui:before:shadow-sm lui:after:pointer-events-none lui:after:absolute lui:after:inset-0 lui:after:rounded-lg lui:after:ring-transparent lui:after:ring-inset lui:sm:focus-within:after:ring-2 lui:sm:focus-within:after:ring-blue-500 lui:has-data-disabled:opacity-50 lui:has-data-disabled:before:bg-zinc-950/5 lui:has-data-disabled:before:shadow-none lui:has-data-invalid:before:shadow-red-500/10">
|
|
65
|
+
<% case @type %>
|
|
66
|
+
<% when :text %>
|
|
67
|
+
<%= text_field_tag(
|
|
68
|
+
@name,
|
|
69
|
+
@value,
|
|
70
|
+
data: input_data,
|
|
71
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
72
|
+
disabled: @disabled,
|
|
73
|
+
autofocus: @autofocus,
|
|
74
|
+
placeholder: @placeholder
|
|
75
|
+
) %>
|
|
76
|
+
<% when :email %>
|
|
77
|
+
<%= email_field_tag(
|
|
78
|
+
@name,
|
|
79
|
+
@value,
|
|
80
|
+
data: input_data,
|
|
81
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
82
|
+
disabled: @disabled,
|
|
83
|
+
autofocus: @autofocus,
|
|
84
|
+
placeholder: @placeholder
|
|
85
|
+
) %>
|
|
86
|
+
<% when :password %>
|
|
87
|
+
<%= password_field_tag(
|
|
88
|
+
@name,
|
|
89
|
+
@value,
|
|
90
|
+
data: input_data,
|
|
91
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
92
|
+
disabled: @disabled,
|
|
93
|
+
autofocus: @autofocus,
|
|
94
|
+
placeholder: @placeholder
|
|
95
|
+
) %>
|
|
96
|
+
<% when :number %>
|
|
97
|
+
<%= number_field_tag(
|
|
98
|
+
@name,
|
|
99
|
+
@value,
|
|
100
|
+
data: input_data,
|
|
101
|
+
class: "lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:hover:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:hover:border-red-500/60 lui:data-disabled:border-zinc-950/20",
|
|
102
|
+
disabled: @disabled,
|
|
103
|
+
autofocus: @autofocus,
|
|
104
|
+
placeholder: @placeholder,
|
|
105
|
+
) %>
|
|
106
|
+
<% end %>
|
|
23
107
|
</span>
|
|
24
108
|
<% end %>
|
|
25
109
|
<% if has_errors? %>
|
|
@@ -3,36 +3,17 @@
|
|
|
3
3
|
class LightningUiKit::InputComponent < LightningUiKit::BaseComponent
|
|
4
4
|
include LightningUiKit::Errors
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
text: :text_field,
|
|
8
|
-
email: :email_field,
|
|
9
|
-
password: :password_field,
|
|
10
|
-
number: :number_field,
|
|
11
|
-
date: :date_field,
|
|
12
|
-
datetime: :datetime_local_field,
|
|
13
|
-
datetime_local: :datetime_local_field,
|
|
14
|
-
month: :month_field,
|
|
15
|
-
week: :week_field,
|
|
16
|
-
time: :time_field,
|
|
17
|
-
url: :url_field,
|
|
18
|
-
search: :search_field,
|
|
19
|
-
telephone: :telephone_field,
|
|
20
|
-
phone: :telephone_field
|
|
21
|
-
}.freeze
|
|
22
|
-
|
|
23
|
-
STANDARD_INPUT_TYPES = INPUT_TYPES.keys.freeze
|
|
24
|
-
|
|
25
|
-
def initialize(name:, value: nil, label: nil, form: nil, type: :text, description: nil, disabled: false, placeholder: nil, error: nil, input_options: {}, **options)
|
|
6
|
+
def initialize(name:, value: nil, autofocus: false, label: nil, form: nil, type: :text, description: nil, disabled: false, placeholder: nil, error: nil, **options)
|
|
26
7
|
@name = name
|
|
27
8
|
@value = value
|
|
28
9
|
@disabled = disabled
|
|
10
|
+
@autofocus = autofocus
|
|
29
11
|
@error = error
|
|
30
12
|
@label = label
|
|
31
13
|
@form = form
|
|
32
14
|
@type = type
|
|
33
15
|
@description = description
|
|
34
16
|
@placeholder = placeholder
|
|
35
|
-
@input_options = input_options
|
|
36
17
|
@options = options
|
|
37
18
|
end
|
|
38
19
|
|
|
@@ -41,154 +22,38 @@ class LightningUiKit::InputComponent < LightningUiKit::BaseComponent
|
|
|
41
22
|
end
|
|
42
23
|
|
|
43
24
|
def data
|
|
44
|
-
|
|
25
|
+
@options[:data] || {}
|
|
45
26
|
end
|
|
46
27
|
|
|
47
28
|
def input_data
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
(@options[:input_data] || {}).tap do |data|
|
|
30
|
+
if has_errors?
|
|
31
|
+
data[:invalid] = "true"
|
|
32
|
+
end
|
|
50
33
|
end
|
|
51
34
|
end
|
|
52
35
|
|
|
53
36
|
def label_data
|
|
54
|
-
{slot: "label"}.merge(@options[:label_data] || {}).
|
|
55
|
-
|
|
37
|
+
{slot: "label"}.merge(@options[:label_data] || {}).tap do |data|
|
|
38
|
+
if @disabled
|
|
39
|
+
data[:disabled] = "true"
|
|
40
|
+
end
|
|
56
41
|
end
|
|
57
42
|
end
|
|
58
43
|
|
|
59
44
|
def description_data
|
|
60
|
-
{slot: "description"}.merge(@options[:description_data] || {}).
|
|
61
|
-
|
|
45
|
+
{slot: "description"}.merge(@options[:description_data] || {}).tap do |data|
|
|
46
|
+
if @disabled
|
|
47
|
+
data[:disabled] = "true"
|
|
48
|
+
end
|
|
62
49
|
end
|
|
63
50
|
end
|
|
64
51
|
|
|
65
52
|
def error_data
|
|
66
|
-
{slot: "error"}.merge(@options[:error_data] || {}).
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def input_classes
|
|
72
|
-
"lui:peer lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)] lui:text-base/6 lui:text-zinc-950 lui:placeholder:text-zinc-500 lui:sm:text-sm/6 lui:border lui:border-zinc-950/10 lui:data-[hover]:border-zinc-950/20 lui:bg-transparent lui:focus:outline-hidden lui:data-invalid:border-red-500 lui:data-invalid:data-[hover]:border-red-500/60 lui:data-disabled:border-zinc-950/20"
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def input_html_options
|
|
76
|
-
base_options = {
|
|
77
|
-
data: input_data,
|
|
78
|
-
class: input_classes,
|
|
79
|
-
disabled: @disabled,
|
|
80
|
-
placeholder: @placeholder
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
# Add type-specific options from **options (Rails convention)
|
|
84
|
-
case @type
|
|
85
|
-
when :number
|
|
86
|
-
base_options[:min] = @options[:min]
|
|
87
|
-
base_options[:max] = @options[:max]
|
|
88
|
-
base_options[:step] = @options[:step]
|
|
89
|
-
when :date, :datetime, :datetime_local, :month, :week, :time
|
|
90
|
-
base_options[:min] = @options[:min]
|
|
91
|
-
base_options[:max] = @options[:max]
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
base_options.merge(@input_options).compact
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
def range_html_options
|
|
98
|
-
{
|
|
99
|
-
data: input_data,
|
|
100
|
-
class: range_classes,
|
|
101
|
-
disabled: @disabled,
|
|
102
|
-
min: @options[:min],
|
|
103
|
-
max: @options[:max],
|
|
104
|
-
step: @options[:step]
|
|
105
|
-
}.merge(@input_options).compact
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def hidden_html_options
|
|
109
|
-
{data: input_data}.merge(@input_options).compact
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def color_html_options
|
|
113
|
-
{
|
|
114
|
-
data: {lui_field_target: "field"},
|
|
115
|
-
class: color_classes,
|
|
116
|
-
disabled: @disabled
|
|
117
|
-
}.merge(@input_options).compact
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
def color_classes
|
|
121
|
-
"lui:h-10 lui:w-14 lui:cursor-pointer lui:appearance-none lui:rounded-lg lui:border lui:border-zinc-950/10 lui:bg-transparent lui:p-1 " \
|
|
122
|
-
"lui:data-[hover]:border-zinc-950/20 lui:focus:outline-none lui:focus:ring-2 lui:focus:ring-blue-500 " \
|
|
123
|
-
"[&::-webkit-color-swatch-wrapper]:lui:p-0 [&::-webkit-color-swatch]:lui:rounded-md [&::-webkit-color-swatch]:lui:border-0 " \
|
|
124
|
-
"[&::-moz-color-swatch]:lui:rounded-md [&::-moz-color-swatch]:lui:border-0 " \
|
|
125
|
-
"lui:disabled:opacity-50 lui:disabled:cursor-not-allowed"
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
def range_classes
|
|
129
|
-
"lui:w-full lui:h-2 lui:appearance-none lui:cursor-pointer lui:bg-zinc-200 lui:rounded-full lui:focus:outline-none " \
|
|
130
|
-
"[&::-webkit-slider-thumb]:lui:appearance-none [&::-webkit-slider-thumb]:lui:w-4 [&::-webkit-slider-thumb]:lui:h-4 [&::-webkit-slider-thumb]:lui:bg-blue-600 [&::-webkit-slider-thumb]:lui:rounded-full [&::-webkit-slider-thumb]:lui:cursor-pointer [&::-webkit-slider-thumb]:lui:shadow-sm [&::-webkit-slider-thumb]:lui:transition-transform [&::-webkit-slider-thumb]:hover:lui:scale-110 " \
|
|
131
|
-
"[&::-moz-range-thumb]:lui:appearance-none [&::-moz-range-thumb]:lui:w-4 [&::-moz-range-thumb]:lui:h-4 [&::-moz-range-thumb]:lui:bg-blue-600 [&::-moz-range-thumb]:lui:rounded-full [&::-moz-range-thumb]:lui:border-0 [&::-moz-range-thumb]:lui:cursor-pointer [&::-moz-range-thumb]:lui:shadow-sm [&::-moz-range-thumb]:lui:transition-transform [&::-moz-range-thumb]:hover:lui:scale-110 " \
|
|
132
|
-
"[&::-moz-range-track]:lui:bg-zinc-200 [&::-moz-range-track]:lui:rounded-full " \
|
|
133
|
-
"lui:disabled:opacity-50 lui:disabled:cursor-not-allowed"
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
def label_html_options
|
|
137
|
-
{
|
|
138
|
-
class: "lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
139
|
-
data: label_data
|
|
140
|
-
}
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
def render_label
|
|
144
|
-
return unless @label
|
|
145
|
-
|
|
146
|
-
if @form
|
|
147
|
-
@form.label(@name, @label, **label_html_options)
|
|
148
|
-
else
|
|
149
|
-
helpers.label_tag(@name, @label, **label_html_options)
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
def control_classes
|
|
154
|
-
"lui:relative lui:block lui:w-full lui:before:pointer-events-none lui:before:absolute lui:before:inset-px lui:before:rounded-[7px] lui:before:bg-white lui:before:shadow-sm lui:after:pointer-events-none lui:after:absolute lui:after:inset-0 lui:after:rounded-lg lui:after:ring-transparent lui:after:ring-inset lui:sm:focus-within:after:ring-2 lui:sm:focus-within:after:ring-blue-500 lui:has-data-disabled:opacity-50 lui:has-data-disabled:before:bg-zinc-950/5 lui:has-data-disabled:before:shadow-none lui:has-data-invalid:before:shadow-red-500/10"
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
def standard_input_type?
|
|
158
|
-
STANDARD_INPUT_TYPES.include?(@type)
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
def render_input
|
|
162
|
-
method_name = INPUT_TYPES[@type]
|
|
163
|
-
if @form
|
|
164
|
-
@form.public_send(method_name, @name, **input_html_options)
|
|
165
|
-
else
|
|
166
|
-
tag_method = "#{method_name}_tag"
|
|
167
|
-
helpers.public_send(tag_method, @name, @value, **input_html_options)
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
def render_range_input
|
|
172
|
-
if @form
|
|
173
|
-
@form.range_field(@name, **range_html_options)
|
|
174
|
-
else
|
|
175
|
-
helpers.range_field_tag(@name, @value, **range_html_options)
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
def render_color_input
|
|
180
|
-
if @form
|
|
181
|
-
@form.color_field(@name, **color_html_options)
|
|
182
|
-
else
|
|
183
|
-
helpers.color_field_tag(@name, @value, **color_html_options)
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
def render_hidden_input
|
|
188
|
-
if @form
|
|
189
|
-
@form.hidden_field(@name, **hidden_html_options)
|
|
190
|
-
else
|
|
191
|
-
helpers.hidden_field_tag(@name, @value, **hidden_html_options)
|
|
53
|
+
{slot: "error"}.merge(@options[:error_data] || {}).tap do |data|
|
|
54
|
+
if @disabled
|
|
55
|
+
data[:disabled] = "true"
|
|
56
|
+
end
|
|
192
57
|
end
|
|
193
58
|
end
|
|
194
59
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<%= tag.dialog(id: @id, open: @open, data:) do %>
|
|
2
2
|
<div class="lui:fixed lui:inset-0 lui:flex lui:w-screen lui:justify-center lui:overflow-y-auto lui:bg-zinc-950/25 lui:px-2 lui:py-2 lui:transition lui:duration-100 lui:focus:outline-0 lui:data-closed:opacity-0 lui:data-enter:ease-out lui:data-leave:ease-in lui:sm:px-6 lui:sm:py-8 lg:lui:px-8 lg:lui:py-16" aria-hidden="true" data-open=""></div>
|
|
3
3
|
<div class="lui:fixed lui:inset-0 lui:w-screen lui:overflow-y-auto lui:pt-6 lui:sm:pt-0">
|
|
4
|
-
<div class="lui:grid lui:min-h-full lui:grid-rows-[1fr_auto] lui:justify-items-center lui:sm:grid-rows-[1fr_auto_3fr] lui:sm:p-4"
|
|
5
|
-
<div class="lui:sm:max-w-3xl lui:row-start-2 lui:w-full lui:min-w-0 lui:rounded-t-3xl lui:bg-white lui:p-(--gutter) lui:ring-1 lui:shadow-lg lui:ring-zinc-950/10 lui:[--gutter:--spacing(8)] lui:sm:mb-auto lui:sm:rounded-2xl lui:forced-colors:outline lui:transition lui:duration-100 lui:will-change-transform lui:data-closed:translate-y-12 lui:data-closed:opacity-0 lui:data-enter:ease-out lui:data-leave:ease-in lui:sm:data-closed:translate-y-0 lui:sm:data-closed:data-enter:scale-95" data-open=""
|
|
4
|
+
<div class="lui:grid lui:min-h-full lui:grid-rows-[1fr_auto] lui:justify-items-center lui:sm:grid-rows-[1fr_auto_3fr] lui:sm:p-4">
|
|
5
|
+
<div class="lui:sm:max-w-3xl lui:row-start-2 lui:w-full lui:min-w-0 lui:rounded-t-3xl lui:bg-white lui:p-(--gutter) lui:ring-1 lui:shadow-lg lui:ring-zinc-950/10 lui:[--gutter:--spacing(8)] lui:sm:mb-auto lui:sm:rounded-2xl lui:forced-colors:outline lui:transition lui:duration-100 lui:will-change-transform lui:data-closed:translate-y-12 lui:data-closed:opacity-0 lui:data-enter:ease-out lui:data-leave:ease-in lui:sm:data-closed:translate-y-0 lui:sm:data-closed:data-enter:scale-95" data-open="">
|
|
6
6
|
<% if @title %>
|
|
7
7
|
<h2 class="lui:text-lg/6 lui:font-semibold lui:text-balance lui:text-zinc-950 lui:sm:text-base/6" data-open="">
|
|
8
8
|
<%= @title %>
|