protos 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e18641b7b93b0f94886468a48ed3c3263bb5edd72dbaeabfc03e346598f0d409
4
- data.tar.gz: 207f45d2b30525c4ed65f83943c2c4eb0617a72dacabc7238a9f3cd4309ad96d
3
+ metadata.gz: d7b9c6eb83f7c89f66d1f625fd200b2f6595c098130e16da1fcb6b2e96dd59fe
4
+ data.tar.gz: 07a7e91d1ef7041dba38b72eb412309d31cf6426ad1e3b157f6a83fab59a32dd
5
5
  SHA512:
6
- metadata.gz: 844cc78e0e2972c8e726a46af3ed08e420c3581d93c79f04b266019f10a38f2441b4ec1a76ec787b16592698cc80c742d1d87d8cc793ac0259bd5baa0acbc893
7
- data.tar.gz: 7b0c9022724175b60e5d1f53efb75237f944889e07fee18c8ff99165b1ae8b87843e9d0fb7ad3f8358788af565938e240141d386f29f31ac372efb71a95c40b0
6
+ metadata.gz: 36fa9e7809d68b3d1227814cb7bb23fc44066813de58360486f5c7ffffafb30f58f6cb50309aef8902796ea234dfe3f5dcd46b451673cf77600da5f257840e33
7
+ data.tar.gz: 8ee74d55eebfaaec0d488809563695bf456229ed8dad466a10b6b5f20c117ed02644ef2a7a9646679a47697cae06eca5e6e50f21a863292d46c9753be4c82939
data/CHANGELOG.md CHANGED
@@ -1,31 +1,38 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2024-03-01
3
+ ## [0.4.3] - 2024-08-14
4
4
 
5
- - Initial release
5
+ - Removes unneeded auto-loading in Rails which fixes collisions with `protos-markdown`
6
+ - Adds fixes for handling form submissions within modals with `protos-stimulus`
7
+ v0.0.3
8
+ - Adds ability to disable margin on p tags with `Protos::Typography`
6
9
 
7
- ## [0.2.0] - 2024-03-06
10
+ ## [0.4.2] - 2024-04-30
8
11
 
9
- - Chose to move away from daisyUI dropdown defaults as they have problems
10
- displaying properly in too many situations
11
- - Opted for using a protos-stimulus controller that uses tippy.js
12
+ - Adds ability to pass arrays of tokens to themes
13
+ - Removes unnecessary calls to `tokens`, preferring arrays of strings for
14
+ performance
15
+ - Improvements to performance with constant hash lookups and early returns on
16
+ `mix`
17
+ - Adds steps component
18
+
19
+ ## [0.4.0] - 2024-04-09
20
+
21
+ - Phlex discord didn't like all the calls to `render`
22
+ - Apparently `render` is called differently within ERB
23
+ - Suggested to change all calls to immediately render, would improve ergonomics
12
24
 
13
25
  ## [0.3.0] - 2024-04-06
14
26
 
15
27
  - Updates to phlex v0.10 by changing all `template` methods to `view_template`
16
28
  - Improvements to README
17
29
 
18
- ## [0.4.0] - 2024-04-09
30
+ ## [0.2.0] - 2024-03-06
19
31
 
20
- - Phlex discord didn't like all the calls to `render`
21
- - Apparently `render` is called differently within ERB
22
- - Suggested to change all calls to immediately render, would improve ergonomics
32
+ - Chose to move away from daisyUI dropdown defaults as they have problems
33
+ displaying properly in too many situations
34
+ - Opted for using a protos-stimulus controller that uses tippy.js
23
35
 
24
- ## [0.4.2] - 2024-04-30
36
+ ## [0.1.0] - 2024-03-01
25
37
 
26
- - Adds ability to pass arrays of tokens to themes
27
- - Removes unnecessary calls to `tokens`, preferring arrays of strings for
28
- performance
29
- - Improvements to performance with constant hash lookups and early returns on
30
- `mix`
31
- - Adds steps component
38
+ - Initial release
@@ -12,6 +12,14 @@ module Protos
12
12
  ul(class: css[:list], &block)
13
13
  end
14
14
  end
15
+
16
+ private
17
+
18
+ def default_attrs
19
+ {
20
+ data: { "protos--command-target": "group" }
21
+ }
22
+ end
15
23
  end
