ariadne_view_components 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +68 -0
  4. data/app/assets/javascripts/ariadne_view_components.js +2 -0
  5. data/app/assets/javascripts/ariadne_view_components.js.map +1 -0
  6. data/app/assets/stylesheets/application.tailwind.css +3 -0
  7. data/app/components/ariadne/ariadne.ts +14 -0
  8. data/app/components/ariadne/base_button.rb +60 -0
  9. data/app/components/ariadne/base_component.rb +155 -0
  10. data/app/components/ariadne/button_component.html.erb +4 -0
  11. data/app/components/ariadne/button_component.rb +158 -0
  12. data/app/components/ariadne/clipboard_copy_component.html.erb +8 -0
  13. data/app/components/ariadne/clipboard_copy_component.rb +50 -0
  14. data/app/components/ariadne/clipboard_copy_component.ts +19 -0
  15. data/app/components/ariadne/component.rb +123 -0
  16. data/app/components/ariadne/content.rb +12 -0
  17. data/app/components/ariadne/counter_component.rb +100 -0
  18. data/app/components/ariadne/flash_component.html.erb +31 -0
  19. data/app/components/ariadne/flash_component.rb +125 -0
  20. data/app/components/ariadne/heading_component.rb +49 -0
  21. data/app/components/ariadne/heroicon_component.html.erb +7 -0
  22. data/app/components/ariadne/heroicon_component.rb +116 -0
  23. data/app/components/ariadne/image_component.rb +51 -0
  24. data/app/components/ariadne/text.rb +25 -0
  25. data/app/components/ariadne/tooltip_component.rb +105 -0
  26. data/app/lib/ariadne/audited/dsl.rb +32 -0
  27. data/app/lib/ariadne/class_name_helper.rb +22 -0
  28. data/app/lib/ariadne/fetch_or_fallback_helper.rb +100 -0
  29. data/app/lib/ariadne/icon_helper.rb +47 -0
  30. data/app/lib/ariadne/join_style_arguments_helper.rb +14 -0
  31. data/app/lib/ariadne/logger_helper.rb +23 -0
  32. data/app/lib/ariadne/status/dsl.rb +41 -0
  33. data/app/lib/ariadne/tab_nav_helper.rb +35 -0
  34. data/app/lib/ariadne/tabbed_component_helper.rb +39 -0
  35. data/app/lib/ariadne/test_selector_helper.rb +20 -0
  36. data/app/lib/ariadne/underline_nav_helper.rb +44 -0
  37. data/app/lib/ariadne/view_helper.rb +22 -0
  38. data/lib/ariadne/classify/utilities.rb +199 -0
  39. data/lib/ariadne/classify/utilities.yml +1817 -0
  40. data/lib/ariadne/classify/validation.rb +18 -0
  41. data/lib/ariadne/classify.rb +210 -0
  42. data/lib/ariadne/view_components/constants.rb +53 -0
  43. data/lib/ariadne/view_components/engine.rb +30 -0
  44. data/lib/ariadne/view_components/linters.rb +3 -0
  45. data/lib/ariadne/view_components/statuses.rb +14 -0
  46. data/lib/ariadne/view_components/version.rb +7 -0
  47. data/lib/ariadne/view_components.rb +59 -0
  48. data/lib/rubocop/config/default.yml +14 -0
  49. data/lib/rubocop/cop/ariadne/ariadne_heroicon.rb +252 -0
  50. data/lib/rubocop/cop/ariadne/base_cop.rb +26 -0
  51. data/lib/rubocop/cop/ariadne/component_name_migration.rb +35 -0
  52. data/lib/rubocop/cop/ariadne/no_tag_memoize.rb +43 -0
  53. data/lib/rubocop/cop/ariadne/system_argument_instead_of_class.rb +57 -0
  54. data/lib/rubocop/cop/ariadne.rb +3 -0
  55. data/lib/tasks/ariadne_view_components.rake +47 -0
  56. data/lib/tasks/coverage.rake +19 -0
  57. data/lib/tasks/custom_utilities.yml +310 -0
  58. data/lib/tasks/docs.rake +525 -0
  59. data/lib/tasks/helpers/ast_processor.rb +44 -0
  60. data/lib/tasks/helpers/ast_traverser.rb +77 -0
  61. data/lib/tasks/static.rake +15 -0
  62. data/lib/tasks/tailwind.rake +31 -0
  63. data/lib/tasks/utilities.rake +121 -0
  64. data/lib/yard/docs_helper.rb +83 -0
  65. data/lib/yard/renders_many_handler.rb +19 -0
  66. data/lib/yard/renders_one_handler.rb +19 -0
  67. data/static/arguments.yml +251 -0
  68. data/static/assets/view-components.svg +18 -0
  69. data/static/audited_at.json +14 -0
  70. data/static/classes.yml +89 -0
  71. data/static/constants.json +243 -0
  72. data/static/statuses.json +14 -0
  73. data/static/tailwindcss.yml +727 -0
  74. metadata +193 -0
