tybo 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +23 -0
  4. data/Rakefile +8 -0
  5. data/app/assets/config/tybo_manifest.js +1 -0
  6. data/app/assets/stylesheets/tybo/application.css +15 -0
  7. data/{lib/app → app}/components/attachment_card_component.html.erb +0 -0
  8. data/{lib/app → app}/components/attachment_card_component.rb +0 -0
  9. data/{lib/app → app}/components/attachments_list_component.html.erb +0 -0
  10. data/{lib/app → app}/components/attachments_list_component.rb +0 -0
  11. data/{lib/app → app}/components/current_user_mini_card_component.html.erb +2 -2
  12. data/{lib/app → app}/components/current_user_mini_card_component.rb +0 -0
  13. data/{lib/app → app}/components/form_component.html.erb +0 -0
  14. data/{lib/app → app}/components/form_component.rb +0 -0
  15. data/{lib/app → app}/components/forms/breadcrumb_component.html.erb +0 -0
  16. data/{lib/app → app}/components/forms/breadcrumb_component.rb +0 -0
  17. data/{lib/app → app}/components/forms/delete_button_component.html.erb +0 -0
  18. data/{lib/app → app}/components/forms/delete_button_component.rb +0 -0
  19. data/{lib/app → app}/components/forms/divider_component.html.erb +0 -0
  20. data/{lib/app → app}/components/forms/divider_component.rb +0 -0
  21. data/{lib/app → app}/components/forms/submit_button_component.html.erb +0 -0
  22. data/{lib/app → app}/components/forms/submit_button_component.rb +0 -0
  23. data/{lib/app → app}/components/forms/subtitle_component.html.erb +0 -0
  24. data/{lib/app → app}/components/forms/subtitle_component.rb +0 -0
  25. data/{lib/app → app}/components/forms/title_component.html.erb +0 -0
  26. data/{lib/app → app}/components/forms/title_component.rb +0 -0
  27. data/{lib/app → app}/components/icons/collection_component.html.erb +0 -0
  28. data/{lib/app → app}/components/icons/collection_component.rb +0 -0
  29. data/{lib/app → app}/components/icons/home_component.html.erb +0 -0
  30. data/{lib/app → app}/components/icons/home_component.rb +0 -0
  31. data/{lib/app → app}/components/icons/mic_component.html.erb +0 -0
  32. data/{lib/app → app}/components/icons/mic_component.rb +0 -0
  33. data/{lib/app → app}/components/icons/news_paper_component.html.erb +0 -0
  34. data/{lib/app → app}/components/icons/news_paper_component.rb +0 -0
  35. data/{lib/app → app}/components/icons/office_building_component.html.erb +0 -0
  36. data/{lib/app → app}/components/icons/office_building_component.rb +0 -0
  37. data/{lib/app → app}/components/icons/question_mark_circle_component.html.erb +0 -0
  38. data/{lib/app → app}/components/icons/question_mark_circle_component.rb +0 -0
  39. data/{lib/app → app}/components/icons/trash_component.html.erb +0 -0
  40. data/{lib/app → app}/components/icons/trash_component.rb +0 -0
  41. data/{lib/app → app}/components/icons/users_component.html.erb +0 -0
  42. data/{lib/app → app}/components/icons/users_component.rb +0 -0
  43. data/{lib/app → app}/components/index_component.html.erb +0 -0
  44. data/{lib/app → app}/components/index_component.rb +0 -0
  45. data/{lib/app → app}/components/index_header_add_component.html.erb +0 -0
  46. data/{lib/app → app}/components/index_header_add_component.rb +0 -0
  47. data/{lib/app → app}/components/index_header_component.html.erb +0 -0
  48. data/{lib/app → app}/components/index_header_component.rb +0 -0
  49. data/{lib/app → app}/components/input/file_component.html.erb +0 -0
  50. data/{lib/app → app}/components/input/file_component.rb +0 -0
  51. data/{lib/app → app}/components/sidebar_component.html.erb +0 -0
  52. data/{lib/app → app}/components/sidebar_component.rb +0 -0
  53. data/{lib/app → app}/components/sidebar_item_component.html.erb +0 -0
  54. data/{lib/app → app}/components/sidebar_item_component.rb +0 -0
  55. data/{lib/app → app}/components/sign_out_button_component.html.erb +1 -1
  56. data/{lib/app → app}/components/sign_out_button_component.rb +3 -0
  57. data/{lib/app → app}/components/tables/active_record_th_component.html.erb +0 -0
  58. data/{lib/app → app}/components/tables/active_record_th_component.rb +1 -0
  59. data/{lib/app → app}/components/tables/table_component.html.erb +0 -0
  60. data/{lib/app → app}/components/tables/table_component.rb +0 -0
  61. data/{lib/app → app}/components/tables/tbody_component.html.erb +0 -0
  62. data/{lib/app → app}/components/tables/tbody_component.rb +0 -0
  63. data/{lib/app → app}/components/tables/td_component.html.erb +1 -1
  64. data/{lib/app → app}/components/tables/td_component.rb +0 -0
  65. data/{lib/app → app}/components/tables/th_component.html.erb +0 -0
  66. data/{lib/app → app}/components/tables/th_component.rb +0 -0
  67. data/{lib/app → app}/components/tables/thead_component.html.erb +0 -0
  68. data/{lib/app → app}/components/tables/thead_component.rb +0 -0
  69. data/{lib/app → app}/components/tables/tr_component.html.erb +0 -0
  70. data/{lib/app → app}/components/tables/tr_component.rb +0 -0
  71. data/app/controllers/tybo/application_controller.rb +4 -0
  72. data/app/controllers/tybo/login_controller.rb +8 -0
  73. data/app/helpers/tybo/application_helper.rb +5 -0
  74. data/app/helpers/tybo/flash_helper.rb +12 -0
  75. data/app/jobs/tybo/application_job.rb +4 -0
  76. data/app/mailers/tybo/application_mailer.rb +6 -0
  77. data/app/models/tybo/application_record.rb +5 -0
  78. data/app/views/devise/confirmations/new.html.erb +20 -0
  79. data/app/views/devise/login/home.html.erb +20 -0
  80. data/app/views/devise/mailer/_reset_password_instructions.html.erb +8 -0
  81. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  82. data/app/views/devise/mailer/email_changed.html.erb +7 -0
  83. data/app/views/devise/mailer/password_change.html.erb +3 -0
  84. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  85. data/app/views/devise/passwords/edit.html.erb +36 -0
  86. data/app/views/devise/passwords/new.html.erb +34 -0
  87. data/app/views/devise/registrations/edit.html.erb +35 -0
  88. data/app/views/devise/registrations/new.html.erb +25 -0
  89. data/app/views/devise/sessions/new.html.erb +50 -0
  90. data/app/views/devise/shared/_devise_errors.html.erb +26 -0
  91. data/app/views/devise/shared/_error_messages.html.erb +15 -0
  92. data/app/views/devise/shared/_links.html.erb +65 -0
  93. data/app/views/devise/unlocks/new.html.erb +19 -0
  94. data/app/views/layouts/_errors.html.erb +22 -0
  95. data/app/views/layouts/_flash.html.erb +24 -0
  96. data/app/views/layouts/devise_admin.html.erb +16 -0
  97. data/app/views/layouts/tybo/application.html.erb +14 -0
  98. data/app/views/login/home.html.erb +19 -0
  99. data/app/views/shared/_pagination.html.erb +36 -0
  100. data/config/initializers/devise.rb +311 -0
  101. data/config/initializers/pagy.rb +246 -0
  102. data/config/initializers/ransack.rb +13 -0
  103. data/config/locales/devise.en.yml +65 -0
  104. data/config/routes.rb +3 -0
  105. data/lib/generators/bo/USAGE +12 -0
  106. data/lib/generators/bo/bo_generator.rb +88 -0
  107. data/lib/generators/bo/templates/_form.html.erb +32 -0
  108. data/lib/generators/bo/templates/_search_bar.html.erb +96 -0
  109. data/lib/generators/bo/templates/_table.html.erb +29 -0
  110. data/lib/generators/bo/templates/controller.rb +66 -0
  111. data/lib/generators/bo/templates/index.html.erb +19 -0
  112. data/lib/generators/bo/templates/item.html.erb +17 -0
  113. data/lib/generators/bo/templates/new.html.erb +1 -0
  114. data/lib/generators/bo/templates/show.html.erb +1 -0
  115. data/lib/generators/bo/utils/files/fr.json +19 -0
  116. data/lib/generators/bo/utils/translations.rb +47 -0
  117. data/lib/generators/bo_namespace/USAGE +11 -0
  118. data/lib/generators/bo_namespace/bo_namespace_generator.rb +50 -0
  119. data/lib/generators/bo_namespace/templates/admin.html.erb +27 -0
  120. data/lib/generators/bo_namespace/templates/admin_controller.rb +7 -0
  121. data/lib/generators/bo_namespace/templates/seeds.rb +9 -0
  122. data/lib/generators/bo_namespace/templates/side_bar.html.erb +4 -0
  123. data/lib/generators/tybo_install/templates/application.tailwind.css +112 -0
  124. data/lib/generators/tybo_install/templates/simple_form_tailwind.rb +147 -0
  125. data/lib/generators/tybo_install/templates/tailwind.config.js +40 -0
  126. data/lib/generators/tybo_install/templates/tom-select.css +458 -0
  127. data/lib/generators/tybo_install/tybo_install_generator.rb +44 -0
  128. data/lib/tybo/engine.rb +19 -0
  129. data/lib/tybo/version.rb +3 -0
  130. data/lib/tybo.rb +4 -43
  131. metadata +186 -98
  132. data/lib/app/helpers/application_helper.rb +0 -5
  133. data/lib/app/helpers/flash_helper.rb +0 -16
  134. data/lib/app/javascript/controllers/attachments_controller.js +0 -14
  135. data/lib/app/javascript/controllers/dropdown_controller.js +0 -15
  136. data/lib/app/javascript/controllers/flash_controller.js +0 -7
  137. data/lib/app/javascript/controllers/index.js +0 -6
  138. data/lib/app/javascript/controllers/questions_controller.js +0 -61
  139. data/lib/app/javascript/controllers/search_form_controller.js +0 -20
  140. data/lib/app/javascript/controllers/ts/search_controller.js +0 -35
  141. data/lib/app/javascript/controllers/ts/select_controller.js +0 -9
@@ -0,0 +1,458 @@
1
+ :root {
2
+ --ts-pr-clear-button: 0;
3
+ --ts-pr-caret: 0;
4
+ --ts-pr-min: .75rem;
5
+ }
6
+
7
+ .ts-wrapper.single .ts-control,
8
+ .ts-wrapper.single .ts-control input {
9
+ cursor: pointer;
10
+ }
11
+
12
+ .ts-control {
13
+ padding-right: max(var(--ts-pr-min), var(--ts-pr-clear-button) + var(--ts-pr-caret)) !important;
14
+ }
15
+
16
+ .ts-wrapper.plugin-drag_drop.multi>.ts-control>div.ui-sortable-placeholder {
17
+ visibility: visible !important;
18
+ background: #f2f2f2 !important;
19
+ background: rgba(0, 0, 0, 0.06) !important;
20
+ border: 0 none !important;
21
+ box-shadow: inset 0 0 12px 4px #fff;
22
+ }
23
+
24
+ .ts-wrapper.plugin-drag_drop .ui-sortable-placeholder::after {
25
+ content: "!";
26
+ visibility: hidden;
27
+ }
28
+
29
+ .ts-wrapper.plugin-drag_drop .ui-sortable-helper {
30
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
31
+ }
32
+
33
+ .plugin-checkbox_options .option input {
34
+ margin-right: 0.5rem;
35
+ }
36
+
37
+ .plugin-clear_button {
38
+ --ts-pr-clear-button: 1em;
39
+ }
40
+
41
+ .plugin-clear_button .clear-button {
42
+ opacity: 0;
43
+ position: absolute;
44
+ top: 50%;
45
+ transform: translateY(-50%);
46
+ right: calc(8px - 6px);
47
+ margin-right: 0 !important;
48
+ background: transparent !important;
49
+ transition: opacity 0.5s;
50
+ cursor: pointer;
51
+ }
52
+
53
+ .plugin-clear_button.form-select .clear-button,
54
+ .plugin-clear_button.single .clear-button {
55
+ right: max(var(--ts-pr-caret), 8px);
56
+ }
57
+
58
+ .plugin-clear_button.focus.has-items .clear-button,
59
+ .plugin-clear_button:not(.disabled):hover.has-items .clear-button {
60
+ opacity: 1;
61
+ }
62
+
63
+ .ts-wrapper .dropdown-header {
64
+ position: relative;
65
+ padding: 10px 8px;
66
+ border-bottom: 1px solid #d0d0d0;
67
+ background: #f8f8f8;
68
+ border-radius: 3px 3px 0 0;
69
+ }
70
+
71
+ .ts-wrapper .dropdown-header-close {
72
+ position: absolute;
73
+ right: 8px;
74
+ top: 50%;
75
+ color: #303030;
76
+ opacity: 0.4;
77
+ margin-top: -12px;
78
+ line-height: 20px;
79
+ font-size: 20px !important;
80
+ }
81
+
82
+ .ts-wrapper .dropdown-header-close:hover {
83
+ color: black;
84
+ }
85
+
86
+ .plugin-dropdown_input.focus.dropdown-active .ts-control {
87
+ box-shadow: none;
88
+ border: 1px solid #d0d0d0;
89
+ }
90
+
91
+ .plugin-dropdown_input .dropdown-input {
92
+ border: 1px solid #d0d0d0;
93
+ border-width: 0 0 1px 0;
94
+ display: block;
95
+ padding: 8px 8px;
96
+ box-shadow: none;
97
+ width: 100%;
98
+ background: transparent;
99
+ }
100
+
101
+ .plugin-dropdown_input .items-placeholder {
102
+ border: 0 none !important;
103
+ box-shadow: none !important;
104
+ width: 100%;
105
+ }
106
+
107
+ .plugin-dropdown_input.has-items .items-placeholder,
108
+ .plugin-dropdown_input.dropdown-active .items-placeholder {
109
+ display: none !important;
110
+ }
111
+
112
+ .ts-wrapper.plugin-input_autogrow.has-items .ts-control>input {
113
+ min-width: 0;
114
+ }
115
+
116
+ .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input {
117
+ flex: none;
118
+ min-width: 4px;
119
+ }
120
+
121
+ .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input::-ms-input-placeholder {
122
+ color: transparent;
123
+ }
124
+
125
+ .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control>input::placeholder {
126
+ color: transparent;
127
+ }
128
+
129
+ .ts-dropdown.plugin-optgroup_columns .ts-dropdown-content {
130
+ display: flex;
131
+ }
132
+
133
+ .ts-dropdown.plugin-optgroup_columns .optgroup {
134
+ border-right: 1px solid #f2f2f2;
135
+ border-top: 0 none;
136
+ flex-grow: 1;
137
+ flex-basis: 0;
138
+ min-width: 0;
139
+ }
140
+
141
+ .ts-dropdown.plugin-optgroup_columns .optgroup:last-child {
142
+ border-right: 0 none;
143
+ }
144
+
145
+ .ts-dropdown.plugin-optgroup_columns .optgroup:before {
146
+ display: none;
147
+ }
148
+
149
+ .ts-dropdown.plugin-optgroup_columns .optgroup-header {
150
+ border-top: 0 none;
151
+ }
152
+
153
+ .ts-wrapper.plugin-remove_button .item {
154
+ display: inline-flex;
155
+ align-items: center;
156
+ padding-right: 0 !important;
157
+ }
158
+
159
+ .ts-wrapper.plugin-remove_button .item .remove {
160
+ color: inherit;
161
+ text-decoration: none;
162
+ vertical-align: middle;
163
+ display: inline-block;
164
+ padding: 0 6px;
165
+ border-radius: 0 2px 2px 0;
166
+ box-sizing: border-box;
167
+ }
168
+
169
+ .ts-wrapper.plugin-remove_button .item .remove:hover {
170
+ background: rgba(0, 0, 0, 0.05);
171
+ }
172
+
173
+ .ts-wrapper.plugin-remove_button.disabled .item .remove:hover {
174
+ background: none;
175
+ }
176
+
177
+ .ts-wrapper.plugin-remove_button .remove-single {
178
+ position: absolute;
179
+ right: 0;
180
+ top: 0;
181
+ font-size: 23px;
182
+ }
183
+
184
+ .ts-wrapper.plugin-remove_button:not(.rtl) .item .remove {
185
+ border-left: 1px solid #d0d0d0;
186
+ margin-left: 6px;
187
+ }
188
+
189
+ .ts-wrapper.plugin-remove_button:not(.rtl) .item.active .remove {
190
+ border-left-color: #cacaca;
191
+ }
192
+
193
+ .ts-wrapper.plugin-remove_button:not(.rtl).disabled .item .remove {
194
+ border-left-color: white;
195
+ }
196
+
197
+ .ts-wrapper.plugin-remove_button.rtl .item .remove {
198
+ border-right: 1px solid #d0d0d0;
199
+ margin-right: 6px;
200
+ }
201
+
202
+ .ts-wrapper.plugin-remove_button.rtl .item.active .remove {
203
+ border-right-color: #cacaca;
204
+ }
205
+
206
+ .ts-wrapper.plugin-remove_button.rtl.disabled .item .remove {
207
+ border-right-color: white;
208
+ }
209
+
210
+ .ts-wrapper {
211
+ position: relative;
212
+ }
213
+
214
+ .ts-dropdown,
215
+ .ts-control,
216
+ .ts-control input {
217
+ color: #303030;
218
+ font-family: inherit;
219
+ font-size: 13px;
220
+ line-height: 18px;
221
+ font-smoothing: inherit;
222
+ }
223
+
224
+ .ts-control,
225
+ .ts-wrapper.single.input-active .ts-control {
226
+ background: #fff;
227
+ cursor: text;
228
+ }
229
+
230
+ .ts-control {
231
+ border: 1px solid #d0d0d0;
232
+ padding: 8px 8px;
233
+ width: 100%;
234
+ overflow: hidden;
235
+ position: relative;
236
+ z-index: 1;
237
+ box-sizing: border-box;
238
+ box-shadow: none;
239
+ border-radius: 3px;
240
+ display: flex;
241
+ flex-wrap: wrap;
242
+ }
243
+
244
+ .ts-wrapper.multi.has-items .ts-control {
245
+ padding: calc(8px - 2px - 0px) 8px calc(8px - 2px - 3px - 0px);
246
+ }
247
+
248
+ .full .ts-control {
249
+ background-color: #fff;
250
+ }
251
+
252
+ .disabled .ts-control,
253
+ .disabled .ts-control * {
254
+ cursor: default !important;
255
+ }
256
+
257
+ .focus .ts-control {
258
+ box-shadow: none;
259
+ }
260
+
261
+ .ts-control>* {
262
+ vertical-align: baseline;
263
+ display: inline-block;
264
+ }
265
+
266
+ .ts-wrapper.multi .ts-control>div {
267
+ cursor: pointer;
268
+ margin: 0 3px 3px 0;
269
+ padding: 2px 6px;
270
+ background: #f2f2f2;
271
+ color: #303030;
272
+ border: 0px solid #d0d0d0;
273
+ }
274
+
275
+ .ts-wrapper.multi .ts-control>div.active {
276
+ background: #e8e8e8;
277
+ color: #303030;
278
+ border: 0px solid #cacaca;
279
+ }
280
+
281
+ .ts-wrapper.multi.disabled .ts-control>div,
282
+ .ts-wrapper.multi.disabled .ts-control>div.active {
283
+ color: #7d7d7d;
284
+ background: white;
285
+ border: 0px solid white;
286
+ }
287
+
288
+ .ts-control>input {
289
+ flex: 1 1 auto;
290
+ min-width: 7rem;
291
+ display: inline-block !important;
292
+ padding: 0 !important;
293
+ min-height: 0 !important;
294
+ max-height: none !important;
295
+ max-width: 100% !important;
296
+ margin: 0 !important;
297
+ text-indent: 0 !important;
298
+ border: 0 none !important;
299
+ background: none !important;
300
+ line-height: inherit !important;
301
+ -webkit-user-select: auto !important;
302
+ -moz-user-select: auto !important;
303
+ -ms-user-select: auto !important;
304
+ user-select: auto !important;
305
+ box-shadow: none !important;
306
+ }
307
+
308
+ .ts-control>input::-ms-clear {
309
+ display: none;
310
+ }
311
+
312
+ .ts-control>input:focus {
313
+ outline: none !important;
314
+ }
315
+
316
+ .has-items .ts-control>input {
317
+ margin: 0px 4px !important;
318
+ }
319
+
320
+ .ts-control.rtl {
321
+ text-align: right;
322
+ }
323
+
324
+ .ts-control.rtl.single .ts-control:after {
325
+ left: 15px;
326
+ right: auto;
327
+ }
328
+
329
+ .ts-control.rtl .ts-control>input {
330
+ margin: 0px 4px 0px -2px !important;
331
+ }
332
+
333
+ .disabled .ts-control {
334
+ opacity: 0.5;
335
+ background-color: #fafafa;
336
+ }
337
+
338
+ .input-hidden .ts-control>input {
339
+ opacity: 0;
340
+ position: absolute;
341
+ left: -10000px;
342
+ }
343
+
344
+ .ts-dropdown {
345
+ position: absolute;
346
+ top: 100%;
347
+ left: 0;
348
+ width: 100%;
349
+ z-index: 10;
350
+ border: 1px solid #d0d0d0;
351
+ background: #fff;
352
+ margin: 0.25rem 0 0 0;
353
+ border-top: 0 none;
354
+ box-sizing: border-box;
355
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
356
+ border-radius: 0 0 3px 3px;
357
+ }
358
+
359
+ .ts-dropdown [data-selectable] {
360
+ cursor: pointer;
361
+ overflow: hidden;
362
+ }
363
+
364
+ .ts-dropdown [data-selectable] .highlight {
365
+ background: rgba(125, 168, 208, 0.2);
366
+ border-radius: 1px;
367
+ }
368
+
369
+ .ts-dropdown .option,
370
+ .ts-dropdown .optgroup-header,
371
+ .ts-dropdown .no-results,
372
+ .ts-dropdown .create {
373
+ padding: 5px 8px;
374
+ }
375
+
376
+ .ts-dropdown .option,
377
+ .ts-dropdown [data-disabled],
378
+ .ts-dropdown [data-disabled] [data-selectable].option {
379
+ cursor: inherit;
380
+ opacity: 0.5;
381
+ }
382
+
383
+ .ts-dropdown [data-selectable].option {
384
+ opacity: 1;
385
+ cursor: pointer;
386
+ }
387
+
388
+ .ts-dropdown .optgroup:first-child .optgroup-header {
389
+ border-top: 0 none;
390
+ }
391
+
392
+ .ts-dropdown .optgroup-header {
393
+ color: #303030;
394
+ background: #fff;
395
+ cursor: default;
396
+ }
397
+
398
+ .ts-dropdown .active {
399
+ background-color: #f5fafd;
400
+ color: #495c68;
401
+ }
402
+
403
+ .ts-dropdown .active.create {
404
+ color: #495c68;
405
+ }
406
+
407
+ .ts-dropdown .create {
408
+ color: rgba(48, 48, 48, 0.5);
409
+ }
410
+
411
+ .ts-dropdown .spinner {
412
+ display: inline-block;
413
+ width: 30px;
414
+ height: 30px;
415
+ margin: 5px 8px;
416
+ }
417
+
418
+ .ts-dropdown .spinner:after {
419
+ content: " ";
420
+ display: block;
421
+ width: 24px;
422
+ height: 24px;
423
+ margin: 3px;
424
+ border-radius: 50%;
425
+ border: 5px solid #d0d0d0;
426
+ border-color: #d0d0d0 transparent #d0d0d0 transparent;
427
+ animation: lds-dual-ring 1.2s linear infinite;
428
+ }
429
+
430
+ @keyframes lds-dual-ring {
431
+ 0% {
432
+ transform: rotate(0deg);
433
+ }
434
+
435
+ 100% {
436
+ transform: rotate(360deg);
437
+ }
438
+ }
439
+
440
+ .ts-dropdown-content {
441
+ overflow-y: auto;
442
+ overflow-x: hidden;
443
+ max-height: 200px;
444
+ /* overflow-scrolling: touch; */
445
+ scroll-behavior: smooth;
446
+ }
447
+
448
+ .ts-hidden-accessible {
449
+ border: 0 !important;
450
+ clip: rect(0 0 0 0) !important;
451
+ -webkit-clip-path: inset(50%) !important;
452
+ clip-path: inset(50%) !important;
453
+ overflow: hidden !important;
454
+ padding: 0 !important;
455
+ position: absolute !important;
456
+ width: 1px !important;
457
+ white-space: nowrap !important;
458
+ }
@@ -0,0 +1,44 @@
1
+
2
+ class TyboInstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("templates", __dir__)
4
+
5
+ def install_dependencies
6
+ gem 'tailwindcss-rails', '~> 2.0', '>= 2.0.21' unless Bundler.locked_gems.specs.any? { |gem| gem.name == 'tailwindcss-rails' }
7
+ gem 'simple_form' unless Bundler.locked_gems.specs.any? { |gem| gem.name == 'simple_form' }
8
+ gem 'simple_form-tailwind', '~> 0.1.1' unless Bundler.locked_gems.specs.any? { |gem| gem.name == 'simple_form-tailwind' }
9
+ run 'bundle install'
10
+ run "rails tailwindcss:install"
11
+ end
12
+
13
+ def create_configuration_files
14
+ template 'application.tailwind.css', File.join('app/assets/stylesheets/application.tailwind.css'), force: true
15
+ template 'tailwind.config.js', File.join('config/tailwind.config.js'), force: true
16
+ template 'tom-select.css', File.join('app/assets/stylesheets/tom-select.css')
17
+ template 'simple_form_tailwind.rb', File.join('config/initializers/simple_form_tailwind.rb')
18
+ end
19
+
20
+ def pin_js_dependencies
21
+ run "./bin/importmap pin tom-select --download"
22
+ run "./bin/importmap pin @tymate/tybo"
23
+ end
24
+
25
+ def create_routes
26
+ route "root to: 'tybo/login#home'"
27
+ route "mount Tybo::Engine => \"/tybo\""
28
+ end
29
+
30
+ def install_administrators
31
+ run 'rails g bo_namespace Administrator'
32
+ end
33
+
34
+ def add_javascript_controllers
35
+ inject_into_file 'app/javascript/controllers/application.js', after: "const application = Application.start()\n" do
36
+ "import { Dropdown, Flash, SearchForm, TsSearch, TsSelect } from \"@tymate/tybo\"\n"
37
+ end
38
+
39
+ inject_into_file 'app/javascript/controllers/application.js', before: "export { application }" do
40
+ "application.register('dropdown', Dropdown)\napplication.register('flash', Flash)\napplication.register('search-form', SearchForm)\napplication.register('ts--search', TsSearch)\napplication.register('ts--select', TsSelect)\n"
41
+ end
42
+ end
43
+ end
44
+
@@ -0,0 +1,19 @@
1
+ require 'devise'
2
+ require 'pagy'
3
+ require 'ransack'
4
+ require 'view_component'
5
+
6
+ module Tybo
7
+ class Engine < ::Rails::Engine
8
+ # Devise
9
+ config.to_prepare do
10
+ Devise::ConfirmationsController.layout "devise_admin"
11
+ Devise::OmniauthCallbacksController.layout "devise_admin"
12
+ Devise::PasswordsController.layout "devise_admin"
13
+ Devise::RegistrationsController.layout "devise_admin"
14
+ Devise::SessionsController.layout "devise_admin"
15
+ Devise::UnlocksController.layout "devise_admin"
16
+ end
17
+ end
18
+ end
19
+
@@ -0,0 +1,3 @@
1
+ module Tybo
2
+ VERSION = "0.0.4"
3
+ end
data/lib/tybo.rb CHANGED
@@ -1,45 +1,6 @@
1
- autoload 'AttachmentCardComponent', 'app/components/attachment_card_component'
2
- autoload 'AttachmentsListComponent', 'app/components/attachments_list_component'
3
- autoload 'CurrentUserMiniCardComponent', 'app/components/current_user_mini_card_component'
4
- autoload 'FormComponent', 'app/components/form_component'
5
- autoload 'IndexComponent', 'app/components/index_component'
6
- autoload 'IndexHeaderAddComponent', 'app/components/index_header_add_component'
7
- autoload 'IndexHeaderComponent', 'app/components/index_header_component'
8
- autoload 'SidebarComponent', 'app/components/sidebar_component'
9
- autoload 'SidebarItemComponent', 'app/components/sidebar_item_component'
10
- autoload 'SignOutButtonComponent', 'app/components/sign_out_button_component'
11
- autoload 'ModalComponent', 'app/components/modal_component'
1
+ require "tybo/version"
2
+ require "tybo/engine"
12
3
 
