protos 0.6.0 → 1.0.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/CHANGELOG.md +30 -1
- data/README.md +62 -81
- data/examples/list.rb +2 -2
- data/examples/navbar.rb +3 -8
- data/lib/protos/accordion/item.rb +4 -2
- data/lib/protos/accordion.rb +10 -11
- data/lib/protos/alert.rb +4 -4
- data/lib/protos/avatar.rb +12 -20
- data/lib/protos/badge.rb +58 -0
- data/lib/protos/breadcrumbs.rb +2 -0
- data/lib/protos/card.rb +37 -19
- data/lib/protos/carousel.rb +15 -10
- data/lib/protos/chat_bubble/content.rb +9 -17
- data/lib/protos/chat_bubble.rb +13 -6
- data/lib/protos/collapse/title.rb +3 -3
- data/lib/protos/collapse.rb +32 -11
- data/lib/protos/combobox.rb +3 -3
- data/lib/protos/command/input.rb +4 -4
- data/lib/protos/command.rb +16 -2
- data/lib/protos/component.rb +12 -36
- data/lib/protos/diff/item.rb +34 -0
- data/lib/protos/diff/resizer.rb +19 -0
- data/lib/protos/diff.rb +30 -0
- data/lib/protos/drawer.rb +7 -3
- data/lib/protos/dropdown/menu.rb +2 -5
- data/lib/protos/dropdown.rb +10 -6
- data/lib/protos/hero.rb +3 -0
- data/lib/protos/list/item.rb +7 -3
- data/lib/protos/list.rb +3 -1
- data/lib/protos/menu/item.rb +23 -0
- data/lib/protos/menu.rb +56 -0
- data/lib/protos/mix.rb +3 -5
- data/lib/protos/modal/close_button.rb +8 -0
- data/lib/protos/modal/dialog.rb +4 -6
- data/lib/protos/modal.rb +6 -1
- data/lib/protos/popover/content.rb +1 -1
- data/lib/protos/popover.rb +24 -21
- data/lib/protos/stats.rb +7 -0
- data/lib/protos/status.rb +46 -0
- data/lib/protos/steps/step.rb +1 -12
- data/lib/protos/steps.rb +5 -3
- data/lib/protos/swap.rb +3 -0
- data/lib/protos/table/caption.rb +5 -3
- data/lib/protos/table/cell.rb +3 -3
- data/lib/protos/table/head.rb +3 -3
- data/lib/protos/table.rb +23 -13
- data/lib/protos/tabs/tab.rb +4 -4
- data/lib/protos/tabs.rb +30 -22
- data/lib/protos/tailwind_merge.rb +65 -0
- data/lib/protos/theme.rb +32 -30
- data/lib/protos/timeline.rb +8 -3
- data/lib/protos/toast.rb +5 -3
- data/lib/protos/types.rb +11 -0
- data/lib/protos/typography/paragraph.rb +3 -3
- data/lib/protos/typography.rb +4 -0
- data/lib/protos/version.rb +1 -1
- data/lib/protos.rb +41 -121
- data/protos.gemspec +4 -5
- metadata +19 -29
- data/lib/protos/command/dialog.rb +0 -40
data/lib/protos/popover.rb
CHANGED
@@ -12,6 +12,9 @@ module Protos
|
|
12
12
|
# Tippy.js options can be passed in via the `options` attribute or, more
|
13
13
|
# conveniently by the typed options listed below.
|
14
14
|
|
15
|
+
autoload :Trigger, "protos/popover/trigger"
|
16
|
+
autoload :Content, "protos/popover/content"
|
17
|
+
|
15
18
|
Positions = Types::Coercible::Symbol.enum(
|
16
19
|
:top,
|
17
20
|
:top_start,
|
@@ -52,33 +55,33 @@ module Protos
|
|
52
55
|
)
|
53
56
|
|
54
57
|
option :position,
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
+
type: Positions,
|
59
|
+
default: -> { :top },
|
60
|
+
reader: false
|
58
61
|
option :animation,
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
+
type: Animations,
|
63
|
+
default: -> { :fade },
|
64
|
+
reader: false
|
62
65
|
option :duration,
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
+
type: Types::Integer | Types::Array.of(Types::Integer),
|
67
|
+
default: -> { [300, 250] },
|
68
|
+
reader: false
|
66
69
|
option :hide_on_click,
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
+
type: Types::Bool | Types.Value(:toggle),
|
71
|
+
default: -> { true },
|
72
|
+
reader: false
|
70
73
|
option :z_index,
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
+
type: Types::Integer,
|
75
|
+
default: -> { 9999 },
|
76
|
+
reader: false
|
74
77
|
option :options,
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
+
default: -> { {} },
|
79
|
+
reader: false,
|
80
|
+
type: Types::Hash
|
78
81
|
option :trigger,
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
+
default: -> { %i[mouseenter focus] },
|
83
|
+
reader: false,
|
84
|
+
type: Triggers | Types::Array.of(Triggers)
|
82
85
|
|
83
86
|
def view_template(&)
|
84
87
|
div(**attrs, &)
|
data/lib/protos/stats.rb
CHANGED
@@ -5,6 +5,13 @@ module Protos
|
|
5
5
|
# DOCS: Stats component that contains a collection of stats
|
6
6
|
# https://daisyui.com/components/stat/
|
7
7
|
|
8
|
+
autoload :Actions, "protos/stats/actions"
|
9
|
+
autoload :Description, "protos/stats/description"
|
10
|
+
autoload :Figure, "protos/stats/figure"
|
11
|
+
autoload :Stat, "protos/stats/stat"
|
12
|
+
autoload :Title, "protos/stats/title"
|
13
|
+
autoload :Value, "protos/stats/value"
|
14
|
+
|
8
15
|
def view_template(&)
|
9
16
|
div(**attrs, &)
|
10
17
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Protos
|
4
|
+
class Status < Component
|
5
|
+
STYLES = {
|
6
|
+
default: "",
|
7
|
+
accent: "status-accent",
|
8
|
+
error: "status-error",
|
9
|
+
info: "status-info",
|
10
|
+
neutral: "status-neutral",
|
11
|
+
primary: "status-primary",
|
12
|
+
secondary: "status-secondary",
|
13
|
+
success: "status-success",
|
14
|
+
warning: "status-warning"
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
Sizes = Types::Coercible::Symbol.enum(:xs, :sm, :md, :lg, :xl)
|
18
|
+
|
19
|
+
SIZES = {
|
20
|
+
xs: "status-xs",
|
21
|
+
sm: "status-sm",
|
22
|
+
md: "status-md",
|
23
|
+
lg: "status-lg",
|
24
|
+
xl: "status-xl"
|
25
|
+
}.freeze
|
26
|
+
|
27
|
+
option :type, type: Types::Styles, default: -> { :primary }
|
28
|
+
option :size, type: Sizes, default: -> { :md }
|
29
|
+
|
30
|
+
def view_template(&)
|
31
|
+
div(**attrs, &)
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def theme
|
37
|
+
{
|
38
|
+
container: [
|
39
|
+
"status",
|
40
|
+
STYLES.fetch(@type),
|
41
|
+
SIZES.fetch(@size)
|
42
|
+
]
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/protos/steps/step.rb
CHANGED
@@ -5,17 +5,6 @@ module Protos
|
|
5
5
|
class Step < Protos::Component
|
6
6
|
# DOCS: Step component that contains a single step in a list of steps
|
7
7
|
|
8
|
-
Styles = Types::Coercible::Symbol.enum(
|
9
|
-
:default,
|
10
|
-
:primary,
|
11
|
-
:secondary,
|
12
|
-
:accent,
|
13
|
-
:info,
|
14
|
-
:success,
|
15
|
-
:warning,
|
16
|
-
:error
|
17
|
-
)
|
18
|
-
|
19
8
|
STYLES = {
|
20
9
|
default: "",
|
21
10
|
primary: "step-primary",
|
@@ -27,7 +16,7 @@ module Protos
|
|
27
16
|
error: "step-error"
|
28
17
|
}.freeze
|
29
18
|
|
30
|
-
option :type, reader: false, type: Styles, default: -> { :default }
|
19
|
+
option :type, reader: false, type: Types::Styles, default: -> { :default }
|
31
20
|
|
32
21
|
def view_template(&)
|
33
22
|
li(**attrs, &)
|
data/lib/protos/steps.rb
CHANGED
@@ -5,6 +5,8 @@ module Protos
|
|
5
5
|
# DOCS: Steps can be used to show a list of steps in a process.
|
6
6
|
# https://daisyui.com/components/steps/
|
7
7
|
|
8
|
+
autoload :Step, "protos/steps/step"
|
9
|
+
|
8
10
|
option :vertical, type: Types::Bool, default: -> { false }
|
9
11
|
|
10
12
|
def view_template(&)
|
@@ -17,10 +19,10 @@ module Protos
|
|
17
19
|
|
18
20
|
def theme
|
19
21
|
{
|
20
|
-
container:
|
22
|
+
container: [
|
21
23
|
"steps",
|
22
|
-
|
23
|
-
|
24
|
+
("steps-vertical" if vertical)
|
25
|
+
]
|
24
26
|
}
|
25
27
|
end
|
26
28
|
end
|
data/lib/protos/swap.rb
CHANGED
data/lib/protos/table/caption.rb
CHANGED
@@ -5,15 +5,17 @@ module Protos
|
|
5
5
|
class Caption < Component
|
6
6
|
# DOCS: The caption of a table
|
7
7
|
|
8
|
+
Sides = Types::Coercible::Symbol.enum(:bottom, :top)
|
9
|
+
|
8
10
|
SIDES = {
|
9
11
|
bottom: "caption-bottom",
|
10
12
|
top: "caption-top"
|
11
13
|
}.freeze
|
12
14
|
|
13
15
|
option :side,
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
reader: false,
|
17
|
+
type: Sides,
|
18
|
+
default: -> { :bottom }
|
17
19
|
|
18
20
|
def view_template(&)
|
19
21
|
caption(**attrs, &)
|
data/lib/protos/table/cell.rb
CHANGED
@@ -12,9 +12,9 @@ module Protos
|
|
12
12
|
}.freeze
|
13
13
|
|
14
14
|
option :align,
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
type: Types::Coercible::Symbol.enum(:left, :center, :right),
|
16
|
+
reader: false,
|
17
|
+
default: -> { :left }
|
18
18
|
|
19
19
|
def view_template(&)
|
20
20
|
td(**attrs, &)
|
data/lib/protos/table/head.rb
CHANGED
@@ -12,9 +12,9 @@ module Protos
|
|
12
12
|
}.freeze
|
13
13
|
|
14
14
|
option :align,
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
type: Types::Coercible::Symbol.enum(:left, :center, :right),
|
16
|
+
reader: false,
|
17
|
+
default: -> { :left }
|
18
18
|
|
19
19
|
def view_template(&)
|
20
20
|
th(**attrs, &)
|
data/lib/protos/table.rb
CHANGED
@@ -5,6 +5,21 @@ module Protos
|
|
5
5
|
# DOCS: A table component
|
6
6
|
# https://daisyui.com/components/table/
|
7
7
|
|
8
|
+
autoload :Caption, "protos/table/caption"
|
9
|
+
autoload :Header, "protos/table/header"
|
10
|
+
autoload :Head, "protos/table/head"
|
11
|
+
autoload :Body, "protos/table/body"
|
12
|
+
autoload :Footer, "protos/table/footer"
|
13
|
+
autoload :Row, "protos/table/row"
|
14
|
+
autoload :Cell, "protos/table/cell"
|
15
|
+
|
16
|
+
Sizes = Types::Coercible::Symbol.enum(
|
17
|
+
:xs,
|
18
|
+
:sm,
|
19
|
+
:md,
|
20
|
+
:lg
|
21
|
+
)
|
22
|
+
|
8
23
|
SIZES = {
|
9
24
|
xs: "table-xs",
|
10
25
|
sm: "table-sm",
|
@@ -16,14 +31,9 @@ module Protos
|
|
16
31
|
option :pin_columns, default: -> { false }, type: Types::Bool
|
17
32
|
option :striped, default: -> { false }, type: Types::Bool
|
18
33
|
option :size,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
:xs,
|
23
|
-
:sm,
|
24
|
-
:md,
|
25
|
-
:lg
|
26
|
-
)
|
34
|
+
default: -> { :md },
|
35
|
+
reader: false,
|
36
|
+
type: Sizes
|
27
37
|
|
28
38
|
def view_template(&block)
|
29
39
|
div(**attrs) do
|
@@ -54,13 +64,13 @@ module Protos
|
|
54
64
|
def theme
|
55
65
|
{
|
56
66
|
container: "w-full overflow-x-auto",
|
57
|
-
table:
|
67
|
+
table: [
|
58
68
|
"table",
|
59
69
|
size,
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
70
|
+
("table-pin-rows" if pin_rows),
|
71
|
+
("table-pin-columns" if pin_columns),
|
72
|
+
("table-striped" if striped)
|
73
|
+
]
|
64
74
|
}
|
65
75
|
end
|
66
76
|
end
|
data/lib/protos/tabs/tab.rb
CHANGED
data/lib/protos/tabs.rb
CHANGED
@@ -5,6 +5,29 @@ module Protos
|
|
5
5
|
# DOCS: A component that contains many Protos::Tab components
|
6
6
|
# https://daisyui.com/components/tab/
|
7
7
|
|
8
|
+
autoload :Tab, "protos/tabs/tab"
|
9
|
+
|
10
|
+
Styles = Types::Coercible::Symbol.enum(
|
11
|
+
:default,
|
12
|
+
:boxed,
|
13
|
+
:bordered,
|
14
|
+
:lifted
|
15
|
+
)
|
16
|
+
|
17
|
+
Sizes = Types::Coercible::Symbol.enum(
|
18
|
+
:xs,
|
19
|
+
:sm,
|
20
|
+
:md,
|
21
|
+
:lg
|
22
|
+
)
|
23
|
+
|
24
|
+
STYLES = {
|
25
|
+
default: "",
|
26
|
+
bordered: "tabs-bordered",
|
27
|
+
boxed: "tabs-boxed",
|
28
|
+
lifted: "tabs-lifted"
|
29
|
+
}.freeze
|
30
|
+
|
8
31
|
SIZES = {
|
9
32
|
xs: "tabs-xs",
|
10
33
|
sm: "tabs-sm",
|
@@ -13,23 +36,13 @@ module Protos
|
|
13
36
|
}.freeze
|
14
37
|
|
15
38
|
option :type,
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
:default,
|
20
|
-
:boxed,
|
21
|
-
:bordered,
|
22
|
-
:lifted
|
23
|
-
)
|
39
|
+
default: -> { :default },
|
40
|
+
reader: false,
|
41
|
+
type: Styles
|
24
42
|
option :size,
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
:xs,
|
29
|
-
:sm,
|
30
|
-
:md,
|
31
|
-
:lg
|
32
|
-
)
|
43
|
+
default: -> { :md },
|
44
|
+
reader: false,
|
45
|
+
type: Sizes
|
33
46
|
|
34
47
|
def view_template(&)
|
35
48
|
div(**attrs, &)
|
@@ -44,12 +57,7 @@ module Protos
|
|
44
57
|
end
|
45
58
|
|
46
59
|
def type
|
47
|
-
|
48
|
-
bordered: "tabs-bordered",
|
49
|
-
boxed: "tabs-boxed",
|
50
|
-
lifted: "tabs-lifted",
|
51
|
-
default: ""
|
52
|
-
}.fetch(@type)
|
60
|
+
STYLES.fetch(@type)
|
53
61
|
end
|
54
62
|
|
55
63
|
def default_attrs
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Protos
|
4
|
+
class TailwindMerge
|
5
|
+
DEFAULTS = ::TailwindMerge::Config::DEFAULTS
|
6
|
+
DAISY_CLASS_GROUPS = {
|
7
|
+
alert: [
|
8
|
+
alert: Protos::Alert::Styles.values.map(&:to_s)
|
9
|
+
],
|
10
|
+
mask: [
|
11
|
+
mask: Protos::Avatar::MaskShapes.values.map(&:to_s)
|
12
|
+
],
|
13
|
+
avatar: [
|
14
|
+
avatar: Protos::Avatar::Indicators.values.map(&:to_s)
|
15
|
+
],
|
16
|
+
badge: [
|
17
|
+
badge: Protos::Badge::Styles.values.map(&:to_s)
|
18
|
+
],
|
19
|
+
card: [
|
20
|
+
card: Protos::Card::Sizes.values.map(&:to_s)
|
21
|
+
],
|
22
|
+
carousel: [
|
23
|
+
carousel: Protos::Carousel::Positions.values.map(&:to_s)
|
24
|
+
],
|
25
|
+
"chat-bubble": [
|
26
|
+
{ "chat-bubble": Protos::ChatBubble::Positions.values.map(&:to_s) },
|
27
|
+
{
|
28
|
+
"chat-bubble": Types::Styles.values.map(&:to_s)
|
29
|
+
}
|
30
|
+
],
|
31
|
+
menu: [
|
32
|
+
menu: Protos::Menu::Sizes.values.map(&:to_s)
|
33
|
+
],
|
34
|
+
table: [
|
35
|
+
table: Protos::Table::Sizes.values.map(&:to_s)
|
36
|
+
],
|
37
|
+
tab: [
|
38
|
+
tab: Protos::Tabs::Sizes.values.map(&:to_s)
|
39
|
+
],
|
40
|
+
caption: [
|
41
|
+
caption: Protos::Table::Caption::Sides.values.map(&:to_s)
|
42
|
+
],
|
43
|
+
swap: [
|
44
|
+
swap: %w[on off]
|
45
|
+
],
|
46
|
+
step: [
|
47
|
+
step: Types::Styles.values.map(&:to_s)
|
48
|
+
]
|
49
|
+
}.freeze
|
50
|
+
|
51
|
+
def initialize
|
52
|
+
@merger = ::TailwindMerge::Merger.new(
|
53
|
+
config: DEFAULTS.merge(
|
54
|
+
ignore_empty_cache: true,
|
55
|
+
cache_size: 500,
|
56
|
+
class_groups: DEFAULTS[:class_groups].merge(DAISY_CLASS_GROUPS)
|
57
|
+
)
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def merge(...)
|
62
|
+
@merger.merge(...)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/lib/protos/theme.rb
CHANGED
@@ -9,30 +9,40 @@ module Protos
|
|
9
9
|
|
10
10
|
class << self
|
11
11
|
def merger
|
12
|
-
|
12
|
+
# This could be a class variable to save memory for subclasses being
|
13
|
+
# used along side this class, but seeing as how its an
|
14
|
+
# internal class I don't see much benefit at the moment.
|
15
|
+
@merger ||= TailwindMerge.new
|
13
16
|
end
|
14
17
|
end
|
15
18
|
|
16
19
|
def initialize(theme = {}, tailwind_merge: true, **kwargs)
|
17
|
-
@
|
20
|
+
@should_merge = tailwind_merge
|
18
21
|
|
19
22
|
@theme = Hash.new do |hash, key|
|
20
23
|
hash[key] = TokenList.new
|
21
24
|
end
|
22
25
|
|
26
|
+
return if kwargs.empty? && theme.empty?
|
27
|
+
|
23
28
|
theme.merge!(kwargs).each do |key, value|
|
24
29
|
@theme[key].add(value)
|
25
30
|
end
|
26
31
|
end
|
27
32
|
|
28
|
-
|
29
|
-
|
33
|
+
# Key can be a symbol or string, they will be merged together for the final
|
34
|
+
# css class.
|
35
|
+
# - A symbol will be used to fetch a `TokenList` from the theme at that key.
|
36
|
+
# - A string is used as a plain css value
|
37
|
+
def [](*keys)
|
38
|
+
symbols, strings = keys.partition { |key| key.instance_of?(Symbol) }
|
39
|
+
values = @theme.values_at(*symbols).map!(&:to_s).reject(&:empty?)
|
40
|
+
values.concat(strings) unless strings.empty?
|
30
41
|
|
31
|
-
|
32
|
-
return
|
33
|
-
return value unless @tailwind_merge
|
42
|
+
return nil if values.empty?
|
43
|
+
return values unless @should_merge
|
34
44
|
|
35
|
-
self.class.merger.merge(
|
45
|
+
self.class.merger.merge(values)
|
36
46
|
end
|
37
47
|
|
38
48
|
def key?(key)
|
@@ -46,42 +56,34 @@ module Protos
|
|
46
56
|
end
|
47
57
|
|
48
58
|
def remove(key, value)
|
49
|
-
@theme[key].remove(value)
|
50
|
-
@theme.delete(key) if
|
59
|
+
token_list = @theme[key].remove(value)
|
60
|
+
@theme.delete(key) if token_list.empty?
|
51
61
|
end
|
52
62
|
|
53
63
|
def set(key, value)
|
54
64
|
return if value.nil?
|
55
65
|
|
56
|
-
@theme
|
66
|
+
if @theme.key?(key)
|
67
|
+
@theme[key].clear.add(value)
|
68
|
+
else
|
69
|
+
@theme[key].add(value)
|
70
|
+
end
|
57
71
|
end
|
58
72
|
|
59
73
|
def merge(hash)
|
60
74
|
return self unless hash
|
61
75
|
|
62
76
|
hash.each do |key, value|
|
63
|
-
if key?(key)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
set(key, value)
|
71
|
-
end
|
77
|
+
next add(key, value) if key?(key.to_sym)
|
78
|
+
# Handle negation
|
79
|
+
next remove(key[1..].to_sym, value) if key.start_with?("!")
|
80
|
+
# handle override
|
81
|
+
next set(key[..-2].to_sym, value) if key.end_with?("!")
|
82
|
+
|
83
|
+
set(key.to_sym, value)
|
72
84
|
end
|
73
85
|
|
74
86
|
self
|
75
87
|
end
|
76
|
-
|
77
|
-
private
|
78
|
-
|
79
|
-
def negation?(key)
|
80
|
-
key.start_with?("!")
|
81
|
-
end
|
82
|
-
|
83
|
-
def override?(key)
|
84
|
-
key.end_with?("!")
|
85
|
-
end
|
86
88
|
end
|
87
89
|
end
|
data/lib/protos/timeline.rb
CHANGED
@@ -5,6 +5,11 @@ module Protos
|
|
5
5
|
# DOCS: A timeline component
|
6
6
|
# https://daisyui.com/components/timeline/
|
7
7
|
|
8
|
+
autoload :Item, "protos/timeline/item"
|
9
|
+
autoload :Left, "protos/timeline/left"
|
10
|
+
autoload :Center, "protos/timeline/center"
|
11
|
+
autoload :Right, "protos/timeline/right"
|
12
|
+
|
8
13
|
option :vertical, type: Types::Bool, default: -> { false }
|
9
14
|
|
10
15
|
def view_template(&)
|
@@ -23,10 +28,10 @@ module Protos
|
|
23
28
|
|
24
29
|
def theme
|
25
30
|
{
|
26
|
-
container:
|
31
|
+
container: [
|
27
32
|
"timeline",
|
28
|
-
|
29
|
-
|
33
|
+
("timeline-vertical" if vertical)
|
34
|
+
]
|
30
35
|
}
|
31
36
|
end
|
32
37
|
end
|
data/lib/protos/toast.rb
CHANGED
@@ -6,6 +6,8 @@ module Protos
|
|
6
6
|
# that popup at a fixed position on the screen.
|
7
7
|
# https://daisyui.com/components/toast/
|
8
8
|
|
9
|
+
autoload :CloseButton, "protos/toast/close_button"
|
10
|
+
|
9
11
|
Positions = Types::Symbol.enum(
|
10
12
|
:top_start,
|
11
13
|
:top_center,
|
@@ -31,9 +33,9 @@ module Protos
|
|
31
33
|
}.freeze
|
32
34
|
|
33
35
|
option :position,
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
type: Positions,
|
37
|
+
default: -> { :bottom_end },
|
38
|
+
reader: false
|
37
39
|
|
38
40
|
def view_template(&)
|
39
41
|
dialog(**attrs, &)
|
data/lib/protos/types.rb
CHANGED
data/lib/protos/typography.rb
CHANGED
@@ -5,6 +5,10 @@ module Protos
|
|
5
5
|
# DOCS: The core typography module that can be mixedin to override the
|
6
6
|
# default elements with custom elements.
|
7
7
|
|
8
|
+
autoload :Heading, "protos/typography/heading"
|
9
|
+
autoload :Paragraph, "protos/typography/paragraph"
|
10
|
+
autoload :InlineLink, "protos/typography/inline_link"
|
11
|
+
|
8
12
|
def h1(**, &)
|
9
13
|
render Heading.new(level: 1, size: :xl, **, &)
|
10
14
|
end
|
data/lib/protos/version.rb
CHANGED