lightning_ui_kit 0.1.4 → 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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/lightning_ui_kit.css +1048 -2821
  3. data/app/assets/builds/lightning_ui_kit.js +1 -1
  4. data/app/assets/builds/lightning_ui_kit.js.map +3 -3
  5. data/app/assets/stylesheets/lightning_ui_kit/application.css +1 -1
  6. data/app/assets/vendor/lightning_ui_kit.css +1063 -1319
  7. data/app/assets/vendor/lightning_ui_kit.js +1 -1
  8. data/app/components/lightning_ui_kit/alert_component.html.erb +1 -1
  9. data/app/components/lightning_ui_kit/alert_component.rb +1 -1
  10. data/app/components/lightning_ui_kit/avatar_component.html.erb +5 -5
  11. data/app/components/lightning_ui_kit/avatar_component.rb +3 -3
  12. data/app/components/lightning_ui_kit/badge_component.html.erb +1 -1
  13. data/app/components/lightning_ui_kit/badge_component.rb +19 -19
  14. data/app/components/lightning_ui_kit/banner_component.html.erb +6 -6
  15. data/app/components/lightning_ui_kit/banner_component.rb +3 -3
  16. data/app/components/lightning_ui_kit/button_component.rb +29 -28
  17. data/app/components/lightning_ui_kit/checkbox_component.html.erb +29 -8
  18. data/app/components/lightning_ui_kit/description_list/item_component.html.erb +3 -3
  19. data/app/components/lightning_ui_kit/description_list_component.html.erb +1 -1
  20. data/app/components/lightning_ui_kit/dropdown_component.html.erb +5 -5
  21. data/app/components/lightning_ui_kit/dropdown_component.rb +3 -3
  22. data/app/components/lightning_ui_kit/dropzone_component.html.erb +22 -22
  23. data/app/components/lightning_ui_kit/dropzone_component.rb +1 -1
  24. data/app/components/lightning_ui_kit/file_input_component.html.erb +6 -6
  25. data/app/components/lightning_ui_kit/file_input_component.rb +1 -1
  26. data/app/components/lightning_ui_kit/input_component.html.erb +13 -13
  27. data/app/components/lightning_ui_kit/input_component.rb +1 -1
  28. data/app/components/lightning_ui_kit/link_component.html.erb +1 -1
  29. data/app/components/lightning_ui_kit/modal_component.html.erb +7 -7
  30. data/app/components/lightning_ui_kit/pagination_component.html.erb +2 -2
  31. data/app/components/lightning_ui_kit/pagination_component.rb +5 -4
  32. data/app/components/lightning_ui_kit/select_component.html.erb +14 -9
  33. data/app/components/lightning_ui_kit/skeleton_component.html.erb +4 -4
  34. data/app/components/lightning_ui_kit/spinner_component.html.erb +1 -1
  35. data/app/components/lightning_ui_kit/switch_component.html.erb +21 -6
  36. data/app/components/lightning_ui_kit/table_component.html.erb +10 -10
  37. data/app/components/lightning_ui_kit/text_component.rb +1 -1
  38. data/app/components/lightning_ui_kit/textarea_component.html.erb +10 -8
  39. data/app/javascript/lightning_ui_kit/controllers/accordion_controller.js +11 -11
  40. data/app/javascript/lightning_ui_kit/controllers/banner_controller.js +3 -3
  41. data/app/javascript/lightning_ui_kit/controllers/dropdown_controller.js +2 -1
  42. data/lib/lightning_ui_kit/version.rb +1 -1
  43. metadata +2 -2
@@ -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 [&>[data-slot=description]+[data-slot=control]]:mt-3 [&>[data-slot=control]+[data-slot=description]]:mt-3 [&>[data-slot=control]+[data-slot=error]]:mt-3 *:data-[slot=label]:font-medium",
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 after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-transparent after:ring-inset sm:focus-within:after:ring-2 sm:focus-within:after:ring-blue-500 has-data-disabled:opacity-50 has-data-disabled:before:bg-zinc-950/5 has-data-disabled:before:shadow-none has-data-invalid:before:shadow-red-500/10">
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 data-invalid:border-red-500 data-invalid:hover:border-red-500 data-disabled:border-zinc-950/20",
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 after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-transparent after:ring-inset sm:focus-within:after:ring-2 sm:focus-within:after:ring-blue-500 has-data-disabled:opacity-50 has-data-disabled:before:bg-zinc-950/5 has-data-disabled:before:shadow-none has-data-invalid:before:shadow-red-500/10">
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 data-invalid:border-red-500 data-invalid:hover:border-red-500 data-disabled:border-zinc-950/20",
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 %>
@@ -30,27 +30,27 @@ export default class extends Controller {
30
30
 
31
31
  openItem(item) {
32
32
  const content = item.querySelector("[data-lui-accordion-target=content]");
33
- content.classList.remove("grid-rows-[0fr]");
34
- content.classList.add("grid-rows-[1fr]");
35
- content.classList.remove("opacity-0");
36
- content.classList.add("opacity-100");
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
37
  const arrow = item.querySelector("[data-lui-accordion-target=arrow]");
38
- arrow.classList.add("rotate-180");
38
+ arrow.classList.add("lui:rotate-180");
39
39
  }
40
40
 
41
41
  closeItem(item) {
42
42
  const content = item.querySelector("[data-lui-accordion-target=content]");
43
- content.classList.remove("grid-rows-[1fr]");
44
- content.classList.add("grid-rows-[0fr]");
45
- content.classList.remove("opacity-100");
46
- content.classList.add("opacity-0");
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
47
  const arrow = item.querySelector("[data-lui-accordion-target=arrow]");
48
- arrow.classList.remove("rotate-180");
48
+ arrow.classList.remove("lui:rotate-180");
49
49
  }
50
50
 
51
51
  isOpen(item) {
52
52
  const content = item.querySelector("[data-lui-accordion-target=content]");
53
- return content.classList.contains("grid-rows-[1fr]");
53
+ return content.classList.contains("lui:grid-rows-[1fr]");
54
54
  }
55
55
  }
56
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
  }
@@ -1,3 +1,3 @@
1
1
  module LightningUiKit
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.4
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-04-06 00:00:00.000000000 Z
11
+ date: 2025-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails