protos 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +56 -60
- data/examples/list.rb +1 -1
- data/examples/navbar.rb +1 -1
- data/lib/protos/accordion/item.rb +4 -2
- data/lib/protos/accordion.rb +5 -4
- data/lib/protos/alert/actions.rb +1 -1
- data/lib/protos/alert/icon.rb +1 -1
- data/lib/protos/alert.rb +1 -1
- data/lib/protos/avatar.rb +1 -1
- data/lib/protos/breadcrumbs/crumb.rb +1 -1
- data/lib/protos/breadcrumbs.rb +1 -1
- data/lib/protos/card/actions.rb +1 -1
- data/lib/protos/card/body.rb +1 -1
- data/lib/protos/card/image.rb +1 -1
- data/lib/protos/card/title.rb +1 -1
- data/lib/protos/card.rb +1 -1
- data/lib/protos/carousel/actions.rb +1 -1
- data/lib/protos/carousel/item.rb +1 -1
- data/lib/protos/carousel.rb +1 -1
- data/lib/protos/chat_bubble/content.rb +1 -1
- data/lib/protos/chat_bubble/footer.rb +1 -1
- data/lib/protos/chat_bubble/header.rb +1 -1
- data/lib/protos/chat_bubble/image.rb +1 -1
- data/lib/protos/chat_bubble.rb +1 -1
- data/lib/protos/collapse/content.rb +1 -1
- data/lib/protos/collapse/title.rb +10 -2
- data/lib/protos/collapse.rb +12 -4
- data/lib/protos/command/dialog.rb +1 -1
- data/lib/protos/command/empty.rb +1 -1
- data/lib/protos/command/group.rb +1 -1
- data/lib/protos/command/input.rb +3 -2
- data/lib/protos/command/item.rb +1 -1
- data/lib/protos/command/list.rb +1 -1
- data/lib/protos/command/title.rb +1 -1
- data/lib/protos/command/trigger.rb +1 -1
- data/lib/protos/command.rb +1 -1
- data/lib/protos/drawer/content.rb +1 -1
- data/lib/protos/drawer/side.rb +1 -1
- data/lib/protos/drawer/trigger.rb +1 -1
- data/lib/protos/drawer.rb +2 -2
- data/lib/protos/dropdown/item.rb +1 -1
- data/lib/protos/dropdown/menu.rb +1 -1
- data/lib/protos/hero/content.rb +1 -1
- data/lib/protos/hero/overlay.rb +1 -1
- data/lib/protos/hero.rb +1 -1
- data/lib/protos/list/item.rb +1 -1
- data/lib/protos/list.rb +1 -1
- data/lib/protos/modal/close_button.rb +1 -1
- data/lib/protos/modal/dialog.rb +1 -1
- data/lib/protos/modal/trigger.rb +1 -1
- data/lib/protos/modal.rb +1 -1
- data/lib/protos/popover/content.rb +1 -1
- data/lib/protos/popover/trigger.rb +1 -1
- data/lib/protos/popover.rb +1 -1
- data/lib/protos/stats/actions.rb +1 -1
- data/lib/protos/stats/description.rb +1 -1
- data/lib/protos/stats/figure.rb +1 -1
- data/lib/protos/stats/stat.rb +1 -1
- data/lib/protos/stats/title.rb +1 -1
- data/lib/protos/stats/value.rb +1 -1
- data/lib/protos/stats.rb +1 -1
- data/lib/protos/swap/off.rb +1 -1
- data/lib/protos/swap/on.rb +1 -1
- data/lib/protos/swap.rb +3 -4
- data/lib/protos/table/body.rb +1 -1
- data/lib/protos/table/caption.rb +1 -1
- data/lib/protos/table/cell.rb +1 -1
- data/lib/protos/table/footer.rb +1 -1
- data/lib/protos/table/head.rb +1 -1
- data/lib/protos/table/header.rb +1 -1
- data/lib/protos/table/row.rb +1 -1
- data/lib/protos/table.rb +1 -1
- data/lib/protos/tabs/tab.rb +3 -2
- data/lib/protos/tabs.rb +1 -1
- data/lib/protos/theme.rb +10 -1
- data/lib/protos/timeline/center.rb +1 -1
- data/lib/protos/timeline/item.rb +1 -1
- data/lib/protos/timeline/left.rb +1 -1
- data/lib/protos/timeline/right.rb +1 -1
- data/lib/protos/timeline.rb +1 -1
- data/lib/protos/toast/close_button.rb +1 -1
- data/lib/protos/toast.rb +1 -1
- data/lib/protos/token_list.rb +1 -17
- data/lib/protos/typography/heading.rb +1 -1
- data/lib/protos/typography/inline_link.rb +1 -1
- data/lib/protos/typography/paragraph.rb +1 -1
- data/lib/protos/version.rb +1 -1
- data/protos.gemspec +1 -1
- metadata +4 -4
data/lib/protos/dropdown/menu.rb
CHANGED
data/lib/protos/hero/content.rb
CHANGED
data/lib/protos/hero/overlay.rb
CHANGED
data/lib/protos/hero.rb
CHANGED
data/lib/protos/list/item.rb
CHANGED
data/lib/protos/list.rb
CHANGED
data/lib/protos/modal/dialog.rb
CHANGED
data/lib/protos/modal/trigger.rb
CHANGED
data/lib/protos/modal.rb
CHANGED
data/lib/protos/popover.rb
CHANGED
data/lib/protos/stats/actions.rb
CHANGED
data/lib/protos/stats/figure.rb
CHANGED
data/lib/protos/stats/stat.rb
CHANGED
data/lib/protos/stats/title.rb
CHANGED
data/lib/protos/stats/value.rb
CHANGED
data/lib/protos/stats.rb
CHANGED
data/lib/protos/swap/off.rb
CHANGED
data/lib/protos/swap/on.rb
CHANGED
data/lib/protos/swap.rb
CHANGED
@@ -6,9 +6,9 @@ module Protos
|
|
6
6
|
# display different content.
|
7
7
|
# https://daisyui.com/components/swap/
|
8
8
|
|
9
|
-
def
|
9
|
+
def view_template
|
10
10
|
label(**attrs) do
|
11
|
-
input(type: :checkbox, class: css[:input])
|
11
|
+
input(type: :checkbox, class: css[:input], autocomplete: :off)
|
12
12
|
yield if block_given?
|
13
13
|
end
|
14
14
|
end
|
@@ -25,8 +25,7 @@ module Protos
|
|
25
25
|
|
26
26
|
def theme
|
27
27
|
{
|
28
|
-
container: tokens("swap")
|
29
|
-
input: tokens("hidden")
|
28
|
+
container: tokens("swap")
|
30
29
|
}
|
31
30
|
end
|
32
31
|
end
|
data/lib/protos/table/body.rb
CHANGED
data/lib/protos/table/caption.rb
CHANGED
data/lib/protos/table/cell.rb
CHANGED
data/lib/protos/table/footer.rb
CHANGED
data/lib/protos/table/head.rb
CHANGED
data/lib/protos/table/header.rb
CHANGED
data/lib/protos/table/row.rb
CHANGED
data/lib/protos/table.rb
CHANGED
data/lib/protos/tabs/tab.rb
CHANGED
@@ -10,13 +10,14 @@ module Protos
|
|
10
10
|
option :active, default: -> { false }
|
11
11
|
option :disabled, default: -> { false }
|
12
12
|
|
13
|
-
def
|
13
|
+
def view_template(&block)
|
14
14
|
input(
|
15
15
|
type: :radio,
|
16
16
|
class: css[:input],
|
17
17
|
name: id,
|
18
18
|
role: :tab,
|
19
|
-
aria_label: label
|
19
|
+
aria_label: label,
|
20
|
+
autocomplete: :off
|
20
21
|
)
|
21
22
|
div(**attrs, &block)
|
22
23
|
end
|
data/lib/protos/tabs.rb
CHANGED
data/lib/protos/theme.rb
CHANGED
@@ -7,12 +7,21 @@ module Protos
|
|
7
7
|
# This is the object that is returned by `css` and used to set slots for
|
8
8
|
# a component style.
|
9
9
|
|
10
|
+
class << self
|
11
|
+
def merger
|
12
|
+
@merger ||= TailwindMerge::Merger.new
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
10
16
|
def initialize(theme = {}, **kwargs)
|
11
17
|
@theme = theme.merge(kwargs)
|
12
18
|
end
|
13
19
|
|
14
20
|
def [](key)
|
15
|
-
@theme[key]
|
21
|
+
value = @theme[key]
|
22
|
+
return value unless value.is_a?(String)
|
23
|
+
|
24
|
+
self.class.merger.merge(value)
|
16
25
|
end
|
17
26
|
|
18
27
|
def key?(key)
|
data/lib/protos/timeline/item.rb
CHANGED
data/lib/protos/timeline/left.rb
CHANGED
data/lib/protos/timeline.rb
CHANGED
data/lib/protos/toast.rb
CHANGED
data/lib/protos/token_list.rb
CHANGED
@@ -24,7 +24,7 @@ module Protos
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def to_s
|
27
|
-
|
27
|
+
@tokens.join(" ")
|
28
28
|
end
|
29
29
|
|
30
30
|
def -(other)
|
@@ -52,21 +52,5 @@ module Protos
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def merge(tokens)
|
59
|
-
TailwindMerge::Merger.new(
|
60
|
-
config: {
|
61
|
-
theme: {
|
62
|
-
# Not currently working in the gem.
|
63
|
-
# "spacing" => %w[xs sm md lg xl],
|
64
|
-
# "padding" => %w[xs sm md lg xl],
|
65
|
-
# "margin" => %w[xs sm md lg xl]
|
66
|
-
}
|
67
|
-
}
|
68
|
-
)
|
69
|
-
.merge(tokens)
|
70
|
-
end
|
71
55
|
end
|
72
56
|
end
|
data/lib/protos/version.rb
CHANGED
data/protos.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_dependency "dry-core", "~> 1.0"
|
38
38
|
spec.add_dependency "dry-initializer", "~> 3.1"
|
39
39
|
spec.add_dependency "dry-types", "~> 1.7"
|
40
|
-
spec.add_dependency "phlex", "~> 1.
|
40
|
+
spec.add_dependency "phlex", "~> 1.10"
|
41
41
|
spec.add_dependency "tailwind_merge", "~> 0.10"
|
42
42
|
|
43
43
|
# For more information and examples about making a new gem, check out our
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nolan J Tait
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-core
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.10'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
68
|
+
version: '1.10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: tailwind_merge
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|