16
24
  end
17
25
  end
@@ -17,7 +17,10 @@ module Protos
17
17
  div(class: css[:icon], &block) if block
18
18
  input(
19
19
  type: :text,
20
- data: { action: "protos--command#filter" },
20
+ data: {
21
+ action: "protos--command#filter",
22
+ "protos--command-target": "input"
23
+ },
21
24
  class: css[:input],
22
25
  placeholder:,
23
26
  autocomplete: :off
@@ -13,7 +13,10 @@ module Protos
13
13
 
14
14
  def default_attrs
15
15
  {
16
- data: { "protos--command-target": "item" }
16
+ data: {
17
+ "protos--command-target": "item",
18
+ action: "turbo:submit-end->protos--modal#handleFormSubmit"
19
+ }
17
20
  }
18
21
  end
19
22
  end
@@ -10,21 +10,21 @@ module Protos
10
10
  div(**attrs, &)
11
11
  end
12
12
 
13
- def input(...) = render Input.new(...)
13
+ def input(...) = render Command::Input.new(...)
14
14
 
15
- def list(...) = render List.new(...)
15
+ def list(...) = render Command::List.new(...)
16
16
 
17
- def trigger(...) = render Trigger.new(...)
17
+ def trigger(...) = render Command::Trigger.new(...)
18
18
 
19
- def dialog(...) = render Dialog.new(...)
19
+ def dialog(...) = render Command::Dialog.new(...)
20
20
 
21
- def title(...) = render Title.new(...)
21
+ def title(...) = render Command::Title.new(...)
22
22
 
23
- def group(...) = render Group.new(...)
23
+ def group(...) = render Command::Group.new(...)
24
24
 
25
- def item(...) = render Item.new(...)
25
+ def item(...) = render Command::Item.new(...)
26
26
 
27
- def empty(...) = render Empty.new(...)
27
+ def empty(...) = render Command::Empty.new(...)
28
28
 
29
29
  private
30
30
 
data/lib/protos/engine.rb CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  module Protos
4
4
  class Engine < ::Rails::Engine
5
- # DOCS: This is the engine for the Protos gem. It allows autoloading the lib
6
- # when used inside a Rails app.
7
-
8
- config.autoload_paths += Dir["#{config.root}/lib/"]
5
+ # DOCS: This is the engine for the Protos gem. It allows autoloading the
6
+ # lib when used inside a Rails app.
9
7
  end
10
8
  end
@@ -5,6 +5,8 @@ module Protos
5
5
  class Paragraph < Component
6
6
  # DOCS: A paragraph of text
7
7
 
8
+ option :margin, default: -> { true }
9
+
8
10
  def view_template(&)
9
11
  p(**attrs, &)
10
12
  end
@@ -13,9 +15,9 @@ module Protos
13
15
 
14
16
  def theme
15
17
  {
16
- container: %w(
17
- leading-relaxed
18
- [&:not(:first-child)]:mt-sm
18
+ container: tokens(
19
+ "leading-relaxed",
20
+ margin: "[&:not(:first-child)]:mt-sm"
19
21
  )
20
22
  }
21
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Protos
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.3"
5
5
  end
data/lib/protos.rb CHANGED
@@ -8,128 +8,126 @@ require "tailwind_merge"
8
8
 
9
9
  module Protos
10
10
  class Error < StandardError; end
11
-
12
- if defined?(Rails)
13
- require_relative "protos/engine"
14
- else
15
- require_relative "protos/version"
16
- require_relative "protos/types"
17
- require_relative "protos/token_list"
18
- require_relative "protos/component"
19
- require_relative "protos/theme"
20
- require_relative "protos/attributes"
21
-
22
- # Components
23
- require_relative "protos/accordion"
24
- require_relative "protos/accordion/item"
25
-
26
- require_relative "protos/alert"
27
- require_relative "protos/alert/actions"
28
- require_relative "protos/alert/icon"
29
-
30
- require_relative "protos/avatar"
31
-
32
- require_relative "protos/breadcrumbs"
33
- require_relative "protos/breadcrumbs/crumb"
34
-
35
- require_relative "protos/card"
36
- require_relative "protos/card/body"
37
- require_relative "protos/card/title"
38
- require_relative "protos/card/actions"
39
- require_relative "protos/card/image"
40
-
41
- require_relative "protos/carousel"
42
- require_relative "protos/carousel/item"
43
- require_relative "protos/carousel/actions"
44
-
45
- require_relative "protos/chat_bubble"
46
- require_relative "protos/chat_bubble/content"
47
- require_relative "protos/chat_bubble/image"
48
- require_relative "protos/chat_bubble/header"
49
- require_relative "protos/chat_bubble/footer"
50
-
51
- require_relative "protos/collapse"
52
- require_relative "protos/collapse/title"
53
- require_relative "protos/collapse/content"
54
-
55
- require_relative "protos/command"
56
- require_relative "protos/command/input"
57
- require_relative "protos/command/dialog"
58
- require_relative "protos/command/group"
59
- require_relative "protos/command/list"
60
- require_relative "protos/command/trigger"
61
- require_relative "protos/command/title"
62
- require_relative "protos/command/item"
63
- require_relative "protos/command/empty"
64
-
65
- require_relative "protos/drawer"
66
- require_relative "protos/drawer/side"
67
- require_relative "protos/drawer/trigger"
68
- require_relative "protos/drawer/content"
69
-
70
- require_relative "protos/hero"
71
- require_relative "protos/hero/content"
72
- require_relative "protos/hero/overlay"
73
-
74
- require_relative "protos/list"
75
- require_relative "protos/list/item"
76
-
77
- require_relative "protos/modal"
78
- require_relative "protos/modal/close_button"
79
- require_relative "protos/modal/dialog"
80
- require_relative "protos/modal/trigger"
81
-
82
- require_relative "protos/popover"
83
- require_relative "protos/popover/trigger"
84
- require_relative "protos/popover/content"
85
-
86
- require_relative "protos/stats"
87
- require_relative "protos/stats/actions"
88
- require_relative "protos/stats/description"
89
- require_relative "protos/stats/figure"
90
- require_relative "protos/stats/stat"
91
- require_relative "protos/stats/title"
92
- require_relative "protos/stats/value"
93
-
94
- require_relative "protos/steps"
95
- require_relative "protos/steps/step"
96
-
97
- require_relative "protos/swap"
98
- require_relative "protos/swap/on"
99
- require_relative "protos/swap/off"
100
-
101
- require_relative "protos/tabs"
102
- require_relative "protos/tabs/tab"
103
-
104
- require_relative "protos/table"
105
- require_relative "protos/table/caption"
106
- require_relative "protos/table/header"
107
- require_relative "protos/table/head"
108
- require_relative "protos/table/body"
109
- require_relative "protos/table/footer"
110
- require_relative "protos/table/row"
111
- require_relative "protos/table/cell"
112
-
113
- require_relative "protos/toast"
114
- require_relative "protos/toast/close_button"
115
-
116
- require_relative "protos/timeline"
117
- require_relative "protos/timeline/item"
118
- require_relative "protos/timeline/left"
119
- require_relative "protos/timeline/center"
120
- require_relative "protos/timeline/right"
121
-
122
- require_relative "protos/typography"
123
- require_relative "protos/typography/heading"
124
- require_relative "protos/typography/paragraph"
125
- require_relative "protos/typography/inline_link"
126
-
127
- # Dependent
128
- require_relative "protos/dropdown"
129
- require_relative "protos/dropdown/item"
130
- require_relative "protos/dropdown/menu"
131
- require_relative "protos/dropdown/trigger"
132
-
133
- require_relative "protos/combobox"
134
- end
135
11
  end
12
+
13
+ require_relative "protos/version"
14
+ require_relative "protos/types"
15
+ require_relative "protos/token_list"
16
+ require_relative "protos/component"
17
+ require_relative "protos/theme"
18
+ require_relative "protos/attributes"
19
+
20
+ # Components
21
+ require_relative "protos/accordion"
22
+ require_relative "protos/accordion/item"
23
+
24
+ require_relative "protos/alert"
25
+ require_relative "protos/alert/actions"
26
+ require_relative "protos/alert/icon"
27
+
28
+ require_relative "protos/avatar"
29
+
30
+ require_relative "protos/breadcrumbs"
31
+ require_relative "protos/breadcrumbs/crumb"
32
+
33
+ require_relative "protos/card"
34
+ require_relative "protos/card/body"
35
+ require_relative "protos/card/title"
36
+ require_relative "protos/card/actions"
37
+ require_relative "protos/card/image"
38
+
39
+ require_relative "protos/carousel"
40
+ require_relative "protos/carousel/item"
41
+ require_relative "protos/carousel/actions"
42
+
43
+ require_relative "protos/chat_bubble"
44
+ require_relative "protos/chat_bubble/content"
45
+ require_relative "protos/chat_bubble/image"
46
+ require_relative "protos/chat_bubble/header"
47
+ require_relative "protos/chat_bubble/footer"
48
+
49
+ require_relative "protos/collapse"
50
+ require_relative "protos/collapse/title"
51
+ require_relative "protos/collapse/content"
52
+
53
+ require_relative "protos/command"
54
+ require_relative "protos/command/input"
55
+ require_relative "protos/command/dialog"
56
+ require_relative "protos/command/group"
57
+ require_relative "protos/command/list"
58
+ require_relative "protos/command/trigger"
59
+ require_relative "protos/command/title"
60
+ require_relative "protos/command/item"
61
+ require_relative "protos/command/empty"
62
+
63
+ require_relative "protos/drawer"
64
+ require_relative "protos/drawer/side"
65
+ require_relative "protos/drawer/trigger"
66
+ require_relative "protos/drawer/content"
67
+
68
+ require_relative "protos/hero"
69
+ require_relative "protos/hero/content"
70
+ require_relative "protos/hero/overlay"
71
+
72
+ require_relative "protos/list"
73
+ require_relative "protos/list/item"
74
+
75
+ require_relative "protos/modal"
76
+ require_relative "protos/modal/close_button"
77
+ require_relative "protos/modal/dialog"
78
+ require_relative "protos/modal/trigger"
79
+
80
+ require_relative "protos/popover"
81
+ require_relative "protos/popover/trigger"
82
+ require_relative "protos/popover/content"
83
+
84
+ require_relative "protos/stats"
85
+ require_relative "protos/stats/actions"
86
+ require_relative "protos/stats/description"
87
+ require_relative "protos/stats/figure"
88
+ require_relative "protos/stats/stat"
89
+ require_relative "protos/stats/title"
90
+ require_relative "protos/stats/value"
91
+
92
+ require_relative "protos/steps"
93
+ require_relative "protos/steps/step"
94
+
95
+ require_relative "protos/swap"
96
+ require_relative "protos/swap/on"
97
+ require_relative "protos/swap/off"
98
+
99
+ require_relative "protos/tabs"
100
+ require_relative "protos/tabs/tab"
101
+
102
+ require_relative "protos/table"
103
+ require_relative "protos/table/caption"
104
+ require_relative "protos/table/header"
105
+ require_relative "protos/table/head"
106
+ require_relative "protos/table/body"
107
+ require_relative "protos/table/footer"
108
+ require_relative "protos/table/row"
109
+ require_relative "protos/table/cell"
110
+
111
+ require_relative "protos/toast"
112
+ require_relative "protos/toast/close_button"
113
+
114
+ require_relative "protos/timeline"
115
+ require_relative "protos/timeline/item"
116
+ require_relative "protos/timeline/left"
117
+ require_relative "protos/timeline/center"
118
+ require_relative "protos/timeline/right"
119
+
120
+ require_relative "protos/typography"
121
+ require_relative "protos/typography/heading"
122
+ require_relative "protos/typography/paragraph"
123
+ require_relative "protos/typography/inline_link"
124
+
125
+ # Dependent
126
+ require_relative "protos/dropdown"
127
+ require_relative "protos/dropdown/item"
128
+ require_relative "protos/dropdown/menu"
129
+ require_relative "protos/dropdown/trigger"
130
+
131
+ require_relative "protos/combobox"
132
+
133
+ require_relative "protos/engine" if defined?(Rails)
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.2
4
+ version: 0.4.3
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-04-30 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-core
@@ -220,7 +220,7 @@ requirements:
220
220
  - tailwindcss
221
221
  - daisyui
222
222
  - protos-stimulus
223
- rubygems_version: 3.5.7
223
+ rubygems_version: 3.5.17
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: A UI component library built with phlex and daisyui