nitro_kit 0.6.0 → 0.7.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/components/nitro_kit/accordion.rb +36 -30
- data/app/components/nitro_kit/alert.rb +10 -6
- data/app/components/nitro_kit/avatar_stack.rb +23 -0
- data/app/components/nitro_kit/button.rb +6 -0
- data/app/components/nitro_kit/card.rb +25 -15
- data/app/components/nitro_kit/checkbox.rb +2 -0
- data/app/components/nitro_kit/checkbox_group.rb +10 -6
- data/app/components/nitro_kit/component.rb +16 -19
- data/app/components/nitro_kit/dialog.rb +63 -53
- data/app/components/nitro_kit/dropdown.rb +76 -59
- data/app/components/nitro_kit/field.rb +82 -65
- data/app/components/nitro_kit/fieldset.rb +14 -7
- data/app/components/nitro_kit/form_builder.rb +13 -10
- data/app/components/nitro_kit/input.rb +1 -1
- data/app/components/nitro_kit/pagination.rb +45 -37
- data/app/components/nitro_kit/radio_button.rb +1 -1
- data/app/components/nitro_kit/radio_button_group.rb +22 -18
- data/app/components/nitro_kit/select.rb +9 -7
- data/app/components/nitro_kit/table.rb +22 -12
- data/app/components/nitro_kit/tabs.rb +49 -43
- data/app/components/nitro_kit/textarea.rb +6 -2
- data/app/components/nitro_kit/toast.rb +9 -5
- data/app/components/nitro_kit/tooltip.rb +14 -12
- data/app/helpers/nitro_kit/accordion_helper.rb +1 -1
- data/app/helpers/nitro_kit/alert_helper.rb +1 -1
- data/app/helpers/nitro_kit/avatar_helper.rb +5 -1
- data/app/helpers/nitro_kit/badge_helper.rb +1 -1
- data/app/helpers/nitro_kit/button_group_helper.rb +1 -1
- data/app/helpers/nitro_kit/button_helper.rb +3 -3
- data/app/helpers/nitro_kit/card_helper.rb +1 -1
- data/app/helpers/nitro_kit/checkbox_helper.rb +3 -3
- data/app/helpers/nitro_kit/combobox_helper.rb +1 -1
- data/app/helpers/nitro_kit/datepicker_helper.rb +1 -1
- data/app/helpers/nitro_kit/dialog_helper.rb +1 -1
- data/app/helpers/nitro_kit/dropdown_helper.rb +1 -1
- data/app/helpers/nitro_kit/field_group_helper.rb +1 -1
- data/app/helpers/nitro_kit/field_helper.rb +1 -1
- data/app/helpers/nitro_kit/fieldset_helper.rb +1 -1
- data/app/helpers/nitro_kit/icon_helper.rb +1 -1
- data/app/helpers/nitro_kit/input_helper.rb +1 -1
- data/app/helpers/nitro_kit/label_helper.rb +1 -1
- data/app/helpers/nitro_kit/pagination_helper.rb +1 -1
- data/app/helpers/nitro_kit/radio_button_helper.rb +2 -2
- data/app/helpers/nitro_kit/select_helper.rb +1 -1
- data/app/helpers/nitro_kit/switch_helper.rb +1 -1
- data/app/helpers/nitro_kit/table_helper.rb +1 -1
- data/app/helpers/nitro_kit/tabs_helper.rb +1 -1
- data/app/helpers/nitro_kit/textarea_helper.rb +1 -1
- data/app/helpers/nitro_kit/toast_helper.rb +2 -2
- data/app/helpers/nitro_kit/tooltip_helper.rb +1 -1
- data/lib/nitro_kit/version.rb +1 -1
- metadata +4 -3
@@ -104,13 +104,17 @@ module NitroKit
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
|
108
|
-
|
107
|
+
def item(title: nil, description: nil, **attrs, &block)
|
108
|
+
builder do
|
109
|
+
render(Item.new(title:, description:, **attrs), &block)
|
110
|
+
end
|
109
111
|
end
|
110
112
|
|
111
|
-
|
112
|
-
|
113
|
-
|
113
|
+
def flash_sink
|
114
|
+
builder do
|
115
|
+
div(id: "nk--toast-sink", data: {nk__toast_target: "sink"}, hidden: true) do
|
116
|
+
render(FlashMessages.new(view_context.flash))
|
117
|
+
end
|
114
118
|
end
|
115
119
|
end
|
116
120
|
|
@@ -25,18 +25,20 @@ module NitroKit
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
def content(text = nil, **attrs, &block)
|
29
|
+
builder do
|
30
|
+
div(
|
31
|
+
**mattr(
|
32
|
+
attrs,
|
33
|
+
class: tooltip_class,
|
34
|
+
data: {
|
35
|
+
state: "closed",
|
36
|
+
nk__tooltip_target: "content"
|
37
|
+
}
|
38
|
+
)
|
39
|
+
) do
|
40
|
+
text_or_block(text, &block)
|
41
|
+
end
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
@@ -3,7 +3,11 @@
|
|
3
3
|
module NitroKit
|
4
4
|
module AvatarHelper
|
5
5
|
def nk_avatar(src = nil, **attrs, &block)
|
6
|
-
render(Avatar.
|
6
|
+
render(Avatar.from_template(src, **attrs), &block)
|
7
|
+
end
|
8
|
+
|
9
|
+
def nk_avatar_stack(**attrs, &block)
|
10
|
+
render(AvatarStack.from_template(**attrs), &block)
|
7
11
|
end
|
8
12
|
end
|
9
13
|
end
|
@@ -5,7 +5,7 @@ module NitroKit
|
|
5
5
|
include Variants
|
6
6
|
|
7
7
|
def nk_button(text = nil, **attrs, &block)
|
8
|
-
render(NitroKit::Button.
|
8
|
+
render(NitroKit::Button.from_template(text, **attrs), &block)
|
9
9
|
end
|
10
10
|
|
11
11
|
automatic_variants(Button::VARIANTS, :nk_button)
|
@@ -37,13 +37,13 @@ module NitroKit
|
|
37
37
|
|
38
38
|
href = attrs[:href] || url_target(text, options)
|
39
39
|
|
40
|
-
render(NitroKit::Button.
|
40
|
+
render(NitroKit::Button.from_template(text, **attrs, href:), &block)
|
41
41
|
end
|
42
42
|
|
43
43
|
automatic_variants(Button::VARIANTS, :nk_button_link_to)
|
44
44
|
|
45
45
|
def nk_button_group(**attrs, &block)
|
46
|
-
render(ButtonGroup.
|
46
|
+
render(ButtonGroup.from_template(**attrs), &block)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -17,7 +17,7 @@ module NitroKit
|
|
17
17
|
|
18
18
|
# TODO: multiple, unchecked hidden field
|
19
19
|
|
20
|
-
render(Checkbox.
|
20
|
+
render(Checkbox.from_template(name:, label:, value: compat_checked_value, checked:, **attrs))
|
21
21
|
end
|
22
22
|
|
23
23
|
def nk_checkbox_tag(name, *args)
|
@@ -38,13 +38,13 @@ module NitroKit
|
|
38
38
|
|
39
39
|
attrs[:checked] = "checked" if checked
|
40
40
|
|
41
|
-
render(Checkbox.
|
41
|
+
render(Checkbox.from_template(name:, **attrs))
|
42
42
|
end
|
43
43
|
|
44
44
|
alias :nk_check_box_tag :nk_checkbox_tag
|
45
45
|
|
46
46
|
def nk_checkbox_group(**attrs, &block)
|
47
|
-
render(CheckboxGroup.
|
47
|
+
render(CheckboxGroup.from_template(**attrs), &block)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -13,11 +13,11 @@ module NitroKit
|
|
13
13
|
name = field_name(compat_object_name, compat_method)
|
14
14
|
value = compat_tag_value || attrs[:value]
|
15
15
|
|
16
|
-
render(RadioButton.
|
16
|
+
render(RadioButton.from_template(label:, name:, value:, **attrs))
|
17
17
|
end
|
18
18
|
|
19
19
|
def nk_radio_button_group(**attrs, &block)
|
20
|
-
render(RadioButtonGroup.
|
20
|
+
render(RadioButtonGroup.from_template(**attrs), &block)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -18,7 +18,7 @@ module NitroKit
|
|
18
18
|
|
19
19
|
# TODO: support index
|
20
20
|
|
21
|
-
render(Select.
|
21
|
+
render(Select.from_template(options, value:, include_blank:, prompt:, **compat_options, **attrs), &block)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module NitroKit
|
4
4
|
module ToastHelper
|
5
5
|
def nk_toast(**attrs, &block)
|
6
|
-
render(Toast.
|
6
|
+
render(Toast.from_template(**attrs), &block)
|
7
7
|
end
|
8
8
|
|
9
9
|
def nk_toast_action(title: nil, description: nil, event: nil)
|
@@ -15,7 +15,7 @@ module NitroKit
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def nk_toast_flash_messages
|
18
|
-
render(Toast::FlashMessages.
|
18
|
+
render(Toast::FlashMessages.from_template(flash))
|
19
19
|
end
|
20
20
|
|
21
21
|
def nk_toast_turbo_stream_refresh
|
data/lib/nitro_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nitro_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikkel Malmberg
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- app/components/nitro_kit/accordion.rb
|
64
64
|
- app/components/nitro_kit/alert.rb
|
65
65
|
- app/components/nitro_kit/avatar.rb
|
66
|
+
- app/components/nitro_kit/avatar_stack.rb
|
66
67
|
- app/components/nitro_kit/badge.rb
|
67
68
|
- app/components/nitro_kit/button.rb
|
68
69
|
- app/components/nitro_kit/button_group.rb
|
@@ -156,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
157
|
- !ruby/object:Gem::Version
|
157
158
|
version: '0'
|
158
159
|
requirements: []
|
159
|
-
rubygems_version: 3.6.
|
160
|
+
rubygems_version: 3.6.9
|
160
161
|
specification_version: 4
|
161
162
|
summary: WIP, not usable yet
|
162
163
|
test_files: []
|