lightning_ui_kit 0.1.3 → 0.2.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/app/assets/builds/lightning_ui_kit.css +1079 -1484
- data/app/assets/builds/lightning_ui_kit.js +2 -2
- data/app/assets/builds/lightning_ui_kit.js.map +3 -3
- data/app/assets/stylesheets/lightning_ui_kit/application.css +1 -1
- data/app/assets/vendor/lightning_ui_kit.css +2627 -0
- data/app/assets/vendor/lightning_ui_kit.js +5 -0
- data/app/components/lightning_ui_kit/alert_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/alert_component.rb +1 -1
- data/app/components/lightning_ui_kit/avatar_component.html.erb +5 -5
- data/app/components/lightning_ui_kit/avatar_component.rb +3 -3
- data/app/components/lightning_ui_kit/badge_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/badge_component.rb +19 -19
- data/app/components/lightning_ui_kit/banner_component.html.erb +6 -6
- data/app/components/lightning_ui_kit/banner_component.rb +3 -3
- data/app/components/lightning_ui_kit/button_component.rb +29 -28
- data/app/components/lightning_ui_kit/checkbox_component.html.erb +29 -8
- data/app/components/lightning_ui_kit/description_list/item_component.html.erb +3 -3
- data/app/components/lightning_ui_kit/description_list_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/dropdown_component.html.erb +5 -5
- data/app/components/lightning_ui_kit/dropdown_component.rb +3 -3
- data/app/components/lightning_ui_kit/dropzone_component.html.erb +22 -22
- data/app/components/lightning_ui_kit/dropzone_component.rb +1 -1
- data/app/components/lightning_ui_kit/file_input_component.html.erb +6 -6
- data/app/components/lightning_ui_kit/file_input_component.rb +1 -1
- data/app/components/lightning_ui_kit/input_component.html.erb +30 -20
- data/app/components/lightning_ui_kit/input_component.rb +1 -1
- data/app/components/lightning_ui_kit/link_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/modal_component.html.erb +7 -7
- data/app/components/lightning_ui_kit/pagination_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/pagination_component.rb +5 -4
- data/app/components/lightning_ui_kit/select_component.html.erb +14 -9
- data/app/components/lightning_ui_kit/skeleton_component.html.erb +4 -4
- data/app/components/lightning_ui_kit/spinner_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/switch_component.html.erb +27 -12
- data/app/components/lightning_ui_kit/table_component.html.erb +10 -10
- data/app/components/lightning_ui_kit/text_component.rb +1 -1
- data/app/components/lightning_ui_kit/textarea_component.html.erb +10 -8
- data/app/javascript/lightning_ui_kit/controllers/accordion_controller.js +22 -17
- data/app/javascript/lightning_ui_kit/controllers/banner_controller.js +3 -3
- data/app/javascript/lightning_ui_kit/controllers/dropdown_controller.js +2 -1
- data/app/javascript/lightning_ui_kit/controllers/dropzone_controller.js +5 -2
- data/lib/lightning_ui_kit/version.rb +1 -1
- metadata +4 -2
@@ -7,6 +7,6 @@ class LightningUiKit::TextComponent < LightningUiKit::BaseComponent
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def classes
|
10
|
-
merge_classes(["text-zinc-600 text-#{@size}", @options[:class]].compact.join(" "))
|
10
|
+
merge_classes(["lui:text-zinc-600 lui:text-#{@size}", @options[:class]].compact.join(" "))
|
11
11
|
end
|
12
12
|
end
|
@@ -1,23 +1,25 @@
|
|
1
1
|
<%= tag.div(
|
2
|
-
class: "[&>[data-slot=label]+[data-slot=control]]:mt-3 [&>[data-slot=label]+[data-slot=description]]:mt-1
|
2
|
+
class: "lui:[&>[data-slot=label]+[data-slot=control]]:mt-3 lui:[&>[data-slot=label]+[data-slot=description]]:mt-1
|
3
|
+
lui:[&>[data-slot=description]+[data-slot=control]]:mt-3 lui:[&>[data-slot=control]+[data-slot=description]]:mt-3
|
4
|
+
lui:[&>[data-slot=control]+[data-slot=error]]:mt-3 lui:*:data-[slot=label]:font-medium",
|
3
5
|
data:
|
4
6
|
) do %>
|
5
7
|
<% if @label %>
|
6
8
|
<%= tag.label(
|
7
9
|
@label,
|
8
|
-
class: "text-base/6 text-zinc-950 select-none data-disabled:opacity-50 sm:text-sm/6",
|
10
|
+
class: "lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
9
11
|
data: label_data
|
10
12
|
) %>
|
11
13
|
<% end %>
|
12
14
|
<% if @description %>
|
13
15
|
<%= tag.p(
|
14
16
|
@description,
|
15
|
-
class: "text-base/6 text-zinc-500 data-disabled:opacity-50 sm:text-sm/6",
|
17
|
+
class: "lui:text-base/6 lui:text-zinc-500 lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
16
18
|
data: description_data
|
17
19
|
) %>
|
18
20
|
<% end %>
|
19
21
|
<% if @form %>
|
20
|
-
<span data-slot="control" class="relative block w-full before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm
|
22
|
+
<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
23
|
<%= @form.text_area(
|
22
24
|
@name,
|
23
25
|
value: @value,
|
@@ -25,13 +27,13 @@
|
|
25
27
|
cols: @cols,
|
26
28
|
multiple: @multiple,
|
27
29
|
data: input_data,
|
28
|
-
class: "relative block w-full appearance-none rounded-lg px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)] text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 border border-zinc-950/10 hover:border-zinc-950/20 bg-transparent focus:outline-hidden
|
30
|
+
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 lui:data-disabled:border-zinc-950/20",
|
29
31
|
disabled: @disabled,
|
30
32
|
autofocus: @autofocus
|
31
33
|
) %>
|
32
34
|
</span>
|
33
35
|
<% else %>
|
34
|
-
<span data-slot="control" class="relative block w-full before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm
|
36
|
+
<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">
|
35
37
|
<%= text_area_tag(
|
36
38
|
@name,
|
37
39
|
@value,
|
@@ -39,7 +41,7 @@
|
|
39
41
|
cols: @cols,
|
40
42
|
multiple: @multiple,
|
41
43
|
data: input_data,
|
42
|
-
class: "relative block w-full appearance-none rounded-lg px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)] text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 border border-zinc-950/10 hover:border-zinc-950/20 bg-transparent focus:outline-hidden
|
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 lui:data-disabled:border-zinc-950/20",
|
43
45
|
disabled: @disabled,
|
44
46
|
autofocus: @autofocus
|
45
47
|
) %>
|
@@ -48,7 +50,7 @@
|
|
48
50
|
<% if has_errors? %>
|
49
51
|
<%= tag.p(
|
50
52
|
error_messages,
|
51
|
-
class: "text-base/6 text-red-600 data-disabled:opacity-50 sm:text-sm/6",
|
53
|
+
class: "lui:text-base/6 lui:text-red-600 lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
52
54
|
data: error_data
|
53
55
|
) %>
|
54
56
|
<% end %>
|
@@ -2,9 +2,14 @@ import { Controller } from "@hotwired/stimulus";
|
|
2
2
|
|
3
3
|
export default class extends Controller {
|
4
4
|
static targets = ["content", "item"];
|
5
|
+
static values = {
|
6
|
+
openFirst: { type: Boolean, default: true }
|
7
|
+
};
|
5
8
|
|
6
9
|
connect() {
|
7
|
-
|
10
|
+
if (this.openFirstValue) {
|
11
|
+
this.openItem(this.itemTargets[0]);
|
12
|
+
}
|
8
13
|
}
|
9
14
|
|
10
15
|
toggle(e) {
|
@@ -24,28 +29,28 @@ export default class extends Controller {
|
|
24
29
|
}
|
25
30
|
|
26
31
|
openItem(item) {
|
27
|
-
const content = item.querySelector("[data-accordion-target=content]");
|
28
|
-
content.classList.remove("grid-rows-[0fr]");
|
29
|
-
content.classList.add("grid-rows-[1fr]");
|
30
|
-
content.classList.remove("opacity-0");
|
31
|
-
content.classList.add("opacity-100");
|
32
|
-
const arrow = item.querySelector("[data-accordion-target=arrow]");
|
33
|
-
arrow.classList.add("rotate-180");
|
32
|
+
const content = item.querySelector("[data-lui-accordion-target=content]");
|
33
|
+
content.classList.remove("lui:grid-rows-[0fr]");
|
34
|
+
content.classList.add("lui:grid-rows-[1fr]");
|
35
|
+
content.classList.remove("lui:opacity-0");
|
36
|
+
content.classList.add("lui:opacity-100");
|
37
|
+
const arrow = item.querySelector("[data-lui-accordion-target=arrow]");
|
38
|
+
arrow.classList.add("lui:rotate-180");
|
34
39
|
}
|
35
40
|
|
36
41
|
closeItem(item) {
|
37
|
-
const content = item.querySelector("[data-accordion-target=content]");
|
38
|
-
content.classList.remove("grid-rows-[1fr]");
|
39
|
-
content.classList.add("grid-rows-[0fr]");
|
40
|
-
content.classList.remove("opacity-100");
|
41
|
-
content.classList.add("opacity-0");
|
42
|
-
const arrow = item.querySelector("[data-accordion-target=arrow]");
|
43
|
-
arrow.classList.remove("rotate-180");
|
42
|
+
const content = item.querySelector("[data-lui-accordion-target=content]");
|
43
|
+
content.classList.remove("lui:grid-rows-[1fr]");
|
44
|
+
content.classList.add("lui:grid-rows-[0fr]");
|
45
|
+
content.classList.remove("lui:opacity-100");
|
46
|
+
content.classList.add("lui:opacity-0");
|
47
|
+
const arrow = item.querySelector("[data-lui-accordion-target=arrow]");
|
48
|
+
arrow.classList.remove("lui:rotate-180");
|
44
49
|
}
|
45
50
|
|
46
51
|
isOpen(item) {
|
47
|
-
const content = item.querySelector("[data-accordion-target=content]");
|
48
|
-
return content.classList.contains("grid-rows-[1fr]");
|
52
|
+
const content = item.querySelector("[data-lui-accordion-target=content]");
|
53
|
+
return content.classList.contains("lui:grid-rows-[1fr]");
|
49
54
|
}
|
50
55
|
}
|
51
56
|
|
@@ -2,10 +2,10 @@ import { Controller } from "@hotwired/stimulus"
|
|
2
2
|
|
3
3
|
export default class extends Controller {
|
4
4
|
close() {
|
5
|
-
this.element.classList.remove("opacity-100");
|
6
|
-
this.element.classList.add("opacity-0");
|
5
|
+
this.element.classList.remove("lui:opacity-100");
|
6
|
+
this.element.classList.add("lui:opacity-0");
|
7
7
|
setTimeout(() => {
|
8
|
-
this.element.classList.add("hidden");
|
8
|
+
this.element.classList.add("lui:hidden");
|
9
9
|
}, 300);
|
10
10
|
}
|
11
11
|
}
|
@@ -7,6 +7,7 @@ export default class Dropdown extends Controller {
|
|
7
7
|
connect() {
|
8
8
|
useTransition(this, {
|
9
9
|
element: this.menuTarget,
|
10
|
+
hiddenClass: "lui:hidden"
|
10
11
|
});
|
11
12
|
}
|
12
13
|
|
@@ -15,7 +16,7 @@ export default class Dropdown extends Controller {
|
|
15
16
|
}
|
16
17
|
|
17
18
|
hide(event) {
|
18
|
-
if (!this.element.contains(event.target) && !this.menuTarget.classList.contains("hidden")) {
|
19
|
+
if (!this.element.contains(event.target) && !this.menuTarget.classList.contains("lui:hidden")) {
|
19
20
|
this.leave();
|
20
21
|
}
|
21
22
|
}
|
@@ -21,8 +21,11 @@ class Upload {
|
|
21
21
|
const hiddenField = document.createElement('input')
|
22
22
|
hiddenField.setAttribute("type", "hidden");
|
23
23
|
hiddenField.setAttribute("value", blob.signed_id);
|
24
|
-
hiddenField.name = this.controller.inputTarget.name
|
25
|
-
this.controller.filesTarget
|
24
|
+
hiddenField.name = this.controller.inputTarget.name;
|
25
|
+
this.controller.filesTarget
|
26
|
+
.querySelector(`#upload_${this.directUpload.id}`)
|
27
|
+
.appendChild(hiddenField);
|
28
|
+
this.controller.inputTarget.value = "";
|
26
29
|
}
|
27
30
|
});
|
28
31
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lightning_ui_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Koval
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,6 +108,8 @@ files:
|
|
108
108
|
- app/assets/builds/lightning_ui_kit.js
|
109
109
|
- app/assets/builds/lightning_ui_kit.js.map
|
110
110
|
- app/assets/stylesheets/lightning_ui_kit/application.css
|
111
|
+
- app/assets/vendor/lightning_ui_kit.css
|
112
|
+
- app/assets/vendor/lightning_ui_kit.js
|
111
113
|
- app/components/lightning_ui_kit/alert_component.html.erb
|
112
114
|
- app/components/lightning_ui_kit/alert_component.rb
|
113
115
|
- app/components/lightning_ui_kit/avatar_component.html.erb
|