protos 0.2.0 → 0.2.1
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/lib/protos/combobox.rb +1 -1
- data/lib/protos/command/list.rb +6 -0
- data/lib/protos/command.rb +1 -1
- data/lib/protos/swap.rb +3 -2
- data/lib/protos/table.rb +29 -1
- data/lib/protos/toast.rb +28 -8
- data/lib/protos/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5001f5f332c249597cb0f0c40cb8ff83429d7843db7c2f3f6cfc3b3ad6e9b50
|
4
|
+
data.tar.gz: 4e0426a89a66cd600cafe5411b02f6b3c5088dcc12bf64148d238bc542878459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eab1e457a004e0501c698f22a3c1aefb389a28a7970f864762320d4a4628e3b502d4a70080f05cdafc112d4dedd3d8a79637428ecef2194ccdf98d93111f2312
|
7
|
+
data.tar.gz: 3b1325007d6ad4c99bc478213aebf31bc03463308f591de7051d5542a95f1d9fd76d176d8e2a6d1396887b7f997e8bb19f14bde22d8544036144d2633317b98b
|
data/lib/protos/combobox.rb
CHANGED
data/lib/protos/command/list.rb
CHANGED
data/lib/protos/command.rb
CHANGED
data/lib/protos/swap.rb
CHANGED
@@ -4,7 +4,7 @@ module Protos
|
|
4
4
|
class Swap < Component
|
5
5
|
def template
|
6
6
|
label(**attrs) do
|
7
|
-
input(type: :checkbox)
|
7
|
+
input(type: :checkbox, class: css[:input])
|
8
8
|
yield if block_given?
|
9
9
|
end
|
10
10
|
end
|
@@ -21,7 +21,8 @@ module Protos
|
|
21
21
|
|
22
22
|
def theme
|
23
23
|
{
|
24
|
-
container: tokens("swap")
|
24
|
+
container: tokens("swap"),
|
25
|
+
input: tokens("hidden")
|
25
26
|
}
|
26
27
|
end
|
27
28
|
end
|
data/lib/protos/table.rb
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
|
3
3
|
module Protos
|
4
4
|
class Table < Component
|
5
|
+
option :pin_rows, default: -> { false }, type: Types::Bool
|
6
|
+
option :pin_columns, default: -> { false }, type: Types::Bool
|
7
|
+
option :striped, default: -> { false }, type: Types::Bool
|
8
|
+
option :size,
|
9
|
+
default: -> { :md },
|
10
|
+
reader: false,
|
11
|
+
type: Types::Coercible::Symbol.enum(
|
12
|
+
:xs,
|
13
|
+
:sm,
|
14
|
+
:md,
|
15
|
+
:lg
|
16
|
+
)
|
17
|
+
|
5
18
|
def template(&block)
|
6
19
|
div(**attrs) do
|
7
20
|
table(class: css[:table], &block)
|
@@ -38,10 +51,25 @@ module Protos
|
|
38
51
|
|
39
52
|
private
|
40
53
|
|
54
|
+
def size
|
55
|
+
{
|
56
|
+
xs: "table-xs",
|
57
|
+
sm: "table-sm",
|
58
|
+
md: "table-md",
|
59
|
+
lg: "table-lg"
|
60
|
+
}.fetch(@size)
|
61
|
+
end
|
62
|
+
|
41
63
|
def theme
|
42
64
|
{
|
43
65
|
container: tokens("w-full", "overflow-x-auto"),
|
44
|
-
table: tokens(
|
66
|
+
table: tokens(
|
67
|
+
"table",
|
68
|
+
size,
|
69
|
+
pin_rows: "table-pin-rows",
|
70
|
+
pin_columns: "table-pin-columns",
|
71
|
+
striped: "table-striped"
|
72
|
+
)
|
45
73
|
}
|
46
74
|
end
|
47
75
|
end
|
data/lib/protos/toast.rb
CHANGED
@@ -3,15 +3,21 @@
|
|
3
3
|
module Protos
|
4
4
|
class Toast < Component
|
5
5
|
Positions = Types::Symbol.enum(
|
6
|
-
:
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
6
|
+
:top_start,
|
7
|
+
:top_center,
|
8
|
+
:top_end,
|
9
|
+
:middle_start,
|
10
|
+
:middle_center,
|
11
|
+
:middle_end,
|
12
|
+
:bottom_start,
|
13
|
+
:bottom_center,
|
14
|
+
:bottom_end
|
12
15
|
)
|
13
16
|
|
14
|
-
option :position,
|
17
|
+
option :position,
|
18
|
+
type: Positions,
|
19
|
+
default: -> { :bottom_end },
|
20
|
+
reader: false
|
15
21
|
|
16
22
|
def template(&block)
|
17
23
|
dialog(**attrs, &block)
|
@@ -29,11 +35,25 @@ module Protos
|
|
29
35
|
}
|
30
36
|
end
|
31
37
|
|
38
|
+
def position
|
39
|
+
{
|
40
|
+
top_start: "toast-start toast-top",
|
41
|
+
top_center: "toast-center toast-top",
|
42
|
+
top_end: "toast-end toast-top",
|
43
|
+
middle_start: "toast-start toast-middle",
|
44
|
+
middle_center: "toast-center toast-middle",
|
45
|
+
middle_end: "toast-end toast-middle",
|
46
|
+
bottom_start: "toast-start toast-bottom",
|
47
|
+
bottom_center: "toast-center toast-bottom",
|
48
|
+
bottom_end: "toast-end toast-bottom"
|
49
|
+
}.fetch(@position)
|
50
|
+
end
|
51
|
+
|
32
52
|
def theme
|
33
53
|
{
|
34
54
|
container: tokens(
|
35
55
|
"toast",
|
36
|
-
|
56
|
+
position,
|
37
57
|
"[&:not([open])]:hidden",
|
38
58
|
"bg-transparent"
|
39
59
|
)
|
data/lib/protos/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.1
|
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-03-
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-core
|