@@ -0,0 +1,243 @@
1
+ {
2
+ "Ariadne::BaseButton": {
3
+ "DEFAULT_CLASSES": "inline-flex items-center px-4 py-2 text-sm border border-gray-300 shadow-sm text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",
4
+ "DEFAULT_SIZE": "m",
5
+ "DEFAULT_TAG": "button",
6
+ "DEFAULT_TYPE": "button",
7
+ "SIZE_CLASS_MAPPINGS": {
8
+ "xs": "inline-flex items-center px-2.5 py-1.5 text-xs font-medium rounded",
9
+ "s": "inline-flex items-center px-3 py-2 text-sm leading-4 font-medium rounded-m",
10
+ "m": "inline-flex items-center px-4 py-2 text-sm font-medium rounded-md",
11
+ "l": "inline-flex items-center px-4 py-2 text-base font-medium rounded-md",
12
+ "xl": "inline-flex items-center px-6 py-3 text-base font-medium rounded-md"
13
+ },
14
+ "TAG_OPTIONS": [
15
+ "button",
16
+ "a",
17
+ "summary"
18
+ ],
19
+ "TYPE_OPTIONS": [
20
+ "button",
21
+ "reset",
22
+ "submit"
23
+ ],
24
+ "VALID_SIZES": [
25
+ "xs",
26
+ "s",
27
+ "m",
28
+ "l",
29
+ "xl"
30
+ ]
31
+ },
32
+ "Ariadne::BaseComponent": {
33
+ "SELF_CLOSING_TAGS": [
34
+ "area",
35
+ "base",
36
+ "br",
37
+ "col",
38
+ "embed",
39
+ "hr",
40
+ "img",
41
+ "input",
42
+ "link",
43
+ "meta",
44
+ "param",
45
+ "source",
46
+ "track",
47
+ "wbr"
48
+ ]
49
+ },
50
+ "Ariadne::ButtonComponent": {
51
+ "DEFAULT_SCHEME": "default",
52
+ "LINK_SCHEME": "link",
53
+ "SCHEME_CLASS_MAPPINGS": {
54
+ "default": "text-blue-800 bg-blue-50 hover:bg-blue-100 border-blue-300 focus:ring-offset-blue-50 focus:ring-blue-600",
55
+ "info": "text-blue-800 bg-blue-50 hover:bg-blue-100 border-blue-300 focus:ring-offset-blue-50 focus:ring-blue-600",
56
+ "success": "text-green-800 bg-green-50 hover:bg-green-100 border-green-300 focus:ring-offset-green-50 focus:ring-green-600",
57
+ "warning": "text-yellow-800 bg-yellow-50 hover:bg-yellow-100 border-yellow-300 focus:ring-offset-yellow-50 focus:ring-yellow-600",
58
+ "danger": "text-red-800 bg-red-50 hover:bg-red-100 border-red-300 focus:ring-offset-red-50 focus:ring-red-600"
59
+ },
60
+ "VALID_SCHEMES": [
61
+ "default",
62
+ "info",
63
+ "success",
64
+ "warning",
65
+ "danger"
66
+ ]
67
+ },
68
+ "Ariadne::ClipboardCopyComponent": {
69
+ "DATA_ACTION": "click->clipboard_copy_component#copy",
70
+ "DATA_CONTROLLER": "clipboard_copy_component",
71
+ "DEFAULT_TAG": "clipboard-copy"
72
+ },
73
+ "Ariadne::Content": {
74
+ },
75
+ "Ariadne::CounterComponent": {
76
+ "DEFAULT_CLASSES": "inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-gray-600 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
77
+ },
78
+ "Ariadne::FlashComponent": {
79
+ "BG_SCHEME_CLASS_MAPPINGS": {
80
+ "default": "bg-blue-50",
81
+ "info": "bg-blue-50",
82
+ "success": "bg-green-50",
83
+ "warning": "bg-yellow-50",
84
+ "danger": "bg-red-50"
85
+ },
86
+ "CONTENT_SCHEME_CLASS_MAPPINGS": {
87
+ "default": "text-blue-700",
88
+ "info": "text-blue-700",
89
+ "success": "text-green-700",
90
+ "warning": "text-yellow-700",
91
+ "danger": "text-red-700"
92
+ },
93
+ "DEFAULT_SCHEME": "default",
94
+ "DISMISSIBLE_SCHEME_CLASS_MAPPINGS": {
95
+ "default": "text-blue-500 bg-blue-50 hover:bg-blue-100 focus:ring-offset-blue-50 focus:ring-blue-600",
96
+ "info": "text-blue-500 bg-blue-50 hover:bg-blue-100 focus:ring-offset-blue-50 focus:ring-blue-600",
97
+ "success": "text-green-500 bg-green-50 hover:bg-green-100 focus:ring-offset-green-50 focus:ring-green-600",
98
+ "warning": "text-yellow-500 bg-yellow-50 hover:bg-yellow-100 focus:ring-offset-yellow-50 focus:ring-yellow-600",
99
+ "danger": "text-red-500 bg-red-50 hover:bg-red-100 focus:ring-offset-red-50 focus:ring-red-600"
100
+ },
101
+ "VALID_BG_SCHEMES": [
102
+ "default",
103
+ "info",
104
+ "success",
105
+ "warning",
106
+ "danger"
107
+ ],
108
+ "VALID_CONTENT_SCHEMES": [
109
+ "default",
110
+ "info",
111
+ "success",
112
+ "warning",
113
+ "danger"
114
+ ],
115
+ "VALID_DISMISSIBLE_SCHEMES": [
116
+ "default",
117
+ "info",
118
+ "success",
119
+ "warning",
120
+ "danger"
121
+ ]
122
+ },
123
+ "Ariadne::HeadingComponent": {
124
+ "TAG_OPTIONS": [
125
+ "h1",
126
+ "h2",
127
+ "h3",
128
+ "h4",
129
+ "h5",
130
+ "h6"
131
+ ],
132
+ "TAG_TO_CLASSES": {
133
+ "h1": "font-bold leading-7 sm:text-3xl sm:truncate",
134
+ "h2": "text-3xl font-extrabold text-gray-900",
135
+ "h3": "text-2xl font-extrabold text-gray-900"
136
+ }
137
+ },
138
+ "Ariadne::HeroiconComponent": {
139
+ "PRELOADED_ICONS": [
140
+ {
141
+ "name": "bell",
142
+ "variant": "outline"
143
+ },
144
+ {
145
+ "name": "check",
146
+ "variant": "outline"
147
+ },
148
+ {
149
+ "name": "chevron-down",
150
+ "variant": "outline"
151
+ },
152
+ {
153
+ "name": "clipboard",
154
+ "variant": "outline"
155
+ },
156
+ {
157
+ "name": "clock",
158
+ "variant": "outline"
159
+ },
160
+ {
161
+ "name": "information-circle",
162
+ "variant": "outline"
163
+ },
164
+ {
165
+ "name": "dots-horizontal",
166
+ "variant": "outline"
167
+ },
168
+ {
169
+ "name": "link",
170
+ "variant": "outline"
171
+ },
172
+ {
173
+ "name": "lock-closed",
174
+ "variant": "outline"
175
+ },
176
+ {
177
+ "name": "mail",
178
+ "variant": "outline"
179
+ },
180
+ {
181
+ "name": "pencil",
182
+ "variant": "outline"
183
+ },
184
+ {
185
+ "name": "plus-sm",
186
+ "variant": "outline"
187
+ },
188
+ {
189
+ "name": "question-mark-circle",
190
+ "variant": "outline"
191
+ },
192
+ {
193
+ "name": "search",
194
+ "variant": "outline"
195
+ },
196
+ {
197
+ "name": "search",
198
+ "variant": "outline"
199
+ },
200
+ {
201
+ "name": "trash",
202
+ "variant": "outline"
203
+ },
204
+ {
205
+ "name": "x",
206
+ "variant": "outline"
207
+ }
208
+ ],
209
+ "SIZE_DEFAULT": "small",
210
+ "SIZE_MAPPINGS": {
211
+ "small": 16,
212
+ "medium": 24
213
+ },
214
+ "SIZE_MEDIUM": "medium",
215
+ "SIZE_OPTIONS": [
216
+ "small",
217
+ "medium"
218
+ ]
219
+ },
220
+ "Ariadne::ImageComponent": {
221
+ },
222
+ "Ariadne::Text": {
223
+ "DEFAULT_TAG": "span"
224
+ },
225
+ "Ariadne::TooltipComponent": {
226
+ "DIRECTION_DEFAULT": "s",
227
+ "DIRECTION_OPTIONS": [
228
+ "s",
229
+ "n",
230
+ "e",
231
+ "w",
232
+ "ne",
233
+ "nw",
234
+ "se",
235
+ "sw"
236
+ ],
237
+ "TYPE_DEFAULT": "description",
238
+ "TYPE_OPTIONS": [
239
+ "label",
240
+ "description"
241
+ ]
242
+ }
243
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Ariadne::BaseButton": "stable",
3
+ "Ariadne::BaseComponent": "stable",
4
+ "Ariadne::ButtonComponent": "stable",
5
+ "Ariadne::ClipboardCopyComponent": "stable",
6
+ "Ariadne::Content": "stable",
7
+ "Ariadne::CounterComponent": "stable",
8
+ "Ariadne::FlashComponent": "stable",
9
+ "Ariadne::HeadingComponent": "stable",
10
+ "Ariadne::HeroiconComponent": "stable",
11
+ "Ariadne::ImageComponent": "stable",
12
+ "Ariadne::Text": "stable",
13
+ "Ariadne::TooltipComponent": "stable"
14
+ }