klods-ruby 1.5.1 → 1.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcb611f6ddc17e2a0e583696ec39bbde270cd6bbb4d67c6aa898f43b9b5001d2
4
- data.tar.gz: 733b3567eab74cfd33b1915624f7dbf0640026b8c531fb1b418d5c44d577ad3e
3
+ metadata.gz: 2ee9af78217af1cd289d6733cfb2e6c1dc258fb8ff7b2c1b25598a201f3139fb
4
+ data.tar.gz: f0fa91dac57cc3b79eda4c79fde4d75563d94b5248f40d44c8d2aeccfea6d5f6
5
5
  SHA512:
6
- metadata.gz: bcc2b4e811428f3988d0aa5a42b7158e5442bd8b199ca48fc7bc598812ee2a3d132f6ae363e0891c1105c12650af1ebf39e99f88e04e1133fb73268c17a4573e
7
- data.tar.gz: b634ffc4cb905b9ea570cb7847f58c6c18c6e9e69c019f683895f39ff0c3f20103a4abe7c37e36d9d7936eba42ce2100b09ff399709015736d78286eb203bd8f
6
+ metadata.gz: f7ea3e5b101d8914f7326343fdfe17329908b1cc881d7bd6ee774f892319a2b2c651d69237dceda6665848986ab2cb4cbed22a473fbe21ef995b6bc286f77a4d
7
+ data.tar.gz: dcee95c510773a4809d9adaa66f5740907d9c55f3bfa3c369b9fc0367f843400592072bb7cfe5010678f5b26820e9c41d2da77e8b21c048643b7b3d5a43796fd
@@ -19,6 +19,7 @@ module Klods
19
19
  include Klods::Components::Modal
20
20
  include Klods::Components::Nav
21
21
  include Klods::Components::Prose
22
+ include Klods::Components::Toc
22
23
  include Klods::Components::Table
23
24
  include Klods::Components::Tabs
24
25
  include Klods::Components::Toast
@@ -44,28 +44,6 @@ module Klods
44
44
  default_icon = Core.el("span", {"aria-hidden" => "true", "class" => "klods-icon"}, Core.raw(MENU_SVG))
45
45
  Core.el("button", props, children || default_icon)
46
46
  end
47
-
48
- def toc(a = nil, b = nil, &block)
49
- props, children = Core.normalize_args(a, b)
50
- children = klods_capture(&block) if block
51
- Core.build(
52
- tag: "ul", base: "klods-toc",
53
- modifiers: {sub: "klods-toc--sub"},
54
- props: props, children: children
55
- )
56
- end
57
-
58
- def toc_item(a = nil, b = nil, &block)
59
- props, children = Core.normalize_args(a, b)
60
- children = klods_capture(&block) if block
61
- Core.el("li", props, children)
62
- end
63
-
64
- def toc_link(a = nil, b = nil, &block)
65
- props, children = Core.normalize_args(a, b)
66
- children = klods_capture(&block) if block
67
- Core.el("a", props, children)
68
- end
69
47
  end
70
48
  end
71
49
  end
@@ -0,0 +1,31 @@
1
+ module Klods
2
+ module Components
3
+ module Toc
4
+ def toc(a = nil, b = nil, &block)
5
+ props, children = Core.normalize_args(a, b)
6
+ children = klods_capture(&block) if block
7
+ Core.build(
8
+ tag: "ul", base: "klods-toc",
9
+ modifiers: {sub: "klods-toc--sub"},
10
+ props: props, children: children
11
+ )
12
+ end
13
+
14
+ def toc_item(a = nil, b = nil, &block)
15
+ props, children = Core.normalize_args(a, b)
16
+ children = klods_capture(&block) if block
17
+ Core.el("li", props, children)
18
+ end
19
+
20
+ def toc_link(a = nil, b = nil, &block)
21
+ props, children = Core.normalize_args(a, b)
22
+ children = klods_capture(&block) if block
23
+ Core.build(
24
+ tag: "a", base: "klods-toc__link",
25
+ modifiers: {active: "klods-toc__link--active"},
26
+ props: props, children: children
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -16,5 +16,6 @@ require_relative "components/nav"
16
16
  require_relative "components/prose"
17
17
  require_relative "components/table"
18
18
  require_relative "components/tabs"
19
+ require_relative "components/toc"
19
20
  require_relative "components/toast"
20
21
  require_relative "components/tooltip"
data/lib/klods/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Klods
2
- VERSION = "1.5.1"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klods-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drue Wilding
@@ -96,6 +96,7 @@ files:
96
96
  - lib/klods/components/table.rb
97
97
  - lib/klods/components/tabs.rb
98
98
  - lib/klods/components/toast.rb
99
+ - lib/klods/components/toc.rb
99
100
  - lib/klods/components/tooltip.rb
100
101
  - lib/klods/core.rb
101
102
  - lib/klods/form_builder.rb