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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43de49498356e50a1fbcac794f988fdcb36c4032bea949316aee19483c1b9208
|
4
|
+
data.tar.gz: 3b4d2a3cdaae5730e46a5880e0ed7d05e0d824bda868d4200d76785c14087ca0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62f3abbfcc402e5a97b2223f91f95601655ec3a5f6824514ad27e2160d093fb62f458b6caccee302bd948717a29e8d89c248cc0e7f760ec03e870f06bb1dab00
|
7
|
+
data.tar.gz: f00b678398e9430ca799ca92f5331a1e62a1fb459237929aed658d24a6ec98836adde8617cbc01add48ac7d5bf66834ca5094fb2307378447e265203d2e306a3
|
@@ -16,42 +16,48 @@ module NitroKit
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
def item(**attrs)
|
20
|
+
builder do
|
21
|
+
div(**attrs) do
|
22
|
+
yield
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
27
|
+
def trigger(text = nil, **attrs)
|
28
|
+
builder do
|
29
|
+
button(
|
30
|
+
**mattr(
|
31
|
+
attrs,
|
32
|
+
type: "button",
|
33
|
+
class: trigger_class,
|
34
|
+
data: {
|
35
|
+
action: "nk--accordion#toggle",
|
36
|
+
nk__accordion_target: "trigger"
|
37
|
+
},
|
38
|
+
aria: {expanded: "false"}
|
39
|
+
)
|
40
|
+
) do
|
41
|
+
block_given? ? yield : plain(text)
|
42
|
+
chevron_icon
|
43
|
+
end
|
40
44
|
end
|
41
45
|
end
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
def content(**attrs)
|
48
|
+
builder do
|
49
|
+
div(
|
50
|
+
**mattr(
|
51
|
+
attrs,
|
52
|
+
class: content_class,
|
53
|
+
data: {
|
54
|
+
nk__accordion_target: "content"
|
55
|
+
},
|
56
|
+
aria: {hidden: "true"}
|
57
|
+
)
|
58
|
+
) do
|
59
|
+
div(class: "pb-4") { yield }
|
60
|
+
end
|
55
61
|
end
|
56
62
|
end
|
57
63
|
|
@@ -22,15 +22,19 @@ module NitroKit
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
def title(text = nil, **attrs, &block)
|
26
|
+
builder do
|
27
|
+
h5(**mattr(attrs, class: title_class)) do
|
28
|
+
text_or_block(text, &block)
|
29
|
+
end
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
def description(text = nil, **attrs, &block)
|
34
|
+
builder do
|
35
|
+
div(**mattr(attrs, class: description_class)) do
|
36
|
+
text_or_block(text, &block)
|
37
|
+
end
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NitroKit
|
4
|
+
class AvatarStack < Component
|
5
|
+
def initialize(size: :md, **attrs)
|
6
|
+
@size = size
|
7
|
+
|
8
|
+
super(attrs)
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_reader :size
|
12
|
+
|
13
|
+
def view_template
|
14
|
+
div(**mattr(attrs, class: "flex items-center -space-x-3 [&>div]:ring-2 [&>div]:ring-background")) do
|
15
|
+
yield
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
builder_method def avatar(*args, **attrs, &block)
|
20
|
+
render(Avatar.new(*args, size:, **attrs, &block))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -133,6 +133,12 @@ module NitroKit
|
|
133
133
|
# If icon only, make square
|
134
134
|
"[&_svg:first-child:last-child]:-mx-2"
|
135
135
|
]
|
136
|
+
when :xl
|
137
|
+
[
|
138
|
+
"px-8 h-14 text-2xl [&_svg]:size-5 gap-x-4",
|
139
|
+
# If icon only, make square
|
140
|
+
"[&_svg:first-child:last-child]:-mx-8"
|
141
|
+
]
|
136
142
|
else
|
137
143
|
raise ArgumentError, "Unknown size `#{size}'"
|
138
144
|
end
|
@@ -15,33 +15,43 @@ module NitroKit
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
def title(text = nil, **attrs, &block)
|
19
|
+
builder do
|
20
|
+
h2(**mattr(attrs, class: "text-lg font-bold -mb-2")) do
|
21
|
+
text_or_block(text, &block)
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
def body(text = nil, **attrs, &block)
|
27
|
+
builder do
|
28
|
+
div(**mattr(attrs, class: "text-muted-content text-sm leading-relaxed")) do
|
29
|
+
text_or_block(text, &block)
|
30
|
+
end
|
27
31
|
end
|
28
32
|
end
|
29
33
|
|
30
|
-
|
31
|
-
|
32
|
-
|
34
|
+
def footer(text = nil, **attrs, &block)
|
35
|
+
builder do
|
36
|
+
div(**mattr(attrs, class: "flex gap-2 items-center")) do
|
37
|
+
text_or_block(text, &block)
|
38
|
+
end
|
33
39
|
end
|
34
40
|
end
|
35
41
|
|
36
|
-
|
37
|
-
|
38
|
-
|
42
|
+
def divider(**attrs)
|
43
|
+
builder do
|
44
|
+
full_width do
|
45
|
+
hr(**attrs)
|
46
|
+
end
|
39
47
|
end
|
40
48
|
end
|
41
49
|
|
42
|
-
|
43
|
-
|
44
|
-
|
50
|
+
def full_width(**attrs)
|
51
|
+
builder do
|
52
|
+
div(**mattr(attrs, data: {slot: "full"}, class: "-mx-(--gap)")) do
|
53
|
+
yield
|
54
|
+
end
|
45
55
|
end
|
46
56
|
end
|
47
57
|
|
@@ -23,15 +23,19 @@ module NitroKit
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
def title(text = nil, **attrs, &block)
|
27
|
+
builder do
|
28
|
+
render(Label.new(**attrs)) do
|
29
|
+
text_or_block(text, &block)
|
30
|
+
end
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
def item(text = nil, **attrs, &block)
|
35
|
+
builder do
|
36
|
+
render(Checkbox.new(**attrs)) do
|
37
|
+
text_or_block(text, &block)
|
38
|
+
end
|
35
39
|
end
|
36
40
|
end
|
37
41
|
end
|
@@ -2,12 +2,20 @@
|
|
2
2
|
|
3
3
|
module NitroKit
|
4
4
|
class Component < Phlex::HTML
|
5
|
-
def initialize(
|
6
|
-
@attrs = merge_attrs(
|
5
|
+
def initialize(attrs = {}, **defaults)
|
6
|
+
@attrs = merge_attrs(attrs, **defaults)
|
7
7
|
end
|
8
8
|
|
9
9
|
attr_reader :attrs
|
10
10
|
|
11
|
+
def self.from_template(*args, **attrs, &block)
|
12
|
+
new(*args, **attrs, &block).tap { |instance| instance.instance_variable_set(:@_nk_from_template, true) }
|
13
|
+
end
|
14
|
+
|
15
|
+
def builder(&block)
|
16
|
+
@_nk_from_template ? capture(&block) : yield
|
17
|
+
end
|
18
|
+
|
11
19
|
private
|
12
20
|
|
13
21
|
# Class-level helper method for builder style components.
|
@@ -15,24 +23,11 @@ module NitroKit
|
|
15
23
|
# in capture so we don't write to the output buffer immediately.
|
16
24
|
# However when called from other components, we don't.
|
17
25
|
def self.builder_method(method_name)
|
18
|
-
|
19
|
-
|
20
|
-
<<~RUBY,
|
21
|
-
# frozen_string_literal: true
|
22
|
-
|
23
|
-
def #{method_name}(...)
|
24
|
-
if caller_locations(1, 1).first.path.end_with?(".rb")
|
25
|
-
super
|
26
|
-
else
|
27
|
-
capture { super }
|
28
|
-
end
|
29
|
-
end
|
30
|
-
RUBY
|
31
|
-
__FILE__,
|
32
|
-
__LINE__ + 1
|
26
|
+
warn(
|
27
|
+
"[DEPRECATION] builder_method is deprecated. Please migrate to using the builder(&) pattern. See https://github.com/mikker/nitro_kit/issues/35 for details."
|
33
28
|
)
|
34
29
|
|
35
|
-
|
30
|
+
nil
|
36
31
|
end
|
37
32
|
|
38
33
|
# Merge attributes with some special cases for matching keys
|
@@ -76,8 +71,10 @@ module NitroKit
|
|
76
71
|
end
|
77
72
|
|
78
73
|
def text_or_block(text = nil, &block)
|
79
|
-
if text
|
74
|
+
if text && text.is_a?(ActiveSupport::SafeBuffer)
|
80
75
|
plain(text)
|
76
|
+
elsif text
|
77
|
+
text
|
81
78
|
elsif block_given?
|
82
79
|
yield
|
83
80
|
else
|
@@ -19,76 +19,86 @@ module NitroKit
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
def trigger(text = nil, as: Button, **attrs, &block)
|
23
|
+
builder do
|
24
|
+
trigger_attrs = mattr(
|
25
|
+
attrs,
|
26
|
+
data: {
|
27
|
+
nk__dialog_target: "trigger",
|
28
|
+
action: "click->nk--dialog#open"
|
29
|
+
}
|
30
|
+
)
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
case as
|
33
|
+
when Symbol
|
34
|
+
send(as, **trigger_attrs) do
|
35
|
+
text_or_block(text, &block)
|
36
|
+
end
|
37
|
+
else
|
38
|
+
render(as.new(**trigger_attrs)) do
|
39
|
+
text_or_block(text, &block)
|
40
|
+
end
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
43
45
|
alias :html_dialog :dialog
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
47
|
+
def dialog(**attrs)
|
48
|
+
builder do
|
49
|
+
html_dialog(
|
50
|
+
**mattr(
|
51
|
+
attrs,
|
52
|
+
class: dialog_class,
|
53
|
+
data: {nk__dialog_target: "dialog"},
|
54
|
+
aria: {
|
55
|
+
labelledby: id(:title),
|
56
|
+
describedby: id(:description)
|
57
|
+
}
|
58
|
+
)
|
59
|
+
) do
|
60
|
+
yield
|
61
|
+
end
|
58
62
|
end
|
59
63
|
end
|
60
64
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
def close_button(**attrs)
|
66
|
+
builder do
|
67
|
+
render(
|
68
|
+
Button.new(
|
69
|
+
**mattr(
|
70
|
+
attrs,
|
71
|
+
variant: :ghost,
|
72
|
+
size: :sm,
|
73
|
+
class: "absolute top-2 right-2",
|
74
|
+
data: {action: "nk--dialog#close"}
|
75
|
+
)
|
70
76
|
)
|
71
|
-
)
|
72
|
-
|
73
|
-
|
77
|
+
) do
|
78
|
+
render(Icon.new(:x))
|
79
|
+
end
|
74
80
|
end
|
75
81
|
end
|
76
82
|
|
77
|
-
|
78
|
-
|
79
|
-
|
83
|
+
def title(text = nil, **attrs, &block)
|
84
|
+
builder do
|
85
|
+
h2(**mattr(attrs, id: id(:title), class: "text-lg font-semibold mb-2")) do
|
86
|
+
text_or_block(text, &block)
|
87
|
+
end
|
80
88
|
end
|
81
89
|
end
|
82
90
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
91
|
+
def description(text = nil, **attrs, &block)
|
92
|
+
builder do
|
93
|
+
div(
|
94
|
+
**mattr(
|
95
|
+
attrs,
|
96
|
+
id: id(:description),
|
97
|
+
class: "text-muted-content mb-6 text-sm leading-relaxed"
|
98
|
+
)
|
99
|
+
) do
|
100
|
+
text_or_block(text, &block)
|
101
|
+
end
|
92
102
|
end
|
93
103
|
end
|
94
104
|
|
@@ -26,97 +26,113 @@ module NitroKit
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
def trigger(text = nil, as: NitroKit::Button, **attrs, &block)
|
30
|
+
builder do
|
31
|
+
trigger_attrs = mattr(
|
32
|
+
attrs,
|
33
|
+
aria: {haspopup: "true", expanded: "false"},
|
34
|
+
data: {nk__dropdown_target: "trigger", action: "click->nk--dropdown#toggle"}
|
35
|
+
)
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
case as
|
38
|
+
when Symbol
|
39
|
+
send(as, **trigger_attrs) do
|
40
|
+
text_or_block(text, &block)
|
41
|
+
end
|
42
|
+
else
|
43
|
+
render(as.new(**trigger_attrs)) do
|
44
|
+
text_or_block(text, &block)
|
45
|
+
end
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
50
|
+
def content(as: :div, **attrs)
|
51
|
+
builder do
|
52
|
+
div(
|
53
|
+
**mattr(
|
54
|
+
attrs,
|
55
|
+
role: "menu",
|
56
|
+
aria: {hidden: "true"},
|
57
|
+
class: content_class,
|
58
|
+
data: {nk__dropdown_target: "content"},
|
59
|
+
popover: true
|
60
|
+
)
|
61
|
+
) do
|
62
|
+
yield
|
63
|
+
end
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
63
|
-
|
64
|
-
|
65
|
-
|
67
|
+
def title(text = nil, **attrs, &block)
|
68
|
+
builder do
|
69
|
+
div(**mattr(attrs, class: title_class)) do
|
70
|
+
text_or_block(text, &block)
|
71
|
+
end
|
66
72
|
end
|
67
73
|
end
|
68
74
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
75
|
+
def item(text = nil, href: nil, variant: :default, **attrs, &block)
|
76
|
+
builder do
|
77
|
+
common_attrs = mattr(
|
78
|
+
attrs,
|
79
|
+
role: "menuitem",
|
80
|
+
tabindex: "-1",
|
81
|
+
class: [item_class, item_variant_class(variant)]
|
82
|
+
)
|
76
83
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
+
if href
|
85
|
+
link_to(href, **common_attrs) do
|
86
|
+
text_or_block(text, &block)
|
87
|
+
end
|
88
|
+
else
|
89
|
+
div(**common_attrs) do
|
90
|
+
text_or_block(text, &block)
|
91
|
+
end
|
84
92
|
end
|
85
93
|
end
|
86
94
|
end
|
87
95
|
|
88
|
-
|
96
|
+
def item_to(
|
89
97
|
text_or_href,
|
90
98
|
href = nil,
|
91
99
|
**attrs,
|
92
100
|
&block
|
93
101
|
)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
102
|
+
builder do
|
103
|
+
if block_given?
|
104
|
+
href = text_or_href
|
105
|
+
text_or_href = nil
|
106
|
+
end
|
98
107
|
|
99
|
-
|
108
|
+
item(text_or_href, href: href, **attrs, &block)
|
109
|
+
end
|
100
110
|
end
|
101
111
|
|
102
|
-
|
103
|
-
|
112
|
+
def destructive_item(*args, **attrs, &block)
|
113
|
+
builder do
|
114
|
+
item(*args, **attrs, variant: :destructive, &block)
|
115
|
+
end
|
104
116
|
end
|
105
117
|
|
106
|
-
|
107
|
-
|
108
|
-
|
118
|
+
def destructive_item_to(text_or_block, href = nil, **attrs, &block)
|
119
|
+
builder do
|
120
|
+
href = args.shift if block_given?
|
121
|
+
destructive_item(text_or_block, href: href, **attrs, &block)
|
122
|
+
end
|
109
123
|
end
|
110
124
|
|
111
|
-
|
112
|
-
|
125
|
+
def separator
|
126
|
+
builder do
|
127
|
+
hr(class: separator_class)
|
128
|
+
end
|
113
129
|
end
|
114
130
|
|
115
131
|
private
|
116
132
|
|
117
133
|
def content_class
|
118
134
|
[
|
119
|
-
"
|
135
|
+
"isolate w-max-content absolute top-0 left-0",
|
120
136
|
"p-1 bg-background text-foreground rounded-md border shadow-sm",
|
121
137
|
"w-fit max-w-sm flex-col text-left",
|
122
138
|
"[&[aria-hidden=true]]:hidden flex"
|
@@ -135,7 +151,8 @@ module NitroKit
|
|
135
151
|
[
|
136
152
|
"px-3 py-1.5 rounded",
|
137
153
|
"font-medium truncate",
|
138
|
-
"cursor-default"
|
154
|
+
"cursor-default",
|
155
|
+
"flex gap-2 items-center [&>span]:truncate"
|
139
156
|
]
|
140
157
|
end
|
141
158
|
|
@@ -144,7 +161,7 @@ module NitroKit
|
|
144
161
|
when :default
|
145
162
|
"[&[href]]:hover:bg-muted"
|
146
163
|
when :destructive
|
147
|
-
"text-destructive [&[href]]:hover:bg-destructive [&[href]]:hover:text-white"
|
164
|
+
"text-destructive-content [&[href]]:hover:bg-destructive [&[href]]:hover:text-white"
|
148
165
|
else
|
149
166
|
raise ArgumentError, "Unknown variant: #{variant.inspect}"
|
150
167
|
end
|