lightning_ui_kit 0.3.3 → 0.3.4
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 +2 -2
- data/app/assets/stylesheets/lightning_ui_kit/application.css +1 -0
- data/app/assets/stylesheets/lightning_ui_kit/themes.css +15 -2
- data/app/assets/vendor/lightning_ui_kit.css +404 -68
- data/app/assets/vendor/lightning_ui_kit.js +3 -3
- data/app/components/lightning_ui_kit/accordion/item_component.html.erb +30 -0
- data/app/components/lightning_ui_kit/accordion/item_component.rb +13 -0
- data/app/components/lightning_ui_kit/accordion_component.html.erb +5 -0
- data/app/components/lightning_ui_kit/accordion_component.rb +22 -0
- data/app/components/lightning_ui_kit/alert_component.html.erb +14 -3
- data/app/components/lightning_ui_kit/alert_component.rb +58 -5
- data/app/components/lightning_ui_kit/card_component.html.erb +34 -0
- data/app/components/lightning_ui_kit/card_component.rb +22 -0
- data/app/components/lightning_ui_kit/layout_component.html.erb +3 -3
- data/app/components/lightning_ui_kit/radio_group/option_component.html.erb +1 -0
- data/app/components/lightning_ui_kit/radio_group/option_component.rb +14 -0
- data/app/components/lightning_ui_kit/radio_group_component.html.erb +60 -0
- data/app/components/lightning_ui_kit/radio_group_component.rb +70 -0
- data/app/components/lightning_ui_kit/tabs/tab_component.html.erb +1 -0
- data/app/components/lightning_ui_kit/tabs/tab_component.rb +8 -0
- data/app/components/lightning_ui_kit/tabs_component.html.erb +30 -0
- data/app/components/lightning_ui_kit/tabs_component.rb +65 -0
- data/app/javascript/lightning_ui_kit/controllers/radio_group_controller.js +74 -0
- data/app/javascript/lightning_ui_kit/controllers/tabs_controller.js +77 -0
- data/app/javascript/lightning_ui_kit/index.js +6 -2
- data/lib/lightning_ui_kit/builder.rb +16 -4
- data/lib/lightning_ui_kit/version.rb +1 -1
- metadata +18 -4
- data/app/components/lightning_ui_kit/banner_component.html.erb +0 -17
- data/app/components/lightning_ui_kit/banner_component.rb +0 -33
- /data/app/javascript/lightning_ui_kit/controllers/{banner_controller.js → alert_controller.js} +0 -0
|
@@ -4,6 +4,10 @@ module LightningUiKit
|
|
|
4
4
|
@view_context = view_context
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
+
def accordion(*, **, &block)
|
|
8
|
+
render(AccordionComponent.new(*, **), &block)
|
|
9
|
+
end
|
|
10
|
+
|
|
7
11
|
def alert(*, **, &block)
|
|
8
12
|
render(AlertComponent.new(*, **), &block)
|
|
9
13
|
end
|
|
@@ -16,14 +20,14 @@ module LightningUiKit
|
|
|
16
20
|
render(BadgeComponent.new(*, **), &block)
|
|
17
21
|
end
|
|
18
22
|
|
|
19
|
-
def banner(*, **, &block)
|
|
20
|
-
render(BannerComponent.new(*, **), &block)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
23
|
def button(*, **, &block)
|
|
24
24
|
render(ButtonComponent.new(*, **), &block)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
def card(*, **, &block)
|
|
28
|
+
render(CardComponent.new(*, **), &block)
|
|
29
|
+
end
|
|
30
|
+
|
|
27
31
|
def checkbox(*, **, &block)
|
|
28
32
|
render(CheckboxComponent.new(*, **), &block)
|
|
29
33
|
end
|
|
@@ -68,6 +72,10 @@ module LightningUiKit
|
|
|
68
72
|
render(PaginationComponent.new(*, **), &block)
|
|
69
73
|
end
|
|
70
74
|
|
|
75
|
+
def radio_group(*, **, &block)
|
|
76
|
+
render(RadioGroupComponent.new(*, **), &block)
|
|
77
|
+
end
|
|
78
|
+
|
|
71
79
|
def select(*, **, &block)
|
|
72
80
|
render(SelectComponent.new(*, **), &block)
|
|
73
81
|
end
|
|
@@ -100,6 +108,10 @@ module LightningUiKit
|
|
|
100
108
|
render(TableComponent.new(*, **), &block)
|
|
101
109
|
end
|
|
102
110
|
|
|
111
|
+
def tabs(*, **, &block)
|
|
112
|
+
render(TabsComponent.new(*, **), &block)
|
|
113
|
+
end
|
|
114
|
+
|
|
103
115
|
def text(*, **, &block)
|
|
104
116
|
render(TextComponent.new(*, **), &block)
|
|
105
117
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lightning_ui_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Koval
|
|
@@ -93,17 +93,21 @@ files:
|
|
|
93
93
|
- app/assets/stylesheets/lightning_ui_kit/themes.css
|
|
94
94
|
- app/assets/vendor/lightning_ui_kit.css
|
|
95
95
|
- app/assets/vendor/lightning_ui_kit.js
|
|
96
|
+
- app/components/lightning_ui_kit/accordion/item_component.html.erb
|
|
97
|
+
- app/components/lightning_ui_kit/accordion/item_component.rb
|
|
98
|
+
- app/components/lightning_ui_kit/accordion_component.html.erb
|
|
99
|
+
- app/components/lightning_ui_kit/accordion_component.rb
|
|
96
100
|
- app/components/lightning_ui_kit/alert_component.html.erb
|
|
97
101
|
- app/components/lightning_ui_kit/alert_component.rb
|
|
98
102
|
- app/components/lightning_ui_kit/avatar_component.html.erb
|
|
99
103
|
- app/components/lightning_ui_kit/avatar_component.rb
|
|
100
104
|
- app/components/lightning_ui_kit/badge_component.html.erb
|
|
101
105
|
- app/components/lightning_ui_kit/badge_component.rb
|
|
102
|
-
- app/components/lightning_ui_kit/banner_component.html.erb
|
|
103
|
-
- app/components/lightning_ui_kit/banner_component.rb
|
|
104
106
|
- app/components/lightning_ui_kit/base_component.rb
|
|
105
107
|
- app/components/lightning_ui_kit/button_component.html.erb
|
|
106
108
|
- app/components/lightning_ui_kit/button_component.rb
|
|
109
|
+
- app/components/lightning_ui_kit/card_component.html.erb
|
|
110
|
+
- app/components/lightning_ui_kit/card_component.rb
|
|
107
111
|
- app/components/lightning_ui_kit/checkbox_component.html.erb
|
|
108
112
|
- app/components/lightning_ui_kit/checkbox_component.rb
|
|
109
113
|
- app/components/lightning_ui_kit/combobox_component.html.erb
|
|
@@ -131,6 +135,10 @@ files:
|
|
|
131
135
|
- app/components/lightning_ui_kit/modal_component.rb
|
|
132
136
|
- app/components/lightning_ui_kit/pagination_component.html.erb
|
|
133
137
|
- app/components/lightning_ui_kit/pagination_component.rb
|
|
138
|
+
- app/components/lightning_ui_kit/radio_group/option_component.html.erb
|
|
139
|
+
- app/components/lightning_ui_kit/radio_group/option_component.rb
|
|
140
|
+
- app/components/lightning_ui_kit/radio_group_component.html.erb
|
|
141
|
+
- app/components/lightning_ui_kit/radio_group_component.rb
|
|
134
142
|
- app/components/lightning_ui_kit/select_component.html.erb
|
|
135
143
|
- app/components/lightning_ui_kit/select_component.rb
|
|
136
144
|
- app/components/lightning_ui_kit/sidebar_component.html.erb
|
|
@@ -149,6 +157,10 @@ files:
|
|
|
149
157
|
- app/components/lightning_ui_kit/table/column_component.rb
|
|
150
158
|
- app/components/lightning_ui_kit/table_component.html.erb
|
|
151
159
|
- app/components/lightning_ui_kit/table_component.rb
|
|
160
|
+
- app/components/lightning_ui_kit/tabs/tab_component.html.erb
|
|
161
|
+
- app/components/lightning_ui_kit/tabs/tab_component.rb
|
|
162
|
+
- app/components/lightning_ui_kit/tabs_component.html.erb
|
|
163
|
+
- app/components/lightning_ui_kit/tabs_component.rb
|
|
152
164
|
- app/components/lightning_ui_kit/text_component.html.erb
|
|
153
165
|
- app/components/lightning_ui_kit/text_component.rb
|
|
154
166
|
- app/components/lightning_ui_kit/textarea_component.html.erb
|
|
@@ -161,7 +173,7 @@ files:
|
|
|
161
173
|
- app/helpers/lightning_ui_kit/component_helper.rb
|
|
162
174
|
- app/helpers/lightning_ui_kit/heroicon_helper.rb
|
|
163
175
|
- app/javascript/lightning_ui_kit/controllers/accordion_controller.js
|
|
164
|
-
- app/javascript/lightning_ui_kit/controllers/
|
|
176
|
+
- app/javascript/lightning_ui_kit/controllers/alert_controller.js
|
|
165
177
|
- app/javascript/lightning_ui_kit/controllers/checkbox_controller.js
|
|
166
178
|
- app/javascript/lightning_ui_kit/controllers/clipboard_controller.js
|
|
167
179
|
- app/javascript/lightning_ui_kit/controllers/combobox_controller.js
|
|
@@ -171,8 +183,10 @@ files:
|
|
|
171
183
|
- app/javascript/lightning_ui_kit/controllers/layout_controller.js
|
|
172
184
|
- app/javascript/lightning_ui_kit/controllers/main_controller.js
|
|
173
185
|
- app/javascript/lightning_ui_kit/controllers/modal_controller.js
|
|
186
|
+
- app/javascript/lightning_ui_kit/controllers/radio_group_controller.js
|
|
174
187
|
- app/javascript/lightning_ui_kit/controllers/reveal_controller.js
|
|
175
188
|
- app/javascript/lightning_ui_kit/controllers/switch_controller.js
|
|
189
|
+
- app/javascript/lightning_ui_kit/controllers/tabs_controller.js
|
|
176
190
|
- app/javascript/lightning_ui_kit/controllers/toast_controller.js
|
|
177
191
|
- app/javascript/lightning_ui_kit/controllers/tooltip_controller.js
|
|
178
192
|
- app/javascript/lightning_ui_kit/index.js
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<%= tag.div(class: classes, data: { type: @type, controller: "lui-banner" }) do %>
|
|
2
|
-
<div data-slot="header" class="lui:flex lui:items-center lui:px-4 lui:py-3">
|
|
3
|
-
<%= heroicon(icon, variant: :outline, options: { class: "lui:shrink-0 lui:w-5 lui:h-5 lui:me-2" }) %>
|
|
4
|
-
<span class="lui:sr-only"><%= @type.to_s.humanize %></span>
|
|
5
|
-
<h3 class="lui:text-md lui:font-medium"><%= @title %></h3>
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
<div class="lui:text-sm lui:text-neutral-text lui:p-4">
|
|
9
|
-
<%= content %>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<% if footer.present? %>
|
|
13
|
-
<div class="lui:p-4 lui:pt-0">
|
|
14
|
-
<%= footer %>
|
|
15
|
-
</div>
|
|
16
|
-
<% end %>
|
|
17
|
-
<% end %>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
class LightningUiKit::BannerComponent < LightningUiKit::BaseComponent
|
|
2
|
-
renders_one :footer
|
|
3
|
-
|
|
4
|
-
def initialize(title:, type: :info, **options)
|
|
5
|
-
@type = type
|
|
6
|
-
@title = title
|
|
7
|
-
@options = options
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def classes
|
|
11
|
-
type_classes = case @type
|
|
12
|
-
when :error
|
|
13
|
-
"lui:bg-destructive/5 lui:border-destructive-border/40 lui:*:data-[slot=header]:bg-destructive/10 lui:*:data-[slot=header]:text-destructive-text"
|
|
14
|
-
else
|
|
15
|
-
"lui:*:data-[slot=header]:bg-neutral-bg"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
merge_classes([default_classes, type_classes, @options[:class]].compact.join(" "))
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def icon
|
|
22
|
-
case @type
|
|
23
|
-
when :error
|
|
24
|
-
"exclamation-triangle"
|
|
25
|
-
else
|
|
26
|
-
"info-circle"
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def default_classes
|
|
31
|
-
"lui:border lui:border-border lui:rounded-lg lui:overflow-hidden lui:transition-opacity lui:duration-300 lui:ease-out lui:opacity-100"
|
|
32
|
-
end
|
|
33
|
-
end
|
/data/app/javascript/lightning_ui_kit/controllers/{banner_controller.js → alert_controller.js}
RENAMED
|
File without changes
|