13
- module Forms
14
- autoload 'BreadcrumbComponent', 'app/components/forms/breadcrumb_component'
15
- autoload 'DeleteButtonComponent', 'app/components/forms/delete_button_component'
16
- autoload 'DividerComponent', 'app/components/forms/divider_component'
17
- autoload 'SubmitButtonComponent', 'app/components/forms/submit_button_component'
18
- autoload 'SubtitleComponent', 'app/components/forms/subtitle_component'
19
- autoload 'TitleComponent', 'app/components/forms/title_component'
20
- end
21
-
22
- module Icons
23
- autoload 'CollectionComponent', 'app/components/icons/collection_component'
24
- autoload 'HomeComponent', 'app/components/icons/home_component'
25
- autoload 'MicComponent', 'app/components/icons/mic_component'
26
- autoload 'NewsPaperComponent', 'app/components/icons/news_paper_component'
27
- autoload 'OfficeBuildingComponent', 'app/components/icons/office_building_component'
28
- autoload 'QuestionMarkCircleComponent', 'app/components/icons/question_mark_circle_component'
29
- autoload 'TrashComponent', 'app/components/icons/trash_component'
30
- autoload 'UsersComponent', 'app/components/icons/users_component'
31
- end
32
-
33
- module Input
34
- autoload 'FileComponent', 'app/components/input/file_component'
35
- end
36
-
37
- module Tables
38
- autoload 'TableComponent', 'app/components/tables/table_component'
39
- autoload 'TbodyComponent', 'app/components/tables/tbody_component'
40
- autoload 'TdComponent', 'app/components/tables/td_component'
41
- autoload 'ThComponent', 'app/components/tables/th_component'
42
- autoload 'TheadComponent', 'app/components/tables/thead_component'
43
- autoload 'TrComponent', 'app/components/tables/tr_component'
44
- autoload 'ActiveRecordTotoComponent', 'app/components/tables/active_record_toto_component'
4
+ module Tybo
5
+ # Your code goes here...
45
6
  end